chooseRole.vue 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. <template>
  2. <view>
  3. <view class="item">
  4. <view class="title">我是货主</view>
  5. <image src="../../static/images/role/jxs.png" mode="widthFix"></image>
  6. </view>
  7. </view>
  8. </template>
  9. <script>
  10. export default {
  11. data() {
  12. return {
  13. roles: [],
  14. current: 1
  15. };
  16. },
  17. created() {
  18. this.getList();
  19. },
  20. methods: {
  21. choose(data) {
  22. for (let i = 0; i < this.roles.length; i++) {
  23. if (this.roles[i].roleName == data.roleName) {
  24. this.current = data.id;
  25. }
  26. }
  27. var that = this;
  28. setTimeout(function () {
  29. that.$common.to('/pages/login/register?type=' + that.current);
  30. }, 500);
  31. },
  32. getList() {
  33. this.$api.getIdentifyList().then(res => {
  34. console.log(res);
  35. this.roles = res.data;
  36. });
  37. },
  38. next() {
  39. // uni.navigateTo({
  40. // url:"/pages/login/register?type="+this.current
  41. // })
  42. this.$common.to('/pages/login/register?type=' + this.current);
  43. }
  44. }
  45. };
  46. </script>
  47. <style lang="scss">
  48. page {
  49. padding: 30px;
  50. }
  51. .custom-style {
  52. margin-bottom: 20px;
  53. width: 80%;
  54. height: 70px;
  55. font-size: 26px;
  56. font-family: serif;
  57. background-color: #87cefa;
  58. border: #87cefa;
  59. }
  60. .active-custom-style {
  61. margin-bottom: 20px;
  62. width: 80%;
  63. height: 70px;
  64. font-size: 28px;
  65. background-color: #00bfff;
  66. border: #00bfff;
  67. }
  68. .r-role {
  69. font-size: 34px;
  70. display: flex;
  71. align-items: center;
  72. justify-content: center;
  73. }
  74. .l-role {
  75. // margin-left: 10px;
  76. // position: absolute;
  77. // right: 10px;
  78. // bottom: 10px;
  79. }
  80. </style>