Commit e0824c0c authored by jiangjiantao's avatar jiangjiantao

merge fix

parents 558e1348 aa0dfba9
......@@ -28,3 +28,5 @@ export const ACTION_ON_PAY_FAILED = "ACTION_ON_PAY_FAILED";
//去首页
export const ACTION_GO_HOME = "ACTION_GO_HOME";
//获取账户信息
export const ACTION_GET_ACCOUNT = "ACTION_GET_ACCOUNT";
......@@ -63,8 +63,9 @@ Page({
my.ix.onBuddyMessage({
success: (res) => {
console.info(`onBuddyMessage success: ${JSON.stringify(res)}`);
if(res.action == ACTION_GO_SCAN){
if(res.action == ACTION_GO_SCAN){//返回扫码页
//增加跳转回去的内容
my.navigateBack();
} else {
//未知指令
}
......
import { API_USE_COUPON } from '../../const/apiurl'
<<<<<<< HEAD
=======
var api = require("../../utils/api.js");
import { Page } from '../../utils/scan';
>>>>>>> aa0dfba9ee3f14735718232a68135631a24f8e7c
import { API_USE_COUPON } from '../../const/apiurl'
import { ACTION_GO_SCAN } from '../../const/actioncmd'
import { ACTION_GET_ACCOUNT } from '../../const/actioncmd'
Page({
data: {
......@@ -35,8 +39,26 @@ Page({
console.info(`sendBuddyMessage failed: ${JSON.stringify(res)}`);
}
});
} else {
//未知指令
} else if(res.action == ACTION_GET_ACCOUNT){
var message = {
data:getApp().globalData.localAccountInfo,
action:ACTION_GET_ACCOUNT
}
my.ix.sendBuddyMessage({
// 填入目标小程序的 AppID
target: getApp().globalData.backScreenAppId,
data: {
action: ACTION_GET_ACCOUNT,
data: message
},
success: (res) => {
console.info(`sendBuddyMessage success: ${JSON.stringify(res)}`);
},
fail: (res) => {
console.info(`sendBuddyMessage failed: ${JSON.stringify(res)}`);
}
});
}
}
});
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment