You've already forked qlg.tsgz.moe
addons
app_download_files
extend
hyhproject
admin
app
common
home
home2
mobile2
common
conf
controller
model
validate
view
default
articles
css
frozenui
goodsconsult
img
js
users
cashconfigs
cashdraws
favorites
favorite_shop.js
favorites.js
list_goods.html
list_shops.html
history
logmoneys
messages
orders
recharge
security
sellerorders
useraddress
userscores
userset
Users.php
edit.html
global.css
index.html
index1.html
jquery-1.10.2.min.js
qrcode.js
share.css
share.html
share_bg.png
user.js
╨┬╜и╬─▒╛╬─╡╡.txt
鈺ㄢ敩鈺溞糕暚鈹€鈻掆暃鈺攢鈺♀暋.txt
base.html
bash.html
brands.html
carts.html
day_new.html
demo.html
dialog.html
error_lost.html
error_switch.html
error_sys.html
footer.html
forget_pass.html
forget_pass2.html
forget_pass3.html
goods_category.html
goods_detail.html
goods_detail2.html
goods_list.html
goods_search.html
header.html
index.html
index2.html
index3.html
index┤°╧▐╩▒├ы╔▒.html
index鈹ぢ扳暓鈻愨暕鈻掆敎褘鈺斺枓.html
juhui.html
login.html
rebate.html
reg.html
register.html
self_shop.html
settlement.html
settlement_quick.html
shop_goods_list.html
shop_home.html
shop_index.html
shop_street.html
wechat2
.htaccess
command.php
mobile
oss
static
thinkphp
upload
vendor
wxtmp
.gitignore
.htaccess
.user.ini
404.html
H5B854518.wgt
admin.php
app_download.html
cash.lock
demo.php
get_startup.php
get_version.php
get_version_new.php
index.html
index.php
qlg.tar.gz
reg.lock
robots.txt
95 lines
2.8 KiB
JavaScript
Executable File
95 lines
2.8 KiB
JavaScript
Executable File
// 获取关注的商品
|
|
function getFavorites(){
|
|
$('#Load').show();
|
|
loading = true;
|
|
var param = {};
|
|
param.id = $('#catId').val();
|
|
param.condition = $('#condition').val();
|
|
param.desc = $('#desc').val();
|
|
param.keyword = $('#searchKey').val();
|
|
param.pagesize = 10;
|
|
param.page = Number( $('#currPage').val() ) + 1;
|
|
$.post(WST.U('mobile/favorites/listGoodsQuery'), param, function(data){
|
|
var json = WST.toJson(data.data);
|
|
var html = '';
|
|
if(json && json.Rows && json.Rows.length>0){
|
|
var gettpl = document.getElementById('fGoods').innerHTML;
|
|
laytpl(gettpl).render(json.Rows, function(html){
|
|
$('#goods-list').html(html);
|
|
});
|
|
$('#currPage').val(data.CurrentPage);
|
|
$('#totalPage').val(data.TotalPage);
|
|
}else{
|
|
html += '<div class="wst-prompt-icon"><img src="'+ window.conf.MOBILE +'/img/nothing-follow-goods.png"></div>';
|
|
html += '<div class="wst-prompt-info">';
|
|
html += '<p>您还没有关注商品。</p>';
|
|
html += '</div>';
|
|
$('#goods-list').html(html);
|
|
}
|
|
WST.imgAdapt('j-imgAdapt');
|
|
loading = false;
|
|
$('#Load').hide();
|
|
echo.init();//图片懒加载
|
|
});
|
|
}
|
|
// 全选
|
|
function checkAll(obj){
|
|
var chk = $(obj).attr('checked');
|
|
$('.active').each(function(k,v){
|
|
$(this).prop('checked',chk);
|
|
});
|
|
}
|
|
// 取消关注
|
|
function cancelFavorite(){
|
|
WST.dialogHide('prompt');
|
|
var gids = new Array();
|
|
$('.active').each(function(k,v){
|
|
if($(this).attr('checked')){
|
|
gids.push($(this).attr('gid'));
|
|
}
|
|
});
|
|
gids = gids.join(',');
|
|
if(gids==''){
|
|
WST.msg('请先选择商品','info');
|
|
return;
|
|
}
|
|
$.post(WST.U('mobile/favorites/cancel'),{id:gids,type:0},function(data){
|
|
var json = WST.toJson(data);
|
|
if(json.status==1){
|
|
$('#currPage').val('0')
|
|
getFavorites();
|
|
}else{
|
|
WST.msg(json.msg,'info');
|
|
}
|
|
});
|
|
|
|
}
|
|
|
|
var currPage = totalPage = 0;
|
|
var loading = false;
|
|
$(document).ready(function(){
|
|
getFavorites();
|
|
$(window).scroll(function(){
|
|
if (loading) return;
|
|
if ((5 + $(window).scrollTop()) >= ($(document).height() - screen.height)) {
|
|
currPage = Number( $('#currPage').val() );
|
|
totalPage = Number( $('#totalPage').val() );
|
|
if( totalPage > 0 && currPage < totalPage ){
|
|
getFavorites();
|
|
}
|
|
}
|
|
});
|
|
});
|
|
|
|
|
|
|
|
function addCart(goodsId){
|
|
$.post(WST.U('mobile/carts/addCart'),{goodsId:goodsId,buyNum:1},function(data,textStatus){
|
|
var json = WST.toJson(data);
|
|
if(json.status==1){
|
|
WST.msg(json.msg,'success');
|
|
}else{
|
|
WST.msg(json.msg,'info');
|
|
}
|
|
});
|
|
} |