chooseRole.vue 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. <template>
  2. <view class="u-page">
  3. <navigation-bar title="选择角色" background-color="#fff" front-color="#000000" />
  4. <u-list>
  5. <u-list-item v-for="(item, index) in roles" :key="index" >
  6. <!-- #fff7f7 -->
  7. <!-- <u-row customStyle="marginBottom:10px;backgroundColor: '#fff7f7';height: '200px'"> -->
  8. <u-row @click="choose(item)" :class="index==current? 'active-custom-style':'custom-style'">
  9. <u-col span="8">
  10. <view class="r-role">
  11. {{item.name}}
  12. </view>
  13. </u-col>
  14. <u-col span="4">
  15. <view class="l-role">
  16. <u-image :showLoading="true" :src="item.src" width="110px" height="142px" radius="10px"></u-image>
  17. </view>
  18. </u-col>
  19. </u-row>
  20. </u-list-item>
  21. </u-list>
  22. <!-- <u-button type="error" shape="circle" text="下一步" @click="next()"></u-button> -->
  23. </view>
  24. </template>
  25. <script>
  26. export default {
  27. data() {
  28. return {
  29. roles: [{
  30. id: 1,
  31. name: "我是边民",
  32. src: require("@/static/images/role/bm.png")
  33. },
  34. {
  35. id: 2,
  36. name: "我是经销商",
  37. src: require("@/static/images/role/jxs.png")
  38. },
  39. {
  40. id: 3,
  41. name: "我是外籍商户",
  42. src: require("@/static/images/role/wjsh.png")
  43. },
  44. {
  45. id: 4,
  46. name: "我是司机",
  47. src: require("@/static/images/role/sj.png")
  48. },
  49. ],
  50. // customStyle: {
  51. // marginBottom: '10px',
  52. // backgroundColor: '#fff7f7',
  53. // height: '200px'
  54. // }
  55. current: 1,
  56. }
  57. },
  58. methods: {
  59. choose(data) {
  60. this.$common.to('/pages/login/register?type='+data.id);
  61. },
  62. next(){
  63. uni.navigateTo({
  64. url:"/pages/index/index"
  65. })
  66. }
  67. }
  68. }
  69. </script>
  70. <style lang="scss">
  71. page {
  72. padding: 0 30px;
  73. }
  74. .custom-style {
  75. margin-bottom: 10px;
  76. background-color: #fff7f7;
  77. height: 145px;
  78. border-radius: 10px;
  79. }
  80. .active-custom-style {
  81. margin-bottom: 10px;
  82. background-color: #fff7f7;
  83. height: 145px;
  84. border-radius: 10px;
  85. border: #f83d3d 1px solid;
  86. }
  87. .r-role {
  88. font-size: 34px;
  89. display: flex;
  90. align-items: center;
  91. justify-content: center;
  92. }
  93. .l-role {
  94. // margin-left: 10px;
  95. // position: absolute;
  96. // right: 10px;
  97. // bottom: 10px;
  98. }
  99. </style>