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.
- 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 +122 -0
- package/src/CreateClientID.js +16 -0
- package/src/ICONS.js +1148 -0
- package/src/appParams.js +1 -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 +368 -0
- package/src/components/CusListItem/CusListItem.vue +141 -0
- package/src/components/CusPoster/CusPoster.vue +167 -0
- package/src/components/CusPoster/CusSwiperDot.vue +234 -0
- package/src/components/CusPrice/CusPrice.vue +383 -0
- package/src/components/CusProduct/CusProduct.vue +763 -0
- package/src/components/CusShops/CusShops.vue +717 -0
- package/src/components/CusSwiperDot/CusSwiperDot.vue +234 -0
- package/src/components/CusTab/CusTab.vue +544 -0
- package/src/components/CusVideo/CusVideo.vue +170 -0
- package/src/components/CusVipList/CusVipList.vue +169 -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/get.package.path.js +22 -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
- package/src/oss.config.js +17 -0
- package/src/settings.js +244 -0
- package/src/staticVersion.js +3 -0
- package/src/xd.less +196 -0
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<view class="vip-list_wrap">
|
|
3
|
+
<view class="vip_cards-header">
|
|
4
|
+
<xd-font-icon icon="iconPLUShuiyuan" :size="24" color="#FCBF28"></xd-font-icon>
|
|
5
|
+
<view class="vip_title">开通会员,本单可省
|
|
6
|
+
<text class="vip_title-price"> {{$xdUniHelper.divisionFloatNumber(plus_saving_money, 100)}}</text>
|
|
7
|
+
<!-- <xd-unit :price="plus_saving_money" :isOld="false" :fontSize="24" :iconSize="0.3" style="margin-left: 8rpx;"></xd-unit> -->
|
|
8
|
+
</view>
|
|
9
|
+
</view>
|
|
10
|
+
<view class="vip_cards-body">
|
|
11
|
+
<view class="vip_card_list">
|
|
12
|
+
<view class="vip_item" :class="{active: vipCardId==item.vip_card_id}"
|
|
13
|
+
v-for="item in list" :key="item.vip_card_id"
|
|
14
|
+
@click="handleChoseVipCard(item)"
|
|
15
|
+
>
|
|
16
|
+
<view class="vip_name">{{ item.product_name }}</view>
|
|
17
|
+
<view class="vip_img">
|
|
18
|
+
<image :src="item.vip_card_icon"></image>
|
|
19
|
+
</view>
|
|
20
|
+
<view class="vip_price">{{ $xdUniHelper.divisionFloatNumber(item.sale_price, 100) }}</view>
|
|
21
|
+
</view>
|
|
22
|
+
</view>
|
|
23
|
+
</view>
|
|
24
|
+
</view>
|
|
25
|
+
</template>
|
|
26
|
+
|
|
27
|
+
<script>
|
|
28
|
+
import XdFontIcon from "@/components/XdFontIcon/XdFontIcon";
|
|
29
|
+
import XdUnit from "@/components/XdUnit/XdUnit"
|
|
30
|
+
import getServiceUrl from "@/common/getServiceUrl"
|
|
31
|
+
export default {
|
|
32
|
+
components: {
|
|
33
|
+
XdFontIcon,
|
|
34
|
+
XdUnit
|
|
35
|
+
},
|
|
36
|
+
props: {
|
|
37
|
+
list: {
|
|
38
|
+
type: Array,
|
|
39
|
+
default() {
|
|
40
|
+
return []
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
vip_card_id: {
|
|
44
|
+
type: Number,
|
|
45
|
+
default: 0
|
|
46
|
+
},
|
|
47
|
+
plus_saving_money: {
|
|
48
|
+
type: Number,
|
|
49
|
+
default: 0
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
watch: {
|
|
53
|
+
vip_card_id(val){
|
|
54
|
+
this.vipCardId = val;
|
|
55
|
+
},
|
|
56
|
+
list(val){
|
|
57
|
+
this.uiList = val.map(item => {
|
|
58
|
+
item.vip_card_icon = getServiceUrl(item.vip_card_icon, 'size2');
|
|
59
|
+
return item;
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
data(){
|
|
64
|
+
return {
|
|
65
|
+
vipCardId: "",
|
|
66
|
+
uiList: []
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
created(){
|
|
70
|
+
this.vipCardId = this.vip_card_id;
|
|
71
|
+
this.uiList = this.list.map(item => {
|
|
72
|
+
item.vip_card_icon = getServiceUrl(item.vip_card_icon, 'size2');
|
|
73
|
+
return item;
|
|
74
|
+
});
|
|
75
|
+
},
|
|
76
|
+
methods: {
|
|
77
|
+
handleChoseVipCard(item){
|
|
78
|
+
if(this.vipCardId === item.vip_card_id){
|
|
79
|
+
this.vipCardId = "";
|
|
80
|
+
}else{
|
|
81
|
+
this.vipCardId = item.vip_card_id;
|
|
82
|
+
}
|
|
83
|
+
this.$emit("choseVipCard", this.vipCardId);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
</script>
|
|
88
|
+
|
|
89
|
+
<style lang="less" scoped>
|
|
90
|
+
.vip-list_wrap{
|
|
91
|
+
padding: 24rpx 0;
|
|
92
|
+
background-color: #FFFFFF;
|
|
93
|
+
.vip_cards-header{
|
|
94
|
+
padding: 0 40rpx 24rpx;
|
|
95
|
+
display: flex;
|
|
96
|
+
align-items: center;
|
|
97
|
+
border-bottom: 2rpx solid #F6F6F6;
|
|
98
|
+
.vip_title{
|
|
99
|
+
color: #86541E;
|
|
100
|
+
font-size: 24rpx;
|
|
101
|
+
font-weight: 400;
|
|
102
|
+
margin-left: 8rpx;
|
|
103
|
+
display: flex;
|
|
104
|
+
align-items: center;
|
|
105
|
+
&-price{
|
|
106
|
+
color: #FF5A39;
|
|
107
|
+
font-weight: bold;
|
|
108
|
+
margin-left: 8rpx;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
.vip_cards-body{
|
|
113
|
+
padding: 24rpx 0 0;
|
|
114
|
+
|
|
115
|
+
.vip_card_list{
|
|
116
|
+
width: 100%;
|
|
117
|
+
overflow: auto;
|
|
118
|
+
white-space: nowrap;
|
|
119
|
+
padding: 0 20rpx;
|
|
120
|
+
box-sizing: border-box;
|
|
121
|
+
|
|
122
|
+
.vip_item{
|
|
123
|
+
width: 160rpx;
|
|
124
|
+
height: 160rpx;
|
|
125
|
+
border: 4rpx solid #EEEEEE;
|
|
126
|
+
background-color: #EEEEEE;
|
|
127
|
+
border-radius: 24rpx;
|
|
128
|
+
box-sizing: border-box;
|
|
129
|
+
display: inline-flex;
|
|
130
|
+
flex-direction: column;
|
|
131
|
+
align-items: center;
|
|
132
|
+
margin: 0 18rpx;
|
|
133
|
+
padding: 16rpx 0;
|
|
134
|
+
color: #999999;
|
|
135
|
+
filter: grayscale(1);
|
|
136
|
+
&.active{
|
|
137
|
+
color: #AB6900;
|
|
138
|
+
border-color: #AB6900;
|
|
139
|
+
background-color: #FFF8ED;
|
|
140
|
+
filter: grayscale(0);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
.vip_name{
|
|
144
|
+
line-height: 1;
|
|
145
|
+
font-size: 16rpx;
|
|
146
|
+
font-weight: 500;
|
|
147
|
+
}
|
|
148
|
+
.vip_img{
|
|
149
|
+
width: 120rpx;
|
|
150
|
+
height: 60rpx;
|
|
151
|
+
border-radius: 7rpx;
|
|
152
|
+
margin: 8rpx 0;
|
|
153
|
+
display: inline-block;
|
|
154
|
+
box-sizing: border-box;
|
|
155
|
+
image{
|
|
156
|
+
width: 100%;
|
|
157
|
+
height: 100%;
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
.vip_price{
|
|
161
|
+
line-height: 1;
|
|
162
|
+
font-size: 36rpx;
|
|
163
|
+
font-weight: 500;
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
</style>
|
package/src/config.h5.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
"type": "build",
|
|
5
|
+
"NODE_ENV": "production",
|
|
6
|
+
"UNI_PLATFORM": "mp-weixin",
|
|
7
|
+
"platform": "mp.weixin",
|
|
8
|
+
"viewType": "preview",
|
|
9
|
+
"isPreview": true,
|
|
10
|
+
"server": "server",
|
|
11
|
+
"copypack": null,
|
|
12
|
+
"fileDir": "resource"
|
|
13
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
//#ifdef H5
|
|
4
|
+
import config from "@/config.h5";
|
|
5
|
+
//#endif
|
|
6
|
+
|
|
7
|
+
//#ifdef MP-WEIXIN
|
|
8
|
+
import config from "@/config.mp.weixin";
|
|
9
|
+
//#endif
|
|
10
|
+
|
|
11
|
+
//#ifdef APP-PLUS
|
|
12
|
+
import config from "@/config.app.plus";
|
|
13
|
+
//#endif
|
|
14
|
+
|
|
15
|
+
export default config;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @description 第三方库
|
|
5
|
+
* @param threePackagePath {String} 第三方库所在项目路径存放路径路
|
|
6
|
+
* @param packname {String} 包名字
|
|
7
|
+
* @returns {string|*}
|
|
8
|
+
*/
|
|
9
|
+
const getPackagePath = (threePackagePath, packname = 'gxd-commands-bussiness')=>{
|
|
10
|
+
if(packname === 'gxd-commands-bussiness') {
|
|
11
|
+
return `/Users/shiyonggao/Desktop/code/BASE/UNIAPP/xd-commands-bussiness/${threePackagePath}`;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
if (packname === 'gxd-uni-library-editx') {
|
|
15
|
+
return `/Users/shiyonggao/Desktop/code/BASE/UNIAPP/xd-uni-library-editx/${threePackagePath}`;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
module.exports = {
|
|
21
|
+
getPackagePath
|
|
22
|
+
}
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
import {mapMutations, mapState} from "vuex";
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
data() {
|
|
6
|
+
return {
|
|
7
|
+
ajaxCardList: null, //接口返回原始数据
|
|
8
|
+
|
|
9
|
+
//卡券列表
|
|
10
|
+
cardOrgList:[], //原始数据
|
|
11
|
+
cardList:null, //计算后的卡列表
|
|
12
|
+
cardPageNum: 0, //当前页面
|
|
13
|
+
cardPageLen: 10, //每页获取数据调试
|
|
14
|
+
cardComputedList:[], //当前获取的数据列表
|
|
15
|
+
cardLoading: false, //加载状态值设置
|
|
16
|
+
cardNextTop: 0, //计算到每一个节点的距离顶部Top值
|
|
17
|
+
contentStatus: false, //内容框是否已经进行过计算距离顶部Top值状态
|
|
18
|
+
hasContent: true, //是否可以进行继续加载状态
|
|
19
|
+
cardIndex: 0,
|
|
20
|
+
|
|
21
|
+
//转换按钮
|
|
22
|
+
hasChangeStatus: false,//是否有转换按钮
|
|
23
|
+
|
|
24
|
+
cardItemEntry: '//img.jufubao.cn/component/card/card_item_entry.png?v1=11',
|
|
25
|
+
cardItem: '//img.jufubao.cn/component/card/card_item.png?v1=11',
|
|
26
|
+
|
|
27
|
+
showStatus:false,
|
|
28
|
+
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
computed:{
|
|
32
|
+
...mapState(['srollPreview'])
|
|
33
|
+
},
|
|
34
|
+
created(){
|
|
35
|
+
this.setSrollPreview({
|
|
36
|
+
pageWindowPrevStart: 0,
|
|
37
|
+
pageWindowPrevEnd: uni.getSystemInfoSync().safeArea.height,
|
|
38
|
+
});
|
|
39
|
+
this.showStatus = true;
|
|
40
|
+
},
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
methods:{
|
|
44
|
+
...mapMutations(['setSrollPreview']),
|
|
45
|
+
|
|
46
|
+
onJfbHide(){
|
|
47
|
+
this.showStatus = false;
|
|
48
|
+
},
|
|
49
|
+
|
|
50
|
+
onJfbShow(options){
|
|
51
|
+
this.showStatus = true;
|
|
52
|
+
this.clearDefault();
|
|
53
|
+
this.onJfbLoad(options);
|
|
54
|
+
},
|
|
55
|
+
|
|
56
|
+
setCardItemShow({height , top},index){
|
|
57
|
+
|
|
58
|
+
//预览模式只获取10条
|
|
59
|
+
if(this.$configProject.isPreview) {
|
|
60
|
+
//console.log(this.cardPageLen, index, this.cardPageLen > index)
|
|
61
|
+
return this.cardPageLen > index;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
//打包模式
|
|
65
|
+
let fiexd = 50;
|
|
66
|
+
let boxTop = top + height + fiexd;
|
|
67
|
+
let boxBottom = top - (fiexd);
|
|
68
|
+
let {pageWindowPrevStart, pageWindowPrevEnd} = this.srollPreview;
|
|
69
|
+
|
|
70
|
+
//console.log(height,top,pageWindowPrevStart,pageWindowPrevEnd)
|
|
71
|
+
return boxTop > pageWindowPrevStart && boxBottom < pageWindowPrevEnd;
|
|
72
|
+
},
|
|
73
|
+
|
|
74
|
+
getBoxTop(){
|
|
75
|
+
return new Promise((resolve, reject)=>{
|
|
76
|
+
const query = uni.createSelectorQuery().in(this);
|
|
77
|
+
query.select('.card-content').boundingClientRect(data=>{
|
|
78
|
+
this.cardNextTop = data.top;
|
|
79
|
+
this.contentStatus = true;
|
|
80
|
+
resolve();
|
|
81
|
+
}).exec()
|
|
82
|
+
})
|
|
83
|
+
|
|
84
|
+
},
|
|
85
|
+
|
|
86
|
+
async handleCardComputed(paddingBottom=30){
|
|
87
|
+
this.$xdShowLoading({});
|
|
88
|
+
if(this.contentStatus === false) await this.getBoxTop();
|
|
89
|
+
this.$nextTick(()=>{
|
|
90
|
+
const query = uni.createSelectorQuery().in(this);
|
|
91
|
+
query.selectAll('.computed-box').boundingClientRect(data => {
|
|
92
|
+
let arr = data.map(item=>{
|
|
93
|
+
let card = this.cardComputedList.filter(it=>{
|
|
94
|
+
return item.dataset.card === it.card_number;
|
|
95
|
+
})[0];
|
|
96
|
+
card['height'] = item.height;
|
|
97
|
+
card['top'] = this.cardNextTop;
|
|
98
|
+
card['index'] = this.cardIndex;
|
|
99
|
+
this.cardNextTop = this.cardNextTop + card['height'] + (paddingBottom * this.$rpxNum);
|
|
100
|
+
this.cardIndex++;
|
|
101
|
+
return card
|
|
102
|
+
});
|
|
103
|
+
this.cardList = (this.cardList||[]).concat(arr);
|
|
104
|
+
this.$xdHideLoading();
|
|
105
|
+
}).exec();
|
|
106
|
+
})
|
|
107
|
+
},
|
|
108
|
+
|
|
109
|
+
handleCardInit(cardList,type,paddingBottom =30){
|
|
110
|
+
let newCardList = this.$xdUniHelper.cloneDeep(cardList);
|
|
111
|
+
let validCardList = this.getCardGroupItem(newCardList.list.filter((item) => {
|
|
112
|
+
// 判断type是否为'is_valid'
|
|
113
|
+
if (type === 'is_valid') {
|
|
114
|
+
// 如果是,则返回item.is_transfering是否不等于'Y'
|
|
115
|
+
return item[type] === 'Y' && item.is_transfering !== 'Y';
|
|
116
|
+
} else if(type === 'is_exchange') {
|
|
117
|
+
// 如果是,则返回item.is_transfering是否不等于'Y'
|
|
118
|
+
return item[type] === 'Y' && item.is_transfering !== 'Y';
|
|
119
|
+
} else {
|
|
120
|
+
// 否则,返回item[type]是否等于'Y'
|
|
121
|
+
return item[type] === 'Y';
|
|
122
|
+
}
|
|
123
|
+
}), newCardList['site_entry_settings']).map((item,index)=>{
|
|
124
|
+
item['index'] = index;
|
|
125
|
+
return item
|
|
126
|
+
});
|
|
127
|
+
console.log(validCardList,'validCardListvalidCardList');
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
this.cardOrgList = this.$xdUniHelper.cloneDeep(validCardList);
|
|
131
|
+
console.warn(`cardOrgList:${this.cardOrgList.length}`)
|
|
132
|
+
this.cardComputedList = this.$xdUniHelper.cloneDeep(this.cardOrgList).slice(this.cardPageNum,this.cardPageLen);
|
|
133
|
+
if(this.cardComputedList.length < this.cardPageLen) {
|
|
134
|
+
this.hasContent = false;
|
|
135
|
+
}
|
|
136
|
+
this.handleCardComputed(paddingBottom).then().catch();
|
|
137
|
+
},
|
|
138
|
+
|
|
139
|
+
onJfbScroll({e}){
|
|
140
|
+
if(this.showStatus) {
|
|
141
|
+
this.setSrollPreview({
|
|
142
|
+
pageWindowPrevStart: e.scrollTop,
|
|
143
|
+
pageWindowPrevEnd:e.scrollTop + uni.getSystemInfoSync().safeArea.height
|
|
144
|
+
})
|
|
145
|
+
}
|
|
146
|
+
},
|
|
147
|
+
|
|
148
|
+
onJfbReachBottom(){
|
|
149
|
+
//加载在不处理,无下一页不处理,当前也为0不处理
|
|
150
|
+
if(this.cardLoading || !this.hasContent || this.cardPageNum === 0) return;
|
|
151
|
+
this.cardLoading = true;
|
|
152
|
+
this.$xdShowLoading({});
|
|
153
|
+
this.$nextTick(()=>{
|
|
154
|
+
setTimeout(()=>{
|
|
155
|
+
this.cardLoading = false;
|
|
156
|
+
this.$xdHideLoading();
|
|
157
|
+
this.cardComputedList = this.$xdUniHelper.cloneDeep(this.cardOrgList).slice(
|
|
158
|
+
this.cardPageNum*this.cardPageLen,
|
|
159
|
+
this.cardPageNum*this.cardPageLen + this.cardPageLen
|
|
160
|
+
);
|
|
161
|
+
this.handleCardComputed().then().catch();
|
|
162
|
+
if(this.cardComputedList.length < this.cardPageLen) {
|
|
163
|
+
this.hasContent = false;
|
|
164
|
+
}
|
|
165
|
+
this.cardPageNum++;
|
|
166
|
+
},500)
|
|
167
|
+
})
|
|
168
|
+
|
|
169
|
+
},
|
|
170
|
+
|
|
171
|
+
clearDefault(){
|
|
172
|
+
this.cardOrgList = [];
|
|
173
|
+
this.cardList = null;
|
|
174
|
+
this.cardPageNum = 0;
|
|
175
|
+
this.cardComputedList = [];
|
|
176
|
+
this.cardLoading = false;
|
|
177
|
+
this.cardNextTop = 0;
|
|
178
|
+
this.contentStatus = false;
|
|
179
|
+
this.hasContent = true;
|
|
180
|
+
this.cardIndex = 0;
|
|
181
|
+
this.ajaxCardList = null;
|
|
182
|
+
//this.hasChangeStatus = false;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
import {mapActions, mapMutations} from 'vuex';
|
|
3
|
+
import storage from "@/common/storage";
|
|
4
|
+
import getServiceUrl from "@/common/getServiceUrl";
|
|
5
|
+
|
|
6
|
+
export default {
|
|
7
|
+
data() {
|
|
8
|
+
return {
|
|
9
|
+
colorObj : {},
|
|
10
|
+
}
|
|
11
|
+
},
|
|
12
|
+
|
|
13
|
+
created(){
|
|
14
|
+
this.colorObj = this.$colorConfig || getApp().globalData.$colorConfig;
|
|
15
|
+
},
|
|
16
|
+
|
|
17
|
+
methods: {
|
|
18
|
+
stringToNumber(str) {
|
|
19
|
+
let result = 0;
|
|
20
|
+
let len = str.length;
|
|
21
|
+
for (let i = 0; i < len; i++) {
|
|
22
|
+
result = result + str.charCodeAt(i) + i;
|
|
23
|
+
}
|
|
24
|
+
return result;
|
|
25
|
+
},
|
|
26
|
+
getCardThemes(name , disabled='N') {
|
|
27
|
+
let colorLen = this.colorObj.cardThemesColor.length;
|
|
28
|
+
let imgLen = this.colorObj.cardThemesImage.length;
|
|
29
|
+
let colorIndex = this.stringToNumber(name) % colorLen;
|
|
30
|
+
let imgIndex = this.stringToNumber(name) % imgLen;
|
|
31
|
+
return {
|
|
32
|
+
color: disabled === 'N' ? this.colorObj.cardThemesColor[colorIndex]: this.getDisabledColor(),
|
|
33
|
+
image: this.colorObj.cardThemesImage[imgIndex],
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
getEntry(codes = [], allEntry = []) {
|
|
37
|
+
//无支持业务线或者未配置业务入口
|
|
38
|
+
if (codes.length === 0 || allEntry.length === 0) return [];
|
|
39
|
+
|
|
40
|
+
let support = [];
|
|
41
|
+
codes.map(bus => {
|
|
42
|
+
allEntry.map(it => {
|
|
43
|
+
it['image_url'] = getServiceUrl(it['image_url'])
|
|
44
|
+
if (bus === it['business_code']) {
|
|
45
|
+
support.push(it);
|
|
46
|
+
}
|
|
47
|
+
})
|
|
48
|
+
});
|
|
49
|
+
return support
|
|
50
|
+
},
|
|
51
|
+
|
|
52
|
+
filterNotSupportEntry(allEntry){
|
|
53
|
+
let isH5FilterEntryList = [];
|
|
54
|
+
let isMpFilterEntryList = [];
|
|
55
|
+
allEntry = allEntry.map(item=>{
|
|
56
|
+
try {
|
|
57
|
+
if(!item.redirect_data) item.redirect_data = null;
|
|
58
|
+
else {
|
|
59
|
+
item.redirect_data = JSON.parse(item.redirect_data);
|
|
60
|
+
item.redirect_data.appType = item.redirect_data.appType || 'h5';
|
|
61
|
+
}
|
|
62
|
+
}catch (e){
|
|
63
|
+
item.redirect_data = null
|
|
64
|
+
}
|
|
65
|
+
return item;
|
|
66
|
+
})
|
|
67
|
+
.filter(item=>{
|
|
68
|
+
//地址不存在
|
|
69
|
+
if(!item.redirect_data) return false
|
|
70
|
+
|
|
71
|
+
//#ifdef H5
|
|
72
|
+
//在H5平台应用中不可跳转到微信小程序应用
|
|
73
|
+
if(item.redirect_data.appType === 'wxmp'){
|
|
74
|
+
isH5FilterEntryList.push(item)
|
|
75
|
+
}
|
|
76
|
+
return item.redirect_data.appType !== 'wxmp';
|
|
77
|
+
//#endif
|
|
78
|
+
|
|
79
|
+
//#ifdef MP-WEIXIN
|
|
80
|
+
const dir = item['redirect_data'].dir;
|
|
81
|
+
const actDir = this.projectAttr['deploy_dir'];
|
|
82
|
+
if(item.redirect_data.appType === 'wxmp') {
|
|
83
|
+
if(dir !== actDir) isMpFilterEntryList.push(item)
|
|
84
|
+
return dir === actDir;
|
|
85
|
+
}
|
|
86
|
+
return true
|
|
87
|
+
//#endif
|
|
88
|
+
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
//#ifdef MP-WEIXIN
|
|
92
|
+
console.warn(`微信小程序端被过滤的入口列表:${JSON.stringify(isMpFilterEntryList.map(item=> `${item.redirect_data.appType}:${item.entry_name}:${item.redirect_data['frontPath']}`),null,2)}`)
|
|
93
|
+
//#endif
|
|
94
|
+
//#ifdef H5
|
|
95
|
+
console.warn(`H5端被过滤的入口列表:${JSON.stringify(isH5FilterEntryList.map(item=> `${item.redirect_data.appType}:${item.entry_name}:${item.redirect_data['frontPath']}`),null,2)}`)
|
|
96
|
+
//#endif
|
|
97
|
+
console.warn(`福利入口链接列表:${JSON.stringify(allEntry.map(item=> `${item.redirect_data.appType}:${item.redirect_data.appType === 'h5'?(item.redirect_data['site_url'] || item.redirect_data['path']) :item.redirect_data['path']}`),null,2)}`);
|
|
98
|
+
|
|
99
|
+
return allEntry
|
|
100
|
+
},
|
|
101
|
+
|
|
102
|
+
getCardGroupItem(list, allEntry, disabled='N') {
|
|
103
|
+
list.map(item => {
|
|
104
|
+
//设置卡片样式
|
|
105
|
+
item['theme'] = this.getCardThemes(item['card_type_name'], disabled);
|
|
106
|
+
item['entries'] = this.getEntry(item['business_codes'], allEntry)
|
|
107
|
+
});
|
|
108
|
+
return list
|
|
109
|
+
},
|
|
110
|
+
|
|
111
|
+
getDisabledColor(){
|
|
112
|
+
return this.colorObj.disableColor
|
|
113
|
+
},
|
|
114
|
+
getMergBg(disabled = 'Y'){
|
|
115
|
+
return disabled === 'Y' ? this.colorObj['mergIcon'][1]
|
|
116
|
+
: this.colorObj['mergIcon'][0]
|
|
117
|
+
},
|
|
118
|
+
getNoData(){
|
|
119
|
+
return this.colorObj.nodata
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
}
|