selectCustom.vue 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262
  1. <template>
  2. <div class="app-main app-content">
  3. <view class="input-wrap_box">
  4. <view>
  5. <AppSearchModule placeholder="请输入客户名称,支持拼音首字母" @input="searchFn"/>
  6. </view>
  7. </view>
  8. <block v-if="!$util.isEmpty(list.data)">
  9. <block v-for="(item, index) in list.data" :key="index">
  10. <tui-list-cell :arrow="true" @click=" pageTo({url: '/admin/billing/index',type:2,query: {customId: item.id,customName:item.name}})">
  11. <div class="tui-msg-box">
  12. <img :src="item.avatar" class="tui-msg-pic" mode="widthFix" />
  13. <div class="tui-msg-item">
  14. <div class="tui-msg-name">
  15. <div class="tui-user-name">{{ item.name }}</div>
  16. </div>
  17. <div class="tui-msg-content">
  18. <span>{{ item.visitTime }}</span>
  19. <span v-if="item.debtAmount > 0" class="debt-amount">欠款:<span class="amount_num">{{item.debtAmount}}</span></span>
  20. </div>
  21. </div>
  22. </div>
  23. <div class="tui-msg-right">
  24. <badge-module
  25. type="danger"
  26. :dot="item.level == 3 ? true : false"
  27. v-if="item.messageNum > 0"
  28. >{{ item.messageNum }}</badge-module
  29. >
  30. </div>
  31. </tui-list-cell>
  32. </block>
  33. </block>
  34. <block v-else>
  35. <app-wrapper-empty :is-empty="$util.isEmpty(list.data)" />
  36. </block>
  37. </div>
  38. </template>
  39. <script>
  40. import TuiListCell from "@/components/plugin/list-cell";
  41. import BadgeModule from "@/components/plugin/badge";
  42. import AppWrapperEmpty from "@/components/app-wrapper-empty";
  43. import appVipModule from "@/components/module/app-vip";
  44. import AppTag from "@/components/module/app-tag.vue";
  45. import AppSearchModule from "@/components/module/app-search";
  46. import { list } from "@/mixins";
  47. import { getList } from "@/api/member";
  48. export default {
  49. name: "selectCustom",
  50. components: {
  51. TuiListCell,
  52. BadgeModule,
  53. AppWrapperEmpty,
  54. appVipModule,
  55. AppTag,
  56. AppSearchModule
  57. },
  58. mixins: [list],
  59. data() {
  60. return {
  61. tabIndex: 0
  62. };
  63. },
  64. onPullDownRefresh() {
  65. this.resetList();
  66. this._list().then((res) => {
  67. uni.stopPullDownRefresh();
  68. });
  69. },
  70. onReachBottom() {
  71. if (!this.list.finished) {
  72. this._list().then((res) => {
  73. uni.stopPullDownRefresh();
  74. });
  75. } else {
  76. uni.stopPullDownRefresh();
  77. }
  78. },
  79. onLoad(option) {},
  80. onShow(){
  81. uni.removeStorageSync('newClient');
  82. },
  83. methods: {
  84. init() {
  85. if(!this.AUTHORITY_SHOW) {
  86. this._list();
  87. }
  88. },
  89. searchFn(e) {
  90. this.seekVal = e;
  91. this._list();
  92. },
  93. _list() {
  94. return getList({
  95. search: "",
  96. type:this.tabIndex,
  97. page: this.list.page,
  98. name: this.seekVal,
  99. }).then((res) => {
  100. this.completes(res);
  101. if (this.$util.isEmpty(res.data)){
  102. return false;
  103. }
  104. });
  105. },
  106. change(e) {
  107. if (this.tabIndex == e.index) {
  108. return false;
  109. }
  110. this.tabIndex = e.index;
  111. this.resetList();
  112. this._list();
  113. },
  114. },
  115. };
  116. </script>
  117. <style lang="scss" scoped>
  118. .app-content {
  119. padding-top: 100px;
  120. padding-bottom: 20px;
  121. }
  122. .tabs-wrap {
  123. position: fixed;
  124. .tabs-left {
  125. width: 80%;
  126. }
  127. .tabs-right {
  128. width: 19%;
  129. border-left: $borderColor;
  130. @include disFlex(center, center);
  131. }
  132. }
  133. .input-wrap_box {
  134. background-color: #fff;
  135. position: fixed;
  136. top: 0;
  137. z-index: 10;
  138. width: 100%;
  139. height: 100px;
  140. display: flex;
  141. align-items: center;
  142. padding: 0 30px;
  143. & > view:nth-child(1) {
  144. flex: 1;
  145. }
  146. }
  147. .tui-msg-box {
  148. display: flex;
  149. align-items: center;
  150. .tui-msg-pic {
  151. width: 80upx;
  152. height: 80upx;
  153. border-radius: 50%;
  154. margin-right: 20upx;
  155. }
  156. .tui-msg-item {
  157. max-width: 500upx;
  158. min-height: 80upx;
  159. overflow: hidden;
  160. display: flex;
  161. flex-direction: column;
  162. justify-content: space-between;
  163. & > div {
  164. @include disFlex(center, flex-start);
  165. & > div:first-child {
  166. margin-right: 8px;
  167. }
  168. }
  169. .level-img {
  170. /deep/.vip-text {
  171. left: 70px;
  172. top: 8px;
  173. }
  174. }
  175. .normal-img {
  176. width: 70px;
  177. padding: 2px 6px;
  178. color: #999;
  179. background-color: #f0f2f6;
  180. border-radius: 20px;
  181. .vip-text {
  182. font-size: 24px;
  183. transform: scale(0.6);
  184. position: relative;
  185. top: -2px;
  186. left: -8px;
  187. }
  188. }
  189. .member-img {
  190. width: 70px;
  191. padding: 2px 6px;
  192. color: green;
  193. background-color: #f0f2f6;
  194. border-radius: 20px;
  195. .vip-text {
  196. font-size: 24px;
  197. transform: scale(0.6);
  198. position: relative;
  199. top: -2px;
  200. left: -8px;
  201. }
  202. }
  203. .iconfont {
  204. color: #00aaed;
  205. }
  206. }
  207. .tui-msg-name {
  208. overflow: hidden;
  209. white-space: nowrap;
  210. text-overflow: ellipsis;
  211. font-size: 30upx;
  212. line-height: 1;
  213. color: #262b3a;
  214. .tui-user-name {
  215. overflow: hidden;
  216. text-overflow: ellipsis;
  217. white-space: nowrap;
  218. width: 180rpx;
  219. }
  220. }
  221. .tui-msg-content {
  222. overflow: hidden;
  223. white-space: nowrap;
  224. text-overflow: ellipsis;
  225. font-size: 24upx;
  226. line-height: 1;
  227. color: #9397a4;
  228. .debt-amount{
  229. margin-left:40rpx;
  230. .amount_num{
  231. color:red;
  232. }
  233. }
  234. }
  235. }
  236. .tui-msg-right {
  237. max-width: 120upx;
  238. height: 80upx;
  239. margin-left: auto;
  240. margin-right: 24px;
  241. text-align: right;
  242. display: flex;
  243. justify-content: space-between;
  244. align-items: center;
  245. }
  246. .user_tag {
  247. border: 1px solid #cccccc;
  248. padding: 5px 12px 5px 12px;
  249. border-radius: 25px;
  250. color: #bbbbbb;
  251. margin-right: 10px;
  252. margin-bottom: 12px;
  253. display: inline-block;
  254. font-size: 30rpx;
  255. }
  256. </style>