$('.cnxh_con').html(''); var msort = 1; var shopId = localStorage.getItem('shopId') var page = 1; var condition = 1; var desc = 0; mui.init({ pullRefresh: { container: '#pullrefresh', down: { style: 'circle', //必选,下拉刷新样式,目前支持原生5+ ‘circle’ 样式 color: '#2BD009', //可选,默认“#2BD009” 下拉刷新控件颜色 height: '50px', //可选,默认50px.下拉刷新控件的高度, range: '100px', //可选 默认100px,控件可下拉拖拽的范围 offset: '0px', //可选 默认0px,下拉刷新控件的起始位置 // auto: true, //可选,默认false.首次加载自动上拉刷新一次 contentdown: "下拉可以刷新", //可选,在下拉可刷新状态时,下拉刷新控件上显示的标题内容 contentover: "释放立即刷新", //可选,在释放可刷新状态时,下拉刷新控件上显示的标题内容 contentrefresh: "正在刷新...", //可选,正在刷新状态时,下拉刷新控件上显示的标题内容 callback: pulldownRefresh //必选,刷新函数,根据具体业务来编写,比如通过ajax从服务器获取新数据; }, up: { contentrefresh: '正在加载...', callback: pullupRefresh } } }); var count = 1; function pullupRefresh() { setTimeout(function() { mui('#pullrefresh').pullRefresh().endPullupToRefresh(); count += 1; // console.log(order_class) mui.ajax(hyhUrl('app/Shops/getShopGoods'), { data: { page: count, shopId: shopId, pageSize: 10, msort: condition, mdesc: desc }, 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); data = data.data; var html = ''; $.each(data.Rows, function() { html += '
' + this.goodsName + '
¥' + Math.round(this.shopPrice * 0.8 * 100) / 100 + '¥' + this.shopPrice + '
可用惠宝抵扣20%货款
');
desc = 0;
} else if(costnum % 2 == 0) {
$('#cost_btn').html('价格
');
desc = 1;
}
} else {
$('#cost_btn').html('价格
')
costnum = 0;
desc = 1
}
mui.ajax(hyhUrl('app/Shops/getShopGoods'), {
data: {
shopId: shopId,
pageSize: 10,
page: 1,
msort: condition,
mdesc: desc
},
dataType: 'json', //服务器返回json格式数据
type: 'post', //HTTP请求类型
timeout: 10000, //超时时间设置为10秒;
success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功;
var data = toJson(data);
data = data.data;
var html = '';
$.each(data.Rows, function() {
html += '' + this.goodsName + '
¥' + Math.round(this.shopPrice * 0.8 * 100) / 100 + '¥' + this.shopPrice + '
可用惠宝抵扣20%货款
' + this.goodsName + '
¥' + Math.round(this.shopPrice * 0.8 * 100) / 100 + '¥' + this.shopPrice + '
可用惠宝抵扣20%货款