my_consulting.vue 9.7 KB

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