| xqd
@@ -1,8 +1,8 @@
|
|
|
<template>
|
|
|
<view class="main">
|
|
|
<view class="padding-lr">
|
|
|
- <view v-for="(item,index) in messageList" @click="gotoliaotian(item)" :key="index" class="padding-lr-sm padding-tb-sm bg-white margin-top-sm"
|
|
|
- style="border-radius: 16rpx;box-shadow: 0 0 50rpx 0 rgba(0, 0, 0, 0.1);">
|
|
|
+ <view v-for="(item,index) in messageList" @click="gotoliaotian(item)" :key="index" class="padding-lr-sm padding-tb-sm bg-white margin-top-sm fade-in"
|
|
|
+ :style="'border-radius: 16rpx;box-shadow: 0 0 50rpx 0 rgba(0, 0, 0, 0.1);'+'opacity:'+opacity+';'+'transform: scale('+scale+');'">
|
|
|
<view class="flex justify-start align-center">
|
|
|
<u-icon name="order"></u-icon>
|
|
|
<text class="text-lg margin-left-xs">{{
|
| xqd
@@ -33,6 +33,8 @@
|
|
|
|
|
|
},
|
|
|
onShow() {
|
|
|
+ this.pageindex = 1
|
|
|
+ this.messageList = []
|
|
|
this.getMessage()
|
|
|
// if (getApp().globalData.imService == null) {
|
|
|
// let user = uni.getStorageSync('user')
|
| xqd
@@ -64,7 +66,9 @@
|
|
|
});
|
|
|
},
|
|
|
mounted() {
|
|
|
-
|
|
|
+ setTimeout(() => {
|
|
|
+ this.handleScroll()
|
|
|
+ }, 800)
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
| xqd
@@ -76,12 +80,27 @@
|
|
|
conversations: []
|
|
|
},
|
|
|
imService: null,
|
|
|
+ opacity: 0,
|
|
|
+ scale: 0.8
|
|
|
}
|
|
|
},
|
|
|
onReachBottom() {
|
|
|
this.getMessage()
|
|
|
},
|
|
|
methods: {
|
|
|
+ getNodes(item) {
|
|
|
+ return (item.top + 200) < uni.getSystemInfoSync().windowHeight && item.bottom >= 0
|
|
|
+ },
|
|
|
+ handleScroll() {
|
|
|
+ let query = uni.createSelectorQuery().selectAll('.fade-in').boundingClientRect((res) => {
|
|
|
+ res.forEach(item => {
|
|
|
+ if (this.getNodes(item)) {
|
|
|
+ this.opacity = 1
|
|
|
+ this.scale = 1
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }).exec()
|
|
|
+ },
|
|
|
getMessage: async function() {
|
|
|
let res = await this.$request.post("/api/v1/user/userMessageList", {
|
|
|
page: this.pageindex
|
| xqd
@@ -116,6 +135,8 @@
|
|
|
})
|
|
|
},
|
|
|
gotoliaotian(item) {
|
|
|
+ // this.getNodes()
|
|
|
+ console.log(item)
|
|
|
if (item.type == 1 || item.type == 4) {
|
|
|
uni.navigateTo({
|
|
|
url: "../common_tools/my_consulting/consultingInfo?id=" + item.relation_id
|
| xqd
@@ -128,6 +149,19 @@
|
|
|
uni.navigateTo({
|
|
|
url: "../service_box/box_details"
|
|
|
})
|
|
|
+ } else if (item.type == 99) {
|
|
|
+ this.$request.post("/api/v1/docter/docterDetail", {
|
|
|
+ docter_id: item.docter_id
|
|
|
+ }).then(res => {
|
|
|
+ let obj = {
|
|
|
+ id: res.id,
|
|
|
+ name: res.name,
|
|
|
+ avatar: res.avatar
|
|
|
+ }
|
|
|
+ uni.navigateTo({
|
|
|
+ url: "../common_tools/my_consulting/conversation?doctor=" + JSON.stringify(obj) + "&doctorstatus=" + 3
|
|
|
+ })
|
|
|
+ })
|
|
|
}
|
|
|
}
|
|
|
}
|
| xqd
@@ -136,4 +170,9 @@
|
|
|
|
|
|
<style scoped lang="scss">
|
|
|
.main {}
|
|
|
+
|
|
|
+ .fade-in {
|
|
|
+ transition: 0.3s all ease-out;
|
|
|
+ box-sizing: border-box;
|
|
|
+ }
|
|
|
</style>
|