Commit 4853b3d2 by 前端

Merge branch 'v3.23.0' into 'master'

V3.23.0

See merge request !10
2 parents 66bfe157 f6d4548c
<template>
<div class="activity-img-box">
<template v-if="imageUrlArr && imageUrlArr.length > 0">
<div v-for="(item, index) in imageUrlArr" :key="index">
<div class="pic-box" :style="{ width: picOptions.width, height: picOptions.height }">
<img class="photo-activity" :src="item" alt="" />
<div class="mask" :style="{ width: picOptions.width, height: picOptions.height }">
<div class="pic-pane-close" @click="handleEnlarge(item)">
<img src="../../assets/images/view.png" alt="" />
</div>
<template v-if="picOptions.isClose">
<div class="pic-pane-close" @click="close('img', index)">
<img src="../../assets/images/dele.png" alt="" />
</div>
</template>
</div>
</div>
</div>
</template>
<template v-if="(imageUrlArr && imageUrlArr.length < 9 && limit > 1) || (imageUrlArr&&imageUrlArr.length == 0 && limit == 1)">
<div class="upload-img">
<i class="el-icon-plus avatar-uploader-desc-icon"></i>
<div class="avatar-uploader-desc-word">上传照片</div>
<input type="file" ref="uploadImg" class="upload-img" style="opacity: 0" accept=".jpg, .jpeg, .png" @change="e => handleImgChange(e)" />
</div>
</template>
<el-dialog class="image-dialog" :visible.sync="dialogVisibleImg" width="50%">
<img :src="dialogSrc" width="100%" v-if="dialogType == 'img'" />
<!-- <video width="100%" autoplay controls :src="dialogSrc" v-else></video> -->
</el-dialog>
</div>
</template>
<script>
export default {
props: {
picOptions: {
type: Object,
default: () => {
return {
width: '104px',
height: '104px',
isClose: true
}
}
},
imageUrlArr: {
type: Array,
default: () => []
},
limit: {
type: String,
default: '1'
},
index: {
type: Number,
default: -1
}
},
data() {
return {
dialogVisibleImg: false
}
},
methods: {
// 上传图片
handleImgChange(e) {
this.$notify({
title: '提示',
message: '图片上传中,请稍后'
})
var file = e.srcElement.files[0]
var reader = new FileReader()
// 默认1MB
const limitSize = 10
const isLt = file.size / 1024 / 1024 < limitSize
if (!isLt) {
this.$message.error('上传图片大小不能超过' + limitSize + 'MB!')
return true
}
if (this.imageUrlArr.length > 9) {
this.$message.error('最多上传9张图片')
return
}
reader.readAsDataURL(file)
reader.onload = e => {
const imgFile = e.target.result
const arrBase64 = imgFile.split(',')
const splitStr = file.name.split('.')
const fileUrl = splitStr[splitStr.length - 1] + '@' + arrBase64[1]
this.$apis.common.pictureUpload({ file: fileUrl, compress: this.picOptions.compress || 0 }).then(res => {
if (res) {
this.$notify({
title: '提示',
message: '图片上传成功',
type: 'success'
})
this.imageUrlArr.push(res)
this.$emit('change', { arr: this.imageUrlArr, key: this.picOptions.key, index: this.index })
}
e.target.value = ''
this.$refs.uploadImg.value = ''
})
}
},
// 预览图文
handleEnlarge(src, type) {
this.dialogVisibleImg = true
this.dialogSrc = src
this.dialogType = type ? type : 'img'
},
// 删除图片/视频
close(type, index) {
switch (type) {
case 'radio':
this.videoUrl = ''
this.videoImage = ''
break
case 'img':
this.imageUrlArr.splice(index, 1)
this.$emit('change', { arr: this.imageUrlArr, key: this.picOptions.key, id: 1, index: this.index })
break
default:
this.videoUrl = ''
}
}
}
}
</script>
<style scoped lang="scss">
.activity-img-box {
display: flex;
flex-wrap: wrap;
max-width: 600px;
.pic-box {
position: relative;
width: 104px;
height: 104px;
border-radius: 4px;
margin-right: 8px;
margin-bottom: 5px;
&:hover .mask {
opacity: 1;
}
.pic {
position: absolute;
object-fit: fill;
}
.photo-activity {
position: absolute;
width: 100%;
height: 100%;
}
.mask {
display: flex;
align-items: center;
justify-content: center;
position: absolute;
background: rgba(0, 0, 0, 0.5);
color: #ffffff;
opacity: 0;
top: 0;
right: 0;
width: 104px;
height: 104px;
z-index: 999;
.pic-pane-close {
width: 16px;
height: 16px;
cursor: pointer;
margin-left: 24px;
&:first-child{
margin-left: 0;
}
img{
width:100%;
display: block;
}
}
}
}
.upload-img {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
width: 104px;
height: 104px;
background: rgba(0, 0, 0, 0.04);
border: 1px dashed rgba(0, 0, 0, 0.15);
border-radius: 4px;
input {
position: absolute;
// top: 0;
// left: 0;
width: 104px;
height: 104px;
}
}
.avatar-uploader-desc-word {
font-weight: 400;
font-size: 28rpx;
color: #666666;
}
.image-dialog {
/deep/ {
.el-dialog__header {
border-bottom: 0px;
padding: 0px;
}
}
}
}
</style>
\ No newline at end of file \ No newline at end of file
...@@ -29,7 +29,10 @@ Vue.use(GLTableButton) ...@@ -29,7 +29,10 @@ Vue.use(GLTableButton)
Vue.use(GLDialog) Vue.use(GLDialog)
export async function bootstrap({ history, common, messenger, globalState, routerBase }) { export async function bootstrap({ history, common, messenger, globalState, routerBase }) {
const { response, request, request2, sign, secret, sign_common, request_common, request_merchant, merchantId } = await fetchConfig(false) const { response, request, request2, sign, secret, sign_common, request_common, request_merchant, merchantId,wuye_merchantLists } = await fetchConfig(false)
// 针对物业门店
Vue.prototype.$wuye_merchantLists = wuye_merchantLists
Vue.prototype.$history = history Vue.prototype.$history = history
Vue.prototype.$messenger = messenger Vue.prototype.$messenger = messenger
Vue.prototype.$globalState = globalState Vue.prototype.$globalState = globalState
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
<div class="home-set microStore edit-box"> <div class="home-set microStore edit-box">
<div class="container edit-container"> <div class="container edit-container">
<div class="home-set-form flex-grow"> <div class="home-set-form flex-grow">
<div class="item-box" v-for="(item, index) in externalFormList" :key="index"> <div class="item-box" v-for="(item, index) in externalFormList" :key="index">
<p class="edit-title">{{ item.title }}</p> <p class="edit-title">{{ item.title }}</p>
<div class="flex pad-32"> <div class="flex pad-32">
...@@ -13,6 +14,15 @@ ...@@ -13,6 +14,15 @@
</p> </p>
<el-button type="text" @click="handleImgDown(editForm[scope.scope.name])">下载图片</el-button> <el-button type="text" @click="handleImgDown(editForm[scope.scope.name])">下载图片</el-button>
</div> </div>
<div slot="welfareGroupQRCodeSlot">
<glsx-preview :picOptions="item.editFormData.posterOptions" :imageUrlArr="editForm.welfareGroupQRCode"
@change="changeChannelImg"></glsx-preview>
</div>
<div slot="welfareOfficerQRCodeSlot">
<glsx-preview :picOptions="item.editFormData.posterOptions1" :imageUrlArr="editForm.welfareOfficerQRCode"
@change="changeChannelImg"></glsx-preview>
</div>
<template slot="bannerList" slot-scope="scope"> <template slot="bannerList" slot-scope="scope">
<div class="banner-box"> <div class="banner-box">
<el-button type="primary" plain class="add-banner-btn" :size="size" @click="handleBannerAdd">新增banner</el-button> <el-button type="primary" plain class="add-banner-btn" :size="size" @click="handleBannerAdd">新增banner</el-button>
...@@ -237,10 +247,16 @@ ...@@ -237,10 +247,16 @@
</div> </div>
</template> </template>
<script> <script>
import preview from '@/components/preview'
export default { export default {
name: 'homeSet', name: 'homeSet',
components: {
glsxPreview: preview,
},
data() { data() {
return { return {
isWuyeFlag:false,
showGh: false, showGh: false,
size: 'small', size: 'small',
userInfo: {}, userInfo: {},
...@@ -320,7 +336,12 @@ export default { ...@@ -320,7 +336,12 @@ export default {
bannerMerchantList: [], bannerMerchantList: [],
noticeMerchantList: [], noticeMerchantList: [],
customerServerType: '', customerServerType: '',
customerServerUrl: '' customerServerUrl: '',
posterOptions:'',
welfareGroupQRCode: [],
posterOptions1:'',
welfareOfficerQRCode:[],
}, },
bannerItem: { bannerItem: {
bannerImg: '', bannerImg: '',
...@@ -352,7 +373,19 @@ export default { ...@@ -352,7 +373,19 @@ export default {
// label: '', // label: '',
name: 'merchantQrcode', name: 'merchantQrcode',
addHtml: 'merchantQrcode' addHtml: 'merchantQrcode'
} },
{
label: '福利群群码',
name: 'welfareGroupQRCode',
addHtml: 'welfareGroupQRCodeSlot',
// isHide:this.isWuyeFlag
},
{
label: '福利官二维码',
name: 'welfareOfficerQRCode',
addHtml: 'welfareOfficerQRCodeSlot',
// isHide:this.isWuyeFlag
},
] ]
}, },
{ {
...@@ -495,6 +528,13 @@ export default { ...@@ -495,6 +528,13 @@ export default {
}, },
mounted() { mounted() {
this.userInfo = this.$globalState.session this.userInfo = this.$globalState.session
// 判断当前的门店是不是物业门店
console.log(this.$wuye_merchantLists)
console.log(this.userInfo.merchantId)
this.isWuyeFlag = this.$wuye_merchantLists.some(item => item == this.userInfo.merchantId);
// 如果不是物业门店 隐藏福利二维码
this.updateExternalFormList();
this.getInfo() this.getInfo()
this.getConsultant() this.getConsultant()
// 非集团账号隐藏配置门店 // 非集团账号隐藏配置门店
...@@ -511,6 +551,18 @@ export default { ...@@ -511,6 +551,18 @@ export default {
if (this.showGh) this.suggestSize = '686*300px' if (this.showGh) this.suggestSize = '686*300px'
}, },
methods: { methods: {
updateExternalFormList() {
this.externalFormList.forEach(item => {
if (item.title == '门店小程序码'){
item.editFormData.forEach(formItem => {
if (formItem.name === 'welfareGroupQRCode' || formItem.name === 'welfareOfficerQRCode') {
formItem.isHide = !this.isWuyeFlag;
console.log(!this.isWuyeFlag)
}
});
}
});
},
handleServerUrlChange(value) { handleServerUrlChange(value) {
this.editForm.customerServerType = value ? 2 : '' this.editForm.customerServerType = value ? 2 : ''
this.freshFlag = new Date() this.freshFlag = new Date()
...@@ -552,6 +604,11 @@ export default { ...@@ -552,6 +604,11 @@ export default {
this.editForm.customerServerUrl = res.customerServerUrl this.editForm.customerServerUrl = res.customerServerUrl
this.editForm.bannerToSubMerchant = res.bannerToSubMerchant || 'N' this.editForm.bannerToSubMerchant = res.bannerToSubMerchant || 'N'
this.editForm.noticeToSubMerchant = res.noticeToSubMerchant || 'N' this.editForm.noticeToSubMerchant = res.noticeToSubMerchant || 'N'
// 本次新增福利二维码
this.editForm.welfareGroupQRCode = res?.welfareGroupQRCode?.split() || []
this.editForm.welfareOfficerQRCode = res?.welfareOfficerQRCode?.split() || []
// 在线客服 // 在线客服
this.customerServerList = [] this.customerServerList = []
if (res.customerServerUserId) { if (res.customerServerUserId) {
...@@ -832,6 +889,9 @@ export default { ...@@ -832,6 +889,9 @@ export default {
// 在线客服-end // 在线客服-end
handleConfirm() { handleConfirm() {
var params = this.$common.utils.deepClone(this.editForm) var params = this.$common.utils.deepClone(this.editForm)
console.log(params)
params.welfareGroupQRCode = params.welfareGroupQRCode.join()
params.welfareOfficerQRCode = params.welfareOfficerQRCode.join()
params.bannerList = [] params.bannerList = []
let flag = true let flag = true
this.editForm.bannerList.forEach((item, idx) => { this.editForm.bannerList.forEach((item, idx) => {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!