my_consulting.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428
  1. <template>
  2. <view class="main bg-white">
  3. <u-dropdown>
  4. <u-dropdown-item v-model="value1" :title="options1[value1].label" @change="typechange" :options="options1"></u-dropdown-item>
  5. <u-dropdown-item v-model="value2" :title="options2[value2].label" @change="paychange" :options="options2"></u-dropdown-item>
  6. <u-dropdown-item v-model="value3" :title="options3[value3].label" @change="timechange" :options="options3"></u-dropdown-item>
  7. </u-dropdown>
  8. <load-refresh ref="loadRefresh" :isRefresh="true" refreshType="loader" refreshTime="2000" heightReduce="10"
  9. backgroundCover="#fff" :pageNo="pageindex" :totalPageNo="totalPage" @loadMore="loadMore" @refresh="refresh">
  10. <view slot="content-list">
  11. <view class="margin-top-sm margin-lr-sm" v-for="(item,index) in ordersList" @click="goinfoorder" :data-id="item.id"
  12. :key="index" style="border-radius: 16rpx;box-shadow:0px 0px 10px rgba(0,0,0,.2);">
  13. <view class="flex justify-between align-center bg-white" style="padding: 28rpx;border-radius: 16rpx;">
  14. <view class="jinxing">
  15. <text style="display: inline-block;width: 12rpx;height: 12rpx;border-radius: 50%;background-color:#EEAA3F;margin-right: 8rpx;"></text>
  16. <text v-if="item.order_status==3">进行中</text>
  17. <text v-else-if="item.order_status==1">未支付</text>
  18. <text v-else-if="item.order_status==2">待接单</text>
  19. <text v-else-if="item.order_status==4">已完成</text>
  20. <text v-else>已取消</text>
  21. </view>
  22. <text class="phonezi" v-if="item.product_type==1">电话咨询</text>
  23. <text class="phonezi" v-else-if="item.product_type==2">图文咨询</text>
  24. </view>
  25. <view class="" style="background: #FBFBFB;padding: 28rpx; border-radius: 16rpx;">
  26. <view class="nametaile flex align-center">
  27. <u-avatar :src="item.docter.avatar" mode="circle"></u-avatar>
  28. <text class="margin-left-sm">{{item.docter.name}}</text>
  29. <text class="text_style" v-for="(itm,idx) in item.docter.label_texts" :key="index">{{itm.label_name}}</text>
  30. </view>
  31. <view class="textstyle margin-top-xs flex align-center justify-between">
  32. <text style="color: #333333;">科室:{{item.docter.office.name||'暂无'}} {{item.docter.qualification.name||'暂无'}}</text>
  33. <text v-if="item.order_status==4&&item.product_type==2" class="text-blue" @click.stop="gosuggest(item)">意见单</text>
  34. <text v-else-if="item.order_status==1" class="text-blue">去支付</text>
  35. <text v-else class="text-blue">查看详情</text>
  36. </view>
  37. <view class="textstyle margin-top-xs flex align-center justify-between">
  38. <text style="color: #333333;">编号:{{item.order_sn}}</text>
  39. <text v-if="item.order_status==4&&item.is_evaluate!=1" @click.stop="evaluate(item,index)" style="width: 130rpx; text-align: right;"
  40. class="text-blue">评价</text>
  41. <text v-else-if="item.order_status==1" class="text-blue">取消</text>
  42. <text v-else-if="item.order_status==4&&item.is_evaluate==1" class="text-blue" @click.stop="gotoeva">查看评价</text>
  43. </view>
  44. <view class="textstyle margin-top-xs">
  45. <text style="color: #333333;">下单时间:{{item.created_at}}</text>
  46. </view>
  47. </view>
  48. </view>
  49. </view>
  50. </load-refresh>
  51. <!-- <view class="margin-lr-sm bg-white">
  52. <view class="margin-top-sm" v-for="(item,index) in ordersList" @click="goinfoorder" :data-id="item.id" :key="index"
  53. style="border-radius: 16rpx;box-shadow: 0 0 50rpx 0 rgba(0, 0, 0, 0.1);">
  54. <view class="flex justify-between align-center bg-white" style="padding: 28rpx;border-radius: 16rpx;">
  55. <view class="jinxing">
  56. <text style="display: inline-block;width: 12rpx;height: 12rpx;border-radius: 50%;background-color:#EEAA3F;margin-right: 8rpx;"></text>
  57. <text v-if="item.order_status==3">进行中</text>
  58. <text v-else-if="item.order_status==1">未支付</text>
  59. <text v-else-if="item.order_status==2">待接单</text>
  60. <text v-else-if="item.order_status==4">已完成</text>
  61. <text v-else>已取消</text>
  62. </view>
  63. <text class="phonezi" v-if="item.product_type==1">电话咨询</text>
  64. <text class="phonezi" v-else-if="item.product_type==2">图文咨询</text>
  65. </view>
  66. <view class="" style="background: #FBFBFB;padding: 28rpx; border-radius: 16rpx;">
  67. <view class="nametaile flex align-center">
  68. <u-avatar :src="item.docter.avatar" mode="circle"></u-avatar>
  69. <text class="margin-left-sm">{{item.docter.name}}</text>
  70. <text class="text_style" v-for="(itm,idx) in item.docter.label_texts" :key="index">{{itm.label_name}}</text>
  71. </view>
  72. <view class="textstyle margin-top-xs flex align-center justify-between">
  73. <text style="color: #333333;">科室:{{item.docter.office.name||'暂无'}} {{item.docter.qualification.name||'暂无'}}</text>
  74. <text v-if="item.order_status==4&&item.product_type==2" class="text-blue" @click.stop="gosuggest(item)">意见单</text>
  75. <text v-else-if="item.order_status==1" class="text-blue">去支付</text>
  76. <text v-else class="text-blue">查看详情</text>
  77. </view>
  78. <view class="textstyle margin-top-xs flex align-center justify-between">
  79. <text style="color: #333333;">编号:{{item.order_sn}}</text>
  80. <text v-if="item.order_status==4&&item.is_evaluate!=1" @click.stop="evaluate(item,index)" style="width: 130rpx; text-align: right;"
  81. class="text-blue">评价</text>
  82. <text v-else-if="item.order_status==1" class="text-blue">取消</text>
  83. <text v-else-if="item.order_status==4&&item.is_evaluate==1" class="text-blue" @click.stop="gotoeva">查看评价</text>
  84. </view>
  85. <view class="textstyle margin-top-xs">
  86. <text style="color: #333333;">下单时间:{{item.created_at}}</text>
  87. </view>
  88. </view>
  89. </view>
  90. </view> -->
  91. <u-popup v-model="showpinjia" mode="center" border-radius="14">
  92. <view class="padding-xl flex flex-direction align-center">
  93. <view class="text-xl text-bold text-black text-center">
  94. 填写评价
  95. </view>
  96. <view class="margin-tb-sm">
  97. <u-rate :count="count" size="48" active-color="#EEAA3F" v-model="ratevalue"></u-rate>
  98. </view>
  99. <textarea v-model="content" class="textareastyle"></textarea>
  100. <view class="flex align-center justify-between margin-tb" style="width: 100%;">
  101. <button class="cancel" @click="concelpop">取消</button>
  102. <button class="determine" @click="determinepop">确定</button>
  103. </view>
  104. </view>
  105. </u-popup>
  106. <u-empty text="暂无数据" mode="order" :show="show" margin-top="250"></u-empty>
  107. <!-- <view class="cu-tabbar-height"></view>
  108. <view class="cu-tabbar-height"></view> -->
  109. </view>
  110. </template>
  111. <script>
  112. import loadRefresh from '@/components/load-refresh/load-refresh'
  113. import IMService from "../../../common/goeasyimutil.js"
  114. export default {
  115. components: {
  116. loadRefresh
  117. },
  118. onLoad(options) {
  119. },
  120. onShow() {
  121. console.log(uni.getStorageSync('user').flag, typeof uni.getStorageSync('user').flag)
  122. if (getApp().globalData.imService == null) {
  123. let user = uni.getStorageSync('user')
  124. getApp().globalData.imService = new IMService();
  125. let loginResult = getApp().globalData.imService.login({
  126. flag: user.flag,
  127. nickname: user.nickname,
  128. avatar: user.avatar
  129. });
  130. if (loginResult) {
  131. //连接IM
  132. getApp().globalData.imService.connectIM();
  133. }
  134. }
  135. },
  136. mounted() {
  137. this.getordersList()
  138. },
  139. data() {
  140. return {
  141. value1: 0, //全部类型
  142. value2: 0, //全部状态
  143. value3: 1, //时间正序
  144. options1: [{
  145. value: 0,
  146. label: "全部类型"
  147. },
  148. {
  149. value: 1,
  150. label: "电话咨询"
  151. },
  152. {
  153. value: 2,
  154. label: "图文咨询"
  155. },
  156. ],
  157. options2: [{
  158. value: 0,
  159. label: "全部状态"
  160. },
  161. {
  162. value: 1,
  163. label: "未支付"
  164. },
  165. {
  166. value: 2,
  167. label: "待接单"
  168. },
  169. {
  170. value: 3,
  171. label: "进行中"
  172. },
  173. {
  174. value: 4,
  175. label: "已完成"
  176. },
  177. {
  178. value: 5,
  179. label: "已取消"
  180. },
  181. ],
  182. options3: [{
  183. value: 0,
  184. label: "时间正序"
  185. },
  186. {
  187. value: 1,
  188. label: "时间倒序"
  189. },
  190. ],
  191. ordersList: [],
  192. pageindex: 1,
  193. show: false,
  194. showpinjia: false,
  195. ratevalue: "",
  196. count: 5,
  197. content: "",
  198. currentorder: "",
  199. evaluateindex: "",
  200. totalPage: ""
  201. }
  202. },
  203. // onReachBottom() {
  204. // this.getordersList()
  205. // },
  206. // onPullDownRefresh() {
  207. // this.pageindex = 1
  208. // this.ordersList = []
  209. // this.getordersList()
  210. // uni.stopPullDownRefresh()
  211. // },
  212. methods: {
  213. loadMore() {
  214. this.getordersList()
  215. },
  216. refresh() {
  217. this.pageindex = 1
  218. // this.ordersList = []
  219. this.getordersList()
  220. },
  221. evaluate(item, index) {
  222. this.showpinjia = true
  223. this.currentorder = item
  224. this.evaluateindex = index
  225. },
  226. determinepop: async function() {
  227. let res = await this.$request.post("/api/v1/evaluate/sumbitEvaluate", {
  228. order_id: this.currentorder.id,
  229. docter_id: this.currentorder.docter_id,
  230. score: this.ratevalue,
  231. content: this.content
  232. })
  233. console.log(res)
  234. if (res.status == 0) {
  235. uni.showToast({
  236. title: "评价成功",
  237. icon: "none",
  238. duration: 500
  239. })
  240. this.ordersList[this.evaluateindex].is_evaluate = 1
  241. setTimeout(() => {
  242. this.showpinjia = false
  243. }, 500)
  244. this.$forceUpdate()
  245. }
  246. },
  247. concelpop() {
  248. this.content = ""
  249. this.showpinjia = false
  250. },
  251. typechange(value) {
  252. this.value1 = value
  253. this.pageindex = 1
  254. this.ordersList = []
  255. this.getordersList()
  256. },
  257. paychange(value) {
  258. this.value2 = value
  259. this.pageindex = 1
  260. this.ordersList = []
  261. this.getordersList()
  262. },
  263. timechange(value) {
  264. this.value3 = value
  265. this.pageindex = 1
  266. this.ordersList = []
  267. this.getordersList()
  268. },
  269. getordersList: async function() {
  270. let res = await this.$request.post("/api/v1/order/orderList", {
  271. page: this.pageindex,
  272. list_type: this.value1,
  273. product_type: this.value1,
  274. order_status: this.value2,
  275. time_sort: this.value3
  276. }, false)
  277. if (res.status == 0) {
  278. this.$refs.loadRefresh.loadOver()
  279. if (this.pageindex > res.data.last_page) {
  280. uni.showToast({
  281. title: "没有更多了",
  282. icon: "none"
  283. })
  284. } else {
  285. this.ordersList = this.ordersList.concat(res.data.data)
  286. this.ordersList.forEach((item, index) => {
  287. if (item.docter == null) {
  288. this.ordersList.splice(index, 1)
  289. }
  290. })
  291. this.ordersList.forEach((item, index) => {
  292. if (item.product_type == 6) {
  293. this.ordersList.splice(index, 1)
  294. }
  295. })
  296. this.ordersList.forEach((item, index) => {
  297. if (item.product_type == 5) {
  298. this.ordersList.splice(index, 1)
  299. }
  300. })
  301. this.ordersList.forEach((item, index) => {
  302. if (item.product_type != 1 && item.product_type != 2) {
  303. this.ordersList.splice(index, 1)
  304. }
  305. })
  306. this.ordersList.forEach((item, index) => {
  307. if (item.product_type == 3) {
  308. this.ordersList.splice(index, 1)
  309. }
  310. })
  311. console.log(this.ordersList)
  312. this.pageindex++
  313. this.totalPage = res.data.last_page
  314. }
  315. }
  316. if (this.ordersList.length == 0) {
  317. this.show = true
  318. } else {
  319. this.show = false
  320. }
  321. },
  322. pinjia() {
  323. },
  324. goinfoorder(e) {
  325. uni.navigateTo({
  326. url: "consultingInfo?id=" + e.currentTarget.dataset.id
  327. })
  328. },
  329. gosuggest(item) {
  330. uni.navigateTo({
  331. url: "opinionInfo?id=" + item.suggest.id
  332. })
  333. },
  334. gotoeva() {
  335. uni.navigateTo({
  336. url: "../me_evaluate"
  337. })
  338. }
  339. }
  340. };
  341. </script>
  342. <style lang="scss">
  343. page {
  344. background-color: #fff;
  345. }
  346. .cancel {
  347. width: 240rpx;
  348. height: 78rpx;
  349. border-radius: 16rpx;
  350. border: 2rpx solid #0B73B9;
  351. color: #0B73B9;
  352. font-size: 32rpx;
  353. }
  354. .determine {
  355. width: 240rpx;
  356. height: 78rpx;
  357. background: #0B73B9;
  358. border-radius: 16rpx;
  359. color: #fff;
  360. font-size: 32rpx;
  361. }
  362. .textareastyle {
  363. width: 560rpx;
  364. height: 269rpx;
  365. padding: 25rpx;
  366. border: 1px solid #C0C0C0;
  367. border-radius: 16rpx;
  368. font-size: 28rpx;
  369. }
  370. .main {}
  371. .text_style {
  372. font-weight: 400;
  373. margin-left: 15rpx;
  374. background-color: #E5F5FF;
  375. color: #0B73B9;
  376. width: 100rpx;
  377. height: 28rpx;
  378. font-size: 20rpx;
  379. border-radius: 10rpx;
  380. text-align: center;
  381. align-items: center;
  382. }
  383. .nametaile {
  384. font-size: 30rpx;
  385. font-weight: 500;
  386. color: #333333;
  387. }
  388. .textstyle {
  389. font-size: 26rpx;
  390. color: #666666;
  391. font-weight: 400;
  392. }
  393. .phonezi {
  394. width: 160rpx;
  395. height: 54rpx;
  396. background: #F6F6F6;
  397. border-radius: 27rpx;
  398. font-size: 28rpx;
  399. font-family: PingFangSC-Regular, PingFang SC;
  400. font-weight: 400;
  401. color: #666666;
  402. display: flex;
  403. align-items: center;
  404. justify-content: center;
  405. }
  406. .jinxing {
  407. height: 30rpx;
  408. font-size: 30rpx;
  409. font-family: PingFangSC-Medium, PingFang SC;
  410. font-weight: 500;
  411. color: #EEAA3F;
  412. display: flex;
  413. align-items: center;
  414. }
  415. </style>