|
|
@ -71,6 +71,40 @@ |
|
|
}, |
|
|
}, |
|
|
onLaunch: function() { |
|
|
onLaunch: function() { |
|
|
let context = this; |
|
|
let context = this; |
|
|
|
|
|
//这里是热更新的代码 |
|
|
|
|
|
// #ifdef APP-PLUS |
|
|
|
|
|
plus.runtime.getProperty(plus.runtime.appid, function(widgetInfo) { |
|
|
|
|
|
console.log(widgetInfo.version) |
|
|
|
|
|
console.log(widgetInfo.name) |
|
|
|
|
|
// uni.request({ |
|
|
|
|
|
// url: '', |
|
|
|
|
|
// data: { |
|
|
|
|
|
// version: widgetInfo.version, |
|
|
|
|
|
// name: widgetInfo.name |
|
|
|
|
|
// }, |
|
|
|
|
|
// success: (result) => { |
|
|
|
|
|
// var data = result.data; |
|
|
|
|
|
// if (data.update && data.wgtUrl) { |
|
|
|
|
|
// uni.downloadFile({ |
|
|
|
|
|
// url: data.wgtUrl, |
|
|
|
|
|
// success: (downloadResult) => { |
|
|
|
|
|
// if (downloadResult.statusCode === 200) { |
|
|
|
|
|
// plus.runtime.install(downloadResult.tempFilePath, { |
|
|
|
|
|
// force: false |
|
|
|
|
|
// }, function() { |
|
|
|
|
|
// console.log('install success...'); |
|
|
|
|
|
// plus.runtime.restart(); |
|
|
|
|
|
// }, function(e) { |
|
|
|
|
|
// console.error('install fail...'); |
|
|
|
|
|
// }); |
|
|
|
|
|
// } |
|
|
|
|
|
// } |
|
|
|
|
|
// }); |
|
|
|
|
|
// } |
|
|
|
|
|
// } |
|
|
|
|
|
// }); |
|
|
|
|
|
}); |
|
|
|
|
|
// #endif |
|
|
this.globalData._i18n = this.$i18n //这是原型链上的$i18n |
|
|
this.globalData._i18n = this.$i18n //这是原型链上的$i18n |
|
|
this.globalData.$t = function(str) { |
|
|
this.globalData.$t = function(str) { |
|
|
let $i18n = context.globalData.$i18n //这里去拿global的i18n |
|
|
let $i18n = context.globalData.$i18n //这里去拿global的i18n |
|
|
|