新增分区逻辑
This commit is contained in:
9
src/api/partition/partitionInfo.js
Normal file
9
src/api/partition/partitionInfo.js
Normal file
@@ -0,0 +1,9 @@
|
||||
import request from '@/utils/request';
|
||||
|
||||
export const getPartitionInfoList = query => {
|
||||
return request({
|
||||
url: '/partition/listPartitionInfo',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
};
|
@@ -76,6 +76,18 @@
|
||||
<input type="text" class="form-control validate[required]" name="name" id="name">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="ar_name" class="col-sm-3 control-label">阿语座驾名称</label>
|
||||
<div class="col-sm-9">
|
||||
<input type="text" class="form-control validate[required]" name="name" id="ar_name">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="en_name" class="col-sm-3 control-label">英语座驾名称</label>
|
||||
<div class="col-sm-9">
|
||||
<input type="text" class="form-control validate[required]" name="name" id="en_name">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">使用萝卜购买</label>
|
||||
@@ -407,7 +419,9 @@ export default {
|
||||
columns: [
|
||||
{ field: 'tmp', title: 'id', align: 'center', checkbox: true, width: '5%' },
|
||||
{ field: 'id', title: '座驾ID', align: 'center', width: '5%' },
|
||||
{ field: 'name', title: '座驾名称', align: 'center', width: '20%' },
|
||||
{field: 'name.zh', title: '座驾名称', align: 'center', width: '20%'},
|
||||
{field: 'name.ar', title: '阿语座驾名称', align: 'center', width: '20%'},
|
||||
{field: 'name.en', title: '英语座驾名称', align: 'center', width: '20%'},
|
||||
{
|
||||
field: 'carGoodsType', title: '座驾类型', align: 'center', width: '20%',
|
||||
formatter: function (val) {
|
||||
@@ -527,8 +541,29 @@ export default {
|
||||
};
|
||||
return param;
|
||||
},
|
||||
ajax:function(request){ //使用ajax请求
|
||||
$.ajax({
|
||||
type:"GET",
|
||||
url:'/admin/car/goods.action?enable=' + ComboboxHelper.getSelected("#condition_type"),
|
||||
contentType:'application/json;charset=utf-8',
|
||||
dataType:'json',
|
||||
data: request.data,
|
||||
success:function (res) {
|
||||
console.log(res);
|
||||
request.success({
|
||||
"rows": res.rows.map(i=>{
|
||||
i.name = JSON.parse(i.name);
|
||||
return i;
|
||||
}),
|
||||
"total": res.total
|
||||
});
|
||||
},
|
||||
error:function(error){
|
||||
console.log(error);
|
||||
}
|
||||
})
|
||||
},
|
||||
toolbar: '#toolbar',
|
||||
url: '/admin/car/goods.action',
|
||||
onLoadSuccess: function () { //加载成功时执行
|
||||
console.log("load success");
|
||||
},
|
||||
@@ -581,7 +616,12 @@ export default {
|
||||
$("#viewFileInfo").html('');
|
||||
|
||||
$("#id").val('');
|
||||
$('#name').val('');
|
||||
$('#ar_name').val('');
|
||||
$('#en_name').val('');
|
||||
$("#name").attr('readonly', false);
|
||||
$("#ar_name").attr('readonly', false);
|
||||
$("#en_name").attr('readonly', false);
|
||||
// $("#price").attr('readonly', false);
|
||||
// $("#renewPrice").attr('readonly', false);
|
||||
$("#seq").val('');
|
||||
@@ -770,7 +810,11 @@ export default {
|
||||
// $("#price").val(json.entity.price);
|
||||
// $("#renewPrice").val(json.entity.renewPrice);
|
||||
$("#days").val(json.entity.days);
|
||||
$("#name").val(json.entity.name);
|
||||
console.log(json.entity.name)
|
||||
var jsonName = JSON.parse(json.entity.name);
|
||||
$("#name").val(jsonName.zh);
|
||||
$("#ar_name").val(jsonName.ar);
|
||||
$("#en_name").val(jsonName.en);
|
||||
$("#price").val(json.entity.price);
|
||||
$("#renewPrice").val(json.entity.renewPrice);
|
||||
$("#seq").val(json.entity.seq);
|
||||
@@ -949,10 +993,29 @@ export default {
|
||||
$("#tipModal").modal('show');
|
||||
return;
|
||||
}
|
||||
// 获取序列化字符串并转换为对象
|
||||
let formData = $('#carGoodsForm').serializeArray().reduce(function(obj, item) {
|
||||
obj[item.name] = item.value;
|
||||
return obj;
|
||||
}, {});
|
||||
|
||||
var name = $("#name").val();
|
||||
// 阿语名称
|
||||
var ar_name = $("#ar_name").val();
|
||||
// 英语名称
|
||||
var en_name = $("#en_name").val();
|
||||
// 国际化字段
|
||||
var jsonName = {"zh":name,"ar":ar_name,"en":en_name}
|
||||
const nameValue = JSON.stringify(jsonName);
|
||||
// 修改属性值
|
||||
formData.name = nameValue; // 将giftName修改为"newGiftName"
|
||||
|
||||
// 将修改后的对象转换回序列化字符串
|
||||
let newSerializeStr = $.param(formData);
|
||||
$.ajax({
|
||||
type: "post",
|
||||
url: "/admin/car/goods.action",
|
||||
data: $('#carGoodsForm').serialize(),
|
||||
data: newSerializeStr,
|
||||
dataType: "json",
|
||||
success: function (json) {
|
||||
if (json.success == 'true') {
|
||||
|
@@ -69,6 +69,18 @@
|
||||
placeholder="请输入气泡名称">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="ar_modal_name" class="col-sm-4 control-label">阿语装扮名称:</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="text" class="form-control validate[required]" name="name" id="ar_modal_name" placeholder="请输入气泡名称">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="en_modal_name" class="col-sm-4 control-label">英语装扮名称:</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="text" class="form-control validate[required]" name="name" id="en_modal_name" placeholder="请输入气泡名称">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label">安卓图片:</label>
|
||||
<div class="col-sm-6">
|
||||
@@ -173,7 +185,9 @@ export default {
|
||||
$('#table').bootstrapTable({
|
||||
columns: [
|
||||
{ field: 'id', title: '装扮id', align: 'middle', width: '5%' },
|
||||
{ field: 'name', title: '装扮名称', align: 'middle', width: '5%' },
|
||||
{field: 'name.zh', title: '装扮名称', align: 'middle', width: '5%'},
|
||||
{field: 'name.ar', title: '阿语装扮名称', align: 'middle', width: '5%'},
|
||||
{field: 'name.en', title: '英语装扮名称', align: 'middle', width: '5%'},
|
||||
{
|
||||
field: 'iosUrl',
|
||||
title: '装扮图片',
|
||||
@@ -264,8 +278,30 @@ export default {
|
||||
};
|
||||
return param;
|
||||
},
|
||||
toolbar: '#toolbar',
|
||||
ajax:function(request){ //使用ajax请求
|
||||
$.ajax({
|
||||
type:"GET",
|
||||
url:'/admin/chatbubble/listByPage',
|
||||
contentType:'application/json;charset=utf-8',
|
||||
dataType:'json',
|
||||
data: request.data,
|
||||
success:function (res) {
|
||||
console.log(res);
|
||||
request.success({
|
||||
"rows": res.rows.map(i=>{
|
||||
i.name = JSON.parse(i.name);
|
||||
return i;
|
||||
}),
|
||||
"total": res.total
|
||||
});
|
||||
},
|
||||
error:function(error){
|
||||
console.log(error);
|
||||
}
|
||||
})
|
||||
},
|
||||
toolbar: '#toolbar',
|
||||
// url: '/admin/chatbubble/listByPage',
|
||||
onLoadSuccess: function () { //加载成功时执行
|
||||
console.log("load success");
|
||||
},
|
||||
@@ -286,7 +322,12 @@ export default {
|
||||
// 赋值
|
||||
$("#addForm #modal_id").val(row.id);
|
||||
$("#addForm #modal_type").val(row.type);
|
||||
$("#addForm #modal_name").val(row.name);
|
||||
console.log(row.name)
|
||||
$("#modal_name").val(row.name.zh);
|
||||
// 阿语名称
|
||||
$("#ar_modal_name").val(row.name.ar);
|
||||
// 英语名称
|
||||
$("#en_modal_name").val(row.name.en);
|
||||
$('#addAndroidIconPicUrl').attr("src", row.androidUrl);
|
||||
$("#addForm #androidUrl").val(row.androidUrl);
|
||||
$('#addIosIconPicUrl').attr("src", row.iosUrl);
|
||||
@@ -332,13 +373,41 @@ export default {
|
||||
$('#button-save').on('click', function () {
|
||||
var androidUrl = $('#androidUrl').val();
|
||||
var iosUrl = $('#iosUrl').val();
|
||||
var name = $('#modal_name').val();
|
||||
// 获取序列化字符串并转换为对象
|
||||
let formData = $('#addForm').serializeArray().reduce(function(obj, item) {
|
||||
obj[item.name] = item.value;
|
||||
return obj;
|
||||
}, {});
|
||||
|
||||
var name = $("#modal_name").val();
|
||||
// 阿语名称
|
||||
var ar_name = $("#ar_modal_name").val();
|
||||
// 英语名称
|
||||
var en_name = $("#en_modal_name").val();
|
||||
// 国际化字段
|
||||
var jsonName = {"zh":name,"ar":ar_name,"en":en_name}
|
||||
const nameValue = JSON.stringify(jsonName);
|
||||
// 修改属性值
|
||||
formData.name = nameValue; // 将giftName修改为"newGiftName"
|
||||
|
||||
// 将修改后的对象转换回序列化字符串
|
||||
let newSerializeStr = $.param(formData);
|
||||
//做下数据校验
|
||||
if (isEmpty(name)) {
|
||||
$("#tipMsg").text("装扮名字不能为空");
|
||||
$("#tipModal").modal('show');
|
||||
return;
|
||||
}
|
||||
if (isEmpty(ar_name)) {
|
||||
$("#tipMsg").text("阿语装扮名字不能为空");
|
||||
$("#tipModal").modal('show');
|
||||
return;
|
||||
}
|
||||
if (isEmpty(en_name)) {
|
||||
$("#tipMsg").text("英语装扮名字不能为空");
|
||||
$("#tipModal").modal('show');
|
||||
return;
|
||||
}
|
||||
if (isEmpty(androidUrl) || isEmpty(iosUrl)) {
|
||||
$("#tipMsg").text("图片不能为空");
|
||||
$("#tipModal").modal('show');
|
||||
@@ -349,7 +418,7 @@ export default {
|
||||
$.ajax({
|
||||
type: "post",
|
||||
url: "/admin/chatbubble/saveOrUpdate",
|
||||
data: $("#addForm").serialize(),
|
||||
data: newSerializeStr,
|
||||
dataType: "json",
|
||||
success: function (json) {
|
||||
if (json.code === 200) {
|
||||
@@ -378,6 +447,8 @@ export default {
|
||||
$('#status').val('');
|
||||
$('#modal_type').val('');
|
||||
$('#modal_name').val('');
|
||||
$('#ar_modal_name').val('');
|
||||
$('#en_modal_name').val('');
|
||||
}
|
||||
//判断空值
|
||||
function isEmpty(data) {
|
||||
|
@@ -119,7 +119,9 @@ export default {
|
||||
columns: [
|
||||
{ field: 'id', title: 'ID', align: 'center', valign: 'middle', width: '10%' },
|
||||
{ field: 'dressId', title: '装扮id', align: 'center', valign: 'middle', width: '10%' },
|
||||
{ field: 'name', title: '装扮名称', align: 'left', valign: 'middle', width: '10%' },
|
||||
{field: 'name.zh', title: '装扮名称', align: 'left', valign: 'middle', width: '10%'},
|
||||
{field: 'name.ar', title: '阿语装扮名称', align: 'left', valign: 'middle', width: '10%'},
|
||||
{field: 'name.en', title: '英语装扮名称', align: 'left', valign: 'middle', width: '10%'},
|
||||
{
|
||||
field: 'pic', title: '装扮图片', align: 'left', valign: 'middle', width: '10%',
|
||||
formatter: function (val, row, index) {
|
||||
@@ -212,9 +214,13 @@ export default {
|
||||
data: request.data,
|
||||
success: function (res) {
|
||||
apiResult(res);
|
||||
console.log(res)
|
||||
request.success({
|
||||
rows: res.data.rows,
|
||||
total: res.data.total,
|
||||
"rows": res.data.rows.map(i=>{
|
||||
i.name = JSON.parse(i.name);
|
||||
return i;
|
||||
}),
|
||||
"total": res.total
|
||||
});
|
||||
},
|
||||
error: function (req) {
|
||||
|
@@ -50,6 +50,14 @@
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form class="form-horizontal" id="bannerForm">
|
||||
<div id="bannerPartitionDiv">
|
||||
<div class="form-group">
|
||||
<label name="partition" class="col-sm-3 control-label">选择地区*:</label>
|
||||
<div class="form-check" id = "partitionCheck">
|
||||
<!-- 分区展示-->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="name" class="col-sm-3 control-label">Banner名字:</label>
|
||||
<div class="col-sm-8">
|
||||
@@ -205,6 +213,14 @@
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form id="addBannerForm" class="form-horizontal">
|
||||
<div id="bannerAddPartitionDiv">
|
||||
<div class="form-group">
|
||||
<label name="partition" class="col-sm-3 control-label">选择地区*:</label>
|
||||
<div class="form-check" id = "partitionAddCheck">
|
||||
<!-- 分区展示-->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="addName" class="col-sm-3 control-label">Banner名字:</label>
|
||||
<div class="col-sm-8">
|
||||
@@ -437,6 +453,7 @@ export default {
|
||||
$('#table').bootstrapTable({
|
||||
columns: [
|
||||
{ field: 'sel', title: 'ID', align: 'center', valign: 'middle', checkbox: true, width: '1%' },
|
||||
{field: 'partitionDesc', title: '地区', align: 'center', valign: 'middle', width: '5%'},
|
||||
{ field: 'bannerId', title: 'bannerID', align: 'center', valign: 'middle', width: '5%' },
|
||||
{ field: 'bannerName', title: '名称', align: 'center', valign: 'middle', width: '10%' },
|
||||
{
|
||||
@@ -646,7 +663,22 @@ export default {
|
||||
$('.titleListDev').addClass("hidden");
|
||||
var bannerId = parseInt($(this).data('id'));
|
||||
isEdit = true;
|
||||
debugger
|
||||
$.ajax({
|
||||
type: 'get',
|
||||
url: '/partition/listPartitionInfo.action',
|
||||
dataType: 'json',
|
||||
success: function (json) {
|
||||
if (json.code == 200) {
|
||||
var length = json.data.length;
|
||||
var partitionCheck = $("#partitionCheck");
|
||||
partitionCheck.empty();
|
||||
// 分区
|
||||
for (var i = 0; i < length; i++) {
|
||||
var checkbox = $("<input>", {type: "checkbox", id: "checkbox" + json.data[i].id, name: "partitionIds", value: json.data[i].id});
|
||||
var label = $("<label>", {class: "partition-checkbox-label", text: json.data[i].desc});
|
||||
|
||||
partitionCheck.append(checkbox,label);
|
||||
}
|
||||
$.ajax({
|
||||
type: "get",
|
||||
url: "/admin/banner/get.action",
|
||||
@@ -677,6 +709,12 @@ export default {
|
||||
$('#showRule').val(json.data.showRule);
|
||||
window.selectOnChange(json.data.bannerType, json.data.titleId);
|
||||
$('#titleList').val(json.data.titleId);
|
||||
// 分区信息
|
||||
var partitionIds = json.data.partitionIds;
|
||||
var length = partitionIds.length;
|
||||
for (var i = 0; i < length; i++) {
|
||||
$("#checkbox" + partitionIds[i]).prop('checked', true);
|
||||
}
|
||||
$('#bannerModal').modal('show');
|
||||
// picker1.datetimepicker('setStartDate', startDate);
|
||||
} else {
|
||||
@@ -685,6 +723,12 @@ export default {
|
||||
}
|
||||
}
|
||||
});
|
||||
} else {
|
||||
$("#tipMsg").text("获取信息出错");
|
||||
$("#tipModal").modal('show');
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@@ -756,6 +800,32 @@ export default {
|
||||
$('#addStartDate').val('');
|
||||
$('#addEndDate').val('');
|
||||
|
||||
// 分区处理
|
||||
$.ajax({
|
||||
type: 'get',
|
||||
url: '/partition/listPartitionInfo.action',
|
||||
dataType: 'json',
|
||||
success: function (json) {
|
||||
if (json.code == 200) {
|
||||
var length = json.data.length;
|
||||
var partitionCheck = $("#partitionAddCheck");
|
||||
partitionCheck.empty();
|
||||
// 创建3个checkbox元素并添加到myDiv元素上
|
||||
for (var i = 0; i < length; i++) {
|
||||
var checkbox = $("<input>", {
|
||||
type: "checkbox",
|
||||
id: "checkbox" + json.data[i].id,
|
||||
name: "partitionIds",
|
||||
value: json.data[i].id
|
||||
});
|
||||
var label = $("<label>", {class: "partition-checkbox-label", text: json.data[i].desc});
|
||||
|
||||
partitionCheck.append(checkbox, label);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// 处理appId
|
||||
// $('#addAppId').empty();
|
||||
// $('#addAppId').append('<option value="">请选择</option>');
|
||||
|
@@ -57,6 +57,14 @@
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form class="form-horizontal" id="bannerForm">
|
||||
<div id="bannerPartitionDiv">
|
||||
<div class="form-group">
|
||||
<label name="partition" class="col-sm-3 control-label">选择地区*:</label>
|
||||
<div class="form-check" id = "partitionCheck">
|
||||
<!-- 分区展示-->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="name" class="col-sm-3 control-label">Banner名字:</label>
|
||||
<div class="col-sm-8">
|
||||
@@ -215,6 +223,14 @@
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form id="addBannerForm" class="form-horizontal">
|
||||
<div id="bannerAddPartitionDiv">
|
||||
<div class="form-group">
|
||||
<label name="partition" class="col-sm-3 control-label">选择地区*:</label>
|
||||
<div class="form-check" id = "partitionAddCheck">
|
||||
<!-- 分区展示-->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="addName" class="col-sm-3 control-label">Banner名字:</label>
|
||||
<div class="col-sm-8">
|
||||
@@ -453,6 +469,7 @@ export default {
|
||||
columns: [
|
||||
{ field: 'sel', title: 'ID', align: 'center', valign: 'middle', checkbox: true, width: '1%' },
|
||||
{ field: 'bannerId', title: 'bannerID', align: 'center', valign: 'middle', width: '5%' },
|
||||
{field: 'partitionDesc', title: '地区', align: 'center', valign: 'middle', width: '5%'},
|
||||
{ field: 'bannerName', title: '名称', align: 'center', valign: 'middle', width: '10%' },
|
||||
{
|
||||
field: 'bannerType', title: 'banner位置', align: 'center', valign: 'middle', width: '10%',
|
||||
@@ -663,6 +680,22 @@ export default {
|
||||
// for(var key in app) {
|
||||
// $('#appId').append('<option value="'+key+'">'+app[key]+'</option>');
|
||||
// }
|
||||
$.ajax({
|
||||
type: 'get',
|
||||
url: '/partition/listPartitionInfo.action',
|
||||
dataType: 'json',
|
||||
success: function (json) {
|
||||
if (json.code == 200) {
|
||||
var length = json.data.length;
|
||||
var partitionCheck = $("#partitionCheck");
|
||||
partitionCheck.empty();
|
||||
// 分区
|
||||
for (var i = 0; i < length; i++) {
|
||||
var checkbox = $("<input>", {type: "checkbox", id: "checkbox" + json.data[i].id, name: "partitionIds", value: json.data[i].id});
|
||||
var label = $("<label>", {class: "partition-checkbox-label", text: json.data[i].desc});
|
||||
|
||||
partitionCheck.append(checkbox,label);
|
||||
}
|
||||
$.ajax({
|
||||
type: 'get',
|
||||
url: '/admin/banner/get.action',
|
||||
@@ -693,6 +726,12 @@ export default {
|
||||
$('#showRule').val(json.data.showRule);
|
||||
window.selectOnChange(json.data.bannerType, json.data.titleId);
|
||||
$('#titleList').val(json.data.titleId);
|
||||
// 分区信息
|
||||
var partitionIds = json.data.partitionIds;
|
||||
var length = partitionIds.length;
|
||||
for (var i = 0; i < length; i++) {
|
||||
$("#checkbox" + partitionIds[i]).prop('checked', true);
|
||||
}
|
||||
$('#bannerModal').modal('show');
|
||||
// picker1.datetimepicker('setStartDate', startDate);
|
||||
} else {
|
||||
@@ -701,6 +740,12 @@ export default {
|
||||
}
|
||||
}
|
||||
})
|
||||
} else {
|
||||
$("#tipMsg").text("获取信息出错");
|
||||
$("#tipModal").modal('show');
|
||||
}
|
||||
}
|
||||
})
|
||||
});
|
||||
function cleanModal(obj) {
|
||||
$('#addBannerForm').find('input[type=text],input[type=hidden],input[type=file]').each(function () {
|
||||
@@ -770,6 +815,32 @@ export default {
|
||||
$('#addStartDate').val('');
|
||||
$('#addEndDate').val('');
|
||||
|
||||
// 分区处理
|
||||
$.ajax({
|
||||
type: 'get',
|
||||
url: '/partition/listPartitionInfo.action',
|
||||
dataType: 'json',
|
||||
success: function (json) {
|
||||
if (json.code == 200) {
|
||||
var length = json.data.length;
|
||||
var partitionCheck = $("#partitionAddCheck");
|
||||
partitionCheck.empty();
|
||||
// 创建3个checkbox元素并添加到myDiv元素上
|
||||
for (var i = 0; i < length; i++) {
|
||||
var checkbox = $("<input>", {
|
||||
type: "checkbox",
|
||||
id: "checkbox" + json.data[i].id,
|
||||
name: "partitionIds",
|
||||
value: json.data[i].id
|
||||
});
|
||||
var label = $("<label>", {class: "partition-checkbox-label", text: json.data[i].desc});
|
||||
|
||||
partitionCheck.append(checkbox, label);
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
// 处理appId
|
||||
// $('#addAppId').empty();
|
||||
// $('#addAppId').append('<option value="">请选择</option>');
|
||||
@@ -1027,4 +1098,10 @@ export default {
|
||||
height: 100%;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
.partition-checkbox-label {
|
||||
margin-right: 10px;
|
||||
margin-left: 5px;
|
||||
}
|
||||
|
||||
</style>
|
@@ -70,6 +70,18 @@
|
||||
<input type="text" class="form-control" name="headwearName" id="headwearName">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="headwearArName" class="col-sm-3 control-label">阿语头饰名称:</label>
|
||||
<div class="col-sm-9">
|
||||
<input type="text" class="form-control" name="headwearName" id="headwearArName">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="headwearEnName" class="col-sm-3 control-label">英语头饰名称:</label>
|
||||
<div class="col-sm-9">
|
||||
<input type="text" class="form-control" name="headwearName" id="headwearEnName">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">使用萝卜购买</label>
|
||||
<div class="col-sm-9">
|
||||
@@ -346,7 +358,9 @@ export default {
|
||||
//{field: 'id', title: 'id', align: 'center', width: '5%'},
|
||||
{ field: 'tmp', title: 'headwearId', align: 'center', checkbox: true, width: '5%' },
|
||||
{ field: 'headwearId', title: '头饰ID', align: 'center', width: '5%' },
|
||||
{ field: 'name', title: '头饰名称', align: 'center', width: '5%' },
|
||||
{field: 'name.zh', title: '头饰名称', align: 'center', width: '5%'},
|
||||
{field: 'name.ar', title: '阿语头饰名称', align: 'center', width: '5%'},
|
||||
{field: 'name.en', title: '英语头饰名称', align: 'center', width: '5%'},
|
||||
{
|
||||
field: 'goldSale',
|
||||
title: '金币购买',
|
||||
@@ -533,8 +547,30 @@ export default {
|
||||
};
|
||||
return param;
|
||||
},
|
||||
toolbar: '#toolbar',
|
||||
ajax:function(request){ //使用ajax请求
|
||||
$.ajax({
|
||||
type:"GET",
|
||||
url:'/admin/headwear/list.action',
|
||||
contentType:'application/json;charset=utf-8',
|
||||
dataType:'json',
|
||||
data: request.data,
|
||||
success:function (res) {
|
||||
console.log(res);
|
||||
request.success({
|
||||
"rows": res.rows.map(i=>{
|
||||
i.name = JSON.parse(i.name);
|
||||
return i;
|
||||
}),
|
||||
"total": res.total
|
||||
});
|
||||
},
|
||||
error:function(error){
|
||||
console.log(error);
|
||||
}
|
||||
})
|
||||
},
|
||||
toolbar: '#toolbar',
|
||||
// url: '/admin/headwear/list.action',
|
||||
onLoadSuccess: function () { //加载成功时执行
|
||||
console.log("load success");
|
||||
},
|
||||
@@ -552,6 +588,8 @@ export default {
|
||||
$("#btnAdd").click(function () {
|
||||
$("#headwearId").val("");
|
||||
$("#headwearName").val("");
|
||||
$("#headwearArName").val("");
|
||||
$("#headwearEnName").val("");
|
||||
$("#price").val("");
|
||||
$("#renewPrice").val("");
|
||||
$("#originalPrice").val("");
|
||||
@@ -591,6 +629,11 @@ export default {
|
||||
$("#add").click(function () {
|
||||
var headwearId = $("#headwearId").val();
|
||||
var headwearName = $("#headwearName").val();
|
||||
var headwearArName = $("#headwearArName").val();
|
||||
var headwearEnName = $("#headwearEnName").val();
|
||||
// 国际化字段
|
||||
var jsonName = {"zh":headwearName,"ar":headwearArName,"en":headwearEnName}
|
||||
const nameValue = JSON.stringify(jsonName);
|
||||
var price = $("#price").val();
|
||||
var renewPrice = $("#renewPrice").val();
|
||||
var days = $("#days").val();
|
||||
@@ -652,7 +695,7 @@ export default {
|
||||
url: "/admin/headwear/save.action",
|
||||
data: {
|
||||
headwearId: headwearId,
|
||||
name: headwearName,
|
||||
name: nameValue,
|
||||
price: price,
|
||||
renewPrice: renewPrice,
|
||||
days: days,
|
||||
@@ -708,7 +751,10 @@ export default {
|
||||
//$("#price").attr('readonly', true);
|
||||
//$("#renewPrice").attr('readonly', true);
|
||||
|
||||
$("#headwearName").val(json.name);
|
||||
var jsonName = JSON.parse(json.name);
|
||||
$("#headwearName").val(jsonName.zh);
|
||||
$("#headwearArName").val(jsonName.ar);
|
||||
$("#headwearEnName").val(jsonName.en);
|
||||
$("#price").val(json.price);
|
||||
$("#renewPrice").val(json.renewPrice);
|
||||
$("#limitDesc").val(json.limitDesc);
|
||||
|
@@ -65,8 +65,19 @@
|
||||
<div class="form-group">
|
||||
<label for="modal_name" class="col-sm-4 control-label">装扮名称:</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="text" class="form-control validate[required]" name="name" id="modal_name"
|
||||
placeholder="请输入资料卡名称">
|
||||
<input type="text" class="form-control validate[required]" name="name" id="modal_name" placeholder="请输入资料卡名称">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="ar_modal_name" class="col-sm-4 control-label">阿语装扮名称:</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="text" class="form-control validate[required]" name="name" id="ar_modal_name" placeholder="请输入资料卡名称">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="en_modal_name" class="col-sm-4 control-label">英语装扮名称:</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="text" class="form-control validate[required]" name="name" id="en_modal_name" placeholder="请输入资料卡名称">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
@@ -163,7 +174,9 @@ export default {
|
||||
$('#table').bootstrapTable({
|
||||
columns: [
|
||||
{ field: 'id', title: '装扮id', align: 'middle', width: '5%' },
|
||||
{ field: 'name', title: '装扮名称', align: 'middle', width: '5%' },
|
||||
{field: 'name.zh', title: '装扮名称', align: 'middle', width: '5%'},
|
||||
{field: 'name.ar', title: '阿语装扮名称', align: 'middle', width: '5%'},
|
||||
{field: 'name.en', title: '英语装扮名称', align: 'middle', width: '5%'},
|
||||
{
|
||||
field: 'pic',
|
||||
title: '装扮图片',
|
||||
@@ -254,8 +267,30 @@ export default {
|
||||
};
|
||||
return param;
|
||||
},
|
||||
toolbar: '#toolbar',
|
||||
ajax:function(request){ //使用ajax请求
|
||||
$.ajax({
|
||||
type:"GET",
|
||||
url:'/admin/infocard/listByPage',
|
||||
contentType:'application/json;charset=utf-8',
|
||||
dataType:'json',
|
||||
data: request.data,
|
||||
success:function (res) {
|
||||
console.log(res);
|
||||
request.success({
|
||||
"rows": res.rows.map(i=>{
|
||||
i.name = JSON.parse(i.name);
|
||||
return i;
|
||||
}),
|
||||
"total": res.total
|
||||
});
|
||||
},
|
||||
error:function(error){
|
||||
console.log(error);
|
||||
}
|
||||
})
|
||||
},
|
||||
toolbar: '#toolbar',
|
||||
// url: '/admin/infocard/listByPage',
|
||||
onLoadSuccess: function () { //加载成功时执行
|
||||
console.log("load success");
|
||||
},
|
||||
@@ -276,7 +311,11 @@ export default {
|
||||
// 赋值
|
||||
$("#addForm #modal_id").val(row.id);
|
||||
$("#addForm #modal_type").val(row.type);
|
||||
$("#addForm #modal_name").val(row.name);
|
||||
$("#addForm #modal_name").val(row.name.zh);
|
||||
// 阿语
|
||||
$("#addForm #ar_modal_name").val(row.name.ar);
|
||||
// 英语
|
||||
$("#addForm #en_modal_name").val(row.name.en);
|
||||
$('#addIconPicUrl').attr("src", row.pic);
|
||||
$("#addForm #pic").val(row.pic);
|
||||
$("#addForm #status").val(row.status);
|
||||
@@ -320,12 +359,24 @@ export default {
|
||||
$('#button-save').on('click', function () {
|
||||
var pic = $('#pic').val();
|
||||
var name = $('#modal_name').val();
|
||||
var arName = $('#ar_modal_name').val();
|
||||
var enName = $('#en_modal_name').val();
|
||||
//做下数据校验
|
||||
if (isEmpty(name)) {
|
||||
$("#tipMsg").text("装扮名字不能为空");
|
||||
$("#tipModal").modal('show');
|
||||
return;
|
||||
}
|
||||
if (isEmpty(arName)) {
|
||||
$("#tipMsg").text("阿语装扮名字不能为空");
|
||||
$("#tipModal").modal('show');
|
||||
return;
|
||||
}
|
||||
if (isEmpty(enName)) {
|
||||
$("#tipMsg").text("英语装扮名字不能为空");
|
||||
$("#tipModal").modal('show');
|
||||
return;
|
||||
}
|
||||
if (isEmpty(pic)) {
|
||||
$("#tipMsg").text("图片不能为空");
|
||||
$("#tipModal").modal('show');
|
||||
@@ -333,10 +384,24 @@ export default {
|
||||
}
|
||||
if ($("#addForm").validationEngine('validate')) {
|
||||
console.log('$("#addForm").serialize()', $("#addForm").serialize())
|
||||
// 获取序列化字符串并转换为对象
|
||||
let formData = $('#addForm').serializeArray().reduce(function(obj, item) {
|
||||
obj[item.name] = item.value;
|
||||
return obj;
|
||||
}, {});
|
||||
|
||||
// 国际化字段
|
||||
var jsonName = {"zh":name,"ar":arName,"en":enName}
|
||||
const nameValue = JSON.stringify(jsonName);
|
||||
// 修改属性值
|
||||
formData.name = nameValue; // 将giftName修改为"newGiftName"
|
||||
|
||||
// 将修改后的对象转换回序列化字符串
|
||||
let newSerializeStr = $.param(formData);
|
||||
$.ajax({
|
||||
type: "post",
|
||||
url: "/admin/infocard/saveOrUpdate",
|
||||
data: $("#addForm").serialize(),
|
||||
data: newSerializeStr,
|
||||
dataType: "json",
|
||||
success: function (json) {
|
||||
if (json.code === 200) {
|
||||
|
@@ -10,12 +10,23 @@
|
||||
|
||||
<form id="searchForm" action="/admin/luckyBagRecord/recordExport" method="get" target="_blank">
|
||||
<div class="col-sm-10">
|
||||
福袋:<select name="luckyBagId" id="qLuckyBagId">
|
||||
福袋:
|
||||
<select name="luckyBagId" id="qLuckyBagId" class="form-control">
|
||||
</select>
|
||||
购买人平台号:<input type="text" name="erbanNo" id="qErbanNo" class="input-sm" placeholder="" />
|
||||
开出礼物名称:<input type="text" name="giftName" id="qGiftName" class="input-sm" placeholder="" />
|
||||
日期:<input type="text" name="startDate" id="qStartDate" class="input-sm datetime" placeholder="">
|
||||
- <input type="text" name="endDate" id="qEndDate" class="input-sm datetime" placeholder="">
|
||||
送礼人地区:
|
||||
<select name="sendPartitionId" id="sendPartitionId" class="form-control">
|
||||
</select>
|
||||
收礼人地区:
|
||||
<select name="receivePartitionId" id="receivePartitionId" class="form-control">
|
||||
</select>
|
||||
购买人平台号:
|
||||
<input type="text" name="erbanNo" id="qErbanNo" class="input-sm form-control" placeholder="" />
|
||||
开出礼物名称:
|
||||
<input type="text" name="giftName" id="qGiftName" class="input-sm form-control" placeholder="" />
|
||||
日期:
|
||||
<input type="text" name="startDate" id="qStartDate" class="input-sm datetime form-control" placeholder="">
|
||||
-
|
||||
<input type="text" name="endDate" id="qEndDate" class="input-sm datetime form-control" placeholder="">
|
||||
</div>
|
||||
</form>
|
||||
<div class="col-sm-2">
|
||||
@@ -35,6 +46,8 @@
|
||||
|
||||
<script>
|
||||
import TableHelper from '@/utils/bootstrap-table-helper';
|
||||
import { getPartitionInfoList } from '@/api/partition/partitionInfo';
|
||||
import { buildSelectOption } from '@/utils/system-helper';
|
||||
|
||||
export default {
|
||||
name: "LuckyBagRecordView",
|
||||
@@ -63,8 +76,10 @@ export default {
|
||||
{ field: 'luckyBagId', title: '福袋ID', align: 'center', width: '5%' },
|
||||
{ field: 'erbanNo', title: '送礼人平台号', align: 'center', width: '5%' },
|
||||
{ field: 'nick', title: '送礼人昵称', align: 'center', width: '5%' },
|
||||
{ field: 'sendPartitionDesc', title: '送礼人地区', align: 'center', valign: 'middle' },
|
||||
{ field: 'receiveErbanNo', title: '收礼人平台号', align: 'center', width: '5%' },
|
||||
{ field: 'receiveNick', title: '收礼人昵称', align: 'center', width: '5%' },
|
||||
{ field: 'receivePartitionDesc', title: '收礼人地区', align: 'center', valign: 'middle' },
|
||||
{ field: 'totalGoldNum', title: '福袋时价', align: 'center', width: '5%' },
|
||||
{ field: 'giftName', title: '礼物名称', align: 'center', width: '5%' },
|
||||
{ field: 'giftValue', title: '礼物价值', align: 'center', width: '5%' },
|
||||
@@ -90,7 +105,8 @@ export default {
|
||||
giftName: $('#qGiftName').val(),
|
||||
startDate: $('#qStartDate').val(),
|
||||
endDate: $('#qEndDate').val(),
|
||||
|
||||
sendPartitionId: $('#sendPartitionId').val(),
|
||||
receivePartitionId: $('#receivePartitionId').val(),
|
||||
};
|
||||
return param;
|
||||
},
|
||||
|
@@ -10,11 +10,18 @@
|
||||
|
||||
<form id="searchForm" action="/admin/luckyBagRecord/statsExport" method="get" target="_blank">
|
||||
<div class="col-sm-10">
|
||||
福袋:<select name="luckyBagId" id="qLuckyBagId">
|
||||
福袋:
|
||||
<select name="luckyBagId" id="qLuckyBagId" class="form-control">
|
||||
</select>
|
||||
平台号:<input type="text" name="erbanNo" id="qErbanNo" class="input-sm" placeholder="" />
|
||||
日期:<input type="text" name="startDate" id="qStartDate" class="input-sm datetime" placeholder="">
|
||||
- <input type="text" name="endDate" id="qEndDate" class="input-sm datetime" placeholder="">
|
||||
地区:
|
||||
<select name="partitionId" id="partitionId" class="form-control">
|
||||
</select>
|
||||
平台号:
|
||||
<input type="text" name="erbanNo" id="qErbanNo" class="input-sm form-control" placeholder="" />
|
||||
日期:
|
||||
<input type="text" name="startDate" id="qStartDate" class="input-sm datetime form-control" placeholder="">
|
||||
-
|
||||
<input type="text" name="endDate" id="qEndDate" class="input-sm datetime form-control" placeholder="">
|
||||
</div>
|
||||
</form>
|
||||
<div class="col-sm-2">
|
||||
@@ -54,6 +61,8 @@
|
||||
|
||||
<script>
|
||||
import TableHelper from '@/utils/bootstrap-table-helper';
|
||||
import { getPartitionInfoList } from '@/api/partition/partitionInfo';
|
||||
import { buildSelectOption } from '@/utils/system-helper';
|
||||
|
||||
export default {
|
||||
name: "LuckyBagStatsView",
|
||||
@@ -62,6 +71,7 @@ export default {
|
||||
},
|
||||
created() {
|
||||
this.$nextTick(function () {
|
||||
this.initPartition();
|
||||
this.initData();
|
||||
});
|
||||
},
|
||||
@@ -80,6 +90,7 @@ export default {
|
||||
columns: [
|
||||
{ field: 'erbanNo', title: '平台号', align: 'center', width: '5%' },
|
||||
{ field: 'nick', title: '昵称', align: 'center', width: '5%' },
|
||||
{ field: 'partitionDesc', title: '地区', align: 'center', valign: 'middle' },
|
||||
{ field: 'num', title: '福袋购买数量', align: 'center', width: '5%' },
|
||||
{ field: 'inputValue', title: '用户投入钻石数', align: 'center', width: '5%' },
|
||||
{ field: 'outputValue', title: '平台支出钻石数', align: 'center', width: '5%' },
|
||||
@@ -109,6 +120,7 @@ export default {
|
||||
erbanNo: $('#qErbanNo').val(),
|
||||
startDate: $('#qStartDate').val(),
|
||||
endDate: $('#qEndDate').val(),
|
||||
partitionId: $('#partitionId').val(),
|
||||
|
||||
};
|
||||
return param;
|
||||
@@ -158,7 +170,21 @@ export default {
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
initPartition() {
|
||||
getPartitionInfoList().then(res => {
|
||||
let data = res.data;
|
||||
buildSelectOption(
|
||||
"#partitionId",
|
||||
null,
|
||||
data.map((v) => {
|
||||
return {
|
||||
value: v.id,
|
||||
text: v.desc,
|
||||
};
|
||||
})
|
||||
);
|
||||
});
|
||||
},
|
||||
};
|
||||
|
||||
function formatTime(val) {
|
||||
|
@@ -73,8 +73,19 @@
|
||||
<div class="form-group">
|
||||
<label for="name1" class="col-sm-4 control-label">铭牌名称:</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="text" class="form-control validate[required]" name="name1" id="name1"
|
||||
placeholder="请输入,5个字符内">
|
||||
<input type="text" class="form-control validate[required]" name="name1" id="name1" placeholder="请输入,5个字符内">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="ar_name1" class="col-sm-4 control-label">阿语铭牌名称:</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="text" class="form-control validate[required]" name="name1" id="ar_name1" placeholder="请输入,5个字符内">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="en_name1" class="col-sm-4 control-label">英语铭牌名称:</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="text" class="form-control validate[required]" name="name1" id="en_name1" placeholder="请输入,5个字符内">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
@@ -202,7 +213,9 @@ export default {
|
||||
columns: [
|
||||
{ field: 'id', title: '铭牌id', align: 'middle', width: '5%' },
|
||||
{ field: 'nameplateTypeStr', title: '铭牌类型', align: 'middle', width: '5%' },
|
||||
{ field: 'name', title: '铭牌名称', align: 'middle', width: '5%' },
|
||||
{field: 'name.zh', title: '铭牌名称', align: 'middle', width: '5%'},
|
||||
{field: 'name.ar', title: '阿语铭牌名称', align: 'middle', width: '5%'},
|
||||
{field: 'name.en', title: '英语铭牌名称', align: 'middle', width: '5%'},
|
||||
{
|
||||
field: 'iconPic',
|
||||
title: '铭牌图片',
|
||||
@@ -289,8 +302,30 @@ export default {
|
||||
};
|
||||
return param;
|
||||
},
|
||||
toolbar: '#toolbar',
|
||||
ajax:function(request){ //使用ajax请求
|
||||
$.ajax({
|
||||
type:"GET",
|
||||
url:'/admin/nameplate/list.action',
|
||||
contentType:'application/json;charset=utf-8',
|
||||
dataType:'json',
|
||||
data: request.data,
|
||||
success:function (res) {
|
||||
console.log(res);
|
||||
request.success({
|
||||
"rows": res.rows.map(i=>{
|
||||
i.name = JSON.parse(i.name);
|
||||
return i;
|
||||
}),
|
||||
"total": res.total
|
||||
});
|
||||
},
|
||||
error:function(error){
|
||||
console.log(error);
|
||||
}
|
||||
})
|
||||
},
|
||||
toolbar: '#toolbar',
|
||||
// url: '/admin/nameplate/list.action',
|
||||
onLoadSuccess: function () { //加载成功时执行
|
||||
console.log("load success");
|
||||
},
|
||||
@@ -316,9 +351,12 @@ export default {
|
||||
if (json) {
|
||||
$("#id").val(json.id);
|
||||
$("#nameplateType1").val(json.nameplateType);
|
||||
$("#name1").val(json.name);
|
||||
var jsonName = JSON.parse(json.name);
|
||||
console.log(jsonName)
|
||||
$("#name1").val(jsonName.zh);
|
||||
$("#ar_name1").val(jsonName.ar);
|
||||
$("#en_name1").val(jsonName.en);
|
||||
$('#nameplateType1').attr("disabled", "true");
|
||||
$('#name1').attr("readonly", "readonly");
|
||||
if (json.isCustomWord == 0) {
|
||||
$('input[name="isCustomWord"]').get(0).checked = true;
|
||||
$('#fixedWord-div').removeClass("hidden");
|
||||
@@ -385,6 +423,11 @@ export default {
|
||||
var fixedWord = $('#fixedWord').val();
|
||||
var isCustomWord = $('input[name="isCustomWord"]:checked').val();
|
||||
var name = $('#name1').val();
|
||||
var ar_name = $('#ar_name1').val();
|
||||
var en_name = $('#en_name1').val();
|
||||
|
||||
var jsonName = {"zh":name,"ar":ar_name,"en":en_name}
|
||||
const nameValue = JSON.stringify(jsonName);
|
||||
var nameplateType = $('#nameplateType1').val();
|
||||
var id = $('#id').val();
|
||||
//做下数据校验
|
||||
@@ -402,6 +445,24 @@ export default {
|
||||
$("#tipModal").modal('show');
|
||||
return;
|
||||
}
|
||||
if (isEmpty(ar_name)) {
|
||||
$("#tipMsg").text("阿语铭牌名字不能为空");
|
||||
$("#tipModal").modal('show');
|
||||
return;
|
||||
}else if (ar_name.length > 5) {
|
||||
$("#tipMsg").text("阿语铭牌名字最多5个字");
|
||||
$("#tipModal").modal('show');
|
||||
return;
|
||||
}
|
||||
if (isEmpty(en_name)) {
|
||||
$("#tipMsg").text("英语铭牌名字不能为空");
|
||||
$("#tipModal").modal('show');
|
||||
return;
|
||||
}else if (en_name.length > 5) {
|
||||
$("#tipMsg").text("英语铭牌名字最多5个字");
|
||||
$("#tipModal").modal('show');
|
||||
return;
|
||||
}
|
||||
// if (isEmpty(isCustomWord)) {
|
||||
// $("#tipMsg").text("用户自定义文案不能为空");
|
||||
// $("#tipModal").modal('show');
|
||||
@@ -445,7 +506,7 @@ export default {
|
||||
url: "/admin/nameplate/save.action",
|
||||
data: {
|
||||
nameplateType: nameplateType,
|
||||
name: name,
|
||||
name: nameValue,
|
||||
isCustomWord: isCustomWord,
|
||||
fixedWord: fixedWord,
|
||||
days: days,
|
||||
@@ -576,6 +637,8 @@ function cleanNamePlateModal() {
|
||||
$(this).removeAttr("checked");
|
||||
});
|
||||
$('#name1').val('');
|
||||
$('#ar_name1').val('');
|
||||
$('#en_name1').val('');
|
||||
$('#nameplateType1').val('');
|
||||
$('#name1').removeAttr("readonly");
|
||||
$('#nameplateType1').removeAttr("disabled");
|
||||
|
@@ -38,6 +38,18 @@
|
||||
<input type="text" class="form-control validate[required]" name="giftName" id="giftName">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="giftArName" class="col-sm-2 control-label">阿语福袋名称</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" class="form-control validate[required]" name="giftName" id="giftArName">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="giftEnName" class="col-sm-2 control-label">印语福袋名称</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" class="form-control validate[required]" name="giftName" id="giftEnName">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="goldPrice" class="col-sm-2 control-label">价格</label>
|
||||
<div class="col-sm-10">
|
||||
@@ -408,7 +420,9 @@ export default {
|
||||
$('#table').bootstrapTable({
|
||||
columns: [
|
||||
{ field: 'giftId', title: 'ID', align: 'center', width: '5%' },
|
||||
{ field: 'giftName', title: '福袋名称', align: 'center', width: '5%' },
|
||||
{field: 'giftName.zh', title: '福袋名称', align: 'center', width: '5%'},
|
||||
{field: 'giftName.ar', title: '阿语福袋名称', align: 'center', width: '5%'},
|
||||
{field: 'giftName.en', title: '英语福袋名称', align: 'center', width: '5%'},
|
||||
{
|
||||
field: 'goldPrice',
|
||||
title: '福袋价格',
|
||||
@@ -525,7 +539,10 @@ export default {
|
||||
success: function (res) {
|
||||
console.log(res);
|
||||
request.success({
|
||||
rows: res.rows,
|
||||
"rows": res.rows.map(i=>{
|
||||
i.giftName = JSON.parse(i.giftName);
|
||||
return i;
|
||||
}),
|
||||
total: res.total
|
||||
});
|
||||
// $('#table-request').bootstrapTable('load', res.data.rows);
|
||||
@@ -768,11 +785,30 @@ export default {
|
||||
|
||||
// 保存福袋
|
||||
$("#add").click(function () {
|
||||
// 获取序列化字符串并转换为对象
|
||||
let formData = $('#giftForm').serializeArray().reduce(function(obj, item) {
|
||||
obj[item.name] = item.value;
|
||||
return obj;
|
||||
}, {});
|
||||
|
||||
var name = $("#giftName").val();
|
||||
// 阿语名称
|
||||
var ar_name = $("#giftArName").val();
|
||||
// 英语名称
|
||||
var en_name = $("#giftEnName").val();
|
||||
// 国际化字段
|
||||
var jsonName = {"zh":name,"ar":ar_name,"en":en_name}
|
||||
const nameValue = JSON.stringify(jsonName);
|
||||
// 修改属性值
|
||||
formData.giftName = nameValue; // 将giftName修改为"newGiftName"
|
||||
|
||||
// 将修改后的对象转换回序列化字符串
|
||||
let newSerializeStr = $.param(formData);
|
||||
if ($("#giftForm").validationEngine('validate')) {
|
||||
$.ajax({
|
||||
type: "post",
|
||||
url: "/admin/luckyBag/save.action",
|
||||
data: $('#giftForm').serialize(),
|
||||
data: newSerializeStr,
|
||||
dataType: "json",
|
||||
success: function (json) {
|
||||
if (json.code == 200) {
|
||||
@@ -804,7 +840,12 @@ export default {
|
||||
console.log('gift', gift);
|
||||
$("#giftId").val(gift.giftId);
|
||||
$("#giftStatus").val(gift.giftStatus);
|
||||
$("#giftName").val(gift.giftName);
|
||||
var jsonName = JSON.parse(gift.giftName);
|
||||
$("#giftName").val(jsonName.zh);
|
||||
// 阿语名称
|
||||
$("#giftArName").val(jsonName.ar);
|
||||
// 英语名称
|
||||
$("#giftEnName").val(jsonName.en);
|
||||
$("#goldPrice").val(gift.goldPrice);
|
||||
$("#seqNo").val(gift.seqNo);
|
||||
$("#startValidTime").val(formatTime(gift.startValidTime));
|
||||
|
@@ -8,18 +8,19 @@
|
||||
<section class="content">
|
||||
<div id="table"></div>
|
||||
<div id="toolbar">
|
||||
<input type="text" name="erbanNo" id="erbanNo" placeholder="请输入平台号">
|
||||
<select name="sort" id="sort">
|
||||
<input type="text" name="erbanNo" id="erbanNo" placeholder="请输入平台号" class="form-control">
|
||||
<select name="sort" id="sort" class="form-control">
|
||||
<option value="0">默认</option>
|
||||
<option value="1">创建时间</option>
|
||||
</select>
|
||||
<select name="roomPermitType" id="roomPermitType">
|
||||
<select name="roomPermitType" id="roomPermitType" class="form-control">
|
||||
<option value="0"></option>
|
||||
<option value="1">牌照房</option>
|
||||
<option value="2">非牌照房</option>
|
||||
<option value="3">新秀房</option>
|
||||
<option value="4">个播房</option>
|
||||
</select>
|
||||
<select name="partitionId" id="partitionId" class="form-control"></select>
|
||||
<button id="btnSearch" class="btn btn-sm btn-primary">查询</button>
|
||||
</div>
|
||||
</section>
|
||||
@@ -254,7 +255,8 @@
|
||||
|
||||
<script>
|
||||
import TableHelper from '@/utils/bootstrap-table-helper';
|
||||
import ComboboxHelper from '@/assets/plugins/bootstrap-combobox/js/bootstrap-combobox-helper';
|
||||
import { getPartitionInfoList } from '@/api/partition/partitionInfo';
|
||||
import { buildSelectOption } from '@/utils/system-helper';
|
||||
|
||||
export default {
|
||||
name: "RoomSearchAdminView",
|
||||
@@ -263,6 +265,7 @@ export default {
|
||||
},
|
||||
created() {
|
||||
this.$nextTick(function () {
|
||||
this.initPartition();
|
||||
this.initData();
|
||||
});
|
||||
},
|
||||
@@ -300,7 +303,8 @@ export default {
|
||||
pageNumber: params.pageNumber,
|
||||
sort: $('#sort').val(),
|
||||
roomPermitType: $('#roomPermitType').val(),
|
||||
erbanNo: $('#erbanNo').val()
|
||||
erbanNo: $('#erbanNo').val(),
|
||||
partitionId: $('#partitionId').val(),
|
||||
};
|
||||
return param;
|
||||
},
|
||||
@@ -317,6 +321,7 @@ export default {
|
||||
{ field: 'room.uid', title: 'Uid', align: 'center', valign: 'middle' },
|
||||
{ field: 'erbanNo', title: '平台号', align: 'center', valign: 'middle' },
|
||||
{ field: 'room.title', title: '标题', align: 'center', valign: 'middle' },
|
||||
{ field:'partitionDesc',title:'地区',align:'center',valign:'middle' },
|
||||
{
|
||||
field: 'room.avatar',
|
||||
title: '房间头像',
|
||||
@@ -1035,7 +1040,22 @@ export default {
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
},
|
||||
initPartition() {
|
||||
getPartitionInfoList().then(res => {
|
||||
let data = res.data;
|
||||
buildSelectOption(
|
||||
"#partitionId",
|
||||
null,
|
||||
data.map((v) => {
|
||||
return {
|
||||
value: v.id,
|
||||
text: v.desc,
|
||||
};
|
||||
})
|
||||
);
|
||||
});
|
||||
},
|
||||
},
|
||||
|
||||
};
|
||||
|
@@ -124,6 +124,7 @@ export default {
|
||||
$("#table").bootstrapTable("destroy");
|
||||
$("#table").bootstrapTable({
|
||||
columns: [
|
||||
{ field: 'partitionDesc', title: '地区', align: 'center', valign: 'middle' },
|
||||
{ field: "userNick", title: "用户名称", align: "center", width: "20%" },
|
||||
{ field: "userErbanNo", title: "房主平台号", align: "center", width: "15%" },
|
||||
{ field: "totalGold", title: "总流水", align: "center", width: "10%" },
|
||||
|
@@ -16,6 +16,9 @@
|
||||
<div class="col-sm-2">
|
||||
<input type="text" class="form-control" name="roomTitle" id="roomTitle" placeholder="">
|
||||
</div>
|
||||
<div class="col-sm-2">
|
||||
<select name="partitionId" id="partitionId" class="form-control"></select>
|
||||
</div>
|
||||
<button id="btnSearch" class="btn btn-default">
|
||||
<i class="glyphicon glyphicon-search"></i>查询
|
||||
</button>
|
||||
@@ -99,6 +102,8 @@
|
||||
<script>
|
||||
import TableHelper from '@/utils/bootstrap-table-helper';
|
||||
import { formatTime } from '@/utils/maintainer';
|
||||
import { getPartitionInfoList } from '@/api/partition/partitionInfo';
|
||||
import { buildSelectOption } from '@/utils/system-helper';
|
||||
|
||||
// tab类型选择变化查询
|
||||
/*function selectOnTabChange(obj){
|
||||
@@ -112,6 +117,7 @@ export default {
|
||||
},
|
||||
created() {
|
||||
this.$nextTick(function () {
|
||||
this.initPartition();
|
||||
this.initData();
|
||||
});
|
||||
},
|
||||
@@ -158,6 +164,7 @@ export default {
|
||||
return "<img src='" + val + "' width='40' height='40'>";
|
||||
}
|
||||
},
|
||||
{ field: 'partitionDesc', title: '地区', align: 'center', valign: 'middle' },
|
||||
{
|
||||
field: 'isTop',
|
||||
title: '是否置顶',
|
||||
@@ -221,8 +228,8 @@ export default {
|
||||
page: params.pageNumber,
|
||||
pageSize: params.pageSize,
|
||||
erbanNo: $('#erbanNo').val(),
|
||||
roomTitle: $('#roomTitle').val()
|
||||
//tabId: tabId
|
||||
roomTitle: $('#roomTitle').val(),
|
||||
partitionId: $('#partitionId').val(),
|
||||
};
|
||||
console.log(param);
|
||||
return param;
|
||||
@@ -401,7 +408,21 @@ export default {
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
initPartition() {
|
||||
getPartitionInfoList().then(res => {
|
||||
let data = res.data;
|
||||
buildSelectOption(
|
||||
"#partitionId",
|
||||
null,
|
||||
data.map((v) => {
|
||||
return {
|
||||
value: v.id,
|
||||
text: v.desc,
|
||||
};
|
||||
})
|
||||
);
|
||||
});
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
|
@@ -14,6 +14,9 @@
|
||||
onchange="selectOnTabChange(this)">
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-sm-2">
|
||||
<select name="partitionId" id="partitionId" class="form-control"></select>
|
||||
</div>
|
||||
<button id="btnAddRoom" class="btn btn-default">
|
||||
<i class="glyphicon glyphicon-plus"></i>添加房间
|
||||
</button>
|
||||
@@ -129,6 +132,8 @@
|
||||
<script>
|
||||
import TableHelper from '@/utils/bootstrap-table-helper';
|
||||
import { formatTime } from '@/utils/maintainer';
|
||||
import { getPartitionInfoList } from '@/api/partition/partitionInfo';
|
||||
import { buildSelectOption } from '@/utils/system-helper';
|
||||
|
||||
export default {
|
||||
name: "RoomTabMapView",
|
||||
@@ -145,13 +150,12 @@ export default {
|
||||
},
|
||||
created() {
|
||||
this.$nextTick(function () {
|
||||
this.initPartition();
|
||||
this.initData();
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
initData() {
|
||||
|
||||
|
||||
$(function () {
|
||||
$('.datetime').datetimepicker({
|
||||
format: 'yyyy-mm-dd hh:ii:00',
|
||||
@@ -184,6 +188,7 @@ export default {
|
||||
}
|
||||
},
|
||||
{ field: 'roomTag', title: '房间标签', align: 'center', width: '5%' },
|
||||
{ field: 'partitionDesc', title: '地区', align: 'center', valign: 'middle' },
|
||||
{
|
||||
field: 'isTop', title: '是否置顶', align: 'center', valign: 'middle', width: '5%',
|
||||
formatter: function (val, row, index) {
|
||||
@@ -231,7 +236,8 @@ export default {
|
||||
pageSize: params.pageSize,
|
||||
erbanNo: $('#erbanNo').val(),
|
||||
roomTitle: $('#roomTitle').val(),
|
||||
tabId: tabId
|
||||
tabId: tabId,
|
||||
partitionId: partitionId,
|
||||
};
|
||||
console.log(param);
|
||||
return param;
|
||||
@@ -442,7 +448,21 @@ export default {
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
initPartition() {
|
||||
getPartitionInfoList().then(res => {
|
||||
let data = res.data;
|
||||
buildSelectOption(
|
||||
"#partitionId",
|
||||
null,
|
||||
data.map((v) => {
|
||||
return {
|
||||
value: v.id,
|
||||
text: v.desc,
|
||||
};
|
||||
})
|
||||
);
|
||||
});
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
|
@@ -51,6 +51,18 @@
|
||||
<input type="text" class="form-control validate[required]" name="name" id="modal_name">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="ar_modal_name" class="col-sm-3 control-label">阿语名称<font color="red">*</font>:</label>
|
||||
<div class="col-sm-9">
|
||||
<input type="text" class="form-control validate[required]" name="name" id="ar_modal_name">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="en_modal_name" class="col-sm-3 control-label">英语名称<font color="red">*</font>:</label>
|
||||
<div class="col-sm-9">
|
||||
<input type="text" class="form-control validate[required]" name="name" id="en_modal_name">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="status" class="col-sm-3 control-label">显示状态<font color="red">*</font>:</label>
|
||||
<div class="col-sm-9">
|
||||
@@ -105,7 +117,9 @@ export default {
|
||||
$('#table').bootstrapTable({
|
||||
columns: [
|
||||
{ field: 'seq', title: '排序', align: 'center', width: '5%' },
|
||||
{ field: 'name', title: 'Tab名称', align: 'center', width: '10%' },
|
||||
{field: 'name.zh', title: 'Tab名称', align: 'center', width: '10%'},
|
||||
{field: 'name.ar', title: '阿语Tab名称', align: 'center', width: '10%'},
|
||||
{field: 'name.en', title: '英语Tab名称', align: 'center', width: '10%'},
|
||||
{
|
||||
field: 'status', title: '显示状态', align: 'center', valign: 'middle', width: '5%',
|
||||
formatter: function (val, row, index) {
|
||||
@@ -134,7 +148,6 @@ export default {
|
||||
align: 'center',
|
||||
width: '10%',
|
||||
formatter: function (val, row, index) {
|
||||
var pageNum = $("#currentPageNum").val();
|
||||
return '<button id="btnEdit" name="btnEdit" class="btn btn-sm btn-success opt-edit" data-id=' + val + '>' +
|
||||
'<i class="glyphicon glyphicon-edit"></i> 编辑</button>' +
|
||||
' <button class="btn btn-sm btn-danger opt-remove" data-id=' + val +
|
||||
@@ -170,8 +183,11 @@ export default {
|
||||
success: function (res) {
|
||||
console.log(res);
|
||||
request.success({
|
||||
rows: res.data.roomTabList,
|
||||
total: res.data.totalPage
|
||||
"rows": res.rows.map(i=>{
|
||||
i.name = JSON.parse(i.name);
|
||||
return i;
|
||||
}),
|
||||
"total": res.total
|
||||
});
|
||||
},
|
||||
error: function (error) {
|
||||
@@ -198,6 +214,8 @@ export default {
|
||||
$("#btnAdd").click(function () {
|
||||
$("#id").val("");
|
||||
$("#modal_name").val("");
|
||||
$("#ar_modal_name").val("");
|
||||
$("#en_modal_name").val("");
|
||||
$("#modal_seq").val("");
|
||||
$("#modal_status").val("");
|
||||
$("#modal_room_tab_show").val("");
|
||||
@@ -213,6 +231,13 @@ export default {
|
||||
$("#add").click(function () {
|
||||
var id = $("#id").val();
|
||||
var name = $("#modal_name").val();
|
||||
// 阿语名称
|
||||
var ar_name = $("#ar_modal_name").val();
|
||||
// 英语名称
|
||||
var en_name = $("#en_modal_name").val();
|
||||
// 国际化字段
|
||||
var jsonName = {"zh":name,"ar":ar_name,"en":en_name}
|
||||
const nameValue = JSON.stringify(jsonName);
|
||||
var seq = $("#modal_seq").val();
|
||||
var status = $("#modal_status").val();
|
||||
var roomTabShow = $("#modal_room_tab_show").val();
|
||||
@@ -223,7 +248,7 @@ export default {
|
||||
url: "/admin/roomTab/save.action",
|
||||
data: {
|
||||
id: id,
|
||||
name: name,
|
||||
name: nameValue,
|
||||
seq: seq,
|
||||
status: status,
|
||||
roomTabShow: roomTabShow,
|
||||
@@ -262,7 +287,12 @@ export default {
|
||||
if (ret.code == 200) {
|
||||
var json = ret.data.roomTab;
|
||||
$("#id").val(id);
|
||||
$("#modal_name").val(json.name);
|
||||
var jsonName = JSON.parse(json.name);
|
||||
$("#modal_name").val(jsonName.zh);
|
||||
// 阿语名称
|
||||
$("#ar_modal_name").val(jsonName.ar);
|
||||
// 英语名称
|
||||
$("#en_modal_name").val(jsonName.en);
|
||||
$("#modal_seq").val(json.seq);
|
||||
if (json.status == 1) {
|
||||
$("#modal_status").val(1);
|
||||
|
@@ -86,6 +86,18 @@
|
||||
<input type="text" class="form-control validate[required]" name="name" id="modal_name">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="ar_modal_name" class="col-sm-3 control-label">阿语名称<font color="red">*</font>:</label>
|
||||
<div class="col-sm-9">
|
||||
<input type="text" class="form-control validate[required]" name="name" id="ar_modal_name">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="en_modal_name" class="col-sm-3 control-label">英语名称<font color="red">*</font>:</label>
|
||||
<div class="col-sm-9">
|
||||
<input type="text" class="form-control validate[required]" name="name" id="en_modal_name">
|
||||
</div>
|
||||
</div>
|
||||
<!-- 上传act图片 -->
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">图片:</label>
|
||||
@@ -105,6 +117,13 @@
|
||||
placeholder="数字小的排前面,必填">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="partitionId" class="col-sm-3 control-label">选择地区<font color="red">*</font>:</label>
|
||||
<div class="col-sm-9">
|
||||
<select name="partitionId" id="modal_partitionId" class="form-control validate[required]">
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="status" class="col-sm-3 control-label">状态<font color="red">*</font>:</label>
|
||||
<div class="col-sm-9">
|
||||
@@ -165,6 +184,8 @@
|
||||
|
||||
<script>
|
||||
import TableHelper from '@/utils/bootstrap-table-helper';
|
||||
import { getPartitionInfoList } from '@/api/partition/partitionInfo';
|
||||
import { buildSelectOption } from '@/utils/system-helper';
|
||||
|
||||
export default {
|
||||
name: "RoomtagAdminView",
|
||||
@@ -173,6 +194,7 @@ export default {
|
||||
},
|
||||
created() {
|
||||
this.$nextTick(function () {
|
||||
this.initPartition();
|
||||
this.initData();
|
||||
});
|
||||
},
|
||||
@@ -183,9 +205,11 @@ export default {
|
||||
$('#table').bootstrapTable({
|
||||
columns: [
|
||||
{ field: 'id', title: '编号', align: 'center', width: '5%' },
|
||||
{ field: 'name', title: '名称', align: 'center', width: '10%' },
|
||||
{
|
||||
field: 'pict', title: '图片', align: 'center', width: '10%', valign: 'center',
|
||||
{ field:'partitionDesc',title:'地区',align:'center',valign:'middle' },
|
||||
{field: 'name.zh', title: '名称', align: 'center', width: '10%'},
|
||||
{field: 'name.ar', title: '阿语名称', align: 'center', width: '10%'},
|
||||
{field: 'name.en', title: '英语名称', align: 'center', width: '10%'},
|
||||
{field: 'pict', title: '图片', align:'center', width: '10%',valign:'center',
|
||||
formatter: function (val,row,index) {
|
||||
if(null == val || val == '') {
|
||||
return '-';
|
||||
@@ -274,8 +298,31 @@ export default {
|
||||
};
|
||||
return param;
|
||||
},
|
||||
toolbar: '#toolbar',
|
||||
ajax:function(request){ //使用ajax请求
|
||||
$.ajax({
|
||||
type:"GET",
|
||||
url:'/admin/roomtag/list.action',
|
||||
contentType:'application/json;charset=utf-8',
|
||||
dataType:'json',
|
||||
data: request.data,
|
||||
success:function (res) {
|
||||
console.log(res);
|
||||
request.success({
|
||||
"rows": res.rows.map(i=>{
|
||||
i.name = JSON.parse(i.name);
|
||||
i.pict = JSON.parse(i.pict);
|
||||
return i;
|
||||
}),
|
||||
"total": res.total
|
||||
});
|
||||
},
|
||||
error:function(error){
|
||||
console.log(error);
|
||||
}
|
||||
})
|
||||
},
|
||||
toolbar: '#toolbar',
|
||||
// url: '/admin/roomtag/list.action',
|
||||
onLoadSuccess: function () { //加载成功时执行
|
||||
console.log("load success");
|
||||
},
|
||||
@@ -321,12 +368,14 @@ export default {
|
||||
}
|
||||
}
|
||||
$('#addForm').ajaxSubmit(options);
|
||||
})
|
||||
});
|
||||
|
||||
//新建标签
|
||||
$("#btnAdd").click(function () {
|
||||
$("#id").val("");
|
||||
$("#modal_name").val("");
|
||||
$("#ar_modal_name").val("");
|
||||
$("#en_modal_name").val("");
|
||||
$("#modal_seq").val("");
|
||||
$("#modal_status").val("");
|
||||
$("#modal_type").val("");
|
||||
@@ -335,18 +384,27 @@ export default {
|
||||
$('#addActPic').val('');
|
||||
$('#addUploadFile').val('');
|
||||
$('#addImgUrl').attr('src', '');
|
||||
$('#modal_partitionId').val('');
|
||||
$("#roomTagModal").modal('show');
|
||||
});
|
||||
|
||||
$("#add").click(function () {
|
||||
var id = $("#id").val();
|
||||
var name = $("#modal_name").val();
|
||||
// 阿语名称
|
||||
var ar_name = $("#ar_modal_name").val();
|
||||
// 英语名称
|
||||
var en_name = $("#en_modal_name").val();
|
||||
// 国际化字段
|
||||
var jsonName = {"zh":name,"ar":ar_name,"en":en_name}
|
||||
const nameValue = JSON.stringify(jsonName);
|
||||
var seq = $("#modal_seq").val();
|
||||
var status = $("#modal_status").val();
|
||||
var type = $("#modal_type").val();
|
||||
var istop = $("#modal_istop").val();
|
||||
var pict = $("#addActPic").val();
|
||||
var description = $("#modal_description").val();
|
||||
var partitionId = $('#modal_partitionId').val();
|
||||
|
||||
if (type != 3 && (pict == null || pict == '')) {
|
||||
$("#tipMsg").text("保存失败,请先上传图片!");
|
||||
@@ -360,13 +418,14 @@ export default {
|
||||
url: "/admin/roomtag/saveRoomTag.action",
|
||||
data: {
|
||||
id: id,
|
||||
name: name,
|
||||
name: nameValue,
|
||||
seq: seq,
|
||||
status: status,
|
||||
type: type,
|
||||
istop: istop,
|
||||
pict: pict,
|
||||
description: description
|
||||
pict: pictValue,
|
||||
description: description,
|
||||
partitionId: partitionId,
|
||||
},
|
||||
dataType: "json",
|
||||
success: function (json) {
|
||||
@@ -400,7 +459,12 @@ export default {
|
||||
success: function (json) {
|
||||
if (json) {
|
||||
$("#id").val(id);
|
||||
$("#modal_name").val(json.name);
|
||||
var jsonName = JSON.parse(json.name);
|
||||
$("#modal_name").val(jsonName.zh);
|
||||
// 阿语名称
|
||||
$("#ar_modal_name").val(jsonName.ar);
|
||||
// 英语名称
|
||||
$("#en_modal_name").val(jsonName.en);
|
||||
$("#modal_seq").val(json.seq);
|
||||
$("#modal_description").val(json.description);
|
||||
if (json.status == true) {
|
||||
@@ -414,8 +478,8 @@ export default {
|
||||
$("#modal_istop").val(0);
|
||||
}
|
||||
$("#modal_type").val(json.type);
|
||||
$('#addActPic').val(json.pict);
|
||||
$('#addImgUrl').attr('src', json.pict);
|
||||
$('#modal_partitionId').val(json.partitionId);
|
||||
// 打开编辑弹窗
|
||||
$("#roomTagModal").modal('show');
|
||||
$("#modalLabel").text("编辑房间标签");
|
||||
@@ -457,7 +521,22 @@ export default {
|
||||
|
||||
|
||||
});
|
||||
}
|
||||
},
|
||||
initPartition() {
|
||||
getPartitionInfoList().then(res => {
|
||||
let data = res.data;
|
||||
buildSelectOption(
|
||||
"#modal_partitionId",
|
||||
null,
|
||||
data.map((v) => {
|
||||
return {
|
||||
value: v.id,
|
||||
text: v.desc,
|
||||
};
|
||||
})
|
||||
);
|
||||
});
|
||||
},
|
||||
},
|
||||
|
||||
};
|
||||
|
@@ -142,6 +142,14 @@
|
||||
<div class="modal-body">
|
||||
<form class="form-horizontal" id="giftForm">
|
||||
<input type="hidden" name="giftId" id="giftId" />
|
||||
<div class="form-group">
|
||||
<label for="partitionFlag" class="col-sm-2 control-label">选择分区</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="checkbox" name="partitionFlag" value="1"/>英语区<br>
|
||||
<input type="checkbox" name="partitionFlag" value="2"/>阿拉伯语区<br>
|
||||
<input type="checkbox" name="partitionFlag" value="4"/>华语区<br>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="consumeType" class="col-sm-2 control-label">消费类型</label>
|
||||
<div class="col-sm-10">
|
||||
@@ -160,6 +168,18 @@
|
||||
<input type="text" class="form-control validate[required]" name="giftName" id="giftName">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="giftArName" class="col-sm-2 control-label">阿语礼物名称</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" class="form-control validate[required]" name="giftName" id="giftArName">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="giftEnName" class="col-sm-2 control-label">英语礼物名称</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" class="form-control validate[required]" name="giftName" id="giftEnName">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="goldPrice" class="col-sm-2 control-label">礼物价格</label>
|
||||
<div class="col-sm-10">
|
||||
@@ -616,7 +636,28 @@ export default {
|
||||
columns: [
|
||||
{ field: 'tmp', title: 'ID', align: 'center', checkbox: true },
|
||||
{ field: 'giftId', title: '礼物ID', align: 'center', width: '5%' },
|
||||
{ field: 'giftName', title: '礼物名称', align: 'center', width: '15%' },
|
||||
{field: 'giftName.zh', title: '礼物名称', align: 'center', width: '15%'},
|
||||
{field: 'giftName.ar', title: '阿语礼物名称', align: 'center', width: '10%'},
|
||||
{field: 'giftName.en', title: '英语礼物名称', align: 'center', width: '10%'},
|
||||
{
|
||||
field: 'partitionFlag',
|
||||
title: '地区',
|
||||
align: 'center',
|
||||
width: '10%',
|
||||
formatter: function (val, row, index) {
|
||||
let value = '';
|
||||
if (val & 1 != 0) {
|
||||
value += '英语区<br>';
|
||||
}
|
||||
if (val & 2 != 0) {
|
||||
value += '阿拉伯语区<br>';
|
||||
}
|
||||
if (val & 4 != 0) {
|
||||
value += '华语区<br>';
|
||||
}
|
||||
return value;
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'giftStatus',
|
||||
title: '礼物状态',
|
||||
@@ -791,8 +832,30 @@ export default {
|
||||
};
|
||||
return param;
|
||||
},
|
||||
ajax:function(request){ //使用ajax请求
|
||||
$.ajax({
|
||||
type:"GET",
|
||||
url:'/admin/gift/getList.action?type=' + ComboboxHelper.getSelected("#condition_type"),
|
||||
contentType:'application/json;charset=utf-8',
|
||||
dataType:'json',
|
||||
data: request.data,
|
||||
success:function (res) {
|
||||
console.log(res);
|
||||
request.success({
|
||||
"rows": res.rows.map(i=>{
|
||||
i.giftName = JSON.parse(i.giftName);
|
||||
return i;
|
||||
}),
|
||||
"total": res.total
|
||||
});
|
||||
},
|
||||
error:function(error){
|
||||
console.log(error);
|
||||
}
|
||||
})
|
||||
},
|
||||
toolbar: '#toolbar',
|
||||
url: '/admin/gift/getList.action',
|
||||
// url: '/admin/gift/getList.action',
|
||||
onLoadSuccess: function () { //加载成功时执行
|
||||
console.log("load success");
|
||||
},
|
||||
@@ -880,6 +943,9 @@ export default {
|
||||
$("#isSendMsg").val('');
|
||||
$("#consumeType").removeAttr("disabled");
|
||||
$('#roomExcludeId').val('');
|
||||
$("input:radio[name='partitionFlag']")[0].checked = false;
|
||||
$("input:radio[name='partitionFlag']")[1].checked = false;
|
||||
$("input:radio[name='partitionFlag']")[2].checked = false;
|
||||
window.selectConsumeChange($("#consumeType"));
|
||||
$('#roomExcludeId').val('');
|
||||
});
|
||||
@@ -1129,6 +1195,9 @@ export default {
|
||||
$("#isSendMsg").val('');
|
||||
$("#consumeType").removeAttr("disabled");
|
||||
$('#roomExcludeId').val('');
|
||||
$("input:radio[name='partitionFlag']")[0].checked = false;
|
||||
$("input:radio[name='partitionFlag']")[1].checked = false;
|
||||
$("input:radio[name='partitionFlag']")[2].checked = false;
|
||||
console.log("btnEdit");
|
||||
var id = $(this).attr("data-id");
|
||||
$this.files = {};
|
||||
@@ -1148,10 +1217,12 @@ export default {
|
||||
if (json.entity) {
|
||||
$("#giftId").val(json.entity.giftId);
|
||||
|
||||
// $("#giftName").attr('readonly', true);
|
||||
// $("#goldPrice").attr('readonly', true);
|
||||
|
||||
$("#giftName").val(json.entity.giftName);
|
||||
var jsonName = JSON.parse(json.entity.giftName);
|
||||
$("#giftName").val(jsonName.zh);
|
||||
// 阿语名称
|
||||
$("#giftArName").val(jsonName.ar);
|
||||
// 英语名称
|
||||
$("#giftEnName").val(jsonName.en);
|
||||
$("#goldPrice").val(json.entity.goldPrice);
|
||||
|
||||
$("#seqNo").val(json.entity.seqNo);
|
||||
@@ -1189,6 +1260,7 @@ export default {
|
||||
var isTimeLimit = parseNum(json.entity.isTimeLimit);
|
||||
var isWholeServer = parseNum(json.entity.isWholeServer);
|
||||
var roomExclude = parseNum(json.entity.roomExclude);
|
||||
var partitionFlag = parseNum(json.entity.partitionFlag);
|
||||
$("#isWholeServer").val(isWholeServer);
|
||||
|
||||
// 礼物状态的值跟其他不同, 1为有效 2为无效
|
||||
@@ -1250,6 +1322,22 @@ export default {
|
||||
$("#viewFileInfo").html('未上传');
|
||||
}
|
||||
|
||||
//分区
|
||||
if (partitionFlag & 1 != 0) {
|
||||
$("input:radio[name='partitionFlag']")[0].checked = true;
|
||||
} else {
|
||||
$("input:radio[name='partitionFlag']")[0].checked = false;
|
||||
}
|
||||
if (partitionFlag & 2 != 0) {
|
||||
$("input:radio[name='partitionFlag']")[1].checked = true;
|
||||
} else {
|
||||
$("input:radio[name='partitionFlag']")[1].checked = false;
|
||||
}
|
||||
if (partitionFlag & 4 != 0) {
|
||||
$("input:radio[name='partitionFlag']")[2].checked = true;
|
||||
} else {
|
||||
$("input:radio[name='partitionFlag']")[2].checked = false;
|
||||
}
|
||||
// 打开编辑弹窗
|
||||
$("#giftModal").modal('show');
|
||||
} else {
|
||||
@@ -1261,12 +1349,38 @@ export default {
|
||||
});
|
||||
|
||||
$("#save").click(function () {
|
||||
// 获取序列化字符串并转换为对象
|
||||
let formData = $('#giftForm').serializeArray().reduce(function(obj, item) {
|
||||
obj[item.name] = item.value;
|
||||
return obj;
|
||||
}, {});
|
||||
|
||||
var name = $("#giftName").val();
|
||||
// 阿语名称
|
||||
var ar_name = $("#giftArName").val();
|
||||
// 英语名称
|
||||
var en_name = $("#giftEnName").val();
|
||||
// 国际化字段
|
||||
var jsonName = {"zh":name,"ar":ar_name,"en":en_name}
|
||||
const nameValue = JSON.stringify(jsonName);
|
||||
// 修改属性值
|
||||
formData.giftName = nameValue; // 将giftName修改为"newGiftName"
|
||||
//分区
|
||||
const partitionFlagArray = $("input:checkbox[name='partitionFlag']:checked").serializeArray();
|
||||
let partitionFlag = 0;
|
||||
for (let i = 0, len = partitionFlagArray.length; i < len; i++) {
|
||||
console.log(partitionFlagArray[i]);
|
||||
partitionFlag |= partitionFlagArray[i].value;
|
||||
}
|
||||
formData.partitionFlag = partitionFlag;
|
||||
// 将修改后的对象转换回序列化字符串
|
||||
let newSerializeStr = $.param(formData);
|
||||
if ($("#giftForm").validationEngine('validate')) {
|
||||
$("#consumeType").removeAttr("disabled");
|
||||
$.ajax({
|
||||
type: "post",
|
||||
url: "/admin/gift/save.action",
|
||||
data: $('#giftForm').serialize(),
|
||||
data: newSerializeStr,
|
||||
dataType: "json",
|
||||
success: function (json) {
|
||||
if (json.success == 'true') {
|
||||
|
@@ -85,6 +85,18 @@
|
||||
id="modal_name" placeholder="请输入内容,限定7个字符内">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="modal_name" class="col-sm-3 control-label">阿语标题:</label>
|
||||
<div class="col-sm-8">
|
||||
<input type="text" class="form-control validate[required,maxSize[7]]" name="name" id="ar_modal_name" placeholder="请输入内容,限定7个字符内">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="modal_name" class="col-sm-3 control-label">印语标题:</label>
|
||||
<div class="col-sm-8">
|
||||
<input type="text" class="form-control validate[required,maxSize[7]]" name="name" id="in_modal_name" placeholder="请输入内容,限定7个字符内">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="modal_description" class="col-sm-3 control-label">描述:</label>
|
||||
<div class="col-sm-8">
|
||||
@@ -93,6 +105,20 @@
|
||||
placeholder="不填写则使用默认描述[最優話題,最熱時事,盡在話題!快與兔友們分享身邊有趣的靈魂吧~],限定100个字符内"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="ar_modal_description" class="col-sm-3 control-label">阿语描述:</label>
|
||||
<div class="col-sm-8">
|
||||
<textarea rows="3" cols="20" class="form-control validate[maxSize[100]]" name="description" id="ar_modal_description"
|
||||
placeholder="不填写则使用默认描述[最優話題,最熱時事,盡在話題!快與兔友們分享身邊有趣的靈魂吧~],限定100个字符内"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="en_modal_description" class="col-sm-3 control-label">印语描述:</label>
|
||||
<div class="col-sm-8">
|
||||
<textarea rows="3" cols="20" class="form-control validate[maxSize[100]]" name="description" id="en_modal_description"
|
||||
placeholder="不填写则使用默认描述[最優話題,最熱時事,盡在話題!快與兔友們分享身邊有趣的靈魂吧~],限定100个字符内"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="modal_notice" class="col-sm-3 control-label">公告:</label>
|
||||
<div class="col-sm-8">
|
||||
@@ -100,6 +126,20 @@
|
||||
id="modal_notice" placeholder="非必填,限定500个字符内"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="ar_modal_notice" class="col-sm-3 control-label">阿语公告:</label>
|
||||
<div class="col-sm-8">
|
||||
<textarea rows="3" cols="20" class="form-control validate[maxSize[500]]" name="notice" id="ar_modal_notice"
|
||||
placeholder="非必填,限定500个字符内"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="en_modal_notice" class="col-sm-3 control-label">英语公告:</label>
|
||||
<div class="col-sm-8">
|
||||
<textarea rows="3" cols="20" class="form-control validate[maxSize[500]]" name="notice" id="en_modal_notice"
|
||||
placeholder="非必填,限定500个字符内"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="modal_worldTypeId" class="col-sm-3 control-label">话题分类:</label>
|
||||
<div class="col-sm-8">
|
||||
@@ -201,7 +241,9 @@ export default {
|
||||
$('#table').bootstrapTable({
|
||||
columns: [
|
||||
{ field: 'id', title: 'ID', align: 'center', valign: 'middle', width: '10%' },
|
||||
{ field: 'name', title: '名称', align: 'left', valign: 'middle', width: '10%' },
|
||||
{field: 'name.zh', title: '名称', align: 'left', valign: 'middle', width: '10%'},
|
||||
{field: 'name.ar', title: '阿语名称', align: 'left', valign: 'middle', width: '10%'},
|
||||
{field: 'name.en', title: '英语名称', align: 'left', valign: 'middle', width: '10%'},
|
||||
{
|
||||
field: 'icon', title: '头像', align: 'left', valign: 'middle', width: '10%',
|
||||
formatter: function (val, row, index) {
|
||||
@@ -211,16 +253,27 @@ export default {
|
||||
return '-';
|
||||
}
|
||||
},
|
||||
{ field: 'description', title: '描述', align: 'left', valign: 'middle', width: '10%' },
|
||||
{
|
||||
field: 'notice', title: '公告', align: 'left', valign: 'middle', width: '10%', formatter: function (val, row, index) {
|
||||
var len = val.length;
|
||||
if (len > 50) {
|
||||
{field: 'description.zh', title: '描述', align: 'left', valign: 'middle', width: '10%'},
|
||||
{field: 'description.ar', title: '阿语描述', align: 'left', valign: 'middle', width: '10%'},
|
||||
{field: 'description.en', title: '英语描述', align: 'left', valign: 'middle', width: '10%'},
|
||||
{field: 'notice.zh', title: '公告', align: 'left', valign: 'middle', width: '10%', formatter: function(val, row, index) {
|
||||
if(val && val.length > 50) {
|
||||
return val.substring(0, 50) + '...<a class="pop" data-toggle="popover" data-container="body" data-placement="top" title="公告" data-content="'+val+'">更多>></a>';
|
||||
}
|
||||
return val;
|
||||
}},
|
||||
{field: 'notice.ar', title: '阿语公告', align: 'left', valign: 'middle', width: '10%', formatter: function(val, row, index) {
|
||||
if(val && val.length > 50) {
|
||||
return val.substring(0, 50) + '...<a class="pop" data-toggle="popover" data-container="body" data-placement="top" title="阿语公告" data-content="'+val+'">更多>></a>';
|
||||
}
|
||||
},
|
||||
return val;
|
||||
}},
|
||||
{field: 'notice.en', title: '英语公告', align: 'left', valign: 'middle', width: '10%', formatter: function(val, row, index) {
|
||||
if(val && val.length > 50) {
|
||||
return val.substring(0, 50) + '...<a class="pop" data-toggle="popover" data-container="body" data-placement="top" title="印语公告" data-content="'+val+'">更多>></a>';
|
||||
}
|
||||
return val;
|
||||
}},
|
||||
{ field: 'ownerErbanNo', title: '创始人', align: 'left', valign: 'middle', width: '10%' },
|
||||
{ field: 'memberNum', title: '人数', align: 'left', valign: 'middle', width: '10%' },
|
||||
{
|
||||
@@ -344,8 +397,32 @@ export default {
|
||||
return param;
|
||||
},
|
||||
uniqueId: 'id',
|
||||
toolbar: '#toolbar',
|
||||
ajax:function(request){ //使用ajax请求
|
||||
$.ajax({
|
||||
type:"GET",
|
||||
url:'/admin/world/list.action',
|
||||
contentType:'application/json;charset=utf-8',
|
||||
dataType:'json',
|
||||
data: request.data,
|
||||
success:function (res) {
|
||||
console.log(res);
|
||||
request.success({
|
||||
"rows": res.rows.map(i=>{
|
||||
i.name = JSON.parse(i.name);
|
||||
i.description = JSON.parse(i.description);
|
||||
i.notice = JSON.parse(i.notice);
|
||||
return i;
|
||||
}),
|
||||
"total": res.total
|
||||
});
|
||||
},
|
||||
error:function(error){
|
||||
console.log(error);
|
||||
}
|
||||
})
|
||||
},
|
||||
toolbar: '#toolbar',
|
||||
// url: '/admin/world/list.action',
|
||||
onLoadSuccess: function () {
|
||||
$('[data-toggle="tooltip"]').tooltip();
|
||||
$('[data-toggle="popover"]').popover();
|
||||
@@ -418,9 +495,26 @@ export default {
|
||||
$('#modal_endTime').val(new Date(data.endTime).format('yyyy-MM-dd hh:mm:ss'));
|
||||
}
|
||||
}
|
||||
$('#modal_name').val(data.name);
|
||||
$('#modal_description').val(data.description);
|
||||
var jsonName = JSON.parse(data.name);
|
||||
$("#modal_name").val(jsonName.zh);
|
||||
// 阿语名称
|
||||
$("#ar_modal_name").val(jsonName.ar);
|
||||
// 印语名称
|
||||
$("#in_modal_name").val(jsonName.in);
|
||||
var jsonDescription = JSON.parse(data.description);
|
||||
$("#modal_description").val(jsonDescription.zh);
|
||||
// 阿语描述
|
||||
$("#ar_modal_description").val(jsonDescription.ar);
|
||||
// 英语描述
|
||||
$("#en_modal_description").val(jsonDescription.en);
|
||||
$('#modal_notice').val(data.notice);
|
||||
var jsonNotice = JSON.parse(data.notice);
|
||||
console.log(jsonNotice)
|
||||
$("#modal_notice").val(jsonNotice.zh);
|
||||
// 阿语名称
|
||||
$("#ar_modal_notice").val(jsonNotice.ar);
|
||||
// 印语名称
|
||||
$("#en_modal_notice").val(jsonNotice.en);
|
||||
//分类
|
||||
$.ajax({
|
||||
type: 'get',
|
||||
@@ -573,9 +667,36 @@ export default {
|
||||
}
|
||||
param.recommend = recommend;
|
||||
param.id = $('#modal_id').val();
|
||||
param.name = $('#modal_name').val();
|
||||
param.description = $('#modal_description').val();
|
||||
param.notice = $('#modal_notice').val();
|
||||
|
||||
var name = $("#modal_name").val();
|
||||
// 阿语名称
|
||||
var ar_name = $("#ar_modal_name").val();
|
||||
// 英语名称
|
||||
var en_name = $("#en_modal_name").val();
|
||||
// 国际化字段
|
||||
var jsonName = {"zh":name,"ar":ar_name,"en":en_name}
|
||||
const nameValue = JSON.stringify(jsonName);
|
||||
param.name=nameValue;
|
||||
|
||||
var description = $("#modal_description").val();
|
||||
// 阿语描述
|
||||
var ar_description = $("#ar_modal_description").val();
|
||||
// 英语描述
|
||||
var en_description = $("#en_modal_description").val();
|
||||
// 国际化描述
|
||||
var jsonDescription = {"zh":description,"ar":ar_description,"en":en_description}
|
||||
const descriptionValue = JSON.stringify(jsonDescription);
|
||||
param.description=descriptionValue;
|
||||
|
||||
var notice = $("#modal_notice").val();
|
||||
// 阿语描述
|
||||
var ar_notice = $("#ar_modal_notice").val();
|
||||
// 英语描述
|
||||
var en_notice = $("#en_modal_notice").val();
|
||||
// 国际化描述
|
||||
var jsonNotice = {"zh":notice,"ar":ar_notice,"en":en_notice}
|
||||
const noticeValue = JSON.stringify(jsonNotice);
|
||||
param.notice=noticeValue;
|
||||
param.worldTypeId = $('#modal_worldTypeId').val();
|
||||
param.ownerErbanNo = $('#modal_ownerErbanNo').val();
|
||||
//标签
|
||||
|
@@ -309,6 +309,7 @@ export default {
|
||||
}
|
||||
}
|
||||
},
|
||||
{field: 'partitionDesc', title: '分区', align: 'center', width: '5%'},
|
||||
/*{field: 'share', title: '分享人数/次数', align: 'center', width: '5%'},
|
||||
{field: 'commment', title: '评论人数/次数', align: 'center', width: '5%'},
|
||||
{field: 'like', title: '点赞人数/次数', align: 'center', width: '5%'},
|
||||
|
Reference in New Issue
Block a user