select.vue 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  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. console.log(item)
  38. this.$store.state.moduleHouse.homestayId=item.merchantId||'1711268640588517378';
  39. uni.setStorageSync('userInfo',this.userInfo);
  40. uni.reLaunch({
  41. url:'/pages/home/index'
  42. })
  43. }
  44. }
  45. }
  46. </script>
  47. <style scoped lang="less">
  48. .page{
  49. background: #F3F4F4;
  50. padding-bottom: 20rpx;
  51. box-sizing: border-box;
  52. overflow-y: auto;
  53. .card{
  54. width: calc(100% - 60rpx);
  55. height: 180rpx;
  56. background: #FFFFFF;
  57. border-radius: 10rpx 10rpx 10rpx 10rpx;
  58. margin: 20rpx 30rpx 0;
  59. padding: 0 30rpx 0 60rpx;
  60. box-sizing: border-box;
  61. background: url(https://i.ringzle.com/file/20240109/1ee084be17f74dde94617dcb7f7c8af3.png) no-repeat;
  62. background-size: 100% 100%;
  63. display: flex;
  64. align-items: center;
  65. justify-content: space-between;
  66. &>view{
  67. &:first-child{
  68. display: flex;
  69. flex-direction: column;
  70. text{
  71. font-size: 32rpx;
  72. font-family: PingFang SC, PingFang SC;
  73. font-weight: 800;
  74. color: #1E3A62;
  75. &:last-child{
  76. font-size: 24rpx;
  77. font-family: PingFang SC, PingFang SC;
  78. font-weight: 400;
  79. color: #1E3A62;
  80. margin-top: 10rpx;
  81. }
  82. }
  83. }
  84. &:last-child{
  85. width: 140rpx;
  86. height: 56rpx;
  87. border-radius: 36rpx 36rpx 36rpx 36rpx;
  88. border: 1rpx solid #70849F;
  89. background: transparent;
  90. line-height: 56rpx;
  91. text-align: center;
  92. font-size: 28rpx;
  93. font-family: PingFang SC, PingFang SC;
  94. font-weight: 800;
  95. color: #1E3A62;
  96. }
  97. }
  98. }
  99. }
  100. </style>