select.vue 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  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.merchantName}}</text>
  7. <text>{{item.typeName}}</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. merchantId:'',
  19. types:[],
  20. list:[]
  21. }
  22. },
  23. created() {
  24. this.getType();
  25. },
  26. onLoad(option) {
  27. if(option.userInfo) this.userInfo = JSON.parse(decodeURIComponent(option.userInfo));
  28. this.getList();
  29. },
  30. methods: {
  31. goBack(e){
  32. uni.clearStorageSync();
  33. },
  34. getType(){
  35. this.$api.post('/api/dict/getListByTypes',['BusinessType']).then(res=>{
  36. if(res.data.code===0){
  37. this.types = res.data.data
  38. }else this.$showToast(res.data.msg);
  39. })
  40. },
  41. getList(){
  42. this.$api.post('/merchant/register/getMerchantStoreList').then(res=>{
  43. if(res.data.code===0){
  44. this.list = res.data.data;
  45. this.list.forEach(l=>{
  46. let t = this.types.find(t=>t.dictValue==l.merchantType);
  47. l.typeName = t?t.dictLabel:''
  48. })
  49. }else this.$showToast(res.data.msg);
  50. })
  51. },
  52. toHome(item){//1711268640588517378 1721450548101648385
  53. if(item.merchantType==2) uni.setStorageSync('homestayId',item.merchantId);
  54. else uni.setStorageSync('merchantId',item.merchantId);
  55. uni.setStorageSync('userInfo',this.userInfo);
  56. uni.reLaunch({
  57. url:'/pages/home/index'
  58. })
  59. }
  60. }
  61. }
  62. </script>
  63. <style scoped lang="less">
  64. .page{
  65. background: #F3F4F4;
  66. padding-bottom: 20rpx;
  67. box-sizing: border-box;
  68. overflow-y: auto;
  69. .card{
  70. width: calc(100% - 60rpx);
  71. height: 180rpx;
  72. background: #FFFFFF;
  73. border-radius: 10rpx 10rpx 10rpx 10rpx;
  74. margin: 20rpx 30rpx 0;
  75. padding: 0 30rpx 0 60rpx;
  76. box-sizing: border-box;
  77. background: url(https://i.ringzle.com/file/20240109/1ee084be17f74dde94617dcb7f7c8af3.png) no-repeat;
  78. background-size: 100% 100%;
  79. display: flex;
  80. align-items: center;
  81. justify-content: space-between;
  82. &>view{
  83. &:first-child{
  84. display: flex;
  85. flex-direction: column;
  86. text{
  87. font-size: 32rpx;
  88. font-family: PingFang SC, PingFang SC;
  89. font-weight: 800;
  90. color: #1E3A62;
  91. &:last-child{
  92. font-size: 24rpx;
  93. font-family: PingFang SC, PingFang SC;
  94. font-weight: 400;
  95. color: #1E3A62;
  96. margin-top: 10rpx;
  97. }
  98. }
  99. }
  100. &:last-child{
  101. width: 140rpx;
  102. height: 56rpx;
  103. border-radius: 36rpx 36rpx 36rpx 36rpx;
  104. border: 1rpx solid #70849F;
  105. background: transparent;
  106. line-height: 56rpx;
  107. text-align: center;
  108. font-size: 28rpx;
  109. font-family: PingFang SC, PingFang SC;
  110. font-weight: 800;
  111. color: #1E3A62;
  112. }
  113. }
  114. }
  115. }
  116. </style>