Commit c1ef314b authored by Mac's avatar Mac

1

parent 96b0080f
......@@ -112,10 +112,9 @@
<view class="gardenCon" v-for="(item1,index1) in item.List" :key="index1" id="img">
<image :src="item1.Img" mode="aspectFill"
style="width: 100%;height:100%;border-radius: 24rpx 24rpx 0 0;"></image>
<view class="gardenTextBox" :style="{background:'linear-gradient(0deg,'+getColor(item1.Img)}">
<view class="gardenTextBox" :style="{background:'linear-gradient(to bottom,0deg,'+item1.bgcolor}">
<view class="gardenTitle one_line">
{{item1.Title}}
{{getColor(item1.Img)}}
</view>
<view class="gardenDigest one_line">
{{item1.Digest}}
......@@ -190,11 +189,22 @@
proxy.$request("/AppletIndex/GetIndexInfo_V2", {}).then(res => {
// console.log(222, res)
data.pageData = res.Data
if(data.pageData.LearningGardenList.length>0){
data.pageData.LearningGardenList.forEach(x=>{
if(x.List.length>0){
x.List.forEach(item=>{
this.getColor(item.Img).then(v=>{
item.bgcolor = v
})
})
}
})
}
})
},
async getColor(src) {
let res = await getImageColor('myCanvas', 'img', src)
const formatres = `rgba(${res.r},${res.g},${res.b})`
const formatres = `rgba(${res.r},${res.g},${res.b},1)`
console.log(168, formatres)
return formatres
},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment