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

123

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