Bläddra i källkod

修改首页显示

zs 1 år sedan
förälder
incheckning
3f968aa61f

+ 12 - 20
pages/home/index.vue

@@ -9,7 +9,7 @@
 			</swiper>
 		</view>
 		<view class="two" v-if="user.role!='Patient'">
-			<uni-collapse accordion>
+			<uni-collapse>
 				<uni-collapse-item title="群组" :thumb="config.group_url[0].url">
 					<view class="content" v-if="groupList.length>0">
 						<view class="two_1">
@@ -51,13 +51,13 @@
 				</view>
 				<view class="list" v-for="(item, index) in groupList" :key="index">
 					<uni-list-chat v-if="item.notRead==0" :title="item.name||''"
-						:avatar="item.doctor.icon[0].url||config.logo_url[0].url" :note="item.content||''" :time="item.doctor.name||''"
-						link="navigateTo" @click="toInfo(item,'group')">
+						:avatar="item.doctor.icon[0].url||config.logo_url[0].url" :note="item.content||''"
+						:time="item.doctor.name||''" link="navigateTo" @click="toInfo(item,'group')">
 					</uni-list-chat>
 					<uni-list-chat v-else :title="item.name||''"
-						:avatar="item.doctor.icon[0].url||config.logo_url[0].url" :note="item.content||''" :time="item.doctor.name||''"
-						link="navigateTo" badge-positon="left" :badge-text="item.notRead||''"
-						@click="toInfo(item,'group')">
+						:avatar="item.doctor.icon[0].url||config.logo_url[0].url" :note="item.content||''"
+						:time="item.doctor.name||''" link="navigateTo" badge-positon="left"
+						:badge-text="item.notRead||''" @click="toInfo(item,'group')">
 					</uni-list-chat>
 				</view>
 			</view>
@@ -78,9 +78,7 @@
 				// 群组
 				groupList: [],
 				// 好友
-				friendList: [{
-					id: '1'
-				}]
+				friendList: []
 			}
 		},
 		onShow: async function() {
@@ -141,10 +139,11 @@
 				if (res.errcode == '0') {
 					// 处理显示数据
 					for (let val of res.data) {
-						if (val.chat.type == 'image') val.content = '[图片]'
-						if (val.chat.type == 'record') val.content = '[语音]'
-						else val.content = val.chat.content
-						val.time = that.formatDate(val.time)
+						if (val.chat) {
+							if (val.chat.type == 'image') val.content = '[图片]'
+							if (val.chat.type == 'record') val.content = '[语音]'
+							else val.content = val.chat.content
+						}
 					}
 					that.$set(that, `groupList`, res.data)
 				} else {
@@ -217,13 +216,6 @@
 					}
 				}
 			},
-			// // 病人直接聊天
-			// toChat(item) {
-			// 	const that = this;
-			// 	uni.navigateTo({
-			// 		url: `/pagesHome/friend/index?patientId=${that.user._id}&doctorId=${item.doctor._id}&groupId=${item._id}&title=${item.doctor.name}`
-			// 	})
-			// },
 			// 详情
 			toInfo(item, type) {
 				if (type == 'group') {

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/pages/home/index.js.map


+ 5 - 13
unpackage/dist/dev/mp-weixin/pages/home/index.js

@@ -280,9 +280,7 @@ var _default = {
       // 群组
       groupList: [],
       // 好友
-      friendList: [{
-        id: '1'
-      }]
+      friendList: []
     };
   },
   onShow: function () {
@@ -393,9 +391,10 @@ var _default = {
                   try {
                     for (_iterator.s(); !(_step = _iterator.n()).done;) {
                       val = _step.value;
-                      if (val.chat.type == 'image') val.content = '[图片]';
-                      if (val.chat.type == 'record') val.content = '[语音]';else val.content = val.chat.content;
-                      val.time = that.formatDate(val.time);
+                      if (val.chat) {
+                        if (val.chat.type == 'image') val.content = '[图片]';
+                        if (val.chat.type == 'record') val.content = '[语音]';else val.content = val.chat.content;
+                      }
                     }
                   } catch (err) {
                     _iterator.e(err);
@@ -486,13 +485,6 @@ var _default = {
         }
       }
     },
-    // // 病人直接聊天
-    // toChat(item) {
-    // 	const that = this;
-    // 	uni.navigateTo({
-    // 		url: `/pagesHome/friend/index?patientId=${that.user._id}&doctorId=${item.doctor._id}&groupId=${item._id}&title=${item.doctor.name}`
-    // 	})
-    // },
     // 详情
     toInfo: function toInfo(item, type) {
       if (type == 'group') {

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 1 - 1
unpackage/dist/dev/mp-weixin/pages/home/index.wxml


+ 1 - 0
unpackage/dist/dev/mp-weixin/uni_modules/uni-badge/components/uni-badge/uni-badge.js

@@ -0,0 +1 @@
+Component({})

+ 4 - 0
unpackage/dist/dev/mp-weixin/uni_modules/uni-badge/components/uni-badge/uni-badge.json

@@ -0,0 +1,4 @@
+{
+  "usingComponents": {},
+  "component": true
+}