完成公众号
This commit is contained in:
parent
b11622f561
commit
849bcbe83c
@ -36,8 +36,11 @@
|
|||||||
>
|
>
|
||||||
> 4 多包名打包方式
|
> 4 多包名打包方式
|
||||||
|
|
||||||
|
|
||||||
## 2022-12-19
|
## 2022-12-19
|
||||||
|
|
||||||
> 1.App名称修改,以及动态获取
|
> 1.App名称修改,以及动态获取
|
||||||
> 2.首页地区选择去除
|
> 2.首页地区选择去除
|
||||||
|
|
||||||
|
## 2023-7-28
|
||||||
|
|
||||||
|
> 1.新闻详情添加登录、关注公众号权限
|
@ -215,10 +215,7 @@ public class CommonWebActivity extends BaseActivity {
|
|||||||
String query = "";
|
String query = "";
|
||||||
String str = "userId=" + UserLgUtils.getUserId();
|
String str = "userId=" + UserLgUtils.getUserId();
|
||||||
try {
|
try {
|
||||||
String key = URLEncoder.encode("userId", "UTF-8");
|
query = URLEncoder.encode(str, "UTF-8");
|
||||||
String value = URLEncoder.encode(UserLgUtils.getUserId(), "UTF-8");
|
|
||||||
query = key + "=" + value;
|
|
||||||
// query = URLEncoder.encode(str, "UTF-8");
|
|
||||||
} catch (UnsupportedEncodingException e) {
|
} catch (UnsupportedEncodingException e) {
|
||||||
throw new RuntimeException(e);
|
throw new RuntimeException(e);
|
||||||
}
|
}
|
||||||
|
@ -332,7 +332,6 @@ public class LoginActivity extends BaseActivity {
|
|||||||
public void onNext(Boolean baseSuccessBean) {
|
public void onNext(Boolean baseSuccessBean) {
|
||||||
dialog.dismiss();
|
dialog.dismiss();
|
||||||
UserLgUtils.putIsPublicCode(baseSuccessBean);
|
UserLgUtils.putIsPublicCode(baseSuccessBean);
|
||||||
//连接socket
|
|
||||||
setResult(333);
|
setResult(333);
|
||||||
finish();
|
finish();
|
||||||
}
|
}
|
||||||
@ -341,7 +340,9 @@ public class LoginActivity extends BaseActivity {
|
|||||||
public void onError(Throwable e) {
|
public void onError(Throwable e) {
|
||||||
dialog.dismiss();
|
dialog.dismiss();
|
||||||
ExceptionHandler.handleException(e);
|
ExceptionHandler.handleException(e);
|
||||||
ToastUtils.show("登录失败,请稍后重试");
|
setResult(333);
|
||||||
|
finish();
|
||||||
|
// ToastUtils.show("登录失败,请稍后重试");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -93,6 +93,7 @@ import com.tengshisoft.mudulemain.cultural.beans.NewsDetailBean;
|
|||||||
import com.tengshisoft.mudulemain.cultural.net.HomeApi;
|
import com.tengshisoft.mudulemain.cultural.net.HomeApi;
|
||||||
import com.tengshisoft.mudulemain.cultural.socket.SocketService;
|
import com.tengshisoft.mudulemain.cultural.socket.SocketService;
|
||||||
import com.tengshisoft.mudulemain.cultural.widget.ButtomCommentListDialogView;
|
import com.tengshisoft.mudulemain.cultural.widget.ButtomCommentListDialogView;
|
||||||
|
import com.tengshisoft.mudulemain.cultural.widget.NoClickRelativeLayout;
|
||||||
import com.youth.banner.Banner;
|
import com.youth.banner.Banner;
|
||||||
import com.youth.banner.transformer.ScaleInTransformer;
|
import com.youth.banner.transformer.ScaleInTransformer;
|
||||||
|
|
||||||
@ -182,7 +183,7 @@ public class NewsLocalDetailActivity extends BaseActivity {
|
|||||||
@BindView(R2.id.btn_public)
|
@BindView(R2.id.btn_public)
|
||||||
Button mBtnPublic;
|
Button mBtnPublic;
|
||||||
@BindView(R2.id.rl_public_code)
|
@BindView(R2.id.rl_public_code)
|
||||||
RelativeLayout mRlPublicCode;
|
NoClickRelativeLayout mRlPublicCode;
|
||||||
|
|
||||||
private AddPhotoBean mCurrentBean;
|
private AddPhotoBean mCurrentBean;
|
||||||
private String mPicPath;
|
private String mPicPath;
|
||||||
@ -208,6 +209,8 @@ public class NewsLocalDetailActivity extends BaseActivity {
|
|||||||
private NewsCategoryAdapter mCategoryAdapter;
|
private NewsCategoryAdapter mCategoryAdapter;
|
||||||
private ActivityResultLauncher<Intent> mResultLauncher;
|
private ActivityResultLauncher<Intent> mResultLauncher;
|
||||||
private SocketMsg mSocketMsg;
|
private SocketMsg mSocketMsg;
|
||||||
|
private boolean mIsAttention = false;//是否需要关注公众号
|
||||||
|
private boolean mIsFirst = true;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected int setLayoutId() {
|
protected int setLayoutId() {
|
||||||
@ -378,6 +381,7 @@ public class NewsLocalDetailActivity extends BaseActivity {
|
|||||||
setDataToView(newsDetailBean);
|
setDataToView(newsDetailBean);
|
||||||
if (TextUtils.isEmpty(newsDetailBean.getNewsViewAuth())) {
|
if (TextUtils.isEmpty(newsDetailBean.getNewsViewAuth())) {
|
||||||
setDataToView(newsDetailBean);
|
setDataToView(newsDetailBean);
|
||||||
|
mIsAttention = false;
|
||||||
} else {
|
} else {
|
||||||
//是否登录
|
//是否登录
|
||||||
if (TextUtils.isEmpty(UserLgUtils.getToken())) {
|
if (TextUtils.isEmpty(UserLgUtils.getToken())) {
|
||||||
@ -389,7 +393,9 @@ public class NewsLocalDetailActivity extends BaseActivity {
|
|||||||
//是否需要关注公众号
|
//是否需要关注公众号
|
||||||
if (newsDetailBean.getNewsViewAuth().contains("2")) {
|
if (newsDetailBean.getNewsViewAuth().contains("2")) {
|
||||||
showPublicCodeDialog(newsDetailBean);
|
showPublicCodeDialog(newsDetailBean);
|
||||||
|
mIsAttention = true;
|
||||||
} else {
|
} else {
|
||||||
|
mIsAttention = false;
|
||||||
setDataToView(newsDetailBean);
|
setDataToView(newsDetailBean);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1186,18 +1192,21 @@ public class NewsLocalDetailActivity extends BaseActivity {
|
|||||||
protected void onStart() {
|
protected void onStart() {
|
||||||
super.onStart();
|
super.onStart();
|
||||||
//在socket断链的情况先手动获取一次是否关注
|
//在socket断链的情况先手动获取一次是否关注
|
||||||
LogUtils.e("是否关注" + UserLgUtils.getIsPublicCode());
|
LogUtils.e("是否关注" + UserLgUtils.getIsPublicCode() + mIsFirst);
|
||||||
if (!UserLgUtils.getIsPublicCode()) {
|
if (!mIsFirst) {
|
||||||
if (mContentSkeleton != null) {
|
if (!UserLgUtils.getIsPublicCode() && mIsAttention) {
|
||||||
mContentSkeleton.show();
|
if (mContentSkeleton != null) {
|
||||||
} else {
|
mContentSkeleton.show();
|
||||||
mContentSkeleton = Skeleton.bind(mLlNewsContent)
|
} else {
|
||||||
.load(R.layout.item_skeleton_news_content_local)
|
mContentSkeleton = Skeleton.bind(mLlNewsContent)
|
||||||
.show();
|
.load(R.layout.item_skeleton_news_content_local)
|
||||||
|
.show();
|
||||||
|
}
|
||||||
|
mRlPublicCode.setVisibility(View.GONE);
|
||||||
|
getUserIsPublicCode();
|
||||||
}
|
}
|
||||||
mRlPublicCode.setVisibility(View.GONE);
|
|
||||||
getUserIsPublicCode();
|
|
||||||
}
|
}
|
||||||
|
mIsFirst = false;
|
||||||
mCommentPage = 1;
|
mCommentPage = 1;
|
||||||
if (!TextUtils.isEmpty(UserLgUtils.getToken())) {
|
if (!TextUtils.isEmpty(UserLgUtils.getToken())) {
|
||||||
getCommentListByLogin(mCommentPage);
|
getCommentListByLogin(mCommentPage);
|
||||||
@ -1613,7 +1622,9 @@ public class NewsLocalDetailActivity extends BaseActivity {
|
|||||||
AttentionCodeBean errorBean = new Gson().fromJson(strData, AttentionCodeBean.class);
|
AttentionCodeBean errorBean = new Gson().fromJson(strData, AttentionCodeBean.class);
|
||||||
UserLgUtils.putIsPublicCode(errorBean.isAttention());
|
UserLgUtils.putIsPublicCode(errorBean.isAttention());
|
||||||
//刷新页面
|
//刷新页面
|
||||||
refreshPage();
|
if (errorBean.isAttention()) {
|
||||||
|
refreshPage();
|
||||||
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,38 @@
|
|||||||
|
package com.tengshisoft.mudulemain.cultural.widget;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.util.AttributeSet;
|
||||||
|
import android.view.MotionEvent;
|
||||||
|
import android.widget.RelativeLayout;
|
||||||
|
|
||||||
|
public class NoClickRelativeLayout extends RelativeLayout {
|
||||||
|
public NoClickRelativeLayout(Context context) {
|
||||||
|
super(context);
|
||||||
|
}
|
||||||
|
|
||||||
|
public NoClickRelativeLayout(Context context, AttributeSet attrs) {
|
||||||
|
super(context, attrs);
|
||||||
|
}
|
||||||
|
|
||||||
|
public NoClickRelativeLayout(Context context, AttributeSet attrs, int defStyleAttr) {
|
||||||
|
super(context, attrs, defStyleAttr);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean dispatchTouchEvent(MotionEvent ev) {
|
||||||
|
boolean bool = super.dispatchTouchEvent(ev);
|
||||||
|
return bool;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onInterceptTouchEvent(MotionEvent ev) {
|
||||||
|
boolean bool = super.onInterceptTouchEvent(ev);
|
||||||
|
return bool;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onTouchEvent(MotionEvent event) {
|
||||||
|
boolean bool = super.onTouchEvent(event);
|
||||||
|
return bool;
|
||||||
|
}
|
||||||
|
}
|
@ -286,11 +286,13 @@
|
|||||||
layout="@layout/layout_bottom_comment" />
|
layout="@layout/layout_bottom_comment" />
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
|
||||||
<RelativeLayout
|
<com.tengshisoft.mudulemain.cultural.widget.NoClickRelativeLayout
|
||||||
android:id="@+id/rl_public_code"
|
android:id="@+id/rl_public_code"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:visibility="gone"
|
android:visibility="gone"
|
||||||
|
android:clickable="true"
|
||||||
|
android:focusable="true"
|
||||||
tools:visibility="visible">
|
tools:visibility="visible">
|
||||||
|
|
||||||
<com.github.mmin18.widget.RealtimeBlurView
|
<com.github.mmin18.widget.RealtimeBlurView
|
||||||
@ -328,5 +330,5 @@
|
|||||||
android:paddingBottom="5dp"
|
android:paddingBottom="5dp"
|
||||||
android:text="去关注"
|
android:text="去关注"
|
||||||
android:textColor="@color/white" />
|
android:textColor="@color/white" />
|
||||||
</RelativeLayout>
|
</com.tengshisoft.mudulemain.cultural.widget.NoClickRelativeLayout>
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
@ -175,6 +175,7 @@ public class SettingActivity extends BaseActivity {
|
|||||||
private void loginOut() {
|
private void loginOut() {
|
||||||
UserLgUtils.setToken("");
|
UserLgUtils.setToken("");
|
||||||
UserLgUtils.setId("");
|
UserLgUtils.setId("");
|
||||||
|
UserLgUtils.putIsPublicCode(false);
|
||||||
isLogin = false;
|
isLogin = false;
|
||||||
mTvLoginOut.setText("登录");
|
mTvLoginOut.setText("登录");
|
||||||
ToastUtils.showShort("退出成功");
|
ToastUtils.showShort("退出成功");
|
||||||
|
Loading…
Reference in New Issue
Block a user