微信小程序> 微信小程序实战篇-个人中心、订单制作

微信小程序实战篇-个人中心、订单制作

浏览量:4431 时间: 来源:极乐叔

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

小程序

个人中心制作

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"    小程序
            
            

版权声明

即速应用倡导尊重与保护知识产权。如发现本站文章存在版权问题,烦请提供版权疑问、身份证明、版权证明、联系方式等发邮件至197452366@qq.com ,我们将及时处理。本站文章仅作分享交流用途,作者观点不等同于即速应用观点。用户与作者的任何交易与本站无关,请知悉。

产品经理

手机 : 13312967497

擅长 : 小程序流量变现

扫码领取礼包

最新资讯

热门模板

  • 头条
  • 搜狐
  • 微博
  • 百家
  • 一点资讯
  • 知乎