|
还是不行 调用setValue就是在手机上就是没有生效
看控制台的console 是进入到调用setValue的函数里了 但是并没有生效 也没有修改之后的回调
// 获取 提醒时间
function getTime(callback) {
getRemindTime(function (ret) {
console.log('获取时间: ' + JSON.stringify(ret));
// 获取开启状态
frameExec('', "frameVM.status = " + ret.status + ";")
// 设置星期 "days":[0,0,0,1,1,1,1]
frameVM.date.forEach(function (item, index) {
item.active = ret.days[index] == 1 ? true : false;
})
// 调用方法修改选中时间
UICustomPickerSetValue(ret.remind_time)
}, function (err) {
console.log(JSON.stringify(err));
})
}
function getRemind() {
// 使用模块
var UICustomPicker = api.require('UICustomPicker');
// console.log(JSON.stringify($api.offset($api.dom('.remindTime-time'))));
UICustomPicker.open({
rect: {
x: $api.offset($api.dom('.remindTime-time')).l,
y: $api.offset($api.dom('.remindTime-time')).t,
w: $api.offset($api.dom('.remindTime-time')).w,
h: $api.offset($api.dom('.remindTime-time')).h
},
styles: {
bg: 'rgba(0,0,0,0)',
normalColor: '#7E838C',
selectedColor: '#18191C',
selectedSize: 18,
tagColor: '#18191C',
tagSize: 15,
},
data: [{
tag: ':',
// scope: '00-23'
scope: ['00', '01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23']
}, {
scope: ['00', '10', '20', '30', '40', '50']
}],
rows: 5,
autoHide: false, // 选中内容是 其他是否隐藏
fixedOn: api.frameName,
fixed: false,
loop: true // 是否循环滚动
}, function (ret, err) {
if (ret) {
console.log('修改时间: ' + JSON.stringify(ret));
frameVM.time = ret.data ? ret.data.join(':') : '';
} else {
console.log(JSON.stringify(err));
}
});
getTime();
}
function UICustomPickerSetValue(time) {
console.log('setValue函数中');
var UICustomPicker = api.require('UICustomPicker');
UICustomPicker.setValue({
id: 0,
data: time
});
}
|
-
|