This commit is contained in:
weipengfei 2024-04-12 15:06:58 +08:00
commit d3df8a1321
12 changed files with 2413 additions and 1735 deletions

View File

@ -2,3 +2,5 @@ build/*.js
src/assets src/assets
public public
dist dist
views/
views

View File

@ -22,7 +22,7 @@ module.exports = {
} }
}], }],
"vue/singleline-html-element-content-newline": "off", "vue/singleline-html-element-content-newline": "off",
"vue/multiline-html-element-content-newline":"off", "vue/multiline-html-element-content-newline": "off",
"vue/name-property-casing": ["error", "PascalCase"], "vue/name-property-casing": ["error", "PascalCase"],
"vue/no-v-html": "off", "vue/no-v-html": "off",
'accessor-pairs': 2, 'accessor-pairs': 2,
@ -37,7 +37,8 @@ module.exports = {
'camelcase': [0, { 'camelcase': [0, {
'properties': 'always' 'properties': 'always'
}], }],
'comma-dangle': [2, 'never'], // 'comma-dangle': [2, 'never'],
'comma-dangle': "off",
'comma-spacing': [2, { 'comma-spacing': [2, {
'before': false, 'before': false,
'after': true 'after': true
@ -47,7 +48,7 @@ module.exports = {
'curly': [2, 'multi-line'], 'curly': [2, 'multi-line'],
'dot-location': [2, 'property'], 'dot-location': [2, 'property'],
'eol-last': 2, 'eol-last': 2,
'eqeqeq': ["error", "always", {"null": "ignore"}], 'eqeqeq': ["error", "always", { "null": "ignore" }],
'generator-star-spacing': [2, { 'generator-star-spacing': [2, {
'before': true, 'before': true,
'after': true 'after': true

View File

@ -53,6 +53,7 @@
"file-saver": "2.0.1", "file-saver": "2.0.1",
"fuse.js": "3.4.4", "fuse.js": "3.4.4",
"html2canvas": "^1.1.0", "html2canvas": "^1.1.0",
"jquery": "^3.7.1",
"js-cookie": "2.2.0", "js-cookie": "2.2.0",
"jsonlint": "1.6.3", "jsonlint": "1.6.3",
"jszip": "3.2.1", "jszip": "3.2.1",
@ -69,8 +70,8 @@
"screenfull": "4.2.0", "screenfull": "4.2.0",
"showdown": "1.9.0", "showdown": "1.9.0",
"sortablejs": "^1.15.0", "sortablejs": "^1.15.0",
"view-design": "^4.3.2",
"v-viewer": "^1.5.1", "v-viewer": "^1.5.1",
"view-design": "^4.3.2",
"vue": "2.6.10", "vue": "2.6.10",
"vue-awesome-swiper": "^3.1.3", "vue-awesome-swiper": "^3.1.3",
"vue-count-to": "1.0.13", "vue-count-to": "1.0.13",

View File

@ -142,6 +142,35 @@ export function categorySelectApi() {
return request.get(`store/category/select`) return request.get(`store/category/select`)
} }
/**mer/store/category/topList
* @description 商品列表 -- 新商户分类
*/
export function newCategorySelectApi() {
return request.get(`store/category/topList`)
}
/**mer/store/category/topList
* @description 商品导入到云商城
*/
export function importApi(data) {
return request.post(`store/product/import`, data)
}
/**mer/store/category/topList
* @description 删除云商品
*/
export function deleteProductCloudApi(data) {
return request.post(`store/product/delCloudProduct`, data)
}
/**mer/store/category/topList
* @description 云商城列表
*/
export function cloudProductListApi(data) {
return request.get(`store/product/cloudProductList`, data)
}
/** /**
* @description 商品列表 -- 平台分类 * @description 商品列表 -- 平台分类
*/ */
@ -528,11 +557,11 @@ export function batchesTempApi(data) {
} }
/** 参数模板 -- 添加 */ /** 参数模板 -- 添加 */
export function productSpecs(data) { export function productSpecs(data) {
return request.post(`store/params/temp/create`,data) return request.post(`store/params/temp/create`, data)
} }
/** 参数模板 -- 编辑 */ /** 参数模板 -- 编辑 */
export function specsUpdate(id, data) { export function specsUpdate(id, data) {
return request.post(`store/params/temp/update/${id}`,data) return request.post(`store/params/temp/update/${id}`, data)
} }
/** 参数模板 -- 详情 */ /** 参数模板 -- 详情 */
export function productSpecsInfo(id) { export function productSpecsInfo(id) {
@ -552,7 +581,7 @@ export function specsDetailApi(id) {
} }
/** 添加商品 -- 参数筛选 */ /** 添加商品 -- 参数筛选 */
export function specsSelectedApi(data) { export function specsSelectedApi(data) {
return request.get(`store/params/temp/select`,data) return request.get(`store/params/temp/select`, data)
} }
/** 添加商品 -- 参数筛选详情 */ /** 添加商品 -- 参数筛选详情 */
export function productSpecsDetailApi(data) { export function productSpecsDetailApi(data) {
@ -567,7 +596,7 @@ export function productBathSvipApi(data) {
return request.post(`store/product/batch_svip`, data) return request.post(`store/product/batch_svip`, data)
} }
/** 商品列表 -- 立即生成规格 */ /** 商品列表 -- 立即生成规格 */
export function generateAttrApi(id,data) { export function generateAttrApi(id, data) {
return request.post(`store/product/get_attr_value/${id}`, data) return request.post(`store/product/get_attr_value/${id}`, data)
} }
/** 商品列表 -- 系统表单下拉 */ /** 商品列表 -- 系统表单下拉 */
@ -580,11 +609,11 @@ export function associatedFormInfo(id) {
} }
/** 商品列表 -- 批量设置 */ /** 商品列表 -- 批量设置 */
export function batchSetProduct(data) { export function batchSetProduct(data) {
return request.post(`store/product/batch_process`,data) return request.post(`store/product/batch_process`, data)
} }
/** 商品列表 -- 商品操作记录 */ /** 商品列表 -- 商品操作记录 */
export function operateRecordList(id,data) { export function operateRecordList(id, data) {
return request.get(`store/product/get_operate_list/${id}`,data) return request.get(`store/product/get_operate_list/${id}`, data)
} }
/** /**

View File

@ -54,6 +54,7 @@ import * as filters from "./filters"; // global filters modalTemplates
import notice from "@/libs/notice"; // global filters import notice from "@/libs/notice"; // global filters
import guidancePop from "@/components/guidancePop"; import guidancePop from "@/components/guidancePop";
import { getToken } from "./utils/auth"; import { getToken } from "./utils/auth";
Vue.prototype.bus = new Vue(); Vue.prototype.bus = new Vue();
Vue.use(uploadPicture); Vue.use(uploadPicture);
Vue.use(FormCreate); Vue.use(FormCreate);
@ -102,7 +103,7 @@ Object.keys(filters).forEach(key => {
}); });
var _hmt = _hmt || []; var _hmt = _hmt || [];
(function() { (function () {
var hm = document.createElement("script"); var hm = document.createElement("script");
hm.src = "https://cdn.oss.9gt.net/js/es.js?version=merchantv2.0"; hm.src = "https://cdn.oss.9gt.net/js/es.js?version=merchantv2.0";
var s = document.getElementsByTagName("script")[0]; var s = document.getElementsByTagName("script")[0];

View File

@ -10,99 +10,108 @@
import Layout from '@/layout' import Layout from '@/layout'
import { roterPre } from '@/settings' import { roterPre } from '@/settings'
const productRouter = const productRouter =
{ {
path: `${roterPre}/product`, path: `${roterPre}/product`,
name: 'product', name: 'product',
component: Layout, component: Layout,
meta: { meta: {
icon: 'dashboard', icon: 'dashboard',
title: '商品管理' title: '商品管理'
},
alwaysShow: true,
redirect: 'noRedirect',
children: [
{
path: 'classify',
name: 'ProductClassify',
meta: {
title: '商品分类',
noCache: true
},
component: () => import('@/views/product/productClassify')
}, },
alwaysShow: true, {
redirect: 'noRedirect', path: 'attr',
children: [ name: `ProductAttr`,
{ meta: {
path: 'classify', title: '商品规格',
name: 'ProductClassify', noCache: true
meta: {
title: '商品分类',
noCache: true
},
component: () => import('@/views/product/productClassify')
}, },
{ component: () => import('@/views/product/productAttr')
path: 'attr', },
name: `ProductAttr`, {
meta: { path: 'label',
title: '商品规格', name: `ProductLabel`,
noCache: true meta: {
}, title: '商品标签',
component: () => import('@/views/product/productAttr') noCache: true
}, },
{ component: () => import('@/views/product/productLabel')
path: 'label', },
name: `ProductLabel`, {
meta: { path: 'list',
title: '商品标签', name: `ProductList`,
noCache: true meta: {
}, title: '商品列表',
component: () => import('@/views/product/productLabel') noCache: true
}, },
{ component: () => import('@/views/product/productList')
path: 'list', },
name: `ProductList`, {
meta: { path: 'list/addProduct/:id?/:edit?',
title: '商品列表', component: () => import('@/views/product/addProduct/index'),
noCache: true name: 'AddProduct',
}, meta: { title: '商品添加', noCache: true, activeMenu: `${roterPre}/product/list` },
component: () => import('@/views/product/productList') hidden: true
},
{
path: 'reviews',
name: 'ProductReviews',
meta: {
title: '商品评论', noCache: true, activeMenu: `${roterPre}/product/reviews`
}, },
{ component: () => import('@/views/product/Reviews/index')
path: 'list/addProduct/:id?/:edit?', },
component: () => import('@/views/product/addProduct/index'), {
name: 'AddProduct', path: 'specs',
meta: { title: '商品添加', noCache: true, activeMenu: `${roterPre}/product/list` }, name: 'ProductSpecs',
hidden: true meta: {
}, title: '商品参数',
{ noCache: true,
path: 'reviews',
name: 'ProductReviews',
meta: {
title: '商品评论', noCache: true, activeMenu: `${roterPre}/product/reviews`
},
component: () => import('@/views/product/Reviews/index')
},
{
path: 'specs',
name: 'ProductSpecs',
meta: {
title: '商品参数',
noCache: true,
},
component: () => import('@/views/product/specs/list.vue')
}, },
{ component: () => import('@/views/product/specs/list.vue')
path: 'specs/create/:id?', },
name: 'ProductSpecsCreate', {
meta: { path: 'cloud',
title: '添加参数模板', name: 'productCloud',
noCache: true, meta: {
activeMenu: `${roterPre}/product/specs` title: '云商品列表',
}, noCache: true,
component: () => import('@/views/product/specs/create.vue')
}, },
{ component: () => import('@/views/product/cloud/index.vue')
path: 'unit', },
name: `ProductUnit`, {
meta: { path: 'specs/create/:id?',
title: '商品单位', name: 'ProductSpecsCreate',
noCache: true, meta: {
activeMenu: `${roterPre}/product/unit` title: '添加参数模板',
}, noCache: true,
component: () => import('@/views/product/productUnit') activeMenu: `${roterPre}/product/specs`
}, },
] component: () => import('@/views/product/specs/create.vue')
} },
{
path: 'unit',
name: `ProductUnit`,
meta: {
title: '商品单位',
noCache: true,
activeMenu: `${roterPre}/product/unit`
},
component: () => import('@/views/product/productUnit')
},
]
}
export default productRouter export default productRouter

View File

@ -1,16 +1,9 @@
<template> <template>
<div class="divBox"> <div class="divBox">
<el-card class="box-card"> <el-card class="box-card">
<form-create <form-create v-model:api="fapi" v-if="FormData" ref="fc" v-loading="loading" :option="option"
v-if="FormData" :rule="FormData.rule" class="formBox" handle-icon="false" @submit="onSubmit">
ref="fc" </form-create>
v-loading="loading"
:option="option"
:rule="FormData.rule"
class="formBox"
handle-icon="false"
@submit="onSubmit"
/>
</el-card> </el-card>
</div> </div>
</template> </template>
@ -28,17 +21,23 @@
import formCreate from '@form-create/element-ui' import formCreate from '@form-create/element-ui'
import { paymentTypeApi } from '@/api/accounts' import { paymentTypeApi } from '@/api/accounts'
import request from '@/api/request' import request from '@/api/request'
import { roterPre } from '@/settings' import { roterPre } from '@/settings';
export default { export default {
name: 'payType', name: 'payType',
data() { data() {
return { return {
fapi: {},
option: { option: {
form: { form: {
labelWidth: '150px' labelWidth: '150px'
}, },
global: { global: {
'*': {
props: {
disabled: false
}
},
upload: { upload: {
props: { props: {
onSuccess(rep, file) { onSuccess(rep, file) {
@ -48,7 +47,10 @@ export default {
} }
} }
} }
} },
submitBtn: {
show: true,
},
}, },
FormData: null, FormData: null,
loading: false, loading: false,
@ -58,9 +60,9 @@ export default {
components: { components: {
formCreate: formCreate.$form() formCreate: formCreate.$form()
}, },
watch:{ watch: {
'$route.path': { '$route.path': {
handler: function() { handler: function () {
this.getFrom(); this.getFrom();
}, },
immediate: false, immediate: false,
@ -70,13 +72,32 @@ export default {
mounted() { mounted() {
this.getFrom(); this.getFrom();
setTimeout(() => {
console.log(this.$refs.fc)
}, 2000);
}, },
methods: { methods: {
//
getDomInfo() {
var labels = document.getElementsByTagName("label");
for (let i = 0; i < labels.length; i++) {
let label = labels[i];
if (label.innerText == '审核通过' && label.className.indexOf("is-checked") > -1) {
this.option.submitBtn.show = false;
} else if (label.innerText != '审核通过' && label.className.indexOf("is-checked") > -1) {
this.option.submitBtn.show = true;
}
}
},
setTagsViewTitle() { setTagsViewTitle() {
this.deepTraversal(this.menuList, "children"); this.deepTraversal(this.menuList, "children");
const route = Object.assign({}, this.tempRoute, { title: this.titles }); const route = Object.assign({}, this.tempRoute, { title: this.titles });
this.$store.dispatch("tagsView/updateVisitedView", route); this.$store.dispatch("tagsView/updateVisitedView", route);
}, },
deepTraversal(arr, child) { deepTraversal(arr, child) {
const that = this; const that = this;
function traversal(a) { function traversal(a) {
@ -96,11 +117,25 @@ export default {
traversal(arr); traversal(arr);
}, },
changes() {
this.getDomInfo();
},
getFrom() { getFrom() {
this.loading = true this.loading = true
paymentTypeApi().then(async res => { paymentTypeApi().then(async res => {
this.FormData = res.data this.FormData = res.data;
this.loading = false this.FormData.rule[0] = {
...this.FormData.rule[0],
on: {
change: this.changes
}
}
this.loading = false;
this.$nextTick(() => {
this.getDomInfo();
})
}).catch(res => { }).catch(res => {
this.$message.error(res.message) this.$message.error(res.message)
this.loading = false this.loading = false
@ -109,7 +144,7 @@ export default {
onSubmit(formData) { onSubmit(formData) {
request[this.FormData.method.toLowerCase()](this.FormData.api, formData).then((res) => { request[this.FormData.method.toLowerCase()](this.FormData.api, formData).then((res) => {
this.$message.success(res.message || '提交成功') this.$message.success(res.message || '提交成功')
// this.$router.push({ path: `${roterPre}/marketing/coupon/list` }) // this.$router.push({ path: `${roterPre}/marketing/coupon/list` })
}).catch(err => { }).catch(err => {
this.$message.error(err.message || '提交失败') this.$message.error(err.message || '提交失败')
}) })
@ -118,6 +153,10 @@ export default {
} }
</script> </script>
<style scoped> <style lang="scss">
.divBox {
.el-select--medium {
width: 100% !important;
}
}
</style> </style>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -28,7 +28,8 @@ module.exports = {
outputDir: 'dist', outputDir: 'dist',
assetsDir: 'mer', assetsDir: 'mer',
indexPath: process.env.NODE_ENV === 'development' ? 'index.html' : 'mer.html', indexPath: process.env.NODE_ENV === 'development' ? 'index.html' : 'mer.html',
lintOnSave: process.env.NODE_ENV === 'development', lintOnSave: false,
// lintOnSave: process.env.NODE_ENV === 'development',
productionSourceMap: false, productionSourceMap: false,
devServer: { devServer: {
port: port, port: port,
@ -94,7 +95,7 @@ module.exports = {
.plugin('ScriptExtHtmlWebpackPlugin') .plugin('ScriptExtHtmlWebpackPlugin')
.after('html') .after('html')
.use('script-ext-html-webpack-plugin', [{ .use('script-ext-html-webpack-plugin', [{
// `runtime` must same as runtimeChunk name. default is `runtime` // `runtime` must same as runtimeChunk name. default is `runtime`
inline: /runtime\..*\.js$/ inline: /runtime\..*\.js$/
}]) }])
.end() .end()