jufubao-third 1.0.21 → 1.0.22-beta10

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.
Files changed (67) hide show
  1. package/.claude/settings.local.json +12 -0
  2. package/package.json +1 -1
  3. package/src/components/JfbThirdPay/WalletMix.js +1 -0
  4. package/src/components/JfbThirdRideCheckPay/Api.js +18 -0
  5. package/src/components/JfbThirdRideCheckPay/Attr.js +17 -0
  6. package/src/components/JfbThirdRideCheckPay/JfbThirdRideCheckPay.vue +217 -0
  7. package/src/components/JfbThirdRideCheckPay/JfbThirdRideCheckPayLess.less +80 -0
  8. package/src/components/JfbThirdRideCheckPay/JfbThirdRideCheckPayMixin.js +30 -0
  9. package/src/components/JfbThirdRideCheckPay/Mock.js +7 -0
  10. package/src/components/JfbThirdRideCheckPay/cusAttr/advanced.js +28 -0
  11. package/src/components/JfbThirdRideCheckPay/cusAttr/content.js +27 -0
  12. package/src/components/JfbThirdRideCheckPay/cusAttr/style.js +7 -0
  13. package/src/components/JfbThirdRideConfirm/Api.js +37 -0
  14. package/src/components/JfbThirdRideConfirm/Attr.js +17 -0
  15. package/src/components/JfbThirdRideConfirm/JfbThirdRideConfirm.vue +527 -0
  16. package/src/components/JfbThirdRideConfirm/JfbThirdRideConfirmLess.less +80 -0
  17. package/src/components/JfbThirdRideConfirm/JfbThirdRideConfirmMixin.js +30 -0
  18. package/src/components/JfbThirdRideConfirm/Mock.js +69 -0
  19. package/src/components/JfbThirdRideConfirm/cusAttr/advanced.js +7 -0
  20. package/src/components/JfbThirdRideConfirm/cusAttr/content.js +27 -0
  21. package/src/components/JfbThirdRideConfirm/cusAttr/style.js +7 -0
  22. package/src/components/JfbThirdRideGenOrder/Api.js +21 -0
  23. package/src/components/JfbThirdRideGenOrder/Attr.js +17 -0
  24. package/src/components/JfbThirdRideGenOrder/JfbThirdRideGenOrder.vue +234 -0
  25. package/src/components/JfbThirdRideGenOrder/JfbThirdRideGenOrderLess.less +80 -0
  26. package/src/components/JfbThirdRideGenOrder/JfbThirdRideGenOrderMixin.js +30 -0
  27. package/src/components/JfbThirdRideGenOrder/Mock.js +11 -0
  28. package/src/components/JfbThirdRideGenOrder/cusAttr/advanced.js +37 -0
  29. package/src/components/JfbThirdRideGenOrder/cusAttr/content.js +7 -0
  30. package/src/components/JfbThirdRideGenOrder/cusAttr/style.js +7 -0
  31. package/src/components/JfbThirdRideHome/Api.js +44 -0
  32. package/src/components/JfbThirdRideHome/Attr.js +17 -0
  33. package/src/components/JfbThirdRideHome/JfbThirdRideHome.vue +831 -0
  34. package/src/components/JfbThirdRideHome/JfbThirdRideHomeLess.less +80 -0
  35. package/src/components/JfbThirdRideHome/JfbThirdRideHomeMixin.js +30 -0
  36. package/src/components/JfbThirdRideHome/Mock.js +13 -0
  37. package/src/components/JfbThirdRideHome/cusAttr/advanced.js +52 -0
  38. package/src/components/JfbThirdRideHome/cusAttr/content.js +27 -0
  39. package/src/components/JfbThirdRideHome/cusAttr/style.js +7 -0
  40. package/src/components/JfbThirdRideLand/Api.js +58 -0
  41. package/src/components/JfbThirdRideLand/Attr.js +17 -0
  42. package/src/components/JfbThirdRideLand/JfbThirdRideLand.vue +256 -0
  43. package/src/components/JfbThirdRideLand/JfbThirdRideLandLess.less +80 -0
  44. package/src/components/JfbThirdRideLand/JfbThirdRideLandMixin.js +30 -0
  45. package/src/components/JfbThirdRideLand/Mock.js +13 -0
  46. package/src/components/JfbThirdRideLand/cusAttr/advanced.js +22 -0
  47. package/src/components/JfbThirdRideLand/cusAttr/content.js +60 -0
  48. package/src/components/JfbThirdRideLand/cusAttr/style.js +109 -0
  49. package/src/components/JfbThirdRideRecord/Api.js +33 -0
  50. package/src/components/JfbThirdRideRecord/Attr.js +17 -0
  51. package/src/components/JfbThirdRideRecord/JfbThirdRideRecord.vue +533 -0
  52. package/src/components/JfbThirdRideRecord/JfbThirdRideRecordLess.less +80 -0
  53. package/src/components/JfbThirdRideRecord/JfbThirdRideRecordMixin.js +30 -0
  54. package/src/components/JfbThirdRideRecord/Mock.js +44 -0
  55. package/src/components/JfbThirdRideRecord/cusAttr/advanced.js +22 -0
  56. package/src/components/JfbThirdRideRecord/cusAttr/content.js +27 -0
  57. package/src/components/JfbThirdRideRecord/cusAttr/style.js +7 -0
  58. package/src/components/JfbThirdRideStartEnd/Api.js +20 -0
  59. package/src/components/JfbThirdRideStartEnd/Attr.js +17 -0
  60. package/src/components/JfbThirdRideStartEnd/JfbThirdRideStartEnd.vue +382 -0
  61. package/src/components/JfbThirdRideStartEnd/JfbThirdRideStartEndLess.less +80 -0
  62. package/src/components/JfbThirdRideStartEnd/JfbThirdRideStartEndMixin.js +30 -0
  63. package/src/components/JfbThirdRideStartEnd/Mock.js +17 -0
  64. package/src/components/JfbThirdRideStartEnd/cusAttr/advanced.js +22 -0
  65. package/src/components/JfbThirdRideStartEnd/cusAttr/content.js +27 -0
  66. package/src/components/JfbThirdRideStartEnd/cusAttr/style.js +7 -0
  67. package/src/mixins/getCoordinatesMixins.js +407 -0
@@ -0,0 +1,27 @@
1
+ 'use strict';
2
+ import { dataVal } from "@/utils/AttrTools";
3
+
4
+ export default (data, gValue, gColor, oldData) => {
5
+ return [
6
+ //内容
7
+ {
8
+ label: "业务线",
9
+ ele: "xd-choose-namespace",
10
+ valueKey: "xnamespace",
11
+ value: dataVal({data, key:'xnamespace', dValue:"", gValue}),
12
+ groupKey:'content',
13
+ className: 'input80',
14
+ labelInline:true,
15
+ placeholder: '请选择业务线',
16
+ notice: '空继承上级业务线',
17
+ inline: false,
18
+ handleCustom: (cb) => {
19
+ XdBus.getParentApi('getOptionsNamespaces')()
20
+ .then(res => {
21
+ cb(res.list)
22
+ })
23
+ .catch();
24
+ }
25
+ },
26
+ ].filter(i=>i)
27
+ }
@@ -0,0 +1,7 @@
1
+ 'use strict';
2
+
3
+ export default (data, gValue, gColor, oldData) => {
4
+ return [
5
+ //风格
6
+ ].filter(i=>i)
7
+ }
@@ -0,0 +1,21 @@
1
+ 'use strict';
2
+ /**
3
+ * @description 接口配置,
4
+ * 在设置方法名字当时候,别忘记加上【模块名字】:Ride
5
+ * @type {*[]}
6
+ */
7
+ module.exports = [
8
+ {
9
+ mapFnName: 'rideOrderDetail',
10
+ title: "打车 - 订单详情(轮询用)",
11
+ path: "/thirdmall-pb/v1/:channel_code/ride/order-result",
12
+ isRule: false,
13
+ data: {
14
+ channel_code: ['渠道编码', 'String', '必选','amapcar'],
15
+ xnamespace: ['业务线', 'String', true],
16
+ channel_order_id: ['订单ID', 'String', true],
17
+ },
18
+ isConsole: true,
19
+ disabled: true,
20
+ }
21
+ ];
@@ -0,0 +1,17 @@
1
+ 'use strict';
2
+
3
+ import style from "./cusAttr/style";
4
+ import advanced from "./cusAttr/advanced";
5
+ import content from "./cusAttr/content";
6
+
7
+ export default {
8
+ style: [],
9
+ advanced: [],
10
+ content: (data, gValue, gColor, oldData={})=>{
11
+ return [
12
+ ...content(data, gValue, gColor, oldData),
13
+ ...style(data, gValue, gColor, oldData),
14
+ ...advanced(data, gValue, gColor, oldData),
15
+ ].filter(i=>i)
16
+ },
17
+ }
@@ -0,0 +1,234 @@
1
+ <template>
2
+ <view
3
+ class="jfb-third-ride-gen-order"
4
+ @click="handleEditxSelect"
5
+ :class="{ editx : isEditx && active }"
6
+ >
7
+ <!--#ifdef H5-->
8
+ <view
9
+ class="jfb-third-ride-gen-order__edit"
10
+ :class="{ editx : isEditx && active }"
11
+ v-if="isEditx && active"
12
+ >
13
+ <view class="jfb-third-ride-gen-order__edit-icon" @click.stop="delEdit">
14
+ <xd-font-icon icon="iconshanchu-01" color="#fff" size="30"></xd-font-icon>
15
+ </view>
16
+ </view>
17
+ <!-- #endif -->
18
+ <view class="jfb-third-ride-gen-order__body">
19
+ <!-- 加载中 -->
20
+ <view class="gen-loading">
21
+ <view class="gen-loading__spinner"></view>
22
+ <text class="gen-loading__title">订单生成中</text>
23
+ <text class="gen-loading__subtitle">请勿关闭页面</text>
24
+ </view>
25
+ </view>
26
+ </view>
27
+ </template>
28
+
29
+ <script>
30
+ import XdFontIcon from "@/components/XdFontIcon/XdFontIcon";
31
+ import { jfbRootExec } from "@/utils/xd.event";
32
+ import JfbThirdRideGenOrderMixin from "./JfbThirdRideGenOrderMixin";
33
+ import { getContainerPropsValue } from "@/utils/xd.base";
34
+ import componentsMixins from "@/mixins/componentsMixins";
35
+ import extsMixins from "@/mixins/extsMixins";
36
+ export default {
37
+ name: "JfbThirdRideGenOrder",
38
+ components: {
39
+ XdFontIcon
40
+ },
41
+ mixins: [
42
+ componentsMixins, extsMixins, JfbThirdRideGenOrderMixin
43
+ ],
44
+ data() {
45
+ return {
46
+ xnamespace: '',
47
+ channelCode: 'amapcar',
48
+ channelOrderId: '',
49
+ pollingTimer: null,
50
+ pollingCount: 0,
51
+ maxPollingCount: 60,
52
+ pollingInterval: 2000,
53
+ orderReady: false,
54
+ payDiffPath: '',
55
+ paySuccessPath: ''
56
+ }
57
+ },
58
+ watch: {
59
+ container(value, oldValue) {
60
+ if (JSON.stringify(value) === JSON.stringify(oldValue)) return;
61
+ if (this.$configProject['isPreview']) this.init(value)
62
+ },
63
+ },
64
+ created() {
65
+ this.init(this.container);
66
+ },
67
+ beforeDestroy() {
68
+ this.stopPolling();
69
+ },
70
+ methods: {
71
+ onJfbLoad(options) {
72
+ this.setNameSpace(options);
73
+ this.channelOrderId = options.channel_order_id || options.order_id || '';
74
+ if (this.channelOrderId) {
75
+ this.startPolling();
76
+ }
77
+ },
78
+ /**
79
+ * @description 开始轮询订单生成结果
80
+ */
81
+ startPolling() {
82
+ this.pollingCount = 0;
83
+ this.orderReady = false;
84
+ this.polling();
85
+ },
86
+ /**
87
+ * @description 轮询订单状态
88
+ */
89
+ polling() {
90
+ if (this.orderReady) return;
91
+ if (this.pollingCount >= this.maxPollingCount) {
92
+ this.$xdToast({ title: '订单生成超时,请查看出行记录' });
93
+ return;
94
+ }
95
+ this.pollingCount++;
96
+ jfbRootExec("rideOrderDetail", {
97
+ vm: this,
98
+ data: {
99
+ channel_code: this.channelCode,
100
+ xnamespace: this.xnamespace,
101
+ channel_order_id: this.channelOrderId
102
+ }
103
+ }).then(res => {
104
+ if (res && res.main_order_id) {
105
+ this.orderReady = true;
106
+ this.stopPolling();
107
+ this.handleOrderResult(res);
108
+ } else {
109
+ this.pollingTimer = setTimeout(() => {
110
+ this.polling();
111
+ }, this.pollingInterval);
112
+ }
113
+ }).catch(() => {
114
+ this.pollingTimer = setTimeout(() => {
115
+ this.polling();
116
+ }, this.pollingInterval);
117
+ });
118
+ },
119
+ /**
120
+ * @description 处理订单结果,判断是否需要补差支付
121
+ */
122
+ handleOrderResult(res) {
123
+ // 需要补差支付
124
+ if (res.need_pay_price > 0 && this.payDiffPath) {
125
+ this.$xdUniHelper.redirectTo({
126
+ url: this.payDiffPath + '?order_id=' + res.pay_order_id
127
+ });
128
+ return;
129
+ }
130
+ // 订单生成成功,跳转到支付成功页
131
+ if (this.paySuccessPath) {
132
+ this.$xdUniHelper.redirectTo({
133
+ url: this.paySuccessPath + '?order_id=' + res.main_order_id
134
+ });
135
+ }
136
+ },
137
+ /**
138
+ * @description 停止轮询
139
+ */
140
+ stopPolling() {
141
+ if (this.pollingTimer) {
142
+ clearTimeout(this.pollingTimer);
143
+ this.pollingTimer = null;
144
+ }
145
+ },
146
+ /**
147
+ * @description 监听事件变化
148
+ * @param container {object} 业务组件对象自己
149
+ */
150
+ init(container) {
151
+ this.xnamespace = getContainerPropsValue(container, 'content.xnamespace', this.projectAttr.business_code || '');
152
+ this.payDiffPath = getContainerPropsValue(container, 'advanced.payDiffPath', {value: ""}).value;
153
+ this.paySuccessPath = getContainerPropsValue(container, 'advanced.paySuccessPath', {value: ""}).value;
154
+ },
155
+ onJfbScroll(options) {
156
+ console.log('event.onJfbScroll', options)
157
+ },
158
+ onJfbReachBottom(options) {
159
+ console.log('event.onJfbReachBottom', options)
160
+ },
161
+ onJfbShow(options) {
162
+ console.log('event.onJfbShow', options)
163
+ },
164
+ onJfbHide(options) {
165
+ console.log('event.onJfbHide', options)
166
+ },
167
+ onJfbBack(options) {
168
+ console.log('event.onJfbBack', options)
169
+ },
170
+ onJfbUpdate(...data) {
171
+ console.log('event.onJfbUpdate', data)
172
+ },
173
+ onJfbCustomEvent(options) {
174
+ console.log('event.onJfbReachBottom', options)
175
+ },
176
+ }
177
+ }
178
+
179
+ </script>
180
+
181
+ <style scoped lang="less">
182
+ @import "./JfbThirdRideGenOrderLess.less";
183
+
184
+ .jfb-third-ride-gen-order {
185
+ background: #FFFFFF;
186
+ min-height: 100vh;
187
+
188
+ &__body {
189
+ display: flex;
190
+ align-items: center;
191
+ justify-content: center;
192
+ min-height: 100vh;
193
+ }
194
+ }
195
+
196
+ // 加载动画
197
+ .gen-loading {
198
+ display: flex;
199
+ flex-direction: column;
200
+ align-items: center;
201
+ justify-content: center;
202
+
203
+ &__spinner {
204
+ width: 64rpx;
205
+ height: 64rpx;
206
+ border: 6rpx solid #E8E8E8;
207
+ border-top-color: #554BE6;
208
+ border-radius: 50%;
209
+ animation: gen-spin 0.8s linear infinite;
210
+ margin-bottom: 32rpx;
211
+ }
212
+
213
+ &__title {
214
+ font-size: 32rpx;
215
+ font-weight: 600;
216
+ color: #333333;
217
+ margin-bottom: 16rpx;
218
+ }
219
+
220
+ &__subtitle {
221
+ font-size: 24rpx;
222
+ color: #999999;
223
+ }
224
+ }
225
+
226
+ @keyframes gen-spin {
227
+ 0% {
228
+ transform: rotate(0deg);
229
+ }
230
+ 100% {
231
+ transform: rotate(360deg);
232
+ }
233
+ }
234
+ </style>
@@ -0,0 +1,80 @@
1
+ /**
2
+ * @desc 获取绝对路径完整地址
3
+ * @param @path
4
+ **/
5
+ //例如:https://image.jufubao.cn/20220501010108/image/bg/default_gonghui_bg.png
6
+ @basePath: 'business/';
7
+ @doMain: '//sandbox-img.jufubao.cn/';
8
+
9
+ .getBusinessImageUrl(@path, @size: 'size8') {
10
+ @url: "@{doMain}@{basePath}@{path}?x-oss-process=style/@{size}";
11
+ background-image: url(@url);
12
+ }
13
+
14
+ //start
15
+ .jfb-third-ride-gen-order {
16
+ box-sizing: border-box;
17
+
18
+ &__body{
19
+ position: relative;
20
+ overflow: hidden;
21
+ z-index: 2
22
+ }
23
+
24
+ &.editx,&.editx:hover {
25
+ position: relative;
26
+ min-height: unit(100, rpx);
27
+ z-index: 3;
28
+ &::after {
29
+ border: 2rpx dashed blue;
30
+ content: " ";
31
+ position: absolute;
32
+ top:0;
33
+ left:0;
34
+ bottom:0;
35
+ right:0;
36
+ z-index: var(--preview-z-index);
37
+ cursor: pointer;
38
+ }
39
+
40
+ }
41
+
42
+
43
+ &__edit {
44
+ cursor: pointer;
45
+ position: absolute;
46
+ right: unit(0, rpx);
47
+ top: unit(0, rpx);
48
+ height: unit(50, rpx);
49
+ z-index: 100;
50
+ display: flex;
51
+ justify-content: center;
52
+ align-items: center;
53
+ background: rgba(0, 0, 0, .4);
54
+ border-radius: 0 0 0 20rpx;
55
+ box-shadow: 0 0 10px rbga(0, 0, 0, 0.3);
56
+ color: #fff;
57
+ font-size: unit(22, rpx);
58
+ padding: 0 6rpx 0 6px;
59
+
60
+ &-icon{
61
+ padding: 0 unit(20, rpx);
62
+ }
63
+
64
+ &.editx {
65
+ box-sizing: border-box;
66
+
67
+ }
68
+ }
69
+ }
70
+ //end
71
+
72
+
73
+ /**notPreview**/
74
+ .jfb-third-ride-gen-order {
75
+ //&:before {
76
+ //content: " ";
77
+ //display: table;
78
+ //}
79
+ }
80
+ /**endNotPreview**/
@@ -0,0 +1,30 @@
1
+ 'use strict';
2
+
3
+
4
+ //@AttrImport
5
+ import Attr from "./Attr";
6
+ //@EndAttrImport
7
+
8
+
9
+ export default {
10
+ data() {
11
+ return {
12
+ //#ifdef H5
13
+
14
+ //@AttrData
15
+ Attr:{}, //对外开发编辑属性
16
+ //@EndAttrData
17
+
18
+ // #endif
19
+ cssRoot: 'jfb-third-ride-gen-order'
20
+ }
21
+ },
22
+ created() {
23
+
24
+ //@AttrDataCreated
25
+ this.Attr = this.$xdUniHelper.customClone(Attr);
26
+ //@EndAttrDataCreated
27
+
28
+
29
+ },
30
+ }
@@ -0,0 +1,11 @@
1
+ 'use strict';
2
+
3
+ module.exports = {
4
+
5
+ rideOrderDetail: {
6
+ main_order_id: 'mock_main_order_001',
7
+ pay_order_id: 'mock_pay_order_001',
8
+ need_pay_price: 500,
9
+ },
10
+
11
+ }
@@ -0,0 +1,37 @@
1
+ 'use strict';
2
+
3
+ export default (data, gValue, gColor, oldData) => {
4
+ return [
5
+ //高级
6
+ {
7
+ label: '支付补差路径',
8
+ groupKey:'advanced',
9
+ className: 'input100',
10
+ ele: 'xd-select-pages-path',
11
+ valueKey: 'payDiffPath',
12
+ placeholder: '请选择需要补差支付时跳转路径',
13
+ labelInline: true,
14
+ inline: false,
15
+ value: data['payDiffPath'] || null,
16
+ setting: {
17
+ mode:'new',
18
+ router: XdBus.getParentApi('getPagesTree')
19
+ },
20
+ },
21
+ {
22
+ label: '支付成功路径',
23
+ groupKey:'advanced',
24
+ className: 'input100',
25
+ ele: 'xd-select-pages-path',
26
+ valueKey: 'paySuccessPath',
27
+ placeholder: '请选择支付成功后跳转路径',
28
+ labelInline: true,
29
+ inline: false,
30
+ value: data['paySuccessPath'] || null,
31
+ setting: {
32
+ mode:'new',
33
+ router: XdBus.getParentApi('getPagesTree')
34
+ },
35
+ },
36
+ ].filter(i=>i)
37
+ }
@@ -0,0 +1,7 @@
1
+ 'use strict';
2
+
3
+ export default (data, gValue, gColor, oldData) => {
4
+ return [
5
+ //内容
6
+ ].filter(i=>i)
7
+ }
@@ -0,0 +1,7 @@
1
+ 'use strict';
2
+
3
+ export default (data, gValue, gColor, oldData) => {
4
+ return [
5
+ //风格
6
+ ].filter(i=>i)
7
+ }
@@ -0,0 +1,44 @@
1
+ 'use strict';
2
+ /**
3
+ * @description 接口配置,
4
+ * 在设置方法名字当时候,别忘记加上【模块名字】:Ride
5
+ * @type {*[]}
6
+ */
7
+ module.exports = [
8
+ {
9
+ //设置方法名字当别忘记加上【模块名字】:Ride
10
+ mapFnName: 'getRideReservationTime',
11
+ title: '打车 - 查询可预约时间',
12
+ path: '/thirdmall-pb/v1/:channel_code/ride/reservation-time',
13
+ isRule: false,
14
+ data: {
15
+ channel_code: ['渠道编码', 'String', '必选','amapcar'],
16
+ },
17
+ isConsole: true,
18
+ disabled: true,
19
+ },
20
+ {
21
+ //设置方法名字当别忘记加上【模块名字】:Ride
22
+ mapFnName: 'getRideEstimatePrice',
23
+ title: '打车 - 查询估价',
24
+ path: '/thirdmall/v1/:xnamespace/:channel_code/ride/estimate-price',
25
+ isRule: false,
26
+ data: {
27
+ channel_code: ['渠道编码', 'String', '必选','amapcar'],
28
+ xnamespace: ['命名空间', 'String', '必选'],
29
+ start_lng: ['起始经度', 'String', '必选'],
30
+ end_lng: ['结束经度', 'String', '必选'],
31
+ start_lat: ['起始纬度', 'String', '必选'],
32
+ end_lat: ['结束纬度', 'String', '必选'],
33
+ start_name: ['起始地址', 'String', '必选'],
34
+ end_name: ['结束地址', 'String', '必选'],
35
+ start_address: ['起始地址', 'String', '必选'],
36
+ end_address: ['结束地址', 'String', '必选'],
37
+ service_type: ['业务类型: 1实时/2预约/3接机/4送机/8代驾', 'String', '必选'],
38
+ ride_types: ['运力类型', 'String', '必选','1,12,3,4'],
39
+ departure_time: ['出发时间', 'String', '可选'],
40
+ },
41
+ isConsole: true,
42
+ disabled: true,
43
+ },
44
+ ];
@@ -0,0 +1,17 @@
1
+ 'use strict';
2
+
3
+ import style from "./cusAttr/style";
4
+ import advanced from "./cusAttr/advanced";
5
+ import content from "./cusAttr/content";
6
+
7
+ export default {
8
+ style: [],
9
+ advanced: [],
10
+ content: (data, gValue, gColor, oldData={})=>{
11
+ return [
12
+ ...content(data, gValue, gColor, oldData),
13
+ ...style(data, gValue, gColor, oldData),
14
+ ...advanced(data, gValue, gColor, oldData),
15
+ ].filter(i=>i)
16
+ },
17
+ }