多租户商城-商户小程序端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

500 lines
12 KiB

2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
  1. <!-- 售后列表 -->
  2. <template>
  3. <view>
  4. <global-loading />
  5. <view class="content">
  6. <view class="order-list-box">
  7. <view>
  8. <view class="item" v-for="item in FindReturnDatalist">
  9. <view class="order-list-top">
  10. <view class="top-l" @click="goShop(item.shopId)">
  11. <image :src="item.shopLogo" class="shop-img"></image>
  12. <text class="shop-name">{{item.shopName}}</text>
  13. <image src="https://ceres.zkthink.com/static/images/arrowRight.png" class="arrow-img"></image>
  14. </view>
  15. <view class="top-r">
  16. <image src="https://ceres.zkthink.com/static/images/afterSaleTuikuan.png" class="order-status-img"></image>
  17. <text class="order-status">{{item.afterType==1?$t('common.refund'):$t('common.return')}}</text>
  18. </view>
  19. </view>
  20. <view class="order-info-box" v-for="(itemlist,index) in item.skus" :key="index">
  21. <view class="order-info" @click="goodsDetails(item.shopId,itemlist.productId,itemlist.skuId)">
  22. <view class="order-info-item">
  23. <image :src="itemlist.image" class="product-img"></image>
  24. <view class="info-box">
  25. <text class="product-name">{{itemlist.productName}}</text>
  26. <view class="product-sku">{{itemlist.value}}</view>
  27. <view class="price-sku-box">
  28. <text class="product-price">$t('common.refund')<text class="fuhao">{{itemlist.total}}</text></text>
  29. </view>
  30. </view>
  31. </view>
  32. </view>
  33. </view>
  34. <view class="total-price-box">
  35. <!-- 退款 -->
  36. <view v-if='item.afterType==1'>
  37. <text class="total-price-l" v-if="item.afterState == 1">{{$t('common.shz')}}</text>
  38. <text class="total-price-l" v-if="item.afterState == 2">{{$t('common.tkz')}}</text>
  39. <text class="total-price-l" v-if="item.afterState == 4">{{$t('common.tkwc')}}</text>
  40. <text class="total-price-l" v-if="item.afterState == 5">{{$t('common.tksb')}}</text>
  41. <text class="total-price-l" v-if="item.afterState == 6">{{$t('common.shbtg')}}</text>
  42. <text class="total-price-l" v-if="item.afterState == 7">{{$t('common.psz')}}</text>
  43. <text class="total-price-l" v-if="item.afterState == 9">{{$t('common.cxsq')}}</text>
  44. <text class="total-price-l" v-if="item.afterState == 10">{{$t('common.shtg')}}</text>
  45. </view>
  46. <!-- 退货 -->
  47. <view v-if='item.afterType==2'>
  48. <text class="total-price-l" v-if="item.afterState == 1">{{$t('common.thshz')}}</text>
  49. <text class="total-price-l" v-if="item.afterState == 3">{{$t('common.thz')}}</text>
  50. <text class="total-price-l" v-if="item.afterState == 4">{{$t('common.ytk')}}</text>
  51. <text class="total-price-l" v-if="item.afterState == 2">{{$t('common.tkz')}}</text>
  52. <text class="total-price-l" v-if="item.afterState == 5">{{$t('common.tksb')}}</text>
  53. <text class="total-price-l" v-if="item.afterState == 6">{{$t('common.shbtg')}}</text>
  54. <text class="total-price-l" v-if="item.afterState == 7">{{$t('common.psz')}}</text>
  55. <text class="total-price-l" v-if="item.afterState == 8">{{$t('thwc')}}</text>
  56. <text class="total-price-l" v-if="item.afterState == 9">{{$t('common.cxsq')}}</text>
  57. <text class="total-price-l" v-if="item.afterState == 10">{{$t('common.shtg')}}</text>
  58. </view>
  59. <text class="total-price-r mar-left-30" v-if="item.afterState != 0 || item.afterState != 6">退款金额 ¥ {{item.price}}</text>
  60. </view>
  61. <!-- 退款 -->
  62. <view class="order-btn-box" v-if='item.afterType==1'>
  63. <text class="btn l" @click="deleteRecord(item)">{{$t('common.deleterecord')}}</text>
  64. <text class="btn l" v-if="(item.afterType==1 && item.afterState == 1 || item.returnType==2 && item.afterState == 6)" @click="cancelRefundTap(item)">{{$t('common.cxtk')}}</text>
  65. <text class="btn viewDetail l" @click="gotoDetails(item)">{{$t('common.viewdetail')}}</text>
  66. </view>
  67. <!-- 退货 -->
  68. <view class="order-btn-box" v-if='item.afterType==2'>
  69. <text class="btn l" @click="deleteRecord(item)">{{$t('common.deleterecord')}}</text>
  70. <text class="btn l" v-if="(item.afterType==2 && item.afterState == 1 || item.afterType==2 && item.afterState == 10 || item.afterState == 6)" @click="cancelRefundTaphuo(item)">{{$t('common.cxth')}}</text>
  71. <text class="btn viewDetail l" @click="gotoDetailshuo(item)">{{$t('common.viewdetail')}}</text>
  72. </view>
  73. </view>
  74. </view>
  75. <view v-if="ifEmpty" class="emptyCart-box flex-items-plus flex-column">
  76. <image class="emptyCart-img" src="https://ceres.zkthink.com/static/img/bgnull.png"></image>
  77. <label class="font-color-999 fs26 mar-top-30">{{$t('common.zwxsjl')}}</label>
  78. </view>
  79. </view>
  80. </view>
  81. <!-- 优惠券领取 -->
  82. <tui-modal :show="delRecord" :custom="true" :fadein="true">
  83. <view class="Put-box1">
  84. <view class="text-align fs34 fs-bold">
  85. {{$t('common.sfsccjl')}}
  86. </view>
  87. <view class="flex-display flex-sp-between">
  88. <view class="btn" @click="delRecord = false">
  89. {{$t('common.sure')}}
  90. </view>
  91. <view class="btn submit" @click="delRecordFn">
  92. {{$t('common.sure')}}
  93. </view>
  94. </view>
  95. </view>
  96. </tui-modal>
  97. </view>
  98. </template>
  99. <script>
  100. import tuiModal from "@/components/modal/modal";
  101. const NET = require('../../utils/request')
  102. const API = require('../../config/api')
  103. export default {
  104. components: {
  105. tuiModal
  106. },
  107. data() {
  108. return {
  109. FindReturnData:[],
  110. moneyReturnId:{
  111. id:''
  112. },
  113. sellPriceitem:'',
  114. FindReturnDatalist:[],
  115. page:1,//当前页
  116. pageSize:20,//每页记录数
  117. loadingType:0,
  118. delRecord: false,
  119. currentAfterId: '',
  120. ifEmpty: false
  121. }
  122. },
  123. onLoad(){
  124. this.getFindReturn()
  125. },
  126. onUnload() {
  127. // #ifdef MP-WEIXIN
  128. this.back();
  129. // #endif
  130. },
  131. onBackPress(e) {
  132. if (e.from === 'navigateBack') {
  133. return false;
  134. }
  135. this.back();
  136. return true;
  137. },
  138. onReachBottom(){
  139. if(this.loadingType == 1){
  140. uni.stopPullDownRefresh()
  141. }else{
  142. this.page = this.page+1
  143. this.getFindReturn()
  144. }
  145. },
  146. methods: {
  147. goodsDetails(shopId,productId,skuId){
  148. uni.navigateTo({
  149. url:'../goodsModule/goodsDetails?shopId='+shopId + '&productId='+productId +'&skuId='+skuId
  150. })
  151. },
  152. goShop(shopId){
  153. uni.navigateTo({
  154. url: '../store/index?storeId=' + shopId
  155. })
  156. },
  157. back(){
  158. uni.switchTab({
  159. url:'../../pages/tabbar/user/index'
  160. });
  161. },
  162. // 获取售后列表数据
  163. getFindReturn() {
  164. // uni.showLoading({
  165. // title:'加载中...'
  166. // })
  167. NET.request(API.FindReturnList, {
  168. page: this.page,
  169. pageSize:this.pageSize,
  170. }, 'GET').then(res => {
  171. // uni.hideLoading()
  172. if(res.data.list.length == 0){
  173. this.loadingType = 1
  174. this.page = this.page
  175. }
  176. this.FindReturnDatalist = this.FindReturnDatalist.concat(res.data.list)
  177. if (this.FindReturnDatalist.length === 0) {
  178. this.ifEmpty = true
  179. }
  180. this.FindReturnData = res.data
  181. }).catch(res => {
  182. // uni.hideLoading()
  183. })
  184. },
  185. // 删除记录
  186. deleteRecord (item) {
  187. this.currentAfterId = item.afterId
  188. this.delRecord = true
  189. },
  190. delRecordFn () {
  191. this.delRecord = false
  192. // uni.showLoading({
  193. // title:'正在删除...'
  194. // })
  195. NET.request(API.deleteAfter, {
  196. id: this.currentAfterId,
  197. }, 'POST').then(res => {
  198. // uni.hideLoading()
  199. uni.showToast({
  200. title:this.$t('common.deletesuccess'),
  201. icon:'none',
  202. duration:1500
  203. })
  204. this.currentAfterId = ''
  205. setTimeout(() => {
  206. this.page = 1
  207. this.FindReturnDatalist = []
  208. this.getFindReturn()
  209. }, 2000);
  210. }).catch(res => {
  211. // uni.hideLoading()
  212. })
  213. },
  214. // 撤销申请
  215. cancelRefundTap(item){
  216. this.Delete(item)
  217. },
  218. // 退款
  219. Delete(item){
  220. // uni.showLoading({
  221. // title:'正在撤销退款...'
  222. // })
  223. NET.request(API.CancelRefund, {
  224. afterId:item.afterId,
  225. orderId:item.orderId
  226. }, 'POST').then(res => {
  227. // uni.hideLoading()
  228. uni.showToast({
  229. title:this.$t('common.undosuccess'),
  230. icon:'none',
  231. duration:2000
  232. })
  233. setTimeout(() => {
  234. this.page = 1
  235. this.FindReturnDatalist = []
  236. this.getFindReturn()
  237. }, 2500);
  238. }).catch(res => {
  239. // uni.hideLoading()
  240. })
  241. },
  242. // 撤销退货
  243. cancelRefundTaphuo(item){
  244. this.Deletehuo(item)
  245. },
  246. // 退货
  247. Deletehuo(item){
  248. NET.request(API.CancelReturnGoods, {
  249. afterId:item.afterId,
  250. orderId:item.orderId
  251. }, 'POST').then(res => {
  252. uni.showToast({
  253. title:this.$t('common.undosuccess'),
  254. icon:'none',
  255. duration:2000
  256. })
  257. setTimeout(() => {
  258. this.page = 1
  259. this.FindReturnDatalist = []
  260. this.getFindReturn()
  261. }, 2500);
  262. }).catch(res => {
  263. })
  264. },
  265. // 退款查看详情
  266. gotoDetails(item){
  267. uni.navigateTo({
  268. url:'refundDetails?item=' + JSON.stringify(item)
  269. })
  270. },
  271. // 退货查看详情
  272. gotoDetailshuo(item){
  273. uni.navigateTo({
  274. url:'returnDetails?item=' + JSON.stringify(item)
  275. })
  276. }
  277. }
  278. }
  279. </script>
  280. <style lang="scss" scoped>
  281. page {
  282. background-color: #F7F7F7;
  283. }
  284. .Put-box1 {
  285. .btn {
  286. text-align: center;
  287. margin-top: 40rpx;
  288. border: 2rpx solid #333333;
  289. height: 80upx;
  290. line-height: 80upx;
  291. width: 100%;
  292. color: #333333;
  293. }
  294. .submit {
  295. background-color: #333333;
  296. color: #FFEBC4;
  297. margin-left: 20rpx;
  298. }
  299. }
  300. .emptyCart-box {
  301. margin-top: 70upx;
  302. .emptyCart-img {
  303. margin-top: 45%;
  304. width: 113upx;
  305. height: 98upx;
  306. }
  307. }
  308. .order-list-box {
  309. padding: 20upx 30upx 0;
  310. box-sizing: border-box;
  311. }
  312. .order-list-box .item {
  313. margin-bottom: 20upx;
  314. background: #fff;
  315. border-radius: 10upx;
  316. }
  317. .order-list-top {
  318. height: 96upx;
  319. padding: 0 30upx;
  320. box-sizing: border-box;
  321. display: flex;
  322. flex-direction: row;
  323. align-items: center;
  324. justify-content: space-between;
  325. border-bottom: 1px solid #eee;
  326. }
  327. .top-l {
  328. display: flex;
  329. flex-direction: row;
  330. align-items: center;
  331. }
  332. .shop-img {
  333. width: 36upx;
  334. height: 36upx;
  335. margin-right: 10upx;
  336. }
  337. .shop-name {
  338. font-size: 30upx;
  339. color: #333;
  340. font-weight: bold;
  341. }
  342. .arrow-img {
  343. margin-left: 15upx;
  344. width: 24upx;
  345. height: 24upx;
  346. }
  347. .top-r {
  348. display: flex;
  349. flex-direction: row;
  350. align-items: center;
  351. }
  352. .order-status-img {
  353. width: 50rpx;
  354. height: 50rpx;
  355. margin-right: 8upx;
  356. }
  357. .order-status {
  358. font-size: 32rpx;
  359. color: #C5AA7B;
  360. }
  361. .order-info-box {
  362. padding: 0 30upx;
  363. box-sizing: border-box;
  364. }
  365. .order-info {}
  366. .order-info-item {
  367. display: flex;
  368. flex-direction: row;
  369. padding: 20upx 0;
  370. }
  371. .product-img {
  372. width: 180upx;
  373. height: 180upx;
  374. border-radius: 10upx;
  375. margin-right: 30upx;
  376. }
  377. .info-box {
  378. flex: 1;
  379. display: flex;
  380. flex-direction: column;
  381. justify-content: space-between;
  382. }
  383. .product-name {
  384. font-size: 26upx;
  385. color: #333;
  386. height: 68upx;
  387. line-height: 34upx;
  388. display: -webkit-box;
  389. overflow: hidden;
  390. text-overflow: ellipsis;
  391. word-break: break-all;
  392. -webkit-box-orient: vertical;
  393. -webkit-line-clamp: 2;
  394. }
  395. .price-sku-box {
  396. display: flex;
  397. flex-direction: row;
  398. justify-content: space-between;
  399. }
  400. .product-sku {
  401. font-size: 24upx;
  402. color: #999;
  403. }
  404. .product-price {
  405. font-size: 28upx;
  406. color: #333;
  407. font-weight: 400;
  408. }
  409. .product-price .fuhao {
  410. font-size: 32upx;
  411. color: #C83732;
  412. font-weight: bold;
  413. }
  414. .product-num {
  415. font-size: 28upx;
  416. color: #999;
  417. }
  418. .total-price-box {
  419. font-size: 26upx;
  420. color: #333;
  421. border: 2rpx solid #E4E5E6;
  422. display: flex;
  423. flex-direction: row;
  424. align-items: center;
  425. height: 70upx;
  426. line-height: 70upx;
  427. margin: 0 30rpx;
  428. }
  429. .total-price-l {
  430. width: 170upx;
  431. margin-left: 40upx;
  432. font-size: 30upx;
  433. color: #333;
  434. }
  435. .total-price-r {
  436. text-align: left;
  437. }
  438. .order-btn-box {
  439. padding: 30upx 0;
  440. display: flex;
  441. flex-direction: row;
  442. justify-content: flex-end;
  443. }
  444. .order-btn-box .btn {
  445. display: inline-view;
  446. width: 140upx;
  447. height: 58upx;
  448. text-align: center;
  449. line-height: 58upx;
  450. font-size: 26upx;
  451. color: #333;
  452. margin-left: 20upx;
  453. }
  454. .order-btn-box .btn.l {
  455. color: #333;
  456. border: 2rpx solid #333333;
  457. }
  458. .order-btn-box .viewDetail {
  459. background: #333333;
  460. border: none;
  461. color: #FFEBC4 !important;
  462. }
  463. /* .order-btn-box .btn.r {
  464. border: 1px solid #ff7911;
  465. color: #ff7911;
  466. } */
  467. </style>