Commit f24487ad authored by 徐光星's avatar 徐光星

Merge branch 'feat/v1.6-0621' into 'master'

Feat/v1.6 0621

See merge request !86
parents 5c79a357 3f828ca6
...@@ -3,15 +3,15 @@ const protocol = EASY_ENV_IS_BROWSER ? window.location.protocol : 'http'; ...@@ -3,15 +3,15 @@ const protocol = EASY_ENV_IS_BROWSER ? window.location.protocol : 'http';
const hostMap = { const hostMap = {
apiHost: `http://localhost:7002/`, apiHost: `http://localhost:7002/`,
// apiHost: `http://192.168.28.199:7001/`, // apiHost: `http://192.168.28.199:7001/`,
// apiHost: 'https://quantum-blocks-sc.liangkebang.net/', // apiHost: 'https://quantum-blocks-yxm.liangkebang.net/',
h5Host: 'https://quantum-h5-sc.liangkebang.net', h5Host: 'https://quantum-h5-yxm.liangkebang.net',
qiniuHost: `https://appsync.lkbang.net`, qiniuHost: `https://appsync.lkbang.net`,
shenceUrl: `${protocol}//bn.xyqb.com/sa?project=default`, shenceUrl: `${protocol}//bn.xyqb.com/sa?project=default`,
opapiHost: `https://opapi-sc.liangkebang.net`, opapiHost: `https://opapi-yxm.liangkebang.net`,
qiniuUpHost: `${protocol}//up-z0.qiniup.com`, qiniuUpHost: `${protocol}//up-z0.qiniup.com`,
// kdspHost: 'https://kdsp-api-sc.liangkebang.net', // kdspHost: 'https://kdsp-api-yxm.liangkebang.net',
talosHost: 'https://talos-sc.liangkebang.net', talosHost: 'https://talos-yxm.liangkebang.net',
kdspHost: 'https://kdsp-api-sc.liangkebang.net', kdspHost: 'https://kdsp-api-yxm.liangkebang.net',
yxmTenantId: 560761, yxmTenantId: 560761,
appIdMap: { appIdMap: {
560761: 'wxe16bf9293671506c', 560761: 'wxe16bf9293671506c',
......
...@@ -13,6 +13,12 @@ export const basicComponents = [ ...@@ -13,6 +13,12 @@ export const basicComponents = [
desc: '跳转链接', desc: '跳转链接',
type: 'text', type: 'text',
}, },
// {
// key: 'freedomVideo',
// name: '视频背景',
// desc: '视频背景',
// type: 'upload'
// },
{ {
key: 'isFinance', key: 'isFinance',
name: '是否导流', name: '是否导流',
......
...@@ -15,6 +15,9 @@ export default { ...@@ -15,6 +15,9 @@ export default {
} }
}, },
watch: { watch: {
value(val) {
this.selected = val;
},
selected(val) { selected(val) {
this.$emit('input', val); this.$emit('input', val);
} }
......
<template>
<div class="GoodsChannelTypeSelectorContainer">
<span class="option" @click="select(item.id)" v-for="(item, index) in options" :key="index" :class="{selected: item.id == selected}">
{{item.label}}
</span>
<!-- <Button type="primary" @click="save">保存</Button> -->
</div>
</template>
<script>
export default {
props: {
value: {
type: String,
default: "1"
}
},
watch: {
value(val) {
this.selected = val;
},
selected(val) {
this.$emit('input', val);
}
},
methods: {
select(id) {
this.selected = id;
}
},
data() {
return {
options: [
{id: '1', label: '单行'},
{id: '2', label: '双行'},
],
selected: 0
}
},
created() {
this.selected = this.value;
}
}
</script>
<style scoped lang="less">
.option{
cursor: pointer;
border-radius: 4px;
line-height:normal;
display: inline-block;
padding: 3px 5px;
border: 1px solid #dddee1;
margin: 0 2px;
user-select: none;
&.selected, &:hover{
border-color: #57a3f3;
box-shadow: 0px 0px 0px 2px rgb(45 140 240 / 20%)
}
}
</style>
<template>
<div class="GoodsPromotionTypeSelectorContainer">
<span class="option" @click="select(item.id)" v-for="(item, index) in options" :key="index" :class="{selected: item.id == selected}">
{{item.label}}
</span>
<!-- <Button type="primary" @click="save">保存</Button> -->
</div>
</template>
<script>
export default {
props: {
value: {
type: String,
default: "1"
}
},
watch: {
value(val) {
this.selected = val;
},
selected(val) {
this.$emit('input', val);
}
},
methods: {
select(id) {
this.selected = id;
}
},
data() {
return {
options: [
{id: '1', label: '左一带五'},
{id: '2', label: '右一带五'},
{id: '3', label: '左二带四'},
{id: '4', label: '右二带四'},
],
selected: 0
}
},
created() {
this.selected = this.value;
}
}
</script>
<style scoped lang="less">
.option{
cursor: pointer;
border-radius: 4px;
line-height:normal;
display: inline-block;
padding: 3px 5px;
border: 1px solid #dddee1;
margin: 0 2px;
user-select: none;
&.selected, &:hover{
border-color: #57a3f3;
box-shadow: 0px 0px 0px 2px rgb(45 140 240 / 20%)
}
}
</style>
...@@ -15,6 +15,9 @@ export default { ...@@ -15,6 +15,9 @@ export default {
} }
}, },
watch: { watch: {
value(val) {
this.selected = val;
},
selected(val) { selected(val) {
this.$emit('input', val); this.$emit('input', val);
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<div> <div>
<div class="upload"> <div class="upload">
<div class="upload-img" v-if="img"> <div class="upload-img" v-if="img">
<img :src="img" v-if="isUrl"> <img :src="componentKey === 'freedomVideo' ? `${img}?vframe/jpg/offset/1` : img" v-if="isUrl">
<cr-icon :type="img" class="upload-img-none-icon" v-else /> <cr-icon :type="img" class="upload-img-none-icon" v-else />
<!-- <Icon type="image" size="20" class="upload-img-none-icon"></Icon> --> <!-- <Icon type="image" size="20" class="upload-img-none-icon"></Icon> -->
<div class="upload-img-cover"> <div class="upload-img-cover">
...@@ -32,13 +32,18 @@ ...@@ -32,13 +32,18 @@
showInput: { showInput: {
type: Boolean, type: Boolean,
default: true default: true
},
componentKey: {
type: String,
default: ''
} }
}, },
data() { data() {
return { return {
id: uuidv4().substr(0, 8), id: uuidv4().substr(0, 8),
percent: 0, percent: 0,
img: this.value img: this.value,
fileType: ''
} }
}, },
computed: { computed: {
...@@ -82,6 +87,23 @@ ...@@ -82,6 +87,23 @@
chunk_size: '4mb', // 分块上传时,每片的体积 chunk_size: '4mb', // 分块上传时,每片的体积
auto_start: true, // 选择文件后自动上传,若关闭需要自己绑定事件触发上传 auto_start: true, // 选择文件后自动上传,若关闭需要自己绑定事件触发上传
init: { init: {
FilesAdded: (up, files) => {
if (this.componentKey === 'freedomVideo') {
console.log(files.length)
if (files.length > 1) {
up.removeFile(files[0]);
this.$toast('视频背景只允许上传单个文件');
return false;
}
console.log(files[0].type, 999)
if (files[0].type.indexOf('video') === -1) {
up.removeFile(files[0]);
this.$toast('只允许上传视频格式文件');
return false;
}
// 自由容器视频背景,只允许上传video
}
},
FileUploaded: (up, file, info) => { FileUploaded: (up, file, info) => {
// console.log(this); // console.log(this);
this.percent = 0; this.percent = 0;
...@@ -104,20 +126,35 @@ ...@@ -104,20 +126,35 @@
}, },
BeforeUpload: (up, file) => { BeforeUpload: (up, file) => {
const {type, size} = file; const {type, size} = file;
console.log(type);
let limit = 0; let limit = 0;
let fileType = '';
// 来自量子积木v1.5需求中的优化点 // 来自量子积木v1.5需求中的优化点
if (type === 'image/gif') { if (type === 'image/gif') {
// gif限制5M // gif限制5M
this.fileType = 'image';
limit = 5 * 1024 * 1024; limit = 5 * 1024 * 1024;
if (size > limit) { if (size > limit) {
this.$toast('gif图大小不允许超过5Mb'); this.$toast('gif图大小不允许超过5Mb');
up.removeFile(file);
return false;
}
} else if (type.toLowerCase().indexOf('video/') === 0) {
// 视频文件,限制4M
this.fileType = 'video';
limit = 4 * 1024 * 1024;
if (size > limit) {
this.$toast('文件大小不允许超过4Mb');
up.removeFile(file);
return false; return false;
} }
} else { } else {
// 其他格式限制800KB // 其他格式限制800KB
this.fileType = 'image';
limit = 800 * 1024; limit = 800 * 1024;
if (size > limit) { if (size > limit) {
this.$toast('文件大小不允许超过800Kb'); this.$toast('文件大小不允许超过800Kb');
up.removeFile(file);
return false; return false;
} }
} }
......
...@@ -15,6 +15,8 @@ import SwiperStyleTypeSelector from './component/SwiperStyleTypeSelector/index.v ...@@ -15,6 +15,8 @@ import SwiperStyleTypeSelector from './component/SwiperStyleTypeSelector/index.v
import SwiperListSelector from './component/SwiperListSelector/index.vue'; import SwiperListSelector from './component/SwiperListSelector/index.vue';
import GoodsSwiperSelector from './component/GoodsSwiperSelector/index.vue'; import GoodsSwiperSelector from './component/GoodsSwiperSelector/index.vue';
import DiscountGoodsSelectorV2 from './component/DiscountGoodsSelectorV2/index.vue'; import DiscountGoodsSelectorV2 from './component/DiscountGoodsSelectorV2/index.vue';
import GoodsChannelTypeSelector from './component/GoodsChannelTypeSelector/index.vue';
import GoodsPromotionTypeSelector from './component/GoodsPromotionTypeSelector/index.vue';
import BaseSelect from './component/BaseSelect/index.vue'; import BaseSelect from './component/BaseSelect/index.vue';
import ComponentSelect from './component/ComponentSelect/index.vue'; import ComponentSelect from './component/ComponentSelect/index.vue';
import FormList from './component/FormList/index.vue'; import FormList from './component/FormList/index.vue';
...@@ -48,7 +50,9 @@ const allComponentsMap = getAllScheme(); ...@@ -48,7 +50,9 @@ const allComponentsMap = getAllScheme();
DiscountGoodsSelectorV2, DiscountGoodsSelectorV2,
SwiperStyleTypeSelector, SwiperStyleTypeSelector,
SwiperListSelector, SwiperListSelector,
GoodsSwiperSelector GoodsSwiperSelector,
GoodsChannelTypeSelector,
GoodsPromotionTypeSelector
}, name: 'DynamicForm' }) }, name: 'DynamicForm' })
export default class DynamicForm extends Mixins(ContextMenuMixin, DynamicFormMixin) { export default class DynamicForm extends Mixins(ContextMenuMixin, DynamicFormMixin) {
@State(state => state.editor.curEleIndex) curEleIndex; @State(state => state.editor.curEleIndex) curEleIndex;
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
</FormItem> </FormItem>
</div> </div>
<FormItem class="Df-component-formitem" v-else :label="item.name" :title="item.desc || ''"> <FormItem class="Df-component-formitem" v-else :label="item.name" :title="item.desc || ''">
<component :hide3Column="curElement.name === 'cs-discount' && item.key ==='column'" :is="getComponent(item.type)" :options="item.options" :formControl="item.formControl" :limit-name="item.type === 'ComponentSelect' && curElement.name === 'cs-goods-tabs' ? 'cs-goods' : ''" v-model="form[item.key]" /> <component :componentKey="item.key" :hide3Column="curElement.name === 'cs-discount' && item.key ==='column'" :is="getComponent(item.type)" :options="item.options" :formControl="item.formControl" :limit-name="item.type === 'ComponentSelect' && curElement.name === 'cs-goods-tabs' ? 'cs-goods' : ''" v-model="form[item.key]" />
</FormItem> </FormItem>
</template> </template>
</Form> </Form>
......
...@@ -84,6 +84,18 @@ export default class FreedomContainer extends Mixins(ContextMenuMixin, Transform ...@@ -84,6 +84,18 @@ export default class FreedomContainer extends Mixins(ContextMenuMixin, Transform
}); });
} }
videoOnload() {
if (this.$refs.videoBackground) {
// const childEle = this.childItem.child[this.curChildIndex];
console.log(this.childItem);
const height = this.$refs.videoBackground.offsetHeight;
this.updateCommonStyle({ containerIndex: this.containerIndex, childIndex: this.curChildIndex, data: { ...this.childItem.commonStyle, height: +height }});
this.$nextTick(() => {
this.adjustHeight();
});
}
}
// 获取point计算后样式 // 获取point计算后样式
setPointStyle() { setPointStyle() {
this.$nextTick(() => { this.$nextTick(() => {
......
<template> <template>
<div class="freedom" :ref="`freedomContainer${containerIndex}`" @click.stop="handleElementClick(containerIndex)"> <div class="freedom" :ref="`freedomContainer${containerIndex}`" @click.stop="handleElementClick(containerIndex)">
<div class="freedom-body" :data-index="containerIndex"> <div class="freedom-body" :data-index="containerIndex">
<video width="100%" @loadeddata="videoOnload" ref="videoBackground" height="auto" style="z-index: -10; osition: absolute; top: 0; left: 0" v-if="childItem.props.freedomVideo" :src="childItem.props.freedomVideo" autoplay loop muted />
<div v-for="(item, index) in childItem.child" :style="transformStyle(item.commonStyle, 'container')" :class="['freedom-body-item', { 'Fb-item_selected': curChildIndex === index }]" :key="index" @click.stop="handleElementClick(containerIndex, index)" @mousedown.stop.prevent="mousedown(index, $event)" @contextmenu.prevent.stop="show($event, containerIndex, index)"> <div v-for="(item, index) in childItem.child" :style="transformStyle(item.commonStyle, 'container')" :class="['freedom-body-item', { 'Fb-item_selected': curChildIndex === index }]" :key="index" @click.stop="handleElementClick(containerIndex, index)" @mousedown.stop.prevent="mousedown(index, $event)" @contextmenu.prevent.stop="show($event, containerIndex, index)">
<component ref="childComponent" :style="transformStyle(item.commonStyle, 'component')" :is="item.name" v-bind="item.props"></component> <component ref="childComponent" :style="transformStyle(item.commonStyle, 'component')" :is="item.name" v-bind="item.props"></component>
<div class="freedom-body-dot" <div class="freedom-body-dot"
......
...@@ -130,6 +130,28 @@ import featurePageTable from './featurePageTable.vue'; ...@@ -130,6 +130,28 @@ import featurePageTable from './featurePageTable.vue';
import activityPageTable from './activityPageTable.vue'; import activityPageTable from './activityPageTable.vue';
import navigatorPageTable from './navigatorPageTable.vue'; import navigatorPageTable from './navigatorPageTable.vue';
import navigatorApi from '@api/navigator.api' import navigatorApi from '@api/navigator.api'
// 添加或修改url中的参数
function addOrEditUrlParams (url, paramName, replaceWith) {
if (url.indexOf(paramName) > -1) {
// let re = /(' + paramName + '=)([^&]*)/gi;
// url = url.replace(re, paramName + '=' + replaceWith);
const re = new RegExp(paramName + '=[^&]*', 'gi')
url = url.replace(re, paramName + '=' + replaceWith)
} else {
let paraStr = paramName + '=' + replaceWith;
let idx = url.indexOf('?');
if (idx < 0) {
url += '?';
} else if (idx >= 0 && idx !== url.length - 1) {
url += '&';
}
url = url + paraStr;
}
return url;
};
export default { export default {
components: { components: {
uploader, uploader,
...@@ -346,6 +368,15 @@ export default { ...@@ -346,6 +368,15 @@ export default {
const arr = this.navigatorData.concat([]); const arr = this.navigatorData.concat([]);
const targetIndex = type === 1 ? index - 1 : index + 1; const targetIndex = type === 1 ? index - 1 : index + 1;
arr[index] = arr.splice(targetIndex, 1, arr[index])[0]; arr[index] = arr.splice(targetIndex, 1, arr[index])[0];
for (let i = 0; i < arr.length; i++) {
if (arr[i].pageType == 2) {
console.log(i);
// 活动页面的时候,因上下移动需要重新给index排序
arr[i].pageUrl = addOrEditUrlParams(arr[i].pageUrl, 'index', i)
console.log(arr[i].pageUrl, i)
}
}
console.log(arr);
this.navigatorData = arr; this.navigatorData = arr;
} }
}, },
......
...@@ -2176,9 +2176,9 @@ ...@@ -2176,9 +2176,9 @@
} }
}, },
"@qg/citrus-ui": { "@qg/citrus-ui": {
"version": "0.3.52", "version": "0.3.54",
"resolved": "http://npmprivate.quantgroups.com/@qg%2fcitrus-ui/-/citrus-ui-0.3.52.tgz", "resolved": "http://npmprivate.quantgroups.com/@qg%2fcitrus-ui/-/citrus-ui-0.3.54.tgz",
"integrity": "sha512-lxEcVFegRhLc+6N76DzgG0Ekoh0yBH0O6GAL+RmJvX5yu+TB9ufjvlKThqRUq3kH5DlUMardRc3zjxTDQGD5uw==", "integrity": "sha512-N4cFIBYIOVL3OCC67i/wZhlyFm2ZcJvSSLRdFT0KmiLSmd5rlJzDQxg26Sohc5v5yUtXH7g/qLHmYI1m1Uf2vw==",
"requires": { "requires": {
"@better-scroll/core": "^2.1.1", "@better-scroll/core": "^2.1.1",
"@qg/cherry-ui": "^2.23.9", "@qg/cherry-ui": "^2.23.9",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment