"use strict";const e=require("../vendor.js"),o=require("./naviHelper.js"),t=require("./apiLoading.js"),n=require("../../gen/Apis.js");exports.navigateToMiniProgram=function(o){e.index.showLoading({title:"加载中",mask:!0}),e.index.navigateToMiniProgram({appId:"wx31500e871924b903",path:(null==o?void 0:o.path)||"",extraData:(null==o?void 0:o.extraData)||{},envVersion:(null==o?void 0:o.envVersion)||"release",success(){e.index.hideLoading()},fail(){e.index.hideLoading()}})},exports.sendChatMessage=function(t){if(!(null==t?void 0:t.page))return o.showToast("请设置跳转页面路径!");e.index.showLoading({title:"加载中...",mask:!0}),e.index.qy.sendChatMessage({msgtype:(null==t?void 0:t.msgtype)||"miniprogram",enterChat:(null==t?void 0:t.enterChat)||!1,miniprogram:{appid:"wx31500e871924b903",title:(null==t?void 0:t.title)||"邀请你绑定房屋",imgUrl:(null==t?void 0:t.imgUrl)||"https://pay-prod-1369486729.cos.ap-guangzhou.myqcloud.com/uploads/cs-test/01K58GCT5DGWKBSYH0G7118XT4.jpg",page:null==t?void 0:t.page},success:function(){e.index.hideLoading(),o.showToast("发送成功!")},fail:function(t){console.log("sendChatMessage fail",t),e.index.hideLoading(),"qy__sendChatMessage:fail cancel"!==(null==t?void 0:t.errMsg)&&o.showToast((null==t?void 0:t.errMsg)||"当前操作,只能在企业微信上聊天工具栏操作")}})},exports.shareToExternalChatTask=function(s,a){e.index.qy.shareToExternalChat({text:{content:(null==s?void 0:s.content)||""},attachments:(null==s?void 0:s.attachments)||[],success:function(e){t.getApiLoading(n.Apis.Customer.CustomerMomentTasks.Store,a).then((e=>{o.showToast("发送成功!"),console.log(e)})),console.log("success",e)},fail(){console.log("fail")},complete(){console.log("complete")}})},exports.shareToExternalContact=function(t){if(!(null==t?void 0:t.page))return o.showToast("请设置跳转页面路径!");e.index.showLoading({title:"加载中...",mask:!0}),e.index.qy.shareToExternalContact({externalUserIds:(null==t?void 0:t.externalUserIds)||[],text:{content:(null==t?void 0:t.title)||"待缴费账单"},attachments:[{msgtype:(null==t?void 0:t.msgtype)||"miniprogram",miniprogram:{appid:"wx31500e871924b903",title:(null==t?void 0:t.title)||"待缴费账单",imgUrl:(null==t?void 0:t.imgUrl)||"https://pay-prod-1369486729.cos.ap-guangzhou.myqcloud.com/uploads/cs-test/01K58GCT5DGWKBSYH0G7118XT4.jpg",page:null==t?void 0:t.page}}],success:function(){e.index.hideLoading(),o.showToast("发送成功!")},fail:function(t){console.log("sendChatMessage fail",t),e.index.hideLoading(),"qy__sendChatMessage:fail cancel"!==(null==t?void 0:t.errMsg)&&o.showToast((null==t?void 0:t.errMsg)||"当前操作,只能在企业微信上聊天工具栏操作")}})},exports.shareToExternalContactTask=function(s,a){e.index.qy.shareToExternalContact({text:{content:(null==s?void 0:s.content)||""},attachments:(null==s?void 0:s.attachments)||[],success:function(e){console.log("shareToExternalContact",e),t.getApiLoading(n.Apis.Customer.CustomerMomentTasks.Store,a).then((e=>{o.showToast("发送成功!"),console.log(e)})),console.log("success",e)},fail(){console.log("fail")},complete(){console.log("complete")}})},exports.shareToExternalMoments=function(s,a){console.log("shareToExternalMoments",s,a),e.wx$1.qy.shareToExternalMoments({text:{content:(null==s?void 0:s.content)||""},attachments:null==s?void 0:s.attachments,success(e){"qy__shareToExternalMoments:ok"==e.errMsg&&t.getApiLoading(n.Apis.Customer.CustomerMomentTasks.Store,a).then((e=>{o.showToast("发送成功!"),console.log(e)})),console.log("分享回调结果success",e)}},(function(e){console.log("分享回调结果",e),"shareToExternalMoments:ok"==e.err_msg&&t.getApiLoading(n.Apis.Customer.CustomerMomentTasks.Store,a).then((e=>{o.showToast("发送成功!"),console.log(e)}))}))};