changeCounter.vue 2.54 KB
Newer Older
1 2
<template>
  <div class="container">
xd's avatar
xd committed
3
    <van-radio-group v-model="radio" class="nobr">
xd's avatar
xd committed
4
      <van-cell-group @change="handleStoreChange" >
xd's avatar
xd committed
5
        <van-cell   v-for="(item,index) in list" :key="index"   >
xd's avatar
xd committed
6 7
          <div class="list">
            <div class="left">
xd's avatar
xd committed
8
              <img :src="item.logo" alt="" />
xd's avatar
xd committed
9 10
            </div>
            <div class="right">
xd's avatar
xd committed
11 12
              <h3>{{ item.name }}</h3>
              <p>{{ item.summaryTitle }}</p>
xd's avatar
xd committed
13 14
            </div>
          </div>
xd's avatar
xd committed
15
          <van-radio slot="right-icon" :name="item.oyStallCode" />
xd's avatar
xd committed
16 17 18
        </van-cell>
      </van-cell-group>
    </van-radio-group>
19 20 21 22
  </div>
</template>

<script>
xd's avatar
xd committed
23
import { getStoreList } from "@/api/sidebar/voucher"
xd's avatar
xd committed
24
import { log } from 'util';
xd's avatar
xd committed
25 26 27
export default {
  data() {
    return {
xd's avatar
xd committed
28
      radio: '',
xd's avatar
xd committed
29 30 31 32
      userId: '',
      list: []
    }
  },
xd's avatar
xd committed
33 34
  created() {    
    this.radio = sessionStorage.getItem('oyStallCode')
xd's avatar
xd committed
35
    this.getList()  
xd's avatar
xd committed
36 37 38 39
  },
  methods: {
    getList() {
      let params = {
xd's avatar
xd committed
40
        user_id: this.$route.query.userId
xd's avatar
xd committed
41 42 43 44 45 46 47 48 49 50
      }
      getStoreList(params).then(res => {
        console.log(res.data);        
        this.list = res.data
        
      })
    },
    handleStoreChange(val) {
      sessionStorage.setItem('oyStallCode',val)
    }
xd's avatar
xd committed
51 52
  }
};
53 54 55 56
</script>

<style scoped>
.container {
xd's avatar
xd committed
57 58 59 60 61 62
  height: auto;
  background-color: #fff;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
63 64 65 66 67 68 69 70 71 72 73 74 75 76
}
.title {
  height: 44px;
  background: rgba(248, 248, 248, 1);
  line-height: 44px;
  padding: 0 16px;
  font-size: 12px;
  color: rgba(45, 71, 106, 1);
}
.fg {
  padding: 0 16px;
  font-size: 12px;
  color: rgba(45, 71, 106, 1);
  height: 44px;
xd's avatar
xd committed
77
  line-height: 44px;
78 79 80 81 82 83 84
}
.icon {
  font-weight: 800;
}
.active {
  background-color: #fff;
  padding: 12px 12px 0 12px;
xd's avatar
xd committed
85
  box-shadow: 0px 2px 4px 0px rgba(221, 221, 221, 1);
86 87 88 89 90 91 92
}
.list {
  height: 94px;
  width: 100%;
  background-color: #fff;
  display: flex;
  justify-content: space-between;
xd's avatar
xd committed
93
  border-bottom: 1px solid rgba(238, 238, 238, 1);
94 95 96 97 98 99
  margin-bottom: 14px;
}
.list3 {
  border-bottom: none;
  margin-bottom: 0;
}
xd's avatar
xd committed
100 101
.left,
.right {
102 103 104
  height: 80px;
}
.left {
xd's avatar
xd committed
105 106
  width: 80px;
  background: rgba(248, 248, 248, 1);
107 108
}
.left img {
xd's avatar
xd committed
109
  width: 100%;
xd's avatar
xd committed
110
  height: 80px;
111 112 113 114 115 116 117 118
}
.right {
  width: 76%;
  padding: 10px;
  background-color: #fff;
}
h3 {
  font-size: 14px;
xd's avatar
xd committed
119 120
  font-weight: bold;
  color: rgba(45, 71, 106, 1);
121 122 123
}
p {
  margin-top: 10px;
xd's avatar
xd committed
124 125
  font-size: 12px;
  color: rgba(45, 71, 106, 0.8);
126
}
xd's avatar
xd committed
127 128 129 130 131 132
.nobr >>> [class*=van-hairline]::after {
  display: none;
}
.nobr >>> .van-cell:not(:last-child)::after {
  display: none;
}
133
</style>