408249787@qq.com 7 時間 前
コミット
724e841f36
2 ファイル変更93 行追加22 行削除
  1. 56 17
      pages/index/home.uvue
  2. 37 5
      pages/user/login.uvue

+ 56 - 17
pages/index/home.uvue

@@ -61,25 +61,10 @@ const userInfo = computed(() => user.info.value?.userInfo)
 const visible = ref(false)
 const visible2 = ref(false)
 const visible3 = ref(false)
+const visible4 = ref(false)
 onMounted(async () => {
 	if (!userInfo.value.wxOpenId) {
-		ui.showConfirm({
-			title: "提示",
-			message: "您当前未绑定微信,是否绑定微信?",
-			confirmText: "绑定",
-			cancelText: "取消",
-			callback: async (action) => {
-				if (action === "confirm") {
-					await handleBind()
-				}
-				else {
-					userInfo.value.wxOpenId = true
-				}
-				if (userInfo.value.memberLevel === 'default') {
-					visible3.value = true
-				}
-			},
-		});
+		visible4.value = true
 		return
 	} else if (userInfo.value.memberLevel === 'default') {
 		visible3.value = true
@@ -87,6 +72,20 @@ onMounted(async () => {
 	}
 
 })
+async function handleClosePopup1() {
+	await handleBind()
+	visible4.value = false
+	if (userInfo.value.memberLevel === 'default') {
+		visible3.value = true
+	}
+}
+function handleClosePopup2() {
+	visible4.value = false
+	userInfo.value.wxOpenId = true
+	if (userInfo.value.memberLevel === 'default') {
+		visible3.value = true
+	}
+}
 function copyUrl() {
 	uni.setClipboardData({
 		data: 'www.xiaoxiongcode.com',
@@ -214,6 +213,26 @@ async function handleExchange() {
 
 			</view>
 		</cl-popup>
+		<cl-popup v-model="visible4" showClose :show-header="false" direction="center" :pt="{
+			inner: {
+				className: '!bg-transparent'
+			}
+		}">
+			<view class="w-[360px]  relative">
+				<image src="https://oss.xiaoxiongcode.com/static/home/6171.png" mode="widthFix"
+					class="w-[360px]  relative ">
+				</image>
+				<view class=" wz-1  ">
+					您当前未绑定微信,是否绑定微信?
+				</view>
+				<view class="wz-2  " @tap="handleClosePopup1">
+					绑定
+				</view>
+				<view class="wz-3  " @tap="handleClosePopup2">
+					取消
+				</view>
+			</view>
+		</cl-popup>
 		<Physics v-if="selected === 'physics'" />
 		<Chinese v-else-if="selected === 'chinese'" />
 		<English v-else-if="selected === 'english'" />
@@ -224,6 +243,26 @@ async function handleExchange() {
 	</cl-page>
 </template>
 <style lang="scss" scoped>
+.wz-1 {
+	@apply absolute text-black text-[18px] font-bold w-[330px] text-center;
+	line-height: 40px;
+	left: 50%;
+	transform: translateX(-50%);
+	top: 48%;
+}
+
+.wz-2 {
+	@apply absolute bottom-[12px] text-white text-[18px] font-bold text-center;
+	right: 31%;
+	bottom: 17%;
+}
+
+.wz-3 {
+	@apply absolute bottom-[12px] text-white text-[18px] font-bold text-center;
+	left: 26%;
+	bottom: 17%;
+}
+
 .menus {
 	@apply mt-[3vh] mx-auto rounded-[20px];
 }

+ 37 - 5
pages/user/login.uvue

@@ -109,6 +109,23 @@
 				</view>
 			</template>
 		</cl-action-sheet>
+		<cl-popup v-model="visible" showClose :show-header="false" direction="center" :pt="{
+			inner: {
+				className: '!bg-transparent'
+			}
+		}">
+			<view class="w-[330px]  relative">
+				<image src="https://oss.xiaoxiongcode.com/static/home/6172.png" mode="widthFix"
+					class="w-[330px]  relative ">
+				</image>
+				<view class=" wz-1  ">
+					当前微信账号,<br />尚未绑定,<br />无法快捷登录
+				</view>
+				<view class="wz-2  " @tap="handleClosePopup">
+					手机登录
+				</view>
+			</view>
+		</cl-popup>
 	</cl-page>
 </template>
 
@@ -124,6 +141,7 @@ import { loginApi, wechatLogin, quicklyRegister } from "@/services/user";
 import type { ClActionSheetOptions } from "@/uni_modules/cool-ui";
 
 const actionSheetRef = ref<ClActionSheetComponentPublicInstance | null>(null);
+const visible = ref(false)
 
 const val = ref('weixin')
 const agree = ref(false)
@@ -195,6 +213,10 @@ function toLogin() {
 		}
 	})
 }
+function handleClosePopup() {
+	visible.value = false
+	tabsChange('quickly_login')
+}
 function toWechatLogin() {
 	uni.login({
 		provider: 'weixin',
@@ -204,11 +226,7 @@ function toWechatLogin() {
 			}).then(res => {
 				console.log(res);
 				if (res.length === 0) {
-					uni.showToast({
-						title: '请先绑定账号',
-						icon: 'none'
-					})
-					tabsChange('quickly_login')
+					visible.value = true
 					return
 				} else if (res.length === 1) {
 					handleSelect(res[0])
@@ -264,6 +282,20 @@ function toPrivacy() {
 	background: linear-gradient(180deg, #169deb5e 0%, #fff 20%);
 }
 
+.wz-1 {
+	@apply absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 text-black text-3xl font-bold w-[300px] text-center;
+	line-height: 40px;
+}
+
+.wz-2 {
+	@apply absolute bottom-[12px] text-black text-2xl font-bold text-center;
+	line-height: 40px;
+	left: 50%;
+	transform: translateX(-50%);
+}
+
+
+
 .title {
 	position: absolute;
 	top: 10%;