From abce02c7a61820f5d580f87364d542e817be429c Mon Sep 17 00:00:00 2001
From: admin <weikou2014>
Date: 星期二, 06 七月 2021 15:22:11 +0800
Subject: [PATCH] 1.1.1完善

---
 app/src/main/java/com/tejia/lijin/app/util/ui/GoodsDetailUtil.java |   66 +++++++++++++++++++++++++++++++-
 1 files changed, 63 insertions(+), 3 deletions(-)

diff --git a/app/src/main/java/com/tejia/lijin/app/util/ui/GoodsDetailUtil.java b/app/src/main/java/com/tejia/lijin/app/util/ui/GoodsDetailUtil.java
index efda8ca..ee7150b 100644
--- a/app/src/main/java/com/tejia/lijin/app/util/ui/GoodsDetailUtil.java
+++ b/app/src/main/java/com/tejia/lijin/app/util/ui/GoodsDetailUtil.java
@@ -3,6 +3,7 @@
 import android.app.Activity;
 import android.content.Context;
 import android.content.Intent;
+import android.content.SharedPreferences;
 import android.graphics.Color;
 import android.graphics.drawable.Drawable;
 import android.graphics.drawable.GradientDrawable;
@@ -135,11 +136,9 @@
                 return "2灏忔椂閿�";
             case 3:
                 return "浠婃棩閿�";
-            case 4:
+            default:
                 return "鎬婚攢";
-
         }
-        return "閿�閲�";
     }
 
 
@@ -164,9 +163,14 @@
             case 11:
                 return "澶╃尗";
             case 20:
+            case 21:
                 return "浜笢";
             case 30:
                 return "鎷煎澶�";
+            case 40:
+                return "鍞搧浼�";
+            case 50:
+                return "鑻忓畞鏄撹喘";
         }
         return "";
     }
@@ -183,4 +187,60 @@
     }
 
 
+    /**
+     * 鏄惁灞曞紑绾㈠寘/杩斿埄璇︽儏
+     *
+     * @param context
+     * @return
+     */
+    public static boolean spreadHoneBaoOrFanLiDetail(Context context) {
+        SharedPreferences sharedPreferences = context.getSharedPreferences("goods", Context.MODE_PRIVATE);
+        long time = sharedPreferences.getLong("installTime", 0L);
+        if (System.currentTimeMillis() - time < 1000 * 60 * 60 * 24L * 3) {
+            return true;
+        }
+        return false;
+    }
+
+    /**
+     * 鍒濆鍖栧畨瑁呮椂闂�
+     *
+     * @param context
+     */
+    public static void initInstallTime(Context context) {
+        SharedPreferences sharedPreferences = context.getSharedPreferences("goods", Context.MODE_PRIVATE);
+        long installTime = sharedPreferences.getLong("installTime", 0L);
+        if (installTime == 0L) {
+            SharedPreferences.Editor editor = sharedPreferences.edit();
+            editor.putLong("installTime", System.currentTimeMillis());
+            editor.commit();
+        }
+    }
+
+    /**
+     * 鏄惁闇�瑕佹彁閱掔櫥褰曡繑鍒�
+     *
+     * @param context
+     * @return
+     */
+    public static boolean needNotifyLoginFanli(Context context) {
+        SharedPreferences sharedPreferences = context.getSharedPreferences("goods", Context.MODE_PRIVATE);
+        boolean notifyLoginFanli = sharedPreferences.getBoolean("notifyLoginFanli", true);
+        return notifyLoginFanli;
+    }
+
+
+    /**
+     * 宸茬粡鎻愰啋浜嗙櫥褰曡繑鍒�
+     *
+     * @param context
+     */
+    public static void alreadyNotifyLoginFanli(Context context) {
+        SharedPreferences sharedPreferences = context.getSharedPreferences("goods", Context.MODE_PRIVATE);
+        SharedPreferences.Editor editor = sharedPreferences.edit();
+        editor.putBoolean("notifyLoginFanli", false);
+        editor.commit();
+    }
+
+
 }

--
Gitblit v1.8.0