Browse Source

[首页][新增][商场选择]

tags/C.10.02
海洋之声 5 years ago
parent
commit
1ca189dd87
5 changed files with 52 additions and 1 deletions
  1. +12
    -0
      components/navbar/navbar.js
  2. +6
    -0
      components/navbar/navbar.wxml
  3. +32
    -0
      components/navbar/navbar.wxss
  4. +1
    -0
      index/index.js
  5. +1
    -1
      index/index.wxml

+ 12
- 0
components/navbar/navbar.js View File

@@ -15,6 +15,10 @@ Component({
type: String,
value: 'Wechat'
},
showLocationIf: {
type: Boolean,
value: false
},
back: {
type: Boolean,
value: false
@@ -26,6 +30,8 @@ Component({
},

data: {
array: ['A广场', 'B广场-北京西单'],
index: 1,
statusBarHeight: app.statusBarHeight + 'px',
navigationBarHeight: (app.statusBarHeight + 44) + 'px'
},
@@ -35,6 +41,12 @@ Component({
url: '/index/index',
})
},
bindPickerChange: function (e) {
console.log('picker发送选择改变,携带值为', e.detail.value)
this.setData({
index: e.detail.value
})
},
back: function () {
wx.navigateBack({
delta: 1


+ 6
- 0
components/navbar/navbar.wxml View File

@@ -10,5 +10,11 @@
</view>
</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>

+ 32
- 0
components/navbar/navbar.wxss View File

@@ -55,4 +55,36 @@
overflow: hidden;
text-overflow: ellipsis;
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;
}

+ 1
- 0
index/index.js View File

@@ -10,6 +10,7 @@ const bgColor = require("../utils/bgColor.js")
let app = getApp();
Page({
data: {
showLocationIf:true,
ifStoreApp: ifStoreApp,
navigationBarTitle: '首页',
navigationBarHeight,


+ 1
- 1
index/index.wxml View File

@@ -1,4 +1,4 @@
<navbar text="首页"></navbar>
<navbar showLocationIf="{{showLocationIf}}" text="首页"></navbar>
<view class="container" style="padding-top:{{navigationBarHeight}};">
<!-- 会员信息 -->
<view class='userinfo' wx:if="{{ifStoreApp!=1}}">


Loading…
Cancel
Save