wangxin 6 سال پیش
والد
کامیت
81d8c4af02

+ 1 - 1
components/wxa-plugin-canvas/poster/index.js

@@ -61,7 +61,7 @@ Component({
         onCreate() {
             !this.data.hideLoading && wx.showLoading({ mask: true, title: '生成中' });
             return this.downloadResource().then(() => {
-                !this.data.hideLoading && wx.hideLoading();
+                // !this.data.hideLoading && wx.hideLoading();
                 const poster = this.selectComponent('#poster');
                 poster.create(this.data.config);
             })

+ 6 - 6
config/config.js

@@ -1,11 +1,11 @@
 // 测试服
-// const apiUrl = "https://kf.hap-job.com/happyjob"
-// const imgServerUrl = "https://hpjobtest.oss-cn-shanghai.aliyuncs.com/uploadfiles/mina"//图片服务器地址
-// const imgServerUrl_new = "https://hpjobtest.oss-cn-shanghai.aliyuncs.com"//图片服务器地址
+const apiUrl = "https://kf.hap-job.com/happyjob"
+const imgServerUrl = "https://hpjobtest.oss-cn-shanghai.aliyuncs.com/uploadfiles/mina"//静态资源图片服务器地址
+const imgServerUrl_new = "https://hpjobtest.oss-cn-shanghai.aliyuncs.com"//图片服务器地址
 // 正式服
-const apiUrl = "https://web.hap-job.com/happyjob"
-const imgServerUrl = "https://happyjob.oss-cn-shanghai.aliyuncs.com/uploadfiles/mina"//图片服务器地址
-const imgServerUrl_new = "https://happyjob.oss-cn-shanghai.aliyuncs.com"//图片服务器地址
+// const apiUrl = "https://web.hap-job.com/happyjob"
+// const imgServerUrl = "https://happyjob.oss-cn-shanghai.aliyuncs.com/uploadfiles/mina" //图片服务器地址
+// const imgServerUrl_new = "https://happyjob.oss-cn-shanghai.aliyuncs.com" //图片服务器地址
 
 module.exports = {
   apiUrl,

+ 0 - 4
pages/bus-detail/bus-detail.wxss

@@ -3,12 +3,8 @@
 .description {
   font-size: 26rpx;
   padding: 15rpx 30rpx;
-  text-align: center;
 }
 
-.description text {
-  text-align: left;
-}
 
 .empty {
   font-size: 24rpx;

+ 1 - 1
pages/company-desc/company-desc.wxml

@@ -1,6 +1,6 @@
 <!--pages/company-desc/company-desc.wxml-->
 
 <view class="description">
-  <text>{{description}}</text>
+  <view>{{description}}</view>
 </view>
 <view class="empty" wx:if="{{!description}}">暂无简介</view>

+ 2 - 1
pages/company-desc/company-desc.wxss

@@ -6,7 +6,8 @@
   text-align: center;
 }
 
-.description text {
+.description view {
+  display: inline-block;
   text-align: left;
 }
 

+ 3 - 5
pages/detail/index.js

@@ -105,7 +105,7 @@ Page({
     return {
       title: this.data.postitionDetail.positionName,
       path: '/pages/detail/index?pc=' + this.data.positionCategory + '&pd=' + this.data.hpPositionId,
-      imageUrl: '/images/happyjob/detail_share.jpg'
+      imageUrl: this.data.imgServerUrl + '/images/happyjob/detail_share.jpg'
     }
   },
   getQuery(data) {
@@ -173,9 +173,6 @@ Page({
     Poster.create();
   },
   onPosterSuccess(e) {
-    wx.showLoading({
-      title: '加载中...',
-    })
     var detail = e.detail;
     this.setData({
       shareImg: detail,
@@ -184,10 +181,11 @@ Page({
     wx.hideLoading()
   },
   onPosterFail(err) {
+    wx.hideLoading()
     console.error(err);
   },
   share() {
-    
+
     let blocks = [];
     let block = [];
     let y = 598;

+ 3 - 3
pages/expense/pages/wages/detail.wxml

@@ -81,17 +81,17 @@
 
   <view class="cell">
     <text>应发合计:</text>
-    <text>{{grossPayment}}</text>
+    <text>{{grossPayment}}</text>
   </view>
 
   <view class="cell">
     <text>扣款合计:</text>
-    <text>{{totalChargeback}}</text>
+    <text>{{totalChargeback}}</text>
   </view>
 
   <view class="cell">
     <text>实发工资:</text>
-    <text>{{netPayment}}</text>
+    <text>{{netPayment}}</text>
   </view>
 
 </view>

+ 3 - 3
pages/expense/pages/wages/index.wxs

@@ -6,10 +6,10 @@ function formatDate(date) {
   var _date = null;
   _date = getDate(date);
 
-  var year = _date.getFullYear()
-  var month = _date.getMonth() + 1
+  var year = _date.getFullYear();
+  var month = _date.getMonth() + 1;
 
-  return year + '年' + month + '月';
+  return year + '年' + (month.toString()[1] ? month : '0' + month) + '月';
 }
 
 function formatNumber(number) {

+ 15 - 3
pages/mine/index.js

@@ -317,10 +317,22 @@ Page({
   },
   toPayRoll(e) {
     if (!this.data.isLogin) {
-      wx.navigateTo({
-        url: '/pages/login/login',
+      wx.showModal({
+        title: '提示',
+        content: '你还未登录,请先登录小程序',
+        showCancel: false,
+        success: res => {
+          if (res.confirm) {
+            // wx.navigateBack({
+            //   delta: 1,
+            // })
+            wx.navigateTo({
+              url: '/pages/login/login',
+            })
+          }
+        }
       })
-      return;
+      return false;
     }
     // if (this.data.approveStatus === 0) {
     //   this.setData({

+ 7 - 21
pages/pt-share/pt-share.js

@@ -180,28 +180,17 @@ Page({
 
   //获取历史记录
   fetchData() {
-    // wx.showLoading({
-    //   title: 'loading',
-    //   mask: true
-    // });
-    wx.showToast({
-      icon: 'loading',
+    wx.showLoading({
       title: 'loading',
-      mask: true,
-      duration: 10000
-    })
+      mask: true
+    });
     var that = this
     return new Promise(function(resolve, reject) {
       try {
         var value = wx.getStorageSync('groupDetail')
         if (value) {
           // Do something with return value
-          wx.showToast({
-            icon: 'loading',
-            title: 'loading',
-            mask: true,
-            duration: 0
-          })
+          wx.hideLoading()
           that.setData({
             postitionDetail: value,
             qrcode: value.qrcodeUrl,
@@ -211,12 +200,7 @@ Page({
       } catch (e) {
         // Do something when catch error
         console.log(data)
-        wx.showToast({
-          icon: 'loading',
-          title: 'loading',
-          mask: true,
-          duration: 0
-        })
+        wx.hideLoading()
         reject(data)
       }
     })
@@ -242,8 +226,10 @@ Page({
         })
       }
     })
+    wx.hideLoading()
   },
   onPosterFail(err) {
+    wx.hideLoading()
     console.error(err);
   },
 

+ 1 - 1
project.config.json

@@ -34,7 +34,7 @@
 	},
 	"compileType": "miniprogram",
 	"libVersion": "2.9.4",
-	"appid": "wx1e8ed93850777ffb",
+	"appid": "wx5ae6908ae55edcb7",
 	"projectname": "kaixin",
 	"debugOptions": {
 		"hidedInDevtools": []

+ 29 - 25
utils/http.js

@@ -37,26 +37,26 @@ const http = (params) => {
   // console.log(params)
   //返回promise 对象
   return new Promise((resolve, reject) => {
-    wx.showToast({
-      icon: 'loading',
-      title: '加载中...',
+    // wx.showToast({
+    //   icon: 'loading',
+    //   title: '加载中...',
+    //   mask: true,
+    //   duration: 10000,
+    //   success: res => {
+    //     console.log(new Date())
+    //     loading = false
+    //   }
+    // })
+    if (loading) {
+
+    }
+    wx.showLoading({
+      title: 'loading',
       mask: true,
-      duration: 10000,
       success: res => {
-        console.log(new Date())
         loading = false
       }
-    })
-    if (loading) {
-
-      // wx.showLoading({
-      //   title: 'loading',
-      //   mask: true,
-      //   success: res => {
-      //     loading = false
-      //   }
-      // });
-    }
+    });
     console.log(params.url)
     wx.request({
       url: apiUrl + params.url, //服务器url+参数中携带的接口具体地址
@@ -69,16 +69,20 @@ const http = (params) => {
       responseType: params.responseType, //响应的数据类型
       success: function(res) {
         console.log("res=>", res.data)
-        // wx.hideLoading();
+        wx.hideLoading({
+          success: res => {
+            loading = true
+          }
+        });
         if (res.statusCode == 200) {
           var errorCode = res.data.errcode
           if (errorCode == 0) {
-            wx.hideToast()
-            wx.showToast({
-              icon: 'loading',
-              title: '加载中...',
-              duration: 0
-            })
+            // wx.hideToast()
+            // wx.showToast({
+            //   icon: 'loading',
+            //   title: '加载中...',
+            //   duration: 0
+            // })
             return resolve(res.data)
           } else if (errorCode == 1014) {
             wx.setStorageSync('openId', res.data.data.openId);
@@ -133,7 +137,7 @@ const http = (params) => {
           } else if (errorCode == 2006) {
             //后台接口异常
           }
-          showToast(res.data.errmsg);
+          params.data.task_id !== 10 && showToast(res.data.errmsg);
           reject(res.data);
         } else {
           //2. 操作不成功返回数据,以toast方式弹出响应信息,如后端未格式化非操作成功异常信息,则可以统一定义异常提示
@@ -147,12 +151,12 @@ const http = (params) => {
         }
       },
       fail: function(e) {
-        // wx.hideLoading()
         console.log('error=>', e)
         wx.showToast({
           icon: "none",
           title: "网络异常",
           success: () => {
+            loading = true
             reject()
           }
         })