Browse Source

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

Arison 7 năm trước cách đây
mục cha
commit
001c8d4e6f

+ 5 - 3
WeiChat/build.gradle

@@ -131,13 +131,13 @@ android {
                     //赋值app属性版本名
                     //variant.mergedFlavor.versionName = getVersionName() + "_" + variant.productFlavors[0].name+"(Build"+currentVersionCode+")"
                     //variant.mergedFlavor.versionName ="v"+versionArray[0].toString().substring(0,1)+"."+ versionArray[0].toString().substring(1,2)+"."+  versionArray[0].toString().substring(2,3)
-                    def releaseInfo= "v"+versionArray[0].toString().substring(0,1)+"."+ versionArray[0].toString().substring(1,2)+"."+  versionArray[0].toString().substring(2,3)+ "_" + variant.productFlavors[0].name+"(Build"+versionArray[1]+")"
+                    def releaseInfo = "v" + versionArray[0].toString().substring(0, 1) + "." + versionArray[0].toString().substring(1, 2) + "." + versionArray[0].toString().substring(2, 3) + "_" + variant.productFlavors[0].name + "(Build" + versionArray[1] + ")"
                     fileName = "WeiChat_${releaseInfo}_release.apk"
 
                 } else if (variant.buildType.name.equals('debug')) {
                     //赋值app属性版本名
-                    variant.mergedFlavor.versionName = getVersionName() + "_" + releaseTime() + "_" + variant.productFlavors[0].name+"(Build"+versionArray[3]+")"+"_debug"
-                    def debugInfo= getVersionName() + "_" + releaseTime() + "_" + variant.productFlavors[0].name+"(Build"+versionArray[3]+")"
+                    variant.mergedFlavor.versionName = getVersionName() + "_" + releaseTime() + "_" + variant.productFlavors[0].name + "(Build" + versionArray[3] + ")" + "_debug"
+                    def debugInfo = getVersionName() + "_" + releaseTime() + "_" + variant.productFlavors[0].name + "(Build" + versionArray[3] + ")"
                     fileName = "WeiChat_${debugInfo}_debug.apk"
 
                 }
@@ -253,6 +253,8 @@ dependencies {
     compile project(':appbooking')
 //    compile project(':android-pdf-viewer')
     compile project(':apputils')
+    compile 'com.android.support.constraint:constraint-layout:1.0.2'
+    compile 'com.android.support:support-v4:26.+'
 }
 
 buildscript {

+ 161 - 0
WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/me/PayListActivity.java

@@ -0,0 +1,161 @@
+package com.xzjmyk.pm.activity.ui.me;
+
+import android.os.Bundle;
+import android.util.Log;
+import android.view.View;
+import android.widget.Button;
+
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
+import com.andreabaccega.widget.FormEditText;
+import com.common.config.BaseConfig;
+import com.core.app.MyApplication;
+import com.core.base.BaseActivity;
+import com.core.utils.ToastUtil;
+import com.core.widget.MyListView;
+import com.me.network.app.http.HttpClient;
+import com.me.network.app.http.Method;
+import com.me.network.app.http.rx.Result2Listener;
+import com.me.network.app.http.rx.ResultSubscriber;
+import com.modular.apputils.listener.OnPlayListener;
+import com.modular.apputils.utils.playsdk.AliPlay;
+import com.modular.apputils.utils.playsdk.WxPlay;
+import com.xzjmyk.pm.activity.R;
+
+public class PayListActivity extends BaseActivity implements OnPlayListener {
+
+    private Button pay_btn;
+    private int type;
+
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        setContentView(R.layout.activity_pay_list);
+        initView();
+        initData();
+        initEvent();
+    }
+
+    private void initEvent() {
+        pay_btn.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View view) {
+                switch(type){
+                    case 1:
+//                        payName="微信";
+                        toWxPay();
+                        break;
+                    case 2:
+//                        payName="支付宝";
+                        toAliPay();
+                        break;
+                    case 3:
+//                        payName="银联";
+                        break;
+                    default:break;
+                }
+            }
+        });
+    }
+
+    /**
+     * 支付宝
+     */
+    private void toAliPay() {
+        new HttpClient.Builder("http://qq784602719.imwork.net:43580/")
+                .isDebug(BaseConfig.isDebug())
+                .build()
+                .Api()
+                .send(new HttpClient.Builder()
+                        .url("fruits/alipay/createOrder.do")
+                        .method(Method.POST)
+                        .build(), new ResultSubscriber<>(new Result2Listener<Object>() {
+
+                    @Override
+                    public void onResponse(Object o) {
+                        Log.i(TAG, "Success:" + o.toString());
+                        String message = o.toString();
+                        message = JSON.parseObject(o.toString()).getString("data");
+                        Log.i(TAG, "message:" + message);
+                        AliPlay.api().alipay(PayListActivity.this, message, PayListActivity.this);
+                    }
+
+                    @Override
+                    public void onFailure(Object t) {
+                        Log.i(TAG, "Failure:" + t.toString());
+                    }
+                }));
+    }
+
+    /**
+     * 微信支付
+     */
+    private void toWxPay() {
+                new HttpClient.Builder("http://nf20718343.iask.in:15161")
+                        .isDebug(BaseConfig.isDebug())
+                        .build()
+                        .Api()
+                        .send(new HttpClient.Builder()
+                        .url("/wxpay/appPay")
+                                .add("userid", MyApplication.getInstance().getLoginUserId())
+                                .add("totalFee",0.01)
+                        .method(Method.POST)
+                        .build(), new ResultSubscriber<>(new Result2Listener<Object>() {
+
+                    @Override
+                    public void onResponse(Object o) {
+                        Log.i(TAG, "Success:" + o.toString());
+                        String message = o.toString();
+                        JSONObject data = JSON.parseObject(JSON.parseObject(o.toString()).getString("msg"));
+                        message = data.toJSONString();
+                        Log.i(TAG, "message:" + message);
+                        WxPlay.api().wxPay(ct, message, PayListActivity.this);
+                    }
+
+                    @Override
+                    public void onFailure(Object t) {
+                        Log.i(TAG, "Failure:" + t.toString());
+                    }
+                }));
+    }
+
+    private void initView() {
+        FormEditText money_et = findViewById(R.id.money_et);
+        pay_btn = findViewById(R.id.pay_btn);
+        MyListView orders_lv = findViewById(R.id.orders_lv);
+
+        type = getIntent().getIntExtra("paytype", -1);
+        String payName = null;
+        switch(type){
+            case 1:
+                payName="微信";
+                break;
+            case 2:
+                payName="支付宝";
+                break;
+            case 3:
+                payName="银联";
+                break;
+            default:break;
+        }
+        pay_btn.setText(payName);
+    }
+    private void initData() {
+
+    }
+
+    @Override
+    public void onSuccess(String resultStatus, String resultInfo) {
+        ToastUtil.showToast(ct, "支付成功");
+    }
+
+    @Override
+    public void onFailure(String resultStatus, String resultInfo) {
+        ToastUtil.showToast(ct, "支付失败");
+    }
+
+    @Override
+    public void onPointerCaptureChanged(boolean hasCapture) {
+
+    }
+}

+ 46 - 0
WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/me/PayTestActivity.java

@@ -0,0 +1,46 @@
+package com.xzjmyk.pm.activity.ui.me;
+
+import android.content.Intent;
+import android.os.Bundle;
+
+import com.core.base.BaseActivity;
+
+public class PayTestActivity extends BaseActivity {
+    private int paytype = -1;
+
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+//        setContentView(R.layout.activity_pay_test);
+//        initView();
+    }
+
+//    private void initView() {
+//        findViewById(R.id.wxpay_btn).setOnClickListener(new View.OnClickListener() {
+//            @Override
+//            public void onClick(View view) {
+//                paytype = 1;
+//              gotoPayActivity(paytype);
+//            }
+//        });
+//        findViewById(R.id.alipay_btn).setOnClickListener(new View.OnClickListener() {
+//            @Override
+//            public void onClick(View view) {
+//                paytype = 2;
+//                gotoPayActivity(paytype);
+//            }
+//        });
+//        findViewById(R.id.unionpay_btn).setOnClickListener(new View.OnClickListener() {
+//            @Override
+//            public void onClick(View view) {
+//                paytype = 3;
+//                gotoPayActivity(paytype);
+//        }
+//        });
+//    }
+
+    private void gotoPayActivity(int type) {
+        startActivity(new Intent(this,PayListActivity.class)
+                                    .putExtra("paytype",type));
+    }
+}

+ 74 - 0
WeiChat/src/main/res/layout/activity_pay_list.xml

@@ -0,0 +1,74 @@
+<?xml version="1.0" encoding="utf-8"?>
+<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:app="http://schemas.android.com/apk/res-auto"
+    xmlns:tools="http://schemas.android.com/tools"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    tools:context="com.xzjmyk.pm.activity.ui.me.PayListActivity">
+
+    <LinearLayout
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:orientation="vertical">
+        <com.andreabaccega.widget.FormEditText
+            android:id="@+id/money_et"
+            android:layout_width="match_parent"
+            android:layout_height="50dp"
+            android:textColor="@color/dark_dark_grey"
+            android:padding="10dp"
+            android:layout_centerVertical="true"
+            android:background="@null"
+            android:hint="请输入支付金额"
+            android:textSize="15sp"
+            android:gravity="center"
+            android:maxLength="6"
+            android:inputType="number"
+            android:text="0.01"
+            />
+        <Button
+            android:id="@+id/pay_btn"
+            android:layout_margin="20dp"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:layout_alignParentBottom="true"
+            android:background="@drawable/bg_bule_btn"
+            android:padding="10dp"
+            android:textColor="@color/white"
+            android:textSize="@dimen/text_main"
+            android:visibility="visible"/>
+        <TextView
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:text="订单列表:"
+            android:textSize="@dimen/text_main"
+            android:layout_marginLeft="20dp"
+            />
+
+        <com.core.widget.CustomerScrollView
+            android:layout_width="match_parent"
+            android:layout_height="match_parent"
+            android:fillViewport="true">
+
+            <LinearLayout
+                android:layout_width="match_parent"
+                android:layout_height="match_parent"
+                android:orientation="vertical">
+                <View
+                    android:layout_width="match_parent"
+                    android:layout_height="10dp"
+                    android:background="#FBFBFB" />
+                <com.core.widget.MyListView
+                    android:id="@+id/orders_lv"
+                    android:layout_width="match_parent"
+                    android:layout_height="match_parent"
+                    android:padding="10dp"
+                    android:visibility="visible"
+                    android:background="@color/white"
+                    >
+                </com.core.widget.MyListView>
+            </LinearLayout>
+        </com.core.widget.CustomerScrollView>
+    </LinearLayout>
+
+
+</android.support.constraint.ConstraintLayout>

+ 11 - 0
WeiChat/src/main/res/layout/content_pay_test.xml

@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="utf-8"?>
+<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:app="http://schemas.android.com/apk/res-auto"
+    xmlns:tools="http://schemas.android.com/tools"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    app:layout_behavior="@string/appbar_scrolling_view_behavior"
+    tools:context="com.xzjmyk.pm.activity.ui.me.PayTestActivity"
+    tools:showIn="@layout/activity_pay_test">
+
+</android.support.constraint.ConstraintLayout>

+ 1 - 0
WeiChat/src/main/res/layout/fragment_me.xml

@@ -568,6 +568,7 @@
                 android:background="@drawable/oa_next"
                 android:contentDescription="@string/app_name" />
         </RelativeLayout>
+
     </LinearLayout>
 
 </ScrollView>

+ 1 - 1
app_core/common/src/main/res/layout/activity_expense_reimbursement.xml

@@ -112,7 +112,7 @@
                     android:textColor="@color/text_main"
                     android:textSize="15sp" />
 
-                <com.andreabaccega.widget.FormEditText xmlns:editTextFormExample="http://schemas.android.com/apk/res-auto"
+                <com.andreabaccega.widget.FormEditText
                     android:id="@+id/reimbursement_currency_fet"
                     android:layout_width="100dp"
                     android:layout_height="wrap_content"

+ 4 - 4
app_core/common/src/main/res/layout/activity_feedback.xml

@@ -1,7 +1,7 @@
 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
-                android:layout_width="match_parent"
-                android:layout_height="match_parent"
-                android:background="#EBE9EA">
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:background="#EBE9EA">
 
     <ScrollView
         android:id="@+id/scroll_view"
@@ -142,4 +142,4 @@
             </LinearLayout>
         </LinearLayout>
     </ScrollView>
-</RelativeLayout>
+</RelativeLayout>

+ 0 - 1
app_modular/appme/src/main/java/com/uas/appme/settings/activity/CheckWagesActivity.java

@@ -28,7 +28,6 @@ import com.common.data.DateFormatUtil;
 import com.common.data.JSONUtil;
 import com.common.data.StringUtil;
 import com.common.system.DisplayUtil;
-import com.core.app.Constants;
 import com.core.app.MyApplication;
 import com.core.base.BaseActivity;
 import com.core.utils.CommonUtil;

+ 3 - 1
app_modular/appme/src/main/java/com/uas/appme/settings/activity/WagesDetailsActivity.java

@@ -109,6 +109,7 @@ public class WagesDetailsActivity extends BaseActivity implements View.OnClickLi
 
 
     private void showDatas(String result) {
+        LogUtil.prinlnLongMsg("resultWage",result);
         haveData = true;
         wages_ll.setVisibility(View.VISIBLE);
         try {
@@ -116,7 +117,7 @@ public class WagesDetailsActivity extends BaseActivity implements View.OnClickLi
             if (salaryObject != null){
                 JSONArray configsArray = salaryObject.getJSONArray("configs");
                 JSONObject dataObject = salaryObject.getJSONObject("data");
-                if (dataObject.size() == 0) {
+                if ( dataObject == null || dataObject.size() == 0 ||  ListUtils.isEmpty(configsArray)) {
                     showEnty();
                     return;
                 }
@@ -163,6 +164,7 @@ public class WagesDetailsActivity extends BaseActivity implements View.OnClickLi
             }
        } catch (Exception e) {
             e.printStackTrace();
+            showEnty();
         }
 }
 

+ 2 - 5
app_modular/apputils/src/main/java/com/modular/apputils/utils/playsdk/WxPlay.java

@@ -2,7 +2,6 @@ package com.modular.apputils.utils.playsdk;
 
 
 import android.content.Context;
-
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
 import com.common.LogUtil;
@@ -19,7 +18,6 @@ import com.tencent.mm.opensdk.openapi.WXAPIFactory;
 public class WxPlay {
     private IWXAPI wxApi;
     private static WxPlay api;
-
     public static WxPlay api() {
         if (api == null) {
             synchronized (WxPlay.class) {
@@ -30,9 +28,7 @@ public class WxPlay {
         }
         return api;
     }
-
-    private WxPlay() {
-
+        private WxPlay() {
     }
 
     public void wxPay(Context context, String orderInfo, OnPlayListener onPlayListener) {
@@ -59,4 +55,5 @@ public class WxPlay {
         }
 
     }
+
 }

+ 0 - 3
app_modular/appworks/src/main/java/com/uas/appworks/OA/platform/fragment/CharitableListFragment.java

@@ -369,12 +369,9 @@ public class CharitableListFragment extends EasyFragment implements OnPlayListen
 ////
 //                }
 //            });
-
-
     }
 
     private CharitableAdapter charitableAdapter;
-
     private void setContantData(List<CharitModel> models) {
 //        if (charitableAdapter == null) {
         charitableAdapter = new CharitableAdapter(ct, models, new CharitableAdapter.MyClickListener() {

+ 1 - 0
app_modular/appworks/src/main/java/com/uas/appworks/widget/SelectPlayPop.java

@@ -177,6 +177,7 @@ public class SelectPlayPop {
                 hideKeyboard(ct, autoNumEd);
             }
         });
+
         giftBtn.setOnClickListener(new View.OnClickListener() {
             @Override
             public void onClick(View view) {