eason.qian 7 years ago
parent 573ae86bff
commit c983035613

@ -105,4 +105,6 @@ public interface RetailAppService {
JSONObject getCouponById(JSONObject device, String coupon_log_id); JSONObject getCouponById(JSONObject device, String coupon_log_id);
void useCoupon(JSONObject device, String coupon_log_id); void useCoupon(JSONObject device, String coupon_log_id);
JSONObject getAd(JSONObject device);
} }

@ -43,6 +43,7 @@ import com.github.miemiedev.mybatis.paginator.domain.PageBounds;
import com.github.miemiedev.mybatis.paginator.domain.PageList; import com.github.miemiedev.mybatis.paginator.domain.PageList;
import com.notnoop.apns.APNS; import com.notnoop.apns.APNS;
import com.notnoop.apns.ApnsService; import com.notnoop.apns.ApnsService;
import org.apache.commons.lang3.RandomUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.time.DateFormatUtils; import org.apache.commons.lang3.time.DateFormatUtils;
import org.apache.commons.lang3.time.DateUtils; import org.apache.commons.lang3.time.DateUtils;
@ -1168,6 +1169,16 @@ public class RetailAppServiceImp implements RetailAppService {
couponVerificationService.useCoupon(coupon_log_id); couponVerificationService.useCoupon(coupon_log_id);
} }
@Override
public JSONObject getAd(JSONObject device) {
String clientType = device.getString("client_type");
deviceSupport.findRegister(clientType);
JSONObject res = royalPayCMSSupport.listArticles("app_ad", false, true, 1, 10);
JSONArray acts = res.getJSONArray("data");
int selectNo = RandomUtils.nextInt(0,acts.size());
return acts.getJSONObject(selectNo);
}
private static boolean mathchLetterorNum(String str) { private static boolean mathchLetterorNum(String str) {
String regex = "[A-Za-z0-9]{8}"; String regex = "[A-Za-z0-9]{8}";
return str.matches(regex); return str.matches(regex);

@ -264,4 +264,12 @@ public class RetailAppController {
} }
/*优惠券End*/ /*优惠券End*/
/**
* 广
*/
@RequestMapping(value = "/ads", method = RequestMethod.GET)
public JSONObject getActivities(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device) {
return retailAppService.getAd(device);
}
} }

@ -20,20 +20,24 @@
<label class="col-md-2 control-label" for="kw-input">HTML Keywords</label> <label class="col-md-2 control-label" for="kw-input">HTML Keywords</label>
<div class="col-md-10"> <div class="col-md-10">
<input ng-model="article.page_keywords" type="text" name="title" id="kw-input" class="form-control"> <input ng-model="article.page_keywords" type="text" name="title" id="kw-input" class="form-control">
<p ng-if="catId=='app_ad'"class="small text-warning">(0不允许跳转 1允许跳转)</p>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label ng-if="catId!='app_activity'" class="col-md-2 control-label" for="desc-input">HTML Description</label> <label ng-if="catId!='app_activity' and catId!='app_ad" class="col-md-2 control-label" for="desc-input">HTML Description</label>
<label ng-if="catId=='app_activity'" class="col-md-2 control-label" for="desc-input">HomePage AD</label> <label ng-if="catId=='app_activity'" class="col-md-2 control-label" for="desc-input">HomePage AD</label>
<label ng-if="catId=='app_ad'" class="col-md-2 control-label" for="desc-input">App Launch AD</label>
<div class="col-md-10"> <div class="col-md-10">
<textarea ng-model="article.page_desc" name="desc" id="desc-input" class="form-control"></textarea> <textarea ng-model="article.page_desc" name="desc" id="desc-input" class="form-control"></textarea>
<p ng-if="catId=='app_activity'"class="small text-warning">(需要展示在首页时填写反之请输0)</p> <p ng-if="catId=='app_activity'"class="small text-warning">(需要展示在首页时填写反之请输0)</p>
<p ng-if="catId=='app_ad'"class="small text-warning">(图片尽量要小控制在500k以内否则会影响APP页面加载速度)</p>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-md-2 control-label" for="summery-input">Summary</label> <label class="col-md-2 control-label" for="summery-input">Summary</label>
<div class="col-md-10"> <div class="col-md-10">
<textarea id="summery-input" ng-model="article.summery" name="summery" class="form-control"></textarea> <textarea id="summery-input" ng-model="article.summery" name="summery" class="form-control"></textarea>
<p ng-if="catId=='app_ad'"class="small text-warning">(若有外链则填否则留空。在Content为空的时若有外链则点击图片进行跳转)</p>
</div> </div>
</div> </div>

@ -23,6 +23,9 @@
<div class="btn-group"> <div class="btn-group">
<a class="btn btn-default" ui-sref=".category({catId:'app_activity'})">App活动页</a> <a class="btn btn-default" ui-sref=".category({catId:'app_activity'})">App活动页</a>
</div> </div>
<div class="btn-group">
<a class="btn btn-default" ui-sref=".category({catId:'app_ad'})">App广告页</a>
</div>
</div> </div>
</div> </div>
</section> </section>

Loading…
Cancel
Save