Compare commits
2 Commits
2fdbba6fa0
...
7c565ff4ad
Author | SHA1 | Date | |
---|---|---|---|
![]() |
7c565ff4ad | ||
![]() |
913118d58e |
@ -1,5 +1,14 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="page-content">
|
<view class="page-content">
|
||||||
|
<!-- 自定义导航栏 -->
|
||||||
|
<view class="custom-nav" :style="{ paddingTop: statusBarHeight + 'px' }">
|
||||||
|
<view class="nav-content">
|
||||||
|
<view class="back-btn" @click="goBack">
|
||||||
|
<text class="cuIcon-back"></text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
<image class="banner" :src="breweryInfo.brandCover"></image>
|
<image class="banner" :src="breweryInfo.brandCover"></image>
|
||||||
<view class="brand-header">
|
<view class="brand-header">
|
||||||
<view style="padding:0 24rpx">
|
<view style="padding:0 24rpx">
|
||||||
@ -137,6 +146,7 @@
|
|||||||
</scroll-view>
|
</scroll-view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
<!-- 登录弹窗组件 -->
|
||||||
<loginPopup ref="loginRef" @loginSuccess="loginSuccess"></loginPopup>
|
<loginPopup ref="loginRef" @loginSuccess="loginSuccess"></loginPopup>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
@ -160,6 +170,7 @@
|
|||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
statusBarHeight: 0, // 状态栏高度
|
||||||
breweryId: '',
|
breweryId: '',
|
||||||
currentTab: 1,
|
currentTab: 1,
|
||||||
breweryInfo: {}, // 品牌方详情
|
breweryInfo: {}, // 品牌方详情
|
||||||
@ -184,6 +195,9 @@
|
|||||||
onLoad({
|
onLoad({
|
||||||
breweryId
|
breweryId
|
||||||
}) {
|
}) {
|
||||||
|
// 获取状态栏高度
|
||||||
|
this.statusBarHeight = uni.getSystemInfoSync().statusBarHeight
|
||||||
|
|
||||||
this.breweryId = breweryId
|
this.breweryId = breweryId
|
||||||
this.queryForm.id = breweryId
|
this.queryForm.id = breweryId
|
||||||
this.getBreweryInfoFun()
|
this.getBreweryInfoFun()
|
||||||
@ -195,6 +209,10 @@
|
|||||||
this.getBreweryCoinBalanceFun() // 啤酒币余额
|
this.getBreweryCoinBalanceFun() // 啤酒币余额
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
// 返回上一页
|
||||||
|
goBack() {
|
||||||
|
uni.navigateBack()
|
||||||
|
},
|
||||||
changeTab(index) {
|
changeTab(index) {
|
||||||
this.currentTab = index
|
this.currentTab = index
|
||||||
this.queryForm.pageNum = 1
|
this.queryForm.pageNum = 1
|
||||||
@ -240,10 +258,6 @@
|
|||||||
},
|
},
|
||||||
// 啤酒币余额
|
// 啤酒币余额
|
||||||
getBreweryCoinBalanceFun() {
|
getBreweryCoinBalanceFun() {
|
||||||
if (!uni.getStorageSync('token')) {
|
|
||||||
this.$refs.loginRef.open()
|
|
||||||
return
|
|
||||||
}
|
|
||||||
getBreweryCoinBalance(this.breweryId).then(res => {
|
getBreweryCoinBalance(this.breweryId).then(res => {
|
||||||
if (res.data) {
|
if (res.data) {
|
||||||
this.myCoin = res.data.balance
|
this.myCoin = res.data.balance
|
||||||
@ -252,10 +266,6 @@
|
|||||||
},
|
},
|
||||||
// 收藏品牌方状态
|
// 收藏品牌方状态
|
||||||
getBreweryFavorStatusFun() {
|
getBreweryFavorStatusFun() {
|
||||||
if (!uni.getStorageSync('token')) {
|
|
||||||
this.$refs.loginRef.open()
|
|
||||||
return
|
|
||||||
}
|
|
||||||
getBreweryFavorStatus(this.breweryId).then(res => {
|
getBreweryFavorStatus(this.breweryId).then(res => {
|
||||||
if (res.data) {
|
if (res.data) {
|
||||||
this.isFavor = true
|
this.isFavor = true
|
||||||
@ -362,10 +372,6 @@
|
|||||||
},
|
},
|
||||||
// 收藏品牌方
|
// 收藏品牌方
|
||||||
favorBreweryFun(status) {
|
favorBreweryFun(status) {
|
||||||
if (!uni.getStorageSync('token')) {
|
|
||||||
this.$refs.loginRef.open()
|
|
||||||
return
|
|
||||||
}
|
|
||||||
let data = {
|
let data = {
|
||||||
breweryId: this.breweryId,
|
breweryId: this.breweryId,
|
||||||
status
|
status
|
||||||
@ -381,10 +387,8 @@
|
|||||||
title: '取消收藏',
|
title: '取消收藏',
|
||||||
icon: 'none'
|
icon: 'none'
|
||||||
})
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
this.getBreweryFavorStatusFun()
|
this.getBreweryFavorStatusFun()
|
||||||
|
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
// 跳转详情
|
// 跳转详情
|
||||||
@ -405,9 +409,41 @@
|
|||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.page-content {
|
.page-content {
|
||||||
|
.custom-nav {
|
||||||
|
position: fixed;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
z-index: 999;
|
||||||
|
background: transparent;
|
||||||
|
|
||||||
|
.nav-content {
|
||||||
|
height: 44px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
padding: 0 32rpx;
|
||||||
|
|
||||||
|
.back-btn {
|
||||||
|
width: 64rpx;
|
||||||
|
height: 64rpx;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
background: rgba(255, 255, 255, 0.8);
|
||||||
|
border-radius: 50%;
|
||||||
|
|
||||||
|
.cuIcon-back {
|
||||||
|
font-size: 36rpx;
|
||||||
|
color: #000;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.banner {
|
.banner {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 724rpx;
|
height: 724rpx;
|
||||||
|
margin-top: v-bind('statusBarHeight + 44 + "px"');
|
||||||
}
|
}
|
||||||
|
|
||||||
.brand-header {
|
.brand-header {
|
||||||
|
@ -543,6 +543,22 @@ export default {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 添加调试日志
|
||||||
|
console.log('提交的表单数据:', {
|
||||||
|
完整表单: this.form,
|
||||||
|
酒吧名称: this.form.bar_name,
|
||||||
|
联系电话: this.form.bar_contact_phone,
|
||||||
|
省份: this.form.province,
|
||||||
|
城市: this.form.city,
|
||||||
|
区域: this.form.district,
|
||||||
|
地址: this.form.address,
|
||||||
|
营业执照: this.form.business_license,
|
||||||
|
门头照片: this.form.storefront_photo,
|
||||||
|
纬度: this.form.latitude,
|
||||||
|
经度: this.form.longitude,
|
||||||
|
openId: this.form.openId
|
||||||
|
});
|
||||||
|
|
||||||
// 显示加载提示
|
// 显示加载提示
|
||||||
uni.showLoading({
|
uni.showLoading({
|
||||||
title: '提交中',
|
title: '提交中',
|
||||||
|
@ -1,90 +1,98 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="page-content">
|
<view class="page">
|
||||||
<image class="banner" :src="breweryInfo.brandCover"></image>
|
<view class="content">
|
||||||
<view class="info">
|
<!-- 自定义导航栏 -->
|
||||||
<view class="flex justify-between align-center" style="margin-bottom: 32rpx;" @click="goBreweryDetail">
|
<view class="custom-nav" :style="{ paddingTop: statusBarHeight + 'px' }">
|
||||||
<view class="flex align-center">
|
<view class="nav-content">
|
||||||
<image :src="breweryInfo.brandLogo" class="cover"></image>
|
<view class="back-btn" @click="goBack">
|
||||||
<view>
|
<text class="cuIcon-back"></text>
|
||||||
<view>服务商家</view>
|
|
||||||
<view style="font-size: 32rpx;color: #303048">{{ breweryInfo.brandName}}</view>
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<text class="cuIcon-right lg"></text>
|
|
||||||
</view>
|
|
||||||
<view class="flex align-start" style="margin-bottom: 28rpx;">
|
|
||||||
<view class="flex solids-right justify-between padding-right"
|
|
||||||
style="flex-direction: column;min-height: 136rpx;">
|
|
||||||
<text style="color: #000;font-size: 36rpx;width: 468rpx;">{{ detail.goodsName}}</text>
|
|
||||||
<text style="color: #5E5F60;font-size: 24rpx;">限量{{ detail.stockNum}}套,兑完即止</text>
|
|
||||||
</view>
|
|
||||||
<view class="text-center" style="width: 206rpx;font-size: 24rpx;">
|
|
||||||
已兑<text style="color: #39E5B1;font-size: 36rpx;margin-left: 8rpx;font-weight: 700;">{{ detail.salesCount }}份</text>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="flex align-center">
|
|
||||||
<image src="@/static/info-circle.png" style="width: 48rpx;height: 48rpx;margin-right: 16rpx;"></image>
|
|
||||||
<text style="color: #5E5F60;font-size: 24rpx;">限购说明:此商品每人限兑1件</text>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<!-- <view class="container"> -->
|
|
||||||
<!-- 这里是好礼介绍 -->
|
|
||||||
<!-- <view class="text-center" style="font-size: 28rpx;color: #000;">
|
|
||||||
好礼介绍
|
|
||||||
</view>
|
|
||||||
<view>
|
|
||||||
|
|
||||||
<image :src="detail.goodsCover" style="width: 260rpx;height: 300rpx;"></image>
|
|
||||||
</view> -->
|
|
||||||
<!-- 这里是兑换须知 -->
|
|
||||||
<!-- <view class="text-center" style="font-size: 28rpx;color:#000;">
|
|
||||||
——兑换须知——
|
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view>
|
<image class="banner" :src="breweryInfo.brandCover"></image>
|
||||||
<view style="font-size: 24rpx;color: #5E5F60;margin-bottom: 20rpx;">1.兑换时间:2022年12月1日-2022年12月31日</view>
|
<view class="info">
|
||||||
<view style="font-size: 24rpx;color: #5E5F60;margin-bottom: 20rpx;">2.兑换地点:大九酿造·Mahanine</view>
|
<view class="flex justify-between align-center" style="margin-bottom: 32rpx;" @click="goBreweryDetail">
|
||||||
<view style="font-size: 24rpx;color: #5E5F60;margin-bottom: 20rpx;">3.兑换方式:线下兑换</view>
|
<view class="flex align-center">
|
||||||
<view style="font-size: 24rpx;color: #5E5F60;margin-bottom: 20rpx;">4.兑换数量:每人限兑1件</view>
|
<image :src="breweryInfo.brandLogo" class="cover"></image>
|
||||||
<view style="font-size: 24rpx;color: #5E5F60;margin-bottom: 20rpx;">5.兑换后,请到兑换地点领取</view>
|
<view>
|
||||||
<view style="font-size: 24rpx;color: #5E5F60;margin-bottom: 20rpx;">6.兑换后,请到兑换地点领取</view>
|
<view>服务商家</view>
|
||||||
<view style="font-size: 24rpx;color: #5E5F60;margin-bottom: 20rpx;">7.兑换后,请到兑换地点领取</view>
|
<view style="font-size: 32rpx;color: #303048">{{ breweryInfo.brandName}}</view>
|
||||||
<view style="font-size: 24rpx;color: #5E5F60;margin-bottom: 20rpx;">8.兑换后,请到兑换地点领取</view>
|
</view>
|
||||||
</view> -->
|
|
||||||
<!-- </view> -->
|
|
||||||
<!-- 兑换按钮区 -->
|
|
||||||
<view class="bottom-box">
|
|
||||||
<view v-if="!coinBalance.balance || coinBalance.balance < detail.redeemedNum" class="tip">
|
|
||||||
<image src="@/static/warning.png" style="margin-right: 24rpx;width: 25rpx;height: 25rpx;"></image>
|
|
||||||
<text>您的{{breweryInfo.brandName}}品牌币数量不足哦</text>
|
|
||||||
</view>
|
|
||||||
<view class="fun-box">
|
|
||||||
<view class="left">
|
|
||||||
<view style="margin-bottom: 20rpx;">{{ detail.redeemedNum}}
|
|
||||||
<image src="@/static/beerCoin.png" style="width: 30rpx;height: 30rpx;margin-left: 20rpx;">
|
|
||||||
</image>
|
|
||||||
</view>
|
</view>
|
||||||
<view class="flex align-center">当前可用品牌币:{{ coinBalance.balance}}<image src="@/static/beerCoin.png"
|
<text class="cuIcon-right lg"></text>
|
||||||
style="width: 30rpx;height: 30rpx;margin-left: 20rpx;">
|
|
||||||
</image>
|
|
||||||
</view>
|
|
||||||
<!-- <view class="flex align-center">当前可用通用币:0<image src="@/static/beerCoin.png"
|
|
||||||
style="width: 30rpx;height: 30rpx;margin-left: 20rpx;">
|
|
||||||
</image>
|
|
||||||
</view> -->
|
|
||||||
</view>
|
</view>
|
||||||
<view class="btn" @click="handleRedeem">
|
<view class="flex align-start" style="margin-bottom: 28rpx;">
|
||||||
立即兑换
|
<view class="flex solids-right justify-between padding-right"
|
||||||
|
style="flex-direction: column;min-height: 136rpx;">
|
||||||
|
<text style="color: #000;font-size: 36rpx;width: 468rpx;">{{ detail.goodsName}}</text>
|
||||||
|
<text style="color: #5E5F60;font-size: 24rpx;">限量{{ detail.stockNum}}套,兑完即止</text>
|
||||||
|
</view>
|
||||||
|
<view class="text-center" style="width: 206rpx;font-size: 24rpx;">
|
||||||
|
已兑<text style="color: #39E5B1;font-size: 36rpx;margin-left: 8rpx;font-weight: 700;">{{ detail.salesCount }}份</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="flex align-center">
|
||||||
|
<image src="@/static/info-circle.png" style="width: 48rpx;height: 48rpx;margin-right: 16rpx;"></image>
|
||||||
|
<text style="color: #5E5F60;font-size: 24rpx;">限购说明:此商品每人限兑1件</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<!-- <view class="container"> -->
|
||||||
|
<!-- 这里是好礼介绍 -->
|
||||||
|
<!-- <view class="text-center" style="font-size: 28rpx;color: #000;">
|
||||||
|
好礼介绍
|
||||||
|
</view>
|
||||||
|
<view>
|
||||||
|
|
||||||
|
<image :src="detail.goodsCover" style="width: 260rpx;height: 300rpx;"></image>
|
||||||
|
</view> -->
|
||||||
|
<!-- 这里是兑换须知 -->
|
||||||
|
<!-- <view class="text-center" style="font-size: 28rpx;color:#000;">
|
||||||
|
——兑换须知——
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view>
|
||||||
|
<view style="font-size: 24rpx;color: #5E5F60;margin-bottom: 20rpx;">1.兑换时间:2022年12月1日-2022年12月31日</view>
|
||||||
|
<view style="font-size: 24rpx;color: #5E5F60;margin-bottom: 20rpx;">2.兑换地点:大九酿造·Mahanine</view>
|
||||||
|
<view style="font-size: 24rpx;color: #5E5F60;margin-bottom: 20rpx;">3.兑换方式:线下兑换</view>
|
||||||
|
<view style="font-size: 24rpx;color: #5E5F60;margin-bottom: 20rpx;">4.兑换数量:每人限兑1件</view>
|
||||||
|
<view style="font-size: 24rpx;color: #5E5F60;margin-bottom: 20rpx;">5.兑换后,请到兑换地点领取</view>
|
||||||
|
<view style="font-size: 24rpx;color: #5E5F60;margin-bottom: 20rpx;">6.兑换后,请到兑换地点领取</view>
|
||||||
|
<view style="font-size: 24rpx;color: #5E5F60;margin-bottom: 20rpx;">7.兑换后,请到兑换地点领取</view>
|
||||||
|
<view style="font-size: 24rpx;color: #5E5F60;margin-bottom: 20rpx;">8.兑换后,请到兑换地点领取</view>
|
||||||
|
</view> -->
|
||||||
|
<!-- </view> -->
|
||||||
|
<!-- 兑换按钮区 -->
|
||||||
|
<view class="bottom-box">
|
||||||
|
<view v-if="isLogin && coinBalance.balance < detail.redeemedNum" class="tip">
|
||||||
|
<image src="@/static/warning.png" style="margin-right: 24rpx;width: 25rpx;height: 25rpx;"></image>
|
||||||
|
<text>您的{{breweryInfo.brandName}}品牌币数量不足哦</text>
|
||||||
|
</view>
|
||||||
|
<view class="fun-box">
|
||||||
|
<view class="left">
|
||||||
|
<view style="margin-bottom: 20rpx;">{{ detail.redeemedNum}}
|
||||||
|
<image src="@/static/beerCoin.png" style="width: 30rpx;height: 30rpx;margin-left: 20rpx;">
|
||||||
|
</image>
|
||||||
|
</view>
|
||||||
|
<view class="flex align-center">当前可用品牌币:{{ isLogin ? (coinBalance.balance || 0) : '登录后可见' }}<image src="@/static/beerCoin.png"
|
||||||
|
style="width: 30rpx;height: 30rpx;margin-left: 20rpx;">
|
||||||
|
</image>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="btn" @click="handleRedeem">
|
||||||
|
立即兑换
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
<!-- 登录弹窗 -->
|
||||||
<loginPopup ref="loginRef"></loginPopup>
|
<loginPopup ref="loginRef"></loginPopup>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import loginPopup from '@/components/loginPopup.vue';
|
import loginPopup from '@/components/loginPopup.vue';
|
||||||
import { getGoodsInfo, getBreweryInfo,getBreweryCoinBalance } from '@/api/bar.js'
|
import { getGoodsInfo, getBreweryInfo, getBreweryCoinBalance } from '@/api/bar.js'
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
loginPopup
|
loginPopup
|
||||||
@ -95,28 +103,63 @@
|
|||||||
breweryId:'', // 品牌方id
|
breweryId:'', // 品牌方id
|
||||||
detail: {},
|
detail: {},
|
||||||
breweryInfo:{},
|
breweryInfo:{},
|
||||||
coinBalance:{}
|
coinBalance:{},
|
||||||
|
isLogin: false, // 登录状态
|
||||||
|
isVerified: false, // 认证状态
|
||||||
|
statusBarHeight: 0, // 状态栏高度
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
onLoad({id, breweryId}) {
|
onLoad({id, breweryId}) {
|
||||||
if (!uni.getStorageSync('token')) {
|
// 获取状态栏高度
|
||||||
this.$refs.loginRef.open()
|
this.statusBarHeight = uni.getSystemInfoSync().statusBarHeight
|
||||||
return
|
|
||||||
}
|
|
||||||
this.id = id
|
this.id = id
|
||||||
this.breweryId = breweryId
|
this.breweryId = breweryId
|
||||||
|
this.checkLoginStatus()
|
||||||
this.getBreweryInfoFun()
|
this.getBreweryInfoFun()
|
||||||
|
this.getDetailFun()
|
||||||
},
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
this.getDetailFun()
|
this.checkLoginStatus()
|
||||||
this.getBreweryCoinBalanceFun()
|
if(this.isLogin) {
|
||||||
|
this.getBreweryCoinBalanceFun()
|
||||||
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
// 返回上一页
|
||||||
|
goBack() {
|
||||||
|
uni.navigateBack()
|
||||||
|
},
|
||||||
|
// 检查登录状态
|
||||||
|
checkLoginStatus() {
|
||||||
|
try {
|
||||||
|
const token = uni.getStorageSync('token')
|
||||||
|
const userInfo = uni.getStorageSync('userInfo')
|
||||||
|
this.isLogin = !!token && !!userInfo
|
||||||
|
this.isVerified = userInfo?.isVerified === 1
|
||||||
|
|
||||||
|
// 如果登录了但没有用户信息,说明登录状态异常
|
||||||
|
if(token && !userInfo) {
|
||||||
|
uni.removeStorageSync('token')
|
||||||
|
this.isLogin = false
|
||||||
|
this.isVerified = false
|
||||||
|
}
|
||||||
|
} catch(e) {
|
||||||
|
console.error('检查登录状态失败:', e)
|
||||||
|
this.isLogin = false
|
||||||
|
this.isVerified = false
|
||||||
|
}
|
||||||
|
},
|
||||||
// 品牌方详情
|
// 品牌方详情
|
||||||
getBreweryInfoFun() {
|
getBreweryInfoFun() {
|
||||||
getBreweryInfo(this.breweryId).then(res => {
|
getBreweryInfo(this.breweryId).then(res => {
|
||||||
this.breweryInfo = res.data
|
this.breweryInfo = res.data
|
||||||
|
}).catch(err => {
|
||||||
|
console.error('获取品牌信息失败:', err)
|
||||||
|
uni.showToast({
|
||||||
|
title: '获取品牌信息失败',
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
// 获取详情
|
// 获取详情
|
||||||
@ -131,7 +174,12 @@
|
|||||||
this.detail = res.data
|
this.detail = res.data
|
||||||
}
|
}
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
|
console.error('获取商品详情失败:', err)
|
||||||
uni.hideLoading()
|
uni.hideLoading()
|
||||||
|
uni.showToast({
|
||||||
|
title: '获取商品详情失败',
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
// 跳转品牌方详情
|
// 跳转品牌方详情
|
||||||
@ -143,12 +191,59 @@
|
|||||||
// 特定品牌啤酒币余额
|
// 特定品牌啤酒币余额
|
||||||
getBreweryCoinBalanceFun() {
|
getBreweryCoinBalanceFun() {
|
||||||
getBreweryCoinBalance(this.breweryId).then(res => {
|
getBreweryCoinBalance(this.breweryId).then(res => {
|
||||||
console.log(res)
|
|
||||||
this.coinBalance = res.data
|
this.coinBalance = res.data
|
||||||
|
}).catch(err => {
|
||||||
|
console.error('获取币种余额失败:', err)
|
||||||
|
uni.showToast({
|
||||||
|
title: '获取币种余额失败',
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
// 兑换
|
// 兑换
|
||||||
handleRedeem() {
|
async handleRedeem() {
|
||||||
|
// 重新检查登录状态
|
||||||
|
this.checkLoginStatus()
|
||||||
|
|
||||||
|
if(!this.isLogin) {
|
||||||
|
// 使用 nextTick 确保组件已加载
|
||||||
|
await this.$nextTick()
|
||||||
|
if(this.$refs.loginRef) {
|
||||||
|
this.$refs.loginRef.open()
|
||||||
|
} else {
|
||||||
|
uni.showToast({
|
||||||
|
title: '请稍后再试',
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!this.isVerified) {
|
||||||
|
uni.showModal({
|
||||||
|
title: '提示',
|
||||||
|
content: '请先完成实名认证',
|
||||||
|
confirmText: '去认证',
|
||||||
|
success: (res) => {
|
||||||
|
if(res.confirm) {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '/pagesMy/verify'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!this.coinBalance.balance || this.coinBalance.balance < this.detail.redeemedNum) {
|
||||||
|
uni.showToast({
|
||||||
|
title: '品牌币余额不足',
|
||||||
|
icon: 'none',
|
||||||
|
duration: 2000
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/pagesCoin/redeemOrder?goodsId=' + this.id
|
url: '/pagesCoin/redeemOrder?goodsId=' + this.id
|
||||||
})
|
})
|
||||||
@ -158,14 +253,46 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.page-content {
|
.page {
|
||||||
// background: linear-gradient(180deg, #FEE034 0%, #FDFDFD 50%, #FDFDFD 100%);
|
|
||||||
// padding-top: 300rpx;
|
|
||||||
min-height: 100vh;
|
min-height: 100vh;
|
||||||
.banner {
|
|
||||||
width: 100%;
|
.custom-nav {
|
||||||
height: 724rpx;
|
position: fixed;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
z-index: 999;
|
||||||
|
background: transparent;
|
||||||
|
|
||||||
|
.nav-content {
|
||||||
|
height: 44px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
padding: 0 32rpx;
|
||||||
|
|
||||||
|
.back-btn {
|
||||||
|
width: 64rpx;
|
||||||
|
height: 64rpx;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
background: rgba(255, 255, 255, 0.8);
|
||||||
|
border-radius: 50%;
|
||||||
|
|
||||||
|
.cuIcon-back {
|
||||||
|
font-size: 36rpx;
|
||||||
|
color: #000;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.banner {
|
||||||
|
width: 100%;
|
||||||
|
height: 724rpx;
|
||||||
|
margin-top: v-bind('statusBarHeight + 44 + "px"');
|
||||||
|
}
|
||||||
|
|
||||||
.info {
|
.info {
|
||||||
position: relative;
|
position: relative;
|
||||||
border-radius: 30rpx;
|
border-radius: 30rpx;
|
||||||
@ -183,18 +310,14 @@
|
|||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.container {
|
|
||||||
padding: 0 32rpx;
|
|
||||||
margin-top: 20rpx;
|
|
||||||
padding-bottom: 300rpx;
|
|
||||||
background: #FFFFFF;
|
|
||||||
}
|
|
||||||
.bottom-box {
|
.bottom-box {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
left: 0;
|
left: 0;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
background: #FFFFFF;
|
background: #FFFFFF;
|
||||||
|
z-index: 99;
|
||||||
|
|
||||||
.tip {
|
.tip {
|
||||||
height: 52rpx;
|
height: 52rpx;
|
||||||
@ -208,11 +331,9 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.fun-box {
|
.fun-box {
|
||||||
|
|
||||||
height: 224rpx;
|
height: 224rpx;
|
||||||
background: #FFFFFF;
|
background: #FFFFFF;
|
||||||
box-shadow: 0px -4px 8px 0px rgba(0, 0, 0, 0.1);
|
box-shadow: 0px -4px 8px 0px rgba(0, 0, 0, 0.1);
|
||||||
// border-radius: 30rpx 30rpx 0px 0px;
|
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
@ -247,9 +368,19 @@
|
|||||||
color: #000;
|
color: #000;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
line-height: 82rpx;
|
line-height: 82rpx;
|
||||||
|
transition: all 0.3s;
|
||||||
|
|
||||||
|
&:active {
|
||||||
|
transform: scale(0.98);
|
||||||
|
opacity: 0.9;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 确保登录弹窗在最顶层
|
||||||
|
:deep(.uni-popup) {
|
||||||
|
z-index: 9999;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
@ -17,12 +17,17 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<template v-else>
|
<template v-else>
|
||||||
<view v-if="!isVerified" class="flex align-center justify-center" style="height: calc(100vh - 100rpx);">
|
<view v-if="!isVerified && !isVerifying" class="flex align-center justify-center" style="height: calc(100vh - 100rpx);">
|
||||||
<view class="flex flex-col align-center">
|
<view class="flex flex-col align-center">
|
||||||
<text style="color: #747783;font-size: 28rpx;margin-bottom: 30rpx;">请先完成门店认证</text>
|
<text style="color: #747783;font-size: 28rpx;margin-bottom: 30rpx;">请先完成门店认证</text>
|
||||||
<button class="cu-btn" style="color: #FFFFFF; background-color: #4E63E0;" @click="toVerify">去认证</button>
|
<button class="cu-btn" style="color: #FFFFFF; background-color: #4E63E0;" @click="toVerify">去认证</button>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
<view v-else-if="isVerifying" class="flex align-center justify-center" style="height: calc(100vh - 100rpx);">
|
||||||
|
<view class="flex flex-col align-center">
|
||||||
|
<text style="color: #747783;font-size: 28rpx;margin-bottom: 30rpx;">您的门店正在认证中,请耐心等待</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
<template v-else>
|
<template v-else>
|
||||||
<view v-if="tabCur == 0" class="my-container">
|
<view v-if="tabCur == 0" class="my-container">
|
||||||
<template v-if="favoriteBeerList.length > 0">
|
<template v-if="favoriteBeerList.length > 0">
|
||||||
@ -97,6 +102,7 @@
|
|||||||
return {
|
return {
|
||||||
isLogin: false,
|
isLogin: false,
|
||||||
isVerified: false,
|
isVerified: false,
|
||||||
|
isVerifying: false,
|
||||||
tabCur: 0,
|
tabCur: 0,
|
||||||
favoriteBeerList: [], // 收藏的酒款列表
|
favoriteBeerList: [], // 收藏的酒款列表
|
||||||
favoriteBreweryList: [], // 收藏的酒厂列表
|
favoriteBreweryList: [], // 收藏的酒厂列表
|
||||||
@ -130,15 +136,49 @@
|
|||||||
checkLoginStatus() {
|
checkLoginStatus() {
|
||||||
const token = uni.getStorageSync('token')
|
const token = uni.getStorageSync('token')
|
||||||
const userInfo = uni.getStorageSync('userInfo')
|
const userInfo = uni.getStorageSync('userInfo')
|
||||||
this.isLogin = !!token
|
const barInfo = uni.getStorageSync('barInfo')
|
||||||
this.isVerified = userInfo?.isVerified === 1
|
|
||||||
|
|
||||||
if (this.isLogin && this.isVerified) {
|
// 重置状态
|
||||||
|
this.isLogin = false
|
||||||
|
this.isVerified = false
|
||||||
|
this.isVerifying = false
|
||||||
|
this.favoriteBeerList = []
|
||||||
|
this.favoriteBreweryList = []
|
||||||
|
this.beerQuery.pageNum = 1
|
||||||
|
this.breweryQuery.pageNum = 1
|
||||||
|
|
||||||
|
// 检查登录状态
|
||||||
|
if (!token) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
this.isLogin = true
|
||||||
|
|
||||||
|
// 检查认证状态
|
||||||
|
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
|
||||||
|
}
|
||||||
|
|
||||||
|
// 如果已登录且已认证或正在认证中,获取关注列表
|
||||||
|
if (this.isVerified || this.isVerifying) {
|
||||||
this.getFavoriteBeerList()
|
this.getFavoriteBeerList()
|
||||||
this.getFavoriteBreweryList()
|
this.getFavoriteBreweryList()
|
||||||
} else {
|
|
||||||
this.favoriteBeerList = []
|
|
||||||
this.favoriteBreweryList = []
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 去登录
|
// 去登录
|
||||||
@ -153,18 +193,8 @@
|
|||||||
},
|
},
|
||||||
// 登录成功
|
// 登录成功
|
||||||
loginSuccess() {
|
loginSuccess() {
|
||||||
this.isLogin = true
|
// 重新检查登录状态
|
||||||
const userInfo = uni.getStorageSync('userInfo')
|
this.checkLoginStatus()
|
||||||
this.isVerified = userInfo?.isVerified === 1
|
|
||||||
|
|
||||||
if (this.isVerified) {
|
|
||||||
this.favoriteBeerList = []
|
|
||||||
this.favoriteBreweryList = []
|
|
||||||
this.beerQuery.pageNum = 1
|
|
||||||
this.breweryQuery.pageNum = 1
|
|
||||||
this.getFavoriteBeerList()
|
|
||||||
this.getFavoriteBreweryList()
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
tabSelect(e) {
|
tabSelect(e) {
|
||||||
console.log(e)
|
console.log(e)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user