list.vue 8.4 KB

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