| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204 |
- <div id="app" v-cloak>
- <el-card shadow="never" style="border:0;" body-style="background-color: #f3f3f3;padding: 10px 0 0;">
- <div slot="header">
- <div style="display:flex;align-items:center;justify-content:space-between;">
- <span>店铺列表</span>
- <el-button type="success" size="small" @click="edit(0)">新增</el-button>
- </div>
- </div>
- <div class="table-body">
- <template>
- <el-table :data="list" v-loading="listLoading">
- <!-- 空数据 -->
- <template slot="empty">
- <el-empty description="暂无店铺数据"></el-empty>
- </template>
- <el-table-column prop="id" align="center" label="店铺ID" width="100px">
- </el-table-column>
- <el-table-column prop="name" align="center" label="店铺名称">
- </el-table-column>
- <el-table-column prop="name" align="center" label="退货联系人">
- <template slot-scope="scope">
- {{ scope.row.contact_person }}
- </template>
- </el-table-column>
- <el-table-column prop="name" align="center" label="退货联系电话">
- <template slot-scope="scope">
- {{ scope.row.phone }}
- </template>
- </el-table-column>
- <el-table-column prop="name" align="center" label="退货地址">
- <template slot-scope="scope">
- {{ scope.row.province }}{{ scope.row.city }}{{ scope.row.district }}{{ scope.row.address }}
- </template>
- </el-table-column>
- <!-- <el-table-column prop="wechat_appid" align="center" label="微信视频小店APPID">-->
- <!-- </el-table-column>-->
- <!-- <el-table-column prop="wechat_secret" align="center" label="微信视频小店密钥">-->
- <!-- </el-table-column>-->
- <!-- <el-table-column prop="wechat_token" align="center" label="微信视频小店消息推送令牌(Token)">-->
- <!-- </el-table-column>-->
- <!-- <el-table-column prop="wechat_aes_key" align="center" label="微信视频小店消息加密密钥">-->
- <!-- </el-table-column>-->
- <el-table-column prop="created_at" label="授权时间" align="center">
- <template slot-scope="scope">
- {{ scope.row.created_at|dateTimeFormat('Y-m-d') }}
- </template>
- </el-table-column>
- <el-table-column label="状态" align="center" width="120px">
- <template slot-scope="scope">
- <el-tag size="mini" :type="scope.row.is_auth == 1 ? 'success' : 'danger'">
- {{scope.row.is_auth == 1 ? '授权成功' : '还未授权'}}
- </el-tag>
- </template>
- </el-table-column>
- <el-table-column prop="right_btn" label="操作" align="center">
- <template slot-scope="scope">
- <el-button class="expected-font-size" @click="edit(scope.row.id)" type="text">编辑</el-button>
- <!-- <el-button @click="copyCallbackUrl(scope.row.callback_url)" type="text" class="copy-btn expected-font-size">复制回调地址</el-button> -->
- </template>
- </el-table-column>
- </el-table>
- </template>
- <!-- 分页 -->
- <el-row type="flex" class="page" justify="end">
- <el-pagination v-if="pagination" :page-size="pagination.defaultPageSize" style="display: inline-block;" background @current-change="pageChange" layout="prev, pager, next" :total="pagination.totalCount">
- </el-pagination>
- </el-row>
- </div>
- </el-card>
- </div>
- <script src="/resources/unpkg/clipboard@1.5.12/dist/clipboard.min.js"></script>
- <script>
- const app = new Vue({
- el: '#app',
- data() {
- return {
- searchData: {
- name: '',
- },
- list: [],
- pageCount: 0,
- page: 1,
- currentPage: null,
- listLoading: false,
- btnLoading: false,
- checked: false,
- type: '',
- sort: '',
- isShow: 0,
- };
- },
- methods: {
-
- // 全选
- allSelect() {
- if (this.checked) {
- this.goods_list.forEach(function(item, index) {
- if (!item.storage) {
- item.is_select = true
- }
- })
- } else {
- this.goods_list.forEach(function(item, index) {
- item.is_select = false
- })
- }
- },
- //搜索
- onSubmit() {
- this.page = 1
- this.getList()
- },
- pagination(currentPage) {
- this.page = currentPage
- this.getList()
- },
- getList() {
- this.listLoading = true;
- var param = {
- r: 'wechat-video-shop/shop/index',
- page: this.page,
- limit: 10
- }
- Object.assign(param, param, this.searchData)
- request({
- params: param,
- }).then(e => {
- if (e.data.code === 0) {
- this.list = e.data.data.list
- this.pageCount = e.data.data.page_count
- this.currentPage = e.data.data.pagination.current_page
- } else {
- this.$message.error(e.data.msg)
- }
- this.listLoading = false
- }).catch(e => {
- this.listLoading = false
- })
- },
- // 编辑
- edit(id) {
- navigateTo({
- r: 'wechat-video-shop/shop/edit',
- id: id
- })
- },
- // 复制回调地址
- copyCallbackUrl(url) {
- let clipboard = new ClipboardJS('.copy-btn', {
- text: function() {
- return url;
- }
- });
- let _this = this;
- clipboard.on('success', (e) => {
- _this.$message.success('复制成功!');
- e.clearSelection()
- clipboard.destroy()
- });
- clipboard.on('error', (e) => {
- _this.$message.error('复制失败!');
- clipboard.destroy()
- });
- },
- },
- mounted: function() {
- this.page = getQuery('page') ? getQuery('page') : 1
- this.getList()
- }
- });
- </script>
- <style>
- .el-input__inner {
- height: 32px;
- line-height: 32px;
- font-size: 13px;
- }
- .expected-font-size {
- font-size: 13px;
- }
- .el-table th>.cell {
- color: #333;
- font-weight: bold;
- font-size: 14px;
- }
- .el-table__footer-wrapper,
- .el-table__header-wrapper {
- border-bottom: 1.4px solid #D6D6D6;
- }
- .price_col {
- color: #FF5D05;
- }
- </style>
|