作者 吴孟雨

添加发布服务成功提示,优化三级分类tab样式,文章详情页添加预览图片功能,优化点击发布按钮弹框消失

... ... @@ -337,9 +337,15 @@ Page({
// self.setData({
// portal_three: res,
// });
// wx.showToast({title:'发布成功',icon: 'success'});
wx.showToast({
title:'发布成功',
icon: 'success',
});
setTimeout(function () {
wx.navigateBack({delta: 1})
},1000)
// wx.hideToast({});
wx.redirectTo({url: '/pages/service/service'})
// wx.redirectTo({url: '/pages/service/service'})
})
}
},
... ...
... ... @@ -167,7 +167,7 @@ Page({
});
this.getPortalPost()
},
//查看评论详情
//查看文章详情
goPostDetail(e) {
const current = e.currentTarget.dataset.index;
const list = this.data.postList.map((item,index) => {
... ...
... ... @@ -20,10 +20,10 @@
</view>
<!--滚动tab-->
<scroll-view class='tab_box' scroll-x>
<!--<view class="scroll">-->
<view class="tab_item {{currentPortalThree==index?'active':''}}" wx:for="{{portal_three}}" wx:key="index"
<view class="scroll">
<view class="scroll_item {{currentPortalThree==index?'active':''}}" wx:for="{{portal_three}}" wx:key="index"
data-current='{{index}}' bindtap='choosePortalThree'>{{item.name}}</view>
<!--</view>-->
</view>
</scroll-view>
</view>
<!--筛选列表-->
... ...
... ... @@ -81,10 +81,27 @@ page {
align-items: center;
justify-content: space-around;
}
/*.scroll {*/
/*display: flex;*/
/*justify-content: space-between;*/
/*}*/
.scroll_item {
display: inline-block;
font-size: 28rpx;
position: relative;
text-align: center;
margin: 0 10rpx;
}
.scroll.active {
color: #53a6fa;
}
.tab_box .scroll .active::after {
content: "";
border: 2rpx solid #53a6fa;
position: absolute;
bottom: 0rpx;
left: 50%;
transform: translateX(-50%);
width: 77rpx;
height: 2rpx;
background: #53a6fa;
}
.icon-daosanjiao {
font-size: 20rpx;
color: RGBA(0, 0, 0, 0.2);
... ...
... ... @@ -11,6 +11,19 @@ Page({
type:'',
id:''
},
previewImg(e) {
const current = e.currentTarget.dataset.index;
var imgs = [];
this.data.postImg[0].photos.map((item,index)=>{
imgs.push(item.url)
});
wx.previewImage({
//当前显示图片
current: imgs[current],
//所有图片
urls: imgs
})
},
//消息通知接口
messageInfo() {
let url = '/home/me/state'
... ...
... ... @@ -49,7 +49,8 @@
<view class='list_content'>{{postList.post_content}}</view>
<view class='list_img_box'>
<block wx:for="{{postImg}}" wx:key="index">
<image src='{{item.url}}' wx:for="{{item.photos}}" wx:key="index"></image>
<image src='{{item.url}}' wx:for="{{item.photos}}" wx:key="index"
data-index="{{index}}" bindtap="previewImg"></image>
</block>
</view>
<view class='list_state_box'>
... ...
... ... @@ -151,6 +151,9 @@ Page({
releaseService() {
wx.navigateTo({
url: '/pages/service/release/release',
});
this.setData({
releasepopup: false
})
},
//发布资讯跳转
... ... @@ -158,10 +161,13 @@ Page({
wx.showToast({
title: '该功能正在开发中',
icon: 'none'
})
});
// wx.navigateTo({
// url: '/pages/service/release/release',
// })
// });
this.setData({
releasepopup: false
})
},
//发布心愿跳转
releaseWish() {
... ... @@ -171,7 +177,10 @@ Page({
})
// wx.navigateTo({
// url: '/pages/wish/release/release',
// })
// });
this.setData({
releasepopup: false
})
},
//底部导航心愿点击事件
wish(e) {
... ...