473e6855c787c76f9933a056f15428b221aca832.svn-base 10 KB

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