child_careList.vue 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192
  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. <u-checkbox-group @change="checkboxGroupChange">
  13. <view v-for="(item,index) in vaccineList" :key="index" @click="xuanzephone(item,index)" class="padding bg-white margin-top-sm flex justify-between align-center"
  14. style="border-radius: 16rpx;box-shadow: 0 0 50rpx 0 rgba(0, 0, 0, 0.1);">
  15. <view class="">
  16. <view class="text-bold" style="color: #333333;font-size: 30rpx;">
  17. {{item.name}}
  18. </view>
  19. <view class="flex align-center margin-top-xs">
  20. <view class="mianfei margin-right-xs" style="font-size:22rpx;color: #EEAA3F;">
  21. {{item.type==1?'免费':'¥'+item.price/100}}
  22. </view>
  23. </view>
  24. <view class="margin-top-xs" style="color: #999999; font-size: 26rpx;">
  25. 备注:<text style="color: #666666;">{{item.remark}}</text>
  26. </view>
  27. </view>
  28. <view class="">
  29. <u-checkbox v-model="item.checked" :key="index" :name="item.id"></u-checkbox>
  30. <!-- <u-radio-group v-model="danxuan">
  31. <u-radio @change="radioChange" :key="index" :name="item.id">
  32. </u-radio>
  33. </u-radio-group> -->
  34. </view>
  35. </view>
  36. </u-checkbox-group>
  37. </view>
  38. <u-empty text="暂无数据" mode="order" :show="show" margin-top="250"></u-empty>
  39. <view class="cu-tabbar-height"></view>
  40. <view class="cu-tabbar-height"></view>
  41. <view class="cu-bar bg-white tabbar" style="position: fixed;bottom: 0;width: 100%;">
  42. <view class="submit" style="background-color: #0B73B9;color: white;" @click="addchild">
  43. 选中
  44. </view>
  45. </view>
  46. </view>
  47. </template>
  48. <script>
  49. export default {
  50. onLoad(options) {
  51. this.org_id = options.id
  52. this.getvaccinesList()
  53. },
  54. onShow() {
  55. },
  56. data() {
  57. return {
  58. org_id: "",
  59. vaccineList: [],
  60. keyword: "",
  61. value: 0, //种类
  62. price: 0, //价格
  63. recommend: 0, //推荐
  64. options1: [{
  65. value: 0,
  66. label: "全部种类"
  67. }, {
  68. value: 1,
  69. label: "I类"
  70. }, {
  71. value: 2,
  72. label: "II类"
  73. }, ],
  74. options2: [{
  75. value: 0,
  76. label: "推荐排序"
  77. }, {
  78. value: 1,
  79. label: "低价优先"
  80. }, {
  81. value: 2,
  82. label: "高价优先"
  83. }, ],
  84. options3: [{
  85. value: 0,
  86. label: "全部价格"
  87. }, {
  88. value: 1,
  89. label: "免费"
  90. }, {
  91. value: 2,
  92. label: "收费"
  93. }, ],
  94. danxuan: "",
  95. show: false,
  96. pageindex: 1
  97. }
  98. },
  99. methods: {
  100. //种类下拉
  101. classtype(value) {
  102. this.value = value
  103. this.vaccineList = []
  104. this.getvaccinesList()
  105. },
  106. //价格下拉
  107. pricetype(value) {
  108. this.price = value
  109. this.vaccineList = []
  110. this.getvaccinesList()
  111. },
  112. //推荐下拉
  113. recomtype(value) {
  114. this.recommend = value
  115. this.vaccineList = []
  116. this.getvaccinesList()
  117. },
  118. getvaccinesList: async function() {
  119. let res = await this.$request.post("/api/v1/nurse/nurseList", {
  120. page: this.pageindex,
  121. name: this.keyword,
  122. type: this.value,
  123. sort_type: this.recommend,
  124. organization_id: this.org_id
  125. })
  126. if (res.status == 0) {
  127. this.vaccineList = res.data.data
  128. this.vaccineList.forEach(item => {
  129. item.checked = false
  130. })
  131. console.log(this.vaccineList)
  132. }
  133. if (this.vaccineList.length == 0) {
  134. this.show = true
  135. } else {
  136. this.show = false
  137. }
  138. },
  139. checkboxGroupChange(e) {},
  140. xuanzephone(item, index) {
  141. item.checked = !item.checked
  142. this.$forceUpdate();
  143. },
  144. addchild() {
  145. let arr = this.vaccineList.filter(item => {
  146. if (item.checked) {
  147. return item
  148. }
  149. })
  150. let pages = getCurrentPages(); //获取所有页面栈实例列表
  151. let nowPage = pages[pages.length - 1]; //当前页页面实例
  152. let prevPage = pages[pages.length - 2]; //上一页页面实例
  153. prevPage.$vm.childcare = arr
  154. uni.navigateBack({ //uni.navigateTo跳转的返回,默认1为返回上一级
  155. delta: 1
  156. });
  157. }
  158. }
  159. }
  160. </script>
  161. <style lang="scss">
  162. page {
  163. background-color: #fff;
  164. }
  165. .main {}
  166. .mianfei {
  167. width: 80rpx;
  168. height: 30rpx;
  169. background: #FFF0D9;
  170. // border-radius: 16rpx;
  171. display: flex;
  172. justify-content: center;
  173. align-items: center;
  174. }
  175. .typestyle {
  176. width: 44rpx;
  177. height: 30rpx;
  178. background: #E5F5FF;
  179. // border-radius: 16rpx;
  180. display: flex;
  181. justify-content: center;
  182. align-items: center;
  183. }
  184. </style>