fixed v-toast
This commit is contained in:
parent
70e848cbbb
commit
5094efd41e
@ -54,6 +54,10 @@ const install = (Vue, vm) => {
|
||||
articlelist({type,page}){
|
||||
return vm.$u.post("/Article/articleList",{type,page})
|
||||
},
|
||||
// 删除文章
|
||||
delarticle({article_id}){
|
||||
return vm.$u.post("/article/articleDelete",{article_id})
|
||||
},
|
||||
// 骑手列表
|
||||
takeawayerlist(){
|
||||
return vm.$u.get("/Order/getTakeawayerList")
|
||||
|
@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<view class="content-item">
|
||||
<view class="image">
|
||||
<image class="cover" :src="info.article_pic"></image>
|
||||
<image class="cover" :src="info.article_pic" alt="没有图片"></image>
|
||||
<image src="/static/image/user/5.png" class="play-icon" v-if="type==2"></image>
|
||||
</view>
|
||||
<view class="right" >
|
||||
@ -69,7 +69,7 @@ export default {
|
||||
width: 160rpx;
|
||||
height: 160rpx;
|
||||
border-radius: 10rpx;
|
||||
background-color: aqua;
|
||||
// background-color: aqua;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
.play-icon {
|
||||
|
@ -81,6 +81,7 @@
|
||||
<view class="determine">确定</view>
|
||||
</view>
|
||||
</u-popup>
|
||||
<u-toast ref="uToast" />
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
|
@ -102,7 +102,8 @@
|
||||
</view>
|
||||
<image src="../../static/image/index/close.png" class="off" @click="close"></image>
|
||||
</view>
|
||||
</u-popup>
|
||||
</u-popup>
|
||||
<u-toast ref="uToast" />
|
||||
</view>
|
||||
</template>
|
||||
|
||||
|
@ -15,6 +15,7 @@
|
||||
<view class="content">{{item.content}}</view>
|
||||
<view class="times">{{item.time}}</view>
|
||||
</view>
|
||||
<u-toast ref="uToast" />
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
|
@ -3,6 +3,7 @@
|
||||
<view class="complaint-item" v-for="(item, index) in 4" :key="index" @click="toDetailsPage">
|
||||
<ComplaintItem></ComplaintItem>
|
||||
</view>
|
||||
<u-toast ref="uToast" />
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
|
@ -28,6 +28,7 @@
|
||||
<view class="title">投诉原因</view>
|
||||
<view class="value u-line-4">太慢了太慢了!!!!</view>
|
||||
</view>
|
||||
<u-toast ref="uToast" />
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
|
@ -16,27 +16,19 @@
|
||||
:is-scroll="false"
|
||||
></u-tabs-swiper>
|
||||
</view>
|
||||
<swiper :current="swiperCurrent">
|
||||
<swiper-item class="swiper-item">
|
||||
<scroll-view scroll-y style="height: 100%;width: 100%;" class="list">
|
||||
<view v-for="(item, index) in newlist" :key="index"><ContentItem :info="item" :type="type" del="del"></ContentItem></view>
|
||||
</scroll-view>
|
||||
</swiper-item>
|
||||
<swiper-item class="swiper-item">
|
||||
<scroll-view scroll-y style="height: 100%;width: 100%;" class="video-list">
|
||||
<view v-for="(item, index) in newlist" :key="index"><ContentItem :info="item" :type="type" @del="del"></ContentItem></view>
|
||||
</scroll-view>
|
||||
</swiper-item>
|
||||
</swiper>
|
||||
<view class="box">
|
||||
<view v-for="(item, index) in newlist" :key="index"><ContentItem :info="item" :type="type" @del="del"></ContentItem></view>
|
||||
</view>
|
||||
<u-popup v-model="show" mode="center">
|
||||
<view class="close-popup">
|
||||
<view class="tips">确定要删除该视频吗</view>
|
||||
<view class="tips">{{msg}}</view>
|
||||
<view class="btn">
|
||||
<view class="cancel" @click="show = false">取消</view>
|
||||
<view class="confirm">确定</view>
|
||||
<view class="confirm" @click="delarticle">确定</view>
|
||||
</view>
|
||||
</view>
|
||||
</u-popup>
|
||||
<u-toast ref="uToast" />
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
@ -57,7 +49,9 @@ export default {
|
||||
],
|
||||
type: 1,
|
||||
num: 1,
|
||||
newlist: []
|
||||
newlist: [],
|
||||
delid:null,
|
||||
msg:""
|
||||
};
|
||||
},
|
||||
components: {
|
||||
@ -73,44 +67,66 @@ export default {
|
||||
methods: {
|
||||
getlist() {
|
||||
let that = this;
|
||||
this.$u.api
|
||||
.articlelist({
|
||||
type: that.type,
|
||||
page: that.num
|
||||
})
|
||||
.then(res => {
|
||||
console.log(res);
|
||||
if (res.errCode != 0) {
|
||||
this.$refs.uToast.show({
|
||||
title: res.message,
|
||||
type: 'error'
|
||||
});
|
||||
} else {
|
||||
let arr = res.data.articleList;
|
||||
for (let index in arr) {
|
||||
that.newlist.push(arr[index]);
|
||||
}
|
||||
this.$u.api.articlelist({
|
||||
type: that.type,
|
||||
page: that.num
|
||||
})
|
||||
.then(res => {
|
||||
if (res.errCode != 0) {
|
||||
this.$refs.uToast.show({
|
||||
title: res.message,
|
||||
type: 'error'
|
||||
});
|
||||
} else {
|
||||
let arr = res.data.articleList;
|
||||
for (let index in arr) {
|
||||
that.newlist.push(arr[index]);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
del(e) {
|
||||
// 删除元素
|
||||
// 提示是否删除弹窗
|
||||
if(this.type==1){
|
||||
this.msg="确定要删除该图文吗?"
|
||||
}else{
|
||||
this.msg="确定要删除该视频吗?"
|
||||
}
|
||||
this.show = true;
|
||||
console.log(e);
|
||||
this.delid = e
|
||||
},
|
||||
// 删除文章
|
||||
delarticle(){
|
||||
let that = this;
|
||||
that.show = false;
|
||||
this.$u.api.delarticle({
|
||||
article_id: that.delid
|
||||
})
|
||||
.then(res => {
|
||||
console.log(res)
|
||||
if (res.errCode != 0) {
|
||||
this.$refs.uToast.show({
|
||||
title: res.message,
|
||||
type: 'error'
|
||||
});
|
||||
} else {
|
||||
this.$refs.uToast.show({
|
||||
title: res.message,
|
||||
type: 'success'
|
||||
});
|
||||
// 删除后更新页面
|
||||
this.newlist = [];
|
||||
that.num=1
|
||||
that.getlist()
|
||||
}
|
||||
});
|
||||
},
|
||||
tabsChange(index) {
|
||||
this.swiperCurrent = index;
|
||||
this.current = index;
|
||||
this.type = index + 1;
|
||||
this.num = 0;
|
||||
this.newlist = [];
|
||||
this.getlist();
|
||||
},
|
||||
animationfinish(e) {
|
||||
console.log(12345666);
|
||||
let current = e.detail.current;
|
||||
this.swiperCurrent = current;
|
||||
this.current = current;
|
||||
this.type = current + 1;
|
||||
}
|
||||
}
|
||||
};
|
||||
@ -120,7 +136,8 @@ export default {
|
||||
width: 100%;
|
||||
position: fixed;
|
||||
top: 0;
|
||||
margin-bottom: 2rpx 0 20rpx 0;
|
||||
margin-bottom: 20rpx;
|
||||
z-index: 1000;
|
||||
}
|
||||
.content {
|
||||
min-height: calc(100vh - var(--window-top));
|
||||
@ -130,6 +147,9 @@ export default {
|
||||
> uni-swiper {
|
||||
flex: 1;
|
||||
}
|
||||
.box{
|
||||
padding-top: 120rpx;
|
||||
}
|
||||
.close-popup {
|
||||
background: rgba(255, 255, 255, 1);
|
||||
border-radius: 10rpx;
|
||||
|
@ -39,6 +39,7 @@
|
||||
</view>
|
||||
</view>
|
||||
</u-popup>
|
||||
<u-toast ref="uToast" />
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
|
@ -16,6 +16,7 @@
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<u-toast ref="uToast" />
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
|
@ -23,6 +23,7 @@
|
||||
<text>骑手投诉</text>
|
||||
<image src="/static/image/user/1.png"></image>
|
||||
</view>
|
||||
<u-toast ref="uToast" />
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
|
@ -42,6 +42,7 @@
|
||||
<image src="../../static/image/index/close.png" class="off" @click="close"></image>
|
||||
</view>
|
||||
</u-popup>
|
||||
<u-toast ref="uToast" />
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
|
Loading…
Reference in New Issue
Block a user