123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129 |
- <template>
- <view>
- <view class="total-num">
- 跟进记录<text>{{total}}</text>
- </view>
- <view class="com-ul">
- <view class="com-li" v-for="(item, index) in logs_list" :key="index">
- <view class="top clearfix">
- <view class="float_left staffName">{{ item.staffName }}</view>
- <view class="time float_right">{{ $u.timeFormat(item.time, 'yyyy-mm-dd hh:MM:ss') }}</view>
- </view>
- <view class="cont">{{ item.content }}</view>
- <view class="picture" v-if="item.picture">
- <image :src="item.picture" mode="aspectFill"></image>
- </view>
- <view class="address">{{ item.location }}</view>
- </view>
- </view>
- <u-loadmore :status="load_status" @loadmore="scrolltolower" :load-text="loadText" />
- </view>
- </template>
- <script>
- export default {
- props: {
- customerId: {
- type: [Number, String],
- default: ''
- }
- },
- data() {
- return {
- loadText: {
- loadmore: '点击加载更多',
- loading: '努力加载中',
- nomore: '没有更多了'
- },
- load_status: 'nomore',
- logs_list: [],
- page: 1,
- pageSize: 10,
- total: 0
- };
- },
- created() {
- this.getAllCustomerCommunication();
- },
- methods: {
- scrolltolower() {
- if (this.total / this.pageSize > this.page) {
- this.page += 1;
- this.getAllCustomerCommunication();
- }
- },
- getAllCustomerCommunication() {
- this.load_status = 'loading';
- this.$u.api
- .getAllCustomerCommunication({
- page: this.page,
- pageSize: this.pageSize,
- customerId: this.customerId,
- staffId: '',
- star: '',
- end: ''
- })
- .then(res => {
- if (this.page === 1) {
- this.logs_list = res.data;
- } else {
- this.logs_list = this.logs_list.concat(res.data);
- }
- this.load_status = this.$utils.loadStatus(this.page, this.pageSize, res.pageTotal);
- this.total = res.pageTotal;
- });
- }
- }
- };
- </script>
- <style lang="scss" scoped>
- .log-scroll {
- height: 100vh;
- }
- .total-num{
- font-size: 24rpx;
- padding: 0 40rpx;
- line-height: 80rpx;
- text{
- color: #4076D6;
- margin-left: 8rpx;
- }
- }
- .com-ul {
- padding: 0 40rpx;
- .com-li {
- margin-bottom: 30rpx;
- padding-bottom: 30rpx;
- border-bottom: 1px dashed #B8C0C8;
- .top {
- .staffName{
- font-weight: 600;
- }
- .time{
- color: #CAD0D7;
- font-weight: 300;
- font-size: 24rpx;
- }
- }
- .cont {
- padding: 20rpx 0;
- line-height: 42rpx;
- }
- .picture{
- image{
- width: 300rpx;
- border-radius: 6rpx;
- height: 100rpx;
- display: block;
- }
- }
- .address{
- margin-top: 16rpx;
- color: #CAD0D7;
- font-weight: 400;
- font-size: 24rpx;
- }
- }
- }
- </style>
|