|
|
@@ -47,7 +47,7 @@ const GCommonHeads = {
|
|
|
|
|
|
let marketId = lk.getVal(OfPayConstKey.marketId);
|
|
|
let eventVisitorId = lk.getVal(OfPayConstKey.eventVisitorId);
|
|
|
-let awardWantDiscount = lk.getVal(OfPayConstKey.awardDiscountPrice,{});
|
|
|
+let awardWantDiscountDict = null;
|
|
|
|
|
|
if (!lk.isExecComm) {
|
|
|
if (!lk.isRequest()) {
|
|
|
@@ -116,8 +116,9 @@ function checkParamsExists(){
|
|
|
|
|
|
function getWillMarketBuyListAll() {
|
|
|
let key = `${OfPayConstKey.marketBuyList}`;
|
|
|
+ let defVal = '星巴克|霸王茶姬|百果园|京东E卡|滴滴快车';
|
|
|
let nameArr = [];
|
|
|
- let nameStr = lk.getVal(key);
|
|
|
+ let nameStr = lk.getVal(key, defVal);
|
|
|
if (!lk.isEmpty(nameStr)) {
|
|
|
let segments = nameStr.trim().split('|');
|
|
|
nameArr = [];
|
|
|
@@ -201,8 +202,26 @@ async function itemBuy(subActivityId, awardData){
|
|
|
}
|
|
|
|
|
|
function getAwardExpectedDiscount(price, prizeName){
|
|
|
- if(awardWantDiscount[prizeName] != void 0){
|
|
|
- return awardWantDiscount[prizeName];
|
|
|
+ if(!awardWantDiscountDict){
|
|
|
+ awardWantDiscountDict = {};
|
|
|
+ let defVal = '星巴克#20.80|霸王茶姬#10.80|百果园#10.80|京东E卡#10.80|滴滴快车#10.80';
|
|
|
+ let discountStr = lk.getVal(OfPayConstKey.awardDiscountPrice,defVal);
|
|
|
+ if (!lk.isEmpty(discountStr)) {
|
|
|
+ let segments = discountStr.trim().split('|');
|
|
|
+ for (let vstr of segments) {
|
|
|
+ if(!lk.isEmpty(vstr)){
|
|
|
+ const vlist = vstr.trim().split('#');
|
|
|
+ const key = vlist[0];
|
|
|
+ if(vlist[1]){
|
|
|
+ const price = Number(vlist[1].trim());
|
|
|
+ awardWantDiscountDict[key] = price;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(awardWantDiscountDict[prizeName] != void 0){
|
|
|
+ return awardWantDiscountDict[prizeName];
|
|
|
}
|
|
|
return price-8.8;
|
|
|
}
|