123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143 |
- <template>
- <view>
- <u-tabbar v-model="myCurrent" :list="tabbarList" :before-switch="beforeSwitch" mid-button-size="72" :mid-button="true" inactive-color="#ADB8C2" active-color="#5098FF">
- </u-tabbar>
- </view>
- </template>
- <script>
- var img1=require('@/assets/img/tabbarImg/item1a.svg')
- var img2=require('@/assets/img/tabbarImg/item1b.svg')
- var img7=require('@/assets/img/tabbarImg/item4a.svg')
- var img8=require('@/assets/img/tabbarImg/item4b.svg')
-
- var img0=require('@/assets/img/tabbarImg/item0.png')
-
- import * as WxJsApi from '@/apis/utils/wxJsApi.js'
-
- export default {
- name: "Tabbar",
- props: {
- current: 0,
- elderStatus: false
- },
- data() {
- return {
- oldindex: this.current,
- myCurrent: this.current,
- tabbarList: [{
- iconPath: img2,
- selectedIconPath: img1,
- text: '主页 ',
- pagePath: "/pages/index/index",
- },
- {
- iconPath: img0,
- selectedIconPath: img0,
- text: '',
- midButton: true,
- pagePath2: "",
-
- },
- // {
- // iconPath: img6,
- // selectedIconPath: img5,
- // text: '用户',
- // pagePath: "/pages/userTab/index",
-
- // },
-
- {
- iconPath: img8,
- selectedIconPath: img7,
- text: '我的',
- pagePath: "/pages/myTab/index",
- }
- ],
- };
- },
- methods: {
- beforeSwitch(index){
- var item=this.tabbarList[index]
- if(item.pagePath){
- return true;
- }else{
- console.log(111)
- return false;
- }
-
- },
- //微信扫二维码
- getScanCode() {
- console.log("getScanCode")
- if (this.userId) {
- WxJsApi.scanQRCode(1).then(res => {
- var url=res;
- //("scanQRCode------" + res)
- if(res&&this.branchParameterBl()&&url.indexOf('youdian.hbjp.com.cn')!=-1){
-
- if(url.indexOf('?code=')!=-1){
- url=url.replace('?code=','?code1233=')
- }
-
-
- if(process.car.NODE_ENV=='test'){
- url='https://youdian.hbjp.com.cn/charging-prod/mobile-charging-car-test/#/'
- +url.split("#/")[1]
- }else{
- url='https://youdian.hbjp.com.cn/charging-prod/mobile-charging-car/#/'
- +url.split("#/")[1]
- }
- console.log(url)
- //window.location.href=url;
- this.youdianurl=url
- this.youdianshow=true
-
- }else if (res) {
-
- API.scanCode(res).then((response) => {
-
- }).catch(error => {
- uni.showToast({
- title: error,
- icon: "none"
- })
- })
- }
- }).catch(error => {
-
- })
- } else {
- uni.navigateTo({
- url: '/pages/login/login'
- })
- }
- },
-
- },
- mounted() {
- console.log(111+"mounted")
- WxJsApi.getWxConfig(['scanQRCode']).then((res) => {
- // //(res)
- }).catch(error => {
- //(res)
- })
-
- },
- destroyed() {
- }
- }
- </script>
- <style>
- </style>
|