Commit 42d509b0 authored by ly's avatar ly

多典花强更

parent 43861929
......@@ -12,16 +12,25 @@
this.loadLocation();
this.loadUuid()
}
let versionNumber
plus.runtime.getProperty(plus.runtime.appid, function(wgtinfo){
if(wgtinfo.version){
versionNumber = wgtinfo.version;
}else{
versionNumber = plus.runtime.version;
}
uni.setStorageSync('version',versionNumber)
})
// let versionNumber
// plus.runtime.getProperty(plus.runtime.appid, function(wgtinfo){
// if(wgtinfo.version){
// versionNumber = wgtinfo.version;
// }else{
// versionNumber = plus.runtime.version;
// }
// uni.setStorageSync('version',versionNumber)
// })
// 手机型号
uni.getSystemInfo({
success:function(res) {
// console.log(res,'model')
uni.setStorageSync('modelApp',res.deviceBrand)
uni.setStorageSync('version',res.appVersion)
}
})
// 强制竖屏
plus.screen.lockOrientation("portrait-primary")
......
No preview for this file type
......@@ -6,17 +6,28 @@
:mask-click="false">
<view class="rocket-content">
<view class="rocket-img"></view>
</view>
<view class="title">
发现新版本
</view>
</view>
<view class="content-v-des">
<view class="content-v">v{{ appUpgeadeObj.versionName }}</view>
<view class='content-text'>发现新版本</view>
<view class="title">
<!-- 更新内容 -->
<scroll-view class="info_desc_scroll" scroll-y="true">
<rich-text class='scroll-text' :nodes="appUpgeadeObj.content"></rich-text>
</scroll-view>
</view>
</view>
<view class="update-content">
<text space="nbsp">{{appUpgeadeObj.updateContent}}</text>
</view>
<view v-if="updateButtonBoolean" class="update-button">
<button class="not-updated-button" :disabled="noUpdatedDisabled"
v-if="appUpgeadeObj.forceUpdate == false" type="warn" @tap.stop="noUpdate">暂不更新</button>
<button class="updated-button" type="warn" @tap.stop="upgradeNow">立即升级</button>
v-show="appUpgeadeObj.forceUpdate == false" type="warn" @tap.stop="noUpdate">暂不更新</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}} -->
......@@ -52,8 +63,7 @@
},
progressBolean: false, // 进度条的显示和隐藏
noUpdatedDisabled: false,
// viewTop: null, // 创建原生View控件
// viewBottom: null // 创建原生View控件
isWGT:false,// 是否wgt资源包
};
},
......@@ -88,39 +98,124 @@
this.$emit('pause')
},
// 立即升级事件
upgradeNow() {
this.noUpdatedDisabled = true
let that = this
let platform = uni.getSystemInfoSync().platform
const index = this.appUpgeadeObj.downloadUrl.indexOf('apps.apple.com')
if (platform == 'ios' && index !== -1) return plus.runtime.openURL(this.appUpgeadeObj.downloadUrl);
plus.runtime.getProperty(plus.runtime.appid, (wgtinfo) => {
var downloadTask = uni.downloadFile({
url: that.appUpgeadeObj.downloadUrl,
success: (downloadResult) => {
if (downloadResult.statusCode === 200) {
plus.runtime.install(downloadResult
.tempFilePath, {
force: false
},
function() {
plus.cache.clear();
plus.runtime.restart();
},
function(err) {
console.log('err--------安装升级包失败', err)
uni.showToast({
title: '安装升级包失败',
icon: 'none'
});
});
upgradeNow() {
const that = this
that.noUpdatedDisabled = true
let platform = uni.getSystemInfoSync().platform
that.isWGT=that.appUpgeadeObj.type == 'wgt'
const index = that.appUpgeadeObj.downloadUrl.indexOf('apps.apple.com')
console.log(that.isWGT,'that.isWGT3333')
if(that.isWGT!=true){
that.updateWgt(that.appUpgeadeObj.downloadUrl,that.appUpgeadeObj.downloadUrl.versionName)
}else{
if (platform == 'ios' && index !== -1) return plus.runtime.openURL(that.appUpgeadeObj.downloadUrl);
}
},
upgradeNowAndroid(){
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{
if(index==true){
plus.runtime.getProperty(plus.runtime.appid, (wgtinfo) => {
var downloadTask = uni.downloadFile({
url: that.appUpgeadeObj.downloadUrl,
success: (downloadResult) => {
if (downloadResult.statusCode === 200) {
plus.runtime.install(downloadResult
.tempFilePath, {
force: false
},
function() {
plus.cache.clear();
plus.runtime.restart();
},
function(err) {
console.log('err--------安装升级包失败', err)
uni.showToast({
title: '安装升级包失败',
icon: 'none'
});
});
}
},
});
downloadTask.onProgressUpdate((res) => {
this.progressData.percent = res.progress
});
})
}else{
console.log(333,'indexw')
//跳转到应用商店
let appurl = "market://details?id=io.dcloud.ddh"
plus.runtime.openURL(appurl)
}
}
},
//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'
})
}
}
},
});
downloadTask.onProgressUpdate((res) => {
this.progressData.percent = res.progress
});
})
})
},
containsApkExtension(url) {
return /\.apk$/i.test(url);
}
}
};
......@@ -154,16 +249,46 @@
top: -105rpx;
left: 225rpx;
}
}
.content-v-des{
position: absolute;
left: 40rpx;
top: 30rpx;
z-index: 3;
.content-v{
font-size: 75rpx;
color:#FFFFFF;
}
.content-text{
padding-top: 20rpx;
font-family: PingFangSC, PingFang SC;
font-size: 42rpx;
color:#333333;
}
.title {
margin-top:20rpx;
display: flex;
font-family: PingFangSC, PingFang SC;
font-weight: 400;
font-size: 16px;
color: #999999;
line-height: 28px;
text-align: left;
font-style: normal;
.info_desc_scroll{
width: 450rpx;
height: 200rpx;
box-sizing: border-box;
line-height: 1.3;
.scroll-text{
padding-bottom:6rpx;
}
}
}
}
.title {
display: flex;
justify-content: center;
font-size: 36rpx;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: #282828;
}
.update-content {
margin-top: 44rpx;
......
......@@ -226,42 +226,6 @@ export default {
uni.removeStorageSync('userLastRefuseTime');
}
}
// const checkVersion=uni.getStorageSync('appVersion-info')
// if (!checkVersion.is_silently) {
// // 读取下载好的包的缓存
// const appDownLoadTempFilePath = uni.getStorageSync('appDownLoadTempFilePath');
// // 更新的版本号
// this.version = checkVersion.versionName;
// // 系统环境
// this.platform = checkVersion.platform;
// // 网络下载地址
// this.url = checkVersion.downloadUrl;
// // 跳转的应用市场列表
// this.storeList = checkVersion.store_list || [];
// // 更新内容
// this.content = checkVersion.versionInfo && this.getContentHTML(checkVersion.versionInfo);
// // 更新标题
// this.title = checkVersion.title || '发现新版本';
// // 是否强制更新
// this.isForceUpdata = checkVersion.forceUpdate;
// // 是否wgt资源包
// this.isWGT = checkVersion.type == 'wgt';
// // 如果已经有下载好的包
// if (appDownLoadTempFilePath && this.compare(this.version, uni.getStorageSync(
// 'appDownLoadTempFilePathVersion')) == 0) {
// this.tempFilePath = appDownLoadTempFilePath;
// this.downloadSuccess = true;
// this.installForBeforeFilePath = appDownLoadTempFilePath;
// } else {
// uni.clearStorageSync('appDownLoadTempFilePath');
// uni.clearStorageSync('appDownLoadTempFilePathVersion');
// }
// // 打开更新提示
// this.$refs.popup.open();
// }
// 检查版本 需要更新时才会触发回调
checkVersion().then((res) => {
// 非静默更新时触发
......
......@@ -170,15 +170,22 @@
const self=this
uni.getSystemInfo({
success: (res) => {
console.log(res.appVersion,'dddd')
const appVersion=res.appVersion
let platform = res.platform;
// 获取本机版本号
let type;
platform === "android" ? (type = "ANDROID") : (type = "IOS");
self.$request(`/pawn/setting/other/appVersion/${type}`,'GET').then(res => {
if (res.success==true) {
const response = res.result.data;
console.log(appVersion,'appVersion')
if(appVersion<response.versionName){
self.appUpgeadeObj=response
}
console.log(response,'response')
self.appUpgeadeObj=response
}
})
}
......@@ -241,7 +248,16 @@
this.Go('uni:/pages/login/login')
}else{
const { tager }=item
this.Go(tager)
console.log(tager)
if(tager.split(',')[1]=='tab'){
console.log(1)
this.Go('uni:/pages/finance/index','tab')
}else{
console.log(2)
this.Go(tager)
}
}
},
goUP(val){
......
......@@ -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 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.
......@@ -18,7 +18,8 @@ export const convertPromise = function (FnName, params = {}) {
}
export const initHeaderInfo = function () {
const versionNew = uni.getStorageSync('m-header-version')
const modelApp = uni.getStorageSync('modelApp')
const versionNew = uni.getStorageSync('m-header-version')
let deviceName
if (plus.os.name == 'Android') {
deviceName = 'android'
......@@ -29,7 +30,7 @@ export const initHeaderInfo = function () {
var randomNum = new Date().getTime();
const commons = {
"appName": "DDH",
"appSourceId": "1",
"appSourceId":modelApp,
"token": randomNum,
"device": deviceName,
"appVersion": versionNew,
......@@ -38,9 +39,10 @@ export const initHeaderInfo = function () {
}
// 初始化请求头的device参数信息
export const initHeaderDevice = function () {
const modelApp = uni.getStorageSync('modelApp')
const common = {
appName: 'DDH',
appSourceId: "1",
appSourceId: modelApp,
token: "c695fa285b9dc46a", // 设备令牌(device_token) 设备udid
idfa: "", // IOS设备则为:IDFA 广告标识
imei: "", //安卓设备为:imei
......
......@@ -22,7 +22,6 @@ const request = async (url, type, data) => {
}
}
return new Promise((resolve, reject) => {
const token = uni.getStorageSync('token')
const tokenFinance = uni.getStorageSync('tokenFinance')
......
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