mirror of
https://gitee.com/java110/MicroCommunityWeb.git
synced 2026-02-24 21:59:12 +08:00
优化代码
This commit is contained in:
parent
f52e3b9f55
commit
ba2ed69094
@ -1,53 +1,73 @@
|
||||
<div id="addIntegralSettingModel" class="modal fade" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
|
||||
<div id="addIntegralSettingModel" class="modal fade" role="dialog" aria-labelledby="exampleModalLabel"
|
||||
aria-hidden="true">
|
||||
<div class="modal-dialog modal-lg">
|
||||
<div class="modal-content">
|
||||
<div class="modal-body">
|
||||
<h3 class="m-t-none m-b "><span><vc:i18n name="积分设置" namespace="addIntegralSetting"></vc:i18n></span></h3>
|
||||
<h3 class="m-t-none m-b ">
|
||||
<vc:i18n name="积分设置" namespace="addIntegralSetting"></vc:i18n>
|
||||
</h3>
|
||||
<div class="ibox-content">
|
||||
<div>
|
||||
<div>
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-2 col-form-label"><span><vc:i18n name='积分金额' namespace='addIntegralSetting'></vc:i18n></span></label>
|
||||
<label class="col-sm-2 col-form-label"><span><vc:i18n name='一个积分等于' namespace='addIntegralSetting'></vc:i18n></span></label>
|
||||
<div class="col-sm-6">
|
||||
<input v-model="addIntegralSettingInfo.money" type="text" :placeholder="vc.i18n('必填,请填写积分金额','addIntegralSetting')" class="form-control">
|
||||
</div>
|
||||
<label class="col-sm-2 col-form-label"><span><vc:i18n name='元' namespace='addIntegralSetting'></vc:i18n></span></label>
|
||||
</div>
|
||||
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-2 col-form-label"><span><vc:i18n name='通知三方平台' namespace='addIntegralSetting'></vc:i18n></span></label>
|
||||
<div class="col-sm-10">
|
||||
<select class="custom-select" v-model="addIntegralSettingInfo.thirdFlag">
|
||||
<option selected disabled value="">{{vc.i18n('必填,请选择通知三方平台','addIntegralSetting')}}</option>
|
||||
<option value="Y">{{vc.i18n('是','addIntegralSetting')}}</option>
|
||||
<option value="N">{{vc.i18n('否','addIntegralSetting')}}</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row" v-if="addIntegralSettingInfo.thirdFlag == 'Y'">
|
||||
<label class="col-sm-2 col-form-label"><span><vc:i18n name='平台地址' namespace='addIntegralSetting'></vc:i18n></span></label>
|
||||
<div class="col-sm-10">
|
||||
<input v-model="addIntegralSettingInfo.thirdUrl" type="text" :placeholder="vc.i18n('必填,请填写平台地址','addIntegralSetting')" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-2 col-form-label"><span><vc:i18n name='使用说明' namespace='addIntegralSetting'></vc:i18n></span></label>
|
||||
<div class="col-sm-10">
|
||||
<textarea v-model="addIntegralSettingInfo.remark" :placeholder="vc.i18n('必填,请填写使用说明','addIntegralSetting')" class="form-control"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="ibox-content">
|
||||
<button class="btn btn-primary float-right" type="button" v-on:click="saveIntegralSettingInfo()"><i class="fa fa-check"></i>
|
||||
<span><vc:i18n name="保存"></vc:i18n></span>
|
||||
</button>
|
||||
<button type="button" class="btn btn-warning float-right" style="margin-right:20px;" data-dismiss="modal">
|
||||
<span><vc:i18n name="取消"></vc:i18n></span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-2 col-form-label">
|
||||
<vc:i18n name='积分金额' namespace='addIntegralSetting'></vc:i18n>
|
||||
</label>
|
||||
<label class="col-sm-2 col-form-label">
|
||||
<vc:i18n name='一个积分等于' namespace='addIntegralSetting'></vc:i18n>
|
||||
</label>
|
||||
<div class="col-sm-6">
|
||||
<input v-model="addIntegralSettingInfo.money" type="text"
|
||||
:placeholder="vc.i18n('必填,请填写积分金额','addIntegralSetting')" class="form-control">
|
||||
</div>
|
||||
<label class="col-sm-2 col-form-label">
|
||||
<vc:i18n name='元' namespace='addIntegralSetting'></vc:i18n>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-2 col-form-label">
|
||||
<vc:i18n name='通知三方平台' namespace='addIntegralSetting'></vc:i18n>
|
||||
</label>
|
||||
<div class="col-sm-10">
|
||||
<select class="custom-select" v-model="addIntegralSettingInfo.thirdFlag">
|
||||
<option selected disabled value="">{{vc.i18n('必填,请选择通知三方平台','addIntegralSetting')}}
|
||||
</option>
|
||||
<option value="Y">{{vc.i18n('是','addIntegralSetting')}}</option>
|
||||
<option value="N">{{vc.i18n('否','addIntegralSetting')}}</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row" v-if="addIntegralSettingInfo.thirdFlag == 'Y'">
|
||||
<label class="col-sm-2 col-form-label">
|
||||
<vc:i18n name='平台地址' namespace='addIntegralSetting'></vc:i18n>
|
||||
</label>
|
||||
<div class="col-sm-10">
|
||||
<input v-model="addIntegralSettingInfo.thirdUrl" type="text"
|
||||
:placeholder="vc.i18n('必填,请填写平台地址','addIntegralSetting')" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-2 col-form-label">
|
||||
<vc:i18n name='使用说明' namespace='addIntegralSetting'></vc:i18n>
|
||||
</label>
|
||||
<div class="col-sm-10">
|
||||
<textarea v-model="addIntegralSettingInfo.remark"
|
||||
:placeholder="vc.i18n('必填,请填写使用说明','addIntegralSetting')"
|
||||
class="form-control"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="ibox-content">
|
||||
<button class="btn btn-primary float-right" type="button"
|
||||
v-on:click="saveIntegralSettingInfo()">
|
||||
<vc:i18n name="保存"></vc:i18n>
|
||||
</button>
|
||||
<button type="button" class="btn btn-warning float-right" style="margin-right:20px;"
|
||||
data-dismiss="modal">
|
||||
<vc:i18n name="取消"></vc:i18n>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -26,7 +26,7 @@
|
||||
methods: {
|
||||
addIntegralSettingValidate() {
|
||||
return vc.validate.validate({
|
||||
addIntegralSettingInfo: vc.component.addIntegralSettingInfo
|
||||
addIntegralSettingInfo: $that.addIntegralSettingInfo
|
||||
}, {
|
||||
'addIntegralSettingInfo.money': [{
|
||||
limit: "required",
|
||||
@ -69,17 +69,17 @@
|
||||
});
|
||||
},
|
||||
saveIntegralSettingInfo: function() {
|
||||
if (!vc.component.addIntegralSettingValidate()) {
|
||||
if (!$that.addIntegralSettingValidate()) {
|
||||
vc.toast(vc.validate.errInfo);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
vc.component.addIntegralSettingInfo.communityId = vc.getCurrentCommunity().communityId;
|
||||
$that.addIntegralSettingInfo.communityId = vc.getCurrentCommunity().communityId;
|
||||
|
||||
vc.http.apiPost(
|
||||
'/integral.saveIntegralSetting',
|
||||
JSON.stringify(vc.component.addIntegralSettingInfo), {
|
||||
JSON.stringify($that.addIntegralSettingInfo), {
|
||||
emulateJSON: true
|
||||
},
|
||||
function(json, res) {
|
||||
@ -88,7 +88,7 @@
|
||||
if (_json.code == 0) {
|
||||
//关闭model
|
||||
$('#addIntegralSettingModel').modal('hide');
|
||||
vc.component.clearAddIntegralSettingInfo();
|
||||
$that.clearAddIntegralSettingInfo();
|
||||
vc.emit('integralSettingManage', 'listIntegralSetting', {});
|
||||
|
||||
return;
|
||||
@ -104,7 +104,7 @@
|
||||
});
|
||||
},
|
||||
clearAddIntegralSettingInfo: function() {
|
||||
vc.component.addIntegralSettingInfo = {
|
||||
$that.addIntegralSettingInfo = {
|
||||
money: '',
|
||||
remark: '',
|
||||
thirdFlag: 'N',
|
||||
|
||||
@ -1,50 +1,71 @@
|
||||
<div id="editIntegralSettingModel" class="modal fade" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
|
||||
<div id="editIntegralSettingModel" class="modal fade" role="dialog" aria-labelledby="exampleModalLabel"
|
||||
aria-hidden="true">
|
||||
<div class="modal-dialog modal-lg">
|
||||
<div class="modal-content">
|
||||
<div class="modal-body">
|
||||
<h3 class="m-t-none m-b "><span><vc:i18n name="积分设置" namespace="editIntegralSetting"></vc:i18n></span></h3>
|
||||
<h3 class="m-t-none m-b ">
|
||||
<vc:i18n name="积分设置" namespace="editIntegralSetting"></vc:i18n>
|
||||
</h3>
|
||||
<div class="ibox-content">
|
||||
<div>
|
||||
<div>
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-2 col-form-label"><span><vc:i18n name='积分金额' namespace='editIntegralSetting'></vc:i18n></span></label>
|
||||
<label class="col-sm-2 col-form-label"><span><vc:i18n name='一个积分等于' namespace='editIntegralSetting'></vc:i18n></span></label>
|
||||
<div class="col-sm-6">
|
||||
<input v-model="editIntegralSettingInfo.money" type="text" :placeholder="vc.i18n('必填,请填写积分金额','editIntegralSetting')" class="form-control">
|
||||
</div>
|
||||
<label class="col-sm-2 col-form-label"><span><vc:i18n name='元' namespace='editIntegralSetting'></vc:i18n></span></label>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-2 col-form-label">
|
||||
<vc:i18n name='积分金额' namespace='editIntegralSetting'></vc:i18n>
|
||||
</label>
|
||||
<label class="col-sm-2 col-form-label">
|
||||
<vc:i18n name='一个积分等于' namespace='editIntegralSetting'></vc:i18n>
|
||||
</label>
|
||||
<div class="col-sm-6">
|
||||
<input v-model="editIntegralSettingInfo.money" type="text"
|
||||
:placeholder="vc.i18n('必填,请填写积分金额','editIntegralSetting')" class="form-control">
|
||||
</div>
|
||||
<label class="col-sm-2 col-form-label">
|
||||
<vc:i18n name='元' namespace='editIntegralSetting'></vc:i18n>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-2 col-form-label"><span><vc:i18n name='通知三方平台' namespace='editIntegralSetting'></vc:i18n></span> </label>
|
||||
<div class="col-sm-10">
|
||||
<select class="custom-select" v-model="editIntegralSettingInfo.thirdFlag">
|
||||
<option selected disabled value="">{{vc.i18n('必填,请选择通知三方平台' ,'editIntegralSetting')}}</option>
|
||||
<option value="Y">{{vc.i18n('是' ,'editIntegralSetting')}} </option>
|
||||
<option value="N">{{vc.i18n('否' ,'editIntegralSetting')}} </option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row" v-if="editIntegralSettingInfo.thirdFlag == 'Y'">
|
||||
<label class="col-sm-2 col-form-label"><span><vc:i18n name='平台地址' namespace='editIntegralSetting'></vc:i18n></span> </label>
|
||||
<div class="col-sm-10">
|
||||
<input v-model="editIntegralSettingInfo.thirdUrl" type="text" :placeholder="vc.i18n('必填,请填写平台地址','editIntegralSetting')" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-2 col-form-label"> <span><vc:i18n name='使用说明' namespace='editIntegralSetting'></vc:i18n></span> </label>
|
||||
<div class="col-sm-10">
|
||||
<textarea v-model="editIntegralSettingInfo.remark" :placeholder="vc.i18n('必填,请填写使用说明','editIntegralSetting')" class="form-control"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="ibox-content">
|
||||
<button class="btn btn-primary float-right" type="button" v-on:click="editIntegralSetting()"><i class="fa fa-check"></i> <span><vc:i18n name="保存"></vc:i18n></span></button>
|
||||
<button type="button" class="btn btn-warning float-right" style="margin-right:20px;" data-dismiss="modal"><span><vc:i18n name="取消"></vc:i18n></span></button>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-2 col-form-label">
|
||||
<vc:i18n name='通知三方平台' namespace='editIntegralSetting'></vc:i18n>
|
||||
</label>
|
||||
<div class="col-sm-10">
|
||||
<select class="custom-select" v-model="editIntegralSettingInfo.thirdFlag">
|
||||
<option selected disabled value="">{{vc.i18n('必填,请选择通知三方平台' ,'editIntegralSetting')}}
|
||||
</option>
|
||||
<option value="Y">{{vc.i18n('是' ,'editIntegralSetting')}} </option>
|
||||
<option value="N">{{vc.i18n('否' ,'editIntegralSetting')}} </option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row" v-if="editIntegralSettingInfo.thirdFlag == 'Y'">
|
||||
<label class="col-sm-2 col-form-label">
|
||||
<vc:i18n name='平台地址' namespace='editIntegralSetting'></vc:i18n>
|
||||
</label>
|
||||
<div class="col-sm-10">
|
||||
<input v-model="editIntegralSettingInfo.thirdUrl" type="text"
|
||||
:placeholder="vc.i18n('必填,请填写平台地址','editIntegralSetting')" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-2 col-form-label">
|
||||
<vc:i18n name='使用说明' namespace='editIntegralSetting'></vc:i18n>
|
||||
</label>
|
||||
<div class="col-sm-10">
|
||||
<textarea v-model="editIntegralSettingInfo.remark"
|
||||
:placeholder="vc.i18n('必填,请填写使用说明','editIntegralSetting')"
|
||||
class="form-control"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="ibox-content">
|
||||
<button class="btn btn-primary float-right" type="button" v-on:click="editIntegralSetting()">
|
||||
<vc:i18n name="保存"></vc:i18n>
|
||||
</button>
|
||||
<button type="button" class="btn btn-warning float-right" style="margin-right:20px;"
|
||||
data-dismiss="modal">
|
||||
<vc:i18n name="取消"></vc:i18n>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -16,16 +16,16 @@
|
||||
},
|
||||
_initEvent: function() {
|
||||
vc.on('editIntegralSetting', 'openEditIntegralSettingModal', function(_params) {
|
||||
vc.component.refreshEditIntegralSettingInfo();
|
||||
$that.refreshEditIntegralSettingInfo();
|
||||
$('#editIntegralSettingModel').modal('show');
|
||||
vc.copyObject(_params, vc.component.editIntegralSettingInfo);
|
||||
vc.component.editIntegralSettingInfo.communityId = vc.getCurrentCommunity().communityId;
|
||||
vc.copyObject(_params, $that.editIntegralSettingInfo);
|
||||
$that.editIntegralSettingInfo.communityId = vc.getCurrentCommunity().communityId;
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
editIntegralSettingValidate: function() {
|
||||
return vc.validate.validate({
|
||||
editIntegralSettingInfo: vc.component.editIntegralSettingInfo
|
||||
editIntegralSettingInfo: $that.editIntegralSettingInfo
|
||||
}, {
|
||||
'editIntegralSettingInfo.money': [{
|
||||
limit: "required",
|
||||
@ -74,14 +74,14 @@
|
||||
});
|
||||
},
|
||||
editIntegralSetting: function() {
|
||||
if (!vc.component.editIntegralSettingValidate()) {
|
||||
if (!$that.editIntegralSettingValidate()) {
|
||||
vc.toast(vc.validate.errInfo);
|
||||
return;
|
||||
}
|
||||
|
||||
vc.http.apiPost(
|
||||
'/integral.updateIntegralSetting',
|
||||
JSON.stringify(vc.component.editIntegralSettingInfo), {
|
||||
JSON.stringify($that.editIntegralSettingInfo), {
|
||||
emulateJSON: true
|
||||
},
|
||||
function(json, res) {
|
||||
@ -93,16 +93,16 @@
|
||||
vc.emit('integralSettingManage', 'listIntegralSetting', {});
|
||||
return;
|
||||
}
|
||||
vc.message(_json.msg);
|
||||
vc.toast(_json.msg);
|
||||
},
|
||||
function(errInfo, error) {
|
||||
console.log('请求失败处理');
|
||||
|
||||
vc.message(errInfo);
|
||||
vc.toast(errInfo);
|
||||
});
|
||||
},
|
||||
refreshEditIntegralSettingInfo: function() {
|
||||
vc.component.editIntegralSettingInfo = {
|
||||
$that.editIntegralSettingInfo = {
|
||||
settingId: '',
|
||||
money: '',
|
||||
remark: '',
|
||||
@ -114,4 +114,4 @@
|
||||
}
|
||||
});
|
||||
|
||||
})(window.vc, window.vc.component);
|
||||
})(window.vc, window.$that);
|
||||
Loading…
Reference in New Issue
Block a user