Commit 6bcd9474903e9d3c04be4538a9706f6e91aff2f8

Authored by zhangyan
1 parent 289ee373

no message

1 -<view class="pet-kind fixed left bottom top bg-white pet-kind-after"> 1 +<view class="pet-kind">
2 <!--<view class="gray-deep-font font30r pet-kind-select">选择宠物品种</view>--> 2 <!--<view class="gray-deep-font font30r pet-kind-select">选择宠物品种</view>-->
3 <block wx:for="{{petlist}}" wx:for-item="list"> 3 <block wx:for="{{petlist}}" wx:for-item="list">
4 <view class="pet-kind-kind flex-cm"> 4 <view class="pet-kind-kind flex-cm">
1 .pet-kind{ 1 .pet-kind{
2 width:100%; 2 width:100%;
  3 + padding-top:60rpx;
  4 + box-sizing:border-box;
3 } 5 }
4 .pet-kind-after{ 6 .pet-kind-after{
5 } 7 }
@@ -4,11 +4,13 @@ Page({ @@ -4,11 +4,13 @@ Page({
4 sex:[ 4 sex:[
5 { 5 {
6 pet_sex:'male', 6 pet_sex:'male',
7 - iconurl:'/pages/image/pet-male.svg' 7 + iconurl:'/pages/image/pet-male.svg',
  8 + isactive:false
8 }, 9 },
9 { 10 {
10 pet_sex:'female', 11 pet_sex:'female',
11 - iconurl:'/pages/image/pet-female.svg' 12 + iconurl:'/pages/image/pet-female.svg',
  13 + isactive:true
12 } 14 }
13 ] 15 ]
14 }, 16 },
@@ -18,4 +20,23 @@ Page({ @@ -18,4 +20,23 @@ Page({
18 onShow:function () { 20 onShow:function () {
19 21
20 }, 22 },
  23 + bindDateChange:function (e) {
  24 + console.log(e.detail.value)
  25 + this.setData({
  26 + date:e.detail.value
  27 + })
  28 + },
  29 + selectsex:function (e) {
  30 + var sex=e.currentTarget.dataset.sex;
  31 + var sexlist=this.data.sex;
  32 + sexlist.forEach(function (v,i) {
  33 + v.isactive=false;
  34 + if(v.pet_sex==sex){
  35 + v.isactive=true
  36 + }
  37 + })
  38 + this.setData({
  39 + sex:sexlist
  40 + })
  41 + },
21 }) 42 })
@@ -5,22 +5,22 @@ @@ -5,22 +5,22 @@
5 </view> 5 </view>
6 <view class="pet-sex flex-lr"> 6 <view class="pet-sex flex-lr">
7 <block wx:for="{{sex}}"> 7 <block wx:for="{{sex}}">
8 - <view class="flex-lm"> 8 + <view class="flex-lm" bindtap="selectsex" data-sex="{{item.pet_sex}}">
9 <image src="{{item.iconurl}}" class="sex-icon"></image> 9 <image src="{{item.iconurl}}" class="sex-icon"></image>
10 <view class="pet-radio flex-cm"> 10 <view class="pet-radio flex-cm">
11 - <view class="cirle-radio bg-orange"></view> 11 + <view class="cirle-radio {{item.isactive==true ? 'bg-orange' : ''}}"></view>
12 </view> 12 </view>
13 </view> 13 </view>
14 </block> 14 </block>
15 </view> 15 </view>
16 - <input type="text" placeholder="请输入宝贝名字" placeholder-class="gray-font font28r font-siny flex-cm" class="black-font font28r flex-cm" maxlength="6"/> 16 + <input type="text" placeholder="请输入宝贝名字" placeholder-class="gray-font font28r font-siny" class="black-font font28r" maxlength="6"/>
17 <view class="pet-birth flex-cm"> 17 <view class="pet-birth flex-cm">
18 - <picker mode="date" value="{{date}}" start="2000-01-01" end="2018-09-01" bindchange="bindDateChange">  
19 - <view class="picker gray-font font28r flex-cm"> 18 + <picker mode="date" value="{{date}}" start="2000-01-01" end="2018-11-09" bindchange="bindDateChange">
  19 + <view class="picker {{date ? 'black-font' : 'gray-font'}} font28r flex-cm">
20 {{date ? date : '请选择宝贝生日'}} 20 {{date ? date : '请选择宝贝生日'}}
21 </view> 21 </view>
22 </picker> 22 </picker>
23 </view> 23 </view>
24 - <input type="digit" placeholder="请输入宝贝体重" placeholder-class="gray-font font28r font-siny flex-cm" class="black-font font28r flex-cm" maxlength="3"/> 24 + <input type="digit" placeholder="请输入宝贝体重" placeholder-class="gray-font font28r font-siny" class="black-font font28r" maxlength="3"/>
25 <view class="save-button white-font bg-orange font30r flex-cm">开启宠爱模式</view> 25 <view class="save-button white-font bg-orange font30r flex-cm">开启宠爱模式</view>
26 </view> 26 </view>