Explorar el Código

commit -m 测试

zhengjinyi hace 4 años
padre
commit
008c01defc
Se han modificado 7 ficheros con 608 adiciones y 1863 borrados
  1. 1 0
      App.vue
  2. 8 10
      pages.json
  3. 0 1554
      pages/tabBar/cart/cart.vue
  4. 0 296
      pages/tabBar/category/index.vue
  5. 413 0
      pages/tabBar/index.vue
  6. 177 0
      pages/tabBar/login.vue
  7. 9 3
      pages/user/cart/cart.vue

+ 1 - 0
App.vue

@@ -72,6 +72,7 @@ export default {
 		}
 	},
 	methods: {
+		...mapMutations(['login','logout']),
 		async getWxAuthorize() {
 			const wechatCode = await authorize.getCode('weixin')
 			this.UserService.userInfoLogin({ 

+ 8 - 10
pages.json

@@ -22,23 +22,21 @@
 			}
 		},
 		{
-			"path": "pages/tabBar/category/index",
+			"path": "pages/goods/list",
 			"style": {
-				"navigationBarTitleText": "分类",
-				"navigationStyle": "custom"
+				"navigationBarTitleText": "立即下单"
 			}
 		},
 		{
-			"path": "pages/tabBar/cart/cart",
+			"path": "pages/tabBar/index",
 			"style": {
-				"navigationBarTitleText": "购物车",
-				"enablePullDownRefresh": true
+				"navigationBarTitleText": "弃用勿删"
 			}
 		},
 		{
-			"path": "pages/goods/list",
+			"path": "pages/tabBar/login",
 			"style": {
-				"navigationBarTitleText": "立即下单"
+				"navigationBarTitleText": "弃用勿删"
 			}
 		},
 		{
@@ -167,13 +165,13 @@
 		"borderStyle": "black",
 		"backgroundColor": "#ffffff",
 		"list": [{
-				"pagePath": "pages/tabBar/category/index",
+				"pagePath": "pages/tabBar/index",
 				"iconPath": "static/icon-home@3x.png",
 				"selectedIconPath": "static/icon-home-active@3x.png",
 				"text": "商城"
 			},
 			{
-				"pagePath": "pages/tabBar/cart/cart",
+				"pagePath": "pages/tabBar/login",
 				"iconPath": "static/icon-cart@3x.png",
 				"selectedIconPath": "static/icon-cart-active@3x.png",
 				"text": "购物车"

+ 0 - 1554
pages/tabBar/cart/cart.vue

@@ -1,1554 +0,0 @@
-<template>
-	<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">
-				<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-yixuanze':'icon-weixuanze']"></view>
-								</view>
-								<view v-if="item.promotions" class="floor-item-act">
-									<view class="floor-tags" @click.stop="clickPopupShow(item,2)">{{item.promotions.name}}</view>	
-								</view>
-								<view class="text">{{item.name}}</view> 
-							</view>
-							<view class="productlist">
-								<view 	class="goods-pros" v-for="(pros,idx) in item.cartList" :key="idx" >
-									<view class="goods-pros-t">
-										<!--选择商品-->
-										<view class="checkbox-box" @click.stop="ischeck(item,pros)">
-											<view class="checkbox iconfont" :class="[pros.productsChecked ? 'icon-yixuanze':'icon-weixuanze']"></view>
-										</view>
-										<view class="pros-img" @click.stop="navToListPage(pros.productId)"	><image :src="pros.image ? pros.image:''" alt="" /></view>
-										<view class="pros-product">
-											<view class="producttitle" @click.stop="navToListPage(pros.productId)"	>{{pros.name}}</view>
-											<view class="productspec">规格:{{pros.unit ? pros.unit : ''}}</view>
-											<view class="productprice">
-												<!--使用过滤器对总价改变-->
-												<view class="price" :class="PromotionsFormat(pros.promotions) ? 'disabled' : ''">
-													<text>¥</text>
-													{{ (PromotionsFormat(pros.promotions) ? pros.originalPrice : pros.price)  | NumFormat }}
-												</view>
-												<view class="count" v-if="pros.validFlag == 2 "  :class="[isshowDelbtn ? 'none':'show']">
-													<text class="count-tips" v-if="pros.number<pros.min">起订量:{{pros.min}}</text>
-													<text class="count-tips step" v-if="pros.isStep">购买量必须为起订量的整数倍</text>
-													<view class="number-box">
-														<view  class="iconfont icon-jianhao" @click="changeCountSub(item,pros)"></view>
-														<input class="btn-input" type="number" maxlength='4' v-model="pros.number" @blur="changeNnmber($event,item,pros)" @focus="changeInput(pros)">
-														<view  class="iconfont icon-jiahao"  @click="changeCountAdd(item,pros)"></view>
-													</view>
-												</view>
-											</view>
-											<view v-show="pros.actStatus==1" class="floor-item-act">
-												<view v-if="PromotionsFormat(pros.promotions)"  class="floor-tags" @click.stop="clickPopupShow(pros,1)">
-													{{pros.promotions.name}}
-													<text v-if ="pros.promotions!=null && pros.promotions.type!=3">
-														:¥{{ pros.promotions == null ? '0.00' : pros.promotions.touchPrice | NumFormat}}
-													</text>
-												</view>
-												<view v-else-if="pros.promotions.type!=3" class="floor-tags" @click.stop="clickPopupShow(pros,2)">{{pros.promotions.name}}</view>	
-											</view>
-											<view  v-if="pros.actStatus == null  &&  pros.ladderFlag == 1" class="floor-item-act">
-												<view class="floor-tags" @click.stop="clickPopupShow(pros,2)">阶梯价格</view>	
-											</view>
-										</view>	
-									</view>
-								</view>
-							</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="failureToProduct(failure)">
-									<!--选择商品-->
-									<view class="checkbox-box" @click.stop="ischeckFailure(failure)" v-if="isshowDelbtn">
-										<button class="checkbox iconfont" 
-												:class="[ failure.productsChecked ? 'icon-yixuanze':'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">{{failureStateText(failure.status)}}</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-yixuanze':'icon-weixuanze']"></button> 
-							<view class="text">全选</view>
-						</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' : ''">
-								总价:<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="https://img.caimei365.com/group1/M00/03/71/Cmis2F3wna6AWdWzAAGlgAP0das422.png" mode="aspectFit"></image>
-					<text class="error-text">购物车空空如也,快去商城逛逛吧~</text>
-					<view class="login-btn"  @click="goIndex">去商城</view>
-				</view>
-			</view>
-		</view>
-		<!-- 促销活动弹窗 -->
-		<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 activiPopup from "@/components/cm-module/productDetails/cm-activipopu"
-	import modalLayer from "@/components/modal-layer"
-	import { mapState,mapMutations } from 'vuex';
-	
-	export default{
-		components:{
-			tuiSkeleton,
-			tuiLoadmore,
-			tuiNomore,
-			activiPopup,
-			modalLayer
-		},
-		data(){
-			return{
-				CustomBar:this.CustomBar,// 顶部导航栏高度
-				isIphoneX:this.$store.state.isIphoneX,
-				userID:'',
-				alertType:'',
-				isStock:'',
-				popupShow:false,
-				handlerPros:{},//监听单挑促销商品
-				failureList:[],	//失效商品列表
-				goodsList:[],	//购物车的商品
-				promotionsList:[],//促销列表
-				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:[]
-			}
-		},
-		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.skeletonShow = true //预加载圆圈
-				this.isCheckAll=false//是否全选
-				this.submitIds = []
-				this.$api.getStorage().then((resolve) => {
-					this.userID = resolve.userID;
-					this.initGetCartGoodsList();
-				})	
-			},
-			initLogin(){
-				authorize.getSetting().then(wxResponse =>{// console.log('是否已授权',res);//0:为取消授权 1:为已授权 2:为未操作
-					if(wxResponse == 1){
-						this.$api.redirectTo('/pages/login/login?type=4')
-					}else{
-						this.$api.navigateTo('/pages/authorization/authorization?type=0')
-					}
-				})	
-			},
-			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.kindCount
-					this.promotionsList = data.promotions
-					this.$store.commit('updateAllNum',data.kindCount)
-					if( data.list.length > 0 || data.invalid.length > 0){
-						this.isEmpty =false
-					}else{
-						this.isEmpty =true
-					}
-					if(data.list && data.list.length > 0 ){
-						this.goodsList = data.list;
-						this.goodsList.forEach((item,index) => {
-							item.cartList.forEach(pros => {
-								pros.shopID = item.shopID;
-								pros.isStep = false
-								if(pros.step === 2){ 
-									if(pros.number % pros.min != 0){
-										pros.number = pros.min
-										this.totalShopPeice()
-										this.updateShoppogNum(pros)
-									}
-								}
-							})
-						})
-						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 productsList = item.cartList,
-					productsCheckedLength = 0,
-					disabledLength = 0;
-				if(this.isshowDelbtn) {
-					productsList.forEach(pros => {
-						if(pros.productsChecked) {
-							productsCheckedLength++;
-						}
-					})
-				} else {
-					productsList.forEach(pros => {
-						if(pros.productsChecked) {
-							productsCheckedLength++;
-						}
-					})
-				}
-				item.checked = productsCheckedLength === productsList.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.cartList.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)=>{
-					//计算店铺满减后店铺合计
-					if(item.promotions && item.promotions.mode == 2){
-						let prosPrice=0;
-						let totalOriginalPrice = 0;//商铺合计原价
-						item.cartList.forEach(pros=>{
-							prosPrice += pros.price*pros.number
-							totalOriginalPrice += pros.originalPrice*pros.number
-						})
-						if(prosPrice >= item.promotions.touchPrice){
-							item.totalPrice = prosPrice - item.promotions.reducedPrice  
-							item.reducedPrice = item.promotions.reducedPrice
-							item.totalOriginalPrice = totalOriginalPrice
-						}else{
-							item.reducedPrice = 0  //统计合计价格
-							item.totalPrice = prosPrice
-						}
-					}else{//以下为计算除店铺满减以外的单品满减以及正常商品合计
-						let _totalPrice = 0;
-						let _reducedPrice = 0;
-						let _totalOriginalPrice =0;
-						item.cartList.forEach(pros=>{
-							let _price = pros.price*pros.number
-							_totalOriginalPrice += pros.price*pros.number;
-							if(pros.promotions && pros.promotions.type != 2 && pros.promotions.mode == 2){
-								if(_price >= pros.promotions.touchPrice){
-									_price = _price - pros.promotions.reducedPrice
-									_reducedPrice += pros.promotions.reducedPrice
-								}
-								_totalPrice +=  _price
-							}else{
-								_reducedPrice = 0;
-								_totalPrice += pros.price*pros.number;
-							}
-						})
-						item.reducedPrice = _reducedPrice
-						item.totalOriginalPrice = _totalOriginalPrice
-						item.totalPrice = _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.cartList.forEach(pros=>{	
-						if(pros.productsChecked){								
-							supplierPrice += pros.price*pros.number;
-							// 单品满减
-							if(pros.promotions && pros.promotions.type*1===1 && pros.promotions.mode*1===2){
-								// 单品满减-重新计算供应商总价/满减金额
-								if(pros.price*pros.number >= pros.promotions.touchPrice){
-									supplierPrice -= pros.promotions.reducedPrice;
-									supplierReducedPrice += pros.promotions.reducedPrice;
-								}
-							}
-						}	
-					})
-					// 店铺满减
-					if(item.promotions && item.promotions.mode*1===2){
-						// 店铺满减-计算供应商总价/满减金额
-						if(supplierPrice >= item.promotions.touchPrice){
-							supplierPrice -= item.promotions.reducedPrice;
-							supplierReducedPrice += item.promotions.reducedPrice;
-						}
-					}
-					item.totalprice = supplierPrice;
-					item.reducedprice = supplierReducedPrice;
-					item.originalprice = (supplierPrice+supplierReducedPrice);
-					totalPrice += item.totalprice;
-					reducedPrice += item.reducedprice;
-					originalPrice += item.originalprice;
-				})
-				 //总促销计算
-				this.promotionsList.forEach(promotions =>{
-					// 凑单满减
-					if(promotions.mode*1===2 && promotions.type*1===2){
-						let total = 0;
-						 promotions.productList.forEach(pros=>{
-							if (this.submitIds.includes(pros.productId*1)){
-								total += pros.number * pros.price;
-							}
-						});
-						if(total>=promotions.touchPrice){
-							totalPrice -= promotions.reducedPrice;
-							reducedPrice += promotions.reducedPrice;
-						}
-					}
-				});
-				//最后统计商品原价
-				this.totalOriginalPrice = originalPrice;
-				//最后满减金额 = 店铺减去金额 + 单品减去金额 + 凑单减去金额
-				this.reducedPrice = reducedPrice;
-				//最终合计价格 = 	店铺满减合计 + 单品满减  + 正常合计 + 凑单满减			
-				this.allPrice = totalPrice ;
-			},
-			totalCount(){//计算总数量
-			    this.allCount = 0
-				let prosAllCount=0
-				let validCount = 0
-				let validList =[];
-				let productsList =[];
-			    this.goodsList.forEach(item=>{
-					productsList = item.cartList
-					productsList.forEach(pros=>{
-						if(pros.productsChecked){
-							prosAllCount+=parseInt(pros.number);
-							this.allCount = prosAllCount
-						}
-					})
-			    })
-			},		
-			changeCountAdd(item,pros){//商品数量加加
-				if(pros.step === 2){
-					pros.isStep = false
-					pros.number += pros.min
-					this.processActivityPrice(pros)
-					this.isStock = false
-				}else{
-					pros.number++
-					this.processActivityPrice(pros)
-					this.isStock = false
-				}
-				this.updateShoppogNum(pros)
-				this.totalShopPeice();
-			},
-			changeCountSub(item,pros){//商品数量减减
-				if(pros.number<=pros.min){
-					pros.number= pros.min
-					this.$util.msg(`该商品最小起订量为${pros.min}`,2000);
-					return
-				}else{
-					if(pros.step === 2){
-						pros.isStep = false
-						pros.number -= pros.min
-					}else{
-						pros.number--
-					}
-					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.number = pros.min
-				}else if(_value < pros.min){	
-					this.$util.msg(`该商品最小起订量为${pros.min}`,2000);
-					pros.number = pros.min
-				}else if(_value % pros.min != 0){
-					pros.isStep = true
-					pros.number = pros.min
-				}else{
-					pros.isStep = false
-					pros.number = 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.price = item.buyPrice
-						}
-					})
-				}
-			},
-			updateShoppogNum(pros){//加减购物车商品更新到后台
-				let params ={userID:this.userID,productID:pros.productId,productCount:pros.number}
-				this.ProductService.ShoppingCartUpdate(params).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.cartList
-					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.cartList.forEach(pros=>{
-							if(pros.productsChecked){
-							   if(pros.number<pros.min){
-								   this.isNoConfim = true
-							   }
-							}
-						})
-					})
-					if(this.isNoConfim){
-						this.$util.modal('','有商品的购买量没达到最小起订量,请修改数量后再次提交结算','去修改','',false,() =>{})
-						return;
-					}
-					let productID = '';
-					this.goodsList.forEach(el=>{//获取勾选的商品ID拼接字符串逗号隔开,最后一个逗号去掉
-						el.cartList.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.cartList.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.cartList.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.cartList
-					products.forEach(pros=>{
-						if(pros.productsChecked){
-						    this.delGoodsList += pros.productId+','
-						}
-					})
-				})
-				this.failureList.forEach(failure=>{
-					if(failure.productsChecked){
-						this.delGoodsList += failure.productId+','
-					}
-				})
-				if(this.delGoodsList.length == 0){
-					this.$util.msg("请选择要删除的商品~",2000);
-					return
-				}else{			
-					this.$util.modal('','确定删除选中的商品吗?','确定','取消',true,() =>{
-						this.ProductService.ShoppingCartDelete({userID:this.userID,productIDs:this.delGoodsList}).then(response =>{
-							this.$util.msg('删除成功',2000);
-							setTimeout(()=>{
-								this.isshowDelbtn = false;
-								this.initGetCartGoodsList();
-							},2000)
-						}).catch(error =>{
-							this.$util.msg(error.msg,2000)
-						})
-					})
-				}
-			},
-			deletefailureList(){
-				this.failureList.forEach(failure=>{ this.delGoodsList += failure.productId+',' })
-				this.$util.modal('','确定清空全部失效商品吗?','确定','取消',true,() =>{
-					this.ProductService.ShoppingCartDelete({userID:this.userID,productIDs:this.delGoodsList}).then(response =>{
-						this.$util.msg('删除成功',2000);
-						setTimeout(()=>{
-							this.isshowDelbtn = false;
-							this.initGetCartGoodsList();
-						},2000)
-					}).catch(error =>{
-						this.$util.msg(error.msg,2000)
-					})
-				})
-			},
-			goIndex(){
-				uni.switchTab({
-				    url: '/pages/tabBar/home/index'
-				});
-			},
-			goNavto(url){
-				uni.navigateTo ({
-					url
-				})
-			},
-			navToListPage(id){
-				console.log('111111111111')
-				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;
-			},
-			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.initLogin()
-			}
-		},
-	}
-</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 #e15616;
-			color: #E15616;
-			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-yixuanze{
-				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;
-			}
-			.floor-item-act{
-				height: 56rpx;
-				text-align: center;
-				box-sizing: border-box;
-				float: left;
-				padding:10rpx 0;
-				margin-left: 20rpx;
-				.floor-tags{
-					height: 28rpx;
-					border-radius: 6rpx;
-					background-color: #FFFFFF;
-					line-height: 28rpx;
-					color: $color-system;
-					text-align: center;
-					display: inline-block;
-					padding:0 16rpx;
-					font-size: $font-size-20;
-					border: 1px solid #E15616;
-					float: right;
-				}
-			}
-		}
-		.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: #FF2A2A;
-					font-size: $font-size-26;
-				}
-				.money-sign{
-					font-size: $font-size-24;
-					color: #FF2A2A;
-				}
-			}
-		}
-		.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: #FF2A2A;
-					float: left;
-					font-weight: bold;
-					&.disabled{
-						color: #999999;
-						text-decoration: line-through;
-					}
-					.money-sign{
-						font-size: $font-size-24;
-						color: #FF2A2A;
-					}
-				}
-				.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 #ffe6dc;
-						border-radius: 30rpx;
-						.iconfont{
-							font-size: $font-size-24;
-							padding:0 18rpx;
-							color: #999999;
-							text-align: center;
-							line-height: 48rpx;
-							font-weight: bold;
-							background: #fef6f3;
-							&.icon-jianhao{
-								border-radius: 30rpx 0 0 30rpx;
-							}
-							&.icon-jiahao{
-								border-radius: 0 30rpx 30rpx 0;
-							}
-						}
-						.btn-input{
-							width: 62rpx;
-							height: 48rpx;
-							line-height: 48rpx;
-							background: #fff;
-							border-radius: 4rpx;
-							text-align: center;
-							font-size: $font-size-24;
-						}
-					}
-					.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: 56rpx;
-				text-align: center;
-				box-sizing: border-box;
-				float: left;
-				padding:0 0 10rpx 0;
-				margin-left: 10rpx;
-				.floor-tags{
-					height: 28rpx;
-					border-radius: 6rpx;
-					background-color: #FFFFFF;
-					line-height: 28rpx;
-					color: $color-system;
-					text-align: center;
-					display: inline-block;
-					padding:0 16rpx;
-					font-size: $font-size-20;
-					border: 1px solid #E15616;
-					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:#FFFFFF;
-					// border: 1px solid #C9C9C9;
-					// color: #999999;
-					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: 110rpx;
-		position: fixed;
-		bottom: 0rpx;
-		z-index: 100;
-		.footer-le{
-			width: 520rpx;
-			height: 100%;
-			padding:0 24rpx;
-			float: left;
-			box-sizing: border-box;
-			.foot-check{
-				width: 100rpx;
-				float: left;
-				line-height: 110rpx;
-				font-size: $font-size-24;
-				.checkbox{
-					width: 40rpx;
-					text-align: center;
-				}
-				.text{
-					width: 60rpx;
-					float: right;
-				}
-			}
-			.sum{
-				width: 360rpx;
-				height: 110rpx;
-				float: right;
-				box-sizing: border-box;
-				padding: 10rpx;
-				.sum-none{
-					width: 100%;
-					height: 45rpx;
-					line-height: 45rpx;
-					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: 45rpx;
-					line-height: 45rpx;
-					font-size: $font-size-30;
-					color: $text-color;
-					float: left;
-					font-weight: normal;
-					&.none{
-						height: 90rpx;
-						line-height: 90rpx;
-					}
-					.money{
-						color: #FF2A2A;
-					}
-					.money-sign{
-						font-size: $font-size-24;
-						color: #FF2A2A;
-					}
-				}
-			}
-		}
-		.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:linear-gradient(135deg,rgba(242,143,49,1) 0%,rgba(225,86,22,1) 100%);
-				font-size: $font-size-28;
-				line-height: 84rpx;
-				color: #FFFFFF;
-				display: flex;
-				border-radius: 42rpx;
-				justify-content: center;
-				align-items: center;
-			}
-		}
-		.footer-del{
-			width: 400rpx;
-			height: 110rpx;
-			position: absolute;
-			padding-left: 200rpx;
-			background: #FFFFFF;
-			right: 0;
-			top: 0;
-			z-index: 1000;
-			&.show{
-				animation: showDelbtn 0s linear both;
-			}
-			&.none{
-				animation: hideDelbtn 0s linear both;
-			}
-			.btn{
-				width: 50%;
-				height: 100%;
-				line-height: 110rpx;
-				font-size: $font-size-28;
-				color: #FFFFFF;
-				text-align: center;
-				float: left;
-			}
-			.btn.btn-cancel{
-				background:#EEC1AB;
-			}
-			.btn.btn-confirm{
-				background:#FF2A2A;
-			}
-			@keyframes showDelbtn {
-				0% {
-					transform: translateX(0);
-				}
-				100% {
-					transform: translateX(-100%);
-				}
-			}
-			@keyframes hideDelbtn {
-				0% {
-					transform: translateX(-100%);
-				}
-				100% {
-					transform: translateX(0);
-				}
-			}
-		}
-	}
-</style>

+ 0 - 296
pages/tabBar/category/index.vue

@@ -1,296 +0,0 @@
-<template>
-	<view id="category" :style="{paddingTop:CustomBar+'px'}">
-		<!--顶部搜索导航栏-->
-		<view class="'search-input-fixed" :style="{top:CustomBar/2+'px'}">
-			<cat-search :systeminfo='systeminfo' :navbar-data='nvabarData' :headerBtnPosi ="headerBtnPosi" @click="hanldTabClick"></cat-search>
-		</view>
-		<view class="category-list">
-			<!-- 左侧分类导航 -->
-			<scroll-view class="left-aside" scroll-y="true" scroll-with-animation :scroll-top="verticalNavTop" :style="{top:(CustomBar+38)+'px',height:(windowHeight-CustomBar+38)+'px'}">
-				<view class="row" v-for="(m, index) in categoryList" :key="index" :class="[index==showCategoryIndex?'on':'']" @tap="showCategory($event,index)" :data-id="index">
-					<view class="text">{{m.name}}</view>
-					<view class="block"></view>
-				</view>
-			</scroll-view>
-			<!--右侧子导航-->   
-			<scroll-view  scroll-y="true" class="right-aside" :style="{top:(CustomBar+38)+'px',height:(windowHeight-CustomBar+38)+'px'}">
-				<view class="category" v-for="(first,index) in categoryList" :key="index" v-show="index==showCategoryIndex" >
-					<template v-if="first.smalltypeList">
-						<view class="category-box AAA" v-for="(small,oIndex) in first.smalltypeList" :key="oIndex">
-							<view class="title">{{small.name}}</view>
-							<view class="list" v-if="small.tinytypeList.length > 0">
-								<view class="box" v-for="(pro,proIndex) in small.tinytypeList" :key="proIndex" @click.stop="navToListPage(pro,3)">
-									<image :src="pro.crmIcon ? pro.crmIcon : 'https://static.caimei365.com/app/img/icon/icon-noneproduct.jpg'"></image>
-									<view class="text">{{pro.name}}</view>
-								</view>
-							</view>
-							<view v-else class="no-data">
-								<view class="box" @click.stop="navToListPage(small,2)">
-									<image :src="small.crmIcon ? small.crmIcon : 'https://static.caimei365.com/app/img/icon/icon-noneproduct.jpg'"></image>
-									<view class="text">全部商品</view>
-								</view>
-							</view>
-						</view>
-					</template>
-					<template v-else>
-						<view class="category-box BBB">
-							<view class="title">{{first.name}}</view>
-							<view class="no-data">
-								<view class="box" @click.stop="navToListPage(first,1)">
-									<image :src="first.crmIcon ? first.crmIcon : 'https://static.caimei365.com/app/img/icon/icon-noneproduct.jpg'"></image>
-									<view class="text">全部商品</view>
-								</view>
-							</view>
-						</view>
-					</template>
-				</view>
-			</scroll-view>
-		</view>
-	</view>
-</template>
-<script>
-	import catSearch from '@/components/uni-search/cat-search.vue'
-	export default {
-		components: {
-			catSearch
-		},
-		data() {
-			return {
-				nvabarData: {							 //顶部自定义导航
-					showCapsule: 1, // 是否显示左上角图标   1表示显示    0表示不显示
-					title: ''		// 导航栏 中间的标题
-				},
-				CustomBar:this.CustomBar,// 顶部导航栏高度
-				headerBtnPosi:	this.setHeaderBtnPosi(), //获取设备顶部胶囊高度
-				systeminfo: this.setSysteminfo(),		 //获取设备信息
-				headerShow:true,
-				showCategoryIndex: 0,
-				categoryList: [],//分类列表
-				search: '',
-				cateTop: {},
-				verticalNavTop: 0,
-				categoryTabIndex:1,
-				windowHeight:0,
-				scrollHeight:0,
-			}
-		},
-		onLoad() {
-			this.initData();
-		},
-		methods: {
-			initData() {// 数据初始化
-				this.GetProductCate(this.categoryTabIndex);
-				const {windowHeight, pixelRatio} = wx.getSystemInfoSync();
-				this.windowHeight = windowHeight - 1;
-				this.scrollHeight = windowHeight - 1;
-			},
-			hanldTabClick(data){
-				this.categoryList = []
-				this.GetProductCate(data);
-			},
-			GetProductCate (index) {// 获取商品分类列表
-				this.CommonService.GetFirstClassly({typeSort:index,source :'crm'}).then(response =>{
-					this.categoryList = response.data
-					// 查询第一个拥有二级菜单的子菜单
-					for (let i = 0; i < this.categoryList.length; i++) {
-						if (this.categoryList[i].smalltypeList.length > 0) {
-							this.showCategoryIndex = i;
-							break;
-						}
-					}
-				}).catch(error =>{
-					this.$util.msg(error.msg,2000)
-				})
-			},
-			showCategory(e,index){//分类切换显示
-				this.showCategoryIndex = index;
-				this.verticalNavTop = (e.currentTarget.dataset.id - 1) * 50
-			},
-			toSearch () {// 跳转至搜索详情页
-				uni.navigateTo({
-					url: `/pages/search/search?search=${JSON.stringify(this.search)}`
-				})
-			},
-			navToListPage(item,index){//分类导航跳转
-				switch(index){
-					case 1:
-						this.$api.navigateTo(`/pages/goods/goods-classify?classType=1&id=${item.bigTypeID}&title=${item.name}`)
-						break;
-					case 2:
-						this.$api.navigateTo(`/pages/goods/goods-classify?classType=2&id=${item.smallTypeID}&title=${item.name}`)
-						break;
-					case 3:
-						this.$api.navigateTo(`/pages/goods/goods-classify?classType=3&id=${item.tinyTypeID}&title=${item.name}`)
-						break;
-				}
-			},
-			setHeaderBtnPosi(){
-				// 获得胶囊按钮位置信息
-				let headerBtnPosi = uni.getMenuButtonBoundingClientRect();
-				return headerBtnPosi
-			},
-			setSysteminfo(){
-				let systeminfo;
-				uni.getSystemInfo({ // 获取设备信息
-					success: (res) => {
-						systeminfo = res
-					},
-				})
-				return systeminfo
-			},
-		}
-	}
-</script>
-<style scoped lang="scss">
-	page {
-		background-color: #fff;
-	}
-	.search-input-fixed{
-		width: 100%;
-		height:auto;
-		position: fixed;
-		top: 0;
-		left: 0;
-		z-index: 1000;
-		background: #FFFFFF;
-		border-bottom: 1px solid #F7F7F7;
-	}		
-	#category {
-		/*模块分类*/
-		.category-list{
-			width: 100%;
-			background-color: #fff;
-			display: flex;
-			.left-aside,.right-aside{
-				position: absolute;
-				top: 100rpx;
-				/*  #ifdef  APP-PLUS  */
-				top: calc(100rpx + var(--status-bar-height));
-				/*  #endif  */
-				bottom: 0rpx;
-			}
-			.left-aside{
-				width: 200rpx;
-				left: 0rpx;
-				background-color: #f2f2f2;
-				.row{
-					width: 100%;
-					height: 100rpx;
-					display: flex;
-					align-items: center;
-					position: relative;
-					.text{
-						width: 100%;
-						position: relative;
-						font-size: $font-size-28;
-						display: flex;
-						justify-content: center;
-						color: $text-color;
-						/* transition: transform 0.3s ease;*/
-						transition-property: transform;
-						transition-duration: 0.2s;
-						transition-timing-function: ease;
-					}
-					.block{
-						position: absolute;
-						width: 0rpx;
-						left: 0;
-						/* transition: transform 0.3s ease;*/
-						transition-property: transform;
-						transition-duration: 0.2s;
-						transition-timing-function: ease;
-					}
-					&.on{
-						height: 100rpx;
-						background-color: #fff;
-						.text{
-							font-size: $font-size-28;
-							color: $color-system;
-						}
-						.block{
-							width: 10rpx;
-							height: 60rpx;
-							top: 20rpx;
-							background-color: $color-system;
-							border-radius: 0 15rpx 15rpx 0;
-						}
-					}
-				}
-			}
-			.right-aside{
-				width: 550rpx;
-				left: 200rpx;
-				.category{
-					width: calc(100%);
-					padding: 0 15rpx 20rpx 0;
-					background: #F7F7F7;
-					.category-box{
-						background: #FFFFFF;
-						margin-bottom: 20rpx;
-						.title{
-							padding: 0 24rpx;
-							line-height: 80rpx;
-							height: 80rpx;
-							text-align: left;
-							color: $text-color;
-							font-size: $font-size-26;
-							border-bottom: 1px solid #F7F7F7;
-							font-weight: 600;
-						}
-						.list{
-							margin-top: 24rpx;
-							width: 100%;
-							display: flex;
-							flex-wrap: wrap;
-							.box{
-								width: calc(71.44vw / 3);
-								margin-bottom: 40rpx;
-								display: flex;
-								justify-content: center;
-								align-items: center;
-								flex-wrap: wrap;
-								image{
-									width: 140rpx;
-									height: 140rpx;
-								}
-								.text{
-									margin-top: 8rpx;
-									width: 100%;
-									display: flex;
-									justify-content: center;
-									font-size: $font-size-24;
-								}
-							}
-						}
-						.no-data {
-							text-align: center;
-							margin: 30rpx 0;
-							color: #666666;
-							font-size: 24rpx;
-							line-height: 80rpx;
-							.box{
-								width: calc(71.44vw / 3);
-								margin-bottom: 40rpx;
-								display: flex;
-								justify-content: center;
-								align-items: center;
-								flex-wrap: wrap;
-								image{
-									width: 140rpx;
-									height: 140rpx;
-								}
-								.text{
-									margin-top: 8rpx;
-									width: 100%;
-									display: flex;
-									justify-content: center;
-									font-size: $font-size-24;
-								}
-							}
-						}
-					}
-				}
-			}
-		}
-	}
-</style>

+ 413 - 0
pages/tabBar/index.vue

@@ -0,0 +1,413 @@
+<template>
+	<view class="container" :style="{ paddingTop: CustomBar + 'px' }">
+		<cm-custom :navbar-data="nvabarData"></cm-custom>
+		<!-- 机构信息区域 -->
+		<template v-if="isRequest">
+			<!-- <view class="ws-title" :style="{lineHeight :CustomBar + 'px' }">维沙采购商城</view> -->
+			<view class="ws-header">
+				<!-- 用户信息 -->
+				<view class="user-info">
+					<image src="@/static/ws/default_avatar.png" mode="widthFix"></image>
+					<view
+						class="ws-login"
+						@click="navigator('/pages/login/login')"
+						v-if="!hasLogin && isRequest"
+					>
+						请登录
+					</view>
+					<view class="user-text" v-else> {{ organizeName }} </view>
+				</view>
+				<!-- 背景图 -->
+				<image class="user-bg" src="@/static/ws/user_bg.png" mode="widthFix"></image>
+			</view>
+			<!-- 机构信息END -->
+			<!-- 订单状态区域 -->
+			<view class="order-wrap">
+				<view class="more">
+					<text class="title">我的订单</text>
+					<view @click="navigator('/pages/user/order/order-list?state=0')">
+						<text class="more-right">全部订单</text>
+						<text class="iconfont icon-chakangengduo"></text>
+					</view>
+				</view>
+				<view class="line"></view>
+				<!-- 菜单选项 -->
+				<view class="order-nav">
+					<view
+						class="order-nav-item"
+						@click="navigator('/pages/user/order/order-list?state=1')"
+					>
+						<image src="@/static/ws/dh_dfk_02.png" mode="widthFix"></image>
+						<text>待付款</text>
+						<view class="tui-badge tui-badge-box" v-if="paymentCount > 0">
+							<tui-badge :scaleRatio="0.8" type="danger">{{
+								paymentCount | countNum
+							}}</tui-badge>
+						</view>
+					</view>
+					<view
+						class="order-nav-item"
+						@click="navigator('/pages/user/order/order-list?state=2')"
+					>
+						<image src="@/static/ws/dh_dfh_03.png" mode="widthFix"></image>
+						<text>待发货</text>
+						<view class="tui-badge tui-badge-box" v-if="waitShipmentsCount > 0">
+							<tui-badge :scaleRatio="0.8" type="danger">{{
+								waitShipmentsCount | countNum
+							}}</tui-badge>
+						</view>
+					</view>
+					<view
+						class="order-nav-item"
+						@click="navigator('/pages/user/order/order-list?state=3')"
+					>
+						<image src="@/static/ws/dh_yfh_04.png" mode="widthFix"></image>
+						<text>已发货</text>
+						<view class="tui-badge tui-badge-box" v-if="shipmentsCount > 0">
+							<tui-badge :scaleRatio="0.8" type="danger">{{
+								shipmentsCount | countNum
+							}}</tui-badge>
+						</view>
+					</view>
+					<view
+						class="order-nav-item"
+						@click="navigator('/pages/user/order/order-list?state=4')"
+					>
+						<image src="@/static/ws/dh_tk_05.png" mode="widthFix"></image>
+						<text>退货/款</text>
+						<view class="tui-badge tui-badge-box" v-if="salesReturnCount > 0">
+							<tui-badge :scaleRatio="0.8" type="danger">{{
+								salesReturnCount | countNum
+							}}</tui-badge>
+						</view>
+					</view>
+				</view>
+			</view>
+			<!-- 订单状态区域END -->
+			<!-- 帮机构下单 -->
+			<view
+				class="place-order"
+				@click="navigator(`/pages/user/club/club-list?id=${organizeId}`)"
+			>
+				<view class="place-left">
+					<text class="iconfont icon-bangjigouxiadan"></text>
+					<text class="title">帮机构下单</text>
+				</view>
+				<text class="iconfont icon-chakangengduo"></text>
+			</view>
+			<!-- 帮机构下单END -->
+			<!-- 客服 -->
+			<button class="ws-service" open-type="contact" @bindcontact="handleContact">
+				<text class="iconfont icon-zaixiankefu"></text> 在线客服
+			</button>
+		</template>
+	</view>
+</template>
+
+<script>
+import nutBadge from '@/components/thorui/tui-badge/tui-badge.vue'
+import { mapState, mapMutations } from 'vuex'
+import authorize from '@/common/config/authorize.js'
+import wxLogin from '@/common/config/wxLogin.js'
+
+export default {
+	components: {
+		nutBadge
+	},
+	data() {
+		return {
+			nvabarData: {
+				//顶部自定义导航
+				showCapsule: 1, // 是否显示左上角图标  1表示显示  0表示不显示,
+				showSearch: 0,
+				title: '维沙采购商城', // 导航栏 中间的标题
+				haveBack: false,
+				textLeft: this.$store.state.isIphone,
+				textColor: '#333333',
+				bgColor: '#ffffff'
+			},
+			CustomBar: this.CustomBar, // 顶部导航栏高度
+			organizeName: '', //采购员组织名称
+			isRequest: false,
+
+			paymentCount: 0, //待付款角标
+			waitShipmentsCount: 0, //待收货角标
+			shipmentsCount: 0, //已发货角标
+			salesReturnCount: 0, //退货/款角标
+			organizeId: '',
+			refresh: false
+		}
+	},
+	onLoad() {
+		// 获取用户是否授权
+		//0:为取消授权 1:为已授权 2:为未操作
+		authorize.getSetting().then(res => {
+			if (res == 1) {
+				console.log('用户已授权')
+				this.GetWxAuthorize()
+			} else {
+				this.isRequest = true
+			}
+		})
+	},
+	computed: {
+		...mapState(['hasLogin', 'userInfo'])
+	},
+	filters: {
+		countNum(value) {
+			return value > 99 ? '99+' : value
+		}
+	},
+	methods: {
+		...mapMutations(['login', 'logout']),
+		// 授权登录验证
+		async GetWxAuthorize() {
+			// 获取微信code
+			const wechatCode = await authorize.getCode('weixin')
+			this.UserService.userInfoLogin({ 
+				code: wechatCode ,
+			})
+			.then(res => {
+				// 登录成功  将信息保存在userInfo中 保存在本地和store
+				this.login(res.data)
+				this.organizeId = res.data.organizeId
+				this.getUserInfoPersonal(this.organizeId)
+				this.refresh = true
+				this.isRequest = true
+			})
+			.catch(err => {
+				// 缓存游客openid
+				uni.setStorageSync('openid', err.data.openid)
+				this.logout()
+				this.refresh = true
+				this.isRequest = true
+			})
+		},
+		//初始化个人中心数据
+		getUserInfoPersonal(organizeId) {
+			this.UserService.userInfoPersonal({ organizeId: organizeId })
+				.then(response => {
+					console.log(response)
+					this.organizeName = response.data.organizeName //采购员组织名称
+					this.paymentCount = response.data.paymentCount //待付款
+					this.waitShipmentsCount = response.data.waitShipmentsCount //待收货
+					this.shipmentsCount = response.data.shipmentsCount //已发货
+					this.salesReturnCount = response.data.salesReturnCount //退货/款
+				})
+				.catch(error => {
+					this.$util.msg(error.msg, 2000)
+				})
+		},
+		// 客服
+		handleContact(e) {
+			console.log(e.detail.path)
+			console.log(e.detail.query)
+		},
+		// 栏目跳转
+		navigator(url) {
+			authorize.getSetting().then(res => {
+				// console.log('是否已授权',res);
+				//0:为取消授权 1:为已授权 2:为未操作
+				if (res == 1) {
+					if (this.hasLogin) {
+						// 已登录
+						this.$api.navigateTo(url)
+					} else {
+						// 未登录
+						this.$api.navigateTo(`/pages/login/login`)
+					}
+				} else {
+					this.$api.navigateTo(`/pages/authorization/authorization`)
+				}
+			})
+		},
+		//下拉刷新
+		onPullDownRefresh() {
+			if (this.hasLogin) {
+				this.GetWxAuthorize()
+				if (this.refresh) {
+					uni.stopPullDownRefresh()
+				}
+			} else {
+				uni.stopPullDownRefresh()
+			}
+		},
+		onShareAppMessage(res) {
+			//分享转发
+			this.isShareModal = false
+			if (res.from === 'button') {
+				// 来自页面内转发按钮
+			}
+			return {
+				title: '维沙采购商城上线啦,快来采购吧~',
+				path: `/pages/index/index`,
+				imageUrl: 'https://static-b.caimei365.com/app/wisa/img/icon/icon-index.png'
+			}
+		}
+	}
+}
+</script>
+
+<style lang="scss">
+@import '@/uni.scss';
+.container {
+	box-sizing: border-box;
+	background: #f7f7f7;
+}
+// 用户登录信息区域
+.ws-title {
+	width: 100%;
+	position: fixed;
+	top: 0;
+	left: 0;
+	font-size: 34rpx;
+	text-align: center;
+}
+.ws-header {
+	position: relative;
+	height: 280rpx;
+	.user-info {
+		position: absolute;
+		z-index: 10;
+		width: 750rpx;
+		height: 280rpx;
+		display: flex;
+		flex-direction: column;
+		align-items: center;
+		justify-content: center;
+		image {
+			display: block;
+			width: 120rpx;
+			height: 120rpx;
+			border-radius: 50%;
+		}
+	}
+	// 登录按钮
+	.ws-login {
+		width: 184rpx;
+		height: 56rpx;
+		margin-top: 25rpx;
+		border-radius: 28rpx;
+		background: linear-gradient(to right, #fccd90, #b6762f);
+		line-height: 56rpx;
+		text-align: center;
+		color: #ffffff;
+		font-size: 28rpx;
+	}
+	// 公司名
+	.user-text {
+		width: 446rpx;
+		margin-top: 25rpx;
+		color: #fff;
+		font-size: 28rpx;
+		line-height: 40rpx;
+		text-align: center;
+		white-space: nowrap;
+		overflow: hidden;
+		text-overflow: ellipsis;
+	}
+	.user-bg {
+		width: 100%;
+	}
+}
+.more {
+	width: 750rpx;
+	display: flex;
+	justify-content: space-between;
+	align-items: center;
+	padding: 23rpx 25rpx;
+	box-sizing: border-box;
+	background: #fff;
+	.more-right {
+		font-size: 26rpx;
+		line-height: 37rpx;
+		margin-right: 10rpx;
+	}
+	.title {
+		font-size: 32rpx;
+		line-height: 45rpx;
+		color: #333333;
+	}
+	.iconfont {
+		font-size: 20rpx;
+		vertical-align: middle;
+	}
+}
+.order-wrap {
+	background: #fff;
+
+	.line {
+		width: 702rpx;
+		height: 1px;
+		margin: 0 auto;
+		background: #f0f0f0;
+	}
+	.order-nav {
+		display: flex;
+		justify-content: space-evenly;
+		align-items: center;
+		padding: 40rpx 0;
+		.order-nav-item {
+			position: relative;
+			display: flex;
+			align-items: center;
+			flex-direction: column;
+			image {
+				width: 56rpx;
+				height: 56rpx;
+			}
+			text {
+				font-size: 26rpx;
+				line-height: 37rpx;
+				margin-top: 8rpx;
+			}
+			.tui-badge {
+				position: absolute;
+				top: -15rpx;
+				right: -20rpx;
+				z-index: 999;
+			}
+		}
+	}
+}
+.place-order {
+	width: 750rpx;
+	display: flex;
+	justify-content: space-between;
+	align-items: center;
+	padding: 23rpx 25rpx;
+	box-sizing: border-box;
+	background: #fff;
+	margin-top: 20rpx;
+	.place-left {
+		.title {
+			font-size: 28rpx;
+			line-height: 40rpx;
+			margin-left: 10rpx;
+		}
+		.iconfont {
+			font-size: 36rpx;
+			vertical-align: middle;
+		}
+	}
+	.iconfont {
+		font-size: 20rpx;
+	}
+}
+.ws-service {
+	width: 160rpx;
+	height: 48rpx;
+	margin: 40rpx auto 0;
+	display: flex;
+	justify-content: center;
+	align-items: center;
+	font-size: 22rpx;
+	background: linear-gradient(to right, #fccd90, #b6762f);
+	color: #fff;
+	border-radius: 24rpx;
+	.iconfont {
+		font-size: 30rpx;
+		margin-right: 6rpx;
+	}
+}
+</style>

+ 177 - 0
pages/tabBar/login.vue

@@ -0,0 +1,177 @@
+<template>
+	<view class="container login">
+		<!-- logo区域 -->
+		<view class="login-main">
+			<image class="logo" src="/static/ws/logo.png" mode="widthFix"></image>
+		</view>
+		<!-- 邀请码标题 -->
+		<view class="login-title">
+			<image src="/static/ws/invitation_code.png" mode="widthFix"></image> <text>邀请码</text>
+		</view>
+		<!-- 邀请码 -->
+		<view class="login-input">
+			<vcode-input
+				borderValueColor="#e8e8e8"
+				borderActiveColor="#e8e8e8"
+				ref="vcodeInputRef"
+				@vcodeInput="vcodeInput"
+				@vcodeChange="vcodeChangeHandle"
+				sum="6"
+			></vcode-input>
+		</view>
+		<!-- 提示信息 -->
+		<view class="logo-message" v-if="loginMessage !== ''"
+			><text>{{ loginMessage }}</text>
+		</view>
+		<button class="login-btn" @click="goLogin" :disabled="isCodeEmpty">登录</button>
+	</view>
+</template>
+
+<script>
+import authorize from '@/common/config/authorize.js'
+import wxLogin from '@/common/config/wxLogin.js'
+import VcodeInput from '@/components/vcode-input/vcode-input'
+import { mapState, mapMutations } from 'vuex'
+import { invitationCodeLogin } from '@/services/use.js'
+export default {
+	components: { VcodeInput },
+	data() {
+		return {
+			invitationCode: '', //获取用户登录的邀请码
+			loginMessage: '' //登录信息反馈
+		}
+	},
+	onLoad(option) {},
+	computed: {
+		...mapState(['isWxAuthorize', 'isLoginType', 'isLoginProductId', 'isLoginOrderId']),
+		// 邀请码长度是否符合要求
+		isCodeEmpty() {
+			return this.invitationCode.trim().length < 6
+		}
+	},
+	methods: {
+		...mapMutations(['login']),
+		// 登录
+		goLogin() {
+			// 获取用户微信信息
+			wx.getUserInfo({
+				success: res => {
+					this.isUserInfo = false
+					this.userInfo = res.userInfo
+					// 验证邀请码
+					this.UserService.userInvitation({
+						invitationCode: this.invitationCode,
+						nickName: res.userInfo.nickName,
+						openid: uni.getStorageSync('openid')
+					})
+					.then(response => {
+						console.log(response)
+						// 保存用户信息
+						this.login(response.data)
+						this.$store.commit('updateStatus', response.data)
+						// 登录成功提示
+						this.$util.msg('登录成功', 1500, false, 'success')
+						setTimeout(() => {
+							this.$api.navigateTo(`/pages/index/index`)
+						}, 1500)
+					})
+					.catch(error => {
+						this.loginMessage = error.msg
+						this.isUserInfo = false
+						// this.$util.msg(error.msg, 2000)
+					})
+				}
+			})
+		},
+		// 输入框输入介绍
+		vcodeInput(val) {
+			// this.invitationCode = val
+			console.log(val)
+		},
+		// 输入框输入事件
+		vcodeChangeHandle(val) {
+			this.invitationCode = val
+			// console.log(val)
+		},
+		// 控制组件获取焦点
+		setFocus() {
+			this.$refs.VcodeInput.setFocus()
+		},
+		// 控制组件失去焦点
+		setBlur() {
+			this.$refs.VcodeInput.setBlur()
+		},
+		// 清除已输入
+		clearValue() {
+			this.$refs.VcodeInput.clearValue()
+		}
+	},
+	onShow() {}
+}
+</script>
+
+<style lang="scss">
+.login {
+	display: flex;
+	align-items: center;
+	flex-direction: column;
+	.login-main,
+	.login-title,
+	.logo-message {
+		width: 590rpx;
+	}
+	.login-main {
+		display: flex;
+		justify-content: center;
+		margin: 180rpx 0 60rpx;
+		image {
+			width: 151rpx;
+			height: 151rpx;
+			border-radius: 50%;
+		}
+	}
+	.login-title {
+		display: flex;
+		justify-content: flex-start;
+		image {
+			width: 40rpx;
+			height: 40rpx;
+			margin-right: 6rpx;
+		}
+	}
+	.login-btn {
+		width: 600rpx;
+		height: 90rpx;
+		text-align: center;
+		line-height: 90rpx;
+		background-color: #000;
+		border-radius: 45rpx;
+		color: #fff;
+		margin-top: 40rpx;
+	}
+	.login-input {
+		margin: 30rpx 0;
+	}
+	.logo-message {
+		margin-bottom: 64rpx;
+		font-size: 24rpx;
+		line-height: 33rpx;
+		color: #ff2a2a;
+		display: flex;
+		justify-content: center;
+		align-items: center;
+		&::before {
+			content: '!';
+			display: block;
+			width: 22rpx;
+			height: 22rpx;
+			border: 1px solid #ff2a2a;
+			border-radius: 50%;
+			color: #ff2a2a;
+			text-align: center;
+			line-height: 22rpx;
+			margin-right: 6rpx;
+		}
+	}
+}
+</style>

+ 9 - 3
pages/user/cart/cart.vue

@@ -687,7 +687,8 @@
 				}
 			},
 			deletefailureList(){
-				this.failureList.forEach(failure=>{ this.delGoodsList += failure.productId+',' })
+				this.delGoodsList = ''
+				this.failureList.forEach(failure=>{ this.delGoodsList += failure.cartId+',' })
 				this.modal = true;
 				this.contentModalText = '确定清除所有失效商品吗?';	
 				this.deleteType = 2
@@ -695,12 +696,17 @@
 			handleClick(e) {//用户操作订单
 				let index = e.index;
 				if(index == 1){
-					this.ProductService.ShoppingCartDelete({cartIds:this.delGoodsList}).then(response =>{
+					this.ProductService.ShoppingCartDelete(
+						{
+							cartIds:this.delGoodsList,
+						}
+					)
+					.then(response =>{
 						this.$util.msg('删除成功',2000);
 						setTimeout(()=>{
 							this.isshowDelbtn = false;
 							this.initGetCartGoodsList();
-						},2000)
+						},1000)
 					}).catch(error =>{
 						this.$util.msg(error.msg,2000)
 					})