From c1591e97b4d361a1a1f82c04057db7f50968e852 Mon Sep 17 00:00:00 2001 From: taochengbo <552920369@qq.com> Date: Sat, 12 Sep 2020 11:27:58 +0800 Subject: [PATCH] =?UTF-8?q?bug--=E4=BF=AE=E5=A4=8D=E5=88=86=E4=BA=AB?= =?UTF-8?q?=E7=BB=91=E5=AE=9A=E5=88=86=E9=94=80=E5=85=B3=E7=B3=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- utils/index.js | 47 ++++++++++++++++++++++++----------------------- 1 file changed, 24 insertions(+), 23 deletions(-) diff --git a/utils/index.js b/utils/index.js index 53d0991..36d810b 100644 --- a/utils/index.js +++ b/utils/index.js @@ -38,26 +38,26 @@ export function dataFormat(time, option) { return timeStr } } - // 年月日,时分秒 - // "YYYY-mm-dd HH:MM" -export function dateFormatL(fmt, date) { - let ret; - const opt = { - "Y+": date.getFullYear().toString(), // 年 - "m+": (date.getMonth() + 1).toString(), // 月 - "d+": date.getDate().toString(), // 日 - "H+": date.getHours().toString(), // 时 - "M+": date.getMinutes().toString(), // 分 - "S+": date.getSeconds().toString() // 秒 - // 有其他格式化字符需求可以继续添加,必须转化成字符串 - }; - for (let k in opt) { - ret = new RegExp("(" + k + ")").exec(fmt); - if (ret) { - fmt = fmt.replace(ret[1], (ret[1].length == 1) ? (opt[k]) : (opt[k].padStart(ret[1].length, "0"))) - }; - }; - return fmt; + // 年月日,时分秒 + // "YYYY-mm-dd HH:MM" +export function dateFormatL(fmt, date) { + let ret; + const opt = { + "Y+": date.getFullYear().toString(), // 年 + "m+": (date.getMonth() + 1).toString(), // 月 + "d+": date.getDate().toString(), // 日 + "H+": date.getHours().toString(), // 时 + "M+": date.getMinutes().toString(), // 分 + "S+": date.getSeconds().toString() // 秒 + // 有其他格式化字符需求可以继续添加,必须转化成字符串 + }; + for (let k in opt) { + ret = new RegExp("(" + k + ")").exec(fmt); + if (ret) { + fmt = fmt.replace(ret[1], (ret[1].length == 1) ? (opt[k]) : (opt[k].padStart(ret[1].length, "0"))) + }; + }; + return fmt; } export function dateFormatT(time) { time = +time * 1000; @@ -271,6 +271,7 @@ export const login = () => { store.dispatch('userInfo', true) getUserInfo().then(user => { console.log('获取用户信息成功') + uni.setStorageSync('uid', user.data.uid); store.dispatch('setUserInfo', user.data) resolve(user) }).catch(error => { @@ -681,7 +682,7 @@ export function handleQrCode() { export function handleUrlParam(path) { console.log(path) - var url = path.split("?")[1]; //获取url中"?"符后的字串 + var url = path.split("?")[1]; //获取url中"?"符后的字串 console.log(url) var theRequest = new Object(); let strs = url.split("&"); @@ -721,8 +722,8 @@ const getImageInfo = (images) => { * @param string store_name 素材文字 * @param string price 价格 * @param function successFn 回调函数 - * - * + * + * */ export const PosterCanvas = (store, successCallBack) => { uni.showLoading({