Administrator 4 年之前
父节点
当前提交
2fcacf3c52
共有 3 个文件被更改,包括 762 次插入4 次删除
  1. 12 4
      supplier/pages/user/information.vue
  2. 165 0
      supplier/pages/user/operator/addoperator.vue
  3. 585 0
      supplier/pages/user/operator/list.vue

+ 12 - 4
supplier/pages/user/information.vue

@@ -77,10 +77,10 @@
 			<view class="zizhi" v-if="issecondshow">
 				<view class="info-title">资质</view>
 				<view class="uploadImage">
-					 <view class="form-upload-image"  >
-						   <image class="upload-img" src="" alt=""  @click="showViewerbigImage()"></image>
-						   <i class="icon mIcon" @click="deleteMedicalImage()"></i>
-					 </view>
+					 <!-- <view class="form-upload-image"  >
+						   <image class="upload-img" src="https://admin-b.caimei365.com/userfiles/1/images/photo/2020/11/15.jpg" alt=""  @click="showViewerbigImage()"></image>
+						   <i class="iconfont icon-shanchu1" @click="deleteMedicalImage()"></i>
+					 </view> -->
 					 <view class="formLine-file" >
 						   <input ref="medicalPracticeLicenseImg1" class="file" type="file" accept="image/png,image/jpeg,image/gif,image/jpg"  @change="uploadzizhiImageFn">
 						   <view class="file-zizhi"></view>
@@ -263,6 +263,7 @@
 		 overflow: hidden;
 		 height: auto;
 		 padding: 0 24rpx;
+		 margin-bottom: 20rpx;
 		 color: #999999;
 		 .radio{
 				float: left;
@@ -277,4 +278,11 @@
 				}
 			}
 	 }
+	 .zizhi{
+		.info-title{
+			padding-left: 24rpx;
+			font-size: $font-size-28;
+			color: #999999;
+		} 
+	 }
 </style>

+ 165 - 0
supplier/pages/user/operator/addoperator.vue

@@ -0,0 +1,165 @@
+<template>
+	<view class="container operator clearfix">
+		<view class="operator-content">
+			<view class="operator-from">
+				<view class="from-row">
+					<input class="input" type="text" v-model="linkman" placeholder="请输入运营人员姓名" maxlength="6"/>
+				</view>
+				<view class="from-row">
+					<input class="input" type="text" v-model="clubMobile" placeholder="请输入运营人员手机号" maxlength="11"/>
+				</view>
+				<button class="add-btn" @click="confirm">确定</button>
+			</view>
+			<view class="operator-text">
+				<view class="text-main">
+					<view>1. 添加运营人员后,运营人员会收到一条邀请码短信</view>
+					<view>2. 运营人员在微信搜索【采美采购商城】小程序,或者搜索关注【采美365】公众号,从底部菜单进入【采美采购商城】小程序</view>
+					<view>3. 使用邀请码进行登录并绑定微信</view>
+					<view>4. 绑定后,运营人员可通过微信直接登录采美365网</view>
+				</view>
+			</view>
+		</view>
+	</view>
+</template>
+
+<script>	
+	import authorize from '@/common/config/authorize.js'	
+	import { addOperator } from "@/api/operator.js"
+	
+	export default {
+		data() {
+			return {
+				clubID:'',
+				userID:'',
+				linkman:'',
+				clubMobile:'',
+			}
+		},
+		onLoad(option){
+			
+		},
+		methods: {			
+			//提交
+			confirm(){
+				let data = this.addressData;
+				if(this.linkman== ''){
+					this.$util.msg('请输入运营人员姓名');
+					return;
+				}
+				if(this.clubMobile == ''){
+					this.$util.msg('请输入运营人员手机号');
+					return;
+				}
+				if(!/(^1[0-9][0-9]{9}$)/.test(this.clubMobile)){
+					this.$util.msg('请输入正确的手机号码');
+					return;
+				}
+				let params = {
+						mobile:this.clubMobile,
+						linkName:this.linkman,
+						userID:this.userID,
+						clubID:this.clubID,
+						configFlag:2
+					}
+				addOperator(params).then(response =>{
+					this.$util.msg('添加成功',2000,true,'success')
+					setTimeout(() =>{
+						uni.navigateBack();
+					},2000)
+				}).catch(error =>{
+					this.$util.msg(error.msg,2000);
+				})
+			}
+		},
+		onShow() {
+			this.$api.getStorage().then((resolve) =>{
+				this.userID = resolve.userID
+				this.clubID = resolve.clubID
+			})
+		}
+	}
+</script>
+
+<style lang="scss">
+	page{
+		height: auto;
+		background: $bg-color;
+		border-top: 1px solid #EBEBEB;
+	}
+	.operator{
+		padding-top: 160rpx;
+		.operator-content{
+			width: 702rpx;
+			padding:0 24rpx;
+			.operator-from{
+				width: 100%;
+				height: auto;
+				.from-row{
+					height: 40rpx;
+					padding: 24rpx;
+					background: #F7F7F7;
+					border-radius: 14rpx;
+					margin-bottom: 20rpx;
+					font-size: $font-size-28;
+					color: $text-color;
+					.input{
+						width: 100%;
+						height: 100%;
+						text-align: left;
+					}
+				}
+			}
+			.operator-text{
+				width: 100%;
+				height: auto;
+				margin-top: 50rpx;
+				line-height: 40rpx;
+				.title{
+					margin-bottom: 50rpx;
+					.icon-gantanhao-yuankuang{
+						font-size: $font-size-32;
+						color: #166CE1;
+						margin-right: 10rpx;
+					}
+					.text-m{
+						font-size: $font-size-30;
+						color: #166CE1;
+					}
+					.text-s{
+						font-size: $font-size-24;
+						color: #999999;
+					}
+				}
+				.text-main{
+					width: 100%;
+					height: auto;
+					view{
+						line-height: 40rpx;
+						font-size: $font-size-28;
+						color: $text-color;
+						text-align: justify;
+						margin-bottom: 10rpx;
+					}
+				}
+			}
+			
+		}
+		.add-btn{
+			width: 702rpx;
+			height: 88rpx;
+			font-size: $font-size-28;
+			line-height: 88rpx;
+			color: #FFFFFF;
+			margin: 0 auto;
+			text-align: center;
+			background: $btn-confirm;
+			border-radius: 14rpx;
+			margin-top: 80rpx;
+		}
+		.add-btn.disabled{
+			background: #F8F8F8;
+			border-radius: 14rpx;
+		}
+	}
+</style>
+

+ 585 - 0
supplier/pages/user/operator/list.vue

@@ -0,0 +1,585 @@
+<template>
+	<view class="container operator clearfix">
+		<view class="operator-top clearfix">
+			<view class="operator-title">
+				<view class="head"><image :src="clubImage == null ? '../../../static/temp/icon-club@3x.png' : clubImage" mode=""></image></view>
+				<view class="title">{{clubName}}</view>
+			</view>
+			<view class="operator-search">
+				<view class="search-wrap">
+					<view class="search-from name">
+						<input class="input" type="text" v-model="linkman" placeholder="请输入姓名" maxlength="6"/>
+					</view>
+					<view class="search-from phone">
+						<input class="input" type="text" v-model="clubMobile" placeholder="请输入手机号" maxlength="11"/>
+					</view>
+					<view class="search-from search">
+						<button class="search-btn" type="default" @click.stop="searchOpertor">搜索</button>
+					</view>
+				</view>
+			</view>
+		</view>
+		<view class="operator-main">
+			<view v-if="isEmpty" class="empty-container">
+				<view class="txt">暂无运营人员</view>
+			</view>
+			<view v-else class="operator-list">
+				<scroll-view scroll-y="true" >
+					<view class="list" v-for="(item, index) in operatorList" :key="index" @click.stop="showOperatorModel(item)">
+						<view class="list-left">
+							<view class="list-head"><image :src="item.headimgurl ? item.headimgurl : '../../../static/temp/icon-seller@3x.png'" mode=""></image></view>
+							<view class="list-tel">
+								<text class="txt">{{item.linkName}}</text>
+								<text class="txt">{{item.mobile}}</text>
+							</view>
+						</view>
+						<view class="list-opea">
+							<view class="opea-type">
+								<view class="opea-type-cell" v-if="item.effectiveFlag != null">
+									<text class="iconfont icon-iconfontweixin" :style="{color: iconStautsColor(item.status)}"></text>
+									<text :style="{color: rexpStautsColor(item.effectiveFlag)}">{{ rexpStautsText(item.effectiveFlag) }}</text>
+								</view>
+								<view class="opea-type-cell none" v-else>
+									<text>- -</text>
+								</view>
+							</view>
+							<view class="opea-del">
+								<view class="opea-type-cell" @click.stop="deleteOperator(item.id)">
+									<text class="iconfont icon-shanchu"></text>
+									<text>删除</text>
+								</view>
+							</view>
+						</view>
+					</view>
+					<!--加载loadding-->
+					<tui-loadmore :visible="loadding" :index="3" type="black"></tui-loadmore>
+					<tui-nomore :visible="!pullUpOn" bgcolor="#F7F7F7" :text='nomoreText'></tui-nomore>
+					<!--加载loadding-->
+				</scroll-view>
+			</view>
+		</view>
+		<div class="operator-btn" :style="{paddingBottom :isIphoneX ? '68rpx' : '0rpx'}">
+			<view class="add-btn" @click="this.$api.navigateTo('/pages/user/operator/addoperator')">添加运营人员</view>
+		</div>
+		<view class="operator-model" v-if="isOperatorModel" @click.stop="closeModel">
+			<view class="operator-alert">
+				<text class="iconfont icon-iconfontguanbi" @click.stop="closeModel"></text>
+				<view class="content">
+					<view class="ciew-t">姓名:{{modelData.linkName}}</view>
+					<view class="ciew-t">手机号:{{modelData.mobile}}</view>
+					<view class="ciew-t">邀请码:{{modelData.invitationCode ? modelData.invitationCode : '无'}}<text :style="{color: rexpStautsColor(modelData.status)}">{{modelStautsText(modelData.effectiveFlag)}}</text></view>
+					<view class="ciew-t">邀请码有效期:{{modelData.effectiveDays}}天</view>
+					<view class="ciew-t">状态:{{modelData.status == '2' ? '已绑定' : '未绑定'}}</view>
+					<view class="ciew-t">添加时间:{{modelData.addTime}}</view>
+					<view class="ciew-t">绑定时间:{{modelData.bindTime == null ? '无' : modelData.bindTime }}</view>
+				</view>
+				<view class="btn" v-if="modelData.status != '2'" @click.stop="updateInvitationCode(modelData)">更新邀请码</view>
+			</view>
+		</view>
+	</view>
+</template>
+
+<script>
+	import authorize from '@/common/config/authorize.js'	
+	import tuiLoadmore from "@/components/tui-components/loadmore/loadmore"
+	import tuiNomore from "@/components/tui-components/nomore/nomore"
+	
+	import { queryOperatorList, deleteOperator , updateCode } from "@/api/operator.js"
+	export default {
+		components:{
+			tuiLoadmore,
+			tuiNomore,
+		},
+		data() {
+			return {
+				clubID:'',
+				clubName:'',
+				clubImage:'',
+				linkman:'',
+				clubMobile:'',
+				isEmpty:false,
+				nomoreText: '上拉显示更多',
+				userID:'',
+				pageNum:1,
+				pageSize:10,
+				hasNextPage:false,
+				loadding: false,
+				pullUpOn: true,
+				pullFlag: true,
+				allowDataStatus:true,
+				wrapperHeight:'100%',
+				scrollHeight:'',
+				deleteAddressId:'',
+				currPage:'',//当前页面
+				prevPage:'',//上一个页面
+				isOperatorModel:false,
+				operatorList:[],
+				isIphoneX:this.$store.state.isIphoneX,
+				modelData:''
+			}
+		},
+		onLoad(){				
+			this.setScrollHeight();
+		},
+		methods: {
+			setScrollHeight() {
+				// 窗口高度 - 底部距离
+				setTimeout(()=> {
+					const query = wx.createSelectorQuery().in(this);
+					query.selectAll('.add-btn').boundingClientRect();
+					query.exec(res => {
+						if(res[0][0]){
+							let winHeight = this.$api.getWindowHeight(),
+								eleTop = res[0][0].top - 1;
+								this.scrollHeight =  eleTop;
+						}
+					})
+				}, 500)
+			},
+			searchOpertor(){
+				this.pageNum=1
+				this.initOperatorList()
+			},
+			initOperatorList(){	
+				let params = {clubID:this.clubID,pageNum:1,pageSize:this.pageSize,linkName:this.linkman,mobile:this.clubMobile}
+				queryOperatorList(params).then(response =>{
+					let responseData = response.data
+					if(responseData.results&&responseData.results.length > 0){
+						this.isEmpty = false
+						this.hasNextPage = response.data.hasNextPage
+						this.operatorList =responseData.results
+						this.pullFlag = false;
+						setTimeout(()=>{this.pullFlag = true;},500)
+						if(this.hasNextPage){
+							this.pullUpOn = false
+							this.nomoreText = '上拉显示更多'
+						}else{
+							this.pullUpOn = true
+							this.loadding = false
+							this.nomoreText = '已至底部'
+						}
+					}else{
+						this.isEmpty = true
+					}
+				}).catch(error =>{
+					this.$util.msg(error.msg,2000)
+				})
+			},	
+			getOnReachBottomData(){
+				this.pageNum+=1
+				let params = {pageNum:this.pageNum,pageSize:this.pageSize,linkName:this.linkman,mobile:this.clubMobile}
+				queryOperatorList(params).then(response =>{
+					let responseData = response.data
+					if(responseData.results&&responseData.results.length > 0){
+						this.hasNextPage = response.data.hasNextPage
+						this.operatorList = this.operatorList.concat(responseData.results) 
+						this.pullFlag = false;// 防上拉暴滑
+						setTimeout(()=>{this.pullFlag = true;},500)
+						if(this.hasNextPage){
+							this.pullUpOn = false
+							this.nomoreText = '上拉显示更多'
+						}else{
+							this.pullUpOn = false
+							this.loadding = false
+							this.nomoreText = '已至底部'
+						}
+					}
+				}).catch(error =>{
+					this.$util.msg(error.msg,2000)
+				})
+			},
+			showOperatorModel(item){
+				this.isOperatorModel = true
+				this.modelData = item
+			},
+			closeModel(){
+				this.isOperatorModel = false
+			},
+			deleteOperator(id){//删除运营人员
+				this.$util.modal('','确定删除运营人员吗?','确定删除','取消',true,() =>{
+					deleteOperator({id:id}).then(response =>{
+						this.$util.msg('删除成功',2000,true,'success')
+						this.initOperatorList()
+					}).catch(error =>{
+						this.$util.msg(error.msg,2000)
+					})
+				})
+			},
+			updateInvitationCode(item){	//更新邀请码	
+				this.$util.modal('','确定更新邀请码并发送给运营人员?','确定更新','取消',true,() =>{
+					updateCode({id:item.id,status:item.status}).then(response =>{
+						this.$util.msg('更新邀请码成功',2000)
+						this.isOperatorModel = false
+						this.initOperatorList()
+					}).catch(error =>{
+						this.$util.msg(error.msg,2000)
+					})
+				})
+			},
+			rexpStautsText(n) {
+			      let text = ''
+			      switch (n) {
+					case '':
+						text = '--'
+						break
+			        case '1':
+			          text = '邀请码有效'
+			          break
+			        case '2':
+			          text = '邀请码已使用'
+			          break
+			        case '3':
+			          text = '邀请码已过期'
+			          break
+			      }
+			      return text
+			},
+			modelStautsText(n) {
+			      let text = ''
+			      switch (n) {
+			        case '1':
+			          text = '(有效)'
+			          break
+			        case '2':
+			          text = '(已使用)'
+			          break
+			        case '3':
+			          text = '(已过期)'
+			          break
+			      }
+			      return text
+			},
+			rexpStautsColor(status) {
+			  let textColor = ''
+			  switch (status) {
+				case '1':
+				  textColor = '#55BB00'
+				  break
+				case '2':
+				  textColor = '#0056BB'
+				  break
+				case '3':
+				  textColor = '#BB0000'
+				  break
+			  }
+			  return textColor
+			},  
+			iconStautsColor(status) {
+			  let textColor = ''
+			  if(status == '2'){
+				   textColor = '#09BB07'
+			  }else{
+				   textColor = '#DDDDDD'
+			  }
+			  return textColor
+			},
+		},
+		onReachBottom() {
+			if(this.hasNextPage){
+				this.loadding = true
+				this.pullUpOn = true
+				this.getOnReachBottomData()
+			}	
+		},
+		onShow() {
+			this.$api.getComStorage('clubInfo').then(response =>{
+				this.clubID = response.clubID
+				this.clubName = response.name
+				this.clubImage = response.image
+				this.pageNum = 1;
+				this.initOperatorList();
+			})
+		}
+	}
+</script>
+
+<style lang='scss'>
+	page {
+		height: auto;
+	}
+	page,.container{
+		/* padding-bottom: 120upx; */
+		background: #F7F7F7;
+		border-top: 1px solid #EBEBEB;
+	}
+	.container{
+		position: relative;
+	}
+	.operator-top{
+		width: 702rpx;
+		padding: 0 24rpx;
+		height: 282rpx;
+		background: #FFFFFF;
+		position:fixed ;
+		top: 0;
+		left: 0;
+		z-index: 999;
+		.operator-title{
+			width: 100%;
+			height: 92rpx;
+			padding: 34rpx 0;
+			.title{
+				width: 420rpx;
+				float: left;
+				font-size: $font-size-32;
+				color: $text-color;
+				line-height: 92rpx;
+				text-align: left;
+				margin-left: 20rpx;
+				-o-text-overflow: ellipsis;
+				text-overflow: ellipsis;
+				display: -webkit-box;
+				word-break: break-all;
+				-webkit-box-orient: vertical;
+				-webkit-line-clamp: 1;
+				overflow: hidden;
+			}
+			.head{
+				width: 92rpx;
+				height: 92rpx;
+				border-radius: 14rpx;
+				border: 1px solid #ebebeb;
+				float: left;
+				image{
+					width: 92rpx;
+					height: 92rpx;
+					border-radius: 14rpx;
+				}
+			}
+		}
+		.operator-search{
+			width: 100%;
+			height: auto;
+			.search-from{
+				width: 300rpx;
+				height: 40rpx;
+				padding: 20rpx;
+				background: $sub-bg-color;
+				border-radius: 14rpx;
+				position: relative;
+				margin-bottom: 20rpx;
+				float: left;
+				&.name{
+					width: 180rpx;
+					margin-right: 20rpx;
+					.input{
+						width: 180rpx;
+						font-size: $font-size-28;
+						color: $text-color;
+						line-height: 40rpx;
+						float: left;
+						height: 40rpx;
+					}
+				}
+				&.phone{
+					width: 228rpx;
+					margin-right: 20rpx;
+					.input{
+						width: 228rpx;
+						padding-left:10rpx;
+						font-size: $font-size-28;
+						color: $text-color;
+						line-height: 40rpx;
+						float: left;
+						height: 40rpx;
+					}
+				}
+				&.search{
+					width: 175rpx;
+					padding: 0;
+					background: #FFFFFF;
+					.search-btn{
+						width: 170rpx;
+						height: 78rpx;
+						border-radius: 14rpx;
+						font-size: $font-size-28;
+						color: #FFFFFF;
+						line-height: 78rpx;
+						background: $btn-confirm;
+					}
+				}
+				.label{
+					text-align: left;
+					font-size: $font-size-28;
+					color:$text-color;
+					line-height: 40rpx;
+					float: left;
+				}
+				
+			}
+			
+		}
+	}
+	.operator-main{
+		padding-top: 282rpx;
+		padding-bottom: 120rpx;
+	}
+	.list{
+		display: flex;
+		align-items: center;
+		width: 702rpx;
+		height: 92rpx;
+		padding: 24rpx;
+		background: #FFFFFF;
+		position: relative;
+		border-bottom: 1px solid #EBEBEB;
+		.list-left{
+			display: flex;
+			flex: 4;
+			.list-head{
+				width: 92rpx;
+				height: 92rpx;
+				border-radius: 14rpx;
+				image{
+					width: 92rpx;
+					height: 92rpx;
+					border-radius: 14rpx;
+				}
+			}
+			.list-tel{
+				margin-left: 18rpx;
+				.txt{
+					display: flex;
+					flex: 1;
+					font-size: $font-size-28;
+					color: $text-color;
+					line-height: 46rpx;
+				}
+			}
+		}
+		.list-opea{
+			flex:6;
+			.opea-type{
+				flex-direction: column;
+				align-items: center;
+				margin-left: 35rpx;
+				float: left;
+				.opea-type-cell{
+					width: 186rpx;
+					height: 64rpx;
+					padding:0 16rpx;
+					border-radius: 10rpx;
+					border: 1px solid #DDDDDD;
+					line-height: 64rpx;
+					font-size: $font-size-24;
+					.icon-iconfontweixin{
+						margin-right: 8rpx;
+						font-size: $font-size-32;
+					}
+					&.none{
+						text-align: center;
+					}
+				}
+			}
+			.opea-del{
+				float: right;
+				flex-direction: column;
+				align-items: center;
+				.opea-type-cell{
+					width: 86rpx;
+					height: 64rpx;
+					padding:0 24rpx;
+					border-radius: 10rpx;
+					border: 1px solid #DDDDDD;
+					line-height: 64rpx;
+					font-size: $font-size-24;
+					color: #FF0000;
+					.icon-shanchu{
+						font-size: $font-size-32;
+						margin-right: 6rpx;
+					}
+				}
+			}
+		}
+	}
+	.operator-model{
+		width: 100%;
+		height: 100%;
+		background: rgba(0,0,0,.1);
+		position: fixed;
+		top: 0;
+		left: 0;
+		bottom: 0;
+		right: 0;
+		margin: auto;
+		z-index: 1000;
+		.operator-alert{
+			width: 435rpx;
+			height: 360rpx;
+			padding: 68rpx 32rpx;
+			background: #FFFFFF;
+			border-radius: 14rpx;
+			position: absolute;
+			top: 0;
+			left: 0;
+			bottom: 0;
+			right: 0;
+			margin: auto;
+			z-index: 1001;
+			.icon-iconfontguanbi{
+				width: 68rpx;
+				height: 68rpx;
+				text-align: center;
+				line-height: 68rpx;
+				position: absolute;
+				right: 0;
+				top: 0;
+				font-size: $font-size-36;
+				color: #999999;
+			}
+			.content{
+				.ciew-t{
+					font-size: $font-size-28;
+					color: $text-color;
+					line-height: 48rpx;
+				}
+			}
+			.btn{
+				width: 100%;
+				height: 68rpx;
+				border-top: 1px solid #F7F7F7;
+				line-height: 68rpx;
+				font-size: $font-size-26;
+				text-align: center;
+				color: $color-system;
+				position: absolute;
+				bottom:0 ;
+				left: 0;
+			}
+		}
+	}
+	.operator-btn{
+		position: fixed;
+		width: 100%;
+		height: 140rpx;
+		left: 0;
+		bottom: 0;
+		background: #FFFFFF;
+		z-index: 95;
+		display: flex;
+		align-items: center;
+		justify-content: center;
+		.add-btn{
+			width: 702rpx;
+			height: 88rpx;
+			font-size: $font-size-28;
+			line-height: 88rpx;
+			color: #FFFFFF;
+			text-align: center;
+			background: $btn-confirm;
+			border-radius: 14rpx;
+		}
+	}
+	.adds-btn{
+		width: 702rpx;
+		height: 88rpx;
+		font-size: 28rpx;
+		line-height: 88rpx;
+		color: #FFFFFF;
+		margin: 0 auto;
+		text-align: center;
+		background: #000000;
+		border-radius: 14rpx;
+	}
+</style>
+