Commit 7ab9e485 authored by pengguangpu's avatar pengguangpu

本地写死广告页配置;

parent 4b25e081
......@@ -57,3 +57,9 @@ export const ACTION_PRINT_LAST_ORDER = "ACTION_PRINT_LAST_ORDER";
//使用优惠券
export const ACTION_USE_COUPON = "ACTION_USE_COUPON";
//获取当前显示的广告图片
export const ACTION_GET_CUR_AD = "ACTION_GET_CUR_AD";
//发送选中的广告url给前屏
export const ACTION_SEND_SEL_AD = "ACTION_SEND_SEL_AD";
\ No newline at end of file
......@@ -7,13 +7,16 @@ page{
}
.bg{
position:absolute;
position:fixed;
width:100%;
height:100%;
left:0rpx;
top:0rpx;
background:url(/images/bg_home.png) no-repeat fixed top;
bottom:0rpx;
/* background:url(/images/bg_home.png) no-repeat fixed top; */
background-size:100% 100%;
/* border: 2px solid red; */
box-sizing: border-box;
}
.container{
......
<view class="page" >
<view class="bg" onTap="homeTap"/>
<view class="bg" onTap="homeTap">
<image mode="scaleToFill" style="width:100%;height:100%;" src="{{adUrl}}"/>
</view>
<!-- 弹窗 -->
<scandialog displayDialog="{{scanDialogDisplay}}"
......
var api = require("../../utils/api.js");
import { Page } from '../../utils/scan';
//API
import { API_USE_COUPON } from '../../const/apiurl'
import { API_REFUND } from '../../const/apiurl'
import { ACTION_GO_SCAN } from '../../const/actioncmd'
import { ACTION_GET_ACCOUNT } from '../../const/actioncmd'
import { ACTION_DIRECT_PAYMENT } from '../../const/actioncmd'
import { ACTION_CONVERT_COUPON } from '../../const/actioncmd'
import { ACTION_GO_HOME } from '../../const/actioncmd'
import { ACTION_REFUND } from '../../const/actioncmd'
import { ACTION_REFUND_FAILED } from '../../const/actioncmd'
import { ACTION_REFUND_SUCCESS } from '../../const/actioncmd'
import { ACTION_PRINT_LAST_ORDER } from '../../const/actioncmd'
//ACTION
import {
ACTION_GO_SCAN, ACTION_GET_CUR_AD, ACTION_SEND_SEL_AD,
ACTION_GET_ACCOUNT, ACTION_DIRECT_PAYMENT, ACTION_CONVERT_COUPON,
ACTION_GO_HOME, ACTION_REFUND, ACTION_REFUND_FAILED,
ACTION_REFUND_SUCCESS, ACTION_PRINT_LAST_ORDER
} from '../../const/actioncmd'
Page({
......@@ -24,6 +23,7 @@ Page({
dialogResultSuccessText: "恭喜您!兑换成功",
dialogResultFailureRemind: "兑换码未识别",
dialogResultFailureText: "兑换失败,请稍后重试!",
adUrl: "/images/img_ad1.png"
},
onLoad() {
......@@ -167,7 +167,35 @@ Page({
}
//去打印
context.printLastOrder(printLastOrder_goodsList, printLastOrder_paySuccessResp)
} else if (res.action == ACTION_GET_CUR_AD) {
//返回当前选中广告
context.returnCurShowAd();
} else if (res.action == ACTION_SEND_SEL_AD) {
var selectAdUrl = res.data;
//改变当前的广告显示
context.setData({
adUrl: selectAdUrl
});
}
}
});
},
/**返回当前选中广告 */
returnCurShowAd() {
let context = this;
my.ix.sendBuddyMessage({
// 填入目标小程序的 AppID
target: getApp().globalData.backScreenAppId,
data: {
action: ACTION_GET_CUR_AD,
data: context.data.adUrl
},
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