This commit is contained in:
dong_bo0602 2022-06-09 15:40:43 +08:00
parent a1f9e23f6d
commit c7f6c43f46
22 changed files with 277 additions and 46 deletions

View File

@ -10,7 +10,8 @@ Page({
page: 1, page: 1,
rows: 5, rows: 5,
newsTypeId: '52baf515-304c-46f2-911a-355d889346f2', newsTypeId: '52baf515-304c-46f2-911a-355d889346f2',
showArea: '6dcbb862-4b48-4dca-aee1-d78fd76adc05' showArea: '6dcbb862-4b48-4dca-aee1-d78fd76adc05',
areaCode: ''
}, },
noticeList: [], noticeList: [],
serviceUrl: app.baseUrls.serviceUrl, serviceUrl: app.baseUrls.serviceUrl,
@ -273,7 +274,7 @@ Page({
*/ */
onLoad: function (options) { onLoad: function (options) {
// this.doLogin() // this.doLogin()
this.getNotice()
this.checkPermission() this.checkPermission()
wx.setStorage({ wx.setStorage({
data: '1', data: '1',
@ -304,8 +305,10 @@ Page({
this.setData({ this.setData({
curCommunityName: wx.getStorageSync('curCommunityName') ? wx.getStorageSync('curCommunityName'): '切换社区', curCommunityName: wx.getStorageSync('curCommunityName') ? wx.getStorageSync('curCommunityName'): '切换社区',
curCommunityId: wx.getStorageSync('curCommunityId') ? wx.getStorageSync('curCommunityId') : '', curCommunityId: wx.getStorageSync('curCommunityId') ? wx.getStorageSync('curCommunityId') : '',
curCommunity: wx.getStorageSync('curCommunityName') curCommunity: wx.getStorageSync('curCommunityName'),
['page.areaCode']: wx.getStorageSync('areaCode') ? wx.getStorageSync('areaCode') : ''
}) })
this.getNotice()
}, },
/** /**

View File

@ -18,8 +18,14 @@
</view> </view>
<view class="help-type">{{circleDetail.problemTypeName}}</view> <view class="help-type">{{circleDetail.problemTypeName}}</view>
<view class="help-photo" wx:if="{{circleDetail.photo.length > 0}}"> <view class="help-photo" wx:if="{{circleDetail.photo.length > 0}}">
<view class="photo-box" wx:for="{{circleDetail.photo}}" wx:if="{{item}}" wx:key="index" bindtap="viewImg" data-id="{{item}}"> <view class="photo-box help-photo-box photo-one" wx:for="{{circleDetail.photo}}" wx:for-item="photo" wx:key="photo" wx:if="{{circleDetail.photo.length == 1}}" bindtap="viewImg" data-id="{{photo}}">
<image src="{{serviceUrl + baseImgUrl + item}}" mode="heightFix"></image> <image src="{{serviceUrl + baseImgUrl + photo}}" mode="widthFix"></image>
</view>
<view class="photo-box help-photo-box photo-four" wx:for="{{circleDetail.photo}}" wx:for-item="photo" wx:key="photo" wx:if="{{circleDetail.photo.length == 4}}" bindtap="viewImg" data-id="{{photo}}">
<image src="{{serviceUrl + baseImgUrl + photo}}" mode="widthFix"></image>
</view>
<view class="photo-box help-photo-box photo-more" wx:for="{{circleDetail.photo}}" wx:for-item="photo" wx:key="photo" wx:if="{{circleDetail.photo.length > 1 && circleDetail.photo.length != 4}}" bindtap="viewImg" data-id="{{photo}}">
<image src="{{serviceUrl + baseImgUrl + photo}}" mode="widthFix"></image>
</view> </view>
</view> </view>
<view class="help-video" wx:if="{{circleDetail.video}}"> <view class="help-video" wx:if="{{circleDetail.video}}">

View File

@ -96,16 +96,41 @@
.photo-box{ .photo-box{
display: inline-block; display: inline-block;
width: 32%; width: 32%;
height: 150rpx; height: 180rpx;
margin-right: 2%; margin-right: 2%;
margin-bottom: 15rpx; margin-bottom: 15rpx;
text-align: center; text-align: center;
position: relative;
overflow: hidden;
} }
.photo-box:nth-child(3n){ .photo-box:nth-child(3n){
margin-right: 0; margin-right: 0;
} }
.photo-box image{ /* .photo-box image{
height: 100%; height: 100%;
} */
.photo-one{
width: 50%;
height: auto;
max-height: 600rpx;
}
.photo-one image{
max-width: 100%;
}
.photo-four image{
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
.photo-four:nth-child(3){
margin-right: 2%;
}
.photo-more image{
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
} }
.reply-row{ .reply-row{
line-height: 60rpx; line-height: 60rpx;

View File

@ -11,7 +11,7 @@
<view class="help-desc"> <view class="help-desc">
<view class="desc-title">邻里圈</view> <view class="desc-title">邻里圈</view>
<textarea placeholder="请输入您要发表的内容" model:value="{{content}}"></textarea> <textarea placeholder="请输入您要发表的内容" model:value="{{content}}"></textarea>
<view class="upload-file"> <view class="upload-file" wx:if="{{!videoId}}">
<view class="upload"> <view class="upload">
<view class="image" wx:for="{{imageList}}" wx:key="index"> <view class="image" wx:for="{{imageList}}" wx:key="index">
<image src="{{serviceUrl + baseImgUrl + item}}" mode="heightFix"></image> <image src="{{serviceUrl + baseImgUrl + item}}" mode="heightFix"></image>
@ -23,7 +23,7 @@
</view> </view>
</view> </view>
</view> </view>
<view class="upload-file"> <view class="upload-file" wx:if="{{imageList.length == 0}}">
<view class="upload"> <view class="upload">
<view class="add video" wx:if="{{videoId}}"> <view class="add video" wx:if="{{videoId}}">
<video src="{{serviceUrl + baseImgUrl + videoId}}"></video> <video src="{{serviceUrl + baseImgUrl + videoId}}"></video>

View File

@ -17,9 +17,18 @@
</view> </view>
<view class="help-type">{{helpDetail.problemTypeName}}</view> <view class="help-type">{{helpDetail.problemTypeName}}</view>
<view class="help-photo" wx:if="{{helpDetail.photo.length > 0}}"> <view class="help-photo" wx:if="{{helpDetail.photo.length > 0}}">
<view class="photo-box" wx:for="{{helpDetail.photo}}" wx:if="{{item}}" wx:key="index" bindtap="viewImg" data-id="{{item}}"> <view class="photo-box help-photo-box photo-one" wx:for="{{helpDetail.photo}}" wx:for-item="photo" wx:key="photo" wx:if="{{helpDetail.photo.length == 1}}" bindtap="viewImg" data-id="{{photo}}">
<image src="{{serviceUrl + baseImgUrl + item}}" mode="heightFix"></image> <image src="{{serviceUrl + baseImgUrl + photo}}" mode="widthFix"></image>
</view> </view>
<view class="photo-box help-photo-box photo-four" wx:for="{{helpDetail.photo}}" wx:for-item="photo" wx:key="photo" wx:if="{{helpDetail.photo.length == 4}}" bindtap="viewImg" data-id="{{photo}}">
<image src="{{serviceUrl + baseImgUrl + photo}}" mode="widthFix"></image>
</view>
<view class="photo-box help-photo-box photo-more" wx:for="{{helpDetail.photo}}" wx:for-item="photo" wx:key="photo" wx:if="{{helpDetail.photo.length > 1 && helpDetail.photo.length != 4}}" bindtap="viewImg" data-id="{{photo}}">
<image src="{{serviceUrl + baseImgUrl + photo}}" mode="widthFix"></image>
</view>
<!-- <view class="photo-box" wx:for="{{helpDetail.photo}}" wx:if="{{item}}" wx:key="index" >
<image src="{{serviceUrl + baseImgUrl + item}}" mode="heightFix"></image>
</view> -->
</view> </view>
<view class="help-video" wx:if="{{helpDetail.video}}"> <view class="help-video" wx:if="{{helpDetail.video}}">
<video src="{{serviceUrl + baseImgUrl + helpDetail.video}}"></video> <video src="{{serviceUrl + baseImgUrl + helpDetail.video}}"></video>

View File

@ -95,16 +95,41 @@
.photo-box{ .photo-box{
display: inline-block; display: inline-block;
width: 32%; width: 32%;
height: 150rpx; height: 180rpx;
margin-right: 2%; margin-right: 2%;
margin-bottom: 15rpx; margin-bottom: 15rpx;
text-align: center; text-align: center;
position: relative;
overflow: hidden;
} }
.photo-box:nth-child(3n){ .photo-box:nth-child(3n){
margin-right: 0; margin-right: 0;
} }
.photo-box image{ /* .photo-box image{
height: 100%; height: 100%;
} */
.photo-one{
width: 50%;
height: auto;
max-height: 600rpx;
}
.photo-one image{
max-width: 100%;
}
.photo-four image{
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
.photo-four:nth-child(3){
margin-right: 2%;
}
.photo-more image{
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
} }
.reply-row{ .reply-row{
line-height: 60rpx; line-height: 60rpx;

View File

@ -10,7 +10,8 @@ Page({
helpList: [], helpList: [],
page: { page: {
page: 1, page: 1,
rows: 10 rows: 10,
communityId: ''
}, },
haveMore: true, haveMore: true,
serviceUrl: app.baseUrls.serviceUrl, serviceUrl: app.baseUrls.serviceUrl,
@ -77,6 +78,9 @@ Page({
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad: function (options) { onLoad: function (options) {
this.setData({
['page.communityId']: options.communityId
})
this.getHelpList() this.getHelpList()
}, },

View File

@ -11,8 +11,14 @@
{{item.content}} {{item.content}}
</view> </view>
<view class="help-photo" wx:if="{{item.photo.length > 0}}"> <view class="help-photo" wx:if="{{item.photo.length > 0}}">
<view class="help-photo-box"> <view class="help-photo-box photo-one" wx:for="{{item.photo}}" wx:for-item="photo" wx:key="photo" wx:if="{{item.photo.length == 1}}">
<image src="{{serviceUrl + baseImgUrl + photo}}" wx:for="{{item.photo}}" wx:for-item="photo" wx:key="photo" mode="heightFix"></image> <image src="{{serviceUrl + baseImgUrl + photo}}" mode="widthFix"></image>
</view>
<view class="help-photo-box photo-four" wx:for="{{item.photo}}" wx:for-item="photo" wx:key="photo" wx:if="{{item.photo.length == 4}}">
<image src="{{serviceUrl + baseImgUrl + photo}}" mode="widthFix"></image>
</view>
<view class="help-photo-box photo-more" wx:for="{{item.photo}}" wx:for-item="photo" wx:key="photo" wx:if="{{item.photo.length > 1 && item.photo.length != 4}}">
<image src="{{serviceUrl + baseImgUrl + photo}}" mode="widthFix"></image>
</view> </view>
</view> </view>
<view class="help-video" wx:if="{{item.video}}"> <view class="help-video" wx:if="{{item.video}}">

View File

@ -54,12 +54,37 @@ page{
margin-right: 2%; margin-right: 2%;
margin-bottom: 20rpx; margin-bottom: 20rpx;
text-align: center; text-align: center;
position: relative;
overflow: hidden;
} }
.help-photo-box:nth-child(3n){ .help-photo-box:nth-child(3n){
margin-right: 0; margin-right: 0;
} }
.help-photo-box image{ /* .help-photo-box image{
height: 100%; height: 100%;
} */
.photo-one{
width: 50%;
height: auto;
max-height: 600rpx;
}
.photo-one image{
max-width: 100%;
}
.photo-four image{
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
.photo-four:nth-child(3){
margin-right: 2%;
}
.photo-more image{
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
} }
.help-video{ .help-video{
margin-top: 20rpx; margin-top: 20rpx;

View File

@ -58,6 +58,13 @@ Page({
submitHelp: function () { submitHelp: function () {
var self = this var self = this
if (!self.data.isLoading) { if (!self.data.isLoading) {
if (self.data.index == 0) {
wx.showToast({
title: '请选择发布类型',
icon: 'error'
})
return
}
var photo = '' var photo = ''
if (self.data.imageList.length > 0) { if (self.data.imageList.length > 0) {
for (let i = 0; i < self.data.imageList.length; i++) { for (let i = 0; i < self.data.imageList.length; i++) {

View File

@ -11,7 +11,7 @@
<view class="help-desc"> <view class="help-desc">
<view class="desc-title">问题描述</view> <view class="desc-title">问题描述</view>
<textarea placeholder="请输入您要发表的内容" model:value="{{content}}"></textarea> <textarea placeholder="请输入您要发表的内容" model:value="{{content}}"></textarea>
<view class="upload-file"> <view class="upload-file" wx:if="{{!videoId}}">
<view class="upload"> <view class="upload">
<view class="image" wx:for="{{imageList}}" wx:key="index"> <view class="image" wx:for="{{imageList}}" wx:key="index">
<image src="{{serviceUrl + baseImgUrl + item}}" mode="heightFix"></image> <image src="{{serviceUrl + baseImgUrl + item}}" mode="heightFix"></image>
@ -23,7 +23,7 @@
</view> </view>
</view> </view>
</view> </view>
<view class="upload-file"> <view class="upload-file" wx:if="{{imageList.length == 0}}">
<view class="upload"> <view class="upload">
<view class="add video" wx:if="{{videoId}}"> <view class="add video" wx:if="{{videoId}}">
<video src="{{serviceUrl + baseImgUrl + videoId}}"></video> <video src="{{serviceUrl + baseImgUrl + videoId}}"></video>

View File

@ -26,9 +26,10 @@ Page({
}, },
// 邻里互助查看更多 // 邻里互助查看更多
checkHelpMore: function () { checkHelpMore: function () {
var self = this
if (this.data.tab == '1') { if (this.data.tab == '1') {
wx.navigateTo({ wx.navigateTo({
url: './help/helpList', url: './help/helpList?communityId=' + self.data.communitySelected,
}) })
} else { } else {
wx.navigateTo({ wx.navigateTo({
@ -52,6 +53,10 @@ Page({
['page.communityId']: self.data.communityList[e.detail.value].communityId, ['page.communityId']: self.data.communityList[e.detail.value].communityId,
areaCode: self.data.communityList[e.detail.value].areaCode, areaCode: self.data.communityList[e.detail.value].areaCode,
}) })
wx.setStorage({
data: e.detail.value,
key: 'communityIndex'
})
if (this.data.tab == '1') { if (this.data.tab == '1') {
self.getHelpList() self.getHelpList()
} else { } else {
@ -135,9 +140,9 @@ Page({
self.setData({ self.setData({
communityList: data, communityList: data,
array: arr, array: arr,
communitySelected: data[0].communityId, communitySelected: wx.getStorageSync('communityIndex') ? data[wx.getStorageSync('communityIndex')].communityId : data[0].communityId,
['page.communityId']: data[0].communityId, ['page.communityId']: wx.getStorageSync('communityIndex') ? data[wx.getStorageSync('communityIndex')].communityId : data[0].communityId,
areaCode: data[0].areaCode areaCode: wx.getStorageSync('communityIndex') ? data[wx.getStorageSync('communityIndex')].areaCode : data[0].areaCode,
}) })
if (self.data.tab == '1') { if (self.data.tab == '1') {
self.getHelpList() self.getHelpList()

View File

@ -6,6 +6,7 @@
<picker bindchange="bindPickerChange" value="{{index}}" range="{{array}}"> <picker bindchange="bindPickerChange" value="{{index}}" range="{{array}}">
<view class="picker"> <view class="picker">
{{array[index]}} {{array[index]}}
<image src="{{sourceUrl}}arrow-down.png"></image>
</view> </view>
</picker> </picker>
<view class="topic"> <view class="topic">
@ -34,8 +35,14 @@
{{item.content}} {{item.content}}
</view> </view>
<view class="help-photo" wx:if="{{item.photo.length > 0}}"> <view class="help-photo" wx:if="{{item.photo.length > 0}}">
<view class="help-photo-box"> <view class="help-photo-box photo-one" wx:for="{{item.photo}}" wx:for-item="photo" wx:key="photo" wx:if="{{item.photo.length == 1}}">
<image src="{{serviceUrl + baseImgUrl + photo}}" wx:for="{{item.photo}}" wx:for-item="photo" wx:key="photo" mode="heightFix"></image> <image src="{{serviceUrl + baseImgUrl + photo}}" mode="widthFix"></image>
</view>
<view class="help-photo-box photo-four" wx:for="{{item.photo}}" wx:for-item="photo" wx:key="photo" wx:if="{{item.photo.length == 4}}">
<image src="{{serviceUrl + baseImgUrl + photo}}" mode="widthFix"></image>
</view>
<view class="help-photo-box photo-more" wx:for="{{item.photo}}" wx:for-item="photo" wx:key="photo" wx:if="{{item.photo.length > 1 && item.photo.length != 4}}">
<image src="{{serviceUrl + baseImgUrl + photo}}" mode="widthFix"></image>
</view> </view>
</view> </view>
<view class="help-video" wx:if="{{item.video}}"> <view class="help-video" wx:if="{{item.video}}">
@ -54,8 +61,14 @@
{{item.content}} {{item.content}}
</view> </view>
<view class="help-photo" wx:if="{{item.photo.length > 0}}"> <view class="help-photo" wx:if="{{item.photo.length > 0}}">
<view class="help-photo-box"> <view class="help-photo-box photo-one" wx:for="{{item.photo}}" wx:for-item="photo" wx:key="photo" wx:if="{{item.photo.length == 1}}">
<image src="{{serviceUrl + baseImgUrl + photo}}" wx:for="{{item.photo}}" wx:for-item="photo" wx:key="photo" mode="heightFix"></image> <image src="{{serviceUrl + baseImgUrl + photo}}" mode="widthFix"></image>
</view>
<view class="help-photo-box photo-four" wx:for="{{item.photo}}" wx:for-item="photo" wx:key="photo" wx:if="{{item.photo.length == 4}}">
<image src="{{serviceUrl + baseImgUrl + photo}}" mode="widthFix"></image>
</view>
<view class="help-photo-box photo-more" wx:for="{{item.photo}}" wx:for-item="photo" wx:key="photo" wx:if="{{item.photo.length > 1 && item.photo.length != 4}}">
<image src="{{serviceUrl + baseImgUrl + photo}}" mode="heightFix"></image>
</view> </view>
</view> </view>
<view class="help-video" wx:if="{{item.video}}"> <view class="help-video" wx:if="{{item.video}}">

View File

@ -118,21 +118,47 @@
.help-photo-box{ .help-photo-box{
display: inline-block; display: inline-block;
width: 32%; width: 32%;
height: 150rpx; height: 180rpx;
margin-right: 2%; margin-right: 2%;
margin-bottom: 20rpx; margin-bottom: 20rpx;
text-align: center; text-align: center;
position: relative;
overflow: hidden;
} }
.help-photo-box:nth-child(3n){ .help-photo-box:nth-child(3n){
margin-right: 0; margin-right: 0;
} }
.help-photo-box image{ /* .help-photo-box image{
height: 100%; height: 100%;
} */
.photo-one{
width: 50%;
height: auto;
max-height: 600rpx;
}
.photo-one image{
max-width: 100%;
}
.photo-four image{
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
.photo-four:nth-child(3){
margin-right: 2%;
}
.photo-more image{
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
} }
.help-video{ .help-video{
margin-top: 20rpx; margin-top: 20rpx;
width: 65%;
} }
.help-video, .help-video video{ .help-video video{
width: 100%; width: 100%;
} }
.help-more{ .help-more{
@ -149,3 +175,9 @@
.neighbor-tab{ .neighbor-tab{
margin-bottom: 30rpx; margin-bottom: 30rpx;
} }
.picker image{
width: 28rpx;
height: 28rpx;
vertical-align: middle;
margin-top: -10rpx;
}

View File

@ -14,6 +14,7 @@ Page({
page: 1, page: 1,
rows: 10, rows: 10,
newsTypeId: '', newsTypeId: '',
areaCode: ''
}, },
newsList: [], newsList: [],
serviceUrl: app.baseUrls.serviceUrl, serviceUrl: app.baseUrls.serviceUrl,
@ -101,6 +102,9 @@ Page({
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad: function (options) { onLoad: function (options) {
this.setData({
['page.areaCode']: wx.getStorageSync('areaCode') ? wx.getStorageSync('areaCode') : ''
})
this.getNewsType() this.getNewsType()
}, },

View File

@ -2,17 +2,19 @@
<textarea placeholder="请输入内容" model:value="{{content}}"></textarea> <textarea placeholder="请输入内容" model:value="{{content}}"></textarea>
</view> </view>
<view class="upload"> <view class="upload">
<view class="upload-box"> <view class="upload-box" wx:if="{{!videoId}}">
<view class="upload-title">上传图片({{imageList.length}}/9</view> <view class="upload-title">上传图片({{imageList.length}}/9</view>
<view class="upload-container"> <view class="upload-container">
<view class="upload-img" wx:for="{{imageList}}" wx:key="index"> <view class="upload-img" wx:for="{{imageList}}" wx:key="index">
<image src="{{serviceUrl + baseImgUrl + item}}" mode="heightFix"></image> <view class="upload-img-box">
<image src="{{serviceUrl + baseImgUrl + item}}" mode="widthFix" class="upload-photo"></image>
</view>
<image src="{{sourceUrl}}delete.png" class="delete" bindtap="deleteImg" data-cur="{{index}}"></image> <image src="{{sourceUrl}}delete.png" class="delete" bindtap="deleteImg" data-cur="{{index}}"></image>
</view> </view>
<view class="add" bindtap="uploadImage" wx:if="{{imageList.length < 9}}">+</view> <view class="add" bindtap="uploadImage" wx:if="{{imageList.length < 9}}">+</view>
</view> </view>
</view> </view>
<view class="upload-box"> <view class="upload-box" wx:if="{{imageList.length == 0}}">
<view class="upload-title">上传视频</view> <view class="upload-title">上传视频</view>
<view class="upload-container"> <view class="upload-container">
<view class="upload-img upload-video" wx:if="{{videoId}}"> <view class="upload-img upload-video" wx:if="{{videoId}}">

View File

@ -40,8 +40,19 @@
.upload-img:nth-child(3n), .add{ .upload-img:nth-child(3n), .add{
margin-right: 0; margin-right: 0;
} }
.upload-img image{ .upload-img .upload-photo{
height: 100%; width: 100%;
height: auto;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
.upload-img-box{
position: relative;
width: 100%;
height: 150rpx;
overflow: hidden;
} }
.add{ .add{
font-size: 60rpx; font-size: 60rpx;

View File

@ -48,6 +48,12 @@ Page({
title: '暂无更多', title: '暂无更多',
icon: 'none' icon: 'none'
}) })
if (self.data.page.page > 1) {
self.setData({
['page.page']: self.data.page.page - 1
})
}
} }
}, function (code, data) { }, function (code, data) {

View File

@ -17,8 +17,14 @@
{{item.content}} {{item.content}}
</view> </view>
<view class="talk-photo" wx:if="{{item.photo.length > 0}}"> <view class="talk-photo" wx:if="{{item.photo.length > 0}}">
<view class="photo-box" wx:for="{{item.photo}}" wx:for-item="photo" wx:key="index"> <view class="photo-box photo-one" wx:for="{{item.photo}}" wx:for-item="photo" wx:key="index" wx:if="{{item.photo.length == 1}}">
<image src="{{serviceUrl + baseImgUrl + photo}}" mode="heightFix"></image> <image src="{{serviceUrl + baseImgUrl + photo}}" mode="widthFix"></image>
</view>
<view class="photo-box photo-four" wx:for="{{item.photo}}" wx:for-item="photo" wx:key="index" wx:if="{{item.photo.length == 4}}">
<image src="{{serviceUrl + baseImgUrl + photo}}" mode="widthFix"></image>
</view>
<view class="photo-box photo-more" wx:for="{{item.photo}}" wx:for-item="photo" wx:key="index" wx:if="{{item.photo.length > 1 && item.photo.length != 4}}">
<image src="{{serviceUrl + baseImgUrl + photo}}" mode="widthFix"></image>
</view> </view>
</view> </view>
<view class="talk-photo" wx:if="{{item.video}}" catchtap="clickVideo"> <view class="talk-photo" wx:if="{{item.video}}" catchtap="clickVideo">

View File

@ -49,11 +49,12 @@
} }
.photo-box{ .photo-box{
width: 32%; width: 32%;
height: 150rpx; height: 180rpx;
overflow: hidden; overflow: hidden;
display: inline-block; display: inline-block;
margin-right: 2%; margin-right: 2%;
text-align: center; text-align: center;
position: relative;
} }
.photo-box:nth-child(3n){ .photo-box:nth-child(3n){
margin-right: 0; margin-right: 0;
@ -86,7 +87,7 @@
background-color: #f55054; background-color: #f55054;
} }
.video-box{ .video-box{
width: 100%; width: 65%;
height: auto !important; height: auto !important;
} }
.video-box video{ .video-box video{
@ -99,3 +100,21 @@
.no-data image{ .no-data image{
width: 300rpx; width: 300rpx;
} }
.photo-one{
width: 50%;
height: auto;
}
.photo-one image{
max-width: 100%;
}
.photo-more image, .photo-four image{
width: 100%;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
height: auto;
}
.photo-four:nth-child(3){
margin-right: 2%;
}

View File

@ -16,8 +16,11 @@
{{talkDetail.content}} {{talkDetail.content}}
</view> </view>
<view class="talk-photo" wx:if="{{talkDetail.photo.length > 0}}"> <view class="talk-photo" wx:if="{{talkDetail.photo.length > 0}}">
<view class="photo-box" wx:for="{{talkDetail.photo}}" wx:key="index" bindtap="viewImg" data-id="{{item}}"> <view class="photo-box photo-one" wx:for="{{talkDetail.photo}}" wx:key="index" bindtap="viewImg" data-id="{{item}}" wx:if="{{talkDetail.photo.length == 1}}">
<image src="{{serviceUrl + baseImgUrl + item}}" mode="heightFix"></image> <image src="{{serviceUrl + baseImgUrl + item}}" mode="widthFix"></image>
</view>
<view class="photo-box photo-more" wx:for="{{talkDetail.photo}}" wx:key="index" bindtap="viewImg" data-id="{{item}}" wx:if="{{talkDetail.photo.length > 1}}">
<image src="{{serviceUrl + baseImgUrl + item}}" mode="widthFix"></image>
</view> </view>
</view> </view>
<view class="talk-photo" wx:if="{{talkDetail.video}}"> <view class="talk-photo" wx:if="{{talkDetail.video}}">

View File

@ -15,6 +15,7 @@
width: 80rpx; width: 80rpx;
height: 80rpx; height: 80rpx;
margin-right: 20rpx; margin-right: 20rpx;
border-radius: 50%;
} }
.good image{ .good image{
width: 40rpx; width: 40rpx;
@ -61,12 +62,18 @@
display: inline-block; display: inline-block;
margin-right: 2%; margin-right: 2%;
text-align: center; text-align: center;
position: relative;
} }
.photo-box:nth-child(3n){ .photo-box:nth-child(3n){
margin-right: 0; margin-right: 0;
} }
.photo-box image{ .photo-more image{
height: 100%; width: 100%;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
height: auto;
} }
.click-good{ .click-good{
padding: 20rpx; padding: 20rpx;
@ -118,7 +125,7 @@
padding: 0 20rpx; padding: 0 20rpx;
} }
.video-box{ .video-box{
width: 100%; width: 65%;
height: auto !important; height: auto !important;
} }
.video-box video{ .video-box video{
@ -133,5 +140,18 @@
.reply-row text{ .reply-row text{
font-weight: bold; font-weight: bold;
} }
.photo-one{
width: 50%;
height: auto;
}
.photo-one image{
max-width: 100%;
}
.photo-more image{
width: 100%;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
height: auto;
}