Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/bailicangdu/vue2-elm
Browse files Browse the repository at this point in the history
  • Loading branch information
bailicangdu committed Jan 17, 2018
2 parents fba0fff + f6fef35 commit 5c91274
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 23 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ npm run dev
```
## 另外
此项目有配套的后台系统,如果想前后台同时开发,可以下载对应的后台系统:[后台项目传送地址](https://github.com/bailicangdu/node-elm)
此项目有配套的后台系统,如果想体验前后台同时开发,可以下载对应的后台系统:[后台项目传送地址](https://github.com/bailicangdu/node-elm)

此时启动项目使用:npm run local 而不是 npm run dev。

Expand Down
2 changes: 1 addition & 1 deletion src/components/common/computeTime.vue
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
.page{
display: inline-block;
.rem_time{
@include sc(.55rem, #orange);
@include sc(.55rem, orange);
padding: .1rem .2rem;
border-radius: .15rem;
}
Expand Down
29 changes: 18 additions & 11 deletions src/page/food/food.vue
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
</ul>
</section>
</section>
</transition>
</transition>
</div>
<div class="sort_item" :class="{choose_type:sortBy == 'sort'}">
<div class="sort_item_container" @click="chooseType('sort')">
Expand Down Expand Up @@ -120,7 +120,7 @@
</li>
</ul>
</section>
</transition>
</transition>
</div>
<div class="sort_item" :class="{choose_type:sortBy == 'activity'}">
<div class="sort_item_container" @click="chooseType('activity')">
Expand Down Expand Up @@ -168,15 +168,15 @@
<section class="shop_list_container">
<shop-list :geohash="geohash" :restaurantCategoryId="restaurant_category_id" :restaurantCategoryIds="restaurant_category_ids" :sortByType='sortByType' :deliveryMode="delivery_mode" :confirmSelect="confirmStatus" :supportIds="support_ids" v-if="latitude" @DidConfrim="clearAll"></shop-list>
</section>
</div>
</div>
</template>

<script>
import {mapState, mapMutations} from 'vuex'
import headTop from 'src/components/header/head'
import shopList from 'src/components/common/shoplist'
import {getImgPath} from 'src/components/common/mixin'
import {msiteAdress, foodCategory, foodDelivery, foodActivity} from 'src/service/getData'
import {msiteAddress, foodCategory, foodDelivery, foodActivity} from 'src/service/getData'
export default {
data(){
Expand Down Expand Up @@ -222,10 +222,10 @@ export default {
this.headTitle = this.$route.query.title;
this.foodTitle = this.headTitle;
this.restaurant_category_id = this.$route.query.restaurant_category_id;
//防止刷新页面时,vuex状态丢失,经度纬度需要重新获取,并存入vuex
//防止刷新页面时,vuex状态丢失,经度纬度需要重新获取,并存入vuex
if (!this.latitude) {
//获取位置信息
let res = await msiteAdress(this.geohash);
let res = await msiteAddress(this.geohash);
// 记录当前经度纬度进入vuex
this.RECORD_ADDRESS(res);
}
Expand Down Expand Up @@ -288,8 +288,14 @@ export default {
},
//点击某个排序方式,获取事件对象的data值,并根据获取的值重新获取数据渲染
sortList(event){
console.log(this.filterNum)
this.sortByType = event.target.getAttribute('data');
let node;
// 如果点击的是 span 中的文字,则需要获取到 span 的父标签 p
if (event.target.nodeName.toUpperCase() !== 'P') {
node = event.target.parentNode;
} else {
node = event.target;
}
this.sortByType = node.getAttribute('data');
this.sortBy = '';
},
//筛选选项中的配送方式选择
Expand Down Expand Up @@ -327,8 +333,9 @@ export default {
},
//只有点击清空按钮才清空数据,否则一直保持原有状态
clearSelect(){
this.support_ids.map(item => item.status = false);
this.filterNum = 0;
this.support_ids.map(item => item.status = false);
this.filterNum = 0;
this.delivery_mode = null;
},
//点击确认时,将需要筛选的id值传递给子组件,并且收回列表
confirmSelectFun(){
Expand Down Expand Up @@ -378,7 +385,7 @@ export default {
transition: all .3s;
fill:#666;
}
}
.choose_type{
.sort_item_container{
Expand Down
4 changes: 2 additions & 2 deletions src/page/login/login.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<input v-if="!showPassword" type="password" placeholder="密码" v-model="passWord">
<input v-else type="text" placeholder="密码" v-model="passWord">
<div class="button_switch" :class="{change_to_text: showPassword}">
<div class="circel_button" :class="{trans_to_right: showPassword}" @click="changePassWordType"></div>
<div class="circle_button" :class="{trans_to_right: showPassword}" @click="changePassWordType"></div>
<span>abc</span>
<span>...</span>
</div>
Expand Down Expand Up @@ -278,7 +278,7 @@
border: 1px;
border-radius: 0.5rem;
position: relative;
.circel_button{
.circle_button{
transition: all .3s;
position: absolute;
top: -0.2rem;
Expand Down
10 changes: 5 additions & 5 deletions src/page/msite/msite.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
</svg>
</router-link>
<router-link to="/home" slot="msite-title" class="msite_title">
<span class="title_text ellipsis">{{msietTitle}}</span>
<span class="title_text ellipsis">{{msiteTitle}}</span>
</router-link>
</head-top>
<nav class="msite_nav">
Expand Down Expand Up @@ -46,15 +46,15 @@ import {mapMutations} from 'vuex'
import headTop from 'src/components/header/head'
import footGuide from 'src/components/footer/footGuide'
import shopList from 'src/components/common/shoplist'
import {msiteAdress, msiteFoodTypes, cityGuess} from 'src/service/getData'
import {msiteAddress, msiteFoodTypes, cityGuess} from 'src/service/getData'
import 'src/plugins/swiper.min.js'
import 'src/style/swiper.min.css'
export default {
data(){
return {
geohash: '', // city页面传递过来的地址geohash
msietTitle: '请选择地址...', // msiet页面头部标题
msiteTitle: '请选择地址...', // msite页面头部标题
foodTypes: [], // 食品分类列表
hasGetData: false, //是否已经获取地理位置数据,成功之后再获取商铺列表信息
imgBaseUrl: 'https://fuss10.elemecdn.com', //图片域名地址
Expand All @@ -70,8 +70,8 @@ export default {
//保存geohash 到vuex
this.SAVE_GEOHASH(this.geohash);
//获取位置信息
let res = await msiteAdress(this.geohash);
this.msietTitle = res.name;
let res = await msiteAddress(this.geohash);
this.msiteTitle = res.name;
// 记录当前经度纬度
this.RECORD_ADDRESS(res);
Expand Down
4 changes: 2 additions & 2 deletions src/page/shop/shop.vue
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@

<script>
import {mapState, mapMutations} from 'vuex'
import {msiteAdress, shopDetails, foodMenu, getRatingList, ratingScores, ratingTags} from 'src/service/getData'
import {msiteAddress, shopDetails, foodMenu, getRatingList, ratingScores, ratingTags} from 'src/service/getData'
import loading from 'src/components/common/loading'
import buyCart from 'src/components/common/buyCart'
import ratingStar from 'src/components/common/ratingStar'
Expand Down Expand Up @@ -427,7 +427,7 @@
async initData(){
if (!this.latitude) {
//获取位置信息
let res = await msiteAdress(this.geohash);
let res = await msiteAddress(this.geohash);
// 记录当前经度纬度进入vuex
this.RECORD_ADDRESS(res);
}
Expand Down
2 changes: 1 addition & 1 deletion src/service/getData.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export const searchplace = (cityid, value) => fetch('/v1/pois', {
* 获取msite页面地址信息
*/

export const msiteAdress = geohash => fetch('/v2/pois/' + geohash);
export const msiteAddress = geohash => fetch('/v2/pois/' + geohash);


/**
Expand Down

0 comments on commit 5c91274

Please sign in to comment.