周立森 5 年之前
父節點
當前提交
5184058c90
共有 1 個檔案被更改,包括 21 行新增21 行删除
  1. 21
    21
      src/pages/shop/index.js

+ 21
- 21
src/pages/shop/index.js 查看文件

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