From d49221bcb47d2a3fc2dfe5950b0c0b4bce0fb2af Mon Sep 17 00:00:00 2001
From: zmj <1493694146@qq.com>
Date: Sat, 22 Jun 2024 11:27:11 +0800
Subject: [PATCH] add

---
 components/goodPopup.vue     | 281 ++++++++++++++++++-----------------
 pages/index/index.vue        |  13 +-
 pagesOrder/settle/settle.vue |   2 +-
 3 files changed, 153 insertions(+), 143 deletions(-)

diff --git a/components/goodPopup.vue b/components/goodPopup.vue
index 533e110..5372a72 100644
--- a/components/goodPopup.vue
+++ b/components/goodPopup.vue
@@ -1,160 +1,165 @@
 <template>
-    <up-popup :show="show" closeable round="10" @close="close" :safeAreaInsetBottom="false">
-        <view class="good-popup">
-            <view class="head-title">
-                {{datas.is_bulk ? '称重商品' : '计件商品'}}
-            </view>
-            <view class="row">
-                <view>商品名称</view>
-                <view>{{datas.name || datas.goods_name || datas.store_name}}</view>
-            </view>
-            <view class="row">
-                <view>商品单位</view>
-                <view>{{datas.unit_name}}</view>
-            </view>
-            <view class="row">
-                <view>商品价格</view>
-                <view>¥ {{datas.price}}</view>
-            </view>
-            <view class="row">
-                <view>小计</view>
-                <view style="color: #F55726;" v-if="+datas.cart_num<+datas.batch">
-                    {{`${datas.batch}${datas.unit_name}起批`}}
-                </view>
-                <view style="color: #F55726;" v-else>¥ {{subtotal}}</view>
-            </view>
-            <view v-if="datas.is_bulk" class="row">
-                <view>购买重量<text style="color: #F55726;">*</text></view>
-                <view style="flex: 1;">
-                    <up-input v-model="datas.cart_num" :cursorSpacing='120' type="digit" border="none"
-                        placeholder="请输入购买重量" inputAlign="right"></up-input>
-                </view>
-            </view>
-            <view v-else class="row">
-                <view>购买数量<text style="color: #F55726;">*</text></view>
-                <view style="flex: 1;">
-                    <up-input v-model="datas.cart_num" :cursorSpacing='120' type="digit" border="none"
-                        placeholder="请输入购买数量" inputAlign="right">
-                        <template #suffix>
-                            <span style="color: #20b128;">{{datas.unit_name}}</span>
-                        </template>
-                    </up-input>
-                </view>
-            </view>
-            <view class="row" style="padding-top: 30px;padding-bottom: 30rpx;">
-                <view style="width: 30%;margin-right: 30rpx;">
-                    <up-button @click="close" color="#f7f7f7"><text style="color: #333;">取消</text></up-button>
-                </view>
-                <view style="flex: 1;">
-                    <up-button @click="change" color="#20b128">确定</up-button>
-                </view>
-            </view>
-        </view>
-    </up-popup>
+	<up-popup :show="show" closeable round="10" @close="close" :safeAreaInsetBottom="false">
+		<view class="good-popup">
+			<view class="head-title">
+				{{datas.is_bulk ? '称重商品' : '计件商品'}}
+			</view>
+			<view class="row">
+				<view>商品名称</view>
+				<view>{{datas.name || datas.goods_name || datas.store_name}}</view>
+			</view>
+			<view class="row">
+				<view>商品单位</view>
+				<view>{{datas.unit_name}}</view>
+			</view>
+			<view class="row">
+				<view>商品价格</view>
+				<view>¥ {{datas.price}} / {{datas.unit_name }}</view>
+			</view>
+			<view class="row" v-if="datas.batch>0">
+				<view>起批量</view>
+				<view>{{datas.batch}}{{datas.unit_name }}起批 </view>
+			</view>
+
+			<view class="row">
+				<view>小计</view>
+				<view style="color: #F55726;" v-if="+datas.cart_num<+datas.batch">
+					{{`${datas.batch}${datas.unit_name}起批`}}
+				</view>
+				<view style="color: #F55726;" v-else>¥ {{subtotal}}</view>
+			</view>
+			<view v-if="datas.is_bulk" class="row">
+				<view>购买重量<text style="color: #F55726;">*</text></view>
+				<view style="flex: 1;">
+					<up-input v-model="datas.cart_num" :cursorSpacing='120' type="digit" border="none"
+						placeholder="请输入购买重量" inputAlign="right"></up-input>
+				</view>
+			</view>
+			<view v-else class="row">
+				<view>购买数量<text style="color: #F55726;">*</text></view>
+				<view style="flex: 1;">
+					<up-input v-model="datas.cart_num" :cursorSpacing='120' type="digit" border="none"
+						placeholder="请输入购买数量" inputAlign="right">
+						<template #suffix>
+							<span style="color: #20b128;">{{datas.unit_name}}</span>
+						</template>
+					</up-input>
+				</view>
+			</view>
+			<view class="row" style="padding-top: 30px;padding-bottom: 30rpx;">
+				<view style="width: 30%;margin-right: 30rpx;">
+					<up-button @click="close" color="#f7f7f7"><text style="color: #333;">取消</text></up-button>
+				</view>
+				<view style="flex: 1;">
+					<up-button @click="change" color="#20b128">确定</up-button>
+				</view>
+			</view>
+		</view>
+	</up-popup>
 </template>
 
 <script setup>
-    import {
-        computed,
-        ref
-    } from "vue"
-    import {
-        toast
-    } from "../uni_modules/uview-plus";
+	import {
+		computed,
+		ref
+	} from "vue"
+	import {
+		toast
+	} from "../uni_modules/uview-plus";
 
-    const props = defineProps({
-        show: {
-            type: Boolean,
-            default: false
-        },
-    })
+	const props = defineProps({
+		show: {
+			type: Boolean,
+			default: false
+		},
+	})
 
-    const datas = ref({
-        cart_num: ''
-    });
-    const setData = (e) => {
-        datas.value = e;
-        if (Number(e.batch) > 0) datas.value.cart_num = e.batch;
-        else datas.value.cart_num = '';
-        
-    }
+	const datas = ref({
+		cart_num: ''
+	});
+	const setData = (e) => {
+		datas.value = e;
+		if (Number(e.batch) > 0) datas.value.cart_num = e.batch;
+		else datas.value.cart_num = '';
 
-    const emit = defineEmits(['close', 'change']);
-    const close = () => {
-        emit('close');
-    }
+	}
 
-    const change = () => {
-        if (+datas.value.cart_num < +datas.value.batch) return uni.$u.toast(
-            `购买数量不能小于${datas.value.batch}${datas.value.unit_name}`);
-        if (subtotal.value <= 0) {
-            uni.$u.toast('金额不可小于等于0');
-            datas.value.cart_num = '';
-            return;
-        }
-        emit('change', datas.value);
-    }
+	const emit = defineEmits(['close', 'change']);
+	const close = () => {
+		emit('close');
+	}
 
-    const subtotal = computed(() => {
-        let num = +datas.value.cart_num || 0;
-        let sell = +datas.value.sell || +datas.value.price;
-        return Number(num * sell * 100 / 100).toFixed(2)
-    })
+	const change = () => {
+		if (+datas.value.cart_num < +datas.value.batch) return uni.$u.toast(
+			`购买数量不能小于${datas.value.batch}${datas.value.unit_name}`);
+		if (subtotal.value <= 0) {
+			uni.$u.toast('金额不可小于等于0');
+			datas.value.cart_num = '';
+			return;
+		}
+		emit('change', datas.value);
+	}
 
-    defineExpose({
-        setData
-    })
+	const subtotal = computed(() => {
+		let num = +datas.value.cart_num || 0;
+		let sell = +datas.value.sell || +datas.value.price;
+		return Number(num * sell * 100 / 100).toFixed(2)
+	})
+
+	defineExpose({
+		setData
+	})
 </script>
 
 <style scoped lang="scss">
-    .good-popup {
-        padding: 30rpx;
+	.good-popup {
+		padding: 30rpx;
 
-        .head-title {
-            font-weight: bold;
-            text-align: center;
-            margin-bottom: 20rpx;
-        }
+		.head-title {
+			font-weight: bold;
+			text-align: center;
+			margin-bottom: 20rpx;
+		}
 
-        .row {
-            display: flex;
-            align-items: center;
-            justify-content: space-between;
-            padding-bottom: 20rpx;
-            border-bottom: 1rpx solid #f6f6f6;
-            margin-bottom: 20rpx;
+		.row {
+			display: flex;
+			align-items: center;
+			justify-content: space-between;
+			padding-bottom: 20rpx;
+			border-bottom: 1rpx solid #f6f6f6;
+			margin-bottom: 20rpx;
 
-            &:last-child {
-                border-bottom: none;
-                margin-bottom: 0;
-            }
+			&:last-child {
+				border-bottom: none;
+				margin-bottom: 0;
+			}
 
-            .content {
-                .top {
-                    display: flex;
+			.content {
+				.top {
+					display: flex;
 
-                    view {
-                        margin-right: 20rpx;
-                    }
-                }
+					view {
+						margin-right: 20rpx;
+					}
+				}
 
-                .bottom {}
-            }
+				.bottom {}
+			}
 
-            image {
-                width: 40rpx;
-                height: 40rpx;
-                flex-shrink: 0;
-            }
-        }
-    }
+			image {
+				width: 40rpx;
+				height: 40rpx;
+				flex-shrink: 0;
+			}
+		}
+	}
 
-    @keyframes disappear {
-        to {
-            opacity: 0;
-            /* 渐隐 */
-            transform: scale(0);
-            /* 缩小 */
-        }
-    }
+	@keyframes disappear {
+		to {
+			opacity: 0;
+			/* 渐隐 */
+			transform: scale(0);
+			/* 缩小 */
+		}
+	}
 </style>
\ No newline at end of file
diff --git a/pages/index/index.vue b/pages/index/index.vue
index 7e4c2c4..519c0cc 100644
--- a/pages/index/index.vue
+++ b/pages/index/index.vue
@@ -144,12 +144,17 @@
 									<text>{{item.spec}}</text>
 								</view>
 							</view>
-							<view style="display: flex;" v-if='userStore?.userInfo?.user_ship==1'>
-								<view class="price" style="margin-right: 10rpx;">¥{{item.vip_price}}</view>
-								<text class='price'>会员价</text>
+							<view style="display: flex;" v-if='item.batch>0'>
+								<view>{{item.batch}}{{item.unit_name }}起卖</view>
+							</view>
+							<view style="display: flex;align-items: center;" v-if='userStore?.userInfo?.user_ship==1'>
+								<text class='price' style="font-size: 24rpx;">会员价¥</text>
+								<text class="price" style="margin-right: 10rpx;">{{item.vip_price}}
+								</text>
+								<text class='price' style="font-size: 24rpx;">/{{item.unit_name}}</text>
 							</view>
 							<view class="price-btn">
-								<view class="price" style="font-size: 24rpx;">¥{{item.price}}</view>
+								<view class="price" style="font-size: 24rpx;">¥{{item.price}}/{{item.unit_name}}</view>
 								<view class="btn">
 									<u--icon name="plus-circle-fill" size="20" color="#20b128"></u--icon>
 								</view>
diff --git a/pagesOrder/settle/settle.vue b/pagesOrder/settle/settle.vue
index cbc529a..4dc095a 100644
--- a/pagesOrder/settle/settle.vue
+++ b/pagesOrder/settle/settle.vue
@@ -67,7 +67,7 @@
 			<view class="row" v-if="[4,5,6].includes(userInfo.user_ship)" style="color: red;">
 				<view>优惠减免</view>
 				<view>
-					<text>-¥</text>{{ c_price(orderInfo.preferential_amount, 0) }}<text>.{{ c_price(orderInfo.preferential_amount, 1) }}</text>
+					<text>-¥</text>{{ c_price(orderInfo.activity_price, 0) }}<text>.{{ c_price(orderInfo.activity_price, 1) }}</text>
 				</view>
 			</view>
 			<view class="row" v-if="userInfo.user_ship==1 ">