| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434 |
- <template>
- <div>
- <div class="box">
- <div class="row allAlignment center head_on_box">
- <p
- class="logo"
- style="font-size:.6rem;color:#E1E1DF;font-family: 'Franklin Gothic Medium'"
- >
- <i style="color:#F76649;">HX</i>669
- </p>
- <p style="color:#fffffe;font-size:.36rem">盈亏记录</p>
- <!-- <img class="log" src="../assets/st-imges/indexlogo.png" alt=""> -->
- <div class="row allAlignment center">
- <img class="user-ion" @click="toRouter()" src="@/assets/st-imges/close.png" alt>
- <!-- <div v-if="nameShow" class="row allAlignment center username">
- {{name}}
- </div>-->
- <img
- style="margin-left: 0.44rem;"
- class="user-ion"
- src="@/assets/st-imges/contact.png"
- alt
- >
- </div>
- </div>
- </div>
- <div class="boxIn row item-center">
- <div class="date row center">
- <yd-button-group>
- <yd-button size="large" bgcolor="rgba(0,0,0,0)" @click.native="openStart">
- {{startTime}}
- </yd-button>
- </yd-button-group>
- </div>
- <p style="margin:0 .22rem">至</p>
- <div class="date row center">
- <yd-button-group>
- <yd-button size="large" bgcolor="rgba(0,0,0,0)" @click.native="openEnd">
- <div>
- {{endTime}}
- </div>
- </yd-button>
- </yd-button-group>
- </div>
- <button class="dateBtn" @click="loadList()">查询</button>
- </div>
- <div class="row classify average">
- <div
- v-for="(item,index) in list"
- :class="item.id==classifynum?'classifyactive':''"
- :key="index"
- @click="classifyclick(index)"
- >{{item.title}}</div>
- </div>
- <div
- class="row center"
- style="height:.88rem;color:#ebebeb;font-size:.32rem;background:#666;margin-top:.1rem;"
- v-if="data.status=='2001'"
- >对不起,您当前没有登录,请前往登录</div>
- <div>
- <div class="datalist">
- <div>
- <yd-infinitescroll :callback="loadList" ref="infinitescrollDemo">
- <yd-list theme="1" slot="list">
- <div v-for="(item,index) in data.list" :key="index">
- <div
- v-if="item.money_type==1"
- :style="classifynum==0?'':'display:none'"
- class="datalistbox row allAlignment"
- >
- <div>
- <!--
-
-
-
- 数据不全,待渲染
-
-
-
-
- -->
- </div>
- <div>
- <!--
-
-
-
- 数据不全,待渲染
-
-
-
-
- -->
- <p>{{item.money_time}}</p>
- <p>+{{item.money}}</p>
- </div>
- </div>
- <div
- v-if="item.money_type==2"
- :style="classifynum==1?'':'display:none'"
- class="datalist-box row allAlignment"
- >
- <p>{{item.money_time}}</p>
- <p>-{{item.money}}</p>
- </div>
- </div>
- </yd-list>
- <!-- 数据全部加载完毕显示 -->
- <span slot="doneTip">啦啦啦,啦啦啦,没有数据啦~~</span>
- <!-- 加载中提示,不指定,将显示默认加载中图标 -->
- <img slot="loadingTip" src="http://static.ydcss.com/uploads/ydui/loading/loading10.svg">
- </yd-infinitescroll>
- </div>
- </div>
- </div>
- <yd-cell-group style="display:none;">
- <yd-cell-item arrow>
- <yd-datetime
- type="date"
- ref="datetimeStart"
- :start-date='startDate'
- :end-date="endTime"
- slot="right"
- v-model="startTime"
- ></yd-datetime>
- </yd-cell-item>
- </yd-cell-group>
- <yd-cell-group style="display:none;">
- <yd-cell-item arrow>
- <yd-datetime
- type="date"
- ref="datetimeEnd"
- :start-date='startTime'
- :end-date="date"
- slot="right"
- v-model="endTime"
- ></yd-datetime>
- </yd-cell-item>
- </yd-cell-group>
- </div>
- </template>
- <script>
- import "@/css/index.css";
- export default {
- name: "ProfitAndLossRecord",
- data() {
- return {
- img: require("@/assets/st-imges/date.png"),
- img1: require("@/assets/st-imges/home.png"),
- img2: require("@/assets/st-imges/gengduo-1.png"),
- active: 0,
- data: "",
- // 当前时间 同时也是日历结束时间
- date:'',
- // 日历开始时间
- startDate:'',
- // 查询开始时间
- startTime: "",
- // 查询结束时间
- endTime: "",
- list: [{ title: "本月已盈利", id: 0 }, { title: "本月已亏损", id: 1 }],
- classifynum: 0,
- // 分页
- page: 1,
- pageSize: 15,
- PageList: []
- };
- },
- created() {
- this.initialTime();
- },
- methods: {
- // 导航
- toRouter() {
- this.$router.go(-2);
- },
- // 初始化时间
- initialTime() {
- // 现在的时间
- let date=new Date()
- // 日历开始时间
- let date2=new Date(date)
- date2.setMonth((date.getMonth()-3))
- this.startDate+=`${date2.getFullYear()}-${(date2.getMonth()+1)<10?'0'+(date2.getMonth()+1):date2.getMonth()+1}-${date2.getDate()<10?'0'+date2.getDate():date2.getDate()}`;
- this.date+=`${date.getFullYear()}-${(date.getMonth()+1)<10?'0'+(date.getMonth()+1):date.getMonth()+1}-${date.getDate()<10?'0'+date.getDate():date.getDate()}`;
- // 查询结束时间
- this.endTime+=`${date.getFullYear()}-${(date.getMonth()+1)<10?'0'+(date.getMonth()+1):date.getMonth()+1}-${date.getDate()<10?'0'+date.getDate():date.getDate()}`
- this.startTime=`${date.getFullYear()}-${(date.getMonth()-2)<10?'0'+(date.getMonth()-2):date.getMonth()-2}-${date.getDate()<10?'0'+date.getDate():date.getDate()}`
- console.log(this.startDate)
- },
- loadList() {
- // 补全时间
- let date=new Date()
- let hours=date.getHours();
- let min = date.getMinutes();
- let sec = date.getSeconds()
- console.log(this.startTime + " 00:00:00",this.endTime+' '+(hours<10?'0'+hours:hours)+':'+(min<10?'0'+min:min)+':'+(sec<10?'0'+sec:sec))
- this.isrequest = false;
- this.$http
- .post(this.$ports.login.ProfitAndLossRecord, {
- currentPage: this.page,
- pageSize: this.pageSize,
- startTime: this.startTime + " 00:00:00", //此处是补全开始时间的时间
- endTime: this.endTime+' '+(hours<10?'0'+hours:hours)+':'+(min<10?'0'+min:min)+':'+(sec<10?'0'+sec:sec),
- status: this.classifynum,
- token: localStorage.getItem("token")
- })
- .then(res => {
- console.log(res,'aaa');
- if (res) {
- this.data = res.data.data;
- if (res.data.data.list) {
- if (res.data.data.list.length < this.pageSize)
- this.ajaxto = false;
- }
- }
- /* 单次请求数据完毕 */
- this.$refs.infinitescrollDemo.$emit("ydui.infinitescroll.finishLoad");
- // 判断是否需要页码加一
- this.page++;
- });
- },
- // 点击待开奖,中奖未中奖
- classifyclick(i) {
- // 请求发送开关
- this.isrequest = true;
- this.classifynum = i;
- // 发送请求
- this.loadList()
- },
- // 日历开关
- openStart() {
- this.$refs.datetimeStart.open();
- },
- openEnd(){
- this.$refs.datetimeEnd.open();
- }
- },
- mounted(){
- this.loadList()
- }
- };
- </script>
- <style scoped>
- .boxIn {
- background: #e4e4e4;
- height: 0.88rem;
- padding: 0 0.32rem;
- }
- .date {
- width: 2.5rem;
- height: 0.6rem;
- border-radius: 0.25rem;
- background: #ccc;
- }
- .dateBtn{
- width: .94rem;
- height: .6rem;
- border: none;
- border-radius: .08rem;
- background-image: linear-gradient(7deg,
- #565656 0%,
- #999999 100%),
- linear-gradient(
- #4a4949,
- #4a4949);
- color: #ffffff;
- margin-left: .22rem;
- }
- .datalist-box p {
- height: 0.88rem;
- display: flex;
- align-items: center;
- }
- .datalistbox div {
- width: 100%;
- }
- .datalist-box {
- width: 100%;
- height: 0.88rem;
- }
- .paging {
- width: 100%;
- height: 0.88rem;
- position: absolute;
- bottom: 0;
- }
- .paging p {
- width: 0.6rem;
- height: 0.6rem;
- margin-left: 0.05rem;
- border-radius: 0.08rem;
- background: #ccc;
- display: flex;
- justify-content: center;
- align-items: center;
- color: #363636;
- }
- .paging p input {
- width: 0.6rem;
- height: 0.6rem;
- background: #ebebeb;
- border: 2px solid #ccc;
- border-radius: 0.08rem;
- }
- .paging p button {
- width: 0.6rem;
- height: 0.6rem;
- border: none;
- background: #555;
- color: #efefef;
- display: flex;
- justify-content: center;
- align-items: center;
- border-radius: 0.08rem;
- }
- .paging p button:active {
- background: rgb(126, 125, 125);
- color: #ccc;
- }
- .datalistbox {
- height: 2.2rem;
- margin-top: 0.3rem;
- background: #efefef;
- padding: 0.2rem 0.3rem;
- font-size: 0.28rem;
- color: #555555;
- line-height: 0.4rem;
- }
- .datalist {
- position: relative;
- }
- .datalistlet {
- background-color: #cccccc;
- }
- .datalist .active {
- background: #f76649 !important;
- color: #efefef !important;
- }
- .msg {
- height: 0.88rem;
- margin-top: 0.3rem;
- color: #ccc;
- background: #333;
- }
- .classifyactive {
- color: #f76649;
- border-bottom: 2px solid #f76649;
- }
- .classify {
- height: 0.88rem;
- font-size: 0.3rem;
- line-height: 0.66rem;
- font-weight: normal;
- color: #777777;
- background-color: #efefef;
- padding: 0.1rem 0;
- }
- .active {
- color: rgb(247, 102, 73) !important;
- }
- .box {
- background: #ebebeb;
- padding-left: 0.14rem;
- }
- div /deep/ .yd-btn-block{
- height: 100%;
- }
- #NavSlide {
- width: 100%;
- overflow: hidden;
- }
- #NavSlide nav {
- padding-top: 0.1rem;
- display: -webkit-box;
- display: -ms-flexbox;
- display: flex;
- -webkit-box-align: middle;
- -ms-flex-align: middle;
- align-items: middle;
- overflow: auto;
- }
- div /deep/ .yd-datetime-content,
- div /deep/ .yd-datetime-shade,
- div /deep/ .yd-datetime-indicator {
- height: 2rem !important;
- }
- div /deep/ .yd-button {
- padding: 0;
- width: 100%;
- height: 100%;
- }
- div /deep/ .yd-button button {
- margin: 0;
- border-radius: 0;
- }
- #NavSlide p {
- text-align: center;
- font-size: 0.28rem;
- -ms-flex-negative: 0;
- flex-shrink: 0;
- padding: 0 0.1rem;
- color: #b8b8b8;
- }
- /* #NavSlide p a{
- color: #E5E5E5;
- text-decoration: none;
- } */
- #NavSlide p span.active {
- color: #363636;
- }
- .head_on_box {
- padding: 0 0.32rem;
- }
- .box {
- height: 0.88rem;
- background: linear-gradient(to bottom, #999999, #6a6a6b);
- overflow: hidden;
- }
- .user-ion {
- width: 0.3rem;
- height: 0.3rem;
- }
- #NavSlide p {
- width: 1.1rem;
- }
- </style>
|