123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139 |
- <template>
- <view class="footer">
- <view class="footer-bar">
- <view class="footer-item" @click="tabarClick(0)">
- <image src="../../static/image/home-fill.png" mode="" v-if="page==0"></image>
- <image src="../../static/image/home.png" mode="" v-else ></image>
- <view class="footer-text" >首页</view>
- </view>
- <view class="footer-item" @click="tabarClick(1)">
- <image src="../../static/image/mine-fill.png" mode="" class="mine" v-if="page==1"></image>
- <image src="../../static/image/mine.png" mode="" class="mine" v-else></image>
- <view class="footer-text" >我的</view>
- </view>
- <view class="scan" @click="scanCode()">
- <view class="scan-icon">
- <image src="../../static/image/scan.png" mode=""></image>
- </view>
- </view>
- </view>
- </view>
- </template>
- <script>
- var app=getApp()
- export default {
- name: 'footer-bar',
- data() {
- return{}
- },
- props: {
- page: {
- type: [Number],
- default: 0
- },
-
- },
-
- methods: {
- tabarClick: function(e) {
-
- if (e == 0) {
- uni.reLaunch({
- url:'../../pages/index/index'
- })
-
- } else if (e == 1) {
- uni.reLaunch({
- url:'../../pages/mine/mine'
- })
-
- }
- },
- //扫描二维码
- scanCode:function(){
- if(app.globalData.is_auth==true){
- uni.scanCode({
- success: function (res) {
- console.log('条码类型:' + res.scanType);
- console.log('条码内容:' + res.result);
- let scan=res.result
- let n1 = scan.length;//地址的总长度
- let n2 = scan.indexOf("=");//取得=号的位置
- let id = scan.substr(n2 + 1, n1 - n2);//从=号后面的内容
- console.log(id,'_)_)_)_)_')
- uni.navigateTo({
- url:'../../pages/index/service?device_no='+ id
- })
- }
- });
- }
- else{
- this.$emit("getFrame",true);
- }
-
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- .footer {
- height: 120rpx;
- position: fixed;
- bottom: 0;
- width: 100%;
- background-color: #fffdfd;
- .footer-bar {
- padding-top: 17upx;
- display: flex;
- position: relative;
- .footer-item {
- flex: 1;
- text-align: center;
- image {
- height:50upx;
- width: 50upx;
- }
- .mine {}
- .footer-text {
- font-size: 26upx;
- }
- }
- .scan {
- height: 142upx;
- width: 142upx;
- border-radius: 50%;
- position: absolute;
- background-color: #FFFFFF;
- bottom: 37upx;
- left: 41%;
- .scan-icon {
- height: 122upx;
- width: 122upx;
- margin: 0 auto;
- margin-top: 10upx;
- border-radius: 50%;
- background-color: $mine-background-color;
- image {
- height: 77upx;
- width: 82upx;
- margin-top: 25upx;
- margin-left: 21upx;
- }
- }
- }
- }
- }
- </style>
|