123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238 |
- <template style="background-color: #b8b8b8;">
- <view style="width: 100%;height: 100%;">
- <view class="topmenu">
- <u-dropdown>
- <u-dropdown-item v-model="value1" :title="options1[value1].label" :options="options1" @change="close1"></u-dropdown-item>
- <u-dropdown-item v-model="value2" :title="options2[value2].label" :options="options2" @change="close2"></u-dropdown-item>
- </u-dropdown>
- </view>
- <view style="padding:28rpx 20rpx;width: 100%;flex-direction: row-reverse;" class="flex">
- <view @click="huihua">
- <text style="font-size: 28rpx;color: #666666;margin-right: 15rpx;">查看会话</text>
- <u-icon name="arrow-right" color="#666666"></u-icon>
- </view>
- </view>
- <!-- 上面的下拉菜单中 -->
- <!-- value1种类 0为全部 1为电话 2为图文-->
- <!-- value2状态 0为处理中 1为历史记录-->
- <view v-for="(item,index) in list" :key='index' :data-index="index" @click="xiangqing">
- <view >
- <view class="list_view">
- <!-- 状态和类型 -->
- <!-- 状态 1未接单 2进行中 3已完成 4已取消 -->
- <!-- 种类 1电话咨询 2图文咨询-->
- <view class="flex align-center" style="margin-bottom: 30rpx;">
- <view style="width: 70%;" v-if="item.zt == 1" class="flex align-center">
- <view style="width: 12rpx;height: 12rpx;border-radius: 50rpx;background-color: #ff9294;margin-right: 20rpx;"></view>
- <view style="color: #ff9294;font-size: 30rpx;font-weight:bold ;">未支付</view>
- </view>
- <view style="width: 70%;" v-if="item.zt == 2" class="flex align-center">
- <view style="width: 12rpx;height: 12rpx;border-radius: 50rpx;background-color: #ff9294;margin-right: 20rpx;"></view>
- <view style="color: #ff9294;font-size: 30rpx;font-weight:bold ;">待接单</view>
- </view>
- <view style="width: 70%;" v-else-if="item.zt == 3" class="flex align-center">
- <view style="width: 12rpx;height: 12rpx;border-radius: 50rpx;background-color: #EEAA3F;margin-right: 20rpx;"></view>
- <view style="color: #EEAA3F;font-size: 30rpx;font-weight:bold ;">进行中</view>
- </view>
- <view style="width: 70%;" v-else-if="item.zt == 4" class="flex align-center">
- <view style="width: 12rpx;height: 12rpx;border-radius: 50rpx;background-color: #84BB43;margin-right: 20rpx;"></view>
- <view style="color: #84BB43;font-size: 30rpx;font-weight:bold ;">已完成</view>
- </view>
- <view style="width: 70%;" v-else-if="item.zt == 5" class="flex align-center">
- <view style="width: 12rpx;height: 12rpx;border-radius: 50rpx;background-color: #bababa;margin-right: 20rpx;"></view>
- <view style="color: #bababa;font-size: 30rpx;font-weight:bold ;">已取消</view>
- </view>
- <view style="width: 30%;" class="flex align-center">
- <view style="font-size: 28rpx;padding: 8rpx 24rpx;border-radius: 20rpx;background-color: #F6F6F6;" v-if="item.zl == 2">图文咨询</view>
- <view style="font-size: 28rpx;padding: 8rpx 24rpx;border-radius: 20rpx;background-color: #F6F6F6;" v-else-if="item.zl == 1">电话咨询</view>
- </view>
- </view>
- <!-- 线 -->
- <u-line color="#ebebeb" />
- <!-- 资料 -->
- <view class="">
- <view class="nr">
- <view class="left">患者:</view>
- <view class="right">{{item.name}}</view>
- </view>
- <view class="nr">
- <view class="left">年龄:</view>
- <view class="right">{{item.birthday}}</view>
- </view>
- <view class="nr">
- <view class="left">订单号:</view>
- <view class="right">{{item.order_sn}}</view>
- </view>
- <view class="nr">
- <view class="left">下单时间:</view>
- <view class="right">{{item.created_at}}</view>
- </view>
- </view>
- </view>
- </view>
- </view>
- <u-empty text="暂无数据" :show="show" mode="order" margin-top="250"></u-empty>
- <view style="width: 100%;height: 100rpx;"></view>
- </view>
- </template>
- <script>
- export default {
- onShow() {
- // this.getLists(this.num,this.value1,this.value2)
- this.getLists(this.num,this.value1,this.value2)
-
- },
- onLoad(e) {
- // 获取列表
- },
- data() {
- return {
- show:false,
- //排序点击事件
- value1: 0,
- value2: 0,
- options1: [{
- label: '全部类型',
- value: 0,
- },
- {
- label: '图文咨询',
- value: 1,
- },
- {
- label: '电话咨询',
- value: 2,
- }
- ],
- options2: [{
- label: '处理中',
- value: 0,
- },
- {
- label: '历史记录',
- value: 1,
- },
- ],
- list: [],
- num: 1 //记录下拉的次数 = 页数
- }
- },
- methods: {
- empty(){
- console.log('list',this.list)
- if(this.list.length==0){
- this.show = true
- }else{
- this.show = false
- }
- },
- getLists: async function(c,t,p) {
- // 备注: curPage当前页,pageSize一页显示多少条,
- // typeAll:类型(不填写为全部类型,1=图文咨询,2=.电话咨询),processing(不填写为全部类型,0=处理中 ,1=历史记录)
- // 根据备注去操作接口
- let res = await this.$request.post('patient/orderPatientList', {
- 'curPage': c,
- 'pageSize': 5,
- 'typeAll': t,
- 'processing': p
- })
- if (res.status == 0) {
- // 如果要加载第二页
- if(c!=1){
- console.log('页数curPage',c)
- console.log('类型typeAll',t)
- console.log('状态processing',p)
- let data = res.data;
- this.list= this.list.concat(data)
- // Array.prototype.push.apply(this.list, data);
- console.log('list',this.list)
- }else{
- console.log('c',c)
- console.log('t',t)
- console.log('p',p)
- let data = res.data;
- this.list = data
- console.log(this.list)
- }
- }
- this.empty()
- },
- close1(e) {
- this.value1 = e
- //重新选择就清空
- this.list = []
- this.num= 1
- //调用接口 页数 类型 状态
- this.getLists(this.num,this.value1,this.value2)
- },
- close2(e) {
- this.value2 = e
- //重新选择就清空
- this.list = []
- this.num= 1
- //调用接口 页数 类型 状态
- this.getLists(this.num,this.value1,this.value2)
- },
- // 会话
- huihua(e) {
- uni.switchTab({
- url: '/pages/conversation/conversation'
- })
- console.log(e)
- },
- // 咨询详情
- xiangqing(e) {
- let id = this.list[e.currentTarget.dataset.index].id;
- uni.navigateTo({
- url: 'xiangqing?data=' + id
- })
- }
- },
- //页面到底监听
- onReachBottom() {
- this.num++
- console.log('到底', this.num);
- setTimeout(function() {
- uni.stopPullDownRefresh();
- }, 1000);
- this.getLists(this.num,this.value1,this.value2)
- }
- }
- </script>
- <style lang="scss">
- .topmenu {
- // position: fixed;
- // top: 0;
- // left: 0;
- width: 100%;
- height: 100rpx;
- background-color: #FFFFFF;
- z-index: 1;
- }
- .list_view {
- margin: 0 28rpx 30rpx 28rpx;
- background-color: #FFFFFF;
- border-radius: 12rpx;
- box-shadow: 0px 2px 12px 0px rgba(0, 0, 0, 0.04);
- padding: 28rpx;
- }
- .nr {
- margin: 28rpx 0;
- display: flex;
- .left {
- width: 25%;
- color: #666666;
- }
- .right {
- width: 75%;
- font-weight: 400;
- }
- }
- </style>
|