Skip to content

Commit 2120c59

Browse files
committed
uview update to 20220309
1 parent 257faf0 commit 2120c59

File tree

11 files changed

+228
-22
lines changed

11 files changed

+228
-22
lines changed

App.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
goLogin: false,
88
subDomain: 'tz', // jdjf0115
99
merchantId: '951', // 42151
10-
version: '1.0.0',
10+
version: '1.1.0',
1111
sysconfigkeys: 'mallName,shopMod,share_profile,recharge_amount_min,open_growth,shopping_cart_vop_open',
1212
wxpayOpenAppId: 'wx9b04553fd8c7b9c3', // 微信开放平台的移动端应用appID
1313
openAlipayProvider: true, // 是否开通支付宝支付

manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name" : "天使童装",
3-
"appid" : "__UNI__151F11E",
3+
"appid" : "__UNI__F2EA85C",
44
"description" : "天使童装",
55
"versionName" : "1.0.0",
66
"versionCode" : 100,

node_modules/.DS_Store

-4 KB
Binary file not shown.

node_modules/apifm-uniapp/index.js

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

pages/order/index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@
235235
},
236236
async refund(item) {
237237
if(item.type == 5) {
238-
// 判断是否可售后
238+
// 京东权益订单,判断是否可售后
239239
const goodsId = item.goodsList[0].goodsIdStr
240240
uni.setStorageSync('afsGoodsId', goodsId) // 京东权益订单,售后的商品编号
241241
const res = await this.$wxapi.joycityPointsCanApplyAfterSale({

pages/refund/apply.vue

Lines changed: 156 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,36 @@
22
<view>
33
<view class="form-box">
44
<u--form ref="uForm" label-width="130rpx" :model="form">
5-
<u-form-item v-if="orderType == 5" label="售后类型" prop="type" required>
5+
<u-form-item v-if="orderType == 3" label="售后商品" prop="skuId" required @click="goodsPickerShow = true">
6+
<u--input
7+
v-model="form.skuName"
8+
readonly
9+
placeholder="请选择售后商品"
10+
border="none"
11+
></u--input>
12+
<u-icon slot="right" name="arrow-right"></u-icon>
13+
<u-picker v-if="orderDetail && orderDetail.goods" :show="goodsPickerShow" :columns="[orderDetail.goods]" keyName="goodsName" @cancel="goodsPickerShow=false" @confirm="goodsPickerSelect"></u-picker>
14+
</u-form-item>
15+
<u-form-item v-if="orderType == 3 && curGoods" label="售后数量" required>
16+
<u-number-box v-model="form.skuNum" :min="1" :max="curGoodsMaxNumber" integer></u-number-box>
17+
</u-form-item>
18+
<u-form-item v-if="orderType == 3" label="外包装" prop="packageDesc" required>
19+
<u-radio-group v-model="form.packageDesc" placement="row">
20+
<u-radio :customStyle="{marginBottom: '8rpx', marginRight: '8rpx'}" label="无包装" name="0">
21+
</u-radio>
22+
<u-radio :customStyle="{marginBottom: '8rpx', marginRight: '8rpx'}" label="包装完整" name="10">
23+
</u-radio>
24+
<u-radio :customStyle="{marginBottom: '8rpx', marginRight: '8rpx'}" label="包装破损" name="20">
25+
</u-radio>
26+
</u-radio-group>
27+
</u-form-item>
28+
<u-form-item v-if="orderType == 3" v-show="supportAfsTypeList" label="售后类型" prop="type" required>
29+
<u-radio-group v-model="form.type" placement="row">
30+
<u-radio v-for="item in supportAfsTypeList" :key="item.code" :customStyle="{marginBottom: '8rpx', marginRight: '8rpx'}" :label="item.name" :name="item.code">
31+
</u-radio>
32+
</u-radio-group>
33+
</u-form-item>
34+
<u-form-item v-else-if="orderType == 5" label="售后类型" prop="type" required>
635
<u-radio-group v-model="form.type" placement="row" @change="typeChange">
736
<u-radio v-for="item in supportAfsTypeList" :key="item" :customStyle="{marginBottom: '8rpx', marginRight: '8rpx'}" :label="item == 10 ? '退货' : '换货'" :name="item">
837
</u-radio>
@@ -18,8 +47,14 @@
1847
</u-radio>
1948
</u-radio-group>
2049
</u-form-item>
50+
<u-form-item v-if="orderType == 3 && goodsBackTypes" label="寄回方式" prop="goodsBackType" required>
51+
<u-radio-group v-model="form.goodsBackType" placement="row">
52+
<u-radio v-for="item in goodsBackTypes" :key="item.code" :customStyle="{marginBottom: '8rpx', marginRight: '8rpx'}" :label="item.name" :name="item.code">
53+
</u-radio>
54+
</u-radio-group>
55+
</u-form-item>
2156
<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>
22-
<u-form-item v-if="orderType != 5" label="收货情况" prop="logisticsStatus" required>
57+
<u-form-item v-if="orderType != 5 && orderType != 3" label="收货情况" prop="logisticsStatus" required>
2358
<u-radio-group v-model="form.logisticsStatus" placement="row">
2459
<u-radio :customStyle="{marginBottom: '8rpx', marginRight: '8rpx'}" label="未收到货" :name="0">
2560
</u-radio>
@@ -61,6 +96,10 @@
6196
export default {
6297
data() {
6398
return {
99+
orderDetail: undefined,
100+
goodsPickerShow: false, // 商品选择器
101+
curGoods: undefined, // 申请售后的商品信息
102+
curGoodsMaxNumber: 0, // 可申请售后的最大商品数量
64103
rules: {
65104
type: [{
66105
type: 'number',
@@ -88,14 +127,38 @@
88127
// 可以单个或者同时写两个触发验证方式
89128
trigger: ['change', 'blur'],
90129
}],
130+
skuName: [{
131+
required: true,
132+
message: '不能为空',
133+
// 可以单个或者同时写两个触发验证方式
134+
trigger: ['change', 'blur'],
135+
}],
136+
goodsBackType: [{
137+
required: true,
138+
message: '不能为空',
139+
// 可以单个或者同时写两个触发验证方式
140+
trigger: ['change', 'blur'],
141+
}],
142+
packageDesc: [{
143+
required: true,
144+
message: '不能为空',
145+
// 可以单个或者同时写两个触发验证方式
146+
trigger: ['change', 'blur'],
147+
}],
91148
},
92149
form: {
93150
type: 0,
94151
logisticsStatus: 0,
95152
orderId: undefined,
96-
reasonId: undefined,
153+
reasonId: '',
97154
reason: undefined,
98-
remark: undefined,
155+
remark: '',
156+
skuId: undefined,
157+
skuName: undefined,
158+
skuNum: undefined,
159+
goodsBackType: undefined,
160+
packageDesc: '10',
161+
queryType: '10'
99162
},
100163
reasons: [
101164
"不喜欢/不想要",
@@ -116,7 +179,8 @@
116179
orderType: 0, // 0 普通订单 1 周期订单 2 扫码点餐订单 3 京东vop订单 4 从区管进货 5 京东权益订单
117180
supportAfsTypeList: undefined,
118181
joycityPointsSearchAfsApplyReasonList: undefined,
119-
afsGoodsId: undefined
182+
afsGoodsId: undefined,
183+
goodsBackTypes: undefined
120184
};
121185
},
122186
onReady() {
@@ -127,6 +191,7 @@
127191
this.supportAfsTypeList = uni.getStorageSync('supportAfsTypeList') // 京东权益订单,支持的售后类型列表 10-退货 20-换货
128192
this.afsGoodsId = uni.getStorageSync('afsGoodsId') // 京东权益订单,售后的商品编号
129193
this.form.orderId = e.orderId
194+
this._orderDetail(e.orderId)
130195
this._orderSet()
131196
if(this.orderType == 5) {
132197
this.form.type = this.supportAfsTypeList[0]
@@ -135,6 +200,19 @@
135200
},
136201
mounted() {},
137202
methods: {
203+
async _orderDetail(orderId) {
204+
// https://www.yuque.com/apifm/nu0f75/oamel8
205+
const res = await this.$wxapi.orderDetail(this.token, orderId)
206+
if (res.code != 0) {
207+
uni.showToast({
208+
title: res.msg,
209+
icon: 'none'
210+
})
211+
uni.navigateBack()
212+
return
213+
}
214+
this.orderDetail = res.data
215+
},
138216
async _orderSet() {
139217
const res = await this.$wxapi.orderSet()
140218
if(res.code == 0) {
@@ -199,6 +277,15 @@
199277
return
200278
}
201279
}
280+
if(this.orderType == 3) {
281+
if(!this.curGoods) {
282+
uni.showToast({
283+
title: '请选择售后商品',
284+
icon: 'none'
285+
})
286+
return
287+
}
288+
}
202289
this.$refs.uForm.validate().then(res => {
203290
this._submit()
204291
}).catch(errors => {
@@ -259,6 +346,70 @@
259346
})
260347
}
261348
});
349+
},
350+
async goodsPickerSelect(e) {
351+
const curGoods = e.value[0]
352+
// 判断该商品可售后的数量
353+
if(this.orderType == 3) {
354+
let res = await this.$wxapi.jdvopQueryCanRefundNumber({
355+
token: this.token,
356+
jdOrderId: this.orderDetail.orderInfo.orderNumberOuter,
357+
skuId: curGoods.supplyGoodsId,
358+
queryType: 10
359+
})
360+
if(res.code != 0) {
361+
uni.showToast({
362+
title: res.msg,
363+
icon: 'none'
364+
})
365+
return
366+
}
367+
if(res.data * 1 < 1) {
368+
uni.showToast({
369+
title: '当前商品无法申请售后',
370+
icon: 'none'
371+
})
372+
return
373+
}
374+
this.form.skuNum = res.data * 1
375+
this.curGoodsMaxNumber = res.data * 1
376+
// 查询支持的售后类型
377+
res = await this.$wxapi.jdvopQueryRefundType({
378+
token: this.token,
379+
jdOrderId: this.orderDetail.orderInfo.orderNumberOuter,
380+
skuId: curGoods.supplyGoodsId,
381+
queryType: 10
382+
})
383+
if(res.code != 0) {
384+
uni.showToast({
385+
title: res.msg,
386+
icon: 'none'
387+
})
388+
return
389+
}
390+
this.supportAfsTypeList = res.data // 退货(10)、换货(20)、维修(30), code : name
391+
this.form.type = res.data[0].code
392+
// 查询商品退还方式
393+
res = await this.$wxapi.jdvopQueryGoodsBackType({
394+
token: this.token,
395+
jdOrderId: this.orderDetail.orderInfo.orderNumberOuter,
396+
skuId: curGoods.supplyGoodsId,
397+
queryType: 10
398+
})
399+
if(res.code != 0) {
400+
uni.showToast({
401+
title: res.msg,
402+
icon: 'none'
403+
})
404+
return
405+
}
406+
this.goodsBackTypes = res.data
407+
this.form.goodsBackType = res.data[0].code
408+
}
409+
this.curGoods = e.value[0]
410+
this.goodsPickerShow = false
411+
this.form.skuId = this.curGoods.goodsId
412+
this.form.skuName = this.curGoods.goodsName
262413
}
263414
}
264415
};

uni_modules/uview-ui/components/u--text/u--text.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
:block="block"
1515
:lines="lines"
1616
:color="color"
17+
:decoration="decoration"
1718
:size="size"
1819
:iconStyle="iconStyle"
1920
:margin="margin"

uni_modules/uview-ui/components/u-datetime-picker/u-datetime-picker.vue

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -118,18 +118,34 @@
118118
})
119119
this.$emit('input', this.innerValue)
120120
},
121+
//用正则截取输出值,当出现多组数字时,抛出错误
122+
intercept(e,type){
123+
let judge = e.match(/\d+/g)
124+
//判断是否掺杂数字
125+
if(judge.length>1){
126+
uni.$u.error("请勿在过滤或格式化函数时添加数字")
127+
return 0
128+
}else if(type&&judge[0].length==4){//判断是否是年份
129+
return judge[0]
130+
}else if(judge[0].length>2){
131+
uni.$u.error("请勿在过滤或格式化函数时添加数字")
132+
return 0
133+
}else{
134+
return judge[0]
135+
}
136+
},
121137
// 列发生变化时触发
122138
change(e) {
123139
const { indexs, values } = e
124140
let selectValue = ''
125141
if(this.mode === 'time') {
126142
// 根据value各列索引,从各列数组中,取出当前时间的选中值
127-
selectValue = `${values[0][indexs[0]]}:${values[1][indexs[1]]}`
143+
selectValue = `${this.intercept(values[0][indexs[0]])}:${this.intercept(values[1][indexs[1]])}`
128144
} else {
129145
// 将选择的值转为数值,比如'03'转为数值的3,'2019'转为数值的2019
130-
const year = parseInt(values[0][indexs[0]])
131-
const month = parseInt(values[1][indexs[1]])
132-
let date = parseInt(values[2] ? values[2][indexs[2]] : 1)
146+
const year = parseInt(this.intercept(values[0][indexs[0]],'year'))
147+
const month = parseInt(this.intercept(values[1][indexs[1]]))
148+
let date = parseInt(values[2] ? this.intercept(values[2][indexs[2]]) : 1)
133149
let hour = 0, minute = 0
134150
// 此月份的最大天数
135151
const maxDate = dayjs(`${year}-${month}-${date}`).daysInMonth()
@@ -140,8 +156,8 @@
140156
// 不允许超过maxDate值
141157
date = Math.min(maxDate, date)
142158
if (this.mode === 'datetime') {
143-
hour = parseInt(values[3][indexs[3]])
144-
minute = parseInt(values[4][indexs[4]])
159+
hour = parseInt(this.intercept(values[3][indexs[3]]))
160+
minute = parseInt(this.intercept(values[4][indexs[4]]))
145161
}
146162
// 转为时间模式
147163
selectValue = Number(new Date(year, month - 1, date, hour, minute))

uni_modules/uview-ui/components/u-swiper-indicator/u-swiper-indicator.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
lineStyle() {
5858
let style = {}
5959
style.width = uni.$u.addUnit(this.lineWidth)
60-
style.transform = `translateX(${ this.current * this.lineWidth }px)`
60+
style.transform = `translateX(${ uni.$u.addUnit(this.current * this.lineWidth) })`
6161
style.backgroundColor = this.indicatorActiveColor
6262
return style
6363
},

unpackage/dist/dev/mp-weixin/app.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,5 +91,6 @@
9191
"desc": "为你推荐附近的门店"
9292
}
9393
},
94-
"usingComponents": {}
94+
"usingComponents": {},
95+
"sitemapLocation": "sitemap.json"
9596
}

0 commit comments

Comments
 (0)