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

1.升级jar包。
2,修改bugly上的问题。

石慧云 4 лет назад
Родитель
Сommit
cf0de69490

+ 1 - 1
app/build.gradle

@@ -125,7 +125,7 @@ dependencies {
     addComponent 'umeng'
     addComponent 'jpush'
     addComponent 'gaode'
-//    addComponent 'lookimg'
+   addComponent 'lookimg'
 
 
     //微信sdk

+ 2 - 1
app/src/main/java/com/quansu/heifengwuliu/activity/HomeActivity.kt

@@ -134,7 +134,8 @@ class HomeActivity : MBActivity<HomeVModel, ActivityHomeBinding>() {
 
         } else {
 
-            val oneFragment = DeliverGoodsFragment()
+           // val oneFragment = DeliverGoodsFragment()
+            val oneFragment =  OwnerSingleFragment()
             val twoFragment = WayBillFragment()
             val threeFragment = MineFragment()
 

+ 1 - 1
app/src/main/java/com/quansu/heifengwuliu/activity/WaybillDetailsActivity.kt

@@ -100,7 +100,7 @@ class WaybillDetailsActivity : MBActivity<WaybillDetailsVModel, ActivityWaybilld
                 UiUtils.dp2Px(context(), 15f),
                 UiUtils.dp2Px(context(), 10f)))
 
-         var adapter: ModelAdapter =ModelAdapter()
+         var adapter: ModelAdapter =ModelAdapter(vm.nopath)
         binding.recyclerVoucher.adapter=adapter
         adapter.addData(vm.nopath)
 

+ 41 - 3
app/src/main/java/com/quansu/heifengwuliu/adapter/ImgsAdapter.kt

@@ -9,6 +9,13 @@ import com.qmuiteam.qmui.kotlin.onClick
 import com.quansu.heifengwuliu.R
 import com.quansu.heifengwuliu.model.GoodsImgBean
 import com.quansu.heifengwuliu.vmodel.WaybillDetailsVModel
+import com.yanzhenjie.permission.AndPermission
+import com.yanzhenjie.permission.runtime.Permission
+import com.ysnows.base.ccretrofit.CCRetrofit
+import com.ysnows.base.route.IGaode
+import com.ysnows.base.route.ILookimg
+import java.util.*
+
 
 /**
  *Created by shihuiyun
@@ -26,7 +33,10 @@ class ImgsAdapter(val vm: WaybillDetailsVModel, data: MutableList<GoodsImgBean>)
             0 -> {//查看图片
                 helper.getView<ImageView>(R.id.img_attachment).load(item.url)
                 helper.setVisible(R.id.iv_delete, true)
-                var ivDelete= helper.getView<ImageView>(R.id.iv_delete)
+                var ivDelete = helper.getView<ImageView>(R.id.iv_delete)
+
+                var ivAttachment = helper.getView<ImageView>(R.id.img_attachment)
+
 
                 ivDelete.onClick {
                     vm.clearMoreImg(helper.adapterPosition)
@@ -34,11 +44,39 @@ class ImgsAdapter(val vm: WaybillDetailsVModel, data: MutableList<GoodsImgBean>)
                     notifyDataSetChanged()
 
                 }
+                ivAttachment.onClick {
+                    //查看大图
+
+                    var list = ArrayList<String>()
+                    list.add(item.url.toString())
+
+
+
+                    AndPermission.with(context)
+                            .runtime()
+                            .permission(
+                                    Permission.WRITE_EXTERNAL_STORAGE,
+                                    Permission.READ_EXTERNAL_STORAGE
+                            )
+                            .onGranted { data ->
+                                CCRetrofit.instance()
+                                        .create(ILookimg::class.java)
+                                        .previewImageArr(list, 0)
+                                        .subscribe()
+                            }
+                            .start()
+
+
+
+
+                }
+
+
 //                helper.addOnClickListener(R.id.iv_delete)
 //                helper.addOnClickListener(R.id.img_attachment)
             }
-            -1 ->{//上传图片
-                var fl= helper.getView<FrameLayout>(R.id.fl)
+            -1 -> {//上传图片
+                var fl = helper.getView<FrameLayout>(R.id.fl)
                 fl.onClick {
                     vm.choseMoreImg()
                 }

+ 27 - 1
app/src/main/java/com/quansu/heifengwuliu/adapter/ModelAdapter.kt

@@ -1,13 +1,39 @@
 package com.quansu.heifengwuliu.adapter
 
 import com.chad.library.adapter.base.viewholder.BaseDataBindingHolder
+import com.qmuiteam.qmui.kotlin.onClick
 import com.quansu.heifengwuliu.R
 import com.quansu.heifengwuliu.databinding.ItemModelBinding
+import com.yanzhenjie.permission.AndPermission
+import com.yanzhenjie.permission.runtime.Permission
 import com.ysnows.base.base.BAdapter
+import com.ysnows.base.ccretrofit.CCRetrofit
+import com.ysnows.base.route.ILookimg
+import java.util.*
 
-class ModelAdapter() : BAdapter<String, BaseDataBindingHolder<ItemModelBinding>>(R.layout.item_model) {
+class ModelAdapter(var list: ArrayList<String>) : BAdapter<String, BaseDataBindingHolder<ItemModelBinding>>(R.layout.item_model) {
 
     override fun convert(holder: BaseDataBindingHolder<ItemModelBinding>, item: String) {
         holder.dataBinding?.item = item
+
+        holder.dataBinding?.imgAttachment?.onClick {
+            //查看大图
+
+
+            AndPermission.with(context)
+                    .runtime()
+                    .permission(
+                            Permission.WRITE_EXTERNAL_STORAGE,
+                            Permission.READ_EXTERNAL_STORAGE
+                    )
+                    .onGranted { data ->
+                        CCRetrofit.instance()
+                                .create(ILookimg::class.java)
+                                .previewImageArr(list,holder.adapterPosition)
+                                .subscribe()
+                    }
+                    .start()
+
+        }
     }
 }

+ 2 - 2
app/src/main/java/com/quansu/heifengwuliu/config/Config.kt

@@ -4,8 +4,8 @@ import com.ysnows.base.config.IConfig
 
 class Config : IConfig {
     override fun baseUrl(): String {
-        return "https://heifengwuliu.qs110.com/"
-       //return "https://heifengwuliudev.qs110.com/"
+      // return "https://heifengwuliu.qs110.com/"
+      return "https://heifengwuliudev.qs110.com/"
 
     }
 

+ 15 - 0
app/src/main/java/com/quansu/heifengwuliu/fragment/OwnerMoreFragment.kt

@@ -97,6 +97,10 @@ class OwnerMoreFragment : MBFragment<OwnerMoreVModel, FragmentOwnermoreBinding>(
             if(numsTypeList.size>0){
                 numsTypeList.clear()
             }
+
+            if(carList.size>0){
+                carList.clear()
+            }
             goodsTypeList.addAll(it.goods_type)
 
             numsTypeList.addAll(it.nums_type)
@@ -761,6 +765,17 @@ class OwnerMoreFragment : MBFragment<OwnerMoreVModel, FragmentOwnermoreBinding>(
         //常用司机
         driverList.clear()
 
+        if(goodsTypeList.size>0){
+            goodsTypeList.clear()
+        }
+        if(numsTypeList.size>0){
+            numsTypeList.clear()
+        }
+
+        if(carList.size>0){
+            carList.clear()
+        }
+
 
         binding.viewHead.getTvChoseTime()!!.text=""
         binding.tvTotalMoney.text=""

+ 44 - 3
app/src/main/java/com/quansu/heifengwuliu/fragment/OwnerSingleFragment.kt

@@ -2,12 +2,14 @@ package com.quansu.heifengwuliu.fragment
 
 import android.app.Activity
 import android.content.Intent
+import android.os.Build
 import android.os.Bundle
 import android.text.Editable
 import android.text.TextUtils
 import android.text.TextWatcher
 import android.util.Log
 import android.view.LayoutInflater
+import android.view.View
 import android.view.ViewGroup
 import androidx.lifecycle.Observer
 import com.google.gson.Gson
@@ -39,6 +41,7 @@ import com.ysnows.base.model.PositionBean
 import com.ysnows.base.route.IGaode
 import com.ysnows.base.utils.B
 import com.ysnows.base.utils.UiSwitch
+import com.ysnows.base.utils.UiUtils
 import java.text.DecimalFormat
 
 /**
@@ -88,6 +91,7 @@ class OwnerSingleFragment : MBFragment<OwnerSingleVModel, FragmentOwnersingleBin
 
     override fun init(savedInstanceState: Bundle?) {
         super.init(savedInstanceState)
+        setShow()
         getData()
 
         vm.info.observe(this, Observer {
@@ -98,6 +102,11 @@ class OwnerSingleFragment : MBFragment<OwnerSingleVModel, FragmentOwnersingleBin
             if(numsTypeList.size>0){
                 numsTypeList.clear()
             }
+
+
+            if(carList.size>0){
+                carList.clear()
+            }
             goodsTypeList.addAll(it.goods_type)
 
             numsTypeList.addAll(it.nums_type)
@@ -115,6 +124,23 @@ class OwnerSingleFragment : MBFragment<OwnerSingleVModel, FragmentOwnersingleBin
 
     }
 
+    private fun  setShow(){
+
+        if (Build.VERSION.SDK_INT < Build.VERSION_CODES.KITKAT) { //不支持沉浸式状态栏
+        } else {
+            //获取状态栏的高度
+            val statusBarHeight: Int = UiUtils.getStatusBarHeight()
+
+            //动态设置高度  tv
+            val params = binding.tv.getLayoutParams()
+            //获取当前控件的布局对象
+            //params.height=UiUtils.dp2dip(getContext(), statusBarHeight);//设置当前控件布局的高度
+            params.height = statusBarHeight
+            binding.tv.layoutParams = params //将设置好的布局参数应用到控件中
+            binding.tv.visibility = View.VISIBLE
+        }
+
+    }
 
     override fun vmClass(): Class<OwnerSingleVModel> {
         return OwnerSingleVModel::class.java
@@ -134,9 +160,11 @@ class OwnerSingleFragment : MBFragment<OwnerSingleVModel, FragmentOwnersingleBin
             PopuBottomUtils.showListString(context(), numsTypeList, object : ChoiceData {
                 override fun onRestuse(name: String?) {
                     vm.unit.value = name
-                    for((index,ss) in numsTypeList.withIndex()){
-                        if(ss == name){
-                            vm.unit_code=index.toString()
+                    for ((index, ss) in numsTypeList.withIndex()) {
+                        if (ss == name) {
+                            vm.unit_code = index.toString()
+
+                            Log.e("-shy-", " index= $index")
                         }
                     }
 
@@ -849,6 +877,19 @@ class OwnerSingleFragment : MBFragment<OwnerSingleVModel, FragmentOwnersingleBin
         binding.etGoodsName.setText("")
         binding.etSingCarPrice.setText("")
         binding.etData.setText("")
+
+        if(goodsTypeList.size>0){
+            goodsTypeList.clear()
+        }
+        if(numsTypeList.size>0){
+            numsTypeList.clear()
+        }
+
+        if(carList.size>0){
+            carList.clear()
+        }
+
+
         getData()
 
 

+ 1 - 1
app/src/main/res/layout/activity_waybilldetails.xml

@@ -728,7 +728,7 @@
                             android:visibility="@{vm.isVoucherShow?View.VISIBLE:View.GONE}"
                             app:layout_goneMarginTop="@dimen/dp_10"
                             app:qmui_backgroundColor="@color/white"
-                            tools:visibility="gone"
+                            tools:visibility="visible"
                             app:qmui_radius="@dimen/dp_4">
 
                             <LinearLayout

+ 41 - 0
app/src/main/res/layout/fragment_ownersingle.xml

@@ -18,6 +18,46 @@
         android:background="@color/color_bg"
         android:orientation="vertical">
 
+        <LinearLayout
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:background="@color/white"
+            android:orientation="vertical">
+
+            <TextView
+                android:id="@+id/tv"
+                android:layout_width="wrap_content"
+                android:visibility="gone"
+                android:layout_height="wrap_content" />
+
+        </LinearLayout>
+
+        <LinearLayout
+            android:layout_width="match_parent"
+            android:layout_height="50dp"
+            android:background="@color/white"
+            android:gravity="center"
+            android:orientation="horizontal"
+            >
+
+            <TextView
+                android:layout_width="0dp"
+                android:layout_height="wrap_content"
+                android:layout_weight="1"
+                android:gravity="center"
+                android:text="一装一卸"
+                android:textColor="#26292F"
+                android:textSize="20sp" />
+
+
+
+        </LinearLayout>
+
+        <View
+            android:layout_width="match_parent"
+            android:layout_height="1dp"
+            android:background="@color/line_color" />
+
         <FrameLayout
             android:layout_width="match_parent"
             android:layout_height="match_parent">
@@ -35,6 +75,7 @@
                     android:orientation="vertical">
 
 
+
                     <LinearLayout
                         android:layout_width="match_parent"
                         android:layout_height="match_parent"

+ 2 - 3
app/src/main/res/layout/item_add_pic.xml

@@ -15,11 +15,10 @@
         <com.qmuiteam.qmui.widget.QMUIRadiusImageView
             android:id="@+id/img_attachment"
             android:layout_width="70dp"
-            android:layout_height="70dp"
+            android:layout_height="60dp"
             android:scaleType="centerCrop"
             android:src="@drawable/bg_need_error"
-            app:qmui_corner_radius="5dp"
-           />
+            app:qmui_corner_radius="5dp" />
 
         <ImageView
             android:id="@+id/iv_delete"

+ 2 - 2
build.gradle

@@ -9,8 +9,8 @@ buildscript {
     ext.coroutines = '1.3.4'
 
     ext.application_id = "com.quansu.heifengwuliu"
-    ext.application_version_code = 3
-    ext.application_version_name = "1.0.3"
+    ext.application_version_code = 4
+    ext.application_version_name = "1.0.4"
     ext.support_version = "29.0.2"
     ext.min_sdk_version = 23
     ext.target_sdk_version = 30

+ 2 - 1
gaode/build.gradle

@@ -53,8 +53,9 @@ dependencies {
     // implementation (name:'locationsdk-1.0.0', ext:'aar')
 
 
-    provided files('libs/locationsdk-1.0.0.aar')
+   // provided files('libs/locationsdk-1.0.0.aar')
 
+    implementation files('libs/locationsdk-1.0.0.aar')
 
 
     // compileOnly 'com.amap.api:location:latest.integration' //定位功能

+ 1 - 1
lookimg/build.gradle

@@ -36,7 +36,7 @@ android {
 dependencies {
     implementation fileTree(dir: 'libs', include: ['*.jar'])
     implementation project(':base')
-    implementation 'com.github.chrisbanes:PhotoView:2.0.0'
+    implementation 'com.github.chrisbanes:PhotoView:2.1.4'
     //图片/视频选择、预览、编辑与拍照
     implementation 'com.github.guoxiaoxing:phoenix:1.0.15'
 //选填 - 图片压缩,开启功能:Phoenix.with().enableCompress(true),获取结果:MediaEntity.getCompressPath()

+ 6 - 0
lookimg/src/main/java/com/quansu/lookimg/ImagePagerActivity.kt

@@ -4,6 +4,7 @@ import android.os.Bundle
 import android.view.KeyEvent
 import android.view.View
 import androidx.viewpager.widget.ViewPager
+import com.qmuiteam.qmui.kotlin.onClick
 import com.quansu.lookimg.adapter.ImagePagerAdapter
 import com.quansu.lookimg.databinding.ActivityImagepagerBinding
 import com.quansu.lookimg.vmodel.ImagePagerVModel
@@ -36,6 +37,11 @@ class ImagePagerActivity : BActivity<ImagePagerVModel, ActivityImagepagerBinding
     override fun init(savedInstanceState: Bundle?) {
         super.init(savedInstanceState)
         initViewPager()
+
+        binding.ivBack.onClick {
+
+            finish()
+        }
     }
 
 

+ 6 - 7
lookimg/src/main/java/com/quansu/lookimg/fragment/ImageDetailFragment.kt

@@ -1,6 +1,5 @@
 package com.quansu.lookimg.fragment
 
-import android.app.Activity
 import android.os.Bundle
 import android.util.Log
 import android.view.LayoutInflater
@@ -26,7 +25,7 @@ class ImageDetailFragment : BFragment<ImageDetailVModel, FragmentImagedetailBind
 
     override fun init(savedInstanceState: Bundle?) {
         super.init(savedInstanceState)
-        Log.e("-shy-", "url=: "+url )
+        Log.e("-shy-", "url=: $url")
         vm.url.value=url
         initImg()
     }
@@ -35,11 +34,11 @@ class ImageDetailFragment : BFragment<ImageDetailVModel, FragmentImagedetailBind
     private fun initImg(){
 
         var mAttacher= PhotoViewAttacher(binding.image)
-        mAttacher.isZoomEnabled
-        mAttacher.setOnPhotoTapListener{
-            view, x, y ->
-            (context as Activity).onBackPressed()
-        }
+
+//        mAttacher.setOnPhotoTapListener{
+//            view, x, y ->
+//            (context as Activity).onBackPressed()
+//        }
 
     }
 

BIN
lookimg/src/main/res/drawable-xxhdpi/lookimg_back.png


+ 7 - 0
lookimg/src/main/res/layout/activity_imagepager.xml

@@ -24,6 +24,13 @@
               android:layout_height="match_parent"/>
 
 
+        <ImageView
+            android:id="@+id/iv_back"
+            android:src="@drawable/lookimg_back"
+            android:layout_marginTop="10dp"
+            android:layout_marginStart="10dp"
+            android:layout_width="25dp"
+            android:layout_height="25dp"/>
 
         <TextView
             android:id="@+id/indicator"

+ 3 - 0
lookimg/src/main/res/layout/fragment_imagedetail.xml

@@ -31,6 +31,9 @@
             android:layout_gravity="center"
             android:visibility="gone" />
 
+
+
+
     </FrameLayout>
 
 </layout>

+ 1 - 1
settings.gradle

@@ -2,7 +2,7 @@ include ':jpush'
 include ':umeng'
 include ':update'
 include ':gaode'
-//include ':lookimg'
+include ':lookimg'
 
 include ':app',':base'
 

+ 2 - 2
umeng/build.gradle

@@ -39,6 +39,6 @@ android {
 dependencies {
     implementation fileTree(dir: "libs", include: ["*.jar"])
     implementation project(':base')
-    provided files('libs/umeng-asms-armeabi-v1.1.3.aar')
-    provided files('libs/umeng-crash-armeabi-v0.0.5.aar')
+    implementation files('libs/umeng-asms-armeabi-v1.1.3.aar')
+    implementation files('libs/umeng-crash-armeabi-v0.0.5.aar')
 }