Skip to content

Commit f6c84ff

Browse files
committed
uview update to 2022-02-17
1 parent fef7a80 commit f6c84ff

File tree

13 files changed

+141
-52
lines changed

13 files changed

+141
-52
lines changed

App.vue

Lines changed: 2 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,open_growth,shopping_cart_vop_open',
1212
wxpayOpenAppId: 'wx9b04553fd8c7b9c3' // 微信开放平台的移动端应用appID

node_modules/apifm-uniapp/index.js

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

pages/index/index.vue

Lines changed: 58 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,14 @@
5858
:time="item.dateEndInt" format="剩余: HH时mm分ss秒"></u-count-down>
5959
<view class="miaosha-price-btn">
6060
<view class="price">¥{{item.minPrice}} <text>¥{{item.originalPrice}}</text></view>
61-
<u-button v-if="item.dateStartInt > 0" type="warning" size="mini" plain disabled text="即将开始" @click="goDetail(item)">
61+
<u-button v-if="item.dateStartInt > 0" type="warning" size="mini" plain disabled text="即将开始"
62+
@click="goDetail(item)">
6263
</u-button>
63-
<u-button v-else-if="item.dateEndInt <= 0" type="info" size="mini" plain disabled text="已结束" @click="goDetail(item)">
64+
<u-button v-else-if="item.dateEndInt <= 0" type="info" size="mini" plain disabled text="已结束"
65+
@click="goDetail(item)">
6466
</u-button>
65-
<u-button v-else-if="item.stores <= 0" type="info" size="mini" plain disabled text="已抢完" @click="goDetail(item)">
67+
<u-button v-else-if="item.stores <= 0" type="info" size="mini" plain disabled text="已抢完"
68+
@click="goDetail(item)">
6669
</u-button>
6770
<u-button v-else type="error" size="mini" plain text="立即抢购" @click="goDetail(item)"></u-button>
6871
</view>
@@ -81,17 +84,21 @@
8184
<view class="goods-container">
8285
<view v-for="(item, index) in goodsRecommend" :key="index" class="goods-box" bindtap="toDetailsTap">
8386
<view class="img-box">
84-
<image :src="item.pic" class="image" mode="aspectFill" lazy-load="true" @click="goDetail(item)" />
87+
<image :src="item.pic" class="image" mode="aspectFill" lazy-load="true"
88+
@click="goDetail(item)" />
8589
</view>
8690
<view class="goods-title u-line-3 pt16" @click="goDetail(item)">
87-
<u-tag v-if="item.supplyType == 'vop_jd' || item.supplyType == 'jdJoycityPoints'" text="京东自营" bgColor="#e64340" borderColor="#e64340" size="mini" class="goods-title-tag"></u-tag>
91+
<u-tag v-if="item.supplyType == 'vop_jd' || item.supplyType == 'jdJoycityPoints'" text="京东自营"
92+
bgColor="#e64340" borderColor="#e64340" size="mini" class="goods-title-tag"></u-tag>
8893
<text class="goods-title">{{ item.name }}</text>
8994
</view>
9095
<u--text v-if="item.characteristic" class="goods-title" :text="item.characteristic" size="28rpx"
9196
color="#c95060"></u--text>
9297
<view class="price-score">
9398
<view v-if="item.minPrice" class="item"><text>¥</text>{{item.minPrice}}</view>
94-
<view v-if="item.minScore" class="item"><text><image class="score-icon" src="/static/images/score.png"></image></text>{{item.minScore}}</view>
99+
<view v-if="item.minScore" class="item"><text>
100+
<image class="score-icon" src="/static/images/score.png"></image>
101+
</text>{{item.minScore}}</view>
95102
</view>
96103
</view>
97104
</view>
@@ -153,17 +160,21 @@
153160
<view class="goods-container">
154161
<view v-for="(item, index) in goods" :key="index" class="goods-box" bindtap="toDetailsTap">
155162
<view class="img-box">
156-
<image :src="item.pic" class="image" mode="aspectFill" lazy-load="true" @click="goDetail(item)" />
163+
<image :src="item.pic" class="image" mode="aspectFill" lazy-load="true"
164+
@click="goDetail(item)" />
157165
</view>
158166
<view class="goods-title u-line-3 pt16" @click="goDetail(item)">
159-
<u-tag v-if="item.supplyType == 'vop_jd' || item.supplyType == 'jdJoycityPoints'" text="京东自营" bgColor="#e64340" borderColor="#e64340" size="mini" class="goods-title-tag"></u-tag>
167+
<u-tag v-if="item.supplyType == 'vop_jd' || item.supplyType == 'jdJoycityPoints'" text="京东自营"
168+
bgColor="#e64340" borderColor="#e64340" size="mini" class="goods-title-tag"></u-tag>
160169
<text class="goods-title">{{ item.name }}</text>
161170
</view>
162171
<u--text v-if="item.characteristic" class="goods-title" :text="item.characteristic" size="28rpx"
163172
color="#c95060"></u--text>
164173
<view class="price-score">
165174
<view v-if="item.minPrice" class="item"><text>¥</text>{{item.minPrice}}</view>
166-
<view v-if="item.minScore" class="item"><text><image class="score-icon" src="/static/images/score.png"></image></text>{{item.minScore}}</view>
175+
<view v-if="item.minScore" class="item"><text>
176+
<image class="score-icon" src="/static/images/score.png"></image>
177+
</text>{{item.minScore}}</view>
167178
</view>
168179
</view>
169180
</view>
@@ -192,24 +203,24 @@
192203
if (ua.match(/MicroMessenger/i) == 'micromessenger') {
193204
const jweixin = require('jweixin-module')
194205
jweixin.ready(() => { // 需在用户可能点击分享按钮前就先调用
195-
jweixin.updateAppMessageShareData({
196-
title: '京栖无限企福平台', // 分享标题
197-
desc: '京栖无限企福平台', // 分享描述
198-
link: 'https://flpt.jxsupplier.com', // 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
199-
imgUrl: 'https://dcdn.it120.cc/2022/01/26/02235d13-1ea8-4cd1-af00-1b219b5b07f9.jpeg', // 分享图标
200-
success: function() {
201-
// 设置成功
202-
}
203-
})
204-
jweixin.updateTimelineShareData({
205-
title: '京栖无限企福平台', // 分享标题
206-
desc: '京栖无限企福平台', // 分享描述
207-
link: 'https://flpt.jxsupplier.com', // 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
208-
imgUrl: 'https://dcdn.it120.cc/2022/01/26/02235d13-1ea8-4cd1-af00-1b219b5b07f9.jpeg', // 分享图标
209-
success: function() {
210-
// 设置成功
211-
}
212-
})
206+
jweixin.updateAppMessageShareData({
207+
title: '京栖无限企福平台', // 分享标题
208+
desc: '京栖无限企福平台', // 分享描述
209+
link: 'https://flpt.jxsupplier.com', // 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
210+
imgUrl: 'https://dcdn.it120.cc/2022/01/26/02235d13-1ea8-4cd1-af00-1b219b5b07f9.jpeg', // 分享图标
211+
success: function() {
212+
// 设置成功
213+
}
214+
})
215+
jweixin.updateTimelineShareData({
216+
title: '京栖无限企福平台', // 分享标题
217+
desc: '京栖无限企福平台', // 分享描述
218+
link: 'https://flpt.jxsupplier.com', // 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
219+
imgUrl: 'https://dcdn.it120.cc/2022/01/26/02235d13-1ea8-4cd1-af00-1b219b5b07f9.jpeg', // 分享图标
220+
success: function() {
221+
// 设置成功
222+
}
223+
})
213224
})
214225
}
215226
// #endif
@@ -266,7 +277,12 @@
266277
this._kanjiaList()
267278
this._pingtuanList()
268279
this._goods()
269-
this.jssdkSign()
280+
// #ifdef H5
281+
const ua = window.navigator.userAgent.toLowerCase()
282+
if (ua.match(/MicroMessenger/i) == 'micromessenger') {
283+
this.jssdkSign()
284+
}
285+
// #endif
270286
},
271287
onShow() {
272288
this.shopInfo = uni.getStorageSync('shopInfo')
@@ -304,18 +320,18 @@
304320
},
305321
methods: {
306322
async jssdkSign() {
307-
const res = await this.$wxapi.jssdkSign(window.location.href)
308-
if (res.code === 0) {
309-
jweixin.config({
310-
debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
311-
appId: res.data.appid, // 必填,公众号的唯一标识
312-
timestamp: res.data.timestamp, // 必填,生成签名的时间戳
313-
nonceStr: res.data.noncestr, // 必填,生成签名的随机串
314-
signature: res.data.sign, // 必填,签名
315-
jsApiList: ['updateAppMessageShareData', 'updateTimelineShareData'] // 必填,需要使用的JS接口列表
316-
})
317-
}
318-
},
323+
const res = await this.$wxapi.jssdkSign(window.location.href)
324+
if (res.code === 0) {
325+
jweixin.config({
326+
debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
327+
appId: res.data.appid, // 必填,公众号的唯一标识
328+
timestamp: res.data.timestamp, // 必填,生成签名的时间戳
329+
nonceStr: res.data.noncestr, // 必填,生成签名的随机串
330+
signature: res.data.sign, // 必填,签名
331+
jsApiList: ['updateAppMessageShareData', 'updateTimelineShareData'] // 必填,需要使用的JS接口列表
332+
})
333+
}
334+
},
319335
goSearch() {
320336
uni.navigateTo({
321337
url: '/pages/search/index'
@@ -505,6 +521,7 @@
505521
width: 100%;
506522
height: var(--status-bar-height);
507523
}
524+
508525
.index {
509526
.top-box {
510527
padding: 16rpx 8rpx;
@@ -779,6 +796,7 @@
779796
margin-top: 32rpx;
780797
}
781798
}
799+
782800
.blank {
783801
height: 32rpx;
784802
}

pages/order/detail.vue

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,24 @@
11
<template>
22
<view v-if="orderDetail" class="to-pay-order">
3+
<u-cell-group title="订单信息">
4+
<u-cell title="订单ID" :value="orderDetail.orderInfo.id"></u-cell>
5+
<u-cell title="订单号" :value="orderDetail.orderInfo.orderNumber"></u-cell>
6+
<u-cell v-if="orderDetail.orderInfo.type == 5" title="京东订单号" :value="orderDetail.orderInfo.orderNumberOuter"></u-cell>
7+
</u-cell-group>
8+
<u-cell-group v-if="refundApplyInfo" title="用户申请售后信息">
9+
<u-cell title="售后类型" :value="refundApplyInfo.baseInfo.typeStr"></u-cell>
10+
<u-cell title="售后原因" :value="refundApplyInfo.baseInfo.reason"></u-cell>
11+
<u-cell v-if="refundApplyInfo.baseInfo.outerOrderId" title="售后订单号" :value="refundApplyInfo.baseInfo.outerOrderId"></u-cell>
12+
<u-cell title="申请时间" :value="refundApplyInfo.baseInfo.dateAdd"></u-cell>
13+
<u-cell v-if="refundApplyInfo.baseInfo.remark" title="备注" :value="refundApplyInfo.baseInfo.remark"></u-cell>
14+
<u-cell title="状态" :value="refundApplyInfo.baseInfo.statusStr"></u-cell>
15+
</u-cell-group>
16+
<view class="refundApplyInfo-pics" v-if="refundApplyInfo && refundApplyInfo.pics">
17+
<u-album :urls="refundApplyInfo.pics" keyName="pic" multipleSize="125"></u-album>
18+
</view>
19+
<u-cell-group v-if="joycityPointsAfterSaleOrderInfo" title="售后进度">
20+
<u-cell v-for="(item,index) in joycityPointsAfterSaleOrderInfo.afsLogs" :title="item.operator + item.operationDesc" :label="item.createdTime"></u-cell>
21+
</u-cell-group>
322
<u-divider text="收货地址"></u-divider>
423
<u-cell v-if="orderDetail.logistics" icon="map" :border="false" :title="orderDetail.logistics.linkMan + ' ' + orderDetail.logistics.mobile" :label="orderDetail.logistics.provinceStr + orderDetail.logistics.cityStr + orderDetail.logistics.areaStr + orderDetail.logistics.address"></u-cell>
524
<u-divider text="商品信息"></u-divider>
@@ -51,6 +70,8 @@
5170
data() {
5271
return {
5372
orderDetail: undefined,
73+
refundApplyInfo: undefined,
74+
joycityPointsAfterSaleOrderInfo: undefined
5475
}
5576
},
5677
created() {
@@ -81,6 +102,9 @@
81102
return
82103
}
83104
this.orderDetail = res.data
105+
if(res.data.orderInfo.refundStatus != 0 || res.data.orderInfo.hasRefund) {
106+
this.refundApplyDetail()
107+
}
84108
},
85109
async orderDelivery() {
86110
uni.showModal({
@@ -107,6 +131,25 @@
107131
icon: 'none'
108132
})
109133
}
134+
},
135+
async refundApplyDetail() {
136+
// https://www.yuque.com/apifm/nu0f75/rgng3x
137+
const res = await this.$wxapi.refundApplyDetail(this.token, this.orderDetail.orderInfo.id)
138+
if(res.code == 0) {
139+
this.refundApplyInfo = res.data[0]
140+
if(this.orderDetail.orderInfo.type == 5) {
141+
this.joycityPointsSearchAfsOrderDetail(this.refundApplyInfo.baseInfo.outerOrderId)
142+
}
143+
}
144+
},
145+
async joycityPointsSearchAfsOrderDetail(afterSaleId) {
146+
const res = await this.$wxapi.joycityPointsSearchAfsOrderDetail({
147+
token: this.token,
148+
afterSaleId
149+
})
150+
if(res.code == 0) {
151+
this.joycityPointsAfterSaleOrderInfo = res.data
152+
}
110153
}
111154
}
112155
}
@@ -251,4 +294,7 @@
251294
color: rgb(200, 200, 200);
252295
font-size: 26rpx;
253296
}
297+
.refundApplyInfo-pics {
298+
padding: 16rpx;
299+
}
254300
</style>

pages/refund/apply.vue

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,13 @@
191191
})
192192
return
193193
}
194+
if(!this.pics || this.pics.length == 0) {
195+
uni.showToast({
196+
title: '请拍照并上传照片',
197+
icon: 'none'
198+
})
199+
return
200+
}
194201
}
195202
this.$refs.uForm.validate().then(res => {
196203
this._submit()

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,10 @@
103103
immediate: true,
104104
handler(newVal) {
105105
this.avatarUrl = newVal
106+
// 如果没有传src,则主动触发error事件,用于显示默认的头像,否则src为''空字符等的时候,会无内容展示
107+
if(!newVal) {
108+
this.errorHandler()
109+
}
106110
}
107111
}
108112
},

uni_modules/uview-ui/components/u-form-item/props.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ export default {
3434
required: {
3535
type: Boolean,
3636
default: uni.$u.props.formItem.required
37+
},
38+
leftIconStyle: {
39+
type: [String, Object],
40+
default: uni.$u.props.formItem.leftIconStyle,
3741
}
3842
}
3943
}

uni_modules/uview-ui/components/u-form-item/u-form-item.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@
8686
* @property {String | Number} labelWidth label的宽度,单位px
8787
* @property {String} rightIcon 右侧图标
8888
* @property {String} leftIcon 左侧图标
89+
* @property {String | Object} leftIconStyle 左侧图标的样式
8990
* @property {Boolean} required 是否显示左边的必填星号,只作显示用,具体校验必填的逻辑,请在rules中配置 (默认 false )
9091
*
9192
* @example <u-form-item label="姓名" prop="userInfo.name" borderBottom ref="item1"></u-form-item>

uni_modules/uview-ui/components/u-switch/props.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,12 @@ export default {
3030
type: [Boolean, String, Number],
3131
default: uni.$u.props.switch.value
3232
},
33-
// 打开选择器时的值
33+
// switch打开时的值
3434
activeValue: {
3535
type: [String, Number, Boolean],
3636
default: uni.$u.props.switch.activeValue
3737
},
38-
// 关闭选择器时的值
38+
// switch关闭时的值
3939
inactiveValue: {
4040
type: [String, Number, Boolean],
4141
default: uni.$u.props.switch.inactiveValue

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
* switch 开关选择器
3434
* @description 选择开关一般用于只有两个选择,且只能选其一的场景。
3535
* @tutorial https://www.uviewui.com/components/switch.html
36-
* @property {Boolean} loading 是否处于加载中(默认 false )
36+
* @property {Boolean} loading 是否处于加载中(默认 false )
3737
* @property {Boolean} disabled 是否禁用(默认 false )
3838
* @property {String | Number} size 开关尺寸,单位px (默认 25 )
3939
* @property {String} activeColor 打开时的背景色 (默认 '#2979ff' )
@@ -44,7 +44,7 @@
4444
* @property {Boolean} asyncChange 是否开启异步变更,开启后需要手动控制输入值 (默认 false )
4545
* @property {String | Number} space 圆点与外边框的距离 (默认 0 )
4646
* @property {Object} customStyle 定义需要用到的外部样式
47-
*
47+
*
4848
* @event {Function} change 在switch打开或关闭时触发
4949
* @example <u-switch v-model="checked" active-color="red" inactive-color="#eee"></u-switch>
5050
*/
@@ -56,7 +56,7 @@
5656
immediate: true,
5757
handler(n) {
5858
if(n !== this.inactiveValue && n !== this.activeValue) {
59-
uni.$u.error('v-mode绑定的值必须为inactiveValue、activeValue二者之一')
59+
uni.$u.error('v-model绑定的值必须为inactiveValue、activeValue二者之一')
6060
}
6161
}
6262
}
@@ -76,7 +76,7 @@
7676
// 如果自定义了“非激活”演示,name边框颜色设置为透明(跟非激活颜色一致)
7777
// 这里不能简单的设置为非激活的颜色,否则打开状态时,会有边框,所以需要透明
7878
if(this.customInactiveColor) {
79-
style.borderColor = 'rgba(0, 0, 0, 0)'
79+
style.borderColor = 'rgba(0, 0, 0, 0)'
8080
}
8181
style.backgroundColor = this.value === this.activeValue ? this.activeColor : this.inactiveColor
8282
return style;

uni_modules/uview-ui/libs/config/config.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
const version = '2.0.27'
33

44
// 开发环境才提示,生产环境不会提示
5-
5+
if (process.env.NODE_ENV === 'development') {
6+
console.log(`\n %c uView V${version} %c https://www.uviewui.com/ \n\n`, 'color: #ffffff; background: #3c9cff; padding:5px 0;', 'color: #3c9cff;background: #ffffff; padding:5px 0;');
7+
}
68

79
export default {
810
v: version,

uni_modules/uview-ui/libs/config/props/formItem.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ export default {
1616
labelWidth: '',
1717
rightIcon: '',
1818
leftIcon: '',
19-
required: false
19+
required: false,
20+
leftIconStyle: '',
2021
}
2122
}

uni_modules/uview-ui/libs/function/index.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -507,8 +507,11 @@ function priceFormat(number, decimals = 0, decimalPoint = '.', thousandsSeparato
507507
const dec = (typeof decimalPoint === 'undefined') ? '.' : decimalPoint
508508
let s = ''
509509
const toFixedFix = function(n, prec) {
510-
const k = 10 ** prec
511-
return `${Math.ceil(parseInt(n * k)) / k}`
510+
const k = 10 ** (prec)
511+
// 这里写成 乘10 再除10 是因为在部分情况下浮点数运算会有精度损失问题
512+
// 例如 1.15 * 100 的结果为 114.999... , parseInt后就变成了114, 显然与预期不符
513+
// 注意这里 (k * 10)的小括号是必须的,用来保证强制的优先级!
514+
return `${Math.ceil(parseInt(n * (k * 10))) / (k * 10)}`
512515
}
513516

514517
s = (prec ? toFixedFix(n, prec) : `${Math.round(n)}`).split('.')

0 commit comments

Comments
 (0)