agent.blade.php 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514
  1. @extends('layouts.base')
  2. @section('title', '团队客户')
  3. @section('content')
  4. <!-- <link href="{{static_url('yunshop/css/member.css')}}" media="all" rel="stylesheet" type="text/css"/> -->
  5. <link href="{{static_url('yunshop/css/total.css')}}" media="all" rel="stylesheet" type="text/css" />
  6. <style>
  7. .vue-title {
  8. display: flex;
  9. margin: 5px 0;
  10. line-height: 32px;
  11. font-size: 16px;
  12. color: #333;
  13. font-weight: 600;
  14. }
  15. .vue-title-left {
  16. width: 4px;
  17. height: 18px;
  18. margin-top: 6px;
  19. background: #29ba9c;
  20. display: inline-block;
  21. margin-right: 10px;
  22. }
  23. .vue-title-content {
  24. font-size: 14px;
  25. flex: 1;
  26. }
  27. .member-info {
  28. display: flex;
  29. margin: 38px;
  30. justify-content: space-between;
  31. }
  32. .search-top {
  33. display: flex;
  34. height: 200px;
  35. }
  36. .top-item1 {
  37. flex: 1;
  38. }
  39. .top-item2 {
  40. width: 540px;
  41. }
  42. .audit,
  43. .is_follow {
  44. width: 60px;
  45. height: 22px;
  46. text-align: center;
  47. line-height: 22px;
  48. font-size: 14px;
  49. color: #fff;
  50. margin: 0 auto;
  51. border-radius: 4px;
  52. background-color: #13c7a7;
  53. }
  54. .un_follow {
  55. width: 70px;
  56. height: 22px;
  57. text-align: center;
  58. line-height: 22px;
  59. font-size: 14px;
  60. color: #fff;
  61. margin: 0 auto;
  62. border-radius: 4px;
  63. background-color: #ffb025;
  64. }
  65. .name-over {
  66. line-height: 37px;
  67. overflow: hidden;
  68. white-space: nowrap;
  69. text-overflow: ellipsis;
  70. }
  71. .el-table_1_column_2 .cell {
  72. /* display: flex; */
  73. }
  74. /* 分页 */
  75. .pagination-right {
  76. text-align: center;
  77. margin: 50px auto;
  78. }
  79. /* 列表 */
  80. p {
  81. font-size: 12px;
  82. margin-top: 5px;
  83. }
  84. .cell {
  85. /* border:1px solid red; */
  86. text-align: center;
  87. }
  88. .keep {
  89. width: 75px;
  90. color: white;
  91. font-weight: 600 !important;
  92. margin: 0 auto;
  93. background: #ff9800;
  94. }
  95. .keep-0 {
  96. background: #13c7a7;
  97. }
  98. [v-cloak] {
  99. display: none;
  100. }
  101. .flexBox {
  102. display: flex;
  103. height: 180px;
  104. padding-bottom: 0px;
  105. }
  106. .solid_e7 {
  107. width: 1px;
  108. height: 140px;
  109. background-color: #e7e7e7;
  110. margin: 10px 50px 0 0;
  111. }
  112. .search_box {
  113. flex: 1;
  114. padding-left: 13px;
  115. }
  116. .index_pub {
  117. height: 42px;
  118. border-radius: 4px;
  119. margin-right: 20px;
  120. margin-bottom: 20px;
  121. }
  122. .index_01 {
  123. /* width: 180px; */
  124. width: 17%;
  125. }
  126. .index_02 {
  127. /* width: 300px; */
  128. width: 17.5%;
  129. }
  130. .index_03 {
  131. width: 202px;
  132. }
  133. .index_btn {
  134. width: 102px;
  135. height: 42px;
  136. border-radius: 4px;
  137. }
  138. .index_btn01 {
  139. background-color: #29ba9c;
  140. }
  141. .index_btn02 {
  142. width: 102px;
  143. color: #29ba9c;
  144. border: solid 1px #29ba9c;
  145. }
  146. .sum_text {
  147. font-family: SourceHanSansCN-Regular;
  148. font-size: 14px;
  149. font-weight: normal;
  150. font-stretch: normal;
  151. letter-spacing: 1px;
  152. color: #999999;
  153. }
  154. /* 列表 */
  155. .straight_table p {
  156. font-size: 12px;
  157. margin-top: 5px;
  158. font-family: SourceHanSansCN-Medium;
  159. font-size: 14px;
  160. font-weight: normal;
  161. font-stretch: normal;
  162. letter-spacing: 0px;
  163. }
  164. /* 操作按钮 */
  165. .operate {
  166. width: 70px;
  167. height: 30px;
  168. border-radius: 4px;
  169. border: solid 1px #a2a2a2;
  170. }
  171. .search_box {
  172. flex: 1;
  173. padding-left: 13px;
  174. }
  175. </style>
  176. <div class="all">
  177. <div id="app" v-cloak>
  178. <div class="total-head flexBox">
  179. <div class="search-top">
  180. <div class="top-item1">
  181. <div class="vue-title" style="margin-bottom:20px;">
  182. <div class="vue-title-left"></div>
  183. <div class="vue-title-content">搜索筛选</div>
  184. </div>
  185. <div class="search_box">
  186. <el-input clearable v-model="mid" placeholder="请输入搜索ID" class="index_pub index_01" @keyup.enter.native="searchEvent(1)"></el-input>
  187. <el-input clearable v-model="keyword" placeholder="可搜索昵称/姓名/手机号" class="index_pub index_02" @keyup.enter.native="searchEvent(1)">
  188. </el-input>
  189. <el-select clearable v-model="followed" placeholder="是否关注" class="index_pub index_01">
  190. <el-option label="已关注" value="1">
  191. </el-option>
  192. <el-option label="未关注" value="-1">
  193. </el-option>
  194. </el-select>
  195. <el-select clearable v-model="isBack" placeholder="黑名单状态" class="index_pub index_01">
  196. <el-option label="否" value="0">
  197. </el-option>
  198. <el-option label="是" value="1">
  199. </el-option>
  200. </el-select>
  201. <el-select clearable v-model="tier" placeholder="层级" class="index_pub index_01">
  202. <el-option v-for="(item,i) in tierList" :key="i" :value="item.level">
  203. [[item.level]] 级 ([[item.total]])
  204. </el-option>
  205. </el-select>
  206. <el-button class="index_btn index_btn01" type="primary" @click="searchEvent(1)" >搜索</el-button>
  207. <el-button class="index_btn index_btn02" @click="excelEvent">导出 Excel</el-button>
  208. </div>
  209. </div>
  210. </div>
  211. <div class="solid_e7"></div>
  212. <div class="top-item2">
  213. <div class="vue-title">
  214. <div class="vue-title-left"></div>
  215. <div class="vue-title-content">会员信息</div>
  216. </div>
  217. <div style="display:flex;margin-top:20px;">
  218. <div>
  219. <img style="width:90px;height:90px;" :src="avatar" alt="">
  220. </div>
  221. <div style="margin-left:10px;display:flex;flex-direction: column;justify-content: space-between;">
  222. <div style="color: #333333;font-weight:600"><span>姓名:[[realname]]</span><span style="margin-left: 30px;">手机号:[[mobile]]</span></div>
  223. <div style="color: #868686;">昵称:[[nickname]]</div>
  224. <div style="color: #868686;">余额:<span style="color:red">[[credit2]]</span> / 积分:<span style="color:red">[[credit1]]</span></div>
  225. </div>
  226. </div>
  227. </div>
  228. </div>
  229. <div class="total-floo">
  230. <div class="vue-title">
  231. <div class="vue-title-left"></div>
  232. <div class="vue-title-content" style="flex:none;margin-right:24px;">客户列表</div>
  233. <div class="sum_text">总数:[[total]]</div>
  234. </div>
  235. <el-table class="straight_table" :data="tableData" style="width: 100%;">
  236. <el-table-column label="会员ID">
  237. <template slot-scope="scope">
  238. <p>[[ scope.row.member_id ]]</p>
  239. </template>
  240. </el-table-column>
  241. <el-table-column label="粉丝">
  242. <template slot-scope="scope">
  243. <div>
  244. <p v-if="scope.row.has_one_child_member && scope.row.has_one_child_member.avatar"><img style="width:37px;height:37px;border-radius: 50%;" :src="scope.row.has_one_child_member.avatar" alt=""></p>
  245. <p class="name-over">[[ scope.row.has_one_child_member.fans_item ? scope.row.has_one_child_member.fans_item : "未更新"]]</p>
  246. </div>
  247. </template>
  248. </el-table-column>
  249. <el-table-column label="姓名">
  250. <template slot-scope="scope">
  251. <p>[[ scope.row.has_one_child_member.realname]]</p>
  252. </template>
  253. </el-table-column>
  254. <el-table-column label="手机号">
  255. <template slot-scope="scope">
  256. <p>[[ scope.row.has_one_child_member.mobile]]</p>
  257. </template>
  258. </el-table-column>
  259. <el-table-column label="客户人数">
  260. <template slot-scope="scope">
  261. <p v-if="scope.row.has_one_lower && scope.row.has_one_lower!=null">[[ scope.row.has_one_lower.first ? scope.row.has_one_lower.first : 0 ]]</p>
  262. <p v-else>0</p>
  263. </template>
  264. </el-table-column>
  265. <el-table-column label="注册时间">
  266. <template slot-scope="scope">
  267. <p>[[timeDate(scope.row.has_one_child_member.createtime*1000)]]</p>
  268. </template>
  269. </el-table-column>
  270. <el-table-column label="关注">
  271. <template slot-scope="scope">
  272. <p class="keep keep-0" v-if="scope.row.has_one_child_fans!==null && scope.row.has_one_child_fans.follow">已关注</p>
  273. <p class="keep" v-else>未关注</p>
  274. </template>
  275. </el-table-column>
  276. <el-table-column label="操作">
  277. <template slot-scope="scope">
  278. <el-popover placement="top" width="150" trigger="click">
  279. <el-link :href="'{{yzWebUrl('member.member.detail', array('id' => ''))}}'+[[scope.row.member_id]]" :underline="false" style="height:30px;line-height:30px;"><i class="fa fa-edit"></i> 会员详情
  280. </el-link>
  281. <el-link :href="'{{yzWebUrl('order.order-list.index', array('member_id' => ''))}}'+[[scope.row.member_id]]" :underline="false" style="height:30px;line-height:30px;"><i class="fa fa-list"></i>
  282. 会员订单</el-link>
  283. <el-link :href="'{{yzWebUrl('point.recharge.index', array('id' => ''))}}'+[[scope.row.member_id]]" :underline="false" style="height:30px;line-height:30px;"><i class="fa fa-credit-card"></i>
  284. 充值积分</el-link>
  285. <el-link :href="'{{yzWebUrl('balance.recharge.index', array('member_id' => ''))}}'+[[scope.row.member_id]]" :underline="false" style="height:30px;line-height:30px;"><i class="fa fa-money"></i>
  286. 充值余额
  287. </el-link>
  288. <el-link :href="'{{yzWebUrl('member.member.agent-old', array('id' => ''))}}'+[[scope.row.member_id]]" :underline="false" style="height:30px;line-height:30px;"><i class="fa fa-exchange"></i>
  289. 直推客户
  290. </el-link>
  291. <el-link :href="'{{yzWebUrl('member.member.agent', array('id' => ''))}}'+[[scope.row.member_id]]" :underline="false" style="height:30px;line-height:30px;"><i class="fa fa-exchange"></i>
  292. 团队客户
  293. </el-link>
  294. <el-link :href="'{{yzWebUrl('member.member.agent-parent', array('id' => ''))}}'+[[scope.row.member_id]]" :underline="false" style="height:30px;line-height:30px;"><i class="fa fa-exchange"></i>
  295. 上级会员
  296. </el-link>
  297. <el-link :href="'{{yzWebUrl('member.member.black', array('black'=>0,'id' => ''))}}'+[[scope.row.member_id]]" v-if="scope.row.is_black==1" :underline="false" style="height:30px;line-height:30px;"><i class="fa fa-minus-circle"></i> 取消黑名单</el-link>
  298. <el-link :href="'{{yzWebUrl('member.member.black', array('black'=>1,'id' => ''))}}'+[[scope.row.member_id]]" v-else :underline="false" style="height:30px;line-height:30px;"><i class="fa fa-minus-circle"></i> 设置黑名单</el-link>
  299. <el-button class="operate" slot="reference" size="mini">操作
  300. </el-button>
  301. </el-popover>
  302. </template>
  303. </el-table-column>
  304. </el-table>
  305. </div>
  306. <!-- 分页 -->
  307. <div v-if="tableData.length!==0" class="fixed total-floo">
  308. <div class="fixed_box">
  309. <el-pagination background style="text-align: right;" @current-change="handleCurrentChange" :current-page.sync="currentPage" :page-size="pagesize" layout="prev, pager, next, jumper" :total="total">
  310. </el-pagination>
  311. </div>
  312. </div>
  313. </div>
  314. </div>
  315. @include("finance.balance.verifyPopupComponent")
  316. <script>
  317. var vm = new Vue({
  318. el: '#app',
  319. delimiters: ['[[', ']]'],
  320. data() {
  321. return {
  322. avatar: "",
  323. nickname: "",
  324. realname: "",
  325. mobile: "",
  326. credit2: "",
  327. credit1: "",
  328. mid: '',
  329. keyword: '',
  330. followed: '',
  331. tier: [],
  332. tierList: [],
  333. isBack: '',
  334. tableData: [],
  335. currentPage: 1,
  336. pagesize: 6,
  337. row_id: '',
  338. total: 0
  339. }
  340. },
  341. created() {
  342. g = this;
  343. //优化在不同设备固定定位挡住的现象设置父元素的内边距
  344. window.onload = function() {
  345. let all = document.querySelector(".all");
  346. let h = window.innerHeight * 0.04;
  347. all.style.paddingBottom = h + "px";
  348. }
  349. let id = this.getParam('id')
  350. if (this.getParam('id') && id !== -1) {
  351. this.row_id = Number(this.getParam('id'));
  352. this.postVipInfoList(1);
  353. this.getLevels();
  354. }
  355. //全局监听 enter事件
  356. // document.onkeydown = (e) => {
  357. // let key = window.event.keyCode
  358. // if (key == 13) {
  359. // g.searchEvent()
  360. // }
  361. // }
  362. },
  363. methods: {
  364. getParam(name) {
  365. var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
  366. var r = window.location.search.substr(1).match(reg);
  367. if (r != null) return unescape(r[2]);
  368. return null;
  369. },
  370. //回退
  371. hisGo(i) {
  372. // console.log(i);
  373. history.go(i)
  374. },
  375. //导出
  376. excelEvent() {
  377. let isSubmied = false;
  378. if (verifyed && (expireTime === 0 || expireTime * 1000 < Date.now())) {
  379. showGetVerifyCodePopup();
  380. return false;
  381. }
  382. if (isSubmied) {
  383. return false;
  384. } else {
  385. isSubmied = true;
  386. }
  387. let url = `{!! yzWebFullUrl('member.member.agent-export') !!}&id=${this.row_id}&aid=${this.mid}&keyword=${this.keyword}&followed=${this.followed}&isblack=${this.isBack}&level=${this.tier}`
  388. window.location.href = url
  389. console.log(url);
  390. },
  391. //搜索层级
  392. getLevels() {
  393. this.$http.post("{!!yzWebFullUrl('member.member.getLevels')!!}", {
  394. id: this.row_id,
  395. }).then(res => {
  396. let {data}=res.body;
  397. //层级
  398. this.tierList =data
  399. console.log(this.tierList);
  400. })
  401. },
  402. //会员信息列表
  403. postVipInfoList(page) {
  404. this.$http.post("{!!yzWebFullUrl('member.member.agent-show')!!}", {
  405. id: this.row_id,
  406. page: page,
  407. aid: this.mid,
  408. keyword: this.keyword,
  409. followed: this.followed,
  410. isblack: this.isBack,
  411. level: this.tier,
  412. }).then(res => {
  413. let {
  414. member,
  415. list,
  416. level_total,
  417. current_page,
  418. per_page,
  419. total
  420. } = res.body.data
  421. //当前页码
  422. this.currentPage = list.current_page
  423. //一页显示几条数据
  424. this.pagesize = list.per_page
  425. //总数据
  426. this.total = list.total
  427. //会员头像
  428. this.avatar = member.avatar
  429. //昵称
  430. this.nickname = member.nickname
  431. //真实姓名
  432. this.realname = member.realname
  433. //手机号码
  434. this.mobile = member.mobile
  435. //余额
  436. this.credit2 = member.credit2
  437. //积分
  438. this.credit1 = member.credit1
  439. let {
  440. data
  441. } = list
  442. if (data !== null && data.length !== 0) {
  443. this.tableData = data
  444. } else {
  445. this.tableData = [];
  446. }
  447. })
  448. },
  449. //当前页码
  450. handleCurrentChange(page) {
  451. this.postVipInfoList(page)
  452. },
  453. //搜索
  454. searchEvent(page) {
  455. this.postVipInfoList(page)
  456. },
  457. //时间的转换
  458. timeDate(date) {
  459. let d = new Date(date);
  460. let resDate = d.getFullYear() + '-' + (d.getMonth() + 1) + '-' + d.getDate() + ' ' + d.getHours() + ':' + d.getMinutes() + ':' + d.getSeconds();;
  461. return resDate;
  462. }
  463. }
  464. })
  465. </script>
  466. @endsection