8e532b294d6269eee2427cc8ec5d40d41ec4a87c.svn-base 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345
  1. <template>
  2. <div>
  3. <div class="abstract">
  4. <div class="abstract-title pdg20">已结算注单</div>
  5. <div class="abstract-date pdg20 row item-center">
  6. <div class="row item-center">
  7. <p style="color:#666;">开始日期</p>
  8. <input type="date">
  9. </div>
  10. <div class="row item-center" style="margin:0 .2rem;">
  11. <p style="color:#666;">结束日期</p>
  12. <input type="date">
  13. </div>
  14. <button @click="category(1)">查询单式投注</button>
  15. <button @click="category(2)">查询串式投注</button>
  16. </div>
  17. <div class="abstract-options row allAlignment">
  18. <div class="row">
  19. <div class="row center" @click="options(3)" :class="optionsActive==3?'active':''">过去30天</div>
  20. <div class="row center" @click="options(2)" :class="optionsActive==2?'active':''">昨日</div>
  21. <div class="row center" @click="options(1)" :class="optionsActive==1?'active':''">今日</div>
  22. </div>
  23. </div>
  24. <div class="abstract-box scroll">
  25. <yd-infinitescroll :callback="loadList" ref="infinitescrollDemo">
  26. <yd-list theme="5" slot="list">
  27. <yd-list-item>
  28. <yd-list-other slot="other">
  29. <div v-for="(item,index) in list" :key="index">
  30. <div
  31. v-if="item.result == 1 || item.result == 2"
  32. style="border-left:.01rem solid #ccc;border-top:.01rem solid #ccc;border-right:.01rem solid #ccc;"
  33. >
  34. <div class="title row item-center allAlignment">
  35. <p style="width:10%">编号</p>
  36. <p style="width:10%">类别</p>
  37. <p style="width:20%">投注详情</p>
  38. <p style="width:10%">投注类别</p>
  39. <p style="width:22%">选项</p>
  40. <p style="width:10%">投注额</p>
  41. <p style="width:10%">赢 / 输</p>
  42. <p style="width:8%">状态</p>
  43. </div>
  44. <ul class="list row">
  45. <li style="width:10%">{{++index}}</li>
  46. <li style="width:10%">体育</li>
  47. <li style="width:20%">
  48. <p>{{item.ctime}}</p>
  49. <p>{{item.order_id}}</p>
  50. </li>
  51. <li style="width:10%">{{item.odds_name}}</li>
  52. <li style="width:22%">
  53. <p>{{item.home_team}}</p>
  54. <p>vs</p>
  55. <p>{{item.guest_team}}</p>
  56. </li>
  57. <li style="width:10%">{{item.bet_money}}</li>
  58. <li style="width:10%">{{item.status == 0?'待开奖':item.status == 1?'中奖':'未中奖'}}</li>
  59. <li style="width:8%">确认</li>
  60. </ul>
  61. </div>
  62. </div>
  63. </yd-list-other>
  64. </yd-list-item>
  65. </yd-list>
  66. </yd-infinitescroll>
  67. </div>
  68. </div>
  69. </div>
  70. </template>
  71. <script>
  72. export default {
  73. name: "settlementBetting",
  74. data() {
  75. return {
  76. optionsActive: 3,
  77. bettingCategory: 1, //投注类别 单注 串式
  78. startTime: "",
  79. newTime: "",
  80. endTime: "",
  81. page: 1,
  82. pageSize: 10,
  83. list: [],
  84. };
  85. },
  86. methods: {
  87. category(num) {
  88. this.bettingCategory = num;
  89. this.list = []
  90. this.loadList();
  91. },
  92. options(num) {
  93. let date = new Date();
  94. this.optionsActive = num;
  95. if (this.optionsActive == 1) {
  96. this.startTime = `${date.getFullYear()}-${
  97. date.getMonth() + 1 < 10
  98. ? "0" + (date.getMonth() + 1)
  99. : date.getMonth() + 1
  100. }-${
  101. date.getDate() < 10 ? "0" + date.getDate() : date.getDate()
  102. }`;
  103. this.endTime = `${date.getFullYear()}-${
  104. date.getMonth() + 1 < 10
  105. ? "0" + (date.getMonth() + 1)
  106. : date.getMonth() + 1
  107. }-${date.getDate() < 10 ? "0" + date.getDate() : date.getDate()}`;
  108. this.page = 1;
  109. this.list = "";
  110. this.$refs.infinitescrollDemo.$emit("ydui.infinitescroll.reInit");
  111. this.loadList();
  112. } else if (this.optionsActive == 2) {
  113. this.startTime = `${date.getFullYear()}-${
  114. date.getMonth() + 1 < 10
  115. ? "0" + (date.getMonth() + 1)
  116. : date.getMonth() + 1
  117. }-${
  118. date.getDate() - 1 < 10
  119. ? "0" + (date.getDate() - 1)
  120. : date.getDate() - 1
  121. }`;
  122. this.endTime = `${date.getFullYear()}-${
  123. date.getMonth() + 1 < 10
  124. ? "0" + (date.getMonth() + 1)
  125. : date.getMonth() + 1
  126. }-${
  127. date.getDate() - 1 < 10
  128. ? "0" + (date.getDate() - 1)
  129. : date.getDate() - 1
  130. }`;
  131. this.page = 1;
  132. this.list = "";
  133. this.$refs.infinitescrollDemo.$emit("ydui.infinitescroll.reInit");
  134. this.loadList();
  135. } else {
  136. this.startTime = `${date.getFullYear()}-${
  137. date.getMonth() < 10 ? "0" + date.getMonth() : date.getMonth()
  138. }-${date.getDate() < 10 ? "0" + date.getDate() : date.getDate()}`;
  139. this.endTime = `${date.getFullYear()}-${
  140. date.getMonth() + 1 < 10
  141. ? "0" + (date.getMonth() + 1)
  142. : date.getMonth() + 1
  143. }-${date.getDate() < 10 ? "0" + date.getDate() : date.getDate()}`;
  144. this.page = 1;
  145. this.list = "";
  146. this.$refs.infinitescrollDemo.$emit("ydui.infinitescroll.reInit");
  147. this.loadList();
  148. }
  149. },
  150. date_fun() {
  151. let date = new Date();
  152. let date1 = new Date(date);
  153. this.newTime = `${date1.getFullYear()}-${
  154. date1.getMonth() + 1 < 10
  155. ? "0" + (date1.getMonth() + 1)
  156. : date1.getMonth() + 1
  157. }-${date1.getDate() < 10 ? "0" + date1.getDate() : date1.getDate()}`;
  158. date1.setMonth(date.getMonth() - 3);
  159. this.startTime = `${date1.getFullYear()}-${
  160. date1.getMonth() + 1 < 10
  161. ? "0" + (date1.getMonth() + 1)
  162. : date1.getMonth() + 1
  163. }-${date1.getDate() < 10 ? "0" + date1.getDate() : date1.getDate()}`;
  164. this.endTime = `${date1.getFullYear()}-${
  165. date1.getMonth() + 1 < 10
  166. ? "0" + (date1.getMonth() + 1)
  167. : date1.getMonth() + 1
  168. }-${date1.getDate() < 10 ? "0" + date1.getDate() : date1.getDate()}`;
  169. date1.setMonth(date.getMonth() - 3);
  170. },
  171. loadList() {
  172. this.$http
  173. .post(this.$ports.login.bettingRecord, {
  174. token: localStorage.getItem("token"),
  175. startTime: this.startTime + " 00:00:00",
  176. endTime: this.endTime + " 23:59:59",
  177. type: this.bettingCategory,
  178. currentPage: this.page,
  179. pageSize: 10
  180. })
  181. .then(res => {
  182. console.log(res);
  183. if (res) {
  184. let arr = []
  185. if(res.data.data.list){
  186. res.data.data.list.forEach(e=>{
  187. if(e.result == 1 || e.result == 2){
  188. arr = [...arr,e]
  189. }
  190. })
  191. }
  192. this.list = [...this.list, ...arr];
  193. console.log(arr, "返回");
  194. }
  195. if (this.pageSize > res.data.data.list.length) {
  196. /* 所有数据加载完毕 */
  197. this.$refs.infinitescrollDemo.$emit(
  198. "ydui.infinitescroll.loadedDone"
  199. );
  200. return;
  201. } else {
  202. /* 单次请求数据完毕 */
  203. this.$refs.infinitescrollDemo.$emit(
  204. "ydui.infinitescroll.finishLoad"
  205. );
  206. this.page++;
  207. }
  208. });
  209. }
  210. },
  211. created() {
  212. this.date_fun();
  213. },
  214. mounted() {
  215. this.options(3);
  216. }
  217. };
  218. </script>
  219. <style scoped>
  220. div /deep/ .yd-list-theme5 .yd-list-item .yd-list-mes {
  221. padding: 0;
  222. }
  223. div /deep/ .yd-list-theme5 .yd-list-item .yd-list-other {
  224. padding: 0;
  225. }
  226. div /deep/ .yd-list-other {
  227. display: block;
  228. }
  229. .yd-list-theme5 .yd-list-item {
  230. padding: 0;
  231. }
  232. div /deep/ .yd-list-img {
  233. display: none;
  234. }
  235. div /deep/ .yd-list-loading {
  236. display: none;
  237. }
  238. .pdg20 {
  239. padding: 0 0.2rem;
  240. }
  241. .abstract-title {
  242. font-size: 0.18rem;
  243. color: #fff;
  244. height: 0.5rem;
  245. background: #999;
  246. line-height: 0.5rem;
  247. }
  248. .abstract-date {
  249. height: 0.8rem;
  250. font-size: 0.14rem;
  251. }
  252. input {
  253. width: 1.7rem;
  254. height: 0.4rem;
  255. font-size: 0.14rem;
  256. color: #666;
  257. border: 0.01rem solid #ddd;
  258. border-radius: 0.05rem;
  259. margin-left: 0.1rem;
  260. cursor: pointer;
  261. }
  262. input[type="date"]::-webkit-inner-spin-button {
  263. visibility: hidden;
  264. }
  265. input[type="date"]::-webkit-clear-button {
  266. display: none;
  267. }
  268. input[type="date"]::-webkit-datetime-edit-fields-wrapper {
  269. background-color: #eee;
  270. }
  271. input[type="date"]::-webkit-datetime-edit {
  272. /* content: '起始时间'; */
  273. padding-left: 0.1rem;
  274. }
  275. button {
  276. background: #999;
  277. border: none;
  278. width: 1rem;
  279. height: 0.4rem;
  280. border-radius: 0.05rem;
  281. color: #fff;
  282. margin-left: 0.2rem;
  283. cursor: pointer;
  284. }
  285. .abstract-options {
  286. height: 0.4rem;
  287. border-bottom: 0.01rem solid #999;
  288. }
  289. .abstract-options > div > div {
  290. width: 1rem;
  291. height: 0.4rem;
  292. color: #fff;
  293. background: #ccc;
  294. margin-left: 0.01rem;
  295. border-radius: 5px 5px 0px 0px;
  296. cursor: pointer;
  297. }
  298. .abstract-options div.active {
  299. background: #666;
  300. }
  301. .abstract-box {
  302. min-height: 2.8rem;
  303. max-height: 6.6rem;
  304. overflow-x: hidden;
  305. overflow-y: auto;
  306. }
  307. .abstract-box > div {
  308. margin-top: 0.2rem;
  309. }
  310. .abstract-box .title {
  311. height: 0.4rem;
  312. background: #ddd;
  313. color: #333;
  314. }
  315. .abstract-box .title p {
  316. text-align: center;
  317. }
  318. .abstract-box .title div {
  319. width: 50%;
  320. text-align: center;
  321. line-height: 0.4rem;
  322. }
  323. .abstract-box .list li {
  324. width: 50%;
  325. height: 1.1rem;
  326. background: #fff;
  327. display: flex;
  328. justify-content: center;
  329. align-items: center;
  330. flex-wrap: wrap;
  331. font-size: 0.14rem;
  332. border-top: 0.01rem solid #ccc;
  333. border-left: 0.01rem solid #ccc;
  334. border-bottom: 0.01rem solid #ccc;
  335. }
  336. .abstract-box .list li p{
  337. width: 100%;
  338. text-align: center;
  339. }
  340. .abstract-box .list li:nth-child(1) {
  341. border-left: none;
  342. }
  343. </style>