lhl01 6 days ago
parent
commit
d01038ba4f
5 changed files with 112 additions and 49 deletions
  1. 1 1
      pages.json
  2. 46 5
      pages/index/listModel.vue
  3. 11 0
      pages/student/myStudent.vue
  4. 1 1
      pages/student/studentDetail.vue
  5. 53 42
      pages/user/jf/give.vue

+ 1 - 1
pages.json

@@ -104,7 +104,7 @@
 			}],
 			"plugins" : {
 			    "chatbot" : {
-			        "version" : "1.5.6",
+			        "version" : "1.5.7",
 			        "provider" : "wx8c631f7e9f2465e1"
 			    }
 			}

+ 46 - 5
pages/index/listModel.vue

@@ -1,6 +1,6 @@
 <template>
 	<view class="content">
-		<map name="" :longitude="longitude" :latitude="latitude" class="map-wrap" :markers="markers"></map>
+		<map name="" :longitude="longitude" :latitude="latitude" class="map-wrap" :markers="markers" @markertap="tapMap"></map>
 		<view class="itemTip flex" @click="$refs.popup.open()">
 			<uni-icons type="bars" size="40rpx"></uni-icons>
 			筛选
@@ -247,6 +247,15 @@
 
 		},
 		methods: {
+			tapMap(e) {
+				console.log(e);
+				let that = this
+				const user = that.navList[that.currentIndex].list.find(item => item.uid == e.markerId)
+				console.log(user);
+				uni.navigateTo({
+					url:`/pages/user/model/model?type=2&uid=${user.uid}&mtype=${user.show_template_id}`
+				})
+			},
 			lookMore(item) {
 				this.latitude = item.latitude
 				this.longitude = item.longitude
@@ -338,14 +347,46 @@
 					longitude: that.longitude
 				})
 				res.data.list.forEach(item => {
-					that.markers.push({
+					let pdata = {
 						id: item.uid*1,
 						latitude: item.latitude || ( item.uid * 0.0001 + 28.9),
 						longitude: item.longitude || ( item.uid * 0.0001 + 120.44297),
-						iconPath:  item.is_tutor == 1 ? '/static/icon/zyds.png':   item.is_researcher == 1 ? "/static/icon/yjy.png" :'/static/icon/myjdw.png',
+						iconPath:'',
+						// iconPath:  item.is_tutor == 1 ? '/static/icon/zyds.png':   item.is_researcher == 1 ? "/static/icon/yjy.png" :'/static/icon/myjdw.png',
 						width: 35,
-						height: 35
-					})
+						height: 35,
+						callout: {}
+					}
+					if(item.is_researcher == 1) {
+						pdata.iconPath = item.avatar
+						pdata.width = 35
+						pdata.height = item.show_template_id > 6 ? 46: 35;
+						pdata.callout = {
+						    content: "研究员",
+						    color: "#ff629f",
+						    fontSize: 14,
+						    borderRadius: 4,
+						    bgColor: "#FFFFFF",
+						    padding: 6,
+						    display: "ALWAYS" // 或 "ALWAYS" 常显
+						  }
+					}else if(item.is_tutor == 1) {
+						pdata.iconPath = item.avatar
+						pdata.width = 35;
+						pdata.height = item.show_template_id > 6 ? 46: 35;
+						pdata.callout = {
+						    content: "职业导师",
+						    color: "#89572c",
+						    fontSize: 14,
+						    borderRadius: 4,
+						    bgColor: "#FFFFFF",
+						    padding: 6,
+						    display: "ALWAYS" // 或 "ALWAYS" 常显
+						  }
+					}else  {
+						pdata.iconPath = '/static/icon/myjdw.png'
+					}
+					that.markers.push(pdata)
 				})
 				item.list = item.list.concat(res.data.list)
 				item.page++

+ 11 - 0
pages/student/myStudent.vue

@@ -34,6 +34,7 @@
 					</view>
 				</view>
 				<view class="card-btn flex" v-if="item.status == 0 || item.status == 1">
+					<view class="btn agree" @click.stop="golook(index)">查看名片</view>
 					<template v-if="item.status == 0">
 						<view class="btn refuse" @click.stop="dealApply(index, 2)">拒绝</view>
 						<view class="btn agree" @click.stop="dealApply(index, 1)">同意</view>
@@ -43,6 +44,9 @@
 						<view class="btn refuse" @click.stop="goDk(index)">打卡记录</view>
 					</template>
 				</view>
+				<view class="card-btn flex" v-else>
+					<view class="btn agree" @click.stop="golook(index)">查看名片</view>
+				</view>
 			</view>
 			<empty v-if="navList[current].list.length == 0 && navList[current].loaded"></empty>
 			<uni-load-more v-else :status="navList[current].loading"></uni-load-more>
@@ -124,6 +128,13 @@
 			}
 		},
 		methods: {
+			golook(index) {
+				let that = this
+				const item = that.navList[that.current].list[index]
+				uni.navigateTo({
+					url:`/pages/user/model/model?type=2&uid=${item.researcher_uid}&mtype=${item.show_template_id}`
+				})
+			},
 			statusText(status) {
 				const map = {
 					0: '申请中',

+ 1 - 1
pages/student/studentDetail.vue

@@ -827,7 +827,7 @@
 				let tt = (type == 'upimg' ? 2 : 1)
 				this.onImg(tt).then((url) => {
 					uni.navigateTo({
-						url: `../realName/cropper?width=${w}&height=${h}`,
+						url: `/pages/user/realName/cropper?width=${w}&height=${h}`,
 						events: {
 							uploadSuccess(res) {
 								that.upLoad(res).then((urldata) => {

+ 53 - 42
pages/user/jf/give.vue

@@ -7,7 +7,7 @@
 
 		<view class="form-box">
 			<view class="form-item">
-				<text class="label">收款人UID</text>
+				<text class="label">收款人UID/手机号</text>
 				<input
 					class="input"
 					type="number"
@@ -17,7 +17,7 @@
 				/>
 			</view>
 
-			<view class="user-card" v-if="targetUser">
+			<!-- <view class="user-card" v-if="targetUser">
 				<image
 					class="avatar"
 					:src="targetUser.avatar || 'https://api.myjie.cn/static/img/logo.png'"
@@ -27,13 +27,13 @@
 					<text class="nickname">{{ targetUser.nickname || '微信用户' }}</text>
 					<text class="uid">UID:{{ targetUser.uid }}</text>
 				</view>
-			</view>
-			<view class="user-tip" v-else-if="keyword && searched && !searching">
+			</view> -->
+			<!-- <view class="user-tip" v-else-if="keyword && searched && !searching">
 				<text>未找到该用户,请检查UID</text>
-			</view>
-			<view class="user-tip" v-else-if="searching">
+			</view> -->
+			<!-- <view class="user-tip" v-else-if="searching">
 				<text>搜索中...</text>
-			</view>
+			</view> -->
 
 			<view class="form-item">
 				<text class="label">转账积分</text>
@@ -149,7 +149,7 @@
 			submit() {
 				const that = this;
 				if (that.submitting) return;
-
+				
 				if (!that.keyword) {
 					return that.$api.msg('请输入收款人UID');
 				}
@@ -159,7 +159,9 @@
 				if (String(that.keyword) === String(that.userInfo.uid)) {
 					return that.$api.msg('不能给自己转账');
 				}
-
+				if (String(that.keyword) === String(that.userInfo.mobile)) {
+					return that.$api.msg('不能给自己转账');
+				}
 				const score = parseInt(that.score, 10);
 				if (!score || score <= 0 || String(score) !== String(that.score).trim()) {
 					return that.$api.msg('请输入有效的整数积分');
@@ -167,42 +169,51 @@
 				if (score > Number(that.userInfo.score || 0)) {
 					return that.$api.msg('积分余额不足');
 				}
-
-				uni.showModal({
-					title: '确认转账',
-					content: `向「UID:${that.keyword}」转账 ${score} 积分?`,
-					success(res) {
-						if (!res.confirm) return;
-						that.submitting = true;
-						const payload = {
-							to_uid: that.keyword,
-							score
-						};
-						if (that.mono && that.mono.trim()) {
-							payload.mono = that.mono.trim();
-						}
-						scoreTransfer(payload)
-							.then(() => {
-								that.$api.msg('转账成功');
-								that.score = '';
-								that.mono = '';
-								that.refreshUserInfo();
-								setTimeout(() => {
-									uni.navigateBack({
-										fail() {
-											uni.redirectTo({
-												url: '/pages/user/jf/bill'
+				searchTransferUser({keyword:that.keyword}).then(ress => {
+					if(ress.data.list && ress.data.list.length > 0) {
+						let user = ress.data.list[0]
+						uni.showModal({
+							title: '确认转账',
+							content: `向「${user.nickname || '微信用户'}(UID:${user.uid})」转账 ${score} 积分?`,
+							success(res) {
+								if (!res.confirm) return;
+								that.submitting = true;
+								const payload = {
+									to_uid: user.uid,
+									score
+								};
+								if (that.mono && that.mono.trim()) {
+									payload.mono = that.mono.trim();
+								}
+								scoreTransfer(payload)
+									.then(() => {
+										that.$api.msg('转账成功');
+										that.score = '';
+										that.mono = '';
+										that.refreshUserInfo();
+										setTimeout(() => {
+											uni.navigateBack({
+												fail() {
+													uni.redirectTo({
+														url: '/pages/user/jf/bill'
+													});
+												}
 											});
-										}
+										}, 1200);
+									})
+									.catch(() => {})
+									.finally(() => {
+										that.submitting = false;
 									});
-								}, 1200);
-							})
-							.catch(() => {})
-							.finally(() => {
-								that.submitting = false;
-							});
+							}
+						});
 					}
-				});
+
+				})
+				
+				
+
+				
 			}
 		}
 	};