weixin_52219567 1 Minggu lalu
induk
melakukan
7d2ad48d29

+ 4 - 12
src/views/home/index-enterprise.vue

@@ -9,16 +9,7 @@
         <img :src="adLeft.imageUrl" alt="促销大图" class="expand-img-full" />
 
         <!-- 作为大图一部分直接漂浮在上面的文案,不破坏图片的整体性 -->
-        <div class="ad-left-text">
-          <div class="deco-inner-white">
-            <span class="d-txt">企业专享低至</span>
-            <span class="d-num">5</span>
-            <span class="d-txt">折</span>
-          </div>
-          <div class="play-btn">
-            <div class="triangle"></div>
-          </div>
-        </div>
+        <div class="ad-left-text"></div>
       </div>
 
       <!-- 右侧主内容区域,霸占 1600px 全宽 -->
@@ -139,6 +130,7 @@ const check = () => {
 
 headerCategoryList({ status: 1 }).then((res) => {
   if (res.code == 200) {
+    document.documentElement.style.setProperty('--hover-jd', res.rows.length > 0 ? res.rows[0].headerThemeColor || '#E7000B' : '#E7000B');
     navItems.value = res.rows;
   }
 });
@@ -341,8 +333,8 @@ onUnmounted(() => window.removeEventListener('resize', check));
   color: #333;
   height: 100%;
 }
-.nav-list li.active {
-  color: #e1251b;
+.nav-list li:hover {
+  color: var(--hover-jd);
 }
 .n-ic-img {
   width: 22px;

+ 9 - 9
src/views/home/jdcomponents/JDCategory.vue

@@ -59,7 +59,7 @@ const getHead = async () => {
   try {
     const datas1 = await getProductCategoryTree({});
     const datas2 = await categoryMainList({ status: 1 });
-    document.documentElement.style.setProperty('--enterprise-color', '#E7000B');
+    document.documentElement.style.setProperty('--hover-jd2', datas2.rows.length > 0 ? datas2.rows[0].categoryThemeColor || '#E7000B' : '#E7000B');
     datas1.data.forEach((item1: any) => {
       datas2.rows.forEach((item2: any) => {
         if (item2.syncCategoryId == item1.id) {
@@ -108,7 +108,7 @@ const onMouseenter = (index: any) => {
 .cate-item.active,
 .cate-item:hover {
   background: #fff;
-  border-color: #e1251b; /* 四周边框变红 */
+  border-color: var(--hover-jd2); /* 四周边框变红 */
   border-right-color: #fff; /* 右边框变白打通 */
   z-index: 201; /* 盖在弹窗上方 */
   width: calc(100% + 1px); /* 向右延伸 1px */
@@ -116,7 +116,7 @@ const onMouseenter = (index: any) => {
 
 .cate-item.active a,
 .cate-item:hover a {
-  color: #e1251b;
+  color: var(--hover-jd2);
   font-weight: bold;
 }
 
@@ -145,7 +145,7 @@ const onMouseenter = (index: any) => {
   width: 950px;
   height: 440px;
   background: #fff;
-  border: 1px solid #e1251b;
+  border: 1px solid var(--hover-jd2);
   border-radius: 12px;
   box-shadow: 4px 6px 20px rgba(0, 0, 0, 0.12);
   padding: 24px 30px;
@@ -170,7 +170,7 @@ const onMouseenter = (index: any) => {
   cursor: pointer;
 }
 .p-tag:hover {
-  background: #e1251b;
+  background: var(--hover-jd2);
   color: #fff;
 }
 
@@ -179,7 +179,7 @@ const onMouseenter = (index: any) => {
   line-height: 1.2;
 }
 .red-t {
-  color: #e1251b;
+  color: var(--hover-jd2);
   font-size: 18px;
   font-weight: 900;
 }
@@ -190,7 +190,7 @@ const onMouseenter = (index: any) => {
 }
 .small-t {
   font-size: 9px;
-  color: #e1251b;
+  color: var(--hover-jd2);
   letter-spacing: 1px;
   cursor: pointer;
 }
@@ -212,7 +212,7 @@ const onMouseenter = (index: any) => {
   cursor: pointer;
 }
 .item-label:hover {
-  color: var(--enterprise-color);
+  color: var(--hover-jd2);
 }
 .sub-dl dd {
   flex: 1;
@@ -228,6 +228,6 @@ const onMouseenter = (index: any) => {
   cursor: pointer;
 }
 .item1-label:hover {
-  color: var(--enterprise-color);
+  color: var(--hover-jd2);
 }
 </style>

+ 9 - 8
src/views/home/jdcomponents/JDHeader.vue

@@ -25,7 +25,7 @@
           <li class="spacer"></li>
           <li @click="onPath('/enterprise/companyInfo')">企业会员</li>
           <li class="spacer"></li>
-          <li class="red">企业采购</li>
+          <li class="red" :style="{ color: config.themeColor }">企业采购</li>
           <li class="spacer"></li>
           <li>客户服务</li>
           <li class="spacer"></li>
@@ -46,8 +46,8 @@
           <div class="search-bar flex" :style="{ borderColor: config.themeColor }">
             <div class="input-group flex-1 flex">
               <input v-model="input" type="text" />
-              <div class="carousel-bos">
-                <el-carousel height="34px" direction="vertical" autoplay>
+              <div class="carousel-bos" v-if="placeholderList.length > 0 && input.length === 0">
+                <el-carousel height="34px" direction="vertical" autoplay loop :interval="4000">
                   <el-carousel-item v-for="item in placeholderList" :key="item">
                     <div class="carousel-word">{{ item }}</div>
                   </el-carousel-item>
@@ -62,7 +62,7 @@
         </div>
 
         <div class="header-actions">
-          <div :style="{ borderColor: config.themeColor }" class="btn-keeper" @click="onPath(config.rightBtnLink)">
+          <div :style="{ borderColor: config.themeColor, color: config.themeColor }" class="btn-keeper" @click="onPath(config.rightBtnLink)">
             <img v-if="config.rightBtnIcon" :src="config.rightBtnIcon" alt="" />{{ config.rightBtnText }}
           </div>
         </div>
@@ -87,9 +87,9 @@ const config = ref<any>({
 currentSearchConfig({}).then((res) => {
   if (res.code == 200) {
     config.value = res.data;
+    document.documentElement.style.setProperty('--hover-jd1', res.data.themeColor || '#E7000B');
     if (res.data.placeholderText) {
       placeholderList.value = res.data.placeholderText.split(',');
-      console.log(placeholderList.value, '77777777777777');
     }
   }
 });
@@ -134,7 +134,7 @@ onUnmounted(() => {
   transition: color 0.2s;
 }
 .top-nav-links li:hover {
-  color: #e1251b;
+  color: var(--hover-jd1);
 }
 .top-nav-links .spacer {
   width: 1px;
@@ -239,6 +239,7 @@ onUnmounted(() => {
     height: 34px;
     width: 100%;
     z-index: 1;
+    pointer-events: none;
     .carousel-word {
       line-height: 34px;
       color: #999;
@@ -286,7 +287,7 @@ onUnmounted(() => {
   cursor: pointer;
 }
 .hot-links span:hover {
-  color: #e1251b;
+  color: var(--hover-jd1);
 }
 .is-fixed .hot-links {
   display: none;
@@ -318,6 +319,6 @@ onUnmounted(() => {
   align-items: center;
 }
 .btn-keeper:hover {
-  background: #fef0f0;
+  background: #f2f2f2;
 }
 </style>

+ 10 - 2
src/views/home/jdcomponents/JDProducts.vue

@@ -45,7 +45,7 @@
 
     <!-- 商品列表 -->
     <div class="product-grid">
-      <div class="p-card" v-for="(p, i) in baseProducts" :key="i">
+      <div class="p-card" v-for="(p, i) in baseProducts" :key="i" @click="onPath('/item?id=' + p.id + '&productNo=' + p.productNo)">
         <div class="p-img-box">
           <img :src="p.image || p.productImage" @error="handleImgError" />
         </div>
@@ -74,7 +74,7 @@
                 <path d="M1 1h4l2.68 13.39a2 2 0 0 0 2 1.61h9.72a2 2 0 0 0 2-1.61L23 6H6"></path>
               </svg>
             </button>
-            <button class="btn-buy" @click="onPath('/item?id=' + p.id + '&productNo=' + p.productNo)">
+            <button class="btn-buy" @click.stop="onCart(p)">
               <span class="txt-normal">加入购物车</span>
               <span class="txt-hover">加入购物车</span>
             </button>
@@ -187,6 +187,13 @@ const getList = () => {
     .then((res) => {
       if (res.code == 200) {
         const newProducts = res.rows || [];
+
+        // 如果没有返回数据,说明没有更多了
+        if (newProducts.length === 0) {
+          noMore.value = true;
+          return;
+        }
+
         baseProducts.value = baseProducts.value.concat(newProducts);
 
         // 判断是否还有更多数据
@@ -407,6 +414,7 @@ onUnmounted(() => {
 .p-card:hover {
   transform: translateY(-4px);
   box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
+  cursor: pointer;
 }
 
 .p-img-box {

+ 3 - 2
src/views/home/jdcomponents/JDUserPanel.vue

@@ -58,6 +58,7 @@
           <div class="t-page" v-for="(item1, index1) in dataList" :key="index1">
             <div class="t-grid">
               <div class="t-i" v-for="(item2, index2) in item1" :key="index2" @click="onPath(item2.jumpLink)">
+                <div v-if="item2.tagText" class="badge">{{ item2.tagText }}</div>
                 <el-image class="t-icon" :src="item2.iconUrl" />
                 <span>{{ item2.name }}</span>
               </div>
@@ -293,7 +294,7 @@ const currentPage = ref(0);
 
 .t-slider-wrap {
   position: relative;
-  overflow: hidden;
+  /* overflow: hidden; */
   width: 100%;
 }
 
@@ -367,7 +368,7 @@ const currentPage = ref(0);
   font-size: 9px;
   padding: 1px 4px;
   border-radius: 8px 8px 8px 0;
-  z-index: 2;
+  z-index: 10;
   border: 1px solid #fff;
   transform: scale(0.9);
 }