Commit ef674b0f authored by 杨硕's avatar 杨硕

添加触底加载

parent d45a28fc
...@@ -27,15 +27,27 @@ ...@@ -27,15 +27,27 @@
return { return {
hotList: [], hotList: [],
page: 1, page: 1,
rows: 5, rows: 10,
total: 0, total: 0,
articleStatus: "loadmore" articleStatus: "loadmore"
} }
}, },
onLoad() { onLoad() {
this.noToken()
},
onShow() {
this.init() this.init()
}, },
methods: { methods: {
noToken() {
const token = this.vuex_token
console.log("token",token);
if (token.length <=0){
this.$u.route({
url: '/login/login/passwordLogin'
})
}
},
init(){ init(){
this.articleStatus = this.page*this.rows >= this.total ? this.articleStatus = this.page*this.rows >= this.total ?
'nomore' : 'loadmore' 'nomore' : 'loadmore'
......
...@@ -34,6 +34,9 @@ ...@@ -34,6 +34,9 @@
} }
}, },
onLoad() {
this.noToken()
},
onShow() { onShow() {
this.init() this.init()
}, },
...@@ -43,6 +46,15 @@ ...@@ -43,6 +46,15 @@
// #endif // #endif
}, },
methods: { methods: {
noToken() {
const token = this.vuex_token
console.log("token",token);
if (token.length <=0){
this.$u.route({
url: '/login/login/passwordLogin'
})
}
},
init(){ init(){
this.status = this.page*this.rows >= this.total ? this.status = this.page*this.rows >= this.total ?
'nomore' : 'loadmore' 'nomore' : 'loadmore'
......
...@@ -64,10 +64,22 @@ ...@@ -64,10 +64,22 @@
} }
}, },
onLoad() { onLoad() {
this.noToken()
},
onShow() {
this.init() this.init()
this.queryVideo() this.queryVideo()
}, },
methods: { methods: {
noToken() {
const token = this.vuex_token
console.log("token",token);
if (token.length <=0){
this.$u.route({
url: '/login/login/passwordLogin'
})
}
},
sectionChange(index) { sectionChange(index) {
this.curNow = index; this.curNow = index;
}, },
......
...@@ -6,13 +6,13 @@ ...@@ -6,13 +6,13 @@
<image class="settingimage1" :src="vuex_avatar"></image> <image class="settingimage1" :src="vuex_avatar"></image>
<image class="settingrightimage" src="../../static/img/image/wode_icon_jiantou@2x.png"></image> <image class="settingrightimage" src="../../static/img/image/wode_icon_jiantou@2x.png"></image>
</view> --> </view> -->
<view class="card2" @click="updateNickName"> <view class="card2">
<image src="../../static/image/shezhi_icon_xingming@2x.png" class="settingimage"></image> <image src="../../static/image/shezhi_icon_xingming@2x.png" class="settingimage"></image>
<view class="settingtitle">姓名</view> <view class="settingtitle">姓名</view>
<view class="righttitle1">{{user.name}}</view> <view class="righttitle1">{{user.name}}</view>
<image class="settingrightimage" src="../../static/img/image/wode_icon_jiantou@2x.png"></image> <image class="settingrightimage" src="../../static/img/image/wode_icon_jiantou@2x.png"></image>
</view> </view>
<view class="card1" @click="updateGender"> <view class="card1">
<image src="../../static/image/shezhi_icon_xingbie@2x.png" class="settingimage"></image> <image src="../../static/image/shezhi_icon_xingbie@2x.png" class="settingimage"></image>
<view class="settingtitle">性别</view> <view class="settingtitle">性别</view>
<view class="righttitle1">{{user.genderStr}}</view> <view class="righttitle1">{{user.genderStr}}</view>
...@@ -44,7 +44,7 @@ ...@@ -44,7 +44,7 @@
<u-modal v-model="nickName.show" title="修改用户名" @confirm="submitNickName" :show-cancel-button="true"> <u-modal v-model="nickName.show" title="修改用户名" @confirm="submitNickName" :show-cancel-button="true">
<view style="padding:10px 50px;"> <view style="padding:10px 50px;">
<u-input style="padding: 0rpx 30rpx;background-color: #ededed;" v-model="nickName.value" <u-input style="padding: 0rpx 30rpx;" v-model="nickName.value"
placeholder="请输入用户名" /> placeholder="请输入用户名" />
</view> </view>
</u-modal> </u-modal>
...@@ -90,10 +90,22 @@ ...@@ -90,10 +90,22 @@
} }
}, },
onLoad() { onLoad() {
this.noToken()
this.init(); this.init();
if(this.vuex_unit.length>0){
this.unitName = this.vuex_unit[0].unitName this.unitName = this.vuex_unit[0].unitName
}
}, },
methods: { methods: {
noToken() {
const token = this.vuex_token
console.log("token",token);
if (token.length <=0){
this.$u.route({
url: '/login/login/passwordLogin'
})
}
},
init() { init() {
const user = this.vuex_user; const user = this.vuex_user;
if (user.nickName !== '未登录') { if (user.nickName !== '未登录') {
...@@ -199,9 +211,10 @@ ...@@ -199,9 +211,10 @@
}); });
this.$u.vuex('vuex_unit',[]) this.$u.vuex('vuex_unit',[])
this.$u.route({ this.$u.route({
url: 'pages/user/profile', url: 'pages/user/profile',
params: {} type: 'tab'
}) })
}, },
toDoc() { toDoc() {
......
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