页面中
requestUtil.request( 'app/shop/' + app.globalData.studio.ID + '/product' , {}, function (res) {
for ( var i in res.data.data){
for ( var j in res.data.data[i].items){
let a = res.data.data[i].items[j].Images.split( ',' )
res.data.data[i].items[j].Icon=a[0]
}
}
console.log( "产品返回数据" )
console.log(res.data.data)
_this.setData({
items: res.data.data
})
_this.setData({
abc: "我走这啦"
})
console.log(_this.data.items)
for (let i = 0; i < res.data.data.length; i++) {
for (let j = 0; j < res.data.data[i].items.length; j++) {
_this.data.products[res.data.data[i].items[j].ID] = res.data.data[i].items[j]
}
}
}
)
|
abc那个对无论真机还是开发者布局页面布局是有用的
items那个在开发者和真机都能打印的出来结果,但是但是对布局真机是没有用的
< view class = 'flex-row pd-l-items' >
< scroll-view class = 'pd-l-i-left' scroll-y = "true" >
< side-list items = '{{items}}' customeIdx = '{{selectedIdx}}' bind:selected = 'selected' >side-list >
scroll-view >
< scroll-view class = 'pd-l-i-right' scroll-y = 'true' id = 'products' scroll-with-animation = "true" scroll-into-view = '{{showItem}}' bindscroll = 'onScroll' >
< view wx:for = '{{items}}' wx:key = 'Categoryid' class = 'pd-l-i-panel' >
< text class = 'pd-l-i-type' id = 'type_{{item.Categoryid}}' >{{item.Category}}text >
< view class = 'flex-row pd-l-i-one' wx:for = '{{item.items}}' wx:key = 'id' >
< image class = 'pd-l-i-img' src = '{{item.Icon}}' bindtap = 'toDetail' data-detailId = '{{item.ID}}' >image >
< view style = 'width:100%' >
< view class = 'pd-l-i-name' bindtap = 'toDetail' data-detailId = '{{item.ID}}' >{{item.ReName}}view >
< view class = 'pd-l-i-des' bindtap = 'toDetail' data-detailId = '{{item.ID}}' >{{item.MoreDescription}}view >
< view class = 'flex-row flex-space-between-center' >
< text class = 'pd-l-i-price' >< text style = 'font-size:24rpx' >¥text >{{item.RealPrice/100}}text >
< block wx:if="{{item.Remain>0}}">
< count customeCount = '{{selectedProducts[item.ID].Count}}' data-id = '{{item.ID}}' bind:changed = 'countChanged' >count >
block >
< block wx:else>< view style = 'font-size:30rpx;color:#666' >无货view >block >
view >
view >
view >
view >
< view wx:if = "{{!items||items.length==0}}" style = "text-align:center;display:flex;flex-direction:column;padding-top:200rpx;justify-content:center;align-items:center" >
< image src = '../../static/ic_empty.png' style = 'width:200rpx;height:160rpx' >image >
< view style = 'font-size:30rpx;color:#999;margin-top:20rpx' >工作室暂未上架产品view >
view >
scroll-view >
view >
|
开发者工具中显示为,而真机中显示是为空的,甚至在布局中设置出来{{items.size}}的个数都是为0的,但在开发者工具中为1。
很急,求救啊
以下为开发者工具中
以下为真机联调
?{{abc}}在那里,{{items.size}}在那里,你把对应的截图给我看看