applicationRefund.vue 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329
  1. <template>
  2. <view class="page">
  3. <view class="commodity-information">
  4. <view class="commodity-1">
  5. <image
  6. class="commodity-img"
  7. :src="goodsDetail.goods.goods_image"
  8. mode=""
  9. ></image>
  10. <view class="commodity-right">
  11. <view class="commodity-2">
  12. <view class="commodity-title"
  13. >{{ goodsDetail.goods.goods_name }}
  14. </view>
  15. </view>
  16. <view class="commodity-3">
  17. <view class="specifications">
  18. {{ goodsDetail.goods.sku_item.item }}
  19. </view>
  20. <view style="font-size: 24rpx">
  21. x{{ goodsDetail.goods.goods_num }}
  22. </view>
  23. </view>
  24. <view class="commodity-price" v-if="goodsDetail.goods">
  25. <text style="font-size: 20rpx">¥</text>
  26. <text>{{ goodsDetail.goods.unit_price.split(".")[0] }}</text
  27. >.
  28. <text style="font-size: 20rpx">{{
  29. goodsDetail.goods.unit_price.split(".")[1]
  30. }}</text>
  31. </view>
  32. </view>
  33. </view>
  34. </view>
  35. <view class="reason">
  36. <view class="application-reason">
  37. <view class=""> 申请原因 </view>
  38. <view class="right" @click="openReason">
  39. <text>{{ refundText }}</text>
  40. <image
  41. class="right-icon"
  42. src="../../static/mine/325.png"
  43. mode=""
  44. ></image>
  45. </view>
  46. </view>
  47. <view class="application-reason">
  48. <view class=""> 退款金额 </view>
  49. <view
  50. class="commodity-price"
  51. style="font-weight: 600"
  52. v-if="goodsDetail.goods"
  53. >
  54. <text style="font-size: 20rpx">¥</text>
  55. <text>{{ goodsDetail.goods.amount.split(".")[0] }}</text
  56. >.
  57. <text style="font-size: 20rpx">{{
  58. goodsDetail.goods.amount.split(".")[1]
  59. }}</text>
  60. </view>
  61. </view>
  62. </view>
  63. <view class="application-explain">
  64. <view class="application-title"> 申请说明 </view>
  65. <view class="textarea">
  66. <u--textarea
  67. v-model="value1"
  68. border="none"
  69. placeholder="请您详细填写申请说明"
  70. ></u--textarea>
  71. <u-upload
  72. :fileList="fileList6"
  73. @afterRead="afterRead"
  74. @delete="deletePic"
  75. name="6"
  76. multiple
  77. :maxCount="1"
  78. width="250"
  79. height="150"
  80. >
  81. <view class="unload">
  82. <view class="text-content"> 上传凭证<br />(最多9张) </view>
  83. </view>
  84. </u-upload>
  85. </view>
  86. <view class="img-list">
  87. <image
  88. v-for="(item, index) in imgList"
  89. :src="item"
  90. :key="index"
  91. mode="scaleToFill"
  92. class="upload-img"
  93. />
  94. </view>
  95. </view>
  96. <reasonPopupVue :show="show" @close="close"></reasonPopupVue>
  97. <view class="footer">
  98. <button class="btn" @click="submitApplication">提交申请</button>
  99. </view>
  100. </view>
  101. </template>
  102. <script>
  103. import reasonPopupVue from "./component/reasonPopup.vue";
  104. export default {
  105. components: {
  106. reasonPopupVue,
  107. },
  108. data() {
  109. return {
  110. show: false,
  111. value1: "",
  112. refundText: "请选择退款原因",
  113. orderId: "",
  114. goodsDetail: {},
  115. imgList: [],
  116. };
  117. },
  118. onLoad(options) {
  119. this.orderId = options.orderId;
  120. },
  121. methods: {
  122. //打开退货理由弹窗
  123. openReason() {
  124. this.show = true;
  125. },
  126. //关闭弹窗
  127. close(value) {
  128. this.refundText = value;
  129. this.show = false;
  130. },
  131. //上传图片
  132. afterRead(e) {
  133. console.log(e);
  134. this.imgList.push(e.file[0].url);
  135. },
  136. //获取订单商品信息
  137. getDetail() {
  138. uni.$u.http
  139. .post(`/api/order/order_goods_details`, {
  140. order_goods_id: this.orderId,
  141. })
  142. .then((res) => {
  143. this.goodsDetail = res;
  144. });
  145. },
  146. //提交申请
  147. submitApplication() {
  148. uni.$u.http
  149. .post(`/api/order/refund`, {
  150. order_id: this.goodsDetail.id,
  151. order_goods_id: this.orderId,
  152. refund_reason: this.refundText,
  153. refund_illustrate: this.value1,
  154. images: this.imgList.join(","),
  155. })
  156. .then((res) => {
  157. uni.showToast({
  158. title: "已申请,请等待审核",
  159. icon: "none",
  160. });
  161. uni.navigateBack({ delta: 1 });
  162. });
  163. },
  164. },
  165. mounted() {
  166. this.getDetail();
  167. uni.setNavigationBarTitle({
  168. title: "申请退款",
  169. });
  170. },
  171. };
  172. </script>
  173. <style lang="scss" scoped>
  174. .page {
  175. padding: 20rpx 24rpx;
  176. position: relative;
  177. .commodity-information {
  178. padding: 28rpx 20rpx;
  179. background-color: #fff;
  180. border-radius: 16rpx;
  181. .commodity-1 {
  182. display: flex;
  183. .commodity-img {
  184. width: 156rpx;
  185. height: 156rpx;
  186. margin-right: 20rpx;
  187. border-radius: 10rpx;
  188. }
  189. .commodity-right {
  190. width: 73%;
  191. }
  192. .commodity-2 {
  193. display: flex;
  194. justify-content: space-between;
  195. width: 100%;
  196. .commodity-title {
  197. width: 328rpx;
  198. overflow: hidden;
  199. white-space: nowrap;
  200. text-overflow: ellipsis;
  201. margin-right: 38rpx;
  202. }
  203. }
  204. .commodity-3 {
  205. display: flex;
  206. justify-content: space-between;
  207. margin-top: 20rpx;
  208. color: #777;
  209. .specifications {
  210. font-size: 28rpx;
  211. color: #777;
  212. }
  213. }
  214. .commodity-price {
  215. margin-top: 24rpx;
  216. font-weight: 600;
  217. }
  218. }
  219. }
  220. .reason {
  221. background-color: #fff;
  222. padding: 0 20rpx;
  223. border-radius: 16rpx;
  224. margin-top: 20rpx;
  225. .application-reason {
  226. display: flex;
  227. justify-content: space-between;
  228. height: 104rpx;
  229. align-items: center;
  230. font-size: 28rpx;
  231. .right {
  232. display: flex;
  233. align-items: center;
  234. color: rgba(34, 34, 34, 0.6);
  235. font-size: 28rpx;
  236. }
  237. .right-icon {
  238. width: 32rpx;
  239. height: 32rpx;
  240. }
  241. }
  242. }
  243. .application-explain {
  244. margin-top: 20rpx;
  245. padding: 28rpx 20rpx;
  246. background-color: #fff;
  247. border-radius: 16rpx;
  248. .application-title {
  249. font-size: 28rpx;
  250. color: #222;
  251. margin-bottom: 18rpx;
  252. }
  253. .textarea {
  254. background-color: #f4f4f4;
  255. padding: 24rpx;
  256. border-radius: 16rpx;
  257. }
  258. .img-list {
  259. display: flex;
  260. margin-top: 20rpx;
  261. flex-wrap: wrap;
  262. .upload-img {
  263. width: 186rpx;
  264. height: 186rpx;
  265. border-radius: 16rpx;
  266. margin-right: 20rpx;
  267. }
  268. }
  269. .unload {
  270. width: 614rpx;
  271. height: 152rpx;
  272. text-align: center;
  273. border-radius: 16rpx;
  274. color: #929292;
  275. border: 2rpx dashed #979797;
  276. font-size: 20rpx;
  277. .text-content {
  278. margin-top: 80rpx;
  279. }
  280. }
  281. }
  282. .footer {
  283. position: fixed;
  284. bottom: 0;
  285. padding: 20rpx 24rpx 60rpx;
  286. background-color: #fff;
  287. left: 0;
  288. width: 100%;
  289. .btn {
  290. margin: 0;
  291. padding: 0;
  292. background-color: #f83224;
  293. color: #fff;
  294. border-radius: 44rpx;
  295. width: 94%;
  296. height: 88rpx;
  297. line-height: 88rpx;
  298. }
  299. }
  300. }
  301. .u-textarea {
  302. background-color: #f4f4f4;
  303. padding: 0;
  304. }
  305. </style>