Skip to content

Commit c5ac4d7

Browse files
committed
优化
1 parent 408b431 commit c5ac4d7

6 files changed

Lines changed: 90 additions & 11 deletions

File tree

App.vue

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
globalData: {
66
h5Domain: 'https://flpt.jxsupplier.com',
77
goLogin: false,
8-
subDomain: 'tz', // jdjf0115
9-
merchantId: '951', // 42151
8+
subDomain: 'jdjf0115', // jdjf0115
9+
merchantId: '42151', // 42151
1010
version: '0.0.2',
1111
sysconfigkeys: 'mallName,shopMod,share_profile,recharge_amount_min'
1212
},
@@ -184,6 +184,8 @@
184184
185185
.item {
186186
padding: 0 8rpx;
187+
display: flex;
188+
align-items: center;
187189
}
188190
189191
.original {

node_modules/apifm-uniapp/index.js

Lines changed: 8 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

node_modules/apifm-uniapp/package.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"test": "eslint . --fix"
55
},
66
"devDependencies": {
7-
"apifm-uniapp": "^3.50.2",
7+
"apifm-uniapp": "^3.51.0",
88
"eslint": "^8.2.0",
99
"eslint-config-airbnb": "^19.0.0",
1010
"vue-i18n": "^8.20.0",

pages/order/index.vue

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,40 @@
280280
})
281281
},
282282
async refund(item) {
283+
if(item.type == 5) {
284+
// 判断是否可售后
285+
const goodsId = item.goodsList[0].goodsIdStr
286+
uni.setStorageSync('afsGoodsId', goodsId) // 京东权益订单,售后的商品编号
287+
const res = await this.$wxapi.joycityPointsCanApplyAfterSale({
288+
token: this.token,
289+
orderId: item.id,
290+
goodsId
291+
})
292+
if(res.code != 0) {
293+
uni.showToast({
294+
title: res.msg,
295+
icon: 'none'
296+
})
297+
return
298+
}
299+
if(!res.data.canApply) {
300+
uni.showToast({
301+
title: res.data.cannotApplyTip,
302+
icon: 'none'
303+
})
304+
return
305+
}
306+
if(res.data.supportMethod == 2) {
307+
uni.showToast({
308+
title: '请联系客服进行售后:' + res.data.afsHotLine,
309+
icon: 'none'
310+
})
311+
return
312+
}
313+
// 可申请的售后类型保存到 storage
314+
uni.setStorageSync('supportAfsTypeList', res.data.supportAfsTypeList) // 支持的售后类型列表 10-退货 20-换货
315+
}
316+
uni.setStorageSync('orderType', item.type)
283317
uni.navigateTo({
284318
url: '../refund/apply?orderId=' + item.id
285319
})

pages/refund/apply.vue

Lines changed: 42 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,13 @@
22
<view>
33
<view class="form-box">
44
<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>
612
<u-radio-group v-model="form.type" placement="row">
713
<u-radio :customStyle="{marginBottom: '8rpx', marginRight: '8rpx'}" label="仅退款" :name="0">
814
</u-radio>
@@ -13,15 +19,20 @@
1319
</u-radio-group>
1420
</u-form-item>
1521
<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>
1723
<u-radio-group v-model="form.logisticsStatus" placement="row">
1824
<u-radio :customStyle="{marginBottom: '8rpx', marginRight: '8rpx'}" label="未收到货" :name="0">
1925
</u-radio>
2026
<u-radio :customStyle="{marginBottom: '8rpx', marginRight: '8rpx'}" label="已收到货" :name="1">
2127
</u-radio>
2228
</u-radio-group>
2329
</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>
2536
<u-radio-group v-model="form.reason" placement="column">
2637
<u-radio v-for="(item,index) in reasons" :customStyle="{marginBottom: '8rpx', marginRight: '8rpx'}" :label="item" :name="item"></u-radio>
2738
</u-radio-group>
@@ -100,16 +111,26 @@
100111
"发票问题",
101112
],
102113
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
104119
};
105120
},
106121
onReady() {
107122
this.$refs.uForm.setRules(this.rules);
108123
},
109124
onLoad(e) {
125+
this.orderType = uni.getStorageSync('orderType')
126+
this.supportAfsTypeList = uni.getStorageSync('supportAfsTypeList') // 京东权益订单,支持的售后类型列表 10-退货 20-换货
127+
this.afsGoodsId = uni.getStorageSync('afsGoodsId') // 京东权益订单,售后的商品编号
110128
this.form.orderId = e.orderId
111-
this.form.reason = this.reasons[0]
112129
this._orderSet()
130+
if(this.orderType == 5) {
131+
this.form.type = this.supportAfsTypeList[0]
132+
this._joycityPointsSearchAfsApplyReasonList()
133+
}
113134
},
114135
mounted() {},
115136
methods: {
@@ -119,6 +140,22 @@
119140
this.orderSet = res.data
120141
}
121142
},
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+
},
122159
// 删除图片
123160
deletePic(event) {
124161
this.pics.splice(event.index, 1)

0 commit comments

Comments
 (0)