selectGhs.vue 6.1 KB

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