Selaa lähdekoodia

fix: 登录页样式调整,首页展示商铺/展示商品刷新逻辑修改,其他页面细节样式调整;

ext.zhangbin71 1 kuukausi sitten
vanhempi
commit
36f7b12df3

+ 1 - 1
hooks/useSendCode.js

@@ -3,7 +3,7 @@ import { ref, onUnmounted } from 'vue'
 
 export function useSendCode() {
   const disabled = ref(false)
-  const text = ref('获取验证码')
+  const text = ref('发送验证码')
   let timer = null
   let count = 60
 

+ 11 - 10
pages/goods/goods_search/index.vue

@@ -46,9 +46,9 @@
 	          </view>
 	          <view class="bottom-row">
 	            <!-- <text class="price">工费: {{ item.price }}/克</text> -->
-	            <text class="sales">工费{{ item.totalLaborCost }}</text>
+	            <text class="sales">工费:¥{{ item.totalLaborCost }}</text>
 	            <text class="sales">
-	              附加费{{ item.additionalAmount }}
+	              附加费:¥{{ item.additionalAmount }}
 	            </text>
 	            <!-- <view class="txt">券</view> -->
 	          </view>
@@ -304,9 +304,9 @@ page {
 }
 
 .searchGood .title {
-  font-size: 28rpx;
-  color: #999;
-  margin: 50rpx 30rpx 25rpx 30rpx;
+  // font-size: 28rpx;
+  // color: #999;
+  // margin: 50rpx 30rpx 25rpx 30rpx;
 }
 
 .searchGood .list {
@@ -331,7 +331,7 @@ page {
 
 .index-product-wrapper {
   padding: 0 16rpx;
-  margin-bottom: 200rpx; /* 为自定义 tabBar 留出空间 */
+  margin-bottom: 72rpx; /* 为自定义 tabBar 留出空间 */
   // min-height: 700rpx;
   //background: #fff;
 
@@ -367,13 +367,13 @@ page {
       }
 
       .text-info {
-        padding: 10rpx 20rpx 20rpx;
+        padding: 16rpx 8rpx;
 
         .title {
           color: #333;
           display: flex;
           align-items: center;
-          justify-items: space-between;
+          justify-content: space-between;
           .tip {
             width: 61rpx;
             height: auto;
@@ -428,13 +428,14 @@ page {
         .merchantInfo{
           display: flex;
           align-items: center;
-          height: 60rpx;
+          height: 40rpx;
+		  margin-top: 16rpx;
         }
         .merchantLogo{
           width: 40rpx;
           height: 40rpx;
           border-radius: 50%;
-          margin-right: 20rpx;
+          margin-right: 8rpx;
         }
         .merchantName{
           font-size: 24rpx;

Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 1584 - 1498
pages/index/index.vue


+ 3 - 1
pages/merchantCenter/index.vue

@@ -318,7 +318,9 @@
 				userId: appStore.userInfo.userId
 			}
 			footprintScan(obj).then(()=>{
-				appStore.userInfo.lastVisitedMerchantId = appStore.userInfo.merchant.id
+				appStore.userInfo.lastVisitedMerchantId = appStore.userInfo.merchant.id;
+				appStore.setIndexRefersh(true)
+				appStore.USERINFO();
 				uni.switchTab({
 					url
 				})

+ 5 - 0
pages/merchantCenters/merchant.vue

@@ -180,6 +180,11 @@ const getSbmerchantInfoFn = async () => {
     userId:appStore.userInfo.userId
   }
   await footprintScan(obj)
+  appStore.USERINFO();
+  // 当浏览的店铺主页不是上次浏览店铺时,才改变状态
+  if(query.value.merchantId != appStore.userInfo.lastVisitedMerchantId){
+	  appStore.setIndexRefersh(true)
+  }
   getSbmerchantInfo(data).then((res) => {
     console.log(res);
     merchantInfo.value = res.data;

+ 14 - 12
pages/user/index.vue

@@ -156,7 +156,7 @@
         <template v-for="(store,storeIndex) in recentStores" :key="store.id">
           <view class="store-item" v-if="storeIndex == 0" @click="viewStore(store)">
               <view class="store-logo">
-                <image class="img" :src="store.merchantLogo"></image>
+                <image class="img" :src="store.merchantLogo" mode="aspectFill"></image>
               </view>
               <view class="store-info">
                 <text class="store-name">{{ store.merchantName }}</text>
@@ -190,7 +190,7 @@
           @click="viewOrders(order.id)"
         >
           <view class="status-icon">
-            <image class="img" :src="order.src" mode="widthFix"></image>
+            <image class="img" :src="order.src"></image>
           </view>
           <text class="status-name">{{ order.name }}</text>
         </view>
@@ -831,7 +831,7 @@ function handleFaceDetect() {
   background: #fff;
   margin: -176rpx 20rpx 20rpx;
   border-radius: 24rpx;
-  padding: 30rpx;
+  padding: 32rpx;
 }
 
 .wallet-header {
@@ -962,16 +962,16 @@ function handleFaceDetect() {
 .order-section,
 .common-functions {
   background: #fff;
-  margin: 20rpx;
+  margin: 16rpx;
   border-radius: 16rpx;
-  padding: 30rpx;
+  padding: 20rpx;
 }
 
 .section-header {
   display: flex;
   justify-content: space-between;
   align-items: center;
-  margin-bottom: 30rpx;
+  margin-bottom: 20rpx;
 }
 
 .section-title {
@@ -988,8 +988,8 @@ function handleFaceDetect() {
   display: flex;
   align-items: center;
   justify-content: flex-start;
-  padding: 20rpx;
-  border-bottom: 2rpx solid #f0f0f0;
+  padding: 16rpx;
+  // border-bottom: 2rpx solid #f0f0f0;
   background-color: #f9f7f0;
   border-radius: 16rpx;
 }
@@ -999,18 +999,20 @@ function handleFaceDetect() {
 }
 
 .store-logo {
+	width: 100rpx;
+	height: 100rpx;
+    margin-right: 16rpx;
   .img {
     width: 100rpx;
     height: 100rpx;
-    border-radius: 16rpx;
-    margin-right: 30rpx;
+    border-radius: 8rpx;
   }
 }
-
 .store-name {
   font-size: 32rpx;
+  font-weight: bold;
   color: #333;
-  margin-bottom: 20rpx;
+  margin-bottom: 10rpx;
   display: block;
 }
 

+ 222 - 126
pages/users/login/index.vue

@@ -2,28 +2,26 @@
 	<div class="login-wrapper bglogin">
 		<up-navbar title="登录" placeholder>
 			<template #left>
-<!--        <view-->
-<!--            v-if="appStore?.$wxConfig?.auditModeEnabled"-->
-<!--            @click="backHome"-->
-<!--        >-->
-<!--          <image src="@/static/images/tabbar/1-001.png" style="height: 40rpx;width: 40rpx;"></image>-->
-<!--        </view>-->
-        <view
-            class="back_extend"
-            v-if="appStore?.$wxConfig?.auditModeEnabled"
-            @click="backHome"
-        >
-          {{ "<" }} 回到首页
-        </view>
+				<!--        <view-->
+				<!--            v-if="appStore?.$wxConfig?.auditModeEnabled"-->
+				<!--            @click="backHome"-->
+				<!--        >-->
+				<!--          <image src="@/static/images/tabbar/1-001.png" style="height: 40rpx;width: 40rpx;"></image>-->
+				<!--        </view>-->
+				<view class="back_extend" v-if="appStore?.$wxConfig?.auditModeEnabled" @click="backHome">
+					{{ "<" }} 回到首页
+				</view>
 			</template>
 		</up-navbar>
 		<div class="shading">
 			<view class="">Hello!</view>
 			<view class="">欢迎来到水贝搬运工</view>
+			<image src="@/static/images/login_ip.png" class="ip-pic"></image>
 		</div>
 		<div class="whiteBg" v-if="formItem === 1">
 			<view class="whiteBg-tab whiteBg-tabimg" :class="{'whiteBg-tabs whiteBg-tabsimg':current == 1}">
-				<view @click="current = item.type" :class="{active:current != index,noActive:current == index}" class="whiteBg-tab-li" v-for="(item,index) in navList" :key="index">
+				<view @click="current = item.type" :class="{active:current != index,noActive:current == index}"
+					class="whiteBg-tab-li" v-for="(item,index) in navList" :key="index">
 					<view class="">{{ item.name }}</view>
 				</view>
 			</view>
@@ -47,10 +45,10 @@
 						<input type="text" class="texts" placeholder="输入邀请码" v-model="inviteCode" />
 					</div>
 				</template>
-				
+
 			</div>
 			<div class="privacy-box" @click="aloneChecked = !aloneChecked">
-				
+
 				<image v-if="aloneChecked" src="/static/images/select-active@2x.png" mode=""></image>
 				<image v-else src="/static/images/select@2x.png" mode=""></image>
 				<view class="">我已阅读并同意</view>
@@ -59,10 +57,25 @@
 			</div>
 			<view class="footer">
 				<button class="logon" @click="loginMobile" v-if="current !== 0">登录</button>
-				<button class="logonWX"  open-type="getPhoneNumber" @getphonenumber="getPhoneNumberFn" v-if="current !== 0">微信登录</button>
+				<!-- <button class="logonWX"  open-type="getPhoneNumber" @getphonenumber="getPhoneNumberFn" v-if="current !== 0">微信登录</button> -->
 				<button class="logon" @click="submit" v-if="current === 0">登录</button>
 			</view>
-		
+			<view class="wx-login" open-type="getPhoneNumber" @getphonenumber="getPhoneNumberFn" v-if="current !== 0">
+				<view class="wx-login-tip">
+					<view class="login-line">
+					</view>
+					<text class="wx-tip">第三方登录</text>
+					<view class="login-line">
+					</view>
+				</view>
+				<view class="wx-login-btn">
+					<button class="logonWX" open-type="getPhoneNumber" @getphonenumber="getPhoneNumberFn"
+						v-if="current !== 0">
+						<image class="wx-icon" src="@/static/images/wxLogin.png" mode="widthFix"></image>
+					</button>
+				</view>
+			</view>
+
 		</div>
 	</div>
 </template>
@@ -98,7 +111,9 @@
 		useSendCode
 	} from "@/hooks/useSendCode";
 	import Cache from "@/utils/cache";
-  import { getPhoneNumber } from "@/utils/util.js";
+	import {
+		getPhoneNumber
+	} from "@/utils/util.js";
 	import {
 		useToast
 	} from "@/hooks/useToast.js";
@@ -108,7 +123,9 @@
 	// import {
 	// 	getGroupchatList
 	// } from "@/api/customerService";
-  import { footprintScan } from "@/api/merchant.js";
+	import {
+		footprintScan
+	} from "@/api/merchant.js";
 	import {
 		EXPIRES_TIME
 	} from "@/config/cache";
@@ -125,7 +142,13 @@
 	const BACK_URL = "login_back_url";
 
 	// Reactive state
-	const navList = ref([{name:"快速登录",type:1}, {name:"账号登录",type:0}]);
+	const navList = ref([{
+		name: "快速登录",
+		type: 1
+	}, {
+		name: "账号登录",
+		type: 0
+	}]);
 	const current = ref(1);
 	const account = ref("");
 	const inviteCode = ref(""); // 邀请码
@@ -137,17 +160,17 @@
 	const keyCode = ref("");
 	const codeUrl = ref("");
 	const codeVal = ref("");
-	
+
 	const platform = ref("");
-	
-	
-	
-	
+
+
+
+
 	const appleShow = ref(false);
 	const aloneChecked = ref(false);
 
-  const merchantId = ref('');
-  const userInfo = ref({});
+	const merchantId = ref('');
+	const userInfo = ref({});
 
 	// Watch formItem to update type
 	watch(formItem, (newVal) => {
@@ -159,26 +182,26 @@
 		text,
 		sendCode
 	} = useSendCode();
-	
+
 
 	function openPrivacy() {
 		// void plus.runtime.openWeb("https://www.shuibeibyg.com/shenhe.html");
-    goDetail("https://www.shuibeibyg.com/shenhe.html")
+		goDetail("https://www.shuibeibyg.com/shenhe.html")
 	}
-  const goDetail = (url) => {
-    const webviewPageUrl = `/pages/webview/privacy?path=${url}`;
-    uni.navigateTo({
-      url: webviewPageUrl,
-      fail: (err) => {
-        console.error("跳转到webview页面失败:", err);
-        uni.showToast({
-          title: "跳转失败,请重试",
-          icon: "none",
-          duration: 1500,
-        });
-      },
-    });
-  };
+	const goDetail = (url) => {
+		const webviewPageUrl = `/pages/webview/privacy?path=${url}`;
+		uni.navigateTo({
+			url: webviewPageUrl,
+			fail: (err) => {
+				console.error("跳转到webview页面失败:", err);
+				uni.showToast({
+					title: "跳转失败,请重试",
+					icon: "none",
+					duration: 1500,
+				});
+			},
+		});
+	};
 
 	// Get logo image
 	const getLogoImage = async () => {
@@ -417,7 +440,7 @@
 			appStore.SETUID(data.uid);
 			const res = await getUserInfo();
 			appStore.UPDATE_USERINFO(res.data);
-      userInfo.value = res.data;
+			userInfo.value = res.data;
 
 			// connect({
 			// 	id: appStore.uid?.toString(),
@@ -431,18 +454,21 @@
 			// 订阅已加入的群组
 			// await getGroupchatListFn(data.uid);
 
-      if(merchantId.value != ''){
-        let obj ={
-          merchantId:merchantId.value,
-          userId:res.data.userId
-        }
-        await footprintScanFn(obj)
-      }else{
-        console.log('============')
-        appStore.UPDATE_MERCHANT_ID('')
-        Toast({ title: "登录成功" });
-        backHome();
-      }
+			if (merchantId.value != '') {
+				let obj = {
+					merchantId: merchantId.value,
+					userId: res.data.userId
+				}
+				appStore.setIndexRefersh(true)
+				await footprintScanFn(obj)
+			} else {
+				console.log('============')
+				appStore.UPDATE_MERCHANT_ID('')
+				Toast({
+					title: "登录成功"
+				});
+				backHome();
+			}
 		} catch (err) {
 			console.error(err);
 			uni.showToast({
@@ -451,45 +477,48 @@
 			});
 		}
 	};
-  const backHome = () => {
-    if(userInfo.value.merchant && userInfo.value.merchant.id){
-      uni.navigateTo({
-        url:"/pages/merchantCenter/index"
-      })
-    }else{
-      uni.switchTab({
-        url: "/pages/index/index",
-      });
-    }
-  };
-  const footprintScanFn =async (data) => {
-    const res = await footprintScan(data);
-    Toast({ title: "登录成功" });
-    backHome();
-  }
-  const getPhoneNumberFn = async (e) => {
-    // Toast({ title: "登录中..." });
-    if (!aloneChecked.value) {
-      return Toast({
-        title: "请阅读并同意用户协议和隐私政策",
-        icon: "none"
-      });
-    }
-    const res = await getPhoneNumber(e);
-    console.log('res',res);
-    if (res) {
-      appStore.LOGIN({
-        token: res.data.token
-      });
-      // 保存过期时间(999天后过期)
-      const expiresTime = Math.round(new Date() / 1000) + 999 * 24 * 60 * 60;
-      Cache.set(EXPIRES_TIME, expiresTime, 0);
-      await getUserInfoFn(res.data);
-    }
-  }
+	const backHome = () => {
+		if (userInfo.value.merchant && userInfo.value.merchant.id) {
+			uni.navigateTo({
+				url: "/pages/merchantCenter/index"
+			})
+		} else {
+			uni.switchTab({
+				url: "/pages/index/index",
+			});
+		}
+	};
+	const footprintScanFn = async (data) => {
+		const res = await footprintScan(data);
+		appStore.USERINFO();
+		Toast({
+			title: "登录成功"
+		});
+		backHome();
+	}
+	const getPhoneNumberFn = async (e) => {
+		// Toast({ title: "登录中..." });
+		if (!aloneChecked.value) {
+			return Toast({
+				title: "请阅读并同意用户协议和隐私政策",
+				icon: "none"
+			});
+		}
+		const res = await getPhoneNumber(e);
+		console.log('res', res);
+		if (res) {
+			appStore.LOGIN({
+				token: res.data.token
+			});
+			// 保存过期时间(999天后过期)
+			const expiresTime = Math.round(new Date() / 1000) + 999 * 24 * 60 * 60;
+			Cache.set(EXPIRES_TIME, expiresTime, 0);
+			await getUserInfoFn(res.data);
+		}
+	}
 	onLoad(() => {
-    console.log(appStore.$wxConfig)
-    merchantId.value = appStore.merchantId || '';
+		console.log(appStore.$wxConfig)
+		merchantId.value = appStore.merchantId || '';
 		getLogoImage();
 	});
 
@@ -510,19 +539,21 @@
 		background: transparent;
 		background-color: transparent !important;
 	}
-	
+
 	::v-deep .u-navbar__content {
 		background: transparent;
 		background-color: transparent !important;
 	}
+
 	.login-wrapper {
 		//background: url('https://sb-admin.oss-cn-shenzhen.aliyuncs.com/shuibei-mini/new-mini/login@2x.png');
 		background-repeat: no-repeat;
 		background-size: 100% 624rpx;
 		background-color: #FFFFFF;
 	}
+
 	.appLogin {
-		
+
 
 		.hds {
 			display: flex;
@@ -606,27 +637,43 @@
 
 	.login-wrapper {
 
+		height: 100vh;
 
 		.shading {
 			padding: 72rpx 78rpx;
 			display: flex;
 			justify-content: center;
 			flex-direction: column;
+			position: relative;
+			z-index: 1;
+
 			view {
 				color: #333333;
 				font-size: 36rpx;
 				font-weight: bold;
+
 				&:first-child {
 					font-size: 48rpx;
 					margin-bottom: 16rpx;
 				}
 			}
+
+			.ip-pic {
+				width: 261rpx;
+				height: 480rpx;
+				position: absolute;
+				right: 14rpx;
+				bottom: calc(-76rpx - 88rpx);
+			}
 		}
 
 		.whiteBg {
-			margin-top: 100rpx;
+			// margin-top: 100rpx;
 			background: #FFFFFF;
 			border-radius: 48rpx 48rpx 0rpx 0rpx;
+			position: relative;
+			z-index: 5;
+
 			.whiteBg-tab {
 				color: #666666;
 				display: flex;
@@ -636,13 +683,15 @@
 				//background: url('https://sb-admin.oss-cn-shenzhen.aliyuncs.com/shuibei-mini/new-mini/logintab1.png');
 				background-repeat: no-repeat;
 				background-size: cover;
+
 				.active {
 					width: 407rpx;
-					
+
 					view {
 						color: #F8C008;
 						font-weight: bold;
 						position: relative;
+
 						&::after {
 							left: 50%;
 							bottom: -12rpx;
@@ -656,15 +705,18 @@
 						}
 					}
 				}
+
 				.noActive {
 					flex: 1;
 				}
 			}
+
 			.whiteBg-tabs {
 				//background: url('https://sb-admin.oss-cn-shenzhen.aliyuncs.com/shuibei-mini/new-mini/logintab.png');
 				background-repeat: no-repeat;
 				background-size: cover;
 			}
+
 			.list {
 				padding: 0 80rpx;
 				margin-top: 120rpx;
@@ -678,11 +730,12 @@
 					background: #F9F7F0;
 					border-radius: 16rpx;
 					margin-bottom: 32rpx;
+
 					.texts {
 						flex: 1;
 						font-size: 28rpx;
 					}
-					
+
 					.code {
 						padding: 0;
 						margin: 0;
@@ -697,6 +750,7 @@
 						font-size: 28rpx;
 						font-weight: bold;
 						border: none;
+
 						&::after {
 							width: 0;
 							border: none;
@@ -716,21 +770,22 @@
 				font-size: 32rpx;
 				font-weight: bold;
 			}
-      .logonWX{
-        display: flex;
-        align-items: center;
-        justify-content: center;
-        height: 88rpx;
-        background-color: #28C445;
-        border-radius: 16rpx;
-        color: #ffffff;
-        font-size: 32rpx;
-        font-weight: bold;
-        margin-top: 30rpx;
-      }
-      .logonWX[disabled]{
-        background-color: #BEEDC7;
-      }
+
+			.logonWX {
+				display: flex;
+				align-items: center;
+				justify-content: center;
+				// height: 88rpx;
+				background-color: #fff;
+				border: none !important;
+				border-radius: 16rpx;
+				color: #ffffff;
+				font-size: 32rpx;
+			}
+
+			.logonWX[disabled] {
+				background-color: #BEEDC7;
+			}
 		}
 
 		.privacy-box {
@@ -738,7 +793,7 @@
 			padding: 0 80rpx;
 			display: flex;
 			align-items: center;
-			
+
 			image {
 				width: 28rpx;
 				height: 28rpx;
@@ -747,19 +802,60 @@
 
 			.privacy-text {
 				color: #F8C008;
-				
+
 				vertical-align: top;
 			}
 		}
 	}
+
 	.footer {
-		padding: 48rpx 80rpx;
+		padding: 48rpx 80rpx 72rpx;
+	}
+
+	.back_extend {
+		//position: fixed;
+		//top: 50px;
+		//left: 10px;
+		//font-size: 26rpx;
+		//color: #999;
+	}
+
+	.wx-login-tip {
+		display: flex;
+		align-items: center;
+		width: 590rpx;
+		margin: 0 auto;
+		justify-content: space-between;
+
+		.login-line {
+			width: 193rpx;
+			height: 1rpx;
+			background-color: #F1F3F8;
+		}
+
+		.wx-tip {
+			font-size: 28rpx;
+			line-height: 44rpx;
+			color: #999;
+			flex: 1;
+			width: 100rpx;
+			text-align: center;
+			display: block;
+		}
+	}
+
+	.wx-login-btn {
+		width: 590rpx;
+		margin: 0 auto;
+		display: flex;
+		align-items: center;
+		justify-content: center;
+		margin-top: 32rpx;
+		padding-bottom: 30rpx;
+
+		.wx-icon {
+			width: 92rpx;
+			height: 92rpx;
+		}
 	}
-  .back_extend {
-    //position: fixed;
-    //top: 50px;
-    //left: 10px;
-    //font-size: 26rpx;
-    //color: #999;
-  }
-</style>
+</style>

+ 3 - 1
static/css/base.css

@@ -475,7 +475,9 @@ checkbox .uni-checkbox-input.uni-checkbox-input-checked::before {
 	background-image: url("https://sb-admin.oss-cn-shenzhen.aliyuncs.com/shuibei-mini/new-mini/jianbianBG.png");
 }
 .bglogin{
-	background: url('https://sb-admin.oss-cn-shenzhen.aliyuncs.com/shuibei-mini/new-mini/login@2x.png');
+	/* background: url('https://sb-admin.oss-cn-shenzhen.aliyuncs.com/shuibei-mini/new-mini/login@2x.png'); */
+	background-color: #fff;
+	background-image: url("https://sb-admin.oss-cn-shenzhen.aliyuncs.com/shuibei-mini/new-mini/jianbianBG.png");
 }
 .whiteBg-tabimg{
 	background: url('https://sb-admin.oss-cn-shenzhen.aliyuncs.com/shuibei-mini/new-mini/logintab1.png');

BIN
static/images/login_ip.png


BIN
static/images/wxLogin.png


+ 3 - 1
stores/app.js

@@ -44,6 +44,8 @@ export const useAppStore = defineStore("app", {
         shopId: "001",
       },
       merchantId: null,
+	  // 首页展示刷新标识,当浏览了新店铺主页/扫店铺码时,改为true,首页onshow时判断true刷新列表并改为false
+	  indexRefreshFlag: false,
     };
   },
   getters: {
@@ -65,7 +67,7 @@ export const useAppStore = defineStore("app", {
       this.refreshArticles = val;
     },
     setIndexRefersh(val) {
-      this.indexRefreshArticles = val;
+      this.indexRefreshFlag = val;
     },
     SET_NAVBAR_HEIGHT(val) {
       this.navbarHeight = val;

+ 1 - 0
utils/util.js

@@ -910,6 +910,7 @@ export async function getSceneInfo(e, index) {
         merchantId: params.merchantId,
         userId: appStore.userInfo.userId,
       };
+	  appStore.setIndexRefersh(true)
       await footprintScan(obj);
       await appStore.USERINFO();
     }