营销:适配商城装修组件【营销文章】

pull/20/head
owen 2023-11-25 15:53:06 +08:00
parent 92e164747a
commit 343b1fd5f6
3 changed files with 17 additions and 7 deletions

View File

@ -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 }
});
}
}

View File

@ -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'" />

View File

@ -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>