jufubao-base 1.0.2 → 1.0.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/build.json.tpl ADDED
@@ -0,0 +1,103 @@
1
+ {
2
+ "apps": [
3
+ {
4
+ "app_id": "jufubao_base",
5
+ "app_name": "聚福宝业务组件基础插件包",
6
+ "app_version": "1.0.0",
7
+ "parameters": {
8
+ "key1": "value1",
9
+ "key2": "value2"
10
+ },
11
+ "package_json": {
12
+ "dependencies": { },
13
+ "devDependencies": { }
14
+ }
15
+ },
16
+ {
17
+ "app_id": "jufubao_store",
18
+ "app_name": "聚福宝商城业务组件包",
19
+ "app_version": "1.0.0",
20
+ "parameters": {
21
+ "key1": "value1",
22
+ "key2": "value2"
23
+ },
24
+ "package_json": {
25
+ "dependencies": {},
26
+ "devDependencies": {}
27
+ }
28
+ }
29
+ ],
30
+ "routers": [
31
+ {
32
+ "package": "body",
33
+ "pages": [
34
+ {
35
+ "page_id": "00ebc41e-7db4-4253-b012-dadd752f788c",
36
+ "page_name_en": "index",
37
+ "page_name": "首页",
38
+ "page": "body/index/index",
39
+ "components":[
40
+ {
41
+ "id": "jufubao-01",
42
+ "name": "JfbBaseNumber",
43
+ "attrs": {
44
+ "key1": "value1"
45
+ }
46
+ },
47
+ {
48
+ "id": "jufubao-02",
49
+ "name": "JfbBaseNumber",
50
+ "attrs": {
51
+ "key2": "value2"
52
+ }
53
+ }
54
+ ]
55
+ },
56
+ {
57
+ "page_id": "00ebc41e-7db4-4253-b012-dadd752f7891",
58
+ "page_name_en": "type",
59
+ "page_name": "产品分类",
60
+ "page": "body/type/type",
61
+ "components": [
62
+ {
63
+ "id": "jufubao-01",
64
+ "name": "JfbBaseNumber",
65
+ "attrs": {
66
+ "key1": "value1"
67
+ }
68
+ },
69
+ {
70
+ "id": "jufubao-02",
71
+ "name": "JfbBaseNumber",
72
+ "attrs": {
73
+ "key2": "value2"
74
+ }
75
+ }
76
+ ]
77
+ },
78
+ {
79
+ "page_id": "00ebc41e-7db4-4253-b012-dadd752f7887",
80
+ "page_name_en": "my",
81
+ "page_name": "我的",
82
+ "page": "body/my/my",
83
+ "components": [
84
+ {
85
+ "id": "jufubao-01",
86
+ "name": "JfbBaseNumber",
87
+ "attrs": {
88
+ "key1": "value1"
89
+ }
90
+ },
91
+ {
92
+ "id": "jufubao-02",
93
+ "name": "JfbBaseNumber",
94
+ "attrs": {
95
+ "key2": "value2"
96
+ }
97
+ }
98
+ ]
99
+ }
100
+ ]
101
+ }
102
+ ]
103
+ }
package/file.config.js ADDED
@@ -0,0 +1,16 @@
1
+ 'use strict';
2
+ module.exports = {
3
+ /**
4
+ * @type {Number}
5
+ * @description 生成文件路径格式类型
6
+ * 其值:默认:1
7
+ * 1=>使用时间格式
8
+ * 2=>使用固定路径(resource,方便替换发布)
9
+ * 默认:1
10
+ *
11
+ * resource,需要文件替换才可以发布:
12
+ * 1、index.js resource/ => / /@@@@/ => https://domain/dir
13
+ * 2、index.html /@@@@/resource => https://domain/dir
14
+ */
15
+ fileVersionType: 1,
16
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jufubao-base",
3
- "version": "1.0.2",
3
+ "version": "1.0.5",
4
4
  "private": false,
5
5
  "description": "聚福宝业务组件基础插件包",
6
6
  "main": "index.js",
@@ -25,7 +25,7 @@
25
25
  "coder": "node ./build/commands/coder.js",
26
26
  "coder:page": "node ./build/commands/coder.page.js",
27
27
  "init.editx": "node ./build/commands/editx.init.js",
28
- "update.package": "node ./build/commands/update.package.js",
28
+ "update.package": "node ./commands/update.pack.js",
29
29
  "publish.package": "node ./commands/npmignore && npm publish",
30
30
  "create.pack": "node ./commands/create.pack.js"
31
31
  },
@@ -48,7 +48,7 @@
48
48
  "color": "^3.1.3",
49
49
  "core-js": "^2.6.5",
50
50
  "flyio": "^0.6.2",
51
- "gxd-uni-commands": "1.0.20",
51
+ "gxd-uni-commands": "1.0.21",
52
52
  "gxd-uni-library": "1.0.22",
53
53
  "jweixin-module": "^1.6.0",
54
54
  "md5": "^2.3.0",
@@ -0,0 +1,150 @@
1
+ 'use strict';
2
+
3
+ export default [
4
+ //文本信息
5
+ {
6
+ label: '标题名称:', //label
7
+ ele: 'el-input', //package 名称
8
+ type: 'text',
9
+ valueKey: 'title', //form[valueKey]
10
+ value: '', //v-model
11
+ placeholder: '请输入标题名称',
12
+ classNmae: 'input40', //样式名称 //input100,input80,input70,input60,input50,input40,input30,input20,
13
+ disabled: true,
14
+ rules: [
15
+ {
16
+ required: true,
17
+ type: 'url',
18
+ message: '请输入域名地址',
19
+ trigger: 'blur'
20
+ },
21
+ ]
22
+ },
23
+
24
+ //远程获取内容选择
25
+ {
26
+ label: '跳转路径:', //label
27
+ ele: 'xd-select-list', //package 名称
28
+ valueKey: 'jumpToLink', //form[valueKey]
29
+ value: '', //v-model
30
+ placeholder: '请选择加盟商',
31
+ multiple: false, //多选
32
+ collapseTags: false,
33
+ remoteApi: '/api/editx/pages',
34
+ remote: true,
35
+ },
36
+
37
+ //本地固定内容选择
38
+ {
39
+ label: '选择内容:', //label
40
+ ele: 'xd-select-list', //package 名称
41
+ valueKey: 'select', //form[valueKey]
42
+ value: '', //v-model
43
+ placeholder: '请选择选择内容',
44
+ multiple: false, //多选
45
+ remote: false,
46
+ list: [
47
+ {"label": "订单详情", "value": '/main/order/order'},
48
+ {"label": "购物车详情", "value": '/main/cart/cart'},
49
+ {"label": "商品详情", "value": '/main/product/product'},
50
+ {"label": "商品分类", "value": '/main/producttype/producttype'},
51
+ ],
52
+ },
53
+
54
+ //本地固定单选选择
55
+ {
56
+ label: '单选列表(固定):', //label
57
+ ele: 'xd-radio', //package 名称
58
+ valueKey: 'radio_status_list', //form[valueKey]
59
+ value: 6, //v-model
60
+ disabled: true,
61
+ rules: [
62
+ {required: true, message: '请选择', trigger: ['blur', 'change']}
63
+ ],
64
+ list: [
65
+ {"label": "万利达集团", "value": 4},
66
+ {"label": "中国联通", "value": 5},
67
+ {"label": "中国移动", "value": 6},
68
+ {"label": "味多美", "value": 7},
69
+ ]
70
+ },
71
+
72
+ //远程固定单选选择
73
+ {
74
+ label: '单选列表(固定):', //label
75
+ ele: 'xd-radio', //package 名称
76
+ valueKey: 'radio_status_list', //form[valueKey]
77
+ value: 6, //v-model
78
+ disabled: false,
79
+ remoteApi: '/api/editx/pages',
80
+ remote: true,
81
+ rules: [
82
+ {required: true, message: '请选择', trigger: ['blur', 'change']}
83
+ ],
84
+ },
85
+
86
+ //本地固定多选选择
87
+ {
88
+ label: '多选列表(固定):', //label
89
+ ele: 'xd-check', //package 名称
90
+ valueKey: 'xd-check_list', //form[valueKey]
91
+ value: 6, //v-model
92
+ disabled: true,
93
+ rules: [
94
+ {required: true, message: '请选择', trigger: ['blur', 'change']}
95
+ ],
96
+ list: [
97
+ {"label": "万利达集团", "value": 4},
98
+ {"label": "中国联通", "value": 5},
99
+ {"label": "中国移动", "value": 6},
100
+ {"label": "味多美", "value": 7},
101
+ ]
102
+ },
103
+
104
+ //远程多选选选择
105
+ {
106
+ label: '多选列表:', //label
107
+ ele: 'xd-check', //package 名称
108
+ valueKey: 'xd-check_remote-list', //form[valueKey]
109
+ value: 6, //v-model
110
+ disabled: false,
111
+ remoteApi: '/api/editx/pages',
112
+ remote: true,
113
+ rules: [
114
+ {required: true, message: '请选择', trigger: ['blur', 'change']}
115
+ ],
116
+ },
117
+
118
+ //状态(二选一)单选选择
119
+ {
120
+ label: '状态(二选一):', //label
121
+ ele: 'xd-radio-status', //package 名称
122
+ valueKey: 'radio_status', //form[valueKey]
123
+ value: 'Y', //v-model
124
+ isall: true,
125
+ disabled: true,
126
+ backValueType: '', //返回值类型 1=>返回(Y,N)2=> [true|false] 3=>[1,0] 4=>[1,2]
127
+ placeholder: '请选择',
128
+ list: 'status', //status=>状态 best=>推荐 associate=>关联 yes=>是否 open=> 是否开启 check=>审核
129
+ },
130
+
131
+ //文本信息
132
+ {
133
+ label: '标题名称:', //label
134
+ ele: 'el-input', //package 名称
135
+ type: 'text',
136
+ valueKey: 'title', //form[valueKey]
137
+ value: '', //v-model
138
+ placeholder: '请输入标题名称',
139
+ classNmae: 'input40', //样式名称 //input100,input80,input70,input60,input50,input40,input30,input20,
140
+ disabled: true,
141
+ rules: [
142
+ {
143
+ required: true,
144
+ type: 'url',
145
+ message: '请输入域名地址',
146
+ trigger: 'blur'
147
+ },
148
+ ]
149
+ },
150
+ ]
@@ -1,61 +1,75 @@
1
1
  <template>
2
- <view class="jfb-base-baidu">
2
+ <view
3
+ class="jfb-base-baidu"
4
+ @click="handleSelect"
5
+ :class="{ editx : isEditx && active }"
6
+ >
3
7
  <!--#ifdef H5-->
4
- <view class="jfb-base-baidu__edit">
5
- <view class="jfb-base-baidu__edit-icon" @click="showEdit"></view>
8
+ <view
9
+ class="jfb-base-baidu__edit"
10
+ :class="{ editx : isEditx && edit && active }"
11
+ v-if="isEditx && active"
12
+ >
13
+ <view class="jfb-base-baidu__edit-icon" @click="showEdit">
14
+ <xd-font-icon icon="iconmingchengtubiao"></xd-font-icon>
15
+ </view>
6
16
  </view>
7
17
  <!-- #endif -->
8
- <view class="jfb-base-baidu__body"></view>
18
+ <view class="jfb-base-baidu__body">
19
+ <view>测试插件( {{containerId}} )</view>
20
+ </view>
9
21
  </view>
10
22
  </template>
11
23
 
12
24
  <script>
13
25
  import XdFontIcon from "@/components/XdFontIcon/XdFontIcon";
26
+ import { jfbRootExec } from "@/utils/xd.event";
27
+ import JfbBaseBaiduMixin from "./JfbBaseBaiduMixin";
14
28
  export default {
15
29
  name: "JfbBaseBaidu",
16
30
  components: {
17
31
  XdFontIcon
18
32
  },
33
+ mixins: [
34
+ JfbBaseBaiduMixin
35
+ ],
19
36
  data() {
20
37
  return {
21
38
 
22
- //#ifdef H5
23
- Attr: {},
24
- edit: false, //是否开启编辑模式
25
- contentId: null, //容器ID
26
-
27
- // #endif
39
+ //todo
28
40
  }
29
41
  },
30
42
  created() {
31
43
 
32
- //#ifdef H5
33
-
34
- //监听Editx属性编辑模块视图发送变化接受时间
35
- this.contentId = this.$xdUniHelper.randomChar(20);
36
- XdBus.addEvent('attrViewChange', (contentId, data) => {
37
- if (contentId !== this.contentId) this.edit = false
38
- });
39
-
40
- // #endif
44
+ //todo
41
45
  },
42
46
  methods: {
43
-
44
- //#ifdef H5
45
-
46
- /**
47
- * @description 点击视图编辑按钮发送Editx属性编辑面板
48
- */
49
- showEdit() {
50
- if (this.edit) return;
51
- this.edit = true;
52
- XdBus.send('attr', {
53
- Attr: this.$xdUniHelper.cloneDeep(Attr),
54
- contentId: this.contentId,
55
- }, false, 'xd-iframe')
56
- }
57
-
58
- //#endif
47
+ onJfbLoad(options) {
48
+ jfbRootExec('baiduUserLogin', {
49
+ vm: this,
50
+ data: {
51
+ account: 'gaoshiyong',
52
+ password: '123456789',
53
+ type: 3,
54
+ ...options
55
+ }
56
+ }).then().catch()
57
+ },
58
+ onJfbScroll(options) {
59
+ console.log('event.onJfbScroll', options)
60
+ },
61
+ onJfbReachBottom(options) {
62
+ console.log('event.onJfbReachBottom', options)
63
+ },
64
+ onJfbShow(options) {
65
+ console.log('event.onJfbShow', options)
66
+ },
67
+ onJfbHide(options) {
68
+ console.log('event.onJfbHide', options)
69
+ },
70
+ onJfbBack(options) {
71
+ console.log('event.onJfbBack', options)
72
+ },
59
73
  }
60
74
  }
61
75
 
@@ -63,8 +77,30 @@
63
77
 
64
78
  <style scoped lang="less">
65
79
  .jfb-base-baidu {
80
+ border: 1px dashed rgba(0,0,0,0);
81
+ box-sizing: border-box;
82
+
83
+ &.editx {
84
+ position: relative;
85
+ border: 1px dashed #efefef;
86
+ box-sizing: border-box;
87
+ }
88
+
66
89
  &__edit {
90
+ position: absolute;
91
+ right: 0;
92
+ top:0;
93
+ width: unit(80, rpx);
94
+ height: unit(40, rpx);
95
+ display: flex;
96
+ justify-content: center;
97
+ align-items: center;
98
+ border: 1px dashed rgba(0, 0, 0, 0);
67
99
 
100
+ &.editx {
101
+ border: 1px dashed #efefef;
102
+ box-sizing: border-box;
103
+ }
68
104
  }
69
105
 
70
106
  &__body{
@@ -0,0 +1,127 @@
1
+ 'use strict';
2
+
3
+ // #ifdef H5
4
+ import Attr from "./Attr";
5
+ // #endif
6
+
7
+ export default {
8
+ props: {
9
+ layoutInfo: {
10
+ type: Object,
11
+ default() {
12
+ return {}
13
+ }
14
+ },
15
+ pageAtrr: {
16
+ type: Object,
17
+ default() {
18
+ return {}
19
+ }
20
+ },
21
+ componentAtrr: {
22
+ type: Object,
23
+ default() {
24
+ return {}
25
+ }
26
+ },
27
+ appAtrr: {
28
+ type: Object,
29
+ default() {
30
+ return {}
31
+ }
32
+ },
33
+ settings: {
34
+ type: Object,
35
+ default() {
36
+ return {}
37
+ }
38
+ }
39
+ },
40
+ data() {
41
+ return {
42
+
43
+ //#ifdef H5
44
+ Attr, //对外开发编辑属性
45
+ active: false, //是否选择当前状态
46
+ isEditx: true, //当前为Editx模式
47
+ edit: false, //是否开启编辑模式
48
+ containerId: null, //容器ID
49
+ // #endif
50
+ }
51
+ },
52
+ created() {
53
+ //console.log(this.layoutInfo)
54
+
55
+ //#ifdef H5
56
+
57
+ //设置插件ID
58
+ if (this.componentAtrr.id) {
59
+ this.containerId = this.componentAtrr.id;
60
+ } else {
61
+ this.containerId = this.$xdUniHelper.randomChar(20);
62
+ }
63
+
64
+ //监听用户点击状态显示虚框
65
+ XdBus.addEvent('select', ({containerId}) => {
66
+ this.active = containerId === this.containerId;
67
+ });
68
+
69
+ //监听用户点击编辑按钮进行编辑状态显示
70
+ XdBus.addEvent('useEditx', ({containerId}) => {
71
+ this.edit = containerId === this.containerId;
72
+ });
73
+
74
+ // #endif
75
+ },
76
+ methods: {
77
+
78
+ /**
79
+ * 检查插件是否加载成功
80
+ */
81
+ onCheck() {
82
+ },
83
+
84
+ //#ifdef H5
85
+ /**
86
+ * @description 点击视图编辑按钮发送Editx属性编辑面板
87
+ */
88
+ showEdit() {
89
+ if (this.edit) return;
90
+ this.edit = true;
91
+
92
+ //往控制面板传递事件
93
+ XdBus.send('attrViewChange', {
94
+ Attr: this.$xdUniHelper.cloneDeep(Attr),
95
+ containerId: this.containerId,
96
+ }, false, 'xd-iframe');
97
+
98
+ //是否对当前控制面板进行编辑操作
99
+ XdBus.message('useEditx', {
100
+ containerId: this.containerId,
101
+ })
102
+ },
103
+ //#endif
104
+
105
+ /**
106
+ * @description 点击选择插件显示边框
107
+ */
108
+ handleSelect() {
109
+
110
+ //#ifdef H5
111
+ if (this.active) return;
112
+ this.active = true;
113
+ XdBus.message('select', {
114
+ containerId: this.containerId,
115
+ })
116
+
117
+ //#endif
118
+ },
119
+
120
+ /**
121
+ * @description 点击选择插件不显示边框
122
+ */
123
+ handleSelectEmpty(){
124
+ return false
125
+ }
126
+ }
127
+ }
@@ -0,0 +1,29 @@
1
+ 'use strict';
2
+
3
+ module.exports = [
4
+ {
5
+ mapFnName: 'getFilmSquate', //自定义方法名字
6
+ title: '获取电影广场列表',
7
+ path: '/api/account/film/list-film-square',
8
+ isRule: false,
9
+ prefix: 'online',
10
+ params: {
11
+ last_key: ['当前页', 'Number', '必选'],
12
+ page_size: ['每页数量', 'Number', '必选'],
13
+ },
14
+ isConsole: true,
15
+ disabled: true,
16
+ },
17
+ {
18
+ mapFnName: 'getPaiqiDate',
19
+ title: '获取电影排期时间',
20
+ path: '/api/account/film/paiqi-date',
21
+ isRule: false,
22
+ params: {
23
+ film_id: ['电影id', 'Number', '必选'],
24
+ cinema_id: ['影院id', 'Number', '必选'],
25
+ },
26
+ isConsole: true,
27
+ disabled: true,
28
+ },
29
+ ];