jufubao-base 1.0.42 → 1.0.43

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.42",
3
+ "version": "1.0.43",
4
4
  "private": false,
5
5
  "description": "聚福宝业务组件基础插件包",
6
6
  "main": "index.js",
@@ -50,7 +50,7 @@
50
50
  "core-js": "^2.6.5",
51
51
  "flyio": "^0.6.2",
52
52
  "gxd-commands-bussiness": "^1.0.12",
53
- "gxd-uni-library-editx": "1.0.8-beta60",
53
+ "gxd-uni-library-editx": "1.0.8",
54
54
  "jweixin-module": "^1.6.0",
55
55
  "md5": "^2.3.0",
56
56
  "path-to-regexp": "^6.2.1",
@@ -0,0 +1,14 @@
1
+ 'use strict';
2
+
3
+ /**
4
+ * @description 当表单组件中有联动操作时候,使用方法进行返回
5
+ */
6
+ export default {
7
+ style: [],
8
+ content: (data) => {
9
+ return []
10
+ },
11
+ advanced: [
12
+
13
+ ],
14
+ };
@@ -0,0 +1,148 @@
1
+ <template>
2
+ <view
3
+ class="jfb-base-back"
4
+ @click="handleEditxSelect"
5
+ :class="{ editx : isEditx && active }"
6
+ >
7
+ <!--#ifdef H5-->
8
+ <view
9
+ class="jfb-base-back__edit"
10
+ :class="{ editx : isEditx && active }"
11
+ v-if="isEditx && active"
12
+ >
13
+ <view class="jfb-base-back__edit-icon" @click="delEdit">删除</view>
14
+ </view>
15
+ <!-- #endif -->
16
+ <view class="jfb-base-back__body">
17
+ <view class="jfb-base-back__body-content">
18
+ <view class="jfb-base-back__body-content-bg" :style="{opacity:opacity}"></view>
19
+ <view class="jfb-base-back__body-content-icon" @click.stop="onJfbBack" :style="{boxShadow:boxShadow}">
20
+ <xd-font-icon icon="iconxiangzuo_xian" size="32" color="#666"></xd-font-icon>
21
+ </view>
22
+ <view class="jfb-base-back__body-content-text" v-if="title && opacity !== minOpacity" :style="{opacity:opacity}">
23
+ <view >{{title}}</view>
24
+ </view>
25
+ </view>
26
+ </view>
27
+ </view>
28
+ </template>
29
+
30
+ <script>
31
+ import XdFontIcon from "@/components/XdFontIcon/XdFontIcon";
32
+ import JfbBaseBackMixin from "./JfbBaseBackMixin";
33
+ import componentsMixins from "@/mixins/componentsMixins";
34
+ import extsMixins from "@/mixins/extsMixins";
35
+ export default {
36
+ name: "JfbBaseBack",
37
+ components: {
38
+ XdFontIcon
39
+ },
40
+ mixins: [
41
+ componentsMixins, extsMixins, JfbBaseBackMixin
42
+ ],
43
+ data() {
44
+ return {
45
+ opacity: 1,
46
+ height: 90,
47
+ minOpacity: 0,
48
+ shadow: 0,
49
+ title: '',
50
+ }
51
+ },
52
+ computed:{
53
+ boxShadow(){
54
+ return `0 0 ${this.shadow * 20}rpx rgba(0,0,0,.4)`
55
+ }
56
+ },
57
+ watch: {
58
+ container(value) {
59
+ this.init(value)
60
+ }
61
+ },
62
+ created() {
63
+ this.$xdRoot.$on('setTitle', (title)=>{
64
+ this.title = title;
65
+ });
66
+ this.init(this.container);
67
+ },
68
+ methods: {
69
+
70
+ /**
71
+ * @description 监听事件变化
72
+ * @param container {object} 业务组件对象自己
73
+ */
74
+ init(container) {
75
+ //this.bgcolor = getContainerPropsValue(container, 'content.bgcolor', '#fff');
76
+ //this.height = getContainerPropsValue(container, 'content.height', 10);
77
+ },
78
+ onJfbScroll({e,options}) {
79
+ let opacity = (this.height - (e.scrollTop > this.height ? this.height : e.scrollTop)) / 100;
80
+ this.shadow = (e.scrollTop > this.height ? this.height : e.scrollTop)/100;
81
+ this.opacity = opacity < this.minOpacity ? this.minOpacity : opacity;
82
+ },
83
+
84
+ onJfbBack() {
85
+ this.$xdUniHelper.navigateBack();
86
+ }
87
+ }
88
+ }
89
+
90
+ </script>
91
+
92
+ <style scoped lang="less">
93
+ @import "./JfbBaseBackLess.less";
94
+
95
+ .jfb-base-back {
96
+ &__body{
97
+ &-content {
98
+ display: flex;
99
+ justify-content: space-between;
100
+ align-items: center;
101
+ align-content: center;
102
+ height: unit(90, rpx);
103
+ padding: 0 unit(10, rpx);
104
+ position: relative;
105
+
106
+ &-icon {
107
+ width: 1em;
108
+ height: 1em;
109
+ font-size: unit(54, rpx);
110
+ border-radius: 50%;
111
+ overflow: hidden;
112
+ display: flex;
113
+ justify-content: center;
114
+ align-content: center;
115
+ flex-shrink: 0;
116
+ position: relative;
117
+ z-index: 2;
118
+ background: #fff;
119
+ }
120
+
121
+ &-text {
122
+ font-size: unit(54, rpx);
123
+ padding-right: 1em;
124
+ flex: 1;
125
+ position: relative;
126
+ z-index: 2;
127
+ color: #666;
128
+
129
+ & > view {
130
+ width: 100%;
131
+ text-align: center;
132
+ line-height: unit(90, rpx);
133
+ font-size: unit(32, rpx);
134
+ }
135
+ }
136
+
137
+ &-bg {
138
+ background: #fff;
139
+ position: absolute;
140
+ top: 0;
141
+ right:0;
142
+ bottom: 0;
143
+ left: 0;
144
+ }
145
+ }
146
+ }
147
+ }
148
+ </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-back {
16
+ border: 1px dashed rgba(0, 0, 0, 0);
17
+ box-sizing: border-box;
18
+ min-height: unit(100, 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-back {
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-back'
20
+ }
21
+ },
22
+ created() {
23
+
24
+ //@AttrDataCreated
25
+ this.Attr = this.$xdUniHelper.customClone(Attr);
26
+ //@EndAttrDataCreated
27
+
28
+
29
+ },
30
+ }
@@ -508,16 +508,10 @@ export default {
508
508
  };
509
509
  });
510
510
  this.cardList = res.list.filter((item) => {
511
- if (item["is_valid"] !== "N") {
512
- return true;
513
- }
514
- return false;
511
+ return item["is_valid"] === "Y";
515
512
  });
516
513
  this.disableList = res.list.filter((item) => {
517
- if (item["is_valid"] === "N") {
518
- return true;
519
- }
520
- return false;
514
+ return item["is_valid"] === "N";
521
515
  });
522
516
  this.changeList = this.cardList.filter((item) => {
523
517
  return item["is_exchange"] === "Y";
@@ -130,10 +130,7 @@ export default {
130
130
  };
131
131
  });
132
132
  this.disableList = res.list.filter((item) => {
133
- if (item["is_valid"] === "N" || item["card_point"] === 0) {
134
- return true;
135
- }
136
- return false;
133
+ return item["is_valid"] === "N";
137
134
  });
138
135
  this.$xdHideLoading();
139
136
  })
@@ -49,7 +49,6 @@
49
49
  data() {
50
50
  return {
51
51
  entryList: [],
52
- //todo
53
52
  bgcolor: "",
54
53
  rowNum: 1,
55
54
  paddingInput: 20,
@@ -103,11 +102,22 @@
103
102
  item['image_url'] = getServiceUrl(item.image_url);
104
103
  item['image_url2'] = item.image_url2 ? getServiceUrl(item.image_url2) : "";
105
104
  item['image_url3'] = item.image_url3 ? getServiceUrl(item.image_url3) : "";
105
+ let nsp = Base64.encodeURI(JSON.stringify({business_code: item['business_code']}));
106
+
107
+ //外站配置地址
108
+ if(item.redirect_type === 'URL') {
109
+ if(item['redirect_data']['path'].indexOf('?') === -1) {
110
+ item['redirect_data']['path'] = `${item['redirect_data']['path']}?x-common=${nsp}&vs=${new Date().getTime()}`
111
+ }
112
+ else item['redirect_data']['path'] = `${item['redirect_data']['path']}&x-common=${nsp}&vs=${new Date().getTime()}`;
113
+ return item;
114
+ }
115
+
106
116
  let jumpUrl = item.path;
107
117
  //#ifdef H5
108
118
  jumpUrl = `//${host}/${dir}${path}`;
109
119
  //#endif
110
- let nsp = Base64.encodeURI(JSON.stringify({business_code: item['business_code']}));
120
+
111
121
  if(item['redirect_data']['fixed_business_code'] === '') {
112
122
  item['redirect_data']['path'] = `${jumpUrl}?x-common=${nsp}&vs=${new Date().getTime()}`
113
123
  }
@@ -118,25 +128,20 @@
118
128
  });
119
129
  if(res.list.length === 1) this.toLink(this.entryList[0]);
120
130
  if(res.list.length === 0) {
121
- uni.showToast({
122
- title: '当前票券暂无支持服务',
123
- icon: 'none',
124
- duration: 2000
125
- });
131
+ this.$xdAlert({content: '当前票券暂无支持服务'})
126
132
  }
127
-
128
133
  })
129
134
  },
130
135
  toLink(item){
131
136
  let path = "";
132
137
  try{
133
138
  path = item.redirect_data.path || item.redirect_data.app.path;
139
+ this.$xdUniHelper.navigateTo({
140
+ url: path
141
+ })
134
142
  }catch{
135
- throw new Error("路径解析错误")
143
+ this.$xdAlert({content: '链接地址配置错误'})
136
144
  }
137
- this.$xdUniHelper.navigateTo({
138
- url: path
139
- })
140
145
  },
141
146
 
142
147
  onJfbBack(options) {
@@ -0,0 +1,32 @@
1
+ 'use strict';
2
+
3
+ /**
4
+ * @description 合并手机号下绑定卡券到自己明显
5
+ * @type {*[]}
6
+ */
7
+ module.exports = [
8
+ {
9
+ mapFnName: 'sendBaseMergeUserCardMsg',
10
+ title: '发送验证码',
11
+ path: '/common/v1/valid_code/sms/send',
12
+ isRule: false,
13
+ data: {
14
+ phone_number: ['手机号', 'String', '必选'],
15
+ biz_name: ['业务名称', 'String', '必选']
16
+ },
17
+ isConsole: true,
18
+ disabled: true,
19
+ },
20
+ {
21
+ mapFnName: 'mergeUserCardToMy',
22
+ title: "找回卡券",
23
+ path: "/card/v1/card-bind/find-back-card-by-phone",
24
+ isRule: false,
25
+ data: {
26
+ phone_number: ['手机号', 'String', '必选' ],
27
+ verification_code: ['手机验证码', 'String', '必选'],
28
+ },
29
+ isConsole: true,
30
+ disable: true,
31
+ },
32
+ ];
@@ -0,0 +1,25 @@
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: 'callback_url', //form[valueKey]
14
+ value: data['callback_url'] || {},
15
+ setting: {
16
+ router: XdBus.getParentApi('getPagesTree')
17
+ },
18
+ inline: false,
19
+ },
20
+ ].filter(i=>i)
21
+ },
22
+ advanced: [
23
+
24
+ ],
25
+ };