Commit 4bf5da33 by weijiguang

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

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