@@ -15,6 +15,10 @@ Component({ | |||||
type: String, | type: String, | ||||
value: 'Wechat' | value: 'Wechat' | ||||
}, | }, | ||||
showLocationIf: { | |||||
type: Boolean, | |||||
value: false | |||||
}, | |||||
back: { | back: { | ||||
type: Boolean, | type: Boolean, | ||||
value: false | value: false | ||||
@@ -26,6 +30,8 @@ Component({ | |||||
}, | }, | ||||
data: { | data: { | ||||
array: ['A广场', 'B广场-北京西单'], | |||||
index: 1, | |||||
statusBarHeight: app.statusBarHeight + 'px', | statusBarHeight: app.statusBarHeight + 'px', | ||||
navigationBarHeight: (app.statusBarHeight + 44) + 'px' | navigationBarHeight: (app.statusBarHeight + 44) + 'px' | ||||
}, | }, | ||||
@@ -35,6 +41,12 @@ Component({ | |||||
url: '/index/index', | url: '/index/index', | ||||
}) | }) | ||||
}, | }, | ||||
bindPickerChange: function (e) { | |||||
console.log('picker发送选择改变,携带值为', e.detail.value) | |||||
this.setData({ | |||||
index: e.detail.value | |||||
}) | |||||
}, | |||||
back: function () { | back: function () { | ||||
wx.navigateBack({ | wx.navigateBack({ | ||||
delta: 1 | delta: 1 | ||||
@@ -10,5 +10,11 @@ | |||||
</view> | </view> | ||||
</view> | </view> | ||||
<view class='title' style="color:{{color}}!important">{{text}}</view> | <view class='title' style="color:{{color}}!important">{{text}}</view> | ||||
<picker bindchange="bindPickerChange" wx:if="{{showLocationIf}}" class="pick-box" value="{{index}}" range="{{array}}"> | |||||
<icon class='iconfont icon-daohangdizhiweizhi'></icon> | |||||
<view class="picker locations"> | |||||
{{array[index]}} | |||||
</view> | |||||
</picker> | |||||
</view> | </view> | ||||
</view> | </view> |
@@ -55,4 +55,36 @@ | |||||
overflow: hidden; | overflow: hidden; | ||||
text-overflow: ellipsis; | text-overflow: ellipsis; | ||||
white-space: nowrap; | white-space: nowrap; | ||||
} | |||||
@font-face { | |||||
font-family: 'iconfont'; /* project id 1353695 */ | |||||
src: url('//at.alicdn.com/t/font_1353695_nyv2ld9xqk8.eot'); | |||||
src: url('//at.alicdn.com/t/font_1353695_nyv2ld9xqk8.eot?#iefix') format('embedded-opentype'), | |||||
url('//at.alicdn.com/t/font_1353695_nyv2ld9xqk8.woff2') format('woff2'), | |||||
url('//at.alicdn.com/t/font_1353695_nyv2ld9xqk8.woff') format('woff'), | |||||
url('//at.alicdn.com/t/font_1353695_nyv2ld9xqk8.ttf') format('truetype'), | |||||
url('//at.alicdn.com/t/font_1353695_nyv2ld9xqk8.svg#iconfont') format('svg'); | |||||
} | |||||
.iconfont { | |||||
font-family: "iconfont" !important; | |||||
font-size: 16px; | |||||
font-style: normal; | |||||
-webkit-font-smoothing: antialiased; | |||||
-moz-osx-font-smoothing: grayscale; | |||||
} | |||||
.icon-daohangdizhiweizhi:before { | |||||
content: "\e787"; | |||||
} | |||||
.locations{ | |||||
font-size: 28rpx; | |||||
display: inline-block; | |||||
width: 200rpx; | |||||
overflow: hidden; | |||||
text-overflow:ellipsis; | |||||
white-space: nowrap; | |||||
} | |||||
.pick-box{ | |||||
width: 260rpx; | |||||
padding-left: 20rpx; | |||||
} | } |
@@ -10,6 +10,7 @@ const bgColor = require("../utils/bgColor.js") | |||||
let app = getApp(); | let app = getApp(); | ||||
Page({ | Page({ | ||||
data: { | data: { | ||||
showLocationIf:true, | |||||
ifStoreApp: ifStoreApp, | ifStoreApp: ifStoreApp, | ||||
navigationBarTitle: '首页', | navigationBarTitle: '首页', | ||||
navigationBarHeight, | navigationBarHeight, | ||||
@@ -1,4 +1,4 @@ | |||||
<navbar text="首页"></navbar> | |||||
<navbar showLocationIf="{{showLocationIf}}" text="首页"></navbar> | |||||
<view class="container" style="padding-top:{{navigationBarHeight}};"> | <view class="container" style="padding-top:{{navigationBarHeight}};"> | ||||
<!-- 会员信息 --> | <!-- 会员信息 --> | ||||
<view class='userinfo' wx:if="{{ifStoreApp!=1}}"> | <view class='userinfo' wx:if="{{ifStoreApp!=1}}"> | ||||