"use strict"; var __defProp = Object.defineProperty; var __defProps = Object.defineProperties; var __getOwnPropDescs = Object.getOwnPropertyDescriptors; var __getOwnPropSymbols = Object.getOwnPropertySymbols; var __hasOwnProp = Object.prototype.hasOwnProperty; var __propIsEnum = Object.prototype.propertyIsEnumerable; var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; var __spreadValues = (a, b) => { for (var prop in b || (b = {})) if (__hasOwnProp.call(b, prop)) __defNormalProp(a, prop, b[prop]); if (__getOwnPropSymbols) for (var prop of __getOwnPropSymbols(b)) { if (__propIsEnum.call(b, prop)) __defNormalProp(a, prop, b[prop]); } return a; }; var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b)); var common_vendor = require("../common/vendor.js"); var api_common = require("../api/common.js"); var api_user = require("../api/user.js"); require("../common/request.js"); const _sfc_main = { data() { return { cityIndex1: 0, cityIndex2: 0, allCitys: [], citys: [[], [], []], cityShow: false, depts: [[]], deptShow: false, hospitals: [[]], hospitalShow: false, positions: [[]], positionShow: false, fileList1: [], fileList2: [], fileList3: [], fileList4: [], checked: 0, form: { sex: "1" }, rules: { doctorName: [ { required: true, message: "\u8BF7\u8F93\u5165\u533B\u751F\u59D3\u540D" } ], idCard: [ { required: true, message: "\u8BF7\u8F93\u5165\u8EAB\u4EFD\u8BC1\u53F7", trigger: ["change", "blur"] } ], deptId: [ { required: true, message: "\u8BF7\u9009\u62E9\u90E8\u95E8" } ], hospitalId: [ { required: true, message: "\u8BF7\u9009\u62E9\u533B\u9662" } ], position: [ { required: true, message: "\u8BF7\u9009\u62E9\u804C\u52A1" } ], cityIds: [ { required: true, message: "\u8BF7\u9009\u62E9\u6240\u5728\u57CE\u5E02" } ], account: [ { required: true, message: "\u8BF7\u8F93\u5165\u5E10\u53F7" } ], password: [ { required: true, message: "\u8BF7\u8F93\u5165\u5BC6\u7801" } ], mobile: [ { required: true, message: "\u8BF7\u8F93\u5165\u624B\u673A\u53F7", trigger: ["change", "blur"] } ] } }; }, onLoad(options) { this.form.doctorType = options.type; this.getCitys(); this.getHospitalList(); this.getDepartmentList(); this.getDictByKey("sys_doc_position"); }, onShow() { }, onReady() { this.$refs.uForm.setRules(this.rules); }, methods: { hospitalSelect(e) { this.form.hospitalId = this.hospitals[0][e.indexs[0]].hospitalId; this.form.hospitalName = this.hospitals[0][e.indexs[0]].hospitalName; this.hospitalShow = false; }, deptSelect(e) { console.log(e); this.form.deptId = this.depts[0][e.indexs[0]].deptId; this.form.deptName = this.depts[0][e.indexs[0]].deptName; this.deptShow = false; }, positionSelect(e) { console.log(e); this.form.position = this.positions[0][e.indexs[0]].dictLabel; this.positionShow = false; }, getDictByKey(key) { var data = { key }; api_common.getDictByKey(data).then((res) => { if (res.code == 200) { this.positions[0] = res.data; } }, (err) => { }); }, openContent(type) { common_vendor.index.navigateTo({ url: "agreement?type=" + type }); }, cityChangeHandler(e) { const { columnIndex, index, picker = this.$refs.cityPicker } = e; if (columnIndex == 0) { this.cityIndex1 = index; console.log(this.cityIndex1); var citys1 = this.allCitys[this.cityIndex1].c; console.log(citys1); picker.setColumnValues(1, citys1); this.cityIndex2 = 0; var citys2 = this.allCitys[this.cityIndex1].c[this.cityIndex2].c; picker.setColumnValues(2, citys2); } if (columnIndex == 1) { this.cityIndex2 = index; var citys = this.allCitys[this.cityIndex1].c[this.cityIndex2].c; console.log(citys); picker.setColumnValues(2, citys); } }, citySelect(e) { console.log(e); this.form.cityName = e.value[0].n + ">" + e.value[1].n + ">" + e.value[2].n; this.form.cityIds = e.value[0].v + "," + e.value[1].v + "," + e.value[2].v; this.cityShow = false; }, getCitys() { var that = this; var data = {}; api_common.getCitys(data).then((res) => { if (res.code == 200) { that.allCitys = res.data; that.citys = [[], [], []]; that.citys[0] = that.allCitys; that.citys[1] = that.allCitys[0].c; that.citys[2] = that.allCitys[0].c[0].c; console.log(that.citys); } }, (err) => { }); }, getHospitalList() { var that = this; var data = {}; api_common.getHospitalList(data).then((res) => { if (res.code == 200) { that.hospitals[0] = res.data; console.log(111); console.log(that.hospitals); } }, (err) => { }); }, getDepartmentList() { var that = this; var data = {}; api_common.getDepartmentList(data).then((res) => { if (res.code == 200) { that.depts[0] = res.data; } }, (err) => { }); }, deletePic(event) { this[`fileList${event.name}`].splice(event.index, 1); }, async afterRead(event) { let lists = [].concat(event.file); let fileListLen = this[`fileList${event.name}`].length; lists.map((item) => { this[`fileList${event.name}`].push(__spreadProps(__spreadValues({}, item), { status: "uploading", message: "\u4E0A\u4F20\u4E2D" })); }); for (let i = 0; i < lists.length; i++) { const result = await this.uploadFilePromise(lists[i].url); let item = this[`fileList${event.name}`][fileListLen]; this[`fileList${event.name}`].splice(fileListLen, 1, Object.assign(item, { status: "success", message: "", url: result })); fileListLen++; } }, uploadFilePromise(url) { return new Promise((resolve, reject) => { common_vendor.index.uploadFile({ url: common_vendor.index.getStorageSync("requestPath") + "/app/common/uploadOSS", filePath: url, name: "file", formData: { user: "test" }, success: (res) => { setTimeout(() => { console.log(JSON.parse(res.data).url); resolve(JSON.parse(res.data).url); }, 1e3); } }); }); }, register() { api_user.registerDoctor(this.form).then((res) => { console.log(res); if (res.code == 200) { common_vendor.index.showToast({ icon: "none", title: res.msg }); setTimeout(function() { common_vendor.index.navigateBack({ delta: 1 }); }, 2e3); } else { common_vendor.index.showToast({ icon: "none", title: res.msg }); } }, (rej) => { console.log(rej); }); }, submit() { var that = this; if (this.fileList1.length > 0) { this.form.avatar = this.fileList1[0].url; } if (this.fileList2.length > 0) { var images = []; that.fileList2.forEach(function(item) { images.push(item.url); }); if (images.length != 2) { common_vendor.index.showToast({ icon: "none", title: "\u8BF7\u4E0A\u4F20\u8EAB\u4EFD\u8BC1\u53F7" }); return; } this.form.idCardFrontUrl = images[0]; this.form.idCardBackUrl = images[1]; } if (this.fileList3.length > 0) { var images = []; that.fileList3.forEach(function(item) { images.push(item.url); }); this.form.certificateImages = images.toString(); } if (this.fileList4.length > 0) { var images = []; that.fileList4.forEach(function(item) { images.push(item.url); }); this.form.practiseImages = images.toString(); } if (this.checked != 1) { common_vendor.index.showToast({ icon: "none", title: "\u8BF7\u540C\u610F\u534F\u8BAE" }); return; } console.log(this.form); this.$refs.uForm.validate().then((res) => { that.register(); }).catch((errors) => { console.log(errors); }); } } }; if (!Array) { const _easycom_u_input2 = common_vendor.resolveComponent("u-input"); const _easycom_u_form_item2 = common_vendor.resolveComponent("u-form-item"); const _easycom_u_radio2 = common_vendor.resolveComponent("u-radio"); const _easycom_u_radio_group2 = common_vendor.resolveComponent("u-radio-group"); const _easycom_u_icon2 = common_vendor.resolveComponent("u-icon"); const _easycom_u__textarea2 = common_vendor.resolveComponent("u--textarea"); const _easycom_u_upload2 = common_vendor.resolveComponent("u-upload"); const _easycom_u_form2 = common_vendor.resolveComponent("u-form"); const _easycom_u_checkbox2 = common_vendor.resolveComponent("u-checkbox"); const _easycom_u_checkbox_group2 = common_vendor.resolveComponent("u-checkbox-group"); const _easycom_u_picker2 = common_vendor.resolveComponent("u-picker"); (_easycom_u_input2 + _easycom_u_form_item2 + _easycom_u_radio2 + _easycom_u_radio_group2 + _easycom_u_icon2 + _easycom_u__textarea2 + _easycom_u_upload2 + _easycom_u_form2 + _easycom_u_checkbox2 + _easycom_u_checkbox_group2 + _easycom_u_picker2)(); } const _easycom_u_input = () => "../uni_modules/uview-plus/components/u-input/u-input.js"; const _easycom_u_form_item = () => "../uni_modules/uview-plus/components/u-form-item/u-form-item.js"; const _easycom_u_radio = () => "../uni_modules/uview-plus/components/u-radio/u-radio.js"; const _easycom_u_radio_group = () => "../uni_modules/uview-plus/components/u-radio-group/u-radio-group.js"; const _easycom_u_icon = () => "../uni_modules/uview-plus/components/u-icon/u-icon.js"; const _easycom_u__textarea = () => "../uni_modules/uview-plus/components/u--textarea/u--textarea.js"; const _easycom_u_upload = () => "../uni_modules/uview-plus/components/u-upload/u-upload.js"; const _easycom_u_form = () => "../uni_modules/uview-plus/components/u-form/u-form.js"; const _easycom_u_checkbox = () => "../uni_modules/uview-plus/components/u-checkbox/u-checkbox.js"; const _easycom_u_checkbox_group = () => "../uni_modules/uview-plus/components/u-checkbox-group/u-checkbox-group.js"; const _easycom_u_picker = () => "../uni_modules/uview-plus/components/u-picker/u-picker.js"; if (!Math) { (_easycom_u_input + _easycom_u_form_item + _easycom_u_radio + _easycom_u_radio_group + _easycom_u_icon + _easycom_u__textarea + _easycom_u_upload + _easycom_u_form + _easycom_u_checkbox + _easycom_u_checkbox_group + _easycom_u_picker)(); } function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) { return common_vendor.e({ a: $data.form.doctorType == 1 }, $data.form.doctorType == 1 ? {} : {}, { b: $data.form.doctorType == 1 }, $data.form.doctorType == 1 ? {} : {}, { c: $data.form.doctorType == 2 }, $data.form.doctorType == 2 ? {} : {}, { d: $data.form.doctorType == 2 }, $data.form.doctorType == 2 ? {} : {}, { e: common_vendor.o(($event) => $data.form.doctorName = $event), f: common_vendor.p({ border: "none", placeholder: "\u8BF7\u8F93\u5165\u771F\u5B9E\u59D3\u540D", modelValue: $data.form.doctorName }), g: common_vendor.p({ labelWidth: "180rpx", borderBottom: true, label: "\u771F\u5B9E\u59D3\u540D", prop: "doctorName" }), h: common_vendor.o(($event) => $data.form.idCard = $event), i: common_vendor.p({ border: "none", placeholder: "\u8BF7\u8F93\u5165\u8EAB\u4EFD\u8BC1\u53F7", modelValue: $data.form.idCard }), j: common_vendor.p({ labelWidth: "180rpx", borderBottom: true, label: "\u8EAB\u4EFD\u8BC1\u53F7", prop: "idCard" }), k: common_vendor.p({ activeColor: "#C39A58", customStyle: { marginRight: "8px" }, label: "\u7537", name: "1" }), l: common_vendor.p({ activeColor: "#C39A58", label: "\u5973", name: "2" }), m: common_vendor.o(($event) => $data.form.sex = $event), n: common_vendor.p({ placement: "row", modelValue: $data.form.sex }), o: common_vendor.p({ labelWidth: "180rpx", borderBottom: true, label: "\u6027\u522B", prop: "sex" }), p: common_vendor.o(($event) => $data.form.cityName = $event), q: common_vendor.p({ disabled: true, disabledColor: "#ffffff", placeholder: "\u8BF7\u9009\u62E9\u6240\u5728\u57CE\u5E02", border: "none", modelValue: $data.form.cityName }), r: common_vendor.p({ name: "arrow-right" }), s: common_vendor.o(($event) => $data.cityShow = true), t: common_vendor.p({ labelWidth: "180rpx", prop: "cityId", borderBottom: true, label: "\u6240\u5728\u57CE\u5E02" }), v: common_vendor.o(($event) => $data.form.hospitalName = $event), w: common_vendor.p({ disabled: true, disabledColor: "#ffffff", placeholder: "\u8BF7\u9009\u62E9\u533B\u9662", border: "none", modelValue: $data.form.hospitalName }), x: common_vendor.p({ name: "arrow-right" }), y: common_vendor.o(($event) => $data.hospitalShow = true), z: common_vendor.p({ labelWidth: "180rpx", prop: "hospitalId", borderBottom: true, label: "\u5C31\u804C\u533B\u9662" }), A: common_vendor.o(($event) => $data.form.deptName = $event), B: common_vendor.p({ disabled: true, disabledColor: "#ffffff", placeholder: "\u8BF7\u9009\u62E9\u79D1\u5BA4", border: "none", modelValue: $data.form.deptName }), C: common_vendor.p({ name: "arrow-right" }), D: common_vendor.o(($event) => $data.deptShow = true), E: common_vendor.p({ labelWidth: "180rpx", prop: "deptId", borderBottom: true, label: "\u6240\u5C5E\u79D1\u5BA4" }), F: common_vendor.o(($event) => $data.form.position = $event), G: common_vendor.p({ disabled: true, disabledColor: "#ffffff", placeholder: "\u8BF7\u9009\u62E9\u804C\u79F0", border: "none", modelValue: $data.form.position }), H: common_vendor.p({ name: "arrow-right" }), I: common_vendor.o(($event) => $data.positionShow = true), J: common_vendor.p({ labelWidth: "180rpx", prop: "position", borderBottom: true, label: "\u804C\u79F0" }), K: common_vendor.o(($event) => $data.form.speciality = $event), L: common_vendor.p({ placeholder: "\u8BF7\u8F93\u5165\u64C5\u957F\u9886\u57DF", count: true, modelValue: $data.form.speciality }), M: common_vendor.p({ labelWidth: "180rpx", borderBottom: true, label: "\u64C5\u957F\u9886\u57DF", prop: "speciality" }), N: common_vendor.o(($event) => $data.form.introduction = $event), O: common_vendor.p({ placeholder: "\u8BF7\u8F93\u5165\u4E2A\u4EBA\u7B80\u4ECB", count: true, modelValue: $data.form.introduction }), P: common_vendor.p({ labelWidth: "180rpx", borderBottom: true, label: "\u4E2A\u4EBA\u7B80\u4ECB", prop: "introduction" }), Q: common_vendor.o($options.afterRead), R: common_vendor.o($options.deletePic), S: common_vendor.p({ fileList: $data.fileList1, name: "1", multiple: true, maxCount: 1 }), T: common_vendor.p({ labelWidth: "180rpx", borderBottom: true, label: "\u533B\u751F\u7167\u7247", prop: "avatar" }), U: common_vendor.o($options.afterRead), V: common_vendor.o($options.deletePic), W: common_vendor.p({ fileList: $data.fileList2, name: "2", multiple: true, maxCount: 2 }), X: common_vendor.p({ labelWidth: "180rpx", borderBottom: true, label: "\u8EAB\u4EFD\u8BC1\u7167\u7247(\u6B63\u53CD\u9762)", prop: "idCardFrontUrl" }), Y: common_vendor.o(($event) => $data.form.certificateCode = $event), Z: common_vendor.p({ border: "none", placeholder: "\u8BF7\u8F93\u5165\u8D44\u8D28\u8BC1\u7F16\u53F7", modelValue: $data.form.certificateCode }), aa: common_vendor.p({ labelWidth: "180rpx", borderBottom: true, label: "\u8D44\u8D28\u8BC1\u7F16\u53F7", prop: "certificateCode" }), ab: common_vendor.o($options.afterRead), ac: common_vendor.o($options.deletePic), ad: common_vendor.p({ fileList: $data.fileList3, name: "3", maxCount: 3 }), ae: common_vendor.p({ labelWidth: "180rpx", borderBottom: true, label: "\u8D44\u8D28\u8BC1\u4E66", prop: "certificateImages" }), af: common_vendor.o(($event) => $data.form.practiseCode = $event), ag: common_vendor.p({ border: "none", placeholder: "\u8BF7\u8F93\u5165\u6267\u4E1A\u8BC1\u7F16\u53F7", modelValue: $data.form.practiseCode }), ah: common_vendor.p({ labelWidth: "180rpx", borderBottom: true, label: "\u6267\u4E1A\u8BC1\u7F16\u53F7", prop: "practiseCode" }), ai: common_vendor.o($options.afterRead), aj: common_vendor.o($options.deletePic), ak: common_vendor.p({ fileList: $data.fileList4, name: "4", maxCount: 3 }), al: common_vendor.p({ labelWidth: "180rpx", borderBottom: true, label: "\u6267\u4E1A\u8BC1\u4E66", prop: "certificateImages" }), am: common_vendor.o(($event) => $data.form.mobile = $event), an: common_vendor.p({ border: "none", placeholder: "\u8BF7\u8F93\u5165\u8054\u7CFB\u7535\u8BDD", modelValue: $data.form.mobile }), ao: common_vendor.p({ labelWidth: "180rpx", borderBottom: true, label: "\u8054\u7CFB\u7535\u8BDD", prop: "mobile" }), ap: common_vendor.o(($event) => $data.form.account = $event), aq: common_vendor.p({ border: "none", placeholder: "\u8BF7\u8F93\u5165\u767B\u5F55\u5E10\u53F7", modelValue: $data.form.account }), ar: common_vendor.p({ labelWidth: "180rpx", borderBottom: true, label: "\u767B\u5F55\u5E10\u53F7", prop: "account" }), as: common_vendor.o(($event) => $data.form.password = $event), at: common_vendor.p({ border: "none", type: "password", placeholder: "\u8BF7\u8F93\u5165\u767B\u5F55\u5BC6\u7801", modelValue: $data.form.password }), av: common_vendor.p({ labelWidth: "180rpx", label: "\u767B\u5F55\u5BC6\u7801", prop: "password" }), aw: common_vendor.sr("uForm", "03357766-0"), ax: common_vendor.p({ rules: $data.rules, model: $data.form, labelPosition: "left" }), ay: common_vendor.p({ activeColor: "#2BC7B9", customStyle: { marginRight: "8px" }, label: "\u540C\u610F", name: 1 }), az: common_vendor.o(($event) => $data.checked = $event), aA: common_vendor.p({ placement: "column", modelValue: $data.checked }), aB: common_vendor.o(($event) => $options.openContent("doctorRegister")), aC: common_vendor.o(($event) => $options.openContent("doctorFiling")), aD: common_vendor.sr("cityPicker", "03357766-45"), aE: common_vendor.o(($event) => $data.cityShow = false), aF: common_vendor.o($options.citySelect), aG: common_vendor.o($options.cityChangeHandler), aH: common_vendor.p({ keyName: "n", show: $data.cityShow, columns: $data.citys }), aI: common_vendor.sr("deptPicker", "03357766-46"), aJ: common_vendor.o(($event) => $data.deptShow = false), aK: common_vendor.o($options.deptSelect), aL: common_vendor.p({ keyName: "deptName", show: $data.deptShow, columns: $data.depts }), aM: common_vendor.o(($event) => $data.hospitalShow = false), aN: common_vendor.o($options.hospitalSelect), aO: common_vendor.p({ keyName: "hospitalName", show: $data.hospitalShow, columns: $data.hospitals }), aP: common_vendor.sr("positionPicker", "03357766-48"), aQ: common_vendor.o(($event) => $data.positionShow = false), aR: common_vendor.o($options.positionSelect), aS: common_vendor.p({ keyName: "dictLabel", show: $data.positionShow, columns: $data.positions }), aT: common_vendor.o(($event) => $options.submit()) }); } var MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-03357766"], ["__file", "E:/Project/2023/\u95EE\u8BCA\u5E73\u53F0/his_user_miniapp/pages_user/registerDoctor.vue"]]); wx.createPage(MiniProgramPage);