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:預(yù)約撥打電話 --> <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:請(qǐng)求代碼
json模擬:
我想根據(jù)后端排序來實(shí)現(xiàn):商品列表view和撥打電話view,動(dòng)態(tài)隨意排序(我后端有個(gè)編輯器可以把商品列表和撥打電話view隨意打亂順序),我前端請(qǐng)求時(shí)候該怎么判斷是商品列表還是撥打電話view? 目前我上面代碼:我的思路是:根據(jù)定義id(data-tantouID="{{tantou.tantouID}}" )來判斷順序,數(shù)據(jù)我拿到了,可是組裝不成功,,有大佬指教下問題所在嗎? |
SF)MN8PF`Q39LFV$@V(OGZI.png (91.32 KB, 下載次數(shù): 1)
工作日 8:30-12:00 14:30-18:00
周六及部分節(jié)假日提供值班服務(wù)