From a9365f3f01a2406f971f999e9b6ff01cdd4b6a55 Mon Sep 17 00:00:00 2001 From: qingyiay <2386314947@qq.com> Date: 星期三, 10 五月 2023 20:33:52 +0800 Subject: [PATCH] 样式修改,引入字体,修改逻辑 --- pages/driver-page/driver-index/bill-of-lading-details/weighingDevice/weighingDevice.vue | 186 +++++++++++++++++++--------------------------- 1 files changed, 78 insertions(+), 108 deletions(-) diff --git a/pages/driver-page/driver-index/bill-of-lading-details/weighingDevice/weighingDevice.vue b/pages/driver-page/driver-index/bill-of-lading-details/weighingDevice/weighingDevice.vue index 96f39bd..0515852 100644 --- a/pages/driver-page/driver-index/bill-of-lading-details/weighingDevice/weighingDevice.vue +++ b/pages/driver-page/driver-index/bill-of-lading-details/weighingDevice/weighingDevice.vue @@ -34,18 +34,22 @@ </view> --> <view class="bottom"><text>TIP:褰撳墠鐘舵�佷负姝e父鏃跺彲浠ョО閲�</text></view> </view> - <view class="middle-block"> + <view class="middle-block" v-if="firstHairCustomernameShow || sideline"> <view class="block-main" v-if="firstHairCustomernameShow"> <view class="first-line"><combined-title title="鍘熷彂淇℃伅"></combined-title></view> <view class="second-line"> - <view class="label-text">鐨噸</view> - <view class="input-container"><u--input placeholder="璇疯緭鍏ョ毊閲�" border="surround" v-model="weighData.coalContactSkin"></u--input></view> - <view class="unit">鍚�</view> + <view class="label-text" :class="{ focusClass: isfocus1 }">鐨噸</view> + <view class="input-container" :class="{ inputClass: isfocus1 }"> + <u--input placeholder="璇疯緭鍏ョ毊閲�" border="surround" v-model="weighData.coalContactSkin" @focus="inputFocus(1)" @blur="inputBlur"></u--input> + </view> + <view class="unit" :class="{ focusClass: isfocus1 }">鍚�</view> </view> <view class="second-line"> - <view class="label-text">姣涢噸</view> - <view class="input-container"><u--input placeholder="璇疯緭鍏ユ瘺閲�" border="surround" v-model="weighData.coalContactHair"></u--input></view> - <view class="unit">鍚�</view> + <view class="label-text" :class="{ focusClass: isfocus2 }">姣涢噸</view> + <view class="input-container" :class="{ inputClass: isfocus2 }"> + <u--input placeholder="璇疯緭鍏ユ瘺閲�" border="surround" v-model="weighData.coalContactHair" @focus="inputFocus(2)" @blur="inputBlur"></u--input> + </view> + <view class="unit" :class="{ focusClass: isfocus2 }">鍚�</view> </view> <view class="second-line"> <view class="label-text">鍑�閲�</view> @@ -53,7 +57,7 @@ <view class="unit">鍚�</view> </view> </view> - <view class="block-sideline" v-else> + <view class="block-sideline" v-if="sideline"> <view class="first-line"><combined-title title="鍘熷彂淇℃伅"></combined-title></view> <view class="weigh-item"> <view class="item"> @@ -71,6 +75,7 @@ </view> </view> </view> + <view v-else style="width: 100%;height: vww(20);"></view> <view class="bottom-block"> <view class="block-main"> <view class="main-information"> @@ -199,8 +204,10 @@ // 澶栬喘绫诲瀷绉伴噸濉啓姣涳紝鐨紝 firstHairCustomernameShow: false, coalContactHair: '', - coalContactSkin: '' - // 浜屾纭 + coalContactSkin: '', + // 鑱氱劍鏃舵敼鍙樻牱寮� + isfocus1: false, + isfocus2: false }; }, watch: { @@ -232,8 +239,11 @@ // 鐩戝惉閲嶉噺鍙樺寲 globalweigh: { handler(v) { - this.weighData.weigh = this.realTimeWeigh = v; - console.log(this.realTimeWeigh, '鐪熷疄閲嶉噺鏀瑰彉浜�'); + // this.weighData.weigh = this.realTimeWeigh = v; + // console.log(this.realTimeWeigh, '鐪熷疄閲嶉噺鏀瑰彉浜�'); + setTimeout(() => { + this.weighData.weigh = this.realTimeWeigh = v; + }, 0); }, deep: true, immediate: true @@ -254,13 +264,14 @@ }, // 鍔犲噺鐓ゆ寜閽鐢ㄤ笌鍚� addAndSubtractCoalDisabled() { - if (this.weighList.orderType == '澶栭攢' || this.weighList.orderType == '鍐呴攢' || this.weighList.orderType == '杞嚭') { - if (this.weighList.hair == 0) { - return true; - } else if (this.weighList.hair != 0) { - return false; - } - } + return this.realTimeWeigh == 0; + // if (this.weighList.orderType == '澶栭攢' || this.weighList.orderType == '鍐呴攢' || this.weighList.orderType == '杞嚭') { + // if (this.weighList.hair == 0) { + // return true; + // } else if (this.weighList.hair != 0) { + // return false; + // } + // } }, // 鏄惁鏀剧┖鎸夐挳绂佺敤 isEvacuation() { @@ -270,6 +281,9 @@ if (this.weighList.orderType == '澶栬喘' || this.weighList.orderType == '鍐呰喘' || this.weighList.orderType == '杞叆') { return this.weighList.hair == this.temporaryWeighObj.skin || this.temporaryWeighObj.skin == this.temporaryWeighObj.hair; } + }, + sideline() { + return this.weighList.orderType == '鍐呰喘' || this.weighList.orderType == '杞嚭'; } }, methods: { @@ -284,6 +298,7 @@ this.weighData.tmId = res.data.id; this.weighData.carNo = res.data.carNo; this.weighData.tmCode = res.data.code; + this.weighData.filedId = res.data.filedId; if (this.weighList.orderType == '澶栬喘' && this.weighList.hair == 0) { this.firstHairCustomernameShow = true; } @@ -351,47 +366,6 @@ } }); }, - /** - * 鍒濆鍖� weoSocket - */ - // initWebSocket() { - // let wsUrl = `${webSocketUrl}?access_token=${uni.getStorageSync('token')}`; - // let socket = uni.connectSocket({ - // url: wsUrl, - // header: { - // CLIENT_TOC: 'Y' - // }, - // complete: res => { - // console.log(res, 'socket缁撴灉'); - // } - // }); - // socket.onOpen(() => { - // console.log('onOpen'); - // }); - // // 鑾峰彇鏈嶅姟鍣ㄤ紶鏉ョ殑鏁版嵁锛屽仛鐩稿簲澶勭悊 - // socket.onMessage(res => { - // console.log('socketWeigh', res); - // let nowWeighObj = JSON.parse(res.data.slice(7)); - // if (nowWeighObj.eqCode == this.weighHouseCode) { - // if (nowWeighObj.eqInfraredStatus) { - // this.infraredStatus = true; - // this.weighData.weigh = this.realTimeWeigh = nowWeighObj.weigh; - // } else { - // this.infraredStatus = false; - // this.weighData.weigh = this.realTimeWeigh = nowWeighObj.weigh; - // } - // } - // }); - // socket.onClose(() => { - // uni.closeSocket(); - // console.log('webSocketClose'); - // this.$u.toast('纾呮埧宸插叧闂�'); - // }); - // socket.onError(err => { - // console.log('socket鎶ラ敊', err); - // this.$u.toast('纾呮埧鏆傛椂涓嶈兘浣跨敤锛岃閲嶆柊杩涘叆璇ラ〉闈紝閲嶈瘯锛侊紒'); - // }); - // }, // 鏀剧┖ evacuation() { this.evacuationModalShow = true; @@ -412,6 +386,19 @@ // 鏀剧┖寮圭獥鍙栨秷 evacuationCancel() { this.evacuationModalShow = false; + }, + // input鑱氱劍 + inputFocus(v) { + if (v == 1) { + this.isfocus1 = true; + } else { + this.isfocus2 = true; + } + }, + // input澶辩劍 + inputBlur() { + this.isfocus1 = false; + this.isfocus2 = false; } } }; @@ -443,11 +430,13 @@ align-items: center; justify-content: center; font-size: 74rpx; - font-family: Determination Sans; font-weight: 400; color: #ffffff; line-height: 69rpx; text-shadow: 0rpx 3rpx 14rpx rgba(0, 0, 0, 0.33); + text { + font-family: weighting; + } } .top_right { display: flex; @@ -455,7 +444,6 @@ justify-content: center; flex: 2; font-size: 31rpx; - font-family: Microsoft YaHei; font-weight: 300; color: #ffffff; view { @@ -472,11 +460,8 @@ align-items: center; flex-direction: column; font-size: 28rpx; - font-family: Microsoft YaHei; font-weight: 300; color: #d9e1fe; - // position: relative; - // top: vww(-10); } } .middle-block { @@ -486,17 +471,28 @@ background: #ffffff; box-shadow: 0rpx 0rpx 14rpx 0rpx rgba(73, 120, 240, 0.14), 0rpx 7rpx 45rpx 0rpx rgba(73, 120, 240, 0.12); border-radius: 20rpx; - @include flex justify-content: center; + @include flex; + justify-content: center; overflow: hidden; .block-main { width: 650rpx; height: 350rpx; - @include flex flex-direction: column; + @include flex; + flex-direction: column; margin-bottom: vww(20); + position: relative; .first-line, .second-line { width: 90%; height: vww(44); + .focusClass { + color: #5b95fd; + } + .inputClass { + border: 1px solid rgba(73, 95, 252, 0.6) !important; + box-shadow: 0rpx 5rpx 13rpx 0rpx rgba(73, 95, 252, 0.6) !important; + border-radius: 12rpx !important; + } .input-container { border: 2px solid #c5c5c5; box-shadow: 0rpx 5rpx 13rpx 0rpx #c5c5c5; @@ -505,6 +501,8 @@ } .first-line { @include flex; + position: relative; + top: vww(8); } .second-line { @include flex; @@ -523,10 +521,9 @@ height: vww(36); @include flex justify-content: space-around; .item { - width: vww(50); + min-width: vww(50); height: vww(45); font-size: 21rpx; - font-family: Microsoft YaHei; font-weight: 400; color: #ffffff; text-align: center; @@ -538,7 +535,6 @@ } .num { font-size: 40rpx; - font-family: Microsoft YaHei; font-weight: 300; color: #303030; } @@ -553,59 +549,33 @@ background: #ffffff; box-shadow: 0rpx 0rpx 14rpx 0rpx rgba(73, 120, 240, 0.14), 0rpx 7rpx 45rpx 0rpx rgba(73, 120, 240, 0.12); border-radius: 20rpx; - @include flex justify-content: center; + @include flex; + justify-content: center; .block-main { width: 94%; height: 565rpx; - margin-top: vww(22); + margin-top: vww(10); @include flex; + justify-content: space-around; align-items: flex-start; flex-direction: column; .main-information { - width: 50%; + width: 100%; height: 28rpx; font-size: 28rpx; - font-family: Microsoft YaHei; font-weight: 300; color: #303030; @include flex; - } - } - } - .two { - flex: 4; - border: vww(2) solid #dddddd; - margin: vww(20); - border-radius: vww(10); - padding: vww(20); - .uni-table { - .uni-table-tr { - padding: 0; - border: vww(1) solid #c6c6c6; - .uni-table-th { - font-size: vww(14); - height: vww(30); - line-height: vww(30); - padding: vww(5) vww(10); - color: #111111; - font-weight: 500; - background: #e2e2e2; + justify-content: flex-start; + .prefix { + min-width: vww(60); } - .uni-table-td { - font-size: vww(14); - font-weight: 400; - height: vww(30); - line-height: vww(30); - padding: vww(5) vww(10); - color: #111111; + .suffix { + flex: 1; + margin-left: vww(12); + text-align: left; } } - } - p { - text-align: center; - font-size: vww(20); - font-weight: 500; - margin-top: vww(5); } } .three { -- Gitblit v1.9.1