|
@@ -1,10 +1,10 @@
|
|
|
<template>
|
|
|
<div class="custom-button-settings">
|
|
|
- <span class="title">{{ custom_button }}</span>
|
|
|
+ <span class="title">{{ $i18n.t("edit_settings.custom_button") }}</span>
|
|
|
|
|
|
<i
|
|
|
class="iconfont icon-material_prompt tool-tip-for-editor"
|
|
|
- v-tooltip="custom_button_tips"
|
|
|
+ v-tooltip="$i18n.t(`edit_settings.custom_button_tips`)"
|
|
|
>
|
|
|
</i>
|
|
|
<br />
|
|
@@ -17,7 +17,7 @@
|
|
|
>
|
|
|
<div
|
|
|
class="title-bar"
|
|
|
- :class="info.customButton[index].isShow ? 'bright' : 'dark'"
|
|
|
+ :class="item.isShow ? 'bright' : 'dark'"
|
|
|
@click="onRequestForChangeExpandStatus(index)"
|
|
|
>
|
|
|
<!-- 新增的体验图片 -->
|
|
@@ -29,8 +29,8 @@
|
|
|
<i class="iconfont icon-edit_input_arrow icon-expand"></i>
|
|
|
<img
|
|
|
v-if="
|
|
|
- info.customButton[index].type === '电话' &&
|
|
|
- info.customButton[index].isShow
|
|
|
+ item.type === '电话' &&
|
|
|
+ item.isShow
|
|
|
"
|
|
|
:src="require('@/assets/images/icons/phone.svg')"
|
|
|
class="button-icon"
|
|
@@ -38,8 +38,8 @@
|
|
|
/>
|
|
|
<img
|
|
|
v-if="
|
|
|
- info.customButton[index].type === '电话' &&
|
|
|
- !info.customButton[index].isShow
|
|
|
+ item.type === '电话' &&
|
|
|
+ !item.isShow
|
|
|
"
|
|
|
:src="require('@/assets/images/icons/phone-dark.svg')"
|
|
|
class="button-icon"
|
|
@@ -47,8 +47,8 @@
|
|
|
/>
|
|
|
<img
|
|
|
v-if="
|
|
|
- info.customButton[index].type === '链接' &&
|
|
|
- info.customButton[index].isShow
|
|
|
+ item.type === '链接' &&
|
|
|
+ item.isShow
|
|
|
"
|
|
|
:src="require('@/assets/images/icons/link.svg')"
|
|
|
class="button-icon"
|
|
@@ -56,82 +56,68 @@
|
|
|
/>
|
|
|
<img
|
|
|
v-if="
|
|
|
- info.customButton[index].type === '链接' &&
|
|
|
- !info.customButton[index].isShow
|
|
|
+ item.type === '链接' &&
|
|
|
+ !item.isShow
|
|
|
"
|
|
|
:src="require('@/assets/images/icons/link-dark.svg')"
|
|
|
class="button-icon"
|
|
|
alt=""
|
|
|
/>
|
|
|
<span class="button-name">
|
|
|
- {{ buttonName[index] }}
|
|
|
+ {{ getButtonTypeI18n(item.type)}}
|
|
|
</span>
|
|
|
</div>
|
|
|
<div class="right">
|
|
|
<i
|
|
|
class="iconfont icon-editor_list_edit btn-edit"
|
|
|
@click.stop="onRequestForEdit(index)"
|
|
|
- v-tooltip="edittips"
|
|
|
+ v-tooltip="$i18n.t(`edit_settings.edit`)"
|
|
|
>
|
|
|
</i>
|
|
|
<i
|
|
|
- v-show="info.customButton[index].isShow"
|
|
|
+ v-show="item.isShow"
|
|
|
class="iconfont icon-editor_on btn-show"
|
|
|
- v-tooltip="hidetips"
|
|
|
- @click.stop="info.customButton[index].isShow = false"
|
|
|
+ v-tooltip="$i18n.t(`edit_settings.hide`)"
|
|
|
+ @click.stop="item.isShow = false"
|
|
|
></i>
|
|
|
<i
|
|
|
- v-show="!info.customButton[index].isShow"
|
|
|
+ v-show="!item.isShow"
|
|
|
class="iconfont icon-editor_off btn-hide"
|
|
|
- v-tooltip="showtips"
|
|
|
+ v-tooltip="$i18n.t(`edit_settings.show`)"
|
|
|
@click.stop="onRequestForShow(index)"
|
|
|
></i>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="edit-content">
|
|
|
<div class="edit-content-item">
|
|
|
- <span class="item-name">{{ button_type }}</span>
|
|
|
- <div style="margin-left: 16px">{{ buttonName[index] }}</div>
|
|
|
+ <span class="item-name">{{ $i18n.t(`edit_settings.button_type`) }}</span>
|
|
|
+ <div style="margin-left: 16px">{{ getButtonTypeI18n(item.type) }}</div>
|
|
|
</div>
|
|
|
<div class="edit-content-item">
|
|
|
- <span class="item-name">{{ button_name }}</span>
|
|
|
+ <span class="item-name">{{ $i18n.t(`edit_settings.button_name`) }}</span>
|
|
|
<div style="margin-left: 16px">
|
|
|
- {{ info.customButton[index].name }}
|
|
|
+ {{ item.name }}
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="edit-content-item">
|
|
|
<span class="item-name">{{ buttonValueTips[index] }}</span>
|
|
|
<div style="margin-left: 16px">
|
|
|
- {{ info.customButton[index].value }}
|
|
|
+ {{ item.value }}
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="edit-content-item">
|
|
|
+ <span class="item-name">{{ $i18n.t("edit_settings.button_open_method") }}</span>
|
|
|
+ <div style="margin-left: 16px">
|
|
|
+ {{ $i18n.t(`zh_key.${item.openMethod}`) }}
|
|
|
</div>
|
|
|
</div>
|
|
|
-
|
|
|
- <!-- <div class="edit-content-item">
|
|
|
- <span class="item-name">{{ button_name }}</span>
|
|
|
- <PulldownMenuInEditor
|
|
|
- class="selector"
|
|
|
- :valueList="buttonTypeList"
|
|
|
- v-model="info.customButton[index].type"
|
|
|
- >
|
|
|
- </PulldownMenuInEditor>
|
|
|
- <input
|
|
|
- class="name-input"
|
|
|
- :placeholder="button_placeholder"
|
|
|
- v-model="info.customButton[index].name"
|
|
|
- maxlength="15"
|
|
|
- />
|
|
|
- </div> -->
|
|
|
- <!-- <div class="edit-content-item">
|
|
|
- <span class="item-name">{{ buttonValueTips[index] }}</span>
|
|
|
- <input class="value-input" v-model="info.customButton[index].value" />
|
|
|
- </div> -->
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
<popup v-if="isEditing" :canClose="false">
|
|
|
<div class="ui-message ui-message-confirm dark edit-window">
|
|
|
<div class="ui-message-header">
|
|
|
- <span>{{ custom_button }}</span>
|
|
|
+ <span>{{ $i18n.t("edit_settings.custom_button") }}</span>
|
|
|
<span @click="isEditing = false">
|
|
|
<i class="iconfont icon_close"></i>
|
|
|
</span>
|
|
@@ -139,16 +125,15 @@
|
|
|
|
|
|
<div class="ui-message-main">
|
|
|
<div class="edit-content-item">
|
|
|
- <span class="item-name">{{ button_name }}</span>
|
|
|
+ <span class="item-name">{{ $i18n.t(`edit_settings.button_name`) }}</span>
|
|
|
<PulldownMenuInEditor
|
|
|
class="selector"
|
|
|
:valueList="buttonTypeList"
|
|
|
v-model="editingInfo.type"
|
|
|
- >
|
|
|
- </PulldownMenuInEditor>
|
|
|
+ />
|
|
|
<input
|
|
|
class="name-input"
|
|
|
- :placeholder="button_placeholder"
|
|
|
+ :placeholder="$i18n.t(`edit_settings.button_placeholder`)"
|
|
|
v-model="editingInfo.name"
|
|
|
maxlength="15"
|
|
|
/>
|
|
@@ -157,18 +142,26 @@
|
|
|
<span class="item-name">{{ editingButtonValueTip }}</span>
|
|
|
<input
|
|
|
class="value-input"
|
|
|
- :placeholder="`${please_input}${editingButtonValueTip}`"
|
|
|
+ :placeholder="`${$i18n.t(`edit_settings.please_input`)}${editingButtonValueTip}`"
|
|
|
v-model="editingInfo.value"
|
|
|
/>
|
|
|
</div>
|
|
|
+ <div class="edit-content-item">
|
|
|
+ <span class="item-name">{{ $i18n.t('edit_settings.button_open_method') }}</span>
|
|
|
+ <PulldownMenuInEditor
|
|
|
+ class="selector"
|
|
|
+ :valueList="buttonOpenMethodList"
|
|
|
+ v-model="editingInfo.openMethod"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
</div>
|
|
|
|
|
|
<div class="ui-message-footer">
|
|
|
<button class="ui-button deepcancel" @click="isEditing = false">
|
|
|
- {{ canceltips }}
|
|
|
+ {{ $i18n.t("gather.cancel") }}
|
|
|
</button>
|
|
|
<button class="ui-button submit" @click="onConfirmEditing">
|
|
|
- {{ comfirmtips }}
|
|
|
+ {{ $i18n.t("gather.comfirm") }}
|
|
|
</button>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -190,28 +183,16 @@ export default {
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
- custom_button: i18n.t("edit_settings.custom_button"),
|
|
|
- custom_button_tips: i18n.t("edit_settings.custom_button_tips"),
|
|
|
- edittips: i18n.t("edit_settings.edit"),
|
|
|
- hidetips: i18n.t("edit_settings.hide"),
|
|
|
- showtips: i18n.t("edit_settings.show"),
|
|
|
- button_name: i18n.t("edit_settings.button_name"),
|
|
|
- button_type: i18n.t("edit_settings.button_type"),
|
|
|
- button_placeholder: i18n.t("edit_settings.button_placeholder"),
|
|
|
- please_input: i18n.t("edit_settings.please_input"),
|
|
|
-
|
|
|
- canceltips: i18n.t("gather.cancel"),
|
|
|
- comfirmtips: i18n.t("gather.comfirm"),
|
|
|
-
|
|
|
expandStatus: [],
|
|
|
buttonTypeList: ["电话", "链接"],
|
|
|
+ buttonOpenMethodList: ['弹出层打开', '新窗口打开'],
|
|
|
isEditing: false,
|
|
|
editingButtonIdx: -1,
|
|
|
- isIgnoreTypeChangeWhenEditing: false,
|
|
|
editingInfo: {
|
|
|
type: "",
|
|
|
name: "",
|
|
|
value: "",
|
|
|
+ openMethod: "",
|
|
|
},
|
|
|
};
|
|
|
},
|
|
@@ -234,22 +215,6 @@ export default {
|
|
|
return null;
|
|
|
}
|
|
|
},
|
|
|
-
|
|
|
- buttonName() {
|
|
|
- if (this.info.customButton) {
|
|
|
- return this.info.customButton.map((item) => {
|
|
|
- if (item.type === "电话") {
|
|
|
- return i18n.t("edit_settings.phone_short");
|
|
|
- } else if (item.type === "链接") {
|
|
|
- return i18n.t("edit_settings.link_short");
|
|
|
- } else {
|
|
|
- return "";
|
|
|
- }
|
|
|
- });
|
|
|
- } else {
|
|
|
- return null;
|
|
|
- }
|
|
|
- },
|
|
|
editingButtonValueTip() {
|
|
|
if (this.editingInfo.type === "电话") {
|
|
|
return i18n.t("edit_settings.phone");
|
|
@@ -263,12 +228,8 @@ export default {
|
|
|
watch: {
|
|
|
"editingInfo.type": {
|
|
|
handler(vNew) {
|
|
|
- if (!this.isIgnoreTypeChangeWhenEditing) {
|
|
|
- console.log(vNew);
|
|
|
- this.editingInfo.name = i18n.t(`zh_key.${vNew}`);
|
|
|
- this.editingInfo.value = "";
|
|
|
- }
|
|
|
- this.isIgnoreTypeChangeWhenEditing = false;
|
|
|
+ this.editingInfo.name = i18n.t(`zh_key.${vNew}`);
|
|
|
+ this.editingInfo.value = "";
|
|
|
},
|
|
|
},
|
|
|
},
|
|
@@ -280,27 +241,51 @@ export default {
|
|
|
type: "电话",
|
|
|
name: "电话",
|
|
|
value: "",
|
|
|
+ openMethod: "弹出层打开",
|
|
|
isShow: false,
|
|
|
},
|
|
|
{
|
|
|
type: "链接",
|
|
|
name: "链接",
|
|
|
value: "",
|
|
|
+ openMethod: "弹出层打开",
|
|
|
isShow: false,
|
|
|
},
|
|
|
];
|
|
|
}
|
|
|
+ if (!this.info.customButton[0].openMethod) {
|
|
|
+ // 这是在v1.3版之前创建的作品,还没设置过自定义按钮的打开方式。
|
|
|
+ this.info.customButton[0].openMethod = '弹出层打开'
|
|
|
+ this.info.customButton[1].openMethod = '弹出层打开'
|
|
|
+ }
|
|
|
+ },
|
|
|
+ mounted() {
|
|
|
+ this.info.customButton.forEach((item) => {
|
|
|
+ item.name =
|
|
|
+ i18n.t(`zh_key.${item.name}`).indexOf("zh_key") > -1
|
|
|
+ ? item.name
|
|
|
+ : i18n.t(`zh_key.${item.name}`);
|
|
|
+ });
|
|
|
},
|
|
|
methods: {
|
|
|
+ getButtonTypeI18n(buttonType) {
|
|
|
+ if (buttonType === '电话') {
|
|
|
+ return i18n.t("edit_settings.phone_short");
|
|
|
+ } else if (buttonType === '链接') {
|
|
|
+ return i18n.t("edit_settings.link_short");
|
|
|
+ } else {
|
|
|
+ return ''
|
|
|
+ }
|
|
|
+ },
|
|
|
onRequestForChangeExpandStatus(index) {
|
|
|
this.$set(this.expandStatus, index, !this.expandStatus[index]);
|
|
|
},
|
|
|
onRequestForEdit(index) {
|
|
|
this.editingButtonIdx = index;
|
|
|
- (this.isIgnoreTypeChangeWhenEditing = true),
|
|
|
- (this.editingInfo.type = this.info.customButton[index].type);
|
|
|
+ this.editingInfo.type = this.info.customButton[index].type;
|
|
|
this.editingInfo.name = this.info.customButton[index].name;
|
|
|
this.editingInfo.value = this.info.customButton[index].value;
|
|
|
+ this.editingInfo.openMethod = this.info.customButton[index].openMethod
|
|
|
this.isEditing = true;
|
|
|
},
|
|
|
checkButtonName(name) {
|
|
@@ -357,14 +342,6 @@ export default {
|
|
|
this.info.customButton[index].isShow = true;
|
|
|
},
|
|
|
},
|
|
|
- mounted() {
|
|
|
- this.info.customButton.forEach((item) => {
|
|
|
- item.name =
|
|
|
- i18n.t(`zh_key.${item.name}`).indexOf("zh_key") > -1
|
|
|
- ? item.name
|
|
|
- : i18n.t(`zh_key.${item.name}`);
|
|
|
- });
|
|
|
- },
|
|
|
};
|
|
|
</script>
|
|
|
|
|
@@ -402,8 +379,7 @@ export default {
|
|
|
display: flex;
|
|
|
justify-content: space-between;
|
|
|
align-items: center;
|
|
|
- padding: 0 16px;
|
|
|
- padding-right: 40px;
|
|
|
+ padding: 0 31px 0 16px;
|
|
|
cursor: pointer;
|
|
|
|
|
|
.experience {
|
|
@@ -453,17 +429,17 @@ export default {
|
|
|
align-items: center;
|
|
|
|
|
|
i.btn-edit {
|
|
|
- margin-left: 16px;
|
|
|
cursor: pointer;
|
|
|
-
|
|
|
+ padding: 7px;
|
|
|
&:hover {
|
|
|
color: #0076f6;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
> .btn-show {
|
|
|
- margin-left: 16px;
|
|
|
+ margin-left: 9px;
|
|
|
cursor: pointer;
|
|
|
+ padding: 7px;
|
|
|
|
|
|
&:hover {
|
|
|
color: #0076f6;
|
|
@@ -471,8 +447,9 @@ export default {
|
|
|
}
|
|
|
|
|
|
> .btn-hide {
|
|
|
- margin-left: 16px;
|
|
|
+ margin-left: 9px;
|
|
|
cursor: pointer;
|
|
|
+ padding: 7px;
|
|
|
|
|
|
&:hover {
|
|
|
color: #0076f6;
|