Commit 57ea05ef by 胡悦

Merge branch 'wuwx_dev_v2.6.0' of http://192.168.3.233:8090/saas/scrm-micro-mark…

…eting into wuwx_dev_v2.6.0
2 parents ebf27d1a 96e81f6e
Showing 53 changed files with 3146 additions and 175 deletions
...@@ -3,6 +3,9 @@ ...@@ -3,6 +3,9 @@
"env": { "env": {
"node": true "node": true
}, },
"globals": {
"AMap": true
},
"extends": ["plugin:vue/essential", "@vue/prettier"], "extends": ["plugin:vue/essential", "@vue/prettier"],
"rules": { "rules": {
"no-console": "off", "no-console": "off",
......
This diff could not be displayed because it is too large.
...@@ -13,10 +13,11 @@ ...@@ -13,10 +13,11 @@
"el-tree-transfer": "^2.2.6", "el-tree-transfer": "^2.2.6",
"element-ui": "^2.4.5", "element-ui": "^2.4.5",
"glsx-common": "^1.4.6", "glsx-common": "^1.4.6",
"glsx-components": "^1.4.3", "glsx-components": "^1.4.2",
"lodash": "^4.17.21", "lodash": "^4.17.21",
"node-sass": "^4.0.0", "node-sass": "^4.0.0",
"vue": "^2.6.10", "vue": "^2.6.10",
"vue-amap": "^0.5.10",
"vue-router": "^3.1.3", "vue-router": "^3.1.3",
"vuedraggable": "^2.24.3", "vuedraggable": "^2.24.3",
"vuex": "^3.1.2", "vuex": "^3.1.2",
......
...@@ -33,6 +33,17 @@ const uploadImgApi = params => { ...@@ -33,6 +33,17 @@ const uploadImgApi = params => {
}) })
} }
const uploadMusicApi = params => {
params.method = 'scrm.api.carlife.common.uploadMusic'
return http({
url: 'rop-scrm-carlife/router',
method: 'POST',
data: params,
sign: true,
noSignAttr: ['file']
})
}
const uploadVideoApi = params => { const uploadVideoApi = params => {
params.method = `${defaultPath}common.uploadVideo` params.method = `${defaultPath}common.uploadVideo`
return http({ return http({
...@@ -128,4 +139,4 @@ const getStaffFollowerListApi = params => { ...@@ -128,4 +139,4 @@ const getStaffFollowerListApi = params => {
}) })
} }
export default { getMerchantGoodsListApi, getGoodsListApi, uploadImgApi, uploadVideoApi, getMerchantList, getSimpleMerchantList, getZoneListApi, getClassifyListApi, pictureUpload, querylabeltree, getCrowdTreeListApi, getStaffFollowerListApi } export default { getMerchantGoodsListApi, getGoodsListApi, uploadImgApi, uploadMusicApi, uploadVideoApi, getMerchantList, getSimpleMerchantList, getZoneListApi, getClassifyListApi, pictureUpload, querylabeltree, getCrowdTreeListApi, getStaffFollowerListApi }
...@@ -130,4 +130,14 @@ const toVoidGift = params => { ...@@ -130,4 +130,14 @@ const toVoidGift = params => {
}) })
} }
export default { getFollowerStaffListApi, getListApi, giftExportApi, deleteGiftApi, getGiftInfoApi, getReceivedGiftInfoApi, exportGiftInfoApi, getDirectionalGiftListApi, insertGiftApi, templateModal, getghDirectionalGiftListApi, toVoidGift } const getQrcode = params => {
params.method = 'scrm.api.coupon.directional.gift.qr.code'
return http({
url: 'rop-scrm-coupon/router',
method: 'POST',
data: params,
sign: true
})
}
export default { getFollowerStaffListApi, getListApi, giftExportApi, deleteGiftApi, getGiftInfoApi, getReceivedGiftInfoApi, exportGiftInfoApi, getDirectionalGiftListApi, insertGiftApi, templateModal, getghDirectionalGiftListApi, toVoidGift, getQrcode }
...@@ -13,6 +13,39 @@ const getActivityPageApi = params => { ...@@ -13,6 +13,39 @@ const getActivityPageApi = params => {
}) })
} }
//分页众筹活动
const getCrowdfundListApi = params => {
params.method = 'scrm.api.shopmall.crowdfunding.activity.page'
return http({
url: 'rop-scrm-shopmall/router',
method: 'GET',
data: params,
sign: true
})
}
//分页浏览明细
const getBrowseListApi = params => {
params.method = 'scrm.api.shopmall.customer.browse.records'
return http({
url: 'rop-scrm-shopmall/router',
method: 'GET',
data: params,
sign: true
})
}
// 分页浏览-导出
const exportBrowseApi = params => {
params.method = 'scrm.api.shopmall.customer.browse.records.export'
return http({
url: 'rop-scrm-shopmall/router',
method: 'POST',
data: params,
sign: true
})
}
//创建/编辑活动 //创建/编辑活动
const addOrUpdateActivityApi = params => { const addOrUpdateActivityApi = params => {
params.method = `${defaultPath}add.or.update` params.method = `${defaultPath}add.or.update`
...@@ -83,4 +116,15 @@ const getSharedApi = params => { ...@@ -83,4 +116,15 @@ const getSharedApi = params => {
}) })
} }
export default { getActivityPageApi, toggleStatusApi, deleteActivityApi, topActivityApi, getSharedApi, addOrUpdateActivityApi, getActivityDetailApi } // 众筹-分享
const getCrowdSharedApi = params => {
params.method = 'scrm.api.shopmall.crowdfunding.activity.get.shared'
return http({
url: 'rop-scrm-shopmall/router',
method: 'GET',
data: params,
sign: true
})
}
export default { getActivityPageApi, getCrowdfundListApi, getBrowseListApi, exportBrowseApi, toggleStatusApi, deleteActivityApi, topActivityApi, getSharedApi, addOrUpdateActivityApi, getActivityDetailApi, getCrowdSharedApi }
...@@ -235,6 +235,11 @@ html { ...@@ -235,6 +235,11 @@ html {
width: 100%; width: 100%;
} }
.marketing .img-36 {
width: 36px;
height: 36px;
}
.marketing .img-60 { .marketing .img-60 {
width: 60px; width: 60px;
height: 60px; height: 60px;
...@@ -299,10 +304,18 @@ html { ...@@ -299,10 +304,18 @@ html {
margin-right: 20px; margin-right: 20px;
} }
.marketing .m-l-10 {
margin-left: 10px;
}
.marketing .m-l-20 { .marketing .m-l-20 {
margin-left: 20px; margin-left: 20px;
} }
.marketing .p-20 {
padding: 20px;
}
.marketing.p-t-10, .marketing.p-t-10,
.marketing .p-t-10 { .marketing .p-t-10 {
padding-top: 10px; padding-top: 10px;
...@@ -565,10 +578,10 @@ html { ...@@ -565,10 +578,10 @@ html {
.marketing .line-20 { .marketing .line-20 {
line-height: 20px; line-height: 20px;
} }
.marketin .weight-5 { .marketing .weight-5 {
font-weight: 500; font-weight: 500;
} }
.marketin .weight-4 { .marketing .weight-4 {
font-weight: 400; font-weight: 400;
} }
.el-tooltip__popper.is-light { .el-tooltip__popper.is-light {
...@@ -589,12 +602,12 @@ html { ...@@ -589,12 +602,12 @@ html {
z-index: 4000 !important; z-index: 4000 !important;
} }
.loadingClass{ .loadingClass {
.el-icon-loading{ .el-icon-loading {
font-size: 22px; font-size: 22px;
} }
.el-icon-loading, .el-icon-loading,
.el-loading-text{ .el-loading-text {
color: #5850ff!important; color: #5850ff !important;
} }
} }

790 Bytes | W: | H:

594 Bytes | W: | H:

src/assets/material/pdf.png
src/assets/material/pdf.png
src/assets/material/pdf.png
src/assets/material/pdf.png
  • 2-up
  • Swipe
  • Onion skin
...@@ -31,6 +31,27 @@ function limitPrice(newValue, oldValue, intergerDigit, pointDigit, minValue, max ...@@ -31,6 +31,27 @@ function limitPrice(newValue, oldValue, intergerDigit, pointDigit, minValue, max
} }
} }
function downloadIamge(imgsrc, name = new Date().getTime()) {
//下载图片地址和图片名
var image = new Image()
// 解决跨域 Canvas 污染问题
image.setAttribute('crossOrigin', 'anonymous')
image.onload = function() {
var canvas = document.createElement('canvas')
canvas.width = image.width
canvas.height = image.height
var context = canvas.getContext('2d')
context.drawImage(image, 0, 0, image.width, image.height)
var url = canvas.toDataURL('image/png') //得到图片的base64编码数据
var a = document.createElement('a') // 生成一个a元素
var event = new MouseEvent('click') // 创建一个单击事件
a.download = name || 'photo' // 设置图片名称
a.href = url // 将生成的URL设置为a.href属性
a.dispatchEvent(event) // 触发a的单击事件
}
image.src = imgsrc
}
function getExplorer() { function getExplorer() {
var ua = navigator.userAgent.toLocaleLowerCase() var ua = navigator.userAgent.toLocaleLowerCase()
var browserType = null var browserType = null
...@@ -103,7 +124,8 @@ const afterSaleStatusList = [ ...@@ -103,7 +124,8 @@ const afterSaleStatusList = [
const orderSourceList = [ const orderSourceList = [
{ confId: '1', confName: '商城订单' }, { confId: '1', confName: '商城订单' },
{ confId: '2', confName: '直播订单' }, { confId: '2', confName: '直播订单' },
{ confId: '3', confName: '秒杀订单' } { confId: '3', confName: '秒杀订单' },
{ confId: '4', confName: '众筹订单' }
] ]
const deliveryTypeList = [ const deliveryTypeList = [
...@@ -204,4 +226,4 @@ const stateList = [ ...@@ -204,4 +226,4 @@ const stateList = [
} }
] ]
export { limitPrice, getExplorer, exportFn, aToExport, orderManageStatusList, afterSaleStatusList, orderSourceList, deliveryTypeList, statusList, serviceStatusList, memberTypeList, stateList, orderTypesList, orderStatusList } export { limitPrice, getExplorer, exportFn, aToExport, downloadIamge, orderManageStatusList, afterSaleStatusList, orderSourceList, deliveryTypeList, statusList, serviceStatusList, memberTypeList, stateList, orderTypesList, orderStatusList }
...@@ -22,29 +22,6 @@ ...@@ -22,29 +22,6 @@
</el-input> </el-input>
<slot :name="item.suffixSlot" :scope="item"></slot> <slot :name="item.suffixSlot" :scope="item"></slot>
</div> </div>
<!-- 选择-输入框 -->
<!-- <el-input v-else-if="item.type === 'selectInput'" :placeholder="'请输入' + item.selectOption.find(k => k.name === searchSelectObj[item.selectName].attr).label" :maxlength="item.maxlength" v-model.trim="searchSelectObj[item.selectName].value" :clearable="item.isClear || false" :style="{ width: item.inputWidth || defaultWidth }" class="input-with-select">
<el-select v-model="searchSelectObj[item.selectName].attr" :style="{ width: item.selectWidth || (labelWidth + 'px') }" slot="prepend" placeholder="请选择" @change="item.handleSelectChange">
<el-option v-for="(subItem, subIndex) in item.selectOption" :key="subIndex" :label="subItem.label" :value="subItem.name"></el-option>
</el-select>
</el-input> -->
<!-- 选择-时间选择框 -->
<!-- <template v-else-if="item.type === 'selectDatePicker'">
<el-select v-model="searchSelectObj[item.selectName].attr" :style="{ width: item.selectWidth || (labelWidth + 'px') }" placeholder="请选择" @change="item.handleSelectChange">
<el-option v-for="(subItem, subIndex) in item.selectOption" :key="subIndex" :label="subItem.label" :value="subItem.name"></el-option>
</el-select>
<el-date-picker v-model="searchSelectObj[item.selectName].value" :style="{ width: item.width || defaultWidth }" :type="item.dateType || 'daterange'" :clearable="item.isClear || false" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" :picker-options="pickerOption[item.pickerOptions]"></el-date-picker>
</template> -->
<!-- 双选择框 -->
<!-- <template v-else-if="item.type === 'selectDouble'">
<el-select v-model="searchSelectObj[item.selectName].attr" :style="{ width: item.selectWidth || (labelWidth + 'px') }" placeholder="请选择" @change="item.handleSelectChange">
<el-option v-for="(subItem, subIndex) in item.selectOption" :key="subIndex" :label="subItem.label" :value="subItem.name"></el-option>
</el-select>
<el-select v-model="searchSelectObj[item.selectName].value" :style="{ width: item.width || defaultWidth }" :placeholder="'请选择' + item.selectOption.find(k => k.name === searchSelectObj[item.selectName].attr).label">
<el-option label="全部" value=""></el-option>
<el-option v-for="subItem in item.selectOption.find(k => k.name === searchSelectObj[item.selectName].attr).optionList" :key="subItem[item.optionId]" :label="subItem[item.optionLabel]" :value="subItem[item.optionId]"></el-option>
</el-select>
</template> -->
<!-- 选择框 --> <!-- 选择框 -->
<div v-else-if="item.type === 'select'"> <div v-else-if="item.type === 'select'">
<el-select :style="{ width: item.width || defaultWidth }" v-model="formObj[item.name]" v-bind="item.attrs ? item.attrs : {}" v-on="item.listeners ? item.listeners : {}" :clearable="item.isClear || false" :placeholder="item.placeholder || '请选择' + item.label" :filterable="!item.noFilter" :disabled="item.isDisabled" :no-data-text="item.noDataText || '无数据'" :multiple="item.multiple || false" :collapse-tags="item.collapseTags || true" @change="selectAddAttr($event, item)"> <el-select :style="{ width: item.width || defaultWidth }" v-model="formObj[item.name]" v-bind="item.attrs ? item.attrs : {}" v-on="item.listeners ? item.listeners : {}" :clearable="item.isClear || false" :placeholder="item.placeholder || '请选择' + item.label" :filterable="!item.noFilter" :disabled="item.isDisabled" :no-data-text="item.noDataText || '无数据'" :multiple="item.multiple || false" :collapse-tags="item.collapseTags || true" @change="selectAddAttr($event, item)">
...@@ -98,6 +75,14 @@ ...@@ -98,6 +75,14 @@
</template> </template>
<slot :name="item.suffixSlot" :scope="item"></slot> <slot :name="item.suffixSlot" :scope="item"></slot>
</template> </template>
<!-- 图文编辑器 -->
<textBox v-else-if="item.type === 'textBox'" :ref="item.name + 'TextBox'" @change="e => handleTextBoxChange(e, item)" @forbid="forbidEdit"></textBox>
<!-- 地图 -->
<div v-else-if="item.type === 'map'" class="flex">
<Province ref="provinceForm" :subdistrict="subdistrict" :isDisabled="item.isDisabled" @selectProvince="e => handleSelectProvince(e, item)" @selectCity="e => handleSelectCity(e, item)"></Province>
<el-input class="input-width" v-model="formObj[item.name]" placeholder="请选择商户地址" :disabled="item.isDisabled"></el-input>
<el-button v-show="!item.isDisabled" @click="handleSelectMap(item)" type="primary">选择地址</el-button>
</div>
</el-form-item> </el-form-item>
</template> </template>
<slot name="footer"></slot> <slot name="footer"></slot>
...@@ -110,10 +95,20 @@ ...@@ -110,10 +95,20 @@
<img v-else class="dialog-img" width="100%" :src="dialogObj.url" alt="" /> <img v-else class="dialog-img" width="100%" :src="dialogObj.url" alt="" />
</div> </div>
</el-dialog> </el-dialog>
<el-dialog :visible.sync="dialogMapVisible" width="60%">
<map-view ref="mapForm" :mapHeight="mapHeight"></map-view>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogMapVisible = false">取 消</el-button>
<el-button type="primary" @click="getAddress">确 定</el-button>
</span>
</el-dialog>
</div> </div>
</template> </template>
<script> <script>
import textBox from '@/views/material/components/textBox'
import Province from './provinceCity.vue'
import mapView from './mapView.vue'
import { beforeRangePickerOptions, afterRangePickerOptions } from './common' import { beforeRangePickerOptions, afterRangePickerOptions } from './common'
export default { export default {
name: 'glsx-combi-form', name: 'glsx-combi-form',
...@@ -123,6 +118,10 @@ export default { ...@@ -123,6 +118,10 @@ export default {
beforeRangePickerOptions: beforeRangePickerOptions, beforeRangePickerOptions: beforeRangePickerOptions,
afterRangePickerOptions: afterRangePickerOptions afterRangePickerOptions: afterRangePickerOptions
}, },
subdistrict: 2,
mapHeight: 450,
dialogMapVisible: false,
targetItem: {},
isImgVisible: false, isImgVisible: false,
dialogObj: { dialogObj: {
url: '', url: '',
...@@ -180,6 +179,12 @@ export default { ...@@ -180,6 +179,12 @@ export default {
} }
}, },
components: {
textBox,
Province,
mapView
},
mounted() { }, mounted() { },
methods: { methods: {
...@@ -255,6 +260,93 @@ export default { ...@@ -255,6 +260,93 @@ export default {
url: src, url: src,
uploadType: targetItem.uploadType || 'img' uploadType: targetItem.uploadType || 'img'
} }
},
// 获取富文本框内容
handleTextBoxChange(val, targetItem) {
this.formObj[targetItem.name] = val
},
// 禁用富文本
forbidEdit() {
this.$refs.textBox.forbidEdit()
},
// 地图
handleSelectMap(targetItem) {
this.targetItem = targetItem
this.dialogMapVisible = true
this.$nextTick(() => {
console.log(this.$refs.mapForm)
if (this.formObj[targetItem.attrObj.fullAddress] && !this.$refs.mapForm.address) {
this.$refs.mapForm.address = this.formObj[targetItem.attrObj.fullAddress]
this.$refs.mapForm.addMarker([this.formObj[targetItem.attrObj.lng], this.formObj[targetItem.attrObj.lat]])
}
})
},
getAddress() {
let mapInfo = this.$refs.mapForm
if (!mapInfo.address) {
this.$message({
message: '请选择地址',
type: 'error',
customClass: 'message-Z-zinde'
})
return
}
this.formObj[this.targetItem.attrObj.fullAddress] = mapInfo.address
this.formObj[this.targetItem.attrObj.lat] = mapInfo.lnglat.lat
this.formObj[this.targetItem.attrObj.lng] = mapInfo.lnglat.lng
// var fullAddress = mapInfo.geocoderAddress.addressComponent || this.formObj[this.targetItem.attrObj.fullAddress]
var fullAddress = mapInfo.geocoderAddress.addressComponent
var provincecode = mapInfo.geocoderAddress.adcode || this.formObj[this.targetItem.attrObj.provinceCode]
this.formObj[this.targetItem.attrObj.provinceCode] = provincecode
// 获取省市
var province = ''
var city = ''
province = fullAddress.province
city = fullAddress.city ? fullAddress.city : fullAddress.district
const municipalities = ['北京市', '天津市', '上海市', '重庆市']
var municipality = municipalities.find(item => item == province)
if (municipality) {
city = city.slice(0, 2) + '城区'
if (municipality === '重庆市') {
provincecode = provincecode.slice(0, 4)
provincecode == 5001 ? (city = city.slice(0, 2) + '城区') : (city = city.slice(0, 2) + '郊县')
}
}
// 判断省市是否匹配
if (this.formObj[this.targetItem.attrObj.provinceName]) {
if (this.formObj[this.targetItem.attrObj.provinceName] !== province && this.formObj[this.targetItem.attrObj.cityName] !== city) {
this.$message({
message: '您选择的地址错误,请重新选择',
type: 'error',
customClass: 'message-Z-zinde'
})
this.formObj[this.formObj[this.targetItem.attrObj.fullAddress]] = ''
return
}
}
this.dialogMapVisible = false
this.formObj[this.targetItem.attrObj.provinceName] = province
this.formObj[this.targetItem.attrObj.cityName] = city
// 当直接点击选择地址时,获取省市ID
this.$refs.provinceForm[0].init(province, city)
},
// 获取省
handleSelectProvince(val, targetItem) {
this.formObj[targetItem.attrObj.fullAddress] = ''
this.formObj[targetItem.attrObj.cityName] = ''
this.formObj[targetItem.attrObj.provinceName] = val.provinceName
this.formObj[targetItem.attrObj.provinceCode] = val.provinceCode
},
// 获取市
handleSelectCity(val, targetItem) {
if (val.cityName) {
this.formObj[targetItem.attrObj.cityName] = val.cityName
this.formObj[targetItem.attrObj.cityCode] = val.cityCode
} else {
this.formObj[targetItem.attrObj.cityName] = ''
this.formObj[targetItem.attrObj.cityCode] = ''
}
this.formObj[targetItem.attrObj.fullAddress] = ''
} }
} }
} }
......
<template>
<div class="map-box" :style="{ height: mapHeight + 'px' }">
<div id="container" style="width: 100%; height: 100%"></div>
<div class="map-address">{{ address }}</div>
<div id="myPageTop" style="position: absolute; top: 10px; width: 50%; left: 25%">
<el-input placeholder="请输入关键字" v-model="input" class="input-with-select">
<el-button slot="append" icon="el-icon-search" @click="searchAddress"></el-button>
</el-input>
</div>
</div>
</template>
<script>
let map, marker, placeSearch
export default {
name: 'map',
props: {
mapHeight: {
type: Number,
default: 300
}
},
data() {
return {
input: '',
address: '',
lnglat: [],
geocoderAddress: {}
}
},
methods: {
mapInit() {
map = new AMap.Map('container', {
resizeEnable: true,
zoom: 20
})
AMap.plugin(['AMap.PlaceSearch'], function () {
//构造地点查询类
placeSearch = new AMap.PlaceSearch({
pageSize: 8, // 单页显示结果条数
pageIndex: 1, // 页码
citylimit: false, //是否强制限制在设置的城市内搜索
// panel: "panel", // 结果列表将在此容器中进行展示。
autoFitView: true, // 是否自动调整地图视野使绘制的 Marker点都处于视口的可见范围
renderStyle: 'default'
})
})
// 添加列表点选监听事件
map.on('click', this.getAddress)
},
searchAddress() {
let _this = this
placeSearch.search(this.input, function (status, result) {
if (status === 'complete' && result.poiList.pois.length) {
let lnglat = result.poiList.pois[0].location
_this.getAddress(lnglat)
}
})
},
addMarker(lnglat) {
let position
if (lnglat.lng) {
position = [lnglat.lng, lnglat.lat]
} else {
position = lnglat
}
marker = new AMap.Marker({
icon: new AMap.Icon({
image: '//a.amap.com/jsapi_demos/static/demo-center/icons/poi-marker-default.png',
size: new AMap.Size(27, 34), //图标大小
imageSize: new AMap.Size(27, 34)
}),
position: position,
offset: new AMap.Pixel(-10, -10)
})
map.add(marker)
map.setFitView()
},
getAddress(e) {
let self = this
let lnglat
if (e.type == 'click') {
lnglat = e.lnglat
} else {
let { lng, lat } = e
lnglat = [lng, lat]
}
if (marker) {
marker.setMap(null)
marker = null
}
self.addMarker(lnglat)
AMap.plugin('AMap.Geocoder', () => {
const geocoder = new AMap.Geocoder()
geocoder.getAddress(lnglat, (status, result) => {
self.lnglat = lnglat
self.address = result.regeocode.formattedAddress
geocoder.getLocation(self.address, (status, result) => {
if (status === 'complete' && result.info === 'OK') {
this.geocoderAddress = result.geocodes[0]
}
})
})
})
},
selectAddress(e) {
//这里获得点选地点的经纬度
this.getAddress()
}
},
mounted() {
this.mapInit()
}
}
</script>
<style scoped lang="scss">
.map-box {
position: relative;
width: 100%;
}
#container {
position: absolute;
height: 100%;
}
#panel {
position: absolute;
max-height: 90%;
overflow-y: auto;
top: 80px;
right: 10px;
width: 280px;
}
.map-address {
position: absolute;
line-height: 20px;
bottom: -30px;
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<div v-if="provinceView">
<el-form ref="provinceForm" :model="provinceForm" inline="true" class="province">
<el-select size="small" v-model="provinceForm.provinceName" clearable :disabled="isDisabled" placeholder="选择省份" :style="{ width: defaultWidth }" @change="selectProvince" class="select-padding">
<el-option v-for="item in AllData" :key="item.adcode" :label="item.name" :value="item.name" @click.native="selectProvince(item)"></el-option>
</el-select>
<el-select size="small" v-model="provinceForm.cityName" clearable :disabled="isDisabled" placeholder="选择市" :style="{ width: defaultWidth }" @change="selectCity" class="select-padding">
<el-option v-for="item in cityList" :key="item.adcode" :label="item.name" :value="item.name" @click.native="selectCity(item)"></el-option>
</el-select>
<el-select v-if="subdistrict == 3" size="small" v-model="provinceForm.townName" clearable :disabled="isDisabled" placeholder="选择区" :style="{ width: defaultWidth }" @change="selectTown" class="select-padding">
<el-option v-for="item in townList" :key="item.adcode" :label="item.name" :value="item.name" @click.native="selectTown(item)"></el-option>
</el-select>
</el-form>
</div>
</template>
<script>
export default {
name: 'GLProvince',
props: {
// 省市级别,2--只显示省市,3--显示省市区,默认只显示省市
subdistrict: {
type: Number,
default: 2
},
// 省市下拉组件宽度
defaultWidth: {
type: String,
default: '150px'
},
// 组件是否展示,默认展示
provinceView: {
type: Boolean,
default: true
},
isDisabled: {
type: Boolean,
default: false
}
},
data() {
return {
// 所有数据
AllData: [],
// 城市列表
cityList: [],
// 地区列表
townList: [],
provinceForm: {
// 省份名称
provinceName: '',
// 城市名称
cityName: '',
// 地区名称
townName: '',
// 省份代码
provinceCode: '',
// 城市代码
cityCode: '',
// 地区代码
townCode: ''
}
}
},
mounted() {
this.provinceList()
},
methods: {
/*
* @params:传入的为一个key-value的对象
1、keywords --查询关键字,只支持单个关键词语搜索关键词支持:行政区名称、citycode、adcode
列如:this.provinceList({keywords: '山东省'}),这样就可以筛选出山东省下的市、区信息
2、subdistrict --设置显示下级行政区级数,0:不返回下级行政区;1:返回下一级行政区;2:返回下两级行政区;3:返回下三级行政区;
不传的话默认为2,可以在组件中穿,也可以在调用方法的时候传,如果需要展示省市组件,传值最小为2
3、page --最外层的districts最多会返回20个数据,若超过限制,请用page请求下一页数据。
例如page=2;page=3。默认page=1
4、extensions --控制行政区信息中返回行政区边界坐标点; 可选值:base、all;
base:不返回行政区边界坐标点;(默认)
all:只返回当前查询district的边界值,不返回子节点的边界值;目前不能返回乡镇/街道级别的边界值
5、filter -- 按照指定行政区划进行过滤,填入后则只返回该省/直辖市信息,需填入adcode,为了保证数据的正确,强烈建议填入此参数
6、callback -- callback值是用户定义的函数名称,此参数只在output=JSON时有效
7、output --返回数据格式类型,可选值:JSON,XML(默认JSON)
* @return:返回的是一个promise对象,如果不需要展示组件,只需要获取值,可以直接调用方法,异步获取返回值
列如:
const p = this.$refs.provinceForm.provinceList({xxxx(可传值,传值可参考上文params描述) })
p.then(r => {
// r 为返回结果
console.log(r)
})
**/
// 获取省市信息
provinceList(params = {}) {
params ? (params.subdistrict ? '' : (params.subdistrict = this.subdistrict)) : (params.subdistrict = this.subdistrict)
let data = ''
for (let key in params) {
data += '&' + key + '=' + params[key]
}
let path = `https://restapi.amap.com/v3/config/district?key=d22348363c34c266f772ae9b635eef2a`
path = path + data
const pro = fetch(path).then(res => {
return res.json()
})
if (this.provinceView) {
pro.then(r => {
this.AllData = r.districts[0].districts
})
}
return pro
},
// 省市回显
init(province, city, town) {
this.provinceForm = {
provinceName: province,
cityName: city,
townName: town
}
if (province) {
this.AllData.map(item => {
if (item.name.indexOf(province) != -1) {
this.provinceForm.provinceName = item.name
this.cityList = item.districts
this.provinceForm.provinceCode = item.adcode
if (city) {
this.cityList.map(itm => {
if (itm.name.indexOf(city) != -1) {
this.provinceForm.cityCode = itm.adcode
this.provinceForm.cityName = itm.name
this.townList = itm.districts
if (town) {
this.townList.map(itmx => {
if (itmx.name.indexOf(town) != -1) {
this.provinceForm.townCode = itmx.adcode
this.provinceForm.townName = itmx.name
}
})
}
}
})
}
}
})
}
},
// 选择省
selectProvince(val) {
this.provinceForm.cityName = ''
this.provinceForm.townName = ''
this.cityList = val.districts
this.$emit('selectProvince', { provinceName: val.name, provinceCode: val.adcode })
},
// 选择市
selectCity(val) {
this.provinceForm.townName = ''
this.townList = val.districts
this.$emit('selectCity', { cityName: val.name, cityCode: val.adcode })
},
// 选择区
selectTown(val) {
this.$emit('selectTown', { townName: val.name, townCode: val.adcode })
}
}
}
</script>
<style scoped lang="scss">
.province {
display: inline-flex;
}
.select-padding {
margin-right: 10px;
}
</style>
...@@ -14,6 +14,14 @@ import './public-path' ...@@ -14,6 +14,14 @@ import './public-path'
import '@/components' import '@/components'
// import 'glsx-components/dist/glsx-components.css' // import 'glsx-components/dist/glsx-components.css'
import { start } from '@/setup' import { start } from '@/setup'
import VueAMap from 'vue-amap'
Vue.use(VueAMap)
// 初始化vue-amap
VueAMap.initAMapApiLoader({
key: 'bd290dc27d0945959280753215ddda71', // 这里写你申请的高德地图的key
plugin: ['AMap.PlaceSearch', 'AMap.Geocoder', 'AMap.Geolocation'],
v: '1.4.15'
})
Vue.config.productionTip = false Vue.config.productionTip = false
Vue.prototype.$apis = apis Vue.prototype.$apis = apis
Vue.prototype.size = 'small' Vue.prototype.size = 'small'
......
...@@ -320,6 +320,36 @@ const staticRoutes = Object.freeze([ ...@@ -320,6 +320,36 @@ const staticRoutes = Object.freeze([
path: '/newCarManage/editCar', path: '/newCarManage/editCar',
component: resolve => require([`@/views/newCarManage/editCar.vue`], resolve), component: resolve => require([`@/views/newCarManage/editCar.vue`], resolve),
meta: {} meta: {}
},
{
name: 'seckillActivity',
path: '/seckillActivity/index',
component: resolve => require([`@/views/seckillActivity/index.vue`], resolve),
meta: {}
},
{
name: 'editActivity',
path: '/seckillActivity/editActivity',
component: resolve => require([`@/views/seckillActivity/editActivity.vue`], resolve),
meta: {}
},
{
name: 'crowdFundList',
path: '/seckillActivity/crowdFundList',
component: resolve => require([`@/views/seckillActivity/crowdFundList.vue`], resolve),
meta: {}
},
{
name: 'editCrowdFund',
path: '/seckillActivity/editCrowdFund',
component: resolve => require([`@/views/seckillActivity/editCrowdFund.vue`], resolve),
meta: {}
},
{
name: 'browseList',
path: '/seckillActivity/browseList',
component: resolve => require([`@/views/seckillActivity/browseList.vue`], resolve),
meta: {}
} }
]) ])
export default staticRoutes export default staticRoutes
...@@ -38,7 +38,7 @@ export async function bootstrap({ history, common, messenger, globalState, route ...@@ -38,7 +38,7 @@ export async function bootstrap({ history, common, messenger, globalState, route
Vue.prototype.$http_merchant = new common.Http({ response, request: request_merchant, sign, secret, alert: message.error, headers: { token: globalState.session.token } }) Vue.prototype.$http_merchant = new common.Http({ response, request: request_merchant, sign, secret, alert: message.error, headers: { token: globalState.session.token } })
Vue.prototype.$http_common = new common.Http({ response, signWay: 'md5', request: request_common, sign: sign_common, secret, alert: ElementUI.Message.error, headers: { TGT: globalState.session.token } }) Vue.prototype.$http_common = new common.Http({ response, signWay: 'md5', request: request_common, sign: sign_common, secret, alert: ElementUI.Message.error, headers: { TGT: globalState.session.token } })
Vue.prototype.$http_xiaolong = new common.Http({ response, request: xiaolong_req, sign, secret, alert: message.error, headers: { token: globalState.session.token } }) Vue.prototype.$http_xiaolong = new common.Http({ response, request: xiaolong_req, sign, secret, alert: message.error, headers: { token: globalState.session.token } })
Vue.prototype.$tracker = common.tracker // Vue.prototype.$tracker = common.tracker
// const myToken = 'scrm-base-107ee03c-1214-48c3-a443-a2332e553b2f-rop' // const myToken = 'scrm-base-107ee03c-1214-48c3-a443-a2332e553b2f-rop'
// Vue.prototype.$http = new common.Http({ response, request, sign, secret, alert: message.error, headers: { token: myToken } }) // Vue.prototype.$http = new common.Http({ response, request, sign, secret, alert: message.error, headers: { token: myToken } })
// Vue.prototype.$http2 = new common.Http({ response, request: request2, sign, secret, alert: message.error, headers: { token: myToken } }) // Vue.prototype.$http2 = new common.Http({ response, request: request2, sign, secret, alert: message.error, headers: { token: myToken } })
......
...@@ -462,7 +462,7 @@ export default { ...@@ -462,7 +462,7 @@ export default {
type: 'success', type: 'success',
message: '操作成功!' message: '操作成功!'
}) })
this.$tracker.track(Object.assign({},{pageName:'群发助手',name:'新建客户群发',params})) // this.$tracker.track(Object.assign({},{pageName:'群发助手',name:'新建客户群发',params}))
} else { } else {
this.$message({ this.$message({
type: 'error', type: 'error',
......
...@@ -336,7 +336,7 @@ export default { ...@@ -336,7 +336,7 @@ export default {
message: '操作成功!' message: '操作成功!'
}) })
// this.$router.push('/customerTransform/index') // this.$router.push('/customerTransform/index')
this.$tracker.track(Object.assign({},{pageName:'群发助手',name:'新建客户群群发',params})) // this.$tracker.track(Object.assign({},{pageName:'群发助手',name:'新建客户群群发',params}))
} else { } else {
this.$message({ this.$message({
type: 'error', type: 'error',
......
...@@ -68,7 +68,7 @@ ...@@ -68,7 +68,7 @@
<div class="tips-text"> <div class="tips-text">
<img src="@/assets/guestCustom/tips.png" class="tips-icon" alt /> <img src="@/assets/guestCustom/tips.png" class="tips-icon" alt />
<span>因企业微信限制,图片长宽建议不超过1440x1080,大小不超过10M,数量不超过9张。视频建议不超过1280x720,帧率30FPS,视频码率1.67 Mbps,最长不超过30S,最大不超过10MB</span> <span>因企业微信限制,普通图片:总像素不超过1555200,大小不超过10M,数量不超过9张。视频建议不超过1280x720,帧率30FPS,视频码率1.67 Mbps,最长不超过30S,最大不超过10MB</span>
</div> </div>
</div> </div>
<ActivityModel ref="activity" @selectActivity="selectActivity"></ActivityModel> <ActivityModel ref="activity" @selectActivity="selectActivity"></ActivityModel>
...@@ -201,10 +201,10 @@ export default { ...@@ -201,10 +201,10 @@ export default {
var image = new Image() var image = new Image()
image.src = e.target.result image.src = e.target.result
image.onload = () => { image.onload = () => {
if (image.width > 1440 || image.height > 1080) { // if (image.width > 1440 || image.height > 1080) {
this.$message.error('图片长宽不超过1440x1080') // this.$message.error('图片长宽不超过1440x1080')
return // return
} // }
this.previewList = this.previewList.filter(item => { this.previewList = this.previewList.filter(item => {
return item.attType == ATT_TYPE.TEXT || item.attType == ATT_TYPE.IMAGE return item.attType == ATT_TYPE.TEXT || item.attType == ATT_TYPE.IMAGE
}) })
......
<template>
<div>
<el-input @blur.stop="formatPhone" type="textarea" v-model="phone" :placeholder="placeholder"></el-input>
<span v-if="isTip" class="approval-tip" style="margin-left:0;">{{ tip }}</span>
<div>
<div :class="['tel-item', !item.valid ? 'valid-tel' : receiveType == 1 ? 'realTel' : 'realNum']" v-for="(item, index) in phoneList" :key="index">
{{ item.tel }}
<i style="cursor:pointer" class="el-icon-close" @click="delPhone(item.tel)"></i>
</div>
</div>
</div>
</template>
<script>
export default {
name: 'phone-area',
model: {
prop: 'newList',
event: 'changePhoneList'
},
props: {
receiveType: {
type: String,
require: true,
default: ''
},
placeholder: {
type: String,
default: ''
},
isTip: {
type: String,
default: ''
}
},
data() {
return {
phone: '',
phoneList: []
}
},
methods: {
delPhone(val) {
let phone = '\n' + this.phone + '\n'
phone = phone.replace(/[\n]/g, '\n\n')
phone = phone.replace(new RegExp('[\n]' + val + '[\n]', 'g'), '\n')
phone = phone.replace(/[\n]+/g, '\n')
phone = phone.replace(/^[\n]+/, '')
this.phone = phone
this.formatPhone()
},
formatPhone() {
let phoneList = this.phone.split('\n')
phoneList = [...new Set(phoneList)]
// let phoneList = this.phone.split(/[\n|\s|,|,]/)
let reg
if (this.receiveType == 1) {
reg = /^(13[0-9]|15[0-9]|16[0-9]|17[0-9]|18[0-9]|19[0-9]|14[0-9])[0-9]{8}$/
} else {
reg = /^[0-9a-zA-Z]{6}$/
}
let arr = []
phoneList.forEach(item => {
arr.push({
tel: item,
valid: reg.test(item)
})
})
this.phoneList = arr.filter(item => item.tel)
this.$emit('changePhoneList', this.phoneList)
}
}
}
</script>
<style scope lang="scss">
.tel-item {
height: 26px;
display: inline-block;
padding: 0 8px;
line-height: 26px;
background: #fafbfe;
border-radius: 4px;
border: 1px solid #e8e8ea;
color: #666666;
text-align: center;
margin-right: 4px;
box-sizing: border-box;
}
.valid-tel {
background: #fff1f0;
border: 1px solid #ffa39e;
color: #ff4d4f;
}
.realTel {
width: 130px;
}
.realNum {
width: 90px;
}
</style>
...@@ -40,17 +40,38 @@ ...@@ -40,17 +40,38 @@
</GLTable> </GLTable>
<!-- 表格区域 end --> <!-- 表格区域 end -->
</div> </div>
<glsx-dialog class="qr-dialog" width="720px" title="生成二维码" btnOkLabel="下载" :isVisible.sync="isQrcodeVisible" @confirmDialog="handleCancelConfirm" @closeDialog="handleCancelClose">
<div class="qrcode-body">
<p>可生成对应发放员工的小程序领取二维码</p>
<el-select filterable v-model="curStaffId" @change="changeStaff" placeholder="请选择发放员工">
<el-option v-for="item in curStaffList" :key="item.staffUUID" :label="item.staffName" :value="item.staffUUID"></el-option>
</el-select>
<div class="img" v-loading="imgLoading">
<el-image :src="curQrcode" alt=""></el-image>
</div>
</div>
</glsx-dialog>
</div> </div>
</template> </template>
<script> <script>
import * as dayjs from 'dayjs' import * as dayjs from 'dayjs'
import url from '@/assets/empty.png' import url from '@/assets/empty.png'
import { aToExport } from '@/common/constant' import { aToExport, downloadIamge } from '@/common/constant'
import glsxDialog from '@/components/glsx-dialog'
export default { export default {
name: 'giftList', name: 'giftList',
components: {
glsxDialog
},
data() { data() {
return { return {
isQrcodeVisible: false,
curId: '',
curStaffId: '',
imgLoading: false,
curStaffList: [],
curQrcode: '',
attrToIcon: { attrToIcon: {
2: 'discount', 2: 'discount',
3: 'cash', 3: 'cash',
...@@ -83,6 +104,22 @@ export default { ...@@ -83,6 +104,22 @@ export default {
listeners: { listeners: {
click: row => this.handleDelete(row.scope) click: row => this.handleDelete(row.scope)
} }
},
{
type: 'GLButton',
name: row => {
return '生成二维码'
},
condition: row => {
return row.scope.approveStatus == 2
},
attrs: {
type: 'text',
fn: '生成二维码'
},
listeners: {
click: row => this.makeQrcode(row.scope)
}
} }
], ],
size: 'small', size: 'small',
...@@ -133,8 +170,8 @@ export default { ...@@ -133,8 +170,8 @@ export default {
tableParams: { tableParams: {
listName: 'list', listName: 'list',
tableOption: { tableOption: {
width:120, width: 200,
align:'center' align: 'center'
}, },
tableColumns: [ tableColumns: [
{ {
...@@ -172,7 +209,8 @@ export default { ...@@ -172,7 +209,8 @@ export default {
{ {
label: '发放员工', label: '发放员工',
prop: 'staffList', prop: 'staffList',
width: 150, width: 200,
line: 1,
formatter: cellValue => { formatter: cellValue => {
return cellValue.staffList.map(item => item.staffName).join(',') return cellValue.staffList.map(item => item.staffName).join(',')
} }
...@@ -260,6 +298,65 @@ export default { ...@@ -260,6 +298,65 @@ export default {
}, },
methods: { methods: {
getQrcode(staffId) {
// 正式版为:release,体验版为: trial 开发版为:develop
let merchantId = this.$globalState.session.merchantId
const appId = this.getAppId()
const params = {
appId,
path: 'packageEquity/pages/directional/directional',
envVersion: this.getEnvVersion(),
scene: `id=${this.curId}&merchantId=${merchantId}&staffUUID=${staffId}`
}
this.imgLoading = true
this.$apis.giftBag.getQrcode(params).then(res => {
if (res) {
this.curQrcode = res
} else {
this.curQrcode = ''
}
this.imgLoading = false
})
},
getEnvVersion() {
const host = window.location.host
if (host.indexOf('beta') > -1 || host.indexOf('test') > -1) {
return 'trial'
} else {
return 'release'
}
},
getAppId() {
const host = window.location.host
if (host.indexOf('beta') > -1) {
return 'wx9f91c1ec493eb425'
} else if (host.indexOf('cgacar') > -1) {
return 'wxfe82b8d65d07808f'
} else {
return 'wxe10067a63c1856ac'
}
},
changeStaff(e) {
this.getQrcode(e)
},
makeQrcode(row) {
this.curId = row.id
this.curStaffList = row.staffList
this.curStaffId = row.staffList[0].staffUUID
this.isQrcodeVisible = true
this.getQrcode(this.curStaffId)
},
handleCancelConfirm() {
downloadIamge(this.curQrcode)
this.handleCancelClose()
},
handleCancelClose() {
this.curId = ''
this.curStaffId = ''
this.curQrcode = ''
this.curStaffList = []
this.isQrcodeVisible = false
},
getParams() { getParams() {
var params = JSON.parse(JSON.stringify(this.searchForm)) var params = JSON.parse(JSON.stringify(this.searchForm))
if (this.searchForm.createDate.length) { if (this.searchForm.createDate.length) {
...@@ -398,7 +495,7 @@ export default { ...@@ -398,7 +495,7 @@ export default {
} }
</script> </script>
<style lang="scss"> <style lang="scss" scoped>
.p-b-12 { .p-b-12 {
margin-bottom: 14px; margin-bottom: 14px;
font-weight: 500; font-weight: 500;
...@@ -411,6 +508,46 @@ export default { ...@@ -411,6 +508,46 @@ export default {
margin-right: 8px; margin-right: 8px;
display: inline-block; display: inline-block;
} }
.qr-dialog {
/deep/.el-dialog__body {
padding: 20px;
.el-scrollbar__wrap {
overflow: hidden;
}
.qrcode-body {
display: flex;
flex-direction: column;
align-items: center;
p {
line-height: 28px;
margin-bottom: 16px;
}
.el-select {
.el-input__inner {
width: 360px;
height: 36px;
}
.el-input__icon {
line-height: 36px;
}
}
.img {
margin-top: 16px;
background: #eee;
display: flex;
align-items: center;
justify-content: center;
&,
img {
width: 160px;
height: 160px;
}
}
}
}
}
.gift-detail .gift-item { .gift-detail .gift-item {
margin-right: 80px; margin-right: 80px;
display: flex; display: flex;
......
...@@ -30,7 +30,13 @@ ...@@ -30,7 +30,13 @@
<input type="file" style="opacity: 0" accept=".pdf" :disabled="routeInfo.addOrEdit == 2 && routeInfo.status != 1" @change="e => handlePdfChange(e)" /> <input type="file" style="opacity: 0" accept=".pdf" :disabled="routeInfo.addOrEdit == 2 && routeInfo.status != 1" @change="e => handlePdfChange(e)" />
<el-button icon="el-icon-plus" :size="size" :disabled="routeInfo.addOrEdit == 2 && routeInfo.status != 1">选择文件</el-button> <el-button icon="el-icon-plus" :size="size" :disabled="routeInfo.addOrEdit == 2 && routeInfo.status != 1">选择文件</el-button>
</div> </div>
<div v-if="pdfUrl">{{ pdfUrl }}</div> <!-- <div v-if="pdfUrl">{{ pdfUrl }}</div> -->
<ul v-if="pdfName || materialAddForm.materialUrl">
<li class="pdf-show">
<span class="pdf-name" @click="openPdfDia">{{ pdfName || materialAddForm.materialUrl }}</span>
<i v-if="routeInfo.addOrEdit == 1" class="el-icon-close" @click="delPdf"></i>
</li>
</ul>
</div> </div>
<!-- 选择自定义链接 --> <!-- 选择自定义链接 -->
<!-- <div v-show="materialAddForm.materialType == 2"> <!-- <div v-show="materialAddForm.materialType == 2">
...@@ -76,7 +82,7 @@ ...@@ -76,7 +82,7 @@
: :
</span> </span>
</span> </span>
<el-checkbox v-model="materialAddForm.isNotifySender" :checked="checked" @change="notifyChange">客户打开素材链接时通知发送人</el-checkbox> <el-checkbox :value="materialAddForm.isNotifySender" :checked="checked" @change="notifyChange">客户打开素材链接时通知发送人</el-checkbox>
<span class="track-tips track-info">(客户不包括本商户的员工)</span> <span class="track-tips track-info">(客户不包括本商户的员工)</span>
</el-form-item> </el-form-item>
<el-form-item prop="tagJson"> <el-form-item prop="tagJson">
...@@ -176,6 +182,7 @@ ...@@ -176,6 +182,7 @@
</div> </div>
</el-form> </el-form>
<SelectLabel ref="selectLabel" @tagSelected="handleSelect" :dialogVisible="dialogVisible"></SelectLabel> <SelectLabel ref="selectLabel" @tagSelected="handleSelect" :dialogVisible="dialogVisible"></SelectLabel>
<!-- <pdfReviewDia ref="pdfReviewDia" :pdfName="pdfName" :pdfUrl="pdfUrl" :dialogVisible="dialogPdfVisible"></pdfReviewDia> -->
<GLFooter class="gl-footer"> <GLFooter class="gl-footer">
<el-button @click="onSave" v-if="this.routeInfo.addOrEdit == 1">存草稿</el-button> <el-button @click="onSave" v-if="this.routeInfo.addOrEdit == 1">存草稿</el-button>
<el-button @click="handleCancel" class="btn-cancle">取消</el-button> <el-button @click="handleCancel" class="btn-cancle">取消</el-button>
...@@ -187,11 +194,13 @@ ...@@ -187,11 +194,13 @@
<script> <script>
import textBox from '@/views/material/components/textBox' import textBox from '@/views/material/components/textBox'
import SelectLabel from '@/views/material/components/selectLable' import SelectLabel from '@/views/material/components/selectLable'
// import pdfReviewDia from './components/pdfReviewDia.vue'
export default { export default {
name: 'addMaterialForm', name: 'addMaterialForm',
components: { components: {
textBox, textBox,
SelectLabel SelectLabel
// pdfReviewDia
}, },
data() { data() {
return { return {
...@@ -205,6 +214,8 @@ export default { ...@@ -205,6 +214,8 @@ export default {
tagging: [], tagging: [],
urlSrc: '', urlSrc: '',
pdfUrl: '', pdfUrl: '',
pdfName: '',
dialogPdfVisible: false,
textBoxContent: '', textBoxContent: '',
materialAddForm: { materialAddForm: {
groupId: '', // 素材组id groupId: '', // 素材组id
...@@ -244,7 +255,6 @@ export default { ...@@ -244,7 +255,6 @@ export default {
}, },
mounted() { mounted() {
this.routeInfo = this.$route.query this.routeInfo = this.$route.query
console.log(this.routeInfo)
this.routeInfo.addOrEdit != 1 ? this.getMaterialInfo() : '' this.routeInfo.addOrEdit != 1 ? this.getMaterialInfo() : ''
this.routeInfo.addOrEdit != 1 ? (this.routeInfo.status != 1 ? this.forbidEdit() : '') : '' this.routeInfo.addOrEdit != 1 ? (this.routeInfo.status != 1 ? this.forbidEdit() : '') : ''
this.title = this.titleObj[this.routeInfo.addOrEdit] this.title = this.titleObj[this.routeInfo.addOrEdit]
...@@ -396,6 +406,12 @@ export default { ...@@ -396,6 +406,12 @@ export default {
this.$apis.common.pictureUpload({ file: base64 }).then(res => { this.$apis.common.pictureUpload({ file: base64 }).then(res => {
if (res) { if (res) {
this.pdfUrl = res this.pdfUrl = res
this.pdfName = file.name
this.$notify({
title: '成功',
message: '文件上传成功',
type: 'success'
})
} }
}) })
} }
...@@ -428,6 +444,13 @@ export default { ...@@ -428,6 +444,13 @@ export default {
this.$refs.materialAddForm.validate(valid => { this.$refs.materialAddForm.validate(valid => {
if (valid) { if (valid) {
var params = this.getParams() var params = this.getParams()
if (!params.materialUrl) {
this.$message({
message: '素材类型不能为空',
type: 'warning'
})
return
}
params.status = 1 params.status = 1
let material let material
if (params.id) { if (params.id) {
...@@ -471,6 +494,13 @@ export default { ...@@ -471,6 +494,13 @@ export default {
// } // }
// }) // })
var params = this.getParams() var params = this.getParams()
if (!params.materialUrl) {
this.$message({
message: '素材类型不能为空',
type: 'warning'
})
return
}
// status 状态 0 启用 -1 禁用 1 存草稿 // status 状态 0 启用 -1 禁用 1 存草稿
params.status = 0 params.status = 0
// params.isNotifySender = -1 // params.isNotifySender = -1
...@@ -568,6 +598,15 @@ export default { ...@@ -568,6 +598,15 @@ export default {
// 删除上传图片 // 删除上传图片
deleteImg() { deleteImg() {
this.materialAddForm.titleUrl = '' this.materialAddForm.titleUrl = ''
},
// 删除pdf
delPdf() {
this.pdfUrl = ''
this.pdfName = ''
},
openPdfDia() {
this.dialogPdfVisible = true
this.$refs.pdfReviewDia.init()
} }
} }
} }
...@@ -751,7 +790,6 @@ export default { ...@@ -751,7 +790,6 @@ export default {
.pdf-show { .pdf-show {
display: inline-flex; display: inline-flex;
position: relative; position: relative;
width: 109px;
height: 32px; height: 32px;
input { input {
position: absolute; position: absolute;
...@@ -878,4 +916,29 @@ export default { ...@@ -878,4 +916,29 @@ export default {
vertical-align: middle; vertical-align: middle;
} }
} }
ul {
margin-top: 5px;
.pdf-show {
// width: 200px;
list-style: none;
align-items: center;
position: relative;
padding: 0 8px;
.pdf-name {
margin-right: 20px;
&:hover {
color: #5850ff;
}
}
&:hover {
cursor: pointer;
background-color: rgba(88, 80, 255, 0.2) !important;
}
i {
position: absolute;
right: 5px;
top: 10px;
}
}
}
</style> </style>
<template> <template>
<div class="material-group"> <div class="material-group" :style="{ height: groupHeight + 'px' }">
<div class="all-group">
<div class="all-group-word" @click="getList">全部素材组 ({{ groupCounter.length }})</div>
<div>
<el-button class="add_btn" icon="el-icon-plus" :size="size" @click="handleAddGroup(1)">素材组</el-button> <el-button class="add_btn" icon="el-icon-plus" :size="size" @click="handleAddGroup(1)">素材组</el-button>
<div class="all-group">
<div @click="getList">
<img src="@/assets/material/groupIcon.png" alt="" />
全部素材组 ({{ groupCounter.length }})
</div> </div>
<div @click="groupVisible = !groupVisible">
<i class="el-icon-arrow-down" v-show="groupVisible"></i>
<i class="el-icon-arrow-up" v-show="!groupVisible"></i>
</div> </div>
<ul> </div>
<ul v-show="groupVisible" :style="{ height: groupHeight - 110 + 'px' }">
<li v-for="(item, index) in groupCounter" :class="index === currentIndex ? 'active' : ''" :key="index" @click="handleGroup(item, index)"> <li v-for="(item, index) in groupCounter" :class="index === currentIndex ? 'active' : ''" :key="index" @click="handleGroup(item, index)">
<img src="@/assets/material/file.png" alt="" style="vertical-align: middle" /> <img src="@/assets/material/file.png" alt="" style="vertical-align: middle" />
<div class="group-name">{{ item.materialGroupName }}</div> <div class="group-name">{{ item.materialGroupName }}</div>
...@@ -27,7 +32,7 @@ ...@@ -27,7 +32,7 @@
import * as dayjs from 'dayjs' import * as dayjs from 'dayjs'
export default { export default {
name: 'materialGroup', name: 'materialGroup',
props: { eventBus: Object }, props: { eventBus: Object, groupHeight: Number },
data() { data() {
return { return {
// 素材组数量 // 素材组数量
...@@ -38,7 +43,8 @@ export default { ...@@ -38,7 +43,8 @@ export default {
orderValue: '', orderValue: '',
isDefault: '' // 默认素材组 0 是 -1 否(进入页面如果素材组数量为0,就会创建默认素材组,默认素材组不可删除) isDefault: '' // 默认素材组 0 是 -1 否(进入页面如果素材组数量为0,就会创建默认素材组,默认素材组不可删除)
}, },
currentIndex: null currentIndex: null,
groupVisible: true
} }
}, },
mounted() { mounted() {
...@@ -165,6 +171,7 @@ export default { ...@@ -165,6 +171,7 @@ export default {
<style lang="scss" scoped> <style lang="scss" scoped>
.el-popover { .el-popover {
min-width: 50px; min-width: 50px;
max-width: 150px;
&:hover { &:hover {
cursor: pointer; cursor: pointer;
} }
...@@ -172,18 +179,23 @@ export default { ...@@ -172,18 +179,23 @@ export default {
.material-group { .material-group {
.all-group { .all-group {
font-size: 16px; font-size: 16px;
font-weight: 600; height: 44px;
padding: 24px 16px 8px 16px; line-height: 44px;
padding: 0 17px 0 16px;
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
.el-button {
margin-top: -13px;
}
&-word {
cursor: pointer; cursor: pointer;
img {
width: 24px;
height: 24px;
vertical-align: middle;
}
i {
color: #999999;
} }
} }
ul { ul {
overflow: auto;
li { li {
cursor: pointer; cursor: pointer;
text-align: left; text-align: left;
...@@ -195,7 +207,7 @@ export default { ...@@ -195,7 +207,7 @@ export default {
font-size: 16px; font-size: 16px;
padding-top: 6px; padding-top: 6px;
position: absolute; position: absolute;
right: 16px; right: 0px;
transform: rotate(90deg); transform: rotate(90deg);
} }
} }
...@@ -210,17 +222,20 @@ ul { ...@@ -210,17 +222,20 @@ ul {
list-style: none; list-style: none;
position: relative; position: relative;
vertical-align: middle; vertical-align: middle;
margin: 0 10px;
&:nth-child(-n + 2) { &:nth-child(-n + 2) {
padding-bottom: 10px; padding-bottom: 10px;
} }
&:hover { &:hover {
color: #5850ff; // color: #5850ff;
background-color: #ebeaff; background-color: #ebeaff;
} }
} }
} }
.add_btn { .add_btn {
color: #5850ff; color: #5850ff;
border-color: #5850ff;
margin: 20px 0 12px 16px;
} }
.group-name { .group-name {
display: inline-flex; display: inline-flex;
......
<template>
<div>
<el-dialog :title="pdfName" :visible.sync="dialogPdfVisible" width="90%" top="20px">
<iframe ref="iframeRef" :src="pdfUrl"></iframe>
</el-dialog>
</div>
</template>
<script>
export default {
name: 'pdfReviewDia',
props: ['pdfUrl', 'pdfName'],
data() {
return {
dialogPdfVisible: false
}
},
methods: {
init() {
this.dialogPdfVisible = true
}
}
}
</script>
<style lang="scss" scoped>
.el-dialog {
.el-dialog__body {
display: flex;
justify-content: center;
padding: 0;
iframe {
width: 88vw;
height: 80vh;
}
}
}
</style>
...@@ -7,11 +7,24 @@ ...@@ -7,11 +7,24 @@
</span> </span>
</glsx-combi-form> </glsx-combi-form>
<GLTable ref="readPerDetailRef" @setTableFinishFun="setTableFinishFun" :getListApi="getListApi" :noDataImg="url" :searchForm="searchForm" :tableParams="tableParams" :pageConf="pageConf"> <GLTable ref="readPerDetailRef" @setTableFinishFun="setTableFinishFun" :getListApi="getListApi" :noDataImg="url" :searchForm="searchForm" :tableParams="tableParams" :pageConf="pageConf">
<div slot="departName" slot-scope="scope"> <div slot="departName" slot-scope="scope" style="display:flex">
<el-tag type="info" v-for="item in scope.scope.departName" effect="plain" :key="item"> <div v-for="(item, index) in scope.scope.departName" :key="index">
<el-tag type="info" :size="size" effect="plain" v-if="index < 3" style="margin-right:4px">
<i class="el-icon-user-solid" style="color: #75acff"></i> <i class="el-icon-user-solid" style="color: #75acff"></i>
{{ item }} {{ item }}
</el-tag> </el-tag>
<el-tag type="info" :size="size" v-if="scope.scope.departName.length > 3 && index == 3">
<el-popover placement="top" width="500" trigger="hover">
<span slot="reference">...({{ scope.scope.departName.length }})</span>
<div class="entmicro-hover">
<el-tag class="toptip" type="info" v-for="(i, index) in scope.scope.departName" :size="size" :key="index">
<i class="el-icon-user-solid" style="color: #75acff"></i>
{{ i }}
</el-tag>
</div>
</el-popover>
</el-tag>
</div>
</div> </div>
</GLTable> </GLTable>
</div> </div>
...@@ -76,7 +89,8 @@ export default { ...@@ -76,7 +89,8 @@ export default {
{ {
label: '所属企微成员', label: '所属企微成员',
prop: 'departName', prop: 'departName',
addHtml: 'departName' addHtml: 'departName',
width: 350
}, },
{ {
label: '阅读次数', label: '阅读次数',
...@@ -111,10 +125,17 @@ export default { ...@@ -111,10 +125,17 @@ export default {
}, },
setTableFinishFun() { setTableFinishFun() {
//接收到的数据为空 //接收到的数据为空
this.$refs.readPerDetailRef.data.length ? (this.$refs.readPerDetailRef.tableHeightValues = '') : this.$refs.readPerDetailRef.setTableHeightFun() this.$refs.readPerDetailRef.data.length ? (this.$refs.readPerDetailRef.tableHeightValues = '') : (this.$refs.readPerDetailRef.tableHeightValues = '280px')
} }
} }
} }
</script> </script>
<style lang="" scoped></style> <style lang="scss" scoped>
.toptip {
margin-right: 4px;
&:nth-last-of-type(-n + 4) {
margin-bottom: 0;
}
}
</style>
...@@ -149,7 +149,8 @@ export default { ...@@ -149,7 +149,8 @@ export default {
if (this.selectNum > 3) { if (this.selectNum > 3) {
this.$message({ this.$message({
message: '最多选择三个标签', message: '最多选择三个标签',
type: 'warning' type: 'warning',
customClass: 'dialog-tips'
}) })
return return
} }
......
...@@ -101,7 +101,7 @@ export default { ...@@ -101,7 +101,7 @@ export default {
this.$apis.material.sendDetailPage(params).then(res => { this.$apis.material.sendDetailPage(params).then(res => {
this.sendStaffTableData = res this.sendStaffTableData = res
// 计算表格高度,数据10条以下自适应,10条以上固定高度,表格内滚动,无数据调用方法计算高度 // 计算表格高度,数据10条以下自适应,10条以上固定高度,表格内滚动,无数据调用方法计算高度
res.length ? (res.length > 10 ? (this.$refs.staffSendDetailRef.tableHeightValues = '425px') : (this.$refs.staffSendDetailRef.tableHeightValues = '')) : this.$refs.staffSendDetailRef.setTableHeightFun() res.length ? (res.length > 10 ? (this.$refs.staffSendDetailRef.tableHeightValues = '425px') : (this.$refs.staffSendDetailRef.tableHeightValues = '')) : (this.$refs.staffSendDetailRef.tableHeightValues = '325px')
// res.length > 10 ? (this.$refs.staffSendDetailRef.tableHeightValues = '425px') : (this.$refs.staffSendDetailRef.tableHeightValues = '') // res.length > 10 ? (this.$refs.staffSendDetailRef.tableHeightValues = '425px') : (this.$refs.staffSendDetailRef.tableHeightValues = '')
}) })
} }
......
...@@ -27,13 +27,13 @@ export default { ...@@ -27,13 +27,13 @@ export default {
this.editor.config.menuTooltipPosition = 'down' this.editor.config.menuTooltipPosition = 'down'
this.editor.config.height = 400 this.editor.config.height = 400
this.editor.config.width = 500 this.editor.config.width = 500
this.editor.config.uploadVideoServer = '/api/upload-video' this.editor.config.excludeMenus = ['code']
this.editor.config.excludeMenus = ['code', 'video']
this.editor.config.onchange = html => { this.editor.config.onchange = html => {
// console.log(html); // console.log(html);
this.content = html // 绑定当前逐渐地值 this.content = html // 绑定当前逐渐地值
this.$emit('change', this.content) // 将内容同步到父组件中 this.$emit('change', this.content) // 将内容同步到父组件中
} }
// 上传图片
this.editor.config.customUploadImg = function(resultFiles, insertImgFn) { this.editor.config.customUploadImg = function(resultFiles, insertImgFn) {
var file = resultFiles[0] var file = resultFiles[0]
var reader = new FileReader() var reader = new FileReader()
...@@ -59,6 +59,32 @@ export default { ...@@ -59,6 +59,32 @@ export default {
// 上传图片,返回结果,将图片插入到编辑器中 // 上传图片,返回结果,将图片插入到编辑器中
} }
} }
// 上传视频
this.editor.config.customUploadVideo = function(resultFiles, insertVideoFn) {
var file = resultFiles[0]
var reader = new FileReader()
// 默认1MB
const limitSize = 10
const isLt = file.size / 1024 / 1024 < limitSize
if (!isLt) {
_this.$message.error('上传视频大小不能超过' + limitSize + 'MB!')
return true
}
reader.readAsDataURL(file)
reader.onload = e => {
const videoFile = e.target.result
const base64 = file.name.split('.')[1] + '@' + videoFile.split(',')[1]
_this.$apis.common.pictureUpload({ file: base64 }).then(res => {
if (res) {
// console.log(res)
insertVideoFn(res)
}
})
// resultFiles 是 input 中选中的文件列表
// insertImgFn 是获取图片 url 后,插入到编辑器的方法
// 上传图片,返回结果,将图片插入到编辑器中
}
}
this.editor.config.onchangeTimeout = 5000 this.editor.config.onchangeTimeout = 5000
this.editor.create() this.editor.create()
}, },
......
...@@ -14,63 +14,79 @@ ...@@ -14,63 +14,79 @@
<div class="container"> <div class="container">
<div class="search-form"> <div class="search-form">
<GLCombiForm ref="showSearch" :rowNumber="1" :formObj="searchForm" :formData="materialFormData" @handleOk="getListApi" @handleRest="handleReset"></GLCombiForm> <GLCombiForm ref="showSearch" :rowNumber="1" :formObj="searchForm" :formData="materialFormData" @handleOk="getListApi" @handleRest="handleReset"></GLCombiForm>
<!-- <glsx-combi-form ref="materialFormRef1" :isEdit="isEdit" :formObj="searchForm" :formData="materialFormData" :inline="true">
<span slot="footer" slot-scope="scope">
<span class="select-pro">
<el-button type="primary" :size="size" @click="getListApi">查询</el-button>
<el-button type="default" :size="size" @click="handleReset(scope)">重置</el-button>
</span>
</span>
</glsx-combi-form> -->
</div> </div>
<div class="tabelList"> <div class="tabelList">
<el-row :style="{ height: boxHeight }"> <el-row>
<el-col :span="5"> <el-col :span="5">
<div class="left" :style="{ height: boxHeight }"> <div class="left">
<MaterialGroup ref="materialGroup" @openAddDialog="addDialogShow" :eventBus="eventBus" @getList="getList" @getListApi="getListApi"></MaterialGroup> <MaterialGroup ref="materialGroup" @openAddDialog="addDialogShow" :groupHeight="boxHeight" :eventBus="eventBus" @getList="getList" @getListApi="getListApi"></MaterialGroup>
</div> </div>
</el-col> </el-col>
<el-col :span="19"> <el-col :span="19">
<div class="right" :style="{ height: boxHeight }"> <div class="right" :style="{ height: boxHeight + 'px' }">
<div class="groupTitle">{{ materialGroupName }}(共{{ tableTotal }}条数据)</div> <div class="groupTitle">{{ materialGroupName }}(共{{ tableTotal }}条数据)</div>
<GLTable ref="materialRef" :hasPage="false" :noDataImg="url" @refreshTable="getListApi" :layout="layout" :searchForm="searchForm" :tableParams="tableParams" :tableData="materialTableData" :pageConf="pageConf" :tableTotal="tableTotal" @sortChange="sortChange" :isCustomHead="true" :customHeadShowList="customHeadShowList"> <GLTable ref="materialRef" :hasPage="false" :noDataImg="url" @refreshTable="getListApi" :layout="layout" :searchForm="searchForm" :tableParams="tableParams" :tableData="materialTableData" :pageConf="pageConf" :tableTotal="tableTotal" @sortChange="sortChange" :isCustomHead="true" :customHeadShowList="customHeadShowList">
<!-- 素材内容 --> <!-- 素材内容 -->
<div slot="materialContentRpcResponse" slot-scope="scope" style="text-align: center"> <div slot="materialContentRpcResponse" slot-scope="scope" style="text-align: center">
<!-- 素材为PDF --> <!-- 素材为PDF -->
<span v-if="scope.scope.materialType == 1" class="material-content"> <span v-if="scope.scope.materialType == 1" class="material-content">
<el-tooltip effect="dark" placement="top" :content="scope.scope.materialContentRpcResponse.materialName" :disabled="scope.scope.materialContentRpcResponse.materialName.length < 16"> <img src="@/assets/material/pdf.png" style="margin-right:8px" alt="" />
<el-tooltip effect="dark" placement="top" :content="scope.scope.materialContentRpcResponse.materialName" :disabled="scope.scope.materialContentRpcResponse.materialName.length < 12">
<span class="hide-content">{{ scope.scope.materialContentRpcResponse.materialName }}</span> <span class="hide-content">{{ scope.scope.materialContentRpcResponse.materialName }}</span>
</el-tooltip> </el-tooltip>
<el-tooltip effect="dark" placement="top" :content="scope.scope.materialContentRpcResponse.materialName + '.pdf'">
<img src="@/assets/material/pdf.png" alt="" />
</el-tooltip>
</span> </span>
<!-- 素材为自定义链接 --> <!-- 素材为自定义链接 -->
<span v-if="scope.scope.materialType == 2"></span> <span v-if="scope.scope.materialType == 2"></span>
<!-- 图文 --> <!-- 素材为图文 -->
<span v-if="scope.scope.materialType == 3" class="material-content"> <span v-if="scope.scope.materialType == 3" class="material-content">
<el-tooltip effect="dark" placement="top" :content="scope.scope.materialContentRpcResponse.materialName" :disabled="scope.scope.materialContentRpcResponse.materialName.length < 16"> <!-- 图片 -->
<span class="hide-content">{{ scope.scope.materialContentRpcResponse.materialName }}</span> <el-popover placement="top" trigger="hover" v-if="scope.scope.urlType == 'img'">
</el-tooltip>
<el-popover placement="top" trigger="hover">
<div> <div>
<img class="img-plus" :src="scope.scope.materialContentRpcResponse.materialUrl ? scope.scope.materialContentRpcResponse.materialUrl : require('../../../src/assets/material/car.png')" alt="" /> <img class="img-plus" :src="scope.scope.materialContentRpcResponse.materialUrl" alt="" />
</div>
<div slot="reference" class="urlContent">
<img style="margin-right:8px" :src="scope.scope.materialContentRpcResponse.materialUrl" alt="" />
<div class="videoMask" v-if="scope.scope.imgCount > 1">
<img src="@/assets/material/multi.png" alt="" />
<span>{{ scope.scope.imgCount }}</span>
</div>
</div> </div>
<img slot="reference" :src="scope.scope.materialContentRpcResponse.materialUrl ? scope.scope.materialContentRpcResponse.materialUrl : require('../../../src/assets/material/car.png')" alt="" />
</el-popover> </el-popover>
<!-- 视频 -->
<el-popover placement="right" trigger="hover" v-if="scope.scope.urlType == 'video'">
<div>
<video controls autoplay width="300" height="300">
<source :src="scope.scope.materialContentRpcResponse.materialUrl" type="video/mp4" />
</video>
</div>
<div slot="reference" class="urlContent">
<video width="36" height="36">
<source :src="scope.scope.materialContentRpcResponse.materialUrl" type="video/mp4" />
</video>
<div class="videoMask">
<img src="@/assets/material/videoIcon.png" style="width: 22px;height: 22px;" alt="" />
</div>
</div>
</el-popover>
<el-tooltip effect="dark" placement="top" :content="scope.scope.materialContentRpcResponse.materialName" :disabled="scope.scope.materialContentRpcResponse.materialName.length < 14">
<span class="hide-content">{{ scope.scope.materialContentRpcResponse.materialName }}</span>
</el-tooltip>
</span> </span>
</div> </div>
<!-- 状态 --> <!-- 状态 -->
<div slot="status" slot-scope="scope"> <div slot="status" slot-scope="scope">
<span v-if="scope.scope.status == 0">启用</span> <GLButton style="display:inline-block" mode="el-switch" v-model="scope.scope.status" :active-value="0" :inactive-value="-1 || 1" fn="禁用" width="32" size="mini" @change="e => handleForbid(e, scope.scope)"></GLButton>
<span v-if="scope.scope.status == -1">禁用</span> <span style="margin-left: 5px;" v-if="scope.scope.status == 0">启用</span>
<span v-if="scope.scope.status == 1">存草稿</span> <span style="margin-left: 5px;" v-else>停用</span>
<!-- <span v-if="scope.scope.status == 1">存草稿</span> -->
</div> </div>
<!-- 类型 --> <!-- 类型 -->
<div slot="materialType" slot-scope="scope"> <div slot="materialType" slot-scope="scope">
<span v-if="scope.scope.materialType == 1">pdf</span> <span v-if="scope.scope.materialType == 1">pdf文件</span>
<span v-if="scope.scope.materialType == 2">自定义链接</span> <span v-if="scope.scope.materialType == 2">自定义链接</span>
<span v-if="scope.scope.materialType == 3">图文</span> <span v-if="scope.scope.urlType == 'video'">视频</span>
<span v-if="scope.scope.urlType == 'img'">图文</span>
<span v-if="!scope.scope.urlType && scope.scope.materialType == 3">纯文字</span>
</div> </div>
<span slot="auth-button" slot-scope="scope"> <span slot="auth-button" slot-scope="scope">
<GLTableButton :buttonList="tableButtonList" :buttonItem="scope.scope" :buttonNum="3"></GLTableButton> <GLTableButton :buttonList="tableButtonList" :buttonItem="scope.scope" :buttonNum="3"></GLTableButton>
...@@ -225,19 +241,6 @@ export default { ...@@ -225,19 +241,6 @@ export default {
}, },
{ {
type: 'GLButton', type: 'GLButton',
name: row => {
return row.status == 0 ? '禁用' : '启用'
},
attrs: {
type: 'text',
fn: '禁用'
},
listeners: {
click: this.handleForbid
}
},
{
type: 'GLButton',
name: '删除', name: '删除',
attrs: { attrs: {
type: 'text', type: 'text',
...@@ -261,18 +264,20 @@ export default { ...@@ -261,18 +264,20 @@ export default {
{ {
label: '状态', label: '状态',
prop: 'status', prop: 'status',
addHtml: 'status' addHtml: 'status',
width: 120
}, },
{ {
label: '类型', label: '类型',
prop: 'materialType', prop: 'materialType',
addHtml: 'materialType' addHtml: 'materialType',
width: 100
}, },
{ {
label: '发送次数', label: '发送次数',
prop: 'sendNum', prop: 'sendNum',
sortable: true, sortable: true,
width: 150, width: 130,
formatter: cellVal => { formatter: cellVal => {
return cellVal.sendNum return cellVal.sendNum
}, },
...@@ -320,7 +325,7 @@ export default { ...@@ -320,7 +325,7 @@ export default {
{ {
label: '阅读人数', label: '阅读人数',
prop: 'readNum', prop: 'readNum',
width: 150, width: 130,
sortable: true, sortable: true,
formatter: cellVal => { formatter: cellVal => {
return cellVal.readNum return cellVal.readNum
...@@ -369,7 +374,7 @@ export default { ...@@ -369,7 +374,7 @@ export default {
{ {
label: '更新时间', label: '更新时间',
prop: 'updatedTime', prop: 'updatedTime',
width: 180, width: 150,
sortable: true, sortable: true,
formatter: cellVal => { formatter: cellVal => {
return cellVal.updatedTime return cellVal.updatedTime
...@@ -385,8 +390,8 @@ export default { ...@@ -385,8 +390,8 @@ export default {
// 计算素材组&素材展示表格容器高度 // 计算素材组&素材展示表格容器高度
let clientHeight = document.documentElement.clientHeight let clientHeight = document.documentElement.clientHeight
let offTop = document.querySelector('.tabelList').offsetTop let offTop = document.querySelector('.tabelList').offsetTop
this.boxHeight = clientHeight - offTop - 80 + 'px' this.boxHeight = clientHeight - offTop - 80
this.tableHeight = clientHeight - offTop - 132 + 'px' this.tableHeight = clientHeight - offTop - 135 + 'px'
// this.findAllDictData('business_type') // this.findAllDictData('business_type')
this.getListEntBusinessType() this.getListEntBusinessType()
this.firstCome() this.firstCome()
...@@ -461,16 +466,25 @@ export default { ...@@ -461,16 +466,25 @@ export default {
}) })
}, },
// 素材禁用&启用 // 素材禁用&启用
handleForbid(scope) { handleForbid(e, scope) {
var params = {} var params = {}
params.id = scope.id params.id = scope.id
if (scope.status == 0) { params.status = e == 0 ? 0 : 1
params.status = -1 this.$apis.material.materialEdit(params).then(res => {
this.secondConfirm('提示', '禁用素材,所有已经发送给客户的素材链接均会失效,是否继续禁用?', 'material', 'materialEdit', params) console.log(res)
} else { res.code == 0 ? this.getListApi() : ''
params.status = 0 this.$message({
this.secondConfirm('提示', '启用素材,确定启用此素材?', 'material', 'materialEdit', params) message: res.code == '0' ? '操作成功' : '操作失败',
} type: res.code == '0' ? 'success' : 'error'
})
})
// if (e == 0) {
// params.status = -1
// this.secondConfirm('提示', '禁用素材,所有已经发送给客户的素材链接均会失效,是否继续禁用?', 'material', 'materialEdit', params)
// } else {
// params.status = 0
// this.secondConfirm('提示', '启用素材,确定启用此素材?', 'material', 'materialEdit', params)
// }
}, },
// 素材删除 // 素材删除
handleDelete(scope) { handleDelete(scope) {
...@@ -506,11 +520,17 @@ export default { ...@@ -506,11 +520,17 @@ export default {
if (item.materialType == 3) { if (item.materialType == 3) {
let html = decodeURIComponent(item.materialContentRpcResponse.materialUrl) let html = decodeURIComponent(item.materialContentRpcResponse.materialUrl)
let imgHtml = html.match(/<img.*?(?:>|\/>)/g) let imgHtml = html.match(/<img.*?(?:>|\/>)/g)
let videoHtml = html.match(/<video.*?(?:>|\/>)/g)
if (imgHtml) { if (imgHtml) {
let imgSrc = imgHtml[0].match('<img[^<>]*? src="([^<>]*?)"') let imgSrc = imgHtml[0].match('<img[^<>]*? src="([^<>]*?)"')
item.materialContentRpcResponse.materialUrl = imgSrc[1] item.materialContentRpcResponse.materialUrl = imgSrc[1]
} else { item.urlType = 'img'
item.materialContentRpcResponse.materialUrl = '' item.imgCount = imgHtml.length
}
if (videoHtml) {
let videoSrc = videoHtml[0].match('<video[^<>]*? src="([^<>]*?)"')
item.materialContentRpcResponse.materialUrl = videoSrc[1]
item.urlType = 'video'
} }
} }
tableData.push(item) tableData.push(item)
...@@ -572,6 +592,32 @@ export default { ...@@ -572,6 +592,32 @@ export default {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.videoMask {
position: absolute;
display: flex;
background: rgba(101, 101, 101, 0.6);
color: #ffffff;
top: 0;
right: 0;
width: 100%;
height: 100%;
img {
position: relative;
align-self: center;
margin: auto;
}
span {
position: absolute;
top: 12px;
right: 15px;
}
}
.urlContent {
margin-right: 8px;
position: relative;
width: 36px;
height: 36px;
}
.search-form, .search-form,
.left, .left,
.right { .right {
...@@ -612,7 +658,6 @@ ul { ...@@ -612,7 +658,6 @@ ul {
.left { .left {
height: 100%; height: 100%;
position: relative; position: relative;
overflow: auto;
border-right: 1px solid #e8e8ea; border-right: 1px solid #e8e8ea;
} }
.right { .right {
...@@ -633,12 +678,12 @@ ul { ...@@ -633,12 +678,12 @@ ul {
.material-content { .material-content {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between; // justify-content: space-between;
.hide-content { .hide-content {
text-align: left; text-align: left;
display: inline-block; display: inline-block;
min-width: 100px; min-width: 100px;
max-width: 220px; // max-width: 220px;
text-overflow: ellipsis; text-overflow: ellipsis;
overflow: hidden; overflow: hidden;
white-space: nowrap; white-space: nowrap;
...@@ -669,4 +714,13 @@ ul { ...@@ -669,4 +714,13 @@ ul {
display: inline-block; display: inline-block;
padding-bottom: 20px; padding-bottom: 20px;
} }
/deep/ .el-switch__core {
width: 32px !important;
}
/deep/ .el-table::before {
background-color: transparent;
}
/deep/ .el-table__fixed-right::before {
background-color: transparent;
}
</style> </style>
...@@ -24,7 +24,12 @@ ...@@ -24,7 +24,12 @@
</div> </div>
<div class="materialDetail-desc-item" v-if="detailInfo.materialType == 1"> <div class="materialDetail-desc-item" v-if="detailInfo.materialType == 1">
<div class="materialDetail-item-name">素材地址:</div> <div class="materialDetail-item-name">素材地址:</div>
<span class="copy-img">
<span id="materialUrl">
{{ detailInfo.materialUrl }} {{ detailInfo.materialUrl }}
</span>
<img @click="copyUrl" src="@/assets/material/copy.png" alt="" />
</span>
<span class="item-name-info">(备注:直接复制素材地址发送给客户无法接受通知提醒)</span> <span class="item-name-info">(备注:直接复制素材地址发送给客户无法接受通知提醒)</span>
</div> </div>
<div class="materialDetail-desc-row"> <div class="materialDetail-desc-row">
...@@ -155,7 +160,7 @@ ...@@ -155,7 +160,7 @@
</div> </div>
</div> </div>
</el-dialog> </el-dialog>
<GLFooter> <GLFooter class="gl-footer">
<el-button @click="goback" type="primary">返回</el-button> <el-button @click="goback" type="primary">返回</el-button>
</GLFooter> </GLFooter>
</div> </div>
...@@ -220,14 +225,17 @@ export default { ...@@ -220,14 +225,17 @@ export default {
this.detailInfo.materialUrl = decodeURIComponent(this.detailInfo.materialUrl) this.detailInfo.materialUrl = decodeURIComponent(this.detailInfo.materialUrl)
let html = this.detailInfo.materialUrl let html = this.detailInfo.materialUrl
let imgHtml = html.match(/<img.*?(?:>|\/>)/g) let imgHtml = html.match(/<img.*?(?:>|\/>)/g)
// for (let i = 0; i < imgHtml.length; i++) { let videoHtml = html.match(/<video.*?(?:>|\/>)/g)
// html = html.replace(imgHtml[i], '')
// }
if (imgHtml) { if (imgHtml) {
for (let i = 0; i < imgHtml.length; i++) { for (let i = 0; i < imgHtml.length; i++) {
html = html.replace(imgHtml[i], '') html = html.replace(imgHtml[i], '')
} }
} }
if (videoHtml) {
for (let i = 0; i < videoHtml.length; i++) {
html = html.replace(videoHtml[i], '')
}
}
this.htmlContent = html this.htmlContent = html
if (imgHtml) { if (imgHtml) {
this.imgSrc = imgHtml[0].match('<img[^<>]*? src="([^<>]*?)"') this.imgSrc = imgHtml[0].match('<img[^<>]*? src="([^<>]*?)"')
...@@ -266,6 +274,18 @@ export default { ...@@ -266,6 +274,18 @@ export default {
}, },
goback() { goback() {
this.$router.go(-1) this.$router.go(-1)
},
copyUrl() {
const range = document.createRange()
range.selectNode(document.getElementById('materialUrl'))
const selection = window.getSelection()
if (selection.rangeCount > 0) selection.removeAllRanges()
selection.addRange(range)
document.execCommand('copy')
this.$message({
message: '复制成功',
type: 'success'
})
} }
} }
} }
...@@ -322,16 +342,18 @@ export default { ...@@ -322,16 +342,18 @@ export default {
flex: 1; flex: 1;
.content-item-title { .content-item-title {
color: #333333; color: #333333;
max-width: 210px; font-family: PingFangSC-Regular, PingFang SC;
max-width: 185px;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
white-space: nowrap;
line-height: 20px; line-height: 20px;
margin-bottom: 6px; margin-bottom: 6px;
} }
.content-item-desc { .content-item-desc {
color: #999999; color: #999999;
line-height: 20px; line-height: 20px;
max-width: 210px; max-width: 185px;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
display: -webkit-box; display: -webkit-box;
...@@ -459,6 +481,7 @@ export default { ...@@ -459,6 +481,7 @@ export default {
font-size: 14px; font-size: 14px;
color: #999999; color: #999999;
line-height: 20px; line-height: 20px;
margin-left: 10px;
} }
.phone-view { .phone-view {
height: 600px; height: 600px;
...@@ -481,15 +504,18 @@ export default { ...@@ -481,15 +504,18 @@ export default {
padding: 8px; padding: 8px;
box-sizing: border-box; box-sizing: border-box;
border-radius: 13px; border-radius: 13px;
box-shadow: -2px 4px 3px #ccc;
&-title { &-title {
width: 100%; width: 100%;
height: 30px; height: 35px;
border-bottom: 1px solid #ccc; border-bottom: 1px solid #ccc;
color: #333; color: #333;
} }
&-word { &-word {
color: #666; color: #666;
line-height: 20px;
/deep/img {
width: 100% !important;
}
} }
} }
} }
...@@ -509,4 +535,17 @@ p { ...@@ -509,4 +535,17 @@ p {
.tag-show { .tag-show {
margin-bottom: -10px; margin-bottom: -10px;
} }
.gl-footer {
z-index: 1000;
}
.copy-img {
display: flex;
align-items: center;
img {
width: 16px;
height: 16px;
margin-left: 4px;
cursor: pointer;
}
}
</style> </style>
...@@ -49,6 +49,7 @@ ...@@ -49,6 +49,7 @@
<div class="choseItem" :class="{ active: currentIndex == index + 1 }" v-for="(item, index) in choseList" :key="index" @click="tabClick(index + 1)"> <div class="choseItem" :class="{ active: currentIndex == index + 1 }" v-for="(item, index) in choseList" :key="index" @click="tabClick(index + 1)">
{{ item }} {{ item }}
</div> </div>
<el-button :size="size" class="default-blue-btn m-l-20" type="default" @click="handleExport">导出</el-button>
</div> </div>
<GLTable ref="memberOrderRef" v-if="isReload" :noDataImg="url" @setTableFinishFun="setTableFinishFun" :searchForm="searchFormTable" :tableParams="tableParams" :getListApi="getListApi" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn"> <GLTable ref="memberOrderRef" v-if="isReload" :noDataImg="url" @setTableFinishFun="setTableFinishFun" :searchForm="searchFormTable" :tableParams="tableParams" :getListApi="getListApi" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn">
<div slot="orderType" slot-scope="scope" style="width: 200px"> <div slot="orderType" slot-scope="scope" style="width: 200px">
...@@ -479,8 +480,8 @@ export default { ...@@ -479,8 +480,8 @@ export default {
display: flex; display: flex;
height: auto; height: auto;
position: relative; position: relative;
width: 285px; width: 367px;
left: calc(100% - 285px); left: calc(100% - 367px);
.choseItem { .choseItem {
display: inline-block; display: inline-block;
cursor: pointer; cursor: pointer;
......
...@@ -135,7 +135,8 @@ export default { ...@@ -135,7 +135,8 @@ export default {
orderSource: '', orderSource: '',
deliveryType: '', deliveryType: '',
vin: '', vin: '',
shareStaffName: '' shareStaffName: '',
shareStaffType: ''
}, },
tableSearchForm: {}, tableSearchForm: {},
statisticsInfo: { statisticsInfo: {
...@@ -273,6 +274,15 @@ export default { ...@@ -273,6 +274,15 @@ export default {
labelWidth: 56, labelWidth: 56,
type: 'input', type: 'input',
maxlength: 100 maxlength: 100
},
{
label: '推荐人类型',
name: 'shareStaffType',
type: 'select',
optionList: [],
optionId: 'confId',
optionLabel: 'confName',
optionsName: 'shareStaffTypeList'
} }
], ],
// 快递信息 // 快递信息
...@@ -375,10 +385,11 @@ export default { ...@@ -375,10 +385,11 @@ export default {
} }
}, },
{ {
type: 'el-button', type: 'GLButton',
name: '订单核销', name: '订单核销',
attrs: { attrs: {
type: 'text' type: 'text',
fn: '订单核销'
}, },
condition: row => { condition: row => {
return row.deliveryType == 1 && row.orderStatus == 21 return row.deliveryType == 1 && row.orderStatus == 21
...@@ -388,10 +399,12 @@ export default { ...@@ -388,10 +399,12 @@ export default {
} }
}, },
{ {
type: 'el-button', type: 'GLButton',
name: '输入快递信息', // name: '输入快递信息',
name: '商品发货',
attrs: { attrs: {
type: 'text' type: 'text',
fn: '商品发货'
}, },
condition: row => { condition: row => {
return row.deliveryType == 2 && row.orderStatus == 6 return row.deliveryType == 2 && row.orderStatus == 6
...@@ -401,10 +414,11 @@ export default { ...@@ -401,10 +414,11 @@ export default {
} }
}, },
{ {
type: 'el-button', type: 'GLButton',
name: '退款审核', name: '退款审核',
attrs: { attrs: {
type: 'text' type: 'text',
fn: '退款审核'
}, },
condition: row => { condition: row => {
return row.afterSaleStatus == 1 return row.afterSaleStatus == 1
...@@ -455,6 +469,22 @@ export default { ...@@ -455,6 +469,22 @@ export default {
} }
}, },
{ {
label: '支付时间',
prop: 'payDate',
width: '180',
formatter: cellValue => {
return cellValue.payDate ? dayjs(cellValue.payDate).format('YYYY-MM-DD HH:mm:ss') : '-'
}
},
{
label: '核销时间',
prop: 'verificationDate',
width: '180',
formatter: cellValue => {
return cellValue.verificationDate ? dayjs(cellValue.verificationDate).format('YYYY-MM-DD HH:mm:ss') : '-'
}
},
{
label: '客户名称', label: '客户名称',
prop: 'customerName', prop: 'customerName',
line: 2, line: 2,
...@@ -484,6 +514,14 @@ export default { ...@@ -484,6 +514,14 @@ export default {
} }
}, },
{ {
label: '推荐人类型',
prop: 'shareStaffType',
width: '180',
formatter: cellValue => {
return this.baseData.shareStaffTypeList.map(item => item.confId).includes(cellValue.shareStaffType + '') ? this.baseData.shareStaffTypeList.find(item => item.confId == cellValue.shareStaffType).confName : '-'
}
},
{
label: '支付总价', label: '支付总价',
prop: 'payPrice', prop: 'payPrice',
formatter: cellValue => { formatter: cellValue => {
...@@ -534,6 +572,10 @@ export default { ...@@ -534,6 +572,10 @@ export default {
refundTypeList: [ refundTypeList: [
{ confId: '1', confName: '退款退货' }, { confId: '1', confName: '退款退货' },
{ confId: '2', confName: '我要退款(无需退货)' } { confId: '2', confName: '我要退款(无需退货)' }
],
shareStaffTypeList: [
{ confId: '1', confName: '个微' },
{ confId: '2', confName: '企微' }
] ]
} }
} }
...@@ -829,7 +871,8 @@ export default { ...@@ -829,7 +871,8 @@ export default {
orderSource: '', orderSource: '',
deliveryType: '', deliveryType: '',
vin: '', vin: '',
shareStaffName: '' shareStaffName: '',
shareStaffType: ''
} }
this.handleSearch() this.handleSearch()
} }
......
...@@ -104,6 +104,10 @@ export default { ...@@ -104,6 +104,10 @@ export default {
name: 'shareStaffName' name: 'shareStaffName'
}, },
{ {
label: '推荐人类型',
name: ''
},
{
label: '车架号', label: '车架号',
name: 'vin' name: 'vin'
}, },
...@@ -135,6 +139,10 @@ export default { ...@@ -135,6 +139,10 @@ export default {
{ {
label: '发货地址', label: '发货地址',
name: 'shipAddress' name: 'shipAddress'
},
{
label: '其他信息',
name: ''
} }
], ],
// 售后信息 // 售后信息
...@@ -177,6 +185,10 @@ export default { ...@@ -177,6 +185,10 @@ export default {
refundTypeList: [ refundTypeList: [
{ confId: '1', confName: '退款退货' }, { confId: '1', confName: '退款退货' },
{ confId: '2', confName: '退款不退货' } { confId: '2', confName: '退款不退货' }
],
shareStaffTypeList: [
{ confId: '1', confName: '个微' },
{ confId: '2', confName: '企微' }
] ]
} }
} }
...@@ -212,12 +224,16 @@ export default { ...@@ -212,12 +224,16 @@ export default {
getInfo() { getInfo() {
this.$apis.orderManage.getOrderDetailApi({ orderCode: this.routeInfo.orderCode }).then(res => { this.$apis.orderManage.getOrderDetailApi({ orderCode: this.routeInfo.orderCode }).then(res => {
this.detailForm = res this.detailForm = res
console.log(this.detailForm)
this.orderRefund = res.orderRefund || null this.orderRefund = res.orderRefund || null
this.detailForm.createdDateStr = dayjs(this.detailForm.createdDate).format('YYYY-MM-DD HH:mm:ss') this.detailForm.createdDateStr = dayjs(this.detailForm.createdDate).format('YYYY-MM-DD HH:mm:ss')
if (this.orderRefund) { if (this.orderRefund) {
this.orderRefund.refundTypeName = this.baseData.refundTypeList.map(item => item.confId).includes(res.orderRefund.refundType + '') ? this.baseData.refundTypeList.find(item => item.confId == res.orderRefund.refundType).confName : '-' this.orderRefund.refundTypeName = this.baseData.refundTypeList.map(item => item.confId).includes(res.orderRefund.refundType + '') ? this.baseData.refundTypeList.find(item => item.confId == res.orderRefund.refundType).confName : '-'
this.orderRefund.createdDateStr = dayjs(this.orderRefund.createdDate).format('YYYY-MM-DD HH:mm:ss') this.orderRefund.createdDateStr = dayjs(this.orderRefund.createdDate).format('YYYY-MM-DD HH:mm:ss')
} }
if (this.detailForm.shareStaffType) {
this.baseData.shareStaffTypeList.map(item => item.confId).includes(this.detailForm.shareStaffType + '') ? this.baseData.shareStaffTypeList.find(item => item.confId == this.detailForm.shareStaffType).confName : '-'
}
if (this.detailForm.subOrderCoupon) { if (this.detailForm.subOrderCoupon) {
this.detailForm.subOrderCoupon.discountAmount = (this.detailForm.subOrderCoupon.discountAmount / 100).toFixed(2) this.detailForm.subOrderCoupon.discountAmount = (this.detailForm.subOrderCoupon.discountAmount / 100).toFixed(2)
} }
......
...@@ -198,8 +198,7 @@ ...@@ -198,8 +198,7 @@
</el-radio-group> </el-radio-group>
</template> </template>
<template slot="serviceDescHtml"> <template slot="serviceDescHtml">
<el-input type="textarea" v-model="editForm.serviceDesc" style="width: 320px" placeholder="请输入商品描述" <el-input type="textarea" v-model="editForm.serviceDesc" style="width: 320px" placeholder="请输入商品描述" :autosize="{ minRows: 2, maxRows: 4 }" maxlength="30" :disabled="isDisabled" />
:autosize="{ minRows: 2, maxRows: 4 }" maxlength="30" :disabled="isDisabled" />
</template> </template>
<div slot="selectMerchant" slot-scope="scope" class="select-merchant"> <div slot="selectMerchant" slot-scope="scope" class="select-merchant">
<div> <div>
...@@ -516,7 +515,7 @@ export default { ...@@ -516,7 +515,7 @@ export default {
// 带货是否选择全部商户(0:否,1:是) // 带货是否选择全部商户(0:否,1:是)
takeAllMerchant: '1', takeAllMerchant: '1',
supplyMerchantList: [], supplyMerchantList: [],
serviceDesc:'' serviceDesc: ''
}, },
isEdit: true, isEdit: true,
labelWidth: '144px', labelWidth: '144px',
......
<!-- 浏览明细 -->
<template>
<div class="edit-share marketing p-t-20 edit-box">
<div class="container edit-container">
<p class="edit-title">{{ routeInfo.activityName }}</p>
<div class="p-20">
<GLCombiForm ref="showSearch" class="p-t-20" :rowNumber="1" :formObj="searchForm" :formData="searchFormData" @handleOk="handleSearch" @handleRest="handleReset"></GLCombiForm>
<div class="flex m-b-10 w-100-percent">
<span class="table-title"></span>
<el-button :size="size" class="default-blue-btn" type="default" @click="handleExport">导出</el-button>
</div>
<!-- 表格区域 开始 -->
<GLTable ref="browserRef" :getListApi="getListApi" :noDataImg="url" :searchForm="searchForm" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn" @setTableFinishFun="setTableFinishFun">
<div slot="customerName" class="flex-align" slot-scope="scope">
<el-popover placement="top" width="160" trigger="hover" popper-class="table-popover-block">
<img class="table-popover-img" :src="scope.scope.customerAvatar" />
<img class="img-36 pointer" slot="reference" :src="scope.scope.customerAvatar" />
</el-popover>
<span class="m-l-10">{{ scope.scope.customerName }}</span>
</div>
<div slot="shareName" class="flex-align" slot-scope="scope">
<el-popover placement="top" width="160" trigger="hover" popper-class="table-popover-block">
<img class="table-popover-img" :src="scope.scope.shareAvatar" />
<img class="img-36 pointer" slot="reference" :src="scope.scope.shareAvatar" />
</el-popover>
<span class="m-l-10">{{ scope.scope.shareName }}</span>
</div>
</GLTable>
<!-- 表格区域 end -->
</div>
</div>
<div class="footer" :style="{ left: footerLeft + 'px', width: footerWidth + 'px' }">
<el-button type="default" @click="handleJump">返回</el-button>
</div>
</div>
</template>
<script>
import * as dayjs from 'dayjs'
import url from '@/assets/empty.png'
import { exportFn } from '@/common/constant'
export default {
name: 'browseList',
data() {
return {
size: 'small',
url: url,
footerLeft: '0',
footerWidth: '0',
routeInfo: {
id: '',
activityName: ''
},
searchForm: {
customerName: '',
mobile: ''
},
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' },
// 搜索
searchFormData: [
{
label: '微信昵称',
name: 'customerName',
type: 'input',
maxlength: 50
},
{
label: '手机号',
name: 'mobile',
type: 'input',
maxlength: 11
}
],
// 表格
getListApi: this.$apis.seckillActivity.getBrowseListApi,
tableParams: {
listName: 'list',
tableColumns: [
{
label: '微信名称',
prop: 'customerName',
addHtml: 'customerName'
},
{
label: '手机号',
prop: 'mobile'
},
{
label: '来源',
prop: 'shareName',
addHtml: 'shareName'
},
{
label: '浏览次数',
prop: 'browseCount'
},
{
label: '浏览时间',
prop: 'createdDate',
// width: '180',
formatter: cellValue => {
return dayjs(cellValue.createdDate).format('YYYY-MM-DD HH:mm:ss')
}
}
]
}
}
},
created() {
this.routeInfo = this.$route.query
},
mounted() {
this.footerLeft = document.querySelector('.base-container-right').offsetLeft
this.footerWidth = document.documentElement.clientWidth - this.footerLeft
},
methods: {
beforeSearchFn() {
return new Promise(resolve => {
this.searchForm.activityId = this.routeInfo.id
resolve()
})
},
handleExport() {
var params = this.$common.utils.deepClone(this.searchForm)
params.pageNum = 1
params.pageSize = 999999
this.$apis.seckillActivity.exportBrowseApi(params).then(res => {
exportFn(res)
})
},
handleJump(path, row = {}) {
this.$router.push({
path: '/seckillActivity/crowdFundList'
})
},
setTableFinishFun() {
//接收到的数据为空
this.$refs.browserRef.data.length ? (this.$refs.browserRef.tableHeightValues = '') : this.$refs.browserRef.setTableHeightFun()
},
handleSearch() {
this.$refs.browserRef.refreshTable()
},
handleReset() {
this.searchForm = {
activityId: this.routeInfo.id,
customerName: '',
mobile: ''
}
this.handleSearch()
}
}
}
</script>
<style scoped></style>
<!-- 秒杀活动 - 众筹模式 -->
<template>
<div class="marketing p-t-20">
<div class="m-b-20">
<GLButton :size="size" class="default-blue-btn el-icon-plus" type="default" @click="handleEdit('add')" fn="新增众筹" mode="el-button">新建众筹</GLButton>
<el-button :size="size" type="default" class="default-blue-btn" @click="handleJump">订单管理</el-button>
</div>
<div class="container">
<GLCombiForm ref="showSearch" :rowNumber="1" :formObj="searchForm" :formData="searchFormData" @handleOk="handleSearch" @handleRest="handleReset"></GLCombiForm>
<!-- 表格区域 开始 -->
<GLTable ref="activity" :getListApi="getListApi" :noDataImg="url" :searchForm="tableSearchForm" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn" @setTableFinishFun="setTableFinishFun">
<div slot="activityImg" class="table-image" slot-scope="scope">
<el-popover placement="top" width="160" trigger="hover" popper-class="table-popover-block">
<img class="table-popover-img" :src="scope.scope.activityImg" />
<img class="img-60 pointer" slot="reference" :src="scope.scope.activityImg" />
</el-popover>
</div>
<div slot="viewAmount" slot-scope="scope">
<p class="cursor-pointer" @click="handleDetail(scope.scope)">{{ scope.scope.viewAmount || 0 }}</p>
</div>
<div class="table-btns" slot="auth-button" slot-scope="scope">
<GLTableButton :buttonList="tableButtonList" :buttonItem="scope.scope" :buttonNum="3"></GLTableButton>
</div>
</GLTable>
<!-- 表格区域 end -->
</div>
<!-- 分享 -->
<share-dialog :isShareVisible="isShareVisible" :shareForm="shareForm" @handleShareClose="handleShareClose"></share-dialog>
</div>
</template>
<script>
import shareDialog from '../productGroup/components/shareDialog'
import * as dayjs from 'dayjs'
import url from '@/assets/empty.png'
export default {
name: 'crowdFundList',
data() {
return {
size: 'small',
url: url,
downForm: {
id: '',
offReason: '',
goodsStatus: 0
},
// 分享
isShareVisible: false,
shareForm: {},
searchForm: {
activityName: '',
activityStatus: ''
},
tableSearchForm: {},
// 搜索
searchFormData: [
{
label: '活动名称',
name: 'activityName',
type: 'input',
width: '215px',
maxlength: 20
},
{
label: '状态',
name: 'activityStatus',
type: 'select',
width: '215px',
optionList: [],
optionId: 'confId',
optionLabel: 'confName',
optionsName: 'statusList'
}
],
// 表格按钮
tableButtonList: [
{
type: 'el-button',
name: '开始',
attrs: {
type: 'text'
},
condition: row => {
return row.activityStatus == '1'
},
listeners: {
click: this.start
}
},
{
type: 'el-button',
name: '结束',
attrs: {
type: 'text'
},
condition: row => {
return row.activityStatus == '2'
},
listeners: {
click: this.end
}
},
{
type: 'GLButton',
name: '编辑',
attrs: {
type: 'text',
fn: '编辑众筹'
},
condition: row => {
return row.activityStatus == '1' || row.activityStatus == '2' || row.activityStatus == '3'
},
listeners: {
click: row => {
// var editOrDetail = {
// 1: 'edit',
// 2: 'detail',
// 3: 'detail'
// }[row.activityStatus]
// return this.handleEdit(editOrDetail, row)
this.handleEdit('edit', row)
}
}
},
{
type: 'GLButton',
name: '删除',
attrs: {
type: 'text',
fn: '删除众筹'
},
condition: row => {
return row.activityStatus == '3'
},
listeners: {
click: this.del
}
},
{
type: 'el-button',
name: '置顶',
attrs: {
type: 'text'
},
listeners: {
click: this.topping
}
},
{
type: 'el-button',
name: '分享',
attrs: {
type: 'text'
},
condition: row => {
return row.activityStatus == '1' || row.activityStatus == '2'
},
listeners: {
click: this.handleShare
}
},
],
// 表格
getListApi: this.$apis.seckillActivity.getCrowdfundListApi,
tableParams: {
listName: 'list',
tableOption: true,
tableColumns: [
{
label: '活动名称',
prop: 'activityName',
width: 220
},
{
label: '缩略图',
prop: 'activityImg',
addHtml: 'activityImg'
},
{
label: '浏览量(次)',
prop: 'viewAmount',
addHtml: 'viewAmount',
width: 140
},
{
label: '进账',
prop: 'income',
formatter: cellValue => {
return cellValue.income ? (cellValue.income / 100).toFixed(2) : '--'
}
},
{
label: '出账',
prop: 'expenditure',
formatter: cellValue => {
return cellValue.expenditure ? (cellValue.expenditure / 100).toFixed(2) : '--'
}
},
{
label: '盈利',
prop: 'profit',
formatter: cellValue => {
return cellValue.profit ? (cellValue.profit / 100).toFixed(2) : '--'
}
},
{
label: '分享',
prop: 'shareAmount'
},
{
label: '销量',
prop: 'saleAmount'
},
{
label: '秒杀价(元)',
name: 'activityPrice',
width: 140,
formatter: cellValue => {
return (cellValue.activityPrice / 100).toFixed(2)
}
},
{
label: '剩余库存',
prop: 'goodsStock',
width: 110
},
{
label: '创建日期',
name: 'createdDate',
width: 200,
formatter: cellValue => {
return dayjs(cellValue.createdDate).format('YYYY-MM-DD HH:mm:ss')
}
},
{
label: '活动状态',
name: 'activityStatus',
width: 110,
formatter: cellValue => {
return this.baseData.statusList.find(item => item.confId == cellValue.activityStatus).confName
}
}
]
},
pageConf: { pageSize: 'pageSize', pageNum: 'currentPage', totalCount: 'total' },
baseData: {
statusList: [
{
confId: '1',
confName: '未开始 '
},
{
confId: '2',
confName: '进行中'
},
{
confId: '3',
confName: '已结束'
}
]
}
}
},
components: {
shareDialog
},
mounted() {
this.getOptionsList('searchFormData')
},
methods: {
getParams() {
var params = JSON.parse(JSON.stringify(this.searchForm))
return params
},
beforeSearchFn() {
return new Promise(resolve => {
this.tableSearchForm = this.getParams()
// delete this.tableSearchForm.createDate
resolve()
})
},
handleJump(path, row = {}) {
this.$router.push({
path: '/orderManage/index'
})
},
secondConfirm(title, txt, apiModule, apiName, apiParams, fn) {
this.$confirm(txt, title, {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
callback: action => {
if (action == 'confirm') {
this.$apis[apiModule][apiName](apiParams).then(res => {
this.$message({
message: res.code == '0' ? '操作成功' : res.message,
type: res.code == '0' ? 'success' : 'error'
})
if (res.code == '0') {
fn && fn()
this.handleSearch()
}
})
}
}
})
},
//开始
start(item) {
this.startOrEndConfirm('开始', item)
},
//结束
end(item) {
this.startOrEndConfirm('结束', item)
},
startOrEndConfirm(txt, row) {
var title = txt
var params = {}
params.id = row.id
if (txt == '开始') {
params.activityStatus = '2' //活动状态(1:未开始,2:开始,3:结束)
} else if (txt == '结束') {
params.activityStatus = '3' //活动状态(1:未开始,2:开始,3:结束)
}
this.secondConfirm(title, '确定要' + txt + '此活动?', 'seckillActivity', 'toggleStatusApi', params)
},
//置顶
topping(row) {
var params = {}
params.id = row.id
this.secondConfirm('删除', '确定置顶此活动?', 'seckillActivity', 'topActivityApi', params)
},
//删除
del(row) {
var params = {}
params.id = row.id
this.secondConfirm('删除', '确定删除此活动?', 'seckillActivity', 'deleteActivityApi', params)
},
// 1-新增;2-编辑
handleEdit(addOrEdit, row) {
var params = {
addOrEdit: addOrEdit,
$title: encodeURI(addOrEdit == 'add' ? '新建众筹活动' : '编辑众筹活动')
}
if (addOrEdit != 'add') {
params.id = row.id
params.activityStatus = row.activityStatus
}
this.$router.push({
path: '/seckillActivity/editCrowdFund',
query: params
})
},
// 明细
handleDetail(row) {
this.$router.push({
path: '/seckillActivity/browseList',
query: {
id: row.id,
activityName: row.activityName
}
})
},
//新增活动
// addActivity() {
// this.$router.push('/seckillActivity/editCrowdFund/1')
// },
// // addOrEdit:1-新增;2-编辑;3-查看
// handleEdit(addOrEdit, row) {
// this.$router.push('/seckillActivity/editCrowdFund/' + addOrEdit + '/' + row.id)
// },
handleShare(row) {
this.$apis.seckillActivity.getCrowdSharedApi({ id: row.id }).then(res => {
this.shareForm = res
this.handleShareClose()
})
},
handleShareClose() {
this.isShareVisible = !this.isShareVisible
},
getOptionsList(formName, hasAll = true, refreshSigle) {
if (refreshSigle) {
var item = this[formName].find(k => k.name == refreshSigle)
var index = this[formName].findIndex(k => k.name == refreshSigle)
this.$set(this[formName][index], 'optionList', this.$common.utils.deepClone(this.baseData[item.optionsName]))
if (hasAll && this.baseData[item.optionsName].length && this.baseData[item.optionsName][0][this[formName][index].optionLabel] !== '全部') {
const temp = {}
temp[this[formName][index].optionId] = ''
temp[this[formName][index].optionLabel] = '全部'
this[formName][index].optionList.unshift(temp)
}
} else {
this[formName].forEach((item, index) => {
if (item.type === 'select' && this.baseData[item.optionsName].length) {
this.$set(this[formName][index], 'optionList', this.$common.utils.deepClone(this.baseData[item.optionsName]))
if (hasAll && this.baseData[item.optionsName].length && this.baseData[item.optionsName][0][this[formName][index].optionLabel] !== '全部') {
const temp = {}
temp[this[formName][index].optionId] = ''
temp[this[formName][index].optionLabel] = '全部'
this[formName][index].optionList.unshift(temp)
}
}
})
}
},
handleSearch() {
this.$refs.activity.refreshTable()
},
handleReset() {
this.searchForm = {
activityName: '',
activityStatus: ''
}
this.handleSearch()
},
setTableFinishFun() {
//接收到的数据为空
this.$refs.activity.data.length ? (this.$refs.activity.tableHeightValues = '') : this.$refs.activity.setTableHeightFun()
}
}
}
</script>
<style scoped></style>
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<glsx-combi-form class="edit-form-container" ref="editFormRef" :isEdit="true" :isBlock="true" :formRef="editChildRef" :formObj="editForm" :formData="editFormData" :formRules="editRule"> <glsx-combi-form class="edit-form-container" ref="editFormRef" :isEdit="true" :isBlock="true" :formRef="editChildRef" :formObj="editForm" :formData="editFormData" :formRules="editRule">
<div slot="activityImg" class="edit-tips m-t-8">展示在首页的活动详情页</div> <div slot="activityImg" class="edit-tips m-t-8">展示在首页的活动详情页</div>
<template slot="activityTimeHtml"> <template slot="activityTimeHtml">
<el-date-picker style="width: 474px" v-model="editForm.activityTime" type="datetimerange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" value-format="yyyy-MM-dd HH:mm:ss" :picker-options="pickerOptions" :default-time="['00:00:00', '23:59:59']" :disabled="isDisabled" clearable></el-date-picker> <el-date-picker style="width: 474px" v-model="editForm.activityTime" type="datetimerange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" value-format="yyyy-MM-dd HH:mm:ss" :picker-options="pickerOptions" :default-time="['00:00:00', '23:59:59']" :disabled="isDisabled" :clearable="false"></el-date-picker>
</template> </template>
<div slot="goodsHtml"> <div slot="goodsHtml">
<el-button type="default" class="default-blue-btn el-icon-plus" v-if="apear != 'see'" @click="handleRelateProClose">选择商品</el-button> <el-button type="default" class="default-blue-btn el-icon-plus" v-if="apear != 'see'" @click="handleRelateProClose">选择商品</el-button>
...@@ -176,13 +176,13 @@ export default { ...@@ -176,13 +176,13 @@ export default {
} }
], ],
goodsStock: [ goodsStock: [
{ required: true, message: '请设置活动库存', trigger: 'change' }, { required: true, message: '请设置活动库存', trigger: 'change' }
{ // {
validator: (rule, value, callback) => { // validator: (rule, value, callback) => {
return value > this.selectedProInfo.goodsStock ? callback(new Error('活动库存不能大于商品库存')) : callback() // return value > this.selectedProInfo.goodsStock ? callback(new Error('活动库存不能大于商品库存')) : callback()
}, // },
trigger: 'change' // trigger: 'change'
} // }
], ],
goodsId: [{ required: true, message: '请选择商品', trigger: ['change', 'blur'] }], goodsId: [{ required: true, message: '请选择商品', trigger: ['change', 'blur'] }],
limitPurchaseFlag: [{ required: true, message: '请选择是否限购', trigger: 'change' }], limitPurchaseFlag: [{ required: true, message: '请选择是否限购', trigger: 'change' }],
...@@ -499,7 +499,7 @@ export default { ...@@ -499,7 +499,7 @@ export default {
this.getGoodInfo(info.goodsId) this.getGoodInfo(info.goodsId)
if (info.activityPrice != null && info.goodsStock != null) { if (info.activityPrice != null && info.goodsStock != null) {
form.activityPrice = (info.activityPrice / 100).toFixed(2) form.activityPrice = (info.activityPrice / 100).toFixed(2)
form.goodsStock = info.goodsStock form.goodsStock = info.goodsStock + ''
} }
this.$nextTick(() => { this.$nextTick(() => {
this.editStatus = false this.editStatus = false
......
<!-- 众筹活动 -->
<template>
<div class="edit-share marketing p-t-20 edit-box edit-activity">
<div class="container edit-container">
<!-- 基本信息 -->
<p class="edit-title">基本信息</p>
<glsx-combi-form class="edit-form-container" ref="editFormRef" :isEdit="true" :isBlock="true" :formRef="editChildRef" :formObj="editForm" :formData="editFormData" :formRules="editRule">
<div slot="activityImg" class="edit-tips m-t-8">展示在首页的活动详情页</div>
<template slot="activityTimeHtml">
<el-date-picker style="width: 474px" v-model="editForm.activityTime" type="datetimerange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" value-format="yyyy-MM-dd HH:mm:ss" :picker-options="pickerOptions" :default-time="['00:00:00', '23:59:59']" :disabled="isDisabled" :clearable="false"></el-date-picker>
</template>
<div slot="goodsHtml">
<el-button type="default" class="default-blue-btn el-icon-plus" v-if="!isDisabled" @click="handleRelateProClose">选择商品</el-button>
<div v-if="selectedProInfo.id && !specificationDetailList.length" style="margin-top: 10px">
<p>
<img class="img-60" :src="selectedProInfo.goodsImage" />
&nbsp;&nbsp;&nbsp; 零售价 {{ (selectedProInfo.retailPrice / 100).toFixed(2) }}元 &nbsp;&nbsp;&nbsp; 商品库存 {{ selectedProInfo.goodsStock }}件
</p>
<el-form-item label="设置秒杀价" prop="activityPrice" id="activityPrice">
<el-input v-model="editForm.activityPrice" style="width: 150px" :disabled="isDisabled"><span slot="append">元</span></el-input>
</el-form-item>
<el-form-item label="活动库存" prop="goodsStock" id="goodsStock">
<el-input v-model="editForm.goodsStock" style="width: 150px" :disabled="isDisabled"><span slot="append">件</span></el-input>
</el-form-item>
</div>
</div>
<div slot="specificationsHtml" v-if="specificationDetailList.length" class="flex" style="min-width: 600px" id="specificationDetailList">
<div style="width: calc(100%)">
<table class="table-spesc" style="width: calc(100%)">
<tbody>
<tr>
<td :style="{ width: specsWidth }" v-for="(subItem, subIndex) in specificationDetailList" :key="subIndex">{{ subItem.specificationName }}</td>
<td :style="{ width: specsWidth }">零售价(元)</td>
<td :style="{ width: specsWidth }">库存</td>
<td :style="{ width: specsWidth }">设置秒杀价</td>
<td :style="{ width: specsWidth }">活动库存</td>
</tr>
</tbody>
</table>
<table class="table-spesc" style="max-height: 400px">
<tbody>
<tr style="border-bottom: 1px solid rgb(235, 235, 235)" v-for="(item, index) in nameToValSpecsList" :key="index">
<td :style="{ width: specsWidth }" v-for="(n, idx) in item.specsValueList" :key="idx">{{ n }}</td>
<td :style="{ width: specsWidth }">{{ item.retailPrice }}元</td>
<td :style="{ width: specsWidth }">{{ item.stock }}件</td>
<td :style="{ width: specsWidth }">
<el-input :disabled="isDisabled" placeholder="秒杀价" style="width: 90%" v-model="item.activityPrice" @input="item.activityPrice = activityPrice_input($event, item.retailPrice)"></el-input>
</td>
<td :style="{ width: specsWidth }">
<el-input :disabled="isDisabled" placeholder="活动库存" style="width: 90%" v-model="item.goodsStock" @input="item.goodsStock = goodsStock_input($event, item.stock)"></el-input>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<template slot="limitPurchaseFlag" slot-scope="scope">
<el-radio-group v-model="editForm[scope.scope.name]" @change="handleIsLimit">
<el-radio v-for="(item, index) in scope.scope.optionList" :key="index" :label="item[scope.scope.optionId]" :disabled="isDisabled">{{ item[scope.scope.optionLabel] }}</el-radio>
</el-radio-group>
<p v-if="editForm[scope.scope.name] == 2" id="limitPurchaseNumber" style="color: #333333;">
每人限购
<el-form-item prop="limitPurchaseNumber">
<el-input v-model="editForm.limitPurchaseNumber" placeholder="请输入限购次数" :disabled="isDisabled"></el-input>
</el-form-item>
件
</p>
</template>
</glsx-combi-form>
<!-- 活动配置 -->
<p class="edit-title">活动配置</p>
<glsx-combi-form class="edit-form-container" ref="configEditFormRef" :isEdit="true" :isBlock="true" :formRef="editChildRef" :formObj="editForm" :formData="configEditFormData" :formRules="editRule">
<template slot="customerServiceFlag" slot-scope="scope">
<el-radio-group v-model="editForm[scope.scope.name]" @change="handleIsLimit">
<el-radio v-for="(item, index) in scope.scope.optionList" :key="index" :label="item[scope.scope.optionId]">{{ item[scope.scope.optionLabel] }}</el-radio>
</el-radio-group>
<div class="customer-service" v-if="editForm[scope.scope.name] == 2" id="customerServiceFlag">
<glsx-combi-form class="edit-form-container" ref="serviceEditFormRef" :isEdit="true" :isBlock="false" :formRef="editChildRef" :formObj="editForm" :formData="serviceEditFormData" :formRules="editRule"></glsx-combi-form>
</div>
</template>
<template slot="activityMusic" slot-scope="scope">
<el-upload v-show="!editForm[scope.scope.name]" class="upload-demo" action="" accept="audio/mp3, audio/m4a" :show-file-list="false" :http-request="handleMusicUpload" :on-change="e => handleMusicChange(e, scope.scope)" :limit="1" :on-exceed="handleExceed">
<el-button class="el-icon-plus" size="small" type="default">背景音乐</el-button>
</el-upload>
<div v-if="editForm[scope.scope.name]" class="flex">
<audio controls>
<source :src="editForm[scope.scope.name]" type="audio/mpeg" />
</audio>
<el-button class="describe-delete" icon="el-icon-delete" type="text" @click="handleMusicDelete(scope.scope)"></el-button>
</div>
</template>
<template slot="fictitious">
<div class="fictitious" id="fictitious">
<el-form-item label="参团:" prop="fictitiousGroupQuantity" labelWidth="60px">
<el-input v-model="editForm.fictitiousGroupQuantity" style="width: 90px" maxlength="50" placeholder="参团人数"></el-input>
</el-form-item>
<el-form-item label="阶梯人数:" prop="fictitiousLadderQuantity" labelWidth="90px">
<el-input v-model="editForm.fictitiousLadderQuantity" style="width: 90px" maxlength="50" placeholder="阶梯人数"></el-input>
</el-form-item>
<el-form-item label="浏览:" prop="fictitiousViewQuantity" labelWidth="60px">
<el-input v-model="editForm.fictitiousViewQuantity" style="width: 90px" maxlength="50" placeholder="浏览人数"></el-input>
</el-form-item>
</div>
</template>
<div slot="activityBigImg" class="edit-tips m-t-8">建议尺寸750*1258</div>
<div slot="activityVideos" class="edit-tips m-t-8">最多上传六个视频</div>
<div slot="posterImg" class="edit-tips m-t-8">建议尺寸640*1008</div>
<div class="form-describe flex-default" slot="formDescribe" v-for="(item, index) in formDescribeList" :key="index">
<el-input class="describe-input" v-model="item.value" placeholder="请输入" maxlength="20" clearable></el-input>
<el-button class="describe-delete" v-show="index != formDescribeList.length - 1 || index == describeNum - 1" icon="el-icon-delete" type="text" @click="handleDescribeDelete(index)"></el-button>
<el-button v-show="index == formDescribeList.length - 1 && formDescribeList.length < describeNum" :size="size" type="default" class="default-blue-btn el-icon-plus" @click="handleDescribeAdd">新增</el-button>
</div>
</glsx-combi-form>
</div>
<div class="wechat-box">
<img class="w-100-percent" src="@/assets/seckillActivity/phone.png" />
<div class="wechat-back">
<p class="wechat-name one-line-ellipsis">{{ editForm.activityName }}</p>
<img class="wechat-head" src="@/assets/seckillActivity/crowd-head.png" />
<img class="icon-server" src="@/assets/seckillActivity/icon-server.png" />
<div class="wechat-inner-box">
<div class="wechat-banner-img">
<img class="icon-music" src="@/assets/seckillActivity/icon-music.png" />
<img :src="editForm.activityImg || require('@/assets/seckillActivity/icon-default.png')" />
<img class="wechat-customer" src="@/assets/seckillActivity/crowd-customer.png" />
<div class="w-100-percent txt-center">
<video v-if="editForm.activityVideos.length" class="wechat-video" controls>
<source :src="editForm.activityVideos[0]" type="video/mp4" />
</video>
</div>
<div class="wechat-block">
<p class="wechat-block-title">活动举办方</p>
<div class="flex-center">
<div>
<p class="m-b-10">{{ editForm.sponsorName }}</p>
<p class="m-b-10 wechat-sub-addr">{{ editForm.activityAddressDetailName }}</p>
<p class="wechat-time" v-if="editForm.activityTime.length">活动时间:{{ editForm.activityTime[0].split(' ')[0] }}-{{ editForm.activityTime[1].split(' ')[0] }}</p>
</div>
<img class="icon-addr" src="@/assets/seckillActivity/icon-addr.png" />
</div>
</div>
<div class="wechat-block">
<p class="wechat-block-title">距离活动开始</p>
<p class="wechat-count-down m-b-10">
<span v-if="editForm.activityTime.length">{{ editForm.activityTime[0].split(' ')[0].split('-')[2] }}</span>
日开始活动,还差
<span class="wechat-txt">{{ countDownObj.d }}</span>天
<span class="wechat-txt">{{ countDownObj.h }}</span>时
<span class="wechat-txt">{{ countDownObj.m }}</span>分
<span class="wechat-txt">{{ countDownObj.s }}</span>秒
</p>
</div>
<div class="w-100-percent txt-center">
<img class="crowd-jdt" src="@/assets/seckillActivity/crowd-jdt.png" />
</div>
<div v-html="editForm.activityDetail"></div>
</div>
</div>
<img class="wechat-footer" src="@/assets/seckillActivity/crowd-footer.png" />
</div>
</div>
<div class="footer" :style="{ left: footerLeft + 'px', width: footerWidth + 'px' }">
<el-button type="primary" v-if="routeInfo.addOrEdit != 'detail'" @click="handleConfirm">确定</el-button>
<el-button v-if="routeInfo.addOrEdit != 'detail'" @click="handleCancel">取消</el-button>
<el-button v-if="routeInfo.addOrEdit == 'detail'" @click="handleCancel">返回</el-button>
</div>
<select-single-pro-dialog v-if="isSingleSelectVisible" :isSingleSelectVisible="isSingleSelectVisible" :selectedProInfo="selectedProInfo" @handleSingleSelectConfirm="handleSingleSelectConfirm" @handleSingleSelectClose="handleSingleSelectClose(true)"></select-single-pro-dialog>
</div>
</template>
<script>
import { limitPrice } from '@/common/constant'
export default {
name: 'editActivity',
data() {
return {
size: 'small',
footerLeft: '0',
footerWidth: '0',
editChildRef: 'editChildRef',
pickerOptions: {
disabledDate(v) {
//禁用当前之前的日期
return v.getTime() < new Date().getTime() - 86400000
}
},
routeInfo: {
// 1-新增;2-编辑;3-查看
// add-新增;edit-编辑;detail-详情
addOrEdit: 'add',
id: '',
activityStatus: ''
},
editStatus: false,
/* eslint-disable */
reg: {
priceReg: /^\d[\d\.]*$/,
numReg: /^[1-9]\d*$/
},
/* eslint-enable */
isDisabled: false,
// 商品选择
isSingleSelectVisible: false,
selectedProInfo: {},
specificationDetailList: [],
nameToValSpecsList: [],
activityInfo: {},
editForm: {
activityName: '',
activityImg: '',
promotion: '',
activityTime: [],
activityPrice: '',
goodsStock: '',
goodsId: '',
limitPurchaseFlag: 1,
limitPurchaseNumber: '',
// 活动配置
customerServiceFlag: 1,
customerServiceName: '',
customerServicePhone: '',
customerServiceQrImg: '',
sponsorName: '',
activityAddressProvinceCode: '',
activityAddressCityCode: '',
activityAddressProvinceName: '',
activityAddressCityName: '',
activityAddressLng: '',
activityAddressLat: '',
activityAddressDetailName: '',
activityBigImg: '',
activityVideos: [],
activityDetail: '',
forwardTitle: '',
posterImg: ''
// formDescribeFirst: '',
// formDescribeSecond: '',
// formDescribeThird: ''
},
//商品列表
tableParams: {
tableOption: true,
tableColumns: [
{
label: '缩略图',
prop: 'goodsImage',
addHtml: 'goodsImage'
},
{
label: '商品名称',
prop: 'goodsName'
},
{
label: '零售价(元)',
prop: 'retailPrice'
}
]
},
searchProForm: {
name: ''
},
// selectedAllProList: [],
// selectedProList: [],
editRule: {
activityName: [{ required: true, message: '请输入活动名称', trigger: 'change' }],
activityImg: [{ required: true, message: '请选择活动宣传图', trigger: 'change' }],
promotion: [{ required: true, message: '请输入活动宣传语', trigger: 'change' }],
activityTime: [{ required: true, message: '活动时间不能为空', trigger: 'change' }],
activityPrice: [
{ required: true, message: '请设置秒杀价', trigger: 'change' },
{
validator: (rule, value, callback) => {
return value >= +(this.selectedProInfo.retailPrice / 100).toFixed(2) ? callback(new Error('秒杀价必须小于零售价')) : callback()
},
trigger: 'change'
}
],
goodsStock: [
{ required: true, message: '请设置活动库存', trigger: 'change' }
// {
// validator: (rule, value, callback) => {
// return value > this.selectedProInfo.goodsStock ? callback(new Error('活动库存不能大于商品库存')) : callback()
// },
// trigger: 'change'
// }
],
goodsId: [{ required: true, message: '请选择商品', trigger: ['change', 'blur'] }],
limitPurchaseFlag: [{ required: true, message: '请选择是否限购', trigger: 'change' }],
limitPurchaseNumber: [
{ required: false, message: '请输入限购次数', trigger: 'blur' },
{
validator: (rule, value, callback) => {
if (this.editForm.limitPurchaseFlag == 2 && (value < 1 || value > 10 || !/^\d+$/.test(value))) {
return callback('请输入1-10的限购次数')
}
return callback()
},
trigger: 'blur'
}
],
// 活动配置
// customerServiceName: [{ required: true, message: '请输入客服名称', trigger: 'change' }],
// customerServicePhone: [{ required: true, message: '请输入客服电话', trigger: 'change' }],
// customerServiceQrImg: [{ required: true, message: '请选择客服二维码', trigger: 'change' }],
// sponsorName: [{ required: true, message: '请输入主办方', trigger: 'change' }],
// activityAddressDetailName: [{ required: true, message: '请选择活动地址', trigger: 'change' }],
activityBigImg: [{ required: true, message: '请选择活动大图', trigger: 'change' }],
activityDetail: [{ required: true, message: '请输入活动详情', trigger: 'change' }],
forwardTitle: [{ required: true, message: '请输入转发标题', trigger: 'change' }]
},
// 表单设置
describeNum: 3,
describeIdxToAttr: {
0: 'First',
1: 'Second',
2: 'Third'
},
formDescribeList: [
{
value: ''
}
],
// 倒计时
countDownObj: {
d: '',
h: '',
m: '',
s: ''
},
// 基本信息
editFormData: [
{
label: '活动名称',
name: 'activityName',
width: '474px',
type: 'input',
maxlength: 20,
tips: '如XX店车主关怀活动',
isDisabled: false
},
{
label: '活动宣传图',
name: 'activityImg',
type: 'upload',
width: '320px',
limitSize: 10,
maxPhotoNum: 1,
isDisabled: false,
suffixSlot: 'activityImg',
handleUpload: (e, file, targetItem) => {
const imgFile = e.target.result
const base64 = file.name.split('.')[file.name.split('.').length - 1] + '@' + imgFile.split(',')[1]
this.$apis.common.uploadImgApi({ file: base64, fileType: 'image' }).then(res => {
this.editForm[targetItem.name] = res
this.$refs.editFormRef.$refs[this.editChildRef].validateField(targetItem.name)
})
}
},
{
label: '活动宣传语',
name: 'promotion',
width: '474px',
type: 'input',
maxlength: 20,
tips: '比如车主关怀,0元秒杀',
isDisabled: false
},
{
label: '活动时间',
name: 'activityTime',
addHtml: 'activityTimeHtml'
},
{
label: '商品',
name: 'goodsId',
addHtml: 'goodsHtml'
},
{
label: '规格明细',
name: '',
addHtml: 'specificationsHtml',
isHide: true
},
{
label: '是否限购',
name: 'limitPurchaseFlag',
addHtml: 'limitPurchaseFlag',
optionId: 'confId',
optionLabel: 'confName',
optionList: [
{
confId: 1,
confName: '否',
isDisabled: false
},
{
confId: 2,
confName: '是',
isDisabled: false
}
]
}
],
// 客服设置
serviceEditFormData: [
{
label: '客服名称',
name: 'customerServiceName',
width: '200px',
type: 'input',
maxlength: 50
},
{
label: '客服电话',
name: 'customerServicePhone',
width: '200px',
type: 'input',
maxlength: 11
},
{
label: '客服二维码',
name: 'customerServiceQrImg',
type: 'upload',
width: '320px',
limitSize: 10,
maxPhotoNum: 1,
handleUpload: (e, file, targetItem) => {
const imgFile = e.target.result
const base64 = file.name.split('.')[file.name.split('.').length - 1] + '@' + imgFile.split(',')[1]
this.$apis.common.uploadImgApi({ file: base64, fileType: 'image' }).then(res => {
this.editForm[targetItem.name] = res
this.$refs.editFormRef.$refs[this.editChildRef].validateField(targetItem.name)
})
}
}
],
// 活动配置
configEditFormData: [
{
label: '客服设置',
name: 'customerServiceFlag',
addHtml: 'customerServiceFlag',
optionId: 'confId',
optionLabel: 'confName',
optionList: [
{
confId: 1,
confName: '同步在线客服'
},
{
confId: 2,
confName: '单独设置'
}
]
},
{
label: '主办方',
name: 'sponsorName',
width: '474px',
type: 'input',
maxlength: 100,
tips: '默认展示门店名称'
},
{
label: '活动地址',
name: 'activityAddressDetailName',
type: 'map',
attrObj: {
provinceName: 'activityAddressProvinceName',
provinceCode: 'activityAddressProvinceCode',
cityName: 'activityAddressCityName',
cityCode: 'activityAddressCityCode',
lat: 'activityAddressLat',
lng: 'activityAddressLng',
fullAddress: 'activityAddressDetailName'
}
},
{
label: '活动大图',
name: 'activityBigImg',
type: 'upload',
width: '320px',
tips: '进入活动页的图片',
limitSize: 5,
maxPhotoNum: 1,
suffixSlot: 'activityBigImg',
handleUpload: (e, file, targetItem) => {
const imgFile = e.target.result
const base64 = file.name.split('.')[file.name.split('.').length - 1] + '@' + imgFile.split(',')[1]
this.$apis.common.uploadImgApi({ file: base64, fileType: 'image' }).then(res => {
this.editForm[targetItem.name] = res
this.$refs.configEditFormRef.$refs[this.editChildRef].validateField(targetItem.name)
})
}
},
{
label: '活动视频',
name: 'activityVideos',
type: 'upload',
uploadType: 'video',
suffixSlot: 'activityVideos',
tips: '大图下可以展示视频,不上传则不显示',
limitSize: 20,
maxPhotoNum: 6,
handleUpload: (e, file, targetItem) => {
const imgFile = e.target.result
const base64 = file.name.split('.')[file.name.split('.').length - 1] + '@' + imgFile.split(',')[1]
this.$apis.common.uploadVideoApi({ file: base64 }).then(res => {
this.editForm[targetItem.name].push(res)
})
}
},
{
label: '活动详情',
name: 'activityDetail',
tips: '展示活动的详细内容',
type: 'textBox'
},
{
label: '音乐文件',
name: 'activityMusic',
tips: '活动页背景音乐',
limitSize: 2,
addHtml: 'activityMusic'
},
{
label: '预估销量',
name: 'predictVolume',
width: '474px',
type: 'input',
append: '件',
maxlength: 20,
tips: '用作战报的销量展示'
},
{
label: '虚拟设置',
name: 'fictitious',
addHtml: 'fictitious'
},
{
label: '转发标题',
name: 'forwardTitle',
width: '474px',
type: 'input',
maxlength: 50
},
{
label: '海报图片',
name: 'posterImg',
type: 'upload',
width: '320px',
limitSize: 10,
maxPhotoNum: 1,
suffixSlot: 'posterImg',
handleUpload: (e, file, targetItem) => {
const imgFile = e.target.result
const base64 = file.name.split('.')[file.name.split('.').length - 1] + '@' + imgFile.split(',')[1]
this.$apis.common.uploadImgApi({ file: base64, fileType: 'image' }).then(res => {
this.editForm[targetItem.name] = res
this.$refs.configEditFormRef.$refs[this.editChildRef].validateField(targetItem.name)
})
}
},
{
label: '表单设置',
name: 'formDescribe',
addHtml: 'formDescribe'
}
]
}
},
mounted() {
this.footerLeft = document.querySelector('.base-container-right').offsetLeft
this.footerWidth = document.documentElement.clientWidth - this.footerLeft
this.routeInfo = this.$route.query
this.routeInfo.addOrEdit != 'add' ? this.getInfo() : ''
var id = this.routeInfo.id
var detailDisableList = ['editFormData']
if (id) {
if (this.routeInfo.addOrEdit == 'edit' && this.routeInfo.activityStatus == 2) {
// this.$refs.configEditFormRef.$refs.activityDetailTextBox[0].forbidEdit()
this.isDisabled = this.routeInfo.addOrEdit != 'add'
detailDisableList.forEach(attr => {
this.changeFormAttr(
attr,
'isDisabled',
this[attr].map(item => item.label),
true
)
})
}
}
},
watch: {
editForm: {
handler(val) {
this.editStatus = true
},
deep: true
},
'editForm.activityPrice'(newValue, oldValue) {
this.editForm.activityPrice = limitPrice(newValue, oldValue, 5, 2, 0)
},
'editForm.goodsStock'(newValue, oldValue) {
this.editForm.goodsStock = limitPrice(newValue, oldValue, 5, 0, 0)
},
'editForm.activityTime'(newValue) {
newValue && this.countDown()
},
'editForm.predictVolume'(newValue, oldValue) {
this.editForm.predictVolume = limitPrice(newValue, oldValue, 7, 0, 0, 1000000)
},
'editForm.fictitiousGroupQuantity'(newValue, oldValue) {
this.editForm.fictitiousGroupQuantity = limitPrice(newValue, oldValue, 7, 0, 0)
},
'editForm.fictitiousLadderQuantity'(newValue, oldValue) {
this.editForm.fictitiousLadderQuantity = limitPrice(newValue, oldValue, 7, 0, 0)
},
'editForm.fictitiousViewQuantity'(newValue, oldValue) {
this.editForm.fictitiousViewQuantity = limitPrice(newValue, oldValue, 7, 0, 0)
}
},
methods: {
changeFormAttr(formName, attrName, labelList, attrValue) {
labelList.forEach(item => {
let idx = this[formName].findIndex(k => k.label == item)
this[formName][idx][attrName] = attrValue
})
},
limitPriceForInput(val, intergerDigit, pointDigit, minValue, maxValue, regRule) {
var _regRule = regRule || 'priceReg'
if (val && this.reg[_regRule].test(val + '')) {
maxValue = typeof maxValue == 'string' ? parseFloat(maxValue) : maxValue
minValue = typeof minValue == 'string' ? parseFloat(minValue) : minValue
if ((val && minValue && val < minValue) || (maxValue && val > maxValue)) {
return maxValue ? maxValue : minValue ? minValue : ''
}
if (/\./.test(val)) {
val = val + ''
var interger = val.split('.')[0]
var point = val.split('.')[1]
var intergerNum = interger.length > intergerDigit ? val.split('.')[0] : interger
var pointNum = point.length > pointDigit ? point.slice(0, pointDigit) : point
val = pointDigit ? intergerNum + '.' + pointNum : val.split('.')[0]
} else {
val = val.length > intergerDigit ? val.slice(0, intergerDigit) : val
}
return val
} else {
return ''
}
},
addZero(i) {
return i < 10 ? `0${i}` : `${i}`
},
countDown() {
let lefttime = parseInt((new Date(this.editForm.activityTime[0]).getTime() - new Date().getTime()) / 1000)
let d = parseInt(lefttime / (24 * 60 * 60))
let h = parseInt((lefttime / (60 * 60)) % 24)
let m = parseInt((lefttime / 60) % 60)
let s = parseInt(lefttime % 60)
h = this.addZero(h)
m = this.addZero(m)
s = this.addZero(s)
if (this.time) clearTimeout(this.time)
this.time = setTimeout(() => {
if (d > 0) d = this.addZero(d)
this.countDownObj = {
d: d,
h: h,
m: m,
s: s
}
this.countDown()
}, 1 * 1000)
},
handleIsLimit(val) {
this.editForm.limitPurchaseNumber = val == 1 ? '' : '1'
this.editRule.limitPurchaseNumber[0].required = val != 1
},
handleRelateProChange(val) {
this.editRule.goodsId[0].required = val == 2
var idx = this.editFormData.findIndex(item => item.name == 'goodsId')
this.editFormData[idx].isHide = val != 2
},
handleRelateProClose(targetItem) {
this.selectedProInfo = this.editForm.goodsId ? { id: this.editForm.goodsId } : {}
this.handleSingleSelectClose()
},
handleSingleSelectConfirm(selectedProInfo) {
this.editForm.activityPrice = ''
this.editForm.goodsStock = ''
this.handleSingleSelectClose()
if (selectedProInfo) {
this.editForm.goodsId = selectedProInfo.id
this.getGoodInfo(selectedProInfo.id)
}
},
handleSingleSelectClose(isCancel = false) {
if (isCancel) {
this.selectedProInfo.id && this.getGoodInfo(this.selectedProInfo.id)
}
this.isSingleSelectVisible = !this.isSingleSelectVisible
},
getGoodInfo(id) {
this.$apis.proManage.getProInfoApi({ id: id }).then(res => {
this.selectedProInfo = this.$common.utils.deepClone(res)
if (this.selectedProInfo.specificationDetailList.length) {
this.changeFormAttr('editFormData', 'isHide', ['规格明细'], false)
this.specificationDetailList = this.selectedProInfo.specificationList
this.recoverySpec()
} else {
this.changeFormAttr('editFormData', 'isHide', ['规格明细'], true)
this.nameToValSpecsList = []
this.specificationDetailList = []
}
})
},
// 规格值解构
changeSpecs(isRecovery) {
this.specsWidth = 100 / (this.specificationDetailList.length + 4) + '%'
this.nameToValSpecsList = []
var markIdx = 0
for (var i = 0; i < this.specificationDetailList.length; i++) {
markIdx = 0
for (var j = 0; j < this.specificationDetailList[i].specificationValueList.length; j++) {
if (i == 0) {
this.nameToValSpecsList.push({
specsValueList: [this.specificationDetailList[i].specificationValueList[j].specificationValue],
retailPrice: '',
stock: '',
activityPrice: '',
goodsStock: ''
})
} else {
var targetValLen = this.specificationDetailList[i].specificationValueList.length
var loopNum = 0
var tempMarkIdx = 0
if (j == 0 && targetValLen > 1) {
var obj = JSON.parse(JSON.stringify(this.nameToValSpecsList))
this.nameToValSpecsList = []
obj.forEach((item, index) => {
for (var k = 0; k < targetValLen; k++) {
this.nameToValSpecsList.push(JSON.parse(JSON.stringify(item)))
}
})
}
loopNum = this.nameToValSpecsList.length / targetValLen
tempMarkIdx = markIdx
for (var k = 0; k < loopNum; k++) {
this.nameToValSpecsList[tempMarkIdx].specsValueList.push(this.specificationDetailList[i].specificationValueList[j].specificationValue)
tempMarkIdx = tempMarkIdx + targetValLen
}
markIdx = markIdx + 1
}
}
}
if (isRecovery) {
this.nameToValSpecsList.forEach((item, index) => {
var specificationObj = {}
item.specsValueList.forEach((subItem, subIndex) => {
specificationObj[this.specificationDetailList[subIndex].specificationName] = subItem
})
item.specificationData = this.setLocaleCompare(specificationObj)
for (var i = 0; i < this.selectedProInfo.specificationDetailList.length; i++) {
var temp = this.selectedProInfo.specificationDetailList[i]
if (temp.specificationData == item.specificationData) {
item.retailPrice = (temp.retailPrice / 100).toFixed(2)
item.stock = temp.stock
item.specificationKey = temp.specificationKey
break
}
}
if (this.activityInfo && this.activityInfo.specificationDetailWithGoodsList) {
for (var k = 0; k < this.activityInfo.specificationDetailWithGoodsList.length; k++) {
var templ = this.activityInfo.specificationDetailWithGoodsList[k]
if (templ.specificationData == item.specificationData) {
item.activityPrice = (templ.retailPrice / 100).toFixed(2)
item.goodsStock = templ.stock
break
}
}
}
})
}
// console.log(this.nameToValSpecsList)
},
setLocaleCompare(params) {
let keys = []
let obj = []
Object.keys(params).forEach(item => {
keys.push(item)
})
keys.sort()
keys.forEach(item => {
obj.push([item, params[item]])
})
return obj.join('&').replace(/,/g, '-')
},
// 恢复规格值
recoverySpec() {
this.changeSpecs(true)
},
//规格-秒杀价输入控制
activityPrice_input(val, maxValue) {
return this.limitPriceForInput(val, 5, 2, 0, maxValue)
},
//规格-活动库存输入控制
goodsStock_input(val, maxValue) {
return this.limitPriceForInput(val, 5, 0, 0, maxValue)
},
// 音乐
handleMusicUpload() { },
musicUpload(e, targetItem) {
var reader = new FileReader()
var file = e.raw
// 默认1MB
const limitSize = targetItem.limitSize
const isLt = file.size / 1024 / 1024 < limitSize
const isType = ['audio/mp3', 'audio/m4a']
if (!isType) {
this.$message.error('上传文件不是jpg、jpeg或png的格式!')
return true
}
if (!isLt) {
this.$message.error('上传的文件大小不能超过' + limitSize + 'MB!')
return true
}
reader.readAsDataURL(file)
reader.onload = e => {
const imgFile = e.target.result
const base64 = file.name.split('.')[file.name.split('.').length - 1] + '@' + imgFile.split(',')[1]
this.$apis.common.uploadMusicApi({ file: base64 }).then(res => {
this.$set(this.editForm, targetItem.name, res)
})
}
},
handleMusicChange(file, targetItem) {
this.musicUpload(file, targetItem)
},
handleMusicDelete(targetItem) {
this.$set(this.editForm, targetItem.name, '')
},
// 表单设置
handleDescribeAdd() {
this.formDescribeList.push({
value: ''
})
},
handleDescribeDelete(idx) {
this.$messageBox.confirm('是否删除该表单设置?', '删除', {
confirmButtonText: '确定',
cancelButtonText: '取消',
callback: action => {
if (action == 'confirm') {
this.formDescribeList.splice(idx, 1)
}
}
})
},
getInfo() {
this.$apis.seckillActivity.getActivityDetailApi({ id: this.routeInfo.id }).then(res => {
var info = res
this.editForm = this.$common.utils.deepClone(res)
this.activityInfo = info
this.$set(this.editForm, 'activityTime', [info.startTime, info.endTime])
this.getGoodInfo(info.goodsId)
if (info.activityPrice != null && info.goodsStock != null) {
this.editForm.activityPrice = (info.activityPrice / 100).toFixed(2)
this.editForm.goodsStock = info.goodsStock + ''
}
// 地图
if (info.activityAddressProvinceName || info.activityAddressCityName) {
this.$refs.configEditFormRef.$refs.provinceForm[0].init(info.activityAddressProvinceName, info.activityAddressCityName)
}
// 活动视频
if (info.activityVideos && info.activityVideos.length) {
this.editForm.activityVideos = info.activityVideos.map(item => item.activityVideo)
}
// 活动详情
if (info.activityDetail) {
this.editForm.activityDetail = decodeURIComponent(info.activityDetail)
this.$refs.configEditFormRef.$refs.activityDetailTextBox[0].setEdit(this.editForm.activityDetail)
}
// 表单设置
this.formDescribeList = []
Object.values(this.describeIdxToAttr).forEach((item, index) => {
if (this.editForm['formDescribe' + item]) {
this.formDescribeList.push({ value: this.editForm['formDescribe' + this.describeIdxToAttr[index]] })
}
})
if (!this.formDescribeList.length) {
this.formDescribeList = [{ value: '' }]
}
this.$nextTick(() => {
this.editStatus = false
})
})
},
validateRules() {
if (this.specificationDetailList.length) {
this.editRule.activityPrice[0].required = false
this.editRule.goodsStock[0].required = false
} else {
this.editRule.activityPrice[0].required = true
this.editRule.goodsStock[0].required = true
}
},
getCouponInfoParams() {
var _this = this
var param = this.$common.utils.deepClone(this.editForm)
param.marketingType = 3
param.activityPrice = (param.activityPrice * 100).toFixed(0) //存的分,需乘100
if (this.routeInfo.id) {
param.id = this.routeInfo.id
}
const d = param.activityTime
if (d && d.length > 0) {
param.startTime = d[0]
param.endTime = d[1]
}
param.goodsId = this.selectedProInfo.id
if (this.nameToValSpecsList.length > 0) {
delete param.activityPrice
delete param.goodsStock
param.specificationDetailList = []
this.nameToValSpecsList.forEach(function (item) {
var obj = {
retailPrice: (item.activityPrice * 100).toFixed(0), //存的分,需乘100
stock: item.goodsStock,
specificationData: item.specificationData,
specificationKey: item.specificationKey
}
if (_this.routeInfo.id) {
obj.activityId = _this.routeInfo.id
}
param.specificationDetailList.push(obj)
})
}
// 活动详情
if (this.editForm.activityDetail) {
param.activityDetail = encodeURIComponent(this.editForm.activityDetail)
}
// 表单设置
Object.values(this.describeIdxToAttr).forEach((item, idx) => {
param['formDescribe' + item] = this.formDescribeList.length > idx ? this.formDescribeList[idx].value : ''
})
return param
},
// 跳转
whereToGo(id) {
document.getElementById(id).scrollIntoView()
},
checkValid(validList) {
for (let i = 0; i < validList.length; i++) {
let item = validList[i]
if (item.valid) {
this.whereToGo(Object.keys(item.errorObj)[0])
return false
}
}
return true
},
addOrUpdate() {
var params = this.getCouponInfoParams()
this.$apis.seckillActivity.addOrUpdateActivityApi(params).then(res => {
this.$message({
message: res.code == '0' ? '操作成功' : res.message ? res.message : '操作失败',
type: res.code == '0' ? 'success' : 'error'
})
if (res.code == '0') {
this.cancelJump()
}
})
},
handleConfirm() {
this.validateRules()
var flag = true
if (this.nameToValSpecsList && this.nameToValSpecsList.length > 0) {
var list = this.nameToValSpecsList
for (var key = 0; key < list.length; key++) {
var item = list[key]
if (!item.activityPrice) {
this.$message({
message: '有未设置秒杀价的项',
type: 'error'
})
flag = false
break
}
if (!item.goodsStock) {
this.$message({
message: '有未设置活动库存的项',
type: 'error'
})
flag = false
break
}
}
}
let validList = []
this.$refs.editFormRef.$refs[this.editChildRef].validate((valid, errorObj) => {
validList = [
{ valid: !valid, errorObj: errorObj },
{ valid: !flag, errorObj: { goodsId: '' } }
]
this.$refs.configEditFormRef.$refs[this.editChildRef].validate((configValid, configErrorObj) => {
validList.push({ valid: !configValid, errorObj: configErrorObj })
if (this.checkValid(validList)) {
this.addOrUpdate()
}
})
})
},
cancelJump() {
this.$router.push({
path: '/seckillActivity/crowdFundList'
})
},
handleCancel() {
if (this.editStatus) {
this.$confirm('当前有内容信息未保存,是否继续返回?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
this.cancelJump()
})
.catch(() => { })
} else {
this.cancelJump()
}
}
}
}
</script>
<style scoped lang="scss">
/* 规格 */
.edit-product-dh .spesc-label {
padding: 1px 10px;
box-sizing: border-box;
width: 110px;
color: #666;
text-align: right;
padding-right: 12px;
}
.edit-product-dh .table-spesc {
width: 100%;
text-align: center;
margin-bottom: 0;
}
.edit-product-dh .table-spesc tbody tr {
border: 1px solid #e7e7e7;
}
.edit-product-dh .table-spesc tbody td {
display: inline-block;
box-sizing: border-box;
width: 20%;
border: none;
padding: 2px 6px;
vertical-align: center;
text-align: center;
}
.edit-product-dh .table-spesc .el-input--small .el-input__inner {
text-align: center !important;
}
.edit-product-dh .w-320 {
width: 320px;
}
/* 规格 */
.edit-activity {
position: relative;
}
.edit-activity .edit-container {
min-height: 680px;
}
.edit-activity .wechat-box {
width: 276px;
box-sizing: border-box;
position: absolute;
top: 100px;
right: 20px;
}
.edit-activity .wechat-box .wechat-inner-box {
position: absolute;
top: 73px;
left: 20px;
width: 236px;
height: 424px;
background-color: #f7f8fa;
overflow-y: scroll;
overflow-x: hidden;
}
.edit-activity .wechat-box .wechat-footer {
position: absolute;
width: 236px;
height: 35px;
bottom: 20px;
left: 20px;
}
.edit-activity .wechat-box .wechat-head {
position: absolute;
width: 236px;
height: 53px;
top: 20px;
left: 20px;
}
.edit-activity .wechat-box .wechat-banner-img {
width: 100%;
height: 552px;
}
.edit-activity .wechat-box .icon-server {
position: absolute;
width: 34px;
height: 42px;
top: 320px;
right: 30px;
z-index: 999;
}
.edit-activity .wechat-box .wechat-banner-img img {
width: 100%;
height: 385px;
}
.edit-activity .wechat-box .wechat-video {
width: 160px;
height: 90px;
margin: 10px auto;
}
.edit-activity .wechat-box .wechat-banner-img .icon-music {
position: absolute;
width: 20px;
height: 20px;
top: 20px;
right: 10px;
}
.edit-activity .wechat-box .wechat-banner-img .wechat-customer {
position: absolute;
width: 100px;
height: 137px;
top: 240px;
left: 10px;
}
.edit-activity .wechat-box .wechat-banner-img {
.wechat-block-title {
text-align: center;
color: #fc5b32;
}
.wechat-block {
box-sizing: border-box;
background-color: #fff;
width: 205px;
font-size: 14px;
padding: 10px;
margin: 10px 12px;
.wechat-sub-addr {
font-size: 12px;
color: #656566;
}
.wechat-time {
font-size: 12px;
color: #fc5b32;
}
.icon-addr {
width: 34px;
height: 34px;
}
.wechat-count-down {
line-height: 22px;
padding: 15px;
border: 1px dotted #e3e3e3;
}
.wechat-txt {
color: #f13c3d;
background-color: #fff4f4;
padding: 4px;
margin: 0 4px;
}
}
}
.edit-activity .wechat-box .wechat-banner-img .crowd-jdt {
width: 205px;
height: 80px;
margin-bottom: 6px;
}
.edit-activity .wechat-box .wechat-name {
position: absolute;
top: 50px;
left: 58px;
width: 138px;
color: #282829;
z-index: 99;
text-align: center;
}
/* .edit-activity .wechat-box .wechat-limit-num {
position: absolute;
bottom: 93px;
left: 160px;
font-size: 10px;
width: 20px;
} */
.edit-activity .customer-service {
width: 656px;
padding: 20px 20px 0 20px;
background: #f9f9f9;
}
.edit-activity .fictitious {
width: 600px;
padding: 20px 20px 0 20px;
background: #f9f9f9;
}
.edit-activity .form-describe {
width: 560px;
padding: 20px;
background: #f9f9f9;
}
.edit-activity .describe-input {
width: 474px;
}
.edit-activity .describe-delete {
margin-left: 8px;
}
::-webkit-scrollbar {
/*滚动条整体样式*/
width: 6px;
height: 3px;
}
::-webkit-scrollbar-thumb {
/*滚动条里面小方块*/
border-radius: 4px;
background-color: rgba(144, 147, 153, 0.3);
}
</style>
<!-- 商品管理-门店 --> <!-- 秒杀活动 -->
<template> <template>
<div class="marketing pro-group p-t-20"> <div class="marketing p-t-20">
<div class="m-b-20"> <div class="m-b-20">
<GLButton :size="size" type="primary" class="el-icon-plus" @click="addActivity()" fn="新增秒杀活动" mode="el-button">新增秒杀活动</GLButton> <GLButton :size="size" type="primary" class="el-icon-plus" @click="addActivity()" fn="新增秒杀活动" mode="el-button">新增秒杀活动</GLButton>
</div> </div>
...@@ -9,12 +9,12 @@ ...@@ -9,12 +9,12 @@
<!-- 表格区域 开始 --> <!-- 表格区域 开始 -->
<GLTable ref="activity" :getListApi="getListApi" :noDataImg="url" :searchForm="tableSearchForm" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn" @setTableFinishFun="setTableFinishFun"> <GLTable ref="activity" :getListApi="getListApi" :noDataImg="url" :searchForm="tableSearchForm" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn" @setTableFinishFun="setTableFinishFun">
<template slot="activityImg" slot-scope="scope"> <div slot="activityImg" class="table-image" slot-scope="scope">
<el-popover placement="top" width="160" trigger="hover" popper-class="table-popover-block"> <el-popover placement="top" width="160" trigger="hover" popper-class="table-popover-block">
<img class="table-popover-img" :src="scope.scope.activityImg" /> <img class="table-popover-img" :src="scope.scope.activityImg" />
<img class="img-60 pointer" slot="reference" :src="scope.scope.activityImg" /> <img class="img-60 pointer" slot="reference" :src="scope.scope.activityImg" />
</el-popover> </el-popover>
</template> </div>
<div class="table-btns" slot="auth-button" slot-scope="scope"> <div class="table-btns" slot="auth-button" slot-scope="scope">
<GLTableButton :buttonList="tableButtonList" :buttonItem="scope.scope" :buttonNum="3"></GLTableButton> <GLTableButton :buttonList="tableButtonList" :buttonItem="scope.scope" :buttonNum="3"></GLTableButton>
</div> </div>
......
...@@ -785,7 +785,7 @@ export default { ...@@ -785,7 +785,7 @@ export default {
message: res.code == '0' ? '操作成功' : res.message, message: res.code == '0' ? '操作成功' : res.message,
type: res.code == '0' ? 'success' : 'error' type: res.code == '0' ? 'success' : 'error'
}) })
this.$tracker.track(Object.assign({},{pageName:'营销SOP',name:'编辑sop事件',params})) // this.$tracker.track(Object.assign({},{pageName:'营销SOP',name:'编辑sop事件',params}))
if (res.code == '0') { if (res.code == '0') {
this.cancelJump() this.cancelJump()
} }
...@@ -798,7 +798,7 @@ export default { ...@@ -798,7 +798,7 @@ export default {
message: res.code == '0' ? '操作成功' : res.message, message: res.code == '0' ? '操作成功' : res.message,
type: res.code == '0' ? 'success' : 'error' type: res.code == '0' ? 'success' : 'error'
}) })
this.$tracker.track(Object.assign({},{pageName:'营销SOP',name:'创建sop事件',params})) // this.$tracker.track(Object.assign({},{pageName:'营销SOP',name:'创建sop事件',params}))
if (res.code == '0') { if (res.code == '0') {
this.cancelJump() this.cancelJump()
} }
......
...@@ -34,7 +34,8 @@ module.exports = { ...@@ -34,7 +34,8 @@ module.exports = {
vuex: 'Vuex', vuex: 'Vuex',
axios: 'axios', axios: 'axios',
echarts: 'echarts', echarts: 'echarts',
moment: 'moment' moment: 'moment',
AMap: 'AMap'
} }
}, },
devServer: { devServer: {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!