完善功能

This commit is contained in:
wangxiaowei
2025-11-24 16:32:01 +08:00
parent e81704d812
commit a7f62ffaa2
10 changed files with 188 additions and 20 deletions

View File

@ -71,14 +71,13 @@
</template>
<script lang="ts" setup>
import {ref} from 'vue'
import Coupon from '@/components/coupon/Coupon.vue'
import GroupCoupon from '@/components/coupon/GroupCoupon.vue'
import { getCoupons } from '@/api/user'
import type { IUserCouponListResult } from '@/api/types/user'
import { router } from '@/utils/tools'
const couponType = ref<number>(2) // couponType 1:优惠券 2:团购券
const OSS = inject('OSS')
const couponList = ref<IUserCouponListResult>({
no_use: [],
@ -107,14 +106,13 @@
// 选择优惠券
handleCheck: (id: any) => {
checkedId.value = id
console.log("🚀 ~ checkedId.value :", checkedId.value )
},
// 确认选择优惠券
handleConfirmCoupon: () => {
const coupon = couponList.value.use.find(item => item.user_coupon_id === checkedId.value)
uni.$emit('chooseCoupon', { coupon })
uni.navigateBack()
router.navigateBack()
}
}
</script>

View File

@ -1,6 +1,6 @@
<route lang="jsonc" type="page">
{
// "needLogin": true,
"needLogin": true,
"layout": "default",
"style": {
"navigationStyle": "custom"

View File

@ -262,7 +262,7 @@
const comboCard = {
// 跳转到对饮茶室的详情页
// 跳转茶室的详情页
handleToStore: () => {
uni.navigateTo({
url: '/pages/store/store-detail/store-detail'

View File

@ -27,19 +27,19 @@ export const getUrlCode = (): { [key: string]: string | undefined } => {
*/
export async function snsapiBaseAuthorize() {
// TODO 测试代码
wxSnsapiBaseLogin({code: '011ganGa10NGEK0reKGa1l3rpS2ganGX'}).then((res: IUserInfoVo) => {
console.log("登录成功 ~ snsapiBaseAuthorize ~ res:", res)
// 映射 IUserLogin 到 IUserInfoVo
useUserStore().setUserInfo(res)
uni.$emit('loginSuccess')
// wxSnsapiBaseLogin({code: '011ganGa10NGEK0reKGa1l3rpS2ganGX'}).then((res: IUserInfoVo) => {
// console.log("登录成功 ~ snsapiBaseAuthorize ~ res:", res)
// // 映射 IUserLogin 到 IUserInfoVo
// useUserStore().setUserInfo(res)
// uni.$emit('loginSuccess')
}).catch(err => {
// 失败就重新授权
uni.setStorageSync('wechatCode', 0)
console.log('请求失败', err)
})
// }).catch(err => {
// // 失败就重新授权
// uni.setStorageSync('wechatCode', 0)
// console.log('请求失败', err)
// })
return
// return
let local = window.location.href // 获取页面url
let appid = import.meta.env.VITE_WX_SERVICE_ACCOUNT_APPID // 公众号的APPID

View File

@ -100,6 +100,7 @@
{
"path": "pages/cashier/cashier",
"type": "page",
"needLogin": true,
"layout": "default",
"style": {
"navigationStyle": "custom"
@ -202,6 +203,7 @@
{
"path": "coupon/my-coupon",
"type": "page",
"needLogin": true,
"layout": "default",
"style": {
"navigationStyle": "custom"

View File

@ -1,5 +1,6 @@
<route lang="jsonc" type="page">
{
"needLogin": true,
"layout": "default",
"style": {
"navigationStyle": "custom"

View File

@ -286,8 +286,12 @@
}
try {
await wxGetLocation((res) => {
console.log("🚀 ~ res:", res)
if (res) {
latitude.value = res.latitude
longitude.value = res.longitude
}
Index.handleSetLocationCache(latitude.value, longitude.value)
Index.handleSearch()
Index.handleGetCityList()

View File

@ -69,7 +69,7 @@
<wd-img width="100%" height="100%" :src="`${OSS}images/my/my_image3.png`" mode="aspectFill"></wd-img>
</view>
<view class="text-[#303133] absolute bottom-12rpx left-24rpx text-center">
<view class="text-30rpx leading-36rpx fon-bold">{{ isLogin ? user?.user_money : '- -' }}</view>
<view class="text-30rpx leading-36rpx font-bold">{{ isLogin ? user?.user_money : '- -' }}</view>
<view class="text-20rpx leading-28rpx ml-10rpx">平台余额</view>
</view>
</view>

View File

@ -70,6 +70,7 @@ export async function wxGetLocation(callback: (res: any) => void ) {
// 用户拒绝授权
uni.setStorageSync('location_deny_time', Date.now())
}
callback(false)
}
});
});

File diff suppressed because one or more lines are too long