帖子
帖子
用户
博客
课程
123下一页
返回列表 发新帖
380
帖子
4
勋章
6
Y币
请求数据的代码在哪里发出来看看?
10
帖子
7
勋章
1220
Y币
next2014 发表于 2018-8-2 07:09
用打印什么页面提示哦

你的if怎么判断的你也没截图,就在你if前打印看看有没有东西
2
帖子
0
勋章
50
Y币
技术支持-F 发表于 2018-8-2 10:16
请求数据的代码在哪里发出来看看?

  {
    "id": "56c94a0426f863e874c76caf",
    "name": "佳沛绿奇异果",
    "price": 18.9,
    "description": "享受清爽汁水融进齿间感觉",
    "originPrice": 25.8,
    "unit": "4个",
    "createdAt": "2016-02-21T05:24:20.759Z",
    "updatedAt": "2016-02-21T06:37:10.726Z",
    "stock": 10,
    "thumbnail": {
      "url": "http://afc7f6321c5ea8bcb5b3.b0**.**/apicloud/d3086f24870df03495f9414649bbadb6.gif",
      "name": "1.gif",
      "id": "56c954cdd72170a205b52c4a"
    },
    "showType": 1,
    "supportAreaId": "56c80e0c789b068408ab5a6f",
    "wareTypeId": "56c80da883af652643474b6b",
    "supportArea(uz*R*id)": null,
    "wareType(uz*R*id)": null,
    "wareInfo": "56c95af47bd0f4ee40b297e9"
  }
2
帖子
0
勋章
50
Y币
TamborTang 发表于 2018-8-2 10:19
你的if怎么判断的你也没截图,就在你if前打印看看有没有东西

if (ret) {
                  var list = $api.byId('list');
                  list.innerHTML = "";
                  for(var i in ret){
                     var ware = ret;
                     $api.append(
                       list,
                        '\
                        <div class="ware">\
                          <div class="content">\
                              <img class="thumbnail" src="' + ware.thumbnail.url +'">\
                              <div class="info">\
                                 <div class="name">' + ware.name + '</div>\
                                   <div claass="description">' +ware.description +  '</div>\
                                   <div class="price-tag">\
                                      <span class="price">¥' + ware.price + '</span>\
                                      <span class="unit">/' + ware.unit + '</span>\
                                   </div>\
                                   <div class="origin-price">超市:\
                                      <del>¥' + ware.originPrice + '</del>\
                                   </div>\
                              </div>\
                              <div class="control">\
                                <img class="add" src="../image/add.png">\
                              </div>\
                          </div>\
                        </div>\
                        ');
                    }
               } else {
                  alert( JSON.stringify( err ) );
               }
2
帖子
0
勋章
50
Y币
TamborTang 发表于 2018-8-2 10:19
你的if怎么判断的你也没截图,就在你if前打印看看有没有东西

跟书上一样的写法的在63页里
380
帖子
4
勋章
6
Y币
next2014 发表于 2018-8-2 20:22
跟书上一样的写法的在63页里

会用console.log看ret的值吗
2
帖子
0
勋章
50
Y币
本帖最后由 next2014 于 2018-8-4 06:42 编辑
技术支持-F 发表于 2018-8-3 10:21
会用console.log看ret的值吗

我已经上传源码了,可以帮我看看吗?谢谢
2
帖子
0
勋章
50
Y币
技术支持-F 发表于 2018-8-3 10:21
会用console.log看ret的值吗

是在apicloud-studio的实时预览那里的console看吗?
2
帖子
0
勋章
50
Y币
TamborTang 发表于 2018-8-2 10:19
你的if怎么判断的你也没截图,就在你if前打印看看有没有东西

我已经上传源码了,可以帮我看看吗?
380
帖子
4
勋章
6
Y币
next2014 发表于 2018-8-4 06:38
是在apicloud-studio的实时预览那里的console看吗?

用WiFi真机同步同步到手机中运行项目
123下一页
您需要登录后才可以回帖 登录

本版积分规则