Browse Source

Merge remote-tracking branch 'origin/master'

# Conflicts:
#	components/AQ/AQTabber.vue
master
liutong 1 year ago
parent
commit
7d94747768
  1. 118
      pages/student/index/index.vue

118
pages/student/index/index.vue

@ -1,5 +1,8 @@
<template> <template>
<view> <view>
<<<<<<< HEAD
<AQTabber></AQTabber>
=======
<view class="top"> <view class="top">
<view class="top_1">发现</view> <view class="top_1">发现</view>
<view class="top_2" @click="publishing"><fui-icon name="plussign" size="80" fontWeight="Number"></fui-icon></view> <view class="top_2" @click="publishing"><fui-icon name="plussign" size="80" fontWeight="Number"></fui-icon></view>
@ -62,6 +65,7 @@
<view style="width: 100%;height: 20rpx;"></view> <view style="width: 100%;height: 20rpx;"></view>
<AQTabber/> <AQTabber/>
>>>>>>> d89f93ea456d0a15a017b476c9df62a3b4c831ed
</view> </view>
</template> </template>
@ -76,16 +80,12 @@
}, },
data() { data() {
return { return {
list:[],
likes:0,
type:1,
type1:1,
activity_id:0,
um_id:0,
urls:'http://medication.zeyan.wang/'
} }
}, },
onLoad() { onLoad() {
<<<<<<< HEAD
=======
const um_id = uni.getStorageSync('um_id'); const um_id = uni.getStorageSync('um_id');
this.um_id = um_id this.um_id = um_id
if (um_id == '') { if (um_id == '') {
@ -94,92 +94,28 @@
}) })
} }
this.fetchData(this.um_id) this.fetchData(this.um_id)
>>>>>>> d89f93ea456d0a15a017b476c9df62a3b4c831ed
}, },
methods: { methods: {
fetchData(um_id) { // fetchData(um_id) {
user.activity_index({ // user.activity_index({
um_id: um_id // um_id: um_id
}).then(res => { // }).then(res => {
console.log(res) // console.log(res)
if(res.status == 200){ // if(res.status == 200){
if(res.data == null){ // if(res.data == null){
this.list = [] // this.list = []
}else{ // }else{
this.list = res.data // this.list = res.data
} // }
}else{ // }else{
uni.showToast({ // uni.showToast({
title: res.msg, // title: res.msg,
icon: 'none' // icon: 'none'
}) // })
} // }
}); // });
}, // },
onPullDownRefresh(){
this.fetchData(this.um_id)
},
publishing(){
uni.navigateTo({
url: '/pages/index/publishing'
})
},
like(id,um_id){
user.activity_like({um_id:um_id,activity_id:id,type:1}).then(res => {
if(res.status == 200){
user.activity_index({
um_id: um_id
}).then(res => {
console.log(res)
if(res.status == 200){
this.list = res.data
}
});
this.type = res.data.type
this.activity_id = res.data.activity_id
}else{
uni.showToast({
title: res.msg,
icon: 'none'
})
}
});
},
collection(id,um_id){
user.activity_like({um_id:um_id,activity_id:id,type:2}).then(res => {
if(res.status == 200){
console.log(res)
this.fetchData(this.um_id)
this.type1 = res.data.type
this.activity_id = res.data.activity_id
}else{
uni.showToast({
title: res.msg,
icon: 'none'
})
}
});
},
coninfo(item){
// user.coninfo({id:id}).then(res => {
// if(res.status == 200){
uni.setStorageSync('coninfo', item);
uni.navigateTo({
url: '/pages/index/coninfo'
})
// }else{
// uni.showToast({
// title: res.msg,
// icon: 'none'
// })
// }
// });
},
Comment(id){
uni.setStorageSync('actid', id);
uni.navigateTo({
url: '/pages/index/Comment'
})
}
} }
} }
</script> </script>

Loading…
Cancel
Save