Pārlūkot izejas kodu

1.提现按钮根据后台开关显示。

shihuiyun 2 gadi atpakaļ
vecāks
revīzija
fbe6b83765

+ 4 - 1
app/src/main/java/com/hdl/xl/activity/MyWalletActivity.kt

@@ -2,6 +2,7 @@ package com.hdl.xl.activity
 
 import android.graphics.Color
 import android.os.Bundle
+import android.text.TextUtils
 import android.util.Log
 import android.view.View
 import com.githang.statusbar.StatusBarCompat
@@ -17,6 +18,7 @@ import com.hdl.xl.vmodel.MyWalletVModel
 import com.hwangjr.rxbus.annotation.Subscribe
 import com.hwangjr.rxbus.annotation.Tag
 import com.qmuiteam.qmui.kotlin.onClick
+import com.tencent.mmkv.MMKV
 import com.ysnows.base.net.IResp
 import com.ysnows.base.net.PageData
 
@@ -24,7 +26,8 @@ class MyWalletActivity : MBRActivity<MyWalletVModel, MyWalletAdapter, ActivityMy
 
     override fun init(savedInstanceState: Bundle?) {
         super.init(savedInstanceState)
-
+        val ss = MMKV.defaultMMKV().decodeString("withdraw", "")
+        vm.isWithd.value = !(!TextUtils.isEmpty(ss)&&ss.equals("0"))
 
         if(null==User.get()?.money){
             vm.money.value="0"

+ 3 - 20
app/src/main/java/com/hdl/xl/activity/WebViewActivity.kt

@@ -23,40 +23,23 @@ open class WebViewActivity : MBActivity<BViewModel<BRepository>, ActivityWebview
 
         binding.webView.webViewClient = object : QMUIWebViewClient(true, false) {
             override fun shouldOverrideUrlLoading(view: WebView?, url: String?): Boolean {
-
-                Log.e("-shy-", "url=: " + url)
                 if (url!!.contains("about:blank")) {
                     finishActivity()
                     return false
                 }
-                if (url!!.contains(BApp.instance()!!.config()!!.searchUrl()+"h5")||url!!.contains(BApp.instance()!!.config()!!.searchUrl()+"")) {
-               // if (url!!.contains("xl://goods:8888/goodsDetail")) {
-                    //发送消息--关闭
-//                    var ss = url!!.split("&")
-//                    var s1 = ss[1].split("=")
-
+                if (url!!.contains(BApp.instance()!!.config()!!.searchUrl()+"h5")
+                        ||url!!.contains(BApp.instance()!!.config()!!.searchUrl()+"")) {
                     if (type.equals("1")) {
                         RxBus.get().post(ConfigRx.PAY_SD_SUESS, "")
                     } else {
                         //寄售
                         RxBus.get().post(ConfigRx.REFRESH_SELL, "")
                     }
-
                     finishActivity()
-
                     return false
                 }
-
                 return true
-//            if (Uri.parse(url).host == "www.example.com") {
-                // This is my web site, so do not override; let my WebView load the page
-                //           return false
-//            }
-                // Otherwise, the link is not for a page on my site, so launch another Activity that handles URLs
-//            Intent(Intent.ACTION_VIEW, Uri.parse(url)).apply {
-//                startActivity(this)
-//            }
-//            return true
+
             }
 
 

+ 4 - 4
app/src/main/java/com/hdl/xl/config/Config.kt

@@ -6,14 +6,14 @@ import com.ysnows.base.config.IConfig
 object  Config : IConfig {
     override fun baseUrl(): String {
 
-      // return "https://xlapi.xiangliannft.com/api/" //正式地址
-        return "https://xianglian-api.hdlkeji.com/api/"//测试地址
+       return "https://xlapi.xiangliannft.com/api/" //正式地址
+      // return "https://xianglian-api.hdlkeji.com/api/"//测试地址
 
     }
 
     override fun searchUrl(): String? {//分享+支付回调的
-        return "https://xianglian-api.hdlkeji.com/"//测试地址
-        // return "https://xlapi.xiangliannft.com/" //正式地址
+       // return "https://xianglian-api.hdlkeji.com/"//测试地址
+        return "https://xlapi.xiangliannft.com/" //正式地址
     }
 
 

+ 6 - 0
app/src/main/java/com/hdl/xl/fragment/HomeMineFragment.kt

@@ -1,6 +1,7 @@
 package com.hdl.xl.fragment
 
 import android.os.Bundle
+import android.text.TextUtils
 import android.view.LayoutInflater
 import android.view.ViewGroup
 import com.hdl.xl.base.MBFragment
@@ -10,6 +11,7 @@ import com.hdl.xl.databinding.FragmentHomeMyBinding
 import com.hdl.xl.vmodel.HomeMineVModel
 import com.hwangjr.rxbus.annotation.Subscribe
 import com.hwangjr.rxbus.annotation.Tag
+import com.tencent.mmkv.MMKV
 
 /**
  *on 2022/7/29
@@ -18,6 +20,10 @@ class HomeMineFragment: MBFragment<HomeMineVModel, FragmentHomeMineBinding>() {
 
     override fun init(savedInstanceState: Bundle?) {
         super.init(savedInstanceState)
+
+        val ss = MMKV.defaultMMKV().decodeString("withdraw", "")
+        vm.isWithd.value = !(!TextUtils.isEmpty(ss)&&ss.equals("0"))
+
         vm.getUserInfo()
     }
 

+ 2 - 1
app/src/main/java/com/hdl/xl/utils/PopuExtenSionUtils.kt

@@ -15,6 +15,7 @@ import com.qmuiteam.qmui.widget.popup.QMUIPopups
 import com.qmuiteam.qmui.widget.roundwidget.QMUIRoundButton
 import com.uuzuche.lib_zxing.activity.CodeUtils
 import com.hdl.xl.R
+import com.ysnows.base.base.BApp
 
 /**
  *Created by shihuiyun
@@ -40,7 +41,7 @@ object  PopuExtenSionUtils {
         //http://cc.chuangchi.vip/web/h5/pages/mine/zhuce?invite_code=rwg5lnlj
 
         var code= com.hdl.xl.model.User.get()?.invite_code
-        var url="http://cc.chuangchi.vip/web/h5/pages/mine/zhuce?invite_code=$code"
+        var url= BApp.instance()!!.config()!!.searchUrl()+"h5/pages/mine/zhuce?invite_code=$code"
         //生成二维码
         var  mBitmap   = CodeUtils.createImage(url, 400, 400, null)
         imgCode.setImageBitmap(mBitmap)

+ 1 - 1
app/src/main/java/com/hdl/xl/utils/PopuPaySuesstils.kt

@@ -46,7 +46,7 @@ object PopuPaySuesstils {
             tvPay.text="支付方式:钱包余额"
         }
         if(bean.pay_type == "sd"||bean.pay_type=="sd_rapid"){
-            tvPay.text="快捷支付"
+            tvPay.text="支付方式:快捷支付"
         }
 
         tvSure.onClick {

+ 1 - 0
app/src/main/java/com/hdl/xl/vmodel/HomeMineVModel.kt

@@ -33,6 +33,7 @@ open class HomeMineVModel(application: Application) : BViewModel<BRepository>(ap
 
     var money=MutableLiveData<String>("0")
 
+    var isWithd=MutableLiveData<Boolean>(true)
 
 
     fun getUserInfo() {

+ 1 - 0
app/src/main/java/com/hdl/xl/vmodel/MyWalletVModel.kt

@@ -27,6 +27,7 @@ class MyWalletVModel(application: Application) : BRViewModel<BRRepository>(appli
     var pay = MutableLiveData<Boolean>(false)
     var withdrawal = MutableLiveData<Boolean>(false)
 
+    var isWithd=MutableLiveData<Boolean>(true)
 
 
     fun getUserInfo() {

+ 4 - 0
app/src/main/res/layout/activity_my_wallet.xml

@@ -9,6 +9,8 @@
             name="vm"
             type="com.hdl.xl.vmodel.MyWalletVModel" />
 
+        <import type="android.view.View"/>
+
     </data>
 
     <LinearLayout
@@ -78,6 +80,8 @@
                     android:layout_height="24dp"
                     android:background="@drawable/bg_moey"
                     android:gravity="center"
+                    android:visibility="@{vm.isWithd?View.VISIBLE:View.GONE}"
+
                     android:onClick="@{v->vm.toWithdrawal()}"
                     android:text="提现"
                     android:textColor="#FFFFFF"

+ 1 - 0
app/src/main/res/layout/fragment_home_mine.xml

@@ -195,6 +195,7 @@
                         android:layout_height="wrap_content"
                         android:background="@drawable/bg_mine_withdraw_button"
                         android:onClick="@{v->vm.toWithdrawal()}"
+                        android:visibility="@{vm.isWithd?View.VISIBLE:View.GONE}"
                         android:paddingLeft="16dp"
                         android:paddingTop="4dp"
                         android:paddingRight="16dp"

+ 2 - 0
app/src/main/res/layout/popu_open_tips.xml

@@ -1,5 +1,6 @@
 <?xml version="1.0" encoding="utf-8"?>
 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:app="http://schemas.android.com/apk/res-auto"
     android:layout_width="match_parent"
     android:layout_height="match_parent"
     android:gravity="center"
@@ -44,6 +45,7 @@
                 android:id="@+id/img"
                 android:layout_width="140dp"
                 android:layout_height="140dp"
+                app:qmui_corner_radius="20dp"
                 android:layout_gravity="center_horizontal"
                 android:layout_marginTop="24dp"
                 android:src="@drawable/bg_need_error" />

BIN
app/src/main/res/mipmap-hdpi/ic_launcher.png


BIN
app/src/main/res/mipmap-mdpi/ic_launcher.png


BIN
app/src/main/res/mipmap-xhdpi/ic_launcher.png


BIN
app/src/main/res/mipmap-xxhdpi/ic_launcher.png


BIN
app/src/main/res/mipmap-xxxhdpi/ic_launcher.png


+ 3 - 3
app/xiaomi/release/output-metadata.json

@@ -10,9 +10,9 @@
     {
       "type": "SINGLE",
       "filters": [],
-      "versionCode": 2,
-      "versionName": "1.0.1",
-      "outputFile": "xiaomi_1.0.1.apk"
+      "versionCode": 1,
+      "versionName": "1.0.0",
+      "outputFile": "xiaomi_1.0.0.apk"
     }
   ]
 }

+ 2 - 2
build.gradle

@@ -10,8 +10,8 @@ buildscript {
     ext.coroutines = '1.3.4'
 
     ext.application_id = "com.hdl.xl"
-    ext.application_version_code = 2
-    ext.application_version_name = "1.0.1"
+    ext.application_version_code = 1
+    ext.application_version_name = "1.0.0"
     ext.support_version = "29.0.2"
     ext.min_sdk_version = 23
     ext.target_sdk_version = 30