vaccinesList.vue 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. <template>
  2. <view class="bg-white">
  3. <u-dropdown>
  4. <u-dropdown-item @change="classtype" v-model="value" :title="options1[value].label" :options="options1"></u-dropdown-item>
  5. <u-dropdown-item @change="pricetype" v-model="price" :title="options3[price].label" :options="options3"></u-dropdown-item>
  6. <u-dropdown-item @change="recomtype" v-model="recommend" :title="options2[recommend].label" :options="options2"></u-dropdown-item>
  7. </u-dropdown>
  8. <view class="padding-lr-sm">
  9. <u-search :clearabled="false" shape="round" :show-action="false" placeholder="搜索疫苗名称" v-model="keyword"></u-search>
  10. </view>
  11. <view class="margin-sm">
  12. <view v-for="(item,index) in vaccineList" :key="index" @click="xuanzephone(item)" class="padding bg-white margin-top-sm flex justify-between align-center"
  13. style="border-radius: 16rpx;box-shadow: 0 0 50rpx 0 rgba(0, 0, 0, 0.1);">
  14. <view class="">
  15. <view class="text-bold" style="color: #333333;font-size: 30rpx;">
  16. {{item.name}}
  17. </view>
  18. <view class="flex align-center margin-top-xs">
  19. <view class="mianfei margin-right-xs" style="font-size:22rpx;color: #EEAA3F;">
  20. {{item.type==1?'免费':'¥'+item.price/100}}
  21. </view>
  22. <view class="typestyle" style="font-size:22rpx;color: #0B73B9;">
  23. {{item.type==1?'I类':'II类'}}
  24. </view>
  25. </view>
  26. <view class="margin-top-xs" style="color: #999999; font-size: 26rpx;">
  27. 备注:<text style="color: #666666;">{{item.remark}}</text>
  28. </view>
  29. <view class="margin-top-xs" style="color: #999999; font-size: 26rpx;">
  30. 厂家:<text style="color: #666666;">{{item.supplier}}</text>
  31. </view>
  32. </view>
  33. <view class="">
  34. <u-radio-group v-model="danxuan">
  35. <u-radio @change="radioChange" :key="index" :name="item.id">
  36. </u-radio>
  37. </u-radio-group>
  38. </view>
  39. </view>
  40. </view>
  41. <view class="cu-tabbar-height"></view>
  42. <view class="cu-tabbar-height"></view>
  43. </view>
  44. </template>
  45. <script>
  46. export default {
  47. onLoad() {
  48. this.getvaccinesList()
  49. },
  50. onShow() {
  51. },
  52. data() {
  53. return {
  54. vaccineList: [],
  55. keyword: "",
  56. value: 0, //种类
  57. price: 0, //价格
  58. recommend: 0, //推荐
  59. options1: [{
  60. value: 0,
  61. label: "全部种类"
  62. }, {
  63. value: 1,
  64. label: "I类"
  65. }, {
  66. value: 2,
  67. label: "II类"
  68. }, ],
  69. options2: [{
  70. value: 0,
  71. label: "推荐排序"
  72. }, {
  73. value: 1,
  74. label: "低价优先"
  75. }, {
  76. value: 2,
  77. label: "高价优先"
  78. }, ],
  79. options3: [{
  80. value: 0,
  81. label: "全部价格"
  82. }, {
  83. value: 1,
  84. label: "免费"
  85. }, {
  86. value: 2,
  87. label: "收费"
  88. }, ],
  89. danxuan: ""
  90. }
  91. },
  92. methods: {
  93. //种类下拉
  94. classtype(value) {
  95. this.value = value
  96. this.vaccineList = []
  97. this.getvaccinesList()
  98. },
  99. //价格下拉
  100. pricetype(value) {
  101. this.price = value
  102. this.vaccineList = []
  103. this.getvaccinesList()
  104. },
  105. //推荐下拉
  106. recomtype(value) {
  107. this.recommend = value
  108. this.vaccineList = []
  109. this.getvaccinesList()
  110. },
  111. getvaccinesList: async function() {
  112. let res = await this.$request.post("/api/v1/vaccine/vaccineList", {
  113. name: this.keyword,
  114. type: this.value,
  115. sort_type: this.recommend
  116. })
  117. if (res.status == 0) {
  118. this.vaccineList = res.data.data
  119. }
  120. },
  121. xuanzephone(item) {
  122. this.danxuan = item.id
  123. }
  124. }
  125. }
  126. </script>
  127. <style lang="scss">
  128. page{
  129. background-color: #fff;
  130. }
  131. .main {}
  132. .mianfei {
  133. width: 60rpx;
  134. height: 30rpx;
  135. background: #FFF0D9;
  136. // border-radius: 16rpx;
  137. display: flex;
  138. justify-content: center;
  139. align-items: center;
  140. }
  141. .typestyle {
  142. width: 44rpx;
  143. height: 30rpx;
  144. background: #E5F5FF;
  145. // border-radius: 16rpx;
  146. display: flex;
  147. justify-content: center;
  148. align-items: center;
  149. }
  150. </style>