recovery.php 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332
  1. <style>
  2. .table-body {
  3. padding: 20px 20px;
  4. background-color: #fff;
  5. }
  6. .table-body .top-input {
  7. margin-top: 34px;
  8. }
  9. .input-item {
  10. width: 200px;
  11. margin-right: 20px;
  12. }
  13. .input-item .el-input__inner {
  14. border-right: 0;
  15. }
  16. .input-item .el-input__inner:hover {
  17. border: 1px solid #dcdfe6;
  18. border-right: 0;
  19. outline: 0;
  20. }
  21. .input-item .el-input__inner:focus {
  22. border: 1px solid #dcdfe6;
  23. border-right: 0;
  24. outline: 0;
  25. }
  26. .input-item .el-input-group__append {
  27. background-color: #fff;
  28. border-left: 0;
  29. width: 10%;
  30. padding: 0;
  31. }
  32. .input-item .el-input-group__append .el-button {
  33. padding: 0;
  34. }
  35. .input-item .el-input-group__append .el-button {
  36. margin: 0;
  37. }
  38. /* #app .table-body .el-table .el-button {
  39. border-radius: 16px;
  40. } */
  41. .create {
  42. height: 36px;
  43. line-height: 36px;
  44. float: right;
  45. color: #BCBCBC;
  46. margin-left: 20px;
  47. }
  48. .name {
  49. cursor: pointer;
  50. color: #49A9FF;
  51. }
  52. /* 卡片 */
  53. .plugin-list {
  54. margin: 0 0 0 -20px;
  55. /* padding-right: 100px; */
  56. display: flex;
  57. flex-wrap: wrap;
  58. }
  59. .plugin-list .plugin-item {
  60. width: 20%;
  61. min-width: 400px;
  62. }
  63. .plugin-item {
  64. border: 1px solid #ebebeb;
  65. background: #FFFFFF;
  66. box-shadow: 3px 5px 15px rgba(80, 80, 80, 0.16);
  67. opacity: 1;
  68. border-radius: 5px;
  69. padding: 20px;
  70. margin: 0 0 20px 20px;
  71. transition: 250ms;
  72. position: relative;
  73. /* min-width: 300px; */
  74. }
  75. .plugin-item .item-status {
  76. position: absolute;
  77. top: 0;
  78. right: 0;
  79. width: 94px;
  80. height: 30px;
  81. background: #E8EAEC;
  82. opacity: 1;
  83. border-radius: 0px 5px 0px 5px;
  84. font-size: 14px;
  85. font-family: Microsoft YaHei;
  86. font-weight: 400;
  87. line-height: 30px;
  88. color: #9398A4;
  89. text-align: center;
  90. }
  91. .item-status-permanent {
  92. width: 94px;
  93. }
  94. .item-status-effective {
  95. width: 164px;
  96. }
  97. .plugin-item .item-info {
  98. display: flex;
  99. align-items: center;
  100. }
  101. /* .plugin-item .item-info .item-right{
  102. min-width: 500px;
  103. } */
  104. .plugin-item .item-btns {
  105. display: flex;
  106. align-items: center;
  107. justify-content: flex-end;
  108. margin-top: 12px;
  109. }
  110. .plugin-item .mall-logo {
  111. width: 70px;
  112. height: 70px;
  113. margin-right: 12px;
  114. }
  115. .plugin-item .mall-logo img {
  116. width: 100%;
  117. height: 100%;
  118. display: block;
  119. border-radius: 50%;
  120. }
  121. .plugin-item .display-name {
  122. font-size: 18pt;
  123. margin-top: 10px;
  124. margin-bottom: 4px;
  125. font-family: Microsoft YaHei;
  126. font-weight: bold;
  127. line-height: 30px;
  128. color: #3F495D;
  129. opacity: 1;
  130. width: 200px;
  131. white-space: nowrap;
  132. overflow: hidden;
  133. text-overflow: ellipsis;
  134. }
  135. .plugin-item .name {
  136. color: #909399;
  137. }
  138. .plugin-item:hover {
  139. cursor: pointer;
  140. border-color: #bfddff;
  141. }
  142. .notinstall .el-checkbox.is-bordered+.el-checkbox.is-bordered {
  143. margin:5px 10px 5px 0px;
  144. }
  145. .notinstall .el-checkbox {
  146. margin-right: 10px;
  147. }
  148. </style>
  149. <div id="app" v-cloak>
  150. <el-card shadow="never" style="border:0" body-style="background-color: #f3f3f3;padding: 0;">
  151. <div class="table-body">
  152. <el-form :inline="true" size="small" class="demo-form-inline">
  153. <el-form-item label="">
  154. <el-input @keyup.enter.native="search" size="small" placeholder="请输入商城名称" type="text" clearable @clear="search" v-model="searchForm.keyword">
  155. <el-button slot="append" @click="search" icon="el-icon-search"></el-button>
  156. </el-input>
  157. </el-form-item>
  158. <el-form-item label="">
  159. <el-input @keyup.enter.native="search" size="small" placeholder="请输入手机号" type="text" clearable @clear="search" v-model="searchForm.mobile">
  160. <el-button slot="append" @click="search" icon="el-icon-search"></el-button>
  161. </el-input>
  162. </el-form-item>
  163. </el-form>
  164. <div class="plugin-list" v-loading="loading">
  165. <template v-for="(plugin,index) in list">
  166. <div class="plugin-item">
  167. <div v-if="plugin.adonsComboRelation && addons_combo_data && addons_combo_data[plugin.adonsComboRelation.addons_combo_id]" class="item-status" style="overflow: hidden;">{{ addons_combo_data[plugin.adonsComboRelation.addons_combo_id] }}</div>
  168. <div class="item-info">
  169. <div class="mall-logo">
  170. <img :src="plugin.logo" alt="">
  171. </div>
  172. <div class="item-right">
  173. <div class="display-name">{{plugin.name}}</div>
  174. <div flex="box:last">
  175. <div class="name" v-if="plugin.admin">使用者:{{plugin.admin.username}}</div>
  176. </div>
  177. <div flex="box:last">
  178. <div class="name">ID:{{plugin.id}}</div>
  179. </div>
  180. <div flex="box:last">
  181. <div class="name">签名:{{plugin.mall_sign}}</div>
  182. </div>
  183. <div flex="box:last">
  184. <div v-if="plugin.expired_at=='0'" class="name">期限:永久</div>
  185. <div v-else class="name">期限:{{plugin.expired_at|filterDate}}</div>
  186. </div>
  187. </div>
  188. </div>
  189. <div class="item-btns">
  190. <el-button v-if="admin_type==1" type="primary" size="mini" @click="restore(plugin)" >商城恢复
  191. </div>
  192. </div>
  193. </template>
  194. </div>
  195. <div style="text-align: right;margin: 20px 0;">
  196. <el-pagination @current-change="pageChange" background layout="prev, pager, next" :page-count="page_count"></el-pagination>
  197. </div>
  198. </div>
  199. </el-card>
  200. </div>
  201. <script>
  202. new Vue({
  203. el: '#app',
  204. data() {
  205. return {
  206. admin_type:0,
  207. addons_combo_data:[],
  208. keyword: '',
  209. searchForm: {
  210. keyword: '',
  211. mobile: '',
  212. },
  213. searchLoading: false,
  214. list: [],
  215. page_count: null,
  216. loading: false,
  217. mallListPage: 1, //默认请求第一页数据
  218. user: _baseUrl + '/resources/img/admin/mall-logo.png',
  219. addons_combo:[],
  220. }
  221. },
  222. created() {
  223. this.loadList({});
  224. },
  225. methods: {
  226. // 2.0 获取列表数据
  227. loadList(params) {
  228. params['r'] = 'admin/mall/recovery';
  229. params['keyword'] = this.searchForm.keyword;
  230. params['mobile'] = this.searchForm.mobile;
  231. params['date'] = this.searchForm.date;
  232. params['is_recycle'] = this.searchForm.isRecycle;
  233. params['user_id'] = getQuery('user_id');
  234. params['page'] = this.mallListPage;
  235. params['limit'] = 12;
  236. this.searchLoading = true;
  237. this.$request({
  238. params: params,
  239. }).then(e => {
  240. this.searchLoading = false;
  241. if (e.data.code === 0) {
  242. this.list = e.data.data.list;
  243. this.admin_type = e.data.data.admin_type;
  244. this.page_count = e.data.data.page_count;
  245. this.addons_combo_data = e.data.data.addons_combo_data;
  246. this.showCopyright = e.data.data.showCopyright;
  247. if (!isEmpty(e.data.data.addons_combo)) this.addons_combo = e.data.data.addons_combo;
  248. }
  249. }).catch(e => {});
  250. },
  251. search() {
  252. this.loadList({});
  253. },
  254. pageChange(page) {
  255. this.mallListPage = page;
  256. this.loadList({
  257. page: page,
  258. });
  259. },
  260. // 恢复
  261. restore(row) {
  262. this.$confirm('是否对该商场进行恢复处理, 是否继续?', '警告', {type: 'warning'}).then(() => {
  263. this.$request({
  264. params: {r: 'admin/mall/update'},
  265. method: 'post',
  266. data: {is_recycle: 0, id: row.id},
  267. }).then(e => {
  268. if (e.data.code === 0) {
  269. this.$message.success(e.data.msg);
  270. this.loadList({});
  271. } else {
  272. this.$message.error(e.data.msg);
  273. }
  274. }).catch(e => {
  275. });
  276. });
  277. },
  278. },
  279. filters: {
  280. // 只保留年月日
  281. filterDate(value) {
  282. var value = parseInt(value)*1000;
  283. if (value != 0) {
  284. let valueResult = new Date(value).getTime(); //转毫秒
  285. let timestamp = Date.parse(new Date()); //当前毫秒时间戳
  286. let date = new Date(value);
  287. let y = date.getFullYear();
  288. let MM = date.getMonth() + 1;
  289. MM = MM < 10 ? ('0' + MM) : MM;
  290. let d = date.getDate();
  291. d = d < 10 ? ('0' + d) : d;
  292. if (valueResult * 1 > timestamp * 1) {
  293. return y + '-' + MM + '-' + d;
  294. } else {
  295. return '已过期(' + y + '-' + MM + '-' + d + ')';
  296. }
  297. }
  298. },
  299. },
  300. });
  301. </script>