123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203 |
- <template>
- <view class="bg-white">
- <u-dropdown>
- <u-dropdown-item @change="classtype" v-model="value" :title="options1[value].label" :options="options1"></u-dropdown-item>
- <u-dropdown-item @change="pricetype" v-model="price" :title="options3[price].label" :options="options3"></u-dropdown-item>
- <u-dropdown-item @change="recomtype" v-model="recommend" :title="options2[recommend].label" :options="options2"></u-dropdown-item>
- </u-dropdown>
- <view class="padding-lr-sm">
- <u-search :clearabled="false" shape="round" :show-action="false" placeholder="搜索儿保项目名称" v-model="keyword"></u-search>
- </view>
- <view class="margin-sm">
- <u-checkbox-group @change="checkboxGroupChange">
- <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"
- style="border-radius: 16rpx;box-shadow: 0 0 50rpx 0 rgba(0, 0, 0, 0.1);">
- <view class="">
- <view class="text-bold" style="color: #333333;font-size: 30rpx;">
- {{item.name}}
- </view>
- <view class="flex align-center margin-top-xs">
- <view class="mianfei margin-right-xs" style="font-size:22rpx;color: #EEAA3F;">
- {{item.type==1?'免费':'¥'+item.price/100}}
- </view>
- </view>
- <view class="margin-top-xs" style="color: #999999; font-size: 26rpx;">
- 备注:<text style="color: #666666;">{{item.remark}}</text>
- </view>
- </view>
- <view class="">
- <u-checkbox v-model="item.checked" :key="index" :name="item.id"></u-checkbox>
- <!-- <u-radio-group v-model="danxuan">
- <u-radio @change="radioChange" :key="index" :name="item.id">
- </u-radio>
- </u-radio-group> -->
- </view>
- </view>
- </u-checkbox-group>
- </view>
- <u-empty text="暂无数据" mode="order" :show="show" margin-top="250"></u-empty>
- <view class="cu-tabbar-height"></view>
- <view class="cu-tabbar-height"></view>
- <view class="cu-bar bg-white tabbar" style="position: fixed;bottom: 0;width: 100%;">
- <view class="submit" style="background-color: #0B73B9;color: white;" @click="addchild">
- 选中
- </view>
- </view>
- </view>
- </template>
- <script>
- export default {
- onLoad(options) {
- this.org_id = options.id
- this.getvaccinesList()
- },
- onShow() {
- },
- data() {
- return {
- org_id: "",
- vaccineList: [],
- keyword: "",
- value: 0, //种类
- price: 0, //价格
- recommend: 0, //推荐
- options1: [{
- value: 0,
- label: "全部种类"
- }, {
- value: 1,
- label: "I类"
- }, {
- value: 2,
- label: "II类"
- }, ],
- options2: [{
- value: 0,
- label: "推荐排序"
- }, {
- value: 1,
- label: "低价优先"
- }, {
- value: 2,
- label: "高价优先"
- }, ],
- options3: [{
- value: 0,
- label: "全部价格"
- }, {
- value: 1,
- label: "免费"
- }, {
- value: 2,
- label: "收费"
- }, ],
- danxuan: "",
- show: false,
- pageindex: 1
- }
- },
- onReachBottom() {
- this.getvaccinesList()
- },
- methods: {
- //种类下拉
- classtype(value) {
- this.value = value
- this.vaccineList = []
- this.getvaccinesList()
- },
- //价格下拉
- pricetype(value) {
- this.price = value
- this.vaccineList = []
- this.getvaccinesList()
- },
- //推荐下拉
- recomtype(value) {
- this.recommend = value
- this.vaccineList = []
- this.getvaccinesList()
- },
- getvaccinesList: async function() {
- let res = await this.$request.post("/api/v1/nurse/nurseList", {
- page: this.pageindex,
- name: this.keyword,
- type: this.value,
- sort_type: this.recommend,
- organization_id: this.org_id
- })
- if (res.status == 0) {
- if (this.pageindex > res.data.last_page) {
- uni.showToast({
- title: "没有更多了",
- icon: "none"
- })
- } else {
- this.vaccineList = this.vaccineList.concat(res.data.data)
- this.vaccineList.forEach(item => {
- item.checked = false
- })
- this.pageindex++
- }
- console.log(this.vaccineList)
- }
- if (this.vaccineList.length == 0) {
- this.show = true
- } else {
- this.show = false
- }
- },
- checkboxGroupChange(e) {},
- xuanzephone(item, index) {
- item.checked = !item.checked
- this.$forceUpdate();
- },
- addchild() {
- let arr = this.vaccineList.filter(item => {
- if (item.checked) {
- return item
- }
- })
- let pages = getCurrentPages(); //获取所有页面栈实例列表
- let nowPage = pages[pages.length - 1]; //当前页页面实例
- let prevPage = pages[pages.length - 2]; //上一页页面实例
- prevPage.$vm.childcare = arr
- uni.navigateBack({ //uni.navigateTo跳转的返回,默认1为返回上一级
- delta: 1
- });
- }
- }
- }
- </script>
- <style lang="scss">
- page {
- background-color: #fff;
- }
- .main {}
- .mianfei {
- width: 80rpx;
- height: 30rpx;
- background: #FFF0D9;
- // border-radius: 16rpx;
- display: flex;
- justify-content: center;
- align-items: center;
- }
- .typestyle {
- width: 44rpx;
- height: 30rpx;
- background: #E5F5FF;
- // border-radius: 16rpx;
- display: flex;
- justify-content: center;
- align-items: center;
- }
- </style>
|