WIN-2CJ8FMUT9OF\Administrator 6 hónapja
szülő
commit
93cebdd7ff

+ 4 - 2
common/css/common.css

@@ -666,7 +666,9 @@ text {
 .b-b-F9F9F9 {
 	border-bottom: 1rpx solid #F9F9F9;
 }
-
+.b-b-2-F9F9F9 {
+	border-bottom: 2rpx solid #F9F9F9;
+}
 .b-b-eee {
 	border-bottom: .5rpx solid #eee;
 }
@@ -1146,7 +1148,7 @@ text {
 }
 
 .b-b-eee {
-	border-bottom: 1rpx solid #eee;
+	border-bottom: 2rpx solid #eee;
 }
 
 .b-t-eee {

+ 70 - 0
components/price-display.vue

@@ -0,0 +1,70 @@
+<template>
+	<view class="price-container">
+		<text class="price-integer"
+			:style="{fontSize:integerSize+'rpx',fontWeight:integerFontWeight,color:integerColor}">{{ integerPart }}</text>
+		<text class="price-decimal"
+			:style="{fontSize:decimalSize+'rpx',fontWeight:decimalFontWeight,color:decimalColor}">.{{ decimalPart }}</text>
+	</view>
+</template>
+
+<script>
+	export default {
+		props: {
+			value: {
+				// 接收价格,如 99.00
+				type: [Number, String],
+				default: 0
+			},
+			// 整数字体大小
+			integerSize: {
+				type: Number,
+				default: 40,
+			},
+			// 整数字体粗细
+			integerFontWeight: {
+				type: Number,
+				default: 700,
+			},
+			// 整数字体颜色
+			integerColor: {
+				type: String,
+				default: '#333',
+			},
+			// 小数字体大小
+			decimalSize: {
+				type: Number,
+				default: 24,
+			},
+			// 小数字体大小
+			decimalFontWeight: {
+				type: Number,
+				default: 700,
+			},
+			// 小数字体颜色
+			decimalColor: {
+				type: String,
+				default: '#333',
+			},
+		},
+		computed: {
+			// 拆分整数和小数部分
+			priceParts() {
+				const num = Number(this.value)
+				// 固定保留两位小数,并拆分
+				const [integer, decimal] = num.toFixed(2).split('.')
+				return {
+					integer,
+					decimal
+				}
+			},
+			integerPart() {
+				return `${this.priceParts.integer}`
+			},
+			decimalPart() {
+				return this.priceParts.decimal
+			}
+		}
+	}
+</script>
+
+<style scoped></style>

+ 35 - 17
pages-order/takeout-info.vue

@@ -17,7 +17,7 @@
 				</view>
 			</view>
 		</view>
-		<view class="plr-24 box-border-box">
+		<view class="plr-24 box-border-box" v-if="infoData.number">
 			<view class="bgc-f b-rad-20 p-32-24 box-border-box fs-36 fw-600 fc-3">
 				取餐号:{{infoData.number?infoData.number:'无'}}
 			</view>
@@ -25,26 +25,31 @@
 		<scroll-view :scroll-y="true" class="scroll-view-css box-border-box p-24-24-136-24"
 			@scrolltolower="scrolltolower">
 			<view class="bgc-f b-rad-20 p-24 box-border-box mb-20">
-				<view class="w-420 fc-3 fs-32 fw-600 text-overflow-ellipsis-one mb-24">
-					{{infoData.shop.shop_name}}
+				<view class="align-items-center mb-24">
+					<image class="shop-icon" src="/static/img/order-food/shop-icon.png" mode=""></image>
+					<view class="w-420 fc-3 fs-28 text-overflow-ellipsis-one">
+						{{infoData.shop.shop_name || ''}}
+					</view>
 				</view>
 				<view class="goods-box" :class="infoData.item.length >= 4 && goodsShow?'goodsShowOne':'goodsShowTwo'">
-					<view class="align-items-center flex-justify-space mb-20" v-for="(item,index) in infoData.item">
+					<view class="align-items-flex-start mb-28" v-for="(item,index) in infoData.item">
 						<image class="goods-img mr-16 flex-shrink0" :src="item.goods_img" mode="aspectFill"></image>
-						<view class="">
-							<view class="align-items-center flex-justify-space mb-2">
-								<view class="fs-28 fc-3 w-376 text-overflow-ellipsis-one mr-36">
-									{{item.goods_name}}
+						<view class="flex-1 flex-justify-space min-h-108">
+							<view class="w376 flex-direction flex-justify-space">
+								<view class="">
+									<view class="fs-28 fc-3 fw-600 w-376 text-overflow-ellipsis-one mr-36">
+										{{item.goods_name || ''}}
+									</view>
+									<view class="mb-2 fs-24 fc-9">
+										{{item.goods_attr || ''}}
+									</view>
 								</view>
-								<view class="fs-32 fc-3 fw-600">
-									¥{{ (Number(item.goods_money)).toFixed(2) }}
+								<view class="fs-24 fc-9">
+									x{{item.goods_number || ''}}
 								</view>
 							</view>
-							<view class="mb-2 fs-24 fc-9">
-								{{item.goods_attr}}
-							</view>
-							<view class="fs-24 fc-9">
-								x{{item.goods_number}}
+							<view class="fs-32 fc-3 fw-600">
+								¥{{ (Number(item.goods_money)).toFixed(2) }}
 							</view>
 						</view>
 					</view>
@@ -87,7 +92,7 @@
 						¥
 					</view>
 					<view class="fs-36  fw-600 fc-3">
-						{{infoData.pay_money}}
+						{{infoData.pay_money || ''}}
 					</view>
 				</view>
 			</view>
@@ -146,7 +151,7 @@
 				</view>
 			</view>
 		</scroll-view>
-		<view class="bot-box box-border-box align-items-center flex-justify-end bgc-f">
+		<view class="bot-box box-border-box align-items-center flex-justify-end bgc-f" v-if="infoData.order_status != 1">
 			<view class="item-but fc-f fs-28 text-align-center b-rad-200" @click="goToUrl()">
 				再来一单
 			</view>
@@ -303,6 +308,19 @@
 </script>
 
 <style lang="scss" scoped>
+	.w376 {
+		width: 376rpx;
+	}
+
+	.min-h-108 {
+		min-height: 108rpx;
+	}
+
+	.shop-icon {
+		width: 48rpx;
+		height: 48rpx;
+	}
+
 	.p-24-24-136-24 {
 		padding: 24rpx 24rpx 136rpx;
 	}

+ 24 - 15
pages-takeout/goods-order.vue

@@ -32,7 +32,7 @@
 			</view>
 
 			<view class="box-card bgc-f b-rad-16 p-24 box-border-box mb-16">
-				<view class="align-items-center flex-justify-space pb-24 b-b-F9F9F9">
+				<view class="align-items-center flex-justify-space pb-24 b-b-eee mb-24">
 					<view class="fs-28 fc-6">
 						店内点单
 					</view>
@@ -44,18 +44,22 @@
 					</view>
 				</view>
 				<view class="mb-24 b-b-F9F9F9">
-					<view class="flex-justify-space mb-28" v-for="(item,i) in cartData.shopping_cart.goods_list"
+					<view class="align-items-flex-start mb-28" v-for="(item,i) in cartData.shopping_cart.goods_list"
 						:key="i">
 						<image class="goods-img flex-shrink0" :src="item.goods_image" mode="aspectFill"></image>
-						<view class="w376">
-							<view class="fs-28 fw-600 mb-2 text-overflow-ellipsis-one">
-								{{item.goods_name}}
+						<view class="flex-1 flex-justify-space min-h-108">
+							<view class="w376 flex-direction flex-justify-space">
+								<view class="">
+									<view class="fs-28 fw-600 mb-2 text-overflow-ellipsis-one">
+										{{item.goods_name || ''}}
+									</view>
+									<view class="fs-24 fc-9 mb-2">{{item.goods_attr || ''}}</view>
+								</view>
+								<view class="fs-24 fc-9">x{{item.goods_number || ''}}</view>
+							</view>
+							<view class="fs-32 fw-600 fc-3">¥{{Number(item.price * item.goods_number).toFixed(2)}}
 							</view>
-							<view class="fs-24 fc-9 mb-2">{{item.goods_attr}}</view>
-							<view class="fs-24 fc-9">x{{item.goods_number}}</view>
 						</view>
-						<!-- <view class="fs-32 fw-600 fc-3">¥{{item.price * item.goods_number}}</view> -->
-						<view class="fs-32 fw-600 fc-3">¥{{Number(item.price * item.goods_number).toFixed(2)}}</view>
 					</view>
 				</view>
 				<view class="flex-justify-space mb-30" v-if="cartData.order_type === 2">
@@ -77,18 +81,18 @@
 					<view class="fs-28 fw-400">店铺优惠</view>
 					<view class="fs-32 fw-600">¥{{cardData.pack_price}}</view>
 				</view> -->
-				<view class="align-items-center flex-justify-end pt-20 b-t-F9F9F9">
+				<view class="align-items-baseline flex-justify-end pt-20 b-t-F9F9F9">
 					<view class="fs-28 fc-0 fw-400 mr-4">
 						应付
 					</view>
 					<span class="fw-600 fc-0 fs-28">¥</span>
 					<span
-						class="fw-600 fc-0 fs-44">{{cartData.order_type === 1 ?cartData.shopping_cart.total_goods_money:cartData.shopping_cart.total_price}}</span>
+						class="fw-600 fc-0 fs-44">{{cartData.order_type === 1 ?Number(cartData.shopping_cart.total_goods_money).toFixed(2):(cartData.shopping_cart.total_price).toFixed(2)}}</span>
 				</view>
 			</view>
 
 			<view class="p-24 box-border-box bgc-f mb-20 b-rad-20 flex-justify-space">
-				<view class="fs-28 fw-600">备注</view>
+				<view class="fs-28 fw-600 flex-shrink0">备注</view>
 				<input v-model="cartData.note" class="flex-1 text-align-right fs-28" type="text" placeholder="请填写你的需求">
 			</view>
 			<view class="p-24 box-border-box bgc-f mb-20 b-rad-20 flex-justify-space">
@@ -106,8 +110,8 @@
 			<view class="bottom-box flex-justify-space align-items-center pl-24 box-border-box pr-8 b-rad-200 bgc-f">
 				<view class="align-items-baseline">
 					<view class="fs-28 fc-3 fw-600">¥</view>
-					<view class="fs-44 fc-3 fw-600">
-						{{cartData.order_type === 1 ?cartData.shopping_cart.total_goods_money:cartData.shopping_cart.total_price}}
+					<view class="fs-48 fc-3 fw-600">
+						{{cartData.order_type === 1 ? (cartData.shopping_cart.total_goods_money).toFixed(2): (cartData.shopping_cart.total_price).toFixed(2) }}
 					</view>
 				</view>
 				<view class="box-2 text-align-center fc-f fs-32 fw-600 b-rad-200" @click="toSave()">立即支付</view>
@@ -257,7 +261,8 @@
 										this.isAJAX = false;
 										setTimeout(() => {
 											uni.redirectTo({
-												url: `/pages-order/takeout-info?orderId=` + res.data.order_id
+												url: `/pages-order/takeout-info?orderId=` +
+													res.data.order_id
 											})
 											cartStore.clearCurrentShopCart();
 										}, 1000)
@@ -299,6 +304,10 @@
 </script>
 
 <style scoped lang="scss">
+	.min-h-108 {
+		min-height: 108rpx;
+	}
+
 	.pop-but {
 		width: 100%;
 		height: 96rpx;

+ 25 - 16
pages-takeout/new-shop.vue

@@ -95,9 +95,10 @@
 								</view>
 								<view class="flex-justify-space align-items-flex-end">
 									<view class="">
-										<span class="fs-24 fw-400 fc-FB3D03">¥</span>
+										<span class="fs-24 fw-400 fc-3">¥</span>
 										<span
-											class="fs-40 fw-b fc-FB3D03">{{info.seckill_money>0?info.seckill_money:info.price}}</span>
+											class="fs-40 fw-b fc-3">{{info.seckill_money>0?info.seckill_money:info.price}}</span>
+											<span class="fs-24 fc-9">/份起</span>
 									</view>
 									<view class="display-flex align-items-center" v-if="info.spec_type == 1">
 										<image v-show="info.num > 0" class="wh-44" @click="addred(1,info)"
@@ -160,11 +161,11 @@
 						<view class="fs-28 fw-400 fc-9">清空</view>
 					</view>
 				</view>
-				<view class="scroll-view-css bgc-ECECEC box-border-box car-scroll-box">
-					<view class="buy-card-item bgc-f b-rad-20 display-flex p-20 box-border-box"
+				<view class="scroll-view-css bgc-f box-border-box car-scroll-box">
+					<view class="buy-card-item b-rad-20 align-items-flex-start box-border-box"
 						v-for="(goods,i) in cartData.goods_list" :key="i">
 						<image class="goods_img flex-shrink0" :src="goods.goods_image" mode="scaleToFill"></image>
-						<view class="flex-1 flex-direction flex-justify-space">
+						<view class="flex-1 flex-direction flex-justify-space min-h b-b-2-F9F9F9 pb-24">
 							<view class="">
 								<view class="w-514 text-overflow-ellipsis-one fs-34 fw-600 mb-8">
 									{{goods.goods_name}}
@@ -174,9 +175,10 @@
 								</view>
 							</view>
 							<view class="flex-justify-space">
-								<view class="">
-									<span class="fs-24 fc-FB3D03 fw-400">¥</span>
-									<span class="fs-40 fc-FB3D03 fw-b">{{goods.price}}</span>
+								<view class="align-items-baseline">
+									<view class="fs-24 fc-3 fw-400">¥</view>
+									<priceDisplay :value="goods.price"></priceDisplay>
+									<!-- <span class="">{{goods.price}}</span> -->
 								</view>
 								<view class="display-flex align-items-center">
 									<image class="wh-44" @click.stop="setShoppingSave(goods,2)"
@@ -195,8 +197,7 @@
 						message="快去选购商品吧!~"></en-blank>
 				</view>
 				<view class="pop-shop-buttom-money box-border-box" @click="openBuyCrad()">
-					<view
-						class="shop-buttom-money-1 bgc-f flex-justify-space align-items-center pl-24 box-border-box pr-8 b-rad-200">
+					<view class="shop-buttom-money-1 bgc-f flex-justify-space align-items-center pl-24 box-border-box pr-8 b-rad-200">
 						<view class="align-items-center">
 							<image class="gwc-img mr-36" src="@/static/img/order-food/gwc-img.png" mode="scaleToFill">
 							</image>
@@ -219,6 +220,7 @@
 </template>
 
 <script>
+	import priceDisplay from '@/components/price-display.vue';
 	import ShopInfo from './shop-mod/info.vue';
 	import tools from "@/service/tools";
 	import EnBlank from "@/components/en-utils/en-blank/en-blank";
@@ -244,7 +246,8 @@
 	export default {
 		components: {
 			ShopInfo,
-			EnBlank
+			EnBlank,
+			priceDisplay,
 		},
 		data() {
 			return {
@@ -622,6 +625,9 @@
 </script>
 
 <style scoped lang="scss">
+	.min-h{
+		min-height: 152rpx;
+	}
 	.car-scroll-box {
 		padding: 12rpx 24rpx calc(env(safe-area-inset-bottom) + 48rpx);
 	}
@@ -824,7 +830,7 @@
 	.pop-shop-buttom-money {
 		width: 100%;
 		// height: 140rpx;
-		background: #ECECEC;
+		background: #fff;
 		padding-left: 24rpx;
 		padding-right: 24rpx;
 		padding-bottom: calc(env(safe-area-inset-bottom) + 12rpx);
@@ -836,10 +842,11 @@
 	}
 
 	.shop-buttom-num {
-		width: 32rpx;
+		// width: 32rpx;
 		height: 32rpx;
 		line-height: 32rpx;
-		border-radius: 50%;
+		border-radius: 20rpx;
+		padding: 0 10rpx;
 		position: absolute;
 		top: 0rpx;
 		left: 85rpx;
@@ -887,6 +894,7 @@
 
 	.buy-card-item {
 		width: 100%;
+		padding: 20rpx 20rpx 0;
 		// height: 176rpx;
 		margin-bottom: 32rpx;
 	}
@@ -902,6 +910,7 @@
 		width: 100%;
 		height: 96rpx;
 		position: relative;
+		box-shadow: 0rpx 8rpx 56rpx 0rpx rgba(154, 152, 152, 0.34);
 	}
 
 	.gwc-img {
@@ -1065,8 +1074,8 @@
 		// margin-bottom: 40rpx;
 
 		.goods_img {
-			width: 200rpx;
-			height: 200rpx;
+			width: 168rpx;
+			height: 168rpx;
 			border-radius: 12rpx;
 			margin-right: 16rpx;
 		}

+ 6 - 5
pages-takeout/new-specs-info.vue

@@ -43,10 +43,10 @@
 								@click.stop="setNum(item,info,0)" mode="">
 							</image>
 							<view class="align-items-center info-text">
-								<view class="" :class="spec_key.indexOf(info.spec_id)>=0?'fc-FF3333':'fc-0'">
+								<view class="fs-28" :class="spec_key.indexOf(info.spec_id)>=0?'fc-FF3333':'fc-0'">
 									{{info.spec_name}}
 								</view>
-								<view class="" :class="spec_key.indexOf(info.spec_id)>=0?'fc-FF3333':'fc-0'"
+								<view class="fs-28" :class="spec_key.indexOf(info.spec_id)>=0?'fc-FF3333':'fc-0'"
 									v-if="info.spec_price && item.affect_quantity != 0">
 									¥{{info.spec_price}}
 								</view>
@@ -71,7 +71,7 @@
 						</view>
 					</view>
 					<view class="fs-24 fc-9">
-						{{spec_text}}
+						{{spec_text || '请选择规格'}}
 					</view>
 				</view>
 				<view class="align-items-center">
@@ -109,7 +109,7 @@
 				specsData: [],
 				spec_key: [],
 				total_price: 0,
-				spec_text: '请选择规格',
+				spec_text: '',
 				postData: {
 					goods_id: '',
 					category_id: '',
@@ -187,7 +187,8 @@
 				if (specArray.length > 0) {
 					this.spec_text = specArray.join('、');
 				} else {
-					this.spec_text = '请选择规格';
+					// this.spec_text = '请选择规格';
+					this.spec_text = '';
 				}
 				this.$forceUpdate();
 			},

+ 23 - 23
pages-takeout/shop-mod/info.vue

@@ -4,19 +4,19 @@
 			<view class="fs-32 fw-500 mb-32">商家信息</view>
 			<view class="mb-40 align-items-center">
 				<image src="@/static/img/takeout/info-address.png" mode=""></image>
-				<view class="fs-28 fw-400">{{shopInfoData.city_name}}{{shopInfoData.shop_name}}</view>
+				<view class="fs-28 fw-400">{{shopInfoData.city_name || ''}}{{shopInfoData.shop_name || ''}}</view>
 			</view>
 <!-- 			<view class="mb-40 align-items-center">
 				<image src="@/static/img/takeout/info-class.png" mode=""></image>
 				<view class="fs-28 fw-400">门店类目:{{shopInfoData.cate_name}}</view>
 			</view> -->
-			<view class="mb-40 align-items-center">
+<!-- 			<view class="mb-40 align-items-center">
 				<image src="@/static/img/takeout/info-time.png" mode=""></image>
-				<view class="fs-28 fw-400">营业时间:{{timeData}}</view>
-			</view>
+				<view class="fs-28 fw-400">营业时间:{{timeData || '暂无'}}</view>
+			</view> -->
 			<view class="align-items-center">
 				<image src="@/static/img/takeout/info-phone.png" mode=""></image>
-				<view class="fs-28 fw-400">联系电话:{{shopInfoData.shop_phone}} </view>
+				<view class="fs-28 fw-400">联系电话:{{shopInfoData.shop_phone || ''}} </view>
 			</view>
 <!-- 			<view class="right-img-f align-items-center" @click.stop="to()">
 				<image src="@/static/img/takeout/info-zz.png" mode=""></image>
@@ -66,24 +66,24 @@
 				}).then((res) => {
 					if (res.code == 1) {
 						this.shopInfoData = res.data
-						res.data.business_hours.forEach((v, k) => {
-							// let time =
-							v.forEach((i, j) => {
-								let time = ''
-								if (j == 0 || j == 3) {
-									time = i + '-'
-								} else {
-									time = i
-								}
-								this.array = this.array + time
-							})
-							if (res.data.business_hours.length === k + 1) {
-								this.timeData = this.timeData + this.array
-							} else {
-								this.timeData = this.timeData + this.array + ','
-							}
-							this.array = ''
-						})
+						// res.data.business_hours.forEach((v, k) => {
+						// 	// let time =
+						// 	v.forEach((i, j) => {
+						// 		let time = ''
+						// 		if (j == 0 || j == 3) {
+						// 			time = i + '-'
+						// 		} else {
+						// 			time = i
+						// 		}
+						// 		this.array = this.array + time
+						// 	})
+						// 	if (res.data.business_hours.length === k + 1) {
+						// 		this.timeData = this.timeData + this.array
+						// 	} else {
+						// 		this.timeData = this.timeData + this.array + ','
+						// 	}
+						// 	this.array = ''
+						// })
 					}
 				})
 			}

+ 1 - 1
pages/index/index.vue

@@ -1,5 +1,5 @@
 <template>
-	<view class="flex-common-css">
+	<view class="flex-common-css bgc-F5F4F9">
 		<Nav :leftShow='false' :customNav='true' title="" bgckgroundBox='#EF1F0C'></Nav>
 		<view class="flex-1 flex-direction iPhone-bottom box-border-box">
 			<image class="qd-bg" src="@/static/img/order-food/qd-bg.png" mode=""></image>

+ 10 - 8
pages/index/search-record.vue

@@ -18,13 +18,15 @@
 				</view>
 			</view>
 		</view>
-		<EnBlank message='暂无商品' :customSrc='true' v-if="goodsList.length <=0 && !historyType">
-			<template v-slot:blankImg>
-				<image class="<strong>black-custom-img</strong>" src="@/static/img/common/no-order.png" mode="">
-				</image>
-			</template>
-		</EnBlank>
-		<view class="scroll-view-css bgc-f seacrh-info box-border-box p-32" v-if="goodsList.length<=0 && historyType">
+		<view class="scroll-view-css" v-if="goodsList.length <=0 && !historyType">
+			<EnBlank message='暂无商品' :customSrc='true'>
+				<template v-slot:blankImg>
+					<image class="<strong>black-custom-img</strong>" src="@/static/img/common/no-order.png" mode="">
+					</image>
+				</template>
+			</EnBlank>
+		</view>
+		<view class="scroll-view-css bgc-f seacrh-info box-border-box p-32" v-if="goodsList.length <=0 && historyType">
 			<view class="flex-justify-space mb-32">
 				<view class="fs-32 fw-600 fc-3">搜索历史</view>
 				<view class="align-items-center" v-if="list.length > 0">
@@ -41,7 +43,7 @@
 					:key="i">{{item}}</view>
 			</view>
 		</view>
-		<scroll-view scroll-y="true" class="scroll-view-css bgc-F5F4F9 p-32 box-border-box" v-else
+		<scroll-view scroll-y="true" class="scroll-view-css bgc-F5F4F9 p-32 box-border-box" v-else-if="goodsList.length > 0"
 			@scrolltolower="scrolltolower">
 			<!-- <view class="scroll-view-css bgc-F5F4F9 p-32 box-border-box" v-else> -->
 			<view class="menu-list flex-justify-space bgc-f p-24 box-border-box b-rad-20 mb-16"

+ 1 - 1
pages/order/index.vue

@@ -12,7 +12,7 @@
 
 		<scroll-view v-else :scroll-y="true" class="scroll-view-css" @scrolltolower="scrolltolower">
 			<view class="list-box p-20 box-border-box">
-				<view class="list-item bgc-f b-rad-20 mb-32 p-24 box-border-box" v-for="(item,index) in list"
+				<view class="list-item bgc-f b-rad-20 mb-20 p-24 box-border-box" v-for="(item,index) in list"
 					@click="goToInfo(item)">
 					<view class="align-items-center flex-justify-space mb-24">
 						<view class="align-items-center">