心愿单审核和贵族购买

This commit is contained in:
18142669586 2023-04-08 17:27:26 +08:00
parent 9c3fbe0506
commit 8ae58e9c14
6 changed files with 55 additions and 3 deletions

View File

@ -395,6 +395,21 @@ public class JavascriptInterfaceUtils {
}
//心愿单守護购买
@JavascriptInterface
public void BuyProtection(String by) {
Bus.get().post(new JavascriptInterfaceEvent()
.setMethod("BuyProtection").setData(by));
}
//心愿单贵族购买
@JavascriptInterface
public void BuyVIP(String by) {
Bus.get().post(new JavascriptInterfaceEvent()
.setMethod("BuyVIP").setData(by));
}
@JavascriptInterface
public String androidMethodLookLive(String uId, String liveId, String isLiving) {
//跳转个人主页

View File

@ -781,7 +781,7 @@
<string name="live_close_exit">直接退出</string>
<string name="user">用戶</string>
<string name="automatic_chat">你都不主動我們怎麼會有故事跟主播Say Hi吧~</string>
<string name="automatic_chat">阿萨飒飒飒飒飒飒萨达飒飒飒飒飒飒你都不主動我們怎麼會有故事跟主播Say Hi吧~</string>
<string name="add_follow">+ 關注</string>
<string name="add_into_active">進入活動</string>

View File

@ -1345,6 +1345,23 @@ public abstract class LiveActivity extends AbsActivity implements SocketMessageL
fragment.show(getSupportFragmentManager(), "LiveGuardBuyDialogFragment");
}
public void openNewBuyGuardWindow(String by) {
if (TextUtils.isEmpty(mLiveUid) || TextUtils.isEmpty(mStream) || mLiveGuardInfo == null) {
return;
}
LiveNewGuardBuyDialogFragment fragment = new LiveNewGuardBuyDialogFragment();
fragment.setLiveGuardInfo(mLiveGuardInfo);
Bundle bundle = new Bundle();
bundle.putString(Constants.COIN_NAME, mCoinName);
bundle.putString(Constants.LIVE_UID, mLiveUid);
bundle.putString(Constants.LIVE_ANCHER_NAME, mAncherName);
bundle.putString(Constants.STREAM, mStream);
bundle.putString(Constants.LIVE_ANCHER_ICON, mAncherIcon);
bundle.putString(Constants.USER_ICON, CommonAppConfig.getInstance().getUserBean().getAvatar());
bundle.putString("by", by);
fragment.setArguments(bundle);
fragment.show(getSupportFragmentManager(), "LiveGuardBuyDialogFragment");
}
/**
* 打开购买守护的弹窗
*/

View File

@ -29,6 +29,7 @@ import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import android.widget.Toast;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.GridLayoutManager;
@ -558,7 +559,7 @@ public class LiveChatAdapter extends RecyclerView.Adapter {
public void scrollToBottom() {
if (mList.size() > 0) {
mRecyclerView.smoothScrollToPosition(getItemCount() - 1);
mRecyclerView.smoothScrollToPosition(getItemCount());
}
mRecyclerViewScrolledDy = 0;
}

View File

@ -21,6 +21,7 @@ import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.LinearLayout;
import android.widget.TextView;
import android.widget.Toast;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
@ -28,9 +29,11 @@ import androidx.fragment.app.FragmentManager;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.yunbao.common.CommonAppConfig;
import com.yunbao.common.Constants;
import com.yunbao.common.bean.JsWishBean;
import com.yunbao.common.bean.LiveBean;
import com.yunbao.common.bean.UserBean;
import com.yunbao.common.dialog.AbsDialogFragment;
import com.yunbao.common.event.JavascriptInterfaceEvent;
import com.yunbao.common.http.HttpCallback;
@ -44,6 +47,7 @@ import com.yunbao.live.R;
import com.yunbao.live.activity.LiveActivity;
import com.yunbao.live.activity.LiveAudienceActivity;
import com.yunbao.live.activity.LiveRyAnchorActivity;
import com.yunbao.live.activity.ZhuangBanActivity;
import com.yunbao.live.event.LiveRoomChangeEvent;
import com.yunbao.live.http.LiveHttpUtil;
import com.yunbao.live.presenter.LiveRoomCheckLivePresenter;
@ -357,6 +361,15 @@ public class LiveHDDialogFragment extends AbsDialogFragment {
);
}
//守護
}else if(TextUtils.equals(event.getMethod(), "BuyProtection")){
((LiveActivity) mContext).openNewBuyGuardWindow(event.getData());
}else if(TextUtils.equals(event.getMethod(), "BuyVIP")){
UserBean u = CommonAppConfig.getInstance().getUserBean();
String url = CommonAppConfig.HOST + "/h5/Noble/index.html?nickname="
+ u.getUserNiceName() + "&usernobId=" + u.getNoble_id() + "&uid="
+ CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken()+"&active="+event.getData();
ZhuangBanActivity.forward(mContext, url, false);
}
}
}

View File

@ -198,7 +198,11 @@ public class LiveNewGuardBuyDialogFragment extends AbsDialogFragment implements
mGuardRightAdapter.setList(mRightList);
buyItemsAdapter.notifyDataSetChanged();
refreshList(1);
if(bundle.getString("by")!=null){
refreshList(Integer.parseInt(bundle.getString("by"))-1);
}else{
refreshList(1);
}
} else {
ToastUtil.show(msg);
@ -275,6 +279,8 @@ public class LiveNewGuardBuyDialogFragment extends AbsDialogFragment implements
}
}
mGuardRightAdapter.notifyDataSetChanged();
buyItemsAdapter.changeItem(index);
buyItemsAdapter.notifyDataSetChanged();
// mBtnBuy.setEnabled(mCoinVal >= guardBuyBean.getCoin());
}