ソースを参照

Merge branch 'master' of http://s.dev01.dkiboss.com:9001/iBOSS-2.0-Mini/iboss_wx_app

liuyao 1 年間 前
コミット
b2f2c2a358

+ 1 - 0
package-basic-data/pages/activity/activity.js

@@ -431,6 +431,7 @@ Page({
         params.buyBeginDate = summaryInfo.buyBeginDate;
         params.buyBeginDate = summaryInfo.buyBeginDate;
         params.buyEndDate = summaryInfo.endDate
         params.buyEndDate = summaryInfo.endDate
         params.extendDays = summaryInfo.extendDays;
         params.extendDays = summaryInfo.extendDays;
+        params.staffNameFrom = app.globalData.user.staffName
         if (this.data.gradeCode == Constants.gradeCode.STD) {
         if (this.data.gradeCode == Constants.gradeCode.STD) {
             params.buyEndDate = summaryInfo.userEndDate
             params.buyEndDate = summaryInfo.userEndDate
             params.endDate = app.globalData.company.endDate
             params.endDate = app.globalData.company.endDate

+ 1 - 1
package-basic-data/pages/func-buy/add-confirm/add-confirm.js

@@ -143,7 +143,7 @@ Page({
             params.vip = true;
             params.vip = true;
         }
         }
         params.buyLong = this.data.extendDays + '天'
         params.buyLong = this.data.extendDays + '天'
-        console.log(params);
+        params.staffNameFrom = app.globalData.user.staffName
         return params;
         return params;
     },
     },
     /**
     /**

+ 16 - 6
package-basic-data/pages/register/company-register/company-register.js

@@ -323,10 +323,10 @@ Page({
     }
     }
     // 从好有分享过来的数据 好友互利共赢  shareType=1 cpid userid startdate enddate 
     // 从好有分享过来的数据 好友互利共赢  shareType=1 cpid userid startdate enddate 
     if (this.data.shareType) {
     if (this.data.shareType) {
-      params.cpIdFrom = this.data.cpIdFrom 
-      params.shareEndDate = this.data.shareEndDate 
-      params.userIdFrom = this.data.userIdFrom 
-      params.staffNameFrom = this.data.staffNameFrom  
+      params.cpIdFrom = this.data.cpIdFrom
+      params.shareEndDate = new Date(this.data.shareEndDate).toDateTimeStr()
+      params.userIdFrom = this.data.userIdFrom
+      params.staffNameFrom = this.data.staffNameFrom
     }
     }
     return params
     return params
   },
   },
@@ -471,6 +471,7 @@ Page({
    * @author : 周兴
    * @author : 周兴
    */
    */
   onLoad: function (options) {
   onLoad: function (options) {
+    console.log(options, "register");
     // 从好有分享过来的数据 好友互利共赢  shareType=1 cpid userid startdate enddate   
     // 从好有分享过来的数据 好友互利共赢  shareType=1 cpid userid startdate enddate   
     if (options.shareType) {
     if (options.shareType) {
       this.setData({
       this.setData({
@@ -518,10 +519,19 @@ Page({
   getCurrentDate() {
   getCurrentDate() {
     let _this = this
     let _this = this
     let service = app.globalData['companyService']
     let service = app.globalData['companyService']
-    _this.excute(service, service.getCurrentDate, {}).then(res => {
+    _this.excute(service, service.getCurrentDate, { flgTime: true }).then(res => {
       if (res.data.code == Constants.SUCESS_CODE) {
       if (res.data.code == Constants.SUCESS_CODE) {
-        //服务器的时间  
+        //服务器的时间 ---带时分秒的
         let nowDate = res.data.data.currentDate
         let nowDate = res.data.data.currentDate
+        // 返回的 邀请 的时间 和服务器的时间
+        if (this.data.shareEndDate && this.data.shareEndDate != null) {
+          let dayDiffs = new Date(nowDate).dayDiff(new Date(this.data.shareEndDate))
+          // 返回的 
+          if (dayDiffs > 0) {
+            util.showToast('邀请的链接已过期');
+          }
+        }
+
         nowDate = new Date(nowDate).toDateStr()
         nowDate = new Date(nowDate).toDateStr()
         _this.setData({
         _this.setData({
           buyBeginDate: nowDate
           buyBeginDate: nowDate

+ 25 - 23
package-basic-data/pages/share/share.js

@@ -147,28 +147,28 @@ Page({
     let service = app.globalData['couponSendService']
     let service = app.globalData['couponSendService']
     return this.excute(service, 'get_item', params)
     return this.excute(service, 'get_item', params)
   },
   },
-  formatDate(isoDateString) {  
+  formatDate(isoDateString) {
     // 首先,尝试将ISO 8601格式的日期字符串转换为Date对象  
     // 首先,尝试将ISO 8601格式的日期字符串转换为Date对象  
-    const date = new Date(isoDateString);  
-    
+    const date = new Date(isoDateString);
+
     // 然后,使用Date对象的方法获取年、月、日、时、分、秒  
     // 然后,使用Date对象的方法获取年、月、日、时、分、秒  
     // 注意月份是从0开始的,所以要+1  
     // 注意月份是从0开始的,所以要+1  
-    const year = date.getUTCFullYear();  
-    const month = String(date.getUTCMonth() + 1).padStart(2, '0');  
-    const day = String(date.getUTCDate()).padStart(2, '0');  
-    const hours = String(date.getUTCHours()).padStart(2, '0');  
-    const minutes = String(date.getUTCMinutes()).padStart(2, '0');  
-    const seconds = String(date.getUTCSeconds()).padStart(2, '0');  
-    
+    const year = date.getUTCFullYear();
+    const month = String(date.getUTCMonth() + 1).padStart(2, '0');
+    const day = String(date.getUTCDate()).padStart(2, '0');
+    const hours = String(date.getUTCHours()).padStart(2, '0');
+    const minutes = String(date.getUTCMinutes()).padStart(2, '0');
+    const seconds = String(date.getUTCSeconds()).padStart(2, '0');
+
     // 最后,按照yyyy-MM-ddTHH:mm:ss的格式拼接字符串  
     // 最后,按照yyyy-MM-ddTHH:mm:ss的格式拼接字符串  
-    return `${year}-${month}-${day}T${hours}:${minutes}:${seconds}`;  
+    return `${year}-${month}-${day}T${hours}:${minutes}:${seconds}`;
   },
   },
   /**
   /**
   * @desc : 获取助力明细
   * @desc : 获取助力明细
   * @author : 刘尧
   * @author : 刘尧
   * @date : 2024/7/30 
   * @date : 2024/7/30 
   */
   */
-  getRegisterItem(){
+  getRegisterItem() {
     let service = app.globalData['integralShareService']
     let service = app.globalData['integralShareService']
     const params = {
     const params = {
       cpId: app.globalData.company.cpId,
       cpId: app.globalData.company.cpId,
@@ -302,7 +302,7 @@ Page({
   * @author : 刘尧
   * @author : 刘尧
   * @date : 2024/8/1 11:32
   * @date : 2024/8/1 11:32
   */
   */
-  insertNewRegisterItem(){
+  insertNewRegisterItem() {
     const params = {
     const params = {
       cpId: app.globalData.company.cpId,
       cpId: app.globalData.company.cpId,
       tacticId: this.data.integralTacticItem.tacticId,
       tacticId: this.data.integralTacticItem.tacticId,
@@ -335,7 +335,7 @@ Page({
   * @author : 刘尧
   * @author : 刘尧
   * @date : 2024/7/30 15:40
   * @date : 2024/7/30 15:40
   */
   */
-  shareIntegral(){
+  shareIntegral() {
     let service = app.globalData['integralShareService']
     let service = app.globalData['integralShareService']
     const params = {
     const params = {
       cpId: app.globalData.company.cpId,
       cpId: app.globalData.company.cpId,
@@ -347,13 +347,13 @@ Page({
     }
     }
     return this.excute(service, service.insert, params)
     return this.excute(service, service.insert, params)
   },
   },
-  
+
   /**
   /**
   * @desc : 获取用户剩余分享次数
   * @desc : 获取用户剩余分享次数
   * @author : 刘尧
   * @author : 刘尧
   * @date : 2024/7/30 15:40
   * @date : 2024/7/30 15:40
   */
   */
-  getShareNumber(){
+  getShareNumber() {
     let service = app.globalData['integralShareService']
     let service = app.globalData['integralShareService']
     const params = {
     const params = {
       cpId: app.globalData.company.cpId,
       cpId: app.globalData.company.cpId,
@@ -374,14 +374,14 @@ Page({
   /**
   /**
    * 用户点击右上角分享
    * 用户点击右上角分享
    */
    */
-  onShareAppMessage: async function(e) {
+  onShareAppMessage: async function (e) {
     const url = this.data.imageUrl + 'share-background.png'
     const url = this.data.imageUrl + 'share-background.png'
     this.setData({
     this.setData({
       cilckViewId: e.target.dataset.detail
       cilckViewId: e.target.dataset.detail
     })
     })
     if (e.target.dataset.detail === "toShare") {
     if (e.target.dataset.detail === "toShare") {
       const integralTacticItem = this.data.integralTacticItem
       const integralTacticItem = this.data.integralTacticItem
-      if(integralTacticItem.shareDayNum > 0){
+      if (integralTacticItem.shareDayNum > 0) {
         const res = await this.shareIntegral()
         const res = await this.shareIntegral()
         if (res.data.code == Constants.SUCESS_CODE) {
         if (res.data.code == Constants.SUCESS_CODE) {
           this.getShareNumber()
           this.getShareNumber()
@@ -393,14 +393,14 @@ Page({
             imageUrl: url
             imageUrl: url
           }
           }
         }
         }
-      }else {
+      } else {
         util.showToast('今日分享已达上限!')
         util.showToast('今日分享已达上限!')
       }
       }
     }
     }
     if (e.target.dataset.detail === "toRegister") {
     if (e.target.dataset.detail === "toRegister") {
       let item = await this.getRegisterItem()
       let item = await this.getRegisterItem()
       item = item.data.data
       item = item.data.data
-      if(item){
+      if (item) {
         const that = this
         const that = this
         const endDate = item.endDate
         const endDate = item.endDate
         const nowTime = item.nowDate
         const nowTime = item.nowDate
@@ -410,7 +410,7 @@ Page({
           integralShareItem: item
           integralShareItem: item
         })
         })
       }
       }
-      if(!this.data.integralShareItem){
+      if (!this.data.integralShareItem) {
         const res = await this.insertNewRegisterItem()
         const res = await this.insertNewRegisterItem()
         if (res.data.code == Constants.SUCESS_CODE) {
         if (res.data.code == Constants.SUCESS_CODE) {
           const that = this
           const that = this
@@ -425,10 +425,12 @@ Page({
         }
         }
       }
       }
       const that = this
       const that = this
+      let path = '/pages/welcome/welcome?cpIdFrom=' + app.globalData.company.cpId + '&shareType=1&shareEndDate=' + that.data.integralShareItem.endDate + '&staffNameFrom=' + app.globalData.user.staffName + '&userIdFrom=' + app.globalData.user.userId
+      console.log("path",path);
       return {
       return {
         title: '邀请好友,互利共赢',
         title: '邀请好友,互利共赢',
         desc: '邀请注册拿云币',
         desc: '邀请注册拿云币',
-        path: '/pages/welcome/welcome?cpIdForm=' + app.globalData.company.cpId + '&shareType=1&shareEndDate=' + that.data.integralShareItem.endDate + '&staffNameFrom=' + app.globalData.user.staffName + 'userIdForm=' + app.globalData.user.userId,
+        path: path,
         imageUrl: url
         imageUrl: url
       }
       }
     }
     }
@@ -446,7 +448,7 @@ Page({
           couponSendItem: item
           couponSendItem: item
         })
         })
       }
       }
-      if(!this.data.couponSendItem){
+      if (!this.data.couponSendItem) {
         const that = this
         const that = this
         const res = await this.insertNewPowerItem()
         const res = await this.insertNewPowerItem()
         if (res.data.code == Constants.SUCESS_CODE) {
         if (res.data.code == Constants.SUCESS_CODE) {

+ 6 - 3
package-basic-data/pages/sign/sign.js

@@ -229,8 +229,8 @@ Page({
     saveData() {
     saveData() {
         let _this = this
         let _this = this
         return this.excute(this.data.service, this.data.service.insert, this.data.params).then(res => {
         return this.excute(this.data.service, this.data.service.insert, this.data.params).then(res => {
-            if (res.data.code == Constants.SUCESS_CODE) { 
-                if (!res.data.data) { 
+            if (res.data.code == Constants.SUCESS_CODE) {
+                if (!res.data.data) {
                     wx.showToast({
                     wx.showToast({
                         title: '签到成功',
                         title: '签到成功',
                         image: '/static/image/success.png',
                         image: '/static/image/success.png',
@@ -241,9 +241,12 @@ Page({
                 let dateArrs = util.getCurrentDateMonth(serverDate)
                 let dateArrs = util.getCurrentDateMonth(serverDate)
                 _this.getSignData(dateArrs[0], dateArrs[1])
                 _this.getSignData(dateArrs[0], dateArrs[1])
                 _this.getIntegral()
                 _this.getIntegral()
+                _this.setData({
+                    loading: false,
+                })
             }
             }
         })
         })
     },
     },
- 
+
 
 
 })
 })

+ 5 - 3
pages/login/login.js

@@ -379,13 +379,15 @@ Page({
           // }
           // }
 
 
         } else {
         } else {
+          
           // 从好有分享过来的数据 好友互利共赢  shareType=1 cpid userid startdate enddate
           // 从好有分享过来的数据 好友互利共赢  shareType=1 cpid userid startdate enddate
           let url = _this.data.shareType
           let url = _this.data.shareType
-            ? '/package-basic-data/pages/register/company-register/company-register?shareType' + _this.data.shareType + '&cpIdFrom=' + _this.data.cpIdFrom
+            ? '/package-basic-data/pages/register/company-register/company-register?shareType=' + _this.data.shareType + '&cpIdFrom=' + _this.data.cpIdFrom
             + '&shareEndDate=' + _this.data.shareEndDate
             + '&shareEndDate=' + _this.data.shareEndDate
-            + '&userIdFrom=' + this.data.userIdFrom
-            + '&staffNameFrom=' + this.data.staffNameFrom
+            + '&userIdFrom=' + _this.data.userIdFrom
+            + '&staffNameFrom=' + _this.data.staffNameFrom
             : '/package-basic-data/pages/register/company-register/company-register'
             : '/package-basic-data/pages/register/company-register/company-register'
+            console.log(url,"login");
           wx.navigateTo({
           wx.navigateTo({
             url: url,
             url: url,
             events: {
             events: {

+ 4 - 2
pages/mine/mine.js

@@ -1027,8 +1027,7 @@ Page({
       menuBtnInfo: wx.getMenuButtonBoundingClientRect()
       menuBtnInfo: wx.getMenuButtonBoundingClientRect()
     })
     })
 
 
-    // 积分
-    this.getIntegral()
+   
   },
   },
   onShow() {
   onShow() {
     if (this.data.mineFlag) {
     if (this.data.mineFlag) {
@@ -1052,6 +1051,9 @@ Page({
         break
         break
     }
     }
     this.getHomeOrderRecCost(dates[0], dates[1])
     this.getHomeOrderRecCost(dates[0], dates[1])
+
+     // 积分
+     this.getIntegral()
   },
   },
   /**
   /**
    * 页面相关事件处理函数--监听用户下拉动作
    * 页面相关事件处理函数--监听用户下拉动作

+ 1 - 0
pages/welcome/welcome.js

@@ -89,6 +89,7 @@ Page({
                 staffNameFrom: options.staffNameFrom,
                 staffNameFrom: options.staffNameFrom,
             })
             })
         }
         }
+        console.log(options,"welcome");
     },
     },
 
 
     /**
     /**