|
以下是我的测试代码:(附件:测试应用的二维码) 测试结果: 没有复现你们所说的问题- <!DOCTYPE html>
- <head>
- <meta charset='utf-8'>
- <meta name='viewport' content='maximum-scale=1.0,minimum-scale=1.0,user-scalable=no,width=device-width,initial-scale=1.0'/>
- </head>
- <body>
- <input type="button" value="openCalendar" onclick="openCalendar()"/> <br/>
- <input type="button" value="preMonth" onclick="preMonth()"/> <br/>
- <input type="button" value="nextMonth" onclick="nextMonth()"/> <br/>
- <input type="button" value="show" onclick="show_calendar()"/> <br/>
- <input type="button" value="hide" onclick="hide_calendar()"/> <br/>
- <input type="button" value="close" onclick="close_calendar()"/> <br/>
- <script>
- window.apiready = function(){
- DEBUG();
- return;
- }
- function preMonth(){
- var obj = api.require('UICalendar');
- obj.prevMonth(function(ret){
- if(ret){
- alert(JSON.stringify(ret));
- }
- });
- }
- function nextMonth(){
- var obj = api.require('UICalendar');
- obj.nextMonth(function(ret){
- if(ret){
- alert(JSON.stringify(ret));
- }
- });
- }
- function show_calendar(){
- var obj = api.require('UICalendar');
- obj.show();
- }
- function hide_calendar(){
- var obj = api.require('UICalendar');
- obj.hide();
- }
- function close_calendar(){
- var obj = api.require('UICalendar');
- obj.close();
- }
- function openCalendar(){
- var obj = api.require('UICalendar');
- obj.open({
- rect: {
- x: 0,
- y: 150,
- w: 320,
- h: 220
- },
- styles: {
- bg: 'rgba(0,0,0,0)',
- week: {
- weekdayColor: '#3b3b3b',
- weekendColor: '#a8d400',
- size: 12
- },
- date: {
- color: '#3b3b3b',
- selectedColor: '#fff',
- selectedBg: '#a8d500',
- size: 12
- },
- today: {
- color: 'rgb(230,46,37)',
- bg: ''
- },
- specialDate: {
- color: '#a8d500',
- bg: 'widget://image/a.png'
- }
- },
- specialDate: [{
- date: '2015-06-01'
- }],
- switchMode: 'vertical',
- fixedOn: '',
- fixed: true
- }, function(ret, err){
- if(ret){
- alert(JSON.stringify(ret));
- }
- });
- }
- function DEBUG(){
- openCalendar();
- }
- </script>
- </body>
- </html>
复制代码 |
-
-
|