哈喽,大家好,又到周五啦,有木有期待今天的更新呀~今天要教大家的是制作个人中心界面,先上效果图

小程序

个人中心制作

1.mine.js

// pages/mine/mine.jsvar app = getApp()Page({  data: {    userInfo: {},    motto: 'Hello World',    // orderItems    orderItems: [      {        typeId: 0,        name: '待付款',        url: 'bill',        imageurl: '../../images/person/personal_pay.png',      },      {        typeId: 1,        name: '待发货',        url: 'bill',        imageurl: '../../images/person/personal_shipped.png',      },      {        typeId: 2,        name: '待收货',        url: 'bill',        imageurl: '../../images/person/personal_receipt.png'      },      {        typeId: 3,        name: '待评价',        url: 'bill',        imageurl: '../../images/person/personal_comment.png'      }    ],  },  //事件处理函数  toOrder: function () {    wx.navigateTo({      url: '../order/order'    })  },  onLoad: function () {    console.log('onLoad')    var that = this    //调用应用实例的方法获取全局数据    app.getUserInfo(function (userInfo) {      //更新数据      that.setData({        userInfo: userInfo      })    })  }})
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52

toOrder :事件监听,跳转到我的订单界面
onLoad:在加载过程中,获取用户的信息

2.mine.wxml

!--pages/mine/mine.wxml--view class="container"  view class="userinfo"    image class="userinfo-avatar" src="{{userInfo.avatarUrl}}" background-size="cover"/image    text class="userinfo-nickname"{{userInfo.nickName}}/text    image src="../../images/person/account_bg.png" class="account-bg"    /image  /view  view class="separate"/view  view class="order" catchtap="toOrder"    微信小程序个人中心模板

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

声明:本站所有文章资源内容,如无特殊说明或标注,均为采集网络资源。如若本站内容侵犯了原著者的合法权益,可联系本站删除。

上一篇小程序前端制作-个人中心
下一篇小程序“搅局”电商企业如何决战下半场

觉得文章有用就打赏一下吧

微信扫一扫打赏