| xqd
@@ -1,25 +1,32 @@
|
|
|
<template class="bc#f6f6f6">
|
|
|
<view style="width: 100%;height: 100%;">
|
|
|
- <u-gap height="30"></u-gap>
|
|
|
- <view v-for="(item,index) in list" :key='index' @click="detail(item)" style="height: 200rpx;padding: 0 30rpx;background-color: #FFFFFF;">
|
|
|
- <view class="flex" style="height: 199rpx;">
|
|
|
- <!-- 头像 -->
|
|
|
- <view style="width: 20%;" class="flex align-center">
|
|
|
- <image :src="item.img" style="width: 100rpx;height: 100rpx;border-radius: 50%;"></image>
|
|
|
+ <view class="title">
|
|
|
+ <!-- 头像 -->
|
|
|
+ <image :src="img" style="width: 100rpx;height: 100rpx;border-radius: 50%;"></image>
|
|
|
+ <!-- 名字 -->
|
|
|
+ <view style="font-size: 34rpx;font-weight: bold;margin-left: 30rpx;">{{name}}</view>
|
|
|
+ <view class="cu-tag round bg-orange sm" v-if="remark!=null">{{remark}}</view>
|
|
|
+ </view>
|
|
|
+ <view style="height: 100rpx;background-color: #FFF;padding: 0 40rpx;font-size: 34rpx;font-weight: bold;" class="flex align-center">
|
|
|
+ 通话记录 </view>
|
|
|
+ <view v-for="(item,index) in list" :key="index" style="padding: 30rpx 30rpx;background-color: #FFF;border-top: 1rpx solid #d0d0d0;" class="flex justify-between align-end">
|
|
|
+ <view>
|
|
|
+ <view style="margin-bottom: 10rpx;">
|
|
|
+ <text style="font-size: 28rpx;margin-right: 10rpx;">订单号:</text>
|
|
|
+ <text style="font-size: 24rpx;">{{item.order}}</text>
|
|
|
</view>
|
|
|
- <!-- 名字 时间 时长 -->
|
|
|
- <view style="width: 45%;display: grid;align-content: center;">
|
|
|
- <!-- 名字 -->
|
|
|
- <view style="font-size: 34rpx;font-weight: bold;margin-bottom: 10rpx;">{{item.name}}</view>
|
|
|
- <!-- 时间 -->
|
|
|
- <view style="color: #a0a0a0;">最近通话时间: {{item.date}}</view>
|
|
|
-
|
|
|
+ <view >
|
|
|
+ <text style="font-size: 28rpx;margin-right: 10rpx">拨入时间:</text>
|
|
|
+ <text style="font-size: 24rpx;">{{item.time}}</text>
|
|
|
</view>
|
|
|
-
|
|
|
</view>
|
|
|
- <u-line color="#f3f3f3" />
|
|
|
+ <view style="height: 100%;">
|
|
|
+ <text style="font-size: 28rpx;margin-right: 10rpx">通话时长:</text>
|
|
|
+ <text style="font-size: 24rpx;">{{item.duration}}</text>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
</view>
|
|
|
+ </view>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
| xqd
@@ -27,44 +34,101 @@
|
|
|
components: {
|
|
|
|
|
|
},
|
|
|
- onLoad() {
|
|
|
- this.getLists();
|
|
|
+ // onLoad() {
|
|
|
+ // console.log(callObject)
|
|
|
+ // this.img = callObject.img
|
|
|
+ // this.name = callObject.name
|
|
|
+ // this.getLists();
|
|
|
+ // },
|
|
|
+ onLoad: function(options) {
|
|
|
+ let object = JSON.parse(options.callObject); //注意,此赋值方法不是微信官方赋值方法,页面奖无法获取数据
|
|
|
+ console.log(object);
|
|
|
+ this.img = object.img
|
|
|
+ this.name = object.name
|
|
|
+ this.id = object.id
|
|
|
+ this.remark = object.remark
|
|
|
+ this.getLists()
|
|
|
},
|
|
|
mounted() {
|
|
|
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
+ id: 0,
|
|
|
+ img: '',
|
|
|
+ name: '',
|
|
|
+ object: '',
|
|
|
list: []
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
- getLists:async function(){
|
|
|
- let res = await this.$request.post("Doctor/user_call");
|
|
|
- if(res.status==0){
|
|
|
- if(res.data.length!=0){
|
|
|
- let data = res.data;
|
|
|
- for(let i=0;i<data.length;i++){
|
|
|
+ getLists: async function() {
|
|
|
+ console.log(this.id)
|
|
|
+ let res = await this.$request.post("Doctor/user_call", {
|
|
|
+ user_id: this.id
|
|
|
+ });
|
|
|
+ if (res.status == 0) {
|
|
|
+ if (res.data.length != 0) {
|
|
|
+ for (let k = 0; k < res.data.length; k++) {
|
|
|
this.list.push({
|
|
|
- img: data[i].user.avatar, //头像
|
|
|
- name: data[i].user.nickname, //名字
|
|
|
- date: data[i].user.dates, //日期
|
|
|
- id: data[i].user.id, //日期
|
|
|
+ time: res.data[k].time,
|
|
|
+ duration: this.getDuration(6524),
|
|
|
+ order: res.data[k].order_sn
|
|
|
})
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- console.log(res);
|
|
|
- },
|
|
|
- detail(e){
|
|
|
- let id = e.id;
|
|
|
- // uni.navigateTo({
|
|
|
- // url: "../conversation/calldetail?id=" + id;
|
|
|
- // })
|
|
|
+ console.log("res", res);
|
|
|
},
|
|
|
+ getDuration(second) {
|
|
|
+ // var hours = Math.floor((second % 86400) / 3600);
|
|
|
+ // var minutes = Math.floor(((second % 86400) % 3600) / 60);
|
|
|
+ // var seconds = Math.floor(((second % 86400) % 3600) % 60);
|
|
|
+ // var duration = hours + ":" + minutes + ":" + seconds;
|
|
|
+ // return duration;
|
|
|
+ var theTime = parseInt(second);// 需要转换的时间秒
|
|
|
+ var theTime1 = 0;// 分
|
|
|
+ var theTime2 = 0;// 小时
|
|
|
+ var theTime3 = 0;// 天
|
|
|
+ if(theTime > 60) {
|
|
|
+ theTime1 = parseInt(theTime/60);
|
|
|
+ theTime = parseInt(theTime%60);
|
|
|
+ if(theTime1 > 60) {
|
|
|
+ theTime2 = parseInt(theTime1/60);
|
|
|
+ theTime1 = parseInt(theTime1%60);
|
|
|
+ if(theTime2 > 24){
|
|
|
+ //大于24小时
|
|
|
+ theTime3 = parseInt(theTime2/24);
|
|
|
+ theTime2 = parseInt(theTime2%24);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ var result = '';
|
|
|
+ if(theTime > 0){
|
|
|
+ result = ""+parseInt(theTime)+"秒";
|
|
|
+ }
|
|
|
+ if(theTime1 > 0) {
|
|
|
+ result = ""+parseInt(theTime1)+"分"+result;
|
|
|
+ }
|
|
|
+ if(theTime2 > 0) {
|
|
|
+ result = ""+parseInt(theTime2)+"小时"+result;
|
|
|
+ }
|
|
|
+ if(theTime3 > 0) {
|
|
|
+ result = ""+parseInt(theTime3)+"天"+result;
|
|
|
+ }
|
|
|
+ return result;
|
|
|
+ }
|
|
|
}
|
|
|
};
|
|
|
</script>
|
|
|
|
|
|
<style>
|
|
|
+ .title {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ border-radius: 30rpx;
|
|
|
+ margin: 30rpx 50rpx;
|
|
|
+ padding: 20rpx;
|
|
|
+ box-shadow: 0 0 50rpx 0 rgba(0, 0, 0, 0.1);
|
|
|
+ }
|
|
|
</style>
|