Files
addons
app_download_files
extend
hyhproject
mobile
oss
static
app
css
img
js
activity1.js
activity10.js
activity2.js
activity3.js
activity4.js
activity5.js
activity6.js
activity7.js
activity8.js
activity9.js
appraise.js
binaryajax.js
canvasResize.js
choiceness.js
classify.js
collect.js
collect_commodity.js
collect_store.js
common.js
common_home.js
complain.js
confirmOrder.js
details.js
details_ac.js
discounts.js
dynamic.js
ect_address.js
ect_index.js
ect_list.js
ect_transfer_accounts.html.js
ect_transfer_accounts.js
editAddress.js
exif.js
goodsList.js
home.js
indent.js
indentcon.js
index.js
journalism.js
journalism_con.js
jquery-3.2.1.min.js
login.js
logistics.js
logisticscon.js
msg.js
msg_con.js
mui.js
mui.min.js
my.js
new_product.js
newuser.js
order_con.js
order_out.js
photoswipe-ui-default.min.js
photoswipe.js
pj.js
plupload.full.min.js
qrcode.js
register.js
setting.js
setting_address.js
setting_fogetPayPwd.js
setting_fogetPwd.js
setting_loginInfo.js
setting_payPwd.js
setting_phone.js
setting_pwd.js
setting_user.js
share.js
share_user_list.js
shopGoodsList.js
shoppingcart.js
shopsList.js
store_activity.js
store_class.js
store_commodity.js
store_home.js
store_info.js
store_new.js
storeout.js
swiper.min.js
time_limit.js
upload.js
upload1.js
app2
images
js
plugins
src
template
thinkphp
upload
vendor
wxtmp
.gitignore
.htaccess
.user.ini
404.html
H5B854518.wgt
admin.php
app-release.apk
app_download.html
cash.lock
demo.php
get_startup.php
get_version.php
get_version_new.php
index.html
index.php
reg.lock
robots.txt
qlg.tsgz.moe/static/app/js/discounts.js
2019-09-06 23:53:10 +08:00

80 lines
2.2 KiB
JavaScript
Executable File
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

jumpPage();
function jumpPage() {
//跳转页面
var subpages = ['choiceness.html', 'dynamic.html', 'new_product.html'];
var subpage_style = {
top: '103px',
bottom: '0px',
scrollIndicator: 'none'
};
var aniShow = {}; //动画显示
//当前激活选项
var activeTab = subpages[0];
//选项卡点击事件
mui('.nav').on('tap', 'a', function(e) {
var targetTab = this.getAttribute('href');
if(targetTab == activeTab) {
return;
}
//显示目标选项卡
//若为iOS平台或非首次显示则直接显示
if(mui.os.ios || aniShow[targetTab]) {
plus.webview.show(targetTab);
} else {
//否则使用fade-in动画且保存变量
var temp = {};
temp[targetTab] = "true";
mui.extend(aniShow, temp);
plus.webview.show(targetTab, "fade-in", 300);
}
//隐藏当前;
plus.webview.hide(activeTab);
//更改当前活跃的选项卡
activeTab = targetTab;
if(targetTab == 'choiceness.html') {
document.getElementsByClassName('p1')[1].classList.remove('on')
document.getElementsByClassName('p1')[2].classList.remove('on')
this.classList.add('on');
}
if(targetTab == 'dynamic.html') {
document.getElementsByClassName('p1')[0].classList.remove('on')
document.getElementsByClassName('p1')[2].classList.remove('on')
this.classList.add('on');
}
if(targetTab == 'new_product.html') {
document.getElementsByClassName('p1')[0].classList.remove('on')
document.getElementsByClassName('p1')[1].classList.remove('on')
this.classList.add('on');
}
});
//首次启动切滑效果
mui.plusReady(function() {
window.addEventListener('refresh', function(e) {
location.reload();
})
// launchScreen();
// plus.navigator.setStatusBarStyle('dark');
// console.log(plus.navigator.getStatusBarStyle())
var self = plus.webview.currentWebview();
for(var i = 0; i < subpages.length; i++) {
var temp = {};
//http://www.html5plus.org/doc/zh_cn/webview.html#plus.webview.create
var sub = plus.webview.create(subpages[i], subpages[i], subpage_style);
if(i > 0) {
sub.hide();
} else {
temp[subpages[i]] = "true";
mui.extend(aniShow, temp); //合并对象
}
self.append(sub);
}
});
}