|
|
@@ -147,28 +147,28 @@ Page({
|
|
|
let service = app.globalData['couponSendService']
|
|
|
return this.excute(service, 'get_item', params)
|
|
|
},
|
|
|
- formatDate(isoDateString) {
|
|
|
+ formatDate(isoDateString) {
|
|
|
// 首先,尝试将ISO 8601格式的日期字符串转换为Date对象
|
|
|
- const date = new Date(isoDateString);
|
|
|
-
|
|
|
+ const date = new Date(isoDateString);
|
|
|
+
|
|
|
// 然后,使用Date对象的方法获取年、月、日、时、分、秒
|
|
|
// 注意月份是从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的格式拼接字符串
|
|
|
- return `${year}-${month}-${day}T${hours}:${minutes}:${seconds}`;
|
|
|
+ return `${year}-${month}-${day}T${hours}:${minutes}:${seconds}`;
|
|
|
},
|
|
|
/**
|
|
|
* @desc : 获取助力明细
|
|
|
* @author : 刘尧
|
|
|
* @date : 2024/7/30
|
|
|
*/
|
|
|
- getRegisterItem(){
|
|
|
+ getRegisterItem() {
|
|
|
let service = app.globalData['integralShareService']
|
|
|
const params = {
|
|
|
cpId: app.globalData.company.cpId,
|
|
|
@@ -302,7 +302,7 @@ Page({
|
|
|
* @author : 刘尧
|
|
|
* @date : 2024/8/1 11:32
|
|
|
*/
|
|
|
- insertNewRegisterItem(){
|
|
|
+ insertNewRegisterItem() {
|
|
|
const params = {
|
|
|
cpId: app.globalData.company.cpId,
|
|
|
tacticId: this.data.integralTacticItem.tacticId,
|
|
|
@@ -335,7 +335,7 @@ Page({
|
|
|
* @author : 刘尧
|
|
|
* @date : 2024/7/30 15:40
|
|
|
*/
|
|
|
- shareIntegral(){
|
|
|
+ shareIntegral() {
|
|
|
let service = app.globalData['integralShareService']
|
|
|
const params = {
|
|
|
cpId: app.globalData.company.cpId,
|
|
|
@@ -347,13 +347,13 @@ Page({
|
|
|
}
|
|
|
return this.excute(service, service.insert, params)
|
|
|
},
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* @desc : 获取用户剩余分享次数
|
|
|
* @author : 刘尧
|
|
|
* @date : 2024/7/30 15:40
|
|
|
*/
|
|
|
- getShareNumber(){
|
|
|
+ getShareNumber() {
|
|
|
let service = app.globalData['integralShareService']
|
|
|
const params = {
|
|
|
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'
|
|
|
this.setData({
|
|
|
cilckViewId: e.target.dataset.detail
|
|
|
})
|
|
|
if (e.target.dataset.detail === "toShare") {
|
|
|
const integralTacticItem = this.data.integralTacticItem
|
|
|
- if(integralTacticItem.shareDayNum > 0){
|
|
|
+ if (integralTacticItem.shareDayNum > 0) {
|
|
|
const res = await this.shareIntegral()
|
|
|
if (res.data.code == Constants.SUCESS_CODE) {
|
|
|
this.getShareNumber()
|
|
|
@@ -393,14 +393,14 @@ Page({
|
|
|
imageUrl: url
|
|
|
}
|
|
|
}
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
util.showToast('今日分享已达上限!')
|
|
|
}
|
|
|
}
|
|
|
if (e.target.dataset.detail === "toRegister") {
|
|
|
let item = await this.getRegisterItem()
|
|
|
item = item.data.data
|
|
|
- if(item){
|
|
|
+ if (item) {
|
|
|
const that = this
|
|
|
const endDate = item.endDate
|
|
|
const nowTime = item.nowDate
|
|
|
@@ -410,7 +410,7 @@ Page({
|
|
|
integralShareItem: item
|
|
|
})
|
|
|
}
|
|
|
- if(!this.data.integralShareItem){
|
|
|
+ if (!this.data.integralShareItem) {
|
|
|
const res = await this.insertNewRegisterItem()
|
|
|
if (res.data.code == Constants.SUCESS_CODE) {
|
|
|
const that = this
|
|
|
@@ -425,10 +425,12 @@ Page({
|
|
|
}
|
|
|
}
|
|
|
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 {
|
|
|
title: '邀请好友,互利共赢',
|
|
|
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
|
|
|
}
|
|
|
}
|
|
|
@@ -446,7 +448,7 @@ Page({
|
|
|
couponSendItem: item
|
|
|
})
|
|
|
}
|
|
|
- if(!this.data.couponSendItem){
|
|
|
+ if (!this.data.couponSendItem) {
|
|
|
const that = this
|
|
|
const res = await this.insertNewPowerItem()
|
|
|
if (res.data.code == Constants.SUCESS_CODE) {
|