edit.php 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333
  1. <style>
  2. .default-avatar{
  3. width: 50px;
  4. height: 50px;
  5. border-radius: 50%;
  6. float: left;
  7. margin-right: 8px;
  8. }
  9. </style>
  10. <div id="my_customer" v-cloak>
  11. <div class="user_info">
  12. <div class="user_detail">
  13. <el-image style="height:50px;width:50px;border-radius: 50%;margin-right: 20px;" :src="userInfo.user.avatar_url? userInfo.avatar_url:'/resources/img/common/default-avatar.png'" lazy></el-image>
  14. <div>
  15. <div class="user_name">
  16. {{userInfo.user.nickname}}
  17. </div>
  18. <div class="info">
  19. <div>
  20. <span>ID:</span>
  21. <span class="text">{{ userInfo.user.id }}</span>
  22. </div>
  23. <div>
  24. <span>手机号:</span>
  25. <span class="text">{{userInfo.user.mobile || '无'}}</span>
  26. </div>
  27. <!-- <div>-->
  28. <!-- <span>邀请码:</span>-->
  29. <!-- <span class="text">{{ userInfo.invite_code }}</span>-->
  30. <!-- </div>-->
  31. </div>
  32. </div>
  33. </div>
  34. </div>
  35. <el-row>
  36. <el-col :span="24">
  37. <div class="grid-content bg-purple-white" style="height: 35px;line-height: 35px;padding-left: 20px;background-color: #fff;margin-bottom: 5px;">
  38. 邀请会员:
  39. </div>
  40. </el-col>
  41. </el-row>
  42. <el-table :data="userList" stripe style="width: 100%" v-loading="listLoading" v-if="is_team">
  43. <el-table-column prop="user.id" label="会员ID" min-width="100" align="center"></el-table-column>
  44. <el-table-column key='3' label="会员名称" width="240" >
  45. <template slot-scope="scope">
  46. <div class="table-info-img-text">
  47. <el-image class="table-info-img circle" :src="scope.row.user.avatar_url">
  48. <div slot="error" class="image-slot">
  49. <com-image src="/resources/img/common/default-avatar.png"></com-image>
  50. </div>
  51. </el-image>
  52. <div class="table-info-text">
  53. <div>{{scope.row.user.nickname}}</div>
  54. <div>{{scope.row.user.mobile}}</div>
  55. </div>
  56. </div>
  57. </template>
  58. </el-table-column>
  59. <el-table-column label="注册时间" min-width="100" align="center">
  60. <template slot-scope="scope">
  61. <div>{{scope.row.user.created_at | dateTimeFormat("Y-m-d H:i:s")}}</div>
  62. </template>
  63. </el-table-column>
  64. </el-table>
  65. <div style="text-align: right;margin: 20px 0;">
  66. <el-pagination @current-change="pagination" background layout="prev, pager, next"
  67. :page-count="pageCount" :current-page="currentPage"></el-pagination>
  68. </div>
  69. </div>
  70. <script>
  71. // getQuery('order_id'),
  72. const app = new Vue({
  73. el: '#my_customer',
  74. data() {
  75. return {
  76. userInfo: [],
  77. activeName: '1',
  78. tabArr: [],
  79. userList: [],
  80. commissionList: [],
  81. capitalList: [],
  82. listLoading: false,
  83. isType: -1,
  84. keyword: '',
  85. search_type: '',
  86. pageCount: 1,
  87. currentPage: 1,
  88. page: 1,
  89. id: '',
  90. from_type:'',
  91. is_team: true,
  92. is_commission: false
  93. }
  94. },
  95. mounted(){
  96. this.user_id = getQuery('user_id');
  97. console.info(getQuery('user_id'));
  98. if (getQuery('id') && getQuery('id') != 0) {
  99. this.id = getQuery('id');
  100. }
  101. /* this.$navigate({
  102. // r: this.getOrderListUrl,
  103. r: 'mall/order/index',
  104. }) */
  105. this.getList();
  106. },
  107. methods: {
  108. getList(){
  109. this.listLoading = true;
  110. this.is_team = true;
  111. this.is_commission = false;
  112. request({
  113. params: {
  114. r: 'share-redpack/invate/edit',
  115. id: this.id,
  116. status: this.activeName,
  117. keyword: this.keyword,
  118. search_type: this.search_type,
  119. page: this.page
  120. },
  121. method: 'get',
  122. }).then(res => {
  123. this.listLoading = false;
  124. if(res.data.code == 0){
  125. this.userInfo = res.data.data.detail;
  126. this.pageCount = res.data.data.list.page_count;
  127. this.userList = res.data.data.list.list;
  128. console.log(this.userList);
  129. }else {
  130. this.listLoading = false;
  131. this.$message.error(e.data.msg);
  132. }
  133. }).catch(err => {
  134. this.$message.error(err.data.msg);
  135. })
  136. },
  137. handleClick(tab, event){
  138. this.commissionList = [];
  139. this.userList = [];
  140. this.pageCount = 1;
  141. this.page = 1;
  142. this.from_type = '';
  143. if (tab.name == 5) {
  144. this.listLoading = true;
  145. this.is_commission = true;
  146. this.is_team = false;
  147. this.getCommission();
  148. } else {
  149. this.activeName = tab.name;
  150. this.keyword = '';
  151. this.search_type = '';
  152. this.getList();
  153. }
  154. },
  155. getCommission() {
  156. this.listLoading = true;
  157. this.is_commission = true;
  158. this.is_team = false;
  159. request({
  160. params: {
  161. r: 'team-data/default/my-commission',
  162. user_id: this.userInfo.id,
  163. id: this.id,
  164. capital_type: this.from_type,
  165. page: this.page
  166. },
  167. method: 'get',
  168. }).then(res => {
  169. this.listLoading = false;
  170. if(res.data.code == 0){
  171. this.commissionList = res.data.data.list;
  172. this.capitalList = res.data.data.capital_type;
  173. this.pageCount = res.data.data.page_count;
  174. }else {
  175. this.listLoading = false;
  176. this.$message.error(e.data.msg);
  177. }
  178. }).catch(err => {
  179. this.listLoading = false;
  180. this.$message.error(err.data.msg);
  181. })
  182. },
  183. selectKeyword(select){
  184. this.search_type = select;
  185. },
  186. searchInfo(){
  187. if ((this.search_type=='' || this.keyword=='') && this.from_type=='') {
  188. this.$message.error('请选择搜索项');
  189. return false;
  190. }
  191. this.commissionList = [];
  192. this.userList = [];
  193. this.pageCount = 1;
  194. this.page = 1;
  195. if (this.activeName == 5) {
  196. this.getCommission();
  197. } else {
  198. this.getList();
  199. }
  200. },
  201. pagination(currentPage){
  202. this.page = currentPage;
  203. if (this.activeName == 5) {
  204. this.getCommission()
  205. } else {
  206. this.getList();
  207. }
  208. },
  209. selectFromType(from_type) {
  210. this.capital_type = from_type;
  211. },
  212. gotoUserDetail(id){
  213. this.$navigate({
  214. r: 'mall/user/user-detail',
  215. id: id
  216. })
  217. },
  218. gotoBy(id){
  219. this.$navigate({
  220. r: 'team-data/default/my-customer',
  221. user_id: id
  222. })
  223. },
  224. formatData(arg1,arg2,change_type){
  225. switch (change_type){
  226. case 'add':
  227. return (arg1+arg2).toFixed(2);
  228. case 'sub':
  229. return (arg1-arg2).toFixed(2);
  230. default:
  231. return 0;
  232. }
  233. }
  234. }
  235. })
  236. </script>
  237. <style>
  238. .user_info{
  239. background: #FFF;
  240. padding: 20px;
  241. margin-bottom: 10px;
  242. }
  243. .user_detail{
  244. display: flex;
  245. align-items: center;
  246. margin-bottom: 40px;
  247. }
  248. .user_detail .info{
  249. display: flex;
  250. font-size: 12px;
  251. color: #939393;
  252. }
  253. .user_detail .info .text{
  254. color: #000;
  255. margin-right: 40px;
  256. }
  257. .user_detail .user_name{
  258. font-size: 15px;
  259. margin-bottom: 10px;
  260. }
  261. .user_total{
  262. background: #F2F2F2;
  263. display: flex;
  264. padding: 20px 30px;
  265. }
  266. .user_total .module{
  267. flex: 1;
  268. color: #919191;
  269. }
  270. .module_value{
  271. font-size: 25px;
  272. color: #000;
  273. margin-top: 8px;
  274. }
  275. .tab_module{
  276. background: #FFF;
  277. padding: 10px 20px;
  278. }
  279. .tab_search{
  280. display: flex;
  281. }
  282. .search_but{
  283. display: flex;
  284. flex: 1;
  285. color: #797979;
  286. align-items: center;
  287. }
  288. .search_but div{
  289. border: 1px solid #E6E6E6;
  290. padding: 5px 20px;
  291. margin-right: 30px;
  292. border-radius: 30px;
  293. height: 30px;
  294. }
  295. .search_but div:hover{
  296. cursor:pointer
  297. }
  298. .search_but_sel{
  299. color: #FFF;
  300. background: #2E8FF4;
  301. }
  302. .search_form{
  303. display:flex;
  304. }
  305. </style>