earch-details.js 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. // pages/search-details/earch-details.js
  2. Page({
  3. /**
  4. * 页面的初始数据
  5. */
  6. data: {
  7. },
  8. /**
  9. * 生命周期函数--监听页面加载
  10. */
  11. onLoad: function (options) {
  12. console.log(options)
  13. var that=this
  14. const sr=options.sr
  15. console.log(sr)
  16. if (sr == 1){
  17. that.setData({
  18. tex:"白菜\n",
  19. texx:" 白菜(学名:Brassica pekinensis (Lour.) Rupr. ) \n是十字花科,芸苔属二年生草本。"
  20. })
  21. } else if (sr ==2){
  22. that.setData({
  23. tex:"青椒\n",
  24. texx:"青椒为植物界,双子叶植物纲,合瓣花亚纲,茄科。 \n和红色辣椒统称为辣椒。果实为浆果。"
  25. })
  26. } else if (sr == 3){
  27. that.setData({
  28. tex:"黄瓜\n",
  29. texx:"黄瓜(学名:Cucumis sativus L.)葫芦科一年生蔓生或攀援草本植物。\n茎、枝伸长,有棱沟,被白色的糙硬毛。卷须细。"
  30. })
  31. }
  32. },
  33. /**
  34. * 生命周期函数--监听页面初次渲染完成
  35. */
  36. onReady: function () {
  37. },
  38. /**
  39. * 生命周期函数--监听页面显示
  40. */
  41. onShow: function () {
  42. },
  43. /**
  44. * 生命周期函数--监听页面隐藏
  45. */
  46. onHide: function () {
  47. },
  48. /**
  49. * 生命周期函数--监听页面卸载
  50. */
  51. onUnload: function (options) {
  52. },
  53. /**
  54. * 页面相关事件处理函数--监听用户下拉动作
  55. */
  56. onPullDownRefresh: function () {
  57. },
  58. /**
  59. * 页面上拉触底事件的处理函数
  60. */
  61. onReachBottom: function () {
  62. },
  63. /**
  64. * 用户点击右上角分享
  65. */
  66. // onShareAppMessage: function () {
  67. // }
  68. })