完成个人中心数据展示
This commit is contained in:
parent
f5be62d934
commit
a71443ffa9
|
@ -86,7 +86,6 @@ export default {
|
|||
}).then(response => {
|
||||
if (response.code == 1) {
|
||||
let user = {
|
||||
avatar: response.data.avatar,
|
||||
nickname: response.data.user_nickname,
|
||||
openid: response.data.openid,
|
||||
mobile: response.data.mobile,
|
||||
|
@ -216,5 +215,26 @@ export default {
|
|||
return reject(response.msg);
|
||||
}).catch(e => { });
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 服务数据
|
||||
*/
|
||||
serviceData() {
|
||||
return new Promise((resolve, reject) => {
|
||||
prototype.$request({
|
||||
api: "user.info",
|
||||
}).then(response => {
|
||||
if (response.code == 1) {
|
||||
return resolve({
|
||||
times: response.data.data.count || 0,
|
||||
favorableRate: response.data.data.good || "0",
|
||||
grade: response.data.data.score || "0",
|
||||
disposableBalance: response.data.balance || 0,
|
||||
FreezeBalance: response.data.balance_no || 0,
|
||||
});
|
||||
}
|
||||
return reject(response.msg);
|
||||
}).catch(e => { });
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -43,27 +43,27 @@
|
|||
<view class="service-data">
|
||||
<view class="section-text">
|
||||
<text>服务:</text>
|
||||
<text class="num">687</text>
|
||||
<text class="num">{{ serviceData.times }}</text>
|
||||
<text>次</text>
|
||||
</view>
|
||||
<view class="section-text">
|
||||
<text>好评率:</text>
|
||||
<text class="num">687</text>
|
||||
<text class="num">{{ serviceData.favorableRate }}</text>
|
||||
<text>%</text>
|
||||
</view>
|
||||
<view class="section-text">
|
||||
<text>评分:</text>
|
||||
<text class="num">5.00</text>
|
||||
<text class="num">{{ serviceData.grade }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="balance-box">
|
||||
<view class="balance-section">
|
||||
<text class="title">可提现余额(元)</text>
|
||||
<text class="num">0.00</text>
|
||||
<text class="num">{{ utils.formatNumber(serviceData.disposableBalance, 2) }}</text>
|
||||
</view>
|
||||
<view class="balance-section">
|
||||
<text class="title">可提现余额(元)</text>
|
||||
<text class="num">0.00</text>
|
||||
<text class="title">反馈期余额(元)</text>
|
||||
<text class="num">{{ utils.formatNumber(serviceData.FreezeBalance, 2) }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
@ -122,6 +122,13 @@ export default {
|
|||
safePt: 0,
|
||||
backgroundImage: require("@/static/temp/1.png"),
|
||||
acceptOrderState: false,
|
||||
serviceData: {
|
||||
times: 0,
|
||||
favorableRate: "0",
|
||||
grade: "0",
|
||||
disposableBalance: 0,
|
||||
FreezeBalance: 0,
|
||||
},
|
||||
};
|
||||
},
|
||||
components: {
|
||||
|
@ -140,9 +147,14 @@ export default {
|
|||
onLoad() {},
|
||||
async onShow() {
|
||||
await this.$store.dispatch("user/info");
|
||||
if (this.isLogin && !this.finishInfo) {
|
||||
if (this.isLogin) {
|
||||
if (!this.finishInfo) {
|
||||
this.$utils.toPage("/pages/member/service-info");
|
||||
}
|
||||
this.$models.user.serviceData().then((data) => {
|
||||
this.serviceData = data;
|
||||
});
|
||||
}
|
||||
},
|
||||
onReady() {},
|
||||
onReachBottom() {},
|
||||
|
|
|
@ -7,8 +7,6 @@ export default {
|
|||
token: "",
|
||||
finishInfo: false,
|
||||
info: {
|
||||
id: 0,
|
||||
avatar: "",
|
||||
nickname: "",
|
||||
openid: "",
|
||||
mobile: "",
|
||||
|
|
Loading…
Reference in New Issue