refund.vue 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330
  1. <template>
  2. <view class="content">
  3. <view class="box">
  4. <block v-for="(item,index) in pageList" :key="index">
  5. <view class="box_item">
  6. <view class="hflex acenter jbetween cell">
  7. <view class="hflex acenter" @click="toShop(item.admin_id)">
  8. <view class="title">{{item.admin_name}}</view>
  9. <u-icon color="#B5B5B5" name="arrow-right" size="10"></u-icon>
  10. </view>
  11. <view class="top_name">{{item.refund_type || ''}}</view>
  12. </view>
  13. <view>
  14. <view class="hflex acenter" v-if="item.goods_item.length == 1">
  15. <view>
  16. <image :src="item.goods_item[0].goods_cover" mode="aspectFill" class="img"></image>
  17. </view>
  18. <view class="img_right">
  19. <view class="name text_hide">{{item.goods_item[0].goods_name}}</view>
  20. <view class="norm text_hide">{{item.goods_item[0].goods_spec}}</view>
  21. <view class="price">退款¥<span style="font-size: 32rpx;">{{item.refund_money}}</span></view>
  22. </view>
  23. </view>
  24. <view class="scroll_img" v-else>
  25. <scroll-view scroll-x="true" style="white-space: nowrap;" class="imgs hflex">
  26. <block v-for="(item2,index2) in item.goods_item" :key="index2">
  27. <view class="imgs_item">
  28. <image :src="item2.goods_cover" class="img"></image>
  29. </view>
  30. </block>
  31. </scroll-view>
  32. <view class="img_leng">共{{item.goods_item.length}}件</view>
  33. </view>
  34. </view>
  35. <!-- <view class="hflex acenter jend cell">
  36. <view class="price">退款:¥{{item.rebate_amount}}</view>
  37. </view> -->
  38. <view class="box_bg hflex acenter">
  39. <view class="status" v-if="item.refund_status == 0">已撤销退款</view>
  40. <view class="status" v-if="item.refund_status == 1">申请中</view>
  41. <view class="status2" v-if="item.refund_status == 1">等待卖家同意退款</view>
  42. <view class="status" v-if="item.refund_status == 2">退款成功</view>
  43. <view class="status2" v-if="item.refund_status == 2">退款成功¥{{item.refund_money}}</view>
  44. <view class="status" v-if="item.refund_status == 3">退款失败</view>
  45. <view class="status2" v-if="item.refund_status == 3">退款已关闭</view>
  46. </view>
  47. <view class="hflex acenter jend cell">
  48. <view class="btn1" @click="delhis(item.id)" v-if="item.refund_status != 1">删除记录</view>
  49. <view class="btn1 btn2" @click="toOrderDetail(item.id)">查看详情</view>
  50. </view>
  51. </view>
  52. </block>
  53. </view>
  54. </view>
  55. </template>
  56. <script>
  57. import $api from '@/static/js/api.js'
  58. var that = ''
  59. export default {
  60. data() {
  61. return {
  62. pageList: [
  63. ],
  64. page:1,
  65. limit: 10,
  66. total: 1,
  67. }
  68. },
  69. onLoad() {
  70. that = this
  71. that.getList()
  72. },
  73. methods: {
  74. getList() {
  75. $api.req({
  76. url: '/data/api.Order/order_list',
  77. method: 'POST',
  78. data: {
  79. status: 5,
  80. page: that.page
  81. }
  82. }, function(res) {
  83. if(res.code == 1) {
  84. for(var i=0;i<res.data.list.length;i++) {
  85. for(var j=0;j<res.data.list[i].goods_item.length;j++) {
  86. res.data.list[i].goods_item[j].goods_spec = $api.resetspec(res.data.list[i].goods_item[j].goods_spec)
  87. }
  88. }
  89. if(that.page == 1) {
  90. that.pageList = res.data.list
  91. } else {
  92. that.pageList = that.pageList.concat(res.data.list)
  93. }
  94. that.total = res.data.page.total
  95. that.limit = res.data.page.limit
  96. }
  97. })
  98. },
  99. // 店铺
  100. toShop(id) {
  101. $api.jump('/page_shop/pages/good/shop?id=' + id)
  102. },
  103. delhis(id) {
  104. $api.req({
  105. url: '/data/api.Order/del_refund',
  106. method: 'POST',
  107. data: {
  108. order_id: id
  109. }
  110. }, function(res) {
  111. if(res.code == 1) {
  112. $api.info(res.info)
  113. that.page = 1
  114. // that.pageList = []
  115. that.getList()
  116. }
  117. })
  118. },
  119. toOrderDetail(id) {
  120. console.log(id);
  121. $api.jump('/page_shop/pages/order/refundDetail?id=' + id)
  122. },
  123. onReachBottom() {
  124. if (Number(that.page) * Number(that.limit) >= Number(that.total)) {
  125. $api.info("没有更多了")
  126. } else {
  127. that.page++
  128. that.getList()
  129. }
  130. }
  131. },
  132. }
  133. </script>
  134. <style lang="scss" scoped>
  135. .content {
  136. background: #F3F3F3;
  137. .top {
  138. box-sizing: border-box;
  139. // padding: 30rpx;
  140. // height: 540rpx;
  141. .u-nav-slot {
  142. position: absolute;
  143. top: 8rpx;
  144. left: 134rpx;
  145. }
  146. .tabs {
  147. background-color: #fff;
  148. width: 100%;
  149. box-sizing: border-box;
  150. padding: 20rpx 30rpx;
  151. .tab_item {
  152. font-size: 32rpx;
  153. font-weight: 400;
  154. color: #333333;
  155. line-height: 44rpx;
  156. }
  157. .tab_active {
  158. font-weight: 500;
  159. color: #222222;
  160. position: relative;
  161. }
  162. .tab_active::after {
  163. content: "";
  164. position: absolute;
  165. bottom: -14rpx;
  166. left: 12rpx;
  167. width: 40rpx;
  168. height: 6rpx;
  169. background: #506DFF;
  170. border-radius: 4rpx;
  171. }
  172. }
  173. }
  174. .box {
  175. width: 100%;
  176. box-sizing: border-box;
  177. padding: 0 30rpx;
  178. .box_item {
  179. background: #FFFFFF;
  180. border-radius: 20rpx;
  181. width: 100%;
  182. margin-top: 20rpx;
  183. box-sizing: border-box;
  184. padding: 0 20rpx;
  185. .box_bg {
  186. width: 100%;
  187. height: 80rpx;
  188. box-sizing: border-box;
  189. background: #F4F4F4;
  190. border-radius: 16rpx;
  191. margin: 28rpx 0;
  192. padding-left: 66rpx;
  193. .status {
  194. font-size: 28rpx;
  195. font-weight: 500;
  196. color: #333333;
  197. line-height: 40rpx;
  198. margin-right: 32rpx;
  199. }
  200. .status2 {
  201. font-size: 28rpx;
  202. font-weight: 400;
  203. color: #333333;
  204. line-height: 40rpx;
  205. }
  206. }
  207. .cell {
  208. padding: 20rpx 0;
  209. }
  210. .title {
  211. font-size: 30rpx;
  212. font-weight: 500;
  213. color: #333333;
  214. line-height: 42rpx;
  215. }
  216. .top_name {
  217. font-size: 26rpx;
  218. font-weight: 400;
  219. color: #333333;
  220. line-height: 36rpx;
  221. }
  222. .text-blue {
  223. font-size: 26rpx;
  224. font-weight: 400;
  225. color: #506DFF;
  226. line-height: 36rpx;
  227. }
  228. .img {
  229. width: 160rpx;
  230. height: 160rpx;
  231. border-radius: 16rpx;
  232. }
  233. .img_right {
  234. margin-left: 16rpx;
  235. width: calc(100% - 176rpx);
  236. .name {
  237. width: 392rpx;
  238. font-size: 28rpx;
  239. font-weight: 500;
  240. color: #222222;
  241. line-height: 40rpx;
  242. }
  243. .norm {
  244. max-width: 300rpx;
  245. width: max-content;
  246. // height: 84rpx;
  247. background: #F5F5F5;
  248. border-radius: 4rpx;
  249. font-size: 22rpx;
  250. font-weight: 400;
  251. color: #888888;
  252. line-height: 32rpx;
  253. box-sizing: border-box;
  254. padding: 12rpx;
  255. }
  256. .num {
  257. font-size: 24rpx;
  258. font-weight: 500;
  259. color: #888888;
  260. line-height: 28rpx;
  261. }
  262. .price {
  263. font-size: 24rpx;
  264. font-weight: 400;
  265. color: #222222;
  266. line-height: 34rpx;
  267. padding-top: 12rpx;
  268. }
  269. }
  270. .scroll_img {
  271. position: relative;
  272. .imgs {
  273. width: 100%;
  274. height: 170rpx;
  275. overflow: hidden;
  276. white-space: nowrap;
  277. .imgs_item {
  278. width: 160rpx;
  279. height: 160rpx;
  280. border-radius: 16rpx;
  281. margin-right: 20rpx;
  282. display: inline-block;
  283. }
  284. }
  285. .img_leng {
  286. position: absolute;
  287. right: 0;
  288. top: 0;
  289. width: 130rpx;
  290. height: 160rpx;
  291. border-radius: 12rpx;
  292. font-size: 24rpx;
  293. font-weight: 500;
  294. color: #222222;
  295. line-height: 160rpx;
  296. text-align: center;
  297. background: linear-gradient(270deg, #FFFFFF 0%, rgba(255,255,255,0.78) 100%);
  298. }
  299. }
  300. .btn1 {
  301. width: 180rpx;
  302. height: 68rpx;
  303. border-radius: 36rpx;
  304. border: 1px solid #D0D0D0;
  305. text-align: center;
  306. font-size: 28rpx;
  307. font-weight: 400;
  308. color: #222222;
  309. line-height: 68rpx;
  310. }
  311. .btn2 {
  312. border: 1px solid #506DFF;
  313. color: #506DFF;
  314. margin-left: 32rpx;
  315. }
  316. }
  317. }
  318. .box:nth-last-child(1) {
  319. margin-bottom: 30rpx;
  320. }
  321. }
  322. </style>