Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
D
doublescreen-front
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
pengguangpu
doublescreen-front
Commits
7ab9e485
Commit
7ab9e485
authored
Feb 26, 2020
by
pengguangpu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
本地写死广告页配置;
parent
4b25e081
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
53 additions
and
14 deletions
+53
-14
actioncmd.js
const/actioncmd.js
+7
-1
img_ad1.png
images/img_ad1.png
+0
-0
img_ad2.png
images/img_ad2.png
+0
-0
home.acss
pages/home/home.acss
+5
-2
home.axml
pages/home/home.axml
+3
-1
home.js
pages/home/home.js
+38
-10
No files found.
const/actioncmd.js
View file @
7ab9e485
...
...
@@ -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
images/img_ad1.png
0 → 100644
View file @
7ab9e485
132 KB
images/img_ad2.png
0 → 100644
View file @
7ab9e485
330 KB
pages/home/home.acss
View file @
7ab9e485
...
...
@@ -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{
...
...
pages/home/home.axml
View file @
7ab9e485
<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}}"
...
...
pages/home/home.js
View file @
7ab9e485
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
)}
`
);
}
});
},
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment