Просмотр исходного кода

commit -m 商品购物车联调

zhengjinyi 4 лет назад
Родитель
Сommit
7fd68d228d

+ 9 - 0
common/config/utilsTools.js

@@ -102,12 +102,21 @@ const _Tools = {
 		s = s < 10 ? ('0' + s) : s;
 	    return y + '-' + MM + '-' + d + ' ' + h + ':' + m + ':' + s;
 	},
+	FormatMoney:function(num){
+		// 金额千分位
+		return num.toString().replace(/\d+/, function (n) { // 先提取整数部分
+			return n.replace(/(\d)(?=(\d{3})+$)/g, function ($1) { // 对整数部分添加分隔符
+				return $1 + ",";
+			});
+		});
+	},
 }
 
 /**
  *@导出
  */ 
 module.exports = {
+	FormatMoney: _Tools.FormatMoney,
 	formatDate: _Tools.formatDate,
 	navigateTo: _Tools.navigateTo,
 	redirectTo: _Tools.redirectTo,

Разница между файлами не показана из-за своего большого размера
+ 0 - 2
common/css/iconfont.scss


+ 2 - 2
components/cm-module/headerNavbar/header-back.vue

@@ -117,12 +117,12 @@
 		    },
 		    _goHome: function () {
 		      	uni.navigateTo({
-		        	url: '/pages/index/index'
+		        	url: '/pages/tabBar/index/index'
 		      	})
 		    },
 		    _goUser: function () {
 		      	uni.navigateTo({
-		        	url: '/pages/index/index'
+		        	url: '/pages/tabBar/user/index'
 		      	})
 		    }, 
 			_goOrderList: function () {

+ 1 - 1
components/cm-module/headerNavbar/headerNavbar.vue

@@ -6,7 +6,7 @@
 	  	</view>
 	  	<view class="navbar-icon" v-if="navbarData.showCapsule ? navbarData.showCapsule : true" 
 			  :style="{width:headerBtnPosi.width+'px;',lineHeight:(navbarBtn.height)+'px',top:navbarBtn.top + statusBarHeight+'px;',left:navbarBtn.right+'px;',height:(navbarBtn.height)+'px;'}">
-			  <text v-if='haveBack' @click="_goBack" class="iconfont icon-shangyibu" :style="{width:headerBtnPosi.width/2+'px',height:navbarBtn.height+'px'}"></text>
+			  <text v-if='haveBack' @click="_goBack" class="iconfont icon-daohangfanhui" :style="{width:headerBtnPosi.width/2+'px',height:navbarBtn.height+'px'}"></text>
 	      	  <text  v-if='haveBack' class="iconfont icon-vertical_line" :style="{borderColor:navbarData.borderColor ? navbarData.borderColor : 'rgba(0,0,0,0.4)'}"></text>
 			  <text @click="_goHome" class="iconfont icon-fanhuishouye" :style="{width:headerBtnPosi.width/2+'px',height:navbarBtn.height+'px'}"></text>
 	  	</view>

+ 2 - 2
components/cm-module/productDetails/cm-activipopu.vue

@@ -2,14 +2,14 @@
 	<!--促销活动弹窗提示-->
 	<tui-bottom-popup :radius="true" :show="popupShow" @close="hidePopup()">
 		<view class="tui-popup-box clearfix">
-			<template v-if="product.actStatus == null  &&  product.ladderPriceFlag == 1">
+			<template v-if="product.activeStatus == 1">
 				<view class="tui-scrollview-box">
 					<view class="ladder-main clearfix">
 						<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.ladderPriceList" :key="index">
+						<view class="ladder-item" v-for="(ladd, index) in product.ladderList" :key="index">
 							<view class="ladder-item-td">{{ ladd.buyNum }}</view>
 							<view class="ladder-item-td">{{ ladd.buyPrice | NumFormat }}</view>
 						</view>

+ 35 - 12
components/cm-module/productDetails/cm-price.vue

@@ -5,16 +5,17 @@
 		<view class="wrap-main-item">
 			<view class="p-price tui-skeleton-fillet">
 				<text class="txt sm">¥</text>
-				<text class="txt big">{{ ( product.retailPrice)| NumFormat }} </text>
+				<text class="txt big">{{ showIndexOfMoney }} </text>
+				<text class="txt sm">{{ smallMoney }} </text>
 			</view>
-			<view class="floor-item-act">
+			<view class="floor-item-act" v-if="product.activeStatus == 1">
 				<view class="tag" @click.stop="clickPopupShow()">活动价</view>
 			</view>
 		</view>
 		<!--促销活动弹窗提示-->
 		<tui-bottom-popup :radius="true" :show="popupShow" @close="hidePopup()">
 			<view class="tui-popup-box clearfix">
-				<template v-if="product.actStatus == 0 && product.ladderPriceFlag == 1">
+				<template v-if="product.activeStatus == 1">
 					<view class="tui-scrollview-box">
 						<view class="ladder-main clearfix">
 							<view class="ladder-item">
@@ -23,10 +24,10 @@
 							</view>
 							<view
 								class="ladder-item"
-								v-for="(ladd, index) in product.ladderPriceList"
+								v-for="(ladd, index) in product.ladderList"
 								:key="index"
 							>
-								<view class="ladder-item-td">{{ ladd.buyNumRangeShow }}</view>
+								<view class="ladder-item-td">{{ ladd.buyNum }}</view>
 								<view class="ladder-item-td">{{ ladd.buyPrice | NumFormat }}</view>
 							</view>
 						</view>
@@ -121,11 +122,7 @@ export default {
 			type: Number,
 			default: 2
 		},
-		shopID: {
-			type: Number,
-			default: 2
-		},
-		ladderPriceList: {
+		ladderList: {
 			type: Array
 		},
 		promotion: {
@@ -134,9 +131,13 @@ export default {
 	},
 	data() {
 		return {
+			productInfo:{},
 			popupShow: false,
 			promotionType: 0,
-			isIphoneX: this.$store.state.isIphoneX
+			isIphoneX: this.$store.state.isIphoneX,
+			ableUserMoney:'',
+			showIndexOfMoney:'',
+			smallMoney:''
 		}
 	},
 	filters: {
@@ -145,11 +146,33 @@ export default {
 			return Number(text).toFixed(2)
 		}
 	},
-	created() {},
+	created() {
+		this.InfoData(this.product)			
+	},
 	computed: {
 		...mapState(['hasLogin', 'isWxAuthorize'])
 	},
 	methods: {
+		InfoData(data){
+			this.productInfo = data
+			if(this.productInfo.price == 0){
+				this.showIndexOfMoney ='0';
+				this.smallMoney=".00"
+			}else{
+				this.ableUserMoney = this.$api.FormatMoney(this.productInfo.price) ;
+				let i =  this.ableUserMoney.toString().lastIndexOf('.');
+				if(i==-1){
+					this.showIndexOfMoney=this.$api.FormatMoney(this.ableUserMoney)
+					this.smallMoney=".00"
+				}else{
+					this.smallMoney = this.ableUserMoney.toString().substring(i);
+					this.showIndexOfMoney= this.$api.FormatMoney(this.ableUserMoney.toString().substring(0,i))
+					if(this.smallMoney.length == 2) { //补0,实际上用不着
+						this.smallMoney = this.smallMoney + '0';
+					}
+				}
+			}
+		},
 		clickPopupShow(type) {
 			this.popupShow = true
 			this.promotionType = type

+ 8 - 8
components/cm-module/scrollTop/scrollTop.vue

@@ -1,8 +1,8 @@
 <template name="scrollTop">
 	<!-- 商品详情价格判断 -->
 	<view>
-		<view class="scrollTop" :style="{bottom:bottom+'rpx'}">
-			<view class="icon top" @click="onPageScrollTop" :class="isScrollTop ? 'show' : 'none'">
+		<view class="scrollTop" :style="{bottom:bottom+'rpx'}" :class="isScrollTop ? 'show' : 'none'">
+			<view class="icon top" @click="onPageScrollTop">
 				<text class="iconfont icon-zhiding"></text>
 			</view>
 		</view>
@@ -58,6 +58,12 @@
 		position: fixed;
 		right: 20rpx;
 		z-index: 999;
+		&.show{
+			display: block;
+		}
+		&.none{
+			display: none;
+		}
 		.icon{
 			width: 80rpx;
 			height: 80rpx;
@@ -78,12 +84,6 @@
 			}
 			&.top{
 				background-color: rgba(25, 25, 25, 0.3);
-				&.show{
-					opacity: 1;
-				}
-				&.none{
-					opacity: 0;
-				}
 			}
 			.iconfont{
 				font-size: $font-size-26;

+ 8 - 0
pages.json

@@ -44,6 +44,14 @@
 				"navigationBarTitleText": "立即下单"
 			}
 		},
+		{
+			"path": "pages/goods/cart",
+			"style": {
+				"navigationBarTitleText": "购物车",
+				"enablePullDownRefresh":true,
+				"navigationStyle":"custom"
+			}
+		},
 		{
 			"path": "pages/goods/search",
 			"style": {

+ 1436 - 0
pages/goods/cart.vue

@@ -0,0 +1,1436 @@
+<template>
+	<view class="container cart clearfix" v-if="hasLogin" :style="{paddingTop:CustomBar+'px'}"> 	
+		<headerNavbar :systeminfo='systeminfo' :navbar-data='nvabarData' :headerBtnPosi ="headerBtnPosi" :page='1'></headerNavbar>
+		<tui-skeleton v-if="skeletonShow" backgroundColor="#fafafa" borderRadius="10rpx" :isLoading	="true" :loadingType="5"></tui-skeleton>
+		<view class="container-cart-main tui-skeleton" :style="{paddingTop:isshowDelbtn ? '0rpx':'80rpx'}">
+			<view class="foot-check-delbtn" v-if="!isshowDelbtn && goodsList.length>0" :style="{top:CustomBar+'px'}">
+				<view class="foot-text">共<text>{{kindCount}}</text>件商品</view>
+				<view class="delBtn" @tap.stop="showDelManager">删除</view>
+			</view>
+			<view v-if="!isEmpty" class="container-cart">
+				<view class="cart-content" :style="{paddingBottom :isIphoneX ? '130rpx' : '100rpx'}">
+					<view class="goods-list">
+						<view v-for="(item, index) in goodsList" :key="index" class="goods-item clearfix">
+							<view class="shoptitle">
+								<!--选择商店的全部商品"-->
+								<view class="checkbox-box" @click.stop="checkShop(item)">
+									<view class="checkbox iconfont" :class="[item.checked ?'icon-xuanze':'icon-weixuanze']"></view>
+								</view>
+								<view class="text">{{item.name}}</view> 
+							</view>
+							<view class="productlist">
+								<view 	class="goods-pros" v-for="(pros,idx) in item.productList" :key="idx" >
+									<view class="goods-pros-t">
+										<!--选择商品-->
+										<view class="checkbox-box" @click.stop="ischeck(item,pros)">
+											<view class="checkbox iconfont" :class="[pros.productsChecked ? 'icon-xuanze':'icon-weixuanze']"></view>
+										</view>
+										<view class="pros-img" @click.stop="navToListPage(pros.productId)"	><image :src="pros.mainImage ? pros.mainImage:''" alt="" /></view>
+										<view class="pros-product">
+											<view class="producttitle" @click.stop="navToListPage(pros.productId)"	>{{pros.productName}}</view>
+											<view class="productspec">规格:{{pros.unit ? pros.unit : ''}}</view>
+											<view class="floor-item-act" v-if="pros.activeStatus == 1">
+												<view class="tag"@click.stop="clickPopupShow(pros,2)">活动价</view>
+											</view>
+											<view class="productprice">
+												<!--使用过滤器对总价改变-->
+												<view class="price"><text>¥</text>{{ pros.price  | NumFormat }}</view>
+												<view class="count">
+													<view class="number-box">
+														<view  class="iconfont icon-jianhao" @click="changeCountSub(item,pros)"></view>
+														<input class="btn-input" type="number" maxlength='4' v-model="pros.productCount" @blur="changeNnmber($event,item,pros)" @focus="changeInput(pros)">
+														<view  class="iconfont icon-jiahao"  @click="changeCountAdd(item,pros)"></view>
+													</view>
+												</view>
+											</view>
+										</view>	
+									</view>
+								</view>
+							</view>	
+							<view class="goods-pros-b clearfix" :class="[isshowDelbtn ? 'none':'show']" >
+								<view class="sum-none" v-if="item.reducedPrice>0">
+									<text class="money-sign">¥</text>
+									<text class="money">{{ item.totalOriginalPrice | NumFormat }}</text>
+									<text class="money-reduced">减<text>¥{{ item.reducedPrice | NumFormat}}</text></text>
+								</view>
+								<view class="sum">合计:<text class="money"><text class="money-sign">¥</text>{{item.totalPrice | NumFormat}}</text></view>
+							</view>
+						</view>
+					</view>	
+					<view class="failure-list" v-if="failureList.length>0">
+						<view class="failure-title">
+							<view class="title-txt">失效商品<text>{{failureList.length}}件</text></view>
+							<view class="title-btn" @click.stop="deletefailureList"><text class="butto">清空失效商品</text></view>
+						</view>
+						<view class="productlist">
+							<view class="goods-pros" v-for="(failure,failureIdx) in failureList" :key="failureIdx" >
+								<view class="goods-pros-t" @click.stop="navToListPage(failure)">
+									<!--选择商品-->
+									<view class="checkbox-box" @click.stop="ischeckFailure(failure)" v-if="isshowDelbtn">
+										<button class="checkbox iconfont" 
+												:class="[ failure.productsChecked ? 'icon-xuanze':'icon-weixuanze']">
+										</button>
+									</view>
+									<text class="img-tip">失效</text>
+									<view class="pros-img">
+										<image :src="failure.image ? failure.image:''" alt="" />
+									</view>
+									<view class="pros-product">
+										<view class="producttitle">{{failure.name}}</view>
+										<view class="productspec">规格:{{failure.unit ? failure.unit : ''}}</view>
+										<view class="productstate">商品已下架</view>
+									</view>
+									<view class="pros-marks" v-if="failure.isFailureLayer"></view>
+								</view>
+							</view>
+						</view>	
+					</view>
+				</view>
+				<!-- 脚部菜单 -->
+				<view class="footer">
+					<view class="footer-le">
+						<view class="foot-check checkbox-box" @tap.stop="checkAll()">
+							<button class="checkbox iconfont" :class="[isCheckAll?'icon-xuanze':'icon-weixuanze']"></button> 
+							<view class="text">全选</view>
+						</view>
+				
+						<view class="sum">
+							<view v-if="!isshowDelbtn" 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>
+					</view>
+					<view v-else class="footer-del">
+						<view class="btn btn-cancel" @tap.stop="hideDelManage">取消</view>
+						<view class="btn btn-confirm" @tap.stop="deleteList">删除</view>
+					</view>
+				</view>
+			</view>
+			<view v-else class="cart-content empty">
+				<view  class="empty-container">
+					<image class="empty-container-image" :src="StaticUrl+'icon-empty-cart.png'" mode="aspectFit"></image>
+					<text class="error-text">购物车空空的,快去逛逛吧~</text>
+				</view>
+			</view>
+		</view>
+		<!-- 操作弹窗 -->
+		<tui-modal :show="modal" @click="handleClick" @cancel="hideMobel" :content="contentModalText" color="#333" :size="32" shape="circle" :maskClosable="false"></tui-modal>
+		<!-- 促销活动弹窗 -->
+		<activi-popup :product="handlerPros" :popupShow="popupShow"></activi-popup>
+		<!-- 透明模态层 -->
+		<modal-layer v-if='modallayer'></modal-layer>
+	</view>
+</template>
+<script>
+	import authorize from '@/common/config/authorize.js'
+	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 headerNavbar from "@/components/cm-module/headerNavbar/headerNavbar.vue" //顶部自定义胶囊'
+	import activiPopup from "@/components/cm-module/productDetails/cm-activipopu"
+	import modalLayer from "@/components/modal-layer"
+	import { mapState,mapMutations } from 'vuex';
+	import { cartList } from '@/common/json/data.json.js' //本地数据
+	
+	export default{
+		components:{
+			tuiSkeleton,
+			tuiLoadmore,
+			tuiNomore,
+			modalLayer,
+			headerNavbar,
+			activiPopup
+		},
+		data(){
+			return{
+				nvabarData: {//顶部自定义导航
+					showCapsule: 1, // 是否显示左上角图标  1表示显示  0表示不显示,
+					showSearch: 0,
+					title: '购物车', // 导航栏 中间的标题
+				},
+				headerBtnPosi:this.setHeaderBtnPosi(),//获取设备顶部胶囊高度
+				systeminfo:this.setSysteminfo(),		 //获取设备信息
+				CustomBar:this.CustomBar,// 顶部导航栏高度
+				isIphoneX:this.$store.state.isIphoneX,
+				userId:'',
+				alertType:'',
+				popupShow:false,
+				handlerPros:{},//监听单挑促销商品
+				failureList:[],	//失效商品列表
+				goodsList:[],	//购物车的商品
+				delGoodsList:'',//要删除的商品
+				setGoodData:'', //确认订单的商品
+				isCheckAll:false,//是否全选
+				kindCount:0,//购物车宝贝数量
+				allPrice:0,//所有价格
+				totalOriginalPrice:0,//所有原价价
+				reducedPrice:0,//满减
+				allCount:0,//被选中的产品数量
+				isModallayer:false,
+				skeletonShow:true,
+				isshowDelbtn:false,
+				isDisabled: false, // 供应商/店铺全选是否禁用状态
+				isNoConfim:false,
+				isEmpty:false,//显示空购物车
+				scrollHeight: 'auto',
+				nomoreText: '上拉显示更多',
+				hasNextPage: false,
+				loadding: false,
+				pullUpOn: true,
+				pullFlag: true,
+				pageSize: 10,
+				pageNum: 1,
+				submitIds:[],
+				modal:false,
+				contentModalText:'',
+				deleteType:0,
+				
+			}
+		},
+		onLoad(){
+			this.setScrollHeight();
+		},
+		computed: {
+			...mapState(['hasLogin','userInfo'])
+		},
+		filters:{
+			NumFormat(value) {//处理金额
+				return Number(value).toFixed(2);
+			},
+			totalprice(val,count){//单件商品的价格 × 数量
+				return (val * count).toFixed(2)
+			}
+		},	
+		methods:{
+			initData(){
+				this.isModallayer = false //遮罩层 防止多次点击
+				this.isCheckAll=false//是否全选
+				this.submitIds = []
+				this.$api.getStorage().then((resolve) => {
+					this.userId = resolve.userId ? resolve.userId : 0;
+					this.InitGetCartGoodsList();
+				})	
+			},
+			clickPopupShow(pros,type){
+				this.popupShow = true;
+				this.handlerPros = pros;
+			},
+			setScrollHeight() {
+				// 窗口高度-footer高度
+				const {windowHeight, pixelRatio} = uni.getSystemInfoSync();
+				setTimeout(()=> {
+					const query = uni.createSelectorQuery().in(this);
+					query.selectAll('.footer').boundingClientRect();
+					query.exec(res => {
+						this.windowHeight = windowHeight;
+						if(res[0][0]) {
+							this.scrollHeight = windowHeight - res[0][0].height;
+						}
+					})
+				}, 500)
+			},
+			InitGetCartGoodsList(){//初始化购物车 index:1
+				this.ProductService.QueryShoppingCartList({userId:this.userId}).then(response =>{
+					this.skeletonShow = false
+					let data = response.data
+					this.kindCount = data.cartQuantity
+					if( data.shopList.length > 0 || data.invalid.length > 0){
+						this.isEmpty =false
+					}else{
+						this.isEmpty =true
+					}
+					if(data.shopList && data.shopList.length > 0 ){
+						this.goodsList = data.shopList;
+						console.log(this.goodsList)
+						this.totalShopPeice()
+					} else {
+						this.goodsList = [];
+					}
+					if( data.invalid && data.invalid.length > 0){
+						let newFailureList = [],isFailureLayer;
+						data.invalid.forEach((failure,index) => {
+							if(failure.status == 1 || failure.status == 2) {
+								isFailureLayer = true
+							}else{
+								isFailureLayer = false
+							}
+							newFailureList.push(Object.assign({},failure,{isFailureLayer:isFailureLayer}))
+						})
+						this.failureList = newFailureList
+					} else {
+						this.failureList = [];
+					}
+				}).catch(error =>{
+					this.$util.msg(error.msg,2000);
+				})
+			},		
+			ischeckFailure(failure){
+				failure.productsChecked = !failure.productsChecked
+				this.updateCheckAllBtn()
+			},
+			ischeck(item,pro){//为未选中的时候改变为true,反之为true
+				pro.productsChecked = !pro.productsChecked;
+				if(pro.productsChecked) {
+					if(!this.submitIds.includes(pro.productID*1)){
+						this.submitIds.push(pro.productID);
+					}
+				} else {
+					var lent = this.submitIds.indexOf(pro.productID*1);
+					if(lent >=0 ){
+						this.submitIds.splice(lent, 1);
+					}
+				}
+				this.updateProductCheckedAllBtn(item);
+				this.updateCheckAllBtn();
+				
+			},
+			updateProductCheckedAllBtn(item) {// 单独每个供应商的勾选判断
+				let productList = item.productList,
+					productsCheckedLength = 0,
+					disabledLength = 0;
+				if(this.isshowDelbtn) {
+					productList.forEach(pros => {
+						if(pros.productsChecked) {
+							productsCheckedLength++;
+						}
+					})
+				} else {
+					productList.forEach(pros => {
+						if(pros.productsChecked) {
+							productsCheckedLength++;
+						}
+					})
+				}
+				item.checked = productsCheckedLength === productList.length;
+			},
+			updateCheckAllBtn() {// 全选勾选判断
+				let goodsCheckedLength = 0,
+					goodsList = this.goodsList,
+					failureList = this.failureList;
+				goodsList.forEach(item => {
+					if(item.checked) {
+						goodsCheckedLength++;
+					}
+				})
+				failureList.forEach(failureItem=>{
+					if(failureItem.productsChecked){
+						goodsCheckedLength++;
+					}
+				})
+				if(this.isshowDelbtn){
+					this.isCheckAll = goodsCheckedLength === goodsList.length + failureList.length;
+				}else{
+					this.isCheckAll = goodsCheckedLength === goodsList.length;
+				}
+			},
+			checkShop(item){//与单选商品类似
+				item.checked = !item.checked;
+				this.setProductChecked(item);
+				this.updateCheckAllBtn();
+			},
+			setProductChecked(item) {
+				item.productList.forEach(pros=>{
+					if(item.checked) {
+						pros.productsChecked = true;
+						if(!this.submitIds.includes(pros.productId*1)){
+							this.submitIds.push(pros.productId);
+						}
+					} else {
+						pros.productsChecked = false;
+						var lent = this.submitIds.indexOf(pros.productId*1);
+						if(lent >=0 ){
+							this.submitIds.splice(lent, 1);
+						}
+					}
+				})
+			},
+			updateBothCheckBtn() {
+				if(this.isshowDelbtn) {
+					// 当管理删除按钮出现时,失效的商品可被选择
+					this.goodsList.forEach((item)=>{
+						item.checked = this.isCheckAll;
+						this.setProductChecked(item);
+					})
+					//删除按钮 全选包括失效商品勾选
+					this.failureList.forEach(failureItem=>{
+						failureItem.productsChecked = this.isCheckAll;
+					})
+				} else {
+					this.goodsList.forEach((item)=>{
+						item.checked = this.isCheckAll && !item.isDisabled;
+						this.setProductChecked(item);
+					})
+				}
+			},
+			checkAll(){//全选方法内调用方法
+				this.isCheckAll = !this.isCheckAll;
+				this.updateBothCheckBtn();     
+			},
+			totalShopPeice(){//每次所属会所下的商品增减重新计算合计价格&减去含有下架的商品
+				let touchPrice = 0;
+				let reducedPrice = 0;//商铺合计满减价
+				this.goodsList.map((item,index)=>{
+					let _totalPrice = 0;
+					let _reducedPrice = 0;
+					let _totalOriginalPrice =0;
+					item.productList.forEach(pros=>{
+						let _price = pros.price*pros.productCount
+						_totalOriginalPrice += pros.price*pros.productCount;
+						if(pros.promotion && pros.promotion.type != 2 && pros.promotion.mode == 2){
+							if(_price >= pros.promotion.touchPrice){
+								_price = _price - pros.promotion.reducedPrice
+								_reducedPrice += pros.promotion.reducedPrice
+							}
+							_totalPrice +=  _price
+						}else{
+							_reducedPrice = 0;
+							_totalPrice += pros.price*pros.productCount;
+						}
+					})
+					item.reducedPrice = _reducedPrice
+					item.totalOriginalPrice = _totalOriginalPrice
+					item.totalPrice = _totalPrice
+					console.log('合计',item.totalPrice)
+				})
+			},
+			totalPeice(){//计算总价格,每次调用此方法,将初始值为0,遍历价格并累加
+				let totalPrice = 0;
+				let reducedPrice = 0;
+				let originalPrice = 0;
+				this.goodsList.forEach((item,index)=>{
+					let supplierPrice = 0;
+					let supplierReducedPrice = 0;
+					item.totalprice = 0;
+					item.reducedprice = 0;
+					item.originalprice = 0;
+					item.productList.forEach(pros=>{	
+						if(pros.productsChecked){								
+							supplierPrice += pros.price*pros.productCount;
+							// 单品满减
+							if(pros.promotion && pros.promotion.type*1===1 && pros.promotion.mode*1===2){
+								// 单品满减-重新计算供应商总价/满减金额
+								if(pros.price*pros.productCount >= pros.promotion.touchPrice){
+									supplierPrice -= pros.promotion.reducedPrice;
+									supplierReducedPrice += pros.promotion.reducedPrice;
+								}
+							}
+						}	
+					})
+					item.totalprice = supplierPrice;
+					item.reducedprice = supplierReducedPrice;
+					item.originalprice = (supplierPrice+supplierReducedPrice);
+					totalPrice += item.totalprice;
+					reducedPrice += item.reducedprice;
+					originalPrice += item.originalprice;
+				})
+				//最后统计商品原价
+				this.totalOriginalPrice = originalPrice;
+				//最后满减金额 = 店铺减去金额 + 单品减去金额 + 凑单减去金额
+				this.reducedPrice = reducedPrice;
+				//最终合计价格 = 	店铺满减合计 + 单品满减  + 正常合计 + 凑单满减			
+				this.allPrice = totalPrice ;
+			},
+			totalCount(){//计算总数量
+				this.allCount = 0
+				let prosAllCount=0
+				let validCount = 0
+				let validList =[];
+				let productList =[];
+				this.goodsList.forEach(item=>{
+					productList = item.productList
+					productList.forEach(pros=>{
+						if(pros.productsChecked){
+							prosAllCount+=parseInt(pros.productCount);
+							this.allCount = prosAllCount
+						}
+					})
+				})
+			},		
+			changeCountAdd(item,pros){//商品数量加加
+				if(pros.step === 2){
+					pros.isStep = false
+					pros.productCount += pros.min
+					this.processActivityPrice(pros)
+				}else{
+					pros.productCount++
+					this.processActivityPrice(pros)
+				}
+				this.updateShoppogNum(pros)
+				this.totalShopPeice();
+			},
+			changeCountSub(item,pros){//商品数量减减
+				if(pros.productCount<=pros.min){
+					pros.productCount= pros.min
+					this.$util.msg(`该商品最小起订量为${pros.min}`,2000);
+					return
+				}else{
+					if(pros.step === 2){
+						pros.isStep = false
+						pros.productCount -= pros.min
+					}else{
+						pros.productCount--
+					}
+					this.processActivityPrice(pros)
+				}
+				this.updateShoppogNum(pros)
+				this.totalShopPeice();
+			},
+			changeInput(pros){//输入商品数量更新
+				pros.isStep = false
+			},
+			changeNnmber(e,item,pros){//输入商品数量更新
+				let _value = Number(e.detail.value);
+				if(!this.$api.isNumber(_value)){
+					pros.productCount = pros.min
+				}else if(_value < pros.min){	
+					this.$util.msg(`该商品最小起订量为${pros.min}`,2000);
+					pros.productCount = pros.min
+				}else if(_value % pros.min != 0){
+					pros.isStep = true
+					pros.productCount = pros.min
+				}else{
+					pros.isStep = false
+					pros.productCount = e.detail.value
+					this.processActivityPrice(pros)
+				}
+				this.updateShoppogNum(pros)
+				this.totalShopPeice();
+			},
+			processActivityPrice(pros){//单独处理活动价格和阶梯价格
+				if(pros.ladderFlag == '0' || pros.actStatus == 1){
+					pros.price = pros.price
+				}else{
+					pros.ladderList.forEach((item,index)=>{
+						if(pros.productCount>=item.buyNum){
+							pros.price = item.buyPrice
+						}
+					})
+				}
+			},
+			updateShoppogNum(pros){//加减购物车商品更新到后台
+				this.ProductService.ShoppingCartUpdate(
+					{
+						cartId:pros.cartId,
+						productCount:pros.productCount,
+					}
+				)
+				.then(response =>{
+					this.isshowDelbtn = false;
+					this.InitGetCartGoodsList();
+				})
+				.catch(error =>{
+					this.$util.msg(error.msg,2000);
+				})
+			 },
+			toConfirmation(){//跳转确认订单页面
+				let setGoodsList=[];
+				this.goodsList.forEach(res=>{
+					let products = res.productList
+					products.forEach(pros=>{
+						if(pros.productsChecked){
+							setGoodsList.push(pros.productId)
+						}
+					})
+				})
+				if(setGoodsList == ''){
+					this.$util.msg("请先选择结算商品~",2000);
+					return
+				}else{
+					this.isNoConfim = false
+					this.goodsList.forEach(el=>{
+						el.productList.forEach(pros=>{
+							if(pros.productsChecked){
+							   if(pros.productCount<pros.min){
+								   this.isNoConfim = true
+							   }
+							}
+						})
+					})
+					if(this.isNoConfim){
+						this.$util.modal('','有商品的购买量没达到最小起订量,请修改数量后再次提交结算','去修改','',false,() =>{})
+						return;
+					}
+					let productID = '';
+					this.goodsList.forEach(el=>{//获取勾选的商品ID拼接字符串逗号隔开,最后一个逗号去掉
+						el.productList.forEach(pros=>{
+							if(pros.productsChecked){
+							   productID += pros.productId+','
+							}
+						})
+					})
+					let cartPramsData={
+							allPrice:this.allPrice,
+							allCount:this.allCount,
+							productID:productID.substring(0,productID.lastIndexOf(',')),
+							productCount:''
+						}
+					this.$api.navigateTo(`/pages/user/order/create-order?data=${JSON.stringify({data:cartPramsData})}`)
+				}
+			},
+			showDelManager(){//显示删除商品管理
+				this.isshowDelbtn = true;
+				if(this.isCheckAll) {
+					this.updateBothCheckBtn();	
+				} else {
+					this.goodsList.forEach(item => {
+						if(item.checked) {
+							item.productList.forEach(pros => {
+								pros.productsChecked = true;
+							})
+						}
+					})
+					this.updateCheckAllBtn();
+				}
+				// 失效也被勾选
+				this.failureList.forEach(failureItem => {
+					if(failureItem.isFailureLayer){
+						failureItem.isFailureLayer = false
+					}
+				})
+			},
+			hideDelManage(){//隐藏删除商品管理			
+				this.isshowDelbtn = false;
+				let isFailureLayer,newFailureList =[];
+				if(this.isCheckAll) {
+					this.updateBothCheckBtn();	
+				} else {
+					// 失效商品取消勾选
+					this.goodsList.forEach(item => {
+						if(item.isDisabled) {
+							item.checked = false;
+						}
+						item.productList.forEach(pros => {
+							if(pros.validFlag == 3) {
+								pros.productsChecked = false;
+							}
+						})
+					})
+					this.updateCheckAllBtn();
+				}
+				this.failureList.forEach((failure,index) => {
+					if(failure.failureState == 1 || failure.failureState == 2) {
+						isFailureLayer = true
+					}else{
+						isFailureLayer = false
+					}
+					newFailureList.push(Object.assign({},failure,{isFailureLayer:isFailureLayer}))
+				})
+				this.failureList = newFailureList;
+			},		
+			deleteList(){//删除购物车商品
+				this.delGoodsList=[];
+				this.goodsList.forEach(delitem=>{
+					let products = delitem.productList
+					products.forEach(pros=>{
+						if(pros.productsChecked){
+							this.delGoodsList += pros.cartId+','
+						}
+					})
+				})
+				this.failureList.forEach(failure=>{
+					if(failure.productsChecked){
+						this.delGoodsList += failure.cartId+','
+					}
+				})
+				if(this.delGoodsList.length == 0){
+					this.$util.msg("请选择要删除的商品~",2000);
+					return
+				}else{			
+					this.modal = true;
+					this.contentModalText = '确定删除选中的商品吗?';	
+					this.deleteType = 1
+				}
+			},
+			deletefailureList(){
+				this.delGoodsList = ''
+				this.failureList.forEach(failure=>{ this.delGoodsList += failure.cartId+',' })
+				this.modal = true;
+				this.contentModalText = '确定清除所有失效商品吗?';	
+				this.deleteType = 2
+			},
+			handleClick(e) {//用户操作订单
+				let index = e.index;
+				if(index == 1){
+					this.ProductService.ShoppingCartDelete(
+						{
+							cartIds:this.delGoodsList,
+						}
+					)
+					.then(response =>{
+						this.$util.msg('删除成功',2000);
+						setTimeout(()=>{
+							this.isshowDelbtn = false;
+							this.InitGetCartGoodsList();
+						},1000)
+					}).catch(error =>{
+						this.$util.msg(error.msg,2000)
+					})
+				}
+				this.modal = false;
+			},
+			hideMobel(){
+				this.modal = false;
+			},
+			navToListPage(productId){
+				this.isModallayer = true;
+				this.$api.navigateTo(`/pages/goods/product?productId=${productId}`)
+			},
+			setHeaderBtnPosi(){
+				// 获得胶囊按钮位置信息
+				let headerBtnPosi = uni.getMenuButtonBoundingClientRect();
+				return headerBtnPosi
+			},
+			setSysteminfo(){
+				let systeminfo;
+				uni.getSystemInfo({ // 获取设备信息
+					success: (res) => {
+						systeminfo = res
+					},
+				})
+				return systeminfo
+			},
+			PromotionsFormat(promo){//促销活动类型数据处理
+				if(promo!=null){
+					if(promo.type == 1 && promo.mode == 1){
+						return true
+					}else{
+						return false
+					}
+				}
+				return false
+			}
+		},
+		watch:{//深度监听所有数据,每次改变重新计算总价和总数
+			goodsList:{
+				deep:true,
+				handler(val,oldval){
+					this.totalPeice()
+					this.totalCount()
+				}
+			}
+		},
+		onPullDownRefresh() {//下拉刷新
+			this.InitGetCartGoodsList()
+			uni.stopPullDownRefresh()
+		},
+		onShow(){
+			if(this.hasLogin){
+				this.initData()
+			}else{
+				this.$api.redirectTo('/pages/login/login')
+			}
+		},
+	}
+</script>
+
+<style lang="scss">
+	page{
+		background: #f7f7f7;
+		height: auto;
+	}
+	.cart-content{
+		position: relative;
+	}
+	.container-cart-main.none{
+		display: none;
+	}
+	.container-cart-main.show{
+		display: block;
+	}
+	.cart-content.empty.none{
+		display: none;
+	}
+	.cart-content.empty.show{
+		display: block;
+	}
+	.container-cart.show{
+		display: block;
+	}
+	.container-cart.none{
+		display: none;
+	}
+	.empty-container.none{
+		display: none;
+	}
+	.empty-container.show{
+		display: flex;
+	}
+	.foot-check-delbtn{
+		width: 100%;
+		height: 80rpx;
+		position: fixed;
+		top: 0;
+		left: 0;
+		box-sizing: border-box;
+		padding: 15rpx 24rpx;
+		background-color: #F7F7F7;
+		z-index: 990;
+		.foot-text{
+			font-size: $font-size-26;
+			height: 50rpx;
+			line-height: 50rpx;
+			color:#666666;
+			float: left;
+			padding-left: 10rpx;
+			text{
+				margin: 0 6rpx;
+			}
+		}
+		.delBtn{
+			width: 100rpx;
+			display: inline-block;
+			padding: 0 15rpx;
+			font-size: $font-size-26;
+			height: 50rpx;
+			line-height: 50rpx;
+			border-radius: 30rpx;
+			background:#FFFFFF;
+			border: 1px solid #ff457b;
+			color: #ff457b;
+			float: right;
+			text-align: center;
+			&.none{
+				display: none;	
+			}
+		}
+	}
+	.checkbox-box{
+		display: flex;
+		align-items: center;
+		.checkbox{
+			display: flex;
+			margin: 0;
+			padding: 5rpx;
+			display: flex;
+			flex-direction: column;
+			align-items: center;
+			box-sizing: border-box;
+			text-align: center;
+			text-decoration: none;
+			border-radius: 0;
+			-webkit-tap-highlight-color: transparent;
+			overflow: hidden;
+			background-color:#FFFFFF;
+			font-size: 36rpx;
+			color:#999999;
+			&.icon-xuanze{
+				color: $color-system;
+			}
+		}
+		&.disabled{
+			.checkbox{
+				color:#999999
+			}
+		}
+		.text{
+			font-size: $font-size-24;
+			margin-left: 10rpx;
+		}
+	}
+	.goods-list{
+		width: 100%;
+		height: auto;
+		background-color: #F7F7F7;
+		.goods-item{
+			width: 702rpx;
+			padding: 0 24rpx;
+			background: #FFFFFF;
+			margin-bottom: 24rpx;
+		}
+		.shoptitle{
+			display: flex;
+			align-items: center;
+			height: 80rpx;
+			line-height: 80rpx;
+			.checkbox-box{
+				padding: 10rpx;
+			}
+			.text{
+				width: 450rpx;
+				display: block;
+				overflow: hidden;
+				text-overflow:ellipsis;
+				white-space: nowrap;
+				margin-left: 20rpx;
+				font-size: $font-size-28;
+				color: $text-color;
+				text-align: left;
+				font-weight: bold;
+			}
+		}
+		.goods-pros{
+			width: 100%;
+			height: auto;
+			margin-bottom: 20rpx;
+		}	
+		.goods-pros-t{
+			display: flex;
+			align-items: center;
+			width: 100%;
+			height: 210rpx;
+			padding:0 0 26rpx 0;
+			.checkbox-box{
+				padding: 10rpx;
+			}
+			.pros-img{
+				width: 210rpx;
+				height: 100%;
+				border-radius: 10rpx;
+				margin:0 20rpx;
+				border:1px solid #f3f3f3;
+				image{
+					width: 100%;
+					height: 100%;
+					border-radius: 10rpx;
+				}
+			}
+		}
+		.goods-pros-b{
+			width:100%;
+			height: auto;
+			padding:0 0 24rpx 0;
+			box-sizing: border-box;
+			&.show{
+				display: block;
+			}
+			&.none{
+				display: none;
+			}
+			.sum-none{
+				width: 100%;
+				height: 48rpx;
+				line-height: 48rpx;
+				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;
+					}
+				}
+			}
+			.sum{
+				width: 100%;
+				height: 40rpx;
+				font-size: $font-size-26;
+				line-height: 40rpx;
+				color: $text-color;
+				float: left;
+				display: flex;
+				justify-content: flex-end;
+				font-weight: bold;
+				.money{
+					color: $color-system;
+					font-size: $font-size-26;
+				}
+				.money-sign{
+					font-size: $font-size-24;
+					color: $color-system;
+				}
+			}
+		}
+		.pros-product{
+			width: 416rpx;
+			height: 100%;
+			line-height: 36rpx;
+			font-size: $font-size-28;	
+			position: relative;
+			.producttitle{
+				width: 100%;
+				display: inline-block;
+				height: auto;							
+				text-overflow:ellipsis;
+				display: -webkit-box;
+				word-break: break-all;
+				-webkit-box-orient: vertical;
+				-webkit-line-clamp: 2;
+				overflow: hidden;
+				margin-bottom: 15rpx;
+				.no-text{
+					display: inline-block;
+					height:36rpx;
+					padding: 0 12rpx;
+					line-height: 36rpx;
+					background:linear-gradient(315deg,rgba(231,0,0,1) 0%,rgba(255,104,1,1) 100%);
+					border-radius:18rpx;
+					text-align: center;
+					color: #FFFFFF;
+					font-size:$font-size-28;
+					margin-right: 24rpx;
+				}
+			}
+			.productspec{
+				height: 36rpx;
+				color: #999999;
+				font-size: $font-size-26;
+			}
+			.productprice{
+				width: 100%;
+				height: 48rpx;
+				margin: 30rpx 0 0 0;
+				.price{
+					line-height: 48rpx;
+					font-size: $font-size-26;
+					width: 48%;
+					color: $color-system;
+					float: left;
+					font-weight: bold;
+					&.disabled{
+						color: #999999;
+						text-decoration: line-through;
+					}
+					.money-sign{
+						font-size: $font-size-24;
+						color: $color-system;
+					}
+				}
+				.count{
+					height: 100%;
+					float: right;
+					position: relative;
+					&.show{
+						display: block;
+					}
+					&.none{
+						display: none;
+					}
+					.count-tips{
+						width: auto;
+						display: inline-block;
+						padding: 0 15rpx;
+						line-height: 44rpx;
+						height: 44rpx;
+						border-radius: 22rpx;
+						background: $btn-confirm;
+						font-size: $font-size-24;
+						text-align: center;
+						color: #FFFFFF;
+						position: absolute;
+						top:-60rpx;
+						left: -5rpx; 
+						z-index: 5;
+						&.step{
+							left:-217rpx
+						}
+						&::before{
+							content: "";
+							position: absolute;
+							bottom: -30rpx;
+							right: 15rpx;
+							z-index:1;
+							width: 0; 
+							height: 0;
+							border-width: 18rpx;
+							border-style: solid;
+							border-color:$color-system transparent transparent transparent;
+						}
+					}
+					.number-box {
+						display: flex;
+						justify-content: center;
+						align-items: center;
+						border: 2rpx solid #e1e1e1;
+						border-radius: 30rpx;
+						height: 48rpx;
+						margin-left: 20rpx;
+						.iconfont {
+							font-size: $font-size-24;
+							padding: 0 14rpx;
+							color: #666666;
+							text-align: center;
+							line-height: 48rpx;
+							font-weight: bold;
+							background: #ffffff;
+							&.icon-jianhao {
+								border-radius: 30rpx 0 0 30rpx;
+							}
+							&.icon-jiahao {
+								border-radius: 0 30rpx 30rpx 0;
+							}
+						}
+						.btn-input {
+							width: 56rpx;
+							height: 44rpx;
+							line-height: 44rpx;
+							border-radius: 4rpx;
+							text-align: center;
+							font-size: $font-size-24;
+							color: #333333;
+							background-color: #f7f7f7;
+						}
+					}
+					.uni-numbox{
+						position: absolute;
+						left: 45rpx;
+						bottom: 0;
+						.uni-numbox-minus, .uni-numbox-plus{
+							width: 50rpx;
+							line-height: 40rpx;
+						}
+						.uni-numbox-value {
+							font-size: $font-size-28;
+							width: 60rpx;
+						}
+					}
+				}
+			}
+			.floor-item-act{
+				width: 100%;
+				height: 30rpx;
+				margin-top: 8rpx;
+				float: left;
+				.tag{
+					display: inline-block;
+					width: 80rpx;
+					height: 30rpx;
+					background: url(https://static.caimei365.com/app/mini-hehe/icon/icon-active.png)top center no-repeat;
+					background-size: contain;
+					font-size: 22rpx;
+					line-height: 30rpx;
+					text-align: center;
+					color: #f83c6c;
+					float: left;
+				}
+			}
+		}
+	}
+	.failure-list{
+		width: 702rpx;
+		height: auto;
+		padding: 0 24rpx;
+		margin-top: 20rpx;
+		background: #FFFFFF;
+		.failure-title{
+			width: 100%;
+			height: 82rpx;
+			line-height: 82rpx;
+			font-size: $font-size-28;
+			border-bottom: 1px solid #EBEBEB;
+			.title-txt{
+				float: left;
+				color:#666666;
+				text-align: left;
+			}
+			.title-btn{
+				float: right;
+				color: $color-system;
+				text-align: right;
+				line-height: 80rpx;
+				.butto{
+					display: inline-block;
+					padding: 0 15rpx;
+					font-size: $font-size-26;
+					height: 50rpx;
+					line-height: 50rpx;
+					border-radius: 30rpx;
+					background:#fff8fd;
+					border: 1px solid #ff457b;
+					color: #ff457b;
+					margin-top: 15rpx;
+				}
+			}
+		}
+		.productlist{
+			padding-top: 10rpx;
+			.goods-pros{
+				width: 100%;
+				height: auto;
+				padding: 20rpx 0;
+			}	
+			.goods-pros-t{
+				display: flex;
+				align-items: center;
+				width: 100%;
+				height: 210rpx;
+				position: relative;
+				.img-tip{
+					display: block;
+					width: 72rpx;
+					height: 36rpx;
+					line-height: 36rpx;
+					font-size: $font-size-24;
+					text-align: center;
+					color: #FFFFFF;
+					border-radius: 24rpx;
+					background:rgba(51,51,51,0.3);
+					// position: absolute;
+					// left: 0;
+					// top: 0;
+				}
+				.checkbox-box{
+					padding: 10rpx;
+				}
+				.pros-img{
+					width: 180rpx;
+					height: 100%;
+					border-radius: 10rpx;
+					margin:0 20rpx;
+					border:1px solid #f3f3f3;
+					position: relative;
+					image{
+						width: 100%;
+						height: 100%;
+						border-radius: 10rpx;
+					}
+				}
+				.pros-marks{
+					width: 730rpx;					height: 250rpx;
+					z-index: 90;
+					background: rgba(0,0,0,.05);
+					position: absolute;
+					left:-20rpx;
+					top: -20rpx;
+				}
+			}
+			.goods-pros-b{
+				width:622rpx;
+				margin-left: 84rpx;
+				height: 40rpx;
+				padding:0 0 26rpx 0;
+				// border-top: 1px solid #EBEBEB;
+				&.show{
+					display: block;
+				}
+				&.none{
+					display: none;
+				}
+				.sum{
+					font-size: $font-size-28;
+					line-height: 40rpx;
+					color: $text-color;
+					display: flex;
+					justify-content: flex-end;
+					.money{
+						color: #FF2A2A;
+						font-size: $font-size-28;
+					}
+					.money-sign{
+						font-size: $font-size-24;
+						color: #FF2A2A;
+					}
+				}
+			}
+			.pros-product{
+				width: 402rpx;
+				height: 100%;
+				line-height: 36rpx;
+				font-size: $font-size-28;	
+				position: relative;
+				.producttitle{
+					width: 100%;
+					display: inline-block;
+					height: auto;							
+					text-overflow:ellipsis;
+					display: -webkit-box;
+					word-break: break-all;
+					-webkit-box-orient: vertical;
+					-webkit-line-clamp: 2;
+					overflow: hidden;
+					margin-bottom: 8rpx;
+					.no-text{
+						display: inline-block;
+						height:36rpx;
+						padding: 0 12rpx;
+						line-height: 36rpx;
+						background:linear-gradient(315deg,rgba(231,0,0,1) 0%,rgba(255,104,1,1) 100%);
+						border-radius:18rpx;
+						text-align: center;
+						color: #FFFFFF;
+						font-size: $font-size-28;
+						margin-right: 24rpx;
+					}
+				}
+				.productspec{
+					height: 36rpx;
+					color: #999999;
+					font-size: $font-size-26;
+					margin-top: 20rpx;
+				}
+				.productstate{
+					font-size: $font-size-28;
+					height: 44rpx;
+					color: #FF2A2A;
+					position: absolute;
+					bottom: 0;
+					left: 0;
+				}
+			}
+		}
+	}
+	.footer{
+		width: 100%;
+		background-color: #FFFFFF;
+		height: 100rpx;
+		position: fixed;
+		bottom: 0rpx;
+		z-index: 100;
+		.footer-le{
+			width: 520rpx;
+			height: 100%;
+			padding:10rpx 24rpx;
+			float: left;
+			box-sizing: border-box;
+			.foot-check{
+				width: 100rpx;
+				float: left;
+				line-height: 80rpx;
+				font-size: $font-size-24;
+				.checkbox{
+					width: 40rpx;
+					text-align: center;
+				}
+				.text{
+					width: 60rpx;
+					float: right;
+				}
+			}
+			.sum{
+				width: 360rpx;
+				height: 100%;
+				float: right;
+				box-sizing: border-box;
+				padding:0 10rpx;
+				.sum-none{
+					width: 100%;
+					height: 40rpx;
+					line-height: 40rpx;
+					color: $text-color;
+					float: left;
+					text-align: right;
+					.money{
+						font-size: $font-size-24;
+						color: #999999;
+						text-decoration: line-through;
+					}
+					.money-sign{
+						font-size: $font-size-24;
+						color: #999999;
+						text-decoration: line-through;
+					}
+					.money-reduced{
+						margin-left: 10rpx;
+						font-size: $font-size-24;
+						color: $color-system;
+					}
+				}
+				.sum-price{
+					text-align: right;
+					width: 100%;
+					height: 40rpx;
+					line-height: 40rpx;
+					font-size: $font-size-30;
+					color: $text-color;
+					float: left;
+					font-weight: normal;
+					&.none{
+						height: 80rpx;
+						line-height: 80rpx;
+					}
+					.money{
+						color: $color-system;
+					}
+					.money-sign{
+						font-size: $font-size-24;
+						color: $color-system;
+					}
+				}
+			}
+		}
+		.footer-ri{
+			width: 230rpx;
+			height: 100%;
+			float: right;
+			display: flex;
+			justify-content: space-between;
+			align-items: center;
+			z-index: 999;
+			box-sizing: border-box;
+			padding: 13rpx 15rpx;
+			&.none{
+				display: none;
+			}
+			.btn{
+				width: 200rpx;
+				height: 100%;
+				background:$btn-confirm;
+				font-size: $font-size-28;
+				line-height: 80rpx;
+				color: #FFFFFF;
+				display: flex;
+				border-radius: 40rpx;
+				justify-content: center;
+				align-items: center;
+			}
+		}
+		.footer-del{
+			width: 420rpx;
+			height: 100rpx;
+			position: absolute;
+			padding-left: 200rpx;
+			background: #FFFFFF;
+			right: 0;
+			top: 0;
+			z-index: 1000;
+			box-sizing: border-box;
+			padding: 10rpx 0;
+			display: flex;
+			&.show{
+				animation: showDelbtn 0s linear both;
+			}
+			&.none{
+				animation: hideDelbtn 0s linear both;
+			}
+			.btn{
+				flex: 1;
+				margin: 0 8rpx;
+				height: 100%;
+				line-height: 80rpx;
+				font-size: $font-size-28;
+				color: #FFFFFF;
+				text-align: center;
+				float: left;
+				border-radius: 40rpx;
+			}
+			.btn.btn-cancel{
+				background:#f7f7f7;
+				color: #B2B2B2;
+			}
+			.btn.btn-confirm{
+				background:$btn-confirm;
+				color: #FFFFFF;
+			}
+			@keyframes showDelbtn {
+				0% {
+					transform: translateX(0);
+				}
+				100% {
+					transform: translateX(-100%);
+				}
+			}
+			@keyframes hideDelbtn {
+				0% {
+					transform: translateX(-100%);
+				}
+				100% {
+					transform: translateX(0);
+				}
+			}
+		}
+	}
+</style>

+ 98 - 191
pages/goods/product.vue

@@ -26,14 +26,7 @@
 		</view>
 		<tui-skeleton v-if="skeletonShow" backgroundColor="#fafafa" borderRadius="10rpx" :isLoading	="true" :loadingType="5"></tui-skeleton>
 		<template v-else >
-			<view class="cart-content empty" v-if="isInvalid">
-				<view  class="empty-container">
-					<image class="empty-container-image" :src="productNoneImage" mode="aspectFit"></image>
-					<text class="error-text">商品已失效,去商城逛逛别的吧~</text>
-					<view class="login-btn"  @click="goIndex">去商城</view>
-				</view>
-			</view>
-			<view class="container-product tui-skeleton" v-else>
+			<view class="container-product tui-skeleton">
 				<view class="container-product-main product-details0">
 					<view class="product-top">
 						<view class="banner-section">
@@ -49,14 +42,13 @@
 							</uni-swiper-dot>
 						</view>
 						<view class="product-wrap clearfix">
-							<view class="wrap-top" :class="goodsData.isNoneDisabled ? 'none' : ''">
+							<view class="wrap-top">
 								<view class="wrap-top-price">
 									<cm-price v-if="isRequest"
 											  :product="product"
 											  :userIdentity="userIdentity"
-											  :shopID= "shopID"
 											  :promotions="product.promotions"
-											  :ladderPriceList="ladderPriceList"/>
+											  :ladderList="ladderList"/>
 								</view>
 								<view class="p-title tui-skeleton-fillet">
 									<view class="p-title-name" :class="product.beautyActFlag == '1' ? 'indent' : ''"> {{product.name == undefined ? '' : product.name}} </view>
@@ -68,9 +60,6 @@
 								<view class="wrap-label" v-if="product.tagsList.length>0">
 									<view class="label-a tui-skeleton-fillet" v-for="(label,index) in  product.tagsList" :key="index">{{label}}</view>
 								</view>
-								<view class="productRemarks">
-										备注:<text class="text">奥术大师大撒大所多撒大所大大奥所多</text>
-								</view>
 								<view class="product-seve">
 									<text class="iconfont icon-wuyoushouhou tui-skeleton-rect"><text class="text">无忧退货</text></text>
 									<text class="iconfont icon-wuyoushouhou tui-skeleton-rect"><text class="text">快速退款</text></text>
@@ -79,7 +68,7 @@
 							</view>
 						</view>			
 					</view>
-					<view class="product-parameter" @click="showPopup" v-if="!goodsData.isNoneDisabled">
+					<view class="product-parameter" @click="showPopup">
 						<text class="title">参数:</text>
 						<text class="name">品牌  起订量  分类...</text>
 						<text class="iconfont icon-chakangengduo"></text>
@@ -91,7 +80,7 @@
 						<view class="title-tab">商品详情</view>
 					</view>
 					<view class="content tui-banner product-rich-text tui-skeleton-rect">
-						<parser :html="html" :img-mode="widthFix" v-if="!goodsData.isNoneDisabled"></parser>
+						<parser :html="html" :img-mode="widthFix" v-if="product.productDetail.detailInfo"></parser>
 						<view class="product-rich-text-none" v-else>暂无商品信息</view>
 					</view>
 				</view>	
@@ -113,10 +102,6 @@
 						<view class="title">商品参数</view>
 						<div class="tui-popup-main">
 							<scroll-view class="tui-popup-scroll"  scroll-y="true">
-								<view class="content-tr">
-									<view class="content-td">起订量</view>
-									<view class="content-th">{{product.minBuyNumber}}</view>
-								</view>
 								<view class="content-tr">
 									<view class="content-td">品牌</view>
 									<view class="content-th">{{product.brandName == null? '其他' : product.brandName}}</view>
@@ -129,10 +114,6 @@
 									<view class="content-td">包装规格</view> 
 									<view class="content-th">{{product.unit}}</view>
 								</view>
-								<view class="content-tr">
-									<view class="content-td">商品编码</view>
-									<view class="content-th">{{product.productCode}}</view>
-								</view>
 								<view class="content-tr">
 									<view class="content-td">库存</view>
 									<view class="content-th">{{product.stock}}</view>
@@ -201,21 +182,18 @@
 								<image :src="product.mainImage" mode=""></image>
 							</view>
 							<view class="layer-nunbox">
-								<view class="layer-nunbox-t" v-if="product.step === 2">
-									<view class="text">*该商品只能以起订量的整数倍购买</view>
-								</view>
 								<view class="layer-nunbox-t">
 									<view class="layer-nunbox-text">数量:</view>
 									<view class="number-box">
-										<view  class="iconfont icon-jianhao" :class="[isQuantity==true?'disabled':'']" @click="changeCountSub()"></view>
+										<view  class="iconfont icon-jianhao" :class="[isQuantity==true ? 'disabled' : '']" @click="changeCountSub()"></view>
 										<input class="btn-input" type="number" v-model="number" maxlength='4'  @blur="changeNumber($event)">
-										<view  class="iconfont icon-jiahao"  :class="[isStock==true?'disabled':'']" @click="changeCountAdd()"></view>
+										<view  class="iconfont icon-jiahao" @click="changeCountAdd()"></view>
 									</view>
 								</view>
 								<view class="layer-nunbox-b">
 									<view class="text">单价:
 										<text class="p sm">¥</text>
-										<text class="p bg">{{buyRetailPrice.toFixed(2)}}</text>
+										<text class="p bg">{{buyRetailPrice | NumFormat}}</text>
 									</view>
 								</view>
 							</view>
@@ -237,7 +215,6 @@
 	import cmAttributes from "@/components/cm-module/productDetails/cm-attributes.vue" //规格信息
 	import parser from "@/components/jyf-Parser/index" //富文本处理
 	import tuiSkeleton from "@/components/tui-skeleton/tui-skeleton"
-	import cmParameter from "@/components/cm-module/productDetails/cm-parameter" //相关参数
 	import cmService from "@/components/cm-module/productDetails/cm-service" //服务项目
 	import authorize from '@/common/config/authorize.js'
 	import wxLogin from "@/services/wxLogin.js"
@@ -250,11 +227,14 @@
 			tuiSkeleton,
 			cmPrice,
 			cmAttributes,
-			cmParameter,
 			cmService
 		},
 		data(){
 			return{			
+				nvabarData: {							 //顶部自定义导航
+					showCapsule: 1, // 是否显示左上角图标   1表示显示    0表示不显示
+					title: ''		// 导航栏 中间的标题
+				},
 				clickPath:'/search/pages/search/search',
 				html:'<div style="text-align: center;color:#333333;">暂无内容</div>',
 				productNoneImage:'https://static.caimei365.com/app/img/icon/icon-pnone.png',
@@ -266,36 +246,28 @@
 				isRequest:false,
 				isScrollTop:false,
 				current:0,
-				shopId:0,
 				isShareType:'',
 				isHeaderPoduct:false,
 				isNavbarFiexd:false,
 				navbarFiexd:'none',
 				ladderPriceFlag:'',
-				ladderPriceList:'',
-				isInvalid:false,
+				ladderList:'',
 				isEvaluate:false,
 				isAnimation:false,
 				skeletonShow:true,
 				isQuantity:false,
-				isStock:false,
 				disabled:false,
-				isNoneDisabled:false,
 				tabCurrentIndex:0,
-				userID:'',
-				shopID:'',
-				productID:0,
+				userId:'',
+				productId:0,
 				userIdentity:0,//用户类型
 				goodsData:{},//自定义数据
-				shop:{},//供应商信息
 				product:{},//采美
 				productImage:[],
 				retailPrice:0,
 				buyRetailPrice:0,
-				buyRetailPriceStep:1,
 				stock:0,
-				number:0,
-				minBuyNumber:0,
+				number:1,
 				productsList:[],
 				goodListData:[],
 				headerBtnPosi:	this.setHeaderBtnPosi(), //获取设备顶部胶囊高度
@@ -304,10 +276,6 @@
 				windowHeight: '',
 				headerColor:false,
 				backPage:1,
-				nvabarData: {							 //顶部自定义导航
-					showCapsule: 1, // 是否显示左上角图标   1表示显示    0表示不显示
-					title: ''		// 导航栏 中间的标题
-				},
 				linkPath:'',
 				CustomBar:this.CustomBar,// 顶部导航栏高度
 				popupShow:false,//参数弹窗
@@ -316,12 +284,11 @@
 				scrollTopArray:[],
 				sectionTopRangeArr: [],
 				winHeight:'',
-				isShowButton:true,
-				isNoneSupplier:false
+				isShowButton:false
 			}
 		},
 		onLoad(option) {
-			this.productID = option.id;//获取商品ID
+			this.productId = option.productId;//获取商品ID
 			this.isShareType = option.type
 			this.linkPath = option.path
 			this.isHeaderPoduct = true
@@ -329,86 +296,66 @@
 				this.backPage = option.page
 			}
 			if(this.isShareType =='share'){
-				authorize.checkLogin()
-				.then(res => {
+				if(uni.getStorageSync('_WX_State')){
 					wxLogin.wxLoginAuthorize()
-				})
-				.catch(err => {
-					console.log(new Date +'用户未授权微信信息')
-				})
+				}
 			}
 			this.getWinHeight()
 		},
 		computed: {
 			...mapState(['hasLogin','isWxAuthorize','identity'])
 		},
+		filters:{
+			NumFormat(value) {//处理金额
+				return Number(value).toFixed(2);
+			}
+		},	
 		methods:{
 			initData(){// 初始化商品详情查询
-				this.ProductService.queryProductDetils({userId:11182,productID:6390,identity:2}).then(response =>{	
-					//购物车数量
-					this.goodsData.cartCount = 10
+				this.ProductService.QueryProductDetils(
+					{
+						productId:this.productId,
+					}
+				)
+				.then(response =>{	
+					//购物车数量				
 					this.skeletonShow = false
 					this.productImage=[];
-					this.shop = response.data.shop
-					this.shopId = response.data.shopID
 					this.product = response.data
 					//已删除/已冻结
-					if(this.product.validFlag === '0'){
-						this.isInvalid = true
+					if(this.product.validFlag === 2){
+						this.isShowButton = true
 					}
 					this.ladderPriceFlag = this.product.ladderPriceFlag;
-					this.html = this.product.productDetail == null ? this.html : this.$api.adaptRichTextImg(this.product.productDetail.detailInfo)
+					this.html = this.product.productDetail == null ? this.html : this.$api.adaptRichTextImg(this.product.productDetail.detailInfo);
 					this.stock = this.product.stock
-					this.buyRetailPriceStep = this.product.step
-					this.number = this.product.minBuyNumber
-					this.minBuyNumber = this.product.minBuyNumber					
 					//处理商品图片列表
 					this.product.imageList.forEach(item =>{
-						this.productImage.push(item.image);
+						this.productImage.push(item);
 					})
 					//处理阶梯价格
-					if(this.product.ladderPriceList!=null){
-						this.ladderPriceList = this.product.ladderPriceList;
-					}
-					//拆分金额并转千分位格式显示
-					if(this.product.retailPrice!=null){
-						this.retailPrice = this.product.retailPrice.toFixed(2);
-						this.buyRetailPrice = this.product.retailPrice;
-					}
-					//处理下架商品和售罄商品
-					if(this.product.validFlag =='3' || this.product.validFlag =='10' || this.stock == 0 ){
-						this.disabled = true
-						this.isNoneDisabled = true
-					}else{
-						this.disabled = false
-						this.isNoneDisabled = false
-						this.goodsData.disabledText = ''
-					}
-					if(this.product.price1TextFlag == "1"){
-						this.disabled = true
-					}
-					if(this.product.price1TextFlag == "2"){
-						if(this.userIdentity == 4){	
-							this.disabled = true
-						}else{
-							this.disabled = false
-						}
-					}
-					this.goodsData.disabled = this.disabled
-					this.goodsData.isNoneDisabled = this.isNoneDisabled
-					if(this.product.validFlag =='3'){
-						this.goodsData.disabledText = '下架'
-					}
-					if(this.product.validFlag =='10'){
-						this.goodsData.disabledText = '停售'
-					}
-					if(this.stock == 0){
-						this.goodsData.disabledText = '售罄'
+					if(this.product.ladderList.length>0){
+						this.ladderList = this.product.ladderList;
 					}
+					this.retailPrice = this.product.price.toFixed(2);
+					this.buyRetailPrice = this.product.price;
 					setTimeout(()=>{
 						this.getSectionProps();
 					},2000)
+					console.log(this.userId)
+					if(this.userId > 0){
+						this.GetCartNumber()
+					}
 					this.isRequest = true
+				})
+				.catch(error =>{
+					this.$util.msg(error.msg,2000);
+				})
+			},
+			GetCartNumber(){//查询购物车数量
+				this.ProductService.QueryShoppingQuantity({userId:this.userId}).then(response => {
+					this.goodsData.cartCount = response.data
+					this.$store.commit('updateAllNum',response.data)
 				}).catch(error =>{
 					this.$util.msg(error.msg,2000);
 				})
@@ -446,51 +393,38 @@
 
 			},
 			buyProductCart(){//底部购物车按钮点击
-				authorize.checkLogin()
-				.then(res => {
+				if(uni.getStorageSync('_WX_State')){
 					if(this.hasLogin){
 						this.$api.navigateTo('/pages/goods/cart')
 					}else{					
-						this.$api.navigateTo('/pages/login/login?type=1')
+						this.$api.navigateTo('/pages/login/login')
 					}
-				})
-				.catch(err => {
+				}else{
 					this.$api.navigateTo('/pages/authorization/authorization?type=1')
-				})
+				}
 			},
 			btnGetConfirm(type){//加入购物车&&立即购买点击
-				authorize.checkLogin()
-				.then(res => {
+				if(uni.getStorageSync('_WX_State')){
 					if(this.hasLogin){
 						this.showSpec(type);
-					}else{
-						this.$api.navigateTo('/pages/login/login?type=1')
+					}else{					
+						this.$api.navigateTo('/pages/login/login')
 					}
-				})
-				.catch(err => {
+				}else{
 					this.$api.navigateTo('/pages/authorization/authorization?type=1')
-				})
+				}
 			},	
 			changeCountAdd(){//popup弹窗数量增加按钮
-				if(this.buyRetailPriceStep == 2){
-					this.number+=this.minBuyNumber
-				}else{
-					this.number++
-				}
+				this.number++
 				this.processActivityPrice()
 			},
 			changeCountSub(){//popup弹窗数量减按钮
-				if(this.number<=this.minBuyNumber){
-					this.number= this.minBuyNumber
-					this.isQuantity =true
-					this.$util.msg(`该商品最小起订量为${this.minBuyNumber}`,2000);
+				if(this.number == 1){
+					this.isQuantity = true
+					this.$util.msg('购买数量不能低于1',2000);
 					return
 				}else{
-					if(this.buyRetailPriceStep == 2){
-						this.number-=this.minBuyNumber
-					}else{
-						this.number--
-					}
+					this.number--
 					this.processActivityPrice()
 					this.isQuantity =false
 				}
@@ -498,13 +432,10 @@
 			changeNumber(e){
 				let _value = e.detail.value;
 				if(!this.$api.isNumber(_value)){
-					this.number = this.minBuyNumber
-				}else if(_value < this.minBuyNumber){	
-					this.$util.msg(`该商品最小起订量为${this.minBuyNumber}`,2000);
-					this.number = this.minBuyNumber
-				}else if( _value % this.minBuyNumber !=0 ){
-					this.$util.msg(`购买量必须为起订量的整数倍`,2000);
-					this.number = this.minBuyNumber
+					this.number = 1
+				}else if(_value == 1){	
+					this.$util.msg('购买数量不能低于1',2000);
+					this.number = 1
 				}else{
 					this.number = e.detail.value
 				}
@@ -514,7 +445,7 @@
 				if(this.ladderPriceFlag == '0' && this.product.actStatus == 0 || this.product.actStatus == 1){
 					this.buyRetailPrice = this.product.retailPrice
 				}else{
-					this.ladderPriceList.forEach((item,index)=>{
+					this.ladderList.forEach((item,index)=>{
 						if(this.number>=item.buyNum){
 							this.buyRetailPrice = item.buyPrice
 						}
@@ -543,7 +474,7 @@
 				let productStp ={
 						allPrice:this.number*this.buyRetailPrice,
 						allCount:this.number,
-						productID:this.product.productID,
+						productId:this.product.productId,
 						productCount:this.number
 				}	
 				this.$api.navigateTo(`/pages/user/order/create-order?type=prodcut&data=${JSON.stringify({data:productStp})}`)
@@ -552,23 +483,24 @@
 				}, 200);
 			},
 			getAddProductCart(){//增加购物车成功和toast弹窗提示成功	
-				this.ProductService.shoppingAddCart({productID:this.productID,userID:this.userID,productCount:this.number}).then(response => {
+				this.ProductService.shoppingAddCart({productId:this.productId,userId:this.userId,productCount:this.number}).then(response => {
 					this.specClass = 'hide';
 					this.$util.msg('加入购物车成功',1500,true,'success')
 					this.isAnimation = true
 					setTimeout(() => {this.specClass = 'none'}, 200)
 					setTimeout(() => {this.isAnimation = false},2000)
-					this.goodsData.cartCount = response.data;
+					this.GetCartNumber()
 				}).catch(error =>{
 					this.$util.msg(error.msg,2000);
 				})
 			},
+			
 			navToLogin(){
 				authorize.checkLogin()
 				.then(res => {
 					this.$store.commit('setLoginType',8)
-					this.$store.commit('setLoginProductId',this.productID)
-					this.$api.navigateTo(`/pages/login/login?id=${this.productID}`)
+					this.$store.commit('setLoginproductId',this.productId)
+					this.$api.navigateTo(`/pages/login/login?id=${this.productId}`)
 				})
 				.catch(err => {
 					this.$api.navigateTo('/pages/authorization/authorization?type=1')
@@ -588,14 +520,6 @@
 				})
 				return systeminfo
 			},
-			goIndex(){//商城首页
-				uni.switchTab({
-				    url: '/pages/tabBar/index/index'
-				});
-			},
-			goSupplier(){//跳供应商资料页
-				this.$api.navigateTo('/supplier/pages/user/my-shop?shopId='+this.shopId)
-			},
 			discard(){
 				//丢弃
 			},
@@ -605,7 +529,7 @@
 			    }
 				return {
 				  title: `${this.product.name}`,
-				  path: `pages/goods/product?type=share&id=${this.productID}`,
+				  path: `pages/goods/product?type=share&id=${this.productId}`,
 				  imageUrl:`${this.productImage[0]}`
 				}
 			},
@@ -701,15 +625,14 @@
 		    }
 			return {
 			  title: `${this.product.name}`,
-			  path: `pages/goods/product?type=share&id=${this.productID}`,
+			  path: `pages/goods/product?type=share&id=${this.productId}`,
 			  imageUrl:`${this.productImage[0]}`
 			}
 		},
 		onShow() {
 			this.$api.getStorage().then((resolve) => {
-				this.userID = resolve.userId ? resolve.userId : '';	
+				this.userId = resolve.userId ? resolve.userId : '';	
 				this.userIdentity = resolve.userIdentity ? resolve.userIdentity : 0
-				this.shopID =  resolve.shopId ? resolve.shopId : '';
 				if (isPreviewImg) {
 					isPreviewImg = false;
 					return;
@@ -755,18 +678,6 @@
 		padding: 24rpx 0 0 0;
 		background-color: #FFFFFF;
 		border-bottom: 20rpx solid #F7F7F7;
-		.productRemarks{
-			height: 48rpx;
-			width: 100%;
-			float: left;
-			line-height: 48rpx;
-			font-size: 24rpx;
-			color: #999999;
-			text-align: left;
-			.text{
-				color: #3f3f3f;
-			}
-		}
 		.wrap-top{
 			width: 702rpx;
 			padding: 0 24rpx;
@@ -774,11 +685,6 @@
 			float: left;
 			padding-bottom:20rpx;
 			border-bottom: 1px solid #F8F8F8;
-			&.none{
-				.p-title{
-					color:#999999
-				}
-			}
 			.p-title{
 				width: 100%;
 				height: auto;
@@ -1566,37 +1472,38 @@
 					line-height: 44rpx;
 					font-size: $font-size-28;
 				}
-				.number-box{
+				.number-box {
 					display: flex;
 					justify-content: center;
 					align-items: center;
-					border:2rpx solid #ffe6dc;
+					border: 2rpx solid #e1e1e1;
 					border-radius: 30rpx;
 					height: 48rpx;
 					margin-left: 20rpx;
-					.iconfont{
+					.iconfont {
 						font-size: $font-size-24;
-						padding:0 18rpx;
-						color: #999999;
+						padding: 0 14rpx;
+						color: #666666;
 						text-align: center;
 						line-height: 48rpx;
 						font-weight: bold;
-						background: #fef6f3;
-						&.icon-jianhao{
+						background: #ffffff;
+						&.icon-jianhao {
 							border-radius: 30rpx 0 0 30rpx;
 						}
-						&.icon-jiahao{
+						&.icon-jiahao {
 							border-radius: 0 30rpx 30rpx 0;
 						}
 					}
-					.btn-input{
-						width: 62rpx;
-						height: 48rpx;
-						line-height: 48rpx;
-						background: #FFFFFF;
+					.btn-input {
+						width: 56rpx;
+						height: 44rpx;
+						line-height: 44rpx;
 						border-radius: 4rpx;
 						text-align: center;
-						font-size: $font-size-28;
+						font-size: $font-size-24;
+						color: #333333;
+						background-color: #f7f7f7;
 					}
 				}
 				.product-step{
@@ -1610,7 +1517,7 @@
 			.layer-nunbox-b{
 				width: 100%;
 				height:44rpx;
-				margin-top: 13rpx;
+				margin-top: 30rpx;
 			}
 			.text{
 				line-height: 44rpx;
@@ -1646,7 +1553,7 @@
 			float: left;
 			.tui-popup-scroll{
 				width: 100%;
-				height: 500rpx;
+				height: 320rpx;
 				.content-tr{
 					width: 100%;
 					min-height: 58rpx;

+ 44 - 27
pages/goods/search.vue

@@ -3,8 +3,8 @@
 		<view class="search-main">
 			<view class="gosearch-btn">
 				<text class="iconfont icon-sousuo"></text>
-				<input class="input" maxlength="20" :focus="isFocus" type="text" value="" confirm-type="search" @focus="onFocus" @input="onShowClose" @confirm="subMitSearch()" placeholder="请输入搜索关键字" v-model.trim="listQuery.keyword"/>
-				<text class="iconfont icon-shanchu1" v-if="isShowClose" @click.stop="delInputText()"></text>
+				<input class="input" maxlength="20" :focus="isFocus" type="text" value="" confirm-type="search" @focus="onFocus" @input="onShowClose" @confirm="subMitSearch()" placeholder="请输入搜索关键字" v-model.trim="listQuery.name"/>
+				<text class="iconfont icon-quxiao" v-if="isShowClose" @click.stop="delInputText()"></text>
 			</view>
 			<view class="search-btn" @click="SubMitSearch()">搜索</view>
 		</view>
@@ -13,7 +13,7 @@
 				<view class="header">搜索历史<text class="iconfont icon-shanchu" @click="confirmDetele"></text></view>
 				<view class="list">
 					<view class="list-main">
-						<view v-for="(item,index) in serachRecordList" :key="index" @click="keywordsClick(item.searchWord)">{{item.searchWord}}</view>
+						<view v-for="(item,index) in serachRecordList" :key="index" @click="keywordsClick(item)">{{item}}</view>
 					</view>
 				</view>
 			</view>
@@ -26,7 +26,7 @@
 					</view>
 					<view class="product-list-msgs">
 						<view class="product-name">{{ pro.name }}</view>
-						<view class="product-unit">规格:10ml/盒</view>
+						<view class="product-unit">规格:{{ pro.unit }}</view>
 						<view class="product-tags" v-if="pro.activistatus == 1"><text class="tag">活动价</text></view>
 						<view class="product-pric">
 							<view class="price">¥{{ pro.price | PriceFormat }}</view>
@@ -100,6 +100,7 @@
 				hasNextPage:false,
 				pullFlag: true,
 				listQuery:{ 
+					userId:0,
 					name:'',
 					pageNum: 1,
 					pageSize: 20,
@@ -110,8 +111,25 @@
 		},
 		onLoad(option) {
 			console.log(option)
+			if(option.type =='share'){
+				if(uni.getStorageSync('_WX_State')){
+					wxLogin.wxLoginAuthorize()
+				}	
+			}
+			this.$api.getStorage().then((resolve) =>{
+				this.userIdentity = resolve.userIdentity;
+				this.listQuery.userId = resolve.userId ? resolve.userId : 0;
+				if(option.keyWord){
+					this.listQuery.name = option.keyWord
+					this.getListFromServer()
+					this.isFocus = false
+				}else{
+					this.isFocus = true
+					this.InitGetSerachRecord()
+				}
+			})	
 			this.$api.getStorage().then((resolve) =>{
-				this.userId = resolve.userId ? resolve.userId : 0;
+				this.listQuery.userId = resolve.userId ? resolve.userId : 0;
 				this.userIdentity = resolve.userIdentity;
 				this.isFocus = true
 				this.InitGetSerachRecord()
@@ -127,18 +145,17 @@
 		},
 		methods:{
 			InitGetSerachRecord(){//查询搜索历史记录
-				this.ProductService.GetProductSearchHistory({userId:this.userID}).then(response =>{
+				this.ProductService.GetProductSearchHistory({userId:this.listQuery.userId}).then(response =>{
 					if(response.code == 0){
 						this.serachRecordList = response.data
 					}
 				})
 			},
 			SubMitSearch() {//搜索
-				if (this.listQuery.keyword == '') {
+				if (this.listQuery.name == '') {
 					this.$util.msg('请输入搜索关键词',2000);
 				}else{
 					this.productList =[]
-					this.SetSearchHistoryAdd()
 					this.getListFromServer()
 					this.isFocus = false
 				}
@@ -148,7 +165,7 @@
 					this.getListFromServer(true);
 				}
 			},
-			getListFromServer(loadMore) {
+			getListFromServer(loadMore) {//搜索商品
 				this.showLoading = true;
 				this.loadingNow = true;
 				this.loadingText = '加载中';
@@ -198,30 +215,22 @@
 					this.$util.msg('加入成功',1500,true,'success')
 				}
 			}, 
-			SetSearchHistoryAdd(){//添加搜索记录
-				if (!this.hasLogin) {return false;}
-				this.ProductService.GetAddProductSearchHistory({userId: this.userID,keyword:this.listQuery.keyword}).then(response =>{
-					//此为每次搜索同时添加用户的搜索记录
-				}).catch(error =>{
-					this.$util.msg(error.msg,2000);
-				})
-			},
 			onShowClose () {//输入框输入时触发
-				this.inputEmpty(this.listQuery.keyword)
+				this.inputEmpty(this.listQuery.name)
 			},
 			onFocus () { //输入框获取焦点时触发
-				this.inputEmpty(this.listQuery.keyword)
+				this.inputEmpty(this.listQuery.name)
 				this.InitGetSerachRecord()
 			},
 			delInputText () { //清除输入框内容
-				this.listQuery.keyword = ''
+				this.listQuery.name = ''
 				this.isShowClose = false
 				this.isShowWrapper = false
-				this.inputEmpty(this.listQuery.keyword)
+				this.inputEmpty(this.listQuery.name)
 				this.InitGetSerachRecord()
 			},
 			keywordsClick (item) {//关键词搜索与历史搜索
-				this.listQuery.keyword = item;
+				this.listQuery.name = item;
 				this.isShowClose = true;
 				this.isFocus = false
 				this.SubMitSearch();
@@ -235,7 +244,7 @@
 			handleClick(e) {//用户操作订单
 				let index = e.index;
 				if(index == 1){
-					this.ProductService.GetDeleteProductSearchHistory({userId:this.userID}).then(response =>{
+					this.ProductService.GetDeleteProductSearchHistory({userId:this.listQuery.userId}).then(response =>{
 						this.$util.msg('删除成功',2000,true,'success')
 						this.serachRecordList=[];
 					}).catch(error =>{
@@ -286,8 +295,8 @@
 		      // 来自页面内转发按钮
 		    }
 			return {
-			  title: `点击查看“${this.listQuery.keyword}”相关的商品`,
-			  path: `search/pages/search/search?type=share&keyWord=${this.listQuery.keyword}`
+			  title: `点击查看“${this.listQuery.name}”相关的商品`,
+			  path: `/pages/goods/search?type=share&keyWord=${this.listQuery.name}`
 			}
 		},
 		onShow() {
@@ -339,8 +348,13 @@
 				color: #8A8A8A;
 				z-index: 10;
 			}
-			.icon-shanchu1{
+			.icon-quxiao{
+				width: 66rpx;
+				height: 66rpx;
+				display: block;
+				line-height: 66rpx;
 				font-size: 36rpx;
+				text-align: center;
 				color: #8A8A8A;
 				position: absolute;
 				right: 10rpx;
@@ -349,7 +363,7 @@
 				z-index: 100;
 			}
 			.input{
-				width: 400rpx;
+				width: 530rpx;
 				height: 100%;
 				float: left;
 				font-size: $font-size-24;
@@ -474,6 +488,9 @@
 		padding: 32rpx 0;
 		box-sizing: border-box;
 		border-bottom: 1px solid #e1e1e1;
+		&:last-child{
+			border-bottom: none;
+		}
 		.product-list-image{
 			width: 182rpx;
 			height: 182rpx;

+ 78 - 121
pages/tabBar/cart/index.vue

@@ -1,5 +1,5 @@
 <template>
-	<view class="container cart clearfix" v-if="!hasLogin"> 	
+	<view class="container cart clearfix" v-if="hasLogin"> 	
 		<tui-skeleton v-if="skeletonShow" backgroundColor="#fafafa" borderRadius="10rpx" :isLoading	="true" :loadingType="5"></tui-skeleton>
 		<view class="container-cart-main tui-skeleton" :style="{paddingTop:isshowDelbtn ? '0rpx':'80rpx'}">
 			<view class="foot-check-delbtn" v-if="!isshowDelbtn && goodsList.length>0">
@@ -18,24 +18,26 @@
 								<view class="text">{{item.name}}</view> 
 							</view>
 							<view class="productlist">
-								<view 	class="goods-pros" v-for="(pros,idx) in item.productsList" :key="idx" >
+								<view 	class="goods-pros" v-for="(pros,idx) in item.productList" :key="idx" >
 									<view class="goods-pros-t">
 										<!--选择商品-->
 										<view class="checkbox-box" @click.stop="ischeck(item,pros)">
 											<view class="checkbox iconfont" :class="[pros.productsChecked ? 'icon-xuanze':'icon-weixuanze']"></view>
 										</view>
-										<view class="pros-img" @click.stop="navToListPage(pros.productId)"	><image :src="pros.image ? pros.image:''" alt="" /></view>
+										<view class="pros-img" @click.stop="navToListPage(pros.productId)"	><image :src="pros.mainImage ? pros.mainImage:''" alt="" /></view>
 										<view class="pros-product">
-											<view class="producttitle" @click.stop="navToListPage(pros.productId)"	>{{pros.name}}</view>
+											<view class="producttitle" @click.stop="navToListPage(pros.productId)"	>{{pros.productName}}</view>
 											<view class="productspec">规格:{{pros.unit ? pros.unit : ''}}</view>
-											<view class="floor-item-act"><view class="tag" @click.stop="clickPopupShow(pros,2)">活动价</view></view>
+											<view class="floor-item-act" v-if="pros.activeStatus == 1">
+												<view class="tag"@click.stop="clickPopupShow(pros,2)">活动价</view>
+											</view>
 											<view class="productprice">
 												<!--使用过滤器对总价改变-->
 												<view class="price"><text>¥</text>{{ pros.price  | NumFormat }}</view>
-												<view class="count" v-if="pros.validFlag == 2 "  :class="[isshowDelbtn ? 'none':'show']">
+												<view class="count">
 													<view class="number-box">
 														<view  class="iconfont icon-jianhao" @click="changeCountSub(item,pros)"></view>
-														<input class="btn-input" type="number" maxlength='4' v-model="pros.minBuyNumber" @blur="changeNnmber($event,item,pros)" @focus="changeInput(pros)">
+														<input class="btn-input" type="number" maxlength='4' v-model="pros.productCount" @blur="changeNnmber($event,item,pros)" @focus="changeInput(pros)">
 														<view  class="iconfont icon-jiahao"  @click="changeCountAdd(item,pros)"></view>
 													</view>
 												</view>
@@ -61,7 +63,7 @@
 						</view>
 						<view class="productlist">
 							<view class="goods-pros" v-for="(failure,failureIdx) in failureList" :key="failureIdx" >
-								<view class="goods-pros-t" @click.stop="failureToProduct(failure)">
+								<view class="goods-pros-t" @click.stop="navToListPage(failure)">
 									<!--选择商品-->
 									<view class="checkbox-box" @click.stop="ischeckFailure(failure)" v-if="isshowDelbtn">
 										<button class="checkbox iconfont" 
@@ -75,7 +77,7 @@
 									<view class="pros-product">
 										<view class="producttitle">{{failure.name}}</view>
 										<view class="productspec">规格:{{failure.unit ? failure.unit : ''}}</view>
-										<view class="productstate">{{failureStateText(failure.status)}}</view>
+										<view class="productstate">商品已下架</view>
 									</view>
 									<view class="pros-marks" v-if="failure.isFailureLayer"></view>
 								</view>
@@ -92,12 +94,7 @@
 						</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>¥{{ reducedPrice | NumFormat}}</text></text>
-							</view>
-							<view class="sum-price" :class="reducedPrice == 0 ? 'none' : ''">
+							<view v-if="!isshowDelbtn" class="sum-price">
 								总价:<text class="money-sign">¥</text><text class="money">{{allPrice | NumFormat}}</text>
 							</view>
 						</view>
@@ -134,7 +131,6 @@
 	import activiPopup from "@/components/cm-module/productDetails/cm-activipopu"
 	import modalLayer from "@/components/modal-layer"
 	import { mapState,mapMutations } from 'vuex';
-	import { cartList } from '@/common/json/data.json.js' //本地数据
 	
 	export default{
 		components:{
@@ -149,14 +145,12 @@
 				StaticUrl:this.$Static,
 				CustomBar:this.CustomBar,// 顶部导航栏高度
 				isIphoneX:this.$store.state.isIphoneX,
-				userID:'',
+				userId:'',
 				alertType:'',
-				isStock:'',
 				popupShow:false,
 				handlerPros:{},//监听单挑促销商品
 				failureList:[],	//失效商品列表
-				goodsList:cartList,	//购物车的商品
-				promotionsList:[],//促销列表
+				goodsList:[],	//购物车的商品
 				delGoodsList:'',//要删除的商品
 				setGoodData:'', //确认订单的商品
 				isCheckAll:false,//是否全选
@@ -166,7 +160,7 @@
 				reducedPrice:0,//满减
 				allCount:0,//被选中的产品数量
 				isModallayer:false,
-				skeletonShow:false,
+				skeletonShow:true,
 				isshowDelbtn:false,
 				isDisabled: false, // 供应商/店铺全选是否禁用状态
 				isNoConfim:false,
@@ -188,7 +182,6 @@
 		},
 		onLoad(){
 			this.setScrollHeight();
-			console.log(this.goodsList)
 		},
 		computed: {
 			...mapState(['hasLogin','userInfo'])
@@ -204,12 +197,11 @@
 		methods:{
 			initData(){
 				this.isModallayer = false //遮罩层 防止多次点击
-				// this.skeletonShow = true //预加载圆圈
 				this.isCheckAll=false//是否全选
 				this.submitIds = []
 				this.$api.getStorage().then((resolve) => {
-					this.userID = resolve.userId;
-					this.initGetCartGoodsList();
+					this.userId = resolve.userId ? resolve.userId : 0;
+					this.InitGetCartGoodsList();
 				})	
 			},
 			clickPopupShow(pros,type){
@@ -230,20 +222,19 @@
 					})
 				}, 500)
 			},
-			initGetCartGoodsList(){//初始化购物车 index:1
-				this.ProductService.QueryShoppingCartList({userId:this.userID}).then(response =>{
+			InitGetCartGoodsList(){//初始化购物车 index:1
+				this.ProductService.QueryShoppingCartList({userId:this.userId}).then(response =>{
 					this.skeletonShow = false
 					let data = response.data
-					this.kindCount = data.kindCount
-					this.promotionsList = data.promotions
-					this.$store.commit('updateAllNum',data.kindCount)
-					if( data.list.length > 0 || data.invalid.length > 0){
+					this.kindCount = data.cartQuantity
+					if( data.shopList.length > 0 || data.invalid.length > 0){
 						this.isEmpty =false
 					}else{
 						this.isEmpty =true
 					}
-					if(data.list && data.list.length > 0 ){
-						this.goodsList = data.list;
+					if(data.shopList && data.shopList.length > 0 ){
+						this.goodsList = data.shopList;
+						console.log(this.goodsList)
 						this.totalShopPeice()
 					} else {
 						this.goodsList = [];
@@ -287,23 +278,23 @@
 				
 			},
 			updateProductCheckedAllBtn(item) {// 单独每个供应商的勾选判断
-				let productsList = item.productsList,
+				let productList = item.productList,
 					productsCheckedLength = 0,
 					disabledLength = 0;
 				if(this.isshowDelbtn) {
-					productsList.forEach(pros => {
+					productList.forEach(pros => {
 						if(pros.productsChecked) {
 							productsCheckedLength++;
 						}
 					})
 				} else {
-					productsList.forEach(pros => {
+					productList.forEach(pros => {
 						if(pros.productsChecked) {
 							productsCheckedLength++;
 						}
 					})
 				}
-				item.checked = productsCheckedLength === productsList.length;
+				item.checked = productsCheckedLength === productList.length;
 			},
 			updateCheckAllBtn() {// 全选勾选判断
 				let goodsCheckedLength = 0,
@@ -331,7 +322,7 @@
 				this.updateCheckAllBtn();
 			},
 			setProductChecked(item) {
-				item.productsList.forEach(pros=>{
+				item.productList.forEach(pros=>{
 					if(item.checked) {
 						pros.productsChecked = true;
 						if(!this.submitIds.includes(pros.productId*1)){
@@ -376,8 +367,8 @@
 					let _reducedPrice = 0;
 					let _totalOriginalPrice =0;
 					item.productList.forEach(pros=>{
-						let _price = pros.retailPrice*pros.productCount
-						_totalOriginalPrice += pros.retailPrice*pros.productCount;
+						let _price = pros.price*pros.productCount
+						_totalOriginalPrice += pros.price*pros.productCount;
 						if(pros.promotion && pros.promotion.type != 2 && pros.promotion.mode == 2){
 							if(_price >= pros.promotion.touchPrice){
 								_price = _price - pros.promotion.reducedPrice
@@ -386,12 +377,13 @@
 							_totalPrice +=  _price
 						}else{
 							_reducedPrice = 0;
-							_totalPrice += pros.retailPrice*pros.productCount;
+							_totalPrice += pros.price*pros.productCount;
 						}
 					})
 					item.reducedPrice = _reducedPrice
 					item.totalOriginalPrice = _totalOriginalPrice
 					item.totalPrice = _totalPrice
+					console.log('合计',item.totalPrice)
 				})
 			},
 			totalPeice(){//计算总价格,每次调用此方法,将初始值为0,遍历价格并累加
@@ -406,11 +398,11 @@
 					item.originalprice = 0;
 					item.productList.forEach(pros=>{	
 						if(pros.productsChecked){								
-							supplierPrice += pros.retailPrice*pros.productCount;
+							supplierPrice += pros.price*pros.productCount;
 							// 单品满减
 							if(pros.promotion && pros.promotion.type*1===1 && pros.promotion.mode*1===2){
 								// 单品满减-重新计算供应商总价/满减金额
-								if(pros.retailPrice*pros.productCount >= pros.promotion.touchPrice){
+								if(pros.price*pros.productCount >= pros.promotion.touchPrice){
 									supplierPrice -= pros.promotion.reducedPrice;
 									supplierReducedPrice += pros.promotion.reducedPrice;
 								}
@@ -436,10 +428,10 @@
 				let prosAllCount=0
 				let validCount = 0
 				let validList =[];
-				let productsList =[];
+				let productList =[];
 			    this.goodsList.forEach(item=>{
-					productsList = item.productList
-					productsList.forEach(pros=>{
+					productList = item.productList
+					productList.forEach(pros=>{
 						if(pros.productsChecked){
 							prosAllCount+=parseInt(pros.productCount);
 							this.allCount = prosAllCount
@@ -450,28 +442,26 @@
 			changeCountAdd(item,pros){//商品数量加加
 				if(pros.step === 2){
 					pros.isStep = false
-					pros.number += pros.min
+					pros.productCount += pros.min
 					this.processActivityPrice(pros)
-					this.isStock = false
 				}else{
-					pros.number++
+					pros.productCount++
 					this.processActivityPrice(pros)
-					this.isStock = false
 				}
 				this.updateShoppogNum(pros)
 				this.totalShopPeice();
 			},
 			changeCountSub(item,pros){//商品数量减减
-				if(pros.number<=pros.min){
-					pros.number= pros.min
+				if(pros.productCount<=pros.min){
+					pros.productCount= pros.min
 					this.$util.msg(`该商品最小起订量为${pros.min}`,2000);
 					return
 				}else{
 					if(pros.step === 2){
 						pros.isStep = false
-						pros.number -= pros.min
+						pros.productCount -= pros.min
 					}else{
-						pros.number--
+						pros.productCount--
 					}
 					this.processActivityPrice(pros)
 				}
@@ -484,46 +474,51 @@
 			changeNnmber(e,item,pros){//输入商品数量更新
 				let _value = Number(e.detail.value);
 				if(!this.$api.isNumber(_value)){
-					pros.number = pros.min
+					pros.productCount = pros.min
 				}else if(_value < pros.min){	
 					this.$util.msg(`该商品最小起订量为${pros.min}`,2000);
-					pros.number = pros.min
+					pros.productCount = pros.min
 				}else if(_value % pros.min != 0){
 					pros.isStep = true
-					pros.number = pros.min
+					pros.productCount = pros.min
 				}else{
 					pros.isStep = false
-					pros.number = e.detail.value
+					pros.productCount = e.detail.value
 					this.processActivityPrice(pros)
 				}
 				this.updateShoppogNum(pros)
 				this.totalShopPeice();
 			},
 			processActivityPrice(pros){//单独处理活动价格和阶梯价格
-				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.ladderList.forEach((item,index)=>{
+						if(pros.productCount>=item.buyNum){
 							pros.price = item.buyPrice
 						}
 					})
 				}
 			},
 			updateShoppogNum(pros){//加减购物车商品更新到后台
-				let params ={userID:this.userID,productID:pros.productId,productCount:pros.number}
-				this.ProductService.ShoppingCartUpdate(params).then(response =>{
+				this.ProductService.ShoppingCartUpdate(
+					{
+						cartId:pros.cartId,
+						productCount:pros.productCount,
+					}
+				)
+				.then(response =>{
 					this.isshowDelbtn = false;
-					this.initGetCartGoodsList();
-				}).catch(error =>{
+					this.InitGetCartGoodsList();
+				})
+				.catch(error =>{
 					this.$util.msg(error.msg,2000);
 				})
 			 },
 			toConfirmation(){//跳转确认订单页面
 				let setGoodsList=[];
 				this.goodsList.forEach(res=>{
-					let products = res.productsList
+					let products = res.productList
 					products.forEach(pros=>{
 						if(pros.productsChecked){
 						    setGoodsList.push(pros.productId)
@@ -536,9 +531,9 @@
 				}else{
 					this.isNoConfim = false
 					this.goodsList.forEach(el=>{
-						el.productsList.forEach(pros=>{
+						el.productList.forEach(pros=>{
 							if(pros.productsChecked){
-							   if(pros.number<pros.min){
+							   if(pros.productCount<pros.min){
 								   this.isNoConfim = true
 							   }
 							}
@@ -550,7 +545,7 @@
 					}
 					let productID = '';
 					this.goodsList.forEach(el=>{//获取勾选的商品ID拼接字符串逗号隔开,最后一个逗号去掉
-						el.productsList.forEach(pros=>{
+						el.productList.forEach(pros=>{
 							if(pros.productsChecked){
 							   productID += pros.productId+','
 							}
@@ -572,7 +567,7 @@
 				} else {
 					this.goodsList.forEach(item => {
 						if(item.checked) {
-							item.productsList.forEach(pros => {
+							item.productList.forEach(pros => {
 								pros.productsChecked = true;
 							})
 						}
@@ -597,7 +592,7 @@
 						if(item.isDisabled) {
 							item.checked = false;
 						}
-						item.productsList.forEach(pros => {
+						item.productList.forEach(pros => {
 							if(pros.validFlag == 3) {
 								pros.productsChecked = false;
 							}
@@ -618,18 +613,18 @@
 			deleteList(){//删除购物车商品
 				this.delGoodsList=[];
 				this.goodsList.forEach(delitem=>{
-					let products = delitem.productsList
+					let products = delitem.productList
 					products.forEach(pros=>{
 						if(pros.productsChecked){
 						    this.delGoodsList += pros.cartId+','
 						}
 					})
 				})
-				// this.failureList.forEach(failure=>{
-				// 	if(failure.productsChecked){
-				// 		this.delGoodsList += failure.cartId+','
-				// 	}
-				// })
+				this.failureList.forEach(failure=>{
+					if(failure.productsChecked){
+						this.delGoodsList += failure.cartId+','
+					}
+				})
 				if(this.delGoodsList.length == 0){
 					this.$util.msg("请选择要删除的商品~",2000);
 					return
@@ -658,7 +653,7 @@
 						this.$util.msg('删除成功',2000);
 						setTimeout(()=>{
 							this.isshowDelbtn = false;
-							this.initGetCartGoodsList();
+							this.InitGetCartGoodsList();
 						},1000)
 					}).catch(error =>{
 						this.$util.msg(error.msg,2000)
@@ -669,49 +664,9 @@
 			hideMobel(){
 				this.modal = false;
 			},
-			goIndex(){
-				uni.switchTab({
-				    url: '/pages/tabBar/index/index'
-				});
-			},
-			goNavto(url){
-				uni.navigateTo ({
-					url
-				})
-			},
-			navToListPage(id){
+			navToListPage(productId){
 				this.isModallayer = true;
-				this.$api.navigateTo(`/pages/goods/product?id=${id}`)
-			},
-			failureToProduct(failure){
-				if(failure.status == 1){
-					this.$util.msg('商品已丢失,不能查看',2000)
-					return
-				}else if(failure.status == 2){
-					this.$util.msg('商品已停售,不能查看',2000)
-					return
-				}else{
-					this.isModallayer = true;
-					this.$api.navigateTo(`/pages/goods/product?id=${failure.productId}`)
-				}
-			},
-			failureStateText(state){
-				let stateText = '',
-					stateTextObject={
-						1:'商品已丢失',
-						2:'商品已停售',
-						3:'商品已下架',
-						4:'商品已售罄',
-						5:'价格仅会员可见,您不能购买',
-						6:'未公开价格',
-						7:'库存不足'
-					}
-				Object.keys(stateTextObject).forEach(key => {
-					if(key == state){
-						stateText = stateTextObject[key]
-					}
-				})
-				return stateText;
+				this.$api.navigateTo(`/pages/goods/product?productId=${productId}`)
 			},
 			setHeaderBtnPosi(){
 				// 获得胶囊按钮位置信息
@@ -748,7 +703,7 @@
 		    }
 		},
 		onPullDownRefresh() {//下拉刷新
-			this.initGetCartGoodsList()
+			this.InitGetCartGoodsList()
 			uni.stopPullDownRefresh()
 		},
 		onShow(){
@@ -1016,6 +971,8 @@
 				font-size: $font-size-26;
 			}
 			.productprice{
+				position: absolute;
+				bottom: 0;
 				width: 100%;
 				height: 48rpx;
 				margin: 30rpx 0 0 0;

+ 16 - 4
pages/tabBar/index/index.vue

@@ -33,7 +33,7 @@
 					<view class="product-list-tag" v-if="pro.activistatus == 1"><text class="tag">活动价</text></view>
 					<view class="product-list-pri">
 						<view class="price">¥{{ pro.price | PriceFormat}}</view>
-						<view class="carts" @click.stop="handAddCarts">
+						<view class="carts" @click.stop="handAddCarts(pro)">
 							<view class="carts-add">
 								<text class="iconfont icon-gouwuche"></text>
 							</view>
@@ -135,7 +135,6 @@
 				this.CommonService.GetProductCarousel().then(response =>{
 					let data = response.data;
 					this.bannerImageList = data
-					// this.$store.commit('updateAllNum',data.shoppingCartCount)
 				}).catch(error =>{
 					this.$util.msg(error.msg,2000)
 				})
@@ -145,6 +144,7 @@
 					let data = response.data;
 					this.productList = data.list
 					this.hasNextPage = data.hasNextPage
+					this.GetCartNumber();
 					this.skeletonShow = false;
 				}).catch(error =>{
 					this.$util.msg(error.msg,2000)
@@ -161,7 +161,7 @@
 				})
 			},
 			Details(pro){
-				this.$api.navigateTo(`/pages/goods/product?id=${pro.productId}`)
+				this.$api.navigateTo(`/pages/goods/product?productId=${pro.productId}`)
 			},
 			handAddCarts(pro){
 				if(!this.hasLogin){
@@ -171,9 +171,21 @@
 						this.$api.navigateTo(`/pages/login/login`)
 					}
 				}else{
-					this.$util.msg('加入成功',1500,true,'success')
+					this.ProductService.shoppingAddCart({productId:pro.productId,userId:this.userId,productCount:1}).then(response => {
+						this.$util.msg('加入购物车成功',1500,true,'success')
+						this.GetCartNumber()
+					}).catch(error =>{
+						this.$util.msg(error.msg,2000);
+					})
 				}
 			}, 
+			GetCartNumber(){//查询购物车数量
+				this.ProductService.QueryShoppingQuantity({userId:this.userId}).then(response => {
+					this.$store.commit('updateAllNum',response.data)
+				}).catch(error =>{
+					this.$util.msg(error.msg,2000);
+				})
+			},
 			handleClick(data){
 				this.$api.navigateTo(`/h5/pages/activity/meobohui`)
 				this.$store.commit('setActivity',data)

+ 5 - 2
pages/tabBar/user/index.vue

@@ -105,7 +105,7 @@
 			</view>
 			<!-- 菜单导航区域END -->
 			<!-- 底部 -->
-			<view class="user-support">
+			<view class="user-support" :class=" userIdentity == 2 ? 'top' : ''">
 				<image class="user-support-image" :src="StaticUrl+'icon-logo@1x.png'" mode=""></image>
 				<view class="user-support-text">采美365网提供商品技术服务</view>
 			</view>
@@ -374,11 +374,14 @@ export default {
 .user-support{
 	width: 100%;
 	float: left;
-	margin-top: 240rpx;
+	margin-top: 340rpx;
 	display: flex;
 	flex-direction: column;
 	align-items: center;
 	justify-content: center;
+	&.top{
+		margin-top: 240rpx;
+	}
 	.user-support-image{
 		width: 54rpx;
 		height: 46rpx;

+ 1 - 4
pages/user/address/address.vue

@@ -206,10 +206,7 @@ export default {
 				}
 			)
 			.then(res => {
-				this.$util.msg('设置成功', 1000, true, 'success')
-				setTimeout(() => {
-					this.GetAddressList()
-				}, 1000)
+				this.GetAddressList()
 			})
 			.catch(err => {
 				this.GetAddressList()

+ 14 - 12
services/product.service.js

@@ -34,7 +34,7 @@ export default class ProductService {
 	/**
 	 * @加入购物车
 	 * @param:userId 用户ID(必填)
-	 * @param:productID 用户ID(必填)
+	 * @param:productId 用户ID(必填)
 	 * @param:productCount 商品数量(必填)
 	 */
 	shoppingAddCart (data = {}) {
@@ -56,7 +56,17 @@ export default class ProductService {
 			isLoading: false 
 		})
 	}
-	
+	/**
+	 * @查询购物车数量
+	 * @param:userId 用户ID(必填)
+	 */
+	QueryShoppingQuantity (data = {}) {
+		return this.AjaxService.get({ 
+			url:'/shopping/quantity', 
+			data, 
+			isLoading: false 
+		})
+	}
 	/**
 	 * @更新购物车商品增减
 	 * @param:cartId 购物车ID
@@ -83,23 +93,15 @@ export default class ProductService {
 	/* 查询搜索历史记录 */
 	GetProductSearchHistory (data = {}) {
 		return this.AjaxService.get({ 
-			url:'/product/searchHistory', 
+			url:'/product/search/history', 
 			data, 
 			isLoading: false ,
 		})
 	}
-	/* 添加搜索历史记录 */
-	GetAddProductSearchHistory (data = {}) {
-		return this.AjaxService.get({ 
-			url:'/product/history/add', 
-			data, 
-			isLoading: true ,
-		})
-	}
 	/* 清除搜索历史记录 */
 	GetDeleteProductSearchHistory (data = {}) {
 		return this.AjaxService.get({ 
-			url:'/product/searchHistory/delete', 
+			url:'/product/delete/history', 
 			data, 
 			isLoading: false ,
 		})

+ 1 - 1
services/user.service.js

@@ -37,7 +37,7 @@ export default class UserService {
 		return this.AjaxService.get({
 			url: '/other/findAddress',
 			data,
-			isLoading: true
+			isLoading: false
 		})
 	}
 	/**

+ 0 - 2
services/wxLogin.js

@@ -18,7 +18,6 @@ const wxLoginAuthorize = async function(){
 		store.commit('updateStatus',_data)
 		store.commit('login',_data);
 		uni.setStorageSync('openId',_data.openId)
-		uni.switchTab({url:'/pages/tabBar/index/index'})
 	})
 	.catch(error =>{
 		const _data = JSON.parse(error.data);
@@ -41,7 +40,6 @@ const wxLoginQuick = async function(){// 根据微信的code获取用户登录
 			store.commit('updateStatus',_data)
 			store.commit('login',_data);
 			uni.setStorageSync('openId',_data.openId)
-			uni.switchTab({url:'/pages/tabBar/index/index'})
 		})
 		.catch(error =>{
 			const _data = JSON.parse(response.data);

+ 3 - 3
store/index.js

@@ -58,17 +58,17 @@ const store = new Vuex.Store({
 		updateAllNum(state, num) {
 			if (num >= 100) {
 				uni.setTabBarBadge({
-					index: 2,
+					index: 1,
 					text: '99+'
 				})
 			} else if (num > 0) {
 				uni.setTabBarBadge({
-					index: 2,
+					index: 1,
 					text: String(num)
 				})
 			} else {
 				uni.removeTabBarBadge({
-					index: 2,
+					index: 1,
 				})
 			}
 		},

Некоторые файлы не были показаны из-за большого количества измененных файлов