weixin_52219567 1 неделя назад
Родитель
Сommit
b28d2314db

+ 37 - 17
src/addon/shop/components/diy/goods-list/index.vue

@@ -22,10 +22,19 @@
               <view class="text-[28rpx] leading-[40rpx] text-[#303133] multi-hidden mb-[10rpx]"
                 :style="{ color: diyComponent.goodsNameStyle.color, fontWeight: diyComponent.goodsNameStyle.fontWeight }"
                 v-if="diyComponent.goodsNameStyle.control">
+                <view class="brand-tag">{{ item.isSelf == 1 ? '自营商品' : '非自营' }}</view>
                 {{ item.itemName }}
               </view>
-              <view class="text-[24rpx] text-[#999] leading-[30rpx] using-hidden mb-[5rpx]" v-if="item.productNo">
-                {{ item.productNo }}
+              <view class="flex flex-wrap">
+                <view class="base-tag" :style="diyGoods.baseTagStyle()">
+                  {{ item.brandName || '品牌' }}
+                </view>
+                <view class="base-tag" :style="diyGoods.baseTagStyle()">
+                  {{ item.bottomCategoryName || '分类' }}
+                </view>
+                <view class="base-tag" :style="diyGoods.baseTagStyle()" v-if="item.isCustomize == 1">
+                  可定制
+                </view>
               </view>
               <view class="mt-auto flex justify-between items-center">
                 <view class="flex flex-col">
@@ -75,10 +84,19 @@
                   <view class="text-[#303133] leading-[40rpx] text-[28rpx] multi-hidden"
                     :style="{ color: diyComponent.goodsNameStyle.color, fontWeight: diyComponent.goodsNameStyle.fontWeight }"
                     v-if="diyComponent.goodsNameStyle.control">
+                    <view class="brand-tag">{{ item.isSelf == 1 ? '自营商品' : '非自营' }}</view>
                     {{ item.itemName }}
                   </view>
-                  <view class="text-[24rpx] text-[#999] leading-[30rpx] using-hidden my-[5rpx]" v-if="item.productNo">
-                    {{ item.productNo }}
+                  <view class="flex flex-wrap">
+                    <view class="base-tag" :style="diyGoods.baseTagStyle()">
+                      {{ item.brandName || '品牌' }}
+                    </view>
+                    <view class="base-tag" :style="diyGoods.baseTagStyle()">
+                      {{ item.bottomCategoryName || '分类' }}
+                    </view>
+                    <view class="base-tag" :style="diyGoods.baseTagStyle()" v-if="item.isCustomize == 1">
+                      可定制
+                    </view>
                   </view>
                   <view class="flex justify-between flex-wrap items-center mt-[20rpx]">
                     <view class="flex flex-col">
@@ -94,11 +112,7 @@
                           }}</text>
                         </view>
                       </view>
-                      <text v-if="diyComponent.saleStyle.control"
-                        class="text-[22rpx] mt-[8rpx] text-[var(--text-color-light9)]"
-                        :style="{ color: diyComponent.saleStyle.color }">
-                        起订{{ item.minOrderQuantity || 1 }}{{ item.unitName || '件' }}
-                      </text>
+    
                     </view>
                     <view class="absolute right-[16rpx] bottom-[16rpx]" @click.stop
                       v-if="diyComponent.btnStyle.control || diyStore.mode == 'decorate'">
@@ -133,10 +147,19 @@
                   <view class="text-[#303133] leading-[40rpx] text-[28rpx] multi-hidden"
                     :style="{ color: diyComponent.goodsNameStyle.color, fontWeight: diyComponent.goodsNameStyle.fontWeight }"
                     v-if="diyComponent.goodsNameStyle.control">
+                    <view class="brand-tag">{{ item.isSelf == 1 ? '自营商品' : '非自营' }}</view>
                     {{ item.itemName }}
                   </view>
-                  <view class="text-[24rpx] text-[#999] leading-[30rpx] using-hidden my-[5rpx]" v-if="item.productNo">
-                    {{ item.productNo }}
+                  <view class="flex flex-wrap">
+                    <view class="base-tag" :style="diyGoods.baseTagStyle()">
+                      {{ item.brandName || '品牌' }}
+                    </view>
+                    <view class="base-tag" :style="diyGoods.baseTagStyle()">
+                      {{ item.bottomCategoryName || '分类' }}
+                    </view>
+                    <view class="base-tag" :style="diyGoods.baseTagStyle()" v-if="item.isCustomize == 1">
+                      可定制
+                    </view>
                   </view>
                   <view class="flex justify-between flex-wrap items-center mt-[20rpx]">
                     <view class="flex flex-col">
@@ -152,11 +175,7 @@
                           }}</text>
                         </view>
                       </view>
-                      <text v-if="diyComponent.saleStyle.control"
-                        class="text-[22rpx] mt-[8rpx] text-[var(--text-color-light9)]"
-                        :style="{ color: diyComponent.saleStyle.color }">
-                        起订{{ item.minOrderQuantity || 1 }}{{ item.unitName || '件' }}
-                      </text>
+           
                     </view>
                     <view class="absolute right-[16rpx] bottom-[16rpx]" @click.stop
                       v-if="diyComponent.btnStyle.control || diyStore.mode == 'decorate'">
@@ -311,7 +330,8 @@ const getGoodsListFn = () => {
   }
   if (diyComponent.value.source == "2") {
     if (diyComponent.value.categoryIds) {
-      data.categoryIds = diyComponent.value.categoryIds.join(",");
+      const categoryId = diyComponent.value.categoryIds.map((item:any) => item[1]);
+      data.categoryIds = categoryId.join(",");
     } else {
       nextStep = true;
     }

+ 25 - 65
src/addon/shop/components/diy/many-goods-list/index.vue

@@ -1,57 +1,23 @@
 <template>
     <view class="overflow-hidden">
-        <scroll-view scroll-x="true" class="many-goods-list-head" :class="diyComponent.headStyle" :scroll-into-view="'a' + cateIndex" :style="warpCss">
-            <template v-if="diyComponent.headStyle == 'style-3'">
-                <template v-if="diyComponent.source == 'custom'">
-                    <view v-for="(item,index) in diyComponent.list" :key="index"
-                          :class="['flex-col inline-flex items-center justify-center', { 'pr-[40rpx]': (index != diyComponent.list.length-1) }]"
-                          @click="changeCateIndex(item,index)">
-                        <image :style="{ borderRadius : (diyComponent.aroundRadius * 2) + 'rpx' }"
-                               :class="['w-[90rpx] h-[90rpx] overflow-hidden border-[2rpx] border-solid border-transparent', {'border-[var(--primary-color)]': index == cateIndex }]"
-                               v-if="item.imageUrl" :src="img(item.imageUrl)" mode="aspectFit" />
-                        <image :style="{ borderRadius : (diyComponent.aroundRadius * 2) + 'rpx' }"
-                               :class="['w-[90rpx] h-[90rpx] overflow-hidden border-[2rpx] border-solid border-transparent', {'border-[var(--primary-color)]': index == cateIndex }]"
-                               v-else :src="img('static/resource/images/diy/figure.png')" mode="scaleToFill" />
-                        <text :class="['text-[28rpx] mt-[16rpx]', {'font-500 text-[var(--primary-color)]' : index == cateIndex  }]">{{ item.title }}</text>
-                    </view>
-                </template>
-                <template v-else-if="diyComponent.source == 'goods_category'">
-                    <view class="pr-[40rpx] inline-flex flex-col items-center justify-center" @click="changeGoodsCategory({ category_id : 0 })">
-                        <image :style="{ borderRadius : (diyComponent.aroundRadius * 2) + 'rpx' }"
-                               :class="['w-[90rpx] h-[90rpx] overflow-hidden border-[2rpx] border-solid border-transparent', {'border-[var(--primary-color)]': currentCategoryId == 0}]"
-                               :src="img('static/resource/images/diy/figure.png')" mode="scaleToFill" />
-                        <text :class="['text-[28rpx] mt-[16rpx]', {'font-500 text-[var(--primary-color)]': currentCategoryId == 0}]">全部</text>
-                    </view>
-                    <view v-for="(item,index) in goodsCategoryListData" :key="index"
-                          :class="['flex-col inline-flex items-center justify-center', { 'pr-[40rpx]': (index != goodsCategoryListData.length-1) }]"
-                          @click="changeGoodsCategory(item)">
-                        <image :style="{ borderRadius : (diyComponent.aroundRadius * 2) + 'rpx' }"
-                               :class="['w-[90rpx] h-[90rpx] overflow-hidden border-[2rpx] border-solid border-transparent', {'border-[var(--primary-color)]': currentCategoryId == item.category_id}]"
-                               v-if="item.image" :src="img(item.image)" mode="aspectFit" />
-                        <image :style="{ borderRadius : (diyComponent.aroundRadius * 2) + 'rpx' }"
-                               :class="['w-[90rpx] h-[90rpx] overflow-hidden border-[2rpx] border-solid border-transparent', {'border-[var(--primary-color)]': currentCategoryId == item.category_id}]"
-                               v-else :src="img('static/resource/images/diy/figure.png')" mode="scaleToFill" />
-                        <text :class="['text-[28rpx] mt-[16rpx]', {'font-500 text-[var(--primary-color)]' : currentCategoryId == item.category_id}]">{{ item.category_name }}</text>
-                    </view>
-                </template>
-            </template>
-            <template v-else>
-                <view v-for="(item, index) in diyComponent.list" class="scroll-item"
-                      :class="[diyComponent.headStyle, { active: index == cateIndex }]" :id="'a' + index" :key="index"
-                      @click="changeCateIndex(item, index)">
-                    <view class="cate" v-if="diyComponent.headStyle == 'style-1'">
-                        <view class="name">{{ item.title }}</view>
-                        <view class="desc" :v-if="item.desc">{{ item.desc }}</view>
-                    </view>
-                    <view v-if="diyComponent.headStyle == 'style-2'" class="cate">
-                        <view class="name">{{ item.title }}</view>
-                        <text class="nc-iconfont nc-icon-xiaolian-2 !text-[40rpx] text-[var(--primary-color)] transform" v-if="index == cateIndex"></text>
-                    </view>
-                    <view v-if="diyComponent.headStyle == 'style-4'" class="cate">
-                        <view class="name">{{ item.title }}</view>
-                    </view>
+        <scroll-view scroll-x="true" class="many-goods-list-head" :class="diyComponent.headStyle"
+            :scroll-into-view="'a' + cateIndex" :style="warpCss">
+            <view v-for="(item, index) in diyComponent.list" class="scroll-item"
+                :class="[diyComponent.headStyle, { active: index == cateIndex }]" :id="'a' + index" :key="index"
+                @click="changeCateIndex(item, index)">
+                <view class="cate" v-if="diyComponent.headStyle == 'style-1'">
+                    <view class="name">{{ item.title }}</view>
+                    <view class="desc" :v-if="item.desc">{{ item.desc }}</view>
                 </view>
-            </template>
+                <view v-if="diyComponent.headStyle == 'style-2'" class="cate">
+                    <view class="name">{{ item.title }}</view>
+                    <text class="nc-iconfont nc-icon-xiaolian-2 !text-[40rpx] text-[var(--primary-color)] transform"
+                        v-if="index == cateIndex"></text>
+                </view>
+                <view v-if="diyComponent.headStyle == 'style-4'" class="cate">
+                    <view class="name">{{ item.title }}</view>
+                </view>
+            </view>
         </scroll-view>
 
         <diy-goods-list class="many-goods-list-body" v-if="goodsValue" :value="goodsValue"></diy-goods-list>
@@ -81,7 +47,7 @@ const diyComponent = computed(() => {
 const warpCss = computed(() => {
     let style = '';
     if (diyComponent.value.componentStartBgColor) {
-        if (diyComponent.value.componentStartBgColor && diyComponent.value.componentEndBgColor) style += `background:linear-gradient(${ diyComponent.value.componentGradientAngle },${ diyComponent.value.componentStartBgColor },${ diyComponent.value.componentEndBgColor });`;
+        if (diyComponent.value.componentStartBgColor && diyComponent.value.componentEndBgColor) style += `background:linear-gradient(${diyComponent.value.componentGradientAngle},${diyComponent.value.componentStartBgColor},${diyComponent.value.componentEndBgColor});`;
         else style += 'background-color:' + diyComponent.value.componentStartBgColor + ';';
     }
     if (diyComponent.value.topRounded) style += 'border-top-left-radius:' + diyComponent.value.topRounded * 2 + 'rpx;';
@@ -107,12 +73,7 @@ onMounted(() => {
 });
 
 const refresh = () => {
-    // 装修模式下设置默认图
-    if (diyComponent.value.headStyle == 'style-3' && diyComponent.value.source == 'goods_category' && diyComponent.value.goods_category) {
-        getGoodsCategoryFn(diyComponent.value.goods_category);
-    } else {
-        changeCateIndex(diyComponent.value.list[0], 0, true)
-    }
+    changeCateIndex(diyComponent.value.list[0], 0, true)
 }
 
 const cateIndex = ref(0) // 当前选中的分类id
@@ -126,8 +87,8 @@ const changeCateIndex = (item: any, index: any, isFirst: any = false) => {
     cateIndex.value = index;
     refreshGoodsList({
         source: item.source,
-        goods_category: item.goods_category,
-        goods_ids: item.goods_ids
+        categoryIds: item.categoryIds,
+        goodsIds: item.goodsIds
     })
 }
 
@@ -184,11 +145,11 @@ const refreshGoodsList = (obj: any) => {
         bottomElementRounded: diyComponent.value.bottomElementRounded
     };
 
-    if (obj.goods_category) {
-        goodsValue.value.goods_category = obj.goods_category
+    if (obj.categoryIds) {
+        goodsValue.value.categoryIds = obj.categoryIds 
     }
-    if (obj.goods_ids && obj.goods_ids.length) {
-        goodsValue.value.goods_ids = obj.goods_ids
+    if (obj.goodsIds && obj.goodsIds.length) {
+        goodsValue.value.goodsIds = obj.goodsIds
     }
 }
 
@@ -365,5 +326,4 @@ const refreshGoodsList = (obj: any) => {
     }
 
 }
-
 </style>

+ 51 - 43
src/addon/shop/components/diy/shop-goods-recommend/index.vue

@@ -2,41 +2,52 @@
     <x-skeleton :type="skeleton.type" :loading="skeleton.loading" :config="skeleton.config">
         <view :style="warpCss" v-if="goodsNum">
             <view class="w-full">
-                <scroll-view :id="'warpStyle-'+diyComponent.id" class="whitespace-nowrap h-[341rpx] w-full" :scroll-x="true">
-                    <template v-for="(item,index) in goodsList" :key="index">
-                        <view v-if="item.info" :id="'item'+index+diyComponent.id"
-                              class="w-[224rpx] h-[341rpx] mr-[20rpx] inline-block bg-[#fff] box-border overflow-hidden"
-                              :class="{'!mr-[0rpx]' : index == (goodsList.length-1)}" :style="itemCss+itemStyle"
-                              @click="toLink(item)">
+                <scroll-view :id="'warpStyle-' + diyComponent.id" class="whitespace-nowrap h-[341rpx] w-full"
+                    :scroll-x="true">
+                    <template v-for="(item, index) in goodsList" :key="index">
+                        <view v-if="item.info" :id="'item' + index + diyComponent.id"
+                            class="w-[224rpx] h-[341rpx] mr-[20rpx] inline-block bg-[#fff] box-border overflow-hidden"
+                            :class="{ '!mr-[0rpx]': index == (goodsList.length - 1) }" :style="itemCss + itemStyle"
+                            @click="toLink(item)">
                             <view class="w-full h-[134rpx]" :style="listFrameStyle(item)">
                                 <view class="flex pl-[16rpx] pr-[20rpx] justify-between h-[63rpx] items-center">
-                                    <view class="text-[28rpx] leading-[34rpx] flex-1 mr-[8rpx]" :style="{'color':item.title.textColor}">{{ item.title.text }}</view>
-                                    <view class="w-[68rpx] h-[34rpx] text-[22rpx] text-center leading-[34rpx] text-[#fff] rounded-[17rpx]" :style="moreTitleStyle(item)">{{ item.moreTitle.text }}</view>
+                                    <view class="text-[28rpx] leading-[34rpx] flex-1 mr-[8rpx]"
+                                        :style="{ 'color': item.title.textColor }">{{ item.title.text }}</view>
+                                    <view
+                                        class="w-[68rpx] h-[34rpx] text-[22rpx] text-center leading-[34rpx] text-[#fff] rounded-[17rpx]"
+                                        :style="moreTitleStyle(item)">{{ item.moreTitle.text }}</view>
                                 </view>
                             </view>
-                            <view class="mt-[-71rpx] h-[278rpx] w-full px-[20rpx] pt-[18rpx] box-border bg-white" :style="itemCss">
+                            <view class="mt-[-71rpx] h-[278rpx] w-full px-[20rpx] pt-[18rpx] box-border bg-white"
+                                :style="itemCss">
                                 <view class="flex items-center justify-center w-[184rpx] h-[184rpx]">
-                                    <u--image width="184rpx" height="184rpx" :radius="imageRounded.val" :src="img(item.info.goods_cover_thumb_mid || '')" model="aspectFill">
+                                    <u--image width="184rpx" height="184rpx" :radius="imageRounded.val"
+                                        :src="img(item.info.productImage || '')" model="aspectFill">
                                         <template #error>
-                                            <image class="w-[184rpx] h-[184rpx]" :style="imageRounded.style" :src="img('static/resource/images/diy/shop_default.jpg')" mode="aspectFill" />
+                                            <image class="w-[184rpx] h-[184rpx]" :style="imageRounded.style"
+                                                :src="img('https://v6.site.niucloud.com/static/resource/images/diy/shop_default.jpg')"
+                                                mode="aspectFill" />
                                         </template>
                                     </u--image>
-<!--                                    <easy-image class="w-[184rpx] h-[184rpx]" :image-src="item.info.goods_cover_thumb_small" :image-style="imageStyle" />-->
                                 </view>
                                 <view class="pt-[12rpx]">
                                     <view
                                         class="h-[44rpx] pl-[4rpx] min-w-[168rpx] box-border flex justify-between items-center mx-auto border-[2rpx] border-solid border-[var(--primary-color)] rounded-[20rpx]"
-                                        :style="{'border-color':item.button.color}">
-                                        <view class="text-[var(--price-text-color)] font-bold price-font flex items-baseline leading-[40rpx] flex-1 justify-center">
-                                            <view class="leading-[1] max-w-[105rpx] truncate" :style="{ color : diyComponent.priceStyle.mainColor }">
+                                        :style="{ 'border-color': item.button.color }">
+                                        <view
+                                            class="text-[var(--price-text-color)] font-bold price-font flex items-baseline leading-[40rpx] flex-1 justify-center">
+                                            <view class="leading-[1] max-w-[105rpx] truncate"
+                                                :style="{ color: diyComponent.priceStyle.mainColor }">
                                                 <text class="text-[18rpx] font-400 mr-[2rpx]">¥</text>
-                                                <text class="text-[28rpx] font-500">{{ parseFloat(diyGoods.goodsPrice(item.info)).toFixed(2) }}</text>
+                                                <text class="text-[28rpx] font-500">{{ diyGoods.goodsPrice(item.info).toFixed(2) }}</text>
                                             </view>
                                         </view>
-                                        <view class="w-[70rpx] box-border text-right text-[#fff] pr-[8rpx] text-[22rpx] font-500 leading-[44rpx] rounded-tr-[20rpx] rounded-br-[20rpx] rounded-tl-[24rpx] relative"
-                                            :style="{'background-color':item.button.color}">
+                                        <view
+                                            class="w-[70rpx] box-border text-right text-[#fff] pr-[8rpx] text-[22rpx] font-500 leading-[44rpx] rounded-tr-[20rpx] rounded-br-[20rpx] rounded-tl-[24rpx] relative"
+                                            :style="{ 'background-color': item.button.color }">
                                             <text>{{ item.button.text }}</text>
-                                            <image class="w-[24rpx] h-[44rpx] absolute top-[-2rpx] left-0" :src="img('/addon/shop/Union.png')" />
+                                            <image class="w-[24rpx] h-[44rpx] absolute top-[-2rpx] left-0"
+                                                :src="img('https://v6.site.niucloud.com/addon/shop/Union.png')" />
                                         </view>
                                     </view>
                                 </view>
@@ -86,7 +97,7 @@ const warpCss = computed(() => {
     let style = '';
     style += 'position:relative;';
     if (diyComponent.value.componentStartBgColor) {
-        if (diyComponent.value.componentStartBgColor && diyComponent.value.componentEndBgColor) style += `background:linear-gradient(${ diyComponent.value.componentGradientAngle },${ diyComponent.value.componentStartBgColor },${ diyComponent.value.componentEndBgColor });`;
+        if (diyComponent.value.componentStartBgColor && diyComponent.value.componentEndBgColor) style += `background:linear-gradient(${diyComponent.value.componentGradientAngle},${diyComponent.value.componentStartBgColor},${diyComponent.value.componentEndBgColor});`;
         else style += 'background-color:' + diyComponent.value.componentStartBgColor + ';';
     }
 
@@ -128,7 +139,7 @@ const imageStyle = computed(() => {
 const listFrameStyle = (item: any) => {
     let style = '';
     if (item.listFrame.startColor) {
-        if (item.listFrame.startColor && item.listFrame.endColor) style = `background:linear-gradient( 110deg, ${ item.listFrame.startColor } 0%, ${ item.listFrame.endColor } 100%);`;
+        if (item.listFrame.startColor && item.listFrame.endColor) style = `background:linear-gradient( 110deg, ${item.listFrame.startColor} 0%, ${item.listFrame.endColor} 100%);`;
         else style = 'background-color:' + item.listFrame.startColor + ';';
     }
     return style
@@ -138,7 +149,7 @@ const listFrameStyle = (item: any) => {
 const moreTitleStyle = (item: any) => {
     let style = '';
     if (item.moreTitle.startColor) {
-        if (item.moreTitle.startColor && item.moreTitle.endColor) style = `background:linear-gradient( 0deg, ${ item.moreTitle.startColor } 0%, ${ item.moreTitle.endColor } 100%);`;
+        if (item.moreTitle.startColor && item.moreTitle.endColor) style = `background:linear-gradient( 0deg, ${item.moreTitle.startColor} 0%, ${item.moreTitle.endColor} 100%);`;
         else style = 'background-color:' + item.moreTitle.startColor + ';';
     }
     return style
@@ -164,21 +175,22 @@ const setItemStyle = () => {
 setItemStyle();
 
 const getGoodsListFn = () => {
-    let data: any = {}
-    if (diyComponent.value.source == 'all') {
-        data.num = diyComponent.value.list.length;
-    } else if (diyComponent.value.source == 'custom') {
-        data.goods_ids = diyComponent.value.goods_ids;
+    let data: any = {
+        pageNum: 1,
+        pageSize: 10,
+        ids: ''
     }
-
-    getGoodsComponents(data).then((res) => {
-        // let goodsObj = res.data;
-        // goodsNum.value = goodsObj.length || 0;
-        // diyComponent.value.list.filter((el: any, index) => {
-        //     el.info = deepClone(goodsObj[index])
-        // });
-        // goodsList.value = deepClone(diyComponent.value.list)
-        // skeleton.loading = false;
+    if(diyComponent.value.goods_ids){
+        data.ids = diyComponent.value.goods_ids.join(",");
+    }
+    getGoodsComponents(data).then((res:any) => {
+        let goodsObj = res.rows;
+        goodsNum.value = goodsObj.length || 0;
+        diyComponent.value.list.filter((el: any, index:any) => {
+            el.info = deepClone(goodsObj[index])
+        });
+        goodsList.value = deepClone(diyComponent.value.list)
+        skeleton.loading = false;
     });
 }
 
@@ -201,10 +213,7 @@ const refresh = () => {
                 goodsList.value = diyComponent.value.list.map((el: any) => {
                     let obj = deepClone(el)
                     obj.info = {
-                        goods_cover_thumb_mid: '',
-                        goodsSku: {
-                            show_price: '10.00'
-                        }
+                        memberPrice: '0',
                     }
                     return obj
                 })
@@ -218,10 +227,9 @@ const refresh = () => {
 }
 
 const toLink = (data: any) => {
-    redirect({ url: '/addon/shop/pages/goods/detail', param: { goods_id: data.info.goods_id } })
+    redirect({ url: '/addon/shop/pages/goods/detail', param: { goodsId: data.info.id } })
 }
 
 </script>
 
-<style lang="scss" scoped>
-</style>
+<style lang="scss" scoped></style>

+ 1 - 1
src/addon/shop/components/diy/shop-search/index.vue

@@ -2,7 +2,7 @@
     <view :style="warpCss">
         <view :style="maskLayer"></view>
         <view class="diy-shop-search relative overflow-hidden flex items-center">
-            <image :src="img('addon/shop/diy/search_01.png')" class="w-[40rpx] h-[40rpx]" mode="widthFix" @click="toLink('/addon/shop/pages/goods/category')" />
+            <image :src="img('https://v6.site.niucloud.com/addon/shop/diy/search_01.png')" class="w-[40rpx] h-[40rpx]" mode="widthFix" @click="toLink('/addon/shop/pages/goods/category')" />
             <view class="flex-1 ml-[24rpx] rounded-[32rpx] flex items-center bg-[var(--temp-bg)] opacity-90 py-[10rpx] pl-[38rpx] pr-[32rpx] justify-between h-[60rpx] box-border" @click="toLink('/addon/shop/pages/goods/search')">
                 <text class="text-[var(--text-color-light9)] text-[26rpx]">{{ diyComponent.text }}</text>
                 <text class="nc-iconfont nc-icon-sousuo-duanV6xx1 text-[24rpx]"></text>

+ 60 - 32
src/addon/shop/components/diy/single-recommend/index.vue

@@ -1,10 +1,14 @@
 <template>
-    <view :style="warpCss" class="overflow-hidden" v-if="goodsList && goodsList[0]">
-        <view class="flex justify-between items-center mb-[20rpx]" v-if="diyComponent.textImg || diyComponent.subTitle.text">
-            <view class="h-[34rpx] flex items-center" v-if="diyComponent.textImg" @click="diyStore.toRedirect(diyComponent.textLink)">
+    <view :style="warpCss" class="overflow-hidden" v-if="goodsList && goodsList.length>0">
+        <view class="flex justify-between items-center mb-[20rpx]"
+            v-if="diyComponent.textImg || diyComponent.subTitle.text">
+            <view class="h-[34rpx] flex items-center" v-if="diyComponent.textImg"
+                @click="diyStore.toRedirect(diyComponent.textLink)">
                 <image class="h-[100%] w-[auto]" :src="img(diyComponent.textImg)" mode="heightFix" />
             </view>
-            <view class="flex items-center ml-[auto]" v-if="diyComponent.subTitle.text" @click="diyStore.toRedirect(diyComponent.subTitle.link)" :style="{'color': diyComponent.subTitle.textColor}">
+            <view class="flex items-center ml-[auto]" v-if="diyComponent.subTitle.text"
+                @click="diyStore.toRedirect(diyComponent.subTitle.link)"
+                :style="{ 'color': diyComponent.subTitle.textColor }">
                 <text class="text-[24rpx]">{{ diyComponent.subTitle.text }}</text>
                 <text class="text-[22rpx] iconfont iconxiangyoujiantou"></text>
             </view>
@@ -15,54 +19,71 @@
             <view class="relative w-[340rpx] overflow-hidden" :style="carouselCss">
                 <view v-if="diyComponent.list.length == 1" class="leading-0 overflow-hidden">
                     <view @click="diyStore.toRedirect(diyComponent.list[0].link)">
-                        <image v-if="diyComponent.list[0].imageUrl" :src="img(diyComponent.list[0].imageUrl)" mode="heightFix" class="h-[504rpx] !w-full" :show-menu-by-longpress="true" />
-                        <image v-else :src="img('static/resource/images/diy/figure.png')" mode="heightFix" class="h-[504rpx] !w-full" :show-menu-by-longpress="true" />
+                        <image v-if="diyComponent.list[0].imageUrl" :src="img(diyComponent.list[0].imageUrl)"
+                            mode="heightFix" class="h-[504rpx] !w-full" :show-menu-by-longpress="true" />
+                        <image v-else :src="img('https://v6.site.niucloud.com/static/resource/images/diy/figure.png')"
+                            mode="heightFix" class="h-[504rpx] !w-full" :show-menu-by-longpress="true" />
                     </view>
                 </view>
                 <template v-else>
                     <swiper class="swiper ns-indicator-dots-three h-[504rpx]" autoplay="true" circular="true"
-                            :indicator-dots="isShowDots" @change="swiperChange"
-                            :indicator-color="diyComponent.indicatorColor"
-                            :indicator-active-color="diyComponent.indicatorActiveColor">
+                        :indicator-dots="isShowDots" @change="swiperChange"
+                        :indicator-color="diyComponent.indicatorColor"
+                        :indicator-active-color="diyComponent.indicatorActiveColor">
                         <swiper-item class="swiper-item" v-for="(item) in diyComponent.list" :key="item.id">
                             <view @click="diyStore.toRedirect(item.link)">
                                 <view class="item h-[504rpx]">
-                                    <image v-if="item.imageUrl" :src="img(item.imageUrl)" mode="scaleToFill" class="w-full h-full" :show-menu-by-longpress="true" />
-                                    <image v-else :src="img('static/resource/images/diy/figure.png')" mode="scaleToFill" class="w-full h-full" :show-menu-by-longpress="true" />
+                                    <image v-if="item.imageUrl" :src="img(item.imageUrl)" mode="scaleToFill"
+                                        class="w-full h-full" :show-menu-by-longpress="true" />
+                                    <image v-else
+                                        :src="img('https://v6.site.niucloud.com/static/resource/images/diy/figure.png')"
+                                        mode="scaleToFill" class="w-full h-full" :show-menu-by-longpress="true" />
                                 </view>
                             </view>
                         </swiper-item>
                     </swiper>
                     <!-- #ifdef MP-WEIXIN -->
                     <view v-if="diyComponent.list.length > 1" class="swiper-dot-box straightLineStyle2">
-                        <view v-for="(numItem, numIndex) in diyComponent.list" :key="numIndex" :class="['swiper-dot', { active: numIndex == swiperIndex }]" :style="[numIndex == swiperIndex ? { backgroundColor: diyComponent.indicatorActiveColor } : { backgroundColor: diyComponent.indicatorColor }]"></view>
+                        <view v-for="(numItem, numIndex) in diyComponent.list" :key="numIndex"
+                            :class="['swiper-dot', { active: numIndex == swiperIndex }]"
+                            :style="[numIndex == swiperIndex ? { backgroundColor: diyComponent.indicatorActiveColor } : { backgroundColor: diyComponent.indicatorColor }]">
+                        </view>
                     </view>
                     <!-- #endif -->
                 </template>
             </view>
 
-            <view class="w-[340rpx] h-[504rpx] flex flex-col bg-[#fff] box-border overflow-hidden" :style="goodsTempCss" @click="toLink(goodsList[0])">
+            <view class="w-[340rpx] h-[504rpx] flex flex-col bg-[#fff] box-border overflow-hidden" :style="goodsTempCss"
+                @click="toLink(goodsList[0])">
                 <view :style="goodsImgCss" class="w-[346rpx] h-[350rpx] overflow-hidden">
-                    <u--image width="346rpx" height="350rpx" :src="img(goodsList[0].goods_cover_thumb_mid || '')" model="aspectFill">
+                    <u--image width="346rpx" height="350rpx" :src="img(goodsList[0].productImage || '')"
+                        model="aspectFill">
                         <template #error>
-                            <image class="w-[346rpx] h-[350rpx]" :src="img('static/resource/images/diy/shop_default.jpg')" mode="aspectFill" />
+                            <image class="w-[346rpx] h-[350rpx]"
+                                :src="img('https://v6.site.niucloud.com/static/resource/images/diy/shop_default.jpg')"
+                                mode="aspectFill" />
                         </template>
                     </u--image>
                 </view>
                 <view class="px-[16rpx] flex-1 pt-[16rpx] pb-[20rpx] flex flex-col justify-between">
-                    <view class="text-[#303133] leading-[40rpx] text-[28rpx] truncate" :style="{ color : diyComponent.goodsNameStyle.color, fontWeight : diyComponent.goodsNameStyle.fontWeight }">{{ goodsList[0].goods_name }}</view>
+                    <view class="text-[#303133] leading-[40rpx] text-[28rpx] truncate"
+                        :style="{ color: diyComponent.goodsNameStyle.color, fontWeight: diyComponent.goodsNameStyle.fontWeight }">
+                        {{ goodsList[0].brandName }}</view>
                     <view class="flex justify-between flex-wrap items-baseline mt-[28rpx]">
                         <view class="flex items-center">
-                            <view class="text-[var(--price-text-color)] price-font truncate max-w-[200rpx]" :style="{ color : diyComponent.priceStyle.mainColor }">
+                            <view class="text-[var(--price-text-color)] price-font truncate max-w-[200rpx]"
+                                :style="{ color: diyComponent.priceStyle.mainColor }">
                                 <text class="text-[24rpx] font-400">¥</text>
-                                <text class="text-[40rpx] font-500">{{ parseFloat(diyGoods.goodsPrice(goodsList[0])).toFixed(2).split('.')[0] }}</text>
-                                <text class="text-[24rpx] font-500">.{{ parseFloat(diyGoods.goodsPrice(goodsList[0])).toFixed(2).split('.')[1] }}</text>
+                                <text class="text-[40rpx] font-500">{{
+                                    diyGoods.goodsPrice(goodsList[0]).toFixed(2).split('.')[0]
+                                    }}</text>
+                                <text class="text-[24rpx] font-500">.{{
+                                    diyGoods.goodsPrice(goodsList[0]).toFixed(2).split('.')[1]
+                                    }}</text>
                             </view>
-							<image v-if="diyGoods.priceType(goodsList[0]) == 'member_price'" class="max-w-[50rpx] h-[28rpx] ml-[6rpx]" :src="img('addon/shop/VIP.png')" mode="heightFix" />
-							<image v-else-if="diyGoods.priceType(goodsList[0]) == 'newcomer_price'"  class="max-w-[60rpx] h-[28rpx] ml-[6rpx]" :src="img('addon/shop/newcomer.png')" mode="heightFix" />
-							<image v-else-if="diyGoods.priceType(goodsList[0]) == 'discount_price'" class="max-w-[80rpx] h-[28rpx] ml-[6rpx]" :src="img('addon/shop/discount.png')" mode="heightFix" />	 
                         </view>
-                        <view class="w-[44rpx] h-[44rpx] bg-[red] flex items-center justify-center rounded-[50%]" :style="{ backgroundColor : diyComponent.saleStyle.color }">
+                        <view class="w-[44rpx] h-[44rpx] bg-[red] flex items-center justify-center rounded-[50%]"
+                            :style="{ backgroundColor: diyComponent.saleStyle.color }">
                             <text class="iconfont iconjia  font-500 text-[32rpx] text-[#fff]"></text>
                         </view>
                     </view>
@@ -84,7 +105,7 @@ const diyGoods = useGoods();
 const props = defineProps(['component', 'index', 'value']);
 const diyStore = useDiyStore();
 
-const goodsList = ref<Array<any>>([]);
+const goodsList = ref<any>([]);
 
 const diyComponent = computed(() => {
     if (props.value) {
@@ -110,7 +131,7 @@ const warpCss = computed(() => {
     let style = '';
     style += 'position:relative;';
     if (diyComponent.value.componentStartBgColor) {
-        if (diyComponent.value.componentStartBgColor && diyComponent.value.componentEndBgColor) style += `background:linear-gradient(${ diyComponent.value.componentGradientAngle },${ diyComponent.value.componentStartBgColor },${ diyComponent.value.componentEndBgColor });`;
+        if (diyComponent.value.componentStartBgColor && diyComponent.value.componentEndBgColor) style += `background:linear-gradient(${diyComponent.value.componentGradientAngle},${diyComponent.value.componentStartBgColor},${diyComponent.value.componentEndBgColor});`;
         else style += 'background-color:' + diyComponent.value.componentStartBgColor + ';';
     }
 
@@ -154,11 +175,16 @@ const carouselCss = computed(() => {
 
 const getGoodsListFn = () => {
     let data = {
-        num: 1,
-        goods_ids: diyComponent.value.source == 'custom' ? diyComponent.value.goods_ids : ''
+        pageNum: 1,
+        pageSize: 10,
+        ids: diyComponent.value.goodsIds.join(",")
     }
-    getGoodsComponents(data).then((res) => {
-        goodsList.value = res.data;
+   
+    getGoodsComponents(data).then((res:any) => {
+        if(res.rows && res.rows.length >0){
+            goodsList.value.push(res.rows[0]);
+            // goodsList.value = res.rows;
+        }
     });
 }
 
@@ -180,11 +206,13 @@ const refresh = () => {
     // 装修模式下设置默认图
     if (diyStore.mode == 'decorate') {
         let obj = {
+            memberPrice: '0.00',
             goods_cover_thumb_mid: "",
-            goods_name: "商品名称",
+            brandName: "商品名称",
             sale_num: "100",
             unit: "件",
-            goodsSku: { show_price: 100 }
+            goodsSku: { show_price: 100 },
+            productImage:''
         };
         goodsList.value.push(obj);
     } else {
@@ -193,7 +221,7 @@ const refresh = () => {
 }
 
 const toLink = (data: any) => {
-    redirect({ url: '/addon/shop/pages/goods/detail', param: { goods_id: data.goods_id } })
+    redirect({ url: '/addon/shop/pages/goods/detail', param: { goodsId: data.id } })
 }
 
 const swiperIndex = ref(0);

+ 4 - 24
src/addon/shop/pages/goods/category.vue

@@ -19,6 +19,7 @@
         class="category"
         v-if="config.level == 2 && config.template === 'style-2'"
         :categoryId="categoryId"
+        :mediumCategoryId="mediumCategoryId"
         :config="config"
       />
     </view>
@@ -45,30 +46,9 @@ let topTabbarData = topTabarObj.setTopTabbarParam({
 
 const config: any = ref({});
 const categoryId = ref(0);
+const mediumCategoryId = ref('');
 
 const getGoodsCategoryConfigFn = () => {
-  //   config.value = {
-  //     level: 1,
-  //     template: "style-1",
-  //     page_title: "商品分类",
-  //     search: {
-  //       control: 1,
-  //       title: "请搜索您想要的商品",
-  //     },
-  //     goods: {
-  //       style: "single-cols",
-  //     },
-  //     sort: "default",
-  //     cart: {
-  //       control: 1,
-  //       event: "cart",
-  //       style: "style-4",
-  //       text: "购买",
-  //     },
-  //   };
-  //   uni.setNavigationBarTitle({
-  //     title: config.value.page_title,
-  //   });
   getGoodsCategoryConfig().then((res: any) => {
     config.value = {
       level: res.data.level,
@@ -86,7 +66,6 @@ const getGoodsCategoryConfigFn = () => {
         text: "购买",
       },
     };
-    console.log("config", config.value);
     uni.setNavigationBarTitle({
       title: config.value.page_title,
     });
@@ -94,7 +73,8 @@ const getGoodsCategoryConfigFn = () => {
 };
 
 onLoad((options: any) => {
-  categoryId.value = options.category_id || 0;
+  categoryId.value = options.categoryId || 0;
+  mediumCategoryId.value = options.mediumCategoryId || '';
   getGoodsCategoryConfigFn();
 });
 

+ 1 - 1
src/addon/shop/pages/goods/components/category-template-one-one.vue

@@ -159,7 +159,7 @@ const getListFn = (mescroll: mescrollStructure) => {
     getGoodsComponents({
         pageNum: mescroll.num,
         pageSize: mescroll.size,
-        topCategoryId: categoryId, // 商品分类id
+        topCategoryId: categoryId == 0 ? '' : categoryId, // 商品分类id
         searchKeyword: searchName.value
     }).then((res: any) => {
         let newArr = res.rows

+ 28 - 9
src/addon/shop/pages/goods/components/category-template-two-two.vue

@@ -84,8 +84,9 @@
                                         'border-[var(--temp-bg)]  bg-[var(--temp-bg)]':
                                             index != subActive,
                                         ' ml-[24rpx]': index != 0,
-                                    }" v-for="(item, index) in tabsData[tabActive]?.children" :key="tabsData[tabActive].id"
-                                    :id="'id' + index" @click="subMenuClick(index, item, 2)">{{ item.label }}</text>
+                                    }" v-for="(item, index) in tabsData[tabActive]?.children"
+                                    :key="tabsData[tabActive].id" :id="'id' + index"
+                                    @click="subMenuClick(index, item, 2)">{{ item.label }}</text>
                             </view>
                         </scroll-view>
                         <view
@@ -110,8 +111,9 @@
                                         index === subActive,
                                     'border-[var(--temp-bg)]  bg-[var(--temp-bg)]':
                                         index != subActive,
-                                }" v-for="(item, index) in tabsData[tabActive]?.children" :key="tabsData[tabActive].category_id"
-                                @click="subMenuClick(index, item, 2)">{{ item.category_name }}</text>
+                                }" v-for="(item, index) in tabsData[tabActive]?.children"
+                                :key="tabsData[tabActive].category_id" @click="subMenuClick(index, item, 2)">{{
+                                    item.label }}</text>
                         </view>
                     </u-popup>
                 </view>
@@ -222,16 +224,20 @@ const prop = defineProps({
         type: [String, Number],
         default: 0,
     },
+    mediumCategoryId: {
+        type: [String, Number],
+        default: '',
+    },
 });
 let config = prop.config;
 let categoryId = prop.categoryId;
+let mediumCategoryId = prop.mediumCategoryId;
 const list = ref<any>([]);
 const searchName = ref("");
 const loading = ref<boolean>(true); //页面加载动画
 const listLoading = ref<boolean>(false); //列表加载动画
 const labelPopup = ref<boolean>(false);
 const cartData = ref<Array<any>>([]);
-const mediumCategoryId = ref<any>(null);
 cartData.value = uni.getStorageSync("shopCart") || [];
 
 interface mescrollStructure {
@@ -247,8 +253,8 @@ const getListFn = (mescroll: mescrollStructure) => {
         pageNum: mescroll.num,
         pageSize: mescroll.size,
         searchKeyword: searchName.value,
-        topCategoryId: categoryId, // 商品分类id
-        mediumCategoryId:mediumCategoryId.value
+        topCategoryId: categoryId == 0 ? '' : categoryId, // 商品分类id
+        mediumCategoryId: mediumCategoryId
     })
         .then((res: any) => {
             let newArr = res.rows;
@@ -347,6 +353,19 @@ const getCategoryData = () => {
                         }
                     }
                 }
+            } else if (mediumCategoryId) {
+                for (let i = 0; i < tabsData.value.length; i++) {
+                    if (tabsData.value[i].children) {
+                        for (let k = 0; k < tabsData.value[i].children.length; k++) {
+                            if (tabsData.value[i].children[k].id == mediumCategoryId) {
+                                tabActive.value = i;
+                                subActive.value = k;
+                                categoryId = tabsData.value[i].id;
+                                break;
+                            }
+                        }
+                    }
+                }
             } else {
                 categoryId = res.data[0].id;
             }
@@ -366,7 +385,7 @@ const subActive = ref<number>(0);
 const firstLevelClick = (index: any, data: any) => {
     tabActive.value = index;
     labelPopup.value = false;
-    mediumCategoryId.value = null;
+    mediumCategoryId = '';
     if (data.children && data.children.length) {
         subMenuClick(0, data, 1);
     } else {
@@ -386,7 +405,7 @@ const subMenuClick = (index: any, data: any, type: number) => {
     if (type == 1) {
         categoryId = data.id;
     } else {
-        mediumCategoryId.value = data.id;
+        mediumCategoryId = data.id;
     }
     labelPopup.value = false;
     list.value = [];

+ 6 - 6
src/addon/shop/pages/goods/search.vue

@@ -102,12 +102,12 @@ const deleteHistoryList = () => {
 }
 
 const getGoodsConfigSearchFn = () => {
-    getGoodsConfigSearch().then((res: any) => {
-        config.value = res.data;
-        if (config.value.search_words) {
-            config.value.search_words = config.value.search_words.filter((word: string) => word && word.trim() !== '');
-        }
-    })
+    // getGoodsConfigSearch().then((res: any) => {
+    //     config.value = res.data;
+    //     if (config.value.search_words) {
+    //         config.value.search_words = config.value.search_words.filter((word: string) => word && word.trim() !== '');
+    //     }
+    // })
 }
 
 //搜索

+ 2 - 2
src/app/components/diy/active-cube/index.vue

@@ -21,7 +21,7 @@
                     <view class="relative h-[36rpx]" @click="diyStore.toRedirect(diyComponent.subTitle.link)">
                         <view v-if="diyComponent.subTitle.text"
                               class="flex items-center text-[22rpx] leading-0 min-w-[60rpx] h-[34rpx] pl-[10rpx] pr-[34rpx]"
-                              :style="{'color': diyComponent.subTitle.textColor, 'background-image':'url('+img('static/resource/images/diy/active_cube/bg_2.png')+')','background-size': '100% 100%','background-repeat': 'no-repeat'}">{{ diyComponent.subTitle.text }}</view>
+                              :style="{'color': diyComponent.subTitle.textColor, 'background-image':'url('+img('https://v6.site.niucloud.com/static/resource/images/diy/active_cube/bg_2.png')+')','background-size': '100% 100%','background-repeat': 'no-repeat'}">{{ diyComponent.subTitle.text }}</view>
                         <!-- 	<image class="absolute left-0 top-0 bottom-0 !w-[16rpx] !h-[36rpx]" :src="img('static/resource/images/diy/active_cube/block_style2_1.png')" mode="scaleToFill"/>
                                     <image class="absolute right-0 top-0 bottom-0 !w-[28rpx] !h-[36rpx]" :src="img('static/resource/images/diy/active_cube/block_style2_2.png')" mode="scaleToFill"/> -->
                     </view>
@@ -52,7 +52,7 @@
                                     :style="btnCss(item.moreTitle)" v-if="item.moreTitle.text">
                                     <text class="mr-[8rpx]">{{ item.moreTitle.text }}</text>
                                     <text class="iconfont iconjiantou-you-cuxiantiao-fill !text-[20rpx] text-[#fff]"></text>
-                                    <image class="absolute left-0 top-0 bottom-0 !w-[28rpx]" :src="img('static/resource/images/diy/active_cube/block_style1_1.png')" mode="scaleToFill" />
+                                    <image class="absolute left-0 top-0 bottom-0 !w-[28rpx]" :src="img('https://v6.site.niucloud.com/static/resource/images/diy/active_cube/block_style1_1.png')" mode="scaleToFill" />
                                 </view>
                             </view>
                             <view class="img-box ml-[10rpx] w-[130rpx]" v-if="item.imageUrl">

+ 1 - 72
src/app/components/diy/carousel-search/index.vue

@@ -47,20 +47,6 @@
                         </view>
                     </view>
                     <view class="flex items-center w-full mt-[16rpx]">
-                        <view @click.stop="locationVal.reposition()" v-if="systemStore.diyAddressInfo"
-                            :style="{ color: diyComponent.search.positionColor }" class="mr-[30rpx]">
-                            <view class="flex items-baseline font-500">
-                                <text class="text-[24rpx] mr-[2rpx]">{{ systemStore.diyAddressInfo.city }}</text>
-                                <text class="iconfont iconxiaV6xx !text-[24rpx]"></text>
-                            </view>
-                            <view class="text-[18rpx] mt-[10rpx] truncate max-w-[160rpx]"
-                                v-if="systemStore.diyAddressInfo.community">{{ systemStore.diyAddressInfo.community }}
-                            </view>
-                        </view>
-                        <view @click.stop="locationVal.reposition()"
-                            class="text-[24rpx] mr-[30rpx] truncate max-w-[160rpx]"
-                            :style="{ color: diyComponent.search.positionColor }" v-else>{{
-                                systemStore.defaultPositionAddress }}</view>
                         <view class="search-content" :style="{ backgroundColor: diyComponent.search.bgColor }"
                             @click.stop="diyStore.toRedirect(diyComponent.search.link)">
                             <text class="input-content text-[#fff] text-[24rpx] leading-[68rpx]"
@@ -80,32 +66,6 @@
                         </view>
                     </view>
                 </view>
-
-                <view class="tab-list-wrap relative z-10" v-if="diyComponent.tab.control">
-                    <scroll-view scroll-x="true" class="scroll-wrap" :scroll-into-view="'a' + currTabIndex">
-                        <view @click="changeData({ source: 'home' }, -1)" class="scroll-item"
-                            :class="[{ active: currTabIndex == -1 }]">
-                            <view class="name" :style="{ 'color': getTabColor(currTabIndex == -1) }">首页</view>
-                        </view>
-                        <view v-for="(item, index) in diyComponent.tab.list" class="scroll-item"
-                            :class="[{ active: index == currTabIndex }]" @click="changeData(item, index)"
-                            :id="'a' + index" :key="index">
-                            <view class="name" :style="{ 'color': getTabColor(index == currTabIndex) }">{{ item.text }}
-                            </view>
-                        </view>
-                    </scroll-view>
-                    <view v-if="diyComponent.tab.list.length"
-                        class="absolute tab-btn iconfont icona-yingyongliebiaoV6xx-32" @click="tabAllPopup = true">
-                    </view>
-                </view>
-
-                <view class="bg-img" v-if="fixedStyleBg">
-                    <image
-                        v-if="diyComponent.swiper.control && diyComponent.swiper.list && diyComponent.swiper.list[swiperIndex].imageUrl"
-                        :src="img(diyComponent.swiper.list[swiperIndex].imageUrl)" mode="widthFix" class="w-full h-full"
-                        :show-menu-by-longpress="true" />
-                    <view v-else class="w-full h-full bg-[#fff]"></view>
-                </view>
             </view>
             <!-- 解决fixed定位后导航栏塌陷的问题 -->
             <template v-if="diyStore.mode != 'decorate'">
@@ -133,7 +93,7 @@
                                     :style="swiperWarpCss"
                                     :class="['w-full h-full', { 'swiper-animation': (swiperIndex != index && diyComponent.swiper.indicatorStyle != 'style-3') }]"
                                     :show-menu-by-longpress="true" />
-                                <image v-else :src="img('static/resource/images/diy/figure.png')" :style="swiperWarpCss"
+                                <image v-else :src="img('https://v6.site.niucloud.com/static/resource/images/diy/figure.png')" :style="swiperWarpCss"
                                     mode="scaleToFill"
                                     :class="['w-full h-full', { 'swiper-animation': (swiperIndex != index && diyComponent.swiper.indicatorStyle != 'style-3') }]"
                                     :show-menu-by-longpress="true" />
@@ -156,20 +116,6 @@
                 </view>
                 <!-- #endif -->
             </view>
-
-            <!-- 分类展开 -->
-            <u-popup :safeAreaInsetTop="true" :show="tabAllPopup" mode="top" @close="tabAllPopup = false">
-                <view class="text-sm px-[30rpx] pt-3" :style="{ 'padding-top': (systemStore.menuButtonInfo.top + 'px') }">
-                    全部分类</view>
-                <view class="flex flex-wrap pl-[30rpx] pt-[30rpx]">
-                    <view @click="changeData({ source: 'home' }, -1)"
-                        :class="['px-[26rpx] border-[2rpx] border-solid border-transparent h-[60rpx] mr-[30rpx] mb-[30rpx] flex items-center justify-center bg-[#F4F4F4] rounded-[8rpx] text-xs', { 'tab-select-popup': currTabIndex == -1 }]">
-                        首页</view>
-                    <text @click="changeData(item, index)" v-for="(item, index) in diyComponent.tab.list" :key="index"
-                        :class="['px-[26rpx] border-[2rpx] border-solid border-transparent h-[60rpx] mr-[30rpx] mb-[30rpx] flex items-center justify-center bg-[#F4F4F4] rounded-[8rpx] text-xs', { 'tab-select-popup': index == currTabIndex }]">{{
-                        item.text }}</text>
-                </view>
-            </u-popup>
         </view>
 
         <!-- 展示微页面数据 -->
@@ -319,23 +265,6 @@ const carouselSwiperStyle = () => {
     return style;
 }
 
-const getTabColor = (flag: any) => {
-    let color = '';
-    if (flag) {
-        color = diyComponent.value.tab.selectColor;
-        if (diyComponent.value.positionWay == 'fixed' && props.scrollBool == 1) {
-            color = diyComponent.value.tab.fixedSelectColor;
-        }
-    } else {
-        color = diyComponent.value.tab.noColor;
-        if (diyComponent.value.positionWay == 'fixed' && props.scrollBool == 1) {
-            color = diyComponent.value.tab.fixedNoColor;
-        }
-    }
-
-    return color;
-}
-
 const isShowSearchPlaceholder = computed(() => {
     let flag = true;
     for (let i = 0; i < diyComponent.value.search.hotWord.list.length; i++) {

+ 1 - 1
src/app/components/diy/float-btn/index.vue

@@ -3,7 +3,7 @@
         <view v-if="diyComponent.style==='style-1'" class="flex flex-col items-center p-[24rpx]" :style="warpCss">
             <view v-for="(item,index) in diyComponent.list" :key="index" @click="diyStore.toRedirect(item.link)" :class="{'flex items-center justify-center' : true, 'mb-[20rpx]': diyComponent.list.length != index+1 }" :style="floatBtnItemCss">
                 <image v-if="item && item.imageUrl" :style="floatBtnItemCss" :src="img(item.imageUrl)" mode="aspectFit" />
-                <image v-else :src="img('static/resource/images/diy/figure.png')" mode="aspectFit" :style="floatBtnItemCss" />
+                <image v-else :src="img('https://v6.site.niucloud.com/static/resource/images/diy/figure.png')" mode="aspectFit" :style="floatBtnItemCss" />
             </view>
         </view>
         <!-- <view v-if="diyComponent.style==='style-2'" class="relative w-[3rpx] h-[3rpx]">

+ 4 - 4
src/app/components/diy/graphic-nav/index.vue

@@ -9,7 +9,7 @@
 
                         <view class="graphic-img relative flex items-center w-10 h-10 mr-[20rpx]" v-if="diyComponent.mode != 'text'" :style="{ width: diyComponent.imageSize * 2 + 'rpx', height: diyComponent.imageSize * 2 + 'rpx' }">
                             <image v-if="item.imageUrl" :src="img(item.imageUrl)" mode="aspectFill" :style="{ maxWidth: diyComponent.imageSize * 2 + 'rpx', maxHeight: diyComponent.imageSize * 2 + 'rpx', borderRadius: diyComponent.aroundRadius * 2 + 'rpx' }" />
-                            <image v-else :src="img('static/resource/images/diy/figure.png')" mode="aspectFill" :style="{ maxWidth: diyComponent.imageSize * 2 + 'rpx', maxHeight: diyComponent.imageSize * 2 + 'rpx', borderRadius: diyComponent.aroundRadius * 2 + 'rpx' }" />
+                            <image v-else :src="img('https://v6.site.niucloud.com/static/resource/images/diy/figure.png')" mode="aspectFill" :style="{ maxWidth: diyComponent.imageSize * 2 + 'rpx', maxHeight: diyComponent.imageSize * 2 + 'rpx', borderRadius: diyComponent.aroundRadius * 2 + 'rpx' }" />
                             <text v-if="item.label.control"
                                   class="tag absolute -top-[10rpx] -right-[24rpx] text-white rounded-[24rpx] rounded-bl-none transform scale-80 py-1 px-2 text-xs"
                                   :style="{ color: item.label.textColor, backgroundImage: 'linear-gradient(' + item.label.bgColorStart + ',' + item.label.bgColorEnd + ')' }">{{ item.label.text }}</text>
@@ -38,7 +38,7 @@
                                     <view class="graphic-img relative flex items-center justify-center w-10 h-10" v-if="diyComponent.mode != 'text'"
                                           :style="{ width: diyComponent.imageSize * 2 + 'rpx', height: diyComponent.imageSize * 2 + 'rpx' }">
                                         <image v-if="item.imageUrl" :src="img(item.imageUrl)" mode="aspectFill" :style="{ maxWidth: diyComponent.imageSize * 2 + 'rpx', maxHeight: diyComponent.imageSize * 2 + 'rpx', borderRadius: diyComponent.aroundRadius * 2 + 'rpx' }" />
-                                        <image v-else :src="img('static/resource/images/diy/figure.png')" mode="aspectFill" :style="{ maxWidth: diyComponent.imageSize * 2 + 'rpx', maxHeight: diyComponent.imageSize * 2 + 'rpx', borderRadius: diyComponent.aroundRadius * 2 + 'rpx' }" />
+                                        <image v-else :src="img('https://v6.site.niucloud.com/static/resource/images/diy/figure.png')" mode="aspectFill" :style="{ maxWidth: diyComponent.imageSize * 2 + 'rpx', maxHeight: diyComponent.imageSize * 2 + 'rpx', borderRadius: diyComponent.aroundRadius * 2 + 'rpx' }" />
 
                                         <text
                                             class="tag absolute -top-[10rpx] -right-[24rpx] text-white rounded-[24rpx] rounded-bl-none transform scale-80 py-1 px-2 text-xs"
@@ -81,7 +81,7 @@
                                       v-if="diyComponent.mode != 'text'"
                                       :style="{ width: diyComponent.imageSize * 2 + 'rpx', height: diyComponent.imageSize * 2 + 'rpx' }">
                                     <image v-if="item.imageUrl" :src="img(item.imageUrl)" mode="aspectFill" :style="{ maxWidth: diyComponent.imageSize * 2 + 'rpx', maxHeight: diyComponent.imageSize * 2 + 'rpx', borderRadius: diyComponent.aroundRadius * 2 + 'rpx' }" />
-                                    <image v-else :src="img('static/resource/images/diy/figure.png')" mode="aspectFill" :style="{ maxWidth: diyComponent.imageSize * 2 + 'rpx', maxHeight: diyComponent.imageSize * 2 + 'rpx', borderRadius: diyComponent.aroundRadius * 2 + 'rpx' }" />
+                                    <image v-else :src="img('https://v6.site.niucloud.com/static/resource/images/diy/figure.png')" mode="aspectFill" :style="{ maxWidth: diyComponent.imageSize * 2 + 'rpx', maxHeight: diyComponent.imageSize * 2 + 'rpx', borderRadius: diyComponent.aroundRadius * 2 + 'rpx' }" />
                                     <text :class="['tag absolute -top-[10rpx] -right-[24rpx] text-white rounded-[24rpx] rounded-bl-none transform scale-80 py-1 px-2 text-xs']"
                                         v-if="item.label.control"
                                         :style="{ color: item.label.textColor, backgroundImage: 'linear-gradient(' + item.label.bgColorStart + ',' + item.label.bgColorEnd + ')' }">{{ item.label.text }}</text>
@@ -113,7 +113,7 @@
                                   v-if="diyComponent.mode != 'text'"
                                   :style="{ width: diyComponent.imageSize * 2 + 'rpx', height: diyComponent.imageSize * 2 + 'rpx' }">
                                 <image v-if="item.imageUrl" :src="img(item.imageUrl)" mode="aspectFill" :style="{ maxWidth: diyComponent.imageSize * 2 + 'rpx', maxHeight: diyComponent.imageSize * 2 + 'rpx', borderRadius: diyComponent.aroundRadius * 2 + 'rpx' }" />
-                                <image v-else :src="img('static/resource/images/diy/figure.png')" mode="aspectFill" :style="{ maxWidth: diyComponent.imageSize * 2 + 'rpx', maxHeight: diyComponent.imageSize * 2 + 'rpx', borderRadius: diyComponent.aroundRadius * 2 + 'rpx' }" />
+                                <image v-else :src="img('https://v6.site.niucloud.com/static/resource/images/diy/figure.png')" mode="aspectFill" :style="{ maxWidth: diyComponent.imageSize * 2 + 'rpx', maxHeight: diyComponent.imageSize * 2 + 'rpx', borderRadius: diyComponent.aroundRadius * 2 + 'rpx' }" />
                                 <text :class="['tag absolute -top-[10rpx] -right-[24rpx] text-white rounded-[24rpx] rounded-bl-none transform scale-80 py-1 px-2 text-xs']"
                                     v-if="item.label.control"
                                     :style="{ color: item.label.textColor, backgroundImage: 'linear-gradient(' + item.label.bgColorStart + ',' + item.label.bgColorEnd + ')' }">{{ item.label.text }}</text>

+ 1 - 1
src/app/components/diy/hot-area/index.vue

@@ -2,7 +2,7 @@
     <view :style="warpCss">
         <view class="simple-graph-wrap overflow-hidden relative leading-0">
             <image v-if="diyComponent.imageUrl" :style="itemCss" :src="img(diyComponent.imageUrl)" mode="widthFix" :show-menu-by-longpress="true" class="w-full" />
-            <image v-else :style="itemCss" :src="img('static/resource/images/diy/figure.png')" mode="widthFix" :show-menu-by-longpress="true" class="w-full" />
+            <image v-else :style="itemCss" :src="img('https://v6.site.niucloud.com/static/resource/images/diy/figure.png')" mode="widthFix" :show-menu-by-longpress="true" class="w-full" />
 
             <template v-if="diyStore.mode != 'decorate'">
                 <!-- 热区功能 -->

+ 1 - 1
src/app/components/diy/image-ads/index.vue

@@ -4,7 +4,7 @@
             <view v-if="diyComponent.list.length == 1" class="leading-0 overflow-hidden" :style="swiperWarpCss">
                 <view @click="diyStore.toRedirect(diyComponent.list[0].link)">
                     <image v-if="diyComponent.list[0].imageUrl" :src="img(diyComponent.list[0].imageUrl)" :style="{height: imgHeight}" mode="heightFix" class="!w-full" :show-menu-by-longpress="true" />
-                    <image v-else :src="img('static/resource/images/diy/figure.png')" :style="{height: imgHeight}" mode="heightFix" class="!w-full" :show-menu-by-longpress="true" />
+                    <image v-else :src="img('https://v6.site.niucloud.com/static/resource/images/diy/figure.png')" :style="{height: imgHeight}" mode="heightFix" class="!w-full" :show-menu-by-longpress="true" />
                 </view>
             </view>
 

+ 2 - 2
src/app/components/diy/notice/index.vue

@@ -5,8 +5,8 @@
             <view class="flex items-center pl-[28rpx] p-[22rpx]">
                 <view v-if="diyComponent.noticeType == 'img'" class="min-w-[60rpx] flex items-center">
                     <template v-if="diyComponent.imgType == 'system'">
-                        <image v-if="diyComponent.systemUrl == 'style_1'" :src="img(`static/resource/images/diy/notice/${diyComponent.systemUrl}.png`)" class="h-[40rpx] w-[auto] mr-[20rpx] flex-shrink-0" mode="heightFix" />
-                        <image v-else-if="diyComponent.systemUrl == 'style_2'" :src="img(`static/resource/images/diy/notice/${diyComponent.systemUrl}.png`)" class="w-[200rpx] mr-[20rpx] h-[30rpx] flex-shrink-0" mode="heightFix" />
+                        <image v-if="diyComponent.systemUrl == 'style_1'" :src="img(`https://v6.site.niucloud.com/static/resource/images/diy/notice/${diyComponent.systemUrl}.png`)" class="h-[40rpx] w-[auto] mr-[20rpx] flex-shrink-0" mode="heightFix" />
+                        <image v-else-if="diyComponent.systemUrl == 'style_2'" :src="img(`https://v6.site.niucloud.com/static/resource/images/diy/notice/${diyComponent.systemUrl}.png`)" class="w-[200rpx] mr-[20rpx] h-[30rpx] flex-shrink-0" mode="heightFix" />
                     </template>
                     <image v-else-if="diyComponent.imgType == 'diy'" :src="img(diyComponent.imageUrl || '')" class="w-[200rpx] h-[30rpx] mr-[20rpx] flex-shrink-0" mode="heightFix" />
                 </view>

+ 6 - 6
src/app/components/diy/rubik-cube/index.vue

@@ -9,7 +9,7 @@
                     <view @click="diyStore.toRedirect(diyComponent.list[0].link)" :class="['item', diyComponent.mode]"
                           :style="{ marginRight: diyComponent.imageGap * 2 + 'rpx', width: diyComponent.list[0].imgWidth, height: diyComponent.list[0].imgHeight + 'px' }">
                         <image v-if="diyComponent.list[0].imageUrl" :src="img(diyComponent.list[0].imageUrl)" mode="scaleToFill" :style="diyComponent.list[0].pageItemStyle" :show-menu-by-longpress="true" />
-                        <image v-else :src="img('static/resource/images/diy/figure.png')" mode="scaleToFill" :style="diyComponent.list[0].pageItemStyle" :show-menu-by-longpress="true" />
+                        <image v-else :src="img('https://v6.site.niucloud.com/static/resource/images/diy/figure.png')" mode="scaleToFill" :style="diyComponent.list[0].pageItemStyle" :show-menu-by-longpress="true" />
                     </view>
                 </view>
 
@@ -18,7 +18,7 @@
                         <template v-if="index > 0">
                             <view @click="diyStore.toRedirect(item.link)" :class="['item', diyComponent.mode]" :style="{ marginBottom: diyComponent.imageGap * 2 + 'rpx', width: item.imgWidth, height: item.imgHeight + 'px' }">
                                 <image v-if="item.imageUrl" :src="img(item.imageUrl)" mode="scaleToFill" :style="item.pageItemStyle" :show-menu-by-longpress="true" />
-                                <image v-else :src="img('static/resource/images/diy/figure.png')" mode="scaleToFill" :style="item.pageItemStyle" :show-menu-by-longpress="true" />
+                                <image v-else :src="img('https://v6.site.niucloud.com/static/resource/images/diy/figure.png')" mode="scaleToFill" :style="item.pageItemStyle" :show-menu-by-longpress="true" />
                             </view>
                         </template>
                     </template>
@@ -31,7 +31,7 @@
                     <view @click="diyStore.toRedirect(diyComponent.list[0].link)" :class="['item', diyComponent.mode]"
                           :style="{ marginRight: diyComponent.imageGap * 2 + 'rpx', width: diyComponent.list[0].imgWidth, height: diyComponent.list[0].imgHeight + 'px' }">
                         <image v-if="diyComponent.list[0].imageUrl" :src="img(diyComponent.list[0].imageUrl)" mode="scaleToFill" :style="diyComponent.list[0].pageItemStyle" :show-menu-by-longpress="true" />
-                        <image v-else :src="img('static/resource/images/diy/figure.png')" mode="scaleToFill" :style="diyComponent.list[0].pageItemStyle" :show-menu-by-longpress="true" />
+                        <image v-else :src="img('https://v6.site.niucloud.com/static/resource/images/diy/figure.png')" mode="scaleToFill" :style="diyComponent.list[0].pageItemStyle" :show-menu-by-longpress="true" />
                     </view>
                 </view>
 
@@ -39,7 +39,7 @@
                     <view @click="diyStore.toRedirect(diyComponent.list[1].link)" :class="['item', diyComponent.mode]"
                           :style="{ marginBottom: diyComponent.imageGap * 2 + 'rpx', width: diyComponent.list[1].imgWidth, height: diyComponent.list[1].imgHeight + 'px' }">
                         <image v-if="diyComponent.list[1].imageUrl" :src="img(diyComponent.list[1].imageUrl)" mode="scaleToFill" :style="diyComponent.list[1].pageItemStyle" :show-menu-by-longpress="true" />
-                        <image v-else :src="img('static/resource/images/diy/figure.png')" mode="scaleToFill" :style="diyComponent.list[1].pageItemStyle" :show-menu-by-longpress="true" />
+                        <image v-else :src="img('https://v6.site.niucloud.com/static/resource/images/diy/figure.png')" mode="scaleToFill" :style="diyComponent.list[1].pageItemStyle" :show-menu-by-longpress="true" />
                     </view>
                     <view class="template-bottom">
                         <template v-for="(item, index) in diyComponent.list" :key="index">
@@ -47,7 +47,7 @@
                                 <view @click="diyStore.toRedirect(item.link)" :class="['item', diyComponent.mode]"
                                       :style="{ marginRight: diyComponent.imageGap * 2 + 'rpx', width: item.imgWidth, height: item.imgHeight + 'px' }">
                                     <image v-if="item.imageUrl" :src="img(item.imageUrl)" mode="scaleToFill" :style="item.pageItemStyle" :show-menu-by-longpress="true" />
-                                    <image v-else :src="img('static/resource/images/diy/figure.png')" mode="scaleToFill" :style="item.pageItemStyle" :show-menu-by-longpress="true" />
+                                    <image v-else :src="img('https://v6.site.niucloud.com/static/resource/images/diy/figure.png')" mode="scaleToFill" :style="item.pageItemStyle" :show-menu-by-longpress="true" />
                                 </view>
                             </template>
                         </template>
@@ -59,7 +59,7 @@
                 <view :class="['item', diyComponent.mode]" v-for="(item, index) in diyComponent.list" :key="index" @click="diyStore.toRedirect(item.link)"
                       :style="{ marginRight: diyComponent.imageGap * 2 + 'rpx', marginBottom: diyComponent.imageGap * 2 + 'rpx', width: item.widthStyle, height: item.imgHeight + 'px' }">
                     <image v-if="item.imageUrl" :src="img(item.imageUrl)" :mode="'scaleToFill'" :style="item.pageItemStyle" :show-menu-by-longpress="true" />
-                    <image v-else :src="img('static/resource/images/diy/figure.png')" :mode="'scaleToFill'" :style="item.pageItemStyle" :show-menu-by-longpress="true" />
+                    <image v-else :src="img('https://v6.site.niucloud.com/static/resource/images/diy/figure.png')" :mode="'scaleToFill'" :style="item.pageItemStyle" :show-menu-by-longpress="true" />
                 </view>
             </template>
 

+ 1 - 0
src/hooks/useDiy.ts

@@ -112,6 +112,7 @@ export function useDiy(params: any = {}) {
                         diyData.title = requestData.title;
 
                         let sources = JSON.parse(requestData.value); // todo diy的结构应该后台处理好,前端就不需要再转换了
+                        console.log(sources,'45645646')
 
                         diyData.global = sources.global;
 

+ 32 - 32
src/hooks/useLocation.ts

@@ -43,38 +43,38 @@ export function useLocation(isOpenLocation: any) {
             // #endif
 
             // #ifndef H5
-            if (systemStore.mapConfig.is_open && !uni.getStorageSync('location_address')) {
-                uni.getLocation({
-                    // #ifndef APP-PLUS
-                    type: 'gcj02',
-                    // #endif
-                    success: res => {
-                        let latlng = res.latitude + ',' + res.longitude; // 纬度(浮点数,范围为90 ~ -90),经度(浮点数,范围为180 ~ -180)
-                        getAddressByLatlngFn(latlng);
-                    },
-                    fail: (res) => {
-                        uni.showToast({ title: res.errMsg, icon: 'none', duration: 15000 })
-                        systemStore.defaultPositionAddress = '定位失败';
-                        if (res.errno) {
-                            if (res.errno == 104) {
-                                let msg = '用户未授权隐私权限,获取位置失败';
-                                uni.showToast({ title: msg, icon: 'none' })
-                            } else if (res.errno == 112) {
-                                let msg = '隐私协议中未声明,获取位置失败';
-                                uni.showToast({ title: msg, icon: 'none' })
-                            }
-                        }
-                        if (res.errMsg) {
-                            if (res.errMsg.indexOf('getLocation:fail') != -1 || res.errMsg.indexOf('deny') != -1 || res.errMsg.indexOf('denied') != -1) {
-                                let msg = '用户未授权获取位置权限,将无法提供服务';
-                                uni.showToast({ title: msg, icon: 'none' })
-                            } else {
-                                uni.showToast({ title: res.errMsg, icon: 'none' })
-                            }
-                        }
-                    }
-                });
-            }
+            // if (systemStore.mapConfig.is_open && !uni.getStorageSync('location_address')) {
+            //     uni.getLocation({
+            //         // #ifndef APP-PLUS
+            //         type: 'gcj02',
+            //         // #endif
+            //         success: res => {
+            //             let latlng = res.latitude + ',' + res.longitude; // 纬度(浮点数,范围为90 ~ -90),经度(浮点数,范围为180 ~ -180)
+            //             getAddressByLatlngFn(latlng);
+            //         },
+            //         fail: (res) => {
+            //             uni.showToast({ title: res.errMsg, icon: 'none', duration: 15000 })
+            //             systemStore.defaultPositionAddress = '定位失败';
+            //             if (res.errno) {
+            //                 if (res.errno == 104) {
+            //                     let msg = '用户未授权隐私权限,获取位置失败';
+            //                     uni.showToast({ title: msg, icon: 'none' })
+            //                 } else if (res.errno == 112) {
+            //                     let msg = '隐私协议中未声明,获取位置失败';
+            //                     uni.showToast({ title: msg, icon: 'none' })
+            //                 }
+            //             }
+            //             if (res.errMsg) {
+            //                 if (res.errMsg.indexOf('getLocation:fail') != -1 || res.errMsg.indexOf('deny') != -1 || res.errMsg.indexOf('denied') != -1) {
+            //                     let msg = '用户未授权获取位置权限,将无法提供服务';
+            //                     uni.showToast({ title: msg, icon: 'none' })
+            //                 } else {
+            //                     uni.showToast({ title: res.errMsg, icon: 'none' })
+            //                 }
+            //             }
+            //         }
+            //     });
+            // }
             // #endif
         }
     }