<template>
|
<view class="container" style="overflow: auto; position: relative;">
|
<image @tap="getData()" style="position: absolute;bottom: 50rpx;width: 2rem;height: 2rem;right: 1rem;" src="https://yanfeiobpub.obs.cn-east-3.myhuaweicloud.com/sms_pro/shuaxin.png"></image>
|
<view v-if="mobileList.length>0" class="orders-list d-flex flex-column w-100"
|
style="padding: 20rpx; padding-bottom: 100rpx;">
|
<view class="order-item" v-for="(item, index) in mobileList" :key="index" style="margin-bottom: 30rpx;"
|
@tap="showchart(item)">
|
<list-cell :hover="false" last>
|
<view class="w-100 d-flex flex-column">
|
<view class="moblist">
|
<view class="avatar">
|
<image
|
src='https://yanfeiobpub.obs.cn-east-3.myhuaweicloud.com/sms_pro/user_header.png'>
|
</image>
|
</view>
|
<view>
|
@{{item.mobile}}
|
</view>
|
<view class="backtxt">
|
共{{item.smsCount}}条
|
</view>
|
<view v-if="item.unReadCount&&item.unReadCount>0" style="color: #FAB714;" class="backtxt">
|
您有{{item.unReadCount}}条回复
|
</view>
|
<view class="mobtip">
|
>
|
</view>
|
</view>
|
|
</view>
|
</list-cell>
|
</view>
|
|
</view>
|
<view v-else>
|
<gray-empty img="empty" text="无数据" />
|
</view>
|
<modal v-if="chartVisible" :show="chartVisible" class="good-detail-modal" color="#5A5B5C" width="90%" custom
|
padding="0rpx" radius="12rpx">
|
<view class="cover" style="height: 0px; padding: 0; z-index: 1000;">
|
<view class="btn-group" style="top:0rpx">
|
<image src="/static/images/menu/close.png" @tap="closeChartVisible"></image>
|
</view>
|
</view>
|
<scroll-view class="detail" scroll-y>
|
<view class="backlist">
|
<view v-for="(backitem,bindex) in backInfo" class="backcell"
|
:class="backitem.memo=='1'?'chart-send':'chart-back'">
|
<view class="avatar" style="margin: 0;">
|
<image src='https://yanfeiobpub.obs.cn-east-3.myhuaweicloud.com/sms_pro/user_header.png'>
|
</image>
|
</view>
|
<view>
|
<view style="text-align: left; position: relative;">
|
<view class="chart-txt" :class="backitem.memo=='1'?'txt-send':'txt-back'">
|
{{backitem.smscontent}}
|
</view>
|
|
</view>
|
<view class="sendstatus status-send" v-if="backitem.memo=='1'">
|
<span style="margin-right: 5px;">{{backitem.sendtime}}</span><span>{{getSmsStatus(backitem.sendstatus)}}</span>
|
</view>
|
<view class="sendstatus status-back" v-else>
|
<span>{{getSmsStatus(backitem.sendstatus)}}</span><span style="margin-left:5px">{{backitem.sendtime}}</span>
|
</view>
|
</view>
|
|
</view>
|
</view>
|
</scroll-view>
|
<view class="add-to-cart-btn" @tap="handleAddToCartInModal()">
|
<view>回复</view>
|
</view>
|
</modal>
|
</view>
|
|
</template>
|
|
<script>
|
import listCell from '@/components/list-cell/list-cell'
|
import modal from '@/components/modal/modal'
|
import comUtils from '@/utils/ComUtils.js'
|
export default {
|
components: {
|
listCell,
|
modal
|
},
|
data() {
|
return {
|
page: 1,
|
pageSize: 5,
|
chartVisible: false,
|
mobileList: [],
|
backInfo: [],
|
backMobile: ''
|
}
|
},
|
computed: {
|
|
},
|
|
async onLoad() {
|
this.getData();
|
},
|
async onReachBottom() {
|
|
},
|
async onPullDownRefresh() {
|
|
},
|
methods: {
|
|
showchart(item) {
|
//获取对话
|
this.backMobile = item.mobile;
|
let memberinfo = uni.getStorageSync('smsmemberinfo');
|
//修改未读状态
|
if (item.unReadCount > 0) {
|
this.$http.post('/smsapi/SmsBusiness/UpdateUnreadSmsHistory', {
|
Memberid: memberinfo.id,
|
Mobile: item.mobile
|
}).then(e => {
|
this.getData();
|
}).catch(function(err) {
|
console.log(err);
|
})
|
}
|
uni.showLoading({
|
title: '加载中'
|
})
|
this.$http.post('/smsapi/SmsBusiness/GetSingleMobile', {
|
Memberid: memberinfo.id,
|
Mobile: item.mobile
|
}).then(e => {
|
this.backInfo = e.result;
|
this.chartVisible = true;
|
uni.hideLoading()
|
}).catch(function(err) {
|
uni.hideLoading()
|
console.log(err);
|
})
|
},
|
getSmsStatus(status) {
|
switch (status) {
|
case 0:
|
return '发送成功';
|
case 1:
|
return '发送失败';
|
default:
|
return '未知';
|
}
|
},
|
closeChartVisible() {
|
this.chartVisible = false;
|
},
|
async getData() {
|
|
let memberinfo = uni.getStorageSync('smsmemberinfo');
|
if (memberinfo == null) {
|
return;
|
}
|
uni.showLoading({
|
title: '加载中'
|
})
|
this.$http.post('/smsapi/SmsBusiness/GetSmsHistory', {
|
Memberid: memberinfo.id
|
}).then(e => {
|
this.mobileList = e.result;
|
uni.hideLoading();
|
}).catch(function(err) {
|
uni.hideLoading()
|
|
console.log(err);
|
})
|
},
|
handleAddToCartInModal() {
|
uni.navigateTo({
|
url: '/pages/sendsms/index?mobile=' + this.backMobile
|
})
|
}
|
}
|
}
|
</script>
|
|
<style lang="scss" scoped>
|
@import '~@/pages/menu/menu.scss';
|
|
.backcell {
|
display: flex;
|
flex-direction: row;
|
text-align: center;
|
margin-bottom: 40rpx;
|
}
|
|
.chart-txt {
|
text-align: left;
|
border-radius: 4%;
|
padding: 20rpx;
|
}
|
|
.sendstatus {
|
position: absolute;
|
font-size: 12px;
|
color: #919293;
|
font-weight: 400;
|
}
|
|
.status-send {
|
right: 4.5rem;
|
}
|
|
.status-back {
|
left: 4.5rem;
|
}
|
|
.txt-back {
|
background: #E8EACF;
|
color: #737c1a;
|
margin-left: 20rpx;
|
}
|
|
.txt-send {
|
background: #B1CEE8;
|
color: #08477f;
|
margin-right: 20rpx;
|
}
|
|
.chart-send {
|
text-align: right;
|
align-items: center;
|
justify-content: right;
|
flex-direction: row-reverse;
|
}
|
|
.chart-back {
|
align-items: center;
|
}
|
|
.backlist {
|
min-height: 800rpx;
|
padding: 70rpx 10rpx 50rpx 10rpx;
|
}
|
|
.moblist {
|
display: flex;
|
flex-direction: row;
|
align-items: center;
|
font-weight: 600;
|
position: relative;
|
}
|
|
.mobtip {
|
position: absolute;
|
right: 0px;
|
color: #919293;
|
}
|
|
.backtxt {
|
margin-left: 10px;
|
font-size: 12px;
|
font-weight: 400;
|
color: #919293;
|
}
|
|
.avatar {
|
width: 100rpx;
|
height: 100rpx;
|
margin-right: 20rpx;
|
border-radius: 100%;
|
align-items: center;
|
justify-content: center;
|
background-color: #FFFFFF;
|
box-shadow: 0 0 20rpx rgba($color: #000000, $alpha: 0.2);
|
|
image {
|
width: 100rpx;
|
height: 100rpx;
|
border-radius: 100%;
|
}
|
}
|
</style>
|