p_basic.js
963 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
var comfun = require('../../comjs/comfun.js');
Page({
data:{
sex:[
{
pet_sex:'male',
iconurl:'/pages/image/pet-male.svg',
isactive:false
},
{
pet_sex:'female',
iconurl:'/pages/image/pet-female.svg',
isactive:true
}
]
},
onLoad:function () {
comfun.setBarTitle('添加宠物')
},
onShow:function () {
},
bindDateChange:function (e) {
console.log(e.detail.value)
this.setData({
date:e.detail.value
})
},
selectsex:function (e) {
var sex=e.currentTarget.dataset.sex;
var sexlist=this.data.sex;
sexlist.forEach(function (v,i) {
v.isactive=false;
if(v.pet_sex==sex){
v.isactive=true
}
})
this.setData({
sex:sexlist
})
},
})