list.vue 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488
  1. <template>
  2. <view style="background: #F5F7FA;">
  3. <view class="search-user flex-y-center ">
  4. <view class="search-content flex-y-center">
  5. <icon type="search" size="18" />
  6. <input confirm-type="search" v-model="seTval" @confirm="confirm" @input="getSearch" class="flex-grow-1"
  7. type="text" placeholder-style="font-size:26rpx" placeholder="请输入用户关键词" />
  8. <view class="flex-center" style="margin-left: 10rpx;" @click.stop="onDel" v-if="seTval">
  9. <icon type="clear" size="18" />
  10. </view>
  11. </view>
  12. <view class="search-btn" @click="search">
  13. 搜索
  14. </view>
  15. </view>
  16. <view class="box-pack-between headerScreen flex-y-center ">
  17. <view class="flex-y-center flex-grow-1 ft26 header-text">
  18. <view class="flex-grow-1 flex-center" data-text="1" :class="act_index==1?'act':''"
  19. @click="onTopBtnTap(1)">
  20. {{type_text}}
  21. <view class="d3"></view>
  22. </view>
  23. <view class="flex-grow-1 flex-center" data-text="2" :class="act_index==2?'act':''"
  24. @click="onTopBtnTap(2)">
  25. {{level_text}}
  26. <view class="d3"></view>
  27. </view>
  28. </view>
  29. </view>
  30. <view class="header-hg200"></view>
  31. <uni-popup-top ref="popup" type="top" :top="top" :maskClass="maskClass">
  32. <view class="showpay">
  33. <block v-if='act_index==1'>
  34. <view class="box-li" :class="state==''?'active':''" @click="pay(0,'全部')" data-type=''
  35. data-text='全部'>全部
  36. </view>
  37. <view class="box-li" :class="state==1?'active':''" @click="pay(1,'微信')" data-type='1'
  38. data-text='微信'>微信
  39. </view>
  40. <view class="box-li" :class="state==2?'active':''" @click="pay(2,'支付宝')" data-type='2'
  41. data-text='支付宝'>支付宝
  42. </view>
  43. </block>
  44. <block v-if='act_index==2'>
  45. <view class="box-li" :class="state==''?'active':''" @click="Onlevel(0,'等级')" data-text='全部'>全部
  46. </view>
  47. <view class="box-li" :class="state==''?'active':''" @click="Onlevel(55,'普通会员')">普通会员
  48. </view>
  49. <view class="box-li" v-for="(item,index) of level_list" :key='index'
  50. :class="item.level==level_index?'active':''" @click="Onlevel(item.level,item.name)">
  51. {{item.name}}
  52. </view>
  53. </block>
  54. </view>
  55. </uni-popup-top>
  56. <no-none v-if='list.length<=0'></no-none>
  57. <block v-else>
  58. <view class="list" v-for="(item,index) of list" :key='index' @click="enit(index)">
  59. <view class="item">
  60. <view class="box-pack-between item-top flex-y-center">
  61. <view class="title-left flex-y-center flex-grow-1">
  62. <image :src="item.type==2?'../static/images/ali.png':'../static/images/wx.png'"></image>
  63. {{item.nickname?item.nickname:item.level_name}} {{item.mobile?'-':''}} {{item.mobile||''}}
  64. </view>
  65. <view class="del" @click.stop="del(item.id,index)">删除</view>
  66. </view>
  67. <view class="flex-y-center box-pack-between item-bottom">
  68. <view class="flex-grow-1 flex-y-center">
  69. <view class="pay_type">
  70. <view class="box-pack-between ">
  71. <view class="pay_type_num">
  72. <text>级别: </text>
  73. <text style="color: #FFBB33;">{{item.level_name}}</text>
  74. </view>
  75. <view style="color: #FFBB33;padding-right: 20rpx;">
  76. ¥{{item.balance}}
  77. </view>
  78. </view>
  79. <view class="box-pack-between">
  80. <view class="time">积分:{{item.integral}} </view>
  81. <view class="flex-y-center ft22">
  82. </view>
  83. </view>
  84. <view class="box-pack-between">
  85. <view class="time">加入时间:{{item.create_time}} </view>
  86. <view class="flex-y-center ft22">
  87. <!-- <text class="iconfont icongengduo ft22"></text> -->
  88. </view>
  89. </view>
  90. </view>
  91. </view>
  92. </view>
  93. </view>
  94. </view>
  95. </block>
  96. </view>
  97. </template>
  98. <script>
  99. import uniPopupTop from '@/components/zx-uni-popup/uni-popup-top.vue'
  100. export default {
  101. components: {
  102. uniPopupTop
  103. },
  104. data() {
  105. return {
  106. list: [],
  107. level_list: [],
  108. page: 1,
  109. $test: this.$test.$test,
  110. floorstatus: false,
  111. act_index: 1,
  112. keywords: "",
  113. type: 0,
  114. type_text: '平台',
  115. level_text: '等级',
  116. level_type: 0,
  117. seTval: '',
  118. top: "200rpx",
  119. maskClass: {
  120. 'position': 'fixed',
  121. 'bottom': 0,
  122. 'top': "100rpx",
  123. 'left': 0,
  124. 'right': 0,
  125. 'backgroundColor': 'rgba(0, 0, 0, 0.4)'
  126. },
  127. }
  128. },
  129. onLoad(e) {
  130. },
  131. onShow(e) {
  132. this.page = 1;
  133. this.list = [];
  134. this.http();
  135. this.level_index();
  136. },
  137. onReachBottom(e) {
  138. this.http();
  139. },
  140. methods: {
  141. enit(index) {
  142. let {
  143. mobile,
  144. user_level,
  145. id
  146. } = this.list[index];
  147. uni.navigateTo({
  148. url: `./user-enit?mobile=${mobile}&level_name=${user_level}&id=${id}`
  149. })
  150. },
  151. // 下单方式
  152. pay(e, text) {
  153. this.type = e;
  154. this.type_text = text;
  155. this.page = 1;
  156. this.list = [];
  157. this.http();
  158. this.$refs.popup.close();
  159. },
  160. Onlevel(e, text) {
  161. this.level_type = e;
  162. this.level_text = text;
  163. this.page = 1;
  164. this.list = [];
  165. this.http();
  166. this.$refs.popup.close();
  167. },
  168. getSearch(e) {
  169. if (!e.detail.value) {
  170. this.page = 1;
  171. this.list = [];
  172. this.keywords = "";
  173. this.http();
  174. }
  175. this.keywords = e.detail.value;
  176. },
  177. onDel() {
  178. this.seTval = '';
  179. this.page = 1;
  180. this.list = [];
  181. this.keywords = "";
  182. this.http();
  183. },
  184. confirm(e) {
  185. this.page = 1;
  186. this.list = [];
  187. this.keywords = e.detail.value;
  188. this.http();
  189. },
  190. search(e) {
  191. this.page = 1;
  192. this.list = [];
  193. this.http();
  194. },
  195. onTopBtnTap(e) {
  196. this.act_index = e;
  197. this.$refs.popup.open();
  198. },
  199. del(id, index) {
  200. uni.showModal({
  201. title: '提示',
  202. content: '是否要删除?',
  203. showCancel: true,
  204. cancelText: '取消',
  205. confirmText: '确定',
  206. success: res => {
  207. if (res.confirm) {
  208. this.request({
  209. url: 'Smdcshop/user_delete',
  210. data: {
  211. id: id,
  212. },
  213. }).then(res => {
  214. console.log(res, "res")
  215. if (res.code === 200 || res.code === "200") {
  216. uni.showToast({
  217. title: "删除成功",
  218. icon: "none",
  219. })
  220. this.list.splice(index, 1);
  221. }
  222. }).catch((res) => {
  223. uni.showToast({
  224. title: res.message,
  225. icon: "none",
  226. })
  227. });
  228. }
  229. },
  230. fail: () => {},
  231. complete: () => {}
  232. });
  233. },
  234. http() {
  235. this.request({
  236. url: "Smdcshop/user_list",
  237. data: {
  238. admin_id: uni.getStorageSync("admin_id"),
  239. page: this.page,
  240. limit: 15,
  241. serch: this.keywords,
  242. level_name: this.level_type,
  243. type: this.type,
  244. },
  245. }).then(res => {
  246. console.log(res, "res")
  247. if (res.code === '200') {
  248. this.list = this.list.concat(res.data);
  249. this.page = this.page + 1;
  250. }
  251. });
  252. },
  253. level_index() {
  254. this.request({
  255. url: "Smdcshop/level_index",
  256. data: {
  257. admin_id: uni.getStorageSync("admin_id"),
  258. },
  259. }).then(res => {
  260. console.log(res, "res")
  261. if (res.code === '200') {
  262. this.level_list = res.data
  263. }
  264. });
  265. },
  266. }
  267. }
  268. </script>
  269. <style>
  270. @import url("/static/css/public.css")
  271. page {
  272. background: rgb(245, 247, 250);
  273. }
  274. .headerScreen {
  275. height: 100rpx;
  276. position: fixed;
  277. top: 100rpx;
  278. width: 100%;
  279. z-index: 999;
  280. background: #fff;
  281. border-bottom: 1rpx solid #F1F1F1;
  282. }
  283. .header-hg200 {
  284. height: 210rpx;
  285. }
  286. .header-text {
  287. text-align: center;
  288. }
  289. .d3 {
  290. width: 0;
  291. height: 0;
  292. border-width: 12rpx;
  293. border-style: solid;
  294. border-color: #000 transparent transparent transparent;
  295. margin-top: 14rpx;
  296. margin-left: 6rpx;
  297. }
  298. .showpay {
  299. width: 100%;
  300. z-index: 10;
  301. background: #FFFFFF;
  302. }
  303. .search-user {
  304. z-index: 999;
  305. position: fixed;
  306. left: 0;
  307. width: 100%;
  308. height: 100rpx;
  309. background: #FFFFFF;
  310. margin-left: 15rpx;
  311. }
  312. .search-user .search-content {
  313. width: 83%;
  314. height: 70rpx;
  315. background: #F1F1F1;
  316. border-radius: 100rpx;
  317. padding: 0 20rpx;
  318. }
  319. .search-user .search-content icon {
  320. margin-right: 10rpx;
  321. }
  322. .search-user .search-btn {
  323. margin-left: 20rpx;
  324. font-size: 28rpx;
  325. }
  326. .box-li {
  327. background-color: #fff;
  328. text-align: center;
  329. border-bottom: 1rpx solid #f1f1f1;
  330. height: 80rpx;
  331. line-height: 80rpx;
  332. font-size: 26rpx;
  333. }
  334. .list {
  335. width: 670rpx;
  336. border-radius: 10rpx;
  337. background: rgba(255, 255, 255, 1);
  338. margin: 0 auto;
  339. margin-bottom: 40rpx;
  340. }
  341. .item {
  342. padding: 0rpx 0rpx 0rpx 24rpx;
  343. }
  344. .item-top {
  345. /* height: 80rpx; */
  346. border-bottom: 1rpx solid #F1F1F1;
  347. padding: 20rpx 0;
  348. }
  349. .item-bottom {
  350. padding: 25rpx 0;
  351. }
  352. .food {
  353. width: 100%;
  354. height: 70rpx;
  355. opacity: 1;
  356. border-radius: 0px 0px 10rpx 10rpx;
  357. padding: 0 30rpx;
  358. }
  359. .title-left {
  360. font-size: 30rpx;
  361. font-weight: 500;
  362. color: #000000;
  363. flex: 1;
  364. }
  365. .title-left image {
  366. width: 50rpx;
  367. height: 50rpx;
  368. margin-right: 10rpx;
  369. border-radius: 100px;
  370. min-width: 50rpx;
  371. }
  372. .title-right {
  373. font-size: 28rpx;
  374. color: #3387FF;
  375. }
  376. .title-orderNO {
  377. border-bottom: 1rpx solid #F1F1F1;
  378. padding-bottom: 29rpx;
  379. }
  380. .wxtype {
  381. width: 36rpx;
  382. height: 36rpx;
  383. }
  384. .pay_type {
  385. font-size: 28rpx;
  386. font-weight: 400;
  387. color: #909090;
  388. width: 100%;
  389. }
  390. .pay_type_num {
  391. margin-bottom: 10rpx;
  392. }
  393. .price {
  394. font-size: 32rpx;
  395. font-weight: 500;
  396. }
  397. .round {
  398. width: 12rpx;
  399. height: 12rpx;
  400. border-radius: 50%;
  401. margin: 0 10rpx 29rpx 0;
  402. }
  403. .pdr-24rpx {
  404. padding: 0 24rpx;
  405. /* padding-left: 10rpx; */
  406. }
  407. .time {
  408. padding-top: 10rpx;
  409. }
  410. .del {
  411. height: 44rpx;
  412. line-height: 44rpx;
  413. padding: 0 20rpx;
  414. font-size: 24rpx;
  415. background-color: #FF5722;
  416. margin-right: 40rpx;
  417. color: #fff;
  418. border-radius: 4rpx;
  419. }
  420. </style>