Commit dfdf1a77 authored by jiangjiantao's avatar jiangjiantao

回退页面

parent e3989226
......@@ -62,4 +62,7 @@ export const ACTION_GET_CUR_AD = "ACTION_GET_CUR_AD";
export const ACTION_SEND_SEL_AD = "ACTION_SEND_SEL_AD";
//系统设置
export const ACTION_SYSTEM_SETTING = "ACTION_SYSTEM_SETTING";
\ No newline at end of file
export const ACTION_SYSTEM_SETTING = "ACTION_SYSTEM_SETTING";
//结算页面back到扫商品页面
export const ACTION_BALANCE_BACK_GOODS = "ACTION_BALANCE_BACK_GOODS";
......@@ -3,6 +3,7 @@ var payUtils = require("../../utils/payUtils.js");
import { ACTION_GO_SCAN, ACTION_GO_HOME } from '../../const/actioncmd'
import { ACTION_ON_PAY_SUCCESS } from '../../const/actioncmd'
import { ACTION_ON_PAY_FAILED } from '../../const/actioncmd'
import { ACTION_BALANCE_BACK_GOODS } from '../../const/actioncmd'
Page({
data: {
......@@ -16,6 +17,24 @@ Page({
isPaying: false,
},
//回退到上一个页面
onBack(e) {
my.ix.sendBuddyMessage({
// 填入目标小程序的 AppID
target: getApp().globalData.backScreenAppId,
data: {
action: ACTION_BALANCE_BACK_GOODS,
data: null
},
success: (res) => {
e.preventDefault();
},
fail: (res) => {
console.info(`sendBuddyMessage failed: ${JSON.stringify(res)}`);
}
});
},
onReady() {
if (my.canIUse('hideBackHome')) {
my.hideBackHome();
......
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