fs-alipay-ad-component 0.1.3 → 0.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/config/index.js +1 -1
- package/es/index/index.acss +1 -1
- package/es/index/index.axml +52 -2
- package/es/index/index.js +1 -1
- package/es/node_modules/qs/lib/formats.js +23 -0
- package/es/node_modules/qs/lib/index.js +11 -0
- package/es/node_modules/qs/lib/parse.js +257 -0
- package/es/node_modules/qs/lib/stringify.js +287 -0
- package/es/node_modules/qs/lib/utils.js +252 -0
- package/es/node_modules/qs/package.json +70 -0
- package/es/utils/constant.js +1 -1
- package/package.json +1 -1
- package/es/node_modules/@fubei/mina-fetch/dist/MiniHttpService.d.ts +0 -7
- package/es/node_modules/@fubei/mina-fetch/dist/core/HttpService.d.ts +0 -143
- package/es/node_modules/@fubei/mina-fetch/dist/core/constants.d.ts +0 -32
- package/es/node_modules/@fubei/mina-fetch/dist/core/types.d.ts +0 -53
- package/es/node_modules/@fubei/mina-fetch/dist/core/util.d.ts +0 -28
- package/es/node_modules/@fubei/mina-fetch/dist/index.es5.js.map +0 -1
- package/es/node_modules/@fubei/mina-fetch/dist/index.js.map +0 -1
- package/es/node_modules/@fubei/mina-logger/dist/index.es5.js.map +0 -1
- package/es/node_modules/@fubei/mina-logger/dist/index.js.map +0 -1
- package/es/node_modules/@fubei/mina-logger/dist/lib/core/MinaFsLogger.js.map +0 -1
- package/es/node_modules/@fubei/mina-logger/dist/lib/core/WebFsLogger.js.map +0 -1
- package/es/node_modules/@fubei/mina-logger/dist/lib/helpers/env.js.map +0 -1
- package/es/node_modules/@fubei/mina-logger/dist/lib/helpers/ipObtain.js.map +0 -1
- package/es/node_modules/@fubei/mina-logger/dist/lib/helpers/promiseLimit.js.map +0 -1
- package/es/node_modules/@fubei/mina-logger/dist/lib/helpers/util.js.map +0 -1
- package/es/node_modules/@fubei/mina-logger/dist/lib/index.js.map +0 -1
- package/es/node_modules/@fubei/mina-logger/dist/lib/types/index.js.map +0 -1
- package/es/node_modules/@fubei/mina-logger/dist/types/core/MinaFsLogger.d.ts +0 -29
- package/es/node_modules/@fubei/mina-logger/dist/types/core/WebFsLogger.d.ts +0 -27
- package/es/node_modules/@fubei/mina-logger/dist/types/helpers/env.d.ts +0 -4
- package/es/node_modules/@fubei/mina-logger/dist/types/helpers/ipObtain.d.ts +0 -6
- package/es/node_modules/@fubei/mina-logger/dist/types/helpers/promiseLimit.d.ts +0 -11
- package/es/node_modules/@fubei/mina-logger/dist/types/helpers/util.d.ts +0 -38
- package/es/node_modules/@fubei/mina-logger/dist/types/index.d.ts +0 -3
- package/es/node_modules/@fubei/mina-logger/dist/types/types/index.d.ts +0 -64
- package/es/node_modules/@fubei/mina-sls/dist/index.es5.js.map +0 -1
- package/es/node_modules/@fubei/mina-sls/dist/index.js.map +0 -1
- package/es/node_modules/dayjs/index.d.ts +0 -429
package/es/config/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var __assign=this&&this.__assign||function(){return __assign=Object.assign||function(s){for(var t,e=1,o=arguments.length;e<o;e++)for(var _ in t=arguments[e])Object.prototype.hasOwnProperty.call(t,_)&&(s[_]=t[_]);return s},__assign.apply(this,arguments)};function getEnv(){var s="prod",t="0.1.
|
|
1
|
+
"use strict";var __assign=this&&this.__assign||function(){return __assign=Object.assign||function(s){for(var t,e=1,o=arguments.length;e<o;e++)for(var _ in t=arguments[e])Object.prototype.hasOwnProperty.call(t,_)&&(s[_]=t[_]);return s},__assign.apply(this,arguments)};function getEnv(){var s="prod",t="0.1.5",e="fs-alipay-ad-component-".concat(s);return __assign(__assign({},{test:{ALI_LOG_PROJECT_NAME:"fshows-ecs-pro",ALI_LOG_SEEDS_STORE:"web-ad-consumer-log",REQUEST_URL:"http://advertising-test.adcomeon.com/api"},beta:{XCXVERSION:t,ALI_LOG_PROJECT_NAME:"fshows-ecs-pro",ALI_LOG_SEEDS_STORE:"web-ad-consumer-log",REQUEST_URL:"https://advertising-beta.adcomeon.com/api"},prod:{ALI_LOG_PROJECT_NAME:"fshows-ecs-pro",ALI_LOG_SEEDS_STORE:"web-ad-consumer-log",REQUEST_URL:"https://advertising.adcomeon.com/api"}}[s]),{XCXVERSION:t,APP_ID:e,ENVIRONMENT_TYPE:s})}Object.defineProperty(exports,"__esModule",{value:!0}),exports.MOCK_URL=exports.OSS_URL=void 0,exports.OSS_URL="https://fs-ad-web-resources.oss-cn-hangzhou.aliyuncs.com/mina",exports.MOCK_URL="http://127.0.0.1:4523/mock/1080865/",exports.default=getEnv;
|
package/es/index/index.acss
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.modal-mask{z-index:9999;position:fixed;top:0;left:0;overflow:hidden;display:flex;justify-content:center;align-items:center;width:100%;height:100%;background:rgba(0,0,0,.8);color:#fff}.modal-mask .modal-dialog{z-index:9999;overflow:hidden;width:540rpx;padding:0 32rpx;border-radius:36rpx;background:#f9f9f9;color:#030303}.modal-mask .modal-title{padding:60rpx 0 50rpx;text-align:center;font-size:36rpx}.modal-mask .modal-footer{height:120rpx;border-top:1px solid #dedede;line-height:120rpx;text-align:center;font-size:34rpx}
|
|
1
|
+
.modal-mask{z-index:9999;position:fixed;top:0;left:0;overflow:hidden;display:flex;justify-content:center;align-items:center;width:100%;height:100%;background:rgba(0,0,0,.8);color:#fff}.modal-mask .modal-dialog{z-index:9999;overflow:hidden;width:540rpx;padding:0 32rpx;border-radius:36rpx;background:#f9f9f9;color:#030303}.modal-mask .modal-title{padding:60rpx 0 50rpx;text-align:center;font-size:36rpx}.modal-mask .modal-footer{height:120rpx;border-top:1px solid #dedede;line-height:120rpx;text-align:center;font-size:34rpx}.custom-pay-success{z-index:999;position:fixed;top:0;left:0;display:flex;justify-content:center;align-items:center;width:100%;height:100%;background-color:rgba(0,0,0,.5)}.pay-success-modal{position:relative;width:260px;padding:130px 32px 16px;border-radius:12px;box-sizing:border-box;text-align:center;background-color:#fff}.pay-modal-header-left{position:absolute;top:12px;left:12px;display:flex;justify-content:center;align-items:center}.pay-modal-tips{padding:4px 8px;border-radius:4px;background-color:#d9d9d9;color:#fff;font-size:10px}.modal-close-icon{width:8px;height:8px;margin-right:4px}.has-bg-modal{background:url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAATgAAAELCAMAAAB6T2pbAAAC/VBMVEX+4tgAAAD83tT+/fv///b/49X+/fr+49j+/fv+/fr+49j//fz//fv/49j8/Pj84tb/49j/49n+7+n+49j+9PD+7eX+/Pn++PT+9vL+6+T+8ev+8+7+7uf++fX+5dz+5t3+6eH+6uL++vb+6N/++vj+9vH+5Nr+597+8uz+8u3+5Nn+593+/fv/RzH/o3r/2KP/RS//oXj/aD//37P/2qb/3a7/pXv/4bb/Qy3/26r/YEj/T0D/Yz//aDv/clv/ZUD/w5j/ZEz/17D/1qD/vYr/bFP/ypn/YEv/0Kf/xpL/wY//jGr/kk7/ZlH/aEv/WUD/roP/f2b/TTf828b/t4//uIT/SDT849X/5LL/zZz/pon/qn//nHX/dF//dlr/a07/8LX/67X/x5j/rIj/e2X/cFb/VUD/Zjb/PiX74c//463/063/3KP/x5//sn//hWj/a1j/ikn/VDv/UTn/Zyn/YSn/06r/3qj/uZb/p33/e17/QDD/NCv/5Ln/i3L/km//kmj/ZUf/QzT82M3/4af/06T/vZn/q3b/TTH/XSL/8r3/1Zf/t33/sXn/hG7/b1r/hEX/XUT/eD/84tr/8c//6b//7K7/0p//n2v/dmH/Oi//z6H+wJ7/so7/qY3/sof/sHH/mHH/nFb/dEX/fj/+Kin9qpv/m4r/l4X/qoH/Jwn/8Mb94sb+27X/y6P/pJT/mn//pHD/mWT/o1z/WEj/Rjz7zsX91Lb8vbH+tar/y6n/wZP/n4b/lnr/kHn/ZTD/ci3/CAL/kID/q2j/gmD/eiz/Vxr/LhL/OAv/FQn+v6b/pYL/nnn/h1f/hk7/PSr/Ox//Mxv90r793L3/uKT/rqD/257/tJv/zor/gFb/9Nf8473/v4P/kFn/XlX/dFD/Wi3/aCD/VB/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dvO3FQxaEI9zvIpWHDCrpPGTQSe8hg14aDxk0UvMnl0FVixs8JDM4cXXrIZG2DuHc6CGR0T3COb4PiTRuD+fGdl3X737d2GZ49e3o9nCBeqie8u2ozvD7WA2103AhXdN31apEP7Lz333V9U3tdr4AE2HhxR+YTzUAAAAASUVORK5CYII=') no-repeat #fff!important}.pay-success-title{margin-bottom:8px;color:#333;font-weight:500;font-size:18px}.pay-success-desc{margin-bottom:24px;color:#999;font-weight:400;font-size:18px}.pay-success-btns{display:flex;flex-direction:column;justify-content:center;align-items:center;gap:12px}.confirm-btn{width:100%;height:48px;border:0;border-radius:24px;line-height:48px;color:#fff;font-size:16px}.cancel-btn{margin:10px 0;border:0;outline:0;box-shadow:none;line-height:10px;background-color:#fff;color:#ccc;font-size:10px}.no-bg-modal{padding:32px;box-sizing:content-box}.no-bg-modal .pay-success-title{margin-bottom:16px}.no-bg-modal .pay-success-desc{margin-bottom:32px}.horizontal-modal{padding:0;padding-top:48rpx}.horizontal-modal .pay-success-title{height:50rpx;margin-bottom:25rpx}.horizontal-modal .pay-modal-header-left{top:0;left:0}.horizontal-modal .pay-modal-header-left .pay-modal-tips{border-radius:16rpx 0rpx 16rpx 0rpx}.horizontal-modal .pay-success-desc{margin-bottom:54rpx;padding:0 24rpx}.horizontal-modal .pay-success-btns{position:relative;flex-direction:row-reverse;height:100rpx;gap:0}.horizontal-modal .pay-success-btns .confirm-btn{flex:1;height:100rpx;border-radius:none;line-height:100rpx!important}.horizontal-modal .pay-success-btns .cancel-btn{flex:1;height:100rpx;margin:0;border-right:1px solid #e5e5e5;line-height:100rpx!important;background:0 0!important}.horizontal-modal .pay-success-btns::after{content:" ";position:absolute;top:0;right:0;left:0;height:1px;border-top:1px solid #e5e5e5;color:#e5e5e5;-webkit-transform:scaleY(.5);transform:scaleY(.5);-webkit-transform-origin:0 0;transform-origin:0 0}
|
package/es/index/index.axml
CHANGED
|
@@ -6,10 +6,60 @@
|
|
|
6
6
|
* @LastEditTime: 2023-05-15 13:44
|
|
7
7
|
-->
|
|
8
8
|
|
|
9
|
-
<view a:if="{{showPayed}}" class="modal-mask" onTap="openAd">
|
|
9
|
+
<!-- <view a:if="{{showPayed}}" class="modal-mask" onTap="openAd">
|
|
10
10
|
<view class="modal-dialog">
|
|
11
11
|
<view class="modal-title">支付成功!</view>
|
|
12
12
|
<view class="modal-footer">确定</view>
|
|
13
13
|
</view>
|
|
14
|
+
</view> -->
|
|
15
|
+
<view></view>
|
|
16
|
+
<!-- S 自定义支付成功弹窗 -->
|
|
17
|
+
<view class="custom-pay-success" style="background-color: {{customPaySuccess.modalBgColor}};" a:if="{{showPayed}}" bindtap="onClickModal">
|
|
18
|
+
<view class="pay-success-modal {{PAY_BUTTON_CLASS_NAME[customPaySuccess.bgScheme]}}" style="width: {{customPaySuccess.modalWidth}}px;transform: translateY({{customPaySuccess.modalYPosition}}px);background: {{customPaySuccess.payModalBgColor}};">
|
|
19
|
+
<!-- S 支付成功弹窗头部 -->
|
|
20
|
+
<view class="pay-modal-header-left">
|
|
21
|
+
<image style="pointer-events: {{customPaySuccess.cancelAllowClick}}" a:if="{{customPaySuccess.showCloseIcon}}" catchTap="handleCustomPaySuccessCancel" src="{{closeModalIcon}}" mode="widthFix" class="modal-close-icon"/>
|
|
22
|
+
<view a:if="{{customPaySuccess.modalTips}}" class="pay-modal-tips" style="background-color: {{customPaySuccess.modalTipsBgColor}};color: {{customPaySuccess.modalTipsColor}};font-size: {{customPaySuccess.modalTipsFontSize}}px;">
|
|
23
|
+
{{customPaySuccess.modalTips}}
|
|
24
|
+
</view>
|
|
25
|
+
</view>
|
|
26
|
+
<!-- E 支付成功弹窗头部 -->
|
|
27
|
+
<!-- S 支付成功标题 -->
|
|
28
|
+
<view
|
|
29
|
+
class="pay-success-title"
|
|
30
|
+
style="color: {{customPaySuccess.payTextColor }};font-size: {{customPaySuccess.payTextFontSize}}px;"
|
|
31
|
+
>
|
|
32
|
+
{{customPaySuccess.payText}}
|
|
33
|
+
</view>
|
|
34
|
+
<!-- E 支付成功标题 -->
|
|
35
|
+
<!-- S 支付成功描述 -->
|
|
36
|
+
<view
|
|
37
|
+
class="pay-success-desc"
|
|
38
|
+
style="color: {{customPaySuccess.titleTextColor}};font-size: {{customPaySuccess.titleTextFontSize}}px;">
|
|
39
|
+
{{customPaySuccess.titleText}}
|
|
40
|
+
</view>
|
|
41
|
+
<!-- E 支付成功描述 -->
|
|
42
|
+
<!-- S 支付成功按钮 -->
|
|
43
|
+
<view class="pay-success-btns">
|
|
44
|
+
<!-- S 确定按钮 -->
|
|
45
|
+
<view
|
|
46
|
+
class="confirm-btn"
|
|
47
|
+
catchTap="handleCustomPaySuccessConfirm"
|
|
48
|
+
style="background-color: {{customPaySuccess.btnBgColor}};color: {{customPaySuccess.btnTextColor}};font-size: {{customPaySuccess.btnTextFontSize}}px;"
|
|
49
|
+
>{{customPaySuccess.btnText}}</view>
|
|
50
|
+
<!-- E 确定按钮 -->
|
|
51
|
+
<!-- S 取消按钮 -->
|
|
52
|
+
<view
|
|
53
|
+
class="cancel-btn"
|
|
54
|
+
catchTap="handleCustomPaySuccessCancel"
|
|
55
|
+
a:if="{{customPaySuccess.hasCancel && customPaySuccess.cancelText}}"
|
|
56
|
+
style="color: {{customPaySuccess.cancelTextColor}};font-size: {{customPaySuccess.cancelTextFontSize}}px;line-height: {{customPaySuccess.cancelLineHeight}}px;min-width: {{customPaySuccess.cancelMinWidth}}px;font-weight: {{customPaySuccess.cancelFontWeight}};pointer-events: {{customPaySuccess.cancelAllowClick}};"
|
|
57
|
+
>
|
|
58
|
+
{{customPaySuccess.cancelText}}
|
|
59
|
+
</view>
|
|
60
|
+
<!-- E 取消按钮 -->
|
|
61
|
+
</view>
|
|
62
|
+
<!-- E 支付成功按钮 -->
|
|
63
|
+
</view>
|
|
14
64
|
</view>
|
|
15
|
-
|
|
65
|
+
<!-- E 自定义支付成功弹窗 -->
|
package/es/index/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var __importDefault=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(exports,"__esModule",{value:!0});var constant_1=require("../utils/constant"),utils_1=require("../utils/utils"),aliApi_1=require("../utils/aliApi"),slsTracker_1=__importDefault(require("../utils/slsTracker")),api_1=require("../api/generator/api");Component({data:{AD_TYPE_ID:constant_1.AD_TYPE_ID,innerOrderId:"",showAdDom:!1,adInfo:{},adPreconditionInfo:constant_1.DEFAULT_PRE_INFO,showPayed:!1,showConfirm:!1},props:{orderId:"",openId:"",flowMasterId:"",clientSession:"",fubeiUser:{},minaVersion:"",isMulti:!1,triggerShow:!1,onAdInfoReady:function(){}},didMount:function(){var t=this.props,a=t.openId,
|
|
1
|
+
"use strict";var _a,__assign=this&&this.__assign||function(){return __assign=Object.assign||function(t){for(var a,n=1,e=arguments.length;n<e;n++)for(var o in a=arguments[n])Object.prototype.hasOwnProperty.call(a,o)&&(t[o]=a[o]);return t},__assign.apply(this,arguments)},__importDefault=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(exports,"__esModule",{value:!0});var constant_1=require("../utils/constant"),utils_1=require("../utils/utils"),aliApi_1=require("../utils/aliApi"),slsTracker_1=__importDefault(require("../utils/slsTracker")),api_1=require("../api/generator/api"),CUSTOM_PAY_SUCCESS_BG={color:1,bgImage:2,horizontal:3},PAY_BUTTON_CLASS_NAME=((_a={})[CUSTOM_PAY_SUCCESS_BG.color]="no-bg-modal",_a[CUSTOM_PAY_SUCCESS_BG.bgImage]="has-bg-modal",_a[CUSTOM_PAY_SUCCESS_BG.horizontal]="horizontal-modal",_a);Component({data:{PAY_BUTTON_CLASS_NAME:PAY_BUTTON_CLASS_NAME,AD_TYPE_ID:constant_1.AD_TYPE_ID,innerOrderId:"",showAdDom:!1,adInfo:{},adPreconditionInfo:constant_1.DEFAULT_PRE_INFO,showPayed:!1,showConfirm:!1,customPaySuccess:{show:!1,btnText:"确定",btnBgColor:"",btnTextColor:"",titleText:"",hasCancel:!1,btnHot:!0,originalWindow:!1}},props:{orderId:"",openId:"",flowMasterId:"",clientSession:"",fubeiUser:{},minaVersion:"",isMulti:!1,triggerShow:!1,onAdInfoReady:function(){}},didMount:function(){var t=this.props,a=t.openId,n=t.flowMasterId;a&&n?(this.initData(),slsTracker_1.default.trackerEvent("支付宝广告组件加载",constant_1.TRACKER.attached),this.getAdData()):(0,aliApi_1.aliShowToast)("缺少必传参数")},didUpdate:function(t){this.props.triggerShow&&this.props.triggerShow!==t.triggerShow&&this.showAd()},methods:{initData:function(){var t=this.props,a=t.openId,n=t.flowMasterId,e=t.orderId,o=t.clientSession,i=t.minaVersion;this.setData({innerOrderId:e||(0,utils_1.getRandomString)()}),my._AgentData={flowMasterId:n,openId:a,minaVersion:i,orderId:this.data.innerOrderId,clientSession:o||(0,utils_1.getRandomString)()}},getPaySuccessConfig:function(t){return{btnText:t.btnText||"确定",btnTextColor:t.btnTextColor||"#fff",titleText:t.titleText||"您即将进入新的页面查看优惠",payText:t.payText||"支付成功",payTextColor:t.payTextColor||"#333",payTextFontSize:t.payTextFontSize||"18",titleTextColor:t.titleTextColor||"#999",titleTextFontSize:t.titleTextFontSize||"18",btnTextFontSize:t.btnTextFontSize||"18",cancelText:t.cancelText,cancelTextColor:t.cancelTextColor||"#ccc",cancelTextFontSize:t.cancelTextFontSize||"10",modalHeight:t.modalHeight||"200",modalWidth:t.modalWidth||"260",cancelMinWidth:t.cancelMinWidth||"20",cancelFontWeight:t.cancelFontWeight||"600",cancelAllowClick:t.cancelAllowClick||"auto",modalBgColor:t.modalBgColor||"rgba(0,0,0,.5)",modalYPosition:t.modalYPosition||"0",btnHot:t.btnHot,payModalBgColor:t.payModalBgColor||"#fff",modalTips:t.modalTips,modalTipsColor:t.modalTipsColor||"#fff",modalTipsFontSize:t.modalTipsFontSize||"10",modalTipsBgColor:t.modalTipsBgColor||"#d9d9d9",showCloseIcon:t.showCloseIcon,bgScheme:t.bgScheme,hasCancel:t.hasCancel,btnBgColor:t.btnBgColor||"#f04144"}},getAdData:function(){var t=this;this.getAdPrecondition().then(function(){t.getAdInfo()}).catch(function(){t.getAdInfo()})},getAdPrecondition:function(){var t=this,a={};return a.orderId=this.data.innerOrderId,this.props.fubeiUser.merchantId&&(a.merchantId=this.props.fubeiUser.merchantId),this.props.fubeiUser.storeId&&(a.storeId=this.props.fubeiUser.storeId),api_1.DefaultApiFetch.adClientGetAdPreconditionPost(a).then(function(a){t.setData({adPreconditionInfo:a})})},getAdInfo:function(){var t=this,a=this.data,n=a.adPreconditionInfo,e=n.agent,o=n.area,i=n.industry,s=n.mobile,r=a.innerOrderId,c=this.props,d=c.flowMasterId,l=c.openId;return api_1.DefaultApiFetch.adClientGetAdInfoPost({openId:l,flowMasterId:d,agent:e,area:o,industry:i,mobile:s,orderId:r,mediaId:constant_1.MEDIA_ID.alipayMina}).then(function(a){if(a){var n=a.isShowDialog;t.setData({adInfo:a,showConfirm:n===constant_1.SHOW_DIALOG.show}),t.props.onAdInfoReady(),slsTracker_1.default.trackerEvent("支付宝广告获取成功",constant_1.TRACKER.getSuccess),t.props.isMulti&&t.showAd()}})},showAd:function(){this.setData({showAdDom:!0,showPayed:this.data.showConfirm,customPaySuccess:__assign({},this.getPaySuccessConfig(this.data.adInfo.creativeList[0]))}),this.data.showConfirm||this.handleShowAd(),this.handleExposureDataReport()},openAd:function(){this.handleShowAd()},handleShowAd:function(){this.setData({showPayed:!1});var t=this.data.adInfo.typeId;t===constant_1.AD_TYPE_ID.minaAd&&this.callAlipay(),t===constant_1.AD_TYPE_ID.H5Link&&this.navigateToH5(),this.data.showConfirm&&this.handleExposureDataReport(constant_1.ACTION_TYPE.click)},navigateToH5:function(){var t=this,a=this.data.adInfo.creativeList[0].url,n=encodeURIComponent("alipays://platformapi/startapp?appId=20000067&url=".concat(encodeURIComponent(a)));my.ap.navigateToAlipayPage({path:encodeURIComponent("https://render.alipay.com/p/s/i/?scheme=".concat(n)),success:function(){slsTracker_1.default.trackerEvent("支付宝H5直跳广告-跳转H5成功",constant_1.TRACKER[constant_1.AD_TYPE_ID.H5Link].linkH5Success),t.handleExposureDataReport(constant_1.ACTION_TYPE.realExposure)},fail:function(t){slsTracker_1.default.trackerEvent("支付宝H5直跳广告-跳转H5失败",constant_1.TRACKER[constant_1.AD_TYPE_ID.H5Link].linkH5Failed)}})},callAlipay:function(){var t=this,a=this.data.adInfo.creativeList[0],n=a.appid,e=a.pagePath,o=a.queryObj,i=a.appletJumpType;i===constant_1.MINA_JUMP_TYPE.openEmbeddedMiniProgram?(0,aliApi_1.aliOpenEmbeddedMiniProgram)({appId:n,path:e,query:o&&JSON.parse(o),appletJumpType:i}).then(function(){t.handleExposureDataReport(constant_1.ACTION_TYPE.realExposure),slsTracker_1.default.trackerEvent("支付宝半屏小程序广告-跳转小程序成功",constant_1.TRACKER[constant_1.AD_TYPE_ID.minaAd].linkMiniprogramSuccess)}).catch(function(){slsTracker_1.default.trackerEvent("支付宝半屏小程序广告-跳转小程序失败",constant_1.TRACKER[constant_1.AD_TYPE_ID.minaAd].linkMiniprogramFailed)}):(0,aliApi_1.aliNavigateToMiniProgram)({appId:n,path:e,query:o&&JSON.parse(o)}).then(function(){t.handleExposureDataReport(constant_1.ACTION_TYPE.realExposure),slsTracker_1.default.trackerEvent("支付宝小程序广告-跳转小程序成功",constant_1.TRACKER[constant_1.AD_TYPE_ID.minaAd].linkMiniprogramSuccess)}).catch(function(){slsTracker_1.default.trackerEvent("支付宝小程序广告-跳转小程序失败",constant_1.TRACKER[constant_1.AD_TYPE_ID.minaAd].linkMiniprogramFailed)})},handleExposureDataReport:function(t){void 0===t&&(t=constant_1.ACTION_TYPE.exposure);var a=this.data.adInfo,n=this.props.openId,e=this.data.adPreconditionInfo,o=e.agent,i=e.area,s=e.industry,r=e.mobile;api_1.DefaultApiFetch.adClientDataReportPost({openId:n,actionType:t,baseData:a,areaData:i,mobileData:r,agentData:o,industryData:s}).then(function(){t===constant_1.ACTION_TYPE.exposure&&slsTracker_1.default.trackerEvent("支付宝广告曝光",constant_1.TRACKER.exposure)})},onClickModal:function(){this.data.customPaySuccess.btnHot&&this.handleCustomPaySuccessConfirm()},handleCustomPaySuccessConfirm:function(){console.log("handleCustomPaySuccessConfirm",this.data.adInfo);var t=this.data.adInfo.creativeList[0],a=t.btnBgColor,n=t.colorPlanType,e=this.data.adInfo.typeId;slsTracker_1.default.trackerEvent("".concat(constant_1.AD_TYPE_ID_DEC[e],"-支付成功弹窗确定按钮点击"),constant_1.TRACKER[e].alipay_modal_click),slsTracker_1.default.trackerEvent("".concat(constant_1.AD_TYPE_ID_DEC[e],"-支付成功弹窗确定按钮点击-").concat(a),"alipay_ad_minaAd_modal_click_".concat(a)),slsTracker_1.default.trackerEvent("支付成功-广告计划类型-".concat(n),"alipay_ad_minaAd_modal_click_".concat(n)),this.handleShowAd()},handleCustomPaySuccessCancel:function(){var t=this.data.adInfo.typeId,a=this.data.adInfo.creativeList[0],n=a.btnBgColor,e=a.colorPlanType;slsTracker_1.default.trackerEvent("".concat(constant_1.AD_TYPE_ID_DEC[t],"-支付成功弹窗取消按钮点击"),constant_1.TRACKER[t].alipay_modal_cancel),slsTracker_1.default.trackerEvent("".concat(constant_1.AD_TYPE_ID_DEC[t],"-支付成功弹窗取消按钮点击-").concat(n),"alipay_ad_minaAd_modal_cancel_".concat(n)),slsTracker_1.default.trackerEvent("支付成功广告计划类型-".concat(e),"alipay_ad_minaAd_modal_cancel_".concat(e)),this.setData({showPayed:!1})}}});
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var replace = String.prototype.replace;
|
|
4
|
+
var percentTwenties = /%20/g;
|
|
5
|
+
|
|
6
|
+
var Format = {
|
|
7
|
+
RFC1738: 'RFC1738',
|
|
8
|
+
RFC3986: 'RFC3986'
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
module.exports = {
|
|
12
|
+
'default': Format.RFC3986,
|
|
13
|
+
formatters: {
|
|
14
|
+
RFC1738: function (value) {
|
|
15
|
+
return replace.call(value, percentTwenties, '+');
|
|
16
|
+
},
|
|
17
|
+
RFC3986: function (value) {
|
|
18
|
+
return String(value);
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
RFC1738: Format.RFC1738,
|
|
22
|
+
RFC3986: Format.RFC3986
|
|
23
|
+
};
|
|
@@ -0,0 +1,257 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var utils = require('./utils');
|
|
4
|
+
|
|
5
|
+
var has = Object.prototype.hasOwnProperty;
|
|
6
|
+
var isArray = Array.isArray;
|
|
7
|
+
|
|
8
|
+
var defaults = {
|
|
9
|
+
allowDots: false,
|
|
10
|
+
allowPrototypes: false,
|
|
11
|
+
arrayLimit: 20,
|
|
12
|
+
charset: 'utf-8',
|
|
13
|
+
charsetSentinel: false,
|
|
14
|
+
comma: false,
|
|
15
|
+
decoder: utils.decode,
|
|
16
|
+
delimiter: '&',
|
|
17
|
+
depth: 5,
|
|
18
|
+
ignoreQueryPrefix: false,
|
|
19
|
+
interpretNumericEntities: false,
|
|
20
|
+
parameterLimit: 1000,
|
|
21
|
+
parseArrays: true,
|
|
22
|
+
plainObjects: false,
|
|
23
|
+
strictNullHandling: false
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
var interpretNumericEntities = function (str) {
|
|
27
|
+
return str.replace(/&#(\d+);/g, function ($0, numberStr) {
|
|
28
|
+
return String.fromCharCode(parseInt(numberStr, 10));
|
|
29
|
+
});
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
var parseArrayValue = function (val, options) {
|
|
33
|
+
if (val && typeof val === 'string' && options.comma && val.indexOf(',') > -1) {
|
|
34
|
+
return val.split(',');
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
return val;
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
// This is what browsers will submit when the ✓ character occurs in an
|
|
41
|
+
// application/x-www-form-urlencoded body and the encoding of the page containing
|
|
42
|
+
// the form is iso-8859-1, or when the submitted form has an accept-charset
|
|
43
|
+
// attribute of iso-8859-1. Presumably also with other charsets that do not contain
|
|
44
|
+
// the ✓ character, such as us-ascii.
|
|
45
|
+
var isoSentinel = 'utf8=%26%2310003%3B'; // encodeURIComponent('✓')
|
|
46
|
+
|
|
47
|
+
// These are the percent-encoded utf-8 octets representing a checkmark, indicating that the request actually is utf-8 encoded.
|
|
48
|
+
var charsetSentinel = 'utf8=%E2%9C%93'; // encodeURIComponent('✓')
|
|
49
|
+
|
|
50
|
+
var parseValues = function parseQueryStringValues(str, options) {
|
|
51
|
+
var obj = {};
|
|
52
|
+
var cleanStr = options.ignoreQueryPrefix ? str.replace(/^\?/, '') : str;
|
|
53
|
+
var limit = options.parameterLimit === Infinity ? undefined : options.parameterLimit;
|
|
54
|
+
var parts = cleanStr.split(options.delimiter, limit);
|
|
55
|
+
var skipIndex = -1; // Keep track of where the utf8 sentinel was found
|
|
56
|
+
var i;
|
|
57
|
+
|
|
58
|
+
var charset = options.charset;
|
|
59
|
+
if (options.charsetSentinel) {
|
|
60
|
+
for (i = 0; i < parts.length; ++i) {
|
|
61
|
+
if (parts[i].indexOf('utf8=') === 0) {
|
|
62
|
+
if (parts[i] === charsetSentinel) {
|
|
63
|
+
charset = 'utf-8';
|
|
64
|
+
} else if (parts[i] === isoSentinel) {
|
|
65
|
+
charset = 'iso-8859-1';
|
|
66
|
+
}
|
|
67
|
+
skipIndex = i;
|
|
68
|
+
i = parts.length; // The eslint settings do not allow break;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
for (i = 0; i < parts.length; ++i) {
|
|
74
|
+
if (i === skipIndex) {
|
|
75
|
+
continue;
|
|
76
|
+
}
|
|
77
|
+
var part = parts[i];
|
|
78
|
+
|
|
79
|
+
var bracketEqualsPos = part.indexOf(']=');
|
|
80
|
+
var pos = bracketEqualsPos === -1 ? part.indexOf('=') : bracketEqualsPos + 1;
|
|
81
|
+
|
|
82
|
+
var key, val;
|
|
83
|
+
if (pos === -1) {
|
|
84
|
+
key = options.decoder(part, defaults.decoder, charset, 'key');
|
|
85
|
+
val = options.strictNullHandling ? null : '';
|
|
86
|
+
} else {
|
|
87
|
+
key = options.decoder(part.slice(0, pos), defaults.decoder, charset, 'key');
|
|
88
|
+
val = utils.maybeMap(
|
|
89
|
+
parseArrayValue(part.slice(pos + 1), options),
|
|
90
|
+
function (encodedVal) {
|
|
91
|
+
return options.decoder(encodedVal, defaults.decoder, charset, 'value');
|
|
92
|
+
}
|
|
93
|
+
);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
if (val && options.interpretNumericEntities && charset === 'iso-8859-1') {
|
|
97
|
+
val = interpretNumericEntities(val);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
if (part.indexOf('[]=') > -1) {
|
|
101
|
+
val = isArray(val) ? [val] : val;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
if (has.call(obj, key)) {
|
|
105
|
+
obj[key] = utils.combine(obj[key], val);
|
|
106
|
+
} else {
|
|
107
|
+
obj[key] = val;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
return obj;
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
var parseObject = function (chain, val, options, valuesParsed) {
|
|
115
|
+
var leaf = valuesParsed ? val : parseArrayValue(val, options);
|
|
116
|
+
|
|
117
|
+
for (var i = chain.length - 1; i >= 0; --i) {
|
|
118
|
+
var obj;
|
|
119
|
+
var root = chain[i];
|
|
120
|
+
|
|
121
|
+
if (root === '[]' && options.parseArrays) {
|
|
122
|
+
obj = [].concat(leaf);
|
|
123
|
+
} else {
|
|
124
|
+
obj = options.plainObjects ? Object.create(null) : {};
|
|
125
|
+
var cleanRoot = root.charAt(0) === '[' && root.charAt(root.length - 1) === ']' ? root.slice(1, -1) : root;
|
|
126
|
+
var index = parseInt(cleanRoot, 10);
|
|
127
|
+
if (!options.parseArrays && cleanRoot === '') {
|
|
128
|
+
obj = { 0: leaf };
|
|
129
|
+
} else if (
|
|
130
|
+
!isNaN(index)
|
|
131
|
+
&& root !== cleanRoot
|
|
132
|
+
&& String(index) === cleanRoot
|
|
133
|
+
&& index >= 0
|
|
134
|
+
&& (options.parseArrays && index <= options.arrayLimit)
|
|
135
|
+
) {
|
|
136
|
+
obj = [];
|
|
137
|
+
obj[index] = leaf;
|
|
138
|
+
} else if (cleanRoot !== '__proto__') {
|
|
139
|
+
obj[cleanRoot] = leaf;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
leaf = obj;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
return leaf;
|
|
147
|
+
};
|
|
148
|
+
|
|
149
|
+
var parseKeys = function parseQueryStringKeys(givenKey, val, options, valuesParsed) {
|
|
150
|
+
if (!givenKey) {
|
|
151
|
+
return;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
// Transform dot notation to bracket notation
|
|
155
|
+
var key = options.allowDots ? givenKey.replace(/\.([^.[]+)/g, '[$1]') : givenKey;
|
|
156
|
+
|
|
157
|
+
// The regex chunks
|
|
158
|
+
|
|
159
|
+
var brackets = /(\[[^[\]]*])/;
|
|
160
|
+
var child = /(\[[^[\]]*])/g;
|
|
161
|
+
|
|
162
|
+
// Get the parent
|
|
163
|
+
|
|
164
|
+
var segment = options.depth > 0 && brackets.exec(key);
|
|
165
|
+
var parent = segment ? key.slice(0, segment.index) : key;
|
|
166
|
+
|
|
167
|
+
// Stash the parent if it exists
|
|
168
|
+
|
|
169
|
+
var keys = [];
|
|
170
|
+
if (parent) {
|
|
171
|
+
// If we aren't using plain objects, optionally prefix keys that would overwrite object prototype properties
|
|
172
|
+
if (!options.plainObjects && has.call(Object.prototype, parent)) {
|
|
173
|
+
if (!options.allowPrototypes) {
|
|
174
|
+
return;
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
keys.push(parent);
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
// Loop through children appending to the array until we hit depth
|
|
182
|
+
|
|
183
|
+
var i = 0;
|
|
184
|
+
while (options.depth > 0 && (segment = child.exec(key)) !== null && i < options.depth) {
|
|
185
|
+
i += 1;
|
|
186
|
+
if (!options.plainObjects && has.call(Object.prototype, segment[1].slice(1, -1))) {
|
|
187
|
+
if (!options.allowPrototypes) {
|
|
188
|
+
return;
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
keys.push(segment[1]);
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
// If there's a remainder, just add whatever is left
|
|
195
|
+
|
|
196
|
+
if (segment) {
|
|
197
|
+
keys.push('[' + key.slice(segment.index) + ']');
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
return parseObject(keys, val, options, valuesParsed);
|
|
201
|
+
};
|
|
202
|
+
|
|
203
|
+
var normalizeParseOptions = function normalizeParseOptions(opts) {
|
|
204
|
+
if (!opts) {
|
|
205
|
+
return defaults;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
if (opts.decoder !== null && opts.decoder !== undefined && typeof opts.decoder !== 'function') {
|
|
209
|
+
throw new TypeError('Decoder has to be a function.');
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') {
|
|
213
|
+
throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined');
|
|
214
|
+
}
|
|
215
|
+
var charset = typeof opts.charset === 'undefined' ? defaults.charset : opts.charset;
|
|
216
|
+
|
|
217
|
+
return {
|
|
218
|
+
allowDots: typeof opts.allowDots === 'undefined' ? defaults.allowDots : !!opts.allowDots,
|
|
219
|
+
allowPrototypes: typeof opts.allowPrototypes === 'boolean' ? opts.allowPrototypes : defaults.allowPrototypes,
|
|
220
|
+
arrayLimit: typeof opts.arrayLimit === 'number' ? opts.arrayLimit : defaults.arrayLimit,
|
|
221
|
+
charset: charset,
|
|
222
|
+
charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults.charsetSentinel,
|
|
223
|
+
comma: typeof opts.comma === 'boolean' ? opts.comma : defaults.comma,
|
|
224
|
+
decoder: typeof opts.decoder === 'function' ? opts.decoder : defaults.decoder,
|
|
225
|
+
delimiter: typeof opts.delimiter === 'string' || utils.isRegExp(opts.delimiter) ? opts.delimiter : defaults.delimiter,
|
|
226
|
+
// eslint-disable-next-line no-implicit-coercion, no-extra-parens
|
|
227
|
+
depth: (typeof opts.depth === 'number' || opts.depth === false) ? +opts.depth : defaults.depth,
|
|
228
|
+
ignoreQueryPrefix: opts.ignoreQueryPrefix === true,
|
|
229
|
+
interpretNumericEntities: typeof opts.interpretNumericEntities === 'boolean' ? opts.interpretNumericEntities : defaults.interpretNumericEntities,
|
|
230
|
+
parameterLimit: typeof opts.parameterLimit === 'number' ? opts.parameterLimit : defaults.parameterLimit,
|
|
231
|
+
parseArrays: opts.parseArrays !== false,
|
|
232
|
+
plainObjects: typeof opts.plainObjects === 'boolean' ? opts.plainObjects : defaults.plainObjects,
|
|
233
|
+
strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults.strictNullHandling
|
|
234
|
+
};
|
|
235
|
+
};
|
|
236
|
+
|
|
237
|
+
module.exports = function (str, opts) {
|
|
238
|
+
var options = normalizeParseOptions(opts);
|
|
239
|
+
|
|
240
|
+
if (str === '' || str === null || typeof str === 'undefined') {
|
|
241
|
+
return options.plainObjects ? Object.create(null) : {};
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
var tempObj = typeof str === 'string' ? parseValues(str, options) : str;
|
|
245
|
+
var obj = options.plainObjects ? Object.create(null) : {};
|
|
246
|
+
|
|
247
|
+
// Iterate over the keys and setup the new object
|
|
248
|
+
|
|
249
|
+
var keys = Object.keys(tempObj);
|
|
250
|
+
for (var i = 0; i < keys.length; ++i) {
|
|
251
|
+
var key = keys[i];
|
|
252
|
+
var newObj = parseKeys(key, tempObj[key], options, typeof str === 'string');
|
|
253
|
+
obj = utils.merge(obj, newObj, options);
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
return utils.compact(obj);
|
|
257
|
+
};
|