1 |
- "use strict";var g=Object.defineProperty,f=Object.defineProperties;var I=Object.getOwnPropertyDescriptors;var d=Object.getOwnPropertySymbols;var x=Object.prototype.hasOwnProperty,y=Object.prototype.propertyIsEnumerable;var c=(t,i,o)=>i in t?g(t,i,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[i]=o,l=(t,i)=>{for(var o in i||(i={}))x.call(i,o)&&c(t,o,i[o]);if(d)for(var o of d(i))y.call(i,o)&&c(t,o,i[o]);return t},h=(t,i)=>f(t,I(i));var e=require("../common/vendor.js"),p=require("../api/packageOrder.js");require("../common/request.js");const v={data(){return{content:null,show:!1,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,choose:0}},onLoad(t){this.packageId=t.packageId,this.doctorId=t.doctorId,this.choose=t.choose||0,this.$isEmpty(t.companyId)||(this.companyId=t.companyId),this.$isEmpty(t.companyUserId)||(this.companyUserId=t.companyUserId);var i=this;e.index.$on("refreshOrderPatient",o=>{i.patient=o}),this.item=this.items[0],this.addMsg(1,this.item.title)},onShow(){},methods:{close(){this.show=!1},confirm(){this.isComplete==1?this.submit():e.index.navigateBack()},addMsg(t,i){var o={type:t,content:i};this.msgs.push(o);var r=this;e.index.createSelectorQuery().select(".msgs").boundingClientRect(n=>{const a=n.height;r.scrollTop=a,console.log(r.scrollTop)}).exec()},optionClick(t,i){if(this.patient==null){e.index.showToast({icon:"none",title:"\u8BF7\u9009\u62E9\u5C31\u8BCA\u4EBA"});return}if(i.value==0){this.content=this.notice[1].title,this.show=!0,this.isComplete=0;return}if(t.option=i.name,console.log(t.option),this.addMsg(2,i.name),this.index++,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=!0,this.isComplete=1;return}},addPatient(){e.index.navigateTo({url:"/pages_user/patient"})},submit(){e.index.showLoading({title:"\u5904\u7406\u4E2D..."});var t={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)};if(this.choose==1||this.choose==2){this.giftCreateOrder(t);return}p.create(t).then(i=>{if(e.index.hideLoading(),i.code==200){var o=["jARl4BpoBkRu-2MxPMkQVhIfGMG0V9qW-X3V_7NtEOU"];e.index.requestSubscribeMessage({tmplIds:o,success(r){setTimeout(function(){e.index.navigateTo({url:"/pages_order/packageOrderPay?orderId="+i.order.orderId})},200)},fail(r){setTimeout(function(){e.index.navigateTo({url:"/pages_order/packageOrderPay?orderId="+i.order.orderId})},200)}})}else e.index.showToast({icon:"none",title:i.msg})})},giftCreateOrder(t){const i=h(l({},t),{choose:this.choose});p.giftCreate(i).then(o=>{if(e.index.hideLoading(),o.code==200){var r=["jARl4BpoBkRu-2MxPMkQVhIfGMG0V9qW-X3V_7NtEOU"];e.index.requestSubscribeMessage({tmplIds:r,success(n){setTimeout(function(){e.index.navigateTo({url:"/pages_order/packageOrderPay?orderId="+o.order.orderId})},200)},fail(n){setTimeout(function(){e.index.navigateTo({url:"/pages_order/packageOrderPay?orderId="+o.order.orderId})},200)}})}else e.index.showToast({icon:"none",title:o.msg})})}}};Array||e.resolveComponent("u-modal")();const _=()=>"../uni_modules/uview-plus/components/u-modal/u-modal.js";Math||_();function k(t,i,o,r,n,a){return e.e({a:n.patient==null},n.patient==null?{b:e.o(s=>a.addPatient())}:{},{c:n.patient!=null},n.patient!=null?e.e({d:e.t(n.patient.patientName),e:n.patient.sex==1},n.patient.sex==1?{}:{},{f:n.patient.sex==2},n.patient.sex==2?{}:{},{g:e.t(t.$getAge(n.patient.birthday)),h:e.t(t.$parseIdCard(n.patient.idCard)),i:e.o(s=>a.addPatient())}):{},{j:e.f(n.msgs,(s,m,u)=>e.e({a:s.type==1},s.type==1?{b:e.t(s.content)}:{},{c:s.type==2},s.type==2?{d:e.t(s.content)}:{})),k:n.scrollTop,l:n.item!=null},n.item!=null?{m:e.t(n.item.title),n:e.f(n.item.options,(s,m,u)=>({a:e.t(s.name),b:e.n(s.color=="red"?"option-item red":"option-item green"),c:e.o(M=>a.optionClick(n.item,s))}))}:{},{o:e.o(s=>a.close()),p:e.o(s=>a.confirm()),q:e.p({show:n.show,title:"\u6E29\u99A8\u63D0\u793A",content:n.content})})}var T=e._export_sfc(v,[["render",k],["__file","E:/Project/2023/\u95EE\u8BCA\u5E73\u53F0/his_user_miniapp/pages_index/packageForm.vue"]]);wx.createPage(T);
|