975599dc7a43f4f19e51a1b10e70f06211de1980.svn-base 10 KB

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