select.vue 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. <template>
  2. <view class="page" :style="{'height':h+'px','padding-top':mt+'px'}">
  3. <c-nav-bar title="选择门店" backUrl="/pages/login/index" @goBack="goBack" :showHome="false"></c-nav-bar>
  4. <view class="card" v-for="(item,index) in list" :key="index" @tap="toHome(item)">
  5. <view>
  6. <text>{{item.name}}</text>
  7. <text>{{item.type}}</text>
  8. </view>
  9. <view>进店</view>
  10. </view>
  11. </view>
  12. </template>
  13. <script>
  14. export default {
  15. data() {
  16. return {
  17. userInfo:null,
  18. list:[]
  19. }
  20. },
  21. onLoad(option) {
  22. if(option.userInfo) this.userInfo = JSON.parse(decodeURIComponent(option.userInfo));
  23. this.getList();
  24. },
  25. methods: {
  26. goBack(e){
  27. uni.clearStorageSync();
  28. },
  29. getList(){
  30. this.list = [
  31. { name:'一家民宿', type:'酒店民宿' },
  32. { name:'石柱村渔家乐', type:'渔家乐' },
  33. { name:'周游嵊泗', type:'旅行社' }
  34. ]
  35. },
  36. toHome(item){
  37. uni.setStorageSync('userInfo',this.userInfo);
  38. uni.reLaunch({
  39. url:'/pages/home/index'
  40. })
  41. }
  42. }
  43. }
  44. </script>
  45. <style scoped lang="less">
  46. .page{
  47. background: #F3F4F4;
  48. padding-bottom: 20rpx;
  49. box-sizing: border-box;
  50. overflow-y: auto;
  51. .card{
  52. width: calc(100% - 60rpx);
  53. height: 180rpx;
  54. background: #FFFFFF;
  55. border-radius: 10rpx 10rpx 10rpx 10rpx;
  56. margin: 20rpx 30rpx 0;
  57. padding: 0 30rpx 0 60rpx;
  58. box-sizing: border-box;
  59. background: url(https://i.ringzle.com/file/20240109/1ee084be17f74dde94617dcb7f7c8af3.png) no-repeat;
  60. background-size: 100% 100%;
  61. display: flex;
  62. align-items: center;
  63. justify-content: space-between;
  64. &>view{
  65. &:first-child{
  66. display: flex;
  67. flex-direction: column;
  68. text{
  69. font-size: 32rpx;
  70. font-family: PingFang SC, PingFang SC;
  71. font-weight: 800;
  72. color: #1E3A62;
  73. &:last-child{
  74. font-size: 24rpx;
  75. font-family: PingFang SC, PingFang SC;
  76. font-weight: 400;
  77. color: #1E3A62;
  78. margin-top: 10rpx;
  79. }
  80. }
  81. }
  82. &:last-child{
  83. width: 140rpx;
  84. height: 56rpx;
  85. border-radius: 36rpx 36rpx 36rpx 36rpx;
  86. border: 1rpx solid #70849F;
  87. background: transparent;
  88. line-height: 56rpx;
  89. text-align: center;
  90. font-size: 28rpx;
  91. font-family: PingFang SC, PingFang SC;
  92. font-weight: 800;
  93. color: #1E3A62;
  94. }
  95. }
  96. }
  97. }
  98. </style>