Commit 2b5930e3 by 前端

Merge branch 'chenwq_dev_v2.6.0' into 'v2.6.0'

Chenwq dev v2.6.0

See merge request !233
2 parents cb81db83 bad56012
import { http, http_common, http2 } from '@/main' import { http, http_common, http2, http_merchant } from '@/main'
const defaultPath = 'scrm.api.carlife.' const defaultPath = 'scrm.api.carlife.'
const getMerchantGoodsListApi = params => { const getMerchantGoodsListApi = params => {
...@@ -139,4 +139,15 @@ const getStaffFollowerListApi = 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 }
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
<div v-else-if="item.type === 'input'"> <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)"> <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.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> </el-input>
<slot :name="item.suffixSlot" :scope="item"></slot> <slot :name="item.suffixSlot" :scope="item"></slot>
</div> </div>
...@@ -76,12 +76,12 @@ ...@@ -76,12 +76,12 @@
<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> <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"> <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> <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-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> </div>
</el-form-item> </el-form-item>
</template> </template>
...@@ -265,6 +265,9 @@ export default { ...@@ -265,6 +265,9 @@ export default {
handleTextBoxChange(val, targetItem) { handleTextBoxChange(val, targetItem) {
this.formObj[targetItem.name] = val this.formObj[targetItem.name] = val
}, },
handleTextBoxFocus(targetItem) {
this.$refs[targetItem.name + 'TextBox'][0].setEdit(this.formObj[targetItem.name])
},
// 禁用富文本 // 禁用富文本
forbidEdit() { forbidEdit() {
this.$refs.textBox.forbidEdit() this.$refs.textBox.forbidEdit()
......
...@@ -82,6 +82,7 @@ export default { ...@@ -82,6 +82,7 @@ export default {
this.createStyle() this.createStyle()
// 每次光标变化的时候,保存 range // 每次光标变化的时候,保存 range
document.addEventListener('selectionchange', this.selectHandler) document.addEventListener('selectionchange', this.selectHandler)
this.$refs.wTextareaContent.focus()
}, },
beforeDestroy() { beforeDestroy() {
// 卸载事件 // 卸载事件
......
...@@ -33,8 +33,11 @@ export default { ...@@ -33,8 +33,11 @@ export default {
this.content = html // 绑定当前逐渐地值 this.content = html // 绑定当前逐渐地值
this.$emit('change', this.content) // 将内容同步到父组件中 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 file = resultFiles[0]
var reader = new FileReader() var reader = new FileReader()
// 默认1MB // 默认1MB
...@@ -60,7 +63,7 @@ export default { ...@@ -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 file = resultFiles[0]
var reader = new FileReader() var reader = new FileReader()
// 默认1MB // 默认1MB
......
...@@ -142,7 +142,9 @@ export default { ...@@ -142,7 +142,9 @@ export default {
}, },
{ {
label: '其他信息', label: '其他信息',
name: '' name: 'formDescribe',
contentName: 'formContent',
attrList: ['First', 'Second', 'Third']
} }
], ],
// 售后信息 // 售后信息
...@@ -224,7 +226,6 @@ export default { ...@@ -224,7 +226,6 @@ 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) {
...@@ -245,6 +246,16 @@ export default { ...@@ -245,6 +246,16 @@ export default {
var takeFeeIdx = this.detailFormData.findIndex(item => item.name == 'takeFee') var takeFeeIdx = this.detailFormData.findIndex(item => item.name == 'takeFee')
this.detailFormData.splice(takeFeeIdx, 1) 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') this.formToRow('detailFormData')
}) })
}, },
......
...@@ -153,13 +153,10 @@ export default { ...@@ -153,13 +153,10 @@ export default {
attrs: { attrs: {
type: 'text' type: 'text'
}, },
condition: row => {
return row.activityStatus == '1' || row.activityStatus == '2'
},
listeners: { listeners: {
click: this.handleShare click: this.handleShare
} }
}, }
], ],
// 表格 // 表格
getListApi: this.$apis.seckillActivity.getCrowdfundListApi, getListApi: this.$apis.seckillActivity.getCrowdfundListApi,
......
...@@ -5,8 +5,8 @@ ...@@ -5,8 +5,8 @@
<p class="edit-title">{{ title }}秒杀活动</p> <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"> <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" 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" :clearable="false"></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" @change="e => handleTimeChange(e, scope.scope)"></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>
...@@ -342,6 +342,10 @@ export default { ...@@ -342,6 +342,10 @@ export default {
} }
}, },
handleTimeChange(value, targetItem) {
!value && (this.editForm[targetItem.name] = [])
},
handleIsLimit(val) { handleIsLimit(val) {
this.editForm.limitPurchaseNumber = val == 1 ? '' : '1' this.editForm.limitPurchaseNumber = val == 1 ? '' : '1'
this.editRule.limitPurchaseNumber[0].required = val != 1 this.editRule.limitPurchaseNumber[0].required = val != 1
......
...@@ -6,11 +6,11 @@ ...@@ -6,11 +6,11 @@
<p class="edit-title">基本信息</p> <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"> <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" 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" :clearable="false"></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" @change="e => handleTimeChange(e, scope.scope)"></el-date-picker>
</template> </template>
<div slot="goodsHtml"> <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"> <div v-if="selectedProInfo.id && !specificationDetailList.length" style="margin-top: 10px">
<p> <p>
<img class="img-60" :src="selectedProInfo.goodsImage" /> <img class="img-60" :src="selectedProInfo.goodsImage" />
...@@ -79,7 +79,7 @@ ...@@ -79,7 +79,7 @@
</div> </div>
</template> </template>
<template slot="activityMusic" slot-scope="scope"> <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-button class="el-icon-plus" size="small" type="default">背景音乐</el-button>
</el-upload> </el-upload>
<div v-if="editForm[scope.scope.name]" class="flex"> <div v-if="editForm[scope.scope.name]" class="flex">
...@@ -103,12 +103,16 @@ ...@@ -103,12 +103,16 @@
</div> </div>
</template> </template>
<div slot="activityBigImg" class="edit-tips m-t-8">建议尺寸750*1258</div> <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 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"> <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" clearable>
<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 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> </div>
</glsx-combi-form> </glsx-combi-form>
</div> </div>
...@@ -121,7 +125,7 @@ ...@@ -121,7 +125,7 @@
<div class="wechat-inner-box"> <div class="wechat-inner-box">
<div class="wechat-banner-img"> <div class="wechat-banner-img">
<img class="icon-music" src="@/assets/seckillActivity/icon-music.png" /> <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" /> <img class="wechat-customer" src="@/assets/seckillActivity/crowd-customer.png" />
<div class="w-100-percent txt-center"> <div class="w-100-percent txt-center">
<video v-if="editForm.activityVideos.length" class="wechat-video" controls> <video v-if="editForm.activityVideos.length" class="wechat-video" controls>
...@@ -134,22 +138,23 @@ ...@@ -134,22 +138,23 @@
<div> <div>
<p class="m-b-10">{{ editForm.sponsorName }}</p> <p class="m-b-10">{{ editForm.sponsorName }}</p>
<p class="m-b-10 wechat-sub-addr">{{ editForm.activityAddressDetailName }}</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> </div>
<img class="icon-addr" src="@/assets/seckillActivity/icon-addr.png" /> <img class="icon-addr" src="@/assets/seckillActivity/icon-addr.png" />
</div> </div>
</div> </div>
<div class="wechat-block"> <div class="wechat-block">
<p class="wechat-block-title">距离活动开始</p> <p class="wechat-block-title">{{ countDownObj.typeTxt }}</p>
<p class="wechat-count-down m-b-10"> <p v-if="countDownObj.activityStatus != 3" class="wechat-count-down">
<span v-if="editForm.activityTime.length">{{ editForm.activityTime[0].split(' ')[0].split('-')[2] }}</span> <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.d }}</span>天
<span class="wechat-txt">{{ countDownObj.h }}</span>时 <span class="wechat-txt">{{ countDownObj.h }}</span>时
<span class="wechat-txt">{{ countDownObj.m }}</span>分 <span class="wechat-txt">{{ countDownObj.m }}</span>分
<span class="wechat-txt">{{ countDownObj.s }}</span>秒 <span class="wechat-txt">{{ countDownObj.s }}</span>秒
</p> </p>
<img v-else class="count-down-img" src="@/assets/seckillActivity/count-down.png" />
</div> </div>
<div class="w-100-percent txt-center"> <div class="w-100-percent txt-center">
<img class="crowd-jdt" src="@/assets/seckillActivity/crowd-jdt.png" /> <img class="crowd-jdt" src="@/assets/seckillActivity/crowd-jdt.png" />
...@@ -179,6 +184,7 @@ export default { ...@@ -179,6 +184,7 @@ export default {
footerLeft: '0', footerLeft: '0',
footerWidth: '0', footerWidth: '0',
editChildRef: 'editChildRef', editChildRef: 'editChildRef',
userInfo: {},
pickerOptions: { pickerOptions: {
disabledDate(v) { disabledDate(v) {
//禁用当前之前的日期 //禁用当前之前的日期
...@@ -300,11 +306,6 @@ export default { ...@@ -300,11 +306,6 @@ 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' }],
activityBigImg: [{ required: true, message: '请选择活动大图', trigger: 'change' }], activityBigImg: [{ required: true, message: '请选择活动大图', trigger: 'change' }],
activityDetail: [{ required: true, message: '请输入活动详情', trigger: 'change' }], activityDetail: [{ required: true, message: '请输入活动详情', trigger: 'change' }],
forwardTitle: [{ required: true, message: '请输入转发标题', trigger: 'change' }] forwardTitle: [{ required: true, message: '请输入转发标题', trigger: 'change' }]
...@@ -323,11 +324,14 @@ export default { ...@@ -323,11 +324,14 @@ export default {
], ],
// 倒计时 // 倒计时
countDownObj: { countDownObj: {
typeTxt: '距离活动开始',
activityStatus: 1,
d: '', d: '',
h: '', h: '',
m: '', m: '',
s: '' s: ''
}, },
fileList: [],
// 基本信息 // 基本信息
editFormData: [ editFormData: [
{ {
...@@ -529,7 +533,7 @@ export default { ...@@ -529,7 +533,7 @@ export default {
name: 'predictVolume', name: 'predictVolume',
width: '474px', width: '474px',
type: 'input', type: 'input',
append: '件', append: '元',
maxlength: 20, maxlength: 20,
tips: '用作战报的销量展示' tips: '用作战报的销量展示'
}, },
...@@ -575,7 +579,7 @@ export default { ...@@ -575,7 +579,7 @@ export default {
this.footerLeft = document.querySelector('.base-container-right').offsetLeft this.footerLeft = document.querySelector('.base-container-right').offsetLeft
this.footerWidth = document.documentElement.clientWidth - this.footerLeft this.footerWidth = document.documentElement.clientWidth - this.footerLeft
this.routeInfo = this.$route.query 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 id = this.routeInfo.id
var detailDisableList = ['editFormData'] var detailDisableList = ['editFormData']
if (id) { if (id) {
...@@ -608,13 +612,13 @@ export default { ...@@ -608,13 +612,13 @@ export default {
this.editForm.goodsStock = limitPrice(newValue, oldValue, 5, 0, 0) this.editForm.goodsStock = limitPrice(newValue, oldValue, 5, 0, 0)
}, },
'editForm.activityTime'(newValue) { 'editForm.activityTime'(newValue) {
newValue && this.countDown() newValue && newValue.length && this.countDown()
}, },
'editForm.predictVolume'(newValue, oldValue) { '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) { '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) { 'editForm.fictitiousLadderQuantity'(newValue, oldValue) {
this.editForm.fictitiousLadderQuantity = limitPrice(newValue, oldValue, 7, 0, 0) this.editForm.fictitiousLadderQuantity = limitPrice(newValue, oldValue, 7, 0, 0)
...@@ -659,26 +663,60 @@ export default { ...@@ -659,26 +663,60 @@ export default {
return i < 10 ? `0${i}` : `${i}` 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() { countDown() {
let lefttime = parseInt((new Date(this.editForm.activityTime[0]).getTime() - new Date().getTime()) / 1000) if (this.editForm.activityTime && this.editForm.activityTime.length) {
let d = parseInt(lefttime / (24 * 60 * 60)) let { activityStatus, startTime, endTime } = this.findCountDownTime()
let h = parseInt((lefttime / (60 * 60)) % 24) let lefttime = parseInt((endTime.getTime() - startTime.getTime()) / 1000)
let m = parseInt((lefttime / 60) % 60) let d = parseInt(lefttime / (24 * 60 * 60))
let s = parseInt(lefttime % 60) let h = parseInt((lefttime / (60 * 60)) % 24)
h = this.addZero(h) let m = parseInt((lefttime / 60) % 60)
m = this.addZero(m) let s = parseInt(lefttime % 60)
s = this.addZero(s) h = this.addZero(h)
if (this.time) clearTimeout(this.time) m = this.addZero(m)
this.time = setTimeout(() => { s = this.addZero(s)
if (d > 0) d = this.addZero(d) 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 = { this.countDownObj = {
d: d, typeTxt: '距离活动开始',
h: h, d: '',
m: m, h: '',
s: s m: '',
s: ''
} }
this.countDown() }
}, 1 * 1000) },
handleTimeChange(value, targetItem) {
!value && (this.editForm[targetItem.name] = [])
}, },
handleIsLimit(val) { handleIsLimit(val) {
...@@ -828,17 +866,19 @@ export default { ...@@ -828,17 +866,19 @@ export default {
musicUpload(e, targetItem) { musicUpload(e, targetItem) {
var reader = new FileReader() var reader = new FileReader()
var file = e.raw var file = e
// 默认1MB // 默认1MB
const limitSize = targetItem.limitSize const limitSize = targetItem.limitSize
const isLt = file.size / 1024 / 1024 < limitSize const isLt = file.size / 1024 / 1024 < limitSize
const isType = ['audio/mp3', 'audio/m4a'] const isType = ['audio/mp3', 'audio/m4a']
if (!isType) { if (!isType) {
this.$message.error('上传文件不是jpg、jpeg或png的格式!') this.$message.error('上传文件不是jpg、jpeg或png的格式!')
this.fileList = []
return true return true
} }
if (!isLt) { if (!isLt) {
this.$message.error('上传的文件大小不能超过' + limitSize + 'MB!') this.$message.error('上传的文件大小不能超过' + limitSize + 'MB!')
this.fileList = []
return true return true
} }
reader.readAsDataURL(file) reader.readAsDataURL(file)
...@@ -851,12 +891,13 @@ export default { ...@@ -851,12 +891,13 @@ export default {
} }
}, },
handleMusicChange(file, targetItem) { handleMusicBeforeUpload(file, targetItem) {
this.musicUpload(file, targetItem) this.musicUpload(file, targetItem)
}, },
handleMusicDelete(targetItem) { handleMusicDelete(targetItem) {
this.$set(this.editForm, targetItem.name, '') this.$set(this.editForm, targetItem.name, '')
this.fileList = []
}, },
// 表单设置 // 表单设置
...@@ -877,6 +918,29 @@ export default { ...@@ -877,6 +918,29 @@ export default {
}) })
}, },
getMerchantInfo() {
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
})
})
},
getInfo() { getInfo() {
this.$apis.seckillActivity.getActivityDetailApi({ id: this.routeInfo.id }).then(res => { this.$apis.seckillActivity.getActivityDetailApi({ id: this.routeInfo.id }).then(res => {
var info = res var info = res
...@@ -888,6 +952,10 @@ export default { ...@@ -888,6 +952,10 @@ export default {
this.editForm.activityPrice = (info.activityPrice / 100).toFixed(2) this.editForm.activityPrice = (info.activityPrice / 100).toFixed(2)
this.editForm.goodsStock = info.goodsStock + '' this.editForm.goodsStock = info.goodsStock + ''
} }
// 预估销量
if (info.predictVolume) {
this.editForm.predictVolume = (info.predictVolume / 100).toFixed(2)
}
// 地图 // 地图
if (info.activityAddressProvinceName || info.activityAddressCityName) { if (info.activityAddressProvinceName || info.activityAddressCityName) {
this.$refs.configEditFormRef.$refs.provinceForm[0].init(info.activityAddressProvinceName, info.activityAddressCityName) this.$refs.configEditFormRef.$refs.provinceForm[0].init(info.activityAddressProvinceName, info.activityAddressCityName)
...@@ -958,6 +1026,10 @@ export default { ...@@ -958,6 +1026,10 @@ export default {
param.specificationDetailList.push(obj) param.specificationDetailList.push(obj)
}) })
} }
// 预估销量
if (this.editForm.predictVolume) {
param.predictVolume = (this.editForm.predictVolume * 100).toFixed(0)
}
// 活动详情 // 活动详情
if (this.editForm.activityDetail) { if (this.editForm.activityDetail) {
param.activityDetail = encodeURIComponent(this.editForm.activityDetail) param.activityDetail = encodeURIComponent(this.editForm.activityDetail)
...@@ -1198,6 +1270,7 @@ export default { ...@@ -1198,6 +1270,7 @@ export default {
line-height: 22px; line-height: 22px;
padding: 15px; padding: 15px;
border: 1px dotted #e3e3e3; border: 1px dotted #e3e3e3;
margin-top: 10px;
} }
.wechat-txt { .wechat-txt {
color: #f13c3d; color: #f13c3d;
...@@ -1205,6 +1278,11 @@ export default { ...@@ -1205,6 +1278,11 @@ export default {
padding: 4px; padding: 4px;
margin: 0 4px; margin: 0 4px;
} }
.count-down-img {
margin-top: 10px;
width: 180px;
height: 188px;
}
} }
} }
.edit-activity .wechat-box .wechat-banner-img .crowd-jdt { .edit-activity .wechat-box .wechat-banner-img .crowd-jdt {
...@@ -1249,6 +1327,13 @@ export default { ...@@ -1249,6 +1327,13 @@ export default {
.edit-activity .describe-delete { .edit-activity .describe-delete {
margin-left: 8px; 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 { ::-webkit-scrollbar {
/*滚动条整体样式*/ /*滚动条整体样式*/
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!