diff --git a/src/router/index.ts b/src/router/index.ts index 5aea280..dee64d6 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -1,94 +1,102 @@ -import { createRouter, createWebHashHistory, createWebHistory } from 'vue-router' +import { + createRouter, + createWebHashHistory, + createWebHistory, +} from "vue-router"; import { LOGIN, QUERY } from "@/router/api"; // 公共路由 const routePublic = [ { // 商品中转(空白页) - path: '/proTransfer', - name: 'proTransfer', - component: () => {} + path: "/proTransfer", + name: "proTransfer", + component: () => ({}), }, { // 中转失败页 - path: '/transferError', - name: 'transferError', - component: () => import('../views/transferError.vue') + path: "/transferError", + name: "transferError", + component: () => import("../views/transferError.vue"), }, ]; - // 模版路由 命名:cmsXXX // 需要:类组件开发、样式外部 index.scss 文件引入(禁用 vh,fixed 窗口相关样式) const routeTemplate = [ { // 商品列表模版 - path: '/cmsList', - name: 'cmsList', - component: () => import('@/views/templates/cmsList/index.vue') + path: "/cmsList", + name: "cmsList", + component: () => import("@/views/templates/cmsList/index.vue"), }, { // 商品详情模版 - path: '/cmsDetail', - name: 'cmsDetail', - component: () => import('@/views/templates/cmsDetail/index.vue') + path: "/cmsDetail", + name: "cmsDetail", + component: () => import("@/views/templates/cmsDetail/index.vue"), }, { - path: '/cmsCash', - name: 'cmsCash', - component: () => import('@/views/templates/cmsCash/index.vue') + path: "/cmsCash", + name: "cmsCash", + component: () => import("@/views/templates/cmsCash/index.vue"), }, { - path: '/cmsVoucher', - name: 'cmsVoucher', - component: () => import('@/views/templates/cmsVoucher/index.vue') - } + path: "/cmsVoucher", + name: "cmsVoucher", + component: () => import("@/views/templates/cmsVoucher/index.vue"), + }, ]; // H5 路由 const routePage = [ { // 组合商品页 - path: '/comProduct', - name: 'comProduct', - component: () => import('../views/pages/comProduct/index.vue') + path: "/comProduct", + name: "comProduct", + component: () => import("../views/pages/comProduct/index.vue"), }, -] +]; -const routes= [ ...routePublic, ...routeTemplate, ...routePage ]; +const routes = [...routePublic, ...routeTemplate, ...routePage]; const router = createRouter({ history: createWebHistory(), - routes -}) + routes, +}); router.beforeEach(async (to, from, next) => { - if (to.path === '/proTransfer') { // 商品中转 + if (to.path === "/proTransfer") { + // 商品中转 // console.log('---proTransfer-router.beforeEach---', to, from); try { - const key = to.query.key || 'rPBVzOCs0FN4P7jNMqHo5IVfb0oaAyigbfNBmCKnavs='; + const key = + to.query.key || "rPBVzOCs0FN4P7jNMqHo5IVfb0oaAyigbfNBmCKnavs="; const res = await LOGIN({ key: key }); // 请求 token if (res && res.code === 200) { res.data.Token = "admingL_q2QjDlD_MdeU11q5ILoeLFEqhbGBtcEptfs-OHzI53vbrgX9GFCh-SB4fSJBGwgSTl.uDPUoyiPjJ2O6e7zUBzExUUXhsdnPxtyLwncYc8.vy9ikZRp-wUba2POZJlTERJxnLbK6DzpQFQTxuYfcNM_yl3Avo7hgCjkS-ot5QgzNiO5TE"; if (res.data.Token) { - localStorage.setItem('token', res.data.Token); - const resList = await QUERY({ key: key }) // 根据商品判断 跳转指定路由 + localStorage.setItem("token", res.data.Token); + const resList = await QUERY({ key: key }); // 根据商品判断 跳转指定路由 if (resList && resList.code === 200) { - localStorage.setItem('key', String(key)); - sessionStorage.removeItem('transferError_page_identify'); + localStorage.setItem("key", String(key)); + sessionStorage.removeItem("transferError_page_identify"); if (resList.data.length !== 1) { - sessionStorage.setItem('transferProListData', JSON.stringify(resList.data)); + sessionStorage.setItem( + "transferProListData", + JSON.stringify(resList.data) + ); return next({ - path: '/cmsList', - query: { key: key } + path: "/cmsList", + query: { key: key }, }); // 商品列表 } else { - const pro = resList.data[0] + const pro = resList.data[0]; if (pro.goods.group_id) { return next({ - path: '/comProduct', - query: { group_id: pro.goods.group_id } + path: "/comProduct", + query: { group_id: pro.goods.group_id }, }); // 组合商品 } else { // todo 3 种商品的详情页 @@ -96,24 +104,24 @@ router.beforeEach(async (to, from, next) => { } } } else { - showToast('登录失败'); + showToast("登录失败"); } } else { showToast(res.message); } next({ - path: '/transferError', - query: { redirect: to.fullPath } + path: "/transferError", + query: { redirect: to.fullPath }, }); } catch (error) { next({ - path: '/transferError', - query: { redirect: to.fullPath } + path: "/transferError", + query: { redirect: to.fullPath }, }); } } else { next(); // 对于非匹配路由,直接放行 } -}) +}); export default router; diff --git a/src/views/templates/cmsCash/index.scss b/src/views/templates/cmsCash/index.scss index 7a7011a..4183e58 100644 --- a/src/views/templates/cmsCash/index.scss +++ b/src/views/templates/cmsCash/index.scss @@ -25,7 +25,7 @@ flex-direction: column; width: 100%; height: 100%; - background: url("https://lsxdemall.oss-cn-chengdu.aliyuncs.com/MarketingSystem/img/redPacktes/common_img_main_1.png") no-repeat; + background: url("https://lsxdmgoss.oss-cn-chengdu.aliyuncs.com/MarketingSystem/image/front/common_img_main_1.png") no-repeat; background-size: 100%; } @@ -52,7 +52,7 @@ #redPacketsViews .bt { width: 200px; height: 46px; - background: url("https://lsxdemall.oss-cn-chengdu.aliyuncs.com/MarketingSystem/img/but_back_img.png"); + background: url("https://lsxdmgoss.oss-cn-chengdu.aliyuncs.com/MarketingSystem/image/front/but_back_img.png"); background-size: 100% 100%; margin: 0 auto; margin-top: 100px; @@ -127,14 +127,14 @@ #redPacketsViews .instruction-header { width: 100%; height: 43px; - background: url("https://lsxdemall.oss-cn-chengdu.aliyuncs.com/MarketingSystem/img/redPacktes/common_img_header.png") no-repeat; + background: url("https://lsxdmgoss.oss-cn-chengdu.aliyuncs.com/MarketingSystem/image/front/common_img_header.png") no-repeat; background-size: 100%; margin-bottom: -3px; } #redPacketsViews .instruction { width: 100%; - background: url("https://lsxdemall.oss-cn-chengdu.aliyuncs.com/MarketingSystem/img/redPacktes/common_img_text.png") no-repeat; + background: url("https://lsxdmgoss.oss-cn-chengdu.aliyuncs.com/MarketingSystem/image/front/common_img_text.png") no-repeat; min-height: 450px; background-size: 100% 100%; font-size: 11px; diff --git a/src/views/templates/cmsCash/index.vue b/src/views/templates/cmsCash/index.vue index 8dfbc2a..2caa4bb 100644 --- a/src/views/templates/cmsCash/index.vue +++ b/src/views/templates/cmsCash/index.vue @@ -4,7 +4,7 @@ @@ -54,7 +54,7 @@

diff --git a/src/views/templates/cmsDetail/config.ts b/src/views/templates/cmsDetail/config.ts index 9d44a1d..9071fdb 100644 --- a/src/views/templates/cmsDetail/config.ts +++ b/src/views/templates/cmsDetail/config.ts @@ -42,7 +42,7 @@ export default [ url: "#", listType: "picture-card", dragFlag: true, - ossPath: "image", + ossPath: "image/front", fileType: ".png,.jpg,.jpeg", fieldName: "bottomImg", removeFunc: true, diff --git a/src/views/templates/cmsDetail/index.vue b/src/views/templates/cmsDetail/index.vue index e428bcd..19f3e0c 100644 --- a/src/views/templates/cmsDetail/index.vue +++ b/src/views/templates/cmsDetail/index.vue @@ -25,7 +25,7 @@
- +

活动规则

@@ -62,11 +62,11 @@ export default { activityDescType: 1, //活动说明:1 图片 2 悬浮 3 富文本 bottomImg: [] as Array, - floatImg: 'https://lsxdemall.oss-cn-chengdu.aliyuncs.com/MarketingSystem/img/acticeTextTip.png', + floatImg: 'https://lsxdmgoss.oss-cn-chengdu.aliyuncs.com/MarketingSystem/image/front/acticeTextTip.png', floatText: '', // 默认背景 - carouselImg: 'https://lsxdemall.oss-cn-chengdu.aliyuncs.com/MarketingSystem/img/detailtop.png', + carouselImg: 'https://lsxdmgoss.oss-cn-chengdu.aliyuncs.com/MarketingSystem/image/front/detailtop.png', defaultList: ['', ''], defaultListImg: 'https://lsxdmgoss.oss-cn-chengdu.aliyuncs.com/MarketingSystem/image/uploads/2024-08-22/91D7DF7C-663C-4379-9BE1-E911B53D0801.png', }, diff --git a/src/views/templates/cmsList/config.ts b/src/views/templates/cmsList/config.ts index 7a43aa6..74c4c08 100644 --- a/src/views/templates/cmsList/config.ts +++ b/src/views/templates/cmsList/config.ts @@ -63,7 +63,7 @@ export default [ listType: "picture-card", dragFlag: true, fileSize: 10, - ossPath: "image", + ossPath: "image/front", fileType: ".png,.jpg,.jpeg", fieldName: "bannerTop", removeFunc: true, @@ -109,7 +109,7 @@ export default [ listType: "picture-card", dragFlag: true, fileSize: 10, - ossPath: "image", + ossPath: "image/front", fileType: ".png,.jpg,.jpeg", fieldName: "bottomImg", removeFunc: true, diff --git a/src/views/templates/cmsList/index.vue b/src/views/templates/cmsList/index.vue index b9b95a9..88a290c 100644 --- a/src/views/templates/cmsList/index.vue +++ b/src/views/templates/cmsList/index.vue @@ -35,7 +35,7 @@
- +

活动规则

@@ -97,16 +97,16 @@ export default { pageData: null, cssData: { bannerUrl: '', - bannerTop: [{ name: '', url: 'https://lsxdemall.oss-cn-chengdu.aliyuncs.com/MarketingSystem/img/goodstop.png'}], + bannerTop: [{ name: '', url: 'https://lsxdmgoss.oss-cn-chengdu.aliyuncs.com/MarketingSystem/image/front/goodstop.png'}], btnColor: 'rgb(255, 255, 255)', btnBgc: 'rgb(250, 205, 106)', contentType: 1, // 样式:1 轮播 2 列表 3 矩阵 activityDescType: 1, //活动说明:1 图片 2 悬浮 3 富文本 bottomImg: [] as Array, - floatImg: 'https://lsxdemall.oss-cn-chengdu.aliyuncs.com/MarketingSystem/img/acticeTextTip.png', + floatImg: 'https://lsxdmgoss.oss-cn-chengdu.aliyuncs.com/MarketingSystem/image/front/acticeTextTip.png', floatText: '', - carouselImg: 'https://lsxdemall.oss-cn-chengdu.aliyuncs.com/MarketingSystem/img/swiper.png', + carouselImg: 'https://lsxdmgoss.oss-cn-chengdu.aliyuncs.com/MarketingSystem/image/front/swiper.png', defaultList: [1, 2, 3, 4, 5], defaultListImg: 'https://lsxdmgoss.oss-cn-chengdu.aliyuncs.com/MarketingSystem/image/uploads/2024-08-20/A89BB503-00DC-456e-B757-CA04ADFA9C06.png', defaultMatrix: [1, 2, 3, 4, 5, 6], diff --git a/src/views/templates/cmsVoucher/index.scss b/src/views/templates/cmsVoucher/index.scss index 477fb47..7bad977 100644 --- a/src/views/templates/cmsVoucher/index.scss +++ b/src/views/templates/cmsVoucher/index.scss @@ -28,7 +28,7 @@ min-height: 90px; display: flex; justify-content: space-between; - background: url("https://lsxdemall.oss-cn-chengdu.aliyuncs.com/MarketingSystem/img/reduce/coupon.png"); + background: url("https://lsxdmgoss.oss-cn-chengdu.aliyuncs.com/MarketingSystem/image/front/coupon.png"); background-size: 100% 100%; } @@ -115,7 +115,7 @@ #reduce .receiveBtn { width: 178px; height: 46px; - background: url("https://lsxdemall.oss-cn-chengdu.aliyuncs.com/MarketingSystem/img/reduce/btnbg.png") no-repeat 100% 100% / cover; + background: url("https://lsxdmgoss.oss-cn-chengdu.aliyuncs.com/MarketingSystem/image/front/btnbg.png") no-repeat 100% 100% / cover; display: flex; justify-content: center; align-items: center; diff --git a/src/views/templates/cmsVoucher/index.vue b/src/views/templates/cmsVoucher/index.vue index 7c0045f..16cc9bf 100644 --- a/src/views/templates/cmsVoucher/index.vue +++ b/src/views/templates/cmsVoucher/index.vue @@ -51,7 +51,7 @@ @click="backgoodsFn" v-if="backAble" class="backIcon" - src="https://lsxdemall.oss-cn-chengdu.aliyuncs.com/MarketingSystem/img/backprepageBtn.png" + src="https://lsxdmgoss.oss-cn-chengdu.aliyuncs.com/MarketingSystem/image/front/backprepageBtn.png" alt="" />