refund.vue 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240
  1. <template>
  2. <view class="content">
  3. <view class="center">
  4. <block v-for="(item,index) in pageList" :key="index">
  5. <view class="box" @click="toDetail(item.id)">
  6. <view class="top hflex acenter jbetween">
  7. <view class="order-no">订单号<span style="color: #333">{{item.order_no}}</span></view>
  8. <view class="text_red" v-if="item.status == 7">未退款</view>
  9. <view class="text_blue" v-if="item.status == 8">已退款</view>
  10. </view>
  11. <view class="time">下单时间:{{item.create_at}}</view>
  12. <view class="good">
  13. <block v-for="(item2,index2) in item.goods_item" :key="index2">
  14. <view class="hflex acenter good_item">
  15. <image :src="item2.goods_cover" class="img"></image>
  16. <view class="good_center">
  17. <view class="name text_hide">{{item2.goods_name}}</view>
  18. <view class="spec">{{item2.goods_spec}}</view>
  19. </view>
  20. <view class="vflex jend">
  21. <view class="price">¥<span style="font-size: 30rpx;">{{item2.price_selling}}</span></view>
  22. <view class="num">X{{item2.stock_sales}}</view>
  23. </view>
  24. </view>
  25. </block>
  26. <view class="hflex jend">
  27. <view class="good_bottom">共{{item.goods_item.length}}件商品 实付款¥<span class="bottom_price">{{item.payment_amount}}</span></view>
  28. </view>
  29. </view>
  30. <view class="box_bottom hflex jend" v-if="item.status == 7">
  31. <view class="btn1 hflex acenter jcenter" @click.stop="refuse(item.id,2)">拒绝申请</view>
  32. <view class="btn1 btn2 hflex acenter jcenter" @click.stop="refuse(item.id,2)">同意退款</view>
  33. </view>
  34. <view class="box_bottom hflex jend" v-if="item.status == 8">>
  35. <view class="btn1 hflex acenter jcenter" @click.stop="dele(item.id)">删除记录</view>
  36. <view class="btn1 btn2 hflex acenter jcenter" @click.stop="toDetail(item.id)">查看详情</view>
  37. </view>
  38. </view>
  39. </block>
  40. </view>
  41. </view>
  42. </template>
  43. <script>
  44. import $api from '@/static/js/api.js'
  45. var that = ''
  46. export default {
  47. data() {
  48. return {
  49. pageList: [],
  50. page: 1,
  51. limit: 10,
  52. total: 1,
  53. }
  54. },
  55. onLoad() {
  56. that = this
  57. that.getList()
  58. },
  59. methods: {
  60. getList() {
  61. $api.req({
  62. url: '/data/api.business.Order/refund_list',
  63. data: {
  64. page: that.page
  65. }
  66. }, function(res) {
  67. if(res.code == 1) {
  68. if(that.page == 1) {
  69. that.pageList = res.data.list
  70. } else {
  71. that.pageList = that.pageList.concat(res.data.list)
  72. }
  73. that.total = res.data.page.total
  74. that.limit = res.data.page.limit
  75. }
  76. })
  77. },
  78. refuse(id,type) {
  79. $api.req({
  80. url: '/data/api.business.Order/examine_refund',
  81. method: 'POST',
  82. data: {
  83. order_id: id,
  84. type: type
  85. }
  86. }, function(res) {
  87. if(res.code == 1) {
  88. $api.info(res.info)
  89. that.page = 1
  90. that.getList()
  91. }
  92. })
  93. },
  94. toDetail(id) {
  95. $api.jump('/pages/order/refundDetail?id=' + id)
  96. },
  97. onReachBottom() {
  98. if (Number(that.page) * Number(that.limit) >= Number(that.total)) {
  99. $api.info("没有更多了")
  100. } else {
  101. that.page++
  102. that.getList(that.cid)
  103. }
  104. }
  105. },
  106. }
  107. </script>
  108. <style lang="scss" scoped>
  109. .content {
  110. .center {
  111. width: 100%;
  112. box-sizing: border-box;
  113. padding: 0 30rpx;
  114. min-height: calc(100vh - 176rpx);
  115. background: #F4F4F4;
  116. .box {
  117. background: #FFFFFF;
  118. border-radius: 20px;
  119. width: 100%;
  120. margin: 20rpx 0 0;
  121. box-sizing: border-box;
  122. padding: 0 20rpx;
  123. .top {
  124. padding: 24rpx 0 14rpx;
  125. .order-no {
  126. font-size: 24rpx;
  127. font-weight: 400;
  128. color: #333333;
  129. line-height: 30rpx;
  130. }
  131. .text_red {
  132. font-size: 24rpx;
  133. font-weight: 400;
  134. color: #FF2020;
  135. line-height: 34rpx;
  136. }
  137. .text_blue {
  138. font-size: 24rpx;
  139. font-weight: 500;
  140. color: #506DFF;
  141. line-height: 34rpx;
  142. }
  143. }
  144. .time {
  145. font-size: 24rpx;
  146. font-weight: 400;
  147. color: #555555;
  148. line-height: 34rpx;
  149. padding: 0 0 24rpx;
  150. }
  151. .good {
  152. width: 100%;
  153. padding: 24rpx 0 20rpx;
  154. border-top: 1rpx solid #F4F4F4;
  155. border-bottom: 1rpx solid #F4F4F4;
  156. .good_item {
  157. padding-bottom: 32rpx;
  158. }
  159. .good_item:nth-last-child(1) {
  160. padding-bottom: 0;
  161. }
  162. .img {
  163. width: 180rpx;
  164. height: 180rpx;
  165. }
  166. .good_center {
  167. margin: 0 20rpx;
  168. width: 338rpx;
  169. .name {
  170. font-size: 30rpx;
  171. font-weight: 400;
  172. color: #222222;
  173. line-height: 42rpx;
  174. padding-bottom: 20rpx;
  175. }
  176. .spec {
  177. width: 288rpx;
  178. background: #F5F5F5;
  179. border-radius: 12rpx;
  180. font-size: 20rpx;
  181. font-weight: 400;
  182. color: #888888;
  183. line-height: 28rpx;
  184. box-sizing: border-box;
  185. padding: 12rpx;
  186. }
  187. }
  188. .price {
  189. font-size: 20rpx;
  190. font-weight: 400;
  191. color: #222222;
  192. line-height: 24rpx;
  193. padding: 0 0 16rpx;
  194. }
  195. .num {
  196. font-size: 24rpx;
  197. font-weight: 500;
  198. color: #888888;
  199. line-height: 28rpx;
  200. }
  201. .good_bottom {
  202. font-size: 22rpx;
  203. font-weight: 400;
  204. color: #272727;
  205. line-height: 32rpx;
  206. padding: 26rpx 0 0;
  207. }
  208. .bottom_price {
  209. font-size: 32rpx;
  210. color: #222222;
  211. font-weight: bold;
  212. line-height: 24px;
  213. line-height: 24px;
  214. }
  215. }
  216. .box_bottom {
  217. padding: 24rpx 0;
  218. .btn1 {
  219. width: 180rpx;
  220. height: 60rpx;
  221. border-radius: 36rpx;
  222. border: 1rpx solid #787878;
  223. font-size: 28rpx;
  224. font-weight: 400;
  225. color: #5D5D5D;
  226. line-height: 40rpx;
  227. margin-left: 24rpx;
  228. }
  229. .btn2 {
  230. background: #506DFF;
  231. border: none;
  232. color: #FFFFFF;
  233. }
  234. }
  235. }
  236. }
  237. }
  238. </style>