Просмотр исходного кода

Merge branch 'feature' of https://gitlab.com/Arisono/SkWeiChat-Baidu into feature

# Conflicts:
#	WeiChat/version.properties
Arison 8 лет назад
Родитель
Сommit
df78fb3e3d

+ 3 - 3
WeiChat/version.properties

@@ -1,5 +1,5 @@
-#Wed Jan 24 16:39:59 CST 2018
-debugName=146
+#Wed Jan 24 18:21:06 CST 2018
+debugName=147
 versionName=613
-debugCode=146
+debugCode=147
 versionCode=152

+ 40 - 7
app_modular/appbooking/src/main/java/com/modular/booking/activity/services/BServicesActivity.java

@@ -129,13 +129,16 @@ public class BServicesActivity extends OABaseActivity implements View.OnClickLis
         MyGridView mGridView = findViewById(R.id.mGridView);
         mBanner = findViewById(R.id.city_industry_service_main_banner);
         mBanner.setImageLoader(new BannerImageLoader());
-        List<String> imgList=new ArrayList<>();
-        imgList.add("http://demo.sc.chinaz.com/Files/DownLoad/webjs1/201707/jiaoben5258/images/3-1.jpg");
-        imgList.add("http://demo.sc.chinaz.com/Files/DownLoad/webjs1/201707/jiaoben5258/images/2-1.jpg");
-        imgList.add("http://demo.sc.chinaz.com/Files/DownLoad/webjs1/201707/jiaoben5258/images/1-1.jpg");
-        imgList.add("http://demo.sc.chinaz.com/Files/DownLoad/webjs1/201707/jiaoben5258/images/2-1.jpg");
-        mBanner.update(imgList);
-        mBanner.start();
+        
+//        List<String> imgList=new ArrayList<>();
+//        imgList.add("http://demo.sc.chinaz.com/Files/DownLoad/webjs1/201707/jiaoben5258/images/3-1.jpg");
+//        imgList.add("http://demo.sc.chinaz.com/Files/DownLoad/webjs1/201707/jiaoben5258/images/2-1.jpg");
+//        imgList.add("http://demo.sc.chinaz.com/Files/DownLoad/webjs1/201707/jiaoben5258/images/1-1.jpg");
+//        imgList.add("http://demo.sc.chinaz.com/Files/DownLoad/webjs1/201707/jiaoben5258/images/2-1.jpg");
+//        mBanner.update(imgList);
+//        mBanner.start();
+        
+        
         List<SBMenuModel> menuModels = new ArrayList<>();
         SBMenuModel menuModel = new SBMenuModel();
         menuModel.setUrl("");
@@ -330,8 +333,38 @@ public class BServicesActivity extends OABaseActivity implements View.OnClickLis
 
     private void intData() {
         loadListData(pageSize);
+        initBannerData();
     }
 
+    
+    private void initBannerData(){
+          HttpClient httpClient=new HttpClient.Builder(Constants.IM_BASE_URL()).build();
+                 httpClient.Api().send(new HttpClient.Builder()
+                 .url("user/appAd")
+                 .add("token",MyApplication.getInstance().mAccessToken)
+                 .method(Method.POST)
+                 .build(),new ResultSubscriber<Object>(new ResultListener<Object>() {
+          
+                     @Override
+                     public void onResponse(Object o) {
+                         try {
+                             LogUtil.d(TAG,toString());
+                             String result=  JSON.parseObject(o.toString()).getString("result");
+                             String url=  JSON.parseArray(result).getJSONObject(0).getString("aa_urlc");
+                             List<String> imgList=new ArrayList<>();
+                             imgList.add(url);
+                             imgList.add(url);
+                             imgList.add(url);
+                             imgList.add(url);
+                             mBanner.update(imgList);
+                             mBanner.start();
+                         } catch (Exception e) {
+                             e.printStackTrace();
+                         }
+                     }
+                 }));
+        
+    }
 
 //    @Override
 //    protected void onResume() {

+ 3 - 1
app_modular/appbooking/src/main/res/layout/item_dish_catagory_list.xml

@@ -4,9 +4,11 @@
     android:layout_height="match_parent">
     <TextView
         android:id="@+id/tv_name"
-        android:layout_width="wrap_content"
+        android:layout_width="match_parent"
         android:layout_height="wrap_content"
         android:layout_gravity="center"
+        android:gravity="center"
+        android:layout_centerInParent="true"
         android:layout_marginTop="@dimen/dp_4"
         android:layout_marginBottom="@dimen/dp_4"
         android:maxLines="2"