refund.vue 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430
  1. <!-- 申请售后 -->
  2. <template>
  3. <view class="refund-wrap">
  4. <!-- 售后商品 -->
  5. <view class="goods-box">
  6. <shopro-mini-card :title="orderItemDetail.goods_title" :image="orderItemDetail.goods_image">
  7. <template #describe>
  8. <view class="order-sku u-ellipsis-1">
  9. <text class="order-num">数量:{{ orderItemDetail.goods_num || 0 }};</text>
  10. {{ orderItemDetail.goods_sku_text ? orderItemDetail.goods_sku_text : '' }}
  11. </view>
  12. </template>
  13. <template #cardBottom>
  14. <view class="card-price-box u-flex">
  15. <text class="order-price font-OPPOSANS">¥{{ orderItemDetail.goods_price || 0 }}</text>
  16. <button class="u-reset-button status-btn" v-if="orderItemDetail.status_name">{{ orderItemDetail.status_name }}</button>
  17. </view>
  18. </template>
  19. </shopro-mini-card>
  20. </view>
  21. <!-- 售后类型 -->
  22. <view class="refund-item">
  23. <view class="item-title">请选择售后类型</view>
  24. <u-radio-group v-model="refundType" active-color="#d89f64" width="100%">
  25. <u-radio shape="circle" v-for="(item, index) in refundTypeList" :key="index" :name="item.value">{{ item.title }}</u-radio>
  26. </u-radio-group>
  27. </view>
  28. <!-- 申请原因 -->
  29. <view class="goods-item u-flex u-row-between" @tap="showModal = true">
  30. <text class="item-title">选择申请原因</text>
  31. <view class="u-flex refund-cause">
  32. <text class="u-m-r-20" style="color: #333;" v-if="refundCause">{{ refundCause }}</text>
  33. <text class="u-m-r-20" v-else>请选择申请原因~</text>
  34. <text class="u-iconfont uicon-arrow-right" style="color: #666"></text>
  35. </view>
  36. </view>
  37. <!-- 联系方式 -->
  38. <view class="refund-item u-m-b-20">
  39. <view class="item-title">联系方式</view>
  40. <view class="input-box u-flex"><input type="number" class="item-input" v-model="phone" placeholder="请输入您的联系电话" placeholder-class="input--pl" /></view>
  41. </view>
  42. <!-- 留言 -->
  43. <view class="refund-item u-m-b-20">
  44. <view class="item-title">相关描述</view>
  45. <view class="describe-box">
  46. <textarea
  47. class="describe-content"
  48. v-model="refundContent"
  49. maxlength="120"
  50. placeholder="客官~请描述您遇到的问题,建议上传照片"
  51. placeholder-class="input--pl"
  52. fixed
  53. ></textarea>
  54. <view class="upload-img">
  55. <u-upload
  56. :showProgress="false"
  57. @on-uploaded="uploadSuccess"
  58. @on-remove="uploadRemove"
  59. :action="`${$API_URL}index/upload`"
  60. width="140"
  61. height="140"
  62. maxCount="9"
  63. ></u-upload>
  64. </view>
  65. </view>
  66. </view>
  67. <!-- 底部按钮 -->
  68. <view class="foot-wrap safe-area-inset-bottom">
  69. <view class="foot_box u-flex u-row-between safe-area-inset-bottom">
  70. <button class="u-reset-button contcat-btn" @tap="onService">联系客服</button>
  71. <button class="u-reset-button sub-btn" @tap="postAftersale">提交</button>
  72. </view>
  73. </view>
  74. <!-- 申请原因弹窗 -->
  75. <u-popup v-model="showModal" safe-area-inset-bottom @close="showModal = false" mode="bottom" :closeable="true" close-icon-pos="top-left">
  76. <view class="modal-box page_box">
  77. <view class="modal-head head_box u-flex u-row-center u-col-center">{{ refundList.title }}</view>
  78. <view class="modal-content content_box">
  79. <view class="u-flex-col u-p-20">
  80. <u-radio-group v-model="refundCause" active-color="#d89f64" width="100%">
  81. <u-radio class="u-m-y-10" shape="circle" v-for="item in refundList.list" :key="item.id" :name="item.val">
  82. <text class="u-p-l-20">{{ item.val }}</text>
  83. </u-radio>
  84. </u-radio-group>
  85. </view>
  86. </view>
  87. <view class="modal-foot foot_box u-flex u-row-center u-col-center"><button class="u-reset-button close-btn" @tap="showModal = false">确定</button></view>
  88. </view>
  89. </u-popup>
  90. </view>
  91. </template>
  92. <script>
  93. export default {
  94. components: {},
  95. data() {
  96. return {
  97. showModal: false,
  98. imgList: [], //图片地址
  99. orderId: 0, //订单ID
  100. orderItemDetail: {}, //订单信息
  101. refundType: '', //售后类型
  102. refundCause: '', //退款原因
  103. refundContent: '', //相关描述
  104. phone: '', //联系方式
  105. refundTypeList: [
  106. //售后类型
  107. {
  108. title: '退款',
  109. value: 'refund'
  110. },
  111. {
  112. title: '退货',
  113. value: 'return'
  114. },
  115. {
  116. title: '其他',
  117. value: 'other'
  118. }
  119. ],
  120. refundList: {
  121. //申请原因
  122. title: '申请原因',
  123. list: [
  124. {
  125. id: 1,
  126. val: '卖家发错货了'
  127. },
  128. {
  129. id: 2,
  130. val: '退运费'
  131. },
  132. {
  133. id: 3,
  134. val: '大小/重量于商品描述不符'
  135. },
  136. {
  137. id: 4,
  138. val: '生产日期、保质期与商品不符'
  139. },
  140. {
  141. id: 5,
  142. val: '质量问题'
  143. }
  144. ]
  145. }
  146. };
  147. },
  148. computed: {},
  149. onLoad() {
  150. this.getOrderItemDetail();
  151. },
  152. methods: {
  153. // 跳转客服
  154. onService() {
  155. this.$Router.push('/pages/public/chat/index');
  156. },
  157. // 上传图片成功
  158. uploadSuccess(e) {
  159. this.imgList = [];
  160. e.forEach(item => {
  161. this.imgList.push(item.response.data.url);
  162. });
  163. },
  164. // 移除图片
  165. uploadRemove(index) {
  166. this.imgList.splice(index, 1);
  167. },
  168. // 订单item详情
  169. getOrderItemDetail() {
  170. let that = this;
  171. that.$http('order.itemDetail', {
  172. id: that.$Route.query.orderId,
  173. order_item_id: that.$Route.query.orderItemId
  174. }).then(res => {
  175. if (res.code === 1) {
  176. that.orderItemDetail = res.data;
  177. }
  178. });
  179. },
  180. // 提交售后
  181. postAftersale() {
  182. let that = this;
  183. that.$http('order.aftersale', {
  184. type: that.refundType,
  185. order_id: that.$Route.query.orderId,
  186. order_item_id: that.$Route.query.orderItemId,
  187. reason: that.refundCause,
  188. content: that.refundContent,
  189. images: that.imgList,
  190. phone: that.phone
  191. }, '申请中...').then(res => {
  192. if (res.code === 1) {
  193. // #ifdef MP-WEIXIN
  194. that.$store.commit('subscribeMessage', 'aftersale');
  195. // #endif
  196. that.$Router.back();
  197. }
  198. });
  199. }
  200. }
  201. };
  202. </script>
  203. <style lang="scss">
  204. // 售后项目
  205. .refund-item {
  206. background-color: #fff;
  207. border-bottom: 1rpx solid #f5f5f5;
  208. padding: 30rpx;
  209. .item-title {
  210. font-size: 30rpx;
  211. font-weight: bold;
  212. color: rgba(51, 51, 51, 1);
  213. margin-bottom: 20rpx;
  214. }
  215. // 留言
  216. .describe-box {
  217. width: 690rpx;
  218. background: rgba(249, 250, 251, 1);
  219. border-radius: 20rpx;
  220. .describe-content {
  221. width: 660rpx;
  222. padding: 30rpx;
  223. height: 200rpx;
  224. font-size: 24rpx;
  225. font-weight: 400;
  226. color: #333;
  227. }
  228. }
  229. .input--pl {
  230. font-size: 24rpx;
  231. font-weight: 400;
  232. color: rgba(177, 179, 199, 1);
  233. }
  234. // 联系方式
  235. .input-box {
  236. height: 84rpx;
  237. background: rgba(249, 250, 251, 1);
  238. border-radius: 20rpx;
  239. .item-input {
  240. padding: 0 30rpx;
  241. flex: 1;
  242. font-size: 28rpx;
  243. font-weight: 400;
  244. color: #333;
  245. }
  246. }
  247. }
  248. .goods-box {
  249. background: #fff;
  250. padding: 20rpx;
  251. margin-bottom: 20rpx;
  252. .order-sku {
  253. font-size: 24rpx;
  254. font-weight: 400;
  255. color: rgba(153, 153, 153, 1);
  256. width: 450rpx;
  257. margin-bottom: 20rpx;
  258. .order-num {
  259. margin-right: 10rpx;
  260. }
  261. }
  262. .card-price-box {
  263. .status-btn {
  264. height: 32rpx;
  265. border: 1rpx solid rgba(207, 169, 114, 1);
  266. border-radius: 15rpx;
  267. font-size: 20rpx;
  268. font-weight: 400;
  269. color: rgba(168, 112, 13, 1);
  270. padding: 0 10rpx;
  271. margin-left: 20rpx;
  272. background: rgba(233, 183, 102, 0.16);
  273. }
  274. .order-price {
  275. font-size: 26rpx;
  276. font-weight: 600;
  277. color: rgba(51, 51, 51, 1);
  278. }
  279. }
  280. }
  281. .goods-item {
  282. height: 95rpx;
  283. background: #fff;
  284. padding: 0 25rpx;
  285. margin-bottom: 20rpx;
  286. // 售后原因
  287. .refund-cause {
  288. font-size: 26rpx;
  289. font-weight: 400;
  290. color: rgba(177, 179, 199, 1);
  291. }
  292. &:nth-of-type(2n) {
  293. margin-bottom: 0;
  294. border-top: 0;
  295. }
  296. .item-title {
  297. font-size: 28rpx;
  298. }
  299. .price {
  300. font-size: 28rpx;
  301. color: #a8700d;
  302. }
  303. }
  304. .upload-img {
  305. padding: 25rpx;
  306. .upload-title {
  307. font-size: 28rpx;
  308. }
  309. }
  310. .img-box {
  311. display: flex;
  312. align-items: center;
  313. flex-wrap: wrap;
  314. .choose-img,
  315. .preview-box {
  316. width: 110rpx;
  317. height: 110rpx;
  318. background: rgba(249, 250, 251, 1);
  319. border: 1rpx solid rgba(223, 223, 223, 1);
  320. margin-right: 20rpx;
  321. margin-bottom: 20rpx;
  322. position: relative;
  323. &:nth-child(5n) {
  324. margin-right: 0;
  325. }
  326. .preview-img {
  327. width: 100%;
  328. height: 100%;
  329. }
  330. }
  331. }
  332. .foot-wrap {
  333. height: 100rpx;
  334. width: 100%;
  335. }
  336. .foot_box {
  337. height: 100rpx;
  338. background-color: #fff;
  339. padding: 0 30rpx;
  340. position: fixed;
  341. width: 100%;
  342. bottom: 0;
  343. left: 0;
  344. border-top: 1rpx solid #f5f5f5;
  345. .sub-btn {
  346. width: 340rpx;
  347. line-height: 74rpx;
  348. background: linear-gradient(90deg, rgba(233, 180, 97, 1), rgba(238, 204, 137, 1));
  349. border: 1rpx solid rgba(238, 238, 238, 1);
  350. border-radius: 38rpx;
  351. color: rgba(#fff, 0.9);
  352. font-size: 28rpx;
  353. }
  354. .contcat-btn {
  355. width: 340rpx;
  356. line-height: 74rpx;
  357. background: rgba(238, 238, 238, 1);
  358. border-radius: 38rpx;
  359. font-size: 28rpx;
  360. font-weight: 400;
  361. color: rgba(51, 51, 51, 1);
  362. }
  363. }
  364. .modal-box {
  365. width: 750rpx;
  366. height: 680rpx;
  367. border-radius: 30rpx 30rpx 0 0;
  368. background: #fff;
  369. .modal-head {
  370. height: 100rpx;
  371. font-size: 30rpx;
  372. }
  373. .modal-content {
  374. font-size: 28rpx;
  375. .sel-item {
  376. height: 100rpx;
  377. width: 100%;
  378. padding: 0 20rpx;
  379. border-bottom: 1rpx solid rgba(223, 223, 223, 0.5);
  380. .sel-radio {
  381. transform: scale(0.7);
  382. }
  383. }
  384. }
  385. .modal-foot {
  386. .close-btn {
  387. width: 710rpx;
  388. line-height: 80rpx;
  389. background: linear-gradient(90deg, rgba(233, 180, 97, 1), rgba(238, 204, 137, 1));
  390. border: 1rpx solid rgba(238, 238, 238, 1);
  391. border-radius: 40rpx;
  392. color: rgba(#fff, 0.9);
  393. }
  394. }
  395. }
  396. </style>