提交 78b3b094 编写于 作者: L linju

123

上级 b1246c71
module.exports = {
"h5":{
"url":"https://static-76ce2c5e-31c7-4d81-8fcf-ed1541ecbc6e.bspapp.com"
"url":"https://static-76ce2c5e-31c7-4d81-8fcf-ed1541ecbc6e.bspapp.com" // 前端网页托管的域名
},
"mp":{
"weixin":{
......@@ -13,7 +13,7 @@ module.exports = {
"/pages/ucenter/settings/settings",
"/uni_modules/uni-login-page/pages/index/pwd-retrieve"
],
"login":["univerify","password","weixin","apple","code"]
"login":["univerify","smsCode","username","weixin","apple"] //默认就是短信验证码登陆
},
"about":{
"appName":"base-app",
......
......@@ -48,12 +48,12 @@ export default function() {
}
//控制登陆优先级
if(url=='/uni_modules/uni-login-page/pages/index/index'){
//一键登录(univerify)、密码登陆(password)、快捷登录&验证码登陆(!univerify&password)
//一键登录(univerify)、密码登陆(username)、快捷登录&验证码登陆(!univerify&password)
if(login[0]=='univerify'){
// console.log(e.url,url);
if(e.url==url){ e.url+= '?' }
e.url += "univerify_first=true"
}else if(login[0]=='password'){
}else if(login[0]=='username'){
e.url = "/uni_modules/uni-login-page/pages/pwd-login/pwd-login"
}else{
//默认即是
......@@ -120,11 +120,11 @@ function initAppVersion() {
}).appVersion = {
...currentVersion,
appid,
hasNew:true
hasNew:false
}
// 检查更新小红点
callCheckVersion()
.then(res=>{
callCheckVersion().then(res=>{
console.log('检查是否有可以更新的版本',res);
if(res.result.code>0){
// 有新版本
getApp({
......
......@@ -3,7 +3,7 @@
<view class="userInfo" @click="toSettings">
<image class="logo-img" :src="login ? (userInfo.avatar || avatarUrl) :avatarUrl"></image>
<view class="logo-title">
<text class="uer-name">{{login ? userInfo.username||userInfo.mobile : '未登录'}}</text>
<text class="uer-name">{{login ? userInfo.nickname||userInfo.username||userInfo.mobile : '未登录'}}</text>
<text class="go-login-navigat-arrow navigat-arrow" v-if="!login">&#xe65e;</text>
</view>
</view>
......@@ -30,7 +30,8 @@
mapGetters,
mapMutations
} from 'vuex';
import checkUpdate from '@/uni_modules/uni-upgrade-center-app/utils/check-update';
import checkUpdate from '@/uni_modules/uni-upgrade-center-app/utils/check-update';
import callCheckVersion from '@/uni_modules/uni-upgrade-center-app/utils/call-check-version';
export default {
data() {
return {
......@@ -57,53 +58,56 @@
}
],
ucenterList: [
[
// #ifdef APP-PLUS
{
title: '去评分',
event: 'gotoMarket'
},
// #endif
{
title: '阅读过的文章',
to: ''
}, {
title: '我的积分',
to: ''
}],
[{
title: '阅读过的文章',
to: ''
title: '问题与反馈',
to: '/uni_modules/uni-feedback/pages/opendb-feedback/list' // /pages/ucenter/uni-feedback/uni-feedback uni_modules/uni-feedback/pages/opendb-feedback/list
}, {
title: '我的积分',
to: ''
}],
[
//#ifdef APP-PLUS
{
title: '检查更新',
rightText: `V${getApp().appVersion.version}_${getApp().appVersion.versionCode}`,
event: 'checkVersion',
showBadge: true
},
{
title:'去评分',
event:'gotoMarket'
},
//#endif
{
title: '问题与反馈',
to: '/uni_modules/uni-feedback/pages/opendb-feedback/list' // /pages/ucenter/uni-feedback/uni-feedback uni_modules/uni-feedback/pages/opendb-feedback/list
},{
title: '关于',
to: '/pages/ucenter/about/about'
}
]
title: '关于',
to: '/pages/ucenter/about/about'
}]
]
}
},
onLoad() {
this.ucenterList[this.ucenterList.length - 1].unshift(
{
title: '检查更新',
rightText: this.appVersion.version+'-'+this.appVersion.versionCode,
event: 'checkVersion',
showBadge: this.appVersion.hasNew
}
)
},
computed: {
...mapGetters({
userInfo: 'user/info',
login: 'user/hasLogin'
})
},
onReady() {
}),
appVersion() {
return getApp().appVersion
}
},
methods: {
...mapMutations({
logout: 'user/logout'
}),
toSettings(){
toSettings() {
uni.navigateTo({
url:"/pages/ucenter/settings/settings"
url: "/pages/ucenter/settings/settings"
})
},
/**
......@@ -114,8 +118,9 @@
this[item.event]();
}
},
checkVersion() {
checkUpdate();
async checkVersion() {
console.log(await callCheckVersion());
checkUpdate()
},
goLogin() {
if (!this.login) {
......@@ -132,27 +137,27 @@
},
tapGrid(index) {
uni.showToast({
title: '你点击了,第' + (index+1) + '',
title: '你点击了,第' + (index + 1) + '',
icon: 'none'
});
},
/**
* 去应用市场评分
*/
gotoMarket(){
gotoMarket() {
// #ifdef APP-PLUS
if (uni.getSystemInfoSync().platform == "ios") {
// 这里填写appstore应用id
let appstoreid = 'id1417078253';
plus.runtime.openURL("itms-apps://" + 'itunes.apple.com/cn/app/wechat/'+appstoreid+'?mt=8');
plus.runtime.openURL("itms-apps://" + 'itunes.apple.com/cn/app/wechat/' + appstoreid + '?mt=8');
}
if (uni.getSystemInfoSync().platform == "android") {
var Uri = plus.android.importClass("android.net.Uri");
var uri = Uri.parse("market://details?id=" + plus.runtime.appid );
var Intent = plus.android.importClass('android.content.Intent');
var intent = new Intent(Intent.ACTION_VIEW, uri);
var main = plus.android.runtimeMainActivity();
main.startActivity(intent);
var uri = Uri.parse("market://details?id=" + plus.runtime.appid);
var Intent = plus.android.importClass('android.content.Intent');
var intent = new Intent(Intent.ACTION_VIEW, uri);
var main = plus.android.runtimeMainActivity();
main.startActivity(intent);
}
// #endif
}
......@@ -299,4 +304,4 @@
/* #endif */
background-color: #DD524D;
}
</style>
</style>
......@@ -5,9 +5,8 @@ const PACKAGE_INFO_KEY = '__package_info__'
export default function() {
return
// #ifdef APP-PLUS
callCheckVersion().then(async (e) => {
callCheckVersion().then(async (e) => {
if (!e.result) return;
const {
code,
......@@ -17,7 +16,7 @@ export default function() {
platform, // 安装包平台
type // 安装包类型
} = e.result;
// 此处逻辑仅为实例,可自行编写
if (code > 0) {
// 腾讯云和阿里云下载链接不同,需要处理一下,阿里云会原样返回
......@@ -65,7 +64,9 @@ export default function() {
} else if (code < 0) {
// TODO 云函数报错处理
console.error(message)
}
}
}).catch(err => {
// TODO 云函数报错处理
console.error(err.message)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册