|
@@ -1,60 +1,22 @@
|
|
|
-import { patientUpdate } from "../patient-detail/service";
|
|
|
-import getEncryptStr from "../../utils/getEncryptStr";
|
|
|
+import { getGuideList } from "../../../../core/utils/ywtService";
|
|
|
Component({
|
|
|
props: {},
|
|
|
data: {
|
|
|
- phone: "",
|
|
|
+ clinicGuideList: []
|
|
|
},
|
|
|
|
|
|
- didMount() {},
|
|
|
+ didMount() {
|
|
|
+ this.guideList()
|
|
|
+ },
|
|
|
|
|
|
methods: {
|
|
|
- onInput(e) {
|
|
|
- this.setData({
|
|
|
- phone: e.detail.value,
|
|
|
- });
|
|
|
- },
|
|
|
-
|
|
|
- choosePhoneContact() {
|
|
|
- my.choosePhoneContact({
|
|
|
- success: (result) => {
|
|
|
- const { mobile } = result;
|
|
|
- this.setData({
|
|
|
- phone: mobile.replace(/(\s|-|\+)/g, ""),
|
|
|
- });
|
|
|
- },
|
|
|
- });
|
|
|
- },
|
|
|
-
|
|
|
- async onSave() {
|
|
|
- const {
|
|
|
- query = {
|
|
|
- id: "",
|
|
|
- relationShip: "",
|
|
|
- },
|
|
|
- } = this.$page.data;
|
|
|
- const phoneNumber = this.data.phone;
|
|
|
-
|
|
|
- if (/^[1]([3-9])[0-9]{9}$/.test(phoneNumber)) {
|
|
|
- patientUpdate({
|
|
|
- id: query.id,
|
|
|
- // relationShip: query.relationShip,
|
|
|
- phoneNumber: await getEncryptStr(this.data.phone),
|
|
|
- }).then(() => {
|
|
|
- my.navigateBack();
|
|
|
- });
|
|
|
- } else {
|
|
|
- my.showToast({
|
|
|
- type: "fail",
|
|
|
- content: "手机号错误",
|
|
|
- duration: 3000,
|
|
|
- success: () => {
|
|
|
- this.setData({
|
|
|
- phone: "",
|
|
|
- });
|
|
|
- },
|
|
|
- });
|
|
|
- }
|
|
|
- },
|
|
|
+ async guideList(pageIndex = 1, pageSize = 50, hospitalId = 41) {
|
|
|
+ const [err, result] = await getGuideList({pageIndex, pageSize, hospitalId});
|
|
|
+ if(!err) {
|
|
|
+ this.setData({
|
|
|
+ clinicGuideList: result.list
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
},
|
|
|
});
|