qlg.tsgz.moe/static/app2/js/ac1111next_.js
2019-09-06 23:53:10 +08:00

83 lines
2.7 KiB
JavaScript
Executable File
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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.

//添加返回顶部按钮
document.write('<script type="text/javascript" src="' + localStorage.getItem("jsUrl") + 'scrollToTop.js?ver=' + localStorage.getItem('version') + '"></scr' + 'ipt>');
var isjiazai = 1;
var topTypeId = '';
var page = 1;
var pageSize = 10;
var costnum = 0;
function getData(topTypeId, page, pageSize) {
var data_ = {
goodsName: topTypeId,
page: page ? page : 1,
pageSize: pageSize ? pageSize : 10
}
if(isjiazai == 0) {
return;
} else {
isjiazai = 0;
}
mui.ajax(llUrl('addon/shuff-shuff-appSearch'), { 
data: data_,
dataType: 'json', //服务器返回json格式数据  
type: 'post', //HTTP请求类型  
timeout: 10000, //超时时间设置为10秒  
success: function(data) {           //服务器返回响应,根据响应结果,分析是否登录成功;  
// console.log(data.data.goodsFavoritesNum)
// console.log(data.data.Rows)
// var data = toJson(data);
console.log(data.status)
if(data.status == 1) {
var data = data.data;
var html = '';
if(data.Rows == '') {
if(page == 1) {
$('#recommend_con').html('<p style="float: left;width: 100%;text-align: center;padding-bottom: 9px;">没有更多商品</p>');
} else {
$('#recommend_con').append('<p style="float: left;width: 100%;text-align: center;padding-bottom: 9px;">没有更多商品</p>');
}
isjiazai = 0;
return;
}
$.each(data.Rows, function() {
html += '<div class="recommend_con_block shadown_wai" data-goodsId="' + this.goodsId + '"><img class="rcb_img" src="' + ectImgUrl(this.goodsImg) + '" alt="" /><div class="rcb_con"><div class="rcb_title"><span style="display:none;" data-shopId="' + this.shopId + '">自营</span>' + this.goodsName + '</div><div class="rcb_pay">¥' + this.shopPrice + ' <span style="display:none;">满减</span></div><div class="rcb_bottom"><span>可用木吉抵扣20%货款</span></div></div><img style="display:none;" class="icon_icon" src="../img/icon_sscl.png" alt="" /></div>';
});
if(page == 1) {
$('#recommend_con').html(html);
} else {
$('#recommend_con').append(html);
}
isjiazai = 1;
$('.rcb_img').height($('.rcb_img').width());
} else {
// console.log(data.msg)
}
},
error: function(xhr, type, errorThrown) {           //异常处理;  
// alert(type);    
}  
}); 
}
mui.plusReady(function() {
var self = plus.webview.currentWebview();
topTypeId = self.data_keyword;
console.log(topTypeId)
getData(topTypeId, page, pageSize)
document.querySelector('.mui-scroll-wrapper').addEventListener('scroll', function(e) {
if(scroll.y == scroll.maxScrollY) {
if(isjiazai == 1) {
page++;
getData(topTypeId, page, pageSize);
}
}
})
})