'助购列表页面功能实现'

This commit is contained in:
Jerry Yan 2019-09-23 15:07:29 +08:00
parent cda15842da
commit 0422d4982c
7 changed files with 135 additions and 30 deletions

View File

@ -5,7 +5,7 @@ var channel = null; //支付通道
mui.init(); mui.init();
mui.plusReady(function() { mui.plusReady(function() {
var self = plus.webview.currentWebview(); var self = plus.webview.currentWebview();
from_id = self.from?self.from:0 from_id = self.from?self.from:1
if(from_id==3){ if(from_id==3){
$("#selectHelpLevel").show(); $("#selectHelpLevel").show();
}else{ }else{
@ -161,7 +161,8 @@ mui.plusReady(function() {
mui.ajax(qlgUrl('app/carts/settlement'), { mui.ajax(qlgUrl('app/carts/settlement'), {
data: { data: {
type: type type: type,
from: from_id
}, },
dataType: 'json', //服务器返回json格式数据 dataType: 'json', //服务器返回json格式数据
type: 'post', //HTTP请求类型 type: 'post', //HTTP请求类型
@ -280,15 +281,20 @@ mui.plusReady(function() {
$('.userMoney').html(data.userMoney); $('.userMoney').html(data.userMoney);
// 助购层级获取 // 助购层级获取
JZL.ajax(qlgUrl('app/user_level/TreeList'),function(res){ if(from_id == '3'){
var _zgData = JSON.parse(res); $("#selectHelpLevel").show();
let _zgHtml = "" JZL.ajax(qlgUrl('app/user_level/TreeList'),{},function(_zgData){
_zgData.forEach(function(each){ let _zgHtml = ""
_zgHtml += '<div class="row clearfix" data-user_id="'+each.userId+'" data-user_name="'+each.userName+'" data-level_name="'+each.level+'">'+ for (let levelId in _zgData) {
'<p class="row_left">'+each.level+'</p>'+'<p class="row_right">'+each.userName.substr(0, 12)+'</p></div>' let each = _zgData[levelId]
_zgHtml += '<div class="row clearfix" data-user_id="'+each.userId+'" data-user_name="'+each.userName+'" data-level_name="'+each.level+'">'+
'<p class="row_left">'+each.level+'</p>'+'<p class="row_right">'+each.userName.substr(0, 12)+'</p></div>'
}
$("#pay_select_level .con_1").html(_zgHtml)
}) })
$("#pay_select_level .con_1").html(_zgHtml) }else{
}) $("#selectHelpLevel").hide();
}
$('#goodsTotalMoney').html(priceT); $('#goodsTotalMoney').html(priceT);
} else { } else {
mui.alert(data.msg); mui.alert(data.msg);
@ -560,6 +566,8 @@ mui.plusReady(function() {
invoiceId: 0, invoiceId: 0,
invoiceClient: '', invoiceClient: '',
recordId: userCoupon, recordId: userCoupon,
goodsType: from_id,
from: from_id,
} }
if(document.getElementById("displayHelpLevel").dataset["level_id"] !== undefined){ if(document.getElementById("displayHelpLevel").dataset["level_id"] !== undefined){
data_send["helpLevel"] = document.getElementById("displayHelpLevel").dataset["level_id"] data_send["helpLevel"] = document.getElementById("displayHelpLevel").dataset["level_id"]

View File

@ -663,7 +663,7 @@ mui.plusReady(function() {
alert('请选择商品分类!'); alert('请选择商品分类!');
return return
} }
if(goodsType==2 & $(this).hasClass('engwc')) { if(goodsType==2 & from_id!=3 & $(this).hasClass('engwc')) {
mui.alert ("助微吧商品不能加入购物车") mui.alert ("助微吧商品不能加入购物车")
return; return;
} }
@ -675,7 +675,7 @@ mui.plusReady(function() {
"HYH-Token": token "HYH-Token": token
}, },
data: { data: {
goodsType:goodsType, goodsType:from_id,
goodsId: goodsId, goodsId: goodsId,
buyNum: buyNum, buyNum: buyNum,
goodsSpecId: goodsSpecId, goodsSpecId: goodsSpecId,

View File

@ -13,7 +13,6 @@ mui.plusReady(function() {
var data_href = self.data_href; var data_href = self.data_href;
if(data_href == 'all') { if(data_href == 'all') {
$('.title').html('全部订单'); $('.title').html('全部订单');
} }
if(data_href == 'waitPay') { if(data_href == 'waitPay') {
$('.title').html('待付款'); $('.title').html('待付款');
@ -30,6 +29,21 @@ mui.plusReady(function() {
if(data_href == 'abnormal') { if(data_href == 'abnormal') {
$('.title').html('退款/售后'); $('.title').html('退款/售后');
} }
if(data_href == 'zgall') {
$('.title').html('助购吧全部订单');
}
if(data_href == 'zgwaitDeliver') {
$('.title').html('助购吧待发货');
}
if(data_href == 'zgwaitReceive') {
$('.title').html('助购吧待收货');
}
if(data_href == 'zgwaitAppraise') {
$('.title').html('助购吧待评价');
}
if(data_href == 'zgabnormal') {
$('.title').html('助购吧退款售后');
}
localStorage.setItem('order_class', data_href); localStorage.setItem('order_class', data_href);
var bSize = 64 + (+localStorage.getItem('ipxSizeTop')) + 'px'; var bSize = 64 + (+localStorage.getItem('ipxSizeTop')) + 'px';
var sub = plus.webview.create('indentcon.html', data_href, { var sub = plus.webview.create('indentcon.html', data_href, {

View File

@ -79,7 +79,7 @@ function getData(page) {
} }
} }
html += '<div class="row" data-orderNo="' + this.orderNo + '" data-id="' + this.orderId + html += '<div class="row" data-orderNo="' + this.orderNo + '" data-id="' + this.orderId +
'"><div class="row_title"><div class="store_name">' + this.shopName + '" data-goodsType="' + this.goodsType + '" data-helpUserId="' + this.helpUserId + '" data-helpUserName="' + this.helpUser.userName + '"><div class="row_title"><div class="store_name">' + this.shopName +
'</div><div class="indent_status shopPhone">商家电话:<a href="tel:' + '</div><div class="indent_status shopPhone">商家电话:<a href="tel:' +
this.phone + '">' + this.phone + '</a></div>' + shopConfirmHtml + '<div class="indent_status yellow">' + this.phone + '">' + this.phone + '</a></div>' + shopConfirmHtml + '<div class="indent_status yellow">' +
this.status + '</div></div><div class="row_con clearfix" data-id="' + this.orderId + this.status + '</div></div><div class="row_con clearfix" data-id="' + this.orderId +
@ -233,6 +233,7 @@ mui.plusReady(function() {
priceT = $(this).parent().siblings('.combination').children('o').html().slice(1); priceT = $(this).parent().siblings('.combination').children('o').html().slice(1);
$('#goodsTotalMoney').html($(this).parent().siblings('.combination').children('o').html()) $('#goodsTotalMoney').html($(this).parent().siblings('.combination').children('o').html())
orderNo = $(this).parent().parent().attr('data-orderNo'); orderNo = $(this).parent().parent().attr('data-orderNo');
var goodsType = $(this).parent().parent().attr('data-goodsType');
if (pay_name == 1) { if (pay_name == 1) {
$('.pay_info .con_1 .row').eq(0).attr('style', 'display: none;'); $('.pay_info .con_1 .row').eq(0).attr('style', 'display: none;');
$('.pay_info .con_1 .row').eq(2).addClass('on'); $('.pay_info .con_1 .row').eq(2).addClass('on');
@ -273,15 +274,23 @@ mui.plusReady(function() {
} }
$('#loginName').html(localStorage.getItem("userName")); $('#loginName').html(localStorage.getItem("userName"));
// 助购层级获取 // 助购层级获取
JZL.ajax(qlgUrl('app/user_level/TreeList'),function(res){ if(goodsType == '3'){
var _zgData = JSON.parse(res); var helpUserId = $(this).parent().parent().attr('data-helpUserId');
let _zgHtml = "" var helpUserName = $(this).parent().parent().attr('data-helpUserName');
_zgData.forEach(function(each){ $("#selectHelpLevel").show().data("user_id", helpUserId).data("user_name", helpUserName);
_zgHtml += '<div class="row clearfix" data-user_id="'+each.userId+'" data-user_name="'+each.userName+'" data-level_name="'+each.level+'">'+ $("#displayHelpLevel").text(helpUserName)
'<p class="row_left">'+each.level+'</p>'+'<p class="row_right">'+each.userName.substr(0, 12)+'</p></div>' JZL.ajax(qlgUrl('app/user_level/TreeList'),{},function(_zgData){
let _zgHtml = ""
for (let levelId in _zgData) {
let each = _zgData[levelId]
_zgHtml += '<div class="row clearfix" data-user_id="'+each.userId+'" data-user_name="'+each.userName+'" data-level_name="'+each.level+'">'+
'<p class="row_left">'+each.level+'</p>'+'<p class="row_right">'+each.userName.substr(0, 12)+'</p></div>'
}
$("#pay_select_level .con_1").html(_zgHtml)
}) })
$("#pay_select_level .con_1").html(_zgHtml) }else{
}) $("#selectHelpLevel").hide();
}
}) })
$('.bg').on('tap', '.mui-icon-left-nav', function() { $('.bg').on('tap', '.mui-icon-left-nav', function() {
@ -330,10 +339,10 @@ mui.plusReady(function() {
orderNo: orderNo orderNo: orderNo
} }
if(document.getElementById("displayHelpLevel").dataset["level_id"] !== undefined){ if(document.getElementById("displayHelpLevel").dataset["level_id"] !== undefined){
data_send["helpLevel"] = document.getElementById("displayHelpLevel").dataset["level_id"] data_ljfk["helpLevel"] = document.getElementById("displayHelpLevel").dataset["level_id"]
} }
if(document.getElementById("displayHelpLevel").dataset["user_id"] !== undefined){ if(document.getElementById("displayHelpLevel").dataset["user_id"] !== undefined){
data_send["helpUserId"] = document.getElementById("displayHelpLevel").dataset["user_id"] data_ljfk["helpUserId"] = document.getElementById("displayHelpLevel").dataset["user_id"]
} }
that.attr('disabled', 'disabled'); that.attr('disabled', 'disabled');
mui.ajax(hyhUrl('app/orders/succeed'), { mui.ajax(hyhUrl('app/orders/succeed'), {

View File

@ -31,9 +31,9 @@ mui.plusReady(function(){
$("#myHelpSaleOrder").on("tap", function(){ $("#myHelpSaleOrder").on("tap", function(){
mui.openWindow({ mui.openWindow({
url: 'indent.html', url: 'indent.html',
id: 'all', id: 'zgall',
extras: { extras: {
data_href: 'all' data_href: 'zgall'
}, },
createNew: false, //是否重复创建同样id的webview默认为false:不重复创建,直接显示 createNew: false, //是否重复创建同样id的webview默认为false:不重复创建,直接显示
waiting: { waiting: {
@ -42,6 +42,80 @@ mui.plusReady(function(){
} }
}) })
}) })
$(".waitSend").on("tap", function(){
mui.openWindow({
url: 'indent.html',
id: 'zgwaitDeliver',
extras: {
data_href: 'zgwaitDeliver'
},
createNew: false, //是否重复创建同样id的webview默认为false:不重复创建,直接显示
waiting: {
autoShow: true, //自动显示等待框默认为true
title: '正在加载...', //等待对话框上显示的提示内容
}
})
})
$(".waitDeliver").on("tap", function(){
mui.openWindow({
url: 'indent.html',
id: 'zgwaitReceive',
extras: {
data_href: 'zgwaitReceive'
},
createNew: false, //是否重复创建同样id的webview默认为false:不重复创建,直接显示
waiting: {
autoShow: true, //自动显示等待框默认为true
title: '正在加载...', //等待对话框上显示的提示内容
}
})
})
$(".waitAppraise").on("tap", function(){
mui.openWindow({
url: 'indent.html',
id: 'zgwaitAppraise',
extras: {
data_href: 'zgwaitAppraise'
},
createNew: false, //是否重复创建同样id的webview默认为false:不重复创建,直接显示
waiting: {
autoShow: true, //自动显示等待框默认为true
title: '正在加载...', //等待对话框上显示的提示内容
}
})
})
$(".abnormal").on("tap", function(){
mui.openWindow({
url: 'indent.html',
id: 'zgabnormal',
extras: {
data_href: 'zgabnormal'
},
createNew: false, //是否重复创建同样id的webview默认为false:不重复创建,直接显示
waiting: {
autoShow: true, //自动显示等待框默认为true
title: '正在加载...', //等待对话框上显示的提示内容
}
})
})
$(".helpSaleCart").on("tap", function(){
mui.openWindow({
url: "shoppingcart.html",
id: "shoppingcart.html_3",
extras: {
from_id: 3,
},
waiting: {
autoShow: true, //自动显示等待框默认为true
title: '正在加载...', //等待对话框上显示的提示内容
options: {
// width: waiting - dialog - widht, //等待框背景区域宽度,默认根据内容自动计算合适宽度
// height: waiting - dialog - height, //等待框背景区域高度,默认根据内容自动计算合适高度
// ......
}
}
})
})
$("#toHelpSale").on("tap", function(){ $("#toHelpSale").on("tap", function(){
JZL.openWindow('zhugouba.html', 'zhugouba.html'); JZL.openWindow('zhugouba.html', 'zhugouba.html');
}) })

View File

@ -574,8 +574,8 @@ mui.plusReady(function() {
extras: { extras: {
// data_id: data_id // data_id: data_id
type: 0 type: 0,
from: from_id
// ..... //自定义扩展参数,可以用来处理页面间传值 // ..... //自定义扩展参数,可以用来处理页面间传值
}, },
createNew: false, //是否重复创建同样id的webview默认为false:不重复创建,直接显示 createNew: false, //是否重复创建同样id的webview默认为false:不重复创建,直接显示

View File

@ -328,5 +328,5 @@ mui("body").on('tap', '.bc_img', function() {
var goodsId = $(this).attr('data-goodsId'); var goodsId = $(this).attr('data-goodsId');
var shopId = $(this).parent().parent().attr('data-shopId'); var shopId = $(this).parent().parent().attr('data-shopId');
var goodsType=$(this).attr('data-goodsType') var goodsType=$(this).attr('data-goodsType')
JZL.openWindow('details.html', 'details.html' + goodsId, {data_id: goodsId,shopId: shopId,goodsType : goodsType, from_id:3}); JZL.openWindow('details.html', 'details.html' + goodsId, {data_id: goodsId,shopId: shopId,goodsType : 3, from_id:3});
}) })