123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198 |
- <template>
- <view>
- <view class="content">
- <view class="status_bar">
- <!-- 这里是状态栏 -->
- </view>
-
- <view class="navbar">
- <view class="left" @click="switch_kuang()">
- <image v-if="mine_code == 'ningdongyunying'" src="./icon/ningdongyunying.png" mode=""></image>
-
- <image v-if="mine_code == 'zaoquan'" src="./icon/zaoquan.png" mode=""></image>
- <uni-icons type="arrowdown" color="#fff" v-if="mine_code == 'ningdongyunying'"></uni-icons>
- </view>
- <view class="search">
- <view class="box">
- <view class="left" @click="go_search()">
- <view class="icon">
- <image src="./icon/search.png" mode=""></image>
- </view>
- <view class="text">搜索</view>
- </view>
- <view class="scan">
- <image src="./icon/saoma.png" mode=""></image>
- </view>
- </view>
- </view>
- <view class="right">
- <view class="icon">
- <image src="./icon/day.png" mode=""></image>
- </view>
- <view class="num">{{temperature_curr}}</view>
- </view>
- <!-- <view class="right" v-show="show">
- <view class="icon" style="margin-right: 4rpx;">
- 积分
- </view>
- <view class="num">999分</view>
- </view> -->
- </view>
- </view>
-
- <view class="status_bar"></view>
- <view style="height: 88rpx;"></view>
- </view>
- </template>
- <script>
- export default {
- name: "t-i-navbar",
- props: [
- "mine_code"
- ],
- data() {
- return {
- // 当前温度
- temperature_curr:"",
- };
- },
- created() {
- // 当前温度
- uni.request({
- url:"http://api.k780.com/?app=weather.today&weaId=286&appkey=10003&sign=b59bc3ef6191eb9f747dd4e83c99f2a4&format=json",
- method:"GET",
- success:(res)=> {
- // console.log(res.data.result.temperature_curr)
- this.temperature_curr = res.data.result.temperature_curr
- }
- })
-
- },
- methods:{
- switch_kuang(){
- if(this.mine_code == 'ningdongyunying'){
- uni.navigateTo({
- url:"../../index/switch-kuang/switch-kuang"
- })
- }
- },
- go_search(){
- uni.navigateTo({
- url:"../../index/search/search?mine_code=" + this.mine_code
- })
- }
- }
- }
- </script>
- <style lang="scss">
- .content{
- position: fixed;
- top: 0;
- left: 0;
-
- z-index: 999;
-
-
- width: 750rpx;
-
- background-image: url(./icon/bg_img.jpg);
- background-size: 750rpx 334rpx;
- background-repeat: no-repeat;
- }
-
- .navbar{
- box-sizing: border-box;
- padding: 10rpx 25rpx;
-
- display: flex;
- align-items: center;
- justify-content: space-between;
-
- height: 88rpx;
- .left{
- display: flex;
- align-items: center;
-
- width: 170rpx;
- image{
- width: 165rpx;
- height: 48rpx;
-
- margin-right: 10rpx;
- }
- }
- .search{
- width: 370rpx;
-
- .box{
- display: flex;
- justify-content: space-between;
- align-items: center;
-
- height: 68rpx;
-
- background-color: rgba(255,255,255,.4);
- border-radius: 50rpx;
-
- box-sizing: border-box;
- padding: 0 20rpx;
-
- .left{
- display: flex;
- height: 68rpx;
- width: 300rpx;
-
- .icon{
- image{
- width: 21rpx;
- height: 21rpx;
- }
- }
- .text{
- color: #FFFFFF;
- font-size: 24rpx;
- }
-
- }
- .scan{
- width: 68rpx;
- text-align: right;
- line-height: 68rpx;
- image{
- width: 27rpx;
- height: 25rpx;
- }
- }
- }
- }
- .right{
- white-space: nowrap;
- color: #FFFFFF;
- font-size: 24rpx;
- width: 124rpx;
- margin-left: 20rpx;
- border-left: 2rpx solid #FFFFFF;
- box-sizing: border-box;
- padding-left: 20rpx;
-
- display: flex;
- align-items: center;
- justify-content: space-around;
- height: 40rpx;
-
- .icon{
- margin-right: 10rpx;
- image{
- width: 40rpx;
- height: 40rpx;
- }
- }
- .num{
- color: #FFFFFF;
- font-size: 24rpx;
- }
- }
- }
- </style>
|