visit.vue 6.0 KB

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