return.vue 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281
  1. <template>
  2. <!-- #ifdef H5 -->
  3. <zj-page-layout
  4. :hasFooter="true"
  5. :isScroll="true"
  6. :refresherTriggered="refresherTriggered"
  7. @refresherrefresh="refresherrefresh"
  8. >
  9. <view class="goods-container">
  10. <view class="title">商品信息</view>
  11. <view class="goods">
  12. <image :src="$imageUrl + form.goodsPicUrl"></image>
  13. <view class="main">
  14. <view class="name">{{ form.goodsTitle }}</view>
  15. <view class="des">{{ form.goods.content }}</view>
  16. <view class="price"
  17. ><text>¥{{ form.goodsAmount }}</text
  18. >x{{ form.num }}</view
  19. >
  20. </view>
  21. </view>
  22. <view class="total"
  23. >订单总金额<text>¥{{ form.price }}</text></view
  24. >
  25. </view>
  26. <view class="form-container">
  27. <view class="title">退货信息填写</view>
  28. <view class="radio">
  29. <view class="label"><text style="color: red">*</text>选择类型</view>
  30. <u-radio-group :disabled="showDisable" v-model="formdata.applyType" placement="row">
  31. <u-radio label="仅退款" activeColor="#01C30B" name="REFUND"></u-radio>
  32. </u-radio-group>
  33. </view>
  34. <view class="content">
  35. <view class="label"><text style="color: red">*</text>退货原因</view>
  36. <u--textarea
  37. style="backgroundcolor: #fff"
  38. :disabled="showDisable"
  39. v-model="formdata.applyNote"
  40. placeholder="请输入内容"
  41. ></u--textarea>
  42. </view>
  43. <view class="content">
  44. <view class="label">上传图片(最多9张)</view>
  45. </view>
  46. <br />
  47. <zj-upload :disabled="showDisable" key="cp" @getFiles="getFiles" :fileList="fileList" :count="9" />
  48. </view>
  49. <view v-if="['REFUND', 'NO_REFUND'].indexOf(form.status) != -1" class="form-container">
  50. <view class="title">处理结果</view>
  51. <view class="row">
  52. <view class="label">处理状态:</view>
  53. <view class="value">{{
  54. form.status === 'REFUND' || form.status === 'NO_REFUND' ? '已处理' : '待平台处理中'
  55. }}</view>
  56. </view>
  57. <view class="row">
  58. <view class="label">处理结果</view>
  59. <view class="value">{{
  60. form.status === 'REFUND' ? '退款成功' : form.status === 'NO_REFUND' ? '不退款' : ''
  61. }}</view>
  62. </view>
  63. <view class="row">
  64. <view class="label">退款金额</view>
  65. <view class="value">¥{{ form.refundPrice }}</view>
  66. </view>
  67. <view class="row">
  68. <view class="label">备注信息</view>
  69. <view class="value">{{ form.refundRemark }}</view>
  70. </view>
  71. </view>
  72. <template slot="footer">
  73. <view class="bottom-container">
  74. <u-button v-if="showDisable" @click="back" text="返回" type="primary" shape="circle"></u-button>
  75. <u-button v-else :disabled="disabled" @click="apply" text="提交申请" type="primary" shape="circle"></u-button>
  76. </view>
  77. </template>
  78. </zj-page-layout>
  79. <!-- #endif -->
  80. <!-- #ifndef H5 -->
  81. <web-view :src="webViewHref(`/pages/mine/myBuy/return`, pam)" @message="crossPage.$listener"></web-view>
  82. <!-- #endif -->
  83. </template>
  84. <script>
  85. import zjUpload from '@/components/zj-upload/index.vue'
  86. import { tr } from '@dcloudio/vue-cli-plugin-uni/packages/postcss/tags'
  87. export default {
  88. // #ifndef H5
  89. data() {
  90. return {
  91. pam: {}
  92. }
  93. },
  94. onLoad(pam) {
  95. this.pam = pam
  96. },
  97. // #endif
  98. // #ifdef H5
  99. components: {
  100. zjUpload
  101. },
  102. data() {
  103. return {
  104. disabled: false,
  105. type: 1,
  106. content: '',
  107. refresherTriggered: false,
  108. form: {
  109. goods: {}
  110. },
  111. formdata: {
  112. applyType: 'REFUND',
  113. applyNote: ''
  114. },
  115. showDisable: false,
  116. fileList: [],
  117. fileurl: [],
  118. orderId: ''
  119. }
  120. },
  121. onLoad({ orderId }) {
  122. this.orderId = orderId
  123. this.getDetail()
  124. },
  125. onShow() {
  126. },
  127. methods: {
  128. back() {
  129. uni.navigateBack()
  130. },
  131. getFiles(value) {
  132. this.fileurl = []
  133. value.forEach(v => {
  134. this.fileurl.push(v)
  135. })
  136. },
  137. //
  138. apply() {
  139. if (!this.formdata.applyNote) {
  140. this.$toast('缺少必要参数,请检查')
  141. return
  142. }
  143. this.disabled = true
  144. let params = {
  145. ...this.formdata,
  146. orderId: this.orderId,
  147. refundFile: this.fileurl.toString()
  148. }
  149. this.$toast('正在申请售后中...')
  150. setTimeout(() => {
  151. this.$api
  152. .postJson('/refundOrder/apply', params)
  153. .then(res => {
  154. this.disabled = false
  155. this.$navToPage(
  156. {
  157. url: '/pages/mine/myBuy/list'
  158. },
  159. 'redirectTo'
  160. )
  161. })
  162. .catch(err => {
  163. this.disabled = false
  164. })
  165. }, 1000)
  166. },
  167. //
  168. getDetail() {
  169. this.$api
  170. .postJson('/refundOrder/detail', {
  171. orderId: this.orderId
  172. })
  173. .then(res => {
  174. this.form = res.data
  175. this.fileList = res.data.orderRefundFileList.map(v => v.imgUrl)
  176. if (['AFTER_WAIT', 'REFUND', 'NO_REFUND'].indexOf(res.data.status) !== -1) {
  177. this.showDisable = true
  178. }
  179. })
  180. .catch(err => {
  181. })
  182. .finally(() => {
  183. this.refresherTriggered = false
  184. })
  185. },
  186. refresherrefresh() {
  187. this.refresherTriggered = true
  188. this.getDetail()
  189. }
  190. }
  191. // #endif
  192. }
  193. </script>
  194. <style lang="scss" scoped>
  195. .goods-container {
  196. background: #ffffff;
  197. margin-top: 30rpx;
  198. padding: 30rpx 30rpx 0;
  199. .title {
  200. font-weight: 500;
  201. }
  202. .goods {
  203. display: flex;
  204. padding: 30rpx 0;
  205. image {
  206. width: 120rpx;
  207. height: 120rpx;
  208. }
  209. .main {
  210. flex: 1;
  211. margin-left: 20rpx;
  212. .name {
  213. font-size: 32rpx;
  214. }
  215. .des {
  216. margin-top: 12rpx;
  217. font-size: 28rpx;
  218. color: $reg-font;
  219. }
  220. .price {
  221. margin-top: 12rpx;
  222. text {
  223. color: $assist-color;
  224. font-weight: 500;
  225. font-size: 32rpx;
  226. margin-right: 12rpx;
  227. }
  228. }
  229. }
  230. }
  231. .total {
  232. border-top: 1px solid #eaeaea;
  233. height: 80rpx;
  234. display: flex;
  235. align-items: center;
  236. justify-content: end;
  237. font-size: 28rpx;
  238. text {
  239. margin-left: 12rpx;
  240. color: $assist-color;
  241. }
  242. }
  243. }
  244. .form-container {
  245. background: #ffffff;
  246. margin-top: 30rpx;
  247. padding: 30rpx;
  248. .title {
  249. font-weight: 500;
  250. }
  251. .label {
  252. color: $sec-font;
  253. flex-shrink: 0;
  254. margin-right: 30rpx;
  255. }
  256. .radio {
  257. display: flex;
  258. align-items: center;
  259. margin-top: 30rpx;
  260. }
  261. .content {
  262. display: flex;
  263. margin-top: 30rpx;
  264. }
  265. .row {
  266. display: flex;
  267. margin-top: 30rpx;
  268. }
  269. }
  270. .bottom-container {
  271. padding: 20rpx 30rpx;
  272. }
  273. </style>