Commit d9cc74e5 by 高淑倩

add: 获取当前账号信息

parent acf7124c
...@@ -40,6 +40,28 @@ function getCurrentPageUrlWithArgs() { ...@@ -40,6 +40,28 @@ function getCurrentPageUrlWithArgs() {
} }
/** /**
* 获取当前帐号信息
*/
function getAccountInfo() {
let accountInfo = wx.getAccountInfoSync();
return accountInfo
}
/***
* 判断用户滑动
* 左滑还是右滑
*/
function getTouchData(endX, endY, startX, startY) {
let turn = "";
if (endX - startX > 50 && Math.abs(endY - startY) < 50) { //右滑
turn = "right";
} else if (endX - startX < -50 && Math.abs(endY - startY) < 50) { //左滑
turn = "left";
}
return turn;
}
/**
* 解析 url 参数 * 解析 url 参数
*/ */
function parseUrl(query){ function parseUrl(query){
...@@ -179,7 +201,8 @@ function getUserInfoByBtn(userInfo) { ...@@ -179,7 +201,8 @@ function getUserInfoByBtn(userInfo) {
return wxService.post(`/member/minaLogin`, { return wxService.post(`/member/minaLogin`, {
code: res[1].code, code: res[1].code,
wechatInfo: res[0], wechatInfo: res[0],
brandId: 2005, // brandId: 2005,
brandId: 1001,
}) })
}, (err) => { }, (err) => {
return Promise.reject(err) return Promise.reject(err)
...@@ -216,5 +239,7 @@ module.exports = { ...@@ -216,5 +239,7 @@ module.exports = {
formatTime: formatTime, formatTime: formatTime,
getAppUserInfo, getAppUserInfo,
formatNumber: formatNumber, formatNumber: formatNumber,
logger: new Logger() logger: new Logger(),
getTouchData,
getAccountInfo
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment