Commit 9822f9de authored by jiangjiantao's avatar jiangjiantao

Merge branch 'dev-1.0' of…

Merge branch 'dev-1.0' of https://gitlab.infra.miyatech.com/pengguangpu/doublescreen-front into dev-1.0
parents ff4e05b4 672554e8
......@@ -56,4 +56,10 @@ export const ACTION_LOGIN_OK = "ACTION_LOGIN_OK";
export const ACTION_PRINT_LAST_ORDER = "ACTION_PRINT_LAST_ORDER";
//使用优惠券
export const ACTION_USE_COUPON = "ACTION_USE_COUPON";
\ No newline at end of file
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,11 +167,39 @@ 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)}`);
}
});
},
/**打印上一单 */
printLastOrder(printLastOrder_goodsList, printLastOrder_paySuccessResp) {
var printLastOrder_orderPriceFen = printLastOrder_paySuccessResp.tradeAmount;
......@@ -282,7 +310,7 @@ Page({
//核销券
verifyCoupon(code) {
this.setData({ scanDialogDisplay: 2 })
var commonRequest = {};
......
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