Commit 5b3cc591 by chenwq

众筹

1 parent 468be9c7
......@@ -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)"></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>
......
......@@ -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) {
......@@ -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')
})
},
......
......@@ -153,9 +153,6 @@ export default {
attrs: {
type: 'text'
},
condition: row => {
return row.activityStatus == '1' || row.activityStatus == '2'
},
listeners: {
click: this.handleShare
}
......
......@@ -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
......
......@@ -6,11 +6,11 @@
<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" />
......@@ -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">
......@@ -103,7 +103,7 @@
</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>
......@@ -134,22 +134,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" />
......@@ -323,11 +324,14 @@ export default {
],
// 倒计时
countDownObj: {
typeTxt: '距离活动开始',
activityStatus: 1,
d: '',
h: '',
m: '',
s: ''
},
fileList: [],
// 基本信息
editFormData: [
{
......@@ -608,7 +612,7 @@ 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)
......@@ -659,26 +663,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 +866,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 +891,13 @@ export default {
}
},
handleMusicChange(file, targetItem) {
handleMusicBeforeUpload(file, targetItem) {
this.musicUpload(file, targetItem)
},
handleMusicDelete(targetItem) {
this.$set(this.editForm, targetItem.name, '')
this.fileList = []
},
// 表单设置
......@@ -1198,6 +1239,7 @@ export default {
line-height: 22px;
padding: 15px;
border: 1px dotted #e3e3e3;
margin-top: 10px;
}
.wechat-txt {
color: #f13c3d;
......@@ -1205,6 +1247,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 {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!