Skip to content

Commit 9cce04b

Browse files
author
石小磊
committed
add: 适配京东平台(jd)
1 parent f592e7e commit 9cce04b

File tree

11 files changed

+80
-68
lines changed

11 files changed

+80
-68
lines changed

changelog.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
## 3.2.12(2021-12-20)
2+
- 新增 适配京东平台(jd)
13
## 3.2.11(2021-12-07)
24
- 修复 uni-ui 在 hello-uniapp 中丢失图标、ui 受到公共样式影响等问题
35
- 修复 微信登录取值报错的问题

manifest.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,9 @@
120120
"mp-toutiao" : {
121121
"usingComponents" : true
122122
},
123+
"mp-jd" : {
124+
"usingComponents" : true
125+
},
123126
"h5" : {
124127
"template" : "template.h5.html",
125128
"router" : {

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,8 @@
7575
"阿里": "y",
7676
"百度": "y",
7777
"字节跳动": "y",
78-
"QQ": "y"
78+
"QQ": "y",
79+
"京东": "y"
7980
},
8081
"快应用": {
8182
"华为": "u",
@@ -102,4 +103,4 @@
102103
}
103104
}
104105
}
105-
}
106+
}

pages.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -672,7 +672,7 @@
672672
}
673673
},
674674
// #endif
675-
// #ifdef APP-PLUS || MP-WEIXIN || MP-QQ
675+
// #ifdef APP-PLUS || MP-WEIXIN || MP-QQ || MP-JD
676676
{
677677
"path": "bluetooth/bluetooth",
678678
"style": {

pages/API/get-network-type/get-network-type.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
</view>
1818
<view class="uni-btn-v uni-common-mt">
1919
<button type="primary" @tap="getNetworkType">获取设备网络状态</button>
20-
<!-- #ifdef MP-WEIXIN -->
20+
<!-- #ifdef MP-WEIXIN || MP-JD-->
2121
<button v-if="hasNetworkType === true && networkType === 'wifi'" class="uni-common-mt" type="primary" @tap="getConnectedWifi">获取 wifi 信息</button>
2222
<!-- #endif -->
2323
<button class="uni-common-mt" @tap="clear">清空</button>

pages/API/get-user-info/get-user-info.vue

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
<!-- #ifdef APP-PLUS || MP-ALIPAY || MP-TOUTIAO -->
2020
<button type="primary" :loading="btnLoading" @click="getUserInfo">获取用户信息</button>
2121
<!-- #endif -->
22-
<!-- #ifdef MP-WEIXIN || MP-BAIDU || MP-QQ -->
22+
<!-- #ifdef MP-WEIXIN || MP-BAIDU || MP-QQ || MP-JD -->
2323
<button type="primary" open-type="getUserInfo" @getuserinfo="mpGetUserInfo">获取用户信息</button>
2424
<!-- #endif -->
2525
<button @click="clear">清空</button>
@@ -68,17 +68,17 @@
6868
this.btnLoading = false;
6969
})
7070
return;
71-
}
72-
73-
if(this.loginProvider === 'apple'){
74-
const nickname = uni.getStorageSync('apple_nickname')
75-
if(nickname){
76-
this.hasUserInfo = true;
71+
}
72+
73+
if(this.loginProvider === 'apple'){
74+
const nickname = uni.getStorageSync('apple_nickname')
75+
if(nickname){
76+
this.hasUserInfo = true;
7777
this.userInfo = { nickName:nickname }
78-
this.btnLoading = false;
79-
return;
80-
}
81-
}
78+
this.btnLoading = false;
79+
return;
80+
}
81+
}
8282
8383
uni.getUserInfo({
8484
provider: this.loginProvider,
@@ -141,6 +141,9 @@
141141
}
142142
this.hasUserInfo = true;
143143
this.userInfo = result.detail.userInfo;
144+
// #ifdef MP-JD
145+
this.userInfo = result.detail.user_info;
146+
// #endif
144147
},
145148
clear() {
146149
this.hasUserInfo = false;

pages/API/login/login.vue

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
</block>
2323
</view>
2424
<view class="uni-btn-v uni- uni-common-mt">
25-
<!-- #ifdef MP-TOUTIAO -->
25+
<!-- #ifdef MP-TOUTIAO || MP-JD-->
2626
<button type="primary" class="page-body-button" v-for="(value,key) in providerList" @click="tologin(value)" :key="key">
2727
登录
2828
</button>
@@ -80,6 +80,9 @@
8080
case 'baidu':
8181
providerName = '百度登录'
8282
break;
83+
case 'jd':
84+
providerName = '京东登录'
85+
break;
8386
case 'toutiao':
8487
providerName = '头条登录'
8588
break;
@@ -249,23 +252,23 @@
249252
})
250253
},
251254
async loginByApple(provider, res) {
252-
// 获取用户信息
253-
let getUserInfoErr, result
254-
// #ifndef VUE3
255+
// 获取用户信息
256+
let getUserInfoErr, result
257+
// #ifndef VUE3
255258
[getUserInfoErr, result] = await uni.getUserInfo({
256259
provider
257-
});
258-
// #endif
259-
260-
// #ifdef VUE3
261-
try {
262-
result = await uni.getUserInfo({
263-
provider
264-
});
265-
} catch(e) {
266-
getUserInfoErr = e
267-
}
268-
// #endif
260+
});
261+
// #endif
262+
263+
// #ifdef VUE3
264+
try {
265+
result = await uni.getUserInfo({
266+
provider
267+
});
268+
} catch(e) {
269+
getUserInfoErr = e
270+
}
271+
// #endif
269272
270273
if (getUserInfoErr) {
271274
let content = getUserInfoErr.errMsg;

pages/component/button/button.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
<button class="mini-btn" type="default" size="mini">按钮</button>
2424
<button class="mini-btn" type="warn" size="mini">按钮</button>
2525
</view>
26-
<!-- #ifdef MP-WEIXIN || MP-QQ -->
26+
<!-- #ifdef MP-WEIXIN || MP-QQ || MP-JD -->
2727
<button open-type="launchApp" app-parameter="uni-app" @error="openTypeError">打开APP</button>
2828
<button open-type="feedback">意见反馈</button>
2929
<!-- #endif -->

pages/extUI/file-picker/file-picker.vue

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -7,37 +7,37 @@
77
<view class="example-body">
88
<uni-file-picker limit="9" title="最多选择9张图片"></uni-file-picker>
99
</view>
10-
</uni-section>
11-
<uni-section title="只选择视频" type="line">
12-
<view class="example-body">
13-
<uni-file-picker limit="9" file-mediatype="video" title="最多选择9个视频"></uni-file-picker>
14-
</view>
10+
</uni-section>
11+
<uni-section title="只选择视频" type="line">
12+
<view class="example-body">
13+
<uni-file-picker limit="9" file-mediatype="video" title="最多选择9个视频"></uni-file-picker>
14+
</view>
1515
</uni-section>
1616

1717

18-
<!-- #ifdef H5 || MP-WEIXIN -->
19-
<uni-section title="选择任意文件" type="line">
20-
<view class="example-body">
21-
<uni-file-picker limit="5" file-mediatype="all" title="最多选择5个文件"></uni-file-picker>
22-
</view>
18+
<!-- #ifdef H5 || MP-WEIXIN || MP-JD -->
19+
<uni-section title="选择任意文件" type="line">
20+
<view class="example-body">
21+
<uni-file-picker limit="5" file-mediatype="all" title="最多选择5个文件"></uni-file-picker>
22+
</view>
2323
</uni-section>
24-
<!-- #endif -->
25-
26-
<uni-section title="自定义图片大小" type="line">
27-
<view class="example-body custom-image-box">
28-
<text class="text">选择头像</text>
29-
<uni-file-picker limit="1" :del-icon="false" disable-preview :imageStyles="imageStyles"
30-
file-mediatype="image">选择</uni-file-picker>
31-
</view>
32-
</uni-section>
33-
34-
<uni-section title="自定义图片大小" type="line">
35-
<view class="example-body ">
36-
<uni-file-picker readonly :value="fileLists" :imageStyles="imageStyles" file-mediatype="image">
37-
</uni-file-picker>
38-
<uni-file-picker readonly :value="fileLists" :listStyles="listStyles" file-mediatype="all">
39-
</uni-file-picker>
40-
</view>
24+
<!-- #endif -->
25+
26+
<uni-section title="自定义图片大小" type="line">
27+
<view class="example-body custom-image-box">
28+
<text class="text">选择头像</text>
29+
<uni-file-picker limit="1" :del-icon="false" disable-preview :imageStyles="imageStyles"
30+
file-mediatype="image">选择</uni-file-picker>
31+
</view>
32+
</uni-section>
33+
34+
<uni-section title="自定义图片大小" type="line">
35+
<view class="example-body ">
36+
<uni-file-picker readonly :value="fileLists" :imageStyles="imageStyles" file-mediatype="image">
37+
</uni-file-picker>
38+
<uni-file-picker readonly :value="fileLists" :listStyles="listStyles" file-mediatype="all">
39+
</uni-file-picker>
40+
</view>
4141
</uni-section>
4242

4343
</view>
@@ -88,10 +88,10 @@
8888
}
8989
</script>
9090

91-
<style lang="scss">
92-
.example-body {
93-
padding:10px;
94-
padding-top: 0;
91+
<style lang="scss">
92+
.example-body {
93+
padding:10px;
94+
padding-top: 0;
9595
}
9696
.custom-image-box {
9797
/* #ifndef APP-NVUE */
@@ -106,4 +106,4 @@
106106
font-size: 14px;
107107
color: #333;
108108
}
109-
</style>
109+
</style>

pages/tabBar/API/API.nvue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
url: 'inner-audio'
5454
},
5555
// #endif
56-
// #ifdef APP-PLUS || MP-WEIXIN || MP-BAIDU || MP-QQ
56+
// #ifdef APP-PLUS || MP-WEIXIN || MP-BAIDU || MP-QQ|| MP-JD
5757
{
5858
name: '录音',
5959
url: 'voice'
@@ -189,7 +189,7 @@
189189
url: 'brightness'
190190
},
191191
// #endif
192-
// #ifdef APP-PLUS || MP-WEIXIN || MP-QQ
192+
// #ifdef APP-PLUS || MP-WEIXIN || MP-QQ|| MP-JD
193193
{
194194
name: '蓝牙',
195195
url: 'bluetooth'

uni_modules/uni-swipe-action/components/uni-swipe-action-item/uni-swipe-action-item.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@
7272
</view>
7373
<!-- #endif -->
7474
<!-- 其他平台使用 js ,长列表性能可能会有影响-->
75-
<!-- #ifdef MP-ALIPAY || MP-BAIDU || MP-TOUTIAO || MP-QQ -->
75+
<!-- #ifdef MP-ALIPAY || MP-BAIDU || MP-TOUTIAO || MP-QQ || MP-JD -->
7676
<view class="uni-swipe">
7777
<view class="uni-swipe_box" @touchstart="touchstart" @touchmove="touchmove" @touchend="touchend"
7878
:style="{transform:moveLeft}" :class="{ani:ani}">
@@ -345,4 +345,4 @@
345345
}
346346
347347
/* #endif */
348-
</style>
348+
</style>

0 commit comments

Comments
 (0)