|
2 | 2 | <view> |
3 | 3 | <view class="form-box"> |
4 | 4 | <u--form ref="uForm" label-width="130rpx" :model="form"> |
5 | | - <u-form-item label="售后类型" prop="type" required> |
| 5 | + <u-form-item v-if="orderType == 5" label="售后类型" prop="type" required> |
| 6 | + <u-radio-group v-model="form.type" placement="row"> |
| 7 | + <u-radio v-for="item in supportAfsTypeList" :key="item" :customStyle="{marginBottom: '8rpx', marginRight: '8rpx'}" :label="item == 10 ? '退货' : '换货'" :name="item"> |
| 8 | + </u-radio> |
| 9 | + </u-radio-group> |
| 10 | + </u-form-item> |
| 11 | + <u-form-item v-else label="售后类型" prop="type" required> |
6 | 12 | <u-radio-group v-model="form.type" placement="row"> |
7 | 13 | <u-radio :customStyle="{marginBottom: '8rpx', marginRight: '8rpx'}" label="仅退款" :name="0"> |
8 | 14 | </u-radio> |
|
13 | 19 | </u-radio-group> |
14 | 20 | </u-form-item> |
15 | 21 | <u-cell v-if="orderSet && orderSet.afterSaleAddress && (form.type == 1 || form.type == 2)" title="寄回地址" required :label="orderSet.afterSaleAddress" value="复制" isLink clickable @click="cp(orderSet.afterSaleAddress)"></u-cell> |
16 | | - <u-form-item label="收货情况" prop="logisticsStatus" required> |
| 22 | + <u-form-item v-if="orderType != 5" label="收货情况" prop="logisticsStatus" required> |
17 | 23 | <u-radio-group v-model="form.logisticsStatus" placement="row"> |
18 | 24 | <u-radio :customStyle="{marginBottom: '8rpx', marginRight: '8rpx'}" label="未收到货" :name="0"> |
19 | 25 | </u-radio> |
20 | 26 | <u-radio :customStyle="{marginBottom: '8rpx', marginRight: '8rpx'}" label="已收到货" :name="1"> |
21 | 27 | </u-radio> |
22 | 28 | </u-radio-group> |
23 | 29 | </u-form-item> |
24 | | - <u-form-item label="售后原因" prop="reason" required> |
| 30 | + <u-form-item v-if="orderType == 5" label="售后原因" prop="reason" required> |
| 31 | + <u-radio-group v-model="form.reason" placement="column"> |
| 32 | + <u-radio v-for="(item,index) in joycityPointsSearchAfsApplyReasonList" :customStyle="{marginBottom: '8rpx', marginRight: '8rpx'}" :label="item.applyReasonName" :name="item.applyReasonName"></u-radio> |
| 33 | + </u-radio-group> |
| 34 | + </u-form-item> |
| 35 | + <u-form-item v-else label="售后原因" prop="reason" required> |
25 | 36 | <u-radio-group v-model="form.reason" placement="column"> |
26 | 37 | <u-radio v-for="(item,index) in reasons" :customStyle="{marginBottom: '8rpx', marginRight: '8rpx'}" :label="item" :name="item"></u-radio> |
27 | 38 | </u-radio-group> |
|
100 | 111 | "发票问题", |
101 | 112 | ], |
102 | 113 | pics: [], |
103 | | - orderSet: undefined |
| 114 | + orderSet: undefined, |
| 115 | + orderType: 0, // 0 普通订单 1 周期订单 2 扫码点餐订单 3 京东vop订单 4 从区管进货 5 京东权益订单 |
| 116 | + supportAfsTypeList: undefined, |
| 117 | + joycityPointsSearchAfsApplyReasonList: undefined, |
| 118 | + afsGoodsId: undefined |
104 | 119 | }; |
105 | 120 | }, |
106 | 121 | onReady() { |
107 | 122 | this.$refs.uForm.setRules(this.rules); |
108 | 123 | }, |
109 | 124 | onLoad(e) { |
| 125 | + this.orderType = uni.getStorageSync('orderType') |
| 126 | + this.supportAfsTypeList = uni.getStorageSync('supportAfsTypeList') // 京东权益订单,支持的售后类型列表 10-退货 20-换货 |
| 127 | + this.afsGoodsId = uni.getStorageSync('afsGoodsId') // 京东权益订单,售后的商品编号 |
110 | 128 | this.form.orderId = e.orderId |
111 | | - this.form.reason = this.reasons[0] |
112 | 129 | this._orderSet() |
| 130 | + if(this.orderType == 5) { |
| 131 | + this.form.type = this.supportAfsTypeList[0] |
| 132 | + this._joycityPointsSearchAfsApplyReasonList() |
| 133 | + } |
113 | 134 | }, |
114 | 135 | mounted() {}, |
115 | 136 | methods: { |
|
119 | 140 | this.orderSet = res.data |
120 | 141 | } |
121 | 142 | }, |
| 143 | + async _joycityPointsSearchAfsApplyReasonList(afsType) { |
| 144 | + const res = await this.$wxapi.joycityPointsSearchAfsApplyReasonList({ |
| 145 | + token: this.token, |
| 146 | + afsType: this.form.type, |
| 147 | + orderId: this.form.orderId, |
| 148 | + goodsId: this.afsGoodsId |
| 149 | + }) |
| 150 | + if(res.code != 0) { |
| 151 | + uni.showToast({ |
| 152 | + title: res.msg, |
| 153 | + icon: 'none' |
| 154 | + }) |
| 155 | + return |
| 156 | + } |
| 157 | + this.joycityPointsSearchAfsApplyReasonList = res.data |
| 158 | + }, |
122 | 159 | // 删除图片 |
123 | 160 | deletePic(event) { |
124 | 161 | this.pics.splice(event.index, 1) |
|
0 commit comments