Commit 880c170f authored by jyx's avatar jyx

登录名称显示错误修改

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