123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869 |
- <template>
- <view>
- <view>asdfasdf asdf</view>
- <u-tabbar :list="vuex_tabBarList" :before-switch="beforeSwitch" :mid-button="false"></u-tabbar>
- </view>
- </template>
- <script>
- import {
- mapState,
- mapMutations,
- } from 'vuex'
- export default {
- data() {
- return {
-
- }
- },
- computed: {
- ...mapState(['hasLogin','vuex_vinScanNums','vuex_scanMaxNums','vuex_tabBarList']),
- userInfo(){
- return this.$store.state.vuex_userInfo
- },
- },
- methods: {
- // 扫描vin
- beforeSwitch(index){
- console.log(index)
- if(index==1){
- this.openCamera()
- }else{
- return true
- }
- },
- // 去扫描
- openCamera(){
- if(this.hasLogin){
- if(this.userInfo.sysUserFlag == '0'){
- if(this.vuex_vinScanNums < this.vuex_scanMaxNums){
- uni.navigateTo({
- url: "/pages/scan-frame/scan-frame"
- })
- }else{
- uni.showModal({
- title: '提示',
- content: '个人用户扫描VIN仅限10次,您的次数已用完!',
- confirmText: '好的',
- showCancel: false,
- success(res) {}
- })
- }
- }else{
- uni.navigateTo({
- url: "/pages/scan-frame/scan-frame"
- })
- }
- }else{
- uni.navigateTo({
- url: '/pages/login/login'
- })
- }
- },
- }
- }
- </script>
- <style>
- </style>
|