jufubao-takeorder 1.0.1

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.
Files changed (50) hide show
  1. package/README.md +27 -0
  2. package/commands.js +84 -0
  3. package/commands.update.change.js +176 -0
  4. package/file.config.js +16 -0
  5. package/get.package.path.js +22 -0
  6. package/get.package.path.js.tpl +22 -0
  7. package/package.json +122 -0
  8. package/src/CreateClientID.js +16 -0
  9. package/src/ICONS.js +1148 -0
  10. package/src/appParams.js +1 -0
  11. package/src/common/authorize.js +261 -0
  12. package/src/common/getBusinessImageUrl.js +39 -0
  13. package/src/common/getServiceUrl.js +38 -0
  14. package/src/common/paysdk/jweixin.js +98 -0
  15. package/src/components/CusCouponChose/CusCouponChose.vue +1024 -0
  16. package/src/components/CusCouponItem/CusCouponItem.vue +298 -0
  17. package/src/components/CusEnter/CusEnter.vue +368 -0
  18. package/src/components/CusListItem/CusListItem.vue +141 -0
  19. package/src/components/CusPoster/CusPoster.vue +167 -0
  20. package/src/components/CusPoster/CusSwiperDot.vue +234 -0
  21. package/src/components/CusPrice/CusPrice.vue +383 -0
  22. package/src/components/CusProduct/CusProduct.vue +763 -0
  23. package/src/components/CusShops/CusShops.vue +717 -0
  24. package/src/components/CusSwiperDot/CusSwiperDot.vue +234 -0
  25. package/src/components/CusTab/CusTab.vue +544 -0
  26. package/src/components/CusVideo/CusVideo.vue +170 -0
  27. package/src/components/CusVipList/CusVipList.vue +169 -0
  28. package/src/config.app.plus.js +6 -0
  29. package/src/config.h5.js +13 -0
  30. package/src/config.mp.weixin.js +13 -0
  31. package/src/config.project.js +15 -0
  32. package/src/get.package.path.js +22 -0
  33. package/src/mixins/cardListMixins.js +187 -0
  34. package/src/mixins/colorCardMixins.js +122 -0
  35. package/src/mixins/componentsMixins.js +900 -0
  36. package/src/mixins/extsMixins.js +3 -0
  37. package/src/mixins/locationMixins.js +119 -0
  38. package/src/mixins/newLocaltionMixins.js +754 -0
  39. package/src/mixins/openDebuggerMixins.js +74 -0
  40. package/src/mixins/pageEditx.js +347 -0
  41. package/src/mixins/pageEvent.js +311 -0
  42. package/src/mixins/pageMain.js +120 -0
  43. package/src/mixins/pageUitls.js +738 -0
  44. package/src/mixins/posterMixins.js +122 -0
  45. package/src/mixins/scrollListFixedHeigthMixins.js +174 -0
  46. package/src/mocks.js +4 -0
  47. package/src/oss.config.js +17 -0
  48. package/src/settings.js +244 -0
  49. package/src/staticVersion.js +3 -0
  50. package/src/xd.less +196 -0
@@ -0,0 +1,311 @@
1
+ 'use strict';
2
+ import {JfbEvent} from "@/utils/xd.event";
3
+ import {mapActions, mapMutations, mapState} from 'vuex';
4
+ import storage from "@/common/storage";
5
+ import {getCacheTime} from "@/common/common";
6
+ import {isThirdLogin} from "@/utils/xd.base";
7
+ /**
8
+ * @description 绑定生命周期 + 操作事件类方法
9
+ */
10
+ export default {
11
+ computed:{
12
+ ...mapState(['shareInfo'])
13
+ },
14
+ data(){
15
+ return {
16
+ isFirst: true, //是否为首次访问
17
+ currentPagesIsShow: false, //当前页面是否为显示状态
18
+ layoutInfo: null, //框架信息
19
+ options: null, //参数信息
20
+ scrollDetail: 0,
21
+
22
+ //窗口高度
23
+ windowHeight:0,
24
+ //相同城市临是存储第三方定位信息
25
+ sameCityChangeLocationKey: 'xd_same_city_change_three_map',
26
+ //保存上一次定位信息
27
+ locationStorageKey: "xd_three_map",
28
+
29
+ scrolltimer: null
30
+ }
31
+ },
32
+ created() {
33
+ this.$xdRoot.$emit('setLayoutPageBg', null);
34
+ },
35
+ onLoad(options) {
36
+ this.options = options;
37
+ this.isOnLoad = true;
38
+
39
+ // #ifdef MP-WEIXIN
40
+ this.init(options);
41
+ this.$xdLog.getARMS().pageShow(this.options);
42
+ wx.onAppRoute(this.handleRouter)
43
+ // #endif
44
+
45
+ // #ifdef H5
46
+ if(this.isCheckAuth) this.setBusinessCodeSave(options, this.pageAttr);
47
+ this.$xdLog.setProject(`App.onLoad`, 'App.pages.onLoad.done');
48
+ this.onInitLoad();
49
+ if(isThirdLogin().isICB){
50
+ this.$nextTick(()=>{
51
+ setTimeout(()=>{
52
+ this.handleIcbHeader();
53
+ }, 500)
54
+ })
55
+ }
56
+ // #endif
57
+
58
+ },
59
+ onPageScroll(e) {
60
+ //预览模式不处理
61
+ if(this.$configProject.isPreview || this.currentPagesIsShow === false) return;
62
+
63
+ if(this.scrolltimer) {
64
+ clearTimeout(this.scrolltimer);
65
+ this.scrolltimer = null;
66
+ }
67
+ this.scrolltimer = setTimeout(()=>{
68
+ console.warn(`event.onPageScroll.onJfbScroll:${e.scrollTop}`);
69
+ },500)
70
+ new JfbEvent('onJfbScroll', {
71
+ vm: this,
72
+ data: {e, options: this.options},
73
+ });
74
+ this.scrollDetail = e.scrollTop;
75
+ },
76
+ onReachBottom(e) {
77
+ //预览模式不处理
78
+ if(this.$configProject.isPreview || this.currentPagesIsShow === false) return;
79
+ console.warn('event.onReachBottom.onJfbReachBottom');
80
+ new JfbEvent('onJfbReachBottom', {
81
+ vm: this,
82
+ data: {e, options: this.options},
83
+ })
84
+ },
85
+ // #ifdef H5
86
+ onBackPress(e) {
87
+ this.onJfbSystemBack(e)
88
+ },
89
+ // #endif
90
+ // #ifdef MP-WEIXIN
91
+ onShareAppMessage(message){
92
+ console.warn(`shareInfo=>${JSON.stringify(this.shareInfo)}`);
93
+ return this.shareInfo;
94
+ },
95
+ // #endif
96
+ onShow() {
97
+ this.currentPagesIsShow = true;
98
+ if (!this.isFirst) {
99
+ console.log('exec.onShow', new Date().getTime() - this.time, 'ms');
100
+ console.warn('event.onShow.onJfbShow');
101
+
102
+ //设置页面headers参数
103
+ this.setPagesHeader(this.$xdUniHelper.cloneDeep(this.pageHeadersInfo));
104
+
105
+ //设置业务线与公共参数
106
+ const bussCode = this.setBusinessCodeSave(this.$xdUniHelper.parseURL().params, this.pageAttr);
107
+ this.setCommonPagesParams(this.pageAttr, bussCode)
108
+ new JfbEvent('onJfbShow', {
109
+ vm: this,
110
+ data: this.options,
111
+ });
112
+
113
+
114
+ // #ifdef MP-WEIXIN
115
+ this.$xdLog.getARMS().pageShow(this.options);
116
+ wx.onAppRoute(this.handleRouter)
117
+ // #endif
118
+
119
+ }
120
+ if (this.isFirst) {
121
+ this.isFirst = false;
122
+ }
123
+ this.setPageTitle();
124
+
125
+ },
126
+ onHide() {
127
+
128
+
129
+ this.setShareInfo({});
130
+ this.currentPagesIsShow = false;
131
+ new JfbEvent('onJfbHide', {
132
+ vm: this,
133
+ data: this.options,
134
+ });
135
+ this.updateLocation();
136
+ // #ifdef MP-WEIXIN
137
+ this.$xdLog.getARMS().pageHide(this.options);
138
+ wx.offAppRoute(this.handleRouter)
139
+ // #endif
140
+ },
141
+ onUnload() {
142
+ this.setShareInfo({});
143
+ console.warn('event.onUnload.onJfbUnload');
144
+ this.currentPagesIsShow = false;
145
+ new JfbEvent('onJfbUnload', {
146
+ vm: this,
147
+ data: this.options,
148
+ });
149
+ this.updateLocation()
150
+ },
151
+ destroyed() {
152
+ this.updateLocation();
153
+ this.setShareInfo({});
154
+ },
155
+ methods: {
156
+ ...mapMutations(['setLocationInfo', 'setShareInfo']),
157
+
158
+ // #ifdef MP-WEIXIN
159
+ handleRouter(router){
160
+ if(router.openType === 'navigateBack') {
161
+ if(this.currentPagesIsShow === false) {
162
+ this.onJfbSystemBack(router);
163
+ wx.offAppRoute(this.handleRouter);
164
+ }
165
+ }
166
+ else {
167
+ //debugger
168
+ }
169
+ },
170
+ // #endif
171
+
172
+ handleIcbHeader(){
173
+ let btn = document.getElementsByClassName('uni-page-head-btn').item(0);
174
+ let fat = document.getElementsByClassName('uni-page-head-ft').item(0);
175
+ //非系统导航模式不处理
176
+ if(!btn) return;
177
+ const styles = window.getComputedStyle(btn, null);
178
+ const color = styles.getPropertyValue('color');
179
+ const display = styles.getPropertyValue('display');
180
+ if(display === 'block') {
181
+ fat.innerHTML = '关闭';
182
+ fat.style.fontSize = '14px';
183
+ fat.style.color = color;
184
+ fat.style.marginTop = '-4px';
185
+ fat.style.marginLeft = '10px'
186
+ }
187
+ const handle = ()=>{
188
+ if(display === 'block') {
189
+ window.ICBC_SDK.back();
190
+ }
191
+ }
192
+ fat.removeEventListener('click',handle);
193
+ fat.addEventListener('click',handle, false)
194
+ },
195
+
196
+ /**
197
+ * @description 页面卸载,隐藏时候触发更新经纬度状态
198
+ */
199
+ updateLocation(){
200
+ let location = storage.get(this.sameCityChangeLocationKey)
201
+ storage.remove(this.sameCityChangeLocationKey);
202
+ if(location) {
203
+ let time = getCacheTime(this);
204
+ storage.set(this.locationStorageKey,location, time);
205
+ this.setLocationInfo(location)
206
+ }
207
+ },
208
+ onInitLoad(){
209
+ let {isCheckAuth, isOnLoad, layoutInfo} = this;
210
+ if(
211
+ isCheckAuth
212
+ && layoutInfo !== null
213
+ && isOnLoad
214
+ ) {
215
+ let nowTime = new Date().getTime();
216
+ this.$xdLog.setProject('App.init.userTime', {
217
+ userTime: `${nowTime - this.time}ms`,
218
+ userStartTime: this.time,
219
+ endTime: nowTime,
220
+ });
221
+
222
+ new JfbEvent('onJfbLoad', {
223
+ vm: this,
224
+ data: this.options,
225
+ });
226
+
227
+ this.$xdRoot.$emit('setLayoutPageBg', null);
228
+
229
+ let currentPath = '';
230
+ // #ifdef MP-WEIXIN
231
+ currentPath = this.$xdUniHelper.getCurrentPages().path;
232
+ // #endif
233
+ // #ifdef H5
234
+ currentPath = location.href;
235
+ // #endif
236
+ //5s上报
237
+ if ((nowTime - this.time) > 10000) {
238
+ this.$xdLog.setARMSCustomError('slow.link', `Slow.Link--${nowTime - this.time}ms--${currentPath}`)
239
+ }
240
+ }
241
+
242
+ },
243
+
244
+ getCurrentPagesIsShow(){
245
+ return this.currentPagesIsShow
246
+ },
247
+ /**
248
+ * @description 框架完成事件
249
+ * @param layout {object} 框架对象
250
+ * @return {Object}
251
+ */
252
+ handleDone(layout) {
253
+ this.$xdLog.setProject(`App.layout`, 'App.pages.layout.done',layout);
254
+ this.layoutInfo = layout;
255
+ this.onInitLoad();
256
+
257
+ // #ifdef H5
258
+ if (this.$configProject.viewType === 'preview') {
259
+ this.$nextTick(() => {
260
+ setTimeout(() => {
261
+ this.setIframeHeigth();
262
+ }, 50)
263
+ });
264
+ }
265
+ // #endif
266
+ },
267
+
268
+ /**
269
+ * @description 框架节点发生变化事件
270
+ * @param layout {object} 框架对象
271
+ * @return {Object}
272
+ */
273
+ handleChange(layout) {
274
+ this.layoutInfo = layout;
275
+ },
276
+
277
+ /**
278
+ * 业务组件之间通信事件
279
+ */
280
+ onCustomEvent(action, data) {
281
+ if (this.currentPagesIsShow) {
282
+ console.warn('event.onCustomEvent.onJfbCustomEvent');
283
+ new JfbEvent('onJfbCustomEvent', {
284
+ vm: this,
285
+ data: {action, data, options: this.options},
286
+ })
287
+ }
288
+ },
289
+
290
+ onJfbSystemBack(system){
291
+ console.warn('event.onSystemBack.onJfbBack');
292
+ new JfbEvent('onJfbSystemBack', {
293
+ vm: this,
294
+ data: system
295
+ })
296
+ },
297
+
298
+ /**
299
+ * @description 绑定自定义导航时候返回事件方法
300
+ */
301
+ back() {
302
+ console.warn('event.back.onJfbBack');
303
+ new JfbEvent('onJfbBack', {
304
+ vm: this,
305
+ data: this.options
306
+ })
307
+ },
308
+ }
309
+ }
310
+
311
+
@@ -0,0 +1,120 @@
1
+ 'use strict';
2
+ import {mapActions, mapState, mapMutations} from 'vuex';
3
+ import {
4
+ AttrToTargetValues,
5
+ getContainerPropsValue,
6
+ baseCloneDeep,
7
+ } from "@/utils/xd.base";
8
+
9
+ export default {
10
+ data(){
11
+ return {
12
+ time: new Date().getTime(),//与页面加载速度有关
13
+ isOnLoad: false, //是否执行了onload事件
14
+ options: null, //页面参数
15
+ pagesParams:'',//页面Json设置参数
16
+ site_id: null, //当前网站ID
17
+ layoutInfo: null, //框架数据
18
+ indexHeight: 0, //预览模式更新Iframe高度有关
19
+ projectAttr: {}, //项目属性
20
+ settings: {}, //编译时刻项目配置对象
21
+
22
+ //保存计算当前页面使用业务组件列表
23
+ containers: {
24
+ topHeight: 0,
25
+ bottomHeight: 0,
26
+ footerHeight: 0,
27
+ tops: [],
28
+ bottoms: [],
29
+ bodys: [],
30
+ footers: [],
31
+ },
32
+ }
33
+ },
34
+ created(){
35
+ this.settings = this.$settings;
36
+ this.site_id = getApp().globalData.$xd.brandInfo.site_id;
37
+ this.projectAttr = getApp().globalData.$xd.brandInfo;
38
+ },
39
+ methods: {
40
+ ...mapActions(['getPageAttr']),
41
+ ...mapMutations(['setPagesHeader', 'setPagesPermission']),
42
+
43
+
44
+ /**
45
+ * @description 获取Containers生产的位置和高度
46
+ * @param item
47
+ * @param isTranform 是否需要转化事件 默认:true
48
+ * @returns {{fixed: *, height: *}}
49
+ */
50
+ getFixedKey(item, isTranform = true) {
51
+ let fixed = 'body';
52
+ let height = 0;
53
+ if (isTranform) item['component']['attrs'] = AttrToTargetValues(item['component']['attrs']);
54
+ item['component']['attrs'].map(it => {
55
+ if (it['key'] === 'fixed') {
56
+ fixed = it['value'];
57
+ }
58
+ if (it['key'] === 'height') {
59
+ height = it['value'];
60
+ }
61
+ });
62
+ return {fixed, height};
63
+ },
64
+
65
+ /**
66
+ * @description 计算top/bottom/footer各自所站高度
67
+ * @param fixed
68
+ * @param height
69
+ * @param oldItem
70
+ * @param containers
71
+ * @returns {*}
72
+ */
73
+ switchFixed(fixed, height, oldItem, containers ){
74
+ switch (fixed) {
75
+ case 'top':
76
+ containers.tops.push(oldItem);
77
+ if (!oldItem.hidden) containers.topHeight += height;
78
+ break;
79
+ case 'bottom':
80
+ containers.bottoms.push(oldItem);
81
+ if (!oldItem.hidden) containers.bottomHeight += height;
82
+ break;
83
+ case 'footer':
84
+ containers.footers.push(oldItem);
85
+ if (!oldItem.hidden) containers.footerHeight += height;
86
+ break;
87
+ default:
88
+ containers.bodys.push(oldItem);
89
+ }
90
+ },
91
+
92
+ /**
93
+ * @description Container数据转化(废弃)
94
+ * @param containers {Array} 使用业务插件数据
95
+ * @return {Object}
96
+ */
97
+ getContainerGroup(containers) {
98
+ let temp = {
99
+ topHeight: 0,
100
+ bottomHeight: 0,
101
+ footerHeight: 0,
102
+ tops: [],
103
+ bottoms: [],
104
+ bodys: [],
105
+ footers: [],
106
+ };
107
+ let refs = [];
108
+ containers.map(item => {
109
+ item['refreshKey'] = this.$xdUniHelper.randomChar(20);
110
+ if (!item.hidden) refs.push(item['container_id']);
111
+ let {fixed, height} = this.getFixedKey(item);
112
+ this.switchFixed(fixed, height, item, temp);
113
+ });
114
+ this.refs = refs;
115
+ return temp;
116
+ },
117
+ }
118
+ }
119
+
120
+