ext.liuqiwen3 hace 1 día
padre
commit
9064859c9c

+ 2 - 2
components/goodList/index.vue

@@ -11,14 +11,14 @@
 				<view class='underline'>
 					<view class='text'>
 						<view class='line1'>{{item.storeName}}</view>
-						<view class='money font-color'>¥<text class='num'>{{item.price}}</text></view>
+						<view class='money font-color'>¥<text class='num'>{{item.totalPrice}}</text></view>
 						<view class='vip-money acea-row row-middle' v-if="item.vip_price && item.vip_price > 0">¥{{item.vip_price || 0}}
 							<image src='/static/images/vip.png'></image><text class='num'>已售{{Number(item.sales) + Number(item.ficti) || 0}}{{item.unitName}}</text>
 						</view>
 						<view class='vip-money acea-row row-middle' v-else><text class='num'>已售{{Number(item.sales) + Number(item.ficti) || 0}}{{item.unitName}}</text></view>
 					</view>
 				</view>
-				<view class='iconfont icon-gouwuche cart-color acea-row row-center-wrapper'></view>
+<!--				<view class='iconfont icon-gouwuche cart-color acea-row row-center-wrapper'></view>-->
 			</view>
 		</block>
 	</view>

+ 1 - 1
config/app.js

@@ -8,7 +8,7 @@ let imgUrl = "https://sb-admin.oss-cn-shenzhen.aliyuncs.com/shuibei-mini/new-min
 
 // export const H5_BASE_URL = "http://192.168.3.10:5174"; // 本地测试
 // export const H5_BASE_URL = "http://192.168.100.35:5175"; // 本地测试
-export const H5_BASE_URL = "https://www.shuibeibyg.com/web-h5/"; // 正式环境H5地址
+export const H5_BASE_URL = "https://test.shuibeibyg.com/web-h5/"; // 正式环境H5地址
 
 // PC 后台 API 地址(用于上传图片)
 export const HTTP_ADMIN_URL = domain;

+ 5 - 6
pages/goods/goods_details/index.vue

@@ -276,9 +276,9 @@
       <view style="margin-top: 8rpx;">收藏</view>
       </button>
       <button
-          @click="listenerActionSheet"
           hover-class="none"
           class="item"
+          open-type="share"
       >
         <image src="@/static/images/share.png" style="width: 44rpx;height: 44rpx;"></image>
         <view>分享</view>
@@ -447,7 +447,7 @@ import couponListWindow from "@/components/couponListWindow";
 import productWindow from "@/components/productWindow";
 import { isTabBarPage } from "@/utils/util.js";
 import $util from "@/utils/util.js";
-import { HTTP_REQUEST_URL_SHARE } from "@/config/app.js";
+import { HTTP_REQUEST_URL_SHARE,HTTP_REQUEST_URL_IMG } from "@/config/app.js";
 import UniIcons from "../../../uni_modules/uni-icons/components/uni-icons/uni-icons.vue";
 const { Toast } = useToast();
 import {
@@ -478,7 +478,7 @@ const cart_num = ref(1);
 const isOpen = ref(false);
 const storeImage = ref("");
 const PromotionCode = ref("");
-const posterbackgd = ref("/static/images/posterbackgd.png");
+const posterbackgd = ref(`${HTTP_REQUEST_URL_IMG}setting/posterbackgd.png`);
 const sharePacket = ref({ isState: true });
 const clientHeight = ref("");
 const good_list = ref([]);
@@ -594,7 +594,6 @@ onReady(() => {
   query
     .select("#home")
     .boundingClientRect((data) => {
-      console.log(data)
       homeTop.value = menuButton.top * 2 + menuButton.height - data.height;
     })
     .exec();
@@ -663,7 +662,7 @@ const ChangeAttr = (res) => {
       cart_num: 1,
       additionalAmount: productSelect.additionalAmount,
     };
-    console.log(res);
+
     attrValue.value = res;
     attrTxt.value = "已选择";
   } else {
@@ -735,7 +734,7 @@ const getGoodsDetails = async () => {
       getImageBase64(productInfo.value.image);
       // #endif
       // #ifdef MP
-      getQrcodeFn();
+      // getQrcodeFn();
       // #endif
     }
     // nextTick(() => {

+ 36 - 2
pages/goods/goods_search/index.vue

@@ -16,7 +16,7 @@
 <!--        </block>-->
 <!--      </view>-->
       <view class='line'></view>
-      <goodList :bastList="bastList" v-if="bastList.length > 0"></goodList>
+      <goodList :bastList="calculatedProducts" v-if="bastList.length > 0"></goodList>
       <view class='loadingicon acea-row row-center-wrapper' v-if="bastList.length > 0">
         <text class='loading iconfont icon-jiazai' :hidden='loading == false'></text>{{ loadTitle }}
       </view>
@@ -31,12 +31,14 @@
 </template>
 
 <script setup>
-import { ref } from 'vue'
+import {computed, ref} from 'vue'
 import { onShow, onReachBottom,onLoad } from '@dcloudio/uni-app'
 import { getSearchKeyword, getProductslist, getProductHot } from '@/api/store.js'
 import goodList from '@/components/goodList'
 import recommend from '@/components/recommend'
 import { HTTP_REQUEST_URL_IMG } from "@/config/app";
+// 获取实时金价
+import useRealGoldPrice from "@/hooks/useRealGoldPrice";
 
 // 响应式数据
 const hostProduct = ref([])
@@ -53,6 +55,38 @@ const hotPage = ref(1)
 const isScroll = ref(true)
 const isbastList = ref(false)
 const query = ref({})
+// 实时价格处理
+const {
+  realGoldprice, // 黄金实时销售价(基础)
+  realPtprice, // 铂金实时销售价(基础)
+  realAgprice, // 白银实时销售价(基础)
+} = useRealGoldPrice({});
+
+const calculatedProducts = computed(() => {
+  // 计算逻辑与原代码一致,但基于响应式数据 products
+  return bastList.value.map((product) => {
+    // 1. 将price字符串转为数字
+    const price = Number(product.price);
+    // 2. 计算乘积
+    const total = (price + product.sales) * realGoldprice.value;
+    // 3. 向上取整到两位小数(先放大100倍取整,再缩小100倍)
+    const roundedTotal = Math.ceil(total * 100) / 100;
+    // 4. 格式化保留两位小数
+    const formattedTotal = roundedTotal.toFixed(2);
+
+    const totalLaborCost = Number(product.totalLaborCost);
+    const additionalAmount = Number(product.additionalAmount);
+    console.log(totalLaborCost)
+    console.log(additionalAmount)
+    const totalPrice = (totalLaborCost+additionalAmount).toFixed(2);
+    console.log('totalPrice',totalPrice)
+    return {
+      ...product,
+      calculatedTotal: formattedTotal, // 新增计算结果字段
+      totalPrice
+    };
+  });
+});
 
 // 获取热搜
 function getRoutineHotSearch() {

+ 0 - 2
pages/index/index.vue

@@ -248,9 +248,7 @@ const calculatedProducts = computed(() => {
 
     const totalLaborCost = Number(product.totalLaborCost);
     const additionalAmount = Number(product.additionalAmount);
-
     const totalPrice = (totalLaborCost+additionalAmount).toFixed(2);
-
     return {
       ...product,
       calculatedTotal: formattedTotal, // 新增计算结果字段

+ 0 - 3
pages/merchantCenters/components/merchant_cate.vue

@@ -68,8 +68,6 @@ const tabbarH = ref(0);
 
 // 获取分类列表
 const getAllCategory = async () => {
-  console.log('============')
-  console.log(props.merchantId)
   try {
     let obj = {
       type: 1,
@@ -144,7 +142,6 @@ const scroll = (e) => {
 };
 // 监听 merchantId 变化
 watch(() => props.merchantId, (newVal) => {
-  console.log('merchantId 变化了:', newVal);
   if (newVal) {
     getAllCategory();
   }

+ 5 - 7
pages/merchantCenters/releaseProduct.vue

@@ -99,7 +99,6 @@
                   await afterRead(e);
                   getImage();
                 }"
-                capture="album"
                 @delete="onPreviewImageDelete"
                 name="preview"
                 max-count="1"
@@ -295,8 +294,6 @@
                 @delete="onProductImageGgDelete"
                 name="productGg"
                 :maxCount="1"
-                :maxSize="5 * 1024 * 1024"
-                accept=".png,.jpg,.jpeg"
             >
               <view class="upload-btn">
                 <up-icon name="plus" size="20" color="#ccc"></up-icon>
@@ -552,7 +549,7 @@ onLoad(async (options)=>{
 async function getProductCategory(){
   let obj = {
     type: 1,
-    status: -1
+    status: 1
   }
   try {
     const { data } = await productCategory(obj)
@@ -788,6 +785,7 @@ async function getImage() {
   if (imageList.value.length > 0) {
     if (imageList.value[0].status == "success") {
       previewImages.value = imageList.value;
+      console.log('previewImages.value',previewImages.value)
       // change();
     } else {
       Toast({ title: "上传失败" });
@@ -921,8 +919,8 @@ const submitForm = async () => {
       ...formData.value
     };
     submitData.cateId =formData.value.categoryIds.join(',');
-    submitData.image =previewImages.value[0].url;
-    const urlString = JSON.stringify(productImages.value.map(item => item.url));
+    submitData.image =previewImages.value[0].info.url;
+    const urlString = JSON.stringify(productImages.value.map(item => item.info.url));
     submitData.sliderImage =urlString;
     submitData.merchantId =parseInt(merchantInfo.id);
     submitData.specType = 0;
@@ -939,7 +937,7 @@ const submitForm = async () => {
         additionalAmount :formData.value.additionalFee,
         attrValue:"{\"规格\":\"默认\"}",
         barCode : formData.value.barCode,
-        image : productImagesGg.value[0].url,
+        image : productImagesGg.value[0].info.url,
         price : formData.value.laborCost,
         stock : formData.value.stock,
         weight :formData.value.weight

+ 1 - 0
pages/user/index.vue

@@ -244,6 +244,7 @@ onShow(async () => {
   if(appStore.isLogin){
     await appStore.USERINFO();
     logoutShow.value = true;
+    wallet.value.balance = appStore.userInfo?.nowMoney || '0.00';
     if(appStore.userInfo?.merchant?.id){
       merchantZYShow.value = true;
     }else{

+ 0 - 2
pages/users/personal_info/personal_info.vue

@@ -90,7 +90,6 @@
         :showWordLimit="true"
         v-model="userInfo.age"
         inputAlign="right"
-        @blur="change"
       ></up-input>
     </view>
     <view class="flex-center-between personal-info-item">
@@ -106,7 +105,6 @@
         :showWordLimit="true"
         v-model="userInfo.mark"
         inputAlign="right"
-        @blur="change"
       ></up-input>
     </view>
 <!--    <view-->

BIN
static/images/posterbackgd.png