index.php 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204
  1. <div id="app" v-cloak>
  2. <el-card shadow="never" style="border:0;" body-style="background-color: #f3f3f3;padding: 10px 0 0;">
  3. <div slot="header">
  4. <div style="display:flex;align-items:center;justify-content:space-between;">
  5. <span>店铺列表</span>
  6. <el-button type="success" size="small" @click="edit(0)">新增</el-button>
  7. </div>
  8. </div>
  9. <div class="table-body">
  10. <template>
  11. <el-table :data="list" v-loading="listLoading">
  12. <!-- 空数据 -->
  13. <template slot="empty">
  14. <el-empty description="暂无店铺数据"></el-empty>
  15. </template>
  16. <el-table-column prop="id" align="center" label="店铺ID" width="100px">
  17. </el-table-column>
  18. <el-table-column prop="name" align="center" label="店铺名称">
  19. </el-table-column>
  20. <el-table-column prop="name" align="center" label="退货联系人">
  21. <template slot-scope="scope">
  22. {{ scope.row.contact_person }}
  23. </template>
  24. </el-table-column>
  25. <el-table-column prop="name" align="center" label="退货联系电话">
  26. <template slot-scope="scope">
  27. {{ scope.row.phone }}
  28. </template>
  29. </el-table-column>
  30. <el-table-column prop="name" align="center" label="退货地址">
  31. <template slot-scope="scope">
  32. {{ scope.row.province }}{{ scope.row.city }}{{ scope.row.district }}{{ scope.row.address }}
  33. </template>
  34. </el-table-column>
  35. <!-- <el-table-column prop="wechat_appid" align="center" label="微信视频小店APPID">-->
  36. <!-- </el-table-column>-->
  37. <!-- <el-table-column prop="wechat_secret" align="center" label="微信视频小店密钥">-->
  38. <!-- </el-table-column>-->
  39. <!-- <el-table-column prop="wechat_token" align="center" label="微信视频小店消息推送令牌(Token)">-->
  40. <!-- </el-table-column>-->
  41. <!-- <el-table-column prop="wechat_aes_key" align="center" label="微信视频小店消息加密密钥">-->
  42. <!-- </el-table-column>-->
  43. <el-table-column prop="created_at" label="授权时间" align="center">
  44. <template slot-scope="scope">
  45. {{ scope.row.created_at|dateTimeFormat('Y-m-d') }}
  46. </template>
  47. </el-table-column>
  48. <el-table-column label="状态" align="center" width="120px">
  49. <template slot-scope="scope">
  50. <el-tag size="mini" :type="scope.row.is_auth == 1 ? 'success' : 'danger'">
  51. {{scope.row.is_auth == 1 ? '授权成功' : '还未授权'}}
  52. </el-tag>
  53. </template>
  54. </el-table-column>
  55. <el-table-column prop="right_btn" label="操作" align="center">
  56. <template slot-scope="scope">
  57. <el-button class="expected-font-size" @click="edit(scope.row.id)" type="text">编辑</el-button>
  58. <!-- <el-button @click="copyCallbackUrl(scope.row.callback_url)" type="text" class="copy-btn expected-font-size">复制回调地址</el-button> -->
  59. </template>
  60. </el-table-column>
  61. </el-table>
  62. </template>
  63. <!-- 分页 -->
  64. <el-row type="flex" class="page" justify="end">
  65. <el-pagination v-if="pagination" :page-size="pagination.defaultPageSize" style="display: inline-block;" background @current-change="pageChange" layout="prev, pager, next" :total="pagination.totalCount">
  66. </el-pagination>
  67. </el-row>
  68. </div>
  69. </el-card>
  70. </div>
  71. <script src="/resources/unpkg/clipboard@1.5.12/dist/clipboard.min.js"></script>
  72. <script>
  73. const app = new Vue({
  74. el: '#app',
  75. data() {
  76. return {
  77. searchData: {
  78. name: '',
  79. },
  80. list: [],
  81. pageCount: 0,
  82. page: 1,
  83. currentPage: null,
  84. listLoading: false,
  85. btnLoading: false,
  86. checked: false,
  87. type: '',
  88. sort: '',
  89. isShow: 0,
  90. };
  91. },
  92. methods: {
  93. // 全选
  94. allSelect() {
  95. if (this.checked) {
  96. this.goods_list.forEach(function(item, index) {
  97. if (!item.storage) {
  98. item.is_select = true
  99. }
  100. })
  101. } else {
  102. this.goods_list.forEach(function(item, index) {
  103. item.is_select = false
  104. })
  105. }
  106. },
  107. //搜索
  108. onSubmit() {
  109. this.page = 1
  110. this.getList()
  111. },
  112. pagination(currentPage) {
  113. this.page = currentPage
  114. this.getList()
  115. },
  116. getList() {
  117. this.listLoading = true;
  118. var param = {
  119. r: 'wechat-video-shop/shop/index',
  120. page: this.page,
  121. limit: 10
  122. }
  123. Object.assign(param, param, this.searchData)
  124. request({
  125. params: param,
  126. }).then(e => {
  127. if (e.data.code === 0) {
  128. this.list = e.data.data.list
  129. this.pageCount = e.data.data.page_count
  130. this.currentPage = e.data.data.pagination.current_page
  131. } else {
  132. this.$message.error(e.data.msg)
  133. }
  134. this.listLoading = false
  135. }).catch(e => {
  136. this.listLoading = false
  137. })
  138. },
  139. // 编辑
  140. edit(id) {
  141. navigateTo({
  142. r: 'wechat-video-shop/shop/edit',
  143. id: id
  144. })
  145. },
  146. // 复制回调地址
  147. copyCallbackUrl(url) {
  148. let clipboard = new ClipboardJS('.copy-btn', {
  149. text: function() {
  150. return url;
  151. }
  152. });
  153. let _this = this;
  154. clipboard.on('success', (e) => {
  155. _this.$message.success('复制成功!');
  156. e.clearSelection()
  157. clipboard.destroy()
  158. });
  159. clipboard.on('error', (e) => {
  160. _this.$message.error('复制失败!');
  161. clipboard.destroy()
  162. });
  163. },
  164. },
  165. mounted: function() {
  166. this.page = getQuery('page') ? getQuery('page') : 1
  167. this.getList()
  168. }
  169. });
  170. </script>
  171. <style>
  172. .el-input__inner {
  173. height: 32px;
  174. line-height: 32px;
  175. font-size: 13px;
  176. }
  177. .expected-font-size {
  178. font-size: 13px;
  179. }
  180. .el-table th>.cell {
  181. color: #333;
  182. font-weight: bold;
  183. font-size: 14px;
  184. }
  185. .el-table__footer-wrapper,
  186. .el-table__header-wrapper {
  187. border-bottom: 1.4px solid #D6D6D6;
  188. }
  189. .price_col {
  190. color: #FF5D05;
  191. }
  192. </style>