123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216 |
- "use strict";
- var common_vendor = require("../common/vendor.js");
- var api_packageOrder = require("../api/packageOrder.js");
- require("../common/request.js");
- const _sfc_main = {
- data() {
- return {
- content: null,
- show: false,
- scrollTop: 0,
- patient: null,
- items: [
- {
- title: "\u60A8\u662F\u5426\u5DF2\u5728\u7EBF\u4E0B\u5C31\u8BCA\uFF0C\u4E14\u5BF9\u6240\u8D2D\u4E70\u7684\u836F\u54C1\u65E0\u8FC7\u654F\u6216\u4E0D\u826F\u53CD\u5E94\uFF1F",
- options: [
- { name: "\u662F\uFF0C\u6211\u7EBF\u4E0B\u5C31\u8BCA\u8FC7", value: 1, color: "green" },
- { name: "\u65E0\uFF0C\u4ECE\u672A\u5C31\u8BCA", value: 0, color: "red" }
- ]
- },
- {
- title: "\u60A8\u662F\u5426\u5DF2\u8BE6\u7EC6\u9605\u8BFB\u836F\u7269\u8BF4\u660E\uFF0C\u786E\u8BA4\u81EA\u5DF1\u7B26\u5408\u836F\u7269\u9002\u7528\u4EBA\u7FA4\uFF0C\u5E76\u4E86\u89E3\u7528\u836F\u65B9\u6CD5\u3001\u7528\u836F\u7981\u5FCC\u7B49\u4FE1\u606F?",
- options: [
- { name: "\u662F\uFF0C\u6211\u5DF2\u5145\u5206\u4E86\u89E3", value: 1, color: "green" },
- { name: "\u5426\uFF0C\u672A\u9605\u8BFB", value: 0, color: "red" }
- ]
- }
- ],
- msgs: [],
- index: 0,
- item: null,
- notice: [
- { title: "\u597D\u7684\u3002\u6211\u5C06\u6839\u636E\u60A8\u63D0\u4EA4\u7684\u590D\u8BCA\u4FE1\u606F\u5F00\u5177\u5904\u65B9\uFF0C\u8BF7\u8BE6\u7EC6\u9605\u8BFB\u836F\u54C1\u8BF4\u660E\u4E66\uFF0C\u9075\u533B\u5631\u7528\u836F\u3002" },
- { title: "\u60A8\u5B58\u5728\u7528\u836F\u7981\u5FCC\u8BC1\uFF0C\u76EE\u524D\u4E0D\u63A8\u8350\u8D2D\u4E70\u6B64\u5957\u9910\u5305\u3002\u5EFA\u8BAE\u60A8\u5C3D\u65E9\u5C31\u533B\uFF0C\u5728\u533B\u751F\u6307\u5BFC\u4E0B\u91C7\u53D6\u9488\u5BF9\u6027\u7684\u6CBB\u7597\u63AA\u65BD!\u5728\u6539\u5584\u76F8\u5173\u7981\u5FCC\u8BC1\u540E\uFF0C\u4E5F\u53EF\u4EE5\u518D\u6B21\u54A8\u8BE2\uFF0C\u91CD\u65B0\u8BC4\u4F30\u662F\u5426\u53EF\u4EE5\u4F7F\u7528\u8BE5\u5957\u9910\u5305\u3002" }
- ],
- packageId: null,
- doctorId: null,
- isComplete: 0,
- companyUserId: null,
- companyId: null
- };
- },
- onLoad(option) {
- this.packageId = option.packageId;
- this.doctorId = option.doctorId;
- if (!this.$isEmpty(option.companyId)) {
- this.companyId = option.companyId;
- }
- if (!this.$isEmpty(option.companyUserId)) {
- this.companyUserId = option.companyUserId;
- }
- var that = this;
- common_vendor.index.$on("refreshOrderPatient", (res) => {
- that.patient = res;
- });
- this.item = this.items[0];
- this.addMsg(1, this.item.title);
- },
- onShow() {
- },
- methods: {
- close() {
- this.show = false;
- },
- confirm() {
- if (this.isComplete == 1) {
- this.submit();
- } else {
- common_vendor.index.navigateBack();
- }
- },
- addMsg(type, content) {
- var msg = { type, content };
- this.msgs.push(msg);
- var that = this;
- common_vendor.index.createSelectorQuery().select(".msgs").boundingClientRect((res) => {
- const scrollH = res.height;
- that.scrollTop = scrollH;
- console.log(that.scrollTop);
- }).exec();
- },
- optionClick(item, option) {
- if (this.patient == null) {
- common_vendor.index.showToast({
- icon: "none",
- title: "\u8BF7\u9009\u62E9\u5C31\u8BCA\u4EBA"
- });
- return;
- }
- if (option.value == 0) {
- this.content = this.notice[1].title;
- this.show = true;
- this.isComplete = 0;
- return;
- }
- item.option = option.name;
- console.log(item.option);
- this.addMsg(2, option.name);
- this.index++;
- if (this.index <= this.items.length - 1) {
- this.item = this.items[this.index];
- this.addMsg(1, this.item.title);
- } else {
- this.content = this.notice[0].title;
- this.show = true;
- this.isComplete = 1;
- return;
- }
- },
- addPatient() {
- common_vendor.index.navigateTo({
- url: "/pages_user/patient"
- });
- },
- submit() {
- common_vendor.index.showLoading({
- title: "\u5904\u7406\u4E2D..."
- });
- var data = {
- companyId: this.companyId,
- companyUserId: this.companyUserId,
- patientId: this.patient.patientId,
- patientJson: JSON.stringify(this.patient),
- packageId: this.packageId,
- doctorId: this.doctorId,
- formJson: JSON.stringify(this.items)
- };
- api_packageOrder.create(data).then((res) => {
- common_vendor.index.hideLoading();
- if (res.code == 200) {
- var temps = ["jARl4BpoBkRu-2MxPMkQVhIfGMG0V9qW-X3V_7NtEOU"];
- common_vendor.index.requestSubscribeMessage({
- tmplIds: temps,
- success(e) {
- setTimeout(function() {
- common_vendor.index.navigateTo({
- url: "/pages_order/packageOrderPay?orderId=" + res.order.orderId
- });
- }, 200);
- },
- fail(e) {
- setTimeout(function() {
- common_vendor.index.navigateTo({
- url: "/pages_order/packageOrderPay?orderId=" + res.order.orderId
- });
- }, 200);
- }
- });
- } else {
- common_vendor.index.showToast({
- icon: "none",
- title: res.msg
- });
- }
- });
- }
- }
- };
- if (!Array) {
- const _easycom_u_modal2 = common_vendor.resolveComponent("u-modal");
- _easycom_u_modal2();
- }
- const _easycom_u_modal = () => "../uni_modules/uview-plus/components/u-modal/u-modal.js";
- if (!Math) {
- _easycom_u_modal();
- }
- function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
- return common_vendor.e({
- a: $data.patient == null
- }, $data.patient == null ? {
- b: common_vendor.o(($event) => $options.addPatient())
- } : {}, {
- c: $data.patient != null
- }, $data.patient != null ? common_vendor.e({
- d: common_vendor.t($data.patient.patientName),
- e: $data.patient.sex == 1
- }, $data.patient.sex == 1 ? {} : {}, {
- f: $data.patient.sex == 2
- }, $data.patient.sex == 2 ? {} : {}, {
- g: common_vendor.t(_ctx.$getAge($data.patient.birthday)),
- h: common_vendor.t(_ctx.$parseIdCard($data.patient.idCard)),
- i: common_vendor.o(($event) => $options.addPatient())
- }) : {}, {
- j: common_vendor.f($data.msgs, (item, index, i0) => {
- return common_vendor.e({
- a: item.type == 1
- }, item.type == 1 ? {
- b: common_vendor.t(item.content)
- } : {}, {
- c: item.type == 2
- }, item.type == 2 ? {
- d: common_vendor.t(item.content)
- } : {});
- }),
- k: $data.scrollTop,
- l: $data.item != null
- }, $data.item != null ? {
- m: common_vendor.t($data.item.title),
- n: common_vendor.f($data.item.options, (option, opIndex, i0) => {
- return {
- a: common_vendor.t(option.name),
- b: common_vendor.n(option.color == "red" ? "option-item red" : "option-item green"),
- c: common_vendor.o(($event) => $options.optionClick($data.item, option))
- };
- })
- } : {}, {
- o: common_vendor.o(($event) => $options.close()),
- p: common_vendor.o(($event) => $options.confirm()),
- q: common_vendor.p({
- show: $data.show,
- title: "\u6E29\u99A8\u63D0\u793A",
- content: $data.content
- })
- });
- }
- var MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "E:/Project/2023/\u95EE\u8BCA\u5E73\u53F0/his_user_miniapp/pages_index/packageForm.vue"]]);
- wx.createPage(MiniProgramPage);
|