|
@@ -1,13 +1,12 @@
|
|
|
<template>
|
|
|
<view class="container">
|
|
|
<view class="utop"></view>
|
|
|
- <uni-nav-bar :fixed="true" class="unibar" title="Coffunity"
|
|
|
-
|
|
|
- left-icon="home" backgroundColor="white" :border="false" height="60px" @clickLeft="onHome"/>
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- <view class="loading" :style="{height:(windowHeight-statusBarHeight-50-height)+'px'}" v-if="isloading">
|
|
|
+ <uni-nav-bar :fixed="true" class="unibar" title="Coffunity" left-icon="home" backgroundColor="white"
|
|
|
+ :border="false" height="60px" @clickLeft="onHome" />
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ <view class="loading" :style="{height:(windowHeight-statusBarHeight-50-height)+'px'}" v-if="isloading">
|
|
|
<image src="https://business.coffunity.cn/upload/loading4.gif" style="width:20px;height:20px"></image>
|
|
|
</view>
|
|
|
<block v-else>
|
|
@@ -22,19 +21,19 @@
|
|
|
</view>
|
|
|
</block> -->
|
|
|
<!-- <block v-if="(teen_index==1 || teen_index==3) && (systemInfo.is_hall ==1 || systemInfo.is_ziti==1)"> -->
|
|
|
- <!-- <i class="iconfont icon-canyin icon-1" :style="{color:setColor}"></i> -->
|
|
|
- <navigator url="../../menber/shop" class="page-title text-nowarp store-title">
|
|
|
- {{storeInfo.title || ''}} <uni-icons type="right" size="3"></uni-icons>
|
|
|
- </navigator>
|
|
|
+ <!-- <i class="iconfont icon-canyin icon-1" :style="{color:setColor}"></i> -->
|
|
|
+ <navigator url="../../menber/shop" class="page-title text-nowarp store-title">
|
|
|
+ {{storeInfo.title || ''}} <uni-icons type="right" size="3"></uni-icons>
|
|
|
+ </navigator>
|
|
|
<!-- </block> -->
|
|
|
</view>
|
|
|
<view class="flex-grow-1 flex-y-center" style="justify-content: flex-end; align-items: center;">
|
|
|
-
|
|
|
- <view @click="onMyOrder" style="margin-right:10px;font-size:12px;font-weight:bold;">我的订单</view>
|
|
|
+
|
|
|
+ <view @click="onMyOrder" style="margin-right:10px;font-size:12px;font-weight:bold;">我的订单</view>
|
|
|
</view>
|
|
|
|
|
|
<!--is_ziti 自提 is_waimai 外卖 is_hall 堂食 -->
|
|
|
- <!-- <view class="por flex-grow-0"
|
|
|
+ <!-- <view class="por flex-grow-0"
|
|
|
v-if="(systemInfo.is_hall==1||systemInfo.is_ziti==1) && systemInfo.is_waimai==1">
|
|
|
<view class="item-off flex">
|
|
|
<view class="flex-grow-1 flex-center" @click="bindCheck" :data-index="item.teenIndex"
|
|
@@ -52,29 +51,28 @@
|
|
|
</view> -->
|
|
|
</view>
|
|
|
|
|
|
- <view :class="['main-block','flex','flex-nowarp','flex-x-between']"
|
|
|
- >
|
|
|
+ <view :class="['main-block','flex','flex-nowarp','flex-x-between']">
|
|
|
<scroll-view scroll-y class="left-bar" :scroll-into-view="menuScrollIntoView" scroll-with-animation>
|
|
|
<view v-for="(item,index) in goodsList" :id="`menu-${item.id}`" :key="index"
|
|
|
:class="['item',currentCateId == item.id?'active':'']" @click="handleMenuTap(index,item.id)">
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- <view class="name" >{{item.title}}</view>
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ <view class="name">{{item.title}}</view>
|
|
|
<view class="num" v-if="item.num>0">{{item.num}}</view>
|
|
|
<!-- <view class="rund" :style="[currentCateId == item.id?{'background-color':setColor}:'']"></view> -->
|
|
|
-
|
|
|
+
|
|
|
</view>
|
|
|
</scroll-view>
|
|
|
|
|
|
<view class="right-bar">
|
|
|
<!-- <view class="top flex flex-nowarp flex-x-between flex-y-center"> -->
|
|
|
- <!-- <view class="active-cat flex flex-nowarp flex-y-center text-nowarp">
|
|
|
+ <!-- <view class="active-cat flex flex-nowarp flex-y-center text-nowarp">
|
|
|
<text class="name">{{goodsList[catActive].title}}</text>
|
|
|
<text class="desc text-nowarp"
|
|
|
v-if="goodsList[catActive].desc">({{goodsList[catActive].desc}})</text>
|
|
|
</view> -->
|
|
|
- <!-- <navigator :url="`/pages/search/search?store_id=${store_id}&table_id=${table_id}`"
|
|
|
+ <!-- <navigator :url="`/pages/search/search?store_id=${store_id}&table_id=${table_id}`"
|
|
|
class="search-btn flex flex-x-center flex-y-center flex-nowarp">
|
|
|
<image src="../../static/icon_4.png" mode="aspectFit" class="icon-4"></image>
|
|
|
<view class="btn-name">搜索</view>
|
|
@@ -110,11 +108,10 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="flex flex-x-end flex-y-center">
|
|
|
- <view class="spec-btn"
|
|
|
- v-if="item2.is_gg == 2" @click="showSpec(item2.id)">
|
|
|
-
|
|
|
+ <view class="spec-btn" v-if="item2.is_gg == 2" @click="showSpec(item2.id)">
|
|
|
+
|
|
|
<!-- <view class="spec-num" v-if="item2.num>0">{{item2.num}}</view> -->
|
|
|
- <view class="circle" >选规格</view>
|
|
|
+ <view class="circle">选规格</view>
|
|
|
<view class="spec-num-gg" v-if="item2.num !== 0">{{item2.num}}</view>
|
|
|
</view>
|
|
|
|
|
@@ -153,7 +150,7 @@
|
|
|
|
|
|
<shopping-car v-on:catActive="bindCatActive" :carNum="carNum" :isDistance="is_distance"
|
|
|
:deliveryPrice="delivery_price" :carTotal="carTotal" :carGoods="carGoods" :userInfo="userInfo"
|
|
|
- :eat_people="choosepeoples" @choosebag="choosebag" :checked="pocket"/>
|
|
|
+ :eat_people="choosepeoples" @choosebag="choosebag" :checked="pocket" />
|
|
|
|
|
|
<view class="mask flex flex-column flex-nowarp flex-x-center flex-y-center" v-show="maskPop">
|
|
|
<!-- 详情弹窗 -->
|
|
@@ -224,9 +221,9 @@
|
|
|
|
|
|
<float-modal v-if="shopId" :shopId="shopId" @modalStatusBack="handleModalBack"></float-modal>
|
|
|
<!-- 2021041200077000000019093688 -->
|
|
|
- <page-btm-bar :active="3" />
|
|
|
+ <page-btm-bar :active="4" />
|
|
|
|
|
|
-<!-- <uni-popup ref="popup" type="center">
|
|
|
+ <!-- <uni-popup ref="popup" type="center">
|
|
|
<view class="shopping">
|
|
|
|
|
|
<form @submit="Shoppingbag">
|
|
@@ -321,8 +318,8 @@
|
|
|
shopId: '',
|
|
|
shoppingObj: {},
|
|
|
pocket: 1,
|
|
|
- is_checkeds:1,
|
|
|
- storeInfo:null,
|
|
|
+ is_checkeds: 1,
|
|
|
+ storeInfo: null,
|
|
|
}
|
|
|
},
|
|
|
|
|
@@ -391,10 +388,10 @@
|
|
|
if (val.store_id && val.userInfo.id) {
|
|
|
this.getIndexInfo();
|
|
|
this.setCopy();
|
|
|
- this.isovertime();
|
|
|
+ this.isovertime();
|
|
|
}
|
|
|
},
|
|
|
-
|
|
|
+
|
|
|
|
|
|
is_creatOrder(val) {
|
|
|
this.getCarList();
|
|
@@ -424,13 +421,13 @@
|
|
|
this.BarHeight();
|
|
|
uni.hideTabBar();
|
|
|
this.userInfo = uni.getStorageSync('userInfo');
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
if (this.systemInfo) {
|
|
|
this.shopId = this.systemInfo.shopid;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
if (this.store_id) {
|
|
|
this.getIndexInfo()
|
|
|
this.setCopy();
|
|
@@ -444,13 +441,14 @@
|
|
|
teenIndex: 2,
|
|
|
},
|
|
|
];
|
|
|
- }else{
|
|
|
- uni.navigateTo({
|
|
|
- url:'/shop/index/index'
|
|
|
- })
|
|
|
+ } else {
|
|
|
+ this.getStore()
|
|
|
+ // uni.navigateTo({
|
|
|
+ // url: '/shop/index/index'
|
|
|
+ // })
|
|
|
}
|
|
|
},
|
|
|
-
|
|
|
+
|
|
|
onHide() {
|
|
|
clearInterval(this._timer)
|
|
|
},
|
|
@@ -485,8 +483,8 @@
|
|
|
if (this.store_id && this.userInfo.id) {
|
|
|
this.teen_index == 1 ? this.isovertime() : ''; //距离上一次是否超时 是否选择人数
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
},
|
|
|
|
|
|
onPullDownRefresh() {
|
|
@@ -510,19 +508,43 @@
|
|
|
|
|
|
methods: {
|
|
|
...mapMutations(['SET_ADDRESS', 'SET_TEEN_INDEX']),
|
|
|
-
|
|
|
- onMyOrder(e){
|
|
|
+ getStore() {
|
|
|
+ let list = [{
|
|
|
+ address: "上海市黄浦区普安路189号曙光大厦20D",
|
|
|
+ height: 60,
|
|
|
+ iconPath: "/shop/static/images/storeIcon.png",
|
|
|
+ id: 3,
|
|
|
+ juli: 11.38,
|
|
|
+ latitude: "31.203889",
|
|
|
+ longitude: "121.437643",
|
|
|
+ store_id: 3,
|
|
|
+ thumb: "/uploads/admin/admin_thumb/20240402/3d53071f7a0fa63535ad25553e93cf11.png",
|
|
|
+ title: "2ndhome",
|
|
|
+ width: 50,
|
|
|
+ }];
|
|
|
+ let store_id = list[0].store_id;
|
|
|
+ this.$store.commit('SET_STORE_ID', store_id)
|
|
|
+ this.$store.commit('SET_TEEN_INDEX', 1) //重置默认
|
|
|
+ this.$store.commit('SET_TABLE_ID', "")
|
|
|
+ this.$store.commit('SET_CATE_ID', '')
|
|
|
+ this.$store.dispatch('getSystemStup', store_id);
|
|
|
+ this.$store.dispatch('getOpenid', store_id);
|
|
|
+ uni.switchTab({
|
|
|
+ url: "/pages/index/index"
|
|
|
+ })
|
|
|
+ },
|
|
|
+ onMyOrder(e) {
|
|
|
uni.navigateTo({
|
|
|
- url:"/pages/myOrderList/myOrderList"
|
|
|
+ url: "/pages/myOrderList/myOrderList"
|
|
|
})
|
|
|
},
|
|
|
handleModalBack(res) {
|
|
|
console.log(res, '-----123')
|
|
|
},
|
|
|
-
|
|
|
- onHome(e){
|
|
|
+
|
|
|
+ onHome(e) {
|
|
|
uni.switchTab({
|
|
|
- url:'/pages/home/home'
|
|
|
+ url: '/pages/home/home'
|
|
|
})
|
|
|
},
|
|
|
|
|
@@ -557,7 +579,7 @@
|
|
|
Socket() {
|
|
|
if (this.systemInfo.is_qian_many == 1) {
|
|
|
app.globalData.callback = (r) => {
|
|
|
- let res = JSON.parse(r.data);
|
|
|
+ let res = JSON.parse(r.data);
|
|
|
if (res.type == 'clear_list') {
|
|
|
if (this.goodsList.length > 0) {
|
|
|
this.carGoods = []
|
|
@@ -749,7 +771,7 @@
|
|
|
lat: this.address.lat || '',
|
|
|
lng: this.address.lng || '',
|
|
|
store_id: this.store_id,
|
|
|
- }, "", "", hideLoading).then(res => {
|
|
|
+ }, "", "", hideLoading).then(res => {
|
|
|
let distance = Number(res.data.distance);
|
|
|
if (distance) {
|
|
|
if (!distance) {
|
|
@@ -789,28 +811,28 @@
|
|
|
}).then(res => {
|
|
|
this.sizeCalcState = false;
|
|
|
let is_rebate = 2
|
|
|
-
|
|
|
- this.storeInfo=res.data;
|
|
|
+
|
|
|
+ this.storeInfo = res.data;
|
|
|
try {
|
|
|
is_rebate = res.data.set.is_rebate
|
|
|
} catch (err) {
|
|
|
console.log(err)
|
|
|
}
|
|
|
-
|
|
|
- console.log('res',res);
|
|
|
-
|
|
|
+
|
|
|
+ console.log('res', res);
|
|
|
+
|
|
|
if (is_rebate == 1) {
|
|
|
this.getCategoryList()
|
|
|
return false
|
|
|
- }
|
|
|
+ }
|
|
|
this.$http.request('xcx/index', {
|
|
|
store_id: this.store_id,
|
|
|
state: Number(this.teen_index),
|
|
|
}, "", "", hideLoading).then(res => {
|
|
|
uni.stopPullDownRefresh();
|
|
|
let list = res.data;
|
|
|
- this.goodsList = list;
|
|
|
-
|
|
|
+ this.goodsList = list;
|
|
|
+
|
|
|
// diy跳转分类
|
|
|
let cate_id = this.$store.state.cate_id;
|
|
|
if (cate_id) {
|
|
@@ -822,16 +844,16 @@
|
|
|
this.catActive = index; //选中分类
|
|
|
this.cateGoods = `cate-${obj.id}`
|
|
|
}
|
|
|
- }else{
|
|
|
- if(list.length>0){
|
|
|
- var obj=list[0];
|
|
|
+ } else {
|
|
|
+ if (list.length > 0) {
|
|
|
+ var obj = list[0];
|
|
|
this.currentCateId = obj.id; //选中分类id
|
|
|
this.currentCateDId = obj.id; //选中分类id
|
|
|
this.catActive = index; //选中分类
|
|
|
this.cateGoods = `cate-${obj.id}`
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
this.getCarList();
|
|
|
}).catch(err => {
|
|
|
uni.stopPullDownRefresh()
|
|
@@ -841,27 +863,27 @@
|
|
|
//获取购物车数据
|
|
|
getCarList() {
|
|
|
var url = 'xcx/cart_list',
|
|
|
- datas;
|
|
|
- console.log(this.systemInfo);
|
|
|
+ datas;
|
|
|
+ console.log(this.systemInfo);
|
|
|
if (this.systemInfo.is_qian_many == 1) {
|
|
|
return
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
datas = {
|
|
|
user_id: this.userInfo.id,
|
|
|
store_id: this.store_id,
|
|
|
}
|
|
|
if (this.userInfo.id && this.store_id) {
|
|
|
this.$http.request(url, datas, "", "", hideLoading).then(res => {
|
|
|
- if(res.data.list<=0){
|
|
|
+ if (res.data.list <= 0) {
|
|
|
this.pocket = 1
|
|
|
}
|
|
|
let arr = this.$utils.removal(res.data.list)
|
|
|
this.new_list = res.data.new_list;
|
|
|
this.computGoodsNum(arr, res.data.total_price, 0, res.data.new_list)
|
|
|
this.isloading = false
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
}).catch(err => {})
|
|
|
}
|
|
|
},
|
|
@@ -927,7 +949,7 @@
|
|
|
spec = '',
|
|
|
new_list = this.new_list,
|
|
|
carItem = false;
|
|
|
- carGoods = this.carGoods;
|
|
|
+ carGoods = this.carGoods;
|
|
|
pocket = idx === '' ? pocket : idx;
|
|
|
if (type == 2) {
|
|
|
for (let i of new_list) {
|
|
@@ -937,24 +959,24 @@
|
|
|
}
|
|
|
}
|
|
|
if (type == 1) {
|
|
|
- function getData(new_list,pocket,goods_id) {
|
|
|
- let as = false
|
|
|
+ function getData(new_list, pocket, goods_id) {
|
|
|
+ let as = false
|
|
|
for (let i of new_list) {
|
|
|
- for(let j of i.list){
|
|
|
+ for (let j of i.list) {
|
|
|
if (i.pocket == pocket && j.goods_id == goods_id) {
|
|
|
- as = true
|
|
|
+ as = true
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- return as
|
|
|
+ return as
|
|
|
}
|
|
|
// 判断当前选中的购物口袋是否选中并且还有产品
|
|
|
- let isAllStudentType = getData(new_list,pocket,goods_id)
|
|
|
+ let isAllStudentType = getData(new_list, pocket, goods_id)
|
|
|
if (isAllStudentType) {
|
|
|
for (let i of new_list) {
|
|
|
- if (i.pocket == pocket) {
|
|
|
- carGoods = i.list;
|
|
|
- }
|
|
|
+ if (i.pocket == pocket) {
|
|
|
+ carGoods = i.list;
|
|
|
+ }
|
|
|
}
|
|
|
} else {
|
|
|
for (let i of new_list) {
|
|
@@ -992,7 +1014,7 @@
|
|
|
spec = specArr.join(',')
|
|
|
money = this.goodsDetail.spec_price
|
|
|
// 调用 showSpec 方法
|
|
|
- this.showSpec(goods_id);
|
|
|
+ this.showSpec(goods_id);
|
|
|
}
|
|
|
} else if (data_from == 'goods') {
|
|
|
//无规格商品
|
|
@@ -1056,20 +1078,20 @@
|
|
|
})
|
|
|
} else {
|
|
|
this.$http.request('xcx/add_cart', datas, 'POST', false, true).then(res => {
|
|
|
-
|
|
|
+
|
|
|
if (res.data.list.length == 0 && data_from == 'car') {
|
|
|
- this.pocket = 1
|
|
|
+ this.pocket = 1
|
|
|
this.maskPop = false
|
|
|
this.carGoodsPop = false
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
let arr = this.$utils.removal(res.data.list)
|
|
|
this.new_list = res.data.new_list;
|
|
|
-
|
|
|
+
|
|
|
this.computGoodsNum(arr, res.data.total_price, num, res.data.new_list)
|
|
|
-
|
|
|
-
|
|
|
- }).catch(err => {})
|
|
|
+
|
|
|
+
|
|
|
+ }).catch(err => {})
|
|
|
}
|
|
|
},
|
|
|
|
|
@@ -1172,7 +1194,7 @@
|
|
|
this.detailPop = false
|
|
|
}).catch(err => {})
|
|
|
},
|
|
|
-
|
|
|
+
|
|
|
//选择规格
|
|
|
chooseSpec(index, specIndex) {
|
|
|
let spec = this.goodsDetail.edit_value[index].spec
|
|
@@ -1187,7 +1209,7 @@
|
|
|
this.goodsDetail.num = 0
|
|
|
this.computSpecPrice()
|
|
|
},
|
|
|
-
|
|
|
+
|
|
|
//计算规格价格
|
|
|
computSpecPrice() {
|
|
|
let edit_value = this.goodsDetail.edit_value
|
|
@@ -1412,4 +1434,4 @@
|
|
|
|
|
|
<style lang="scss">
|
|
|
@import url("./index.css");
|
|
|
-</style>
|
|
|
+</style>
|