ext.liuqiwen3 преди 1 седмица
родител
ревизия
081df2ac77
променени са 38 файла, в които са добавени 1289 реда и са изтрити 1070 реда
  1. 14 4
      pages.json
  2. 7 4
      pages/goods_details/index.vue
  3. 5 5
      pages/index/index.vue
  4. 368 0
      pages/merchant/index.vue
  5. 359 135
      pages/order_addcart/order_addcart.vue
  6. 1 1
      pages/personal_info/personal_info.vue
  7. 531 915
      pages/user/index.vue
  8. 1 3
      pages/users/my_merchant/index.vue
  9. 3 3
      static/css/base.css
  10. BIN
      static/images/phone2.png
  11. BIN
      static/images/phoneyellow.png
  12. BIN
      static/images/setting.png
  13. BIN
      static/images/setting/bofang.png
  14. BIN
      static/images/setting/cunliao.png
  15. BIN
      static/images/setting/daifahuo.png
  16. BIN
      static/images/setting/daifukuan.png
  17. BIN
      static/images/setting/daishouhuo.png
  18. BIN
      static/images/setting/dianpu.png
  19. BIN
      static/images/setting/dingwei.png
  20. BIN
      static/images/setting/lianxikefu.png
  21. BIN
      static/images/setting/mailiao.png
  22. BIN
      static/images/setting/mailiao2.png
  23. BIN
      static/images/setting/shoucang.png
  24. BIN
      static/images/setting/tiliao.png
  25. BIN
      static/images/setting/tuikuan.png
  26. BIN
      static/images/setting/vip.png
  27. BIN
      static/images/setting/vipBG.png
  28. BIN
      static/images/setting/vipIcon.png
  29. BIN
      static/images/setting/xiazaiapp.png
  30. BIN
      static/images/setting/yijianjianyi.png
  31. BIN
      static/images/setting/yiwancheng.png
  32. BIN
      static/images/setting/zuji.png
  33. BIN
      static/images/tabbar/1-001.png
  34. BIN
      static/images/tabbar/2-001.png
  35. BIN
      static/images/tabbar/3-001.png
  36. BIN
      static/images/tabbar/3-003.png
  37. BIN
      static/images/tabbar/4-001.png
  38. BIN
      static/images/tabbar/4-003.png

+ 14 - 4
pages.json

@@ -28,7 +28,8 @@
 		{
 			"path": "pages/user/index",
 			"style": {
-				"navigationBarTitleText": "个人中心"
+				"navigationBarTitleText": "个人中心",
+				"navigationStyle": "custom"
 			}
 		},
 		{
@@ -100,7 +101,7 @@
 			"path": "pages/order_addcart/order_addcart",
 			"style": {
 				"navigationBarTitleText": "购物车",
-				"navigationBarBackgroundColor": "#ffe079",
+				"navigationBarBackgroundColor": "#fff",
 				"navigationBarTextStyle": "black"
 			}
 		},
@@ -118,6 +119,15 @@
 				"navigationBarTextStyle": "black",
 				"enablePullDownRefresh": false
 			}
+		},
+		{
+			"path": "pages/merchant/index",
+			"style": {
+				"navigationBarTitleText": "商家主页",
+				"navigationBarBackgroundColor": "#ffffff",
+				"navigationBarTextStyle": "black",
+				"enablePullDownRefresh": false
+			}
 		}
 	],
 	"subPackages": [
@@ -350,13 +360,13 @@
 			{
 				"pagePath": "pages/order_addcart/order_addcart",
 				"iconPath": "static/images/tabbar/3-001.png",
-				"selectedIconPath": "static/images/tabbar/3-002.png",
+				"selectedIconPath": "static/images/tabbar/3-003.png",
 				"text": "购物车"
 			},
 			{
 				"pagePath": "pages/user/index",
 				"iconPath": "static/images/tabbar/4-001.png",
-				"selectedIconPath": "static/images/tabbar/4-002.png",
+				"selectedIconPath": "static/images/tabbar/4-003.png",
 				"text": "我的"
 			}
 		]

+ 7 - 4
pages/goods_details/index.vue

@@ -187,7 +187,7 @@
 <!--                </view>-->
 <!--              </view>-->
 <!--            </view>-->
-            <view class="store-card">
+            <view class="store-card" @click="toStore">
               <view class="left">
                 <image class="storeImg" :src="sbMerchantInfo.merchantLogo" mode="aspectFit"></image>
               </view>
@@ -200,12 +200,12 @@
               </view>
             </view>
             <view class="product-intro" id="past3">
-              <view class="title">
+              <view class="title" style="text-align: left;height:80rpx;line-height: 80rpx;font-size: 32rpx;color: #333;">
 <!--                <image src="/static/images/xzuo.png"></image>-->
                 <span class="sp">商品详情</span>
 <!--                <image src="/static/images/xyou.png"></image>-->
               </view>
-              <view class="conter">
+              <view class="conter" style="border-radius: 16rpx;overflow: hidden;">
                 <up-parse :content="description"></up-parse>
               </view>
             </view>
@@ -850,7 +850,7 @@ const toShopCart = () => {
   if (!isLogin.value) {
     toLogin();
   } else {
-    uni.navigateTo({
+    uni.switchTab({
       url: "/pages/order_addcart/order_addcart",
     });
   }
@@ -1202,6 +1202,9 @@ const metalTypeFormatter = (val)=> {
   }
   return str;
 }
+const toStore = () => {
+  uni.navigateTo({ url: "/pages/merchant/index?merchantId="+sbMerchantInfo.value.id });
+}
 </script>
 
 <style scoped lang="scss">

+ 5 - 5
pages/index/index.vue

@@ -240,7 +240,10 @@ const calculatedProducts = computed(() => {
 });
 
 onShow(() => {
-
+  getGroomList();
+  getAllCategory();
+  uni.setNavigationBarTitle({ title: site_name.value });
+  getUserBenefits();
 });
 onLoad(async (options)=>{
   merchantId.value = uni.getStorageSync('merchantId') || '';
@@ -252,10 +255,7 @@ onLoad(async (options)=>{
     console.log('===========')
     getIndexConfig();
   }
-  getGroomList();
-  getAllCategory();
-  uni.setNavigationBarTitle({ title: site_name.value });
-  getUserBenefits();
+
 })
 const getMerchantBannerListFn = async () => {
   try {

+ 368 - 0
pages/merchant/index.vue

@@ -0,0 +1,368 @@
+
+
+<template>
+  <view class="container">
+<!--    商家信息-->
+    <view class="store-card">
+      <view class="info-top">
+        <view class="left">
+          <image class="storeImg" :src="merchantInfo.merchantLogo" mode="aspectFit"></image>
+        </view>
+        <view class="center">
+          <view class="name">{{merchantInfo.merchantName}}</view>
+        </view>
+      </view>
+      <view class="desc">{{merchantInfo.merchantDescribe}}</view>
+      <view class="tel">
+        <image class="phone mr20" src="@/static/images/phone2.png" mode="widthFix"></image>
+        <text>联系电话:{{merchantInfo.merchantPhone}}</text>
+        <image class="phone fr" src="@/static/images/phoneyellow.png" mode="widthFix"></image>
+      </view>
+    </view>
+<!--    商品-->
+    <up-tabs :list="tabList"
+             @click="tabChange"
+             lineColor="#333333"
+             :itemStyle="{
+               flex:1,
+               height:'44px',
+             }"
+             :activeStyle="{
+                color: '#333333',
+                fontWeight: 'bold',
+                transform: 'scale(1.05)'
+            }"
+             :inactiveStyle="{
+              color: '#666666',
+              transform: 'scale(1)'
+        }"></up-tabs>
+      <!--    商品列表-->
+    <view class="index-product-wrapper">
+      <view
+          class="list-box animated"
+          :class="goodsList.length > 0 ? 'fadeIn on' : ''"
+      >
+        <view
+            class="item"
+            v-for="(item, index) in calculatedProducts"
+            :key="index"
+            @click="goDetail(item)"
+        >
+          <view class="pictrue">
+            <image :src="item.image" mode=""></image>
+          </view>
+          <view class="text-info">
+            <view class="title" >
+              <view class="text line1">{{ item.storeName }}</view>
+              <view class="weight">{{ item.weight }}g</view>
+            </view>
+            <view class="bottom-row">
+              <!-- <text class="price">工费: {{ item.price }}/克</text> -->
+              <text class="price">¥ {{ item.totalLaborCost }}</text>
+              <text class="sales">
+                销量:{{ Number(item.sales || 0) + Number(item.ficti || 0) }}件
+              </text>
+              <!-- <view class="txt">券</view> -->
+            </view>
+            <view class="bottom-row">
+              <!-- <text class="price">工费: {{ item.price }}/克</text> -->
+              <text class="sales">工费: {{ item.totalLaborCost }}</text>
+              <text class="sales">
+                附加费: {{ item.totalLaborCost }}
+              </text>
+              <!-- <view class="txt">券</view> -->
+            </view>
+          </view>
+        </view>
+      </view>
+      <view class="loadingicon acea-row row-center-wrapper" v-if="goodScroll">
+        <text
+            class="loading iconfont icon-jiazai"
+            :hidden="loading == false"
+        ></text>
+      </view>
+      <view class="no-data" v-if="isNoDataState">
+        <image
+            src="https://my-go-easy-im.oss-cn-shenzhen.aliyuncs.com/goeasy-im-%E6%B0%B4%E8%B4%9D%E5%95%86%E5%9F%8E/zhanwu_20250827104005_1720_6.png"
+        />
+      </view>
+      <view class="mores-txt flex" v-if="!goodScroll && !isNoDataState">
+        <text>我是有底线的</text>
+      </view>
+    </view>
+  </view>
+</template>
+<script setup>
+import {computed, ref} from 'vue';
+import { onLoad, onShow, onReachBottom } from "@dcloudio/uni-app";
+import { getSbmerchantInfo } from "@/api/merchant.js";
+import {
+  getGroomList as getGroomListApi,
+} from "@/api/store.js";
+// 获取实时金价
+import useRealGoldPrice from "@/hooks/useRealGoldPrice";
+// 实时价格处理
+const {
+  realGoldprice, // 黄金实时销售价(基础)
+  realPtprice, // 铂金实时销售价(基础)
+  realAgprice, // 白银实时销售价(基础)
+} = useRealGoldPrice({});
+
+const query = ref({});
+const merchantInfo = ref({});
+const tabList = ref([
+  {name:'推荐商品'},
+  {name:'商品分类'}
+])
+const goodsList = ref([]);
+const goodType = ref(1);
+// Pagination
+const params = ref({
+  page: 1,
+  limit: 10,
+});
+const loading = ref(false);
+const goodScroll = ref(true);
+
+const calculatedProducts = computed(() => {
+  // 计算逻辑与原代码一致,但基于响应式数据 products
+  return goodsList.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);
+
+    return {
+      ...product,
+      calculatedTotal: formattedTotal, // 新增计算结果字段
+    };
+  });
+});
+const isNoDataState = computed(() => {
+  return goodsList.value.length === 0 && !loading.value;
+});
+
+
+onLoad((options) => {
+  query.value = options;
+  getSbmerchantInfoFn();
+  getGroomList();
+});
+onReachBottom(() => {
+  getGroomList();
+});
+const getSbmerchantInfoFn = () => {
+  let data = {
+    merchantId:query.value.merchantId
+  }
+  getSbmerchantInfo(data).then((res) => {
+    console.log(res);
+    merchantInfo.value = res.data;
+  })
+}
+const tabChange = (item) => {
+  console.log('item',item)
+}
+// Product Lists
+const getGroomList = async () => {
+  if (!goodScroll.value) return;
+  try {
+    loading.value = true;
+    query.value.merchantId!='' ?  params.value.merchantId = query.value.merchantId:'';
+    const { data } = await getGroomListApi(goodType.value, params.value);
+
+    goodsList.value = [...goodsList.value, ...data.productList.list] || [];
+    goodScroll.value = data.productList.list.length >= params.value.limit;
+    params.value.page++;
+  } catch (err) {
+    console.error(err);
+  } finally {
+    loading.value = false;
+  }
+};
+</script>
+<style scoped lang="scss">
+.container{
+  padding: 30rpx;
+  box-sizing: border-box;
+}
+.store-card{
+  background: #ffffff;
+  border-radius: 16rpx;
+  padding: 20rpx;
+  margin-bottom: 10rpx;
+
+  .info-top{
+    display: flex;
+    justify-content: center;
+    align-items: center;
+    background-color: #F9F7F0;
+    border-radius: 16rpx;
+    .left{
+      width: 140rpx;
+      .storeImg{
+        width: 100rpx;
+        height: 100rpx;
+      }
+    }
+    .center{
+      width: 70%;
+      .name{
+        font-size: 32rpx;
+        color: #333;line-height: 60rpx;
+      }
+
+    }
+  }
+  .desc{
+    font-size: 24rpx;
+    color: #666;
+    line-height: 40rpx;
+    padding: 20rpx 0;
+  }
+  .tel{
+    font-size: 28rpx;
+    color:#333;
+    line-height: 40rpx;
+    .phone{
+      width: 34rpx;
+      vertical-align: middle;
+    }
+  }
+}
+.mr20{
+  margin-right: 20rpx;
+}
+.fr{
+  float: right;
+}
+.index-product-wrapper {
+  //padding: 0 30rpx;
+  margin-bottom: 110rpx;
+  min-height: 700rpx;
+  margin-top: 30rpx;
+  //background: #fff;
+
+  &.on {
+    min-height: 1500rpx;
+  }
+
+  .list-box {
+    display: flex;
+    flex-wrap: wrap;
+    justify-content: space-between;
+
+    .item {
+      width: 48.99%;
+      height: 490rpx;
+      background-color: #ffffff;
+      box-shadow: 0rpx 3rpx 13rpx 0rpx rgba(0, 0, 0, 0.13);
+      border-radius: 20rpx;
+      margin-bottom: 20rpx;
+
+      overflow: hidden;
+      display: flex;
+      flex-direction: column;
+      justify-content: space-between;
+
+      .pictrue {
+        position: relative;
+
+        image {
+          width: 100%;
+          height: 330rpx;
+        }
+      }
+
+      .text-info {
+        padding: 10rpx 20rpx 15rpx;
+
+        .title {
+          color: #222222;
+          display: flex;
+          align-items: center;
+          justify-items: space-between;
+          .tip {
+            width: 61rpx;
+            height: auto;
+            font-size: 22rpx;
+            display: flex;
+            justify-content: center;
+            align-items: center;
+            color: #ffffff;
+            position: relative;
+            margin-right: 5rpx;
+            background-color: #ef4800;
+            border-radius: 5rpx;
+          }
+          .text{
+            width: 80%;
+          }
+          .weight{
+            background-color: rgba(197, 128, 3, 0.10);
+            color: #C58003;
+            font-size: 24rpx;
+            padding: 8rpx 16rpx;
+            border-radius: 8rpx;
+            float: right;
+          }
+        }
+
+        .bottom-row {
+          color: $theme-color;
+          display: flex;
+          justify-content: space-between;
+          align-items: center;
+          font-size: 28rpx;
+          margin: 10rpx 0 0;
+
+          .price {
+            padding-bottom: 4rpx;
+            font-weight: 800;
+            white-space: nowrap;
+            font-size: 28rpx;
+            color: #f16327;
+          }
+
+          .sales {
+            color: #b4b4b4;
+            font-size: 22rpx;
+            white-space: nowrap;
+            color: #6e6e6e;
+          }
+        }
+      }
+    }
+
+    &.on {
+      display: flex;
+    }
+  }
+}
+.no-data {
+  margin: 150rpx auto 0;
+  text-align: center;
+
+  img {
+    width: 65%;
+    height: auto;
+  }
+}
+.mores-txt {
+  width: 100%;
+  align-items: center;
+  justify-content: center;
+  height: 70rpx;
+  color: #999;
+  font-size: 24rpx;
+
+  .iconfont {
+    margin-top: 2rpx;
+    font-size: 20rpx;
+  }
+}
+</style>

+ 359 - 135
pages/order_addcart/order_addcart.vue

@@ -1,108 +1,211 @@
 <template>
   <view>
     <view class="shoppingCart copy-data">
-      <view class="borRadius14 cartBox">
-        <view
-          v-if="cartList.valid.length > 0 || cartList.invalid.length > 0"
-          class="pad20"
-        >
+      <view class="borRadius14">
           <view
-            v-if="
+              v-if="
               (cartList.valid.length === 0 && cartList.invalid.length === 0) ||
               cartList.valid.length > 0
             "
-            class="nav acea-row row-between-wrapper"
+              class="nav acea-row row-between-wrapper"
           >
             <view
-              >购物车数量
+            >购物车数量
               <!-- <text class="num font-color">{{ cartCount }}</text></view> -->
               <text class="num font-color">{{ orderGoodsCount }}</text></view>
             <view
-              v-if="cartList.valid.length > 0 || cartList.invalid.length > 0"
-              class="administrate acea-row row-center-wrapper"
-              @click="manage"
-              >{{ footerswitch ? "管理" : "取消" }}
+                v-if="cartList.valid.length > 0 || cartList.invalid.length > 0"
+                class="administrate acea-row row-center-wrapper"
+                @click="manage"
+            >{{ footerswitch ? "管理" : "取消" }}
             </view>
           </view>
-          <view class="list">
-            <up-checkbox-group
-              @change="checkboxChange"
-              shape="circle"
-              v-model="shopCheckbox"
-            >
-              <block v-for="(item, index) in cartList.valid" :key="index">
-                <view class="item acea-row row-between-wrapper">
-                  <up-checkbox
-                    activeColor="#E93323"
-                    :name="item.id"
-                    :disabled="!item.attrStatus && footerswitch"
-                    :checked="item.checked"
-                    :customStyle="{ marginRight: '10px' }"
-                  ></up-checkbox>
-
-                  <navigator
-                    :render-link="false"
-                    :url="'/pages/goods_details/index?id=' + item.productId"
-                    hover-class="none"
-                    class="picTxt row-between-wrapper"
+      </view>
+      <view class="borRadius14 cartBox">
+        <view
+          v-if="cartList.valid.length > 0 || cartList.invalid.length > 0"
+          class="pad20"
+        >
+          <!-- 按商家分组的商品列表 -->
+          <view class="merchant-groups">
+            <block v-for="(merchant, merchantIndex) in groupedCartList" :key="merchantIndex">
+              <view class="merchant-group">
+                <!-- 商家头部 -->
+                <view class="merchant-header acea-row row-between-wrapper">
+                  <view class="merchant-info acea-row row-middle">
+                    <image class="merchant-logo" :src="merchant.logo" mode="aspectFill"></image>
+                    <text class="merchant-name">{{ merchant.name }}</text>
+                    <uni-icons type="right" size="14" color="#333333"></uni-icons>
+                  </view>
+                </view>
+
+                <!-- 商家下的商品列表 -->
+                <view class="list">
+                  <up-checkbox-group
+                      @change="checkboxChange"
+                      shape="circle"
+                      v-model="shopCheckbox"
                   >
-                    <view class="pictrue">
-                      <image :src="item.image"></image>
-                    </view>
-                    <view class="item-info">
-                      <view class="text">
-                        <view
-                          class="line1"
-                          :class="item.attrStatus ? '' : 'reColor'"
-                          >{{ item.storeName }}
-                        </view>
-                        <view class="attribute-box infor line1">
-                          <view class="attribute-suk" v-show="item.suk">属性:{{ item.suk }}</view>
-                          <view v-show="!item.attrStatus" class="invalid-count">数量:{{ item.cartNum }}</view>
-                        </view>
-                        <view class="labor-costs line1" v-if="item.attrStatus"
-                          >工费:{{ item.price }}/克</view
+                    <block v-for="(item, index) in merchant.products" :key="index">
+                      <view class="item acea-row row-between-wrapper">
+                        <up-checkbox
+                            activeColor="#F8C008"
+                            :name="item.id"
+                            :disabled="!item.attrStatus && footerswitch"
+                            :checked="item.checked"
+                            :customStyle="{ marginRight: '10px' }"
+                        ></up-checkbox>
+
+                        <navigator
+                            :render-link="false"
+                            :url="'/pages/goods_details/index?id=' + item.productId"
+                            hover-class="none"
+                            class="picTxt row-between-wrapper"
                         >
-                        <view class="money" v-if="item.attrStatus"
-                          >¥{{ item.storePrice }}</view
-                        >
-                        <!-- <view class='money' v-if="item.attrStatus">¥{{item.truePrice}}</view> -->
-                        <view
-                          class="reElection acea-row row-between-wrapper"
-                          v-else
-                        >
-                          <view class="title">请重新选择商品规格</view>
-                          <view
-                            class="reBnt cart-color acea-row row-center-wrapper"
-                            @click.stop="reElection(item)"
-                            >重选
+                          <view class="pictrue">
+                            <image :src="item.image"></image>
                           </view>
-                        </view>
-                      </view>
-                      <view
-                        class="carnum acea-row row-center-wrapper"
-                        v-if="item.attrStatus"
-                      >
-                        <view
-                          class="reduce"
-                          :class="item.numSub ? 'on' : ''"
-                          @click.stop="subCart(index)"
-                          >-</view
-                        >
-                        <view class="num">{{ item.cartNum }}</view>
-                        <view
-                          class="plus"
-                          :class="item.numAdd ? 'on' : ''"
-                          @click.stop="addCart(index)"
-                          >+</view
-                        >
+                          <view class="item-info">
+                            <view class="text">
+                              <view
+                                  class="line1"
+                                  :class="item.attrStatus ? '' : 'reColor'"
+                              >
+                                <view class="storeName">
+                                  {{ item.storeName }}
+                                </view>
+                                <view
+                                    class="carnum acea-row row-center-wrapper"
+                                    v-if="item.attrStatus"
+                                >
+                                  <view
+                                      class="reduce"
+                                      :class="item.numSub ? 'on' : ''"
+                                      @click.stop="subCart(index)"
+                                  >-</view
+                                  >
+                                  <view class="num">{{ item.cartNum }}</view>
+                                  <view
+                                      class="plus"
+                                      :class="item.numAdd ? 'on' : ''"
+                                      @click.stop="addCart(index)"
+                                  >+</view
+                                  >
+                                </view>
+                              </view>
+                              <view class="attribute-box infor line1">
+                                <view class="attribute-suk" v-show="item.suk">属性:{{ item.suk }}</view>
+                                <view v-show="!item.attrStatus" class="invalid-count">数量:{{ item.cartNum }}</view>
+                              </view>
+
+                              <view class="money" v-if="item.attrStatus"
+                              >¥{{ item.storePrice }}</view
+                              >
+                              <view class="labor-costs line1" v-if="item.attrStatus"
+                              >工费:{{ item.price }}/克</view
+                              >
+                              <!-- <view class='money' v-if="item.attrStatus">¥{{item.truePrice}}</view> -->
+                              <view
+                                  class="reElection acea-row row-between-wrapper"
+                                  v-else
+                              >
+                                <view class="title">请重新选择商品规格</view>
+                                <view
+                                    class="reBnt cart-color acea-row row-center-wrapper"
+                                    @click.stop="reElection(item)"
+                                >重选
+                                </view>
+                              </view>
+                            </view>
+
+                          </view>
+                        </navigator>
                       </view>
-                    </view>
-                  </navigator>
+                    </block>
+                  </up-checkbox-group>
                 </view>
-              </block>
-            </up-checkbox-group>
+              </view>
+            </block>
           </view>
+<!--          <view class="list">-->
+<!--            <up-checkbox-group-->
+<!--              @change="checkboxChange"-->
+<!--              shape="circle"-->
+<!--              v-model="shopCheckbox"-->
+<!--            >-->
+<!--              <block v-for="(item, index) in cartList.valid" :key="index">-->
+<!--                <view class="item acea-row row-between-wrapper">-->
+<!--                  <up-checkbox-->
+<!--                    activeColor="#F8C008"-->
+<!--                    :name="item.id"-->
+<!--                    :disabled="!item.attrStatus && footerswitch"-->
+<!--                    :checked="item.checked"-->
+<!--                    :customStyle="{ marginRight: '10px' }"-->
+<!--                  ></up-checkbox>-->
+
+<!--                  <navigator-->
+<!--                    :render-link="false"-->
+<!--                    :url="'/pages/goods_details/index?id=' + item.productId"-->
+<!--                    hover-class="none"-->
+<!--                    class="picTxt row-between-wrapper"-->
+<!--                  >-->
+<!--                    <view class="pictrue">-->
+<!--                      <image :src="item.image"></image>-->
+<!--                    </view>-->
+<!--                    <view class="item-info">-->
+<!--                      <view class="text">-->
+<!--                        <view-->
+<!--                          class="line1"-->
+<!--                          :class="item.attrStatus ? '' : 'reColor'"-->
+<!--                          >{{ item.storeName }}-->
+<!--                        </view>-->
+<!--                        <view class="attribute-box infor line1">-->
+<!--                          <view class="attribute-suk" v-show="item.suk">属性:{{ item.suk }}</view>-->
+<!--                          <view v-show="!item.attrStatus" class="invalid-count">数量:{{ item.cartNum }}</view>-->
+<!--                        </view>-->
+<!--                        <view class="labor-costs line1" v-if="item.attrStatus"-->
+<!--                          >工费:{{ item.price }}/克</view-->
+<!--                        >-->
+<!--                        <view class="money" v-if="item.attrStatus"-->
+<!--                          >¥{{ item.storePrice }}</view-->
+<!--                        >-->
+<!--                        &lt;!&ndash; <view class='money' v-if="item.attrStatus">¥{{item.truePrice}}</view> &ndash;&gt;-->
+<!--                        <view-->
+<!--                          class="reElection acea-row row-between-wrapper"-->
+<!--                          v-else-->
+<!--                        >-->
+<!--                          <view class="title">请重新选择商品规格</view>-->
+<!--                          <view-->
+<!--                            class="reBnt cart-color acea-row row-center-wrapper"-->
+<!--                            @click.stop="reElection(item)"-->
+<!--                            >重选-->
+<!--                          </view>-->
+<!--                        </view>-->
+<!--                      </view>-->
+<!--                      <view-->
+<!--                        class="carnum acea-row row-center-wrapper"-->
+<!--                        v-if="item.attrStatus"-->
+<!--                      >-->
+<!--                        <view-->
+<!--                          class="reduce"-->
+<!--                          :class="item.numSub ? 'on' : ''"-->
+<!--                          @click.stop="subCart(index)"-->
+<!--                          >-</view-->
+<!--                        >-->
+<!--                        <view class="num">{{ item.cartNum }}</view>-->
+<!--                        <view-->
+<!--                          class="plus"-->
+<!--                          :class="item.numAdd ? 'on' : ''"-->
+<!--                          @click.stop="addCart(index)"-->
+<!--                          >+</view-->
+<!--                        >-->
+<!--                      </view>-->
+<!--                    </view>-->
+<!--                  </navigator>-->
+<!--                </view>-->
+<!--              </block>-->
+<!--            </up-checkbox-group>-->
+<!--          </view>-->
           <!-- cartList.valid.length===0 && cartList.invalid.length > 0 -->
           <view
             v-if="cartList.invalid.length > 0"
@@ -190,17 +293,18 @@
         <up-checkbox-group shape="circle" @change="checkboxAllChange">
           <!-- <checkbox value="all" :checked="!!isAllSelect" /> -->
           <up-checkbox
-            activeColor="#E93323"
+            activeColor="#F8C008"
             :checked="!!isAllSelect"
           ></up-checkbox>
           <text class="checkAll">全选({{ selectValue.length }})</text>
         </up-checkbox-group>
       </view>
       <view class="money acea-row row-middle" v-if="footerswitch == true">
+        <text style="font-size: 24rpx;color: #333;">合计:</text>
         <text class="font-color">¥{{ selectCountPrice }}</text>
         <form @submit="subOrder" report-submit="true">
           <button class="placeOrder bg-color" formType="submit">
-            立即下单
+            结算
           </button>
         </form>
       </view>
@@ -238,7 +342,7 @@
 </template>
 
 <script setup>
-import { ref, reactive, computed } from "vue";
+import { ref, reactive, computed,watch } from "vue";
 import { onLoad, onShow, onReachBottom } from "@dcloudio/uni-app";
 import { useAppStore } from "@/stores/app.js";
 import {
@@ -347,10 +451,71 @@ onReachBottom(() => {
   }
 });
 
+// 计算属性:按商家分组购物车商品
+const groupedCartList = computed(() => {
+  const groups = {};
+
+  cartList.valid.forEach(item => {
+    const merchant = item.sbMerchant;
+    if (merchant && merchant.id) {
+      const merchantId = merchant.id;
+
+      if (!groups[merchantId]) {
+        groups[merchantId] = {
+          id: merchantId,
+          name: merchant.merchantName || '未知商家',
+          logo: merchant.merchantLogo || '/static/images/default-store.png',
+          products: []
+        };
+      }
+
+      groups[merchantId].products.push(item);
+    } else {
+      // 如果没有商家信息,放到默认分组
+      const defaultId = 'default';
+      if (!groups[defaultId]) {
+        groups[defaultId] = {
+          id: defaultId,
+          name: '其他商家',
+          logo: '/static/images/default-store.png',
+          products: []
+        };
+      }
+      groups[defaultId].products.push(item);
+    }
+  });
+
+  return Object.values(groups);
+});
+
 const orderGoodsCount = computed(() => {
   // console.log('fsdfsdfsd', cartList, cartList)
   return cartList.valid.length + cartList.invalid.length;
 });
+// 监听购物车数据变化,重新计算选中状态
+watch(() => cartList.valid, (newVal) => {
+  calculateSelectStatus();
+}, { deep: true });
+
+// 重新计算选中状态
+function calculateSelectStatus() {
+  const validList = cartList.valid;
+  const selectValueArr = selectValue.value;
+  let checkedCount = 0;
+  let totalValidCount = 0;
+
+  validList.forEach(item => {
+    if (item.attrStatus) {
+      totalValidCount++;
+      if (selectValueArr.includes(item.id)) {
+        checkedCount++;
+      }
+    }
+  });
+
+  isAllSelect.value = totalValidCount > 0 && checkedCount === totalValidCount;
+  switchSelect();
+}
 
 const closeProductPopup = () => {
   showProductPopup.value = false;
@@ -628,62 +793,62 @@ function checkboxAllChange(value) {
 function setAllSelectValue(status) {
   const valid = cartList.valid;
   let selectValueArr = [];
-  if (valid.length > 0) {
-    let newValid = valid.map((item) => {
-      if (status) {
-        if (footerswitch.value) {
-          if (item.attrStatus) {
-            item.checked = true;
-            selectValueArr.push(item.id);
-          } else {
-            item.checked = false;
-          }
-        } else {
+
+  valid.forEach(item => {
+    if (status) {
+      if (footerswitch.value) {
+        if (item.attrStatus) {
           item.checked = true;
           selectValueArr.push(item.id);
+        } else {
+          item.checked = false;
         }
-        isAllSelect.value = true;
       } else {
-        item.checked = false;
-        isAllSelect.value = false;
+        item.checked = true;
+        selectValueArr.push(item.id);
       }
-      return item;
-    });
-    cartList.valid = newValid;
-    selectValue.value = selectValueArr;
-    switchSelect();
-  }
+    } else {
+      item.checked = false;
+    }
+  });
+
+  cartList.valid = [...valid];
+  selectValue.value = selectValueArr;
+  isAllSelect.value = status === 1;
+  switchSelect();
 }
 
 function checkboxChange(value) {
   const valid = cartList.valid;
-  let arr1 = [];
-  let arr2 = [];
-  let arr3 = [];
-  let newValid = valid.map((item) => {
-    if (inArray(item.id, value)) {
+  let checkedItems = [];
+  let uncheckedItems = [];
+  let invalidItems = [];
+
+  valid.forEach(item => {
+    if (value.includes(item.id)) {
       if (footerswitch.value) {
         if (item.attrStatus) {
           item.checked = true;
-          arr1.push(item);
+          checkedItems.push(item);
         } else {
           item.checked = false;
         }
       } else {
         item.checked = true;
-        arr1.push(item);
+        checkedItems.push(item);
       }
     } else {
       item.checked = false;
-      arr2.push(item);
+      uncheckedItems.push(item);
     }
-    return item;
   });
+
   if (footerswitch.value) {
-    arr3 = arr2.filter((item) => !item.attrStatus);
+    invalidItems = uncheckedItems.filter(item => !item.attrStatus);
   }
-  cartList.valid = newValid;
-  isAllSelect.value = newValid.length === arr1.length + arr3.length;
+
+  cartList.valid = [...valid];
+  isAllSelect.value = valid.length === checkedItems.length + invalidItems.length;
   selectValue.value = value;
   switchSelect();
 }
@@ -1054,7 +1219,12 @@ function unsetCart() {
           width: 396rpx;
           font-size: 28rpx;
           color: #282828;
-
+          display: flex;
+          justify-content: space-between;
+          align-items: center;
+          .storeName{
+            width: 70%;
+          }
           .reColor {
             color: #999;
           }
@@ -1213,7 +1383,7 @@ function unsetCart() {
 .footer {
   z-index: 9;
   width: 100%;
-  height: 100rpx;
+  height: 132rpx;
   background-color: #fff;
   position: fixed;
   padding: 0 24rpx;
@@ -1221,9 +1391,11 @@ function unsetCart() {
   border-top: 1rpx solid #eee;
   bottom: 0;
 
+
   .checkAll {
     font-size: 28rpx;
-    color: #282828;
+    line-height: 56rpx;
+    color: #333333;
     margin-left: 14rpx;
   }
   .money {
@@ -1233,13 +1405,13 @@ function unsetCart() {
     }
   }
   .placeOrder {
-    color: #fff;
-    font-size: 30rpx;
-    width: 226rpx;
-    height: 70rpx;
-    border-radius: 50rpx;
+    color: #333;
+    font-size: 32rpx;
+    width: 192rpx;
+    height: 88rpx;
+    border-radius: 16rpx;
     text-align: center;
-    line-height: 70rpx;
+    line-height: 88rpx;
     margin-left: 22rpx;
   }
   .button {
@@ -1272,10 +1444,62 @@ function unsetCart() {
 .uni-p-b-96 {
   height: 96rpx;
 }
-// .my_nav {
-//   top: calc(44px + 88rpx + 50rpx) !important;
-// }
-// .my_nav_top {
-//   margin-top: calc(44px + 88rpx + 30rpx + 105rpx) !important;
-// }
+.merchant-groups {
+  margin-bottom: 20rpx;
+}
+
+.merchant-group {
+  background: #fff;
+  border-radius: 16rpx;
+  margin-bottom: 20rpx;
+  overflow: hidden;
+
+  .merchant-header {
+    padding: 24rpx;
+
+    .merchant-info {
+      .merchant-logo {
+        width: 40rpx;
+        height: 40rpx;
+        border-radius: 50%;
+        margin-right: 20rpx;
+      }
+
+      .merchant-name {
+        font-size: 24rpx;
+        color: #333;
+      }
+    }
+
+    .merchant-action {
+      display: flex;
+      align-items: center;
+      color: #999;
+      font-size: 24rpx;
+
+      text {
+        margin-right: 8rpx;
+      }
+    }
+  }
+
+  .merchant-products {
+    padding: 0 24rpx;
+  }
+}
+
+// 调整商品项样式以适应分组布局
+.item {
+  padding: 24rpx 0;
+  border-bottom: 1rpx solid #f5f5f5;
+
+  &:last-child {
+    border-bottom: none;
+  }
+}
+
+// 其他原有样式保持不变
+.cartBox {
+  margin-top: 20rpx;
+}
 </style>

+ 1 - 1
pages/personal_info/personal_info.vue

@@ -1,7 +1,7 @@
 <template>
   <view class="personal-info">
     <!-- 上传 -->
-    <view class="upload-box border-bottom">
+    <view class="upload-box">
       <up-upload
         @afterRead="
           async (e) => {

Файловите разлики са ограничени, защото са твърде много
+ 531 - 915
pages/user/index.vue


+ 1 - 3
pages/users/my_merchant/index.vue

@@ -42,9 +42,7 @@
 <script setup>
 import { ref } from 'vue';
 import { onLoad, onShow, onReachBottom } from "@dcloudio/uni-app";
-import {
-  getSbmerchantInfo
-} from "@/api/merchant.js";
+import { getSbmerchantInfo } from "@/api/merchant.js";
 import { toLogin } from "@/libs/login.js";
 import { useAppStore } from "@/stores/app.js";
 const appStore = useAppStore();

+ 3 - 3
static/css/base.css

@@ -1,16 +1,16 @@
 @charset "UTF-8";
 
 .font-color,.font-color-red {
-	color: #E93323!important
+	color: #FD5F3C!important
 }
 
 .bg-color {
 	/* background-color: #E93323 !important */
-	background-color: #e9c279 !important
+	background-color: #F8C008 !important
 }
 
 .icon-color {
-	color: #E93323
+	color: #FD5F3C
 }
 
 .cart-color {

BIN
static/images/phone2.png


BIN
static/images/phoneyellow.png


BIN
static/images/setting.png


BIN
static/images/setting/bofang.png


BIN
static/images/setting/cunliao.png


BIN
static/images/setting/daifahuo.png


BIN
static/images/setting/daifukuan.png


BIN
static/images/setting/daishouhuo.png


BIN
static/images/setting/dianpu.png


BIN
static/images/setting/dingwei.png


BIN
static/images/setting/lianxikefu.png


BIN
static/images/setting/mailiao.png


BIN
static/images/setting/mailiao2.png


BIN
static/images/setting/shoucang.png


BIN
static/images/setting/tiliao.png


BIN
static/images/setting/tuikuan.png


BIN
static/images/setting/vip.png


BIN
static/images/setting/vipBG.png


BIN
static/images/setting/vipIcon.png


BIN
static/images/setting/xiazaiapp.png


BIN
static/images/setting/yijianjianyi.png


BIN
static/images/setting/yiwancheng.png


BIN
static/images/setting/zuji.png


BIN
static/images/tabbar/1-001.png


BIN
static/images/tabbar/2-001.png


BIN
static/images/tabbar/3-001.png


BIN
static/images/tabbar/3-003.png


BIN
static/images/tabbar/4-001.png


BIN
static/images/tabbar/4-003.png