多租户商城-商户小程序端
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.

742 lines
17 KiB

2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
  1. <template>
  2. <view class="container">
  3. <global-loading />
  4. <view class="content"
  5. style="padding-bottom:200upx;">
  6. <view class="order-list-box"
  7. v-for="(item,index) in retundlist"
  8. :key="index">
  9. <view class="item">
  10. <view class="order-info-box">
  11. <view class="order-info">
  12. <view class="order-info-item">
  13. <image :src="item.image"
  14. class="product-img"></image>
  15. <view class="info-box">
  16. <text class="product-name">{{ item.productName }}</text>
  17. <view class="product-sku">{{ item.value }}</view>
  18. <view class="price-sku-box">
  19. <text class="product-price">
  20. <text class="fuhao"></text>
  21. {{ item.price }}
  22. </text>
  23. <text class="product-num">x {{ item.number }}</text>
  24. </view>
  25. </view>
  26. </view>
  27. </view>
  28. </view>
  29. </view>
  30. </view>
  31. <view class="afterSale-select-box">
  32. <view class="item"
  33. @click="openStatusSelect">
  34. <view class="l">货物状态</view>
  35. <view class="r-box"
  36. v-model="ReturnMoneyQuery.goodsState"
  37. v-if="ReturnMoneyQuery.goodsState == 0">
  38. <text>未收到货</text>
  39. <image src="https://ceres.zkthink.com/static/images/arrowRight.png"
  40. class="r"></image>
  41. </view>
  42. <view class="r-box"
  43. v-model="ReturnMoneyQuery.goodsState"
  44. v-if="ReturnMoneyQuery.goodsState == 1">
  45. <text>已收到货</text>
  46. <image src="https://ceres.zkthink.com/static/images/arrowRight.png"
  47. class="r"></image>
  48. </view>
  49. </view>
  50. <view class="item"
  51. @click="openReasonSelect">
  52. <view class="l">退款原因</view>
  53. <view class="r-box">
  54. <text v-model="ReturnMoneyQuery.returnReason">{{ liyoutext }}</text>
  55. <image src="https://ceres.zkthink.com/static/images/arrowRight.png"
  56. class="r"></image>
  57. </view>
  58. </view>
  59. </view>
  60. <view class="afterSale-select-box mt20">
  61. <view class="item">
  62. <view class="l">退款金额
  63. <text class="order-status">¥ {{ sellPriceitem.toFixed(2) }}</text>
  64. </view>
  65. </view>
  66. <view class="item item-start">
  67. <view class="l">退款说明</view>
  68. <view class="r-box r-box2">
  69. <input v-model="ReturnMoneyQuery.returnDesc"
  70. maxlength="200"
  71. type="text"
  72. placeholder="选填"
  73. class="r-box-input"></input>
  74. </view>
  75. </view>
  76. </view>
  77. <view class="afterSale-select-box mt20">
  78. <view class="upload-title">上传凭证</view>
  79. <view class="mar-left-10 mar-top-10">
  80. <u-upload :limitType="['png', 'jpg', 'jpeg', 'webp', 'gif', 'image']"
  81. max-count="4"
  82. :action="action"
  83. ref="uUpload"
  84. :header="headerToken"
  85. :form-data="formData"></u-upload>
  86. </view>
  87. </view>
  88. <view class="order-flow-box">
  89. <view class="flow-word">退款流程</view>
  90. <view class="flow-word mt25">
  91. <text>1退货说明并提交</text>
  92. <text>22天内等待卖家处理超时默认同意退款</text>
  93. <text>3卖家同意退款金额原路退还</text>
  94. </view>
  95. <view class="flow-word mt50">退款金额以实际支付价格为准</view>
  96. </view>
  97. </view>
  98. <view class="order-confirm-box"
  99. style="padding-top:30upx;"
  100. :style="{'padding-bottom':(isIphone==true? 90:0)+'rpx'}">
  101. <text class="btn"
  102. @click="confirmTap">提交
  103. </text>
  104. </view>
  105. <!-- 货物状态弹框 -->
  106. <u-popup v-model="cargoStatusShowFalg"
  107. mode="center"
  108. border-radius="14"
  109. width="80%"
  110. closeable="true">
  111. <view class="alert-box">
  112. <view class="afterSale-status-box">
  113. <view class="status-title">货物状态</view>
  114. <view class="item-box">
  115. <view class="item"
  116. @click="ReturnMoneyQuery.goodsState = 0">
  117. <text class="status-select-title">未收到货</text>
  118. <image mode="aspectFill"
  119. src="https://ceres.zkthink.com/static/images/selectActive.png"
  120. v-if="ReturnMoneyQuery.goodsState == 0"
  121. class="status-select-img"></image>
  122. <image mode="aspectFill"
  123. src="https://ceres.zkthink.com/static/images/selectEmpty.png"
  124. v-else
  125. class="status-select-img"></image>
  126. </view>
  127. <view class="item"
  128. @click="ReturnMoneyQuery.goodsState = 1">
  129. <text class="status-select-title">已收到货</text>
  130. <image mode="aspectFill"
  131. src="https://ceres.zkthink.com/static/images/selectActive.png"
  132. v-if="ReturnMoneyQuery.goodsState == 1"
  133. class="status-select-img"></image>
  134. <image mode="aspectFill"
  135. src="https://ceres.zkthink.com/static/images/selectEmpty.png"
  136. v-else
  137. class="status-select-img"></image>
  138. </view>
  139. </view>
  140. <view class="status-btn"
  141. @click="closeStatusSelect">确定
  142. </view>
  143. </view>
  144. </view>
  145. </u-popup>
  146. <!-- 退款原因弹框 -->
  147. <!-- 退款原因弹框 -->
  148. <u-popup v-model="reasonShowFalg"
  149. mode="center"
  150. border-radius="14"
  151. width="80%"
  152. closeable="true">
  153. <view class="alert-box">
  154. <view class="afterSale-status-box"
  155. scroll-y>
  156. <view class="status-title">退款原因</view>
  157. <view class="item-box">
  158. <view class="item"
  159. @click="returnReasonTap(item,index)"
  160. v-for="(item,index) in liyouData"
  161. :key="index">
  162. <text class="status-select-title">{{ item }}</text>
  163. <image mode="aspectFill"
  164. src="https://ceres.zkthink.com/static/images/selectActive.png"
  165. v-if="ReturnMoneyQuery.returnReason == index"
  166. class="status-select-img"></image>
  167. <image mode="aspectFill"
  168. src="https://ceres.zkthink.com/static/images/selectEmpty.png"
  169. v-else
  170. class="status-select-img"></image>
  171. </view>
  172. </view>
  173. <view class="status-btn"
  174. @click="closeReasonSelect">确定
  175. </view>
  176. </view>
  177. </view>
  178. </u-popup>
  179. </view>
  180. </template>
  181. <script>
  182. const NET = require('../../utils/request')
  183. const API = require('../../config/api')
  184. export default {
  185. data() {
  186. return {
  187. returnImgsList: 1,
  188. cargoStatusShowFalg: false,
  189. reasonShowFalg: false,
  190. returnReasonIndex: 1,
  191. item: {},
  192. ReturnMoneyQuery: {
  193. goodsState: 1,
  194. orderCode: "",
  195. orderProductIds: "",
  196. refundFee: 0,
  197. returnDesc: "",
  198. returnImgs: "",
  199. returnReason: 0,
  200. returnType: 0
  201. },
  202. action: API.UploadUrl,
  203. formData: {'folderId': -1},
  204. headerToken: {Authorization: ''},
  205. fileList: [],
  206. sellPriceitem: 0,//退款价格
  207. listitemid: '', //选中商品的id
  208. orderCode: '', // 选中订单编码
  209. liyouData: [],
  210. liyoutext: '',
  211. liyouindex: '',
  212. retundlist: [],
  213. orderId: 0,
  214. isIphone: false,
  215. isAllSelect: 0,
  216. }
  217. },
  218. onReady() {
  219. this.isIphone = getApp().globalData.isIphone;
  220. this.fileList = this.$refs.uUpload.lists
  221. },
  222. async onLoad(option) {
  223. this.retundlist = JSON.parse(decodeURIComponent(option.list))
  224. this.orderId = option.orderId
  225. this.isAllSelect = option.isAllSelect
  226. this.retundlist.forEach(el => {
  227. this.sellPriceitem = this.sellPriceitem + el.number * el.price
  228. })
  229. this.getReasonEnums()
  230. this.sellPriceitem = await this.HandleGetRefundMoney()
  231. },
  232. methods: {
  233. // 算钱
  234. HandleGetRefundMoney() {
  235. return new Promise((resolve, reject) => {
  236. // uni.showLoading({
  237. // title: "计算中..."
  238. // })
  239. let postData = {
  240. orderId: this.orderId,
  241. isAllSelect: this.isAllSelect==1 ? 1 : 0,
  242. skus: this.retundlist,
  243. afterType:2,
  244. goodsState:this.ReturnMoneyQuery.goodsState
  245. }
  246. NET.request(API.GetRefundMoney, postData, "POST").then(res => {
  247. uni.hideLoading()
  248. resolve (parseFloat(res.json))
  249. }).catch(err=>{
  250. uni.hideLoading()
  251. })
  252. })
  253. },
  254. confirmTap() {
  255. if (this.fileList.length > 0) {
  256. this.commentImgsFlag = true
  257. for (let i = 0; i < this.fileList.length; i++) {
  258. this.commentImgs += this.fileList[i].response.data.url + ','
  259. }
  260. }
  261. this.ReturnMoney()
  262. },
  263. getReasonEnums() {
  264. NET.request(API.ReasonEnums, 'GET').then(res => {
  265. this.liyouData = res.data
  266. this.liyoutext = this.liyouData[0]
  267. }).catch(res => {
  268. })
  269. },
  270. ReturnMoney() {
  271. if (this.ReturnMoneyQuery.goodsState === '') {
  272. uni.showToast({
  273. title: '请选择货物状态!',
  274. duration: 2000,
  275. icon: 'none'
  276. });
  277. } else if (this.liyoutext === '') {
  278. uni.showToast({
  279. title: '请选择退货原因!',
  280. duration: 2000,
  281. icon: 'none'
  282. });
  283. } else {
  284. // uni.showLoading({
  285. // mask: true,
  286. // title: '正在提交...',
  287. // })
  288. let skusobjdata = []
  289. this.retundlist.forEach((i) => {
  290. let skusobj = {}
  291. skusobj["skuId"] = i.skuId
  292. skusobj["number"] = i.number
  293. skusobjdata.push(skusobj)
  294. })
  295. NET.request(API.ApplyReturnMoney, {
  296. orderId: this.orderId,
  297. afterType: 2,
  298. goodsState: this.ReturnMoneyQuery.goodsState,
  299. price: this.sellPriceitem,
  300. returnReason: this.liyoutext,
  301. explain: this.ReturnMoneyQuery.returnDesc,
  302. image: this.commentImgs,
  303. skus: skusobjdata,
  304. isAllSelect: this.isAllSelect
  305. }, 'POST').then(res => {
  306. uni.hideLoading()
  307. uni.showToast({
  308. title: '提交成功'
  309. })
  310. setTimeout(() => {
  311. uni.redirectTo({
  312. url:'/pages_category_page2/orderModule/afterSale'
  313. })
  314. }, 1500)
  315. }).catch(res => {
  316. uni.showToast({
  317. title: '商品已在售后,请勿重新操作!',
  318. duration: 2000,
  319. icon: 'none'
  320. });
  321. uni.hideLoading()
  322. })
  323. }
  324. },
  325. // 理由
  326. returnReasonTap(item, index) {
  327. this.ReturnMoneyQuery.returnReason = index
  328. this.liyoutext = item
  329. },
  330. openStatusSelect() {
  331. this.cargoStatusShowFalg = true
  332. },
  333. openReasonSelect() {
  334. this.reasonShowFalg = true
  335. },
  336. async closeStatusSelect() {
  337. this.cargoStatusShowFalg = false
  338. this.sellPriceitem = await this.HandleGetRefundMoney()
  339. },
  340. closeReasonSelect() {
  341. this.reasonShowFalg = false
  342. },
  343. }
  344. }
  345. </script>
  346. <style lang="scss">
  347. .content {
  348. padding: 0 0 120upx;
  349. box-sizing: border-box;
  350. }
  351. .order-list-box {
  352. padding: 20upx 30upx;
  353. box-sizing: border-box;
  354. }
  355. .order-list-box .item {
  356. /* margin-bottom: 20upx; */
  357. background: #fff;
  358. border-radius: 10upx;
  359. }
  360. .order-list-top {
  361. height: 96upx;
  362. padding: 0 30upx;
  363. box-sizing: border-box;
  364. display: flex;
  365. flex-direction: row;
  366. align-items: center;
  367. justify-content: space-between;
  368. border-bottom: 1px solid #eee;
  369. }
  370. .top-l {
  371. display: flex;
  372. flex-direction: row;
  373. align-items: center;
  374. }
  375. .shop-img {
  376. width: 36upx;
  377. height: 36upx;
  378. margin-right: 10upx;
  379. }
  380. .shop-name {
  381. font-size: 30upx;
  382. color: #333;
  383. font-weight: bold;
  384. }
  385. .arrow-img {
  386. margin-left: 15upx;
  387. width: 24upx;
  388. height: 24upx;
  389. }
  390. .order-status {
  391. font-size: 28upx;
  392. color: #C83732;
  393. font-weight: 500;
  394. }
  395. .order-info-box {
  396. padding: 0 30upx;
  397. box-sizing: border-box;
  398. }
  399. .order-info {
  400. /* border-bottom: 1px solid #eee; */
  401. }
  402. .order-info-item {
  403. display: flex;
  404. flex-direction: row;
  405. padding: 20upx 0;
  406. border-bottom: solid 1px #eee;
  407. }
  408. .order-info-item:last-child {
  409. border-bottom: none;
  410. }
  411. .product-img {
  412. width: 180upx;
  413. height: 180upx;
  414. border-radius: 10upx;
  415. margin-right: 30upx;
  416. }
  417. .info-box {
  418. flex: 1;
  419. display: flex;
  420. flex-direction: column;
  421. }
  422. .product-name {
  423. font-size: 26upx;
  424. color: #333;
  425. height: 68upx;
  426. line-height: 34upx;
  427. display: -webkit-box;
  428. overflow: hidden;
  429. text-overflow: ellipsis;
  430. word-break: break-all;
  431. -webkit-box-orient: vertical;
  432. -webkit-line-clamp: 2;
  433. }
  434. .price-sku-box {
  435. display: flex;
  436. flex-direction: row;
  437. justify-content: space-between;
  438. }
  439. .product-sku {
  440. font-size: 24upx;
  441. color: #999;
  442. margin-top: 30upx;
  443. }
  444. .product-price {
  445. font-size: 28upx;
  446. color: #333;
  447. font-weight: 400;
  448. }
  449. .product-price .fuhao {
  450. font-size: 28upx;
  451. }
  452. .product-num {
  453. font-size: 28upx;
  454. color: #999;
  455. }
  456. .afterSale-select-box {
  457. width: 100%;
  458. background: #fff;
  459. padding: 0 30upx;
  460. box-sizing: border-box;
  461. }
  462. .afterSale-select-box .item {
  463. height: 100upx;
  464. border-bottom: 1px solid #e5e5e5;
  465. display: flex;
  466. flex-direction: row;
  467. align-items: center;
  468. justify-content: space-between;
  469. font-size: 28upx;
  470. color: #333;
  471. }
  472. .afterSale-select-box .item:last-of-type {
  473. border-bottom: none;
  474. }
  475. .afterSale-select-box .item.item-start {
  476. justify-content: flex-start;
  477. }
  478. .afterSale-select-box .item .l {
  479. display: flex;
  480. flex-direction: row;
  481. align-items: center;
  482. }
  483. .afterSale-select-box .item .afterSale-img {
  484. width: 26upx;
  485. height: 26upx;
  486. margin-right: 20upx;
  487. }
  488. .afterSale-select-box .item .r-box {
  489. display: flex;
  490. flex-direction: row;
  491. align-items: center;
  492. color: #999;
  493. }
  494. .afterSale-select-box .item .r-box2 {
  495. width: 100%;
  496. flex: 1;
  497. }
  498. .afterSale-select-box .item .r {
  499. width: 24upx;
  500. height: 24upx;
  501. margin-left: 10upx;
  502. }
  503. .afterSale-select-box .line {
  504. border-bottom: 1px solid #e5e5e5;
  505. }
  506. .mt20 {
  507. margin-top: 20upx;
  508. }
  509. .r-box-input {
  510. text-align: left;
  511. flex: 1;
  512. z-index: 0;
  513. }
  514. .upload-title {
  515. font-size: 28upx;
  516. color: #333;
  517. padding: 30upx 0;
  518. }
  519. .upload-img-box {
  520. display: flex;
  521. flex-direction: row;
  522. flex-wrap: wrap;
  523. padding: 0 0 30upx;
  524. align-items: flex-start;
  525. }
  526. .upload-img-box .single {
  527. display: flex;
  528. flex-direction: row;
  529. align-items: flex-end;
  530. }
  531. .upload-img-box .upload-img-item-box {
  532. position: relative;
  533. }
  534. .upload-img-box .upload-img-item {
  535. width: 150upx;
  536. height: 150upx;
  537. border-radius: 8upx;
  538. margin: 0 50upx 30upx 0;
  539. }
  540. .upload-img-box .upload-img-item:nth-of-type(3n) {
  541. margin-right: 0;
  542. }
  543. .upload-img-box .afterSale-close-img {
  544. position: absolute;
  545. top: -20upx;
  546. left: 110upx;
  547. width: 50upx;
  548. height: 50upx;
  549. border: 5upx solid #fff;
  550. border-radius: 50%;
  551. }
  552. .upload-img-box .single .jiahao {
  553. font-size: 70upx;
  554. color: #999;
  555. font-weight: 100;
  556. }
  557. .upload-img-box .single .upload-word {
  558. font-size: 24upx;
  559. color: #999;
  560. }
  561. .upload-img-box .single-kuang {
  562. width: 150upx;
  563. height: 150upx;
  564. background: #f5f5f5;
  565. border-radius: 8upx;
  566. display: flex;
  567. flex-direction: column;
  568. align-items: center;
  569. }
  570. .upload-img-box .single-num {
  571. margin-left: 10upx;
  572. font-size: 24upx;
  573. color: #999;
  574. }
  575. .order-flow-box {
  576. display: flex;
  577. flex-direction: column;
  578. padding: 30upx;
  579. box-sizing: border-box;
  580. }
  581. .flow-word {
  582. font-size: 24upx;
  583. color: #999;
  584. display: flex;
  585. flex-direction: column;
  586. }
  587. .mt25 {
  588. margin-top: 20upx;
  589. }
  590. .mt50 {
  591. margin-top: 30upx;
  592. margin-bottom: 20upx;
  593. }
  594. .order-confirm-box {
  595. position: fixed;
  596. bottom: 0;
  597. left: 0;
  598. width: 100%;
  599. height: 160upx;
  600. background: #fff;
  601. padding: 0 30upx;
  602. box-sizing: border-box;
  603. display: flex;
  604. flex-direction: row;
  605. align-items: center;
  606. justify-content: center;
  607. }
  608. .order-confirm-box .btn {
  609. width: 100%;
  610. height: 100upx;
  611. line-height: 100upx;
  612. background: #333333;
  613. font-size: 28upx;
  614. color: #FFEBC4;
  615. text-align: center;
  616. }
  617. .alert-box {
  618. width: 100%;
  619. height: 100%;
  620. background: rgba(0, 0, 0, 0.5);
  621. }
  622. .afterSale-status-box {
  623. width: 100%;
  624. background: #fff;
  625. border-radius: 15upx 15upx 0upx 0upx;
  626. }
  627. .status-title {
  628. width: 100%;
  629. height: 140upx;
  630. background: #fff;
  631. border-radius: 15upx 15upx 0 0;
  632. font-size: 34upx;
  633. color: #333;
  634. text-align: center;
  635. line-height: 140upx;
  636. }
  637. .afterSale-status-box .item {
  638. display: flex;
  639. flex-direction: row;
  640. align-items: center;
  641. justify-content: space-between;
  642. border-bottom: 1px solid #e5e5e5;
  643. }
  644. .afterSale-status-box .item:last-of-type {
  645. border-bottom: none;
  646. }
  647. .afterSale-status-box .item-box {
  648. padding: 0 0 60upx 0;
  649. }
  650. .afterSale-status-box .status-select-title {
  651. padding: 0 0 0 30upx;
  652. box-sizing: border-box;
  653. font-size: 28upx;
  654. color: #333;
  655. }
  656. .afterSale-status-box .status-select-img {
  657. width: 40upx;
  658. height: 40upx;
  659. margin: 30upx;
  660. box-sizing: border-box;
  661. }
  662. .afterSale-status-box .status-btn {
  663. width: 100%;
  664. height: 100upx;
  665. line-height: 100upx;
  666. background: #333333;
  667. font-size: 28upx;
  668. color: #FFEBC4;
  669. text-align: center;
  670. }
  671. </style>