Commit c38bcaf5 by zhangcheng

调整首页

parent 0af5f384
<template>
<!-- Tab -->
<u-tabbar v-model="selectedTabbar" :border="false" inactive-color="#000000" active-color="#006ECF" :fixed="true" :safeAreaInsetBottom="true" @change="beforeSwitch">
<u-tabbar-item v-for="(item,index) in list" :key="item.text" :text="item.text" :icon="selectedTabbar==index?item.activeIcon:item.icon"></u-tabbar-item>
</u-tabbar>
</template>
<script>
export default {
data() {
return{
}
},
props:['selectedTabbar'],
computed:{
list(){
// tabbar List
return this.$store.state.list;
}
},
methods:{
//点击tab
beforeSwitch(index) {
uni.switchTab({url:this.list[index].pagePath});
return true;
}
}
}
</script>
<style>
</style>
\ No newline at end of file
...@@ -50,7 +50,12 @@ ...@@ -50,7 +50,12 @@
"quickapp" : {}, "quickapp" : {},
/* 小程序特有相关 */ /* 小程序特有相关 */
"mp-weixin" : { "mp-weixin" : {
"appid" : "wxdb0df0ee46a184be", "appid" : "wx71aa3662dfd3227d",
"permission": {
"scope.userLocation": {
"desc": "你的位置信息将用于小程序位置接口的效果展示"
}
},
"setting" : { "setting" : {
"urlCheck" : false, "urlCheck" : false,
"es6" : false, "es6" : false,
......
<template> <template>
<view> <view>
<!-- Tab --> <tabBar :selectedTabbar="selectedTabbar"></tabBar>
<u-tabbar v-model="selectedTabbar" :border="false" inactive-color="#000000" active-color="#006ECF" :fixed="true" :safeAreaInsetBottom="true" @change="beforeSwitch">
<u-tabbar-item v-for="(item,index) in list" :key="item.text" :text="item.text" :icon="selectedTabbar==index?item.activeIcon:item.icon"></u-tabbar-item>
</u-tabbar>
</view> </view>
</template> </template>
...@@ -15,16 +12,9 @@ ...@@ -15,16 +12,9 @@
} }
}, },
computed:{ computed:{
list(){
// tabbar List
return this.$store.state.list;
}
}, },
methods: { methods: {
beforeSwitch(index) {
uni.switchTab({url:this.list[index].pagePath});
return true;
}
} }
} }
</script> </script>
......
<template> <template>
<view> <view>
<!-- Tab --> <tabBar :selectedTabbar="selectedTabbar"></tabBar>
<u-tabbar v-model="selectedTabbar" :border="false" inactive-color="#000000" active-color="#006ECF" :fixed="true" :safeAreaInsetBottom="true" @change="beforeSwitch">
<u-tabbar-item v-for="(item,index) in list" :key="item.text" :text="item.text" :icon="selectedTabbar==index?item.activeIcon:item.icon"></u-tabbar-item>
</u-tabbar>
</view> </view>
</template> </template>
...@@ -16,16 +13,10 @@ ...@@ -16,16 +13,10 @@
} }
}, },
computed:{ computed:{
list(){
// tabbar List
return this.$store.state.list;
}
}, },
methods: { methods: {
beforeSwitch(index) {
uni.switchTab({url:this.list[index].pagePath});
return true;
}
} }
} }
</script> </script>
......
import Config from '../static/config/index.js'; import Config from '../static/config/index.js';
import WXBizDataCrypt from "./WXBizDataCrypt.js"; import WXBizDataCrypt from "./WXBizDataCrypt.js";
uni.getLocation({
type: 'gcj02', //返回可以用于uni.openLocation的经纬度
success: function (res) {
console.log(res, 'res')
var params = {
lat: res.latitude,
lng: res.longitude
}
// getAddress(params).then(res => {
// console.log(res, 'aaa')
// })
}
})
export default{ export default{
uniLogin() { uniLogin() {
uni.login({ uni.login({
...@@ -21,6 +34,21 @@ export default{ ...@@ -21,6 +34,21 @@ export default{
} }
}) })
}, },
getLocation() {
uni.getLocation({
type: 'gcj02', //返回可以用于uni.openLocation的经纬度
success: function (res) {
console.log(res, 'res')
var params = {
lat: res.latitude,
lng: res.longitude
}
getAddress(params).then(res => {
console.log(res, 'aaa')
})
}
})
},
// 解密手机 // 解密手机
async onGetPhoneNumber(appid,session_key,encryptedData,iv) { async onGetPhoneNumber(appid,session_key,encryptedData,iv) {
let pc = await new WXBizDataCrypt(appid,session_key); let pc = await new WXBizDataCrypt(appid,session_key);
......
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