Skip to content

Commit b7e4051

Browse files
committed
profile
1 parent cfd79b1 commit b7e4051

File tree

4 files changed

+48
-32
lines changed

4 files changed

+48
-32
lines changed

README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,8 +213,12 @@ npm run build
213213

214214
<img src="https://github.com/bailicangdu/vue2-elm/blob/master/screenshots/reset.png" width="365" height="619"/>
215215

216+
## 个人中心
216217

217-
#### 其他页面陆续开发中。。。
218+
<img src="https://github.com/bailicangdu/vue2-elm/blob/master/screenshots/profile.png" width="365" height="619"/>
219+
220+
221+
#### 其他页面正在开发中。。。
218222

219223

220224
# 总结
@@ -232,4 +236,4 @@ npm run build
232236

233237

234238

235-
如果觉得不错,请star一下吧 😊
239+
##### 如果觉得不错,请star一下吧 😊

screenshots/profile.png

94.7 KB
Loading

src/page/profile/profile.vue

Lines changed: 25 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,21 @@
33
<head-top go-back='true' :head-title="profiletitle"></head-top>
44
<section class="profile-number">
55
<router-link to="/profile/info" class="profile-link">
6-
<span class="privateImage">
6+
<img :src="getImgPath(this.avatar)" class="privateImage" v-if="this.avatar">
7+
<span class="privateImage" v-else>
78
<svg class="privateImage-svg">
89
<use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#avatar-default"></use>
910
</svg>
1011
</span>
1112
<div class="user-info">
12-
<p>3adc5bfcd</p>
13+
<p>{{username}}</p>
1314
<p>
1415
<span class="user-icon">
1516
<svg class="icon-mobile" fill="#fff">
1617
<use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#mobile"></use>
1718
</svg>
1819
</span>
19-
<span class="icon-mobile-number">15800319949</span>
20+
<span class="icon-mobile-number">{{mobile}}</span>
2021
</p>
2122
</div>
2223
<span class="arrow">
@@ -29,15 +30,15 @@
2930
<section class="info-data">
3031
<ul class="clear">
3132
<router-link to="/profile/balance" tag="li" class="info-data-link">
32-
<span class="info-data-top"><b>0.00</b>元</span>
33+
<span class="info-data-top"><b>{{balance}}</b>元</span>
3334
<span class="info-data-bottom">我的余额</span>
3435
</router-link>
3536
<router-link to="/profile/benefit" tag="li" class="info-data-link">
36-
<span class="info-data-top"><b>1</b>个</span>
37+
<span class="info-data-top"><b>{{count}}</b>个</span>
3738
<span class="info-data-bottom">我的优惠</span>
3839
</router-link>
3940
<router-link to="/profile/points" tag="li" class="info-data-link">
40-
<span class="info-data-top"><b>1010</b>分</span>
41+
<span class="info-data-top"><b>{{pointNumber}}</b>分</span>
4142
<span class="info-data-bottom">我的积分</span>
4243
</router-link>
4344
</ul>
@@ -94,7 +95,7 @@
9495
</section>
9596
<section class="profile-1reTe">
9697
<!-- 服务中心 -->
97-
<router-link to='/profile/service' class="myorder">
98+
<router-link to='/service' class="myorder">
9899
<aside>
99100
<svg fill="#4aa5f0">
100101
<use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#service"></use>
@@ -135,20 +136,34 @@
135136
<script>
136137
import headTop from '../../components/header/head'
137138
import {mapState} from 'vuex'
139+
import {getImgPath} from '../../components/common/mixin'
138140
139141
export default {
140142
data(){
141143
return{
142144
profiletitle: '我的',
143-
count : '', //优惠券个数
144-
pontNumber : '', //积分
145+
getUserinfo: {}, //得到数据
146+
username: '', //用户名
147+
mobile: '', //电话号码
148+
balance: '', //我的余额
149+
count : '', //优惠券个数
150+
pointNumber : '', //积分数
151+
avatar: '', //头像地址
145152
}
146153
},
147154
148155
mounted(){
149-
console.log(this.userInfo)
156+
this.getUserinfo = this.userInfo;
157+
this.avatar = this.getUserinfo.avatar;
158+
this.username = this.getUserinfo.username;
159+
this.mobile = this.getUserinfo.mobile;
160+
this.balance = this.getUserinfo.balance;
161+
this.count = this.getUserinfo.gift_amount;
162+
this.pointNumber = this.getUserinfo.point;
150163
},
151164
165+
mixins: [getImgPath],
166+
152167
components:{
153168
headTop
154169
},

src/service/tempdata/login.js

Lines changed: 17 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3,30 +3,27 @@ export const validate_token = {
33
};
44

55
export const userInfo = {
6-
"user_id": 109065163,
7-
"mobile": "13681711254",
8-
"is_mobile_valid": true,
9-
"email": "",
10-
"is_email_valid": false,
11-
"avatar": "",
12-
"username": "32f7e5896",
13-
"is_active": true,
14-
"brand_member": false,
15-
"point": 960,
6+
"avatar": "e3c1b9262cfb2c65fa3054d54cfaec54jpeg",
7+
"balance": 0,
168
"brand_member_new": 0,
179
"column_desc": {
18-
"gift_mall_desc": "0\u5143\u597d\u7269\u5728\u8fd9\u91cc!",
19-
"game_desc": "\u73a9\u6e38\u620f\u9886\u7ea2\u5305",
10+
"game_desc": "玩游戏领红包",
11+
"game_image_hash": "05f108ca4e0c543488799f0c7c708cb1jpeg",
2012
"game_is_show": 1,
21-
"game_link": "https:\/\/gamecenter.faas.ele.me",
22-
"game_image_hash": "05f108ca4e0c543488799f0c7c708cb1jpeg"
13+
"game_link": "https://gamecenter.faas.ele.me",
14+
"gift_mall_desc": "0元好物在这里"
2315
},
24-
"pay_without_password": null,
25-
"delivery_card_expire_days": 0,
26-
"balance": 0,
27-
"payment_quota": 50,
2816
"current_address_id": 0,
2917
"current_invoice_id": 0,
30-
"referal_code": "",
31-
"gift_amount": 2
18+
"delivery_card_expire_days": 0,
19+
"email": "",
20+
"gift_amount": 1,
21+
"id": 108758383,
22+
"is_active": 1,
23+
"is_email_valid": false,
24+
"is_mobile_valid": true,
25+
"mobile": "13681711254",
26+
"point": 960,
27+
"user_id": 109065163,
28+
"username": "cangdu"
3229
};

0 commit comments

Comments
 (0)