You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
88 lines
5.3 KiB
88 lines
5.3 KiB
<!--pages/home/customer/index.wxml-->
|
|
<cu-custom bgColor="bg-white" isBack="{{true}}">
|
|
<view slot="content">客户列表</view>
|
|
</cu-custom>
|
|
|
|
<van-search value="{{ form.name }}" disabled="{{!orderList.length}}" shape="round" placeholder="请输入姓名、电话号码、卡号" use-action-slot bind:change="onChange">
|
|
<!-- <van-button slot="action" plain type="info" size="small" bind:click="addCustomer">添加客户</van-button> -->
|
|
<view slot="action" bind:tap="onChange" style="padding: 0rpx 8rpx" wx:if="{{form.name}}">取消</view>
|
|
</van-search>
|
|
<scroll-view class="scrollList" scroll-y scroll-into-view="{{scrollViewId}}" style="height:{{height}}rpx">
|
|
<view class="list-empty" style="height:{{height}}rpx" wx:if="{{!orderList.length}}" bindtap="onRefreshList">
|
|
<view style="margin-bottom:24px" wx:if="{{loading}}">
|
|
<van-loading type="spinner" size="32" />
|
|
</view>
|
|
<image class="img-empty" src="/assets/image/list_empty.png" wx:else></image>
|
|
<view class="text-empty">{{loading? '正在加载' : '暂无数据,点击重新刷新'}}</view>
|
|
</view>
|
|
<!-- 查询结果 -->
|
|
<view wx:if="{{form.name}}">
|
|
<view class="list-empty" style="height:{{height}}rpx" wx:if="{{!searchList.length}}">
|
|
<view style="margin-bottom:24px" wx:if="{{loading}}">
|
|
<van-loading type="spinner" size="32" />
|
|
</view>
|
|
<image class="img-empty" src="/assets/image/list_empty.png" wx:else></image>
|
|
<view class="text-empty">{{loading? '正在搜索' : '暂无数据'}}</view>
|
|
</view>
|
|
<van-cell clickable wx:for="{{searchList}}" wx:key="index">
|
|
<view slot="title" class="flex flex-justify" data-index="{{index}}" bindtap="customerInfo">
|
|
<!-- <van-image round width="80rpx" height="80rpx" src="{{ item.avatarUrl || '/assets/image/ygImg.png' }}" /> -->
|
|
<view style="width:100%;flex:1">
|
|
<view class="text-sg text-bold">{{item.name || ''}}</view>
|
|
<view class="text-sm text-gray" style="line-height:32rpx;height:32rpx">
|
|
<text wx:if="{{item.mobile}}" style="padding-right: 24rpx;">{{'电话号码:' + item.mobile}}</text>
|
|
<text wx:if="{{item.cardNo}}">{{'卡号:' + item.cardNo}}</text>
|
|
</view>
|
|
</view>
|
|
<view class="text-blue" style="padding:6rpx 0rpx" data-index="{{index}}" catchtap="bindCustomer" wx:if="{{!item.userId}}">注册纸通宝</view>
|
|
</view>
|
|
</van-cell>
|
|
</view>
|
|
<view wx:else>
|
|
<!-- 列表 -->
|
|
<block wx:for-item="pageItem" wx:for-index="pageIndex" wx:for="{{orderList}}" wx:key="pageIndex" wx:if="{{pageItem.data[0]}}">
|
|
<view style="background-color:#f3f3f3;" id="{{pageItem.sign == '#' ? 'E_' : pageItem.sign}}">
|
|
<text class="text-sg" style="line-height:50rpx;padding-left:32rpx">{{pageItem.sign}}</text>
|
|
</view>
|
|
<van-cell clickable wx:for="{{pageItem.data}}" wx:key="index">
|
|
<view slot="title" class="flex flex-justify" data-page="{{pageIndex}}" data-index="{{index}}" bindtap="customerInfo">
|
|
<!-- <van-image round width="80rpx" height="80rpx" src="{{ item.avatarUrl || '/assets/image/ygImg.png' }}" /> -->
|
|
<view style="width:100%;flex:1">
|
|
<view class="text-sg text-bold">{{item.name || ''}}</view>
|
|
<view class="text-sm text-gray" style="line-height:32rpx;height:32rpx">
|
|
<text wx:if="{{item.mobile}}" style="padding-right: 24rpx;">{{'电话号码:' + item.mobile}}</text>
|
|
<text wx:if="{{item.cardNo}}">{{'卡号:' + item.cardNo}}</text>
|
|
</view>
|
|
</view>
|
|
<view class="text-blue" style="padding:6rpx 24rpx;" data-page="{{pageIndex}}" data-index="{{index}}"
|
|
catchtap="bindCustomer" wx:if="{{!item.userId}}">注册纸通宝</view>
|
|
</view>
|
|
</van-cell>
|
|
</block>
|
|
<van-divider content-position="center" custom-style="padding:0rpx 120rpx">
|
|
<text class="text-df">共计{{total}}个客户</text>
|
|
</van-divider>
|
|
</view>
|
|
</scroll-view>
|
|
|
|
<view style="border-radius: 50rpx;position: fixed;bottom:160rpx;right:50rpx">
|
|
<van-button round type="info" icon="plus" bind:click="addCustomer" custom-style="width: 100rpx;height: 100rpx;"></van-button>
|
|
</view>
|
|
<notification id="qn-notification"/>
|
|
|
|
<!-- 右侧定位 -->
|
|
<view wx:if="{{!form.name && orderList.length > 5 && total > 15}}" class="list-bar" style="height:{{indexHeight}}rpx;top:{{titleHeight}}rpx"
|
|
catchtouchstart="touchStart" catchtouchmove="touchMove" catchtouchend="touchEnd" catchtouchcancel="touchEnd">
|
|
<text wx:for="{{orderList}}" wx:key="index" class="list-text" style="height:{{itemHeight}}rpx;color:{{index == touchmoveIndex ? '#008AFF' : '#333333'}}">{{item.sign}}</text>
|
|
</view>
|
|
<view class="list-alert" wx:if="{{touchmove && orderList[touchmoveIndex].sign}}">{{orderList[touchmoveIndex].sign}}</view>
|
|
|
|
<!-- <van-popup show="{{ show }}" custom-style="background: transparent;" bind:close="onClickHide">
|
|
<view class="flex flex-center flex-column" catch:tap="noop">
|
|
<view class="bg-white" style="padding:32rpx">
|
|
<canvas style="width:600rpx; height:600rpx;" canvas-id="van-qrcode"></canvas>
|
|
</view>
|
|
<text class="text-xl text-white" style="margin-top:48rpx;text-align:center">裕隆纸业有限公司</text>
|
|
<van-icon name="close" color="white" size="48px" custom-style="margin-top:96rpx" catch:tap="onClickHide" />
|
|
</view>
|
|
</van-popup> -->
|