old-log.blade.php 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317
  1. @extends('layouts.base')
  2. @section('title', '会员合并记录')
  3. @section('content')
  4. <link href="{{static_url('yunshop/css/total.css')}}" media="all" rel="stylesheet" type="text/css" />
  5. <style scoped>
  6. /* 设置input宽度 */
  7. .input-w {
  8. width: 200px;
  9. margin-right: 22px;
  10. }
  11. .input_box,
  12. .button_box {
  13. display: inline-block;
  14. }
  15. /* 会员合并记录列表 */
  16. .vue-title-content span {
  17. opacity: .6;
  18. margin-left: 14px;
  19. }
  20. .el-table .cell {
  21. color: #333;
  22. font-family: inherit;
  23. }
  24. .el-table td div {
  25. font-family: "微软雅黑";
  26. font-weight: 400;
  27. }
  28. /* 分页 */
  29. .pagination-right {
  30. text-align: center;
  31. margin: 50px auto;
  32. }
  33. /* 选项卡部分 */
  34. .nav {
  35. cursor: default;
  36. user-select: none;
  37. }
  38. .new {
  39. display: flex;
  40. width: 1000px;
  41. margin-left: 0px;
  42. }
  43. .nav-btn {
  44. cursor: pointer;
  45. color: #666666;
  46. font-size: 14px;
  47. font-family: SourceHanSansCN-Regular;
  48. padding: 9px;
  49. border-radius: 5px;
  50. margin-right: 10px;
  51. background-color: white;
  52. font-weight: normal;
  53. font-stretch: normal;
  54. letter-spacing: 2px;
  55. }
  56. .nav-btn-back {
  57. color: #FFF;
  58. background-color: #29BA9C;
  59. }
  60. </style>
  61. <div class="all">
  62. <div id="app">
  63. <div class="nav total-head">
  64. <ul class="new">
  65. <li @click="btnEvent(i)" class="nav-btn " :class="{'nav-btn-back': isIndex===i}" v-for='(item,i) in navlist' :key="i">[[item]]</li>
  66. </ul>
  67. </div>
  68. <div class="total-head">
  69. <el-form>
  70. <!-- 会员合并记录-->
  71. <el-form-item>
  72. <div class="vue-title">
  73. <div class="vue-title-left"></div>
  74. <div class="vue-title-content">会员合并记录</div>
  75. </div>
  76. </el-form-item>
  77. <el-form-item>
  78. <div class="input_box">
  79. <el-input clearable class="input-w" v-model="merge.beforeId" placeholder="合并前会员id"></el-input>
  80. <el-input clearable class="input-w" v-model="merge.afterId" placeholder="合并后会员id">
  81. </el-input>
  82. </div>
  83. <div class="button_box">
  84. <el-button @click="submit" @keyup.enter="submit" type="primary">搜索</el-button>
  85. </div>
  86. </el-form-item>
  87. </el-form>
  88. </div>
  89. <!-- 邀请码列表 -->
  90. <div class="total-floo">
  91. <div class="vue-title">
  92. <div class="vue-title-left"></div>
  93. <div class="vue-title-content">合并记录<span>总数:&nbsp;[[total]]</span></div>
  94. </div>
  95. <!-- 列表+分页查询 -->
  96. <el-table v-loading="loading" style="width:100%; padding-bottom:1px;" :data="mergeList" :header-cell-style='{"text-align":"center"}' :cell-style='{"text-align":"center"}'>
  97. <el-table-column label="ID">
  98. <template slot-scope="scope">
  99. <p>[[scope.row.id]]</p>
  100. </template>
  101. </el-table-column>
  102. <el-table-column label="合并前会员id">
  103. <template slot-scope="scope">
  104. <p v-if="isIndex==0">[[scope.row.member_id]]</p>
  105. <p v-else-if="isIndex==1">[[scope.row.old_uid]]</p>
  106. <p v-else>[[scope.row.mark_member_id]]</p>
  107. </template>
  108. </el-table-column>
  109. <el-table-column label="合并后会员id">
  110. <template slot-scope="scope">
  111. <p v-if="isIndex==0">[[scope.row.member_id_after]]</p>
  112. <p v-else-if="isIndex==1">[[scope.row.new_uid]]</p>
  113. <p v-else>[[scope.row.member_id]]</p>
  114. </template>
  115. </el-table-column>
  116. <el-table-column label="合并时间">
  117. <template slot-scope="scope">
  118. <p>[[scope.row.created_at | createdAt]]</p>
  119. </template>
  120. </el-table-column>
  121. </el-table>
  122. </div>
  123. <!-- 分页 -->
  124. <div v-if="mergeList.length!==0" class="fixed total-floo">
  125. <div class="fixed_box">
  126. <el-pagination background style="text-align: right;" @current-change="handleCurrentChange" :current-page.sync="currentPage" :page-size="pagesize" layout="prev, pager, next, jumper" :total="total">
  127. </el-pagination>
  128. </div>
  129. </div>
  130. </div>
  131. </div>
  132. <script>
  133. const vm = new Vue({
  134. el: "#app",
  135. name: "auth",
  136. delimiters: ["[[", "]]"],
  137. data() {
  138. return {
  139. merge: {
  140. beforeId: "",
  141. afterId: ""
  142. },
  143. mergeList: [],
  144. //总人数
  145. mergeListSum: 0,
  146. currentPage: 1, //当前的页码
  147. pagesize: 5, //每页显示的行数
  148. total: 0, //总数
  149. //导航头部标签
  150. navlist: ["自动合并记录", "绑定手机合并记录", "点击合并记录"],
  151. //切换选项卡标识
  152. isIndex: 0,
  153. loading: true
  154. }
  155. },
  156. created() {
  157. g = this;
  158. //优化在不同设备固定定位挡住的现象设置父元素的内边距
  159. window.onload = function() {
  160. let all = document.querySelector(".all");
  161. let h = window.innerHeight * 0.04;
  162. all.style.paddingBottom = h + "px";
  163. }
  164. //获取当前数据总数
  165. this.mergeListSum = this.mergeList.length;
  166. //全局监听searchBtnt enter事件
  167. document.onkeydown = (e) => {
  168. let key = window.event.keyCode;
  169. if (key == 13) {
  170. g.submit();
  171. }
  172. }
  173. if (this.isIndex == 0) {
  174. this.postAuto(1);
  175. } else if (i == 1) {
  176. this.postBind(1);
  177. } else {
  178. this.postMerge(1);
  179. }
  180. },
  181. filters: {
  182. createdAt(date) {
  183. if (date !== null && date) {
  184. if (g.isIndex == 1) {
  185. return g.timeDate(date * 1000)
  186. } else {
  187. return date
  188. }
  189. } else {
  190. return ""
  191. }
  192. }
  193. },
  194. methods: {
  195. //点击选项卡函数
  196. btnEvent(i) {
  197. //点击切换清空数据
  198. this.merge.beforeId = "";
  199. this.merge.afterId = "";
  200. this.mergeList = [];
  201. this.isIndex = i;
  202. window.sessionStorage.setItem("iMerge", this.isIndex);
  203. if (i === 0) {
  204. this.postAuto(1);
  205. } else if (i === 1) {
  206. this.postBind(1);
  207. } else {
  208. this.postMerge(1);
  209. }
  210. },
  211. //自动合并记录
  212. postAuto(page) {
  213. this.$http.post("{!!yzWebFullUrl('member.merge-log.auth-merge')!!}", {
  214. page: page,
  215. search: {
  216. member_id: this.merge.beforeId,
  217. mark_member_id: this.merge.afterId
  218. }
  219. }).then(res => {
  220. this.infoAll(res)
  221. })
  222. },
  223. //绑定手机合并记录
  224. postBind(page) {
  225. this.$http.post("{!!yzWebFullUrl('member.merge-log.bind-tel')!!}", {
  226. page: page,
  227. search: {
  228. member_id: this.merge.beforeId,
  229. mark_member_id: this.merge.afterId
  230. }
  231. }).then(res => {
  232. this.infoAll(res)
  233. })
  234. },
  235. //点击合并记录
  236. postMerge(page) {
  237. this.$http.post("{!!yzWebFullUrl('member.merge-log.click-merge')!!}", {
  238. page: page,
  239. search: {
  240. member_id: this.merge.beforeId,
  241. mark_member_id: this.merge.afterId
  242. }
  243. }).then(res => {
  244. this.infoAll(res)
  245. })
  246. },
  247. infoAll(res) {
  248. if (res.data.result == 1) {
  249. this.loading = true;
  250. setTimeout(() => {
  251. this.loading = false;
  252. }, 300)
  253. let {
  254. data,
  255. current_page,
  256. per_page,
  257. total
  258. } = res.body.data.list;
  259. if (data !== null && data.length !== 0) {
  260. this.mergeList = data;
  261. } else {
  262. this.mergeList = [];
  263. }
  264. this.currentPage = current_page;
  265. this.pagesize = per_page;
  266. this.total = total;
  267. } else {
  268. this.$message.error(res.data.msg);
  269. }
  270. },
  271. isTypeNull(str) {
  272. // 如果对象 或者为空则返回
  273. if (str === null) {
  274. return false
  275. } else {
  276. return true;
  277. }
  278. },
  279. //页面切换的方式
  280. handleCurrentChange(page) {
  281. if (this.isIndex === 0) {
  282. this.postAuto(page);
  283. } else if (this.isIndex === 1) {
  284. this.postBind(page);
  285. } else {
  286. this.postMerge(page)
  287. }
  288. },
  289. //请求当前合并列表
  290. submit() {
  291. if (this.isIndex == 0) {
  292. this.postAuto(this.currentPage);
  293. } else if (this.isIndex == 1) {
  294. this.postBind(this.currentPage);
  295. } else {
  296. this.postMerge(this.currentPage)
  297. }
  298. },
  299. //时间的转换
  300. timeDate(date) {
  301. let d = new Date(date);
  302. let resDate = d.getFullYear() + '-' + (d.getMonth() + 1) + '-' + d.getDate() + ' ' + d.getHours() + ':' + d.getMinutes() + ':' + d.getSeconds();;
  303. return resDate;
  304. }
  305. }
  306. })
  307. </script>@endsection