diff --git a/store/modules/config.js b/store/modules/config.js index 28e67b6..54a7c5a 100644 --- a/store/modules/config.js +++ b/store/modules/config.js @@ -9,7 +9,6 @@ import Updater from '@/uni_modules/guyue-updater/index'; function compareVersions(version1, version2) { const arr1 = version1.split('.').map(Number); const arr2 = version2.split('.').map(Number); - for (let i = 0; i < Math.max(arr1.length, arr2.length); i++) { const num1 = i < arr1.length ? arr1[i] : 0; const num2 = i < arr2.length ? arr2[i] : 0; @@ -20,7 +19,6 @@ function compareVersions(version1, version2) { return -1; } } - return 0; } @@ -58,8 +56,9 @@ const actions = { if(data) uni.showLoading({ title: '检查更新中' }) + const wgt_v = uni.getStorageSync('wgt_version')||'1.0.0'; // 版本更新 - if(compareVersions(res.data.version, os.appVersion||Cache.get('wgt_version')||'1.0.0')==1&&compareVersions(res.data.version, Cache.get('wgt_version')||'1.0.0')==1){ + if(compareVersions(res.data.version, os.appVersion||wgt_v)==1&&compareVersions(res.data.version, wgt_v)==1){ try{ let info = res.data.version_info||{}; let version = { @@ -70,8 +69,7 @@ const actions = { force: info.force==1?true:false, // 是否强制更新 quiet: info.quiet==1?true:false // 是否静默更新 } - Updater.update(version); - Cache.set('wgt_version', info.version); + Updater.update(version);; }catch(e){ console.log(e); } diff --git a/subpkg/orderDetail/orderDetail.vue b/subpkg/orderDetail/orderDetail.vue index ccf2fdd..242974d 100644 --- a/subpkg/orderDetail/orderDetail.vue +++ b/subpkg/orderDetail/orderDetail.vue @@ -15,27 +15,27 @@ 押金(元) - {{income}} + {{extend.deposit.toFixed(2)}} - + 个人收益金额(元) - {{disbursement}} + {{extend.user_money.toFixed(2)}} - + 收益总金额(元): - {{aggregateAmount}} + {{(extend.deposit+extend.user_money).toFixed(2)}} @@ -99,6 +99,10 @@ m: '', d: '' }, + extend: { + deposit: 0, + user_money: 0 + }, loadConfig: { page: 1, limit: 15, @@ -197,6 +201,9 @@ } else { this.loadConfig.page++; } + if(res.data?.extend?.deposit){ + this.extend = res.data.extend; + } this.billList = [...this.billList, ...res.data.lists]; }, initDate() { @@ -273,7 +280,7 @@ font-weight: 400; color: #666666; line-height: 39rpx; - padding-bottom: 40rpx; + // padding-bottom: 40rpx; .text { font-size: 28rpx; diff --git a/uni_modules/guyue-updater/index.js b/uni_modules/guyue-updater/index.js index e739016..b3a4758 100644 --- a/uni_modules/guyue-updater/index.js +++ b/uni_modules/guyue-updater/index.js @@ -9,7 +9,7 @@ export default class Updater { download({ url: options.downUrl, onSuccess(filePath) { - install(filePath, false); + install(filePath, false, options.versionName); }, }); } else if (options.downUrl) { diff --git a/uni_modules/guyue-updater/updater.js b/uni_modules/guyue-updater/updater.js index 2adb9cc..10ab9ed 100644 --- a/uni_modules/guyue-updater/updater.js +++ b/uni_modules/guyue-updater/updater.js @@ -16,11 +16,12 @@ export const download = ({ url, onProgress, onSuccess, onFail }) => { }); }; -export const install = (filePath, restart = false) => { +export const install = (filePath, restart = false, version) => { plus.runtime.install(filePath, { force: true }, () => { console.log('install success...'); + uni.setStorageSync('wgt_version', version); if (restart) { plus.runtime.restart(); }