How does WeChat Mini Programs choose the photo and display it on another page?

as shown in the figure, the photo I currently selected by clicking the button is displayed on the current page. Now I want to display the picture on another page, but the image tag cannot be displayed on another page directly. What method can I use?

<view class="page">
  <view class="button-sp-area">
<button class="weui-btn" type="primary" bindtap="btn"></button>
<button class="weui-btn" type="primary" ></button>
 <button class="weui-btn" type="primary"></button>
 <button class="weui-btn" type="primary" ></button>
  </view>
<image class= "show-image" mode="aspectFitf" src="{{src}}">      </image>
</view>
 btn: function (e) {
      var _this = this
      wx.chooseImage({
      count: 1,
      sizeType: ["original", "compressed"],
      sourceType: ["album", "camera"],
      success(res) {
    // tempFilePathimgsrc
      var tempFilePaths = res.tempFilePaths;
      _this.setData({
        src: tempFilePaths
    })
  }
})
}


do you want to get the src data in the data of this page on another page? consider using the page stack

.
 var pages = getCurrentPages();
 var Page = pages[pages.length - 1];//
 var prevPage = pages[pages.length - 2]; //
 var info = prevPage.data //data

url search pass parameters
/ test?url=djqwuidjqoijdoiqw

Menu