diff --git a/src/api/tools/alipay.js b/src/api/tools/alipay.js index 54090f5..6aa09f3 100644 --- a/src/api/tools/alipay.js +++ b/src/api/tools/alipay.js @@ -2,14 +2,14 @@ import request from '@/utils/request' export function get() { return request({ - url: 'api/aliPay', + url: 'bxg/api/aliPay', method: 'get' }) } export function update(data) { return request({ - url: 'api/aliPay', + url: 'bxg/api/aliPay', data, method: 'put' }) @@ -18,7 +18,7 @@ export function update(data) { // 支付 export function toAliPay(url, data) { return request({ - url: 'api/' + url, + url: 'bxg/api/' + url, data, method: 'post' }) diff --git a/src/views/bxg/activity/bargain/form.vue b/src/views/bxg/activity/bargain/form.vue index 4f2449a..6420b7e 100644 --- a/src/views/bxg/activity/bargain/form.vue +++ b/src/views/bxg/activity/bargain/form.vue @@ -244,6 +244,11 @@ export default { }, doAdd() { add(this.form).then(res => { + if (res.status==500){ + this.loading = false + this.$message.error(res.msg) + return + } this.resetForm() this.$notify({ title: '添加成功', diff --git a/src/views/bxg/activity/combination/form.vue b/src/views/bxg/activity/combination/form.vue index 3b30a33..764a5fe 100644 --- a/src/views/bxg/activity/combination/form.vue +++ b/src/views/bxg/activity/combination/form.vue @@ -155,13 +155,12 @@ - - + - + @@ -228,6 +227,12 @@ export default { components: {editor, picUpload, mulpicUpload, Treeselect, MaterialList, UeditorWrap, singlePic, cgood}, data() { return { + rule:{ + phone: [ + { required: true, message: '请输入手机号码', trigger: 'blur' }, + { pattern: /^((1[3,5,8][0-9])|(14[5,7])|(17[0,5,6,7,8])|(19[7]))\d{8}$/, message: '请检查手机号是否正确', trigger: 'blur' }, + ], + }, spinShow: false, // 批量设置表格data oneFormBatch: [ @@ -356,6 +361,8 @@ export default { loading: false, treeSelect: [], tableIndex: 0, + + ruleValidate: { title: [ {required: true, message: '请输入拼团名称', trigger: 'blur'} @@ -379,8 +386,14 @@ export default { {required: true, message: '请选择运费模板', trigger: 'change', type: 'number'} ], price: [ - {required: true, message: '请输入拼团价格', trigger: 'blur'} + {required: true, message: '请输入商品售价', trigger: 'blur'} ], + // pink_price: [ + // {required: true, message: '请输入拼团价格', trigger: 'blur'} + // ], + // pink_stock: [ + // {required: true,message: '库存设置不能小于0', trigger: 'blur',min: 1, }, + // ], people: [ {required: true, message: '请选择拼团人数', trigger: 'change', type: 'number'} ], @@ -651,6 +664,7 @@ export default { if (valid) { if (this.formValidate.spec_type === 0) { this.formValidate.attrs = this.oneFormValidate; + console.log('this.oneFormValidate',this.oneFormValidate) this.formValidate.header = []; this.formValidate.items = []; } else { @@ -661,12 +675,16 @@ export default { return this.$message.warning('请点击生成规格!'); } add(this.formValidate).then(async res => { + if (res.status==500){ + this.$message.error(res.msg); + return + } this.$message({ message: '操作成功', type: 'success' }); setTimeout(() => { - this.$router.push({path: '/activity/combination'}); + this.$router.push({path: '/bxg/activity/combination'}); }, 500); }).catch(res => { this.$message.error(res.msg); diff --git a/src/views/bxg/activity/combination/index.vue b/src/views/bxg/activity/combination/index.vue index da7de53..5ee31a0 100644 --- a/src/views/bxg/activity/combination/index.vue +++ b/src/views/bxg/activity/combination/index.vue @@ -122,10 +122,10 @@ export default { }, methods: { toAddURL(){ - this.$router.push({ path: 'bxg/activity/combinationAdd' }) + this.$router.push({ path: '/bxg/activity/combinationAdd'}) }, toUpdateURL(id){ - this.$router.push({ path: 'bxg/activity/combinationEdit/'+id }) + this.$router.push({ path: '/bxg/activity/combinationEdit/'+id }) }, formatTimeTwo, checkPermission, diff --git a/src/views/bxg/activity/seckill/form.vue b/src/views/bxg/activity/seckill/form.vue index a464b14..5701aef 100644 --- a/src/views/bxg/activity/seckill/form.vue +++ b/src/views/bxg/activity/seckill/form.vue @@ -408,7 +408,7 @@ export default { }, mounted () { this.getInfo(), - initData('api/yxSystemGroupData',{ groupName: 'yshop_seckill_time',status:1 }).then(res => { + initData('bxg/api/yxSystemGroupData',{ groupName: 'yshop_seckill_time',status:1 }).then(res => { this.myTimes = res.content }) if(this.$route.params.id){ @@ -660,24 +660,30 @@ export default { if(this.formValidate.spec_type === 1 && this.manyFormValidate.length===0){ return this.$message.warning('请点击生成规格!'); } - - // 判断是否是添加 if(this.isAdd){ console.log(this.formValidate) add(this.formValidate).then(res=>{ + if (res.status==500){ + this.$message.error(res.msg); + return + } this.$message({ message:'操作成功', type: 'success' }); setTimeout(() => { - this.$router.push({ path: '/activity/seckill' }); + this.$router.push({ path: '/bxg/activity/seckill' }); }, 500); }).catch(res => { this.$message.error(res.msg); }) }else{ add(this.formValidate).then(async res => { + if (res.status==500){ + this.$message.error(res.msg); + return + } this.$message({ message:'操作成功', type: 'success' diff --git a/src/views/bxg/activity/seckill/index.vue b/src/views/bxg/activity/seckill/index.vue index 7601f66..f3eb320 100644 --- a/src/views/bxg/activity/seckill/index.vue +++ b/src/views/bxg/activity/seckill/index.vue @@ -106,10 +106,10 @@ export default { }, methods: { toAddURL(){ - this.$router.push({ path: '/activity/secKillAdd' }) + this.$router.push({ path: '/bxg/activity/secKillAdd' }) }, toUpdateURL(id){ - this.$router.push({ path: '/activity/secKillEdit/'+id }) + this.$router.push({ path: '/bxg/activity/secKillEdit/'+id }) }, formatTimeTwo, checkPermission, diff --git a/src/views/bxg/shop/set/seckill.vue b/src/views/bxg/shop/set/seckill.vue index 6d8bfc9..5665c09 100644 --- a/src/views/bxg/shop/set/seckill.vue +++ b/src/views/bxg/shop/set/seckill.vue @@ -19,7 +19,12 @@ - + + + +