preSale.js
2.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
// 服务项目对应的图标
// const commonBaseURL = 'https://img02.glsx.com.cn/weapp/resource/miniprogram-test/glsx/'
import { IMG_VERSION } from './constantData'
const commonBaseURL = wx.$imgUrl
let ImageConfig = []
IMG_VERSION().then(version => {
ImageConfig = [{
name: `qq音乐`,
url: `${commonBaseURL}equity/QQ_music.png?v=${version}`
}, {
name: `WPS`,
url: `${commonBaseURL}equity/WPS.png?v=${version}`
}, {
name: `qq阅读`,
url: `${commonBaseURL}equity/QQ_read.png?v=${version}`
}, {
name: `爱奇艺`,
url: `${commonBaseURL}equity/aiqiyi.png?v=${version}`
}, {
name: `百度网盘`,
url: `${commonBaseURL}equity/baiduwp.png?v=${version}`
}, {
name: `哔哩哔哩`,
url: `${commonBaseURL}equity/bili.png?v=${version}`
}, {
name: `凯叔讲故事`,
url: `${commonBaseURL}equity/kaishu.png?v=${version}`
}, {
name: `酷狗音乐`,
url: `${commonBaseURL}equity/kugou.png?v=${version}`
}, {
name: `芒果TV`,
url: `${commonBaseURL}equity/mgTv.png?v=${version}`
}, {
name: `美团`,
url: `${commonBaseURL}equity/mtdc.png?v=${version}`
}, {
name: `奈雪`,
url: `${commonBaseURL}equity/naixue.png?v=${version}`
}, {
name: `瑞幸`,
url: `${commonBaseURL}equity/ruixin.png?v=${version}`
}, {
name: `腾讯视频`,
url: `${commonBaseURL}equity/tenxun.png?v=${version}`
}, {
name: `网易云`,
url: `${commonBaseURL}equity/wangyiyun.png?v=${version}`
}, {
name: `优酷`,
url: `${commonBaseURL}equity/youku.png?v=${version}`
}, {
name: `知乎`,
url: `${commonBaseURL}equity/zhihu.png?v=${version}`
}, {
name: `作业帮`,
url: `${commonBaseURL}equity/workjob.png?v=${version}`
}, {
name: `喜马拉雅`,
url: `${commonBaseURL}equity/ximalaya.png?v=${version}`
}, {
name: `e袋洗`,
url: `${commonBaseURL}equity/edaixi.png?v=${version}`
}]
})
const matchImage = (brandName) => {
// 避免字母大小写影响
brandName = brandName.toLowerCase()
//默认值
let url = 'https://img01.glsx.com.cn/weapp/resource/equity-h5-new/aiqiyi.png'
ImageConfig.forEach(item => {
if (brandName.indexOf(item.name.toLowerCase()) != -1) {
url = item.url
}
})
return url
}
const iconUtil = {
matchImage
}
export default iconUtil