提交 a3d70aad 编写于 作者: L linju

123

上级 2b257a59
...@@ -8,24 +8,31 @@ ...@@ -8,24 +8,31 @@
onLaunch: function() { onLaunch: function() {
console.log('App Launch') console.log('App Launch')
initApp(); initApp();
//预加载设置页面
uni.preloadPage({
url: "/pages/ucenter/settings/settings",
complete:e=>{
console.log(e);
}
});
// #ifdef APP-PLUS // #ifdef APP-PLUS
//预加载一键登录 //预加载一键登录
// plus.oauth.getServices(oauthServices=>{ plus.oauth.getServices(oauthServices=>{
// oauthServices.forEach(({_id},item)=>{ console.log(oauthServices);
// if(_id=='provider'){ oauthServices.forEach(({_id},item)=>{
// uni.preLogin({ if(_id=='provider'){
// provider:item, uni.preLogin({
// complete:e=>{ provider:item,
// console.log(e); complete:e=>{
// } console.log(e);
// }) }
// } })
// }) }
})
// uni.preloadPage({url: "/uni_modules/uni-login-page/pages/index/index"}); uni.preloadPage({url: "/uni_modules/uni-login-page/pages/index/index"});
// },err=>{ },err=>{
// console.error('获取服务供应商失败:' + JSON.stringify(err)); console.error('获取服务供应商失败:' + JSON.stringify(err));
// }) })
// #endif // #endif
}, },
onShow: function() { onShow: function() {
......
...@@ -5,13 +5,19 @@ ...@@ -5,13 +5,19 @@
"/uni_modules/uni-login-page/pages/index/pwd-retrieve" "/uni_modules/uni-login-page/pages/index/pwd-retrieve"
] ]
}, },
"aboutus":{ "about":{
"appName":"base-app", "appName":"base-app",
"company":"数字天堂(北京)网络技术有限公司", "company":"数字天堂(北京)网络技术有限公司",
"slogan":"为开发而生", "slogan":"为开发而生",
"agreement":{ "agreements":[
"privacy":"https://uniapp.dcloud.io/", {
"business":"https://uniapp.dcloud.io/" "title":"用户服务协议",
} "url":"https://uniapp.dcloud.io/"
},
{
"title":"隐私政策",
"url":"https://uniapp.dcloud.io/"
}
]
} }
} }
\ No newline at end of file
...@@ -10,21 +10,46 @@ export default function() { ...@@ -10,21 +10,46 @@ export default function() {
//自定义路由拦截 //自定义路由拦截
const {"router":{needLogin}} = baseappConfig //需要登陆的页面 const {"router":{needLogin}} = baseappConfig //需要登陆的页面
changeAction(["navigateTo", "redirectTo", "reLaunch", "switchTab"], {
before_action: e => { // changeAction(["navigateTo", "redirectTo", "reLaunch", "switchTab"], {
let token = uni.getStorageSync('uni-id-token') // before_action: e => {
if (needLogin.includes(e.url) && token == '') { // let token = uni.getStorageSync('uni-id-token')
console.log('该页面需要登陆,即将跳转到login页面'); // let url = e.url.split('?')[0]
uni.showToast({title:'该页面需要登陆,即将跳转到login页面',icon:'none'}) // if (needLogin.includes(url) && token == '') {
uni.redirectTo({ // console.log('该页面需要登陆,即将跳转到login页面');
url:"/uni_modules/uni-login-page/pages/index/index" // uni.showToast({title:'该页面需要登陆,即将跳转到login页面',icon:'none'})
}) // uni.navigateTo({
return false // url:"/uni_modules/uni-login-page/pages/index/index"
// })
// return false
// }
// return true
// }
// })
//uni.addInterceptor的写法
let list = ["navigateTo", "redirectTo", "reLaunch", "switchTab"];
list.forEach(item=>{
uni.addInterceptor(item,{
invoke(e){// 调用前拦截
//console.log(e);
let token = uni.getStorageSync('uni-id-token')
let url = e.url.split('?')[0]
if (needLogin.includes(url) && token == '') {
console.log('该页面需要登陆,即将跳转到login页面');
uni.showToast({title:'该页面需要登陆,即将跳转到login页面',icon:'none'})
uni.navigateTo({
url:"/uni_modules/uni-login-page/pages/index/index"
})
return false
}
return true
} }
return true })
}
}) })
//提示网络变化 //提示网络变化
eventListenerNetwork() eventListenerNetwork()
...@@ -128,7 +153,7 @@ function changeAction(actions, {before_action,after_action}) { ...@@ -128,7 +153,7 @@ function changeAction(actions, {before_action,after_action}) {
let old_action = uni[action] let old_action = uni[action]
uni[action] = e => { uni[action] = e => {
if (before_action(e)) { if (before_action(e)) {
console.log(after_action); // console.log(after_action);
if (after_action) { if (after_action) {
var compose = function(f, g) { var compose = function(f, g) {
return function(x) { return function(x) {
......
...@@ -28,12 +28,24 @@ export default function request(name,params,callback=false,{showLoading=false,lo ...@@ -28,12 +28,24 @@ export default function request(name,params,callback=false,{showLoading=false,lo
resolve(e) resolve(e)
return callback(data,e.result,e) return callback(data,e.result,e)
} }
debug? uni.showModal({content: JSON.stringify(e)}) :''; if(debug){
uni.showModal({
content: JSON.stringify(e),
showCancel: false,
confirmText: '知道了'
})
}
}, },
fail(err){ fail(err){
reject(err) reject(err)
console.log(err); console.log(err);
debug? uni.showModal({content: JSON.stringify(err)}) :''; if(debug){
uni.showModal({
content: JSON.stringify(err),
showCancel: false,
confirmText: '知道了'
})
}
fail(err) fail(err)
} }
}) })
......
...@@ -19,19 +19,19 @@ ...@@ -19,19 +19,19 @@
} }
}, { }, {
"path": "uni_modules/uni-login-page/pages/index/index", "path": "uni_modules/uni-login-page/pages/index/index",
"style": { "style": {
"navigationBarTitleText": "", "navigationBarTitleText": "",
"app-plus": { "app-plus": {
"animationType": "none", "animationType": "none",
"popGesture": "none", "popGesture": "none"
"titleNView": { // "titleNView": {
"buttons": [{ // "buttons": [{
"text": "帮助", // "text": "帮助",
"type": "none", // "type": "none",
"fontSize": "16px", // "fontSize": "16px",
"width": "60px" // "width": "60px"
}] // }]
} // }
} }
} }
}, { }, {
...@@ -139,14 +139,14 @@ ...@@ -139,14 +139,14 @@
"style": { "style": {
"navigationBarTitleText": "", "navigationBarTitleText": "",
"app-plus": { "app-plus": {
"titleNView": { // "titleNView": {
"buttons": [{ // "buttons": [{
"text": "帮助", // "text": "帮助",
"type": "none", // "type": "none",
"fontSize": "16px", // "fontSize": "16px",
"width": "60px" // "width": "60px"
}] // }]
} // }
} }
} }
}, { }, {
...@@ -154,14 +154,14 @@ ...@@ -154,14 +154,14 @@
"style": { "style": {
"navigationBarTitleText": "", "navigationBarTitleText": "",
"app-plus": { "app-plus": {
"titleNView": { // "titleNView": {
"buttons": [{ // "buttons": [{
"text": "帮助", // "text": "帮助",
"type": "none", // "type": "none",
"fontSize": "16px", // "fontSize": "16px",
"width": "60px" // "width": "60px"
}] // }]
} // }
} }
} }
}, { }, {
...@@ -169,14 +169,14 @@ ...@@ -169,14 +169,14 @@
"style": { "style": {
"navigationBarTitleText": "", "navigationBarTitleText": "",
"app-plus": { "app-plus": {
"titleNView": { // "titleNView": {
"buttons": [{ // "buttons": [{
"text": "帮助", // "text": "帮助",
"type": "none", // "type": "none",
"fontSize": "16px", // "fontSize": "16px",
"width": "60px" // "width": "60px"
}] // }]
} // }
} }
} }
......
...@@ -21,7 +21,27 @@ ...@@ -21,7 +21,27 @@
} }
}, },
onLoad() { onLoad() {
uni.addInterceptor('showToast',{
invoke(e){// 调用前拦截
console.log(e)
e.title = "645"
},
success(e){// 成功回调拦截
console.log(e)
},
fail(e){// 失败回调拦截
console.log(e)
},
complete(e){
console.log(e)
},
returnValue(e){// 返回结果拦截
console.log(e)
}
})
return
/* /*
当某个权限调用失败 当某个权限调用失败
1.先检测手机的该模块是否打开 1.先检测手机的该模块是否打开
......
<template> <template>
<view class="aboutus"> <view class="about">
<view class="logo"> <view class="logo">
<image class="logoImg" src="@/static/logo.png"></image> <image class="logoImg" src="@/static/logo.png"></image>
<text class="tip appName">{{aboutus.appName}}</text> <text class="tip appName">{{about.appName}}</text>
<text class="tip" style="font-size:24upx;">Version {{version}}</text> <text class="tip" style="font-size:24upx;">Version {{version}}</text>
</view> </view>
<view class="copyright"> <view class="copyright">
<text class="agreement" @click="navigateTo(aboutus.agreement.privacy,'用户服务协议')">《用户服务协议》</text> <template v-for="(agreement,index) in about.agreements">
<text class="hint"></text> <text class="agreement" @click="navigateTo(agreement)">{{agreement.title}}</text>
<text class="agreement" @click="navigateTo(aboutus.agreement.business,'隐私政策')">《隐私政策》</text> <text class="hint" v-if="about.agreements.length-1>index"></text>
</template>
<text class="hint">Copyright © {{year}}</text> <text class="hint">Copyright © {{year}}</text>
<text class="hint">{{aboutus.company}}</text> <text class="hint">{{about.company}}</text>
</view> </view>
</view> </view>
</template> </template>
...@@ -26,15 +27,15 @@ import baseappConfig from '@/baseapp.config.json'; ...@@ -26,15 +27,15 @@ import baseappConfig from '@/baseapp.config.json';
return { return {
version:"V1.0.0", version:"V1.0.0",
year:"2020", year:"2020",
aboutus:{} about:{}
}; };
}, },
created() { created() {
this.aboutus = baseappConfig.aboutus this.about = baseappConfig.about
this.year = (new Date).getFullYear() this.year = (new Date).getFullYear()
}, },
methods:{ methods:{
navigateTo(url,title){ navigateTo({url,title}){
uni.navigateTo({ uni.navigateTo({
url: '/pages/common/webview/webview?url='+url+'&title='+title, url: '/pages/common/webview/webview?url='+url+'&title='+title,
success: res => {}, success: res => {},
...@@ -46,7 +47,7 @@ import baseappConfig from '@/baseapp.config.json'; ...@@ -46,7 +47,7 @@ import baseappConfig from '@/baseapp.config.json';
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.aboutus { .about {
width: 750upx; width: 750upx;
flex-direction: column; flex-direction: column;
} }
......
<template>
<view class="content">
<!-- 功能列表 -->
<uni-list class="content">
<uni-list-item v-for="(item,index) in agreeList" :key="index" :title="item.title"
:clickable="true" @click="itemClick(item)" :showSwitch="item.showSwitch" :switchChecked="item.isChecked"
:link="!item.showSwitch"></uni-list-item>
</uni-list>
<!-- 退出按钮 -->
<view class="bottom-back" @click="clickLogout">
<text class="bottom-back-text" v-if="userInfo">退出登录</text>
<text class="bottom-back-text" v-else>登录</text>
</view>
</view>
</template>
<script>
import {isOn,setting} from './dc-push/push.js';
import {mapMutations,mapGetters} from 'vuex';
export default {
data() {
return {
agreeList: [{
title: '个人资料',
event:'toEdit'
},
{
title: '修改密码',
event:'changePwd'
},
// {
// title: '注销用户',
// event: ''
// },
//#ifdef APP-PLUS
{
title: '推送功能',
name: 'push',
event: 'openSetting',
isChecked: false,
showSwitch: true
},
// {
// title: '清理缓存',
// event: ''
// },
//#endif
]
}
},
computed:{
...mapGetters({
'userInfo':'user/info'
})
},
onLoad() {
this.initSoterAuthentication();
},
onShow() {
this.checkPush();
},
methods: {
...mapMutations({
logout: 'user/logout'
}),
toEdit(){
uni.navigateTo({
url: '/pages/ucenter/edit/edit'
});
},
changePwd(){
uni.navigateTo({
url:'/uni_modules/uni-login-page/pages/index/pwd-retrieve?phoneNumber='+ (this.userInfo?this.userInfo.phone:'') +'&phoneArea=+86'
});
},
checkPush(){
// 手机端获取推送是否开启
//#ifdef APP-PLUS
let pushIsOn = isOn();
this.agreeList.forEach(item => {
item.name == 'push' ? (item.isChecked = pushIsOn) : '';
})
//#endif
},
/**
* 添加生物认证选项
*/
initSoterAuthentication() {
// #ifdef APP-PLUS || MP-WEIXIN
let checkAuthModeList = [{
title: '指纹解锁',
name: 'fingerPrint',
event: 'startSoterAuthentication'
}, {
title: '人脸解锁',
name: 'facial',
event: 'startSoterAuthentication'
}];
uni.checkIsSupportSoterAuthentication({
success: (res) => {
res.supportMode.forEach(item => {
this.agreeList.push(checkAuthModeList.find(mode => mode.name == item));
})
},
fail: (err) => {
reject(err);
}
})
// #endif
},
/**
* 开始生物认证
*/
startSoterAuthentication(item) {
// 检查是否开启认证
this.checkIsSoterEnrolledInDevice(item)
.then(()=>{
// 开始认证
uni.startSoterAuthentication({
requestAuthModes: [item.name],
challenge: '123456', // 微信端挑战因子
authContent: `请用${item.title}`,
success:(res)=> {
if(res.errCode == 0){
/**
* 验证成功后开启自己的业务逻辑
*
* app端以此为依据 验证成功
*
* 微信小程序需要再次通过后台验证resultJSON与resultJSONSignature获取最终结果
*/
return uni.showToast({
title: `${item.title}成功`,
icon: 'none'
});
}
uni.showToast({
title: '认证失败请重试',
icon: 'none'
});
},
fail:(err)=> {
uni.showToast({
title: `认证失败:${err.errCode}`,
icon: 'none'
});
}
})
})
},
checkIsSoterEnrolledInDevice(mode){
return new Promise((resolve, reject)=>{
uni.checkIsSoterEnrolledInDevice({
checkAuthMode:mode.name,
success: (res) => {
if(res.isEnrolled){
return resolve(res);
}
uni.showToast({
title: `设备未开启${mode.title}`,
icon: 'none'
});
reject(res);
},
fail: (err) => {
uni.showToast({
title: `${mode.title}失败`,
icon: 'none'
});
reject(err);
}
})
})
},
clickLogout() {
if(this.userInfo){
uni.showModal({
title: '提示',
content: '是否退出登录',
cancelText: '取消',
confirmText: '确定',
success: res => {
if(res.confirm){
this.logout();
uni.navigateBack();
}
},
fail: () => {},
complete: () => {}
});
}else{
uni.navigateTo({
url: '/uni_modules/uni-login-page/pages/index/index'
});
}
},
itemClick(item) {
if (!item.to && item.event) {
this[item.event](item);
}
},
/**
* 打开设置页面
*/
openSetting() {
setting();
}
}
}
</script>
<style>
/* #ifndef APP-NVUE */
page {
flex: 1;
width: 100%;
height: 100%;
}
uni-button:after{
border: none;
border-radius: 0;
}
/* #endif */
.content {
/* #ifndef APP-NVUE */
display: flex;
width: 100%;
height: 100%;
/* #endif */
flex-direction: column;
flex: 1;
}
.bottom-back {
width: 750rpx;
height: 120rpx;
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
flex-direction: column;
justify-content: center;
align-items: center;
/* #ifndef APP-NVUE */
border: none;
/* #endif */
border-width: 0;
border-radius: 0;
background-color: #007AFF;
}
.bottom-back-text {
font-size: 40rpx;
color: #FFFFFF;
}
</style>
...@@ -15,14 +15,8 @@ ...@@ -15,14 +15,8 @@
</template> </template>
<script> <script>
import { import {isOn,setting} from './dc-push/push.js';
isOn, import {mapMutations,mapGetters} from 'vuex';
setting
} from './dc-push/push.js';
import {
mapMutations,
mapGetters
} from 'vuex';
export default { export default {
data() { data() {
return { return {
...@@ -77,18 +71,8 @@ ...@@ -77,18 +71,8 @@
}, },
changePwd(){ changePwd(){
uni.navigateTo({ uni.navigateTo({
url:'/uni_modules/uni-login-page/pages/index/pwd-retrieve?phoneNumber='+ (this.userInfo.phone||'') +'&phoneArea=+86' url:'/uni_modules/uni-login-page/pages/index/pwd-retrieve?phoneNumber='+ (this.userInfo?this.userInfo.phone:'') +'&phoneArea=+86'
}); });
// if(this.userInfo){
// uni.navigateTo({
// url:'/uni_modules/uni-login-page/pages/index/pwd-retrieve?phoneNumber='+ (this.userInfo.phone||'') +'&phoneArea=+86'
// });
// } else {
// uni.showToast({
// title: '请先登录',
// icon: 'none'
// });
// }
}, },
checkPush(){ checkPush(){
// 手机端获取推送是否开启 // 手机端获取推送是否开启
......
<template> <template>
<view class="center"> <view class="center">
<navigator url="/pages/ucenter/settings/settings" class="userInfo"> <view class="userInfo" @click="toSettings">
<image class="logo-img" :src="login ? (userInfo.avatar || avatarUrl) :avatarUrl"></image> <image class="logo-img" :src="login ? (userInfo.avatar || avatarUrl) :avatarUrl"></image>
<view class="logo-title"> <view class="logo-title">
<text class="uer-name">{{login ? userInfo.username||userInfo.mobile : '未登录'}}</text> <text class="uer-name">{{login ? userInfo.username||userInfo.mobile : '未登录'}}</text>
<text class="go-login-navigat-arrow navigat-arrow" v-if="!login">&#xe65e;</text> <text class="go-login-navigat-arrow navigat-arrow" v-if="!login">&#xe65e;</text>
</view> </view>
</navigator> </view>
<uni-grid class="grid" :column="5" :showBorder="false" :square="true"> <uni-grid class="grid" :column="5" :showBorder="false" :square="true">
<uni-grid-item class="item" v-for="({text,icon},index) in gridList" @click.native="tapGrid(index)"> <uni-grid-item class="item" v-for="({text,icon},index) in gridList" @click.native="tapGrid(index)">
<uni-icons class="icon" color="#5d5e64" :type="icon" size="28"></uni-icons> <uni-icons class="icon" color="#5d5e64" :type="icon" size="28"></uni-icons>
...@@ -14,17 +14,12 @@ ...@@ -14,17 +14,12 @@
</uni-grid-item> </uni-grid-item>
</uni-grid> </uni-grid>
<uni-list class="center-list" v-for="(sublist , index) in ucenterList"> <uni-list class="center-list" v-for="(sublist , index) in ucenterList">
<uni-list-item v-for="item in sublist" <uni-list-item v-for="item in sublist" :title="item.title" link :rightText="item.rightText"
:title="item.title" :clickable="true" :to="item.to" @click="ucenterListClick(item)">
link :rightText="item.rightText" <view v-if="item.showBadge" class="item-footer" slot="footer">
:clickable="true" <text class="item-footer-text">{{item.rightText}}</text>
:to="item.to" <view class="item-footer-badge"></view>
@click="ucenterListClick(item)" </view>
>
<view v-if="item.showBadge" class="item-footer" slot="footer">
<text class="item-footer-text">{{item.rightText}}</text>
<view class="item-footer-badge"></view>
</view>
</uni-list-item> </uni-list-item>
</uni-list> </uni-list>
</view> </view>
...@@ -69,29 +64,23 @@ ...@@ -69,29 +64,23 @@
title: '我的积分', title: '我的积分',
to: '' to: ''
}], }],
[{ [
title: '政策与协议',
to: '/pages/ucenter/agree-list/agree-list'
}, {
title: '关于',
to: '/pages/ucenter/about/about'
},
//#ifdef APP-PLUS //#ifdef APP-PLUS
{ {
title: '检查更新', title: '检查更新',
rightText: `V${getApp().appVersion.version}_${getApp().appVersion.versionCode}`, rightText: `V${getApp().appVersion.version}_${getApp().appVersion.versionCode}`,
event:'checkVersion', event: 'checkVersion',
showBadge:true showBadge: true
} },
//#endif //#endif
], {
[{ title: '反馈',
title: '反馈', to: '/uni_modules/opendb-feedback/pages/opendb-feedback/list' // /pages/ucenter/uni-feedback/uni-feedback uni_modules/opendb-feedback/pages/opendb-feedback/list
to: '/uni_modules/opendb-feedback/pages/opendb-feedback/list' // /pages/ucenter/uni-feedback/uni-feedback uni_modules/opendb-feedback/pages/opendb-feedback/list },{
}, { title: '关于',
title: '设置', to: '/pages/ucenter/about/about'
to: '/pages/ucenter/settings/settings' }
}] ]
] ]
} }
}, },
...@@ -107,7 +96,12 @@ ...@@ -107,7 +96,12 @@
methods: { methods: {
...mapMutations({ ...mapMutations({
logout: 'user/logout' logout: 'user/logout'
}), }),
toSettings(){
uni.navigateTo({
url:"/pages/ucenter/settings/settings"
})
},
/** /**
* 个人中心项目列表点击事件 * 个人中心项目列表点击事件
*/ */
...@@ -132,9 +126,9 @@ ...@@ -132,9 +126,9 @@
}) })
} }
}, },
tapGrid(index){ tapGrid(index) {
uni.showToast({ uni.showToast({
title: '你点击了,第'+index+'', title: '你点击了,第' + index + '',
icon: 'none' icon: 'none'
}); });
} }
...@@ -174,7 +168,7 @@ ...@@ -174,7 +168,7 @@
.userInfo { .userInfo {
width: 750rpx; width: 750rpx;
padding: 20rpx; padding: 20rpx;
padding-top:50px; padding-top: 50px;
background-color: #2F85FC; background-color: #2F85FC;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
...@@ -232,11 +226,12 @@ ...@@ -232,11 +226,12 @@
background-color: #007AFF; background-color: #007AFF;
height: 40rpx; height: 40rpx;
} }
.grid{ .grid {
background-color: #FFFFFF; background-color: #FFFFFF;
margin:25rpx 0; margin: 25rpx 0;
} }
.uni-grid .text { .uni-grid .text {
font-size: 26rpx; font-size: 26rpx;
color: #817f82; color: #817f82;
...@@ -246,36 +241,38 @@ ...@@ -246,36 +241,38 @@
justify-content: center; justify-content: center;
align-items: center; align-items: center;
} }
/*修改边线粗细示例*/
/* #ifndef APP-NVUE */ /*修改边线粗细示例*/
/* #ifndef APP-NVUE */
.center-list /deep/ .uni-list--border:after, .center-list /deep/ .uni-list--border:after,
.center-list /deep/ .uni-list--border-top , .center-list /deep/ .uni-list--border-top,
.center-list /deep/ .uni-list--border-bottom{ .center-list /deep/ .uni-list--border-bottom {
-webkit-transform: scaleY(0.2); -webkit-transform: scaleY(0.2);
transform: scaleY(0.2); transform: scaleY(0.2);
} }
/* #endif */
.item-footer{ /* #endif */
flex-direction: row; .item-footer {
align-items: center; flex-direction: row;
} align-items: center;
.item-footer-text{ }
color: #999;
font-size: 24rpx; .item-footer-text {
padding-right: 10rpx; color: #999;
} font-size: 24rpx;
.item-footer-badge{ padding-right: 10rpx;
width: 20rpx; }
height: 20rpx;
/* #ifndef APP-NVUE */ .item-footer-badge {
border-radius: 50%; width: 20rpx;
/* #endif */ height: 20rpx;
/* #ifdef APP-NVUE */ /* #ifndef APP-NVUE */
border-radius: 10rpx; border-radius: 50%;
/* #endif */ /* #endif */
background-color: #DD524D; /* #ifdef APP-NVUE */
} border-radius: 10rpx;
/* #endif */
</style> background-color: #DD524D;
}
</style>
...@@ -157,5 +157,25 @@ ...@@ -157,5 +157,25 @@
} }
} }
} }
},
"opendb-app-versions":{
"data":[
{
"is_silently": false,
"is_mandatory": false,
"appid": "__UNI__03B096E",
"name": "base-app",
"title": "新增升级中心",
"contents": "新增升级中心",
"platform": [
"Android"
],
"version": "1.0.1",
"url": "https://vkceyugu.cdn.bspapp.com/VKCEYUGU-3469aac7-a663-4c5d-8ee8-94275f8c09ab/3128d010-01c5-4121-a1d6-f3f919944a23.apk",
"stable_publish": false,
"type": "native_app",
"create_date": 1616771628150
}
]
} }
} }
...@@ -41,10 +41,12 @@ page { ...@@ -41,10 +41,12 @@ page {
padding-top: 50rpx; padding-top: 50rpx;
} }
/* #ifndef APP-NVUE */
.hidden, .hidden,
page { page {
background-color: transparent; background-color: transparent;
} }
/* #endif */
.login-iknow { .login-iknow {
padding-top: 24rpx; padding-top: 24rpx;
......
...@@ -4,12 +4,12 @@ import { ...@@ -4,12 +4,12 @@ import {
mapMutations mapMutations
} from 'vuex'; } from 'vuex';
let mixin = { let mixin = {
// 监听帮助按钮 // // 监听帮助按钮
onNavigationBarButtonTap(event) { // onNavigationBarButtonTap(event) {
uni.navigateTo({ // uni.navigateTo({
url:helpPage // url:helpPage
}) // })
}, // },
data(){ data(){
return { return {
// 用户协议页面跳转 // 用户协议页面跳转
......
...@@ -96,7 +96,7 @@ ...@@ -96,7 +96,7 @@
let oauthService = this.oauthServices.find((service) => service.id == type) let oauthService = this.oauthServices.find((service) => service.id == type)
// #ifdef APP-PLUS // #ifdef APP-PLUS
//uni.showLoading({mask: true}); //uni.showLoading({mask: true});
console.log(type,231); console.log(type);
//请勿直接使用前端获取的unionid或openid直接用于登陆,前端的数据都是不可靠的 //请勿直接使用前端获取的unionid或openid直接用于登陆,前端的数据都是不可靠的
if(type=='weixin'){ if(type=='weixin'){
oauthService.authorize(({code})=>{ oauthService.authorize(({code})=>{
...@@ -104,6 +104,7 @@ ...@@ -104,6 +104,7 @@
this.quickLogin({code},type) this.quickLogin({code},type)
}, },
err=>{ err=>{
uni.hideLoading()
console.log(err); console.log(err);
}) })
} }
...@@ -122,11 +123,24 @@ ...@@ -122,11 +123,24 @@
fail: (err) => { fail: (err) => {
uni.hideLoading() uni.hideLoading()
console.log(err); console.log(err);
if(err.errCode===30002){ switch (err.errCode){
console.log('在一键登陆界面,点击其他登陆方式'); case 30002:
} console.log('在一键登陆界面,点击其他登陆方式');
if(err.errCode===30003){ break;
uni.navigateBack() case 30003:
console.log('关闭了登陆');
uni.navigateBack()
break;
case 30006:
uni.showModal({
title: "登陆服务初始化错误",
content:err.metadata.error_data,
showCancel: false,
confirmText: '知道了',
});
break;
default:
break;
} }
} }
}) })
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册