mirror of
https://gitee.com/java110/MicroCommunityWeb.git
synced 2026-06-12 10:00:56 +08:00
优化 小程序和公众号
This commit is contained in:
parent
90fc1622b5
commit
20784fe9f6
@ -0,0 +1,29 @@
|
||||
<div id="editWechatAttrModel" class="modal fade" tabindex="-1" 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 ">修改</h3>
|
||||
<div class="ibox-content">
|
||||
<div>
|
||||
<div>
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-2 col-form-label">{{editWechatAttrInfo.specCdName}}</label>
|
||||
<div class="col-sm-10"><input v-model="editWechatAttrInfo.value" type="text"
|
||||
placeholder="必填,请填写" class="form-control"></div>
|
||||
</div>
|
||||
<div class="ibox-content">
|
||||
<button class="btn btn-primary float-right" type="button"
|
||||
v-on:click="editWechatAttrMethod()"><i class="fa fa-check"></i> 修改
|
||||
</button>
|
||||
<button type="button" class="btn btn-warning float-right" style="margin-right:20px;"
|
||||
data-dismiss="modal">取消
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
95
public/components/property/editWechatAttr/editWechatAttr.js
Normal file
95
public/components/property/editWechatAttr/editWechatAttr.js
Normal file
@ -0,0 +1,95 @@
|
||||
(function (vc) {
|
||||
|
||||
vc.extends({
|
||||
data: {
|
||||
editWechatAttrInfo: {
|
||||
attrId: '',
|
||||
wechatId: '',
|
||||
specCdName: '',
|
||||
specCd: '',
|
||||
value: ''
|
||||
}
|
||||
},
|
||||
_initMethod: function () {
|
||||
|
||||
},
|
||||
_initEvent: function () {
|
||||
vc.on('editWechatAttr', 'openEditWechatAttrModal', function (_wechatAttr) {
|
||||
vc.copyObject(_wechatAttr, vc.component.editWechatAttrInfo);
|
||||
$('#editWechatAttrModel').modal('show');
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
editWechatAttrValidate() {
|
||||
return vc.validate.validate({
|
||||
editWechatAttrInfo: vc.component.editWechatAttrInfo
|
||||
}, {
|
||||
'editWechatAttrInfo.attrId': [
|
||||
{
|
||||
limit: "required",
|
||||
param: "",
|
||||
errInfo: "填写错误"
|
||||
}
|
||||
],
|
||||
'editWechatAttrInfo.value': [
|
||||
{
|
||||
limit: "required",
|
||||
param: "",
|
||||
errInfo: "请填写值"
|
||||
},
|
||||
{
|
||||
limit: "maxLength",
|
||||
param: "500",
|
||||
errInfo: "长度不能超过200位"
|
||||
}
|
||||
]
|
||||
|
||||
});
|
||||
},
|
||||
editWechatAttrMethod: function () {
|
||||
|
||||
if (!vc.component.editWechatAttrValidate()) {
|
||||
vc.toast(vc.validate.errInfo);
|
||||
return;
|
||||
}
|
||||
vc.component.editWechatAttrInfo.communityId = vc.getCurrentCommunity().communityId;
|
||||
vc.http.apiPost(
|
||||
'smallWechat.updateSmallWechatAttr',
|
||||
JSON.stringify(vc.component.editWechatAttrInfo),
|
||||
{
|
||||
emulateJSON: true
|
||||
},
|
||||
function (json, res) {
|
||||
let _json = JSON.parse(json);
|
||||
if (_json.code == 0) {
|
||||
//关闭model
|
||||
$('#editWechatAttrModel').modal('hide');
|
||||
vc.emit('wechatAttrInfo', 'getWechatAttrInfo',
|
||||
vc.component.editWechatAttrInfo);
|
||||
vc.component.clearEditWechatAttrInfo();
|
||||
return;
|
||||
}
|
||||
|
||||
vc.toast(_json.msg);
|
||||
|
||||
},
|
||||
function (errInfo, error) {
|
||||
console.log('请求失败处理');
|
||||
|
||||
vc.component.editWechatAttrInfo.errorInfo = errInfo;
|
||||
|
||||
});
|
||||
},
|
||||
clearEditWechatAttrInfo: function () {
|
||||
vc.component.editWechatAttrInfo = {
|
||||
attrId: '',
|
||||
wechatId: '',
|
||||
specCdName: '',
|
||||
specCd: '',
|
||||
value: ''
|
||||
};
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
})(window.vc);
|
||||
@ -18,13 +18,13 @@
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr v-for="(storeAttr, key) in wechatAttrInfo.attrs">
|
||||
<td class="text-center">{{storeAttr.specCdName}}</td>
|
||||
<td class="text-center">{{storeAttr.value}}</td>
|
||||
<tr v-for="(wechatAttr, key) in wechatAttrInfo.attrs">
|
||||
<td class="text-center">{{wechatAttr.specCdName}}</td>
|
||||
<td class="text-center">{{wechatAttr.value}}</td>
|
||||
<td class="text-right">
|
||||
<div class="btn-group">
|
||||
<button class="btn-white btn btn-xs"
|
||||
v-on:click="_openEditStoreAttrModel(storeAttr)">修改
|
||||
v-on:click="_openEditWechatAttrModel(wechatAttr)">修改
|
||||
</button>
|
||||
</div>
|
||||
</td>
|
||||
@ -46,4 +46,6 @@
|
||||
</div>
|
||||
<vc:create path="common/editStoreInfo"></vc:create>
|
||||
<vc:create path="common/editStoreAttr"></vc:create>
|
||||
|
||||
<vc:create path="property/editWechatAttr"></vc:create>
|
||||
</div>
|
||||
@ -28,7 +28,7 @@
|
||||
_initEvent: function () {
|
||||
|
||||
vc.on('wechatAttrInfo', 'getWechatAttrInfo', function (_param) {
|
||||
$that.wechatAttrInfo.wechatId = _param.weChatId;
|
||||
$that.wechatAttrInfo.wechatId = _param.wechatId;
|
||||
$that._listListWechatAttrs(DEFAULT_PAGE, DEFAULT_ROWS);
|
||||
});
|
||||
},
|
||||
@ -50,9 +50,10 @@
|
||||
console.log('请求失败处理');
|
||||
}
|
||||
);
|
||||
},
|
||||
_openEditWechatAttrModel:function(_wechatAttr){
|
||||
vc.emit('editWechatAttr','openEditWechatAttrModal',_wechatAttr);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
})(window.vc);
|
||||
|
||||
@ -46,7 +46,9 @@
|
||||
var _smallWeChatManageInfo = JSON.parse(json);
|
||||
vc.component.smallWeChatManageInfo.smallWeChats = _smallWeChatManageInfo.smallWeChats;
|
||||
if (_smallWeChatManageInfo.smallWeChats.length > 0) {
|
||||
vc.emit('wechatAttrInfo', 'getWechatAttrInfo', _smallWeChatManageInfo.smallWeChats[0]);
|
||||
vc.emit('wechatAttrInfo', 'getWechatAttrInfo', {
|
||||
wechatId:_smallWeChatManageInfo.smallWeChats[0].weChatId
|
||||
});
|
||||
}
|
||||
|
||||
}, function (errInfo, error) {
|
||||
|
||||
@ -1,45 +1,12 @@
|
||||
<div>
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<div class="ibox ">
|
||||
<div class="ibox-title">
|
||||
<h5>查询条件</h5>
|
||||
<div class="ibox-tools" style="top:10px;">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="ibox-content">
|
||||
<div class="row">
|
||||
<div class="col-sm-4">
|
||||
<div class="form-group">
|
||||
<input type="text" placeholder="请输入名称"
|
||||
v-model="smallWeChatManageInfo.conditions.name" class=" form-control">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-4">
|
||||
<div class="form-group">
|
||||
<input type="text" placeholder="请输入appId"
|
||||
v-model="smallWeChatManageInfo.conditions.appId" class=" form-control">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-4">
|
||||
<button type="button" class="btn btn-primary btn-sm" v-on:click="_querySmallWeChatMethod()">
|
||||
<i class="fa fa-search"></i> 查询
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<div class="ibox">
|
||||
<div class="ibox-title">
|
||||
<div class="ibox-tools" style="top:10px;">
|
||||
<button type="button" class="btn btn-primary btn-sm" v-on:click="_openAddSmallWeChatModal(1000)">
|
||||
<h5>我的小程序</h5>
|
||||
<div class="ibox-tools" style="top:10px;" v-if="smallWeChatManageInfo.smallWeChats.length == 0 ">
|
||||
<button type="button" class="btn btn-primary btn-sm"
|
||||
v-on:click="_openAddSmallWeChatModal(1000)">
|
||||
<i class="glyphicon glyphicon-plus"></i>
|
||||
添加小程序
|
||||
</button>
|
||||
@ -47,55 +14,45 @@
|
||||
</div>
|
||||
<div class="ibox-content">
|
||||
|
||||
<table class="footable table table-stripped toggle-arrow-tiny"
|
||||
data-page-size="15"
|
||||
>
|
||||
<table class="footable table table-stripped toggle-arrow-tiny" data-page-size="15">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-center">名称</th>
|
||||
<th class="text-center">APPID</th>
|
||||
<th class="text-center">应用密钥</th>
|
||||
<th class="text-center">支付密码</th>
|
||||
<th class="text-center">商户ID</th>
|
||||
<th class="text-center">描述</th>
|
||||
<th class="text-center">操作</th>
|
||||
<tr>
|
||||
<th class="text-center">名称</th>
|
||||
<th class="text-center">APPID</th>
|
||||
<th class="text-center">应用密钥</th>
|
||||
<th class="text-center">支付密码</th>
|
||||
<th class="text-center">商户ID</th>
|
||||
<th class="text-center">描述</th>
|
||||
<th class="text-center">操作</th>
|
||||
|
||||
|
||||
</tr>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="smallWeChat in smallWeChatManageInfo.smallWeChats">
|
||||
<td class="text-center">{{smallWeChat.name}}</td>
|
||||
<td class="text-center">{{smallWeChat.appId}}</td>
|
||||
<td class="text-center">********</td>
|
||||
<td class="text-center">**********</td>
|
||||
<td class="text-center">{{smallWeChat.mchId}}</td>
|
||||
<td class="text-center">{{smallWeChat.remarks}}</td>
|
||||
<td class="text-center">
|
||||
<!-- <div class="btn-group">-->
|
||||
<!-- <button class="btn-white btn btn-xs"-->
|
||||
<!-- v-on:click="_openEditSmallWeChatModel(smallWeChat)">修改-->
|
||||
<!-- </button>-->
|
||||
<!-- </div>-->
|
||||
<div class="btn-group">
|
||||
<button class="btn-white btn btn-xs"
|
||||
v-on:click="_openDeleteSmallWeChatModel(smallWeChat)">删除
|
||||
</button>
|
||||
</div>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
<tr v-for="smallWeChat in smallWeChatManageInfo.smallWeChats">
|
||||
<td class="text-center">{{smallWeChat.name}}</td>
|
||||
<td class="text-center">{{smallWeChat.appId}}</td>
|
||||
<td class="text-center">********</td>
|
||||
<td class="text-center">**********</td>
|
||||
<td class="text-center">{{smallWeChat.mchId}}</td>
|
||||
<td class="text-center">{{smallWeChat.remarks}}</td>
|
||||
<td class="text-center">
|
||||
<div class="btn-group">
|
||||
<button class="btn-white btn btn-xs"
|
||||
v-on:click="_openEditSmallWeChatModel(smallWeChat)">修改
|
||||
</button>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td colspan="7">
|
||||
<ul class="pagination float-right"></ul>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="7">
|
||||
<ul class="pagination float-right"></ul>
|
||||
</td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
<!-- 分页 -->
|
||||
<vc:create path="frame/pagination"></vc:create>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -108,4 +65,4 @@
|
||||
<vc:create path="property/deleteSmallWeChat"></vc:create>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@ -37,6 +37,7 @@
|
||||
|
||||
vc.component.smallWeChatManageInfo.conditions.page = _page;
|
||||
vc.component.smallWeChatManageInfo.conditions.row = _rows;
|
||||
vc.component.smallWeChatManageInfo.conditions.communityId = vc.getCurrentCommunity().communityId;
|
||||
var param = {
|
||||
params: vc.component.smallWeChatManageInfo.conditions
|
||||
};
|
||||
|
||||
Loading…
Reference in New Issue
Block a user