vaccinesList.vue 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186
  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. <u-empty text="暂无数据" mode="order" :show="show" margin-top="250"></u-empty>
  42. <view class="cu-tabbar-height"></view>
  43. <view class="cu-tabbar-height"></view>
  44. </view>
  45. </template>
  46. <script>
  47. export default {
  48. onLoad(options) {
  49. this.org_id = options.id
  50. this.getvaccinesList()
  51. },
  52. onShow() {
  53. },
  54. data() {
  55. return {
  56. org_id: "",
  57. vaccineList: [],
  58. keyword: "",
  59. value: 0, //种类
  60. price: 0, //价格
  61. recommend: 0, //推荐
  62. options1: [{
  63. value: 0,
  64. label: "全部种类"
  65. }, {
  66. value: 1,
  67. label: "I类"
  68. }, {
  69. value: 2,
  70. label: "II类"
  71. }, ],
  72. options2: [{
  73. value: 0,
  74. label: "推荐排序"
  75. }, {
  76. value: 1,
  77. label: "低价优先"
  78. }, {
  79. value: 2,
  80. label: "高价优先"
  81. }, ],
  82. options3: [{
  83. value: 0,
  84. label: "全部价格"
  85. }, {
  86. value: 1,
  87. label: "免费"
  88. }, {
  89. value: 2,
  90. label: "收费"
  91. }, ],
  92. danxuan: "",
  93. show: false,
  94. pageindex: 1
  95. }
  96. },
  97. methods: {
  98. //种类下拉
  99. classtype(value) {
  100. this.value = value
  101. this.pageindex = 1
  102. this.vaccineList = []
  103. this.getvaccinesList()
  104. },
  105. //价格下拉
  106. pricetype(value) {
  107. this.price = value
  108. this.pageindex = 1
  109. this.vaccineList = []
  110. this.getvaccinesList()
  111. },
  112. //推荐下拉
  113. recomtype(value) {
  114. this.recommend = value
  115. this.pageindex = 1
  116. this.vaccineList = []
  117. this.getvaccinesList()
  118. },
  119. getvaccinesList: async function() {
  120. let res = await this.$request.post("/api/v1/vaccine/vaccineList", {
  121. page: this.pageindex,
  122. name: this.keyword,
  123. type: this.value,
  124. sort_type: this.recommend,
  125. organization_id: this.org_id
  126. })
  127. if (res.status == 0) {
  128. if (this.pageindex > res.data.last_page) {
  129. uni.showToast({
  130. title: "没有更多了",
  131. icon: "none"
  132. })
  133. } else {
  134. this.vaccineList = this.vaccineList.concat(res.data.data)
  135. this.pageindex++
  136. }
  137. }
  138. if (this.vaccineList.length == 0) {
  139. this.show = true
  140. } else {
  141. this.show = false
  142. }
  143. },
  144. xuanzephone(item) {
  145. this.danxuan = item.id
  146. let pages = getCurrentPages(); //获取所有页面栈实例列表
  147. let nowPage = pages[pages.length - 1]; //当前页页面实例
  148. let prevPage = pages[pages.length - 2]; //上一页页面实例
  149. prevPage.$vm.yimiaoInfo = item
  150. uni.navigateBack({ //uni.navigateTo跳转的返回,默认1为返回上一级
  151. delta: 1
  152. });
  153. }
  154. }
  155. }
  156. </script>
  157. <style lang="scss">
  158. page {
  159. background-color: #fff;
  160. }
  161. .main {}
  162. .mianfei {
  163. width: 60rpx;
  164. height: 30rpx;
  165. background: #FFF0D9;
  166. // border-radius: 16rpx;
  167. display: flex;
  168. justify-content: center;
  169. align-items: center;
  170. }
  171. .typestyle {
  172. width: 44rpx;
  173. height: 30rpx;
  174. background: #E5F5FF;
  175. // border-radius: 16rpx;
  176. display: flex;
  177. justify-content: center;
  178. align-items: center;
  179. }
  180. </style>