Mini Program jumps from the list page to the details page, how the details page gets all the data through id.

id from the list page

detail:function (event) {

var id=event.currentTarget.dataset.id
wx.navigateTo({
  url: "detail/detail?id="+id,
});

}

how do I get it on the details page?
data simulated by the interface using easymock

Jul.19,2021

print the options of the onLoad parameter of the details page.


solve

  • Product details page code is as follows
// 
onLoad(e) {
  // 
  console.log(e);
  // id
  const id = e.id; // url,
  // ...ajax
}

principle

  • is the parameter passed by query
  • Of course,
  • can also be operated by saving to a global variable and saving it to a local cache (when too many parameters are passed, or when objects need to be passed)

reference

https://developers.weixin.qq.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b37e39-2c0c7.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b37e39-2c0c7.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?