miaosha.vue
4.4 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
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
<template>
<view class="content">
<view class='homehead miaoshahead'>
<view class="miaoshaimg">
<image src="../../static/miaoshatop.png" mode=""></image>
</view>
</view>
<view class="miaoshatime flexthree">
<view class='miaoname'>距离开始</view>
<view class='miaotime miaohour boxsizing'>8</view>
<view class="miaoname">天</view>
<view class="miaofen flexone miaohour">
<view class='miaotime miaok'>2</view>
<view class='miaotime'>3</view>
</view>
<view class="miaoname">:</view>
<view class="miaofen flexone miaohour">
<view class='miaotime boxsizing miaok'>4</view>
<view class='miaotime boxsizing'>5</view>
</view>
<view class="miaoname">:</view>
<view class="miaofen flexone miaohour">
<view class='miaotime boxsizing miaok'>1</view>
<view class='miaotime boxsizing'>2</view>
</view>
</view>
<!-- 搜索商品 -->
<view class="searchgood commnonpadding">
<view class="searchgooditem flexone boxsizing" v-for="(item,index) in orderlist" :key="index" @click="goodtail" :data-id="item.id">
<view class="gooditemleft">
<image :src="item.image" mode=""></image>
</view>
<view class="gooditemright ">
<view class="goodsouname morehidden">{{item.name}}</view>
<view class="miaogood flextwo">
<view class="miaogoodleft">
<view class="saleprice">¥{{item.seckill_price}}</view>
<view class="yuansaleprice">¥{{item.goods_price}}</view>
</view>
<view class="buynow">立即抢购</view>
</view>
<view class="miaojindu flextwo">
<view class="miaojinduleft">
<view class="miaojinnei" :style="{width:item.percentage+'%'}"></view>
</view>
<view class="miaojinduright">已抢{{item.percentage}}%</view>
</view>
</view>
</view>
<!-- <view class="searchgooditem flexone boxsizing">
<view class="gooditemleft">
<image src="../../static/goopic.png" mode=""></image>
</view>
<view class="gooditemright ">
<view class="goodsouname morehidden">商品名称商品名称商品名称商品名称商品名称商品名称商品名称商品名称</view>
<view class="miaogood flextwo">
<view class="miaogoodleft">
<view class="saleprice">¥288</view>
<view class="yuansaleprice">¥340</view>
</view>
<view class="buynow">立即抢购</view>
</view>
<view class="miaojindu flextwo">
<view class="miaojinduleft">
<view class="miaojinnei"></view>
</view>
<view class="miaojinduright">已抢60%</view>
</view>
</view>
</view>
<view class="searchgooditem flexone boxsizing">
<view class="gooditemleft">
<image src="../../static/goopic.png" mode=""></image>
</view>
<view class="gooditemright ">
<view class="goodsouname morehidden">商品名称商品名称商品名称商品名称商品名称商品名称商品名称商品名称</view>
<view class="miaogood flextwo">
<view class="miaogoodleft">
<view class="saleprice">¥288</view>
<view class="yuansaleprice">¥340</view>
</view>
<view class="buynow">立即抢购</view>
</view>
<view class="miaojindu flextwo">
<view class="miaojinduleft">
<view class="miaojinnei"></view>
</view>
<view class="miaojinduright">已抢60%</view>
</view>
</view>
</view>
-->
</view>
</view>
</template>
<script>
import app from "../../App.vue";
export default {
data() {
return {
showbanben: false,
page:1,
orderlist:[]
}
},
onLoad() {
this.getmiaosha()
},
methods: {
getmiaosha() {
let that = this;
var url = 'flour_goods/get_flour_goods';
console.log('获取的参数', that.seldata)
var params = {
is_seckill: 1,
page: that.page,
pageNum: 10
}
console.log(params)
app.post(url, params, "post").then((res) => {
console.log(res);
that.orderlist=that.orderlist.concat(res.data.data)
// that.goodinfo=res.data.data;
}).catch((err) => {})
},
// 商品详情
goodtail(e) {
let id = e.currentTarget.dataset.id;
console.log(id)
// type 1 面访商品
uni.navigateTo({
url: '/pages/nearshop/goodtail?id=' + id + '&type=' + 1
})
},
},
onReachBottom() {
let newpage=this.page;
newpage++;
this.page=newpage;
this.getmiaosha()
}
}
</script>
<style>
@import url('../../base/homepage');
</style>