jufubao-forms 1.0.0-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/README.md +27 -0
- package/commands.js +84 -0
- package/commands.update.change.js +176 -0
- package/file.config.js +16 -0
- package/get.package.path.js +22 -0
- package/get.package.path.js.tpl +22 -0
- package/package.json +119 -0
- package/src/CreateClientID.js +16 -0
- package/src/ICONS.js +1148 -0
- package/src/common/authorize.js +261 -0
- package/src/common/getBusinessImageUrl.js +39 -0
- package/src/common/getServiceUrl.js +38 -0
- package/src/common/paysdk/jweixin.js +98 -0
- package/src/components/CusCouponChose/CusCouponChose.vue +1024 -0
- package/src/components/CusCouponItem/CusCouponItem.vue +298 -0
- package/src/components/CusEnter/CusEnter.vue +333 -0
- package/src/components/CusPoster/CusPoster.vue +213 -0
- package/src/components/CusPoster/CusSwiperDot.vue +234 -0
- package/src/components/CusProduct/CusProduct.vue +362 -0
- package/src/components/CusSwiperDot/CusSwiperDot.vue +234 -0
- package/src/components/CusTab/CusTab.vue +411 -0
- package/src/components/CusVideo/CusVideo.vue +170 -0
- package/src/components/JfbFormsDynamicForm/Api.js +66 -0
- package/src/components/JfbFormsDynamicForm/Attr.js +35 -0
- package/src/components/JfbFormsDynamicForm/JfbFormsDynamicForm.vue +767 -0
- package/src/components/JfbFormsDynamicForm/JfbFormsDynamicFormLess.less +79 -0
- package/src/components/JfbFormsDynamicForm/JfbFormsDynamicFormMixin.js +30 -0
- package/src/components/JfbFormsDynamicForm/Mock.js +194 -0
- package/src/components/JfbFormsDynamicForm/XdFormDate.vue +71 -0
- package/src/components/JfbFormsDynamicForm/ld-select/ld-select.vue +329 -0
- package/src/components/JfbFormsDynamicForm/uni-datetime-picker/calendar-item.vue +177 -0
- package/src/components/JfbFormsDynamicForm/uni-datetime-picker/calendar.vue +930 -0
- package/src/components/JfbFormsDynamicForm/uni-datetime-picker/i18n/en.json +22 -0
- package/src/components/JfbFormsDynamicForm/uni-datetime-picker/i18n/index.js +8 -0
- package/src/components/JfbFormsDynamicForm/uni-datetime-picker/i18n/zh-Hans.json +22 -0
- package/src/components/JfbFormsDynamicForm/uni-datetime-picker/i18n/zh-Hant.json +22 -0
- package/src/components/JfbFormsDynamicForm/uni-datetime-picker/time-picker.vue +934 -0
- package/src/components/JfbFormsDynamicForm/uni-datetime-picker/uni-datetime-picker.vue +1042 -0
- package/src/components/JfbFormsDynamicForm/uni-datetime-picker/util.js +403 -0
- package/src/components/JfbFormsList/Api.js +20 -0
- package/src/components/JfbFormsList/Attr.js +70 -0
- package/src/components/JfbFormsList/JfbFormsList.vue +228 -0
- package/src/components/JfbFormsList/JfbFormsListLess.less +79 -0
- package/src/components/JfbFormsList/JfbFormsListMixin.js +30 -0
- package/src/components/JfbFormsList/Mock.js +38 -0
- package/src/components/JfbFormsQuestionAndAnswer/Api.js +43 -0
- package/src/components/JfbFormsQuestionAndAnswer/Attr.js +14 -0
- package/src/components/JfbFormsQuestionAndAnswer/JfbFormsQuestionAndAnswer.vue +506 -0
- package/src/components/JfbFormsQuestionAndAnswer/JfbFormsQuestionAndAnswerLess.less +79 -0
- package/src/components/JfbFormsQuestionAndAnswer/JfbFormsQuestionAndAnswerMixin.js +30 -0
- package/src/components/JfbFormsQuestionAndAnswer/Mock.js +144 -0
- package/src/components/SkeProduct/SkeProduct.vue +241 -0
- package/src/config.app.plus.js +6 -0
- package/src/config.h5.js +13 -0
- package/src/config.mp.weixin.js +13 -0
- package/src/config.project.js +15 -0
- package/src/mixins/cardListMixins.js +187 -0
- package/src/mixins/colorCardMixins.js +122 -0
- package/src/mixins/componentsMixins.js +900 -0
- package/src/mixins/extsMixins.js +3 -0
- package/src/mixins/locationMixins.js +119 -0
- package/src/mixins/newLocaltionMixins.js +754 -0
- package/src/mixins/openDebuggerMixins.js +74 -0
- package/src/mixins/pageEditx.js +347 -0
- package/src/mixins/pageEvent.js +311 -0
- package/src/mixins/pageMain.js +120 -0
- package/src/mixins/pageUitls.js +738 -0
- package/src/mixins/posterMixins.js +122 -0
- package/src/mixins/scrollListFixedHeigthMixins.js +174 -0
- package/src/mocks.js +4 -0
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
methods:{
|
|
5
|
+
/**
|
|
6
|
+
* @description 过滤不可以用
|
|
7
|
+
* 当前项目未H5时,过滤所有小程序应用
|
|
8
|
+
* 当前项目未小程序时,过滤所有非当前小程序应用
|
|
9
|
+
* 站外地址直接返回
|
|
10
|
+
* 站内地址未选值直接返回
|
|
11
|
+
* 预览模式全过
|
|
12
|
+
*/
|
|
13
|
+
posterFilterNoUseData(list = []){
|
|
14
|
+
let content = this.$xdUniHelper.cloneDeep(list).filter(item=>{
|
|
15
|
+
//预览模式
|
|
16
|
+
if( this.$configProject.isPreview) return true;
|
|
17
|
+
|
|
18
|
+
//非内部应用
|
|
19
|
+
if(item.redirect_type !== 'INN') return true
|
|
20
|
+
|
|
21
|
+
//没有配置链接
|
|
22
|
+
if(!item.redirect_data) return true;
|
|
23
|
+
|
|
24
|
+
//内部应用
|
|
25
|
+
else {
|
|
26
|
+
let redirect_data;
|
|
27
|
+
try {
|
|
28
|
+
redirect_data = JSON.parse(item.redirect_data);
|
|
29
|
+
if(!item['app_type']) item['app_type']= 'h5';
|
|
30
|
+
|
|
31
|
+
//#ifdef H5
|
|
32
|
+
return item['app_type'] !== 'wxmp';
|
|
33
|
+
//#endif
|
|
34
|
+
|
|
35
|
+
//#ifdef MP-WEIXIN
|
|
36
|
+
let actDir = this.$parent['projectAttr']['deploy_dir'];
|
|
37
|
+
let dir = this.getPosterPathDir(redirect_data.page);
|
|
38
|
+
if(item['app_type'] === 'wxmp'){
|
|
39
|
+
return actDir === dir;
|
|
40
|
+
}
|
|
41
|
+
else if(item['app_type'] === 'h5') return true;
|
|
42
|
+
else return true
|
|
43
|
+
//#endif
|
|
44
|
+
}
|
|
45
|
+
catch (e) {
|
|
46
|
+
return true
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
console.warn(`PostersList:${JSON.stringify(content.map(item=>`${item.app_type}:${item.content_name}:${item.redirect_data}`), null,2)}`)
|
|
51
|
+
return content;
|
|
52
|
+
|
|
53
|
+
},
|
|
54
|
+
|
|
55
|
+
getPosterPathDir(pathDir){
|
|
56
|
+
if(pathDir.indexOf('@site_domain@/') === 0) {
|
|
57
|
+
return pathDir.replace('@site_domain@/','').split('/')[0]
|
|
58
|
+
}
|
|
59
|
+
return ''
|
|
60
|
+
},
|
|
61
|
+
|
|
62
|
+
handlePosterClick(item) {
|
|
63
|
+
if(!item.redirect_data) {
|
|
64
|
+
console.warn(`未配置链接地址: ${item.redirect_data}`);
|
|
65
|
+
console.error(`未配置链接地址: ${item.redirect_data}`);
|
|
66
|
+
return
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
//内部链接跳转地址
|
|
70
|
+
if (item.redirect_type === 'INN') {
|
|
71
|
+
try {
|
|
72
|
+
let url = JSON.parse(item.redirect_data);
|
|
73
|
+
let params = '';
|
|
74
|
+
if(url.page) {
|
|
75
|
+
if (item['redirect_params']) params = `?${item['redirect_params']}`;
|
|
76
|
+
this.$xdUniHelper.navigateTo({url: url.page + params})
|
|
77
|
+
}
|
|
78
|
+
else {
|
|
79
|
+
console.error(`应用链接配置错误: ${url.page}`)
|
|
80
|
+
}
|
|
81
|
+
} catch (e) {
|
|
82
|
+
console.error(`应用链接配置错误: ${item.redirect_data}`)
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
//外部链接
|
|
87
|
+
if (item.redirect_type === 'URL') {
|
|
88
|
+
let reg = /^(http:\/\/|https:\/\/|\/\/)+.+$/;
|
|
89
|
+
let spReg = /(-apiuri\/v)/;
|
|
90
|
+
//#ifdef MP-WEIXIN
|
|
91
|
+
try {
|
|
92
|
+
let url = JSON.parse(item.redirect_data);
|
|
93
|
+
if (reg.test(url.url) || spReg.test(url.url)) {
|
|
94
|
+
console.warn(`广告跳转外站: ${url.url}`)
|
|
95
|
+
this.$xdUniHelper.navigateTo(url);
|
|
96
|
+
} else {
|
|
97
|
+
console.error(`广告跳转外站配置错误: ${url.url}`)
|
|
98
|
+
}
|
|
99
|
+
} catch (e) {
|
|
100
|
+
console.error(`广告跳转外站配置错误: ${item.redirect_data}`)
|
|
101
|
+
}
|
|
102
|
+
//#endif
|
|
103
|
+
//#ifdef H5
|
|
104
|
+
try {
|
|
105
|
+
let url = JSON.parse(item.redirect_data);
|
|
106
|
+
console.warn(`广告跳转外站: ${url.url}`);
|
|
107
|
+
this.$xdUniHelper.redirectTo(url, false)
|
|
108
|
+
} catch (e) {
|
|
109
|
+
console.error(`广告跳转外站配置错误: ${item.redirect_data}`)
|
|
110
|
+
}
|
|
111
|
+
//#endif
|
|
112
|
+
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
//无跳转地址
|
|
116
|
+
if(item.redirect_type === 'EMP') {
|
|
117
|
+
console.warn(`无跳转地址`);
|
|
118
|
+
}
|
|
119
|
+
},
|
|
120
|
+
},
|
|
121
|
+
}
|
|
122
|
+
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
data() {
|
|
6
|
+
return {
|
|
7
|
+
//base
|
|
8
|
+
jfbListScrollElx: null, //计算滚动区域顶部元素top值(必须设置)建议使用ID选择器
|
|
9
|
+
jfbScrollList: null, //计算后的卡列表 (null|Array)
|
|
10
|
+
jfbScrollIndex:0,//记录当前数组的索引值
|
|
11
|
+
jfbScrollNextTop: 0, //计算元素初始化父节点元素距离顶部Top值
|
|
12
|
+
|
|
13
|
+
//list
|
|
14
|
+
jfbScrollRowShowNum: 1, //每行显示个数
|
|
15
|
+
jfbScrollItemPadding: 0, //行间距 rpx
|
|
16
|
+
jfbScrollItemHeight: 200, //块高度 rpx
|
|
17
|
+
jfbScrollLimit: 20, //每页个数
|
|
18
|
+
jfbScrollStart: 0, //可视区域的顶部边界值
|
|
19
|
+
jfbScrollEnd: 0, //可视区域的底部边界值
|
|
20
|
+
jfbShowPageStatus: false,//页面是否转为后台允许状态
|
|
21
|
+
jfbScrollFixed: 50, //调节阀值 rpx
|
|
22
|
+
|
|
23
|
+
//转换
|
|
24
|
+
jfbPxNum: 0, //px to rpx (1px * $pxNum)rpx
|
|
25
|
+
jfbRpxNum: 0, //rpx to px (1rpx * $rpxNum)px
|
|
26
|
+
maxAutoWindowWidth: 1280,
|
|
27
|
+
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
|
|
31
|
+
watch:{
|
|
32
|
+
jfbScrollStart() {
|
|
33
|
+
// console.log(this.jfbScrollStart, this.jfbScrollEnd);
|
|
34
|
+
// debugger
|
|
35
|
+
},
|
|
36
|
+
jfbScrollNextTop(val){
|
|
37
|
+
// console.log(val);
|
|
38
|
+
// debugger
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
|
|
42
|
+
created(){
|
|
43
|
+
this.jfbScrollEnd = uni.getSystemInfoSync().safeArea.height;
|
|
44
|
+
this.jfbPxNum = 750 / uni.getSystemInfoSync().windowWidth;
|
|
45
|
+
this.jfbRpxNum = uni.getSystemInfoSync().windowWidth / 750;
|
|
46
|
+
if(uni.getSystemInfoSync().windowWidth > 1280) {
|
|
47
|
+
this.jfbRpxNum = 375 / 750;
|
|
48
|
+
this.jfbPxNum = 750 / 375;
|
|
49
|
+
}
|
|
50
|
+
this.jfbShowPageStatus = true;
|
|
51
|
+
},
|
|
52
|
+
|
|
53
|
+
methods: {
|
|
54
|
+
checkListItemShow({height , top},index){
|
|
55
|
+
|
|
56
|
+
if(this.$configProject.isPreview) {
|
|
57
|
+
return this.jfbScrollLimit > index;
|
|
58
|
+
}
|
|
59
|
+
let boxTop = top + height + this.jfbScrollFixed * this.jfbRpxNum;
|
|
60
|
+
let boxBottom = top - (this.jfbScrollFixed * this.jfbRpxNum);
|
|
61
|
+
let {jfbScrollStart, jfbScrollEnd} = this;
|
|
62
|
+
return boxTop > jfbScrollStart && boxBottom < jfbScrollEnd;
|
|
63
|
+
},
|
|
64
|
+
|
|
65
|
+
getScrollContentTop(){
|
|
66
|
+
return new Promise((resolve, reject)=>{
|
|
67
|
+
this.$nextTick(()=>{
|
|
68
|
+
this.$xdUniHelper.getEleInfo(this.jfbListScrollElx, this, (data)=>{
|
|
69
|
+
this.jfbScrollNextTop = data.top;
|
|
70
|
+
console.warn('content-box:top='+this.jfbScrollNextTop)
|
|
71
|
+
resolve();
|
|
72
|
+
})
|
|
73
|
+
})
|
|
74
|
+
})
|
|
75
|
+
},
|
|
76
|
+
|
|
77
|
+
async onJfbLoad(options){
|
|
78
|
+
this.jfbListOptions = options;
|
|
79
|
+
if(this.jfbListScrollElx === null) throw new Error('滚动区域顶部元素,进行距离顶部设置');
|
|
80
|
+
else {
|
|
81
|
+
|
|
82
|
+
await this.getScrollContentTop();
|
|
83
|
+
if(typeof this['onJfbPackageLoad'] === 'function') {
|
|
84
|
+
this['onJfbPackageLoad'](options);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
},
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* @description 设置属性 注意在created里面进行设置
|
|
91
|
+
* @param key
|
|
92
|
+
* @param value
|
|
93
|
+
*/
|
|
94
|
+
setJfbScrollAttr(key, value){
|
|
95
|
+
let allow = [
|
|
96
|
+
'jfbScrollRowShowNum',
|
|
97
|
+
'jfbScrollItemPadding',
|
|
98
|
+
'jfbScrollItemHeight',
|
|
99
|
+
'maxAutoWindowWidth',
|
|
100
|
+
'jfbListScrollElx',
|
|
101
|
+
'jfbScrollLimit'
|
|
102
|
+
];
|
|
103
|
+
if(allow.indexOf(key) === -1) console.warn(`键值:${key}不存在`);
|
|
104
|
+
else {
|
|
105
|
+
this[key]= value;
|
|
106
|
+
}
|
|
107
|
+
},
|
|
108
|
+
|
|
109
|
+
computeJfbScrollList(data = []){
|
|
110
|
+
return new Promise((resolve)=>{
|
|
111
|
+
const handle = ()=>{
|
|
112
|
+
if(this.jfbScrollNextTop === null) {
|
|
113
|
+
setTimeout(()=>{
|
|
114
|
+
handle();
|
|
115
|
+
}, 50)
|
|
116
|
+
return
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
//处理
|
|
120
|
+
let newData = this.$xdUniHelper.cloneDeep(data);
|
|
121
|
+
newData = newData.map(item=>{
|
|
122
|
+
let row = Math.floor(this.jfbScrollIndex/this.jfbScrollRowShowNum);
|
|
123
|
+
let height = this.jfbScrollItemHeight * this.jfbRpxNum;
|
|
124
|
+
let padding = this.jfbScrollItemPadding * this.jfbRpxNum;
|
|
125
|
+
item['height'] = height;
|
|
126
|
+
item['top'] = this.jfbScrollNextTop;
|
|
127
|
+
item['scrollIndex'] = this.jfbScrollIndex;
|
|
128
|
+
|
|
129
|
+
if(this.jfbScrollIndex%this.jfbScrollRowShowNum === (this.jfbScrollRowShowNum -1)) {
|
|
130
|
+
this.jfbScrollNextTop = this.jfbScrollNextTop + height + padding;
|
|
131
|
+
}
|
|
132
|
+
this.jfbScrollIndex++;
|
|
133
|
+
return item;
|
|
134
|
+
});
|
|
135
|
+
this.jfbScrollList = (this.jfbScrollList||[]).concat(newData);
|
|
136
|
+
resolve(this.jfbScrollList)
|
|
137
|
+
}
|
|
138
|
+
handle();
|
|
139
|
+
})
|
|
140
|
+
},
|
|
141
|
+
|
|
142
|
+
onJfbScroll(params){
|
|
143
|
+
|
|
144
|
+
if(this.jfbShowPageStatus) {
|
|
145
|
+
this.jfbScrollStart = params.e.scrollTop;
|
|
146
|
+
this.jfbScrollEnd = params.e.scrollTop + uni.getSystemInfoSync().safeArea.height
|
|
147
|
+
}
|
|
148
|
+
if(typeof this['onJfbPackageScroll'] === 'function') {
|
|
149
|
+
this['onJfbPackageScroll'](params);
|
|
150
|
+
}
|
|
151
|
+
},
|
|
152
|
+
|
|
153
|
+
onJfbHide(options){
|
|
154
|
+
this.jfbShowPageStatus = false;
|
|
155
|
+
if(typeof this['onJfbPackageHide'] === 'function') {
|
|
156
|
+
this['onJfbPackageHide'](options);
|
|
157
|
+
}
|
|
158
|
+
},
|
|
159
|
+
|
|
160
|
+
onJfbShow(options){
|
|
161
|
+
this.jfbShowPageStatus = true;
|
|
162
|
+
if(typeof this['onJfbPackageShow'] === 'function') {
|
|
163
|
+
this['onJfbPackageShow'](options);
|
|
164
|
+
}
|
|
165
|
+
},
|
|
166
|
+
|
|
167
|
+
clearDefault(){
|
|
168
|
+
this.jfbScrollList = null;
|
|
169
|
+
this.jfbScrollNextTop = 0;
|
|
170
|
+
this.jfbScrollIndex = 0
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
}
|
|
174
|
+
}
|
package/src/mocks.js
ADDED