Commit 96fb4ff5 by mReturn

客户验收二维码

parent fc52a1b8
...@@ -26,30 +26,30 @@ public class Constants { ...@@ -26,30 +26,30 @@ public class Constants {
/** /**
* uat环境配置. * uat环境配置.
*/ */
public static final String ENVIROMENT = "uat"; // public static final String ENVIROMENT = "uat";
public static final int LOG_LEVEL = LogUtils.LEVEL_ALL; // public static final int LOG_LEVEL = LogUtils.LEVEL_ALL;
public static final String BASE_URL = "http://47.95.223.6:3112"; // public static final String BASE_URL = "http://47.95.223.6:3112";
public final static String UP_PHOTO = "/file/uploadMore?targetPath=test/sp/mobile/android/business/checkApply"; // public final static String UP_PHOTO = "/file/uploadMore?targetPath=test/sp/mobile/android/business/checkApply";
public final static String WEB_SOP = "http://47.95.223.6:9004/#/sop"; // public final static String WEB_SOP = "http://47.95.223.6:9004/#/sop";
public final static String WEB_SOP_DETAIL = "http://47.95.223.6:9004/#/sopdetail"; // public final static String WEB_SOP_DETAIL = "http://47.95.223.6:9004/#/sopdetail";
public final static String WEB_ZHI_SHI = "http://47.95.223.6:9004/#/detail"; // public final static String WEB_ZHI_SHI = "http://47.95.223.6:9004/#/detail";
public final static String CHECK_MULTI_WEB_SOP = "http://47.95.223.6:9004/#/manyServiceResult"; // public final static String CHECK_MULTI_WEB_SOP = "http://47.95.223.6:9004/#/manyServiceResult";
public final static String MULTI_WEB_SOP = "http://47.95.223.6:9004/#/manySop"; // public final static String MULTI_WEB_SOP = "http://47.95.223.6:9004/#/manySop";
public static final boolean IS_DEBUG = true; // public static final boolean IS_DEBUG = true;
/** /**
* 正式环境. * 正式环境.
*/ */
// public static final String ENVIROMENT = "release"; public static final String ENVIROMENT = "release";
// public static final int LOG_LEVEL = LogUtils.LEVEL_OFF; public static final int LOG_LEVEL = LogUtils.LEVEL_OFF;
// public static final String BASE_URL = "https://mobile.kf.ai"; public static final String BASE_URL = "https://mobile.kf.ai";
// public final static String UP_PHOTO = "/file/uploadMore?targetPath=online/sp/mobile/android/business/checkApply"; public final static String UP_PHOTO = "/file/uploadMore?targetPath=online/sp/mobile/android/business/checkApply";
// public final static String WEB_SOP = "https://sop.kf.ai/#/sop"; public final static String WEB_SOP = "https://sop.kf.ai/#/sop";
// public final static String WEB_SOP_DETAIL = "https://sop.kf.ai/#/sopdetail"; public final static String WEB_SOP_DETAIL = "https://sop.kf.ai/#/sopdetail";
// public final static String WEB_ZHI_SHI = "https://sop.kf.ai/#/detail"; public final static String WEB_ZHI_SHI = "https://sop.kf.ai/#/detail";
// public final static String CHECK_MULTI_WEB_SOP = "https://sop.kf.ai/#/manyServiceResult"; public final static String CHECK_MULTI_WEB_SOP = "https://sop.kf.ai/#/manyServiceResult";
// public final static String MULTI_WEB_SOP = "https://sop.kf.ai/#/manySop"; public final static String MULTI_WEB_SOP = "https://sop.kf.ai/#/manySop";
// public static final boolean IS_DEBUG = false; public static final boolean IS_DEBUG = false;
/** /**
* 统一配置. * 统一配置.
......
...@@ -157,8 +157,8 @@ public class OrderApiFactory { ...@@ -157,8 +157,8 @@ public class OrderApiFactory {
public static Observable<String> createUrl(int orderId) { public static Observable<String> createUrl(int orderId) {
return Api.getService(OrderService.class).createUrl(orderId).compose(Api.applySchedulers()); return Api.getService(OrderService.class).createUrl(orderId).compose(Api.applySchedulers());
} }
public static Call<ResponseBody> createWxUrl(int orderId, int width) { public static Call<ResponseBody> createWxUrl(String path , int width) {
return Api.getService(OrderService.class).createWxUrl(orderId,width); return Api.getService(OrderService.class).createWxUrl(path,width);
} }
public static Observable<Boolean> queryPayStatus(int siteId) { public static Observable<Boolean> queryPayStatus(int siteId) {
......
...@@ -343,7 +343,7 @@ interface OrderService { ...@@ -343,7 +343,7 @@ interface OrderService {
Observable<BaseResponse<String>> createUrl(@Path("orderId") int orderId); Observable<BaseResponse<String>> createUrl(@Path("orderId") int orderId);
@GET(OrderConstant.CREATE_WX_URL) @GET(OrderConstant.CREATE_WX_URL)
Call<ResponseBody> createWxUrl(@Query("id") int workId, @Query("width") int width); Call<ResponseBody> createWxUrl(@Query("path") String path, @Query("width") int width);
/** /**
* 查询是否开通移动支付. * 查询是否开通移动支付.
......
...@@ -171,7 +171,8 @@ public class OrderConstant { ...@@ -171,7 +171,8 @@ public class OrderConstant {
public final static String CREATE_URL = "/api-user" + "/account/createUrlByOrderId/{orderId}"; public final static String CREATE_URL = "/api-user" + "/account/createUrlByOrderId/{orderId}";
public final static String CREATE_WX_URL = "/api-third/WXUser/getWxQrCode?path=pages/orderServerDetail/main"; // public final static String CREATE_WX_URL = "/api-third/WXUser/getWxQrCode?path=pages/orderServerDetail/main";
public final static String CREATE_WX_URL = "/api-third/WXUser/getWxQrCode";
/** /**
* 修改自建单. * 修改自建单.
......
...@@ -6,11 +6,14 @@ import android.graphics.BitmapFactory; ...@@ -6,11 +6,14 @@ import android.graphics.BitmapFactory;
import com.dayu.common.Constants; import com.dayu.common.Constants;
import com.dayu.order.R; import com.dayu.order.R;
import com.dayu.order.api.OrderApiFactory; import com.dayu.order.api.OrderApiFactory;
import com.dayu.order.common.OrderConstant;
import com.dayu.utils.QRCodeUtils; import com.dayu.utils.QRCodeUtils;
import com.dayu.utils.ToastUtils; import com.dayu.utils.ToastUtils;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import okhttp3.ResponseBody; import okhttp3.ResponseBody;
import retrofit2.Call; import retrofit2.Call;
...@@ -40,7 +43,14 @@ public class QRCodePresenter extends QRCodeContract.Presenter { ...@@ -40,7 +43,14 @@ public class QRCodePresenter extends QRCodeContract.Presenter {
// })); // }));
Call<ResponseBody> call = OrderApiFactory.createWxUrl(mId, 470); // OrderConstant.CREATE_WX_URL = OrderConstant.CREATE_WX_URL.replace("{id}",mId+"");
String path = "pages/orderServerDetail/main?id="+mId;
// try {
// path = URLEncoder.encode(path,"UTF-8");
// } catch (UnsupportedEncodingException e) {
// e.printStackTrace();
// }
Call<ResponseBody> call = OrderApiFactory.createWxUrl(path, 470);
call.enqueue(new Callback<ResponseBody>() { call.enqueue(new Callback<ResponseBody>() {
@Override @Override
public void onResponse(Call<ResponseBody> call, Response<ResponseBody> response) { public void onResponse(Call<ResponseBody> call, Response<ResponseBody> response) {
...@@ -50,7 +60,7 @@ public class QRCodePresenter extends QRCodeContract.Presenter { ...@@ -50,7 +60,7 @@ public class QRCodePresenter extends QRCodeContract.Presenter {
Bitmap bitmap = BitmapFactory.decodeStream(is); Bitmap bitmap = BitmapFactory.decodeStream(is);
is.close(); is.close();
mView.setBitmap(bitmap); mView.setBitmap(bitmap);
} catch (IOException e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
ToastUtils.showShortToast(R.string.error_unknow); ToastUtils.showShortToast(R.string.error_unknow);
} }
......
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