Commit 3b34e803 by songbingqi

调整部分页面 修复bug

parent db4696b3
......@@ -13,7 +13,8 @@
<view class="status_text">——制作完成后才能扫哦——</view>
</div>
<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>
......@@ -198,8 +199,9 @@ export default {
width: 100%;
height: 300rpx;
padding-top: 48rpx;
padding-left: 31rpx;
h3 {
.title {
font-size: 28rpx;
font-family: PingFangSC-Semibold, PingFang SC;
font-weight: 600;
......@@ -207,8 +209,9 @@ export default {
}
.flow_img {
width: 100%;
height: 100%;
padding:36rpx 32rpx 0rpx 32rpx;
width: 586rpx;
height: 223rpx;
display: block;
}
}
......
......@@ -135,7 +135,7 @@ export default {
},
cart(item, category){
console.log(item)
console.log(item,category)
const skuStatus = item.skus.filter(item=>{return Number(item.state)===1})
if(skuStatus.length===0){
this.showToast({
......
......@@ -100,11 +100,11 @@ export default {
skusSellout: [],
loginInfo:"",
pirce: 0,
size: 0,
size: 1,
topBarTop:0,
topBarHeight:0,
BottomSafeHeight:0,
Utils
Utils,
}
},
onShow() {
......@@ -136,6 +136,23 @@ export default {
const goodsInfo = JSON.parse(uni.getStorageSync('goodsInfo'));
this.goodInfo = goodsInfo;
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;
if (skus) {
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 {
|| skus.find(v => v.state == 1)
|| skus.find(v => v.isDefault == 1)
|| skus[0]
if (!sku) return;
if (sku){
this.selected.push(...sku.rules)
}else{
this.selected = []
};
skus.forEach(item => {
if (item.state == 1) {
item.rules.forEach(rule => {
......@@ -153,6 +173,7 @@ export default {
})
}
})
}
this.$nextTick(() => {
this.buildGoods(e => {
......@@ -162,10 +183,9 @@ export default {
this.size = 0
}
})
this.$forceUpdate()
})
},
methods: {
goBack(){
wx.navigateBack({
delta: 1
......@@ -256,7 +276,16 @@ export default {
if(this.checkNum('addShop')){
const { goods } = this;
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' });
return;
}else{
......@@ -264,6 +293,13 @@ export default {
Utils.getallNum(goods)
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) {
......@@ -277,11 +313,13 @@ export default {
const {state,goods:newgoods} = data.data
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}
console.log(this.goodInfo)
this.initInfo(this.goodInfo)
if(state==1){
if(state == 2){
this.showToast({ title: '本商品已经售罄', icon: 'none' });
return;
}else{
......@@ -322,7 +360,7 @@ export default {
}
},
}
}
</script>
......
......@@ -2,10 +2,10 @@
<scroll-view class="msg" scroll-y>
<view class="empty" v-show="empty == true">
<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 class="empty_text">——暂无消息,去品尝杯咖啡吧——</view>
<button class="empty_button" @click="goHome"></button>
<button class="empty_button" @click="goHome">去品尝</button>
</view>
<view class="msg_item" v-for="item in list" @click="toRead(item)" :key="item.id">
<view class="msg_item_title_time">
......@@ -69,8 +69,8 @@ export default {
margin-top: 311rpx;
.empty_icon {
width: 280rpx;
height: 266rpx;
width: 322rpx;
height: 234rpx;
}
.empty_text {
......@@ -87,7 +87,12 @@ export default {
width: 167rpx;
height: 64rpx;
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{
border-radius: 2rpx;
......
......@@ -25,6 +25,7 @@
<canvas v-if="qrShow" class="canvas-code" canvas-id="myQrcode"
style="background:#fff;width: 200px;height: 200px; display:block; left:-800rpx;position:absolute;" />
<div v-if="qrShow" class="flow_describe">
<view class="title">扫码流程</view>
<image :mode="'aspectFit'" class="flow_img" src="/static/imgs/saomaliucheng.png"></image>
</div>
......@@ -396,12 +397,13 @@ export default {
.flow_describe {
width: 100%;
height: 300rpx;
padding-left: 32rpx;
background: #FFFFFF;
border-radius: 10rpx;
padding-top: 50rpx;
padding-bottom: 60rpx;
h3 {
.title {
font-size: 28rpx;
font-family: PingFangSC-Semibold, PingFang SC;
font-weight: 600;
......@@ -409,8 +411,9 @@ export default {
}
.flow_img {
width: 100%;
height: 100%;
padding:36rpx 32rpx 0rpx 32rpx;
width: 586rpx;
height: 223rpx;
display: block;
}
}
......
......@@ -219,6 +219,7 @@ export default {
},
messageAndSave() {
wx.requestSubscribeMessage({
// 'Oq_zfRWRXijvXenRmfD2PARgpvdYlbkjR4laxKmBqb0'
tmplIds: ['1uErx-15S-3vuopXSvvsxCeM_Jd-1iZC-nXzd2yW3QU', 'Q4HDwBEvpTXpwtZktqWm4SZOTEuQK1x48xjqjD2GqyM', 'Fu_CPIXa0cnJ4EDdVKqFQ3qqKJccMqt2oorI5mfNq74'],
success: (res) => {
const finalValue = Object.values(res).indexOf('reject')
......
......@@ -34,7 +34,8 @@
<view class="order-banner" v-if="buied" @click="openQrcode">
<view class="info">
<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 class="line"></view>
<view class="barCode-box">
......@@ -265,15 +266,26 @@ export default {
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 {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);
if(!newsku){
this.showToast({ title: '本商品已经售罄', icon: 'none' });
return;
}else{
if(state == 2){
if(newsku){
if(newsku.isDefault != 1){
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.sku = newsku
itemCopy.skuId = newsku?.skuId
......@@ -475,6 +487,7 @@ export default {
.second {
margin-top: 12rpx;
width: 400rpx;
height: 34rpx;
font-size: 24rpx;
font-family: PingFangSC-Medium, PingFang SC;
......
......@@ -346,7 +346,6 @@ button::after {
.function {
width: 686rpx;
background: #FFFFFF;
border-radius: 10rpx;
margin: 0 auto;
padding: 22rpx 26rpx;
box-sizing: border-box;
......
......@@ -3,17 +3,17 @@
<view v-show="false">{{userms}}</view>
<view class="empty" v-show="userms && empty == true">
<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 class="empty_text">——您还未下单,下单品尝一下吧——</view>
<button class="empty_button" @click="goHome"></button>
<button class="empty_button" @click="goHome">去品尝</button>
</view>
<view class="empty" v-show="!userms">
<view class="empty_notdl" v-show="!userms">
<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 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 class="orders">
<view class="order_item" v-for="item in list" :key="item.id" @click="openInfo(item)">
......@@ -236,11 +236,13 @@ export default {
margin-top: 311rpx;
.empty_icon {
width: 280rpx;
height: 266rpx;
width: 322rpx;
height: 234rpx;
}
.empty_text {
width: 500rpx;
margin-top: 35rpx;
text-align: center;
......@@ -253,11 +255,55 @@ export default {
margin-top: 35rpx;
width: 167rpx;
height: 64rpx;
background: url('@/static/imgs/qupinchang.png') center center no-repeat;
border-radius: 0rpx;
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{
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{
border-radius: 0rpx;
border-radius: 2rpx;
border: 0rpx;
}
}
......
import { $EventBus } from '@/utils/EventBus';
import context from '../../main.js'
import Order from '@/request/order/index.js'
export default {
// 获取菜单列表
getMenuList(id) {
......@@ -54,24 +55,32 @@ export default {
package: data.package,
signType: data.signType || 'MD5', // 签名算法
paySign: data.paySign, // 签名
success: function (res) {
success: async function (res) {
if (res.errMsg == 'requestPayment:ok') {
// 删除购物车数据后重新放回购物车
uni.setStorageSync('shopCarInfo', []);
$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({
title: '支付失败',
icon: 'error',
});
uni.setStorageSync('shopCarInfo', []);
$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