瀏覽代碼

style: "调整定位+优惠码+优惠券+页头+导出"

Ritchie 1 年之前
父節點
當前提交
1fbae4f30a

+ 7 - 3
src/assets/language/en.json

@@ -233,6 +233,7 @@
     }
   },
   "device": {
+    "managementCenter": "Device Management Center",
     "setAlarm": "set alarm",
     "equipmentName": "Equipment name",
     "selectDevice": "Select Device",
@@ -474,6 +475,7 @@
     "noPosition": "No positioning",
     "equipLocation": "Equipment location",
     "position": "Position",
+    "viewPositioning": "View positioning",
     "view": "view",
     "oneKeyFeed": "One key feeding",
     "replenishment": "replenishment",
@@ -484,8 +486,8 @@
     "stick": "stick",
     "water": "water",
     "wasteWater": "wasteWater",
-    "turnOffHibe": "Turn off hibernation",
-    "enableSleep": "Enable Sleep",
+    "turnOffSleep": "Turn off Sleep",
+    "turnOnSleep": "Turn on Sleep",
     "communiChannel": "Communication channel",
     "tweets": "Tweets",
     "mq": "Mq",
@@ -541,7 +543,8 @@
     "export": "export",
     "apply": "apply",
     "discount": "discount",
-    "termOfValidity": "term of validity",
+    "termOfValidity": "Valid until",
+    "expired": "(Expired)",
     "validDays": "Valid days",
     "usingTheMachine": "Using the machine",
     "purchaseDiscountCode": "Purchase discount code",
@@ -1231,6 +1234,7 @@
     "rankMethod": "Ranking method"
   },
   "user": {
+    "personalCenter": "Personal Center",
     "essentialInformation": "essential information",
     "systemId": "System id",
     "myAccount": "My Account",

+ 7 - 3
src/assets/language/zh.json

@@ -233,6 +233,7 @@
     }
   },
   "device": {
+    "managementCenter": "设备管理中心",
     "setAlarm": "设置闹钟",
     "equipmentName": "设备名称",
     "selectDevice": "选择设备",
@@ -490,6 +491,7 @@
     "noPosition": "暂无定位",
     "equipLocation": "设备位置",
     "position": "定位",
+    "viewPositioning": "查看定位",
     "view": "查看",
     "oneKeyFeed": "一键补料",
     "replenishment": "补料",
@@ -501,8 +503,8 @@
     "water": "清水",
     "wasteWater": "废水",
     "sentSuccessfully": "发送请求成功",
-    "turnOffHibe": "关闭休眠",
-    "enableSleep": "开启休眠",
+    "turnOffSleep": "关闭睡眠",
+    "turnOnSleep": "开启睡眠",
     "communiChannel": "通信通道",
     "tweets": "个推",
     "mq": "Mq",
@@ -542,7 +544,8 @@
     "export": "导出",
     "apply": "申请",
     "discount": "折扣",
-    "termOfValidity": "有效期",
+    "termOfValidity": "有效期至",
+    "expired": "(已过期)",
     "validDays": "有效天数",
     "usingTheMachine": "使用机器",
     "purchaseDiscountCode": "购买优惠码",
@@ -1245,6 +1248,7 @@
     "rankMethod": "排行方式"
   },
   "user": {
+    "personalCenter": "个人中心",
     "essentialInformation": "基本信息",
     "systemId": "系统id",
     "myAccount": "我的账号",

+ 15 - 0
src/styles/device/index.less

@@ -292,6 +292,21 @@
               line-height: 13px;
             }
 
+            .clickable-link {
+              text-decoration: underline;
+              cursor: pointer;
+              font-size: 14px;
+            }
+            // .clickable-link:active {
+            //   color: rgb(26, 49, 117);
+            // }
+            .replenishment {
+              text-decoration: underline;
+              cursor: pointer;
+              font-size: 14px;
+              color: #4d6add;
+            }
+
             .layer5 {
               width: 100%;
 

+ 4 - 2
src/styles/discountCode/index.less

@@ -108,6 +108,7 @@
                 justify-content: flex-end;
                 align-items: center;
 
+                // 导出 
                 .buttonItem {
                     width: 60px;
                     line-height: 1.6;
@@ -115,8 +116,8 @@
                     margin-right: 15px;
                     text-align: center;
                     background-color: #EDF0FC;
-                    color: #A5B4EE;
-                    border: 1px solid #A5B4EE;
+                    color: #e16959;
+                    border: 1px solid #7b91ea;
                     position: relative;
                 }
             }
@@ -155,6 +156,7 @@
                     }
                 }
 
+                // 使用,未使用
                 .tipBox {
                     position: absolute;
                     top: 20px;

+ 1 - 1
src/styles/home/index.less

@@ -118,7 +118,7 @@
           .txt10 {
             height: 17px;
             overflow-wrap: break-word;
-            color: rgba(64, 77, 116, 1);
+            color: #4d6add;
             font-size: 12px;
             text-align: center;
             white-space: nowrap;

+ 9 - 6
src/styles/orderCenter/index.less

@@ -253,7 +253,8 @@
         .wrap1 {
           width: 100%;
           height: 30px;
-          padding: 0 12px;
+          padding: 0 12px 5px;
+          align-items: center;
 
           .ImageText7 {
             height: 18px;
@@ -285,7 +286,7 @@
                   font-family: PingFangSC-Semibold;
                   text-align: left;
                   white-space: nowrap;
-                  line-height: 14px;
+                  line-height: 12px;
                   display: block;
                 }
               }
@@ -293,16 +294,18 @@
           }
 
           .ImageText8 {
-            height: 16px;
+            height: 18px;
+            margin-top: 1px;
+            width: 79px;
 
             .bd3 {
               height: 16px;
 
               .info4 {
-                height: 16px;
+                height: 14px;
                 overflow-wrap: break-word;
-                color: rgba(64, 77, 116, 1);
-                font-size: 11px;
+                color: #4d6add;
+                font-size: 14px;
                 text-align: center;
                 white-space: nowrap;
                 line-height: 16px;

+ 15 - 8
src/views/device/deviceOper.vue

@@ -138,6 +138,14 @@
         </div>
         <div class="operText">{{ $t("device.customLogo.customLogo") }}</div>
       </div>
+      <!-- 查看定位 -->
+      <!-- <div class="operItem" @click="viewPosiClk()">
+        <div class="operIcon">
+          <img class="operImg" src="../../assets/device/operIcon/location.png" />
+        </div>
+        <div class="operText">{{ $t("device.viewPositioning") }}</div>
+      </div> -->
+
     </div>
   </van-dialog>
   <van-dialog v-model:show="operCheckShow" :title="$t('device.operationConfirmation')" :showConfirmButton="false"
@@ -175,7 +183,7 @@ import { useI18n } from "vue-i18n";
 import { getLoginUser, styleUrl } from "@/common/js/utils";
 
 export default {
-  emits: ['operfinish'],  
+  emits: ['operfinish'],
   setup(props, { emit }) {
     // 点击修改价格
     const modifyPriceClk = () => {
@@ -199,7 +207,7 @@ export default {
     const device = ref({});
     const operType = ref("");
     // 休眠按钮
-    const sleepTitle = ref(t("device.enableSleep"));
+    const sleepTitle = ref(t("device.turnOnSleep"));
     // 初始化页面获取列表
     onMounted(async () => {
       // 加载样式
@@ -207,14 +215,13 @@ export default {
     });
     // 当前弹窗父组件触发
     const showOper = (e) => {
-      console.log()
       device.value = e;
       show.value = true;
       // isSleep=true,机器属于休眠状态,按钮是关闭休眠
       if (device.value.isSleep) {
-        sleepTitle.value = t("device.turnOffHibe");
+        sleepTitle.value = t("device.turnOffSleep");
       } else {
-        sleepTitle.value = t("device.enableSleep");
+        sleepTitle.value = t("device.turnOnSleep");
       }
     };
     // 重启炉头
@@ -283,7 +290,7 @@ export default {
         query: { deviceId: device.value.id, clientId: device.value.clientId },
       });
     };
-    // 系统脱机
+    // 系统脱机
     const tuojiEquipmentFun = () => {
       operType.value = 5;
       operCheckShow.value = true;
@@ -295,7 +302,6 @@ export default {
         query: { deviceId: device.value.id, name: device.value.name },
       });
     };
-    // 删除设备
     const deleteDevice = () => {
       operType.value = 6;
       operCheckShow.value = true;
@@ -377,7 +383,7 @@ export default {
           Toast.fail(data.message);
         }
       }
-      // 删除设备
+      // 删除设备
       if (operType.value === 6) {
         const { data } = await delOneDevice({
           equipmentId: device.value.id,
@@ -425,6 +431,7 @@ export default {
       sleepTitle,
       viewLogs,
       deleteDevice,
+      // viewPosiClk,
       changePasswordClk,
     };
   },

+ 4 - 3
src/views/device/deviceSet.vue

@@ -107,11 +107,12 @@
             </template>
           </van-field>
         </div>
-        <van-field colon readonly :label="`${$t('device.coupon')}`" placeholder="">
+        <!-- 优惠券 -->
+        <van-field colon readonly :label="`${$t('device.coupon')}`" placeholder="" v-if="user.type < 2">
           <template #input>
             <div class="l-flex-RC">
               <span>{{ couponStatusNameComp }}</span>
-              <van-switch @change="couponStatusChg" v-model="deviceDetal.couponStatus" size="24" active-value="1"
+              <van-switch @change="couponStatusChg" v-model="deviceDetal.couponStatus" size="23px" active-value="1"
                           inactive-value="0" />
             </div>
           </template>
@@ -466,7 +467,7 @@ export default {
         Toast(res.data.message);
         setTimeout(() => {
           getDeviceDetalFun();
-        }, 1000);
+        }, 1500);
       });
     };
     const couponStatusNameComp = computed(() => {

+ 24 - 7
src/views/device/index.vue

@@ -1,7 +1,7 @@
 <template>
   <!-- 设备列表 -->
   <div class="devicePage flex-col">
-    <s-header :name="sys ? sys.title : $t('public.sysName')" :noback="false"></s-header>
+    <s-header :name="sys ? sys.title : $t('device.managementCenter')" :noback="true"></s-header>
     <div class="listBox">
       <van-list v-model:loading="loading" v-model:error="error" :error-text="$t('public.requestFailed')"
         :finished="finished" :finished-text="$t('public.noMore')" offset="300" :immediate-check="false" @load="onLoad">
@@ -130,8 +130,11 @@
                   <!-- <span class="txt5 o-ptb-10 kBordBott l-flex-RC"><span>远程开门:</span>
                     <van-button type="primary">开门</van-button>
                   </span> -->
-                  <span class="txt1 o-ptb-8">{{ item.fullName }}</span>
-                  <div>
+
+                  <!-- 设备地址 -->
+                  <!-- <span class="txt1 o-ptb-8">{{ item.fullName }}</span> -->
+                  <!-- 定位: -->
+                  <!-- <div>
                     <span v-if="item.latitude" class="txt5 o-ptb-8 kBordBott l-flex-RC">
                       <span class="info1">{{
                         $t("device.position") }}:</span>
@@ -139,7 +142,17 @@
                         $t("device.view")
                       }}</van-button>
                     </span>
+                  </div> -->
+
+                  <!-- 定位: -->
+                  <div>
+                    <span v-if="item.latitude" class="txt5 o-ptb-8 kBordBott l-flex-RC">
+                      <span class="info1">{{ $t("device.position") }}:</span>
+                      <a class="clickable-link o-ptb-8" @click="viewPosiClk(item)">{{ item.fullName }}</a>
+                    </span>
                   </div>
+
+
                   <van-row class="layer5 o-ptb-8 kBordBott" justify="space-between"
                     v-if="(item.machineType == '0' || item.machineType == null) && item.equimentType != 'POP320'">
                     <van-col class="word5">{{ $t("device.furnaceHeadTemperature") }}:{{
@@ -189,9 +202,11 @@
                         {{ $t("device.wasteWater") }}:{{ Format_calcuDecial(item.wasteWater) }}%
                       </van-col>
                     </van-row>
+                    <!-- 一键补料 -->
                     <span class="txt5 o-ptb-8 kBordBott l-flex-RC"><span>{{ $t("device.oneKeyFeed") }}:</span>
-                      <van-button @click="replenishmentClk(item)" type="primary">{{ $t("device.replenishment") }}
-                      </van-button>
+                      <!-- <van-button @click="replenishmentClk(item)" type="primary">{{ $t("device.replenishment") }}
+                      </van-button> -->
+                      <a class="replenishment o-ptb-8" @click="replenishmentClk(item)">{{ $t("device.replenishment") }}</a>
                     </span>
                   </template>
                   <span class="info1 o-ptb-8 kBordBott">{{ $t("device.lastRefreshTime") }}:{{
@@ -405,6 +420,7 @@ export default {
 
     // 点击查看定位
     const viewPosiClk = (row) => {
+      console.log("row 是 >>>", row);
       if (row.latitude) {
         router.push({
           path: "viewPosition",
@@ -418,11 +434,12 @@ export default {
         Toast(`${t("device.noPosition")}!!!`);
       }
     };
+
     // 点击补料
     const replenishmentClk = (row) => {
-      console.log("row", row);
+      console.log("row >>>", row);
       Api_getReplenishment({ equipmentId: row.id }).then((res) => {
-        console.log("res", res);
+        console.log("res >>>", res);
         // Toast(res.data.message);
         Dialog.alert({
           message: t('device.sentSuccessfully'),

+ 13 - 5
src/views/discountCode/index.vue

@@ -41,11 +41,11 @@
               </div>
               <div class="itemRow"><span class="itemTitle">{{ $t('discountCode.creationTime') }}:&nbsp;</span>{{
                 showDateTime(item.createDate) }}</div>
-              <div class="itemRow"><span class="itemTitle">{{ $t('discountCode.usageTime') }}:&nbsp;</span>{{
+              <div class="itemRow" v-if="item.isUse !== '0'"><span class="itemTitle">{{ $t('discountCode.usageTime') }}:&nbsp;</span>{{
                 showDateTime(item.useDate) }}</div>
               <div class="itemRow"><span class="itemTitle">{{ $t('discountCode.termOfValidity') }}:&nbsp;</span>{{
-                showDate(item.lastUseDate) }}</div>
-              <div class="itemRow"><span class="itemTitle">{{ $t('discountCode.usingTheMachine') }}:&nbsp;</span>{{
+                showDate(item.lastUseDate) }} <span v-if="item.isUse === '0' && isExpired(item.lastUseDate)">{{ $t('discountCode.expired') }}</span></div>
+              <div class="itemRow" v-if="item.isUse !== '0'"><span class="itemTitle">{{ $t('discountCode.usingTheMachine') }}:&nbsp;</span>{{
                 item.useBy }}</div>
             </div>
             <div class="tipBox" v-if="item.isUse === '0'">{{ $t('discountCode.notUsed') }}</div>
@@ -81,7 +81,7 @@ export default {
       adminId: "", // 用户账户id
       current: 1, // 页数
       size: 20, // 页大小
-      isUse: '0', // 是否使用
+      isUse: '0', // 是否使用,0:未使用;1:已使用
       // type: null // 优惠码类型 0或null:折扣优惠码;1:抵扣价优惠码
     });
     // 初始化页面获取列表
@@ -135,6 +135,13 @@ export default {
       $M_ExportFile(data, headers);
     }
     const payCode = () => { router.push({ path: '/payCode' }); };
+
+    const isExpired = ref((lastUseDate) => {
+      const currentDate = new Date();
+      const lastUseDateTime = new Date(lastUseDate);
+      return currentDate > lastUseDateTime;
+    });
+
     return {
       searchRef,
       loading,
@@ -151,7 +158,8 @@ export default {
       showDate,
       showDateTime,
       exportClick,
-      payCode
+      payCode,
+      isExpired,
     };
   },
   components: { sHeader, codeSearch },

+ 1 - 1
src/views/user.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="page flex-col">
-    <s-header :name="sys ? sys.title : $t('public.sysName')" :noback="true" :isFixed="false"></s-header>
+    <s-header :name="sys ? sys.title : $t('user.personalCenter')" :noback="true" :isFixed="false"></s-header>
     <div class="userPageBox">
       <div class="userBaseBox">
         <div class="baseRow flex-row justify-between">