jufubao-base 1.0.218 → 1.0.220-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.
@@ -0,0 +1,284 @@
1
+ <template>
2
+ <view
3
+ class="jfb-base-notice-dialog"
4
+ @click="handleEditxSelect"
5
+ :class="{ editx: isEditx && active }"
6
+ >
7
+ <!--#ifdef H5-->
8
+ <view
9
+ class="jfb-base-notice-dialog__edit"
10
+ :class="{ editx: isEditx && active }"
11
+ v-if="isEditx && active"
12
+ >
13
+ <view class="jfb-base-notice-dialog__edit-icon" @click="delEdit"
14
+ >删除</view
15
+ >
16
+ </view>
17
+ <!-- #endif -->
18
+ <view class="jfb-base-notice-dialog__body">
19
+ <view v-if="isShow && contentList && contentList.length" class="jfb-base-notice-dialog__body_dialog">
20
+ <view
21
+ class="jfb-base-notice-dialog__body_dialog_mask"
22
+ @click.stop="handleMaskHide"
23
+ ></view>
24
+ <view class="jfb-base-notice-dialog__body_dialog_content">
25
+ <xd-font-icon
26
+ @click.stop="handleClose"
27
+ v-if="close_position === 'right'"
28
+ class="close-top"
29
+ icon="iconguanbi_xian"
30
+ color="#fff"
31
+ size="64"
32
+ ></xd-font-icon>
33
+ <image
34
+ @click="handleToLink"
35
+ mode="widthFix"
36
+ :src="currentImage"
37
+ ></image>
38
+ <xd-font-icon
39
+ @click.stop="handleClose"
40
+ v-if="close_position === 'bottom'"
41
+ class="close-bottom"
42
+ icon="iconguanbi_xian"
43
+ color="#fff"
44
+ size="64"
45
+ ></xd-font-icon>
46
+ </view>
47
+ </view>
48
+ <view
49
+ :style="{ background: backgroundColor, color: warningColor }"
50
+ class="jfb-base-notice-dialog__body-pop"
51
+ v-if="isPreview"
52
+ >弹框方便编辑(占位),在线上此模块不显</view
53
+ >
54
+ </view>
55
+ </view>
56
+ </template>
57
+
58
+ <script>
59
+ import XdFontIcon from "@/components/XdFontIcon/XdFontIcon";
60
+ import { jfbRootExec } from "@/utils/xd.event";
61
+ import JfbBaseNoticeDialogMixin from "./JfbBaseNoticeDialogMixin";
62
+ import { getContainerPropsValue } from "@/utils/xd.base";
63
+ import componentsMixins from "@/mixins/componentsMixins";
64
+ import extsMixins from "@/mixins/extsMixins";
65
+ import getServiceUrl from "@/common/getServiceUrl";
66
+ import storage from "@/common/storage";
67
+ const Color = require("color");
68
+ export default {
69
+ name: "JfbBaseNoticeDialog",
70
+ components: {
71
+ XdFontIcon,
72
+ },
73
+ mixins: [componentsMixins, extsMixins, JfbBaseNoticeDialogMixin],
74
+ data() {
75
+ return {
76
+ isShow: true,
77
+ backgroundColor: "",
78
+ isPreview: false, //是否预览
79
+ is_hide_dailog: "N",
80
+ time: 3, //小时
81
+ close_position: "",
82
+ type: "",
83
+ currentImage: "",
84
+ currentLinkUrl: "",
85
+ currentIndex: 0,
86
+ contentList: [],
87
+ number: ''
88
+ };
89
+ },
90
+ watch: {
91
+ container(value, oldValue) {
92
+ if (JSON.stringify(value) === JSON.stringify(oldValue)) return;
93
+ if (this.$configProject["isPreview"]) this.init(value);
94
+ },
95
+ is_hide_dailog(value) {
96
+ if (value === "N") {
97
+ storage.remove(this.containerId);
98
+ }
99
+ this.onJfbLoad();
100
+ },
101
+ },
102
+ created() {
103
+ this.isPreview = this.$configProject.isPreview;
104
+ this.backgroundColor = Color(this.warningColor).alpha(0.2).toString();
105
+ this.init(this.container);
106
+
107
+ //todo
108
+ },
109
+ methods: {
110
+ onJfbLoad(options) {
111
+ //预览模式
112
+ if (this.isPreview) {
113
+ if (this.is_hide_dailog === "N") {
114
+ this.getContent();
115
+ } else {
116
+ this.isShow = false;
117
+ }
118
+ return;
119
+ } else {
120
+ if (!storage.get(this.containerId)) this.getContent();
121
+ }
122
+ },
123
+ getContent() {
124
+ jfbRootExec("getListNoticeDialogContent", {
125
+ vm: this,
126
+ data: {
127
+ page_id: this.pageAttr["page_id"], //页面ID
128
+ container_id: this.containerId, //组件ID
129
+ page_size: this.number, //数量
130
+ },
131
+ })
132
+ .then((res) => {
133
+ console.log(res.list, "res.list");
134
+
135
+ //弹窗显示
136
+ if (res.list.length > 0) {
137
+ this.contentList = res.list.map((item) => {
138
+ return JSON.parse(item.content);
139
+ });
140
+ this.currentImage = getServiceUrl(
141
+ this.contentList[0].image_url,
142
+ "size3"
143
+ );
144
+ this.currentLinkUrl = this.getLinkUrl(
145
+ this.contentList[0].redirect_data
146
+ );
147
+ this.currentIndex = 0;
148
+
149
+ this.handlePop();
150
+ }
151
+ })
152
+ .catch((error) => {
153
+ console.error(error);
154
+ });
155
+ },
156
+ getLinkUrl(data) {
157
+ data = JSON.parse(data);
158
+ return `${data.page}?${data.redirect_params}`;
159
+ },
160
+ /**
161
+ * @description 监听事件变化
162
+ * @param container {object} 业务组件对象自己
163
+ */
164
+ init(container) {
165
+ this.time = Number(getContainerPropsValue(container, "content.time", 3));
166
+ this.is_hide_dailog = getContainerPropsValue(
167
+ container,
168
+ "content.is_hide_dailog",
169
+ "N"
170
+ );
171
+ this.close_position = getContainerPropsValue(
172
+ container,
173
+ "content.close_position",
174
+ "right"
175
+ );
176
+ this.type = getContainerPropsValue(container, "content.type", "pop");
177
+ this.number = getContainerPropsValue(container, "content.number", 1);
178
+ },
179
+ handlePop() {
180
+ console.warn(`this.time${this.time * 60 + "分钟"}`);
181
+ storage.set(this.containerId, 1, this.time);
182
+ this.isShow = true;
183
+ },
184
+ handleMaskHide() {
185
+ if (this.isPreview) return;
186
+ this.isShow = false;
187
+ },
188
+ handleClose() {
189
+ //切换下一张,没有下一张,关闭
190
+ if (this.currentIndex === this.contentList.length - 1) {
191
+ this.isShow = false;
192
+ return;
193
+ }
194
+ this.currentIndex = this.currentIndex + 1;
195
+ this.currentLinkUrl = this.getLinkUrl(
196
+ this.contentList[this.currentIndex].redirect_data
197
+ );
198
+ this.currentImage = getServiceUrl(
199
+ this.contentList[this.currentIndex].image_url,
200
+ "size3"
201
+ );
202
+ },
203
+ handleToLink() {
204
+ if (this.isPreview) return;
205
+ this.$xdUniHelper.navigateTo({
206
+ url: this.currentLinkUrl,
207
+ });
208
+ },
209
+ onJfbScroll(options) {
210
+ console.log("event.onJfbScroll", options);
211
+ },
212
+ onJfbReachBottom(options) {
213
+ console.log("event.onJfbReachBottom", options);
214
+ },
215
+ onJfbShow(options) {
216
+ console.log("event.onJfbShow", options);
217
+ },
218
+ onJfbHide(options) {
219
+ console.log("event.onJfbHide", options);
220
+ },
221
+ onJfbBack(options) {
222
+ console.log("event.onJfbBack", options);
223
+ },
224
+ onJfbUpdate(...data) {
225
+ console.log("event.onJfbUpdate", data);
226
+ },
227
+ onJfbCustomEvent(options) {
228
+ console.log("event.onJfbReachBottom", options);
229
+ },
230
+ },
231
+ };
232
+ </script>
233
+
234
+ <style scoped lang="less">
235
+ @import "./JfbBaseNoticeDialogLess.less";
236
+
237
+ .jfb-base-notice-dialog {
238
+ &__body {
239
+ &-pop {
240
+ min-height: 100rpx;
241
+ text-align: center;
242
+ vertical-align: middle;
243
+ color: #666;
244
+ font-size: unit(24, rpx);
245
+ line-height: 100rpx;
246
+ }
247
+ &_dialog {
248
+ position: fixed;
249
+ top: 0;
250
+ left: 0;
251
+ bottom: 0;
252
+ right: 0;
253
+ z-index: 3000;
254
+ &_mask {
255
+ position: absolute;
256
+ top: 0;
257
+ bottom: 0;
258
+ left: 0;
259
+ right: 0;
260
+ background: rgba(0, 0, 0, 0.6);
261
+ }
262
+ &_content {
263
+ position: absolute;
264
+ top: 50%;
265
+ left: 50%;
266
+ transform: translate(-50%, -50%);
267
+ display: flex;
268
+ flex-direction: column;
269
+ & > image {
270
+ width: 730rpx;
271
+ }
272
+ .close-top {
273
+ position: relative;
274
+ right: -40%;
275
+ margin-bottom: 20rpx;
276
+ }
277
+ .close-bottom {
278
+ margin-top: 68rpx;
279
+ }
280
+ }
281
+ }
282
+ }
283
+ }
284
+ </style>
@@ -0,0 +1,79 @@
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-notice-dialog {
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: 4;
37
+ cursor: pointer;
38
+ }
39
+
40
+ }
41
+
42
+
43
+ &__edit {
44
+ cursor: pointer;
45
+ position: absolute;
46
+ right: unit(0, rpx);
47
+ top: unit(-52, rpx);
48
+ height: unit(50, rpx);
49
+ line-height: unit(50, rpx);
50
+ display: flex;
51
+ justify-content: center;
52
+ align-items: center;
53
+ background: rgba(0, 0, 0, .6);
54
+ border-radius: unit(10, rpx);
55
+ box-shadow: 0 0 10px rbga(0, 0, 0, 0.3);
56
+ color: #fff;
57
+ font-size: unit(22, rpx);
58
+
59
+ &-icon{
60
+ padding: 0 unit(20, rpx);
61
+ }
62
+
63
+ &.editx {
64
+ box-sizing: border-box;
65
+
66
+ }
67
+ }
68
+ }
69
+ //end
70
+
71
+
72
+ /**notPreview**/
73
+ .jfb-base-notice-dialog {
74
+ //&:before {
75
+ //content: " ";
76
+ //display: table;
77
+ //}
78
+ }
79
+ /**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-notice-dialog'
20
+ }
21
+ },
22
+ created() {
23
+
24
+ //@AttrDataCreated
25
+ this.Attr = this.$xdUniHelper.customClone(Attr);
26
+ //@EndAttrDataCreated
27
+
28
+
29
+ },
30
+ }
@@ -0,0 +1,5 @@
1
+ 'use strict';
2
+
3
+ module.exports = {
4
+
5
+ }
@@ -38,4 +38,29 @@ module.exports = [
38
38
  isConsole: true,
39
39
  disabled: true,
40
40
  },
41
+ {
42
+ mapFnName: "checkSendStatus",
43
+ path: "/common/v1/valid_code/sms/check-send-status",
44
+ title: "校验验证码发送状态",
45
+ isRule: false,
46
+ data: {
47
+ phone_number: ['手机号', 'String', '必选'],
48
+ biz_name: ['业务名称', 'String', '必选']
49
+ },
50
+ isConsole: true,
51
+ disabled: true,
52
+ },
53
+ {
54
+ mapFnName: "loginJumpPhone",
55
+ path: "/passport/v1/user/login-jump-phone",
56
+ title: "授权登录(跳过手机号验证码)",
57
+ isRule: false,
58
+ data: {
59
+ phone_number: ['手机号', 'String', '必选'],
60
+ provider_id: ['登录方式id', 'Number', '必选'],
61
+ auth_code: ['临时授权码', 'String', '否'],
62
+ },
63
+ isConsole: true,
64
+ disabled: true,
65
+ }
41
66
  ];
@@ -41,6 +41,7 @@
41
41
  '--placeholder-font-color': placeholderFont.color,
42
42
  '--placeholder-font-weight': placeholderFont.fontWeight,
43
43
  'margin-top': '40rpx',
44
+ '--main-color': mainColor,
44
45
  }"
45
46
  >
46
47
  <xd-form-item
@@ -131,6 +132,30 @@
131
132
  @click="toNotLoginHome"
132
133
  >暂不登录,去逛逛</view> -->
133
134
  </view>
135
+ <xd-dialog :show.sync="showDialog"
136
+ :showClose="false"
137
+ maskAutoClose
138
+ :showTitle="false">
139
+ <view class="p_dialog_content">
140
+ <view class="">
141
+ <xd-font-icon icon="iconmingchengtubiao" :size="48" color="#666"></xd-font-icon>
142
+ </view>
143
+ <view class="cont_text">检测到短信发送异常<br/>是否跳过手机号收集?</view>
144
+ </view>
145
+ <view slot="btn" class="btn_foot" style="background-color: #DDD;">
146
+ <view class="btn_item" :style="{
147
+ backgroundColor: '#FFF',
148
+ }"
149
+ @click="p_loginNotJump"
150
+ >不跳过</view>
151
+ <view class="btn_item" :style="{
152
+ backgroundColor: mainColor,
153
+ color: '#FFF'
154
+ }"
155
+ @click="p_loginJumpPhone"
156
+ >跳过</view>
157
+ </view>
158
+ </xd-dialog>
134
159
  </view>
135
160
  </view>
136
161
  </template>
@@ -147,6 +172,7 @@ import XdForm from "@/components/XdForm/XdForm";
147
172
  import XdFormInput from "@/components/XdFormInput/XdFormInput";
148
173
  import XdButton from "@/components/XdButton/XdButton";
149
174
  import XdFormCheckbox from "@/components/XdFormCheckbox/XdFormCheckbox";
175
+ import XdDialog from "@/components/XdDailog/XdDailog";
150
176
  //#ifdef H5
151
177
  import cookie from "@/common/cookie";
152
178
  //#endif
@@ -164,6 +190,7 @@ export default {
164
190
  XdFormInput,
165
191
  XdButton,
166
192
  XdFormCheckbox,
193
+ XdDialog
167
194
  },
168
195
  mixins: [componentsMixins, extsMixins, JfbBasePhoneLoginMixin],
169
196
  data() {
@@ -179,6 +206,7 @@ export default {
179
206
  provider_id: "",
180
207
  callback_url: "",
181
208
  isCollectUsername: false,
209
+ showDialog: false,
182
210
 
183
211
  inputStyle: "linear", //输入框样式 linear:线性 face: 面性
184
212
  formBorderColor: "#F9F9F9", //
@@ -493,6 +521,7 @@ export default {
493
521
  },
494
522
  })
495
523
  .then((res) => {
524
+ this.p_checkSendStatus(phone_number);
496
525
  this.$xdHideLoading();
497
526
  this.jfbTimeer = 120;
498
527
  this.interval = setInterval(() => {
@@ -507,6 +536,44 @@ export default {
507
536
  this.$xdLog.catch(error);
508
537
  });
509
538
  },
539
+ p_checkSendStatus(phone_number){
540
+ jfbRootExec("checkSendStatus", {
541
+ vm: this,
542
+ data: {
543
+ phone_number
544
+ }
545
+ }).then(res => {
546
+ if(res.data && res.data.is_jump === 'Y'){
547
+ this.showDialog = true;
548
+ }
549
+ })
550
+ },
551
+ p_loginNotJump(){
552
+ this.showDialog = false;
553
+ },
554
+ p_loginJumpPhone(){
555
+ const { auth_code, provider_id } = this;
556
+ const { phone_number } = this.accountForm;
557
+ this.$xdShowLoading({});
558
+ jfbRootExec("loginJumpPhone", {
559
+ vm: this,
560
+ data: {
561
+ auth_code,
562
+ provider_id,
563
+ phone_number,
564
+ }
565
+ }).then(res => {
566
+ this.$xdHideLoading();
567
+ let { callback_url } = this;
568
+ if (callback_url) callback_url = decodeURIComponent(callback_url);
569
+ this.$xdUniHelper.redirectTo({
570
+ url: callback_url || this.settings.index,
571
+ });
572
+ }).catch((error) => {
573
+ this.$xdHideLoading();
574
+ this.$xdLog.catch(error);
575
+ });
576
+ },
510
577
  doLoginForm() {
511
578
  const { auth_code, provider_id } = this;
512
579
  const { phone_number, verification_code, user_name } = this.accountForm;
@@ -564,6 +631,35 @@ export default {
564
631
 
565
632
  .jfb-base-phone-login {
566
633
  &__body {
634
+ ::v-deep .xd-dailog__body-content{
635
+ padding: 2rpx;
636
+ overflow: hidden;
637
+ }
638
+ .p_dialog_content{
639
+ padding: 100rpx 0rpx;
640
+ display: flex;
641
+ align-items: center;
642
+ justify-content: center;
643
+ .cont_text{
644
+ text-align: left;
645
+ margin-left: 12rpx;
646
+ font-size: 32rpx;
647
+ color: #333;
648
+ }
649
+ }
650
+ .btn_foot{
651
+ width: 100%;
652
+ display: flex;
653
+ .btn_item{
654
+ flex: 1;
655
+ border: 1px solid #E5E5E5;
656
+ height: 96rpx;
657
+ line-height: 96rpx;
658
+ text-align: center;
659
+ font-size: 32rpx;
660
+ }
661
+ }
662
+
567
663
  // #ifdef H5
568
664
  .form-item {
569
665
  ::v-deep &.uni-forms-item {
@@ -336,6 +336,29 @@ export default {
336
336
  ],
337
337
  hidden: data.previewCurrent !== 'card'
338
338
  },
339
+ {
340
+ label: "无票券时是否展示购买新卡入口:",
341
+ ele: "xd-radio",
342
+ valueKey: "isShowBuy",
343
+ value: data.isShowBuy || "N",
344
+ list: [
345
+ { label: "展示", value: "Y" },
346
+ { label: "隐藏", value: "N" }
347
+ ],
348
+ groupKey: "content",
349
+ },
350
+ {
351
+ label: '购买新卡文案:',
352
+ ele: 'el-input',
353
+ type: 'text',
354
+ valueKey: 'buy_name',
355
+ groupKey:'content',
356
+ value: data.buy_name || '',
357
+ placeholder: '请输入购买新卡文案',
358
+ className: 'input80',
359
+ inline: false,
360
+ notice: '当未设置文案时,页面默认展示为"<span style="color:red">购买新卡</span>",建议不超过<span style="color:red">4</span>个汉字'
361
+ },
339
362
  {
340
363
  ele: "title",
341
364
  label: "我的优惠券内容配置",
@@ -1114,6 +1137,18 @@ export default {
1114
1137
  },
1115
1138
  inline: false,
1116
1139
  },
1140
+ {
1141
+ label: '购买新卡地址:',
1142
+ ele: 'xd-select-pages-path',
1143
+ valueKey: 'buy_new_url',
1144
+ groupKey:'advanced',
1145
+ placeholder: '请选择购买新卡地址',
1146
+ value: data.buy_new_url || null,
1147
+ setting: {
1148
+ router: XdBus.getParentApi('getPagesTree'),
1149
+ },
1150
+ inline: false,
1151
+ },
1117
1152
  ].filter(i=>i)
1118
1153
  },
1119
1154
  advanced: [],
@@ -104,7 +104,9 @@
104
104
  </view>
105
105
  <view v-else class="empty_data">
106
106
  <image :src="emptyBg"></image>
107
- 暂无票券
107
+ <view style="display:flex;align-items: center;justify-content: center;">
108
+ 暂无票券 <view v-if="isShowBuy==='Y'" class="buy_new" @click="toBuyNew" :style="{color: mainColor}"><view>{{buy_name}}</view> <xd-font-icon size="20" icon="iconxiangyou_xian"></xd-font-icon></view>
109
+ </view>
108
110
  </view>
109
111
  </view>
110
112
  </template>
@@ -245,6 +247,9 @@
245
247
  cardBtnMinWidth: 100,
246
248
  menuShowType: "text",
247
249
  cardFontColor: "",
250
+ buy_new_url: '',
251
+ isShowBuy: "",
252
+ buy_name: ""
248
253
  }
249
254
  },
250
255
  computed: {
@@ -587,6 +592,9 @@
587
592
  this.noticePadding = getContainerPropsValue(value, "content.noticePadding", {top: 20, left: 20, right: 20, bottom: 20});
588
593
  this.noticeFont = getContainerPropsValue(value, "content.noticeFont", {});
589
594
  this.noticeMoreFont = getContainerPropsValue(value, "content.noticeMoreFont", {});
595
+ this.isShowBuy = getContainerPropsValue(value, "content.isShowBuy", "N");
596
+ this.buy_name = getContainerPropsValue(value, "content.buy_name", "购买新卡");
597
+ this.buy_new_url = getContainerPropsValue(value,"content.buy_new_url",{value: ""}).value;
590
598
 
591
599
  console.log(this.cardShadow, 'cardShadow')
592
600
  if(this.bindCardTextStyle && !this.bindCardTextStyle.color){
@@ -716,6 +724,11 @@
716
724
  url: this.disabledPath
717
725
  })
718
726
  },
727
+ toBuyNew() {
728
+ this.$xdUniHelper.navigateTo({
729
+ url: `${this.buy_new_url}`,
730
+ });
731
+ },
719
732
  onJfbScroll(options) {
720
733
  // console.log('event.onJfbScroll', options)
721
734
  },
@@ -886,6 +899,13 @@
886
899
  flex-direction: column;
887
900
  align-items: center;
888
901
  justify-content: center;
902
+ .buy_new {
903
+ display: flex;
904
+ margin-left: 8rpx;
905
+ & > view:first-child {
906
+ margin-right: 8rpx;
907
+ }
908
+ }
889
909
  & > image {
890
910
  width: unit(460,rpx);
891
911
  height: unit(400,rpx);