|
@@ -3,7 +3,7 @@ import { getWindowHeight } from '@utils/style'
|
3
|
3
|
import { AtTabs, AtTabsPane } from 'taro-ui'
|
4
|
4
|
import "taro-ui/dist/style/components/tabs.scss"
|
5
|
5
|
import './index.scss'
|
6
|
|
-import {getThumbnail } from '@utils/tools'
|
|
6
|
+import { getThumbnail } from '@utils/tools'
|
7
|
7
|
// import Search from '@components/search'
|
8
|
8
|
import Banner from './banner'
|
9
|
9
|
import ready from '@utils/ready'
|
|
@@ -37,10 +37,10 @@ export default class Shop extends Component {
|
37
|
37
|
goodsList: [],
|
38
|
38
|
user: {},
|
39
|
39
|
current: 0,
|
40
|
|
- points:0
|
|
40
|
+ points: 0
|
41
|
41
|
}
|
42
|
42
|
|
43
|
|
- componentDidShow() {
|
|
43
|
+ componentDidShow () {
|
44
|
44
|
|
45
|
45
|
Taro.showLoading()
|
46
|
46
|
ready.queue(() => {
|
|
@@ -53,7 +53,7 @@ export default class Shop extends Component {
|
53
|
53
|
Taro.hideLoading()
|
54
|
54
|
}
|
55
|
55
|
|
56
|
|
- loadBannerList() {
|
|
56
|
+ loadBannerList () {
|
57
|
57
|
const payload = {
|
58
|
58
|
showPosition: 'mall',
|
59
|
59
|
cityId: this.props.curCity.id
|
|
@@ -65,7 +65,7 @@ export default class Shop extends Component {
|
65
|
65
|
})
|
66
|
66
|
}
|
67
|
67
|
|
68
|
|
- loadList() {
|
|
68
|
+ loadList () {
|
69
|
69
|
|
70
|
70
|
|
71
|
71
|
Taro.showLoading()
|
|
@@ -88,7 +88,7 @@ export default class Shop extends Component {
|
88
|
88
|
})
|
89
|
89
|
}
|
90
|
90
|
|
91
|
|
- loadGoodsBuilding() {
|
|
91
|
+ loadGoodsBuilding () {
|
92
|
92
|
const payload = {
|
93
|
93
|
|
94
|
94
|
cityId: this.props.curCity.id
|
|
@@ -115,7 +115,7 @@ export default class Shop extends Component {
|
115
|
115
|
})
|
116
|
116
|
}
|
117
|
117
|
|
118
|
|
- handleClick(value) {
|
|
118
|
+ handleClick (value) {
|
119
|
119
|
|
120
|
120
|
this.setState({
|
121
|
121
|
current: value
|
|
@@ -136,32 +136,32 @@ export default class Shop extends Component {
|
136
|
136
|
|
137
|
137
|
}
|
138
|
138
|
|
139
|
|
- onViewDetail(item) {
|
|
139
|
+ onViewDetail (item) {
|
140
|
140
|
Taro.navigateTo({
|
141
|
141
|
url: `/pages/shop/detail/index?id=${item.goodsId}`
|
142
|
142
|
})
|
143
|
143
|
}
|
144
|
144
|
|
145
|
|
- goPointRecords() {
|
|
145
|
+ goPointRecords () {
|
146
|
146
|
const { person: { points } } = this.props.userInfo
|
147
|
147
|
Taro.navigateTo({
|
148
|
148
|
url: `/pages/shop/integralDetail/index?points=` + points
|
149
|
149
|
})
|
150
|
150
|
}
|
151
|
151
|
|
152
|
|
- goPointRule() {
|
|
152
|
+ goPointRule () {
|
153
|
153
|
Taro.navigateTo({
|
154
|
154
|
url: `/pages/shop/rule/index`
|
155
|
155
|
})
|
156
|
156
|
}
|
157
|
157
|
|
158
|
|
- handleLocationClick() {
|
|
158
|
+ handleLocationClick () {
|
159
|
159
|
Taro.navigateTo({
|
160
|
160
|
url: `/pages/city/index`
|
161
|
161
|
})
|
162
|
162
|
}
|
163
|
163
|
|
164
|
|
- doSign() {
|
|
164
|
+ doSign () {
|
165
|
165
|
const { user: { id, havaSigned } } = this.state
|
166
|
166
|
if (havaSigned) {
|
167
|
167
|
return
|
|
@@ -183,7 +183,7 @@ export default class Shop extends Component {
|
183
|
183
|
})
|
184
|
184
|
}
|
185
|
185
|
|
186
|
|
- loadUserInfo() {
|
|
186
|
+ loadUserInfo () {
|
187
|
187
|
// debugger
|
188
|
188
|
queryUserInfo().then(user => {
|
189
|
189
|
console.log(user, "user")
|
|
@@ -196,14 +196,14 @@ export default class Shop extends Component {
|
196
|
196
|
})
|
197
|
197
|
}
|
198
|
198
|
|
199
|
|
- renderLogin() {
|
|
199
|
+ renderLogin () {
|
200
|
200
|
return <Authorize></Authorize>
|
201
|
201
|
}
|
202
|
202
|
handleBannerClick = (item) => {
|
203
|
203
|
console.log(this, "this")
|
204
|
204
|
this.redirectTo(item)
|
205
|
205
|
}
|
206
|
|
- redirectTo({ targetId, contentType, buildingId } = {}) {
|
|
206
|
+ redirectTo ({ targetId, contentType, buildingId } = {}) {
|
207
|
207
|
switch (contentType) {
|
208
|
208
|
// 项目
|
209
|
209
|
case 'project':
|
|
@@ -248,7 +248,7 @@ export default class Shop extends Component {
|
248
|
248
|
}
|
249
|
249
|
}
|
250
|
250
|
|
251
|
|
- renderGoods() {
|
|
251
|
+ renderGoods () {
|
252
|
252
|
const { goods: { records = [] } } = this.props
|
253
|
253
|
const { goodsList, goodsBuilding, current } = this.state
|
254
|
254
|
|
|
@@ -261,9 +261,9 @@ export default class Shop extends Component {
|
261
|
261
|
{
|
262
|
262
|
goodsList.length &&
|
263
|
263
|
goodsList.map(item => (
|
264
|
|
-
|
|
264
|
+
|
265
|
265
|
<View className="item" key={item.goodsId} onClick={this.onViewDetail.bind(this, item)}>
|
266
|
|
- {console.log(item,'--item---')}
|
|
266
|
+ {console.log(item, '--item---')}
|
267
|
267
|
<Image className="item__img" mode="aspectFill" src={item.imgUrl} />
|
268
|
268
|
<View className="item__title">{item.goodsName}</View>
|
269
|
269
|
<View className="item__des">
|
|
@@ -288,7 +288,7 @@ export default class Shop extends Component {
|
288
|
288
|
{
|
289
|
289
|
goodsBuilding && goodsBuilding.length >= 2 &&
|
290
|
290
|
<View className="list__wrap">
|
291
|
|
- <View className="hot_title" style={{marginBottom:'0'}}>热门商品</View>
|
|
291
|
+ <View className="hot_title" style={{ marginBottom: '0' }}>热门商品</View>
|
292
|
292
|
<AtTabs scroll tabDirection='horizontal' current={current} tabList={goodsBuilding} onClick={this.handleClick.bind(this)}>
|
293
|
293
|
|
294
|
294
|
{goodsBuilding.map((l_item, index) => (
|
|
@@ -330,7 +330,7 @@ export default class Shop extends Component {
|
330
|
330
|
)
|
331
|
331
|
}
|
332
|
332
|
|
333
|
|
- renderDetail() {
|
|
333
|
+ renderDetail () {
|
334
|
334
|
const { user, points } = this.state
|
335
|
335
|
const { userInfo: { person }, curCity } = this.props
|
336
|
336
|
const { bannerList = [] } = this.state
|
|
@@ -389,7 +389,7 @@ export default class Shop extends Component {
|
389
|
389
|
);
|
390
|
390
|
}
|
391
|
391
|
|
392
|
|
- render() {
|
|
392
|
+ render () {
|
393
|
393
|
const { person: { phone, tel } } = this.props.userInfo
|
394
|
394
|
|
395
|
395
|
return (
|