commodity.vue
5.65 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
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
<template>
<view class="container">
<global-loading />
<view>
<view v-for="(item, index) in Productlist" :key="index" class="goodsDetails-box flex-display flex-column mar-left-30"
@click="goodsDatails(item)">
<view class="goodsDetails flex-items-plus flex-row mar-top-30">
<image class="goodsImg" :src="item.image"></image>
<view class="mar-left-30">
<view class="goodsName-box overflowNoDot">
<label class="goodsName fs26 mar-left-20">{{item.productName}}</label>
</view>
<view class="priceBuyNum-box mar-top-20">
<label class="fs24 font-color-C5AA7B">¥</label>
<label class="fs36 font-color-C5AA7B mar-left-10">{{item.price}}</label>
<label class="fs24 font-color-999 mar-left-20" v-if="item.users != null">{{item.users}}人付款</label>
<label class="fs24 font-color-999 mar-left-20" v-else>0人付款</label>
</view>
<view class="fenxiang" @click.stop="fenxiang(item)">
分享
</view>
</view>
</view>
</view>
</view>
</view>
</template>
<script>
const NET = require('../../utils/request')
const API = require('../../config/api')
import tkiQrcode from '@/components/tki-qrcode/tki-qrcode.vue'
export default {
data() {
return {
Productlist: [],
item:{},
fenxiangitem: {},
show: false,
erweima: '',
tuimgs:'',
size: 160, // 二维码大小
onval: true, // val值变化时自动重新生成二维码
loadMake: true, // 组件加载完成后自动生成二维码
shopId:0,
headimg:'',
username:'',
distributorId:0,
page: 1,
pageSize: 20,
loadingType:0
}
},
onLoad(options) {
this.shopId = options.shopId
this.distributorId = options.distributorId
this.headimg = options.headimg
this.username = options.username
this.getStoreProductList()
},
onReachBottom() {
if(this.loadingType == 1){
uni.stopPullDownRefresh()
}else{
this.page = this.page+1
this.getStoreProductList()
}
},
methods: {
getStoreProductList() {
// uni.showLoading({
// mask: true,
// title: '加载中...'
// })
NET.request(API.StoreProductList, {
shopId: this.shopId,
page:this.page,
pageSize:this.pageSize
}, 'GET').then(res => {
uni.hideLoading()
if(res.data.list.length == 0){
this.loadingType = 1
this.page = this.page
}
this.Productlist = this.Productlist.concat(res.data.list)
}).catch(res => {
uni.hideLoading()
})
},
goodsDatails(item) {
uni.navigateTo({
url: '../goodsModule/goodsDetails?productId='+item.productId+'&shopId='+this.shopId+'&skuId='+item.skuId
})
},
fenxiang(item) {
// #ifdef APP-PLUS
var system = 1
// #endif
// #ifdef H5
var system = 3
// #endif
// #ifdef MP-WEIXIN
var system = 2
// #endif
// #ifdef MP-ALIPAY
var system = 4
// #endif
// uni.showLoading({
// mask: true,
// title: '请稍候...'
// })
NET.request(API.getSharePic, {
productId: item.productId,
shopId: item.shopId,
skuId: item.skuId,
terminal: system
}, 'GET').then(res => {
uni.hideLoading()
// 推广商品
uni.navigateTo({
url: `../../pages_category_page1/distributionModule/shareProduct?shareType=2&shareImg=${res.data}&productId=${item.productId}&skuId=${item.skuId}&shopId=${item.shopId}&salesId=${this.distributorId}`
});
}).catch(res => {
uni.hideLoading()
})
}
}
}
</script>
<style lang='scss' scoped>
input {
padding-left: 80upx;
}
.warp {
display: flex;
align-items: center;
justify-content: center;
height: 100%;
}
.qrimg-i {
margin-right: 10px;
}
.rect {
width: 89%;
height: 80%;
background-color: #fff;
position: relative;
.guanbi {
width: 46rpx;
height: 46rpx;
position: absolute;
top: -100rpx;
left: 50%;
margin-left: -23rpx;
}
.user {
display: flex;
padding: 20upx;
}
}
.fenx {
position: fixed;
bottom: 0rpx;
z-index: 10001;
background-color: #F7F7F7;
width: 100%;
height: 98rpx;
display: flex;
color: #343434;
view {
line-height: 98rpx;
}
image {
width: 50rpx;
height: 50rpx;
display: inline-block;
margin-top: 25rpx;
}
}
.fenxiang {
height: 50upx;
line-height: 50upx;
width: 120upx;
color: #FFEBC4;
text-align: center;
position: absolute;
background-color: #333333;
right: 10upx;
}
.container {
.emptyCart-box {
margin-top: 70upx;
.emptyCart-img{
width: 216rpx;
height: 156rpx;
}
}
.searchImg {
width: 36upx;
height: 36upx;
position: absolute;
left: 60upx;
}
.search-box {
background-color: #F7F7F7;
border-radius: 33upx;
width: 530upx;
height: 66upx;
}
.searchboxPlace {
font-size: 26upx;
color: #A9A9A9;
padding-right: 30upx;
}
.searchClose-icon {
width: 30upx;
height: 30upx;
margin-left: -50upx;
}
.promotion618 {
width: 130upx;
height: 30upx;
}
.goodsDetails-box {
width: 690upx;
.goodsDetails {
position: relative;
border-bottom: 1upx solid #EDEDED;
padding-bottom: 30upx;
.goodsName-box {
width: 389upx;
height: 85upx;
.img618-cion {
width: 70upx;
height: 36upx;
}
}
.goodsImg {
width: 260upx;
height: 260upx;
}
.discounts-box {
margin-left: -10upx;
margin-top: 20upx;
.discounts-text {
margin-left: 10upx;
color: #C5AA7B;
background-color: #FFE4CC;
padding: 6upx 12upx;
border-radius: 4upx;
}
}
.arrowImg {
width: 20upx;
height: 20upx;
}
}
}
}
</style>