123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177 |
- <template>
- <view style="padding: 0px 20px;margin-top: 5px;">
- <!-- 顶部对方已读和未读按钮 -->
- <uni-segmented-control :current="current" :values="items" @clickItem="onClickItem" styleType="button"
- activeColor="#6EB312"></uni-segmented-control>
- <!-- 发出的邀请列表 -->
- <view v-show="current === 0">
- <view v-for="(Info,index) in InviteInfoRead" :key="index">
- <view class="invitationWrapper" @click="invitationDetail(Info)">
- <view class="invitationTitle">
- <view>
- <text>邀请号</text>
- <text class="invitatinDetail">{{Info.id}}</text>
- </view>
- <view class="other">
- <!-- <text>对方</text> -->
- <text class="invitatinDetail">{{Info.fromUname}} {{Info.identity}}</text>
- </view>
- </view>
- <view class="invitationContent">
- <text>邀请内容</text>
- <text class="invitatinDetail">{{Info.requireDetail}}</text>
- </view>
- <view class="invitationDateAndStatus">
- <view>
- <text>邀请日期</text>
- <text class="invitatinDetailOther">{{Info.datetime}}</text>
- </view>
- <view class="other">
- <text>我方状态</text>
- <text class="invitatinStatus">{{Info.operateStatus}}</text>
- </view>
- </view>
- </view>
- </view>
- </view>
- <view v-show="current === 1">
- <view v-for="(Info,index) in InviteInfoUnRead" :key="index">
- <view class="invitationWrapper" @click="invitationDetail(Info)">
- <view class="invitationTitle">
- <view>
- <text>邀请号</text>
- <text class="invitatinDetail">{{Info.id}}</text>
- </view>
- <view class="other">
- <!-- <text>对方</text> -->
- <text class="invitatinDetail">{{Info.fromUname}} {{Info.identity}}</text>
- </view>
- </view>
- <view class="invitationContent">
- <text>邀请内容</text>
- <text class="invitatinDetail">{{Info.requireDetail}}</text>
- </view>
- <view class="invitationDateAndStatus">
- <text>邀请日期</text>
- <text class="invitatinDetailOther">{{Info.datetime}}</text>
- </view>
- </view>
- </view>
- </view>
- </view>
- </template>
- <script>
- export default {
- data() {
- return {
- current: 0,
- items: ['已读', '未读'],
- InviteInfoRead: [],
- InviteInfoUnRead: []
- };
- },
- created() {
- this.readYes()
- },
- methods: {
- async readYes() {
- const {
- data: result
- } = await uni.$http.get('/education/invite-info/getReceivedInvitationRead')
- this.InviteInfoRead = result.data.list
- },
- async readNo() {
- const {
- data: result
- } = await uni.$http.get('/education/invite-info/getReceivedInvitationUnread')
- this.InviteInfoUnRead = result.data.list
- },
- async invitationDetail(Info) {
- uni.navigateTo({
- url: '/subpkg/my/invitation/my_invitation_receive_detail?id='+encodeURIComponent(Info.id)
- })
- },
- onClickItem(e) {
- if (this.current != e.currentIndex) {
- this.current = e.currentIndex
- }
- if (this.current === 1) {
- this.readNo()
- }
- if (this.current === 0) {
- this.readYes()
- }
- }
- }
- }
- </script>
- <!-- 设置页面背景 -->
- <style lang="scss">
- page {
- height: 100%;
- }
- </style>
- <style lang="scss" scoped>
- /* 顶部对方已读和未读按钮 */
- .read {
- display: flex;
- justify-content: space-around;
- }
- .readDetail {
- padding: 10rpx 20rpx;
- border-radius: 30rpx;
- background-color: #FFF2CC;
- font-weight: bold;
- }
- /* 列表样式 */
- .invitationWrapper {
- width: 94%;
- padding: 20rpx;
- margin-top: 20rpx;
- border-radius: 20rpx;
- background-color: #FFF;
- font-size: 30rpx;
- }
- /* 邀请号和对方身份、邀请日期和对方状态 */
- .invitationTitle,
- .invitationDateAndStatus {
- display: flex;
- position: relative;
- }
- /* 对方身份 */
- .other {
- position: absolute;
- left: 60%;
- }
- /* 具体内容的样式 */
- .invitatinDetail,
- .invitatinStatus {
- margin-left: 20rpx;
- font-weight: bold;
- }
- .invitatinDetailOther {
- margin-left: 20rpx;
- font-weight: bold;
- font-size: 26rpx;
- }
- .invitatinStatus {
- color: red;
- }
- /* 邀请内容、邀请日期和对方状态 */
- .invitationContent {
- margin-top: 10rpx;
- }
- </style>
|