更新代码:同步最新变更
This commit is contained in:
parent
7c565ff4ad
commit
b2bbfcd9e2
137
components/ActivityItem.vue
Normal file
137
components/ActivityItem.vue
Normal file
@ -0,0 +1,137 @@
|
|||||||
|
<template>
|
||||||
|
<view class="activity-item flex" @click="handleClick">
|
||||||
|
<view class="left flex flex-col justify-between align-center">
|
||||||
|
<image :src="item.brandLogo" style="width: 140rpx;height: 140rpx;"></image>
|
||||||
|
<text>活动状态</text>
|
||||||
|
<view v-if="item.audit_status == 0" style="color: #9E9E9E;font-size: 24rpx;">待审核</view>
|
||||||
|
<view v-if="item.audit_status == 2" style="color: #DE3C4B;font-size: 24rpx;">未通过</view>
|
||||||
|
<view v-if="item.audit_status == 1">
|
||||||
|
<block v-if="item.activity_status == 1">
|
||||||
|
<view class="margin-bottom-xs" style="color: #9E9E9E;font-size: 24rpx;">招募进行中</view>
|
||||||
|
<view>
|
||||||
|
<text style="font-size: 72rpx; color: #DE3C4B;">{{item.remainingDays}}</text>天
|
||||||
|
</view>
|
||||||
|
</block>
|
||||||
|
<block v-else>
|
||||||
|
<view style="color: #9E9E9E;font-size: 24rpx;">活动已结束</view>
|
||||||
|
</block>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="right">
|
||||||
|
<view class="title">{{ item.breweryName }}</view>
|
||||||
|
<view class="sub">时间:首次扫码开始累计 <text style="color:#DE3C4B">{{item.duration}}天内</text></view>
|
||||||
|
<view class="sub">目标:全系列酒款累积扫码 ≥ {{ item.activityTarget}}桶</view>
|
||||||
|
<scroll-view v-if="item.beers" scroll-x="true" class="scroll-img">
|
||||||
|
<view class="beer-box" v-for="(beer, beerIndex) in item.beers" :key="beerIndex" @click.stop="handleReview(beer)">
|
||||||
|
<image v-if="beer.cover" :src="beer.cover" class="cover"></image>
|
||||||
|
</view>
|
||||||
|
</scroll-view>
|
||||||
|
<view class="flex align-center">
|
||||||
|
<text v-if="item.activityRewardType == 2 || (item.activityRewardType == 1 && item.activityRewardGoods)" class="zeng">赠</text>
|
||||||
|
<text v-if="item.activityRewardType == 1 && item.activityRewardGoods" style="color: #0B0E26;font-size: 24rpx;">{{item.activityRewardGoods.goodsName}} * {{item.activityRewardCount}}</text>
|
||||||
|
<text v-if="item.activityRewardType == 2" style="color: #0B0E26;font-size: 24rpx;">啤酒币 * {{item.activityRewardCount}}个</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
name: 'activity-item',
|
||||||
|
props: {
|
||||||
|
item: {
|
||||||
|
type: Object,
|
||||||
|
required: true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
handleClick() {
|
||||||
|
this.$emit('click', this.item)
|
||||||
|
},
|
||||||
|
handleReview(beer) {
|
||||||
|
this.$emit('review', beer)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.activity-item {
|
||||||
|
border-radius: 20rpx;
|
||||||
|
background: #FDFDFD;
|
||||||
|
box-sizing: border-box;
|
||||||
|
border: 1px solid #F2F2F2;
|
||||||
|
width: 702rpx;
|
||||||
|
margin-bottom: 32rpx;
|
||||||
|
|
||||||
|
.left {
|
||||||
|
padding: 24rpx 20rpx;
|
||||||
|
border-radius: 20rpx;
|
||||||
|
background: #FFFFFF;
|
||||||
|
box-sizing: border-box;
|
||||||
|
border: 1px solid #EFEDE9;
|
||||||
|
width: 180rpx;
|
||||||
|
margin-top: -10rpx;
|
||||||
|
margin-bottom: -10rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.right {
|
||||||
|
padding: 20rpx;
|
||||||
|
flex: 1;
|
||||||
|
|
||||||
|
.title {
|
||||||
|
font-family: Source Han Sans;
|
||||||
|
font-size: 28rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
line-height: 30rpx;
|
||||||
|
color: #0B0E26;
|
||||||
|
margin-bottom: 20rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sub {
|
||||||
|
font-family: Source Han Sans;
|
||||||
|
font-size: 24rpx;
|
||||||
|
font-weight: 500;
|
||||||
|
line-height: 30rpx;
|
||||||
|
color: #0B0E26;
|
||||||
|
margin-bottom: 16rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.scroll-img {
|
||||||
|
width: 500rpx;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
white-space: nowrap;
|
||||||
|
height: 144rpx;
|
||||||
|
margin-bottom: 20rpx;
|
||||||
|
|
||||||
|
.beer-box {
|
||||||
|
width: 100rpx;
|
||||||
|
background: #FFFFFF;
|
||||||
|
margin-right: 20rpx;
|
||||||
|
box-sizing: border-box;
|
||||||
|
display: inline-block;
|
||||||
|
|
||||||
|
.cover {
|
||||||
|
width: 100rpx;
|
||||||
|
height: 144rpx;
|
||||||
|
border-radius: 10rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.zeng {
|
||||||
|
font-family: Source Han Sans;
|
||||||
|
font-size: 20rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
line-height: normal;
|
||||||
|
text-align: center;
|
||||||
|
color: #0B0E26;
|
||||||
|
padding: 8rpx 12rpx;
|
||||||
|
border-radius: 10rpx;
|
||||||
|
background: #FEE034;
|
||||||
|
margin-right: 20rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
@ -102,6 +102,8 @@
|
|||||||
getOpenId(loginRes.code).then(res => {
|
getOpenId(loginRes.code).then(res => {
|
||||||
console.log(res.token)
|
console.log(res.token)
|
||||||
this.openId = res.openId
|
this.openId = res.openId
|
||||||
|
// 保存openId到storage中
|
||||||
|
uni.setStorageSync('openId', res.openId)
|
||||||
if (res.token) {
|
if (res.token) {
|
||||||
uni.setStorageSync('token', res.token)
|
uni.setStorageSync('token', res.token)
|
||||||
// 获取用户信息
|
// 获取用户信息
|
||||||
@ -158,6 +160,8 @@
|
|||||||
|
|
||||||
// 如果没有barId,提示去认证
|
// 如果没有barId,提示去认证
|
||||||
if (!res.user.barId) {
|
if (!res.user.barId) {
|
||||||
|
// 从storage中获取openId
|
||||||
|
const openId = uni.getStorageSync('openId') || this.openId
|
||||||
uni.showModal({
|
uni.showModal({
|
||||||
title: '提示',
|
title: '提示',
|
||||||
content: '您还未认证门店,请先认证',
|
content: '您还未认证门店,请先认证',
|
||||||
@ -166,7 +170,7 @@
|
|||||||
if (res.confirm) {
|
if (res.confirm) {
|
||||||
console.log('确定')
|
console.log('确定')
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/pages/index/registration?openId=' + this.openId
|
url: '/pages/index/registration?openId=' + openId
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
11
pages.json
11
pages.json
@ -359,7 +359,7 @@
|
|||||||
"path" : "addAiad",
|
"path" : "addAiad",
|
||||||
"style" :
|
"style" :
|
||||||
{
|
{
|
||||||
"navigationBarTitleText" : "修改地址",
|
"navigationBarTitleText" : "联系我们",
|
||||||
"navigationBarBackgroundColor": "#19367A",
|
"navigationBarBackgroundColor": "#19367A",
|
||||||
"navigationBarTextStyle": "white"
|
"navigationBarTextStyle": "white"
|
||||||
}
|
}
|
||||||
@ -376,9 +376,9 @@
|
|||||||
],
|
],
|
||||||
"globalStyle": {
|
"globalStyle": {
|
||||||
"navigationBarTextStyle": "black",
|
"navigationBarTextStyle": "black",
|
||||||
"navigationBarTitleText": "",
|
"navigationBarTitleText": "uni-app",
|
||||||
"navigationBarBackgroundColor": "#FDFDFD"
|
"navigationBarBackgroundColor": "#F8F8F8",
|
||||||
// "navigationStyle": "custom"
|
"backgroundColor": "#F8F8F8"
|
||||||
},
|
},
|
||||||
"tabBar": {
|
"tabBar": {
|
||||||
"selectedColor": "#1A1A1A",
|
"selectedColor": "#1A1A1A",
|
||||||
@ -429,7 +429,8 @@
|
|||||||
"autoscan": true,
|
"autoscan": true,
|
||||||
"custom": {
|
"custom": {
|
||||||
"^u-(.*)": "uview-ui/components/u-$1/u-$1.vue",
|
"^u-(.*)": "uview-ui/components/u-$1/u-$1.vue",
|
||||||
"^brand-filter": "@/components/brandFilter.vue"
|
"^brand-filter": "@/components/brandFilter.vue",
|
||||||
|
"^activity-item": "@/components/ActivityItem.vue"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -31,44 +31,17 @@
|
|||||||
:refresher-triggered="isRefreshing"
|
:refresher-triggered="isRefreshing"
|
||||||
@refresherrefresh="onRefresh"
|
@refresherrefresh="onRefresh"
|
||||||
>
|
>
|
||||||
<view class="activity-item flex" v-for="(it, index) in activeList" :key="index" @click="toDetail(it)">
|
<activity-item
|
||||||
<view class="left flex flex-col justify-between align-center">
|
v-for="(item, index) in activeList"
|
||||||
<image :src="it.brandLogo" style="width: 140rpx;height: 140rpx;"></image>
|
:key="index"
|
||||||
<text>活动状态</text>
|
:item="item"
|
||||||
<view v-if="it.audit_status == 0" style="color: #9E9E9E;font-size: 24rpx;">待审核</view>
|
@click="toDetail"
|
||||||
<view v-if="it.audit_status == 2" style="color: #DE3C4B;font-size: 24rpx;">未通过</view>
|
@review="toReview"
|
||||||
<view v-if="it.audit_status == 1">
|
/>
|
||||||
<block v-if="it.activity_status == 1">
|
|
||||||
<view class="margin-bottom-xs" style="color: #9E9E9E;font-size: 24rpx;">招募进行中</view>
|
|
||||||
<view>
|
|
||||||
<text style="font-size: 72rpx; color: #DE3C4B;">{{it.remainingDays}}</text>天
|
|
||||||
</view>
|
|
||||||
</block>
|
|
||||||
<block v-else>
|
|
||||||
<view style="color: #9E9E9E;font-size: 24rpx;">活动已结束</view>
|
|
||||||
</block>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="right">
|
|
||||||
<view class="title">{{ it.breweryName }}</view>
|
|
||||||
<view class="sub">时间:首次扫码开始累计 <text style="color:#DE3C4B">{{it.duration}}天内</text></view>
|
|
||||||
<view class="sub">目标:全系列酒款累积扫码 ≥ {{ it.activityTarget}}桶</view>
|
|
||||||
<scroll-view v-if="it.beers" scroll-x="true" class="scroll-img">
|
|
||||||
<view class="beer-box" v-for="(beer, beerIndex) in it.beers" :key="beerIndex" @click="toReview(beer)">
|
|
||||||
<image v-if="beer.cover" :src="beer.cover" class="cover"></image>
|
|
||||||
</view>
|
|
||||||
</scroll-view>
|
|
||||||
<view class="flex align-center">
|
|
||||||
<text v-if="it.activityRewardType == 2 || (it.activityRewardType == 1 && it.activityRewardGoods)" class="zeng">赠</text>
|
|
||||||
<text v-if="it.activityRewardType == 1 && it.activityRewardGoods" style="color: #0B0E26;font-size: 24rpx;">{{it.activityRewardGoods.goodsName}} * {{it.activityRewardCount}}</text>
|
|
||||||
<text v-if="it.activityRewardType == 2" style="color: #0B0E26;font-size: 24rpx;">啤酒币 * {{it.activityRewardCount}}个</text>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="cu-load" :class="loading?'loading': activeList.length == total ? 'over' :'more'"></view>
|
<view class="cu-load" :class="loading?'loading': activeList.length == total ? 'over' :'more'"></view>
|
||||||
</scroll-view>
|
</scroll-view>
|
||||||
</view>
|
</view>
|
||||||
<loginPopup ref="loginRef"></loginPopup>
|
<login-popup ref="loginRef"></login-popup>
|
||||||
<!-- 品牌筛选组件 -->
|
<!-- 品牌筛选组件 -->
|
||||||
<brand-filter ref="brandFilterRef" @confirm="onBrandFilterConfirm"></brand-filter>
|
<brand-filter ref="brandFilterRef" @confirm="onBrandFilterConfirm"></brand-filter>
|
||||||
</view>
|
</view>
|
||||||
@ -81,11 +54,13 @@
|
|||||||
} from '@/api/bar.js'
|
} from '@/api/bar.js'
|
||||||
import loginPopup from '@/components/loginPopup.vue'
|
import loginPopup from '@/components/loginPopup.vue'
|
||||||
import brandFilter from '@/components/brandFilter.vue'
|
import brandFilter from '@/components/brandFilter.vue'
|
||||||
|
import ActivityItem from '@/components/ActivityItem.vue'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
loginPopup,
|
loginPopup,
|
||||||
brandFilter
|
brandFilter,
|
||||||
|
ActivityItem
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
@ -22,12 +22,11 @@
|
|||||||
<text>登录/认证</text>
|
<text>登录/认证</text>
|
||||||
</block>
|
</block>
|
||||||
<block v-else-if="userStatus === 'unverified'">
|
<block v-else-if="userStatus === 'unverified'">
|
||||||
<!-- <text>您的门店未认证</text> -->
|
|
||||||
<text>请点击认证门店信息</text>
|
<text>请点击认证门店信息</text>
|
||||||
</block>
|
</block>
|
||||||
<block v-else-if="userStatus === 'verifying'">
|
<block v-else-if="userStatus === 'verifying'">
|
||||||
<text>正在认证审核中</text>
|
<text>正在认证审核中</text>
|
||||||
<!-- <text>请耐心等待</text> -->
|
<text style="font-size: 24rpx; color: #999;">请耐心等待</text>
|
||||||
</block>
|
</block>
|
||||||
</view>
|
</view>
|
||||||
<text class="cuIcon-right" style="color: #999999; font-size: 32rpx;"></text>
|
<text class="cuIcon-right" style="color: #999999; font-size: 32rpx;"></text>
|
||||||
@ -133,6 +132,13 @@
|
|||||||
computed: {
|
computed: {
|
||||||
// 用户状态
|
// 用户状态
|
||||||
userStatus() {
|
userStatus() {
|
||||||
|
// 添加调试日志
|
||||||
|
console.log('计算用户状态:', {
|
||||||
|
isLoggedIn: this.isLoggedIn,
|
||||||
|
barInfo: this.barInfo,
|
||||||
|
authState: this.barInfo ? this.barInfo.authState : 'barInfo为空'
|
||||||
|
});
|
||||||
|
|
||||||
if (!this.isLoggedIn) return 'guest' // 游客
|
if (!this.isLoggedIn) return 'guest' // 游客
|
||||||
if (!this.barInfo || this.barInfo.authState === 0) return 'unverified' // 未认证
|
if (!this.barInfo || this.barInfo.authState === 0) return 'unverified' // 未认证
|
||||||
if (this.barInfo.authState === 1) return 'verifying' // 认证中
|
if (this.barInfo.authState === 1) return 'verifying' // 认证中
|
||||||
@ -143,10 +149,15 @@
|
|||||||
this.statusBaeHeight = uni.getWindowInfo.statusBarHeight
|
this.statusBaeHeight = uni.getWindowInfo.statusBarHeight
|
||||||
},
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
this.checkLoginStatus()
|
console.log('页面显示,检查登录状态');
|
||||||
|
this.checkLoginStatus();
|
||||||
|
|
||||||
if (this.isLoggedIn) {
|
if (this.isLoggedIn) {
|
||||||
this.getBarInfoFun()
|
console.log('已登录,获取酒吧信息和扫码数据');
|
||||||
this.getMyScanDataFun()
|
this.getBarInfoFun();
|
||||||
|
this.getMyScanDataFun();
|
||||||
|
} else {
|
||||||
|
console.log('未登录,不获取数据');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
@ -177,42 +188,104 @@
|
|||||||
this.userInfo = userInfo
|
this.userInfo = userInfo
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 添加调试日志
|
||||||
|
console.log('登录状态检查:', {
|
||||||
|
token: token,
|
||||||
|
isLoggedIn: this.isLoggedIn,
|
||||||
|
userInfo: this.userInfo
|
||||||
|
})
|
||||||
|
|
||||||
this.loading = false
|
this.loading = false
|
||||||
},
|
},
|
||||||
loginSuccess() {
|
loginSuccess() {
|
||||||
this.userInfo = uni.getStorageSync('userInfo')
|
console.log('登录成功,开始更新页面数据');
|
||||||
this.getBarInfoFun()
|
// 更新登录状态
|
||||||
this.getMyScanDataFun()
|
this.isLoggedIn = true;
|
||||||
|
this.userInfo = uni.getStorageSync('userInfo');
|
||||||
|
|
||||||
|
// 使用 Promise.all 同时获取所有需要的数据
|
||||||
|
Promise.all([
|
||||||
|
this.getBarInfoFun(),
|
||||||
|
this.getMyScanDataFun()
|
||||||
|
]).then(() => {
|
||||||
|
console.log('所有数据更新完成');
|
||||||
|
// 强制更新视图
|
||||||
|
this.$forceUpdate();
|
||||||
|
// 显示登录成功提示
|
||||||
|
uni.showToast({
|
||||||
|
title: '登录成功',
|
||||||
|
icon: 'success',
|
||||||
|
duration: 1500
|
||||||
|
});
|
||||||
|
}).catch(err => {
|
||||||
|
console.error('数据更新失败:', err);
|
||||||
|
uni.showToast({
|
||||||
|
title: '数据更新失败',
|
||||||
|
icon: 'none'
|
||||||
|
});
|
||||||
|
});
|
||||||
},
|
},
|
||||||
// 获取酒吧信息
|
// 获取酒吧信息
|
||||||
getBarInfoFun() {
|
getBarInfoFun() {
|
||||||
if (!this.isLoggedIn) return
|
if (!this.isLoggedIn) {
|
||||||
|
console.log('用户未登录,不获取酒吧信息')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
getBarInfo().then(res => {
|
getBarInfo().then(res => {
|
||||||
if (res.code === 200) {
|
console.log('获取酒吧信息成功:', res)
|
||||||
|
if (res && res.data) {
|
||||||
this.barInfo = res.data
|
this.barInfo = res.data
|
||||||
|
// 更新认证状态
|
||||||
|
if (this.barInfo.authState === 2) {
|
||||||
|
// 已认证
|
||||||
|
this.isVerified = true
|
||||||
|
this.isVerifying = false
|
||||||
|
} else if (this.barInfo.authState === 1) {
|
||||||
|
// 认证中
|
||||||
|
this.isVerified = false
|
||||||
|
this.isVerifying = true
|
||||||
|
} else {
|
||||||
|
// 未认证
|
||||||
|
this.isVerified = false
|
||||||
|
this.isVerifying = false
|
||||||
|
}
|
||||||
|
// 强制更新视图
|
||||||
|
this.$forceUpdate()
|
||||||
|
} else {
|
||||||
|
console.log('获取酒吧信息成功,但数据为空')
|
||||||
|
this.barInfo = null
|
||||||
|
this.isVerified = false
|
||||||
|
this.isVerifying = false
|
||||||
}
|
}
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
console.error('获取酒吧信息失败:', err)
|
console.error('获取酒吧信息失败:', err)
|
||||||
uni.showToast({
|
this.barInfo = null
|
||||||
title: '获取酒吧信息失败',
|
this.isVerified = false
|
||||||
icon: 'none'
|
this.isVerifying = false
|
||||||
})
|
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
// 获取我的扫码数据
|
// 获取我的扫码数据
|
||||||
getMyScanDataFun() {
|
getMyScanDataFun() {
|
||||||
if (!this.isLoggedIn) return
|
if (!this.isLoggedIn) {
|
||||||
getMyScanData().then(res => {
|
return Promise.reject('未登录');
|
||||||
|
}
|
||||||
|
|
||||||
|
return getMyScanData().then(res => {
|
||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
this.myScanData = res.data
|
this.myScanData = res.data;
|
||||||
|
return this.myScanData;
|
||||||
|
} else {
|
||||||
|
return Promise.reject(res);
|
||||||
}
|
}
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
console.error('获取扫码数据失败:', err)
|
console.error('获取扫码数据失败:', err);
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '获取扫码数据失败',
|
title: '获取扫码数据失败',
|
||||||
icon: 'none'
|
icon: 'none'
|
||||||
})
|
});
|
||||||
})
|
return Promise.reject(err);
|
||||||
|
});
|
||||||
},
|
},
|
||||||
// 处理用户信息区域点击
|
// 处理用户信息区域点击
|
||||||
handleUserBoxClick() {
|
handleUserBoxClick() {
|
||||||
|
@ -602,12 +602,39 @@ export default {
|
|||||||
// 隐藏加载提示
|
// 隐藏加载提示
|
||||||
uni.hideLoading();
|
uni.hideLoading();
|
||||||
|
|
||||||
|
// 处理特定错误情况
|
||||||
|
let errorMessage = error.message || '提交失败';
|
||||||
|
|
||||||
|
// 检查是否是手机号已注册的错误
|
||||||
|
if (errorMessage.includes('手机号') && errorMessage.includes('已注册')) {
|
||||||
|
errorMessage = '该手机号已注册,请直接登录或使用其他手机号';
|
||||||
|
} else if (errorMessage.includes('手机号') && errorMessage.includes('存在')) {
|
||||||
|
errorMessage = '该手机号已存在,请直接登录或使用其他手机号';
|
||||||
|
}
|
||||||
|
|
||||||
// 显示错误提示
|
// 显示错误提示
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: error.message || '提交失败',
|
title: errorMessage,
|
||||||
icon: 'none',
|
icon: 'none',
|
||||||
duration: 2000
|
duration: 3000
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// 如果是手机号已注册的错误,提供登录选项
|
||||||
|
if (errorMessage.includes('手机号') && (errorMessage.includes('已注册') || errorMessage.includes('已存在'))) {
|
||||||
|
setTimeout(() => {
|
||||||
|
uni.showModal({
|
||||||
|
title: '提示',
|
||||||
|
content: '是否前往登录页面?',
|
||||||
|
success: (res) => {
|
||||||
|
if (res.confirm) {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '/pages/index/phoneLogin'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}, 1500);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -377,7 +377,7 @@
|
|||||||
|
|
||||||
// 检查认证状态
|
// 检查认证状态
|
||||||
const barInfo = uni.getStorageSync('barInfo')
|
const barInfo = uni.getStorageSync('barInfo')
|
||||||
if (!barInfo || barInfo.authState !== 2) {
|
if (!barInfo) {
|
||||||
uni.showModal({
|
uni.showModal({
|
||||||
title: '提示',
|
title: '提示',
|
||||||
content: '请先认证门店',
|
content: '请先认证门店',
|
||||||
@ -393,6 +393,29 @@
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 处理不同的认证状态
|
||||||
|
if (barInfo.authState === 0) {
|
||||||
|
uni.showModal({
|
||||||
|
title: '提示',
|
||||||
|
content: '请先认证门店',
|
||||||
|
showCancel: true,
|
||||||
|
success: (res) => {
|
||||||
|
if (res.confirm) {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '/pages/index/registration'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
return
|
||||||
|
} else if (barInfo.authState === 1) {
|
||||||
|
uni.showToast({
|
||||||
|
title: '您的门店正在认证中,请耐心等待',
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/pages/index/writeReview?beerId=' + this.beerId
|
url: '/pages/index/writeReview?beerId=' + this.beerId
|
||||||
})
|
})
|
||||||
@ -420,7 +443,7 @@
|
|||||||
|
|
||||||
// 检查认证状态
|
// 检查认证状态
|
||||||
const barInfo = uni.getStorageSync('barInfo')
|
const barInfo = uni.getStorageSync('barInfo')
|
||||||
if (!barInfo || barInfo.authState !== 2) {
|
if (!barInfo) {
|
||||||
uni.showModal({
|
uni.showModal({
|
||||||
title: '提示',
|
title: '提示',
|
||||||
content: '请先认证门店',
|
content: '请先认证门店',
|
||||||
@ -436,6 +459,29 @@
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 处理不同的认证状态
|
||||||
|
if (barInfo.authState === 0) {
|
||||||
|
uni.showModal({
|
||||||
|
title: '提示',
|
||||||
|
content: '请先认证门店',
|
||||||
|
showCancel: true,
|
||||||
|
success: (res) => {
|
||||||
|
if (res.confirm) {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '/pages/index/registration'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
return
|
||||||
|
} else if (barInfo.authState === 1) {
|
||||||
|
uni.showToast({
|
||||||
|
title: '您的门店正在认证中,请耐心等待',
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
let data = {
|
let data = {
|
||||||
beerId: this.beerId,
|
beerId: this.beerId,
|
||||||
status
|
status
|
||||||
@ -492,7 +538,7 @@
|
|||||||
|
|
||||||
// 检查认证状态
|
// 检查认证状态
|
||||||
const barInfo = uni.getStorageSync('barInfo')
|
const barInfo = uni.getStorageSync('barInfo')
|
||||||
if (!barInfo || barInfo.authState !== 2) {
|
if (!barInfo) {
|
||||||
uni.showModal({
|
uni.showModal({
|
||||||
title: '提示',
|
title: '提示',
|
||||||
content: '请先认证门店',
|
content: '请先认证门店',
|
||||||
@ -508,6 +554,29 @@
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 处理不同的认证状态
|
||||||
|
if (barInfo.authState === 0) {
|
||||||
|
uni.showModal({
|
||||||
|
title: '提示',
|
||||||
|
content: '请先认证门店',
|
||||||
|
showCancel: true,
|
||||||
|
success: (res) => {
|
||||||
|
if (res.confirm) {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '/pages/index/registration'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
return
|
||||||
|
} else if (barInfo.authState === 1) {
|
||||||
|
uni.showToast({
|
||||||
|
title: '您的门店正在认证中,请耐心等待',
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: "/pagesActivity/winelist?beerId=" + this.beerId
|
url: "/pagesActivity/winelist?beerId=" + this.beerId
|
||||||
})
|
})
|
||||||
|
@ -128,6 +128,7 @@
|
|||||||
barInfo: null,
|
barInfo: null,
|
||||||
isLoggedIn: false,
|
isLoggedIn: false,
|
||||||
isVerified: false,
|
isVerified: false,
|
||||||
|
isVerifying: false,
|
||||||
navHeight: 0,
|
navHeight: 0,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
@ -149,11 +150,32 @@
|
|||||||
this.isLoggedIn = !!token
|
this.isLoggedIn = !!token
|
||||||
this.userInfo = userInfo
|
this.userInfo = userInfo
|
||||||
this.barInfo = barInfo
|
this.barInfo = barInfo
|
||||||
this.isVerified = barInfo && barInfo.authState === 2
|
|
||||||
|
// 检查认证状态
|
||||||
|
if (barInfo) {
|
||||||
|
if (barInfo.authState === 2) {
|
||||||
|
// 已认证
|
||||||
|
this.isVerified = true
|
||||||
|
this.isVerifying = false
|
||||||
|
} else if (barInfo.authState === 1) {
|
||||||
|
// 认证中
|
||||||
|
this.isVerified = false
|
||||||
|
this.isVerifying = true
|
||||||
|
} else {
|
||||||
|
// 未认证
|
||||||
|
this.isVerified = false
|
||||||
|
this.isVerifying = false
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// 兼容旧版本,使用userInfo中的isVerified
|
||||||
|
this.isVerified = userInfo?.isVerified === 1
|
||||||
|
this.isVerifying = false
|
||||||
|
}
|
||||||
|
|
||||||
console.log('【checkLoginStatus】登录状态:', {
|
console.log('【checkLoginStatus】登录状态:', {
|
||||||
isLoggedIn: this.isLoggedIn,
|
isLoggedIn: this.isLoggedIn,
|
||||||
isVerified: this.isVerified,
|
isVerified: this.isVerified,
|
||||||
|
isVerifying: this.isVerifying,
|
||||||
userInfo: this.userInfo,
|
userInfo: this.userInfo,
|
||||||
barInfo: this.barInfo
|
barInfo: this.barInfo
|
||||||
})
|
})
|
||||||
@ -182,7 +204,7 @@
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!this.isVerified) {
|
if (!this.isVerified && !this.isVerifying) {
|
||||||
uni.showModal({
|
uni.showModal({
|
||||||
title: '提示',
|
title: '提示',
|
||||||
content: '请先认证门店',
|
content: '请先认证门店',
|
||||||
@ -198,6 +220,14 @@
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (this.isVerifying) {
|
||||||
|
uni.showToast({
|
||||||
|
title: '您的门店正在认证中,请耐心等待',
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
uni.getSetting({
|
uni.getSetting({
|
||||||
success: (res) => {
|
success: (res) => {
|
||||||
if (!res.authSetting['scope.userLocation']) {
|
if (!res.authSetting['scope.userLocation']) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user