list.blade.php 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292
  1. @extends('layouts.base')
  2. @section('title', '授权码管理')
  3. @section('content')
  4. <style>
  5. .panel{
  6. margin-bottom:10px!important;
  7. border-radius: 10px;
  8. padding-left: 20px;
  9. }
  10. .panel .active a {
  11. background-color: #29ba9c!important;
  12. border-radius: 18px!important;
  13. color:#fff;
  14. }
  15. .panel a{
  16. border:none!important;
  17. background-color:#fff!important;
  18. }
  19. .content{
  20. background: #eff3f6;
  21. padding: 10px!important;
  22. }
  23. .con{
  24. padding-bottom:20px;
  25. position:relative;
  26. border-radius: 8px;
  27. min-height: 100vh;
  28. background: #fff;
  29. }
  30. .con .setting .block{
  31. padding:10px;
  32. background-color:#fff;
  33. border-radius: 8px;
  34. }
  35. .con .setting .block .title{
  36. font-size:18px;
  37. margin-bottom:15px;
  38. display:flex;
  39. align-items:center;
  40. justify-content:space-between;
  41. }
  42. .add{
  43. width: 154px;
  44. height: 36px;
  45. border-radius: 4px;
  46. border: solid 1px #29ba9c;
  47. color:#29ba9c;
  48. display:flex;
  49. align-items:center;
  50. justify-content:center;
  51. }
  52. .el-table--fit{
  53. margin-top:-10px;
  54. }
  55. b{
  56. font-size:14px;
  57. }
  58. .vue-crumbs a {
  59. color: #333;
  60. }
  61. .vue-crumbs a:hover {
  62. color: #29ba9c;
  63. }
  64. .vue-crumbs {
  65. margin: 0 20px;
  66. font-size: 14px;
  67. color: #333;
  68. font-weight: 400;
  69. padding-bottom: 10px;
  70. line-height: 32px;
  71. }
  72. .el-table--border::after, .el-table--group::after, .el-table::before{
  73. background-color:#fff;
  74. }
  75. </style>
  76. <div id='re_content' >
  77. <div class="con">
  78. <div class="setting">
  79. <el-row>
  80. <el-button type="primary" @click="codeBasic()">基础设置</el-button>
  81. <el-button type="success" disabled @click="code()">授权码管理</el-button>
  82. <el-button type="info" @click="codeLog()">使用记录</el-button>
  83. </el-row>
  84. <div style="background: #eff3f6;width:100%;height:15px;margin-top: 1em;"></div>
  85. <div class="block">
  86. <div class="title">
  87. <div style="display:flex;align-items:center;"><span style="width: 4px;height: 18px;background-color: #29ba9c;margin-right:15px;display:inline-block;"></span><b>授权码管理</b></div></div>
  88. <el-input v-model="search_form.keyword" style="width:30%;margin-left:16px;margin-right:16px;" placeholder="会员ID/昵称/姓名/手机号"></el-input>
  89. <el-select v-model="search_form.code_level_id" placeholder="授权码等级" clearable>
  90. <el-option
  91. v-for="item in options"
  92. :key="item.id"
  93. :label="item.name"
  94. :value="item.id">
  95. </el-option>
  96. </el-select>
  97. <el-button type="primary" @click="search">搜索</el-button>
  98. </div>
  99. <div style="background: #eff3f6;width:100%;height:15px;"></div>
  100. <div class="block">
  101. <div class="title">
  102. <div style="display:flex;align-items:center;">
  103. {{--<span style="width: 4px;height: 18px;background-color: #29ba9c;margin-right:15px;display:inline-block;"></span>--}}
  104. {{--<b>分类列表</b>--}}
  105. <a href="{{ yzWebFullUrl('plugin.room.admin.anchor-manage.manualSend') }}">
  106. <el-button type="primary" style="margin-left:30px;" size="mini">手动赠送</el-button></a>
  107. </div>
  108. </div>
  109. </div>
  110. <template style="margin-top:-10px;">
  111. <el-table :data="tableData" style="padding:0 10px">
  112. <el-table-column prop="id" align="center" label="ID">
  113. </el-table-column>
  114. <el-table-column align="center" label="会员">
  115. <template slot-scope="scope">
  116. <div v-if="scope.row.nickname">
  117. <img :src="scope.row.avatar" style="width:30px;height:30px;padding:1px;border:1px solid #ccc;">
  118. <div>[[scope.row.nickname]]</div>
  119. </div>
  120. </template>
  121. </el-table-column>
  122. <el-table-column prop="level_name" align="center" label="授权码等级">
  123. </el-table-column>
  124. <el-table-column prop="sort" align="center" label="授权码数量">
  125. <template slot-scope="scope">
  126. <el-popover class="item" placement="top" effect="light">
  127. <div style="text-align:center;">
  128. <el-input v-model="change_code_num" size="small"
  129. style="width:100px;"></el-input>
  130. <el-button size="small" @click="confirmChangeCodeNum(scope.row.id)" >确定
  131. </el-button>
  132. </div>
  133. <i ref="icon" class="el-icon-edit edit-i" style="color:#29BA9C;cursor:pointer;" title="点击编辑排序" @click="editTitle(scope.$index,'code_num')" slot="reference"></i>
  134. </el-popover>
  135. [[scope.row.code_num]]
  136. </template>
  137. <el-popover placement="right" width="400" trigger="click">
  138. 123
  139. </el-popover>
  140. </el-table-column>
  141. <el-table-column align="center" label="记录">
  142. <template slot-scope="scope" >
  143. <a :href="'{{ yzWebFullUrl('plugin.room.admin.anchor-manage.codeDetail', array('id' => '')) }}'+[[scope.row.id]]" style="color:#999">查看明细</a>
  144. </template>
  145. </el-table-column>
  146. </el-table>
  147. </template>
  148. <el-row style="background-color:#fff;">
  149. <el-col :span="24" align="center" migra style="padding:15px 5% 15px 0" v-loading="loading">
  150. <el-pagination background @current-change="currentChange"
  151. :current-page="current_page"
  152. layout="prev, pager, next"
  153. :page-size="Number(page_size)" :current-page="current_page" :total="page_total"></el-pagination>
  154. </el-col>
  155. </el-row>
  156. </div>
  157. </div>
  158. </div>
  159. <script>
  160. var vm = new Vue({
  161. el: "#re_content",
  162. delimiters: ['[[', ']]'],
  163. data() {
  164. let level={!!$level?:'{}' !!}
  165. //console.log(level);
  166. return {
  167. change_code_num:'',
  168. table_loading:false,
  169. loading:false,
  170. search_loading:false,
  171. all_loading:false,
  172. page_total:0,
  173. page_size:0,
  174. current_page:0,
  175. search_form:{
  176. keyword:'',
  177. code_level_id:'',
  178. },
  179. real_search_form:{},
  180. tableData: [],
  181. options:level,
  182. }
  183. },
  184. mounted () {
  185. this.search();
  186. },
  187. methods: {
  188. // 确认修改排序
  189. confirmChangeCodeNum(id) {
  190. let that = this;
  191. if (!(/^\d+$/.test(that.change_code_num))) {
  192. that.$message.error('请输入正确数字');
  193. return false;
  194. }
  195. that.table_loading = true;
  196. let json = {id: id, number: that.change_code_num};
  197. let loading = this.$loading({target:document.querySelector(".content"),background: 'rgba(0, 0, 0, 0)'});
  198. that.$http.post("{!! yzWebFullUrl('plugin.room.admin.anchor-manage.codeUpdate') !!}", json).then(response => {
  199. console.log(response);
  200. if (response.data.result == 1) {
  201. that.$message.success('操作成功!');
  202. loading.close();
  203. location.reload();
  204. } else {
  205. that.$message.error(response.data.msg);
  206. }
  207. that.table_loading = false;
  208. }), function (res) {
  209. console.log(res);
  210. that.table_loading = false;
  211. };
  212. },
  213. // 编辑商品标题
  214. editTitle(index, type) {
  215. let that = this;
  216. if (type == 'code_num') {
  217. that.change_code_num = "";
  218. that.change_code_num = that.tableData[index].code_num;
  219. }
  220. },
  221. search() {
  222. this.search_loading = true;
  223. let json={
  224. search:this.search_form,
  225. }
  226. this.$http.post('{!! yzWebFullUrl('plugin.room.admin.anchor-manage.codeListSearch') !!}',json
  227. ).then(function (response) {
  228. if (response.data.result){
  229. let datas = response.data.data.list;
  230. this.tableData=datas.data
  231. this.page_total = datas.total;
  232. this.page_size = datas.per_page;
  233. this.current_page = datas.current_page;
  234. this.loading = false;
  235. this.real_search_form=Object.assign({},this.search_form);
  236. }
  237. else {
  238. this.$message({message: response.data.msg,type: 'error'});
  239. }
  240. this.search_loading = false;
  241. },function (response) {
  242. this.search_loading = false;
  243. this.$message({message: response.data.msg,type: 'error'});
  244. }
  245. );
  246. },
  247. currentChange(val) {
  248. this.loading = true;
  249. this.$http.post('{!! yzWebFullUrl('plugin.room.admin.anchor-manage.codeListSearch') !!}',{page:val,search:this.real_search_form}).then(function (response){
  250. if (response.data.result){
  251. let datas = response.data.data.list;
  252. this.tableData=datas.data
  253. this.page_total = datas.total;
  254. this.page_size = datas.per_page;
  255. this.current_page = datas.current_page;
  256. this.loading = false;
  257. } else {
  258. this.$message({message: response.data.msg,type: 'error'});
  259. }
  260. },function (response) {
  261. console.log(response);
  262. this.loading = false;
  263. }
  264. );
  265. },
  266. codeBasic() {
  267. window.location.href = "{!! yzWebFullUrl('plugin.room.admin.anchor-manage.basicCode') !!}";
  268. },
  269. code() {
  270. window.location.href = "{!! yzWebFullUrl('plugin.room.admin.anchor-manage.codeList') !!}";
  271. },
  272. codeLog() {
  273. window.location.href = "{!! yzWebFullUrl('plugin.room.admin.anchor-manage.usageRecord') !!}";
  274. },
  275. },
  276. });
  277. </script>
  278. @endsection