Browse Source

Merge remote-tracking branch 'remotes/origin/dev_v3_lqw' into dev_v3_zb

ext.zhangbin71 1 ngày trước cách đây
mục cha
commit
201740b236

+ 1 - 2
components/productWindow/index.vue

@@ -25,7 +25,7 @@
             >附加费: {{ attr.productSelect.additionalAmount || "0" }}元</text
             >附加费: {{ attr.productSelect.additionalAmount || "0" }}元</text
             >
             >
           </view>
           </view>
-          <view class="font-color" >
+          <view class="font-color" style="display: flex;align-items: center;margin-top: 24rpx;" >
             <view class="carnum acea-row row-left">
             <view class="carnum acea-row row-left">
               <view
               <view
                   class="item reduce"
                   class="item reduce"
@@ -409,7 +409,6 @@ function getCheckedValue() {
   }
   }
   .carnum {
   .carnum {
     height: 54rpx;
     height: 54rpx;
-    margin-top: 24rpx;
     border: 2rpx solid #DCDFE6;
     border: 2rpx solid #DCDFE6;
     display: inline-flex;
     display: inline-flex;
 
 

+ 1 - 1
pages.json

@@ -20,7 +20,7 @@
 		{
 		{
 			"path": "pages/mall/dapan",
 			"path": "pages/mall/dapan",
 			"style": {
 			"style": {
-				"navigationBarBackgroundColor": "#000000",
+				"navigationBarBackgroundColor": "#ffe079",
 				"navigationBarTextStyle": "white",
 				"navigationBarTextStyle": "white",
 				"navigationBarTitleText": "大盘"
 				"navigationBarTitleText": "大盘"
 			}
 			}

+ 4 - 2
pages/goods/goods_details/index.vue

@@ -124,7 +124,7 @@
               <!-- 材质和克重行 -->
               <!-- 材质和克重行 -->
               <view class="material-row">
               <view class="material-row">
                 <view class="material-item" style="width: 60rpx;">
                 <view class="material-item" style="width: 60rpx;">
-                  <image style="width: 40rpx;" src="@/static/images/order.png" mode="widthFix"></image>
+                  <image style="width: 40rpx;height: 40rpx;" src="@/static/images/order.png" mode="widthFix"></image>
                 </view>
                 </view>
                 <view class="material-item">
                 <view class="material-item">
                   <text class="material-value">{{ metalTypeFormatter(productInfo.metalType) }}</text>
                   <text class="material-value">{{ metalTypeFormatter(productInfo.metalType) }}</text>
@@ -159,7 +159,7 @@
               <!-- 规格选择区域 -->
               <!-- 规格选择区域 -->
               <view class="spec-section">
               <view class="spec-section">
                 <view style="width: 60rpx;text-align: center;">
                 <view style="width: 60rpx;text-align: center;">
-                  <image style="width: 40rpx;" src="@/static/images/2-001.png" mode="widthFix"></image>
+                  <image style="width: 40rpx;height: 40rpx;" src="@/static/images/2-001.png" mode="widthFix"></image>
                 </view>
                 </view>
                   <view class="spec-info">
                   <view class="spec-info">
                   <view class="spec-label">请选择规格</view>
                   <view class="spec-label">请选择规格</view>
@@ -1305,10 +1305,12 @@ function setCollect () {
     if (userCollect.value) {
     if (userCollect.value) {
       collectDel(productInfo.value.id).then(res => {
       collectDel(productInfo.value.id).then(res => {
         userCollect.value = !userCollect.value;
         userCollect.value = !userCollect.value;
+        uni.showToast({title:'取消收藏成功',icon:'none'})
       })
       })
     } else {
     } else {
       collectAdd(productInfo.value.id).then(res => {
       collectAdd(productInfo.value.id).then(res => {
         userCollect.value = !userCollect.value;
         userCollect.value = !userCollect.value;
+        uni.showToast({title:'收藏成功',icon:'none'})
       })
       })
     }
     }
   }
   }

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

@@ -78,7 +78,7 @@ function getProductList() {
     bastList.value = (bastList.value || []).concat(list)
     bastList.value = (bastList.value || []).concat(list)
     loading.value = false
     loading.value = false
     loadend.value = isLoadend
     loadend.value = isLoadend
-    loadTitle.value = isLoadend ? "😕人家是有底线的~~" : "加载更多"
+    loadTitle.value = isLoadend ? "我是有底线的" : "加载更多"
     page.value += 1
     page.value += 1
     isbastList.value = true
     isbastList.value = true
   }).catch(() => {
   }).catch(() => {
@@ -134,7 +134,7 @@ onShow(() => {
 })
 })
 onLoad((options)=>{
 onLoad((options)=>{
   query.value = options || {};
   query.value = options || {};
-  if(options){
+  if(options && options.cid){
     getProductList()
     getProductList()
   }
   }
 })
 })

+ 9 - 9
pages/goods_cate/goods_cate.vue

@@ -4,7 +4,7 @@
       <view class='acea-row row-between-wrapper input'>
       <view class='acea-row row-between-wrapper input'>
         <text class='iconfont icon-sousuo'></text>
         <text class='iconfont icon-sousuo'></text>
         <input type='text' placeholder='点击搜索商品信息' @confirm="searchSubmitValue" confirm-type='search' name="search"
         <input type='text' placeholder='点击搜索商品信息' @confirm="searchSubmitValue" confirm-type='search' name="search"
-               placeholder-class='placeholder'></input>
+               placeholder-class='placeholder' @focus="searchSubmitValue"></input>
       </view>
       </view>
     </view>
     </view>
     <view class='aside' :style="{bottom: tabbarH + 'px',height: height + 'rpx'}">
     <view class='aside' :style="{bottom: tabbarH + 'px',height: height + 'rpx'}">
@@ -68,7 +68,7 @@ const getAllCategory = async () => {
   try {
   try {
     let obj = {
     let obj = {
       type: 1,
       type: 1,
-      status: -1
+      status: 1
     }
     }
     const { data }= await productCategory(obj);
     const { data }= await productCategory(obj);
     const newArr = []
     const newArr = []
@@ -76,8 +76,8 @@ const getAllCategory = async () => {
       newArr[index] = value
       newArr[index] = value
       if (value.child) newArr[index].child = value.child.filter(item => item.status === true)
       if (value.child) newArr[index].child = value.child.filter(item => item.status === true)
     })
     })
-    productList.value = newArr.filter(item => item.code !== 'bb_mall')
-
+    let listArr = newArr.filter(item => item.code !== 'bb_mall')
+    productList.value = listArr.sort((a, b) => a.sort - b.sort);
     if(query.value.id){
     if(query.value.id){
       const index = productList.value.findIndex(item => item.id === query.value.id);
       const index = productList.value.findIndex(item => item.id === query.value.id);
       tap(index,query.value.id)
       tap(index,query.value.id)
@@ -155,15 +155,15 @@ const scroll = (e) => {
 const searchSubmitValue = (e) => {
 const searchSubmitValue = (e) => {
   const searchValue = e.detail.value?.trim();
   const searchValue = e.detail.value?.trim();
 
 
-  if (!searchValue) {
-    return uni.showToast({ title: '请填写要搜索的产品信息' });
-  }
+  // if (!searchValue) {
+  //   return uni.showToast({ title: '请填写要搜索的产品信息' });
+  // }
 
 
-  if (searchValue.length > 0) {
+  // if (searchValue.length > 0) {
     uni.navigateTo({
     uni.navigateTo({
       url: '/pages/goods/goods_search/index?keyword=' + searchValue
       url: '/pages/goods/goods_search/index?keyword=' + searchValue
     });
     });
-  }
+  // }
 };
 };
 
 
 // 页面加载
 // 页面加载

+ 13 - 4
pages/index/index.vue

@@ -136,7 +136,7 @@
                   </text>
                   </text>
                   <!-- <view class="txt">券</view> -->
                   <!-- <view class="txt">券</view> -->
                 </view>
                 </view>
-                <template v-if="item?.merchant?.id && (appStore.userInfo && !appStore.userInfo.merchant)">
+                <template v-if="item?.merchant?.id &&(!appStore.userInfo || (appStore.userInfo && !appStore.merchantId))">
                   <view class="merchantInfo" @click.stop="toMerchant(item.merchant.id)">
                   <view class="merchantInfo" @click.stop="toMerchant(item.merchant.id)">
                     <image class="merchantLogo" :src="item.merchant.merchantLogo" mode="scaleToFill"></image>
                     <image class="merchantLogo" :src="item.merchant.merchantLogo" mode="scaleToFill"></image>
                     <text class="merchantName">{{item.merchant.merchantName}}</text>
                     <text class="merchantName">{{item.merchant.merchantName}}</text>
@@ -194,6 +194,8 @@ import {
 } from "@/api/store.js";
 } from "@/api/store.js";
 import { timeFormat } from "@/uni_modules/uview-plus";
 import { timeFormat } from "@/uni_modules/uview-plus";
 import UniIcons from "../../uni_modules/uni-icons/components/uni-icons/uni-icons.vue";
 import UniIcons from "../../uni_modules/uni-icons/components/uni-icons/uni-icons.vue";
+import { getSceneInfo } from '@/utils/util.js';
+import { toLogin } from "@/libs/login.js";
 // 获取实时金价
 // 获取实时金价
 // 实时价格处理
 // 实时价格处理
 const {
 const {
@@ -255,7 +257,10 @@ const calculatedProducts = computed(() => {
     };
     };
   });
   });
 });
 });
+onLoad(async (options) => {
+  const params = await getSceneInfo(options,'index');
 
 
+});
 onShow(() => {
 onShow(() => {
   const isLogin = appStore.isLogin;
   const isLogin = appStore.isLogin;
   if(isLogin){
   if(isLogin){
@@ -264,19 +269,23 @@ onShow(() => {
   }
   }
 
 
   uni.setNavigationBarTitle({ title: site_name.value });
   uni.setNavigationBarTitle({ title: site_name.value });
+
   if(appStore.merchantId && appStore.merchantId!=''){
   if(appStore.merchantId && appStore.merchantId!=''){
     merchantId.value = appStore.merchantId;
     merchantId.value = appStore.merchantId;
+    if(!isLogin){
+      toLogin();
+    }
   }else if(appStore?.userInfo?.merchant && appStore?.userInfo?.merchant.id){
   }else if(appStore?.userInfo?.merchant && appStore?.userInfo?.merchant.id){
     merchantId.value = appStore.userInfo.merchant.id
     merchantId.value = appStore.userInfo.merchant.id
   }else{
   }else{
     merchantId.value = '';
     merchantId.value = '';
   }
   }
-
-
   if(merchantId.value && merchantId.value!=''){
   if(merchantId.value && merchantId.value!=''){
+    console.log('++++++++++++++++')
     getSbmerchantInfoFn();
     getSbmerchantInfoFn();
     getMerchantBannerListFn()
     getMerchantBannerListFn()
   }else{
   }else{
+    console.log('+++++===============')
     getIndexConfig();
     getIndexConfig();
   }
   }
   getGroomList();
   getGroomList();
@@ -456,7 +465,7 @@ onReachBottom(() => {
 });
 });
 // Product Details
 // Product Details
 const goDetail = async (item) => {
 const goDetail = async (item) => {
-  await goShopDetail(item, uid);
+  // await goShopDetail(item, uid);
   uni.navigateTo({ url: `/pages/goods/goods_details/index?id=${item.id}` });
   uni.navigateTo({ url: `/pages/goods/goods_details/index?id=${item.id}` });
 };
 };
 function getAllCategory () {
 function getAllCategory () {

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

@@ -68,7 +68,7 @@ const getAllCategory = async () => {
   try {
   try {
     let obj = {
     let obj = {
       type: 1,
       type: 1,
-      status: -1
+      status: 1
     }
     }
     const { data }= await productCategory(obj);
     const { data }= await productCategory(obj);
     const newArr = []
     const newArr = []
@@ -76,7 +76,8 @@ const getAllCategory = async () => {
       newArr[index] = value
       newArr[index] = value
       if (value.child) newArr[index].child = value.child.filter(item => item.status === true)
       if (value.child) newArr[index].child = value.child.filter(item => item.status === true)
     })
     })
-    productList.value = newArr.filter(item => item.code !== 'bb_mall')
+    let listArr = newArr.filter(item => item.code !== 'bb_mall')
+    productList.value = listArr.sort((a, b) => a.sort - b.sort);
 
 
     // 使用 nextTick 确保 DOM 已更新
     // 使用 nextTick 确保 DOM 已更新
     nextTick(() => {
     nextTick(() => {

+ 10 - 2
pages/merchantCenters/merchant.vue

@@ -101,6 +101,10 @@ import { onLoad, onShow, onReachBottom } from "@dcloudio/uni-app";
 import { getSbmerchantInfo } from "@/api/merchant.js";
 import { getSbmerchantInfo } from "@/api/merchant.js";
 import merchantCate from "./components/merchant_cate.vue"
 import merchantCate from "./components/merchant_cate.vue"
 import { getGroomList as getGroomListApi, } from "@/api/store.js";
 import { getGroomList as getGroomListApi, } from "@/api/store.js";
+import { footprintScan } from "@/api/merchant.js";
+import { useAppStore } from "@/stores/app";
+const appStore = useAppStore();
+
 // 获取实时金价
 // 获取实时金价
 import useRealGoldPrice from "@/hooks/useRealGoldPrice";
 import useRealGoldPrice from "@/hooks/useRealGoldPrice";
 // 实时价格处理
 // 实时价格处理
@@ -158,10 +162,15 @@ onLoad((options) => {
 onReachBottom(() => {
 onReachBottom(() => {
   getGroomList();
   getGroomList();
 });
 });
-const getSbmerchantInfoFn = () => {
+const getSbmerchantInfoFn = async () => {
   let data = {
   let data = {
     merchantId:query.value.merchantId
     merchantId:query.value.merchantId
   }
   }
+  let obj ={
+    merchantId:query.value.merchantId,
+    userId:appStore.userInfo.userId
+  }
+  await footprintScan(obj)
   getSbmerchantInfo(data).then((res) => {
   getSbmerchantInfo(data).then((res) => {
     console.log(res);
     console.log(res);
     merchantInfo.value = res.data;
     merchantInfo.value = res.data;
@@ -223,7 +232,6 @@ const makePhoneCall = () => {
   });
   });
 };
 };
 const goDetail = async (item) => {
 const goDetail = async (item) => {
-  await goShopDetail(item, uid);
   uni.navigateTo({ url: `/pages/goods/goods_details/index?id=${item.id}` });
   uni.navigateTo({ url: `/pages/goods/goods_details/index?id=${item.id}` });
 };
 };
 </script>
 </script>

+ 72 - 61
pages/order_addcart/order_addcart.vue

@@ -77,23 +77,23 @@
                                 <view v-if="item.attrStatus">
                                 <view v-if="item.attrStatus">
                                   <view
                                   <view
                                       class="carnum acea-row row-center-wrapper"
                                       class="carnum acea-row row-center-wrapper"
-                                      v-if="item.editNum"
+                                      v-show="item.editNum"
                                   >
                                   >
                                     <view
                                     <view
                                         class="reduce"
                                         class="reduce"
                                         :class="item.numSub ? 'on' : ''"
                                         :class="item.numSub ? 'on' : ''"
-                                        @click.stop="subCart(index)"
+                                        @click.stop="subCart(item.id, merchantIndex, index)"
                                     >-</view
                                     >-</view
                                     >
                                     >
                                     <view class="num">{{ item.cartNum }}</view>
                                     <view class="num">{{ item.cartNum }}</view>
                                     <view
                                     <view
                                         class="plus"
                                         class="plus"
                                         :class="item.numAdd ? 'on' : ''"
                                         :class="item.numAdd ? 'on' : ''"
-                                        @click.stop="addCart(index)"
+                                        @click.stop="addCart(item.id, merchantIndex, index)"
                                     >+</view
                                     >+</view
                                     >
                                     >
                                   </view>
                                   </view>
-                                  <view class="carnumTag" v-if="!item.editNum" @click.stop="item.editNum = true">
+                                  <view class="carnumTag" v-show="!item.editNum" @click.stop="item.editNum = true">
                                     X{{ item.cartNum }}
                                     X{{ item.cartNum }}
                                   </view>
                                   </view>
                                 </view>
                                 </view>
@@ -337,7 +337,7 @@
       @submit="handleSubmit"
       @submit="handleSubmit"
       @myevent="onMyEvent"
       @myevent="onMyEvent"
       @ChangeAttr="ChangeAttr"
       @ChangeAttr="ChangeAttr"
-      @ChangeCartNum="ChangeCartNum"
+      @ChangeCartNum="ChangeCartNumFn"
       @attrVal="attrVal"
       @attrVal="attrVal"
       @iptCartNum="iptCartNum"
       @iptCartNum="iptCartNum"
       id="product-window"
       id="product-window"
@@ -453,9 +453,10 @@ onShow(() => {
     hotLimit.value = 10;
     hotLimit.value = 10;
     cartList.valid = [];
     cartList.valid = [];
     cartList.invalid = [];
     cartList.invalid = [];
-    isAllSelect.value = false;
-    selectValue.value = [];
-    selectCountPrice.value = 0.0;
+    // 不要重置选中状态
+    // isAllSelect.value = false;
+    // selectValue.value = [];
+    // selectCountPrice.value = 0.0;
     cartCount.value = 0;
     cartCount.value = 0;
     isShowAuth.value = false;
     isShowAuth.value = false;
   }
   }
@@ -703,7 +704,7 @@ function attrVal(val) {
     attr.productAttr[val.indexw].attrValues[val.indexn];
     attr.productAttr[val.indexw].attrValues[val.indexn];
 }
 }
 
 
-function ChangeCartNum(changeValue) {
+function ChangeCartNumFn(changeValue) {
   let productSelect = productValue.value[attrValue.value];
   let productSelect = productValue.value[attrValue.value];
   if (productSelect === undefined && !attr.productAttr.length)
   if (productSelect === undefined && !attr.productAttr.length)
     productSelect = attr.productSelect;
     productSelect = attr.productSelect;
@@ -912,36 +913,15 @@ function setAllSelectValue(status) {
 
 
 function checkboxChange(value) {
 function checkboxChange(value) {
   const valid = cartList.valid;
   const valid = cartList.valid;
-  let checkedItems = [];
-  let uncheckedItems = [];
-  let invalidItems = [];
 
 
+  // 更新所有商品的选中状态
   valid.forEach(item => {
   valid.forEach(item => {
-    if (value.includes(item.id)) {
-      if (footerswitch.value) {
-        if (item.attrStatus) {
-          item.checked = true;
-          checkedItems.push(item);
-        } else {
-          item.checked = false;
-        }
-      } else {
-        item.checked = true;
-        checkedItems.push(item);
-      }
-    } else {
-      item.checked = false;
-      uncheckedItems.push(item);
-    }
+    item.checked = value.includes(item.id);
   });
   });
 
 
-  if (footerswitch.value) {
-    invalidItems = uncheckedItems.filter(item => !item.attrStatus);
-  }
-
   cartList.valid = [...valid];
   cartList.valid = [...valid];
-  // isAllSelect.value = valid.length === checkedItems.length + invalidItems.length;
   selectValue.value = value;
   selectValue.value = value;
+
   // 计算全选状态
   // 计算全选状态
   if (footerswitch.value) {
   if (footerswitch.value) {
     // 结算模式下,只计算有效商品
     // 结算模式下,只计算有效商品
@@ -967,19 +947,33 @@ function switchSelect() {
   const validList = cartList.valid;
   const validList = cartList.valid;
   const selectValueArr = selectValue.value;
   const selectValueArr = selectValue.value;
   let selectCount = 0.0;
   let selectCount = 0.0;
+
+  console.log('switchSelect called', {
+    validListLength: validList.length,
+    selectValueArrLength: selectValueArr.length,
+    selectValueArr: selectValueArr
+  });
+
   if (selectValueArr.length < 1) {
   if (selectValueArr.length < 1) {
-    selectCountPrice.value = selectCount;
+    selectCountPrice.value = '0.00';
   } else {
   } else {
     for (let index in validList) {
     for (let index in validList) {
       if (inArray(validList[index].id, selectValueArr)) {
       if (inArray(validList[index].id, selectValueArr)) {
-        selectCount = util.$h.Add(
-          selectCount,
-          util.$h.Mul(validList[index].cartNum, validList[index].storePrice)
-        );
+        console.log('Calculating item:', {
+          id: validList[index].id,
+          cartNum: validList[index].cartNum,
+          storePrice: validList[index].storePrice,
+          checked: validList[index].checked
+        });
+        const itemTotal = util.$h.Mul(validList[index].cartNum, validList[index].storePrice);
+        selectCount = util.$h.Add(selectCount, itemTotal);
       }
       }
     }
     }
-    selectCountPrice.value = selectCount;
+    // 保留两位小数
+    selectCountPrice.value = selectCount.toFixed(2);
   }
   }
+
+  console.log('Final selectCountPrice:', selectCountPrice.value);
 }
 }
 
 
 function iptCartNumInput(index) {
 function iptCartNumInput(index) {
@@ -997,10 +991,11 @@ function blurInput(index) {
   }
   }
 }
 }
 
 
-function subCart(index) {
+function subCart(cartIdVal, merchantIndex, productIndex) {
+  const item = groupedCartList.value[merchantIndex].products[productIndex];
   let status = false;
   let status = false;
-  const item = cartList.valid[index];
   item.cartNum = Number(item.cartNum) - 1;
   item.cartNum = Number(item.cartNum) - 1;
+
   if (item.cartNum < 1) status = true;
   if (item.cartNum < 1) status = true;
   if (item.cartNum <= 1) {
   if (item.cartNum <= 1) {
     item.cartNum = 1;
     item.cartNum = 1;
@@ -1009,18 +1004,20 @@ function subCart(index) {
     item.numSub = false;
     item.numSub = false;
     item.numAdd = false;
     item.numAdd = false;
   }
   }
+
   if (false == status) {
   if (false == status) {
     setCartNum(item.id, item.cartNum, function (data) {
     setCartNum(item.id, item.cartNum, function (data) {
-      cartList.valid[index] = item;
       switchSelect();
       switchSelect();
       getCartNum();
       getCartNum();
     });
     });
   }
   }
 }
 }
 
 
-function addCart(index) {
-  const item = cartList.valid[index];
+function addCart(cartIdVal, merchantIndex, productIndex) {
+  console.log(cartIdVal)
+  const item = groupedCartList.value[merchantIndex].products[productIndex];
   item.cartNum = Number(item.cartNum) + 1;
   item.cartNum = Number(item.cartNum) + 1;
+
   if (item.cartNum >= item.stock) {
   if (item.cartNum >= item.stock) {
     item.cartNum = item.stock;
     item.cartNum = item.stock;
     item.numAdd = true;
     item.numAdd = true;
@@ -1029,8 +1026,9 @@ function addCart(index) {
     item.numAdd = false;
     item.numAdd = false;
     item.numSub = false;
     item.numSub = false;
   }
   }
+
   setCartNum(item.id, item.cartNum, function (data) {
   setCartNum(item.id, item.cartNum, function (data) {
-    cartList.valid[index] = item;
+    // 更新UI
     switchSelect();
     switchSelect();
     getCartNum();
     getCartNum();
   });
   });
@@ -1051,16 +1049,24 @@ function getCartNum() {
 function getCartData(data) {
 function getCartData(data) {
   return new Promise((resolve, reject) => {
   return new Promise((resolve, reject) => {
     getCartList(data)
     getCartList(data)
-      .then((res) => {
-        resolve(res.data);
-      })
-      .catch(function (err) {
-        loading.value = false;
-        canShow.value = true;
-        Toast({
-          title: err,
+        .then((res) => {
+          // 加载数据后,同步选中状态
+          const data = res.data;
+          if (data.list && data.list.length > 0) {
+            data.list.forEach(item => {
+              // 如果这个商品ID在选中列表中,设置checked为true
+              item.checked = selectValue.value.includes(item.id);
+            });
+          }
+          resolve(data);
+        })
+        .catch(function (err) {
+          loading.value = false;
+          canShow.value = true;
+          Toast({
+            title: err,
+          });
         });
         });
-      });
   });
   });
 }
 }
 
 
@@ -1084,6 +1090,7 @@ async function getCartListFn() {
       let valid = cartListData.list;
       let valid = cartListData.list;
       let validList = [...cartList.valid, ...valid];
       let validList = [...cartList.valid, ...valid];
       let selectValueArr = [];
       let selectValueArr = [];
+
       if (validList.length > 0) {
       if (validList.length > 0) {
         for (let index in validList) {
         for (let index in validList) {
           // 购物车加减状态
           // 购物车加减状态
@@ -1106,9 +1113,13 @@ async function getCartListFn() {
 
 
           // attrStatus 判断商品是否有效
           // attrStatus 判断商品是否有效
           if (validList[index].attrStatus) {
           if (validList[index].attrStatus) {
-            // validList[index].checked = true;
-            // selectValueArr.push(validList[index].id);
-            validList[index].checked = false;
+            // 关键修改:根据 selectValue 中的ID来设置选中状态
+            if (selectValue.value.includes(validList[index].id)) {
+              validList[index].checked = true;
+              selectValueArr.push(validList[index].id);
+            } else {
+              validList[index].checked = false;
+            }
           } else {
           } else {
             validList[index].checked = false;
             validList[index].checked = false;
           }
           }
@@ -1116,12 +1127,12 @@ async function getCartListFn() {
       }
       }
       cartList.valid = validList;
       cartList.valid = validList;
       data.page += 1;
       data.page += 1;
-      selectValue.value = selectValueArr;
+      // 不要重置 selectValue,保持原来的选中状态
+      // selectValue.value = selectValueArr;
+
       let newArr = validList.filter((item) => item.attrStatus);
       let newArr = validList.filter((item) => item.attrStatus);
       // 全选状态
       // 全选状态
-      // isAllSelect.value =
-        // newArr.length == selectValueArr.length && newArr.length;
-      isAllSelect.value = false;
+      isAllSelect.value = newArr.length > 0 && selectValue.value.length === newArr.length;
       switchSelect();
       switchSelect();
     }
     }
     loading.value = false;
     loading.value = false;

+ 9 - 2
pages/order_list/index.vue

@@ -11,7 +11,7 @@
               >
               >
               <text
               <text
                 >总消费:¥{{
                 >总消费:¥{{
-                  Number(orderDataState.sumPrice).toFixed(2) || 0
+                  formattedSumPrice
                 }}</text
                 }}</text
               >
               >
             </view>
             </view>
@@ -113,7 +113,7 @@
 </template>
 </template>
 
 
 <script setup>
 <script setup>
-import { ref, onMounted } from "vue";
+import { ref, onMounted,computed } from "vue";
 import { onShow,onLoad, onReachBottom } from "@dcloudio/uni-app";
 import { onShow,onLoad, onReachBottom } from "@dcloudio/uni-app";
 import OrderListCard from "@/components/OrderListCard";
 import OrderListCard from "@/components/OrderListCard";
 import { useAppStore } from "@/stores/app";
 import { useAppStore } from "@/stores/app";
@@ -305,6 +305,13 @@ function delOrder(order_id, index) {
       Toast({ title: err });
       Toast({ title: err });
     });
     });
 }
 }
+const formattedSumPrice = computed(() => {
+  const price = orderDataState.value.sumPrice;
+  if (price === null || price === undefined || price === '' || isNaN(price)) {
+    return '0.00';
+  }
+  return Number(price).toFixed(2);
+});
 </script>
 </script>
 
 
 <style scoped lang="scss">
 <style scoped lang="scss">

+ 2 - 2
pages/users/browsing_history/index.vue

@@ -6,8 +6,8 @@
           :key="index"
           :key="index"
           class="record-item"
           class="record-item"
       >
       >
-        <view class="icon-container">
-          <image :src="record.merchantLogo" mode="aspectFit"></image>
+        <view>
+          <image class="icon-container" :src="record.merchantLogo" mode="aspectFit"></image>
         </view>
         </view>
         <view class="info-container">
         <view class="info-container">
           <view class="shop-name">{{ record.merchantName }}</view>
           <view class="shop-name">{{ record.merchantName }}</view>

+ 1 - 2
pages/users/login/index.vue

@@ -345,8 +345,7 @@ const getUserInfoFn = async (data) => {
 };
 };
 
 
 onLoad((options) => {
 onLoad((options) => {
-  const params = getSceneInfo(options);
-  merchantId.value = params.merchantId || '';
+  merchantId.value = appStore.merchantId || '';
   getLogoImage();
   getLogoImage();
 });
 });
 
 

+ 8 - 6
pages/users/user_address/index.vue

@@ -15,7 +15,6 @@
               name="realName"
               name="realName"
               :value="userAddress.realName"
               :value="userAddress.realName"
               placeholder-class="placeholder"
               placeholder-class="placeholder"
-              maxlength="4"
             />
             />
           </view>
           </view>
           <view class="item acea-row row-between-wrapper">
           <view class="item acea-row row-between-wrapper">
@@ -67,9 +66,9 @@
           </view>
           </view>
         </view>
         </view>
         <view class="default acea-row row-middle borRadius14">
         <view class="default acea-row row-middle borRadius14">
-          <checkbox-group @change="ChangeIsDefault">
-            <checkbox :checked="userAddress.isDefault" />设置为默认地址
-          </checkbox-group>
+          <up-checkbox-group @change="ChangeIsDefault" shape="circle" class="check-box">
+            <up-checkbox :checked="userAddress.isDefault" activeColor="#F8C008" />设置为默认地址
+          </up-checkbox-group>
         </view>
         </view>
 
 
         <button class="keepBnt bg-color" form-type="submit">立即保存</button>
         <button class="keepBnt bg-color" form-type="submit">立即保存</button>
@@ -491,8 +490,8 @@ function ChangeIsDefault() {
   line-height: 86rpx;
   line-height: 86rpx;
   margin: 0 auto;
   margin: 0 auto;
   font-size: 32rpx;
   font-size: 32rpx;
-  color: #e93323;
-  border: 1px solid #e93323;
+  color: #F8C008;
+  border: 1px solid #F8C008;
 }
 }
 
 
 .relative {
 .relative {
@@ -515,4 +514,7 @@ function ChangeIsDefault() {
   // background-color: #E93323;
   // background-color: #E93323;
   height: var(--status-bar-height);
   height: var(--status-bar-height);
 }
 }
+:deep(.u-checkbox-group){
+  align-items: center;
+}
 </style>
 </style>

+ 50 - 31
pages/users/user_address_list/index.vue

@@ -13,10 +13,12 @@
       class="address-management"
       class="address-management"
       :class="addressList.length < 1 && page > 1 ? 'fff' : ''"
       :class="addressList.length < 1 && page > 1 ? 'fff' : ''"
     >
     >
-      <radio-group
+      <up-radio-group
         class="radio-group"
         class="radio-group"
         @change="radioChange"
         @change="radioChange"
         v-if="addressList.length"
         v-if="addressList.length"
+        activeColor="#F8C008"
+        v-model="currentCheckedValue"
       >
       >
         <view
         <view
           class="item borRadius14"
           class="item borRadius14"
@@ -35,18 +37,16 @@
           </view>
           </view>
           <view class="operation acea-row row-between-wrapper">
           <view class="operation acea-row row-between-wrapper">
             <!-- #ifndef MP -->
             <!-- #ifndef MP -->
-            <radio
+            <up-radio
               class="radio"
               class="radio"
               :value="index.toString()"
               :value="index.toString()"
-              :checked="item.isDefault"
+              :name="item.id"
+              label="设为默认"
             >
             >
-              <text>设为默认</text>
-            </radio>
+            </up-radio>
             <!-- #endif -->
             <!-- #endif -->
             <!-- #ifdef MP -->
             <!-- #ifdef MP -->
-            <radio class="radio" :value="index" :checked="item.isDefault">
-              <text>设为默认</text>
-            </radio>
+            <up-radio class="radio" :name="item.id" label="设为默认"></up-radio>
             <!-- #endif -->
             <!-- #endif -->
             <view class="acea-row row-middle">
             <view class="acea-row row-middle">
               <view @click="editAddressFn(item.id)"
               <view @click="editAddressFn(item.id)"
@@ -58,7 +58,7 @@
             </view>
             </view>
           </view>
           </view>
         </view>
         </view>
-      </radio-group>
+      </up-radio-group>
       <view
       <view
         class="loadingicon acea-row row-center-wrapper"
         class="loadingicon acea-row row-center-wrapper"
         v-if="addressList.length"
         v-if="addressList.length"
@@ -144,6 +144,7 @@ const secKill = ref(false);
 const preOrderNo = ref(0);
 const preOrderNo = ref(0);
 const isFlashSale = ref(false); // 是否为秒杀订单
 const isFlashSale = ref(false); // 是否为秒杀订单
 const isGroupBuy = ref(false); // 是否为团购订单
 const isGroupBuy = ref(false); // 是否为团购订单
+const currentCheckedValue = ref("");
 
 
 watch(
 watch(
   () => appStore.isLogin,
   () => appStore.isLogin,
@@ -302,6 +303,17 @@ function getAddressListFn(isPage) {
       let list = res.data.list;
       let list = res.data.list;
       let isLoadend = list.length < limit.value;
       let isLoadend = list.length < limit.value;
       addressList.value = [...addressList.value, ...list];
       addressList.value = [...addressList.value, ...list];
+
+      const defaultAddress = addressList.value.find(item => item.isDefault);
+      console.log(defaultAddress)
+      if (defaultAddress) {
+        currentCheckedValue.value = defaultAddress.id;
+      } else if (addressList.value.length > 0) {
+        // 如果没有默认地址,选择第一个
+        currentCheckedValue.value = newList[0].id;
+      }
+      console.log('currentCheckedValue.value',currentCheckedValue.value)
+
       loadend.value = isLoadend;
       loadend.value = isLoadend;
       loadTitle.value = isLoadend ? "我也是有底线的" : "加载更多";
       loadTitle.value = isLoadend ? "我也是有底线的" : "加载更多";
       page.value = page.value + 1;
       page.value = page.value + 1;
@@ -315,29 +327,35 @@ function getAddressListFn(isPage) {
 
 
 // 设置默认地址
 // 设置默认地址
 function radioChange(e) {
 function radioChange(e) {
-  let index = parseInt(e.detail.value);
-  let address = addressList.value[index];
-  if (address == undefined) return Toast({ title: "您设置的默认地址不存在!" });
-  setAddressDefault(address.id)
-    .then(() => {
-      addressList.value.forEach((item, i) => {
-        item.isDefault = i === index;
-      });
-      Toast(
-        {
-          title: "设置成功",
-          icon: "success",
-        },
-        () => {
-          addressList.value = [...addressList.value];
-        }
-      );
-    })
-    .catch((err) => {
-      return Toast({
-        title: err,
+  const addressId = e; // 现在是地址ID
+  const address = addressList.value.find(item => item.id === addressId);
+  if (!address) return Toast({ title: "您设置的默认地址不存在!" });
+
+  setAddressDefault(addressId)
+      .then(() => {
+        // 更新所有地址的isDefault状态
+        addressList.value.forEach(item => {
+          item.isDefault = item.id === addressId;
+        });
+
+        // 更新当前选中的值
+        currentCheckedValue.value = addressId;
+
+        Toast(
+            {
+              title: "设置成功",
+              icon: "success",
+            },
+            () => {
+              addressList.value = [...addressList.value];
+            }
+        );
+      })
+      .catch((err) => {
+        return Toast({
+          title: err,
+        });
       });
       });
-    });
 }
 }
 
 
 // 编辑地址
 // 编辑地址
@@ -442,6 +460,7 @@ onReachBottom(() => {
   background-color: #fff;
   background-color: #fff;
   padding: 0 20rpx;
   padding: 0 20rpx;
   margin-bottom: 20rpx;
   margin-bottom: 20rpx;
+  width: 100%;
 }
 }
 
 
 .address-management .item .address {
 .address-management .item .address {

+ 9 - 8
pages/users/user_goods_collection/index.vue

@@ -48,7 +48,7 @@
       <view class='pictrue'>
       <view class='pictrue'>
         <image :src="HTTP_REQUEST_URL_IMG+'noCollection.png'"></image>
         <image :src="HTTP_REQUEST_URL_IMG+'noCollection.png'"></image>
       </view>
       </view>
-      <recommend :hostProduct="hostProduct"></recommend>
+<!--      <recommend :hostProduct="hostProduct"></recommend>-->
     </view>
     </view>
 
 
     <home></home>
     <home></home>
@@ -176,7 +176,7 @@ const setAllSelectValue = (status) => {
 // 授权回调
 // 授权回调
 const onLoadFun = () => {
 const onLoadFun = () => {
   get_user_collect_product();
   get_user_collect_product();
-  get_host_product();
+  // get_host_product();
 };
 };
 
 
 // 授权关闭
 // 授权关闭
@@ -208,7 +208,7 @@ const get_user_collect_product = async () => {
     collectProductList.value = Util.SplitArray(collectProductListData, collectProductList.value);
     collectProductList.value = Util.SplitArray(collectProductListData, collectProductList.value);
 
 
     if (collectProductList.value.length === 0) {
     if (collectProductList.value.length === 0) {
-      get_host_product();
+      // get_host_product();
     }
     }
 
 
     loadend.value = isLoadend;
     loadend.value = isLoadend;
@@ -290,7 +290,7 @@ onShow(() => {
 // 页面上拉触底
 // 页面上拉触底
 onReachBottom(() => {
 onReachBottom(() => {
   get_user_collect_product();
   get_user_collect_product();
-  get_host_product();
+  // get_host_product();
 });
 });
 </script>
 </script>
 
 
@@ -352,7 +352,7 @@ onReachBottom(() => {
 
 
     .name {
     .name {
       width: 434rpx;
       width: 434rpx;
-      margin-bottom: 56rpx;
+      margin-bottom: 30rpx;
     }
     }
   }
   }
 
 
@@ -374,15 +374,15 @@ onReachBottom(() => {
 }
 }
 
 
 .collectionGoods .item .pictrue {
 .collectionGoods .item .pictrue {
-  width: 130rpx;
-  height: 130rpx;
+  width: 100rpx;
+  height: 100rpx;
   margin-right: 20rpx;
   margin-right: 20rpx;
 }
 }
 
 
 .collectionGoods .item .pictrue image {
 .collectionGoods .item .pictrue image {
   width: 100%;
   width: 100%;
   height: 100%;
   height: 100%;
-  border-radius: 14rpx;
+  border-radius: 16rpx;
 }
 }
 
 
 .collectionGoods .item .text {
 .collectionGoods .item .text {
@@ -414,6 +414,7 @@ onReachBottom(() => {
 .noCommodity {
 .noCommodity {
   background-color: #fff;
   background-color: #fff;
   padding-top: 1rpx;
   padding-top: 1rpx;
+  padding-bottom: 30rpx;
   border-top: 0;
   border-top: 0;
 }
 }
 
 

+ 9 - 1
utils/util.js

@@ -3,6 +3,7 @@ import { HTTP_ADMIN_URL, BASE_OSS_URL } from "@/config/app.js";
 import { useAppStore } from "@/stores/app.js";
 import { useAppStore } from "@/stores/app.js";
 import { addJoinTeamUserRole } from "@/api/api.js";
 import { addJoinTeamUserRole } from "@/api/api.js";
 import { getJoinRolesAPI } from "@/api/joinus";
 import { getJoinRolesAPI } from "@/api/joinus";
+import { footprintScan } from "@/api/merchant.js";
 import { pathToBase64 } from "@/plugin/image-tools/index.js";
 import { pathToBase64 } from "@/plugin/image-tools/index.js";
 import { useToast } from "@/hooks/useToast";
 import { useToast } from "@/hooks/useToast";
 import pageJson from '@/pages.json';
 import pageJson from '@/pages.json';
@@ -887,7 +888,7 @@ export function isTabBarPage() {
 }
 }
 
 
 // 获取邀请码
 // 获取邀请码
-export function getSceneInfo(e) {
+export async function getSceneInfo (e,index) {
   if (e.scene) {
   if (e.scene) {
     const decodedScene = decodeURIComponent(e.scene);
     const decodedScene = decodeURIComponent(e.scene);
     const params = {};
     const params = {};
@@ -901,6 +902,13 @@ export function getSceneInfo(e) {
     }
     }
 
 
     if (params.merchantId) appStore.UPDATE_MERCHANT_ID(params.merchantId);
     if (params.merchantId) appStore.UPDATE_MERCHANT_ID(params.merchantId);
+    if(index == 'index' && appStore.userInfo){
+      let obj ={
+        merchantId:params.merchantId,
+        userId:appStore.userInfo.userId
+      }
+      await footprintScan(obj)
+    }
     console.log("获取邀请码-params", params)
     console.log("获取邀请码-params", params)
     return params;
     return params;
   }
   }