周立森 5 년 전
부모
커밋
6b7a261f73
2개의 변경된 파일15개의 추가작업 그리고 6개의 파일을 삭제
  1. 6
    2
      src/pages/person/index.js
  2. 9
    4
      src/pages/project/index.js

+ 6
- 2
src/pages/person/index.js 파일 보기

@@ -191,8 +191,12 @@ export default class Person extends Component {
191 191
           </View>
192 192
           <View className='qiandao-con'>
193 193
             <Text className='qiandao-text'>签到得积分,积分兑好礼,马上去签到吧!</Text>
194
-            <View className={user.havaSigned ? 'reday-qiandao-btn' : 'qiandao-btn'} onClick={this.doSign}>{user.havaSigned ? '已签到' : '签到'}</View>
195
-
194
+            {/* <View className={user.havaSigned ? 'reday-qiandao-btn' : 'qiandao-btn'} onClick={this.doSign}>{user.havaSigned ? '已签到' : '签到'}</View> */}
195
+            {
196
+                user.havaSigned ?
197
+                  ( <View className='reday-qiandao-btn' onClick={this.doSign}> 已签到</View> ):
198
+                  (<View className="qiandao__btn" onClick={this.doSign}>签到</View>)
199
+              }
196 200
             {/* <Text className='integral-cont_btn' onClick={this.goShop}>去兑换</Text> */}
197 201
 
198 202
           </View>

+ 9
- 4
src/pages/project/index.js 파일 보기

@@ -101,9 +101,14 @@ export default class Index extends Component {
101 101
       const payload = { location: `${location.longitude},${location.latitude}` }
102 102
 
103 103
       getLocationCity(payload).then(res => {
104
-        const curCity = res
105
-        this.updateCity(curCity)
106
-      }).catch(err=>{
104
+
105
+        let curCity = cityList.filter(item => {
106
+          return item.name == res.name
107
+        })
108
+
109
+        console.log('-----curCity-->', curCity)
110
+        this.updateCity(curCity[0] || defaultCity)
111
+      }).catch(err => {
107 112
         Taro.showToast({
108 113
           title: `定位错误: ${err.message}`,
109 114
           icon: 'none',
@@ -162,7 +167,7 @@ export default class Index extends Component {
162 167
   }
163 168
   loadBannerList () {
164 169
     const { curCity } = this.props
165
-    console.log(this.props,'this.props')
170
+    console.log(this.props, 'this.props')
166 171
     // 获取首页banner
167 172
     const payload = {
168 173
       showPosition: 'index'