liujd 6 лет назад
Родитель
Сommit
d50cfebef2

+ 0 - 1
mobile-code/src/mixins/globalMixins.js

@@ -46,7 +46,6 @@ export default {
 				})
 				// #endif
 				// #ifdef MP-WEIXIN
-				console.log('afa')
 				wxLoginFn().then(res => {
 					this.init()
 				})

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

@@ -74,7 +74,7 @@ export default {
 	props: {
 		stepIndex: {
 			type: Number,
-			default: 1
+			default: 0
 		},
 		show: {
 			type: Boolean,
@@ -100,7 +100,7 @@ export default {
 		getWxMobile(e) {
 			console.log(e)
 			if (e.detail.errMsg === 'getPhoneNumber:ok') {
-				getWxPhone({ iv: e.detail.iv, encryptData: e.detail.encryptedData }).then(res => {
+				getWxPhone({ iv: e.detail.iv, encryptedData: e.detail.encryptedData }).then(res => {
 					console.log('用户信息', res)
 				})
 			} else {

+ 11 - 3
mobile-code/src/pages/home/user.vue

@@ -46,7 +46,12 @@
 					<div class="my-surplus">{{ shopUser.userAsset.balance || 0.00 }}</div>
 				</div>
 				<div class="surplus-right">
-					<button class="button-com" v-if="shopUser.isFull != 1" @click="applyVIP">申请会员</button>
+					<!-- #ifdef H5 -->
+					<button class="button-com" v-if="shopUser.isFull != 1" @click="showPopup">申请会员</button>
+					<!-- #endif -->
+					<!-- #ifdef MP-WEIXIN -->
+					<button class="button-com mini-btn" open-type="getUserInfo" v-if="shopUser.isFull != 1" @getuserinfo="getWxAvatar">申请会员</button>
+					<!-- #endif -->
 					<button class="button-com" @click="pageToFn({
 					url: '/pages/pay/index',
 					query: {
@@ -143,7 +148,10 @@ export default {
 		}
 	},
 	computed: {
-		...mapGetters({ shopUser: 'getShopUser' })
+		...mapGetters({ shopUser: 'getShopUser' }),
+		// #ifdef MP-WEIXIN
+		...mapGetters({ loginInfo: 'getLoginInfo' })
+		// #endif
 	},
 	onLoad(option) {
 		// this.init()
@@ -186,7 +194,7 @@ export default {
 				success: res => {
 					console.log('res', res)
 					this.popupShow = true
-					getWxInfo({ iv: res.iv, encryptData: res.encryptedData }).then(subRes => {
+					getWxInfo({ iv: res.iv, encryptedData: res.encryptedData }).then(subRes => {
 						console.log('用户信息', subRes)
 						this.wxInfo = subRes
 						this.popupShow = true

+ 6 - 1
mobile-code/src/store/modules/login.js

@@ -1,6 +1,11 @@
 export default {
 	state: {
-		loginInfo: null
+		loginInfo: {}
+	},
+	getters: {
+		getLoginInfo(state) {
+			return state.loginInfo || {}
+		}
 	},
 	mutations: {
 		setLoginInfo(state, payload) {