diff --git a/src/api/marketingCard/marketingCard.js b/src/api/marketingCard/marketingCard.js index 937a522..f393afe 100644 --- a/src/api/marketingCard/marketingCard.js +++ b/src/api/marketingCard/marketingCard.js @@ -168,5 +168,42 @@ export default { }, + + + // 新人推荐礼包 + // 获取礼包列表 + newUserGiftListPage: function(data) { + return request({ + url: '/ecommendnewuserbag/giftBagListPage', + method: 'post', + data: data + }); + }, + + + // 修改小程序礼包上架/下架状态 + updateNewUserGiftState: function(sid,isEnable) { + return request({ + url: '/ecommendnewuserbag/isGrounding/'+sid+"/"+isEnable + }); + }, + + // 新增、保存礼包 + saveNewUserGift: function(data) { + return request({ + url: '/ecommendnewuserbag/saveGiftBag', + method: 'post', + data: data + }); + }, + + // 初始化礼包 + newUserGiftInit: function(data) { + return request({ + url: '/ecommendnewuserbag/giftBagInit/'+data, + method: 'get' + }); + }, + } diff --git a/src/layout/components/Sidebar/index.vue b/src/layout/components/Sidebar/index.vue index 8a3ef03..fb810ff 100644 --- a/src/layout/components/Sidebar/index.vue +++ b/src/layout/components/Sidebar/index.vue @@ -1,514 +1,516 @@ + ] + } + ] + } + }, + computed: { + ...mapGetters(['sidebar']), + // routes() { + // f4d2e507-c4ed-451c-b364-04c08f962045 + // console.log('78979789', this.$router.options.routes) + // return this.$router.options.routes + // }, + activeMenu() { + // const route = this.$route + // const { + // meta, + // path + // } = route + // // if set path, the sidebar will highlight the path you set + // if (meta.activeMenu) { + // return meta.activeMenu + // } + return '/index' + }, + showLogo() { + return this.$store.state.settings.sidebarLogo + }, + variables() { + return variables + }, + isCollapse() { + return !this.sidebar.opened + } + }, + created() { + this.postHuoquyonghu() + }, + methods: { + // 获取用户信息 + postHuoquyonghu() { + // var token = getStorage() + // loginDetails(token).then((response) => { + // console.log('resss', response) + // if (response.code === '200') { + // this.YongHuid = response.data + // this.params.userSid = this.YongHuid.sid + // getrolemenus(this.params).then((res) => { + // const userRoles = this.resRouter(res.data) + this.routes.push({ + path: '*', + redirect: '/404', + hidden: true + }) + console.log('左侧菜单', this.routes) + return this.routes + // }) + // } + // }) + }, + resRouter(menus) { + // 递归,将后台传来数组 + for (var i = 0; i < menus.length; i++) { + if (menus[i].children && menus[i].children.length != 0) { + this.resRouter(menus[i].children) + } + if (menus[i].children.length == 0) { + delete menus[i].children + delete menus[i].redirect + } + if (menus[i].component == '') { + console.log('55555', menus[i]) + menus[i] = { + path: menus[i].path, + component: '', + redirect: menus[i].path, + children: [menus[i]] + } + } else { + // menus[i] = { + // path: menus[i].path, + // component: '', + // redirect: menus[i].path, + // children: [menus[i]], + // } + } + } + this.routes = menus + console.log('左侧菜单', this.routes) + return menus + } + } + } + \ No newline at end of file diff --git a/src/router/index.js b/src/router/index.js index d322c71..29647c9 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -188,6 +188,14 @@ export const constantRoutes = [{ noCache: true } }, { + path: '/marketingCard/newUserGift', + component: () => import('@/views/marketingCard/newUserGift.vue'), + name: 'newUserGift', + meta: { + title: '新人推荐礼包设置', + noCache: true + } + },{ path: '/marketingCard/index', component: () => import('@/views/marketingCard/index.vue'), name: 'index', diff --git a/src/views/marketingCard/appletAdd.vue b/src/views/marketingCard/appletAdd.vue index b592494..d4ca190 100644 --- a/src/views/marketingCard/appletAdd.vue +++ b/src/views/marketingCard/appletAdd.vue @@ -414,6 +414,17 @@ saveOrUpdate() { console.log('>>>>>>>>>saveOrUpdate', this.formobj) + + if (this.formobj.preferentialPrice=='') { + this.$message({ + showClose: true, + type: 'warning', + message: '优惠后的价格不能为空' + }) + return + } + + this.submitdisabled = true req.saveAppletGiftBag(this.formobj) .then(resp => { diff --git a/src/views/marketingCard/newUserGift.vue b/src/views/marketingCard/newUserGift.vue new file mode 100644 index 0000000..3983f4e --- /dev/null +++ b/src/views/marketingCard/newUserGift.vue @@ -0,0 +1,282 @@ + + + + \ No newline at end of file diff --git a/src/views/marketingCard/newUserGiftAdd.vue b/src/views/marketingCard/newUserGiftAdd.vue new file mode 100644 index 0000000..f77b772 --- /dev/null +++ b/src/views/marketingCard/newUserGiftAdd.vue @@ -0,0 +1,535 @@ + + + + \ No newline at end of file diff --git a/src/views/marketingCard/newUserGiftInfo.vue b/src/views/marketingCard/newUserGiftInfo.vue new file mode 100644 index 0000000..3ae4696 --- /dev/null +++ b/src/views/marketingCard/newUserGiftInfo.vue @@ -0,0 +1,245 @@ + + + + \ No newline at end of file