| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332 |
- <style>
- .table-body {
- padding: 20px 20px;
- background-color: #fff;
- }
- .table-body .top-input {
- margin-top: 34px;
- }
- .input-item {
- width: 200px;
- margin-right: 20px;
- }
- .input-item .el-input__inner {
- border-right: 0;
- }
- .input-item .el-input__inner:hover {
- border: 1px solid #dcdfe6;
- border-right: 0;
- outline: 0;
- }
- .input-item .el-input__inner:focus {
- border: 1px solid #dcdfe6;
- border-right: 0;
- outline: 0;
- }
- .input-item .el-input-group__append {
- background-color: #fff;
- border-left: 0;
- width: 10%;
- padding: 0;
- }
- .input-item .el-input-group__append .el-button {
- padding: 0;
- }
- .input-item .el-input-group__append .el-button {
- margin: 0;
- }
- /* #app .table-body .el-table .el-button {
- border-radius: 16px;
- } */
- .create {
- height: 36px;
- line-height: 36px;
- float: right;
- color: #BCBCBC;
- margin-left: 20px;
- }
- .name {
- cursor: pointer;
- color: #49A9FF;
- }
- /* 卡片 */
- .plugin-list {
- margin: 0 0 0 -20px;
- /* padding-right: 100px; */
- display: flex;
- flex-wrap: wrap;
- }
- .plugin-list .plugin-item {
- width: 20%;
- min-width: 400px;
- }
- .plugin-item {
- border: 1px solid #ebebeb;
- background: #FFFFFF;
- box-shadow: 3px 5px 15px rgba(80, 80, 80, 0.16);
- opacity: 1;
- border-radius: 5px;
- padding: 20px;
- margin: 0 0 20px 20px;
- transition: 250ms;
- position: relative;
- /* min-width: 300px; */
- }
- .plugin-item .item-status {
- position: absolute;
- top: 0;
- right: 0;
- width: 94px;
- height: 30px;
- background: #E8EAEC;
- opacity: 1;
- border-radius: 0px 5px 0px 5px;
- font-size: 14px;
- font-family: Microsoft YaHei;
- font-weight: 400;
- line-height: 30px;
- color: #9398A4;
- text-align: center;
- }
- .item-status-permanent {
- width: 94px;
- }
- .item-status-effective {
- width: 164px;
- }
- .plugin-item .item-info {
- display: flex;
- align-items: center;
- }
- /* .plugin-item .item-info .item-right{
- min-width: 500px;
- } */
- .plugin-item .item-btns {
- display: flex;
- align-items: center;
- justify-content: flex-end;
- margin-top: 12px;
- }
- .plugin-item .mall-logo {
- width: 70px;
- height: 70px;
- margin-right: 12px;
- }
- .plugin-item .mall-logo img {
- width: 100%;
- height: 100%;
- display: block;
- border-radius: 50%;
- }
- .plugin-item .display-name {
- font-size: 18pt;
- margin-top: 10px;
- margin-bottom: 4px;
- font-family: Microsoft YaHei;
- font-weight: bold;
- line-height: 30px;
- color: #3F495D;
- opacity: 1;
- width: 200px;
- white-space: nowrap;
- overflow: hidden;
- text-overflow: ellipsis;
- }
- .plugin-item .name {
- color: #909399;
- }
- .plugin-item:hover {
- cursor: pointer;
- border-color: #bfddff;
- }
- .notinstall .el-checkbox.is-bordered+.el-checkbox.is-bordered {
- margin:5px 10px 5px 0px;
- }
- .notinstall .el-checkbox {
- margin-right: 10px;
- }
- </style>
- <div id="app" v-cloak>
- <el-card shadow="never" style="border:0" body-style="background-color: #f3f3f3;padding: 0;">
- <div class="table-body">
- <el-form :inline="true" size="small" class="demo-form-inline">
- <el-form-item label="">
- <el-input @keyup.enter.native="search" size="small" placeholder="请输入商城名称" type="text" clearable @clear="search" v-model="searchForm.keyword">
- <el-button slot="append" @click="search" icon="el-icon-search"></el-button>
- </el-input>
- </el-form-item>
- <el-form-item label="">
- <el-input @keyup.enter.native="search" size="small" placeholder="请输入手机号" type="text" clearable @clear="search" v-model="searchForm.mobile">
- <el-button slot="append" @click="search" icon="el-icon-search"></el-button>
- </el-input>
- </el-form-item>
- </el-form>
- <div class="plugin-list" v-loading="loading">
- <template v-for="(plugin,index) in list">
- <div class="plugin-item">
- <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>
- <div class="item-info">
- <div class="mall-logo">
- <img :src="plugin.logo" alt="">
- </div>
- <div class="item-right">
- <div class="display-name">{{plugin.name}}</div>
- <div flex="box:last">
- <div class="name" v-if="plugin.admin">使用者:{{plugin.admin.username}}</div>
- </div>
- <div flex="box:last">
- <div class="name">ID:{{plugin.id}}</div>
- </div>
- <div flex="box:last">
- <div class="name">签名:{{plugin.mall_sign}}</div>
- </div>
- <div flex="box:last">
- <div v-if="plugin.expired_at=='0'" class="name">期限:永久</div>
- <div v-else class="name">期限:{{plugin.expired_at|filterDate}}</div>
- </div>
- </div>
- </div>
- <div class="item-btns">
- <el-button v-if="admin_type==1" type="primary" size="mini" @click="restore(plugin)" >商城恢复
- </div>
- </div>
- </template>
- </div>
- <div style="text-align: right;margin: 20px 0;">
- <el-pagination @current-change="pageChange" background layout="prev, pager, next" :page-count="page_count"></el-pagination>
- </div>
- </div>
- </el-card>
- </div>
- <script>
- new Vue({
- el: '#app',
- data() {
- return {
- admin_type:0,
- addons_combo_data:[],
- keyword: '',
- searchForm: {
- keyword: '',
- mobile: '',
- },
- searchLoading: false,
- list: [],
- page_count: null,
- loading: false,
- mallListPage: 1, //默认请求第一页数据
- user: _baseUrl + '/resources/img/admin/mall-logo.png',
- addons_combo:[],
- }
- },
- created() {
- this.loadList({});
- },
- methods: {
- // 2.0 获取列表数据
- loadList(params) {
- params['r'] = 'admin/mall/recovery';
- params['keyword'] = this.searchForm.keyword;
- params['mobile'] = this.searchForm.mobile;
- params['date'] = this.searchForm.date;
- params['is_recycle'] = this.searchForm.isRecycle;
- params['user_id'] = getQuery('user_id');
- params['page'] = this.mallListPage;
- params['limit'] = 12;
- this.searchLoading = true;
- this.$request({
- params: params,
- }).then(e => {
- this.searchLoading = false;
- if (e.data.code === 0) {
- this.list = e.data.data.list;
- this.admin_type = e.data.data.admin_type;
- this.page_count = e.data.data.page_count;
- this.addons_combo_data = e.data.data.addons_combo_data;
- this.showCopyright = e.data.data.showCopyright;
- if (!isEmpty(e.data.data.addons_combo)) this.addons_combo = e.data.data.addons_combo;
- }
- }).catch(e => {});
- },
- search() {
- this.loadList({});
- },
- pageChange(page) {
- this.mallListPage = page;
- this.loadList({
- page: page,
- });
- },
- // 恢复
- restore(row) {
- this.$confirm('是否对该商场进行恢复处理, 是否继续?', '警告', {type: 'warning'}).then(() => {
- this.$request({
- params: {r: 'admin/mall/update'},
- method: 'post',
- data: {is_recycle: 0, id: row.id},
- }).then(e => {
- if (e.data.code === 0) {
- this.$message.success(e.data.msg);
- this.loadList({});
- } else {
- this.$message.error(e.data.msg);
- }
- }).catch(e => {
- });
- });
- },
- },
- filters: {
- // 只保留年月日
- filterDate(value) {
- var value = parseInt(value)*1000;
- if (value != 0) {
- let valueResult = new Date(value).getTime(); //转毫秒
- let timestamp = Date.parse(new Date()); //当前毫秒时间戳
- let date = new Date(value);
- let y = date.getFullYear();
- let MM = date.getMonth() + 1;
- MM = MM < 10 ? ('0' + MM) : MM;
- let d = date.getDate();
- d = d < 10 ? ('0' + d) : d;
- if (valueResult * 1 > timestamp * 1) {
- return y + '-' + MM + '-' + d;
- } else {
- return '已过期(' + y + '-' + MM + '-' + d + ')';
- }
- }
- },
- },
- });
- </script>
|