index.php 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462
  1. <?php
  2. /**
  3. * @link:http://www.goodmall.com/
  4. * @copyright: Copyright (c) 2022
  5. * 名片
  6. * Author: zcx
  7. * Date: 2022-09-14
  8. * Time: 16:59
  9. */
  10. ?>
  11. <div id="app" v-cloak>
  12. <el-card shadow="never" style="border:0;min-width: 1200px;" body-style="background-color: #f3f3f3;padding: 10px 0 0;">
  13. <div slot="header">
  14. <span>分红记录</span>
  15. </div>
  16. <div class="table-body">
  17. <el-form size="small" :inline="true" flex="dir:left cross:center">
  18. <div class="flex-bew">
  19. <div flex>
  20. </div>
  21. <div flex>
  22. <div class="item-box" flex="dir:left cross:center">
  23. <div class="label">关键字:</div>
  24. <el-input size="small" style="width: 200px" v-model="search.name" placeholder="请输入关键字"></el-input>
  25. </div>
  26. <div class="item-box" flex="dir:left cross:center">
  27. <div class="label">选择时间:</div>
  28. <el-date-picker style="margin-top: 1px;" size="small" clearable @change="changeTime" v-model="time" type="datetimerange" value-format="yyyy-MM-dd HH:mm:ss" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" :default-time="['00:00:00', '23:59:59']"></el-date-picker>
  29. </div>
  30. <div class="item-box" flex="dir:left cross:center">
  31. <el-button size="small" type="primary" style="padding: 9px 15px !important;" @click="searchs">
  32. <i class="el-icon-search"></i>
  33. 搜索
  34. </el-button>
  35. </div>
  36. </div>
  37. </div>
  38. </el-form>
  39. <el-tabs v-model="activeName">
  40. <el-table :data="list" stripe v-loading="loading" size="small" style="margin-bottom: 15px;"
  41. @selection-change="handleSelectionChange">
  42. <el-table-column type="selection"></el-table-column>
  43. <el-table-column label="订单号" prop="order_no" align="center" width="250" class-name="goods-name"></el-table-column>
  44. <el-table-column label="用户" prop="cate_name" min-width="160" align="center">
  45. <template slot-scope="scope" >
  46. <div flex>
  47. <image class="user-avatar" :src="scope.row.avatar_url" style="width:50px;height:50px;">
  48. <div class="flexcenter">{{scope.row.nickname }}(ID:{{scope.row.user_id}})</div>
  49. </div>
  50. </template>
  51. </el-table-column>
  52. <el-table-column label="手机号" prop="mobile" min-width="160" align="center"></el-table-column>
  53. <el-table-column label="总分红次数" prop="total_times" min-width="130" align="center"></el-table-column>
  54. <el-table-column label="已分次数" prop="divided_times" min-width="130" align="center"></el-table-column>
  55. <el-table-column label="已分总额" prop="divided_money" min-width="130" align="center"></el-table-column>
  56. <el-table-column label="来源" prop="mobile" min-width="100" align="center">
  57. <template slot-scope="scope">
  58. <div @click="source(scope.row)" :style="{color: scope.row.type == 't' || scope.row.type == 's' ?'blue':''}">{{scope.row.type == 'x' ? '直推消费':(scope.row.type == 't' ? '拉新奖励':'购买商品')}}</div>
  59. </template>
  60. </el-table-column>
  61. <el-table-column label="时间" prop="created_at" min-width="160" align="center">
  62. <template slot-scope="scope">
  63. <div>{{scope.row.created_at|dateTimeFormat('Y-m-d H:i:s')}}</div>
  64. </template>
  65. </el-table-column>
  66. <el-table-column label="退款" prop="mobile" min-width="100" align="center">
  67. <template slot-scope="scope">
  68. <div>{{scope.row.is_feedback == 1 ? '已':'未'}}</div>
  69. </template>
  70. </el-table-column>
  71. <el-table-column label="贡献值" prop="contribution" min-width="100" align="center"></el-table-column>
  72. <el-table-column
  73. fixed="right"
  74. label="操作"
  75. align="center"
  76. width="300">
  77. <template slot-scope="scope">
  78. <el-button type="text" @click="detail(scope.row)" >详情</el-button>
  79. <!--<el-button type="text" @click="source(scope.row)" v-if="scope.row.type=='t'||scope.row.type=='s'">来源</el-button>-->
  80. </template>
  81. </el-table-column>
  82. </el-table>
  83. </el-tabs>
  84. <!-- 分页器 -->
  85. <div flex="box:last cross:center">
  86. <div></div>
  87. <div>
  88. <el-pagination v-if="pagination" :page-size="pagination.defaultPageSize"
  89. style="display: inline-block;float: right;" background @current-change="pageChange"
  90. layout="prev, pager, next" :total="pagination.totalCount">
  91. </el-pagination>
  92. </div>
  93. </div>
  94. </div>
  95. </el-card>
  96. <el-dialog title="来源" :visible.sync="editGoodsDialog" width="850px">
  97. <div>
  98. <el-block v-if="editType == 's'">
  99. <el-table :data="editData" stripe v-loading="loading" size="small" style="margin-bottom: 15px;">
  100. <el-table-column label="ID" prop="id" min-width="70" align="center"></el-table-column>
  101. <el-table-column label="商品名称" prop="goods_name" min-width="160" align="center"></el-table-column>
  102. <div>
  103. <el-table-column label="规格名称" prop="goods_attr_name" min-width="160" align="center"></el-table-column>
  104. </div>
  105. <el-table-column label="数量" prop="num" min-width="130" align="center"></el-table-column>
  106. <el-table-column label="价格" prop="price" min-width="130" align="center"></el-table-column>
  107. <el-table-column label="主图" prop="pic_url" min-width="130" align="center">
  108. <template>
  109. <img :src="editData.pic_url"></img>
  110. </template>
  111. </el-table-column>
  112. </el-table>
  113. </el-block>
  114. <el-block v-if="editType == 't'">
  115. <el-table :data="editData" stripe v-loading="loading" size="small" style="margin-bottom: 15px;">
  116. <el-table-column label="ID" prop="id" min-width="130" align="center"></el-table-column>
  117. <el-table-column label="昵称" prop="nickname" min-width="160" align="center"></el-table-column>
  118. <el-table-column label="手机号" prop="mobile" min-width="130" align="center"></el-table-column>
  119. <el-table-column label="头像" prop="avatar_url" min-width="130" align="center">
  120. <template>
  121. <img :src="editData.pic_url"></img>
  122. </template>
  123. </el-table-column>
  124. </el-table>
  125. </el-block>
  126. </div>
  127. <span slot="footer" class="dialog-footer">
  128. <el-button type="primary" :loading="loading" style="margin-bottom: 10px;" size="small" @click="bossDialog=false">确定</el-button>
  129. </span>
  130. </el-dialog>
  131. </div>
  132. <script>
  133. const app = new Vue({
  134. el: '#app',
  135. data: {
  136. cForm:{
  137. goods_id:[]
  138. },
  139. cateList:[],//分类列表
  140. page:1,
  141. limit:50,
  142. time:[], //本地存时间,请求时不发送
  143. search: {
  144. name : '',
  145. status:null,
  146. start:'',
  147. end:''
  148. },
  149. time:'',
  150. loading: false,
  151. activeName: '-1',
  152. list: [], //列表数据
  153. pagination: null,
  154. choose_list:[],
  155. cateForm:{
  156. id:0,
  157. name:'',
  158. status:0
  159. },
  160. setting:{
  161. id:0,
  162. contribution:0,
  163. contribution_percent:0,
  164. profit_percent:0,
  165. profit:0,
  166. cate_id:0
  167. },
  168. editData:[],
  169. editGoodsDialog:false,
  170. editType:'x'
  171. },
  172. mounted() {
  173. // 获取列表首页数据
  174. this.loadData(this.page,this.search); //获取列表数据
  175. },
  176. methods: {
  177. detail(row){
  178. this.$navigate({
  179. r: 'blind-box/bonus-log/detail',
  180. id: row.id
  181. })
  182. },
  183. source(row){
  184. switch (row.type){
  185. case 't':
  186. this.tSource(row);
  187. this.editType = 't'
  188. break;
  189. case 's':
  190. this.sSource(row);
  191. this.editType = 's'
  192. break;
  193. case 'x':
  194. break;
  195. }
  196. },
  197. //推荐会员获得贡献值的来源
  198. tSource(row){
  199. request({
  200. params: {
  201. r: 'blind-box/bonus-log/source',
  202. },
  203. method: 'post',
  204. data: {
  205. bonus_log_id: row.id,
  206. }
  207. }).then(e => {
  208. this.loading = false;
  209. if (e.data.code === 0) {
  210. console.log(e.data.data);
  211. this.editData = e.data.data
  212. this.editGoodsDialog = true
  213. } else {
  214. this.$message.error(e.data.msg);
  215. }
  216. }).catch(e => {
  217. });
  218. },
  219. //购物消费
  220. sSource(row){
  221. request({
  222. params: {
  223. r: 'blind-box/bonus-log/source-goods',
  224. },
  225. method: 'post',
  226. data: {
  227. order_no: row.order_no,
  228. }
  229. }).then(e => {
  230. this.loading = false;
  231. if (e.data.code === 0) {
  232. this.editData = e.data.data
  233. this.editGoodsDialog = true
  234. } else {
  235. this.$message.error(e.data.msg);
  236. }
  237. }).catch(e => {
  238. });
  239. },
  240. changeTime(e){
  241. if(e == null){
  242. this.search.start = ''
  243. this.search.end = ''
  244. }else{
  245. this.search.start = e[0]
  246. this.search.end = e[1]
  247. }
  248. console.log('选择时间',e)
  249. },
  250. loadData(page,others) {
  251. this.loading = true;
  252. console.log(666,this.search);
  253. request({
  254. method: 'get',
  255. params: {
  256. r: 'blind-box/bonus-log/index',
  257. page: page,
  258. limit:this.limit,
  259. ...others, //其他搜索字段
  260. },
  261. }).then(e => {
  262. this.loading = false;
  263. if (e.data.code === 0) {
  264. this.list = e.data.data.list;
  265. console.log('this.list',this.list)
  266. this.pagination = e.data.data.pagination;
  267. } else {
  268. this.$message.error(e.data.msg);
  269. }
  270. }).catch(e => {
  271. });
  272. },
  273. pageChange(page) {
  274. this.page = page;
  275. this.loadData(this.page,this.search);
  276. },
  277. handleSelectionChange(val,type) {
  278. console.log('val',val,type)
  279. let self = this;
  280. if(type == 'row'){
  281. self.choose_list.push(val.id)
  282. self.delGoods()
  283. }else{
  284. self.choose_list = [];
  285. val.forEach(function (item) {
  286. self.choose_list.push(item.id);
  287. })
  288. }
  289. },
  290. searchs() {
  291. this.page = 1;
  292. this.loadData(this.page,this.search);
  293. },
  294. }
  295. });
  296. </script>
  297. <style>
  298. .el-tabs__header {
  299. font-size: 16px;
  300. }
  301. .table-body {
  302. padding: 20px;
  303. background-color: #fff;
  304. }
  305. .table-body .el-button {
  306. padding: 0 !important;
  307. border: 0;
  308. margin: 0 5px;
  309. }
  310. .input-item {
  311. width: 250px;
  312. margin: 0 0 20px;
  313. display: inline-block;
  314. }
  315. .input-item .el-input__inner {
  316. border-right: 0;
  317. }
  318. .input-item .el-input__inner:hover {
  319. border: 1px solid #dcdfe6;
  320. border-right: 0;
  321. outline: 0;
  322. }
  323. .input-item .el-input__inner:focus {
  324. border: 1px solid #dcdfe6;
  325. border-right: 0;
  326. outline: 0;
  327. }
  328. .input-item .el-input-group__append {
  329. background-color: #fff;
  330. border-left: 0;
  331. width: 10%;
  332. padding: 0;
  333. }
  334. .input-item .el-input-group__append .el-button {
  335. padding: 0;
  336. }
  337. .input-item .el-input-group__append .el-button {
  338. margin: 0;
  339. }
  340. .batch {
  341. margin: 0 0 20px;
  342. display: inline-block;
  343. }
  344. .batch .el-button {
  345. padding: 9px 15px !important;
  346. }
  347. .item-box{
  348. margin-right: 20px;
  349. }
  350. .item-box .label{
  351. margin-right: 8px;
  352. }
  353. .form-nickname{
  354. width: 180px;
  355. white-space:nowrap;
  356. overflow:hidden;
  357. text-overflow:ellipsis;
  358. }
  359. .index-video-url{
  360. width: 300px;
  361. }
  362. .index-video-url video{
  363. width: 100%;
  364. }
  365. .index-related-info{
  366. width: 500px;
  367. }
  368. .video-top{
  369. width: 100%;
  370. display: flex;
  371. align-items: flex-start;
  372. box-sizing: border-box;
  373. padding: 20px;
  374. /* opacity: .5; */
  375. background-color: #FFFFFF;
  376. }
  377. .video-top .top-right{
  378. line-height: 26px;
  379. }
  380. .video-top .top-right .top-title{
  381. font-size: 18px;
  382. white-space:nowrap;
  383. overflow:hidden;
  384. text-overflow:ellipsis;
  385. width: 360px;
  386. }
  387. .video-top .top-right .wrapper{
  388. display: flex;
  389. /* align-items: flex-start; */
  390. }
  391. .video-top .top-right .wrapper .to-copy{
  392. /* color: #03C5FF; */
  393. margin-left: 20px;
  394. }
  395. .video-top .top-right .detail-price{
  396. color: #BC0100;
  397. font-size: 18px;
  398. font-family: Microsoft YaHei;
  399. font-weight: bold;
  400. }
  401. /* .atooltip {
  402. background: #FFFFFF !important;
  403. border: none !important;
  404. } */
  405. .el-table th>.cell{
  406. color: #333;
  407. font-weight: bold;
  408. font-size: 14px;
  409. }
  410. .el-table__footer-wrapper, .el-table__header-wrapper{
  411. border-bottom: 1.4px solid #D6D6D6;
  412. }
  413. .award-money{
  414. color: #BC0100;
  415. }
  416. .flex-bew{
  417. display:flex;
  418. justify-content: space-between;
  419. width:100%;
  420. }
  421. .goods-name .cell{
  422. width: 250px;
  423. word-break: break-all;
  424. text-overflow: ellipsis;
  425. display: -webkit-box;
  426. -webkit-box-orient: vertical;
  427. -webkit-line-clamp: 2; /* 这里是超出几行省略 */
  428. overflow: hidden;
  429. }
  430. .flexcenter{
  431. display: flex;
  432. justify-content: center;
  433. align-items: center;
  434. }
  435. .user-avatar{
  436. border-radius:50%;
  437. margin-right:5px;
  438. }
  439. </style>