赞
踩
<home wx:if="{{PageCur=='home'}}"></home> <class wx:if="{{PageCur=='class'}}"></class> <cart wx:if="{{PageCur=='cart'}}"></cart> <my wx:if="{{PageCur=='my'}}"></my> <view class="cu-bar tabbar bg-white shadow foot"> <view class="action" bindtap="NavChange" data-cur="home"> <view class='cuIcon-cu-image'> <image src="/images/tabbar/home{{PageCur=='home'?'_cur':''}}.png"></image> </view> <view class="{{PageCur=='home'?'text-orange':'text-gray'}}">首页</view> </view> <view class="action" bindtap="NavChange" data-cur="class"> <view class='cuIcon-cu-image'> <image src="/images/tabbar/class{{PageCur=='class'?'_cur':''}}.png"></image> </view> <view class="{{PageCur=='class'?'text-orange':'text-gray'}}">分类</view> </view> <view class="action text-gray add-action"> <button class="cu-btn cuIcon-scan bg-orange shadow" bindtap='goto'></button> 扫一扫 </view> <view class="action" bindtap="NavChange" data-cur="cart"> <view class='cuIcon-cu-image'> <image src="/images/tabbar/cart{{PageCur=='cart'?'_cur':''}}.png"></image> </view> <view class="{{PageCur=='cart'?'text-orange':'text-gray'}}">购物车</view> </view> <view class="action" bindtap="NavChange" data-cur="my"> <view class='cuIcon-cu-image'> <image src="/images/tabbar/my{{PageCur=='my'?'_cur':''}}.png"></image> </view> <view class="{{PageCur=='my'?'text-orange':'text-gray'}}">我的</view> </view> </view>
.userinfo { display: flex; flex-direction: column; align-items: center; } .userinfo-avatar { width: 128rpx; height: 128rpx; margin: 20rpx; border-radius: 50%; } .userinfo-nickname { color: #aaa; } .usermotto { margin-top: 200px; }
const app = getApp() Page({ data: { PageCur: 'home' }, NavChange(e) { this.setData({ PageCur: e.currentTarget.dataset.cur }) }, goto: function () { wx.scanCode({ success(res) { wx.showModal({ title: '扫码内容', content: res.result, }) } }) }, onLoad: function () { } })
{
"usingComponents": {
"home": "/pages/home/home",
"class": "/pages/class/class",
"cart": "/pages/cart/cart",
"my": "/pages/my/my"
}
}
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。