Przeglądaj źródła

修改群详情

zs 1 rok temu
rodzic
commit
87f9595a72

+ 30 - 11
pages/home/index.vue

@@ -9,11 +9,11 @@
 			</swiper>
 		</view>
 		<view class="two">
-			<uni-collapse>
+			<uni-collapse accordion>
 				<uni-collapse-item title="群组" :thumb="config.group_url[0].url">
-					<view class="content">
+					<view class="content" v-if="groupList.length>0">
 						<view class="two_1">
-							<input type="text" v-model="searchInfo.name" @input="toInput" placeholder="搜索">
+							<input type="text" v-model="searchgroup.name" @input="toInputGroup" placeholder="搜索">
 						</view>
 						<view class="list" v-for="(item, index) in groupList" :key="index">
 							<uni-list-chat :title="item.name" :avatar="item.doctor.icon[0].url||config.logo_url[0].url"
@@ -23,9 +23,9 @@
 					</view>
 				</uni-collapse-item>
 				<uni-collapse-item title="好友" :thumb="config.friend_url[0].url">
-					<view class="content">
+					<view class="content" v-if="friendList.length>0">
 						<view class="two_1">
-							<input type="text" v-model="searchInfo.name" @input="toInput" placeholder="搜索">
+							<input type="text" v-model="searchfriend.name" @input="toInputFriend" placeholder="搜索">
 						</view>
 						<view class="list" v-for="(item, index) in friendList" :key="index"
 							@tap="toInfo(item,'friend')">
@@ -48,7 +48,8 @@
 			return {
 				user: {},
 				config: {},
-				searchInfo: {},
+				searchgroup: {},
+				searchfriend: {},
 				// 广告
 				advertList: [],
 				// 群组
@@ -119,7 +120,7 @@
 				// 群组
 				res = await that.$api(`/group`, 'GET', {
 					...info,
-					...that.searchInfo
+					...that.searchgroup
 				})
 				if (res.errcode == '0') {
 					that.$set(that, `groupList`, res.data)
@@ -129,12 +130,30 @@
 					});
 				}
 				// 好友
+				res = await that.$api(`/chat/lcl`, 'GET', {
+					...info,
+					...that.searchfriend
+				})
+				if (res.errcode == '0') {
+					that.$set(that, `friendList`, res.data)
+				} else {
+					uni.showToast({
+						title: res.errmsg,
+					});
+				}
+			},
+			// 群组输入框
+			toInputGroup(e) {
+				const that = this;
+				if (that.searchgroup.name) that.$set(that.searchgroup, `name`, e.detail.value)
+				else that.$set(that, `searchgroup`, {})
+				that.search();
 			},
-			// 输入框
-			toInput(e) {
+			// 好友输入框
+			toInputFriend(e) {
 				const that = this;
-				if (that.searchInfo.name) that.$set(that.searchInfo, `name`, e.detail.value)
-				else that.$set(that, `searchInfo`, {})
+				if (that.searchfriend.name) that.$set(that.searchfriend, `name`, e.detail.value)
+				else that.$set(that, `searchfriend`, {})
 				that.search();
 			},
 			// 详情

+ 16 - 1
pages/my/index.vue

@@ -2,7 +2,7 @@
 	<view class="main">
 		<view class="one">
 			<view class="one_1">
-				<image class="image" :src="user.logo&&user.logo.length>0?user.logo[0].url:'../../static/doctor.jpg'"
+				<image class="image" :src="user.logo&&user.logo.length>0?user.logo[0].url:config.user_url[0].url"
 					mode=""></image>
 				<view class="right">
 					<text class="name">{{user.name||'微信用户'}}</text>
@@ -31,6 +31,7 @@
 		data() {
 			return {
 				user: {},
+				config: {},
 				// 菜单
 				menuList: []
 			}
@@ -41,6 +42,7 @@
 		},
 		onShow: async function(e) {
 			const that = this;
+			that.searchConfig();
 			that.searchToken();
 			await that.search();
 		},
@@ -58,6 +60,19 @@
 					});
 				}
 			},
+			searchConfig() {
+				const that = this;
+				try {
+					const res = uni.getStorageSync('config');
+					if (res) that.$set(that, `config`, res);
+				} catch (e) {
+					uni.showToast({
+						title: err.errmsg,
+						icon: 'error',
+						duration: 2000
+					});
+				}
+			},
 			// 查询
 			async search() {
 				const that = this;

+ 1 - 1
pages/science/index.vue

@@ -10,7 +10,7 @@
 						<view class="list_1">
 							<view class="left">
 								<image class="image"
-									:src="item.doctor.icon&&item.doctor.icon.length>0?item.doctor.icon[0].url:'../../static/doctor.jpg'"
+									:src="item.doctor.icon&&item.doctor.icon.length>0?item.doctor.icon[0].url:config.user_url[0].url"
 									mode="">
 								</image>
 								<text>{{item.doctor.name||'暂无'}}</text>

+ 211 - 6
pagesHome/group/index.vue

@@ -1,6 +1,55 @@
 <template>
 	<view class="main">
-		群组
+		<view class="one">
+			<view class="one_1">群组成员({{total||0}})</view>
+			<view class="one_2">
+				<view class="list" v-for="(item, index) in personList" :key="index" @tap="toChat(item)">
+					<view class="url">
+						<image class="image"
+							:src="item.icon&&item.icon.length>0?item.icon[0].url:config.user_url[0].url" mode="">
+						</image>
+					</view>
+					<view class="name textOne">{{item.name||'暂无姓名'}}</view>
+				</view>
+			</view>
+			<view class="one_3">
+				<view class="more" @tap="toMore">查看更多群成员 <text class="iconfont icon-dayuhao"></text></view>
+			</view>
+		</view>
+		<view class="two">
+			<view class="two_1">医生信息</view>
+			<view class="two_2">
+				<image class="image"
+					:src="doctorInfo.icon&&doctorInfo.icon.length>0?doctorInfo.icon[0].url:config.user_url[0].url"
+					mode="">
+				</image>
+				<view class="name textOver">姓名:{{doctorInfo.name||'暂无'}}</view>
+				<view class="other">
+					<view class="other_1 textOne">
+						<text>手机号:</text>{{doctorInfo.mobile||'暂无'}}
+					</view>
+					<view class="other_1 textOne">
+						<text>医院名称:</text>{{doctorInfo.hos_name||'暂无'}}
+					</view>
+					<view class="other_1 textOne">
+						<text>科室名称:</text>{{doctorInfo.dept_name||'暂无'}}
+					</view>
+					<view class="other_1 textOne">
+						<text>职称:</text>{{doctorInfo.post||'暂无'}}
+					</view>
+					<view class="other_1 textOne">
+						<text>职务:</text>{{doctorInfo.title||'暂无'}}
+					</view>
+					<view class="other_1 textOne">
+						<text>简介:</text>{{doctorInfo.content||'暂无'}}
+					</view>
+				</view>
+			</view>
+		</view>
+		<view class="thr">
+			<view class="thr_1">群简介</view>
+			<view class="thr_2">{{info.content||'暂无'}}</view>
+		</view>
 	</view>
 </template>
 
@@ -8,7 +57,15 @@
 	export default {
 		data() {
 			return {
-				id: ''
+				id: '',
+				config: {},
+				info: {},
+				// 群成员
+				personList: [],
+				doctorInfo: {},
+				total: 0,
+				skip: 0,
+				limit: 20,
 			}
 		},
 		onLoad: async function(e) {
@@ -17,12 +74,62 @@
 			uni.setNavigationBarTitle({
 				title: e && e.title || '群组'
 			});
-		},
-		onShow: async function(e) {
-			const that = this;
+			await that.searchConfig();
+			await that.search();
 		},
 		methods: {
-
+			searchConfig() {
+				const that = this;
+				try {
+					const res = uni.getStorageSync('config');
+					if (res) that.$set(that, `config`, res);
+				} catch (e) {
+					uni.showToast({
+						title: err.errmsg,
+						icon: 'error',
+						duration: 2000
+					});
+				}
+			},
+			async search() {
+				const that = this;
+				if (that.id) {
+					const res = await that.$api(`/group/${that.id}`, 'GET', {})
+					if (res.errcode == '0') {
+						that.$set(that, `info`, res.data)
+						that.$set(that, `total`, res.data.patients.length)
+						that.$set(that, `doctorInfo`, res.data.doctor)
+					} else {
+						uni.showToast({
+							title: res.errmsg,
+						});
+					}
+					// 群成员
+					let info = {
+						skip: that.skip,
+						limit: that.limit,
+						groupId: that.id
+					}
+					const arr = await that.$api(`/group/getPaitentList`, 'GET', {
+						...info
+					})
+					if (arr.errcode == '0') {
+						that.$set(that, `personList`, arr.data)
+					} else {
+						uni.showToast({
+							title: arr.errmsg,
+						});
+					}
+				}
+			},
+			// 聊天
+			toChat(item) {
+				console.log(item);
+			},
+			// 查看更多成员
+			toMore() {
+				console.log('查看更多成员');
+			},
 		}
 	}
 </script>
@@ -30,5 +137,103 @@
 <style lang="scss" scoped>
 	.main {
 		padding: 2vw;
+		background-color: var(--f9Color);
+
+		.one {
+			background-color: var(--mainColor);
+
+			.one_1 {
+				text-align: center;
+				padding: 2vw 0;
+				font-size: var(--font16Size);
+				font-weight: bold;
+			}
+
+			.one_2 {
+				display: flex;
+				flex-wrap: wrap;
+
+				.list {
+					display: flex;
+					flex-direction: column;
+					align-items: center;
+					width: 15vw;
+					margin: 2vw;
+
+					.image {
+						width: 15vw;
+						height: 15vw;
+						border-radius: 2vw;
+					}
+
+					.name {
+						margin: 1vw 0 0 0;
+						font-size: var(--font12Size);
+						color: var(--f85Color);
+					}
+				}
+			}
+
+			.one_3 {
+				.more {
+					text-align: center;
+					padding: 4vw;
+					font-size: var(--font14Size);
+					color: var(--f69Color);
+				}
+			}
+		}
+
+		.two {
+			padding: 2vw;
+			margin: 2vw 0;
+			background-color: var(--mainColor);
+
+			.two_1 {
+				font-size: var(--font16Size);
+				font-weight: bold;
+			}
+
+			.two_2 {
+				padding: 2vw 0;
+
+				.image {
+					width: 20vw;
+					height: 20vw;
+					border-radius: 2vw;
+				}
+
+				.name {
+					font-size: var(--font14Size);
+					font-weight: bold;
+				}
+
+				.other {
+					font-size: var(--font14Size);
+					color: var(--f69Color);
+
+					.other_1 {
+						margin: 1vw 0 0 0;
+					}
+				}
+			}
+		}
+
+		.thr {
+			padding: 2vw;
+			margin: 2vw 0;
+			background-color: var(--mainColor);
+
+			.thr_1 {
+				font-size: var(--font16Size);
+				font-weight: bold;
+			}
+
+			.thr_2 {
+				padding: 2vw 0;
+				font-size: var(--font14Size);
+				color: var(--f69Color);
+			}
+		}
 	}
 </style>

BIN
static/doctor.jpg


Plik diff jest za duży
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/pages/home/index.js.map


Plik diff jest za duży
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/pages/my/index.js.map


Plik diff jest za duży
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/pages/science/index.js.map


Plik diff jest za duży
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/pagesHome/group/index.js.map


+ 28 - 6
unpackage/dist/dev/mp-weixin/pages/home/index.js

@@ -139,11 +139,15 @@ var render = function () {
       g0: g0,
     }
   })
+  var g1 = _vm.groupList.length
+  var g2 = _vm.friendList.length
   _vm.$mp.data = Object.assign(
     {},
     {
       $root: {
         l0: l0,
+        g1: g1,
+        g2: g2,
       },
     }
   )
@@ -241,7 +245,8 @@ var _default = {
     return {
       user: {},
       config: {},
-      searchInfo: {},
+      searchgroup: {},
+      searchfriend: {},
       // 广告
       advertList: [],
       // 群组
@@ -359,7 +364,7 @@ var _default = {
                   // doctor: that.user._id,
                 }; // 群组
                 _context3.next = 8;
-                return that.$api("/group", 'GET', _objectSpread(_objectSpread({}, info), that.searchInfo));
+                return that.$api("/group", 'GET', _objectSpread(_objectSpread({}, info), that.searchgroup));
               case 8:
                 res = _context3.sent;
                 if (res.errcode == '0') {
@@ -370,7 +375,18 @@ var _default = {
                   });
                 }
                 // 好友
-              case 10:
+                _context3.next = 12;
+                return that.$api("/chat/lcl", 'GET', _objectSpread(_objectSpread({}, info), that.searchfriend));
+              case 12:
+                res = _context3.sent;
+                if (res.errcode == '0') {
+                  that.$set(that, "friendList", res.data);
+                } else {
+                  uni.showToast({
+                    title: res.errmsg
+                  });
+                }
+              case 14:
               case "end":
                 return _context3.stop();
             }
@@ -378,10 +394,16 @@ var _default = {
         }, _callee3);
       }))();
     },
-    // 输入框
-    toInput: function toInput(e) {
+    // 群组输入框
+    toInputGroup: function toInputGroup(e) {
+      var that = this;
+      if (that.searchgroup.name) that.$set(that.searchgroup, "name", e.detail.value);else that.$set(that, "searchgroup", {});
+      that.search();
+    },
+    // 好友输入框
+    toInputFriend: function toInputFriend(e) {
       var that = this;
-      if (that.searchInfo.name) that.$set(that.searchInfo, "name", e.detail.value);else that.$set(that, "searchInfo", {});
+      if (that.searchfriend.name) that.$set(that.searchfriend, "name", e.detail.value);else that.$set(that, "searchfriend", {});
       that.search();
     },
     // 详情

Plik diff jest za duży
+ 1 - 1
unpackage/dist/dev/mp-weixin/pages/home/index.wxml


+ 17 - 2
unpackage/dist/dev/mp-weixin/pages/my/index.js

@@ -185,6 +185,7 @@ var _default = {
   data: function data() {
     return {
       user: {},
+      config: {},
       // 菜单
       menuList: []
     };
@@ -219,10 +220,11 @@ var _default = {
           switch (_context2.prev = _context2.next) {
             case 0:
               that = this;
+              that.searchConfig();
               that.searchToken();
-              _context2.next = 4;
+              _context2.next = 5;
               return that.search();
-            case 4:
+            case 5:
             case "end":
               return _context2.stop();
           }
@@ -248,6 +250,19 @@ var _default = {
         });
       }
     },
+    searchConfig: function searchConfig() {
+      var that = this;
+      try {
+        var res = uni.getStorageSync('config');
+        if (res) that.$set(that, "config", res);
+      } catch (e) {
+        uni.showToast({
+          title: err.errmsg,
+          icon: 'error',
+          duration: 2000
+        });
+      }
+    },
     // 查询
     search: function search() {
       var _this = this;

Plik diff jest za duży
+ 1 - 1
unpackage/dist/dev/mp-weixin/pages/my/index.wxml


Plik diff jest za duży
+ 1 - 1
unpackage/dist/dev/mp-weixin/pages/science/index.wxml


Plik diff jest za duży
+ 157 - 21
unpackage/dist/dev/mp-weixin/pagesHome/group/index.js


Plik diff jest za duży
+ 1 - 1
unpackage/dist/dev/mp-weixin/pagesHome/group/index.wxml


+ 79 - 0
unpackage/dist/dev/mp-weixin/pagesHome/group/index.wxss

@@ -3,5 +3,84 @@
 /* 水平间距 */
 .main.data-v-1a2d2750 {
   padding: 2vw;
+  background-color: var(--f9Color);
+}
+.main .one.data-v-1a2d2750 {
+  background-color: var(--mainColor);
+}
+.main .one .one_1.data-v-1a2d2750 {
+  text-align: center;
+  padding: 2vw 0;
+  font-size: var(--font16Size);
+  font-weight: bold;
+}
+.main .one .one_2.data-v-1a2d2750 {
+  display: flex;
+  flex-wrap: wrap;
+}
+.main .one .one_2 .list.data-v-1a2d2750 {
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+  width: 15vw;
+  margin: 2vw;
+}
+.main .one .one_2 .list .image.data-v-1a2d2750 {
+  width: 15vw;
+  height: 15vw;
+  border-radius: 2vw;
+}
+.main .one .one_2 .list .name.data-v-1a2d2750 {
+  margin: 1vw 0 0 0;
+  font-size: var(--font12Size);
+  color: var(--f85Color);
+}
+.main .one .one_3 .more.data-v-1a2d2750 {
+  text-align: center;
+  padding: 4vw;
+  font-size: var(--font14Size);
+  color: var(--f69Color);
+}
+.main .two.data-v-1a2d2750 {
+  padding: 2vw;
+  margin: 2vw 0;
+  background-color: var(--mainColor);
+}
+.main .two .two_1.data-v-1a2d2750 {
+  font-size: var(--font16Size);
+  font-weight: bold;
+}
+.main .two .two_2.data-v-1a2d2750 {
+  padding: 2vw 0;
+}
+.main .two .two_2 .image.data-v-1a2d2750 {
+  width: 20vw;
+  height: 20vw;
+  border-radius: 2vw;
+}
+.main .two .two_2 .name.data-v-1a2d2750 {
+  font-size: var(--font14Size);
+  font-weight: bold;
+}
+.main .two .two_2 .other.data-v-1a2d2750 {
+  font-size: var(--font14Size);
+  color: var(--f69Color);
+}
+.main .two .two_2 .other .other_1.data-v-1a2d2750 {
+  margin: 1vw 0 0 0;
+}
+.main .thr.data-v-1a2d2750 {
+  padding: 2vw;
+  margin: 2vw 0;
+  background-color: var(--mainColor);
+}
+.main .thr .thr_1.data-v-1a2d2750 {
+  font-size: var(--font16Size);
+  font-weight: bold;
+}
+.main .thr .thr_2.data-v-1a2d2750 {
+  padding: 2vw 0;
+  font-size: var(--font14Size);
+  color: var(--f69Color);
 }