Commit c63699d5 authored by 郭志伟's avatar 郭志伟

feat(backtop):返回顶部支持分享

parent 77b75f28
...@@ -25,8 +25,8 @@ export default class DynamicForm extends Vue { ...@@ -25,8 +25,8 @@ export default class DynamicForm extends Vue {
@Watch('pageData', { immediate: true }) @Watch('pageData', { immediate: true })
onPageDataChange(newVal) { onPageDataChange(newVal) {
const { pageName, pageDescribe, pageKeywords, coverImage, isPublish, isTemplate } = this.pageData; const { pageName, pageDescribe, pageKeywords, coverImage, isPublish, isTemplate, shareCoverImage, shareOpenMethod } = this.pageData;
this.formCustom = { pageName, pageDescribe, pageKeywords, coverImage, isPublish: !!isPublish, isTemplate: !!isTemplate }; this.formCustom = { pageName, pageDescribe, pageKeywords, coverImage, isPublish: !!isPublish, isTemplate: !!isTemplate, shareCoverImage, shareOpenMethod };
} }
@Watch('value') @Watch('value')
......
...@@ -10,6 +10,16 @@ ...@@ -10,6 +10,16 @@
<FormItem label="页面关键字" prop="pageKeywords"> <FormItem label="页面关键字" prop="pageKeywords">
<Input v-model="formCustom.pageKeywords" type="textarea" placeholder="请输入页面关键字" :rows="3"></Input> <Input v-model="formCustom.pageKeywords" type="textarea" placeholder="请输入页面关键字" :rows="3"></Input>
</FormItem> </FormItem>
<FormItem label="页面缩略图" prop="shareCoverImage">
<Upload v-model="formCustom.shareCoverImage" :show-input="false" />
<p class="basic-form__tip">可选,默认使用页面缩略图,建议图片比例1:1,图片格式jpg、png</p>
</FormItem>
<FormItem label="H5打开方式" prop="shareOpenMethod">
<RadioGroup v-model="formCustom.shareOpenMethod">
<Radio :label="1">小程序</Radio>
<Radio :label="2">APP</Radio>
</RadioGroup>
</FormItem>
<FormItem label="是否发布" prop="isPublish"> <FormItem label="是否发布" prop="isPublish">
<i-switch v-model="formCustom.isPublish"></i-switch> <i-switch v-model="formCustom.isPublish"></i-switch>
</FormItem> </FormItem>
...@@ -37,5 +47,9 @@ ...@@ -37,5 +47,9 @@
object-fit: contain; object-fit: contain;
} }
} }
&__tip {
color: #666;
line-height: 16px;
}
} }
</style> </style>
\ No newline at end of file
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
</div> </div>
</div> </div>
</div> </div>
<Input v-model="img" @input="handleImgUrlChange"></Input> <Input v-if="showInput" v-model="img" @input="handleImgUrlChange"></Input>
</div> </div>
</template> </template>
<script> <script>
...@@ -29,6 +29,10 @@ ...@@ -29,6 +29,10 @@
export default { export default {
props: { props: {
value: String, value: String,
showInput: {
type: Boolean,
default: true
}
}, },
data() { data() {
return { return {
......
...@@ -60,6 +60,11 @@ export default class DynamicPageForm extends Mixins(ContextMenuMixin) { ...@@ -60,6 +60,11 @@ export default class DynamicPageForm extends Mixins(ContextMenuMixin) {
name: '返回顶部', name: '返回顶部',
type: 'checkbox' type: 'checkbox'
}, },
{
key: 'showShare',
name: '分享按钮',
type: 'checkbox'
},
{ {
key: 'btAttachVal', key: 'btAttachVal',
name: '添加按钮', name: '添加按钮',
......
...@@ -80,8 +80,8 @@ export default class DashBoard extends Mixins(ContextMenuMixin, GoodsTabsMixin, ...@@ -80,8 +80,8 @@ export default class DashBoard extends Mixins(ContextMenuMixin, GoodsTabsMixin,
this.pageData.elements.sort((a, b) => a.point.y - b.point.y); this.pageData.elements.sort((a, b) => a.point.y - b.point.y);
// 处理商品标签组件 // 处理商品标签组件
const pageData = this.handleGoodsTabs(); const pageData = this.handleGoodsTabs();
const { pageName, pageDescribe, pageKeywords, coverImage, isPublish, isTemplate } = pageConfig; const { pageName, pageDescribe, pageKeywords, coverImage, isPublish, isTemplate, shareCoverImage, shareOpenMethod } = pageConfig;
const pageInfo = { page: JSON.stringify(pageData), author: user?.account, isPublish, pageName, pageDescribe, pageKeywords, coverImage, isTemplate } as pageInfo; const pageInfo = { page: JSON.stringify(pageData), author: user?.account, isPublish, pageName, pageDescribe, pageKeywords, coverImage, isTemplate, shareCoverImage, shareOpenMethod } as pageInfo;
if (this.uuid) { pageInfo.uuid = this.uuid; } if (this.uuid) { pageInfo.uuid = this.uuid; }
await this.savePageData({ pageInfo, pageData: this.pageData }); await this.savePageData({ pageInfo, pageData: this.pageData });
if (this.uuid) { await this.getPageDate({ pageId: this.uuid }); } if (this.uuid) { await this.getPageDate({ pageId: this.uuid }); }
......
...@@ -48,6 +48,8 @@ export interface PageInfo { ...@@ -48,6 +48,8 @@ export interface PageInfo {
enable?: number; enable?: number;
author?: string; author?: string;
coverImage?: string; coverImage?: string;
shareCoverImage?: string; // 分享缩略图
shareOpenMethod?: string; // 分享后的打开方式
isTemplate?: number | boolean; isTemplate?: number | boolean;
isPublish?: number | boolean; isPublish?: number | boolean;
pageName?: string; pageName?: string;
...@@ -87,13 +89,20 @@ export const defaultState = { ...@@ -87,13 +89,20 @@ export const defaultState = {
pageBottomTxt: '没有更多啦~', pageBottomTxt: '没有更多啦~',
pageBottomColor: '#fff', pageBottomColor: '#fff',
showBackTop: true, showBackTop: true,
showShare: true,
btAttachVal: [ btAttachVal: [
{ {
persets: '购物车',
name: '购物车', name: '购物车',
icon: 'shopping-cart-o', icon: 'shopping-cart',
url: 'xyqb://shoppingCart?needLogin=1', url: 'xyqb://shoppingCart?needLogin=1',
color: '#333', color: '#333',
background: '#fff' iconColor: '#333',
background: '#fff',
shadow: true,
radius: true,
size: 46,
iconSize: 20
} }
], ],
}, },
......
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