jufubao-base 1.0.67 → 1.0.69-beta1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jufubao-base",
3
- "version": "1.0.67",
3
+ "version": "1.0.69-beta1",
4
4
  "private": false,
5
5
  "description": "聚福宝业务组件基础插件包",
6
6
  "main": "index.js",
@@ -0,0 +1,19 @@
1
+ 'use strict';
2
+
3
+ /**
4
+ * @description 卡券登陆
5
+ * @type {*[]}
6
+ */
7
+ module.exports = [
8
+ {
9
+ mapFnName: 'getCouponDialogList', //自定义方法名字(必选)
10
+ title: '获取活动弹框列表',
11
+ path: '/sms/v1/activity/list',
12
+ isRule: false,
13
+ params: {
14
+ namespace: ['业务线', 'String', '必填'],
15
+ },
16
+ isConsole: true,
17
+ disabled: true,
18
+ },
19
+ ];
@@ -0,0 +1,60 @@
1
+ 'use strict';
2
+
3
+ /**
4
+ * @description 当表单组件中有联动操作时候,使用方法进行返回
5
+ */
6
+ export default {
7
+ style: [],
8
+ content:(data) => {
9
+ return [
10
+ {
11
+ label: '选取优惠券列表路径:', //label
12
+ ele: 'xd-select-pages-path', //package 名称
13
+ valueKey: 'list_url', //form[valueKey]
14
+ placeholder: '请选择优惠券列表路径',
15
+ value: data['list_url'] ||null,
16
+ setting: {
17
+ router: XdBus.getParentApi('getPagesTree'),
18
+ },
19
+ inline: false,
20
+ },
21
+ {
22
+ label: '活动提示方式:',
23
+ ele: 'xd-radio',
24
+ valueKey: 'type',
25
+ value: data['type']||1,
26
+ placeholder: '请选择活动提示方式',
27
+ multiple: false,
28
+ className: 'input80',
29
+ list: [
30
+ { label: '弹框', value: 1 },
31
+ { label: '切换', value: 2 },
32
+ ]
33
+ },
34
+ {
35
+ label: '弹窗间隔:',
36
+ ele: 'el-input',
37
+ type: 'text',
38
+ valueKey: 'time',
39
+ value: data.time || '',
40
+ placeholder: '请输入弹窗间隔,默认值:3小时',
41
+ className: 'input80',
42
+ unit: '小时'
43
+ },
44
+ {
45
+ label: '是否隐藏弹框(仅预览模式生效):',
46
+ ele: 'xd-radio',
47
+ valueKey: 'isHide',
48
+ value: data['isHide']||false,
49
+ placeholder: '请选择是否隐藏弹框',
50
+ multiple: false,
51
+ className: 'input80',
52
+ list: [
53
+ { label: '是', value: true },
54
+ { label: '否', value: false },
55
+ ]
56
+ },
57
+ ].filter(i=>i)
58
+ },
59
+ advanced: [],
60
+ };
@@ -0,0 +1,297 @@
1
+ <template>
2
+ <view
3
+ class="jfb-base-con-dialog"
4
+ @click="handleEditxSelect"
5
+ :class="{
6
+ editx: isEditx && active,
7
+ noBorder: noBorder,
8
+ }"
9
+ >
10
+ <!--#ifdef H5-->
11
+ <view
12
+ class="jfb-base-con-dialog__edit"
13
+ :class="{ editx: isEditx && active }"
14
+ v-if="isEditx && active && !noBorder"
15
+ >
16
+ <view class="jfb-base-con-dialog__edit-icon" @click="delEdit">删除</view>
17
+ </view>
18
+ <!-- #endif -->
19
+ <view class="jfb-base-con-dialog__body">
20
+ <view class="jfb-base-con-dialog__body-dialog" v-if="isShow">
21
+ <view class="jfb-base-con-dialog__body-dialog-mask"></view>
22
+ <view class="jfb-base-con-dialog__body-dialog-content">
23
+ <view v-if="list.length>1" class="jfb-base-con-dialog__body-dialog-content-num">
24
+ <text>{{ currentIndex + 1 }}/{{ list.length }}</text>
25
+ </view>
26
+ <view style="display: flex; align-items: center">
27
+ <view
28
+ @click="handleChange('left')"
29
+ v-if="this.type === 2 && this.currentIndex !== 0"
30
+ class="jfb-base-con-dialog__body-dialog-content-left"
31
+ >
32
+ <xd-font-icon icon="iconxiangzuo_xian"></xd-font-icon>
33
+ </view>
34
+ <view class="jfb-base-con-dialog__body-dialog-content-image">
35
+ <image :src="currentImage"></image>
36
+ <image @click="handleToList" :src="currentBtnImage"></image>
37
+ </view>
38
+ <view
39
+ v-if="this.type === 2 && this.currentIndex !== list.length - 1"
40
+ @click="handleChange('right')"
41
+ class="jfb-base-con-dialog__body-dialog-content-right"
42
+ >
43
+ <xd-font-icon icon="iconxiangyou_xian"></xd-font-icon>
44
+ </view>
45
+ </view>
46
+ <xd-font-icon
47
+ @click="handleClose"
48
+ class="jfb-base-con-dialog__body-dialog-content-close"
49
+ icon="iconguanbi_xian"
50
+ color="#fff"
51
+ size="64"
52
+ ></xd-font-icon>
53
+ </view>
54
+ </view>
55
+ <view
56
+ :style="{ background: backgroundColor, color: warningColor }"
57
+ class="jfb-base-con-dialog__body-pop"
58
+ v-if="isPreview"
59
+ >弹框方便编辑(占位),在线上此模块不显</view
60
+ >
61
+ </view>
62
+ </view>
63
+ </template>
64
+
65
+ <script>
66
+ import XdFontIcon from "@/components/XdFontIcon/XdFontIcon";
67
+ import { jfbRootExec, JfbEvent } from "@/utils/xd.event";
68
+ import JfbBaseConDialogMixin from "./JfbBaseConDialogMixin";
69
+ import componentsMixins from "@/mixins/componentsMixins";
70
+ import extsMixins from "@/mixins/extsMixins";
71
+ import { getContainerPropsValue } from "@/utils/xd.base";
72
+ import getServiceUrl from "@/common/getServiceUrl";
73
+ import colorCardMixins from "@/mixins/colorCardMixins";
74
+ const Color = require("color");
75
+ import { mapState } from "vuex";
76
+ import storage from "@/common/storage";
77
+
78
+ export default {
79
+ name: "JfbBaseConDialog",
80
+ components: {
81
+ XdFontIcon,
82
+ },
83
+ mixins: [componentsMixins, extsMixins, JfbBaseConDialogMixin],
84
+ data() {
85
+ return {
86
+ list_url: "",
87
+ list: [],
88
+ currentImage: "",
89
+ currentBtnImage: "",
90
+ currentIndex: 0,
91
+ isShow: false,
92
+ type: "",
93
+ isPreview: false, //是否预览
94
+ activity_id: "",
95
+ backgroundColor: "",
96
+ };
97
+ },
98
+ computed: {
99
+ ...mapState(["pageBusinessCode"]),
100
+ },
101
+ watch: {
102
+ container(value) {
103
+ console.log(value, "aakakakkaka");
104
+ this.init(value);
105
+ },
106
+ },
107
+ created() {
108
+ this.isPreview = this.$configProject.isPreview;
109
+ this.backgroundColor = Color(this.warningColor).alpha(0.2).toString();
110
+ this.init(this.container);
111
+ },
112
+ methods: {
113
+ init(value) {
114
+ this.list_url = getContainerPropsValue(value, "content.list_url", {
115
+ value: "",
116
+ }).value;
117
+ this.type = getContainerPropsValue(value, "content.type", 1);
118
+ this.isHide = getContainerPropsValue(value, "content.isHide", false);
119
+ this.time = Number(getContainerPropsValue(value, "content.time", 3));
120
+ if (this.isPreview) {
121
+ this.isShow = !this.isHide;
122
+ }
123
+ },
124
+ getDialogList() {
125
+ jfbRootExec("getCouponDialogList", {
126
+ vm: this,
127
+ data: {
128
+ namespace: this.pageBusinessCode,
129
+ },
130
+ })
131
+ .then((res) => {
132
+ console.log(res, "resresres");
133
+ this.list = res.list;
134
+ this.currentImage = getServiceUrl(
135
+ this.list[this.currentIndex].app_activity_url
136
+ );
137
+ this.currentBtnImage = getServiceUrl(
138
+ this.list[this.currentIndex].app_activity_button
139
+ );
140
+ this.activity_id = this.list[this.currentIndex].activity_id;
141
+ this.handlePop();
142
+ })
143
+ .catch((err) => {
144
+ console.log(err, "err");
145
+ });
146
+ },
147
+ handlePop() {
148
+ console.log("this.time", this.time * 60 + "分钟");
149
+ storage.set(this.containerId, 1, this.time);
150
+ this.isShow = true;
151
+ },
152
+ onJfbLoad(options) {
153
+ console.log(11111);
154
+ try {
155
+ if (!storage.get(this.containerId)) this.getDialogList();
156
+ } catch (error) {
157
+ console.log(error, "errorerror");
158
+ }
159
+ },
160
+ onJfbUpdate(data) {
161
+ storage.remove(this.containerId);
162
+ this.getDialogList();
163
+ },
164
+ onJfbShow(options) {
165
+ this.isShow=false
166
+ this.onJfbLoad(options);
167
+ },
168
+ handleToList() {
169
+ this.$xdUniHelper.navigateTo({
170
+ url: `${this.list_url}?activity_id=${this.activity_id}&distribution_method=homed`,
171
+ });
172
+ },
173
+ handleClose() {
174
+ //切换下一张,没有下一张,关闭
175
+ if (this.currentIndex == this.list.length - 1 || this.type == 2) {
176
+ this.isShow = false;
177
+ return;
178
+ }
179
+ this.currentIndex = this.currentIndex + 1;
180
+ this.currentImage = getServiceUrl(
181
+ this.list[this.currentIndex].app_activity_url
182
+ );
183
+ this.currentBtnImage = getServiceUrl(
184
+ this.list[this.currentIndex].app_activity_button
185
+ );
186
+ this.activity_id = this.list[this.currentIndex].activity_id;
187
+ },
188
+ handleChange(type) {
189
+ this.currentIndex =
190
+ type === "left" ? this.currentIndex - 1 : this.currentIndex + 1;
191
+ //不小于0,不大于数组长度
192
+ this.currentIndex = Math.max(
193
+ 0,
194
+ Math.min(this.currentIndex, this.list.length - 1)
195
+ );
196
+ this.currentImage = getServiceUrl(
197
+ this.list[this.currentIndex].app_activity_url
198
+ );
199
+ this.currentBtnImage = getServiceUrl(
200
+ this.list[this.currentIndex].app_activity_button
201
+ );
202
+ this.activity_id = this.list[this.currentIndex].activity_id;
203
+ },
204
+ },
205
+ };
206
+ </script>
207
+
208
+ <style scoped lang="less">
209
+ @import "./JfbBaseConDialogLess.less";
210
+
211
+ .jfb-base-con-dialog {
212
+ &__body {
213
+ &-pop {
214
+ min-height: 100rpx;
215
+ text-align: center;
216
+ vertical-align: middle;
217
+ color: #666;
218
+ font-size: unit(24, rpx);
219
+ line-height: 100rpx;
220
+ }
221
+ &-dialog {
222
+ position: fixed;
223
+ top: 0;
224
+ bottom: 0;
225
+ left: 0;
226
+ right: 0;
227
+ z-index: 3000;
228
+
229
+ &-mask {
230
+ position: absolute;
231
+ top: 0;
232
+ bottom: 0;
233
+ left: 0;
234
+ right: 0;
235
+ background: rgba(0, 0, 0, 0.5);
236
+ }
237
+
238
+ &-content {
239
+ max-height: unit(1000, rpx);
240
+ overflow-y: auto;
241
+ overflow-x: hidden;
242
+ position: absolute;
243
+ top: 50%;
244
+ left: 50%;
245
+ transform: translate(-50%, -50%);
246
+ display: flex;
247
+ flex-direction: column;
248
+ &-num {
249
+ margin: 0 auto;
250
+ background: rgba(255, 255, 255, 0.5);
251
+ border-radius: unit(40, rpx);
252
+ padding: unit(8, rpx) unit(24, rpx);
253
+ color: #fff;
254
+ font-size: unit(40, rpx);
255
+ }
256
+ &-close {
257
+ margin: 0 auto;
258
+ }
259
+ &-left {
260
+ background: rgba(255, 255, 255, 0.1);
261
+ padding: unit(40, rpx) unit(10, rpx);
262
+ color: #fff;
263
+ border-radius: unit(40, rpx);
264
+ }
265
+ &-right {
266
+ background: rgba(255, 255, 255, 0.1);
267
+ padding: unit(40, rpx) unit(10, rpx);
268
+ color: #fff;
269
+ border-radius: unit(40, rpx);
270
+ }
271
+ &-image {
272
+ min-width: unit(600, rpx);
273
+ min-height: unit(800, rpx);
274
+ height: unit(800, rpx);
275
+ display: flex;
276
+ align-items: center;
277
+ flex-direction: column;
278
+ margin: 20rpx;
279
+ position: relative;
280
+
281
+ & > image:first-child {
282
+ width: 100%;
283
+ height: 100%;
284
+ }
285
+
286
+ & > image:nth-child(2) {
287
+ width: unit(448, rpx);
288
+ height: unit(70, rpx);
289
+ position: absolute;
290
+ bottom: unit(100, rpx);
291
+ }
292
+ }
293
+ }
294
+ }
295
+ }
296
+ }
297
+ </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-base-con-dialog {
16
+ border: 1px dashed rgba(0, 0, 0, 0);
17
+ box-sizing: border-box;
18
+ min-height: unit(50, rpx);
19
+
20
+ &__body{
21
+ position: relative;
22
+ overflow: hidden;
23
+ z-index: 2
24
+ }
25
+
26
+ &.editx {
27
+ position: relative;
28
+ border: 1px dashed blue;
29
+ box-sizing: border-box;
30
+ z-index: 3
31
+
32
+ }
33
+
34
+ &:hover {
35
+ border: 1px dashed blue;
36
+ }
37
+
38
+ &.noBorder {
39
+ border-color: rgba(0,0,0,0);
40
+ border-width: 0;
41
+ }
42
+
43
+
44
+ &__edit {
45
+ cursor: pointer;
46
+ position: absolute;
47
+ right: unit(0, rpx);
48
+ top: unit(-52, rpx);
49
+ height: unit(50, rpx);
50
+ line-height: unit(50, rpx);
51
+ display: flex;
52
+ justify-content: center;
53
+ align-items: center;
54
+ background: rgba(0, 0, 0, .6);
55
+ border-radius: unit(10, rpx);
56
+ box-shadow: 0 0 10px rbga(0, 0, 0, 0.3);
57
+ color: #fff;
58
+ font-size: unit(22, rpx);
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-base-con-dialog {
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-base-con-dialog'
20
+ }
21
+ },
22
+ created() {
23
+
24
+ //@AttrDataCreated
25
+ this.Attr = this.$xdUniHelper.customClone(Attr);
26
+ //@EndAttrDataCreated
27
+
28
+
29
+ },
30
+ }
@@ -0,0 +1,30 @@
1
+ 'use strict';
2
+
3
+ module.exports = {
4
+ getCouponDialogList: {
5
+ "list": [
6
+ {
7
+ "app_key": "sms-coupon",
8
+ "app_activity_url": "//sandbox-img.jufubao.cn/uploads/20231123/b68d9ff61ffe6cada499d8ad809aaa8d.jpg",
9
+ "app_activity_button": "//sandbox-img.jufubao.cn/uploads/20231123/d9730115b5e1e8047b2b36e69655e745.jpg",
10
+ "background": "background1.png",
11
+ "activity_id": 35,
12
+ },
13
+ {
14
+ "app_key": "sms-coupon",
15
+ "app_activity_url": "//sandbox-img.jufubao.cn/uploads/20231123/b68d9ff61ffe6cada499d8ad809aaa8d.jpg",
16
+ "app_activity_button": "//sandbox-img.jufubao.cn/uploads/20231123/d9730115b5e1e8047b2b36e69655e745.jpg",
17
+ "background": "background1.png",
18
+ "activity_id": 35,
19
+ },
20
+ {
21
+ "app_key": "sms-coupon",
22
+ "app_activity_url": "//sandbox-img.jufubao.cn/uploads/20231123/b68d9ff61ffe6cada499d8ad809aaa8d.jpg",
23
+ "app_activity_button": "//sandbox-img.jufubao.cn/uploads/20231123/d9730115b5e1e8047b2b36e69655e745.jpg",
24
+ "background": "background1.png",
25
+ "activity_id": 35,
26
+ }
27
+ ],
28
+ "request_id": "4b9803ed0ecdc0f6"
29
+ }
30
+ }
@@ -0,0 +1,58 @@
1
+ 'use strict';
2
+
3
+ /**
4
+ * @description 卡券登陆
5
+ * @type {*[]}
6
+ */
7
+ module.exports = [
8
+ {
9
+ mapFnName: 'getListBaseNewsContentCoupon', //自定义方法名字(必选)
10
+ title: '获取内容',
11
+ path: '/cms/v1/news-content',
12
+ isRule: false,
13
+ params: {
14
+ scene: ['使用场景', 'String', '选填'],
15
+ container_id: ['插件ID', 'String', '必填'],
16
+ page_id: ['页面ID', 'String', '必填'],
17
+ page_size: ['记录条数', 'Number', '必填', 1],
18
+ code: ['业务线id', 'String', '选填'],
19
+ },
20
+ isConsole: true,
21
+ disabled: true,
22
+ },
23
+ {
24
+ mapFnName: 'getCouponList', //自定义方法名字(必选)
25
+ title: '获取优惠券列表',
26
+ path: '/sms-coupon/v1/activity-prizes-user/list',
27
+ isRule: false,
28
+ params: {
29
+ distribution_method: ['发放方式 entry=主动发放, homed=首页发放,paid=消费后发放,card_binded=绑定卡后发放', 'String', '选填'],
30
+ namespace: ['业务线', 'String', '必填'],
31
+ },
32
+ isConsole: true,
33
+ disabled: true,
34
+ },
35
+ {
36
+ mapFnName: 'getAllCoupon', //自定义方法名字(必选)
37
+ title: '领取优惠券',
38
+ path: '/sms-coupon/v1/activity-prizes-user/set',
39
+ isRule: false,
40
+ params: {
41
+ distribution_method: ['发放方式 entry=主动发放, homed=首页发放,paid=消费后发放,card_binded=绑定卡后发放', 'String', '选填'],
42
+ namespace: ['业务线', 'String', '必填'],
43
+ },
44
+ isConsole: true,
45
+ disabled: true,
46
+ },
47
+ {
48
+ mapFnName: 'getCouponResult', //自定义方法名字(必选)
49
+ title: '轮询查询活动结果',
50
+ path: '/sms-coupon/v1/activity-prizes-user/get',
51
+ isRule: false,
52
+ params: {
53
+ tmp_order_number: ['tmp_order_number', 'String', '选填'],
54
+ },
55
+ isConsole: true,
56
+ disabled: true,
57
+ },
58
+ ];