| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266 |
- <template>
- <view class="group-work u-skeleton-fillet">
- <view
- class="head-item"
- @click="goDetail('/pages/groupBuying/list')"
- :style="{ backgroundImage: `url(${bgImage || ''})` }"
- >
- <view class="top-left">
- <view class="top-left-title">拼团购</view>
- <view class="top-left-tip">精选好物推荐</view>
- </view>
- <view class="top-right" style="color: #75c27a">
- <text>查看更多</text>
- <!-- <text class="iconfont u-font24"></text> -->
- <uv-icon name="arrow-right" size="24rpx" color="#75c27a"></uv-icon>
- </view>
- </view>
- <view
- class="group-work-main"
- v-if="(groupList && groupList.length > 0) || skeletonShow"
- >
- <view
- class="middle_item"
- v-for="item in skeletonShow ? 1 : groupList"
- :key="item.id"
- >
- <view
- class="middle"
- @click="goProductDetails('/pages/groupBuying/details?id=' + item.id)"
- >
- <view class="middle-left">
- <!-- ?x-oss-process=style/w_350 -->
- <image
- v-if="item && item.coverImage"
- :src="`${item.coverImage}`"
- mode="aspectFill"
- >
- </image>
- </view>
- <view class="middle-right">
- <view class="middle-title u-text2">{{ item.title }}</view>
- <view class="division">
- <view class="middle-num">
- <view class="contain">
- <view class="large">
- <rich-text
- :nodes="$mUtil.priceBigSmall(item.minPrice)"
- ></rich-text>
- </view>
- <view class="small">¥ {{ item.minSalePrice }}</view>
- </view>
- <view class="three"
- >{{ item.groupPeopleNum }}人团,已拼
- <text style="color: red"> {{ item.resultSaleNum }}</text>
- 件</view
- >
- </view>
- <view class="button">去拼团</view>
- </view>
- </view>
- </view>
- </view>
- </view>
- <noData v-else :config="{ top: 1, content: '暂无商品~' }"></noData>
- </view>
- </template>
- <script setup>
- import { ref, onMounted } from "vue";
- import { activitygoodswillYouSpellPage_Api } from "@/api/groupbuy";
- const props = defineProps({
- skeletonShow: {
- type: Boolean,
- default: false,
- },
- bgImage: {
- type: String,
- default: "",
- },
- });
- const emit = defineEmits(["goDetail", "goProductDetails"]);
- const groupList = ref([]);
- const goDetail = (url) => {
- emit("goDetail", url);
- };
- const goProductDetails = (url) => {
- emit("goProductDetails", url);
- };
- /**团购 */
- const getgroupList = () => {
- activitygoodswillYouSpellPage_Api({
- pageSize: 10,
- pageNum: 1,
- }).then((res) => {
- if (res && res.code == 200) {
- groupList.value = res.rows || [];
- }
- });
- };
- onMounted(() => {
- getgroupList();
- });
- defineExpose({
- init: getgroupList,
- });
- </script>
- <style scoped lang="scss">
- .group-work {
- margin: 30rpx 0;
- background: #d4f2e8;
- padding-bottom: 30rpx;
- border-radius: 10rpx;
- box-sizing: border-box;
- overflow: hidden;
- .group-work-main {
- padding: 30rpx;
- margin: 20rpx 30rpx 0 30rpx;
- box-sizing: border-box;
- background-color: #ffffff;
- border-radius: 10rpx;
- }
- }
- .head-item {
- display: flex;
- align-items: center;
- justify-content: space-between;
- padding: 27rpx 30rpx;
- box-sizing: border-box;
- overflow: hidden;
- background-size: 100% 100%;
- background-repeat: no-repeat;
- .top-left {
- .top-left-title {
- font-size: 36rpx;
- font-family: PingFang SC, PingFang SC-Bold;
- font-weight: 700;
- }
- .top-left-tip {
- font-size: 24rpx;
- font-family: PingFang SC, PingFang SC-Regular;
- font-weight: 400;
- margin-top: 5rpx;
- }
- }
- .top-right {
- width: 165rpx;
- height: 67rpx;
- line-height: 67rpx;
- background: #ffffff;
- border-radius: 34rpx;
- box-sizing: border-box;
- font-size: 24rpx;
- font-family: PingFang SC, PingFang SC-Regular;
- font-weight: 400;
- text-align: center;
- display: flex;
- align-items: center;
- justify-content: center;
- }
- }
- .middle_item {
- padding: 0 30rpx;
- }
- .middle_item:last-child {
- border: none;
- }
- .middle {
- display: flex;
- border-bottom: 1rpx solid #f7f7f7;
- padding-bottom: 40rpx;
- padding-top: 42rpx;
- .middle-left {
- margin-right: 20rpx;
- image {
- width: 226rpx;
- height: 226rpx;
- border-radius: 10rpx;
- }
- }
- .middle-right {
- width: 100%;
- display: flex;
- flex-direction: column;
- justify-content: space-between;
- margin-top: 10rpx;
- padding-bottom: 10rpx;
- .middle-title {
- font-size: 28rpx;
- margin-top: 10rpx;
- color: #181818;
- font-weight: 400;
- line-height: 36rpx;
- }
- .division {
- display: flex;
- width: 100%;
- padding-bottom: 10rpx;
- justify-content: space-between;
- }
- .middle-num {
- flex: 1;
- .contain {
- display: flex;
- align-items: flex-end;
- }
- .three {
- font-size: 24rpx;
- font-weight: Regular;
- color: #333333;
- line-height: 24rpx;
- margin-top: 8rpx;
- }
- .large {
- color: #00bf5a;
- font-size: 36rpx;
- font-weight: Bold;
- line-height: 24rpx;
- }
- .small {
- margin-left: 16rpx;
- font-size: 22rpx;
- font-weight: 500;
- color: #cccccc;
- line-height: 24rpx;
- text-decoration: line-through;
- }
- }
- .button {
- width: 130rpx;
- height: 60rpx;
- text-align: center;
- line-height: 60rpx;
- color: #ffffff;
- font-size: 28rpx;
- background: #069d4d;
- border-radius: 32rpx;
- }
- }
- }
- </style>
|