Przeglądaj źródła

广告,分页

XWookey 2 lat temu
rodzic
commit
c2c7a640d6

+ 4 - 0
app.js

@@ -3,8 +3,12 @@ let wechat = require('./utils/wechat.js');
 let log = require('./utils/log.js');
 App({
   globalData: {
+    // 本机调试
+    // postHeadAgreement: 'http://127.0.0.1:10301',
+
     // 测试
     // postHeadAgreement: 'https://jqcs.pjnes.com/cloud/chargapi',
+
     // 正式
     postHeadAgreement: 'https://cdglyy.pjnes.com/cloud/chargapi',
     helpPhoneNum: '4009608068',

+ 3 - 3
pages/chargemoney/chargemoney.wxml

@@ -46,9 +46,9 @@
   
 </view>
 
-<view style="width: 100%;margin-top:50rpx">
-        <ad unit-id="adunit-8eb13875bcf592b0" ad-intervals="30"></ad>
-    </view>
+<!-- <view style="width: 100%;margin-top:50rpx">
+  <ad unit-id="adunit-8eb13875bcf592b0" ad-intervals="30"></ad>
+</view> -->
 
 <button class='{{chargemoney_select>0?"chargemoney_button":"chargemoney_button_disable"}}' bindtap="{{chargemoney_select>0?'beginChargemoney':''}}">立即充值</button>
 <view class="foot"><text>点击立即充值即表示同意</text><text class='blue'>充值协议</text></view>

+ 3 - 3
pages/forget/forget.wxml

@@ -23,9 +23,9 @@
       下一步
     </button>
 
-    <view style="width: 100%;margin-top:50rpx">
-        <ad unit-id="adunit-8eb13875bcf592b0" ad-intervals="30"></ad>
-    </view>
+    <!-- <view style="width: 100%;margin-top:50rpx">
+      <ad unit-id="adunit-8eb13875bcf592b0" ad-intervals="30"></ad>
+    </view> -->
 
   </view>
 </view>

+ 3 - 3
pages/login/login.wxml

@@ -20,8 +20,8 @@
     <text class='register_view'  bindtap='goToRegister'>注册账户</text>
     <text class='forget_view'  bindtap='goToForget'>忘记密码?</text>
     </view>
-    <view style="width: 100%;margin-top:50rpx">
-        <ad unit-id="adunit-8eb13875bcf592b0" ad-intervals="30"></ad>
-    </view>
+    <!-- <view style="width: 100%;margin-top:50rpx">
+      <ad unit-id="adunit-8eb13875bcf592b0" ad-intervals="30"></ad>
+    </view> -->
   </view>
 </view>

+ 2 - 2
pages/order/order.wxml

@@ -65,9 +65,9 @@
     </view>
   </view>-->
   
-  <view style="width: 100%;margin-top:50rpx">
+  <!-- <view style="width: 100%;margin-top:50rpx">
     <ad unit-id="adunit-8eb13875bcf592b0" ad-intervals="30"></ad>
-  </view>
+  </view> -->
 
 </view>
 

+ 3 - 3
pages/outmoney/outmoney.wxml

@@ -11,7 +11,7 @@
   </picker>
 </view>
 
-<view style="width: 100%;margin-top:50rpx">
-        <ad unit-id="adunit-8eb13875bcf592b0" ad-intervals="30"></ad>
-    </view>
+<!-- <view style="width: 100%;margin-top:50rpx">
+  <ad unit-id="adunit-8eb13875bcf592b0" ad-intervals="30"></ad>
+</view> -->
 <button class='{{checkPass?"outmoney_button":"outmoney_button_disable"}}' bindtap="{{checkPass?'beginOutMoney':''}}" >立即提现</button>

+ 3 - 3
pages/register/register.wxml

@@ -41,8 +41,8 @@
     <button class='{{checkPass?"login_button":"login_button_disable"}}' bindtap="{{checkPass?'getUserProfile':''}}">
       注册
     </button>
-    <view style="width: 100%;margin-top:50rpx">
-        <ad unit-id="adunit-8eb13875bcf592b0" ad-intervals="30"></ad>
-    </view>
+    <!-- <view style="width: 100%;margin-top:50rpx">
+      <ad unit-id="adunit-8eb13875bcf592b0" ad-intervals="30"></ad>
+    </view> -->
   </view>
 </view>

+ 3 - 3
pages/reset_password/reset_password.wxml

@@ -18,9 +18,9 @@
     </view>
     <view class="errorMsg"><text>{{errorMsg}}</text></view>
 
-    <view style="width: 100%;margin-top:50rpx">
-        <ad unit-id="adunit-8eb13875bcf592b0" ad-intervals="30"></ad>
-    </view>
+<!-- <view style="width: 100%;margin-top:50rpx">
+  <ad unit-id="adunit-8eb13875bcf592b0" ad-intervals="30"></ad>
+</view> -->
     
     <button class='{{checkPass?"login_button":"login_button_disable"}}' bindtap="{{checkPass?'resetPassword':''}}">
       确认

+ 3 - 3
pages/scan_result/scan_result.wxml

@@ -71,6 +71,6 @@
   </view>
   <button wx:if="{{chargPile}}" class='charg_button' bindtap="beginCharge" >开始充电</button>
 
-  <view style="width: 100%;margin-top:50rpx">
-        <ad unit-id="adunit-8eb13875bcf592b0" ad-intervals="30"></ad>
-    </view>
+<!-- <view style="width: 100%;margin-top:50rpx">
+  <ad unit-id="adunit-8eb13875bcf592b0" ad-intervals="30"></ad>
+</view> -->

+ 3 - 3
pages/ucenter/center/center.wxml

@@ -51,9 +51,9 @@
       </view>
     </view>
 
-    <view style="width: 100%;margin-top:50rpx">
-        <ad unit-id="adunit-8eb13875bcf592b0" ad-intervals="30"></ad>
-    </view>
+<!-- <view style="width: 100%;margin-top:50rpx">
+  <ad unit-id="adunit-8eb13875bcf592b0" ad-intervals="30"></ad>
+</view> -->
     
     <view class="errorMsg">
       <text>{{errorMsg}}</text>

+ 68 - 24
pages/ucenter/chargemoneylog/chargemoneylog.js

@@ -7,7 +7,13 @@ Page({
   data: {
     chargemoneylogs: [],
     userInfo: {},
-    isLogin: false
+    isLogin: false,
+    pagesize:10,
+    pagenum:1,
+    total:-1,
+    loadTotal: 0,
+    dataLoading: false,
+    finishedLoadTap: 0
   },
 
   /**
@@ -17,33 +23,70 @@ Page({
     let userInfo = wx.getStorageSync('userInfo');
     let isLogin = wx.getStorageSync('isLogin');
     this.setData({
-      userInfo,
-      isLogin
+      userInfo:userInfo,
+      isLogin:isLogin
     });
     let that = this;
+
     // 页面显示
     if (userInfo && isLogin) {
-      wx.request({
-        url: getApp().globalData.postHeadAgreement +'/restapi/wechat/rechargeList',
-        data: {
-          userId: userInfo.userId
-        },
-        method: 'POST',
-        success(res) {
-          console.log(res);
-          let chargemoneylogs = res.data;
-          for (var i = 0; i < chargemoneylogs.length ; i++){
-            chargemoneylogs[i].rechargeTimeDate = chargemoneylogs[i].rechargeTime.split(" ")[0];
-            chargemoneylogs[i].rechargeTimeTime =chargemoneylogs[i].rechargeTime.split(" ")[1];
-          }
-          that.rechargeTimeOrder(chargemoneylogs);
-          that.setData({
-            chargemoneylogs
-          });
-        }
-      });
+      this.getPage()
     }
   },
+  getPage(){
+
+    if(this.data.chargemoneylogs.length == this.data.total){
+      this.setData({
+        finishedLoadTap:this.data.finishedLoadTap+1
+      })
+      if(this.data.finishedLoadTap>0){
+        wx.showToast({
+          title: '全部加载完毕',
+          icon: 'success',
+          duration: 2000
+        })
+      }
+      return
+    }
+
+    if(this.data.dataLoading){
+      return
+    }
+    this.setData({
+      dataLoading: true
+    })
+    wx.showLoading({
+      title: '数据加载中....',
+    })
+
+  let that = this;
+    wx.request({
+      url: getApp().globalData.postHeadAgreement +'/restapi/wechat/rechargeList',
+      data: {
+        userId:  wx.getStorageSync('userInfo').userId,
+        pagenum: this.data.pagenum++,
+        pagesize: 10,
+      },
+      method: 'POST',
+      success(res) {
+        console.log(res);
+        let chargemoneylogs = res.data.rows;
+        for (var i = 0; i < chargemoneylogs.length ; i++){
+          chargemoneylogs[i].rechargeTimeDate = chargemoneylogs[i].rechargeTime.split(" ")[0];
+          chargemoneylogs[i].rechargeTimeTime =chargemoneylogs[i].rechargeTime.split(" ")[1];
+        }
+        // that.rechargeTimeOrder(chargemoneylogs);
+        wx.hideLoading()
+        that.setData({
+          chargemoneylogs: that.data.chargemoneylogs.concat(chargemoneylogs),
+          total: res.data.total,
+          dataLoading: false
+        });
+      }
+    });
+
+  },
+
   rechargeTimeOrder(chargemoneylogs) {
     if (chargemoneylogs && 0 != chargemoneylogs.length) {
       chargemoneylogs.sort(function(ma, mb) {
@@ -86,12 +129,13 @@ Page({
   onPullDownRefresh: function() {
 
   },
-
+  bindScrollTolowerEvent: function(){
+    this.getPage();
+  },
   /**
    * 页面上拉触底事件的处理函数
    */
   onReachBottom: function() {
-
   },
 
   /**

+ 1 - 1
pages/ucenter/chargemoneylog/chargemoneylog.wxml

@@ -8,7 +8,7 @@
   <text class='money'>金额(元)</text>
   <text class='state'>状态</text>
 </view>
-<scroll-view class='context' scroll-y='true'>
+<scroll-view class='context' scroll-y='true' bindscrolltolower="bindScrollTolowerEvent" >
   <view class="text_context" hover-class='active' data-keywords="{{item}}" wx:key='{{key}}' wx:for="{{chargemoneylogs}}">
     <view class="time">
       <text>{{item.rechargeTimeDate}}</text>

+ 68 - 22
pages/ucenter/charginglog/charginglog.js

@@ -6,7 +6,13 @@ Page({
    * 页面的初始数据
    */
   data: {
-    charginglogs: []
+    charginglogs: [],
+    pagesize:10,
+    pagenum:1,
+    total:-1,
+    loadTotal: 0,
+    dataLoading: false,
+    finishedLoadTap: 0
   },
 
   /**
@@ -18,28 +24,66 @@ Page({
     let that = this;
     // 页面显示
     if (userInfo && isLogin) {
-      wx.request({
-        url: getApp().globalData.postHeadAgreement +'/restapi/pileLog/wechatuserallcharglog',
-        data: {
-          userId: userInfo.userId
-        },
-        method: 'POST',
-        success(res) {
-          console.log(res);
-          if (res.data.result) {
-            let {
-              result: charginglogs
-            } = res.data;
-            that.startTimeOrder(charginglogs);
-            that.formatCharginglogs(charginglogs);
-            that.setData({
-              charginglogs
-            });
-          }
-        }
-      });
+      this.getPage();
+    }
+  },
+  getPage(){
+    console.info(this.data.charginglogs.length + " MMM " + this.data.total)
+    
+    if(this.data.charginglogs.length == this.data.total){
+      this.setData({
+        finishedLoadTap:this.data.finishedLoadTap+1
+      })
+      if(this.data.finishedLoadTap>0){
+        wx.showToast({
+          title: '全部加载完毕',
+          icon: 'success',
+          duration: 2000
+        })
+      }
+      return
+    }
+
+    if(this.data.dataLoading){
+      return
     }
+    this.setData({
+      dataLoading: true
+    })
+    wx.showLoading({
+      title: '数据加载中....',
+    })
+
+  let that = this;
+
+    wx.request({
+      url: getApp().globalData.postHeadAgreement +'/restapi/pileLog/wechatuserallcharglog',
+      data: {
+        userId: wx.getStorageSync('userInfo').userId,
+        pagenum: this.data.pagenum++,
+        pagesize: 10,
+      },
+      method: 'POST',
+      success(res) {
+        console.log(res);
+        if (res.data.result.rows) {
+          let {
+            rows: charginglogs
+          } = res.data.result;
+          // that.startTimeOrder(charginglogs);
+          that.formatCharginglogs(charginglogs);
+          wx.hideLoading()
+          that.setData({
+            charginglogs: that.data.charginglogs.concat(charginglogs),
+            total: res.data.result.total,
+            dataLoading: false
+          });
+        }
+      }
+    });
   },
+
+
   formatCharginglogs(charginglogs) {
     charginglogs.forEach((item, index) => {
       try {
@@ -112,7 +156,9 @@ Page({
   onReachBottom: function() {
 
   },
-
+  bindScrollTolowerEvent: function(){
+    this.getPage();
+  },
   /**
    * 用户点击右上角分享
    */

+ 1 - 1
pages/ucenter/charginglog/charginglog.wxml

@@ -1,5 +1,5 @@
 <!--pages/ucenter/charginglog/charginglog.wxml-->
-<scroll-view class='context' scroll-y='true'>
+<scroll-view class='context' scroll-y='true'  bindscrolltolower="bindScrollTolowerEvent" >
   <view class='context_block'></view>
   
   <view class="text_context" wx:for="{{charginglogs}}" wx:key="id" wx:for-item="charginglog" hover-class='active'>

+ 3 - 3
pages/ucenter/help/help.wxml

@@ -13,9 +13,9 @@
 
   </view>
 
-  <view style="width: 100%;margin-top:50rpx">
-        <ad unit-id="adunit-8eb13875bcf592b0" ad-intervals="30"></ad>
-    </view>
+<!-- <view style="width: 100%;margin-top:50rpx">
+  <ad unit-id="adunit-8eb13875bcf592b0" ad-intervals="30"></ad>
+</view> -->
   <!-- <view class='title1'>
     <text class='blod'>常见问题</text>
   </view> -->

+ 3 - 3
pages/ucenter/index/index.wxml

@@ -15,9 +15,9 @@
   <!-- <view class="banner">
     <image src='/banner/banner1.png'></image>
   </view> -->
-  <view style="width: 100%;">
-        <ad unit-id="adunit-8eb13875bcf592b0" ad-intervals="30"></ad>
-    </view>
+<!-- <view style="width: 100%;">
+  <ad unit-id="adunit-8eb13875bcf592b0" ad-intervals="30"></ad>
+</view> -->
   <view class="context" wx:if='{{!userInfo.flag}}' >
     <view class='context_view' bindtap="goPurse" hover-class='active'>
       <image class='my_purse' src='/images/my_purse.png'></image>

+ 3 - 3
pages/ucenter/purse/purse.wxml

@@ -18,6 +18,6 @@
     <text>提现</text>
   </view>
 </view>
-<view style="width: 100%;margin-top:50rpx">
-        <ad unit-id="adunit-8eb13875bcf592b0" ad-intervals="30"></ad>
-    </view>
+<!-- <view style="width: 100%;margin-top:50rpx">
+  <ad unit-id="adunit-8eb13875bcf592b0" ad-intervals="30"></ad>
+</view> -->

+ 12 - 3
pages/worksheetinfo/worksheetinfo.js

@@ -65,7 +65,8 @@ Page({
     excepttime: null,
     finishdate: null,
     finishtime: null,
-    accendantids: []
+    accendantids: [],
+    userNames:[]
   },
   bindChargstationsChange: function(e) {
     if (this.data.chargstationsindex != e.detail.value) {
@@ -157,6 +158,7 @@ Page({
   },
   bindWorkSheetSubmit(e) {
     let worksheetinfo = this.data.worksheetinfo;
+    worksheetinfo.operatorName = this.data.userNames.length>0?this.data.userNames[0]:"";
     worksheetinfo.pams = this.data.accendantids;
     worksheetinfo.accendant = null;
     if (this.data.exceptdate && this.data.excepttime) {
@@ -423,7 +425,11 @@ Page({
       let pcitures_src = worksheetinfo.pciture.split(",");
       var pcitures = [];
       pcitures_src.forEach((item, index) => {
-        pcitures[index] = { src: item, flag: item.indexOf('https://cdgl.pjnes.com/profile/station/') != -1};
+        // pcitures[index] = { src: item, flag: item.indexOf('https://cdgl.pjnes.com/profile/station/') != -1};
+        let url = getApp().globalData.postHeadAgreement
+        url = url.replace("cloud/chargapi","") + "web/profile/station/" + item
+        console.info(url)
+        pcitures[index] = { url:url, src: item, flag: item.indexOf(getApp().globalData.postHeadAgreement) != -1};
       });
       this.setData({
         pcitures
@@ -480,11 +486,14 @@ Page({
       success(res) {
         //console.log(res);
         let accendantids = [];
+        let userNames = [];
         res.data.forEach((item, index) => {
           accendantids.push(item.userId);
+          userNames.push(item.userName);
         });
         that.setData({
-          accendantids
+          accendantids,
+          userNames
         });
       }
     });

+ 2 - 1
pages/worksheetinfo/worksheetinfo.wxml

@@ -66,7 +66,8 @@
       <view class="q-image-wrap">
         <image wx:if="{{item.flag}}" class="q-image" src="{{item.src}}" mode="aspectFill" data-idx="{{index}}"></image>
         <!-- 图片缩略图  -->
-        <image wx:if="{{!item.flag}}" class="q-image" src="https://cdgl.pjnes.com/profile/station/{{item.src}}" mode="aspectFill" data-idx="{{index}}"></image>
+        <image wx:if="{{!item.flag}}" class="q-image" src="{{item.url}}" mode="aspectFill" data-idx="{{index}}"></image>
+        <!-- <image wx:if="{{!item.flag}}" class="q-image" src="https://cdgl.pjnes.com/profile/station/{{item.src}}" mode="aspectFill" data-idx="{{index}}"></image> -->
         <view wx:if="{{worksheetinfo.workStatus!=6}}" class="q-image-remover" data-idx="{{index}}" bindtap="removePciture">删除</view>
       </view>
     </block>

+ 15 - 37
project.config.json

@@ -19,8 +19,6 @@
     "uploadWithSourceMap": true,
     "compileHotReLoad": false,
     "useMultiFrameRuntime": true,
-    "useApiHook": true,
-    "useApiHostProcess": false,
     "babelSetting": {
       "ignore": [],
       "disablePlugins": [],
@@ -34,125 +32,105 @@
     "userConfirmedBundleSwitch": false,
     "packNpmManually": false,
     "packNpmRelationList": [],
-    "minifyWXSS": true
+    "minifyWXSS": true,
+    "ignoreUploadUnusedFiles": true
   },
   "compileType": "miniprogram",
-  "libVersion": "2.25.1",
-  "appid": "wx6e03e5ada030b1aa",
-  "projectname": "%E5%85%85%E7%94%B5%E6%A1%A9",
-  "isGameTourist": false,
   "simulatorType": "wechat",
   "simulatorPluginLibVersion": {},
   "condition": {
-    "search": {
-      "list": []
-    },
-    "conversation": {
-      "list": []
-    },
-    "plugin": {
-      "list": []
-    },
-    "game": {
-      "currentL": -1,
-      "list": []
-    },
-    "gamePlugin": {
-      "list": []
-    },
     "miniprogram": {
       "list": [
         {
-          "id": -1,
           "name": "登录",
           "pathName": "pages/login/login",
           "query": "",
           "scene": null
         },
         {
-          "id": -1,
           "name": "忘记密码",
           "pathName": "pages/forget/forget",
           "query": "",
           "scene": null
         },
         {
-          "id": 2,
           "name": "找回密码",
           "pathName": "pages/reset_password/reset_password",
           "query": "loginName=1234444",
           "scene": null
         },
         {
-          "id": -1,
           "name": "注册",
           "pathName": "pages/register/register",
           "query": "",
           "scene": null
         },
         {
-          "id": 4,
           "name": "我的",
           "pathName": "pages/ucenter/index/index",
           "query": "",
           "scene": null
         },
         {
-          "id": -1,
           "name": "充值记录",
           "pathName": "pages/ucenter/chargemoneylog/chargemoneylog",
           "query": "",
           "scene": null
         },
         {
-          "id": -1,
           "name": "充值",
           "pathName": "pages/chargemoney/chargemoney",
           "query": "",
           "scene": null
         },
         {
-          "id": 7,
           "name": "充电中",
           "pathName": "pages/charging/charging",
           "query": "",
           "scene": null
         },
         {
-          "id": -1,
           "name": "客服中心",
           "pathName": "pages/ucenter/help/help",
           "query": "",
           "scene": null
         },
         {
-          "id": -1,
           "name": "我的钱包",
           "pathName": "pages/ucenter/purse/purse",
           "query": "",
           "scene": null
         },
         {
-          "id": -1,
           "name": "充电记录",
           "pathName": "pages/ucenter/charginglog/charginglog",
           "query": "",
           "scene": null
         },
         {
-          "id": -1,
           "name": "终端详情",
           "pathName": "pages/scan_result/scan_result",
           "query": "",
           "scene": null
         },
         {
-          "id": -1,
           "name": "去支付",
           "pathName": "pages/order/order",
+          "query": "",
           "scene": null
         }
       ]
     }
-  }
+  },
+  "editorSetting": {
+    "tabIndent": "insertSpaces",
+    "tabSize": 2
+  },
+  "libVersion": "2.25.1",
+  "packOptions": {
+    "ignore": [],
+    "include": []
+  },
+  "appid": "wx6e03e5ada030b1aa",
+  "projectname": "%E5%85%85%E7%94%B5%E6%A1%A9"
 }

+ 4 - 0
project.private.config.json

@@ -0,0 +1,4 @@
+{
+  "description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html",
+  "libVersion": "2.26.1"
+}