From 16c98154ca67d48665ed3a83874d43fdc626ac60 Mon Sep 17 00:00:00 2001 From: Liuyi <candymxq888@outlook.com> Date: 星期三, 09 十月 2024 17:42:24 +0800 Subject: [PATCH] 添加获取用户位置 --- pages/index/index.vue | 133 +++++++++++++++++++++++++++++--------------- 1 files changed, 88 insertions(+), 45 deletions(-) diff --git a/pages/index/index.vue b/pages/index/index.vue index 81f9166..56bf6c4 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -48,9 +48,17 @@ * 扫码取水相关 */ function toScan(){ - uni.navigateTo({ - url:'/pages/scanWater/index' - }) + // 调用二维码扫描接口 + uni.scanCode({ + scanType: ['qrCode'], + success: function (res) { + console.log('条码类型:' + res.scanType); + console.log('条码内容:' + res.result); + uni.navigateTo({ + url:'/pages/scanWater/index' + }) + } + }); } /** * 功能列表相关 @@ -90,11 +98,11 @@ } onMounted( async() =>{ getTopHeight() - await getInfo() + // await getInfo() // await getUserLocation() }) onShow(async() =>{ - await getInfo() + await getInfo() }) </script> @@ -120,8 +128,14 @@ <view class="left-bottom">电话:{{cardInfo.userPhone}}</view> </view> <view class="card-right"> - <view>金额卡</view> - <view> + <view class="card-right-top"> + <view @click="navTo('/pages/addCard/index')"> + <image src='../../static/images/index/vip-add.png' alt=''></image> + <span>添加会员卡</span> + </view> + <span>金额卡</span> + </view> + <view @click="navTo('/pages/recharge/index')"> <span>余额:</span> <span class="card-balance">{{cardInfo.balance}}</span> <span>元</span> @@ -135,15 +149,17 @@ <image src="../../static/images/index/home21.png" alt=""></image> <view>送水到家</view> </view> - <view class="box1-bg box1-two"> - <view>账户余额(元)</view> + <view @click="navTo('/pages/facilityList/index')" class="box1-bg box1-two"> + <image src="../../static/images/index/icon22.png" alt=""></image> + <view>附近设备</view> + <!-- <view>账户余额(元)</view> <view class="recharge"> <text>¥</text> <text>120.00</text> </view> <view @click="navTo('/pages/recharge/index')"> 充值 - </view> + </view> --> </view> <view class="box1-bg box1-three" @click="toScan()"> <image src="../../static/images/index/icon23.png" alt=""></image> @@ -297,6 +313,27 @@ align-items:flex-end; flex-direction: column; height:100%; + .card-right-top{ + align-items: center; + display: flex; + justify-content: space-between; + view{ + background-color: #fff; + color: #5EA1FA; + border-radius:20rpx; + padding: 5rpx 8rpx; + align-items: center; + display: flex; + justify-content: space-around; + font-size:24rpx; + margin-right:10rpx; + image{ + width:28rpx; + height:28rpx; + margin-right:10rpx; + } + } + } .card-balance{ font-weight:600; } @@ -336,45 +373,51 @@ } } .box1-two{ - box-sizing: border-box; - padding:25rpx 0 10rpx; + font-weight: 300; + font-size: 32rpx; + color: #000000; display: flex; flex-direction:column; align-items:center; - justify-content:space-around; - view:first-child{ - font-weight: 300; - font-size: 24rpx; - color: #464646; - text-align: center; - margin-bottom:10rpx; + justify-content:space-evenly; + image{ + width:96rpx; + height: 96rpx; + // margin-bottom:20rpx; } - .recharge{ - text:first-child{ - font-weight: 500; - font-size: 32rpx; - color: #000; - } - text:last-child{ - font-weight: 300; - font-size: 32rpx; - color: #2269E5; - } - } - view:last-child{ - width: 140rpx; - height: 80rpx; - font-weight:300; - font-size: 24rpx; - color: #000141; - background-image: url('../../static/images/index/icon22.png'); - background-repeat: no-repeat; - background-position: center; - background-size: 100% 100%; - text-align:center; - line-height:80rpx; - margin-top:10rpx; - } + // view:first-child{ + // font-weight: 300; + // font-size: 24rpx; + // color: #464646; + // text-align: center; + // margin-bottom:10rpx; + // } + // .recharge{ + // text:first-child{ + // font-weight: 500; + // font-size: 32rpx; + // color: #000; + // } + // text:last-child{ + // font-weight: 300; + // font-size: 32rpx; + // color: #2269E5; + // } + // } + // view:last-child{ + // width: 140rpx; + // height: 70rpx; + // font-weight:300; + // font-size: 24rpx; + // color: #000141; + // background-image: url('../../static/images/index/icon22.png'); + // background-repeat: no-repeat; + // background-position: center; + // background-size: 100% 100%; + // text-align:center; + // line-height:70rpx; + // margin-top:10rpx; + // } } .box1-three{ font-weight: 300; -- Gitblit v1.9.3