Commit d200caea authored by 彭佳妮(贵阳日报)'s avatar 彭佳妮(贵阳日报)
parents 82434109 6f152b4e
...@@ -4,6 +4,9 @@ import { sgyOrderGetStatus } from './api/order'; ...@@ -4,6 +4,9 @@ import { sgyOrderGetStatus } from './api/order';
import testJson from './static/json/test.json'; import testJson from './static/json/test.json';
import { getToken } from './utils/auth'; import { getToken } from './utils/auth';
import { setOrderDic } from './utils/orderDic'; import { setOrderDic } from './utils/orderDic';
// beforeMount(() => {
// if (!getToken()) signIn();
// });
onLaunch(() => { onLaunch(() => {
if (!getToken()) signIn(); if (!getToken()) signIn();
sgyOrderGetStatus().then((res) => { sgyOrderGetStatus().then((res) => {
...@@ -22,12 +25,18 @@ onHide(() => { ...@@ -22,12 +25,18 @@ onHide(() => {
}); });
// 登录 // 登录
const signIn = () => { const signIn = () => {
getTokenUser(testJson).then((res) => { xma.xh.getUserProfile({
const token = res.data.access_token; range: ['ACCOUNT', 'MOBILE', 'CITIZEN'],
const userInfo = res.data.user_info; async success(info) {
xma.setStorageSync('Authorization', token); const info2 = JSON.stringify(info);
xma.setStorageSync('userInfo', userInfo); getTokenUser(info2).then((res) => {
console.log('登录...'); const token = res.data.access_token;
const userInfo = res.data.user_info;
xma.setStorageSync('Authorization', token);
xma.setStorageSync('userInfo', userInfo);
console.log('登录...');
});
},
}); });
}; };
</script> </script>
......
...@@ -9,7 +9,8 @@ ...@@ -9,7 +9,8 @@
{ {
"path": "pages/index/index", "path": "pages/index/index",
"style": { "style": {
"navigationBarTitleText": "小程序平台" "navigationBarTitleText": "小程序平台",
"navigationStyle":"custom"
} }
}, },
{ {
......
...@@ -322,6 +322,12 @@ const reset = () => { ...@@ -322,6 +322,12 @@ const reset = () => {
cardData2.value = []; cardData2.value = [];
show.value = false; show.value = false;
}; };
const toUse = () => {
xma.navigateTo({
url: '/pages/index/listFood?type=1',
});
};
// 商家列表分页-搜索列表 // 商家列表分页-搜索列表
const getMerchantList = () => { const getMerchantList = () => {
xma.showLoading({ xma.showLoading({
......
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