调整个人中心页面,会议中心页面,充值页面
This commit is contained in:
@@ -146,11 +146,13 @@
|
||||
computed
|
||||
} from "vue"
|
||||
import {
|
||||
joinMember
|
||||
joinMember,
|
||||
ltPayMember
|
||||
} from '@/common/api/order/index.js'
|
||||
import * as vipApi from '@/common/api/market/vip.js'
|
||||
import {pay} from '@/utils/pay.js'
|
||||
import {
|
||||
APIusershopInfodetail
|
||||
APIusershopInfodetail,APIshopUserInfo
|
||||
} from '@/common/api/member.js'
|
||||
import {
|
||||
onLoad
|
||||
@@ -162,8 +164,8 @@
|
||||
show1: false,
|
||||
title: ''
|
||||
})
|
||||
|
||||
const memberOpen=ref(false)
|
||||
|
||||
const memberOpen = ref(false)
|
||||
|
||||
function modelHide() {
|
||||
model.show = false;
|
||||
@@ -278,7 +280,14 @@
|
||||
}
|
||||
const memberLevel = ref(null)
|
||||
const shopInfo = reactive({})
|
||||
const shopUserInfo = ref({})
|
||||
async function init(shopId) {
|
||||
const userRes= await APIshopUserInfo({
|
||||
shopId
|
||||
})
|
||||
if (userRes) {
|
||||
shopUserInfo.value=userRes
|
||||
}
|
||||
const shopRes = await APIusershopInfodetail({
|
||||
shopId
|
||||
})
|
||||
@@ -289,8 +298,10 @@
|
||||
shopId: shopId
|
||||
})
|
||||
if (res) {
|
||||
if(res.memberConfig.isSubmitInfo){
|
||||
memberOpen.value=true;
|
||||
if (res.memberConfig.isSubmitInfo && (shopUserInfo.value.sex === null || shopUserInfo.value.sex ===
|
||||
undefined || !shopUserInfo.value.nickName || !shopUserInfo.value.birthDay || !shopUserInfo.value
|
||||
.phone)) {
|
||||
memberOpen.value = true;
|
||||
}
|
||||
conditionList.value = res.memberConfig.conditionList.map(v => {
|
||||
const json = {
|
||||
@@ -335,33 +346,49 @@
|
||||
onLoad((opt) => {
|
||||
Object.assign(option, opt)
|
||||
console.log(option);
|
||||
let shopId = uni.cache.get('shopId')
|
||||
if (opt.shopId) {
|
||||
shopId = opt.shopId
|
||||
}
|
||||
if (shopId) {
|
||||
option.shopId = shopId
|
||||
}
|
||||
let shopId = option.shopId
|
||||
init(shopId)
|
||||
})
|
||||
|
||||
let userInfo = {}
|
||||
function emitsmemberOpen(e){
|
||||
memberOpen.value=false
|
||||
userInfo=e
|
||||
|
||||
|
||||
function emitsmemberOpen(e) {
|
||||
memberOpen.value = false
|
||||
Object.assign(shopUserInfo.value,e)
|
||||
}
|
||||
async function buy() {
|
||||
const json = {
|
||||
shopId: option.shopId,
|
||||
name: configList.value[vipSel.value].name,
|
||||
num: 1,
|
||||
shopId: option.shopId,
|
||||
shopUserId: shopUserInfo.value.id
|
||||
}
|
||||
if (state.isSubmitInfo) {
|
||||
json.sex = userInfo.sex ;
|
||||
json.birthDay = userInfo.birthDay;
|
||||
json.nickName = userInfo.nickName
|
||||
json.sex = shopUserInfo.value.sex;
|
||||
json.birthDay = shopUserInfo.value.birthDay;
|
||||
json.nickName = shopUserInfo.value.nickName
|
||||
}
|
||||
|
||||
const res = await ltPayMember(json)
|
||||
if (!res) {
|
||||
return uni.showToast({
|
||||
title: '购买失败',
|
||||
icon:'error'
|
||||
})
|
||||
}
|
||||
const payRes=await pay(res)
|
||||
console.log(payRes);
|
||||
if(payRes){
|
||||
uni.showToast({
|
||||
title: '开通会员成功',
|
||||
icon:'none'
|
||||
})
|
||||
setTimeout(()=>{
|
||||
uni.redirectTo({
|
||||
url:'/user/vip/vip?shopId='+option.shopId
|
||||
})
|
||||
},1000)
|
||||
}
|
||||
const res = await joinMember(json)
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user