mirror of
https://gitee.com/java110/MicroCommunityWeb.git
synced 2026-06-11 06:07:24 +08:00
publish 1.5 version
This commit is contained in:
parent
897aebc6a6
commit
3e4179098b
@ -1,4 +1,4 @@
|
||||
(function (vc) {
|
||||
(function(vc) {
|
||||
|
||||
vc.extends({
|
||||
propTypes: {
|
||||
@ -13,15 +13,15 @@
|
||||
toType: '',
|
||||
stock: '',
|
||||
validityDay: '',
|
||||
remark:'',
|
||||
toTypes:[]
|
||||
remark: '',
|
||||
toTypes: []
|
||||
}
|
||||
},
|
||||
_initMethod: function () {
|
||||
_initMethod: function() {
|
||||
|
||||
},
|
||||
_initEvent: function () {
|
||||
vc.on('addCouponPropertyPool', 'openAddCouponPropertyPoolModal', function () {
|
||||
_initEvent: function() {
|
||||
vc.on('addCouponPropertyPool', 'openAddCouponPropertyPoolModal', function() {
|
||||
$('#addCouponPropertyPoolModel').modal('show');
|
||||
});
|
||||
},
|
||||
@ -30,8 +30,7 @@
|
||||
return vc.validate.validate({
|
||||
addCouponPropertyPoolInfo: vc.component.addCouponPropertyPoolInfo
|
||||
}, {
|
||||
'addCouponPropertyPoolInfo.couponName': [
|
||||
{
|
||||
'addCouponPropertyPoolInfo.couponName': [{
|
||||
limit: "required",
|
||||
param: "",
|
||||
errInfo: "优惠券名称不能为空"
|
||||
@ -42,8 +41,7 @@
|
||||
errInfo: "优惠券名称不能超过64"
|
||||
},
|
||||
],
|
||||
'addCouponPropertyPoolInfo.fromType': [
|
||||
{
|
||||
'addCouponPropertyPoolInfo.fromType': [{
|
||||
limit: "required",
|
||||
param: "",
|
||||
errInfo: "来自方式不能为空"
|
||||
@ -54,8 +52,7 @@
|
||||
errInfo: "来自方式不能超过12"
|
||||
},
|
||||
],
|
||||
'addCouponPropertyPoolInfo.toType': [
|
||||
{
|
||||
'addCouponPropertyPoolInfo.toType': [{
|
||||
limit: "required",
|
||||
param: "",
|
||||
errInfo: "用途不能为空"
|
||||
@ -66,8 +63,7 @@
|
||||
errInfo: "用途不能超过12"
|
||||
},
|
||||
],
|
||||
'addCouponPropertyPoolInfo.stock': [
|
||||
{
|
||||
'addCouponPropertyPoolInfo.stock': [{
|
||||
limit: "required",
|
||||
param: "",
|
||||
errInfo: "数量不能为空"
|
||||
@ -78,21 +74,20 @@
|
||||
errInfo: "数量不能超过12"
|
||||
},
|
||||
],
|
||||
'addCouponPropertyPoolInfo.validityDay': [
|
||||
{
|
||||
'addCouponPropertyPoolInfo.validityDay': [{
|
||||
limit: "required",
|
||||
param: "",
|
||||
errInfo: "有效期'不能为空"
|
||||
errInfo: "有效期不能为空"
|
||||
},
|
||||
{
|
||||
limit: "maxLength",
|
||||
param: "12",
|
||||
errInfo: "有效期'不能超过12"
|
||||
errInfo: "有效期不能超过12"
|
||||
},
|
||||
],
|
||||
});
|
||||
},
|
||||
saveCouponPropertyPoolInfo: function () {
|
||||
saveCouponPropertyPoolInfo: function() {
|
||||
if (!vc.component.addCouponPropertyPoolValidate()) {
|
||||
vc.toast(vc.validate.errInfo);
|
||||
|
||||
@ -103,11 +98,10 @@
|
||||
|
||||
vc.http.apiPost(
|
||||
'/couponProperty.saveCouponPropertyPool',
|
||||
JSON.stringify(vc.component.addCouponPropertyPoolInfo),
|
||||
{
|
||||
JSON.stringify(vc.component.addCouponPropertyPoolInfo), {
|
||||
emulateJSON: true
|
||||
},
|
||||
function (json, res) {
|
||||
function(json, res) {
|
||||
//vm.menus = vm.refreshMenuActive(JSON.parse(json),0);
|
||||
let _json = JSON.parse(json);
|
||||
if (_json.code == 0) {
|
||||
@ -121,49 +115,50 @@
|
||||
vc.message(_json.msg);
|
||||
|
||||
},
|
||||
function (errInfo, error) {
|
||||
function(errInfo, error) {
|
||||
console.log('请求失败处理');
|
||||
|
||||
vc.message(errInfo);
|
||||
|
||||
});
|
||||
},
|
||||
clearAddCouponPropertyPoolInfo: function () {
|
||||
clearAddCouponPropertyPoolInfo: function() {
|
||||
vc.component.addCouponPropertyPoolInfo = {
|
||||
couponName: '',
|
||||
fromType: '2002',
|
||||
toType: '',
|
||||
stock: '',
|
||||
validityDay: '',
|
||||
remark:'',
|
||||
toTypes:[]
|
||||
remark: '',
|
||||
toTypes: []
|
||||
|
||||
};
|
||||
},
|
||||
_addChangeToType:function(){
|
||||
if(!$that.addCouponPropertyPoolInfo.toType){
|
||||
_addChangeToType: function() {
|
||||
if (!$that.addCouponPropertyPoolInfo.toType) {
|
||||
return;
|
||||
}
|
||||
|
||||
let _param = {
|
||||
params:{
|
||||
beanName:$that.addCouponPropertyPoolInfo.toType,
|
||||
page:1,
|
||||
row:100
|
||||
params: {
|
||||
beanName: $that.addCouponPropertyPoolInfo.toType,
|
||||
page: 1,
|
||||
row: 100
|
||||
}
|
||||
}
|
||||
}
|
||||
//发送get请求
|
||||
vc.http.apiGet('/couponKey.listCouponKey',
|
||||
_param,
|
||||
function (json, res) {
|
||||
let _marketSmsManageInfo = JSON.parse(json);
|
||||
$that.addCouponPropertyPoolInfo.toTypes = _marketSmsManageInfo.data;
|
||||
}, function (errInfo, error) {
|
||||
console.log('请求失败处理');
|
||||
}
|
||||
);
|
||||
//发送get请求
|
||||
vc.http.apiGet('/couponKey.listCouponKey',
|
||||
_param,
|
||||
function(json, res) {
|
||||
let _marketSmsManageInfo = JSON.parse(json);
|
||||
$that.addCouponPropertyPoolInfo.toTypes = _marketSmsManageInfo.data;
|
||||
},
|
||||
function(errInfo, error) {
|
||||
console.log('请求失败处理');
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
})(window.vc);
|
||||
})(window.vc);
|
||||
Loading…
Reference in New Issue
Block a user