Commit 880c170f authored by jyx's avatar jyx

登录名称显示错误修改

parent 868ee1e3
...@@ -127,7 +127,7 @@ public class UserManager { ...@@ -127,7 +127,7 @@ public class UserManager {
ps.putString(CODE_ID, user.getIdcode()); ps.putString(CODE_ID, user.getIdcode());
ps.putString(MOBILE, mobile); ps.putString(MOBILE, mobile);
// ps.putString(GAME_INFO, user.getGameInfo()); // ps.putString(GAME_INFO, user.getGameInfo());
ps.putString(REAL_NAME, user.getReal_name()); // ps.putString(REAL_NAME, user.getReal_name());
ps.putString(ALIPAY_ACCOUNT, user.getAlipay_account()); ps.putString(ALIPAY_ACCOUNT, user.getAlipay_account());
ps.putString(USER_GOLD, String.valueOf(user.getCoin())); ps.putString(USER_GOLD, String.valueOf(user.getCoin()));
ps.putString(USER_CASH, String.format("%.2f", user.getSurplus())); ps.putString(USER_CASH, String.format("%.2f", user.getSurplus()));
......
...@@ -25,7 +25,7 @@ public class UserBean implements Serializable { ...@@ -25,7 +25,7 @@ public class UserBean implements Serializable {
private String head; private String head;
private String openid; private String openid;
private String nickName; private String nickname;
private String mobile; private String mobile;
private String real_name; private String real_name;
private String alipay_account; private String alipay_account;
...@@ -45,7 +45,7 @@ public class UserBean implements Serializable { ...@@ -45,7 +45,7 @@ public class UserBean implements Serializable {
} }
public String getNickName() { public String getNickName() {
return nickName; return nickname;
} }
public String getMobile() { public String getMobile() {
......
package com.mints.goodmoney.mvp.presenters; package com.mints.goodmoney.mvp.presenters;
import android.content.Context;
import android.text.TextUtils; import android.text.TextUtils;
import com.google.gson.Gson;
import com.mints.goodmoney.common.Constant; import com.mints.goodmoney.common.Constant;
import com.mints.goodmoney.common.DeviceInfo; import com.mints.goodmoney.common.DeviceInfo;
import com.mints.goodmoney.manager.AppHttpManager; import com.mints.goodmoney.manager.AppHttpManager;
...@@ -11,21 +9,16 @@ import com.mints.goodmoney.manager.ShumeiManager; ...@@ -11,21 +9,16 @@ import com.mints.goodmoney.manager.ShumeiManager;
import com.mints.goodmoney.manager.UserManager; import com.mints.goodmoney.manager.UserManager;
import com.mints.goodmoney.mvp.model.BaseResponse; import com.mints.goodmoney.mvp.model.BaseResponse;
import com.mints.goodmoney.mvp.model.DrawcashBean; import com.mints.goodmoney.mvp.model.DrawcashBean;
import com.mints.goodmoney.mvp.model.LocationBean;
import com.mints.goodmoney.mvp.model.UserBean; import com.mints.goodmoney.mvp.model.UserBean;
import com.mints.goodmoney.mvp.views.DrawcashView; import com.mints.goodmoney.mvp.views.DrawcashView;
import com.mints.goodmoney.utils.DeviceUuidFactory; import com.mints.goodmoney.utils.DeviceUuidFactory;
import com.mints.goodmoney.utils.SPUtil;
import com.mints.library.net.neterror.BaseSubscriber; import com.mints.library.net.neterror.BaseSubscriber;
import com.mints.library.net.neterror.Throwable; import com.mints.library.net.neterror.Throwable;
import com.mints.library.utils.json.JsonUtil;
import net.grandcentrix.tray.AppPreferences; import net.grandcentrix.tray.AppPreferences;
import java.util.HashMap; import java.util.HashMap;
import cn.jpush.android.api.JPushInterface;
public class DrawcashPresenter extends BasePresenter<DrawcashView> { public class DrawcashPresenter extends BasePresenter<DrawcashView> {
/** /**
......
...@@ -6,7 +6,6 @@ import android.text.TextUtils ...@@ -6,7 +6,6 @@ import android.text.TextUtils
import android.view.View import android.view.View
import cn.sharesdk.framework.ShareSDK import cn.sharesdk.framework.ShareSDK
import cn.sharesdk.wechat.friends.Wechat import cn.sharesdk.wechat.friends.Wechat
import com.mints.goodmoney.BuildConfig
import com.mints.goodmoney.R import com.mints.goodmoney.R
import com.mints.goodmoney.common.Constant import com.mints.goodmoney.common.Constant
import com.mints.goodmoney.login.LoginApi import com.mints.goodmoney.login.LoginApi
...@@ -169,7 +168,6 @@ class LoginActivity : BaseActivity() ...@@ -169,7 +168,6 @@ class LoginActivity : BaseActivity()
progressDialog.dismiss() progressDialog.dismiss()
} }
finish() finish()
} }
...@@ -204,7 +202,7 @@ class LoginActivity : BaseActivity() ...@@ -204,7 +202,7 @@ class LoginActivity : BaseActivity()
} }
BackInputUtil.phoneNumAddSpace(etLoginMobile) BackInputUtil.phoneNumAddSpace(etLoginMobile)
mobile = UserManager.getInstance().getMobile() mobile = UserManager.getInstance().mobile
if (!TextUtils.isEmpty(mobile)) { if (!TextUtils.isEmpty(mobile)) {
etLoginMobile.setText(mobile) etLoginMobile.setText(mobile)
etLoginMobile.setSelection(mobile!!.length + 2) etLoginMobile.setSelection(mobile!!.length + 2)
......
...@@ -26,6 +26,22 @@ class SettingsActivity : BaseActivity(), View.OnClickListener { ...@@ -26,6 +26,22 @@ class SettingsActivity : BaseActivity(), View.OnClickListener {
initLayout() initLayout()
} }
override fun onResume() {
super.onResume()
if (userManager.mobile.isNotEmpty()) {
item_phone.findViewById<TextView>(R.id.tv_right).text = userManager.mobile
} else {
item_phone.findViewById<TextView>(R.id.tv_right).text = "未绑定"
}
// if (userManager.wxOpenid.isNotEmpty()) {
// item_wechat.findViewById<TextView>(R.id.tv_right).text = userManager.wxName
// } else {
// item_wechat.findViewById<TextView>(R.id.tv_right).text = "未授权"
// }
}
private fun initLayout() { private fun initLayout() {
tv_title.text = "设置" tv_title.text = "设置"
iv_left_icon.visibility = View.VISIBLE iv_left_icon.visibility = View.VISIBLE
...@@ -47,19 +63,23 @@ class SettingsActivity : BaseActivity(), View.OnClickListener { ...@@ -47,19 +63,23 @@ class SettingsActivity : BaseActivity(), View.OnClickListener {
item_phone.findViewById<TextView>(R.id.tv_title).setCompoundDrawables(phone, null, null, null) item_phone.findViewById<TextView>(R.id.tv_title).setCompoundDrawables(phone, null, null, null)
item_phone.findViewById<TextView>(R.id.tv_right).visibility = View.VISIBLE item_phone.findViewById<TextView>(R.id.tv_right).visibility = View.VISIBLE
item_phone.findViewById<ImageView>(R.id.iv_right).visibility = View.GONE item_phone.findViewById<ImageView>(R.id.iv_right).visibility = View.GONE
if (userManager.userIsLogin()) { if (userManager.mobile.isNotEmpty()) {
item_phone.findViewById<TextView>(R.id.tv_right).text = userManager.mobile item_phone.findViewById<TextView>(R.id.tv_right).text = userManager.mobile
} else { } else {
item_phone.findViewById<TextView>(R.id.tv_right).text = "未绑定" item_phone.findViewById<TextView>(R.id.tv_right).text = "未绑定"
} }
item_wechat.findViewById<TextView>(R.id.tv_title).text = "微信号" // item_wechat.findViewById<TextView>(R.id.tv_title).text = "微信昵称"
val wechat = resources.getDrawable(R.mipmap.icon_settings_wechat) // val wechat = resources.getDrawable(R.mipmap.icon_settings_wechat)
wechat.setBounds(0, 0, 56, 56) // wechat.setBounds(0, 0, 56, 56)
item_wechat.findViewById<TextView>(R.id.tv_title).setCompoundDrawables(wechat, null, null, null) // item_wechat.findViewById<TextView>(R.id.tv_title).setCompoundDrawables(wechat, null, null, null)
item_wechat.findViewById<TextView>(R.id.tv_right).visibility = View.VISIBLE // item_wechat.findViewById<TextView>(R.id.tv_right).visibility = View.VISIBLE
item_wechat.findViewById<ImageView>(R.id.iv_right).visibility = View.GONE // item_wechat.findViewById<ImageView>(R.id.iv_right).visibility = View.GONE
item_wechat.findViewById<TextView>(R.id.tv_right).text = "未授权" // if (userManager.wxOpenid.isNotEmpty()) {
// item_wechat.findViewById<TextView>(R.id.tv_right).text = userManager.wxName
// } else {
// item_wechat.findViewById<TextView>(R.id.tv_right).text = "未授权"
// }
// item_invitedCode.findViewById<TextView>(R.id.tv_title).text = "邀请码" // item_invitedCode.findViewById<TextView>(R.id.tv_title).text = "邀请码"
// val invitedCode = resources.getDrawable(R.mipmap.icon_settings_invite) // val invitedCode = resources.getDrawable(R.mipmap.icon_settings_invite)
...@@ -106,15 +126,19 @@ class SettingsActivity : BaseActivity(), View.OnClickListener { ...@@ -106,15 +126,19 @@ class SettingsActivity : BaseActivity(), View.OnClickListener {
override fun onClick(v: View?) { override fun onClick(v: View?) {
when (v?.id) { when (v?.id) {
R.id.item_phone -> { R.id.item_phone -> {
if (!userManager.userIsLogin()) { if (userManager.userIsLogin() && userManager.mobile.isEmpty()) {
readyGo(LoginActivity::class.java) val bundle = Bundle()
} bundle.putBoolean(Constant.LOGIN_FLAG, true)
} readyGo(LoginActivity::class.java, bundle)
R.id.item_wechat -> {
if (!userManager.userIsLogin()) {
readyGo(LoginActivity::class.java)
} }
} }
// R.id.item_wechat -> {
// if (userManager.userIsLogin() && userManager.wxOpenid.isEmpty()) {
// val bundle = Bundle()
// bundle.putBoolean(Constant.LOGIN_FLAG, true)
// readyGo(LoginActivity::class.java)
// }
// }
R.id.item_invitedCode -> { R.id.item_invitedCode -> {
submitInvitedCode() submitInvitedCode()
} }
......
...@@ -127,11 +127,11 @@ class FriendsFragment : BaseFragment(), FriendsView, OnRefreshListener, Platform ...@@ -127,11 +127,11 @@ class FriendsFragment : BaseFragment(), FriendsView, OnRefreshListener, Platform
} }
override fun onPageDown() { override fun onPageDown() {
bv_friends_task.stopAutoScroll() // bv_friends_task.stopAutoScroll()
} }
override fun onPageUp() { override fun onPageUp() {
bv_friends_task.startAutoScroll() // bv_friends_task.startAutoScroll()
} }
}) })
...@@ -158,12 +158,12 @@ class FriendsFragment : BaseFragment(), FriendsView, OnRefreshListener, Platform ...@@ -158,12 +158,12 @@ class FriendsFragment : BaseFragment(), FriendsView, OnRefreshListener, Platform
friendsPresenter.getFriendsMsg() friendsPresenter.getFriendsMsg()
} }
bv_friends_task.startAutoScroll() // bv_friends_task.startAutoScroll()
} }
override fun onPause() { override fun onPause() {
super.onPause() super.onPause()
bv_friends_task.stopAutoScroll() // bv_friends_task.stopAutoScroll()
} }
override fun onDestroy() { override fun onDestroy() {
......
...@@ -25,7 +25,6 @@ import com.mints.goodmoney.mvp.model.* ...@@ -25,7 +25,6 @@ import com.mints.goodmoney.mvp.model.*
import com.mints.goodmoney.mvp.presenters.MyPresenter import com.mints.goodmoney.mvp.presenters.MyPresenter
import com.mints.goodmoney.mvp.views.MyView import com.mints.goodmoney.mvp.views.MyView
import com.mints.goodmoney.ui.activitys.* import com.mints.goodmoney.ui.activitys.*
import com.mints.goodmoney.ui.adapter.GvMyAdapter
import com.mints.goodmoney.ui.adapter.MainMyAdapter import com.mints.goodmoney.ui.adapter.MainMyAdapter
import com.mints.goodmoney.ui.fragment.base.BaseFragment import com.mints.goodmoney.ui.fragment.base.BaseFragment
import com.mints.goodmoney.utils.ImageUtil import com.mints.goodmoney.utils.ImageUtil
...@@ -63,7 +62,7 @@ class MyFragment : BaseFragment(), MyView, MainMyAdapter.OnItemChildClickListene ...@@ -63,7 +62,7 @@ class MyFragment : BaseFragment(), MyView, MainMyAdapter.OnItemChildClickListene
private var hotList: List<BannerBean.ListBean>? = arrayListOf() private var hotList: List<BannerBean.ListBean>? = arrayListOf()
// 当天签到金币 // 当天签到金币
private var curSignCoin = 5 private var curSignCoin = 50
// 签到信息 // 签到信息
private var signCardBean: SignCardBean? = null private var signCardBean: SignCardBean? = null
...@@ -312,16 +311,13 @@ class MyFragment : BaseFragment(), MyView, MainMyAdapter.OnItemChildClickListene ...@@ -312,16 +311,13 @@ class MyFragment : BaseFragment(), MyView, MainMyAdapter.OnItemChildClickListene
private fun setUserLoginStatus() { private fun setUserLoginStatus() {
if (userConfig != null) { if (userConfig != null) {
val code = userConfig!!.userMsg.idcode item_title_invitecode.text = "邀请码:" + userConfig!!.userMsg.idcode
if (code.isNotEmpty()) {
item_title_invitecode.text = "邀请码:$code"
}
} }
if (userManager.userIsLogin()) { if (userManager.userIsLogin()) {
// 已登录 // 已登录
if (userManager.wxOpenid.isNotEmpty()) { if (userManager.wxOpenid.isNotEmpty()) {
GlideUtils.loadImageView(context, userManager.wxHeader, item_title_avatar) GlideUtils.loadImageViewLoding(context, userManager.wxHeader, item_title_avatar, R.mipmap.ic_my, R.mipmap.ic_my)
item_title_id.text = userManager.wxName item_title_id.text = userManager.wxName
} else { } else {
var mobile = userManager.mobile var mobile = userManager.mobile
...@@ -336,9 +332,9 @@ class MyFragment : BaseFragment(), MyView, MainMyAdapter.OnItemChildClickListene ...@@ -336,9 +332,9 @@ class MyFragment : BaseFragment(), MyView, MainMyAdapter.OnItemChildClickListene
var userId = userManager.userID var userId = userManager.userID
if (userId.isNotEmpty() && userId.length > 11) { if (userId.isNotEmpty() && userId.length > 11) {
userId = userId.substring(userId.length - 10) userId = userId.substring(userId.length - 10)
item_title_id.text = "游客$userId 去登录" item_title_id.text = "游客$userId 去登录"
} else { } else {
item_title_id.text = "游客 去登录" item_title_id.text = "游客 去登录"
} }
item_title_avatar.setImageResource(R.mipmap.ic_my) item_title_avatar.setImageResource(R.mipmap.ic_my)
} }
...@@ -370,18 +366,18 @@ class MyFragment : BaseFragment(), MyView, MainMyAdapter.OnItemChildClickListene ...@@ -370,18 +366,18 @@ class MyFragment : BaseFragment(), MyView, MainMyAdapter.OnItemChildClickListene
progressStrInvited = "(" + userConfig!!.taskShareFriend.complete + "/" + userConfig!!.taskShareFriend.max + ")" progressStrInvited = "(" + userConfig!!.taskShareFriend.complete + "/" + userConfig!!.taskShareFriend.max + ")"
} }
val task2 = TaskBean(R.mipmap.icon_my_invite, "邀好友,赚金币", progressStrInvited, "去邀请", 2) val task2 = TaskBean(R.mipmap.icon_my_invite, "邀好友,赚金币", progressStrInvited, "去邀请", 2)
// 看福利视频赚金币 // // 看福利视频赚金币
var progressStrVideo = "" // var progressStrVideo = ""
if (userConfig != null) { // if (userConfig != null) {
progressStrVideo = "(" + userConfig!!.taskVeido.complete + "/" + userConfig!!.taskVeido.max + ")" // progressStrVideo = "(" + userConfig!!.taskVeido.complete + "/" + userConfig!!.taskVeido.max + ")"
} // }
val task3 = TaskBean(R.mipmap.icon_my_video, "看福利视频赚金币", progressStrVideo, "赚金币", 3) // val task3 = TaskBean(R.mipmap.icon_my_video, "看福利视频赚金币", progressStrVideo, "赚金币", 3)
// 玩游戏,赚金币 // // 玩游戏,赚金币
val task4 = TaskBean(R.mipmap.icon_my_game, "玩游戏,赚金币", "", "赚金币", 4) // val task4 = TaskBean(R.mipmap.icon_my_game, "玩游戏,赚金币", "", "赚金币", 4)
// 小说免费看,金币大家赚 // // 小说免费看,金币大家赚
val task5 = TaskBean(R.mipmap.icon_my_fiction, "小说免费看,金币大家赚", "", "去阅读", 5) // val task5 = TaskBean(R.mipmap.icon_my_fiction, "小说免费看,金币大家赚", "", "去阅读", 5)
// 试玩平台 // // 试玩平台
val task6 = TaskBean(R.mipmap.icon_my_demo, "试玩平台", "", "", 5) // val task6 = TaskBean(R.mipmap.icon_my_demo, "试玩平台", "", "", 5)
dataList.add(task1) dataList.add(task1)
dataList.add(task2) dataList.add(task2)
// dataList.add(task3) // dataList.add(task3)
......
...@@ -27,8 +27,7 @@ import net.grandcentrix.tray.AppPreferences ...@@ -27,8 +27,7 @@ import net.grandcentrix.tray.AppPreferences
* 作者:孟崔广 * 作者:孟崔广
* 时间:2020/9/20 17:30 * 时间:2020/9/20 17:30
*/ */
class PanFragment : BaseFragment() class PanFragment : BaseFragment(), PanView {
, PanView {
private val panPresenter by lazy { PanPresenter() } private val panPresenter by lazy { PanPresenter() }
private val ps by lazy { AppPreferences(context) } private val ps by lazy { AppPreferences(context) }
...@@ -41,7 +40,6 @@ class PanFragment : BaseFragment() ...@@ -41,7 +40,6 @@ class PanFragment : BaseFragment()
override fun initViewsAndEvents() { override fun initViewsAndEvents() {
panPresenter.attachView(this) panPresenter.attachView(this)
} }
override fun onHiddenChanged(hidden: Boolean) { override fun onHiddenChanged(hidden: Boolean) {
...@@ -79,21 +77,19 @@ class PanFragment : BaseFragment() ...@@ -79,21 +77,19 @@ class PanFragment : BaseFragment()
private fun loadTurnUrl() { private fun loadTurnUrl() {
getTurnUrl() getTurnUrl()
blTurntableWebview.setDefaultHandler(DefaultHandler()) blTurntableWebview.setDefaultHandler(DefaultHandler())
blTurntableWebview.setWebChromeClient(WebChromeClient()) blTurntableWebview.webChromeClient = WebChromeClient()
blTurntableWebview.setOnLongClickListener(OnLongClickListener { true }) blTurntableWebview.setOnLongClickListener { true }
//注册监听方法当js中调用callHandler方法时会调用此方法(handlerName必须和js中相同) //注册监听方法当js中调用callHandler方法时会调用此方法(handlerName必须和js中相同)
blTurntableWebview.registerHandler("getTurnResult", object : BridgeHandler { blTurntableWebview.registerHandler("getTurnResult") { data, function ->
override fun handler(data: String, function: CallBackFunction) { val turntableBean: TurntableBean = JsonUtil.parseJson(data, TurntableBean::class.java)
val turntableBean: TurntableBean = JsonUtil.parseJson(data, TurntableBean::class.java) if (turntableBean != null) {
if (turntableBean != null) { val bundle = Bundle()
val bundle = Bundle() bundle.putInt(Constant.MAIN_CUR_COIN, turntableBean.coin)
bundle.putInt(Constant.MAIN_CUR_COIN, turntableBean.getCoin()) bundle.putString(Constant.MAIN_CARRIER_TYPE, carrierType)
bundle.putString(Constant.MAIN_CARRIER_TYPE, carrierType) bundle.putString(Constant.MAIN_EXTRA_ID, turntableBean.key)
bundle.putString(Constant.MAIN_EXTRA_ID, turntableBean.getKey()) readyGo(AwardActivity::class.java, bundle)
readyGo(AwardActivity::class.java, bundle)
}
} }
}) }
blTurntableWebview.setDefaultHandler(object : DefaultHandler() { blTurntableWebview.setDefaultHandler(object : DefaultHandler() {
override fun handler(data: String, function: CallBackFunction) { override fun handler(data: String, function: CallBackFunction) {
showToast(data) showToast(data)
......
...@@ -121,10 +121,10 @@ public class BannerView extends FrameLayout { ...@@ -121,10 +121,10 @@ public class BannerView extends FrameLayout {
public boolean onTouch(View view, MotionEvent motionEvent) { public boolean onTouch(View view, MotionEvent motionEvent) {
switch (motionEvent.getAction()) { switch (motionEvent.getAction()) {
case MotionEvent.ACTION_DOWN: case MotionEvent.ACTION_DOWN:
stopAutoScroll(); if (isAutoScroll) stopAutoScroll();
break; break;
case MotionEvent.ACTION_UP: case MotionEvent.ACTION_UP:
startAutoScroll(); if (isAutoScroll) startAutoScroll();
break; break;
} }
return false; return false;
......
...@@ -12,7 +12,8 @@ ...@@ -12,7 +12,8 @@
<include <include
android:id="@+id/item_wechat" android:id="@+id/item_wechat"
layout="@layout/item_settings" /> layout="@layout/item_settings"
android:visibility="gone" />
<include <include
android:id="@+id/item_invitedCode" android:id="@+id/item_invitedCode"
......
...@@ -63,7 +63,7 @@ ...@@ -63,7 +63,7 @@
android:id="@+id/img_invite" android:id="@+id/img_invite"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:padding="15dp" android:padding="10dp"
android:scaleType="centerCrop" android:scaleType="centerCrop"
android:src="@mipmap/bg_friends" /> android:src="@mipmap/bg_friends" />
......
...@@ -16,8 +16,7 @@ ...@@ -16,8 +16,7 @@
<com.mints.goodmoney.ui.widgets.CircleImageView <com.mints.goodmoney.ui.widgets.CircleImageView
android:id="@+id/item_title_avatar" android:id="@+id/item_title_avatar"
android:layout_width="70dp" android:layout_width="70dp"
android:layout_height="70dp" android:layout_height="70dp" />
android:src="@mipmap/ic_launcher" />
<LinearLayout <LinearLayout
android:layout_width="0dp" android:layout_width="0dp"
...@@ -84,7 +83,7 @@ ...@@ -84,7 +83,7 @@
android:layout_marginTop="20dp" android:layout_marginTop="20dp"
android:layout_marginEnd="15dp" android:layout_marginEnd="15dp"
android:background="@drawable/shape_gold_card" android:background="@drawable/shape_gold_card"
android:elevation="2dip" android:elevation="1.5dip"
android:gravity="center_vertical" android:gravity="center_vertical"
android:orientation="horizontal" android:orientation="horizontal"
android:paddingStart="15dp" android:paddingStart="15dp"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment