fixed v-toast

This commit is contained in:
cmxdd 2020-07-30 10:12:27 +08:00
parent 70e848cbbb
commit 5094efd41e
12 changed files with 80 additions and 47 deletions

View File

@ -54,6 +54,10 @@ const install = (Vue, vm) => {
articlelist({type,page}){ articlelist({type,page}){
return vm.$u.post("/Article/articleList",{type,page}) return vm.$u.post("/Article/articleList",{type,page})
}, },
// 删除文章
delarticle({article_id}){
return vm.$u.post("/article/articleDelete",{article_id})
},
// 骑手列表 // 骑手列表
takeawayerlist(){ takeawayerlist(){
return vm.$u.get("/Order/getTakeawayerList") return vm.$u.get("/Order/getTakeawayerList")

View File

@ -1,7 +1,7 @@
<template> <template>
<view class="content-item"> <view class="content-item">
<view class="image"> <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> <image src="/static/image/user/5.png" class="play-icon" v-if="type==2"></image>
</view> </view>
<view class="right" > <view class="right" >
@ -69,7 +69,7 @@ export default {
width: 160rpx; width: 160rpx;
height: 160rpx; height: 160rpx;
border-radius: 10rpx; border-radius: 10rpx;
background-color: aqua; // background-color: aqua;
flex-shrink: 0; flex-shrink: 0;
} }
.play-icon { .play-icon {

View File

@ -81,6 +81,7 @@
<view class="determine">确定</view> <view class="determine">确定</view>
</view> </view>
</u-popup> </u-popup>
<u-toast ref="uToast" />
</view> </view>
</template> </template>
<script> <script>

View File

@ -102,7 +102,8 @@
</view> </view>
<image src="../../static/image/index/close.png" class="off" @click="close"></image> <image src="../../static/image/index/close.png" class="off" @click="close"></image>
</view> </view>
</u-popup> </u-popup>
<u-toast ref="uToast" />
</view> </view>
</template> </template>

View File

@ -15,6 +15,7 @@
<view class="content">{{item.content}}</view> <view class="content">{{item.content}}</view>
<view class="times">{{item.time}}</view> <view class="times">{{item.time}}</view>
</view> </view>
<u-toast ref="uToast" />
</view> </view>
</template> </template>
<script> <script>

View File

@ -3,6 +3,7 @@
<view class="complaint-item" v-for="(item, index) in 4" :key="index" @click="toDetailsPage"> <view class="complaint-item" v-for="(item, index) in 4" :key="index" @click="toDetailsPage">
<ComplaintItem></ComplaintItem> <ComplaintItem></ComplaintItem>
</view> </view>
<u-toast ref="uToast" />
</view> </view>
</template> </template>
<script> <script>

View File

@ -28,6 +28,7 @@
<view class="title">投诉原因</view> <view class="title">投诉原因</view>
<view class="value u-line-4">太慢了太慢了</view> <view class="value u-line-4">太慢了太慢了</view>
</view> </view>
<u-toast ref="uToast" />
</view> </view>
</template> </template>
<script> <script>

View File

@ -16,27 +16,19 @@
:is-scroll="false" :is-scroll="false"
></u-tabs-swiper> ></u-tabs-swiper>
</view> </view>
<swiper :current="swiperCurrent"> <view class="box">
<swiper-item class="swiper-item"> <view v-for="(item, index) in newlist" :key="index"><ContentItem :info="item" :type="type" @del="del"></ContentItem></view>
<scroll-view scroll-y style="height: 100%;width: 100%;" class="list"> </view>
<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>
<u-popup v-model="show" mode="center"> <u-popup v-model="show" mode="center">
<view class="close-popup"> <view class="close-popup">
<view class="tips">确定要删除该视频吗</view> <view class="tips">{{msg}}</view>
<view class="btn"> <view class="btn">
<view class="cancel" @click="show = false">取消</view> <view class="cancel" @click="show = false">取消</view>
<view class="confirm">确定</view> <view class="confirm" @click="delarticle">确定</view>
</view> </view>
</view> </view>
</u-popup> </u-popup>
<u-toast ref="uToast" />
</view> </view>
</template> </template>
<script> <script>
@ -57,7 +49,9 @@ export default {
], ],
type: 1, type: 1,
num: 1, num: 1,
newlist: [] newlist: [],
delid:null,
msg:""
}; };
}, },
components: { components: {
@ -73,44 +67,66 @@ export default {
methods: { methods: {
getlist() { getlist() {
let that = this; let that = this;
this.$u.api this.$u.api.articlelist({
.articlelist({ type: that.type,
type: that.type, page: that.num
page: that.num })
}) .then(res => {
.then(res => { if (res.errCode != 0) {
console.log(res); this.$refs.uToast.show({
if (res.errCode != 0) { title: res.message,
this.$refs.uToast.show({ type: 'error'
title: res.message, });
type: 'error' } else {
}); let arr = res.data.articleList;
} else { for (let index in arr) {
let arr = res.data.articleList; that.newlist.push(arr[index]);
for (let index in arr) {
that.newlist.push(arr[index]);
}
} }
}); }
});
}, },
del(e) { del(e) {
// //
if(this.type==1){
this.msg="确定要删除该图文吗?"
}else{
this.msg="确定要删除该视频吗?"
}
this.show = true; 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) { tabsChange(index) {
this.swiperCurrent = index; this.current = index;
this.type = index + 1; this.type = index + 1;
this.num = 0; this.num = 0;
this.newlist = []; this.newlist = [];
this.getlist(); 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%; width: 100%;
position: fixed; position: fixed;
top: 0; top: 0;
margin-bottom: 2rpx 0 20rpx 0; margin-bottom: 20rpx;
z-index: 1000;
} }
.content { .content {
min-height: calc(100vh - var(--window-top)); min-height: calc(100vh - var(--window-top));
@ -130,6 +147,9 @@ export default {
> uni-swiper { > uni-swiper {
flex: 1; flex: 1;
} }
.box{
padding-top: 120rpx;
}
.close-popup { .close-popup {
background: rgba(255, 255, 255, 1); background: rgba(255, 255, 255, 1);
border-radius: 10rpx; border-radius: 10rpx;

View File

@ -39,6 +39,7 @@
</view> </view>
</view> </view>
</u-popup> </u-popup>
<u-toast ref="uToast" />
</view> </view>
</template> </template>
<script> <script>

View File

@ -16,6 +16,7 @@
</view> </view>
</view> </view>
</view> </view>
<u-toast ref="uToast" />
</view> </view>
</template> </template>
<script> <script>

View File

@ -23,6 +23,7 @@
<text>骑手投诉</text> <text>骑手投诉</text>
<image src="/static/image/user/1.png"></image> <image src="/static/image/user/1.png"></image>
</view> </view>
<u-toast ref="uToast" />
</view> </view>
</template> </template>
<script> <script>

View File

@ -42,6 +42,7 @@
<image src="../../static/image/index/close.png" class="off" @click="close"></image> <image src="../../static/image/index/close.png" class="off" @click="close"></image>
</view> </view>
</u-popup> </u-popup>
<u-toast ref="uToast" />
</view> </view>
</template> </template>
<script> <script>