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