营销:适配商城装修组件【营销文章】
parent
92e164747a
commit
343b1fd5f6
|
@ -0,0 +1,12 @@
|
||||||
|
import request from '@/sheep/request';
|
||||||
|
|
||||||
|
export default {
|
||||||
|
// 获得文章详情
|
||||||
|
getArticle: (id) => {
|
||||||
|
return request({
|
||||||
|
url: '/app-api/promotion/article/get',
|
||||||
|
method: 'GET',
|
||||||
|
params: { id }
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
|
@ -23,8 +23,6 @@
|
||||||
<s-video-block v-if="type === 'VideoPlayer'" :data="data" :styles="styles" />
|
<s-video-block v-if="type === 'VideoPlayer'" :data="data" :styles="styles" />
|
||||||
<!-- 基础组件:辅助线 -->
|
<!-- 基础组件:辅助线 -->
|
||||||
<s-line-block v-if="type === 'lineBlock'" :data="data" />
|
<s-line-block v-if="type === 'lineBlock'" :data="data" />
|
||||||
<!-- 图文组件:富文字 -->
|
|
||||||
<s-richtext-block v-if="type === 'richtext'" :data="data" :styles="styles" />
|
|
||||||
<!-- 图文组件:热区 -->
|
<!-- 图文组件:热区 -->
|
||||||
<s-hotzone-block v-if="type === 'hotzone'" :data="data" :styles="styles" />
|
<s-hotzone-block v-if="type === 'hotzone'" :data="data" :styles="styles" />
|
||||||
|
|
||||||
|
@ -43,6 +41,8 @@
|
||||||
<s-live-block v-if="type === 'mplive'" :data="data" :styles="styles" />
|
<s-live-block v-if="type === 'mplive'" :data="data" :styles="styles" />
|
||||||
<!-- 营销组件:优惠券 -->
|
<!-- 营销组件:优惠券 -->
|
||||||
<s-coupon-block v-if="type === 'CouponCard'" :data="data" :styles="styles" />
|
<s-coupon-block v-if="type === 'CouponCard'" :data="data" :styles="styles" />
|
||||||
|
<!-- 营销组件:文章 -->
|
||||||
|
<s-richtext-block v-if="type === 'PromotionArticle'" :data="data" :styles="styles" />
|
||||||
|
|
||||||
<!-- 会员组件:会员卡片 -->
|
<!-- 会员组件:会员卡片 -->
|
||||||
<s-user-card v-if="type === 'userCard'" />
|
<s-user-card v-if="type === 'userCard'" />
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
</template>
|
</template>
|
||||||
<script setup>
|
<script setup>
|
||||||
import { reactive, onMounted } from 'vue';
|
import { reactive, onMounted } from 'vue';
|
||||||
import sheep from '@/sheep';
|
import ArticleApi from '@/sheep/api/promotion/article';
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
data: {
|
data: {
|
||||||
type: Object,
|
type: Object,
|
||||||
|
@ -30,9 +30,7 @@
|
||||||
content: '',
|
content: '',
|
||||||
});
|
});
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
const { error, data } = await sheep.$api.data.richtext(props.data.id);
|
const { data } = await ArticleApi.getArticle(props.data.id);
|
||||||
if (error === 0) {
|
|
||||||
state.content = data.content;
|
state.content = data.content;
|
||||||
}
|
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
Loading…
Reference in New Issue