twt 7 月之前
父節點
當前提交
406b509196
共有 7 個文件被更改,包括 188 次插入97 次删除
  1. 4 2
      common/request.js
  2. 22 8
      pages/index/car.vue
  3. 1 1
      pages/index/consumption.vue
  4. 3 2
      pages/index/coupon.vue
  5. 18 9
      pages/index/custom.vue
  6. 128 71
      pages/index/index.vue
  7. 12 4
      pages/index/package.vue

+ 4 - 2
common/request.js

@@ -1,5 +1,7 @@
 //测试地址
 const baseUrl = 'http://dms.66km.com.cn/'
+//const baseUrl = 'http://192.168.0.14:20187/'
+
 //正式地址
 
 
@@ -44,7 +46,7 @@ const http = (url = '', date = {}, type = 'POST', header = {
 				 	duration: 3000
 				 });
 			} */
-			if(response.data.code!=1){
+			/* if(response.data.code!=1){
 				//console.log(res.data.msg)
 				 uni.hideLoading();
 				 //uni.clearStorageSync()
@@ -55,7 +57,7 @@ const http = (url = '', date = {}, type = 'POST', header = {
 				 });
 			}else{
 				
-			}
+			} */
 			resolve(response.data);
             
         }).catch(error => {

+ 22 - 8
pages/index/car.vue

@@ -24,7 +24,7 @@
 								
 							</view>
 						</view>
-						<view v-if="item.carDetailInfo.NextAuditTime&&item.carDetailInfo.InsuranceExpireDate">
+						<view v-if="item.carDetailInfo.NextAuditTime||item.carDetailInfo.InsuranceExpireDate">
 							<image class="carUpimg" v-if="item.show" src="../../static/img/icon_arrow_up.png" mode=""></image>
 							<image class="carUpimg" v-if="!item.show" src="../../static/img/icon_arrow_down.png" mode=""></image>
 						</view>
@@ -279,22 +279,36 @@
 				    var state= this.isDateGreater(item.carDetailInfo.NextAuditTime)
 					var day= this.daysUntilDate(item.carDetailInfo.NextAuditTime)
 					if(state){
-						txt='您的爱车'+item.PlateNumber+'车险到期时间为'+item.carDetailInfo.NextAuditTime+',还有'+day+'天即将到期,请及时续保~'
+						if(day>30){
+							txt='您的爱车'+item.PlateNumber+'年审到期时间为'+item.carDetailInfo.NextAuditTime+',还有'+day+'天到期,请及时续保~'
+						}else{
+							txt='您的爱车'+item.PlateNumber+'年审到期时间为'+item.carDetailInfo.NextAuditTime+',还有'+day+'天即将到期,请及时续保~'
+						}
+						
 					}else{
-						txt='您的爱车'+item.PlateNumber+'车险已于'+item.carDetailInfo.NextAuditTime+'为了不影响车辆使用,请及时续保~'
+						txt='您的爱车'+item.PlateNumber+'年审已于'+item.carDetailInfo.NextAuditTime+'过期,为了不影响车辆使用,请及时续保~'
 					}
 			   }
 			   if(num==2){ //保险
 			   		var state= this.isDateGreater(item.carDetailInfo.InsuranceExpireDate)
 			   		var day= this.daysUntilDate(item.carDetailInfo.InsuranceExpireDate)
 			   		if(state){
-			   			txt='您的爱车'+item.PlateNumber+'车险到期时间为'+item.carDetailInfo.InsuranceExpireDate.slice(0,10)+',还有'+day+'天即将到期,请及时续保~'
+						if(day>30){
+							txt='您的爱车'+item.PlateNumber+'车险到期时间为'+item.carDetailInfo.InsuranceExpireDate.slice(0,10)+',还有'+day+'天到期,请及时续保~'
+						}else{
+							txt='您的爱车'+item.PlateNumber+'车险到期时间为'+item.carDetailInfo.InsuranceExpireDate.slice(0,10)+',还有'+day+'天即将到期,请及时续保~'
+						}
+			   			
 			   		}else{
-			   			txt='您的爱车'+item.PlateNumber+'车险已于'+item.carDetailInfo.InsuranceExpireDate.slice(0,10)+'为了不影响车辆使用,请及时续保~'
+			   			txt='您的爱车'+item.PlateNumber+'车险已于'+item.carDetailInfo.InsuranceExpireDate.slice(0,10)+'过期,为了不影响车辆使用,请及时续保~'
 			   		}		   
 			   }
 			   console.log(txt)
-			  
+			 /* uni.showToast({
+			  	title: txt,
+			  	icon: 'none',
+			  	duration: 3000
+			   }); */
 			  
 			//console.log(this.isDateGreater(item.NextAuditTime))   
 			  // if(item.)
@@ -318,11 +332,11 @@
 			   	if (res.err_msg == 'sendChatMessage:ok') {
 			   		//发送成功
 			   	}else{
-					uni.showToast({
+					/* uni.showToast({
 						title: '发送失败',
 						icon: 'none',
 						duration: 3000
-					 });
+					 }); */
 				}
 			   })
 		   },

+ 1 - 1
pages/index/consumption.vue

@@ -16,7 +16,7 @@
 			<image src="http://dmsphoto.66km.com.cn/thFiles/3C95A4C5-73F8-4B34-902B-703B8A0825C9.png" mode="widthFix" class="nodataImg"></image>
 			<view class="noTxt">暂无数据</view>
 		</view>
-		<view class="cBox"  v-show="!nodataShow">
+		<view class="cBox"  v-show="!nodataShow&&list.length!=0">
 			<view class="line" v-for="(item,index) in list">
 				<view class="lineTop">
 					<view class="ltLeft">

+ 3 - 2
pages/index/coupon.vue

@@ -24,7 +24,7 @@
 			<image src="http://dmsphoto.66km.com.cn/thFiles/3C95A4C5-73F8-4B34-902B-703B8A0825C9.png" mode="widthFix" class="nodataImg"></image>
 			<view class="noTxt">暂无数据</view>
 		</view>
-		<view class="cBox"  v-show="!nodataShow">
+		<view class="cBox"  v-show="!nodataShow&&list.length!=0">
 			<view class="line" v-for="(item,index) in list">
 				<view class="lineTop">
 					<view class="nameBox">
@@ -56,8 +56,9 @@
 				
 				
 			</view>
+			<view style="height: 40rpx;"></view>
 		</view>
-		<view style="height: 40rpx;background: #FFFFFF;"></view>
+	
 	 
 		<view class="tkBox" v-if="couShow" @click="couHide">
 			<view class="popupBox" @click.stop="">

+ 18 - 9
pages/index/custom.vue

@@ -190,21 +190,28 @@
 				var that=this;
 				this.userId=uni.getStorageSync('userId')
 				this.corpID=uni.getStorageSync('corpID')
+				/* this.corpID='wpMGjbBgAA_zIu6wbKy48zFSbGiGeP8g'
+				this.agentId='1000051' */
 				this.$http('enterprise/wechat/extCustomerInfo', {
 				   corpID:this.corpID,
 				   extUserId:this.userId,
 				   token:this.token
 				}, 'GET').then(res => {
 					uni.hideLoading();
-				    this.customerInfo=res.data.customerInfo
-					this.customerId=this.customerInfo.id
-					uni.setStorage({
-						key: 'customerId',
-						data: that.customerId,
-						 success: function () {	 }
-					});
-					this.keyongMoney= this.customerInfo.creditMoney - this.customerInfo.stayInMoney
-					this.keyongMoney.toFixed(2)
+					if(res.code!=1){
+						this.customerInfo=''
+					}else{
+						this.customerInfo=res.data.customerInfo
+						this.customerId=this.customerInfo.id
+						uni.setStorage({
+							key: 'customerId',
+							data: that.customerId,
+							 success: function () {	 }
+						});
+						this.keyongMoney= this.customerInfo.creditMoney - this.customerInfo.stayInMoney
+						this.keyongMoney.toFixed(2)
+					}
+				   
 				})
 			},
 		  extCustomerMobile(){
@@ -214,6 +221,8 @@
 			  }); 
 			  this.userId=uni.getStorageSync('userId')
 			  this.corpID=uni.getStorageSync('corpID')
+			 /* this.corpID='wpMGjbBgAA_zIu6wbKy48zFSbGiGeP8g'
+			  this.agentId='1000051' */
 			  this.$http('enterprise/wechat/extCustomerMobile', {
 			     corpID:this.corpID,
 			     extUserId: this.userId,

+ 128 - 71
pages/index/index.vue

@@ -1,6 +1,9 @@
 <template>
 	<view class="content" style="background: #F4F5F7;">
-		<view class="indexTop">
+		<view class="qwTsBox" v-if="qwtsShow">
+			<view class="qwTsTxt">{{msg}}</view>
+		</view>
+		<view class="indexTop" v-if="userDetail">
 			<view class="top">
 				<view>
 					<image class="logo" :src="userDetail.avatar"></image>
@@ -38,11 +41,14 @@
 		<view @click="copy(token)">{{token}}</view>
 		<view>{{agentId}}</view> -->
 		<!-- <view @click="oAuth">重新授权</view> -->
-		<!-- <view style="color: red;">{{userId}}</view>
+	<!--   <view style="color: red;">{{userId}}</view>
 		<view @click="copy(userId)">复制userId</view>
 		<view>{{token}}</view>
 		<view @click="copy(token)">复制token</view> -->
 	<!-- 	<view>agentId:{{agentId}}</view> -->
+	 <!--   <view>code1:{{code1}}</view>
+		<view>code2:{{code2}}</view> 
+		<view>code3:{{code3}}</view> -->
 	</view>
 </template>
 
@@ -69,6 +75,11 @@
 				corpID:'',
 				agentId:'',
 				unionID:'',
+				qwtsShow:false,
+				code1:'',
+				code2:'',
+				code3:'',
+				msg:'',
 			}
 		},
 		onLoad() {
@@ -76,17 +87,19 @@
             this.code=uni.getStorageSync('code')
 			this.token=uni.getStorageSync('token')
 			this.corpID=uni.getStorageSync('corpID')
-			this.agentId=uni.getStorageSync('agentId')
+			 this.agentId=uni.getStorageSync('agentId')
 			/* this.corpID='wpMGjbBgAA_zIu6wbKy48zFSbGiGeP8g'
 			this.agentId='1000051'
 			this.userId='wmMGjbBgAA0JAbGD5Vu8BzEuYgZhvhOA'
+			//this.token='D226815BF1F1A11DE73489E7B8B3F7CEB2FA7AB1E002EF21F835C7D505158C7DAF945459643F62A3A6FD87751E6880BB'
+			 
 			this.token='26AF53EA2DC528681ABD7B3AC46072E96F0A964431A2453CF0F1DA1C28732A1EAF945459643F62A3A6FD87751E6880BB'
 			 */
 		     //this.userId='wmMGjbBgAALroygkoaVBN4-W2O1daIkg'
 			 //this.token='065BAA93971FEB1A37A08D682FCDB41CC69E76FC36BB038790FB99C5CD71C28EAF945459643F62A3A6FD87751E6880BB'
 		    //this.userId='wmMGjbBgAAeKTdCmEN0CLKPNwJ4ACTxw'
 			//this.token='0A809B6077F4044EDECFC49762B59668E9508B2CA4C6C4791C8894B2B1A7338AAF945459643F62A3A6FD87751E6880BB'
-			/* uni.setStorage({
+			/*  uni.setStorage({
 				key: 'token',
 				data: that.token,
 				 success: function () {	
@@ -140,72 +153,86 @@
 			},
 			extCustomerInfo(){
 				var that=this;
+				/* uni.showModal({
+					title: '提示',
+					content: 'extCustomerInfo',
+					success: function (res) {
+						if (res.confirm) {
+							console.log('用户点击确定');
+						} else if (res.cancel) {
+							console.log('用户点击取消');
+						}
+					}
+				}); */
 				this.$http('enterprise/wechat/extCustomerInfo', {
 				   //corpID:'wpMGjbBgAA_zIu6wbKy48zFSbGiGeP8g',
 				   corpID:that.corpID,
 				  // extUserId:'wmMGjbBgAA0JAbGD5Vu8BzEuYgZhvhOA',
-				    extUserId:this.userId,
+				   extUserId:this.userId,
 				   token:this.token
 				}, 'GET').then(res => {
 					console.log(res.code)
-					 uni.hideLoading();
+					this.code2=res.code
+					uni.hideLoading();
 					if(res.code!=1){
-						uni.showModal({
-							title: '提示',
-							content: res.msg,
-							success: function (res) {
-								if (res.confirm) {
-									console.log('用户点击确定');
-								} else if (res.cancel) {
-									console.log('用户点击取消');
-								}
-							}
-						});
-
 						
 						 //uni.clearStorageSync()
-						 uni.showToast({
-						 	title: res.msg,
-						 	icon: 'none',
-						 	duration: 3000
-						 });
-					}
-				    this.customerInfo=res.data.customerInfo
-					uni.setStorage({
-						key: 'integral',
-						data: that.customerInfo.integral,
-						 success: function () {	 }
-					});
-					uni.setStorage({
-						key: 'levelName',
-						data: that.customerInfo.levelName,
-						 success: function () {	 }
-					});
-					var map=res.data.map
-					var arr=[]
-					if(map.length){
-						map.forEach(item=>{
-							arr.push(item.PlateNumber)
-						})
+						 if(res.code == 401){
+							 this.qwtsShow=true
+							 this.msg=res.msg
+						 }else{
+							 uni.showToast({
+							 	title: res.msg,
+							 	icon: 'none',
+							 	duration: 3000
+							 }); 
+						 }
+						
+					}else{
+						this.customerInfo=res.data.customerInfo
+						uni.setStorage({
+							key: 'integral',
+							data: that.customerInfo.integral,
+							 success: function () {	 }
+						});
+						uni.setStorage({
+							key: 'levelName',
+							data: that.customerInfo.levelName,
+							 success: function () {	 }
+						});
+						var map=res.data.map
+						var arr=[]
+						if(map.length){
+							map.forEach(item=>{
+								arr.push(item.PlateNumber)
+							})
+						}
+						uni.setStorage({
+							key: 'PlateNumberArr',
+							data: arr,
+							 success: function () {	 }
+						});
 					}
-					uni.setStorage({
-						key: 'PlateNumberArr',
-						data: arr,
-						 success: function () {	 }
-					});
+				
 					
 					
 				})
 			},
 			extUserDetail(){
 				var that=this;
-				
+				console.log("extUserDetail")
 				this.$http('enterpriseWechat/auth/extUserDetail', {
 				   corpID:that.corpID,
 				  // extUserId:'wmMGjbBgAA0JAbGD5Vu8BzEuYgZhvhOA'
 				  extUserId:this.userId
 				}, 'GET').then(res => {
+					console.log("extUserDetailRES"+res.code)
 					uni.hideLoading();
+					this.code1=res.code
+					if(res.code == 401){
+						 this.qwtsShow=true
+						  this.msg=res.msg
+					}
 					this.userDetail=res.data
 					this.$refs.customView.getdata()
 				})
@@ -239,12 +266,23 @@
 				   corpID:that.corpID,
 				   code: this.code
 				}, 'GET').then(res => {
+					this.code3=res.code
 					if(res.code!=1){
-						 uni.showToast({
-						 	title: res.msg,
-						 	icon: 'none',
-						 	duration: 3000
-						 });
+						uni.hideLoading();
+						 if(res.code == 401){
+						 	this.qwtsShow=true
+							 this.msg=res.msg
+						 }else if(res.code == 0){
+						 	this.qwtsShow=true
+							 this.msg=res.msg
+						 }else{
+							 uni.showToast({
+								title: res.msg,
+								//title: res.code,
+								icon: 'none',
+								duration: 3000
+							 }); 
+						 }
 					}else{
 						this.token=res.data.token
 						uni.setStorage({
@@ -262,25 +300,14 @@
 				})
 			},
 			init(){
-				/* if(this.$wx.agentConfig){
-						uni.showToast({
-							title: 'agentConfig',
-							icon: 'none',
-							duration: 3000
-						});			   
-				}else{
-					   uni.showToast({
-						title: 'agentConfig失败',
-						icon: 'none',
-						duration: 3000
-					   });
-				} */
+				
 				var that=this
+				
 				this.$http('enterpriseWechat/auth/getAgentConfig', {
 				   corpID:that.corpID,
 				   url:'http://qw.66km.com.cn/'
 				}, 'GET').then(res => {
-					console.log(11)
+					
 					that.$wx.agentConfig({
 					    corpid:that.corpID,// 必填,企业微信的corpid,必须与当前登录的企业一致
 					    agentid:that.agentId, // 必填,企业微信的应用id (e.g. 1000247)
@@ -290,11 +317,7 @@
 					    jsApiList: ['getCurExternalContact','getContext','sendChatMessage'], //必填,传入需要使用的接口名称
 					    success: function(res) {
 						   console.log(res)
-						  /* uni.showToast({
-							title: 'agentConfig成功',
-							icon: 'none',
-							duration: 3000
-						   }); */
+						 
 						// 回调
 						   that.getContext()
 					    },
@@ -332,6 +355,13 @@
 			},
 			getCurExternalContact(){
 				var that=this;
+				/* uni.showModal({
+					title: '提示',
+					content: 'getCurExternalContact',
+					success: function (res) {
+						
+					}
+				}); */
 			   this.$wx.invoke('getCurExternalContact', {
 					   }, function(res){
 					   if(res.err_msg == "getCurExternalContact:ok"){
@@ -384,6 +414,13 @@
 			     });
 		   }
 		},
+		 onBackPress (options) {
+		    if (options.from === "backbutton") {
+		      return true
+		    } else {
+		      return false
+		    }
+		  },
 		onReachBottom() {
 			
 		},
@@ -465,4 +502,24 @@
 	.tabline{
 		padding-bottom: 8rpx;
 	}
+	.qwTsBox{
+		width: 100%;
+		height: 100%;
+		background: rgba(0, 0, 0, 0.5);
+		position: fixed;
+		top: 0;
+		left: 0;
+		z-index: 111;
+	}
+	.qwTsTxt{
+		color: #333;
+		text-align: center;
+		margin-top: 40vh;
+		background: #fff;
+		width: 60vw;
+		border-radius: 10rpx;
+		margin-left: calc(20vw - 30rpx);
+		font-size: 30rpx;
+		padding: 30rpx;
+	}
 </style>

+ 12 - 4
pages/index/package.vue

@@ -1,10 +1,17 @@
 <template>
 	<view class="content">
-		<view  class="nodataBox" v-show="nodataShow||czList.length==0">
+		<view v-if="nodataShow" class="nodataBox">
 			<image src="http://dmsphoto.66km.com.cn/thFiles/3C95A4C5-73F8-4B34-902B-703B8A0825C9.png" mode="widthFix" class="nodataImg"></image>
 			<view class="noTxt">暂无数据</view>
 		</view>
-	<view class="box" v-show="!nodataShow">
+		<view  v-else>
+			<view  class="nodataBox" v-show="czList.length==0&&jcList.length==0">
+				<image src="http://dmsphoto.66km.com.cn/thFiles/3C95A4C5-73F8-4B34-902B-703B8A0825C9.png" mode="widthFix" class="nodataImg"></image>
+				<view class="noTxt">暂无数据</view>
+			</view>
+		</view>
+		
+	<view class="box" v-show="!nodataShow&&czList.length!=0&&jcList.length!=0">
 		<view class="line" v-for="(item,index) in czList">
 				 <view class="lineNameBox">
 					 <view class="lnameLeft">
@@ -50,8 +57,9 @@
 					
 				 </view>
 		</view>
+		<view style="height: 40rpx;"></view>
 	</view>
-	 <view style="height: 40rpx;background: #FFFFFF;"></view>
+	 
 	 
 	 
 	 <uni-popup ref="popup" type="bottom" >
@@ -153,7 +161,7 @@
 				  this.$http('enterprise/wechat/listCardTimesInfo', {
 				    id:this.customerId,
 				  }, 'GET').then(res => {
-				     this.jcList=res.data
+				    this.jcList=res.data
 				  	
 				  })
 			  }