用户信息编辑新增国家字段
This commit is contained in:
@@ -40,6 +40,7 @@
|
||||
<div class="part form-group">
|
||||
<div class="nick">昵称: <span></span></div>
|
||||
<div class="partitionId">地区: <span></span></div>
|
||||
<div class="regionName">国家: <span></span></div>
|
||||
<div class="erbanNo">平台号: <span></span></div>
|
||||
<div class="uid">UID: <span></span></div>
|
||||
<!-- <div class="avatar">头像:<img src="" alt="" width="70px" height="70px"></div>-->
|
||||
@@ -118,6 +119,12 @@
|
||||
<select name="partitionId" id="partitionId" class="form-control validate[required]"></select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="regionId" class="col-sm-3 control-label">选择国家:</label>
|
||||
<div class="col-sm-7">
|
||||
<select name="regionId" id="regionId" class="form-control validate[required]"></select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="editNick" class="col-sm-3 control-label">昵称:</label>
|
||||
<div class="col-sm-7">
|
||||
@@ -316,6 +323,30 @@ export default {
|
||||
this.$nextTick(function () {
|
||||
this.initPartition();
|
||||
this.initData();
|
||||
$("#partitionId").on("change", function() {
|
||||
var selectedValue = $(this).val();
|
||||
$.ajax({
|
||||
type: "get",
|
||||
url: "/admin/regionInfo/listByPartitionId",
|
||||
data: { partitionId: selectedValue,containAll:false },
|
||||
dataType: "json",
|
||||
success: function (res) {
|
||||
var regionId = $("#regionId");
|
||||
regionId.empty();
|
||||
if(res.code == 200){
|
||||
for (var i = 0; i < res.data.length; i++) {
|
||||
|
||||
var option = $("<option>", {
|
||||
text: JSON.parse(res.data[i].name).zh,
|
||||
value:res.data[i].id
|
||||
});
|
||||
regionId.append(option);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
});
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
@@ -383,6 +414,7 @@ export default {
|
||||
return value;
|
||||
}
|
||||
},
|
||||
{ field: 'regionName', title: '国家', align: 'center', valign: 'middle' },
|
||||
{
|
||||
field: '', title: '是否实名认证', align: 'center', valign: 'middle',
|
||||
formatter: function (val, row, index) {
|
||||
@@ -548,6 +580,8 @@ export default {
|
||||
$('.nick span').html(users.nick);
|
||||
$('.erbanNo span').html(users.erbanNo);
|
||||
$('.uid span').html(users.uid);
|
||||
$('.regionName span').html(res.data.regionName);
|
||||
|
||||
if (users.gender == 1) {
|
||||
$('.gender span').html('男');
|
||||
} else {
|
||||
@@ -711,6 +745,29 @@ export default {
|
||||
'<td><button class="btn btn-danger" type="button" onclick="delPhoto(this)">删除</button></td></tr>');
|
||||
$photos.append($photo);
|
||||
});
|
||||
// 获取选择地区
|
||||
$.ajax({
|
||||
type: "get",
|
||||
url: "/admin/regionInfo/listByPartitionId",
|
||||
data: { partitionId: partitionId,containAll:false },
|
||||
dataType: "json",
|
||||
success: function (res) {
|
||||
var regionId = $("#regionId");
|
||||
regionId.empty();
|
||||
if(res.code == 200){
|
||||
for (var i = 0; i < res.data.length; i++) {
|
||||
|
||||
var option = $("<option>", {
|
||||
text: JSON.parse(res.data[i].name).zh,
|
||||
value:res.data[i].id
|
||||
});
|
||||
regionId.append(option);
|
||||
|
||||
}
|
||||
$("#regionId").val(users.regionId);
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
$('#editModal').modal('show');
|
||||
}
|
||||
@@ -868,6 +925,7 @@ export default {
|
||||
msg: $("#msg").val(),
|
||||
sendMsg: sendMsg,
|
||||
partitionId: $('#partitionId').val(),
|
||||
regionId:$('#regionId').val()
|
||||
},
|
||||
dataType: 'json',
|
||||
success: function (res) {
|
||||
|
Reference in New Issue
Block a user