|
|
@ -43,12 +43,61 @@ |
|
|
|
this.$db.set('areaGoodsList', list) |
|
|
|
}, |
|
|
|
async sysInfoMethod() { |
|
|
|
console.log('sysInfo11111111>>>>>') |
|
|
|
let params = {}; |
|
|
|
let list = await Api.apiCall('get', Api.index.sysInfo, params); |
|
|
|
console.log('sysInfo>>>>>', sysInfo) |
|
|
|
console.log('sysInfo222222222>>>>>', sysInfo) |
|
|
|
this.$db.set('sysInfo', list) |
|
|
|
}, |
|
|
|
|
|
|
|
// 获取CID |
|
|
|
getCid() { |
|
|
|
// #ifdef APP-PLUS |
|
|
|
var t1_time = 0; |
|
|
|
var t1 = setInterval(function() { |
|
|
|
var cid = plus.push.getClientInfo().clientid; |
|
|
|
console.log(cid != undefined, cid != "undefined", cid) |
|
|
|
console.log("cid>>>>>>>>>>", cid) |
|
|
|
if (cid != null || cid != "null") { |
|
|
|
uni.setStorageSync('cid', cid); |
|
|
|
clearInterval(t1); |
|
|
|
return |
|
|
|
} |
|
|
|
}, 130); |
|
|
|
// #endif |
|
|
|
}, |
|
|
|
// 监听通知信息 |
|
|
|
handlePush() { |
|
|
|
// #ifdef APP-PLUS |
|
|
|
const _handlePush = function(message) { |
|
|
|
|
|
|
|
console.log("message>>>>>>>>>>", message) |
|
|
|
uni.setStorageSync('message', message); |
|
|
|
获取自定义信息 |
|
|
|
let payload = message.payload; |
|
|
|
|
|
|
|
// uni.switchTab({ |
|
|
|
// url: `${payload.path}` |
|
|
|
// }) |
|
|
|
|
|
|
|
// uni.navigateTo({ |
|
|
|
// url: '/pages/index/messageDetail', |
|
|
|
// // 版本2.8.9+ 支持 |
|
|
|
// success: (res) => { |
|
|
|
// // 和上面其实没差什么,但是这种方式是可以的 这里不是$emit |
|
|
|
// res.eventChannel.emit('sendTestValue', { |
|
|
|
// info: item |
|
|
|
// }) |
|
|
|
// } |
|
|
|
// }); |
|
|
|
|
|
|
|
} |
|
|
|
// 事件处理 |
|
|
|
plus.push.addEventListener('click', _handlePush) |
|
|
|
plus.push.addEventListener('receive', _handlePush) |
|
|
|
// #endif |
|
|
|
}, |
|
|
|
|
|
|
|
}, |
|
|
|
onLaunch: function() { |
|
|
|
// uni.removeStorageSync('userInfo'); |
|
|
@ -56,8 +105,8 @@ |
|
|
|
console.log('App onLaunch') |
|
|
|
let userInfo = uni.getStorageSync('userInfo') || ''; |
|
|
|
let token = uni.getStorageSync('token') || ''; |
|
|
|
console.log('App onLaunch>>>',userInfo) |
|
|
|
console.log('App onLaunch>>>',token) |
|
|
|
console.log('App onLaunch>>>', userInfo) |
|
|
|
console.log('App onLaunch>>>', token) |
|
|
|
if (token) { |
|
|
|
//更新登陆状态 |
|
|
|
uni.getStorage({ |
|
|
@ -83,6 +132,44 @@ |
|
|
|
// icon: "none" |
|
|
|
// }); |
|
|
|
// #endif |
|
|
|
|
|
|
|
this.handlePush(); |
|
|
|
this.getCid(); |
|
|
|
console.log('App onLaunch111111111111>>>', token) |
|
|
|
// let sss = { |
|
|
|
// "url": "http://mall.yyundong.com/portalapi/api/appVersion/versioninfo", |
|
|
|
// "resolve": { |
|
|
|
// "data": { |
|
|
|
// "code": 200, |
|
|
|
// "data": "{\"id\":null,\"appName\":null,\"versionCode\":1010,\"versionName\":\"1.0.1.0\",\"downloadUrl\":\"http://mall.yyundong.com/apks/mall-1010.apk\",\"versionInfo\":\"BUG修复。\",\"isAlpha\":null,\"fileName\":\"mall-1010.apk\",\"forceUpdate\":false}" |
|
|
|
// }, |
|
|
|
// "statusCode": 200, |
|
|
|
// "header": { |
|
|
|
// "X-XSS-Protection": "1; mode=block", |
|
|
|
// "Connection": "keep-alive", |
|
|
|
// "Content-Length": "268", |
|
|
|
// "X-Content-Type-Options": "nosniff", |
|
|
|
// "Cache-Control": "no-cache, no-store, max-age=0, must-revalidate", |
|
|
|
// "Date": "Thu, 16 Mar 2023 05:48:35 GMT", |
|
|
|
// "Expires": "0", |
|
|
|
// "X-Frame-Options": "DENY", |
|
|
|
// "Content-Type": "application/json;charset=UTF-8", |
|
|
|
// "Server": "nginx/1.20.2", |
|
|
|
// "Pragma": "no-cache" |
|
|
|
// }, |
|
|
|
// "errMsg": "request:ok", |
|
|
|
// "cookies": [] |
|
|
|
// }, |
|
|
|
// "header": { |
|
|
|
// "Content-Type": "application/json;charset=UTF-8" |
|
|
|
// }, |
|
|
|
// "data": { |
|
|
|
// "version": "1010", |
|
|
|
// "type": 1101 |
|
|
|
// }, |
|
|
|
// "method": "GET" |
|
|
|
// } |
|
|
|
// uni.setStorageSync('message', sss); |
|
|
|
}, |
|
|
|
onShow: function() { |
|
|
|
console.log('App Show') |
|
|
|