banner的小问题
This commit is contained in:
parent
0a4b3269e6
commit
d2db9f1478
@ -9,12 +9,15 @@ buildscript {
|
|||||||
maven{url 'https://maven.aliyun.com/repository/jcenter' }
|
maven{url 'https://maven.aliyun.com/repository/jcenter' }
|
||||||
maven {url 'https://developer.huawei.com/repo/'}
|
maven {url 'https://developer.huawei.com/repo/'}
|
||||||
maven { url 'https://developer.hihonor.com/repo/' }
|
maven { url 'https://developer.hihonor.com/repo/' }
|
||||||
|
maven { url "https://mvn.mob.com/android"}
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
classpath 'com.android.tools.build:gradle:7.2.0'
|
classpath 'com.android.tools.build:gradle:7.2.0'
|
||||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
||||||
classpath 'com.huawei.agconnect:agcp:1.6.0.300'
|
classpath 'com.huawei.agconnect:agcp:1.6.0.300'
|
||||||
|
classpath 'com.android.tools.build:gradle:3.1.2'
|
||||||
|
classpath 'com.mob.sdk:MobSDK:+'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -224,11 +224,12 @@ class CircleLogic extends GetxController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void getBanner() async {
|
void getBanner() async {
|
||||||
bannerList.clear();
|
|
||||||
var data =
|
var data =
|
||||||
await DioManager.instance.get(url: Api.getNearbyBeanner, params: {});
|
await DioManager.instance.get(url: Api.getNearbyBeanner, params: {});
|
||||||
var bean = BaseResponse<BannerList>.fromJson(
|
var bean = BaseResponse<BannerList>.fromJson(
|
||||||
data, (data) => BannerList.fromJson(data));
|
data, (data) => BannerList.fromJson(data));
|
||||||
|
bannerList.clear();
|
||||||
bannerList.addAll(bean.data.banners);
|
bannerList.addAll(bean.data.banners);
|
||||||
cityName = bean.data.city;
|
cityName = bean.data.city;
|
||||||
}
|
}
|
||||||
@ -253,8 +254,10 @@ class CircleLogic extends GetxController {
|
|||||||
orientationList.forEach((element) {
|
orientationList.forEach((element) {
|
||||||
if (element.isSelect) orientations.add(element.id);
|
if (element.isSelect) orientations.add(element.id);
|
||||||
});
|
});
|
||||||
|
if(offset==0){
|
||||||
|
getBanner();
|
||||||
|
}
|
||||||
|
|
||||||
// getBanner();
|
|
||||||
var data = await DioManager.instance.post(url: Api.postNearbyList, params: {
|
var data = await DioManager.instance.post(url: Api.postNearbyList, params: {
|
||||||
"offset": offset,
|
"offset": offset,
|
||||||
'deep': deep,
|
'deep': deep,
|
||||||
|
|||||||
@ -476,7 +476,7 @@ class _CirclePageState extends State<CirclePage>
|
|||||||
}
|
}
|
||||||
|
|
||||||
Widget bannerView(CircleLogic controller) {
|
Widget bannerView(CircleLogic controller) {
|
||||||
return Container(
|
return SizedBox(
|
||||||
height: 160.sp,
|
height: 160.sp,
|
||||||
// margin: EdgeInsets.symmetric(horizontal: 16.sp),
|
// margin: EdgeInsets.symmetric(horizontal: 16.sp),
|
||||||
child: Swiper(
|
child: Swiper(
|
||||||
@ -485,7 +485,7 @@ class _CirclePageState extends State<CirclePage>
|
|||||||
loop: logic.bannerList.length>1?true:false,
|
loop: logic.bannerList.length>1?true:false,
|
||||||
// index:logic.index,
|
// index:logic.index,
|
||||||
itemBuilder: (BuildContext context, int index) {
|
itemBuilder: (BuildContext context, int index) {
|
||||||
// print(index);
|
print(logic.bannerList[index].picUrl);
|
||||||
return GestureDetector(
|
return GestureDetector(
|
||||||
onTap: () async {
|
onTap: () async {
|
||||||
print(logic.bannerList[index].param);
|
print(logic.bannerList[index].param);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user