ext.liuqiwen3 1 天之前
父节点
当前提交
b285330465

+ 11 - 7
pages/change_password/change_password.vue

@@ -5,6 +5,10 @@
         <form @submit.prevent="submit">
         <form @submit.prevent="submit">
           <view class="item">
           <view class="item">
             <view class="acea-row row-middle">
             <view class="acea-row row-middle">
+              <image
+                  src="https://sb-admin.oss-cn-shenzhen.aliyuncs.com/crmebimage/public/maintain/2025/08/28/phone_1.png"
+                  style="width: 24rpx; height: 34rpx"
+              ></image>
               <input
               <input
                 type="text"
                 type="text"
                 class="texts"
                 class="texts"
@@ -180,9 +184,9 @@ page {
             font-size: 28rpx;
             font-size: 28rpx;
             height: 80rpx;
             height: 80rpx;
             line-height: 80rpx;
             line-height: 80rpx;
-            display: flex;
-            justify-content: center;
-            align-items: center;
+            //display: flex;
+            //justify-content: center;
+            //align-items: center;
           }
           }
 
 
           input {
           input {
@@ -190,9 +194,9 @@ page {
             font-size: 28rpx;
             font-size: 28rpx;
             height: 80rpx;
             height: 80rpx;
             line-height: 80rpx;
             line-height: 80rpx;
-            display: flex;
-            justify-content: center;
-            align-items: center;
+            //display: flex;
+            //justify-content: center;
+            //align-items: center;
           }
           }
 
 
           .code {
           .code {
@@ -218,7 +222,7 @@ page {
       height: 86rpx;
       height: 86rpx;
       margin-top: 80rpx;
       margin-top: 80rpx;
       background-color: $theme-color;
       background-color: $theme-color;
-      border-radius: 120rpx;
+      border-radius: 16rpx;
       color: #ffffff;
       color: #ffffff;
       font-size: 30rpx;
       font-size: 30rpx;
     }
     }

+ 58 - 50
pages/goods/goods_details/index.vue

@@ -59,9 +59,9 @@
                     <view class="money font-color">
                     <view class="money font-color">
                       <text class="num">¥{{ attr.productSelect.storePrice }}</text>
                       <text class="num">¥{{ attr.productSelect.storePrice }}</text>
                     </view>
                     </view>
-                    <view @click="listenerActionSheet" class="share share-top">
-                      <uni-icons size="24" type="redo"></uni-icons>
-                    </view>
+<!--                    <view @click="listenerActionSheet" class="share share-top">-->
+<!--                      <uni-icons size="24" type="redo"></uni-icons>-->
+<!--                    </view>-->
                   </view>
                   </view>
                   <view class="label acea-row row-between-wrapper">
                   <view class="label acea-row row-between-wrapper">
                     <view>工费:{{ attr.productSelect.price || 0 }}元/g</view>
                     <view>工费:{{ attr.productSelect.price || 0 }}元/g</view>
@@ -69,20 +69,20 @@
                     <view>
                     <view>
                       附加费:{{ attr.productSelect.additionalAmount || "" }}
                       附加费:{{ attr.productSelect.additionalAmount || "" }}
                     </view>
                     </view>
-                    <view >
-                      销量:{{
-                        Number(productInfo?.sales || 0) + productInfo.ficti || "0"
-                      }}件
-                    </view>
+<!--                    <view >-->
+<!--                      销量:{{-->
+<!--                        Number(productInfo?.sales || 0) + productInfo.ficti || "0"-->
+<!--                      }}件-->
+<!--                    </view>-->
                   </view>
                   </view>
                 </view>
                 </view>
-<!--                <view class="sales-container">-->
-<!--                  <text class="sales-text">-->
-<!--                    销量:{{-->
-<!--                      Number(productInfo?.sales || 0) + productInfo.ficti || "0"-->
-<!--                    }}件-->
-<!--                  </text>-->
-<!--                </view>-->
+                <view class="sales-container">
+                  <text class="sales-text">
+                    已售:{{
+                      Number(productInfo?.sales || 0) + productInfo.ficti || "0"
+                    }}件
+                  </text>
+                </view>
               </view>
               </view>
 
 
               <view class="introduce" style="margin-bottom: 0;">{{ productInfo.storeName }}</view>
               <view class="introduce" style="margin-bottom: 0;">{{ productInfo.storeName }}</view>
@@ -252,7 +252,7 @@
           customPrefix="iconfont"
           customPrefix="iconfont"
           type="icon-kefu1"
           type="icon-kefu1"
         ></uni-icons>
         ></uni-icons>
-        <view>客服</view>
+        <view style="margin-top: 8rpx;">客服</view>
       </button>
       </button>
       <button
       <button
           @click="setCollect"
           @click="setCollect"
@@ -273,34 +273,42 @@
             type="icon-shoucang"
             type="icon-shoucang"
             v-else
             v-else
         ></uni-icons>
         ></uni-icons>
-      <view>收藏</view>
+      <view style="margin-top: 8rpx;">收藏</view>
       </button>
       </button>
-      <block v-if="type === 'normal'">
-        <view
-          class="animated item"
-          :class="animated == true ? 'bounceIn' : ''"
-          url="/pages/order_addcart/order_addcart"
+      <button
+          @click="listenerActionSheet"
           hover-class="none"
           hover-class="none"
-          @click="toShopCart"
-        >
-          <uni-icons
-            size="22"
-            color="#666"
-            customPrefix="iconfont"
-            type="icon-gouwuche"
-            class="icon-item"
-          >
-            <text v-if="Math.floor(CartCount) > 0" class="num bg-color">{{
-              CartCount
-            }}</text>
-          </uni-icons>
-          <!-- <view class="iconfont icon-gouwuche1">
-            <text v-if="Math.floor(CartCount) > 0" class="num bg-color">{{
-              CartCount
-            }}</text>
-          </view> -->
-          <view>购物车</view>
-        </view>
+          class="item"
+      >
+        <image src="@/static/images/share.png" style="width: 44rpx;height: 44rpx;"></image>
+        <view>分享</view>
+      </button>
+      <block v-if="type === 'normal'">
+<!--        <view-->
+<!--          class="animated item"-->
+<!--          :class="animated == true ? 'bounceIn' : ''"-->
+<!--          url="/pages/order_addcart/order_addcart"-->
+<!--          hover-class="none"-->
+<!--          @click="toShopCart"-->
+<!--        >-->
+<!--          <uni-icons-->
+<!--            size="22"-->
+<!--            color="#666"-->
+<!--            customPrefix="iconfont"-->
+<!--            type="icon-gouwuche"-->
+<!--            class="icon-item"-->
+<!--          >-->
+<!--            <text v-if="Math.floor(CartCount) > 0" class="num bg-color">{{-->
+<!--              CartCount-->
+<!--            }}</text>-->
+<!--          </uni-icons>-->
+<!--          &lt;!&ndash; <view class="iconfont icon-gouwuche1">-->
+<!--            <text v-if="Math.floor(CartCount) > 0" class="num bg-color">{{-->
+<!--              CartCount-->
+<!--            }}</text>-->
+<!--          </view> &ndash;&gt;-->
+<!--          <view>购物车</view>-->
+<!--        </view>-->
         <view class="bnt acea-row" v-if="attr.productSelect.stock <= 0">
         <view class="bnt acea-row" v-if="attr.productSelect.stock <= 0">
           <form @submit="joinCart" report-submit="true">
           <form @submit="joinCart" report-submit="true">
             <button class="joinCart bnts" form-type="submit">加入购物车</button>
             <button class="joinCart bnts" form-type="submit">加入购物车</button>
@@ -368,20 +376,20 @@
     <!-- 分享按钮 -->
     <!-- 分享按钮 -->
     <view class="generate-posters acea-row row-middle" :class="posters ? 'on' : ''">
     <view class="generate-posters acea-row row-middle" :class="posters ? 'on' : ''">
       <!-- #ifndef MP -->
       <!-- #ifndef MP -->
-      <view class="item" hover-class='none' v-if="weixinStatus === true" @click="H5ShareBox = true">
+      <button class="item" hover-class='none' v-if="weixinStatus === true" @click="H5ShareBox = true">
         <view>
         <view>
           <image class="shareImg" src="@/static/images/wexin.png" mode="widthFix"></image>
           <image class="shareImg" src="@/static/images/wexin.png" mode="widthFix"></image>
         </view>
         </view>
         <view class="">发送给朋友</view>
         <view class="">发送给朋友</view>
-      </view>
+      </button>
       <!-- #endif -->
       <!-- #endif -->
       <!-- #ifdef MP -->
       <!-- #ifdef MP -->
-      <view class="item" open-type="share" hover-class='none' @click="goFriend">
+      <button class="item" open-type="share" hover-class='none' @click="goFriend">
         <view class="">
         <view class="">
           <image class="shareImg" src="@/static/images/wexin.png" mode="widthFix"></image>
           <image class="shareImg" src="@/static/images/wexin.png" mode="widthFix"></image>
         </view>
         </view>
         <view class="">发送给朋友</view>
         <view class="">发送给朋友</view>
-      </view>
+      </button>
       <!-- #endif -->
       <!-- #endif -->
       <view class="item" hover-class='none' @click="goPoster">
       <view class="item" hover-class='none' @click="goPoster">
         <view style="display: flex;justify-content: center;align-items: center;">
         <view style="display: flex;justify-content: center;align-items: center;">
@@ -1381,13 +1389,13 @@ function setCollect () {
       }
       }
 
 
       .joinCart {
       .joinCart {
-        border-radius: 50rpx 0 0 50rpx;
-        background-image: linear-gradient(to right, #fea10f 0%, #fa8013 100%);
+        border-radius: 16rpx 0 0 16rpx;
+        background-image: linear-gradient(to right, #694300 0%, #261800 100%);
       }
       }
 
 
       .buy {
       .buy {
-        border-radius: 0 50rpx 50rpx 0;
-        background-image: linear-gradient(to right, #fa6514 0%, #e93323 100%);
+        border-radius: 0 16rpx 16rpx 0;
+        background-image: linear-gradient(to right, #FFE079 0%, #F8C008 100%);
       }
       }
     }
     }
   }
   }

+ 68 - 78
pages/merchantCenters/components/merchant_cate.vue

@@ -2,23 +2,17 @@
   <view class='productSort'>
   <view class='productSort'>
     <view class='aside' :style="{bottom: tabbarH + 'px',height: height + 'rpx'}">
     <view class='aside' :style="{bottom: tabbarH + 'px',height: height + 'rpx'}">
       <scroll-view scroll-y="true" scroll-with-animation='true' style="height: 100%;">
       <scroll-view scroll-y="true" scroll-with-animation='true' style="height: 100%;">
-        <view class='item acea-row row-center-wrapper'
-              :class='index==navActive?"on":""'
-              v-for="(item,index) in productList"
-              :key="index"
-              @click='tap(index,"b"+index)'>
+        <view class='item acea-row row-center-wrapper' :class='index==navActive?"on":""'
+              v-for="(item,index) in productList" :key="index" @click='tap(index,"b"+index)'>
           <text>{{item.name}}</text>
           <text>{{item.name}}</text>
         </view>
         </view>
       </scroll-view>
       </scroll-view>
     </view>
     </view>
     <view class='conter'>
     <view class='conter'>
-      <scroll-view scroll-y="true"
-                   :scroll-into-view="toView"
-                   :style='"height:"+height+"rpx;"'
-                   @scroll="scroll"
+      <scroll-view scroll-y="true" :scroll-into-view="toView" :style='"height:"+height+"rpx;"' @scroll="scroll"
                    scroll-with-animation='true'>
                    scroll-with-animation='true'>
         <view v-for="(item,index) in productList" :key="index">
         <view v-for="(item,index) in productList" :key="index">
-          <view class='listw' :id="'b'+index">
+          <view class='listw'>
             <view class='title acea-row row-center-wrapper'>
             <view class='title acea-row row-center-wrapper'>
               <view class='line'></view>
               <view class='line'></view>
               <view class='name'>{{item.name}}</view>
               <view class='name'>{{item.name}}</view>
@@ -27,7 +21,7 @@
             <view class='list acea-row'>
             <view class='list acea-row'>
               <view v-for="(itemn,indexn) in item.child" :key="indexn">
               <view v-for="(itemn,indexn) in item.child" :key="indexn">
                 <navigator hover-class='none'
                 <navigator hover-class='none'
-                           :url='"/pages/goods/goods_search/index?cid="+itemn.id+"&title="+itemn.name+"&merchantId="+props.merchantId'
+                           :url='"/pages/goods_search/index?cid="+itemn.id+"&title="+itemn.name+"&merchantId="+props.merchantId'
                            class='item acea-row row-column row-middle'>
                            class='item acea-row row-column row-middle'>
                   <view class='name line1'>{{itemn.name}}</view>
                   <view class='name line1'>{{itemn.name}}</view>
                 </navigator>
                 </navigator>
@@ -41,10 +35,21 @@
   </view>
   </view>
 </template>
 </template>
 <script setup>
 <script setup>
-import { ref, onMounted, nextTick,watch} from 'vue';
-import { onLoad, onShow } from '@dcloudio/uni-app';
-import { productCategory } from '@/api/merchant.js';
-
+import {
+  ref,
+  onMounted,
+  nextTick,
+  watch,
+  getCurrentInstance
+} from 'vue';
+import {
+  onLoad,
+  onShow
+} from '@dcloudio/uni-app';
+import {
+  productCategory
+} from '@/api/merchant.js';
+const instance = getCurrentInstance();
 const props = defineProps({
 const props = defineProps({
   merchantId: {
   merchantId: {
     type: [String, Number],
     type: [String, Number],
@@ -70,7 +75,9 @@ const getAllCategory = async () => {
       type: 1,
       type: 1,
       status: 1
       status: 1
     }
     }
-    const { data }= await productCategory(obj);
+    const {
+      data
+    } = await productCategory(obj);
     const newArr = []
     const newArr = []
     data.forEach((value, index) => {
     data.forEach((value, index) => {
       newArr[index] = value
       newArr[index] = value
@@ -80,51 +87,36 @@ const getAllCategory = async () => {
     productList.value = listArr.sort((a, b) => a.sort - b.sort);
     productList.value = listArr.sort((a, b) => a.sort - b.sort);
 
 
     // 使用 nextTick 确保 DOM 已更新
     // 使用 nextTick 确保 DOM 已更新
-    nextTick(() => {
-      setTimeout(() => {
-        infoScroll();
-      }, 500);
-    });
+    // nextTick(() => {
+    // 	setTimeout(() => {
+    // 		infoScroll();
+    // 	}, 500);
+    // });
   } catch (error) {
   } catch (error) {
     console.error('获取分类列表失败:', error);
     console.error('获取分类列表失败:', error);
-    uni.showToast({ title: '加载分类失败' });
+    uni.showToast({
+      title: '加载分类失败'
+    });
   }
   }
 };
 };
-
 // 计算滚动相关数据
 // 计算滚动相关数据
 const infoScroll = () => {
 const infoScroll = () => {
-  console.log('infoScroll++++++++')
-  let len = productList.value.length;
-  let child = productList.value[len - 1] && productList.value[len - 1].child
-      ? productList.value[len - 1].child
-      : [];
-  number.value = child ? child.length : 0;
+  nextTick(() => {
+    setTimeout(() => {
+      const len = productList.value.length;
 
 
-  // 设置商品列表高度
-  uni.getSystemInfo({
-    success: (res) => {
-      height.value = (res.windowHeight) * (750 / res.windowWidth) - 98;
-    },
-  });
-
-  let heightTemp = 0;
-  let hightArrTemp = [];
+      // 创建查询对象,并指定在当前组件实例中查询
+      const query = uni.createSelectorQuery().in(instance);
 
 
-  for (let i = 0; i < len; i++) {
-    // 获取元素所在位置
-    let query = uni.createSelectorQuery();
-    let idView = "#b" + i;
-    query.select(idView).boundingClientRect();
-    query.exec((res) => {
-      if (res && res[0]) {
-        let top = res[0].top;
-        hightArrTemp.push(top);
-        hightArr.value = hightArrTemp;
-        console.log('hightArr.value======')
-        console.log(hightArr.value)
-      }
-    });
-  }
+      // 先查询所有元素
+      query.selectAll('.listw').boundingClientRect((rects) => {
+        if (rects) {
+          hightArr.value = rects.map(rect => rect.top);
+          console.log('hightArr:', hightArr.value);
+        }
+      }).exec();
+    }, 500);
+  });
 };
 };
 
 
 // 点击左侧导航
 // 点击左侧导航
@@ -138,32 +130,17 @@ const scroll = (e) => {
   let scrollTop = e.detail.scrollTop;
   let scrollTop = e.detail.scrollTop;
   let scrollArr = hightArr.value;
   let scrollArr = hightArr.value;
 
 
-  console.log('scrollTop:', scrollTop, 'scrollArr:', scrollArr);
-
-  if (!scrollArr || scrollArr.length === 0 || scrollArr.length < 2) return;
-
-  // 修正逻辑:减去第一个元素的高度作为偏移量
-  const baseOffset = scrollArr[0] || 0;
-  const adjustedScrollTop = scrollTop + baseOffset;
+  if (!scrollArr || scrollArr.length === 0) return;
 
 
-  // 找到当前应该激活的索引
-  let currentIndex = 0;
   for (let i = 0; i < scrollArr.length; i++) {
   for (let i = 0; i < scrollArr.length; i++) {
-    if (i === 0 && adjustedScrollTop < scrollArr[0]) {
-      currentIndex = 0;
-      break;
-    } else if (i === scrollArr.length - 1 && adjustedScrollTop >= scrollArr[i]) {
-      currentIndex = i;
-      break;
-    } else if (adjustedScrollTop >= scrollArr[i] && adjustedScrollTop < scrollArr[i + 1]) {
-      currentIndex = i;
-      break;
+    if (scrollTop >= 0 && scrollTop < scrollArr[1] - scrollArr[0]) {
+      navActive.value = 0;
+    } else if (scrollTop >= scrollArr[i] - scrollArr[0] && scrollTop < scrollArr[i + 1] - scrollArr[0]) {
+      navActive.value = i;
+    } else if (scrollTop >= scrollArr[scrollArr.length - 1] - scrollArr[0]) {
+      navActive.value = scrollArr.length - 1;
     }
     }
   }
   }
-
-  if (navActive.value !== currentIndex) {
-    navActive.value = currentIndex;
-  }
 };
 };
 // 监听 merchantId 变化
 // 监听 merchantId 变化
 watch(() => props.merchantId, (newVal) => {
 watch(() => props.merchantId, (newVal) => {
@@ -171,7 +148,9 @@ watch(() => props.merchantId, (newVal) => {
   if (newVal) {
   if (newVal) {
     getAllCategory();
     getAllCategory();
   }
   }
-}, { immediate: true }); // 立即执行一次
+}, {
+  immediate: true
+}); // 立即执行一次
 
 
 // 页面加载
 // 页面加载
 onLoad(() => {
 onLoad(() => {
@@ -181,7 +160,17 @@ onLoad(() => {
 // 页面显示
 // 页面显示
 onShow(() => {
 onShow(() => {
   getAllCategory();
   getAllCategory();
+  // // 设置商品列表高度
+  uni.getSystemInfo({
+    success: (res) => {
+      height.value = (res.windowHeight) * (750 / res.windowWidth) - (88 + 30 + 30);
+    },
+  });
 });
 });
+
+defineExpose({
+  infoScroll
+})
 </script>
 </script>
 
 
 <style scoped lang="scss">
 <style scoped lang="scss">
@@ -189,7 +178,7 @@ onShow(() => {
   position: absolute;
   position: absolute;
   width: 180rpx;
   width: 180rpx;
   left: 0;
   left: 0;
-  top:0;
+  top: 0;
   background-color: #fff;
   background-color: #fff;
   overflow-y: scroll;
   overflow-y: scroll;
   overflow-x: hidden;
   overflow-x: hidden;
@@ -260,7 +249,8 @@ onShow(() => {
   width: 100%;
   width: 100%;
   height: 100%;
   height: 100%;
   border-radius: 50%;
   border-radius: 50%;
-  div{
+
+  div {
     background-color: #f7f7f7;
     background-color: #f7f7f7;
   }
   }
 }
 }

+ 17 - 3
pages/merchantCenters/merchant.vue

@@ -90,13 +90,13 @@
         <text>我是有底线的</text>
         <text>我是有底线的</text>
       </view>
       </view>
     </view>
     </view>
-    <view class="index-product-wrapper" v-if="tabActive == '1'">
-      <merchantCate :merchant-id="query.merchantId || merchantInfo.id" />
+    <view class="index-product-wrapper" v-show="tabActive == '1'">
+      <merchantCate ref="merchantCateRef" :merchant-id="query.merchantId || merchantInfo.id" />
     </view>
     </view>
   </view>
   </view>
 </template>
 </template>
 <script setup>
 <script setup>
-import {computed, ref} from 'vue';
+import {computed, nextTick, ref} from 'vue';
 import { onLoad, onShow, onReachBottom } from "@dcloudio/uni-app";
 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"
@@ -130,6 +130,7 @@ const params = ref({
 });
 });
 const loading = ref(false);
 const loading = ref(false);
 const goodScroll = ref(true);
 const goodScroll = ref(true);
+const merchantCateRef = ref()
 
 
 const calculatedProducts = computed(() => {
 const calculatedProducts = computed(() => {
   // 计算逻辑与原代码一致,但基于响应式数据 products
   // 计算逻辑与原代码一致,但基于响应式数据 products
@@ -179,6 +180,19 @@ const getSbmerchantInfoFn = async () => {
 const tabChange = (item) => {
 const tabChange = (item) => {
   console.log('item',item)
   console.log('item',item)
   tabActive.value = item.code;
   tabActive.value = item.code;
+  if(item.code==1){
+    try {
+      setTimeout(()=>{
+        nextTick(()=>{
+          merchantCateRef.value.infoScroll();
+        })
+      },500)
+    } catch (error) {
+      console.log(error)
+      //TODO handle the exception
+    }
+
+  }
 }
 }
 // Product Lists
 // Product Lists
 const getGroomList = async () => {
 const getGroomList = async () => {

+ 7 - 7
pages/users/login/index.vue

@@ -542,9 +542,9 @@ page {
             font-size: 28rpx;
             font-size: 28rpx;
             height: 80rpx;
             height: 80rpx;
             line-height: 80rpx;
             line-height: 80rpx;
-            display: flex;
-            justify-content: center;
-            align-items: center;
+            //display: flex;
+            //justify-content: center;
+            //align-items: center;
           }
           }
 
 
           input {
           input {
@@ -552,9 +552,9 @@ page {
             font-size: 28rpx;
             font-size: 28rpx;
             height: 80rpx;
             height: 80rpx;
             line-height: 80rpx;
             line-height: 80rpx;
-            display: flex;
-            justify-content: center;
-            align-items: center;
+            //display: flex;
+            //justify-content: center;
+            //align-items: center;
           }
           }
 
 
           .code {
           .code {
@@ -581,7 +581,7 @@ page {
       height: 86rpx;
       height: 86rpx;
       margin-top: 80rpx;
       margin-top: 80rpx;
       background-color: $theme-color;
       background-color: $theme-color;
-      border-radius: 120rpx;
+      border-radius: 16rpx;
       color: #ffffff;
       color: #ffffff;
       font-size: 30rpx;
       font-size: 30rpx;
     }
     }