child_careList.vue 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203
  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. onReachBottom() {
  100. this.getvaccinesList()
  101. },
  102. methods: {
  103. //种类下拉
  104. classtype(value) {
  105. this.value = value
  106. this.vaccineList = []
  107. this.getvaccinesList()
  108. },
  109. //价格下拉
  110. pricetype(value) {
  111. this.price = value
  112. this.vaccineList = []
  113. this.getvaccinesList()
  114. },
  115. //推荐下拉
  116. recomtype(value) {
  117. this.recommend = value
  118. this.vaccineList = []
  119. this.getvaccinesList()
  120. },
  121. getvaccinesList: async function() {
  122. let res = await this.$request.post("/api/v1/nurse/nurseList", {
  123. page: this.pageindex,
  124. name: this.keyword,
  125. type: this.value,
  126. sort_type: this.recommend,
  127. organization_id: this.org_id
  128. })
  129. if (res.status == 0) {
  130. if (this.pageindex > res.data.last_page) {
  131. uni.showToast({
  132. title: "没有更多了",
  133. icon: "none"
  134. })
  135. } else {
  136. this.vaccineList = this.vaccineList.concat(res.data.data)
  137. this.vaccineList.forEach(item => {
  138. item.checked = false
  139. })
  140. this.pageindex++
  141. }
  142. console.log(this.vaccineList)
  143. }
  144. if (this.vaccineList.length == 0) {
  145. this.show = true
  146. } else {
  147. this.show = false
  148. }
  149. },
  150. checkboxGroupChange(e) {},
  151. xuanzephone(item, index) {
  152. item.checked = !item.checked
  153. this.$forceUpdate();
  154. },
  155. addchild() {
  156. let arr = this.vaccineList.filter(item => {
  157. if (item.checked) {
  158. return item
  159. }
  160. })
  161. let pages = getCurrentPages(); //获取所有页面栈实例列表
  162. let nowPage = pages[pages.length - 1]; //当前页页面实例
  163. let prevPage = pages[pages.length - 2]; //上一页页面实例
  164. prevPage.$vm.childcare = arr
  165. uni.navigateBack({ //uni.navigateTo跳转的返回,默认1为返回上一级
  166. delta: 1
  167. });
  168. }
  169. }
  170. }
  171. </script>
  172. <style lang="scss">
  173. page {
  174. background-color: #fff;
  175. }
  176. .main {}
  177. .mianfei {
  178. width: 80rpx;
  179. height: 30rpx;
  180. background: #FFF0D9;
  181. // border-radius: 16rpx;
  182. display: flex;
  183. justify-content: center;
  184. align-items: center;
  185. }
  186. .typestyle {
  187. width: 44rpx;
  188. height: 30rpx;
  189. background: #E5F5FF;
  190. // border-radius: 16rpx;
  191. display: flex;
  192. justify-content: center;
  193. align-items: center;
  194. }
  195. </style>