zhengjinyi пре 4 година
родитељ
комит
f580730b49

+ 0 - 15
api/use.js

@@ -246,21 +246,6 @@ export function accountInfo(params) {
 	})
 }
 
-/**
- *首页初始化
- */
-export function queryHomeInfo(params) {
-	return new Promise(function(resolve,reject) {
-		request.get('/home/modules',{params}, res => {
-			if(res.code == 0){
-				resolve(res)
-			}else{
-				reject(res)
-			}
-		})
-	})
-}
-
 /**
  *用户状态初始化
  */

+ 2 - 2
common/config/config.js

@@ -2,9 +2,9 @@ let URL_CONFIG = ""
 if(process.env.NODE_ENV === 'development'){
     // 开发环境
 	// URL_CONFIG = 'http://192.168.2.68:8008'	 //本地IP联调地址
-	// URL_CONFIG = 'http://192.168.2.67: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{
     // 生产环境

+ 5 - 1
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_mkxy06756m.ttf') format('truetype');
+	src: url('https://at.alicdn.com/t/font_1519039_3078rskth5w.ttf') format('truetype');
 }
 .iconfont {
 	font-family: "iconfont" !important;
@@ -13,6 +13,10 @@
 	-webkit-font-smoothing: antialiased;
 	-moz-osx-font-smoothing: grayscale;
 }
+.icon-biaoqian:before {
+  content: "\e633";
+}
+
 .icon-xingxing:before {
   content: "\e870";
 }

+ 1 - 1
components/cm-module/cm-seller/home.vue

@@ -206,7 +206,7 @@
 				this.getOrganizeProducts()
 			},		
 			getHomeInformation(){		
-				queryHomeInfo({}).then(res =>{
+				this.CommonService.GetHomeModulesDataInfo({}).then(res =>{
 					let data = res.data;
 					this.bannerImageList = data.bannerImageList
 					this.mallPageModules = data.mallPageModules

+ 184 - 66
components/cm-module/productDetails/cm-activipopu.vue

@@ -1,8 +1,56 @@
 <template name="cm-price">
-	<!-- 商品促销活动弹窗提示判断 -->
-	<view class="wrap-main">
-	
-	</view>
+	<!--促销活动弹窗提示-->
+	<tui-bottom-popup :radius="true" :show="popupShow" @close="hidePopup()">
+		<view class="tui-popup-box clearfix">
+			<template v-if="product.actStatus == null  &&  product.ladderFlag == 1">
+				<view class="tui-scrollview-box">
+					<view class="ladder-main">
+						<view class="ladder-item">
+							<view class="ladder-item-td">起订量</view>
+							<view class="ladder-item-td">价格</view>
+						</view>
+						<view class="ladder-item" v-for="(ladd, index) in product.ladderPrices" :key="index">
+							<view class="ladder-item-td">{{ ladd.numRange }}</view>
+							<view class="ladder-item-td">{{ ladd.buyPrice | NumFormat }}</view>
+						</view>
+					</view>
+				</view>	
+			</template>	
+			<template v-else>
+				<view class="tui-scrollview-box">
+					<view class="box-text">
+						<text>促销时间:</text>
+						<text class="txt" v-if="product.promotions.status == 1">不限时</text>
+						<text class="txt" v-else>{{ product.promotions.beginTime }} ~ {{ product.promotions.endTime }}</text>
+					</view>
+					<view class="box-title" v-show="product.promotions.mode ==2">
+						<text>购买{{product.promotions.name}}商品,满</text>
+						<text class="txt">¥{{product.promotions == null ? '0.00' : product.promotions.touchPrice | NumFormat}}</text>减
+						<text class="txt">¥{{product.promotions == null ? '0.00' : product.promotions.reducedPrice | NumFormat}}</text>
+					</view>
+					<view class="box-title" v-show="product.promotions.mode==3">
+						<text>购买{{product.promotions.name}}商品,满</text>
+						<text class="txt">¥{{product.promotions.touchPrice}}</text>赠送商品
+					</view>
+					<view class="box-product" v-show="product.promotions.mode==3">
+						<view class="box-product-main"  v-for="(item, index) in pproduct.romotions.giftList" :key="index">
+							<view class="image"><image :src="item.image" mode="widthFix"></image></view>
+							<view class="info">
+								<view class="name">{{ item.name }}</view>
+								<view class="num">X{{ item.number }}</view>
+							</view>
+						</view>
+					</view>
+				</view>
+			</template>
+			<view class="tui-right-flex tui-popup-btn" :style="{ paddingBottom :isIphoneX ? '68rpx' : '0rpx' }">
+				<view class="tui-flex-1">
+					<view class="tui-button" v-if="product.promotions.type == 2" @click="goGoodActiveFn(product.promotions.id)">更多凑单商品</view>
+					<view class="tui-button" v-else @click="hidePopup()">了解</view>
+				</view>
+			</view>
+		</view>	
+	</tui-bottom-popup>
 </template>
 
 <script>
@@ -13,24 +61,14 @@
 			product:{
 				type:Object,
 			},
-			userIdentity: {
-				type: Number,
-				default: 2
-			},
-			ladderPriceList:{
-				type: Array,
-			},
-			retailPrice:{
-				type:String,
-			},
-			minBuyNumber:{
-				type: Number,
-				default: 1
+			popupShow:{
+				type:Boolean,
+				default:false
 			}
 		},
 		data() {
 			return{
-				popupShow:false
+				isIphoneX:this.$store.state.isIphoneX,
 			}
 		},
 		filters: {
@@ -45,17 +83,12 @@
 			...mapState(['hasLogin','isWxAuthorize'])
 		},
 		methods:{
-			clickPopupShow(){
-				this.popupShow = true
-			},
 			hidePopup(){
-				this.popupShow = false
+				this.$parent.popupShow = false
 			},
-			goUpgradeApply(){
-				this.$api.navigateTo('/pages/login/apply')
-			},
-			loginClick(){
-				this.$api.navigateTo('/pages/login/login')
+			goGoodActiveFn(id){
+				this.$parent.popupShow = false
+				this.$api.navigateTo('/pages/goods/goods-active?id='+id)
 			}
 		},
 		
@@ -65,59 +98,144 @@
 <style lang="scss">	
 	.tui-flex-1 {
 		flex: 1;
-		padding: 16rpx;
 	}
 	.tui-popup-box {
 		position: relative;
-		padding: 30rpx 0 100rpx 0;
-	}
-	.tui-popup-title{
-		line-height: 60rpx;
-		text-align: center;
-		color: #333;
-		font-size: 28rpx;
-		border-bottom: 1px solid #EBEBEB;
+		box-sizing: border-box;
+		min-height: 220rpx;
+		padding:24rpx 24rpx 0 24rpx;
 	}
-	.tui-popup-attr{
+	.tui-scrollview-box{
 		width: 100%;
-		padding: 0 20rpx;
-		.tui-popup-attr-cell{
+		height: auto;
+		float: left;
+		box-sizing: border-box;
+		.ladder-main{
 			width: 100%;
-			height: auto;
-			border-bottom: 1px solid #EFEFEF;
-			font-size: 24rpx;
-			line-height: 24rpx;
-			display: flex;
-			flex-wrap: wrap;
-			.attr-cell-td{
-				width: 238rpx;
+			height: 320rpx;
+			border: 1px solid rgba(225,86,22,0.3);
+			border-radius: 10rpx;
+			.ladder-item{
+				width: 100%;
+				height: 80rpx;
 				float: left;
-				color: #999999;
-				padding:24rpx 20rpx;
-				display: flex;
-				flex: 3;
-				flex-direction: column;
+				border-bottom: 1px solid rgba(225,86,22,0.3);
+				&:nth-child(1){
+					.ladder-item-td{
+						color: #333333;
+					}
+				}
+				&:last-child{
+					border-bottom: none;
+				}
+				.ladder-item-td{
+					width:50%;
+					text-align: center;
+					line-height: 80rpx;
+					font-size: $font-size-24;
+					color: $color-system;
+					box-sizing: border-box;
+					float: left;
+					&:nth-child(1){
+						border-right: 1px solid rgba(225,86,22,0.3);
+					}
+				}
 			}
-			.attr-cell-tr{
-				width: 462rpx;
-				float: left;
-				color: #333333;
-				padding:20rpx;
-				display: flex;
-				flex: 7;
-				flex-direction: column;
+		}
+		.box-title{
+			font-size: $font-size-26;
+			color: $text-color;
+			text-align: left;
+			line-height: 56rpx;
+			.txt{
+				color: $color-system;
+				margin: 0 8rpx;
 			}
-			&:last-child{
-				border-bottom: none;
+		}
+		.box-text{
+			font-size: $font-size-26;
+			color: $text-color;
+			text-align: left;
+			line-height: 56rpx;
+			.txt{
+				color: $color-system;
+			}
+		}
+		.box-product{
+			width: 100%;
+			height: auto;
+			margin-top: 20rpx;
+			.title{
+				font-size: $font-size-24;
+				color: $text-color;
+				text-align: left;
+				line-height: 54rpx;
+			}
+			.box-product-main{
+				width: 100%;
+				height: 136rpx;
+				.image{
+					width: 134rpx;
+					height: 134rpx;
+					border: 1px solid #EBEBEB;
+					float: left;
+					image{
+						width: 100%;
+						height: 100%;
+						display: block;
+					}
+				}
+				.info{
+					width: 540rpx;
+					height: 134rpx;
+					float: left;
+					margin-left: 16rpx;
+					position: relative;
+					.name{
+						width: 100%;
+						float: left;
+						line-height: 40rpx;
+						font-size: $font-size-28;
+						color: $text-color;
+						-o-text-overflow: ellipsis;
+						text-overflow: ellipsis;
+						display: -webkit-box;
+						word-break: break-all;
+						-webkit-box-orient: vertical;
+						-webkit-line-clamp: 2;
+						overflow: hidden;
+					}
+					.num{
+						width: 100%;
+						height: 44rpx;
+						font-size: $font-size-24;
+						color: $text-color;
+						text-align: left;
+						line-height: 44rpx;
+						position: absolute;
+						bottom: 0;
+						left: 0;
+					}
+				}
 			}
 		}
 	}
+	
 	.tui-popup-btn {
 		width: 100%;
-		position: absolute;
-		left: 0;
-		bottom: 0;
-		z-index: 9999;
+		height: auto;
+		float: left;
+		margin-top: 24rpx;
+		.tui-button{
+			width: 100%;
+			height: 88rpx;
+			background: $btn-confirm;
+			line-height: 88rpx;
+			text-align: center;
+			color: #FFFFFF;
+			font-size: $font-size-28;
+			border-radius: 14rpx;
+		}
 	}
 </style>
 

+ 17 - 20
components/cm-module/productDetails/cm-price.vue

@@ -29,7 +29,7 @@
 					</view>
 					<view v-if="product.actStatus==1" class="floor-item-act">
 						<view v-if="product.promotions.type == 1 && product.promotions.mode == 1"  class="floor-tags" @click.stop="clickPopupShow(1)">
-							{{product.promotions.name}}<text v-if="hasLogin">:¥{{ product.promotions.touchPrice | NumFormat }}</text>
+							{{product.promotions.name}}<text v-if="hasLogin">:¥{{ product.promotions == null ? '0.00' : product.promotions.touchPrice | NumFormat }}</text>
 						</view>
 						<view v-else class="floor-tags" @click.stop="clickPopupShow()">{{product.promotions.name}}</view>	
 					</view>
@@ -50,7 +50,7 @@
 					</view>
 					<view v-if="product.actStatus==1" class="floor-item-act">
 						<view v-if="product.promotions.type == 1 && product.promotions.mode == 1"  class="floor-tags" @click.stop="clickPopupShow(1)">
-							{{product.promotions.name}}<text v-if="hasLogin">:¥{{ product.promotions.touchPrice | NumFormat }}</text>
+							{{product.promotions.name}}<text v-if="hasLogin">:¥{{ product.promotions == null ? '0.00' : product.promotions.touchPrice | NumFormat }}</text>
 						</view>
 						<view v-else class="floor-tags" @click.stop="clickPopupShow()">{{product.promotions.name}}</view>	
 					</view>
@@ -78,7 +78,7 @@
 						</view>
 						<view v-if="product.actStatus==1" class="floor-item-act">
 							<view v-if="product.promotions.type == 1 && product.promotions.mode == 1"  class="floor-tags" @click.stop="clickPopupShow(1)">
-								{{product.promotions.name}}<text v-if="hasLogin">:¥{{ product.promotions.touchPrice | NumFormat }}</text>
+								{{product.promotions.name}}<text v-if="hasLogin">:¥{{ product.promotions == null ? '0.00' : product.promotions.touchPrice | NumFormat }}</text>
 							</view>
 							<view v-else class="floor-tags" @click.stop="clickPopupShow()">{{product.promotions.name}}</view>	
 						</view>
@@ -109,20 +109,20 @@
 						<view class="tui-scrollview-box">
 							<view class="box-text">
 								<text>促销时间:</text>
-								<text class="txt" v-if="promotions.status == 1">不限时</text>
-								<text class="txt" v-else>{{ promotions.beginTime }} ~ {{ promotions.endTime }}</text>
+								<text class="txt" v-if="product.promotions.status == 1">不限时</text>
+								<text class="txt" v-else>{{ product.promotions.beginTime }} ~ {{ product.promotions.endTime }}</text>
 							</view>
-							<view class="box-title" v-show="promotions.mode ==2">
+							<view class="box-title" v-show="product.promotions.mode ==2">
 								<text>购买凑单商品,满</text>
-								<text class="txt">¥{{promotions.touchPrice}}</text>减
-								<text class="txt">¥{{promotions.reducedPrice}}</text>
+								<text class="txt">¥{{ product.promotions == null ? '0.00' : product.promotions.touchPrice | NumFormat }}</text>减
+								<text class="txt">¥{{ product.promotions == null ? '0.00' : product.promotions.reducedPrice | NumFormat }}</text>
 							</view>
-							<view class="box-title" v-show="promotions.mode==3">
+							<view class="box-title" v-show="product.promotions.mode==3">
 								<text>购买购买凑单商品,满</text>
-								<text class="txt">¥{{promotions.touchPrice}}</text>赠送商品
+								<text class="txt">¥{{ product.promotions == null ? '0.00' : product.promotions.touchPrice | NumFormat }}</text>赠送商品
 							</view>
-							<view class="box-product" v-show="promotions.mode==3">
-								<view class="box-product-main"  v-for="(item, index) in promotions.giftList" :key="index">
+							<view class="box-product" v-show="product.promotions.mode==3">
+								<view class="box-product-main"  v-for="(item, index) in product.romotions.giftList" :key="index">
 									<view class="image"><image :src="item.image" mode="widthFix"></image></view>
 									<view class="info">
 										<view class="name">{{ item.name }}</view>
@@ -134,7 +134,7 @@
 					</template>
 					<view class="tui-right-flex tui-popup-btn" :style="{ paddingBottom :isIphoneX ? '68rpx' : '0rpx' }">
 						<view class="tui-flex-1">
-							<view class="tui-button" v-if="product.promotions.type == 2" @click="hidePopup()">更多凑单商品</view>
+							<view class="tui-button" v-if="product.promotions.type == 2" @click="goGoodActiveFn(product.promotions.id)">更多凑单商品</view>
 							<view class="tui-button" v-else @click="hidePopup()">了解</view>
 						</view>
 					</view>
@@ -195,13 +195,10 @@
 			loginClick(){
 				this.$api.navigateTo('/pages/login/login')
 			},
-			toFixed:function(text) {//处理金额
-				if(text == null || text === undefined){
-					return Number(0).toFixed(2);
-				}else{
-					return Number(text).toFixed(2);
-				}
-			},
+			goGoodActiveFn(id){
+				this.$parent.popupShow = false
+				this.$api.navigateTo('/pages/goods/goods-active?id='+id)
+			}
 		},
 		
 	}

+ 6 - 0
pages.json

@@ -72,6 +72,12 @@
 				"navigationBarTitleText": "商品列表",
 				"enablePullDownRefresh":true
 			}
+		},{
+			"path": "pages/goods/goods-active",
+			"style": {
+				"navigationBarTitleText": "凑单商品",
+				"enablePullDownRefresh":true
+			}
 		},{
 			"path": "pages/goods/product",
 			"style": {

+ 298 - 0
pages/goods/goods-active.vue

@@ -0,0 +1,298 @@
+<template>
+	<view class="container" v-show="isRepuest">
+		<view class="container-title">
+			<view class="name">【{{promotionsInfo.name}}】{{promotionsInfo.description}}</view>
+			<view class="text">
+				<text class="span">促销时间:</text>
+				<text class="span r">
+					<text class="txt" v-if="promotionsInfo.status == 1">不限时</text>
+					<text class="txt" v-else>{{ promotionsInfo.beginTime }} ~ {{ promotionsInfo.endTime }}</text>
+				</text>
+			</view>
+			<view class="text">下面为参与本次凑单满赠活动的全部商品</view>
+		</view>
+		<view class="tui-order-content">
+			<view class="hotgoods-swiper">
+				<view class="scoll-wrapper clearfix">
+					<view class="floor-item" v-for="(item, index) in  productList" :key="index" @click.stop="detail(item.productId)">
+						<image class="tui-skeleton-fillet" :src="item.image" mode="aspectFill"></image>
+						<view class="floor-item-content">
+							<view class="title"><text class="mclap">{{item.name}}</text></view>
+							<view class="price">
+								<text class="p sm">¥</text>
+								<text class="p big">{{item.price | NumFormat}}</text>
+							</view>
+						</view>
+					</view>
+				</view>
+			</view>	
+			<!--加载loadding-->
+			<tui-loadmore :visible="loadding" :index="3" type="black"></tui-loadmore>
+			<tui-nomore :visible="!pullUpOn" bgcolor="#F7F7F7" :text='nomoreText'></tui-nomore>
+			<!--加载loadding-->
+		</view>
+	</view>
+</template>
+
+<script>
+	import tuiLoadmore from "@/components/tui-components/loadmore/loadmore"
+	import tuiNomore from "@/components/tui-components/nomore/nomore"
+	
+	export default {
+		components: {
+			tuiLoadmore,
+			tuiNomore,
+		},
+		data() {
+			return {
+				isRepuest:false,
+				userID:0,
+				promotionsId:0,
+				productList: [],
+				pageSize:10,
+				pageNum:1,
+				loadding: false,
+				pullUpOn: true,
+				modal:false,
+				promotionsInfo:{},
+				loadding: false,
+				pullUpOn: true,
+				hasNextPage: false,
+				pullFlag: true,
+				nomoreText: '上拉显示更多',
+			}
+		},
+		onLoad(option) {
+			this.promotionsId=option.id
+			this.$api.getComStorage('userInfo').then((resolve) =>{
+				this.userID = resolve.userID ? resolve.userID :0;
+				this.initSsoMemberCollectionList()
+			}).catch(error =>{
+				this.initSsoMemberCollectionList()
+			})
+		},
+		filters: {
+			NumFormat:function(text) {//处理金额
+				return Number(text).toFixed(2);
+			},
+		},
+		methods: {
+			initSsoMemberCollectionList(id){//凑单初始化
+				this.ProductService.queryProductPromotionInfo({promotionsId:this.promotionsId}).then(response =>{
+					let data = response.data
+					this.promotionsInfo = data
+					this.queryProductPromotionList()
+				}).catch(error =>{
+					this.$util.msg(error.message,2000)
+				})	
+			},
+			queryProductPromotionList(id){//查询凑单商品列表
+				this.ProductService.queryProductPromotionList({pageNum:this.pageNum,pageSize:this.pageSize,promotionsId:this.promotionsId}).then(response =>{
+					let data = response.data
+					if(data.list && data.list.length > 0){
+						this.hasNextPage = data.hasNextPage;
+						this.productList = data.list;
+						this.getProductPrice()
+						// 防上拉暴滑
+						this.pullFlag = false;
+						setTimeout(()=>{ this.pullFlag = true; },500)
+						// 底部提示文案
+						if(this.hasNextPage){
+							this.pullUpOn = false
+							this.nomoreText = '上拉显示更多'
+						}else{
+							if(this.productList.length < 2){
+								this.pullUpOn = true
+							}else{
+								this.pullUpOn = false
+								this.nomoreText = '已至底部'
+							}
+						}
+					}
+				}).catch(error =>{
+					this.$util.msg(error.message,2000)
+				})	
+			},
+			getOnReachBottomData(){//上滑加载
+				this.pageNum+=1
+				this.ProductService.queryProductPromotionList({pageNum:this.pageNum,pageSize:this.pageSize,promotionsId:this.promotionsId}).then(response =>{
+					let data = response.data
+					if(data.list&&data.list.length > 0){
+						this.hasNextPage = data.hasNextPage;
+						this.productList = this.productList.concat(data.list) 
+						this.getProductPrice()
+						this.pullFlag = false;// 防上拉暴滑
+						setTimeout(()=>{this.pullFlag = true;},500)
+						if(this.hasNextPage){
+							this.pullUpOn = false
+							this.nomoreText = '上拉显示更多'
+						}else{
+							this.pullUpOn = false
+							this.loadding = false
+							this.nomoreText = '已至底部'
+						}
+					}
+				}).catch(error =>{
+					this.$util.msg(error.msg,2000)
+				})
+			},
+			getProductPrice(){//获取商品或者活动价格
+				let productIdArr = [];
+				let productIds ='';
+				this.productList.map(item=>{
+					productIdArr.push(item.id)
+				})
+				productIds = productIdArr.join(",");
+				this.ProductService.querySearchProductPrice({userId: this.userID,productIds:productIds}).then(response =>{
+					this.productList = this.ReturnNewProducts(this.productList,response.data);
+					this.isRepuest = true;
+				}).catch(error =>{
+					this.$util.msg(error.msg,2000)
+				})
+			},
+			ReturnNewProducts(Array,list){
+				let NewArray = []
+				Array.map(item=>{
+					for (let i = 0; i < list.length; i++) {
+						if( item.id == list[i].productId ){
+							NewArray.push(Object.assign(item,list[i])) 
+						}
+					}
+				});
+				return NewArray
+			},
+			detail: function(id) {
+				this.$api.navigateTo(`/pages/goods/productDetail?id=${id}`)
+			},
+		},
+		onReachBottom() {
+			if(this.hasNextPage){
+				this.loadding = true
+				this.pullUpOn = true
+				this.getOnReachBottomData()
+			}	
+		},
+		onShow() {
+			
+		}
+	}
+</script>
+
+<style lang="scss">
+	page{
+		background-color: #F7F7F7;
+	}
+	.container {
+		padding-bottom: 0;
+	}
+	.container-title{
+		width: 100%;
+		height: 242rpx;
+		box-sizing: border-box;
+		padding:21rpx 24rpx 23rpx 24rpx;
+		background: url(https://admin-b.caimei365.com/userfiles/1/images/photo/2020/09/%E8%83%8C%E6%99%AF%E5%9B%BE.png) no-repeat;
+		background-size: cover;
+		.name{
+			width: 100%;
+			box-sizing: border-box;
+			height: 96rpx;
+			line-height: 36rpx;
+			padding: 12rpx 0;
+			font-size: $font-size-28;
+			color: #FFFFFF;
+		}
+		.text{
+			width: 100%;
+			height: 48rpx;
+			line-height: 48rpx;
+			font-size: $font-size-24;
+			color: #FFFFFF;
+			.span{
+				display: inline-block;
+				float: left;
+				&.r{
+					padding:0 20rpx;
+					height: 36rpx;
+					line-height: 36rpx;
+					border-radius: 6rpx;
+					text-align: center;
+					color: $color-system;
+					font-size: $font-size-26;
+					margin-top: 4rpx;
+					background-color: #FFFFFF;
+					margin-left: 10rpx;
+				}
+			}
+		}
+	}
+	.hotgoods-swiper{
+		width: 100%;
+		height: auto;				
+		overflow: hidden;
+		margin-bottom: 20rpx;
+		.scoll-wrapper{
+			width: 100%;
+			height: auto;
+			box-sizing: border-box;
+			padding: 24rpx;
+			background: #F7F7F7;
+			.floor-item{
+				width: 340rpx;
+				height: auto;
+				margin-right: 20rpx;
+				font-size: $font-size-24;
+				color: $text-color;
+				background: #FFFFFF;
+				line-height: 36rpx;
+				border-radius: 14rpx;
+				margin-bottom: 20rpx;
+				float: left;
+				box-sizing: border-box;
+				padding-bottom: 16rpx;
+				&:nth-child(2n){
+					margin-right: 0;
+				}
+				image{
+					width: 341rpx;
+					height: 341rpx;
+					border-radius: 20rpx 20rpx 0 0;
+					display: block;
+					margin-bottom: 20rpx;
+				}
+				.floor-item-content{
+					width: 100%;
+					padding: 0 15rpx;
+					box-sizing: border-box;
+				}
+				.title{
+					width: 100%;
+					height: 72rpx;
+					display: flex;
+					flex-direction: column;
+					padding: 10rpx 0;
+					.mclap{
+						width: 100%;
+						line-height: 36rpx;
+						text-overflow:ellipsis;
+						display: -webkit-box;
+						word-break: break-all;
+						-webkit-box-orient: vertical;
+						-webkit-line-clamp: 2;
+						overflow: hidden;
+						font-size: 26rpx;
+					}
+				}
+				.price{
+					color: #333333;
+					line-height: 44rpx;
+					.sm{
+						font-size: $font-size-24;
+					}
+					.big{
+						font-size: $font-size-28;
+					}
+				}
+			}
+		}
+	}
+</style>

+ 164 - 57
pages/tabBar/cart/cart.vue

@@ -9,10 +9,13 @@
 							<view class="shoptitle">
 								<!--选择商店的全部商品"-->
 								<view class="checkbox-box" @click.stop="checkShop(item)">
-									<button class="checkbox iconfont" 
+									<view class="checkbox iconfont" 
 											:class="[item.checked ?'icon-gouxuanl':'icon-weigouxuan']" 									
 											:disabled="item.isDisabled && !isshowDelbtn">
-									</button>
+									</view>
+								</view>
+								<view v-if="item.promotions" class="floor-item-act">
+									<view class="floor-tags" @click.stop="clickPopupShow(item,2)">{{item.promotions.name}}</view>	
 								</view>
 								<view class="text">{{item.name}}</view> 
 							</view>
@@ -20,34 +23,46 @@
 								<view 	class="goods-pros" v-for="(pros,idx) in item.cartList" :key="idx" >
 									<view class="goods-pros-t">
 										<!--选择商品-->
-										<view class="checkbox-box" @click.stop="ischeck(item,pros)" :class="[pros.validFlag == '3' && !isshowDelbtn ?'disabled' : '']">
-											<button class="checkbox iconfont" 
-												  :disabled="pros.validFlag == '3' && !isshowDelbtn"
-												  :class="[pros.productsChecked ?'icon-gouxuanl':'icon-weigouxuan']">
-											</button>
+										<view class="checkbox-box" @click.stop="ischeck(item,pros)" :class="[pros.validFlag == 3 && !isshowDelbtn ?'disabled' : '']">
+											<view class="checkbox iconfont" 
+												  :disabled="pros.validFlag == 3 && !isshowDelbtn"
+												  :class="[pros.productsChecked ? 'icon-gouxuanl':'icon-weigouxuan']">
+											</view>
 										</view>
 										<view class="pros-img" @click.stop="navToListPage(pros.productId)"	><image :src="pros.image ? pros.image:''" alt="" /></view>
 										<view class="pros-product">
 											<view class="producttitle" @click.stop="navToListPage(pros.productId)"	>
-												<text v-if="pros.validFlag == '3'" class="no-text">商品已下架</text>{{pros.name}}
+												<text v-if="pros.validFlag == 3" class="no-text">商品已下架</text>{{pros.name}}
 											</view>
 											<view class="productspec">规格:{{pros.unit ? pros.unit : ''}}</view>
 											<view class="productprice">
 												<!--使用过滤器对总价改变-->
-												<view class="price" :class="[pros.validFlag == '3' ?'disabled' : '']">
-													<text :class="[pros.validFlag == '3' ?'disabled' : 'money-sign']">¥</text>
+												<view class="price" :class="[pros.validFlag == 3 || pros.promotions.type == 1 && pros.promotions.mode == 1  ?'disabled' : '']">
+													<text :class="[pros.validFlag == 3 || pros.promotions.type == 1 && pros.promotions.mode == 1 ?'disabled' : 'money-sign']">¥</text>
 													{{pros.price | NumFormat}}
 												</view>
-												<view class="count" v-if="pros.validFlag == '2'"  :class="[isshowDelbtn ? 'none':'show']">
+												<view class="count" v-if="pros.validFlag == 2"  :class="[isshowDelbtn ? 'none':'show']">
 													<text class="count-tips" v-if="pros.number<pros.min">起订量:{{pros.min}}</text>
 													<text class="count-tips step" v-if="pros.isStep">购买量必须为起订量的整数倍</text>
 													<view class="number-box">
-														<view  class="iconfont icon-jianhao" :class="[pros.validFlag == '3'?'disabled':'']" @click="changeCountSub(item,pros)"></view>
+														<view  class="iconfont icon-jianhao" :class="[pros.validFlag == 3 ?'disabled':'']" @click="changeCountSub(item,pros)"></view>
 														<input class="btn-input" type="number" maxlength='4' v-model="pros.number" @blur="changeNnmber($event,item,pros)" @focus="changeInput(pros)">
-														<view  class="iconfont icon-jiahao"  :class="[pros.validFlag == '3'?'disabled':'']" @click="changeCountAdd(item,pros)"></view>
+														<view  class="iconfont icon-jiahao"  :class="[pros.validFlag == 3 ?'disabled':'']" @click="changeCountAdd(item,pros)"></view>
 													</view>
 												</view>
 											</view>
+											<view v-show="pros.actStatus==1" class="floor-item-act">
+												<view v-if="pros.promotions.type == 1 && pros.promotions.mode == 1"  class="floor-tags" @click.stop="clickPopupShow(pros,1)">
+													{{pros.promotions.name}}
+													<text v-if ="pros.promotions!=null">
+														:¥{{ pros.promotions == null ? '0.00' : pros.promotions.touchPrice | NumFormat}}
+													</text>
+												</view>
+												<view v-else class="floor-tags" @click.stop="clickPopupShow(pros,2)">{{pros.promotions.name}}</view>	
+											</view>
+											<view  v-if="pros.actStatus == null  &&  pros.ladderFlag == 1" class="floor-item-act">
+												<view class="floor-tags" @click.stop="clickPopupShow(pros,2)">阶梯价格</view>	
+											</view>
 										</view>	
 									</view>
 								</view>
@@ -72,7 +87,7 @@
 										</button>
 									</view>
 									<view class="pros-img">
-										<image :src="failure.mainImage ? failure.mainImage:''" alt="" />
+										<image :src="failure.image ? failure.image:''" alt="" />
 										<text class="img-tip">失效</text>
 									</view>
 									<view class="pros-product">
@@ -96,7 +111,16 @@
 						<view class="foot-check-delbtn">
 							<button class="delBtn" @tap.stop="showDelManager">删除</button>
 						</view>
-						<view class="sum">总价:<text class="money-sign">¥</text><text class="money">{{allPrice.toFixed(2)}}</text></view>
+						<view class="sum">
+							<view class="sum-none" v-if="reducedPrice>0">
+								<text class="money-sign">¥</text>
+								<text class="money">{{ totalOriginalPrice | NumFormat }}</text>
+								<text class="money-reduced"><text class="iconfont icon-biaoqian"></text>减<text>¥{{ reducedPrice | NumFormat}}</text></text>
+							</view>
+							<view class="sum-price">
+								总价:<text class="money-sign">¥</text><text class="money">{{allPrice | NumFormat}}</text>
+							</view>
+						</view>
 					</view>
 					<view v-if="!isshowDelbtn" class="footer-ri" >
 						<view class="btn hanld-btn" @tap="toConfirmation">去结算({{allCount}})</view>
@@ -115,6 +139,8 @@
 				</view>
 			</view>
 		</view>
+		<!-- 促销活动弹窗 -->
+		<activi-popup :product="handlerPros" :popupShow="popupShow"></activi-popup>
 		<!-- 透明模态层 -->
 		<modal-layer v-if='modallayer'></modal-layer>
 	</view>
@@ -124,6 +150,7 @@
 	import tuiSkeleton from "@/components/tui-skeleton/tui-skeleton"
 	import tuiLoadmore from "@/components/tui-components/loadmore/loadmore"
 	import tuiNomore from "@/components/tui-components/nomore/nomore"
+	import activiPopup from "@/components/cm-module/productDetails/cm-activipopu"
 	import modalLayer from "@/components/modal-layer"
 	import { mapState,mapMutations } from 'vuex';
 	
@@ -132,6 +159,7 @@
 			tuiSkeleton,
 			tuiLoadmore,
 			tuiNomore,
+			activiPopup,
 			modalLayer
 		},
 		data(){
@@ -141,12 +169,16 @@
 				userID:'',
 				alertType:'',
 				isStock:'',
+				popupShow:false,
+				handlerPros:{},//监听单挑促销商品
 				failureList:[],	//失效商品列表
 				goodsList:[],	//购物车的商品
 				delGoodsList:'',//要删除的商品
 				setGoodData:'', //确认订单的商品
 				isCheckAll:false,//是否全选
 				allPrice:0,//所有价格
+				totalOriginalPrice:0,//所有原价价
+				reducedPrice:0,//满减
 				allCount:0,//被选中的产品数量
 				isNnder:true,
 				isModallayer:false,
@@ -198,6 +230,10 @@
 					}
 				})	
 			},
+			clickPopupShow(pros,type){
+				this.popupShow = true;
+				this.handlerPros = pros;
+			},
 			setScrollHeight() {
 				// 窗口高度-footer高度
 				const {windowHeight, pixelRatio} = uni.getSystemInfoSync();
@@ -232,7 +268,7 @@
 								pros.shopID = item.shopID;
 								pros.isStep = false
 								pros.productsChecked = false
-								if(pros.validFlag == '3' ) {invalidLength++;}
+								if(pros.validFlag == 3 ) {invalidLength++;}
 								if(pros.step === 2){ 
 									if(pros.number % pros.min != 0){
 										pros.number = pros.min
@@ -247,10 +283,10 @@
 					} else {
 						this.goodsList = [];
 					}
-					if( responseData.failureList && responseData.failureList.length > 0){
+					if( data.invalid && data.invalid.length > 0){
 						let newFailureList = [],isFailureLayer;
-						responseData.failureList.forEach((failure,index) => {
-							if(failure.failureState == 1 || failure.failureState == 2) {
+						data.invalid.forEach((failure,index) => {
+							if(failure.status == 1 || failure.status == 2) {
 								isFailureLayer = true
 							}else{
 								isFailureLayer = false
@@ -274,6 +310,7 @@
 				console.log(pro.productsChecked)
 				this.updateProductCheckedAllBtn(item);
 				this.updateCheckAllBtn();
+				
 			},
 			updateProductCheckedAllBtn(item) {// 单独每个供应商的勾选判断
 				let productsList = item.cartList,
@@ -287,10 +324,10 @@
 					})
 				} else {
 					productsList.forEach(pros => {
-						if(pros.productsChecked && pros.validFlag != '3') {
+						if(pros.productsChecked && pros.validFlag != 3) {
 							productsCheckedLength++;
 						}
-						if(pros.validFlag == '3') {disabledLength++;}
+						if(pros.validFlag == 3) {disabledLength++;}
 					})
 				}
 				item.checked = productsCheckedLength === productsList.length - disabledLength;
@@ -321,10 +358,9 @@
 				this.updateCheckAllBtn();
 			},
 			setProductChecked(item) {
-				let products = item.cartList;
-				products.forEach(pros=>{
+				item.cartList.forEach(pros=>{
 					if(item.checked) {
-						if(pros.validFlag =='3'){
+						if(pros.validFlag == 3){
 							// 无效
 							this.isNnder = true;
 							pros.productsChecked = this.isshowDelbtn ?true :false;
@@ -337,7 +373,6 @@
 						pros.productsChecked = false;
 					}
 				})
-				
 			},
 			updateBothCheckBtn() {
 				if(this.isshowDelbtn) {
@@ -368,11 +403,11 @@
 				let productsList=[];
 				this.goodsList.map((item,index)=>{
 					productsList=item.cartList;
-					prosPrice=productsList.reduce((p,e)=>p+e.retailPrice*e.number,0);
+					prosPrice=productsList.reduce((p,e)=>p+e.price*e.number,0);
 					productsList.forEach(pros =>{
-						if(pros.validFlag =='3'){
+						if(pros.validFlag ==3){
 							validList.push(pros)
-							validPrice = validList.reduce((p,e)=>p+e.retailPrice*e.number,0);
+							validPrice = validList.reduce((p,e)=>p+e.price*e.number,0);
 							item.totalPrice = prosPrice - validPrice
 						}else{
 							item.totalPrice = prosPrice
@@ -390,10 +425,10 @@
 					productsList=item.cartList;
 					productsList.forEach(pros=>{	
 						if(pros.productsChecked){
-							prosPrice+=pros.retailPrice*pros.number;
-							if(pros.validFlag =='3'){
+							prosPrice+=pros.price*pros.number;
+							if(pros.validFlag ==3){
 								validList.push(pros)
-								validPrice = validList.reduce((p,e)=>p+e.retailPrice*e.number,0);
+								validPrice = validList.reduce((p,e)=>p+e.price*e.number,0);
 								this.allPrice = prosPrice - validPrice
 							}else{
 								this.allPrice = prosPrice
@@ -413,7 +448,7 @@
 					productsList.forEach(pros=>{
 						if(pros.productsChecked){
 							prosAllCount+=parseInt(pros.number);
-							if(pros.validFlag =='3'){
+							if(pros.validFlag ==3){
 								validList.push(pros)
 								validList.forEach(val =>{
 									validCount += val.number
@@ -480,19 +515,18 @@
 				this.totalShopPeice();
 			},
 			processActivityPrice(pros){//单独处理活动价格和阶梯价格
-				let ladderPriceList = pros.ladderPriceList;
-				if(pros.ladderPriceFlag == '0' || pros.actStatus == 1){
-					pros.retailPrice = pros.retailPrice
+				let ladderPriceList = pros.ladderPrices;
+				if(pros.ladderFlag == '0' || pros.actStatus == 1){
+					pros.price = pros.price
 				}else{
 					ladderPriceList.forEach((item,index)=>{
 						if(pros.number>=item.buyNum){
-							pros.retailPrice = item.buyPrice
+							pros.price = item.buyPrice
 						}
 					})
 				}
 			},
 			updateShoppogNum(pros){//加减购物车商品更新到后台
-				console.log(pros)
 				let params ={userID:this.userID,productID:pros.productId,productCount:pros.number}
 				this.ProductService.shoppingCartUpdate(params).then(response =>{
 					this.isshowDelbtn = false;
@@ -580,7 +614,7 @@
 							item.checked = false;
 						}
 						item.cartList.forEach(pros => {
-							if(pros.validFlag == '3') {
+							if(pros.validFlag == 3) {
 								pros.productsChecked = false;
 							}
 						})
@@ -609,7 +643,7 @@
 				})
 				this.failureList.forEach(failure=>{
 					if(failure.productsChecked){
-						this.delGoodsList += failure.productID+','
+						this.delGoodsList += failure.productId+','
 					}
 				})
 				if(this.delGoodsList.length == 0){
@@ -658,15 +692,15 @@
 				this.$api.navigateTo(`/pages/goods/product?id=${id}`)
 			},
 			failureToProduct(failure){
-				if(failure.failureState == 1){
+				if(failure.status == 1){
 					this.$util.msg('商品已丢失,不能查看',2000)
 					return
-				}else if(failure.failureState == 2){
+				}else if(failure.status == 2){
 					this.$util.msg('商品已停售,不能查看',2000)
 					return
 				}else{
 					this.isModallayer = true;
-					this.$api.navigateTo(`/pages/goods/product?id=${failure.productID}`)
+					this.$api.navigateTo(`/pages/goods/product?id=${failure.productId}`)
 				}
 			},
 			failureStateText(state){
@@ -801,22 +835,42 @@
 			display: flex;
 			align-items: center;
 			height: 80rpx;
-			// border-bottom: 1px solid #EBEBEB;
 			line-height: 80rpx;
 			.checkbox-box{
 				padding: 10rpx;
 			}
 			.text{
+				width: 450rpx;
 				display: block;
 				overflow: hidden;
 				text-overflow:ellipsis;
 				white-space: nowrap;
-				margin-left: 37rpx;
+				margin-left: 20rpx;
 				font-size: $font-size-28;
 				color: $text-color;
 				text-align: left;
 				font-weight: bold;
 			}
+			.floor-item-act{
+				height: 56rpx;
+				text-align: center;
+				box-sizing: border-box;
+				float: left;
+				padding:10rpx 0;
+				margin-left: 10rpx;
+				.floor-tags{
+					float: right;
+					height: 36rpx;
+					border-radius: 4rpx;
+					background-color: rgba(225, 86, 22, 0.1);
+					line-height: 36rpx;
+					color: $color-system;
+					text-align: center;
+					display: inline-block;
+					padding:0 16rpx;
+					font-size: $font-size-20;
+				}
+			}
 		}
 		.goods-pros{
 			width: 100%;
@@ -908,10 +962,8 @@
 				font-size: $font-size-26;
 			}
 			.productprice{
-				height: 48rpx;
-				position: absolute;
 				width: 100%;
-				bottom: 0;
+				height: 48rpx;
 				.price{
 					line-height: 48rpx;
 					font-size: $font-size-28;
@@ -920,6 +972,7 @@
 					float: left;
 					&.disabled{
 						color: #999999;
+						text-decoration: line-through;
 					}
 					.money-sign{
 						font-size: $font-size-24;
@@ -1004,6 +1057,26 @@
 					}
 				}
 			}
+			.floor-item-act{
+				height: 56rpx;
+				text-align: center;
+				box-sizing: border-box;
+				float: left;
+				padding:10rpx 0;
+				margin-left: 10rpx;
+				.floor-tags{
+					float: right;
+					height: 36rpx;
+					border-radius: 4rpx;
+					background-color: rgba(225, 86, 22, 0.1);
+					line-height: 36rpx;
+					color: $color-system;
+					text-align: center;
+					display: inline-block;
+					padding:0 16rpx;
+					font-size: $font-size-20;
+				}
+			}
 		}
 	}
 	.failure-list{
@@ -1213,17 +1286,51 @@
 				}
 			}
 			.sum{
-				font-size: $font-size-28;
-				line-height: 110rpx;
-				color: $text-color;
-				display: flex;
-				justify-content: flex-end;
-				.money{
-					color: #FF2A2A;
+				width: 280rpx;
+				height: 110rpx;
+				float: right;
+				.sum-none{
+					width: 100%;
+					height: 55rpx;
+					line-height: 55rpx;
+					color: $text-color;
+					float: left;
+					text-align: right;
+					.money{
+						font-size: $font-size-26;
+						color: #999999;
+						text-decoration: line-through;
+					}
+					.money-sign{
+						font-size: $font-size-26;
+						color: #999999;
+						text-decoration: line-through;
+					}
+					.money-reduced{
+						margin-left: 10rpx;
+						font-size: $font-size-26;
+						color: $color-system;
+						.iconfont{
+							font-size: $font-size-34;
+						}
+					}
 				}
-				.money-sign{
-					font-size: $font-size-24;
-					color: #FF2A2A;
+				.sum-price{
+					text-align: right;
+					width: 100%;
+					height: 55rpx;
+					line-height: 55rpx;
+					font-size: $font-size-30;
+					color: $text-color;
+					float: left;
+					font-weight: bold;
+					.money{
+						color: #FF2A2A;
+					}
+					.money-sign{
+						font-size: $font-size-24;
+						color: #FF2A2A;
+					}
 				}
 			}
 		}

+ 2 - 2
pages/tabBar/home/home.vue

@@ -158,7 +158,7 @@
 	import cmCustom from '@/components/cm-module/home/cm-custom.vue'
 	import activityAlert from '@/components/cm-module/activity/activity_on_1.vue'
 	import uniStars from '@/components/uni-stars/uni-stars.vue'
-	import { userInfoLogin, queryHomeInfo } from "@/api/use.js"
+	import { userInfoLogin } from "@/api/use.js"
 	import { queryPreferred } from "@/api/product.js"
 	import { mapState,mapMutations} from 'vuex';
 	export default {
@@ -263,7 +263,7 @@
 				})
 			},		
 			getHomeInformation(){//初始化首页数据	
-				queryHomeInfo({}).then(res =>{
+				this.CommonService.GetHomeModulesDataInfo({ userId:this.userID }).then(res =>{
 					let data = res.data;
 					this.bannerImageList = data.bannerImageList
 					this.mallPageModules = data.mallPageModules

+ 2 - 2
services/ajax.env.js

@@ -2,9 +2,9 @@ let URL_CONFIG = ""
 if(process.env.NODE_ENV === 'development'){
     // 开发环境
 	// URL_CONFIG = 'http://192.168.2.68:8008'	 //本地IP联调地址
-	// URL_CONFIG = 'http://192.168.2.67: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{
     // 生产环境

+ 4 - 0
services/common.service.js

@@ -10,4 +10,8 @@ export default class CommonService {
 	GetHomeClassify (data = {}) {
 		return this.AjaxService.get({ url:'/home/classify', data, isLoading: true })
 	}
+	/* 首页初始化 */
+	GetHomeModulesDataInfo (data = {}) {
+		return this.AjaxService.get({ url:'/home/modules', data, isLoading: false })
+	}
 }

+ 23 - 0
services/product.service.js

@@ -16,6 +16,7 @@ export default class ProductService {
 	queryProductPreferred (data = {}) {
 		return this.AjaxService.get({ url:'/product/preferred', data, isLoading: true })
 	}
+	
 	/**
 	 * @商品列表-查询商品价格
 	 * @param:userId 用户ID(未登录传0或者'')
@@ -24,6 +25,24 @@ export default class ProductService {
 	querySearchProductPrice (data = {}) {
 		return this.AjaxService.get({ url:'/product/listPrice', data, isLoading: false })
 	}
+	
+	/**
+	 * @查询凑单商品页初始化
+	 * @param:promotionsId 促销ID
+	 */
+	queryProductPromotionInfo (data = {}) {
+		return this.AjaxService.get({ url:'/product/promotion/info', data, isLoading: false })
+	}
+	/**
+	 * @查询凑单商品列表
+	 * @param:promotionsId 促销ID
+	 * @param:pageSize 查询条数
+	 * @param:pageNum 查询页数
+	 */
+	queryProductPromotionList (data = {}) {
+		return this.AjaxService.get({ url:'/product/promotion/products', data, isLoading: true })
+	}
+	
 	/**
 	 * @商品详情-查询商品详情
 	 * @param:userId 用户ID(未登录传0或者'')
@@ -32,6 +51,7 @@ export default class ProductService {
 	queryProductDetils (data = {}) {
 		return this.AjaxService.get({ url:'/product/details', data, isLoading: false })
 	}
+	
 	/**
 	 * @加入购物车
 	 * @param:userId 用户ID(必填)
@@ -41,6 +61,7 @@ export default class ProductService {
 	shoppingAddCart (data = {}) {
 		return this.AjaxService.post({ url:'/shoppingCart/addCart', data, isLoading: true })
 	}
+	
 	/**
 	 * @购物车列表
 	 * @param:userId 用户ID(必填)
@@ -48,6 +69,7 @@ export default class ProductService {
 	queryShoppingCartList (data = {}) {
 		return this.AjaxService.get({ url:'/shoppingCart/list', data, isLoading: false })
 	}
+	
 	/**
 	 * @更新购物车商品增减
 	 * @param:userId 用户ID(必填)
@@ -57,6 +79,7 @@ export default class ProductService {
 	shoppingCartUpdate (data = {}) {
 		return this.AjaxService.post({ url:'/shoppingCart/update', data, isLoading: true })
 	}
+	
 	/**
 	 * @删除购物车商品
 	 * @param:userId 用户ID(必填)