From a321bf358ff68d3f45a84b70401fa92b0ad7aba4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=A5=A5=E6=96=AF?= <9068149@qq.com> Date: Wed, 10 Nov 2021 14:13:24 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=B4=E4=BD=93=E4=BB=A3=E7=A0=81=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/config/config.js | 2 +- script/verify-commit.js | 22 +- src/App.vue | 40 +- src/api/api.js | 127 --- .../componentscom/listswitching/index.vue | 27 - src/components/createTemplate/index.vue | 164 ---- src/components/extension/index.vue | 289 ------ .../rightslider/captiontextsstyle/index.vue | 44 +- src/components/rightslider/decorate/index.vue | 98 +- .../graphicnavigationstyle/index.vue | 6 - .../rightslider/listswitchingstyle/index.vue | 49 - .../listswitchingstyle/productUpload.vue | 382 -------- .../rightslider/magiccubestyle/index.vue | 7 - .../rightslider/pictureadsstyle/index.vue | 6 - .../rightslider/richtextstyle/index.vue | 5 - src/components/uploadCommodity/index.vue | 120 +-- src/layout/home/index.vue | 102 +- src/layout/qrcode/index.vue | 15 - src/layout/screen/index.vue | 689 -------------- src/permission.js | 5 - src/router/index.js | 6 - src/utils/componentProperties.js | 5 +- src/utils/filter.js | 18 - src/utils/index.js | 67 -- src/views/establishShop/index.vue | 879 ------------------ 25 files changed, 43 insertions(+), 3131 deletions(-) delete mode 100644 src/components/createTemplate/index.vue delete mode 100644 src/components/extension/index.vue delete mode 100644 src/components/rightslider/listswitchingstyle/productUpload.vue delete mode 100644 src/layout/qrcode/index.vue delete mode 100644 src/layout/screen/index.vue delete mode 100644 src/views/establishShop/index.vue diff --git a/public/config/config.js b/public/config/config.js index 6cc59c3..0dc647b 100644 --- a/public/config/config.js +++ b/public/config/config.js @@ -1,4 +1,4 @@ window.global_config = { - BASE_URL: '/api', + BASE_URL: '/api/', NODE_ENV: 'prd', } diff --git a/script/verify-commit.js b/script/verify-commit.js index 19ea291..afdb2d2 100644 --- a/script/verify-commit.js +++ b/script/verify-commit.js @@ -1,14 +1,14 @@ -const msgPath = process.env.HUSKY_GIT_PARAMS -const msg = require('fs').readFileSync(msgPath, 'utf-8').trim() +// const msgPath = process.env.HUSKY_GIT_PARAMS +// const msg = require('fs').readFileSync(msgPath, 'utf-8').trim() -const commitRE = /^(merge|feat|fix|docs|style|refactor|perf|test|workflow|build|ci|chore|release|workflow)(\(.+\))?: .{1,50}/ +// const commitRE = /^(merge|feat|fix|docs|style|refactor|perf|test|workflow|build|ci|chore|release|workflow)(\(.+\))?: .{1,50}/ -if (!commitRE.test(msg)) { - console.log() - console.error(` - 不合法的 commit 消息格式。 - 请查看 git commit 提交规范:https://gitee.com/OKGENE_1/dashboard/projects/OKGENE_1/vue2.x-template/wikis/OKGENE_1%2Fvue2.x-template?doc_id=1047366&sort_id=3095531 - `) +// if (!commitRE.test(msg)) { +// console.log() +// console.error(` +// 不合法的 commit 消息格式。 +// 请查看 git commit 提交规范:feat: XXXXX +// `) - process.exit(1) -} +// process.exit(1) +// } diff --git a/src/App.vue b/src/App.vue index c2a0fa2..6d6041a 100644 --- a/src/App.vue +++ b/src/App.vue @@ -17,7 +17,6 @@ export default { data() { return { isRouterAlive: true, - permissionsJson: {}, } }, created() { @@ -25,16 +24,9 @@ export default { .loginAdminTest({ loginname: 'admin', pwd: '123456' }) .then((res) => { console.log(res) - this.getPermission() - this.getShopCommodity() }) }, - mounted() { - //将hasPermission挂载到window - window['hasPermission'] = (data) => { - return this.hasPermission(data) - } - }, + mounted() {}, methods: { // 刷新页面 reload() { @@ -43,36 +35,6 @@ export default { this.isRouterAlive = true }) }, - // 获取当前用户权限 - getPermission() { - this.$httpApi.getPermission().then((res) => { - let permissionsList = res.data.permissionsList - - for (let i in permissionsList) { - this.permissionsJson[permissionsList[i].funkey] = 1 - } - }) - }, - // 返回一个布尔值,判断对象是否包含特定的自身(非继承)属性 - hasPermission(permission) { - return this.permissionsJson.hasOwnProperty(permission) - }, - // 获取商品数据 - getShopCommodity() { - this.$httpApi - .getShopCommodity() - .then((res) => { - this.loading = false - console.log(res.data.shopCommodity, '------------------shopCommodity') - localStorage.setItem( - 'shopCommodity', - JSON.stringify(res.data.shopCommodity) - ) - }) - .catch(() => { - this.loading = false - }) - }, }, } diff --git a/src/api/api.js b/src/api/api.js index 421cfac..70c494a 100644 --- a/src/api/api.js +++ b/src/api/api.js @@ -1,103 +1,6 @@ import httpAjax from './http.js' class httpApi { - - // 上传图片base64 - miniShop = (data) => httpAjax({ - url: '/upload/base64/miniShop', - method: 'post', - data - }) - - // 保存 - save = (data) => httpAjax({ - url: '/adm/component/save', - method: 'post', - header: 'json', - data - }) - - //获取创建过的页面列表 - shopTemplate = (data) => httpAjax({ - url: '/adm/shopTemplate/list', - method: 'post', - header: 'json', - data - }) - - //获取页面模板 - shopTemplates = data => httpAjax({ - url: '/apiShop/shopTemplate', - data, - method: 'post' - }) - - //获取历史页面 - listData = data => httpAjax({ - url: '/adm/shopTemplate/list.data', - data, - method: 'post' - }) - - //设为主页 - homePage = data => httpAjax({ - url: '/adm/shopTemplate/homePage', - data, - method: 'post' - }) - - //删除选项 - delete = data => httpAjax({ - url: '/adm/shopTemplate/delete', - data, - method: 'post' - }) - - //获取下拉框模板类型 - selectData = data => httpAjax({ - url: '/adm/poster/select.data', - data, - method: 'post' - }) - - //获取海报 - poster = data => httpAjax({ - url: '/adm/shopTemplate/poster', - data, - method: 'post' - }) - - //复制 - copy = data => httpAjax({ - url: '/adm/shopTemplate/copy', - data, - method: 'post' - }) - - //导出 - exportTemplate = data => httpAjax({ - url: '/adm/shopTemplate/export', - data, - method: 'post' - }) - //导入 - importTemplate = data => httpAjax({ - url: '/adm/shopTemplate/import', - data, - method: 'post' - }) - //获取系统模板 - defaultTemplate = data => httpAjax({ - url: '/adm/shopTemplate/defaultTemplate', - data, - method: 'post' - }) - //获取当前用户权限 - getPermission = data => httpAjax({ - url: '/adm/permission/getPermission', - data, - method: 'post' - }) //手机登录接口 loginAdminTest = data => httpAjax({ @@ -106,36 +9,6 @@ class httpApi { method: 'post' }) - //设置为模板 - saveDefaultTemplate = data => httpAjax({ - url: '/adm/shopTemplate/saveDefaultTemplate', - data, - method: 'post' - }) - - //查看店铺概要信息 - queryShopInfo = data => httpAjax({ - url: '/adm/shop/queryShopInfo', - data, - method: 'post' - }) - - //修改店铺信息,目前只支持名称和头像链接修改 - updateShopInfo = data => httpAjax({ - url: '/adm/shop/updateShopInfo', - data, - method: 'post' - }) - - - //动态获取商品数据 - getShopCommodity = data => httpAjax({ - url: '/adm/shop/getShopCommodity', - data, - method: 'post' - }) - - } export default new httpApi() \ No newline at end of file diff --git a/src/components/componentscom/listswitching/index.vue b/src/components/componentscom/listswitching/index.vue index a9ee6cf..c9a6bc5 100644 --- a/src/components/componentscom/listswitching/index.vue +++ b/src/components/componentscom/listswitching/index.vue @@ -205,12 +205,6 @@ >
- {{ item.name }} -

{{ item.introduce }} -

{{ item.price }} -
- {{ item.name }} -

{{ item.introduce }} -

{{ item.price }} -
- {{ item.name }} -

{{ item.introduce }} -

{{ item.price }} -
-
- - - - - - - - - - -
空白模板
-
-
- - - -
- - 使用模板 -
-
-
-
-
-
-
-
- - - - - diff --git a/src/components/extension/index.vue b/src/components/extension/index.vue deleted file mode 100644 index 1eaa452..0000000 --- a/src/components/extension/index.vue +++ /dev/null @@ -1,289 +0,0 @@ - - - - - diff --git a/src/components/rightslider/captiontextsstyle/index.vue b/src/components/rightslider/captiontextsstyle/index.vue index 4e0d4a3..3dd3c02 100644 --- a/src/components/rightslider/captiontextsstyle/index.vue +++ b/src/components/rightslider/captiontextsstyle/index.vue @@ -207,37 +207,19 @@ - + + 内部链接 + 外部链接 + - - - - -
@@ -291,21 +273,7 @@ export default { ], } }, - methods: { - /* 获取下拉框内容 */ - getOption() { - this.$httpApi.shopTemplate().then((res) => { - - this.options = res.data.shopTemplateList - }) - }, - changeId(res) { - this.datas.more.select = { - name: res.name, - id: res.id, - } - }, - }, + methods: {}, } diff --git a/src/components/rightslider/decorate/index.vue b/src/components/rightslider/decorate/index.vue index 2735bb1..3c105d7 100644 --- a/src/components/rightslider/decorate/index.vue +++ b/src/components/rightslider/decorate/index.vue @@ -55,16 +55,6 @@ - - - @@ -100,54 +90,6 @@
- - - - {{ datas.bottomLogo.isShowBootom ? '显示' : '隐藏' }} - - - - - -
-
- 店铺名称: - -
- -
- 店铺头像: - -
- 更换头像 - -
-
-
-
@@ -202,63 +144,31 @@ export default { 'hsla(209, 100%, 56%, 0.73)', '#c7158577', ], - shopData: { - shopName: null, // 店铺名称 - shopPic: null, // 店铺头像 - }, uploadImgDataType: null, // 获取到的图片地址属于哪一类别 0 修改底部logo 1 修改店铺图标 2 页面背景图 } }, - created() { - this.getShopInfo() - }, + created() {}, methods: { - // 显示上传图片组件 type : 0 修改底部logo 1 修改店铺图标 2 页面背景图 + // 显示上传图片组件 type : 2 页面背景图 showUpload(type) { this.uploadImgDataType = type this.$refs.upload.showUpload() }, - // 底部logo + // 上传图片 uploadInformation(res) { - if (this.uploadImgDataType === '0') { - this.datas.bottomLogo.botLogo = res - } else if (this.uploadImgDataType === '1') { - this.shopData.shopPic = res - this.changeShopInfo() - } else if (this.uploadImgDataType === '2') { + if (this.uploadImgDataType === '2') { this.datas.bgImg = res } }, - // 获取店铺信息 - getShopInfo() { - this.$httpApi.queryShopInfo().then((res) => { - - - this.shopData.shopName = res.data.name // 店铺名称 - this.shopData.shopPic = res.data.icon // 店铺头像 - }) - }, // 清空背景图片 clear() { this.datas.bgImg = '' }, - // 修改店铺信息 - changeShopInfo() { - let params = { - name: this.shopData.shopName, - icon: this.shopData.shopPic, - } - - this.$httpApi.updateShopInfo(params).then((res) => { - console.log('change shop info ::', res) - this.$message.success(res.msg) - }) - }, }, watch: { colourAction(data) { diff --git a/src/components/rightslider/graphicnavigationstyle/index.vue b/src/components/rightslider/graphicnavigationstyle/index.vue index bfb658a..3615009 100644 --- a/src/components/rightslider/graphicnavigationstyle/index.vue +++ b/src/components/rightslider/graphicnavigationstyle/index.vue @@ -272,14 +272,8 @@ export default { } }, created() { - this.initImageList() }, methods: { - // 初始化更新imageList数据 - initImageList() { - this.datas.imageList = this.$utils.replaceImageList(this.datas.imageList) - console.log(this.datas.imageList, '------------created imageList') - }, showUpload(type) { this.uploadImgDataType = type this.$refs.upload.showUpload() diff --git a/src/components/rightslider/listswitchingstyle/index.vue b/src/components/rightslider/listswitchingstyle/index.vue index b4e2e1c..355ae8b 100644 --- a/src/components/rightslider/listswitchingstyle/index.vue +++ b/src/components/rightslider/listswitchingstyle/index.vue @@ -63,28 +63,6 @@ - - - {{ datas.showMore ? '显示' : '隐藏' }} - - - - - - -
添加商品

@@ -549,22 +527,8 @@ export default { } }, created() { - // if(this.datas.moreUrl) { - // this.moreName = this.datas.moreUrl[1] - // } - // this.changeImageListData() }, methods: { - changeImageListData() { - let shopCommodity = JSON.parse(localStorage.getItem('shopCommodity')) - console.log(shopCommodity, '--------------listswitching datas') - // let newList = [] - // this.datas.imageList.forEach((element) => { - // newList.push(shopCommodity[element.type][element.id]) - // }) - - // this.datas.imageList = newList - }, /* 上传图片弹框 */ dialogVisibleshow(text, number) { this.$refs.upload.showUpload() @@ -623,19 +587,6 @@ export default { delecommoditylisttypetab(index) { this.datas.commoditylisttypetab.splice(index, 1) }, - - /* 获取下拉框内容 */ - getOption() { - this.$httpApi.shopTemplate().then((res) => { - - this.options = res.data.shopTemplateList - }) - }, - - selectMore() { - this.datas.showMore = true - this.datas.moreUrl = this.moreName - }, }, computed: { styleText() { diff --git a/src/components/rightslider/listswitchingstyle/productUpload.vue b/src/components/rightslider/listswitchingstyle/productUpload.vue deleted file mode 100644 index bb5d63a..0000000 --- a/src/components/rightslider/listswitchingstyle/productUpload.vue +++ /dev/null @@ -1,382 +0,0 @@ - - - - - - diff --git a/src/components/rightslider/magiccubestyle/index.vue b/src/components/rightslider/magiccubestyle/index.vue index fabcf3b..c0941be 100644 --- a/src/components/rightslider/magiccubestyle/index.vue +++ b/src/components/rightslider/magiccubestyle/index.vue @@ -424,15 +424,8 @@ export default { }, }, created() { - this.initImageList() }, methods: { - // 初始化更新imageList数据 - initImageList() { - this.datas.imageList = this.$utils.replaceImageList(this.datas.imageList) - console.log(this.datas.imageList, '------------created imageList') - }, - /* 替换 */ uploadInformation(res) { this.datas.imageList[this.imgActive].src = res diff --git a/src/components/rightslider/pictureadsstyle/index.vue b/src/components/rightslider/pictureadsstyle/index.vue index b3c4298..c92425f 100644 --- a/src/components/rightslider/pictureadsstyle/index.vue +++ b/src/components/rightslider/pictureadsstyle/index.vue @@ -248,15 +248,9 @@ export default { }, created() { - this.initImageList() }, methods: { - // 初始化更新imageList数据 - initImageList() { - this.datas.imageList = this.$utils.replaceImageList(this.datas.imageList) - console.log(this.datas.imageList, '------------created imageList') - }, // 提交 uploadInformation(res) { diff --git a/src/components/rightslider/richtextstyle/index.vue b/src/components/rightslider/richtextstyle/index.vue index b580081..098e9be 100644 --- a/src/components/rightslider/richtextstyle/index.vue +++ b/src/components/rightslider/richtextstyle/index.vue @@ -114,11 +114,6 @@ export default { succFun(res.result) } xhr.send(formData) - - // this.$httpApi.uploadImgs(formData).then(res => { - // if(res.success != true) return failFun('HTTP Error: ' + res.msg) - // succFun(res.result) - // }) }, }, predefineColors: [ diff --git a/src/components/uploadCommodity/index.vue b/src/components/uploadCommodity/index.vue index a783801..7c86a47 100644 --- a/src/components/uploadCommodity/index.vue +++ b/src/components/uploadCommodity/index.vue @@ -107,139 +107,45 @@ export default { changeType(isVisible, linkType) { if (isVisible && linkType) { this.emptyText = '正在搜索中' - /* 获取视频,音频,直播信息 */ + /* 获取信息 */ let res = { code: 0, success: true, error: false, data: [ { - id: 403, - createTime: 1621504872000, - updateTime: 1621504872000, - remark: null, - name: '查玛代表传承人', - classifyId: null, - type: 2, - retailPrice: 0, - price: 0, - memberPrice: 0, - vipPrice: 0, - costPrice: 0, - jidPrice: 0, - zidPrice: 0, - tidPrice: 0, - scorePrice: 0, - freight: 0, - top: null, - score: null, - sort: 1, - status: 1, - code: null, coverUrl: 'https://imgs.starfirelink.com/minicourse/非遗传承人@2x_1621504834414.png', - url: 'https://mgt.starfirelink.com/mobile/index.html#/videoOnDemand?videoId=5285890818212341060', - lengths: '', introduce: '', - free: 1, - classOne: null, - classTwo: null, - classThree: null, - seriesId: 0, - vId: null, + price: 0, + name: '测试1', videoId: '5285890818212341060', - teacherId: 1, - details: '', - buys: 0, - tryVideoId: null, - tryLengths: null, - num: 0, - bannerImgUrl: null, - specifications: null, - color: null, - createTimes: null, - createTimee: null, - updateTimes: null, - updateTimee: null, - page: 1, - limit: 20, - order: null, - ordertype: null, - minPrice: null, - maxPrice: null, - seriesName: null, + id: 403, + type: 2, + seriesId: '0', }, { - id: 396, - createTime: 1621403190000, - updateTime: 1621416056000, - remark: null, - name: '测试', - classifyId: null, - type: 2, - retailPrice: 0, - price: 1, - memberPrice: 1, - vipPrice: 0, - costPrice: 0, - jidPrice: 0, - zidPrice: 0, - tidPrice: 0, - scorePrice: 0, - freight: 0, - top: null, - score: null, - sort: 1, - status: 1, - code: null, coverUrl: 'https://imgs.starfirelink.com/minicourse/QQ截图20210409170420_1621416051505.png', - url: 'https://mgt.starfirelink.com/mobile/index.html#/videoOnDemand?videoId=', - lengths: '1', introduce: '1', - free: 0, - classOne: null, - classTwo: null, - classThree: null, - seriesId: 85, - vId: null, + price: 1, + name: '测试2', videoId: '', - teacherId: 1, - details: '1', - buys: 1, - tryVideoId: null, - tryLengths: null, - num: 0, - bannerImgUrl: null, - specifications: null, - color: null, - createTimes: null, - createTimee: null, - updateTimes: null, - updateTimee: null, - page: 1, - limit: 20, - order: null, - ordertype: null, - minPrice: null, - maxPrice: null, - seriesName: '非遗商城', + id: 396, + type: 2, + seriesId: '85', }, ], } this.activ = 0 res.data.length === 0 ? (this.emptyText = '暂无数据') : null this.options = res.data - // 校验数据 - this.options = this.$utils.filterCommodityData(linkType, this.options) } }, // 保存跳转的地方 changeId(res) { - console.log(res) - // 通过商品 type 和 id 获取到商品数据 newList接口数据可以不用 - console.log(this.$utils.getCoursewareData(this.type, res.id),'--------') - this.dialogImageUrl = this.$utils.getCoursewareData(this.type, res.id) + this.dialogImageUrl = res + console.log(this.dialogImageUrl, '----------------changeId') }, /* 显示上传文件组件 */ showUpload() { diff --git a/src/layout/home/index.vue b/src/layout/home/index.vue index 9885854..3ce8c2b 100644 --- a/src/layout/home/index.vue +++ b/src/layout/home/index.vue @@ -256,55 +256,8 @@ export default { }, mounted() { - //该字段用于区分,是否是选择模板 - let type = this.$route.query.type - if (this.$route.query.id) { - /* 加载 */ - const loading = this.$loading({ - lock: true, - text: '加载中...', - spinner: 'el-icon-loading', - background: 'rgba(0, 0, 0, 0.7)', - }) - this.$httpApi - .shopTemplates({ shopTemplateId: this.$route.query.id }) - .then((res) => { - /* 取消加载 */ - loading.close() - - let datas = res.data.shopTemplate - - //如果为模板,则需要将id设置为null,否则模板会被修改 - if (!type) { - this.id = res.data.shopTemplate.id - } - - this.pageComponents = JSON.parse(datas.component) - - console.log(this.pageComponents, '--------------------pageComponents') - - if (datas.templateJson) { - console.log('----------home datas1') - this.pageSetup = JSON.parse(datas.templateJson) - } else { - console.log('----------home datas2') - this.pageSetup.name = datas.name - this.pageSetup.details = datas.details - this.pageSetup.bgColor = datas.bgColor - } - /* 默认页面设置 */ - this.currentproperties = this.pageSetup - console.log( - this.currentproperties, - this.pageSetup, - '----------home datas' - ) - }) - } else { this.pageSetup.name = '页面标题' this.currentproperties = this.pageSetup - console.log(this.currentproperties, '----------home datas') - } }, methods: { @@ -342,49 +295,14 @@ export default { }, /** * 保存 - * - * @param {Function} callBack 回调函数 */ - Preservation(callBack) { + Preservation() { /* 隐藏border和删除图标 */ this.deleShow = false /* 渲染结束截图 */ this.$nextTick(() => { /* 截图 */ - this.toImage((res) => { - /* 加载 */ - const loadings = this.$loading({ - lock: true, - text: '上传中...', - spinner: 'el-icon-loading', - background: 'rgba(0, 0, 0, 0.7)', - }) - - this.$httpApi - .save({ - id: this.id, - imgUrl: res, - // bgColor: this.pageSetup.colour, - // details:this.pageSetup.description, - name: this.pageSetup.name, - // bottomLogo: this.pageSetup.bottomLogo, - templateJson: JSON.stringify(this.pageSetup), - component: JSON.stringify(this.pageComponents), - }) - .then((res) => { - /* 取消加载 */ - loadings.close() - - this.$message({ - message: '上传成功', - type: 'success', - }) - - this.id = res.data.id - - if (callBack) callBack() - }) - }) + this.toImage() }) }, @@ -393,7 +311,7 @@ export default { * * @param {Function} callBack 回调函数 */ - toImage(callBack) { + toImage() { /* 加载 */ const loading = this.$loading({ lock: true, @@ -415,18 +333,8 @@ export default { let url = canvas.toDataURL('image/png') const formData = new FormData() formData.append('base64File', url) - this.$httpApi.miniShop(formData).then((res) => { - /* 取消加载 */ - loading.close() - - this.$message({ - message: '保存成功', - type: 'success', - }) - - /* 获取图片链接 */ - callBack(res.data.src) - }) + console.log(formData,'--------------页面图片formData') + loading.close() }) }, diff --git a/src/layout/qrcode/index.vue b/src/layout/qrcode/index.vue deleted file mode 100644 index fd0d87a..0000000 --- a/src/layout/qrcode/index.vue +++ /dev/null @@ -1,15 +0,0 @@ - - - - - diff --git a/src/layout/screen/index.vue b/src/layout/screen/index.vue deleted file mode 100644 index a832dd0..0000000 --- a/src/layout/screen/index.vue +++ /dev/null @@ -1,689 +0,0 @@ - - - diff --git a/src/permission.js b/src/permission.js index 7f7fc2d..53f9de8 100644 --- a/src/permission.js +++ b/src/permission.js @@ -30,11 +30,6 @@ Vue.prototype.$httpApi = httpApi /* import VueCookies from 'vue-cookies' Vue.use(VueCookies) */ -Vue.prototype.$hasPermission = function (permission) { - //console.log("---------$hasPermission-------") - return window.hasPermission(permission) -} - // 挂载 uitls import Utils from './utils/index' Vue.prototype.$utils = Utils diff --git a/src/router/index.js b/src/router/index.js index 39e49f4..d89e53d 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -18,12 +18,6 @@ const routes = [ }, ], }, - { - // 创建页面 - path: '/establishShop', - name: 'establishShop', - component: () => import('@/views/establishShop'), - }, ] const router = new VueRouter({ diff --git a/src/utils/componentProperties.js b/src/utils/componentProperties.js index c9934d5..3d6b355 100644 --- a/src/utils/componentProperties.js +++ b/src/utils/componentProperties.js @@ -27,9 +27,8 @@ componentsData.set('captiontext', { show: false,//是否显示查看更多 type: 1, // 样式选择 text: '查看更多', //自定义文字 - httpType: 1,//链接类型 - http: '',//外部链接 - select: {},//内部跳转链接 + httpType: 10,//链接类型 + http: '',//链接 }, }, }) diff --git a/src/utils/filter.js b/src/utils/filter.js index ce40e15..eacebd4 100644 --- a/src/utils/filter.js +++ b/src/utils/filter.js @@ -22,24 +22,6 @@ let globalFilter = { s = s < 10 ? '0' + s : s return y + '-' + MM + '-' + d + ' ' + h + ':' + m + ':' + s }, - - /** - * - * 获取最新的组件数据 - * @param {*} itemData - * @param {*} itemKey - * @returns - */ - getCommodityItemData(itemData, itemKey) { - let shopCommodity = JSON.parse(localStorage.getItem('shopCommodity')) - if ( - shopCommodity[itemData.type] && shopCommodity[itemData.type][itemData.id] - ) { - return shopCommodity[itemData.type][itemData.id][itemKey] - } else { - return null - } - }, } export default globalFilter diff --git a/src/utils/index.js b/src/utils/index.js index 56840d3..4a84049 100644 --- a/src/utils/index.js +++ b/src/utils/index.js @@ -102,73 +102,6 @@ class utils { return result } - /** - * 过滤商品数据 对应商品类型没有指定id等数据 options 中禁止选择 - * - * @param {*} linkType - * @param {*} data - * @memberof utils - */ - filterCommodityData(linkType, data) { - data.forEach((item) => { - if (linkType === '1' || linkType === '3') { - // 视频音频必须拥有videoId 和 id - item.videoId && item.id ? null : (item.disabled = true) // 不存在数据 直接禁用 - } else if (linkType === '2' || linkType === '6' || linkType === '10') { - item.id ? null : (item.disabled = true) - } - }) - - return data - } - - // getCoursewareData 匹配数组 - coursewareMetchArr = ['1', '2', '3', '6', '7'] - - /** - * 通过商品类型 商品id获取商品数据 - * - * @param {String} type 商品类型 - * @param {Number} id 商品id - * @memberof utils - */ - getCoursewareData(type, id) { - // 只匹配type 为 1 2 3 6 - if (this.coursewareMetchArr.includes(type)) { - console.log('utils -> getCoursewareData -> id', id) - console.log('utils -> getCoursewareData -> type', type) - let shopCommodity = JSON.parse(localStorage.getItem('shopCommodity')) - - return shopCommodity[type][id] - } - } - - /** - * 更新imageList数据 - * - * @param {Array} imageList 需要改变的imageList数组 - * @returns {Array} 更改好的数据 - * @memberof utils - */ - replaceImageList(imageList) { - console.log(imageList, '----------------------imageList') - if (imageList.length > 0) { - // 有数据 不用更新封面图片 只用更新videoId name等数据 - imageList.forEach((element) => { - console.log(element, '-------------------replaceImageList') - element.http = - this.getCoursewareData( - element.linktype ? element.linktype : element.http.type, - element.http.id - ) || element.http - }) - console.log(imageList, '--------------------更新后的数据') - return imageList - } else { - return [] - } - } - /** * 递归合并两个对象 diff --git a/src/views/establishShop/index.vue b/src/views/establishShop/index.vue deleted file mode 100644 index f862c22..0000000 --- a/src/views/establishShop/index.vue +++ /dev/null @@ -1,879 +0,0 @@ - - - - -