lalala 6 лет назад
Родитель
Сommit
e35841a48d

+ 25 - 13
mobile-code/src/pages/home/components/login-popup.vue

@@ -10,7 +10,7 @@
 			<!-- 获取手机号 -->
 			<template v-if="stepIndex == 0">
 				<div class="popup-attr-wrap">
-					<img :src="info.smallAvatarUrl | default_avatar" mode="widthFix" alt />
+					<img :src="wxInfo.smallAvatarUrl | default_avatar" mode="widthFix" alt />
 				</div>
 				<!-- #ifdef H5 -->
 				<div class="creat-account-btn">
@@ -18,8 +18,11 @@
 				</div>
 				<!-- #endif -->
 				<!-- #ifdef MP-WEIXIN -->
-				<div class="creat-account-btn">
-					<button class="button-com mini-btn" open-type="getUserInfo" @getuserinfo="getWxAvatar">点击创建头像</button>
+				<div class="creat-account-btn" v-if="$util.isEmpty(wxInfo)">
+					<button class="button-com red big mini-btn" open-type="getUserInfo" @getuserinfo="getWxAvatar">点击创建头像</button>
+				</div>
+				<div class="creat-account-btn" v-else>
+					<button class="button-com red big mini-btn" open-type="getPhoneNumber" @getphonenumber="getWxMobile" :plain="true">点击生成手机号</button>
 				</div>
 				<!-- #endif -->
 			</template>
@@ -32,22 +35,20 @@
 					<div class="phone-num font-bold">{{ wxPhoneInfo }}</div>
 				</div>
 				<div class="creat-account-btn">
-					<button class="button-com red big mini-btn" open-type="getPhoneNumber" @getphonenumber="getWxMobile" :plain="true">点击生成手机号</button>
-					<!-- <button class="button-com red big" @click="attentionPublish">点击生成手机号</button> -->
+					<button class="button-com red big" @click="attentionPublish">点击创建账号</button>
 					<!-- <button class="button-com red big mini-btn" open-type="getPhoneNumber" @getphonenumber="getWxMobile" :plain="true">点击创建头像</button> -->
 				</div>
 			</template>
 			<!-- 关注公众号 -->
 			<template v-if="stepIndex == 2">
+				<!-- #ifdef MP-WEIXIN -->
 				<div class="wx-public-wrap">
-					<!-- #ifdef MP-WEIXIN -->
-					<block v-if="true">
+					<block v-if="isPublic">
 						<official-account @binderror="officialErr"></official-account>
 					</block>
 					<block v-else>
 						<button class="button-com red big">完成</button>
 					</block>
-					<!-- #endif -->
 					<!-- <div class="app-color-3">国兰华尚关联的公众号</div>
 					<div class="flex-center-between">
 						<div class="wx-public-left">
@@ -62,6 +63,7 @@
 						<button class="button-com wx-public-btn">查看</button>
 					</div> -->
 				</div>
+				<!-- #endif -->
 			</template>
 		</div>
 	</bottom-popup>
@@ -93,13 +95,18 @@ export default {
 		info: {
 			type: Object,
 			default: () => {}
+		},
+		isPublic: {
+			type: Boolean,
+			default: false
 		}
 	},
 	data() {
 		return {
 			constant: this.$constant,
 			stepIndex: 0,
-			wxPhoneInfo: ''
+			wxPhoneInfo: '',
+			wxInfo: {}
 		}
 	},
 	methods: {
@@ -119,7 +126,7 @@ export default {
 					// this.popupShow = true
 					getWxInfo({ iv: res.iv, encryptedData: res.encryptedData }).then(subRes => {
 						console.log('用户信息', subRes)
-						this.stepIndex = 1
+						// this.stepIndex = 1
 						this.wxInfo = subRes.data
 						this.popupShow = true
 					})
@@ -136,7 +143,7 @@ export default {
 				getWxPhone({ iv: e.detail.iv, encryptedData: e.detail.encryptedData }).then(res => {
 					console.log('用户信息', res)
 					this.wxPhoneInfo = res.data.mobile
-					this.stepIndex = 2
+					this.stepIndex = 1
 					wxLoginFn(true)
 				})
 			} else {
@@ -193,7 +200,7 @@ export default {
 				@include disFlex(center, flex-start);
 				width: 600px;
 				// height: 94px;
-				margin: 142px auto 62px;
+				margin: 116px auto 62px;
 				padding-left: 40px;
 				padding-bottom: 40px;
 				border-bottom: 1px solid $borderColor;
@@ -213,7 +220,7 @@ export default {
 				width: 90%;
 				padding: 10px 16px 28px;
 				box-shadow: 2px 2px 10px #eee;
-				margin: 118px auto 194px;
+				margin: 130px auto 194px;
 				border-radius: 10px;
 				.flex-center-between {
 					margin-top: 22px;
@@ -239,6 +246,11 @@ export default {
 						border-radius: 10px;
 					}
 				}
+
+				.button-com {
+					width: 90%;
+					margin: 20px 5% 0;
+				}
 			}
 		}
 	}

+ 10 - 4
mobile-code/src/pages/home/user.vue

@@ -46,8 +46,8 @@
 					<div class="my-surplus">{{ shopUser.userAsset.balance || 0.00 }}</div>
 				</div>
 				<div class="surplus-right">
-					<button class="button-com" @click="showPopup">申请会员</button>
-					<!-- <button class="button-com" v-if="shopUser.isFull != 1" @click="showPopup">申请会员</button> -->
+					<!-- <button class="button-com" @click="showPopup">申请会员</button> -->
+					<button class="button-com" v-if="shopUser.isFull != 1" @click="showPopup">申请会员</button>
 					<!-- <button class="button-com mini-btn" open-type="getUserInfo" v-if="loginInfo.isFull != 1" @getuserinfo="getWxAvatar">申请会员</button> -->
 					<button class="button-com" @click="pageToFn({
 					url: '/pages/pay/index',
@@ -105,7 +105,7 @@
 			</tui-list-view>
 		</div>
 		<!-- 登录弹窗 -->
-		<login-popup :show="popupShow" :info="wxInfo" @hide="hidePopup" />
+		<login-popup :show="popupShow" :info="wxInfo" :isPublic="isPublic" @hide="hidePopup" />
 		<!-- 登录弹窗 -->
 		<app-trademark />
 		<!-- <app-footer :activeIndex="3" /> -->
@@ -139,6 +139,7 @@ export default {
 		return {
 			constant: this.$constant,
 			popupShow: false,
+			isPublic: false,
 			stepIndex: 0,
 			wxInfo: {},
 			loginShow: false
@@ -158,7 +159,12 @@ export default {
 	},
 	methods: {
 		init() {
-			getShopUser()
+			getShopUser().then(res => {
+				if (this.option.aaa && res.isFull != 1) {
+					this.isPublic = true
+					this.popupShow = true
+				}
+			})
 		},
 		// pageTo
 		pageToFn(item) {