Commit df6f3f57 by 王志慧

Merge branch 'SAAS+V4.38.7' of http://192.168.3.233:8090/saas_plus/dj-car-boutiq…

…ue-work-wechat into SAAS+V4.38.7
2 parents a068ca90 de113e02
......@@ -20,7 +20,7 @@ import eventbus from './utils/eventbus'
import api from './api/api'
import { Version } from 'glsx-common-sdk'
import { areaList } from '@vant/area-data' //预加载省市区
// 将 api.reNoSignIn() 函数包装为防抖函数
// 将 api.reNoSignIn() 函数包装为节流函数
const debouncedReNoSignIn = debounce(function (noSignInUuid, that) {
console.log('debouncedReNoSignIn2222');
api.reNoSignIn({
......@@ -37,7 +37,7 @@ const debouncedReNoSignIn = debounce(function (noSignInUuid, that) {
that.login(false)
}
})
}, 5000); // 设置防抖时间为 5 秒
}, 0); // 设置防抖时间为 5 秒
// 定义一个防抖函数
function debounce(func, timeout) {
let timer;
......
......@@ -2,6 +2,7 @@
"dependencies": {
"@vant/area-data": "^1.5.1",
"@vant/weapp": "^1.10.24",
"dayjs": "^1.11.11",
"glsk-applet-component": "^1.0.0",
"glsx-applet-component": "^1.1.29",
"glsx-common-sdk": "^0.2.8",
......
// packageEquity/pages/aiInspection/components/dateBox/dateBox.js
import dayjs from 'dayjs'
const defaultDay = new Date().setDate(new Date().getDate() - 1)
Component({
......@@ -26,6 +27,7 @@ Component({
*/
methods: {
init() {
wx.$util.showLoading()
const now = new Date().format('yyyy/MM/dd'),
calendar = this.selectComponent('#calendar')
this.setData({
......@@ -35,33 +37,33 @@ Component({
currentDayTime: new Date(defaultDay).getTime()
})
calendar.resetData(new Date(defaultDay).format('yyyy-MM-dd'))
wx.$util.hideLoading()
},
selectDay(e) {
let {
date
} = e.detail,
currentDay = new Date(date.replace(/-/g, '/'))
} = e.detail
let currentDay = dayjs(date)
this.setData({
currentDay: currentDay.format('yyyy年MM月dd日'),
currentDayTime: currentDay.getTime(),
currentDay: currentDay.format('YYYY年MM月DD日'),
currentDayTime: currentDay.valueOf(),
}, () => {
this.triggerEvent('change', date)
this.selectComponent('#calendar').resetData(date)
wx.$util.hideLoading()
})
this.triggerEvent('change', date)
this.selectComponent('#calendar').resetData(date)
},
choose(e) {
const {
wx.$util.showLoading()
let {
index
} = e.target.dataset, {
currentDayTime
} = this.data
let currentDay = new Date(currentDayTime)
currentDay.setDate(currentDay.getDate() + Number(index))
let y = currentDay.getFullYear(),
m = currentDay.getMonth() + 1 < 10 ? `0${currentDay.getMonth() + 1}` : currentDay.getMonth() + 1,
d = currentDay.getDate() < 10 ? `0${currentDay.getDate()}` : currentDay.getDate()
currentDayTime
} = this.data,
date = dayjs(currentDayTime).add(Number(index), 'day').format('YYYY-MM-DD')
this.selectDay({
detail: {
date: `${y}-${m}-${d}`
date
}
})
},
......
<view class="date-box">
<block wx:if="{{minTime != currentDayTime}}">
<view class="date-btn" bindtap="choose" data-index="-1">
<gl-image class="icon" src="/equity/arrow-left.png" />
<gl-image data-index="-1" class="icon" src="/equity/arrow-left.png" />
上一天
</view>
</block>
......@@ -12,7 +12,7 @@
<block wx:if="{{maxDateTime != currentDayTime}}">
<view class="date-btn next" bindtap="choose" data-index="1">
下一天
<gl-image class="icon" src="/equity/arrow-right.png" />
<gl-image class="icon" data-index="1" src="/equity/arrow-right.png" />
</view>
</block>
</view>
......
......@@ -41,6 +41,9 @@ Component({
// init()
this.audioInit()
},
detached() {
bgMusic.destroy()
}
},
/**
* 组件的方法列表
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!