zs 1 년 전
부모
커밋
9ae406c4b2

+ 5 - 0
pages/home/index.vue

@@ -39,6 +39,11 @@
 			await that.searchToken();
 			await that.search();
 		},
+		onPullDownRefresh: async function() {
+			const that = this;
+			await that.search();
+			uni.stopPullDownRefresh();
+		},
 		methods: {
 			// 用户信息
 			searchToken() {

+ 137 - 4
pages/my/index.vue

@@ -1,22 +1,155 @@
 <template>
 	<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'"
+					mode=""></image>
+				<text>{{user.name||'微信用户'}}</text>
+			</view>
+		</view>
+		<view class="two">
+			<view class="list" v-for="(item, index) in menuList" :key="index" @click="toCommon(item.route)">
+				<view class="left">
+					<view class="icon">
+						<text class="iconfont" :class="[item.icon]"></text>
+					</view>
+					<text class="title">{{item.title||'暂无'}}</text>
+				</view>
+				<view class="right">
+					<text class="iconfont icon-dayuhao"></text>
+				</view>
+			</view>
+		</view>
 	</view>
 </template>
 
 <script>
 	export default {
 		data() {
-			return {}
+			return {
+				user: {},
+				// 菜单
+				menuList: []
+			}
+		},
+		onLoad: async function() {
+			const that = this;
+			await that.searchOther();
+		},
+		onShow: async function(e) {
+			const that = this;
+			that.searchToken();
+			await that.search();
 		},
 		methods: {
-
+			searchToken() {
+				const that = this;
+				try {
+					const res = uni.getStorageSync('token');
+					if (res) that.$set(that, `user`, res);
+				} catch (e) {
+					uni.showToast({
+						title: err.errmsg,
+						icon: 'error',
+						duration: 2000
+					});
+				}
+			},
+			// 查询
+			async search() {
+				const that = this;
+				let res;
+				// res = await that.$api(`/user`, 'GET', {
+				// 	user: that.user._id
+				// })
+				// if (res.errcode == '0') {
+				// 	that.$set(that, `list`, res.data)
+				// } else {
+				// 	uni.showToast({
+				// 		title: res.errmsg,
+				// 	});
+				// }
+			},
+			// 公共跳转
+			toCommon(e) {
+				uni.navigateTo({
+					url: `/${e}`
+				})
+			},
+			async searchOther() {
+				const that = this;
+				let config = that.$config;
+				that.$set(that, `menuList`, config.menuList);
+			}
 		}
 	}
 </script>
 
 <style lang="scss" scoped>
 	.main {
-		padding: 2vw;
+		display: flex;
+		flex-direction: column;
+		width: 100vw;
+		height: 100vh;
+		background-image: linear-gradient(to top, rgba(241, 241, 241, 1), rgba(241, 241, 241, 1), rgba(0, 122, 255, 1));
+
+		.one {
+			.one_1 {
+				padding: 15vw 5vw;
+				display: flex;
+				align-items: center;
+				font-size: var(--font18Size);
+
+				.image {
+					width: 15vw;
+					height: 15vw;
+					border-radius: 2vw;
+					margin: 0 2vw;
+				}
+			}
+		}
+
+		.two {
+			display: flex;
+			flex-direction: column;
+			padding: 2vw;
+			margin: 2vw;
+			border-radius: 10px;
+			background-color: var(--mainColor);
+
+			.list {
+				display: flex;
+				justify-content: space-between;
+				padding: 2vw;
+				border-bottom: 1px solid var(--f9Color);
+
+				.left {
+					display: flex;
+					align-items: center;
+					font-size: var(--font12Size);
+
+					.icon {
+						padding: 0 1vw 0 0;
+
+						.iconfont {
+							color: var(--f3CColor);
+							font-size: var(--font18Size);
+						}
+					}
+
+					.title {
+						display: inline-block;
+						font-size: var(--font12Size);
+					}
+				}
+
+				.right {
+					display: flex;
+					align-items: center;
+					font-size: var(--font12Size);
+					color: var(--f99Color);
+				}
+			}
+		}
 	}
 </style>

BIN
static/doctor.jpg


파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/pages/home/index.js.map


파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/pages/my/index.js.map


+ 31 - 7
unpackage/dist/dev/mp-weixin/pages/home/index.js

@@ -246,6 +246,30 @@ var _default = {
     }
     return onShow;
   }(),
+  onPullDownRefresh: function () {
+    var _onPullDownRefresh = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() {
+      var that;
+      return _regenerator.default.wrap(function _callee2$(_context2) {
+        while (1) {
+          switch (_context2.prev = _context2.next) {
+            case 0:
+              that = this;
+              _context2.next = 3;
+              return that.search();
+            case 3:
+              uni.stopPullDownRefresh();
+            case 4:
+            case "end":
+              return _context2.stop();
+          }
+        }
+      }, _callee2, this);
+    }));
+    function onPullDownRefresh() {
+      return _onPullDownRefresh.apply(this, arguments);
+    }
+    return onPullDownRefresh;
+  }(),
   methods: {
     // 用户信息
     searchToken: function searchToken() {
@@ -264,19 +288,19 @@ var _default = {
     // 查询
     search: function search() {
       var _this = this;
-      return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() {
+      return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3() {
         var that, res;
-        return _regenerator.default.wrap(function _callee2$(_context2) {
+        return _regenerator.default.wrap(function _callee3$(_context3) {
           while (1) {
-            switch (_context2.prev = _context2.next) {
+            switch (_context3.prev = _context3.next) {
               case 0:
                 that = _this; // 广告
-                _context2.next = 3;
+                _context3.next = 3;
                 return that.$api("/adv", 'GET', {
                   is_use: '0'
                 });
               case 3:
-                res = _context2.sent;
+                res = _context3.sent;
                 if (res.errcode == '0') {
                   that.$set(that, "advertList", res.data);
                 } else {
@@ -286,10 +310,10 @@ var _default = {
                 }
               case 5:
               case "end":
-                return _context2.stop();
+                return _context3.stop();
             }
           }
-        }, _callee2);
+        }, _callee3);
       }))();
     }
   }

+ 150 - 3
unpackage/dist/dev/mp-weixin/pages/my/index.js

@@ -102,6 +102,15 @@ var render = function () {
   var _vm = this
   var _h = _vm.$createElement
   var _c = _vm._self._c || _h
+  var g0 = _vm.user.logo && _vm.user.logo.length > 0
+  _vm.$mp.data = Object.assign(
+    {},
+    {
+      $root: {
+        g0: g0,
+      },
+    }
+  )
 }
 var recyclableRender = false
 var staticRenderFns = []
@@ -135,12 +144,34 @@ __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 +180,127 @@ exports.default = void 0;
 //
 var _default = {
   data: function data() {
-    return {};
+    return {
+      user: {},
+      // 菜单
+      menuList: []
+    };
   },
-  methods: {}
+  onLoad: function () {
+    var _onLoad = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
+      var that;
+      return _regenerator.default.wrap(function _callee$(_context) {
+        while (1) {
+          switch (_context.prev = _context.next) {
+            case 0:
+              that = this;
+              _context.next = 3;
+              return that.searchOther();
+            case 3:
+            case "end":
+              return _context.stop();
+          }
+        }
+      }, _callee, this);
+    }));
+    function onLoad() {
+      return _onLoad.apply(this, arguments);
+    }
+    return onLoad;
+  }(),
+  onShow: function () {
+    var _onShow = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(e) {
+      var that;
+      return _regenerator.default.wrap(function _callee2$(_context2) {
+        while (1) {
+          switch (_context2.prev = _context2.next) {
+            case 0:
+              that = this;
+              that.searchToken();
+              _context2.next = 4;
+              return that.search();
+            case 4:
+            case "end":
+              return _context2.stop();
+          }
+        }
+      }, _callee2, this);
+    }));
+    function onShow(_x) {
+      return _onShow.apply(this, arguments);
+    }
+    return onShow;
+  }(),
+  methods: {
+    searchToken: function searchToken() {
+      var that = this;
+      try {
+        var res = uni.getStorageSync('token');
+        if (res) that.$set(that, "user", res);
+      } catch (e) {
+        uni.showToast({
+          title: err.errmsg,
+          icon: 'error',
+          duration: 2000
+        });
+      }
+    },
+    // 查询
+    search: function search() {
+      var _this = this;
+      return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3() {
+        var that, res;
+        return _regenerator.default.wrap(function _callee3$(_context3) {
+          while (1) {
+            switch (_context3.prev = _context3.next) {
+              case 0:
+                that = _this; // res = await that.$api(`/user`, 'GET', {
+                // 	user: that.user._id
+                // })
+                // if (res.errcode == '0') {
+                // 	that.$set(that, `list`, res.data)
+                // } else {
+                // 	uni.showToast({
+                // 		title: res.errmsg,
+                // 	});
+                // }
+              case 1:
+              case "end":
+                return _context3.stop();
+            }
+          }
+        }, _callee3);
+      }))();
+    },
+    // 公共跳转
+    toCommon: function toCommon(e) {
+      uni.navigateTo({
+        url: "/".concat(e)
+      });
+    },
+    searchOther: function searchOther() {
+      var _this2 = this;
+      return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4() {
+        var that, config;
+        return _regenerator.default.wrap(function _callee4$(_context4) {
+          while (1) {
+            switch (_context4.prev = _context4.next) {
+              case 0:
+                that = _this2;
+                config = that.$config;
+                that.$set(that, "menuList", config.menuList);
+              case 3:
+              case "end":
+                return _context4.stop();
+            }
+          }
+        }, _callee4);
+      }))();
+    }
+  }
 };
 exports.default = _default;
+/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
 
 /***/ }),
 

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 1 - 1
unpackage/dist/dev/mp-weixin/pages/my/index.wxml


+ 52 - 0
unpackage/dist/dev/mp-weixin/pages/my/index.wxss

@@ -2,6 +2,58 @@
 /* 水平间距 */
 /* 水平间距 */
 .main.data-v-4dcceeb0 {
+  display: flex;
+  flex-direction: column;
+  width: 100vw;
+  height: 100vh;
+  background-image: linear-gradient(to top, #f1f1f1, #f1f1f1, #007aff);
+}
+.main .one .one_1.data-v-4dcceeb0 {
+  padding: 15vw 5vw;
+  display: flex;
+  align-items: center;
+  font-size: var(--font18Size);
+}
+.main .one .one_1 .image.data-v-4dcceeb0 {
+  width: 15vw;
+  height: 15vw;
+  border-radius: 2vw;
+  margin: 0 2vw;
+}
+.main .two.data-v-4dcceeb0 {
+  display: flex;
+  flex-direction: column;
+  padding: 2vw;
+  margin: 2vw;
+  border-radius: 10px;
+  background-color: var(--mainColor);
+}
+.main .two .list.data-v-4dcceeb0 {
+  display: flex;
+  justify-content: space-between;
   padding: 2vw;
+  border-bottom: 1px solid var(--f9Color);
+}
+.main .two .list .left.data-v-4dcceeb0 {
+  display: flex;
+  align-items: center;
+  font-size: var(--font12Size);
+}
+.main .two .list .left .icon.data-v-4dcceeb0 {
+  padding: 0 1vw 0 0;
+}
+.main .two .list .left .icon .iconfont.data-v-4dcceeb0 {
+  color: var(--f3CColor);
+  font-size: var(--font18Size);
+}
+.main .two .list .left .title.data-v-4dcceeb0 {
+  display: inline-block;
+  font-size: var(--font12Size);
+}
+.main .two .list .right.data-v-4dcceeb0 {
+  display: flex;
+  align-items: center;
+  font-size: var(--font12Size);
+  color: var(--f99Color);
 }
 

BIN
unpackage/dist/dev/mp-weixin/static/doctor.jpg