lhl hai 1 ano
pai
achega
bc120f6f3e

+ 26 - 1
components/PageDesign/PageDesign.vue

@@ -15,7 +15,7 @@
 			<view class="" v-if="temData[index].comName === 'NavBar' && temData[index+1].comName !== 'NavBar'">
 				<image src="http://up.liuniukj.com/167307900573324/931544405107da76ca2ec31cd63fae49/yyzq.png" mode=""
 					class="banner-ad"
-					@click="goPage('/pagesT/unit/item')"></image>
+					@click="navTo('/pagesT/unit/item')"></image>
 			</view>
 			<AdvGroup v-if="item.comName === 'AdvGroup'" :modelData="item.modelData" />
 			<GoodsGroup v-if="item.comName === 'GoodsGroup'" :modelData="item.modelData" :goodsList="item.data"
@@ -133,6 +133,31 @@
 			// this.getHome();
 		},
 		methods: {
+			navTo(url) {
+				// console.log(this.hasLogin)
+				// return
+				if (!this.$store.state.hasLogin) {
+					// #ifdef APP-PLUS
+					uni.reLaunch({
+						url: '/pagesT/public/wxLogin'
+					});
+					// #endif
+					// #ifdef MP-WEIXIN
+					uni.reLaunch({
+						url: '/pagesT/binding/bindInfo'
+					});
+					//#endif
+					// #ifdef H5
+					uni.navigateTo({
+						url: '/pagesT/public/wxLogin?loginType=2'
+					});
+					// #endif
+				} else {
+					uni.navigateTo({
+						url
+					});
+				}
+			},
 			backEvent() {
 				if (this.isBackIndex) {
 					this.goPage('/pages/index/index', 'switchTab');

+ 4 - 2
pages/user/user.vue

@@ -228,7 +228,7 @@
 				<view class="list-li clearfix" @click="navTo('/pagesT/unit/yhk')">
 					<view class="fn-icon">
 						<image src="https://api.junhailan.com/img/user/hyk.png" mode="aspectFill"></image>
-						<view>优惠卡</view>
+						<view>会员项目</view>
 					</view>
 				</view>
 				<view class="list-li clearfix" @click="navTo('/pagesT/user/GetCoupon')">
@@ -658,7 +658,9 @@
 				if (this.userInfo.salesManName) {
 					this.call_show = true;
 				} else {
-					this.lianxi(this.enterprisemobile);
+					// this.lianxi(this.enterprisemobile);
+					this.lianxi('17350663338');
+					
 				}
 			},
 			// 完善资料提示取消

+ 42 - 17
pagesT/order/createOrderT.vue

@@ -373,9 +373,27 @@
 				})
 				this.canpay = false
 			},
+			isJson(str) {
+			    if (typeof str == 'string') {
+			        try {
+			            var obj = JSON.parse(str);
+			            if (typeof obj == 'object' && obj) {
+			                return true;
+			            } else {
+			                return false;
+			            }
+			
+			        } catch (e) {
+			            console.log('error:' + str + '!!!' + e);
+			            return false;
+			        }
+			    }
+			    console.log('It is not a string!')
+			},
 			//判断是否能预约员工
 			getYgYyTimeArea() {
 				let that = this
+				that.canpay = false
 				that.$u.api.getYgYyTimeArea({
 					time: that.choose_time,
 					uid: that.choose_yg.uid
@@ -384,28 +402,35 @@
 				}) => {
 					console.log(data,'data')
 					let choose_time = that.choose_time_detail.replace(/\:/g, '')
-					if(data.time_slot) {
+					if(this.isJson(data.time_slot)) {
 						data.time_slot = JSON.parse(data.time_slot)
 					}
-					let worktime = [data.time_slot[0][0].replace(/\:/g, ''), data.time_slot[0][1].replace(/\:/g,
-						'')]
-					// 判断员工是否在工作时间
-					console.log(choose_time, worktime)
-					if (choose_time * 1 >= worktime[0] * 1 && choose_time * 1 <= worktime[1] * 1) {
-						this.canpay = true
-					} else {
-						console.log('该员工不在工作时间')
-						that.cannot()
-					}
-					if (data.reserved && data.reserved.length > 0) {
-						for (let i = 0; i < data.reserved.length; i++) {
-							console.log(i)
-							if (that.choose_time_detail == data.reserved[i]) {
-								that.cannot('该员工已有预约')
-								break
+					
+					for(let j = 0;j<data.time_slot.length;j++) {
+						let worktime = [data.time_slot[j][0].replace(/\:/g, ''), data.time_slot[j][1].replace(/\:/g,
+							'')]
+						// 判断员工是否在工作时间
+						console.log(choose_time, worktime)
+						if (choose_time * 1 >= worktime[0] * 1 && choose_time * 1 <= worktime[1] * 1) {
+							this.canpay = true
+							console.log('可以预约');
+							break
+						} else {
+							if(j == data.time_slot.length) {
+								that.cannot()
+							}
+							
+						}
+						if (data.reserved && data.reserved.length > 0) {
+							for (let i = 0; i < data.reserved.length; i++) {
+								if (j== data.time_slot.length && that.choose_time_detail == data.reserved[i]) {
+									that.cannot('该员工已有预约')
+									break
+								}
 							}
 						}
 					}
+					
 
 				})
 			},

+ 26 - 6
pagesT/unit/item.vue

@@ -1,7 +1,7 @@
 <template>
 	<view class="content">
 		<view class="gq-list">
-			<view class="gq-item" v-for="item in list" @click="goPage('/pagesT/unit/itemdetail?id=' + item.id)">
+			<view class="gq-item" v-for="item in list" @click="navTo('/pagesT/unit/itemdetail?id=' + item.id)">
 				<view class="gq-logo">
 					<image :src="item.image" mode="" class=""></image>
 				</view>
@@ -76,14 +76,34 @@
 			
 		},
 		methods: {
-			navto(url) {
-				uni.navigateTo({
-					url
-				})
+			navTo(url) {
+				// console.log(this.hasLogin)
+				// return
+				if (!this.$store.state.hasLogin) {
+					// #ifdef APP-PLUS
+					uni.reLaunch({
+						url: '/pagesT/public/wxLogin'
+					});
+					// #endif
+					// #ifdef MP-WEIXIN
+					uni.reLaunch({
+						url: '/pagesT/binding/bindInfo'
+					});
+					//#endif
+					// #ifdef H5
+					uni.navigateTo({
+						url: '/pagesT/public/wxLogin?loginType=2'
+					});
+					// #endif
+				} else {
+					uni.navigateTo({
+						url
+					});
+				}
 			},
 			getList() {
 				let that = this
-				if (that.loadingType == 'nomore' || that.loadingType == 'loading') {
+				if (that.loadingType == 'loading') {
 					return
 				}
 				that.loadingType = 'loading'

+ 13 - 13
pagesT/unit/itemdetail.vue

@@ -12,16 +12,16 @@
 						<view class="icon ibonfont ibonhome"></view>
 						<view class="text">首页</view>
 					</view>
-					<view class="box" @click="goPage('/pages/cart/cart', 'switchTab')">
+					<!-- <view class="box" @click="goPage('/pages/cart/cart', 'switchTab')">
 						<u-badge v-if="cartNum > 0" type="error" :offset="[-18, -24]" :count="cartNum"></u-badge>
 						<view class="icon ibonfont iboncart"></view>
 						<view class="text">购物车</view>
-					</view>
+					</view> -->
 					<!-- #ifdef MP-WEIXIN -->
-					<view class="box" @click="shareGoods">
+					<!-- <view class="box" @click="shareGoods">
 						<view class="icon ibonfont ibonfenxiang2"></view>
 						<view class="text">分享</view>
-					</view>
+					</view> -->
 					<!-- #endif -->
 				</view>
 <!-- 				<block v-if="goods_detail.isDistribution === 4 && goods_detail.inventorTotal <= 0">
@@ -41,7 +41,7 @@
 						<image :src="item" mode="aspectFit" @click="previewImage(index)"></image>
 					</swiper-item>
 				</swiper>
-				<view class="indicator">{{ currentSwiper + 1 }}/{{ imgList.length }}</view>
+				<!-- <view class="indicator">{{ currentSwiper + 1 }}/{{ imgList.length }}</view> -->
 			</view>
 			<!-- 标题 价格 -->
 			<view class="goods-info">
@@ -56,12 +56,12 @@
 						</view>
 						<view class="market-price">¥{{ goods_detail.ot_price }}</view>
 					</view>
-					<view class="right-view">
+					<!-- <view class="right-view">
 						<view class="goods-num">
 							<view class="num-li">
 								已售{{ goods_detail.sold }}</view>
 						</view>
-					</view>
+					</view> -->
 				</view>
 				<view class="goods-info-main">
 					<view class="clearfix top-title">
@@ -72,8 +72,8 @@
 				</view>
 			</view>
 			<!--规则选择 -->
-			<view class="info-box" style="margin-top: 0;">
-				<view class="row" v-if="goods_detail.unitData.length > 1">
+			<view class="info-box" style="margin-top: 0;" v-if="goods_detail.unitData">
+				<view class="row" v-if="goods_detail.unitData && goods_detail.unitData.length > 1">
 					<view class="text">换算</view>
 					<view class="content">
 						<block v-for="(item, index) in goods_detail.unitData" :key="index">
@@ -157,8 +157,7 @@
 								<text  class="float_right ibonfont  ibonxuanze1" style="color: #CCCCCC;" v-else></text>
 							</view>
 						</view>
-						<view class="pay-li" @click="choosPayType(2)" v-if="goods_detail.price*1 > 0">
-						<!-- <view class="pay-li" v-if="goods_detail.price*1 > 0"> -->
+						<!-- <view class="pay-li" @click="choosPayType(2)" v-if="goods_detail.price*1 > 0">
 							<text class="ibonfont ibonweixinzhifu"></text>
 							<view class="pay-name clearfix ">
 								<view class="float_left">
@@ -167,7 +166,7 @@
 								<text class="float_right ibonfont ibonxuanze1" v-if="pay_type == 2"></text>
 								<text class="float_right ibonfont ibonxuanze1" style="color: #CCCCCC;" v-else></text>
 							</view>
-						</view>
+						</view> -->
 					</view>
 					<view class="pay-btn primary-btn" @click="submit">
 						<text>确定</text>
@@ -1487,7 +1486,8 @@
 			.buy {
 				border-radius: 8upx;
 				height: 74upx;
-				width: 385rpx;
+				// width: 385rpx;
+				width: 580rpx;
 				color: #ffffff;
 				display: inline-block;
 				line-height: 74upx;