优化会员,商品,下单

This commit is contained in:
wwz
2025-03-15 12:03:34 +08:00
parent e6ca187e5a
commit fc957feb72
19 changed files with 484 additions and 978 deletions

View File

@@ -90,7 +90,8 @@
} from 'vue';
import {
APIshopUser
APIshopUser,
APIshopUserInfo
} from '@/common/api/member.js'
import {
@@ -112,6 +113,8 @@
},
});
// 定义要触发的事件
const formInfo = reactive({
nickName: "",
telephone: "",
@@ -302,13 +305,7 @@
const registerMember = async () => {
// if ( userHeadImg.value == "" || userHeadImg.value == null ) {
// uni.showToast({
// title: '请选择会员头像',
// icon: 'none'
// });
// return;
// }
if (formInfo.nickName == "" || formInfo.nickName == null) {
uni.showToast({
title: '请输入会员昵称',
@@ -316,13 +313,7 @@
});
return;
}
// if ( this.birthDay == "" || this.birthDay == null ) {
// uni.showToast({
// title: '请选择日期',
// icon: 'none'
// });
// return;
// }
if (formInfo.telephone == "" || formInfo.telephone == null) {
uni.showToast({
title: '请获取手机号',
@@ -337,7 +328,7 @@
});
return;
}
let res = await APIshopUser({
await APIshopUser({
// id: uni.cache.get('userInfo').id,
// shopId: uni.cache.get('shopId'),
nickName: formInfo.nickName,
@@ -345,7 +336,6 @@
phone: formInfo.telephone,
birthDay: formInfo.birthDay
})
// 定义自定义事件
let APIshopUserInfores = await APIshopUserInfo({
shopId: uni.cache.get('shopId')
})
@@ -355,11 +345,11 @@
title: '会员加入成功',
icon: 'none'
})
// 定义自定义事件
setTimeout(() => {
if (props.detailtype == 'detail') {
uni.navigateBack()
}
uni.navigateBack()
}, 1500)
}
</script>

View File

@@ -320,7 +320,6 @@
});
return false;
}
console.log(infoForn, 111)
console.log({
shopId: infoForn.shopId,
activateId: infoForn.id,
@@ -340,6 +339,7 @@
console.log(res)
}
// 会员总信息
const asyncshopUserInfo = async () => {
let res = await APIshopUserInfo({
@@ -349,6 +349,7 @@
uni.cache.set('ordershopUserInfo', res.shopInfo)
infoForn.show = res.isVip == 1 ? false : true
infoForn.userInfo = res
infoForn.shopUserInfo = res.shopInfo
}
const detailtype = ref('')
@@ -377,10 +378,10 @@
infoForn.shopId = options.shopId ? options.shopId : uni.cache.get('shopId')
}
let resone = await APIusershopInfodetail({
shopId: infoForn.shopId
})
infoForn.shopUserInfo = resone.shopInfo
// let resone = await APIusershopInfodetail({
// shopId: infoForn.shopId
// })
// infoForn.shopUserInfo = resone.shopInfo
asyncshopUserInfo()
if (options.type == 'detail') {
detailtype.value = 'detail'

View File

@@ -115,7 +115,7 @@
})
const form = reactive({
memberOpen: false,
memberOpen: true,
shopName: "",
amount: '',
lucky: {
@@ -153,11 +153,6 @@
})
}
// * 注册会员卡
const getRegisterMember = () => {
this.memberOpen = e;
this.init()
}
// 会员总信息
const asyncshopUserInfo = async () => {
@@ -167,6 +162,7 @@
uni.cache.set('orderVIP', res)
uni.cache.set('ordershopUserInfo', res.shopInfo)
form.memberOpen = res.isVip == 1 ? false : true
shopUserInfo.shopExtend = res.shopExtendList[2]
}
@@ -184,14 +180,15 @@
// 获取页面参数
const pageParams = currentPage.options;
if (pageParams.shopId) {
asyncshopUserInfo()
uni.cache.set('shopId', pageParams.shopId, 30)
let res = await APIusershopInfodetail({
shopId: pageParams.shopId
})
// 根据传的shopInfo来返回上面的值
shopUserInfo.shopExtend = res.shopExtend.member_bg
shopUserInfo.shopId = pageParams.shopId
uni.cache.set('shopId', pageParams.shopId, 30)
// let res = await APIusershopInfodetail({
// shopId: pageParams.shopId
// })
// 根据传的shopInfo来返回上面的值
// shopUserInfo.shopExtend = res.shopExtend.member_bg
asyncshopUserInfo()
console.log(shopUserInfo.shopId)
}
})

View File

@@ -107,7 +107,7 @@
const teblist = ref([])
const shopExtend = ref(null)
const userInfo = reactive({})
const ShopId = ref(uni.cache.get('shopId'))
const clickEvent = () => {