返回

专注连锁门店会员营销管理系统

线上+线下+进销存+收银+会员
HiShop > Hi小程序 > 小程序开发 > 开发实例 >

小程序个人中心页面开发,小程序个人中心页面怎么做

2020-09-27 作者:秩名

 

 

个人中心制作

1. mine.js

// pages/mine/mine.js
var 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

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">
    <text class="myorder-text">我的订单</text>
    <text class="myorderlook-text">查看全部订单</text>
    <image class="next-image" src="../../images/person/next.png"></image>
  </view>
  <view class="line"></view>

  <view class="navs">
    <block wx:for-items="{{orderItems}}" wx:key="name">
      <view class="nav-item" catchtap="toOrder" data-type="{{item.name}}" data-typeid="{{item.typeId}}">
        <image src="{{item.imageurl}}" class="nav-image" />
        <text>{{item.name}}</text>
      </view>
    </block>
  </view>

  <view class="separate"></view>
  <view class="person-list">
    <view class="list-item">
      <image class="item-image" src="../../images/person/personal_favorite.png"></image>
      <text class="item-text">我的收藏</text>
    </view>
    <view class="person-line"></view>
    <view class="list-item">
      <image class="item-image" src="../../images/person/personal_site.png"></image>
      <text class="item-text">收货地址</text>
    </view>
    <view class="person-line"></view>
    <view class="list-item">
      <image class="item-image" src="../../images/person/personal_sale_record.png"></image>
      <text class="item-text">售后记录</text>
    </view>
    <view class="person-line"></view>
    <view class="list-item">
      <image class="item-image" src="../../images/person/personal_evaluated.png"></image>
      <text class="item-text">我的评价</text>
    </view>
    <view class="person-line"></view>
    <view class="list-item">
      <image class="item-image" src="../../images/person/personal_share.png"></image>
      <text class="item-text">推广邀请</text>
    </view>
  </view>
  <view class="separate"></view>
</view>

小程序个人中心页面开发,小程序个人中心页面怎么做

线上+线下+进销存+收银+会员门店零售管理好帮手

  • 极速收银管理

    门店能实现快速收银,提升门店经营效率。

  • 进销存管理

    系统自带进销存管理,更好管理库存销售。

  • 软硬件一体化

    配备收银硬件一站式整体服务。

收 银 会员管理 库存管理 商品管理 交接班 数据报表 营销促单 售后处理 多种收款

获取报价

推荐文章

门店系统 获取报价 立即咨询 免费试用