fxyk-cell.vue 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. <template>
  2. <u-cell-item :arrow="arrow" :bg-color="bgColor" :value="rightValue" class="value-style">
  3. <view slot="title" class="d-flex a-center">
  4. <view :style="titleStyle">{{ title }}</view>
  5. <view v-if="redDot" class="red-dot"></view>
  6. </view>
  7. <view v-if="leftSlot" slot="icon" style="margin-right:29rpx">
  8. <u-image width="45rpx" height="48rpx" :fade="false" square="circle" mode="aspectFit" :src="leftImg" bg-color="#ffffff"></u-image>
  9. </view>
  10. <view v-if="rightSlot" slot="right-icon">
  11. <u-input v-model="value" type="text" input-align="right" :placeholder="placeholder"/>
  12. </view>
  13. </u-cell-item>
  14. </template>
  15. <script>
  16. export default {
  17. props: {
  18. // 左侧标题
  19. title: {
  20. type: String,
  21. default: '修改密码'
  22. },
  23. // 是否显示红色圆点
  24. redDot: {
  25. type: Boolean,
  26. default: false
  27. },
  28. // 是有使用左侧插槽
  29. leftSlot: {
  30. type: Boolean,
  31. default: true
  32. },
  33. // 左侧插槽图片
  34. leftImg: {
  35. type: String,
  36. default: ''
  37. },
  38. // 右侧箭头
  39. arrow: {
  40. type: Boolean,
  41. default: true
  42. },
  43. // 右侧内容
  44. rightValue: {
  45. type: String,
  46. default: ''
  47. },
  48. // 是否使用右侧插槽
  49. rightSlot: {
  50. type: Boolean,
  51. default: false
  52. },
  53. // 右侧插槽提示信息
  54. placeholder: {
  55. type: String,
  56. default: "请输入6位密码"
  57. },
  58. // 背景颜色
  59. bgColor: {
  60. type: String,
  61. default: "transparent"
  62. }
  63. },
  64. data() {
  65. return {
  66. value: ''
  67. }
  68. },
  69. computed: {
  70. titleStyle() {
  71. return {'font-size': '29rpx',
  72. 'font-family': 'SimSun',
  73. 'font-weight': '400',
  74. 'line-height': '40rpx',
  75. 'color': '#000000'}
  76. }
  77. }
  78. }
  79. </script>
  80. <style lang="scss" scoped>
  81. .red-dot {
  82. width: 17rpx;
  83. height: 17rpx;
  84. background: #FF0011;
  85. border-radius: 50%;
  86. margin-left: 8rpx;
  87. }
  88. .value-style {
  89. font-size: 29rpx;
  90. font-family: SimSun;
  91. font-weight: 400;
  92. line-height: 40rpx;
  93. color: #9C9C9C;
  94. }
  95. </style>