This commit is contained in:
DESKTOP-GMUNQ1B\k 2024-04-10 17:08:27 +08:00
parent 46b6d92a36
commit e52f05a384
8 changed files with 406 additions and 355 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

@ -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

@ -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>

View File

@ -13,8 +13,8 @@
<el-col :span="24"> <el-col :span="24">
<el-form-item label="商品类型:" required> <el-form-item label="商品类型:" required>
<div v-for="(item, index) in virtual" :key="index" class="virtual" :class="formValidate.type == item.id <div v-for="(item, index) in virtual" :key="index" class="virtual" :class="formValidate.type == item.id
? 'virtual_boder' ? 'virtual_boder'
: 'virtual_boder2' : 'virtual_boder2'
" @click="virtualbtn(item.id, 2)"> " @click="virtualbtn(item.id, 2)">
<div class="virtual_top">{{ item.tit }}</div> <div class="virtual_top">{{ item.tit }}</div>
<div class="virtual_bottom">({{ item.tit2 }})</div> <div class="virtual_bottom">({{ item.tit2 }})</div>
@ -275,8 +275,8 @@
<el-input v-if="formThead[iii].title !== '付费会员价' && <el-input v-if="formThead[iii].title !== '付费会员价' &&
formThead[iii].title !== '商品编号' && formThead[iii].title !== '商品编号' &&
formThead[iii].title !== '库存' formThead[iii].title !== '库存'
" v-model="scope.row[iii]" type="number" min="0" size="small" class="priceBox" " v-model="scope.row[iii]" type="number" min="0" size="small" class="priceBox" controls-position="right"
controls-position="right" @blur="memberPrice(formThead[iii], scope.row)" /> @blur="memberPrice(formThead[iii], scope.row)" />
<el-input v-if="formThead[iii].title === '库存' && formValidate.type == 2" v-model="scope.row[iii]" <el-input v-if="formThead[iii].title === '库存' && formValidate.type == 2" v-model="scope.row[iii]"
type="text" size="small" class="priceBox" disabled /> type="text" size="small" class="priceBox" disabled />
<el-input v-else-if="formThead[iii].title === '库存' && formValidate.type != 2" <el-input v-else-if="formThead[iii].title === '库存' && formValidate.type != 2"
@ -635,8 +635,8 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col v-if="(formValidate.delivery_way.length == 2 || <el-col v-if="(formValidate.delivery_way.length == 2 ||
(formValidate.delivery_way.length == 1 && (formValidate.delivery_way.length == 1 &&
formValidate.delivery_way[0] == 2)) && formValidate.delivery_way[0] == 2)) &&
formValidate.type == 0 formValidate.type == 0
" :span="24"> " :span="24">
<el-form-item label="是否包邮:"> <el-form-item label="是否包邮:">
@ -2538,9 +2538,9 @@ export default {
if (!this.formValidate.cate_id) { if (!this.formValidate.cate_id) {
return this.$message.warning("基本信息-平台商品分类不能为空"); return this.$message.warning("基本信息-平台商品分类不能为空");
} }
// if (!this.formValidate.mer_cate_id) { if (!this.formValidate.mer_cate_id) {
// return this.$message.warning("-"); return this.$message.warning("基本信息-商户商品分类不能为空");
// } }
if (!this.formValidate.image) { if (!this.formValidate.image) {
return this.$message.warning("基本信息-商品封面图不能为空"); return this.$message.warning("基本信息-商品封面图不能为空");
} }

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()