avatar.vue 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. <template>
  2. <view>
  3. <cu-custom bgColor="bg-gradual-blue" :isBack="true"><block slot="backText">返回</block><block slot="content">头像</block></cu-custom>
  4. <view class="cu-bar bg-white">
  5. <view class="action">
  6. <text class="cuIcon-title text-blue"></text>头像形状
  7. </view>
  8. </view>
  9. <view class="padding">
  10. <view class="cu-avatar round" style="background-image:url(https://ossweb-img.qq.com/images/lol/web201310/skin/big10001.jpg)"></view>
  11. <view class="cu-avatar radius margin-left" style="background-image:url(https://ossweb-img.qq.com/images/lol/web201310/skin/big81005.jpg);"></view>
  12. </view>
  13. <view class="cu-bar bg-white margin-top">
  14. <view class="action">
  15. <text class="cuIcon-title text-blue"></text>头像尺寸
  16. </view>
  17. </view>
  18. <view class="padding">
  19. <view class="cu-avatar sm round margin-left" style="background-image:url(https://ossweb-img.qq.com/images/lol/web201310/skin/big10001.jpg)"></view>
  20. <view class="cu-avatar round margin-left" style="background-image:url(https://ossweb-img.qq.com/images/lol/web201310/skin/big81005.jpg);"></view>
  21. <view class="cu-avatar lg round margin-left" style="background-image:url(https://ossweb-img.qq.com/images/lol/web201310/skin/big25002.jpg);"></view>
  22. <view class="cu-avatar xl round margin-left" style="background-image:url(https://ossweb-img.qq.com/images/lol/web201310/skin/big99008.jpg);"></view>
  23. </view>
  24. <view class="padding">
  25. <view class="cu-avatar sm round margin-left bg-red"> A</view>
  26. <view class="cu-avatar round margin-left bg-red">B</view>
  27. <view class="cu-avatar lg round margin-left bg-red">C</view>
  28. <view class="cu-avatar xl round margin-left bg-red">D</view>
  29. </view>
  30. <view class="padding">
  31. <view class="cu-avatar sm round margin-left bg-red"> 蔚</view>
  32. <view class="cu-avatar round margin-left bg-red">蓝</view>
  33. <view class="cu-avatar lg round margin-left bg-red">
  34. <text>wl</text>
  35. </view>
  36. <view class="cu-avatar xl round margin-left bg-red">
  37. <text class="avatar-text">网络</text>
  38. </view>
  39. </view>
  40. <view class="cu-bar bg-white margin-top">
  41. <view class="action">
  42. <text class="cuIcon-title text-blue"></text>内嵌文字(图标)
  43. </view>
  44. </view>
  45. <view class="padding">
  46. <view class="cu-avatar radius">
  47. <text class="cuIcon-people"></text>
  48. </view>
  49. <view class="cu-avatar radius margin-left">
  50. <text>港</text>
  51. </view>
  52. </view>
  53. <view class="cu-bar bg-white margin-top">
  54. <view class="action">
  55. <text class="cuIcon-title text-blue"></text>头像颜色
  56. </view>
  57. </view>
  58. <view class="padding-sm">
  59. <view class="cu-avatar round lg margin-xs" :class="'bg-' + item.name" v-for="(item,index) in ColorList" :key="index">
  60. <text class="avatar-text">{{item.name}}</text>
  61. </view>
  62. </view>
  63. <view class="cu-bar bg-white margin-top">
  64. <view class="action">
  65. <text class="cuIcon-title text-blue"></text>头像组
  66. </view>
  67. </view>
  68. <view class="padding">
  69. <view class="cu-avatar-group">
  70. <view class="cu-avatar round lg" v-for="(item,index) in avatar" :key="index" :style="[{ backgroundImage:'url(' + avatar[index] + ')' }]"></view>
  71. </view>
  72. </view>
  73. <view class="cu-bar bg-white margin-top">
  74. <view class="action">
  75. <text class="cuIcon-title text-blue"></text>头像标签
  76. </view>
  77. </view>
  78. <view class="padding">
  79. <view class="cu-avatar round lg margin-left" v-for="(item,index) in avatar" :key="index" :style="[{ backgroundImage:'url(' + avatar[index] + ')' }]">
  80. <view class="cu-tag badge" :class="index%2==0?'cuIcon-female bg-pink':'cuIcon-male bg-blue'"></view>
  81. </view>
  82. </view>
  83. </view>
  84. </template>
  85. <script>
  86. export default {
  87. data() {
  88. return {
  89. ColorList: this.ColorList,
  90. avatar: [
  91. 'https://ossweb-img.qq.com/images/lol/web201310/skin/big10001.jpg',
  92. 'https://ossweb-img.qq.com/images/lol/web201310/skin/big81005.jpg',
  93. 'https://ossweb-img.qq.com/images/lol/web201310/skin/big25002.jpg',
  94. 'https://ossweb-img.qq.com/images/lol/web201310/skin/big91012.jpg'
  95. ],
  96. };
  97. }
  98. }
  99. </script>
  100. <style>
  101. </style>