Browse Source

优化更新

soobin 2 years ago
parent
commit
71b24998be

+ 1 - 0
src/assets/language/en.json

@@ -304,6 +304,7 @@
     "remoteSugarMaking": "Remote sugar making",
     "outDoor": "Outer door",
     "inDoor": "Inner door",
+	"status": "Status",
     "openRemind": "Remind",
     "openRemindOut": "Are you sure you want to switch the outer door?",
     "openRemindIn": "Are you sure you want to switch the Inner door?",

+ 1 - 0
src/assets/language/zh.json

@@ -300,6 +300,7 @@
     "remoteDoorOpening": "远程开门",
 	"outDoor": "外 门",
 	"inDoor": "内 门",
+	"status": "状 态",
 	"openRemind": "提醒",
 	"openRemindOut": "是否切换外门开关?",
 	"openRemindIn": "是否切换内门开关?",

+ 5 - 1
src/service/device/index.js

@@ -49,8 +49,12 @@ export function selectProducts(params) {
 export function doSugar(params) {
   return axios.get(`/SZWL-SERVER/tSugarDo/doSugar?${stringToUrl(params)}`);
 }
-// 查询是否做糖状态/今日做糖列表
+// 查询做糖状态
 export function selectSugarStatus(params) {
+  return axios.get(`/SZWL-SERVER/tSugarDo/selectSugarStatus?${stringToUrl(params)}`);
+}
+// 今日做糖列表
+export function selectSugarList(params) {
   return axios.get(`/SZWL-SERVER/tSugarDo/selectSugarList?${stringToUrl(params)}`);
 }
 // 查询定时开关列表

+ 2 - 2
src/utils/config.js

@@ -2,9 +2,9 @@ let baseURL;
 // 开发环境
 if (process.env.NODE_ENV === 'development') {
     // 测试的
-    baseURL = 'https://szwl.sunzee.com.cn/'
+    // baseURL = 'https://szwl.sunzee.com.cn/'
     // 正式的
-    // baseURL = 'https://sz.sunzee.com.cn/'
+    baseURL = 'https://sz.sunzee.com.cn/'
     
     // baseURL = 'http://120.25.151.99:49002/'
     // 编译环境

+ 0 - 0
src/views/customLogo/index.vue


+ 34 - 89
src/views/device/customLogo.vue

@@ -2,8 +2,11 @@
 <!--  修改logo  -->
   <div class="page flex-col">
     <s-header :name="$t('device.customLogo.customLogo')" :noback="false"></s-header>
-
-    <div class="wrap1 flex-col">
+	<div class="block2 flex-row justify-between">
+		<div class="block3 flex-col"></div>
+		<span class="info2">{{ $t('device.equipmentName') }}:{{ deviceDetail ? deviceDetail.name : '' }}</span>
+	</div>
+    <div class="wrap1 flex-col o-pt-15">
       <van-field v-model="logoNumber"
                  type="digit"
                  :label="$t('device.customLogo.logoLabel')"
@@ -17,7 +20,6 @@
                   class="volumeChangeButton"
                   @click="submitChange">{{ $t('device.customLogo.registerButton') }}</van-button>
     </div>
-
   </div>
 </template>
 
@@ -41,13 +43,13 @@ export default defineComponent({
     // 初始化页面获取列表
     onMounted(async () => {
       await getDeviceDetailFun();
+	  console.log(deviceDetail.value.name);
     });
 
     const getDeviceDetailFun = async () => {
       const { data } = await getDeviceDetal({id : deviceId});
       if (data.code === '00000') {
         deviceDetail.value = data.data;
-        // volume.value = data.data.volume ? data.data.volume : 0;
       } else { Toast.fail(data.message); }
     }
 
@@ -59,7 +61,6 @@ export default defineComponent({
       // }
       const { data } = await customLogo({
         id: deviceId,
-        // adminId:
       })
       if (data.code === '00000') {
         Toast.success(t('device.modificationSucceeded'));
@@ -89,21 +90,7 @@ export default defineComponent({
   width: 100%;
   height: calc(100vh - 44px);
   overflow: hidden;
-  .van-slider {
-    width: 92%;
-    height: 4px;
-    margin: 0 auto;
-    margin-top: 35px;
-    background-color: #dfdfe5;
-    .van-slider__bar {
-      background-color: rgba(77, 193, 147, 1);
-    }
-    .van-slider__button {
-      background-color: rgba(77, 193, 147, 1);
-      width: 16px;
-      height: 16px;
-    }
-  }
+  
   .volumeChangeButton {
     background-color: #4d6add;
     width: 220px;
@@ -114,75 +101,33 @@ export default defineComponent({
   .wrap1 {
     width: 100%;
     height: 274px;
-    .box2 {
-      background-color: rgba(255, 255, 255, 1);
-      z-index: 23;
-      height: 54px;
-      margin-top: 1px;
-      width: 100%;
-      position: relative;
-      .section3 {
-        width: 162px;
-        height: 20px;
-        margin: 17px 0 0 15px;
-        .box3 {
-          background-color: rgba(128, 150, 236, 1);
-          border-radius: 2px;
-          width: 4px;
-          height: 12px;
-          margin-top: 4px;
-        }
-        .info1 {
-          width: 150px;
-          height: 20px;
-          overflow-wrap: break-word;
-          color: rgba(64, 77, 116, 1);
-          font-size: 14px;
-          font-family: PingFangSC-Medium;
-          text-align: left;
-          white-space: nowrap;
-          line-height: 20px;
-          display: block;
-        }
-      }
-      .img1 {
-        z-index: 31;
-        position: absolute;
-        left: 0;
-        top: 53px;
-        width: 100%;
-        height: 2px;
-      }
-    }
-    .box4 {
-      width: 147px;
-      height: 14px;
-      margin: 19px 0 0 15px;
-      .word3 {
-        width: 104px;
-        height: 13px;
-        overflow-wrap: break-word;
-        color: rgba(64, 77, 116, 1);
-        font-size: 13px;
-        text-align: left;
-        white-space: nowrap;
-        line-height: 13px;
-        margin-top: 1px;
-        display: block;
-      }
-      .word4 {
-        width: 33px;
-        height: 13px;
-        overflow-wrap: break-word;
-        color: rgba(64, 77, 116, 1);
-        font-size: 15px;
-        font-family: PingFangSC-Medium;
-        text-align: left;
-        white-space: nowrap;
-        line-height: 15px;
-        display: block;
-      }
-    }
+  }
+  
+  .block2 {
+  	width: 162px;
+  	height: 20px;
+  	margin: 18px 0 0 15px;
+  
+  	.block3 {
+  		background-color: rgba(128, 150, 236, 1);
+  		border-radius: 2px;
+  		width: 4px;
+  		height: 12px;
+  		margin-top: 4px;
+  	}
+  
+  	.info2 {
+  		width: 150px;
+  		height: 20px;
+  		overflow-wrap: break-word;
+  		color: rgba(64, 77, 116, 1);
+  		font-size: 14px;
+  		font-family: PingFangSC-Medium;
+  		text-align: left;
+  		white-space: nowrap;
+  		line-height: 20px;
+  		display: block;
+  	}
   }
 }
 </style>

+ 1 - 6
src/views/device/deviceOper.vue

@@ -172,7 +172,7 @@
 	  </div>
 
     <!-- 定制logo -->
-    <div class="operItem" @click="customLogo()">
+    <div v-if="user.type < 2" class="operItem" @click="customLogo()">
 	    <div class="operIcon">
 	      <img
 	        class="operImg"
@@ -334,11 +334,6 @@ export default {
       operType.value = 6;
       operCheckShow.value = true;
     };
-    // 定制logo
-    // const customLogo = () => {
-    //   operType.value = 6;
-    //   operCheckShow.value = true;
-    // };
     // 取消操作
     const operCheckClear = () => {
       operCheckShow.value = false;

+ 19 - 3
src/views/device/doSugar.vue

@@ -11,7 +11,14 @@
         :placeholder="$t('device.pleaseSelectAPattern')" @click="show = true" />
       <van-popup v-model:show="show" round position="bottom">
         <van-cascader v-model="cascaderValue" :title="$t('device.pleaseSelectAPattern')" :options="options"
-          @close="show = false" @finish="onFinish" />
+          @close="show = false" @finish="onFinish" >
+			<template #option="{ option }">
+				<div class="cascader-item">
+				<van-image :src="option.imgUrl" width="50px" height="50px"></van-image>
+				<div class="cascader-label">{{ option.value }}</div>
+				</div>
+			</template>
+		</van-cascader>
       </van-popup>
       <div class="textRow o-pr-20">
         <span @click="pushToDaySugarList">{{ $t('device.todaysSugarList') }}>></span>
@@ -53,8 +60,13 @@ export default {
     // 初始化页面获取列表
     onMounted(async () => {
       getDeviceDetalFun();
+	  // console.log(deviceId);
     });
 
+	const showSugarPhoto = (no) => {
+		return require(`../../assets/order/spunSugar/goods/${no}.png`);
+	};
+
     // 获取设备列表数据
     const getDeviceDetalFun = async () => {
       const { data } = await getDeviceDetal({ id: deviceId });
@@ -71,9 +83,11 @@ export default {
           return {
             text: item.productName,
             value: item.productName,
+			imgUrl: showSugarPhoto(item.no),
           };
         })
       } else { Toast.fail(data.message); }
+	  console.log(options.value);
     }
     const submitDoSugar = async () => {
       doSugartData.value = null;
@@ -95,8 +109,9 @@ export default {
         doSugartType.value = true;
       } else { Toast.fail(data.message); }
     };
+	
     const pushToDaySugarList = async () => {
-      router.push({ path: 'toDaySugarList' })
+      router.push({ path: 'toDaySugarList', query: { deviceId: deviceId}})
     }
 
     return {
@@ -110,7 +125,8 @@ export default {
       doSugartData,
       doSugartType,
       checkData,
-      pushToDaySugarList
+      pushToDaySugarList,
+	  showSugarPhoto,
     };
   },
   components: { sHeader },

+ 19 - 6
src/views/device/openDoor.vue

@@ -15,16 +15,16 @@
 			>
 				<template #input>
 					<div class="l-flex-RC">
-					<span>{{ deviceDetal.outDoor != 1 ? $t("device.close") : $t("device.open") }}</span>
 					<van-switch
-						disabled
 						:model-value="deviceDetal.outDoor"
 						@update:model-value="outDoorChg"
-						size="24"
+						size="22"
 						active-value="1"
 						inactive-value="0"
 					/>
 					</div>
+					<span class="info3 o-pl-50">{{$t("device.status")}}: </span>
+					<span class="info3 o-pl-10">{{ deviceDetal.outDoor != 1 ? $t("device.close") : $t("device.open") }}</span>
 				</template>
 			</van-field>
 			
@@ -36,16 +36,16 @@
 			>
 				<template #input>
 					<div class="l-flex-RC">
-					<span>{{ deviceDetal.inDoor != 1 ? $t("device.close") : $t("device.open") }}</span>
 					<van-switch
-						disabled
 						:model-value="deviceDetal.inDoor"
 						@update:model-value="inDoorChg"
-						size="24"
+						size="22"
 						active-value="1"
 						inactive-value="0"
 					/>
 					</div>
+					<span class="info3 o-pl-50">{{$t("device.status")}}: </span>
+					<span class="info3 o-pl-10">{{ deviceDetal.inDoor != 1 ? $t("device.close") : $t("device.open") }}</span>
 				</template>
 			</van-field>
 		</div>
@@ -187,6 +187,19 @@
 					display: block;
 				}
 			}
+			
+			.info3 {
+				width: auto;
+				height: 20px;
+				overflow-wrap: break-word;
+				color: rgba(64, 77, 116, 1);
+				font-size: 14px;
+				font-family: PingFangSC-Medium;
+				text-align: left;
+				white-space: nowrap;
+				line-height: 20px;
+				display: block;
+			}
 		}
 	}
 </style>

+ 139 - 52
src/views/device/toDaySugarList.vue

@@ -1,58 +1,145 @@
 <template>
-  <!-- 今日做糖列表 -->
-  <div class="page flex-col">
-    <s-header :name="$t('device.todaysSugarList')" :noback="false"></s-header>
-    <div class="listBox">
-      <div v-for="(item, index) in list" :key="index">
-        {{ item }}
-      </div>
-    </div>
-  </div>
+	<!-- 今日做糖列表 -->
+	<div class="page flex-col">
+		<s-header :name="$t('device.todaysSugarList')" :noback="false"></s-header>
+		<div class="box1 flex-col">
+			<div class="block2 flex-row justify-between">
+				<div class="block3 flex-col"></div>
+				<span class="info2">{{ $t('device.equipmentName') }}:{{ deviceDetal ? deviceDetal.name : '' }}</span>
+			</div>
+			<van-list
+			  class="o-pt-20"
+			  v-model:loading="loading"
+			  :finished="finished"
+			  finished-text="没有更多了"
+			  @load="selectSugarListFun"
+			>
+			  <van-cell v-for="(item, index) in list" :key="index" :title="item" />
+			</van-list>
+		</div>
+	</div>
 </template>
 <script>
-import { onMounted, ref } from "vue";
-import sHeader from "@/components/SimpleHeader";
-import { selectSugarStatus } from "@/service/device";
-import { Toast } from "vant";
-import { getLoginUser } from "@/common/js/utils";
-
-export default {
-  setup() {
-    const user = getLoginUser();
-    const list = ref([]);
-    // 初始化页面获取列表
-    onMounted(async () => {
-      selectSugarStatusFun();
-    });
-
-    // 获取设备列表数据
-    const selectSugarStatusFun = async () => {
-      console.log(user);
-      const { data } = await selectSugarStatus({ adminId: user.id });
-      if (data.code) {
-        list.value = data.data.map((item) => {
-          return item.productName;
-        });
-      } else {
-        Toast.fail(data.message);
-      }
-    };
-
-    return { list };
-  },
-  components: { sHeader },
-};
+	import {
+		onMounted,
+		ref
+	} from "vue";
+	import sHeader from "@/components/SimpleHeader";
+	import {
+		getDeviceDetal,
+		selectSugarList
+	} from "@/service/device";
+	import {
+		Toast
+	} from "vant";
+	import {
+		getLoginUser
+	} from "@/common/js/utils";
+	import {
+		useRoute
+	} from 'vue-router';
+
+
+	export default {
+		setup() {
+			const route = useRoute();
+			const deviceId = route.query.deviceId;
+			const deviceDetal = ref(null);
+			const loading = ref(false);
+			const finished = ref(false);
+			const user = getLoginUser();
+			const list = ref([]);
+			// 初始化页面获取列表
+			onMounted(async () => {
+				getDeviceDetalFun();
+				selectSugarListFun();
+				// console.log(deviceDetal);
+			});
+
+
+			// 获取设备数据
+			const getDeviceDetalFun = async () => {
+				const {
+					data
+				} = await getDeviceDetal({
+					id: deviceId
+				});
+				if (data.code === '00000') {
+					deviceDetal.value = data.data;
+				} else {
+					Toast.fail(data.message);
+				}
+			}
+
+			// 获取做糖列表数据
+			const selectSugarListFun = async () => {
+				// console.log(user);
+				const {
+					data
+				} = await selectSugarList({
+					adminId: user.id
+				});
+				if (data.code) {
+					list.value = data.data.map((item) => {
+						return item.productName;
+					});
+					finished.value = true;
+				} else {
+					Toast.fail(data.message);
+				}
+			};
+
+			return {
+				list,
+				deviceDetal,
+				loading,
+				finished,
+				selectSugarListFun,
+			};
+		},
+		components: {
+			sHeader
+		},
+	};
 </script>
 <style lang="less" scoped>
-@import "../../common/style/common";
-.page {
-  position: relative;
-  width: 375px;
-  height: calc(100vh - 44px);
-  .listBox {
-    font-size: 12px;
-    line-height: 2;
-    text-align: center;
-  }
-}
+	@import "../../common/style/common";
+
+	.page {
+		position: relative;
+		width: 375px;
+		height: calc(100vh - 44px);
+
+		.box1 {
+			width: 100%;
+			height: 237px;
+
+			.block2 {
+				width: 162px;
+				height: 20px;
+				margin: 18px 0 0 15px;
+
+				.block3 {
+		 		background-color: rgba(128, 150, 236, 1);
+					border-radius: 2px;
+					width: 4px;
+					height: 12px;
+					margin-top: 4px;
+				}
+
+				.info2 {
+					width: 150px;
+					height: 20px;
+					overflow-wrap: break-word;
+		 		color: rgba(64, 77, 116, 1);
+					font-size: 14px;
+					font-family: PingFangSC-Medium;
+					text-align: left;
+					white-space: nowrap;
+					line-height: 20px;
+					display: block;
+				}
+			}
+		}
+	}
 </style>