index.php 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437
  1. <?php
  2. use common\helpers\ComponentHelper;
  3. ComponentHelper::loadComponentView('com-image');
  4. ?>
  5. <div id="app" v-cloak>
  6. <el-card shadow="never" style="border:0;min-width: 1000px;"
  7. body-style="background-color: #f3f3f3;padding: 10px 0 0;">
  8. <div slot="header">
  9. <span>小店列表</span>
  10. </div>
  11. <div class="table-body">
  12. <div style="padding-bottom: 20px;">
  13. <div class="flex">
  14. <div class="flex" style="margin-right: 20px;">
  15. <div class="input-title" style="flex-shrink: 0;">小店名称</div>
  16. <el-input size="small" style="width: 130px;" placeholder="请输入门店名称"
  17. v-model="searchData.store_name"></el-input>
  18. </div>
  19. <div class="flex" style="margin-right: 20px;">
  20. <div class="input-title" style="flex-shrink: 0;">店长</div>
  21. <el-input size="small" style="width: 130px;" placeholder="请输入店长姓名"
  22. v-model="searchData.storeowner">
  23. </el-input>
  24. </div>
  25. <div class="flex" style="margin-right: 20px;">
  26. <div class="input-title" style="flex-shrink: 0;">绑定会员</div>
  27. <el-input size="small" style="width: 130px;" placeholder="请输入会员名称"
  28. v-model="searchData.nickname">
  29. </el-input>
  30. </div>
  31. <div class="item-box" flex="dir:left cross:center">
  32. <div class="label">小店状态</div>
  33. <el-select v-model="searchData.status" @change='searchs' class="select" size="small"
  34. style="width: 130px;">
  35. <el-option :key="0" label="全部" :value="0"></el-option>
  36. <el-option :key="1" label="正常" :value="1"></el-option>
  37. <el-option :key="3" label="禁用" :value="3"></el-option>
  38. </el-select>
  39. </div>
  40. <el-button style="padding: 9px 15px !important;" size="small" type="primary" @click="searchs">搜索
  41. </el-button>
  42. <el-button type="warning" @click="clereSearch"
  43. v-if="searchData.store_name || searchData.storeowner || searchData.nickname || searchData.cate_id || searchData.status"
  44. style="padding: 9px 15px !important;">清除搜索条件
  45. </el-button>
  46. </div>
  47. </div>
  48. <el-table :data="list" stripe v-loading="loading" size="small" style="margin-bottom: 15px; width: 100%">
  49. <el-table-column prop="id" label="小店ID" width="100" align="center"></el-table-column>
  50. <el-table-column label="小店名称" width="200" prop="store_name" align="center">
  51. <template slot-scope="scope">
  52. <com-image style="float: left;margin-right: 10px;" mode="aspectFill"
  53. :src="scope.row.logo_img"></com-image>
  54. <div>{{scope.row.store_name}}</div>
  55. <div>{{scope.row.shop_mobile}}</div>
  56. </template>
  57. </el-table-column>
  58. <el-table-column label="小店地址" prop="store_address" width="180" align="center">
  59. <template slot-scope="scope">
  60. <div>{{scope.row.store_address}}</div>
  61. </template>
  62. </el-table-column>
  63. <el-table-column label="会员" width="150" align="center">
  64. <template slot-scope="scope">
  65. <com-image style="float: left;margin-right: 5px;" mode="aspectFill"
  66. :src="scope.row.avatar_url"></com-image>
  67. <div>{{scope.row.nickname}}</div>
  68. <div>{{scope.row.user_mobile}}</div>
  69. </template>
  70. </el-table-column>
  71. <el-table-column label="店长姓名" prop="shop_owner" width="120" align="center">
  72. <template slot-scope="scope">
  73. <div>{{scope.row.shop_owner}}</div>
  74. </template>
  75. </el-table-column>
  76. <el-table-column label="所属业务" width="170" align="center">
  77. <template slot-scope="scope">
  78. <com-image style="float: left;margin-right: 5px;" mode="aspectFill" :src="scope.row
  79. .business.avatar_url"></com-image>
  80. <div>{{scope.row.business.nickname}}</div>
  81. <div>{{scope.row.business.mobile}}</div>
  82. </template>
  83. </el-table-column>
  84. <el-table-column label="" prop="" width="160" align="center">
  85. <template slot="header">
  86. 小店累计收入
  87. </template>
  88. <template slot-scope="scope">
  89. <div>
  90. <span style="color: #409EFF;">{{scope.row.total_money || 0}}</span><br/>
  91. </div>
  92. </template>
  93. </el-table-column>
  94. <el-table-column label="会员总数" prop="user_nums" width="100" align="center">
  95. <template slot-scope="scope">
  96. <div>
  97. {{scope.row.user_nums}}
  98. </div>
  99. </template>
  100. </el-table-column>
  101. <el-table-column label="状态" prop="store_status" width="80" align="center">
  102. <template slot-scope="scope">
  103. <div>
  104. <span>{{storeStatus[scope.row.store_status]}}</span>
  105. </div>
  106. </template>
  107. </el-table-column>
  108. <el-table-column label="创建时间" prop="user_count" width="100" align="center">
  109. <template slot-scope="scope">
  110. <div>
  111. {{scope.row.created_at | dateTimeFormat('Y-m-d H:i:s')}}
  112. </div>
  113. </template>
  114. </el-table-column>
  115. <el-table-column label="操作" style="width: 200px;" fixed="right" align="center">
  116. <template slot-scope="scope">
  117. <el-button type="text" size="small" @click="goToDetail(scope.row.id)">详情</el-button>
  118. </template>
  119. </el-table-column>
  120. </el-table>
  121. <div style="text-align: right;margin: 20px 0;">
  122. <el-pagination @current-change="pagination" background layout="prev, pager, next"
  123. :page-count="pageCount"></el-pagination>
  124. </div>
  125. </div>
  126. </el-card>
  127. </div>
  128. <script src="/resources/unpkg/clipboard@1.0.0/dist/clipboard.min.js"></script>
  129. <script>
  130. const app = new Vue({
  131. el: '#app',
  132. data: {
  133. searchData: {
  134. cate_id: 0,
  135. nickname: '',
  136. storeowner: '',
  137. store_name: '',
  138. status: 0,
  139. },
  140. currPage: 1,
  141. pageCount: 0,
  142. loading: false,
  143. store_id:0,
  144. recharge: '',
  145. dialogVisible: false,
  146. dialogSendVisible: false,
  147. btnLoading:false,
  148. recharge_list: [],
  149. list: [],
  150. dialogLoading: false,
  151. // exportList: [],
  152. categorys: [],
  153. storeStatus: {
  154. 1: '正常',
  155. 2: '过期',
  156. 3: '禁用',
  157. 4: '冻结',
  158. },
  159. store_login_url: '', // 门店登录 url
  160. store_collection_url: '', // 门店收款码链接
  161. shareData: {
  162. url: "", //链接
  163. img: "", //二维码
  164. qrcode_filename: '', // 二维码文件名
  165. },
  166. applet_url: '',
  167. },
  168. mounted() {
  169. this.loadData();
  170. },
  171. methods: {
  172. searchs() {
  173. this.currPage = 1;
  174. this.loadData();
  175. },
  176. clereSearch() {
  177. this.searchData.cate_id = 0;
  178. this.searchData.nickname = '';
  179. this.searchData.storeowner = '';
  180. this.searchData.store_name = '';
  181. this.searchData.status = 0;
  182. this.currPage = 1;
  183. this.loadData();
  184. },
  185. loadData() {
  186. this.loading = true;
  187. request({
  188. params: {
  189. r: 'happiness/agent/store/index',
  190. page: this.currPage,
  191. ...this.searchData,
  192. },
  193. method: 'get',
  194. }).then(e => {
  195. this.loading = false;
  196. if (e.data.code == 0) {
  197. this.list = e.data.data.list;
  198. this.store_login_url = e.data.data.store_login_url;
  199. this.store_collection_url = e.data.data.store_collection_url;
  200. this.pageCount = e.data.data.page_count;
  201. this.edit_status = e.data.data.edit_status;
  202. this.categorys = e.data.data.cate_list;
  203. this.recharge_list = e.data.data.recharge_list;
  204. console.log(this.recharge_list)
  205. } else {
  206. this.$message.error(e.data.msg);
  207. }
  208. }).catch(e => {
  209. this.loading = false;
  210. });
  211. },
  212. pagination(currentPage) {
  213. let self = this;
  214. self.currPage = currentPage;
  215. self.loadData();
  216. },
  217. // 跳转门店详情页
  218. goToDetail(id) {
  219. navigateTo({
  220. r: 'happiness/agent/store/detail',
  221. store_id: id,
  222. });
  223. },
  224. }
  225. });
  226. var clipboard = new ClipboardJS('#copy_btn');
  227. var self = this;
  228. clipboard.on('success', function (e) {
  229. self.ELEMENT.Message.success('复制成功');
  230. e.clearSelection();
  231. });
  232. clipboard.on('error', function (e) {
  233. self.ELEMENT.Message.success('复制失败,请手动复制');
  234. });
  235. </script>
  236. <style>
  237. .el-tabs__header {
  238. font-size: 16px;
  239. }
  240. .table-body {
  241. padding: 20px;
  242. background-color: #fff;
  243. }
  244. .input-item {
  245. width: 250px;
  246. margin-right: 40px;
  247. }
  248. .input-item .el-input__inner {
  249. border-right: 0;
  250. }
  251. .input-item .el-input__inner:hover {
  252. border: 1px solid #dcdfe6;
  253. border-right: 0;
  254. outline: 0;
  255. }
  256. .input-item .el-input__inner:focus {
  257. border: 1px solid #dcdfe6;
  258. border-right: 0;
  259. outline: 0;
  260. }
  261. .input-item .el-input-group__append {
  262. background-color: #fff;
  263. border-left: 0;
  264. width: 10%;
  265. padding: 0;
  266. }
  267. .input-item .el-input-group__append .el-button {
  268. padding: 0;
  269. }
  270. .input-item .el-input-group__append .el-button {
  271. margin: 0;
  272. }
  273. .table-body {
  274. padding: 20px;
  275. background-color: #fff;
  276. }
  277. .table-body .el-button {
  278. padding: 0 !important;
  279. border: 0;
  280. margin: 0 5px;
  281. }
  282. .input-item {
  283. width: 250px;
  284. margin: 0 0 20px;
  285. display: inline-block;
  286. }
  287. .input-item .el-input__inner {
  288. border-right: 0;
  289. }
  290. .input-item .el-input__inner:hover {
  291. border: 1px solid #dcdfe6;
  292. border-right: 0;
  293. outline: 0;
  294. }
  295. .input-item .el-input__inner:focus {
  296. border: 1px solid #dcdfe6;
  297. border-right: 0;
  298. outline: 0;
  299. }
  300. .input-item .el-input-group__append {
  301. background-color: #fff;
  302. border-left: 0;
  303. width: 10%;
  304. padding: 0;
  305. }
  306. .input-item .el-input-group__append .el-button {
  307. padding: 0;
  308. }
  309. .input-item .el-input-group__append .el-button {
  310. margin: 0;
  311. }
  312. .batch {
  313. margin: 0 0 20px;
  314. display: inline-block;
  315. }
  316. .batch .el-button {
  317. padding: 9px 15px !important;
  318. }
  319. .el-table th > .cell {
  320. color: #333;
  321. font-weight: bold;
  322. font-size: 14px;
  323. }
  324. .el-table__footer-wrapper,
  325. .el-table__header-wrapper {
  326. border-bottom: 1.4px solid #D6D6D6;
  327. }
  328. .el-table .el-button {
  329. padding: 0 !important;
  330. border: 0;
  331. margin: 0 5px;
  332. }
  333. #app .copy .el-input-group__append {
  334. background-color: #409EFF;
  335. border-color: #409EFF;
  336. padding: 0 10px;
  337. }
  338. #app .table-body .copybtn {
  339. color: #fff;
  340. padding: 0 30px;
  341. }
  342. .el-alert {
  343. padding: 0;
  344. padding-left: 5px;
  345. padding-bottom: 5px;
  346. }
  347. .el-alert--info .el-alert__description {
  348. color: #606266;
  349. }
  350. .el-alert .el-button {
  351. margin-left: 20px;
  352. }
  353. .el-alert__content {
  354. display: flex;
  355. align-items: center;
  356. }
  357. .table-body .el-alert__title {
  358. margin-top: 5px;
  359. font-weight: 400;
  360. }
  361. .el-table th > .cell {
  362. color: #333;
  363. font-weight: bold;
  364. font-size: 14px;
  365. }
  366. .el-table__footer-wrapper,
  367. .el-table__header-wrapper {
  368. border-bottom: 1.4px solid #D6D6D6;
  369. }
  370. .item-box {
  371. margin-right: 20px;
  372. }
  373. .flex {
  374. display: flex;
  375. align-items: center;
  376. }
  377. .input-title {
  378. margin-right: 15px;
  379. }
  380. .item-box .label {
  381. margin-right: 8px;
  382. }
  383. .com-share-pop {
  384. display: inline-block;
  385. }
  386. .grid-icon {
  387. color: #999;
  388. cursor: pointer;
  389. font-size: 18px;
  390. }
  391. </style>