Commit ef674b0f authored by 杨硕's avatar 杨硕

添加触底加载

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