selectCustom.vue 6.6 KB

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