wxml: <view class='LBall' > <!-- 1:楼盘商品介绍 --> <block wx:for='{{loupanbt}}' data-loupanID="{{loupanbt.loupanbtID}}" wx:for-item="loupanbt" wx:key="{{loupanbt.id}}"> <view class='anjia-loupanjieshao'> <view class='maidian-thought-1'>\r\t{{loupanbt.loupanbiaoti}}\t\r</view> <view class='anjia-wenzi'>{{loupanbt.loupanwenben}}</view> <view class='anjia-image'><image src='{{loupanbt.images}}'></image></view> </view> <!-- 2:预约拨打电话 --> <view class='tantou' wx:for='{{tantou}}' data-tantouID="{{tantou.tantouID}}" wx:for-item="tantou" wx:key="{{unique}}"> <view class='tantou-xinxi'> <button class='tantou-lejie'><navigator url="">{{tantou.lejie}} </navigator></button> <button class='tantou-bodas' catchtap='phone'>{{tantou.bodas}}</button> </view> <view class='tantou-xinxi'> <form bindsubmit="yuyueSubmit"> <input type="number" class="yuyuephone" name="yuyuephone" placeholder="输入您电话"id="yuyuephone" maxlength="11" bindinput='blurPhone'/> <button form-type='submit' class='yuyuebtn'>{{tantou.queding}}</button> </form> </view> </view> </block> </view> |
js:请求代码
json模拟:
我想根据后端排序来实现:商品列表view和拨打电话view,动态随意排序(我后端有个编辑器可以把商品列表和拨打电话view随意打乱顺序),我前端请求时候该怎么判断是商品列表还是拨打电话view? 目前我上面代码:我的思路是:根据定义id(data-tantouID="{{tantou.tantouID}}" )来判断顺序,数据我拿到了,可是组装不成功,,有大佬指教下问题所在吗? |
SF)MN8PF`Q39LFV$@V(OGZI.png (91.32 KB, 下载次数: 1)