Browse Source

update 议题删除功能

master
fanp 6 years ago
parent
commit
0b3e98b5e8
  1. 12
      models/topic.js
  2. 28
      pages/topics/index.js
  3. 2
      pages/topics/index.wxml
  4. 58
      pages/topics/interactive/cell/index.js
  5. 45
      pages/topics/interactive/cell/index.wxml
  6. 54
      pages/topics/interactive/cell/index.wxss
  7. 4
      pages/topics/interactive/index.js
  8. 6
      pages/topics/interactive/index.wxml
  9. 2
      pages/topics/interactive/topicArticle/index.wxml
  10. 86
      pages/user/index.js
  11. 6
      pages/user/myInfo/index.js
  12. 1
      pages/user/myInfo/index.json
  13. 16
      pages/user/myInfo/index.wxml
  14. 10
      pages/user/myInfo/index.wxss
  15. 48
      pages/user/myTopics/index.js
  16. 1
      pages/user/myTopics/index.json
  17. 2
      pages/user/myTopics/index.wxml
  18. 47
      pages/user/myTopics/myParticipant/cell/index.js
  19. 45
      pages/user/myTopics/myParticipant/cell/index.wxml
  20. 87
      pages/user/myTopics/myParticipant/cell/index.wxss
  21. 3
      pages/user/myTopics/myParticipant/index.js
  22. 3
      pages/user/myTopics/myParticipant/index.wxml
  23. 3
      pages/user/myTopics/myRelease/index.js
  24. 5
      pages/user/myTopics/myRelease/index.wxml

12
models/topic.js

@ -3,6 +3,7 @@ import {HTTP, Method} from '../utils/http.js'
const TopicBaseUrl = {
topic_list_url:'/api/group/page', // 议题列表
topic_addGroup_url:'/api/group/addGroup', // 新建议题
topic_deleteGroup_url:'/api/group/deleteGroup/',// 删除议题
topic_goldenList_url:'/api/comment/goldenList', // 金点子列表
topic_detail_url:'/api/group/queryById/', // 议题详情
topic_detailComment_url:'/api/comment/page', // 评论列表
@ -57,6 +58,17 @@ class TopicModel extends HTTP {
this.request(params)
}
deleteGroup(id, success) {
let params = {
url: TopicBaseUrl.topic_deleteGroup_url + `${id}`,
method: Method.POST,
data: {},
success: success
}
this.request(params)
}
getTopicDetailComment(id, page,success) {
let params = {
url: TopicBaseUrl.topic_detailComment_url,

28
pages/topics/index.js

@ -61,7 +61,7 @@ Page({
const datas = res.result.list
let tempDatas = []
datas.forEach(item => {
datas.forEach((item,index) => {
tempDatas.push({
topicId: item.id,
userIcon: item.groupAvator || '',
@ -71,6 +71,8 @@ Page({
commentNum: item.commentNum,
topicImg: item.image,
time: item.createTime,
dataIndex:index+((page-1)*10),
isTouchMove:false,
})
})
if (page == 1) {
@ -201,6 +203,30 @@ Page({
return this.fetchGoodIdeaList()
}
},
deleteTopic(e) {
console.log(e.detail.id)
let that = this
topicModel.deleteGroup(e.detail.id, res => {
console.log(res)
if (res.code === 200) {
wx.showToast({
title: '删除成功',
icon: 'none',
success() {
that.setData({
currPage: 1,
})
switch (that.data.segmentIndex) {
case 0:
return that.fetchTopicList()
case 1:
return that.fetchGoodIdeaList()
}
}
})
}
})
},
tapGoodIdeaPraise(e){
this.fetchGoodIdeaPraise(e.detail.commentId)
},

2
pages/topics/index.wxml

@ -1,7 +1,7 @@
<!--pages/topics/index.wxml-->
<view class="content-wrapper">
<e-segment bind:tapSegment="tapSegment" headerTitles="{{headerTitles}}" defaultSelectIndex="{{selectedTitle}}"/>
<interactive wx:if="{{segmentIndex==0}}" list="{{topicList}}" />
<interactive wx:if="{{segmentIndex==0}}" list="{{topicList}}" bind:deleteTopic="deleteTopic"/>
<goodIdea wx:if="{{segmentIndex==1}}" list="{{goodIdeaList}}" bind:tapGoodIdeaPraise="tapGoodIdeaPraise"/>
<message wx:if="{{segmentIndex==2}}" />
</view>

58
pages/topics/interactive/cell/index.js

@ -1,4 +1,5 @@
// pages/topics/common/interactive/common/imageCell/index.js
import { store } from '../../../../utils/store.js'
Component({
/**
@ -11,14 +12,17 @@ Component({
userIcon:String,
userName:String,
time: String,
commentNum: Number
commentNum: Number,
dataIndex:Number,
isTouchMove:Boolean,
},
/**
* 组件的初始数据
*/
data: {
startX: 0, //开始坐标
startY: 0
},
/**
@ -27,6 +31,56 @@ Component({
methods: {
onTap() {
this.triggerEvent('clickListItem', { topicId: this.properties.topicId })
},
touchstart: function (e) {
let {nickName} = store.readUserInfo()
if (e.currentTarget.dataset.name === nickName) {
//开始触摸时 重置所有删除
if (this.properties.isTouchMove) {
this.setData({
isTouchMove: false
})
}
this.setData({
startX: e.changedTouches[0].clientX,
startY: e.changedTouches[0].clientY,
})
}
},
touchmove: function (e) {
let { nickName } = store.readUserInfo()
if (e.currentTarget.dataset.name === nickName) {
var that = this
// index = e.currentTarget.dataset.index,//当前索引
const startX = that.data.startX//开始X坐标
const startY = that.data.startY//开始Y坐标
const touchMoveX = e.changedTouches[0].clientX//滑动变化坐标
const touchMoveY = e.changedTouches[0].clientY//滑动变化坐标
//获取滑动角度
const angle = that.angle({ X: startX, Y: startY }, { X: touchMoveX, Y: touchMoveY })
if (Math.abs(angle) > 30) return;
if (touchMoveX > startX) //右滑
that.setData({
isTouchMove: false
})
else //左滑
that.setData({
isTouchMove: true
})
}
// console.log(e)
},
angle: function (start, end) {
var _X = end.X - start.X,
_Y = end.Y - start.Y
//返回角度 /Math.atan()返回数字的反正切值
return 360 * Math.atan(_Y / _X) / (2 * Math.PI);
},
del: function (e) {
this.triggerEvent('deleteTopic', { id: e.currentTarget.dataset.id })
}
}
})

45
pages/topics/interactive/cell/index.wxml

@ -1,29 +1,34 @@
<!--pages/topics/common/interactive/common/imageCell/index.wxml-->
<view class="cell" bindtap="onTap">
<view class="left {{articleImg === '' ? 'leftActive' : ''}}">
<view class="left-top">
<view class="cell_title">{{title}}</view>
</view>
<view class="left-bottom">
<view class="left-bottom-userInfo">
<view class="user-icon">
<image src="{{userIcon || 'images/avatar.png'}}"></image>
<view class="touch-item {{isTouchMove ? 'touch-move-active' : ''}}" data-index="{{dataIndex}}" data-name="{{userName}}" bindtouchstart="touchstart" bindtouchmove="touchmove" >
<view class="content">
<view class="left {{articleImg === '' ? 'leftActive' : ''}}">
<view class="left-top">
<view class="cell_title">{{title}}</view>
</view>
<view class="userName">{{userName}}</view>
<view class="cell_info_meta">{{time}}</view>
</view>
<view class="left-bottom">
<view class="left-bottom-userInfo">
<view class="user-icon">
<image src="{{userIcon || 'images/avatar.png'}}"></image>
</view>
<view class="userName">{{userName}}</view>
<view class="cell_info_meta">{{time}}</view>
</view>
<view class="left-bottom-comments">
<view class="comments-icon">
<image src="/images/common/com_count.png"></image>
</view>
<view class="commentNum">{{commentNum}}</view>
</view>
<view class="left-bottom-comments">
<view class="comments-icon">
<image src="/images/common/com_count.png"></image>
</view>
<view class="commentNum">{{commentNum}}</view>
</view>
<view class="right" wx:if="{{topicImg.length > 0}}">
<image class="articleImg" src="{{topicImg}}"></image>
</view>
</view>
</view>
<view class="right" wx:if="{{topicImg.length > 0}}">
<image class="articleImg" src="{{topicImg}}"></image>
<view class="del" data-index="{{dataIndex}}" data-id="{{topicId}}" catchtap="del">删除</view>
</view>
</view>

54
pages/topics/interactive/cell/index.wxss

@ -1,10 +1,11 @@
/* pages/topics/common/interactive/common/imageCell/index.wxss */
.cell {
border-bottom: 1px solid #E7E7E7;
/* border-bottom: 1px solid #E7E7E7;
display: flex;
flex-direction: row;
padding: 10px 20px;
align-items: center;
align-items: center; */
/* min-height: 80px; */
}
.left{
display: flex;
@ -23,6 +24,7 @@
justify-content: space-between;
}
.left-bottom-userInfo{
padding: 5px 0;
display: flex;
flex: row;
align-items: center;
@ -67,8 +69,8 @@
color: #3B3B3B;
}
.right{
width: 30%;
height: 70px;
width: 35%;
height: 80px;
border-radius: 5px;
background-color: #EEEEEE;
}
@ -96,12 +98,10 @@ image{
color: #9C9C9C;
}
.cell_info_meta {
padding-top: 10rpx;
display: flex;
flex-direction: row;
align-items: center;
font-size: 12px;
line-height: 12px;
color: #D4D4D4;
}
.cell_info_top {
@ -109,3 +109,45 @@ image{
width: 20px;
height: 12px;
}
.touch-item {
font-size: 14px;
display: flex;
justify-content: space-between;
border-bottom:1px solid #ccc;
width: 100%;
overflow: hidden
}
.content {
width: 100%;
/* padding: 10px; */
line-height: 22px;
margin-right:0;
-webkit-transition: all 0.4s;
transition: all 0.4s;
-webkit-transform: translateX(120px);
transform: translateX(120px);
margin-left: -120px;
display: flex;
flex-direction: row;
padding: 10px 20px;
align-items: center;
}
.del {
background-color: orangered;
width: 120px;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
color: #fff;
-webkit-transform: translateX(120px);
transform: translateX(120px);
-webkit-transition: all 0.4s;
transition: all 0.4s;
}
.touch-move-active .content,
.touch-move-active .del {
-webkit-transform: translateX(0);
transform: translateX(0);
}

4
pages/topics/interactive/index.js

@ -27,10 +27,14 @@ Component({
})
},
clickListItem(e) {
console.log(e)
const topicId = e.detail.topicId;
wx.navigateTo({
url: `/pages/topics/interactive/topicArticle/index?topicId=${topicId}`,
})
},
deleteTopic(e){
this.triggerEvent('deleteTopic', { id: e.detail.id })
}
}
})

6
pages/topics/interactive/index.wxml

@ -9,7 +9,11 @@
userName="{{item.userName}}"
time="{{item.time}}"
commentNum="{{item.commentNum}}"
bind:clickListItem="clickListItem"/>
bind:clickListItem="clickListItem"
dataIndex="{{item.dataIndex}}"
isTouchMove="{{item.isTouchMove}}"
bind:deleteTopic="deleteTopic"
/>
</block>
<view class="publish" bindtap="onTap">

2
pages/topics/interactive/topicArticle/index.wxml

@ -68,5 +68,5 @@
</view>
</view>
<modal hidden="{{hiddenmodalput}}" confirm-text="提交" cancel-text="取消" bindcancel="cancel" bindconfirm="confirm">
<textarea bindinput="bingTextAreaInput" value="{{currentComment}}" maxlength="400" placeholder="请输入评论" auto-focus/>
<textarea bindinput="bingTextAreaInput" value="{{currentComment}}" maxlength="400" placeholder="请输入评论"/>
</modal>

86
pages/user/index.js

@ -37,42 +37,44 @@ Page({
onShow: function () {
this.getUserInfo()
},
isAuthUserInfo () {
let that = this
wx.showLoading()
console.log('未授权')
return new Promise(resolve => {
wx.getSetting({
success (res) {
if (res.authSetting['scope.userInfo']) {
// 已经授权,可以直接调用 getUserInfo 获取头像昵称
wx.getUserInfo({
success: function (res) {
// isAuthUserInfo () {
// let that = this
// wx.showLoading()
// console.log('未授权')
// return new Promise(resolve => {
// wx.getSetting({
// success (res) {
// if (res.authSetting['scope.userInfo']) {
// // 已经授权,可以直接调用 getUserInfo 获取头像昵称
// wx.getUserInfo({
// success: function (res) {
let nickName = res.userInfo.nickName
let avatarUrl = res.userInfo.avatarUrl
// let nickName = res.userInfo.nickName
// let avatarUrl = res.userInfo.avatarUrl
store.saveUserInfo({
nickName: nickName,
avatarUrl: avatarUrl,
phone: ''
})
// store.saveUserInfo({
// nickName: nickName,
// avatarUrl: avatarUrl,
// phone: ''
// })
if (nickName && avatarUrl) {
that.setData({
isAuth: false
}, () => {
wx.hideLoading()
})
}
that.getUserInfo()
}
})
}
}
})
})
},
// if (nickName && avatarUrl) {
// that.setData({
// isAuth: false
// }, () => {
// wx.hideLoading()
// })
// }
// that.getUserInfo()
// }
// })
// }
// }
// })
// })
// },
// 授权登录
bindGetUserInfo (e) {
console.log(e.detail.userInfo)
if (e.detail.userInfo){
@ -82,17 +84,16 @@ Page({
this.updateUserInfo(avatarUrl,nickName)
}
},
hasBindUserInfo () {
return store.hasBindUserInfo();
},
// 将用户信息发送服务器
updateUserInfo (avatarUrl, nickName) {
userModel.updateUserInfo(avatarUrl, nickName, res => {
if(res.code === 200){
this.isAuthUserInfo()
this.getUserInfo()
}
})
},
// 获取用户信息
getUserInfo () {
userModel.getUserInfo(res => {
let nickName = res.result.nickName
@ -104,7 +105,7 @@ Page({
userInfo: res.result,
avatarUrl: res.result.avatarUrl,
nickName: res.result.nickName,
reAuth: true
reAuth: true,
},()=>{
if (store.hasPhone()) {
console.log('已经绑定手机号码')
@ -130,6 +131,7 @@ Page({
})
},
// 获取未读消息
getMsgStatus () {
userModel.getMyMessageTotal(res => {
console.log(res.result.total)
@ -138,13 +140,15 @@ Page({
})
})
},
// cell点击
onTapItem (e) {
const { type } = e.currentTarget.dataset
console.log(type)
if (type === 'myInfo'){
// wx.navigateTo({
// url: `/pages/user/${type}/index?userIcon=${this.data.userInfo.avatarUrl}&userName=${this.data.userInfo.nickName}&userPhone=${this.data.userInfo.phone || ''}&company=${this.data.userInfo.company || ''}&position=${this.data.userInfo.position || ''}`,
// })
wx.navigateTo({
url: `/pages/user/${type}/index?userIcon=${this.data.userInfo.avatarUrl}&userName=${this.data.userInfo.nickName}&userPhone=${this.data.userInfo.phone || ''}&company=${this.data.userInfo.company || ''}&position=${this.data.userInfo.position || ''}`,
})
} else {
wx.navigateTo({
url: `/pages/user/${type}/index`,

6
pages/user/myInfo/index.js

@ -32,9 +32,9 @@ Page({
onTapItem(e) {
const { type } = e.currentTarget.dataset
console.log(type)
if(type === 'userIcon'){
this.upload()
}
// if(type === 'userIcon'){
// this.upload()
// }
},
upload(){
let that = this

1
pages/user/myInfo/index.json

@ -1,5 +1,4 @@
{
"enablePullDownRefresh": true,
"navigationBarTitleText": "个人资料",
"usingComponents": {
"e-ibutton": "/components/image-button/index",

16
pages/user/myInfo/index.wxml

@ -11,28 +11,32 @@
bindtap="onTapItem" data-type="userName"
title="名字"
ext-class="cell-item">
<input slot="footer" class="msg_footer" bindinput="bindNikeNameInput" value="{{nikeName}}"></input>
<view slot="footer" class="msg_footer" >{{nikeName}}</view>
<!-- <input slot="footer" class="footer_input" bindinput="bindNikeNameInput" value="{{nikeName}}"></input> -->
</mp-cell>
<mp-cell
bindtap="onTapItem" data-type="userPhone"
title="手机号"
ext-class="cell-item">
<input slot="footer" class="msg_footer" bindinput="bindPhoneInput" value="{{phone}}"></input>
<view slot="footer" class="msg_footer" >{{phone}}</view>
<!-- <input slot="footer" class="footer_input" bindinput="bindPhoneInput" value="{{phone}}"></input> -->
</mp-cell>
<mp-cell
bindtap="onTapItem" data-type="workUnit"
title="工作单位"
ext-class="cell-item">
<input slot="footer" class="msg_footer" bindinput="bindCompanyInput" value="{{company}}"></input>
<view slot="footer" class="msg_footer" >{{company}}</view>
<!-- <input slot="footer" class="footer_input" bindinput="bindCompanyInput" value="{{company}}"></input> -->
</mp-cell>
<mp-cell
bindtap="onTapItem" data-type="position"
title="职务"
ext-class="cell-item">
<input slot="footer" class="msg_footer" bindinput="bindPositionInput" value="{{position}}"></input>
<view slot="footer" class="msg_footer" >{{position}}</view>
<!-- <input slot="footer" class="footer_input" bindinput="bindPositionInput" value="{{position}}"></input> -->
</mp-cell>
<view class="btnView">
<!-- <view class="btnView">
<e-ibutton title="提交" bind:onTap="submit"/>
</view>
</view> -->
</mp-cells>
</view>

10
pages/user/myInfo/index.wxss

@ -40,13 +40,13 @@
}
/* 页面body */
.page_bd .weui-cell{
padding: 10px 16px 10px 16px;
/* padding: 10px 16px 10px 16px; */
}
.weui-cell_wxss{
}
.weui-cell__ft{
width: 70%;
/* width: 70%; */
}
.page_bd .weui-cell__hd {
display: flex;
@ -58,13 +58,17 @@
height: 16px;
padding: 0 10px 0 0;
}
.msg_footer{
.footer_input{
font-size: 14px;
border: 1px solid #AAAAAA;
border-radius: 4px;
height: 30px;
text-align: left;
}
.msg_footer{
font-size: 14px;
text-align: left;
}
.btnView{
position: fixed;
padding: 10px 20px 20px 20px;

48
pages/user/myTopics/index.js

@ -4,6 +4,8 @@ import relativeTime from '../../../utils/dayjs/relativeTime.js'
dayjs.extend(relativeTime);
import { UserModel } from '../../../models/user.js'
let userModel = new UserModel()
import { TopicModel } from '../../../models/topic.js'
let topicModel = new TopicModel()
Page({
@ -17,7 +19,8 @@ Page({
list:{
type:Array,
value:[]
}
},
currentPage:1,
},
/**
@ -26,12 +29,32 @@ Page({
onLoad: function (options) {
this.fetchMyTopicList()
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
this.setData({
currentPage: 1
})
this.fetchMyTopicList()
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
let page = this.data.currentPage + 1
this.setData({
currentPage: page
})
this.fetchMyTopicList()
},
fetchMyTopicList(){
let page = this.data.currentPage
userModel.getMyTopics(page,this.data.selectedTitle+1,res=>{
const datas = res.result.list
let tempDatas = []
datas.forEach(item => {
datas.forEach((item,index) => {
tempDatas.push({
topicId: item.id,
title: item.title,
@ -40,6 +63,8 @@ Page({
commentNum: item.commentNum,
topicImg: item.image,
time: item.createTime,
dataIndex: index + ((page - 1) * 10),
isTouchMove: false,
})
})
if (page == 1) {
@ -76,5 +101,24 @@ Page({
list:[]
});
this.fetchMyTopicList()
},
deleteTopic(e){
let that = this
topicModel.deleteGroup(e.detail.id,res=>{
console.log(res)
if(res.code === 200){
wx.showToast({
title: '删除成功',
icon: 'none',
success(){
that.setData({
currentPage: 1
})
that.fetchMyTopicList()
}
})
}
})
}
})

1
pages/user/myTopics/index.json

@ -1,4 +1,5 @@
{
"enablePullDownRefresh": true,
"navigationBarTitleText": "我的议题",
"usingComponents": {
"e-segment": "/components/segment/index",

2
pages/user/myTopics/index.wxml

@ -2,5 +2,5 @@
<view class="content-wrapper">
<e-segment bind:tapSegment="tapSegment" headerTitles="{{headerTitles}}" defaultSelectIndex="{{selectedTitle}}"/>
<myParticipant wx:if="{{selectedTitle==0}}" list="{{list}}"/>
<myRelease wx:if="{{selectedTitle==1}}" list="{{list}}"/>
<myRelease wx:if="{{selectedTitle==1}}" list="{{list}}" bind:deleteTopic="deleteTopic"/>
</view>

47
pages/user/myTopics/myParticipant/cell/index.js

@ -11,14 +11,17 @@ Component({
userName: String,
time: String,
commentNum: Number,
type:String
type:String,
dataIndex: Number,
isTouchMove: Boolean,
},
/**
* 组件的初始数据
*/
data: {
startX: 0, //开始坐标
startY: 0
},
/**
@ -37,6 +40,46 @@ Component({
type: this.properties.type
}
this.triggerEvent('clickListItem', { item: item })
},
touchstart: function (e) {
//开始触摸时 重置所有删除
if (this.properties.isTouchMove) {
this.setData({
isTouchMove: false
})
}
this.setData({
startX: e.changedTouches[0].clientX,
startY: e.changedTouches[0].clientY,
})
},
touchmove: function (e) {
var that = this
// index = e.currentTarget.dataset.index,//当前索引
const startX = that.data.startX//开始X坐标
const startY = that.data.startY//开始Y坐标
const touchMoveX = e.changedTouches[0].clientX//滑动变化坐标
const touchMoveY = e.changedTouches[0].clientY//滑动变化坐标
//获取滑动角度
const angle = that.angle({ X: startX, Y: startY }, { X: touchMoveX, Y: touchMoveY })
if (Math.abs(angle) > 30) return;
if (touchMoveX > startX) //右滑
that.setData({
isTouchMove: false
})
else //左滑
that.setData({
isTouchMove: true
})
},
angle: function (start, end) {
var _X = end.X - start.X,
_Y = end.Y - start.Y
//返回角度 /Math.atan()返回数字的反正切值
return 360 * Math.atan(_Y / _X) / (2 * Math.PI);
},
del: function (e) {
this.triggerEvent('deleteListItem', { id: e.currentTarget.dataset.id })
}
}
})

45
pages/user/myTopics/myParticipant/cell/index.wxml

@ -1,29 +1,34 @@
<!--pages/topics/common/interactive/common/imageCell/index.wxml-->
<view class="cell" id="cell" bindtap="onTap">
<view class="left {{articleImg === '' ? 'leftActive' : ''}}">
<view class="left-top">
<view class="cell_title">{{title}}</view>
</view>
<view class="left-bottom">
<view class="left-bottom-userInfo">
<view class="user-icon" wx:if="{{userIcon.length > 0}}">
<image class="img" src="{{userIcon}}"></image>
<view class="touch-item {{isTouchMove ? 'touch-move-active' : ''}}" data-index="{{dataIndex}}" bindtouchstart="touchstart" bindtouchmove="touchmove" >
<view class="content">
<view class="left {{articleImg === '' ? 'leftActive' : ''}}">
<view class="left-top">
<view class="cell_title">{{title}}</view>
</view>
<view class="userName">{{userName}}</view>
<view class="cell_info_meta">{{time}}</view>
</view>
<view class="left-bottom">
<view class="left-bottom-userInfo">
<view class="user-icon" wx:if="{{userIcon.length > 0}}">
<image class="img" src="{{userIcon}}"></image>
</view>
<view class="userName">{{userName}}</view>
<view class="cell_info_meta">{{time}}</view>
</view>
<view class="left-bottom-comments">
<view class="comments-icon">
<image src="/images/common/com_count.png"></image>
</view>
<view class="commentNum">{{commentNum}}</view>
</view>
<view class="left-bottom-comments">
<view class="comments-icon">
<image src="/images/common/com_count.png"></image>
</view>
<view class="commentNum">{{commentNum}}</view>
</view>
<view class="right" wx:if="{{topicImg.length > 0}}">
<image class="articleImg" src="{{topicImg}}"></image>
</view>
</view>
</view>
<view class="right" wx:if="{{topicImg.length > 0}}">
<image class="articleImg" src="{{topicImg}}"></image>
<view class="del" data-index="{{dataIndex}}" data-id="{{topicId}}" catchtap="del">删除</view>
</view>
</view>

87
pages/user/myTopics/myParticipant/cell/index.wxss

@ -1,25 +1,17 @@
/* pages/topics/common/interactive/common/imageCell/index.wxss */
.cell {
/* border-bottom: 1px solid #E7E7E7;
display: flex;
flex-direction: row;
padding: 10px 20rpx;
box-sizing: border-box;
align-items: center;
position: relative;
}
.cell:after {
content: "";
position: absolute;
bottom: 1px;
left: 20px;
right: 20px;
border-bottom: 1px solid #E7E7E7;
padding: 10px 20px;
align-items: center; */
/* min-height: 80px; */
}
.left{
display: flex;
flex-direction: column;
width: 70%;
/* width: 70%; */
flex:1;
}
.leftActive{
display: flex;
@ -32,6 +24,7 @@
justify-content: space-between;
}
.left-bottom-userInfo{
padding: 5px 0;
display: flex;
flex: row;
align-items: center;
@ -39,15 +32,15 @@
.user-icon{
width: 20px;
height: 20px;
border-radius: 50%;
background-color: #EEEEEE;
/* border-radius: 50%; */
/* border: 1px solid #ddd; */
/* background-color: #EEEEEE; */
}
.img{
width: 20px;
height: 20px;
.user-icon image {
/* border-radius: 50%; */
}
.userName{
max-width: 120rpx;
max-width: 120rpx;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
@ -76,8 +69,8 @@
color: #3B3B3B;
}
.right{
width: 30%;
height: 70px;
width: 35%;
height: 80px;
border-radius: 5px;
background-color: #EEEEEE;
}
@ -94,17 +87,21 @@ image{
font-weight: 300;
font-size: 17px;
color: #000;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
overflow: hidden;
text-overflow: ellipsis;
}
.cell_title_selected {
color: #9C9C9C;
}
.cell_info_meta {
padding-top: 10rpx;
display: flex;
flex-direction: row;
align-items: center;
font-size: 12px;
line-height: 12px;
color: #D4D4D4;
}
.cell_info_top {
@ -112,3 +109,45 @@ image{
width: 20px;
height: 12px;
}
.touch-item {
font-size: 14px;
display: flex;
justify-content: space-between;
border-bottom:1px solid #ccc;
width: 100%;
overflow: hidden
}
.content {
width: 100%;
/* padding: 10px; */
line-height: 22px;
margin-right:0;
-webkit-transition: all 0.4s;
transition: all 0.4s;
-webkit-transform: translateX(120px);
transform: translateX(120px);
margin-left: -120px;
display: flex;
flex-direction: row;
padding: 10px 20px;
align-items: center;
}
.del {
background-color: orangered;
width: 120px;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
color: #fff;
-webkit-transform: translateX(120px);
transform: translateX(120px);
-webkit-transition: all 0.4s;
transition: all 0.4s;
}
.touch-move-active .content,
.touch-move-active .del {
-webkit-transform: translateX(0);
transform: translateX(0);
}

3
pages/user/myTopics/myParticipant/index.js

@ -28,6 +28,7 @@ Component({
wx.navigateTo({
url: `/pages/topics/interactive/topicArticle/index?topicId=${id}`,
})
}
},
}
})

3
pages/user/myTopics/myParticipant/index.wxml

@ -9,7 +9,8 @@
userName="{{item.userName}}"
time="{{item.time}}"
commentNum="{{item.commentNum}}"
bind:clickListItem="clickListItem"/>
bind:clickListItem="clickListItem"
/>
</block>
<e-empty empty="{{list.length <= 0}}" message="暂无内容"/>
</view>

3
pages/user/myTopics/myRelease/index.js

@ -28,6 +28,9 @@ Component({
wx.navigateTo({
url: `/pages/topics/interactive/topicArticle/index?topicId=${id}`,
})
},
deleteListItem(e) {
this.triggerEvent('deleteTopic', { id: e.detail.id })
}
}
})

5
pages/user/myTopics/myRelease/index.wxml

@ -4,12 +4,13 @@
<cell
topicId="{{item.topicId}}"
title="{{item.title}}"
userIcon="{{item.groupAvator}}"
userIcon="{{item.userIcon}}"
topicImg="{{item.topicImg}}"
userName="{{item.userName}}"
time="{{item.time}}"
commentNum="{{item.commentNum}}"
bind:clickListItem="clickListItem"/>
bind:clickListItem="clickListItem"
bind:deleteListItem="deleteListItem"/>
</block>
<e-empty empty="{{list.length <= 0}}" message="暂无内容"/>
</view>

Loading…
Cancel
Save