|
[云开发]
scrollPicture使用云数据库中url时,出现闪退情侣
[复制链接]
- var arrayPath = new Array();
- var arrayTitle = new Array();
- // arrayPath[0] = 'http://aa5727d3031dd7d42978.b0**.**/apicloud/c883b40eea3189de1101d94fb2c2933c.jpg';
- // arrayPath[1] = 'http://aa5727d3031dd7d42978.b0**.**/apicloud/e3754335ff0bb91363c6e4670df1bdcf.jpg';
- // arrayPath[2] = 'http://f.hiphotos**.**/image/pic/item/4e4a20a4462309f7bdca9423710e0cf3d7cad65d.jpg';
- // arrayPath[3] = 'http://aa5727d3031dd7d42978.b0**.**/apicloud/c883b40eea3189de1101d94fb2c2933c.jpg';
- // arrayPath[4] = 'http://aa5727d3031dd7d42978.b0**.**/apicloud/c883b40eea3189de1101d94fb2c2933c.jpg';
- //
- var model = api.require('model');
- var query = api.require('query');
- model.config({
- appKey : 'BA84BDC4-AE99-74F6-31B7-17B2568AFA5F',
- host : 'https://d.apicloud.com'
- });
- query.createQuery(function(ret, err) {
- if (ret && ret.qid) {
- var queryId = ret.qid;
- model.findAll({
- class : 'advertisement',
- qid : queryId
- }, function(ret, err) {
- if (ret) {
- for(i = 0; i < ret.length; i++){
- arrayPath[i] = ret[i].img.toString();
- alert(arrayPath[i]);
- }
- } else {
- api.toast({
- msg : err.msg,
- location : 'middle'
- })
- }
- });
- }
- });
- arrayTitle[0] = '第一张';
- arrayTitle[1] = '第二张';
- arrayTitle[2] = '第三张';
- arrayTitle[3] = '第四张';
- arrayTitle[4] = '第五张';
- var obj = api.require('scrollPicture');
- obj.open({
- x : 0,
- y : 0,
- h : 200,
- fixedOn : api.frameName,
- fixed : false,
- placeholderImg : 'widget://res/scrollPicture_placehloder.png',
- paths : arrayPath,
- subtitle : {
- titles : arrayTitle
- },
- control : {
- position : 2
- }
- }, function(ret, err) {
- if (ret.status) {
- ret.click
- } else {
- ret.index
- }
- });
- 单独将url值赋值给数组时是可以使用的,但是从云数据库取url下来是就不行,我用alert来显示一下,确实可以得到url,可是一用就崩溃,,,,
复制代码
|
|