Browse Source

登录优化

shish 6 months ago
parent
commit
4301ed8d50

+ 8 - 10
ghsApp/src/admin/home/login.vue

@@ -4,9 +4,9 @@
 			<view class="experFrame">
 			<view>
 				<view style="text-align:center;margin-bottom:10upx;">
-				<image :src="`${constant.imgUrl}/logo3.png`" class="logo" mode="widthFix"></image> 
+					<image :src="`${constant.imgUrl}/logo3.png`" class="logo" mode="widthFix"></image> 
 				</view>
-				<view style="color:#666666;text-align:center;margin-bottom:50upx;font-size:35upx;">销花宝</view>
+				<view style="color:#666666;text-align:center;margin-bottom:30upx;margin-top:10upx;font-size:35upx;">销花宝</view>
 
 				<template v-if="showAccountLogin">
 					<view>
@@ -15,7 +15,7 @@
 					<view>
 						<input @focus="password=''" v-model="password" class="experInput" placeholder="密码" type="password" />
 					</view>
-					<view style="margin-top:40upx;">
+					<view style="margin-top:20upx;">
 						<button class="admin-button-com small blue buttonText" @click="loginFun">登陆</button>
 					</view>
 				</template>
@@ -34,10 +34,9 @@
 				<button class="admin-button-com small blue buttonText" @click="mobileLogin()">本机号码一键登录</button>
 				</view>
 				<!-- #endif -->
-				<!-- #ifdef APP-PLUS -->
 				<view style="color:#999999;font-size:25upx;margin-top:55upx;">
 					<checkbox-group @change="agreeItem">
-						<label>
+						<label style="display:flex;align-items:center;justify-content:center;">
 							<checkbox value="1" style="transform:scale(0.8)" :checked="agree == 1" />
 							<text>
 								我已阅读并同意
@@ -48,8 +47,7 @@
 						</label>
 					</checkbox-group>
 				</view>
-				<!-- #endif -->
-				<view style="margin-top:80upx;color:#999999;width:86vw;font-size:35upx;">
+				<view style="margin-top:30upx;color:#999999;width:86vw;font-size:35upx;" v-if="showAccountLogin==false">
 					<text style="float:right;margin-right:35upx;" @click="useAccount()">使用账号密码登录</text>
 				</view>
 			</view>
@@ -126,10 +124,10 @@ export default {
 			this.$forceUpdate()
 		},
 		goToService(){
-			plus.runtime.openURL('http://www.wixhb.com/main/xhb-register')
+			this.$util.pageTo({ url: "/admin/home/register"})
 		},
 		goToPrivacy(){
-			plus.runtime.openURL('http://www.wixhb.com/main/xhb-privacy')
+			this.$util.pageTo({ url: "/admin/home/privacy"})
 		},
 		agreeItem(e){
 			let arr = e.target.value
@@ -426,7 +424,7 @@ export default {
         height:90upx;
       }
       .logo{
-        width:180upx;
+        width:160upx;
         margin:0 auto;
       }
   }

+ 83 - 17
ghsApp/src/admin/home/privacy.vue

@@ -1,10 +1,20 @@
 <template>
-	<view style="font-size:30upx;">
-        <view style="padding:0upx 8upx 30upx 8upx">
-        <view v-for="(item, index) in itemData" :key="index">
-            <view :class="[item.gap == 2 ? 'hasGap':'noGap',item.bold == 2 ? 'hasBold':'noBold']">{{item.content}}</view>
-        </view>
-        </view>
+	<view class="privacy-container">
+		<view class="privacy-content" v-if="parsedItems.length > 0">
+			<view 
+				v-for="(item, index) in parsedItems" 
+				:key="index"
+				:class="{
+					'privacy-item': true,
+					'hasBold': item.bold === 2,
+					'noBold': item.bold !== 2,
+					'hasGap': item.gap === 2,
+					'noGap': item.gap !== 2
+				}"
+			>
+				{{ item.content }}
+			</view>
+		</view>
 	</view>
 </template>
 <script>
@@ -15,34 +25,90 @@ export default {
 	mixins: [],
 	data() {
 		return {
-            itemData:[]
+            html: '',
+            parsedItems: []
 		}
 	},
 	computed: {
 	},
 	onLoad(){
         getPrivacyAgreement().then(res=>{
-			console.log(res)
             if(res.code == 1){
-                this.itemData = res.data.html
+                this.html = res.data.html
+                this.parsePrivacyHtml(this.html)
             }
         })
 	},
 	methods: {
+		init(){
+
+		},
+		// 拆解后端返回的隐私协议HTML字符串
+		parsePrivacyHtml(htmlStr) {
+			
+			// 按换行符拆解字符串
+			const arr = htmlStr.split('\n')
+				.map(item => item.trim())
+				.filter(item => item !== '');
+			
+			// 移除重复项
+			const uniqueArr = Array.from(new Set(arr));
+			
+			// 处理每一项,提取样式标记和内容
+			const newItems = [];
+			uniqueArr.forEach(item => {
+				const current = {};
+				
+				// 检查 _@@_ 标记(间距)
+				if (item.indexOf('_@@_') !== -1) {
+					current.gap = 2;
+				}
+				
+				// 检查 _BB_ 标记(粗体)
+				if (item.indexOf('_BB_') !== -1) {
+					current.bold = 2;
+				}
+				
+				// 移除标记符,保留内容
+				let content = item.replace(/_BB_/g, '');
+				content = content.replace(/_@@_/g, '');
+				current.content = content;
+				
+				newItems.push(current);
+			});
+			
+			this.parsedItems = newItems;
+		},
     }
 };
 </script>
 <style lang="scss" scoped>
-.hasGap{
-	margin-top:49upx;
+.privacy-container {
+	padding: 30upx 30upx 30upx 30upx;
+	font-size: 30upx;
 }
-.hasBold{
-	font-weight:bold;
+
+.privacy-content {
+	line-height: 1.6;
 }
-.noGap{
-	margin-top:0upx;
+
+.privacy-item {
+	padding: 15upx 0;
 }
-.noBold{
-	font-weight:normal;
+
+.hasGap {
+	margin-top: 40upx;
+}
+
+.hasBold {
+	font-weight: bold;
+}
+
+.noGap {
+	margin-top: 0upx;
+}
+
+.noBold {
+	font-weight: normal;
 }
 </style>

+ 39 - 1
ghsApp/src/admin/home/register.vue

@@ -24,11 +24,49 @@ export default {
         getRegisterAgreement().then(res=>{
 			console.log(res)
             if(res.code == 1){
-                this.itemData = res.data.html
+                this.parseAgreementHtml(res.data.html)
             }
         })
 	},
 	methods: {
+		init(){
+
+		},
+		// 拆解后端返回的注册协议HTML字符串
+		parseAgreementHtml(htmlStr) {
+			// 按换行符拆解字符串
+			const arr = htmlStr.split('\n')
+				.map(item => item.trim())
+				.filter(item => item !== '');
+			
+			// 移除重复项
+			const uniqueArr = Array.from(new Set(arr));
+			
+			// 处理每一项,提取样式标记和内容
+			const newItems = [];
+			uniqueArr.forEach(item => {
+				const current = {};
+				
+				// 检查 _@@_ 标记(间距)
+				if (item.indexOf('_@@_') !== -1) {
+					current.gap = 2;
+				}
+				
+				// 检查 _BB_ 标记(粗体)
+				if (item.indexOf('_BB_') !== -1) {
+					current.bold = 2;
+				}
+				
+				// 移除标记符,保留内容
+				let content = item.replace(/_BB_/g, '');
+				content = content.replace(/_@@_/g, '');
+				current.content = content;
+				
+				newItems.push(current);
+			});
+			
+			this.itemData = newItems;
+		}
     }
 };
 </script>

+ 15 - 17
hdApp/src/admin/home/login.vue

@@ -6,19 +6,19 @@
 				<view style="text-align:center;margin-bottom:20upx;">
 				<image :src="`${constant.imgUrl}/logo4.png`" class="logo" mode="widthFix"></image>
 				</view>
-				<view style="color:#666666;text-align:center;margin-bottom:20upx;font-size:35upx;">花掌柜</view>
+				<view style="color:#666666;text-align:center;margin-bottom:10upx;font-size:35upx;margin-top:10upx;">花掌柜</view>
 
-<template v-if="showAccountLogin">
-				<view>
-				<input @focus="mobile=''" v-model="mobile" class="experInput" placeholder="手机号" type="number" />
-				</view>
-				<view>
-				<input @focus="password=''" v-model="password" class="experInput" placeholder="密码" type="password" />
-				</view>
-				<view style="margin-top:10upx;">
-				<button class="admin-button-com small blue buttonText" @click="loginFun">登陆</button>
-				</view>
-</template>
+				<template v-if="showAccountLogin">
+					<view>
+					<input @focus="mobile=''" v-model="mobile" class="experInput" placeholder="手机号" type="number" />
+					</view>
+					<view>
+					<input @focus="password=''" v-model="password" class="experInput" placeholder="密码" type="password" />
+					</view>
+					<view style="margin-top:0upx;">
+						<button class="admin-button-com small blue buttonText" @click="loginFun">登陆</button>
+					</view>
+				</template>
 
 				<!-- #ifdef MP-WEIXIN -->
 				<view style="margin-top:55upx;">
@@ -36,10 +36,9 @@
 				<button class="admin-button-com small blue buttonText" @click="mobileLogin">本机号码一键登录</button>
 				</view>
 				<!-- #endif -->
-				<!-- #ifdef APP-PLUS -->
 				<view style="color:#999999;font-size:25upx;margin-top:60upx;">
 					<checkbox-group @change="agreeItem">
-						<label>
+						<label style="display:flex;align-items:center;justify-content:center;">
 							<checkbox value="1" style="transform:scale(0.8)" :checked="agree == 1" />
 							<text>
 								我已阅读并同意
@@ -50,7 +49,6 @@
 						</label>
 					</checkbox-group>
 				</view>
-				<!-- #endif -->
 				<view style="margin-top:45upx;color:#333333;font-size:38upx;width:100%;text-align:right;padding-right:70upx;">
 					<text style="margin-right:40upx;" @click="useAccount()">使用账号密码登录</text>
 					<text @click="register">注册账号</text>
@@ -138,10 +136,10 @@ export default {
 			this.$forceUpdate()
 		},
 		goToService(){
-			plus.runtime.openURL('http://www.wixhb.com/main/hzg-register')
+			this.$util.pageTo({ url: "/admin/home/register"})
 		},
 		goToPrivacy(){
-			plus.runtime.openURL('http://www.wixhb.com/main/hzg-privacy')
+			this.$util.pageTo({ url: "/admin/home/privacy"})
 		},
 		agreeItem(e){
 			let arr = e.target.value

+ 114 - 0
hdApp/src/admin/home/privacy.vue

@@ -0,0 +1,114 @@
+<template>
+	<view class="privacy-container">
+		<view class="privacy-content" v-if="parsedItems.length > 0">
+			<view 
+				v-for="(item, index) in parsedItems" 
+				:key="index"
+				:class="{
+					'privacy-item': true,
+					'hasBold': item.bold === 2,
+					'noBold': item.bold !== 2,
+					'hasGap': item.gap === 2,
+					'noGap': item.gap !== 2
+				}"
+			>
+				{{ item.content }}
+			</view>
+		</view>
+	</view>
+</template>
+<script>
+import { getPrivacyAgreement } from '@/api/auth'
+export default {
+	name: "privacy",
+	components: {},
+	mixins: [],
+	data() {
+		return {
+            html: '',
+            parsedItems: []
+		}
+	},
+	computed: {
+	},
+	onLoad(){
+        getPrivacyAgreement().then(res=>{
+            if(res.code == 1){
+                this.html = res.data.html
+                this.parsePrivacyHtml(this.html)
+            }
+        })
+	},
+	methods: {
+		init(){
+
+		},
+		// 拆解后端返回的隐私协议HTML字符串
+		parsePrivacyHtml(htmlStr) {
+			
+			// 按换行符拆解字符串
+			const arr = htmlStr.split('\n')
+				.map(item => item.trim())
+				.filter(item => item !== '');
+			
+			// 移除重复项
+			const uniqueArr = Array.from(new Set(arr));
+			
+			// 处理每一项,提取样式标记和内容
+			const newItems = [];
+			uniqueArr.forEach(item => {
+				const current = {};
+				
+				// 检查 _@@_ 标记(间距)
+				if (item.indexOf('_@@_') !== -1) {
+					current.gap = 2;
+				}
+				
+				// 检查 _BB_ 标记(粗体)
+				if (item.indexOf('_BB_') !== -1) {
+					current.bold = 2;
+				}
+				
+				// 移除标记符,保留内容
+				let content = item.replace(/_BB_/g, '');
+				content = content.replace(/_@@_/g, '');
+				current.content = content;
+				
+				newItems.push(current);
+			});
+			
+			this.parsedItems = newItems;
+		},
+    }
+};
+</script>
+<style lang="scss" scoped>
+.privacy-container {
+	padding: 30upx 30upx 30upx 30upx;
+	font-size: 30upx;
+}
+
+.privacy-content {
+	line-height: 1.6;
+}
+
+.privacy-item {
+	padding: 15upx 0;
+}
+
+.hasGap {
+	margin-top: 40upx;
+}
+
+.hasBold {
+	font-weight: bold;
+}
+
+.noGap {
+	margin-top: 0upx;
+}
+
+.noBold {
+	font-weight: normal;
+}
+</style>

+ 86 - 0
hdApp/src/admin/home/register.vue

@@ -0,0 +1,86 @@
+<template>
+	<view style="font-size:30upx;">
+        <view style="padding:0upx 8upx 30upx 8upx">
+        <view v-for="(item, index) in itemData" :key="index">
+            <view :class="[item.gap == 2 ? 'hasGap':'noGap',item.bold == 2 ? 'hasBold':'noBold']">{{item.content}}</view>
+        </view>
+        </view>
+	</view>
+</template>
+<script>
+import { getRegisterAgreement } from '@/api/auth'
+export default {
+	name: "register",
+	components: {},
+	mixins: [],
+	data() {
+		return {
+            itemData:[]
+		}
+	},
+	computed: {
+	},
+	onLoad(){
+        getRegisterAgreement().then(res=>{
+			console.log(res)
+            if(res.code == 1){
+                this.parseAgreementHtml(res.data.html)
+            }
+        })
+	},
+	methods: {
+		init(){
+
+		},
+		// 拆解后端返回的注册协议HTML字符串
+		parseAgreementHtml(htmlStr) {
+			// 按换行符拆解字符串
+			const arr = htmlStr.split('\n')
+				.map(item => item.trim())
+				.filter(item => item !== '');
+			
+			// 移除重复项
+			const uniqueArr = Array.from(new Set(arr));
+			
+			// 处理每一项,提取样式标记和内容
+			const newItems = [];
+			uniqueArr.forEach(item => {
+				const current = {};
+				
+				// 检查 _@@_ 标记(间距)
+				if (item.indexOf('_@@_') !== -1) {
+					current.gap = 2;
+				}
+				
+				// 检查 _BB_ 标记(粗体)
+				if (item.indexOf('_BB_') !== -1) {
+					current.bold = 2;
+				}
+				
+				// 移除标记符,保留内容
+				let content = item.replace(/_BB_/g, '');
+				content = content.replace(/_@@_/g, '');
+				current.content = content;
+				
+				newItems.push(current);
+			});
+			
+			this.itemData = newItems;
+		}
+    }
+};
+</script>
+<style lang="scss" scoped>
+.hasGap{
+	margin-top:49upx;
+}
+.hasBold{
+	font-weight:bold;
+}
+.noGap{
+	margin-top:0upx;
+}
+.noBold{
+	font-weight:normal;
+}
+</style>