15d65e2bf5eace96c0599ce3f9d1e24a6102f937.svn-base 11 KB

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