5985ea5aec3f48ce5b5b4b50d44b5bab964f2da0.svn-base 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434
  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. <img class="user-ion" @click="toRouter()" src="@/assets/st-imges/close.png" alt>
  15. <!-- <div v-if="nameShow" class="row allAlignment center username">
  16. {{name}}
  17. </div>-->
  18. <img
  19. style="margin-left: 0.44rem;"
  20. class="user-ion"
  21. src="@/assets/st-imges/contact.png"
  22. alt
  23. >
  24. </div>
  25. </div>
  26. </div>
  27. <div class="boxIn row item-center">
  28. <div class="date row center">
  29. <yd-button-group>
  30. <yd-button size="large" bgcolor="rgba(0,0,0,0)" @click.native="openStart">
  31. {{startTime}}
  32. </yd-button>
  33. </yd-button-group>
  34. </div>
  35. <p style="margin:0 .22rem">至</p>
  36. <div class="date row center">
  37. <yd-button-group>
  38. <yd-button size="large" bgcolor="rgba(0,0,0,0)" @click.native="openEnd">
  39. <div>
  40. {{endTime}}
  41. </div>
  42. </yd-button>
  43. </yd-button-group>
  44. </div>
  45. <button class="dateBtn" @click="loadList()">查询</button>
  46. </div>
  47. <div class="row classify average">
  48. <div
  49. v-for="(item,index) in list"
  50. :class="item.id==classifynum?'classifyactive':''"
  51. :key="index"
  52. @click="classifyclick(index)"
  53. >{{item.title}}</div>
  54. </div>
  55. <div
  56. class="row center"
  57. style="height:.88rem;color:#ebebeb;font-size:.32rem;background:#666;margin-top:.1rem;"
  58. v-if="data.status=='2001'"
  59. >对不起,您当前没有登录,请前往登录</div>
  60. <div>
  61. <div class="datalist">
  62. <div>
  63. <yd-infinitescroll :callback="loadList" ref="infinitescrollDemo">
  64. <yd-list theme="1" slot="list">
  65. <div v-for="(item,index) in data.list" :key="index">
  66. <div
  67. v-if="item.money_type==1"
  68. :style="classifynum==0?'':'display:none'"
  69. class="datalistbox row allAlignment"
  70. >
  71. <div>
  72. <!--
  73. 数据不全,待渲染
  74. -->
  75. </div>
  76. <div>
  77. <!--
  78. 数据不全,待渲染
  79. -->
  80. <p>{{item.money_time}}</p>
  81. <p>+{{item.money}}</p>
  82. </div>
  83. </div>
  84. <div
  85. v-if="item.money_type==2"
  86. :style="classifynum==1?'':'display:none'"
  87. class="datalist-box row allAlignment"
  88. >
  89. <p>{{item.money_time}}</p>
  90. <p>-{{item.money}}</p>
  91. </div>
  92. </div>
  93. </yd-list>
  94. <!-- 数据全部加载完毕显示 -->
  95. <span slot="doneTip">啦啦啦,啦啦啦,没有数据啦~~</span>
  96. <!-- 加载中提示,不指定,将显示默认加载中图标 -->
  97. <img slot="loadingTip" src="http://static.ydcss.com/uploads/ydui/loading/loading10.svg">
  98. </yd-infinitescroll>
  99. </div>
  100. </div>
  101. </div>
  102. <yd-cell-group style="display:none;">
  103. <yd-cell-item arrow>
  104. <yd-datetime
  105. type="date"
  106. ref="datetimeStart"
  107. :start-date='startDate'
  108. :end-date="endTime"
  109. slot="right"
  110. v-model="startTime"
  111. ></yd-datetime>
  112. </yd-cell-item>
  113. </yd-cell-group>
  114. <yd-cell-group style="display:none;">
  115. <yd-cell-item arrow>
  116. <yd-datetime
  117. type="date"
  118. ref="datetimeEnd"
  119. :start-date='startTime'
  120. :end-date="date"
  121. slot="right"
  122. v-model="endTime"
  123. ></yd-datetime>
  124. </yd-cell-item>
  125. </yd-cell-group>
  126. </div>
  127. </template>
  128. <script>
  129. import "@/css/index.css";
  130. export default {
  131. name: "ProfitAndLossRecord",
  132. data() {
  133. return {
  134. img: require("@/assets/st-imges/date.png"),
  135. img1: require("@/assets/st-imges/home.png"),
  136. img2: require("@/assets/st-imges/gengduo-1.png"),
  137. active: 0,
  138. data: "",
  139. // 当前时间 同时也是日历结束时间
  140. date:'',
  141. // 日历开始时间
  142. startDate:'',
  143. // 查询开始时间
  144. startTime: "",
  145. // 查询结束时间
  146. endTime: "",
  147. list: [{ title: "本月已盈利", id: 0 }, { title: "本月已亏损", id: 1 }],
  148. classifynum: 0,
  149. // 分页
  150. page: 1,
  151. pageSize: 15,
  152. PageList: []
  153. };
  154. },
  155. created() {
  156. this.initialTime();
  157. },
  158. methods: {
  159. // 导航
  160. toRouter() {
  161. this.$router.go(-2);
  162. },
  163. // 初始化时间
  164. initialTime() {
  165. // 现在的时间
  166. let date=new Date()
  167. // 日历开始时间
  168. let date2=new Date(date)
  169. date2.setMonth((date.getMonth()-3))
  170. this.startDate+=`${date2.getFullYear()}-${(date2.getMonth()+1)<10?'0'+(date2.getMonth()+1):date2.getMonth()+1}-${date2.getDate()<10?'0'+date2.getDate():date2.getDate()}`;
  171. this.date+=`${date.getFullYear()}-${(date.getMonth()+1)<10?'0'+(date.getMonth()+1):date.getMonth()+1}-${date.getDate()<10?'0'+date.getDate():date.getDate()}`;
  172. // 查询结束时间
  173. this.endTime+=`${date.getFullYear()}-${(date.getMonth()+1)<10?'0'+(date.getMonth()+1):date.getMonth()+1}-${date.getDate()<10?'0'+date.getDate():date.getDate()}`
  174. this.startTime=`${date.getFullYear()}-${(date.getMonth()-2)<10?'0'+(date.getMonth()-2):date.getMonth()-2}-${date.getDate()<10?'0'+date.getDate():date.getDate()}`
  175. console.log(this.startDate)
  176. },
  177. loadList() {
  178. // 补全时间
  179. let date=new Date()
  180. let hours=date.getHours();
  181. let min = date.getMinutes();
  182. let sec = date.getSeconds()
  183. console.log(this.startTime + " 00:00:00",this.endTime+' '+(hours<10?'0'+hours:hours)+':'+(min<10?'0'+min:min)+':'+(sec<10?'0'+sec:sec))
  184. this.isrequest = false;
  185. this.$http
  186. .post(this.$ports.login.ProfitAndLossRecord, {
  187. currentPage: this.page,
  188. pageSize: this.pageSize,
  189. startTime: this.startTime + " 00:00:00", //此处是补全开始时间的时间
  190. endTime: this.endTime+' '+(hours<10?'0'+hours:hours)+':'+(min<10?'0'+min:min)+':'+(sec<10?'0'+sec:sec),
  191. status: this.classifynum,
  192. token: localStorage.getItem("token")
  193. })
  194. .then(res => {
  195. console.log(res,'aaa');
  196. if (res) {
  197. this.data = res.data.data;
  198. if (res.data.data.list) {
  199. if (res.data.data.list.length < this.pageSize)
  200. this.ajaxto = false;
  201. }
  202. }
  203. /* 单次请求数据完毕 */
  204. this.$refs.infinitescrollDemo.$emit("ydui.infinitescroll.finishLoad");
  205. // 判断是否需要页码加一
  206. this.page++;
  207. });
  208. },
  209. // 点击待开奖,中奖未中奖
  210. classifyclick(i) {
  211. // 请求发送开关
  212. this.isrequest = true;
  213. this.classifynum = i;
  214. // 发送请求
  215. this.loadList()
  216. },
  217. // 日历开关
  218. openStart() {
  219. this.$refs.datetimeStart.open();
  220. },
  221. openEnd(){
  222. this.$refs.datetimeEnd.open();
  223. }
  224. },
  225. mounted(){
  226. this.loadList()
  227. }
  228. };
  229. </script>
  230. <style scoped>
  231. .boxIn {
  232. background: #e4e4e4;
  233. height: 0.88rem;
  234. padding: 0 0.32rem;
  235. }
  236. .date {
  237. width: 2.5rem;
  238. height: 0.6rem;
  239. border-radius: 0.25rem;
  240. background: #ccc;
  241. }
  242. .dateBtn{
  243. width: .94rem;
  244. height: .6rem;
  245. border: none;
  246. border-radius: .08rem;
  247. background-image: linear-gradient(7deg,
  248. #565656 0%,
  249. #999999 100%),
  250. linear-gradient(
  251. #4a4949,
  252. #4a4949);
  253. color: #ffffff;
  254. margin-left: .22rem;
  255. }
  256. .datalist-box p {
  257. height: 0.88rem;
  258. display: flex;
  259. align-items: center;
  260. }
  261. .datalistbox div {
  262. width: 100%;
  263. }
  264. .datalist-box {
  265. width: 100%;
  266. height: 0.88rem;
  267. }
  268. .paging {
  269. width: 100%;
  270. height: 0.88rem;
  271. position: absolute;
  272. bottom: 0;
  273. }
  274. .paging p {
  275. width: 0.6rem;
  276. height: 0.6rem;
  277. margin-left: 0.05rem;
  278. border-radius: 0.08rem;
  279. background: #ccc;
  280. display: flex;
  281. justify-content: center;
  282. align-items: center;
  283. color: #363636;
  284. }
  285. .paging p input {
  286. width: 0.6rem;
  287. height: 0.6rem;
  288. background: #ebebeb;
  289. border: 2px solid #ccc;
  290. border-radius: 0.08rem;
  291. }
  292. .paging p button {
  293. width: 0.6rem;
  294. height: 0.6rem;
  295. border: none;
  296. background: #555;
  297. color: #efefef;
  298. display: flex;
  299. justify-content: center;
  300. align-items: center;
  301. border-radius: 0.08rem;
  302. }
  303. .paging p button:active {
  304. background: rgb(126, 125, 125);
  305. color: #ccc;
  306. }
  307. .datalistbox {
  308. height: 2.2rem;
  309. margin-top: 0.3rem;
  310. background: #efefef;
  311. padding: 0.2rem 0.3rem;
  312. font-size: 0.28rem;
  313. color: #555555;
  314. line-height: 0.4rem;
  315. }
  316. .datalist {
  317. position: relative;
  318. }
  319. .datalistlet {
  320. background-color: #cccccc;
  321. }
  322. .datalist .active {
  323. background: #f76649 !important;
  324. color: #efefef !important;
  325. }
  326. .msg {
  327. height: 0.88rem;
  328. margin-top: 0.3rem;
  329. color: #ccc;
  330. background: #333;
  331. }
  332. .classifyactive {
  333. color: #f76649;
  334. border-bottom: 2px solid #f76649;
  335. }
  336. .classify {
  337. height: 0.88rem;
  338. font-size: 0.3rem;
  339. line-height: 0.66rem;
  340. font-weight: normal;
  341. color: #777777;
  342. background-color: #efefef;
  343. padding: 0.1rem 0;
  344. }
  345. .active {
  346. color: rgb(247, 102, 73) !important;
  347. }
  348. .box {
  349. background: #ebebeb;
  350. padding-left: 0.14rem;
  351. }
  352. div /deep/ .yd-btn-block{
  353. height: 100%;
  354. }
  355. #NavSlide {
  356. width: 100%;
  357. overflow: hidden;
  358. }
  359. #NavSlide nav {
  360. padding-top: 0.1rem;
  361. display: -webkit-box;
  362. display: -ms-flexbox;
  363. display: flex;
  364. -webkit-box-align: middle;
  365. -ms-flex-align: middle;
  366. align-items: middle;
  367. overflow: auto;
  368. }
  369. div /deep/ .yd-datetime-content,
  370. div /deep/ .yd-datetime-shade,
  371. div /deep/ .yd-datetime-indicator {
  372. height: 2rem !important;
  373. }
  374. div /deep/ .yd-button {
  375. padding: 0;
  376. width: 100%;
  377. height: 100%;
  378. }
  379. div /deep/ .yd-button button {
  380. margin: 0;
  381. border-radius: 0;
  382. }
  383. #NavSlide p {
  384. text-align: center;
  385. font-size: 0.28rem;
  386. -ms-flex-negative: 0;
  387. flex-shrink: 0;
  388. padding: 0 0.1rem;
  389. color: #b8b8b8;
  390. }
  391. /* #NavSlide p a{
  392. color: #E5E5E5;
  393. text-decoration: none;
  394. } */
  395. #NavSlide p span.active {
  396. color: #363636;
  397. }
  398. .head_on_box {
  399. padding: 0 0.32rem;
  400. }
  401. .box {
  402. height: 0.88rem;
  403. background: linear-gradient(to bottom, #999999, #6a6a6b);
  404. overflow: hidden;
  405. }
  406. .user-ion {
  407. width: 0.3rem;
  408. height: 0.3rem;
  409. }
  410. #NavSlide p {
  411. width: 1.1rem;
  412. }
  413. </style>