Skip to content

Commit d400165

Browse files
authored
Merge pull request bailicangdu#43 from wahyd4/master
登陆 => 登录
2 parents 44ecc7d + 189c8bd commit d400165

File tree

12 files changed

+86
-86
lines changed

12 files changed

+86
-86
lines changed

README.md

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
# 前言
22

3-
初学vue时曾在网上搜索vue的实战项目源码,无奈大部分都是简单的demo,对于深究vue没有太大的帮助,剩下的一些大部分都是像音乐播放器之类的展示型项目,交互没有预期那么复杂。但我们实际在工作中,经常会遇到有购物车的项目,这类项目因为涉及到money,所以对逻辑严谨度要求高,页面之间交互复杂,又会伴随着登陆、注册、用户信息等等,常常会让我们很头疼。既然还没人用vue写过这样的项目,那不如我来写,开源出来对能看到的人也会有帮助。
3+
初学vue时曾在网上搜索vue的实战项目源码,无奈大部分都是简单的demo,对于深究vue没有太大的帮助,剩下的一些大部分都是像音乐播放器之类的展示型项目,交互没有预期那么复杂。但我们实际在工作中,经常会遇到有购物车的项目,这类项目因为涉及到money,所以对逻辑严谨度要求高,页面之间交互复杂,又会伴随着登录、注册、用户信息等等,常常会让我们很头疼。既然还没人用vue写过这样的项目,那不如我来写,开源出来对能看到的人也会有帮助。
44

55
这种功能性的项目很实用但是往往也很枯燥,没有音乐播放器那么看起来绚丽,思来想去发现饿了么是一个不错的素材,一来它足够复杂,开放的外卖平台比一般的公司独有商店更加复杂。二来 见到那么多美食,大家也不会感觉到厌烦。
66

77
为啥是饿了么,而不是百度,美团?原因很简单,三个外卖大佬里,饿了么的色调和布局是最漂亮的,看起来最舒服。
88

9-
此项目大大小小共 45 个页面,涉及注册、登陆、商品展示、购物车、下单等等,是一个完整的流程。一般公司即便是官网的单页面项目都没这么复杂,如果这个项目能驾驭的了,相信大部分公司的其他单页面应用也就不在话下,即便更复杂,也不会比这个高到哪里去。
9+
此项目大大小小共 45 个页面,涉及注册、登录、商品展示、购物车、下单等等,是一个完整的流程。一般公司即便是官网的单页面项目都没这么复杂,如果这个项目能驾驭的了,相信大部分公司的其他单页面应用也就不在话下,即便更复杂,也不会比这个高到哪里去。
1010

1111
因为利用业余时间来做,年前就开始写,又跨个年,周期有点长,项目从零布局到完成共用了2个多月的时间,目前项目已经完成,正在进行一些性能的优化,增加详细的注释。
1212

@@ -24,7 +24,7 @@ vue2 + vuex + vue-router + webpack + ES6/7 + fetch + sass + flex + svg
2424

2525
# 项目运行
2626

27-
#### 注意:由于涉及大量的 ES6/7 等新属性,nodejs 必须是 6.0 以上版本 ,node 7 是先行版,有可能会出问题,建议使用 node 6 稳定版
27+
#### 注意:由于涉及大量的 ES6/7 等新属性,nodejs 必须是 6.0 以上版本 ,node 7 是先行版,有可能会出问题,建议使用 node 6 稳定版
2828

2929
```
3030
git clone https://github.com/bailicangdu/vue2-elm.git  
@@ -75,7 +75,7 @@ npm run build
7575

7676
# 关于 demo 与 数据 的说明🤔
7777

78-
1、下载代码运行后,因为开启了反向代理,可以获取真实的官方数据,最终可以进行下单(真实的下单,而不是模拟,下单后可以在官方App中查看并付款,亲自试过,且成功付款点餐),但是为了安全起见,登陆的帐号为固定的帐号,以免泄露个人信息,不过照样可以点餐。
78+
1、下载代码运行后,因为开启了反向代理,可以获取真实的官方数据,最终可以进行下单(真实的下单,而不是模拟,下单后可以在官方App中查看并付款,亲自试过,且成功付款点餐),但是为了安全起见,登录的帐号为固定的帐号,以免泄露个人信息,不过照样可以点餐。
7979

8080
2、demo的数据为模拟的固定数据,只做为效果演示,因为反向代理必须在PC端运行代码才行。
8181

@@ -85,7 +85,7 @@ npm run build
8585
#### (demo使用的是模拟数据,数据是固定的,只做为样式的演示,要获取真实的数据,请clone代码并运行);
8686

8787
[查看demo请戳这里](http://test.fe.ptdev.cn/elm/)(请用chrome手机模式预览)
88-
88+
8989
### 移动端扫描下方二维码
9090

9191
![](https://github.com/bailicangdu/vue2-elm/blob/master/screenshots/elm_ewm.png)
@@ -106,7 +106,7 @@ npm run build
106106
- [x] 店铺评价页面 -- 完成
107107
- [x] 单个食品详情页面 -- 完成
108108
- [x] 商家详情页 -- 完成
109-
- [x] 登陆、注册 -- 完成
109+
- [x] 登录、注册 -- 完成
110110
- [x] 修改密码 -- 完成
111111
- [x] 个人中心 -- 完成
112112
- [x] 发送短信、语音验证 -- 完成
@@ -119,7 +119,7 @@ npm run build
119119
- [x] 服务中心 -- 完成
120120
- [x] 红包 -- 完成
121121
- [x] 上传头像 -- 完成
122-
- [ ] 付款 -- 臣妾做不到啊~~
122+
- [ ] 付款 -- 臣妾做不到啊~~
123123

124124

125125

@@ -131,7 +131,7 @@ npm run build
131131

132132
3、vue因其轻量级的框架在中小型项目中表现亮眼,在大型单页面应用中因为vuex的存在,表现依然出色,在处理复杂交互逻辑的时候,vuex的存在是不可或缺的。所以说利用 vue + vuex 完全可以去做大型的单页面项目。
133133

134-
4、项目写到现在,从 登陆注册到、首页、搜索、商家列表、购物车、下单、订单列表、个人中心 一个流程走完之后、不但对vue的理解更深一层,而且对以后掌控大型项目的时候也有非常多的帮助,做一个实际的项目才能对自己有很大的提升。
134+
4、项目写到现在,从 登录注册到、首页、搜索、商家列表、购物车、下单、订单列表、个人中心 一个流程走完之后、不但对vue的理解更深一层,而且对以后掌控大型项目的时候也有非常多的帮助,做一个实际的项目才能对自己有很大的提升。
135135

136136
5、曾一度怀疑,花几个月的时间做这样一个项目到底有没有意义,本来只是想做一个小项目练练手,没想到后来越写越多,不过坚持下来后我相信一切都是值得的。
137137

@@ -186,7 +186,7 @@ npm run build
186186
<img src="https://github.com/bailicangdu/vue2-elm/blob/master/screenshots/search.gif" width="365" height="619"/>
187187

188188

189-
### 登陆页
189+
### 登录页
190190

191191
<img src="https://github.com/bailicangdu/vue2-elm/blob/master/screenshots/login1.png" width="365" height="619"/>
192192
<img src="https://github.com/bailicangdu/vue2-elm/blob/master/screenshots/login.gif" width="365" height="619"/>
@@ -224,17 +224,17 @@ npm run build
224224
| |-- mUtils.js // 常用的js方法
225225
| |-- rem.js // px转换rem
226226
| |-- images // 公共图片
227-
| |-- pages
227+
| |-- pages
228228
| |-- balance // 余额页
229229
| |--children
230230
| |--detail // 余额说明
231231
| |-- benefit // 红包页
232232
| |--children
233233
| |--commend // 推荐有奖
234-
| |--coupon // 代金券说明
235-
| |--exchange // 兑换红包
236-
| |--hbDescription // 红包说明
237-
| |--hbHistory // 历史红包
234+
| |--coupon // 代金券说明
235+
| |--exchange // 兑换红包
236+
| |--hbDescription // 红包说明
237+
| |--hbHistory // 历史红包
238238
| |-- city // 当前城市页
239239
| |-- food // 食品筛选排序页
240240
| |-- confirmOrder // 确认订单页
@@ -252,7 +252,7 @@ npm run build
252252
| |-- find // 发现页
253253
| |-- forget // 忘记密码,修改密码页
254254
| |-- home // 首页
255-
| |-- login // 登陆注册页
255+
| |-- login // 登录注册页
256256
| |-- msite // 商铺列表页
257257
| |-- order // 订单列表页
258258
| |--children
@@ -278,14 +278,14 @@ npm run build
278278
| |--children
279279
| |--questionDetail // 问题详情
280280
|       |-- shop                     // 商铺筛选页
281-
| |-- children
282-
| |-- foodDetail // 商铺信息页
281+
| |-- children
282+
| |-- foodDetail // 商铺信息页
283283
| |-- shopDetail // 单个商铺信息页
284-
| |-- children
285-
| |-- shopSafe // 商铺认证信息页
284+
| |-- children
285+
| |-- shopSafe // 商铺认证信息页
286286
| |-- vipcard // 会员卡办理页
287-
| |-- children
288-
| |-- invoiceRecord // 购买记录
287+
| |-- children
288+
| |-- invoiceRecord // 购买记录
289289
| |-- useCart // 使用卡号购买
290290
| |-- vipDescription // 会员说明
291291
|

src/components/header/head.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<svg class="user_avatar" v-if="userInfo">
1212
<use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#user"></use>
1313
</svg>
14-
<span class="login_span" v-else>登陆|注册</span>
14+
<span class="login_span" v-else>登录|注册</span>
1515
</router-link>
1616
<section class="title_head ellipsis" v-if="headTitle">
1717
<span class="title_text">{{headTitle}}</span>
@@ -28,7 +28,7 @@
2828
export default {
2929
data(){
3030
return{
31-
31+
3232
}
3333
},
3434
mounted(){
@@ -37,7 +37,7 @@
3737
3838
},
3939
mounted(){
40-
40+
4141
},
4242
props: ['signinUp', 'headTitle', 'goBack'],
4343
computed: {

src/page/city/city.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@
88
<input type="search" name="city" placeholder="输入学校、商务楼、地址" class="city_input input_style" required v-model='inputVaule'>
99
</div>
1010
<div>
11-
<input type="submit" name="submit" class="city_submit input_style" @click='postpois'>
11+
<input type="submit" name="submit" class="city_submit input_style" @click='postpois' value="提交">
1212
</div>
1313
</form>
1414
<header v-if="historytitle" class="pois_search_history">搜索历史</header>
1515
<ul class="getpois_ul">
1616
<li v-for="(item, index) in placelist" @click='nextpage(index, item.geohash)' :key="index">
1717
<h4 class="pois_name ellipsis">{{item.name}}</h4>
1818
<p class="pois_address ellipsis">{{item.address}}</p>
19-
</li>
19+
</li>
2020
</ul>
2121
<div class="search_none_place" v-if="placeNone">很抱歉!无搜索结果</div>
2222
</div>
@@ -31,7 +31,7 @@
3131
data(){
3232
return{
3333
inputVaule:'', // 搜索地址
34-
cityid:'', // 当前城市id
34+
cityid:'', // 当前城市id
3535
cityname:'', // 当前城市名字
3636
placelist:[], // 搜索城市列表
3737
placeHistory:[], // 历史搜索记录
@@ -79,7 +79,7 @@
7979
nextpage(index, geohash){
8080
let history = getStore('placeHistory');
8181
let choosePlace = this.placelist[index];
82-
if (history) {
82+
if (history) {
8383
let checkrepeat = false;
8484
this.placeHistory = JSON.parse(history);
8585
this.placeHistory.forEach(item => {

src/page/confirmOrder/children/children/addAddress.vue

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
</svg>
2020
<span>女士</span>
2121
</span>
22-
</div>
22+
</div>
2323
</section>
2424
</section>
2525
<section class="section_list">
@@ -35,7 +35,7 @@
3535
<section class="section_list">
3636
<span class="section_left">送餐地址</span>
3737
<section class="section_right">
38-
<router-link to="/confirmOrder/chooseAddress/addAddress/searchAddress" tag="div" class="choose_address">{{searchAddress? searchAddress.name : '小区/写字楼/学校等'}}</router-link>
38+
<router-link to="/confirmOrder/chooseAddress/addAddress/searchAddress" tag="div" class="choose_address">{{searchAddress? searchAddress.name : '小区/写字楼/学校等'}}</router-link>
3939
<input type="text" name="address_detail" placeholder="详细地址(如门牌号等)" v-model="address_detail" class="input_style">
4040

4141
</section>
@@ -51,7 +51,7 @@
5151
<alert-tip v-if="showAlert" @closeTip="showAlert = false" :alertText="alertText"></alert-tip>
5252
<transition name="router-slid" mode="out-in">
5353
<router-view></router-view>
54-
</transition>
54+
</transition>
5555
</div>
5656
</template>
5757

@@ -78,15 +78,15 @@
7878
}
7979
},
8080
created(){
81-
81+
8282
},
8383
components: {
8484
headTop,
8585
alertTip,
8686
},
8787
computed: {
8888
...mapState([
89-
'searchAddress', 'geohash', 'userInfo',
89+
'searchAddress', 'geohash', 'userInfo',
9090
]),
9191
},
9292
methods: {
@@ -101,7 +101,7 @@
101101
async addAddress(){
102102
if (!(this.userInfo && this.userInfo.user_id)) {
103103
this.showAlert = true;
104-
this.alertText = '请登陆'
104+
this.alertText = '请登录'
105105
}else if(!this.name){
106106
this.showAlert = true;
107107
this.alertText = '请输入姓名'
@@ -135,10 +135,10 @@
135135
}
136136
}
137137
</script>
138-
138+
139139
<style lang="scss" scoped>
140140
@import 'src/style/mixin';
141-
141+
142142
.address_page{
143143
position: fixed;
144144
top: 0;

src/page/confirmOrder/confirmOrder.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@
119119
<alert-tip v-if="showAlert" @closeTip="showAlert = false" :alertText="alertText"></alert-tip>
120120
<transition name="router-slid" mode="out-in">
121121
<router-view></router-view>
122-
</transition>
122+
</transition>
123123
</div>
124124
</template>
125125

@@ -250,7 +250,7 @@
250250
//用户未登录时弹出提示框
251251
if (!(this.userInfo && this.userInfo.user_id)) {
252252
this.showAlert = true;
253-
this.alertText = '请登陆';
253+
this.alertText = '请登录';
254254
return
255255
//未选择地址则提示
256256
}else if(!this.choosedAddress){
@@ -434,7 +434,7 @@
434434
margin-top: .4rem;
435435
header{
436436
padding: .7rem;
437-
border-bottom: 0.025rem solid #f5f5f5;
437+
border-bottom: 0.025rem solid #f5f5f5;
438438
img{
439439
@include wh(1.2rem, 1.2rem);
440440
vertical-align: middle;
@@ -466,7 +466,7 @@
466466
}
467467
}
468468
.total_price{
469-
border-top: 0.025rem solid #f5f5f5;
469+
border-top: 0.025rem solid #f5f5f5;
470470
}
471471
}
472472
.confrim_order{

src/page/login/login.vue

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<template>
22
<div class="loginContainer">
33
<head-top :head-title="loginWay? '登录':'密码登录'" goBack="true">
4-
<div slot="changeLogin" class="change_login" @click="changeLoginWay">{{loginWay? "密码登陆":"短信登陆"}}</div>
4+
<div slot="changeLogin" class="change_login" @click="changeLoginWay">{{loginWay? "密码登录":"短信登录"}}</div>
55
</head-top>
66
<form class="loginForm" v-if="loginWay">
77
<section class="input_container phone_number">
@@ -38,10 +38,10 @@
3838
</section>
3939
</form>
4040
<p class="login_tips">
41-
温馨提示:未注册饿了么账号的手机号,登陆时将自动注册,且代表您已同意
41+
温馨提示:未注册饿了么账号的手机号,登录时将自动注册,且代表您已同意
4242
<a href="https://h5.ele.me/service/agreement/">《用户服务协议》</a>
4343
</p>
44-
<div class="login_container" @click="mobileLogin">登陆</div>
44+
<div class="login_container" @click="mobileLogin">登录</div>
4545
<router-link to="/forget" class="to_forget" v-if="!loginWay">忘记密码?</router-link>
4646
<alert-tip v-if="showAlert" :showHide="showAlert" @closeTip="closeTip" :alertText="alertText"></alert-tip>
4747
</div>
@@ -56,11 +56,11 @@
5656
export default {
5757
data(){
5858
return {
59-
loginWay: true, //登陆方式,默认短信登陆
59+
loginWay: true, //登录方式,默认短信登录
6060
showPassword: false, // 是否显示密码
6161
phoneNumber: null, //电话号码
6262
mobileCode: null, //短信验证码
63-
validate_token: null, //获取短信时返回的验证值,登陆时需要
63+
validate_token: null, //获取短信时返回的验证值,登录时需要
6464
computedTime: 0, //倒数记时
6565
userInfo: null, //获取到的用户信息
6666
userAccount: null, //用户名
@@ -88,7 +88,7 @@
8888
...mapMutations([
8989
'RECORD_USERINFO',
9090
]),
91-
//改变登陆方式
91+
//改变登录方式
9292
changeLoginWay(){
9393
this.loginWay = !this.loginWay;
9494
},
@@ -136,7 +136,7 @@
136136
this.validate_token = res.validate_token;
137137
}
138138
},
139-
//发送登陆信息
139+
//发送登录信息
140140
async mobileLogin(){
141141
if (this.loginWay) {
142142
if (!this.rightPhoneNumber) {
@@ -164,7 +164,7 @@
164164
this.alertText = '请输入验证码';
165165
return
166166
}
167-
//用户名登陆
167+
//用户名登录
168168
this.userInfo = await accountLogin(this.userAccount, this.passWord, this.codeNumber);
169169
}
170170
//如果返回的值不正确,则弹出提示框,返回的值正确则返回上一页
@@ -175,12 +175,12 @@
175175
}else{
176176
this.RECORD_USERINFO(this.userInfo);
177177
this.$router.go(-1);
178-
178+
179179
}
180180
},
181181
closeTip(){
182182
this.showAlert = false;
183-
}
183+
}
184184
}
185185
}
186186

0 commit comments

Comments
 (0)