feat: add virtual resource payments and optimize images
This commit is contained in:
101
pages/index.vue
101
pages/index.vue
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<view class="">
|
||||
<image style="position: relative;z-index: 1;" class="fengrui-img" src="https://img.yidaima.cn/feast/index_bj.jpg"
|
||||
<image style="position: relative;z-index: 1;" class="fengrui-img" src="/static/home/index-bg.jpg"
|
||||
mode="aspectFill"></image>
|
||||
<view style="position: relative;z-index: 2;" class="index-box">
|
||||
<view class="notice-box">
|
||||
@@ -10,7 +10,7 @@
|
||||
</view>
|
||||
</view>
|
||||
<!-- 轮播图 -->
|
||||
<carousel :img-list="swiperData" url-key="url" @selected="selectedBanner"/>
|
||||
<carousel :img-list="swiperData"/>
|
||||
<!-- <uni-swiper-dot class="uni-swiper-dot-box" :info="swiperData" :current="current" field="content">
|
||||
<swiper autoplay :circular="true" interval="2000" class="swiper-box" :current="swiperDotIndex"
|
||||
@change="changeSwiper">
|
||||
@@ -22,7 +22,7 @@
|
||||
</swiper>
|
||||
</uni-swiper-dot> -->
|
||||
<view class="index-info">
|
||||
<view class="mt30 grid text-center col-4 bg-white" style="padding: 30rpx 0; border-radius: 15rpx;row-gap: 30rpx;">
|
||||
<view class="mt30 grid text-center col-3 bg-white" style="padding: 30rpx 0; border-radius: 15rpx;row-gap: 30rpx;">
|
||||
<view @click="Jump('/pages/tool/highQualityCode')">
|
||||
<image class="cell_3_icon flex justify-center align-center" style="height:65rpx;" src="https://img.yidaima.cn/feast/sjbz.png" mode="aspectFit">
|
||||
</image>
|
||||
@@ -33,11 +33,6 @@
|
||||
</image>
|
||||
<view>资源分享</view>
|
||||
</view>
|
||||
<view @click="Jump('/pages/tool/video')">
|
||||
<image class="cell_3_icon flex justify-center align-center" style="height: 65rpx;" src="https://img.yidaima.cn/feast/sp.png" mode="aspectFit">
|
||||
</image>
|
||||
<view>演示视频</view>
|
||||
</view>
|
||||
<view @click="Jump('/pages/tool/freeCode')">
|
||||
<image class="cell_3_icon flex justify-center align-center" style="height: 65rpx;" src="https://img.yidaima.cn/feast/sycc.png" mode="aspectFit">
|
||||
</image>
|
||||
@@ -64,15 +59,18 @@
|
||||
</view>
|
||||
<view style="height: 240rpx;" v-else>
|
||||
<!-- <image class="blog-img" :src="baseUrl+item.showImg"></image> -->
|
||||
<image class="blog-img" :src="item.showImg"></image>
|
||||
<image class="blog-img" :src="articleImage(item)" lazy-load mode="aspectFill" @error="articleImageError(item)"></image>
|
||||
<view class="info-box">
|
||||
<view class="ellipsis-multiline">
|
||||
{{item.title}}
|
||||
</view>
|
||||
<view class="info-icon">
|
||||
<image v-if="item.isAd == 0" class="muen-sld-icon" src="https://img.yidaima.cn/feast/guanggao.svg" mode=""></image>
|
||||
<image v-if="item.appResourceId" class="muen-sld-icon" src="https://img.yidaima.cn/feast/xiazai.svg" mode=""></image>
|
||||
<image v-if="item.weight == 999" class="muen-sld-icon2" src="https://img.yidaima.cn/feast/top.svg" mode=""></image>
|
||||
<image v-if="item.appResource.isAd == 0" class="muen-sld-icon" src="https://img.yidaima.cn/mf.svg" mode=""></image>
|
||||
<image v-if="item.appResource.isAd == 1" class="muen-sld-icon" src="https://img.yidaima.cn/feast/guanggao.svg" mode=""></image>
|
||||
<image v-if="item.appResource.isAd == 2" class="muen-sld-icon" src="https://img.yidaima.cn/jf.svg" mode=""></image>
|
||||
<image v-if="item.appResource.isAd == 3" class="muen-sld-icon" src="https://img.yidaima.cn/ff.svg" mode=""></image>
|
||||
<image v-if="item.appResourceId" class="muen-sld-icon" src="https://img.yidaima.cn/feast/xiazai.svg" mode=""></image>
|
||||
<image v-if="item.weight == 999" class="muen-sld-icon2" src="https://img.yidaima.cn/feast/top.svg" mode=""></image>
|
||||
</view>
|
||||
<view class="muen-sld-time"><text style="float: left;">{{item.createTime}}</text>
|
||||
<text class="cuIcon-attention look-number"><text>{{item.lookNumber}}</text></text></view>
|
||||
@@ -132,7 +130,7 @@
|
||||
getConfigKey
|
||||
} from "@/api/app/public.js"
|
||||
import {
|
||||
listArticle,newUser,wxLogin,autoLoginWx,getSysSet
|
||||
listArticle,newUser,wxLogin,getSysSet
|
||||
} from "@/api/app/index.js"
|
||||
import {
|
||||
getQiniuToken
|
||||
@@ -203,27 +201,19 @@
|
||||
uni.login({
|
||||
provider: 'weixin',
|
||||
success: loginRes => {
|
||||
//获取openid
|
||||
autoLoginWx(loginRes.code).then(response => {
|
||||
var antoInfo = JSON.parse(response.msg)
|
||||
var data = {
|
||||
openId: antoInfo.openid,
|
||||
oldUserId : 0
|
||||
}
|
||||
//邀请用户
|
||||
if(option.userid && option.userid != 'undefined'){
|
||||
data.oldUserId = option.userid
|
||||
}
|
||||
//登录
|
||||
wxLogin(data).then(logininfo => {
|
||||
setToken(logininfo.token)
|
||||
//设置用户信息
|
||||
this.$store.dispatch('GetInfo').then(res => {
|
||||
|
||||
})
|
||||
var data = {
|
||||
code: loginRes.code,
|
||||
oldUserId : 0
|
||||
}
|
||||
//邀请用户
|
||||
if(option.userid && option.userid != 'undefined'){
|
||||
data.oldUserId = option.userid
|
||||
}
|
||||
wxLogin(data).then(logininfo => {
|
||||
setToken(logininfo.token)
|
||||
this.$store.dispatch('GetInfo').then(res => {
|
||||
})
|
||||
})
|
||||
|
||||
}
|
||||
});
|
||||
//获取系统配置数据
|
||||
@@ -241,12 +231,6 @@
|
||||
that.modalName = "indexModal"
|
||||
uni.setStorageSync("isIndexModal", that.modalInfo)
|
||||
}
|
||||
//轮播图
|
||||
that.swiperData = []
|
||||
var swiper = setinfo.indexSwiper.split(",")
|
||||
for(var i=0; i < swiper.length; i++){
|
||||
that.swiperData.push({image:swiper[i]})
|
||||
}
|
||||
})
|
||||
//获取文章列表
|
||||
this.getBlogList()
|
||||
@@ -285,6 +269,41 @@
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
articleImage(item) {
|
||||
if (item && item.imageFallback) {
|
||||
return this.$image.original(item.showImg)
|
||||
}
|
||||
return this.$image.articleThumbnail(item)
|
||||
},
|
||||
articleImageError(item) {
|
||||
if (!item || item.imageFallback || !item.showImg) {
|
||||
return
|
||||
}
|
||||
this.$set(item, 'imageFallback', true)
|
||||
},
|
||||
setArticleSwiper(articleList) {
|
||||
this.swiperData = (articleList || [])
|
||||
.filter(item => item && Number(item.weight) !== 999)
|
||||
.slice(0, 5)
|
||||
.map(item => ({
|
||||
id: item.id,
|
||||
image: this.$image.articleThumbnail(item),
|
||||
fallbackImage: this.$image.original(item.showImg),
|
||||
url: '/pages/blog/bloginfo?id=' + item.id
|
||||
}))
|
||||
},
|
||||
getArticleSwiper(pageSize) {
|
||||
listArticle({
|
||||
pageNum: 1,
|
||||
pageSize: pageSize,
|
||||
isShow: this.queryParams.isShow
|
||||
}).then(response => {
|
||||
this.setArticleSwiper(response.rows)
|
||||
if (this.swiperData.length < 5 && response.rows.length < response.total) {
|
||||
this.getArticleSwiper(Math.min(pageSize + 5, response.total))
|
||||
}
|
||||
})
|
||||
},
|
||||
offApp(){
|
||||
uni.exitMiniProgram({
|
||||
success: function () {
|
||||
@@ -332,6 +351,10 @@
|
||||
getBlogList(){
|
||||
var that = this;
|
||||
listArticle(this.queryParams).then(response => {
|
||||
that.setArticleSwiper(response.rows)
|
||||
if (that.swiperData.length < 5 && response.rows.length < response.total) {
|
||||
that.getArticleSwiper(response.rows.length + 5)
|
||||
}
|
||||
that.blogList = response.rows
|
||||
var allTotal = this.queryParams.pageNum * this.queryParams.pageSize
|
||||
that.total = response.total
|
||||
@@ -603,4 +626,4 @@
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user