materialWorkBranch.vue 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. <template>
  2. <gui-page :custom-header="true" :header-class="['gui-theme-background-color']">
  3. <template #gHeader>
  4. <view style="height:44px;" class="gui-flex gui-nowrap gui-rows gui-align-items-center">
  5. <!-- 使用组件实现返回按钮及返回首页按钮 -->
  6. <text
  7. style="font-size:44rpx;"
  8. class="gui-header-leader-btns gui-color-white font-icons"
  9. @tap="goHome"
  10. >&#xe6c5;</text>
  11. <!-- 导航文本此处也可以是其他自定义内容 -->
  12. <text
  13. class="gui-h4 gui-blod gui-flex1 gui-text-center gui-ellipsis gui-color-white gui-primary-text"
  14. >功能列表</text>
  15. <!-- 此处加一个右侧展位元素与左侧同宽,实现标题居中 -->
  16. <!-- 实际宽度请根据自己情况设置 -->
  17. <view style="width:40px;" />
  18. </view>
  19. </template>
  20. <template #gBody>
  21. <view class="card-list-flexbox">
  22. <view class="card">
  23. <div class="card-panel" style="background-color: #55aa7f;" @click="handleNavigateTo('物料拆分')">
  24. <text class="font-icons">&#xe661;</text>
  25. <text>物料拆分</text>
  26. </div>
  27. </view>
  28. <view class="card">
  29. <div class="card-panel" style="background-color: #00a0e9;" @click="handleNavigateTo('物料合并')">
  30. <text class="font-icons">&#xe64d;</text>
  31. <text>物料合并</text>
  32. </div>
  33. </view>
  34. </view>
  35. </template>
  36. </gui-page>
  37. </template>
  38. <script>
  39. import {
  40. defineComponent
  41. } from 'vue'
  42. export default defineComponent({
  43. setup() {
  44. const goHome = function() {
  45. uni.$goHome()
  46. }
  47. const handleNavigateTo = function(state) {
  48. switch (state) {
  49. case '物料拆分':
  50. uni.navigateTo({
  51. url: '/pages/workbranch/warehouse/materialDisass/materialSplit'
  52. })
  53. break
  54. case '物料合并':
  55. uni.navigateTo({
  56. url: '/pages/workbranch/warehouse/materialDisass/materialMerge'
  57. })
  58. break
  59. }
  60. }
  61. return {
  62. goHome,
  63. handleNavigateTo
  64. }
  65. }
  66. })
  67. </script>
  68. <style lang="scss" scoped>
  69. .gui-header-leader-btns {
  70. color: black;
  71. font-size: 24px !important;
  72. margin-left: 24rpx;
  73. }
  74. .card-list-flexbox {
  75. margin-top: 100px;
  76. display: grid;
  77. grid-template-columns: 1fr 1fr 1fr;
  78. .card {
  79. display: flex;
  80. justify-content: center;
  81. align-items: center;
  82. .card-panel {
  83. width: 85px;
  84. height: 85px;
  85. display: flex;
  86. flex-direction: column;
  87. justify-content: center;
  88. align-items: center;
  89. border-radius: 8px;
  90. box-shadow: 1px 1px 2px 3px #e9e9e9;
  91. text:nth-of-type(2) {
  92. margin-top: 4px;
  93. font-size: 12px;
  94. font-weight: bold;
  95. color: white;
  96. }
  97. }
  98. }
  99. }
  100. .font-icons {
  101. font-size: 36px;
  102. color: white;
  103. }
  104. </style>