selCustomert.vue 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266
  1. <template>
  2. <view class="selSupplier">
  3. <!-- <view class="search-view">
  4. <u-search @custom="search()" @search="search()" @clear="search()" action-text="搜索" :clearabled="true" placeholder="客户名称/手机号" v-model="keyword"></u-search>
  5. </view> -->
  6. <view class="customer-ul" >
  7. <view class="gk-wrap" v-for="(item, index) in customer_list" :key="index">
  8. <view class="gk-top">
  9. <view class="top-left">
  10. <view class="left-name">
  11. <u-icon margin-left="10" name="account-fill" label-size="24" label-color="#2979ff" :label="item.name" color="#2979ff" size="28"></u-icon>
  12. </view>
  13. <view class="left-tip">
  14. {{item.customerType}}
  15. </view>
  16. </view>
  17. <view class="top-right" @click="goBf(item)">
  18. 拜访记录<image src="../../static/img/downright.png" mode=""></image>
  19. </view>
  20. </view>
  21. <view class="call-wrap" @click="goCall(item.mobile)" v-if="item.mobile">
  22. 联系客户
  23. </view>
  24. <view class="user-info">
  25. <view class="phone">
  26. {{item.mobile}}
  27. </view>
  28. <view class="brithday">
  29. 生日:{{item.birthday?getBirthday(item.birthday): '--'}}
  30. </view>
  31. <view class="where">
  32. 地区:{{ item.area.provinceName }}-{{ item.area.cityName }}-{{ item.area.districtName }}-{{ item.area.address }}
  33. </view>
  34. </view>
  35. </view>
  36. <!-- <view class="customer-li" v-for="(item, index) in customer_list" :key="index" @click="changeSupplier(item)">
  37. <view class="customer-name">{{ item.name }}</view>
  38. <view class="other">
  39. <view class="concat clearfix">
  40. <text class="float_left">{{ item.customerType }}</text>
  41. <view class="float_right" v-if="item.mobile">
  42. <u-icon name="phone-fill" size="26"></u-icon>
  43. <text class="phone-text">{{ item.mobile }}</text>
  44. </view>
  45. </view>
  46. <view class="address">{{ item.area.provinceName }}-{{ item.area.cityName }}-{{ item.area.districtName }}-{{ item.area.address }}</view>
  47. </view>
  48. </view> -->
  49. </view>
  50. <u-loadmore :status="load_status" />
  51. </view>
  52. </template>
  53. <script>
  54. export default {
  55. data() {
  56. return {
  57. keyword: '',
  58. load_status: 'nomore',
  59. page: 1,
  60. pageSize: 10,
  61. total: 0,
  62. customer_list: []
  63. };
  64. },
  65. onLoad() {
  66. this.getAllCustomer();
  67. },
  68. onPullDownRefresh() {
  69. this.getAllCustomer();
  70. },
  71. // 上拉加载
  72. onReachBottom() {
  73. if (this.total / this.pageSize > this.page) {
  74. this.page += 1;
  75. this.getAllCustomer();
  76. }
  77. },
  78. methods: {
  79. goBf(item) {
  80. uni.navigateTo({
  81. url:'/pagesT/customer/CommunicationLogs?id=' + item.id + '&name=' + item.name
  82. })
  83. },
  84. changeSupplier(item) {
  85. // 选择供应商返回上一页
  86. this._prePage().customerData = item;
  87. uni.navigateBack();
  88. },
  89. search() {
  90. this.page = 1;
  91. this.getAllCustomer();
  92. },
  93. getAllCustomer() {
  94. this.loading_status = 'loading';
  95. this.$u.api
  96. .getAllCustomer({
  97. page: this.page,
  98. pageSize: this.pageSize,
  99. enableStatus: 5,
  100. keyword: this.keyword,
  101. status: 2
  102. })
  103. .then(res => {
  104. uni.stopPullDownRefresh();
  105. if (this.page === 1) {
  106. this.customer_list = res.data;
  107. } else {
  108. this.customer_list = this.customer_list.concat(res.data);
  109. }
  110. this.total = res.pageTotal;
  111. this.load_status = this.$utils.loadStatus(this.page, this.pageSize, this.total);
  112. })
  113. .catch(err => {
  114. uni.stopPullDownRefresh();
  115. });
  116. },
  117. goCall(phone) {
  118. uni.makePhoneCall({
  119. phoneNumber: phone
  120. })
  121. },
  122. getBirthday(time) {
  123. let date = new Date(time*1000)
  124. return date.getFullYear() + '-' + (date.getMonth() + 1) + '-' + date.getDate()
  125. }
  126. }
  127. };
  128. </script>
  129. <style lang="scss" scoped>
  130. .search-view {
  131. position: fixed;
  132. z-index: 99;
  133. top: 0;
  134. left: 0;
  135. width: 100%;
  136. background-color: #ffffff;
  137. border-bottom: 1px solid #f5f5f5;
  138. padding: 20rpx;
  139. .input-view {
  140. padding: 0 24rpx;
  141. input {
  142. height: 60rpx;
  143. line-height: 60rpx;
  144. padding: 0 24rpx;
  145. display: inline-block;
  146. width: 580rpx;
  147. border: 1px solid #f5f5f5;
  148. vertical-align: middle;
  149. border-radius: 8rpx;
  150. background-color: #f7f8fa;
  151. }
  152. .add-icon {
  153. margin-left: 14rpx;
  154. display: inline-block;
  155. vertical-align: middle;
  156. }
  157. }
  158. }
  159. .customer-ul {
  160. // padding-top: 90rpx;
  161. padding-top: 20rpx;
  162. padding-bottom: 20rpx;
  163. .customer-li {
  164. width: 702rpx;
  165. margin: 0 auto;
  166. background-color: #ffffff;
  167. border-radius: 10rpx;
  168. margin-top: 20rpx;
  169. .customer-name {
  170. padding: 0 20rpx;
  171. line-height: 80rpx;
  172. border-bottom: 1px solid #f5f5f5;
  173. }
  174. .other {
  175. font-size: 24rpx;
  176. padding: 10rpx 20rpx;
  177. line-height: 50rpx;
  178. .concat {
  179. .float_right {
  180. color: $uni-color-primary;
  181. .phone-text {
  182. margin-left: 10rpx;
  183. }
  184. }
  185. }
  186. }
  187. }
  188. }
  189. .gk-wrap {
  190. width: 710rpx;
  191. height: 224rpx;
  192. border-radius: 20rpx;
  193. background-color: #fff;
  194. margin:0 auto 20rpx;
  195. position: relative;
  196. .call-wrap {
  197. position: absolute;
  198. right: 20rpx;
  199. bottom: 20rpx;
  200. width: 126rpx;
  201. height: 48rpx;
  202. background: #4D74CF;
  203. border-radius: 10rpx;
  204. color: #fff;
  205. text-align: center;
  206. line-height: 48rpx;
  207. font-size: 24rpx;
  208. font-weight: 400;
  209. }
  210. .user-info {
  211. padding-left: 20rpx;
  212. font-size: 24rpx;
  213. font-weight: 500;
  214. color: #939393;
  215. .phone {
  216. color: #0F2447;
  217. }
  218. .brithday {
  219. margin: 15rpx 0;
  220. }
  221. }
  222. .gk-top {
  223. height: 80rpx;
  224. width: 100%;
  225. display: flex;
  226. justify-content: space-between;
  227. align-items: center;
  228. .top-left {
  229. display: flex;
  230. .left-name {
  231. padding: 0 20rpx;
  232. height: 40rpx;
  233. border-radius: 0 20rpx 20rpx 0;
  234. background-color: #ecf5ff;
  235. margin-right: 20rpx;
  236. max-width: 400rpx;
  237. }
  238. .left-tip {
  239. border: 1px solid #4D74CF;
  240. color: #4D74CF;
  241. height: 32rpx;
  242. padding: 0 10rpx;
  243. line-height: 32rpx;
  244. border-radius: 5rpx;
  245. font-size: 20rpx;
  246. }
  247. }
  248. .top-right {
  249. display: flex;
  250. align-items: center;
  251. padding-right: 20rpx;
  252. font-size: 22rpx;
  253. font-weight: 500;
  254. color: #999999;
  255. image {
  256. width: 9rpx;
  257. height: 17rpx;
  258. }
  259. }
  260. }
  261. }
  262. </style>