Compare commits

..

No commits in common. "b40921054625e39aca23e964f0df1f76a98d6769" and "2e4184429a4187d6d69201ce49acc6ef5ad4a7fb" have entirely different histories.

6 changed files with 22 additions and 83 deletions

View File

@ -42,7 +42,7 @@
{ {
"path": "pages/shop/pay", "path": "pages/shop/pay",
"style": { "style": {
"navigationStyle": "custom" "navigationBarTitleText": "收银台"
} }
}, },
{ {
@ -53,14 +53,9 @@
}, },
{ {
"path" : "pages/main/login", "path" : "pages/main/login",
"style": { "style" :
"navigationStyle": "custom" {
} "navigationBarTitleText" : ""
},
{
"path" : "pages/main/order",
"style": {
"navigationStyle": "custom"
} }
} }
], ],

View File

@ -1,27 +0,0 @@
<template>
<view>
<!-- topbar -->
<u-navbar title="订单查询" bgColor="#d43030" :titleStyle="{ color: '#FFF'}" :autoBack="true" placeholder>
<view class="u-nav-slot" slot="left">
<u-icon name="arrow-left" color="#fff" size="19"></u-icon>
</view>
</u-navbar>
</view>
</template>
<script>
export default {
data() {
return {
}
},
methods: {
}
}
</script>
<style>
</style>

View File

@ -72,11 +72,10 @@
<view v-else class="bg-m rad16 flex" style="height: 108rpx;"> <view v-else class="bg-m rad16 flex" style="height: 108rpx;">
<view class="flex md p-b-12"> <view class="flex md p-b-12">
<u--image src="/static/icons/planeBox-100.svg" width="136rpx" height="136rpx" <u--image src="/static/icons/planeBox-100.svg" width="136rpx" height="136rpx"
@click="$store.commit('setCartShow',!$store.state.cartShow)" /> @click="$store.state.cartShow = !$store.state.cartShow" />
</view> </view>
<view class="fci fz36 flex1 flex msb"> <view class="fci fz36 flex1 flex msb">
<view class="flex1 p-l-12 flex column mc" <view class="flex1 p-l-12 flex column mc" @click="$store.state.cartShow = !$store.state.cartShow">
@click="$store.commit('setCartShow',!$store.state.cartShow)">
<view class="fz36 fb">¥{{total | formatPrice}}</view> <view class="fz36 fb">¥{{total | formatPrice}}</view>
<view class="fz24" v-if="minimumOrderDifference>0">还差¥{{minimumOrderDifference | formatPrice}}起送 <view class="fz24" v-if="minimumOrderDifference>0">还差¥{{minimumOrderDifference | formatPrice}}起送
</view> </view>
@ -187,13 +186,13 @@
// resnull // resnull
if (!res) { if (!res) {
setTimeout(() => { setTimeout(() => {
this.getElRect(elClass) this.getElRect(elClass);
}, 10) }, 10)
return return
} }
this[dataVal] = res.height this[dataVal] = res.height;
resolve() resolve()
}).exec() }).exec();
}) })
}, },
// //
@ -263,22 +262,21 @@
// height2 // height2
if (!height2 || scrollHeight >= height1 && scrollHeight < height2) { if (!height2 || scrollHeight >= height1 && scrollHeight < height2) {
this.leftMenuStatus(i) this.leftMenuStatus(i)
return return;
} }
} }
}, 10) }, 10)
}, },
//"" //""
handleSeled() { handleSeled() {
const regex = /^(\+?\d{1,4}[\s-]?)?\d{3}\*{4}\d{4}$/ if (!this.$store.state.userInfo.tel) { //
if (regex.test(this.$store.state.userInfo.tel)) { // uni.navigateTo({
uni.navigateTo({ //
url: '/pages/shop/order'
})
} else { //
uni.navigateTo({ //
url: '/pages/main/getTel' url: '/pages/main/getTel'
}) })
} else { //
uni.navigateTo({
url: '/pages/shop/order'
})
} }
} }
}, },

View File

@ -44,8 +44,8 @@
<text class="fz24">合计</text> <text class="fz24">合计</text>
<text class="fz44">¥{{total | formatPrice}}</text> <text class="fz44">¥{{total | formatPrice}}</text>
</view> </view>
<view class="fz32 flex column mac mc fci rad16 m-r-24" style="width:220rpx;height:100rpx;" <view class="fz32 bg-m flex column mac mc fci rad16 m-r-24" style="width:220rpx;height:100rpx;"
@click="handleCheckout" :class="isPressed?'bg-g':'bg-m'"> @click="handleCheckout">
<view>提交订单</view> <view>提交订单</view>
<view>Checkout</view> <view>Checkout</view>
</view> </view>
@ -64,7 +64,6 @@
export default { export default {
data() { data() {
return { return {
isPressed: false, //
remark: '' // remark: '' //
} }
}, },
@ -91,10 +90,6 @@
totalPrice, totalPrice,
// //
handleCheckout() { handleCheckout() {
if (this.isPressed) {//
return
}
this.isPressed = true
// //
uni.$u.http.post('/Api/Check/checkout', { uni.$u.http.post('/Api/Check/checkout', {
cartList: JSON.stringify(this.cartList), // cartList: JSON.stringify(this.cartList), //
@ -110,11 +105,9 @@
}).then(res => { }).then(res => {
// //
if (res.data.status === 1) { if (res.data.status === 1) {
// const order_sn = res.data.order_sn;
this.$store.commit('clearCartList')
//
uni.navigateTo({ uni.navigateTo({
url: `/pages/shop/pay?order_sn=${res.data.order_sn}` url: `/pages/shop/pay?order_sn=${order_sn}`
}); });
} else if (res.data.status === -1) { } else if (res.data.status === -1) {
uni.removeStorage({ // uni.removeStorage({ //
@ -131,7 +124,6 @@
title: res.data.msg, title: res.data.msg,
icon: 'error' icon: 'error'
}) })
this.isPressed = false
} }
}) })
} }
@ -141,12 +133,7 @@
formatPrice, // formatPrice, //
}, },
onShow() { onShow() {
//
if (this.$store.state.cartList.length === 0) {
uni.redirectTo({
url: '/pages/main/order'
})
}
} }
} }
</script> </script>

View File

@ -1,12 +1,6 @@
<template> <template>
<view> <view>
<!-- topbar --> <button @click="pay">确认支付</button>
<u-navbar title="收银台" bgColor="#d43030" :titleStyle="{ color: '#FFF'}" :autoBack="true" placeholder>
<view class="u-nav-slot" slot="left">
<u-icon name="arrow-left" color="#fff" size="19"></u-icon>
</view>
</u-navbar>
<button @click="pay" type="primary" style="margin-top:200rpx;">确认支付</button>
</view> </view>
</template> </template>

View File

@ -43,10 +43,6 @@ const store = new Vuex.Store({
}, },
//修改状态 //修改状态
mutations: { mutations: {
//设置 列表页 购物车折叠显隐
setCartShow(state,val){
Vue.set(state,'cartShow', val)
},
//设置 标记用户登录状态 //设置 标记用户登录状态
setMqttState(state,val){ setMqttState(state,val){
Vue.set(state,'mqttState', val) Vue.set(state,'mqttState', val)
@ -93,10 +89,6 @@ const store = new Vuex.Store({
setShopCon(state, obj) { setShopCon(state, obj) {
state.shopCon = obj state.shopCon = obj
}, },
//清空购物车
clearCartList(state){
Vue.set(state,'cartList', [])
},
// 设置购物车列表 // 设置购物车列表
setCartList(state, obj) { setCartList(state, obj) {
let isExisting = false let isExisting = false