index.php 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224
  1. <div id="app" v-cloak>
  2. <el-card shadow="never" style="border:0;min-width: 1000px;" body-style="background-color: #f3f3f3;padding: 10px 0 0;">
  3. <div slot="header">
  4. <span>短信发送日志</span>
  5. </div>
  6. <!-- 统计 -->
  7. <el-card class="box-card" style="margin-bottom: 10px;">
  8. <div class="headBox">
  9. <div class="headItem" >
  10. <div>
  11. <i class="el-icon-coin" style="font-size: 50px;margin-right: 10px;"></i>
  12. </div>
  13. <div>
  14. <div>
  15. <label slot="label">短信发送总数
  16. <el-tooltip class="item" effect="dark"
  17. content="商城短信发送总数"
  18. placement="top-start">
  19. <i class="el-icon-info"></i>
  20. </el-tooltip>
  21. </label>
  22. </div>
  23. <div style="font-weight: bold;font-size: 25px;">{{ statistic.send_total }}</div>
  24. </div>
  25. </div>
  26. <div class="headItem">
  27. <div>
  28. <i class="el-icon-coin" style="font-size: 50px;margin-right: 10px;"></i>
  29. </div>
  30. <div>
  31. <div>
  32. <label slot="label">验证码
  33. <el-tooltip placement="top">
  34. <div slot="content">
  35. 会员在商城发送验证码总数
  36. </div>
  37. <i class="el-icon-info"></i>
  38. </el-tooltip>
  39. </label>
  40. </div>
  41. <div style="font-weight: bold;font-size: 25px;">{{ statistic.captcha }}</div>
  42. </div>
  43. </div>
  44. <div class="headItem" style="background-color: #F59C6C;">
  45. <div>
  46. <i class="el-icon-coin" style="font-size: 50px;margin-right: 10px;"></i>
  47. </div>
  48. <div>
  49. <div>新用户注册</div>
  50. <div style="font-weight: bold;font-size: 25px;">{{ statistic.newuser }}</div>
  51. </div>
  52. </div>
  53. <div class="headItem" style="background-color: #1ABC9C;">
  54. <div>
  55. <i class="el-icon-coin" style="font-size: 50px;margin-right: 10px;"></i>
  56. </div>
  57. <div>
  58. <div>订单支付提醒</div>
  59. <div style="font-weight: bold;font-size: 25px;">{{ statistic.order }}</div>
  60. </div>
  61. </div>
  62. <div class="headItem" style="background-color: #6C9EF5;">
  63. <div>
  64. <i class="el-icon-coin" style="font-size: 50px;margin-right: 10px;"></i>
  65. </div>
  66. <div>
  67. <div>订单售后提醒</div>
  68. <div style="font-weight: bold;font-size: 25px;">{{ statistic.refund_order }}</div>
  69. </div>
  70. </div>
  71. </div>
  72. </el-card>
  73. <!-- 统计 -->
  74. <div class="table-body">
  75. <el-form ref="form" style="margin-bottom: 10px;" :model="search" label-width="96px" size="mini">
  76. <el-row :gutter="24">
  77. <el-col :span="4" style="padding-left: 0;" class="top_form">
  78. <el-form-item label="手机号">
  79. <el-input v-model="search.mobile" placeholder="请输入手机号" clearable></el-input>
  80. </el-form-item>
  81. </el-col>
  82. <el-col :span="6" class="top_form">
  83. <el-form-item label="ip">
  84. <el-input v-model="search.ip" placeholder="请输入ip" clearable></el-input>
  85. </el-form-item>
  86. </el-col>
  87. <el-col :span="4" class="top_form">
  88. <el-form-item label="短信类型">
  89. <el-select v-model="search.type" placeholder="请选择短信类型">
  90. <el-option v-for="(name,title) in type_arr" :label="name" :value="title" :key="name"></el-option>
  91. </el-select>
  92. </el-form-item>
  93. </el-col>
  94. <el-col :span="6">
  95. <el-button type="primary" size="mini" @click="toSearch" >搜索</el-button>
  96. <el-button type="danger" size="mini" @click="resetSearch" >清除</el-button>
  97. </el-col>
  98. </el-row>
  99. </el-form>
  100. <el-table :data="list" stripe v-loading="loading" size="small" style="margin-bottom: 15px;">
  101. <el-table-column prop="mobile" label="手机号码" align="center"></el-table-column>
  102. <el-table-column prop="ip" label="IP" align="center"></el-table-column>
  103. <el-table-column label="短信类型" prop="type" align="center">
  104. <template slot-scope="scope">
  105. <el-tag size="small">{{ type_arr[scope.row.type] }}</el-tag>
  106. </template>
  107. </el-table-column>
  108. <el-table-column label="发送时间" align="center">
  109. <template slot-scope="scope">
  110. {{scope.row.created_at|dateTimeFormat('Y-m-d H:i:s')}}
  111. </template>
  112. </el-table-column>
  113. </el-table>
  114. <div style="text-align: right;margin: 20px 0;">
  115. <el-pagination @current-change="pagination" background layout="prev, pager, next" :page-count="pageCount"></el-pagination>
  116. </div>
  117. </div>
  118. </el-card>
  119. </div>
  120. <style>
  121. /*统计样式*/
  122. .headBox {
  123. display: flex;
  124. flex-wrap: wrap;
  125. /*margin-bottom: 10px;*/
  126. color: #fff;
  127. }
  128. .headItem {
  129. width: 16%;
  130. margin:0 0.5%;
  131. height: 120px;
  132. border-radius: 10px;
  133. background-color: #F56C6C;
  134. /*margin-right: 20px;*/
  135. margin-bottom: 14px;
  136. display: flex;
  137. align-items: center;
  138. justify-content: center;
  139. }
  140. </style>
  141. <script>
  142. const app = new Vue({
  143. el: '#app',
  144. data: {
  145. loading: false,
  146. dialogVisible: false,
  147. page: 1,
  148. pageCount: 0,
  149. list: [],
  150. search: {
  151. mobile: null,
  152. ip: null,
  153. type: null,
  154. },
  155. type_arr: [],// 模块
  156. statistic:{
  157. send_total: 0,// 发送总数
  158. captcha: 0,// 验证码
  159. newuser: 0,// 新用户注册
  160. order: 0,// 订单支付提醒
  161. refund_order: 0,// 订单售后提醒
  162. }
  163. },
  164. mounted() {
  165. this.loadData();
  166. },
  167. methods: {
  168. //获取列表信息
  169. loadData() {
  170. this.loading = true;
  171. let params = {
  172. r: 'mall/sms/index',
  173. page:this.page,
  174. };
  175. params = Object.assign(params, this.search);
  176. request({
  177. params: params,
  178. method: 'get'
  179. }).then(e => {
  180. this.loading = false;
  181. if (e.data.code == 0) {
  182. this.list = e.data.data.list.list;
  183. this.type_arr = e.data.data.type_arr;
  184. if(this.page == 1) this.statistic = e.data.data.statistic;
  185. this.pageCount = e.data.data.list.page_count;
  186. this.page = e.data.data.list.page;
  187. } else {
  188. this.$message.error(e.data.msg);
  189. }
  190. }).catch(e => {
  191. this.loading = false;
  192. });
  193. },
  194. pagination(currentPage) {
  195. let self = this;
  196. self.page = currentPage;
  197. self.loadData();
  198. },
  199. //搜索
  200. toSearch() {
  201. this.page = 1;
  202. this.loadData();
  203. },
  204. //清空搜索
  205. resetSearch() {
  206. this.search = {};
  207. this.loadData();
  208. },
  209. handleClose() {
  210. this.dialogVisible = false
  211. },
  212. }
  213. });
  214. </script>