Commit 51a7dd2c authored by yuwenwen's avatar yuwenwen

移动端BUG修复

parent 688ebc98
...@@ -5,6 +5,10 @@ ...@@ -5,6 +5,10 @@
<image class="avatar" v-if="form.faceImg" :src="form.faceImg" @error="imgLoadFail"></image> <image class="avatar" v-if="form.faceImg" :src="form.faceImg" @error="imgLoadFail"></image>
<!-- <image class="avatar" v-else src="/static/images/default-avatar.png"></image> --> <!-- <image class="avatar" v-else src="/static/images/default-avatar.png"></image> -->
<view class="user-name">{{form.nickName}}</view> <view class="user-name">{{form.nickName}}</view>
<view class="top-icon" v-if="form.isTop==1">
<image class="icon" src="/static/images/is-top.png"></image>
</view>
<image v-if="deleteable || userInfo.bbsAdmin || form.isSelf==1" class="more-icon" <image v-if="deleteable || userInfo.bbsAdmin || form.isSelf==1" class="more-icon"
@click.stop="handleDelDynamics" src="/static/images/more-icon.png"></image> @click.stop="handleDelDynamics" src="/static/images/more-icon.png"></image>
<image v-else class="more-icon" src="/static/images/more-icon.png"></image> <image v-else class="more-icon" src="/static/images/more-icon.png"></image>
...@@ -391,8 +395,9 @@ ...@@ -391,8 +395,9 @@
}, },
// 预览图片 // 预览图片
preview(list, index) { preview(list, index) {
console.log(list, index)
let urls = list.map((item) => { let urls = list.map((item) => {
return item.url; return item.imageUrl;
}) })
if (urls.length > 0) { if (urls.length > 0) {
uni.previewImage({ uni.previewImage({
......
...@@ -2,11 +2,14 @@ ...@@ -2,11 +2,14 @@
<view class="detail-page-container pk-detail-page"> <view class="detail-page-container pk-detail-page">
<view class="pk-tab-box" v-if="voteOptions.length>0"> <view class="pk-tab-box" v-if="voteOptions.length>0">
<view class="tab-item" v-for="(item,index) in voteOptions" @click="handleChange(item,index)"> <view class="tab-item" v-for="(item,index) in voteOptions" @click="handleChange(item,index)">
<view class="text" :class="{'active':index==activeIndex}">{{item.name}}{{item.voteCount}}</view> <view class="text"
:class="{'active-red':(index==0&&index==activeIndex),'active':(index==1&&index==activeIndex)}">
{{optionText[index].text}}{{item.voteCount}}</view>
</view> </view>
</view> </view>
<scroll-view class="scroll-view-pk" scroll-y :show-scrollbar="false" v-if="list.length>0" @scrolltolower="loadMore"> <scroll-view class="scroll-view-pk" scroll-y :show-scrollbar="false" v-if="list.length>0"
@scrolltolower="loadMore">
<view class="list-item" v-for="(item,index) in list"> <view class="list-item" v-for="(item,index) in list">
<image src="/static/images/default-avatar.png" class="avatar"></image> <image src="/static/images/default-avatar.png" class="avatar"></image>
<view class="name">{{item.nickName}}</view> <view class="name">{{item.nickName}}</view>
...@@ -32,15 +35,20 @@ ...@@ -32,15 +35,20 @@
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
momentId: '', momentId: '',
optionCode:undefined optionCode: undefined
}, },
total:0, total: 0,
activeIndex: 0, activeIndex: 0,
voteOptions: [], voteOptions: [],
list:[] list: [],
optionText: [{
text: '红方'
}, {
text: '蓝方'
}]
} }
}, },
components:{ components: {
ListEmpty ListEmpty
}, },
onLoad(options) { onLoad(options) {
...@@ -58,16 +66,16 @@ ...@@ -58,16 +66,16 @@
methods: { methods: {
getList() { getList() {
uni.showLoading({ uni.showLoading({
title:'加载中...' title: '加载中...'
}) })
voteList(this.queryParams).then(res => { voteList(this.queryParams).then(res => {
this.list = [...this.list,...res.rows]; this.list = [...this.list, ...res.rows];
this.total = res.total; this.total = res.total;
}).finally(()=>{ }).finally(() => {
uni.hideLoading() uni.hideLoading()
}) })
}, },
handleChange(item,index){ handleChange(item, index) {
this.activeIndex = index this.activeIndex = index
this.queryParams.optionCode = item.code; this.queryParams.optionCode = item.code;
this.queryParams.pageNum = 1; this.queryParams.pageNum = 1;
...@@ -75,7 +83,7 @@ ...@@ -75,7 +83,7 @@
this.getList() this.getList()
}, },
loadMore() { loadMore() {
if(this.list.length < this.total){ if (this.list.length < this.total) {
this.queryParams.pageNum += 1; this.queryParams.pageNum += 1;
this.getList() this.getList()
} }
...@@ -89,6 +97,7 @@ ...@@ -89,6 +97,7 @@
.pk-detail-page { .pk-detail-page {
background-color: white; background-color: white;
.pk-tab-box { .pk-tab-box {
height: 92rpx; height: 92rpx;
display: flex; display: flex;
...@@ -113,6 +122,11 @@ ...@@ -113,6 +122,11 @@
color: #3484FD; color: #3484FD;
border-bottom: 4rpx solid #3484FD; border-bottom: 4rpx solid #3484FD;
} }
.active-red {
color: #ff645f;
border-bottom: 4rpx solid #ff645f;
}
} }
} }
...@@ -149,4 +163,4 @@ ...@@ -149,4 +163,4 @@
} }
} }
} }
</style> </style>
\ No newline at end of file
...@@ -48,8 +48,8 @@ ...@@ -48,8 +48,8 @@
<view class="choice-box" v-if="form.voteOptionType=='IMAGE'"> <view class="choice-box" v-if="form.voteOptionType=='IMAGE'">
<view class="choice-item"> <view class="choice-item">
<image-upload v-model="voteOptionsAffirmative" :limit="1" :width="120" :height="120" <image-upload v-model="voteOptionsAffirmative" :mediaType="['image']" :limit="1" :width="120" :height="120"
:showIcons="false"></image-upload> :showIcons="false" ></image-upload>
<input class="text" maxlength="16" v-model="form.voteOptions[0].name" <input class="text" maxlength="16" v-model="form.voteOptions[0].name"
placeholder="请输入选项1(16字以内)" /> placeholder="请输入选项1(16字以内)" />
</view> </view>
......
...@@ -22,9 +22,22 @@ ...@@ -22,9 +22,22 @@
border-radius: 50%; border-radius: 50%;
} }
.user-name{ .user-name{
width: calc(100% - 168rpx); width: calc(100% - 208rpx);
color: rgba(16, 16, 16, 1); color: rgba(16, 16, 16, 1);
} }
.top-icon{
width: 40rpx;
height: 40rpx;
border-radius: 6rpx;
background-color: rgba(242, 172, 57, 0.1);
display: flex;
align-items: center;
justify-content: center;
.icon{
width: 24rpx;
height: 24rpx;
}
}
.more-icon{ .more-icon{
width: 48rpx; width: 48rpx;
height: 48rpx; height: 48rpx;
......
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