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