Commit b5f4c19a authored by gaodapeng's avatar gaodapeng

增加发送系统设置事件

parent 69110abc
......@@ -61,6 +61,9 @@ export const ACTION_SEND_SEL_AD = "ACTION_SEND_SEL_AD";
//使用优惠券
export const ACTION_USE_COUPON = "ACTION_USE_COUPON";
//系统设置
export const ACTION_SYSTEM_SETTING = "ACTION_SYSTEM_SETTING";
const FLOW_IDLE = "idle";
const FLOW_COLLECTIONS = "collections";//收款
const FLOW_REFUND = "refund";//退款
......
......@@ -1062,6 +1062,7 @@
/**
海报页面样式
*/
.posterPage {
display: flex;
flex-direction: column;
......@@ -1158,9 +1159,11 @@
align-content: center;
}
.posterSelected image{
.posterSelected image {
border-radius: 5rpx;
border: 0rpx solid white;
}
/* 关于系统 */
.about-system-top {
......
var api = require("../../utils/api.js");
import {
ACTION_USE_COUPON,ACTION_GOODS,ACTION_MEMBER,
ACTION_GO_BALANCE,ACTION_REQUEST_GOOD_INFO,ACTION_PRINT_RESULT,
ACTION_REPRINT,ACTION_GO_SCAN,ACTION_ON_PAY_SUCCESS,
ACTION_ON_PAY_FAILED,ACTION_GO_HOME,ACTION_GET_ACCOUNT,
ACTION_DIRECT_PAYMENT,ACTION_CONVERT_COUPON,ACTION_LOGIN_OK,
ACTION_REFUND,ACTION_REFUND_SUCCESS,ACTION_REFUND_FAILED,
import {
ACTION_USE_COUPON, ACTION_GOODS, ACTION_MEMBER,
ACTION_GO_BALANCE, ACTION_REQUEST_GOOD_INFO, ACTION_PRINT_RESULT,
ACTION_REPRINT, ACTION_GO_SCAN, ACTION_ON_PAY_SUCCESS,
ACTION_ON_PAY_FAILED, ACTION_GO_HOME, ACTION_GET_ACCOUNT,
ACTION_DIRECT_PAYMENT, ACTION_CONVERT_COUPON, ACTION_LOGIN_OK,
ACTION_REFUND, ACTION_REFUND_SUCCESS, ACTION_REFUND_FAILED,
ACTION_PRINT_LAST_ORDER, ACTION_GET_CUR_AD, ACTION_SEND_SEL_AD,
} from '../../const/actioncmd'
ACTION_SYSTEM_SETTING,
} from '../../const/actioncmd'
import { FLOW_IDLE, FLOW_COLLECTIONS, FLOW_REFUND, FLOW_DIRECT_PAYMENT } from '../../const/actioncmd'
......@@ -51,7 +52,7 @@ Page({
//优惠券 0关闭 录入券弹窗 1等待录入 2.录入中 3.录入成功 4.录入失败
discCouponState: 0,
discCouponMsg: "录入失败!无效的优惠券码",
discCouponPrice : 0,
discCouponPrice: 0,
//兑换券 0关闭兑换券弹窗 1等待兑换 2.兑换中 3.兑换成功 4.兑换失败
convertCouponState: 0,
......@@ -309,14 +310,14 @@ Page({
});
//跳转广告页面
context.goPage('poster');
}else if(res.action == ACTION_USE_COUPON){
} else if (res.action == ACTION_USE_COUPON) {
//优惠券
let coupon = res.data
context.setData({
discCouponState:coupon.discCouponState,
discCouponMsg:coupon.discCouponMsg,
discCouponPrice:coupon.discCouponPrice
})
let coupon = res.data
context.setData({
discCouponState: coupon.discCouponState,
discCouponMsg: coupon.discCouponMsg,
discCouponPrice: coupon.discCouponPrice
})
}
}
......@@ -483,6 +484,20 @@ Page({
* 系统设置
*/
onHomeSysSettingClicked() {
my.ix.sendBuddyMessage({
// 填入目标小程序的 AppID
target: getApp().globalData.frontScreenAppId,
data: {
action: ACTION_SYSTEM_SETTING,
data: null
},
success: (res) => {
console.info(`sendBuddyMessage success: ${JSON.stringify(res)}`);
},
fail: (res) => {
console.info(`sendBuddyMessage failed: ${JSON.stringify(res)}`);
}
});
},
/**
......@@ -546,9 +561,9 @@ Page({
totalDisc: 0.00,
goods: [
],
discCouponState:0,
discCouponMsg:"",
discCouponPrice:0,
discCouponState: 0,
discCouponMsg: "",
discCouponPrice: 0,
})
var commonRequest = {
......@@ -813,7 +828,7 @@ Page({
target: getApp().globalData.frontScreenAppId,
data: commonRequest,
success: (res) => {
context.goPage('waitoperate');
context.goPage('waitoperate');
console.log("通知前屏跳转到结算页面 成功 ===》" + JSON.stringify(res));
},
fail: (res) => {
......@@ -895,12 +910,12 @@ Page({
convertCouponClose(e) {
this.setData({ convertCouponState: 0 })
var request = {};
request.convertCouponState = 0;
request.convertCouponState = 0;
this.sendConvertCouponToFront(request)
},
//发送优惠券到前屏
//发送优惠券到前屏
sendDiscCouponToFront(res) {
let context = this;
my.ix.sendBuddyMessage({
......@@ -939,14 +954,14 @@ Page({
//用券返回
couponBack(e) {
this.setData({ discCouponState: 0 })
this.sendDiscCouponToFront(0)
this.setData({ discCouponState: 0 })
this.sendDiscCouponToFront(0)
},
//使用券
useCoupon(e) {
this.setData({ discCouponState: 1 })
var request = {};
request.discCouponState = 1;
request.discCouponState = 1;
request.discCouponPrice = this.data.discCouponPrice
this.sendDiscCouponToFront(request)
},
......@@ -1138,7 +1153,7 @@ Page({
//回首页
this.goPage('home');
},
//打印标识位
onPrintEnabledSwitch(e) {
this.setData({
......
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