Commit 97f9d805 authored by jiangjiantao's avatar jiangjiantao

bugfix

parent a6a972cd
...@@ -13,15 +13,11 @@ Page({ ...@@ -13,15 +13,11 @@ Page({
}, },
onshow(){ onShow(){
my.ix.onBuddyMessage({ my.ix.onBuddyMessage({
success: (res) => { success: (res) => {
console.info(`onBuddyMessage success: ${JSON.stringify(res)}`); console.info(`onBuddyMessage success: ${JSON.stringify(res)}`);
if(res.action == ACTION_GO_SCAN){ if(res.action == ACTION_GO_SCAN){
//跳转到扫码页面
my.redirectTo({
url: "/pages/scan/scan"
});
my.ix.sendBuddyMessage({ my.ix.sendBuddyMessage({
// 填入目标小程序的 AppID // 填入目标小程序的 AppID
target: getApp().globalData.backScreenAppId, target: getApp().globalData.backScreenAppId,
...@@ -31,6 +27,10 @@ Page({ ...@@ -31,6 +27,10 @@ Page({
}, },
success: (res) => { success: (res) => {
console.info(`sendBuddyMessage success: ${JSON.stringify(res)}`); console.info(`sendBuddyMessage success: ${JSON.stringify(res)}`);
//跳转到扫码页面
my.reLaunch({
url: "/pages/scan/scan",
});
}, },
fail: (res) => { fail: (res) => {
console.info(`sendBuddyMessage failed: ${JSON.stringify(res)}`); console.info(`sendBuddyMessage failed: ${JSON.stringify(res)}`);
......
import { ACTION_PRINT_RESULT } from '../../const/actioncmd' import { ACTION_PRINT_RESULT } from '../../const/actioncmd'
import { ACTION_REPRINT } from '../../const/actioncmd' import { ACTION_REPRINT } from '../../const/actioncmd'
import { ACTION_GO_HOME } from '../../const/actioncmd'
Page({ Page({
data: { data: {
...@@ -125,8 +126,11 @@ Page({ ...@@ -125,8 +126,11 @@ Page({
if (res.action == ACTION_REPRINT) { if (res.action == ACTION_REPRINT) {
//重新打印 //重新打印
this.print(); this.print();
} else { } else if(res.action == ACTION_GO_HOME) {
//未知指令 //去首页
my.reLaunch({
url: "/pages/home/home",
});
} }
} }
}); });
......
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