|
@@ -7,21 +7,21 @@
|
|
|
</view>
|
|
|
<view class="name-box">
|
|
|
<view class="name-top">
|
|
|
- {{userInfo.nickname}}
|
|
|
- </view>
|
|
|
- <view class="name-phone">
|
|
|
- {{getPhone}}
|
|
|
+ {{userInfo.nickname}}<text v-if="userInfo && userInfo.level_name && userInfo.level > 1">{{'('+ userInfo.level_name +')'}}</text>
|
|
|
+ </view>
|
|
|
+ <view class="" v-if="userInfo && userInfo.level_name && userInfo.level > 1" style="color: #fff;font-size: 32rpx;">
|
|
|
+ <text v-if="vip_endtime < newTime">已到期,立即续费</text><text>{{userInfo.vip_endtime | time}} 到期<text @click="xuFei()">(续费)</text></text>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="nav-wrapper">
|
|
|
- <view class="nav-item flex" @click="tohelp">
|
|
|
+ <!-- <view class="nav-item flex" @click="tohelp">
|
|
|
<view class="item-left flex">
|
|
|
<image src="../../static/icon/i6.png" mode="" class="img1"></image>
|
|
|
<view class="title">求救记录</view>
|
|
|
</view>
|
|
|
<view class="item-right">
|
|
|
- <image src="../../static/index/right.png" mode=""></image>
|
|
|
+ >
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="nav-item flex" @click="torreco">
|
|
@@ -29,73 +29,64 @@
|
|
|
<image src="../../static/icon/u-help.png" mode="" class="img2"></image>
|
|
|
<view class="title">救援记录</view>
|
|
|
</view>
|
|
|
- <view class="item-right">
|
|
|
- <image src="../../static/index/right.png" mode=""></image>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
- <view class="nav-item flex" @click="getAdress">
|
|
|
- <view class="item-left flex">
|
|
|
- <image src="../../static/index/user13.png" mode="" class="img2"></image>
|
|
|
- <view class="title">常用地址</view>
|
|
|
- </view>
|
|
|
- <view class="item-right">
|
|
|
- <image src="../../static/index/right.png" mode=""></image>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
- <!-- <view class="nav-item flex" @click="navTo('/pages/user/myaid')">
|
|
|
- <view class="item-left flex">
|
|
|
- <image src="../../static/icon/u-jz.png" mode="" class="img1"></image>
|
|
|
- <view class="title">捐赠记录</view>
|
|
|
- </view>
|
|
|
<view class="item-right">
|
|
|
>
|
|
|
</view>
|
|
|
- </view> -->
|
|
|
- <!-- <view class="nav-item flex" @click="tojkjl">
|
|
|
- <view class="item-left flex">
|
|
|
- <image src="../../static/icon/u-jk.png" mode="" class="img1"></image>
|
|
|
- <view class="title">捐款记录</view>
|
|
|
- </view>
|
|
|
- <view class="item-right">
|
|
|
- >
|
|
|
- </view>
|
|
|
- </view> -->
|
|
|
- <view class="nav-item flex" @click="tocertificates">
|
|
|
+ </view> -->
|
|
|
+ <!-- <view class="nav-item flex" @click="navTo('/pages/form/myDonate')">
|
|
|
+ <view class="item-left flex">
|
|
|
+ <image src="../../static/icon/u-jz.png" mode="" class="img1"></image>
|
|
|
+ <view class="title">捐赠记录</view>
|
|
|
+ </view>
|
|
|
+ <view class="item-right">
|
|
|
+ >
|
|
|
+ </view>
|
|
|
+ </view> -->
|
|
|
+ <view class="nav-item flex" @click="navTo('/pages/form/myDonate')">
|
|
|
+ <view class="item-left flex">
|
|
|
+ <image src="../../static/icon/u-jk.png" mode="" class="img1"></image>
|
|
|
+ <view class="title">捐款记录</view>
|
|
|
+ </view>
|
|
|
+ <view class="item-right">
|
|
|
+ >
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view class="nav-item flex" @click="tocertificates" >
|
|
|
<view class="item-left flex">
|
|
|
<image src="../../static/icon/i9.png" mode="" class="img4"></image>
|
|
|
<view class="title">我的证书</view>
|
|
|
</view>
|
|
|
- <view class="item-right">
|
|
|
- <image src="../../static/index/right.png" mode=""></image>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
- <!-- <view class="nav-item flex" @click="navTo('/pages/applyHelp/cation')" >
|
|
|
- <view class="item-left flex">
|
|
|
- <image src="../../static/icon/i7.png" mode="" class="img4"></image>
|
|
|
- <view class="title">申请帮扶</view>
|
|
|
- </view>
|
|
|
- <view class="item-right">
|
|
|
- >
|
|
|
- </view>
|
|
|
- </view> -->
|
|
|
- <!-- <view class="nav-item flex" @click="navTo('/pages/user/myFu')" >
|
|
|
- <view class="item-left flex">
|
|
|
- <image src="../../static/icon/u-m-f.png" mode="" class="img4"></image>
|
|
|
- <view class="title">我的帮扶</view>
|
|
|
- </view>
|
|
|
- <view class="item-right">
|
|
|
- >
|
|
|
- </view>
|
|
|
- </view> -->
|
|
|
- <!-- @click="loginout" -->
|
|
|
- <!-- <view class="nav-item flex" @click="navTo('/pages/user/userSet')" >
|
|
|
- <view class="item-left flex">
|
|
|
- <image src="../../static/icon/u-set.png" mode="" class="img4"></image>
|
|
|
- <view class="title">退出</view>
|
|
|
- </view>
|
|
|
<view class="item-right">
|
|
|
>
|
|
|
</view>
|
|
|
+ </view>
|
|
|
+ <!-- <view class="nav-item flex" @click="navTo('/pages/applyHelp/cation')" >
|
|
|
+ <view class="item-left flex">
|
|
|
+ <image src="../../static/icon/i7.png" mode="" class="img4"></image>
|
|
|
+ <view class="title">申请帮扶</view>
|
|
|
+ </view>
|
|
|
+ <view class="item-right">
|
|
|
+ >
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view class="nav-item flex" @click="navTo('/pages/user/myFu')" >
|
|
|
+ <view class="item-left flex">
|
|
|
+ <image src="../../static/icon/u-m-f.png" mode="" class="img4"></image>
|
|
|
+ <view class="title">我的帮扶</view>
|
|
|
+ </view>
|
|
|
+ <view class="item-right">
|
|
|
+ >
|
|
|
+ </view>
|
|
|
+ </view> -->
|
|
|
+ <!-- @click="loginout" -->
|
|
|
+ <!-- <view class="nav-item flex" @click="navTo('/pages/user/userSet')" >
|
|
|
+ <view class="item-left flex">
|
|
|
+ <image src="../../static/icon/u-set.png" mode="" class="img4"></image>
|
|
|
+ <view class="title">设置</view>
|
|
|
+ </view>
|
|
|
+ <view class="item-right">
|
|
|
+ >
|
|
|
+ </view>
|
|
|
</view> -->
|
|
|
</view>
|
|
|
</view>
|
|
@@ -110,35 +101,62 @@
|
|
|
saveUrl,
|
|
|
interceptor
|
|
|
} from '@/utils/loginUtils.js';
|
|
|
+ import { detail_training } from '@/api/train.js';
|
|
|
import {
|
|
|
- detail_training
|
|
|
- } from '@/api/train.js';
|
|
|
- import {
|
|
|
- userinfo,
|
|
|
+ userinfo,
|
|
|
logout
|
|
|
} from '@/api/user.js';
|
|
|
// #ifdef H5
|
|
|
import {
|
|
|
weixindata
|
|
|
} from '@/utils/wxAuthorized';
|
|
|
- // #endif
|
|
|
+ // #endif
|
|
|
+ import { getVipmoney, createOrder } from '@/api/index.js'
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
|
- common_address: '',
|
|
|
- name: '',
|
|
|
- signDate: '',
|
|
|
- id: 0,
|
|
|
- is_over: 0,
|
|
|
-
|
|
|
+ common_address:'',
|
|
|
+ name:'',
|
|
|
+ signDate:'',
|
|
|
+ id:0,
|
|
|
+ is_over:0,
|
|
|
+ newTime: 0,
|
|
|
+ money: '',
|
|
|
+ mid: '',
|
|
|
}
|
|
|
+ },
|
|
|
+ filters: {
|
|
|
+ time(val) {
|
|
|
+ let str = '';
|
|
|
+ // console.log(val)
|
|
|
+ if (val) {
|
|
|
+ let date = new Date(val * 1000);
|
|
|
+ let Y = date.getFullYear();
|
|
|
+ let M = date.getMonth() + 1 > 9 ? (date.getMonth()+1) : '0' + (date.getMonth()+1);
|
|
|
+ let D = date.getDate() > 9 ? date.getDate() : '0' + date.getDate();
|
|
|
+ str = Y + '年' + M + '月' + D + '日';
|
|
|
+ }
|
|
|
+ return str;
|
|
|
+ },
|
|
|
},
|
|
|
-
|
|
|
onShow() {
|
|
|
- console.log(this);
|
|
|
+ console.log(this);
|
|
|
+ let obj = this
|
|
|
// 判断是否已经登录
|
|
|
if (this.hasLogin) {
|
|
|
- this.loadBaseData();
|
|
|
+ this.loadBaseData();
|
|
|
+ getVipmoney().then(({
|
|
|
+ data
|
|
|
+ }) => {
|
|
|
+ console.log(data, 'getVipmoney');
|
|
|
+ data.forEach(e => {
|
|
|
+ if (e.name == obj.userInfo.level_name) {
|
|
|
+ obj.money = e.pay_price;
|
|
|
+ obj.mid = e.id;
|
|
|
+ console.log(obj.money, obj.mid)
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
} else {
|
|
|
saveUrl();
|
|
|
uni.showModal({
|
|
@@ -155,9 +173,10 @@
|
|
|
});
|
|
|
}
|
|
|
this.type = this.userInfo.type;
|
|
|
- this.common_address = this.userInfo.common_address
|
|
|
- console.log(this.userInfo, 'wuwu')
|
|
|
- console.log('点前保存的地址', this.common_address)
|
|
|
+ this.common_address = this.userInfo.common_address
|
|
|
+ let str = new Date()
|
|
|
+ this.newTime = str.getTime()
|
|
|
+ console.log('点前保存的地址',this.common_address)
|
|
|
// 保存当前页面
|
|
|
},
|
|
|
onReady() {
|
|
@@ -172,38 +191,81 @@
|
|
|
// })
|
|
|
},
|
|
|
computed: {
|
|
|
- ...mapState('user', ['hasLogin', 'userInfo']),
|
|
|
- getPhone() {
|
|
|
- return this.userInfo.mobile.substring(0, 3) + '****' + this.userInfo.mobile.substring(7)
|
|
|
-
|
|
|
-
|
|
|
- }
|
|
|
+ ...mapState('user', ['hasLogin', 'userInfo']),
|
|
|
+ ...mapState(['weichatObj']),
|
|
|
},
|
|
|
methods: {
|
|
|
- ...mapMutations('user', ['setUserInfo', 'logout']),
|
|
|
- loginout() {
|
|
|
- let obj = this;
|
|
|
- uni.showModal({
|
|
|
- content: '确定要退出登录么',
|
|
|
- success: e => {
|
|
|
- if (e.confirm) {
|
|
|
- logout({}).then(e => {
|
|
|
- obj.logout();
|
|
|
- uni.switchTab({
|
|
|
- url: '/pages/index/index'
|
|
|
- })
|
|
|
- })
|
|
|
- .catch(e => {
|
|
|
- console.log(e);
|
|
|
- });
|
|
|
- }
|
|
|
- }
|
|
|
- });
|
|
|
- },
|
|
|
- tojkjl() {
|
|
|
- uni.navigateTo({
|
|
|
- url: '/pages/user/jkjl'
|
|
|
- })
|
|
|
+ ...mapMutations('user', ['setUserInfo','logout']),
|
|
|
+ // 续费
|
|
|
+ xuFei() {
|
|
|
+ let obj = this
|
|
|
+ uni.showModal({
|
|
|
+ title: '提示',
|
|
|
+ content: '续费' + obj.userInfo.level_name + '需要缴纳' + obj.money + '元年费,是否续费',
|
|
|
+ success: function(res) {
|
|
|
+ if (res.confirm) {
|
|
|
+ console.log('用户点击确定');
|
|
|
+ createOrder({
|
|
|
+ level_id: obj.mid,
|
|
|
+ body: '红会年费',
|
|
|
+ pay_type: 0,
|
|
|
+ // name: obj.name,
|
|
|
+ pay_price: obj.money,
|
|
|
+ from: 'weixin'
|
|
|
+ }).then(({data}) =>{
|
|
|
+ let res = data.jsConfig;
|
|
|
+ obj.weichatObj.chooseWXPay({
|
|
|
+ timestamp: res.timestamp,
|
|
|
+ nonceStr: res.nonceStr,
|
|
|
+ package: res.package,
|
|
|
+ signType: res.signType,
|
|
|
+ paySign: res.paySign,
|
|
|
+ success: function(res) {
|
|
|
+ // uni.navigateTo({
|
|
|
+ // url: '../joinSuc/joinNow'
|
|
|
+ // });
|
|
|
+ obj.loadBaseData()
|
|
|
+ uni.showModal({
|
|
|
+ title:'提示',
|
|
|
+ content: '续费成功'
|
|
|
+ })
|
|
|
+ },
|
|
|
+ fail: function(res) {
|
|
|
+ console.log(res, "失败")
|
|
|
+ console.log(res.errMsg)
|
|
|
+ }
|
|
|
+ });
|
|
|
+ })
|
|
|
+ } else if (res.cancel) {
|
|
|
+ console.log('用户点击取消');
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ // 登出
|
|
|
+ loginout() {
|
|
|
+ let obj = this;
|
|
|
+ uni.showModal({
|
|
|
+ content: '确定要退出登录么',
|
|
|
+ success: e => {
|
|
|
+ if (e.confirm) {
|
|
|
+ logout({}).then(e => {
|
|
|
+ obj.logout();
|
|
|
+ uni.switchTab({
|
|
|
+ url: '/pages/index/index'
|
|
|
+ })
|
|
|
+ })
|
|
|
+ .catch(e => {
|
|
|
+ console.log(e);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ tojkjl() {
|
|
|
+ uni.navigateTo({
|
|
|
+ url: '/pages/user/jkjl'
|
|
|
+ })
|
|
|
},
|
|
|
loadBaseData() {
|
|
|
userinfo({}).then(({
|
|
@@ -228,11 +290,6 @@
|
|
|
url: '/pages/user/myFu'
|
|
|
})
|
|
|
},
|
|
|
- getAdress(){
|
|
|
- uni.navigateTo({
|
|
|
- url:'/pages/applic/chooseAddress'
|
|
|
- })
|
|
|
- },
|
|
|
torreco() {
|
|
|
uni.navigateTo({
|
|
|
url: '/pages/applic/rescuerecords'
|
|
@@ -252,10 +309,10 @@
|
|
|
uni.navigateTo({
|
|
|
// pages/form/certificatesList
|
|
|
// url: '/pages/form/certificates?name=' + this.name + '&signDate=' + this.signDate
|
|
|
- url: '/pages/form/certificatesList'
|
|
|
+ url: '/pages/form/certificatesList'
|
|
|
})
|
|
|
},
|
|
|
- navTo(url) {
|
|
|
+ navTo(url) {
|
|
|
console.log(url)
|
|
|
uni.navigateTo({
|
|
|
url: url
|
|
@@ -267,16 +324,14 @@
|
|
|
|
|
|
<style lang="scss">
|
|
|
page {
|
|
|
- min-height: 100%;
|
|
|
+ min-height: 100%;
|
|
|
height: auto;
|
|
|
background: #fff;
|
|
|
}
|
|
|
-
|
|
|
.content {
|
|
|
line-height: 1.5;
|
|
|
- background-color: #fff;
|
|
|
+ background-color: #fff;
|
|
|
height: 100%;
|
|
|
-
|
|
|
.top {
|
|
|
width: 750rpx;
|
|
|
height: 312rpx;
|
|
@@ -289,7 +344,6 @@
|
|
|
justify-content: center;
|
|
|
background-image: url(../../static/img/userbg.png);
|
|
|
background-size: 100% 100%;
|
|
|
-
|
|
|
.avater {
|
|
|
width: 150rpx;
|
|
|
height: 150rpx;
|
|
@@ -305,33 +359,23 @@
|
|
|
.name-box {
|
|
|
// flex: 1;
|
|
|
padding-top: 25rpx;
|
|
|
- display: flex;
|
|
|
- flex-direction: column;
|
|
|
- align-items: center;
|
|
|
- justify-content: center;
|
|
|
-
|
|
|
.name-top {
|
|
|
-
|
|
|
+ font-size: 42rpx;
|
|
|
+ font-weight: 400;
|
|
|
+ margin-bottom: 15rpx;
|
|
|
font-size: 32rpx;
|
|
|
font-family: PingFang SC;
|
|
|
font-weight: 500;
|
|
|
- color: #FFFFFF;
|
|
|
- }
|
|
|
-
|
|
|
- .name-phone {
|
|
|
- font-size: 26rpx;
|
|
|
- font-family: PingFang SC;
|
|
|
- font-weight: 500;
|
|
|
- color: #FFFFFF;
|
|
|
+ color: #FFFFFF;
|
|
|
+ text-align: center;
|
|
|
}
|
|
|
-
|
|
|
- .name-bottom {
|
|
|
+ .name-bottom{
|
|
|
margin-top: 16rpx;
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
// justify-content: center;
|
|
|
-
|
|
|
- .nameInfo {
|
|
|
+
|
|
|
+ .nameInfo{
|
|
|
color: #FFFFFF;
|
|
|
padding: 6rpx 16rpx;
|
|
|
border: 1rpx solid #FFFFFF;
|
|
@@ -420,8 +464,7 @@
|
|
|
.tt {
|
|
|
display: flex;
|
|
|
flex-wrap: wrap;
|
|
|
- padding-left: 32rpx;
|
|
|
-
|
|
|
+ padding-left:32rpx;
|
|
|
.tt-box {
|
|
|
width: 206rpx;
|
|
|
height: 206rpx;
|
|
@@ -432,12 +475,10 @@
|
|
|
justify-content: center;
|
|
|
margin-right: 35rpx;
|
|
|
margin-bottom: 30rpx;
|
|
|
-
|
|
|
image {
|
|
|
width: 64rpx;
|
|
|
height: 64rpx;
|
|
|
}
|
|
|
-
|
|
|
.tt-txt {
|
|
|
font-size: 24rpx;
|
|
|
font-family: PingFang SC;
|
|
@@ -449,7 +490,6 @@
|
|
|
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
.nav-wrapper {
|
|
|
width: 678rpx;
|
|
|
// height: 560rpx;
|
|
@@ -458,51 +498,41 @@
|
|
|
border-radius: 20rpx;
|
|
|
margin: 32rpx auto 0;
|
|
|
color: #555555;
|
|
|
-
|
|
|
.nav-item {
|
|
|
height: 115rpx;
|
|
|
border-bottom: 1rpx #F6F6F6 solid;
|
|
|
-
|
|
|
&:last-of-type {
|
|
|
border-bottom: none;
|
|
|
}
|
|
|
-
|
|
|
justify-content: space-between;
|
|
|
align-items: center;
|
|
|
padding: 0 36rpx 0 40rpx;
|
|
|
-
|
|
|
.item-left {
|
|
|
-
|
|
|
+
|
|
|
align-items: center;
|
|
|
-
|
|
|
image {
|
|
|
// background-color: red;
|
|
|
}
|
|
|
-
|
|
|
.img1 {
|
|
|
width: 34rpx;
|
|
|
height: 34rpx;
|
|
|
margin-right: 21rpx;
|
|
|
}
|
|
|
-
|
|
|
.img2 {
|
|
|
width: 36rpx;
|
|
|
height: 32rpx;
|
|
|
margin-right: 19rpx;
|
|
|
}
|
|
|
-
|
|
|
.img3 {
|
|
|
width: 28rpx;
|
|
|
height: 36rpx;
|
|
|
margin-right: 25rpx;
|
|
|
}
|
|
|
-
|
|
|
.img4 {
|
|
|
width: 36rpx;
|
|
|
height: 28rpx;
|
|
|
margin-right: 19rpx;
|
|
|
}
|
|
|
-
|
|
|
.title {
|
|
|
font-size: 32rpx;
|
|
|
font-family: PingFang SC;
|
|
@@ -510,15 +540,8 @@
|
|
|
color: #555555;
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
.item-right {
|
|
|
-
|
|
|
- width: 16rpx;
|
|
|
- height: 30rpx;
|
|
|
- image{
|
|
|
- width: 100%;
|
|
|
- height: 100%;
|
|
|
- }
|
|
|
+ line-height: 115rpx;
|
|
|
}
|
|
|
}
|
|
|
}
|