修复内容
1. 会员等级背景图去掉校验 2. 当查询不到会员等级是,按无会员等级展示 3. 删除商城首页冗余配置在index中的引用 4. 换绑推广人时,计算上一个推广人的推广人数 5. pc后台清除推广人时,更新推广人数量 6. 保证砍价金额最小为0.01 7. 修复商品删除时购物车关联删除 8. 删除商品问题修复 9. 运费模板——指定包邮,包邮数量类型修改 10. 签到错误修复 11. 修复我的优惠券只查询20条的问题 12. 文章列表修复 13. 拼团商品详情页数据统计显示问题修复 14. PC后台,账户详情,持有优惠券列表修复 15. 支付查询参数修复 16. 修复过期优惠券可以重复领取 17. 订单邮费切换地址重复计算修复 18. 判断是否在指定包邮区域内 必须满足件数 + 金额 才能包邮 19. 支付页面,切换tab,金额计算问题修复 20. 物流模板新增、编辑——修复 21. 去除线下邮费的影响 22. 订单运费计算重写 23. 下单页面到店自提合计金额不应该计算商品邮费 24. 新人券领取后,部分使用时间为空——修复
This commit is contained in:
@@ -3,8 +3,7 @@ ENV = 'development'
|
||||
|
||||
# base api
|
||||
# VUE_APP_BASE_API = '/dev-api'
|
||||
# VUE_APP_BASE_API = 'http://127.0.0.1:8080'
|
||||
VUE_APP_BASE_API = 'http://127.0.0.1:8080'
|
||||
VUE_APP_BASE_API = 'http://localhost:8080'
|
||||
|
||||
# vue-cli uses the VUE_CLI_BABEL_TRANSPILE_MODULES environment variable,
|
||||
# to control whether the babel-plugin-dynamic-import-node plugin is enabled.
|
||||
|
||||
@@ -3,5 +3,5 @@ ENV = 'production'
|
||||
|
||||
# base api
|
||||
# VUE_APP_BASE_API = '/prod-api'
|
||||
VUE_APP_BASE_API = 'http://127.0.0.1:8080'
|
||||
VUE_APP_BASE_API = 'http://localhost:8080'
|
||||
|
||||
|
||||
@@ -1,5 +1,10 @@
|
||||
module.exports = {
|
||||
presets: [
|
||||
'@vue/app'
|
||||
['@vue/app',
|
||||
{
|
||||
'useBuiltIns': 'entry',
|
||||
polyfills: ['es6.promise', 'es6.symbol']
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
|
||||
@@ -46,6 +46,7 @@
|
||||
"@babel/parser": "^7.9.6",
|
||||
"async-validator": "^1.11.2",
|
||||
"axios": "0.18.1",
|
||||
"babel-polyfill": "^6.26.0",
|
||||
"clipboard": "2.0.4",
|
||||
"codemirror": "5.45.0",
|
||||
"core-js": "^2.6.11",
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 4.2 KiB After Width: | Height: | Size: 4.2 KiB |
@@ -14,7 +14,6 @@ couponFrom.install = function(Vue, options) {
|
||||
instance.$mount(document.createElement('div'))
|
||||
document.body.appendChild(instance.$el)
|
||||
Vue.prototype.$modalCoupon = function(handle, keyNum, coupons=[], callback, userIds='') {
|
||||
console.log( userIds)
|
||||
instance.visible = true
|
||||
instance.handle = handle
|
||||
instance.keyNum = keyNum
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import Vue from 'vue'
|
||||
|
||||
import '@babel/polyfill'
|
||||
// import 'babel-polyfill'
|
||||
import Cookies from 'js-cookie'
|
||||
|
||||
import 'normalize.css/normalize.css' // a modern alternative to CSS resets
|
||||
@@ -105,6 +106,10 @@ if (vconsole !== undefined && vconsole === md5Crmeb) {
|
||||
new Module.default();
|
||||
});
|
||||
}
|
||||
// 自定义实现String 类型的replaceAll方法
|
||||
String.prototype.replaceAll = function(s1, s2) {
|
||||
return this.replace(new RegExp(s1, "gm"), s2);
|
||||
}
|
||||
// Vue.prototype.$modalCoupon = modalCoupon
|
||||
/**
|
||||
* If you don't want to use mock-server
|
||||
@@ -185,6 +190,10 @@ function newVue(attrs, main, html) {
|
||||
}).$mount('#app')
|
||||
}
|
||||
|
||||
String.prototype.replaceAll = function(s1, s2) {
|
||||
return this.replace(new RegExp(s1, "gm"), s2);
|
||||
}
|
||||
|
||||
new Vue({
|
||||
el: '#app',
|
||||
router,
|
||||
|
||||
@@ -83,7 +83,19 @@ export function Mul(arg1, arg2) {
|
||||
//替换安全域名
|
||||
export function setDomain(url) {
|
||||
url = url ? url.toString() : '';
|
||||
//本地调试打开,生产请注销
|
||||
if (url.indexOf("https://") > -1) return url;
|
||||
else return url.replace('http://', 'https://');
|
||||
// 正则替换存在的转义符
|
||||
url = url.replace(/\\/g,'');
|
||||
url = url.replace('http://','https://');
|
||||
if(url.startsWith('src="')){
|
||||
url = url.replaceAll('src="','');
|
||||
}
|
||||
if(url.startsWith('//img')){
|
||||
url = url.replace('//img','https://img');
|
||||
}
|
||||
return url;
|
||||
}
|
||||
|
||||
// 过滤富文本中的 img 相对路径访问
|
||||
export function replaceImgSrcHttps(content) {
|
||||
return content.replaceAll('src="//','src="https://');
|
||||
}
|
||||
|
||||
@@ -4,22 +4,17 @@ import store from '@/store'
|
||||
import { getToken } from '@/utils/auth'
|
||||
import SettingMer from '@/utils/settingMer'
|
||||
import { isPhone } from "@/libs/wechat";
|
||||
// create an axios instance
|
||||
const service = axios.create({
|
||||
baseURL: SettingMer.apiBaseURL, // url = base url + request url
|
||||
// withCredentials: true, // send cookies when cross-domain requests
|
||||
timeout: 20000 // request timeout
|
||||
baseURL: SettingMer.apiBaseURL,
|
||||
timeout: 20000 // 过期时间
|
||||
})
|
||||
|
||||
// request interceptor
|
||||
service.interceptors.request.use(
|
||||
config => {
|
||||
// do something before request is sent
|
||||
// 发送请求之前做的
|
||||
const token = !store.getters.token?sessionStorage.getItem('token'):store.getters.token;
|
||||
if (token) {
|
||||
// let each request carry token
|
||||
// ['X-Token'] is a custom headers key
|
||||
// please modify it according to the actual situationf
|
||||
config.headers['Authori-zation'] = token
|
||||
}
|
||||
if(/get/i.test(config.method)){
|
||||
@@ -29,7 +24,6 @@ service.interceptors.request.use(
|
||||
return config
|
||||
},
|
||||
error => {
|
||||
// do something with request error
|
||||
return Promise.reject(error)
|
||||
}
|
||||
)
|
||||
|
||||
@@ -7,7 +7,6 @@ export default {// 设置选中的方法
|
||||
// 如果总记忆中还没有选择的数据,那么就直接取当前页选中的数据,不需要后面一系列计算
|
||||
if (multipleSelectionAll.length <= 0) {
|
||||
multipleSelectionAll=multipleSelection
|
||||
console.log(multipleSelectionAll)
|
||||
successFn(multipleSelectionAll)
|
||||
return
|
||||
}
|
||||
@@ -23,8 +22,6 @@ export default {// 设置选中的方法
|
||||
// 如果总选择里面不包含当前页选中的数据,那么就加入到总选择集合里
|
||||
if (selectAllIds.indexOf(row[idKey]) < 0) {
|
||||
multipleSelectionAll.push(row)
|
||||
console.log(multipleSelectionAll)
|
||||
// successFn(multipleSelectionAll)
|
||||
}
|
||||
})
|
||||
const noSelectIds = []
|
||||
@@ -40,8 +37,6 @@ export default {// 设置选中的方法
|
||||
if (multipleSelectionAll[i][idKey] == uid) {
|
||||
// 如果总选择中有未被选中的,那么就删除这条
|
||||
multipleSelectionAll.splice(i, 1)
|
||||
console.log(multipleSelectionAll)
|
||||
//successFn(multipleSelectionAll)
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
:visible.sync="editDataConfig.visible"
|
||||
append-to-body
|
||||
destroy-on-close
|
||||
width="700px"
|
||||
>
|
||||
<edit
|
||||
v-if="editDataConfig.visible"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-form ref="selfForm" :model="selfForm" label-width="100px">
|
||||
<el-form ref="selfForm" :model="selfForm" label-width="120px">
|
||||
<el-form-item label="排序" prop="sort" :rules="[{ required: true, message:'排序不能为空', trigger:['blur','change'] }]">
|
||||
<el-input-number v-model="selfForm.sort" />
|
||||
</el-form-item>
|
||||
@@ -11,8 +11,7 @@
|
||||
>
|
||||
<el-switch
|
||||
v-model="selfForm.status"
|
||||
active-color="#13ce66"
|
||||
inactive-color="#ff4949"
|
||||
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
@@ -1,869 +0,0 @@
|
||||
<template>
|
||||
<div class="divBox">
|
||||
<el-card class="box-card">
|
||||
<div slot="header" class="clearfix">
|
||||
<el-steps :active="currentTab" align-center finish-status="success">
|
||||
<el-step title="选择秒杀商品" />
|
||||
<el-step title="填写基础信息" />
|
||||
<el-step title="修改商品详情" />
|
||||
</el-steps>
|
||||
</div>
|
||||
<el-form
|
||||
ref="formValidate"
|
||||
v-loading="fullscreenLoading"
|
||||
class="formValidate mt20"
|
||||
:rules="ruleValidate"
|
||||
:model="formValidate"
|
||||
label-width="150px"
|
||||
@submit.native.prevent
|
||||
>
|
||||
<!-- 砍价商品-->
|
||||
<div v-show="currentTab === 0">
|
||||
<el-form-item label="选择商品:" prop="image">
|
||||
<div class="upLoadPicBox" @click="changeGood">
|
||||
<div v-if="formValidate.image" class="pictrue"><img :src="formValidate.image"></div>
|
||||
<div v-else class="upLoad">
|
||||
<i class="el-icon-camera cameraIconfont"/>
|
||||
</div>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</div>
|
||||
<!-- 商品信息-->
|
||||
<div v-show="currentTab === 1">
|
||||
<el-row :gutter="24">
|
||||
<el-col :span="24">
|
||||
<el-form-item label="商品主图:" prop="image">
|
||||
<div class="upLoadPicBox" @click="modalPicTap('1')">
|
||||
<div v-if="formValidate.image" class="pictrue"><img :src="formValidate.image"></div>
|
||||
<div v-else class="upLoad">
|
||||
<i class="el-icon-camera cameraIconfont" />
|
||||
</div>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="商品轮播图:" prop="images">
|
||||
<div class="acea-row">
|
||||
<div
|
||||
v-for="(item,index) in formValidate.imagess"
|
||||
:key="index"
|
||||
class="pictrue"
|
||||
draggable="true"
|
||||
@dragstart="handleDragStart($event, item)"
|
||||
@dragover.prevent="handleDragOver($event, item)"
|
||||
@dragenter="handleDragEnter($event, item)"
|
||||
@dragend="handleDragEnd($event, item)"
|
||||
>
|
||||
<img :src="item">
|
||||
<i class="el-icon-error btndel" @click="handleRemove(index)" />
|
||||
</div>
|
||||
<div v-if="formValidate.imagess.length<10" class="upLoadPicBox" @click="modalPicTap('2')">
|
||||
<div class="upLoad">
|
||||
<i class="el-icon-camera cameraIconfont" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="砍价活动名称:" prop="title">
|
||||
<el-input v-model="formValidate.title" placeholder="请输入商品名称" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="砍价活动简介:">
|
||||
<el-input v-model="formValidate.info" maxlength="250" type="textarea" :rows="3" placeholder="请输入商品简介" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col v-bind="grid2">
|
||||
<el-form-item label="单位:" prop="unitName">
|
||||
<el-input v-model="formValidate.unitName" placeholder="请输入单位" class="selWidthd"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col v-bind="grid2">
|
||||
<el-form-item label="排序:" prop="sort">
|
||||
<el-input v-model="formValidate.sort" placeholder="请输入排序" class="selWidthd"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="活动时间:">
|
||||
<el-date-picker
|
||||
class="mr20"
|
||||
v-model="timeVal"
|
||||
type="daterange"
|
||||
value-format="yyyy-MM-dd"
|
||||
format="yyyy-MM-dd"
|
||||
range-separator="至"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
@change="onchangeTime">
|
||||
</el-date-picker>
|
||||
<span>设置活动开启结束时间,用户可以在设置时间内发起参与砍价</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="砍价人数:" prop="peopleNum">
|
||||
<el-input-number v-model="formValidate.peopleNum" :min="1" :step="1" step-strictly step-strictly placeholder="请输入砍价人数" class="selWidthd mr20"/>
|
||||
<span>需邀请多少人砍价成功</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="帮砍次数:" prop="bargainNum">
|
||||
<el-input-number v-model="formValidate.bargainNum" :min="1" :step="1" step-strictly placeholder="请输入帮砍次数" class="selWidthd mr20"/>
|
||||
<span>单个商品用户可以帮砍的次数,例:次数设置为1,甲和乙同时将商品A的砍价链接发给丙,丙只能帮甲或乙其中一个人砍价</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="购买数量限制:" prop="num">
|
||||
<el-input-number v-model="formValidate.num" :min="1" :step="1" step-strictly placeholder="请输入购买数量限制" class="selWidthd mr20"/>
|
||||
<span>单个活动每个用户发起砍价次数限制</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col v-bind="grid2">
|
||||
<el-form-item label="运费模板:" prop="tempId">
|
||||
<div class="acea-row">
|
||||
<el-select v-model="formValidate.tempId" placeholder="请选择" class="selWidthd">
|
||||
<el-option
|
||||
v-for="item in shippingList"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
<!--<el-button class="mr15" @click="addTem">添加运费模板</el-button>-->
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="活动状态:" required>
|
||||
<el-radio-group v-model="formValidate.status">
|
||||
<el-radio :label="0" class="radio">关闭</el-radio>
|
||||
<el-radio :label="1">开启</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<!-- 规格表格-->
|
||||
<el-col :span="24">
|
||||
<el-form-item label="商品属性:" class="labeltop" required>
|
||||
<el-table
|
||||
ref="multipleTable"
|
||||
:data="formValidate.ManyAttrValue"
|
||||
tooltip-effect="dark"
|
||||
style="width: 100%">
|
||||
<el-table-column label="选择" min-width="60">
|
||||
<template slot-scope="scope">
|
||||
<el-radio v-model="radio" :label="scope.row"
|
||||
@change.native="changeType(scope.row)"
|
||||
>
|
||||
</el-radio>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<template v-if="manyTabDate && formValidate.specType">
|
||||
<el-table-column v-for="(item,iii) in manyTabDate" :key="iii" align="center" :label="manyTabTit[iii].title" min-width="80">
|
||||
<template slot-scope="scope">
|
||||
<span class="priceBox" v-text="scope.row[iii]" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
</template>
|
||||
<el-table-column align="center" label="图片" min-width="80">
|
||||
<template slot-scope="scope">
|
||||
<div class="upLoadPicBox" @click="modalPicTap('1','duo',scope.$index)">
|
||||
<div v-if="scope.row.image" class="pictrue tabPic"><img :src="scope.row.image"></div>
|
||||
<div v-else class="upLoad tabPic">
|
||||
<i class="el-icon-camera cameraIconfont" />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column v-for="(item,iii) in attrValue" :key="iii" :label="formThead[iii].title" align="center" min-width="140">
|
||||
<template slot-scope="{row,$index}">
|
||||
<template v-if="formThead[iii].title === '砍价起始金额'">
|
||||
<el-form-item
|
||||
:prop="`multipleSelection.${$index}.price`"
|
||||
:rules="ruleValidate.price"
|
||||
class="inpBox"
|
||||
>
|
||||
<el-input-number
|
||||
size="small"
|
||||
v-model="row[iii]"
|
||||
:min="0"
|
||||
:precision="2" :step="0.1"
|
||||
class="priceBox"
|
||||
/>
|
||||
</el-form-item>
|
||||
</template>
|
||||
<template v-else-if="formThead[iii].title === '砍价最低价'">
|
||||
<el-form-item
|
||||
:prop="`ManyAttrValue.${$index}.minPrice`"
|
||||
:rules="ruleValidate.minPrice"
|
||||
class="inpBox"
|
||||
>
|
||||
<el-input-number
|
||||
size="small"
|
||||
v-model="row[iii]"
|
||||
:min="0"
|
||||
:max="parseFloat(row.price)"
|
||||
:precision="2" :step="0.1"
|
||||
class="priceBox"
|
||||
/>
|
||||
</el-form-item>
|
||||
</template>
|
||||
<template v-else-if="formThead[iii].title === '限量'">
|
||||
<el-form-item
|
||||
:prop="`ManyAttrValue.${$index}.quota`"
|
||||
:rules="ruleValidate.quota"
|
||||
class="inpBox"
|
||||
>
|
||||
<el-input-number
|
||||
size="small"
|
||||
v-model="row[iii]"
|
||||
type="number"
|
||||
:min="1"
|
||||
:max="row.stock"
|
||||
:step="1" step-strictly
|
||||
class="priceBox"
|
||||
@change="inpChange(row[iii], row.id)"
|
||||
/>
|
||||
</el-form-item>
|
||||
</template>
|
||||
<span v-else v-text="row[iii]" class="priceBox" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
<!-- 商品详情-->
|
||||
<div v-show="currentTab === 2">
|
||||
<el-form-item label="商品详情:">
|
||||
<ueditor-from v-model="formValidate.content" :content="formValidate.content" />
|
||||
</el-form-item>
|
||||
<el-form-item label="商品规则:">
|
||||
<ueditor-from v-model="formValidate.rule" :content="formValidate.rule" />
|
||||
</el-form-item>
|
||||
</div>
|
||||
<el-form-item style="margin-top:30px;">
|
||||
<el-button
|
||||
v-show="(!$route.params.id && currentTab > 0) || ($route.params.id && currentTab===2)"
|
||||
type="primary"
|
||||
class="submission"
|
||||
size="small"
|
||||
@click="handleSubmitUp"
|
||||
>上一步</el-button>
|
||||
<el-button
|
||||
v-show="currentTab == 0"
|
||||
type="primary"
|
||||
class="submission"
|
||||
size="small"
|
||||
@click="handleSubmitNest1('formValidate')"
|
||||
>下一步</el-button>
|
||||
<el-button
|
||||
v-show="currentTab == 1"
|
||||
type="primary"
|
||||
class="submission"
|
||||
size="small"
|
||||
@click="handleSubmitNest2('formValidate')"
|
||||
>下一步</el-button>
|
||||
<el-button
|
||||
v-show="currentTab===2"
|
||||
:loading="loading"
|
||||
type="primary"
|
||||
class="submission"
|
||||
size="small"
|
||||
@click="handleSubmit('formValidate')"
|
||||
>提交</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
<CreatTemplates ref="addTemplates" @getList="getShippingList" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { productDetailApi, categoryApi } from '@/api/store'
|
||||
import { shippingTemplatesList } from '@/api/logistics'
|
||||
import { getSeckillList } from '@/libs/public'
|
||||
import { bargainSaveApi, bargainUpdateApi, bargainInfoApi } from '@/api/marketing'
|
||||
import CreatTemplates from '@/views/systemSetting/logistics/shippingTemplates/creatTemplates'
|
||||
const defaultObj = {
|
||||
image: '',
|
||||
images: '',
|
||||
imagess: [],
|
||||
title: '',
|
||||
info: '',
|
||||
num: 1,
|
||||
unitName: '',
|
||||
sort: 0,
|
||||
giveIntegral: 0,
|
||||
ficti: 0,
|
||||
isShow: false,
|
||||
tempId: '',
|
||||
attrValue: [{
|
||||
image: '',
|
||||
price: 0,
|
||||
minPrice: 0,
|
||||
cost: 0,
|
||||
otPrice: 0,
|
||||
stock: 0,
|
||||
quota: 1,
|
||||
weight: 0,
|
||||
volume: 0,
|
||||
barCode: ''
|
||||
}],
|
||||
attr: [],
|
||||
selectRule: '',
|
||||
content: '',
|
||||
specType: false,
|
||||
id: 0,
|
||||
// productId: 0,
|
||||
timeId: '',
|
||||
startTime: '',
|
||||
stopTime: '',
|
||||
timeVal: [],
|
||||
status: 0,
|
||||
rule: '',
|
||||
ManyAttrValue: [{
|
||||
image: '',
|
||||
price: 0,
|
||||
minPrice: 0,
|
||||
cost: 0,
|
||||
otPrice: 0,
|
||||
stock: 0,
|
||||
quota: 1,
|
||||
weight: 0,
|
||||
volume: 0,
|
||||
barCode: ''
|
||||
}], // 多规格
|
||||
multipleSelection: [{
|
||||
image: '',
|
||||
price: 0,
|
||||
minPrice: 0,
|
||||
cost: 0,
|
||||
otPrice: 0,
|
||||
stock: 0,
|
||||
quota: 1,
|
||||
weight: 0,
|
||||
volume: 0,
|
||||
barCode: ''
|
||||
}]
|
||||
}
|
||||
const objTitle = {
|
||||
price: {
|
||||
title: '砍价起始金额'
|
||||
},
|
||||
minPrice: {
|
||||
title: '砍价最低价'
|
||||
},
|
||||
cost: {
|
||||
title: '成本价'
|
||||
},
|
||||
otPrice: {
|
||||
title: '原价'
|
||||
},
|
||||
stock: {
|
||||
title: '库存'
|
||||
},
|
||||
quota: {
|
||||
title: "限量",
|
||||
},
|
||||
weight: {
|
||||
title: '重量(KG)'
|
||||
},
|
||||
volume: {
|
||||
title: '体积(m³)'
|
||||
},
|
||||
barCode: {
|
||||
title: '商品编号'
|
||||
}
|
||||
}
|
||||
export default {
|
||||
name: "creatSeckill",
|
||||
components: { CreatTemplates },
|
||||
data() {
|
||||
return {
|
||||
props2: {
|
||||
children: 'child',
|
||||
label: 'name',
|
||||
value: 'id',
|
||||
multiple: true,
|
||||
emitPath: false
|
||||
},
|
||||
grid2: {
|
||||
xl: 8,
|
||||
lg: 10,
|
||||
md: 12,
|
||||
sm: 24,
|
||||
xs: 24
|
||||
},
|
||||
currentTab: 0,
|
||||
formThead: Object.assign({}, objTitle),
|
||||
formValidate: {},
|
||||
loading: false,
|
||||
fullscreenLoading: false,
|
||||
merCateList: [], // 商户分类筛选
|
||||
shippingList: [], // 运费模板
|
||||
seckillTime: [],
|
||||
ruleValidate: {
|
||||
productId: [
|
||||
{ required: true, message: '请选择商品', trigger: 'change' }
|
||||
],
|
||||
title: [
|
||||
{ required: true, message: '请输入商品标题', trigger: 'blur' }
|
||||
],
|
||||
attrValue: [
|
||||
{ required: true, message: '请选择商品属相', trigger: 'change', type: 'array', min: '1' }
|
||||
],
|
||||
num: [
|
||||
{ required: true, message: '请输入购买数量限制', trigger: 'blur' }
|
||||
],
|
||||
unitName: [
|
||||
{ required: true, message: '请输入单位', trigger: 'blur' }
|
||||
],
|
||||
info: [
|
||||
{ required: true, message: '请输入秒杀商品简介', trigger: 'blur' }
|
||||
],
|
||||
tempId: [
|
||||
{ required: true, message: '请选择运费模板', trigger: 'change' }
|
||||
],
|
||||
timeId: [
|
||||
{ required: true, message: '请选择活动时间', trigger: 'change' }
|
||||
],
|
||||
image: [
|
||||
{ required: true, message: '请上传商品图', trigger: 'change' }
|
||||
],
|
||||
imagess: [
|
||||
{ required: true, message: '请上传商品轮播图', type: 'array', trigger: 'change' }
|
||||
],
|
||||
specType: [
|
||||
{ required: true, message: '请选择商品规格', trigger: 'change' }
|
||||
],
|
||||
timeVal:[
|
||||
{ required: true, message: '请选择活动日期', trigger: 'change', type: 'array'}
|
||||
],
|
||||
bargainNum:[
|
||||
{ required: true, message: '请输入帮砍次数', trigger: 'blur'}
|
||||
],
|
||||
peopleNum: [
|
||||
{ required: true, message: '请输入砍价人数', trigger: 'blur'}
|
||||
],
|
||||
price: [
|
||||
{ required: true, message: '请输入砍价起始金额', trigger: 'blur'}
|
||||
],
|
||||
minPrice: [
|
||||
{ required: true, message: '请输入砍价最低金额', trigger: 'blur'}
|
||||
],
|
||||
quota: [
|
||||
{ required: true, message: '请输入限量', trigger: 'blur'}
|
||||
]
|
||||
},
|
||||
manyTabDate: {},
|
||||
manyTabTit: {},
|
||||
attrInfo: {},
|
||||
tempRoute: {},
|
||||
multipleSelection: [Object.assign({}, defaultObj.attrValue[0])],
|
||||
productId: 0,
|
||||
timeVal: [],
|
||||
radio: '',
|
||||
ManyAttrValue: [Object.assign({}, defaultObj.attrValue[0])], // 多规格
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
attrValue() {
|
||||
const obj = Object.assign({}, defaultObj.attrValue[0])
|
||||
delete obj.image
|
||||
return obj
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.$watch('formValidate.attr', this.watCh)
|
||||
this.tempRoute = Object.assign({}, this.$route)
|
||||
},
|
||||
mounted() {
|
||||
getSeckillList(1).then((res) => {
|
||||
this.seckillTime = res.list
|
||||
})
|
||||
this.formValidate.imagess = []
|
||||
if ( this.$route.params.id ) {
|
||||
this.setTagsViewTitle()
|
||||
this.getInfo()
|
||||
this.currentTab = 1
|
||||
}
|
||||
this.getShippingList()
|
||||
this.getCategorySelect()
|
||||
},
|
||||
methods: {
|
||||
changeType(row, index){
|
||||
row.checked = true;
|
||||
this.formValidate.multipleSelection = [row];
|
||||
},
|
||||
inpChange(currentValue, id){
|
||||
// this.ManyAttrValue.map(item => {
|
||||
// if(!currentValue && item.id ===id){
|
||||
// item.quota = 1
|
||||
// this.$set(item, 'quota', 1)
|
||||
// this.ManyAttrValue = Object.assign([], this.ManyAttrValue)
|
||||
// }
|
||||
// })
|
||||
|
||||
console.log(this.ManyAttrValue)
|
||||
// if(!currentValue) item.quota = 1
|
||||
},
|
||||
watCh(val) {
|
||||
const tmp = {}
|
||||
const tmpTab = {}
|
||||
this.formValidate.attr.forEach((o, i) => {
|
||||
tmp['value' + i] = { title: o.attrName }
|
||||
tmpTab['value' + i] = ''
|
||||
})
|
||||
this.manyTabTit = tmp
|
||||
this.manyTabDate = tmpTab
|
||||
this.formThead = Object.assign({}, this.formThead, tmp)
|
||||
},
|
||||
handleRemove (i) {
|
||||
this.formValidate.imagess.splice(i, 1)
|
||||
},
|
||||
// 点击商品图
|
||||
modalPicTap (tit, num, i) {
|
||||
const _this = this
|
||||
this.$modalUpload(function(img) {
|
||||
if(tit==='1'&& !num){
|
||||
_this.formValidate.image = img[0].sattDir
|
||||
_this.formValidate.ManyAttrValue[0].image = img[0].sattDir
|
||||
}
|
||||
if(tit==='2'&& !num){
|
||||
if(img.length>10) return this.$message.warning("最多选择10张图片!");
|
||||
if(img.length + _this.formValidate.imagess.length > 10) return this.$message.warning("最多选择10张图片!");
|
||||
img.map((item) => {
|
||||
_this.formValidate.imagess.push(item.sattDir)
|
||||
});
|
||||
}
|
||||
if(tit==='1'&& num === 'duo' ){
|
||||
_this.specType ? _this.formValidate.ManyAttrValue[i].image = img[0].sattDir : _this.formValidate.ManyAttrValue[0].image = img[0].sattDir
|
||||
}
|
||||
},tit, 'content')
|
||||
},
|
||||
// 具体日期
|
||||
onchangeTime(e) {
|
||||
this.formValidate.timeVal = e;
|
||||
this.formValidate.startTime = e ? e[0] : "";
|
||||
this.formValidate.stopTime = e ? e[1] : "";
|
||||
},
|
||||
changeGood(){
|
||||
const _this = this
|
||||
this.$modalGoodList(function(row) {
|
||||
_this.formValidate.image = row.image
|
||||
_this.productId = row.id
|
||||
// _this.formValidate.productId = row.id
|
||||
})
|
||||
},
|
||||
handleSubmitNest1() {
|
||||
if (!this.formValidate.image) {
|
||||
this.$message.warning("请选择商品!");
|
||||
return;
|
||||
} else {
|
||||
this.currentTab++;
|
||||
if (!this.$route.params.id) this.getProdect(this.productId);
|
||||
}
|
||||
},
|
||||
// 商品分类;
|
||||
getCategorySelect() {
|
||||
categoryApi({ status: -1, type: 1 }).then(res => {
|
||||
this.merCateList = this.filerMerCateList(res)
|
||||
})
|
||||
},
|
||||
filerMerCateList(treeData) {
|
||||
return treeData.map((item) => {
|
||||
if(!item.child){
|
||||
item.disabled = true
|
||||
}
|
||||
item.label = item.name
|
||||
return item
|
||||
})
|
||||
},
|
||||
// 运费模板;
|
||||
getShippingList() {
|
||||
shippingTemplatesList(this.tempData).then(res => {
|
||||
this.shippingList = res.list
|
||||
})
|
||||
},
|
||||
// 运费模板
|
||||
addTem() {
|
||||
this.$refs.addTemplates.dialogVisible = true
|
||||
this.$refs.addTemplates.getCityList()
|
||||
},
|
||||
// 商品详情
|
||||
getInfo () {
|
||||
if(!this.$route.params.id){
|
||||
this.getProdect(this.productId)
|
||||
}else{
|
||||
this.getSekllProdect(this.$route.params.id)
|
||||
}
|
||||
},
|
||||
getProdect(id) {
|
||||
this.fullscreenLoading = true
|
||||
productDetailApi(id).then(async res => {
|
||||
let info = res
|
||||
this.formValidate = info;
|
||||
this.formValidate.imagess = JSON.parse(info.sliderImage);
|
||||
this.formValidate.title = info.storeName;
|
||||
this.formValidate.proName = info.storeName;
|
||||
this.formValidate.info = info.storeInfo;
|
||||
this.formValidate.productId = info.id;
|
||||
this.formValidate.timeId = this.$route.params.id ? Number(info.timeId) : this.$route.params.timeId ? Number(this.$route.params.timeId) : '';
|
||||
this.formValidate.startTime = info.startTime || '';
|
||||
this.formValidate.stopTime = info.stopTime || '';
|
||||
this.formValidate.timeVal = [];
|
||||
this.formValidate.status = 0;
|
||||
this.formValidate.num = 1;
|
||||
this.formValidate.rule = '';
|
||||
this.formValidate.peopleNum = 1;
|
||||
this.formValidate.bargainNum = 1;
|
||||
if(info.specType){
|
||||
info.attrValues.forEach((row) => {
|
||||
row.quota = row.stock;
|
||||
});
|
||||
this.formValidate.ManyAttrValue = info.attrValues
|
||||
this.multipleSelection = info.attrValues
|
||||
}else{
|
||||
info.attrValue.forEach((row) => {
|
||||
row.quota = row.stock;
|
||||
});
|
||||
this.formValidate.ManyAttrValue = info.attrValue
|
||||
this.radio = info.attrValue[0]
|
||||
this.formValidate.attr = []
|
||||
}
|
||||
this.fullscreenLoading = false
|
||||
}).catch(res => {
|
||||
this.fullscreenLoading = false
|
||||
})
|
||||
},
|
||||
getSekllProdect(id) {
|
||||
this.fullscreenLoading = true
|
||||
bargainInfoApi({id:id}).then(async res => {
|
||||
let info = res;
|
||||
this.formValidate = info;
|
||||
this.formValidate.proName = info.title;
|
||||
this.formValidate.imagess = JSON.parse(info.sliderImage);
|
||||
this.formValidate.timeId = Number(info.timeId);
|
||||
this.timeVal = info.startTime && info.stopTime ? [info.startTime, info.stopTime] : []
|
||||
if(info.specType){
|
||||
this.formValidate.ManyAttrValue = info.attrValues;
|
||||
this.$nextTick(() => {
|
||||
this.formValidate.ManyAttrValue.forEach((item, index) => {
|
||||
if (item.checked) {
|
||||
this.$set(item, 'price', item.price)
|
||||
this.$set(item, 'quota', item.quota)
|
||||
this.radio = item
|
||||
}
|
||||
})
|
||||
});
|
||||
}else{
|
||||
this.formValidate.ManyAttrValue = info.attrValue;
|
||||
this.formValidate.attr = [];
|
||||
this.radio = info.attrValue[0];
|
||||
}
|
||||
this.fullscreenLoading = false
|
||||
}).catch(res => {
|
||||
this.fullscreenLoading = false
|
||||
})
|
||||
},
|
||||
handleSubmitNest2(name) {
|
||||
this.$refs[name].validate((valid) => {
|
||||
if (valid) {
|
||||
if(this.formValidate.specType && this.multipleSelection.length ===0 ) return this.$message.warning("请选择至少一个商品属性!");
|
||||
return this.$message.warning("请填写完整信息!");
|
||||
this.currentTab++;
|
||||
// this.multipleSelection.every((value, index) => {
|
||||
// if(!value.quota){
|
||||
// this.$message.warning("请填选择至少一个商品属性!");
|
||||
// return false;
|
||||
// }else{
|
||||
// this.currentTab++;
|
||||
// return true;
|
||||
// }
|
||||
// });
|
||||
// for(i = 0; i < this.multipleSelection.length; i++){
|
||||
// if(!this.multipleSelection[i].quota){
|
||||
// break;
|
||||
// }else{
|
||||
// this.currentTab++;
|
||||
// }
|
||||
// }
|
||||
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
// 提交
|
||||
handleSubmit(name) {
|
||||
if(!this.formValidate.specType){
|
||||
this.formValidate.attr = []
|
||||
this.formValidate.attrValue = this.formValidate.ManyAttrValue
|
||||
}else{
|
||||
this.formValidate.attrValue = this.multipleSelection
|
||||
}
|
||||
this.formValidate.images = JSON.stringify(this.formValidate.imagess)
|
||||
this.$refs[name].validate((valid) => {
|
||||
if (valid) {
|
||||
this.fullscreenLoading = true;
|
||||
this.loading = true;
|
||||
this.$route.params.id
|
||||
? bargainUpdateApi({id: this.$route.params.id}, this.formValidate)
|
||||
.then(async () => {
|
||||
this.fullscreenLoading = false;
|
||||
this.$message.success('编辑成功');
|
||||
this.$router.push({
|
||||
path: "/marketing/bargain/bargainGoods",
|
||||
});
|
||||
this.$refs[name].resetFields();
|
||||
this.formValidate.images = [];
|
||||
this.loading = false;
|
||||
})
|
||||
.catch(() => {
|
||||
this.fullscreenLoading = false;
|
||||
this.loading = false;
|
||||
})
|
||||
: bargainSaveApi(this.formValidate)
|
||||
.then(async (res) => {
|
||||
this.fullscreenLoading = false;
|
||||
this.$message.success('新增成功');
|
||||
this.$router.push({
|
||||
path: "/marketing/bargain/bargainGoods",
|
||||
});
|
||||
this.$refs[name].resetFields();
|
||||
this.formValidate.images = [];
|
||||
this.loading = false;
|
||||
})
|
||||
.catch(() => {
|
||||
this.fullscreenLoading = false;
|
||||
this.loading = false;
|
||||
});
|
||||
} else {
|
||||
if (
|
||||
!this.formValidate.storeName ||
|
||||
!this.formValidate.unitName ||
|
||||
!this.formValidate.store_info ||
|
||||
!this.formValidate.image ||
|
||||
!this.formValidate.images
|
||||
) {
|
||||
this.$message.warning("请填写完整商品信息!");
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
},
|
||||
handleSubmitUp() {
|
||||
if (this.currentTab-- < 0) this.currentTab = 0;
|
||||
},
|
||||
setTagsViewTitle() {
|
||||
const title = '编辑秒杀商品'
|
||||
const route = Object.assign({}, this.tempRoute, { title: `${title}-${this.$route.params.id}` })
|
||||
this.$store.dispatch('tagsView/updateVisitedView', route)
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.inpBox{
|
||||
/deep/.el-form-item__error {
|
||||
line-height: 20px !important;
|
||||
position: static !important;
|
||||
}
|
||||
}
|
||||
.labeltop{
|
||||
/deep/.el-input-number--small{
|
||||
/*width: 172px !important;*/
|
||||
min-width: 132px !important;
|
||||
}
|
||||
}
|
||||
|
||||
.proCoupon{
|
||||
/deep/.el-form-item__content{
|
||||
margin-top: 5px;
|
||||
}
|
||||
}
|
||||
.tabPic{
|
||||
width: 40px !important;
|
||||
height: 40px !important;
|
||||
img{
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
.noLeft{
|
||||
/deep/.el-form-item__content{
|
||||
margin-left: 0 !important;
|
||||
}
|
||||
}
|
||||
.tabNumWidth{
|
||||
/deep/.el-input-number--medium{
|
||||
width: 121px !important;
|
||||
}
|
||||
/deep/.el-input-number__increase{
|
||||
width: 20px !important;
|
||||
font-size: 12px !important;
|
||||
}
|
||||
/deep/.el-input-number__decrease{
|
||||
width: 20px !important;
|
||||
font-size: 12px !important;
|
||||
}
|
||||
/deep/.el-input-number--medium .el-input__inner {
|
||||
padding-left: 25px !important;
|
||||
padding-right: 25px !important;
|
||||
}
|
||||
/deep/ thead{
|
||||
line-height: normal !important;
|
||||
}
|
||||
/deep/ .el-table .cell{
|
||||
line-height: normal !important;
|
||||
}
|
||||
}
|
||||
.selWidth{
|
||||
width: 80%;
|
||||
}
|
||||
.selWidthd{
|
||||
width: 350px;
|
||||
}
|
||||
.button-new-tag {
|
||||
height: 28px;
|
||||
line-height: 26px;
|
||||
padding-top: 0;
|
||||
padding-bottom: 0;
|
||||
}
|
||||
.input-new-tag {
|
||||
width: 90px;
|
||||
margin-left: 10px;
|
||||
vertical-align: bottom;
|
||||
}
|
||||
.pictrue{
|
||||
width: 60px;
|
||||
height: 60px;
|
||||
border: 1px dotted rgba(0,0,0,0.1);
|
||||
margin-right: 10px;
|
||||
position: relative;
|
||||
cursor: pointer;
|
||||
img{
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
.btndel{
|
||||
position: absolute;
|
||||
z-index: 1;
|
||||
width :20px !important;
|
||||
height: 20px !important;
|
||||
left: 46px;
|
||||
top: -4px;
|
||||
}
|
||||
.labeltop{
|
||||
/deep/.el-form-item__label{
|
||||
/*float: none !important;*/
|
||||
/*display: inline-block !important;*/
|
||||
/*margin-left: 120px !important;*/
|
||||
/*width: auto !important;*/
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -204,7 +204,6 @@
|
||||
:max="row.stock"
|
||||
:step="1" step-strictly
|
||||
class="priceBox"
|
||||
@change="inpChange(row[iii], row.id)"
|
||||
/>
|
||||
<span v-else v-text="row[iii]" class="priceBox" />
|
||||
</template>
|
||||
@@ -451,18 +450,6 @@
|
||||
row.checked = true;
|
||||
this.multipleSelection = [row];
|
||||
},
|
||||
inpChange(currentValue, id){
|
||||
// this.ManyAttrValue.map(item => {
|
||||
// if(!currentValue && item.id ===id){
|
||||
// item.quota = 1
|
||||
// this.$set(item, 'quota', 1)
|
||||
// this.ManyAttrValue = Object.assign([], this.ManyAttrValue)
|
||||
// }
|
||||
// })
|
||||
|
||||
console.log(this.ManyAttrValue)
|
||||
// if(!currentValue) item.quota = 1
|
||||
},
|
||||
watCh(val) {
|
||||
const tmp = {}
|
||||
const tmpTab = {}
|
||||
@@ -508,7 +495,6 @@
|
||||
this.$modalGoodList(function(row) {
|
||||
_this.formValidate.image = row.image
|
||||
_this.productId = row.id
|
||||
// _this.formValidate.productId = row.id
|
||||
})
|
||||
},
|
||||
handleSubmitNest1() {
|
||||
@@ -516,8 +502,8 @@
|
||||
this.$message.warning("请选择商品!");
|
||||
return;
|
||||
} else {
|
||||
this.currentTab++;
|
||||
if (!this.$route.params.id) this.getProdect(this.productId);
|
||||
this.currentTab++;
|
||||
if (!this.$route.params.id) this.getProdect(this.productId);
|
||||
}
|
||||
},
|
||||
// 商品分类;
|
||||
@@ -664,6 +650,9 @@
|
||||
if(!this.radio.price) return this.$message.warning("请填写砍价起始金额!");
|
||||
if(!this.radio.minPrice && this.radio.minPrice!=0) return this.$message.warning("请填写砍价最低价!");
|
||||
if(!this.radio.quota) return this.$message.warning("请填写限量!");
|
||||
// 砍价起始金额 >= 砍价人数*0.01 + 砍价最低价
|
||||
let nums = this.formValidate.peopleNum * 0.01 + this.radio.minPrice
|
||||
if(this.radio.price < nums) return this.$message.warning(`砍价起始金额不能小于${nums}!`);
|
||||
}
|
||||
this.currentTab++;
|
||||
} else {
|
||||
|
||||
@@ -468,7 +468,6 @@
|
||||
},
|
||||
handleRemove (i) {
|
||||
this.formValidate.imagelist.splice(i, 1)
|
||||
// this.imagelist=[...this.imagelist];
|
||||
},
|
||||
// 点击商品图
|
||||
modalPicTap (tit, num, i) {
|
||||
@@ -502,7 +501,6 @@
|
||||
this.$modalGoodList(function(row) {
|
||||
_this.formValidate.image = row.image
|
||||
_this.productId = row.id
|
||||
// _this.formValidate.productId = row.id
|
||||
})
|
||||
},
|
||||
handleSubmitNest1() {
|
||||
@@ -550,7 +548,6 @@
|
||||
getProdect(id) {
|
||||
this.fullscreenLoading = true
|
||||
productDetailApi(id).then(async res => {
|
||||
//this.formValidate = res;
|
||||
this.formValidate = {
|
||||
image: this.$selfUtil.setDomain(res.image),
|
||||
imagelist: JSON.parse(res.sliderImage),
|
||||
@@ -608,7 +605,6 @@
|
||||
getSekllProdect(id) {
|
||||
this.fullscreenLoading = true
|
||||
combinationInfoApi({id:id}).then(async res => {
|
||||
//this.formValidate = res;
|
||||
this.formValidate = {
|
||||
image: this.$selfUtil.setDomain(res.image),
|
||||
imagelist: JSON.parse(res.sliderImage),
|
||||
@@ -665,23 +661,6 @@
|
||||
if (valid) {
|
||||
if(this.formValidate.specType && this.multipleSelection.length ===0 ) return this.$message.warning("请选择至少一个商品属性!");
|
||||
this.currentTab++;
|
||||
// this.multipleSelection.every((value, index) => {
|
||||
// if(!value.quota){
|
||||
// this.$message.warning("请填选择至少一个商品属性!");
|
||||
// return false;
|
||||
// }else{
|
||||
// this.currentTab++;
|
||||
// return true;
|
||||
// }
|
||||
// });
|
||||
// for(i = 0; i < this.multipleSelection.length; i++){
|
||||
// if(!this.multipleSelection[i].quota){
|
||||
// break;
|
||||
// }else{
|
||||
// this.currentTab++;
|
||||
// }
|
||||
// }
|
||||
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
label="ID"
|
||||
min-width="50"
|
||||
/>
|
||||
<el-table-column label="拼图图片" min-width="80">
|
||||
<el-table-column label="拼团图片" min-width="80">
|
||||
<template slot-scope="scope">
|
||||
<div class="demo-image__preview">
|
||||
<el-image
|
||||
|
||||
@@ -280,7 +280,6 @@
|
||||
content: '',
|
||||
specType: false,
|
||||
id: 0,
|
||||
// productId: 0,
|
||||
timeId: '',
|
||||
startTime: '',
|
||||
stopTime: '',
|
||||
@@ -620,23 +619,6 @@
|
||||
if (valid) {
|
||||
if(this.formValidate.specType && this.multipleSelection.length ===0 ) return this.$message.warning("请填选择至少一个商品属性!");
|
||||
this.currentTab++;
|
||||
// this.multipleSelection.every((value, index) => {
|
||||
// if(!value.quota){
|
||||
// this.$message.warning("请填选择至少一个商品属性!");
|
||||
// return false;
|
||||
// }else{
|
||||
// this.currentTab++;
|
||||
// return true;
|
||||
// }
|
||||
// });
|
||||
// for(i = 0; i < this.multipleSelection.length; i++){
|
||||
// if(!this.multipleSelection[i].quota){
|
||||
// break;
|
||||
// }else{
|
||||
// this.currentTab++;
|
||||
// }
|
||||
// }
|
||||
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -85,14 +85,12 @@
|
||||
scanType: ["qrCode", "barCode"]
|
||||
})
|
||||
.then(res => {
|
||||
console.log('openQRCode',res)
|
||||
if (res.resultStr) {
|
||||
that.verify_code = res.resultStr;
|
||||
that.storeCancellation();
|
||||
} else that.$dialog.error("没有扫描到什么!");
|
||||
})
|
||||
.catch(res => {
|
||||
console.log('catch', res)
|
||||
if (res.is_ready) {
|
||||
res.wx.scanQRCode({
|
||||
needResult: 1,
|
||||
|
||||
@@ -226,7 +226,7 @@ export default {
|
||||
tableFrom: {
|
||||
page: 1,
|
||||
limit: 20,
|
||||
status: '',
|
||||
status: '3',
|
||||
type: 'sms'
|
||||
},
|
||||
columns2: [],
|
||||
@@ -299,13 +299,10 @@ export default {
|
||||
},
|
||||
watch: {
|
||||
sms (n) {
|
||||
console.log(n)
|
||||
if (n.open === 1) this.getList();
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
console.log(this.isChecked)
|
||||
console.log(this.sms.open)
|
||||
if (this.sms.open === 1) this.getList();
|
||||
// if (this.isChecked === '1' && this.sms.open === 1) this.getList();
|
||||
},
|
||||
|
||||
@@ -254,12 +254,12 @@
|
||||
<template v-if="formValidate.isSub">
|
||||
<el-table-column align="center" label="一级返佣(元)" min-width="120">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.brokerage" type="number" :min="0" class="priceBox" />
|
||||
<el-input v-model="scope.row.brokerage" type="number" :min="0" :max="scope.row.price" class="priceBox" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="二级返佣(元)" min-width="120">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.brokerageTwo" type="number" :min="0" class="priceBox" />
|
||||
<el-input v-model="scope.row.brokerageTwo" type="number" :min="0" :max="scope.row.price" class="priceBox" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
</template>
|
||||
@@ -331,12 +331,12 @@
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="一级返佣(元)" min-width="120" v-if="formValidate.isSub">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.brokerage" type="number" :min="0" class="priceBox" />
|
||||
<el-input v-model="scope.row.brokerage" type="number" :min="0" :max="scope.row.price" class="priceBox" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="二级返佣(元)" min-width="120" v-if="formValidate.isSub">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.brokerageTwo" type="number" :min="0" class="priceBox" />
|
||||
<el-input v-model="scope.row.brokerageTwo" type="number" :min="0" :max="scope.row.price" class="priceBox" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column key="3" align="center" label="操作" min-width="80">
|
||||
@@ -880,11 +880,10 @@
|
||||
isHot: info.isHot,
|
||||
isBest: info.isBest,
|
||||
tempId: info.tempId,
|
||||
// attrValue: info.attrValue,
|
||||
attr: info.attr,
|
||||
selectRule: info.selectRule,
|
||||
isSub: info.isSub,
|
||||
content: info.content,
|
||||
content: this.$selfUtil.replaceImgSrcHttps(info.content),
|
||||
specType: info.specType,
|
||||
id: info.id,
|
||||
giveIntegral: info.giveIntegral,
|
||||
@@ -909,8 +908,7 @@
|
||||
this.formValidate.attr = info.attr.map(item => {
|
||||
return {
|
||||
attrName : item.attrName,
|
||||
attrValue: item.attrValues.split(','),
|
||||
// inputVisible: false
|
||||
attrValue: item.attrValues.split(',')
|
||||
}
|
||||
})
|
||||
this.ManyAttrValue = info.attrValues;
|
||||
|
||||
@@ -119,7 +119,7 @@
|
||||
<el-table-column label="操作" min-width="150" fixed="right" align="center">
|
||||
<template slot-scope="scope">
|
||||
<router-link :to="{path: '/store/list/creatProduct/' + scope.row.id}">
|
||||
<el-button type="text" size="small" class="mr10">编辑</el-button>
|
||||
<el-button type="text" size="small" class="mr10" v-if="tableFrom.type !== '5'">编辑</el-button>
|
||||
</router-link>
|
||||
<el-button v-if="tableFrom.type === '5'" type="text" size="small" @click="handleRestore(scope.row.id, scope.$index)">恢复商品</el-button>
|
||||
<el-button type="text" size="small" @click="handleDelete(scope.row.id, tableFrom.type)">{{ tableFrom.type === '5' ? '删除' : '加入回收站' }}</el-button>
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
<script>
|
||||
import categoryList from '@/components/Category/list'
|
||||
export default {
|
||||
// name: "list",
|
||||
components: { categoryList },
|
||||
data() {
|
||||
return {
|
||||
|
||||
@@ -156,10 +156,10 @@
|
||||
this.pics.splice(i, 1)
|
||||
},
|
||||
submitForm(formName) {
|
||||
this.loadingbtn = true;
|
||||
this.formValidate.pics = this.pics.length>0 ? JSON.stringify(this.pics) : ''
|
||||
this.$refs[formName].validate((valid) => {
|
||||
if (valid) {
|
||||
this.loadingbtn = true;
|
||||
replyCreatApi(this.formValidate).then(() => {
|
||||
this.$message.success("新增成功")
|
||||
setTimeout(() => {
|
||||
|
||||
@@ -484,7 +484,7 @@
|
||||
attr: info.attr || [],
|
||||
selectRule: info.selectRule,
|
||||
isSub: false,
|
||||
content: info.content,
|
||||
content: this.$selfUtil.replaceImgSrcHttps(info.content),
|
||||
specType: info.attr.length ? true : false,
|
||||
id: info.id,
|
||||
giveIntegral: info.giveIntegral,
|
||||
|
||||
@@ -20,9 +20,6 @@ export default {
|
||||
mounted() {
|
||||
},
|
||||
methods: {
|
||||
handleTreeCheckChange(data, checked, indateminate) {
|
||||
console.log(data, checked, indateminate)
|
||||
},
|
||||
categoryAdd(pram) {
|
||||
const _pram = {
|
||||
extra: pram.extra,
|
||||
|
||||
@@ -35,24 +35,32 @@
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column min-width="130px" align="center" :label="columns.title">
|
||||
<template slot-scope="{row}">
|
||||
<el-input-number v-model="row.first" controls-position="right" :min="1" />
|
||||
<el-table-column min-width="130px" align="center" :label="columns.title" prop="first">
|
||||
<template scope="scope">
|
||||
<el-form-item :rules="rules.first" :prop="'region.'+scope.$index+'.first'">
|
||||
<el-input-number v-model="scope.row.first" controls-position="right" :step-strictly="ruleForm.type===1?true:false" :min="ruleForm.type===1?1:0.1"/>
|
||||
</el-form-item>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column min-width="120px" align="center" label="运费(元)">
|
||||
<template slot-scope="{row}">
|
||||
<el-input-number v-model="row.firstPrice" controls-position="right" />
|
||||
<el-table-column min-width="120px" align="center" label="运费(元)" prop="firstPrice">
|
||||
<template scope="scope">
|
||||
<el-form-item :rules="rules.firstPrice" :prop="'region.'+scope.$index+'.firstPrice'">
|
||||
<el-input-number v-model="scope.row.firstPrice" controls-position="right" />
|
||||
</el-form-item>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column min-width="120px" align="center" :label="columns.title2">
|
||||
<template slot-scope="{row}">
|
||||
<el-input-number v-model="row.renewal" controls-position="right" />
|
||||
<el-table-column min-width="120px" align="center" :label="columns.title2" prop="renewal">
|
||||
<template scope="scope">
|
||||
<el-form-item :rules="rules.renewal" :prop="'region.'+scope.$index+'.renewal'">
|
||||
<el-input-number v-model="scope.row.renewal" controls-position="right" :step-strictly="ruleForm.type===1?true:false" :min="ruleForm.type===1?1:0.1"/>
|
||||
</el-form-item>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column class-name="status-col" align="center" label="续费(元)" min-width="120">
|
||||
<template slot-scope="{row}">
|
||||
<el-input-number v-model="row.renewalPrice" controls-position="right" />
|
||||
<el-table-column class-name="status-col" align="center" label="续费(元)" min-width="120" prop="renewalPrice">
|
||||
<template scope="scope">
|
||||
<el-form-item :rules="rules.renewalPrice" :prop="'region.'+scope.$index+'.renewalPrice'">
|
||||
<el-input-number v-model="scope.row.renewalPrice" controls-position="right" />
|
||||
</el-form-item>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="操作" min-width="80">
|
||||
@@ -96,7 +104,7 @@
|
||||
</el-table-column>
|
||||
<el-table-column min-width="180px" align="center" :label="columns.title3">
|
||||
<template slot-scope="{row}">
|
||||
<el-input-number v-model="row.number" controls-position="right" />
|
||||
<el-input-number v-model="row.number" controls-position="right" :step-strictly="ruleForm.type===1?true:false" :min="ruleForm.type===1?1:0.1"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column min-width="120px" align="center" label="包邮金额(元)">
|
||||
@@ -151,7 +159,7 @@
|
||||
</el-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="onClose('ruleForm')">取 消</el-button>
|
||||
<el-button type="primary" @click="onsubmit('ruleForm')">确 定</el-button>
|
||||
<el-button type="primary" :loading="loading" @click="onsubmit('ruleForm')">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
@@ -165,10 +173,10 @@ const defaultRole = {
|
||||
appoint: false,
|
||||
sort: 0,
|
||||
region: [{
|
||||
first: 1,
|
||||
firstPrice: 1,
|
||||
renewal: 1,
|
||||
renewalPrice: 1,
|
||||
first: 0,
|
||||
firstPrice: 0,
|
||||
renewal: 0,
|
||||
renewalPrice: 0,
|
||||
city_ids: []
|
||||
}],
|
||||
undelivery: 0,
|
||||
@@ -201,6 +209,7 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
loading : false,
|
||||
rules: {
|
||||
name: [
|
||||
{ required: true, message: '请输入模板名称', trigger: 'blur' }
|
||||
@@ -222,6 +231,18 @@ export default {
|
||||
],
|
||||
city_id3: [
|
||||
{ type: 'array', required: true, message: '请至少选择一个地区', trigger: 'change' }
|
||||
],
|
||||
first: [
|
||||
{ required: true, message: '请输入', trigger: 'blur' }
|
||||
],
|
||||
renewal: [
|
||||
{ required: true, message: '请输入', trigger: 'blur' }
|
||||
],
|
||||
firstPrice: [
|
||||
{ required: true, message: '请输入运费', trigger: 'blur' }
|
||||
],
|
||||
renewalPrice: [
|
||||
{ required: true, message: '请输入续费', trigger: 'blur' }
|
||||
]
|
||||
},
|
||||
nodeKey: 'city_id',
|
||||
@@ -259,7 +280,7 @@ export default {
|
||||
},
|
||||
popoverHide() {},
|
||||
handleClose() {
|
||||
this.$refs['ruleForm'].resetFields()
|
||||
// this.$refs['ruleForm'].resetFields()
|
||||
this.dialogVisible = false
|
||||
this.ruleForm={
|
||||
name: '',
|
||||
@@ -267,10 +288,10 @@ export default {
|
||||
appoint: false,
|
||||
sort: 0,
|
||||
region: [{
|
||||
first: 1,
|
||||
firstPrice: 1,
|
||||
renewal: 1,
|
||||
renewalPrice: 1,
|
||||
first: 0,
|
||||
firstPrice: 0,
|
||||
renewal: 0,
|
||||
renewalPrice: 0,
|
||||
city_ids: []
|
||||
}],
|
||||
undelivery: 0,
|
||||
@@ -281,7 +302,6 @@ export default {
|
||||
},
|
||||
changeRegion(value) {
|
||||
console.log(value)
|
||||
// console.integralLog(value)
|
||||
},
|
||||
changeRadio(num) {
|
||||
this.columns = Object.assign({}, statusMap[num - 1])
|
||||
@@ -289,10 +309,10 @@ export default {
|
||||
// 添加配送区域
|
||||
addRegion(region) {
|
||||
region.push(Object.assign({}, {
|
||||
first: 1,
|
||||
firstPrice: 1,
|
||||
renewal: 1,
|
||||
renewalPrice: 1,
|
||||
first: 0,
|
||||
firstPrice: 0,
|
||||
renewal: 0,
|
||||
renewalPrice: 0,
|
||||
city_ids: []
|
||||
}))
|
||||
},
|
||||
@@ -322,6 +342,7 @@ export default {
|
||||
appoint: info.appoint,
|
||||
sort: info.sort
|
||||
})
|
||||
this.columns = Object.assign({}, statusMap[this.ruleForm.type - 1])
|
||||
this.$nextTick(() => {
|
||||
loadingInstance.close()
|
||||
})
|
||||
@@ -395,6 +416,7 @@ export default {
|
||||
onsubmit(formName) {
|
||||
this.$refs[formName].validate((valid) => {
|
||||
if (valid) {
|
||||
this.loading = true;
|
||||
const param = {
|
||||
appoint: this.ruleForm.appoint,
|
||||
name: this.ruleForm.name,
|
||||
@@ -434,28 +456,26 @@ export default {
|
||||
if (this.type === 0) {
|
||||
logistics.shippingSave(param).then(res => {
|
||||
this.$message.success('操作成功')
|
||||
|
||||
this.handleClose()
|
||||
this.$nextTick(() => {
|
||||
this.dialogVisible = false
|
||||
this.$refs[formName].resetFields()
|
||||
this.clear()
|
||||
})
|
||||
setTimeout(() => {
|
||||
this.$emit('getList')
|
||||
}, 600)
|
||||
this.loading = false;
|
||||
})
|
||||
} else {
|
||||
logistics.shippingUpdate(param, { id: this.tempId }).then(res => {
|
||||
this.$message.success('操作成功')
|
||||
setTimeout(() => {
|
||||
this.$emit('getList')
|
||||
this.$refs[formName].resetFields()
|
||||
this.clear()
|
||||
this.handleClose()
|
||||
}, 600)
|
||||
this.$nextTick(() => {
|
||||
this.dialogVisible = false
|
||||
this.$refs[formName].resetFields()
|
||||
})
|
||||
this.loading = false;
|
||||
})
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -25,14 +25,14 @@
|
||||
</div>
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-form-item label="用户背景" required prop="image">
|
||||
<div class="upLoadPicBox" @click="modalPicTap('1', 'image')">
|
||||
<div v-if="formValidate.image" class="pictrue"><img :src="formValidate.image"></div>
|
||||
<div v-else class="upLoad">
|
||||
<i class="el-icon-camera cameraIconfont" />
|
||||
</div>
|
||||
</div>
|
||||
</el-form-item>
|
||||
<!--<el-form-item label="用户背景" required prop="image">-->
|
||||
<!--<div class="upLoadPicBox" @click="modalPicTap('1', 'image')">-->
|
||||
<!--<div v-if="formValidate.image" class="pictrue"><img :src="formValidate.image"></div>-->
|
||||
<!--<div v-else class="upLoad">-->
|
||||
<!--<i class="el-icon-camera cameraIconfont" />-->
|
||||
<!--</div>-->
|
||||
<!--</div>-->
|
||||
<!--</el-form-item>-->
|
||||
<el-form-item label="是否显示" required>
|
||||
<el-radio-group v-model="formValidate.isShow">
|
||||
<el-radio :label="true" class="radio">显示</el-radio>
|
||||
|
||||
@@ -164,7 +164,7 @@
|
||||
</el-form>
|
||||
</div>
|
||||
<el-button class="mr10" size="small" @click="onSend">发送优惠券</el-button>
|
||||
<el-button v-show="loginType === 'wechat'" size="mini" class="mr10" @click="sendNews">发送文章</el-button>
|
||||
<!--<el-button v-show="loginType === 'wechat'" size="mini" class="mr10" @click="sendNews">发送文章</el-button>-->
|
||||
<el-button class="mr10" size="small" @click="setBatch('group')">批量设置分组</el-button>
|
||||
<el-button class="mr10" size="small" @click="setBatch('label')">批量设置标签</el-button>
|
||||
</div>
|
||||
|
||||
@@ -25,6 +25,7 @@ module.exports = {
|
||||
* In most cases please use '/' !!!
|
||||
* Detail: https://cli.vuejs.org/config/#publicpath
|
||||
*/
|
||||
transpileDependencies: ['element-ui', 'vuex', 'js-cookie', '@babel', 'resize-detector'],
|
||||
publicPath: '/',
|
||||
outputDir: 'dist',
|
||||
assetsDir: 'static',
|
||||
|
||||
Reference in New Issue
Block a user