zs 1 rok pred
rodič
commit
d764000e8f

+ 1 - 0
App.vue

@@ -128,5 +128,6 @@
 		--fF0Color: #FF0000;
 		--f08Color: #008000;
 		--f35BColor: #35BD7B;
+		--f191Color: #191970;
 	}
 </style>

+ 19 - 8
pages/home/index.vue

@@ -13,10 +13,9 @@
 				<uni-collapse-item title="群组" :thumb="config.group_url[0].url">
 					<view class="content">
 						<view class="list" v-for="(item, index) in groupList" :key="index" @tap="toInfo(item)">
-							<uni-list-chat title="uni-app"
-								avatar="https://qiniu-web-assets.dcloud.net.cn/unidoc/zh/unicloudlogo.png"
-								note="您收到一条新的消息" time="2020-02-02 20:20" badge-positon="left"
-								badge-text="99"></uni-list-chat>
+							<uni-list-chat :title="item.name"
+								:avatar="item.doctor.icon[0].url"
+								time="2020-02-02 20:20"></uni-list-chat>
 						</view>
 						<view class="is_bottom" v-if="is_bottom">
 							<text>{{config.bottom_title||'到底了!'}}</text>
@@ -50,9 +49,7 @@
 				// 广告
 				advertList: [],
 				// 群组
-				groupList: [{
-					id: '1'
-				}],
+				groupList: [],
 				// 好友
 				friendList: [{
 					id: '1'
@@ -101,8 +98,9 @@
 			// 查询
 			async search() {
 				const that = this;
+				let res;
 				// 广告
-				const res = await that.$api(`/adv`, 'GET', {
+				res = await that.$api(`/adv`, 'GET', {
 					is_use: '0'
 				})
 				if (res.errcode == '0') {
@@ -112,6 +110,19 @@
 						title: res.errmsg,
 					});
 				}
+				// 群组
+				res = await that.$api(`/group`, 'GET', {
+					// doctor: that.user._id
+				})
+				if (res.errcode == '0') {
+					that.$set(that, `groupList`, res.data)
+				} else {
+					uni.showToast({
+						title: res.errmsg,
+					});
+				}
+				// 好友
+
 			},
 		}
 	}

+ 68 - 14
pages/science/index.vue

@@ -7,7 +7,24 @@
 			<scroll-view scroll-y="true" class="scroll-view" @scrolltolower="toPage" @scroll="toScroll">
 				<view class="list-scroll-view">
 					<view class="list" v-for="(item, index) in list" :key="index" @tap="toInfo(item)">
-						1111
+						<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'"
+									mode="">
+								</image>
+								<text>{{item.doctor.name||'暂无'}}</text>
+							</view>
+							<view class="right">{{item.create_time||'暂无'}}</view>
+						</view>
+						<view class="list_2">
+							<image class="image" :src="item.img_url&&item.img_url.length>0?item.img_url[0].url:''"
+								mode="">
+							</image>
+						</view>
+						<view class="list_3">
+							<text>{{item.title||'暂无标题'}}</text>
+						</view>
 					</view>
 					<view class="is_bottom" v-if="is_bottom">
 						<text>{{config.bottom_title||'到底了!'}}</text>
@@ -27,7 +44,7 @@
 				list: [],
 				total: 0,
 				skip: 0,
-				limit: 6,
+				limit: 5,
 				page: 0,
 				// 数据是否触底
 				is_bottom: false,
@@ -142,7 +159,7 @@
 				const that = this;
 				that.$set(that, `list`, [])
 				that.$set(that, `skip`, 0)
-				that.$set(that, `limit`, 6)
+				that.$set(that, `limit`, 5)
 				that.$set(that, `page`, 0)
 			}
 		}
@@ -155,13 +172,13 @@
 		flex-direction: column;
 		width: 100vw;
 		height: 100vh;
-	
+
 		.one {
 			display: flex;
 			justify-content: center;
 			align-items: center;
 			padding: 2vw;
-	
+
 			input {
 				width: 100%;
 				padding: 2vw;
@@ -170,41 +187,78 @@
 				border-radius: 5px;
 			}
 		}
-	
+
 		.two {
 			position: relative;
 			flex-grow: 1;
 			background-color: var(--f9Color);
 			margin: 2vw 0 0 0;
-	
+
 			.list {
-				display: flex;
 				background-color: var(--mainColor);
 				border: 1px solid var(--f5Color);
-				padding: 2vw;
+				padding: 2vw 0;
 				margin: 2vw 2vw 0 2vw;
-				border-radius: 5px;
+				border-radius: 10px;
+
+				.list_1 {
+					display: flex;
+					justify-content: space-between;
+					align-items: center;
+					padding: 2vw;
+
+					.left {
+						display: flex;
+						align-items: center;
+						font-size: var(--font16Size);
+						color: var(--f191Color);
+
+						.image {
+							width: 10vw;
+							height: 10vw;
+							border-radius: 10vw;
+							margin: 0 2vw 0 0;
+						}
+					}
+
+					.right {
+						font-size: var(--font12Size);
+						color: var(--f99Color);
+					}
+				}
+
+				.list_2 {
+					.image {
+						width: 100%;
+						height: 30vh;
+					}
+				}
+
+				.list_3 {
+					padding: 2vw;
+					font-size: var(--font16Size);
+				}
 			}
 		}
 	}
-	
+
 	.scroll-view {
 		position: absolute;
 		top: 0;
 		left: 0;
 		right: 0;
 		bottom: 0;
-	
+
 		.list-scroll-view {
 			display: flex;
 			flex-direction: column;
 		}
 	}
-	
+
 	.is_bottom {
 		width: 100%;
 		text-align: center;
-	
+
 		text {
 			padding: 2vw 0;
 			display: inline-block;

+ 78 - 4
pagesScience/science/index.vue

@@ -1,22 +1,96 @@
 <template>
 	<view class="main">
-		首页
+		<view class="one">
+			{{info.title||'暂无标题'}}
+		</view>
+		<view class="two">
+			<view class="two_1">{{info.doctor.name||'暂无'}}</view>
+			<view class="two_2">{{info.create_time||'暂无'}}</view>
+		</view>
+		<view class="thr">
+			<rich-text :nodes="formatRichText(info.content)"></rich-text>
+		</view>
+		<view class="four">
+			来源 | {{info.origin||'暂无来源'}}
+		</view>
 	</view>
 </template>
 
 <script>
 	export default {
 		data() {
-			return {}
+			return {
+				id: '',
+				info: {},
+			}
+		},
+		onLoad: async function(e) {
+			const that = this;
+			that.$set(that, `id`, e && e.id || '');
+			that.search();
 		},
 		methods: {
-
+			async search() {
+				const that = this;
+				if (that.id) {
+					const res = await that.$api(`/article/${that.id}`, 'GET', {})
+					if (res.errcode == '0') {
+						that.$set(that, `info`, res.data)
+					} else {
+						uni.showToast({
+							title: res.errmsg,
+						});
+					}
+				}
+			},
+			// 处理富文本
+			formatRichText(html) {
+				if (html) {
+					// 富文本内容格式化
+					return html && html.replace(/<img[^>]*>/gi, function(match, capture) {
+						// 查找所有的 img 元素
+						return match.replace(/style=".*"/gi, '').replace(/style='.*'/gi,
+							'')
+						// 删除找到的所有 img 元素中的 style 属性
+					}).replace(/\<img/gi, '<img style="width:100%;"') // 对 img 元素增加 style 属性,并设置宽度为 100%
+				}
+			},
 		}
 	}
 </script>
 
 <style lang="scss" scoped>
 	.main {
-		padding: 2vw;
+		padding: 2vw 3vw;
+
+		.one {
+			font-size: var(--font18Size);
+			font-weight: bold;
+			padding: 2vw 0;
+		}
+
+		.two {
+			display: flex;
+			align-items: center;
+			font-size: var(--font14Size);
+
+			.two_1 {
+				color: var(--f191Color);
+			}
+
+			.two_2 {
+				color: var(--f99Color);
+				padding: 0 2vw;
+			}
+		}
+
+		.thr {
+			padding: 3vw 0;
+		}
+
+		.four {
+			padding: 4vw 0;
+			font-size: var(--font14Size);
+		}
 	}
 </style>

Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/common/main.js.map


Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/pages/home/index.js.map


Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/pages/science/index.js.map


Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/pagesScience/science/index.js.map


+ 1 - 0
unpackage/dist/dev/mp-weixin/common/main.wxss

@@ -2448,5 +2448,6 @@ page {
   --fF0Color: #FF0000;
   --f08Color: #008000;
   --f35BColor: #35BD7B;
+  --f191Color: #191970;
 }
 

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

@@ -231,7 +231,6 @@ var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/r
 //
 //
 //
-//
 var _default = {
   data: function data() {
     return {
@@ -240,9 +239,7 @@ var _default = {
       // 广告
       advertList: [],
       // 群组
-      groupList: [{
-        id: '1'
-      }],
+      groupList: [],
       // 好友
       friendList: [{
         id: '1'
@@ -338,7 +335,7 @@ var _default = {
           while (1) {
             switch (_context3.prev = _context3.next) {
               case 0:
-                that = _this; // 广告
+                that = _this;
                 _context3.next = 3;
                 return that.$api("/adv", 'GET', {
                   is_use: '0'
@@ -352,7 +349,22 @@ var _default = {
                     title: res.errmsg
                   });
                 }
-              case 5:
+                // 群组
+                _context3.next = 7;
+                return that.$api("/group", 'GET', {
+                  // doctor: that.user._id
+                });
+              case 7:
+                res = _context3.sent;
+                if (res.errcode == '0') {
+                  that.$set(that, "groupList", res.data);
+                } else {
+                  uni.showToast({
+                    title: res.errmsg
+                  });
+                }
+                // 好友
+              case 9:
               case "end":
                 return _context3.stop();
             }

Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 1 - 1
unpackage/dist/dev/mp-weixin/pages/home/index.wxml


+ 37 - 2
unpackage/dist/dev/mp-weixin/pages/science/index.js

@@ -102,6 +102,24 @@ var render = function () {
   var _vm = this
   var _h = _vm.$createElement
   var _c = _vm._self._c || _h
+  var l0 = _vm.__map(_vm.list, function (item, index) {
+    var $orig = _vm.__get_orig(item)
+    var g0 = item.doctor.icon && item.doctor.icon.length > 0
+    var g1 = item.img_url && item.img_url.length > 0
+    return {
+      $orig: $orig,
+      g0: g0,
+      g1: g1,
+    }
+  })
+  _vm.$mp.data = Object.assign(
+    {},
+    {
+      $root: {
+        l0: l0,
+      },
+    }
+  )
 }
 var recyclableRender = false
 var staticRenderFns = []
@@ -168,6 +186,23 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
 //
 //
 //
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
 var _default = {
   data: function data() {
     return {
@@ -176,7 +211,7 @@ var _default = {
       list: [],
       total: 0,
       skip: 0,
-      limit: 6,
+      limit: 5,
       page: 0,
       // 数据是否触底
       is_bottom: false,
@@ -358,7 +393,7 @@ var _default = {
       var that = this;
       that.$set(that, "list", []);
       that.$set(that, "skip", 0);
-      that.$set(that, "limit", 6);
+      that.$set(that, "limit", 5);
       that.$set(that, "page", 0);
     }
   }

Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 1 - 1
unpackage/dist/dev/mp-weixin/pages/science/index.wxml


+ 32 - 3
unpackage/dist/dev/mp-weixin/pages/science/index.wxss

@@ -27,12 +27,41 @@
   margin: 2vw 0 0 0;
 }
 .main .two .list.data-v-357bbe3e {
-  display: flex;
   background-color: var(--mainColor);
   border: 1px solid var(--f5Color);
-  padding: 2vw;
+  padding: 2vw 0;
   margin: 2vw 2vw 0 2vw;
-  border-radius: 5px;
+  border-radius: 10px;
+}
+.main .two .list .list_1.data-v-357bbe3e {
+  display: flex;
+  justify-content: space-between;
+  align-items: center;
+  padding: 2vw;
+}
+.main .two .list .list_1 .left.data-v-357bbe3e {
+  display: flex;
+  align-items: center;
+  font-size: var(--font16Size);
+  color: var(--f191Color);
+}
+.main .two .list .list_1 .left .image.data-v-357bbe3e {
+  width: 10vw;
+  height: 10vw;
+  border-radius: 10vw;
+  margin: 0 2vw 0 0;
+}
+.main .two .list .list_1 .right.data-v-357bbe3e {
+  font-size: var(--font12Size);
+  color: var(--f99Color);
+}
+.main .two .list .list_2 .image.data-v-357bbe3e {
+  width: 100%;
+  height: 30vh;
+}
+.main .two .list .list_3.data-v-357bbe3e {
+  padding: 2vw;
+  font-size: var(--font16Size);
 }
 .scroll-view.data-v-357bbe3e {
   position: absolute;

+ 97 - 3
unpackage/dist/dev/mp-weixin/pagesScience/science/index.js

@@ -102,6 +102,15 @@ var render = function () {
   var _vm = this
   var _h = _vm.$createElement
   var _c = _vm._self._c || _h
+  var m0 = _vm.formatRichText(_vm.info.content)
+  _vm.$mp.data = Object.assign(
+    {},
+    {
+      $root: {
+        m0: m0,
+      },
+    }
+  )
 }
 var recyclableRender = false
 var staticRenderFns = []
@@ -135,12 +144,27 @@ __webpack_require__.r(__webpack_exports__);
 /***/ (function(module, exports, __webpack_require__) {
 
 "use strict";
+/* WEBPACK VAR INJECTION */(function(uni) {
 
-
+var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
 Object.defineProperty(exports, "__esModule", {
   value: true
 });
 exports.default = void 0;
+var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ 30));
+var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ 32));
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
 //
 //
 //
@@ -149,11 +173,81 @@ exports.default = void 0;
 //
 var _default = {
   data: function data() {
-    return {};
+    return {
+      id: '',
+      info: {}
+    };
   },
-  methods: {}
+  onLoad: function () {
+    var _onLoad = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(e) {
+      var that;
+      return _regenerator.default.wrap(function _callee$(_context) {
+        while (1) {
+          switch (_context.prev = _context.next) {
+            case 0:
+              that = this;
+              that.$set(that, "id", e && e.id || '');
+              that.search();
+            case 3:
+            case "end":
+              return _context.stop();
+          }
+        }
+      }, _callee, this);
+    }));
+    function onLoad(_x) {
+      return _onLoad.apply(this, arguments);
+    }
+    return onLoad;
+  }(),
+  methods: {
+    search: function search() {
+      var _this = this;
+      return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() {
+        var that, res;
+        return _regenerator.default.wrap(function _callee2$(_context2) {
+          while (1) {
+            switch (_context2.prev = _context2.next) {
+              case 0:
+                that = _this;
+                if (!that.id) {
+                  _context2.next = 6;
+                  break;
+                }
+                _context2.next = 4;
+                return that.$api("/article/".concat(that.id), 'GET', {});
+              case 4:
+                res = _context2.sent;
+                if (res.errcode == '0') {
+                  that.$set(that, "info", res.data);
+                } else {
+                  uni.showToast({
+                    title: res.errmsg
+                  });
+                }
+              case 6:
+              case "end":
+                return _context2.stop();
+            }
+          }
+        }, _callee2);
+      }))();
+    },
+    // 处理富文本
+    formatRichText: function formatRichText(html) {
+      if (html) {
+        // 富文本内容格式化
+        return html && html.replace(/<img[^>]*>/gi, function (match, capture) {
+          // 查找所有的 img 元素
+          return match.replace(/style=".*"/gi, '').replace(/style='.*'/gi, '');
+          // 删除找到的所有 img 元素中的 style 属性
+        }).replace(/\<img/gi, '<img style="width:100%;"'); // 对 img 元素增加 style 属性,并设置宽度为 100%
+      }
+    }
+  }
 };
 exports.default = _default;
+/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
 
 /***/ }),
 

Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 1 - 1
unpackage/dist/dev/mp-weixin/pagesScience/science/index.wxml


+ 25 - 1
unpackage/dist/dev/mp-weixin/pagesScience/science/index.wxss

@@ -2,6 +2,30 @@
 /* 水平间距 */
 /* 水平间距 */
 .main.data-v-70804fa6 {
-  padding: 2vw;
+  padding: 2vw 3vw;
+}
+.main .one.data-v-70804fa6 {
+  font-size: var(--font18Size);
+  font-weight: bold;
+  padding: 2vw 0;
+}
+.main .two.data-v-70804fa6 {
+  display: flex;
+  align-items: center;
+  font-size: var(--font14Size);
+}
+.main .two .two_1.data-v-70804fa6 {
+  color: var(--f191Color);
+}
+.main .two .two_2.data-v-70804fa6 {
+  color: var(--f99Color);
+  padding: 0 2vw;
+}
+.main .thr.data-v-70804fa6 {
+  padding: 3vw 0;
+}
+.main .four.data-v-70804fa6 {
+  padding: 4vw 0;
+  font-size: var(--font14Size);
 }