Sfoglia il codice sorgente

名片审核+顾问绑定

xhj 2 anni fa
parent
commit
74097c2ab0

+ 2 - 0
card/cardDetail/cardDetail.css

@@ -102,6 +102,8 @@
 	font-family: Source Han Sans CN-Regular, Source Han Sans CN;
 	font-weight: 400;
 	color: #FFFFFF;
+	z-index: 2;
+    position: relative;
 }
 .user-btn-text{
 	text-align: center;

+ 42 - 10
card/cardDetail/cardDetail.vue

@@ -8,7 +8,7 @@
 			<view class="user-name">{{ cardInfo.realName }}</view>
 			<view class="user-tag ddflex">
 				<view class="user-tag-item">{{ cardInfo.jobName }}</view>
-				<view class="user-tag-item">入司{{cardInfo.inDate?getAge(cardInfo.inDate):1}}年</view>
+				<view class="user-tag-item">入司{{cardInfo.inDate?monthDayDiff(cardInfo.inDate):'1年'}}</view>
 			</view>
 			<view class="pf">
 				<view class="pf-title">综合评分</view>
@@ -41,12 +41,20 @@
 				<rich-text :nodes="cardInfo.brief ? cardInfo.brief : ''"></rich-text>
 			</view>
 			<image class="user-code" :src="code?code:'/static/images/lj_img.png'"></image>
-			<view class="user-btn" @click="submit">
-				选TA做专属顾问
-			</view>
-			<view class="user-btn-text" @click="jumpUrl('/card/cardList/cardList')">
-				更多专属顾问>
-			</view>
+			<block v-if="!noBind">
+				<view class="user-btn" @click="submit">
+					选TA做专属顾问
+				</view>
+				<view class="user-btn-text" @click="jumpUrl('/card/cardList/cardList')">
+					更多专属顾问>
+				</view>
+			</block>
+			<!-- 解绑 -->
+			<block v-else>
+				<view class="user-btn" @click="bindCancal">
+					解除绑定
+				</view>
+			</block>
 		</view>
 	</view>
 </template>
@@ -67,11 +75,15 @@
 				cardInfo:{},
 				evaluateInfo:{},
 				code:'',
-				loading:true
+				loading:true,
+				noBind:false
 			}
 		},
 		onLoad(options) {
 			this.id = options.id
+			if(options.noBind){
+				this.noBind = true
+			}
 			uni.showLoading({
 				title:'加载中'
 			})
@@ -120,8 +132,8 @@
 						});
 					});
 				},
-			getAge(date) {
-				return util.getAge(date)
+			monthDayDiff(date) {
+				return util.monthDayDiff(date)
 			},
 			submit(){
 				req.postRequest('/api/visiting/card/bindManageSaleNo',{manageSaleNo:this.cardInfo.jobNumber},res=>{
@@ -135,6 +147,26 @@
 						})
 					},1000)
 				})
+			},
+			// 解绑
+			bindCancal(){
+				uni.showModal({
+					title:'提示',
+					content:'确定解除绑定?',
+					success: (con) => {
+						if(con.confirm){
+							req.postRequest('/api/visiting/card/unBindManageSaleNo',{},res=>{
+								req.msg('已解除绑定')
+								let userInfo = req.getStorage('userInfo')
+								userInfo.manageSaleNo = ''
+								req.setStorage('userInfo',userInfo)
+								setTimeout(()=>{
+									uni.navigateBack()
+								},1000)
+							})
+						}
+					}
+				})
 			}
 		},
 		mounted() {

+ 3 - 3
card/cardFound/cardFound.vue

@@ -27,7 +27,7 @@
 					</view>
 					<view class="ddflex" style="margin-top: 4rpx;">
 						<view class="card-tag">{{cabInfo.jobName}}</view>
-						<view class="card-tag">入司{{cabInfo.inDate?getAge(cabInfo.inDate):1}}年</view>
+						<view class="card-tag">入司{{cabInfo.inDate?monthDayDiff(cabInfo.inDate):'1年'}}</view>
 					</view>
 					<view class="card-area ddflex">
 						<image src="/static/pages/images/dzico.png"></image>
@@ -330,8 +330,8 @@ export default {
 			})
 		},
 		
-		getAge(date) {
-			return util.getAge(date)
+		monthDayDiff(date) {
+			return util.monthDayDiff(date)
 		},
 		
 		

+ 3 - 3
card/cardList/cardList.vue

@@ -70,7 +70,7 @@
 						</view>
 						<view class="ddflex" style="margin-top: 4rpx;">
 							<view class="card-tag">{{ item.jobName }}</view>
-							<view class="card-tag">入司{{item.inDate?getAge(item.inDate):1}}年</view>
+							<view class="card-tag">入司{{item.inDate?monthDayDiff(item.inDate):'1年'}}</view>
 						</view>
 						<view class="card-area ddflex">
 							<image src="/card/static/images/area.png"></image>
@@ -418,8 +418,8 @@
 				}
 			
 			},
-			getAge(date) {
-				return util.getAge(date)
+			monthDayDiff(date) {
+				return util.monthDayDiff(date)
 			},
 		},
 		mounted() {

+ 99 - 26
card/create/create.vue

@@ -189,12 +189,19 @@ export default {
 		};
 	},
 	async onLoad(opt) {
-		this.isEdit = opt.isEdit;
+		this.isEdit = opt.isEdit?true:false;
 		this.id = opt.id;
-		this.saleNo = opt.saleNo
+		// if(opt.saleNo){
+		// 	console.log(opt.saleNo)
+		// 	this.saleNo = opt.saleNo
+		// 	req.setStorage('saleNo',this.saleNo)
+		// }else{
+		// 	console.log(req.getStorage('saleNo'))
+		// 	opt.saleNo = req.getStorage('saleNo')
+		// 	this.saleNo = opt.saleNo
+		// }
 		
-		await req.silenceLogin(opt.saleNo)
-		this.loading = false
+		await req.silenceLogin()
 		console.log('getUserCard')
 		this.getUserCard()
 		this.getEmploymentInfo()
@@ -212,7 +219,7 @@ export default {
 		},
 		getEmploymentInfo(){
 			return new Promise((resolve,reject)=>{
-				req.getRequest('/api/visiting/card/employmentInfo',{jobNumber:this.saleNo},res=>{
+				req.getRequest('/api/visiting/card/employmentInfo',{jobNumber:req.getStorage('userInfo').saleNo},res=>{
 					if(res.name){
 						this.employmentInfo = res;
 						this.realName = this.employmentInfo.name;
@@ -233,8 +240,29 @@ export default {
 				console.log('getUserCard',res)
 				this.userCard = res
 				if(!res){
+					this.isEdit = true
 					this.getUserInfo()
 				}else{
+					if(!this.isEdit){
+						if(res.auditState==0){
+							// 待审核
+							uni.redirectTo({
+								url:'/card/success/success?state=0'
+							})
+							return false
+						}else if(res.auditState==1){
+							// 审核成功
+							uni.redirectTo({
+								url:'/card/success/success?state=1'
+							})
+							return false
+						}else if(res.auditState==2){
+							// 审核失败
+							uni.redirectTo({
+								url:'/card/success/success?state=2&&msg='+res.auditFailReason
+							})
+						}
+					}
 					this.id = res.id
 					this.avatar = res.avatar;
 					this.realName = res.realName;
@@ -253,7 +281,10 @@ export default {
 					this.morCity = [res.areaCode.substring(0,2)+'0000',res.areaCode.substring(0,4)+'00',res.areaCode]
 					this.city = res.areaCodeName
 					this.areaCode = this.morCity[2];
+					this.latitude = res.latitude
+					this.longitude = res.longitude
 				}
+				this.loading = false
 				this.getEmploymentInfo()
 			});
 		},
@@ -497,28 +528,70 @@ export default {
 			var url = '';
 			if (this.id) {
 				dataP.id = this.id;
-			} 
-
-			req.postRequest(
-				'/api/visiting/card/saveOrUpdate',
-				dataP,
-				json => {
-					if (that.id) {
-						req.msg('保存成功');
-						setTimeout(function() {
-							uni.navigateBack({
-								delta: 1
-							});
-						}, 1500);
-					} else {
-						req.msg('名片创建成功');
-						setTimeout(function() {
-							that.jumpUrl('/card/index/index');
-						}, 1500);
+				uni.showModal({
+					title:'提示',
+					content:'重新提交将会重新审核信息,确定提交?',
+					success: (con) => {
+						if(con.confirm){
+							req.postRequest(
+								'/api/visiting/card/saveOrUpdate',
+								dataP,
+								json => {
+									if (that.id) {
+										uni.reLaunch({
+											url:'/card/success/success'
+										})
+										// req.msg('修改成功');
+										// setTimeout(function() {
+										// 	uni.navigateBack({
+										// 		delta: 1
+										// 	});
+										// }, 1500);
+									} else {
+										uni.reLaunch({
+											url:'/card/success/success'
+										})
+										// req.msg('名片创建成功');
+										// setTimeout(function() {
+										// 	that.jumpUrl('/card/index/index');
+										// }, 1500);
+									}
+								},
+								true
+							);
+						}
 					}
-				},
-				true
-			);
+				})
+			} else{
+				req.postRequest(
+					'/api/visiting/card/saveOrUpdate',
+					dataP,
+					json => {
+						if (that.id) {
+							uni.reLaunch({
+								url:'/card/success/success'
+							})
+							// req.msg('修改成功');
+							// setTimeout(function() {
+							// 	uni.navigateBack({
+							// 		delta: 1
+							// 	});
+							// }, 1500);
+						} else {
+							uni.reLaunch({
+								url:'/card/success/success'
+							})
+							// req.msg('名片创建成功');
+							// setTimeout(function() {
+							// 	that.jumpUrl('/card/index/index');
+							// }, 1500);
+						}
+					},
+					true
+				);
+			}
+
+			
 		}
 	}
 };

+ 27 - 5
card/index/index.vue

@@ -35,6 +35,10 @@
 								<image src="/card/static/images/change.png"></image>
 								<!-- 更换销售员-->
 							</view>
+							<view v-if="cardId&&(!userInfo.manageSaleNo)" style="background-color: #FF7229;" class="change ddflex" @click="bindSale()">
+								<image  style="width: 36rpx;height: 36rpx;" src="/card/static/images/bind.png"></image>
+								<!-- 绑定销售员-->
+							</view>
 						</view>
 					</block>
 				</view>
@@ -43,7 +47,7 @@
 						<view class="name">
 							{{ cardInfo.realName }}
 							<text class="job" v-if="cardInfo.job">{{ cardInfo.jobName }}</text>
-							<text class="job">入司{{cardInfo.inDate?getAge(cardInfo.inDate):1}}年</text>
+							<text class="job">入司{{cardInfo.inDate?monthDayDiff(cardInfo.inDate):'1年'}}</text>
 						</view>
 						<view class="company ddflex" style="margin-top: 20rpx;">
 							<image src="/card/static/images/gs.png"></image>
@@ -361,10 +365,10 @@
 							<image src="../../static/images/comment.png"></image>
 							{{ item.count.commentCount < 99 ? item.count.commentCount : '99+' }}
 						</view>
-						<button open-type="share" class="opt-share ddflex">
+						<!-- <button open-type="share" class="opt-share ddflex">
 							<image src="../../static/images/share.png"></image>
 							分享
-						</button>
+						</button> -->
 					</view>
 				</view>
 			</view>
@@ -843,8 +847,8 @@ import util from '../../utils/util.js';
 					}
 				});
 			},
-			getAge(date){
-				return util.getAge(date)
+			monthDayDiff(date){
+				return util.monthDayDiff(date)
 			},
 			
 			// 获取评论
@@ -982,6 +986,24 @@ import util from '../../utils/util.js';
 			toUserHomePage(userId) {
 				this.jumpUrl('/topics/home/home?userId=' + userId);
 			},
+			
+			bindSale(){
+				uni.showModal({
+					title:'提示',
+					content:'是否绑定该顾问?',
+					success: (con) => {
+						if(con.confirm){
+							req.postRequest('/api/visiting/card/bindManageSaleNo',{manageSaleNo:this.cardInfo.jobNumber},res=>{
+								req.msg('已绑定专属顾问')
+								let userInfo = req.getStorage('userInfo')
+								userInfo.manageSaleNo = this.cardInfo.jobNumber
+								req.setStorage('userInfo',userInfo)
+								this.userInfo = req.getStorage('userInfo')
+							})
+						}
+					}
+				})
+			}
 		},
 		mounted() {
 			const systemInfo = uni.getSystemInfoSync();

+ 4 - 4
card/poster/poster.vue

@@ -18,7 +18,7 @@
 				<view class="infos">
 					<view class="name">{{ cardInfo.realName }}<text style="font-size: 24rpx;margin-left: 10rpx;font-weight: 400;">{{ cardInfo.jobName }}</text></view>
 					<view class="company">{{ cardInfo.companyName }}</view>
-					<view class="industry">入司{{ cardInfo.inDate?getAge(cardInfo.inDate):1}}年</view>
+					<view class="industry">入司{{ cardInfo.inDate?monthDayDiff(cardInfo.inDate):'1年'}}</view>
 				</view>
 			</view>
 			<view class="opt dflex">
@@ -229,7 +229,7 @@ export default {
 				ctx.setFontSize(20);
 				ctx.setFillStyle('#ffffff');
 				ctx.setTextAlign('left');
-				var discountText = '入司'+(that.cardInfo.inDate?that.getAge(that.cardInfo.inDate):1)+'年'
+				var discountText = '入司'+(that.cardInfo.inDate?that.monthDayDiff(that.cardInfo.inDate):'1年')
 				var bdColor = '#fff';
 				var bdBackground = 'transparent';
 				var bdRadius = 5;
@@ -272,8 +272,8 @@ export default {
 				return '';
 			}
 		},
-		getAge(date){
-			return util.getAge(date)
+		monthDayDiff(date){
+			return util.monthDayDiff(date)
 		},
 		/**
 		 *

BIN
card/static/images/bind.png


BIN
card/static/images/sh.png


BIN
card/static/images/shcg.png


BIN
card/static/images/shsb.png


+ 13 - 0
card/success/success.css

@@ -0,0 +1,13 @@
+/* success.css */
+page{background: #fff;}
+.success{padding: 134rpx 50rpx 0;text-align: center;}
+.success image{width: 106rpx;height: 106rpx;margin: 0 auto;}
+.tip{font-size: 40rpx;color: #000;margin: 25rpx 0 20rpx;}
+.tips{font-size: 24rpx;color: #999;line-height: 40rpx;}
+.mine{color: var(--btn);display: inline-block;}
+.share{width: 371rpx !important;height: 80rpx !important;background: var(--btn);border-radius: 40rpx !important;font-size: 36rpx;color: #fff;line-height: 80rpx !important;margin: 90rpx auto 0 !important;}
+.backhome{width: 367rpx;height: 76rpx;background: #FFFFFF;border: 2rpx solid var(--btn);border-radius: 40rpx;font-size: 36rpx;color: var(--btn);text-align: center;line-height: 76rpx;margin: 20rpx auto 0;}
+.color-red{
+	border: 2rpx solid red;
+	color: red;
+}

+ 58 - 0
card/success/success.vue

@@ -0,0 +1,58 @@
+<template>
+	<view class="success">
+		<block>
+			<image v-if="state==1" src="../static/images/shcg.png"></image>
+			<image v-if="state==2" src="../static/images/shsb.png"></image>
+			<image v-if="state==0" src="../static/images/sh.png"></image>
+		</block>
+		<view class="tip">
+			<block v-if="state==1">审核成功</block>
+			<block v-if="state==2">审核失败</block>
+			<block v-if="state==0">审核中</block>
+		</view>
+		<view class="tips">
+			<block v-if="state==0">您已成功提交名片信息,请耐心等待审核</block>
+			<block v-if="state==1">您的名片信息已通过审核</block>
+			<block v-if="state==2">{{msg}}</block>
+		</view>
+		<navigator v-if="state==0" url="/card/index/index" open-type="navigate" hover-class="none" class="backhome">预览名片</navigator>
+		<view v-if="state==1">
+			<navigator url="/card/index/index" open-type="navigate" hover-class="none" class="backhome">预览名片</navigator>
+			<navigator url="/card/create/create?isEdit=true" open-type="navigate" hover-class="none" class="backhome color-red">修改信息</navigator>
+		</view>
+		<navigator v-if="state==2" url="/card/create/create?isEdit=true" open-type="navigate" hover-class="none" class="backhome">去修改</navigator>
+	</view>
+</template>
+
+<script>
+const req = require('../../utils/request.js');
+const util = require('../../utils/util.js');
+const app = getApp();
+export default {
+	components: {
+	},
+	data() {
+		return {
+			options: {},
+			detail: {},
+			state:0,
+			msg:''
+		};
+	},
+	onLoad(options) {
+		this.options = options;
+		this.state = options.state?options.state:0
+		this.msg = options.msg
+	},
+	onShow() {
+	},
+	onReachBottom: function() {
+	},
+	methods: {
+	}
+};
+</script>
+
+<style>
+	@import "./success.css";
+</style>

+ 3 - 3
match/activityDetail/activityDetail.vue

@@ -42,7 +42,7 @@
 						<view style="margin-top: 3rpx;" class="ddflex">
 							<view class="user-tag">{{detail.card.companyName}}</view>
 							<view class="user-tag">{{detail.card.jobName}}</view>
-							<view class="user-tag">入司{{detail.card.inDate?getAge(detail.card.inDate):1}}年</view>
+							<view class="user-tag">入司{{detail.card.inDate?monthDayDiff(detail.card.inDate):1}}年</view>
 						</view>
 					</view>
 				</view>
@@ -413,8 +413,8 @@ export default {
 				});
 			});
 		},
-		getAge(date){
-			return util.getAge(date)
+		monthDayDiff(date){
+			return util.monthDayDiff(date)
 		},
 	}
 };

+ 3 - 0
mine/bindNumber/bindNumber.vue

@@ -35,6 +35,9 @@ import { setTimeout } from "timers";
 				if(!this.saleNo) req.msg("请输入工号")
 				req.postRequest('/api/user/bindSaleNo',{saleNo:this.saleNo},res=>{
 					req.msg("绑定成功")
+					req.getRequest('/api/user/info', {}, suc => {
+						req.setStorage('userInfo', data);
+					});
 					setTimeout(()=>{
 						uni.navigateBack()
 					},1000)

+ 20 - 0
mine/set/set.css

@@ -0,0 +1,20 @@
+page{
+	background-color: #fff;
+}
+.set-item{
+	margin: 0 30rpx;
+	padding: 30rpx 0;
+	justify-content: space-between;
+	line-height: 40rpx;
+	font-size: 28rpx;
+	border-bottom: 2rpx solid #E2E2E2;
+}
+.set-info{
+	font-size: 28rpx;
+	color: #A1A1A1;
+}
+.set-item image{
+	width: 13rpx;
+	height: 23rpx;
+	margin-left: 10rpx;
+}

+ 64 - 0
mine/set/set.vue

@@ -0,0 +1,64 @@
+<template>
+	<view>
+		<view class="set-item ddflex" v-if="userInfo.manageSaleNo" @click="jumpUrl('/card/cardDetail/cardDetail?noBind=true&id='+recommendCard.id)">
+			我的保险顾问
+			<view class="ddflex set-info">
+				<view>{{recommendCard.realName}}</view>
+				<image src="../../static/pages/images/more.png"></image>
+			</view>
+		</view>
+		<view class="set-item ddflex" @click="jumpUrl('/mine/userinfo/userinfo')">
+			个人资料
+			<view class="ddflex set-info">
+				<image src="../../static/pages/images/more.png"></image>
+			</view>
+		</view>
+	</view>
+</template>
+
+<script>
+	const app = getApp();
+	const req = require("../../utils/request.js");
+
+	export default {
+		components: {},
+		props: {},
+		data() {
+			return {
+				userInfo:'',
+				recommendCard:''
+			}
+		},
+		onLoad(options) {
+			
+		},
+		onShow() {
+			this.userInfo = req.getStorage('userInfo')
+			if(this.userInfo.manageSaleNo){
+				this.getRecommendCard()
+			}
+		},
+		methods: {
+			jumpUrl(url){
+				uni.navigateTo({
+					url:url
+				})
+			},
+			// 获取推荐销售
+			getRecommendCard(){
+				if(this.userInfo.manageSaleNo){
+					req.getRequest('/api/visiting/card/recommendCardInfo',{},res=>{
+						this.recommendCard = res
+					})
+				}
+			},
+		},
+		mounted() {
+			
+		},
+	}
+</script>
+
+<style>
+	@import "./set.css";
+</style>

+ 47 - 0
office/createTeam/index.vue

@@ -18,6 +18,14 @@
 				</view>
 				<view class="upload ddflex" @click="uploadImgs" v-if="zhiPicUrls.length < 1"><image src="../static/images/upload.png"></image></view>
 			</view>
+			<view class="tits">群二维码</view>
+			<view class="imgbox ddflex">
+				<view class="imgs" v-if="qunCode" :key="index">
+					<image :src="qunCode" class="img" mode="aspectFill"></image>
+					<image src="../static/images/close.png" class="del" @tap="cleanCode(index)"></image>
+				</view>
+				<view class="upload ddflex" @click="uploadImgsCode" v-if="!qunCode"><image src="../static/images/upload.png"></image></view>
+			</view>
 			<view class="other">
 				<view class="li ddflex" @click="chooseLocation">
 					<image src="../static/images/tj_wzico.png" class="o-ico"></image>
@@ -47,6 +55,7 @@ export default {
 		return {
 			opt: {},
 			zhiPicUrls: [],
+			qunCode:'',
 			title: '',
 			description: '',
 			location: {},
@@ -121,6 +130,36 @@ export default {
 				}
 			});
 		},
+		uploadImgsCode() {
+			let that = this;
+			uni.chooseImage({
+				count: 1,
+				sizeType: ['original', 'compressed'],
+				sourceType: ['album', 'camera'],
+				success: function({ tempFilePaths }) {
+					uni.showLoading({
+						title: '上传中'
+					});
+					var promise = Promise.all(
+						tempFilePaths.map(tempFilePath => {
+							return new Promise(function(resolve, reject) {
+								req.uploadFile('/api/nocheck/upload', tempFilePath, res => {
+									that.qunCode = res.src;
+									uni.hideLoading()
+								});
+							});
+						})
+					);
+					promise
+						.then(function(results) {
+							console.log(results);
+						})
+						.catch(function(err) {
+							console.log(err);
+						});
+				}
+			});
+		},
 		//预览图片
 		previewImg(picUrls, index) {
 			//预览合同图片
@@ -138,6 +177,10 @@ export default {
 			arr.splice(index, 1);
 			this.zhiPicUrls = arr;
 		},
+		cleanCode() {
+			// 删除图片
+			this.qunCode = '';
+		},
 		chooseLocation(){
 			let that = this;
 			uni.chooseLocation({//choosePoi不返回经纬度
@@ -182,6 +225,10 @@ export default {
 			if (this.zhiPicUrls.length > 0) {
 				dataPream.url = this.zhiPicUrls.join(',');
 			}
+			// 群二维码
+			if(this.qunCode){
+				dataPream.qunCode = this.qunCode
+			}
 			// 位置
 			if(this.location&&this.location.poiName){
 				dataPream.poiName = this.location.poiName;

BIN
office/static/images/jt.png


+ 15 - 1
office/team/index.css

@@ -24,7 +24,7 @@ page{
 .cons-b{margin: 10rpx 30rpx 30rpx;background: #fff;border-radius: 20rpx;}
 .tab{padding: 26rpx 30rpx;}
 .tab .li{min-width: 88rpx;height: 48rpx;background: #fff;border-radius: 24rpx;font-size: 24rpx;color: #000;text-align: center;line-height: 48rpx;margin-right: 30rpx;box-sizing: border-box;padding: 0 20rpx;}
-.tab .li.active{background: #E1FFF4;color: #FF7000;}
+.tab .li.active{background: #E1FFF4;color: var(--main);}
 .list .li{padding: 40rpx 30rpx 45rpx;border-bottom: 1rpx solid rgba(174, 174, 174, 0.2);}
 .list .li:last-child{border-bottom: none;}
 .userimg{width: 66rpx;height: 66rpx;border-radius: 50%;margin-right: 12rpx;}
@@ -182,3 +182,17 @@ page{
 .team-user-heads image:first-child{
 	margin-left: 0rpx;
 }
+
+
+.qunCode{
+	background: #FFFFFF;
+	border-radius: 15rpx 15rpx 15rpx 15rpx;
+	opacity: 1;
+	margin: 30rpx;
+	padding: 30rpx 40rpx;
+	justify-content: space-between;
+}
+.qunCode-pic{
+	width: 120rpx;
+	height: 120rpx;
+}

+ 9 - 0
office/team/index.vue

@@ -49,6 +49,15 @@
 				<view class="join-btn" @click="joinTeam">加入</view>
 			</view>
 		</view>
+		
+		<view class="ddflex qunCode">
+			<view>
+				<view>加入【{{teamInfo.title}}群】</view>
+				<view style="margin: 10rpx 0;">一起探讨更多保险知识</view>
+				<image style="width: 27rpx;height: 17rpx;" src="/office/static/images/jt.png"></image>
+			</view>
+			<image class="qunCode-pic" src="/static/images/lj_img.png" show-menu-by-longpress="true" @click="previewImgss(['/static/images/lj_img.png'],0)"></image>
+		</view>
 			
 		<view class="tab ddflex">
 			<!-- <view :class="'li ' + (pType == 1 ? 'active' : '')" @click="swiPType(1)">综合</view> -->

+ 10 - 0
pages.json

@@ -266,6 +266,11 @@
 					"style": {
 						"navigationBarTitleText": "我的关注"
 					}
+				},{
+					"path": "set/set",
+					"style": {
+						"navigationBarTitleText": "设置中心"
+					}
 				}
 			]
 		},
@@ -574,6 +579,11 @@
 					}
 
 				}, {
+					"path": "success/success",
+					"style": {
+						"navigationBarTitleText": ""
+					}
+				},{
 					"path": "poster/poster",
 					"style": {
 						"navigationBarTitleText": "名片码",

+ 3 - 3
pages/index/index.vue

@@ -47,7 +47,7 @@
 						</view>
 						<view class="service-person-option ddflex">
 							<image src="/static/pages/images/cy.png"></image>
-							<view>入司{{recommendCard.inDate?getAge(recommendCard.inDate):1}}年</view>
+							<view>入司{{recommendCard.inDate?monthDayDiff(recommendCard.inDate):'1年'}}</view>
 						</view>
 						<view class="service-person-option ddflex">
 							<image src="/static/pages/images/fw.png"></image>
@@ -968,8 +968,8 @@
 				date = new Date(date.replace(/-/g, '/'))
 				return utils.formatTime(date).t3
 			},
-			getAge(date) {
-				return utils.getAge(date)
+			monthDayDiff(date) {
+				return utils.monthDayDiff(date)
 			},
 			// 热门活动
 			getUrlHot(item) {

+ 1 - 1
pages/interactive/index.vue

@@ -794,7 +794,7 @@
 			        {
 			            page: 1,
 			            limit: 1,
-						code:'gfdt'
+						code:req.public.gfdtCode
 			        },
 			        function (res) {
 			            _this.setData({

+ 55 - 29
pages/user/user.vue

@@ -117,7 +117,7 @@
 								</view>
 								<view class="service-person-option ddflex">
 									<image src="/static/pages/images/cy_hui.png"></image>
-									<view>入司{{recommendCard.inDate?getAgeFn(recommendCard.inDate):1}}年</view>
+									<view>入司{{recommendCard.inDate?monthDayDiff(recommendCard.inDate):'1年'}}</view>
 								</view>
 								<view class="service-person-option ddflex">
 									<image src="/static/pages/images/fw_hui.png"></image>
@@ -142,14 +142,14 @@
 		</view>
 <!-- url="/promote/invite/invite" -->
 		<view class="box mlist" v-if="userInfos.userType!=1">
-			<navigator class="li ddflex"  hover-class="none">
+			<button class="li ddflex"  open-type="share">
 				<image src="/static/images/yqhy.png" class="mico"></image>
 				<view class="fflex">推荐好友</view>
 				<image src="../../static/pages/images/more.png" class="rico"></image>
-			</navigator>
+			</button>
 		</view>
 		<view class="box mlist" v-else>
-			<navigator class="li ddflex" url="/card/index/index" hover-class="none">
+			<navigator class="li ddflex" @click="toCard()" hover-class="none">
 				<image src="/static/images/wdmp.png" class="mico"></image>
 				<view class="fflex">我的名片</view>
 				<image src="../../static/pages/images/more.png" class="rico"></image>
@@ -180,6 +180,11 @@
 				<view class="fflex">关于中国人寿</view>
 				<image src="../../static/pages/images/more.png" class="rico"></image>
 			</navigator>
+			<navigator class="li ddflex" url="/mine/set/set" hover-class="none">
+				<image src="/static/images/setting.png" class="mico"></image>
+				<view class="fflex">设置中心</view>
+				<image src="../../static/pages/images/more.png" class="rico"></image>
+			</navigator>
 		</view>
 		<!-- <footer-copyright></footer-copyright> -->
 		<view style="height: 80rpx;"></view>
@@ -259,7 +264,7 @@
 				isShowUpdate: false, //是否显示更新信息弹窗
 				isUpdateInfo: false, //更新用户信息
 				isUpdateMobile: false, //绑定手机号
-				recommendCard:{},
+				recommendCard:'',
 				isShowCodePop:false,
 				isShowBind:false,
 				myCount:{
@@ -317,13 +322,22 @@
 			if (this.isLogin) {
 				this.getMy();
 				this.getAbout();
-				this.getRecommendCard()
 				this.getMyCount()
 				this.noLogin = true;
 			} else {
 				this.noLogin = false;
 			}
 		},
+		onShareAppMessage(res) {
+			if (res.from == 'button') {
+				let userInfo = req.getStorage('userInfo');
+				return {
+					title: userInfo.nickName+'邀请您加入'+this.config.CONFIG_PROJECT_TITLE,
+					path: '/pages/index/index',
+					imageUrl: this.config.CONFIG_PROJECT_LOGO, // 分享图
+				};
+			}
+		},
 		methods: {
 
 			jumpUrl(url) {
@@ -348,27 +362,11 @@
 					this.userInfos = data;
 					// that.setData(data); // this.isbindmobile();
 					console.log('userinfo==' + JSON.stringify(data));
-					this.getuserMoney();
+					this.getRecommendCard()
 					// console.log(this);
 				});
 			},
 
-			getuserMoney() {
-				let is_open_wallet = JSON.parse(req.getStorage('configRes')).is_open_wallet;
-
-				if (is_open_wallet) {
-					if (JSON.parse(is_open_wallet).isOpenWallet == 1) {
-						route.extendNew({}, res => {
-							// console.log(parseFloat(res.all).toFixed(2));
-							if (res)
-								this.setData({
-									userMoney: parseFloat(res.all).toFixed(2)
-								});
-						});
-					}
-				}
-			},
-
 			getAbout() {
 				var _this = this;
 
@@ -451,13 +449,22 @@
 			// },
 			// 获取推荐销售
 			getRecommendCard(){
-				req.getRequest('/api/visiting/card/recommendCardInfo',{},res=>{
-					this.recommendCard = res
-				})
+				if(this.userInfos.userType==1){
+					req.getRequest('/api/visiting/card/userInfo',{},res=>{
+						this.recommendCard = res
+					})
+				}else{
+					if(this.userInfos.manageSaleNo){
+						req.getRequest('/api/visiting/card/recommendCardInfo',{},res=>{
+							this.recommendCard = res
+						})
+					}else{
+						this.recommendCard = ''
+					}
+				}
 			},
-			getAgeFn(date){
-				console.log('getAge',date)
-				return util.getAge(date)
+			monthDayDiff(date){
+				return util.monthDayDiff(date)
 			},
 			// 拨打电话
 			callPhone(val) {
@@ -486,6 +493,25 @@
 				req.getRequest('/api/my/count',{},res=>{
 					this.myCount = res
 				})
+			},
+			toCard(){
+				if(this.recommendCard){
+					if(this.recommendCard.auditState==0){
+						// 待审核
+						this.jumpUrl('card/success/success?state=0')
+						return false
+					}else if(this.recommendCard.auditState==1){
+						// 审核成功
+						this.jumpUrl('card/success/success?state=1')
+						return false
+					}else if(this.recommendCard.auditState==2){
+						// 审核失败
+						this.jumpUrl('card/success/success?state=2&&msg='+this.recommendCard.auditFailReason)
+						return false
+					}
+				}else{
+					this.jumpUrl('card/create/create')
+				}
 			}
 		},
 		created() {

BIN
static/images/setting.png


+ 2 - 3
utils/request.js

@@ -36,9 +36,7 @@ const publics = {
 	'storemanagers': 'https://websmall.zhiqiyun.com?appId=', //saas门店管理地址(智企云所有)
 	'channel': '', //处方中间渠道号  SAAS系统为空
 	'is_customer_pick_up': false,
-
-	// 'adGroupId': '1196269897935630352', //享团-宜得了
-	'mapLBSKEY': 'YQZBZ-6LMC4-IGQUO-XE64O-4UJL6-YNB77',
+	'mapLBSKEY': 'CBRBZ-5SHKL-3NCPX-EP5MQ-B57M6-CWFUU',
 	'iconSrc': 'red/',
 	'titleTopBgColor': '#FFF',
 	// 小程序ID  wxe7bec198ecfe1162
@@ -49,6 +47,7 @@ const publics = {
 	'xbrmCode': 'xiaobairumen', //小白入门
 	'tbalCode': 'toubaoanli', //投保案例
 	'lpalCode': 'lipeianli', //理赔案例
+	'gfdtCode':'gfdt',//官方动态
 
 }
 /*

+ 39 - 1
utils/util.js

@@ -475,6 +475,43 @@ function getAge(birthYearMonthDay) {
 	return age;
 }
 
+function monthDayDiff(birthYearMonthDay) {
+        let flag = [1, 3, 5, 7, 8, 10, 12, 4, 6, 9, 11, 2];
+        let start = new Date(birthYearMonthDay.replace(/-/g, '/'));
+        let end = new Date();
+        let year = end.getFullYear() - start.getFullYear();
+        let month = end.getMonth() - start.getMonth();
+        let day = end.getDate() - start.getDate();
+        if (month < 0) {
+            year--;
+            month = end.getMonth() + (12 - start.getMonth());
+        }
+        if (day < 0) {
+            month--;
+            let index = flag.findIndex((temp) => {
+                return temp === start.getMonth() + 1
+            });
+            let monthLength;
+            if (index <= 6) {
+                monthLength = 31;
+            } else if (index > 6 && index <= 10) {
+                monthLength = 30;
+            } else {
+                monthLength = 28;
+            }
+            day = end.getDate() + (monthLength - start.getDate());
+        }
+		if(year>0){
+			return `${year}年`;
+		}else if(month>0){
+			return `${month}月`;
+		}else if(day>0){
+			return `${day}天`;
+		}else{
+			return '0天'
+		}
+      }
+
 module.exports = {
 	formatTime: formatTime,
 	formatTimes: formatTimes,
@@ -493,5 +530,6 @@ module.exports = {
 	toDecimal: toDecimal,
 	captureTime: captureTime,
 	saveImage: saveImage,
-	getAge:getAge
+	getAge:getAge,
+	monthDayDiff:monthDayDiff
 };