提交 92e0b341 作者: 王进

增加客服切支付逻辑

上级 ab39c852
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* @time: 2018-09-19 * @time: 2018-09-19
*/ */
class WechatSDK { class WechatSDK {
private sdkVersion: string = '1.5' private sdkVersion: string = '2.0'
public constructor() { public constructor() {
this.sdkInit() this.sdkInit()
this.timerInit(); this.timerInit();
...@@ -162,6 +162,20 @@ class WechatSDK { ...@@ -162,6 +162,20 @@ class WechatSDK {
} }
_selt.navigateToMiniProgram(params); _selt.navigateToMiniProgram(params);
return 2; // 切支付状态 return 2; // 切支付状态
} else if (res.data.open_customer_service) { // 客服切支付
let order = {
sessionFrom: 'order_id=' + res.data.order_num || ''
}
console.log('##客服切支付:', order);
const params = {
title: '充值教程',
content: '即将跳转官方【客服会话】进行充值, 向客服回复【充值】获取充值链接',
showCancel: false,
success: function () {
_selt.Customer(order);
}
}
_selt.showModal(params);
} else { } else {
// 根据返回的用户订单状态判断是新订单还是未完成订单 // 根据返回的用户订单状态判断是新订单还是未完成订单
if (res.data.order_type == 1) { // 新订单 if (res.data.order_type == 1) { // 新订单
...@@ -544,9 +558,9 @@ class WechatSDK { ...@@ -544,9 +558,9 @@ class WechatSDK {
}) })
} }
// 客服 // 客服
public Customer() { public Customer(_orderInfo?) {
try { try {
(wx as any).openCustomerServiceConversation({}) (wx as any).openCustomerServiceConversation(_orderInfo)
} catch (err) { } catch (err) {
console.log("访问客服异常-->", err) console.log("访问客服异常-->", err)
} }
...@@ -575,9 +589,7 @@ class WechatSDK { ...@@ -575,9 +589,7 @@ class WechatSDK {
} }
// 定义wechat方法 // 定义wechat方法
public async getUserInfo(): Promise<any> { public async getUserInfo(): Promise<any> {
const _selt = this const _selt = this;
// const isAuthorize = _selt.ReportParams.from && (Object.keys(_selt.getAuthorize).length > 0) ? _selt.getAuthorize[_selt.ReportParams.from] : false
// if (isAuthorize) {
return new Promise(async function (resolve, reject) { return new Promise(async function (resolve, reject) {
let status = await _selt._getSetting(); let status = await _selt._getSetting();
console.log("@@SDK用户授权状态", status) console.log("@@SDK用户授权状态", status)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论