|
@@ -5,20 +5,49 @@
|
|
<el-divider></el-divider>
|
|
<el-divider></el-divider>
|
|
|
|
|
|
<div class="form-container">
|
|
<div class="form-container">
|
|
- <el-form ref="mainForm" :model="mainForm" :rules="mainFormRules">
|
|
|
|
|
|
+ <el-form ref="mainForm" :model="mainForm">
|
|
|
|
+ <template v-if="type == 10 || type == 11 || type == 12">
|
|
|
|
+ <el-form-item :label="'活动专区主标题:'" prop="title1">
|
|
|
|
+ <el-input
|
|
|
|
+ v-model="mainForm.title1"
|
|
|
|
+ placeholder="请输入活动专区主标题"
|
|
|
|
+ style="width: 300px"
|
|
|
|
+ maxlength="6"
|
|
|
|
+ show-word-limit
|
|
|
|
+ ></el-input>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item :label="'活动专区副标题:'" prop="title2">
|
|
|
|
+ <el-input
|
|
|
|
+ v-model="mainForm.title2"
|
|
|
|
+ placeholder="请输入活动专区副标题"
|
|
|
|
+ style="width: 300px"
|
|
|
|
+ maxlength="6"
|
|
|
|
+ show-word-limit
|
|
|
|
+ ></el-input>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </template>
|
|
|
|
+
|
|
<el-upload
|
|
<el-upload
|
|
class="avatar-uploader"
|
|
class="avatar-uploader"
|
|
:action="baseURL + 'common/upload'"
|
|
:action="baseURL + 'common/upload'"
|
|
:headers="myHeaders"
|
|
:headers="myHeaders"
|
|
:show-file-list="false"
|
|
:show-file-list="false"
|
|
:on-success="uploadSuccess"
|
|
:on-success="uploadSuccess"
|
|
- :before-upload="beforeUpload">
|
|
|
|
|
|
+ :before-upload="beforeUpload"
|
|
|
|
+ style="height: 0"
|
|
|
|
+ >
|
|
</el-upload>
|
|
</el-upload>
|
|
<el-form-item :label="'活动专区图片:'" prop="img1_url">
|
|
<el-form-item :label="'活动专区图片:'" prop="img1_url">
|
|
<div class="images">
|
|
<div class="images">
|
|
<div class="main-img">
|
|
<div class="main-img">
|
|
- <div class="img" v-if="img1_url" @mouseover="img1_hover = true;" @mouseout="img1_hover = false;">
|
|
|
|
- <el-image ref="img1" :src="img1_url" :preview-src-list="[img1_url]" style="width: 120px; height: 120px" fit="contain"></el-image>
|
|
|
|
|
|
+ <div class="img" v-if="img1_url" @mouseover="img1_hover = true" @mouseout="img1_hover = false">
|
|
|
|
+ <el-image
|
|
|
|
+ ref="img1"
|
|
|
|
+ :src="img1_url"
|
|
|
|
+ :preview-src-list="[img1_url]"
|
|
|
|
+ style="width: 120px; height: 120px"
|
|
|
|
+ fit="contain"
|
|
|
|
+ ></el-image>
|
|
<div class="mask" v-show="img1_hover">
|
|
<div class="mask" v-show="img1_hover">
|
|
<i class="el-icon-zoom-in" @click="previewImage('img1')"></i>
|
|
<i class="el-icon-zoom-in" @click="previewImage('img1')"></i>
|
|
<i class="el-icon-upload2" @click="uploadImage('img1')"></i>
|
|
<i class="el-icon-upload2" @click="uploadImage('img1')"></i>
|
|
@@ -30,15 +59,21 @@
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="tips">
|
|
<div class="tips">
|
|
- <span>尺寸比例为:{{ratio}}</span>
|
|
|
|
|
|
+ <span>尺寸比例为:{{ ratio }}</span>
|
|
</div>
|
|
</div>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
|
|
|
<el-form-item :label="'活动专区表头图片:'">
|
|
<el-form-item :label="'活动专区表头图片:'">
|
|
<div class="images">
|
|
<div class="images">
|
|
<div class="main-img">
|
|
<div class="main-img">
|
|
- <div class="img" v-if="img2_url" @mouseover="img2_hover = true;" @mouseout="img2_hover = false;">
|
|
|
|
- <el-image ref="img2" :src="img2_url" :preview-src-list="[img2_url]" style="width: 120px; height: 120px" fit="contain"></el-image>
|
|
|
|
|
|
+ <div class="img" v-if="img2_url" @mouseover="img2_hover = true" @mouseout="img2_hover = false">
|
|
|
|
+ <el-image
|
|
|
|
+ ref="img2"
|
|
|
|
+ :src="img2_url"
|
|
|
|
+ :preview-src-list="[img2_url]"
|
|
|
|
+ style="width: 120px; height: 120px"
|
|
|
|
+ fit="contain"
|
|
|
|
+ ></el-image>
|
|
<div class="mask" v-show="img2_hover">
|
|
<div class="mask" v-show="img2_hover">
|
|
<i class="el-icon-zoom-in" @click="previewImage('img2')"></i>
|
|
<i class="el-icon-zoom-in" @click="previewImage('img2')"></i>
|
|
<i class="el-icon-upload2" @click="uploadImage('img2')"></i>
|
|
<i class="el-icon-upload2" @click="uploadImage('img2')"></i>
|
|
@@ -54,36 +89,13 @@
|
|
<span>尺寸比例为:750*800</span>
|
|
<span>尺寸比例为:750*800</span>
|
|
</div>
|
|
</div>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
-
|
|
|
|
- <el-form-item :label="'活动分享图片:'">
|
|
|
|
- <div class="images">
|
|
|
|
- <div class="main-img">
|
|
|
|
- <div class="img" v-if="img3_url" @mouseover="img3_hover = true;" @mouseout="img3_hover = false;">
|
|
|
|
- <el-image ref="img3" :src="img3_url" :preview-src-list="[img3_url]" style="width: 120px; height: 120px" fit="contain"></el-image>
|
|
|
|
- <div class="mask" v-show="img3_hover">
|
|
|
|
- <i class="el-icon-zoom-in" @click="previewImage('img3')"></i>
|
|
|
|
- <i class="el-icon-upload2" @click="uploadImage('img3')"></i>
|
|
|
|
- <i class="el-icon-delete" @click="deleteImage('img3')"></i>
|
|
|
|
- </div>
|
|
|
|
- </div>
|
|
|
|
- <div class="add" v-else @click="uploadImage('img3')">
|
|
|
|
- <i class="el-icon-plus avatar-uploader-icon"></i>
|
|
|
|
- </div>
|
|
|
|
- </div>
|
|
|
|
- </div>
|
|
|
|
- <div class="tips">
|
|
|
|
- <span>尺寸比例为:750*750</span>
|
|
|
|
- </div>
|
|
|
|
- </el-form-item>
|
|
|
|
<el-form-item :label="'活动专区背景颜色:'" prop="backGroundColor">
|
|
<el-form-item :label="'活动专区背景颜色:'" prop="backGroundColor">
|
|
<div style="display: flex">
|
|
<div style="display: flex">
|
|
- <el-color-picker v-model="mainForm.backGroundColor">
|
|
|
|
- </el-color-picker>
|
|
|
|
|
|
+ <el-color-picker v-model="mainForm.backGroundColor"> </el-color-picker>
|
|
<el-button style="margin-left: 20px" @click="resetFn">重置</el-button>
|
|
<el-button style="margin-left: 20px" @click="resetFn">重置</el-button>
|
|
</div>
|
|
</div>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-form>
|
|
</el-form>
|
|
-
|
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<div class="btn-group">
|
|
<div class="btn-group">
|
|
@@ -108,25 +120,33 @@
|
|
<div class="blank">操作</div>
|
|
<div class="blank">操作</div>
|
|
</div>
|
|
</div>
|
|
<div class="goods-item" v-for="(item, index) in goodsList" :key="index">
|
|
<div class="goods-item" v-for="(item, index) in goodsList" :key="index">
|
|
- <div class="goods-info" >
|
|
|
|
|
|
+ <div class="goods-info">
|
|
<img :src="item.imgUrl" alt="" />
|
|
<img :src="item.imgUrl" alt="" />
|
|
{{ item.goodsName }}
|
|
{{ item.goodsName }}
|
|
</div>
|
|
</div>
|
|
<div class="spec-list">
|
|
<div class="spec-list">
|
|
<div class="spec-item" v-for="(it, idx) in item.goodsSpecs" :key="idx">
|
|
<div class="spec-item" v-for="(it, idx) in item.goodsSpecs" :key="idx">
|
|
- <div class="col name">{{it.name}}-{{it.specValue}}</div>
|
|
|
|
|
|
+ <div class="col name">{{ it.name }}-{{ it.specValue }}</div>
|
|
<div class="col input"><el-input disabled type="number" size="small" v-model="it.orgPrice"></el-input></div>
|
|
<div class="col input"><el-input disabled type="number" size="small" v-model="it.orgPrice"></el-input></div>
|
|
<div class="col input"><el-input disabled type="number" size="small" v-model="it.price"></el-input></div>
|
|
<div class="col input"><el-input disabled type="number" size="small" v-model="it.price"></el-input></div>
|
|
- <div class="col input"><el-input disabled type="number" size="small" v-model="it.shareAmount"></el-input></div>
|
|
|
|
- <div class="col input"><el-input disabled type="number" size="small" v-model="it.innerSharePercent"></el-input></div>
|
|
|
|
- <div class="col input"><el-input disabled type="number" size="small" v-model="it.innerShareAmount"></el-input></div>
|
|
|
|
- <div class="col input"><el-input disabled type="number" size="small" v-model="it.innerSharePercent"></el-input></div>
|
|
|
|
|
|
+ <div class="col input">
|
|
|
|
+ <el-input disabled type="number" size="small" v-model="it.shareAmount"></el-input>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="col input">
|
|
|
|
+ <el-input disabled type="number" size="small" v-model="it.innerSharePercent"></el-input>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="col input">
|
|
|
|
+ <el-input disabled type="number" size="small" v-model="it.innerShareAmount"></el-input>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="col input">
|
|
|
|
+ <el-input disabled type="number" size="small" v-model="it.innerSharePercent"></el-input>
|
|
|
|
+ </div>
|
|
<div class="col input"><el-input disabled type="number" size="small" v-model="it.stockNum"></el-input></div>
|
|
<div class="col input"><el-input disabled type="number" size="small" v-model="it.stockNum"></el-input></div>
|
|
<div class="col input"><el-input disabled type="number" size="small" v-model="it.soldNum"></el-input></div>
|
|
<div class="col input"><el-input disabled type="number" size="small" v-model="it.soldNum"></el-input></div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="operation">
|
|
<div class="operation">
|
|
- <el-button type="text" style="color: #f56c6c" @click="deleteGoods(item.goodsId,index)">删除</el-button>
|
|
|
|
|
|
+ <el-button type="text" style="color: #f56c6c" @click="deleteGoods(item.goodsId, index)">删除</el-button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="empty-text" v-if="goodsList.length < 1">暂无数据</div>
|
|
<div class="empty-text" v-if="goodsList.length < 1">暂无数据</div>
|
|
@@ -134,48 +154,77 @@
|
|
|
|
|
|
<div class="page-footer">
|
|
<div class="page-footer">
|
|
<div class="footer" :class="classObj">
|
|
<div class="footer" :class="classObj">
|
|
- <el-button
|
|
|
|
- type="primary"
|
|
|
|
- @click="submitMainForm"
|
|
|
|
- :loading="formLoading"
|
|
|
|
- >{{ formLoading ? "提交中 ..." : "提 交" }}</el-button
|
|
|
|
- >
|
|
|
|
|
|
+ <el-button type="primary" @click="submitMainForm" :loading="formLoading">{{
|
|
|
|
+ formLoading ? '提交中 ...' : '提 交'
|
|
|
|
+ }}</el-button>
|
|
<el-button @click="goBack">关 闭</el-button>
|
|
<el-button @click="goBack">关 闭</el-button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
-
|
|
|
|
|
|
+
|
|
<!-- 选择商品 -->
|
|
<!-- 选择商品 -->
|
|
- <el-dialog title="选择商品" :visible.sync="addGoodsVisible" :show-close="false" width="50%" :close-on-click-modal="false">
|
|
|
|
|
|
+ <el-dialog
|
|
|
|
+ title="选择商品"
|
|
|
|
+ :visible.sync="addGoodsVisible"
|
|
|
|
+ :show-close="false"
|
|
|
|
+ width="50%"
|
|
|
|
+ :close-on-click-modal="false"
|
|
|
|
+ >
|
|
<div class="dialog-container clearfix">
|
|
<div class="dialog-container clearfix">
|
|
<div class="left fl">
|
|
<div class="left fl">
|
|
<div class="item" @click="changeClassify('')">全部分类</div>
|
|
<div class="item" @click="changeClassify('')">全部分类</div>
|
|
<div class="group" v-for="(item, index) in classifyList" :key="index">
|
|
<div class="group" v-for="(item, index) in classifyList" :key="index">
|
|
<div class="item" @click="toggleOpen(index)">
|
|
<div class="item" @click="toggleOpen(index)">
|
|
- <i :class="item.isOpen ? 'el-icon-caret-bottom':'el-icon-caret-right'"></i> {{item.name}}
|
|
|
|
|
|
+ <i :class="item.isOpen ? 'el-icon-caret-bottom' : 'el-icon-caret-right'"></i> {{ item.name }}
|
|
</div>
|
|
</div>
|
|
<div class="child" v-if="item.isOpen">
|
|
<div class="child" v-if="item.isOpen">
|
|
- <div class="item" v-for="(childItem, childIndex) in item.children" :key="childIndex" @click="changeClassify(childItem.categoryId)">{{childItem.name}}</div>
|
|
|
|
|
|
+ <div
|
|
|
|
+ class="item"
|
|
|
|
+ v-for="(childItem, childIndex) in item.children"
|
|
|
|
+ :key="childIndex"
|
|
|
|
+ @click="changeClassify(childItem.categoryId)"
|
|
|
|
+ >
|
|
|
|
+ {{ childItem.name }}
|
|
|
|
+ </div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<div class="right fl">
|
|
<div class="right fl">
|
|
<div class="search">
|
|
<div class="search">
|
|
- <el-input placeholder="请输入商品名称进行搜索" v-model="keyword" class="input-with-select" clearable size="small" style="width: 250px">
|
|
|
|
|
|
+ <el-input
|
|
|
|
+ placeholder="请输入商品名称进行搜索"
|
|
|
|
+ v-model="keyword"
|
|
|
|
+ class="input-with-select"
|
|
|
|
+ clearable
|
|
|
|
+ size="small"
|
|
|
|
+ style="width: 250px"
|
|
|
|
+ >
|
|
<el-button slot="append" icon="el-icon-search" size="small" @click="getGoodsListByScreen"></el-button>
|
|
<el-button slot="append" icon="el-icon-search" size="small" @click="getGoodsListByScreen"></el-button>
|
|
</el-input>
|
|
</el-input>
|
|
</div>
|
|
</div>
|
|
- <div class="table" style="margin: 10px 0 20px;">
|
|
|
|
- <el-table
|
|
|
|
- v-loading="table_listLoading"
|
|
|
|
- :data="table_dataList"
|
|
|
|
- element-loading-text="Loading"
|
|
|
|
- tooltip-effect="dark"
|
|
|
|
- style="width: 100%"
|
|
|
|
|
|
+ <div class="table" style="margin: 10px 0 20px">
|
|
|
|
+ <el-table
|
|
|
|
+ v-loading="table_listLoading"
|
|
|
|
+ :data="table_dataList"
|
|
|
|
+ element-loading-text="Loading"
|
|
|
|
+ tooltip-effect="dark"
|
|
|
|
+ style="width: 100%"
|
|
max-height="270"
|
|
max-height="270"
|
|
- @selection-change="handleChooseGoods">
|
|
|
|
- <el-table-column align="center" type="selection" :selectable='checkboxSelect' width="45"></el-table-column>
|
|
|
|
- <el-table-column align="center" prop="goodsName" label="商品名称" min-width="200" show-overflow-tooltip></el-table-column>
|
|
|
|
|
|
+ @selection-change="handleChooseGoods"
|
|
|
|
+ >
|
|
|
|
+ <el-table-column
|
|
|
|
+ align="center"
|
|
|
|
+ type="selection"
|
|
|
|
+ :selectable="checkboxSelect"
|
|
|
|
+ width="45"
|
|
|
|
+ ></el-table-column>
|
|
|
|
+ <el-table-column
|
|
|
|
+ align="center"
|
|
|
|
+ prop="goodsName"
|
|
|
|
+ label="商品名称"
|
|
|
|
+ min-width="200"
|
|
|
|
+ show-overflow-tooltip
|
|
|
|
+ ></el-table-column>
|
|
<el-table-column align="center" prop="goodsPrice" label="价格" width="80"></el-table-column>
|
|
<el-table-column align="center" prop="goodsPrice" label="价格" width="80"></el-table-column>
|
|
<el-table-column align="center" prop="stockNum" label="库存" width="80"></el-table-column>
|
|
<el-table-column align="center" prop="stockNum" label="库存" width="80"></el-table-column>
|
|
</el-table>
|
|
</el-table>
|
|
@@ -188,7 +237,8 @@
|
|
:page-size="table_pageSize"
|
|
:page-size="table_pageSize"
|
|
background
|
|
background
|
|
layout="prev, pager, next"
|
|
layout="prev, pager, next"
|
|
- :total="table_listTotal">
|
|
|
|
|
|
+ :total="table_listTotal"
|
|
|
|
+ >
|
|
</el-pagination>
|
|
</el-pagination>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@@ -202,7 +252,13 @@
|
|
</el-dialog>
|
|
</el-dialog>
|
|
|
|
|
|
<!-- 选择分类 -->
|
|
<!-- 选择分类 -->
|
|
- <el-dialog title="选择分类" :visible.sync="addClassifyVisible" :show-close="false" width="40%" :close-on-click-modal="false">
|
|
|
|
|
|
+ <el-dialog
|
|
|
|
+ title="选择分类"
|
|
|
|
+ :visible.sync="addClassifyVisible"
|
|
|
|
+ :show-close="false"
|
|
|
|
+ width="40%"
|
|
|
|
+ :close-on-click-modal="false"
|
|
|
|
+ >
|
|
<div class="classify-list">
|
|
<div class="classify-list">
|
|
<el-tree
|
|
<el-tree
|
|
:data="classifyList"
|
|
:data="classifyList"
|
|
@@ -211,41 +267,45 @@
|
|
node-key="categoryId"
|
|
node-key="categoryId"
|
|
ref="tree"
|
|
ref="tree"
|
|
highlight-current
|
|
highlight-current
|
|
- :props="defaultProps">
|
|
|
|
|
|
+ :props="defaultProps"
|
|
|
|
+ >
|
|
</el-tree>
|
|
</el-tree>
|
|
</div>
|
|
</div>
|
|
-
|
|
|
|
|
|
+
|
|
<div slot="footer" class="dialog-footer">
|
|
<div slot="footer" class="dialog-footer">
|
|
<el-button type="primary" @click="submitAddClassify">保 存</el-button>
|
|
<el-button type="primary" @click="submitAddClassify">保 存</el-button>
|
|
<el-button @click="cancelAddClassify">取 消</el-button>
|
|
<el-button @click="cancelAddClassify">取 消</el-button>
|
|
</div>
|
|
</div>
|
|
</el-dialog>
|
|
</el-dialog>
|
|
-
|
|
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
-import { getToken } from "@/utils/auth";
|
|
|
|
-import { getactivityGoodsDetail,addActiveGoods,editEnterpriseTemplate, getClassifyList, getGoodsList, getMoreGoodsList } from "@/api/special";
|
|
|
|
|
|
+import { getToken } from '@/utils/auth'
|
|
|
|
+import {
|
|
|
|
+ getactivityGoodsDetail,
|
|
|
|
+ addActiveGoods,
|
|
|
|
+ editEnterpriseTemplate,
|
|
|
|
+ getClassifyList,
|
|
|
|
+ getGoodsList,
|
|
|
|
+ getMoreGoodsList
|
|
|
|
+} from '@/api/special'
|
|
export default {
|
|
export default {
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
- companyWechatId:"",
|
|
|
|
- useTemplate:"",
|
|
|
|
- activityName: "", // 头部标题
|
|
|
|
|
|
+ companyWechatId: '',
|
|
|
|
+ useTemplate: '',
|
|
|
|
+ activityName: '', // 头部标题
|
|
ratio: '',
|
|
ratio: '',
|
|
- objectId: "", // 小程序模板id
|
|
|
|
- type: "", // 类型
|
|
|
|
|
|
+ objectId: '', // 小程序模板id
|
|
|
|
+ type: '', // 类型
|
|
baseURL: process.env.VUE_APP_BASE_API,
|
|
baseURL: process.env.VUE_APP_BASE_API,
|
|
- myHeaders: { "x-token": getToken() },
|
|
|
|
|
|
+ myHeaders: { 'x-token': getToken() },
|
|
formLoading: false,
|
|
formLoading: false,
|
|
mainForm: {
|
|
mainForm: {
|
|
- backGroundColor: "#F4F2F2",
|
|
|
|
- },
|
|
|
|
- mainFormRules: {
|
|
|
|
- // img1_url: [
|
|
|
|
- // { required: true, message: "请上传活动专区图片", trigger: "blur" },
|
|
|
|
- // ],
|
|
|
|
|
|
+ title1: '',
|
|
|
|
+ title2: '',
|
|
|
|
+ backGroundColor: '#F4F2F2'
|
|
},
|
|
},
|
|
goodsList: [], // 列表数据
|
|
goodsList: [], // 列表数据
|
|
|
|
|
|
@@ -271,88 +331,101 @@ export default {
|
|
img1_url: '',
|
|
img1_url: '',
|
|
img1_hover: false,
|
|
img1_hover: false,
|
|
img2_url: '',
|
|
img2_url: '',
|
|
- img2_hover: false,
|
|
|
|
- img3_url: '',
|
|
|
|
- img3_hover: false,
|
|
|
|
- };
|
|
|
|
|
|
+ img2_hover: false
|
|
|
|
+ }
|
|
},
|
|
},
|
|
computed: {
|
|
computed: {
|
|
sidebar() {
|
|
sidebar() {
|
|
- return this.$store.state.app.sidebar;
|
|
|
|
|
|
+ return this.$store.state.app.sidebar
|
|
},
|
|
},
|
|
classObj() {
|
|
classObj() {
|
|
return {
|
|
return {
|
|
hideSidebar: !this.sidebar.opened,
|
|
hideSidebar: !this.sidebar.opened,
|
|
- openSidebar: this.sidebar.opened,
|
|
|
|
- };
|
|
|
|
- },
|
|
|
|
|
|
+ openSidebar: this.sidebar.opened
|
|
|
|
+ }
|
|
|
|
+ }
|
|
},
|
|
},
|
|
created() {
|
|
created() {
|
|
- const { item } = this.$route.query;
|
|
|
|
- this.activityName = item.activityName;
|
|
|
|
- this.objectId = item.objectId;
|
|
|
|
- this.type = item.type;
|
|
|
|
- this.ratio = item.ratio;
|
|
|
|
-
|
|
|
|
- this.companyWechatId = JSON.parse(localStorage.getItem("jsmmall_user")).companyWechatId;
|
|
|
|
- this.useTemplate = JSON.parse(localStorage.getItem("jsmmall_user")).useTemplate;
|
|
|
|
-
|
|
|
|
- this.getactivityGoodsDetail();
|
|
|
|
-
|
|
|
|
- if(item.type == 2){
|
|
|
|
- this.img1_url=item.popupImage
|
|
|
|
- this.img2_url=item.popupHeadImage
|
|
|
|
- this.img3_url=item.popupQrcode
|
|
|
|
- this.mainForm.backGroundColor=item.popupBackgroundColor
|
|
|
|
- } else if(item.type==3){
|
|
|
|
- this.img1_url=item.active1Image
|
|
|
|
- this.img2_url=item.active1HeadImage
|
|
|
|
- this.img3_url=item.active1Qrcode
|
|
|
|
- this.mainForm.backGroundColor=item.active1BackgroundColor
|
|
|
|
- }
|
|
|
|
- else if(item.type==4){
|
|
|
|
- this.img1_url=item.active2LeftImage
|
|
|
|
- this.img2_url=item.active2LeftHeadImage
|
|
|
|
- this.img3_url=item.active2LeftQrcode
|
|
|
|
- this.mainForm.backGroundColor=item.active2LeftBackgroundColor
|
|
|
|
- }else if(item.type==5){
|
|
|
|
- this.img1_url=item.active2RightImage
|
|
|
|
- this.img2_url=item.active2RightHeadImage
|
|
|
|
- this.img3_url=item.active2RightQrcode
|
|
|
|
- this.mainForm.backGroundColor=item.active2RightBackgroundColor
|
|
|
|
- }else if(item.type==6){
|
|
|
|
- this.img1_url=item.only1Image
|
|
|
|
- this.img2_url=item.only1HeadImage
|
|
|
|
- this.img3_url=item.only1Qrcode
|
|
|
|
- this.mainForm.backGroundColor=item.only1BackgroundColor
|
|
|
|
- } else if(item.type==7){
|
|
|
|
- this.img1_url=item.only2Image
|
|
|
|
- this.img2_url=item.only2HeadImage
|
|
|
|
- this.img3_url=item.only2Qrcode
|
|
|
|
- this.mainForm.backGroundColor=item.only2BackgroundColor
|
|
|
|
- } else if(item.type==8){
|
|
|
|
- this.img1_url=item.only3Image
|
|
|
|
- this.img2_url=item.only3HeadImage
|
|
|
|
- this.img3_url=item.only3Qrcode
|
|
|
|
- this.mainForm.backGroundColor=item.only3BackgroundColor
|
|
|
|
- }else {
|
|
|
|
- this.img1_url=item.only4Image
|
|
|
|
- this.img2_url=item.only4HeadImage
|
|
|
|
- this.img3_url=item.only4Qrcode
|
|
|
|
- this.mainForm.backGroundColor=item.only4BackgroundColor
|
|
|
|
|
|
+ const { item } = this.$route.query
|
|
|
|
+ this.activityName = item.activityName
|
|
|
|
+ this.objectId = item.objectId
|
|
|
|
+ this.type = item.type
|
|
|
|
+ this.ratio = item.ratio
|
|
|
|
+
|
|
|
|
+ this.companyWechatId = JSON.parse(localStorage.getItem('greemall_user')).companyWechatId
|
|
|
|
+ this.useTemplate = JSON.parse(localStorage.getItem('greemall_user')).useTemplate
|
|
|
|
+
|
|
|
|
+ this.getactivityGoodsDetail()
|
|
|
|
+
|
|
|
|
+ if (item.type == 2) {
|
|
|
|
+ this.img1_url = item.popupImage
|
|
|
|
+ this.img2_url = item.popupHeadImage
|
|
|
|
+ this.mainForm.backGroundColor = item.popupBackgroundColor
|
|
|
|
+ } else if (item.type == 3) {
|
|
|
|
+ this.img1_url = item.active1Image
|
|
|
|
+ this.img2_url = item.active1HeadImage
|
|
|
|
+ this.mainForm.backGroundColor = item.active1BackgroundColor
|
|
|
|
+ } else if (item.type == 4) {
|
|
|
|
+ this.img1_url = item.active2LeftImage
|
|
|
|
+ this.img2_url = item.active2LeftHeadImage
|
|
|
|
+ this.mainForm.backGroundColor = item.active2LeftBackgroundColor
|
|
|
|
+ } else if (item.type == 5) {
|
|
|
|
+ this.img1_url = item.active2RightImage
|
|
|
|
+ this.img2_url = item.active2RightHeadImage
|
|
|
|
+ this.mainForm.backGroundColor = item.active2RightBackgroundColor
|
|
|
|
+ } else if (item.type == 6) {
|
|
|
|
+ this.img1_url = item.only1Image
|
|
|
|
+ this.img2_url = item.only1HeadImage
|
|
|
|
+ this.mainForm.backGroundColor = item.only1BackgroundColor
|
|
|
|
+ } else if (item.type == 7) {
|
|
|
|
+ this.img1_url = item.only2Image
|
|
|
|
+ this.img2_url = item.only2HeadImage
|
|
|
|
+ this.mainForm.backGroundColor = item.only2BackgroundColor
|
|
|
|
+ } else if (item.type == 8) {
|
|
|
|
+ this.img1_url = item.only3Image
|
|
|
|
+ this.img2_url = item.only3HeadImage
|
|
|
|
+ this.mainForm.backGroundColor = item.only3BackgroundColor
|
|
|
|
+ } else if (item.type == 9) {
|
|
|
|
+ this.img1_url = item.only4Image
|
|
|
|
+ this.img2_url = item.only4HeadImage
|
|
|
|
+ this.mainForm.backGroundColor = item.only4BackgroundColor
|
|
|
|
+ } else if (item.type == 10) {
|
|
|
|
+ this.img1_url = item.topics1Image
|
|
|
|
+ this.img2_url = item.topics1HeadImage
|
|
|
|
+ this.mainForm.backGroundColor = item.topics1BackgroundColor
|
|
|
|
+ this.mainForm.title1 = item.topics1Title
|
|
|
|
+ this.mainForm.title2 = item.topics1Title2
|
|
|
|
+ } else if (item.type == 11) {
|
|
|
|
+ this.img1_url = item.topics2Image
|
|
|
|
+ this.img2_url = item.topics2HeadImage
|
|
|
|
+ this.mainForm.backGroundColor = item.topics2BackgroundColor
|
|
|
|
+ this.mainForm.title1 = item.topics2Title
|
|
|
|
+ this.mainForm.title2 = item.topics2Title2
|
|
|
|
+ } else if (item.type == 12) {
|
|
|
|
+ this.img1_url = item.topics3Image
|
|
|
|
+ this.img2_url = item.topics3HeadImage
|
|
|
|
+ this.mainForm.backGroundColor = item.topics3BackgroundColor
|
|
|
|
+ this.mainForm.title1 = item.topics3Title
|
|
|
|
+ this.mainForm.title2 = item.topics3Title2
|
|
|
|
+ } else if (item.type == 13) {
|
|
|
|
+ this.img1_url = item.bottomBannerImage
|
|
|
|
+ this.img2_url = item.bottomBannerHeadImage
|
|
|
|
+ this.mainForm.backGroundColor = item.bottomBannerBackgroundColor
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
|
|
methods: {
|
|
methods: {
|
|
// 更改模板信息
|
|
// 更改模板信息
|
|
- editEnterpriseTemplate(params){
|
|
|
|
- editEnterpriseTemplate(params).then(res=>{console.log('更改模板信息',res)})
|
|
|
|
|
|
+ editEnterpriseTemplate(params) {
|
|
|
|
+ editEnterpriseTemplate(params).then(res => {
|
|
|
|
+ console.log('更改模板信息', res)
|
|
|
|
+ })
|
|
},
|
|
},
|
|
|
|
|
|
// 添加活动商品
|
|
// 添加活动商品
|
|
- addActiveGoods(params){
|
|
|
|
- addActiveGoods(params).then(res=>{
|
|
|
|
- if(res.code==200){
|
|
|
|
|
|
+ addActiveGoods(params) {
|
|
|
|
+ addActiveGoods(params).then(res => {
|
|
|
|
+ if (res.code == 200) {
|
|
this.$router.go(-1)
|
|
this.$router.go(-1)
|
|
}
|
|
}
|
|
})
|
|
})
|
|
@@ -362,97 +435,97 @@ export default {
|
|
getactivityGoodsDetail() {
|
|
getactivityGoodsDetail() {
|
|
const params = {
|
|
const params = {
|
|
objectId: this.objectId, // 小程序模板id
|
|
objectId: this.objectId, // 小程序模板id
|
|
- type: this.type, // 类型: 1=新维度分类,2=首页弹窗, 3=活动专区1,4=活动专区2左侧,5=活动专区2右侧,6=专场专区1,7=专场专区2 , 8=专场专区3 , 9=专场专区4
|
|
|
|
- };
|
|
|
|
- getactivityGoodsDetail(params).then((res) => {
|
|
|
|
- res.data.activeGoodsList.forEach(item=> {
|
|
|
|
|
|
+ type: this.type // 类型: 1=新维度分类,2=首页弹窗,3=活动专区1,4=活动专区2左侧,5=活动专区2右侧,6=专场专区1,7=专场专区2,8=专场专区3,9=专场专区4,10=专题精选1,11=专题精选2,12=专题精选3,13=底部广告图
|
|
|
|
+ }
|
|
|
|
+ getactivityGoodsDetail(params).then(res => {
|
|
|
|
+ res.data.activeGoodsList.forEach(item => {
|
|
item.imgUrl = item.goods.imgUrl
|
|
item.imgUrl = item.goods.imgUrl
|
|
- });
|
|
|
|
|
|
+ })
|
|
|
|
|
|
this.goodsList = res.data.activeGoodsList
|
|
this.goodsList = res.data.activeGoodsList
|
|
- });
|
|
|
|
|
|
+ })
|
|
},
|
|
},
|
|
|
|
|
|
// 重置
|
|
// 重置
|
|
resetFn() {
|
|
resetFn() {
|
|
- this.mainForm.backGroundColor = "#F4F2F2";
|
|
|
|
|
|
+ this.mainForm.backGroundColor = '#F4F2F2'
|
|
},
|
|
},
|
|
|
|
|
|
// 删除商品
|
|
// 删除商品
|
|
- deleteGoods(item,index) {
|
|
|
|
- this.goodsList.splice(index,1)
|
|
|
|
|
|
+ deleteGoods(item, index) {
|
|
|
|
+ this.goodsList.splice(index, 1)
|
|
},
|
|
},
|
|
|
|
|
|
uploadImage(type) {
|
|
uploadImage(type) {
|
|
- this.uploadImageType = type;
|
|
|
|
- document.querySelector('.avatar-uploader input').click();
|
|
|
|
|
|
+ this.uploadImageType = type
|
|
|
|
+ document.querySelector('.avatar-uploader input').click()
|
|
},
|
|
},
|
|
|
|
|
|
// 上传图片
|
|
// 上传图片
|
|
uploadSuccess(res, file) {
|
|
uploadSuccess(res, file) {
|
|
- this[this.uploadImageType + '_url'] = res.data.url;
|
|
|
|
|
|
+ this[this.uploadImageType + '_url'] = res.data.url
|
|
},
|
|
},
|
|
|
|
|
|
beforeUpload(file) {
|
|
beforeUpload(file) {
|
|
- const fileSuffix = file.name.substring(file.name.lastIndexOf(".") + 1);
|
|
|
|
- const whiteList = ['jpg', 'jpeg', 'png'];
|
|
|
|
|
|
+ const fileSuffix = file.name.substring(file.name.lastIndexOf('.') + 1)
|
|
|
|
+ const whiteList = ['jpg', 'jpeg', 'png', 'gif']
|
|
if (whiteList.indexOf(fileSuffix) === -1) {
|
|
if (whiteList.indexOf(fileSuffix) === -1) {
|
|
- this.$errorMsg('只支持上传jpg/jpeg/png文件!');
|
|
|
|
- return false;
|
|
|
|
|
|
+ this.$errorMsg('只支持上传jpg/jpeg/png/gif文件!')
|
|
|
|
+ return false
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
|
|
// 预览图片
|
|
// 预览图片
|
|
previewImage(type) {
|
|
previewImage(type) {
|
|
- this.$refs[type].showViewer = true;
|
|
|
|
|
|
+ this.$refs[type].showViewer = true
|
|
},
|
|
},
|
|
|
|
|
|
// 删除图片
|
|
// 删除图片
|
|
deleteImage(type) {
|
|
deleteImage(type) {
|
|
- this[type + '_url'] = '';
|
|
|
|
|
|
+ this[type + '_url'] = ''
|
|
},
|
|
},
|
|
|
|
|
|
// 返回
|
|
// 返回
|
|
goBack() {
|
|
goBack() {
|
|
- this.$router.go(-1);
|
|
|
|
|
|
+ this.$router.go(-1)
|
|
},
|
|
},
|
|
|
|
|
|
// 获取分类列表
|
|
// 获取分类列表
|
|
getClassifyList(state) {
|
|
getClassifyList(state) {
|
|
- getClassifyList({categoryLevel: 1, status: true}).then(res => {
|
|
|
|
|
|
+ getClassifyList({ categoryLevel: 1, status: true }).then(res => {
|
|
res.data.forEach(item => {
|
|
res.data.forEach(item => {
|
|
- item.isOpen = false;
|
|
|
|
- });
|
|
|
|
- this.classifyList = res.data;
|
|
|
|
- this.classifyCurrent = '';
|
|
|
|
- if(!state) {
|
|
|
|
- this.getGoodsList();
|
|
|
|
|
|
+ item.isOpen = false
|
|
|
|
+ })
|
|
|
|
+ this.classifyList = res.data
|
|
|
|
+ this.classifyCurrent = ''
|
|
|
|
+ if (!state) {
|
|
|
|
+ this.getGoodsList()
|
|
}
|
|
}
|
|
})
|
|
})
|
|
},
|
|
},
|
|
|
|
|
|
// 展开/收起 分类
|
|
// 展开/收起 分类
|
|
toggleOpen(index) {
|
|
toggleOpen(index) {
|
|
- this.classifyList[index].isOpen = !this.classifyList[index].isOpen;
|
|
|
|
|
|
+ this.classifyList[index].isOpen = !this.classifyList[index].isOpen
|
|
},
|
|
},
|
|
|
|
|
|
// 切换分类
|
|
// 切换分类
|
|
changeClassify(cid) {
|
|
changeClassify(cid) {
|
|
- if(this.table_chooseGoods.length > 0) {
|
|
|
|
- return this.$errorMsg('当前已选择商品,不可切换分类');
|
|
|
|
|
|
+ if (this.table_chooseGoods.length > 0) {
|
|
|
|
+ return this.$errorMsg('当前已选择商品,不可切换分类')
|
|
}
|
|
}
|
|
- this.classifyCurrent = cid;
|
|
|
|
- this.table_currentPage = 1;
|
|
|
|
- this.getGoodsList();
|
|
|
|
|
|
+ this.classifyCurrent = cid
|
|
|
|
+ this.table_currentPage = 1
|
|
|
|
+ this.getGoodsList()
|
|
},
|
|
},
|
|
|
|
|
|
// 搜索
|
|
// 搜索
|
|
getGoodsListByScreen() {
|
|
getGoodsListByScreen() {
|
|
- if(this.table_chooseGoods.length > 0) {
|
|
|
|
- return this.$errorMsg('当前已选择商品,不可搜索');
|
|
|
|
|
|
+ if (this.table_chooseGoods.length > 0) {
|
|
|
|
+ return this.$errorMsg('当前已选择商品,不可搜索')
|
|
}
|
|
}
|
|
- this.table_currentPage = 1;
|
|
|
|
- this.getGoodsList();
|
|
|
|
|
|
+ this.table_currentPage = 1
|
|
|
|
+ this.getGoodsList()
|
|
},
|
|
},
|
|
|
|
|
|
// 获取商品列表
|
|
// 获取商品列表
|
|
@@ -461,124 +534,124 @@ export default {
|
|
pageNum: this.table_currentPage,
|
|
pageNum: this.table_currentPage,
|
|
pageSize: this.table_pageSize,
|
|
pageSize: this.table_pageSize,
|
|
keyword: this.keyword,
|
|
keyword: this.keyword,
|
|
- categoryId: this.classifyCurrent,
|
|
|
|
|
|
+ categoryId: this.classifyCurrent
|
|
}).then(res => {
|
|
}).then(res => {
|
|
- let oldGoodsList = this.goodsList;
|
|
|
|
- let newGoodsList = res.data.records;
|
|
|
|
- for(let i = 0; i < oldGoodsList.length; i++) {
|
|
|
|
|
|
+ let oldGoodsList = this.goodsList
|
|
|
|
+ let newGoodsList = res.data.records
|
|
|
|
+ for (let i = 0; i < oldGoodsList.length; i++) {
|
|
let oldItem = oldGoodsList[i]
|
|
let oldItem = oldGoodsList[i]
|
|
- for(let j = 0; j < newGoodsList.length; j++) {
|
|
|
|
|
|
+ for (let j = 0; j < newGoodsList.length; j++) {
|
|
let newItem = newGoodsList[j]
|
|
let newItem = newGoodsList[j]
|
|
- if(newItem.goodsId === oldItem.goodsId){
|
|
|
|
- newGoodsList[j].selected = true;
|
|
|
|
- break;
|
|
|
|
|
|
+ if (newItem.goodsId === oldItem.goodsId) {
|
|
|
|
+ newGoodsList[j].selected = true
|
|
|
|
+ break
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- for(let j = 0; j < newGoodsList.length; j++) {
|
|
|
|
|
|
+ for (let j = 0; j < newGoodsList.length; j++) {
|
|
let newItem = newGoodsList[j]
|
|
let newItem = newGoodsList[j]
|
|
- if(newItem.promotionGroup === true){
|
|
|
|
- newGoodsList[j].selected = true;
|
|
|
|
|
|
+ if (newItem.promotionGroup === true) {
|
|
|
|
+ newGoodsList[j].selected = true
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- this.table_dataList = newGoodsList;
|
|
|
|
- this.table_listTotal = res.data.total;
|
|
|
|
- this.table_listLoading = false;
|
|
|
|
|
|
+ this.table_dataList = newGoodsList
|
|
|
|
+ this.table_listTotal = res.data.total
|
|
|
|
+ this.table_listLoading = false
|
|
})
|
|
})
|
|
},
|
|
},
|
|
|
|
|
|
// 查询重复值并禁选
|
|
// 查询重复值并禁选
|
|
- checkboxSelect (row, rowIndex) {
|
|
|
|
|
|
+ checkboxSelect(row, rowIndex) {
|
|
if (row.selected) {
|
|
if (row.selected) {
|
|
return false // 禁用
|
|
return false // 禁用
|
|
- }else{
|
|
|
|
|
|
+ } else {
|
|
return true // 不禁用
|
|
return true // 不禁用
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
|
|
// 更改列表当前页
|
|
// 更改列表当前页
|
|
handleTableCurrentChange(val) {
|
|
handleTableCurrentChange(val) {
|
|
- if(this.table_chooseGoods.length > 0) {
|
|
|
|
- return this.$errorMsg('当前已选择商品,不可切换分页');
|
|
|
|
|
|
+ if (this.table_chooseGoods.length > 0) {
|
|
|
|
+ return this.$errorMsg('当前已选择商品,不可切换分页')
|
|
}
|
|
}
|
|
- this.table_currentPage = val;
|
|
|
|
- this.getGoodsList();
|
|
|
|
|
|
+ this.table_currentPage = val
|
|
|
|
+ this.getGoodsList()
|
|
},
|
|
},
|
|
|
|
|
|
// table点击选择商品
|
|
// table点击选择商品
|
|
handleChooseGoods(val) {
|
|
handleChooseGoods(val) {
|
|
- this.table_chooseGoods = val;
|
|
|
|
|
|
+ this.table_chooseGoods = val
|
|
},
|
|
},
|
|
|
|
|
|
// 打开 选择商品
|
|
// 打开 选择商品
|
|
addGoods() {
|
|
addGoods() {
|
|
- this.addGoodsVisible = true;
|
|
|
|
- this.getClassifyList();
|
|
|
|
|
|
+ this.addGoodsVisible = true
|
|
|
|
+ this.getClassifyList()
|
|
},
|
|
},
|
|
|
|
|
|
// 取消 选择商品
|
|
// 取消 选择商品
|
|
- cancelAddGoods(){
|
|
|
|
- this.addGoodsVisible = false;
|
|
|
|
|
|
+ cancelAddGoods() {
|
|
|
|
+ this.addGoodsVisible = false
|
|
},
|
|
},
|
|
|
|
|
|
// 提交 选择商品
|
|
// 提交 选择商品
|
|
submitAddGoods() {
|
|
submitAddGoods() {
|
|
- let oldGoodsList = this.goodsList;
|
|
|
|
- let newGoodsList = this.table_chooseGoods;
|
|
|
|
- this.goodsList = oldGoodsList.concat(newGoodsList);
|
|
|
|
- this.addGoodsVisible = false;
|
|
|
|
|
|
+ let oldGoodsList = this.goodsList
|
|
|
|
+ let newGoodsList = this.table_chooseGoods
|
|
|
|
+ this.goodsList = oldGoodsList.concat(newGoodsList)
|
|
|
|
+ this.addGoodsVisible = false
|
|
},
|
|
},
|
|
|
|
|
|
// 打开 选择分类
|
|
// 打开 选择分类
|
|
addClassify() {
|
|
addClassify() {
|
|
- this.addClassifyVisible = true;
|
|
|
|
- this.getClassifyList(true);
|
|
|
|
|
|
+ this.addClassifyVisible = true
|
|
|
|
+ this.getClassifyList(true)
|
|
},
|
|
},
|
|
|
|
|
|
// 取消 选择分类
|
|
// 取消 选择分类
|
|
- cancelAddClassify(){
|
|
|
|
- this.addClassifyVisible = false;
|
|
|
|
|
|
+ cancelAddClassify() {
|
|
|
|
+ this.addClassifyVisible = false
|
|
},
|
|
},
|
|
|
|
|
|
// 提交 选择分类
|
|
// 提交 选择分类
|
|
submitAddClassify() {
|
|
submitAddClassify() {
|
|
- if(this.$refs.tree.getCheckedNodes().length <= 0) {
|
|
|
|
- return this.$errorMsg('请选择分类');
|
|
|
|
|
|
+ if (this.$refs.tree.getCheckedNodes().length <= 0) {
|
|
|
|
+ return this.$errorMsg('请选择分类')
|
|
}
|
|
}
|
|
- let checkeds = this.$refs.tree.getCheckedNodes();
|
|
|
|
- let ids = [];
|
|
|
|
|
|
+ let checkeds = this.$refs.tree.getCheckedNodes()
|
|
|
|
+ let ids = []
|
|
checkeds.forEach(item => {
|
|
checkeds.forEach(item => {
|
|
- if(item.level === 2) {
|
|
|
|
- ids.push(item.categoryId);
|
|
|
|
|
|
+ if (item.level === 2) {
|
|
|
|
+ ids.push(item.categoryId)
|
|
}
|
|
}
|
|
})
|
|
})
|
|
- getMoreGoodsList({ categoryIds: ids.join(',')}).then(res => {
|
|
|
|
- let oldGoodsList = this.goodsList;
|
|
|
|
- let newGoodsList = [];
|
|
|
|
|
|
+ getMoreGoodsList({ categoryIds: ids.join(',') }).then(res => {
|
|
|
|
+ let oldGoodsList = this.goodsList
|
|
|
|
+ let newGoodsList = []
|
|
res.data.forEach(item => {
|
|
res.data.forEach(item => {
|
|
- if(item.promotionGroup === false) {
|
|
|
|
- newGoodsList.push(item);
|
|
|
|
|
|
+ if (item.promotionGroup === false) {
|
|
|
|
+ newGoodsList.push(item)
|
|
}
|
|
}
|
|
})
|
|
})
|
|
- let allGoodsList = oldGoodsList.concat(newGoodsList);
|
|
|
|
- let showGoodsList = [];
|
|
|
|
- let obj = {};
|
|
|
|
- for(var i =0; i<allGoodsList.length; i++){
|
|
|
|
- if(!obj[allGoodsList[i].goodsId]){
|
|
|
|
- showGoodsList.push(allGoodsList[i]);
|
|
|
|
- obj[allGoodsList[i].goodsId] = true;
|
|
|
|
|
|
+ let allGoodsList = oldGoodsList.concat(newGoodsList)
|
|
|
|
+ let showGoodsList = []
|
|
|
|
+ let obj = {}
|
|
|
|
+ for (var i = 0; i < allGoodsList.length; i++) {
|
|
|
|
+ if (!obj[allGoodsList[i].goodsId]) {
|
|
|
|
+ showGoodsList.push(allGoodsList[i])
|
|
|
|
+ obj[allGoodsList[i].goodsId] = true
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- this.goodsList = showGoodsList;
|
|
|
|
- this.addClassifyVisible = false;
|
|
|
|
|
|
+ this.goodsList = showGoodsList
|
|
|
|
+ this.addClassifyVisible = false
|
|
})
|
|
})
|
|
},
|
|
},
|
|
|
|
|
|
// 提交
|
|
// 提交
|
|
submitMainForm() {
|
|
submitMainForm() {
|
|
- this.$refs.mainForm.validate((valid) => {
|
|
|
|
|
|
+ this.$refs.mainForm.validate(valid => {
|
|
if (valid) {
|
|
if (valid) {
|
|
- const params={
|
|
|
|
|
|
+ const params = {
|
|
goodsList: this.goodsList,
|
|
goodsList: this.goodsList,
|
|
objectId: this.objectId,
|
|
objectId: this.objectId,
|
|
type: this.type
|
|
type: this.type
|
|
@@ -587,85 +660,108 @@ export default {
|
|
|
|
|
|
let comParams = {
|
|
let comParams = {
|
|
companyWechatTemplateId: this.objectId,
|
|
companyWechatTemplateId: this.objectId,
|
|
- companyWechatId:this.companyWechatId,
|
|
|
|
- templateType:this.useTemplate
|
|
|
|
|
|
+ companyWechatId: this.companyWechatId,
|
|
|
|
+ templateType: this.useTemplate
|
|
}
|
|
}
|
|
let params1 = {}
|
|
let params1 = {}
|
|
|
|
|
|
- if(this.type == 2){
|
|
|
|
|
|
+ if (this.type == 2) {
|
|
params1 = {
|
|
params1 = {
|
|
popupBackgroundColor: this.mainForm.backGroundColor,
|
|
popupBackgroundColor: this.mainForm.backGroundColor,
|
|
popupHeadImage: this.img2_url,
|
|
popupHeadImage: this.img2_url,
|
|
popupImage: this.img1_url,
|
|
popupImage: this.img1_url,
|
|
- popupQrcode: this.img3_url,
|
|
|
|
...comParams
|
|
...comParams
|
|
}
|
|
}
|
|
- } else if(this.type == 3){
|
|
|
|
|
|
+ } else if (this.type == 3) {
|
|
params1 = {
|
|
params1 = {
|
|
active1BackgroundColor: this.mainForm.backGroundColor,
|
|
active1BackgroundColor: this.mainForm.backGroundColor,
|
|
active1HeadImage: this.img2_url,
|
|
active1HeadImage: this.img2_url,
|
|
active1Image: this.img1_url,
|
|
active1Image: this.img1_url,
|
|
- active1Qrcode: this.img3_url,
|
|
|
|
...comParams
|
|
...comParams
|
|
}
|
|
}
|
|
- } else if(this.type == 4){
|
|
|
|
|
|
+ } else if (this.type == 4) {
|
|
params1 = {
|
|
params1 = {
|
|
active2LeftBackgroundColor: this.mainForm.backGroundColor,
|
|
active2LeftBackgroundColor: this.mainForm.backGroundColor,
|
|
active2LeftHeadImage: this.img2_url,
|
|
active2LeftHeadImage: this.img2_url,
|
|
active2LeftImage: this.img1_url,
|
|
active2LeftImage: this.img1_url,
|
|
- active2LeftQrcode: this.img3_url,
|
|
|
|
...comParams
|
|
...comParams
|
|
}
|
|
}
|
|
- } else if(this.type == 5){
|
|
|
|
|
|
+ } else if (this.type == 5) {
|
|
params1 = {
|
|
params1 = {
|
|
active2RightBackgroundColor: this.mainForm.backGroundColor,
|
|
active2RightBackgroundColor: this.mainForm.backGroundColor,
|
|
active2RightHeadImage: this.img2_url,
|
|
active2RightHeadImage: this.img2_url,
|
|
active2RightImage: this.img1_url,
|
|
active2RightImage: this.img1_url,
|
|
- active2RightQrcode: this.img3_url,
|
|
|
|
...comParams
|
|
...comParams
|
|
}
|
|
}
|
|
- } else if(this.type == 6){
|
|
|
|
|
|
+ } else if (this.type == 6) {
|
|
params1 = {
|
|
params1 = {
|
|
only1BackgroundColor: this.mainForm.backGroundColor,
|
|
only1BackgroundColor: this.mainForm.backGroundColor,
|
|
only1HeadImage: this.img2_url,
|
|
only1HeadImage: this.img2_url,
|
|
only1Image: this.img1_url,
|
|
only1Image: this.img1_url,
|
|
- only1Qrcode: this.img3_url,
|
|
|
|
...comParams
|
|
...comParams
|
|
}
|
|
}
|
|
- } else if(this.type == 7){
|
|
|
|
|
|
+ } else if (this.type == 7) {
|
|
params1 = {
|
|
params1 = {
|
|
only2BackgroundColor: this.mainForm.backGroundColor,
|
|
only2BackgroundColor: this.mainForm.backGroundColor,
|
|
only2HeadImage: this.img2_url,
|
|
only2HeadImage: this.img2_url,
|
|
only2Image: this.img1_url,
|
|
only2Image: this.img1_url,
|
|
- only2Qrcode: this.img3_url,
|
|
|
|
...comParams
|
|
...comParams
|
|
}
|
|
}
|
|
- } else if(this.type == 8){
|
|
|
|
|
|
+ } else if (this.type == 8) {
|
|
params1 = {
|
|
params1 = {
|
|
only3BackgroundColor: this.mainForm.backGroundColor,
|
|
only3BackgroundColor: this.mainForm.backGroundColor,
|
|
only3HeadImage: this.img2_url,
|
|
only3HeadImage: this.img2_url,
|
|
only3Image: this.img1_url,
|
|
only3Image: this.img1_url,
|
|
- only3Qrcode: this.img3_url,
|
|
|
|
...comParams
|
|
...comParams
|
|
}
|
|
}
|
|
- } else if(this.type == 9){
|
|
|
|
|
|
+ } else if (this.type == 9) {
|
|
params1 = {
|
|
params1 = {
|
|
only4BackgroundColor: this.mainForm.backGroundColor,
|
|
only4BackgroundColor: this.mainForm.backGroundColor,
|
|
only4HeadImage: this.img2_url,
|
|
only4HeadImage: this.img2_url,
|
|
only4Image: this.img1_url,
|
|
only4Image: this.img1_url,
|
|
- only4Qrcode: this.img3_url,
|
|
|
|
|
|
+ ...comParams
|
|
|
|
+ }
|
|
|
|
+ } else if (this.type == 10) {
|
|
|
|
+ params1 = {
|
|
|
|
+ topics1BackgroundColor: this.mainForm.backGroundColor,
|
|
|
|
+ topics1HeadImage: this.img2_url,
|
|
|
|
+ topics1Image: this.img1_url,
|
|
|
|
+ topics1Title: this.mainForm.title1,
|
|
|
|
+ topics1Title2: this.mainForm.title2,
|
|
|
|
+ ...comParams
|
|
|
|
+ }
|
|
|
|
+ } else if (this.type == 11) {
|
|
|
|
+ params1 = {
|
|
|
|
+ topics2BackgroundColor: this.mainForm.backGroundColor,
|
|
|
|
+ topics2HeadImage: this.img2_url,
|
|
|
|
+ topics2Image: this.img1_url,
|
|
|
|
+ topics2Title: this.mainForm.title1,
|
|
|
|
+ topics2Title2: this.mainForm.title2,
|
|
|
|
+ ...comParams
|
|
|
|
+ }
|
|
|
|
+ } else if (this.type == 12) {
|
|
|
|
+ params1 = {
|
|
|
|
+ topics3BackgroundColor: this.mainForm.backGroundColor,
|
|
|
|
+ topics3HeadImage: this.img2_url,
|
|
|
|
+ topics3Image: this.img1_url,
|
|
|
|
+ topics3Title: this.mainForm.title1,
|
|
|
|
+ topics3Title2: this.mainForm.title2,
|
|
|
|
+ ...comParams
|
|
|
|
+ }
|
|
|
|
+ } else if (this.type == 13) {
|
|
|
|
+ params1 = {
|
|
|
|
+ bottomBannerBackgroundColor: this.mainForm.backGroundColor,
|
|
|
|
+ bottomBannerHeadImage: this.img2_url,
|
|
|
|
+ bottomBannerImage: this.img1_url,
|
|
...comParams
|
|
...comParams
|
|
}
|
|
}
|
|
}
|
|
}
|
|
this.editEnterpriseTemplate(params1)
|
|
this.editEnterpriseTemplate(params1)
|
|
}
|
|
}
|
|
- });
|
|
|
|
- },
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- },
|
|
|
|
-};
|
|
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+}
|
|
</script>
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
<style lang="scss" scoped>
|
|
@@ -973,39 +1069,7 @@ export default {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
-.page-footer {
|
|
|
|
- height: 70px;
|
|
|
|
-}
|
|
|
|
-.footer {
|
|
|
|
- position: fixed;
|
|
|
|
- bottom: 0;
|
|
|
|
- left: 0;
|
|
|
|
- z-index: 1;
|
|
|
|
- width: 100%;
|
|
|
|
- background: #fff;
|
|
|
|
- padding: 15px 40px;
|
|
|
|
- box-sizing: border-box;
|
|
|
|
- transition: all 0.28s;
|
|
|
|
- text-align: right;
|
|
|
|
- box-shadow: 0 2px 5px 0 rgb(0 0 0 / 50%), 0 2px 5px 0 rgb(0 0 0 / 10%);
|
|
|
|
- &.hideSidebar {
|
|
|
|
- margin-left: 54px;
|
|
|
|
- width: calc(100vw - 54px);
|
|
|
|
- }
|
|
|
|
- &.openSidebar {
|
|
|
|
- margin-left: 210px;
|
|
|
|
- width: calc(100vw - 210px);
|
|
|
|
- }
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-::v-deep input::-webkit-outer-spin-button,
|
|
|
|
-::v-deep input::-webkit-inner-spin-button {
|
|
|
|
- -webkit-appearance: none;
|
|
|
|
-}
|
|
|
|
-::v-deep input[type="number"] {
|
|
|
|
- -moz-appearance: textfield;
|
|
|
|
-}
|
|
|
|
::v-deep .el-form-item__label {
|
|
::v-deep .el-form-item__label {
|
|
margin-left: 0px !important;
|
|
margin-left: 0px !important;
|
|
}
|
|
}
|
|
-</style>
|
|
|
|
|
|
+</style>
|