空状态需要处理,需要添加分享页面
This commit is contained in:
64
pages/shop-together/index.vue
Normal file
64
pages/shop-together/index.vue
Normal file
@@ -0,0 +1,64 @@
|
||||
<script setup>
|
||||
import { onLoad } from '@dcloudio/uni-app'
|
||||
import { getMyGroupList } from '@/api/mall'
|
||||
import { ref } from 'vue'
|
||||
import { GROUP_STATUS } from '@/constants/mall-data'
|
||||
import { navigateTo } from '@/utils/router'
|
||||
|
||||
const list = ref([])
|
||||
const getData = async () => {
|
||||
const res = await getMyGroupList()
|
||||
list.value = res.data
|
||||
console.log(res.data)
|
||||
}
|
||||
|
||||
const onGo = id => {
|
||||
navigateTo('/pages/shop-together/detail', { id })
|
||||
}
|
||||
|
||||
onLoad(() => {
|
||||
getData()
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<view class="shop-together">
|
||||
<view
|
||||
v-for="item in list"
|
||||
:key="item.id"
|
||||
class="public-product_item"
|
||||
@click="onGo(item.id)"
|
||||
>
|
||||
<image
|
||||
:src="item.productImage"
|
||||
mode="scaleToFill"
|
||||
class="left-img"
|
||||
></image>
|
||||
<view class="right-content">
|
||||
<text class="product-name">{{ item.productName }}</text>
|
||||
<view class="line-box">
|
||||
<view class="rmb-box">
|
||||
<text></text>
|
||||
<text>¥{{ item.totalAmount }}</text>
|
||||
</view>
|
||||
<view
|
||||
:class="`_${GROUP_STATUS[item.status].class}`"
|
||||
class="state-box"
|
||||
>
|
||||
{{ GROUP_STATUS[item.status].name }}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
page {
|
||||
background: #f9f9f9;
|
||||
}
|
||||
@import '@/styles/mall.scss';
|
||||
.shop-together {
|
||||
padding: 16rpx 24rpx;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user