update api abput mine
This commit is contained in:
@@ -1,21 +1,30 @@
|
||||
<template>
|
||||
<view class="content">
|
||||
<view class="tab-swiper">
|
||||
<u-tabs-swiper ref="uTabs" :list="list" :current="current" @change="tabsChange" active-color="#FF780F" inactive-color="#333333" font-size="30" gutter="317" height="98" :show-bar="false" swiperWidth="750" :is-scroll="false"></u-tabs-swiper>
|
||||
<u-tabs-swiper
|
||||
ref="uTabs"
|
||||
:list="list"
|
||||
:current="current"
|
||||
@change="tabsChange"
|
||||
active-color="#FF780F"
|
||||
inactive-color="#333333"
|
||||
font-size="30"
|
||||
gutter="317"
|
||||
height="98"
|
||||
:show-bar="false"
|
||||
swiperWidth="750"
|
||||
:is-scroll="false"
|
||||
></u-tabs-swiper>
|
||||
</view>
|
||||
<swiper :current="swiperCurrent" >
|
||||
<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>
|
||||
<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>
|
||||
<view v-for="(item, index) in newlist" :key="index"><ContentItem :info="item" :type="type" @del="del"></ContentItem></view>
|
||||
</scroll-view>
|
||||
</swiper-item>
|
||||
</swiper>
|
||||
@@ -23,7 +32,7 @@
|
||||
<view class="close-popup">
|
||||
<view class="tips">确定要删除该视频吗</view>
|
||||
<view class="btn">
|
||||
<view class="cancel" @click="show=false">取消</view>
|
||||
<view class="cancel" @click="show = false">取消</view>
|
||||
<view class="confirm">确定</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -31,102 +40,109 @@
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
import ContentItem from '@/components/content-item/index'
|
||||
import ContentItem from '@/components/content-item/index';
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
show: false,
|
||||
current: 0,
|
||||
swiperCurrent: 0,
|
||||
list: [{
|
||||
name: '图文'
|
||||
}, {
|
||||
name: '视频'
|
||||
}],
|
||||
type:1,
|
||||
num:1,
|
||||
newlist:[]
|
||||
}
|
||||
list: [
|
||||
{
|
||||
name: '图文'
|
||||
},
|
||||
{
|
||||
name: '视频'
|
||||
}
|
||||
],
|
||||
type: 1,
|
||||
num: 1,
|
||||
newlist: []
|
||||
};
|
||||
},
|
||||
components: {
|
||||
ContentItem
|
||||
},
|
||||
onLoad() {
|
||||
this.getlist()
|
||||
this.getlist();
|
||||
},
|
||||
onReachBottom() {
|
||||
this.num++
|
||||
this.getlist()
|
||||
this.num++;
|
||||
this.getlist();
|
||||
},
|
||||
methods: {
|
||||
getlist(){
|
||||
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 => {
|
||||
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]);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
},
|
||||
del(e) {
|
||||
// 删除元素
|
||||
this.show=true
|
||||
console.log(e)
|
||||
this.show = true;
|
||||
console.log(e);
|
||||
},
|
||||
tabsChange(index) {
|
||||
this.swiperCurrent = index;
|
||||
this.type=index+1;
|
||||
this.num=0
|
||||
this.newlist=[]
|
||||
this.getlist()
|
||||
this.type = index + 1;
|
||||
this.num = 0;
|
||||
this.newlist = [];
|
||||
this.getlist();
|
||||
},
|
||||
animationfinish(e) {
|
||||
console.log(12345666)
|
||||
console.log(12345666);
|
||||
let current = e.detail.current;
|
||||
this.swiperCurrent = current;
|
||||
this.current = current;
|
||||
this.type=current+1;
|
||||
},
|
||||
},
|
||||
this.type = current + 1;
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.tab-swiper {
|
||||
width: 100%;
|
||||
position: fixed;
|
||||
top: 0;
|
||||
margin-bottom: 2rpx 0 20rpx 0;
|
||||
}
|
||||
.content {
|
||||
min-height: calc(100vh - var(--window-top));
|
||||
background-color: #ECECEC;
|
||||
background-color: #ececec;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
> uni-swiper {
|
||||
flex: 1;
|
||||
}
|
||||
.tab-swiper {
|
||||
margin: 2rpx 0 20rpx 0;
|
||||
}
|
||||
.close-popup {
|
||||
background:rgba(255,255,255,1);
|
||||
background: rgba(255, 255, 255, 1);
|
||||
border-radius: 10rpx;
|
||||
.tips {
|
||||
width: 420rpx;
|
||||
font-size: 28rpx;
|
||||
color: rgba(102,102,102,1);
|
||||
color: rgba(102, 102, 102, 1);
|
||||
text-align: center;
|
||||
padding: 38rpx 0;
|
||||
}
|
||||
.btn {
|
||||
width: 420rpx;
|
||||
border-top: 2rpx #ECECEC solid;
|
||||
border-top: 2rpx #ececec solid;
|
||||
display: flex;
|
||||
> view {
|
||||
font-size: 26rpx;
|
||||
@@ -136,12 +152,12 @@ export default {
|
||||
}
|
||||
.cancel {
|
||||
color: #333333;
|
||||
border-right: 2rpx #ECECEC solid;
|
||||
border-right: 2rpx #ececec solid;
|
||||
}
|
||||
.confirm {
|
||||
color: #FF780F;
|
||||
color: #ff780f;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<view class="lately">
|
||||
<view class="title">最新</view>
|
||||
<view class="items">
|
||||
<view v-for="(item, index) in myfans" :key="index">
|
||||
<view v-for="(item, index) in newfans" :key="index">
|
||||
<FansItem :info="item"></FansItem>
|
||||
</view>
|
||||
</view>
|
||||
@@ -11,7 +11,7 @@
|
||||
<view class="before">
|
||||
<view class="title">早前</view>
|
||||
<view class="items">
|
||||
<view v-for="(item, index) in newfans" :key="index">
|
||||
<view v-for="(item, index) in myfans" :key="index">
|
||||
<FansItem :info="item"></FansItem>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@@ -6,11 +6,11 @@
|
||||
</view>
|
||||
<view class="item">
|
||||
<text class="title">用户名</text>
|
||||
<input type="text" :value="info.member_nickname==null?'新用户':info.member_nickname" />
|
||||
<input type="text" value="" v-model="info.member_nickname" placeholder="请输入用户名"/>
|
||||
</view>
|
||||
<view class="item">
|
||||
<text class="title">个性签名</text>
|
||||
<input type="text" :value="info.signature==''?'该用户很懒没有签名!':info.signature" />
|
||||
<input type="text" value="" v-model="info.signature" placeholder="请输入个性签名"/>
|
||||
</view>
|
||||
<view class="password" @click="updatePwd">
|
||||
<text>修改密码</text>
|
||||
|
||||
Reference in New Issue
Block a user