|
|
@ -1,19 +1,17 @@ |
|
|
|
<template> |
|
|
|
<template> |
|
|
|
<view class="content"> |
|
|
|
<view class="content"> |
|
|
|
<!-- <view class="width100 height85 backcorfff heads"> |
|
|
|
<view class="width100" v-if="flist ==''"> |
|
|
|
<view class="paddtop10 width90 alijusstart"> |
|
|
|
<view class="width100 height40 font14 padleft15 alijusstart" |
|
|
|
<view class="width80p font16 fcor333 fontwig6"> |
|
|
|
style="background-color: #e7f2ea;color: #4e8a5c;"> |
|
|
|
<image mode="widthFix" class="icon15 marRight10" src="../static/imgs/shop.png"></image>时代天街 |
|
|
|
<image class="icon20 paddtright5" mode="widthFix" src="../static/imgs/horn.png"></image> |
|
|
|
</view> |
|
|
|
营业时间{{starttime}}至{{endtime}}. |
|
|
|
<view class="width20 fotrt"> |
|
|
|
|
|
|
|
<image mode="widthFix" class="icon20" src="../static/imgs/nocollection.png"></image> |
|
|
|
|
|
|
|
<image mode="widthFix" class="icon20" src="../static/imgs/collection.png"></image> |
|
|
|
|
|
|
|
</view> |
|
|
|
|
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="width90 mart5 font12 fcor999">前门西大街正阳市场1号楼中部</view> |
|
|
|
<view v-if="flist == '' " class="width100 mart60 fotct font14 fcor666"> |
|
|
|
</view> --> |
|
|
|
<image mode="widthFix" style="width: 70vw;" :src="imagewxUrl+imgadres"></image> |
|
|
|
|
|
|
|
</view> |
|
|
|
|
|
|
|
</view> |
|
|
|
|
|
|
|
|
|
|
|
<scroll-view scroll-y class="left-aside"> |
|
|
|
<scroll-view scroll-y class="left-aside" v-if="flist !=''"> |
|
|
|
<view v-for="(item,index) in flist" :key="index" class="f-item" :class="{active: item.name == currentId}" |
|
|
|
<view v-for="(item,index) in flist" :key="index" class="f-item" :class="{active: item.name == currentId}" |
|
|
|
@click="tabtap(item)"> |
|
|
|
@click="tabtap(item)"> |
|
|
|
<view class="width100 fotct"> |
|
|
|
<view class="width100 fotct"> |
|
|
@ -26,8 +24,8 @@ |
|
|
|
</scroll-view> |
|
|
|
</scroll-view> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<scroll-view scroll-with-animation scroll-y class="right-aside" @scroll="asideScroll" |
|
|
|
<scroll-view scroll-with-animation scroll-y class="right-aside" @scroll="asideScroll" :scroll-top="tabScrollTop" |
|
|
|
:scroll-top="tabScrollTop"> |
|
|
|
v-if="flist !='' "> |
|
|
|
<view v-for="(item,index) in slist" :key="index" :id="'main-'+item.kfcId"> |
|
|
|
<view v-for="(item,index) in slist" :key="index" :id="'main-'+item.kfcId"> |
|
|
|
<view class="s-item width90"> |
|
|
|
<view class="s-item width90"> |
|
|
|
<text class="promotion_mixg1 backcor99" style="margin-right: -3px;"></text> |
|
|
|
<text class="promotion_mixg1 backcor99" style="margin-right: -3px;"></text> |
|
|
@ -36,7 +34,7 @@ |
|
|
|
{{item.name}} |
|
|
|
{{item.name}} |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view v-if="titem.cateName == item.name" class="t-list mart10 paddbotm10" v-for="(titem,index) in tlist" |
|
|
|
<view v-if="titem.cateName == item.name" class="t-list mart10 paddbotm10" v-for="(titem,index) in tlist" |
|
|
|
:key="index" @click="showPopups(titem)"> |
|
|
|
:key="index"> |
|
|
|
<view class="paddtop10 width94 font16 fcor333 fotrt fontwig6 text2"> |
|
|
|
<view class="paddtop10 width94 font16 fcor333 fotrt fontwig6 text2"> |
|
|
|
{{titem.productName}} |
|
|
|
{{titem.productName}} |
|
|
|
</view> |
|
|
|
</view> |
|
|
@ -59,10 +57,22 @@ |
|
|
|
v-if="titem.originalPrice == titem.salePrice" style="text-decoration: line-through;"> |
|
|
|
v-if="titem.originalPrice == titem.salePrice" style="text-decoration: line-through;"> |
|
|
|
|
|
|
|
|
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="mart10 icon-click fotrt"> |
|
|
|
<view class="mart10 icon-click fotrt alijusend" v-if="titem.productId"> |
|
|
|
<!-- <image class="btn-reduce" mode="widthFix" src="../static/imgs/reduce.png"></image> --> |
|
|
|
<image class="btn-reduce" mode="widthFix" src="../static/imgs/reduce.png" |
|
|
|
<!-- <view class="num fcorfff" style="background: #d90209;">1</view> --> |
|
|
|
v-if="titem.count > 0" @click="deletenums(titem)"></image> |
|
|
|
<image class="btn-plus" mode="widthFix" src="../static/imgs/plus.png"></image> |
|
|
|
<view class="num fcorfff" style="background: #d90209;" v-if="titem.count > 0"> |
|
|
|
|
|
|
|
{{titem.count}} |
|
|
|
|
|
|
|
</view> |
|
|
|
|
|
|
|
<image class="btn-plus" mode="widthFix" src="../static/imgs/plus.png" |
|
|
|
|
|
|
|
@click="showPopups(titem)"></image> |
|
|
|
|
|
|
|
</view> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<view class="mart10 icon-click fotrt alijusend" v-else> |
|
|
|
|
|
|
|
<view class="num fcorfff font14" style="background: #d90209;" @click="showPopups(titem)"> |
|
|
|
|
|
|
|
选规格 |
|
|
|
|
|
|
|
</view> |
|
|
|
|
|
|
|
<view class="unibadge" v-if="titem.count > 0"> |
|
|
|
|
|
|
|
{{titem.count}}</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
|
|
|
|
|
|
|
|
</view> |
|
|
|
</view> |
|
|
@ -72,12 +82,13 @@ |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</scroll-view> |
|
|
|
</scroll-view> |
|
|
|
|
|
|
|
|
|
|
|
<shopcart :goods="shoppingcart" @add="addCart" @dec="decreaseCart" @input="inputCart" @delAll="delAll"> |
|
|
|
<shopcart v-if="flist !='' " :goods="shoppingcart" @add="addCart" @dec="decreaseCart" |
|
|
|
|
|
|
|
@delAll="delAll"> |
|
|
|
</shopcart> |
|
|
|
</shopcart> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- 弹窗选择规格 --> |
|
|
|
<!-- 弹窗选择规格 --> |
|
|
|
<wybPopup ref="popup" type="bottom" width="500" height="700" scrollY="true" radius="6" :showCloseIcon="true"> |
|
|
|
<wybPopup ref="popup" type="bottom" width="500" height="700" scrollY="true" radius="6" :showCloseIcon="true"> |
|
|
|
<image mode="widthFix" class="width40w mart40" :src="kfcimgs"></image> |
|
|
|
<image mode="widthFix" class="width40w mart40" :src="kfcimgs"></image> |
|
|
|
<view class="width100 line1 mart10"></view> |
|
|
|
<view class="width100 line1 mart10"></view> |
|
|
|
<view class="mart20 width90 font18 fontwig6 fcor333">{{kfcname}}</view> |
|
|
|
<view class="mart20 width90 font18 fontwig6 fcor333">{{kfcname}}</view> |
|
|
@ -139,11 +150,17 @@ |
|
|
|
kfcname: '', // 名字 |
|
|
|
kfcname: '', // 名字 |
|
|
|
kfcimgs: '', //图片 |
|
|
|
kfcimgs: '', //图片 |
|
|
|
kfcprice: '', //价格 |
|
|
|
kfcprice: '', //价格 |
|
|
|
kfcoldprice: '' //原价 |
|
|
|
kfcoldprice: '', //原价 |
|
|
|
|
|
|
|
starttime: '', //开始时间 |
|
|
|
|
|
|
|
endtime: '', //结束时间 |
|
|
|
|
|
|
|
imagewxUrl: app.globalData.imageWxImg, |
|
|
|
|
|
|
|
imgadres: 'storeClose.png', |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
onLoad(options) { |
|
|
|
onLoad(options) { |
|
|
|
this.storeCode = options.storeCode; |
|
|
|
this.storeCode = options.storeCode; |
|
|
|
|
|
|
|
this.starttime = options.sttime; |
|
|
|
|
|
|
|
this.endtime = options.entime; |
|
|
|
this.listByStoreCode(); |
|
|
|
this.listByStoreCode(); |
|
|
|
}, |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
methods: { |
|
|
@ -232,6 +249,21 @@ |
|
|
|
addCart: function(item) { |
|
|
|
addCart: function(item) { |
|
|
|
if (item.num >= 0) { |
|
|
|
if (item.num >= 0) { |
|
|
|
item.num++ |
|
|
|
item.num++ |
|
|
|
|
|
|
|
for (var i = 0; i < this.tlist.length; i++) { |
|
|
|
|
|
|
|
if (this.tlist[i].productId && item.productId == this.tlist[i].productId) { |
|
|
|
|
|
|
|
this.tlist[i].count = item.num; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!this.tlist[i].productId) { |
|
|
|
|
|
|
|
for (var k = 0; k < this.tlist[i].specGroups.length; k++) { |
|
|
|
|
|
|
|
if (item.productId == this.tlist[i].specGroups[k].productId) { |
|
|
|
|
|
|
|
this.tlist[i].count = item.num |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
this.shoppingcart.forEach((good) => { |
|
|
|
this.shoppingcart.forEach((good) => { |
|
|
|
if (item.name == good.name) |
|
|
|
if (item.name == good.name) |
|
|
|
good.num = item.num |
|
|
|
good.num = item.num |
|
|
@ -248,27 +280,25 @@ |
|
|
|
decreaseCart(item) { |
|
|
|
decreaseCart(item) { |
|
|
|
if (item.num) { |
|
|
|
if (item.num) { |
|
|
|
item.num-- |
|
|
|
item.num-- |
|
|
|
this.shoppingcart.forEach((good) => { |
|
|
|
for (var i = 0; i < this.tlist.length; i++) { |
|
|
|
if (item.name == good.name) |
|
|
|
if (this.tlist[i].productId && item.productId == this.tlist[i].productId) { |
|
|
|
good.num = item.num |
|
|
|
this.tlist[i].count = this.tlist[i].count - 1; |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
inputCart: function(item) { |
|
|
|
|
|
|
|
if (item.num >= 0) { |
|
|
|
|
|
|
|
item.num++ |
|
|
|
|
|
|
|
this.shoppingcart.forEach((good) => { |
|
|
|
|
|
|
|
if (item.name == good.name) |
|
|
|
|
|
|
|
good.num = item.num + -1 |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
if (!this.tlist[i].productId) { |
|
|
|
|
|
|
|
for (var k = 0; k < this.tlist[i].specGroups.length; k++) { |
|
|
|
|
|
|
|
if (item.productId == this.tlist[i].specGroups[k].productId) { |
|
|
|
|
|
|
|
this.tlist[i].count = this.tlist[i].count - 1; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
this.shoppingcart.forEach((good) => { |
|
|
|
this.shoppingcart.forEach((good) => { |
|
|
|
if (item.name == good.name) |
|
|
|
if (item.name == good.name) |
|
|
|
Vue.set(good, 'count', 1) |
|
|
|
good.num = item.num |
|
|
|
}) |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
// 清空购物车 |
|
|
|
// 清空购物车 |
|
|
|
delAll() { |
|
|
|
delAll() { |
|
|
@ -277,8 +307,29 @@ |
|
|
|
good.num = 0 |
|
|
|
good.num = 0 |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (var i = 0; i < this.tlist.length; i++) { |
|
|
|
|
|
|
|
this.tlist[i].count = 0; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
this.shoppingcart = []; |
|
|
|
app.globalData.qianzhulist = ''; |
|
|
|
app.globalData.qianzhulist = ''; |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//商品减 |
|
|
|
|
|
|
|
deletenums(item) { |
|
|
|
|
|
|
|
if (item.count) { |
|
|
|
|
|
|
|
item.count-- |
|
|
|
|
|
|
|
for (var i = 0; i < this.tlist.length; i++) { |
|
|
|
|
|
|
|
if (this.tlist[i].productId && item.productId == this.tlist[i].productId) { |
|
|
|
|
|
|
|
this.tlist[i].count = item.count; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
this.shoppingcart.forEach((good) => { |
|
|
|
|
|
|
|
if (item.productName == good.name) |
|
|
|
|
|
|
|
good.num = item.count |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
//弹出弹窗 |
|
|
|
//弹出弹窗 |
|
|
|
showPopups(item) { |
|
|
|
showPopups(item) { |
|
|
|
let that = this; |
|
|
|
let that = this; |
|
|
@ -335,7 +386,13 @@ |
|
|
|
}, 1000); |
|
|
|
}, 1000); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}else{ |
|
|
|
|
|
|
|
|
|
|
|
for (var i = 0; i < that.tlist.length; i++) { |
|
|
|
|
|
|
|
if (that.tlist[i].productId && item.productId == that.tlist[i].productId) { |
|
|
|
|
|
|
|
that.tlist[i].count = that.tlist[i].count + 1 |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} else { |
|
|
|
that.kdjchangelist = item.specGroups; |
|
|
|
that.kdjchangelist = item.specGroups; |
|
|
|
that.kfcimgs = item.specGroups[0].productImageUrl; |
|
|
|
that.kfcimgs = item.specGroups[0].productImageUrl; |
|
|
|
that.productId = item.specGroups[0].productId; |
|
|
|
that.productId = item.specGroups[0].productId; |
|
|
@ -346,6 +403,7 @@ |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
//选择类型 |
|
|
|
//选择类型 |
|
|
|
changetype(item) { |
|
|
|
changetype(item) { |
|
|
|
this.productId = item.productId; |
|
|
|
this.productId = item.productId; |
|
|
@ -368,6 +426,16 @@ |
|
|
|
"oldprice": this.kfcoldprice |
|
|
|
"oldprice": this.kfcoldprice |
|
|
|
} |
|
|
|
} |
|
|
|
this.shoppingcart.push(datas); |
|
|
|
this.shoppingcart.push(datas); |
|
|
|
|
|
|
|
for (var i = 0; i < this.tlist.length; i++) { |
|
|
|
|
|
|
|
if (!this.tlist[i].productId) { |
|
|
|
|
|
|
|
for (var k = 0; k < this.tlist[i].specGroups.length; k++) { |
|
|
|
|
|
|
|
if (this.productId == this.tlist[i].specGroups[k].productId) { |
|
|
|
|
|
|
|
this.tlist[i].count = this.tlist[i].count + this.nums |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
this.$refs.popup.hide(); |
|
|
|
this.$refs.popup.hide(); |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
@ -376,6 +444,16 @@ |
|
|
|
if (this.shoppingcart[i].name == this.kfcname) { |
|
|
|
if (this.shoppingcart[i].name == this.kfcname) { |
|
|
|
indexs = 0; |
|
|
|
indexs = 0; |
|
|
|
this.shoppingcart[i].num = this.shoppingcart[i].num + this.nums; |
|
|
|
this.shoppingcart[i].num = this.shoppingcart[i].num + this.nums; |
|
|
|
|
|
|
|
for (var i = 0; i < this.tlist.length; i++) { |
|
|
|
|
|
|
|
if (!this.tlist[i].productId) { |
|
|
|
|
|
|
|
for (var k = 0; k < this.tlist[i].specGroups.length; k++) { |
|
|
|
|
|
|
|
if (this.productId == this.tlist[i].specGroups[k].productId) { |
|
|
|
|
|
|
|
this.tlist[i].count = this.tlist[i].count + this.nums |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
if (indexs != 0) { |
|
|
|
if (indexs != 0) { |
|
|
@ -389,6 +467,16 @@ |
|
|
|
"oldprice": this.kfcoldprice |
|
|
|
"oldprice": this.kfcoldprice |
|
|
|
} |
|
|
|
} |
|
|
|
this.shoppingcart.push(datas); |
|
|
|
this.shoppingcart.push(datas); |
|
|
|
|
|
|
|
for (var i = 0; i < this.tlist.length; i++) { |
|
|
|
|
|
|
|
if (!this.tlist[i].productId) { |
|
|
|
|
|
|
|
for (var k = 0; k < this.tlist[i].specGroups.length; k++) { |
|
|
|
|
|
|
|
if (this.productId == this.tlist[i].specGroups[k].productId) { |
|
|
|
|
|
|
|
this.tlist[i].count = this.tlist[i].count + this.nums |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
this.$refs.popup.hide(); |
|
|
|
this.$refs.popup.hide(); |
|
|
|
}, |
|
|
|
}, |
|
|
@ -509,6 +597,7 @@ |
|
|
|
border-radius: 15px; |
|
|
|
border-radius: 15px; |
|
|
|
background: #fff; |
|
|
|
background: #fff; |
|
|
|
min-height: 150px; |
|
|
|
min-height: 150px; |
|
|
|
|
|
|
|
|
|
|
|
&:after { |
|
|
|
&:after { |
|
|
|
content: ''; |
|
|
|
content: ''; |
|
|
|
flex: 99; |
|
|
|
flex: 99; |
|
|
@ -578,4 +667,18 @@ |
|
|
|
position: fixed; |
|
|
|
position: fixed; |
|
|
|
bottom: 0px; |
|
|
|
bottom: 0px; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.unibadge { |
|
|
|
|
|
|
|
background: #000; |
|
|
|
|
|
|
|
width: 20px; |
|
|
|
|
|
|
|
height: 20px; |
|
|
|
|
|
|
|
border-radius: 50%; |
|
|
|
|
|
|
|
font-size: 9px; |
|
|
|
|
|
|
|
color: #fff; |
|
|
|
|
|
|
|
line-height: 20px; |
|
|
|
|
|
|
|
text-align: center; |
|
|
|
|
|
|
|
position: absolute; |
|
|
|
|
|
|
|
margin-top: -25px; |
|
|
|
|
|
|
|
margin-right: -5px; |
|
|
|
|
|
|
|
} |
|
|
|
</style> |
|
|
|
</style> |
|
|
|