Commit a052f84b authored by huangyuanyuan's avatar huangyuanyuan
parents f0e13515 01f94434
......@@ -5,13 +5,28 @@ Page({
* 页面的初始数据
*/
data: {
progress: 20,
userInfo: {}
progress: 0,
userInfo: {},
custormInfo: {},
memberNextExp: {},
gap: 0,
nextExp: 0,
},
getInfo: function () {
let _this = this
app.$apiJava("api/b2b/user/getSimpleUser", { account: _this.data.userInfo.account }).then(res => {
console.log(res)
app.$apiJavaNew("api/b2b/user/getSimpleUser", { account: this.data.userInfo.account }).then(res => {
this.setData({
custormInfo: res,
})
}).catch(err => { })
},
getUserMemberExp: function () {
app.$apiJavaNew("api/member/getUserMemberExp", { customer: this.data.userInfo.customerAccountId }).then(res => {
let NextExp = (((res.next.nextExp - res.next.gap) / res.next.nextExp) * 100).toFixed(2)
this.setData({
progress: NextExp,
gap: res.next.gap,
nextExp: res.next.nextExp - res.next.gap,
})
}).catch(err => { })
},
/**
......@@ -23,6 +38,7 @@ Page({
userInfo: userInfo
})
this.getInfo()
this.getUserMemberExp()
},
/**
......
......@@ -9,13 +9,14 @@
<view class='mine2_info clearfix'>
<view class="boxF">
<view class="boxS">
<view class="boxT" style="background-image: url(http://b.hiphotos.baidu.com/image/pic/item/10dfa9ec8a1363272bc51737938fa0ec08fac78e.jpg);"></view>
<view class="boxT" wx:if="{{!custormInfo.photo}}" style="background-image: url(http://imgfile.oytour.com/New/Upload/Cloud/2019-06/20190628030353039.png);"></view>
<view wx:else class="boxT" style="background-image: url({{custormInfo.photo}});"></view>
</view>
</view>
<view class='inf-box'>
<view class='top'>
<view class='name'>唐杰</view>
<view class='grade'><text>V2</text></view>
<view class='name'>{{custormInfo.name}}</view>
<view class='grade'><text>V{{custormInfo.vipRate}}</text></view>
<view class='progress-box'>
<view class='progress-box-line' style='width: {{progress}}%'></view>
</view>
......@@ -24,24 +25,24 @@
<view class='addr'>
<view class='addr-left'>
<image src='../../images/menber/fangzi.png'></image>
<text>唐菲旅行社</text>
<text>{{custormInfo.customerName}}</text>
</view>
<view>
<image src='../../images/menber/phone.png'></image>
<text>18911111489</text>
<text>{{custormInfo.mobile}}</text>
</view>
</view>
<view class='kefu'>
<text>客服经理(唐杰:15444444566)</text>
<text>客服经理({{custormInfo.managers[0].emName}}:{{custormInfo.managers[0].mobile}})</text>
</view>
</view>
<view class='jiaoyi-box'>
<view class='jiaoyi-box-left'>
<view class='price'>¥ <text>466989.00</text></view>
<view class='price'>¥ <text>{{custormInfo.monthTradeMoney}}</text></view>
<view class='jiaoti-tit'>本月交易额</view>
</view>
<view class='jiaoyi-box-right'>
<view class='price'>¥ <text>256589.00</text></view>
<view class='price'>¥ <text>{{custormInfo.sumTradeMoney}}</text></view>
<view class='jiaoti-tit'>累计交易额</view>
</view>
</view>
......@@ -93,7 +94,7 @@
</view>
<view class="tablist">
<view>
<navigator hover-class="Home_hover" url="/pages/member/memberCenter/memberCenter">
<navigator hover-class="Home_hover" url="/pages/member/memberCenter/memberCenter?progress={{progress}}&gap={{gap}}&vip={{custormInfo.vipRate}}&nextExp={{nextExp}}">
<image mode="aspectFit" src="../../images/menber/menu-hui.png"></image>
<view class='order-type-name'>会员中心</view>
</navigator>
......
// pages/member/memberCenter/memberCenter.js
let app = getApp()
Page({
/**
* 页面的初始数据
*/
data: {
progress: 20,
progress: 0,
gap: 0,
vip: 0,
nextExp: 0,
memberrate: [],
},
getMemberRate: function () {
app.$apiJavaNew("api/member/getmemberrate", { state: 1, name: '' }).then(res => {
let data = res,
vip = this.data.vip,
nextExp = 600;
res.map((x, index)=>{
if (index <= vip) {
x.progress = x.tradeMoneyReq > 0 ? ((nextExp / x.tradeMoneyReq) * 100).toFixed(2) : 0
} else {
x.progress = 0
}
})
this.setData({
memberrate: data
})
console.log(res)
}).catch(err => { })
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
onLoad: function (options) {
this.setData({
progress: Number(options.progress),
gap: options.gap,
vip: Number(options.vip),
nextExp: options.nextExp
})
this.getMemberRate()
},
/**
......
<view class='member-center'>
<view class='member-center-top'>
<view class='left'>
V2
V{{vip}}
</view>
<view class='right'>
<view class='name'>V2普通会员</view>
<view class='reg'>600</view>
<view class='name'>V{{vip}}普通会员</view>
<view class='reg'>{{nextExp}}</view>
<view class='progress-box'>
<view class='progress-box-line' style='width: {{progress}}%'></view>
</view>
<view class='tips'>还差234升级V3尊享会员</view>
<view class='tips'>还差{{gap}}升级V{{vip+1}}尊享会员</view>
</view>
</view>
<view class='member-center-bottom'>
......@@ -20,19 +20,31 @@
<view class='dengji'>
<scroll-view scroll-x>
<view class='big-box'>
<view class='live-item'>
<view class='live-item' wx:for="{{memberrate}}" wx:for-item="item" wx:for-index="index" wx:key="index" >
<view class='live-item-left'>
<view class='live-item-left-img' style='background-image: url(http://imgfile.oytour.com/New/Upload/Cloud/2019-06/20190627045202190.png)'>
V0
<view wx:if="{{index === 0 || index === 5}}" class='live-item-left-img' style='background-image: url(http://imgfile.oytour.com/New/Upload/Cloud/2019-06/20190627045202190.png)'>
{{item.name}}
</view>
<view wx:elif="{{index === 1 || index === 6}}" class='live-item-left-img' style='background-image: url(http://imgfile.oytour.com/New/Upload/Cloud/2019-06/20190627045202206.png)'>
{{item.name}}
</view>
<view wx:elif="{{index === 2 || index === 7}}" class='live-item-left-img' style='background-image: url(http://imgfile.oytour.com/New/Upload/Cloud/2019-06/20190627045202161.png)'>
{{item.name}}
</view>
<view wx:elif="{{index === 3 || index === 8}}" class='live-item-left-img' style='background-image: url(http://imgfile.oytour.com/New/Upload/Cloud/2019-06/20190627045202195.png)'>
{{item.name}}
</view>
<view class='reg-num'>0</view>
<view wx:elif="{{index === 4 || index === 9}}" class='live-item-left-img' style='background-image: url(http://imgfile.oytour.com/New/Upload/Cloud/2019-06/20190627045202216.png)'>
{{item.name}}
</view>
<view class='reg-num'>{{item.tradeMoneyReq}}</view>
</view>
<view class='progress-small-box'>
<view class='progress-small-box-line' style='width: {{40}}%'></view>
<view class='radius' style='left:{{40-2}}%'></view>
<view class='progress-small-box-line' style='width: {{item.progress}}%'></view>
<view class='radius' wx:if="{{item.progress!==0}}" style='left:{{item.progress-2}}%'></view>
</view>
</view>
<view class='live-item'>
<!-- <view class='live-item'>
<view class='live-item-left'>
<view class='live-item-left-img' style='background-image: url(http://imgfile.oytour.com/New/Upload/Cloud/2019-06/20190627045202206.png)'>
V1
......@@ -41,7 +53,6 @@
</view>
<view class='progress-small-box'>
<view class='progress-small-box-line' style='width: {{0}}%'></view>
<!-- <view class='radius' style='left:{{80}}%'></view> -->
</view>
</view>
<view class='live-item'>
......@@ -53,7 +64,6 @@
</view>
<view class='progress-small-box'>
<view class='progress-small-box-line' style='width: {{0}}%'></view>
<!-- <view class='radius' style='left:{{80}}%'></view> -->
</view>
</view>
<view class='live-item'>
......@@ -65,7 +75,6 @@
</view>
<view class='progress-small-box'>
<view class='progress-small-box-line' style='width: {{0}}%'></view>
<!-- <view class='radius' style='left:{{80}}%'></view> -->
</view>
</view>
<view class='live-item'>
......@@ -77,9 +86,8 @@
</view>
<view class='progress-small-box'>
<view class='progress-small-box-line' style='width: {{0}}%'></view>
<!-- <view class='radius' style='left:{{80}}%'></view> -->
</view>
</view>
</view> -->
</view>
</scroll-view>
</view>
......
......@@ -53,7 +53,7 @@ page {
}
.progress-small-box{
width: 70rpx;
height: 4rpx;
height: 10rpx;
background:rgba(238,238,238,.8);
margin: -50rpx 10rpx 0 0;
}
......@@ -98,11 +98,11 @@ page {
text-align: center;
}
.live-item .live-item-left{
width: 80rpx;
width: 100rpx;
text-align: center;
}
.live-item .live-item-left .live-item-left-img{
margin-left: 10rpx;
margin-left: 25rpx;
width: 60rpx;
height: 60rpx;
background-size:100% 100%;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment