Commit 017a5e0d by han xu

241115需求开发

parent 91bf5283
......@@ -34,7 +34,7 @@ public class Constants {
public static final String PROGRAM_PATH = "pages/mallDetail/main?goodsId=gid&userId=uid&type=1"; //小程序路径
public static final String LEAEN_PROGRAM_PATH = "/pages/shareVideo/main?type=_type&id="; //课程视频小程序路径
public static final String USER_PROGRAM_PATH = " /pages/complaint/main?accountId=";
public static final String USER_PROGRAM_PATH = " /pages/masterInfo/main?id=";
public static final String INVITE_NEW_SHARE_URL = "http://app.dl.kf.ai/ext/#/shareMaster?code="; //邀请新人分享链接
public static final String INVITE_NEW_SHARE_URL_BUSINESS = "http://app.dl.kf.ai/ext/#/merchants?code="; //邀请商家分享链接
public static final String WITHDRAWAL_URL = "dayu-h5-withdrawal?";//申请提现链接.
......@@ -194,6 +194,8 @@ public class Constants {
public final static String ID = "id";
public final static String TITLE = "title";
public final static String SHOULD_GET_WEB_TITLE = "shouldGetWebTitle";
public final static String IDS = "ids";
public final static String OPERATE_DETAIL = "operate_detail";
public final static String OPERATE_DETAIL_PHONE = "operate_detail_phone";
......
......@@ -2,6 +2,8 @@ package com.bigfish.salecenter.adapter;
import android.view.View;
import androidx.core.content.ContextCompat;
import com.bigfish.salecenter.R;
import com.bigfish.salecenter.databinding.ItemSaleProductBinding;
import com.bigfish.salecenter.model.SaleProduct;
......@@ -28,13 +30,20 @@ public class BdOrderAdapter extends CoreAdapter<SaleProduct, ItemSaleProductBind
super.onBind(holder, item, position);
holder.tvBrandModel.setText(item.getCustomerCompany());
GlideImageLoader.loadFit(mContext, holder.ivImg, item.getGoodsFirstUrl(), R.drawable.icon_img_default);
holder.tvSinglePrice.setText(CommonUtils.getIntMoneyStr(mContext, item.getBdPrice()));
// holder.tvSinglePrice.setText(CommonUtils.getIntMoneyStr(mContext, item.getBdPrice()));
holder.tvSinglePrice.setVisibility(View.GONE);
holder.tvSinglePriceText.setVisibility(View.GONE);
holder.tvCommision.setText(CommonUtils.getIntMoneyStr(mContext, item.getSalesPrice()));
holder.btnShare.setVisibility(View.GONE);
holder.btnShare.setVisibility(View.VISIBLE);
holder.btnShare.setBackground(ContextCompat.getDrawable(mContext, R.drawable.btn_black_corner));
holder.tvShare.setText("取消");
holder.award.setText("继续提交");
holder.collectIcon.setVisibility(View.GONE);
holder.award.setVisibility(View.VISIBLE);
holder.llCommision.setVisibility(View.GONE);
holder.rlSinglePrice.setVisibility(View.VISIBLE);
holder.btnShare.setOnClickListener(v -> mPresenter.onCancelClick(item.getId()));
}
public void initPresenter(SaleProductPresent presenter) {
......
......@@ -37,7 +37,7 @@ public class SaleProductAdapter extends CoreAdapter<ProductListBean, ItemSalePro
holder.tvBrandModel.setText(item.getGoodsModel());
GlideImageLoader.loadFit(mContext, holder.ivImg, item.getFirstUrl(), R.drawable.icon_img_default);
holder.tvSinglePrice.setText(CommonUtils.getIntMoneyStr(mContext, item.getBdPrice()));
holder.tvCommision.setText(CommonUtils.getIntMoneyStr(mContext, item.getSalesPrice()));
holder.tvCommision.setText(CommonUtils.getIntMoneyStr(mContext, item.getSalesPrice()) + '起');
if (item.getCollectionStatus() == 1) {
holder.collectIcon.setBackgroundResource(R.drawable.iicon_collect);
} else {
......
......@@ -2,6 +2,7 @@ package com.bigfish.salecenter.api;
import static com.dayu.common.Constants.API_8600;
import com.bigfish.salecenter.model.CancelProductData;
import com.bigfish.salecenter.model.CollectProductData;
import com.bigfish.salecenter.model.OrdersBean;
import com.bigfish.salecenter.model.ProductDetailBean;
......@@ -23,6 +24,7 @@ import retrofit2.Call;
import retrofit2.http.Body;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.PUT;
import retrofit2.http.Path;
import retrofit2.http.Query;
......@@ -104,6 +106,13 @@ public interface SaleService {
Observable<BaseResponse<Boolean>> collectProdcut(@Body CollectProductData data);
/**
* 取消商机有奖
*/
@PUT(API_8600+ "/bdOrder")
Observable<BaseResponse<Boolean>> cancelProduct(@Body CancelProductData data);
/**
* 销售列表
*
* @return
......
package com.bigfish.salecenter.model;
public class CancelProductData {
public int id;
public String updated;
public int status;
public CancelProductData (int id, String updated, int status){
this.id = id;
this.updated = updated;
this.status = status;
}
}
......@@ -132,6 +132,10 @@ public class SaleProduct implements Serializable {
this.customerCompany = customerCompany;
}
public int getId() {
return id;
}
public static class BdOrderTasks implements Serializable {
private int bdOrderId;
......
package com.bigfish.salecenter.presenter.saleproduct;
import com.bigfish.salecenter.model.ProductListBean;
import com.bigfish.salecenter.model.SaleProduct;
import com.bigfish.salecenter.model.SaleTab;
import com.dayu.base.ui.presenter.BaseListPresenter;
import com.dayu.base.ui.presenter.BasePresenter;
......
......@@ -6,8 +6,10 @@ import androidx.databinding.ObservableField;
import com.bigfish.salecenter.api.SaleService;
import com.bigfish.salecenter.event.RefreshSaleTab;
import com.bigfish.salecenter.model.CancelProductData;
import com.bigfish.salecenter.model.CollectProductData;
import com.bigfish.salecenter.model.ProductListBean;
import com.bigfish.salecenter.model.SaleProduct;
import com.dayu.base.api.Api;
import com.dayu.common.Constants;
import com.dayu.event.UserInfo;
......@@ -138,6 +140,17 @@ public class SaleProductPresent extends SaleProductContract.Presenter {
// );
}
//点击取消按钮
public void onCancelClick(int id) {
Api.getService(SaleService.class).cancelProduct(new CancelProductData(id, UserManager.getInstance().getUser().getAccountName(), 6)).compose(Api.applySchedulers())
.subscribe(baseObserver(
products -> {
this.refresh();
}, responeThrowable -> datas.set(Constants.FAILED)
));
}
@Override
public void loadMore() {
......
......@@ -5,6 +5,7 @@ import android.graphics.drawable.AnimationDrawable;
import android.os.Bundle;
import android.text.Editable;
import android.text.TextUtils;
import android.util.Log;
import android.view.View;
import android.view.inputmethod.EditorInfo;
......
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="5dp"/>
<solid android:color="@color/cl_home_title_text_color"/>
</shape>
\ No newline at end of file
......@@ -53,7 +53,7 @@
<TextView
style="@style/sale_item_text"
android:textSize="@dimen/dp_12"
android:text="销售提成:" />
android:text="商机奖励/销售提成:" />
<TextView
android:id="@+id/tv_commision"
......@@ -79,6 +79,7 @@
android:orientation="horizontal">
<TextView
android:id="@+id/tv_single_price_text"
style="@style/sale_item_text"
android:textSize="@dimen/dp_12"
android:text="商机奖金:" />
......@@ -111,6 +112,7 @@
android:gravity="center">
<TextView
android:id="@+id/tv_share"
android:layout_width="wrap_content"
android:layout_height="30dp"
android:drawablePadding="10dp"
......
......@@ -116,6 +116,7 @@ public class ServiceBean {
private String realName;
private String accountUrl;
private String identityUrl;
private String identityBackUrl;
public String getAccountUrl() {
return accountUrl;
......@@ -129,6 +130,10 @@ public class ServiceBean {
return identityUrl;
}
public String getIdentityBackUrl() {
return identityBackUrl;
}
public void setIdentityUrl(String identityUrl) {
this.identityUrl = identityUrl;
}
......
......@@ -15,11 +15,13 @@ public class ServiceSaveBean1 {
private String realName;
private String accountUrl;
private String identityUrl;
private String identityBackUrl;
public AccountExt(String realName, String accountUrl, String identityUrl) {
public AccountExt(String realName, String accountUrl, String identityUrl, String identityBackUrl) {
this.realName = realName;
this.accountUrl = accountUrl;
this.identityUrl = identityUrl;
this.identityBackUrl = identityBackUrl;
}
public AccountExt(String realName) {
......
......@@ -144,6 +144,22 @@ public class CommeWebViewActivity extends DataBindingActivity<ActivityWebviewBin
return true;
}
});
mWebView.setWebViewClient(new WebViewClient() {
@Override
public void onPageFinished(WebView view, String url) {
super.onPageFinished(view, url);
// 获取网页标题
String pageTitle = view.getTitle();
if (!pageTitle.isEmpty()) {
mBind.tvTitle.setText(pageTitle);
}
}
});
mWebView.setWebChromeClient(new WebChromeClient() {
public void openFileChooser(ValueCallback<Uri> uploadMsg, String AcceptType, String capture) {
......
......@@ -44,9 +44,14 @@ public class RegisterActivity extends BaseActivity<SImplePresenter, ActivityRegi
private String accountUrl;
private String accountPath;
private String identityUrl;
private String identityBackUrl;
private String identityPath;
private String identityBackPath;
private int headerRequest = 123;
private int identityRequest = 124;
private int identityBackRequest = 124;
private volatile int uploadImageCount = 0;
boolean isForce; //是否强制用户选择服务场景
......@@ -84,6 +89,12 @@ public class RegisterActivity extends BaseActivity<SImplePresenter, ActivityRegi
SelectPicUtils.selectPic(mActivity, 1, true, identityRequest,true);
}
);
mBind.addIdentityBack.setOnClickListener(v -> {
ToastUtils.showLongToast("相机权限使用说明: 用于拍照、录制视频等场景");
CommonUtils.hideSoftInput(mActivity);
SelectPicUtils.selectPic(mActivity, 1, true, identityBackRequest,true);
}
);
}
......@@ -102,6 +113,7 @@ public class RegisterActivity extends BaseActivity<SImplePresenter, ActivityRegi
ServiceBean.AccountExt account = data.getAccountExt();
mBind.etName.setText(account.getRealName());
identityUrl = account.getIdentityUrl();
identityBackUrl = account.getIdentityBackUrl();
accountUrl = account.getAccountUrl();
if (!TextUtils.isEmpty(accountUrl)) {
GlideImageLoader.load(mActivity, accountUrl, mBind.header);
......@@ -109,6 +121,9 @@ public class RegisterActivity extends BaseActivity<SImplePresenter, ActivityRegi
if (!TextUtils.isEmpty(identityUrl)) {
GlideImageLoader.load(mActivity, identityUrl, mBind.idetntity);
}
if (!TextUtils.isEmpty(identityBackUrl)) {
GlideImageLoader.load(mActivity, identityBackUrl, mBind.idetntityBack);
}
}));
//服务类型数据
......@@ -147,39 +162,46 @@ public class RegisterActivity extends BaseActivity<SImplePresenter, ActivityRegi
}
if (TextUtils.isEmpty(identityUrl) && TextUtils.isEmpty(identityPath)) {
ToastUtils.showShortToast("请先上传身份证照片");
ToastUtils.showShortToast("请先上传身份证人像面照片");
return;
}
if (TextUtils.isEmpty(identityBackUrl) && TextUtils.isEmpty(identityPath)) {
ToastUtils.showShortToast("请先上传身份证国徽面照片");
return;
}
showDialog();
if (TextUtils.isEmpty(accountUrl) || TextUtils.isEmpty(identityUrl)) {
if (TextUtils.isEmpty(accountUrl)) {
BaseApiFactory.uploadPhotoNew(BaseApiFactory.packPhoto(accountPath), Constants.PHOTO + "/privacy/head", "yyMM")
.subscribe(mPresenter.baseObserver(imgs -> {
accountUrl = imgs.get(0);
if (TextUtils.isEmpty(identityUrl)) {
BaseApiFactory.uploadPhotoNew(BaseApiFactory.packPhoto(identityPath), Constants.PHOTO + "/privacy/idcard", "yyMM")
.subscribe(mPresenter.baseObserver(data -> {
identityUrl = data.get(0);
save();
}));
} else {
save();
}
}));
} else if (TextUtils.isEmpty(identityUrl)) {
BaseApiFactory.uploadPhotoNew(BaseApiFactory.packPhoto(identityPath), Constants.PHOTO + "/privacy/idcard", "yyMM")
.subscribe(mPresenter.baseObserver(imgs -> {
identityUrl = imgs.get(0);
save();
}));
}
} else {
save();
if (TextUtils.isEmpty(identityUrl)) {
BaseApiFactory.uploadPhotoNew(BaseApiFactory.packPhoto(identityPath), Constants.PHOTO + "/privacy/idcard", "yyMM")
.subscribe(mPresenter.baseObserver(data -> {
identityUrl = data.get(0);
save();
}));
}
if (TextUtils.isEmpty(identityBackUrl)) {
BaseApiFactory.uploadPhotoNew(BaseApiFactory.packPhoto(identityBackPath), Constants.PHOTO + "/privacy/idcard", "yyMM")
.subscribe(mPresenter.baseObserver(data -> {
identityBackUrl = data.get(0);
save();
}));
}
if (TextUtils.isEmpty(accountUrl)) {
BaseApiFactory.uploadPhotoNew(BaseApiFactory.packPhoto(accountPath), Constants.PHOTO + "/privacy/head", "yyMM")
.subscribe(mPresenter.baseObserver(imgs -> {
accountUrl = imgs.get(0);
save();
}));
}
}
private void save() {
ServiceSaveBean1.AccountExt accountExt = new ServiceSaveBean1.AccountExt(mBind.etName.getText().toString().trim(), accountUrl, identityUrl);
if (uploadImageCount != 0){
return;
}
ServiceSaveBean1.AccountExt accountExt = new ServiceSaveBean1.AccountExt(mBind.etName.getText().toString().trim(), accountUrl, identityUrl, identityBackUrl);
ServiceSaveBean1 saveBean = new ServiceSaveBean1(accountExt);
Api.getService(UserService2.class).commitData1(saveBean, mUserId).compose(Api.applySchedulers())
.subscribe(mPresenter.baseObserver(bool -> {
......@@ -221,6 +243,17 @@ public class RegisterActivity extends BaseActivity<SImplePresenter, ActivityRegi
}
GlideImageLoader.load_1(mActivity, identityPath, mBind.idetntity);
}
} else if (requestCode == identityBackRequest) {
identityBackUrl = "";
if (!TextUtils.isEmpty(mSelectList.get(0).getCompressPath())) {
identityBackPath =mSelectList.get(0).getCompressPath();
} else {
identityBackPath = mSelectList.get(0).getPath();
if (identityBackPath.contains("content")){
identityBackPath = mSelectList.get(0).getRealPath();
}
}
GlideImageLoader.load_1(mActivity, identityBackPath, mBind.idetntityBack);
}
}
}
......
......@@ -171,7 +171,7 @@
android:paddingTop="5dp"
android:layout_marginTop="20dp"
android:paddingBottom="5dp"
android:text="请确认您的身份证正面照片:"
android:text="请确认您的身份证照片:"
android:textColor="@color/default_text_color"
android:textSize="16dp" />
......@@ -220,6 +220,52 @@
android:text="上传/拍照" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="horizontal"
android:paddingTop="20dp">
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="2"
android:gravity="center">
<ImageView
android:id="@+id/idetntityBack"
android:layout_width="172dp"
android:layout_height="108dp"
android:src="@drawable/iicon_register_identity_back" />
</LinearLayout>
<LinearLayout
android:id="@+id/addIdentityBack"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="+"
android:textColor="@color/common_text_color"
android:textSize="30dp" />
<TextView
style="@style/sale_item_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:paddingEnd="10dp"
android:text="上传/拍照" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
</androidx.core.widget.NestedScrollView>
</com.scwang.smartrefresh.layout.SmartRefreshLayout>
......
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 sign in to comment