Commit 88ddcf42 by 杨明

fixed

1 parent b56215ee
......@@ -28,7 +28,7 @@
<slot :name="item.suffixSlot" :scope="item"></slot>
</div>
<div v-else-if="item.type === 'InputNumber'">
<el-input-number v-model="formObj[item.name]" @change="e => handleInputChange(e, item)" :min="formObj[item.min] || 0" :max="formObj[item.max]" label="描述文字"></el-input-number>
<el-input-number v-model="formObj[item.name]" :min="formObj[item.min] || 0" :max="formObj[item.max]" label="描述文字"></el-input-number>
</div>
<!-- 选择框 -->
<div v-else-if="item.type === 'select'">
......@@ -99,6 +99,14 @@
</template>
<slot name="footer"></slot>
</el-form>
<GLDialog v-if="isImgVisible" :appendToBody="true" bigTitle="查看" mode="big" :visible.sync="isImgVisible" :close-on-click-modal="false" @onOk="isImgVisible = false" @onCancel="isImgVisible = false">
<div class="dialog-look">
<video v-if="dialogObj.uploadType == 'video'" class="dialog-video" controls>
<source :src="dialogObj.url" type="video/mp4" />
</video>
<img v-else class="dialog-img" width="100%" :src="dialogObj.url" alt="" />
</div>
</GLDialog>
<GLDialog :appendToBody="true" bigTitle="选择地址" mode="big" :visible.sync="dialogMapVisible" @onOk="getAddress" @onCancel="dialogMapVisible = false">
<map-view v-if="dialogMapVisible" ref="mapForm"></map-view>
<!-- <span slot="footer" class="dialog-footer">
......@@ -522,4 +530,9 @@ export default {
color: #5850ff;
cursor: pointer;
}
.el-input-number__decrease:hover,
.el-input-number__decrease:hover:not(.is-disabled) ~ .el-input .el-input__inner:not(.is-disabled),
.el-input-number__increase:hover:not(.is-disabled) ~ .el-input .el-input__inner:not(.is-disabled) {
border-color: #5850ff;
}
</style>
......@@ -2,7 +2,7 @@
* @Author: yangming yangming@didihu.com.cn
* @Date: 2023-05-22 20:12:55
* @LastEditors: yangming yangming@didihu.com.cn
* @LastEditTime: 2023-05-22 20:27:53
* @LastEditTime: 2023-05-25 11:36:45
* @FilePath: \scrm-micro-home\src\utils\color.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
......@@ -12,7 +12,7 @@ var canvas = document.createElement('canvas')
var context = canvas.getContext('2d')
var myColor = []
function getColor() {
var imageData = context.getImageData(img_width - 1, img_height - 1, img_width, img_height)
var imageData = context.getImageData(img_width - 10, img_height - 10, img_width, img_height)
myColor = [imageData.data[0], imageData.data[1], imageData.data[2]]
var hexColor = gethex(...myColor)
return `#${hexColor}`
......
......@@ -2,7 +2,7 @@
* @Author: yangming yangming@didihu.com.cn
* @Date: 2023-05-16 10:23:52
* @LastEditors: yangming yangming@didihu.com.cn
* @LastEditTime: 2023-05-24 15:30:15
* @LastEditTime: 2023-05-25 16:24:02
* @FilePath: \scrm-micro-home\src\views\home\components\Marketing\GPTAnalysis.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
......@@ -115,6 +115,7 @@
<img class="server-type" :src="require(`@/assets/img/coupon/equity.png`)" />
<div class="gift-content">
<div class="gift-item" v-for="(subItem, subIndex) in selectedEquityList" :key="subIndex">
<span class="circle"></span>
<p :class="['gift-coupon-name']">{{ subItem.packageName }}</p>
<i class="el-icon-delete" style="color: #c6c6c6" @click="handleEquityDelete(subIndex)"></i>
</div>
......@@ -203,8 +204,8 @@ export default {
name: 'analysis',
data() {
return {
mainColor: '',
editChildRef: 'editChildRef',
logoInfo: '',
importNum: 0,
couponTemplateList: [],
orderShow,
......@@ -289,7 +290,7 @@ export default {
suffixSlot: 'detailImage',
handleUpload: (e, file, targetItem) => {
getUploadImgColor(file, color => {
this.mainColor = color
this.editForm.mainColor = color
})
const imgFile = e.target.result
const base64 = file.name.split('.')[file.name.split('.').length - 1] + '@' + imgFile.split(',')[1]
......@@ -374,7 +375,6 @@ export default {
name: 'merchantLog',
type: 'upload',
width: '320px',
tips: '进入活动页的图片',
mark: '建议尺寸:最大1M,尺寸216*60',
style: 'color: #999999;',
limitSize: 5,
......@@ -416,20 +416,21 @@ export default {
...mapState('marketing', ['activityInfo', 'GPTList', 'merchantInfo']),
mergeStr() {
const { backgroundImage, detailImage, merchantLog } = this.editForm
if (!backgroundImage || !detailImage || !merchantLog) return
return backgroundImage + detailImage + merchantLog
return [backgroundImage, detailImage, merchantLog]
}
},
watch: {
activityInfo(val) {
val && this.confirmMsg(val)
},
//监听主图、内容图、logo
mergeStr(val) {
if (val) {
if (val && val.every(item=>item)) {
this.getMergeImgs()
} else {
this.bigImage = null
this.editForm.bigImage = null
}
console.log(this.editForm.bigImage)
}
},
components: {
......@@ -505,14 +506,22 @@ export default {
uploadImg(imgFile) {
const base64 = 'png' + '@' + imgFile.split(',')[1]
this.$apis.common.pictureUpload({ file: base64, fileType: 'image' }).then(res => {
this.bigImage = res
this.editForm.bigImage = res
})
},
//主图、内容图、logo合并图片
async getMergeImgs() {
const { backgroundImage, detailImage, merchantLog } = this.editForm
try {
const res = await Promise.all([this.getImgWH(backgroundImage), this.getImgWH(detailImage), this.getImgWH(merchantLog)])
const h = (res[0].dh / res[0].dw) * 375 + (res[1].dh / res[1].dw) * 375
this.logoInfo = {
imgSrc: merchantLog,
x: 375 - res[2].dw/2 - 20,
y: 20,
width: res[2].dw / 2,
height: res[2].dh / 2
}
const draw = new Drawing(
{
width: 375,
......@@ -533,13 +542,7 @@ export default {
width: 375,
height: (res[1].dh / res[1].dw) * 375
},
{
imgSrc: merchantLog,
x: 375 - res[2].dw - 20,
y: 20,
width: res[2].dw / 2,
height: res[2].dh / 2
}
{ ...this.logoInfo }
],
base64 => {
this.uploadImg(base64)
......@@ -669,7 +672,7 @@ export default {
},
getViewParams() {
const prams = this.getCouponInfoParams()
return { ...prams, selectedEquityList: this.selectedEquityList, couponList: this.editForm.superMarketingCouponRelRequestList, selectedGoodsList: this.selectedGoodsList }
return { ...prams, selectedEquityList: this.selectedEquityList, couponList: this.editForm.superMarketingCouponRelRequestList, selectedGoodsList: this.selectedGoodsList, logoInfo: this.logoInfo,bigImage:this.editForm.bigImage }
},
getCouponInfoParams() {
var param = this.$common.utils.deepClone(this.editForm)
......@@ -697,7 +700,6 @@ export default {
const equityServices = this.selectedEquityList.map(i => i.packageCode)
param.equityServices = equityServices.join(',')
param.importCustomersUrl = this.exportUrl
param.bigImage = this.bigImage
param.superMarketingCouponRelRequestList = couponLists.concat(selectedGoodsList) || []
delete param.createdTime
delete param.activityCouponBaseInfoDTOS
......@@ -740,13 +742,13 @@ export default {
this.selectedGoodsList = couponItemList
this.selectedGoodsList.forEach(item => {
item.id = item.couponId
item.denomination = item.couponAnticipatedCost
})
})
},
// isGetList =true 创建成功初始化
init(isGetList = true) {
isGetList && this.setSchemeListData({ merchantId: this.editForm.merchantId, pageSize: 5, currentPage: 1 })
this.editForm = { marketingTitle: '', marketingSubtitle: '', activityTime: [], superMarketingCouponRelRequestList: [], backgroundImage: '', detailImage: '', merchantLog: '', merchantname: this.merchantInfo.merchantName, merchantAddress: this.merchantInfo.merchantAddress, merchantId: this.merchantInfo.merchantNo }
this.editForm = { mainColor: '', marketingTitle: '', bigImage: '', marketingSubtitle: '', activityTime: [], superMarketingCouponRelRequestList: [], backgroundImage: '', detailImage: '', merchantLog: '', merchantname: this.merchantInfo.merchantName, merchantAddress: this.merchantInfo.merchantAddress, merchantId: this.merchantInfo.merchantNo }
this.selectedGoodsList = []
this.selectedEquityList = []
this.exportUrl = ''
......@@ -830,19 +832,23 @@ export default {
.catch(() => {
this.setActivityInfo()
})
},
// 未开通不显示
equityMerchant() {
var params = {
merchantId: this.$globalState.session.merchantId
}
this.$apis.giftBag.equityMerchant(params).then(res => {
if (res.packageConfigs && res.packageConfigs) {
this.setNameHide('editFormData', ['equityList', 'equityListBlock'], false)
}
})
}
},
mounted() {
this.couponTemplate()
this.init(false)
var params = {
merchantId: this.$globalState.session.merchantId
}
this.$apis.giftBag.equityMerchant(params).then(res => {
if (res.packageConfigs && res.packageConfigs) {
this.setNameHide('editFormData', ['equityList', 'equityListBlock'], false)
}
})
this.equityMerchant()
}
}
</script>
......@@ -941,6 +947,7 @@ export default {
width: calc(100% - 70px);
border-bottom: 1px solid #e5e5e5;
line-height: 22px;
padding-left: 10px;
.gift-item {
display: inline-block;
width: 50%;
......
......@@ -2,45 +2,69 @@
* @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2023-05-15 15:08:32
* @LastEditors: yangming yangming@didihu.com.cn
* @LastEditTime: 2023-05-24 15:46:24
* @LastEditTime: 2023-05-25 16:24:16
* @FilePath: \scrm-micro-home\src\views\home\components\Marketing\MarketingRight.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
<div class="review-box">
<div class="review-title">预览营销方案</div>
<phone-view :activityInfo="activityInfo"></phone-view>
<phone-view :activityInfo="activityDetail"></phone-view>
<div class="review-refresh" @click="renewImg">更新预览图</div>
</div>
</template>
<script>
import PhoneView from './PhoneView'
import { mapState } from 'vuex'
export default {
data() {
return {
activityInfo: {}
activityDetail: {},
getComponent: ''
}
},
mounted() {
setTimeout(() => {
let children = this.$parent.$children
this.findComponent(children)
}, 300)
},
components: {
PhoneView
},
computed: {
...mapState('marketing', ['activityInfo']),
imgArr() {
const { backgroundImage, detailImage, merchantLog, mainColor, logoInfo,bigImage } = this.getComponent && this.getComponent.getViewParams()
return [backgroundImage, detailImage, merchantLog, mainColor, logoInfo,bigImage]
}
},
watch: {
imgArr(val) {
const [backgroundImage = '', detailImage = '', merchantLog = '', mainColor, logoInfo,bigImage] = val
this.activityDetail = { ...this.activityDetail, ...{ backgroundImage, detailImage, merchantLog, mainColor, logoInfo,bigImage } }
console.log(this.activityDetail)
},
activityInfo(val) {
this.activityDetail = {}
console.log(this.activityDetail)
}
},
methods: {
renewImg() {
const _this = this
let children = this.$parent.$children
findComponent(children)
function findComponent(children) {
for (let i = 0; i < children.length; i++) {
if (children[i].$options.componentsName == 'analysis') {
_this.activityInfo = children[i].getViewParams()
console.log(_this.activityInfo)
return
}
if (children[i].$children) {
findComponent(children[i].$children)
}
findComponent(children) {
for (let i = 0; i < children.length; i++) {
if (children[i].$options.componentsName == 'analysis') {
this.getComponent = children[i]
return
}
if (children[i].$children) {
this.findComponent(children[i].$children)
}
}
},
renewImg() {
this.activityDetail = this.getComponent.getViewParams()
console.log(this.activityDetail)
}
}
}
......
......@@ -2,7 +2,7 @@
* @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2023-05-15 15:08:32
* @LastEditors: yangming yangming@didihu.com.cn
* @LastEditTime: 2023-05-24 15:48:19
* @LastEditTime: 2023-05-25 16:22:34
* @FilePath: \scrm-micro-home\src\views\home\components\Marketing\MarketingRight.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
......@@ -13,20 +13,24 @@
<div class="review-title_top">{{ detail.marketingTitle || detail.activityName }}</div>
<div class="review-content">
<div class="review-main">
<div class="review-bg-img">
<img :src="detail.activityBigImg" v-if="detail.activityBigImg" />
</div>
<div class="review-bg-img">
<img :src="detail.backgroundImage" v-if="detail.backgroundImage" />
</div>
<div class="review-main-img">
<img :src="detail.detailImage" v-if="detail.detailImage" />
</div>
<div class="review-logo-img">
<img :src="detail.merchantLog" v-if="detail.merchantLog" />
</div>
<template v-if="detail.activityBigImg || detail.bigImage">
<div class="review-bg-img">
<img :src="detail.activityBigImg || detail.bigImage" />
</div>
</template>
<template v-else>
<div class="review-bg-img">
<img :src="detail.backgroundImage" v-if="detail.backgroundImage" />
</div>
<div class="review-main-img">
<img :src="detail.detailImage" v-if="detail.detailImage" />
</div>
<div class="review-logo-img" :style="{ height: logoInfo.height + 'px', width: logoInfo.width + 'px', top: logoInfo.y + 'px', left: logoInfo.x + 'px' }">
<img :src="detail.merchantLog" v-if="detail.merchantLog" />
</div>
</template>
</div>
<div class="review-package">
<div class="review-package" :style="{ background: activityInfo.mainColor }">
<div class="review-equity" v-if="detail.selectedEquityList && detail.selectedEquityList.length">
<div class="service-item" v-for="(item, index) in detail.selectedEquityList" :key="index">
<div class="service-time">1年</div>
......@@ -35,7 +39,6 @@
</div>
<div class="review-goods" v-if="detail.selectedGoodsList && detail.selectedGoodsList.length">
<div class="goods-item" v-for="(item, index) in detail.selectedGoodsList" :key="index">
<div class="service-logo"></div>
<div class="service-desc">
<div class="title">{{ item.brandName }}{{ item.goodsName }}</div>
<div class="content">x{{ item.couponAmount }} 抵扣券</div>
......@@ -83,7 +86,7 @@
</div>
</div>
</div>
<div class="review-footer" v-if="detail.activityPrice">
<div class="review-footer" v-if="!isNaN(detail.activityPrice)">
<label>¥</label>
{{ (detail.activityPrice / 100).toFixed(2) }}
</div>
......@@ -99,6 +102,7 @@ export default {
data() {
return {
detail: {},
logoInfo: {},
discount: {
2: '折扣券',
3: '代金券',
......@@ -124,6 +128,14 @@ export default {
activityInfo: {
handler(val) {
this.detail = val
if(!this.detail.logoInfo)return
const { x, y, height, width } = this.detail.logoInfo
this.logoInfo = {
x: (x * 262) / 375,
y: (y * 262) / 375,
height: (height * 262) / 375,
width: (width * 262) / 375
}
},
deep: true,
immediate: true
......@@ -142,11 +154,12 @@ export default {
}
.review-title_top {
position: absolute;
top: 38px;
top: 44px;
left: 0px;
width: 100%;
text-align: center;
line-height: 40px;
font-size: 14px;
}
.review-footer {
position: absolute;
......@@ -176,13 +189,12 @@ export default {
}
}
.review-package {
background: #ddd8c0;
padding: 16px;
.review-equity,
.review-service,
.review-goods {
background: #ffffff;
border-radius: 12px;
border-radius: 6px;
padding: 10px;
margin-bottom: 10px;
}
......@@ -273,7 +285,7 @@ export default {
}
.service-desc {
width: 55%;
width: 65%;
.title {
font-size: 12px;
color: #111111;
......@@ -303,7 +315,7 @@ export default {
width: 100%;
height: 32px;
background: rgba(255, 255, 255, 0.8);
border-radius: 8px 8px 0 0;
border-radius: 6px 6px 0 0;
padding: 0px 10px;
box-sizing: border-box;
}
......@@ -325,6 +337,7 @@ export default {
display: flex;
padding: 10px;
background: #ffffff;
border-radius: 0 0 6px 6px;
.store {
font-weight: 500;
font-size: 14px;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!