• 会议OA项目-其它页面->自定义组件应用,其它界面的布局


    1.自定义组件应用

    文档参考:https://developers.weixin.qq.com/miniprogram/dev/framework/custom-component/

    1. //oamin\project.config.json
    2. {
    3. "description": "项目配置文件",
    4. "packOptions": {
    5. "ignore": [],
    6. "include": []
    7. },
    8. "setting": {
    9. "bundle": false,
    10. "userConfirmedBundleSwitch": false,
    11. "ignoreDevUnusedFiles": false,
    12. "ignoreUploadUnusedFiles": false,
    13. "urlCheck": true,
    14. "scopeDataCheck": false,
    15. "coverView": true,
    16. "es6": true,
    17. "postcss": true,
    18. "compileHotReLoad": false,
    19. "lazyloadPlaceholderEnable": false,
    20. "preloadBackgroundData": false,
    21. "minified": true,
    22. "autoAudits": false,
    23. "newFeature": false,
    24. "uglifyFileName": false,
    25. "uploadWithSourceMap": true,
    26. "useIsolateContext": true,
    27. "nodeModules": false,
    28. "enhance": true,
    29. "useMultiFrameRuntime": true,
    30. "useApiHook": true,
    31. "useApiHostProcess": true,
    32. "showShadowRootInWxmlPanel": true,
    33. "packNpmManually": false,
    34. "enableEngineNative": false,
    35. "packNpmRelationList": [],
    36. "minifyWXSS": true,
    37. "showES6CompileOption": false,
    38. "minifyWXML": true,
    39. "babelSetting": {
    40. "ignore": [],
    41. "disablePlugins": [],
    42. "outputPath": ""
    43. }
    44. },
    45. "compileType": "miniprogram",
    46. "libVersion": "2.19.4",
    47. "appid": "wx02e1b4896f9ba974",
    48. "projectname": "miniprogram-92",
    49. "condition": {},
    50. "editorSetting": {
    51. "tabIndent": "insertSpaces",
    52. "tabSize": 2
    53. }
    54. }
    1. "tabs">
    2. "tabs_title">
    3. for="{{tabList}}" wx:key="id" class="title_item {{index==tabIndex?'item_active':''}}" bindtap="handleItemTap" data-index="{{index}}">
    4. "margin-bottom:5rpx">{{item}}
    5. "width:30px" class="{{index==tabIndex?'item_active1':''}}">
    6. "tabs_content">
    1. /* components/tabs/tabs.wxss */
    2. .tabs {
    3. position: fixed;
    4. top: 0;
    5. width: 100%;
    6. background-color: #fff;
    7. z-index: 99;
    8. border-bottom: 1px solid #efefef;
    9. padding-bottom: 20rpx;
    10. }
    11. .tabs_title {
    12. /* width: 400rpx; */
    13. width: 90%;
    14. display: flex;
    15. font-size: 9pt;
    16. padding: 0 20rpx;
    17. }
    18. .title_item {
    19. color: #999;
    20. padding: 15rpx 0;
    21. display: flex;
    22. flex: 1;
    23. flex-flow: column nowrap;
    24. justify-content: center;
    25. align-items: center;
    26. }
    27. .item_active {
    28. /* color:#ED8137; */
    29. color: #000000;
    30. font-size: 11pt;
    31. font-weight: 800;
    32. }
    33. .item_active1 {
    34. /* color:#ED8137; */
    35. color: #000000;
    36. font-size: 11pt;
    37. font-weight: 800;
    38. border-bottom: 6rpx solid #333;
    39. border-radius: 2px;
    40. }
    41. /* components/tabs/tabs.wxss */
    42. .tabs {
    43. position: fixed;
    44. top: 0;
    45. width: 100%;
    46. background-color: #fff;
    47. z-index: 99;
    48. border-bottom: 1px solid #efefef;
    49. padding-bottom: 20rpx;
    50. }
    51. .tabs_title {
    52. /* width: 400rpx; */
    53. width: 90%;
    54. display: flex;
    55. font-size: 9pt;
    56. padding: 0 20rpx;
    57. }
    58. .title_item {
    59. color: #999;
    60. padding: 15rpx 0;
    61. display: flex;
    62. flex: 1;
    63. flex-flow: column nowrap;
    64. justify-content: center;
    65. align-items: center;
    66. }
    67. .item_active {
    68. /* color:#ED8137; */
    69. color: #000000;
    70. font-size: 11pt;
    71. font-weight: 800;
    72. }
    73. .item_active1 {
    74. /* color:#ED8137; */
    75. color: #000000;
    76. font-size: 11pt;
    77. font-weight: 800;
    78. border-bottom: 6rpx solid #333;
    79. border-radius: 2px;
    80. }
    1. //oamin\pages\meeting\list\list.json
    2. {
    3. "usingComponents": {
    4. "tabs": "/components/tabs/tabs"
    5. }
    6. }
    1. // components/tabs/tabs.js
    2. Component({
    3. /**
    4. * 组件的属性列表
    5. */
    6. properties: {
    7. tabList:Object
    8. },
    9. /**
    10. * 组件的初始数据
    11. */
    12. data: {
    13. },
    14. /**
    15. * 组件的方法列表
    16. */
    17. methods: {
    18. handleItemTap(e){
    19. // 获取索引
    20. const {index} = e.currentTarget.dataset;
    21. // 触发 父组件的事件
    22. this.triggerEvent("tabsItemChange",{index})
    23. this.setData({
    24. tabIndex:index
    25. })
    26. }
    27. }
    28. })

    2.其它界面的布局

    1. "user">
    2. "user-img" src="/static/persons/1.jpg">
    3. "user-name">牛逼
    4. "user-oper">修改
    5. "info">
    6. "item1">
    7. "item-icon" src="/static/tabBar/sdk.png">
    8. "item-title">我主持的会议
    9. "item-num">1
    10. "item-open">>
    11. "item2">
    12. "item-icon" src="/static/tabBar/sdk.png">
    13. "item-title">我参与的会议
    14. "item-num">10
    15. "item-open">>
    16. "info">
    17. "item1">
    18. "item-icon" src="/static/tabBar/sdk.png">
    19. "item-title">我发布的会议
    20. "item-num">1
    21. "item-open">>
    22. "item2">
    23. "item-icon" src="/static/tabBar/sdk.png">
    24. "item-title">我参与的投票
    25. "item-num">10
    26. "item-open">>
    27. "info">
    28. "item1">
    29. "item-icon" src="/static/tabBar/sdk.png">
    30. "item-title">消息
    31. "item-num">
    32. "item-open">>
    33. "item2">
    34. "item-icon" src="/static/tabBar/sdk.png">
    35. "item-title">设置
    36. "item-num">
    37. "item-open">>
    1. /* pages/ucenter/index/index.wxss */
    2. .user {
    3. display: flex;
    4. align-items: center;
    5. border-bottom: 6px solid lightgray;
    6. }
    7. .user-img {
    8. width: 80px;
    9. height: 80px;
    10. margin: 10px;
    11. }
    12. .user-name {
    13. font-weight: 700;
    14. margin: 0 250rpx 0 50rpx;
    15. }
    16. .user-open {
    17. color: lightgray;
    18. }
    19. /* .info {} */
    20. .item1,.item2 {
    21. padding: 5px;
    22. display: flex;
    23. align-items: center;
    24. }
    25. .item1{
    26. border-bottom: 1px solid lightgray;
    27. }
    28. .item2 {
    29. border-bottom: 10px solid lightgray;
    30. }
    31. .item-icon {
    32. width: 40px;
    33. height: 40px;
    34. }
    35. .item-title {
    36. width: 500rpx;
    37. }
    38. .item-num {
    39. width: 60rpx;
    40. }
    41. /* .item-open {} */

  • 相关阅读:
    向量数据库Milvus字符串查询
    SpringMVC学习笔记(三)
    从李佳琦到背后的商业逻辑再到游戏行业
    FastDFS-02-JavaAPI
    PlatformIO开发环境
    计算机毕业设计-长途汽车售票系统SSM+JSP【代码讲解+安装调试+文档指导】
    Android 中的权限
    【MATLAB源码-第157期】基于matlab的海马优化算法(SHO)机器人栅格路径规划,输出做短路径图和适应度曲线。
    vue3 prop验证类型
    mysql更新 在字符串中的指定字符后面拼接字符串
  • 原文地址:https://blog.csdn.net/weixin_73471776/article/details/133917708