75ae810c418e2204be8683f869bdcc47.json 29 KB

1
  1. {"remainingRequest":"D:\\front\\item\\zyAdmin\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!D:\\front\\item\\zyAdmin\\src\\pages\\marketing\\storeIntegral\\create.vue?vue&type=style&index=0&id=280fafeb&lang=scss&scoped=true","dependencies":[{"path":"D:\\front\\item\\zyAdmin\\src\\pages\\marketing\\storeIntegral\\create.vue","mtime":1761614939038},{"path":"D:\\front\\item\\zyAdmin\\node_modules\\css-loader\\index.js","mtime":1761614929364},{"path":"D:\\front\\item\\zyAdmin\\node_modules\\vue-loader\\lib\\loaders\\stylePostLoader.js","mtime":1761614937403},{"path":"D:\\front\\item\\zyAdmin\\node_modules\\postcss-loader\\src\\index.js","mtime":1761614935133},{"path":"D:\\front\\item\\zyAdmin\\node_modules\\sass-loader\\dist\\cjs.js","mtime":1761614936391},{"path":"D:\\front\\item\\zyAdmin\\node_modules\\cache-loader\\dist\\cjs.js","mtime":1761614927801},{"path":"D:\\front\\item\\zyAdmin\\node_modules\\vue-loader\\lib\\index.js","mtime":1761614937402}],"contextDependencies":[],"result":[{"type":"Buffer","data":"base64:DQouY29udGVudF93aWR0aCB7DQogIHdpZHRoOiA0NjBweDsNCn0NCi5jdXN0b20tbGFiZWwgew0KICBkaXNwbGF5OiBpbmxpbmUtZmxleDsNCiAgbGluZS1oZWlnaHQ6IDEuNTsNCn0NCi5ncmV5IHsNCiAgY29sb3I6ICM5OTk7DQp9DQoubWF4VyA6OnYtZGVlcCAuaXZ1LXNlbGVjdC1kcm9wZG93biB7DQogIG1heC13aWR0aDogNjAwcHg7DQp9DQoudGFiQm94X2ltZyB7DQogIHdpZHRoOiA1MHB4Ow0KICBoZWlnaHQ6IDUwcHg7DQogIG1hcmdpbjogMCBhdXRvOw0KfQ0KLnRhYkJveF9pbWcgaW1nIHsNCiAgd2lkdGg6IDEwMCU7DQogIGhlaWdodDogMTAwJTsNCn0NCi5wcmljZUJveCB7DQogIHdpZHRoOiAxMDAlOw0KfQ0KLmZvcm0gew0KICAucGljQm94IHsNCiAgICBkaXNwbGF5OiBpbmxpbmUtYmxvY2s7DQogICAgY3Vyc29yOiBwb2ludGVyOw0KICB9DQogIC5waWN0cnVlIHsNCiAgICB3aWR0aDogNjBweDsNCiAgICBoZWlnaHQ6IDYwcHg7DQogICAgYm9yZGVyOiAxcHggZG90dGVkIHJnYmEoMCwgMCwgMCwgMC4xKTsNCiAgICBtYXJnaW4tcmlnaHQ6IDE1cHg7DQogICAgZGlzcGxheTogaW5saW5lLWJsb2NrOw0KICAgIHBvc2l0aW9uOiByZWxhdGl2ZTsNCiAgICBjdXJzb3I6IHBvaW50ZXI7DQoNCiAgICBpbWcgew0KICAgICAgd2lkdGg6IDEwMCU7DQogICAgICBoZWlnaHQ6IDEwMCU7DQogICAgfQ0KICAgIC5idG5kZWwgew0KICAgICAgcG9zaXRpb246IGFic29sdXRlOw0KICAgICAgei1pbmRleDogOTsNCiAgICAgIHdpZHRoOiAyMHB4ICFpbXBvcnRhbnQ7DQogICAgICBoZWlnaHQ6IDIwcHggIWltcG9ydGFudDsNCiAgICAgIGxlZnQ6IDQ2cHg7DQogICAgICB0b3A6IC00cHg7DQogICAgfQ0KICB9DQogIC51cExvYWQgew0KICAgIHdpZHRoOiA1OHB4Ow0KICAgIGhlaWdodDogNThweDsNCiAgICBsaW5lLWhlaWdodDogNThweDsNCiAgICBib3JkZXI6IDFweCBkb3R0ZWQgcmdiYSgwLCAwLCAwLCAwLjEpOw0KICAgIGJvcmRlci1yYWRpdXM6IDRweDsNCiAgICBiYWNrZ3JvdW5kOiByZ2JhKDAsIDAsIDAsIDAuMDIpOw0KICAgIGN1cnNvcjogcG9pbnRlcjsNCiAgfQ0KfQ0K"},{"version":3,"sources":["create.vue"],"names":[],"mappings":";AAurBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"create.vue","sourceRoot":"src/pages/marketing/storeIntegral","sourcesContent":["<template>\r\n <div>\r\n <pages-header\r\n ref=\"pageHeader\"\r\n :title=\"$route.params.id ? '编辑积分商品' : '添加积分商品'\"\r\n :backUrl=\"$routeProStr + '/marketing/store_integral/index'\"\r\n ></pages-header>\r\n <el-card :bordered=\"false\" shadow=\"never\" class=\"mt16\">\r\n <el-row class=\"mt30 acea-row row-middle row-center\" v-loading=\"spinShow\">\r\n <el-col :span=\"20\">\r\n <steps :stepList=\"stepList\" :isActive=\"current\"></steps>\r\n </el-col>\r\n <el-col :span=\"23\">\r\n <el-form\r\n class=\"form mt30\"\r\n ref=\"formValidate\"\r\n :model=\"formValidate\"\r\n :rules=\"ruleValidate\"\r\n @on-validate=\"validate\"\r\n :label-width=\"labelWidth\"\r\n :label-position=\"labelPosition\"\r\n @submit.native.prevent\r\n >\r\n <el-form-item label=\"选择商品:\" prop=\"image_input\" v-if=\"current === 0\">\r\n <div class=\"picBox\" v-db-click @click=\"changeGoods\">\r\n <div class=\"pictrue\" v-if=\"formValidate.image\">\r\n <img v-lazy=\"formValidate.image\" />\r\n </div>\r\n <div class=\"upLoad acea-row row-center-wrapper\" v-else>\r\n <i class=\"el-icon-goods\" style=\"font-size: 24px\"></i>\r\n </div>\r\n </div>\r\n </el-form-item>\r\n <el-col v-show=\"current === 1\">\r\n <el-col :span=\"24\">\r\n <el-form-item prop=\"image\">\r\n <div class=\"custom-label\" slot=\"label\">\r\n <div>\r\n <div>商品主图</div>\r\n <div>(750*750)</div>\r\n </div>\r\n <div>:</div>\r\n </div>\r\n <div class=\"picBox\" v-db-click @click=\"modalPicTap('dan', 'danFrom')\">\r\n <div class=\"pictrue\" v-if=\"formValidate.image\">\r\n <img v-lazy=\"formValidate.image\" />\r\n </div>\r\n <div class=\"upLoad acea-row row-center-wrapper\" v-else>\r\n <i class=\"el-icon-picture-outline\" style=\"font-size: 24px\"></i>\r\n </div>\r\n </div>\r\n </el-form-item>\r\n </el-col>\r\n <el-col :span=\"24\">\r\n <el-form-item prop=\"images\">\r\n <div class=\"custom-label\" slot=\"label\">\r\n <div>\r\n <div>商品轮播图</div>\r\n <div>(750*750)</div>\r\n </div>\r\n <div>:</div>\r\n </div>\r\n <div class=\"acea-row\">\r\n <div\r\n class=\"pictrue\"\r\n v-for=\"(item, index) in formValidate.images\"\r\n :key=\"index\"\r\n draggable=\"true\"\r\n @dragstart=\"handleDragStart($event, item)\"\r\n @dragover.prevent=\"handleDragOver($event, item)\"\r\n @dragenter=\"handleDragEnter($event, item)\"\r\n @dragend=\"handleDragEnd($event, item)\"\r\n >\r\n <img v-lazy=\"item\" />\r\n <i class=\"el-icon-circle-close btndel\" v-db-click @click=\"handleRemove(index)\"></i>\r\n </div>\r\n <div\r\n v-if=\"formValidate.images.length < 10\"\r\n class=\"upLoad acea-row row-center-wrapper\"\r\n v-db-click\r\n @click=\"modalPicTap('duo')\"\r\n >\r\n <i class=\"el-icon-picture-outline\" style=\"font-size: 24px\"></i>\r\n </div>\r\n </div>\r\n </el-form-item>\r\n </el-col>\r\n <el-col :span=\"24\">\r\n <el-col v-bind=\"grid\">\r\n <el-form-item label=\"商品标题:\" prop=\"title\" label-for=\"title\">\r\n <el-input\r\n placeholder=\"请输入商品标题\"\r\n v-model=\"formValidate.title\"\r\n class=\"content_width\"\r\n maxlength=\"80\"\r\n show-word-limit\r\n />\r\n </el-form-item>\r\n </el-col>\r\n </el-col>\r\n <el-col :span=\"24\">\r\n <el-form-item label=\"用户兑换数量限制:\" prop=\"num\">\r\n <div class=\"acea-row row-middle\">\r\n <el-input-number\r\n :controls=\"false\"\r\n :min=\"1\"\r\n :max=\"9999999999\"\r\n placeholder=\"请输入数量限制\"\r\n element-id=\"num\"\r\n :precision=\"0\"\r\n v-model=\"formValidate.num\"\r\n class=\"content_width\"\r\n />\r\n <div class=\"ml10 grey\">\r\n 每个用户可购买该商品总数限制。例如设置为4,表示本活动,每个用户最多可兑换总数4个\r\n </div>\r\n </div>\r\n </el-form-item>\r\n </el-col>\r\n <el-col :span=\"24\">\r\n <el-form-item label=\"单位:\" prop=\"unit_name\" label-for=\"unit_name\">\r\n <el-input\r\n placeholder=\"请输入单位\"\r\n element-id=\"unit_name\"\r\n v-model=\"formValidate.unit_name\"\r\n class=\"content_width\"\r\n />\r\n </el-form-item>\r\n </el-col>\r\n\r\n <el-col :span=\"24\">\r\n <el-form-item label=\"排序:\">\r\n <el-input-number\r\n :controls=\"false\"\r\n placeholder=\"请输入排序\"\r\n element-id=\"sort\"\r\n :precision=\"0\"\r\n v-model=\"formValidate.sort\"\r\n class=\"content_width\"\r\n />\r\n </el-form-item>\r\n </el-col>\r\n <el-col :span=\"24\">\r\n <el-form-item label=\"上架状态:\" props=\"is_show\" label-for=\"status\">\r\n <el-radio-group element-id=\"is_show\" v-model=\"formValidate.is_show\">\r\n <el-radio :label=\"1\" class=\"radio\">开启</el-radio>\r\n <el-radio :label=\"0\">关闭</el-radio>\r\n </el-radio-group>\r\n </el-form-item>\r\n </el-col>\r\n <el-col v-bind=\"grid2\">\r\n <el-form-item label=\"热门推荐:\" props=\"is_host\" label-for=\"is_host\">\r\n <el-radio-group element-id=\"is_host\" v-model=\"formValidate.is_host\">\r\n <el-radio :label=\"1\" class=\"radio\">开启</el-radio>\r\n <el-radio :label=\"0\">关闭</el-radio>\r\n </el-radio-group>\r\n </el-form-item>\r\n </el-col>\r\n <el-col :span=\"24\">\r\n <el-form-item label=\"规格选择:\">\r\n <el-table\r\n ref=\"multipleTable\"\r\n :data=\"specsData\"\r\n border\r\n :row-key=\"getRowKeys\"\r\n class=\"mt14\"\r\n highlight-current-row\r\n @selection-change=\"changeCheckbox\"\r\n >\r\n <el-table-column type=\"selection\" :reserve-selection=\"true\" width=\"55\"> </el-table-column>\r\n <el-table-column\r\n :label=\"item.title\"\r\n :min-width=\"item.minWidth\"\r\n v-for=\"(item, index) in columns\"\r\n :key=\"index\"\r\n >\r\n <template slot-scope=\"scope\">\r\n <template v-if=\"item.key\">\r\n <div>\r\n <span>{{ scope.row[item.key] }}</span>\r\n </div>\r\n </template>\r\n <template v-else-if=\"item.slot === 'pic'\">\r\n <div\r\n class=\"acea-row row-middle row-center-wrapper\"\r\n v-db-click\r\n @click=\"modalPicTap('dan', 'danTable', scope.$index)\"\r\n >\r\n <div class=\"pictrue pictrueTab\" v-if=\"scope.row.pic\">\r\n <img v-lazy=\"scope.row.pic\" />\r\n </div>\r\n <div class=\"upLoad pictrueTab acea-row row-center-wrapper\" v-else>\r\n <i class=\"el-icon-picture-outline\" style=\"font-size: 24px\"></i>\r\n </div>\r\n </div>\r\n </template>\r\n <template v-else-if=\"item.slot === 'price'\">\r\n <el-input-number\r\n :controls=\"false\"\r\n v-model=\"scope.row.price\"\r\n :min=\"0\"\r\n :precision=\"0\"\r\n class=\"priceBox\"\r\n :active-change=\"false\"\r\n ></el-input-number>\r\n </template>\r\n <template v-else-if=\"item.slot === 'quota'\">\r\n <el-input-number\r\n :controls=\"false\"\r\n v-model=\"scope.row.quota\"\r\n :min=\"1\"\r\n :max=\"scope.row.stock\"\r\n active-change\r\n class=\"priceBox\"\r\n ></el-input-number>\r\n </template>\r\n </template>\r\n </el-table-column>\r\n </el-table>\r\n </el-form-item>\r\n </el-col>\r\n </el-col>\r\n <el-row v-show=\"current === 2\">\r\n <el-col :span=\"24\">\r\n <el-form-item label=\"内容:\">\r\n <WangEditor\r\n style=\"width: 90%\"\r\n :content=\"formValidate.description\"\r\n @editorContent=\"getEditorContent\"\r\n ></WangEditor>\r\n </el-form-item>\r\n </el-col>\r\n </el-row>\r\n <el-col :span=\"24\">\r\n <el-form-item>\r\n <el-button\r\n class=\"submission\"\r\n v-db-click\r\n @click=\"step\"\r\n :disabled=\"($route.params.id && current === 1) || current === 0\"\r\n >上一步\r\n </el-button>\r\n <el-button\r\n :disabled=\"submitOpen && current === 2\"\r\n type=\"primary\"\r\n class=\"submission\"\r\n v-db-click\r\n @click=\"next('formValidate')\"\r\n >{{ current === 2 ? '提交' : '下一步' }}</el-button\r\n >\r\n </el-form-item>\r\n </el-col>\r\n </el-form>\r\n </el-col>\r\n </el-row>\r\n </el-card>\r\n <!-- 选择商品-->\r\n <el-dialog :visible.sync=\"modals\" title=\"商品列表\" class=\"paymentFooter\" width=\"1000px\">\r\n <goods-list ref=\"goodslist\" @getProductId=\"getProductId\"></goods-list>\r\n </el-dialog>\r\n <!-- 上传图片-->\r\n <el-dialog :visible.sync=\"modalPic\" width=\"950px\" title=\"上传商品图\" :close-on-click-modal=\"false\">\r\n <uploadPictures\r\n :isChoice=\"isChoice\"\r\n @getPic=\"getPic\"\r\n @getPicD=\"getPicD\"\r\n :gridBtn=\"gridBtn\"\r\n :gridPic=\"gridPic\"\r\n v-if=\"modalPic\"\r\n ></uploadPictures>\r\n </el-dialog>\r\n </div>\r\n</template>\r\n\r\n<script>\r\nimport { mapState } from 'vuex';\r\nimport goodsList from '@/components/goodsList/index';\r\nimport WangEditor from '@/components/wangEditor/index.vue';\r\nimport uploadPictures from '@/components/uploadPictures';\r\nimport { integralAddApi, productAttrsApi, integralInfoApi } from '@/api/marketing';\r\nimport steps from '@/components/steps/index';\r\n\r\nexport default {\r\n name: 'storeIntegralCreate',\r\n components: { goodsList, uploadPictures, WangEditor, steps },\r\n data() {\r\n return {\r\n submitOpen: false,\r\n spinShow: false,\r\n isChoice: '',\r\n current: 0,\r\n modalPic: false,\r\n grid: {\r\n xl: 12,\r\n lg: 20,\r\n md: 24,\r\n sm: 24,\r\n xs: 24,\r\n },\r\n grid2: {\r\n xl: 8,\r\n lg: 12,\r\n md: 12,\r\n sm: 24,\r\n xs: 24,\r\n },\r\n gridPic: {\r\n xl: 6,\r\n lg: 8,\r\n md: 12,\r\n sm: 12,\r\n xs: 12,\r\n },\r\n gridBtn: {\r\n xl: 4,\r\n lg: 8,\r\n md: 8,\r\n sm: 8,\r\n xs: 8,\r\n },\r\n myConfig: {\r\n autoHeightEnabled: false, // 编辑器不自动被内容撑高\r\n initialFrameHeight: 500, // 初始容器高度\r\n initialFrameWidth: '100%', // 初始容器宽度\r\n UEDITOR_HOME_URL: '/UEditor/',\r\n serverUrl: '',\r\n },\r\n stepList: ['选择积分商品', '填写基础信息', '修改商品详情'],\r\n modals: false,\r\n modal_loading: false,\r\n images: [],\r\n formValidate: {\r\n images: [],\r\n info: '',\r\n title: '',\r\n image: '',\r\n unit_name: '',\r\n price: 0,\r\n ot_price: 0,\r\n cost: 0,\r\n sales: 0,\r\n stock: 0,\r\n sort: 0,\r\n num: 1,\r\n once_num: 1,\r\n give_integral: 0,\r\n postage: 0,\r\n section_time: [],\r\n is_postage: 0,\r\n is_hot: 0,\r\n status: 0,\r\n description: '',\r\n id: 0,\r\n product_id: 0,\r\n temp_id: '',\r\n time_id: '',\r\n attrs: [],\r\n items: [],\r\n },\r\n description: '',\r\n templateList: [],\r\n timeList: [],\r\n columns: [],\r\n specsData: [],\r\n picTit: '',\r\n tableIndex: 0,\r\n ruleValidate: {\r\n image: [{ required: true, message: '请选择主图', trigger: 'change' }],\r\n images: [\r\n {\r\n required: true,\r\n type: 'array',\r\n message: '请选择主图',\r\n trigger: 'change',\r\n },\r\n {\r\n type: 'array',\r\n min: 1,\r\n message: 'Choose two hobbies at best',\r\n trigger: 'change',\r\n },\r\n ],\r\n title: [{ required: true, message: '请输入商品标题', trigger: 'blur' }],\r\n info: [{ required: true, message: '请输入积分活动简介', trigger: 'blur' }],\r\n unit_name: [{ required: true, message: '请输入单位', trigger: 'blur' }],\r\n price: [\r\n {\r\n required: true,\r\n type: 'number',\r\n message: '请输入兑换积分',\r\n trigger: 'blur',\r\n },\r\n ],\r\n ot_price: [\r\n {\r\n required: true,\r\n type: 'number',\r\n message: '请输入原价',\r\n trigger: 'blur',\r\n },\r\n ],\r\n cost: [\r\n {\r\n required: true,\r\n type: 'number',\r\n message: '请输入成本价',\r\n trigger: 'blur',\r\n },\r\n ],\r\n stock: [\r\n {\r\n required: true,\r\n type: 'number',\r\n message: '请输入库存',\r\n trigger: 'blur',\r\n },\r\n ],\r\n num: [\r\n {\r\n required: true,\r\n type: 'number',\r\n message: '请输入兑换数量限制',\r\n trigger: 'blur',\r\n },\r\n ],\r\n once_num: [\r\n {\r\n required: true,\r\n type: 'number',\r\n message: '请输入单次兑换数量限制',\r\n trigger: 'blur',\r\n },\r\n ],\r\n },\r\n copy: 0,\r\n };\r\n },\r\n computed: {\r\n ...mapState('media', ['isMobile']),\r\n labelWidth() {\r\n return this.isMobile ? undefined : '135px';\r\n },\r\n labelPosition() {\r\n return this.isMobile ? 'top' : 'right';\r\n },\r\n },\r\n mounted() {\r\n if (this.$route.params.id) {\r\n this.copy = this.$route.params.copy;\r\n this.current = 1;\r\n this.getInfo();\r\n }\r\n },\r\n methods: {\r\n getEditorContent(data) {\r\n this.description = data;\r\n },\r\n // 规格;\r\n productAttrs(rows) {\r\n let that = this;\r\n productAttrsApi(rows.id, 4)\r\n .then((res) => {\r\n let data = res.data.info;\r\n that.specsData = data.attrs;\r\n that.specsData.forEach(function (item, index) {\r\n that.$set(that.specsData[index], 'id', index);\r\n });\r\n that.formValidate.items = data.items;\r\n that.columns = data.header;\r\n })\r\n .catch((res) => {\r\n that.$message.error(res.msg);\r\n });\r\n },\r\n // 多选\r\n changeCheckbox(selection) {\r\n this.formValidate.attrs = selection;\r\n },\r\n // 表单验证\r\n validate(prop, status, error) {\r\n if (status === false) {\r\n this.$message.error(error);\r\n }\r\n },\r\n // 商品id\r\n getProductId(row) {\r\n this.modal_loading = false;\r\n this.modals = false;\r\n setTimeout(() => {\r\n this.formValidate = {\r\n images: row.slider_image,\r\n info: row.store_info,\r\n title: row.store_name,\r\n image: row.image,\r\n unit_name: row.unit_name,\r\n price: 0, // 不取商品中的原价\r\n ot_price: row.ot_price,\r\n cost: row.cost,\r\n sales: row.sales,\r\n stock: row.stock,\r\n sort: row.sort,\r\n num: 1,\r\n once_num: 1,\r\n give_integral: row.give_integral,\r\n postage: row.postage,\r\n section_time: [],\r\n is_postage: row.is_postage,\r\n is_host: 0,\r\n is_show: 1,\r\n description: '',\r\n id: 0,\r\n product_id: row.id,\r\n temp_id: row.temp_id,\r\n };\r\n this.productAttrs(row);\r\n this.$refs.goodslist.productRow = null;\r\n }, 500);\r\n },\r\n\r\n cancel() {\r\n this.modals = false;\r\n },\r\n // 具体日期\r\n onchangeTime(e) {\r\n this.formValidate.section_time = e;\r\n },\r\n // 详情\r\n getInfo() {\r\n this.spinShow = true;\r\n integralInfoApi(this.$route.params.id)\r\n .then(async (res) => {\r\n let that = this;\r\n let info = res.data.info;\r\n this.formValidate = info;\r\n this.$set(this.formValidate, 'items', info.attrs.items);\r\n this.columns = info.attrs.header;\r\n this.specsData = info.attrs.value;\r\n that.specsData.forEach(function (item, index) {\r\n that.$set(that.specsData[index], 'id', index);\r\n });\r\n let data = info.attrs;\r\n let attr = [];\r\n for (let index in info.attrs.value) {\r\n if (info.attrs.value[index]._checked) {\r\n attr.push(info.attrs.value[index]);\r\n }\r\n }\r\n that.formValidate.attrs = attr;\r\n attr.forEach((row) => {\r\n that.$refs.multipleTable.toggleRowSelection(row, true);\r\n });\r\n this.spinShow = false;\r\n })\r\n .catch((res) => {\r\n this.spinShow = false;\r\n this.$message.error(res.msg);\r\n });\r\n },\r\n getRowKeys(row) {\r\n return row.id;\r\n },\r\n // 下一步\r\n next(name) {\r\n let that = this;\r\n if (this.current === 2) {\r\n this.formValidate.description = this.description;\r\n this.$refs[name].validate((valid) => {\r\n if (valid) {\r\n if (this.copy == 1) this.formValidate.copy = 1;\r\n this.formValidate.id = Number(this.$route.params.id) || 0;\r\n this.submitOpen = true;\r\n integralAddApi(this.formValidate)\r\n .then(async (res) => {\r\n this.submitOpen = false;\r\n this.$message.success(res.msg);\r\n setTimeout(() => {\r\n this.$router.push({\r\n path: this.$routeProStr + '/marketing/store_integral/index',\r\n });\r\n }, 500);\r\n })\r\n .catch((res) => {\r\n this.submitOpen = false;\r\n this.$message.error(res.msg);\r\n });\r\n } else {\r\n return false;\r\n }\r\n });\r\n } else if (this.current === 1) {\r\n this.$refs[name].validate((valid) => {\r\n if (valid) {\r\n if (!that.formValidate.attrs) {\r\n return that.$message.error('请选择属性规格');\r\n } else {\r\n for (let index in that.formValidate.attrs) {\r\n if (that.formValidate.attrs[index].quota <= 0) {\r\n return that.$message.error('兑换次数必须大于0');\r\n }\r\n }\r\n }\r\n this.current += 1;\r\n } else {\r\n return this.$message.warning('请完善您的信息');\r\n }\r\n });\r\n } else {\r\n if (this.formValidate.image) {\r\n this.current += 1;\r\n } else {\r\n this.$message.warning('请选择商品');\r\n }\r\n }\r\n },\r\n // 上一步\r\n step() {\r\n this.current--;\r\n },\r\n // 内容\r\n getContent(val) {\r\n this.formValidate.description = val;\r\n },\r\n // 点击商品图\r\n modalPicTap(tit, picTit, index) {\r\n this.modalPic = true;\r\n this.isChoice = tit === 'dan' ? '单选' : '多选';\r\n this.picTit = picTit;\r\n this.tableIndex = index;\r\n },\r\n // 获取单张图片信息\r\n getPic(pc) {\r\n switch (this.picTit) {\r\n case 'danFrom':\r\n this.formValidate.image = pc.att_dir;\r\n break;\r\n // case 'danTable':\r\n // this.specsData[this.tableIndex].pic = pc.att_dir;\r\n // break;\r\n default:\r\n if (!!this.formValidate.attrs && this.formValidate.attrs.length) {\r\n this.$set(this.specsData[this.tableIndex], '_checked', true);\r\n }\r\n this.specsData[this.tableIndex].pic = pc.att_dir;\r\n }\r\n this.modalPic = false;\r\n },\r\n // 获取多张图信息\r\n getPicD(pc) {\r\n this.images = pc;\r\n this.images.map((item) => {\r\n this.formValidate.images.push(item.att_dir);\r\n this.formValidate.images = this.formValidate.images.splice(0, 10);\r\n });\r\n this.modalPic = false;\r\n },\r\n handleRemove(i) {\r\n this.images.splice(i, 1);\r\n this.formValidate.images.splice(i, 1);\r\n },\r\n // 选择商品\r\n changeGoods() {\r\n this.modals = true;\r\n this.$nextTick((e) => {\r\n this.$refs.goodslist.formValidate.is_show = -1;\r\n this.$refs.goodslist.formValidate.type = 7;\r\n this.$refs.goodslist.getList();\r\n this.$refs.goodslist.goodsCategory();\r\n });\r\n }, // 移动\r\n handleDragStart(e, item) {\r\n this.dragging = item;\r\n },\r\n handleDragEnd(e, item) {\r\n this.dragging = null;\r\n },\r\n // 首先把div变成可以放置的元素,即重写dragenter/dragover\r\n handleDragOver(e) {\r\n e.dataTransfer.dropEffect = 'move'; // e.dataTransfer.dropEffect=\"move\";//在dragenter中针对放置目标来设置!\r\n },\r\n handleDragEnter(e, item) {\r\n e.dataTransfer.effectAllowed = 'move'; // 为需要移动的元素设置dragstart事件\r\n if (item === this.dragging) {\r\n return;\r\n }\r\n const newItems = [...this.formValidate.images];\r\n const src = newItems.indexOf(this.dragging);\r\n const dst = newItems.indexOf(item);\r\n newItems.splice(dst, 0, ...newItems.splice(src, 1));\r\n this.formValidate.images = newItems;\r\n },\r\n },\r\n};\r\n</script>\r\n\r\n<style lang=\"scss\" scoped>\r\n.content_width {\r\n width: 460px;\r\n}\r\n.custom-label {\r\n display: inline-flex;\r\n line-height: 1.5;\r\n}\r\n.grey {\r\n color: #999;\r\n}\r\n.maxW ::v-deep .ivu-select-dropdown {\r\n max-width: 600px;\r\n}\r\n.tabBox_img {\r\n width: 50px;\r\n height: 50px;\r\n margin: 0 auto;\r\n}\r\n.tabBox_img img {\r\n width: 100%;\r\n height: 100%;\r\n}\r\n.priceBox {\r\n width: 100%;\r\n}\r\n.form {\r\n .picBox {\r\n display: inline-block;\r\n cursor: pointer;\r\n }\r\n .pictrue {\r\n width: 60px;\r\n height: 60px;\r\n border: 1px dotted rgba(0, 0, 0, 0.1);\r\n margin-right: 15px;\r\n display: inline-block;\r\n position: relative;\r\n cursor: pointer;\r\n\r\n img {\r\n width: 100%;\r\n height: 100%;\r\n }\r\n .btndel {\r\n position: absolute;\r\n z-index: 9;\r\n width: 20px !important;\r\n height: 20px !important;\r\n left: 46px;\r\n top: -4px;\r\n }\r\n }\r\n .upLoad {\r\n width: 58px;\r\n height: 58px;\r\n line-height: 58px;\r\n border: 1px dotted rgba(0, 0, 0, 0.1);\r\n border-radius: 4px;\r\n background: rgba(0, 0, 0, 0.02);\r\n cursor: pointer;\r\n }\r\n}\r\n</style>\r\n"]}]}