| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162 |
- <template>
- <view class="content">
- <view class="order-body">
- <view class="empty-body" v-if="loginState">
- <view class="img">
- <image src="/static/image/empty.png" mode="widthFix"></image>
- <view class="tip">请先登录</view>
- </view>
- <view class="re-btn" @click="reback">去登陆</view>
- </view>
- <block class="" v-else>
- <view class="page">
- <view class="list-item" v-for="(item,index) in dataList" :key="index" @click="$dialog.jumpUri('/pages/service/msg?poi='+item.poi_id+'&source=list',1)">
- <view class="avatar">
- <text class="round" v-if="item.last.num > 0"></text>
- <image :src="item.avatar" mode="widthFix"></image>
- </view>
- <view class="content">
- <view class="title">
- <text class="name">{{ item.poi_name }}</text>
- <text class="time">{{ item.last.create_at }}</text>
- </view>
- <view class="txt">
- <view class="desc" v-if="item.last.type=='text'">{{item.last.content}}</view>
- <view class="desc" v-if="item.last.type=='order'">[订单消息]</view>
- <view class="desc" v-if="item.last.type=='image'">[图片消息]</view>
- <view class="desc" v-if="item.last.type=='video'">[视频消息]</view>
- <view class="desc" v-if="item.last.type=='pay'">[支付消息]</view>
- <view class="desc" v-if="item.last.type=='address'">[地址消息]</view>
- </view>
- </view>
- </view>
- </view>
- </block>
-
- </view>
- </view>
- </template>
- <script>
- var app;
- import * as Api from "@/static/api/service.js";
- export default {
- data() {
- return {
- listState:false,
- dataList:[],
- loginState:true
- }
- },
- onShow() {
- var token = uni.getStorageSync("user_token")
- if (token) {
- this.loginState = false;
- }
- this.queryList(1,10)
- },
- onLoad() {
- app = this;
- },
- methods: {
- reback(){
- uni.navigateTo({
- url:"/pages/auth/login"
- })
- },
- queryList(pageNo, pageSize){
- var formData = {};
- var token = uni.getStorageSync("user_token")
- if (!token) {
- return false;
- }
- const tokenPoi = uni.getStorageSync("contact");
- console.log("tokenPoi",tokenPoi)
- formData.page = pageNo;
- formData.size = pageSize;
- formData.poi = tokenPoi.poi_id;
- app.listState = true;
- Api.list(formData).then((res)=>{
- app.listState = false;
- uni.hideLoading();
- if (res.code !== 1) {
- return app.$dialog.showSuccess(res.msg);
- }
- app.dataList = app.dataList.concat(res.data.rows);
- })
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- .empty-body{display: flex;align-items: center;justify-content: center;flex-direction: column;height: 100vh;}
- .empty-body .img{text-align: center;font-size: 28upx;color: #666;}
- .empty-body .img image{height: 160upx;width: 160upx;}
- .empty-body .img .tip{margin-top: 20upx;}
- .empty-body .re-btn{width: 180upx;height: 80upx;line-height: 80upx;text-align: center;font-size: 28upx;color: #fff;background-color: #007aff;border-radius: 10upx;margin-top: 60upx;}
- .page {
- padding: 0 32rpx;
- color: #333;
- }
- .list-item {
- display: flex;
- padding: 30rpx 0;
- border-bottom: 2upx solid #ccced3;
- .avatar {
- width: 90rpx;
- height: 90rpx;
- border-radius: 10rpx;
- margin-right: 20rpx;
- position: relative;
- .round {
- position: absolute;
- width: 14rpx;
- height: 14rpx;
- border-radius: 50%;
- background: #ef5656;
- top: -4rpx;
- right: -4rpx;
- z-index: 1;
- }
- image {
- width: 100%;
- height: 100%;
- border-radius: 10rpx;
- }
- }
- .content {
- flex: 1;
- .title {
- display: flex;
- justify-content: space-between;
- .name {
- font-weight: bold;
- }
- .time {
- color: #999;
- font-size: 24rpx;
- }
- }
- .txt {
- margin-top: 10rpx;
- overflow: hidden;
- text-overflow: ellipsis;
- display: -webkit-box;
- -webkit-line-clamp: 1;
- -webkit-box-orient: vertical;
- text-align: left;
- color: #999;
- font-size: 26rpx;
- }
- }
- }
- </style>
|