WeChat Mini Programs view bindtap changed to navigator bindtap url form

question

add, or can you tell me how to change the following code to jump to the corresponding cat.wxml list, whether the corresponding category label bright red
is passing multiple parameters, parameter 1 jump cat.wxml parameter 2 this classification (call to cat.wxml list) is easy to understand?

or just jump to the cat.wxml page (after the specified category is displayed, call up each category at the top),

<navigator bindtap="hideGetCoupon" class="flex-y-center" url="/pages/cat/cat?cat_id={{cat.id}}">


how to put the following code

related codes

after adjusting the classification on the home page, the effect of the classification can not be seen, only the corresponding classification products are displayed, and the classification is missing as shown in the figure above

<navigator bindtap="hideGetCoupon" class="flex-y-center" url="/pages/cat/cat?cat_id={{cat.id}}">
<text></text>
<image src="{{__wxapp_img.store.jiantou_r.url}}"></image>
 </navigator>

after modification, you can jump to the page effect of the following code, which is the effect of the normal classified page

.

cat.wxml


cat.js




I don't know if what I understand is correct:
1, home

 <!--index.wxml-->
<navigator 
    bindtap="hideGetCoupon" 
    class="flex-y-center" 
    url="/pages/list/list?cat_id={{cat.id}}">
    <text></text>    
    <image src="{{__wxapp_img.store.jiantou_r.url}}"></image>
</navigator>

2, classified list page

 <!--cat.wxml-->
<view 
    bindtap="goodsAll" 
    class="scroll-view-item {{item.id==cat_id?'active':''}}" 
    data-index="{{index}}" 
    id="{{item.id}}"
    wx:for="{{cat_list}}"
    wx:key="unique">{{item.name}}</view>

onload receive parameters in cat.js

//cat.js
onLoad: function (options) {
   if (options.cat_id){
      this.setData({
        cat_id: options.cat_id,
      })
    }
}

  • your cat_list is obviously not worth it, is it?
  • check the request API of cat_list to see if you also need to pass parameters, then pass the corresponding parameters

item.active can I print it?


I don't quite understand what you're talking about, but since you want to change it to that navigational jump, just write in the corresponding URL, then display the corresponding category, pass in the parameters with data-, and then receive and display it on the page after the jump.

Menu