zixun.vue 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238
  1. <template style="background-color: #b8b8b8;">
  2. <view style="width: 100%;height: 100%;">
  3. <view class="topmenu">
  4. <u-dropdown>
  5. <u-dropdown-item v-model="value1" :title="options1[value1].label" :options="options1" @change="close1"></u-dropdown-item>
  6. <u-dropdown-item v-model="value2" :title="options2[value2].label" :options="options2" @change="close2"></u-dropdown-item>
  7. </u-dropdown>
  8. </view>
  9. <view style="padding:28rpx 20rpx;width: 100%;flex-direction: row-reverse;" class="flex">
  10. <view @click="huihua">
  11. <text style="font-size: 28rpx;color: #666666;margin-right: 15rpx;">查看会话</text>
  12. <u-icon name="arrow-right" color="#666666"></u-icon>
  13. </view>
  14. </view>
  15. <!-- 上面的下拉菜单中 -->
  16. <!-- value1种类 0为全部 1为电话 2为图文-->
  17. <!-- value2状态 0为处理中 1为历史记录-->
  18. <view v-for="(item,index) in list" :key='index' :data-index="index" @click="xiangqing">
  19. <view >
  20. <view class="list_view">
  21. <!-- 状态和类型 -->
  22. <!-- 状态 1未接单 2进行中 3已完成 4已取消 -->
  23. <!-- 种类 1电话咨询 2图文咨询-->
  24. <view class="flex align-center" style="margin-bottom: 30rpx;">
  25. <view style="width: 70%;" v-if="item.zt == 1" class="flex align-center">
  26. <view style="width: 12rpx;height: 12rpx;border-radius: 50rpx;background-color: #ff9294;margin-right: 20rpx;"></view>
  27. <view style="color: #ff9294;font-size: 30rpx;font-weight:bold ;">未支付</view>
  28. </view>
  29. <view style="width: 70%;" v-if="item.zt == 2" class="flex align-center">
  30. <view style="width: 12rpx;height: 12rpx;border-radius: 50rpx;background-color: #ff9294;margin-right: 20rpx;"></view>
  31. <view style="color: #ff9294;font-size: 30rpx;font-weight:bold ;">待接单</view>
  32. </view>
  33. <view style="width: 70%;" v-else-if="item.zt == 3" class="flex align-center">
  34. <view style="width: 12rpx;height: 12rpx;border-radius: 50rpx;background-color: #EEAA3F;margin-right: 20rpx;"></view>
  35. <view style="color: #EEAA3F;font-size: 30rpx;font-weight:bold ;">进行中</view>
  36. </view>
  37. <view style="width: 70%;" v-else-if="item.zt == 4" class="flex align-center">
  38. <view style="width: 12rpx;height: 12rpx;border-radius: 50rpx;background-color: #84BB43;margin-right: 20rpx;"></view>
  39. <view style="color: #84BB43;font-size: 30rpx;font-weight:bold ;">已完成</view>
  40. </view>
  41. <view style="width: 70%;" v-else-if="item.zt == 5" class="flex align-center">
  42. <view style="width: 12rpx;height: 12rpx;border-radius: 50rpx;background-color: #bababa;margin-right: 20rpx;"></view>
  43. <view style="color: #bababa;font-size: 30rpx;font-weight:bold ;">已取消</view>
  44. </view>
  45. <view style="width: 30%;" class="flex align-center">
  46. <view style="font-size: 28rpx;padding: 8rpx 24rpx;border-radius: 20rpx;background-color: #F6F6F6;" v-if="item.zl == 2">图文咨询</view>
  47. <view style="font-size: 28rpx;padding: 8rpx 24rpx;border-radius: 20rpx;background-color: #F6F6F6;" v-else-if="item.zl == 1">电话咨询</view>
  48. </view>
  49. </view>
  50. <!-- 线 -->
  51. <u-line color="#ebebeb" />
  52. <!-- 资料 -->
  53. <view class="">
  54. <view class="nr">
  55. <view class="left">患者:</view>
  56. <view class="right">{{item.name}}</view>
  57. </view>
  58. <view class="nr">
  59. <view class="left">年龄:</view>
  60. <view class="right">{{item.birthday}}</view>
  61. </view>
  62. <view class="nr">
  63. <view class="left">订单号:</view>
  64. <view class="right">{{item.order_sn}}</view>
  65. </view>
  66. <view class="nr">
  67. <view class="left">下单时间:</view>
  68. <view class="right">{{item.created_at}}</view>
  69. </view>
  70. </view>
  71. </view>
  72. </view>
  73. </view>
  74. <u-empty text="暂无数据" :show="show" mode="order" margin-top="250"></u-empty>
  75. <view style="width: 100%;height: 100rpx;"></view>
  76. </view>
  77. </template>
  78. <script>
  79. export default {
  80. onShow() {
  81. // this.getLists(this.num,this.value1,this.value2)
  82. this.getLists(this.num,this.value1,this.value2)
  83. },
  84. onLoad(e) {
  85. // 获取列表
  86. },
  87. data() {
  88. return {
  89. show:false,
  90. //排序点击事件
  91. value1: 0,
  92. value2: 0,
  93. options1: [{
  94. label: '全部类型',
  95. value: 0,
  96. },
  97. {
  98. label: '图文咨询',
  99. value: 1,
  100. },
  101. {
  102. label: '电话咨询',
  103. value: 2,
  104. }
  105. ],
  106. options2: [{
  107. label: '处理中',
  108. value: 0,
  109. },
  110. {
  111. label: '历史记录',
  112. value: 1,
  113. },
  114. ],
  115. list: [],
  116. num: 1 //记录下拉的次数 = 页数
  117. }
  118. },
  119. methods: {
  120. empty(){
  121. console.log('list',this.list)
  122. if(this.list.length==0){
  123. this.show = true
  124. }else{
  125. this.show = false
  126. }
  127. },
  128. getLists: async function(c,t,p) {
  129. // 备注: curPage当前页,pageSize一页显示多少条,
  130. // typeAll:类型(不填写为全部类型,1=图文咨询,2=.电话咨询),processing(不填写为全部类型,0=处理中 ,1=历史记录)
  131. // 根据备注去操作接口
  132. let res = await this.$request.post('patient/orderPatientList', {
  133. 'curPage': c,
  134. 'pageSize': 5,
  135. 'typeAll': t,
  136. 'processing': p
  137. })
  138. if (res.status == 0) {
  139. // 如果要加载第二页
  140. if(c!=1){
  141. console.log('页数curPage',c)
  142. console.log('类型typeAll',t)
  143. console.log('状态processing',p)
  144. let data = res.data;
  145. this.list= this.list.concat(data)
  146. // Array.prototype.push.apply(this.list, data);
  147. console.log('list',this.list)
  148. }else{
  149. console.log('c',c)
  150. console.log('t',t)
  151. console.log('p',p)
  152. let data = res.data;
  153. this.list = data
  154. console.log(this.list)
  155. }
  156. }
  157. this.empty()
  158. },
  159. close1(e) {
  160. this.value1 = e
  161. //重新选择就清空
  162. this.list = []
  163. this.num= 1
  164. //调用接口 页数 类型 状态
  165. this.getLists(this.num,this.value1,this.value2)
  166. },
  167. close2(e) {
  168. this.value2 = e
  169. //重新选择就清空
  170. this.list = []
  171. this.num= 1
  172. //调用接口 页数 类型 状态
  173. this.getLists(this.num,this.value1,this.value2)
  174. },
  175. // 会话
  176. huihua(e) {
  177. uni.switchTab({
  178. url: '/pages/conversation/conversation'
  179. })
  180. console.log(e)
  181. },
  182. // 咨询详情
  183. xiangqing(e) {
  184. let id = this.list[e.currentTarget.dataset.index].id;
  185. uni.navigateTo({
  186. url: 'xiangqing?data=' + id
  187. })
  188. }
  189. },
  190. //页面到底监听
  191. onReachBottom() {
  192. this.num++
  193. console.log('到底', this.num);
  194. setTimeout(function() {
  195. uni.stopPullDownRefresh();
  196. }, 1000);
  197. this.getLists(this.num,this.value1,this.value2)
  198. }
  199. }
  200. </script>
  201. <style lang="scss">
  202. .topmenu {
  203. // position: fixed;
  204. // top: 0;
  205. // left: 0;
  206. width: 100%;
  207. height: 100rpx;
  208. background-color: #FFFFFF;
  209. z-index: 1;
  210. }
  211. .list_view {
  212. margin: 0 28rpx 30rpx 28rpx;
  213. background-color: #FFFFFF;
  214. border-radius: 12rpx;
  215. box-shadow: 0px 2px 12px 0px rgba(0, 0, 0, 0.04);
  216. padding: 28rpx;
  217. }
  218. .nr {
  219. margin: 28rpx 0;
  220. display: flex;
  221. .left {
  222. width: 25%;
  223. color: #666666;
  224. }
  225. .right {
  226. width: 75%;
  227. font-weight: 400;
  228. }
  229. }
  230. </style>