Skip to content

Commit 714ae8e

Browse files
committed
updata shop
1 parent 9bde05f commit 714ae8e

15 files changed

Lines changed: 573 additions & 59 deletions

File tree

src/App.vue

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,23 @@
7272
<symbol viewBox="0 0 32 32" id="speed">
7373
<path fill="#37c7b7" d="M16 32c8.837 0 16-7.163 16-16S24.837 0 16 0 0 7.163 0 16s7.163 16 16 16zm0-2C8.268 30 2 23.732 2 16S8.268 2 16 2s14 6.268 14 14-6.268 14-14 14z"></path><path fill="#37c7b7" d="M15 7v11.002l5.678 4.882 1.304-1.517-5.33-4.583.348.758V6.999h-2z"></path>
7474
</symbol>
75+
<symbol viewBox="0 0 44 44" id="cart-minus">
76+
<path fill-rule="evenodd" d="M22 0C9.8 0 0 9.8 0 22s9.8 22 22 22 22-9.8 22-22S34.2 0 22 0zm0 42C11 42 2 33 2 22S11 2 22 2s20 9 20 20-9 20-20 20z" clip-rule="evenodd"></path>
77+
<path fill-rule="evenodd" d="M32 20c1.1 0 2 .9 2 2s-.9 2-2 2H12c-1.1 0-2-.9-2-2s.9-2 2-2h20z" clip-rule="evenodd"></path>
78+
</symbol>
79+
<symbol viewBox="0 0 44 44" id="cart-add">
80+
<path fill="none" d="M0 0h44v44H0z"></path>
81+
<path fill-rule="evenodd" d="M22 0C9.8 0 0 9.8 0 22s9.8 22 22 22 22-9.8 22-22S34.2 0 22 0zm10 24h-8v8c0 1.1-.9 2-2 2s-2-.9-2-2v-8h-8c-1.1 0-2-.9-2-2s.9-2 2-2h8v-8c0-1.1.9-2 2-2s2 .9 2 2v8h8c1.1 0 2 .9 2 2s-.9 2-2 2z" clip-rule="evenodd"></path>
82+
</symbol>
83+
<symbol viewBox="0 0 24 32" id="cart-remove">
84+
<path fill="#bbb" fill-rule="evenodd" d="M21.5 10h-19c-1.1 0-1.918.896-1.819 1.992l1.638 18.016C2.419 31.104 3.4 32 4.5 32h15c1.1 0 2.081-.896 2.182-1.992l1.637-18.016A1.798 1.798 0 0 0 21.5 10zM8 28H5L4 14h4v14zm6 0h-4V14h4v14zm5 0h-3V14h4l-1 14zm2-24h-2.941l-.353-2.514C17.592.669 16.823 0 15.998 0H8c-.825 0-1.593.668-1.708 1.486L5.94 4H3a3 3 0 0 0-3 3v1h24V7a3 3 0 0 0-3-3zM8.24 2h7.52l.279 2H7.96l.28-2z"></path>
85+
</symbol>
86+
<symbol viewBox="0 0 14 16" id="cart">
87+
<path fill="#FFF" fill-rule="evenodd" d="M12.364 2.998H2.088L1.816.687a.455.455 0 0 0-.478-.431L.431.303A.454.454 0 0 0 0 .78l1.256 10.893c.006.293.011 1.325.933 1.325h9.546a.455.455 0 0 0 .455-.454v-.881a.454.454 0 0 0-.455-.455H3.05l-.11-.937h8.606c.998 0 1.889-.724 1.989-1.616l.455-4.04c.1-.893-.628-1.617-1.626-1.617zm-.45 4.245c-.075.669-.317 1.212-1.066 1.212H2.727L2.3 4.812h8.821c.749 0 1.065.543.99 1.212l-.197 1.219zM2.416 15.79a1 1 0 1 0 0-2 1 1 0 0 0 0 2zm9.092 0a1 1 0 1 0 0-2 1 1 0 0 0 0 2z"></path>
88+
</symbol>
7589
</defs>
7690
</svg>
77-
<transition name="router-fade">
91+
<transition name="router-fade" mode="out-in">
7892
<router-view></router-view>
7993
</transition>
8094
</div>
@@ -91,7 +105,7 @@
91105
<style lang="scss">
92106
@import './style/common.scss';
93107
.router-fade-enter-active, .router-fade-leave-active {
94-
transition: opacity .6s;
108+
transition: opacity .4s;
95109
}
96110
.router-fade-enter, .router-fade-leave-active {
97111
opacity: 0;

src/components/common/mixin.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ export const loadMore = {
1313
let requestFram;
1414
let oldScrollTop;
1515

16+
document.addEventListener('scroll',() => {
17+
loadMore();
18+
},false)
1619
el.addEventListener('touchstart',() => {
1720
height = el.offsetHeight;
1821
setTop = el.offsetTop;

src/components/common/shoplist.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ export default {
129129
this.showLoading = false;
130130
}
131131
},
132-
watch:{
132+
watch: {
133133
//监听父级传来的restaurantCategoryIds,当值发生变化的时候重新获取餐馆数据,作用于排序和筛选
134134
restaurantCategoryIds: function (value){
135135
this.listenPropChange();

src/config/mUtils.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,9 @@ export const loadMore = (element, callback) => {
5454
let requestFram;
5555
let oldScrollTop;
5656

57+
element.addEventListener('scroll',() => {
58+
loadMore();
59+
}, false)
5760
//运动开始时获取元素 高度 和 offseTop, pading, margin
5861
element.addEventListener('touchstart',() => {
5962
height = element.offsetHeight;
@@ -62,7 +65,7 @@ export const loadMore = (element, callback) => {
6265
marginBottom = getStyle(element,'marginBottom');
6366
},{passive: true})
6467

65-
//运动过程中保持坚挺 scrollTop 的值判断是否到达底部
68+
//运动过程中保持监听 scrollTop 的值判断是否到达底部
6669
element.addEventListener('touchmove',() => {
6770
loadMore();
6871
},{passive: true})
@@ -102,6 +105,9 @@ export const showBack = callback => {
102105
let requestFram;
103106
let oldScrollTop;
104107

108+
document.addEventListener('scroll',() => {
109+
showBackFun();
110+
}, false)
105111
document.addEventListener('touchstart',() => {
106112
showBackFun();
107113
},{passive: true})

src/images/icon_point.png

158 Bytes
Loading

src/page/food/food.vue

Lines changed: 33 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -198,35 +198,8 @@ export default {
198198
confirmStatus: false, // 确认选择
199199
}
200200
},
201-
async created(){
202-
//获取从msite页面传递过来的参数
203-
this.geohash = this.$route.query.geohash;
204-
this.headTitle = this.$route.query.title;
205-
this.foodTitle = this.headTitle;
206-
this.restaurant_category_id = this.$route.query.restaurant_category_id;
207-
//防止刷新页面时,vuex状态丢失,经度纬度需要重新获取,并存入vuex
208-
if (!this.latitude) {
209-
//获取位置信息
210-
let res = await msiteAdress(this.geohash);
211-
// 记录当前经度纬度进入vuex
212-
this.RECORD_ADDRESS(res);
213-
}
214-
//获取category分类左侧数据
215-
this.category = await foodCategory(this.latitude, this.longitude);
216-
//初始化时定位当前category分类左侧默认选择项,在右侧展示出其sub_categories列表
217-
this.category.forEach(item => {
218-
if (this.restaurant_category_id == item.id) {
219-
this.categoryDetail = item.sub_categories;
220-
}
221-
});
222-
//获取筛选列表的配送方式
223-
this.Delivery = await foodDelivery(this.latitude, this.longitude);
224-
//获取筛选列表的商铺活动
225-
this.Activity = await foodActivity(this.latitude, this.longitude);
226-
//记录support_ids的状态,默认不选中,点击状态取反,status为true时为选中状态
227-
this.Activity.forEach((item, index) => {
228-
this.support_ids[index] = {status: false, id: item.id};
229-
})
201+
created(){
202+
this.initData();
230203
},
231204
mixins: [getImgPath],
232205
components: {
@@ -242,6 +215,37 @@ export default {
242215
...mapMutations([
243216
'RECORD_ADDRESS'
244217
]),
218+
//初始化获取数据
219+
async initData(){
220+
//获取从msite页面传递过来的参数
221+
this.geohash = this.$route.query.geohash;
222+
this.headTitle = this.$route.query.title;
223+
this.foodTitle = this.headTitle;
224+
this.restaurant_category_id = this.$route.query.restaurant_category_id;
225+
//防止刷新页面时,vuex状态丢失,经度纬度需要重新获取,并存入vuex
226+
if (!this.latitude) {
227+
//获取位置信息
228+
let res = await msiteAdress(this.geohash);
229+
// 记录当前经度纬度进入vuex
230+
this.RECORD_ADDRESS(res);
231+
}
232+
//获取category分类左侧数据
233+
this.category = await foodCategory(this.latitude, this.longitude);
234+
//初始化时定位当前category分类左侧默认选择项,在右侧展示出其sub_categories列表
235+
this.category.forEach(item => {
236+
if (this.restaurant_category_id == item.id) {
237+
this.categoryDetail = item.sub_categories;
238+
}
239+
});
240+
//获取筛选列表的配送方式
241+
this.Delivery = await foodDelivery(this.latitude, this.longitude);
242+
//获取筛选列表的商铺活动
243+
this.Activity = await foodActivity(this.latitude, this.longitude);
244+
//记录support_ids的状态,默认不选中,点击状态取反,status为true时为选中状态
245+
this.Activity.forEach((item, index) => {
246+
this.support_ids[index] = {status: false, id: item.id};
247+
})
248+
},
245249
// 点击顶部三个选项,展示不同的列表,选中当前选项进行展示,同时收回其他选项
246250
async chooseType(type){
247251
if (this.sortBy !== type) {

src/page/msite/msite.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ export default {
7979
}
8080
this.foodTypes = foodArr;
8181
}).then(() => {
82+
//初始化swiper
8283
new Swiper('.swiper-container', {
8384
pagination: '.swiper-pagination',
8485
loop: true

src/page/shop/children/rating.vue

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
<template>
2+
<div class="rating_page">
3+
<head-top head-title="评论" go-back='true'></head-top>
4+
</div>
5+
</template>
6+
7+
<script>
8+
import headTop from '../../../components/header/head'
9+
10+
export default {
11+
data(){
12+
return{
13+
14+
}
15+
},
16+
mounted(){
17+
18+
},
19+
components: {
20+
headTop,
21+
},
22+
props:[],
23+
}
24+
</script>
25+
26+
<style lang="scss" scoped>
27+
@import '../../../style/mixin.scss';
28+
29+
.rating_page{
30+
position: absolute;
31+
top: 0;
32+
left: 0;
33+
right: 0;
34+
bottom: 0;
35+
background-color: #fff;
36+
z-index: 18;
37+
}
38+
</style>

0 commit comments

Comments
 (0)