index.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571
  1. <template>
  2. <view class="container">
  3. <JHeader title="申请退货" width="50" height="50" style="padding: 24upx 0 0;"></JHeader>
  4. <view class="content" style="padding-bottom:200upx;">
  5. <view v-for="(item, index) in retundlist" :key="index" class="order-list-box">
  6. <view class="item">
  7. <view class="order-info-box">
  8. <view class="order-info">
  9. <view class="order-info-item">
  10. <image :src="common.seamingImgUrl(item.image)" class="product-img"></image>
  11. <view class="info-box">
  12. <text class="product-name">{{ item.productName }}</text>
  13. <view class="product-sku">{{ item.value }}</view>
  14. <view class="price-sku-box">
  15. <text class="product-price">
  16. <text class="fuhao">¥</text>
  17. {{ item.price }}
  18. </text>
  19. <text class="product-num">x {{ item.number }}</text>
  20. </view>
  21. </view>
  22. </view>
  23. </view>
  24. </view>
  25. </view>
  26. </view>
  27. <view class="afterSale-select-box">
  28. <view class="item" @click="openStatusSelect">
  29. <view class="l">货物状态</view>
  30. <view v-if="ReturnMoneyQuery.goodsState == 0" class="r-box">
  31. <text>未收到货</text>
  32. <tui-icon name="arrowright" :size="48" unit="upx" color="#999999" margin="0 0 0 10upx"></tui-icon>
  33. </view>
  34. <view v-if="ReturnMoneyQuery.goodsState == 1" class="r-box">
  35. <text>已收到货</text>
  36. <tui-icon name="arrowright" :size="48" unit="upx" color="#999999" margin="0 0 0 10upx"></tui-icon>
  37. </view>
  38. </view>
  39. <view class="item" @click="openReasonSelect">
  40. <view class="l">退款原因</view>
  41. <view class="r-box">
  42. <text>{{ liyoutext }}</text>
  43. <tui-icon name="arrowright" :size="48" unit="upx" color="#999999" margin="0 0 0 10upx"></tui-icon>
  44. </view>
  45. </view>
  46. </view>
  47. <view class="afterSale-select-box mt20">
  48. <view class="item">
  49. <view class="l">
  50. 退款金额:
  51. <text class="order-status">¥ {{ sellPriceitem.toFixed(2) }}</text>
  52. </view>
  53. </view>
  54. <view class="item item-start">
  55. <view class="l">退款说明:</view>
  56. <view class="r-box r-box2">
  57. <input
  58. v-model="ReturnMoneyQuery.returnDesc" maxlength="200" type="text" placeholder="选填"
  59. class="r-box-input"
  60. ></input>
  61. </view>
  62. </view>
  63. </view>
  64. <view class="afterSale-select-box mt20">
  65. <view class="upload-title">上传凭证</view>
  66. <view class="mar-left-10 mar-top-10">
  67. <ATFMoreUpload :imgs="fileList" @upload="handleSaveImg" @delete="handleDeleteImg"></ATFMoreUpload>
  68. </view>
  69. </view>
  70. <view class="order-flow-box">
  71. <view class="flow-word">退款流程:</view>
  72. <view class="flow-word mt25">
  73. <text>1、退货说明并提交</text>
  74. <text>2、2天内等待卖家处理,超时默认同意退款</text>
  75. <text>3、卖家同意,退款金额原路退还</text>
  76. </view>
  77. <view class="flow-word mt50">注:退款金额以实际支付价格为准</view>
  78. </view>
  79. </view>
  80. <view
  81. class="order-confirm-box" style="padding-top:30upx;"
  82. :style="{ 'padding-bottom': (isIphone == true ? 90 : 0) + 'rpx' }"
  83. >
  84. <text class="btn" @click="confirmTap">
  85. 提交
  86. </text>
  87. </view>
  88. <!-- 货物状态弹框 -->
  89. <tui-bottom-popup :show="cargoStatusShowFalg" @close="closeStatusSelect">
  90. <view class="alert-box">
  91. <view class="afterSale-status-box">
  92. <view class="status-title">货物状态</view>
  93. <view class="item-box">
  94. <view class="item" @click="ReturnMoneyQuery.goodsState = 0">
  95. <text class="status-select-title">未收到货</text>
  96. <tui-icon
  97. v-if="ReturnMoneyQuery.goodsState == 0" name="circle-fill" :size="40" unit="upx"
  98. color="#c5aa7b"
  99. margin="30upx"
  100. ></tui-icon>
  101. <tui-icon v-else name="circle" :size="40" unit="upx" color="#cccccc" margin="30upx"></tui-icon>
  102. </view>
  103. <view class="item" @click="ReturnMoneyQuery.goodsState = 1">
  104. <text class="status-select-title">已收到货</text>
  105. <tui-icon
  106. v-if="ReturnMoneyQuery.goodsState == 1" name="circle-fill" :size="40" unit="upx"
  107. color="#c5aa7b"
  108. margin="30upx"
  109. ></tui-icon>
  110. <tui-icon v-else name="circle" :size="40" unit="upx" color="#cccccc" margin="30upx"></tui-icon>
  111. </view>
  112. </view>
  113. <view class="status-btn" @click="closeStatusSelect">
  114. 确定
  115. </view>
  116. </view>
  117. </view>
  118. </tui-bottom-popup>
  119. <!-- 退款原因弹框 -->
  120. <tui-bottom-popup :show="reasonShowFalg" @close="reasonShowFalg = false">
  121. <view class="alert-box">
  122. <view class="afterSale-status-box" scroll-y>
  123. <view class="status-title">退款原因</view>
  124. <view class="item-box">
  125. <view v-for="(item, index) in liyouData" :key="index" class="item" @click="returnReasonTap(item, index)">
  126. <text class="status-select-title">{{ item }}</text>
  127. <tui-icon
  128. v-if="ReturnMoneyQuery.returnReason == index" name="circle-fill" :size="40" unit="upx"
  129. color="#c5aa7b" margin="30upx"
  130. ></tui-icon>
  131. <tui-icon v-else name="circle" :size="40" unit="upx" color="#cccccc" margin="30upx"></tui-icon>
  132. </view>
  133. </view>
  134. <view class="status-btn" @click="closeReasonSelect">
  135. 确定
  136. </view>
  137. </view>
  138. </view>
  139. </tui-bottom-popup>
  140. </view>
  141. </template>
  142. <script>
  143. import { getReturnPriceRefundMoneyApi, getReasonSelectEnumsApi, updateApplyReturnMoneySubmitApi } from '../../../api/anotherTFInterface'
  144. export default {
  145. name: 'AfterSaleApplyRetund',
  146. data() {
  147. return {
  148. cargoStatusShowFalg: false,
  149. reasonShowFalg: false,
  150. ReturnMoneyQuery: {
  151. goodsState: 1,
  152. orderCode: '',
  153. orderProductIds: '',
  154. refundFee: 0,
  155. returnDesc: '',
  156. returnImgs: '',
  157. returnReason: 0,
  158. returnType: 0
  159. },
  160. fileList: [],
  161. sellPriceitem: 0, // 退款价格
  162. liyouData: [],
  163. liyoutext: '',
  164. retundlist: [],
  165. orderId: 0,
  166. isIphone: false,
  167. isAllSelect: 0,
  168. commentImgs: ''
  169. }
  170. },
  171. onReady() {
  172. this.isIphone = getApp().globalData.isIphone
  173. },
  174. async onLoad(option) {
  175. if (option.list) this.retundlist = JSON.parse(decodeURIComponent(option.list))
  176. this.orderId = option.orderId
  177. this.isAllSelect = option.isAllSelect
  178. this.retundlist.forEach((el) => {
  179. this.sellPriceitem = this.sellPriceitem + el.number * el.price
  180. })
  181. this.getReasonEnums()
  182. this.sellPriceitem = await this.HandleGetRefundMoney()
  183. },
  184. methods: {
  185. handleSaveImg(imgUrl) {
  186. this.fileList.push(imgUrl)
  187. this.$forceUpdate()
  188. },
  189. handleDeleteImg(imgUrl) {
  190. this.fileList.splice(this.fileList.findIndex((item) => item === imgUrl), 1)
  191. this.$forceUpdate()
  192. },
  193. // 算钱
  194. HandleGetRefundMoney() {
  195. return new Promise((resolve, reject) => {
  196. // uni.showLoading({
  197. // title: "计算中..."
  198. // })
  199. const postData = {
  200. orderId: this.orderId,
  201. isAllSelect: this.isAllSelect == 1 ? 1 : 0,
  202. skus: this.retundlist,
  203. afterType: 2,
  204. goodsState: this.ReturnMoneyQuery.goodsState
  205. }
  206. getReturnPriceRefundMoneyApi(postData).then((res) => {
  207. uni.hideLoading()
  208. resolve(parseFloat(res.json))
  209. })
  210. .catch((e) => {
  211. uni.hideLoading()
  212. })
  213. })
  214. },
  215. confirmTap() {
  216. if (this.fileList.length > 0) {
  217. for (let i = 0; i < this.fileList.length; i++) {
  218. this.commentImgs += this.fileList[i] + ','
  219. }
  220. }
  221. this.ReturnMoney()
  222. },
  223. getReasonEnums() {
  224. getReasonSelectEnumsApi({}).then((res) => {
  225. this.liyouData = res.data
  226. this.liyoutext = this.liyouData[0]
  227. })
  228. },
  229. ReturnMoney() {
  230. if (this.ReturnMoneyQuery.goodsState === '') {
  231. uni.showToast({
  232. title: '请选择货物状态!',
  233. duration: 2000,
  234. icon: 'none'
  235. })
  236. } else if (this.liyoutext === '') {
  237. uni.showToast({
  238. title: '请选择退货原因!',
  239. duration: 2000,
  240. icon: 'none'
  241. })
  242. } else {
  243. uni.showLoading({
  244. mask: true,
  245. title: '正在提交...'
  246. })
  247. const skusobjdata = []
  248. this.retundlist.forEach((i) => {
  249. const skusobj = {}
  250. skusobj.skuId = i.skuId
  251. skusobj.number = i.number
  252. skusobjdata.push(skusobj)
  253. })
  254. updateApplyReturnMoneySubmitApi({
  255. orderId: this.orderId,
  256. afterType: 2,
  257. goodsState: this.ReturnMoneyQuery.goodsState,
  258. price: this.sellPriceitem,
  259. returnReason: this.liyoutext,
  260. explain: this.ReturnMoneyQuery.returnDesc,
  261. image: this.commentImgs,
  262. skus: skusobjdata,
  263. isAllSelect: this.isAllSelect
  264. }).then((res) => {
  265. uni.hideLoading()
  266. uni.showToast({
  267. title: '提交成功'
  268. })
  269. setTimeout(() => {
  270. uni.redirectTo({
  271. url: `/another-tf/another-serve/afterSale/index`
  272. })
  273. }, 1500)
  274. })
  275. .catch((e) => {
  276. uni.showToast({
  277. title: '商品已在售后,请勿重新操作!',
  278. duration: 2000,
  279. icon: 'none'
  280. })
  281. uni.hideLoading()
  282. })
  283. }
  284. },
  285. // 理由
  286. returnReasonTap(item, index) {
  287. this.ReturnMoneyQuery.returnReason = index
  288. this.liyoutext = item
  289. },
  290. openStatusSelect() {
  291. this.cargoStatusShowFalg = true
  292. },
  293. openReasonSelect() {
  294. this.reasonShowFalg = true
  295. },
  296. async closeStatusSelect() {
  297. this.cargoStatusShowFalg = false
  298. this.sellPriceitem = await this.HandleGetRefundMoney()
  299. },
  300. closeReasonSelect() {
  301. this.reasonShowFalg = false
  302. }
  303. }
  304. }
  305. </script>
  306. <style lang="less" scoped>
  307. .content {
  308. padding: 0 0 120upx;
  309. box-sizing: border-box;
  310. }
  311. .order-list-box {
  312. padding: 20upx 30upx;
  313. box-sizing: border-box;
  314. }
  315. .order-list-box .item {
  316. /* margin-bottom: 20upx; */
  317. background: #fff;
  318. border-radius: 10upx;
  319. }
  320. .order-status {
  321. font-size: 28upx;
  322. color: #C83732;
  323. font-weight: 500;
  324. }
  325. .order-info-box {
  326. padding: 0 30upx;
  327. box-sizing: border-box;
  328. }
  329. .order-info-item {
  330. display: flex;
  331. flex-direction: row;
  332. padding: 20upx 0;
  333. border-bottom: solid 1px #eee;
  334. }
  335. .order-info-item:last-child {
  336. border-bottom: none;
  337. }
  338. .product-img {
  339. width: 180upx;
  340. height: 180upx;
  341. border-radius: 10upx;
  342. margin-right: 30upx;
  343. }
  344. .info-box {
  345. flex: 1;
  346. display: flex;
  347. flex-direction: column;
  348. }
  349. .product-name {
  350. font-size: 26upx;
  351. color: #333;
  352. height: 68upx;
  353. line-height: 34upx;
  354. display: -webkit-box;
  355. overflow: hidden;
  356. text-overflow: ellipsis;
  357. word-break: break-all;
  358. -webkit-box-orient: vertical;
  359. -webkit-line-clamp: 2;
  360. }
  361. .price-sku-box {
  362. display: flex;
  363. flex-direction: row;
  364. justify-content: space-between;
  365. }
  366. .product-sku {
  367. font-size: 24upx;
  368. color: #999;
  369. margin-top: 30upx;
  370. }
  371. .product-price {
  372. font-size: 28upx;
  373. color: #333;
  374. font-weight: 400;
  375. }
  376. .product-price .fuhao {
  377. font-size: 28upx;
  378. }
  379. .product-num {
  380. font-size: 28upx;
  381. color: #999;
  382. }
  383. .afterSale-select-box {
  384. width: 100%;
  385. background: #fff;
  386. padding: 0 30upx;
  387. box-sizing: border-box;
  388. }
  389. .afterSale-select-box .item {
  390. height: 100upx;
  391. border-bottom: 1px solid #e5e5e5;
  392. display: flex;
  393. flex-direction: row;
  394. align-items: center;
  395. justify-content: space-between;
  396. font-size: 28upx;
  397. color: #333;
  398. }
  399. .afterSale-select-box .item:last-of-type {
  400. border-bottom: none;
  401. }
  402. .afterSale-select-box .item.item-start {
  403. justify-content: flex-start;
  404. }
  405. .afterSale-select-box .item .l {
  406. display: flex;
  407. flex-direction: row;
  408. align-items: center;
  409. }
  410. .afterSale-select-box .item .r-box {
  411. display: flex;
  412. flex-direction: row;
  413. align-items: center;
  414. color: #999;
  415. }
  416. .afterSale-select-box .item .r-box2 {
  417. width: 100%;
  418. flex: 1;
  419. }
  420. .mt20 {
  421. margin-top: 20upx;
  422. }
  423. .r-box-input {
  424. text-align: left;
  425. flex: 1;
  426. z-index: 0;
  427. }
  428. .upload-title {
  429. font-size: 28upx;
  430. color: #333;
  431. padding: 30upx 0;
  432. }
  433. .order-flow-box {
  434. display: flex;
  435. flex-direction: column;
  436. padding: 30upx;
  437. box-sizing: border-box;
  438. }
  439. .flow-word {
  440. font-size: 24upx;
  441. color: #999;
  442. display: flex;
  443. flex-direction: column;
  444. }
  445. .mt25 {
  446. margin-top: 20upx;
  447. }
  448. .mt50 {
  449. margin-top: 30upx;
  450. margin-bottom: 20upx;
  451. }
  452. .order-confirm-box {
  453. position: fixed;
  454. bottom: 0;
  455. left: 0;
  456. width: 100%;
  457. height: 160upx;
  458. background: #fff;
  459. padding: 0 30upx;
  460. box-sizing: border-box;
  461. display: flex;
  462. flex-direction: row;
  463. align-items: center;
  464. justify-content: center;
  465. }
  466. .order-confirm-box .btn {
  467. width: 100%;
  468. height: 100upx;
  469. line-height: 100upx;
  470. background: #333333;
  471. font-size: 28upx;
  472. color: #FFEBC4;
  473. text-align: center;
  474. }
  475. .alert-box {
  476. width: 100%;
  477. height: 100%;
  478. background: rgba(0, 0, 0, 0.5);
  479. }
  480. .afterSale-status-box {
  481. width: 100%;
  482. background: #fff;
  483. border-radius: 15upx 15upx 0upx 0upx;
  484. }
  485. .status-title {
  486. width: 100%;
  487. height: 140upx;
  488. background: #fff;
  489. border-radius: 15upx 15upx 0 0;
  490. font-size: 34upx;
  491. color: #333;
  492. text-align: center;
  493. line-height: 140upx;
  494. }
  495. .afterSale-status-box .item {
  496. display: flex;
  497. flex-direction: row;
  498. align-items: center;
  499. justify-content: space-between;
  500. border-bottom: 1px solid #e5e5e5;
  501. }
  502. .afterSale-status-box .item:last-of-type {
  503. border-bottom: none;
  504. }
  505. .afterSale-status-box .item-box {
  506. padding: 0 0 60upx 0;
  507. }
  508. .afterSale-status-box .status-select-title {
  509. padding: 0 0 0 30upx;
  510. box-sizing: border-box;
  511. font-size: 28upx;
  512. color: #333;
  513. }
  514. .afterSale-status-box .status-btn {
  515. width: 100%;
  516. height: 100upx;
  517. line-height: 100upx;
  518. background: #333333;
  519. font-size: 28upx;
  520. color: #FFEBC4;
  521. text-align: center;
  522. }
  523. </style>