index.vue 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. <template>
  2. <uni-card>
  3. <template v-slot:title>
  4. <uni-list>
  5. <uni-list-item :show-switch="true" title="自定义标题"/>
  6. </uni-list>
  7. </template>
  8. <uni-list>
  9. <uni-list-item v-for="item in items" :key="item.accountId"
  10. :title="item.accountName"
  11. :note="item.remark"
  12. thumb="/static/images/avatar.png"
  13. :rightText="item.posName" >
  14. <template v-slot:footer>
  15. <div class="rtbox">
  16. <view class="rt">
  17. <view class="positionName">
  18. <uni-tag :text="item.positionName" size="mini" type="primary"></uni-tag>
  19. </view>
  20. <view class="posName">
  21. <uni-tag :text="item.posName" size="mini" type="success"></uni-tag>
  22. </view>
  23. </view>
  24. <div class="delbt" @click="handle(item)">
  25. <image src="/static/images/del.png"></image>
  26. </div>
  27. </div>
  28. </template>
  29. </uni-list-item>
  30. </uni-list>
  31. <div class="addbt" @click="onAdd">+</div>
  32. <AddForm ref="add" />
  33. </uni-card>
  34. </template>
  35. <script>
  36. import{geDutyList} from '@/api/duty.js'
  37. import AddForm from './components/AddForm.vue'
  38. export default {
  39. components:{
  40. AddForm
  41. },
  42. data() {
  43. return {
  44. keywords:"",
  45. year:new Date().getFullYear(),
  46. dutyDate:'',
  47. week: 44,
  48. items:[]
  49. }
  50. },
  51. onShow() {
  52. this.getData()
  53. },
  54. methods: {
  55. getData(){
  56. // geDutyList({
  57. // year:this.year,
  58. // week:this.week
  59. // }).then((res)=>{
  60. // this.items=res.data
  61. // })
  62. let item={
  63. "accountId": 1122996,
  64. "accountName": "郭志荣",
  65. "groupId": 406283,
  66. "groupName": "铜川市印台区应急管理局",
  67. "ocId": 406283,
  68. "posId": 1122897,
  69. "posName": "主班领导",
  70. "positionId": 1122915,
  71. "positionName": "党委书记、局长",
  72. "remark": "全盘把控"
  73. }
  74. this.items=Array.from({length:10},(_,idx)=>item)
  75. },
  76. handle(item){
  77. },
  78. onAdd(){
  79. this.$refs.add.show()
  80. }
  81. }
  82. }
  83. </script>
  84. <style lang="scss" scoped>
  85. .addbt{
  86. width: 80rpx;
  87. height: 80rpx;
  88. border-radius: 50%;
  89. background-color: #409eff;
  90. color: #fff;
  91. line-height: 80rpx;
  92. text-align: center;
  93. box-shadow:0 2px 10rpx rgba(64,158,255,0.30);
  94. position: fixed;
  95. right: 10rpx;
  96. top: 50%;
  97. z-index: 99;
  98. font-size: 60rpx;
  99. }
  100. .rtbox{
  101. display: flex;
  102. align-items: center;
  103. justify-content: space-between;
  104. }
  105. .delbt{
  106. padding: 20rpx;
  107. image{
  108. display: block;
  109. width: 30rpx;
  110. height: 30rpx;
  111. }
  112. }
  113. </style>