Commit e9aef4fd by 胡悦

Merge branch 'v2.7.0' into huy_dev_v2.7.0

2 parents 9ee31c59 1f5d9c98
import { http, http_common, http2 } from '@/main'
import { http, http_common, http2, http_merchant } from '@/main'
const defaultPath = 'scrm.api.carlife.'
const getMerchantGoodsListApi = params => {
......@@ -139,4 +139,15 @@ const getStaffFollowerListApi = params => {
})
}
export default { getMerchantGoodsListApi, getGoodsListApi, uploadImgApi, uploadMusicApi, uploadVideoApi, getMerchantList, getSimpleMerchantList, getZoneListApi, getClassifyListApi, pictureUpload, querylabeltree, getCrowdTreeListApi, getStaffFollowerListApi }
// 获取商户信息
const getMerchantInfoApi = params => {
params.method = 'merchants.api.merchant.findMerchantBaseInfo'
return http_merchant({
url: '/rop-merchants/router',
method: 'POST',
data: params,
sign: true
})
}
export default { getMerchantGoodsListApi, getGoodsListApi, uploadImgApi, uploadMusicApi, uploadVideoApi, getMerchantList, getSimpleMerchantList, getZoneListApi, getClassifyListApi, pictureUpload, querylabeltree, getCrowdTreeListApi, getStaffFollowerListApi, getMerchantInfoApi }
......@@ -189,7 +189,7 @@ html {
}
.marketing .el-table .cell {
line-height: 16px;
line-height: 17px;
padding: 0 16px !important;
}
......@@ -602,6 +602,46 @@ html {
z-index: 4000 !important;
}
.dot {
display: inline-flex;
align-items: center;
div {
display: inline-block;
width: 6px;
height: 6px;
border-radius: 50%;
margin-right: 8px;
}
.normal {
background-color: #2cca74;
}
.draft {
background-color: #fdb757;
}
.dot1 {
background-color: #fdb757;
}
.dot2 {
background-color: #2cca74;
}
.dot3 {
background-color: #999999;
}
.dot4 {
background-color: #eb4e4e;
}
.dot5 {
background-color: #fdb757;
}
}
.loadingClass {
.el-icon-loading {
font-size: 22px;
......

358 Bytes | W: | H:

554 Bytes | W: | H:

src/assets/material/file.png
src/assets/material/file.png
src/assets/material/file.png
src/assets/material/file.png
  • 2-up
  • Swipe
  • Onion skin
......@@ -18,7 +18,7 @@
<div v-else-if="item.type === 'input'">
<el-input :placeholder="item.placeholder || '请输入' + item.label" v-bind="item.attrs ? item.attrs : {}" v-on="item.listeners ? item.listeners : {}" :prefix-icon="item.prefixIcon" v-model.trim="formObj[item.name]" :disabled="item.isDisabled" :maxlength="item.maxlength" :clearable="item.isClear || false" :type="item.inputType || 'text'" :rows="item.rows || 2" :style="{ width: item.width || defaultWidth }" :show-word-limit="item.showLimit || false" :show-password="item.showPass || false" @keydown.native="e => handleInputDown(e, item)">
<span v-if="item.prepend" slot="prepend">{{ item.prepend }}</span>
<span v-if="item.append" slot="append">{{ item.append }}</span>
<span v-if="item.append" slot="suffix">{{ item.append }}</span>
</el-input>
<slot :name="item.suffixSlot" :scope="item"></slot>
</div>
......@@ -76,12 +76,12 @@
<slot :name="item.suffixSlot" :scope="item"></slot>
</template>
<!-- 图文编辑器 -->
<textBox v-else-if="item.type === 'textBox'" :ref="item.name + 'TextBox'" @change="e => handleTextBoxChange(e, item)" @forbid="forbidEdit"></textBox>
<textBox v-else-if="item.type === 'textBox'" :ref="item.name + 'TextBox'" @change="e => handleTextBoxChange(e, item)" @focus="handleTextBoxFocus(item)"></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>
<el-button class="m-l-10" v-show="!item.isDisabled" @click="handleSelectMap(item)" type="primary">选择地址</el-button>
</div>
</el-form-item>
</template>
......@@ -265,6 +265,9 @@ export default {
handleTextBoxChange(val, targetItem) {
this.formObj[targetItem.name] = val
},
handleTextBoxFocus(targetItem) {
this.$refs[targetItem.name + 'TextBox'][0].setEdit(this.formObj[targetItem.name])
},
// 禁用富文本
forbidEdit() {
this.$refs.textBox.forbidEdit()
......
......@@ -82,6 +82,7 @@ export default {
this.createStyle()
// 每次光标变化的时候,保存 range
document.addEventListener('selectionchange', this.selectHandler)
this.$refs.wTextareaContent.focus()
},
beforeDestroy() {
// 卸载事件
......
......@@ -46,7 +46,7 @@
<span v-if="editForm.receiveRule == 2 && editForm.receiveWay">{{ `${editForm.receiveWay == '1' ? '手机号:' : '车架号后6位:'}${editForm.receiveDetails}` }}</span>
<span v-if="editForm.receiveRule == 1">{{ editForm.receiveWay == '1' ? '指定手机号' : '指定车架号后6位' }}:</span>
<div v-if="editForm.receiveRule == 1" class="phone-wrap">
<span :class="['phone',editForm.receiveWay==1?'realTel':'realNum']" v-for="(item, id) in receiveDetailList" :key="id">{{ item }}</span>
<span :class="['phone', editForm.receiveWay == 1 ? 'realTel' : 'realNum']" v-for="(item, id) in receiveDetailList" :key="id">{{ item }}</span>
</div>
</div>
<div slot="staffListBlock" class="sale-select" v-show="editForm.staffList && editForm.staffList.length != 0">
......@@ -261,7 +261,8 @@ export default {
handleCancel() {
this.$router.push({
path: '/giftBag/index'
path: '/giftBag/index',
query: { type: this.routeInfo.type }
})
}
}
......@@ -343,10 +344,10 @@ export default {
display: inline-block;
margin: 5px 16px 5px 0;
}
.realTel{
.realTel {
width: 120px;
}
.realNum{
.realNum {
width: 80px;
}
}
......
......@@ -499,6 +499,7 @@ export default {
.p-b-12 {
margin-bottom: 14px;
font-weight: 500;
padding-left: 10px;
color: #333333;
}
.approve-status {
......@@ -548,27 +549,31 @@ export default {
}
}
.gift-detail .gift-item {
margin-right: 80px;
display: flex;
align-items: center;
color: #333333;
img {
height: 23px;
width: 58px;
margin-right: 23px;
}
.gift-coupon-name {
display: inline-block;
}
.gift-tips {
display: inline-block;
font-size: 12px;
height: 18px;
line-height: 18px;
color: #999999;
background-color: #eeeded;
margin-right: 7px;
.gift-detail {
padding:0 200px 0 10px;
.gift-item {
margin-right: 80px;
display: flex;
align-items: center;
color: #333333;
width: 400px;
img {
height: 23px;
width: 58px;
margin-right: 10px;
}
.gift-coupon-name {
display: inline-block;
}
.gift-tips {
display: inline-block;
font-size: 12px;
height: 18px;
line-height: 18px;
color: #999999;
background-color: #eeeded;
margin-right: 7px;
}
}
}
.gift-detail .gift-item:last-child {
......
......@@ -28,13 +28,16 @@ export default {
receivedGiftList
},
created() {
this.activeName = sessionStorage.getItem('GIFTNAME') ? sessionStorage.getItem('GIFTNAME') : 'giftList'
// this.activeName = sessionStorage.getItem('GIFTNAME') ? sessionStorage.getItem('GIFTNAME') : 'giftList'
if (this.$route.query.type == 'received') {
this.activeName = 'receivedGiftList'
}
},
mounted() {},
methods: {
handleTabClick() {
sessionStorage.setItem('GIFTNAME', this.activeName)
this.$router.push({ path: this.$route.path, query: { type: this.activeName == 'receivedGiftList' ? 'received' : 'gift' } })
}
}
}
......
......@@ -22,14 +22,18 @@
<!-- 表格区域 开始 -->
<GLTable ref="receivedGiftListRef" :getListApi="getListApi" :hasNum="false" :noDataImg="url" :searchForm="tableSearchForm" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn" @setTableFinishFun="setTableFinishFun">
<span slot="directionalGiftName" slot-scope="scope">
<el-button type="text" @click="handleDetail(scope.scope)">{{ scope.scope.directionalGiftName }}</el-button>
<el-tooltip effect="dark" :content="scope.scope.directionalGiftName" placement="top-start">
<p class="gift-name" @click="handleDetail(scope.scope)">
{{ scope.scope.directionalGiftName }}
</p>
</el-tooltip>
<span v-if="scope.scope.receiveStatus == 2" class="void-label">已作废</span>
<el-tooltip class="item" effect="dark" :content="scope.scope.cancelReason" placement="top-start">
<el-tooltip effect="dark" :content="scope.scope.cancelReason" placement="top-start">
<p class="void-reason" v-if="scope.scope.receiveStatus == 2">作废原因:{{ scope.scope.cancelReason || '--' }}</p>
</el-tooltip>
</span>
<div slot="giftInfo" slot-scope="scope">
<GLTable ref="giftListRef" :hasNum="false" :hasPage="false" :noDataImg="url" :tableParams="giftParams" :tableData="scope.scope | filterTable" @setTableFinishFun="setGiftTableFinishFun"></GLTable>
<GLTable class="secondTable" ref="giftListRef" :hasNum="false" :hasPage="false" :noDataImg="url" :tableParams="giftParams" :tableData="scope.scope | filterTable" @setTableFinishFun="setGiftTableFinishFun"></GLTable>
</div>
<div class="table-btns" slot="auth-button" slot-scope="scope">
<el-button :disabled="scope.scope.receiveStatus == 2" type="text" @click="handleCancel(scope.scope)">作废</el-button>
......@@ -196,12 +200,13 @@ export default {
tableColumns: [
{
label: '礼包明细',
prop: 'couponName'
prop: 'couponName',
width: 200
},
{
label: '数量',
name: 'couponAmount',
width: '100px',
width: 150,
formatter: cellValue => {
return 'X' + cellValue.couponAmount
}
......@@ -209,6 +214,7 @@ export default {
{
label: '已核销/次',
prop: 'anticipatedCost ',
width: 150,
formatter: cellValue => {
return 'X' + cellValue.delet
}
......@@ -216,6 +222,7 @@ export default {
{
label: '可使用/次',
prop: 'getAmount',
width: 150,
formatter: cellValue => {
if (cellValue.residueCouponAmount == -1) {
return '不限次数'
......@@ -369,7 +376,8 @@ export default {
this.$router.push({
path: '/giftBag/giftDetail',
query: {
id: row.directionalGiftId
id: row.directionalGiftId,
type: 'received'
}
})
},
......@@ -513,6 +521,18 @@ export default {
.marketing /deep/ .el-table th div {
line-height: normal !important;
}
.secondTable {
padding-left: 10px;
}
.gift-name {
color: #5850ff;
margin: 0;
cursor: pointer;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
word-break: break-all;
}
.void-label {
width: 44px;
height: 18px;
......@@ -523,7 +543,7 @@ export default {
text-align: center;
line-height: 18px;
background: #eeeded;
margin-left: 4px;
margin-top: 2px;
}
.void-reason {
font-size: 10px;
......
......@@ -5,12 +5,12 @@
<h4>{{ title }}</h4>
<el-divider></el-divider>
<div class="form-item-container">
<el-form-item v-if="routeInfo.addOrEdit == 1" label="选择素材组:" prop="selectMaterialGroup">
<el-form-item v-if="routeInfo.addOrEdit == 1" label="选择素材组:" prop="groupId">
<el-select v-model="materialAddForm.groupId" placeholder="全部" :size="size">
<el-option v-for="item in groupCounter" :key="item.id" :label="item.materialGroupName" :value="item.id"></el-option>
</el-select>
</el-form-item>
<el-form-item v-else label="选择素材组:">
<el-form-item v-else label="选择素材组:" prop="selectMaterialGroupName">
<el-select v-model="materialAddForm.groupName" placeholder="全部" :size="size" disabled>
<el-option v-for="item in groupCounter" :key="item.id" :label="item.materialGroupName" :value="item.id"></el-option>
</el-select>
......@@ -237,7 +237,7 @@ export default {
// phoneVisible: false,
businessTypes: [],
materialAddFormRules: {
selectMaterialGroup: [{ required: true, message: '请选择素材组', trigger: 'change' }],
groupId: [{ required: true, message: '请选择素材组', trigger: 'change' }],
materialName: [
{ required: true, message: '请输入素材名称', trigger: 'change' },
{ max: 30, message: '素材名称长度不能超过30', trigger: 'blur' }
......@@ -286,9 +286,26 @@ export default {
if (this.materialAddForm.isNotifySender) {
params.isNotifySender = 0
}
if (params.materialType == 1) {
if (this.materialAddForm.materialType == 1) {
params.materialUrl = this.pdfUrl
} else if (params.materialType == 3) {
} else if (this.materialAddForm.materialType == 3) {
let html = this.textBoxContent
let imgHtml = html.match(/<img.*?(?:>|\/>)/g)
let videoHtml = html.match(/<video.*?(?:>|\/>)/g)
if (imgHtml) {
for (let i = 0; i < imgHtml.length; i++) {
html = html.replace(imgHtml[i], '')
}
}
if (videoHtml) {
for (let i = 0; i < videoHtml.length; i++) {
html = html.replace(videoHtml[i], '')
}
}
html = html.replace(/<[^>]+>/g, '')
if (videoHtml && videoHtml.length && !imgHtml && !html.length) params.materialType = 4
if (!imgHtml && !videoHtml) params.materialType = 5
if (imgHtml && imgHtml.length && !videoHtml && !html.length) params.materialType = 6
this.textBoxContent = encodeURIComponent(this.textBoxContent)
params.materialUrl = this.textBoxContent
}
......@@ -303,19 +320,20 @@ export default {
}
this.$apis.material.materialDetail(params).then(res => {
this.materialAddForm = res
if (this.materialAddForm.businessType) {
if (res.businessType) {
const businessTypeArr = this.materialAddForm.businessType.split(',')
this.materialAddForm.businessType = businessTypeArr.map(item => parseInt(item))
} else {
this.materialAddForm.businessType = []
}
if (this.materialAddForm.materialType == 3) {
if (res.materialType == 3 || res.materialType == 4 || res.materialType == 5 || res.materialType == 6) {
this.materialAddForm.materialType = 3
this.materialAddForm.materialUrl = decodeURIComponent(this.materialAddForm.materialUrl)
this.$refs.textBox.setEdit(this.materialAddForm.materialUrl)
} else if (this.materialAddForm.materialType == 1) {
} else if (res.materialType == 1) {
this.pdfUrl = this.materialAddForm.materialUrl
}
if (this.materialAddForm.tagJson) {
if (res.tagJson) {
const tagging = eval(this.materialAddForm.tagJson)
// let arr = []
this.tagging = tagging.map(item => {
......@@ -446,7 +464,7 @@ export default {
var params = this.getParams()
if (!params.materialUrl) {
this.$message({
message: '素材类型不能为空',
message: '素材内容不能为空',
type: 'warning'
})
return
......@@ -479,41 +497,16 @@ export default {
handleSubmit() {
this.$refs.materialAddForm.validate(valid => {
if (valid) {
// let tagging = this.tagging.map(item => {
// let tagIds = item.labelList.map(tag => {
// return tag.id
// })
// let name = item.labelList.map(tag => {
// return tag.name
// })
// return {
// groupId: item.labelGroup.id,
// tagIds: tagIds.join(','),
// name: name.join(','),
// labelType: item.labelGroup.name
// }
// })
var params = this.getParams()
if (!params.materialUrl) {
this.$message({
message: '素材类型不能为空',
message: '素材内容不能为空',
type: 'warning'
})
return
}
// status 状态 0 启用 -1 禁用 1 存草稿
params.status = 0
// params.isNotifySender = -1
// params.tagJson = JSON.stringify(tagging)
// if (this.materialAddForm.isNotifySender) {
// params.isNotifySender = 0
// }
// if (params.materialType == 1) {
// params.materialUrl = this.pdfUrl
// } else if (params.materialType == 3) {
// this.textBoxContent = encodeURIComponent(this.textBoxContent)
// params.materialUrl = this.textBoxContent
// }
let material
if (params.id) {
material = 'materialEdit'
......
......@@ -12,17 +12,26 @@
</div>
</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)">
<img src="@/assets/material/file.png" alt="" style="vertical-align: middle" />
<div class="group-name">{{ item.materialGroupName }}</div>
<el-popover placement="right" trigger="hover">
<div>
<GLButton class="group-btn" :size="size" type="text" fn="置顶" @click="handleStick(item)">{{ item.orderTime ? '取消置顶' : '置顶' }}</GLButton>
<GLButton class="group-btn" :size="size" type="text" fn="修改" @click="handleAddGroup(2, item)">修改</GLButton>
<GLButton class="group-btn" :size="size" type="text" fn="删除" v-if="item.isDefault == -1" @click="handleDeleteGroup(item.id)">删除</GLButton>
</div>
<i slot="reference" class="el-icon-more"></i>
</el-popover>
<li class="group-list" v-for="(item, index) in groupCounter" :class="index === currentIndex ? 'active' : ''" :key="index" @click="handleGroup(item, index)">
<div>
<img src="@/assets/material/file.png" alt="" style="vertical-align: middle;height:24px;width:24px" />
<div class="group-name">{{ item.materialGroupName }}</div>
</div>
<div>
<el-popover placement="right" trigger="hover">
<div>
<GLButton class="group-btn" :size="size" type="text" fn="置顶" @click="handleStick(item)">{{ item.orderTime ? '取消置顶' : '置顶' }}</GLButton>
<GLButton class="group-btn" :size="size" type="text" fn="修改" @click="handleAddGroup(2, item)">修改</GLButton>
<GLButton class="group-btn" :size="size" type="text" fn="删除" v-if="item.isDefault == -1" @click="handleDeleteGroup(item.id)">删除</GLButton>
<!-- <el-button class="group-btn" :size="size" type="text" fn="置顶" @click="handleStick(item)">{{ item.orderTime ? '取消置顶' : '置顶' }}</el-button>
<el-button class="group-btn" :size="size" type="text" fn="修改" @click="handleAddGroup(2, item)">修改</el-button>
<el-button class="group-btn" :size="size" type="text" fn="删除" v-if="item.isDefault == -1" @click="handleDeleteGroup(item.id)">删除</el-button> -->
</div>
<div slot="reference">
<img class="more-icon" src="@/assets/material/more.png" alt="" />
</div>
</el-popover>
</div>
</li>
</ul>
</div>
......@@ -169,6 +178,9 @@ export default {
</script>
<style lang="scss" scoped>
.status-words {
margin-left: 5px;
}
.el-popover {
min-width: 50px;
max-width: 150px;
......@@ -196,19 +208,18 @@ export default {
}
ul {
overflow: auto;
li {
.group-list {
cursor: pointer;
text-align: left;
padding: 8px 16px 8px 18px;
padding: 8px 8px 8px 18px;
display: flex;
justify-content: space-between;
&.active {
background-color: #ebeaff;
}
i {
font-size: 16px;
padding-top: 6px;
position: absolute;
right: 0px;
transform: rotate(90deg);
.more-icon {
vertical-align: middle;
padding-top: 3px;
}
}
}
......
......@@ -33,8 +33,11 @@ export default {
this.content = html // 绑定当前逐渐地值
this.$emit('change', this.content) // 将内容同步到父组件中
}
this.editor.config.onfocus = () => {
this.$emit('focus')
}
// 上传图片
this.editor.config.customUploadImg = function(resultFiles, insertImgFn) {
this.editor.config.customUploadImg = function (resultFiles, insertImgFn) {
var file = resultFiles[0]
var reader = new FileReader()
// 默认1MB
......@@ -60,7 +63,7 @@ export default {
}
}
// 上传视频
this.editor.config.customUploadVideo = function(resultFiles, insertVideoFn) {
this.editor.config.customUploadVideo = function (resultFiles, insertVideoFn) {
var file = resultFiles[0]
var reader = new FileReader()
// 默认1MB
......
<template>
<div>
<el-dialog :visible.sync="dialogVisibleImg" width="50%" :before-close="videoClose">
<div class="image-dialog">
<video width="100%" controls :src="dialogSrc" id="video1" @click="playVideo"></video>
<img @click="playVideoImg" v-show="paused" src="@/assets/material/video1.png" alt="" />
<img @click="playVideoImg" v-show="!paused" src="@/assets/material/video2.png" alt="" />
</div>
</el-dialog>
</div>
</template>
<script>
export default {
name: 'videoShowDia',
data() {
return {
dialogVisibleImg: false,
dialogSrc: '',
paused: false,
myVideo: ''
}
},
methods: {
init(src) {
this.dialogVisibleImg = true
this.dialogSrc = src
setTimeout(() => {
this.myVideo = document.getElementById('video1')
this.paused = this.myVideo.paused ? true : false
})
},
videoClose() {
this.myVideo.pause()
this.myVideo.muted = false
this.dialogVisibleImg = false
},
playVideo() {
var myVideo = document.getElementById('video1')
this.paused = !myVideo.paused
this.paused ? myVideo.play() : myVideo.pause()
},
playVideoImg() {
this.paused = !this.paused
console.log(this.paused)
this.paused ? this.myVideo.pause() : this.myVideo.play()
}
}
}
</script>
<style lang="scss" scoped>
/deep/ .el-dialog__header {
background-color: black;
}
/deep/ .el-dialog__body {
padding: 0;
}
/deep/ .el-dialog {
position: relative;
}
.image-dialog {
position: absolute;
width: 100%;
img {
width: 170px;
position: absolute;
top: 35%;
left: 40%;
}
}
</style>
......@@ -9,11 +9,11 @@
</div>
<span @click="showIntroductionDialog" class="introduc-word">
功能介绍
<i class="el-icon-arrow-right"></i>
<!-- <i class="el-icon-arrow-right"></i> -->
</span>
<div class="container">
<div class="search-form">
<GLCombiForm ref="showSearch" :rowNumber="1" :formObj="searchForm" :formData="materialFormData" @handleOk="getListApi" @handleRest="handleReset"></GLCombiForm>
<GLCombiForm ref="showSearch" :rowNumber="2" :formObj="searchForm" :formData="materialFormData" @handleOk="getListApi" @handleRest="handleReset"></GLCombiForm>
</div>
<div class="tabelList">
<el-row>
......@@ -24,7 +24,7 @@
</el-col>
<el-col :span="19">
<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">
<!-- 素材内容 -->
<div slot="materialContentRpcResponse" slot-scope="scope" style="text-align: center">
......@@ -38,7 +38,7 @@
<!-- 素材为自定义链接 -->
<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 || scope.scope.materialType == 4 || scope.scope.materialType == 5 || scope.scope.materialType == 6" class="material-content">
<!-- 图片 -->
<el-popover placement="top" trigger="hover" v-if="scope.scope.urlType == 'img'">
<div>
......@@ -53,40 +53,34 @@
</div>
</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 class="urlContent" v-if="scope.scope.urlType == 'video'" @click="videoOpen(scope.scope)">
<video preload loop muted 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>
</el-popover>
</div>
<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>
</div>
<!-- 状态 -->
<div slot="status" slot-scope="scope">
<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 style="margin-left: 5px;" v-if="scope.scope.status == 0">启用</span>
<span style="margin-left: 5px;" v-else>停用</span>
<!-- <span v-if="scope.scope.status == 1">存草稿</span> -->
<div slot="status" class="dot" slot-scope="scope">
<div :class="materialStatus[scope.scope.status]"></div>
<span v-if="scope.scope.status == 0">启用</span>
<span v-if="scope.scope.status == -1">停用</span>
<span v-if="scope.scope.status == 1">草稿</span>
</div>
<!-- 类型 -->
<div slot="materialType" slot-scope="scope">
<span v-if="scope.scope.materialType == 1">pdf文件</span>
<span v-if="scope.scope.materialType == 2">自定义链接</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>
<span v-if="scope.scope.materialType == 3">图文</span>
<span v-if="scope.scope.materialType == 4">视频</span>
<span v-if="scope.scope.materialType == 5">纯文字</span>
<span v-if="scope.scope.materialType == 6">纯图片</span>
</div>
<span slot="auth-button" slot-scope="scope">
<GLTableButton :buttonList="tableButtonList" :buttonItem="scope.scope" :buttonNum="3"></GLTableButton>
......@@ -99,27 +93,36 @@
</div>
<AddMaterialGroupDia :businessTypes="businessTypes" ref="addMaterialGroup" :dialogVisible="materialGroupDialog" :eventBus="eventBus"></AddMaterialGroupDia>
<FunctionIntroduc :introductionDialog="introductionDialog" @closeIntroductDia="closeIntroductDia"></FunctionIntroduc>
<VideoShowDia ref="VideoShowDia" :dialogVisible="dialogVisibleImg"></VideoShowDia>
</div>
</template>
<script>
const iconUrl =
'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAYAAAFoTx1HAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAADqADAAQAAAABAAAADgAAAAC98Dn6AAAB7klEQVQoFVVSQUhUURQ9981sVFyYRRHuFFq1CGlZC3etnBlMRhMXQwhtCqIQJBA3gSSi1EpkNqkjCjOjm1YWuGojBVO7Fi0K2qQLF6H453bO+/ODLvz37z333PvOu+8BtImCf0K56J8VYKLoC9HRMlnwRxaRgB0kOHDDz5gl/0hZBaaFwGl3H65j577nygV/ITCM71pinRo1GiF4zm8jqzkr5dEtluiTJZ9zx8fYTEBmbP5D/tSY3wnaRUwB0rbdsAH5SYK3sW2l4r1/jnFIsUMElmsNmxdB7JGsUnGUWvQz+XkHXtXqNsxx/KL/Zg+oS5xxi8A2T8SqNe0az3NANyfVJD4N5ripZDTDrc1da8kn/i1QxGya4eq4Kl8aui7hblRLUd/JXCSxxXarBJ9T8fuYFLsztiqTv4NjXUTh2rZteEhiP8OKiiIez3+CFoWubdXtpUDe1XAbmJEfQLxpRxFPRz7T1ccz6BFkl6okRzHFOJ5ccbnkr8l5LF8mrl5Pnv5gJksJjmlD/wclv9121ClxeqthH4TJQh5fLhIMaa7LOrRuIk2la89lfO29ghuU/69IHBatqIZfOhgWv2OXhUIOi/FCnDpoZuYqaCaYpYJ5gvf+m6pInUE9Y5NRhoPCdGl80fscyFK1aqfCZH8B0rPa9foo7e4AAAAASUVORK5CYII='
const materialStatus = {
'0': 'normal',
'1': 'draft',
'-1': 'dot3'
}
import Vue from 'vue'
import url from '@/assets/empty.png'
import iconUrl from '@/assets/icon-circle-question.png'
import AddMaterialGroupDia from '@/views/material/components/addMaterialGroupDia'
import MaterialGroup from '@/views/material/components/materialGroup'
import FunctionIntroduc from '@/views/material/components/functionIntroduc'
import VideoShowDia from './components/videoDia.vue'
export default {
name: 'materialList',
components: {
AddMaterialGroupDia,
MaterialGroup,
FunctionIntroduc
FunctionIntroduc,
VideoShowDia
},
data() {
return {
dialogVisibleImg: false, // 视频弹框
url,
materialStatus: materialStatus,
eventBus: new Vue(),
searchForm: {
groupId: '', // 素材组id
......@@ -175,6 +178,18 @@ export default {
{
optionId: 3,
optionLabel: '图文'
},
{
optionId: 4,
optionLabel: '视频'
},
{
optionId: 5,
optionLabel: '纯文字'
},
{
optionId: 6,
optionLabel: '纯图片'
}
],
optionId: 'optionId',
......@@ -197,7 +212,7 @@ export default {
},
{
optionId: -1,
optionLabel: '禁用'
optionLabel: '停用'
},
{
optionId: 1,
......@@ -241,6 +256,19 @@ export default {
},
{
type: 'GLButton',
name: row => {
return row.status == 0 ? '禁用' : '启用'
},
attrs: {
type: 'text',
fn: '禁用'
},
listeners: {
click: this.handleForbid
}
},
{
type: 'GLButton',
name: '删除',
attrs: {
type: 'text',
......@@ -306,9 +334,8 @@ export default {
[
h('img', {
style: {
width: '14px',
height: '14px',
'margin-left': '4px',
width: '17px',
height: '17px',
'vertical-align': 'middle'
},
attrs: {
......@@ -355,9 +382,8 @@ export default {
[
h('img', {
style: {
width: '14px',
height: '14px',
'margin-left': '4px',
width: '17px',
height: '17px',
'vertical-align': 'middle'
},
attrs: {
......@@ -406,6 +432,13 @@ export default {
}
},
videoOpen(scope) {
console.log(scope)
this.dialogVisibleImg = true
let dialogSrc = scope.materialContentRpcResponse.materialUrl
this.$refs.VideoShowDia.init(dialogSrc)
},
// 重置
handleReset() {
this.searchForm = {
......@@ -466,29 +499,20 @@ export default {
})
},
// 素材禁用&启用
handleForbid(e, scope) {
handleForbid(scope) {
var params = {}
params.id = scope.id
params.status = e == 0 ? 0 : 1
this.$apis.material.materialEdit(params).then(res => {
console.log(res)
res.code == 0 ? this.getListApi() : ''
this.$message({
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)
// }
if (scope.status == 0) {
params.status = -1
this.secondConfirm('提示', '禁用素材,确定禁用此素材?', 'material', 'materialEdit', params)
} else {
params.status = 0
this.secondConfirm('提示', '启用素材,确定启用此素材?', 'material', 'materialEdit', params)
}
},
// 素材删除
handleDelete(scope) {
this.secondConfirm('提示', '删除素材,所有已经发送给客户的素材链接均会失效,是否继续删除?', 'material', 'materialDelete', { id: scope.id })
this.secondConfirm('提示', '删除素材,该素材将不再可以使用,是否继续删除?', 'material', 'materialDelete', { id: scope.id })
},
// 1-新增素材,2-编辑素材
addMaterial(addOrEdit, scope) {
......@@ -513,11 +537,8 @@ export default {
let data = res
let tableData = []
data.forEach(item => {
// 根据素材类型是图文还是pdf处理数据
if (item.materialType != 3) {
item.materialContentRpcResponse.materialUrl = ''
}
if (item.materialType == 3) {
// 根据素材类型是图文处理数据
if (item.materialType == 3 || item.materialType == 4 || item.materialType == 5 || item.materialType == 6) {
let html = decodeURIComponent(item.materialContentRpcResponse.materialUrl)
let imgHtml = html.match(/<img.*?(?:>|\/>)/g)
let videoHtml = html.match(/<video.*?(?:>|\/>)/g)
......@@ -698,6 +719,7 @@ ul {
height: 200px;
}
.introduc-word {
font-size: 14px;
margin-left: 16px;
color: #5850ff;
}
......
......@@ -216,12 +216,13 @@ export default {
params.flag = 0
this.$apis.material.materialDetail(params).then(res => {
this.detailInfo = res
if (this.detailInfo.tagJson) {
if (res.tagJson) {
this.detailInfo.tagJson = eval(this.detailInfo.tagJson)
} else {
this.detailInfo.tagJson = []
}
if (this.detailInfo.materialType == 3) {
if (res.materialType == 3 || res.materialType == 4 || res.materialType == 5 || res.materialType == 6) {
this.detailInfo.materialType = 3
this.detailInfo.materialUrl = decodeURIComponent(this.detailInfo.materialUrl)
let html = this.detailInfo.materialUrl
let imgHtml = html.match(/<img.*?(?:>|\/>)/g)
......
......@@ -70,10 +70,10 @@
</div>
<glsx-dialog class="refund-fill-boxss" :width="'576px'" title="提示" :show-close="true" :isVisible="isShow" @confirmDialog="isShow = false" @closeDialog="isShow = false" :noCancel="true">
<div class="dialog-refund">
<img class="img" src="../../images/warn.png" />
<div>该会员在升级黑卡会员期间,已购买过生活权益</div>
<div style="color: #FF4D4F;padding: 6px 0;">(时间:{{orderDate}} 金额:{{orderPrice}}元)</div>
<div>暂不支持退款</div>
<img class="img" src="../../images/warn.png" />
<div>该会员在升级黑卡会员期间,已购买过生活权益</div>
<div style="color: #FF4D4F;padding: 6px 0;">(时间:{{orderDate}} 金额:{{orderPrice}}元)</div>
<div>暂不支持退款</div>
</div>
</glsx-dialog>
<glsx-dialog class="refund-fill-box" :width="'720px'" title="退款确认" :isVisible="refundVisible" @confirmDialog="refundConfirmDialog" @closeDialog="refundVisible = false" :isShowCloseBtn="true">
......@@ -88,13 +88,13 @@
<script>
import { orderTypesList, orderStatusList, exportFn } from '@/common/constant'
import url from '@/assets/empty.png'
import { getOrderListApi, orderExportApi, orderRefund,ordeRefundApi } from '@/api/modules/order'
import { getOrderListApi, orderExportApi, orderRefund, ordeRefundApi } from '@/api/modules/order'
export default {
data() {
return {
isShow:false,
orderPrice:'',
orderDate:'',
isShow: false,
orderPrice: '',
orderDate: '',
orderCode: '',
refund: '',
refundVisible: false,
......@@ -151,7 +151,13 @@ export default {
name: 'merchantName',
type: 'input',
maxlength: 100
}
},
{
label: '推荐人',
name: 'shareStaffName',
type: 'input',
maxlength: 100
},
],
choseList: ['全部', '待收货', '已完成', '退款|售后'],
currentIndex: 1,
......@@ -180,7 +186,7 @@ export default {
fn: '退款'
},
condition: row => {
if(row.packageType == 2) {
if (row.packageType == 2) {
return row.refundFlag == 1 && row.show
} else {
return row.refundFlag == 1
......@@ -214,7 +220,8 @@ export default {
},
{
label: '价格/元',
prop: 'originalPrice'
prop: 'originalPrice',
width: '100'
},
{
label: '实收金额/元',
......@@ -224,7 +231,7 @@ export default {
{
label: '订单状态',
prop: 'orderStatus',
width: '80',
width: '100',
formatter: cellValue => {
return this.baseData.orderStatusList.find(item => item.confId == cellValue.orderStatus).confName
}
......@@ -283,10 +290,10 @@ export default {
this.merchantModel = this.$globalState.session.merchantModel
this.accountLevel = this.$globalState.session.accountLevel
}
if (this.$isGroupUp) {
let idx = this.tableParams.tableColumns.findIndex(item => item.label == '推荐人')
this.tableParams.tableColumns.splice(idx, 1)
}
// if (this.$isGroupUp) {
// let idx = this.tableParams.tableColumns.findIndex(item => item.label == '推荐人')
// this.tableParams.tableColumns.splice(idx, 1)
// }
},
mounted() {
this.getOptionsList('searchFormData')
......@@ -366,21 +373,21 @@ export default {
})
},
ordeRefund(orderCode) {
ordeRefundApi({orderCode}).then(res => {
if(res != null) {
this.orderDate = res.orderDate
this.orderPrice = res.orderPrice
this.isShow = true
} else {
this.refundVisible = true
}
})
ordeRefundApi({ orderCode }).then(res => {
if (res != null) {
this.orderDate = res.orderDate
this.orderPrice = res.orderPrice
this.isShow = true
} else {
this.refundVisible = true
}
})
},
handleRefund(data) {
this.orderCode = data.orderCode
this.refund = ''
// this.refundVisible = !this.refundVisible
if(data.packageType == 2) {
if (data.packageType == 2) {
this.ordeRefund(data.orderCode)
} else {
this.refundVisible = true
......@@ -433,12 +440,12 @@ export default {
//接收到的数据为空
this.$refs.memberOrderRef.data.length ? (this.$refs.memberOrderRef.tableHeightValues = '') : this.$refs.memberOrderRef.setTableHeightFun()
let arr = this.$refs.memberOrderRef.data
if(arr.length > 0) {
if (arr.length > 0) {
arr.map(e => {
if(e.refundFlag == 1 && e.packageType == 2) {
if (e.refundFlag == 1 && e.packageType == 2) {
let time = new Date(`${e.createDate}`)
let timer = new Date()
if(timer.getTime() < time.getTime() + 604800000) {
if (timer.getTime() < time.getTime() + 604800000) {
e.show = true
}
}
......@@ -532,7 +539,7 @@ export default {
padding-bottom: 12px;
}
}
::v-deep .el-dialog__footer {
::v-deep .el-dialog__footer {
text-align: center;
}
}
......
......@@ -37,6 +37,13 @@
<span :class="['table-circle', 'm-r-8', [2, 10, 22].includes(scope.scope.orderStatus) ? 'back-green' : [9].includes(scope.scope.orderStatus) ? 'back-blue' : [1, 21, 6].includes(scope.scope.orderStatus) ? 'back-orange' : 'back-grey']"></span>
<span>{{ baseData.orderStatusList.map(item => item.confId).includes(scope.scope.orderStatus + '') ? baseData.orderStatusList.find(item => item.confId == scope.scope.orderStatus).confName : '-' }}</span>
</div>
<div slot="shareStaffImageUrl" class="table-image" slot-scope="scope">
<el-popover v-if="scope.scope.shareStaffImageUrl" placement="top" width="160" trigger="hover" popper-class="table-popover-block">
<img class="table-popover-img" :src="scope.scope.shareStaffImageUrl" />
<img class="img-60 pointer" slot="reference" :src="scope.scope.shareStaffImageUrl" />
</el-popover>
<span v-else>-</span>
</div>
<div class="table-btns" slot="auth-button" slot-scope="scope">
<GLTableButton :buttonList="tableButtonList" :buttonItem="scope.scope" :buttonNum="3"></GLTableButton>
</div>
......@@ -494,6 +501,14 @@ export default {
}
},
{
label: '手机号',
prop: 'customerPhone',
width: 130,
formatter: cellValue => {
return cellValue.customerPhone || '-'
}
},
{
label: '车架号',
prop: 'vinNo',
width: 120,
......@@ -510,10 +525,15 @@ export default {
prop: 'shareStaffName',
width: '180',
formatter: cellValue => {
return cellValue.shareStaffName || '-'
return cellValue.shareStaffName ? cellValue.shareStaffName + (cellValue.shareStaffPhone ? '+' + cellValue.shareStaffPhone : '') : '-'
}
},
{
label: '头像',
prop: 'shareStaffImageUrl',
addHtml: 'shareStaffImageUrl'
},
{
label: '推荐人类型',
prop: 'shareStaffType',
width: '180',
......@@ -524,6 +544,7 @@ export default {
{
label: '支付总价',
prop: 'payPrice',
width: '120',
formatter: cellValue => {
return cellValue.payPrice || '0'
}
......
......@@ -105,7 +105,7 @@ export default {
},
{
label: '推荐人类型',
name: ''
name: 'shareStaffTypeName'
},
{
label: '车架号',
......@@ -142,7 +142,9 @@ export default {
},
{
label: '其他信息',
name: ''
name: 'formDescribe',
contentName: 'formContent',
attrList: ['First', 'Second', 'Third']
}
],
// 售后信息
......@@ -224,7 +226,6 @@ export default {
getInfo() {
this.$apis.orderManage.getOrderDetailApi({ orderCode: this.routeInfo.orderCode }).then(res => {
this.detailForm = res
console.log(this.detailForm)
this.orderRefund = res.orderRefund || null
this.detailForm.createdDateStr = dayjs(this.detailForm.createdDate).format('YYYY-MM-DD HH:mm:ss')
if (this.orderRefund) {
......@@ -232,7 +233,7 @@ export default {
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 : '-'
this.detailForm.shareStaffTypeName = 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) {
this.detailForm.subOrderCoupon.discountAmount = (this.detailForm.subOrderCoupon.discountAmount / 100).toFixed(2)
......@@ -245,6 +246,16 @@ export default {
var takeFeeIdx = this.detailFormData.findIndex(item => item.name == 'takeFee')
this.detailFormData.splice(takeFeeIdx, 1)
}
// 其他信息
var formDescribeObj = this.detailFormData.find(item => item.name == 'formDescribe')
this.detailForm[formDescribeObj.name] = ''
formDescribeObj.attrList.forEach(item => {
let label = this.detailForm[formDescribeObj.name + item]
let value = this.detailForm[formDescribeObj.contentName + item]
if (label) {
this.detailForm[formDescribeObj.name] += label + ':' + value + ' '
}
})
this.formToRow('detailFormData')
})
},
......
......@@ -99,11 +99,8 @@ export default {
},
{
label: '浏览时间',
prop: 'createdDate',
// width: '180',
formatter: cellValue => {
return dayjs(cellValue.createdDate).format('YYYY-MM-DD HH:mm:ss')
}
prop: 'lastBrowseDate',
width: '180'
}
]
}
......
......@@ -153,13 +153,10 @@ export default {
attrs: {
type: 'text'
},
condition: row => {
return row.activityStatus == '1' || row.activityStatus == '2'
},
listeners: {
click: this.handleShare
}
},
}
],
// 表格
getListApi: this.$apis.seckillActivity.getCrowdfundListApi,
......
......@@ -5,8 +5,8 @@
<p class="edit-title">{{ 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 slot="activityTimeHtml" slot-scope="scope">
<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" @change="e => handleTimeChange(e, scope.scope)"></el-date-picker>
</template>
<div slot="goodsHtml">
<el-button type="default" class="default-blue-btn el-icon-plus" v-if="apear != 'see'" @click="handleRelateProClose">选择商品</el-button>
......@@ -342,6 +342,10 @@ export default {
}
},
handleTimeChange(value, targetItem) {
!value && (this.editForm[targetItem.name] = [])
},
handleIsLimit(val) {
this.editForm.limitPurchaseNumber = val == 1 ? '' : '1'
this.editRule.limitPurchaseNumber[0].required = val != 1
......
<!-- 众筹活动 -->
<template>
<div class="edit-share marketing p-t-20 edit-box edit-activity">
<div class="edit-share marketing p-t-20 edit-box edit-activity" v-loading="loading">
<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 slot="activityTimeHtml" slot-scope="scope">
<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" @change="e => handleTimeChange(e, scope.scope)"></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>
<el-button type="default" class="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" />
......@@ -71,7 +71,7 @@
<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-group v-model="editForm[scope.scope.name]">
<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">
......@@ -79,7 +79,7 @@
</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-upload v-show="!editForm[scope.scope.name]" class="upload-demo" action="" accept="audio/mp3, audio/m4a" :show-file-list="false" :http-request="handleMusicUpload" :before-upload="e => handleMusicBeforeUpload(e, scope.scope)" :file-list="fileList" :limit="1">
<el-button class="el-icon-plus" size="small" type="default">背景音乐</el-button>
</el-upload>
<div v-if="editForm[scope.scope.name]" class="flex">
......@@ -94,21 +94,25 @@
<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-form-item id="fictitiousLadderQuantity" 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-form-item id="fictitiousViewQuantity" 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="activityVideos" class="edit-tips m-t-8">最多上传6个视频</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-input class="describe-input" v-model="item.value" placeholder="请输入" maxlength="20">
<el-button v-show="index == formDescribeList.length - 1 && formDescribeList.length < describeNum" slot="suffix" :size="size" type="text" @click="handleDescribeAdd">
<span class="describe-plus">+</span>
</el-button>
</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>
<!-- <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>
......@@ -121,7 +125,7 @@
<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 :src="editForm.activityBigImg || 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>
......@@ -134,22 +138,23 @@
<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>
<p class="wechat-time" v-if="editForm.activityTime && 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>
<p class="wechat-block-title">{{ countDownObj.typeTxt }}</p>
<p v-if="countDownObj.activityStatus != 3" class="wechat-count-down">
<span v-if="editForm.activityTime && 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>
<img v-else class="count-down-img" src="@/assets/seckillActivity/count-down.png" />
</div>
<div class="w-100-percent txt-center">
<img class="crowd-jdt" src="@/assets/seckillActivity/crowd-jdt.png" />
......@@ -174,11 +179,20 @@ import { limitPrice } from '@/common/constant'
export default {
name: 'editActivity',
data() {
var validatorPhone = function (rule, value, callback) {
if (value && !/^(0|86|17951)?(13[0-9]|15[0123456789]|17[678]|18[0-9]|14[57])[0-9]{8}$/.test(value)) {
callback(new Error('手机号格式错误'))
} else {
callback()
}
}
return {
size: 'small',
footerLeft: '0',
footerWidth: '0',
editChildRef: 'editChildRef',
loading: false,
userInfo: {},
pickerOptions: {
disabledDate(v) {
//禁用当前之前的日期
......@@ -232,6 +246,9 @@ export default {
activityBigImg: '',
activityVideos: [],
activityDetail: '',
fictitiousGroupQuantity: '',
fictitiousLadderQuantity: 30,
fictitiousViewQuantity: '',
forwardTitle: '',
posterImg: ''
// formDescribeFirst: '',
......@@ -276,15 +293,7 @@ export default {
trigger: 'change'
}
],
goodsStock: [
{ required: true, message: '请设置活动库存', trigger: 'change' }
// {
// validator: (rule, value, callback) => {
// return value > this.selectedProInfo.goodsStock ? callback(new Error('活动库存不能大于商品库存')) : callback()
// },
// trigger: 'change'
// }
],
goodsStock: [{ required: true, message: '请设置活动库存', trigger: 'change' }],
goodsId: [{ required: true, message: '请选择商品', trigger: ['change', 'blur'] }],
limitPurchaseFlag: [{ required: true, message: '请选择是否限购', trigger: 'change' }],
limitPurchaseNumber: [
......@@ -300,11 +309,19 @@ export default {
}
],
// 活动配置
// 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' }],
customerServicePhone: { required: false, validator: validatorPhone, trigger: 'change' },
fictitiousLadderQuantity: [{ required: true, message: '请输入阶梯人数', trigger: 'change' }],
fictitiousViewQuantity: [
{
validator: (rule, value, callback) => {
if (value < +this.editForm.fictitiousGroupQuantity) {
return callback(new Error('浏览人数应大于参团人数'))
}
return callback()
},
trigger: 'change'
}
],
activityBigImg: [{ required: true, message: '请选择活动大图', trigger: 'change' }],
activityDetail: [{ required: true, message: '请输入活动详情', trigger: 'change' }],
forwardTitle: [{ required: true, message: '请输入转发标题', trigger: 'change' }]
......@@ -323,11 +340,14 @@ export default {
],
// 倒计时
countDownObj: {
typeTxt: '距离活动开始',
activityStatus: 1,
d: '',
h: '',
m: '',
s: ''
},
fileList: [],
// 基本信息
editFormData: [
{
......@@ -521,7 +541,7 @@ export default {
label: '音乐文件',
name: 'activityMusic',
tips: '活动页背景音乐',
limitSize: 2,
limitSize: 5,
addHtml: 'activityMusic'
},
{
......@@ -529,7 +549,7 @@ export default {
name: 'predictVolume',
width: '474px',
type: 'input',
append: '件',
append: '元',
maxlength: 20,
tips: '用作战报的销量展示'
},
......@@ -575,7 +595,7 @@ export default {
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() : ''
this.routeInfo.addOrEdit != 'add' ? this.getInfo() : this.getMerchantInfo()
var id = this.routeInfo.id
var detailDisableList = ['editFormData']
if (id) {
......@@ -608,13 +628,13 @@ export default {
this.editForm.goodsStock = limitPrice(newValue, oldValue, 5, 0, 0)
},
'editForm.activityTime'(newValue) {
newValue && this.countDown()
newValue && newValue.length && this.countDown()
},
'editForm.predictVolume'(newValue, oldValue) {
this.editForm.predictVolume = limitPrice(newValue, oldValue, 7, 0, 0, 1000000)
this.editForm.predictVolume = limitPrice(newValue, oldValue, 7, 2, 0, 1000000)
},
'editForm.fictitiousGroupQuantity'(newValue, oldValue) {
this.editForm.fictitiousGroupQuantity = limitPrice(newValue, oldValue, 7, 0, 0)
this.editForm.fictitiousGroupQuantity = limitPrice(newValue, oldValue, 3, 0, 0, 100)
},
'editForm.fictitiousLadderQuantity'(newValue, oldValue) {
this.editForm.fictitiousLadderQuantity = limitPrice(newValue, oldValue, 7, 0, 0)
......@@ -659,26 +679,60 @@ export default {
return i < 10 ? `0${i}` : `${i}`
},
findCountDownTime() {
let startTime = new Date(this.editForm.activityTime[0])
let endTime = new Date(this.editForm.activityTime[1])
let currentTime = new Date()
// activityStatus 1:未开始,2进行中,3已结束
let activityStatus = currentTime < startTime ? 1 : endTime < currentTime ? 2 : 3
return {
activityStatus,
startTime: activityStatus == 1 ? currentTime : activityStatus == 2 ? currentTime : endTime,
endTime: activityStatus == 1 ? startTime : activityStatus == 2 ? endTime : endTime
}
},
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)
if (this.editForm.activityTime && this.editForm.activityTime.length) {
let { activityStatus, startTime, endTime } = this.findCountDownTime()
let lefttime = parseInt((endTime.getTime() - startTime.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)
let typeTxt = {
1: '距离活动开始',
2: '距离活动结束',
3: '活动倒计时'
}[activityStatus]
if (this.time) clearTimeout(this.time)
this.time = setTimeout(() => {
if (d > 0) d = this.addZero(d)
this.countDownObj = {
typeTxt: typeTxt,
d: d,
h: h,
m: m,
s: s
}
this.countDown()
}, 1 * 1000)
} else {
this.countDownObj = {
d: d,
h: h,
m: m,
s: s
typeTxt: '距离活动开始',
d: '',
h: '',
m: '',
s: ''
}
this.countDown()
}, 1 * 1000)
}
},
handleTimeChange(value, targetItem) {
!value && (this.editForm[targetItem.name] = [])
},
handleIsLimit(val) {
......@@ -828,17 +882,19 @@ export default {
musicUpload(e, targetItem) {
var reader = new FileReader()
var file = e.raw
var file = e
// 默认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的格式!')
this.fileList = []
return true
}
if (!isLt) {
this.$message.error('上传的文件大小不能超过' + limitSize + 'MB!')
this.fileList = []
return true
}
reader.readAsDataURL(file)
......@@ -851,12 +907,13 @@ export default {
}
},
handleMusicChange(file, targetItem) {
handleMusicBeforeUpload(file, targetItem) {
this.musicUpload(file, targetItem)
},
handleMusicDelete(targetItem) {
this.$set(this.editForm, targetItem.name, '')
this.fileList = []
},
// 表单设置
......@@ -877,44 +934,83 @@ export default {
})
},
getMerchantInfo() {
this.loading = true
let merchantId = this.$globalState.session.merchantId
this.$apis.common
.getMerchantInfoApi({ merchantId: merchantId })
.then(res => {
this.userInfo = res
this.editForm.sponsorName = res.merchantName
// 地图
if (res.provinceName || res.cityName) {
this.$refs.configEditFormRef.$refs.provinceForm[0].init(res.provinceName, res.cityName)
let mapAttr = this.configEditFormData.find(item => item.name == 'activityAddressDetailName')
this.editForm[mapAttr.attrObj.provinceName] = res.provinceName
this.editForm[mapAttr.attrObj.provinceCode] = res.provinceCode
this.editForm[mapAttr.attrObj.cityName] = res.cityName
this.editForm[mapAttr.attrObj.cityCode] = res.cityCode
this.editForm[mapAttr.attrObj.lat] = res.lat
this.editForm[mapAttr.attrObj.lng] = res.lng
this.editForm[mapAttr.attrObj.fullAddress] = res.merchantAddress
}
this.$nextTick(() => {
this.editStatus = false
})
})
.finally(() => {
this.loading = false
})
},
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]] })
this.loading = true
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.predictVolume) {
this.editForm.predictVolume = (info.predictVolume / 100).toFixed(2)
}
// 地图
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
})
})
if (!this.formDescribeList.length) {
this.formDescribeList = [{ value: '' }]
}
this.$nextTick(() => {
this.editStatus = false
.finally(() => {
this.loading = false
})
})
},
validateRules() {
......@@ -958,6 +1054,10 @@ export default {
param.specificationDetailList.push(obj)
})
}
// 预估销量
if (this.editForm.predictVolume) {
param.predictVolume = (this.editForm.predictVolume * 100).toFixed(0)
}
// 活动详情
if (this.editForm.activityDetail) {
param.activityDetail = encodeURIComponent(this.editForm.activityDetail)
......@@ -987,17 +1087,23 @@ export default {
},
addOrUpdate() {
this.loading = true
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'
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()
}
})
.finally(() => {
this.loading = false
})
if (res.code == '0') {
this.cancelJump()
}
})
},
handleConfirm() {
......@@ -1034,7 +1140,16 @@ export default {
this.$refs.configEditFormRef.$refs[this.editChildRef].validate((configValid, configErrorObj) => {
validList.push({ valid: !configValid, errorObj: configErrorObj })
if (this.checkValid(validList)) {
this.addOrUpdate()
if (this.$refs.serviceEditFormRef) {
this.$refs.serviceEditFormRef.$refs[this.editChildRef].validate((serviceValid, serviceErrorObj) => {
validList.splice(2, 0, { valid: !serviceValid, errorObj: serviceErrorObj })
if (this.checkValid(validList)) {
this.addOrUpdate()
}
})
} else {
this.addOrUpdate()
}
}
})
})
......@@ -1198,6 +1313,7 @@ export default {
line-height: 22px;
padding: 15px;
border: 1px dotted #e3e3e3;
margin-top: 10px;
}
.wechat-txt {
color: #f13c3d;
......@@ -1205,6 +1321,11 @@ export default {
padding: 4px;
margin: 0 4px;
}
.count-down-img {
margin-top: 10px;
width: 180px;
height: 188px;
}
}
}
.edit-activity .wechat-box .wechat-banner-img .crowd-jdt {
......@@ -1240,15 +1361,26 @@ export default {
}
.edit-activity .form-describe {
width: 560px;
padding: 20px;
padding: 0 20px 20px;
background: #f9f9f9;
}
.edit-activity .form-describe:first-child {
padding: 20px;
}
.edit-activity .describe-input {
width: 474px;
}
.edit-activity .describe-delete {
color: #999999;
margin-left: 8px;
}
.edit-activity .describe-plus {
font-size: 18px;
color: #999999;
padding: 0 4px 4px 8px;
cursor: pointer;
border-left: 1px solid rgb(220, 223, 230);
}
::-webkit-scrollbar {
/*滚动条整体样式*/
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!