|
@@ -1,7 +1,8 @@
|
|
<template>
|
|
<template>
|
|
<view class="main">
|
|
<view class="main">
|
|
<view class="info">
|
|
<view class="info">
|
|
- <scroll-view scroll-y="true" :scroll-top="scrollTop" class="scroll-view">
|
|
|
|
|
|
+ <scroll-view scroll-y="true" :scroll-top="scrollTop" class="scroll-view" @scrolltolower="toPage"
|
|
|
|
+ @scroll="toScroll">
|
|
<view class="list-scroll-view">
|
|
<view class="list-scroll-view">
|
|
<view class="one">
|
|
<view class="one">
|
|
<swiperImg :imgsList='info.file'></swiperImg>
|
|
<swiperImg :imgsList='info.file'></swiperImg>
|
|
@@ -16,18 +17,17 @@
|
|
</view>
|
|
</view>
|
|
<view class="thr">
|
|
<view class="thr">
|
|
<view class="thr_1">评论 {{total}}</view>
|
|
<view class="thr_1">评论 {{total}}</view>
|
|
- <scroll-view scroll-y="true" class="scroll-view" @scrolltolower="toPage" @scroll="toScroll">
|
|
|
|
|
|
+ <scroll-view scroll-y="true" class="scroll">
|
|
<view class="list-scroll-view">
|
|
<view class="list-scroll-view">
|
|
- <view class="thr_2">
|
|
|
|
- <view class="list" v-for="(item,index) in list" :key="index">
|
|
|
|
- <image class="image"
|
|
|
|
- :src="item.user_file&&item.user_file.length>0?item.user_file[0].url:'../../static/my.png'"
|
|
|
|
- mode="aspectFill">
|
|
|
|
- </image>
|
|
|
|
- <view class="other">
|
|
|
|
- <view class="name textOver">{{item.user_name||'暂无'}}</view>
|
|
|
|
- <view class="content">{{item.content||'暂无'}}</view>
|
|
|
|
- </view>
|
|
|
|
|
|
+ <view class="list" v-for="(item,index) in list" :key="index">
|
|
|
|
+ <image class="image"
|
|
|
|
+ :src="item.user_file&&item.user_file.length>0?item.user_file[0].url:'../../static/my.png'"
|
|
|
|
+ mode="aspectFill">
|
|
|
|
+ </image>
|
|
|
|
+ <view class="other">
|
|
|
|
+ <view class="name textOver">{{item.user_name||'暂无'}}</view>
|
|
|
|
+ <view class="content">{{item.content||'暂无'}}</view>
|
|
|
|
+ <view class="name">{{item.create_time||'暂无'}}</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<view class="is_bottom" v-if="is_bottom">
|
|
<view class="is_bottom" v-if="is_bottom">
|
|
@@ -83,7 +83,7 @@
|
|
list: [],
|
|
list: [],
|
|
total: 0,
|
|
total: 0,
|
|
skip: 0,
|
|
skip: 0,
|
|
- limit: 15,
|
|
|
|
|
|
+ limit: 6,
|
|
page: 0,
|
|
page: 0,
|
|
// 数据是否触底
|
|
// 数据是否触底
|
|
is_bottom: false,
|
|
is_bottom: false,
|
|
@@ -107,17 +107,13 @@
|
|
await that.search();
|
|
await that.search();
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
- searchConfig() {
|
|
|
|
|
|
+ async searchConfig() {
|
|
const that = this;
|
|
const that = this;
|
|
- try {
|
|
|
|
- const res = uni.getStorageSync('config');
|
|
|
|
- if (res) that.$set(that, `config`, res);
|
|
|
|
- } catch (e) {
|
|
|
|
- uni.showToast({
|
|
|
|
- title: err.errmsg,
|
|
|
|
- icon: 'error',
|
|
|
|
- duration: 2000
|
|
|
|
- });
|
|
|
|
|
|
+ let res;
|
|
|
|
+ // 基本设置
|
|
|
|
+ res = await that.$api(`/config`, 'GET', {});
|
|
|
|
+ if (res.errcode == '0') {
|
|
|
|
+ that.$set(that, `config`, res.data);
|
|
}
|
|
}
|
|
},
|
|
},
|
|
searchToken() {
|
|
searchToken() {
|
|
@@ -178,6 +174,13 @@
|
|
...info,
|
|
...info,
|
|
});
|
|
});
|
|
if (res.errcode == '0') {
|
|
if (res.errcode == '0') {
|
|
|
|
+ for (let val of res.data) {
|
|
|
|
+ const user = await that.$api(`/user/${val.user}`, 'GET', {});
|
|
|
|
+ if (user.errcode == '0') {
|
|
|
|
+ val.user_file = user.data.logo
|
|
|
|
+ val.user_name = user.data.name || user.data.nick_name
|
|
|
|
+ }
|
|
|
|
+ }
|
|
let list = [...that.list, ...res.data];
|
|
let list = [...that.list, ...res.data];
|
|
that.$set(that, `list`, list);
|
|
that.$set(that, `list`, list);
|
|
that.$set(that, `total`, res.total)
|
|
that.$set(that, `total`, res.total)
|
|
@@ -271,7 +274,7 @@
|
|
const that = this;
|
|
const that = this;
|
|
that.$set(that, `list`, [])
|
|
that.$set(that, `list`, [])
|
|
that.$set(that, `skip`, 0)
|
|
that.$set(that, `skip`, 0)
|
|
- that.$set(that, `limit`, 15)
|
|
|
|
|
|
+ that.$set(that, `limit`, 6)
|
|
that.$set(that, `page`, 0)
|
|
that.$set(that, `page`, 0)
|
|
},
|
|
},
|
|
// 查询其他信息
|
|
// 查询其他信息
|
|
@@ -332,6 +335,32 @@
|
|
font-size: var(--font15Size);
|
|
font-size: var(--font15Size);
|
|
border-bottom: 1px solid var(--f9Color);
|
|
border-bottom: 1px solid var(--f9Color);
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ .list {
|
|
|
|
+ display: flex;
|
|
|
|
+ align-items: center;
|
|
|
|
+ padding: 2vw;
|
|
|
|
+
|
|
|
|
+ .image {
|
|
|
|
+ width: 10vw;
|
|
|
|
+ height: 10vw;
|
|
|
|
+ border-radius: 10vw;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .other {
|
|
|
|
+ display: flex;
|
|
|
|
+ flex-direction: column;
|
|
|
|
+ width: 80vw;
|
|
|
|
+ padding: 2vw;
|
|
|
|
+ border-bottom: 1px solid var(--f9Color);
|
|
|
|
+ font-size: var(--font12Size);
|
|
|
|
+
|
|
|
|
+ .name {
|
|
|
|
+ color: var(--f85Color);
|
|
|
|
+ padding: 2px 0;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|