Commit 0bc9e82d671279631e0a3317b9fd064d4db9457f

Authored by 李攀
1 parent 6c745e31

wfsdf

... ... @@ -11,8 +11,8 @@ def isWindows = {
11 11 }
12 12
13 13 ext {
14   - APP_VERSION_CODE = 5;
15   - APP_VERSION_NAME = "v2.2-0606";
  14 + APP_VERSION_CODE = 6;
  15 + APP_VERSION_NAME = "v2.3-0608";
16 16 }
17 17
18 18 android {
... ...
... ... @@ -18,6 +18,7 @@ public class RoomQrCodeInfo extends BaseModel {
18 18 public static class DataEntity {
19 19
20 20 private String code;
  21 + private String room_sn;
21 22
22 23 public String getCode() {
23 24 return code;
... ... @@ -27,10 +28,19 @@ public class RoomQrCodeInfo extends BaseModel {
27 28 this.code = code;
28 29 }
29 30
  31 + public String getRoom_sn() {
  32 + return room_sn;
  33 + }
  34 +
  35 + public void setRoom_sn(String room_sn) {
  36 + this.room_sn = room_sn;
  37 + }
  38 +
30 39 @Override
31 40 public String toString() {
32 41 return "DataEntity{" +
33 42 "code='" + code + '\'' +
  43 + ", room_sn='" + room_sn + '\'' +
34 44 '}';
35 45 }
36 46 }
... ...
... ... @@ -22,6 +22,7 @@ public class RoomStatusInfo extends BaseModel {
22 22 private int end_time;
23 23 private int status;
24 24 private String film_hash;
  25 + private String film_name;
25 26 private int now_time;
26 27
27 28 public String getOrder_sn() {
... ... @@ -64,6 +65,14 @@ public class RoomStatusInfo extends BaseModel {
64 65 this.film_hash = film_hash;
65 66 }
66 67
  68 + public String getFilm_name() {
  69 + return film_name;
  70 + }
  71 +
  72 + public void setFilm_name(String film_name) {
  73 + this.film_name = film_name;
  74 + }
  75 +
67 76 public int getNow_time() {
68 77 return now_time;
69 78 }
... ... @@ -80,6 +89,7 @@ public class RoomStatusInfo extends BaseModel {
80 89 ", end_time=" + end_time +
81 90 ", status=" + status +
82 91 ", film_hash='" + film_hash + '\'' +
  92 + ", film_name='" + film_name + '\'' +
83 93 ", now_time=" + now_time +
84 94 '}';
85 95 }
... ...
  1 +package com.gimi.common.cinema.utils;
  2 +
  3 +import android.content.Context;
  4 +
  5 +/**
  6 + * Created by wugian on 2017/6/12.
  7 + */
  8 +
  9 +public class ResUtils {
  10 + public static String getResResult(Context context, int... resIds) {
  11 + StringBuilder stringBuilder = new StringBuilder();
  12 + for (int resId : resIds) {
  13 + stringBuilder.append(context.getString(resId));
  14 + }
  15 + return stringBuilder.toString();
  16 + }
  17 +}
... ...
... ... @@ -57,5 +57,7 @@ public interface SmartControlContract {
57 57 void getCleanQrCode(String orderSn, String roomSn);
58 58
59 59 void getSysTime(Context context);
  60 +
  61 + void getNextOrderInfo(Context context, String roomSn);
60 62 }
61 63 }
... ...
... ... @@ -122,6 +122,23 @@ public class SmartControlPresenter implements SmartControlContract.Presenter {
122 122 });
123 123 }
124 124
  125 +
  126 + @Override
  127 + public void getNextOrderInfo(Context context, String roomSn) {
  128 + roomInfoModel.getRoomNestOrderInfo(roomSn, new RoomInfoModelImpl.GetRoomStatusListener() {
  129 + @Override
  130 + public void onGetRoomStatusSuccess(RoomStatusInfo info) {
  131 + LogUtils.i("room-info", "onGetRoomStatusSuccess:" + info.toString());
  132 + mainView.updateOrderInfo(info);
  133 + }
  134 +
  135 + @Override
  136 + public void onGetRoomStatusFailure(WrongMsg wrongMsg) {
  137 + LogUtils.i("room-info", "onGetRoomStatusFailure:" + wrongMsg.toString());
  138 + }
  139 + });
  140 + }
  141 +
125 142 @Override
126 143 public void reportOpenDoorStatus(String oderSn) {
127 144 roomInfoModel.reportOpenDoorStatus(oderSn, new RoomInfoModelImpl.OpenDoorStatusListener() {
... ...
... ... @@ -29,6 +29,7 @@ import com.gimi.common.cinema.utils.ActivityCollector;
29 29 import com.gimi.common.cinema.utils.CToast;
30 30 import com.gimi.common.cinema.utils.LogUtils;
31 31 import com.gimi.common.cinema.utils.OpenMMUtils;
  32 +import com.gimi.common.cinema.utils.ResUtils;
32 33 import com.gimi.common.cinema.utils.SambaFileCharge;
33 34 import com.gimi.common.cinema.utils.Utils;
34 35 import com.google.gson.Gson;
... ... @@ -51,6 +52,7 @@ import com.telink.bluetooth.light.Parameters;
51 52 import com.telink.bluetooth.light.model.Mesh;
52 53 import com.telink.util.Event;
53 54 import com.telink.util.EventListener;
  55 +import com.xgimi.gimicinema.R;
54 56 import com.xgimi.gimicinema.activity.AdsPreVideoPlayerActivity;
55 57 import com.xgimi.gimicinema.activity.QrCodeShowActivity;
56 58 import com.xgimi.gimicinema.activity.SimpleAdsPlayer2;
... ... @@ -68,6 +70,7 @@ public class SmartControlService extends BaseService implements EventListener<St
68 70
69 71 public static final int ORDER_PLAY_COMPLETE = 0x1101;
70 72
  73 + private Context mContext;
71 74 private boolean hasSystemFeatureBluetoothLe = true;
72 75 private BLEBroadcastReceiver bleBroadcastReceiver = new BLEBroadcastReceiver();
73 76 private SmartControlContract.Presenter presenter;
... ... @@ -102,6 +105,7 @@ public class SmartControlService extends BaseService implements EventListener<St
102 105 @Override
103 106 public int onStartCommand(Intent intent, int flags, int startId) {
104 107 super.onStartCommand(intent, flags, startId);
  108 + mContext = this;
105 109 new SmartControlPresenter(this);
106 110 mApplication = (FangTangApplication) getApplication();
107 111 mApplication.doInit();
... ... @@ -331,23 +335,35 @@ public class SmartControlService extends BaseService implements EventListener<St
331 335 intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
332 336 startActivity(intent);
333 337 roomStatusInfo = null;
334   -// if (roomStatusInfo != null && roomStatusInfo.getData() != null & roomInfo != null && roomInfo.getData() != null) {
335   -// if (System.currentTimeMillis() - lastRequest > 3000) {
336   -// lastRequest = System.currentTimeMillis();
337   -// countMsg = messageEvent.getMessage();
338   -// presenter.getCleanQrCode(roomStatusInfo.getData().getOrder_sn(), roomInfo.getData().getRoom_sn());
339   -// }
340   -// } else {
341   -// String msg = "roomStatusInfo is Null:" + (roomStatusInfo == null) +
342   -// ",roomInfo is Null:" + (roomInfo == null);
343   -// Log.d("room-info", msg);
344   -// Toast.makeText(this, msg, Toast.LENGTH_SHORT).show();
345   -// }
  338 + if (roomStatusInfo != null && roomStatusInfo.getData() != null & roomInfo != null && roomInfo.getData() != null) {
  339 + if (System.currentTimeMillis() - lastRequest > 3000) {
  340 + lastRequest = System.currentTimeMillis();
  341 + countMsg = messageEvent.getMessage();
  342 + presenter.getCleanQrCode(roomStatusInfo.getData().getOrder_sn(), roomInfo.getData().getRoom_sn());
  343 + }
  344 + } else {
  345 + String msg = "roomStatusInfo is Null:" + (roomStatusInfo == null) +
  346 + ",roomInfo is Null:" + (roomInfo == null);
  347 + Log.d("room-info", msg);
  348 + Toast.makeText(this, msg, Toast.LENGTH_SHORT).show();
  349 + }
346 350 break;
347 351 case ORDER_PLAY_COMPLETE:
  352 + if (roomStatusInfo != null && roomStatusInfo.getData() != null & roomInfo != null && roomInfo.getData() != null) {
  353 + if (System.currentTimeMillis() - lastRequest > 3000) {
  354 + lastRequest = System.currentTimeMillis();
  355 + countMsg = messageEvent.getMessage();
  356 + presenter.getCleanQrCode(roomStatusInfo.getData().getOrder_sn(), roomInfo.getData().getRoom_sn());
  357 + }
  358 + } else {
  359 + String msg = "roomStatusInfo is Null:" + (roomStatusInfo == null) +
  360 + ",roomInfo is Null:" + (roomInfo == null);
  361 + Log.i("room-info", msg);
  362 + Toast.makeText(this, msg, Toast.LENGTH_SHORT).show();
  363 + }
348 364 LogUtils.i("room-info", messageEvent.getMessage());
349 365 Utils.saveString(this, "oder-play-completed", new Gson().toJson(roomStatusInfo));
350   - playEndAds();
  366 +// playEndAds();
351 367 break;
352 368 default:
353 369 Log.d("room-info", messageEvent.getMessage());
... ... @@ -597,20 +613,23 @@ public class SmartControlService extends BaseService implements EventListener<St
597 613 if (!TextUtils.isEmpty(data.getFilm_hash())) {
598 614 localMovieMessages = new NewDBManager(this).queryPlayMovie(data.getFilm_hash());
599 615 if (localMovieMessages == null) {
600   - show("电影信息出错,找不到相关电影");
601 616 LogUtils.e("room-info", "file not exists:" + orderInfo.toString());
602   - if (offset > 3) {
603   - CToast.makeText(this, "您已迟到" + offset + "分钟,请注意把握时间,没有找到电影信息,请联系客服", 90 * 1000).show();
604   - } else {
605   - CToast.makeText(this, "没有找到电影信息,请联系客服", 90 * 1000).show();
606   - }
  617 + CToast.makeText(this, "没有找到电影信息,请联系客服", 90 * 1000).show();
607 618 }
608 619 }
609 620 if (localMovieMessages != null) {
610   - if (offset > 3) {
611   - CToast.makeText(this, "您已迟到" + offset + "分钟,请注意把握时间", 100 * 1000).show();
612   - }
613 621 LogUtils.i("room-info", "play movie" + localMovieMessages.toString());
  622 + String showMsg;
  623 + if (offset > 0) {
  624 + showMsg = String.format(ResUtils.getResResult(mContext,
  625 + R.string.welcome, R.string.ads_promote,
  626 + R.string.delay_time_fill_time,
  627 + R.string.play_movie_fill_name),
  628 + offset, roomStatusInfo.getData().getFilm_name());
  629 + } else {
  630 + showMsg = String.format(ResUtils.getResResult(mContext, R.string.welcome, R.string.ads_promote, R.string.play_movie_fill_name), roomStatusInfo.getData().getFilm_name());
  631 + }
  632 + CToast.makeText(this, showMsg, 100 * 1000).show();
614 633 OpenMMUtils.openMMWithAds(this, localMovieMessages.getPlayPath(), null);
615 634 } else {
616 635 LogUtils.e("room-info", "file not exists:" + orderInfo.toString());
... ... @@ -621,15 +640,24 @@ public class SmartControlService extends BaseService implements EventListener<St
621 640 @Override
622 641 public void prepareRoomQrCodeInfo(RoomQrCodeInfo qrCodeInfo) {
623 642 this.info = qrCodeInfo;
624   - Intent intent = new Intent(this, QrCodeShowActivity.class)
625   - .putExtra("qr", info.getData().getCode())
626   - .putExtra("room_sn", roomInfo.getData().getRoom_sn())
627   - .putExtra("order_sn", roomStatusInfo.getData().getOrder_sn());
628   - if ("count_service".equals(countMsg)) {
629   - intent.putExtra("count_call", true);
  643 + if (info != null && info.getData() != null && TextUtils.isEmpty(info.getData().getRoom_sn())) {
  644 + LogUtils.i(TAG, "order_sn is null,play end ads");
  645 + playEndAds();
  646 +// Intent intent = new Intent(this, QrCodeShowActivity.class)
  647 +// .putExtra("qr", info.getData().getCode())
  648 +// .putExtra("room_sn", roomInfo.getData().getRoom_sn())
  649 +// .putExtra("order_sn", roomStatusInfo.getData().getOrder_sn());
  650 +// if ("count_service".equals(countMsg)) {
  651 +// intent.putExtra("count_call", true);
  652 +// }
  653 +// intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
  654 +// startActivity(intent);
  655 + } else {
  656 + LogUtils.i(TAG, "order_sn not null:" + qrCodeInfo.toString());
  657 + String showMsg = ResUtils.getResResult(mContext, R.string.ads_promote, R.string.play_next_fill_name);
  658 + CToast.makeText(mContext, showMsg, 30 * 1000).show();
  659 + presenter.getNextOrderInfo(SmartControlService.this, info.getData().getRoom_sn());
630 660 }
631   - intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
632   - startActivity(intent);
633 661 }
634 662
635 663 @Override
... ... @@ -656,6 +684,10 @@ public class SmartControlService extends BaseService implements EventListener<St
656 684 return;
657 685 }
658 686 if (roomStatusInfo != null && roomStatusInfo.getData() != null && roomInfo != null && roomInfo.getData() != null) {
  687 + if (Constant.count > 30) {
  688 + String showMsg = ResUtils.getResResult(mContext, R.string.ads_promote, R.string.end_ads);
  689 + CToast.makeText(mContext, showMsg, 30 * 1000).show();
  690 + }
659 691 Intent intentAds = new Intent(this.getApplicationContext(), SimpleAdsPlayer2.class);
660 692 intentAds.putExtra("ads_path", adsVideoPath);
661 693 intentAds
... ...
... ... @@ -228,7 +228,6 @@ public class SocketService1 extends BaseService {
228 228 LogUtils.i(TAG, "send msg:" + msg);
229 229 } else {
230 230 if (heartBeatErrorCount.getAndIncrement() > 3) {
231   -// if (heartBeatErrorCount.getAndDecrement() >= 0) {
232 231 LogUtils.i(TAG, "heartBeatErrorCount:" + heartBeatErrorCount.get());
233 232 clearConnect();
234 233 return false;
... ...
... ... @@ -10,6 +10,8 @@ public interface IRoomInfoModel {
10 10
11 11 void getRoomStatus(String roomSn, RoomInfoModelImpl.GetRoomStatusListener listener);
12 12
  13 + void getRoomNestOrderInfo(String orderSn, RoomInfoModelImpl.GetRoomStatusListener listener);
  14 +
13 15 void getRoomQrCode(String orderSn, String roomSn, RoomInfoModelImpl.GetRoomQrCodeListener listener);
14 16
15 17 void reportOpenDoorStatus(String orderSn, RoomInfoModelImpl.OpenDoorStatusListener listener);
... ...
... ... @@ -2,11 +2,11 @@ package com.xgimi.gimicinema.model;
2 2
3 3 import android.content.Context;
4 4 import android.text.TextUtils;
5   -import android.util.Log;
6 5 import com.gimi.common.cinema.model.RoomInfo;
7 6 import com.gimi.common.cinema.model.RoomQrCodeInfo;
8 7 import com.gimi.common.cinema.model.RoomStatusInfo;
9 8 import com.gimi.common.cinema.model.WrongMsg;
  9 +import com.gimi.common.cinema.utils.LogUtils;
10 10 import com.gimi.common.cinema.utils.OkHttpClientManager;
11 11 import com.gimi.common.cinema.utils.Utils;
12 12 import com.google.gson.Gson;
... ... @@ -31,6 +31,7 @@ public class RoomInfoModelImpl implements IRoomInfoModel {
31 31 private static String ROOM_QRCODE_BY_ORDER_SN = roomUrl + "tcp/getEndQRCode?order_sn=";
32 32 private static String ROOM_REPORT_ROOM_STATUS = roomUrl + "tcp/reportRoomStatus?order_sn=";
33 33 private static String ROOM_REPORT_SLEEP_STATUS = roomUrl + "tcp/recvSleepCmdTimeout?order_sn=";
  34 + private static String ROOM_NEXT_STATUS_BY_ROOM_SN = roomUrl + "tcp/getRoomStatusByOrderSN?order_sn=";
34 35
35 36 public RoomInfoModelImpl() {
36 37 Context applicationContext = FangTangApplication.getInstance().getApplicationContext();
... ... @@ -51,6 +52,7 @@ public class RoomInfoModelImpl implements IRoomInfoModel {
51 52 ROOM_QRCODE_BY_ORDER_SN = roomUrl + "tcp/getEndQRCode?order_sn=";
52 53 ROOM_REPORT_ROOM_STATUS = roomUrl + "tcp/reportRoomStatus?order_sn=";
53 54 ROOM_REPORT_SLEEP_STATUS = roomUrl + "tcp/recvSleepCmdTimeout?order_sn=";
  55 + ROOM_NEXT_STATUS_BY_ROOM_SN = roomUrl + "tcp/getRoomStatusByOrderSN?order_sn=";
54 56 }
55 57
56 58 @Override
... ... @@ -67,7 +69,7 @@ public class RoomInfoModelImpl implements IRoomInfoModel {
67 69 }
68 70 }
69 71
70   - Log.d("room-info", "request:getRoomInfo,url = " + ROOM_INFO_BY_IMEI_URL + imei);
  72 + LogUtils.i("room-info", "request:getRoomInfo,url = " + ROOM_INFO_BY_IMEI_URL + imei);
71 73 OkHttpClientManager.getAsyn(ROOM_INFO_BY_IMEI_URL + imei,
72 74 new OkHttpClientManager.ResultCallback<String>() {
73 75 @Override
... ... @@ -80,7 +82,7 @@ public class RoomInfoModelImpl implements IRoomInfoModel {
80 82 @Override
81 83 public void onResponse(String response) {
82 84 RoomInfo roomInfo1 = null;
83   - Log.d("room-info", "getRoomInfo" + response);
  85 + LogUtils.i("room-info", "getRoomInfo" + response);
84 86 try {
85 87 roomInfo1 = new Gson().fromJson(response, RoomInfo.class);
86 88 } catch (JsonSyntaxException e) {
... ... @@ -105,12 +107,10 @@ public class RoomInfoModelImpl implements IRoomInfoModel {
105 107 @Override
106 108 public void doSomeThing() {
107 109 long time = -1;
108   - Log.d("room-info", "request:getRoomInfo,url = " + ROOM_INFO_BY_IMEI_URL + imei);
  110 + LogUtils.i("room-info", "request:getRoomInfo,url = " + ROOM_INFO_BY_IMEI_URL + imei);
109 111 try {
110 112 time = OkHttpClientManager.getSysTime(ROOM_INFO_BY_IMEI_URL + imei);
111   - } catch (IOException e) {
112   - e.printStackTrace();
113   - } catch (ParseException e) {
  113 + } catch (IOException | ParseException e) {
114 114 e.printStackTrace();
115 115 }
116 116 if (time != -1) {
... ... @@ -120,13 +120,11 @@ public class RoomInfoModelImpl implements IRoomInfoModel {
120 120 }
121 121 }
122 122 });
123   -
124   -
125 123 }
126 124
127 125 @Override
128 126 public void getRoomStatus(String roomSn, final GetRoomStatusListener listener) {
129   - Log.d("room-info", "request:getRoomStatus,url = " + ROOM_STATUS_BY_ROOM_SN_URL + roomSn);
  127 + LogUtils.i("room-info", "request:getRoomStatus,url = " + ROOM_STATUS_BY_ROOM_SN_URL + roomSn);
130 128 OkHttpClientManager.getAsyn(ROOM_STATUS_BY_ROOM_SN_URL + roomSn,
131 129 new OkHttpClientManager.ResultCallback<String>() {
132 130 @Override
... ... @@ -139,8 +137,41 @@ public class RoomInfoModelImpl implements IRoomInfoModel {
139 137 @Override
140 138 public void onResponse(String response) {
141 139 RoomStatusInfo roomInfo1 = null;
142   - Log.d("room-info", "getRoomStatus" + response);
  140 + LogUtils.i("room-info", "getRoomStatus" + response);
  141 +
  142 + try {
  143 + roomInfo1 = new Gson().fromJson(response, RoomStatusInfo.class);
  144 + } catch (JsonSyntaxException e) {
  145 + e.printStackTrace();
  146 + }
  147 + if (roomInfo1 != null) {
  148 + listener.onGetRoomStatusSuccess(roomInfo1);
  149 + } else {
  150 + WrongMsg wrongMsg = new WrongMsg();
  151 + wrongMsg.setMsg(response);
  152 + listener.onGetRoomStatusFailure(wrongMsg);
  153 + }
  154 + }
  155 + });
  156 + }
  157 +
  158 +
  159 + @Override
  160 + public void getRoomNestOrderInfo(String orderSn, final GetRoomStatusListener listener) {
  161 + LogUtils.i("room-info", ROOM_NEXT_STATUS_BY_ROOM_SN + orderSn);
  162 + OkHttpClientManager.getAsyn(ROOM_NEXT_STATUS_BY_ROOM_SN + orderSn,
  163 + new OkHttpClientManager.ResultCallback<String>() {
  164 + @Override
  165 + public void onError(Request request, Exception e) {
  166 + WrongMsg wrongMsg = new WrongMsg();
  167 + wrongMsg.setMsg(e.getMessage());
  168 + listener.onGetRoomStatusFailure(wrongMsg);
  169 + }
143 170
  171 + @Override
  172 + public void onResponse(String response) {
  173 + RoomStatusInfo roomInfo1 = null;
  174 + LogUtils.i("room-info", "getRoomStatus" + response);
144 175 try {
145 176 roomInfo1 = new Gson().fromJson(response, RoomStatusInfo.class);
146 177 } catch (JsonSyntaxException e) {
... ... @@ -159,7 +190,7 @@ public class RoomInfoModelImpl implements IRoomInfoModel {
159 190
160 191 @Override
161 192 public void getRoomQrCode(String orderSn, String roomSn, final GetRoomQrCodeListener listener) {
162   - Log.d("room-info", "request:getRoomQrCode,url = " + ROOM_QRCODE_BY_ORDER_SN + orderSn + "&room_sn=" + roomSn);
  193 + LogUtils.i("room-info", "request:getRoomQrCode,url = " + ROOM_QRCODE_BY_ORDER_SN + orderSn + "&room_sn=" + roomSn);
163 194 OkHttpClientManager.getAsyn(ROOM_QRCODE_BY_ORDER_SN + orderSn + "&room_sn=" + roomSn,
164 195 new OkHttpClientManager.ResultCallback<String>() {
165 196 @Override
... ... @@ -171,7 +202,7 @@ public class RoomInfoModelImpl implements IRoomInfoModel {
171 202
172 203 @Override
173 204 public void onResponse(String response) {
174   - Log.d("room-info", "getRoomQrCode:" + response);
  205 + LogUtils.i("room-info", "getRoomQrCode:" + response);
175 206
176 207 RoomQrCodeInfo roomInfo1 = null;
177 208 try {
... ... @@ -193,18 +224,18 @@ public class RoomInfoModelImpl implements IRoomInfoModel {
193 224
194 225 @Override
195 226 public void reportOpenDoorStatus(String orderSn, final OpenDoorStatusListener listener) {
196   - Log.d("room-info", "request:reportOpenDoorStatus,url = " + ROOM_REPORT_ROOM_STATUS + orderSn);
  227 + LogUtils.i("room-info", "request:reportOpenDoorStatus,url = " + ROOM_REPORT_ROOM_STATUS + orderSn);
197 228 OkHttpClientManager.getAsyn(ROOM_REPORT_ROOM_STATUS + orderSn,
198 229 new OkHttpClientManager.ResultCallback<String>() {
199 230 @Override
200 231 public void onError(Request request, Exception e) {
201   - Log.d("room-info", request.toString() + "," + e.getMessage());
  232 + LogUtils.i("room-info", request.toString() + "," + e.getMessage());
202 233 listener.onOpenDoorFailure();
203 234 }
204 235
205 236 @Override
206 237 public void onResponse(String response) {
207   - Log.d("room-info", "reportOpenDoorStatus:" + response);
  238 + LogUtils.i("room-info", "reportOpenDoorStatus:" + response);
208 239 listener.onOpenDoorSuccess();
209 240 }
210 241 });
... ... @@ -212,18 +243,18 @@ public class RoomInfoModelImpl implements IRoomInfoModel {
212 243
213 244 @Override
214 245 public void reportSleepSysStatus(String orderSn, String roomSn, final SleepSysStatusListener listener) {
215   - Log.d("room-info", "request:reportSleepSysStatus,url = " + ROOM_QRCODE_BY_ORDER_SN + orderSn);
  246 + LogUtils.i("room-info", "request:reportSleepSysStatus,url = " + ROOM_QRCODE_BY_ORDER_SN + orderSn);
216 247 OkHttpClientManager.getAsyn(ROOM_REPORT_SLEEP_STATUS + orderSn + "&room_sn=" + roomSn,
217 248 new OkHttpClientManager.ResultCallback<String>() {
218 249 @Override
219 250 public void onError(Request request, Exception e) {
220   - Log.d("room-info", request.toString() + "," + e.getMessage());
  251 + LogUtils.i("room-info", request.toString() + "," + e.getMessage());
221 252 listener.onSleepSuccess();
222 253 }
223 254
224 255 @Override
225 256 public void onResponse(String response) {
226   - Log.d("room-info", "reportSleepSysStatus:" + response);
  257 + LogUtils.i("room-info", "reportSleepSysStatus:" + response);
227 258 listener.onSleepFailure();
228 259 }
229 260 });
... ...
... ... @@ -19,10 +19,15 @@ package com.xgimi.gimicinema.service;
19 19 import android.app.Service;
20 20 import android.content.Intent;
21 21 import android.os.IBinder;
  22 +import android.text.TextUtils;
22 23 import android.util.Log;
23 24 import com.gimi.common.cinema.model.Constant;
24 25 import com.gimi.common.cinema.model.MessageEvent;
  26 +import com.gimi.common.cinema.utils.CToast;
25 27 import com.gimi.common.cinema.utils.LogUtils;
  28 +import com.gimi.common.cinema.utils.ResUtils;
  29 +import com.xgimi.gimicinema.R;
  30 +import com.xgimi.gimicinema.application.FangTangApplication;
26 31 import org.greenrobot.eventbus.EventBus;
27 32
28 33 import static com.gimi.common.cinema.model.Constant.count;
... ... @@ -45,6 +50,16 @@ public class CountService extends Service {
45 50 LogUtils.d(TAG, "count is :" + count);
46 51 if (Constant.count > 0) {
47 52 Log.d(TAG, "if");
  53 + if (Constant.count == 5) {
  54 + String showMsg = ResUtils.getResResult(this, R.string.ads_promote, R.string.welcome_again);
  55 + CToast.makeText(this, showMsg, 30 * 1000).show();
  56 + }
  57 + if (Constant.count == 10) {
  58 + if (!TextUtils.isEmpty(((FangTangApplication) getApplicationContext()).getCurrentPlayUrl())) {
  59 + String showMsg = ResUtils.getResResult(this, R.string.ads_promote, R.string.time_ends_ten_min);
  60 + CToast.makeText(this, showMsg, 30 * 1000).show();
  61 + }
  62 + }
48 63 new CountDownThread().start();
49 64 } else {
50 65 Log.d(TAG, "else");
... ...
... ... @@ -106,11 +106,13 @@
106 106 <string name="pre_ads_times">映前广告次数</string>
107 107 <string name="set_sm_light">设置智能灯光</string>
108 108
  109 + <string name="welcome">欢迎您的光临。</string>
109 110 <string name="ads_promote">青柠影咖,年轻人的奇幻乐园。</string>
110   - <string name="delay_time">您已迟到%d分钟,</string>
111   - <string name="play_movie">即将为你播放%s</string>
  111 + <string name="delay_time_fill_time">您已迟到%d分钟,</string>
  112 + <string name="play_movie_fill_name">即将为你播放%s</string>
112 113 <string name="end_ads">本场电影已结束,请观看《青柠电影先锋》</string>
113 114 <string name="welcome_again">离场时请携带好随身物品,欢迎下次光临。</string>
114   - <string name="play_next">本场电影已结束,将于广告后为您播放下一部影片%s</string>
  115 + <string name="play_next_fill_name">本场电影已结束,即将为您播放下一部影片</string>
  116 + <string name="time_ends_ten_min">距观景时间结束还有10分钟。</string>
115 117
116 118 </resources>
... ...
Please register or login to post a comment