1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283 |
- import { getDepositDetails, getsubscribeID } from "./service";
- import { reportApi } from "../../utils/cloudMonitorHelper";
- Component({
- data: {
- showSubscrible: true,
- // 是否显示订阅部分
- detail: null,
- // 缴纳详情
- isReady: false,
- },
- didMount() {
- const { depositId, inpatientId } = this.$page.data.query || {};
- this.getDepositDetailsFn(depositId, inpatientId);
- // this.subscribeMsg();
- /* 服务办结,押金缴纳完成 */
- reportApi("押金缴纳完成");
- },
- methods: {
- subscribeMsg() {
- const pluginId = 2021001155639035;
- my.loadPlugin({
- plugin: `${pluginId}@*`,
- success: () => {
- this.setData({
- isReady: true,
- }); // 储存插件实列
- // eslint-disable-next-line no-undef
- const pluginInstance = requirePlugin(`dynamic-plugin://${pluginId}`);
- this.requestSubscribeMessage = pluginInstance.requestSubscribeMessage;
- },
- });
- },
- showSubscrible() {
- this.setData({
- showSubscrible: false,
- });
- },
- // 订阅插件要用时,请放开注释
- requestSubscribeMessageFn(subscribeID) {
- return new Promise((resolve) => {
- my.requestSubscribeMessage({
- // 模板id列表,最多3个
- entityIds: [subscribeID],
- callback() {
- resolve(true);
- },
- });
- });
- },
- async gotoSubscrible() {
- try {
- const subscribeID = await getsubscribeID();
- await this.requestSubscribeMessageFn(subscribeID.depositTemplateId);
- } catch (error) {
- console.log(error, "error");
- }
- },
- // 获取支付详情
- async getDepositDetailsFn(depositId, inpatientId) {
- try {
- const detail = await getDepositDetails({
- depositId,
- hisPatientId: inpatientId,
- receiptNo: depositId,
- });
- this.setData({
- detail,
- });
- } catch (error) {
- console.log(error, "error");
- }
- },
- },
- });
|