Commit 3b34e803 by songbingqi

调整部分页面 修复bug

parent db4696b3
...@@ -13,7 +13,8 @@ ...@@ -13,7 +13,8 @@
<view class="status_text">——制作完成后才能扫哦——</view> <view class="status_text">——制作完成后才能扫哦——</view>
</div> </div>
<div class="flow_describe"> <div class="flow_describe">
<image :mode="'aspectFit'" class="flow_img" src="/static/imgs/saomaliucheng.png"></image> <view class="title">扫码流程</view>
<image :mode="'aspectFit'" class="flow_img" :src="'/static/imgs/saomaliucheng.png'"></image>
</div> </div>
</div> </div>
...@@ -198,8 +199,9 @@ export default { ...@@ -198,8 +199,9 @@ export default {
width: 100%; width: 100%;
height: 300rpx; height: 300rpx;
padding-top: 48rpx; padding-top: 48rpx;
padding-left: 31rpx;
h3 { .title {
font-size: 28rpx; font-size: 28rpx;
font-family: PingFangSC-Semibold, PingFang SC; font-family: PingFangSC-Semibold, PingFang SC;
font-weight: 600; font-weight: 600;
...@@ -207,8 +209,9 @@ export default { ...@@ -207,8 +209,9 @@ export default {
} }
.flow_img { .flow_img {
width: 100%; padding:36rpx 32rpx 0rpx 32rpx;
height: 100%; width: 586rpx;
height: 223rpx;
display: block; display: block;
} }
} }
......
...@@ -135,7 +135,7 @@ export default { ...@@ -135,7 +135,7 @@ export default {
}, },
cart(item, category){ cart(item, category){
console.log(item) console.log(item,category)
const skuStatus = item.skus.filter(item=>{return Number(item.state)===1}) const skuStatus = item.skus.filter(item=>{return Number(item.state)===1})
if(skuStatus.length===0){ if(skuStatus.length===0){
this.showToast({ this.showToast({
......
...@@ -100,11 +100,11 @@ export default { ...@@ -100,11 +100,11 @@ export default {
skusSellout: [], skusSellout: [],
loginInfo:"", loginInfo:"",
pirce: 0, pirce: 0,
size: 0, size: 1,
topBarTop:0, topBarTop:0,
topBarHeight:0, topBarHeight:0,
BottomSafeHeight:0, BottomSafeHeight:0,
Utils Utils,
} }
}, },
onShow() { onShow() {
...@@ -136,6 +136,23 @@ export default { ...@@ -136,6 +136,23 @@ export default {
const goodsInfo = JSON.parse(uni.getStorageSync('goodsInfo')); const goodsInfo = JSON.parse(uni.getStorageSync('goodsInfo'));
this.goodInfo = goodsInfo; this.goodInfo = goodsInfo;
console.log(JSON.parse(JSON.stringify(this.goodInfo))); console.log(JSON.parse(JSON.stringify(this.goodInfo)));
this.initInfo(this.goodInfo)
},
// watch:{
// selected(val){
// console.log(val,'val')
// const {skus,specs} = this.goodInfo
// console.log(skus,'--------skus',specs,'--------specs')
// const ruleIdList = val.map(res=>res.ruleId)
// console.log(ruleIdList)
// }
// },
methods: {
initInfo(goodsInfo){
this.available = []
this.selected = []
const skus = goodsInfo.skus; const skus = goodsInfo.skus;
if (skus) { if (skus) {
const sku = skus.find(v => v.isDefault == 1 && v.state == 1) || skus.find(v => v.isDefault == 0 && v.state == 1); const sku = skus.find(v => v.isDefault == 1 && v.state == 1) || skus.find(v => v.isDefault == 0 && v.state == 1);
...@@ -144,8 +161,11 @@ export default { ...@@ -144,8 +161,11 @@ export default {
|| skus.find(v => v.state == 1) || skus.find(v => v.state == 1)
|| skus.find(v => v.isDefault == 1) || skus.find(v => v.isDefault == 1)
|| skus[0] || skus[0]
if (!sku) return; if (sku){
this.selected.push(...sku.rules) this.selected.push(...sku.rules)
}else{
this.selected = []
};
skus.forEach(item => { skus.forEach(item => {
if (item.state == 1) { if (item.state == 1) {
item.rules.forEach(rule => { item.rules.forEach(rule => {
...@@ -153,6 +173,7 @@ export default { ...@@ -153,6 +173,7 @@ export default {
}) })
} }
}) })
} }
this.$nextTick(() => { this.$nextTick(() => {
this.buildGoods(e => { this.buildGoods(e => {
...@@ -162,10 +183,9 @@ export default { ...@@ -162,10 +183,9 @@ export default {
this.size = 0 this.size = 0
} }
}) })
this.$forceUpdate()
}) })
}, },
methods: {
goBack(){ goBack(){
wx.navigateBack({ wx.navigateBack({
delta: 1 delta: 1
...@@ -256,7 +276,16 @@ export default { ...@@ -256,7 +276,16 @@ export default {
if(this.checkNum('addShop')){ if(this.checkNum('addShop')){
const { goods } = this; const { goods } = this;
const { data } = await Order.checkSku({skuId:goods.skuId}) const { data } = await Order.checkSku({skuId:goods.skuId})
if(data.data&&data.data.state===2){ const {state,goods:newgoods} = data.data
const newInfo = JSON.parse(JSON.stringify(newgoods))
newInfo.category = this.goodInfo.category
// newInfo.skus.map(res=>res.state = '2')
// newInfo.skus[0].state = '2'
this.goodInfo = {...newInfo}
this.initInfo(this.goodInfo)
if(state == 2){
this.showToast({ title: '本商品已经售罄', icon: 'none' }); this.showToast({ title: '本商品已经售罄', icon: 'none' });
return; return;
}else{ }else{
...@@ -264,6 +293,13 @@ export default { ...@@ -264,6 +293,13 @@ export default {
Utils.getallNum(goods) Utils.getallNum(goods)
uni.switchTab({ url: '/pages/menu/menu' }) uni.switchTab({ url: '/pages/menu/menu' })
} }
return
// const { data } = await Order.checkSku({skuId:goods.skuId})
// else{
// goods.num = this.size;
// Utils.getallNum(goods)
// uni.switchTab({ url: '/pages/menu/menu' })
// }
} }
}, },
async getallNum(e) { async getallNum(e) {
...@@ -277,11 +313,13 @@ export default { ...@@ -277,11 +313,13 @@ export default {
const {state,goods:newgoods} = data.data const {state,goods:newgoods} = data.data
const newInfo = JSON.parse(JSON.stringify(newgoods)) const newInfo = JSON.parse(JSON.stringify(newgoods))
newInfo.skus.map(res=>res.state = 2) newInfo.category = this.goodInfo.category
// newInfo.skus.map(res=>res.state = '2')
// newInfo.skus[0].state = '2'
this.goodInfo = {...newInfo} this.goodInfo = {...newInfo}
console.log(this.goodInfo) this.initInfo(this.goodInfo)
if(state==1){ if(state == 2){
this.showToast({ title: '本商品已经售罄', icon: 'none' }); this.showToast({ title: '本商品已经售罄', icon: 'none' });
return; return;
}else{ }else{
...@@ -322,7 +360,7 @@ export default { ...@@ -322,7 +360,7 @@ export default {
} }
}, }
} }
</script> </script>
......
...@@ -2,10 +2,10 @@ ...@@ -2,10 +2,10 @@
<scroll-view class="msg" scroll-y> <scroll-view class="msg" scroll-y>
<view class="empty" v-show="empty == true"> <view class="empty" v-show="empty == true">
<view :style="{'text-align':'center'}"> <view :style="{'text-align':'center'}">
<image class="empty_icon" src="/static/imgs/none_content.png"></image> <image class="empty_icon" src="/static/imgs/wuxiaoxizhanweitu.png"></image>
</view> </view>
<view class="empty_text">——暂无消息,去品尝杯咖啡吧——</view> <view class="empty_text">——暂无消息,去品尝杯咖啡吧——</view>
<button class="empty_button" @click="goHome"></button> <button class="empty_button" @click="goHome">去品尝</button>
</view> </view>
<view class="msg_item" v-for="item in list" @click="toRead(item)" :key="item.id"> <view class="msg_item" v-for="item in list" @click="toRead(item)" :key="item.id">
<view class="msg_item_title_time"> <view class="msg_item_title_time">
...@@ -69,8 +69,8 @@ export default { ...@@ -69,8 +69,8 @@ export default {
margin-top: 311rpx; margin-top: 311rpx;
.empty_icon { .empty_icon {
width: 280rpx; width: 322rpx;
height: 266rpx; height: 234rpx;
} }
.empty_text { .empty_text {
...@@ -87,7 +87,12 @@ export default { ...@@ -87,7 +87,12 @@ export default {
width: 167rpx; width: 167rpx;
height: 64rpx; height: 64rpx;
border-radius: 2rpx; border-radius: 2rpx;
background: url('@/static/imgs/qupinchang.png') center center no-repeat; font-size: 24rpx;
font-family: PingFangSC-Regular, PingFang SC;
background: #003AE9;
font-weight: 400;
color: #FFFFFF;
line-height: 64rpx;
} }
.empty_button::after{ .empty_button::after{
border-radius: 2rpx; border-radius: 2rpx;
......
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
<canvas v-if="qrShow" class="canvas-code" canvas-id="myQrcode" <canvas v-if="qrShow" class="canvas-code" canvas-id="myQrcode"
style="background:#fff;width: 200px;height: 200px; display:block; left:-800rpx;position:absolute;" /> style="background:#fff;width: 200px;height: 200px; display:block; left:-800rpx;position:absolute;" />
<div v-if="qrShow" class="flow_describe"> <div v-if="qrShow" class="flow_describe">
<view class="title">扫码流程</view>
<image :mode="'aspectFit'" class="flow_img" src="/static/imgs/saomaliucheng.png"></image> <image :mode="'aspectFit'" class="flow_img" src="/static/imgs/saomaliucheng.png"></image>
</div> </div>
...@@ -396,12 +397,13 @@ export default { ...@@ -396,12 +397,13 @@ export default {
.flow_describe { .flow_describe {
width: 100%; width: 100%;
height: 300rpx; height: 300rpx;
padding-left: 32rpx;
background: #FFFFFF; background: #FFFFFF;
border-radius: 10rpx; border-radius: 10rpx;
padding-top: 50rpx; padding-top: 50rpx;
padding-bottom: 60rpx; padding-bottom: 60rpx;
h3 { .title {
font-size: 28rpx; font-size: 28rpx;
font-family: PingFangSC-Semibold, PingFang SC; font-family: PingFangSC-Semibold, PingFang SC;
font-weight: 600; font-weight: 600;
...@@ -409,8 +411,9 @@ export default { ...@@ -409,8 +411,9 @@ export default {
} }
.flow_img { .flow_img {
width: 100%; padding:36rpx 32rpx 0rpx 32rpx;
height: 100%; width: 586rpx;
height: 223rpx;
display: block; display: block;
} }
} }
......
...@@ -219,6 +219,7 @@ export default { ...@@ -219,6 +219,7 @@ export default {
}, },
messageAndSave() { messageAndSave() {
wx.requestSubscribeMessage({ wx.requestSubscribeMessage({
// 'Oq_zfRWRXijvXenRmfD2PARgpvdYlbkjR4laxKmBqb0'
tmplIds: ['1uErx-15S-3vuopXSvvsxCeM_Jd-1iZC-nXzd2yW3QU', 'Q4HDwBEvpTXpwtZktqWm4SZOTEuQK1x48xjqjD2GqyM', 'Fu_CPIXa0cnJ4EDdVKqFQ3qqKJccMqt2oorI5mfNq74'], tmplIds: ['1uErx-15S-3vuopXSvvsxCeM_Jd-1iZC-nXzd2yW3QU', 'Q4HDwBEvpTXpwtZktqWm4SZOTEuQK1x48xjqjD2GqyM', 'Fu_CPIXa0cnJ4EDdVKqFQ3qqKJccMqt2oorI5mfNq74'],
success: (res) => { success: (res) => {
const finalValue = Object.values(res).indexOf('reject') const finalValue = Object.values(res).indexOf('reject')
......
...@@ -34,7 +34,8 @@ ...@@ -34,7 +34,8 @@
<view class="order-banner" v-if="buied" @click="openQrcode"> <view class="order-banner" v-if="buied" @click="openQrcode">
<view class="info"> <view class="info">
<view class="first">取单码:<text class="first-code">{{ orderInfo.orderNum }}</text></view> <view class="first">取单码:<text class="first-code">{{ orderInfo.orderNum }}</text></view>
<view class="second">请您耐心等候,剩余等候时间<text class="time">{{ orderInfo.waitTime }}</text>分钟</view> <view class="second" v-if="orderInfo.state =='4'">订单已制作完成,请尽快取餐~</view>
<view class="second" v-else>请您耐心等候,剩余等候时间<text class="time">{{ orderInfo.waitTime }}</text>分钟</view>
</view> </view>
<view class="line"></view> <view class="line"></view>
<view class="barCode-box"> <view class="barCode-box">
...@@ -265,15 +266,26 @@ export default { ...@@ -265,15 +266,26 @@ export default {
let itemCopy = JSON.parse(JSON.stringify(item)); let itemCopy = JSON.parse(JSON.stringify(item));
const sku = itemCopy.skus.find(v => v.isDefault == 1 && v.state != 2) || itemCopy.skus.find(v => v.isDefault == 0 && v.state != 2); const sku = itemCopy.skus.find(v => v.isDefault == 1 && v.state != 2) || itemCopy.skus.find(v => v.isDefault == 0 && v.state != 2);
const {data} = await Order.checkSku({skuId:sku.skuId}) const {data} = await Order.checkSku({skuId:sku.skuId})
const {goods} = data.data const {state,goods} = data.data
const newsku = goods.skus.find(v => v.isDefault == 1 && v.state != 2) || goods.skus.find(v => v.isDefault == 0 && v.state != 2); const newsku = goods.skus.find(v => v.isDefault == 1 && v.state != 2) || goods.skus.find(v => v.isDefault == 0 && v.state != 2);
if(!newsku){ if(state == 2){
this.showToast({ title: '本商品已经售罄', icon: 'none' }); if(newsku){
return;
}else{
if(newsku.isDefault != 1){ if(newsku.isDefault != 1){
this.showToast({ title: '默认规格已售罄,已添加其他规格', icon: 'none' }); this.showToast({ title: '默认规格已售罄,已添加其他规格', icon: 'none' });
itemCopy.skus = [newsku];
itemCopy.sku = newsku
itemCopy.skuId = newsku?.skuId
itemCopy.num = 1;
itemCopy.flag = true;
itemCopy.categoryId = category.id;
itemCopy.goodsName = category.name;
Utils.getallNum(itemCopy);
}
}else{
this.showToast({ title: '本商品已经售罄', icon: 'none' });
return;
} }
}else{
itemCopy.skus = [newsku]; itemCopy.skus = [newsku];
itemCopy.sku = newsku itemCopy.sku = newsku
itemCopy.skuId = newsku?.skuId itemCopy.skuId = newsku?.skuId
...@@ -475,6 +487,7 @@ export default { ...@@ -475,6 +487,7 @@ export default {
.second { .second {
margin-top: 12rpx; margin-top: 12rpx;
width: 400rpx;
height: 34rpx; height: 34rpx;
font-size: 24rpx; font-size: 24rpx;
font-family: PingFangSC-Medium, PingFang SC; font-family: PingFangSC-Medium, PingFang SC;
......
...@@ -346,7 +346,6 @@ button::after { ...@@ -346,7 +346,6 @@ button::after {
.function { .function {
width: 686rpx; width: 686rpx;
background: #FFFFFF; background: #FFFFFF;
border-radius: 10rpx;
margin: 0 auto; margin: 0 auto;
padding: 22rpx 26rpx; padding: 22rpx 26rpx;
box-sizing: border-box; box-sizing: border-box;
......
...@@ -3,17 +3,17 @@ ...@@ -3,17 +3,17 @@
<view v-show="false">{{userms}}</view> <view v-show="false">{{userms}}</view>
<view class="empty" v-show="userms && empty == true"> <view class="empty" v-show="userms && empty == true">
<view :style="{'text-align':'center'}"> <view :style="{'text-align':'center'}">
<image class="empty_icon" src="/static/imgs/none_content.png"></image> <image class="empty_icon" src="/static/imgs/wudingdanzhanweitu.png"></image>
</view> </view>
<view class="empty_text">——您还未下单,下单品尝一下吧——</view> <view class="empty_text">——您还未下单,下单品尝一下吧——</view>
<button class="empty_button" @click="goHome"></button> <button class="empty_button" @click="goHome">去品尝</button>
</view> </view>
<view class="empty" v-show="!userms"> <view class="empty_notdl" v-show="!userms">
<view :style="{'text-align':'center'}"> <view :style="{'text-align':'center'}">
<image class="empty_icon" src="/static/imgs/none_content.png"></image> <image class="empty_icon" src="/static/imgs/weidengluzhanweitu.png"></image>
</view> </view>
<view class="empty_text">——您还未登录,请先登录——</view> <view class="empty_text">——您还未登录,请先登录——</view>
<button class="empty_button" open-type="getPhoneNumber" @getphonenumber="getPhoneNumber"></button> <button class="empty_button" open-type="getPhoneNumber" @getphonenumber="getPhoneNumber">去品尝</button>
</view> </view>
<view class="orders"> <view class="orders">
<view class="order_item" v-for="item in list" :key="item.id" @click="openInfo(item)"> <view class="order_item" v-for="item in list" :key="item.id" @click="openInfo(item)">
...@@ -236,11 +236,13 @@ export default { ...@@ -236,11 +236,13 @@ export default {
margin-top: 311rpx; margin-top: 311rpx;
.empty_icon { .empty_icon {
width: 280rpx; width: 322rpx;
height: 266rpx; height: 234rpx;
} }
.empty_text { .empty_text {
width: 500rpx;
margin-top: 35rpx; margin-top: 35rpx;
text-align: center; text-align: center;
...@@ -253,11 +255,55 @@ export default { ...@@ -253,11 +255,55 @@ export default {
margin-top: 35rpx; margin-top: 35rpx;
width: 167rpx; width: 167rpx;
height: 64rpx; height: 64rpx;
background: url('@/static/imgs/qupinchang.png') center center no-repeat; border-radius: 2rpx;
border-radius: 0rpx; font-size: 24rpx;
font-family: PingFangSC-Regular, PingFang SC;
background: #003AE9;
font-weight: 400;
color: #FFFFFF;
line-height: 64rpx;
}
.empty_button::after{
border-radius: 2rpx;
border: 0rpx;
}
}
.empty_notdl{
position: fixed;
/* 居中对齐begin */
left: 50%;
/* 兼容老版本的方法 */
-webkit-transform: translateX(-50%);
transform: translate(-50%);
margin-top: 311rpx;
.empty_icon {
width: 322rpx;
height: 234rpx;
}
.empty_text {
margin-top: 35rpx;
text-align: center;
font-size: 24rpx;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: #999999;
}
.empty_button {
margin-top: 35rpx;
width: 167rpx;
height: 64rpx;
border-radius: 2rpx;
font-size: 24rpx;
font-family: PingFangSC-Regular, PingFang SC;
background: #003AE9;
font-weight: 400;
color: #FFFFFF;
line-height: 64rpx;
} }
.empty_button::after{ .empty_button::after{
border-radius: 0rpx; border-radius: 2rpx;
border: 0rpx; border: 0rpx;
} }
} }
......
import { $EventBus } from '@/utils/EventBus'; import { $EventBus } from '@/utils/EventBus';
import context from '../../main.js' import context from '../../main.js'
import Order from '@/request/order/index.js'
export default { export default {
// 获取菜单列表 // 获取菜单列表
getMenuList(id) { getMenuList(id) {
...@@ -54,24 +55,32 @@ export default { ...@@ -54,24 +55,32 @@ export default {
package: data.package, package: data.package,
signType: data.signType || 'MD5', // 签名算法 signType: data.signType || 'MD5', // 签名算法
paySign: data.paySign, // 签名 paySign: data.paySign, // 签名
success: function (res) { success: async function (res) {
if (res.errMsg == 'requestPayment:ok') { if (res.errMsg == 'requestPayment:ok') {
// 删除购物车数据后重新放回购物车 // 删除购物车数据后重新放回购物车
uni.setStorageSync('shopCarInfo', []); uni.setStorageSync('shopCarInfo', []);
$EventBus.$emit('updateCar'); $EventBus.$emit('updateCar');
uni.switchTab({ url: '/pages/order/order' }); const {data} = await Order.getMyOrder()
const {rows} = data
uni.setStorageSync('orderInfo', rows[0]);
let url = '/orderSubPackage/pages/orderInfo/index'
uni.navigateTo({ url })
} }
// 业务逻辑。。。 // 业务逻辑。。。
}, },
fail: function (err) { fail: async function (err) {
context.showToast({ context.showToast({
title: '支付失败', title: '支付失败',
icon: 'error', icon: 'error',
}); });
uni.setStorageSync('shopCarInfo', []); uni.setStorageSync('shopCarInfo', []);
$EventBus.$emit('updateCar'); $EventBus.$emit('updateCar');
uni.switchTab({ url: '/pages/order/order' }); const {data} = await Order.getMyOrder()
const {rows} = data
uni.setStorageSync('orderInfo', rows[0]);
let url = '/orderSubPackage/pages/orderInfo/index'
uni.navigateTo({ url })
}, },
}); });
}, },
......
static/imgs/saomaliucheng.png

56.2 KB | W: | H:

static/imgs/saomaliucheng.png

75.8 KB | W: | H:

static/imgs/saomaliucheng.png
static/imgs/saomaliucheng.png
static/imgs/saomaliucheng.png
static/imgs/saomaliucheng.png
  • 2-up
  • Swipe
  • Onion skin
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment