123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156 |
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="utf-8">
- <title>开机奖励-产品中心-创业帮</title>
- <meta name="keywords" content="开机奖励-产品中心-创业帮">
- <meta name="description" content="开机奖励-产品中心-创业帮">
- <meta content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,shrink-to-fit=no,user-scalable=no" name="viewport" viewport="cover">
- <meta name="apple-mobile-web-app-capable" content="yes">
- <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
- <meta content="telephone=no" name="format-detection">
- <meta content="email=no" name="format-detection">
- <meta name="apple-mobile-web-app-title" content="开机奖励-产品中心-创业帮">
- <meta http-equiv="Cache-Control" content="no-siteapp">
- <link rel="stylesheet" href="./static/css/main.css">
- </head>
- <body class="bgc-back h100p ovh pt0" style="padding-top:0;">
- <div id="app">
- <van-nav-bar class="user_rank_explan_title user_title_normal" left-arrow :title="'开机奖励-'+title" v-if="toptitleisshow" @click-left="goback">
- <template #left> <img src="./static/images/left.png" alt=""></template>
- </van-nav-bar>
- <van-tabs v-model="active" animated swipeable line-width="20" title-active-color="#ff502a" @change="changetab" line-height="2" :ellipsis="false" sticky v-cloak>
- <van-tab class="top_line" title="按日查询">
- <div class="bgcfff">
- <div class="ovh-x" ref="wrapper1">
- <van-pull-refresh v-model="refreshing" @refresh="onRefresh" style="height:100%;" :class="transactions.length === 0 ? 'isnodata':''">
- <van-empty class="custom-image" image="./static/images/empty-img.png" description="暂无数据" v-if="isnodata"></van-empty>
- <van-list v-model="loading" :finished="finished" finished-text="没有更多数据了" @load="onLoad" :immediate-check="false">
- <van-cell-group :border="false">
- <van-cell v-for="item,index in transactions" @click="bootdetail(item.DateValue)" :title="item.Date" :value="item.RewardAmount +'元'" title-class="f12 c333" value-class="f12" center is-link></van-cell>
- </van-cell-group>
- </van-list>
- </van-pull-refresh>
- </div>
- </div>
- </van-tab>
- <van-tab class="top_line" title="按月查询">
- <div class="bgcfff">
- <div class="ovh-x" ref="wrapper2">
- <van-pull-refresh v-model="refreshing" @refresh="onRefresh" style="height:100%;" :class="transactions.length === 0 ? 'isnodata':''">
- <van-empty class="custom-image" image="./static/images/empty-img.png" description="暂无数据" v-if="isnodata"></van-empty>
- <van-list v-model="loading" :finished="finished" finished-text="没有更多数据了" @load="onLoad" :immediate-check="false">
- <van-cell-group :border="false">
- <van-cell v-for="item,index in transactions" :title="item.Date" :value="item.RewardAmount+'元'" title-class="f12 c333" value-class="f12" center></van-cell>
- </van-cell-group>
- </van-list>
- </van-pull-refresh>
- </div>
- </div>
- </van-tab>
- </van-tabs>
- </div>
- <script src="./static/js/klm-vv.min.js"></script>
- <script src="./static/js/appfunc.min.js"></script>
- <script src="./static/js/klm-axios-config.js"></script>
- <script src="./static/js/publicfn.js"></script>
- <script>
- // 通过 CDN 引入时不会自动注册 Lazyload 组件
- // 可以通过下面的方式手动注册
- Vue.use(vant.Lazyload);
- PublicLib.SetStatusBarBgColor({bgcolor:'ffffff'});
- // 在 #app 标签下渲染一个按钮组件
- let app = new Vue({
- el: '#app',
- data() {
- return {
- isnodata:false,
- toptitleisshow:false,
- active: 0,
- title:'',
- transactions: [
- ],
- loading: false,
- finished: false,
- refreshing: false,
- pageinfo:{
- PageSize:20,
- PageNum:1
- }
- };
- },
- created(){
- this.toptitleisshow = toptitleisshow;
- this.title = PublicLib.getCookieInfo('productMachineType');
- this.getbootlist();
- PublicLib.SetTitle({Title:'开机奖励-'+ PublicLib.getCookieInfo('productMachineType')});
- },
- beforeUpdate() {
- this.$nextTick(() => {
- this.$refs.wrapper1.style.height = `${document.documentElement.clientHeight - 44}px`;
- });
- },
- watch:{
- active(value){
- if(value === 1){
- this.$nextTick(() => {
- this.$refs.wrapper2.style.height = `${document.documentElement.clientHeight - 44}px`;
- });
- };
- }
- },
- methods: {
- goback(){
- PublicLib.GoBack({Level:1});
- },
- onLoad() {
- if (this.refreshing) {
- //- this.transactions = [];
- this.refreshing = false;
- this.pageinfo.PageNum = 0;
- };
- this.pageinfo.PageNum++;
- this.getbootlist();
- console.log(this.$refs.wrapper1.scrollTop);
- },
- bootdetail(time){
- PublicLib.putCookieInfo('bootDetailTime', time);
- PublicLib.Goto({Url:'product-profit-boot-detail'});
- },
- onRefresh() {
- // 清空列表数据
- this.finished = false;
- // 重新加载数据
- // 将 loading 设置为 true,表示处于加载状态
- this.loading = true;
- this.pageinfo.PageNum = 1;
- this.getbootlist('refresh');
- },
- changetab(){
- this.pageinfo.PageNum = 1;
- this.getbootlist('refresh');
- },
- async getbootlist(type = 'onload'){
- const ProductType = PublicLib.getCookieInfo('productMachineId');
- const UserId = PublicLib.getCookieInfo('userId');
- const Kind = this.active === 0 ? 1 : 2;
- const res = await getRequest('api/v1/pos/openreward/statlist?t='+Math.random(6),JSON.stringify({...this.pageinfo,ProductType,UserId,Kind}));
- if(res.status !== '1')return tips('开机奖励列表获取失败!');
- //- PublicLib.HideLoading();
- if(res.data.length < this.pageinfo.PageSize) {
- this.finished = true;
- };
- if(type === 'refresh'){
- this.transactions = res.data
- this.refreshing = false;
- }else{
- this.transactions.push(...res.data);
- }
- this.loading = false;
- if(this.transactions.length === 0) {this.isnodata = true}else{this.isnodata = false};
- },
- }
- });
- </script>
- </body>
- </html>
|