child.php 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385
  1. <?php
  2. use common\helpers\ComponentHelper;
  3. $diyPath = dirname(__DIR__) . '/components';
  4. ?>
  5. <style>
  6. </style>
  7. <div id="app" v-cloak>
  8. <el-card shadow="never" style="border:0;min-width: 1000px;" body-style="background-color: #f3f3f3;padding: 10px 0 0;">
  9. <div slot="header">
  10. <span>粉丝列表</span>
  11. </div>
  12. <div class="table-body">
  13. <div class="input-item">
  14. <el-input @keyup.enter.native="loadData" size="small" placeholder="请输入推荐人id,查询对应粉丝" v-model="search.user_id"
  15. clearable @clear="toSearch">
  16. </el-input>
  17. </div>
  18. <div class="input-item">
  19. <el-input @keyup.enter.native="loadData" size="small" placeholder="请输入推荐人用户昵称/手机号搜索" v-model="search.keyword" clearable @clear="toSearch">
  20. </el-input>
  21. </div>
  22. <el-button type="primary" size="small" style="padding: 9px 15px !important;" @click="toSearch">搜索</el-button>
  23. <el-tabs v-model="activeName" @tab-click="handleClick">
  24. <el-table :data="list" stripe v-loading="loading" size="small" style="margin-bottom: 15px;"
  25. @selection-change="handleSelectionChange">
  26. <el-table-column prop="user_id" label="用户ID" align="center"></el-table-column>
  27. <el-table-column label="基本信息" >
  28. <template slot-scope="scope">
  29. <div class="user_img" flex="cross:center">
  30. <el-image class="default-avatar" :src="scope.row.avatar_url">
  31. <div slot="error" class="image-slot">
  32. <com-image src="resources/img/mall/default_avatar_url.png"></com-image>
  33. </div>
  34. </el-image>
  35. <div class="uer-nickname over1" v-if="scope.row.nickname">{{scope.row.nickname}}</div>
  36. <div class="uer-nickname over1" v-else >ID:{{scope.row.user_id}}</div>
  37. </div>
  38. </template>
  39. </el-table-column>
  40. <el-table-column label="手机号" prop="mobile" align="center" >
  41. <template slot-scope="scope">
  42. <div>{{scope.row.mobile}}</div>
  43. </template>
  44. </el-table-column>
  45. <el-table-column label="推荐人" prop="parent_name" align="center">
  46. <template slot-scope="scope">
  47. <template v-if="scope.row.parent_id">
  48. <template v-if="scope.row.parent_name">{{scope.row.parent_name}}</template>
  49. <template v-else>ID:{{scope.row.parent_id}}</template>
  50. </template>
  51. <template v-else>平台</template>
  52. </template>
  53. </el-table-column>
  54. <el-table-column label="推荐人奖励信息" prop="commission" align="center">
  55. <template slot-scope="scope">
  56. 佣金:{{scope.row.commission_ratio}}
  57. 积分:{{scope.row.score_ratio}}
  58. </template>
  59. </el-table-column>
  60. </el-table-column>
  61. <el-table-column label="排序" align="center">
  62. <template slot-scope="scope">
  63. {{scope.row.index}}
  64. </template>
  65. </el-table-column>
  66. </el-table-column>
  67. </el-table>
  68. </el-tabs>
  69. <div flex="box:last cross:center">
  70. <div></div>
  71. <div>
  72. <el-pagination v-if="pagination" :page-size="pagination.defaultPageSize"
  73. style="display: inline-block;float: right;" background @current-change="pageChange"
  74. layout="prev, pager, next" :total="pagination.totalCount">
  75. </el-pagination>
  76. </div>
  77. </div>
  78. </div>
  79. </el-card>
  80. <achievement-edit v-model="edit.show" @savesuccess="stockEditFun"></achievement-edit>
  81. </div>
  82. <script>
  83. const app = new Vue({
  84. el: '#app',
  85. data: {
  86. qrimg: '',
  87. showqr: false,
  88. avatar: '',
  89. nickname: '',
  90. search: {
  91. user_id: null,
  92. keyword: '',
  93. page: 1,
  94. },
  95. loading: false,
  96. activeName: '-1',
  97. list: [],
  98. pagination: null,
  99. dialogChild: false,
  100. dialogLoading: false,
  101. childList: [],
  102. share_name: {
  103. first: '一级',
  104. second: '二级',
  105. third: '三级'
  106. },
  107. select: {
  108. nickname: '',
  109. status: 'first',
  110. },
  111. dialogContent: false,
  112. remarksForm: {
  113. remarks: '',
  114. user_id: '',
  115. id: '',
  116. },
  117. remarksLoading: false,
  118. exportList: {},
  119. edit: {
  120. show: false,
  121. },
  122. level: {
  123. show: false,
  124. agent: null,
  125. },
  126. commission_arr: {},
  127. agentLevelList: [],
  128. levelList: {},
  129. choose_list: [],
  130. export_url: 'agent/default/index', // 导出路径
  131. },
  132. mounted() {
  133. this.loadData();
  134. },
  135. methods: {
  136. handle(type, data = null){
  137. let id = data ? parseInt(data.id) : '';
  138. switch (type){
  139. case 'remarks':
  140. this.remarksLoading = true;
  141. request({
  142. params: {
  143. r: 'agent/default/remarks-edit',
  144. },
  145. method: 'post',
  146. data:{
  147. remarks: this.remarksForm.remarks,
  148. user_id: this.remarksForm.user_id,
  149. id: this.remarksForm.id
  150. }
  151. }).then(e => {
  152. this.remarksLoading = false;
  153. if (e.data.code == 0) {
  154. this.dialogContent = false;
  155. this.loadData();
  156. this.$message.success(e.data.msg);
  157. } else {
  158. this.$message.error(e.data.msg);
  159. }
  160. }).catch(e => {
  161. this.remarksLoading = false;
  162. this.$message.error('未知错误');
  163. });
  164. break
  165. }
  166. },
  167. confirmSubmit() {
  168. console.log(this.activeName)
  169. this.search.status = this.activeName
  170. },
  171. loadData() {
  172. this.loading = true;
  173. let params = {
  174. r: 'circle-distribution/user/child'
  175. };
  176. params = Object.assign(params, this.search);
  177. request({
  178. params: params,
  179. method: 'get',
  180. }).then(e => {
  181. this.loading = false;
  182. if (e.data.code == 0) {
  183. this.list = e.data.data.list;
  184. this.pagination = e.data.data.pagination;
  185. } else {
  186. this.$message.error(e.data.msg);
  187. }
  188. }).catch(e => {
  189. this.loading = false;
  190. });
  191. },
  192. pageChange(page) {
  193. this.search.page = page;
  194. this.loadData();
  195. },
  196. handleClick(tab, event) {
  197. this.search.page = 1;
  198. this.search.status = this.activeName;
  199. this.loadData()
  200. },
  201. // order(id) {
  202. // navigateTo({
  203. // r: 'mall/agent/order',
  204. // id: id
  205. // })
  206. // },
  207. // cash(user_id) {
  208. // navigateTo({
  209. // r: 'mall/agent/cash',
  210. // user_id: user_id
  211. // })
  212. // },
  213. toSearch() {
  214. this.search.page = 1;
  215. this.loadData();
  216. },
  217. remarks(row) {
  218. this.dialogContent = true;
  219. this.remarksForm = {
  220. remarks: row.remarks,
  221. user_id: row.user_id,
  222. id: row.id
  223. }
  224. },
  225. dialogChildShow(share, status) {
  226. this.dialogChild = true;
  227. this.dialogLoading = true;
  228. this.select = {
  229. nickname: share.nickname,
  230. status: status
  231. };
  232. request({
  233. params: {
  234. r: 'mall/agent/team',
  235. status: status,
  236. id: share.user_id
  237. },
  238. method: 'get'
  239. }).then(e => {
  240. this.dialogLoading = false;
  241. if (e.data.code == 0) {
  242. this.childList = e.data.data.list;
  243. }
  244. }).catch(e => {
  245. this.dialogLoading = false;
  246. this.$message.error('未知错误');
  247. });
  248. },
  249. editClick() {
  250. this.edit.show = true;
  251. },
  252. editLevel(row) {
  253. this.level.show = true;
  254. this.level.agent = row;
  255. },
  256. handleSelectionChange(val) {
  257. let self = this;
  258. self.choose_list = [];
  259. val.forEach(function (item) {
  260. self.choose_list.push(item.id);
  261. })
  262. },
  263. levelSuccess() {
  264. this.loadData();
  265. },
  266. stockEditFun(){
  267. this.loadData();
  268. }
  269. }
  270. });
  271. </script>
  272. <style>
  273. .el-tabs__header {
  274. font-size: 16px;
  275. }
  276. .table-body {
  277. padding: 20px;
  278. background-color: #fff;
  279. }
  280. .table-body .el-button {
  281. padding: 0 !important;
  282. border: 0;
  283. margin: 0 5px;
  284. }
  285. .input-item {
  286. width: 250px;
  287. margin: 0 0 20px;
  288. display: inline-block;
  289. }
  290. /*.input-item .el-input__inner {*/
  291. /* border-right: 0;*/
  292. /*}*/
  293. .input-item .el-input__inner:hover {
  294. border: 1px solid #dcdfe6;
  295. /*border-right: 0;*/
  296. outline: 0;
  297. }
  298. .input-item .el-input__inner:focus {
  299. border: 1px solid #dcdfe6;
  300. /*border-right: 0;*/
  301. outline: 0;
  302. }
  303. .input-item .el-input-group__append {
  304. background-color: #fff;
  305. border-left: 0;
  306. width: 10%;
  307. padding: 0;
  308. }
  309. .input-item .el-input-group__append .el-button {
  310. padding: 0;
  311. }
  312. .input-item .el-input-group__append .el-button {
  313. margin: 0;
  314. }
  315. .batch {
  316. margin: 0 0 20px;
  317. display: inline-block;
  318. }
  319. .batch .el-button {
  320. padding: 9px 15px !important;
  321. }
  322. .el-table th>.cell{
  323. color: #333;
  324. font-weight: bold;
  325. font-size: 14px;
  326. }
  327. .el-table__footer-wrapper, .el-table__header-wrapper{
  328. border-bottom: 1.4px solid #D6D6D6;
  329. }
  330. .el-table th>.cell {
  331. color: #333;
  332. font-weight: bold;
  333. font-size: 14px;
  334. }
  335. .table1 .el-table__footer-wrapper,
  336. .table1 .el-table__header-wrapper {
  337. border-bottom: 1.4px solid #D6D6D6;
  338. }
  339. .user_img{
  340. position: relative;
  341. margin-right: 8px;
  342. /* height: 50px;
  343. width: 50px; */
  344. }
  345. .default-avatar{
  346. width: 50px;
  347. height: 50px;
  348. border-radius: 50%;
  349. margin-right: 8px;
  350. }
  351. .uer-nickname {
  352. flex: 1;
  353. }
  354. </style>