Merge remote-tracking branch 'origin/develop' into develop

master
yangkai 6 years ago
commit fa225a873b

@ -120,9 +120,9 @@ public interface RetailAppService {
void useCoupon(JSONObject device, String coupon_log_id);
JSONObject getAd(JSONObject device);
JSONObject getAd();
JSONObject getAdDetail(JSONObject device, String article_id);
JSONObject getAdDetail(String article_id);
JSONObject getCheckClientInfo(JSONObject device);
@ -163,4 +163,6 @@ public interface RetailAppService {
JSONObject getCouponCusCouponLog(String client_moniker, AppQueryBean appQueryBean);
void saveCouponAccuessLog(int client_id, String coupon_id);
JSONObject getStyle();
}

@ -498,6 +498,11 @@ public class RetailAppServiceImp implements RetailAppService {
couponAccuessLogMapper.save(couponAccuessLog);
}
@Override
public JSONObject getStyle() {
return royalPayCMSSupport.getStyle();
}
@Override
public void updateClient(JSONObject device, AppClientBean appClientBean) {
String clientType = device.getString("client_type");
@ -1765,23 +1770,44 @@ public class RetailAppServiceImp implements RetailAppService {
}
@Override
public JSONObject getAd(JSONObject device) {
String clientType = device.getString("client_type");
deviceSupport.findRegister(clientType);
public JSONObject getAd() {
JSONObject res = royalPayCMSSupport.listArticles("app_ad", false, true, 1, 10);
JSONArray acts = res.getJSONArray("data");
if (acts.size() > 0) {
int selectNo = RandomUtils.nextInt(0, acts.size());
return acts.getJSONObject(selectNo);
JSONObject getActs = acts.getJSONObject(selectNo);
getActs.put("ad_cover", getActs.getString("page_desc"));
getActs.put("ad_mode", getActs.getString("page_keywords"));
getActs.put("ad_link", getActs.getString("summery"));
getActs.put("publish_date", DateFormatUtils.format(getActs.getDate("publish_time"),"yyyy/MM/dd HH:mm:ss"));
String reference = getActs.getString("reference");
JSONObject referenceObj = JSONObject.parseObject(reference);
if (reference != null) {
if (referenceObj.getString("ad_type") != null) {
getActs.put("ad_type", referenceObj.getString("ad_type"));
}
if (referenceObj.getString("expire_date") != null) {
getActs.put("expire_date", referenceObj.getString("expire_date"));
}
if (referenceObj.getString("duration_time") != null) {
getActs.put("duration_time", referenceObj.getString("duration_time"));
}
}else {
getActs.put("message", "mess : (ad_type && expire_date && duration_time) not set");
}
getActs.remove("reference");
getActs.remove("page_desc");
getActs.remove("page_keywords");
getActs.remove("summery");
getActs.remove("publish_time");
return getActs;
}
return null;
}
@Override
public JSONObject getAdDetail(JSONObject device, String article_id) {
String clientType = device.getString("client_type");
deviceSupport.findRegister(clientType);
public JSONObject getAdDetail(String article_id) {
JSONObject res = royalPayCMSSupport.getArticle("app_ad", article_id);
Document doc = Jsoup.parse(res.getString("content"));
String father = "<div style=\"padding:0 10px\"></div>";

@ -395,19 +395,6 @@ public class RetailAppController {
}
/* 优惠券End */
/**
* 广
*/
@RequestMapping(value = "/ads", method = RequestMethod.GET)
public JSONObject getAd(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device) {
return retailAppService.getAd(device);
}
@RequestMapping(value = "/ads/{article_id}", method = RequestMethod.GET)
public JSONObject getAdDetail(@PathVariable String article_id, @ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device) {
return retailAppService.getAdDetail(device, article_id);
}
@RequestMapping(value = "/bills/{bill_id}", method = RequestMethod.GET)
public JSONObject getBill(@PathVariable("bill_id") String bill_id, @ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device) {
return billService.getBillDetail(bill_id, device.getIntValue("client_id"));
@ -574,4 +561,9 @@ public class RetailAppController {
retailAppService.saveCouponAccuessLog(client_id, coupon_id);
}
@RequestMapping(value = "/style", method = RequestMethod.GET)
public JSONObject getStyle() {
return retailAppService.getStyle();
}
}

@ -1,7 +1,9 @@
package au.com.royalpay.payment.manage.appclient.web;
import au.com.royalpay.payment.manage.appclient.beans.RetailLoginInfo;
import au.com.royalpay.payment.manage.appclient.core.RetailAppService;
import au.com.royalpay.payment.manage.signin.core.SignInStatusManager;
import au.com.royalpay.payment.tools.CommonConsts;
import au.com.royalpay.payment.tools.device.DeviceSupport;
import au.com.royalpay.payment.tools.exceptions.BadRequestException;
import au.com.royalpay.payment.tools.http.HttpUtils;
@ -32,6 +34,8 @@ public class RetailValidationController {
private SignInStatusManager signInStatusManager;
@Resource
private DeviceSupport deviceSupport;
@Resource
private RetailAppService retailAppService;
@RequestMapping(value = "/devices/{devType}/register", method = RequestMethod.POST)
public JSONObject register(@RequestBody String registeration, @PathVariable String devType) {
@ -91,4 +95,17 @@ public class RetailValidationController {
}
return res;
}
/**
* 广
*/
@RequestMapping(value = "/ads", method = RequestMethod.GET)
public JSONObject getAd() {
return retailAppService.getAd();
}
@RequestMapping(value = "/ads/{article_id}", method = RequestMethod.GET)
public JSONObject getAdDetail(@PathVariable String article_id) {
return retailAppService.getAdDetail( article_id);
}
}

@ -34,11 +34,11 @@ public interface RiskAttentionMerchantsMapper {
PageList<JSONObject> query(JSONObject params, PageBounds pagination);
@Select("SELECT client_moniker FROM risk_attention_merchants " +
"WHERE (abn LIKE CONCAT('%',#{abn},'%') ) OR (acn LIKE CONCAT('%',#{acn},'%') ) " +
" OR (contact_phone LIKE CONCAT('%',#{contact_phone},'%') ) " +
" OR (contact_person LIKE CONCAT('%',#{contact_person},'%') ) " +
" OR (client_moniker LIKE CONCAT('%',#{client_moniker},'%') ) " +
" OR (bank_account_no LIKE CONCAT('%',#{bank_account_no},'%') ) AND is_valid=1")
"WHERE (abn = #{abn} ) OR (acn = #{acn} ) " +
" OR (contact_phone = #{contact_phone} ) " +
" OR (contact_person = #{contact_person} ) " +
" OR (client_moniker = #{client_moniker} ) " +
" OR (bank_account_no = #{bank_account_no} ) AND is_valid=1")
List<JSONObject> listRiskySimilarMerchants(JSONObject params);
}

@ -591,8 +591,8 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
if (clientMapper.findClientByMoniker(registery.getClientMoniker()) != null) {
throw new BadRequestException("error.partner.valid.dumplicate_client_moniker");
}
//检查商户是否进入系统黑名单
isRiskyMerchant(partner, null);
//2018-09-10,新建商户不检查是否在系统黑名单
//isRiskyMerchant(partner, null);
try {
@ -1184,6 +1184,11 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
clientModifySupport.processClientConfigModify(new SwitchPermissionModify(manager, clientMoniker, "enable_hf_email_notice", allow));
}
clientModifySupport.processClientConfigModify(new SwitchPermissionModify(manager, clientMoniker, "enable_" + channel.toLowerCase(), allow));
if (channel.equals("wechat") || channel.equals("alipay")) {
isRiskyMerchant(client,null);
}
logger.info(manager.getString("display_name") + "(" + manager.getString("manager_id") + ") switched client " + clientMoniker + " channel "
+ channel + " to " + allow);
return;

@ -6,7 +6,7 @@
from act_charity
left JOIN pmt_transactions on act_charity.client_id = pmt_transactions.client_id
and pmt_transactions.transaction_type='Credit' and pmt_transactions.transaction_time>=act_charity.active_time
and pmt_transactions.transaction_time&lt;'2018-09-01' and pmt_transactions.transaction_time>='2018-07-09'
and pmt_transactions.transaction_time&lt;'2018-10-31' and pmt_transactions.transaction_time>='2018-07-09'
and pmt_transactions.channel != 'Settlement'
GROUP BY act_charity.client_id order by count_ordernum desc
</select>
@ -14,7 +14,7 @@
select count(DISTINCT order_id) as count_ordernum,date_format(pmt_transactions.transaction_time,'%Y-%m-%d') as orderdate,client_moniker,ifnull(sum(pmt_transactions.clearing_amount),0) as sum_ordernum from act_charity inner JOIN pmt_transactions ON act_charity.client_id = pmt_transactions.client_id
and pmt_transactions.transaction_type='Credit' and pmt_transactions.transaction_time>=#{begin} and pmt_transactions.transaction_time&lt;=#{end} and pmt_transactions.transaction_time>=act_charity.active_time
and pmt_transactions.channel != 'Settlement'
and pmt_transactions.transaction_time&lt;'2018-09-01' and pmt_transactions.transaction_time>='2018-07-09'
and pmt_transactions.transaction_time&lt;'2018-10-31' and pmt_transactions.transaction_time>='2018-07-09'
group by date_format(pmt_transactions.transaction_time,'%Y-%m-%d')
</select>
@ -22,7 +22,7 @@
<select id="getChairtyWeekRaking" resultType="com.alibaba.fastjson.JSONObject">
select count(DISTINCT pmt_transactions.order_id) *0.01 as chair_ordernum,act_charity.client_moniker,ifnull(sum(pmt_transactions.clearing_amount),0) as sum_ordernum from act_charity left JOIN pmt_transactions ON act_charity.client_id = pmt_transactions.client_id
and pmt_transactions.transaction_type='Credit' and pmt_transactions.transaction_time&gt;=#{begin} and pmt_transactions.transaction_time&lt;=#{end} and pmt_transactions.transaction_time>=act_charity.active_time
and pmt_transactions.transaction_time&lt;'2018-09-01' and pmt_transactions.transaction_time>='2018-07-09'
and pmt_transactions.transaction_time&lt;'2018-10-31' and pmt_transactions.transaction_time>='2018-07-09'
GROUP BY act_charity.client_moniker order by chair_ordernum desc
</select>
</mapper>

@ -109,6 +109,7 @@ define(['angular', 'uiRouter', 'static/commons/angular-ueditor'], function (angu
app.controller('cmsAddArticleCtrl', ['$scope', '$http', '$state', '$stateParams', 'commonDialog', function ($scope, $http, $state, $stateParams, commonDialog) {
$scope.saveArticle = function () {
$scope.article.reference =$scope.reference;
$http.post('/app/cms/categories/' + $stateParams.catId + '/articles', $scope.article).then(function (resp) {
$state.go('^.article_view', {articleId: resp.data.article_id});
}, function (resp) {
@ -119,7 +120,14 @@ define(['angular', 'uiRouter', 'static/commons/angular-ueditor'], function (angu
app.controller('cmsArticleEditCtrl', ['$scope', '$http', '$state', '$stateParams', 'commonDialog', 'article', function ($scope, $http, $state, $stateParams, commonDialog, article) {
$scope.article = article.data;
if ($scope.article.reference) {
$scope.reference = JSON.parse($scope.article.reference);
}else {
$scope.reference = {};
}
$scope.saveArticle = function () {
$scope.article.reference =$scope.reference;
$http.put('/app/cms/categories/' + $stateParams.catId + '/articles/' + $stateParams.articleId, $scope.article).then(function (resp) {
$state.go('^.article_view', {articleId: $stateParams.articleId});
}, function (resp) {

@ -20,7 +20,7 @@
<label class="col-md-2 control-label" for="kw-input">HTML Keywords</label>
<div class="col-md-10">
<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跳转编辑内容 2跳转到外链)</p>
<p ng-if="catId=='app_ad'"class="small text-warning">(重要0不允许跳转 1跳转到外链)</p>
</div>
</div>
<div class="form-group">
@ -40,7 +40,27 @@
<p ng-if="catId=='app_ad'"class="small text-warning">(若有外链,则填,否则留空)</p>
</div>
</div>
<div class="form-group">
<label class="col-md-2 control-label" for="kw-input">Type</label>
<div class="col-md-10">
<input ng-model="reference.ad_type" type="text" name="title" id="type-input" class="form-control">
<p ng-if="catId=='app_ad'"class="small text-warning">(广告封面 type=0时 为图片地址 type=1时 为视频地址)</p>
</div>
</div>
<div class="form-group">
<label class="col-md-2 control-label" for="kw-input">Mode</label>
<div class="col-md-10">
<input ng-model="reference.expire_date" type="text" name="title" id="expire_date-input" class="form-control">
<p ng-if="catId=='app_ad'"class="small text-warning">(广告过期时间 格式为: 2018/10/01 00:00:00)</p>
</div>
</div>
<div class="form-group">
<label class="col-md-2 control-label" for="kw-input">Duration time</label>
<div class="col-md-10">
<input ng-model="reference.duration_time" type="text" name="title" id="duration_time-input" class="form-control">
<p ng-if="catId=='app_ad'"class="small text-warning">(广告展示时间(s))</p>
</div>
</div>
</form>
<div class="form-group">
<label class="control-label">Content</label>

@ -31,7 +31,7 @@
<th>Title</th>
<th>Add Time</th>
<th>Published</th>
<th>Recommended</th>
<!-- <th>Recommended</th>-->
<th>Operation</th>
</tr>
</thead>
@ -44,11 +44,11 @@
<i class="fa" ng-class="{'fa-check text-success':article.publish_status,'fa-remove text-danger':!article.publish_status}"></i>
</a>
</td>
<td>
<!-- <td>
<a role="button" ng-click="toggleArticleRecommended(article)" title="Toggle recommended">
<i class="fa" ng-class="{'fa-check text-success':article.recommended,'fa-remove text-danger':!article.recommended}"></i>
</a>
</td>
</td>-->
<td>
<a ui-sref=".edit_article({articleId:article.article_id})" title="edit"><i class="fa fa-edit"></i></a>
<a ui-sref=".article_view({articleId:article.article_id})" title="preview"><i class="fa fa-eye"></i></a>

Binary file not shown.

After

Width:  |  Height:  |  Size: 71 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 210 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 83 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 621 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 636 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 347 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 621 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 718 KiB

@ -0,0 +1,391 @@
/**
* Created by yixian on 2017-05-08
*/
$(function () {
'use strict';
var dataCache = {price: '0', coupons: [], coupon_groups:{}};
var exchangeRate = parseFloat(window.exchange_rate);
dataCache.paying = false;
var ctrl = {};
$('.weui_grid.key').bind('touchstart', function () {
if (dataCache.paying) {
return;
}
var char = $(this).attr('data-char');
appendChar(char);
});
$('.coupons .use-check').click(function () {
if ($(this).hasClass('disabled')) {
return;
}
var couponId = $(this).attr('data-coupon-id');
var couponGroup = $(this).attr('data-coupon-group');
if (couponGroup) {
var prevCouponId = dataCache.coupon_groups[couponGroup];
if (prevCouponId) {
var prevIdx = dataCache.coupons.indexOf(prevCouponId);
if (prevIdx >= 0) {
dataCache.coupons.splice(prevIdx, 1);
}
if (prevCouponId!=couponId) {
$('.coupons .use-check[data-coupon-id="' + prevCouponId + '"]').removeClass('checked').addClass('unchecked');
dataCache.coupon_groups[couponGroup] = couponId;
}else {
dataCache.coupon_groups[couponGroup]= null;
}
}else {
dataCache.coupon_groups[couponGroup] = couponId;
}
}
if ($(this).is('.checked')) {
$(this).removeClass('checked').addClass('unchecked');
} else {
$(this).removeClass('unchecked').addClass('checked');
}
var checked = $(this).is('.checked');
if (checked) {
dataCache.coupons.push(couponId);
updatePrice();
} else {
var idx = dataCache.coupons.indexOf(couponId);
dataCache.coupons.splice(idx, 1);
updatePrice();
}
});
$('#key_B').bind('touchstart', function () {
backspace();
});
function updatePoundage(price) {
if (window.extensions.indexOf('customerrate') >= 0 && window.rateValue != null) {
if (window.use_customised_rate) {
var rate = new Decimal(100).plus(window.rateValue).div(100);
var poundageValue = new Decimal(dataCache.price).mul(rate).sub(dataCache.price);
} else {
var rateRemain = new Decimal(100).sub(window.rateValue).div(100);
poundageValue = new Decimal(dataCache.price).div(rateRemain).sub(dataCache.price);
}
dataCache.poundageValue = poundageValue.toFixed(2, Decimal.ROUND_HALF_UP);
return poundageValue.plus(price).toFixed(2, Decimal.ROUND_HALF_UP);
}
return price;
}
function updatePrice() {
$('#audVal').html(dataCache.price);
var realPrice = dataCache.price;
$('#audValReal').html(realPrice);
var surchargeData = calculateSurcharge(realPrice);
dataCache.tax = surchargeData.tax;
dataCache.surcharge = surchargeData.surcharge;
var price = surchargeData.newPrice || realPrice;
var priceBeforeDiscount = price;
dataCache.discounts = [];
$(window.coupons).each(function () {
price = this.handleDiscount(price, dataCache.price, dataCache.discounts, dataCache.coupons);
});
dataCache.customSurcharge = new Decimal(price).sub(realPrice).toFixed(2,Decimal.ROUND_HALF_UP);
dataCache.finalPrice = new Decimal(price).toFixed(2, Decimal.ROUND_FLOOR);
var rate = 'CNY' == window.currency ? 1 : exchangeRate;
var cnyVal = Decimal.mul(price, rate).toFixed(2, Decimal.ROUND_HALF_UP);
$('#cnyVal').html(cnyVal);
dataCache.currencyPrice = 'CNY' == window.currency ? Decimal.div(priceBeforeDiscount, exchangeRate).toFixed(2, Decimal.ROUND_FLOOR) : priceBeforeDiscount;
}
function updatePoundageStatus() {
$(window.coupons).each(function () {
var coupon = this;
var couponId = coupon.couponId();
if (coupon.isEnable(dataCache.currencyPrice||0)) {
$('.coupons .use-check[data-coupon-id=' + couponId + ']').removeClass('disabled');
} else {
var dom = $('.coupons .use-check[data-coupon-id=' + couponId + ']').addClass('disabled');
var couponGroup = dom.attr('data-coupon-group');
if (couponGroup) {
if (dataCache.coupon_groups[couponGroup] == couponId) {
dataCache.coupon_groups[couponGroup] = null;
}
}
var idx = dataCache.coupons.indexOf(couponId);
if (idx >= 0) {
dataCache.coupons.splice(idx, 1);
}
dom.removeClass('checked').addClass('unchecked');
}
})
}
updatePoundageStatus();
function backspace() {
dataCache.price = dataCache.price.substring(0, dataCache.price.length - 1);
if (dataCache.price.length == 0) {
dataCache.price = '0';
}
updatePrice();
updatePoundageStatus();
}
function appendChar(char) {
var pointLocation = dataCache.price.indexOf('.');
if (pointLocation >= 0 || char == '.' || dataCache.price.length < 5) {
if (pointLocation >= 0 && char == '.') {
return;
}
if (pointLocation >= 0 && pointLocation <= dataCache.price.length - 3) {
return;
}
if (dataCache.price == '0' && char != '.') {
dataCache.price = '';
}
dataCache.price += char;
updatePrice();
updatePoundageStatus();
}
}
$('#coupon-box-toggle').click(function () {
$('.coupons-container').addClass('show')
});
$('.coupons-container>.coupons-mask,.coupons-container #close-coupon-box').click(function () {
$(this).parents('.coupons-container').removeClass('show');
});
$('.remark-btn').click(function () {
var cfg = {
title: '备注 Remark',
template: '',
initialize: function (dialog) {
$('<textarea rows="2"></textarea>').addClass('remark-input').attr('name', 'remark').val(dataCache.remark || '').appendTo($('.weui_dialog_bd', dialog));
},
confirm: function (dialog, chosen) {
if (chosen) {
var remark = $('textarea[name="remark"]', dialog).val();
if (remark) {
$('#remark-box').text('备注:' + remark).show()
} else {
$('#remark-box').text('').hide();
}
dataCache.remark = remark;
}
}
};
showWeuiDialog(cfg);
});
$('.paydetail').click(function () {
var config = {
title: 'Payment Detail',
template: '',
initialize: function (dialog) {
var bd = $('.weui_dialog_bd', dialog);
var currencySymbol = window.currency == 'AUD' ? '$' : '¥';
$('<p></p>').html('Input Price 输入金额:' + currencySymbol + dataCache.price).appendTo(bd);
if (parseFloat(dataCache.customSurcharge) > 0) {
$('<p></p>').html('Surcharge 手续费(' + window.rateValue + '%):+' + currencySymbol + dataCache.customSurcharge).appendTo(bd);
}
$(dataCache.discounts).each(function () {
$('<p></p>').html(this.title + ':-' + currencySymbol + this.amount).appendTo(bd);
});
$('<p></p>').addClass('final').html('Final 支付金额:' + currencySymbol + (dataCache.finalPrice || 0)).appendTo(bd);
}
};
showWeuiDialog(config);
});
$('#key_P').bind('touchstart', function () {
pay();
// $('#key_P').addClass('hidden');
// $('#key_Loading').removeClass('hidden');
// if (dataCache.paying) {
// return;
// }
// dataCache.paying = true;
// var data = {price: dataCache.price + '', original_number: true, currency: window.currency};
// if (dataCache.remark) {
// data.description = dataCache.remark;
// }
// if (window.extensions.indexOf('preauthorize') >= 0) {
// data.preauthorize = true;
// }
// if (window.extensions.indexOf('qrcodemode') >= 0) {
// data.qrmode = true;
// }
// if (window.extensions.indexOf('customerrate') >= 0) {
// data.customerrate = true;
// }
// data.coupons = dataCache.coupons;
// dataCache.remark = '';
// data.account_id = User.getProduct();
// data.qrcodeVersion = window.qrcodeVersion;
// $.ajax({
// url: '/api/v1.0/bestpay/partners/' + window.client_moniker + '/app_order',
// method: 'POST',
// data: JSON.stringify(data),
// dataType: 'json',
// contentType: 'application/json',
// success: function (pay) {
// if (pay.direct_paid) {
// window.location = '/api/v1.0/bestpay/partners/' + window.client_moniker + '/orders/' + pay.order_id;
// return;
// }
// var paydata = pay.params;
// try {
// Payment.onPay(paydata, function () {
// window.location = '/api/v1.0/bestpay/partners/' + window.client_moniker + '/orders/' + pay.order_id;
// dataCache.paying = false;
// $('#key_P').removeClass('hidden');
// $('#key_Loading').addClass('hidden');
// }, function (rescode) {
// dataCache.paying = false;
// if (rescode === "cancel") {
// Dialog.alert("支付取消" + rescode)
// } else {
// Dialog.alert("支付失败" + rescode)
// }
// $('#key_P').removeClass('hidden');
// $('#key_Loading').addClass('hidden');
// })
// } catch (e) {
// Dialog.alert(e);
// dataCache.paying = false;
// $('#key_P').removeClass('hidden');
// $('#key_Loading').addClass('hidden');
// }
// Dialog.dismissDialog(dataCache.process);
// },
// error: function (jqXhr) {
// Dialog.alert(jqXhr.responseJSON.message);
// Dialog.dismissDialog(dataCache.process);
// dataCache.paying = false;
// $('#key_P').removeClass('hidden');
// $('#key_Loading').addClass('hidden');
// }
// });
});
function showWeuiDialog(config) {
if (config.templateUrl) {
$.ajax({
url: config.templateUrl,
dataType: 'html',
success: function (template) {
buildDialog(template);
}
});
} else {
buildDialog(config.template);
}
function buildDialog(template) {
var defaultConfig = {backdrop: true};
config = $.extend({}, defaultConfig, config);
var dialog = $("<div></div>", {class: 'weui_dialog_confirm'});
var mask = $('<div></div>', {class: 'weui_mask'}).appendTo(dialog);
if (config.backdrop) {
mask.click(function () {
dialog.remove();
if ($.isFunction(config.dismiss)) {
config.dismiss();
}
})
}
var dialogBox = $("<div></div>", {class: 'weui_dialog'}).appendTo(dialog);
if (config.title) {
$('<div></div>', {class: 'weui_dialog_hd'}).append($('<strong></strong>', {class: 'weui_dialog_title'}).html(config.title)).appendTo(dialogBox);
}
var dialogBody = $("<div></div>", {class: 'weui_dialog_bd'}).appendTo(dialogBox);
if (template) {
dialogBody.append(template);
}
if ($.isFunction(config.initialize)) {
config.initialize(dialog);
}
var ft = $('<div class="weui_dialog_ft"></div>').appendTo(dialogBox);
if ($.isFunction(config.confirm)) {
var yes = $('<a></a>', {class: 'weui_btn_dialog primary', text: 'OK'}).appendTo(ft);
yes.click(function () {
config.confirm(dialog, true);
dialog.remove();
});
var no = $('<a></a>', {class: 'weui_btn_dialog default', text: 'Cancel'}).appendTo(ft);
no.click(function () {
config.confirm(dialog, false);
dialog.remove();
})
} else {
var ok = $('<a></a>', {class: 'weui_btn_dialog primary', text: 'OK'}).appendTo(ft);
ok.click(function () {
dialog.remove();
})
}
dialog.appendTo($('body'));
}
}
function getUserId(){
alert(12);
window.RPayPlus.send("getUserId", null, function(data){
alert(data);
});
}
function pay(){
var order={
orderId:'00002',
amount:'$100.07',
title:'Gift card purchase'
};
window.RPayPlus.send('pay', order, function(data){
alert('this is callback from native and data='+JSON.stringify(data));
});
}
function back(){
window.RPayPlus.send("back", null, null);
}
function jsInvoke(){
window.RPayPlus.send("jsInvoke", 'Native Test', null);
}
function createOrder(msg){
alert('create order information='+JSON.stringify(msg));
}
function queryOrder(msg){
alert('query order information='+JSON.stringify(msg));
var order={
orderId:'00001',
amount:'$10.98',
title:'Balance Top-UP'
};
setTimeout("window.RPayPlus.onResult("+JSON.stringify(order)+");", 1500);
}
function registerJs(){
window.RPayPlus.register('createOrder', function(data){
createOrder(data);
});
window.RPayPlus.register('queryOrder', function(data){
queryOrder(data);
});
}
getUserId();
});

@ -0,0 +1,58 @@
$(function (){
var callbacks = {};
var functions = {};
window.RPayPlus = {
// 向Native端发送消息用于实现JS->Native
send: function(methodName, param, callback) {
alert(1);
var thisId = 0;
if(callback){
thisId = new Date().getTime();; // 获取唯一id
callbacks[thisId] = callback; // 存储Callback
}
var json = {
method: methodName,
data: param || {},
callbackId: thisId // 传到 Native 端
};
var msg = JSON.stringify(json);
var u = navigator.userAgent;
var isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/);
if(isiOS){
window.webkit.messageHandlers.rpayplus.postMessage(msg);
} else{
rpayplus.send(msg);
}
},
// 接收来自Native发送的消息用于实现Native->JS
receive: function(msg) {
var method = msg.methodName,
data = msg.data || {},
callbackId = msg.callbackId; // JS->Native的回调函数ID
// 具体逻辑 bridgeName 和 callbackId 不会同时存在;
// callbackId有效表示此接收信息源自JS->Native的回调
// callbackId无效且method有效表示是Native->JS的直接调用
if (callbackId && callbacks[callbackId]) {
callbacks[callbackId](msg.data); // 执行调用
return;
}
if (method && functions[method]) {
functions[method](msg);
}
},
// 注册JS方法供Native调用未被注册的方法Native无法调用
register: function(methodName, callback) {
if (!functions[methodName]) {
functions[methodName] = callback;
}
},
// JS端逻辑处理完成后回调给Native的数据
onResult: function(data){
window.RPayPlus.send("jsCallback", data, null);
}
};
});

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

@ -701,50 +701,128 @@ define(['angular', 'decimal', 'uiRouter', 'ngBootSwitch', 'ngFileUpload'], funct
};
$scope.myInterval = 2000;
$scope.first = true;
$scope.pcfirst = true;
$scope.bankfirst = true;
$scope.appfirst = true;
$scope.active = 0;
$scope.show = false;
var slides = $scope.slides = [];
var addSlide = function () {
slides.push({
image: '/static/images/hfpaylink_intro/hf_pay_step1.png',
$scope.pcshow = false;
$scope.appshow = false;
$scope.bankshow = false;
var slidesPc = $scope.slidesPc = [];
var slidesPcBank = $scope.slidesBank = [];
var slidesApp = $scope.slidesApp = [];
var addSlidePc = function () {
slidesPc.push({
image: '/static/images/hfpaylink_intro/pc_hf_pay_step1.png',
text: '第一次打开支付链接进行下单,第一步用微信扫码页面弹出的二维码,确认您的身份',
id:0
});
slides.push({
image: '/static/images/hfpaylink_intro/hf_pay_step2.png',
slidesPc.push({
image: '/static/images/hfpaylink_intro/pc_hf_pay_step2.png',
text: '下一步填写订单信息。注意订单金额货币单位是澳元AUD。请认真填写商品名称否则可能导致交易不成功。填写完成最后提交订单。',
id:1
});
slides.push({
image: '/static/images/hfpaylink_intro/hf_pay_step3.png',
text: '跳转到汇付支付页面,选择您的支付方式,同时填写姓名、身份证、银行卡号、手机号信息,完成身份验证,最后点击“确认支付”',
slidesPc.push({
image: '/static/images/hfpaylink_intro/pc_hf_pay_step3.png',
text: '页面显示支付二维码使用相应的支付app进行扫码支付。如订单有误请点击"返回上一步"修改订单。',
id:2
});
slides.push({
image: '/static/images/hfpaylink_intro/hf_pay_step4.png',
text: '页面弹出支付二维码使用相应的支付app进行扫码支付。',
slidesPc.push({
image: '/static/images/hfpaylink_intro/hf_pay_end.png',
text: '完成支付,跳转到支付成功页面。',
id:3
});
slides.push({
image: '/static/images/hfpaylink_intro/hf_pay_step5.png',
};
var addSlidePcBank = function () {
slidesPcBank.push({
image: '/static/images/hfpaylink_intro/pc_bank_hf_pay_step1.png',
text: '第一次打开支付链接进行下单,第一步用微信扫码页面弹出的二维码,确认您的身份',
id:0
});
slidesPcBank.push({
image: '/static/images/hfpaylink_intro/pc_bank_hf_pay_step2.png',
text: '下一步填写订单信息。注意订单金额货币单位是澳元AUD。请认真填写商品名称否则可能导致交易不成功。填写完成最后提交订单。',
id:1
});
slidesPcBank.push({
image: '/static/images/hfpaylink_intro/pc_bank_hf_pay_step3.png',
text: '提交订单后,页面跳转到对应银行,请填写相关信息完成支付。',
id:2
});
slidesPcBank.push({
image: '/static/images/hfpaylink_intro/hf_pay_end.png',
text: '完成支付,跳转到支付成功页面。',
id:4
id:3
});
};
var addSlideApp = function () {
slidesApp.push({
image: '/static/images/hfpaylink_intro/app_bank_hf_pay_step1.png',
text: '使用微信客户端填写订单信息。注意订单金额货币单位是澳元AUD。请认真填写商品名称否则可能导致交易不成功。填写完成最后提交订单。',
id:0
});
slidesApp.push({
image: '/static/images/hfpaylink_intro/app_bank_hf_pay_step2.png',
text: '提交订单后,页面跳转到汇付天下支付页面,请填写相关信息完成支付。',
id:1
});
};
$scope.toFirst = function () {
if(!$scope.first) {
$scope.toPcFirst = function () {
$scope.reset();
if(!$scope.pcfirst) {
return;
}
addSlide();
$scope.first = false;
addSlidePc();
$scope.pcfirst = false;
};
$scope.toShow = function () {
$scope.show = true;
$scope.toBankFirst = function () {
$scope.reset();
if(!$scope.bankfirst) {
return;
}
addSlidePcBank();
$scope.bankfirst = false;
};
$scope.toAppFirst = function () {
$scope.reset();
if(!$scope.appfirst) {
return;
}
addSlideApp();
$scope.appfirst = false;
};
$scope.toPcShow = function () {
$scope.pcshow = true;
};
$scope.toAppShow = function () {
$scope.appshow = true;
};
$scope.toBankShow = function () {
$scope.bankshow = true;
};
$scope.toHide = function () {
$scope.show = false
}
$scope.pcshow = false;
$scope.bankshow = false;
$scope.appshow = false;
};
$scope.reset = function () {
slidesPc = $scope.slidesPc = [];
slidesPcBank = $scope.slidesBank = [];
slidesApp = $scope.slidesApp = [];
$scope.myInterval = 2000;
$scope.pcfirst = true;
$scope.bankfirst = true;
$scope.appfirst = true;
$scope.active = 0;
$scope.pcshow = false;
$scope.appshow = false;
$scope.bankshow = false;
};
}]);
app.controller('clientPaymentMaterialCtrl', ['$scope', '$http', 'partner', function ($scope, $http, partner) {

@ -1,8 +1,8 @@
<style>
.pos{
position:absolute;
top:-395px;
left:120px;
top:30%;
left:30%;
height: 400px;
width:700px;
z-index: 10000;
@ -104,36 +104,78 @@
<div class="col-sm-10">
<a href={{partner.hf_pay_url}} target="_Blank">
<span class="form-control-static">{{partner.hf_pay_url}}
<!-- <span id="intro">
<a href=""><i id="carousel_id" class="glyphicon glyphicon-info-sign" ng-mouseover="toFirst();toShow()"></i></a>
<div class="pos" ng-show="show">
<i class="tocancle glyphicon glyphicon-remove" ng-click="toHide()"></i>
<uib-carousel active="active" interval="myInterval" no-wrap="false">
<uib-slide ng-repeat="slide in slides track by slide.id" index="slide.id">
<img ng-src="{{slide.image}}" style="margin:auto;height: 400px;background-color: black">
<div class="carousel-caption" style="bottom: 10px;text-shadow: 0 0px 0px">
<p class="text-primary">{{slide.text}}</p>
</div>
</uib-slide>
</uib-carousel>
</div>
</span>-->
</span>
</a>
<i class="fa fa-clipboard margin-r-5" style="cursor: pointer" ng-click="clientCopyHfLink()"></i>
<input style="opacity: 0" id="c-cpbt" value={{partner.hf_pay_url}} readonly>
</div>
</div>
<div class="form-group">
<div class="form-group" style="display: flex">
<label class="col-sm-2 control-label">HF Pay QR Code</label>
<img ng-src="{{partner.hfQrcodeUrl}}" class="img-responsive" />
<div>
<span style="padding-left: 19.5%;font-size:9px;">仅支持微信客户端扫描</span>
<div style="text-align: center">
<img ng-src="{{partner.hfQrcodeUrl}}" class="img-responsive" />
<span style="font-size:9px;">仅支持微信客户端扫描</span>
</div>
<div style="padding-top: 30px;padding-left: 20%;text-align: center">
<img style="width: 220px;height: 150px;cursor: pointer" src="/static/images/hfpaylink_intro/pc_hf_pay_step1.png" class="img-responsive" ng-click="reset();toPcFirst();toPcShow()"/>
<span style="font-size:9px;">微信/支付宝电脑端</span>
<span >
<div class="pos" ng-show="pcshow">
<i class="tocancle glyphicon glyphicon-remove" ng-click="toHide()"></i>
<uib-carousel active=0 interval="myInterval" no-wrap="false">
<uib-slide ng-repeat="slide1 in slidesPc track by slide1.id" index="slide1.id">
<img ng-src="{{slide1.image}}" style="margin:auto;height: 400px;background-color: black">
<div class="carousel-caption" style="bottom: 10px;text-shadow: 0 0px 0px">
<p class="text-primary">{{slide1.text}}</p>
</div>
</uib-slide>
</uib-carousel>
</div>
</span>
</div>
<div style="padding-top: 30px;padding-left: 4%;text-align: center">
<img style="width: 220px;height: 150px;cursor: pointer" src="/static/images/hfpaylink_intro/pc_hf_pay_step1.png" class="img-responsive" ng-click="reset();toBankFirst();toBankShow()"/>
<span style="font-size:9px;">网银电脑端</span>
<span id="intro">
<div class="pos" ng-show="bankshow">
<i class="tocancle glyphicon glyphicon-remove" ng-click="toHide()"></i>
<uib-carousel active=0 interval="myInterval" no-wrap="false">
<uib-slide ng-repeat="slide2 in slidesBank track by slide2.id" index="slide2.id">
<img ng-src="{{slide2.image}}" style="margin:auto;height: 400px;background-color: black">
<div class="carousel-caption" style="bottom: 10px;text-shadow: 0 0px 0px">
<p class="text-primary">{{slide2.text}}</p>
</div>
</uib-slide>
</uib-carousel>
</div>
</span>
</div>
<div style="padding-top: 30px;padding-left: 4%;text-align: center">
<img style="width: 220px;height: 150px;cursor: pointer" src="/static/images/hfpaylink_intro/app_bank_hf_pay_step1.png" class="img-responsive" ng-click="reset();toAppFirst();toAppShow()"/>
<span style="font-size:9px;">手机端</span>
<span >
<div class="pos" ng-show="appshow">
<i class="tocancle glyphicon glyphicon-remove" ng-click="toHide()"></i>
<uib-carousel active=0 interval="myInterval" no-wrap="false">
<uib-slide ng-repeat="slide3 in slidesApp track by slide3.id" index="slide3.id">
<img ng-src="{{slide3.image}}" style="margin:auto;height: 400px;background-color: black">
<div class="carousel-caption" style="bottom: 10px;text-shadow: 0 0px 0px">
<p class="text-primary">{{slide3.text}}</p>
</div>
</uib-slide>
</uib-carousel>
</div>
</span>
</div>
</div>
</div>
</div>
</div>

@ -329,8 +329,8 @@
<div class="col-sm-10">
<input type="checkbox" ng-model="paymentInfo.enable_link" bs-switch switch-change="toggleHfLink('hf')">
&nbsp;&nbsp;<a href={{paymentInfo.hf_pay_url}} target="_Blank"><span ng-if="paymentInfo.enable_link">{{paymentInfo.hf_pay_url}}</span></a>
<i class="fa fa-clipboard margin-r-5" style="cursor: pointer" ng-click="copyHfLink()"></i>
<input style="opacity: 0" id="cpbt" value={{paymentInfo.hf_pay_url}} readonly>
<i ng-if="paymentInfo.enable_link" class="fa fa-clipboard margin-r-5" style="cursor: pointer" ng-click="copyHfLink()"></i>
<input ng-if="paymentInfo.enable_link" style="opacity: 0" id="cpbt" value={{paymentInfo.hf_pay_url}} readonly>
</div>
</div>
<div class="form-group" ng-if="paymentInfo.enable_link">

Loading…
Cancel
Save