Browse Source

消息列表修改

jwyu 3 years ago
parent
commit
90df70f807

+ 5 - 5
pages-approve/custome/detail.vue

@@ -379,10 +379,10 @@
 					];
 				}
 
-				//服务更新
-				if (info && contractInfo && info.CompanyApprovalDetail.ApplyMethod === 5) {
+				//续约申请/补充协议
+				if (info && contractInfo && (info.CompanyApprovalDetail.ApplyMethod === 5||info.CompanyApprovalDetail.ApplyMethod===6)) {
 					uni.setNavigationBarTitle({
-						title:'服务更新'
+						title:info.CompanyApprovalDetail.ApplyMethod === 5?'续约申请':'补充协议'
 					})
 					arr = [{
 							key: "合同编号",
@@ -539,8 +539,8 @@
 					});
 				}
 
-				//服务更新
-				if (info && contractInfo && info.CompanyApprovalDetail.ApplyMethod === 5) {
+				//续约申请/补充协议
+				if (info && contractInfo && (info.CompanyApprovalDetail.ApplyMethod === 5||info.CompanyApprovalDetail.ApplyMethod===6)) {
 					obj.title = "购买品种";
 					arr = contractInfo.PermissionList;
 					if (!arr) return obj;

+ 5 - 2
pages-approve/custome/list.vue

@@ -87,7 +87,7 @@
 						this.finished=true
 					}else{
 						let arr=res.data.List.map(item=>{
-							//申请类型:申请类型:1:试用->正式,2:冻结—>试用,3:试用延期,4:原销售申请领取流失客户,5:正式客户申请服务更新
+							//申请类型:申请类型:1:试用->正式,2:冻结—>试用,3:试用延期,4:原销售申请领取流失客户,5:续约申请,6:补充协议
 							let applyType=''
 							switch(item.ApplyMethod){
 								case 1:
@@ -103,8 +103,11 @@
 									applyType='原销售申领'
 									break;
 								case 5:
-									applyType='服务更新'
+									applyType='续约申请'
 									break;	
+								case 6:
+									applyType='补充协议'
+									break;
 							}
 							return {
 								title:item.CompanyName,

+ 85 - 29
pages-todomessages/list/list.vue

@@ -1,8 +1,10 @@
 <template>
+	<scroll-view scroll-y="true" :scroll-into-view="scrollViewId" @scrolltoupper="onScrollTop" style="height: 100vh;">
 	<view class="message-list-page">
-		<!-- <view class="top-time-box white-wrap">昨天 21:00</view> -->
 		<view class="list">
-			<view class="message-item flex" v-for="item in list" :key="item.Id">
+			<view class="message-item" v-for="item in list" :key="item.Id" :id="`msg${item.Id}`">
+				<view class="top-time-box white-wrap">{{item.msgTime}}</view>
+				<view class="flex">
 				<image :src="avatar" mode="aspectFill" style="width: 88rpx;height: 88rpx;"></image>
 				<view class="message-content">
 					<view style="color:#666;font-size: 12px;">审批小助手</view>
@@ -21,9 +23,11 @@
 						<image :src="item.statusImg" mode="aspectFill" class="status-img"></image>
 					</view>
 				</view>
+				</view>
 			</view>
 		</view>
 	</view>
+	</scroll-view>
 </template>
 
 <script>
@@ -40,6 +44,8 @@
 		},
 		data() {
 			return {
+				scrollViewId:'',
+
 				type: null, //类型对应的数字: 1客户(custome)、2合同(contract)、3用印(seal)
 				typeName:null,//类型对应的英文 客户(custome)、合同(contract)、用印(seal)
 				page: 1, //页码
@@ -53,21 +59,27 @@
 			this.initPage(options.type)
 			this.getList()
 		},
-		onPullDownRefresh() {
-			this.page=1
-			this.finished=false
-			this.list=[]
-			this.getList()
-			setTimeout(()=>{
-				uni.stopPullDownRefresh()
-			},1500)
-		},
-		onReachBottom() {
-			if(this.finished) return
-			this.page++
-			this.getList()
-		},
+		// onPullDownRefresh() {
+		// 	this.page=1
+		// 	this.finished=false
+		// 	this.list=[]
+		// 	this.getList()
+		// 	setTimeout(()=>{
+		// 		uni.stopPullDownRefresh()
+		// 	},1500)
+		// },
+		// onReachBottom() {
+		// 	if(this.finished) return
+		// 	this.page++
+		// 	this.getList()
+		// },
 		methods: {
+			onScrollTop(){
+				if(this.finished) return
+				this.page++
+				this.getList()
+			},
+
 			handleGoDetail(e){
 				if(this.typeName==='custome'){
 					uni.navigateTo({
@@ -114,18 +126,56 @@
 									statusName='已驳回'
 									break
 							}
+
+							// 处理消息时间
+							let msgTime=this.handleMsgTime(item.CreateTime)
 							return {
 								statusImg:statusImg,
 								statusName:statusName,
-								...item
+								...item,
+								msgTime:msgTime
 							}
 						})
-						this.list = [...this.list, ...arr]
+						this.$nextTick(()=>{
+							this.scrollViewId=`msg${res.data.List[0].Id}`
+						})
+						
+						let reArr=arr.reverse()
+						this.list = [...reArr,...this.list]
 					}
 					
 				}
 			},
 
+			handleMsgTime(e){
+				let timeStr=''
+				// 获取今日
+				const todayTime=new Date()
+
+
+				const time=new Date(e)
+				const year=time.getFullYear()
+				const month = time.getMonth() + 1 > 9 ? time.getMonth()+1 : '0'+(time.getMonth()+1);
+				const day = time.getDate() > 9 ? time.getDate() : "0" + time.getDate();
+				const hours=time.getHours() > 9 ? time.getHours():'0'+time.getHours()
+				const minutes=time.getMinutes()>9 ?time.getMinutes():'0'+time.getMinutes()
+				const seconds=time.getSeconds()>9?time.getSeconds():'0'+time.getSeconds()
+
+				if(year!=todayTime.getFullYear()||(time.getMonth()!=todayTime.getMonth())){
+					timeStr=`${year}.${month}.${day} ${hours}:${minutes}:${seconds}`
+				}else if(time.getDate()+1==todayTime.getDate()){
+					//昨天
+					timeStr=`昨天 ${hours}:${minutes}:${seconds}`
+				}else if(time.getDate()==todayTime.getDate()){
+					timeStr=`今天 ${hours}:${minutes}:${seconds}`
+				}else{
+					timeStr=`${year}.${month}.${day} ${hours}:${minutes}:${seconds}`
+				}
+				
+
+				return timeStr
+			},
+
 			// 初始化界面
 			initPage(type) {
 				
@@ -164,21 +214,27 @@
 		padding: 20rpx;
 	}
 	
-	.top-time-box{
-		margin-left: auto;
-		margin-right: auto;
-		width: 200rpx;
-		height: 50rpx;
-		line-height: 50rpx;
-		font-size: 12px;
-		text-align: center;
-		border-radius: 25rpx;
-	}
+	
 	.list{
 		padding: 0 36rpx 0 19rpx;
 		.message-item{
-			margin-top: 60rpx;
+			margin-top: 50rpx;
+		}
+		.top-time-box{
+			display: inline-block;
+			padding: 0 20rpx;
+			min-width: 200rpx;
+			height: 50rpx;
+			line-height: 50rpx;
+			font-size: 12px;
+			text-align: center;
+			border-radius: 25rpx;
+			position: relative;
+			left: 50%;
+			transform: translateX(-50%);
+			margin-bottom: 40rpx;
 		}
+		
 		.message-content{
 			margin-left: 20rpx;
 			flex: 1;

+ 21 - 18
pages/mine/index.vue

@@ -1,23 +1,29 @@
 <template>
 	<view class="mine-page white-wrap">
-		<view class="top-box">
-			<view class="avatar">
-				<open-data class="avatar" style="width: 100%;height: 100%;" type="userAvatarUrl"></open-data>
+		<view class="top-box flex">
+			<view>
+				<open-data class="avatar" type="userAvatarUrl"></open-data>
+			</view>
+			<view>
+				<view style="margin-bottom:10rpx">{{userInfo.RealName}}</view>
+				<view>ID:{{userInfo.AdminName}}</view>
 			</view>
 			
-			<!-- <image class="avatar" src="../../static/icon-1.png" mode="aspectFill"></image> -->
-			<text>{{userInfo.RealName}}</text>
 		</view>
 		
 		<view class="base-info-wrap white-wrap">
-			<view style="font-size: 16px;font-weight: bold;">基信息</view>
+			<view style="font-size: 16px;font-weight: bold;">基信息</view>
 			<view class="info-list">
 				<view class="info-item">
 					<text class="label">公司名称</text>
 					<text>弘则弥道(上海)投资咨询有限公司</text>
 				</view>
 				<view class="info-item">
-					<text class="label">职位</text>
+					<text class="label">所属部门</text>
+					<text></text>
+				</view>
+				<view class="info-item">
+					<text class="label">角色</text>
 					<text>{{userInfo.RoleName}}</text>
 				</view>
 			</view>
@@ -65,29 +71,26 @@
 		min-height: 100vh;
 	}
 	.top-box{
-		background-color: #FDF9F8;
-		text-align: center;
-		height: 400rpx;
-		padding-top: 60rpx;
+		background: linear-gradient(74deg, #7AB8FF 0%, #2457FF 100%);
+		height: 300rpx;
+		align-items: center;
 		font-size: 16px;
 		font-weight: bold;
-		line-height: 2;
+		color: #fff;
+		padding-left: 58rpx;
 		.avatar{
 			display: block;
-			margin-left: auto;
-			margin-right: auto;
+			margin-right: 20rpx;
 			width: 178rpx;
 			height: 178rpx;
 			border-radius: 50%;
 			overflow: hidden;
+			border: 4px solid #fff;
 		}
 	}
 	.base-info-wrap{
-		box-shadow: 0 -3rpx 0rpx rgba(212, 34, 34, 0.05);
-		border-radius: 32rpx 32rpx 0 0;
-		margin-top: -20rpx;
 		min-height: 200rpx;
-		padding: 60rpx 34rpx;
+		padding: 60rpx 30rpx 30rpx 58rpx;
 	}
 	
 	.info-list{

BIN
static/tabbar-icon-index-s.png


BIN
static/tabbar-icon-index.png


BIN
static/tabbar-icon-mine-s.png


BIN
static/tabbar-icon-mine.png


BIN
static/tabbar-icon-workbench-s.png


BIN
static/tabbar-icon-workbench.png