index.vue 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515
  1. <template>
  2. <view class="container">
  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 style="width: 50%;" class="flex-grow-1 flex-center " data-text="1" :class="act_index==1?'act':''"
  19. @click="onTopBtnTap(1)">
  20. <view class="text-1" style="width: auto; max-width: 300rpx;">
  21. {{level_text}}
  22. </view>
  23. <view class="d3"></view>
  24. </view>
  25. <view style="width: 50%;" class="flex-grow-1 flex-center text-1" data-text="2"
  26. :class="act_index==2?'act':''" @click="onTopBtnTap(2)">
  27. <view class="text-1" style="width: auto; max-width: 300rpx;">
  28. {{type_text}}
  29. </view>
  30. <view class="d3"></view>
  31. </view>
  32. </view>
  33. </view>
  34. <view class="header-hg200"></view>
  35. <uni-popup-top ref="popup" type="top" :top="top" :maskClass="maskClass">
  36. <view class="showpay">
  37. <block v-if='act_index==1'>
  38. <view class="box-li" :class="level_id==0?'active':''" @click="Onlevel(0,'全部')" data-text='全部'>全部
  39. </view>
  40. <scroll-view scroll-y="true" style="height: 400rpx;">
  41. <view class="box-li" v-for="(item,index) of tableTypeList" :key='index'
  42. :class="item.id==level_id?'active':''" @click="Onlevel(item.id,item.name)">
  43. {{item.name}}
  44. </view>
  45. </scroll-view>
  46. </block>
  47. <block v-if='act_index==2'>
  48. <view class="box-li" :class="status==0?'active':''" @click="onStatus(0,'全部')">全部
  49. </view>
  50. <view class="box-li" :class="status==1?'active':''" @click="onStatus(1,'已通过')">已通过
  51. </view>
  52. <view class="box-li" :class="status==2?'active':''" @click="onStatus(2,'待审核')">待审核
  53. </view>
  54. <view class="box-li" :class="status==3?'active':''" @click="onStatus(3,'已拒绝')">已拒绝
  55. </view>
  56. </block>
  57. </view>
  58. </uni-popup-top>
  59. <no-none v-if='list.length<=0'></no-none>
  60. <view class="list" v-else>
  61. <view class="item" style="border: none;" v-for="(item,index) in list" :key="index">
  62. <view class="name flex flex-y-center">
  63. <text>{{item.level_name||'未知等级'}}</text>
  64. <view :class="['status-name',item.status == 1?'open':'close']" v-if="item.state == 1">
  65. {{item.status == 1?'已启用':'已禁用'}}
  66. </view>
  67. <view class="ft28" style="padding-right: 20rpx;color: #247EFF;margin-left: auto;">
  68. {{item.state==1?'审核通过':item.state==2?'审核中':item.state==3?'审核不通过':''}}
  69. </view>
  70. </view>
  71. <view class="content">
  72. <view class="flex flex-y-center">
  73. <view class="cell flex flex-y-center">
  74. <view class="title">昵称:</view>
  75. <view class="desc">{{item.nickname||''}}</view>
  76. </view>
  77. </view>
  78. <view class="flex flex-y-center box-pack-between" style="margin-top: 16rpx;">
  79. <view class="cell flex-grow-0 flex-y-center ">
  80. <view class="title">手机:</view>
  81. <view class="desc">{{item.mobile||''}}</view>
  82. </view>
  83. <view class="cell flex-grow-0 flex-y-center ">
  84. <view class="title">所属平台:</view>
  85. <view class="desc">{{item.type==1?'微信':'支付宝'}}</view>
  86. </view>
  87. </view>
  88. <view class="flex flex-y-center box-pack-between" style="margin-top: 16rpx;">
  89. <view class="cell flex-grow-0 flex-y-center ">
  90. <view class="title">消费获得礼盒:</view>
  91. <view class="desc">{{item.pay_gift}}</view>
  92. </view>
  93. <view class="cell flex-grow-0 flex-y-center">
  94. <view class="title">剩余礼盒:</view>
  95. <view class="desc">{{item.over_gift}}</view>
  96. </view>
  97. </view>
  98. <view class="flex flex-y-center box-pack-between" style="margin-top: 16rpx;">
  99. <view class="cell flex flex-y-center ">
  100. <view class="title">当前佣金:</view>
  101. <view class="desc">{{item.commission}}</view>
  102. </view>
  103. <view class="cell flex flex-y-center">
  104. <view class="title">结算绑定:</view>
  105. <view class="desc">{{item.content || ''}}</view>
  106. </view>
  107. </view>
  108. <!-- <view class="flex flex-y-center box-pack-between" style="margin-top: 16rpx;">
  109. <view class="cell flex flex-y-center">
  110. <view class="title">启用:</view>
  111. <switch :checked="item.status==1?true:false" @change="onChange" :data-id='item.id' />
  112. </view>
  113. </view> -->
  114. <view class="flex flex-y-center" style="margin-top: 16rpx;">
  115. <view class="cell flex flex-y-center " style="width:100%">
  116. <view class="title">创建时间:</view>
  117. <view class="desc">{{item.create_time}}</view>
  118. </view>
  119. </view>
  120. </view>
  121. <view class="btm-block border1rpx flex-center">
  122. <view class="btn" v-if="item.state == 2" @click="toExamine(item.id,index)">审核合伙人</view>
  123. <template v-if="item.state == 1">
  124. <view class="btn close-btn" v-if="item.status == 1" @click="settlement(item.id,0,index)">禁用合伙人
  125. </view>
  126. <view class="btn open-btn" v-else-if="item.status == 0" @click="settlement(item.id,1,index)">
  127. 启用合伙人</view>
  128. </template>
  129. </view>
  130. </view>
  131. </view>
  132. </view>
  133. </template>
  134. <script>
  135. import uniPopupTop from '@/components/zx-uni-popup/uni-popup-top.vue'
  136. export default {
  137. components: {
  138. uniPopupTop
  139. },
  140. data() {
  141. return {
  142. act_index: 1,
  143. type_text: '审核状态',
  144. level_text: '合伙人等级',
  145. level_id: "",
  146. admin_id: '',
  147. list: [],
  148. page: 1,
  149. is_bottom: false,
  150. keywords: "",
  151. status: 0,
  152. type: 2,
  153. tableTypeList: [],
  154. top: "200rpx",
  155. maskClass: {
  156. 'position': 'fixed',
  157. 'bottom': 0,
  158. 'top': "100rpx",
  159. 'left': 0,
  160. 'right': 0,
  161. 'backgroundColor': 'rgba(0, 0, 0, 0.4)'
  162. },
  163. }
  164. },
  165. onLoad(e) {
  166. // this.type = e.type || 2;
  167. this.admin_id = uni.getStorageSync("admin_id");
  168. this.shop_store_index();
  169. },
  170. onShow() {
  171. this.getData(1)
  172. },
  173. onReachBottom() {
  174. if (!this.is_bottom) {
  175. this.getData(this.page + 1)
  176. }
  177. },
  178. methods: {
  179. // onChange(e) {
  180. // console.log(e, "eee")
  181. // this.is_show = e.detail.value ? 1 : 0;
  182. // this.settlement(e.currentTarget.dataset.id);
  183. // },
  184. settlement(id, is_show, index) {
  185. this.request({
  186. url: 'Smdcshop/shared_users_settlement',
  187. data: {
  188. id,
  189. is_show, //0关闭,1启用
  190. }
  191. }).then(res => {
  192. if (res.code == 200) {
  193. let item = this.list[index]
  194. item.status = is_show
  195. this.$set(this.list, index, item)
  196. }
  197. })
  198. },
  199. //审核
  200. toExamine(id, index) {
  201. uni.showActionSheet({
  202. title: '审核合伙人',
  203. itemList: ['通过', '审核中', '拒绝'],
  204. success: r => {
  205. let state = r.tapIndex + 1
  206. this.examine(id,state,index)
  207. }
  208. })
  209. },
  210. examine(id,state,index) {
  211. this.request({
  212. url: 'smdcshop/shared_users_edit',
  213. data: {
  214. id,
  215. state, //1:审核通过,2审核中,3拒绝
  216. admin_id:uni.getStorageSync('admin_id')
  217. }
  218. }).then(res => {
  219. if (res.code == 200) {
  220. let item = this.list[index]
  221. item.state = state
  222. this.$set(this.list, index, item)
  223. }
  224. })
  225. },
  226. shop_store_index() {
  227. let storeinfo = uni.getStorageSync("storeinfo");
  228. this.request({
  229. url: 'Smdcshop/shared_level_index',
  230. data: {
  231. admin_id: this.admin_id,
  232. page: 1,
  233. limit: 1000,
  234. }
  235. }).then(res => {
  236. if (res.code == 200) {
  237. this.tableTypeList = res.data;
  238. }
  239. })
  240. },
  241. onStatus(e, text) {
  242. this.status = e;
  243. this.type_text = text;
  244. this.list = [];
  245. this.getData(1);
  246. this.$refs.popup.close();
  247. },
  248. Onlevel(e, text) {
  249. this.level_id = e;
  250. this.level_text = text;
  251. this.list = [];
  252. this.getData(1);
  253. this.$refs.popup.close();
  254. },
  255. getSearch(e) {
  256. if (!e.detail.value) {
  257. this.page = 1;
  258. this.list = [];
  259. this.keywords = "";
  260. this.getData(1);
  261. }
  262. this.keywords = e.detail.value;
  263. },
  264. onDel() {
  265. this.seTval = '';
  266. this.page = 1;
  267. this.list = [];
  268. this.keywords = "";
  269. this.getData(1);
  270. },
  271. confirm(e) {
  272. this.page = 1;
  273. this.list = [];
  274. this.keywords = e.detail.value;
  275. this.getData(1);
  276. },
  277. search(e) {
  278. this.page = 1;
  279. this.list = [];
  280. this.getData(1);
  281. },
  282. onTopBtnTap(e) {
  283. this.act_index = e;
  284. this.$refs.popup.open();
  285. },
  286. getData(page) {
  287. if (page == 1) {
  288. this.list = []
  289. this.page = 1
  290. this.is_bottom = false
  291. }
  292. this.request({
  293. url: 'smdcshop/shared_users_index',
  294. data: {
  295. page,
  296. limit: 10,
  297. serch: this.keywords,
  298. admin_id: this.admin_id,
  299. state: this.status, //状态:全部=空。1通过,2审核中,3已拒绝
  300. level_id: this.level_id //合伙人等级
  301. }
  302. }).then(res => {
  303. if (res.code == 200 && res.data.length) {
  304. this.list = this.list.concat(res.data)
  305. this.page = page
  306. } else {
  307. this.is_bottom = true
  308. }
  309. })
  310. }
  311. }
  312. }
  313. </script>
  314. <style>
  315. page {
  316. background-color: #F4F5F7;
  317. }
  318. </style>
  319. <style lang="scss" scoped>
  320. /* @import url("./static/css/common.css"); */
  321. .list {
  322. padding: 30rpx 25rpx;
  323. }
  324. .list .item {
  325. border-radius: 8rpx;
  326. overflow: hidden;
  327. border-left: 8rpx solid #247EFF;
  328. background-color: #fff;
  329. margin-bottom: 30rpx;
  330. }
  331. .list .item .name {
  332. height: 80rpx;
  333. border-bottom: 1rpx solid #f5f5f5;
  334. font-size: 30rpx;
  335. line-height: 80rpx;
  336. font-weight: bold;
  337. margin: 0 30rpx;
  338. }
  339. .list .item .name .status-name {
  340. height: 40rpx;
  341. line-height: 40rpx;
  342. font-size: 24rpx;
  343. font-weight: 400;
  344. margin-left: 12rpx;
  345. padding: 0 20rpx;
  346. border-radius: 8rpx;
  347. color: #fff;
  348. }
  349. .list .item .name .status-name.open {
  350. background: linear-gradient(129deg, #1f9802, #04be02);
  351. }
  352. .list .item .name .status-name.close {
  353. background: linear-gradient(129deg, #be0202, #ff0000);
  354. }
  355. .list .item .content {
  356. padding: 20rpx 0 24rpx 30rpx;
  357. }
  358. .list .item .content .cell {
  359. flex: none;
  360. min-width: 50%;
  361. box-sizing: border-box;
  362. font-size: 26rpx;
  363. line-height: 37rpx;
  364. color: #666;
  365. }
  366. .list .item .content .cell .title {
  367. color: #99A0AD;
  368. }
  369. .list .item .btm-block {
  370. border-top: 1rpx solid #f5f5f5;
  371. padding: 30rpx 0;
  372. margin: 0 24rpx;
  373. .btn {
  374. height: 46rpx;
  375. background-color: #007dFF;
  376. font-size: 28rpx;
  377. font-weight: 500;
  378. line-height: 44rpx;
  379. color: #fff;
  380. padding: 0.5rpx 24rpx;
  381. border-radius: 23rpx;
  382. &.open-btn {
  383. background: linear-gradient(129deg, #1f9802, #04be02);
  384. }
  385. &.close-btn {
  386. background: linear-gradient(129deg, #be0202, #ff0000);
  387. }
  388. }
  389. }
  390. .headerScreen {
  391. height: 100rpx;
  392. position: fixed;
  393. top: 100rpx;
  394. width: 100%;
  395. z-index: 999;
  396. background: #fff;
  397. border-bottom: 1rpx solid #F1F1F1;
  398. }
  399. .header-hg200 {
  400. height: 210rpx;
  401. }
  402. .header-text {
  403. text-align: center;
  404. }
  405. .d3 {
  406. width: 0;
  407. height: 0;
  408. border-width: 12rpx;
  409. border-style: solid;
  410. border-color: #000 transparent transparent transparent;
  411. margin-top: 14rpx;
  412. margin-left: 6rpx;
  413. }
  414. .showpay {
  415. width: 100%;
  416. z-index: 10;
  417. background: #FFFFFF;
  418. }
  419. .search-user {
  420. z-index: 999;
  421. position: fixed;
  422. left: 0;
  423. width: 100%;
  424. height: 100rpx;
  425. background: #FFFFFF;
  426. margin-left: 15rpx;
  427. }
  428. .search-user .search-content {
  429. width: 83%;
  430. height: 70rpx;
  431. background: #F1F1F1;
  432. border-radius: 100rpx;
  433. padding: 0 20rpx;
  434. }
  435. .search-user .search-content icon {
  436. margin-right: 10rpx;
  437. }
  438. .search-user .search-btn {
  439. margin-left: 20rpx;
  440. font-size: 28rpx;
  441. }
  442. .box-li {
  443. background-color: #fff;
  444. text-align: center;
  445. border-bottom: 1rpx solid #f1f1f1;
  446. height: 80rpx;
  447. line-height: 80rpx;
  448. font-size: 26rpx;
  449. }
  450. page .active {
  451. color: #007AFF;
  452. }
  453. </style>