af119b63f3af006113b0c0973b44b7b420ba6c50.svn-base 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481
  1. <template>
  2. <div>
  3. <div class="box">
  4. <div class="row allAlignment center head_on_box">
  5. <p
  6. class="logo"
  7. style="font-size:.6rem;color:#E1E1DF;font-family: 'Franklin Gothic Medium'"
  8. >
  9. <i style="color:#F76649;">HX</i>669
  10. </p>
  11. <p style="color:#fffffe;font-size:.36rem">盈亏记录</p>
  12. <!-- <img class="log" src="../assets/st-imges/indexlogo.png" alt=""> -->
  13. <div class="row allAlignment center">
  14. <yd-button type="primary" bgcolor="rgba(0,0,0,0)" @click.native="isshow()">
  15. <img class="user-ion" src="@/assets/st-imges/user.png" alt>
  16. </yd-button>
  17. <!-- <div v-if="nameShow" class="row allAlignment center username">
  18. {{name}}
  19. </div>-->
  20. <img
  21. style="margin-left: 0.44rem;"
  22. class="user-ion"
  23. src="@/assets/st-imges/contact.png"
  24. alt
  25. >
  26. </div>
  27. </div>
  28. </div>
  29. <div class="box row">
  30. <div id="NavSlide">
  31. <nav>
  32. <p v-for="(item,index) in arr" @click="getdates(item.start,item.end,index)" :key="index">
  33. <span :class="{active:index==active}">{{item.title}}</span>
  34. </p>
  35. </nav>
  36. </div>
  37. <div class="date row center">
  38. <yd-button-group>
  39. <yd-button size="large" bgcolor="rgba(0,0,0,0)" @click.native="open">
  40. <img :src="img" style="width:.3rem;height:.3rem">日历
  41. </yd-button>
  42. </yd-button-group>
  43. </div>
  44. </div>
  45. <div class="row classify average">
  46. <div
  47. v-for="(item,index) in list"
  48. :class="item.id==classifynum?'classifyactive':''"
  49. :key="index"
  50. @click="classifyclick(index)"
  51. >{{item.title}}</div>
  52. </div>
  53. <div
  54. class="row center"
  55. style="height:.88rem;color:#333;font-size:.32rem;"
  56. v-if="data.status=='2001'"
  57. >对不起,您当前没有登录,请前往登录</div>
  58. <div>
  59. <div class="datalist">
  60. <div class="datalistbox row allAlignment">
  61. <yd-infinitescroll :callback="loadList" ref="infinitescrollDemo">
  62. <yd-list theme="1" slot="list">
  63. <div v-for="(item,index) in data.list" :key="index">
  64. <div
  65. v-if="item.money_type==1"
  66. :style="classifynum==0?'':'display:none'"
  67. class="datalist-box row allAlignment"
  68. >
  69. <p>{{item.money_time}}</p>
  70. <p>+{{item.money}}</p>
  71. </div>
  72. <div
  73. v-if="item.money_type==2"
  74. :style="classifynum==1?'':'display:none'"
  75. class="datalist-box row allAlignment"
  76. >
  77. <p>{{item.money_time}}</p>
  78. <p>-{{item.money}}</p>
  79. </div>
  80. </div>
  81. </yd-list>
  82. <!-- 数据全部加载完毕显示 -->
  83. <span slot="doneTip">啦啦啦,啦啦啦,没有数据啦~~</span>
  84. <!-- 加载中提示,不指定,将显示默认加载中图标 -->
  85. <img slot="loadingTip" src="http://static.ydcss.com/uploads/ydui/loading/loading10.svg">
  86. </yd-infinitescroll>
  87. </div>
  88. </div>
  89. </div>
  90. <yd-cell-group style="display:none;">
  91. <yd-cell-item arrow>
  92. <yd-datetime
  93. type="date"
  94. ref="datetime"
  95. start-year="2014"
  96. :end-date="endyear"
  97. v-model="datetime"
  98. slot="right"
  99. ></yd-datetime>
  100. </yd-cell-item>
  101. </yd-cell-group>
  102. <Login v-if="isShow"/>
  103. </div>
  104. </template>
  105. <script>
  106. import "@/css/index.css";
  107. import Login from "@/pages/Login/index/StLogin";
  108. import register from "@/pages/Login/index/register";
  109. export default {
  110. name: "BettingRecord",
  111. data() {
  112. return {
  113. isShow: true,
  114. img: require("@/assets/st-imges/date.png"),
  115. img1: require("@/assets/st-imges/home.png"),
  116. img2: require("@/assets/st-imges/gengduo-1.png"),
  117. timearr: [],
  118. arr: [],
  119. active: 0,
  120. // 是否继续请求
  121. ajaxto: true,
  122. data: "",
  123. datetime: "2017-05-11",
  124. // 查询开始结束时间
  125. startTime: "",
  126. endTime: "",
  127. startyear: "",
  128. endyear: "",
  129. list: [{ title: "本月已盈利", id: 0 }, { title: "本月已亏损", id: 1 }],
  130. classifynum: 0,
  131. // 分页
  132. page: 1,
  133. pageSize: 15,
  134. PageList: []
  135. };
  136. },
  137. computed: {
  138. Isshow: function() {
  139. return this.$store.state.isShow;
  140. }
  141. },
  142. components: {
  143. Login
  144. },
  145. created() {
  146. this.fun_date();
  147. if(this.ajaxto){
  148. this.loadList();
  149. }
  150. },
  151. methods: {
  152. // 分页查询时间
  153. getdates(start, end, index) {
  154. this.active = index;
  155. this.startTime = start;
  156. this.endTime = end;
  157. if(this.ajaxto){
  158. this.loadList();
  159. }
  160. },
  161. loadList(ispage) {
  162. let date = new Date(),
  163. date2 = new Date(date);
  164. this.startTime = `${date2.getFullYear()}-${
  165. date2.getMonth() + 1 < 10
  166. ? "0" + (date2.getMonth() + 1)
  167. : date2.getMonth() + 1
  168. }-${
  169. date2.getDate() - 7 < 10
  170. ? "0" + date2.getDate() - 7
  171. : date2.getDate() - 7
  172. } 00:00:00`;
  173. this.endTime = `${date2.getFullYear()}-${
  174. date2.getMonth() + 1 < 10
  175. ? "0" + (date2.getMonth() + 1)
  176. : date2.getMonth() + 1
  177. }-${
  178. date2.getDate() - 7 < 10
  179. ? "0" + date2.getDate() - 7
  180. : date2.getDate() - 7
  181. } ${date2.getHours() < 10 ? "0" + date2.getHours() : date2.getHours()}:${
  182. date2.getMinutes() < 10 ? "0" + date2.getMinutes() : date2.getMinutes()
  183. }:${
  184. date2.getSeconds() < 10 ? "0" + date2.getSeconds() : date2.getSeconds()
  185. }`;
  186. this.$http
  187. .post(this.$ports.login.ProfitAndLossRecord, {
  188. currentPage: this.page,
  189. pageSize: this.pageSize,
  190. token: "Ym0dZz15559259655cbd8bcdbd7ef" //localStorage.getItem("token")
  191. })
  192. .then(res => {
  193. if (res) {
  194. this.data = res.data.data;
  195. console.log(res.data.data)
  196. if(res.data.data.list.length<this.pageSize){
  197. this.ajaxto=false
  198. }
  199. }
  200. /* 单次请求数据完毕 */
  201. this.$refs.infinitescrollDemo.$emit("ydui.infinitescroll.finishLoad");
  202. // 判断是否需要页码加一
  203. if (ispage) {
  204. this.page++;
  205. }
  206. });
  207. },
  208. classifyclick(i) {
  209. this.classifynum = i;
  210. },
  211. open() {
  212. this.$refs.datetime.open();
  213. },
  214. isshow() {
  215. let isShow = true;
  216. this.$store.dispatch("GET_ISSHOW", isShow);
  217. },
  218. //设置一周赛事
  219. fun_date: function() {
  220. let date = new Date();
  221. this.endyear = this.endyear + date.getFullYear() + "/";
  222. this.endyear =
  223. this.endyear +
  224. (date.getMonth() < 10
  225. ? "0" + (date.getMonth() + 1)
  226. : date.getMonth() + 1) +
  227. "/";
  228. this.endyear =
  229. this.endyear +
  230. (date.getDate() < 10 ? "0" + date.getDate() : date.getDate());
  231. let date2 = new Date(date);
  232. let newday = new Date();
  233. let endmonth = newday.getMonth() + 1;
  234. newday.setDate(0);
  235. let daynum = newday.getDate();
  236. let num = 0,
  237. org,
  238. str;
  239. for (let i = daynum; i >= 1; i--) {
  240. date2.setDate(date2.getDate() - 1);
  241. org = date2.getDay();
  242. switch (org) {
  243. case 0:
  244. str = "星期日";
  245. break;
  246. case 1:
  247. str = "星期一";
  248. break;
  249. case 2:
  250. str = "星期二";
  251. break;
  252. case 3:
  253. str = "星期三";
  254. break;
  255. case 4:
  256. str = "星期四";
  257. break;
  258. case 5:
  259. str = "星期五";
  260. break;
  261. case 6:
  262. str = "星期六";
  263. break;
  264. }
  265. let years = date2.getFullYear();
  266. let month =
  267. date2.getMonth() + 1 < 10
  268. ? "0" + (date2.getMonth() + 1)
  269. : date2.getMonth() + 1;
  270. let day =
  271. date2.getDate() < 10 ? "0" + date2.getDate() : date2.getDate();
  272. let time2 = {};
  273. time2.id = num;
  274. if (i == daynum) {
  275. time2.title = month + "-" + day + "今天";
  276. time2.start = `${date.getFullYear()}-${month}-${day} 00:00:00`;
  277. time2.end = `${date.getFullYear()}-${month}-${day} ${
  278. date2.getHours() < 10 ? "0" + date2.getHours() : date2.getHours()
  279. }:${
  280. date2.getMinutes() < 10
  281. ? "0" + date2.getMinutes()
  282. : date2.getMinutes()
  283. }:${
  284. date2.getSeconds() < 10
  285. ? "0" + date2.getSeconds()
  286. : date2.getSeconds()
  287. }`;
  288. } else if (i == daynum - 1) {
  289. time2.title = month + "-" + day + "昨天";
  290. time2.start = `${date2.getFullYear()}-${month}-${day} 00:00:00`;
  291. time2.end = `${date2.getFullYear()}-${month}-${day} 23:59:59`;
  292. } else if (i == daynum - 2) {
  293. time2.title = month + "-" + day + "前天";
  294. time2.start = `${date2.getFullYear()}-${month}-${day} 00:00:00`;
  295. time2.end = `${date2.getFullYear()}-${month}-${day} 23:59:59`;
  296. } else {
  297. time2.title = month + "-" + day + str;
  298. time2.start = `${date2.getFullYear()}-${month}-${day} 00:00:00`;
  299. time2.end = `${date2.getFullYear()}-${month}-${day} 23:59:59`;
  300. }
  301. this.arr.push(time2);
  302. num++;
  303. }
  304. }
  305. },
  306. watch: {
  307. Isshow(val) {
  308. this.isShow = val;
  309. }
  310. },
  311. mounted() {}
  312. };
  313. </script>
  314. <style scoped>
  315. .datalist-box p {
  316. height: 0.88rem;
  317. display: flex;
  318. align-items: center;
  319. }
  320. .datalistbox div {
  321. width: 100%;
  322. }
  323. .datalist-box {
  324. width: 100%;
  325. height: 0.88rem;
  326. }
  327. .paging {
  328. width: 100%;
  329. height: 0.88rem;
  330. position: absolute;
  331. bottom: 0;
  332. }
  333. .paging p {
  334. width: 0.6rem;
  335. height: 0.6rem;
  336. margin-left: 0.05rem;
  337. border-radius: 0.08rem;
  338. background: #ccc;
  339. display: flex;
  340. justify-content: center;
  341. align-items: center;
  342. color: #363636;
  343. }
  344. .paging p input {
  345. width: 0.6rem;
  346. height: 0.6rem;
  347. background: #ebebeb;
  348. border: 2px solid #ccc;
  349. border-radius: 0.08rem;
  350. }
  351. .paging p button {
  352. width: 0.6rem;
  353. height: 0.6rem;
  354. border: none;
  355. background: #555;
  356. color: #efefef;
  357. display: flex;
  358. justify-content: center;
  359. align-items: center;
  360. border-radius: 0.08rem;
  361. }
  362. .paging p button:active {
  363. background: rgb(126, 125, 125);
  364. color: #ccc;
  365. }
  366. .datalistbox {
  367. margin-top: 0.3rem;
  368. background: #efefef;
  369. padding: 0.2rem 0.3rem;
  370. font-size: 0.28rem;
  371. color: #555555;
  372. line-height: 0.4rem;
  373. }
  374. .datalist {
  375. position: relative;
  376. }
  377. .datalistlet {
  378. background-color: #cccccc;
  379. }
  380. .datalist .active {
  381. background: #f76649 !important;
  382. color: #efefef !important;
  383. }
  384. .msg {
  385. height: 0.88rem;
  386. margin-top: 0.3rem;
  387. color: #ccc;
  388. background: #333;
  389. }
  390. .classifyactive {
  391. color: #f76649;
  392. border-bottom: 2px solid #f76649;
  393. }
  394. .classify {
  395. height: 0.88rem;
  396. font-size: 0.3rem;
  397. line-height: 0.66rem;
  398. font-weight: normal;
  399. color: #777777;
  400. background-color: #efefef;
  401. padding: 0.1rem 0;
  402. }
  403. .active {
  404. color: rgb(247, 102, 73) !important;
  405. }
  406. .box {
  407. background: #ebebeb;
  408. padding-left: 0.14rem;
  409. }
  410. .date {
  411. width: 20%;
  412. background: #ccc;
  413. height: 0.88rem;
  414. }
  415. #NavSlide {
  416. width: 100%;
  417. overflow: hidden;
  418. }
  419. #NavSlide nav {
  420. padding-top: 0.1rem;
  421. display: -webkit-box;
  422. display: -ms-flexbox;
  423. display: flex;
  424. -webkit-box-align: middle;
  425. -ms-flex-align: middle;
  426. align-items: middle;
  427. overflow: auto;
  428. }
  429. div /deep/ .yd-datetime-content,
  430. div /deep/ .yd-datetime-shade,
  431. div /deep/ .yd-datetime-indicator {
  432. height: 2rem !important;
  433. }
  434. div /deep/ .yd-button {
  435. padding: 0;
  436. width: 100%;
  437. height: 100%;
  438. }
  439. div /deep/ .yd-button button {
  440. margin: 0;
  441. border-radius: 0;
  442. }
  443. #NavSlide p {
  444. text-align: center;
  445. font-size: 0.28rem;
  446. -ms-flex-negative: 0;
  447. flex-shrink: 0;
  448. padding: 0 0.1rem;
  449. color: #b8b8b8;
  450. }
  451. /* #NavSlide p a{
  452. color: #E5E5E5;
  453. text-decoration: none;
  454. } */
  455. #NavSlide p span.active {
  456. color: #363636;
  457. }
  458. .head_on_box {
  459. padding: 0 0.32rem;
  460. }
  461. .box {
  462. height: 0.88rem;
  463. background: linear-gradient(to bottom, #999999, #6a6a6b);
  464. overflow: hidden;
  465. }
  466. .user-ion {
  467. width: 0.3rem;
  468. height: 0.3rem;
  469. }
  470. #NavSlide p {
  471. width: 1.1rem;
  472. }
  473. </style>