list.vue 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304
  1. <template>
  2. <view class="refund-list">
  3. <view class="tab-box">
  4. <view class="item" v-for="(item,index) in tabList" :key="index" :class="{'active':index == tabIndex}" @click="bindTab(index)">{{item.title}}</view>
  5. </view>
  6. <view class="goods-wrapper">
  7. <view class="info-box" v-for="(item,index) in goodsList" :key="index">
  8. <view class="title" @click="goStore(item)">
  9. <text class="iconfont icon-shangjiadingdan"></text>
  10. <text class="txt">{{item.merchant.mer_name}}</text>
  11. <text class="iconfont icon-xiangyou"></text>
  12. </view>
  13. <view class="product-box">
  14. <view class="product-item" v-for="goods in item.refundProduct" :key="goods.order_product_id">
  15. <image class="img-box" :src="goods.product.cart_info.product.image" mode=""></image>
  16. <view class="msg">
  17. <view class="name line1"><text v-if="goods.product.cart_info.product_type === 2" class="event_name event_bg">预售</text>{{goods.product.cart_info.product.store_name}}</view>
  18. <view class="des">{{goods.product.cart_info.productAttr.sku}}</view>
  19. <view class="price">退款:{{item.refund_price}}</view>
  20. <view class="num">x {{goods.product.product_num}}</view>
  21. </view>
  22. </view>
  23. </view>
  24. <view class="btn-box" v-if="item.status == 1">
  25. <view class="btn gray" @click="goDetail(item)">查看详情</view>
  26. <view class="btn" @click="goPage(item.refund_order_id)">退回商品</view>
  27. </view>
  28. <view class="btn-box" v-else-if="item.status == -1">
  29. <view class="btn gray" @click="goDetail(item)">查看详情</view>
  30. <view class="btn" @click="applyAgain(item)">再次申请</view>
  31. </view>
  32. <view class="btn-box" v-else>
  33. <view class="btn gray" v-if="item.status == 3" @click="bindDetele(item,index)">删除记录</view>
  34. <view class="btn" @click="goDetail(item)">查看详情</view>
  35. </view>
  36. <view class="status">
  37. <!-- 0审核中 1待发货 2待收货 3已退款 -1已拒绝 -->
  38. <block v-if="item.status == 0">
  39. <text class="iconfont icon-shenhezhong1 red-color"></text>
  40. </block>
  41. <block v-if="item.status == 1">
  42. <text class="iconfont icon-daituihuo"></text>
  43. </block>
  44. <block v-if="item.status == 2">
  45. <text class="iconfont icon-tuihuozhong"></text>
  46. </block>
  47. <block v-if="item.status == 3">
  48. <text class="iconfont icon-yituikuan"></text>
  49. </block>
  50. <block v-if="item.status == -1">
  51. <text class="iconfont icon-yijujue1"></text>
  52. </block>
  53. </view>
  54. </view>
  55. </view>
  56. </view>
  57. </template>
  58. <script>
  59. let app = getApp();
  60. import { refundList,refundDel } from '@/api/order.js'
  61. export default{
  62. data(){
  63. return {
  64. tabIndex:0,
  65. tabList:[
  66. {
  67. title:'全部'
  68. },
  69. {
  70. title:'处理中'
  71. },
  72. {
  73. title:'已处理'
  74. },
  75. ],
  76. goodsList:[],
  77. isScroll:true,
  78. page:1,
  79. limit:15,
  80. hide_mer_status: app.globalData.hide_mer_status
  81. }
  82. },
  83. onLoad() {
  84. this.getList();
  85. },
  86. onReady(){
  87. uni.$on('update',(data)=>{
  88. this.hide_mer_status = data.hide_mer_status
  89. })
  90. },
  91. mounted: function() {
  92. const app = getApp();
  93. this.$nextTick(() => {
  94. this.hide_mer_status = app.globalData.hide_mer_status
  95. });
  96. },
  97. methods:{
  98. goStore(item){
  99. if(this.hide_mer_status == 0){
  100. uni.navigateTo({
  101. url:`/pages/store/home/index?id=${item.merchant.mer_id}`
  102. })
  103. }
  104. },
  105. goPage(id){
  106. uni.navigateTo({
  107. url:'/pages/users/refund/goods/index?id='+id
  108. })
  109. },
  110. applyAgain(item){
  111. uni.navigateTo({
  112. url:`/pages/order_details/index?order_id=${item.refundProduct[0].product.order_id}`
  113. })
  114. },
  115. bindTab(index){
  116. this.tabIndex = index
  117. this.page =1
  118. this.isScroll = true
  119. this.goodsList = []
  120. this.getList()
  121. },
  122. getList(){
  123. if(!this.isScroll) return
  124. refundList({
  125. type:this.tabIndex,
  126. page:this.page,
  127. limit:this.limit
  128. }).then(({data})=>{
  129. this.isScroll = data.list.length>=this.limit
  130. this.goodsList = this.goodsList.concat(data.list)
  131. this.page+=1
  132. })
  133. },
  134. // 去详情页
  135. goDetail(item){
  136. uni.navigateTo({
  137. url:'/pages/users/refund/detail?id='+item.refund_order_id
  138. })
  139. },
  140. // 删除记录
  141. bindDetele(item,index){
  142. let self = this
  143. uni.showModal({
  144. title: '提示',
  145. content: '确定删除该记录吗?',
  146. success: function (res) {
  147. if (res.confirm) {
  148. refundDel(item.refund_order_id).then(res=>{
  149. self.goodsList.splice(index,1)
  150. })
  151. uni.showToast({
  152. title:'删除成功',
  153. icon:'none'
  154. })
  155. } else if (res.cancel) {
  156. console.log('用户点击取消');
  157. }
  158. }
  159. });
  160. }
  161. },
  162. onReachBottom() {
  163. this.getList();
  164. }
  165. }
  166. </script>
  167. <style lang="scss">
  168. .refund-list{
  169. .tab-box{
  170. z-index: 50;
  171. position: fixed;
  172. left: 0;
  173. top: 0;
  174. width: 100%;
  175. display: flex;
  176. .item{
  177. flex: 1;
  178. display: flex;
  179. justify-content: center;
  180. align-items: center;
  181. height: 90rpx;
  182. background-color: #fff;
  183. border-bottom: 1px solid transparent;
  184. &.active{
  185. color: $theme-color;
  186. border-color: $theme-color;
  187. }
  188. }
  189. }
  190. .goods-wrapper{
  191. margin-top: 102rpx;
  192. }
  193. .info-box{
  194. position: relative;
  195. margin-top: 12rpx;
  196. background-color: #fff;
  197. .title{
  198. display: flex;
  199. align-items: center;
  200. padding: 0 32rpx;
  201. height: 86rpx;
  202. border-bottom: 1px solid #F0F0F0;
  203. color: #282828;
  204. .icon-shangjiadingdan{
  205. font-size: 32rpx;
  206. }
  207. .txt{
  208. margin: 0 5rpx ;
  209. }
  210. .icon-xiangyou{
  211. color: #999;
  212. font-size: 20rpx;
  213. margin-top: 6rpx;
  214. }
  215. }
  216. .product-box{
  217. .product-item{
  218. display: flex;
  219. padding: 25rpx 30rpx;
  220. .img-box{
  221. width:130rpx;
  222. height:130rpx;
  223. border-radius:16rpx;
  224. }
  225. .msg{
  226. position: relative;
  227. display: flex;
  228. flex-direction: column;
  229. justify-content: space-between;
  230. width: 440rpx;
  231. margin-left: 26rpx;
  232. .name{
  233. font-size: 28rpx;
  234. color: #282828;
  235. }
  236. .des{
  237. font-size: 20rpx;
  238. color: #868686;
  239. }
  240. .price{
  241. font-size: 26rpx;
  242. }
  243. .num{
  244. position: absolute;
  245. right: -80rpx;
  246. top: 4rpx;
  247. color: #868686;
  248. font-size: 26rpx;
  249. }
  250. }
  251. }
  252. .event_name{
  253. display: inline-block;
  254. margin-right: 9rpx;
  255. color: #fff;
  256. font-size: 20rpx;
  257. padding: 0 8rpx;
  258. line-height: 30rpx;
  259. text-align: center;
  260. border-radius: 6rpx;
  261. }
  262. }
  263. .btn-box{
  264. display: flex;
  265. justify-content: flex-end;
  266. padding:0 20rpx 20rpx;
  267. .btn{
  268. width:176rpx;
  269. height:60rpx;
  270. line-height: 60rpx;
  271. margin-left: 18rpx;
  272. text-align: center;
  273. background:$theme-color;
  274. border-radius:30rpx;
  275. color: #fff;
  276. font-size: 27rpx;
  277. &.gray{
  278. border:1px solid #ddd;
  279. background: transparent;
  280. color: #aaa;
  281. }
  282. }
  283. }
  284. .status{
  285. position: absolute;
  286. right: 30rpx;
  287. top: 0;
  288. .iconfont{
  289. font-size: 120rpx;
  290. opacity: .3;
  291. }
  292. .red-color{
  293. color: $theme-color;
  294. }
  295. }
  296. }
  297. }
  298. .event_bg{
  299. background: #FF7F00;
  300. }
  301. </style>