解决数据绑定和升级VIP问题

This commit is contained in:
邓洁
2023-02-23 23:59:30 +08:00
parent deb66d77fd
commit e5c257ed2d
5 changed files with 35 additions and 11 deletions

View File

@@ -38,7 +38,7 @@
}, },
data() { data() {
return { return {
member: false, member: '',
showEdit: true, showEdit: true,
avatar: '', avatar: '',
nickname: '用户', nickname: '用户',
@@ -75,6 +75,8 @@
this.avatar = uni.getStorageSync('img_url') + data.avatar this.avatar = uni.getStorageSync('img_url') + data.avatar
this.nickname = data.nickname this.nickname = data.nickname
this.member = data.member this.member = data.member
uni.setStorageSync('member', data.member)
uni.setStorageSync('agreement', data.agreement)
uni.setStorageSync('com_name', data.com_name) uni.setStorageSync('com_name', data.com_name)
uni.setStorageSync('com_mobile', data.com_mobile) uni.setStorageSync('com_mobile', data.com_mobile)
}).finally(_ => {}) }).finally(_ => {})

View File

@@ -3,13 +3,14 @@
<u-navbar :autoBack="true" title="会员中心"></u-navbar> <u-navbar :autoBack="true" title="会员中心"></u-navbar>
<u--image src="/static/my/wo_icon_hyzxbj.png" width="750rpx" height="349rpx" :lazy-load="true"> <u--image src="/static/my/wo_icon_hyzxbj.png" width="750rpx" height="349rpx" :lazy-load="true">
</u--image> </u--image>
<myAvatar :center="show"></myAvatar> <myAvatar ref="myavatar" :center="show"></myAvatar>
<view style="height: 56rpx;"></view> <view style="height: 56rpx;"></view>
<myForm ref="nameAndphone"></myForm> <myForm ref="nameAndphone"></myForm>
<view class="commitment"> <view class="commitment">
{{commitment}} {{commitment}}
</view> </view>
<u-button type="success" text="升级VIP" color="#0EBB5B" @click="handleSureClick()"></u-button> <u-button type="success" :text="btnText" color="#0EBB5B" @click="handleSureClick()" :disabled="btnDisabled">
</u-button>
<u-modal :show="showM" closeOnClickOverlay="false" confirmText="确定" @confirm="confirm"> <u-modal :show="showM" closeOnClickOverlay="false" confirmText="确定" @confirm="confirm">
<rich-text :nodes="content"></rich-text> <rich-text :nodes="content"></rich-text>
</u-modal> </u-modal>
@@ -23,17 +24,29 @@
name: '', name: '',
phone: '', phone: '',
showM: false, showM: false,
btnText: '升级VIP',
btnDisabled: false,
//部分产品无权限访问需升级VIP //部分产品无权限访问需升级VIP
needAsk: '', needAsk: '',
//会员中心的用户名旁边不显示edit图标 //会员中心的用户名旁边不显示edit图标
show: false, show: false,
content: `请保持手机畅通<br> content: `请保持手机畅通<br>
客服会及时联系您`, 客服会及时联系您`,
commitment: '承诺声明预留文字位置承诺声明预留文字位置承诺声明预留文字位置承诺声明预留文字位置承诺声明预留文字位置承诺声明预留文字位置承诺声明预留文字位置承诺声明预留文字位置承诺声明预留文字位置承诺声明预留文字位置承诺声明预留文字位置承诺声明预留文字位置' commitment: ''
} }
}, },
onLoad(option) { onLoad(option) {
console.log('ask', option.ask); console.log('uni.getStorageSync', uni.getStorageSync('member'));
if (uni.getStorageSync('member') == 2) {
this.btnText = '升级VIP'
} else if (uni.getStorageSync('member') == 3) {
this.btnText = '升级VIP'
this.btnDisabled = true
} else if (uni.getStorageSync('member') == 99) {
this.btnText = '升级vip正在审核中'
this.btnDisabled = true
}
this.commitment = uni.getStorageSync('agreement')
if (option.ask == 1) { if (option.ask == 1) {
this.needAsk = option.ask this.needAsk = option.ask
} }

View File

@@ -151,7 +151,7 @@
this.showUpdate = true this.showUpdate = true
} }
//升级VIP正在审核中 //升级VIP正在审核中
if (dataCode == 0 && detail.mytpe == 0) { if (dataCode == 0 && detail.mytpe == 99) {
this.showUpdating = true this.showUpdating = true
} }
if (detail) { if (detail) {

View File

@@ -89,10 +89,15 @@
<view style="padding: 30rpx;background-color: #fff;"> <view style="padding: 30rpx;background-color: #fff;">
<u-button color="#0EBB5B" text="确定发布" @tap.stop="submitForm"></u-button> <u-button color="#0EBB5B" text="确定发布" @tap.stop="submitForm"></u-button>
</view> </view>
<view style="padding: 20rpx;text-align: center;background-color: #fff;"> <view style="padding: 12rpx 30rpx 20rpx 30rpx;background-color: #fff;">
<text <text
style="font-size: 24rpx;font-family: PingFangSC-Regular, PingFang SC;font-weight: 400;color: #C8C8C8;line-height: 28rpx;">承诺声明预留文字位置承诺声明预留文字位置</text> style="font-size: 24rpx;font-family: PingFangSC-Regular, PingFang SC;font-weight: 400;color: #C8C8C8;line-height: 28rpx;"
v-if="tabCurrent === 0">{{claim_r}}</text>
<text
style="font-size: 24rpx;font-family: PingFangSC-Regular, PingFang SC;font-weight: 400;color: #C8C8C8;line-height: 28rpx;"
v-if="tabCurrent === 1">{{claim_c}}</text>
</view> </view>
</view> </view>
</u--form> </u--form>
<view style="margin:0 20rpx;"> <view style="margin:0 20rpx;">
@@ -115,6 +120,8 @@
}, },
data() { data() {
return { return {
claim_r: '',
claim_c: '',
tabsList: [{ tabsList: [{
name: '需求发布' name: '需求发布'
}, { }, {
@@ -207,11 +214,13 @@
}, },
getFormData() { getFormData() {
this.$apiServe.getIdeasAndNeedsFormdata().then(res => { this.$apiServe.getIdeasAndNeedsFormdata().then(res => {
console.log(res.data.data) console.log(res.data)
const formData = res.data.data const formData = res.data.data
this.productPickerColumn[0] = formData.product this.productPickerColumn[0] = formData.product
this.positionPickerColumn[0] = formData.loc this.positionPickerColumn[0] = formData.loc
this.categoryPickerList[0] = formData.class this.categoryPickerList[0] = formData.class
this.claim_r = formData.claim_r
this.claim_c = formData.claim_c
// this.productPickerList = res.data.data.map((item, index) => { // this.productPickerList = res.data.data.map((item, index) => {
// temp.push(item.name) // temp.push(item.name)
// return item // return item

View File

@@ -55,7 +55,7 @@
} }
}, },
onTabItemTap() { onTabItemTap() {
// this.$refs.myavatar.getUser() this.$refs.myavatar.getUser()
if (!uni.getStorageSync('loginToken') || uni.getStorageSync('loginToken').length === 0) { if (!uni.getStorageSync('loginToken') || uni.getStorageSync('loginToken').length === 0) {
this.isLoad = false this.isLoad = false
return return