|
@@ -521,11 +521,13 @@
|
|
|
pageDataMap.typeMap['数据流量包'].online = $(this).hasClass('center-text')
|
|
|
if (pageDataMap.typeMap['数据流量包'].online) {
|
|
|
pageDataMap.typeMap['数据流量包'].level = $(this).attr('data-level')
|
|
|
+ $("#select-ent-datapack").removeClass('border-remove')
|
|
|
$("#email").show();
|
|
|
getExportForRepeatInfo({
|
|
|
packType: pageDataMap.typeMap['数据流量包'].level == '1' ? 'normal' : 'senior'
|
|
|
})
|
|
|
} else {
|
|
|
+ $("#select-ent-datapack").addClass('border-remove')
|
|
|
$("#email").hide();
|
|
|
pageDataMap.typeMap['数据流量包'].entId = $(this).attr('data-id')
|
|
|
getExportForRepeatInfo({
|
|
@@ -671,12 +673,27 @@
|
|
|
tempDom.find('.info-dec').text('(' + (level == '1' ? '标准' : '高级') + '字段包)')
|
|
|
parentDom.append(tempDom)
|
|
|
}
|
|
|
+ var maxItem = {
|
|
|
+ entId: -1,
|
|
|
+ level: -1,
|
|
|
+ surplus: 0,
|
|
|
+ online: false
|
|
|
+ }
|
|
|
+
|
|
|
// 数据流量包
|
|
|
if (pageDataMap.dataExportPackInfo) {
|
|
|
var parentDom = $("#select-ent-datapack .switch-dataType")
|
|
|
// 数据流量包 线下
|
|
|
if (pageDataMap.dataExportPackInfo.entPack) {
|
|
|
pageDataMap.dataExportPackInfo.entPack.forEach(function (v) {
|
|
|
+ if (v.surplusToday >= maxItem.surplus) {
|
|
|
+ maxItem = {
|
|
|
+ entId: v.entId,
|
|
|
+ level: -1,
|
|
|
+ surplus: v.surplusToday,
|
|
|
+ online: false
|
|
|
+ }
|
|
|
+ }
|
|
|
var tempDom = $("#select-ent-item-template").clone()
|
|
|
tempDom.attr('data-id', v.entId)
|
|
|
tempDom.css('display', 'initial')
|
|
@@ -688,9 +705,25 @@
|
|
|
// 数据流量包 线上
|
|
|
if (pageDataMap.dataExportPackInfo.personalPack) {
|
|
|
if (pageDataMap.dataExportPackInfo.personalPack.normalTotal > 0) {
|
|
|
+ if (pageDataMap.dataExportPackInfo.personalPack.normalTotal >= maxItem.surplus) {
|
|
|
+ maxItem = {
|
|
|
+ entId: -1,
|
|
|
+ level: 1,
|
|
|
+ surplus: pageDataMap.dataExportPackInfo.personalPack.normalTotal,
|
|
|
+ online: true
|
|
|
+ }
|
|
|
+ }
|
|
|
createTempDom(1, parentDom)
|
|
|
}
|
|
|
if (pageDataMap.dataExportPackInfo.personalPack.seniorTotal > 0) {
|
|
|
+ if (pageDataMap.dataExportPackInfo.personalPack.seniorTotal >= maxItem.surplus) {
|
|
|
+ maxItem = {
|
|
|
+ entId: -1,
|
|
|
+ level: 2,
|
|
|
+ surplus: pageDataMap.dataExportPackInfo.personalPack.seniorTotal,
|
|
|
+ online: true
|
|
|
+ }
|
|
|
+ }
|
|
|
createTempDom(2, parentDom)
|
|
|
}
|
|
|
}
|
|
@@ -703,8 +736,17 @@
|
|
|
pageDataMap.typeMap['数据流量包'].show = parentDom.children('.no-select').length > 0
|
|
|
if (pageDataMap.typeMap['数据流量包'].show) {
|
|
|
// 默认加载第一项去重数据
|
|
|
- var attrId = parentDom.children('.no-select').eq(0).attr('data-id')
|
|
|
+ var attrId = parentDom.children('.no-select').eq(0).attr('data-id')
|
|
|
var attrLevel = parentDom.children('.no-select').eq(0).attr('data-level')
|
|
|
+ if (maxItem.online) {
|
|
|
+ attrLevel = maxItem.level
|
|
|
+ attrId = -1
|
|
|
+ parentDom.children('.no-select[data-level="'+attrLevel+'"]').addClass('active')
|
|
|
+ } else {
|
|
|
+ attrLevel = -1
|
|
|
+ attrId = maxItem.entId
|
|
|
+ parentDom.children('.no-select[data-id="'+attrId+'"]').addClass('active')
|
|
|
+ }
|
|
|
if (attrId) {
|
|
|
pageDataMap.typeMap['数据流量包'].entId = attrId
|
|
|
getExportForRepeatInfo({
|
|
@@ -737,7 +779,6 @@
|
|
|
}, false)
|
|
|
tempDom.show()
|
|
|
}
|
|
|
- parentDom.children('.no-select').eq(0).addClass('active')
|
|
|
if ( pageDataMap.isPackLength == 1) {
|
|
|
$("#select-ent-datapack").hide()
|
|
|
$("#select-ent-datapack").removeAttr('data-show-type')
|
|
@@ -780,7 +821,10 @@
|
|
|
$(".toDeduction").show()
|
|
|
$(".toDeduction").off('click').on('click', dataPackSubmit)
|
|
|
if (pageDataMap.typeMap['数据流量包'].online) {
|
|
|
+ $("#select-ent-datapack").removeClass('border-remove')
|
|
|
$("#email").show()
|
|
|
+ } else {
|
|
|
+ $("#select-ent-datapack").addClass('border-remove')
|
|
|
}
|
|
|
canPayForDataPack()
|
|
|
break
|