预处理选择层级,待接口及确认在哪里提交数据及是否必须提交等

This commit is contained in:
2019-09-08 12:29:40 +08:00
parent bff6584b7d
commit 17e9a8658e
5 changed files with 110 additions and 7 deletions

View File

@ -271,7 +271,20 @@ mui.plusReady(function() {
$('.js_r').html(html1);
$('#loginName').html(data.loginName);
$('.userMoney').html(data.userMoney);
// 助购层级获取
// TODO: ajax
var _zgData = [
{level_id:1, user_id:2, user_name: "UID2名称", level_name: "第一层"},
{level_id:2, user_id:4, user_name: "UID4名称", level_name: "第二层"},
{level_id:3, user_id:6, user_name: "konodioda~~~~~~~~~~~~~6", level_name: "第三层"},
]
let _zgHtml = ""
_zgData.forEach(function(each){
_zgHtml += '<div class="row clearfix" data-level_id="'+each.level_id+'" data-user_id="'+each.user_id+'" data-user_name="'+each.user_name+'" data-level_name="'+each.level_name+'">'+
'<p class="row_left">'+each.level_name+'</p>'+'<p class="row_right">'+each.user_name.substr(0, 12)+'</p></div>'
})
$("#pay_select_level .con_1").html(_zgHtml)
$('#goodsTotalMoney').html(priceT);
} else {
mui.alert(data.msg);
@ -514,6 +527,15 @@ mui.plusReady(function() {
}
})
// 助购层级选择
$('.pay').on('tap', '#selectHelpLevel', function() {
$("#pay_select_level").show();
})
$("#pay_select_level .con_1").on('tap', '.row', function(e){
$("#pay_select_level").hide();
$("#displayHelpLevel").text((this.dataset.user_name + "(" + this.dataset.level_name + ")").substr(0,12))
for(var _k in this.dataset){document.getElementById("displayHelpLevel").dataset[_k] = this.dataset[_k]}
})
var click = false;
$('.pay_btn').on('tap', function() {
@ -533,7 +555,13 @@ mui.plusReady(function() {
isInvoice: 0,
invoiceId: 0,
invoiceClient: '',
recordId: userCoupon
recordId: userCoupon,
}
if(document.getElementById("displayHelpLevel").dataset["level_id"] !== undefined){
data_send["helpLevel"] = document.getElementById("displayHelpLevel").dataset["level_id"]
}
if(document.getElementById("displayHelpLevel").dataset["user_id"] !== undefined){
data_send["helpUserId"] = document.getElementById("displayHelpLevel").dataset["user_id"]
}
$('.remark').each(function() {
data_send['remark_' + ($(this).attr('data-shopid'))] = $(this).val();