refund.vue 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376
  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.refund_status == 1">等待审核</view>
  9. <view class="text_blue" v-if="item.refund_status == 2">同意退款</view>
  10. <view class="text_blue" v-if="item.refund_status == 3">拒绝退款</view>
  11. </view>
  12. <view class="time">下单时间:{{item.create_at}}</view>
  13. <view class="good">
  14. <block v-for="(item2,index2) in item.goods_item" :key="index2">
  15. <view class="hflex acenter good_item">
  16. <image :src="item2.goods_cover" class="img"></image>
  17. <view class="good_center">
  18. <view class="name text_hide">{{item2.goods_name}}</view>
  19. <view class="spec text_hide">{{item2.goods_spec}}</view>
  20. </view>
  21. <view class="vflex jend">
  22. <view class="price">¥<span style="font-size: 30rpx;">{{item2.price_selling}}</span></view>
  23. <view class="num">X{{item2.stock_sales}}</view>
  24. </view>
  25. </view>
  26. </block>
  27. <view class="hflex jend">
  28. <view class="good_bottom">共{{item.goods_item.length}}件商品 实付款¥<span class="bottom_price">{{item.payment_amount}}</span></view>
  29. </view>
  30. </view>
  31. <view class="box_bottom hflex jend" v-if="item.refund_status == 1">
  32. <view class="btn1 hflex acenter jcenter" @click.stop="apply1(item.id,2)">拒绝申请</view>
  33. <view class="btn1 btn2 hflex acenter jcenter" @click.stop="apply1(item.id,1)">同意退款</view>
  34. </view>
  35. <view class="box_bottom hflex jend" v-if="item.refund_status == 2">
  36. <view class="btn1 hflex acenter jcenter" @click.stop="dele(item.id)">删除记录</view>
  37. <view class="btn1 btn2 hflex acenter jcenter" @click.stop="toDetail(item.id)">查看详情</view>
  38. </view>
  39. <view class="box_bottom hflex jend" v-if="item.refund_status == 3">
  40. <view class="btn1 hflex acenter jcenter" style="color: #9A9A9A;">已拒绝申请</view>
  41. </view>
  42. </view>
  43. </block>
  44. </view>
  45. <u-popup :show="show_refuse" mode="center" round="10" @close="close" :safeAreaInsetBottom="false">
  46. <view class="popu">
  47. <view class="popu_title hflex acenter jcenter">拒绝原因</view>
  48. <u-textarea v-model="reason" confirmType="done" placeholder="请填写拒绝原因" border="none" ></u-textarea>
  49. <view class="popu_bottom hflex acenter jcenter">
  50. <view class="btn1 hflex acenter jcenter" @click="close">取消</view>
  51. <view class="btn1 btn2 hflex acenter jcenter" @click="refuse">提交</view>
  52. </view>
  53. </view>
  54. </u-popup>
  55. <u-popup :show="show_agree" mode="center" round="10" @close="close" :safeAreaInsetBottom="false">
  56. <view class="popu">
  57. <view class="popu_title hflex acenter jcenter">确认退款</view>
  58. <view class="popu_bottom hflex acenter jcenter">
  59. <view class="btn1 hflex acenter jcenter" @click="close">取消</view>
  60. <view class="btn1 btn2 hflex acenter jcenter" @click="agree">确认</view>
  61. </view>
  62. </view>
  63. </u-popup>
  64. </view>
  65. </template>
  66. <script>
  67. import $api from '@/static/js/api.js'
  68. var that = ''
  69. export default {
  70. data() {
  71. return {
  72. pageList: [],
  73. page: 1,
  74. limit: 10,
  75. total: 1,
  76. show_refuse: false,
  77. reason: '',
  78. show_agree: false,
  79. id: '',
  80. }
  81. },
  82. onLoad() {
  83. that = this
  84. uni.startPullDownRefresh();
  85. },
  86. onShow() {
  87. that.getList()
  88. },
  89. onPullDownRefresh() {
  90. that.page = 1
  91. that.pageList = []
  92. that.getList()
  93. },
  94. methods: {
  95. getList() {
  96. $api.req({
  97. url: '/data/api.business.Order/refund_list',
  98. data: {
  99. page: that.page
  100. }
  101. }, function(res) {
  102. if(res.code == 1) {
  103. for(var i=0;i<res.data.list.length;i++) {
  104. for(var j=0;j<res.data.list[i].goods_item.length;j++) {
  105. var temp = res.data.list[i].goods_item[j].goods_cover.split('|')
  106. res.data.list[i].goods_item[j].goods_cover = temp[0]
  107. }
  108. }
  109. for(var i=0;i<res.data.list.length;i++) {
  110. for(var j=0;j<res.data.list[i].goods_item.length;j++) {
  111. res.data.list[i].goods_item[j].goods_spec = $api.resetspec(res.data.list[i].goods_item[j].goods_spec)
  112. }
  113. }
  114. if(that.page == 1) {
  115. that.pageList = res.data.list
  116. } else {
  117. that.pageList = that.pageList.concat(res.data.list)
  118. }
  119. // console.log(that.pageList);
  120. that.total = res.data.page.total
  121. that.limit = res.data.page.limit
  122. uni.stopPullDownRefresh();
  123. }
  124. })
  125. },
  126. apply1(id,type) {
  127. that.id = id
  128. // console.log(type);
  129. if(type == 1) {
  130. that.show_agree = true
  131. } else {
  132. that.show_refuse = true
  133. }
  134. },
  135. close() {
  136. that.show_refuse = false
  137. that.show_agree = false
  138. },
  139. refuse() {
  140. $api.req({
  141. url: '/data/api.business.Order/examine_refund',
  142. method: 'POST',
  143. data: {
  144. order_id: that.id,
  145. type: 2,
  146. reason: that.reason
  147. }
  148. }, function(res) {
  149. if(res.code == 1) {
  150. that.page = 1
  151. that.getList()
  152. that.close()
  153. }
  154. })
  155. },
  156. agree() {
  157. $api.req({
  158. url: '/data/api.business.Order/examine_refund',
  159. method: 'POST',
  160. data: {
  161. order_id: that.id,
  162. type: 1
  163. }
  164. }, function(res) {
  165. if(res.code == 1) {
  166. that.page = 1
  167. that.getList()
  168. that.close()
  169. }
  170. })
  171. },
  172. dele(id) {
  173. $api.req({
  174. url: '/data/api.business.Order/del_refund',
  175. method: 'POST',
  176. data: {
  177. order_id: id
  178. }
  179. }, function(res) {
  180. if(res.code == 1) {
  181. $api.info(res.info)
  182. that.page = 1
  183. that.getList()
  184. }
  185. })
  186. },
  187. toDetail(id) {
  188. $api.jump('/pages/order/refundDetail?id=' + id)
  189. },
  190. onReachBottom() {
  191. if (Number(that.page) * Number(that.limit) >= Number(that.total)) {
  192. $api.info("没有更多了")
  193. } else {
  194. that.page++
  195. that.getList(that.cid)
  196. }
  197. }
  198. },
  199. }
  200. </script>
  201. <style lang="scss" scoped>
  202. .content {
  203. .center {
  204. width: 100%;
  205. box-sizing: border-box;
  206. padding: 0 30rpx;
  207. min-height:100vh;
  208. background: #F4F4F4;
  209. .box {
  210. background: #FFFFFF;
  211. border-radius: 20px;
  212. width: 100%;
  213. margin: 20rpx 0 0;
  214. box-sizing: border-box;
  215. padding: 0 20rpx;
  216. .top {
  217. padding: 24rpx 0 14rpx;
  218. .order-no {
  219. font-size: 24rpx;
  220. font-weight: 400;
  221. color: #333333;
  222. line-height: 30rpx;
  223. }
  224. .text_red {
  225. font-size: 24rpx;
  226. font-weight: 400;
  227. color: #FF2020;
  228. line-height: 34rpx;
  229. }
  230. .text_blue {
  231. font-size: 24rpx;
  232. font-weight: 500;
  233. color: #506DFF;
  234. line-height: 34rpx;
  235. }
  236. }
  237. .time {
  238. font-size: 24rpx;
  239. font-weight: 400;
  240. color: #555555;
  241. line-height: 34rpx;
  242. padding: 0 0 24rpx;
  243. }
  244. .good {
  245. width: 100%;
  246. padding: 24rpx 0 20rpx;
  247. border-top: 1rpx solid #F4F4F4;
  248. border-bottom: 1rpx solid #F4F4F4;
  249. .good_item {
  250. padding-bottom: 32rpx;
  251. }
  252. .good_item:nth-last-child(1) {
  253. padding-bottom: 0;
  254. }
  255. .img {
  256. width: 180rpx;
  257. height: 180rpx;
  258. }
  259. .good_center {
  260. margin: 0 20rpx;
  261. width: 338rpx;
  262. .name {
  263. font-size: 30rpx;
  264. font-weight: 400;
  265. color: #222222;
  266. line-height: 42rpx;
  267. padding-bottom: 20rpx;
  268. }
  269. .spec {
  270. width: max-content;
  271. max-width: 300rpx;
  272. background: #F5F5F5;
  273. border-radius: 12rpx;
  274. font-size: 20rpx;
  275. font-weight: 400;
  276. color: #888888;
  277. line-height: 28rpx;
  278. box-sizing: border-box;
  279. padding: 12rpx;
  280. }
  281. }
  282. .price {
  283. font-size: 20rpx;
  284. font-weight: 400;
  285. color: #222222;
  286. line-height: 24rpx;
  287. padding: 0 0 16rpx;
  288. }
  289. .num {
  290. font-size: 24rpx;
  291. font-weight: 500;
  292. color: #888888;
  293. line-height: 28rpx;
  294. }
  295. .good_bottom {
  296. font-size: 22rpx;
  297. font-weight: 400;
  298. color: #272727;
  299. line-height: 32rpx;
  300. padding: 26rpx 0 0;
  301. }
  302. .bottom_price {
  303. font-size: 32rpx;
  304. color: #222222;
  305. font-weight: bold;
  306. line-height: 24px;
  307. line-height: 24px;
  308. }
  309. }
  310. .box_bottom {
  311. padding: 24rpx 0;
  312. .btn1 {
  313. width: 180rpx;
  314. height: 60rpx;
  315. border-radius: 36rpx;
  316. border: 1rpx solid #787878;
  317. font-size: 28rpx;
  318. font-weight: 400;
  319. color: #5D5D5D;
  320. line-height: 40rpx;
  321. margin-left: 24rpx;
  322. }
  323. .btn2 {
  324. background: #506DFF;
  325. border: none;
  326. color: #FFFFFF;
  327. }
  328. }
  329. }
  330. }
  331. .popu {
  332. width: 570rpx;
  333. margin: 0 auto;
  334. background: #FFFFFF;
  335. border-radius: 20rpx;
  336. box-sizing: border-box;
  337. padding: 0 30rpx;
  338. .popu_title {
  339. font-size: 36rpx;
  340. font-weight: 500;
  341. color: #222222;
  342. line-height: 50rpx;
  343. padding: 44rpx 0 36rpx;
  344. }
  345. .u-textarea {
  346. background: #F2F2F2 !important;
  347. border-radius: 20rpx !important;
  348. margin-bottom: 54rpx;
  349. }
  350. .popu_bottom {
  351. padding-bottom: 52rpx;
  352. .btn1 {
  353. width: 220rpx;
  354. height: 76rpx;
  355. border-radius: 38rpx;
  356. border: 2rpx solid #506DFF;
  357. font-size: 32rpx;
  358. font-weight: 400;
  359. color: #506DFF;
  360. line-height: 44rpx;
  361. }
  362. .btn2 {
  363. background: #506DFF;
  364. color: #FFFFFF;
  365. margin-left: 50rpx;
  366. }
  367. }
  368. }
  369. }
  370. </style>