Commit 6d982563 by chenwq

众筹

1 parent 308bab6f
...@@ -33,7 +33,9 @@ ...@@ -33,7 +33,9 @@
<!-- radio --> <!-- radio -->
<div v-else-if="item.type === 'radio'"> <div v-else-if="item.type === 'radio'">
<el-radio-group v-model="formObj[item.name]" v-bind="item.attrs ? item.attrs : {}" v-on="item.listeners ? item.listeners : {}" :disabled="item.isDisabled" @change="item.handleRadioChange"> <el-radio-group v-model="formObj[item.name]" v-bind="item.attrs ? item.attrs : {}" v-on="item.listeners ? item.listeners : {}" :disabled="item.isDisabled" @change="item.handleRadioChange">
<el-radio v-for="subItem in item.optionList" :key="subItem[item.optionId]" :disabled="subItem.isDisabled" :label="subItem[item.optionId]">{{ subItem[item.optionLabel] }} <slot :name="subItem.suffixSonSlot" :scope="subItem"></slot> <el-radio v-for="subItem in item.optionList" :key="subItem[item.optionId]" :disabled="subItem.isDisabled" :label="subItem[item.optionId]">
{{ subItem[item.optionLabel] }}
<slot :name="subItem.suffixSonSlot" :scope="subItem"></slot>
</el-radio> </el-radio>
</el-radio-group> </el-radio-group>
<slot :name="item.suffixSlot" :scope="item"></slot> <slot :name="item.suffixSlot" :scope="item"></slot>
...@@ -42,20 +44,21 @@ ...@@ -42,20 +44,21 @@
<template v-else-if="item.type === 'upload'"> <template v-else-if="item.type === 'upload'">
<p class="photo-top-tips">{{ item.topTips }}</p> <p class="photo-top-tips">{{ item.topTips }}</p>
<div v-if="!item.isDisabled" :style="{ width: item.width || defaultWidth }"> <div v-if="!item.isDisabled" :style="{ width: item.width || defaultWidth }">
<div v-if="Array.isArray(formObj[item.name]) ? formObj[item.name].length < item.maxPhotoNum : !formObj[item.name]" class="activity-img img-w-h"> <div v-if="Array.isArray(formObj[item.name]) ? formObj[item.name].length < item.maxPhotoNum : !formObj[item.name]" class="activity-img img-w-h" :style="item.uploadStyle && item.uploadStyle.hasOwnProperty('imgWH') ? item.uploadStyle.imgWH : ''">
<div class="add" :style="{ top: item.maxPhotoNum == 1 ? '50%' : '40%' }">+</div> <div class="add" :style="item.uploadStyle && item.uploadStyle.hasOwnProperty('addStyle') ? item.uploadStyle.addStyle : ''">+</div>
<span v-if="item.maxPhotoNum > 1" class="number">{{ formObj[item.name].length }} / {{ item.maxPhotoNum }}</span> <!-- <span v-if="item.maxPhotoNum > 1" class="number">{{ formObj[item.name].length }}/{{ item.maxPhotoNum }}</span> -->
<input v-if="item.uploadType == 'video'" type="file" style="opacity: 0" :id="item.name + 'file'" ref="file" class="activity-img img-w-h" accept="video/mp4" @change="e => handleUploadChange(e, item)" /> <span class="number" :style="item.uploadStyle && item.uploadStyle.hasOwnProperty('fontSize') ? item.uploadStyle.fontSize : ''">上传图片</span>
<input v-else type="file" style="opacity: 0" :id="item.name + 'file'" ref="file" class="activity-img img-w-h" accept="image/png, image/jpeg, image/gif, image/jpg" @change="e => handleUploadChange(e, item)" /> <input v-if="item.uploadType == 'video'" type="file" style="opacity: 0" :id="item.name + 'file'" ref="file" class="activity-img img-w-h" :style="item.uploadStyle && item.uploadStyle.hasOwnProperty('imgWH') ? item.uploadStyle.imgWH : ''" accept="video/mp4" @change="e => handleUploadChange(e, item)" />
<input v-else type="file" style="opacity: 0" :id="item.name + 'file'" ref="file" class="activity-img img-w-h" :style="item.uploadStyle && item.uploadStyle.hasOwnProperty('imgWH') ? item.uploadStyle.imgWH : ''" accept="image/png, image/jpeg, image/gif, image/jpg" @change="e => handleUploadChange(e, item)" />
</div> </div>
</div> </div>
<template> <template>
<div v-if="Array.isArray(formObj[item.name]) ? formObj[item.name].length : formObj[item.name]"> <div v-if="Array.isArray(formObj[item.name]) ? formObj[item.name].length : formObj[item.name]">
<span v-if="Array.isArray(formObj[item.name])"> <span v-if="Array.isArray(formObj[item.name])">
<span v-for="(subItem, subIndex) in formObj[item.name]" :key="subIndex" class="muti-imgs img-w-h"> <span v-for="(subItem, subIndex) in formObj[item.name]" :key="subIndex" class="muti-imgs img-w-h" :style="item.uploadStyle && item.uploadStyle.hasOwnProperty('imgWH') ? item.uploadStyle.imgWH : ''">
<video v-if="item.uploadType == 'video'" class="img-w-h activity-img" :src="typeof subItem == 'object' ? subItem.content : subItem"></video> <video v-if="item.uploadType == 'video'" class="img-w-h activity-img" :style="item.uploadStyle && item.uploadStyle.hasOwnProperty('imgWH') ? item.uploadStyle.imgWH : ''" :src="typeof subItem == 'object' ? subItem.content : subItem"></video>
<img v-else class="img-w-h" :src="typeof subItem == 'object' ? subItem.content : subItem" /> <img v-else class="img-w-h" :style="item.uploadStyle && item.uploadStyle.hasOwnProperty('imgWH') ? item.uploadStyle.imgWH : ''" :src="typeof subItem == 'object' ? subItem.content : subItem" />
<span class="img-btns"> <span class="img-btns" :style="item.uploadStyle && item.uploadStyle.hasOwnProperty('imgWH') ? item.uploadStyle.imgWH : ''">
<span class="btn-item"> <span class="btn-item">
<i v-show="!item.isDisabled" class="el-icon-delete" @click="handleImgDelete(item, subIndex)"></i> <i v-show="!item.isDisabled" class="el-icon-delete" @click="handleImgDelete(item, subIndex)"></i>
<i class="el-icon-zoom-in" @click="handleImgLook(typeof subItem == 'object' ? subItem.content : subItem, item)"></i> <i class="el-icon-zoom-in" @click="handleImgLook(typeof subItem == 'object' ? subItem.content : subItem, item)"></i>
...@@ -64,9 +67,9 @@ ...@@ -64,9 +67,9 @@
</span> </span>
</span> </span>
<span v-else class="muti-imgs"> <span v-else class="muti-imgs">
<video v-if="item.uploadType == 'video'" class="img-w-h activity-img" :src="formObj[item.name]"></video> <video v-if="item.uploadType == 'video'" class="img-w-h activity-img" :style="item.uploadStyle && item.uploadStyle.hasOwnProperty('imgWH') ? item.uploadStyle.imgWH : ''" :src="formObj[item.name]"></video>
<img v-else class="img-w-h" :src="formObj[item.name]" /> <img v-else class="img-w-h" :style="item.uploadStyle && item.uploadStyle.hasOwnProperty('imgWH') ? item.uploadStyle.imgWH : ''" :src="formObj[item.name]" />
<span class="img-btns"> <span class="img-btns" :style="item.uploadStyle && item.uploadStyle.hasOwnProperty('imgWH') ? item.uploadStyle.imgWH : ''">
<span class="btn-item"> <span class="btn-item">
<i v-show="!item.isDisabled" class="el-icon-delete" @click="handleImgDelete(item)"></i> <i v-show="!item.isDisabled" class="el-icon-delete" @click="handleImgDelete(item)"></i>
<i class="el-icon-zoom-in" @click="handleImgLook(formObj[item.name], item)"></i> <i class="el-icon-zoom-in" @click="handleImgLook(formObj[item.name], item)"></i>
...@@ -241,11 +244,11 @@ export default { ...@@ -241,11 +244,11 @@ export default {
if (targetItem.hasPixel && (imgWidth > wdithLt || imgHeight > heightLt)) { if (targetItem.hasPixel && (imgWidth > wdithLt || imgHeight > heightLt)) {
this.$message.error('图片尺寸最大为' + wdithLt + '像素*' + heightLt + '像素') this.$message.error('图片尺寸最大为' + wdithLt + '像素*' + heightLt + '像素')
} else { } else {
targetItem.handleUpload(e, file, targetItem) targetItem.handleUpload(e, file, targetItem, this.formObj)
} }
} }
} else { } else {
targetItem.handleUpload(e, file, targetItem) targetItem.handleUpload(e, file, targetItem, this.formObj)
} }
} }
document.getElementById(targetItem.name + 'file').value = '' document.getElementById(targetItem.name + 'file').value = ''
...@@ -466,6 +469,9 @@ export default { ...@@ -466,6 +469,9 @@ export default {
bottom: 0; bottom: 0;
left: 50%; left: 50%;
transform: translateX(-50%); transform: translateX(-50%);
font-size: 14px;
width: 100%;
text-align: center;
} }
.muti-imgs .img-btns { .muti-imgs .img-btns {
......
...@@ -3,12 +3,14 @@ ...@@ -3,12 +3,14 @@
<div class="marketing order-manage"> <div class="marketing order-manage">
<div class="container"> <div class="container">
<GLCombiForm ref="showSearch" :rowNumber="1" :formObj="searchForm" :formData="searchFormData" @handleOk="handleSearch" @handleRest="handleReset"></GLCombiForm> <GLCombiForm ref="showSearch" :rowNumber="1" :formObj="searchForm" :formData="searchFormData" @handleOk="handleSearch" @handleRest="handleReset"></GLCombiForm>
<div class="flex"> <div class="flex">
<div class="flex-default"> <div class="flex-default">
<el-tabs v-model="activeName" @tab-click="handleTabClick"> <el-tabs v-model="activeName" @tab-click="handleTabClick">
<el-tab-pane label="全部订单" name="allOrder"></el-tab-pane> <el-tab-pane label="全部订单" name="allOrder"></el-tab-pane>
<el-tab-pane label="售后订单" name="afterOrder"></el-tab-pane> <el-tab-pane label="售后订单" name="afterOrder"></el-tab-pane>
</el-tabs> </el-tabs>
<span class="table-tips"> <span class="table-tips">
已生成有效订单 已生成有效订单
<span class="txt-blue">&nbsp;{{ statisticsInfo.orderCount || 0 }}&nbsp;</span> <span class="txt-blue">&nbsp;{{ statisticsInfo.orderCount || 0 }}&nbsp;</span>
...@@ -21,6 +23,7 @@ ...@@ -21,6 +23,7 @@
</div> </div>
<el-button class="default-blue-btn" :size="size" type="default" @click="handleExport">导出</el-button> <el-button class="default-blue-btn" :size="size" type="default" @click="handleExport">导出</el-button>
</div> </div>
<!-- 表格区域 - 全部订单/售后订单 - 开始 --> <!-- 表格区域 - 全部订单/售后订单 - 开始 -->
<GLTable ref="allOrderRef" :getListApi="getListApi" :noDataImg="url" :searchForm="tableSearchForm" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn" @setTableFinishFun="setTableFinishFun"> <GLTable ref="allOrderRef" :getListApi="getListApi" :noDataImg="url" :searchForm="tableSearchForm" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn" @setTableFinishFun="setTableFinishFun">
<div slot="weChatName" class="flex-align" slot-scope="scope"> <div slot="weChatName" class="flex-align" slot-scope="scope">
...@@ -121,6 +124,7 @@ ...@@ -121,6 +124,7 @@
</GLDialog> </GLDialog>
</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'
...@@ -312,6 +316,20 @@ export default { ...@@ -312,6 +316,20 @@ export default {
labelWidth: 56, labelWidth: 56,
type: 'input', type: 'input',
maxlength: 100 maxlength: 100
},
{
label: '手机号',
name: 'customerPhone',
labelWidth: 56,
type: 'input',
maxlength: 11
},
{
label: '推荐人手机号',
name: 'shareStaffPhone',
labelWidth: 56,
type: 'input',
maxlength: 11
} }
], ],
// 快递信息 // 快递信息
...@@ -493,19 +511,29 @@ export default { ...@@ -493,19 +511,29 @@ export default {
tableOption: true, tableOption: true,
tableColumns: [ tableColumns: [
{ {
label: '订单编号', label: '客户名称',
prop: 'orderCode', prop: 'customerName',
width: '180' line: 2,
width: 180,
formatter: cellValue => {
return cellValue.customerName || '-'
}
}, },
{ {
label: '商户订单号', label: '手机号',
prop: 'outTradeNo', prop: 'customerPhone',
width: '160', width: 130,
formatter: cellValue => { formatter: cellValue => {
return cellValue.outTradeNo || '-' return cellValue.customerPhone || '-'
} }
}, },
{ {
label: '微信名称',
prop: 'weChatName',
addHtml: 'weChatName',
width: 300
},
{
label: '订单时间', label: '订单时间',
prop: 'createdDate', prop: 'createdDate',
width: '180', width: '180',
...@@ -530,29 +558,6 @@ export default { ...@@ -530,29 +558,6 @@ export default {
} }
}, },
{ {
label: '微信名称',
prop: 'weChatName',
addHtml: 'weChatName',
width: 300
},
{
label: '客户名称',
prop: 'customerName',
line: 2,
width: 180,
formatter: cellValue => {
return cellValue.customerName || '-'
}
},
{
label: '手机号',
prop: 'customerPhone',
width: 130,
formatter: cellValue => {
return cellValue.customerPhone || '-'
}
},
{
label: '车架号', label: '车架号',
prop: 'vinNo', prop: 'vinNo',
width: 130, width: 130,
...@@ -595,6 +600,12 @@ export default { ...@@ -595,6 +600,12 @@ export default {
} }
}, },
{ {
label: '其他信息',
prop: 'otherInformation',
width: '280',
line: 1
},
{
label: '活动名称', label: '活动名称',
prop: 'activityName', prop: 'activityName',
width: '120' width: '120'
...@@ -628,6 +639,19 @@ export default { ...@@ -628,6 +639,19 @@ export default {
formatter: cellValue => { formatter: cellValue => {
return this.baseData.deliveryTypeList.map(item => item.confId).includes(cellValue.deliveryType + '') ? this.baseData.deliveryTypeList.find(item => item.confId == cellValue.deliveryType).confName : '-' return this.baseData.deliveryTypeList.map(item => item.confId).includes(cellValue.deliveryType + '') ? this.baseData.deliveryTypeList.find(item => item.confId == cellValue.deliveryType).confName : '-'
} }
},
{
label: '订单编号',
prop: 'orderCode',
width: '180'
},
{
label: '商户订单号',
prop: 'outTradeNo',
width: '160',
formatter: cellValue => {
return cellValue.outTradeNo || '-'
}
} }
] ]
}, },
...@@ -652,10 +676,12 @@ export default { ...@@ -652,10 +676,12 @@ export default {
} }
} }
}, },
mounted() { mounted() {
// this.getCount() // this.getCount()
this.getOptionsList('searchFormData') this.getOptionsList('searchFormData')
}, },
methods: { methods: {
getParams() { getParams() {
var params = JSON.parse(JSON.stringify(this.searchForm)) var params = JSON.parse(JSON.stringify(this.searchForm))
...@@ -670,6 +696,7 @@ export default { ...@@ -670,6 +696,7 @@ export default {
delete params.createDate delete params.createDate
return params return params
}, },
beforeSearchFn() { beforeSearchFn() {
return new Promise(resolve => { return new Promise(resolve => {
this.tableSearchForm = this.getParams() this.tableSearchForm = this.getParams()
...@@ -677,6 +704,7 @@ export default { ...@@ -677,6 +704,7 @@ export default {
resolve() resolve()
}) })
}, },
getOptionsList(formName, hasAll = true, refreshSigle) { getOptionsList(formName, hasAll = true, refreshSigle) {
if (refreshSigle) { if (refreshSigle) {
var item = this[formName].find(k => k.name == refreshSigle) var item = this[formName].find(k => k.name == refreshSigle)
...@@ -702,6 +730,7 @@ export default { ...@@ -702,6 +730,7 @@ export default {
}) })
} }
}, },
secondConfirm(title, txt, apiModule, apiName, apiParams, fn) { secondConfirm(title, txt, apiModule, apiName, apiParams, fn) {
this.$confirm(txt, title, { this.$confirm(txt, title, {
confirmButtonText: '确定', confirmButtonText: '确定',
...@@ -723,6 +752,7 @@ export default { ...@@ -723,6 +752,7 @@ export default {
} }
}) })
}, },
getCount() { getCount() {
var params = this.getParams() var params = this.getParams()
delete params.createDate delete params.createDate
...@@ -730,6 +760,7 @@ export default { ...@@ -730,6 +760,7 @@ export default {
this.statisticsInfo = res || { orderCount: '', payPriceTotal: '', refundTotal: '' } this.statisticsInfo = res || { orderCount: '', payPriceTotal: '', refundTotal: '' }
}) })
}, },
handleDetail(row) { handleDetail(row) {
this.$router.push({ this.$router.push({
path: '/orderManage/orderDetail', path: '/orderManage/orderDetail',
...@@ -738,6 +769,7 @@ export default { ...@@ -738,6 +769,7 @@ export default {
} }
}) })
}, },
// 输入快递信息 - start // 输入快递信息 - start
handleExpressClose() { handleExpressClose() {
this.isExpressVisible = !this.isExpressVisible this.isExpressVisible = !this.isExpressVisible
...@@ -747,6 +779,7 @@ export default { ...@@ -747,6 +779,7 @@ export default {
deliveryNumber: '' deliveryNumber: ''
} }
}, },
handleExpressConfirm() { handleExpressConfirm() {
this.$refs.expressRef.$refs[this.editChildRef].validate(valid => { this.$refs.expressRef.$refs[this.editChildRef].validate(valid => {
if (valid) { if (valid) {
...@@ -766,11 +799,13 @@ export default { ...@@ -766,11 +799,13 @@ export default {
} }
}) })
}, },
handleExpressInfo(row) { handleExpressInfo(row) {
this.isExpressVisible = !this.isExpressVisible this.isExpressVisible = !this.isExpressVisible
this.orderCode = row.orderCode this.orderCode = row.orderCode
}, },
// 输入快递信息 - end // 输入快递信息 - end
// 订单核销 - start // 订单核销 - start
handleWriteOffClose() { handleWriteOffClose() {
this.isWriteOffVisible = !this.isWriteOffVisible this.isWriteOffVisible = !this.isWriteOffVisible
...@@ -779,6 +814,7 @@ export default { ...@@ -779,6 +814,7 @@ export default {
verificationCode: '' verificationCode: ''
} }
}, },
handleWriteOffConfirm() { handleWriteOffConfirm() {
this.$refs.writeOffRef.$refs[this.editChildRef].validate(valid => { this.$refs.writeOffRef.$refs[this.editChildRef].validate(valid => {
if (valid) { if (valid) {
...@@ -798,6 +834,7 @@ export default { ...@@ -798,6 +834,7 @@ export default {
} }
}) })
}, },
handleWriteOff(row) { handleWriteOff(row) {
if (row.orderSource == 4) { if (row.orderSource == 4) {
this.secondConfirm('订单核销', '请确定是否核销此订单?', 'orderManage', 'crowdFundWriteOffApi', { orderCode: row.orderCode }) this.secondConfirm('订单核销', '请确定是否核销此订单?', 'orderManage', 'crowdFundWriteOffApi', { orderCode: row.orderCode })
...@@ -807,6 +844,7 @@ export default { ...@@ -807,6 +844,7 @@ export default {
this.orderCode = row.orderCode this.orderCode = row.orderCode
}, },
// 订单核销 - end // 订单核销 - end
// 退款审核 - start // 退款审核 - start
handleExamineClose() { handleExamineClose() {
this.isExamineVisible = !this.isExamineVisible this.isExamineVisible = !this.isExamineVisible
...@@ -819,6 +857,7 @@ export default { ...@@ -819,6 +857,7 @@ export default {
contactPhone: '' contactPhone: ''
} }
}, },
submitExamine(params) { submitExamine(params) {
this.$apis.orderManage.examineAllowApi(params).then(res => { this.$apis.orderManage.examineAllowApi(params).then(res => {
this.$message({ this.$message({
...@@ -832,6 +871,7 @@ export default { ...@@ -832,6 +871,7 @@ export default {
} }
}) })
}, },
handleExamineConfirm() { handleExamineConfirm() {
var params = { var params = {
id: this.orderInfo.id id: this.orderInfo.id
...@@ -850,6 +890,7 @@ export default { ...@@ -850,6 +890,7 @@ export default {
this.submitExamine(params) this.submitExamine(params)
} }
}, },
handleExamine(row) { handleExamine(row) {
this.orderCode = row.orderCode this.orderCode = row.orderCode
this.$apis.orderManage.examineDetailApi({ orderCode: row.orderCode }).then(res => { this.$apis.orderManage.examineDetailApi({ orderCode: row.orderCode }).then(res => {
...@@ -860,12 +901,14 @@ export default { ...@@ -860,12 +901,14 @@ export default {
}) })
}, },
// 退款审核 - end // 退款审核 - end
// 确认收货 - start // 确认收货 - start
handleReceivingClose() { handleReceivingClose() {
this.isReceivingVisible = !this.isReceivingVisible this.isReceivingVisible = !this.isReceivingVisible
this.orderCode = '' this.orderCode = ''
this.orderInfo = {} this.orderInfo = {}
}, },
handleReceivingConfirm() { handleReceivingConfirm() {
var params = { var params = {
id: this.orderInfo.id id: this.orderInfo.id
...@@ -882,6 +925,7 @@ export default { ...@@ -882,6 +925,7 @@ export default {
} }
}) })
}, },
handleReceiving(row) { handleReceiving(row) {
this.$apis.orderManage.examineDetailApi({ orderCode: row.orderCode }).then(res => { this.$apis.orderManage.examineDetailApi({ orderCode: row.orderCode }).then(res => {
this.orderInfo = res || {} this.orderInfo = res || {}
...@@ -891,6 +935,7 @@ export default { ...@@ -891,6 +935,7 @@ export default {
}) })
}, },
// 确认收货 - end // 确认收货 - end
setTableFinishFun() { setTableFinishFun() {
this.$refs.allOrderRef.data.forEach(item => { this.$refs.allOrderRef.data.forEach(item => {
item.vinNo = item.vin ? (item.vin.split(',').length > 1 ? item.vin.split(',') : item.vin) : '-' item.vinNo = item.vin ? (item.vin.split(',').length > 1 ? item.vin.split(',') : item.vin) : '-'
...@@ -899,18 +944,22 @@ export default { ...@@ -899,18 +944,22 @@ export default {
this.$refs.allOrderRef.data.length ? (this.$refs.allOrderRef.tableHeightValues = '') : this.$refs.allOrderRef.setTableHeightFun() this.$refs.allOrderRef.data.length ? (this.$refs.allOrderRef.tableHeightValues = '') : this.$refs.allOrderRef.setTableHeightFun()
this.getCount() this.getCount()
}, },
handleSearch() { handleSearch() {
this.$refs.allOrderRef.refreshTable() this.$refs.allOrderRef.refreshTable()
}, },
handleTabClick() { handleTabClick() {
this.handleSearch() this.handleSearch()
}, },
handleExport(row) { handleExport(row) {
var params = this.getParams() var params = this.getParams()
this.$apis.orderManage.orderExportApi(params).then(res => { this.$apis.orderManage.orderExportApi(params).then(res => {
exportFn(res) exportFn(res)
}) })
}, },
handleReset() { handleReset() {
this.searchForm = { this.searchForm = {
orderCode: '', orderCode: '',
...@@ -932,6 +981,7 @@ export default { ...@@ -932,6 +981,7 @@ export default {
} }
} }
</script> </script>
<style lang="scss"> <style lang="scss">
.order-table-popover { .order-table-popover {
min-width: 80px !important; min-width: 80px !important;
...@@ -957,4 +1007,4 @@ export default { ...@@ -957,4 +1007,4 @@ export default {
color: #5092ff; color: #5092ff;
} }
} }
</style>
\ No newline at end of file \ No newline at end of file
</style>
<template>
<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.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.activityVideoList.length" class="wechat-video" controls>
<source :src="editForm.activityVideoList[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 && 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">{{ 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" />
</div>
<div v-html="editForm.activityDetail"></div>
</div>
</div>
<img class="wechat-footer" src="@/assets/seckillActivity/crowd-footer.png" />
</div>
</div>
</template>
<script>
export default {
name: 'crowdEditWechat',
data() {
return {
// 倒计时
countDownObj: {
typeTxt: '距离活动开始',
activityStatus: 1,
d: '',
h: '',
m: '',
s: ''
},
}
},
props: {
editForm: {
type: Object,
default: () => { }
}
},
mounted() { },
methods: {
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() {
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 = {
typeTxt: '距离活动开始',
d: '',
h: '',
m: '',
s: ''
}
}
}
}
}
</script>
<style lang="scss" scoped>
.wechat-box {
width: 276px;
box-sizing: border-box;
position: relative;
margin: 0 auto;
}
.wechat-box .wechat-inner-box {
position: absolute;
top: 73px;
left: 20px;
width: 236px;
height: 424px;
background-color: #f7f8fa;
overflow-y: scroll;
overflow-x: hidden;
}
.wechat-box .wechat-footer {
position: absolute;
width: 236px;
height: 35px;
bottom: 20px;
left: 20px;
}
.wechat-box .wechat-head {
position: absolute;
width: 236px;
height: 53px;
top: 20px;
left: 20px;
}
.wechat-box .wechat-banner-img {
width: 100%;
height: 552px;
}
.wechat-box .icon-server {
position: absolute;
width: 34px;
height: 42px;
top: 320px;
right: 30px;
z-index: 999;
}
.wechat-box .wechat-banner-img img {
width: 100%;
height: 385px;
}
.wechat-box .wechat-video {
width: 160px;
height: 90px;
margin: 10px auto;
}
.wechat-box .wechat-banner-img .icon-music {
position: absolute;
width: 20px;
height: 20px;
top: 20px;
right: 10px;
}
.wechat-box .wechat-banner-img .wechat-customer {
position: absolute;
width: 100px;
height: 137px;
top: 240px;
left: 10px;
}
.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;
margin-top: 10px;
}
.wechat-txt {
color: #f13c3d;
background-color: #fff4f4;
padding: 4px;
margin: 0 4px;
}
.count-down-img {
margin-top: 10px;
width: 180px;
height: 188px;
}
}
}
.wechat-box .wechat-banner-img .crowd-jdt {
width: 205px;
height: 80px;
margin-bottom: 6px;
}
.wechat-box .wechat-name {
position: absolute;
top: 50px;
left: 58px;
width: 138px;
color: #282829;
z-index: 99;
text-align: center;
}
</style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!