فهرست منبع

修改基本信息

zs 1 سال پیش
والد
کامیت
934779786c

+ 2 - 3
pages/home/index.vue

@@ -13,9 +13,8 @@
 				<uni-collapse-item title="群组" :thumb="config.group_url[0].url">
 				<uni-collapse-item title="群组" :thumb="config.group_url[0].url">
 					<view class="content">
 					<view class="content">
 						<view class="list" v-for="(item, index) in groupList" :key="index" @tap="toInfo(item)">
 						<view class="list" v-for="(item, index) in groupList" :key="index" @tap="toInfo(item)">
-							<uni-list-chat :title="item.name"
-								:avatar="item.doctor.icon[0].url"
-								time="2020-02-02 20:20"></uni-list-chat>
+							<uni-list-chat :title="item.name" :avatar="item.doctor.icon[0].url"
+								:time="item.doctor.name"></uni-list-chat>
 						</view>
 						</view>
 						<view class="is_bottom" v-if="is_bottom">
 						<view class="is_bottom" v-if="is_bottom">
 							<text>{{config.bottom_title||'到底了!'}}</text>
 							<text>{{config.bottom_title||'到底了!'}}</text>

+ 176 - 4
pagesMy/basic/index.vue

@@ -1,22 +1,194 @@
 <template>
 <template>
 	<view class="main">
 	<view class="main">
-		基本信息
+		<view class="one">
+			<upload class='upload' :list="user.icon" name="icon" :count="1" @uplSuc="uplSuc" @uplDel="uplDel">
+			</upload>
+		</view>
+		<view class="two">
+			<view class="two_1">
+				<view class="left">姓名</view>
+				<view class="right">
+					<input v-model="user.name" placeholder="请输入真实姓名" />
+					<text class="iconfont icon-dayuhao"></text>
+				</view>
+			</view>
+			<view class="two_1">
+				<view class="left">手机号</view>
+				<view class="right">
+					<input v-model="user.mobile" placeholder="请输入手机号" />
+					<text class="iconfont icon-dayuhao"></text>
+				</view>
+			</view>
+			<view class="two_1">
+				<view class="left">性别</view>
+				<view class="right">
+					<picker class="picker" mode="selector" :range="genderList" @change="genderChange" range-key="label">
+						<view>{{user.gender||'请选择性别'}}</view>
+					</picker>
+					<text class="iconfont icon-dayuhao"></text>
+				</view>
+			</view>
+			<view class="two_1">
+				<view class="left">医院名称</view>
+				<view class="right">
+					<input v-model="user.hos_name" placeholder="请输入医院名称" />
+					<text class="iconfont icon-dayuhao"></text>
+				</view>
+			</view>
+			<view class="two_1">
+				<view class="left">科室名称</view>
+				<view class="right">
+					<input v-model="user.dept_name" placeholder="请输入科室名称" />
+					<text class="iconfont icon-dayuhao"></text>
+				</view>
+			</view>
+			<view class="two_1">
+				<view class="left">职务</view>
+				<view class="right">
+					<input v-model="user.title" placeholder="请输入职务" />
+					<text class="iconfont icon-dayuhao"></text>
+				</view>
+			</view>
+			<view class="two_1">
+				<view class="left">职称</view>
+				<view class="right">
+					<input v-model="user.post" placeholder="请输入职称" />
+					<text class="iconfont icon-dayuhao"></text>
+				</view>
+			</view>
+		</view>
+		<view class="thr">
+			<button class="button" type="primary" size="mini" @click="onSubmit()">保存</button>
+		</view>
 	</view>
 	</view>
 </template>
 </template>
 
 
 <script>
 <script>
+	import upload from '../../components/upload/index.vue';
 	export default {
 	export default {
+		components: {
+			upload
+		},
 		data() {
 		data() {
-			return {}
+			return {
+				user: {},
+				gender_name: '',
+				// 字典表
+				genderList: [{
+						label: '男',
+						value: '男'
+					},
+					{
+						label: '女',
+						value: '女'
+					}
+				],
+			}
+		},
+		onLoad: async function() {
+			const that = this;
+			await that.search();
+		},
+		onShow: async function(e) {
+			const that = this;
+			that.searchToken();
 		},
 		},
 		methods: {
 		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;
+			},
+			// 图片上传
+			uplSuc(e) {
+				const that = this;
+				that.$set(that.user, `icon`, [e.data]);
+			},
+			// 图片删除
+			uplDel(e) {
+				const that = this;
+				that.$set(that.user, `icon`, [])
+			},
+			// 性别选择
+			genderChange(e) {
+				const that = this;
+				let data = that.genderList[e.detail.value];
+				if (data) that.$set(that.user, `gender`, data.value)
+			},
+			// 保存
+			async onSubmit() {
+				const that = this;
+				const form = that.user;
+				let res;
+				res = await that.$api(`/doctor/${form._id}`, 'POST', form);
+				if (res.errcode == '0') {
+					uni.showToast({
+						title: '维护信息成功',
+						icon: 'none'
+					})
+				} else {
+					uni.showToast({
+						title: res.errmsg,
+						icon: 'none'
+					})
+				}
+			},
 		}
 		}
 	}
 	}
 </script>
 </script>
 
 
 <style lang="scss" scoped>
 <style lang="scss" scoped>
 	.main {
 	.main {
-		padding: 2vw;
+		.one {
+			display: flex;
+			justify-content: center;
+			padding: 2vw;
+		}
+
+		.two {
+			padding: 2vw;
+
+			.two_1 {
+				display: flex;
+				justify-content: space-between;
+				padding: 4vw;
+				border-bottom: 1px solid var(--f9Color);
+				font-size: var(--font14Size);
+				color: var(--f69Color);
+
+				.right {
+					display: flex;
+					align-items: center;
+
+					input {
+						text-align: right;
+						padding: 0 1vw;
+					}
+				}
+			}
+		}
+
+		.thr {
+			text-align: center;
+
+			.button {
+				margin: 2vw 0 0 0;
+				background-color: var(--f3CColor);
+				color: var(--mainColor);
+				font-size: var(--font14Size);
+			}
+		}
 	}
 	}
 </style>
 </style>

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/common/runtime.js.map


تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 1 - 0
unpackage/dist/dev/.sourcemap/mp-weixin/components/upload/index.js.map


تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/pages/home/index.js.map


تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/pagesMy/basic/index.js.map


تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 2 - 2
unpackage/dist/dev/mp-weixin/common/runtime.js


تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 295 - 0
unpackage/dist/dev/mp-weixin/components/upload/index.js


+ 6 - 0
unpackage/dist/dev/mp-weixin/components/upload/index.json

@@ -0,0 +1,6 @@
+{
+  "usingComponents": {
+    "uni-icons": "/uni_modules/uni-icons/components/uni-icons/uni-icons"
+  },
+  "component": true
+}

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 1 - 0
unpackage/dist/dev/mp-weixin/components/upload/index.wxml


+ 32 - 0
unpackage/dist/dev/mp-weixin/components/upload/index.wxss

@@ -0,0 +1,32 @@
+@charset "UTF-8";
+/* 水平间距 */
+/* 水平间距 */
+.upload {
+  padding: 0 2vw;
+}
+.upload .upload_1 {
+  display: flex;
+  flex-wrap: wrap;
+}
+.upload .upload_1 .list {
+  position: relative;
+  width: 25vw;
+  height: 25vw;
+  text-align: center;
+  margin: 1vw;
+  border: 1px solid var(--f99Color);
+}
+.upload .upload_1 .list .image {
+  width: 100%;
+  height: 100%;
+}
+.upload .upload_1 .list .add {
+  position: relative;
+  top: 20px;
+}
+.upload .upload_1 .list .del {
+  position: absolute;
+  right: 0;
+  top: 0;
+}
+

+ 0 - 1
unpackage/dist/dev/mp-weixin/pages/home/index.js

@@ -230,7 +230,6 @@ var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/r
 //
 //
 //
 //
 //
 //
-//
 var _default = {
 var _default = {
   data: function data() {
   data: function data() {
     return {
     return {

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 1 - 1
unpackage/dist/dev/mp-weixin/pages/home/index.wxml


+ 151 - 9
unpackage/dist/dev/mp-weixin/pagesMy/basic/index.js

@@ -135,25 +135,167 @@ __webpack_require__.r(__webpack_exports__);
 /***/ (function(module, exports, __webpack_require__) {
 /***/ (function(module, exports, __webpack_require__) {
 
 
 "use strict";
 "use strict";
+/* WEBPACK VAR INJECTION */(function(uni) {
 
 
-
+var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
 Object.defineProperty(exports, "__esModule", {
 Object.defineProperty(exports, "__esModule", {
   value: true
   value: true
 });
 });
 exports.default = void 0;
 exports.default = void 0;
-//
-//
-//
-//
-//
-//
+var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ 30));
+var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ 32));
+var upload = function upload() {
+  __webpack_require__.e(/*! require.ensure | components/upload/index */ "components/upload/index").then((function () {
+    return resolve(__webpack_require__(/*! ../../components/upload/index.vue */ 181));
+  }).bind(null, __webpack_require__)).catch(__webpack_require__.oe);
+};
 var _default = {
 var _default = {
+  components: {
+    upload: upload
+  },
   data: function data() {
   data: function data() {
-    return {};
+    return {
+      user: {},
+      gender_name: '',
+      // 字典表
+      genderList: [{
+        label: '男',
+        value: '男'
+      }, {
+        label: '女',
+        value: '女'
+      }]
+    };
   },
   },
-  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.search();
+            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();
+            case 2:
+            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;
+        return _regenerator.default.wrap(function _callee3$(_context3) {
+          while (1) {
+            switch (_context3.prev = _context3.next) {
+              case 0:
+                that = _this;
+              case 1:
+              case "end":
+                return _context3.stop();
+            }
+          }
+        }, _callee3);
+      }))();
+    },
+    // 图片上传
+    uplSuc: function uplSuc(e) {
+      var that = this;
+      that.$set(that.user, "icon", [e.data]);
+    },
+    // 图片删除
+    uplDel: function uplDel(e) {
+      var that = this;
+      that.$set(that.user, "icon", []);
+    },
+    // 性别选择
+    genderChange: function genderChange(e) {
+      var that = this;
+      var data = that.genderList[e.detail.value];
+      if (data) that.$set(that.user, "gender", data.value);
+    },
+    // 保存
+    onSubmit: function onSubmit() {
+      var _this2 = this;
+      return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4() {
+        var that, form, res;
+        return _regenerator.default.wrap(function _callee4$(_context4) {
+          while (1) {
+            switch (_context4.prev = _context4.next) {
+              case 0:
+                that = _this2;
+                form = that.user;
+                _context4.next = 4;
+                return that.$api("/doctor/".concat(form._id), 'POST', form);
+              case 4:
+                res = _context4.sent;
+                if (res.errcode == '0') {
+                  uni.showToast({
+                    title: '维护信息成功',
+                    icon: 'none'
+                  });
+                } else {
+                  uni.showToast({
+                    title: res.errmsg,
+                    icon: 'none'
+                  });
+                }
+              case 6:
+              case "end":
+                return _context4.stop();
+            }
+          }
+        }, _callee4);
+      }))();
+    }
+  }
 };
 };
 exports.default = _default;
 exports.default = _default;
+/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
 
 
 /***/ }),
 /***/ }),
 
 

+ 3 - 1
unpackage/dist/dev/mp-weixin/pagesMy/basic/index.json

@@ -1,4 +1,6 @@
 {
 {
   "navigationBarTitleText": "基本信息",
   "navigationBarTitleText": "基本信息",
-  "usingComponents": {}
+  "usingComponents": {
+    "upload": "/components/upload/index"
+  }
 }
 }

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 1 - 1
unpackage/dist/dev/mp-weixin/pagesMy/basic/index.wxml


+ 31 - 1
unpackage/dist/dev/mp-weixin/pagesMy/basic/index.wxss

@@ -1,7 +1,37 @@
 @charset "UTF-8";
 @charset "UTF-8";
 /* 水平间距 */
 /* 水平间距 */
 /* 水平间距 */
 /* 水平间距 */
-.main.data-v-0166ed94 {
+.main .one.data-v-0166ed94 {
+  display: flex;
+  justify-content: center;
   padding: 2vw;
   padding: 2vw;
 }
 }
+.main .two.data-v-0166ed94 {
+  padding: 2vw;
+}
+.main .two .two_1.data-v-0166ed94 {
+  display: flex;
+  justify-content: space-between;
+  padding: 4vw;
+  border-bottom: 1px solid var(--f9Color);
+  font-size: var(--font14Size);
+  color: var(--f69Color);
+}
+.main .two .two_1 .right.data-v-0166ed94 {
+  display: flex;
+  align-items: center;
+}
+.main .two .two_1 .right input.data-v-0166ed94 {
+  text-align: right;
+  padding: 0 1vw;
+}
+.main .thr.data-v-0166ed94 {
+  text-align: center;
+}
+.main .thr .button.data-v-0166ed94 {
+  margin: 2vw 0 0 0;
+  background-color: var(--f3CColor);
+  color: var(--mainColor);
+  font-size: var(--font14Size);
+}