当前位置:   article > 正文

微信小程序之开发会议OA项目

微信小程序之开发会议OA项目

目录

前言

本篇目标 

首页

会议

投票 

个人中心 

会议OA项目-首页

配置

tabbar

mock工具

page

swiper

会议信息

会议OA项目-会议 

自定义tabs组件

会议管理

会议OA项目-投票

会议OA项目-个人中心


前言

文章含源码资源,投票及个人中心详细自行查看源码即可

  1. 小程序没有DOM对象,一切基于组件化
  2. 储备知识

    1. 理解事件机制

    2. 理解组件化

    3. 理解数据绑定

    4. Flex布局

    5. 移动端适配方案

  3. 建议:学习vue后开发小程序更简单

本篇目标 

首页

会议

 

投票 

个人中心 

 

会议OA项目-首页

配置

  • config/api.js
    1. // 以下是业务服务器API地址
    2. // 本机开发API地址
    3. var WxApiRoot = 'http://localhost:8080/demo/wx/';
    4. // 测试环境部署api地址
    5. // var WxApiRoot = 'http://192.168.0.101:8070/demo/wx/';
    6. // 线上平台api地址
    7. //var WxApiRoot = 'https://www.oa-mini.com/demo/wx/';
    8. module.exports = {
    9. IndexUrl: WxApiRoot + 'home/index', //首页数据接口
    10. SwiperImgs: WxApiRoot+'swiperImgs', //轮播图
    11. MettingInfos: WxApiRoot+'meeting/list', //会议信息
    12. };

tabbar

  • app.json
    1. "list": [{
    2. "pagePath": "pages/index/index",
    3. "text": "首页",
    4. "iconPath": "/static/tabBar/coding.png",
    5. "selectedIconPath": "/static/tabBar/coding-active.png"
    6. },
    7. {
    8. "pagePath": "pages/meeting/list/list",
    9. "iconPath": "/static/tabBar/sdk.png",
    10. "selectedIconPath": "/static/tabBar/sdk-active.png",
    11. "text": "会议"
    12. },
    13. {
    14. "pagePath": "pages/vote/list/list",
    15. "iconPath": "/static/tabBar/template.png",
    16. "selectedIconPath": "/static/tabBar/template-active.png",
    17. "text": "投票"
    18. },
    19. {
    20. "pagePath": "pages/ucenter/index/index",
    21. "iconPath": "/static/tabBar/component.png",
    22. "selectedIconPath": "/static/tabBar/component-active.png",
    23. "text": "个人中心"
    24. }]

mock工具

  • imageSrcs
    1. {
    2. "data": {
    3. "images":[
    4. {
    5. "img": "https://tse2-mm.cn.bing.net/th/id/OIP-C.ja-L_FC01Xbzhqo4Rm3B8gHaEo?rs=1&pid=ImgDetMain",
    6. "text": "1"
    7. },
    8. {
    9. "img": "https://tse2-mm.cn.bing.net/th/id/OIP-C.A3UXYP_OyP3S5UfO6HXuAgHaEK?rs=1&pid=ImgDetMain",
    10. "text": "2"
    11. },
    12. {
    13. "img": "https://pic3.zhimg.com/v2-9873f715d01819718cdc59dc004052b5_1440w.jpg?source=172ae18b",
    14. "text": "3"
    15. },
    16. {
    17. "img": "https://ts1.cn.mm.bing.net/th/id/R-C.8bb9ed00b8b77b8de03ca88c2c5b9c70?rik=KsLZ%2fjYfY5ELCg&riu=http%3a%2f%2fwww.kutoo8.com%2fupload%2fimage%2f10539408%2f14.jpg&ehk=HMGT1e0hcjxVw1XAbC7yJpq3qSDWlnwsj%2fRN%2f0Etimk%3d&risl=&pid=ImgRaw&r=0",
    18. "text": "4"
    19. },
    20. {
    21. "img": "https://img1.pconline.com.cn/piclib/200906/09/batch/1/34797/1244512002916phjm5dpgjl.jpg",
    22. "text": "5"
    23. },
    24. {
    25. "img": "https://ts1.cn.mm.bing.net/th/id/R-C.d951726778523659c8f2d7fd6ad838fd?rik=kR8VYs9ELLWFKQ&riu=http%3a%2f%2fwww.kutoo8.com%2fupload%2fimage%2f85280274%2f2017032108.jpg&ehk=%2fJInO%2fEPMaYF1q%2fu6vzk2j6hPSkAEyCyc3%2fH1Ib1tM0%3d&risl=&pid=ImgRaw&r=0",
    26. "text": "6"
    27. }
    28. ]
    29. },
    30. "statusCode": "200",
    31. "header": {
    32. "content-type":"applicaiton/json;charset=utf-8"
    33. }
    34. }

page

  • index.css
    1. page{
    2. height: 100%;
    3. background-color: #efeff4;
    4. }

swiper

  • index.wxml
    1. <swiper indicator-dots="true" autoplay="true" circular="true" indicator-color="#fff" indicator-active-color="blue">
    2. <block wx:for="{{images}}" wx:key="text">
    3. <swiper-item>
    4. <view class="swiper-item">
    5. <image src="{{item.img}}" mode="scaleToFill"></image>
    6. </view>
    7. </swiper-item>
    8. </block>
    9. </swiper>

  • index.css
    1. swiper {
    2. width: 100%;
    3. height: calc(100vw*9/16);
    4. }
    5. .swiper-item>image {
    6. width:100%;
    7. }

  • index.js
    1. loadSwiperImgs(){
    2. //请注意this的指向问题
    3. let that=this;
    4. wx.request({
    5. url: api.SwiperImgs,
    6. success(rs){
    7. console.log(rs);
    8. that.setData({
    9. images:rs.data.images
    10. });
    11. }
    12. })
    13. }

会议信息

  • mock数据
    1. {
    2. "data": {
    3. "lists": [
    4. {
    5. "id": "1",
    6. "image": "/static/persons/Snipaste_2024-02-18_20-39-17.png",
    7. "title": "微信小程序会议OA_空空",
    8. "num":"1314",
    9. "state":"进行中",
    10. "starttime": "2024-02-18 21:00:00",
    11. "location": "湖南省——长沙市"
    12. },
    13. {
    14. "id": "1",
    15. "image": "/static/persons/Snipaste_2024-02-18_20-40-00.png",
    16. "title": "微信小程序会议OA_空空",
    17. "num":"520",
    18. "state":"已结束",
    19. "starttime": "2024-02-18 12:00:00",
    20. "location": "湖南省——长沙市"
    21. },
    22. {
    23. "id": "1",
    24. "image": "/static/persons/Snipaste_2024-02-18_20-40-45.png",
    25. "title": "微信小程序会议OA_空空",
    26. "num":"888",
    27. "state":"进行中",
    28. "starttime": "2024-02-18 08:00:00",
    29. "location": "湖南省——长沙市"
    30. },
    31. {
    32. "id": "1",
    33. "image": "/static/persons/Snipaste_2024-02-18_20-40-45.png",
    34. "title": "微信小程序会议OA_空空",
    35. "num":"666",
    36. "state":"已结束",
    37. "starttime": "2024-02-18 08:00:00",
    38. "location": "湖南省——长沙市"
    39. },
    40. {
    41. "id": "1",
    42. "image": "/static/persons/Snipaste_2024-02-18_20-40-00.png",
    43. "title": "微信小程序会议OA_空空",
    44. "num":"999",
    45. "state":"进行中",
    46. "starttime": "2024-02-18 08:00:00",
    47. "location": "湖南省——长沙市"
    48. }
    49. ]
    50. },
    51. "statusCode": "200",
    52. "header": {
    53. "content-type":"applicaiton/json;charset=utf-8"
    54. }
    55. }

  • index.wxml
    1. <view class="mobi-title">
    2. <text class="mobi-icon"></text>
    3. <text>会议信息</text>
    4. </view>
    5. <block wx:for-items="{{lists}}" wx:for-item="item" wx:key="item.id">
    6. <view class="list" data-id="{{item.id}}">
    7. <view class="list-img">
    8. <image class="video-img" mode="scaleToFill" src="{{item.image}}"></image>
    9. </view>
    10. <view class="list-detail">
    11. <view class="list-title"><text>{{item.title}}</text></view>
    12. <view class="list-tag">
    13. <view class="state">{{item.state}}</view>
    14. <view class="join"><text class="list-num">{{item.num}}</text>人报名</view>
    15. </view>
    16. <view class="list-info"><text>{{item.address}}</text>|<text>{{item.time}}</text></view>
    17. </view>
    18. </view>
    19. </block>
    20. <view class="section bottom-line">
    21. <text>到底啦</text>
    22. </view>

  • index.js
    1. loadMeetingInfos(){
    2. let that=this;
    3. wx.request({
    4. url: api.MettingInfos,
    5. dataType: 'json',
    6. success(res) {
    7. console.log(res)
    8. that.setData({
    9. lists:res.data.lists
    10. })
    11. }
    12. })
    13. }

  • index.wxss
    1. .mobi-title {
    2. font-size: 12pt;
    3. color: #777;
    4. line-height: 110%;
    5. font-weight: bold;
    6. width: 100%;
    7. padding: 15rpx;
    8. background-color: #f3f3f3;
    9. }
    10. .mobi-icon {
    11. padding: 0rpx 3rpx;
    12. border-radius: 3rpx;
    13. background-color: #ff7777;
    14. position: relative;
    15. margin-right: 10rpx;
    16. }
    17. /*list*/
    18. .list {
    19. display: flex;
    20. flex-direction: row;
    21. width: 100%;
    22. padding: 0 20rpx 0 0;
    23. border-top: 1px solid #eeeeee;
    24. background-color: #fff;
    25. margin-bottom: 5rpx;
    26. /* border-radius: 20rpx;
    27. box-shadow: 0px 0px 10px 6px rgba(0,0,0,0.1); */
    28. }
    29. .list-img {
    30. display: flex;
    31. margin: 10rpx 10rpx;
    32. width: 150rpx;
    33. height: 220rpx;
    34. justify-content: center;
    35. align-items: center;
    36. }
    37. .list-img .video-img {
    38. width: 120rpx;
    39. height: 120rpx;
    40. }
    41. .list-detail {
    42. margin: 10rpx 10rpx;
    43. display: flex;
    44. flex-direction: column;
    45. width: 600rpx;
    46. height: 220rpx;
    47. }
    48. .list-title text {
    49. font-size: 11pt;
    50. color: #333;
    51. font-weight: bold;
    52. }
    53. .list-detail .list-tag {
    54. display: flex;
    55. height: 70rpx;
    56. }
    57. .list-tag .state {
    58. font-size: 9pt;
    59. color: #81aaf7;
    60. width: 120rpx;
    61. border: 1px solid #93b9ff;
    62. border-radius: 2px;
    63. margin: 10rpx 0rpx;
    64. display: flex;
    65. justify-content: center;
    66. align-items: center;
    67. }
    68. .list-tag .join {
    69. font-size: 11pt;
    70. color: #bbb;
    71. margin-left: 20rpx;
    72. display: flex;
    73. justify-content: center;
    74. align-items: center;
    75. }
    76. .list-tag .list-num {
    77. font-size: 11pt;
    78. color: #ff6666;
    79. }
    80. .list-info {
    81. font-size: 9pt;
    82. color: #bbb;
    83. margin-top: 20rpx;
    84. }
    85. .bottom-line{
    86. display: flex;
    87. height: 60rpx;
    88. justify-content: center;
    89. align-items: center;
    90. background-color: #f3f3f3;
    91. }
    92. .bottom-line text{
    93. font-size: 9pt;
    94. color: #666;
    95. }

会议OA项目-会议 

自定义tabs组件

 文档参考地址:自定义组件 | 微信开放文档

tabs.json

  1. {
  2. "component": true,
  3. "usingComponents": {}
  4. }

 tabs.wxml

  1. <view class="tabs">
  2. <view class="tabs_title">
  3. <view wx:for="{{tabList}}" wx:key="id" class="title_item {{index==tabIndex?'item_active':''}}" bindtap="handleItemTap" data-index="{{index}}">
  4. <view style="margin-bottom:5rpx">{{item}}</view>
  5. <view style="width:30px" class="{{index==tabIndex?'item_active1':''}}"></view>
  6. </view>
  7. </view>
  8. <view class="tabs_content">
  9. <slot></slot>
  10. </view>
  11. </view>

 tabs.wxss

  1. .tabs {
  2. position: fixed;
  3. top: 0;
  4. width: 100%;
  5. background-color: #fff;
  6. z-index: 99;
  7. border-bottom: 1px solid #efefef;
  8. padding-bottom: 20rpx;
  9. }
  10. .tabs_title {
  11. /* width: 400rpx; */
  12. width: 90%;
  13. display: flex;
  14. font-size: 9pt;
  15. padding: 0 20rpx;
  16. }
  17. .title_item {
  18. color: #999;
  19. padding: 15rpx 0;
  20. display: flex;
  21. flex: 1;
  22. flex-flow: column nowrap;
  23. justify-content: center;
  24. align-items: center;
  25. }
  26. .item_active {
  27. /* color:#ED8137; */
  28. color: #000000;
  29. font-size: 11pt;
  30. font-weight: 800;
  31. }
  32. .item_active1 {
  33. /* color:#ED8137; */
  34. color: #000000;
  35. font-size: 11pt;
  36. font-weight: 800;
  37. border-bottom: 6rpx solid #333;
  38. border-radius: 2px;
  39. }

 tabs.js

  1. var App = getApp();
  2. Component({
  3. /**
  4. * 组件的属性列表
  5. */
  6. properties: {
  7. tabList:Object
  8. },
  9. /**
  10. * 组件的初始数据
  11. */
  12. data: {
  13. tabIndex:0
  14. },
  15. /**
  16. * 组件的方法列表
  17. */
  18. methods: {
  19. handleItemTap(e){
  20. // 获取索引
  21. const {index} = e.currentTarget.dataset;
  22. // 触发 父组件的事件
  23. this.triggerEvent("tabsItemChange",{index})
  24. this.setData({
  25. tabIndex:index
  26. })
  27. }
  28. }
  29. })

会议管理

list.json

  1. {
  2. "usingComponents": {
  3. "tabs":"/components/tabs/tabs"
  4. }
  5. }

list.wxml

  1. <tabs tabList="{{tabs}}" bindtabsItemChange="tabsItemChange">
  2. </tabs>
  3. <view style="height: 100rpx;"></view>
  4. <block wx:for-items="{{lists}}" wx:for-item="item" wx:key="item.id">
  5. <view class="list" data-id="{{item.id}}">
  6. <view class="list-img al-center">
  7. <image class="video-img" mode="scaleToFill" src="{{item.image}}"></image>
  8. </view>
  9. <view class="list-detail">
  10. <view class="list-title"><text>{{item.title}}</text></view>
  11. <view class="list-tag">
  12. <view class="state al-center">{{item.state}}</view>
  13. <view class="join al-center"><text class="list-num">{{item.num}}</text>人报名</view>
  14. </view>
  15. <view class="list-info"><text>{{item.address}}</text>|<text>{{item.time}}</text></view>
  16. </view>
  17. </view>
  18. </block>

list.wxss

  1. .mobi-title {
  2. font-size: 12pt;
  3. color: #777;
  4. line-height: 110%;
  5. font-weight: bold;
  6. width: 100%;
  7. padding: 15rpx;
  8. background-color: #f3f3f3;
  9. }
  10. .mobi-icon {
  11. padding: 0rpx 3rpx;
  12. border-radius: 3rpx;
  13. background-color: #ff7777;
  14. position: relative;
  15. margin-right: 10rpx;
  16. }
  17. /*list*/
  18. .list {
  19. display: flex;
  20. flex-direction: row;
  21. width: 100%;
  22. padding: 0 20rpx 0 0;
  23. border-top: 1px solid #eeeeee;
  24. background-color: #fff;
  25. margin-bottom: 5rpx;
  26. /* border-radius: 20rpx;
  27. box-shadow: 0px 0px 10px 6px rgba(0,0,0,0.1); */
  28. }
  29. .list-img {
  30. display: flex;
  31. margin: 10rpx 10rpx;
  32. width: 150rpx;
  33. height: 220rpx;
  34. justify-content: center;
  35. align-items: center;
  36. }
  37. .list-img .video-img {
  38. width: 120rpx;
  39. height: 120rpx;
  40. }
  41. .list-detail {
  42. margin: 10rpx 10rpx;
  43. display: flex;
  44. flex-direction: column;
  45. width: 600rpx;
  46. height: 220rpx;
  47. }
  48. .list-title text {
  49. font-size: 11pt;
  50. color: #333;
  51. font-weight: bold;
  52. }
  53. .list-detail .list-tag {
  54. display: flex;
  55. height: 70rpx;
  56. }
  57. .list-tag .state {
  58. font-size: 9pt;
  59. color: #81aaf7;
  60. width: 120rpx;
  61. border: 1px solid #93b9ff;
  62. border-radius: 2px;
  63. margin: 10rpx 0rpx;
  64. display: flex;
  65. justify-content: center;
  66. align-items: center;
  67. }
  68. .list-tag .join {
  69. font-size: 11pt;
  70. color: #bbb;
  71. margin-left: 20rpx;
  72. display: flex;
  73. justify-content: center;
  74. align-items: center;
  75. }
  76. .list-tag .list-num {
  77. font-size: 11pt;
  78. color: #ff6666;
  79. }
  80. .list-info {
  81. font-size: 9pt;
  82. color: #bbb;
  83. margin-top: 20rpx;
  84. }
  85. .bottom-line{
  86. display: flex;
  87. height: 60rpx;
  88. justify-content: center;
  89. align-items: center;
  90. background-color: #f3f3f3;
  91. }
  92. .bottom-line text{
  93. font-size: 9pt;
  94. color: #666;
  95. }

list.js

  1. // pages/meeting/list/list.js
  2. Page({
  3. /**
  4. * 页面的初始数据
  5. */
  6. data: {
  7. tabs:['会议中','已完成','已取消','全部会议'],
  8. lists: [
  9. {
  10. 'id': '1',
  11. 'image': '/static/persons/Snipaste_2024-02-18_20-39-17.png',
  12. 'title': '微信小程序会议OA_空空',
  13. 'num':'1314',
  14. 'state':'进行中',
  15. 'time': '02月18日 21:00',
  16. 'address': '湖南省——长沙市'
  17. },
  18. {
  19. 'id': '1',
  20. 'image': '/static/persons/Snipaste_2024-02-18_20-40-00.png',
  21. 'title': '微信小程序会议OA_空空',
  22. 'num':'520',
  23. 'state':'已结束',
  24. 'time': '02月18日 21:00',
  25. 'address': '湖南省——长沙市'
  26. },
  27. {
  28. 'id': '1',
  29. 'image': '/static/persons/Snipaste_2024-02-18_20-40-45.png',
  30. 'title': '微信小程序会议OA_空空',
  31. 'num':'666',
  32. 'state':'进行中',
  33. 'time': '02月18日 21:00',
  34. 'address': '湖南省——长沙市'
  35. },
  36. {
  37. 'id': '1',
  38. 'image': '/static/persons/Snipaste_2024-02-18_20-40-45.png',
  39. 'title': '微信小程序会议OA_空空',
  40. 'num':'888',
  41. 'state':'已结束',
  42. 'time': '02月18日 21:00',
  43. 'address': '湖南省——长沙市'
  44. },
  45. {
  46. 'id': '1',
  47. 'image': '/static/persons/Snipaste_2024-02-18_20-39-17.png',
  48. 'title': '微信小程序会议OA_空空',
  49. 'num':'217',
  50. 'state':'进行中',
  51. 'time': '10月09日 16:59',
  52. 'address': '北京市·朝阳区'
  53. }
  54. ],
  55. lists1: [
  56. {
  57. 'id': '1',
  58. 'image': '/static/persons/Snipaste_2024-02-18_20-39-17.png',
  59. 'title': '微信小程序会议OA_空空',
  60. 'num':'304',
  61. 'state':'进行中',
  62. 'time': '10月09日 17:59',
  63. 'address': '深圳市·南山区'
  64. },
  65. {
  66. 'id': '1',
  67. 'image': '/static/persons/Snipaste_2024-02-18_20-39-17.png',
  68. 'title': '微信小程序会议OA_空空',
  69. 'num':'380',
  70. 'state':'已结束',
  71. 'time': '10月09日 17:39',
  72. 'address': '北京市·朝阳区'
  73. },
  74. {
  75. 'id': '1',
  76. 'image': '/static/persons/Snipaste_2024-02-18_20-39-17.png',
  77. 'title': '微信小程序会议OA_空空',
  78. 'num':'500',
  79. 'state':'进行中',
  80. 'time': '10月09日 17:31',
  81. 'address': '大连市'
  82. }
  83. ],
  84. lists2: [
  85. {
  86. 'id': '1',
  87. 'image': '/static/persons/Snipaste_2024-02-18_20-39-17.png',
  88. 'title': '微信小程序会议OA_空空',
  89. 'num':'304',
  90. 'state':'进行中',
  91. 'time': '10月09日 17:59',
  92. 'address': '深圳市·南山区'
  93. },
  94. {
  95. 'id': '1',
  96. 'image': '/static/persons/Snipaste_2024-02-18_20-39-17.png',
  97. 'title': '微信小程序会议OA_空空',
  98. 'num':'380',
  99. 'state':'已结束',
  100. 'time': '10月09日 17:39',
  101. 'address': '北京市·朝阳区'
  102. }
  103. ],
  104. lists3: [
  105. {
  106. 'id': '1',
  107. 'image': '/static/persons/Snipaste_2024-02-18_20-39-17.png',
  108. 'title': '微信小程序会议OA_空空',
  109. 'num':'304',
  110. 'state':'进行中',
  111. 'time': '10月09日 17:59',
  112. 'address': '深圳市·南山区'
  113. },
  114. {
  115. 'id': '1',
  116. 'image': '/static/persons/Snipaste_2024-02-18_20-39-17.png',
  117. 'title': '微信小程序会议OA_空空',
  118. 'num':'380',
  119. 'state':'已结束',
  120. 'time': '10月09日 17:39',
  121. 'address': '北京市·朝阳区'
  122. },
  123. {
  124. 'id': '1',
  125. 'image': '/static/persons/Snipaste_2024-02-18_20-39-17.png',
  126. 'title': '微信小程序会议OA_空空',
  127. 'num':'500',
  128. 'state':'进行中',
  129. 'time': '10月09日 17:31',
  130. 'address': '大连市'
  131. },
  132. {
  133. 'id': '1',
  134. 'image': '/static/persons/Snipaste_2024-02-18_20-39-17.png',
  135. 'title': '微信小程序会议OA_空空',
  136. 'num':'150',
  137. 'state':'已结束',
  138. 'time': '10月09日 17:21',
  139. 'address': '北京市·朝阳区'
  140. },
  141. {
  142. 'id': '1',
  143. 'image': '/static/persons/Snipaste_2024-02-18_20-39-17.png',
  144. 'title': '微信小程序会议OA_空空',
  145. 'num':'217',
  146. 'state':'进行中',
  147. 'time': '10月09日 16:59',
  148. 'address': '北京市·朝阳区'
  149. }
  150. ]
  151. },
  152. /**
  153. * 生命周期函数--监听页面加载
  154. */
  155. onLoad(options) {
  156. },
  157. /**
  158. * 生命周期函数--监听页面显示
  159. */
  160. onShow() {
  161. },
  162. tabsItemChange(e){
  163. let tolists;
  164. if(e.detail.index==1){
  165. tolists = this.data.lists1;
  166. }else if(e.detail.index==2){
  167. tolists = this.data.lists2;
  168. }else{
  169. tolists = this.data.lists3;
  170. }
  171. this.setData({
  172. lists: tolists
  173. })
  174. }
  175. })

会议OA项目-投票

list.js

  1. // pages/vote/list/list.js
  2. var app = getApp();
  3. Page({
  4. /**
  5. * 页面的初始数据
  6. */
  7. data: {
  8. tabs:['全部','发起的','参与的'],
  9. voteList:[
  10. {
  11. id:1,
  12. title:'微信小程序会议OA_空空',
  13. votes:[
  14. {
  15. id:1,
  16. img:'/static/persons/Snipaste_2024-02-18_20-40-00.png',
  17. title:'A',
  18. mem:'A'
  19. },
  20. {
  21. id:2,
  22. img:'/static/persons/Snipaste_2024-02-18_20-40-45.png',
  23. title:'B',
  24. mem:'B'
  25. }
  26. ]
  27. },
  28. {
  29. id:1,
  30. title:'微信小程序会议OA_空空',
  31. votes:[
  32. {
  33. id:1,
  34. img:'/static/persons/Snipaste_2024-02-18_20-40-00.png',
  35. title:'B',
  36. mem:'B'
  37. },
  38. {
  39. id:2,
  40. img:'/static/persons/Snipaste_2024-02-18_20-40-45.png',
  41. title:'C',
  42. mem:'C'
  43. },
  44. {
  45. id:3,
  46. img:'/static/persons/Snipaste_2024-02-18_20-40-45.png',
  47. title:'D',
  48. mem:'X'
  49. },
  50. {
  51. id:4,
  52. img:'/static/persons/Snipaste_2024-02-18_20-39-17.png',
  53. title:'F',
  54. mem:'T'
  55. }
  56. ]
  57. }
  58. ]
  59. },
  60. /**
  61. * 生命周期函数--监听页面加载
  62. */
  63. onLoad(options) {
  64. },
  65. /**
  66. * 生命周期函数--监听页面初次渲染完成
  67. */
  68. onReady() {
  69. },
  70. /**
  71. * 生命周期函数--监听页面显示
  72. */
  73. onShow() {
  74. },
  75. /**
  76. * 生命周期函数--监听页面隐藏
  77. */
  78. onHide() {
  79. },
  80. /**
  81. * 生命周期函数--监听页面卸载
  82. */
  83. onUnload() {
  84. },
  85. /**
  86. * 页面相关事件处理函数--监听用户下拉动作
  87. */
  88. onPullDownRefresh() {
  89. },
  90. /**
  91. * 页面上拉触底事件的处理函数
  92. */
  93. onReachBottom() {
  94. },
  95. /**
  96. * 用户点击右上角分享
  97. */
  98. onShareAppMessage() {
  99. },
  100. tabsItemChange(e){
  101. let index = e.detail.index;
  102. console.log('vote.index='+index)
  103. if(index==1 || index==2){
  104. if (app.globalData.hasLogin) {
  105. }else{
  106. wx.navigateTo({
  107. url: '/pages/auth/login/login',
  108. })
  109. }
  110. }
  111. }
  112. })

会议OA项目-个人中心

index.wxml

  1. <view class="page-container">
  2. <view class="user-info-container">
  3. <view class="user-info" bindtap="goLogin">
  4. <image class="user-img" mode="scaleToFill" src="{{userInfo.avatarUrl}}" />
  5. <text class="user-info-name">{{userInfo.nickName}}</text>
  6. </view>
  7. <image class="user-update" src="/static/tabBar/component.png" bindtap='goPages' data-url='/pages/ucenter/user/user'/>
  8. </view>
  9. <view class="boundary" />
  10. <view class="cells-container">
  11. <view class="cell-wrap">
  12. <image class="cell-icon" src="/static/tabBar/sdk.png" />
  13. <text class="cell-text">我主持的会议</text>
  14. <view class="cell-right">
  15. <view class="cell-list-num">{{metting_pubs}}</view>
  16. <view class="cell-arrow"></view>
  17. </view>
  18. </view>
  19. <view class="cell-wrap">
  20. <image class="cell-icon" src="/static/tabBar/sdk.png" />
  21. <text class="cell-text">我参与的会议</text>
  22. <view class="cell-right">
  23. <view class="cell-list-num">{{metting_joins}}</view>
  24. <view class="cell-arrow"></view>
  25. </view>
  26. </view>
  27. </view>
  28. <view class="boundary" />
  29. <view class="cells-container">
  30. <view class="cell-wrap">
  31. <image class="cell-icon" src="/static/tabBar/sdk.png" />
  32. <text class="cell-text">我发布的投票</text>
  33. <view class="cell-right">
  34. <view class="cell-list-num">1</view>
  35. <view class="cell-arrow"></view>
  36. </view>
  37. </view>
  38. <view class="cell-wrap">
  39. <image class="cell-icon" src="/static/tabBar/sdk.png" />
  40. <text class="cell-text">我参与的投票</text>
  41. <view class="cell-right">
  42. <view class="cell-list-num">10</view>
  43. <view class="cell-arrow"></view>
  44. </view>
  45. </view>
  46. </view>
  47. <view class="boundary" />
  48. <view class="cells-container">
  49. <view class="cell-wrap">
  50. <image class="cell-icon" src="/static/tabBar/template.png" />
  51. <text class="cell-text">消息</text>
  52. <view class="cell-right">
  53. <view class="cell-list-num"></view>
  54. <view class="cell-arrow"></view>
  55. </view>
  56. </view>
  57. <view class="cell-wrap">
  58. <image class="cell-icon" src="/static/tabBar/component.png" />
  59. <text class="cell-text">设置</text>
  60. <view class="cell-right">
  61. <view class="cell-list-num"></view>
  62. <view class="cell-arrow"></view>
  63. </view>
  64. </view>
  65. </view>
  66. </view>

箭头样式:

  1. .cell-arrow {
  2. width: 7px;
  3. height: 7px;
  4. border-width: 1px;
  5. border-color: rgb(136, 136, 136);
  6. border-style: none solid solid none;
  7. transform: rotate(315deg);
  8. }

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/小小林熬夜学编程/article/detail/130729
推荐阅读
相关标签
  

闽ICP备14008679号