人生三从境界:昨夜西风凋碧树,独上高楼,望尽天涯路。 衣带渐宽终不悔,为伊消得人憔悴。 众里寻他千百度,蓦然回首,那人却在灯火阑珊处。

test.js 文件里的onLoad

function getarticles(p,order,mythis) {
  wx.request({
    url: 'https://ganggouo.cn/index.php/Home/getarticles',    //后台接口地址
    method: 'post',  //post请求
    data: {
      p: p,
      order: order,
    },
    header: {
      'content-type': 'application/x-www-form-urlencoded'
    },
    success: function (res) {
      mythis.setData({
        Articlelist: res.data
      });
    },
    fail: function (res) {
      console.log(res);
    }
  });
};

 

test.html 页面渲染

<view class='projectlist' >
  <view class='project'  wx:for="{{arrayProject}}"  wx:for-item="itemProjec" wx:key="id" data-datas="{{itemProjec}}" bindtap='projectDetail'>
      <view class='projectText'> {{itemProjec.gongchengmingcheng}} </view>
      <view class='projectleibie label'> {{arrayCategory[itemProjec.leixing].name}} </view>
      <view class='projectjiesuan label'> {{arraySchedule[itemProjec.jieduan].name}} </view>
      <view class='projectTime'> {{itemProjec.faburiqi}} </view>
  </view>
</view>

 

posted on 2018-12-04 09:28  测试开发喵  阅读(2581)  评论(0编辑  收藏  举报