编辑我的页面跳转,完成积分和优惠券页面的创建(内容还没写多少)
This commit is contained in:
@@ -4,8 +4,10 @@ import Dialog from '@vant/weapp/dialog/dialog';
|
||||
import { getUserInfo, logout } from "../../service/user";
|
||||
import { getDot } from "../../utils/system";
|
||||
import request from "../../utils/request"
|
||||
import { getCurrentIntegral } from "../../service/system";
|
||||
const { OK } = request;
|
||||
|
||||
|
||||
Page({
|
||||
|
||||
/**
|
||||
@@ -15,6 +17,7 @@ Page({
|
||||
user: {},
|
||||
tenement: {},
|
||||
visible: false,
|
||||
integral: 0,
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -63,9 +66,20 @@ Page({
|
||||
}
|
||||
this.init()
|
||||
this.getUnReadNumber()
|
||||
// this.getIntegral()
|
||||
const tenement = wx.getStorageSync('tenement')
|
||||
this.setData({ tenement })
|
||||
},
|
||||
async getIntegral() {
|
||||
const { code, message, data } = await getCurrentIntegral();
|
||||
if (code !== OK) {
|
||||
alertInfo(message)
|
||||
return;
|
||||
}
|
||||
this.setData({
|
||||
integral: data?.balance || 0
|
||||
})
|
||||
},
|
||||
async init() {
|
||||
const tenement = wx.getStorageSync('tenement')
|
||||
const result = await getUserInfo(tenement?.id);
|
||||
@@ -86,6 +100,16 @@ Page({
|
||||
url: '/pages/workBench/index',
|
||||
})
|
||||
},
|
||||
jumpToIntegral() {
|
||||
wx.navigateTo({
|
||||
url: '/pages/integral/index',
|
||||
})
|
||||
},
|
||||
jumpToDiscountCoupon() {
|
||||
wx.navigateTo({
|
||||
url: '/pages/discountCoupon/index',
|
||||
})
|
||||
},
|
||||
async getUnReadNumber() {
|
||||
const dot = await getDot();
|
||||
this.setData({
|
||||
|
@@ -8,7 +8,8 @@
|
||||
"navigator": "/components/navigator/index",
|
||||
"van-grid": "@vant/weapp/grid/index",
|
||||
"avatar": "/components/avatar/index",
|
||||
"van-grid-item": "@vant/weapp/grid-item/index"
|
||||
"van-grid-item": "@vant/weapp/grid-item/index",
|
||||
"van-image": "@vant/weapp/image/index"
|
||||
},
|
||||
"navigationBarTitleText": "我的",
|
||||
"navigationStyle": "custom"
|
||||
|
@@ -12,12 +12,61 @@
|
||||
</view>
|
||||
</view>
|
||||
<view style="margin-bottom: 20rpx;border-radius: 16rpx; overflow: hidden;">
|
||||
<van-grid column-num="3">
|
||||
<van-grid-item icon="friends-o" text="财税援助" bind:click="jumpToFinance" />
|
||||
<van-grid-item icon="envelop-o" text="法律援助" bind:click="jumpToLaw" />
|
||||
<van-grid-item icon="notes-o" text="电力百科" bind:click="jumpToEncyclopedia" />
|
||||
<van-grid column-num="3" >
|
||||
<van-grid-item
|
||||
bind:click="jumpToFinance"
|
||||
use-slot
|
||||
>
|
||||
<van-image
|
||||
style="margin-top: 20rpx;"
|
||||
width="140rpx"
|
||||
height="140rpx"
|
||||
src="/assets/images/finance.png"
|
||||
/>
|
||||
<view style="margin-top: 20rpx;font-size: 34rpx;"> 财税援助 </view>
|
||||
</van-grid-item>
|
||||
<van-grid-item
|
||||
bind:click="jumpToLaw"
|
||||
use-slot
|
||||
>
|
||||
<van-image
|
||||
width="140rpx"
|
||||
height="140rpx"
|
||||
style="margin-top: 20rpx;"
|
||||
src="/assets/images/law.png"
|
||||
/>
|
||||
<view style="margin-top: 20rpx;font-size: 34rpx;"> 法律援助 </view>
|
||||
</van-grid-item>
|
||||
<van-grid-item
|
||||
bind:click="jumpToEncyclopedia"
|
||||
use-slot
|
||||
>
|
||||
<van-image
|
||||
width="140rpx"
|
||||
height="140rpx"
|
||||
style="margin-top: 20rpx;"
|
||||
src="/assets/images/baike.png"
|
||||
/>
|
||||
<view style="margin-top: 20rpx;font-size: 34rpx;"> 电力百科 </view>
|
||||
</van-grid-item>
|
||||
</van-grid>
|
||||
</view>
|
||||
<!-- <view style="margin-bottom: 20rpx;border-radius: 16rpx; overflow: hidden;">
|
||||
<van-cell
|
||||
title="积分兑换"
|
||||
value=""
|
||||
is-link
|
||||
bind:tap="jumpToIntegral"
|
||||
icon="diamond-o"
|
||||
/>
|
||||
<van-cell
|
||||
title="我的优惠券"
|
||||
value=""
|
||||
is-link
|
||||
bind:tap="jumpToDiscountCoupon"
|
||||
icon="label-o"
|
||||
/>
|
||||
</view> -->
|
||||
<view style="border-radius: 16rpx; overflow: hidden;">
|
||||
<van-cell title="联系客服" value="" is-link bind:tap="connect" icon="service-o" />
|
||||
<van-cell icon="qr" wx:if="{{!!user.isAdmin}}" title="二维码" value="" is-link bind:click="jumpToQrCode" />
|
||||
@@ -29,7 +78,7 @@
|
||||
</view>
|
||||
</view>
|
||||
</van-cell>
|
||||
<van-cell title="发票抬头" icon="discount-o" value="" is-link bind:tap="jumpToUpdateInvoice">
|
||||
<van-cell title="发票抬头" icon="notes-o" value="" is-link bind:tap="jumpToUpdateInvoice">
|
||||
</van-cell>
|
||||
<van-cell title="绑定企业" icon="exchange" value="" is-link bind:tap="bindTenement" />
|
||||
<van-cell title="常见问题" icon="question-o" value="" is-link bind:tap="jumpToQuestions" />
|
||||
|
Reference in New Issue
Block a user