123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081 |
- import { getDepositDetails, getsubscribeID } from "./service";
- import { reportApi } from "../../utils/cloudMonitorHelper";
- Component({
- data: {
- showSubscrible: true,
- // 是否显示订阅部分
- detail: null,
- // 缴纳详情
- isReady: false,
- },
- didMount() {
- const { depositId } = this.$page.data.query || {};
- this.getDepositDetailsFn(depositId);
- // 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) => {
- this.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) {
- try {
- const detail = await getDepositDetails({
- depositId,
- });
- this.setData({
- detail,
- });
- } catch (error) {
- console.log(error, "error");
- }
- },
- },
- });
|