zyejMAll-mobile/sheep/components/s-block-item/s-block-item.vue

212 lines
5.8 KiB
Vue
Raw Normal View History

2024-08-07 10:31:42 +08:00
<template>
2024-08-07 21:40:27 +08:00
<view>
2024-10-14 19:12:22 +08:00
<!-- 基础组件搜索框 -->
2024-08-07 21:40:27 +08:00
<s-search-block v-if="type === 'SearchBar'" :data="data" :styles="styles" :navbar="false" />
<!-- 基础组件公告栏 -->
<s-notice-block v-if="type === 'NoticeBar'" :data="data" />
<!-- 基础组件菜单导航 -->
<s-menu-button v-if="type === 'MenuSwiper'" :data="data" :styles="styles" />
<!-- 基础组件列表导航 -->
<s-menu-list v-if="type === 'MenuList'" :data="data" />
<!-- 基础组件宫格导航 -->
<s-menu-grid v-if="type === 'MenuGrid'" :data="data" />
<!-- 基础组件弹窗广告 -->
<s-popup-image v-if="type === 'Popover'" :data="data" />
<!-- 基础组件悬浮按钮 -->
<s-float-menu v-if="type === 'FloatingActionButton'" :data="data" />
2024-08-07 10:31:42 +08:00
2024-08-07 21:40:27 +08:00
<!-- 图文组件图片展示 -->
<s-image-block v-if="type === 'ImageBar'" :data="data" :styles="styles" />
<!-- 图文组件图片轮播 -->
<s-image-banner v-if="type === 'Carousel'" :data="data" :styles="styles" />
<!-- 基础组件标题栏 -->
<s-title-block v-if="type === 'TitleBar'" :data="data" :styles="styles" />
<!-- 图文组件广告魔方 -->
<s-image-cube v-if="type === 'MagicCube'" :data="data" :styles="styles" />
<!-- 图文组件视频播放 -->
<s-video-block v-if="type === 'VideoPlayer'" :data="data" :styles="styles" />
<!-- 基础组件分割线 -->
<s-line-block v-if="type === 'Divider'" :data="data" />
<!-- 图文组件热区 -->
<s-hotzone-block v-if="type === 'HotZone'" :data="data" :styles="styles" />
2024-08-07 10:31:42 +08:00
2024-08-07 21:40:27 +08:00
<!-- 商品组件商品卡片 -->
<s-goods-card v-if="type === 'ProductCard'" :data="data" :styles="styles" />
<!-- 商品组件商品栏 -->
<s-goods-shelves v-if="type === 'ProductList'" :data="data" :styles="styles" />
2024-08-07 10:31:42 +08:00
2024-08-07 21:40:27 +08:00
<!-- 营销组件拼团 -->
<s-groupon-block v-if="type === 'PromotionCombination'" :data="data" :styles="styles" />
<!-- 营销组件秒杀 -->
<s-seckill-block v-if="type === 'PromotionSeckill'" :data="data" :styles="styles" />
<!-- 营销组件积分商城 -->
2024-10-14 19:12:22 +08:00
<s-point-block v-if="type === 'PromotionPoint'" :data="data" :styles="styles" />
2024-10-11 18:12:34 +08:00
<!-- 营销组件小程序直播暂时没有这个功能 -->
2024-08-07 21:40:27 +08:00
<s-live-block v-if="type === 'MpLive'" :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" /> -->
2024-10-14 19:12:22 +08:00
<view class="floxt" v-if="type === 'PromotionArticle'">
2024-08-07 21:40:27 +08:00
<view class="addClass" v-for="(item, index) in state.model" @click="path(item.id)">
<view class="image">
2024-10-14 19:12:22 +08:00
<image :src="item.picUrl" alt="" />
2024-08-07 21:40:27 +08:00
</view>
<view class="text">
<view class="top">
{{item.title}}
</view>
<view class="bottom">
2024-08-08 10:22:22 +08:00
{{ sheep.$helper.timeFormat(item.createTime, 'yyyy-mm-dd hh:MM:ss') }}
2024-08-07 21:40:27 +08:00
</view>
</view>
</view>
</view>
2024-08-07 10:31:42 +08:00
2024-08-07 21:40:27 +08:00
<!-- 用户组件用户卡片 -->
<s-user-card v-if="type === 'UserCard'" />
2024-10-14 19:12:22 +08:00
<view v-if="type === 'UserOrder'" class="new-huiy" @click="
2024-10-21 17:47:58 +08:00
sheep.$router.go('/pages/user/user_vip/list')
2024-10-14 19:12:22 +08:00
">
2024-10-21 19:28:07 +08:00
<view class="new-button" v-if="userInfo.activate == 1">正在试用</view>
<view class="new-button" v-if="userInfo.activate == 2">开通</view>
<view class="new-button" v-if="userInfo.activate == 3">永久</view>
<view class="new-button" v-if="userInfo.activate == 0">立即开通</view>
2024-10-14 19:12:22 +08:00
<image class="seckill1" mode="aspectFit"
src="https://zysc.fjptzykj.com:3000/shangcheng/64776e2edc3c2f15295e7c3976ba301e08f9170f99a2e845d8f33bd65179b177.png" />
2024-10-11 18:12:34 +08:00
</view>
2024-08-07 21:40:27 +08:00
<!-- 用户组件用户订单 -->
<s-order-card v-if="type === 'UserOrder'" :data="data" />
<!-- 用户组件用户资产 -->
<s-wallet-card v-if="type === 'UserCard'" />
2024-08-07 21:40:27 +08:00
<!-- 用户组件用户卡券 -->
<s-coupon-card v-if="type === 'UserCoupon'" />
</view>
2024-08-07 10:31:42 +08:00
</template>
<script setup>
2024-08-08 10:22:22 +08:00
import sheep from '@/sheep';
2024-10-14 19:12:22 +08:00
import {
ref,
reactive,
2024-10-21 19:28:07 +08:00
unref,
computed
2024-10-14 19:12:22 +08:00
} from 'vue';
2024-08-07 21:40:27 +08:00
import AddressApi from '@/sheep/api/member/address';
const state = reactive({
2024-10-14 19:12:22 +08:00
model: [],
2024-08-07 21:40:27 +08:00
});
2024-10-21 19:28:07 +08:00
// 用户信息
const userInfo = computed(() => sheep.$store('user').userInfo);
2024-08-07 21:40:27 +08:00
const ff = async (id) => {
2024-10-14 19:12:22 +08:00
let {
code,
data
} = await AddressApi.textList();
state.model = data;
2024-08-07 21:40:27 +08:00
}
2024-10-14 19:12:22 +08:00
2024-08-07 21:40:27 +08:00
ff();
/**
* 装修组件 - 组件集
*/
const props = defineProps({
type: {
type: String,
default: '',
},
data: {
type: Object,
default () {},
},
styles: {
type: Object,
default () {},
},
});
function path(id) {
// $u.route({url:'/pages/goods/index',params:{id:'14'}})
uni.navigateTo({
2024-10-14 19:12:22 +08:00
url: `/pages/mulu/mulu?id=${id}`
2024-08-07 21:40:27 +08:00
});
}
2024-08-07 10:31:42 +08:00
</script>
2024-08-07 21:40:27 +08:00
<style scoped lang="scss">
2024-10-14 19:12:22 +08:00
:deep(.uni-border-bottom) {
height: 0;
2024-09-30 19:00:13 +08:00
}
2024-10-14 19:12:22 +08:00
.new-huiy {
width: 100%;
2024-10-16 18:09:51 +08:00
height: 93px;
2024-10-14 19:12:22 +08:00
z-index: 9999999999999;
.new-button {
background: white;
padding: 4px 8px;
text-align: center;
2024-10-11 18:12:34 +08:00
position: absolute;
border-radius: 20px;
2024-10-16 18:09:51 +08:00
right: 14px;
2024-10-11 18:12:34 +08:00
top: 37px;
2024-10-14 19:12:22 +08:00
font-size: 14px;
2024-10-11 18:12:34 +08:00
color: rgba(148, 109, 45, 1);
z-index: 33;
}
2024-10-14 19:12:22 +08:00
.seckill1 {
height: 100px;
2024-10-11 18:12:34 +08:00
position: absolute;
2024-10-14 19:12:22 +08:00
z-index: 22;
left: 50%;
transform: translateX(-50%);
2024-10-16 18:09:51 +08:00
width: 100%;
2024-10-11 18:12:34 +08:00
}
}
2024-10-14 19:12:22 +08:00
2024-08-07 21:40:27 +08:00
.floxt {
width: 100%;
2024-10-14 19:12:22 +08:00
2024-08-07 21:40:27 +08:00
.addClass {
2024-10-14 19:12:22 +08:00
background: white;
2024-08-07 21:40:27 +08:00
display: flex;
justify-content: space-between;
width: 100%;
2024-10-14 19:12:22 +08:00
margin: 20rpx 0;
2024-08-07 21:40:27 +08:00
// padding: 40rpx;
// padding-right: 0;
// height: 200rpx;
.image {
width: 250rpx;
height: 156rpx;
margin-right: 18rpx;
2024-10-14 19:12:22 +08:00
padding: 20rpx 20rpx;
image {
2024-08-07 21:40:27 +08:00
width: 100%;
height: 100%;
}
}
.text {
display: flex;
width: 100%;
// text-align: center;
2024-10-14 19:12:22 +08:00
padding: 20rpx 20rpx;
flex: 1;
2024-08-07 21:40:27 +08:00
flex-direction: column;
justify-content: space-between;
2024-10-14 19:12:22 +08:00
.bottom {
2024-08-08 10:22:22 +08:00
color: #999;
font-size: 12px;
}
2024-10-14 19:12:22 +08:00
2024-08-07 21:40:27 +08:00
}
}
}
</style>