return.vue 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287
  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 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, crossPagePam)" @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. this.$navToPage(
  131. {
  132. url: ''
  133. },
  134. 'navigateBack'
  135. )
  136. },
  137. getFiles(value) {
  138. this.fileurl = []
  139. value.forEach(v => {
  140. this.fileurl.push(v)
  141. })
  142. },
  143. //
  144. apply() {
  145. if (!this.formdata.applyNote) {
  146. this.$toast('缺少必要参数,请检查')
  147. return
  148. }
  149. this.disabled = true
  150. let params = {
  151. ...this.formdata,
  152. orderId: this.orderId,
  153. refundFile: this.fileurl.toString()
  154. }
  155. this.$toast('正在申请售后中...')
  156. setTimeout(() => {
  157. this.$api
  158. .postJson('/refundOrder/apply', params)
  159. .then(res => {
  160. this.disabled = false
  161. this.$navToPage(
  162. {
  163. url: '/pages/mine/myBuy/list'
  164. },
  165. 'redirectTo'
  166. )
  167. })
  168. .catch(err => {
  169. this.disabled = false
  170. })
  171. }, 1000)
  172. },
  173. //
  174. getDetail() {
  175. this.$api
  176. .postJson('/refundOrder/detail', {
  177. orderId: this.orderId
  178. })
  179. .then(res => {
  180. this.form = res.data
  181. this.fileList = res.data.orderRefundFileList.map(v => v.imgUrl)
  182. if (['AFTER_WAIT', 'REFUND', 'NO_REFUND'].indexOf(res.data.status) !== -1) {
  183. this.showDisable = true
  184. }
  185. })
  186. .catch(err => {
  187. })
  188. .finally(() => {
  189. this.refresherTriggered = false
  190. })
  191. },
  192. refresherrefresh() {
  193. this.refresherTriggered = true
  194. this.getDetail()
  195. }
  196. }
  197. // #endif
  198. }
  199. </script>
  200. <style lang="scss" scoped>
  201. .goods-container {
  202. background: #ffffff;
  203. margin-top: 30rpx;
  204. padding: 30rpx 30rpx 0;
  205. .title {
  206. font-weight: 500;
  207. }
  208. .goods {
  209. display: flex;
  210. padding: 30rpx 0;
  211. image {
  212. width: 120rpx;
  213. height: 120rpx;
  214. }
  215. .main {
  216. flex: 1;
  217. margin-left: 20rpx;
  218. .name {
  219. font-size: 32rpx;
  220. }
  221. .des {
  222. margin-top: 12rpx;
  223. font-size: 28rpx;
  224. color: $reg-font;
  225. }
  226. .price {
  227. margin-top: 12rpx;
  228. text {
  229. color: $assist-color;
  230. font-weight: 500;
  231. font-size: 32rpx;
  232. margin-right: 12rpx;
  233. }
  234. }
  235. }
  236. }
  237. .total {
  238. border-top: 1px solid #eaeaea;
  239. height: 80rpx;
  240. display: flex;
  241. align-items: center;
  242. justify-content: end;
  243. font-size: 28rpx;
  244. text {
  245. margin-left: 12rpx;
  246. color: $assist-color;
  247. }
  248. }
  249. }
  250. .form-container {
  251. background: #ffffff;
  252. margin-top: 30rpx;
  253. padding: 30rpx;
  254. .title {
  255. font-weight: 500;
  256. }
  257. .label {
  258. color: $sec-font;
  259. flex-shrink: 0;
  260. margin-right: 30rpx;
  261. }
  262. .radio {
  263. display: flex;
  264. align-items: center;
  265. margin-top: 30rpx;
  266. }
  267. .content {
  268. display: flex;
  269. margin-top: 30rpx;
  270. }
  271. .row {
  272. display: flex;
  273. margin-top: 30rpx;
  274. }
  275. }
  276. .bottom-container {
  277. padding: 20rpx 30rpx;
  278. }
  279. </style>