- html
<wx-view v-if="slide.dwdata.loading" class="weui-loadmore b-loadmore">
<wx-view class="weui-loading"></wx-view>
<wx-view class="weui-loadmore__tips">
<wx-text value="正在加载..."></wx-text>
</wx-view>
</wx-view>
- css
| const timestamp = new Date().getTime() | |
| const timezone = new Date().getTimezoneOffset() | |
| const UTCTimezone = new Date(timestamp).getTime() + (timezone * 60000) | |
| const beijingTime = new Date(UTCTimezone + (3600000 * 8)) |
| // range(number) | |
| function js_range (number) { | |
| return [...Array(number).keys()] | |
| } | |
| // js_range(5) = [0,1,2,3,4] |
| scrollToTop () { | |
| const scrollStep = - window.scrollY / (window.scrollY / 25), | |
| scrollInterval = setInterval(function () { | |
| if (window.scrollY != 0) { | |
| window.scrollBy(0, scrollStep) | |
| } | |
| else clearInterval(scrollInterval) | |
| }, 5) | |
| } |
| # coding: utf-8 | |
| import time | |
| import requests | |
| from requests.adapters import HTTPAdapter | |
| from requests.packages.urllib3.util.retry import Retry | |
| def requests_retry_session( | |
| retries=1, |
| async asyncForEach (array, callback) { | |
| for (let index = 0; index < array.length; index++) { | |
| await callback(array[index], index, array) | |
| } | |
| } |
<wx-view v-if="slide.dwdata.loading" class="weui-loadmore b-loadmore">
<wx-view class="weui-loading"></wx-view>
<wx-view class="weui-loadmore__tips">
<wx-text value="正在加载..."></wx-text>
</wx-view>
</wx-view>
| import datetime | |
| from functools import wraps | |
| def calculate_time(name): | |
| def deco(func): | |
| @wraps(func) | |
| def wrapper(*awgs, **kwargs): | |
| start = datetime.datetime.now() | |
| result = func(*awgs, **kwargs) | |
| end = datetime.datetime.now() |
| async chooseImage () { | |
| if (dw.platform === 'dwapp') { | |
| if (!dw.data.token) { | |
| const response = await dw.request('get/contexters/get_qiniu_data') | |
| dw.setDatas({ | |
| token: response.data.token, | |
| qiniu_url: response.data.qiniu_url | |
| }) | |
| } | |
| dw.wx.chooseImage({ |