123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266 |
- <template>
- <view class="selSupplier">
- <!-- <view class="search-view">
- <u-search @custom="search()" @search="search()" @clear="search()" action-text="搜索" :clearabled="true" placeholder="客户名称/手机号" v-model="keyword"></u-search>
- </view> -->
- <view class="customer-ul" >
- <view class="gk-wrap" v-for="(item, index) in customer_list" :key="index">
- <view class="gk-top">
- <view class="top-left">
- <view class="left-name">
- <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="left-tip">
- {{item.customerType}}
- </view>
- </view>
- <view class="top-right" @click="goBf(item)">
- 拜访记录<image src="../../static/img/downright.png" mode=""></image>
- </view>
- </view>
- <view class="call-wrap" @click="goCall(item.mobile)" v-if="item.mobile">
- 联系客户
- </view>
- <view class="user-info">
- <view class="phone">
- {{item.mobile}}
- </view>
- <view class="brithday">
- 生日:{{item.birthday?getBirthday(item.birthday): '--'}}
- </view>
- <view class="where">
- 地区:{{ item.area.provinceName }}-{{ item.area.cityName }}-{{ item.area.districtName }}-{{ item.area.address }}
- </view>
- </view>
- </view>
- <!-- <view class="customer-li" v-for="(item, index) in customer_list" :key="index" @click="changeSupplier(item)">
- <view class="customer-name">{{ item.name }}</view>
- <view class="other">
- <view class="concat clearfix">
- <text class="float_left">{{ item.customerType }}</text>
- <view class="float_right" v-if="item.mobile">
- <u-icon name="phone-fill" size="26"></u-icon>
- <text class="phone-text">{{ item.mobile }}</text>
- </view>
- </view>
- <view class="address">{{ item.area.provinceName }}-{{ item.area.cityName }}-{{ item.area.districtName }}-{{ item.area.address }}</view>
- </view>
- </view> -->
- </view>
- <u-loadmore :status="load_status" />
- </view>
- </template>
- <script>
- export default {
- data() {
- return {
- keyword: '',
- load_status: 'nomore',
- page: 1,
- pageSize: 10,
- total: 0,
- customer_list: []
- };
- },
- onLoad() {
- this.getAllCustomer();
- },
- onPullDownRefresh() {
- this.getAllCustomer();
- },
- // 上拉加载
- onReachBottom() {
- if (this.total / this.pageSize > this.page) {
- this.page += 1;
- this.getAllCustomer();
- }
- },
- methods: {
- goBf(item) {
- uni.navigateTo({
- url:'/pagesT/customer/CommunicationLogs?id=' + item.id + '&name=' + item.name
- })
- },
- changeSupplier(item) {
- // 选择供应商返回上一页
- this._prePage().customerData = item;
- uni.navigateBack();
- },
- search() {
- this.page = 1;
- this.getAllCustomer();
- },
- getAllCustomer() {
- this.loading_status = 'loading';
- this.$u.api
- .getAllCustomer({
- page: this.page,
- pageSize: this.pageSize,
- enableStatus: 5,
- keyword: this.keyword,
- status: 2
- })
- .then(res => {
- uni.stopPullDownRefresh();
- if (this.page === 1) {
- this.customer_list = res.data;
- } else {
- this.customer_list = this.customer_list.concat(res.data);
- }
- this.total = res.pageTotal;
- this.load_status = this.$utils.loadStatus(this.page, this.pageSize, this.total);
- })
- .catch(err => {
- uni.stopPullDownRefresh();
- });
- },
- goCall(phone) {
- uni.makePhoneCall({
- phoneNumber: phone
- })
- },
- getBirthday(time) {
- let date = new Date(time*1000)
- return date.getFullYear() + '-' + (date.getMonth() + 1) + '-' + date.getDate()
- }
- }
- };
- </script>
- <style lang="scss" scoped>
- .search-view {
- position: fixed;
- z-index: 99;
- top: 0;
- left: 0;
- width: 100%;
- background-color: #ffffff;
- border-bottom: 1px solid #f5f5f5;
- padding: 20rpx;
- .input-view {
- padding: 0 24rpx;
- input {
- height: 60rpx;
- line-height: 60rpx;
- padding: 0 24rpx;
- display: inline-block;
- width: 580rpx;
- border: 1px solid #f5f5f5;
- vertical-align: middle;
- border-radius: 8rpx;
- background-color: #f7f8fa;
- }
- .add-icon {
- margin-left: 14rpx;
- display: inline-block;
- vertical-align: middle;
- }
- }
- }
- .customer-ul {
- // padding-top: 90rpx;
- padding-top: 20rpx;
- padding-bottom: 20rpx;
- .customer-li {
- width: 702rpx;
- margin: 0 auto;
- background-color: #ffffff;
- border-radius: 10rpx;
- margin-top: 20rpx;
- .customer-name {
- padding: 0 20rpx;
- line-height: 80rpx;
- border-bottom: 1px solid #f5f5f5;
- }
- .other {
- font-size: 24rpx;
- padding: 10rpx 20rpx;
- line-height: 50rpx;
- .concat {
- .float_right {
- color: $uni-color-primary;
- .phone-text {
- margin-left: 10rpx;
- }
- }
- }
- }
- }
- }
- .gk-wrap {
- width: 710rpx;
- height: 224rpx;
- border-radius: 20rpx;
- background-color: #fff;
- margin:0 auto 20rpx;
- position: relative;
- .call-wrap {
- position: absolute;
- right: 20rpx;
- bottom: 20rpx;
- width: 126rpx;
- height: 48rpx;
- background: #4D74CF;
- border-radius: 10rpx;
- color: #fff;
- text-align: center;
- line-height: 48rpx;
- font-size: 24rpx;
- font-weight: 400;
- }
- .user-info {
- padding-left: 20rpx;
- font-size: 24rpx;
- font-weight: 500;
- color: #939393;
- .phone {
- color: #0F2447;
- }
- .brithday {
- margin: 15rpx 0;
- }
-
- }
- .gk-top {
- height: 80rpx;
- width: 100%;
- display: flex;
- justify-content: space-between;
- align-items: center;
- .top-left {
- display: flex;
-
- .left-name {
- padding: 0 20rpx;
- height: 40rpx;
- border-radius: 0 20rpx 20rpx 0;
- background-color: #ecf5ff;
- margin-right: 20rpx;
- max-width: 400rpx;
- }
- .left-tip {
- border: 1px solid #4D74CF;
- color: #4D74CF;
- height: 32rpx;
- padding: 0 10rpx;
- line-height: 32rpx;
- border-radius: 5rpx;
- font-size: 20rpx;
- }
- }
- .top-right {
- display: flex;
- align-items: center;
- padding-right: 20rpx;
- font-size: 22rpx;
- font-weight: 500;
- color: #999999;
- image {
- width: 9rpx;
- height: 17rpx;
- }
- }
- }
- }
- </style>
|