1.一、在index.js页面

2.1、index.js中的goodspagedata方法从后台get的数据通过setData将数据shareData从逻辑层发送到视图层(我理解为将数据发送到Page({})下层和goodspagedata方法的同级)

3.

4.2、然后在index.js的sharePoster方法中通过this.data.shareData拿到数据,再通过navigateTo将所需数据传送到post.js中

5.(从index页面跳转到post页面,并且把index页面的数据传递到post页面使用)

6.

7.二、在post.js页面

8.1、在post.js页面中的onLoad事件的e参数中就包括index.js传递过来的数据,将数据通过setData从逻辑层发送到post.wxml视图层

9.post.js

10.

11.post.wxml

12.

TAG标签: 微信小程序微信小程序页面之间传递参数小程序页面传值

http://www.xiaochengxub.com/read-98296.html