Przeglądaj źródła

commit - m 模块优化

zhengjinyi 4 lat temu
rodzic
commit
63da41a707

+ 1 - 0
.gitignore

@@ -1,4 +1,5 @@
 unpackage/
 .gitignore
 common/config/config.js
+services/ajax.env.js
 .idea/

+ 2 - 2
common/config/config.js

@@ -1,10 +1,10 @@
 let URL_CONFIG = ""
 if(process.env.NODE_ENV === 'development'){
     // 开发环境
-	URL_CONFIG = 'http://192.168.2.68:8008'	 //涛涛联调地址
+	// URL_CONFIG = 'http://192.168.2.68:8008'	 //涛涛联调地址
 	// URL_CONFIG = 'http://192.168.2.67:8008'	 //裴裴联调地址
 	// URL_CONFIG = 'http://192.168.2.75:8008'	 //超超联调地址
-	// URL_CONFIG = 'https://spi-b.caimei365.com'	 //采美测试地址
+	URL_CONFIG = 'https://spi-b.caimei365.com'	 //采美测试地址
 	// URL_CONFIG = 'https://spi.caimei365.com'
 }else{
     // 生产环境

+ 9 - 2
common/css/iconfont.scss

@@ -4,7 +4,7 @@
 	font-family: iconfont;
 	font-weight: normal;
 	font-style: normal;
-	src: url('https://at.alicdn.com/t/font_1519039_7j33jbdaqau.ttf') format('truetype');
+	src: url('https://at.alicdn.com/t/font_1519039_m4qos4oii1.ttf') format('truetype');
 }
 .iconfont {
 	font-family: "iconfont" !important;
@@ -13,6 +13,14 @@
 	-webkit-font-smoothing: antialiased;
 	-moz-osx-font-smoothing: grayscale;
 }
+.icon-zhanghuyuemingxi1:before {
+  content: "\e6e4";
+}
+
+.icon-shanchu3:before {
+  content: "\e6e0";
+}
+
 .icon-gou1:before {
   content: "\e6df";
 }
@@ -432,4 +440,3 @@
 .icon-wodebeifenx:before {
   content: "\e611";
 }
-

+ 4 - 3
components/cm-module/cm-seller/user.vue

@@ -373,7 +373,6 @@
 		bottom: -170rpx;
 		left: 24rpx;
 		border-radius: 20rpx;
-		box-shadow:0px 3px 6px rgba(225,86,22,0.07);
 	}	
 	.tab-title{
 		font-size: $font-size-28;
@@ -457,7 +456,6 @@
 		padding:0 24rpx;
 		background: $bg-color;
 		border-radius: 20rpx;
-		box-shadow:0px 3px 6px rgba(225,86,22,0.07);
 	}
 	.list-cell{
 		display:flex;
@@ -467,7 +465,10 @@
 		position:relative;
 		background: $bg-color;
 		justify-content: center;
-		// border-bottom: 1px solid #EBEBEB;
+		border-bottom: 1px solid #EBEBEB;
+		&:last-child{
+			border-bottom: none;
+		}
 		&.cell-hover{
 			background:#fafafa;
 		}

+ 1 - 1
components/cm-module/homeIndex/banner.vue

@@ -176,7 +176,7 @@
 					color: $color-system;
 					font-size: $font-size-34;
 					.sm{
-						font-size: $font-size-24;
+						font-size: $font-size-28;
 					}
 				}
 			}

+ 3 - 2
components/cm-module/homeIndex/hotProduct.vue

@@ -197,7 +197,7 @@
 		}
 		.recommend-list{
 			width: 100%;
-			height: 1080rpx;
+			height: 1100rpx;
 			position: relative;
 			padding-bottom: 20rpx;
 			.tui-banner-swiper {
@@ -233,7 +233,7 @@
 					}
 					.floor-item-content{
 						width: 311rpx;
-						padding: 0 15rpx;
+						padding: 0 20rpx;
 					}
 					.floor-item-act{
 						display: block;
@@ -281,6 +281,7 @@
 						display: flex;
 						flex-direction: column;
 						margin-bottom: 15rpx;
+						padding: 0;
 						.mclap{
 							width: 100%;
 							line-height:40rpx;

+ 0 - 1
components/cm-module/homeIndex/navbars.vue

@@ -44,7 +44,6 @@
 		methods:{
 			initData(list){
 				this.navList = this.ReturnNewNavList(this.navList,list)
-				console.log(this.navList)
 			},
 			ReturnNewNavList(listA,listB){
 				let NewArray = []

+ 0 - 24
components/cm-module/homeIndex/supplierList.vue

@@ -12,10 +12,6 @@
 				<view class="box-item-mask">{{ item.title }}</view>
 			</view>
 		</view>
-		<view class="f-text tui-skeleton-fillet">
-			<image class="logo" src="../../../static/logo-c@2x.png" mode=""></image>
-			<text class="txt"> - 采美365网 -</text>
-		</view>
 	</view>
 </template>
 
@@ -117,24 +113,4 @@
 			}
 		}
 	}
-	.f-text{
-		width: 100%;
-		height: auto;
-		float: left;
-		display: flex;
-		flex-direction: column;
-		align-items: center;
-		margin-top: 24rpx;
-		.logo{
-			width: 80rpx;
-			height: 80rpx;
-			margin: 0 auto;
-			margin: 0 6rpx;
-		}
-		.txt{
-			font-size: $font-size-24;
-			color: #666666;
-			line-height: 60rpx;
-		}
-	}
 </style>

+ 3 - 2
components/cm-module/supplier/user.vue

@@ -395,7 +395,6 @@
 		bottom: -170rpx;
 		left: 24rpx;
 		border-radius: 16rpx;
-		box-shadow:0px 3px 6px rgba(225,86,22,0.07);
 	}	
 	.tab-title{
 		font-size: $font-size-30;
@@ -458,7 +457,6 @@
 		padding:0 24rpx;
 		background: $bg-color;
 		border-radius: 20rpx;
-		box-shadow:0px 3px 6px rgba(225,86,22,0.07);
 	}
 	.list-cell{
 		display:flex;
@@ -469,6 +467,9 @@
 		background: $bg-color;
 		justify-content: center;
 		border-bottom: 1px solid #EBEBEB;
+		&:last-child{
+			border-bottom: none;
+		}
 		&.cell-hover{
 			background:#fafafa;
 		}

+ 5 - 5
components/thorui/tui-modal/tui-modal.vue

@@ -71,11 +71,11 @@
 				default: function() {
 					return [{
 						text: "取消",
-						type: "red",
+						type: "danger",
 						plain: true //是否空心
 					}, {
 						text: "确定",
-						type: "red",
+						type: "danger",
 						plain: false
 					}]
 				}
@@ -247,7 +247,7 @@
 	}
 
 	.tui-danger {
-		background: #ed3f14;
+		background: #E15616;
 		color: #fff;
 	}
 
@@ -257,12 +257,12 @@
 	}
 
 	.tui-danger-outline {
-		color: #ed3f14;
+		color: #E15616;
 		background: transparent;
 	}
 
 	.tui-danger-outline::after {
-		border: 1px solid #ed3f14;
+		border: 1px solid #E15616;
 	}
 
 	.tui-red {

+ 26 - 1
h5/pages/activity/activity-list.vue

@@ -5,7 +5,10 @@
 				<image class="list-image" :src="item.image" mode="scaleToFill"></image>
 				<view class="title">{{item.title}}</view>
 				<view class="time" v-show="item.status!=3">
-					<view class="text">{{item.detail }}</view>
+					<view class="text">{{ item.detail }}</view>
+				</view>
+				<view class="mack" v-show="item.status == 3">
+					<view class="mack-text">活动已经结束</view>
 				</view>
 			</view>
 			<!--加载loadding-->
@@ -159,5 +162,27 @@
 				text-align: center;
 			}
 		}
+		.mack{
+			width: 100%;
+			height: 100%;
+			position: absolute;
+			top: 0;
+			left: 0;
+			z-index: 9999;
+			background: rbba(255,255,255,.6);
+			border-radius: 2rpx;
+			display: flex;
+			flex-direction: column;
+			align-items: center;
+			.mack-text{
+				width: 220rpx;
+				height: 70rpx;
+				border-radius: 35rpx;
+				text-align: center;
+				background: rgba(0,0,0,.4);
+				color: #FFFFFF;
+				line-height: 70rpx;
+			}
+		}
 	}
 </style>

+ 1 - 1
h5/pages/activity/activity_mid.vue

@@ -155,7 +155,7 @@
 						item.productList = newProductList
 					})
 					this.isRequest = true
-					// 老郑你看下要不要加延时,可能会获取不到scrollTop
+					// 你看下要不要加延时,可能会获取不到scrollTop
 					setTimeout(()=>{
 						this.getSectionProps();
 					},2000)

+ 26 - 0
pages/goods/goods-secondary.vue

@@ -28,6 +28,9 @@
 							<view class="time" v-show="item.status!=3">
 								<view class="text">{{item.detail }}</view>
 							</view>
+							<view class="mack" v-show="item.status == 3">
+								<view class="mack-text">活动已经结束</view>
+							</view>
 						</view>
 						<!--加载loadding-->
 						<tui-loadmore :visible="loadding" :index="3" type="black"></tui-loadmore>
@@ -328,6 +331,29 @@
 				text-align: center;
 			}
 		}
+		.mack{
+			width: 100%;
+			height: 100%;
+			position: absolute;
+			top: 0;
+			left: 0;
+			z-index: 9999;
+			background: rbba(255,255,255,.6);
+			border-radius: 2rpx;
+			display: flex;
+			flex-direction: column;
+			align-items: center;
+			justify-content: center;
+			.mack-text{
+				width: 220rpx;
+				height: 70rpx;
+				border-radius: 35rpx;
+				text-align: center;
+				background: rgba(0,0,0,.4);
+				color: #FFFFFF;
+				line-height: 70rpx;
+			}
+		}
 	}
 	//二级分类
 	.instrument{

+ 103 - 16
pages/goods/product.vue

@@ -13,12 +13,9 @@
 				<text>详情</text>
 				<text class="line"></text>
 			</view>
-			<view class="nav-item tui-skeleton-fillet" 
-				  :class="{ current: tabCurrentIndex === 1 }" 
-				  @click="tabClick(1)" 
-				  v-if="product.productDetail.orderInfo || product.productDetail.serviceInfo">
-					<text>服务项目</text>
-					<text class="line"></text>
+			<view class="nav-item tui-skeleton-fillet" :class="{ current: tabCurrentIndex === 1 }" @click="tabClick(1)">
+				<text>服务项目</text>
+				<text class="line"></text>
 			</view>	
 			<view class="nav-item tui-skeleton-fillet" :class="{ current: tabCurrentIndex === 2 }" @click="tabClick(2)">
 				<text>推荐</text>
@@ -108,7 +105,7 @@
 						<view class="right"><text class="iconfont icon-xiayibu"></text></view>
 					</view>
 				</view>
-				<view class="product-details productDetails0">
+				<view class="product-details product-details0">
 					<!-- 商品详情 -->
 					<view class="title">
 						<view class="title-tab">商品详情</view>
@@ -117,16 +114,19 @@
 						<parser :html="html" :img-mode="widthFix"></parser>
 					</view>
 				</view>	
-				<view class="product-details service productDetails1" v-show="product.productDetail.orderInfo || product.productDetail.serviceInfo">
+				<view class="product-details service product-details1">
 					<!-- 服务项目 -->
 					<view class="title">
 						<view class="title-tab">服务项目</view>
 					</view>
-					<view class="content service">
+					<view class="content service" v-if="product.productDetail.orderInfo || product.productDetail.serviceInfo">
 						<cm-service :product="product.productDetail" v-if="isRequest"></cm-service>
 					</view>
+					<view class="content-none"  v-else>
+						<text>暂无服务项目</text>
+					</view>
 				</view>	
-				<view class="product-details recommend productDetails2">
+				<view class="product-details recommend product-details2">
 					<!-- 相关推荐 -->
 					<view class="title">
 						<view class="title-tab">相关推荐</view>
@@ -264,6 +264,7 @@
 	import cmParameter from "@/components/cm-module/productDetails/cm-parameter" //相关参数
 	import cmService from "@/components/cm-module/productDetails/cm-service" //服务项目
 	import wxLogin from "@/common/config/wxLogin.js"
+	import { debounce } from '@/common/config/common.js'
 	var isPreviewImg;
 	export default{
 		components:{
@@ -331,7 +332,12 @@
 				},
 				linkPath:'',
 				CustomBar:this.CustomBar,// 顶部导航栏高度
-				popupShow:false//参数弹窗
+				popupShow:false,//参数弹窗
+				tabSelectFlag:false,
+				sectionPropsArr: [],
+				scrollTopArray:[],
+				sectionTopRangeArr: [],
+				winHeight:''
 			}
 		},
 		onLoad(option) {
@@ -352,6 +358,7 @@
 					}
 				})	
 			}
+			this.getWinHeight()
 		},
 		computed: {
 			...mapState(['hasLogin','isWxAuthorize'])
@@ -417,6 +424,9 @@
 					if(this.stock == 0){
 						this.goodsData.disabledText = '售罄'
 					}
+					setTimeout(()=>{
+						this.getSectionProps();
+					},2000)
 					this.isRequest = true
 				}).catch(error =>{
 					this.$util.msg(error.msg,2000);
@@ -436,9 +446,9 @@
 				})
 			},
 			tabClick(index) {//商品详情&&供应商信息tab切换
-				console.log(index)
+				this.tabSelectFlag = true
 				this.tabCurrentIndex = index;
-				let classIndex = '.productDetails'+index;
+				let classIndex = '.product-details'+index;
 				uni.createSelectorQuery().select('.container-product-main').boundingClientRect((data)=>{//最外层盒子节点
 				  uni.createSelectorQuery().select(classIndex).boundingClientRect((res)=>{//最外层盒子节点
 				    uni.pageScrollTo({
@@ -626,9 +636,64 @@
 			},
 			hidePopup(){
 				this.popupShow = false
-			}
+			},
+			getSectionProps() {//获取每个tab对应区域的scrollTop值
+				let className = '.product-details',
+					sectionPropsArr = [];
+				uni.createSelectorQuery().select('.container-product-main').boundingClientRect((data)=>{//最外层盒子节点
+				  uni.createSelectorQuery().selectAll(className).boundingClientRect((res)=>{//最外层盒子节点
+						res.forEach((item, index) => {
+							sectionPropsArr.push({
+								className: `${className}${index}`,
+								scrollTop: item.top - data.top - 150
+							})
+						})
+						this.sectionPropsArr = sectionPropsArr;
+						this.sectionTopRangeArr = this.getSectionRange(sectionPropsArr);
+				  }).exec()
+				}).exec()
+			},
+			getSectionRange(arr) {// 获取每个tab对应区域的区间
+				let sectionScrollTopList = [];
+				for(let i = 0; i < arr.length; i++) {
+					let thisScrollTop = arr[i].scrollTop;
+					if(i < arr.length - 1) {
+						let nextScrollTop = arr[i+1].scrollTop;
+						if(i == 0) {
+							sectionScrollTopList.push(`0-${thisScrollTop}`);
+						} else if(i == arr.length - 1){
+							sectionScrollTopList.push(`${thisScrollTop}-${nextScrollTop - this.winHeight}`);
+						} else {
+							sectionScrollTopList.push(`${thisScrollTop}-${nextScrollTop}`);
+						}
+					} else {
+						sectionScrollTopList.push(`${thisScrollTop}-${thisScrollTop+500}`);
+					}
+				}
+				return sectionScrollTopList;
+			},
+			activeTab: debounce((top, _this)=> {//当滑动时也能同步激活tab
+				const { sectionTopRangeArr } = _this;
+				if(sectionTopRangeArr.length > 0) {
+					sectionTopRangeArr.forEach((item, index) => {
+						let splitItem = item.split('-'),
+							openInterval = Number(splitItem[0]),
+							closedInterval = Number(splitItem[1]);
+						if(top >= openInterval && top < closedInterval) {
+							_this.tabCurrentIndex = index;
+						}
+					})
+				}
+			},100, true),
+			getWinHeight() {
+				this.winHeight = wx.getSystemInfoSync().windowHeight;
+			},
 		},
 		onPageScroll(e){//实时获取到滚动的值
+			const { scrollTop } = e;
+			if(!this.tabSelectFlag) {
+				this.activeTab(scrollTop, this);
+			}
 			if(e.scrollTop>50){
 				this.headerColor = true
 				this.navbarFiexd = 'fixed'
@@ -1141,6 +1206,16 @@
 				}
 			}
 		}
+		.content-none{
+			width: 100%;
+			height: 80rpx;
+			line-height: 80rpx;
+			text-align: left;
+			font-size: $font-size-26;
+			color: #999999;
+			box-sizing: border-box;
+			padding: 0 24rpx;
+		}
 		.title{
 			width: 100%;
 			box-sizing: border-box;
@@ -1178,7 +1253,6 @@
 		}
 		.content{
 			width: 100%;
-			min-height: 750rpx;
 			background-color: #FFFFFF;
 		}
 	}
@@ -1335,7 +1409,10 @@
 		opacity: 0;
 		left: 0;
 		&.fixed{
-			opacity: 1;
+			animation: showFixedColor 0.3s ease-in-out both;
+		}
+		&.none{
+		   animation: hideFixedColor 0.3s ease-in-out both;
 		}
 		.nav-item {
 			display: flex;
@@ -1366,6 +1443,16 @@
 			}
 		}
 	}
+	@keyframes showFixedColor {
+		0% {background: rgba(255,255,255,0);opacity: 0;}
+		50% {background: rgba(255,255,255,0.5);opacity: 0.5;}
+		100% {background: rgba(255,255,255,1);opacity: 1;}
+	}
+	@keyframes hideFixedColor {
+		0% {background: rgba(255,255,255,1);opacity: 1;}
+		50% {background: rgba(255,255,255,0.5);opacity: 0.5;}
+		100% {background: rgba(255,255,255,0);opacity: 0;}
+	}
 	/* 加入购物模态层*/
 	@keyframes showPopup {
 		0% {

+ 33 - 23
pages/login/bindwechat.vue

@@ -257,30 +257,32 @@
 			.login-input{
 				width: 654rpx;
 				height: 40rpx;
-				padding: 24rpx;
+				padding: 24rpx 0;
 				margin-bottom: 20rpx;
-				background: #F7F7F7;
-				border-radius: 14rpx;
+				background: #FFFFFF;
 				display: flex;
 				flex-direction: column;
 				align-items: center;
+				border-bottom: 1px solid #E1E1E1;
 				&.code{
 					width: 370rpx;
 					float: left;
 					margin-right: 20rpx;
 				}
 				&.btn{
-					width: 258rpx;
-					height: 88rpx;
+					width: 220rpx;
+					height: 64rpx;
 					padding: 0;
 					float: left;
 					background: $btn-confirm;
+					border-radius: 32rpx;
+					margin-top: 10rpx;
 					.input{
-						width: 258rpx;
-						height: 88rpx;
-						line-height: 88rpx;
+						width: 220rpx;
+						height: 64rpx;
+						line-height: 64rpx;
 						padding: 0;
-						border-radius: 14rpx;
+						border-radius: 32rpx;
 						color: #FFFFFF;
 						background: $btn-confirm;
 					}
@@ -293,46 +295,54 @@
 					}
 				}
 				&.img-btn{
-					width: 250rpx;
-					height: 88rpx;
+					width: 300rpx;
+					height: 64rpx;
 					padding: 0;
 					float: left;
 					background: #FFFFFF;
 					display: block;
+					border-bottom: none;
+					margin-top: 10rpx;
 					.vscodeimg{
-						width: 180rpx;
-						height: 88rpx;
+						width: 160rpx;
+						height: 64rpx;
 						float: left;
 						display: flex;
 						flex-direction: column;
 						align-items: center;
-						border-radius: 14rpx;
+						border-radius: 6rpx;
 						image{
 							width: 180rpx;
 							height: 88rpx;
-							border-radius: 14rpx;
+							border-radius: 6rpx;
 						}
 					}
 					.vscod-refresh{
-						width: 70rpx;
+						width: 100rpx;
 						float: right;
-						display: flex;
-						flex-direction: column;
-						align-items: center;
+						height: 64rpx;
 						.icon-shuaxin{
-							font-size: 48rpx;
-							color: #333333;
+							font-size: 40rpx;
+							color: #999999;
+							display: block;
+							float: left;
+							height: 64rpx;
+							line-height: 64rpx;
 						}
 						.ref-text{
+							display: block;
+							float: right;
+							height: 64rpx;
+							line-height: 64rpx;
 							font-size: 24rpx;
-							color: #333333;
+							color: #999999;
 						}
 					}
 				}
 				.input{
 					width: 100%;
 					height: 100%;
-					background: #F7F7F7;
+					background: #FFFFFF;
 					font-size: $font-size-28;
 					line-height: 40rpx;
 					color: #333333;

+ 5 - 4
pages/login/login.vue

@@ -133,17 +133,17 @@
 		.login-input{
 			width: 600rpx;
 			height: 88rpx;
-			padding: 24rpx 40rpx;
+			padding: 24rpx 0;
 			margin: 0 auto;
 			margin-bottom: 30rpx;
-			background: #F7F7F7;
-			border-radius: 44rpx;
+			background: #FFFFFF;
 			position: relative;
 			box-sizing: border-box;
+			border-bottom: 1px solid #e1e1e1;
 			.input{
 				width: 100%;
 				height: 100%;
-				background: #F7F7F7;
+				background: #FFFFFF;
 				font-size: $font-size-28;
 				line-height: 88rpx;
 				color: #333333;
@@ -167,6 +167,7 @@
 				padding: 0 24rpx;
 				line-height: 40rpx;
 				font-size: $font-size-28;
+				border-bottom: none;
 				.login-reg{
 					float: left;
 					color: $color-system;

+ 4 - 4
pages/login/logincode.vue

@@ -108,17 +108,17 @@
 		.login-input{
 			width: 600rpx;
 			height: 88rpx;
-			padding: 24rpx 40rpx;
+			padding: 24rpx 0;
 			margin: 0 auto;
 			margin-bottom: 30rpx;
-			background: #F7F7F7;
-			border-radius: 44rpx;
+			background: #FFFFFF;
 			position: relative;
 			box-sizing: border-box;
+			border-bottom: 1px solid #E1E1E1;
 			.input{
 				width: 100%;
 				height: 100%;
-				background: #F7F7F7;
+				background: #FFFFFF;
 				font-size: $font-size-28;
 				line-height: 88rpx;
 				color: #333333;

+ 4 - 3
pages/tabBar/user/user.vue

@@ -184,7 +184,7 @@
 				salesReturnCount:'',//退货/款角标
 				firstList:[
 					{name:'运营人员管理',path:'/pages/user/operator/list',icon:'icon-yunyingrenyuanguanli'},
-					{name:'账户余额明细',path:'/pages/user/account/account',icon:'icon-zhanghuyuemingxi'},
+					{name:'账户余额明细',path:'/pages/user/account/account',icon:'icon-zhanghuyuemingxi1'},
 					{name:'收货地址管理',path:'/pages/user/address/address',icon:'icon-shouhuodizhiguanli'},
 					{name:'机构资料',path:'/pages/login/information',icon:'icon-jigouziliao'},
 					{name:'账户设置',path:'/pages/user/setting/setting',icon:'icon-zhanghushezhi'},
@@ -521,7 +521,6 @@
 		bottom: -170rpx;
 		left: 24rpx;
 		border-radius: 20rpx;
-		box-shadow:0px 3px 6px rgba(225,86,22,0.07);
 	}	
 	.tab-title{
 		font-size: $font-size-28;
@@ -605,7 +604,6 @@
 		padding:0 24rpx;
 		background: $bg-color;
 		border-radius: 20rpx;
-		box-shadow:0px 3px 6px rgba(225,86,22,0.07);
 	}
 	.list-cell{
 		display:flex;
@@ -616,6 +614,9 @@
 		background: $bg-color;
 		justify-content: center;
 		border-bottom: 1px solid #EBEBEB;
+		&:last-child{
+			border-bottom: none;
+		}
 		&.cell-hover{
 			background:#fafafa;
 		}

+ 2 - 2
services/ajax.env.js

@@ -1,10 +1,10 @@
 let URL_CONFIG = ""
 if(process.env.NODE_ENV === 'development'){
     // 开发环境
-	URL_CONFIG = 'http://192.168.2.68:8008'	 //涛涛联调地址
+	// URL_CONFIG = 'http://192.168.2.68:8008'	 //涛涛联调地址
 	// URL_CONFIG = 'http://192.168.2.67:8008'	 //裴裴联调地址
 	// URL_CONFIG = 'http://192.168.2.75:8008'	 //超超联调地址
-    // URL_CONFIG = 'https://spi-b.caimei365.com'	 //采美测试地址
+    URL_CONFIG = 'https://spi-b.caimei365.com'	 //采美测试地址
 	// URL_CONFIG = 'https://spi.caimei365.com'
 }else{
     // 生产环境

+ 8 - 0
services/shop.service.js

@@ -22,6 +22,14 @@ export default class ShopService {
 	GetSupplierPyProduct (data = {}) {
 		return this.AjaxService.get({ url:'/supplier/myProduct', data, isLoading: true })
 	}
+	/* 小程序供应商操作添加删除主推商品 */
+	SupplierSwitchFeaturedyProduct (data = {}) {
+		return this.AjaxService.post({ url:'/supplier/switchFeatured', data, isLoading: true })
+	}
+	/* 小程序供应商操作下架商品 */
+	SupplierSoldOutProduct (data = {}) {
+		return this.AjaxService.post({ url:'/supplier/soldOut', data, isLoading: true })
+	}
 	/* 小程序供应商我的店铺详情 */
 	GetSupplierHomeDeatils (data = {}) {
 		return this.AjaxService.get({ url:'/supplier/home/detail', data, isLoading: true })

+ 4 - 4
supplier/pages/deliver/deliver-goods.vue

@@ -84,7 +84,9 @@
 			}
 		},
 		onLoad(option){
-	
+			this.shopOrderId = option.shopOrderId
+			this.setScrollHeight()
+			this.initShopOrderShipmentsInfo();
 		},
 		computed: {
 			...mapState(['hasLogin','userInfo'])
@@ -202,9 +204,7 @@
 			uni.stopPullDownRefresh()
 		},
 		onShow(){
-			this.shopOrderId = uni.getStorageSync('shopOrderId')
-			this.setScrollHeight()
-			this.initShopOrderShipmentsInfo();
+		
 		},
 	}
 </script>

+ 112 - 158
supplier/pages/user/my-product.vue

@@ -26,7 +26,7 @@
 						<tui-swipe-actions :actions="item.actions" @click="handlerButton($event,item)" :params="item">
 							<template v-slot:content>
 								<view class="tui-goods-item">
-									<view class="tui-goods-checkBox" v-if="isSuperv" @click="">
+									<view class="tui-goods-checkBox" v-if="isSuperv">
 										<view class="checkbox iconfont" :class="[item.isChecked ?'icon-yixuanze':'icon-weixuanze']" @click="checkedSoperv(item)"></view>
 									</view>
 									<view class="tui-goods-image">
@@ -108,11 +108,11 @@
 			</view>
 		</tui-drawer>
 		<!-- 批量操作 -->
-		<tui-bottom-popup :radius="false" :mask="false" :show="isSuperv" @close="closeSupervFn()">
+		<tui-bottom-popup :radius="false" :mask="false" :show="isSuperv">
 			<view class="tui-popup-box clearfix">
 				<view class="tui-right-flex tui-popup-btn" :style="{ paddingBottom :isIphoneX ? '68rpx' : '0rpx' }">
 					<view class="tui-flex-1">
-						<view class="tui-button" :class="isProductChecked ? 'active' : ''" @click="closeSupervFn()">批量下架</view>
+						<view class="tui-button" :class="isProductChecked ? 'active' : ''" @click="handleAllUnder()">批量下架</view>
 					</view>
 				</view>
 			</view>	
@@ -189,6 +189,7 @@
 				OperationType:'',//操作类型
 				isCmcustomClass : 'left',
 				featuredNum:0,
+				productIds:'',//批量下架操作商品ID
 				
 			}
 		},
@@ -227,8 +228,8 @@
 				this.listQuery.pageNum = 1
 				this.ShopService.GetSupplierPyProduct(this.listQuery).then(response =>{
 					let data = response.data.productPage
-					this.hasNextPage = data.hasNextPage;
-					console.log(data.results)
+					this.featuredNum = response.data.featuredNum
+					this.hasNextPage = data.hasNextPage
 					if(data.results && data.results.length > 0){
 						this.isEmpty = false;
 						this.dataList = data.results;
@@ -255,6 +256,7 @@
 				this.listQuery.pageNum += 1
 				this.ShopService.GetSupplierPyProduct(this.listQuery).then(response =>{
 					let data = response.data.productPage
+					this.featuredNum = response.data.featuredNum
 					this.hasNextPage = data.hasNextPage;
 					this.dataList = this.dataList.concat(data.results)
 					this.handleDataList()
@@ -271,78 +273,31 @@
 				})	
 			},	
 			handleDataList(){//根据商品状态set不同的tabAction返回新的数据
-				const mapStateArr = [
-						{
-							val:['0','3','8','10'],
-							actions:[
-								{name: '无操作',color: '#fff',fontsize: 26,width: 50,background: '#e1e1e1'}
-							]
-						},
-						{
-							val:['1','9'],
-							actions:[
-								{name: '查看详情',color: '#fff',fontsize: 26,width: 50,background: '#f9a94b'}
-							]
-						},
-						{
-							val:['2'],
-							actions:[
-								{name: '查看详情',color: '#fff',fontsize: 26,width: 50,background: '#f9a94b'},
-								{name: '删除主页推荐',color: '#fff',fontsize: 26,width: 50,background: '#ff7a51'},
-								{name: '下架',color: '#fff',fontsize: 26,width: 50,background: '#fea785'}
-							]	
-						}
-					]
 				this.dataList.forEach(item =>{
-					switch(item.validFlag){
-						case '0':
-							item.actions = [
-								{name: '无操作',color: '#fff',fontsize: 26,width: 50,background: '#e1e1e1'},
-							]
-							break;
-						case '1':
+					if(item.validFlag === '0' || item.validFlag === '3' || item.validFlag === '8' || item.validFlag === '10'){
+						item.actions = [
+							{name: '无操作',color: '#fff',fontsize: 26,width: 50,background: '#e1e1e1'},
+						]
+					}else if(item.validFlag === '1' || item.validFlag === '9'){
+						item.actions = [
+							{name: '查看详情',color: '#fff',fontsize: 26,width: 50,background: '#f9a94b'},
+						]
+					}else if(item.validFlag === '2'){
+						if(item.featuredFlag ==='1'){
 							item.actions = [
 								{name: '查看详情',color: '#fff',fontsize: 26,width: 50,background: '#f9a94b'},
+								{name: '删除主页推荐',color: '#fff',fontsize: 26,width: 50,background: '#ff7a51'},
+								{name: '下架',color: '#fff',fontsize: 26,width: 50,background: '#fea785'},
 							]
-							break;
-						case '2':
-							if(item.featuredFlag == 1){
-								item.actions = [
-									{name: '查看详情',color: '#fff',fontsize: 26,width: 50,background: '#f9a94b'},
-									{name: '删除主页推荐',color: '#fff',fontsize: 26,width: 50,background: '#ff7a51'},
-									{name: '下架',color: '#fff',fontsize: 26,width: 50,background: '#fea785'},
-								]
-							}else{
-								item.actions = [
-									{name: '查看详情',color: '#fff',fontsize: 26,width: 50,background: '#f9a94b'},
-									{name: '添加主页推荐',color: '#fff',fontsize: 26,width: 50,background: '#ff7a51'},
-									{name: '下架',color: '#fff',fontsize: 26,width: 50,background: '#fea785'},
-								]
-							}
-							break;
-						case '3':
-							item.actions = [
-								{name: '无操作',color: '#fff',fontsize: 26,width: 50,background: '#e1e1e1'},
-							]
-							break;
-						case '8':
-							item.actions = [
-								{name: '无操作',color: '#fff',fontsize: 26,width: 50,background: '#e1e1e1'},
-							]
-							break;
-						case '9':
+						}else{
 							item.actions = [
 								{name: '查看详情',color: '#fff',fontsize: 26,width: 50,background: '#f9a94b'},
+								{name: '添加主页推荐',color: '#fff',fontsize: 26,width: 50,background: '#ff7a51'},
+								{name: '下架',color: '#fff',fontsize: 26,width: 50,background: '#fea785'},
 							]
-							break;
-						case '10':
-							item.actions = [
-								{name: '无操作',color: '#fff',fontsize: 26,width: 50,background: '#e1e1e1'},
-							]
-							break;
+						}
 					}
 				})
-				console.log(this.dataList)
 			},
 			handSearchList(){//搜索
 				this.GetProductListInfo()
@@ -358,138 +313,137 @@
 				this.threeClassificationText='';
 				this.classificationTwoList = [];
 				this.classificationThreeList = [];
-				console.log(this.listQuery)
 			},
 			handlerButton(e,item){//监听侧滑按钮点击事件
-				switch(this.currents){
-					case 0://全部商品列表
-						this.handleCurrentsAll(e,item)
-						break;
-					case 1://上架商品列表
-						this.handleCurrentsUpdate(e,item)
-						break;
-					case 2://下架商品列表
-						this.handleCurrentsDown(e,item)
-						break;
-				}				
-			},
-			handleCurrentsAll(e,item){//处理全部商品列表只做删除操作
-				switch(e.index){
-					case 0://删除
-						this.handleDeleter(item)
-						break;
-				}
-			},
-			handleCurrentsUpdate(e,item){//处理上架商品列表只做下架&&删除操作
-				switch(e.index){
-					case 0://下架
-						this.handleUnder(item)
-						break;
-					case 1://删除
-						this.handleDeleter(item)
-						break;
-				}
-			},
-			handleCurrentsDown(e,item){//处理下架商品列表只做下架&&删除操作
-				switch(e.index){
-					case 0://上架
-						this.handleGround(item)
-						break;
-					case 1://删除
-						this.handleDeleter(item)
-						break;
+				if(item.validFlag === '0' || item.validFlag === '3' || item.validFlag === '8' || item.validFlag === '10'){
+					if(e.index == 0){
+						return
+					}
+				}else if(item.validFlag === '1' || item.validFlag === '9'){
+					if(e.index == 0){
+						this.$api.navigateTo(`/pages/goods/product?id=${item.productID}`)
+					}
+				}else if(item.validFlag === '2'){
+					switch(e.index){
+						case 0:
+							this.$api.navigateTo(`/pages/goods/product?id=${item.productID}`)
+							break;
+						case 1:
+							if(item.featuredFlag ==='1'){
+								this.handleDeleteShopRemb(item)
+							}else{
+								this.handleAddShopRemb(item)
+							}
+							break;
+						case 2:
+							this.handleUnder(item)
+					}
 				}
 			},
-			handleDeleter(item){//删除操作
-				this.OperationType = 'delete'
+			handleAddShopRemb(item){//添加主页推荐
+				console.log(this.featuredNum);
+				let num = 4- this.featuredNum;
+				console.log(num);
+				this.OperationType = 'add'
 				this.handlerProduct = item
 				this.modal = true;
-				this.contentModalText = '是否删除该商品?';
+				this.contentModalText = `总共能添加4个主推商品,您还能添加${num}个确定将该商品添加为主推商品吗?`;
 			},
-			handleGround(item){//上架操作
-				this.OperationType = 'ground'
+			
+			handleDeleteShopRemb(item){//删除主页推荐
+				this.OperationType = 'delete'
 				this.handlerProduct = item
 				this.modal = true;
-				this.contentModalText = '是否上架该商品?';
+				this.contentModalText = '是否把该商品从主推商品中删除?';
 			},
 			handleUnder(item){//下架操作
 				this.OperationType = 'under'
 				this.handlerProduct = item
 				this.modal = true;
-				this.contentModalText = '是否下架该商品?';
+				this.contentModalText = '确定下架该商品吗?';
+			},
+			handleAllUnder(){//批量下架操作
+				let isValidFlag = false
+				if(this.isProductChecked){
+					this.dataList.forEach(el => {
+						if(el.isChecked) { 
+							if(el.validFlag != 2){ 
+								isValidFlag = true; 
+							}else{
+								isValidFlag = false
+								this.productIds += el.productID+','
+							}
+						}
+					})
+					if(isValidFlag){
+						this.$util.modal('','部分选中的商品暂未上架,不能进行下架操作','确定','',false,() =>{})
+					}else{	
+						this.OperationType = 'allunder'
+						this.modal = true;
+						this.contentModalText = '确定下架选中的商品吗?';												
+					}
+				}else{
+					return;
+				}
 			},
 			handleClick(e) {//弹窗提示用户操作
 				if(e.index == 1){
 					switch(this.OperationType){
-						case 'delete'://删除商品
-							this.UpdateDeleteStatus()
+						case 'delete'://删除主页推荐
+							this.SupplierDeleteSwitchFeatured(this.handlerProduct)
 							break;
-						case 'ground'://上架商品
-							this.UpdatePublishStatus(this.handlerProduct,1)
+						case 'add'://添加主页推荐
+							this.SupplierAddSwitchFeatured(this.handlerProduct)
 							break;
 						case 'under'://下架商品
-							this.UpdatePublishStatus(this.handlerProduct,0)
+							this.SupplierSoldOutProduct(this.handlerProduct)
+							break;
+						case 'allunder'://批量下架
+							this.SupplierAllSoldOutProduct(this.productIds)
 							break;
 					}
 				}
 				this.modal = false;
 			},
-			UpdatePublishStatus(item,publishStatus){//上下架商品操作处理接口
-				this.ProductService.ProductUpdatePublishStatus({publishStatus:publishStatus,ids:item.id}).then(response =>{
-					this.$util.msg('操作成功',2000,true,'success');
+			SupplierDeleteSwitchFeatured(item){//操作删除主页推荐
+				this.ShopService.SupplierSwitchFeaturedyProduct({productId:item.productID,featuredFlag:0}).then(response =>{
+					this.$util.msg('删除成功',2000,true,'success');
 					setTimeout(() => {
 						this.GetProductListInfo()
-						this.getOrderListCount()
 					},2000)
 				}).catch(error =>{
 					this.$util.msg(error.msg,2000)
 				})
 			},
-			UpdateDeleteStatus(){//商品删除处理接口
-				this.ProductService.ProductUpdateDeleteStatus({deleteStatus:1,ids:this.handlerProduct.id}).then(response =>{
-					this.$util.msg('删除商品成功',2000,true,'success');
+			SupplierAddSwitchFeatured(item){//操作添加主页推荐
+				this.ShopService.SupplierSwitchFeaturedyProduct({productId:item.productID,featuredFlag:1}).then(response =>{
+					this.$util.msg('添加成功',2000,true,'success');
 					setTimeout(() => {
 						this.GetProductListInfo()
-						this.getOrderListCount()
 					},2000)
 				}).catch(error =>{
 					this.$util.msg(error.msg,2000)
 				})
 			},
-			tabClick(index){
-				this.currents = index
-				switch(index){
-					case 0:
-						this.listQuery.publishStatus = ''
-						this.dataList = []
-						this.GetProductListInfo()
-						this.actions =[
-							{name: '删除',color: '#fff',fontsize: 28,width: 80,background: '#ff4759'},
-						]
-						break;
-					case 1:
-						this.listQuery.publishStatus = 1
-						this.dataList = []
-						this.GetProductListInfo()
-						this.actions =[
-							{name: '下架',color: '#fff',fontsize: 28,width: 80,background: '#ffaa33'},
-							{name: '删除',color: '#fff',fontsize: 28,width: 80,background: '#ff4759'},
-						]
-						break;
-					case 2:
-						this.listQuery.publishStatus = 0
-						this.dataList = []
+			SupplierSoldOutProduct(item){//操作下架商品
+				this.ShopService.SupplierSoldOutProduct({productIds:item.productID}).then(response =>{
+					this.$util.msg('下架成功',2000,true,'success');
+					setTimeout(() => {
 						this.GetProductListInfo()
-						this.actions =[
-							{name: '上架',color: '#fff',fontsize: 28,width: 80,background: '#4688fa'},
-							{name: '删除',color: '#fff',fontsize: 28,width: 80,background: '#ff4759'},
-						]
-						break;
-				
-				}
+					},2000)
+				}).catch(error =>{
+					this.$util.msg(error.msg,2000)
+				})
 			},
-			bindDateChange: function(e) {//选择筛选时间
-				this.listQuery.date = e.detail.value
+			SupplierAllSoldOutProduct(ids){//操作批量下架商品
+				this.ShopService.SupplierSoldOutProduct({productIds:ids}).then(response =>{
+					this.$util.msg('下架成功',2000,true,'success');
+					setTimeout(() => {
+						this.GetProductListInfo()
+					},2000)
+				}).catch(error =>{
+					this.$util.msg(error.msg,2000)
+				})
 			},
 			bindPickerChange: function(type,e) {//选择筛选条件
 				switch(type){