selectCustom.vue 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339
  1. <template>
  2. <view 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. <view class="tui-msg-box">
  12. <img :src="item.avatar" class="tui-msg-pic" mode="widthFix"/>
  13. <view class="tui-msg-item" style="position:relative;">
  14. <view class="tui-msg-name">
  15. <view class="tui-user-name">
  16. {{ item.name }}
  17. </view>
  18. </view>
  19. <view class="tui-msg-content">
  20. <span>{{ item.visitTime.substr(5,11) }}</span>
  21. <span v-if="Number(item.balance)!=0" class="balance-amount">
  22. <span v-if="item.balance>0" class="amount_add">余额{{item.balance?parseFloat(item.balance):0}}</span>
  23. <span v-else class="amount_sub">欠款{{item.balance?Math.abs(parseFloat(item.balance)):0}}</span>
  24. </span>
  25. <text v-if="item.overTimeUnExpend && item.overTimeUnExpend == 10000" style="font-size:24upx;margin-left:20upx;color:green;">没有下过单</text>
  26. <text v-if="item.overTimeUnExpend && item.overTimeUnExpend == 7" style="font-size:24upx;margin-left:20upx;color:green;">超1周未下单</text>
  27. <text v-if="item.overTimeUnExpend && item.overTimeUnExpend == 30" style="font-size:24upx;margin-left:20upx;color:green;">超1个月未下单</text>
  28. <text v-if="item.overTimeUnExpend && item.overTimeUnExpend == 180" style="font-size:24upx;margin-left:20upx;color:green;">超半年未下单</text>
  29. <text v-if="item.overTimeUnExpend && item.overTimeUnExpend == 365" style="font-size:24upx;margin-left:20upx;color:green;">超1年未下单</text>
  30. </view>
  31. </view>
  32. </view>
  33. <view class="tui-msg-right">
  34. <badge-module type="danger" :dot="item.level == 3 ? true : false" v-if="item.messageNum > 0" >{{ item.messageNum }}</badge-module >
  35. </view>
  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. </view>
  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. import { mapGetters } from "vuex";
  54. export default {
  55. name: "selectCustom",
  56. components: {
  57. TuiListCell,
  58. BadgeModule,
  59. AppWrapperEmpty,
  60. appVipModule,
  61. AppTag,
  62. AppSearchModule,
  63. couldScan:false
  64. },
  65. mixins: [list],
  66. data() {
  67. return {
  68. tabIndex: 0,
  69. selectStyle:1
  70. };
  71. },
  72. computed:{
  73. ...mapGetters(["getMyShopInfo"]),
  74. },
  75. onPullDownRefresh() {
  76. this.resetList();
  77. this._list().then((res) => {
  78. uni.stopPullDownRefresh();
  79. });
  80. },
  81. onReachBottom() {
  82. if (!this.list.finished) {
  83. this._list().then((res) => {
  84. uni.stopPullDownRefresh();
  85. });
  86. } else {
  87. uni.stopPullDownRefresh();
  88. }
  89. },
  90. onLoad(option) {
  91. // #ifdef APP-PLUS
  92. if(plus.device.vendor == 'Newland'){
  93. this.couldScan = true
  94. }
  95. // #endif
  96. },
  97. onShow(){
  98. uni.removeStorageSync('newClient');
  99. },
  100. methods: {
  101. selectCurrent(item,scanEnv=0){
  102. let style = this.option.style ? this.option.style : 1
  103. this.selectStyle = style
  104. if(style == 1){
  105. //花材开单
  106. this.$util.pageTo({url: '/admin/billing/index2?customId='+item.id+'&customName='+item.name,type:2})
  107. }else if(style == 3){
  108. //花束开单
  109. this.$util.pageTo({url: '/admin/billing/hs?customId='+item.id+'&customName='+item.name,type:2})
  110. }else if(style == 2){
  111. //用于选择客户并且需要返回的情况
  112. let pages = getCurrentPages();
  113. let prevPage = pages[ pages.length - 2 ];
  114. prevPage.$vm.form.customId = item.id;
  115. prevPage.$vm.form.customName = item.name;
  116. prevPage.$vm.form.selectCustomOk = 1;
  117. uni.navigateBack({})
  118. }else{
  119. //无操作
  120. }
  121. },
  122. init() {
  123. if(!this.no_shop_show_model) {
  124. this._list();
  125. }
  126. },
  127. searchFn(e) {
  128. this.resetList();
  129. this.seekVal = e;
  130. this._list();
  131. },
  132. _list() {
  133. return getList({
  134. search: "",
  135. type:this.tabIndex,
  136. page: this.list.page,
  137. name: this.seekVal,
  138. }).then((res) => {
  139. this.completes(res);
  140. if (this.$util.isEmpty(res.data)){
  141. return false;
  142. }
  143. });
  144. },
  145. change(e) {
  146. if (this.tabIndex == e.index) {
  147. return false;
  148. }
  149. this.tabIndex = e.index;
  150. this.resetList();
  151. this._list();
  152. },
  153. },
  154. };
  155. </script>
  156. <style lang="scss" scoped>
  157. .app-content {
  158. padding-top: 100upx;
  159. padding-bottom: 20upx;
  160. }
  161. .tabs-wrap {
  162. position: fixed;
  163. .tabs-left {
  164. width: 80%;
  165. }
  166. .tabs-right {
  167. width: 19%;
  168. border-left: $borderColor;
  169. @include disFlex(center, center);
  170. }
  171. }
  172. .input-wrap_box {
  173. background-color: #fff;
  174. position: fixed;
  175. top: 0;
  176. z-index: 10;
  177. /* 手机mobile屏幕小于1000px */
  178. @media screen and (max-width: 1100px) {
  179. width: 100%;
  180. }
  181. /* 收银台cashier屏幕大于1000px */
  182. @media screen and (min-width:1100px) {
  183. width: 40%;
  184. }
  185. height: 100upx;
  186. display: flex;
  187. align-items: center;
  188. padding: 0 30upx;
  189. & > view:nth-child(1) {
  190. flex: 1;
  191. }
  192. }
  193. .tui-msg-box {
  194. display: flex;
  195. align-items: center;
  196. .tui-msg-pic {
  197. width: 80upx;
  198. height: 80upx;
  199. border-radius: 50%;
  200. margin-right: 20upx;
  201. }
  202. .tui-msg-item {
  203. max-width: 500upx;
  204. min-height: 80upx;
  205. overflow: hidden;
  206. display: flex;
  207. flex-direction: column;
  208. justify-content: space-between;
  209. & > div {
  210. @include disFlex(center, flex-start);
  211. & > div:first-child {
  212. margin-right: 8upx;
  213. }
  214. }
  215. .level-img {
  216. ::v-deep.vip-text {
  217. left: 70upx;
  218. top: 8upx;
  219. }
  220. }
  221. .normal-img {
  222. width: 70upx;
  223. padding: 2upx 6upx;
  224. color: #999;
  225. background-color: #f0f2f6;
  226. border-radius: 20upx;
  227. .vip-text {
  228. font-size: 24upx;
  229. transform: scale(0.6);
  230. position: relative;
  231. top: -2upx;
  232. left: -8upx;
  233. }
  234. }
  235. .member-img {
  236. width: 70upx;
  237. padding: 2upx 6upx;
  238. color: green;
  239. background-color: #f0f2f6;
  240. border-radius: 20upx;
  241. .vip-text {
  242. font-size: 24upx;
  243. transform: scale(0.6);
  244. position: relative;
  245. top: -2upx;
  246. left: -8upx;
  247. }
  248. }
  249. .iconfont {
  250. color: #00aaed;
  251. }
  252. }
  253. .tui-msg-name {
  254. overflow: hidden;
  255. white-space: nowrap;
  256. text-overflow: ellipsis;
  257. font-size: 30upx;
  258. line-height: 1;
  259. color: #262b3a;
  260. margin-bottom: 4upx;
  261. .tui-user-name {
  262. overflow: hidden;
  263. text-overflow: ellipsis;
  264. white-space: nowrap;
  265. width: 450upx;
  266. font-size: 34upx;
  267. .super-man{
  268. margin-left:30upx;
  269. color:red;
  270. font-size:24upx;
  271. display:inline-block;
  272. color:white;
  273. border:1upx solid green;
  274. padding:6upx 10upx;
  275. background-color: green;
  276. border-radius: 11upx;
  277. }
  278. .ls-man{
  279. margin-left:30upx;
  280. font-size:24upx;
  281. display:inline-block;
  282. color:white;
  283. border:1upx solid #a5b1a5;
  284. padding:6upx 10upx;
  285. background-color: #a5b1a5;
  286. border-radius: 11upx;
  287. }
  288. }
  289. }
  290. .tui-msg-content {
  291. width:500upx;
  292. overflow: hidden;
  293. white-space: nowrap;
  294. text-overflow: ellipsis;
  295. font-size: 26upx;
  296. color: #9397a4;
  297. .balance-amount{
  298. margin-left:20upx;
  299. .amount_sub{
  300. color:red;
  301. margin-left:6upx;
  302. }
  303. .amount_add{
  304. color:#3385FF;
  305. margin-left:6upx;
  306. }
  307. }
  308. }
  309. }
  310. .tui-msg-right {
  311. max-width: 120upx;
  312. height: 80upx;
  313. margin-left: auto;
  314. margin-right: 24upx;
  315. text-align: right;
  316. display: flex;
  317. justify-content: space-between;
  318. align-items: center;
  319. }
  320. .user_tag {
  321. border: 1upx solid #cccccc;
  322. padding: 5upx 12upx 5upx 12upx;
  323. border-radius: 25upx;
  324. color: #bbbbbb;
  325. margin-right: 10upx;
  326. margin-bottom: 12upx;
  327. display: inline-block;
  328. font-size: 30upx;
  329. }
  330. </style>