完善功能
This commit is contained in:
@ -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>
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<route lang="jsonc" type="page">
|
||||
{
|
||||
// "needLogin": true,
|
||||
"needLogin": true,
|
||||
"layout": "default",
|
||||
"style": {
|
||||
"navigationStyle": "custom"
|
||||
|
||||
@ -262,7 +262,7 @@
|
||||
|
||||
|
||||
const comboCard = {
|
||||
// 跳转到对饮茶室的详情页
|
||||
// 跳转茶室的详情页
|
||||
handleToStore: () => {
|
||||
uni.navigateTo({
|
||||
url: '/pages/store/store-detail/store-detail'
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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"
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
<route lang="jsonc" type="page">
|
||||
{
|
||||
"needLogin": true,
|
||||
"layout": "default",
|
||||
"style": {
|
||||
"navigationStyle": "custom"
|
||||
|
||||
@ -286,8 +286,12 @@
|
||||
}
|
||||
try {
|
||||
await wxGetLocation((res) => {
|
||||
latitude.value = res.latitude
|
||||
longitude.value = res.longitude
|
||||
console.log("🚀 ~ res:", res)
|
||||
if (res) {
|
||||
latitude.value = res.latitude
|
||||
longitude.value = res.longitude
|
||||
}
|
||||
|
||||
Index.handleSetLocationCache(latitude.value, longitude.value)
|
||||
Index.handleSearch()
|
||||
Index.handleGetCityList()
|
||||
|
||||
@ -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>
|
||||
|
||||
@ -70,6 +70,7 @@ export async function wxGetLocation(callback: (res: any) => void ) {
|
||||
// 用户拒绝授权
|
||||
uni.setStorageSync('location_deny_time', Date.now())
|
||||
}
|
||||
callback(false)
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
162
vite.config.ts.timestamp-1763707924428-d7286c67300ac.mjs
Normal file
162
vite.config.ts.timestamp-1763707924428-d7286c67300ac.mjs
Normal file
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user