diff --git a/models/topic.js b/models/topic.js
index a1c55c1..2d197a6 100644
--- a/models/topic.js
+++ b/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,
diff --git a/pages/topics/index.js b/pages/topics/index.js
index df013a9..81fd443 100644
--- a/pages/topics/index.js
+++ b/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)
},
diff --git a/pages/topics/index.wxml b/pages/topics/index.wxml
index 526bee8..980a759 100644
--- a/pages/topics/index.wxml
+++ b/pages/topics/index.wxml
@@ -1,7 +1,7 @@
-
+
diff --git a/pages/topics/interactive/cell/index.js b/pages/topics/interactive/cell/index.js
index 11df272..a5f1407 100644
--- a/pages/topics/interactive/cell/index.js
+++ b/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 })
}
}
})
diff --git a/pages/topics/interactive/cell/index.wxml b/pages/topics/interactive/cell/index.wxml
index 7727ad6..fd60493 100644
--- a/pages/topics/interactive/cell/index.wxml
+++ b/pages/topics/interactive/cell/index.wxml
@@ -1,29 +1,34 @@
-
-
- {{title}}
-
-
-
-
-
-
+
+
+
+
+ {{title}}
- {{userName}}
- {{time}}
-
+
+
+
+
+
+
+ {{userName}}
+ {{time}}
+
+
+
-
-
+
+
+
-
-
-
-
+ 删除
+
diff --git a/pages/topics/interactive/cell/index.wxss b/pages/topics/interactive/cell/index.wxss
index 48f4042..68e225e 100644
--- a/pages/topics/interactive/cell/index.wxss
+++ b/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,16 +98,56 @@ 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 {
padding: 0 10px;
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);
}
\ No newline at end of file
diff --git a/pages/topics/interactive/index.js b/pages/topics/interactive/index.js
index 00b76b1..c445b58 100644
--- a/pages/topics/interactive/index.js
+++ b/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 })
}
}
})
diff --git a/pages/topics/interactive/index.wxml b/pages/topics/interactive/index.wxml
index c29217f..2e0f503 100644
--- a/pages/topics/interactive/index.wxml
+++ b/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"
+ />
diff --git a/pages/topics/interactive/topicArticle/index.wxml b/pages/topics/interactive/topicArticle/index.wxml
index 7393f61..a1df078 100644
--- a/pages/topics/interactive/topicArticle/index.wxml
+++ b/pages/topics/interactive/topicArticle/index.wxml
@@ -68,5 +68,5 @@
-
+
\ No newline at end of file
diff --git a/pages/user/index.js b/pages/user/index.js
index 22c4d40..f252ea7 100644
--- a/pages/user/index.js
+++ b/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`,
diff --git a/pages/user/myInfo/index.js b/pages/user/myInfo/index.js
index fa16d38..becffa6 100644
--- a/pages/user/myInfo/index.js
+++ b/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
diff --git a/pages/user/myInfo/index.json b/pages/user/myInfo/index.json
index 83e283c..dba7d7d 100644
--- a/pages/user/myInfo/index.json
+++ b/pages/user/myInfo/index.json
@@ -1,5 +1,4 @@
{
- "enablePullDownRefresh": true,
"navigationBarTitleText": "个人资料",
"usingComponents": {
"e-ibutton": "/components/image-button/index",
diff --git a/pages/user/myInfo/index.wxml b/pages/user/myInfo/index.wxml
index 3e823f4..571a821 100644
--- a/pages/user/myInfo/index.wxml
+++ b/pages/user/myInfo/index.wxml
@@ -11,28 +11,32 @@
bindtap="onTapItem" data-type="userName"
title="名字"
ext-class="cell-item">
-
+
+
-
+
+
-
+
+
-
+
+
-
+
diff --git a/pages/user/myInfo/index.wxss b/pages/user/myInfo/index.wxss
index eaff6bb..c1af3ba 100644
--- a/pages/user/myInfo/index.wxss
+++ b/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;
diff --git a/pages/user/myTopics/index.js b/pages/user/myTopics/index.js
index d7b31ef..d4b20ad 100644
--- a/pages/user/myTopics/index.js
+++ b/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()
+ }
+ })
+ }
+ })
}
})
\ No newline at end of file
diff --git a/pages/user/myTopics/index.json b/pages/user/myTopics/index.json
index b692be3..55bff3b 100644
--- a/pages/user/myTopics/index.json
+++ b/pages/user/myTopics/index.json
@@ -1,4 +1,5 @@
{
+ "enablePullDownRefresh": true,
"navigationBarTitleText": "我的议题",
"usingComponents": {
"e-segment": "/components/segment/index",
diff --git a/pages/user/myTopics/index.wxml b/pages/user/myTopics/index.wxml
index 4c8b37f..12a43fe 100644
--- a/pages/user/myTopics/index.wxml
+++ b/pages/user/myTopics/index.wxml
@@ -2,5 +2,5 @@
-
+
diff --git a/pages/user/myTopics/myParticipant/cell/index.js b/pages/user/myTopics/myParticipant/cell/index.js
index c625683..1d7b5b5 100644
--- a/pages/user/myTopics/myParticipant/cell/index.js
+++ b/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 })
}
}
})
diff --git a/pages/user/myTopics/myParticipant/cell/index.wxml b/pages/user/myTopics/myParticipant/cell/index.wxml
index d32a89f..97d2a6d 100644
--- a/pages/user/myTopics/myParticipant/cell/index.wxml
+++ b/pages/user/myTopics/myParticipant/cell/index.wxml
@@ -1,29 +1,34 @@
-
-
- {{title}}
-
-
-
-
-
-
+
+
+
+
+ {{title}}
- {{userName}}
- {{time}}
-
+
+
+
+
+
+
+ {{userName}}
+ {{time}}
+
+
+
-
-
+
+
+
-
-
-
+ 删除
diff --git a/pages/user/myTopics/myParticipant/cell/index.wxss b/pages/user/myTopics/myParticipant/cell/index.wxss
index 913435c..68e225e 100644
--- a/pages/user/myTopics/myParticipant/cell/index.wxss
+++ b/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,13 +69,13 @@
color: #3B3B3B;
}
.right{
- width: 30%;
- height: 70px;
+ width: 35%;
+ height: 80px;
border-radius: 5px;
background-color: #EEEEEE;
}
image{
- width: 100%;
+ width: 100%;
height: 100%;
}
.articleImg{
@@ -94,21 +87,67 @@ 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 {
padding: 0 10px;
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);
}
\ No newline at end of file
diff --git a/pages/user/myTopics/myParticipant/index.js b/pages/user/myTopics/myParticipant/index.js
index 2035e9c..0d23bc7 100644
--- a/pages/user/myTopics/myParticipant/index.js
+++ b/pages/user/myTopics/myParticipant/index.js
@@ -28,6 +28,7 @@ Component({
wx.navigateTo({
url: `/pages/topics/interactive/topicArticle/index?topicId=${id}`,
})
- }
+ },
+
}
})
diff --git a/pages/user/myTopics/myParticipant/index.wxml b/pages/user/myTopics/myParticipant/index.wxml
index f6823d7..870f7db 100644
--- a/pages/user/myTopics/myParticipant/index.wxml
+++ b/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"
+ />
diff --git a/pages/user/myTopics/myRelease/index.js b/pages/user/myTopics/myRelease/index.js
index 4dfbaed..0225b9f 100644
--- a/pages/user/myTopics/myRelease/index.js
+++ b/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 })
}
}
})
diff --git a/pages/user/myTopics/myRelease/index.wxml b/pages/user/myTopics/myRelease/index.wxml
index 95cc018..2b9bcb2 100644
--- a/pages/user/myTopics/myRelease/index.wxml
+++ b/pages/user/myTopics/myRelease/index.wxml
@@ -4,12 +4,13 @@
|
+ bind:clickListItem="clickListItem"
+ bind:deleteListItem="deleteListItem"/>