weixin_52219567 1 kuukausi sitten
vanhempi
sitoutus
92494866b1

+ 1 - 1
src/addon/shop/api/goods.ts

@@ -4,7 +4,7 @@ import request from '@/utils/request'
  * 获取商品分类模板配置
  */
 export function getGoodsCategoryConfig() {
-    return request.get(`shop/goods/category/config`)
+    return request.get(`mall/miniPageSetMini/current`)
 }
 
 /**

+ 494 - 484
src/addon/shop/components/diy/shop-goods-detail-basic-info/index.vue

@@ -3,7 +3,7 @@
 		v-if="diyComponent && diyComponent.goods && Object.keys(diyComponent.goods).length">
 		<!-- 自定义头部 -->
 		<view class="flex items-center left-0 right-0 z-10 bg-transparent detail-head"
-			:class="{'!bg-[#fff]' :detailHeadBgChange, 'fixed': diyStore.mode != 'decorate', 'absolute': diyStore.mode == 'decorate'}"
+			:class="{ '!bg-[#fff]': detailHeadBgChange, 'fixed': diyStore.mode != 'decorate', 'absolute': diyStore.mode == 'decorate' }"
 			:style="navbarInnerStyle">
 			<view class="flex-center h-[60rpx] rounded-[30rpx] box-border arrow-left px-[40rpx] leading-[1]"
 				:style="navbarInnerArrowStyle">
@@ -14,73 +14,80 @@
 		</view>
 		<view class="fixed top-0 left-0 right-0 bottom-0 z-100 bg-transparent" @click="topNav = false" v-if="topNav">
 			<view class="search-box w-[202rpx] bg-[#fff] rounded-[12rpx] relative" :style="fixedInnerStyle">
-				<view class="px-[20rpx] flex-center" @click="redirect(item.url)" v-for="(item,index) in menuContents"
+				<view class="px-[20rpx] flex-center" @click="redirect(item.url)" v-for="(item, index) in menuContents"
 					:key="index">
 					<text class="text-[30rpx] mr-[10rpx]" :class="item.iconfont"></text>
 					<text
-						class="pl-[14rpx] py-[20rpx] flex-1 text-[24rpx] text-[#333] border-0 border-[#ddd] border-b-[1rpx] border-solid">{{ item.name }}</text>
+						class="pl-[14rpx] py-[20rpx] flex-1 text-[24rpx] text-[#333] border-0 border-[#ddd] border-b-[1rpx] border-solid">{{
+							item.name }}</text>
 				</view>
 			</view>
 		</view>
 		<view class="w-full relative overflow-hidden" :style="mediumCss">
-			<view class="absolute top-0 left-0 w-full h-full transition-transform duration-300 ease-linear transform translate-x-0">
+			<view
+				class="absolute top-0 left-0 w-full h-full transition-transform duration-300 ease-linear transform translate-x-0">
 				<view class="swiper-box">
 					<u-swiper :list="diyComponent.goods.goods_image" @change="swiperChangeFn"
 						:indicator="(diyComponent.goods.goods_image.length != 1 || diyStore.mode == 'decorate') && diyComponent.medium.indicator"
-						:indicatorStyle="{'bottom': '70rpx'}" :autoplay="true"
-						:height="swiperImageHeight" radius="0" @click="swiperClick"></u-swiper>
+						:indicatorStyle="{ 'bottom': '70rpx' }" :autoplay="true" :height="swiperImageHeight" radius="0"
+						@click="swiperClick"></u-swiper>
 				</view>
 			</view>
 			<!-- 切换视频、图片 -->
 			<view
-				class="media-mode bg-[rgb(0,0,0,.5)] flex items-center rounded-[50rpx] p-[2rpx] absolute bottom-[130rpx] right-[20rpx] text-center leading-[46rpx]"
-			>
+				class="media-mode bg-[rgb(0,0,0,.5)] flex items-center rounded-[50rpx] p-[2rpx] absolute bottom-[130rpx] right-[20rpx] text-center leading-[46rpx]">
 				<view class="tab-item flex items-center !bg-[#fff] !text-[#666]">
 					<text
-						v-if="diyComponent?.goods?.goods_image?.length > 1">{{swiperCurrentIndex}}/{{diyComponent.goods.goods_image.length}}</text>
+						v-if="diyComponent?.goods?.goods_image?.length > 1">{{ swiperCurrentIndex }}/{{ diyComponent.goods.goods_image.length }}</text>
 				</view>
 			</view>
 		</view>
-		<view
-			class="relative flex items-center justify-between !bg-cover box-border pb-[26rpx] h-[136rpx] px-[30rpx]"
+		<view class="relative flex items-center justify-between !bg-cover box-border pb-[26rpx] h-[136rpx] px-[30rpx]"
 			:style="marketGoodCss">
 			<view class="text-[#fff] leading-[normal]">
 				<view class="inline-block mr-[14rpx] relative top-[2rpx]">
 					<text class="text-[32rpx] price-font mr-[4rpx]">¥</text>
-					<text
-						class="text-[48rpx] -mb-[4rpx] price-font">{{ parseFloat(goodsPrice).toFixed(2).split('.')[0] }}</text>
+					<text class="text-[48rpx] -mb-[4rpx] price-font">{{ parseFloat(goodsPrice).toFixed(2).split('.')[0]
+						}}</text>
 					<text class="text-[32rpx] price-font">.{{ parseFloat(goodsPrice).toFixed(2).split('.')[1] }}</text>
 				</view>
 				<view class="inline-block">
-					<text
-						class="text-[30rpx] relative top-[1rpx] price-font leading-[36rpx] line-through">¥{{ diyComponent.marketPrice || '0.00' }}</text>
+					<text class="text-[30rpx] relative top-[1rpx] price-font leading-[36rpx] line-through">¥{{
+						diyComponent.marketPrice || '0.00' }}</text>
 				</view>
 			</view>
 		</view>
 		<view class="overflow-hidden -mt-[34rpx] relative" :style="ordinaryGoodCss">
 			<view class="detail-title relative px-[30rpx] pt-[30rpx]">
 				<view class="font-medium text-[30rpx] multi-hidden leading-[40rpx]"
-					:style="{'color': diyComponent.goodsInfo.titleColor}">
-					<view class="brand-tag middle" v-if="diyComponent.goods.goods_brand"
-						:style="diyGoods.baseTagStyle(diyComponent?.goods?.goods_brand)">
-						{{ diyComponent?.goods?.goods_brand?.brand_name }}</view>
+					:style="{ 'color': diyComponent.goodsInfo.titleColor }">
+					<view class="brand-tag middle">
+						{{ diyComponent.isSelf == 1 ? '自营商品' : '非自营' }}</view>
 					{{ diyComponent.goods.goods_name }}
 				</view>
+				<view class="flex flex-wrap mt-[16rpx]">
+					<view class="base-tag middle">{{ diyComponent.brandName }}</view>
+					<view class="base-tag middle">{{ diyComponent.topCategoryName }}</view>
+					<view class="base-tag middle">{{ diyComponent.mediumCategoryName }}</view>
+					<view class="base-tag middle">{{ diyComponent.bottomCategoryName }}</view>
+				</view>
 				<view class="flex justify-between items-start mt-[24rpx]">
-					<view class="text-[24rpx] leading-[34rpx]" 
-						:style="{'color': diyComponent.goodsInfo.saleInfoColor}" v-if="saleInfo.includes('stock')">
+					<view class="text-[24rpx] leading-[34rpx]" :style="{ 'color': diyComponent.goodsInfo.saleInfoColor }"
+						v-if="saleInfo.includes('stock')">
 						<text class="whitespace-nowrap mr-[4rpx]">库存:</text>
 						<text>{{ diyComponent.allStock }}</text>
 						<text>{{ diyComponent.goods.unit }}</text>
 					</view>
-					<view class="text-[24rpx] leading-[34rpx]" v-if="saleInfo.includes('sales')" :style="{'color': diyComponent.goodsInfo.saleInfoColor}">
-                        <text class="mx-[2rpx]"> {{ diyComponent.isCustomize == 1 ? '可定制' : '不可定制' }}</text>
-                    </view>
-					<view class="text-[24rpx] leading-[34rpx]" v-if="saleInfo.includes('underlined_price')"  :style="{'color': diyComponent.goodsInfo.saleInfoColor}">
-                        <text class="whitespace-nowrap mr-[4rpx]">起订:</text>
-                        <text>{{ diyComponent.minOrderQuantity }}</text>
+					<view class="text-[24rpx] leading-[34rpx]" v-if="saleInfo.includes('sales')"
+						:style="{ 'color': diyComponent.goodsInfo.saleInfoColor }">
+						<text class="mx-[2rpx]"> {{ diyComponent.isCustomize == 1 ? '可定制' : '不可定制' }}</text>
+					</view>
+					<view class="text-[24rpx] leading-[34rpx]" v-if="saleInfo.includes('underlined_price')"
+						:style="{ 'color': diyComponent.goodsInfo.saleInfoColor }">
+						<text class="whitespace-nowrap mr-[4rpx]">起订:</text>
+						<text>{{ diyComponent.minOrderQuantity }}</text>
 						<text>{{ diyComponent.goods.unit }}</text>
-                    </view>
+					</view>
 				</view>
 			</view>
 		</view>
@@ -90,487 +97,490 @@
 </template>
 
 <script setup lang="ts">
-	import { ref, computed, watch, onMounted, nextTick, getCurrentInstance } from 'vue';
-	import { onPageScroll } from '@dcloudio/uni-app'
-	import { redirect, img, getToken } from '@/utils/common';
-	import useDiyStore from '@/app/stores/diy';
-	import useSystemStore from '@/stores/system'
-	import { useGoods } from '@/addon/shop/hooks/useGoods'
-	import useGoodsDetailStore from '@/addon/shop/stores/goodsDetail';
-
-	const props = defineProps(['component', 'index', 'value', 'global']);
-	const diyStore = useDiyStore();
-	const emits = defineEmits(['loadingFn', 'update:componentIsShow']); //商品数据加载完成之后触发
-	const topNav = ref(false);
-	const switchMedia : any = ref('img');
-	const swiperCurrentIndex = ref(1); // 轮播图当前索引
-	const videoContext : any = ref(null)
-	const discountTime = ref(0)
-	const swiperImageHeight = ref('100vw') // 轮播图高度
-	const diyGoods = useGoods();
-
-	const diyComponent = computed(() => {
-		if (diyStore.mode == 'decorate') {
-			const obj = {
-				price: 50,
-				goods: {
-					goods_image: [img('static/resource/images/diy/shop_default.jpg')],
-					goods_name: '商品名称',
-					sub_title: '商品副标题',
-					unit: '件',
-					sale_num: '50'
-				},
-				market_price: '100.00',
-				stock: 80,
-			}
-			return Object.assign({}, obj, diyStore.value[props.index]);
-		} else {
-			return Object.assign({}, props.component, useGoodsDetailStore().goodsDetail);
-		}
-	})
-	const saleInfo = ref<any>([])
-	const diyGlobal = computed(() => {
-		return props.global;
-	})
-
-	const warpCss = computed(() => {
-		let style = '';
-		style += 'position:relative;';
-		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 || diyComponent.value.componentEndBgColor) + ';';
-
-		if (diyComponent.value.componentBgUrl) {
-			style += `background-image:url('${img(diyComponent.value.componentBgUrl)}');`;
-			style += 'background-size: cover;background-repeat: no-repeat;';
-		}
-
-		if (diyComponent.value.topRounded) style += 'border-top-left-radius:' + diyComponent.value.topRounded * 2 + 'rpx;';
-		if (diyComponent.value.topRounded) style += 'border-top-right-radius:' + diyComponent.value.topRounded * 2 + 'rpx;';
-		if (diyComponent.value.bottomRounded) style += 'border-bottom-left-radius:' + diyComponent.value.bottomRounded * 2 + 'rpx;';
-		if (diyComponent.value.bottomRounded) style += 'border-bottom-right-radius:' + diyComponent.value.bottomRounded * 2 + 'rpx;';
-		return style;
-	})
-
-	/************ 自定义头部-start ****************/
-	const systemStore = useSystemStore()
-	let platform = systemStore.systemInfo.platform;
-
-	// 导航栏内部盒子的样式
-	const navbarInnerStyle = computed(() => {
-		let style = '';
-		// 导航栏宽度,如果在小程序下,导航栏宽度为胶囊的左边到屏幕左边的距离
-		// #ifdef MP
-		let rightButtonWidth = systemStore.menuButtonInfo.width ? systemStore.menuButtonInfo.width * 2 + 'rpx' : '70rpx';
-		style += 'height:' + systemStore.menuButtonInfo.height + 'px;';
-		style += 'padding-right:calc(' + rightButtonWidth + ' + 30rpx);';
-		style += 'padding-left:calc(' + rightButtonWidth + ' + 30rpx);';
-		style += 'padding-top:' + systemStore.menuButtonInfo.top + 'px;';
-		style += 'padding-bottom: 8px;';
-
-		style += 'font-size: 32rpx;';
-		if (platform === 'ios') {
-			// 苹果(iOS)设备
-			style += 'font-weight: 500;';
-		} else if (platform === 'android') {
-			// 安卓(Android)设备
-			style += 'font-size: 36rpx;';
-		}
-		// #endif
-
-		// #ifdef H5
-		style += 'height: 100rpx;';
-		style += 'padding-right: 30rpx;';
-		style += 'padding-left: 30rpx;';
-
-		style += 'font-size: 32rpx;';
-		if (platform === 'ios') {
-			// 苹果(iOS)设备
-			style += 'font-weight: 500;';
-		} else if (platform === 'android') {
-			// 安卓(Android)设备
-			style += 'font-size: 36rpx;';
-		}
-		// #endif
-
-		// #ifdef APP-PLUS
-		style += 'height: 80rpx;';
-		style += 'padding-right: 30rpx;';
-		style += 'padding-left: 30rpx;';
-		style += 'padding-top:' + systemStore.systemInfo.statusBarHeight + 'px;';
-		// #endif
-
-		return style;
-	})
-
-	// 导航栏内部盒子的样式
-	const navbarInnerArrowStyle = computed(() => {
-		let style = '';
-		// 导航栏宽度,如果在小程序下,导航栏宽度为胶囊的左边到屏幕左边的距离
-		// #ifdef MP
-		style += 'position: absolute;';
-		style += 'left:calc( 100vw - ' + systemStore.menuButtonInfo.right + 'px);';
-		if (platform === 'ios') {
-			// 苹果(iOS)设备
-			style += 'font-weight: 700;';
-		} else if (platform === 'android') {
-			// 安卓(Android)设备
-		}
-		// #endif
-		return style;
-	})
-
-	// 导航栏头部卡片样式
-	const fixedInnerStyle = computed(() => {
-		let style = '';
-		// #ifdef MP
-		style += 'top:' + (systemStore.menuButtonInfo.height + systemStore.menuButtonInfo.top + 8) + 'px;';
-		style += 'left:calc( 100vw - ' + systemStore.menuButtonInfo.right + 'px);';
-		// #endif
-		// #ifdef H5
-		style += 'top: 100rpx;';
-		style += 'left: 30rpx;';
-		// #endif
-		// #ifdef APP-PLUS
-		style += 'top:' + (systemStore.systemInfo.statusBarHeight + uni.upx2px(100)) + 'px;';
-		style += 'left: 30rpx;';
-		// #endif
-		return style;
-	})
-
-	// 头部滚动
-	const instance = getCurrentInstance();
-	let swiperHeight = 0
-	let detailHead = 0
-
-	const detailHeadBgChange = ref(false)
-	onPageScroll((e) => {
-		if (swiperHeight == 0 || detailHead == 0) return;
-		let height = swiperHeight - detailHead - 20;
-		detailHeadBgChange.value = false;
-		if (e.scrollTop >= height) {
-			detailHeadBgChange.value = true;
-		}
-	})
-	/************ 自定义头部-end ****************/
-	/************* 分享海报-end **************/
-
-	// 菜单列表
-	const menuList:any = {
-		index: {
-			name: '首页',
-			iconfont: 'nc-iconfont nc-icon-shouyeV6xx11',
-			url: { url: '/addon/shop/pages/index', mode: 'reLaunch' }
-		},
-		search: {
-			name: '搜索',
-			iconfont: 'nc-iconfont nc-icon-sousuo-duanV6xx1',
-			url: { url: '/addon/shop/pages/goods/search' }
-		},
-		cart: {
-			name: '购物车',
-			iconfont: 'nc-iconfont nc-icon-gouwucheV6xx1',
-			url: { url: '/addon/shop/pages/goods/cart' }
-		},
-		member: {
-			name: '个人中心',
-			iconfont: 'nc-iconfont nc-icon-a-wodeV6xx-36',
-			url: { url: '/addon/shop/pages/member/index' }
-		},
-		collect: {
-			name: '我的收藏',
-			iconfont: 'nc-iconfont nc-icon-guanzhuV6xx',
-			url: { url: '/addon/shop/pages/goods/collect' }
-		},
-		goods_list: {
-			name: '商品列表',
-			iconfont: 'iconfont icona-yingyongliebiaoV6xx-32',
-			url: { url: '/addon/shop/pages/goods/list' }
-		},
-		goods_category: {
-			name: '商品分类',
-			iconfont: 'nc-iconfont nc-icon-shangpinfenlei',
-			url: { url: '/addon/shop/pages/goods/category' }
+import { ref, computed, watch, onMounted, nextTick, getCurrentInstance } from 'vue';
+import { onPageScroll } from '@dcloudio/uni-app'
+import { redirect, img, getToken } from '@/utils/common';
+import useDiyStore from '@/app/stores/diy';
+import useSystemStore from '@/stores/system'
+import { useGoods } from '@/addon/shop/hooks/useGoods'
+import useGoodsDetailStore from '@/addon/shop/stores/goodsDetail';
+
+const props = defineProps(['component', 'index', 'value', 'global']);
+const diyStore = useDiyStore();
+const emits = defineEmits(['loadingFn', 'update:componentIsShow']); //商品数据加载完成之后触发
+const topNav = ref(false);
+const switchMedia: any = ref('img');
+const swiperCurrentIndex = ref(1); // 轮播图当前索引
+const videoContext: any = ref(null)
+const discountTime = ref(0)
+const swiperImageHeight = ref('100vw') // 轮播图高度
+const diyGoods = useGoods();
+
+const diyComponent = computed(() => {
+	if (diyStore.mode == 'decorate') {
+		const obj = {
+			price: 50,
+			goods: {
+				goods_image: [img('static/resource/images/diy/shop_default.jpg')],
+				goods_name: '商品名称',
+				sub_title: '商品副标题',
+				unit: '件',
+				sale_num: '50'
+			},
+			market_price: '100.00',
+			stock: 80,
 		}
+		return Object.assign({}, obj, diyStore.value[props.index]);
+	} else {
+		return Object.assign({}, props.component, useGoodsDetailStore().goodsDetail);
 	}
-
-	const menuContents = computed(() => {
-		const list:any = []
-		let menu = typeof diyComponent.value.menuContent == 'object' ? diyComponent.value.menuContent : diyComponent.value.menuContent.split(',')
-		menu.forEach((item : any) => {
-			if (menuList[item]) {
-				list.push(menuList[item])
-			}
-		})
-		return list
-	})
-
-	// 图片轮播change事件
-	const swiperChangeFn = (e : any) => {
-		swiperCurrentIndex.value = e.current + 1;
+})
+const saleInfo = ref<any>([])
+const diyGlobal = computed(() => {
+	return props.global;
+})
+
+const warpCss = computed(() => {
+	let style = '';
+	style += 'position:relative;';
+	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 || diyComponent.value.componentEndBgColor) + ';';
+
+	if (diyComponent.value.componentBgUrl) {
+		style += `background-image:url('${img(diyComponent.value.componentBgUrl)}');`;
+		style += 'background-size: cover;background-repeat: no-repeat;';
 	}
 
-
-	// 商品价格
-	const goodsPrice = computed(() => {
-		let price = "0.00";
-		if (diyStore.mode != 'decorate') {
-            price = diyComponent.value.memberPrice || '0.00'
-		} else {
-			price = '100.00' // 装修模式
-		}
-		return price;
-	})
-
-	// 普通商品样式
-	const ordinaryGoodCss = computed(() => {
-		let style = "";
-
-		if (diyComponent.value.goodsInfo.startBgColor && diyComponent.value.goodsInfo.endBgColor) style += `background:linear-gradient(180deg,${diyComponent.value.goodsInfo.startBgColor} 85% ,${diyComponent.value.goodsInfo.endBgColor} 100%);`;
-		else style += 'background-color:' + (diyComponent.value.goodsInfo.startBgColor || diyComponent.value.goodsInfo.endBgColor) + ';';
-
-		if (diyComponent.value.goodsInfo.topMargin) style += 'margin-top:' + diyComponent.value.goodsInfo.topMargin * 2 + 'rpx;';
-		if (diyComponent.value.goodsInfo.aboutMargin) {
-			style += 'margin-left:' + diyComponent.value.goodsInfo.aboutMargin * 2 + 'rpx;';
-			style += 'margin-right:' + diyComponent.value.goodsInfo.aboutMargin * 2 + 'rpx;';
-		}
-
-		if (diyComponent.value.goodsInfo.topRounded) style += 'border-top-left-radius:' + diyComponent.value.goodsInfo.topRounded * 2 + 'rpx;';
-		if (diyComponent.value.goodsInfo.topRounded) style += 'border-top-right-radius:' + diyComponent.value.goodsInfo.topRounded * 2 + 'rpx;';
-		if (diyComponent.value.goodsInfo.bottomRounded) style += 'border-bottom-left-radius:' + diyComponent.value.goodsInfo.bottomRounded * 2 + 'rpx;';
-		if (diyComponent.value.goodsInfo.bottomRounded) style += 'border-bottom-right-radius:' + diyComponent.value.goodsInfo.bottomRounded * 2 + 'rpx;';
-		return style;
-	})
-
-	// 价格模块样式
-	const marketGoodCss = computed(() => {
-		let style = "";
-		let imgVal = 'https://v6.site.niucloud.com/' + diyComponent.value.priceRegion.marketingBgImg;
-		style += `background: url(${img(imgVal)}) no-repeat;`;
-
-		if (diyComponent.value.goodsInfo.priceBgColor) {
-			style += `background-color: ${diyComponent.value.goodsInfo.priceBgColor};`;
-		}
-
-		if (diyComponent.value.goodsInfo.priceTopMargin) style += 'margin-top:' + diyComponent.value.goodsInfo.priceTopMargin * 2 + 'rpx;';
-		if (diyComponent.value.goodsInfo.priceAboutMargin) {
-			style += 'margin-left:' + diyComponent.value.goodsInfo.priceAboutMargin * 2 + 'rpx;';
-			style += 'margin-right:' + diyComponent.value.goodsInfo.priceAboutMargin * 2 + 'rpx;';
-		}
-
-		if (diyComponent.value.goodsInfo.priceTopRounded) style += 'border-top-left-radius:' + diyComponent.value.goodsInfo.priceTopRounded * 2 + 'rpx;';
-		if (diyComponent.value.goodsInfo.priceTopRounded) style += 'border-top-right-radius:' + diyComponent.value.goodsInfo.priceTopRounded * 2 + 'rpx;';
-		if (diyComponent.value.goodsInfo.priceBottomRounded) style += 'border-bottom-left-radius:' + diyComponent.value.goodsInfo.priceBottomRounded * 2 + 'rpx;';
-		if (diyComponent.value.goodsInfo.priceBottomRounded) style += 'border-bottom-right-radius:' + diyComponent.value.goodsInfo.priceBottomRounded * 2 + 'rpx;';
-		return style;
-	})
-
-
-	const mediumCss = computed(() => {
-		let style = "";
-		if (diyComponent.value.medium.type == 'height_adaptive') {
-			style += `height:${swiperImageHeight.value};`;
-		} else {
-			style += 'height:100vw;';
+	if (diyComponent.value.topRounded) style += 'border-top-left-radius:' + diyComponent.value.topRounded * 2 + 'rpx;';
+	if (diyComponent.value.topRounded) style += 'border-top-right-radius:' + diyComponent.value.topRounded * 2 + 'rpx;';
+	if (diyComponent.value.bottomRounded) style += 'border-bottom-left-radius:' + diyComponent.value.bottomRounded * 2 + 'rpx;';
+	if (diyComponent.value.bottomRounded) style += 'border-bottom-right-radius:' + diyComponent.value.bottomRounded * 2 + 'rpx;';
+	return style;
+})
+
+/************ 自定义头部-start ****************/
+const systemStore = useSystemStore()
+let platform = systemStore.systemInfo.platform;
+
+// 导航栏内部盒子的样式
+const navbarInnerStyle = computed(() => {
+	let style = '';
+	// 导航栏宽度,如果在小程序下,导航栏宽度为胶囊的左边到屏幕左边的距离
+	// #ifdef MP
+	let rightButtonWidth = systemStore.menuButtonInfo.width ? systemStore.menuButtonInfo.width * 2 + 'rpx' : '70rpx';
+	style += 'height:' + systemStore.menuButtonInfo.height + 'px;';
+	style += 'padding-right:calc(' + rightButtonWidth + ' + 30rpx);';
+	style += 'padding-left:calc(' + rightButtonWidth + ' + 30rpx);';
+	style += 'padding-top:' + systemStore.menuButtonInfo.top + 'px;';
+	style += 'padding-bottom: 8px;';
+
+	style += 'font-size: 32rpx;';
+	if (platform === 'ios') {
+		// 苹果(iOS)设备
+		style += 'font-weight: 500;';
+	} else if (platform === 'android') {
+		// 安卓(Android)设备
+		style += 'font-size: 36rpx;';
+	}
+	// #endif
+
+	// #ifdef H5
+	style += 'height: 100rpx;';
+	style += 'padding-right: 30rpx;';
+	style += 'padding-left: 30rpx;';
+
+	style += 'font-size: 32rpx;';
+	if (platform === 'ios') {
+		// 苹果(iOS)设备
+		style += 'font-weight: 500;';
+	} else if (platform === 'android') {
+		// 安卓(Android)设备
+		style += 'font-size: 36rpx;';
+	}
+	// #endif
+
+	// #ifdef APP-PLUS
+	style += 'height: 80rpx;';
+	style += 'padding-right: 30rpx;';
+	style += 'padding-left: 30rpx;';
+	style += 'padding-top:' + systemStore.systemInfo.statusBarHeight + 'px;';
+	// #endif
+
+	return style;
+})
+
+// 导航栏内部盒子的样式
+const navbarInnerArrowStyle = computed(() => {
+	let style = '';
+	// 导航栏宽度,如果在小程序下,导航栏宽度为胶囊的左边到屏幕左边的距离
+	// #ifdef MP
+	style += 'position: absolute;';
+	style += 'left:calc( 100vw - ' + systemStore.menuButtonInfo.right + 'px);';
+	if (platform === 'ios') {
+		// 苹果(iOS)设备
+		style += 'font-weight: 700;';
+	} else if (platform === 'android') {
+		// 安卓(Android)设备
+	}
+	// #endif
+	return style;
+})
+
+// 导航栏头部卡片样式
+const fixedInnerStyle = computed(() => {
+	let style = '';
+	// #ifdef MP
+	style += 'top:' + (systemStore.menuButtonInfo.height + systemStore.menuButtonInfo.top + 8) + 'px;';
+	style += 'left:calc( 100vw - ' + systemStore.menuButtonInfo.right + 'px);';
+	// #endif
+	// #ifdef H5
+	style += 'top: 100rpx;';
+	style += 'left: 30rpx;';
+	// #endif
+	// #ifdef APP-PLUS
+	style += 'top:' + (systemStore.systemInfo.statusBarHeight + uni.upx2px(100)) + 'px;';
+	style += 'left: 30rpx;';
+	// #endif
+	return style;
+})
+
+// 头部滚动
+const instance = getCurrentInstance();
+let swiperHeight = 0
+let detailHead = 0
+
+const detailHeadBgChange = ref(false)
+onPageScroll((e) => {
+	if (swiperHeight == 0 || detailHead == 0) return;
+	let height = swiperHeight - detailHead - 20;
+	detailHeadBgChange.value = false;
+	if (e.scrollTop >= height) {
+		detailHeadBgChange.value = true;
+	}
+})
+/************ 自定义头部-end ****************/
+/************* 分享海报-end **************/
+
+// 菜单列表
+const menuList: any = {
+	index: {
+		name: '首页',
+		iconfont: 'nc-iconfont nc-icon-shouyeV6xx11',
+		url: { url: '/addon/shop/pages/index', mode: 'reLaunch' }
+	},
+	search: {
+		name: '搜索',
+		iconfont: 'nc-iconfont nc-icon-sousuo-duanV6xx1',
+		url: { url: '/addon/shop/pages/goods/search' }
+	},
+	cart: {
+		name: '购物车',
+		iconfont: 'nc-iconfont nc-icon-gouwucheV6xx1',
+		url: { url: '/addon/shop/pages/goods/cart' }
+	},
+	member: {
+		name: '个人中心',
+		iconfont: 'nc-iconfont nc-icon-a-wodeV6xx-36',
+		url: { url: '/addon/shop/pages/member/index' }
+	},
+	collect: {
+		name: '我的收藏',
+		iconfont: 'nc-iconfont nc-icon-guanzhuV6xx',
+		url: { url: '/addon/shop/pages/goods/collect' }
+	},
+	goods_list: {
+		name: '商品列表',
+		iconfont: 'iconfont icona-yingyongliebiaoV6xx-32',
+		url: { url: '/addon/shop/pages/goods/list' }
+	},
+	goods_category: {
+		name: '商品分类',
+		iconfont: 'nc-iconfont nc-icon-shangpinfenlei',
+		url: { url: '/addon/shop/pages/goods/category' }
+	}
+}
+
+const menuContents = computed(() => {
+	const list: any = []
+	let menu = typeof diyComponent.value.menuContent == 'object' ? diyComponent.value.menuContent : diyComponent.value.menuContent.split(',')
+	menu.forEach((item: any) => {
+		if (menuList[item]) {
+			list.push(menuList[item])
 		}
-		return style;
 	})
-
-
-	const swiperClick = (index : any) => {
-		if (typeof index == 'number') imgListPreview(diyComponent.value.goods.goods_image, index)
+	return list
+})
+
+// 图片轮播change事件
+const swiperChangeFn = (e: any) => {
+	swiperCurrentIndex.value = e.current + 1;
+}
+
+
+// 商品价格
+const goodsPrice = computed(() => {
+	let price = "0.00";
+	if (diyStore.mode != 'decorate') {
+		price = diyComponent.value.memberPrice || '0.00'
+	} else {
+		price = '100.00' // 装修模式
 	}
+	return price;
+})
 
-	//预览图片
-	const imgListPreview = (item : any, index : any) => {
-		if (Array.isArray(item)) {
-			if (!item.length) return false
-			var urlList = item;
-			uni.previewImage({
-				indicator: "number",
-				current: index,
-				loop: true,
-				urls: urlList
-			})
-		} else {
-			if (item === '') return false
-			var urlList = []
-			urlList.push(img(item))  //push中的参数为 :src="item.img_url" 中的图片地址
-			uni.previewImage({
-				indicator: "number",
-				loop: true,
-				urls: urlList
-			})
-		}
+// 普通商品样式
+const ordinaryGoodCss = computed(() => {
+	let style = "";
 
-	}
+	if (diyComponent.value.goodsInfo.startBgColor && diyComponent.value.goodsInfo.endBgColor) style += `background:linear-gradient(180deg,${diyComponent.value.goodsInfo.startBgColor} 85% ,${diyComponent.value.goodsInfo.endBgColor} 100%);`;
+	else style += 'background-color:' + (diyComponent.value.goodsInfo.startBgColor || diyComponent.value.goodsInfo.endBgColor) + ';';
 
-	// 返回上一页
-	const backToPrevious = () => {
-		if (getCurrentPages().length > 1) {
-			uni.navigateBack({
-				delta: 1
-			});
-		} else {
-			redirect({
-				url: '/addon/shop/pages/index',
-				mode: 'reLaunch'
-			});
-		}
+	if (diyComponent.value.goodsInfo.topMargin) style += 'margin-top:' + diyComponent.value.goodsInfo.topMargin * 2 + 'rpx;';
+	if (diyComponent.value.goodsInfo.aboutMargin) {
+		style += 'margin-left:' + diyComponent.value.goodsInfo.aboutMargin * 2 + 'rpx;';
+		style += 'margin-right:' + diyComponent.value.goodsInfo.aboutMargin * 2 + 'rpx;';
 	}
 
-	const initFn = () => {
-		saleInfo.value = (typeof diyComponent.value?.saleInfo == 'object') ? diyComponent.value?.saleInfo : diyComponent.value?.saleInfo.split(',');
-
-		setTimeout(() => {
-			const query = uni.createSelectorQuery().in(instance);
-			query.select('.swiper-box').boundingClientRect((data : any) => {
-				swiperHeight = data ? data.height : 0;
-			}).exec();
-			query.select('.detail-head').boundingClientRect((data : any) => {
-				if (data) {
-					detailHead = data.height ? data.height : 0;
-				}
-			}).exec();
-		}, 400)
-
-		// 轮播图高度
-		if (diyComponent.value.medium.type == 'height_adaptive') {
-			const screenWidth = uni.getSystemInfoSync().screenWidth
-			swiperImageHeight.value = (screenWidth * diyComponent.value.goods.image_size.height / diyComponent.value.goods.image_size.width) * 2 + 'rpx'
-		} else {
-			swiperImageHeight.value = '100vw'
-		}
+	if (diyComponent.value.goodsInfo.topRounded) style += 'border-top-left-radius:' + diyComponent.value.goodsInfo.topRounded * 2 + 'rpx;';
+	if (diyComponent.value.goodsInfo.topRounded) style += 'border-top-right-radius:' + diyComponent.value.goodsInfo.topRounded * 2 + 'rpx;';
+	if (diyComponent.value.goodsInfo.bottomRounded) style += 'border-bottom-left-radius:' + diyComponent.value.goodsInfo.bottomRounded * 2 + 'rpx;';
+	if (diyComponent.value.goodsInfo.bottomRounded) style += 'border-bottom-right-radius:' + diyComponent.value.goodsInfo.bottomRounded * 2 + 'rpx;';
+	return style;
+})
+
+// 价格模块样式
+const marketGoodCss = computed(() => {
+	let style = "";
+	let imgVal = 'https://v6.site.niucloud.com/' + diyComponent.value.priceRegion.marketingBgImg;
+	style += `background: url(${img(imgVal)}) no-repeat;`;
+
+	if (diyComponent.value.goodsInfo.priceBgColor) {
+		style += `background-color: ${diyComponent.value.goodsInfo.priceBgColor};`;
 	}
 
-	onMounted(() => {
-		saleInfo.value = (typeof diyComponent.value?.saleInfo == 'object') ? diyComponent.value?.saleInfo : diyComponent.value?.saleInfo.split(',');
-		// 装修模式下刷新
-		if (diyStore.mode == 'decorate') {
-			watch(
-				() => diyComponent.value,
-				(newValue, oldValue) => {
-					if (newValue && newValue.componentName == 'ShopGoodsDetailBasicInfo') {
-						nextTick(() => {
-							saleInfo.value = (typeof diyComponent.value?.saleInfo == 'object') ? diyComponent.value?.saleInfo : diyComponent.value?.saleInfo.split(',');
-						})
-					}
-				}
-			)
-		} else {
-			initFn()
-			watch(
-				() => diyComponent.value,
-				(newValue, oldValue) => {
-					if (newValue && newValue.componentName == 'ShopGoodsDetailBasicInfo') {
-						emits('update:componentIsShow', true)
-					}
-				},
-				{ immediate: true }
-			)
-		}
-	});
-</script>
-<style lang="scss" scoped>
-	.arrow-left {
-		// background: rgba(153, 153, 153, 0.1);
-		background: rgba(255, 255, 255, 0.6);
-		border: 1rpx solid rgba(0, 0, 0, 0.1);
+	if (diyComponent.value.goodsInfo.priceTopMargin) style += 'margin-top:' + diyComponent.value.goodsInfo.priceTopMargin * 2 + 'rpx;';
+	if (diyComponent.value.goodsInfo.priceAboutMargin) {
+		style += 'margin-left:' + diyComponent.value.goodsInfo.priceAboutMargin * 2 + 'rpx;';
+		style += 'margin-right:' + diyComponent.value.goodsInfo.priceAboutMargin * 2 + 'rpx;';
 	}
 
-	.media-mode {
-		.tab-item {
-			color: #fff;
-			font-size: 24rpx;
-			line-height: 46rpx;
-			border-radius: 50rpx;
-			padding: 0 20rpx;
-			display: inline-block;
-		}
-	}
+	if (diyComponent.value.goodsInfo.priceTopRounded) style += 'border-top-left-radius:' + diyComponent.value.goodsInfo.priceTopRounded * 2 + 'rpx;';
+	if (diyComponent.value.goodsInfo.priceTopRounded) style += 'border-top-right-radius:' + diyComponent.value.goodsInfo.priceTopRounded * 2 + 'rpx;';
+	if (diyComponent.value.goodsInfo.priceBottomRounded) style += 'border-bottom-left-radius:' + diyComponent.value.goodsInfo.priceBottomRounded * 2 + 'rpx;';
+	if (diyComponent.value.goodsInfo.priceBottomRounded) style += 'border-bottom-right-radius:' + diyComponent.value.goodsInfo.priceBottomRounded * 2 + 'rpx;';
+	return style;
+})
 
-	.brand-tag {
-		position: relative;
-		top: -2rpx;
-		display: inline;
-		line-height: 38rpx;
-		padding: 4rpx 8rpx;
-		border-radius: 4rpx;
-		margin-right: 8rpx;
-		background: red;
-		vertical-align: middle;
-		font-size: 18rpx;
-		color: #fff;
-		border: 2rpx solid transparent;
 
-		&.middle {
-			padding: 4rpx 8rpx;
-			border-radius: 8rpx;
-			font-size: 20rpx;
-			margin-right: 6rpx;
-		}
+const mediumCss = computed(() => {
+	let style = "";
+	if (diyComponent.value.medium.type == 'height_adaptive') {
+		style += `height:${swiperImageHeight.value};`;
+	} else {
+		style += 'height:100vw;';
 	}
-
-	.base-tag {
-		display: flex;
-		justify-content: center;
-		align-items: center;
-		height: 34rpx;
-		font-size: 18rpx;
-		padding: 0 8rpx;
-		color: #333;
-		border-radius: 4rpx;
-		background-color: #fff;
-		margin-right: 8rpx;
-		box-sizing: border-box;
-		margin-top: 8rpx;
-		border: 2rpx solid transparent;
-
-		&.middle {
-			height: 40rpx;
-			padding: 0 12rpx;
-			border-radius: 8rpx;
-			font-size: 20rpx;
-			margin-right: 16rpx;
-		}
+	return style;
+})
+
+
+const swiperClick = (index: any) => {
+	if (typeof index == 'number') imgListPreview(diyComponent.value.goods.goods_image, index)
+}
+
+//预览图片
+const imgListPreview = (item: any, index: any) => {
+	if (Array.isArray(item)) {
+		if (!item.length) return false
+		var urlList = item;
+		uni.previewImage({
+			indicator: "number",
+			current: index,
+			loop: true,
+			urls: urlList
+		})
+	} else {
+		if (item === '') return false
+		var urlList = []
+		urlList.push(img(item))  //push中的参数为 :src="item.img_url" 中的图片地址
+		uni.previewImage({
+			indicator: "number",
+			loop: true,
+			urls: urlList
+		})
 	}
 
-	.img-tag {
-		display: block;
-		height: 34rpx;
-		width: auto;
-		border-radius: 4rpx;
-		margin-right: 14rpx;
-		box-sizing: border-box;
-		margin-top: 8rpx;
-
-		&.middle {
-			height: 38rpx;
-			border-radius: 8rpx;
-			margin-right: 16rpx;
-		}
+}
+
+// 返回上一页
+const backToPrevious = () => {
+	if (getCurrentPages().length > 1) {
+		uni.navigateBack({
+			delta: 1
+		});
+	} else {
+		redirect({
+			url: '/addon/shop/pages/index',
+			mode: 'reLaunch'
+		});
 	}
-
-	.goods-video-height {
-		height: 100%;
+}
+
+const initFn = () => {
+	saleInfo.value = (typeof diyComponent.value?.saleInfo == 'object') ? diyComponent.value?.saleInfo : diyComponent.value?.saleInfo.split(',');
+
+	setTimeout(() => {
+		const query = uni.createSelectorQuery().in(instance);
+		query.select('.swiper-box').boundingClientRect((data: any) => {
+			swiperHeight = data ? data.height : 0;
+		}).exec();
+		query.select('.detail-head').boundingClientRect((data: any) => {
+			if (data) {
+				detailHead = data.height ? data.height : 0;
+			}
+		}).exec();
+	}, 400)
+
+	// 轮播图高度
+	if (diyComponent.value.medium.type == 'height_adaptive') {
+		const screenWidth = uni.getSystemInfoSync().screenWidth
+		swiperImageHeight.value = (screenWidth * diyComponent.value.goods.image_size.height / diyComponent.value.goods.image_size.width) * 2 + 'rpx'
+	} else {
+		swiperImageHeight.value = '100vw'
 	}
-
-	:deep(.uni-video-bar) {
-		bottom: 34rpx !important;
+}
+
+onMounted(() => {
+	saleInfo.value = (typeof diyComponent.value?.saleInfo == 'object') ? diyComponent.value?.saleInfo : diyComponent.value?.saleInfo.split(',');
+	// 装修模式下刷新
+	if (diyStore.mode == 'decorate') {
+		watch(
+			() => diyComponent.value,
+			(newValue, oldValue) => {
+				if (newValue && newValue.componentName == 'ShopGoodsDetailBasicInfo') {
+					nextTick(() => {
+						saleInfo.value = (typeof diyComponent.value?.saleInfo == 'object') ? diyComponent.value?.saleInfo : diyComponent.value?.saleInfo.split(',');
+					})
+				}
+			}
+		)
+	} else {
+		initFn()
+		watch(
+			() => diyComponent.value,
+			(newValue, oldValue) => {
+				if (newValue && newValue.componentName == 'ShopGoodsDetailBasicInfo') {
+					emits('update:componentIsShow', true)
+				}
+			},
+			{ immediate: true }
+		)
 	}
-
-	:deep(.uni-video-cover) {
-		background: none;
+});
+</script>
+<style lang="scss" scoped>
+.arrow-left {
+	// background: rgba(153, 153, 153, 0.1);
+	background: rgba(255, 255, 255, 0.6);
+	border: 1rpx solid rgba(0, 0, 0, 0.1);
+}
+
+.media-mode {
+	.tab-item {
+		color: #fff;
+		font-size: 24rpx;
+		line-height: 46rpx;
+		border-radius: 50rpx;
+		padding: 0 20rpx;
+		display: inline-block;
 	}
-
-	:deep(.uni-video-cover-duration) {
-		display: none;
+}
+
+.brand-tag {
+	position: relative;
+	top: -2rpx;
+	display: inline;
+	line-height: 38rpx;
+	padding: 4rpx 8rpx;
+	border-radius: 4rpx;
+	margin-right: 8rpx;
+	background: red;
+	vertical-align: middle;
+	font-size: 18rpx;
+	color: #fff;
+	border: 2rpx solid transparent;
+
+	&.middle {
+		padding: 4rpx 8rpx;
+		border-radius: 8rpx;
+		font-size: 20rpx;
+		margin-right: 6rpx;
 	}
-
-	:deep(.uni-video-cover-play-button) {
-		border-radius: 50%;
-		border: 4rpx solid #fff;
-		width: 120rpx;
-		height: 120rpx;
-		background-size: 30%;
+}
+
+.base-tag {
+	display: flex;
+	justify-content: center;
+	align-items: center;
+	height: 34rpx;
+	font-size: 18rpx;
+	padding: 0 8rpx;
+	color: #333;
+	border-radius: 4rpx;
+	background-color: #fff;
+	margin-right: 8rpx;
+	box-sizing: border-box;
+	margin-top: 8rpx;
+	border: 2rpx solid transparent;
+	color: rgb(255, 0, 0);
+	border-color: rgb(255, 0, 0);
+	background-color: rgb(255, 255, 255);
+
+	&.middle {
+		height: 40rpx;
+		padding: 0 12rpx;
+		border-radius: 8rpx;
+		font-size: 20rpx;
+		margin-right: 16rpx;
+	}
+}
+
+.img-tag {
+	display: block;
+	height: 34rpx;
+	width: auto;
+	border-radius: 4rpx;
+	margin-right: 14rpx;
+	box-sizing: border-box;
+	margin-top: 8rpx;
+
+	&.middle {
+		height: 38rpx;
+		border-radius: 8rpx;
+		margin-right: 16rpx;
 	}
+}
+
+.goods-video-height {
+	height: 100%;
+}
+
+:deep(.uni-video-bar) {
+	bottom: 34rpx !important;
+}
+
+:deep(.uni-video-cover) {
+	background: none;
+}
+
+:deep(.uni-video-cover-duration) {
+	display: none;
+}
+
+:deep(.uni-video-cover-play-button) {
+	border-radius: 50%;
+	border: 4rpx solid #fff;
+	width: 120rpx;
+	height: 120rpx;
+	background-size: 30%;
+}
 </style>

+ 6 - 6
src/addon/shop/hooks/useDiyGoodsDetail.ts

@@ -272,12 +272,12 @@ export function useDiyGoodsDetail(params: any = {}) {
             sale_num:data.allStock,
             goods_desc:data.pcDetail
         }
-        // if(data.imageUrl){
-        //     data.goods.goods_image = data.imageUrl.split(',');
-        // }
-        // data.goods.goods_image.forEach((item: any, index: any) => {
-        //     data.goods.goods_image[index] = img(item);
-        // })
+        if(data.imageUrl){
+            data.goods.goods_image = data.imageUrl.split(',');
+        }
+        data.goods.goods_image.forEach((item: any, index: any) => {
+            data.goods.goods_image[index] = img(item);
+        })
         data.allStock = Number(data.totalInventory || 0) + Number(data.nowInventory || 0) + Number(data.virtualInventory || 0);
 
         if (getToken()) {

+ 112 - 82
src/addon/shop/pages/goods/category.vue

@@ -1,99 +1,129 @@
 <template>
-    <view :style="themeColor()">
-        <!-- #ifdef MP-WEIXIN || APP-PLUS -->
-        <top-tabbar :data="topTabbarData" scrollBool="1" :isBack="false" />
-        <!-- #endif -->
-        <view class="relative">
-            <category-template-one-one class="category" v-if="config.level === 1 && config.template === 'style-1'"
-                :categoryId="categoryId" :config="config" />
-            <category-template-two-one v-if="config.level === 2 && config.template === 'style-1'"
-                :categoryId="categoryId" :config="config" />
-            <category-template-two-two class="category" v-if="config.level === 2 && config.template === 'style-2'"
-                :categoryId="categoryId" :config="config" />
-        </view>
+  <view :style="themeColor()">
+    <!-- #ifdef MP-WEIXIN || APP-PLUS -->
+    <top-tabbar :data="topTabbarData" scrollBool="1" :isBack="false" />
+    <!-- #endif -->
+    <view class="relative">
+      <category-template-one-one
+        class="category"
+        v-if="config.level == 1 && config.template === 'style-1'"
+        :categoryId="categoryId"
+        :config="config"
+      />
+      <category-template-two-one
+        v-if="config.level == 2 && config.template === 'style-1'"
+        :categoryId="categoryId"
+        :config="config"
+      />
+      <category-template-two-two
+        class="category"
+        v-if="config.level == 2 && config.template === 'style-2'"
+        :categoryId="categoryId"
+        :config="config"
+      />
     </view>
+  </view>
 </template>
 <script setup lang="ts">
-import { onLoad, onShow } from '@dcloudio/uni-app'
-import { ref } from 'vue';
-import categoryTemplateTwoOne from '@/addon/shop/pages/goods/components/category-template-two-one.vue';
-import categoryTemplateOneOne from '@/addon/shop/pages/goods/components/category-template-one-one.vue';
-import categoryTemplateTwoTwo from '@/addon/shop/pages/goods/components/category-template-two-two.vue';
-import { getGoodsCategoryConfig } from '@/addon/shop/api/goods';
-import { topTabar } from '@/utils/topTabbar';
-import useSystemStore from '@/stores/system';
-const systemStore = useSystemStore()
+import { onLoad, onShow } from "@dcloudio/uni-app";
+import { ref } from "vue";
+import categoryTemplateTwoOne from "@/addon/shop/pages/goods/components/category-template-two-one.vue";
+import categoryTemplateOneOne from "@/addon/shop/pages/goods/components/category-template-one-one.vue";
+import categoryTemplateTwoTwo from "@/addon/shop/pages/goods/components/category-template-two-two.vue";
+import { getGoodsCategoryConfig } from "@/addon/shop/api/goods";
+import { topTabar } from "@/utils/topTabbar";
+import useSystemStore from "@/stores/system";
+const systemStore = useSystemStore();
 
 /********* 自定义头部 - start ***********/
-const topTabarObj = topTabar()
-let topTabbarData = topTabarObj.setTopTabbarParam({ title: '商品分类', topStatusBar: { textColor: '#333' } })
+const topTabarObj = topTabar();
+let topTabbarData = topTabarObj.setTopTabbarParam({
+  title: "商品分类",
+  topStatusBar: { textColor: "#333" },
+});
 /********* 自定义头部 - end ***********/
 
-const config: any = ref({})
-const categoryId = ref(0)
+const config: any = ref({});
+const categoryId = ref(0);
 
 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": 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": "购买"
-        }
-    }
+      level: res.data.level,
+      template: res.data.template,
+      page_title: res.data.pageTitle,
+      search: {
+        control: res.data.searchControl,
+        title: "请搜索您想要的商品",
+      },
+      sort: "default",
+      cart: {
+        control: 1,
+        event: "cart",
+        style: "style-4",
+        text: "购买",
+      },
+    };
+    console.log("config", config.value);
     uni.setNavigationBarTitle({
-        title: config.value.page_title
+      title: config.value.page_title,
     });
-    // getGoodsCategoryConfig().then(res => {
-    //     config.value = res.data
-    //     uni.setNavigationBarTitle({
-    //         title: config.value.page_title
-    //     });
-    // })
-}
+  });
+};
 
 onLoad((options: any) => {
-    categoryId.value = options.category_id || 0;
-    getGoodsCategoryConfigFn()
+  categoryId.value = options.category_id || 0;
+  getGoodsCategoryConfigFn();
 });
 
-onShow(() => {
-})
-
+onShow(() => {});
 </script>
 <style>
 /*  #ifdef  H5  */
 :deep(.category .detail .mescroll-body) {
-    padding-bottom: calc(50px + constant(safe-area-inset-bottom)) !important;
-    padding-bottom: calc(50px + env(safe-area-inset-bottom)) !important;
+  padding-bottom: calc(50px + constant(safe-area-inset-bottom)) !important;
+  padding-bottom: calc(50px + env(safe-area-inset-bottom)) !important;
 }
 
 :deep(.category .cart .mescroll-body) {
-    padding-bottom: calc(100rpx + 50px + constant(safe-area-inset-bottom)) !important;
-    padding-bottom: calc(100rpx + 50px + env(safe-area-inset-bottom)) !important;
+  padding-bottom: calc(
+    100rpx + 50px + constant(safe-area-inset-bottom)
+  ) !important;
+  padding-bottom: calc(100rpx + 50px + env(safe-area-inset-bottom)) !important;
 }
 
 /*  #endif  */
 /*  #ifndef  H5  */
 .category .detail .mescroll-body {
-    padding-bottom: calc(100rpx + constant(safe-area-inset-bottom)) !important;
-    padding-bottom: calc(100rpx + env(safe-area-inset-bottom)) !important;
+  padding-bottom: calc(100rpx + constant(safe-area-inset-bottom)) !important;
+  padding-bottom: calc(100rpx + env(safe-area-inset-bottom)) !important;
 }
 
 .category .cart .mescroll-body {
-    padding-bottom: calc(200rpx + constant(safe-area-inset-bottom)) !important;
-    padding-bottom: calc(200rpx + env(safe-area-inset-bottom)) !important;
+  padding-bottom: calc(200rpx + constant(safe-area-inset-bottom)) !important;
+  padding-bottom: calc(200rpx + env(safe-area-inset-bottom)) !important;
 }
 
 /*
@@ -125,45 +155,45 @@ onShow(() => {
 	z-index: 8 !important;
 } */
 .category .labelPopup :deep(.u-transition) {
-    top: 96rpx !important;
-    left: 170rpx !important;
-    z-index: 8 !important;
+  top: 96rpx !important;
+  left: 170rpx !important;
+  z-index: 8 !important;
 
-    &:nth-child(2) {
-        left: 168rpx !important;
-    }
+  &:nth-child(2) {
+    left: 168rpx !important;
+  }
 }
 
 .category .labelPopup.active :deep(.u-transition) {
-    top: 190rpx !important;
+  top: 190rpx !important;
 }
 
 /*  #endif  */
 </style>
 <style lang="scss" scoped>
 :deep(.mescroll-upwarp) {
-    box-sizing: border-box;
-    padding-left: 182rpx;
+  box-sizing: border-box;
+  padding-left: 182rpx;
 }
 
 :deep(.tab-bar-placeholder) {
-    display: none !important;
+  display: none !important;
 }
 
 :deep(.u-tabbar__placeholder) {
-    display: none !important;
+  display: none !important;
 }
 
 button::after {
-    border: 0 !important;
+  border: 0 !important;
 }
 
 :deep(.part .mescroll-empty) {
-    width: 542rpx;
-    height: 542rpx;
-    margin-top: 0;
-    margin-left: 0;
-    margin-right: 0;
-    padding-top: 50rpx;
+  width: 542rpx;
+  height: 542rpx;
+  margin-top: 0;
+  margin-left: 0;
+  margin-right: 0;
+  padding-top: 50rpx;
 }
 </style>

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

@@ -1,24 +1,28 @@
 <template>
     <view class="min-h-screen bg-[var(--page-bg-color)] overflow-hidden">
-        <view class="mescroll-box bg-[var(--page-bg-color)]"
-              :class="{ 'cart': config.cart.control && config.cart.event === 'cart', 'detail': !(config.cart.control && config.cart.event === 'cart') }" v-if="tabsData.length">
-              <mescroll-body ref="mescrollRef" :down="{ use: false }" @init="mescrollInit" @up="getListFn">
-                <view v-if="config.search.control" class="search-box z-10 bg-[#fff] fixed top-0 left-0 right-0 h-[100rpx] box-border"  :style="{'top': systemStore.topTabbarInfo.fullHeight || 0}">
+        <view class="mescroll-box bg-[var(--page-bg-color)] detail" v-if="tabsData.length">
+            <mescroll-body ref="mescrollRef" :down="{ use: false }" @init="mescrollInit" @up="getListFn">
+                <view v-if="config.search.control == 1"
+                    class="search-box z-10 bg-[#fff] fixed top-0 left-0 right-0 h-[100rpx] box-border"
+                    :style="{ 'top': systemStore.topTabbarInfo.fullHeight || 0 }">
                     <view class="flex-1 search-input">
                         <text @click.stop="searchNameFn" class="nc-iconfont nc-icon-sousuo-duanV6xx1 btn"></text>
-                        <input class="input" type="text" v-model.trim="searchName" :placeholder="config.search.title" @confirm="searchNameFn" placeholderClass="text-[var(--text-color-light9)]">
-                        <text v-if="searchName" class="nc-iconfont nc-icon-cuohaoV6xx1 clear" @click="searchName=''"></text>
+                        <input class="input" type="text" v-model.trim="searchName" :placeholder="config.search.title"
+                            @confirm="searchNameFn" placeholderClass="text-[var(--text-color-light9)]">
+                        <text v-if="searchName" class="nc-iconfont nc-icon-cuohaoV6xx1 clear"
+                            @click="searchName = ''"></text>
                     </view>
                 </view>
                 <!--  #ifdef H5 -->
                 <view class="tabs-box z-2 fixed left-0 bg-[#fff] bottom-[50px] top-0"
-                      :class="{ '!top-[100rpx]': config.search.control, 'pb-[98rpx]': config.cart.control && config.cart.event === 'cart' }">
+                    :class="{ '!top-[100rpx]': config.search.control == 1 }">
                     <scroll-view :scroll-y="true" class="scroll-height">
                         <view class="bg-[var(--temp-bg)]">
-                            <view class="tab-item" :class="{ 'tab-item-active': index == tabActive,'rounded-br-[12rpx]':tabActive-1===index,'rounded-tr-[12rpx]':tabActive+1===index}"
-                                  v-for="(item, index) in tabsData" :key="index" @click="firstLevelClick(index, item)">
+                            <view class="tab-item"
+                                :class="{ 'tab-item-active': index == tabActive, 'rounded-br-[12rpx]': tabActive - 1 === index, 'rounded-tr-[12rpx]': tabActive + 1 === index }"
+                                v-for="(item, index) in tabsData" :key="index" @click="firstLevelClick(index, item)">
                                 <view class="text-box text-left leading-[1.3] break-words px-[16rpx]">
-                                    {{ item.category_name }}
+                                    {{ item.label }}
                                 </view>
                             </view>
                         </view>
@@ -29,169 +33,83 @@
                 <view class="tabs-box z-2 fixed left-0 bg-[#fff] pb-ios bottom-[100rpx] top-0" :style="tabsBoxCss">
                     <scroll-view :scroll-y="true" class="scroll-height">
                         <view class="bg-[var(--temp-bg)]">
-                            <view class="tab-item" :class="{ 'tab-item-active': index == tabActive,'rounded-br-[12rpx]':tabActive-1===index,'rounded-tr-[12rpx]':tabActive+1===index}"
-                                  v-for="(item, index) in tabsData" :key="index" @click="firstLevelClick(index, item)">
-                                <view class="text-box text-left leading-[1.3] break-words px-[16rpx]">{{ item.category_name }}</view>
+                            <view class="tab-item"
+                                :class="{ 'tab-item-active': index == tabActive, 'rounded-br-[12rpx]': tabActive - 1 === index, 'rounded-tr-[12rpx]': tabActive + 1 === index }"
+                                v-for="(item, index) in tabsData" :key="index" @click="firstLevelClick(index, item)">
+                                <view class="text-box text-left leading-[1.3] break-words px-[16rpx]">{{ item.label }}
+                                </view>
                             </view>
                         </view>
                     </scroll-view>
                 </view>
                 <!--  #endif -->
-                <view class="flex justify-center flex-wrap pl-[188rpx] pb-[20rpx]" :class="{ ' pt-[120rpx]': config.search.control, ' pt-[20rpx]': !(config.search.control) }">
-                    <template v-for="(item, index) in list" :key="item.goods_id">
-                        <view class="box-border bg-white w-full flex mr-[20rpx] py-[24rpx] px-[20rpx] rounded-[var(--rounded-small)]" :class="{ 'mt-[16rpx]': index }" @click.stop="toLink(item.goods_id)">
-                            <view class="w-[168rpx] h-[168rpx] flex items-center justify-center rounded-[var(--goods-rounded-small)] overflow-hidden">
-                                <u--image width="168rpx" height="168rpx" radius="var(--goods-rounded-small)" :src="img( item.goods_cover_thumb_mid || '')" model="aspectFill">
+                <view class="flex justify-center flex-wrap pl-[188rpx] pb-[20rpx]"
+                    :class="{ ' pt-[120rpx]': config.search.control, ' pt-[20rpx]': !(config.search.control == 1) }">
+                    <template v-for="(item, index) in list" :key="index">
+                        <view
+                            class="box-border bg-white w-full flex mr-[20rpx] py-[24rpx] px-[20rpx] rounded-[var(--rounded-small)]"
+                            :class="{ 'mt-[16rpx]': index }" @click.stop="toLink(item.id)">
+                            <view
+                                class="w-[168rpx] h-[168rpx] flex items-center justify-center rounded-[var(--goods-rounded-small)] overflow-hidden">
+                                <u--image width="168rpx" height="168rpx" radius="var(--goods-rounded-small)"
+                                    :src="img(item.productImage || '')" model="aspectFill">
                                     <template #error>
-                                        <image class="w-[168rpx] h-[168rpx]" :src="img('static/resource/images/diy/shop_default.jpg')" mode="aspectFill" />
+                                        <image class="w-[168rpx] h-[168rpx]"
+                                            :src="img('https://v6.site.niucloud.com/static/resource/images/diy/shop_default.jpg')"
+                                            mode="aspectFill" />
                                     </template>
                                 </u--image>
                             </view>
                             <view class="flex flex-1 ml-[20rpx] flex-wrap flex-col">
-                                <view class="max-h-[80rpx] text-[26rpx] leading-[40rpx] multi-hidden">{{ item.goods_name }}</view>
+                                <view class="max-h-[80rpx] text-[26rpx] leading-[40rpx] multi-hidden">{{ item.itemName
+                                }}</view>
                                 <view class="flex-1 flex items-end justify-between">
                                     <view class="text-[var(--price-text-color)] price-font -mb-[8rpx]">
                                         <text class="text-[24rpx] font-500">¥</text>
-                                        <text class="text-[40rpx] font-500">{{ parseFloat(goodsPrice(item)).toFixed(2).split('.')[0] }}</text>
-                                        <text class="text-[24rpx] font-500">.{{ parseFloat(goodsPrice(item)).toFixed(2).split('.')[1] }}</text>
-                                        <image class="h-[24rpx] max-w-[46rpx] ml-[6rpx]" v-if="priceType(item) == 'member_price'" :src="img('addon/shop/VIP.png')" mode="heightFix" />
-										<image class="h-[24rpx] max-w-[60rpx] ml-[6rpx]" v-if="priceType(item) == 'newcomer_price'" :src="img('addon/shop/newcomer.png')" mode="heightFix" />
-										<image class="h-[24rpx] max-w-[80rpx] ml-[6rpx]" v-if="priceType(item) == 'discount_price'" :src="img('addon/shop/discount.png')" mode="heightFix" /> 
+                                        <text class="text-[40rpx] font-500">{{
+                                            diyGoods.goodsPrice(item).toFixed(2).split('.')[0] }}</text>
+                                        <text class="text-[24rpx] font-500">.{{
+                                            diyGoods.goodsPrice(item).toFixed(2).split('.')[1] }}</text>
+                                    </view>
+                                    <view class="h-[44rpx] relative">
+                                        <view :id="'itemCart' + index"
+                                            class="w-[102rpx] box-border text-center text-[#fff] primary-btn-bg h-[46rpx] text-[22rpx] leading-[46rpx] rounded-[100rpx]">
+                                            购买</view>
                                     </view>
-                                    <template v-if="!item.isMaxBuy">
-                                        <view v-if=" (item.goods_type == 'real' || (item.goods_type == 'virtual' && item.virtual_receive_type != 'verify')) && item.goodsSku.sku_spec_format === '' && cartList['goods_' + item.goods_id] && cartList['goods_' + item.goods_id]['sku_' + item.goodsSku.sku_id] && config.cart.control && config.cart.event === 'cart'" class="flex items-center">
-                                            <view class="relative w-[32rpx] h-[32rpx]">
-                                                <text class="text-[32rpx] text-color nc-iconfont nc-icon-jianshaoV6xx absolute flex items-center justify-center -left-[14rpx] -bottom-[14rpx] -right-[14rpx] -top-[14rpx]"
-                                                    @click.stop="reduceCart(item, cartList['goods_' + item.goods_id]['sku_' + item.goodsSku.sku_id])"></text>
-                                            </view>
-                                            <text class="text-[#333] text-[24rpx] mx-[16rpx]">{{ cartList['goods_' + item.goods_id]['sku_' + item.goodsSku.sku_id].num }}</text>
-                                            <view class="relative w-[32rpx] h-[32rpx]">
-                                                <text class="text-[32rpx] text-color iconfont iconjiahao2fill absolute flex items-center justify-center -left-[14rpx] -bottom-[14rpx] -right-[14rpx] -top-[14rpx]"
-                                                    :id="'itemCart' + index" @click.stop="addCartBtn(item,cartList['goods_' + item.goods_id]['sku_' + item.goodsSku.sku_id],'itemCart' + index)"></text>
-                                            </view>
-                                        </view>
-                                        <template
-                                            v-else-if="(item.goods_type == 'virtual' && item.virtual_receive_type != 'verify') || item.goods_type == 'real'">
-                                            <view v-if="config.cart.control && config.cart.style === 'style-1'" class="h-[44rpx] relative">
-                                                <view :id="'itemCart' + index"
-                                                      class="w-[102rpx] box-border text-center text-[#fff] primary-btn-bg h-[46rpx] text-[22rpx] leading-[46rpx] rounded-[100rpx]"
-                                                      @click.stop="itemCart(item, 'itemCart' + index)">{{ config.cart.text }}</view>
-                                                <view
-                                                    v-if="cartList['goods_' + item.goods_id] && cartList['goods_' + item.goods_id].totalNum"
-                                                    :class="['absolute right-[-16rpx] top-[-16rpx] rounded-[30rpx] h-[30rpx] min-w-[30rpx] text-center leading-[26rpx] bg-[var(--primary-color)]  text-[#fff] text-[20rpx] font-500 box-border box-border border-[2rpx] border-solid border-[#fff]', cartList['goods_' + item.goods_id].totalNum > 9 ? 'px-[10rpx]' : '']">{{ cartList['goods_' + item.goods_id].totalNum }}</view>
-                                            </view>
-                                            <view v-if="config.cart.control && config.cart.style === 'style-2'" class="w-[50rpx] h-[50rpx] relative" @click.stop="itemCart(item, 'itemCart' + index)">
-                                                <text :id="'itemCart' + index" class="text-color nc-iconfont nc-icon-tianjiaV6xx text-[44rpx]"></text>
-                                                <view v-if="cartList['goods_' + item.goods_id] && cartList['goods_' + item.goods_id].totalNum"
-                                                    :class="['absolute right-[-16rpx] top-[-16rpx] rounded-[30rpx] h-[30rpx] min-w-[30rpx] text-center leading-[26rpx] bg-[var(--primary-color)] text-[#fff] text-[20rpx] font-500 box-border box-border border-[2rpx] border-solid border-[#fff]', cartList['goods_' + item.goods_id].totalNum > 9 ? 'px-[10rpx]' : '']">{{ cartList['goods_' + item.goods_id].totalNum }}</view>
-                                            </view>
-                                            <view v-if="config.cart.control && config.cart.style === 'style-3'"
-                                                  class="w-[50rpx] flex justify-center items-end  h-[50rpx]  relative"
-                                                  @click.stop="itemCart(item, 'itemCart' + index)">
-                                                <text :id="'itemCart' + index" class="text-color nc-iconfont nc-icon-gouwucheV6xx6 !text-[34rpx]"></text>
-                                                <view v-if="cartList['goods_' + item.goods_id] && cartList['goods_' + item.goods_id].totalNum"
-                                                    :class="['absolute right-[-10rpx] top-[-2rpx] rounded-[30rpx] h-[30rpx] min-w-[30rpx] text-center leading-[26rpx] bg-[var(--primary-color)] text-[#fff] text-[20rpx] font-500 box-border box-border border-[2rpx] border-solid border-[#fff]', cartList['goods_' + item.goods_id].totalNum > 9 ? 'px-[10rpx]' : '']">{{ cartList['goods_' + item.goods_id].totalNum }}</view>
-                                            </view>
-                                            <view v-if="config.cart.control && config.cart.style === 'style-4'"
-                                                  class="w-[50rpx] h-[50rpx] justify-center flex items-end relative"
-                                                  @click.stop="itemCart(item, 'itemCart' + index)">
-                                                <view :id="'itemCart' + index" class=" flex items-center justify-center text-[#fff] bg-color h-[44rpx] w-[44rpx] rounded-[22rpx] text-center">
-                                                    <text class="nc-iconfont nc-icon-gouwucheV6xx6 !text-[26rpx]"></text>
-                                                </view>
-                                                <view v-if="cartList['goods_' + item.goods_id] && cartList['goods_' + item.goods_id].totalNum"
-                                                    :class="['absolute right-[-10rpx] top-[-10rpx] rounded-[30rpx] h-[30rpx] min-w-[30rpx] text-center leading-[26rpx] bg-[var(--primary-color)] text-[#fff] text-[20rpx] font-500 box-border border-[2rpx] border-solid border-[#fff]', cartList['goods_' + item.goods_id].totalNum > 9 ? 'px-[10rpx]' : '']">{{ cartList['goods_' + item.goods_id].totalNum }}</view>
-                                            </view>
-                                        </template>
-                                    </template>
                                 </view>
                             </view>
                         </view>
 
                     </template>
-                    <mescroll-empty class="part" v-if="!list.length && !loading && listLoading" :option="{tip : '暂无商品'}"></mescroll-empty>
+                    <mescroll-empty class="part" v-if="!list.length && !loading && listLoading"
+                        :option="{ tip: '暂无商品' }"></mescroll-empty>
                 </view>
                 <add-cart-popup ref="cartRef" />
             </mescroll-body>
-            <!--  #ifdef  H5 -->
-            <view v-if="config.cart.control && config.cart.event === 'cart'"
-                  class="bg-[#fff] z-10 flex justify-between items-center fixed left-0 right-0 bottom-[50px] box-solid px-[24rpx] py-[17rpx] mb-ios border-[0] border-t-[2rpx] border-solid border-[#f6f6f6]">
-                <view class="flex items-center">
-                    <view class="w-[66rpx] h-[66rpx] mr-[27rpx] relative">
-                        <view id="animation-end" class="w-[66rpx] h-[66rpx] rounded-[35rpx] bg-[var(--primary-color)] text-center leading-[70rpx]" @click.stop="toCart">
-                            <text class="nc-iconfont nc-icon-gouwucheV6mm1 text-[#fff] text-[32rpx]"></text>
-                        </view>
-                        <view v-if="totalNum" class="border-[1rpx] border-solid border-[#fff]"
-                              :class="['absolute left-[40rpx] top-[-10rpx] rounded-[28rpx] h-[28rpx] min-w-[28rpx] text-center leading-[26rpx] bg-[var(--primary-color)] text-[#fff] text-[20rpx] font-500 box-border', totalNum > 9 ? 'px-[10rpx]' : '']">
-                            {{ totalNum > 99 ? "99+" : totalNum }}
-                        </view>
-                    </view>
-                    <text class="text-[26rpx] font-500 text-[#333]">总计:</text>
-                    <view class="text-[var(--price-text-color)] price-font font-bold flex items-baseline">
-                        <text class="text-[26rpx] mr-[6rpx]">¥</text>
-                        <text class="text-[44rpx]">{{ parseFloat(totalMoney) }}</text>
-                    </view>
-                </view>
-                <button
-                    class="w-[180rpx] h-[70rpx] text-[26rpx] leading-[70rpx] font-500 m-0 rounded-full remove-border"
-                    :class="{'primary-btn-bg !text-[#fff]': parseFloat(totalMoney) > 0, 'bg-[#F7F7F7] !text-[var(--text-color-light9)]': parseFloat(totalMoney) <= 0}" @click="settlement">去结算</button>
-            </view>
-            <!--  #endif -->
-
-            <!-- #ifdef MP-WEIXIN -->
-            <view v-if="config.cart.control && config.cart.event === 'cart'" class="bg-[#fff] z-10 flex justify-between items-center fixed left-0 right-0 bottom-[100rpx] box-solid px-[24rpx] py-[17rpx] mb-ios border-[0] border-t-[2rpx] border-solid border-[#f6f6f6]">
-                <view class="flex items-center">
-                    <view class="w-[66rpx] h-[66rpx] mr-[27rpx] relative">
-                        <view id="animation-end" class="w-[66rpx] h-[66rpx] rounded-[35rpx] bg-[var(--primary-color)] text-center leading-[66rpx]" @click.stop="toCart">
-                            <text class="nc-iconfont nc-icon-gouwucheV6mm1 text-[#fff] text-[32rpx]"></text>
-                        </view>
-                        <view v-if="totalNum" class="border-[1rpx] border-solid border-[#fff]"
-                              :class="['absolute left-[40rpx] top-[-10rpx] rounded-[28rpx] h-[28rpx] min-w-[28rpx] text-center leading-[26rpx] bg-[var(--primary-color)] text-[#fff] text-[20rpx] font-500 box-border', totalNum > 9 ? 'px-[10rpx]' : '']">
-                            {{ totalNum > 99 ? "99+" : totalNum }}
-                        </view>
-                    </view>
-                    <text class="text-[26rpx] font-500 text-[#333]">总计:</text>
-                    <view class="text-[var(--price-text-color)] price-font font-bold inline-block">
-                        <text class="text-[26rpx] mr-[6rpx]">¥</text>
-                        <text class="text-[44rpx]">{{ parseFloat(totalMoney) }}</text>
-                    </view>
-                </view>
-                <!--<button v-if="isBindMobile && userInfo && !userInfo.mobile" class="w-[180rpx] h-[70rpx] text-[26rpx] leading-[70rpx] font-500 m-0 rounded-full remove-border" :class="{'primary-btn-bg !text-[#fff]': parseFloat(totalMoney) > 0, 'bg-[#F7F7F7] !text-[var(&#45;&#45;text-color-light9)]': parseFloat(totalMoney) <= 0}" open-type="getPhoneNumber" @getphonenumber="memberStore.bindMobile">去结算</button>-->
-                <!--<button v-else class="w-[180rpx] h-[70rpx] text-[26rpx] leading-[70rpx] font-500 m-0 rounded-full remove-border" :class="{'primary-btn-bg !text-[#fff]': parseFloat(totalMoney) > 0, 'bg-[#F7F7F7] !text-[var(&#45;&#45;text-color-light9)]': parseFloat(totalMoney) <= 0}" @click="settlement">去结算</button>-->
-                <button
-                    class="w-[180rpx] h-[70rpx] text-[26rpx] leading-[70rpx] font-500 m-0 rounded-full remove-border"
-                    :class="{'primary-btn-bg !text-[#fff]': parseFloat(totalMoney) > 0, 'bg-[#F7F7F7] !text-[var(--text-color-light9)]': parseFloat(totalMoney) <= 0}" @click="settlement">去结算</button>
-            </view>
-            <!--  #endif -->
         </view>
-
-        <view v-show="animationElStatus" :style="animationElStatus" class="fixed z-999 flex items-center justify-center text-[#fff] bg-color h-[44rpx] w-[44rpx] rounded-[22rpx] text-center">
+        <view v-show="animationElStatus" :style="animationElStatus"
+            class="fixed z-999 flex items-center justify-center text-[#fff] bg-color h-[44rpx] w-[44rpx] rounded-[22rpx] text-center">
             <text class=" nc-iconfont nc-icon-gouwucheV6xx6 !text-[30rpx]"></text>
         </view>
-        <mescroll-empty v-if="!tabsData.length && !loading" :option="{tip : '暂无商品分类'}"></mescroll-empty>
+        <mescroll-empty v-if="!tabsData.length && !loading" :option="{ tip: '暂无商品分类' }"></mescroll-empty>
         <loading-page :loading="loading"></loading-page>
-
         <tabbar />
-        <!-- 强制绑定手机号 -->
-        <bind-mobile ref="bindMobileRef" />
     </view>
 </template>
 
 <script setup lang="ts">
 import { ref, onMounted, computed, getCurrentInstance } from 'vue';
-import { t } from '@/locale';
 import { img, redirect } from '@/utils/common';
-import { getGoodsCategoryTree, getGoodsPages } from '@/addon/shop/api/goods';
+import { getGoodsCategoryTree, getGoodsPages, getGoodsComponents } from '@/addon/shop/api/goods';
 import MescrollBody from '@/components/mescroll/mescroll-body/mescroll-body.vue';
 import MescrollEmpty from '@/components/mescroll/mescroll-empty/mescroll-empty.vue';
 import useMescroll from '@/components/mescroll/hooks/useMescroll.js';
 import addCartPopup from './add-cart-popup.vue'
-import bindMobile from '@/components/bind-mobile/bind-mobile.vue';
 import { onPageScroll, onReachBottom } from '@dcloudio/uni-app';
-import { useLogin } from '@/hooks/useLogin'
-import useMemberStore from '@/stores/member'
 import useCartStore from '@/addon/shop/stores/cart'
-import { cloneDeep } from 'lodash-es'
 import useSystemStore from '@/stores/system';
+import { useGoods } from '@/addon/shop/hooks/useGoods'
+const diyGoods = useGoods();
 const systemStore = useSystemStore()
 
 // 查询购物车列表
@@ -200,23 +118,13 @@ cartStore.getList();
 
 const tabsBoxCss = computed(() => {
     let style = ''
-    if(config.search.control){
-        style += `top: calc(${ systemStore.topTabbarInfo.height || 0 }px + 98rpx);`
-    }else{
-        style += `top: ${ systemStore.topTabbarInfo.height || 0 }px;`
-    }
-
-    if(config.cart.control && config.cart.event === 'cart'){
-        style += `bottom: 198rpx !important;`
+    if (config.search.control == '1') {
+        style += `top: calc(${systemStore.topTabbarInfo.height || 0}px + 98rpx);`
+    } else {
+        style += `top: ${systemStore.topTabbarInfo.height || 0}px;`
     }
     return style
 })
-
-const cartList = computed(() => cartStore.cartList)
-const totalNum = computed(() => cartStore.totalNum)
-const totalMoney = computed(() => cartStore.totalMoney)
-const memberStore = useMemberStore()
-const userInfo = computed(() => memberStore.info)
 const { mescrollInit, getMescroll } = useMescroll(onPageScroll, onReachBottom);
 const prop = defineProps({
     config: {
@@ -227,17 +135,16 @@ const prop = defineProps({
     },
     categoryId: {
         type: [String, Number],
-        default: 0
+        default: ''
     }
 })
 let config = prop.config
 let categoryId = prop.categoryId;
-const list = ref<Array<Object>>([]);
+const list = ref<any>([]);
 const searchName = ref("");
 const loading = ref<boolean>(true);//页面加载动画
 const listLoading = ref<boolean>(false);//列表加载动画
 const cartData = ref<Array<any>>([])
-const instance = getCurrentInstance(); // 获取组件实例
 cartData.value = uni.getStorageSync('shopCart') || []
 
 interface mescrollStructure {
@@ -249,20 +156,19 @@ interface mescrollStructure {
 
 const getListFn = (mescroll: mescrollStructure) => {
     listLoading.value = false
-    getGoodsPages({
-        page: mescroll.num,
-        limit: mescroll.size,
-        goods_category: categoryId, // 商品分类id
+    getGoodsComponents({
+        pageNum: mescroll.num,
+        pageSize: mescroll.size,
+        topCategoryId: categoryId, // 商品分类id
+        searchKeyword: searchName.value
     }).then((res: any) => {
-        let newArr = res.data.data
+        let newArr = res.rows
         //设置列表数据
 
         if (mescroll.num == 1) {
             list.value = []; //如果是第一页需手动制空列表
         }
         list.value = list.value.concat(newArr);
-        // 商品限购
-        goodsMaxBuy();
         loading.value = false;
         mescroll.endSuccess(newArr.length);
         if (!list.value.length) listLoading.value = true
@@ -273,38 +179,8 @@ const getListFn = (mescroll: mescrollStructure) => {
     })
 }
 
-const goodsMaxBuy = () => {
-    list.value.forEach((data, index) => {
-        data.isMaxBuy = false;
-
-        let maxBuyNum = -1;
-        // 限购 - 是否开启限购
-        if (data.is_limit) {
-            if (data.max_buy) {
-                let max_buy = 0;
-                if (data.limit_type == 1) { //单次限购
-                    max_buy = data.max_buy;
-                } else { // 单人限购
-                    let buyVal = data.max_buy - (data.has_buy || 0);
-                    max_buy = buyVal > 0 ? buyVal : 0;
-                }
-
-                if (max_buy > data.stock) {
-                    maxBuyNum = data.stock
-                } else if (max_buy <= data.stock) {
-                    maxBuyNum = max_buy;
-                }
-            }
-        }
-
-        if (maxBuyNum == 0) {
-            data.isMaxBuy = true;
-        }
-    })
-}
-
 const toLink = (goods_id: string) => {
-    redirect({ url: '/addon/shop/pages/goods/detail', param: { goods_id } })
+    redirect({ url: '/addon/shop/pages/goods/detail', param: { goodsId: goods_id } })
 }
 
 onMounted(() => {
@@ -313,76 +189,6 @@ onMounted(() => {
 
 //设置购物车动画
 const animationElStatus = ref('')
-const animationAddRepeatFlag = ref<Boolean>(false)
-const cartRepeatFlag = ref<Boolean>(false)
-const animationAddCart = (row: any, id: any) => {
-    if (animationAddRepeatFlag.value || cartRepeatFlag.value) return false
-    animationAddRepeatFlag.value = true
-    cartRepeatFlag.value = true
-
-    let obj: any = {
-        goods_id: row.goodsSku.goods_id,
-        sku_id: row.goodsSku.sku_id,
-        sale_price: goodsPrice(row),
-        stock: row.goodsSku.stock
-    };
-    if (row.id) {
-        obj.num = row.num;
-        obj.id = row.id;
-    }
-
-    // 起购
-    let num = 1;
-    if (row.min_buy > 0 && !row.num) {
-        num = row.min_buy;
-    } else {
-        num = 1;
-    }
-
-    cartStore.increase(obj, num, () => {
-        cartRepeatFlag.value = false
-    });
-    // #ifdef  MP-WEIXIN
-    setTimeout(() => {
-        uni.createSelectorQuery().in(instance).select('#animation-end').boundingClientRect((res: any) => {
-            uni.createSelectorQuery().in(instance).select('#' + id).boundingClientRect((position: any) => {
-                animationElStatus.value = `top: ${ position.top }px; left: ${ position.left }px;`
-                setTimeout(() => {
-                    animationElStatus.value = `top: ${ res.top + res.height / 2 - position.height / 3 }px; left: ${ res.left + res.width / 2 - position.width / 3 }px; transition: all 0.8s; transform: rotate(-720deg);`
-                }, 20);
-
-                setTimeout(() => {
-                    animationElStatus.value = ''
-                    animationAddRepeatFlag.value = false
-                }, 1020);
-
-            }).exec()
-
-        }).exec()
-    }, 100)
-    // #endif
-    // #ifdef  H5
-    setTimeout(() => {
-        const animationEnd: any = window.document.getElementById('animation-end');
-        const animationEndLeft = animationEnd.getBoundingClientRect().left;
-        const animationEndTop = animationEnd.getBoundingClientRect().top;
-
-        const itemCart: any = window.document.getElementById(id);
-        const itemCartLift = itemCart.getBoundingClientRect().left;
-        const itemCartTop = itemCart.getBoundingClientRect().top;
-        animationElStatus.value = `top: ${ itemCartTop }px; left: ${ itemCartLift }px;`
-
-        setTimeout(() => {
-            animationElStatus.value = `top: ${ animationEndTop + animationEnd.offsetHeight / 2 - itemCart.offsetHeight / 3 }px; left: ${ animationEndLeft + animationEnd.offsetWidth / 2 - itemCart.offsetHeight / 3 }px; transition: all 0.8s; transform: rotate(-720deg);`
-        }, 20);
-        setTimeout(() => {
-            animationElStatus.value = ''
-            animationAddRepeatFlag.value = false
-        }, 1020);
-
-    }, 100);
-    // #endif
-}
 
 /**
  * @description 获取分类数据
@@ -390,17 +196,17 @@ const animationAddCart = (row: any, id: any) => {
 const tabsData: any = ref<Array<Object>>([])
 const getCategoryData = () => {
     loading.value = true;
-    getGoodsCategoryTree().then((res: any) => {
+    getGoodsCategoryTree({ platform: 0 }).then((res: any) => {
         tabsData.value = res.data;
         if (categoryId) {
             for (let i = 0; i < tabsData.value.length; i++) {
-                if (tabsData.value[i].category_id == categoryId) {
+                if (tabsData.value[i].id == categoryId) {
                     tabActive.value = i;
                     break;
                 }
                 if (tabsData.value[i].child_list) {
                     for (let k = 0; k < tabsData.value[i].child_list.length; k++) {
-                        if (tabsData.value[i].child_list[k].category_id == categoryId) {
+                        if (tabsData.value[i].child_list[k].id == categoryId) {
                             tabActive.value = i;
                             break;
                         }
@@ -408,7 +214,7 @@ const getCategoryData = () => {
                 }
             }
         } else {
-            categoryId = res.data[0].category_id;
+            categoryId = res.data[0].id;
         }
         loading.value = false;
     }).catch(() => {
@@ -420,177 +226,16 @@ const getCategoryData = () => {
 const tabActive = ref<number>(0)
 
 // 一级菜单点击事件
-const firstLevelClick = (index: number, data: any) => {
+const firstLevelClick = (index: any, data: any) => {
     tabActive.value = index;
-    categoryId = data.category_id;
+    categoryId = data.id;
     list.value = [];
     getMescroll().resetUpScroll();
 }
 
 // 搜索名字
 const searchNameFn = () => {
-    // getMescroll().resetUpScroll();
-    // if(searchName.value)
-    redirect({ url: '/addon/shop/pages/goods/list', param: { goods_name: encodeURIComponent(searchName.value) } })
-}
-
-//点击商品购物车按钮
-const cartRef = ref()
-const itemCart = (row: any, id: any) => {
-    // 虚拟商品,并且需要核销,禁止加入购物车
-    if (row.goods_type == 'virtual' && row.virtual_receive_type == 'verify') {
-        return toLink(row.goodsSku.goods_id)
-    }
-
-    if (config.cart.event !== 'cart') {
-        return toLink(row.goodsSku.goods_id)
-    }
-
-    if (!userInfo.value) {
-        useLogin().setLoginBack({ url: '/addon/shop/pages/goods/category' })
-        return false
-    }
-
-    if (row.goodsSku.sku_spec_format) {
-        cartRef.value.open(row.goodsSku.sku_id)
-    } else {
-        //单规格添加购物车
-        if (!row.goodsSku.stock || parseInt(row.goodsSku.num || 0) > parseInt(row.goodsSku.stock)) {
-            uni.showToast({ title: '商品库存不足', icon: 'none' })
-            return;
-        }
-        if (row.min_buy && row.min_buy > parseInt(row.stock)) {
-            uni.showToast({ title: '商品库存小于起购数量', icon: 'none' })
-            return;
-        }
-        animationAddCart(row, id)
-    }
-}
-
-//点击购物车加号 添加数量
-const addCartBtn = (item: any, row: any, id: string) => {
-    if (parseInt(row.num) >= parseInt(row.stock)) {
-        uni.showToast({ title: '商品库存不足', icon: 'none' })
-        return;
-    }
-
-    // 起购
-    let num = row.num;
-    if (item.min_buy > 0 && item.min_buy > num) {
-        num = item.min_buy;
-    }
-
-    /************** 限购-start *****************/
-    let maxBuyNum = -1;
-    // 限购 - 是否开启限购
-    if (item.is_limit && item.max_buy) {
-        let max_buy = 0;
-        if (item.limit_type == 1) { //单次限购
-            max_buy = item.max_buy;
-        } else { // 单人限购
-            let buyVal = item.max_buy - (item.has_buy || 0);
-            max_buy = buyVal > 0 ? buyVal : 0;
-        }
-
-        if (max_buy > item.goodsSku.stock) {
-            maxBuyNum = item.goodsSku.stock
-        } else if (max_buy <= item.goodsSku.stock) {
-            maxBuyNum = max_buy;
-        }
-    }
-
-    if (item.is_limit && num >= item.max_buy) {
-        let tips = `该商品单次限购${ item.max_buy }件`;
-        if (item.limit_type != 1) { //单次限购
-            tips = `该商品每人限购${ item.max_buy }件`;
-        }
-        uni.showToast({ title: tips, icon: 'none' })
-        return false;
-    }
-    /************** 限购-end *****************/
-
-    let obj = cloneDeep(item)
-    obj.num = num;
-    obj.id = row.id;
-    animationAddCart(obj, id)
-}
-
-//点击购物车减号
-const reduceCart = (data: any, row: any) => {
-    if (cartRepeatFlag.value) return false
-    cartRepeatFlag.value = true
-
-    let reduceNum = 1;
-    if (data.min_buy > 0 && data.min_buy == row.num) {
-        reduceNum = data.min_buy;
-    }
-
-    cartStore.reduce({
-        id: row.id,
-        goods_id: row.goods_id,
-        sku_id: row.sku_id,
-        stock: row.stock,
-        sale_price: row.sale_price,
-        num: row.num
-    }, reduceNum, () => {
-        cartRepeatFlag.value = false
-    })
-
-}
-
-//进入购物车
-const toCart = () => {
-    redirect({ url: '/addon/shop/pages/goods/cart' })
-}
-
-//强制绑定手机号
-const bindMobileRef: any = ref(null)
-const isBindMobile = ref(uni.getStorageSync('isBindMobile'))
-
-/**
- * 结算
- */
-const settlement = () => {
-
-    // #ifdef H5
-    // 绑定手机号
-    // if(uni.getStorageSync('isBindMobile')){
-    // 	bindMobileRef.value.open()
-    // 	return false
-    // }
-    // #endif
-
-    if (!totalNum.value) {
-        uni.showToast({ title: '还没有选择商品', icon: 'none' })
-        return
-    }
-    const cart_ids: any = []
-    Object.values(cartList.value).forEach(item => {
-        Object.keys(item).forEach(v => {
-            if (v != 'totalNum' && v != 'totalMoney') cart_ids.push(item[v].id)
-        })
-
-    })
-    if (cart_ids.length == 0) {
-        return;
-    }
-    uni.setStorage({
-        key: 'orderCreateData',
-        data: { cart_ids },
-        success() {
-            redirect({ url: '/addon/shop/pages/order/payment' })
-        }
-    })
-}
-
-// 价格类型
-const priceType = (data: any) => {
-    return data.goodsSku.show_type
-}
-
-// 商品价格
-const goodsPrice = (data: any) => {
-    return data.goodsSku.show_price
+    getMescroll().resetUpScroll();
 }
 </script>
 
@@ -774,6 +419,7 @@ const goodsPrice = (data: any) => {
         height: calc(100vh - 40rpx - 100rpx - env(safe-area-inset-bottom));
     }
 }
+
 /*  #endif  */
 
 // 空页面

+ 39 - 30
src/addon/shop/pages/goods/components/category-template-two-one.vue

@@ -1,46 +1,57 @@
 <template>
     <view class=" bg-[var(--page-bg-color)] overflow-hidden min-h-screen">
         <view class="mescroll-box" v-if="tabsData.length">
-            <view v-if="config.search.control" class="search-box box-border z-10 fixed top-0 left-0 right-0  h-[100rpx] bg-[#fff]" :style="{'top': systemStore.topTabbarInfo.fullHeight || 0}">
+            <view v-if="config.search.control"
+                class="search-box box-border z-10 fixed top-0 left-0 right-0  h-[100rpx] bg-[#fff]"
+                :style="{ 'top': systemStore.topTabbarInfo.fullHeight || 0 }">
                 <view class="flex-1 search-input">
                     <text @click.stop="searchNameFn" class="nc-iconfont nc-icon-sousuo-duanV6xx1 btn"></text>
-                    <input class="input" type="text" v-model.trim="searchName" :placeholder="config.search.title" placeholderClass="text-[var(--text-color-light9)]" @confirm="searchNameFn">
-                    <text v-if="searchName" class="nc-iconfont nc-icon-cuohaoV6xx1 clear" @click="searchName=''"></text>
+                    <input class="input" type="text" v-model.trim="searchName" :placeholder="config.search.title"
+                        placeholderClass="text-[var(--text-color-light9)]" @confirm="searchNameFn">
+                    <text v-if="searchName" class="nc-iconfont nc-icon-cuohaoV6xx1 clear" @click="searchName = ''"></text>
                 </view>
             </view>
             <view class="tabs-box z-2 fixed left-0 bg-[#fff] bottom-[50px] top-0" :style="tabsBoxCss">
                 <scroll-view :scroll-y="true" class="scroll-height">
                     <view class="bg-[var(--temp-bg)]">
                         <view class="tab-item"
-                              :class="{ 'tab-item-active': index == tabActive,'rounded-br-[12rpx]':tabActive-1===index,'rounded-tr-[12rpx]':tabActive+1===index  }"
-                              v-for="(item, index) in tabsData" :key="index" @click="firstLevelClick(index, item)">
-                            <view class="text-box text-[26rpx] text-left leading-[1.3] break-words px-[16rpx]">{{ item.category_name }}</view>
+                            :class="{ 'tab-item-active': index == tabActive, 'rounded-br-[12rpx]': tabActive - 1 === index, 'rounded-tr-[12rpx]': tabActive + 1 === index }"
+                            v-for="(item, index) in tabsData" :key="index" @click="firstLevelClick(index, item)">
+                            <view class="text-box text-[26rpx] text-left leading-[1.3] break-words px-[16rpx]">{{
+                                item.label }}</view>
                         </view>
                     </view>
                 </scroll-view>
             </view>
             <scroll-view class="h-[100vh]" :scroll-y="true">
-                <view class="pl-[188rpx] scroll-ios pt-[20rpx] pr-[20rpx]" :class="{ '!pt-[120rpx]': config.search.control }">
-                    <view class="bg-[#fff] grid grid-cols-3 gap-x-[50rpx] gap-y-[32rpx] py-[32rpx] px-[24rpx] rounded-[var(--rounded-big)]"
-                        v-if="tabsData[tabActive]?.child_list && !loading">
-                        <template v-for="(item, index) in tabsData[tabActive]?.child_list" :key="item.category_id">
-                            <view @click="toLink(item.category_id)" class=" flex items-center justify-center flex-col">
-                                <u--image radius="var(--goods-rounded-big)" width="120rpx" height="120rpx" :src="img(item.image ? item.image : '')" model="aspectFill">
+                <view class="pl-[188rpx] scroll-ios pt-[20rpx] pr-[20rpx]"
+                    :class="{ '!pt-[120rpx]': config.search.control }">
+                    <view
+                        class="bg-[#fff] grid grid-cols-3 gap-x-[50rpx] gap-y-[32rpx] py-[32rpx] px-[24rpx] rounded-[var(--rounded-big)]"
+                        v-if="tabsData[tabActive]?.children && !loading">
+                        <template v-for="(item, index) in tabsData[tabActive]?.children" :key="item.category_id">
+                            <view @click="toLink(item.id)" class=" flex items-center justify-center flex-col">
+                                <u--image radius="var(--goods-rounded-big)" width="120rpx" height="120rpx"
+                                    :src="img(item.image ? item.image : '')" model="aspectFill">
                                     <template #error>
-                                        <image class="rounded-[var(--goods-rounded-big)] overflow-hidden w-[120rpx] h-[120rpx]" :src="img('static/resource/images/diy/shop_default.jpg')" mode="aspectFill" />
+                                        <image
+                                            class="rounded-[var(--goods-rounded-big)] overflow-hidden w-[120rpx] h-[120rpx]"
+                                            src="@/static/logo.png"
+                                            mode="aspectFill" />
                                     </template>
                                 </u--image>
-                                <view class="text-[24rpx] text-center mt-[16rpx] leading-[34rpx]">{{item.category_name }}</view>
+                                <view class="text-[24rpx] text-center mt-[16rpx] leading-[34rpx]">{{ item.label }}</view>
                             </view>
                         </template>
                     </view>
-                    
-                    <mescroll-empty class="part" v-if="!tabsData[tabActive]?.child_list && !loading" :option="{tip : '暂无商品分类'}"></mescroll-empty>
+
+                    <mescroll-empty class="part" v-if="!tabsData[tabActive]?.children && !loading"
+                        :option="{ tip: '暂无商品分类' }"></mescroll-empty>
                 </view>
             </scroll-view>
         </view>
         <tabbar />
-        <mescroll-empty v-if="!tabsData.length && !loading" :option="{tip : '暂无商品分类'}"></mescroll-empty>
+        <mescroll-empty v-if="!tabsData.length && !loading" :option="{ tip: '暂无商品分类' }"></mescroll-empty>
         <loading-page :loading="loading"></loading-page>
     </view>
 </template>
@@ -77,10 +88,10 @@ onMounted(() => {
 
 const tabsBoxCss = computed(() => {
     let style = ''
-    if(config.search.control){
-        style += `top: calc(${ systemStore.topTabbarInfo.height || 0 }px + 100rpx);`
-    }else{
-        style += `top: ${ systemStore.topTabbarInfo.height || 0 }px;`
+    if (config.search.control) {
+        style += `top: calc(${systemStore.topTabbarInfo.height || 0}px + 100rpx);`
+    } else {
+        style += `top: ${systemStore.topTabbarInfo.height || 0}px;`
     }
     return style
 })
@@ -91,17 +102,17 @@ const tabsBoxCss = computed(() => {
 const tabsData: any = ref<Array<Object>>([])
 const getCategoryData = () => {
     loading.value = true;
-    getGoodsCategoryTree().then((res: any) => {
+    getGoodsCategoryTree({ platform: 0 }).then((res: any) => {
         tabsData.value = res.data;
         if (categoryId) {
             for (let i = 0; i < tabsData.value.length; i++) {
-                if (tabsData.value[i].category_id == categoryId) {
+                if (tabsData.value[i].id == categoryId) {
                     tabActive.value = i;
                     break;
                 }
-                if (tabsData.value[i].child_list) {
-                    for (let k = 0; k < tabsData.value[i].child_list.length; k++) {
-                        if (tabsData.value[i].child_list[k].category_id == categoryId) {
+                if (tabsData.value[i].children) {
+                    for (let k = 0; k < tabsData.value[i].children.length; k++) {
+                        if (tabsData.value[i].children[k].id == categoryId) {
                             tabActive.value = i;
                             break;
                         }
@@ -119,16 +130,14 @@ const getCategoryData = () => {
 const tabActive = ref<number>(0)
 
 // 一级菜单点击事件
-const firstLevelClick = (index: number, data: Object) => {
+const firstLevelClick = (index: any, data: Object) => {
     tabActive.value = index;
 }
 const toLink = (curr_goods_category: string) => {
-    redirect({ url: '/addon/shop/pages/goods/list', param: { curr_goods_category } })
+    redirect({ url: '/addon/shop/pages/goods/list', param: { topCategoryId: categoryId, mediumCategoryId: curr_goods_category } })
 }
 // 搜索名字
 const searchNameFn = () => {
-    // getMescroll().resetUpScroll();
-    // if(searchName.value)
     redirect({ url: '/addon/shop/pages/goods/list', param: { goods_name: encodeURIComponent(searchName.value) } })
 }
 </script>

+ 265 - 551
src/addon/shop/pages/goods/components/category-template-two-two.vue

@@ -1,22 +1,40 @@
 <template>
     <view class="min-h-screen bg-[var(--page-bg-color)] overflow-hidden">
-        <view class="mescroll-box bg-[#f6f6f6]" :class="{ 'cart': config.cart.control && config.cart.event === 'cart', 'detail': !(config.cart.control && config.cart.event === 'cart') }" v-if="tabsData.length">
+        <view class="mescroll-box bg-[#f6f6f6] detail" v-if="tabsData.length">
             <mescroll-body ref="mescrollRef" :down="{ use: false }" @init="mescrollInit" @up="getListFn">
-                <view v-if="config.search.control" class="box-border search-box z-10 bg-[#fff] fixed top-0 left-0 right-0 h-[96rpx]" :style="{'top': systemStore.topTabbarInfo.fullHeight || 0}">
+                <view v-if="config.search.control == 1"
+                    class="box-border search-box z-10 bg-[#fff] fixed top-0 left-0 right-0 h-[96rpx]"
+                    :style="{ top: systemStore.topTabbarInfo.fullHeight || 0 }">
                     <view class="flex-1 search-input">
                         <text @click.stop="searchNameFn" class="nc-iconfont nc-icon-sousuo-duanV6xx1 btn"></text>
-                        <input class="input" type="text" v-model.trim="searchName" :placeholder="config.search.title" placeholderClass="text-[var(--text-color-light9)]" @confirm="searchNameFn">
-                        <text v-if="searchName" class="nc-iconfont nc-icon-cuohaoV6xx1 clear" @click="searchName=''"></text>
+                        <input class="input" type="text" v-model.trim="searchName" :placeholder="config.search.title"
+                            placeholderClass="text-[var(--text-color-light9)]" @confirm="searchNameFn" />
+                        <text v-if="searchName" class="nc-iconfont nc-icon-cuohaoV6xx1 clear"
+                            @click="searchName = ''"></text>
                     </view>
                 </view>
 
                 <!--  #ifdef  H5 -->
-                <view class="tabs-box z-2 fixed left-0 bg-[#fff] bottom-[50px] top-0" :class="{ '!top-[96rpx]': config.search.control, 'pb-[98rpx]': config.cart.control && config.cart.event === 'cart' }">
+                <view class="tabs-box z-2 fixed left-0 bg-[#fff] bottom-[50px] top-0" :class="{
+                    '!top-[96rpx]': config.search.control,
+                    'pb-[98rpx]': config.cart.control && config.cart.event === 'cart',
+                }">
                     <scroll-view :scroll-y="true" class="scroll-height">
                         <view class="bg-[var(--temp-bg)]">
-                            <view class="tab-item" :class="{ 'tab-item-active ': index == tabActive,'rounded-br-[12rpx]':tabActive-1===index && (!tabsData[tabActive].child_list || !tabsData[tabActive].child_list.length),'rounded-tr-[12rpx]':tabActive+1===index&&(!tabsData[tabActive].child_list || !tabsData[tabActive].child_list.length) }"
-                                  v-for="(item, index) in tabsData" :key="index" @click="firstLevelClick(index, item)">
-                                <view class="text-box leading-[1.3] break-words px-[24rpx]">{{ item.category_name }}</view>
+                            <view class="tab-item" :class="{
+                                'tab-item-active ': index == tabActive,
+                                'rounded-br-[12rpx]':
+                                    tabActive - 1 === index &&
+                                    (!tabsData[tabActive].children ||
+                                        !tabsData[tabActive].children.length),
+                                'rounded-tr-[12rpx]':
+                                    tabActive + 1 === index &&
+                                    (!tabsData[tabActive].children ||
+                                        !tabsData[tabActive].children.length),
+                            }" v-for="(item, index) in tabsData" :key="index" @click="firstLevelClick(index, item)">
+                                <view class="text-box leading-[1.3] break-words px-[24rpx]">{{
+                                    item.label
+                                    }}</view>
                             </view>
                         </view>
                     </scroll-view>
@@ -27,662 +45,358 @@
                 <view class="tabs-box z-2 fixed left-0 bg-[#fff] pb-ios bottom-[100rpx] top-0" :style="tabsBoxCss">
                     <scroll-view :scroll-y="true" class="scroll-height">
                         <view class="bg-[var(--temp-bg)]">
-                            <view class="tab-item"
-                                  :class="{ 'tab-item-active': index == tabActive,'rounded-br-[12rpx]':tabActive-1===index&&(!tabsData[tabActive].child_list || !tabsData[tabActive].child_list.length),'rounded-tr-[12rpx]':tabActive+1===index&&(!tabsData[tabActive].child_list || !tabsData[tabActive].child_list.length) }"
-                                  v-for="(item, index) in tabsData" :key="index" @click="firstLevelClick(index, item)">
-                                <view class="text-box px-[16rpx] leading-[1.3] break-words">{{ item.category_name }}</view>
+                            <view class="tab-item" :class="{
+                                'tab-item-active': index == tabActive,
+                                'rounded-br-[12rpx]':
+                                    tabActive - 1 === index &&
+                                    (!tabsData[tabActive].children ||
+                                        !tabsData[tabActive].children.length),
+                                'rounded-tr-[12rpx]':
+                                    tabActive + 1 === index &&
+                                    (!tabsData[tabActive].children ||
+                                        !tabsData[tabActive].children.length),
+                            }" v-for="(item, index) in tabsData" :key="index" @click="firstLevelClick(index, item)">
+                                <view class="text-box px-[16rpx] leading-[1.3] break-words">{{
+                                    item.label
+                                    }}</view>
                             </view>
                         </view>
                     </scroll-view>
                 </view>
                 <!--  #endif -->
 
-                <view class="flex items-center h-[98rpx] pl-[24rpx] pr-[48rpx] py-[20rpx] z-10 bg-white fixed left-[168rpx] right-0 box-border top-0"
-                    :style="twoTabCss"
-                      :class="{ '!top-[94rpx]': config.search.control }"
-                      v-if="tabsData[tabActive]?.child_list && tabsData[tabActive]?.child_list.length">
+                <view
+                    class="flex items-center h-[98rpx] pl-[24rpx] pr-[48rpx] py-[20rpx] z-10 bg-white fixed left-[168rpx] right-0 box-border top-0"
+                    :style="twoTabCss" :class="{ '!top-[94rpx]': config.search.control }" v-if="
+                        tabsData[tabActive]?.children &&
+                        tabsData[tabActive]?.children.length
+                    ">
                     <template v-if="!labelPopup">
                         <scroll-view :scroll-x="true" scroll-with-animation
-                                     :scroll-into-view="'id' + (subActive ? subActive - 1 : 0)"
-                                     class="flex-1 h-[54rpx] scroll-Y box-border pr-[24rpx] bg-white">
+                            :scroll-into-view="'id' + (subActive ? subActive - 1 : 0)"
+                            class="flex-1 h-[54rpx] scroll-Y box-border pr-[24rpx] bg-white">
                             <view class="flex items-center h-[54rpx] box-border">
                                 <text
-                                    class="w-[150rpx] flex-shrink-0 px-[14rpx] h-[54rpx] truncate  text-center !leading-[50rpx] !text-[24rpx] border-[2rpx] border-solid !rounded-[100rpx] box-border text-[#333] box-border"
-                                    :class="{ 'bg-[var(--primary-color-light)] font-500 text-[var(--primary-color)] border-[var(--primary-color)]': index === subActive, 'border-[var(--temp-bg)]  bg-[var(--temp-bg)]': index != subActive, ' ml-[24rpx]': index != 0 }"
-                                    v-for="(item, index) in tabsData[tabActive]?.child_list"
-                                    :key="tabsData[tabActive].category_id" :id="'id' + index"
-                                    @click="subMenuClick(index, item)">{{ item.category_name }}</text>
+                                    class="w-[150rpx] flex-shrink-0 px-[14rpx] h-[54rpx] truncate text-center !leading-[50rpx] !text-[24rpx] border-[2rpx] border-solid !rounded-[100rpx] box-border text-[#333] box-border"
+                                    :class="{
+                                        'bg-[var(--primary-color-light)] font-500 text-[var(--primary-color)] border-[var(--primary-color)]':
+                                            index === subActive,
+                                        '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>
                             </view>
                         </scroll-view>
-                        <view class="absolute right-[24rpx] nc-iconfont nc-icon-xiaV6xx text-[30rpx] w-[30rpx] h-[30rpx] text-center transform " @click="labelPopup = true"></view>
+                        <view
+                            class="absolute right-[24rpx] nc-iconfont nc-icon-xiaV6xx text-[30rpx] w-[30rpx] h-[30rpx] text-center transform"
+                            @click="labelPopup = true"></view>
                     </template>
                     <template v-else>
-                        <view class="flex-1 h-[48rpx] text-[28rpx] text-[var(--text-color-light9)] pr-[24rpx] leading-[48rpx]">全部分类</view>
-                        <text class="absolute right-[24rpx] nc-iconfont nc-icon-shangV6xx-1 text-[#333] text-[30rpx]" @click="labelPopup = false"></text>
+                        <view
+                            class="flex-1 h-[48rpx] text-[28rpx] text-[var(--text-color-light9)] pr-[24rpx] leading-[48rpx]">
+                            全部分类</view>
+                        <text class="absolute right-[24rpx] nc-iconfont nc-icon-shangV6xx-1 text-[#333] text-[30rpx]"
+                            @click="labelPopup = false"></text>
                     </template>
                 </view>
-                <view class="labelPopup" :class="{ 'active': config.search.control }">
-					<u-popup :show="labelPopup" mode="top" @close="labelPopup = false">
+                <view class="labelPopup" :class="{ active: config.search.control }">
+                    <u-popup :show="labelPopup" mode="top" @close="labelPopup = false">
                         <view class="flex flex-wrap pb-[24rpx]" :style="labelPopupCss" @touchmove.prevent.stop>
                             <text
                                 class="px-[14rpx] flex-shrink-0 w-[160rpx] box-border ml-[20rpx] mb-[26rpx] h-[60rpx] text-center leading-[56rpx] text-[24rpx] border-[2rpx] border-solid !rounded-[100rpx] text-[#333] truncate"
-                                :class="{ 'bg-[var(--primary-color-light)] font-500 text-[var(--primary-color)] border-[var(--primary-color)]': index === subActive, 'border-[var(--temp-bg)]  bg-[var(--temp-bg)]': index != subActive }"
-                                v-for="(item, index) in tabsData[tabActive]?.child_list"
-                                :key="tabsData[tabActive].category_id" @click="subMenuClick(index, item)">{{ item.category_name }}</text>
+                                :class="{
+                                    'bg-[var(--primary-color-light)] font-500 text-[var(--primary-color)] border-[var(--primary-color)]':
+                                        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>
                         </view>
                     </u-popup>
                 </view>
-                <view class="flex justify-center flex-wrap pl-[168rpx] pt-[20rpx] pb-[20rpx]"
-                      :class="{ '!pt-[214rpx]': config.search.control && tabsData[tabActive]?.child_list && tabsData[tabActive]?.child_list.length, 'pt-[120rpx]': config.search.control && (!tabsData[tabActive].child_list || !tabsData[tabActive].child_list.length), 'pt-[118rpx]': tabsData[tabActive]?.child_list && tabsData[tabActive]?.child_list.length && !config.search.control }">
-                    <template v-for="(item, index) in list" :key="item.goods_id">
-                        <view class="w-[536rpx] box-border bg-white w-full flex mx-[20rpx] py-[24rpx] px-[20rpx] rounded-[var(--rounded-small)]"
-                            :class="{ 'mt-[20rpx]': index }" @click.stop="toLink(item.goods_id)">
-                            <view class="w-[168rpx] h-[168rpx] flex items-center justify-center mr-[20rpx] rounded-[var(--goods-rounded-small)] overflow-hidden">
-                                <u--image width="168rpx" height="168rpx" :radius="'var(--goods-rounded-small)'" :src="img( item.goods_cover_thumb_mid || '')" model="aspectFill">
+                <view class="flex justify-center flex-wrap pl-[168rpx] pt-[20rpx] pb-[20rpx]" :class="{
+                    '!pt-[214rpx]':
+                        config.search.control &&
+                        tabsData[tabActive]?.children &&
+                        tabsData[tabActive]?.children.length,
+                    'pt-[120rpx]':
+                        config.search.control &&
+                        (!tabsData[tabActive].children ||
+                            !tabsData[tabActive].children.length),
+                    'pt-[118rpx]':
+                        tabsData[tabActive]?.children &&
+                        tabsData[tabActive]?.children.length &&
+                        !config.search.control,
+                }">
+                    <template v-for="(item, index) in list" :key="index">
+                        <view
+                            class="w-[536rpx] box-border bg-white w-full flex mx-[20rpx] py-[24rpx] px-[20rpx] rounded-[var(--rounded-small)]"
+                            :class="{ 'mt-[20rpx]': index }" @click.stop="toLink(item.id)">
+                            <view
+                                class="w-[168rpx] h-[168rpx] flex items-center justify-center mr-[20rpx] rounded-[var(--goods-rounded-small)] overflow-hidden">
+                                <u--image width="168rpx" height="168rpx" :radius="'var(--goods-rounded-small)'"
+                                    :src="img(item.productImage || '')" model="aspectFill">
                                     <template #error>
-                                        <image class="w-[168rpx] h-[168rpx]" :src="img('static/resource/images/diy/shop_default.jpg')" mode="aspectFill" />
+                                        <image class="w-[168rpx] h-[168rpx]" :src="img(
+                                            'https://v6.site.niucloud.com/static/resource/images/diy/shop_default.jpg'
+                                        )
+                                            " mode="aspectFill" />
                                     </template>
                                 </u--image>
                             </view>
                             <view class="flex flex-1 flex-wrap flex-col">
-                                <view class="max-h-[80rpx] text-[26rpx] leading-[40rpx] multi-hidden">{{ item.goods_name }}</view>
-                                <view class="flex  items-end justify-between flex-1">
+                                <view class="max-h-[80rpx] text-[26rpx] leading-[40rpx] multi-hidden">{{ item.itemName
+                                    }}</view>
+                                <view class="flex items-end justify-between flex-1">
                                     <view class="text-[var(--price-text-color)] price-font -mb-[8rpx]">
                                         <text class="text-[24rpx] font-500">¥</text>
-                                        <text class="text-[40rpx] font-500">{{ parseFloat(goodsPrice(item)).toFixed(2).split('.')[0] }}</text>
-                                        <text class="text-[24rpx] font-500">.{{ parseFloat(goodsPrice(item)).toFixed(2).split('.')[1] }}</text>
-                                        <image class="h-[24rpx] max-w-[46rpx] ml-[6rpx]" v-if="priceType(item) == 'member_price'" :src="img('addon/shop/VIP.png')" mode="heightFix" />
-										<image class="h-[24rpx] max-w-[60rpx] ml-[6rpx]" v-if="priceType(item) == 'newcomer_price'" :src="img('addon/shop/newcomer.png')" mode="heightFix" />
-										<image class="h-[24rpx] max-w-[80rpx] ml-[6rpx]" v-if="priceType(item) == 'discount_price'" :src="img('addon/shop/discount.png')" mode="heightFix" /> 
+                                        <text class="text-[40rpx] font-500">{{
+                                            diyGoods.goodsPrice(item).toFixed(2).split(".")[0]
+                                            }}</text>
+                                        <text class="text-[24rpx] font-500">.{{
+                                            diyGoods.goodsPrice(item).toFixed(2).split(".")[1]
+                                            }}</text>
                                     </view>
-                                    <template v-if="!item.isMaxBuy">
-                                        <view v-if="(item.goods_type == 'real' || (item.goods_type == 'virtual' && item.virtual_receive_type != 'verify')) && item.goodsSku.sku_spec_format === '' && cartList['goods_' + item.goods_id] && cartList['goods_' + item.goods_id]['sku_' + item.goodsSku.sku_id] && config.cart.control && config.cart.event === 'cart'" class="flex items-center">
-                                            <view class="relative w-[32rpx] h-[32rpx]">
-                                                <text class="text-[32rpx] text-color nc-iconfont nc-icon-jianshaoV6xx absolute flex items-center justify-center -left-[12rpx] -bottom-[14rpx] -right-[14rpx] -top-[14rpx]"
-                                                    @click.stop="reduceCart(item,cartList['goods_' + item.goods_id]['sku_' + item.goodsSku.sku_id])"></text>
-                                            </view>
-                                            <text class="text-[#333] text-[24rpx] mx-[16rpx]">{{ cartList['goods_' + item.goods_id]['sku_' + item.goodsSku.sku_id].num }}</text>
-                                            <view class="relative w-[32rpx] h-[32rpx]">
-                                                <text class="text-[32rpx] text-color iconfont iconjiahao2fill absolute flex items-center justify-center -left-[14rpx] -bottom-[14rpx] -right-[14rpx] -top-[14rpx]"
-                                                    :id="'itemCart' + index"
-                                                    @click.stop="addCartBtn(item,cartList['goods_' + item.goods_id]['sku_' + item.goodsSku.sku_id], 'itemCart' + index)"></text>
-                                            </view>
+
+                                    <view class="h-[44rpx] relative pl-[20rpx]">
+                                        <view :id="'itemCart' + index"
+                                            class="w-[102rpx] box-border text-center text-[#fff] primary-btn-bg h-[46rpx] text-[22rpx] leading-[46rpx] rounded-[100rpx]">
+                                            购买
                                         </view>
-                                        <template v-else-if="(item.goods_type == 'virtual' && item.virtual_receive_type != 'verify') || item.goods_type == 'real'">
-                                            <view v-if="config.cart.control && config.cart.style === 'style-1'" class="h-[44rpx] relative  pl-[20rpx]">
-                                                <view :id="'itemCart' + index"
-                                                      class="w-[102rpx] box-border text-center text-[#fff] primary-btn-bg h-[46rpx] text-[22rpx] leading-[46rpx] rounded-[100rpx]"
-                                                      @click.stop="itemCart(item, 'itemCart' + index)">
-                                                    {{ config.cart.text }}
-                                                </view>
-                                                <view v-if="cartList['goods_' + item.goods_id] && cartList['goods_' + item.goods_id].totalNum"
-                                                    :class="['absolute right-[-16rpx] top-[-16rpx] rounded-[30rpx] h-[30rpx] min-w-[30rpx] text-center leading-[26rpx] bg-[var(--primary-color)] text-[#fff] text-[20rpx] font-500 box-border box-border border-[2rpx] border-solid border-[#fff]', cartList['goods_' + item.goods_id].totalNum > 9 ? 'px-[10rpx]' : '']">
-                                                    {{ cartList['goods_' + item.goods_id].totalNum }}
-                                                </view>
-                                            </view>
-                                            <view v-if="config.cart.control && config.cart.style === 'style-2'" class="w-[50rpx] h-[50rpx] relative" @click.stop="itemCart(item, 'itemCart' + index)">
-                                                <text :id="'itemCart' + index" class="text-color nc-iconfont nc-icon-tianjiaV6xx text-[44rpx]"></text>
-                                                <view v-if="cartList['goods_' + item.goods_id] && cartList['goods_' + item.goods_id].totalNum"
-                                                    :class="['absolute right-[-16rpx] top-[-16rpx] rounded-[30rpx] h-[30rpx] min-w-[30rpx] text-center leading-[26rpx] bg-[var(--primary-color)] text-[#fff] text-[20rpx] font-500 box-border box-border border-[2rpx] border-solid border-[#fff]', cartList['goods_' + item.goods_id].totalNum > 9 ? 'px-[10rpx]' : '']">{{ cartList['goods_' + item.goods_id].totalNum }}</view>
-                                            </view>
-                                            <view v-if="config.cart.control && config.cart.style === 'style-3'"
-                                                  class="w-[50rpx] h-[50rpx] flex justify-center items-end  relative"
-                                                  @click.stop="itemCart(item, 'itemCart' + index)">
-                                                <text :id="'itemCart' + index" class="text-color nc-iconfont nc-icon-gouwucheV6xx6 !text-[34rpx]"></text>
-                                                <view v-if="cartList['goods_' + item.goods_id] && cartList['goods_' + item.goods_id].totalNum"
-                                                    :class="['absolute right-[-10rpx] top-[-2rpx] rounded-[30rpx] h-[30rpx] min-w-[30rpx] text-center leading-[26rpx] bg-[var(--primary-color)] text-[#fff] text-[20rpx] font-500 box-border box-border border-[2rpx] border-solid border-[#fff]', cartList['goods_' + item.goods_id].totalNum > 9 ? 'px-[10rpx]' : '']">{{ cartList['goods_' + item.goods_id].totalNum }}</view>
-                                            </view>
-                                            <view v-if="config.cart.control && config.cart.style === 'style-4'" class="w-[50rpx] h-[50rpx] flex items-end relative"
-                                                  @click.stop="itemCart(item, 'itemCart' + index)">
-                                                <view :id="'itemCart' + index" class=" flex items-center justify-center text-[#fff] bg-color h-[44rpx] w-[44rpx] rounded-[22rpx] text-center">
-                                                    <text class="nc-iconfont nc-icon-gouwucheV6xx6 !text-[26rpx]"></text>
-                                                </view>
-                                                <view v-if="cartList['goods_' + item.goods_id] && cartList['goods_' + item.goods_id].totalNum"
-                                                    :class="['absolute right-[-10rpx] top-[-10rpx] rounded-[30rpx] h-[30rpx] min-w-[30rpx] text-center leading-[26rpx] bg-[var(--primary-color)] text-[#fff] text-[20rpx] font-500 box-border border-[2rpx] border-solid border-[#fff]', cartList['goods_' + item.goods_id].totalNum > 9 ? 'px-[10rpx]' : '']">{{ cartList['goods_' + item.goods_id].totalNum }}</view>
-                                            </view>
-                                        </template>
-                                    </template>
+                                    </view>
                                 </view>
                             </view>
                         </view>
-
                     </template>
-                    <mescroll-empty class="part" v-if="!list.length && !loading && listLoading" :option="{tip : '暂无商品'}"></mescroll-empty>
+                    <mescroll-empty class="part" v-if="!list.length && !loading && listLoading"
+                        :option="{ tip: '暂无商品' }"></mescroll-empty>
                 </view>
                 <add-cart-popup ref="cartRef" />
             </mescroll-body>
-            <!--  #ifdef  H5 -->
-            <view v-if="config.cart.control && config.cart.event === 'cart'" class="bg-[#fff] z-10 flex justify-between items-center fixed left-0 right-0 bottom-[50px] box-solid px-[24rpx] py-[17rpx] mb-ios border-[0] border-t-[2rpx] border-solid border-[#f6f6f6]">
-                <view class="flex items-center">
-                    <view class="w-[66rpx] h-[66rpx] mr-[27rpx] relative">
-                        <view id="animation-end" class="w-[66rpx] h-[66rpx] rounded-[35rpx] bg-[var(--primary-color)] text-center leading-[70rpx]" @click.stop="toCart">
-                            <text class="nc-iconfont nc-icon-gouwucheV6mm1 text-[#fff] text-[32rpx]"></text>
-                        </view>
-                        <view v-if="totalNum" class="border-[1rpx] border-solid border-[#fff]"
-                              :class="['absolute left-[40rpx] top-[-10rpx] rounded-[28rpx] h-[28rpx] min-w-[28rpx] text-center leading-[26rpx] bg-[var(--primary-color)] text-[#fff] text-[20rpx] font-500 box-border', totalNum > 9 ? 'px-[10rpx]' : '']">
-                            {{ totalNum > 99 ? "99+" : totalNum }}
-                        </view>
-                    </view>
-                    <text class="text-[26rpx] text-[#333]">总计:</text>
-                    <view class="text-[var(--price-text-color)] price-font font-bold flex items-baseline">
-                        <text class="text-[26rpx] mr-[6rpx]">¥</text>
-                        <text class="text-[44rpx]">{{ parseFloat(totalMoney) }}</text>
-                    </view>
-                </view>
-                <button
-                    class="w-[180rpx] h-[70rpx] text-[26rpx] leading-[70rpx] font-500 m-0 rounded-full remove-border"
-                    :class="{'primary-btn-bg !text-[#fff]': parseFloat(totalMoney) > 0, 'bg-[#F7F7F7] !text-[var(--text-color-light9)]': parseFloat(totalMoney) <= 0}"
-                    @click="settlement">去结算</button>
-            </view>
-            <!--  #endif -->
-
-            <!-- #ifdef MP-WEIXIN -->
-            <view v-if="config.cart.control && config.cart.event === 'cart'"
-                  class="bg-[#fff] z-10 flex justify-between items-center fixed left-0 right-0 bottom-[100rpx] box-solid px-[24rpx] py-[17rpx] mb-ios border-[0] border-t-[2rpx] border-solid border-[#f6f6f6]">
-                <view class="flex items-center">
-                    <view class="w-[66rpx] h-[66rpx] mr-[27rpx] relative">
-                        <view id="animation-end"
-                              class="w-[66rpx] h-[66rpx] rounded-[35rpx] bg-[var(--primary-color)] text-center leading-[66rpx]"
-                              @click.stop="toCart">
-                            <text class="nc-iconfont nc-icon-gouwucheV6mm1 text-[#fff] text-[32rpx]"></text>
-                        </view>
-                        <view v-if="totalNum" class="border-[1rpx] border-solid border-[#fff]"
-                              :class="['absolute left-[40rpx] top-[-10rpx] rounded-[28rpx] h-[28rpx] min-w-[28rpx] text-center leading-[26rpx] bg-[var(--primary-color)] text-[#fff] text-[20rpx] font-500 box-border', totalNum > 9 ? 'px-[10rpx]' : '']">
-                            {{ totalNum > 99 ? "99+" : totalNum }}
-                        </view>
-                    </view>
-                    <text class="text-[26rpx] text-[#333]">总计:</text>
-                    <view class="text-[var(--price-text-color)] price-font font-bold inline-block">
-                        <text class="text-[26rpx] mr-[6rpx]">¥</text>
-                        <text class="text-[44rpx]">{{ parseFloat(totalMoney) }}</text>
-                    </view>
-                </view>
-                <!--<button v-if="isBindMobile && userInfo && !userInfo.mobile" class="w-[180rpx] h-[70rpx] text-[26rpx] leading-[70rpx] font-500 m-0 rounded-full remove-border"  :class="{'primary-btn-bg !text-[#fff]': parseFloat(totalMoney) > 0, 'bg-[#F7F7F7] !text-[var(&#45;&#45;text-color-light9)]': parseFloat(totalMoney) <= 0}" open-type="getPhoneNumber" @getphonenumber="memberStore.bindMobile">去结算</button>-->
-                <!--<button v-else class="w-[180rpx] h-[70rpx] text-[26rpx] leading-[70rpx] font-500 m-0 rounded-full remove-border"  :class="{'primary-btn-bg !text-[#fff]': parseFloat(totalMoney) > 0, 'bg-[#F7F7F7] !text-[var(&#45;&#45;text-color-light9)]': parseFloat(totalMoney) <= 0}" @click="settlement">去结算</button>-->
-                <button
-                    class="w-[180rpx] h-[70rpx] text-[26rpx] leading-[70rpx] font-500 m-0 rounded-full remove-border"
-                    :class="{'primary-btn-bg !text-[#fff]': parseFloat(totalMoney) > 0, 'bg-[#F7F7F7] !text-[var(--text-color-light9)]': parseFloat(totalMoney) <= 0}"
-                    @click="settlement">去结算</button>
-            </view>
-            <!--  #endif -->
         </view>
 
-        <view v-show="animationElStatus" :style="animationElStatus" class="fixed z-999 flex items-center justify-center text-[#fff] bg-color h-[44rpx] w-[44rpx] rounded-[22rpx] text-center">
-            <text class=" nc-iconfont nc-icon-gouwucheV6xx6 !text-[30rpx]"></text>
+        <view v-show="animationElStatus" :style="animationElStatus"
+            class="fixed z-999 flex items-center justify-center text-[#fff] bg-color h-[44rpx] w-[44rpx] rounded-[22rpx] text-center">
+            <text class="nc-iconfont nc-icon-gouwucheV6xx6 !text-[30rpx]"></text>
         </view>
         <view class="flex justify-center items-center w-[100%]" v-if="!tabsData.length && !loading">
-            <mescroll-empty :option="{tip : '暂无商品分类'}"></mescroll-empty>
+            <mescroll-empty :option="{ tip: '暂无商品分类' }"></mescroll-empty>
         </view>
         <loading-page :loading="loading"></loading-page>
         <tabbar />
-        <!-- 强制绑定手机号 -->
-        <bind-mobile ref="bindMobileRef" />
     </view>
 </template>
 
 <script setup lang="ts">
-import { ref, onMounted, computed, getCurrentInstance } from 'vue';
-import { t } from '@/locale';
-import { img, redirect } from '@/utils/common';
-import { getGoodsCategoryTree, getGoodsPages } from '@/addon/shop/api/goods';
-import MescrollBody from '@/components/mescroll/mescroll-body/mescroll-body.vue';
-import MescrollEmpty from '@/components/mescroll/mescroll-empty/mescroll-empty.vue';
-import useMescroll from '@/components/mescroll/hooks/useMescroll.js';
-import addCartPopup from './add-cart-popup.vue'
-import bindMobile from '@/components/bind-mobile/bind-mobile.vue';
-import { onPageScroll, onReachBottom } from '@dcloudio/uni-app';
-import { useLogin } from '@/hooks/useLogin'
-import useMemberStore from '@/stores/member'
-import useCartStore from '@/addon/shop/stores/cart'
-import { cloneDeep } from 'lodash-es'
-import useSystemStore from '@/stores/system';
-const systemStore = useSystemStore()
-
-const instance = getCurrentInstance(); // 获取组件实例
+import { ref, onMounted, computed, getCurrentInstance } from "vue";
+import { img, redirect } from "@/utils/common";
+import {
+    getGoodsCategoryTree,
+    getGoodsPages,
+    getGoodsComponents,
+} from "@/addon/shop/api/goods";
+import MescrollBody from "@/components/mescroll/mescroll-body/mescroll-body.vue";
+import MescrollEmpty from "@/components/mescroll/mescroll-empty/mescroll-empty.vue";
+import useMescroll from "@/components/mescroll/hooks/useMescroll.js";
+import addCartPopup from "./add-cart-popup.vue";
+import { onPageScroll, onReachBottom } from "@dcloudio/uni-app";
+import useCartStore from "@/addon/shop/stores/cart";
+import useSystemStore from "@/stores/system";
+const systemStore = useSystemStore();
+import { useGoods } from "@/addon/shop/hooks/useGoods";
+const diyGoods = useGoods();
+
 const cartStore = useCartStore();
 // 查询购物车列表
 cartStore.getList();
-
-const cartList = computed(() => cartStore.cartList)
-const totalNum = computed(() => cartStore.totalNum)
-const totalMoney = computed(() => cartStore.totalMoney)
-const memberStore = useMemberStore()
-const userInfo = computed(() => memberStore.info)
 const { mescrollInit, getMescroll } = useMescroll(onPageScroll, onReachBottom);
 const prop = defineProps({
     config: {
         type: Object,
-        default: (() => {
-            return {}
-        })
+        default: () => {
+            return {};
+        },
     },
     categoryId: {
         type: [String, Number],
-        default: 0
-    }
-})
-let config = prop.config
+        default: 0,
+    },
+});
+let config = prop.config;
 let categoryId = prop.categoryId;
-const list = ref<Array<Object>>([]);
+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>>([])
-cartData.value = uni.getStorageSync('shopCart') || []
+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 {
-    num: number,
-    size: number,
-    endSuccess: Function,
-
-    [propName: string]: any
+    num: number;
+    size: number;
+    endSuccess: Function;
+    [propName: string]: any;
 }
 
 const getListFn = (mescroll: mescrollStructure) => {
-    listLoading.value = false
-    getGoodsPages({
-        page: mescroll.num,
-        limit: mescroll.size,
-        goods_category: categoryId, // 商品分类id
-    }).then((res: any) => {
-        let newArr = res.data.data
-        //设置列表数据
-        if (mescroll.num == 1) {
-            list.value = []; //如果是第一页需手动制空列表
-        }
-        list.value = list.value.concat(newArr);
-        // 商品限购
-        goodsMaxBuy();
-        loading.value = false;
-        mescroll.endSuccess(newArr.length);
-        if (!list.value.length) listLoading.value = true
-    }).catch(() => {
-        loading.value = false;
-        listLoading.value = true
-        mescroll.endErr(); // 请求失败, 结束加载
+    listLoading.value = false;
+    getGoodsComponents({
+        pageNum: mescroll.num,
+        pageSize: mescroll.size,
+        searchKeyword: searchName.value,
+        topCategoryId: categoryId, // 商品分类id
+        mediumCategoryId:mediumCategoryId.value
     })
-}
+        .then((res: any) => {
+            let newArr = res.rows;
+            //设置列表数据
+            if (mescroll.num == 1) {
+                list.value = []; //如果是第一页需手动制空列表
+            }
+            list.value = list.value.concat(newArr);
+            loading.value = false;
+            mescroll.endSuccess(newArr.length);
+            if (!list.value.length) listLoading.value = true;
+        })
+        .catch(() => {
+            loading.value = false;
+            listLoading.value = true;
+            mescroll.endErr(); // 请求失败, 结束加载
+        });
+};
 // 左侧tab切换样式
 const tabsBoxCss = computed(() => {
-    let style = ''
-    if(config.search.control){
-        style += `top: calc(${ systemStore.topTabbarInfo.height || 0 }px + 96rpx);`
-    }else{
-        style += `top: ${ systemStore.topTabbarInfo.height || 0 }px;`
-    }
-
-    if(config.cart.control && config.cart.event === 'cart'){
-        style += `bottom: 198rpx !important;`
+    let style = "";
+    if (config.search.control) {
+        style += `top: calc(${systemStore.topTabbarInfo.height || 0}px + 96rpx);`;
+    } else {
+        style += `top: ${systemStore.topTabbarInfo.height || 0}px;`;
     }
-    return style
-})
+    return style;
+});
 // 二级菜单样式
 const twoTabCss = computed(() => {
-    let style = ''
-    if(config.search.control){
-        style += `top: calc(${ systemStore.topTabbarInfo.height || 0 }px + 94rpx) !important;`
-    }else{
-        style += `top: ${ systemStore.topTabbarInfo.height || 0 }px !important;`
+    let style = "";
+    if (config.search.control) {
+        style += `top: calc(${systemStore.topTabbarInfo.height || 0
+            }px + 94rpx) !important;`;
+    } else {
+        style += `top: ${systemStore.topTabbarInfo.height || 0}px !important;`;
     }
-    return style
-})
+    return style;
+});
 
 // 二级菜单弹窗样式
 const labelPopupCss = computed(() => {
-    let style = ''
+    let style = "";
     // #ifdef MP-WEIXIN
-    style = `padding-top: calc(${ systemStore.topTabbarInfo.height || 0 }px + 20rpx) !important;`
+    style = `padding-top: calc(${systemStore.topTabbarInfo.height || 0
+        }px + 20rpx) !important;`;
     // #endif
     // #ifdef H5
-    style = `padding-top: 20rpx !important;`
+    style = `padding-top: 20rpx !important;`;
     // #endif
-    return style
-})
-
-const goodsMaxBuy = () => {
-    list.value.forEach((data, index) => {
-        data.isMaxBuy = false;
-
-        let maxBuyNum = -1;
-        // 限购 - 是否开启限购
-        if (data.is_limit) {
-            if (data.max_buy) {
-                let max_buy = 0;
-                if (data.limit_type == 1) { //单次限购
-                    max_buy = data.max_buy;
-                } else { // 单人限购
-                    let buyVal = data.max_buy - (data.has_buy || 0);
-                    max_buy = buyVal > 0 ? buyVal : 0;
-                }
-
-                if (max_buy > data.stock) {
-                    maxBuyNum = data.stock
-                } else if (max_buy <= data.stock) {
-                    maxBuyNum = max_buy;
-                }
-            }
-        }
-        if (maxBuyNum == 0) {
-            data.isMaxBuy = true;
-        }
-    })
-}
+    return style;
+});
 
 const toLink = (goods_id: string) => {
-    redirect({ url: '/addon/shop/pages/goods/detail', param: { goods_id } })
-}
+    redirect({
+        url: "/addon/shop/pages/goods/detail",
+        param: { goodsId: goods_id },
+    });
+};
 
 onMounted(() => {
-    getCategoryData()
-})
+    getCategoryData();
+});
 
 //设置购物车动画
-const animationElStatus = ref('')
-const animationAddRepeatFlag = ref<Boolean>(false)
-const cartRepeatFlag = ref<Boolean>(false)
-const animationAddCart = (row: any, id: any) => {
-    if (animationAddRepeatFlag.value || cartRepeatFlag.value) return false
-    animationAddRepeatFlag.value = true
-    cartRepeatFlag.value = true
-
-    let obj: any = {
-        goods_id: row.goodsSku.goods_id,
-        sku_id: row.goodsSku.sku_id,
-        sale_price: goodsPrice(row),
-        stock: row.goodsSku.stock
-    };
-    if (row.id) {
-        obj.num = row.num;
-        obj.id = row.id;
-    }
-
-    // 起购
-    let num = 1;
-    if (row.min_buy > 0 && !row.num) {
-        num = row.min_buy;
-    } else {
-        num = 1;
-    }
+const animationElStatus = ref("");
 
-    cartStore.increase(obj, num, () => {
-        cartRepeatFlag.value = false
-    });
-    // #ifdef  MP-WEIXIN
-    setTimeout(() => {
-        uni.createSelectorQuery().in(instance).select('#animation-end').boundingClientRect((res: any) => {
-            uni.createSelectorQuery().in(instance).select('#' + id).boundingClientRect((position: any) => {
-                animationElStatus.value = `top: ${ position.top }px; left: ${ position.left }px;`
-                setTimeout(() => {
-                    animationElStatus.value = `top: ${ res.top + res.height / 2 - position.height / 3 }px; left: ${ res.left + res.width / 2 - position.width / 3 }px; transition: all 0.8s; transform: rotate(-720deg);`
-                }, 20);
-
-                setTimeout(() => {
-                    animationElStatus.value = ''
-                    animationAddRepeatFlag.value = false
-                }, 1020);
-
-            }).exec()
-
-        }).exec()
-    }, 100)
-    // #endif
-    // #ifdef  H5
-    setTimeout(() => {
-        const animationEnd: any = window.document.getElementById('animation-end');
-        const animationEndLeft = animationEnd.getBoundingClientRect().left;
-        const animationEndTop = animationEnd.getBoundingClientRect().top;
-
-        const itemCart: any = window.document.getElementById(id);
-        const itemCartLift = itemCart.getBoundingClientRect().left;
-        const itemCartTop = itemCart.getBoundingClientRect().top;
-        animationElStatus.value = `top: ${ itemCartTop }px; left: ${ itemCartLift }px;`
-
-        setTimeout(() => {
-            animationElStatus.value = `top: ${ animationEndTop + animationEnd.offsetHeight / 2 - itemCart.offsetHeight / 3 }px; left: ${ animationEndLeft + animationEnd.offsetWidth / 2 - itemCart.offsetHeight / 3 }px; transition: all 0.8s; transform: rotate(-720deg);`
-        }, 20);
-        setTimeout(() => {
-            animationElStatus.value = ''
-            animationAddRepeatFlag.value = false
-        }, 1020);
-
-    }, 100);
-    // #endif
-}
-
-const tabsData: any = ref<Array<Object>>([])
+const tabsData: any = ref<Array<Object>>([]);
 const getCategoryData = () => {
     loading.value = true;
-    getGoodsCategoryTree().then((res: any) => {
-        tabsData.value = res.data;
-        for (let i = 0; i < tabsData.value.length; i++) {
-            if (tabsData.value[i].child_list) {
-                let obj = {
-                    category_name: "全部",
-                    category_id: tabsData.value[i].category_id
-                };
-                tabsData.value[i].child_list.unshift(obj)
-            }
-        }
-        if (categoryId) {
+    getGoodsCategoryTree({ platform: 0 })
+        .then((res: any) => {
+            tabsData.value = res.data;
             for (let i = 0; i < tabsData.value.length; i++) {
-                if (tabsData.value[i].category_id == categoryId) {
-                    tabActive.value = i;
-                    break;
+                if (tabsData.value[i].children) {
+                    let obj = {
+                        label: "全部",
+                        id: '',
+                    };
+                    tabsData.value[i].children.unshift(obj);
                 }
-                if (tabsData.value[i].child_list) {
-                    for (let k = 0; k < tabsData.value[i].child_list.length; k++) {
-                        if (tabsData.value[i].child_list[k].category_id == categoryId) {
-                            tabActive.value = i;
-                            subActive.value = k;
-                            break;
+            }
+            if (categoryId) {
+                for (let i = 0; i < tabsData.value.length; i++) {
+                    if (tabsData.value[i].id == categoryId) {
+                        tabActive.value = i;
+                        break;
+                    }
+                    if (tabsData.value[i].children) {
+                        for (let k = 0; k < tabsData.value[i].children.length; k++) {
+                            if (tabsData.value[i].children[k].id == categoryId) {
+                                tabActive.value = i;
+                                subActive.value = k;
+                                break;
+                            }
                         }
                     }
                 }
+            } else {
+                categoryId = res.data[0].id;
             }
-        } else {
-            categoryId = res.data[0].category_id;
-        }
-        loading.value = false;
-    }).catch(() => {
-        loading.value = false;
-    });
-}
+            loading.value = false;
+        })
+        .catch(() => {
+            loading.value = false;
+        });
+};
 
 // 一级菜单样式控制
-const tabActive = ref<number>(0)
+const tabActive = ref<number>(0);
 // 二级菜单样式控制
-const subActive = ref<number>(0)
+const subActive = ref<number>(0);
 
 // 一级菜单点击事件
-const firstLevelClick = (index: number, data: any) => {
+const firstLevelClick = (index: any, data: any) => {
     tabActive.value = index;
-    labelPopup.value = false
-    if (data.child_list && data.child_list.length) {
-        subMenuClick(0, data.child_list[0]);
+    labelPopup.value = false;
+    mediumCategoryId.value = null;
+    if (data.children && data.children.length) {
+        subMenuClick(0, data, 1);
     } else {
-        categoryId = data.category_id;
+        categoryId = data.id;
         list.value = [];
         getMescroll().resetUpScroll();
     }
-}
+};
 
 /**
  * @description 二级菜单点击事件
  * @param {number} index
  * @param {Object} data
  * */
-const subMenuClick = (index: number, data: any) => {
+const subMenuClick = (index: any, data: any, type: number) => {
     subActive.value = index;
-    categoryId = data.category_id;
-    labelPopup.value = false
+    if (type == 1) {
+        categoryId = data.id;
+    } else {
+        mediumCategoryId.value = data.id;
+    }
+    labelPopup.value = false;
     list.value = [];
     getMescroll().resetUpScroll();
-}
+};
 
 // 搜索名字
 const searchNameFn = () => {
-    // getMescroll().resetUpScroll();
-    // if(searchName.value)
-    redirect({ url: '/addon/shop/pages/goods/list', param: { goods_name: encodeURIComponent(searchName.value) } })
-}
-
-//点击商品购物车按钮
-const cartRef = ref()
-const itemCart = (row: any, id: any) => {
-    // 虚拟商品,并且需要核销,禁止加入购物车
-    if (row.goods_type == 'virtual' && row.virtual_receive_type == 'verify') {
-        return toLink(row.goodsSku.goods_id)
-    }
-
-    if (config.cart.event !== 'cart') {
-        return toLink(row.goods_id)
-    }
-
-    if (!userInfo.value) {
-        useLogin().setLoginBack({ url: '/addon/shop/pages/goods/category' })
-        return false
-    }
-
-    if (row.goodsSku.sku_spec_format) {
-        cartRef.value.open(row.goodsSku.sku_id)
-    } else {
-        //单规格添加购物车
-        if (!row.goodsSku.stock || parseInt(row.goodsSku.num || 0) > parseInt(row.goodsSku.stock)) {
-            uni.showToast({ title: '商品库存不足', icon: 'none' })
-            return;
-        }
-        if (row.min_buy && row.min_buy > parseInt(row.stock)) {
-            uni.showToast({ title: '商品库存小于起购数量', icon: 'none' })
-            return;
-        }
-        animationAddCart(row, id)
-    }
-}
-
-//点击购物车加号 添加数量
-const addCartBtn = (item: any, row: any, id: string) => {
-    if (parseInt(row.num) >= parseInt(row.stock)) {
-        uni.showToast({ title: '商品库存不足', icon: 'none' })
-        return;
-    }
-
-    // 起购
-    let num = row.num;
-    if (item.min_buy > 0 && item.min_buy > row.num) {
-        num = item.min_buy;
-    }
-
-    /************** 限购-start *****************/
-    // let maxBuyNum = -1;
-    // 限购 - 是否开启限购
-    if (item.is_limit && item.max_buy) {
-        let max_buy = 0;
-        if (item.limit_type == 1) { //单次限购
-            max_buy = item.max_buy;
-        } else { // 单人限购
-            let buyVal = item.max_buy - (item.has_buy || 0);
-            max_buy = buyVal > 0 ? buyVal : 0;
-        }
-
-        // if(max_buy > item.goodsSku.stock){
-        // 	maxBuyNum = item.goodsSku.stock
-        // }else if(max_buy <= item.goodsSku.stock){
-        // 	maxBuyNum = max_buy;
-        // }
-    }
-    if (item.is_limit && num >= item.max_buy) {
-        let tips = `该商品单次限购${ item.max_buy }件`;
-        if (item.limit_type != 1) { //单次限购
-            tips = `该商品每人限购${ item.max_buy }件`;
-        }
-        uni.showToast({ title: tips, icon: 'none' })
-        return false;
-    }
-    /************** 限购-end *****************/
-
-    let obj = cloneDeep(item)
-    obj.num = num;
-    obj.id = row.id;
-    animationAddCart(obj, id)
-}
-
-//点击购物车减号
-const reduceCart = (data: any, row: any) => {
-    if (cartRepeatFlag.value) return false
-    cartRepeatFlag.value = true
-
-    let reduceNum = 1;
-    if (data.min_buy > 0 && data.min_buy == row.num) {
-        reduceNum = data.min_buy;
-    }
-
-    cartStore.reduce({
-        id: row.id,
-        goods_id: row.goods_id,
-        sku_id: row.sku_id,
-        stock: row.stock,
-        sale_price: row.sale_price,
-        num: row.num
-    }, reduceNum, () => {
-        cartRepeatFlag.value = false
-    })
-
-}
-
-//进入购物车
-const toCart = () => {
-    redirect({ url: '/addon/shop/pages/goods/cart' })
-}
-
-//强制绑定手机号
-const bindMobileRef: any = ref(null)
-const isBindMobile = ref(uni.getStorageSync('isBindMobile'))
-
-/**
- * 结算
- */
-const settlement = () => {
-
-    // #ifdef H5
-    // 绑定手机号
-    // if(uni.getStorageSync('isBindMobile')){
-    // 	bindMobileRef.value.open()
-    // 	return false
-    // }
-    // #endif
-
-    if (!totalNum.value) {
-        uni.showToast({ title: '还没有选择商品', icon: 'none' })
-        return
-    }
-    const cart_ids: any = []
-    Object.values(cartList.value).forEach(item => {
-        Object.keys(item).forEach(v => {
-            if (v != 'totalNum' && v != 'totalMoney') cart_ids.push(item[v].id)
-        })
-    })
-    if (cart_ids.length == 0) {
-        return;
-    }
-    uni.setStorage({
-        key: 'orderCreateData',
-        data: { cart_ids },
-        success() {
-            redirect({ url: '/addon/shop/pages/order/payment' })
-        }
-    })
-}
-
-// 价格类型
-const priceType = (data: any) => {
-	return data.goodsSku.show_type
-}
-
-// 商品价格
-const goodsPrice = (data: any) => {
-	return data.goodsSku.show_price
-}
+    getMescroll().resetUpScroll();
+};
 </script>
 
 <style lang="scss" scoped>
@@ -761,12 +475,12 @@ const goodsPrice = (data: any) => {
 
 .search-box .search-ipt {
     height: 58rpx;
-    background-color: #F6F8F8;
+    background-color: #f6f8f8;
     border-radius: 33rpx;
 }
 
 .search-box .search-ipt .input-placeholder {
-    color: #A5A6A6;
+    color: #a5a6a6;
 }
 
 .tabs-box {
@@ -795,7 +509,7 @@ const goodsPrice = (data: any) => {
         left: 0;
         top: 50%;
         transform: translateY(-50%);
-        content: '';
+        content: "";
         width: 6rpx;
         height: 48rpx;
         background-color: var(--primary-color);
@@ -807,7 +521,7 @@ const goodsPrice = (data: any) => {
         left: 0;
         top: 50%;
         transform: translateY(-50%);
-        content: '';
+        content: "";
         width: 6rpx;
         height: 48rpx;
         background-color: var(--primary-color);

+ 90 - 19
src/addon/shop/pages/goods/list.vue

@@ -18,7 +18,7 @@
                 <view class=" flex items-center justify-between text-[26rpx] flex-1">
                     <text class="text-[#333]" :class="{ 'text-[var(--primary-color)] font-500': searchType == 'all' }"
                         @click="searchTypeFn('all')">综合排序</text>
-                    <view class="flex items-center text-[#333]"
+                    <!-- <view class="flex items-center text-[#333]"
                         :class="{ 'text-[var(--primary-color)] font-500': searchType == 'stock' }"
                         @click="searchTypeFn('stock')">
                         <text class="mr-[4rpx]">库存</text>
@@ -28,6 +28,11 @@
                         <text v-else-if="searchType === 'stock'"
                             class="text-[16rpx] nc-iconfont nc-icon-a-xiangxiaV6xx1"
                             :class="{ 'text-[var(--primary-color)]': searchType == 'stock' }"></text>
+                    </view> -->
+                    <view class="flex items-center"
+                        :class="{ 'text-[var(--primary-color)] font-500': searchType == 'isSelf' }"
+                        @click="searchTypeFn('isSelf')">
+                        <text class="mr-[8rpx]">{{ cusType == 'all' ? '是否自营' : cusType == 1 ? '自营' : '非自营' }}</text>
                     </view>
                     <view class="flex items-center text-[#333]"
                         :class="{ 'text-[var(--primary-color)] font-500': searchType == 'price' }"
@@ -59,9 +64,8 @@
                             class="truncate text-[#333] border-[2rpx] border-solid border-transparent w-[162rpx] h-[56rpx] flex items-center justify-center mr-[20rpx] mb-[30rpx] box-border bg-[var(--temp-bg)] rounded-[50rpx] text-[24rpx]">
                             全部
                         </text>
-                        <text @click="loadCategory(item.id, subItem.id)"
-                            v-for="(subItem, index) in item.children" :key="subItem.id"
-                            :class="{ 'label-select': mediumCategoryId == subItem.id }"
+                        <text @click="loadCategory(item.id, subItem.id)" v-for="(subItem, index) in item.children"
+                            :key="subItem.id" :class="{ 'label-select': mediumCategoryId == subItem.id }"
                             class="truncate text-[#333] border-[2rpx] border-solid border-transparent w-[162rpx] h-[56rpx] flex items-center justify-center mr-[20rpx] mb-[30rpx] box-border bg-[var(--temp-bg)] rounded-[50rpx] text-[24rpx]">
                             {{ subItem.label }}
                         </text>
@@ -70,6 +74,25 @@
             </view>
         </u-popup>
 
+        <u-popup :show="cusPopup" mode="top" @close="cusPopup = false">
+            <view @touchmove.prevent.stop class="h-[50vh] overflow-auto mt-[30rpx]">
+                <view class="flex flex-wrap pl-[20rpx] pt-[20rpx]">
+                    <text @click="onCub('all')" :class="{ 'label-select': cusType == 'all' }"
+                        class="truncate text-[#333] border-[2rpx] border-solid border-transparent w-[162rpx] h-[56rpx] flex items-center justify-center mr-[20rpx] mb-[30rpx] box-border bg-[var(--temp-bg)] rounded-[50rpx] text-[24rpx]">
+                        全部
+                    </text>
+                    <text @click="onCub(1)" :class="{ 'label-select': cusType == 1 }"
+                        class="truncate text-[#333] border-[2rpx] border-solid border-transparent w-[162rpx] h-[56rpx] flex items-center justify-center mr-[20rpx] mb-[30rpx] box-border bg-[var(--temp-bg)] rounded-[50rpx] text-[24rpx]">
+                        自营
+                    </text>
+                    <text @click="onCub(0)" :class="{ 'label-select': cusType == 0 }"
+                        class="truncate text-[#333] border-[2rpx] border-solid border-transparent w-[162rpx] h-[56rpx] flex items-center justify-center mr-[20rpx] mb-[30rpx] box-border bg-[var(--temp-bg)] rounded-[50rpx] text-[24rpx]">
+                        非自营
+                    </text>
+                </view>
+            </view>
+        </u-popup>
+
         <mescroll-body ref="mescrollRef" top="176rpx" bottom="60px" @init="mescrollInit" :down="{ use: false }"
             @up="getAllAppListFn">
             <view v-if="goodsList.length" :class="['sidebar-margin', !listType ? 'biserial-goods-list' : '']">
@@ -86,11 +109,18 @@
                         <view class="flex-1 flex flex-col ml-[20rpx] py-[6rpx]">
                             <view class="text-[28rpx] text-[#333] leading-[40rpx] multi-hidden mb-[10rpx]"></view>
                             <view class="text-[24rpx] text-[#999] leading-[30rpx] using-hidden mb-[8rrpx]">
+                                <view class="brand-tag"> {{ item.isSelf == 1 ? '自营商品' : '非自营' }} </view>
                                 {{ item.itemName }}
                             </view>
                             <view class="flex flex-wrap">
                                 <view class="base-tag" :style="diyGoods.baseTagStyle()">
-                                    起订{{ item.minOrderQuantity || 1 }}{{ item.unitName || '件' }}
+                                    {{ 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-baseline">
@@ -102,9 +132,13 @@
                                         <text class="text-[24rpx] font-500">.{{
                                             diyGoods.goodsPrice(item).toFixed(2).split('.')[1] }}</text>
                                     </view>
+                                    <view class="ml-[12rpx] text-[var(--text-color-light9)] text-[22rpx]"
+                                        style="text-decoration: line-through">
+                                        ¥{{ item.marketPrice }}
+                                    </view>
                                 </view>
                                 <text class="text-[22rpx] mt-[20rpx] text-[var(--text-color-light9)]">
-                                    库存:{{ item.totalInventory || 0 }}
+                                    起订{{ item.minOrderQuantity || 1 }}{{ item.unitName || '件' }}
                                 </text>
                             </view>
                         </view>
@@ -127,12 +161,16 @@
 
                                 <view class="px-[20rpx] flex-1 pt-[16rpx] pb-[24rpx] flex flex-col justify-between">
                                     <view class="text-[24rpx] text-[#999] leading-[30rpx] using-hidden my-[5rpx]">
+                                        <view class="brand-tag"> {{ item.isSelf == 1 ? '自营商品' : '非自营' }} </view>
                                         {{ item.itemName }}
                                     </view>
                                     <view class="flex flex-wrap">
-                                        <view class="base-tag" :style="diyGoods.baseTagStyle()">起订{{
-                                            item.minOrderQuantity || 1 }}{{ item.unitName || '件' }}
-                                        </view>
+                                        <view class="base-tag" :style="diyGoods.baseTagStyle()">{{ item.brandName || ''
+                                        }}</view>
+                                        <view class="base-tag" :style="diyGoods.baseTagStyle()">{{
+                                            item.bottomCategoryName || '' }}</view>
+                                        <view v-if="item.isCustomize == 1" class="base-tag"
+                                            :style="diyGoods.baseTagStyle()">可定制</view>
                                     </view>
                                     <view class="flex justify-between flex-wrap items-end">
                                         <view class="flex items-baseline mt-[20rpx]">
@@ -143,9 +181,13 @@
                                                 <text class="text-[24rpx] font-500">.{{
                                                     diyGoods.goodsPrice(item).toFixed(2).split('.')[1] }}</text>
                                             </view>
+                                            <view class="ml-[12rpx] text-[var(--text-color-light9)] text-[22rpx]"
+                                                style="text-decoration: line-through">
+                                                ¥{{ item.marketPrice }}
+                                            </view>
                                         </view>
-                                        <text class="text-[22rpx] text-[var(--text-color-light9)] mt-[20rpx]"> 库存:{{
-                                            item.totalInventory || 0 }}</text>
+                                        <text class="text-[22rpx] text-[var(--text-color-light9)] mt-[20rpx]"> 起订{{
+                                            item.minOrderQuantity || 1 }}{{ item.unitName || '件' }}</text>
                                     </view>
                                 </view>
                             </view>
@@ -166,12 +208,16 @@
                                 <view class="px-[20rpx] flex-1 pt-[16rpx] pb-[24rpx] flex flex-col justify-between">
                                     <view class="text-[#303133] leading-[40rpx] text-[28rpx] multi-hidden"></view>
                                     <view class="text-[24rpx] text-[#999] leading-[30rpx] using-hidden my-[5rpx]">
+                                        <view class="brand-tag"> {{ item.isSelf == 1 ? '自营商品' : '非自营' }} </view>
                                         {{ item.itemName }}
                                     </view>
                                     <view class="flex flex-wrap">
-                                        <view class="base-tag" :style="diyGoods.baseTagStyle()">
-                                            起订{{ item.minOrderQuantity || 1 }}{{ item.unitName || '件' }}
-                                        </view>
+                                        <view class="base-tag" :style="diyGoods.baseTagStyle()">{{ item.brandName || ''
+                                        }}</view>
+                                        <view class="base-tag" :style="diyGoods.baseTagStyle()">{{
+                                            item.bottomCategoryName || '' }}</view>
+                                        <view v-if="item.isCustomize == 1" class="base-tag"
+                                            :style="diyGoods.baseTagStyle()">可定制</view>
                                     </view>
                                     <view class="flex justify-between flex-wrap items-baseline">
                                         <view class="flex items-baseline mt-[20rpx]">
@@ -182,9 +228,13 @@
                                                 <text class="text-[24rpx] font-500">.{{
                                                     diyGoods.goodsPrice(item).toFixed(2).split('.')[1] }}</text>
                                             </view>
+                                            <view class="ml-[12rpx] text-[var(--text-color-light9)] text-[22rpx]"
+                                                style="text-decoration: line-through">
+                                                ¥{{ item.marketPrice }}
+                                            </view>
                                         </view>
-                                        <text class="mt-[20rpx] text-[22rpx] text-[var(--text-color-light9)]">库存:{{
-                                            item.totalInventory || 0 }}</text>
+                                        <text class="mt-[20rpx] text-[22rpx] text-[var(--text-color-light9)]">起订{{
+                                            item.minOrderQuantity || 1 }}{{ item.unitName || '件' }}</text>
                                     </view>
                                 </view>
                             </view>
@@ -226,6 +276,9 @@ const goods_name = ref("");
 const searchType = ref('all');
 //列表类型
 const listType = ref(true)
+//定制
+const cusPopup = ref(false);
+const cusType = ref<any>('all');
 
 // 新增:用于存储当前排序方式(Asc / Desc)
 const currentSortOrder = ref('Asc');
@@ -235,6 +288,9 @@ onLoad(async (option: any) => {
     // 处理小程序场景值参数
     option = handleOnloadParams(option);
     // #endif
+    if (option.topCategoryId) topCategoryId.value = option.topCategoryId;
+    if (option.mediumCategoryId) mediumCategoryId.value = option.mediumCategoryId;
+    if (option.goods_name) goods_name.value = option.goods_name;
     currGoodsCategory.value = option.curr_goods_category || ''
     goods_name.value = option.goods_name ? decodeURIComponent(option.goods_name) : ''
     await getGoodsCategoryTree({ platform: 0 }).then((res: any) => {
@@ -269,12 +325,13 @@ const getAllAppListFn = (mescroll: mescrollStructure) => {
     }
 
     let data: object = {
-        topCategoryId: mediumCategoryId.value,
+        topCategoryId: topCategoryId.value,
         mediumCategoryId: mediumCategoryId.value,
         pageNum: mescroll.num,
         pageSize: mescroll.size,
         searchKeyword: goods_name.value,
         sortField,
+        isSelf: cusType.value == 'all' ? '' : cusType.value,
         sortOrder
     };
 
@@ -299,10 +356,10 @@ onPageScroll((e) => {
 })
 
 const loadCategory = (id: string, cid: any) => {
-    if(cid == ''){
+    if (cid == '') {
         topCategoryId.value = id;
         mediumCategoryId.value = '';
-    }else{
+    } else {
         topCategoryId.value = id;
         mediumCategoryId.value = cid;
     }
@@ -311,12 +368,25 @@ const loadCategory = (id: string, cid: any) => {
     labelPopup.value = false;
 }
 
+const onCub = (res: any) => {
+    cusType.value = res;
+    goodsList.value = [];
+    getMescroll().resetUpScroll();
+    cusPopup.value = false;
+}
+
 // 搜索
 const searchTypeFn = (type: any) => {
     if (type === 'label') {
+        cusPopup.value = false;
         labelPopup.value = true;
         return;
     }
+    if (type === 'isSelf') {
+        labelPopup.value = false;
+        cusPopup.value = true;
+        return;
+    }
 
     // 切换排序类型时重置顺序为 Asc
     if (searchType.value !== type) {
@@ -328,6 +398,7 @@ const searchTypeFn = (type: any) => {
 
     searchType.value = type;
     labelPopup.value = false;
+    cusPopup.value = false;
     goodsList.value = [];
     getMescroll().resetUpScroll();
 }

+ 0 - 7
src/addon/shop/pages/index.vue

@@ -13,13 +13,6 @@
             </view>
 
         </view>
-
-        <!-- #ifdef MP-WEIXIN -->
-        <!-- 收藏小程序提示 -->
-        <collect-tip ref="collectTipRef" ></collect-tip>
-        <!-- 小程序隐私协议 -->
-        <wx-privacy-popup ref="wxPrivacyPopupRef"></wx-privacy-popup>
-        <!-- #endif -->
     </view>
 </template>
 

+ 1 - 1
src/addon/shop/pages/order/detail.vue

@@ -61,7 +61,7 @@
                         </view>
                     </view>
                 </view>
-                <view class="sidebar-margin mt-[var(--top-m)] card-template">
+                <view class="sidebar-margin mt-[var(--top-m)] card-template" v-if="progressSteps && progressSteps.length>0">
                     <u-steps :current="currentStep" dot direction="column" activeColor="var(--primary-color)">
                         <template v-for="(item, index) in progressSteps" :key="index + 'id'">
                             <u-steps-item :title="item.title" :desc="item.time"></u-steps-item>

+ 115 - 73
src/app/components/diy/carousel-search/index.vue

@@ -1,7 +1,7 @@
 <template>
     <view :style="warpCss" class="goods-carousel-search-wrap">
         <view class="relative pb-[20rpx]">
-            <view class="bg-img" :class="{'!-bottom-[200rpx]': diyComponent.bgGradient == true}">
+            <view class="bg-img" :class="{ '!-bottom-[200rpx]': diyComponent.bgGradient == true }">
                 <image
                     v-if="diyComponent.swiper.control && diyComponent.swiper.list && diyComponent.swiper.list[swiperIndex].imageUrl"
                     :src="img(diyComponent.swiper.list[swiperIndex].imageUrl)" mode="scaleToFill" class="w-full h-full"
@@ -11,47 +11,70 @@
             </view>
             <view class="fixed-wrap" :style="fixedStyle">
                 <view v-if="diyComponent.search.style == 'style-1'" class="diy-search-wrap relative z-10"
-                      @click="diyStore.toRedirect(diyComponent.search.link)" :style="!props.global.topStatusBar.isShow ? navbarInnerStyle : ''">
-                    <!-- <view class="img-wrap" v-if="diyComponent.search.logo">	
-                        <image :src="img(diyComponent.search.logo)" mode="aspectFit" />
-                    </view> -->
-					  <image :src="img(diyComponent.search.logo)" v-if="diyComponent.search.logo" mode="aspectFit" class="max-h-[60rpx] w-[152rpx] mr-[20rpx]" />
-                    <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]" :style="{color: diyComponent.search.color }">{{ isShowSearchPlaceholder ? diyComponent.search.text : '' }}</text>
-                        <text class="nc-iconfont nc-icon-sousuo-duanV6xx1 w-[80rpx] h-[52rpx] flex items-center justify-center rounded-[50rpx] text-[28rpx] text-[#fff]"
-                            :style="{backgroundColor: diyComponent.search.btnBgColor, color: diyComponent.search.btnColor }"></text>
-                        <swiper class="swiper-wrap" :interval="diyComponent.search.hotWord.interval * 1000" autoplay="true" vertical="true" circular="true" v-if="!isShowSearchPlaceholder">
-                            <swiper-item class="swiper-item" v-for="(item) in diyComponent.search.hotWord.list" :key="item.id">
-                                <view class="leading-[64rpx] text-[24rpx]" :style="{color: diyComponent.search.color }">{{ item.text }}</view>
+                    @click="diyStore.toRedirect(diyComponent.search.link)"
+                    :style="!props.global.topStatusBar.isShow ? navbarInnerStyle : ''">
+                    <image :src="img(diyComponent.search.logo)" v-if="diyComponent.search.logo" mode="aspectFit"
+                        class="max-h-[60rpx] w-[152rpx] mr-[20rpx]" />
+                    <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]"
+                            :style="{ color: diyComponent.search.color }">{{ isShowSearchPlaceholder ?
+                                diyComponent.search.text : '' }}</text>
+                        <text
+                            class="nc-iconfont nc-icon-sousuo-duanV6xx1 w-[80rpx] h-[52rpx] flex items-center justify-center rounded-[50rpx] text-[28rpx] text-[#fff]"
+                            :style="{ backgroundColor: diyComponent.search.btnBgColor, color: diyComponent.search.btnColor }"></text>
+                        <swiper class="swiper-wrap" :interval="diyComponent.search.hotWord.interval * 1000"
+                            autoplay="true" vertical="true" circular="true" v-if="!isShowSearchPlaceholder">
+                            <swiper-item class="swiper-item" v-for="(item) in diyComponent.search.hotWord.list"
+                                :key="item.id">
+                                <view class="leading-[64rpx] text-[24rpx]"
+                                    :style="{ color: diyComponent.search.color }">
+                                    {{ item.text }}</view>
                             </swiper-item>
                         </swiper>
                     </view>
                 </view>
-                <view v-if="diyComponent.search.style == 'style-2'" class="diy-search-wrap style-2 relative z-10" @click="diyStore.toRedirect(diyComponent.search.link)">
+                <view v-if="diyComponent.search.style == 'style-2'" class="diy-search-wrap style-2 relative z-10"
+                    @click="diyStore.toRedirect(diyComponent.search.link)">
                     <view class="flex items-center" :style="!props.global.topStatusBar.isShow ? navbarInnerStyle : ''">
-                        <!-- <view class="img-wrap" v-if="diyComponent.search.logo"><image :src="img(diyComponent.search.logo)" mode="aspectFit" /></view> -->
-						  <image :src="img(diyComponent.search.logo)" v-if="diyComponent.search.logo" mode="aspectFit" class="max-h-[60rpx] w-[152rpx] mr-[10rpx]" />
-                        <view :style="searchSubTitleCss" class="max-w-[360rpx] text-[24rpx] h-[38rpx] rounded-r-[20rpx] rounded-t-[20rpx] rounded-bl-[2rpx]" v-if="diyComponent.search.subTitle.text">
-                            <view class="truncate leading-[38rpx] h-[38rpx]  px-[12rpx]">{{ diyComponent.search.subTitle.text }}</view>
+                        <image :src="img(diyComponent.search.logo)" v-if="diyComponent.search.logo" mode="aspectFit"
+                            class="max-h-[60rpx] w-[152rpx] mr-[10rpx]" />
+                        <view :style="searchSubTitleCss"
+                            class="max-w-[360rpx] text-[24rpx] h-[38rpx] rounded-r-[20rpx] rounded-t-[20rpx] rounded-bl-[2rpx]"
+                            v-if="diyComponent.search.subTitle.text">
+                            <view class="truncate leading-[38rpx] h-[38rpx]  px-[12rpx]">{{
+                                diyComponent.search.subTitle.text }}</view>
                         </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 @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 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]" :style="{color: diyComponent.search.color }">{{ isShowSearchPlaceholder ? diyComponent.search.text : '' }}</text>
-                            <text class="nc-iconfont nc-icon-sousuo-duanV6xx1 w-[80rpx] h-[52rpx] flex items-center justify-center rounded-[50rpx] text-[28rpx] text-[#fff]"
-                                :style="{backgroundColor: diyComponent.search.btnBgColor, color: diyComponent.search.btnColor }"></text>
+                        <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]"
+                                :style="{ color: diyComponent.search.color }">{{ isShowSearchPlaceholder ?
+                                    diyComponent.search.text : '' }}</text>
+                            <text
+                                class="nc-iconfont nc-icon-sousuo-duanV6xx1 w-[80rpx] h-[52rpx] flex items-center justify-center rounded-[50rpx] text-[28rpx] text-[#fff]"
+                                :style="{ backgroundColor: diyComponent.search.btnBgColor, color: diyComponent.search.btnColor }"></text>
                             <swiper class="swiper-wrap" :interval="diyComponent.search.hotWord.interval * 1000"
-                                    autoplay="true" vertical="true" circular="true" v-if="!isShowSearchPlaceholder">
-                                <swiper-item class="swiper-item" v-for="(item) in diyComponent.search.hotWord.list" :key="item.id">
-                                    <view class="leading-[64rpx] text-[24rpx]" :style="{color: diyComponent.search.color }">{{ item.text }}</view>
+                                autoplay="true" vertical="true" circular="true" v-if="!isShowSearchPlaceholder">
+                                <swiper-item class="swiper-item" v-for="(item) in diyComponent.search.hotWord.list"
+                                    :key="item.id">
+                                    <view class="leading-[64rpx] text-[24rpx]"
+                                        :style="{ color: diyComponent.search.color }">{{ item.text }}</view>
                                 </swiper-item>
                             </swiper>
                         </view>
@@ -60,76 +83,91 @@
 
                 <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 class="line" :style="{'background-color': getTabColor(currTabIndex == -1)}" v-if="currTabIndex == -1"></view> -->
+                        <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 class="line" :style="{'background-color': getTabColor(index == currTabIndex)}" v-if="index == currTabIndex"></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 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"
+                    <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'">
-                <view v-if="diyComponent.positionWay == 'fixed' && props.scrollBool != undefined && props.scrollBool != -1"
+                <view
+                    v-if="diyComponent.positionWay == 'fixed' && props.scrollBool != undefined && props.scrollBool != -1"
                     class="u-navbar-placeholder" :style="{ width: '100%', paddingTop: moduleHeight }"></view>
             </template>
 
             <!-- 轮播图 -->
-            <view class="relative" :class="{'mx-[20rpx]': swiperStyleBool && diyComponent.swiper.swiperStyle != 'style-3', 'swiper-style-3': diyComponent.swiper.swiperStyle == 'style-3'}" :style="carouselSwiperStyle()">
+            <view class="relative"
+                :class="{ 'mx-[20rpx]': swiperStyleBool && diyComponent.swiper.swiperStyle != 'style-3', 'swiper-style-3': diyComponent.swiper.swiperStyle == 'style-3' }"
+                :style="carouselSwiperStyle()">
                 <swiper v-if="diyComponent.swiper.control" class="swiper" :style="{ height: imgHeight }" autoplay="true"
-                        circular="true" @change="swiperChange"
-                        :class="{ 'swiper-left': diyComponent.swiper.indicatorAlign == 'left', 'swiper-right': diyComponent.swiper.indicatorAlign == 'right', 'ns-indicator-dots': diyComponent.swiper.indicatorStyle == 'style-2', 'ns-indicator-dots-three': diyComponent.swiper.indicatorStyle == 'style-3' }"
-                        :previous-margin="swiperStyleBool ? 0 : '26rpx'" :next-margin="swiperStyleBool ? 0 : '26rpx'"
-                        :interval="diyComponent.swiper.interval * 1000" :indicator-dots="isShowDots"
-                        :indicator-color="diyComponent.swiper.indicatorColor"
-                        :indicator-active-color="diyComponent.swiper.indicatorActiveColor">
-                    <swiper-item class="swiper-item" v-for="(item,index) in diyComponent.swiper.list" :key="item.id" :style="swiperWarpCss">
+                    circular="true" @change="swiperChange"
+                    :class="{ 'swiper-left': diyComponent.swiper.indicatorAlign == 'left', 'swiper-right': diyComponent.swiper.indicatorAlign == 'right', 'ns-indicator-dots': diyComponent.swiper.indicatorStyle == 'style-2', 'ns-indicator-dots-three': diyComponent.swiper.indicatorStyle == 'style-3' }"
+                    :previous-margin="swiperStyleBool ? '0' : '26rpx'" :next-margin="swiperStyleBool ? '0' : '26rpx'"
+                    :interval="diyComponent.swiper.interval * 1000" :indicator-dots="isShowDots"
+                    :indicator-color="diyComponent.swiper.indicatorColor"
+                    :indicator-active-color="diyComponent.swiper.indicatorActiveColor">
+                    <swiper-item class="swiper-item" v-for="(item, index) in diyComponent.swiper.list" :key="item.id"
+                        :style="swiperWarpCss">
                         <view @click="diyStore.toRedirect(item.link)">
-                            <view class="item" :style="{height: imgHeight}">
-                                <image v-if="item.imageUrl" :src="img(item.imageUrl)" mode="scaleToFill" :style="swiperWarpCss"
-                                       :class="['w-full h-full',{'swiper-animation': (swiperIndex != index && diyComponent.swiper.indicatorStyle != 'style-3')}]"
-                                       :show-menu-by-longpress="true" />
+                            <view class="item" :style="{ height: imgHeight }">
+                                <image v-if="item.imageUrl" :src="img(item.imageUrl)" mode="scaleToFill"
+                                    :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"
-                                       mode="scaleToFill"
-                                       :class="['w-full h-full',{'swiper-animation': (swiperIndex != index && diyComponent.swiper.indicatorStyle != 'style-3')}]"
-                                       :show-menu-by-longpress="true" />
+                                    mode="scaleToFill"
+                                    :class="['w-full h-full', { 'swiper-animation': (swiperIndex != index && diyComponent.swiper.indicatorStyle != 'style-3') }]"
+                                    :show-menu-by-longpress="true" />
                             </view>
                         </view>
                     </swiper-item>
                 </swiper>
                 <!-- #ifdef MP-WEIXIN -->
                 <view v-if="diyComponent.swiper.list.length > 1" :class="[
-						'swiper-dot-box',
-						{ 'straightLine': diyComponent.swiper.indicatorStyle == 'style-2' },
-						{ 'straightLineStyle2': diyComponent.swiper.indicatorStyle == 'style-3' },
-						{ 'swiper-left': diyComponent.swiper.indicatorAlign == 'left' },
-						{ 'swiper-right': diyComponent.swiper.indicatorAlign == 'right' }
-					]">
+                    'swiper-dot-box',
+                    { 'straightLine': diyComponent.swiper.indicatorStyle == 'style-2' },
+                    { 'straightLineStyle2': diyComponent.swiper.indicatorStyle == 'style-3' },
+                    { 'swiper-left': diyComponent.swiper.indicatorAlign == 'left' },
+                    { 'swiper-right': diyComponent.swiper.indicatorAlign == 'right' }
+                ]">
                     <view v-for="(numItem, numIndex) in diyComponent.swiper.list" :key="numIndex"
-                          :class="['swiper-dot', { active: numIndex == swiperIndex }]"
-                          :style="[numIndex == swiperIndex ? { backgroundColor: diyComponent.swiper.indicatorActiveColor } : { backgroundColor: diyComponent.swiper.indicatorColor }]"></view>
+                        :class="['swiper-dot', { active: numIndex == swiperIndex }]"
+                        :style="[numIndex == swiperIndex ? { backgroundColor: diyComponent.swiper.indicatorActiveColor } : { backgroundColor: diyComponent.swiper.indicatorColor }]">
+                    </view>
                 </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="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 @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>
@@ -182,7 +220,7 @@ locationVal.init();
 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;';
@@ -317,10 +355,10 @@ const bgImgBoxStyle = computed(() => {
     if (str.indexOf('(') > -1) {
         let arr = str.split('(')[1].split(')')[0].split(',');
         if (diyComponent.value.bgGradient == true) {
-            style += `background: linear-gradient(rgba(${ arr[0] }, ${ arr[1] }, ${ arr[2] }, 0) 65%, rgba(${ arr[0] }, ${ arr[1] }, ${ arr[2] }, 0.6) 70%, rgba(${ arr[0] }, ${ arr[1] }, ${ arr[2] }, 0.85) 80%, rgba(${ arr[0] }, ${ arr[1] }, ${ arr[2] }, 0.95) 90%,  rgb(${ arr[0] }, ${ arr[1] }, ${ arr[2] }, 1) 100%);`;
+            style += `background: linear-gradient(rgba(${arr[0]}, ${arr[1]}, ${arr[2]}, 0) 65%, rgba(${arr[0]}, ${arr[1]}, ${arr[2]}, 0.6) 70%, rgba(${arr[0]}, ${arr[1]}, ${arr[2]}, 0.85) 80%, rgba(${arr[0]}, ${arr[1]}, ${arr[2]}, 0.95) 90%,  rgb(${arr[0]}, ${arr[1]}, ${arr[2]}, 1) 100%);`;
         }
     } else {
-        style += `background: (${ str });`;
+        style += `background: (${str});`;
     }
     return style;
 });
@@ -353,7 +391,7 @@ const swiperWarpCss = computed(() => {
 const searchSubTitleCss = computed(() => {
     let style = '';
     if (diyComponent.value.search.subTitle.textColor) style += 'color:' + diyComponent.value.search.subTitle.textColor + ';';
-    if (diyComponent.value.search.subTitle.startColor && diyComponent.value.search.subTitle.endColor) style += `background:linear-gradient(${ diyComponent.value.search.subTitle.startColor }, ${ diyComponent.value.search.subTitle.endColor });`;
+    if (diyComponent.value.search.subTitle.startColor && diyComponent.value.search.subTitle.endColor) style += `background:linear-gradient(${diyComponent.value.search.subTitle.startColor}, ${diyComponent.value.search.subTitle.endColor});`;
     else style += 'background-color:' + (diyComponent.value.search.subTitle.startColor || diyComponent.value.search.subTitle.endColor) + ';';
     return style;
 })
@@ -473,7 +511,7 @@ const getDiyInfoFn = (id: any) => {
             diyPageData.value.forEach((item: any, index) => {
                 item.pageStyle = '';
                 if (item.pageStartBgColor) {
-                    if (item.pageStartBgColor && item.pageEndBgColor) item.pageStyle += `background:linear-gradient(${ item.pageGradientAngle },${ item.pageStartBgColor },${ item.pageEndBgColor });`;
+                    if (item.pageStartBgColor && item.pageEndBgColor) item.pageStyle += `background:linear-gradient(${item.pageGradientAngle},${item.pageStartBgColor},${item.pageEndBgColor});`;
                     else item.pageStyle += 'background-color:' + item.pageStartBgColor + ';';
                 }
 
@@ -504,7 +542,7 @@ isShowDots.value = false;
 // #endif
 
 /******************************* 存储滚动值-start ***********************/
-    // 键名和组件名一致即可
+// 键名和组件名一致即可
 let componentsScrollVal = uni.getStorageSync('componentsScrollValGroup')
 if (componentsScrollVal && (typeof componentsScrollVal == "object")) {
     componentsScrollVal.CarouselSearch = 20
@@ -530,7 +568,8 @@ if (componentsScrollVal && (typeof componentsScrollVal == "object")) {
         filter: blur(0);
         overflow: hidden;
 
-        uni-image, image {
+        uni-image,
+        image {
             -webkit-filter: blur(15px);
             filter: blur(15px);
             -webkit-transform: scale(2) translateY(15%);
@@ -538,7 +577,9 @@ if (componentsScrollVal && (typeof componentsScrollVal == "object")) {
         }
 
         &.no-filter {
-            uni-image, image {
+
+            uni-image,
+            image {
                 -webkit-filter: blur(0);
                 filter: blur(0);
             }
@@ -595,7 +636,8 @@ if (componentsScrollVal && (typeof componentsScrollVal == "object")) {
         flex: 1;
         position: relative;
 
-        .input-content, .uni-input {
+        .input-content,
+        .uni-input {
             box-sizing: border-box;
             display: block;
             height: 60rpx;

+ 8 - 7
src/app/pages/auth/login.vue

@@ -200,11 +200,11 @@ const getOpenid = () => {
 	uni.login({
 		provider: 'weixin',
 		success: function (loginRes) {
-			wxLogin({ code: loginRes.code })
+			wxLogin({ code: loginRes.code, clientId: '428a8310cd442757ae699df5d894f051' })
 				.then((res: any) => {
-					// // 登录成功,应跳转或处理 token
-					// memberStore.setToken(res.data.access_token);
-					// useLogin().handleLoginBack();
+					// 登录成功,应跳转或处理 token
+					memberStore.setToken(res.data.accessToken);
+					useLogin().handleLoginBack();
 				})
 				.catch((res: any) => {
 					if (res.code == 601) {
@@ -221,11 +221,12 @@ const getOpenid = () => {
 }
 const getphonenumber = async (res1: any) => {
 	if (res1.detail.errMsg == "getPhoneNumber:ok") {
-		loginByPhone({ code: res1.detail.code, openId: openId.value })
+		loginByPhone({ code: res1.detail.code, openId: openId.value, clientId: '428a8310cd442757ae699df5d894f051' })
 			.then((res2: any) => {
-
+				memberStore.setToken(res2.data.accessToken);
+				useLogin().handleLoginBack();
 			}).catch((res2: any) => {
-				if (res2.code == 500) {
+				if (res2.code == 601) {
 					redirect({ url: '/app/pages/auth/register' })
 				}
 			});

+ 4 - 4
src/app/pages/auth/register.vue

@@ -117,12 +117,12 @@ const formData = reactive({
 	password: "",
 	confirmPassword: "",
 	openId: "",
-	RegisterSource: ""
+	registerSource: ""
 });
 
 onLoad(async (option: any) => {
 	// #ifdef MP-WEIXIN
-	formData.RegisterSource = '2'
+	formData.registerSource = '2'
 	// #endif
 });
 
@@ -262,7 +262,7 @@ const handleRegister = () => {
 							formData.openId = res1.msg
 							registerMiniCustomer(formData).then((res: any) => {
 								if (res.code == 200) {
-									redirect({ url: '/wap/app/pages/auth/login', mode: 'redirectTo' })
+									redirect({ url: '/app/pages/auth/login', mode: 'redirectTo' })
 								}
 							}).catch(() => { loading.value = false; });
 						}
@@ -277,7 +277,7 @@ const handleRegister = () => {
 		// #ifndef MP-WEIXIN
 		registerMiniCustomer(formData).then((res: any) => {
 			if (res.code == 200) {
-				redirect({ url: '/wap/app/pages/auth/login', mode: 'redirectTo' })
+				redirect({ url: '/app/pages/auth/login', mode: 'redirectTo' })
 			}
 		}).catch(() => { loading.value = false; });
 		// #endif

+ 5 - 3
src/app/stores/diy.ts

@@ -133,13 +133,15 @@ const useDiyStore = defineStore('diy', {
             // #endif
         },
         toRedirect(data: any) {
-            if (Object.keys(data).length) {
-                if (!data.name) return;
+            if (data) {
                 if (currRoute() == 'app/pages/member/index' && !getToken()) {
                     useLogin().setLoginBack({ url: data.url })
                     return;
                 }
-                diyRedirect(data);
+                diyRedirect({
+                    url: data,
+                    name:''
+                });
             }
         },
     }

+ 1 - 1
src/components/mescroll/mescroll-uni/mescroll-uni-option.js

@@ -21,7 +21,7 @@ const GlobalOption = {
 		},
 		empty: {
 			use: true, // 是否显示空布局
-			icon: img("static/resource/images/system/empty.png") // 图标路径 (建议放入static目录, 如 /static/img/mescroll-empty.png )
+			icon: img("https://v6.site.niucloud.com/static/resource/images/system/empty.png") // 图标路径 (建议放入static目录, 如 /static/img/mescroll-empty.png )
 		}
 	},
 	// 国际化配置

+ 7 - 49
src/hooks/useLogin.ts

@@ -20,49 +20,7 @@ export function useLogin() {
     const setLoginBack = (data: redirectOptions) => {
         uni.setStorage({ key: 'loginBack', data })
         setTimeout(() => {
-            const config = useConfigStore()
-            const systemStore = useSystemStore()
-
-            // // #ifdef MP-WEIXIN
-
-            // if (!uni.getStorageSync('autoLoginLock')  && config.login.is_bind_mobile) {
-            //     uni.setStorageSync('isBindMobile', true) // 强制绑定手机号标识
-            // }
-            // // #endif
-
-            // // #ifdef H5
-            // if (!uni.getStorageSync('autoLoginLock') && isWeixinBrowser() && config.login.is_bind_mobile) {
-            //     uni.setStorageSync('isBindMobile', true) // 强制绑定手机号标识
-            // }
-            // // #endif
-
-            // 如果只开启了账号密码登录,就不需要跳转到登录中间页了,直接进入普通账号密码登录页面
-            // #ifdef MP-WEIXIN
-            if (config.login.is_username && !config.login.is_mobile && !config.login.is_auth_register) {
-                redirect({ url: '/app/pages/auth/login', param: { type: 'username' } })
-            } else if (systemStore.initStatus == 'finish' && !config.login.is_username && !config.login.is_mobile && !config.login.is_auth_register) {
-                uni.showToast({ title: '商家未开启登录注册', icon: 'none' })
-            } else {
-                redirect({ url: '/app/pages/auth/index' })
-            }
-            // #endif
-
-            // #ifdef H5
-            if (isWeixinBrowser()) {
-                // 微信浏览器
-                if (config.login.is_username && !config.login.is_mobile && !config.login.is_auth_register) {
-                    redirect({ url: '/app/pages/auth/login', param: { type: 'username' } })
-                } else if (systemStore.initStatus == 'finish' && !config.login.is_username && !config.login.is_mobile && !config.login.is_auth_register) {
-                    uni.showToast({ title: '商家未开启登录注册', icon: 'none' })
-                } else {
-                    redirect({ url: '/app/pages/auth/index' })
-                }
-            } else {
-                console.log('??????')
-                // 普通浏览器
-                redirect({ url: '/app/pages/auth/login', param: { type: 'username' } })
-            }
-            // #endif
+            redirect({ url: '/app/pages/auth/login', param: { type: 'username' } })
         })
     }
 
@@ -230,12 +188,12 @@ export function useLogin() {
         };
 
         // #ifdef MP-WEIXIN
-        updateWeappOpenid(obj).then((res) => {
-            useMemberStore().getMemberInfo(() => {
-                const memberInfo = useMemberStore().info
-                memberInfo && memberInfo.weapp_openid && uni.setStorageSync('openid', memberInfo.weapp_openid)
-            })
-        })
+        // updateWeappOpenid(obj).then((res) => {
+        //     useMemberStore().getMemberInfo(() => {
+        //         const memberInfo = useMemberStore().info
+        //         memberInfo && memberInfo.weapp_openid && uni.setStorageSync('openid', memberInfo.weapp_openid)
+        //     })
+        // })
         // #endif
 
         // #ifdef H5

BIN
src/static/logo.png


+ 6 - 5
src/stores/member.ts

@@ -86,11 +86,12 @@ const useMemberStore = defineStore('member', {
                 uni.removeStorageSync('wap_member_not_control_mobile');
                 isRedirect && redirect({ url: '/app/pages/index/index', mode: 'switchTab' })
             }
-            logout().then(() => {
-                clearStorage()
-            }).catch(() => {
-                clearStorage()
-            })
+            clearStorage()
+            // logout().then(() => {
+            //     clearStorage()
+            // }).catch(() => {
+            //     clearStorage()
+            // })
         },
         // 一键绑定手机号
         bindMobile(e: any) {

+ 1 - 0
src/utils/common.ts

@@ -142,6 +142,7 @@ export const redirect = (redirect: any) => {
  * @param {Object} link
  */
 export const diyRedirect = (link: any) => {
+    
     const diyStore = useDiyStore();
     // 装修模式禁止跳转
     if (diyStore.mode == 'decorate') return;

+ 1 - 1
src/utils/request.ts

@@ -43,7 +43,7 @@ class Request {
         try {
             getToken() && (this.config.header[import.meta.env.VITE_REQUEST_HEADER_TOKEN_KEY] = 'Bearer ' + getToken())
             this.config.header[import.meta.env.VITE_REQUEST_HEADER_CHANNEL_KEY] = getAppChannel()
-            this.config.header.clientId = 'e5cd7e4891bf95d1d19206ce24a7b32e'
+            this.config.header.clientId = '428a8310cd442757ae699df5d894f051'
         } catch (e) {
         }
     }