123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213 |
- <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">
- <view v-for="(item,index) in vaccineList" :key="index" @click="xuanzephone(item)"
- 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 class="typestyle margin-right-xs" style="font-size:22rpx;color: #0B73B9;">
- {{item.type==1?'I类':'II类'}}
- </view>
- <view class="typestyle padding-lr-xs"
- style="font-size:22rpx;color: #fa3534;background-color: #fab6b6;" v-if="item.stock<=0">
- 缺苗
- </view>
- <view class="typestyle padding-lr-xs"
- style="font-size:22rpx;color: #fff;background-color: #ff9900;width: 108rpx;border-radius: 8px;"
- v-if="item.is_recommend==1">
- 强烈推荐
- </view>
- </view>
- <view class="margin-top-xs" style="color: #999999; font-size: 26rpx;">
- 备注:<text style="color: #666666;">{{item.remark||''}}</text>
- </view>
- <view class="margin-top-xs" style="color: #999999; font-size: 26rpx;">
- 厂家:<text style="color: #666666;">{{item.supplier||'暂无厂家'}}</text>
- </view>
- </view>
- <view class="">
- <u-radio-group v-model="danxuan">
- <u-radio @change="radioChange" :key="index" :name="item.id">
- </u-radio>
- </u-radio-group>
- </view>
- </view>
- </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>
- </template>
- <script>
- export default {
- onLoad(options) {
- this.org_id = options.id
- this.patient_id = options.patient_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,
- patient_id: ""
- }
- },
- onReachBottom() {
- this.getvaccinesList()
- },
- methods: {
- //种类下拉
- classtype(value) {
- this.value = value
- this.pageindex = 1
- this.vaccineList = []
- this.getvaccinesList()
- },
- //价格下拉
- pricetype(value) {
- this.price = value
- this.pageindex = 1
- this.vaccineList = []
- this.getvaccinesList()
- },
- //推荐下拉
- recomtype(value) {
- this.recommend = value
- this.pageindex = 1
- this.vaccineList = []
- this.getvaccinesList()
- },
- getvaccinesList: async function() {
- let res = await this.$request.post("/api/v1/vaccine/vaccineList", {
- page: this.pageindex,
- name: this.keyword,
- type: this.value,
- sort_type: this.recommend,
- organization_id: this.org_id,
- patient_id: this.patient_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.pageindex++
- }
- }
- if (this.vaccineList.length == 0) {
- this.show = true
- } else {
- this.show = false
- }
- },
- xuanzephone(item) {
- if (item.stock <= 0) {
- uni.showToast({
- title: "该疫苗库存不足",
- icon: "none"
- })
- return false
- }
- this.danxuan = item.id
- let pages = getCurrentPages(); //获取所有页面栈实例列表
- let nowPage = pages[pages.length - 1]; //当前页页面实例
- let prevPage = pages[pages.length - 2]; //上一页页面实例
- prevPage.$vm.yimiaoInfo = item
- uni.navigateBack({ //uni.navigateTo跳转的返回,默认1为返回上一级
- delta: 1
- });
- }
- }
- }
- </script>
- <style lang="scss">
- page {
- background-color: #fff;
- }
- .main {}
- .mianfei {
- width: 60rpx;
- height: 30rpx;
- background: #FFF0D9;
- // border-radius: 16rpx;
- display: flex;
- justify-content: center;
- align-items: center;
- }
- .typestyle {
- width: 64rpx;
- height: 30rpx;
- background: #E5F5FF;
- // border-radius: 16rpx;
- display: flex;
- justify-content: center;
- align-items: center;
- }
- </style>
|