From 2cb264ec2b7c7dd9798d1821927104fad35bd063 Mon Sep 17 00:00:00 2001
From: ZZJ <10913410+zzj2100@user.noreply.gitee.com>
Date: 星期二, 28 六月 2022 14:47:43 +0800
Subject: [PATCH] 系统设置自适应
---
src/pages/desktop/index/components/Desktop.vue | 146 ++++++++++++++++++++++++++++++++++--------------
1 files changed, 103 insertions(+), 43 deletions(-)
diff --git a/src/pages/desktop/index/components/Desktop.vue b/src/pages/desktop/index/components/Desktop.vue
index a77c052..a0737fb 100644
--- a/src/pages/desktop/index/components/Desktop.vue
+++ b/src/pages/desktop/index/components/Desktop.vue
@@ -12,7 +12,9 @@
<div class="warn-tag" v-if="showFreeVersion">
<span v-if="!snExpire" class="text"
- >璇曠敤鐗堝皻鏈縺娲伙紝浠呮敮鎸佷娇鐢ㄩ儴鍒嗗姛鑳斤紝濡傞渶浣跨敤鍏ㄩ儴鍔熻兘锛岃灏藉揩婵�娲汇��</span
+ >{{
+ versionName
+ }}灏氭湭婵�娲伙紝浠呮敮鎸佷娇鐢ㄩ儴鍒嗗姛鑳斤紝濡傞渶浣跨敤鍏ㄩ儴鍔熻兘锛岃灏藉揩婵�娲汇��</span
>
<span v-else class="text">SmartAIOS 璇曠敤鏈熷凡鍒版湡锛岃鎮ㄥ敖蹇縺娲荤郴缁�</span>
<div>
@@ -51,7 +53,6 @@
<div class="login-content">
<el-form
:model="phone"
- status-icon
:rules="phoneCodeRule"
:validate-on-rule-change="false"
ref="phoneLogin"
@@ -92,13 +93,11 @@
</span>
</el-dialog>
<div class="ver">
- <span class="ver-text">鐗堟湰锛�</span>{{ versionName }}
+ <span class="ver-text">鐗堟湰锛�</span>SmartAI{{ versionName }}
</div>
- <div class="ver">
- <span class="ver-text">鐘舵�侊細</span>{{ versionState }}
- </div>
+ <div class="ver"><span class="ver-text">鐘舵�侊細</span>灏氭湭婵�娲�</div>
<el-divider></el-divider>
- <div class="info" v-if="versionName == 'SmartAI姝e紡鐗�'">
+ <div class="info" v-if="versionName == '姝e紡鐗�'">
<span style="font-weight: bold; font-size: 18px">路 </span>
<span style="font-size: 14px; line-height: 21px; color: #5f5f5f">
濡傛灉鎮ㄥ凡杩炴帴鍒癐nternet骞朵笖宸茶喘涔颁骇鍝佸瘑閽ワ紝鍙互灏濊瘯楠岃瘉SmartAI鍟嗗煄璐︽埛婵�娲荤郴缁熴��
@@ -109,13 +108,13 @@
</el-button>
</div>
</div>
- <div class="info" v-if="versionName == 'SmartAI姝e紡鐗�'">
+ <div class="info" v-if="versionName == '姝e紡鐗�'">
<span style="font-weight: bold; font-size: 18px">路 </span>
<span style="font-size: 14px; line-height: 21px; color: #5f5f5f">
濡傛灉鎮ㄦ湭杩炴帴Internet鎴栨縺娲诲け璐ワ紝鍙皾璇曠绾挎縺娲伙紝璇风敤鎵嬫満鎵爜璐拱浜у搧鎴栭獙璇丼martAI鍟嗗煄璐︽埛婵�娲荤郴缁熴��
</span>
</div>
- <div class="info" v-if="versionName !== 'SmartAI姝e紡鐗�'">
+ <div class="info" v-if="versionName !== '姝e紡鐗�'">
<span style="font-weight: bold; font-size: 18px">路 </span>
<span style="font-size: 14px; line-height: 21px; color: #5f5f5f">
濡傛灉杩樻病鏈変骇鍝佸瘑閽ワ紝浣犲彲浠ヤ娇鐢ㄦ墜鏈烘壂鐮佹垨鍓嶅線姝ら摼鎺�
@@ -157,16 +156,18 @@
<!-- <el-divider></el-divider> -->
<span slot="footer" class="dialog-footer">
- <!-- v-if="!snExpire && versionName != 'SmartAI姝e紡鐗�'" -->
<div class="btns">
- <el-button class="cancel" @click="activeDialog = false"
+ <el-button
+ v-if="!snExpire && versionName != '姝e紡鐗�'"
+ class="cancel"
+ @click="activeDialog = false"
>缁х画璇曠敤</el-button
>
<el-button
class="cancel"
- v-if="snExpire && versionName != 'SmartAI姝e紡鐗�'"
+ v-if="snExpire && versionName != '姝e紡鐗�'"
@click="$emit('quit')"
- >閫�鍑虹櫥褰�
+ >閫�鍑虹櫥闄�
</el-button>
<el-button class="ok" type="primary" @click="activateVersion"
>婵�娲�</el-button
@@ -186,7 +187,7 @@
>
<div class="tip">
<i class="el-icon-info"></i>
- <span> 璇锋鏌ヨ鍗曚俊鎭紝纭鏃犺鍚庡啀婵�娲荤郴缁熴�� </span>
+ <span>璇锋鏌ヨ鍗曚俊鎭槸鍚︽纭紝纭鏃犺鍚庡啀婵�娲荤郴缁�</span>
</div>
<div class="order-list" v-if="orderList.length">
@@ -205,18 +206,33 @@
<span>{{ item.orderMoney }} 鍏�</span>
</div>
<div class="desc">
+ <div>璁㈠崟鐢熸垚鏃ユ湡锛歿{ item.createTime }}</div>
+ <div>浜у搧鍚嶇О锛歿{ prod.productName }}</div>
+ <div>浜у搧绫诲瀷锛歿{ prod.productTypeName }}</div>
<div>绯荤粺鐗堟湰锛歿{ prod.edition }}</div>
<div>閫氶亾鏁伴噺锛歿{ prod.ChCount }}</div>
- <div>鎽勫儚鏈烘暟閲忥細{{ prod.cameraCount }}</div>
- <div>鏈嶅姟鏃堕暱锛歿{ prod.serveYear }} 骞�</div>
+ <div>鎺堟潈鏁伴噺锛歿{ prod.authCount }}</div>
+ <div>
+ 璧锋鏈嶅姟鏃堕棿 锛歿{
+ startAndEnd(item.createTime, prod.serveYear)
+ }}
+ </div>
</div>
</div>
</div>
</div>
- <div class="no-order-list" v-else>鎶辨瓑锛屾病鏈夋煡璇㈠埌璁㈠崟銆�</div>
+ <div class="no-order-list" v-else>
+ {{
+ loadingOrders ? "璁㈠崟鍔犺浇涓紝璇风◢鍚�..." : "鎶辨瓑锛屾湭鏌ヨ鍒拌鍗曚俊鎭紒"
+ }}
+ </div>
<span slot="footer" class="dialog-footer">
- <el-button @click="$emit('quit')">閫�鍑虹櫥褰�</el-button>
- <el-button type="primary" @click="activeVerByOrd">婵�娲�</el-button>
+ <div class="btns">
+ <el-button class="cancel" @click="$emit('quit')">閫�鍑虹櫥褰�</el-button>
+ <el-button class="ok" type="primary" @click="activeVerByOrd"
+ >婵�娲�</el-button
+ >
+ </div>
</span>
</el-dialog>
</div>
@@ -250,7 +266,6 @@
innerDialog: false,
versionName: "",
codeMsg: "鑾峰彇楠岃瘉鐮�",
- versionState: "灏氭湭婵�娲�",
secrectKey: "",
curOrder: {},
curProd: {},
@@ -259,6 +274,7 @@
snExpire: false,
timer: null,
token: "",
+ loadingOrders: true,
orderList: [],
phone: {
phoneNum: "",
@@ -276,6 +292,11 @@
this.validateSn();
},
methods: {
+ startAndEnd(createTime, serveYear) {
+ let year = createTime.split("-")[0];
+ let endTime = parseInt(year) + serveYear + createTime.slice(4);
+ return createTime + " - " + endTime;
+ },
activeVerByOrd() {
activeByOrder({
token: this.token,
@@ -295,6 +316,7 @@
validateSn() {
getSN().then((res) => {
this.snExpire = res.data.expire;
+ this.activeDialog = res.data.expire;
this.showFreeVersion = res.data.sn == "" || res.data.expire;
this.versionName = this.getVersionName(res.data.edition);
});
@@ -314,24 +336,23 @@
}
},
choseProd(order, prod) {
- debugger;
this.curOrder = order;
this.curProd = prod;
},
getVersionName(s) {
switch (s) {
case "alpha":
- return "SmartAI鍐呮祴鐗�";
+ return "鍐呮祴鐗�";
case "beta":
- return "SmartAI鍏祴鐗�";
+ return "鍏祴鐗�";
case "trial":
- return "SmartAI璇曠敤鐗�";
+ return "璇曠敤鐗�";
case "test":
- return "SmartAI娴嬭瘯鐗�";
+ return "娴嬭瘯鐗�";
case "official":
- return "SmartAI姝e紡鐗�";
+ return "姝e紡鐗�";
default:
- return "SmartAI瀹氬埗鐗�";
+ return "瀹氬埗鐗�";
break;
}
},
@@ -345,11 +366,13 @@
loginShopInSmart(param).then((res) => {
this.innerDialog = true;
this.activeDialog = false;
+
this.token = res.data.access_token;
getShopOrderList({ token: this.token })
.then((res) => {
if (res.code == 200) {
this.orderList = res.data.list;
+ this.loadingOrders = false;
} else {
this.$notify.error("鑾峰彇璁㈠崟鍒楄〃澶辫触");
}
@@ -399,7 +422,6 @@
}
activateVersion({ code: this.secrectKey.trim() })
.then((res) => {
- debugger;
if (res.code == 200) {
this.$notify.success("婵�娲绘垚鍔�");
this.validateSn();
@@ -420,7 +442,6 @@
this.activeDialog = true;
},
uploadKey(params) {
- debugger;
let param = new FormData();
param.append("code", params.file);
uploadKey(param).then(
@@ -540,10 +561,10 @@
.el-dialog.my-account {
border-radius: 24px;
.btns {
- display: flex;
+ display: flex;
justify-content: right;
.cancel {
- width: 76px;
+ width: 76px;
height: 40px;
cursor: pointer;
border-radius: 20px;
@@ -551,7 +572,6 @@
font-size: 14px;
color: var(--colorCard);
border-color: var(--colorCard) !important;
- margin-right: 12px;
display: flex;
align-items: center;
justify-content: center;
@@ -606,10 +626,11 @@
}
}
.el-dialog__footer {
- padding: 30px ;
+ padding: 30px;
text-align: left;
box-sizing: border-box;
- box-shadow: 0px -1px 0px rgb(0 0 0 / 8%);}
+ box-shadow: 0px -1px 0px rgb(0 0 0 / 8%);
+ }
.el-dialog__header {
padding: 14px 20px 13px;
text-align: center;
@@ -669,19 +690,58 @@
}
}
.el-dialog.my-order {
+ border-radius: 24px;
+ .el-dialog__body {
+ padding: 22px 20px;
+ }
+ .btns {
+ display: flex;
+ justify-content: right;
+ .cancel {
+ width: 140px;
+
+ height: 40px;
+ cursor: pointer;
+ border-radius: 20px;
+ line-height: 40px;
+ font-size: 14px;
+ color: var(--colorCard);
+ border-color: var(--colorCard) !important;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ }
+ .ok {
+ width: 140px;
+ height: 40px;
+ cursor: pointer;
+ border-radius: 20px;
+ background-color: var(--colorCard) !important;
+ border-color: var(--colorCard) !important;
+ color: #fff;
+ line-height: 40px;
+ font-size: 14px;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ }
+ }
.tip {
width: auto;
- height: 40px;
- background: rgb(145, 213, 255, 0.2);
- box-sizing: border-box;
- border: 1px rgb(145, 213, 255) solid;
+ display: -webkit-box;
+ display: -ms-flexbox;
display: flex;
padding: 0 10px;
border-radius: 5px;
+ color: #5f5f5f;
+ line-height: 20px;
+ font-weight: bold;
+ -ms-flex-align: center;
align-items: center;
+ justify-content: center;
i {
margin-right: 5px;
- font-size: 16px;
+ font-size: 24px;
color: var(--colorCard);
}
span {
@@ -698,10 +758,8 @@
height: 550px;
overflow-y: auto;
.order-card {
- height: 150px;
background: #fff;
margin-bottom: 15px;
-
border-radius: 8px;
box-shadow: 0px 0px 4px rgb(0 0 0 / 25%);
.head {
@@ -719,10 +777,12 @@
display: flex;
flex-direction: column;
justify-content: space-evenly;
- height: 110px;
text-align: left;
box-sizing: border-box;
- padding: 0 20px;
+ font-size: 13px;
+
+ padding: 8px 20px;
+ line-height: 20px;
}
}
}
--
Gitblit v1.8.0