activity.vue
3.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
<template>
<view class="content">
<view class="Box">
<view class="productBox" v-for="(item,index) in productList" :key="index"
@click="goodsDateils(item.shopId,item.productId,item.skuId)">
<view class="proImg">
<image :src="item.image" mode=""></image>
</view>
<view class="rightBox">
<view class="proTitle">
{{item.productName}}
</view>
<view class="price">
<text class="fs36 font-color-red">
¥{{item.price}}
</text>
<text class="mar-left-10 fs26">
{{item.users}}人付款
</text>
</view>
<view class="flex-sp-between flex-display mar-top-20" @click.stop="goStore(item.shopId)">
<view>
{{item.shopName}}
</view>
<view>
<!-- <image class="rightIcon" src="" mode="aspectFill"></image> -->
</view>
</view>
</view>
</view>
</view>
</view>
</template>
<script>
const NET = require('@/utils/request')
const API = require('@/config/api')
export default {
data() {
return {
list: [],
pageSize: 1,
productList:[]
}
},
onPullDownRefresh() { //上拉触底函数
this.pageSize = this.pageSize + 1
this.GetremenList()
},
onLoad() {
this.GetremenList()
},
methods: {
// 获取列表数据
GetremenList() {
let timestamp = new Date().getTime()
NET.request(API.GetremenList, {
page: this.pageSize,
pageSize: 5,
timestamp: timestamp
}, 'get').then(res => {
uni.stopPullDownRefresh();
console.log(res)
if (res.code == 200) {
this.productList = res.data.list
} else {
uni.showToast({
title: res.message,
icon: 'none'
})
}
})
},
// 跳转店铺
goStore(shopId) {
uni.navigateTo({
url: './store/index?storeId=' + shopId
})
},
//商品详情
goodsDateils(shopId, productId, skuId) {
console.log(111)
uni.navigateTo({
url: './goodsModule/goodsDetails?shopId=' + shopId + '&productId=' + productId + '&skuId=' +
skuId
})
}
}
}
</script>
<style lang="scss" scoped>
page {
background-color: #FBE7E0;
}
.content {
.Box {
padding: 30upx;
.productBox {
background-color: #FFFFFF;
height: 280upx;
margin-bottom: 20upx;
border-radius: 20upx;
padding: 20upx;
display: flex;
justify-content: space-between;
.proImg {
width: 240upx;
height: 240upx;
image {
width: 100%;
height: 100%;
border-radius: 20upx;
}
}
.rightBox {
width: 60%;
.proTitle {
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
}
.biao {
margin-top: 20upx;
text {
margin-right: 10upx;
border-radius: 5upx;
color: #C5AA7B;
padding: 5upx 10upx 5upx;
background-color: #FBE7E0;
}
}
.price {
margin-top: 55upx;
}
.rightIcon {
width: 24upx;
height: 24upx;
}
}
}
}
}
</style>