From 4f39a6ba29fdfa468bfdb881bf03c96fcd7a6697 Mon Sep 17 00:00:00 2001 From: weipengfei <2187978347@qq.com> Date: Thu, 31 Aug 2023 10:45:23 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/company/company.vue | 90 +++++++++++++++++----------------- store/modules/config.js | 33 +++++++++---- 2 files changed, 68 insertions(+), 55 deletions(-) diff --git a/components/company/company.vue b/components/company/company.vue index 308da64..ffed8c3 100644 --- a/components/company/company.vue +++ b/components/company/company.vue @@ -39,21 +39,21 @@ - - 公司名称 : - {{company.company_name}} + + 公司名称︰ + {{company.company_name}} - - 社会代码 : - {{company.organization_code}} + + 社会代码︰ + {{company.organization_code}} - - 公司类型 : - {{company.company_type_name||company.company_type}} + + 公司类型︰ + {{company.company_type_name||company.company_type}} - - 负责区域 : - {{c_address}} + + 负责区域︰ + {{c_address}} @@ -69,21 +69,21 @@ - - 法人姓名 : - {{company.master_name}} + + 法人姓名︰ + {{company.master_name}} - - 担任职务 : - {{company.master_position}} + + 担任职务︰ + {{company.master_position}} - - 联系电话 : - {{company.master_phone}} + + 联系电话︰ + {{company.master_phone}} - - 电子邮箱 : - {{company.master_email}} + + 电子邮箱︰ + {{company.master_email}} @@ -154,21 +154,21 @@ - - 甲方 : - {{contract.party_a_name}} + + 甲方︰ + {{contract.party_a_name}} - - 乙方 : - {{contract.party_b_name}} + + 乙方︰ + {{contract.party_b_name}} - - 合同类型 : - {{contract.contract_type_name}} + + 合同类型︰ + {{contract.contract_type_name}} - - 合同编号 : - {{contract.contract_no}} + + 合同编号︰ + {{contract.contract_no}} @@ -183,7 +183,6 @@ 合同 - {{contract.create_time}} @@ -531,14 +530,15 @@ display: flex; flex-direction: column; justify-content: space-between; + word-break: break-all; - view { - margin-bottom: 10rpx; - - text:nth-child(2) { - margin-left: 20rpx; - } - } + .right_item{ + display: flex; + margin-bottom: 10rpx; + .right_item_title{ + flex-shrink: 0; + } + } } } @@ -572,7 +572,7 @@ .text { display: flex; flex-direction: column; - justify-content: space-between; + justify-content: space-around; .name { font-size: 32rpx; diff --git a/store/modules/config.js b/store/modules/config.js index ab118f3..452e805 100644 --- a/store/modules/config.js +++ b/store/modules/config.js @@ -2,6 +2,25 @@ import Cache from '@/utils/cache'; import { getConfig } from "@/api/config.js"; 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; + + if (num1 > num2) { + return 1; + } else if (num1 < num2) { + return -1; + } + } + + return 0; +} + const state = { eyeType: Cache.get('eyeType') || true, // 小眼睛 request: Cache.get('request') || true, // 网络请求 @@ -27,18 +46,11 @@ const actions = { async initConfig({ state, commit }) { let res = await getConfig(); commit('SET_CONFIG', res.data); + let os = uni.getSystemInfoSync(); // 版本更新 - if(res.data.newVersion){ + if(compareVersions(res.data.version, os.appVersion)==1){ try{ let info = res.data.versionInfo||{}; - // Updater.update({ - // title: '发现新版本', - // content: '1. 我们更新了新的UI设计\n2. 我们更新了新的UI设计\n3. 我们更新了新的UI设计\n4. 我们更新了新的UI设计\n', - // versionName: '1.3.6', - // downUrl: 'https://lihai001.oss-cn-chengdu.aliyuncs.com/__UNI__B5B1EDD__20230816174515.apk', - // force: false, // 是否强制更新 - // quiet: false // 是否静默更新 - // }) info = { title: info.title||'发现新版本', content: info.content||'修复了部分BUG', @@ -47,7 +59,7 @@ const actions = { force: info.force||false, // 是否强制更新 quiet: info.quiet||false // 是否静默更新 } - Updater.update(info) + Updater.update(info); }catch(e){ console.log(e); } @@ -55,6 +67,7 @@ const actions = { } }; + export default { state, mutations,