|
@@ -12,8 +12,9 @@
|
|
<view class="container">
|
|
<view class="container">
|
|
<u-tag plain :text="cList.openState ? '营业中' : '离线'" :type="cList.openState ? 'success' : 'error'"
|
|
<u-tag plain :text="cList.openState ? '营业中' : '离线'" :type="cList.openState ? 'success' : 'error'"
|
|
size="mini"></u-tag>
|
|
size="mini"></u-tag>
|
|
- <view @click="btnIc">
|
|
|
|
- <u-icon :label="cList.name" labelPos="left" size="16" name="arrow-down"></u-icon>
|
|
|
|
|
|
+ <view>
|
|
|
|
+ <text>{{cList.name}}</text>
|
|
|
|
+ <!-- <u-icon :label="cList.name" labelPos="left" size="16" name="arrow-down"></u-icon> -->
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<u-col span="3">
|
|
<u-col span="3">
|
|
@@ -43,6 +44,7 @@
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
|
|
+ <my-gap :height="10" />
|
|
<specPopup class='spec-box' ref="specPopup" :cardMsg="cardMsg" @update-shopmsg="handleUpdateShopMsg"
|
|
<specPopup class='spec-box' ref="specPopup" :cardMsg="cardMsg" @update-shopmsg="handleUpdateShopMsg"
|
|
@addShop="carListMeg">
|
|
@addShop="carListMeg">
|
|
</specPopup>
|
|
</specPopup>
|
|
@@ -56,8 +58,7 @@
|
|
<view class="balance dflex-c background-gradient" @click="toBuy">去结算</view>
|
|
<view class="balance dflex-c background-gradient" @click="toBuy">去结算</view>
|
|
</view>
|
|
</view>
|
|
<cartPopupVue ref="cartPopup" @selected-changed="handleSelectedChanged" />
|
|
<cartPopupVue ref="cartPopup" @selected-changed="handleSelectedChanged" />
|
|
- <u-modal ref="uModal" :show="modalShow" :title="modalTitle" :content="modalContent" :closeable="true"
|
|
|
|
- @close="modalClose" @confirm="confirm"></u-modal>
|
|
|
|
|
|
+
|
|
</view>
|
|
</view>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
@@ -80,56 +81,32 @@
|
|
iconPeople: iconPeople,
|
|
iconPeople: iconPeople,
|
|
shoppingCart: shoppingCart,
|
|
shoppingCart: shoppingCart,
|
|
tags: 1,
|
|
tags: 1,
|
|
- txts: 0,
|
|
|
|
- carList: [],
|
|
|
|
|
|
+ txts: 1,
|
|
|
|
+ carList: {},
|
|
goods: [],
|
|
goods: [],
|
|
total: 0,
|
|
total: 0,
|
|
cList: {},
|
|
cList: {},
|
|
cardMsg: {},
|
|
cardMsg: {},
|
|
selectedList: [],
|
|
selectedList: [],
|
|
- buyCount: 0,
|
|
|
|
- modalShow: false,
|
|
|
|
- modalTitle: '您还未登录',
|
|
|
|
- modalContent: '您是否确定要登录'
|
|
|
|
|
|
+ buyCount: 0
|
|
}
|
|
}
|
|
},
|
|
},
|
|
onLoad() {
|
|
onLoad() {
|
|
- const token = uni.getStorageSync('token')
|
|
|
|
- if (token) {
|
|
|
|
- const e = uni.getStorageSync('carl')
|
|
|
|
- this.cList = e
|
|
|
|
- this.fatchDate()
|
|
|
|
- this.carListMeg()
|
|
|
|
- this.tables()
|
|
|
|
- uni.$on('register_refresh', () => {
|
|
|
|
- this.fatchDate()
|
|
|
|
- this.carListMeg()
|
|
|
|
- this.tables()
|
|
|
|
- this.total = 0
|
|
|
|
- })
|
|
|
|
- } else {
|
|
|
|
- this.modalShow = true;
|
|
|
|
- }
|
|
|
|
|
|
+ const e = uni.getStorageSync('carl')
|
|
|
|
+ this.cList = e
|
|
|
|
+ this.fatchDate()
|
|
|
|
+ this.carListMeg()
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
- modalClose() {
|
|
|
|
- this.modalShow = false;
|
|
|
|
- },
|
|
|
|
- confirm() {
|
|
|
|
- //调用登录方法,autoLogin方法在mian.js中
|
|
|
|
- this.autoLogin()
|
|
|
|
- this.modalShow = false
|
|
|
|
- },
|
|
|
|
// 加购
|
|
// 加购
|
|
goCart(e) {
|
|
goCart(e) {
|
|
- // console.log('================', e)
|
|
|
|
this.cardMsg = e
|
|
this.cardMsg = e
|
|
this.$nextTick(() => {
|
|
this.$nextTick(() => {
|
|
this.$refs.specPopup.open();
|
|
this.$refs.specPopup.open();
|
|
});
|
|
});
|
|
},
|
|
},
|
|
handleSelectedChanged(selectedItems) {
|
|
handleSelectedChanged(selectedItems) {
|
|
- //console.log('选中的数据:', selectedItems)
|
|
|
|
|
|
+ console.log('选中的数据:', selectedItems)
|
|
this.carList = selectedItems
|
|
this.carList = selectedItems
|
|
this.carListMeg()
|
|
this.carListMeg()
|
|
this.totalPrice()
|
|
this.totalPrice()
|
|
@@ -157,6 +134,8 @@
|
|
|
|
|
|
// 将总价格转换回浮点数(以元为单位)
|
|
// 将总价格转换回浮点数(以元为单位)
|
|
this.total = (total / 100).toFixed(2);
|
|
this.total = (total / 100).toFixed(2);
|
|
|
|
+
|
|
|
|
+ console.log('total', this.total);
|
|
},
|
|
},
|
|
showCart() {
|
|
showCart() {
|
|
this.$nextTick(() => {
|
|
this.$nextTick(() => {
|
|
@@ -169,47 +148,31 @@
|
|
})
|
|
})
|
|
},
|
|
},
|
|
toDetial(e) {
|
|
toDetial(e) {
|
|
- // console.log('eeeeee====================', e)
|
|
|
|
|
|
+ console.log('eeeeee====================', e)
|
|
const data = {
|
|
const data = {
|
|
spuId: e.spuId,
|
|
spuId: e.spuId,
|
|
tobyC: this.buyCount
|
|
tobyC: this.buyCount
|
|
}
|
|
}
|
|
uni.navigateTo({
|
|
uni.navigateTo({
|
|
- url: `/pages/goodDetail/goodDetail?data=${encodeURIComponent(JSON.stringify(data))}`
|
|
|
|
|
|
+ url: `/pages/goodDetail/goodDetail?data=${encodeURIComponent(JSON.stringify(data))}`
|
|
})
|
|
})
|
|
},
|
|
},
|
|
toBuy() {
|
|
toBuy() {
|
|
- // console.log('e========carList', this.carList)
|
|
|
|
- const carlist = {
|
|
|
|
- carlist: this.carList,
|
|
|
|
- total: this.total
|
|
|
|
- }
|
|
|
|
- if (carlist.carlist.length <= 0) {
|
|
|
|
- // this.$refs.uNotify.show({'请选择'})
|
|
|
|
- uni.showToast({
|
|
|
|
- title: '请选择',
|
|
|
|
- icon: 'error',
|
|
|
|
- duration: 2000
|
|
|
|
- });
|
|
|
|
- } else {
|
|
|
|
- uni.navigateTo({
|
|
|
|
- url: `/pages/order/submitOrder/submitOrder?data=${encodeURIComponent(JSON.stringify(carlist))}`
|
|
|
|
- })
|
|
|
|
- this.$nextTick(() => {
|
|
|
|
- this.$refs.cartPopup.setShow(false)
|
|
|
|
- this.total = 0
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
|
|
+ console.log('e========carList', this.carList)
|
|
|
|
+ // uni.navigateTo({
|
|
|
|
+ // url: `/pages/order/submitOrder/submitOrder`
|
|
|
|
+ // })
|
|
},
|
|
},
|
|
onOrder() {
|
|
onOrder() {
|
|
uni.navigateTo({
|
|
uni.navigateTo({
|
|
- url: `/pages/order/myOrder/myOrder?type=0`
|
|
|
|
|
|
+ url: `/pages/order/myOrder/myOrder`
|
|
})
|
|
})
|
|
},
|
|
},
|
|
onMyInfo() {
|
|
onMyInfo() {
|
|
const info = {
|
|
const info = {
|
|
customerPhone: this.cList.customerPhone
|
|
customerPhone: this.cList.customerPhone
|
|
}
|
|
}
|
|
|
|
+ console.log('======================', info)
|
|
uni.setStorageSync("info", info)
|
|
uni.setStorageSync("info", info)
|
|
uni.navigateTo({
|
|
uni.navigateTo({
|
|
url: `/pages/user/user`
|
|
url: `/pages/user/user`
|
|
@@ -220,16 +183,16 @@
|
|
var queryParmas = {
|
|
var queryParmas = {
|
|
id: this.cList.id
|
|
id: this.cList.id
|
|
}
|
|
}
|
|
- // console.log('idididididid', queryParmas)
|
|
|
|
|
|
+ console.log('idididididid', queryParmas)
|
|
const result = await this.$request('post', '/sale/diningCarProduct/queryDiningCarProduct', queryParmas,
|
|
const result = await this.$request('post', '/sale/diningCarProduct/queryDiningCarProduct', queryParmas,
|
|
true)
|
|
true)
|
|
if (result) {
|
|
if (result) {
|
|
- // this.goods = result.rows
|
|
|
|
const queIds = new Set(result.rows.map(item => item.spuId));
|
|
const queIds = new Set(result.rows.map(item => item.spuId));
|
|
const spuIds = Array.from(queIds).join(',');
|
|
const spuIds = Array.from(queIds).join(',');
|
|
const res = await this.$request('get', `/item/spu/queryByIds?spuIds=${spuIds}`)
|
|
const res = await this.$request('get', `/item/spu/queryByIds?spuIds=${spuIds}`)
|
|
const data = res.data
|
|
const data = res.data
|
|
this.goods = data.filter(item => item.status !== 1)
|
|
this.goods = data.filter(item => item.status !== 1)
|
|
|
|
+ console.log('res', res.data)
|
|
}
|
|
}
|
|
},
|
|
},
|
|
async carListMeg() {
|
|
async carListMeg() {
|
|
@@ -240,16 +203,6 @@
|
|
const carList = res.data
|
|
const carList = res.data
|
|
this.buyCount = carList.length
|
|
this.buyCount = carList.length
|
|
}
|
|
}
|
|
- },
|
|
|
|
- async tables() {
|
|
|
|
- const params = {
|
|
|
|
- storeId: this.cList.id
|
|
|
|
- }
|
|
|
|
- const res = await this.$request('get', '/order/tradeOrder/queryTradeOrder', params)
|
|
|
|
- if (res) {
|
|
|
|
- console.log('result', res.rows)
|
|
|
|
- this.txts = res.rows.length
|
|
|
|
- }
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|