Commit e7bcb2f3 authored by 余成's avatar 余成

写完大部分逻辑

parent 289d6b23
# Shanxi_CCB_Card # Shanxi_CCB_Card
http://cf.dui88.com/pages/viewpage.action?pageId=153703121 源码交付项目
源码交付项目
\ No newline at end of file 小米分期 还没给链接
swiper
周四专享 顺序位
\ No newline at end of file
android.png

5.53 KB

home_bg.png

1010 KB

<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="en">
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>信用卡专享优惠-惠满三晋</title> <title>信用卡专享优惠-惠满三晋</title>
<!-- 这里是浏览器适配 --> <meta http-equiv="X-UA-Compatible" content="ie=edge" />
<script>
!(function (e, i) { <meta name="viewport"
var t = e.documentElement, content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0,viewport-fit=cover" />
n = navigator.userAgent.match(/iphone|ipod|ipad/gi), <script type="text/javascript" src="https://api.map.baidu.com/api?v=2.0&ak=DD279b2a90afdf0ae7a3796787a0742e"></script>
a = n ? Math.min(i.devicePixelRatio, 3) : 1,
m = "orientationchange" in window ? "orientationchange" : "resize"; <!-- 这里是浏览器适配 -->
t.dataset.dpr = a; <script>
for ( !(function (e, i) {
var d, l, c = !1, o = e.getElementsByTagName("meta"), r = 0; var t = e.documentElement,
r < o.length; n = navigator.userAgent.match(/iphone|ipod|ipad/gi),
r++ a = n ? Math.min(i.devicePixelRatio, 3) : 1,
) { m = "orientationchange" in window ? "orientationchange" : "resize";
(l = o[r]), "viewport" == l.name && ((c = !0), (d = l)); t.dataset.dpr = a;
} for (
if (c) { var d, l, c = !1, o = e.getElementsByTagName("meta"), r = 0;
d.content = r < o.length;
"width=device-width,initial-scale=1.0,maximum-scale=1.0, minimum-scale=1.0,user-scalable=no"; r++
} else { ) {
var o = e.createElement("meta"); (l = o[r]), "viewport" == l.name && ((c = !0), (d = l));
(o.name = "viewport"),
(o.content =
"width=device-width,initial-scale=1.0,maximum-scale=1.0, minimum-scale=1.0,user-scalable=no"),
t.firstElementChild.appendChild(o);
}
var s = function () {
var e = t.clientWidth;
var dw = window["designWidth"] || 750;
e / a > dw && (e = dw * a),
(window.remScale = e / dw),
(t.style.fontSize = 100 * (e / dw) + "px");
};
s(), e.addEventListener && i.addEventListener(m, s, !1);
})(document, window);
</script>
<!-- 全局样式 -->
<style>
* {
padding: 0;
margin: 0;
outline: none;
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
/*禁止长按链接与图片弹出菜单*/
-webkit-touch-callout: none;
-ms-touch-callout: none;
-moz-touch-callout: none;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
font-family: -apple-system, Helvetica, sans-serif;
} }
if (c) {
body { d.content =
width: 100%; "width=device-width,initial-scale=1.0,maximum-scale=1.0, minimum-scale=1.0,user-scalable=no";
height: 100%; } else {
var o = e.createElement("meta");
(o.name = "viewport"),
(o.content =
"width=device-width,initial-scale=1.0,maximum-scale=1.0, minimum-scale=1.0,user-scalable=no"),
t.firstElementChild.appendChild(o);
} }
var s = function () {
.container { var e = t.clientWidth;
width: 7.5rem; var dw = window["designWidth"] || 750;
max-width: 7.5rem; e / a > dw && (e = dw * a),
min-height: 100vh; (window.remScale = e / dw),
overflow: hidden; (t.style.fontSize = 100 * (e / dw) + "px");
position: relative; };
background-color: #a1daff; s(), e.addEventListener && i.addEventListener(m, s, !1);
} })(document, window);
</script>
::-webkit-scrollbar { <!-- 全局样式 -->
display: none; <style>
} * {
padding: 0;
img { margin: 0;
display: block; outline: none;
width: 100%; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
margin: 0; /*禁止长按链接与图片弹出菜单*/
padding: 0; -webkit-touch-callout: none;
text-decoration: none; -ms-touch-callout: none;
} -moz-touch-callout: none;
</style> -webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
font-family: -apple-system, Helvetica, sans-serif;
}
body {
width: 100%;
height: 100%;
}
.container {
width: 7.5rem;
max-width: 7.5rem;
min-height: 100vh;
overflow: hidden;
position: relative;
background-color: #a1daff;
}
::-webkit-scrollbar {
display: none;
}
img {
display: block;
width: 100%;
margin: 0;
padding: 0;
text-decoration: none;
}
.bgBox {
width: 100%;
}
.bgBox img {
width: 100%;
display: inline-block;
pointer-events: none;
}
.banner {
width: 6.8rem;
height: 2.1rem;
position: absolute;
left: 0.36rem;
pointer-events: auto;
/* background-color: rgba(0, 0, 0, 0.7); */
}
.meizhuang {
top: 7.3rem;
}
.wenlv {
top: 9.7rem;
}
.secondPage {
position: relative;
width: 100%;
display: none;
}
.backbtn {
width: 0.97rem;
height: 0.38rem;
position: absolute;
top: 2.2rem;
left: 0rem;
z-index: 888;
}
.bgMeiZhuang,
.bgWenLv {
width: 100%;
}
.links0 {
width: 1.5rem;
height: 1.5rem;
top: 11.1rem;
right: 1rem;
position: absolute;
/* background-color: rgba(0, 0, 0, 0.7); */
}
.voucher {
width: 6.12rem;
height: 1.7rem;
position: absolute;
left: 0.66rem;
pointer-events: auto;
/* background-color: rgba(0, 0, 0, 0.7); */
}
.living {
top: 9.96rem;
}
.scene {
top: 12.07rem;
}
.eating {
top: 14.15rem;
}
.gift {
top: 16.26rem;
}
.sharebtn {
width: 1.16rem;
height: 0.51rem;
position: fixed;
top: 2.9rem;
right: 0;
pointer-events: auto;
}
#wxTip {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.7);
}
#typeImage {
position: absolute;
top: 5vw;
right: 5vw;
width: 71vw;
}
#toast {
position: fixed;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
background-color: rgba(0, 0, 0, 0.7);
border-radius: .15rem;
padding: .15rem;
color: #fff;
font-size: .3rem;
text-align: center;
transition: all 1s;
display:none;
}
</style>
<!-- 首页样式 -->
<style>
.independent {
width: 6.89rem;
position: absolute;
pointer-events: auto;
left: 50%;transform: translateX(-50%);
border-radius: 0.15rem;
height: 2rem;
}
.huadongrequ {
top: 1.55rem;
height: 1.8rem;
}
.remenhuodong {
top: 4.35rem;
}
.change-place {
top: 6.32rem;
position: absolute;
width: 7.5rem;
height: 6rem;
}
.jinxuandapai {
top: 0;
width: 7.5rem;
height: 3rem;
}
.jinxuandapai img {
width: 7.2rem;
object-fit:cover;
margin: 0 .3rem;
box-sizing: border-box;
}
.qingsongguang {
margin-top: .4rem;
height: 2.4rem;
position: relative;
}
.qingsongguang-bg {
position: absolute;
width: 6.89rem;
object-fit: cover;
left: 50%;
transform: translateX(-50%);
}
.left-food,.right-food {
position: absolute;
top: .63rem;;
width: 3.1rem;
height: 1.3rem;
border-radius: .15rem;
}
.left-food {
left: .42rem;
}
.right-food {
right: .42rem;
}
.zhousizhuanxiang {
margin: auto;
margin-top: .4rem;
width: 6.89rem;
position: relative;
}
.zhousizhuanxian img {
width: 6.89rem;
object-fit: cover;
margin: 0 .3rem;
box-sizing: border-box;
}
.btn-click {
position: absolute;
width: 6.89rem;
height: .5rem;
top: 0.52rem;
height: 1.97rem;
}
.bottom-container {
position: absolute;
top: 15.4rem;
width: 7.5rem;
height: 9.8rem;
}
.shape {
position: absolute;
width: 3.3rem;
height: 1.65rem;
border-radius: .15rem;
}
.left-shape {
left: .32rem;
}
.right-shape {
right: .32rem;
}
.top-55 {
top: .55rem;
}
.top-248 {
top: 2.48rem;
}
.top-480 {
top: 4.88rem;
}
.shape-square {
position: absolute;
top: 6.9rem;
width:2.1rem;
height:1.5rem;
}
.left-square {
left: .3rem;
}
.center-square {
left: 2.7rem;
}
.right-square {
right: .32rem;
}
</style>
<!-- 二级页面 每日品牌好券 -->
<style>
.bg-Brand {
width: 7.5rem;
object-fit: cover;
}
.position-container {
top: 0;
width: 7.5rem;
height:100%;
position: absolute;
}
.brand-btn {
position: absolute;
width: 1.1rem;
height: 1.1rem;
border-radius: 50%;
}
.brand-small-btn {
position: absolute;
width: 1.2rem;
height: .4rem;
border-radius: .15rem;
}
.brand-middle-btn {
position: absolute;
width: 1.5rem;
height: .4rem;
border-radius: .15rem;
}
.right-95 {
right: .95rem;
}
.right-0-4 {
right: .4rem;
}
.right-2-2 {
right: 2.2rem;
}
.top-3-13 {
top: 3.13rem
}
.top-7-68 {
top: 7.68rem;
}
.top-9-46 {
top: 9.46rem;
}
.top-9-8 {
top: 9.8rem;
}
.top-1-356 {
top: 13.56rem;
}
.top-6-85 {
top: 6.85rem;
}
.top-16-52 {
top: 16.52rem;
}
.top-13-44 {
top: 13.44rem;
}
.top-4-3 {
top: 4.3rem;
}
.top-6-2 {
top: 6.2rem;
}
.top-8 {
top: 8rem;
}
.top-11-6 {
top: 11.6rem;
}
.left-64 {
left: .64rem;
}
.left-4 {
left: 4rem;
}
.left-0-4 {
left: .4rem;
}
.left-0-5 {
left: .5rem;
}
.left-2-1 {
left: 2.1rem;
}
.left-3-9 {
left: 3.9rem;
}
.left-0-54 {
left: 0.54rem;
}
</style>
</head> </head>
<body> <body>
<div>
<div class="container">
<div class="bgBox">
<img class="bg" src="home_bg.png" />
</div>
<!-- 滑动热区 -->
<div class="independent huadongrequ"></div>
<!-- 热门活动 -->
<div onclick="jumpUrl('home',7)" class="independent remenhuodong"></div>
<!-- 位置可换的div -->
<div class="change-place">
<!-- 周四专享 -->
<div class="zhousizhuanxiang" id="thursday_top">
<img src="./mode_thursday.png">
<span class="btn-click" onclick="showPop('ThursdayPage')"></span>
</div>
<!-- 精选大牌 -->
<div class="jinxuandapai" onclick="showPop('GoodBrandPage')">
<img src="mode_brand.png">
</div>
<!-- 轻松逛餐食 -->
<div class="qingsongguang">
<img class="qingsongguang-bg" src="mode_food.png" />
<span class="left-food" onclick="jumpUrl('home',8)"></span>
<span class="right-food" onclick="jumpUrl('home',9)"></span>
</div>
<!-- 周四专享 -->
<div class="zhousizhuanxiang" id="thursday_bottom">
<img src="./mode_thursday.png">
<span class="btn-click" onclick="showPop('ThursdayPage')"></span>
</div>
</div>
<div class="bottom-container">
<!-- 消费礼遇 -->
<!-- 境外消费特享 -->
<span class="shape top-55 left-shape" onclick="jumpUrl('home',10)"></span>
<!-- 积分刮刮乐 -->
<span class="shape top-55 right-shape" onclick="jumpUrl('home',12)"></span>
<!-- 全球支付 -->
<span class="shape top-248 left-shape" onclick="jumpUrl('home',11)"></span>
<!-- 中免日上 -->
<span class="shape top-248 right-shape" onclick="jumpUrl('home',18)"></span>
<!-- 信用生活 -->
<!-- 装修分期推荐有礼 -->
<span class="shape top-480 left-shape" onclick="jumpUrl('home',13)"></span>
<!-- 达标返现 -->
<span class="shape top-480 right-shape" onclick="jumpUrl('home',14)"></span>
<!-- 苹果分期 -->
<span class="left-square shape-square" onclick="jumpUrl('home',15)"></span>
<!-- 小米分期 -->
<span class="center-square shape-square"></span>
<!-- 随付款分期 -->
<span class="right-square shape-square" onclick="jumpUrl('home',17)"></span>
</div>
<!-- 分享按钮 -->
<img id="sharebtn" class="sharebtn" onclick="goShare()" src="share.png" alt="" />
</div>
<!-- 二级页面-周四专享页 -->
<div class="secondPage" id="ThursdayPage">
<img class="backbtn" onclick="goBack()" src="backbtn.png" />
<img class="bgMeiZhuang" src="thursday_bg.png" />
<div class="position-container">
<span class="brand-small-btn top-4-3 left-0-54" onclick="jumpUrl('thursday',1)"></span>
<span class="brand-small-btn top-4-3 right-2-2" onclick="jumpUrl('thursday',2)"></span>
<span class="brand-small-btn top-6-2 left-0-54" onclick="jumpUrl('thursday',3)"></span>
<span class="brand-small-btn top-6-2 right-2-2" onclick="jumpUrl('thursday',4)"></span>
<span class="brand-small-btn top-8 left-0-54" onclick="jumpUrl('thursday',5)"></span>
<span class="brand-small-btn top-8 right-2-2" onclick="jumpUrl('thursday',6)"></span>
<span class="brand-small-btn top-9-8 left-0-54" onclick="jumpUrl('thursday',7)"></span>
<span class="brand-small-btn top-9-8 right-2-2" onclick="jumpUrl('thursday',8)"></span>
<span class="brand-small-btn top-11-6 left-0-54" onclick="jumpUrl('thursday',9)"></span>
<span class="brand-small-btn top-11-6 right-2-2" onclick="jumpUrl('thursday',10)"></span>
</div>
</div>
<!-- 二级页面-每日品牌好券 -->
<div class="secondPage" id="GoodBrandPage">
<img class="backbtn" onclick="goBack()" src="backbtn.png" />
<img class="bg-Brand" src="brand_bg.png" />
<div class="position-container">
<!-- 信用卡新客专享 山西乐活 -->
<span class="brand-btn right-95 top-3-13" onclick="jumpUrl('brand',1)"></span>
<!-- 山西全区品牌限量领 -->
<span class="brand-small-btn top-6-85 left-64" onclick="jumpUrl('brand',2)"></span>
<span class="brand-small-btn top-6-85 left-4" onclick="jumpUrl('brand',3)"></span>
<!-- 唐久 30-10-->
<span class="brand-btn right-95 top-7-68" onclick="jumpUrl('brand',4)"></span>
<!-- 金虎 6-5-->
<span class="brand-btn right-95 top-9-46" onclick="jumpUrl('brand',5)"></span>
<!-- 太远地区 -->
<span class="brand-middle-btn left-0-4 top-13-44" onclick="jumpUrl('brand',6)"></span>
<span class="brand-middle-btn left-2-1 top-13-44" onclick="jumpUrl('brand',7)"></span>
<span class="brand-middle-btn left-3-9 top-13-44" onclick="jumpUrl('brand',8)"></span>
<span class="brand-middle-btn right-0-4 top-13-44" onclick="jumpUrl('brand',9)"></span>
<!-- 王府井奥莱特享 -->
<span class="brand-small-btn left-0-5 top-16-52" onclick="jumpUrl('brand',10)"></span>
<span class="brand-small-btn left-4 top-16-52" onclick="jumpUrl('brand',11)"></span>
</div>
</div>
<div id="toast"></div>
</div>
</body> </body>
<script>
// 这里进行星期四判断 只做顺序
const thursday_top = document.getElementById("thursday_top");
const thursday_bottom = document.getElementById("thursday_bottom");
switch(new Date().getDay()) {
case 4: // 这里说明是星期四
thursday_top.style.display="block";
thursday_bottom.style.display="none";
break;
default:
thursday_top.style.display="none";
thursday_bottom.style.display="block";
}
// 环境判断
var ua = navigator.userAgent;
var isAndroid = ua.indexOf("Android") > -1 || ua.indexOf("Adr") > -1;
var isiOS = !!ua.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/);
var isWeChat = /MicroMessenger/.test(ua);
// 跳转链接
var linkList = {
home: {
// 荐者有礼
1: 'https://item.mobi88.cn/web/longfen666/index.html?origin=longfen666_pro&code=011Ial000jN3aO1bcg400i2Emv4Ial0Z&state=#/',
// 推荐办卡 畅想京东E卡
2: 'https://ssz.ccb.com/hccbtl/m120/2259-1206708.html?userInfoId=56114&overdueTime=1657282460861&dcCpAvyId=YHHD2022060260646#/',
// 开新享好礼
3: 'https://sinfo2.ccb.com/cn/creditcard/apply/new_mobile/card_list.html?Rcmd_InsID=IC1000203&wbbk=',
// 办visa冬奥卡冰墩墩自由
4: 'https://sinfo1.ccb.com/cn/creditcard/apply/new_mobile/index.html?cardId=20211011_1633930412&Rcmd_InsID=IC1000096&wbbk=',
// linefriends粉丝信用卡
5: 'https://sinfo1.ccb.com/cn/creditcard/apply/new_mobile/index.html?cardId=20171011_1507704476&Rcmd_InsID=IC1000059&wbbk=',
// 建行绑卡会
6: 'https://sx.mangezi.com/s13251/p38452/cardmeet!220601?_productName=??????#wechat_redirect',
// 2.热门活动为固定banner位,
7: 'https://mp.weixin.qq.com/s/DpeaCU559Ykz1DOIhnbA7g',
// 轻松逛餐食为行内2个券码
// 满30-15
8: 'https://res.yunbusiness.ccb.com/gbchannel/e_report/CCBLIFE/#/couponDetail/176264?couponType=msps',
// 满6-5
9: 'https://res.yunbusiness.ccb.com/gbchannel/e_report/CCBLIFE/#/couponDetail/173383?couponType=msps',
// 消费礼遇
// 境外消费特享visa卡享8%返现
10: 'https://ssz.ccb.com/v2/manage/book/f3c5ms/',
// 全球支付Visa信用卡一元购专属活动
11: 'https://common.uncle-ad.com/ccbh5course/',
// 积分刷刷乐
12: 'http://zzfw.ccb.com/cn/mobilev3/nonfinance_mobilev3/zzly/jingxuanqy_details_qg.html?Svc_Prj_ID=MFXB2022070410425300015965&chnlType=',
// 信用生活:
// 装修分期 推荐有礼 推荐人链接
13: 'https://xykhd.ccb.com/deco/referrer',
// 建行家装节 惠购惠有礼 达标返现活动报名链接
14: 'https://mobile.ccb.com/e_report/MerchantDiscount/activity/activity_d.html?intent=1&DcCp_Avy_ID=YHHD2022062862665',
// 苹果分期
15: 'https://ssz.ccb.com/v2/manage/book/ogtztn/',
// 小米分期
16: '',
// 随付贷分期
17: 'https://xykhd.ccb.com/loan/',
// 中兔日上
18: 'https://ssz.ccb.com/v2/manage/book/dkjinm/'
},
brand: {
// 山西乐活节
1: 'https://res.yunbusiness.ccb.com/gbchannel/e_report/CCBLIFE/#/couponDetail/143558?couponType=msps',
// 每日好卷 商超/轻食
2: 'https://res.yunbusiness.ccb.com/gbchannel/e_report/CCBLIFE/#/couponDetail/176264?couponType=msps',
// 一元吃早餐
3: 'https://res.yunbusiness.ccb.com/gbchannel/e_report/CCBLIFE/#/couponDetail/173383?couponType=msps',
// 唐久 满30-10元
4: 'https://res.yunbusiness.ccb.com/gbchannel/e_report/CCBLIFE/#/couponDetail/171916?couponType=msps',
// 金虎 满25-10元
5: 'https://res.yunbusiness.ccb.com/gbchannel/e_report/CCBLIFE/#/couponDetail/175109?couponType=msps',
// 好利来
6: 'https://res.yunbusiness.ccb.com/gbchannel/e_report/CCBLIFE/#/couponDetail/178207?couponType=msps',
// 双合成
7: 'https://res.yunbusiness.ccb.com/gbchannel/e_report/CCBLIFE/#/couponDetail/178179?couponType=msps',
// 美滋美客
8: 'https://res.yunbusiness.ccb.com/gbchannel/e_report/CCBLIFE/#/couponDetail/178200?couponType=msps',
// 梅森凯瑟
9: 'https://res.yunbusiness.ccb.com/gbchannel/e_report/CCBLIFE/#/couponDetail/178188?couponType=msps',
// 太原王府井 1000-106
10: 'https://res.yunbusiness.ccb.com/gbchannel/e_report/CCBLIFE/#/couponDetail/178234?couponType=msps',
// 500-66
11: 'https://res.yunbusiness.ccb.com/gbchannel/e_report/CCBLIFE/#/couponDetail/178259?couponType=msps'
},
thursday: {
// 大原专享
1: 'https://yunbusiness.ccb.com/gbchannel/e_report/CCBLIFE/index.html#/couponDiscountActivity?ACT_ID=20220518090000000977&REGION_CODE=140100',
// 大同专享
2: 'https://yunbusiness.ccb.com/gbchannel/e_report/CCBLIFE/index.html#/couponDiscountActivity?ACT_ID=20220707080000000298&REGION_CODE=140200',
// 长治专享
3: 'https://yunbusiness.ccb.com/gbchannel/e_report/CCBLIFE/index.html#/couponDiscountActivity?ACT_ID=20220707070000000329&REGION_CODE=140400',
// 晋中专享
4: 'https://yunbusiness.ccb.com/gbchannel/e_report/CCBLIFE/index.html#/couponDiscountActivity?ACT_ID=20220707090000000379&REGION_CODE=140700',
// 运城专享
5: 'https://yunbusiness.ccb.com/gbchannel/e_report/CCBLIFE/index.html#/couponDiscountActivity?ACT_ID=20220707080000000285&REGION_CODE=140800',
// 晋城专享
6: '',
// 临汾专享
7: '',
// 朔州专享
8: '',
// 阳泉专享
9: '',
// 忻州分行
10: 'https://yunbusiness.ccb.com/gbchannel/e_report/CCBLIFE/index.html#/couponDiscountActivity?ACT_ID=20220707080000000781&REGION_CODE=140900'
}
};
// 引导遮罩
var tipDiv = document.createElement("div");
var img = isiOS ? "ios" : "android";
tipDiv.innerHTML =
'<div id="wxTip">\n' +
'<img id="typeImage" src="./' +
img +
'.png">\n' +
"</div>";
function toast(msg) {
var toast = document.getElementById("toast");
toast.innerHTML = msg
toast.style.display ='block'
setTimeout(function() {
toast.style.display ='none'
},2000)
return function() {
toast.style.display ='none'
}
}
// 端内展示分享按钮 端外不展示
if (!isInClient() || !window.CCBBridge) {
document.getElementById("sharebtn").style.display = "none";
} else {
document.getElementById("sharebtn").style.display = "";
}
/**
* 判断是否是端内
*/
function isInClient() {
//return getClientVersion() ? true : false;
var info = navigator.userAgent;
return info.indexOf("CloudMercWebView") > -1 ||
info.indexOf("CCBSDK") > -1
? true
: false;
}
console.log("端内:", isInClient());
console.log("ccbbriage", window.CCBBridge == true);
/**
* 分享
*/
function goShare() {
var requestObj = {
action: "share",
params: {
// share_id:'',
text: "优惠多多,诚意满满。",
title: "诚满浦江",
url: window.location.href,
image: "https://yun.duiba.com.cn/aurora/assets/af77c5352fe74771e495623b86dd4ed683a4ff59.png",
type: "",
},
};
console.log("分享信息", requestObj);
window.CCBBridge &&
window.CCBBridge.requestNative(JSON.stringify(requestObj), "cbShare");
}
/**
* 点击卡券 区分端内外进行跳转
*/
function jumpUrl(page,index) {
if (isWeChat) {
document.body.appendChild(tipDiv);
return;
}
var targetUrl = linkList[page][index];
console.log('targetUrl', targetUrl);
// 检查是否不在建行生活App内
if (!isInClient() || !window.CCBBridge) { // 端外
if (isiOS) {
window.location.href =
"cloudapp://utils?url=" + encodeURIComponent(targetUrl);
} else {
window.location.href =
"cloudapp://utils?ccbParam=" + encodeURIComponent(targetUrl);
}
setTimeout(function () {
// 一般这个时间段内还停留在当前页面就肯定是没安装建行生活App的人了,直接引导下载吧.
showDownLoadApp();
}, 300);
} else { // 端内
isShanghai(targetUrl)
}
}
/**
* 限制上海地区参与
*/
function isShanghai(targetUrl) {
// 判断是否上海
var geolocation = new BMap.Geolocation();
geolocation.getCurrentPosition(function (r) {
if (this.getStatus() == BMAP_STATUS_SUCCESS) {
console.log("您的坐标:" + r.point.lng + "," + r.point.lat);
var map = new BMap.Map("allmap");
var point = new BMap.Point(r.point.lng, r.point.lat);
var geoc = new BMap.Geocoder();
geoc.getLocation(point, function (rs) {
var addComp = rs.addressComponents;
console.log(addComp.city);
//条件满足
if (addComp.city === "上海市") {
// 端内
toLink(targetUrl);
} else {
alert("仅限上海市参与");
}
});
}
});
}
/**
* 引导下载app
*/
function showDownLoadApp() {
// 引导没有安装建行生活的人去下载安装建行生活
// location.href = 'https://qm.hpay.inrice.com/ddc-life-landing/wx/'
location.href =
"https://yunbusiness.ccb.com/gbchannel/e_report/outercoupon/#/CustomerActivity/20210827090000000351/YSM202108172049725";
}
/**
* 端内跳转
*/
function toLink(url) {
console.log("跳转链接", url);
window.CCBBridge &&
window.CCBBridge.requestNative(
JSON.stringify({
action: "forward",
params: {
type: "1",
isNewView: "1",
toPage: url, // 跳转链接
isShowTitle: "0",
isShowHeader: "0",
},
}),
"forwardCB"
);
}
</script>
<script type="text/javascript">
// function scrollToTop(){
// window.scrollTo(0,0)
// }
// scrollToTop()
var move = function (e) {
e.preventDefault();
};
// 页面弹窗
var showPop = function (shopKey) {
// if (!isInClient() || !window.CCBBridge) {
// } else {//微信中不让点击
// document.body && document.body.addEventListener('touchmove', move, { passive: false });
// document.body && (document.body.style.overflow = 'hidden')
// 这里加逻辑 周四专享点击 如果不是周四弹toast
if(shopKey=='ThursdayPage' && new Date().getDay()!=4) {
toast('不好意思,当前活动未开始,请每周四参与领券');
return false;
}
document.getElementsByClassName("container")[0].style.display = "none";
document.getElementsByClassName("secondPage")[0].style.display = "block";
document.documentElement.scrollTop = 0;
document.body.scrollTop = 0;
var domById = document.getElementById(shopKey);
var secondPageDom = document.getElementsByClassName("secondPage");
for (var i = 0; i < secondPageDom.length; i++) {
if (secondPageDom[i].id == shopKey) {
secondPageDom[i].style.display = "block";
} else {
secondPageDom[i].style.display = "none";
}
}
// }
};
// 返回按钮
var goBack = function () {
document.getElementsByClassName("container")[0].style.display = "block";
var secondList = document.getElementsByClassName("secondPage");
for (var i = 0; i < secondList.length; i++) {
secondList[i].style.display = "none";
}
};
</script>
</html> </html>
\ No newline at end of file
ios.png

6.66 KB

share.png

3.22 KB

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