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' ...@@ -20,7 +20,7 @@ import eventbus from './utils/eventbus'
import api from './api/api' import api from './api/api'
import { Version } from 'glsx-common-sdk' import { Version } from 'glsx-common-sdk'
import { areaList } from '@vant/area-data' //预加载省市区 import { areaList } from '@vant/area-data' //预加载省市区
// 将 api.reNoSignIn() 函数包装为防抖函数 // 将 api.reNoSignIn() 函数包装为节流函数
const debouncedReNoSignIn = debounce(function (noSignInUuid, that) { const debouncedReNoSignIn = debounce(function (noSignInUuid, that) {
console.log('debouncedReNoSignIn2222'); console.log('debouncedReNoSignIn2222');
api.reNoSignIn({ api.reNoSignIn({
...@@ -37,7 +37,7 @@ const debouncedReNoSignIn = debounce(function (noSignInUuid, that) { ...@@ -37,7 +37,7 @@ const debouncedReNoSignIn = debounce(function (noSignInUuid, that) {
that.login(false) that.login(false)
} }
}) })
}, 5000); // 设置防抖时间为 5 秒 }, 0); // 设置防抖时间为 5 秒
// 定义一个防抖函数 // 定义一个防抖函数
function debounce(func, timeout) { function debounce(func, timeout) {
let timer; let timer;
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
"dependencies": { "dependencies": {
"@vant/area-data": "^1.5.1", "@vant/area-data": "^1.5.1",
"@vant/weapp": "^1.10.24", "@vant/weapp": "^1.10.24",
"dayjs": "^1.11.11",
"glsk-applet-component": "^1.0.0", "glsk-applet-component": "^1.0.0",
"glsx-applet-component": "^1.1.29", "glsx-applet-component": "^1.1.29",
"glsx-common-sdk": "^0.2.8", "glsx-common-sdk": "^0.2.8",
......
// packageEquity/pages/aiInspection/components/dateBox/dateBox.js // packageEquity/pages/aiInspection/components/dateBox/dateBox.js
import dayjs from 'dayjs'
const defaultDay = new Date().setDate(new Date().getDate() - 1) const defaultDay = new Date().setDate(new Date().getDate() - 1)
Component({ Component({
...@@ -26,6 +27,7 @@ Component({ ...@@ -26,6 +27,7 @@ Component({
*/ */
methods: { methods: {
init() { init() {
wx.$util.showLoading()
const now = new Date().format('yyyy/MM/dd'), const now = new Date().format('yyyy/MM/dd'),
calendar = this.selectComponent('#calendar') calendar = this.selectComponent('#calendar')
this.setData({ this.setData({
...@@ -35,33 +37,33 @@ Component({ ...@@ -35,33 +37,33 @@ Component({
currentDayTime: new Date(defaultDay).getTime() currentDayTime: new Date(defaultDay).getTime()
}) })
calendar.resetData(new Date(defaultDay).format('yyyy-MM-dd')) calendar.resetData(new Date(defaultDay).format('yyyy-MM-dd'))
wx.$util.hideLoading()
}, },
selectDay(e) { selectDay(e) {
let { let {
date date
} = e.detail, } = e.detail
currentDay = new Date(date.replace(/-/g, '/')) let currentDay = dayjs(date)
this.setData({ this.setData({
currentDay: currentDay.format('yyyy年MM月dd日'), currentDay: currentDay.format('YYYY年MM月DD日'),
currentDayTime: currentDay.getTime(), currentDayTime: currentDay.valueOf(),
}) }, () => {
this.triggerEvent('change', date) this.triggerEvent('change', date)
this.selectComponent('#calendar').resetData(date) this.selectComponent('#calendar').resetData(date)
wx.$util.hideLoading()
})
}, },
choose(e) { choose(e) {
const { wx.$util.showLoading()
let {
index index
} = e.target.dataset, { } = e.target.dataset, {
currentDayTime currentDayTime
} = this.data } = this.data,
let currentDay = new Date(currentDayTime) date = dayjs(currentDayTime).add(Number(index), 'day').format('YYYY-MM-DD')
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()
this.selectDay({ this.selectDay({
detail: { detail: {
date: `${y}-${m}-${d}` date
} }
}) })
}, },
......
<view class="date-box"> <view class="date-box">
<block wx:if="{{minTime != currentDayTime}}"> <block wx:if="{{minTime != currentDayTime}}">
<view class="date-btn" bindtap="choose" data-index="-1"> <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> </view>
</block> </block>
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
<block wx:if="{{maxDateTime != currentDayTime}}"> <block wx:if="{{maxDateTime != currentDayTime}}">
<view class="date-btn next" bindtap="choose" data-index="1"> <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> </view>
</block> </block>
</view> </view>
......
...@@ -41,6 +41,9 @@ Component({ ...@@ -41,6 +41,9 @@ Component({
// init() // init()
this.audioInit() 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!