From 51c7896fd8e45085dd5cdfff11e79a00ee0a7379 Mon Sep 17 00:00:00 2001 From: Houjie <714924425@qq.com> Date: 星期五, 05 九月 2025 15:16:54 +0800 Subject: [PATCH] 上料/下料、报工/打印机配置/产线选择 、排产工单 --- pages/login/login.vue | 848 ++++++++++++++++++++++++++++++++++--------------------- 1 files changed, 524 insertions(+), 324 deletions(-) diff --git a/pages/login/login.vue b/pages/login/login.vue index 5980f18..37cdb4b 100644 --- a/pages/login/login.vue +++ b/pages/login/login.vue @@ -1,343 +1,543 @@ - <template> - <view class="zai-box"> - <scroll-view scroll-y class="page"> - <view class="text-center" :style="[{animation: 'show ' + 0.4+ 's 1'}]"> - <image src="/static/logo-lx.png" mode='aspectFit' class="zai-logo "></image> - <view class="zai-title text-shadow ">璁惧绠$悊 </view> - </view> - <view class="box padding-lr-xl login-paddingtop" :style="[{animation: 'show ' + 0.6+ 's 1'}]"> - <block v-if="loginWay==1"> - <view class="cu-form-group margin-top shadow-warp" :class="[shape=='round'?'round':'']"> - <view class="title"><text class="cuIcon-people margin-right-xs"></text>璐﹀彿:</view> - <input placeholder="璇疯緭鍏ヨ处鍙�" name="input" v-model="userName"></input> - </view> - <view class="cu-form-group margin-top shadow-warp" :class="[shape=='round'?'round':'']"> - <view class="title"><text class="cuIcon-lock margin-right-xs"></text>瀵嗙爜:</view> - <input class="uni-input" placeholder="璇疯緭鍏ュ瘑鐮�" :password="!showPassword" v-model="password" /> - <view class="action text-lg"> - <text :class="[showPassword ? 'cuIcon-attention' : 'cuIcon-attentionforbid']" - @click="changePassword"></text> - </view> - </view> - <view class="padding text-center margin-top"> - <button class="cu-btn bg-blue lg margin-right shadow" :loading="loading" - :class="[shape=='round'?'round':'']" @tap="onLogin"><text - space="emsp">{{loading ? "鐧诲綍涓�...":" 鐧诲綍 "}}</text> - </button> - <!-- <button class="cu-btn line-blue lg margin-left shadow" :loading="loading" :class="[shape=='round'?'round':'']" - @tap="loginWay=3-loginWay">鐭俊鐧诲綍 - </button> --> - </view> - </block> - <block v-else> - <view class="cu-form-group margin-top shadow-warp" :class="[shape=='round'?'round':'']"> - <view class="title"><text class="cuIcon-mobile margin-right-xs"></text>鎵嬫満鍙�:</view> - <input placeholder="璇疯緭鍏ユ墜鏈哄彿" type="number" maxlength="11" v-model="phoneNo"></input> - </view> - <view class="cu-form-group margin-top shadow-warp" :class="[shape=='round'?'round':'']"> - <view class="title"><text class="cuIcon-lock margin-right-xs"></text>楠岃瘉鐮�:</view> - <input class="uni-input" placeholder="璇疯緭鍏ラ獙璇佺爜" v-model="smsCode" /> - <view class="action"> - <button class="cu-btn line-blue sm" :disabled="!isSendSMSEnable" @click="onSMSSend"> - {{ getSendBtnText }}</button> - </view> - </view> - <view class="padding text-center margin-top"> - <button class="cu-btn bg-blue lg margin-right shadow" :loading="loading" - :class="[shape=='round'?'round':'']" @tap="onSMSLogin"><text - space="emsp">{{loading ? "鐧诲綍涓�...":" 鐧诲綍 "}}</text> - </button> - <button class="cu-btn line-blue lg margin-left shadow" :loading="loading" - :class="[shape=='round'?'round':'']" @tap="loginWay=1">璐︽埛鐧诲綍 - </button> - </view> - </block> +<template> + <view class="zai-box"> + <scroll-view scroll-y class="page"> + <view class="text-center" :style="[{animation: 'show ' + 0.4+ 's 1'}]"> + <image src="/static/logo-lx.png" mode='aspectFit' class="zai-logo "></image> + <view class="zai-title text-shadow ">璁惧绠$悊 </view> + </view> + <view class="box padding-lr-xl login-paddingtop" :style="[{animation: 'show ' + 0.6+ 's 1'}]"> + <block v-if="loginWay==1"> + <view class="cu-form-group margin-top shadow-warp" :class="[shape=='round'?'round':'']"> + <view class="title"><text class="cuIcon-people margin-right-xs"></text>璐﹀彿:</view> + <input placeholder="璇疯緭鍏ヨ处鍙�" name="input" v-model="userName"></input> + </view> + <view class="cu-form-group margin-top shadow-warp" :class="[shape=='round'?'round':'']"> + <view class="title"><text class="cuIcon-lock margin-right-xs"></text>瀵嗙爜:</view> + <input class="uni-input" placeholder="璇疯緭鍏ュ瘑鐮�" :password="!showPassword" v-model="password" /> + <view class="action text-lg"> + <text :class="[showPassword ? 'cuIcon-attention' : 'cuIcon-attentionforbid']" + @click="changePassword"></text> + </view> + </view> + <view class="padding text-center margin-top"> + <button class="cu-btn bg-blue lg margin-right shadow" :loading="loading" + :class="[shape=='round'?'round':'']" @tap="onLogin"><text + space="emsp">{{loading ? "鐧诲綍涓�...":" 鐧诲綍 "}}</text> + </button> + </view> + </block> + <block v-else> + <view class="cu-form-group margin-top shadow-warp" :class="[shape=='round'?'round':'']"> + <view class="title"><text class="cuIcon-mobile margin-right-xs"></text>鎵嬫満鍙�:</view> + <input placeholder="璇疯緭鍏ユ墜鏈哄彿" type="number" maxlength="11" v-model="phoneNo"></input> + </view> + <view class="cu-form-group margin-top shadow-warp" :class="[shape=='round'?'round':'']"> + <view class="title"><text class="cuIcon-lock margin-right-xs"></text>楠岃瘉鐮�:</view> + <input class="uni-input" placeholder="璇疯緭鍏ラ獙璇佺爜" v-model="smsCode" /> + <view class="action"> + <button class="cu-btn line-blue sm" :disabled="!isSendSMSEnable" @click="onSMSSend"> + {{ getSendBtnText }}</button> + </view> + </view> + <view class="padding text-center margin-top"> + <button class="cu-btn bg-blue lg margin-right shadow" :loading="loading" + :class="[shape=='round'?'round':'']" @tap="onSMSLogin"><text + space="emsp">{{loading ? "鐧诲綍涓�...":" 鐧诲綍 "}}</text> + </button> + <button class="cu-btn line-blue lg margin-left shadow" :loading="loading" + :class="[shape=='round'?'round':'']" @tap="loginWay=1">璐︽埛鐧诲綍 + </button> + </view> + </block> - <!-- #ifdef APP-PLUS --> - <view class="padding flex flex-direction text-center"> - 褰撳墠鐗堟湰:{{version}} - </view> - <!-- #endif --> + <!-- #ifdef APP-PLUS --> + <view class="padding flex flex-direction text-center"> + 褰撳墠鐗堟湰:{{version}} + </view> + <!-- #endif --> - </view> - </scroll-view> - <!-- 鐧诲綍鍔犺浇寮圭獥 --> - <view class="cu-load load-modal" v-if="loading"> - <!-- <view class="cuIcon-emojifill text-orange"></view> --> - <image src="/static/logo-lx.png" mode="aspectFit" class="round"></image> - <view class="gray-text">鐧诲綍涓�...</view> - </view> - </view> + </view> + </scroll-view> + <!-- 鐧诲綍鍔犺浇寮圭獥 --> + <view class="cu-load load-modal" v-if="loading"> + <image src="/static/logo-lx.png" mode="aspectFit" class="round"></image> + <view class="gray-text">鐧诲綍涓�...</view> + </view> - </template> + <!-- 浜х嚎閫夋嫨寮圭獥 - 浠庡簳閮ㄥ脊鍑� --> + <view class="line-modal-mask" v-if="showLineModal" @click="closeLineModal"></view> + <view class="line-modal" v-if="showLineModal" :class="{ 'line-modal-active': showLineModal }"> + <view class="line-modal-header"> + <view class="line-modal-title">閫夋嫨浜х嚎</view> + <text class="cuIcon-close" @click="closeLineModal"></text> + </view> + <view class="line-modal-content"> + <view v-if="lineLoading" class="loading-view"> + <view class="cu-load"></view> + <view class="text-gray">鍔犺浇浜х嚎涓�...</view> + </view> + <view v-else-if="lineList.length === 0" class="empty-view"> + <text class="cuIcon-meh text-gray text-xl"></text> + <view class="text-gray">鏆傛棤鍙敤浜х嚎</view> + </view> + <view class="line-item" v-for="(line, index) in lineList" :key="line.id" @click="selectLine(line)" + :class="{ 'line-item-selected': selectedLineId === line.id }"> + <view class="line-name">{{ line.name }}</view> + <text class="cuIcon-check text-blue" v-if="selectedLineId === line.id"></text> + </view> + </view> + <view class="line-modal-footer"> + <button class="cu-btn bg-blue lg" @click="confirmLineSelection" :disabled="!selectedLineId"> + 纭閫夋嫨 + </button> + </view> + </view> + </view> +</template> - <script> - import { - ACCESS_TOKEN, - USER_NAME, - USER_INFO - } from "@/common/util/constants" - import { - mapActions - } from "vuex" - import configService from '@/common/service/config.service.js'; +<script> + import { + ACCESS_TOKEN, + USER_NAME, + USER_INFO + } from "@/common/util/constants" + import { + mapActions, + mapState, + mapGetters + } from "vuex" // 鏂板mapGetters + import configService from '@/common/service/config.service.js'; - export default { - data() { - return { - shape: '', //round 鍦嗗舰 - loading: false, - userName: '', - password: '', - phoneNo: '', - smsCode: '', - showPassword: false, //鏄惁鏄剧ず鏄庢枃 - loginWay: 1, //1: 璐﹀瘑锛�2锛氶獙璇佺爜 - smsCountDown: 0, - smsCountInterval: null, - toggleDelay: false, - version: '', - //绗笁鏂圭櫥褰曠浉鍏充俊鎭� - thirdType: "", - thirdLoginInfo: "", - thirdLoginState: false, - bindingPhoneModal: false, - thirdUserUuid: '', - id: '', - url: { - bindingThirdPhone: '/sys/thirdLogin/bindingThirdPhone' - } - }; - }, - onLoad: function(options) { - this.id = options.id; - // #ifdef APP-PLUS - var that = this - plus.runtime.getProperty(plus.runtime.appid, function(wgtinfo) { - that.version = wgtinfo.version - }); - // #endif - }, - computed: { - isSendSMSEnable() { - return this.smsCountDown <= 0 && this.phoneNo.length > 4; - }, - getSendBtnText() { - if (this.smsCountDown > 0) { - return this.smsCountDown + '绉掑悗鍙戦��'; - } else { - return '鍙戦�侀獙璇佺爜'; - } - }, - canSMSLogin() { - return this.userName.length > 4 && this.smsCode.length > 4; - }, - canPwdLogin() { - return this.userName.length > 4 && this.password.length > 4; - }, - }, - methods: { - ...mapActions(["mLogin", "PhoneLogin", "ThirdLogin"]), - onLogin: function() { - if (!this.userName || this.userName.length == 0) { - this.$tip.toast('璇峰~鍐欑敤鎴峰悕'); - return; - } - if (!this.password || this.password.length == 0) { - this.$tip.toast('璇峰~鍐欏瘑鐮�'); - return; - } - let loginParams = { - username: this.userName, - password: this.password - } - this.loading = true; - this.mLogin(loginParams).then((res) => { - this.loading = false; - if (res.data.success) { - // #ifdef APP-PLUS - this.saveClientId() - // #endif - // #ifndef APP-PLUS - this.$tip.success('鐧诲綍鎴愬姛!') - this.$Router.replaceAll({ - name: 'index' - }) - // if (this.id) { - // uni.navigateTo({ - // url: `/pages/device/deviceWebDeils/deviceWebDeils?equipmentId=${this.id}` - // }); + export default { + data() { + return { + shape: '', //round 鍦嗗舰 + loading: false, + userName: '', + password: '', + phoneNo: '', + smsCode: '', + showPassword: false, //鏄惁鏄剧ず鏄庢枃 + loginWay: 1, //1: 璐﹀瘑锛�2锛氶獙璇佺爜 + smsCountDown: 0, + smsCountInterval: null, + toggleDelay: false, + version: '', + //绗笁鏂圭櫥褰曠浉鍏充俊鎭� + thirdType: "", + thirdLoginInfo: "", + thirdLoginState: false, + bindingPhoneModal: false, + thirdUserUuid: '', + id: '', + url: { + bindingThirdPhone: '/sys/thirdLogin/bindingThirdPhone' + }, + // 浜х嚎閫夋嫨鐩稿叧 + showLineModal: false, // 浜х嚎寮圭獥鏄惁鏄剧ず + lineList: [], // 浜х嚎鍒楄〃 + selectedLineId: null, // 褰撳墠閫変腑鐨勪骇绾縄D + lineLoading: false // 浜х嚎鍔犺浇鐘舵�� + }; + }, + computed: { + ...mapState(['currentLineId']), + ...mapGetters(['currentLineName']), // 鏂板锛氳幏鍙栧綋鍓嶄骇绾垮悕绉帮紙鐢ㄤ簬楠岃瘉锛� + isSendSMSEnable() { + return this.smsCountDown <= 0 && this.phoneNo.length > 4; + }, + getSendBtnText() { + if (this.smsCountDown > 0) { + return this.smsCountDown + '绉掑悗鍙戦��'; + } else { + return '鍙戦�侀獙璇佺爜'; + } + }, + canSMSLogin() { + return this.userName.length > 4 && this.smsCode.length > 4; + }, + canPwdLogin() { + return this.userName.length > 4 && this.password.length > 4; + }, + }, + onLoad: function(options) { + this.id = options.id; + // #ifdef APP-PLUS + var that = this + plus.runtime.getProperty(plus.runtime.appid, function(wgtinfo) { + that.version = wgtinfo.version + }); + // #endif + }, + methods: { + ...mapActions(["mLogin", "PhoneLogin", "ThirdLogin", "fetchLineList", "setCurrentLine"]), - // } else { - // this.$tip.success('鐧诲綍鎴愬姛!') - // this.$Router.replaceAll({ - // name: 'index' - // }) - // } + onLogin: function() { + if (!this.userName || this.userName.length == 0) { + this.$tip.toast('璇峰~鍐欑敤鎴峰悕'); + return; + } + if (!this.password || this.password.length == 0) { + this.$tip.toast('璇峰~鍐欏瘑鐮�'); + return; + } + let loginParams = { + username: this.userName, + password: this.password + } + this.loading = true; + this.mLogin(loginParams).then((res) => { + this.loading = false; + if (res.data.success) { + console.log('璐﹀彿鐧诲綍鎴愬姛锛屽噯澶囧鐞嗕骇绾块�夋嫨'); + // #ifdef APP-PLUS + this.saveClientId() + // #endif + // #ifndef APP-PLUS + this.handleLoginSuccess() + // #endif + } else { + this.$tip.alert(res.data.message); + } + }).catch((err) => { + let msg = err.data.message || "璇锋眰鍑虹幇閿欒锛岃绋嶅悗鍐嶈瘯" + this.loading = false; + this.$tip.alert(msg); + }).finally(() => { + this.loading = false; + }) + }, + saveClientId() { + var info = plus.push.getClientInfo(); + var cid = info.clientid; + this.$http.get("/sys/user/saveClientId", { + params: { + clientId: cid + } + }).then(res => { + console.log("res::saveClientId>", res) + this.handleLoginSuccess(); + }).catch(err => { + console.error('淇濆瓨clientId澶辫触:', err); + this.handleLoginSuccess(); + }) + }, - // #endif - } else { - this.$tip.alert(res.data.message); - } - }).catch((err) => { - let msg = err.data.message || "璇锋眰鍑虹幇閿欒锛岃绋嶅悗鍐嶈瘯" - this.loading = false; - this.$tip.alert(msg); - }).finally(() => { - this.loading = false; - }) - }, - saveClientId() { - var info = plus.push.getClientInfo(); - var cid = info.clientid; - this.$http.get("/sys/user/saveClientId", { - params: { - clientId: cid - } - }).then(res => { - console.log("res::saveClientId>", res) - this.$tip.success('鐧诲綍鎴愬姛!') - this.$Router.replaceAll({ - name: 'index' - }) - }) - }, - changePassword() { - this.showPassword = !this.showPassword; - }, - onSMSSend() { - let smsParams = {}; - smsParams.mobile = this.phoneNo; - smsParams.smsmode = "0"; - let checkPhone = new RegExp(/^[1]([3-9])[0-9]{9}$/); - if (!smsParams.mobile || smsParams.mobile.length == 0) { - this.$tip.toast('璇疯緭鍏ユ墜鏈哄彿'); - return false - } - if (!checkPhone.test(smsParams.mobile)) { - this.$tip.toast('璇疯緭鍏ユ纭殑鎵嬫満鍙�'); - return false - } - this.$http.post("/sys/sms", smsParams).then(res => { - if (res.data.success) { - this.smsCountDown = 60; - this.startSMSTimer(); - } else { - this.smsCountDown = 0; - this.$tip.toast(res.data.message); - } - }); - }, - startSMSTimer() { - this.smsCountInterval = setInterval(() => { - this.smsCountDown--; - if (this.smsCountDown <= 0) { - clearInterval(this.smsCountInterval); - } - }, 1000); - }, - onSMSLogin() { - let checkPhone = new RegExp(/^[1]([3-9])[0-9]{9}$/); + changePassword() { + this.showPassword = !this.showPassword; + }, - if (!this.phoneNo || this.phoneNo.length == 0) { - this.$tip.toast('璇峰~鍐欐墜鏈哄彿'); - return; - } - if (!checkPhone.test(this.phoneNo)) { - this.$tip.toast('璇疯緭鍏ユ纭殑鎵嬫満鍙�'); - return false - } - if (!this.smsCode || this.smsCode.length == 0) { - this.$tip.toast('璇峰~鐭俊楠岃瘉鐮�'); - return; - } - let loginParams = { - mobile: this.phoneNo, - captcha: this.smsCode - }; - this.PhoneLogin(loginParams).then((res) => { - console.log("res====銆�", res) - if (res.data.success) { - this.$tip.success('鐧诲綍鎴愬姛!') - this.$Router.replaceAll({ - name: 'index' - }) - } else { - this.$tip.error(res.data.message); - } - }).catch((err) => { - let msg = ((err.response || {}).data || {}).message || err.data.message || "璇锋眰鍑虹幇閿欒锛岃绋嶅悗鍐嶈瘯" - this.$tip.error(msg); - }); - }, - loginSuccess() { - // 鐧婚檰鎴愬姛锛岄噸瀹氬悜鍒颁富椤� - this.$Router.replace({ - name: 'index' - }) - }, - requestFailed(err) { - this.$message.warning("鐧诲綍澶辫触") - }, - }, - beforeDestroy() { - if (this.smsCountInterval) { - clearInterval(this.smsCountInterval); - } - }, - } - </script> + onSMSSend() { + let smsParams = {}; + smsParams.mobile = this.phoneNo; + smsParams.smsmode = "0"; + let checkPhone = new RegExp(/^[1]([3-9])[0-9]{9}$/); + if (!smsParams.mobile || smsParams.mobile.length == 0) { + this.$tip.toast('璇疯緭鍏ユ墜鏈哄彿'); + return false + } + if (!checkPhone.test(smsParams.mobile)) { + this.$tip.toast('璇疯緭鍏ユ纭殑鎵嬫満鍙�'); + return false + } + this.$http.post("/sys/sms", smsParams).then(res => { + if (res.data.success) { + this.smsCountDown = 60; + this.startSMSTimer(); + } else { + this.smsCountDown = 0; + this.$tip.toast(res.data.message); + } + }); + }, - <style> - .login-paddingtop { - padding-top: 100upx; - } + startSMSTimer() { + this.smsCountInterval = setInterval(() => { + this.smsCountDown--; + if (this.smsCountDown <= 0) { + clearInterval(this.smsCountInterval); + } + }, 1000); + }, - .zai-box { - padding: 0 20upx; - padding-top: 100upx; - position: relative; - } + onSMSLogin() { + let checkPhone = new RegExp(/^[1]([3-9])[0-9]{9}$/); - .zai-logo { - width: 200upx; - height: 150px; - } + if (!this.phoneNo || this.phoneNo.length == 0) { + this.$tip.toast('璇峰~鍐欐墜鏈哄彿'); + return; + } + if (!checkPhone.test(this.phoneNo)) { + this.$tip.toast('璇疯緭鍏ユ纭殑鎵嬫満鍙�'); + return false + } + if (!this.smsCode || this.smsCode.length == 0) { + this.$tip.toast('璇峰~鐭俊楠岃瘉鐮�'); + return; + } + let loginParams = { + mobile: this.phoneNo, + captcha: this.smsCode + }; + this.PhoneLogin(loginParams).then((res) => { + console.log("鐭俊鐧诲綍鎴愬姛锛屽噯澶囧鐞嗕骇绾块�夋嫨"); + if (res.data.success) { + this.handleLoginSuccess(); + } else { + this.$tip.error(res.data.message); + } + }).catch((err) => { + let msg = ((err.response || {}).data || {}).message || err.data.message || "璇锋眰鍑虹幇閿欒锛岃绋嶅悗鍐嶈瘯" + this.$tip.error(msg); + }); + }, - .zai-title { - font-size: 58upx; - color: #000000; - text-align: center; - } + // 鐧诲綍鎴愬姛鍚庣殑澶勭悊 + handleLoginSuccess() { + console.log('杩涘叆handleLoginSuccess鏂规硶'); + this.$tip.success('鐧诲綍鎴愬姛!'); - .input-placeholder, - .zai-input { - color: #94afce; - } + // 妫�鏌ユ槸鍚﹀凡鏈変繚瀛樼殑浜х嚎锛堝寘鍚獻D鍜屽悕绉帮級 + const savedLineId = uni.getStorageSync('currentLineId'); + const savedLineName = uni.getStorageSync('currentLineName'); + console.log('鏈湴瀛樺偍鐨勪骇绾縄D:', savedLineId, '鍚嶇О:', savedLineName); - .zai-label { - padding: 60upx 0; - text-align: center; - font-size: 30upx; - color: #a7b6d0; - } + if (savedLineId && savedLineName) { + // 宸叉湁瀹屾暣鐨勪骇绾夸俊鎭紝鐩存帴杩涘叆棣栭〉 + console.log('宸叉湁淇濆瓨鐨勪骇绾匡紝鐩存帴杩涘叆棣栭〉'); + this.navigateToHome(); + } else { + // 鏃犱繚瀛樼殑浜х嚎锛岃幏鍙栦骇绾垮垪琛ㄥ苟鏄剧ず寮圭獥 + console.log('鏃犱繚瀛樼殑浜х嚎锛屽噯澶囪幏鍙栦骇绾垮垪琛�'); + this.getLineListAndShowModal(); + } + }, - .zai-btn { - background: #ff65a3; - color: #fff; - border: 0; - border-radius: 100upx; - font-size: 36upx; - } + // 鑾峰彇浜х嚎鍒楄〃骞舵樉绀哄脊绐� + getLineListAndShowModal() { + console.log('杩涘叆getLineListAndShowModal鏂规硶'); + this.lineLoading = true; + this.lineList = []; + this.selectedLineId = null; - .zai-btn:after { - border: 0; - } + // 璋冪敤Vuex action鑾峰彇浜х嚎鍒楄〃 + this.fetchLineList().then(lineList => { + console.log('鑾峰彇浜х嚎鍒楄〃鎴愬姛:', lineList); + this.lineList = lineList || []; + this.lineLoading = false; - /*鎸夐挳鐐瑰嚮鏁堟灉*/ - .zai-btn.button-hover { - transform: translate(1upx, 1upx); - } - </style> \ No newline at end of file + // 濡傛灉鏈変骇绾匡紝榛樿閫変腑绗竴鏉″苟鏄剧ず寮圭獥 + if (this.lineList.length > 0) { + this.selectedLineId = this.lineList[0].id; + this.showLineModal = true; + console.log('浜х嚎鍒楄〃涓嶄负绌猴紝鏄剧ず寮圭獥'); + } else { + console.log('浜х嚎鍒楄〃涓虹┖锛屼笉鏄剧ず寮圭獥'); + this.$tip.toast('鏈幏鍙栧埌浜х嚎鏁版嵁锛岃鑱旂郴绠$悊鍛�'); + this.navigateToHome(); + } + }).catch(err => { + console.error('鑾峰彇浜х嚎鍒楄〃澶辫触:', err); + this.lineLoading = false; + this.$tip.toast('鑾峰彇浜х嚎鍒楄〃澶辫触锛岃閲嶈瘯'); + + // 3绉掑悗閲嶈瘯 + setTimeout(() => { + this.getLineListAndShowModal(); + }, 3000); + }); + }, + + // 閫夋嫨浜х嚎 + selectLine(line) { + console.log('閫変腑鐨勪骇绾�:', line.id, line.name); // 鎵撳嵃閫変腑鐨勪骇绾垮悕绉� + this.selectedLineId = line.id; + }, + + // 纭閫夋嫨浜х嚎锛堣Е鍙慥uex淇濆瓨ID鍜屽悕绉帮級 + confirmLineSelection() { + if (!this.selectedLineId) return; + + // 璋冪敤setCurrentLine锛孷uex浼氳嚜鍔ㄥ悓姝ュ悕绉� + this.setCurrentLine(this.selectedLineId).then(() => { + console.log('浜х嚎閫夋嫨鎴愬姛锛孖D:', this.selectedLineId, '鍚嶇О:', this.currentLineName); + this.showLineModal = false; + this.navigateToHome(); + }); + }, + + // 鍏抽棴浜х嚎閫夋嫨寮圭獥 + closeLineModal() { + this.showLineModal = false; + }, + + // 璺宠浆鍒伴椤� + navigateToHome() { + this.$Router.replaceAll({ + name: 'index' + }); + + }, + + loginSuccess() { + this.$Router.replace({ + name: 'index' + }) + }, + + requestFailed(err) { + this.$message.warning("鐧诲綍澶辫触") + }, + }, + beforeDestroy() { + if (this.smsCountInterval) { + clearInterval(this.smsCountInterval); + } + } + } +</script> + +<style> + /* 鍘熸湁鏍峰紡淇濇寔涓嶅彉 */ + .login-paddingtop { + padding-top: 100upx; + } + + .zai-box { + padding: 0 20upx; + padding-top: 100upx; + position: relative; + } + + .zai-logo { + width: 200upx; + height: 150px; + } + + .zai-title { + font-size: 58upx; + color: #000000; + text-align: center; + } + + .input-placeholder, + .zai-input { + color: #94afce; + } + + .zai-label { + padding: 60upx 0; + text-align: center; + font-size: 30upx; + color: #a7b6d0; + } + + .zai-btn { + background: #ff65a3; + color: #fff; + border: 0; + border-radius: 100upx; + font-size: 36upx; + } + + .zai-btn:after { + border: 0; + } + + .zai-btn.button-hover { + transform: translate(1upx, 1upx); + } + + /* 浜х嚎閫夋嫨寮圭獥鏍峰紡 */ + .line-modal-mask { + position: fixed; + top: 0; + left: 0; + right: 0; + bottom: 0; + background-color: rgba(0, 0, 0, 0.5); + z-index: 998; + opacity: 0; + transition: opacity 0.3s ease; + } + + .line-modal { + position: fixed; + left: 0; + right: 0; + bottom: -100%; + background-color: #fff; + border-top-left-radius: 20upx; + border-top-right-radius: 20upx; + z-index: 999; + transition: bottom 0.3s ease; + max-height: 80vh; + } + + .line-modal-active { + bottom: 0; + } + + .line-modal-active+.line-modal-mask { + opacity: 1; + } + + .line-modal-header { + display: flex; + justify-content: space-between; + align-items: center; + padding: 20upx 30upx; + border-bottom: 1px solid #eee; + } + + .line-modal-title { + font-size: 34upx; + font-weight: bold; + } + + .line-modal-content { + padding: 20upx; + overflow-y: auto; + max-height: calc(80vh - 180upx); + } + + .line-item { + display: flex; + justify-content: space-between; + align-items: center; + padding: 25upx 20upx; + border-bottom: 1px solid #f5f5f5; + font-size: 30upx; + } + + .line-item-selected { + background-color: #f0f7ff; + } + + .line-item:last-child { + border-bottom: none; + } + + .line-modal-footer { + padding: 20upx 30upx; + border-top: 1px solid #eee; + } + + .loading-view { + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + padding: 60upx 0; + } + + .empty-view { + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + padding: 60upx 0; + } +</style> \ No newline at end of file -- Gitblit v1.9.3