Commit 6549c41b authored by ly's avatar ly

更新

parent f1c3a12a
......@@ -26,8 +26,8 @@
<view v-if="updateButtonBoolean" class="update-button">
<button class="not-updated-button" :disabled="noUpdatedDisabled"
v-show="appUpgeadeObj.forceUpdate == false" type="warn" @tap.stop="noUpdate">暂不更新</button>
<button v-show='appUpgeadeObj.type == "ANDROID" || appUpgeadeObj.type == "WGT"' class="updated-button" type="warn" @tap.stop="upgradeNowAndroid">立即升级</button>
<button v-show='appUpgeadeObj.type == "IOS" || appUpgeadeObj.type == "WGT"' class="updated-button" type="warn" @tap.stop="upgradeNow">立即升级</button>
<button v-show='appUpgeadeObj.type == "ANDROID"' class="updated-button" type="warn" @tap.stop="upgradeNowAndroid">立即升级</button>
<button v-show='appUpgeadeObj.type == "IOS" ' class="updated-button" type="warn" @tap.stop="upgradeNow">立即升级</button>
</view>
<!-- v-if="progressBolean" -->
<!-- {{progressBolean}} -->
......@@ -103,7 +103,9 @@
that.noUpdatedDisabled = true
let platform = uni.getSystemInfoSync().platform
that.isWGT=that.appUpgeadeObj.type == 'wgt'
const wgtType=that.containsWGTExtension(that.appUpgeadeObj.downloadUrl)
that.isWGT=wgtType
const index = that.appUpgeadeObj.downloadUrl.indexOf('apps.apple.com')
console.log(that.isWGT,'that.isWGT3333')
if(that.isWGT==true){
......@@ -117,11 +119,10 @@
let that = this
that.noUpdatedDisabled = true
let platform = uni.getSystemInfoSync().platform
const index = that.containsApkExtension(this.appUpgeadeObj.downloadUrl)
that.isWGT=that.appUpgeadeObj.type == 'wgt'
if(that.isWGT==true){
that.updateWgt(that.appUpgeadeObj.downloadUrl,that.appUpgeadeObj.downloadUrl.versionName)
}else{
const index = that.containsApkExtension(that.appUpgeadeObj.downloadUrl)
const wgtType=that.containsWGTExtension(that.appUpgeadeObj.downloadUrl)
console.log(wgtType,'that.isWGT')
that.isWGT= wgtType
if(index==true){
plus.runtime.getProperty(plus.runtime.appid, (wgtinfo) => {
var downloadTask = uni.downloadFile({
......@@ -156,7 +157,7 @@
let appurl = "market://details?id=io.dcloud.ddh"
plus.runtime.openURL(appurl)
}
}
// }
},
......@@ -216,6 +217,9 @@
},
containsApkExtension(url) {
return /\.apk$/i.test(url);
},
containsWGTExtension(url) {
return /\.wgt$/i.test(url);
}
}
};
......
......@@ -44,7 +44,7 @@ let env = process.env.VUE_APP_BASE_NODE_ENV
*/
// #ifdef APP-PLUS
env = "development";
env = "prod";
// #endif
const api = {
......
......@@ -2,8 +2,8 @@
"name" : "多典花",
"appid" : "__UNI__DE04B13",
"description" : "",
"versionName" : "1.0.1",
"versionCode" : 101,
"versionName" : "1.0.2",
"versionCode" : 102,
"transformPx" : false,
/* 5+App特有相关 */
"app-plus" : {
......
......@@ -96,7 +96,7 @@ export default {
const common = uni.getStorageSync("m-header-device")
//这里是获取位置信息
if(!common && token){
console.log(kkkkk)
loadDevice()
loadNetwork()
loadUuid()
......
......@@ -145,6 +145,7 @@
const self=this
self.$request('/pawn/setting/other/switch/loan','GET').then(res => {
const {data}=res.result
console.log(data,'yyydata')
if (res.code == 200 && data == true) {
try {
console.log(data,'显示')
......@@ -180,10 +181,27 @@
if (res.success==true) {
const response = res.result.data;
console.log(appVersion,'appVersion')
if(appVersion<response.versionName){
const wgtType=self.containsWGTExtension(response.downloadUrl)
if(wgtType==true){
let checkStatus=uni.getStorageSync('checkVersions')
console.log(wgtType,'要热更新')
if(checkStatus==response.versionName){
console.log('热更新过了')
return false
}else{
console.log('热更新了')
self.updateWgt(response.downloadUrl,response.versionName)
}
}else{
console.log('强更了')
self.appUpgeadeObj=response
}
}
console.log(response,'response')
}
......@@ -335,6 +353,63 @@
this.pageNum=this.pageNum+1
this.searchGood();
},
//wgt更新
updateWgt(downloadUrl,newVersion){
uni.showModal({
title: '已发现新版本',
content: '确认更新?',
showCancel: false,
success:function(res){
uni.setStorageSync('checkVersions',newVersion)
if(res.confirm){
uni.downloadFile({
url: downloadUrl,
success: (downloadResult) => {
plus.runtime.install(downloadResult.tempFilePath,{force: true},function(){
//应用热重启,重新启动进入首页
plus.runtime.restart();
uni.showModal({
title: '安装成功!',
content: '已重新进入应用',
showCancel: false,
success:function(res){
if(res.confirm){
console.log('用户点击确定');
}else if(res.cancel){
console.log('用户点击确定');
}
}
})
},
function(e){
console.log(e,'安装失败')
uni.showModal({
title: '安装失败',
icon: 'none'
})
})
},
fail: (err) => {
uni.showToast({
title: '下载失败',
icon: 'none'
})
}
})
}else if(res.cancel){
uni.showToast({
title: '已取消',
icon: 'none'
})
}
}
})
},
containsWGTExtension(url) {
return /\.wgt$/i.test(url);
}
},
onShow() {
const token=uni.getStorageSync('token')
......
......@@ -129,7 +129,7 @@
self.$request('/app/v1/userIndex','GET').then(res => {
console.log(res,'userIndex');
const { menuBar ,user,baseMenuBar,extMenuBarList}=res.result
self.menuBar=menuBar
// self.menuBar=menuBar
self.menuList=baseMenuBar
self.extMenuBarList=extMenuBarList
if(user.cell){
......
iosProfile=/Users/jinzhouhang/work/zhanhai/uni-ddh-app/profile/uni_ddh_test.mobileprovision
ioscertFile=/Users/jinzhouhang/work/zhanhai/uni-ddh-app/profile/ddh-test.p12
iosProfile=/Users/jinzhouhang/work/zhanhai/uni-ddh-app/profile/uni_ddh_prod.mobileprovision
ioscertFile=/Users/jinzhouhang/work/zhanhai/uni-ddh-app/profile/ddh-prod.p12
ioscertPassword=ep/Tdjka4Y7WYqDB6/S7dw==
......@@ -2,7 +2,7 @@
var isReady=false;var onReadyCallbacks=[];
var isServiceReady=false;var onServiceReadyCallbacks=[];
var __uniConfig = {"pages":["pages/index/index","pages/sort/index","pages/my/index","pages/recruit/index","pages/recruitResult/index","pages/category/category","pages/application/application","pages/myneed/myneed","pages/Ineed/Ineed","pages/productDetails/productDetails","pages/detailResult/detailResult","pages/useFeed/useFeed","pages/lookGoods/lookGoods","pages/login/login","pages/prolist/prolist","pages/setting/setting","pages/contact/contact","pages/webview/webview","pages/web/web","pages/bill/indexs","pages/finance/index","pages/app-update/index","pages/agreement/index"],"window":{"navigationBarTextStyle":"black","navigationBarTitleText":"uni-app","navigationBarBackgroundColor":"#FFFFFF","backgroundColor":"#F8F8F8","bounce":"none"},"tabBar":{"borderStyle":"white","color":"#BBBBBB","selectedColor":"#2263E6","iconWidth":"24px","height":"52px","fontSize":"12px","list":[{"pagePath":"pages/index/index","iconPath":"/static/tab/indexfh.png","selectedIconPath":"/static/tab/indexf.png","text":"首页"},{"pagePath":"pages/finance/index","iconPath":"/static/tab/index-h.png","selectedIconPath":"/static/tab/index.png","text":"贷款"},{"pagePath":"pages/bill/indexs","iconPath":"/static/tab/billh.png","selectedIconPath":"/static/tab/bill.png","text":"账单"},{"pagePath":"pages/my/index","iconPath":"/static/tab/my-h.png","selectedIconPath":"/static/tab/my.png","text":"我的"}]},"darkmode":false,"nvueCompiler":"uni-app","nvueStyleCompiler":"uni-app","renderer":"auto","splashscreen":{"alwaysShowBeforeRender":true,"autoclose":false},"appname":"多典花","compilerVersion":"4.24","entryPagePath":"pages/index/index","networkTimeout":{"request":60000,"connectSocket":60000,"uploadFile":60000,"downloadFile":60000}};
var __uniRoutes = [{"path":"/pages/index/index","meta":{"isQuit":true,"isTabBar":true},"window":{"enablePullDownRefresh":false,"navigationStyle":"custom","bounce":"none"}},{"path":"/pages/sort/index","meta":{},"window":{"navigationBarTitleText":"款式"}},{"path":"/pages/my/index","meta":{"isQuit":true,"isTabBar":true},"window":{"enablePullDownRefresh":true,"navigationStyle":"custom"}},{"path":"/pages/recruit/index","meta":{},"window":{"enablePullDownRefresh":false,"navigationBarTitleText":"鉴定师招聘"}},{"path":"/pages/recruitResult/index","meta":{},"window":{"enablePullDownRefresh":false,"navigationStyle":"custom"}},{"path":"/pages/category/category","meta":{},"window":{"enablePullDownRefresh":false,"navigationBarTitleText":"选择鉴定品类"}},{"path":"/pages/application/application","meta":{},"window":{"enablePullDownRefresh":false,"navigationBarTitleText":"我的鉴定申请"}},{"path":"/pages/myneed/myneed","meta":{},"window":{"enablePullDownRefresh":false,"navigationBarTitleText":"我需要的"}},{"path":"/pages/Ineed/Ineed","meta":{},"window":{"enablePullDownRefresh":false,"navigationBarTitleText":"我需要"}},{"path":"/pages/productDetails/productDetails","meta":{},"window":{"enablePullDownRefresh":false,"navigationBarTitleText":"商品详情"}},{"path":"/pages/detailResult/detailResult","meta":{},"window":{"enablePullDownRefresh":false,"navigationStyle":"custom"}},{"path":"/pages/useFeed/useFeed","meta":{},"window":{"enablePullDownRefresh":false,"navigationBarTitleText":"用户反馈"}},{"path":"/pages/lookGoods/lookGoods","meta":{},"window":{"enablePullDownRefresh":false,"navigationBarTitleText":""}},{"path":"/pages/login/login","meta":{},"window":{"enablePullDownRefresh":false,"navigationBarTitleText":"登录"}},{"path":"/pages/prolist/prolist","meta":{},"window":{"navigationBarTitleText":"相关协议"}},{"path":"/pages/setting/setting","meta":{},"window":{"enablePullDownRefresh":false,"navigationBarTitleText":"设置"}},{"path":"/pages/contact/contact","meta":{},"window":{"navigationBarTitleText":"通讯录","enablePullDownRefresh":false}},{"path":"/pages/webview/webview","meta":{},"window":{"enablePullDownRefresh":false,"navigationBarTitleText":""}},{"path":"/pages/web/web","meta":{},"window":{"enablePullDownRefresh":false,"navigationBarTitleText":""}},{"path":"/pages/bill/indexs","meta":{"isQuit":true,"isTabBar":true},"window":{"navigationBarTitleText":"账单"}},{"path":"/pages/finance/index","meta":{"isQuit":true,"isTabBar":true},"window":{"enablePullDownRefresh":true,"navigationStyle":"custom"}},{"path":"/pages/app-update/index","meta":{},"window":{"disableScroll":true,"backgroundColorTop":"transparent","background":"transparent","titleNView":false,"scrollIndicator":false,"animationType":"fade-in","animationDuration":200,"disableSwipeBack":true}},{"path":"/pages/agreement/index","meta":{},"window":{"navigationStyle":"custom","navigationBarTitleText":"","enablePullDownRefresh":false,"bounce":"none","animationType":"fade-in","background":"transparent","backgroundColor":"rgba(0,0,0,0)","webviewBGTransparent":true,"mask":"none"}}];
var __uniRoutes = [{"path":"/pages/index/index","meta":{"isQuit":true,"isTabBar":true},"window":{"enablePullDownRefresh":false,"navigationStyle":"custom","bounce":"none"}},{"path":"/pages/sort/index","meta":{},"window":{"navigationBarTitleText":"款式"}},{"path":"/pages/my/index","meta":{"isQuit":true,"isTabBar":true},"window":{"enablePullDownRefresh":true,"navigationStyle":"custom"}},{"path":"/pages/recruit/index","meta":{},"window":{"enablePullDownRefresh":false,"navigationBarTitleText":"鉴定师招聘"}},{"path":"/pages/recruitResult/index","meta":{},"window":{"enablePullDownRefresh":false,"navigationStyle":"custom"}},{"path":"/pages/category/category","meta":{},"window":{"enablePullDownRefresh":false,"navigationBarTitleText":"选择鉴定品类"}},{"path":"/pages/application/application","meta":{},"window":{"enablePullDownRefresh":false,"navigationBarTitleText":"我的鉴定申请"}},{"path":"/pages/myneed/myneed","meta":{},"window":{"enablePullDownRefresh":false,"navigationBarTitleText":"我需要的"}},{"path":"/pages/Ineed/Ineed","meta":{},"window":{"enablePullDownRefresh":false,"navigationBarTitleText":"我需要"}},{"path":"/pages/productDetails/productDetails","meta":{},"window":{"enablePullDownRefresh":false,"navigationBarTitleText":"商品详情"}},{"path":"/pages/detailResult/detailResult","meta":{},"window":{"enablePullDownRefresh":false,"navigationStyle":"custom"}},{"path":"/pages/useFeed/useFeed","meta":{},"window":{"enablePullDownRefresh":false,"navigationBarTitleText":"用户反馈"}},{"path":"/pages/lookGoods/lookGoods","meta":{},"window":{"enablePullDownRefresh":false,"navigationBarTitleText":""}},{"path":"/pages/login/login","meta":{},"window":{"enablePullDownRefresh":false,"navigationBarTitleText":"登录"}},{"path":"/pages/prolist/prolist","meta":{},"window":{"navigationBarTitleText":"相关协议"}},{"path":"/pages/setting/setting","meta":{},"window":{"enablePullDownRefresh":false,"navigationBarTitleText":"设置"}},{"path":"/pages/contact/contact","meta":{},"window":{"navigationBarTitleText":"通讯录","enablePullDownRefresh":false}},{"path":"/pages/webview/webview","meta":{},"window":{"enablePullDownRefresh":false,"navigationBarTitleText":""}},{"path":"/pages/web/web","meta":{},"window":{"enablePullDownRefresh":false,"navigationBarTitleText":""}},{"path":"/pages/bill/indexs","meta":{"isQuit":true,"isTabBar":true},"window":{"navigationBarTitleText":"账单"}},{"path":"/pages/finance/index","meta":{"isQuit":true,"isTabBar":true},"window":{"enablePullDownRefresh":true,"navigationStyle":"custom"}},{"path":"/pages/app-update/index","meta":{},"window":{"navigationStyle":"custom","navigationBarTitleText":"","enablePullDownRefresh":false,"bounce":"none","animationType":"fade-in","background":"transparent","backgroundColor":"rgba(0,0,0,0)","webviewBGTransparent":true,"mask":"none"}},{"path":"/pages/agreement/index","meta":{},"window":{"navigationStyle":"custom","navigationBarTitleText":"","enablePullDownRefresh":false,"bounce":"none","animationType":"fade-in","background":"transparent","backgroundColor":"rgba(0,0,0,0)","webviewBGTransparent":true,"mask":"none"}}];
__uniConfig.onReady=function(callback){if(__uniConfig.ready){callback()}else{onReadyCallbacks.push(callback)}};Object.defineProperty(__uniConfig,"ready",{get:function(){return isReady},set:function(val){isReady=val;if(!isReady){return}const callbacks=onReadyCallbacks.slice(0);onReadyCallbacks.length=0;callbacks.forEach(function(callback){callback()})}});
__uniConfig.onServiceReady=function(callback){if(__uniConfig.serviceReady){callback()}else{onServiceReadyCallbacks.push(callback)}};Object.defineProperty(__uniConfig,"serviceReady",{get:function(){return isServiceReady},set:function(val){isServiceReady=val;if(!isServiceReady){return}const callbacks=onServiceReadyCallbacks.slice(0);onServiceReadyCallbacks.length=0;callbacks.forEach(function(callback){callback()})}});
service.register("uni-app-config",{create(a,b,c){if(!__uniConfig.viewport){var d=b.weex.config.env.scale,e=b.weex.config.env.deviceWidth,f=Math.ceil(e/d);Object.assign(__uniConfig,{viewport:f,defaultFontSize:Math.round(f/20)})}return{instance:{__uniConfig:__uniConfig,__uniRoutes:__uniRoutes,global:void 0,window:void 0,document:void 0,frames:void 0,self:void 0,location:void 0,navigator:void 0,localStorage:void 0,history:void 0,Caches:void 0,screen:void 0,alert:void 0,confirm:void 0,prompt:void 0,fetch:void 0,XMLHttpRequest:void 0,WebSocket:void 0,webkit:void 0,print:void 0}}}});
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
......@@ -22,6 +22,7 @@ const request = async (url, type, data) => {
}
}
console.log(baseUrl,'日===')
return new Promise((resolve, reject) => {
const token = uni.getStorageSync('token')
const tokenFinance = uni.getStorageSync('tokenFinance')
......@@ -39,7 +40,7 @@ const request = async (url, type, data) => {
Author: token, //多典花
},
success: (res) => {
// console.log(res,'333')
const {
data,
statusCode
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment