Commit 4bf5da33 by weijiguang

修改首页字体,修改每单杯数判断

parent d77d6b90
......@@ -149,6 +149,7 @@ export default {
background: #FFFFFF;
border-radius: 10rpx;
padding-top: 25rpx;
padding-bottom: 25rpx;
.code {
font-size: 36rpx;
......
......@@ -116,7 +116,6 @@ export default {
.shop-box {
min-width: 300rpx;
font-size: 28rpx;
font-family: PingFangSC-Semibold, PingFang SC;
font-weight: 600;
display: flex;
......@@ -132,7 +131,6 @@ export default {
.distance {
height: 46rpx;
font-size: 24rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #FFFFFF;
line-height: 42rpx;
......@@ -189,7 +187,6 @@ export default {
.user-name {
height: 28rpx;
font-size: 20rpx;
font-family: ArialMT;
color: #FFFFFF;
line-height: 22rpx;
}
......@@ -198,7 +195,6 @@ export default {
display: flex;
height: 22rpx;
font-size: 16rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #FFFFFF;
line-height: 22rpx;
......@@ -224,7 +220,6 @@ export default {
background: #006ECF;
border-radius: 4rpx;
font-size: 20rpx;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: #FFFFFF;
line-height: 48rpx;
......@@ -254,7 +249,6 @@ export default {
.first {
height: 44rpx;
font-size: 32rpx;
font-family: PingFangSC-Semibold, PingFang SC;
font-weight: 600;
color: #323232;
line-height: 44rpx;
......@@ -265,14 +259,12 @@ export default {
margin-top: 20rpx;
height: 34rpx;
font-size: 24rpx;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: #323232;
line-height: 34rpx;
.time {
font-size: 28rpx;
font-family: Arial-BoldMT, Arial;
font-weight: normal;
color: #006ECF;
margin: 0 16rpx;
......@@ -314,7 +306,6 @@ export default {
text-align: center;
margin-top: 14rpx;
font-size: 16rpx;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: #666666;
line-height: 22rpx;
......@@ -346,7 +337,6 @@ export default {
height: 170rpx;
line-height: 170rpx;
font-size: 24rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #666666;
display: flex;
......@@ -383,7 +373,6 @@ export default {
margin-bottom: 40rpx;
height: 44rpx;
font-size: 32rpx;
font-family: PingFangSC-Semibold, PingFang SC;
font-weight: 600;
color: #000000;
line-height: 44rpx;
......@@ -411,7 +400,6 @@ export default {
.goods-name {
font-size: 28rpx;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: #000000;
}
......@@ -424,7 +412,6 @@ export default {
margin-right: 10rpx;
padding: 4rpx 6rpx;
font-size: 16rpx;
font-family: ArialMT;
color: #006ECF;
line-height: 24rpx;
display: inline-block;
......@@ -434,7 +421,6 @@ export default {
.desc-box {
display: flex;
font-size: 20rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #666666;
line-height: 40rpx;
......@@ -449,10 +435,10 @@ export default {
display: inline-block;
height: 32rpx;
font-size: 24rpx;
font-family: Arial-BoldMT, Arial;
color: #EB5F17;
line-height: 32rpx;
margin-right: 6rpx;
font-weight: 800;
}
.price {
......@@ -460,7 +446,6 @@ export default {
display: inline-block;
height: 22rpx;
font-size: 20rpx;
font-family: ArialMT;
color: #666666;
line-height: 22rpx;
......
......@@ -89,8 +89,8 @@ export default {
allchecked: true,
// checked:true,
goods: [],//购物车商品信息
loginInfo:"",
imgPath: 'https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fpic.51yuansu.com%2Fpic3%2Fcover%2F01%2F82%2F40%2F596fa6dc00bb4_610.jpg&refer=http%3A%2F%2Fpic.51yuansu.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=jpeg?sec=1633499781&t=d37222e32213957ddbdd01d62e071309'
loginInfo: "",
imgPath: 'https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fpic.51yuansu.com%2Fpic3%2Fcover%2F01%2F82%2F40%2F596fa6dc00bb4_610.jpg&refer=http%3A%2F%2Fpic.51yuansu.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=jpeg?sec=1633499781&t=d37222e32213957ddbdd01d62e071309',
}
},
created() {
......@@ -128,9 +128,13 @@ export default {
},
//跳转到结算
saveReserve(e) {
if(this.totalPrice < 0 || this.totalNum <= 0) {
uni.showToast({ title: '请选择商品', icon: 'error' })
return;
}
let Authorization = uni.getStorageSync('Authorization');
let shopCarInfo = uni.getStorageSync('shopCarInfo').filter(v => v.flag == true);
if (shopCarInfo && this.totalPrice > 0 && this.totalNum > 0) {
if (shopCarInfo) {
if (Authorization) {
uni.navigateTo({
url: `/orderSubPackage/pages/settlement/index?buyType=1`
......@@ -192,9 +196,10 @@ export default {
this.goods.forEach(function (val) {
s += Number(val.num);
}, 0);
if (s >= 9) {
let countOfOrder = uni.getStorageSync('countOfOrder');
if (s >= countOfOrder) {
uni.showToast({
title: '最多可一次购买9杯',
title: '最多可一次购买'+countOfOrder+'杯',
icon: 'none'
});
return;
......@@ -211,7 +216,7 @@ export default {
totalNum() {
let totalNum = 0;
this.goods.map(item => {
item.flag ? totalNum += item.num : totalNum += 0
item.flag ? totalNum += parseInt(item.num) : totalNum += 0
})
return totalNum
},
......
......@@ -191,11 +191,12 @@ export default {
}
},
addGood() {
if (this.size < 9) {
let countOfOrder = uni.getStorageSync('countOfOrder');
if (this.size < countOfOrder) {
this.size = this.size + 1;
} else {
uni.showToast({
title: '最多可一次购买9杯',
title: '最多可一次购买'+countOfOrder+'杯',
icon: 'none',
});
}
......
......@@ -126,7 +126,7 @@ export default {
getShopMenus(params) {
$EventBus.$off('getMenuList');
$EventBus.$on('getMenuList', (data) => {
console.log("shop:"+data.id);
console.log("shop:"+JSON.stringify(data));
if(this.shopInfo && this.shopInfo.id != data.id) {
// 切换店铺清空购物车
uni.removeStorageSync('shopCarInfo');
......@@ -234,9 +234,11 @@ export default {
},
async getMenuList(id) {
let { data } = await Menu.getMenuList(id);
console.log("menus:"+JSON.stringify(data));
if (data.code == 200) {
data.data = data.data;
this.$store.commit('setMenuAllInfo', data.data);
uni.setStorageSync('countOfOrder', parseInt(data.data.countOfOrder));
this.$refs.MenuAssembly.createList(data.data.categorys)
}
},
......
......@@ -127,22 +127,37 @@ export default {
}
},
async oneMoreOrder(item) {
// 清空购物车
uni.removeStorageSync('shopCarInfo');
$EventBus.$emit('updateCar');
//
const numObj = {}
const { id, shopId, orderDetails } = item;
orderDetails.forEach(item => {
orderDetails[item.skuId] = item.num
})
const { data } = await order.moreOrder({ orderId: id, shopId });
if(!data || !data.data){
uni.showToast({ title: "该订单中的商品已经售罄了" });
return;
}
let list = new Array();
data.data.forEach(item => {
const skuId = item.skus[0].skuId
const nextData = { ...item, skuId, num: orderDetails[skuId], flag: true, sku: item.skus[0] }
if (nextData.sku.state == 1) {
Utils.getallNum(nextData)
list.push(nextData);
}
});
uni.switchTab({ url: '/pages/menu/menu' })
if(!list || list.length<=0) {
uni.showToast({ title: "该订单中的商品已经售罄了", icon: 'error' });
return;
}
list.forEach(nextData => {
Utils.getallNum(nextData);
})
uni.switchTab({ url: '/pages/menu/menu' });
},
async getList() {
if (!this.userms) return
......
......@@ -47,9 +47,10 @@ export default {
let shopCarInfo = uni.getStorageSync('shopCarInfo') || [];
let size = 0;
shopCarInfo.forEach((item) => (size += item.num));
if (size >= 9) {
let countOfOrder = uni.getStorageSync('countOfOrder');
if (size >= countOfOrder) {
uni.showToast({
title: '最多可一次购买9杯',
title: '最多可一次购买'+countOfOrder+'杯',
icon: 'none',
});
return false;
......@@ -77,9 +78,10 @@ export default {
let goodsList = [];
let size = 0;
goodsList.forEach((item) => (size += item.num));
if (size >= 9) {
let countOfOrder = uni.getStorageSync('countOfOrder');
if (size >= countOfOrder) {
uni.showToast({
title: '最多可一次购买9杯',
title: '最多可一次购买'+countOfOrder+'杯',
icon: 'none',
});
return false;
......
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