twt 8 months ago
parent
commit
3f628b8a0a
10 changed files with 850 additions and 250 deletions
  1. 33 4
      common/request.js
  2. 6 0
      pages.json
  3. 30 16
      pages/index/auto.vue
  4. 200 0
      pages/index/auto2.vue
  5. 218 131
      pages/index/car.vue
  6. 74 14
      pages/index/consumption.vue
  7. 50 18
      pages/index/coupon.vue
  8. 49 27
      pages/index/custom.vue
  9. 113 21
      pages/index/index.vue
  10. 77 19
      pages/index/package.vue

+ 33 - 4
common/request.js

@@ -10,7 +10,12 @@ const http = (url = '', date = {}, type = 'POST', header = {
 		header={};
 		var token=uni.getStorageSync('token')
 		header['token']=token;
-		header['Content-Type']='application/json;charset=utf-8';
+		if(url=='enterprise/wechat/extCustomerMobile'){
+			header['Content-Type']='application/x-www-form-urlencoded';
+		}else{
+			header['Content-Type']='application/json;charset=utf-8';
+		}
+	
         uni.request({
             method: type,
             url: baseUrl + url,
@@ -18,9 +23,10 @@ const http = (url = '', date = {}, type = 'POST', header = {
             header: header,
             dataType: 'json',         
         }).then((response) => {
-           // console.log(response)
+           // console.log(response.data.code)
+			//console.log(response.data.data.code)
             //let [error, res] = response;
-		    //console.log(res)
+		   // console.log(res)
 			/* if(res.data.code==401||res.data.code==403){
 			
 				 uni.clearStorageSync()
@@ -28,7 +34,30 @@ const http = (url = '', date = {}, type = 'POST', header = {
 			}else if(res.data.code==409){
 				 // getToken(url,date,type,header)
 			} */
-            resolve(response.data);
+			/* if(response.data.data.code!=1){
+				console.log(res.data.data.msg)
+				uni.hideLoading();
+				 uni.clearStorageSync()
+				 uni.showToast({
+				 	title: res.data.data.msg,
+				 	icon: 'none',
+				 	duration: 3000
+				 });
+			} */
+			if(response.data.code!=1){
+				//console.log(res.data.msg)
+				 uni.hideLoading();
+				 //uni.clearStorageSync()
+				 uni.showToast({
+				 	title: response.data.msg,
+				 	icon: 'none',
+				 	duration: 3000
+				 });
+			}else{
+				
+			}
+			resolve(response.data);
+            
         }).catch(error => {
             let [err, res] = error;
             reject(err)

+ 6 - 0
pages.json

@@ -11,6 +11,12 @@
 			"style": {
 				"navigationStyle": "custom"
 			}
+		},
+		{
+			"path": "pages/index/auto2",
+			"style": {
+				"navigationStyle": "custom"
+			}
 		}
 	],
 	"globalStyle": {

+ 30 - 16
pages/index/auto.vue

@@ -1,6 +1,8 @@
 <template>
 	<view class="content">
-		<view>11{{code}}</view>
+	<!-- 	<view>11{{code}}</view> -->
+<!-- 	<view>{{agentId}}</view>
+	<view>{{code}}</view> -->
 	</view>
 </template>
 
@@ -14,30 +16,52 @@
 		data() {
 			return {
 			 code:'',
+			 corpID:'',
+			 agentId:'',
 			}
 		},
 		onLoad(opt) {
 		  console.log(opt)
+		  this.agentId=opt.agentid
+		  this.corpID=opt.appid
+		  uni.showLoading({
+		   	title: '加载中'
+		  }); 
             //const token = uni.getStorageSync('token');
 		  // this.init()
 		// this.code= this.$common.getHashQuery('code')
 		  // this.code=uni.getStorageSync('code')
 		  if(opt.code){
+			   uni.hideLoading();
 			  this.code=opt.code
 			  uni.setStorage({
 			  	key: 'code',
 			  	data: opt.code,
 			  	 success: function () {	
-					 uni.navigateTo({
+					uni.navigateTo({
 					 	url:'index'
-					 })
+					 }) 
+			  	 }
+			  });
+			  uni.setStorage({
+			  	key: 'corpID',
+			  	data: 'wpMGjbBgAA_zIu6wbKy48zFSbGiGeP8g',
+			  	 success: function () {	
+			  					
+			  	 }
+			  });
+			  uni.setStorage({
+			  	key: 'agentId',
+			  	data: '1000051',
+			  	 success: function () {	
+			  					
 			  	 }
 			  });
 		  }else{
 			  this.$http('enterpriseWechat/auth/oAuth2', {
 			       corpID:'wpMGjbBgAA_zIu6wbKy48zFSbGiGeP8g',
-			  	  redirectUri:'http://qw.66km.com.cn/pages/index/auto',
-			  	  agentId:'1000040'
+			  	   redirectUri:'http://qw.66km.com.cn/pages/index/auto',
+			  	   agentId:'1000051'
 			  }, 'GET').then(res => {
 			  	//console.log(res.data)
 			  	 location.href=  res.data
@@ -55,16 +79,6 @@
 			    uni.showLoading({
 			     	title: '加载中'
 			    }); 
-			   /* this.$http('enterpriseWechat/auth/oAuth2', {
-			     corpID:'wpMGjbBgAA_zIu6wbKy48zFSbGiGeP8g',
-			   	 redirectUri:'http://qw.66km.com.cn/#/',
-				 agentId:'1000036'
-			   }, 'GET').then(res => {
-			   	   uni.hideLoading();
-			   	   console.log(res.data)
-			   }).catch(err=>{
-			   		uni.hideLoading();
-			   }) */
 			  
 			   this.$http('enterpriseWechat/auth/getAgentConfig', {
 			     corpID:'wpMGjbBgAA_zIu6wbKy48zFSbGiGeP8g',
@@ -74,7 +88,7 @@
 				   //console.log(this.$wx.agentConfig)
 				   this.$wx.agentConfig({
 				       corpid: 'wpMGjbBgAA_zIu6wbKy48zFSbGiGeP8g', // 必填,企业微信的corpid,必须与当前登录的企业一致
-				       agentid: '1000040', // 必填,企业微信的应用id (e.g. 1000247)
+				       agentid: '1000051', // 必填,企业微信的应用id (e.g. 1000247)
 				       timestamp: res.data.timestamp, // 必填,生成签名的时间戳
 				       nonceStr: res.data.nonceStr, // 必填,生成签名的随机串
 				       signature: res.data.signature,// 必填,签名,见附录-JS-SDK使用权限签名算法

+ 200 - 0
pages/index/auto2.vue

@@ -0,0 +1,200 @@
+<template>
+	<view class="content">
+	<!-- 	<view>11{{code}}</view> -->
+	<view>{{agentId}}</view>
+	<view>{{code}}</view>
+	<view @click="copy(code)">复制code</view>
+	<view style="color: red;">{{userId}}</view>
+	<view @click="copy(userId)">复制userId</view>
+	</view>
+</template>
+
+<script>
+
+	export default {
+		components: {
+		
+		},
+		
+		data() {
+			return {
+			 code:'',
+			 corpID:'',
+			 agentId:'',
+			}
+		},
+		onLoad(opt) {
+		  console.log(opt)
+		  this.agentId=opt.agentid
+		  this.corpID=opt.appid
+		  uni.showLoading({
+		   	title: '加载中'
+		  }); 
+            //const token = uni.getStorageSync('token');
+		  // this.init()
+		// this.code= this.$common.getHashQuery('code')
+		  // this.code=uni.getStorageSync('code')
+		  if(opt.code){
+			   uni.hideLoading();
+			  this.code=opt.code
+			  uni.setStorage({
+			  	key: 'code',
+			  	data: opt.code,
+			  	 success: function () {	
+					/* uni.navigateTo({
+					 	url:'index'
+					 }) */
+			  	 }
+			  });
+			  uni.setStorage({
+			  	key: 'corpID',
+			  	data: 'wpMGjbBgAA_zIu6wbKy48zFSbGiGeP8g',
+			  	 success: function () {	
+			  					
+			  	 }
+			  });
+			  uni.setStorage({
+			  	key: 'agentId',
+			  	data: '1000051',
+			  	 success: function () {	
+			  					
+			  	 }
+			  });
+		  }else{
+			  this.$http('enterpriseWechat/auth/oAuth2', {
+			       corpID:'wpMGjbBgAA_zIu6wbKy48zFSbGiGeP8g',
+			  	   redirectUri:'http://qw.66km.com.cn/pages/index/auto',
+			  	   agentId:'1000051'
+			  }, 'GET').then(res => {
+			  	//console.log(res.data)
+			  	 location.href=  res.data
+			  	
+			  }).catch(err=>{
+			  		
+			  })
+		  }
+		   
+		},
+		methods: {
+			copy(e){
+				uni.setClipboardData({
+				   data: e,
+				   success: function () {
+				  
+					 uni.showToast({
+					   title: '复制成功',
+					   icon: 'success',
+					   duration: 2000
+					 });
+				   },
+				   fail: function () {
+					 console.log('复制失败');
+					
+				   }
+				 });
+			},
+		   init(){
+			    this.code=uni.getStorageSync('code')
+				
+			    uni.showLoading({
+			     	title: '加载中'
+			    }); 
+			  
+			   this.$http('enterpriseWechat/auth/getAgentConfig', {
+			     corpID:'wpMGjbBgAA_zIu6wbKy48zFSbGiGeP8g',
+				 url:'http://qw.66km.com.cn/'
+			   }, 'GET').then(res => {
+			   	   uni.hideLoading();
+				   //console.log(this.$wx.agentConfig)
+				   this.$wx.agentConfig({
+				       corpid: 'wpMGjbBgAA_zIu6wbKy48zFSbGiGeP8g', // 必填,企业微信的corpid,必须与当前登录的企业一致
+				       agentid: '1000051', // 必填,企业微信的应用id (e.g. 1000247)
+				       timestamp: res.data.timestamp, // 必填,生成签名的时间戳
+				       nonceStr: res.data.nonceStr, // 必填,生成签名的随机串
+				       signature: res.data.signature,// 必填,签名,见附录-JS-SDK使用权限签名算法
+				       jsApiList: ['getCurExternalContact'], //必填,传入需要使用的接口名称
+				       success: function(res) {
+						   console.log(res)
+						   uni.showToast({
+						   	title: 'agentConfig成功',
+						   	icon: 'none',
+						   	duration: 3000
+						   });
+				           // 回调
+				       },
+				       fail: function(res) {
+						   console.log(res)
+						   uni.showToast({
+						   	title: 'agentConfig失败',
+						   	icon: 'none',
+						   	duration: 3000
+						   });
+				           if(res.errMsg.indexOf('function not exist') > -1){
+				               alert('版本过低请升级')
+				           }
+				       }
+				   });
+			   	
+			   }).catch(err=>{
+				    uni.hideLoading();
+			   })
+		   },
+           tabFn(num){
+			   this.tabIndex=num
+		   }
+		}
+	}
+</script>
+
+<style scoped>
+	.top{
+		background: #fff;
+	}
+	.top{
+		display: flex;
+		padding: 30rpx 24rpx;
+	}
+	.logo{
+		width: 98rpx;height: 98rpx;
+	}
+	.topRight{
+		padding-left: 20rpx;
+	}
+	.wxName{
+		font-weight: 500;
+		font-size: 32rpx;
+		color: #333333;
+		line-height: 45rpx;
+	}
+	.titleBox{
+		display: flex;
+		padding-top: 10rpx;
+	}
+	.title{
+		height: 36rpx;
+		border-radius: 4rpx;
+		border: 1px solid #FF8113;
+		line-height: 34rpx;
+		font-size: 24rpx;
+		color: #FF8113;
+		padding: 0 8rpx;
+		margin-right: 10rpx;
+		
+	}
+	.tabBox{
+		display: flex;justify-content: space-between;
+		background: #fff;
+		margin-top: 16rpx;
+		padding: 30rpx 24rpx;
+		font-size: 30rpx;
+		color: #333333;
+		line-height: 42rpx;
+	}
+	.tabActive{
+		color: #FF8113;font-weight: 500;
+		border-bottom: 2px solid #FF8113;
+	}
+	.tabline{
+		padding-bottom: 8rpx;
+	}
+</style>

+ 218 - 131
pages/index/car.vue

@@ -1,190 +1,262 @@
 <template>
 	<view class="content">
-		<view class="carTop">
-			<view class="carCont">
-				<view class="carModel">
-					<image src="../../static/logo.png" mode="" class="carLogo"></image>
-					<view class="carModelCont">
-						<view class="carMcTop">
-							<view class="plateNumber">鲁A12345</view>
-							<view class="carTime">9年4个月</view>
-							<view class="carA">A类车</view>
-						</view>
-						<view class="carMcTxt">2021款 1.2T 无极S-CVT 精英PLUS版 过精英PLUS版精英PLUS版长长...</view>
-					    <view class="carTitleBox">
-							<view class="carTitle">潜在车辆</view>
-							<view class="carTitle">矩形</view>
-						</view>
-					</view>
-					<view>
-						<image class="carUpimg" src="../../static/img/icon_arrow_up.png" mode=""></image>
-					</view>
-				</view>
-				<view class="carData">
-					<view class="carDataLine">最新里程:29301km</view>
-					<view class="carDataLine">累计消费:2930.00</view>
-					
-				</view>
-				<view class="carnotes">车辆备注:这是备注信息</view>
-			</view>
+		<view  class="nodataBox" v-show="nodataShow">
+			<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">
-			<view class="line">
-				<view class="lineTop">
-					<view class="lineTop1">
-						<view class="lineTopNs">
-							<view class="nsTxt">年审日期</view>
-							<view class="nsStatus">已过期</view>
+		<view class="carLine" v-for="(item,index ) in carList" @click="extCarInfo(item)">
+			<view class="carTop" >
+				<view class="carCont">
+					<view class="carModel">
+						<image :src="item.BrandLogo" mode="" class="carLogo"></image>
+						<view class="carModelCont">
+							<view class="carMcTop">
+								<view class="plateNumber">{{item.PlateNumber}}</view>
+								<view class="carTime">9年4个月</view>
+								<view class="carA">{{item.carType}}</view>
+							</view>
+							<view class="carMcTxt">{{item.CarModel}}</view>
+						    <view class="carTitleBox" v-if="item.carDetailInfo.labelName">
+								<view class="carTitle" v-for="(v,i) in item.carDetailInfo.labelName.split(',')">{{v}}</view>
+								
+							</view>
 						</view>
-						<view class="lineTimeBox">
-							<span>2019-01-21</span>
+						<view>
 							<image class="carUpimg" src="../../static/img/icon_arrow_up.png" mode=""></image>
 						</view>
 					</view>
-					<view class="lineTop2">
-						<view class="chaoqi">超期天数:10</view>
-						<view class="lineBtn">发送提醒</view>
+					<view class="carData">
+						<view class="carDataLine">最新里程:{{item.Milage}}km</view>
+						<view class="carDataLine">累计消费:2930.00</view>
+						
 					</view>
+					<view class="carnotes">车辆备注:{{item.carDetailInfo.Comment}}</view>
 				</view>
-				<view class="lineCont">
-					<view class="lcLine">
+			</view>
+			
+			<view class="box">
+				<view class="line">
+					<view class="lineTop">
 						<view class="lineTop1">
 							<view class="lineTopNs">
-								<view class="nsTxt">保险提醒</view>
-								<view class="nsStatus">即将到期</view>
+								<view class="nsTxt">年审日期</view>
+								<view class="nsStatus" v-if="!isDateGreater(item.carDetailInfo.NextAuditTime)">
+								  <span v-if="daysUntilDate(item.carDetailInfo.NextAuditTime)>30">已过期</span>
+								  <span v-else>即将过期</span>
+								</view>
 							</view>
 							<view class="lineTimeBox">
-								<span>2019-01-21</span>
+								<span>{{item.carDetailInfo.NextAuditTime}}</span>
 								<image class="carUpimg" src="../../static/img/icon_arrow_up.png" mode=""></image>
 							</view>
 						</view>
-						<view class="carData">
-							<view class="carDataLine">交强险到期:2011-02-12</view>
-							<view class="carDataLine">商业险到期:2011-02-12</view>
-						</view>
-						<view class="carnotes">保险公司:这是保险公司名</view>
 						<view class="lineTop2">
-							<view class="chaoqi">距离天数:10</view>
+							<view class="chaoqi">
+								<span v-if="!isDateGreater(item.carDetailInfo.NextAuditTime)">超期天数:{{daysUntilDate(item.carDetailInfo.NextAuditTime)}}天</span>
+								
+								</view>
 							<view class="lineBtn">发送提醒</view>
 						</view>
 					</view>
-					
-				</view>
-			</view>
-			
-			<!-- 提醒商机 -->
-			<view class="line">
-				<view class="lineTop">
-					<view class="lineTop1">
-						<view class="lineTopNs">
-							<view class="nsTxt">提醒商机</view>
-							
-						</view>
-						<view class="lineTimeBox">
-							<span style="color: #FF0000;">2条</span>
-							<image class="carUpimg" src="../../static/img/icon_arrow_up.png" mode=""></image>
+					<view class="lineCont">
+						<view class="lcLine">
+							<view class="lineTop1">
+								<view class="lineTopNs">
+									<view class="nsTxt">保险提醒</view>
+									<view class="nsStatus"  v-if="!isDateGreater(item.carDetailInfo.InsuranceExpireDate)">
+										<span v-if="daysUntilDate(item.carDetailInfo.InsuranceExpireDate)>30">已过期</span>
+										<span v-else>即将过期</span>
+									</view>
+								</view>
+								<view class="lineTimeBox" v-if="item.carDetailInfo.InsuranceExpireDate">
+									<span>{{item.carDetailInfo.InsuranceExpireDate.slice(0,10)}}</span>
+									<image class="carUpimg" src="../../static/img/icon_arrow_up.png" mode=""></image>
+								</view>
+							</view>
+							<view class="carData">
+								<view class="carDataLine">交强险到期:{{item.carDetailInfo.CompulsoryInsuranceTime}}</view>
+								<view class="carDataLine">商业险到期:{{item.carDetailInfo.CommercialInsuranceTime}}</view>
+							</view>
+							<view class="carnotes">保险公司:{{item.carDetailInfo.inscName}}</view>
+							<view class="lineTop2">
+								<view class="chaoqi">距离天数:{{daysUntilDate(item.carDetailInfo.InsuranceExpireDate)}}天</view>
+								<view class="lineBtn">发送提醒</view>
+							</view>
 						</view>
+						
 					</view>
-				
 				</view>
-				<view class="lineCont">
-					<view class="lcLine">
+				
+				<!-- 提醒商机 -->
+				<view class="line" v-if="false">
+					<view class="lineTop">
 						<view class="lineTop1">
 							<view class="lineTopNs">
-								<view class="nsTxt">提醒类别:机油滤清器</view>
+								<view class="nsTxt">提醒商机</view>
+								
 							</view>
-						</view>
-						<view class="carData">
-							<view class="carDataLine">下次服务日期:2024-02-12</view>
-							<view class="carDataLine">下次服务里程:93843km</view>
-						</view>
-						<view class="carnotes">上次到店:2022-01-21</view>
-						<view class="lineTop2">
-							<view class="chaoqi">超期天数:10</view>
-							<view class="lineBtn">发送提醒</view>
-						</view>
-					</view>
-					<view class="lcLine">
-						<view class="lineTop1">
-							<view class="lineTopNs">
-								<view class="nsTxt">保养提醒</view>
+							<view class="lineTimeBox">
+								<span style="color: #FF0000;">2条</span>
+								<image class="carUpimg" src="../../static/img/icon_arrow_up.png" mode=""></image>
 							</view>
 						</view>
-						<view class="carData">
-							<view class="carDataLine">下次服务日期:2024-02-12</view>
-							<view class="carDataLine">下次服务里程:93843km</view>
-						</view>
-						<view class="carnotes">上次到店:2022-01-21</view>
-						<view class="lineTop2">
-							<view class="chaoqi">超期天数:10</view>
-							<view class="lineBtn">发送提醒</view>
-						</view>
-					</view>
 					
-				</view>
-			</view>
-			<!-- 提醒商机 -->
-			<!-- 检测异常商机 -->
-			<view class="line">
-				<view class="lineTop">
-					<view class="lineTop1">
-						<view class="lineTopNs">
-							<view class="nsTxt">检测异常商机</view>
-							
+					</view>
+					<view class="lineCont">
+						<view class="lcLine">
+							<view class="lineTop1">
+								<view class="lineTopNs">
+									<view class="nsTxt">提醒类别:机油滤清器</view>
+								</view>
+							</view>
+							<view class="carData">
+								<view class="carDataLine">下次服务日期:2024-02-12</view>
+								<view class="carDataLine">下次服务里程:93843km</view>
+							</view>
+							<view class="carnotes">上次到店:2022-01-21</view>
+							<view class="lineTop2">
+								<view class="chaoqi">超期天数:</view>
+								<view class="lineBtn">发送提醒</view>
+							</view>
 						</view>
-						<view class="lineTimeBox">
-							<span style="color: #FF0000;">2条</span>
-							<image class="carUpimg" src="../../static/img/icon_arrow_up.png" mode=""></image>
+						<view class="lcLine">
+							<view class="lineTop1">
+								<view class="lineTopNs">
+									<view class="nsTxt">保养提醒</view>
+								</view>
+							</view>
+							<view class="carData">
+								<view class="carDataLine">下次服务日期:2024-02-12</view>
+								<view class="carDataLine">下次服务里程:93843km</view>
+							</view>
+							<view class="carnotes">上次到店:2022-01-21</view>
+							<view class="lineTop2">
+								<view class="chaoqi">超期天数:10</view>
+								<view class="lineBtn">发送提醒</view>
+							</view>
 						</view>
+						
 					</view>
-				
 				</view>
-				<view class="lineCont">
-					<view class="lcLine">
+				<!-- 提醒商机 -->
+				<!-- 检测异常商机 -->
+				<view class="line" v-if="false">
+					<view class="lineTop">
 						<view class="lineTop1">
 							<view class="lineTopNs">
 								<view class="nsTxt">检测异常商机</view>
+								
+							</view>
+							<view class="lineTimeBox">
+								<span style="color: #FF0000;">2条</span>
+								<image class="carUpimg" src="../../static/img/icon_arrow_up.png" mode=""></image>
 							</view>
 						</view>
-						
-						<view class="carData">
-							<view class="carDataLine">下次服务日期:2024-02-12</view>
-							<view class="carDataLine" style="color: #FF0000;">距离天数:10</view>
-						</view>
-						<view class="carnotes">检测结果:长了换行1</view>
-						<view class="carData" style="padding-top: 16rpx;">
-							<view class="carDataLine">检测日期:2024-02-12</view>
-							<view class="carDataLine" >检测里程:9383km</view>
-						</view>
-						<view class="carnotes">检测门店:这是门店名称长了换行展示1</view>
-						<view class="lineTop2">
-							<view class="chaoqi"></view>
-							<view class="lineBtn">发送提醒</view>
-						</view>
+					
 					</view>
-				
+					<view class="lineCont">
+						<view class="lcLine">
+							<view class="lineTop1">
+								<view class="lineTopNs">
+									<view class="nsTxt">检测异常商机</view>
+								</view>
+							</view>
+							
+							<view class="carData">
+								<view class="carDataLine">下次服务日期:2024-02-12</view>
+								<view class="carDataLine" style="color: #FF0000;">距离天数:10</view>
+							</view>
+							<view class="carnotes">检测结果:长了换行1</view>
+							<view class="carData" style="padding-top: 16rpx;">
+								<view class="carDataLine">检测日期:2024-02-12</view>
+								<view class="carDataLine" >检测里程:9383km</view>
+							</view>
+							<view class="carnotes">检测门店:这是门店名称长了换行展示1</view>
+							<view class="lineTop2">
+								<view class="chaoqi"></view>
+								<view class="lineBtn">发送提醒</view>
+							</view>
+						</view>
 					
+						
+					</view>
 				</view>
+				<!-- 检测异常商机 -->
 			</view>
-			<!-- 检测异常商机 -->
+			
 		</view>
+	
+		
+	
 		
 	</view>
 </template>
 
 <script>
 	export default {
+		props:['token'],
 		data() {
 			return {
-				
+				carList:[],
+				carInfo:'',
+				nodataShow:false
 			}
 		},
 		onLoad() {
 
 		},
+		computed: {
+		    // 计算属性来判断日期是否大于当前日期
+		    isDateGreater() {
+				 return (val)=>{
+					 const currentDate = new Date();
+					 const compareDate = new Date(val);
+					 			
+					 return compareDate > currentDate;
+				 }
+		     
+		    },
+			daysUntilDate() {
+				 return (val)=>{
+				      const today = new Date();
+				      const specificDate = new Date(val);
+					  
+				      const diffTime = Math.abs(today - specificDate);
+					  var time=diffTime / (1000 * 60 * 60 * 24);
+				      return parseInt(time);
+				}
+				 
+			}
+		  },
 		methods: {
-          
+           getdata(){
+			   this.extCarInfo()
+			  /* var that=this;
+			   	this.$http('enterprise/wechat/extCustomerInfo', {
+			   	   corpID:'wpMGjbBgAA_zIu6wbKy48zFSbGiGeP8g',
+			   	   extUserId:'wmMGjbBgAA0JAbGD5Vu8BzEuYgZhvhOA',
+			   	   token:this.token
+			   	}, 'GET').then(res => {
+			   	    this.carList=res.data.data.map
+			   	}) */
+			   
+		   },
+		   extCarInfo(item){
+			   var that=this;
+			    this.customerId=uni.getStorageSync('customerId')
+				if(!this.customerId){
+					this.nodataShow=true
+				}else{
+					this.$http('enterprise/wechat/extCarInfo', {
+					   id:this.customerId,
+					  
+					   //token:this.token
+					}, 'GET').then(res => {
+					    this.carList=res.data
+					})
+				}
+			   
+		   }
 		}
 	}
 </script>
@@ -215,7 +287,7 @@
 		padding-left: 24rpx;
 	}
 	.carModelCont{
-		width: 560rpx;
+		width: 540rpx;
 		padding-left: 12rpx;
 	}
 	.carMcTop{
@@ -363,4 +435,19 @@ color: #FF0000;
 	.lcLine .carnotes{
 		padding-left: 0;padding-right: 0;
 	}
+	.nodataImg{
+	  width: 400rpx;
+	  padding-top: 100rpx;
+	}
+	.noTxt{
+		font-size: 32rpx;
+		color: #999999;
+		padding-top: 50rpx;
+	}
+	.nodataBox{
+		text-align: center;
+	}
+	.carLine{
+		margin-bottom: 20rpx;
+	}
 </style>

+ 74 - 14
pages/index/consumption.vue

@@ -2,33 +2,43 @@
 	<view class="content">
 		<view class="topbox">
 			<view class="top">
-				<span>全部车辆</span>
-				<image class="carUpimg" src="../../static/img/icon_arrow_down.png" mode=""></image>
+				<picker @change="bindPickerChange" :value="index" :range="array">
+					<view class="screenName"> <span>车牌号:{{array[index]}}</span> 
+					  <image src="../../static/img/icon_arrow_down.png" mode="" class="carUpimg"></image>
+					</view>
+				</picker>
+				<!-- <span>全部车辆</span>
+				<image class="carUpimg" src="../../static/img/icon_arrow_down.png" mode=""></image> -->
 			</view>
 		</view>
-		<view class="cBox">
-			<view class="line">
+		<view  class="nodataBox" v-show="nodataShow">
+			<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="line" v-for="(item,index) in list">
 				<view class="lineTop">
 					<view class="ltLeft">
-						<view class="cp">鲁A12345</view>
-						<view class="km">1000km</view>
+						<view class="cp">{{item.PlateNumber}}</view>
+						<view class="km" v-if="item.CurrentMileage">{{item.CurrentMileage}}km</view>
 					</view>
 					<view class="ltRgiht">
-						<span class="span1">¥759.00</span>
+						<span class="span1">¥{{item.ReceiptMoney}}</span>
 					</view>
 					
 				</view>
 				<view class="lineCont">
-					<view class="lineLine1">消费门店:店名一</view>
+					<view class="lineLine1">消费门店:{{item.ShopName}}</view>
 					<view class="line2">
-						<view>日期:2019-09-12</view>
-						<view>接待人员:王二</view>
+						<view>日期:{{item.PickTime}}</view>
+						<view>接待人员:{{item.PickName}}</view>
 					</view>
 					<view class="line2">
-						<view>车牌号:鲁A12345</view>
-						<view style="color: #00A040;">已结算</view>
+						<view>车牌号:{{item.PlateNumber}}</view>
+						<view style="color: #999999;" v-if="item.PayState == 0">未结算</view>
+						<view style="color: #00A040;" v-if="item.PayState == 2">已结算</view>
 					</view>
-					<view class="lineLine1">备注:备注信息有的话就全展示出来,换行展示,没有直接不显示这行,这是维修单</view>
+					<view class="lineLine1">备注:{{item.Comment}}</view>
 				</view>
 				<view class="lineBottom" @click="seeData">
 					<span>查看消费明细</span>
@@ -111,13 +121,50 @@
 	export default {
 		data() {
 			return {
-				
+				 customerId:'',
+				 list:[],
+				 array:'',
+				 nodataShow:false,
+				 index:0,
+				 plateNumber:'',
 			}
 		},
 		onLoad() {
 
 		},
 		methods: {
+			getdata(){
+				    var that=this;
+					this.customerId=uni.getStorageSync('customerId')
+					this.array=uni.getStorageSync('PlateNumberArr')
+					this.array.unshift('全部')
+					if(!this.customerId){
+						this.nodataShow=true
+					}else{
+						this.getList()
+					}
+					
+			},
+			getList(){
+				this.$http('enterprise/wechat/listIntegralInfoByCustomerId', {
+				   customerID:this.customerId,
+				   unionID:'EEADACCD-8A19-499D-8AD7-6975D2C93243',
+				   page:1,
+				   limit:50,
+				   plateNumber:this.plateNumber
+				}, 'GET').then(res => {
+				    this.list=res.data.Items
+				})
+			},
+			bindPickerChange: function(e) {
+					console.log('picker发送选择改变,携带值为', e.detail)
+					this.index = e.detail.value
+					this.plateNumber=this.array[this.index]
+					if(this.index==0){
+						this.plateNumber=''
+					}
+					this.getList()
+			},
            seeData(){
 			    this.$refs.popup.open('bottom')
 		   }
@@ -131,6 +178,7 @@
 }
 .carUpimg{
 		width: 26rpx;height: 16rpx;
+		margin-left: 10rpx;
 	}
 
 .cBox{
@@ -288,4 +336,16 @@ border-radius: 10rpx;margin-top: 20rpx;
 		line-height: 33rpx;
 		padding-top: 10rpx;
 	}
+	.nodataImg{
+	  width: 400rpx;
+	  padding-top: 100rpx;
+	}
+	.noTxt{
+		font-size: 32rpx;
+		color: #999999;
+		padding-top: 50rpx;
+	}
+	.nodataBox{
+		text-align: center;
+	}
 </style>

+ 50 - 18
pages/index/coupon.vue

@@ -1,43 +1,53 @@
 <template>
 	<view class="content">
-		<view class="topbox">
+		<view  class="nodataBox" v-show="nodataShow">
+			<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="topbox" v-show="!nodataShow">
 			<view class="top">
 				<view class="topLine">
-					<view class="topTxt1">默认等级</view>
+					<view class="topTxt1">{{levelName}}</view>
 					<view class="topTxt2">客户等级</view>
 				</view>
 				<view class="topx"></view>
 				<view class="topLine">
-					<view class="topTxt1">18</view>
+					<view class="topTxt1">{{list.length}}</view>
 					<view class="topTxt2">可用优惠券</view>
 				</view>
 				<view class="topx"></view>
 				<view class="topLine">
-					<view class="topTxt1">19</view>
+					<view class="topTxt1">{{integral}}</view>
 					<view class="topTxt2">可用积分</view>
 				</view>
 			</view>
 		</view>
-		<view class="cBox">
+		<view class="cBox"  v-show="!nodataShow">
 			<view class="line" v-for="(item,index) in list">
 				<view class="lineTop">
 					<view class="nameBox">
-						<view class="type">代金券</view>
+						<view class="type" v-if="item.discountType==1">满减券</view>
+						<view class="type" v-if="item.discountType==2">商品券</view>
+						<view class="type" v-if="item.discountType==3">服务券</view>
 						<view class="name">{{item.ActName}}</view>
 					</view>
 					<view class="lprice">
 						 <span class="price1">¥</span>
-						 <span class="price2">4566</span>
-						 <span class="price3">满10000元可用</span>
+						 <span class="price2">{{item.ActMoney}}</span>
+						 <span class="price3">{{item.WhereMoney}}</span>
 					</view>
 					<view style="display: flex;">
-							<view class="chepai">限鲁A9JK32使用</view>
+							<view class="chepai" v-if="item.applyCarPlateNumber">限{{tem.applyCarPlateNumber}}使用</view>
+							<view class="chepai" v-else>不限车牌</view>
 					</view>
 				
-					<view class="time">2021.02.21 至 2021.03</view>
+					<view class="time" v-if="item.StartTime">{{item.StartTime.slice(0,10)}}至{{item.EndTime.slice(0,10)}}</view>
+					<view class="time" v-else>有效期:领取后{{item.EndOffsetDays}}天有效</view>
 				</view>
 				<view class="lineBottom">
-					[不可叠加] [限门店] [使用说明]
+					{{item.overlyType == 0 ? '[不可叠加]' : '[可叠加]'}} 
+					 {{item.shopLimit == 0 ? '[不限门店]' : '[限门店]'}}
+					 [使用说明]
 				</view>
 				
 				
@@ -53,7 +63,10 @@
 		data() {
 			return {
 				 customerId:'',
-				 list:[]
+				 list:[],
+				 integral:'',
+				 levelName:'',
+				 nodataShow:false,
 			}
 		},
 		onLoad() {
@@ -63,12 +76,19 @@
            getdata(){
 			   var that=this;
 			   this.customerId=uni.getStorageSync('customerId')
-			   this.$http('enterprise/wechat/listIntegralInfo', {
-			     id:this.customerId,
-			   }, 'GET').then(res => {
-			       this.list=res.data
-			   	
-			   })
+			   this.integral=uni.getStorageSync('integral')
+			   this.levelName=uni.getStorageSync('levelName')
+			   if(!this.customerId){
+			   	this.nodataShow=true
+			   }else{
+				   this.$http('enterprise/wechat/listIntegralInfo', {
+				     id:this.customerId,
+				   }, 'GET').then(res => {
+				       this.list=res.data
+				   	
+				   })
+			   }
+			  
 		   }
 		}
 	}
@@ -172,4 +192,16 @@ color: #666666;
 	color: #666666;
 	padding: 15rpx 24rpx;
 }
+.nodataImg{
+	  width: 400rpx;
+	  padding-top: 100rpx;
+	}
+	.noTxt{
+		font-size: 32rpx;
+		color: #999999;
+		padding-top: 50rpx;
+	}
+	.nodataBox{
+		text-align: center;
+	}
 </style>

+ 49 - 27
pages/index/custom.vue

@@ -1,11 +1,19 @@
 <template>
 	<view class="content">
-		<view class="contLineBox">
-			<view class="contLine">
+		<!-- <view class="contLineBox"  v-if="!customerInfo">
+			<view class="contLine" >
 				<view class="lineTitle">手机号</view>
+				<view class="lineRgiht2" @click="editIphone">请输入手机号,以获取更多信息
+				
+				</view>
+			</view>
+		</view> -->
+		<view class="contLineBox" >
+			<view class="contLine" v-if="customerInfo.mobilePhone">
+				<view class="lineTitle" >手机号</view>
 				<view class="lineRgiht">{{customerInfo.mobilePhone}}</view>
 			</view>
-			<view class="contLine">
+			<view class="contLine" v-if="customerInfo.mobilePhone">
 				<view class="lineTitle">手机号</view>
 				<view class="lineRgiht2" @click="editIphone">请输入手机号,以获取更多信息
 				
@@ -35,9 +43,9 @@
 				<view class="lineRgiht" v-if="customerInfo.CusromerType==1">个人</view>
 				<view class="lineRgiht" v-if="customerInfo.CusromerType==2">单位</view>
 			</view>
-			<view class="contLine">
+			<view class="contLine" v-if="customerInfo.cusromerType==2">
 				<view class="lineTitle">单位名称</view>
-				<view class="lineRgiht">库里</view>
+				<view class="lineRgiht">{{customerInfo.unitName}}</view>
 			</view>
 			<view class="contLine">
 				<view class="lineTitle">服务顾问</view>
@@ -45,31 +53,31 @@
 			</view>
 			<view class="contLine">
 				<view class="lineTitle">所属门店</view>
-				<view class="lineRgiht">库里</view>
+				<view class="lineRgiht">{{customerInfo.shopName}}</view>
 			</view>
 			<view class="contLine">
 				<view class="lineTitle">创建时间</view>
 				<view class="lineRgiht">{{customerInfo.createTime}}</view>
 			</view>
 		</view>
-		<view class="box">
+		<view class="box" >
 			<view class="boxTitle">信用额度</view>
 			<view class="creditBox">
 				<view class="creditLine">
 					<view class="creditTitle">剩余记账:</view>
-					<view class="creditNum">2299</view>
+					<view class="creditNum">{{customerInfo.stayInMoney}}</view>
 				</view>
 				<view class="creditLine">
 					<view class="creditTitle">超期账款:</view>
-					<view class="creditNum">2299</view>
+					<view class="creditNum">{{customerInfo.remainderMoney}}</view>
 				</view>
 				<view class="creditLine">
 					<view class="creditTitle">最近到期日:</view>
-					<view class="creditNum">2299</view>
+					<view class="creditNum">{{customerInfo.dueDate}}</view>
 				</view>
 				<view class="creditLine">
 					<view class="creditTitle">可用额度:</view>
-					<view class="creditNum">2299</view>
+					<view class="creditNum">{{keyongMoney}}</view>
 				</view>
 				<view class="creditLine">
 					<view class="creditTitle">信用额度:</view>
@@ -77,7 +85,7 @@
 				</view>
 			</view>
 		</view>
-		<view class="box">
+		<view class="box" >
 			<view class="boxTitle2">信用额度
 			   <image class="boxIcon" src="../../static/img/icon_arrow_up.png" mode=""></image>
 			</view>
@@ -99,15 +107,15 @@
 			</view>
 			<view class="contLine">
 				<view class="lineTitle">推广员工</view>
-				<view class="lineRgiht">身份证</view>
+				<view class="lineRgiht">{{customerInfo.proUserName}}</view>
 			</view>
 			<view class="contLine">
 				<view class="lineTitle">推广客户</view>
-				<view class="lineRgiht">身份证</view>
+				<view class="lineRgiht">{{customerInfo.proCustomerName}}</view>
 			</view>
-			<view class="contLine">
+			<view class="contLine"  v-if="customerInfo">
 				<view class="lineTitle">生日</view>
-				<view class="lineRgiht">{{customerInfo.birthday}}</view>
+				<view class="lineRgiht" v-if="customerInfo.birthday">{{customerInfo.birthday.slice(0,10)}}</view>
 			</view>
 			<view class="contLine">
 				<view class="lineTitle">客户备注</view>
@@ -144,6 +152,9 @@
 			return {
 				extUserMobile:'',
 				customerInfo:'',
+				customerId:'',
+				unionID:'',
+				keyongMoney:'',
 			}
 		},
 		onLoad() {
@@ -156,18 +167,21 @@
 			},
 			extCustomerInfo(){
 				var that=this;
+				this.userId=uni.getStorageSync('userId')
 				this.$http('enterprise/wechat/extCustomerInfo', {
 				   corpID:'wpMGjbBgAA_zIu6wbKy48zFSbGiGeP8g',
-				   extUserId:'wmMGjbBgAA0JAbGD5Vu8BzEuYgZhvhOA',
+				   extUserId:this.userId,
 				   token:this.token
 				}, 'GET').then(res => {
-				    this.customerInfo=res.data.data.customerInfo
+				    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(){
@@ -175,19 +189,26 @@
 			  uni.showLoading({
 			   	title: '加载中'
 			  }); 
+			  this.userId=uni.getStorageSync('userId')
 			  this.$http('enterprise/wechat/extCustomerMobile', {
 			     corpID:'wpMGjbBgAA_zIu6wbKy48zFSbGiGeP8g',
-			     extUserId:'wmMGjbBgAA0JAbGD5Vu8BzEuYgZhvhOA',
+			     extUserId: this.userId,
 			     extUserMobile:this.extUserMobile
 			  }, 'POST').then(res => {
-			      uni.hideLoading();
-				  uni.showToast({
-					title: res.data,
-					icon: 'none',
-					duration: 3000
-				  });
-				  this.pBcancel()
-				  this.extCustomerInfo()
+				   uni.hideLoading();
+				  if(res.code!=1){
+					  
+				  }else{
+					  uni.showToast({
+							title: res.data,
+							icon: 'none',
+							duration: 3000
+					  });
+					  this.pBcancel()
+					  this.extCustomerInfo()
+				  }
+			     
+				  
 			  	
 			  }).catch(err=>{
 				  
@@ -239,6 +260,7 @@ width: 500rpx;
 		color: #FF8113;
 		padding: 0 8rpx;
 		margin-right: 10rpx;
+		margin-bottom: 10rpx;
 		
 	}
 	.box{

+ 113 - 21
pages/index/index.vue

@@ -1,5 +1,5 @@
 <template>
-	<view class="content">
+	<view class="content" style="background: #F4F5F7;">
 		<view class="top">
 			<view>
 				<image class="logo" :src="userDetail.avatar"></image>
@@ -20,16 +20,22 @@
 		</view>
 		
 		<custom ref="customView" :token="token" v-show="tabIndex==1"></custom>
-	    <car ref="carView" v-show="tabIndex==2"></car>
+	    <car ref="carView"  :token="token" v-show="tabIndex==2"></car>
 	    <packageV ref="packageView" v-show="tabIndex==3"></packageV> 
 		<coupon ref="couponView" v-show="tabIndex==4"></coupon>
 		<consumption ref="consumptionView" v-show="tabIndex==5"></consumption>
-		<view>{{code}}</view>
-		<view @click="copy(code)">复制code</view>
-		<view style="color: red;">{{userId}}</view>
+	  <!--  <view>{{code}}</view>
+		<view @click="copy(code)">复制code</view> -->
+		<!--<view style="color: red;">{{userId}}</view>
 		<view @click="copy(userId)">复制userId</view>
-		<view @click="oAuth">重新授权</view>
+		
 		<view @click="copy(token)">{{token}}</view>
+		<view>{{agentId}}</view> -->
+		<!-- <view @click="oAuth">重新授权</view> -->
+		<!-- <view style="color: red;">{{userId}}</view>
+		<view @click="copy(userId)">复制userId</view>
+		<view>{{token}}</view>
+		<view @click="copy(token)">复制token</view> -->
 	</view>
 </template>
 
@@ -53,20 +59,53 @@
 				userId:'',
 				userDetail:'',
 				customerInfo:'',
+				corpID:'',
+				agentId:'',
+				unionID:'',
 			}
 		},
 		onLoad() {
+			var that=this
             this.code=uni.getStorageSync('code')
 			this.token=uni.getStorageSync('token')
-			if(!this.token){
+			this.corpID=uni.getStorageSync('corpID')
+			this.agentId=uni.getStorageSync('agentId')
+			//this.userId='wmMGjbBgAA0JAbGD5Vu8BzEuYgZhvhOA'
+			//this.token='26AF53EA2DC528681ABD7B3AC46072E96F0A964431A2453CF0F1DA1C28732A1EAF945459643F62A3A6FD87751E6880BB'
+			
+		   /* this.userId='wmMGjbBgAALroygkoaVBN4-W2O1daIkg'
+			this.token='065BAA93971FEB1A37A08D682FCDB41CC69E76FC36BB038790FB99C5CD71C28EAF945459643F62A3A6FD87751E6880BB'
+			 uni.setStorage({
+				key: 'token',
+				data: that.token,
+				 success: function () {	
+					  that.extCustomerInfo()
+					  that.extUserDetail()
+				 }
+			}); 
+			uni.setStorage({
+				key: 'userId',
+				data: that.userId,
+				 success: function () {	
+					
+				 }
+			}); */
+			/* this.code='aSBU0ums_4Z3ofjrfgSlYppwI9Cku5qtIg45ECkJTYY'
+			
+			 
+			 */ 
+			/* if(!this.token){
 				this.authUserInfo()
 			}else{
-				this.extCustomerInfo()
-				 // this.$refs.customView.getdata()
+				 this.extCustomerInfo()
+				 
+				//this.$refs.customView.getdata() 
+				this.extUserDetail()
+				 //this.init()
 			}
-			
-		    this.init()
-			 this.extUserDetail()
+			 */
+		   	this.authUserInfo()
+			//this.extUserDetail()
 		},
 		methods: {
 			tabFn(num){
@@ -74,18 +113,52 @@
 			   if(num==1){
 				   this.$refs.customView.getdata()
 			   }
+			   if(num==2){
+			   		this.$refs.carView.getdata()
+			   }
+			   if(num == 3){
+				   this.$refs.packageView.getdata()
+			   }
 			   if(num==4){
 			   	  this.$refs.couponView.getdata()
 			   }
+			   if(num==5){
+			   	  this.$refs.consumptionView.getdata()
+			   }
+			   
 			},
 			extCustomerInfo(){
 				var that=this;
 				this.$http('enterprise/wechat/extCustomerInfo', {
 				   corpID:'wpMGjbBgAA_zIu6wbKy48zFSbGiGeP8g',
-				   extUserId:'wmMGjbBgAA0JAbGD5Vu8BzEuYgZhvhOA',
+				  // extUserId:'wmMGjbBgAA0JAbGD5Vu8BzEuYgZhvhOA',
+				    extUserId:this.userId,
 				   token:this.token
 				}, 'GET').then(res => {
-				    this.customerInfo=res.data.data.customerInfo
+				    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.data.map
+					var arr=[]
+					if(map.length){
+						map.forEach(item=>{
+							arr.push(item.PlateNumber)
+						})
+					}
+					uni.setStorage({
+						key: 'PlateNumberArr',
+						data: arr,
+						 success: function () {	 }
+					});
+					
 					
 				})
 			},
@@ -93,24 +166,35 @@
 				var that=this;
 				this.$http('enterpriseWechat/auth/extUserDetail', {
 				   corpID:'wpMGjbBgAA_zIu6wbKy48zFSbGiGeP8g',
-				   extUserId:'wmMGjbBgAA0JAbGD5Vu8BzEuYgZhvhOA'
+				  // extUserId:'wmMGjbBgAA0JAbGD5Vu8BzEuYgZhvhOA'
+				  extUserId:this.userId
 				}, 'GET').then(res => {
+					uni.hideLoading();
 					this.userDetail=res.data
 					this.$refs.customView.getdata()
 				})
 			},
 			authUserInfo(){
 				var that=this;
+				uni.showLoading({
+				 	title: '加载中'
+				}); 
 				this.$http('enterpriseWechat/auth/authUserInfo', {
 				   corpID:'wpMGjbBgAA_zIu6wbKy48zFSbGiGeP8g',
-				   code:'F1IuIOqKSe_jNMQrCghvVnyyUSN0YKnNHr3pYoBXTPY'
+				   code: this.code
 				}, 'GET').then(res => {
+					
 					this.token=res.data.token
 					uni.setStorage({
 						key: 'token',
 						data: that.token,
-						 success: function () {	 }
+						 success: function () {	
+							 that.init()
+						 }
 					});
+					
+					//that.extUserDetail()
+					//that.extCustomerInfo()
 				})
 			},
 			init(){
@@ -135,7 +219,7 @@
 					console.log(11)
 					that.$wx.agentConfig({
 					    corpid: 'wpMGjbBgAA_zIu6wbKy48zFSbGiGeP8g', // 必填,企业微信的corpid,必须与当前登录的企业一致
-					    agentid: '1000040', // 必填,企业微信的应用id (e.g. 1000247)
+					    agentid:that.agentId, // 必填,企业微信的应用id (e.g. 1000247)
 					    timestamp: res.data.timestamp, // 必填,生成签名的时间戳
 					    nonceStr: res.data.nonceStr, // 必填,生成签名的随机串
 					    signature: res.data.signature,// 必填,签名,见附录-JS-SDK使用权限签名算法
@@ -188,7 +272,15 @@
 					   }, function(res){
 					   if(res.err_msg == "getCurExternalContact:ok"){
 						   that.userId  = res.userId ; //返回当前外部联系人userId
+						   uni.setStorage({
+						   	key: 'userId',
+						   	data: that.userId,
+						   	 success: function () {	
+						   		
+						   	 }
+						   });
 						   that.extUserDetail()
+						   that.extCustomerInfo()
 					   }else {
 						   //错误处理
 						   uni.showToast({
@@ -259,7 +351,7 @@
 					  // that.agentConfigFn()
 					  that.$wx.agentConfig({
 					      corpid: 'wpMGjbBgAA_zIu6wbKy48zFSbGiGeP8g', // 必填,企业微信的corpid,必须与当前登录的企业一致
-					      agentid: '1000040', // 必填,企业微信的应用id (e.g. 1000247)
+					      agentid: '1000051', // 必填,企业微信的应用id (e.g. 1000247)
 					      timestamp: res.data.timestamp, // 必填,生成签名的时间戳
 					      nonceStr: res.data.nonceStr, // 必填,生成签名的随机串
 					      signature: res.data.signature,// 必填,签名,见附录-JS-SDK使用权限签名算法
@@ -300,7 +392,7 @@
           
 		   oAuth(){
 			  uni.navigateTo({
-			  	url:'auto'
+			  	url:'auto?appid='+this.agentId+'&agentid='+this.agentId
 			  }) 
 		   },
 		   copy(e){
@@ -359,7 +451,7 @@
 		color: #FF8113;
 		padding: 0 8rpx;
 		margin-right: 10rpx;
-		
+		margin-bottom: 10rpx;
 	}
 	.tabBox{
 		display: flex;justify-content: space-between;

+ 77 - 19
pages/index/package.vue

@@ -1,39 +1,46 @@
 <template>
 	<view class="content">
-	<view class="box">
-		<view class="line" @click="detailFn(1)">
+		<view  class="nodataBox" v-show="nodataShow">
+			<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 class="line" @click="detailFn(1,item.listCar)" v-for="(item,index) in czList">
 				 <view class="lineNameBox">
 					 <view class="lnameLeft">
 						 <view class="type">储值</view>
-						 <view class="lname">储值名称一</view>
+						 <view class="lname">{{item.PacKName}}</view>
 					 </view>
 					 <view class="lBtn">使用条款</view>
 				 </view>
 				 <view class="lprice">
 					 <span class="price1">¥</span>
 					 <span class="price2">4566</span>
-					 <span class="price3">( 充10000送1000 )</span>
+					 <span class="price3">( 充{{item.ChargeMoney}}送{{item.GiftMoney}} )</span>
 				 </view>
 				 <view class="lShop">
-					 <view class="lShopName">可用门店:这是门店名称</view>
+					 <view class="lShopName">可用门店:{{item.ShopName}}</view>
 					 <image class="carUpimg" src="../../static/img/icon_arrow_up.png" mode=""></image>
 				 </view>
 		</view>
-		<view class="line" @click="detailFn(2)">
+		<view class="line" @click="detailFn(2,item.maps)" v-for="(item,index) in jcList">
 				 <view class="lineNameBox">
 					 <view class="lnameLeft">
 						 <view class="type">计次</view>
-						 <view class="lname">储值名称一</view>
+						 <view class="lname">{{item.packName}}</view>
 					 </view>
 					 <view class="lBtn">使用条款</view>
 				 </view>
-				 <view class="lprice">
+				 <!-- <view class="lprice">
 					 <span class="price1">¥</span>
 					 <span class="price2">4566</span>
 					 <span class="price3">( 充10000送1000 )</span>
-				 </view>
+				 </view> -->
 				 <view class="lShop">
-					 <view class="lShopName">可用门店:这是门店名称</view>
+					 <view class="lShopName" v-if="item.shoplist.length==0">可用门店:全部</view>
+					 <view class="lShopName" v-else>可用门店:
+					    <span v-for="(s,i) in item.shoplist">{{s.shopName}}</span>
+					 </view>
 					 <image class="carUpimg" src="../../static/img/icon_arrow_up.png" mode=""></image>
 				 </view>
 		</view>
@@ -45,10 +52,10 @@
 	 	<view class="popupBox" v-if="type==1">
 	 	  <view class="popupTitleBox">
 	 		  <view class="popupTitle">储值详情</view>
-	 		  <image src="../../static/img/cha.png" mode="" class="chaImg"></image>
+	 		  <image src="../../static/img/cha.png" mode="" class="chaImg" @click="guanbi"></image>
 	 	  </view>
 		  <view class="dlineBox">
-			  <view class="dLine" v-for="(item,index) in 20">
+			  <view class="dLine" v-for="(item,index) in listCar">
 				  <view class="dlineTime">06-13 11:28</view>
 				  <view class="dlineprice1">-¥1.00</view>
 			  </view>
@@ -58,18 +65,20 @@
 		<view class="popupBox" v-if="type==2">
 		  <view class="popupTitleBox">
 			  <view class="popupTitle">计次详情</view>
-			  <image src="../../static/img/cha.png" mode="" class="chaImg"></image>
+			  <image src="../../static/img/cha.png" mode="" class="chaImg" @click="guanbi"></image>
 		  </view>
 		  <view class="dlineBox">
-			  <view class="dLine2" v-for="(item,index) in 20">
+			  <view class="dLine2" v-for="(item,index) in maps">
 				<view class="jcNameBox">
-						<view class="jcType">项目</view>
-						<view class="jcNameTxt">王艳王岩</view>
+						<view class="jcType" v-if="item.FlowType==2">项目</view>
+						<view class="jcType" v-if="item.FlowType==1">商品</view>
+						<view class="jcNameTxt">{{item.FlowName}}</view>
 				</view>
 				<view class="jcTitme">
-					<view class="jcYxq">有效期:2019-09-09</view>
+					<view class="jcYxq" v-if="item.ExpireTime&&item.ExpireTime!=null&&item.ExpireTime!='null'">有效期:{{item.ExpireTime.slice(0,10)}}</view>
+					<view class="jcYxq" v-else>有效期:永久</view>
 					<view class="jcNum">
-						<span>剩余/总:<span style="color: #FF3B30;">10</span> /23</span>
+						<span>剩余/总:<span style="color: #FF3B30;">{{item.AmountQty}}</span> /{{item.TotalQty}}</span>
 					</view>
 				</view>
 			  </view>
@@ -87,15 +96,52 @@
 		data() {
 			return {
 				type:1,
+				czList:[],
+				jcList:[],
+				listCar:'',
+				maps:'',
+				nodataShow:false,
 			}
 		},
 		onLoad() {
 
 		},
 		methods: {
-          detailFn(num){
+		  getdata(){
+			  var that=this;
+			  this.customerId=uni.getStorageSync('customerId')
+			  //储值信息
+			  if(!this.customerId){
+			  	this.nodataShow=true
+			  }else{
+				  this.$http('enterprise/wechat/cardMoneyInfo', {
+				    id:this.customerId,
+				  }, 'GET').then(res => {
+				     this.czList=res.data
+				  	
+				  })
+				  //计次信息
+				  this.$http('enterprise/wechat/listCardTimesInfo', {
+				    id:this.customerId,
+				  }, 'GET').then(res => {
+				     this.jcList=res.data
+				  	
+				  })
+			  }
+			  
+		  },
+          detailFn(num,list){
 			  this.type=num;
+			  if(num==1){
+				  this.listCar=list
+			  }
+			  if(num==2){
+				  this.maps=list
+			  }
 			  this.$refs.popup.open('bottom')
+		  },
+		  guanbi(){
+			    this.$refs.popup.close()
 		  }
 		}
 	}
@@ -244,4 +290,16 @@
 		font-size: 24rpx;
 		color: #999999;
 	}
+	.nodataImg{
+	  width: 400rpx;
+	  padding-top: 100rpx;
+	}
+	.noTxt{
+		font-size: 32rpx;
+		color: #999999;
+		padding-top: 50rpx;
+	}
+	.nodataBox{
+		text-align: center;
+	}
 </style>