Commit 9ec1eace authored by jiaoyahui's avatar jiaoyahui

增加删除接口

parent 8a74d3fb
...@@ -108,6 +108,11 @@ live: { ...@@ -108,6 +108,11 @@ live: {
getconfig:function(data){ getconfig:function(data){
return service.post('/wx/jssdk/config', data) return service.post('/wx/jssdk/config', data)
}, },
deleteLiveHistory:function(data,historyId){
console.log(data,'p')
return service.get('/app/live/deleteLiveHistory/'+historyId,data)
},
......
...@@ -3,12 +3,12 @@ ...@@ -3,12 +3,12 @@
<img src="../../assets/left.png" alt="" class="Lent_p" @click="go"> <img src="../../assets/left.png" alt="" class="Lent_p" @click="go">
<div class="brow">我的浏览</div> <div class="brow">我的浏览</div>
<ul v-if="this.flag == 1"> <ul>
<div class="time">一天之内</div> <div class="time">一天之内</div>
<!-- data-type=0 隐藏删除按钮 data-type=1 显示删除按钮 --> <!-- data-type=0 隐藏删除按钮 data-type=1 显示删除按钮 -->
<li class="li_vessel" v-for="(item,index) in lists " data-type="0" :key="index"> <li class="li_vessel" v-for="(item,index) in lists " data-type="0" :key="index">
<!-- "touchstart" 当手指触摸屏幕时候触发 "touchend" 当手指从屏幕上离开的时候触发 "capture" 用于事件捕获--> <!-- "touchstart" 当手指触摸屏幕时候触发 "touchend" 当手指从屏幕上离开的时候触发 "capture" 用于事件捕获-->
<div @touchstart.capture="touchStart" @touchend.capture="touchEnd" @click="oneself"> <div @touchstart.capture="touchStart" @touchend.capture="touchEnd" @click="oneself" v-if="item.flag == 1">
<div class="contant"> <div class="contant">
<img class="image" :src="item.lvrImgSmallUrl" alt /> <img class="image" :src="item.lvrImgSmallUrl" alt />
<div class="rightBox"> <div class="rightBox">
...@@ -19,16 +19,16 @@ ...@@ -19,16 +19,16 @@
</div> </div>
</div> </div>
</div> </div>
<div class="removeBtn" @click="remove" :data-index="index">删除</div> <div class="removeBtn" @click="remove(index,item.id)" :data-index="index">删除</div>
</li> </li>
</ul> </ul>
<!-- 更早 --> <!-- 更早 -->
<ul v-if="this.flag == 0"> <ul>
<div class="timetwo">更早</div> <div class="timetwo">更早</div>
<li class="li_vessel" v-for="(item,index) in lists " data-type="0" :key="index"> <li class="li_vessel" v-for="(item,index) in lists " data-type="0" :key="index">
<!-- "touchstart" 当手指触摸屏幕时候触发 "touchend" 当手指从屏幕上离开的时候触发 "capture" 用于事件捕获--> <!-- "touchstart" 当手指触摸屏幕时候触发 "touchend" 当手指从屏幕上离开的时候触发 "capture" 用于事件捕获-->
<div @touchstart.capture="touchStart" @touchend.capture="touchEnd" @click="oneself"> <div @touchstart.capture="touchStart" @touchend.capture="touchEnd" @click="oneself" v-if="item.flag == 0">
<div class="contant"> <div class="contant">
<img class="image" :src="item.lvrImgSmallUrl" alt /> <img class="image" :src="item.lvrImgSmallUrl" alt />
<div class="rightBox"> <div class="rightBox">
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
</div> </div>
</div> </div>
</div> </div>
<div class="removeBtn" @click="remove" :data-index="index">删除</div> <div class="removeBtn" @click="remove(index,item.id)" :data-index="index">删除</div>
</li> </li>
</ul> </ul>
...@@ -65,6 +65,19 @@ export default { ...@@ -65,6 +65,19 @@ export default {
this.getLiveHistory() this.getLiveHistory()
}, },
methods: { methods: {
deleteLiveHistory(id){
let token=sessionStorage.getItem("token")
console.log(id,'有没有id')
let temp=this.qs.stringify({
token:token,
historyId:id
})
this.server.live.deleteLiveHistory(temp,id).then(res=>{
})
},
go:function(){ go:function(){
this.$router.push({name:'mine'}) this.$router.push({name:'mine'})
...@@ -87,7 +100,8 @@ export default { ...@@ -87,7 +100,8 @@ export default {
this.lists =res.data.data.list this.lists =res.data.data.list
this.listtwo=res.data.data.list this.listtwo=res.data.data.list
this.updateTime=res.data.data.list.updateTime this.updateTime=res.data.data.list.updateTime
this.flag=res.data.data.list[0].flag this.flag=res.data.data.list
console.log(this.flag,'-=----------------') console.log(this.flag,'-=----------------')
}) })
...@@ -144,13 +158,16 @@ export default { ...@@ -144,13 +158,16 @@ export default {
} }
}, },
//删除数据信息 //删除数据信息
remove(e) { remove(index,id) {
// 当前索引值 // 当前索引值
let index = e.currentTarget.dataset.index; // let index = e.currentTarget.dataset.index;
// let id = e.currentTarget.dataset.id;
console.log(id,'wwwwww')
// 复位 // 复位
this.restSlide(); this.restSlide();
// 删除数组lists中一个数据 // 删除数组lists中一个数据
this.lists.splice(index, 1); this.lists.splice(index, 1);
this.deleteLiveHistory(id)
}, },
}, },
......
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