123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167 |
- <template>
- <view>
- <view class="com-ul">
- <view class="com-li" v-for="(item, index) in visite_list" :key="index">
- <view class="cutomer-name clearfix">
- <view class="float_left ellipsis">
- <u-icon margin-left="10" name="account-fill" label-size="24" label-color="#2979ff" :label="item.name" color="#2979ff" size="28"></u-icon>
- </view>
- <view class="float_right staff-name">
- {{ staff_name}}
- <!-- <u-icon name="dianhua" color="#2d73ed" custom-prefix="custom-icon" /> -->
- </view>
- </view>
- <view class="cont">
- <view class="content">{{ item.content }}</view>
- <view v-if="item.picture" class="image-view"><image @click="previewImage(item.picture)" :src="item.picture" mode="aspectFill"></image></view>
- <view class="address clearfix">
- <view class="float_left">
- <block v-if="item.location">
- <u-icon name="map-fill" color="#6c6c6c" size="26"></u-icon>
- {{ item.location }}
- </block>
- <text v-else style="color: #999999;">无定位信息</text>
- </view>
- </view>
- <view class="time clearfix">
- <view class="float_left">{{ $u.timeFormat(item.createTime, 'yyyy-mm-dd hh:MM:ss') }}</view>
- <view v-if="item.managerMobile" class="float_right" @click="callPhone(item.managerMobile)">
- <!-- <u-icon @click="goPage(`/pagesT/customer/CommunicationLogsAdd?id=${item.id}`)"
- style="margin-right: 30rpx;" name="edit-pen-fill" color="#2d73ed" /> -->
- 客户电话:{{ item.managerMobile }}
- </view>
- </view>
- </view>
- </view>
- </view>
- <u-loadmore :status="load_status" />
- </view>
- </template>
- <script>
- export default {
- data() {
- return {
- id: '',
- staff_name:'',
- visite_list: {},
- load_status: 'nomore',
- page: 1,
- pageSize: 10,
- total: 0
- };
- },
- onLoad(options) {
- this.id = options.id;
- this.staff_name = options.name;
- this.getCustomerVisitInfo();
- },
- onReachBottom() {
- if (this.total / this.pageSize > this.page) {
- this.page += 1;
- this.getCustomerVisitInfo();
- }
- },
- onPullDownRefresh() {
- this.page = 1;
- this.getCustomerVisitInfo();
- },
- methods: {
- previewImage(image) {
- // 预览图片
- uni.previewImage({
- urls: [image],
- longPressActions: {
- itemList: ['发送给朋友', '保存图片', '收藏'],
- success: function(data) {
- console.log('选中了第' + (data.tapIndex + 1) + '个按钮,第' + (data.index + 1) + '张图片');
- },
- fail: function(err) {
- console.log(err.errMsg);
- }
- }
- });
- },
- getCustomerVisitInfo() {
- this.load_status = 'loading';
- this.$u.api
- .getCustomerVisitInfo({
- staffId: this.id,
- page: this.page,
- pageSize: this.pageSize
- })
- .then(res => {
- uni.stopPullDownRefresh();
- if (this.page === 1) {
- this.visite_list = res.data;
- } else {
- this.visite_list = this.visite_list.concat(res.data);
- }
- this.total = res.pageTotal;
- this.load_status = this.$utils.loadStatus(this.page, this.pageSize, this.total);
- });
- },
- }
- };
- </script>
- <style lang="scss" scoped>
- .com-ul {
- .com-li {
- width: 710rpx;
- margin: 20rpx auto;
- background-color: #ffffff;
- padding: 20rpx 0;
- border-radius: 20rpx;
- .cutomer-name {
- padding-bottom: 10rpx;
- color: $uni-color-primary;
- font-size: 24rpx;
- .float_left {
- max-width: 540rpx;
- background-color: #ecf5ff;
- border-top-right-radius: 20rpx;
- border-bottom-right-radius: 20rpx;
- padding: 0 20rpx;
- line-height: 40rpx;
- }
- .staff-name {
- padding-right: 20rpx;
- line-height: 40rpx;
- }
- }
- .cont {
- padding: 0 20rpx;
- line-height: 36rpx;
- .content {
- padding-bottom: 10rpx;
- }
- .image-view {
- padding-bottom: 10rpx;
- image {
- width: 120rpx;
- height: 120rpx;
- border-radius: 10rpx;
- }
- }
- .address {
- padding-bottom: 10rpx;
- font-size: 24rpx;
- }
- .time {
- font-size: 24rpx;
- color: #999999;
- }
- }
- }
- }
- </style>
|