my_consulting.vue 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364
  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. methods: {
  159. evaluate(item, index) {
  160. this.showpinjia = true
  161. this.currentorder = item
  162. this.evaluateindex = index
  163. },
  164. determinepop: async function() {
  165. let res = await this.$request.post("/api/v1/evaluate/sumbitEvaluate", {
  166. order_id: this.currentorder.id,
  167. docter_id: this.currentorder.docter_id,
  168. score: this.ratevalue,
  169. content: this.content
  170. })
  171. console.log(res)
  172. if (res.status == 0) {
  173. uni.showToast({
  174. title: "评价成功",
  175. icon: "none",
  176. duration: 500
  177. })
  178. this.ordersList[this.evaluateindex].is_evaluate = 1
  179. setTimeout(() => {
  180. this.showpinjia = false
  181. }, 500)
  182. this.$forceUpdate()
  183. }
  184. },
  185. concelpop() {
  186. this.content = ""
  187. this.showpinjia = false
  188. },
  189. typechange(value) {
  190. this.value1 = value
  191. this.pageindex = 1
  192. this.ordersList = []
  193. this.getordersList()
  194. },
  195. paychange(value) {
  196. this.value2 = value
  197. this.pageindex = 1
  198. this.ordersList = []
  199. this.getordersList()
  200. },
  201. timechange(value) {
  202. this.value3 = value
  203. this.pageindex = 1
  204. this.ordersList = []
  205. this.getordersList()
  206. },
  207. getordersList: async function() {
  208. let res = await this.$request.post("/api/v1/order/orderList", {
  209. page: this.pageindex,
  210. list_type: this.value1,
  211. product_type: this.value1,
  212. order_status: this.value2,
  213. time_sort: this.value3
  214. })
  215. if (res.status == 0) {
  216. if (this.pageindex > res.data.last_page) {
  217. uni.showToast({
  218. title: "没有更多了",
  219. icon: "none"
  220. })
  221. } else {
  222. this.ordersList = this.ordersList.concat(res.data.data)
  223. this.ordersList.forEach((item, index) => {
  224. if (item.docter == null) {
  225. this.ordersList.splice(index, 1)
  226. }
  227. })
  228. this.ordersList.forEach((item, index) => {
  229. if (item.product_type == 6) {
  230. this.ordersList.splice(index, 1)
  231. }
  232. })
  233. this.ordersList.forEach((item, index) => {
  234. if (item.product_type == 5) {
  235. this.ordersList.splice(index, 1)
  236. }
  237. })
  238. this.ordersList.forEach((item, index) => {
  239. if (item.product_type != 1 && item.product_type != 2) {
  240. this.ordersList.splice(index, 1)
  241. }
  242. })
  243. this.ordersList.forEach((item, index) => {
  244. if (item.product_type == 3) {
  245. this.ordersList.splice(index, 1)
  246. }
  247. })
  248. console.log(this.ordersList)
  249. this.pageindex++
  250. }
  251. }
  252. if (this.ordersList.length == 0) {
  253. this.show = true
  254. } else {
  255. this.show = false
  256. }
  257. },
  258. pinjia() {
  259. },
  260. goinfoorder(e) {
  261. uni.navigateTo({
  262. url: "consultingInfo?id=" + e.currentTarget.dataset.id
  263. })
  264. },
  265. gosuggest(item) {
  266. uni.navigateTo({
  267. url: "opinionInfo?id=" + item.suggest.id
  268. })
  269. },
  270. gotoeva() {
  271. uni.navigateTo({
  272. url: "../me_evaluate"
  273. })
  274. }
  275. }
  276. };
  277. </script>
  278. <style lang="scss">
  279. page {
  280. background-color: #fff;
  281. }
  282. .cancel {
  283. width: 240rpx;
  284. height: 78rpx;
  285. border-radius: 16rpx;
  286. border: 2rpx solid #0B73B9;
  287. color: #0B73B9;
  288. font-size: 32rpx;
  289. }
  290. .determine {
  291. width: 240rpx;
  292. height: 78rpx;
  293. background: #0B73B9;
  294. border-radius: 16rpx;
  295. color: #fff;
  296. font-size: 32rpx;
  297. }
  298. .textareastyle {
  299. width: 560rpx;
  300. height: 269rpx;
  301. padding: 25rpx;
  302. border: 1px solid #C0C0C0;
  303. border-radius: 16rpx;
  304. font-size: 28rpx;
  305. }
  306. .main {}
  307. .text_style {
  308. font-weight: 400;
  309. margin-left: 15rpx;
  310. background-color: #E5F5FF;
  311. color: #0B73B9;
  312. width: 100rpx;
  313. height: 28rpx;
  314. font-size: 20rpx;
  315. border-radius: 10rpx;
  316. text-align: center;
  317. align-items: center;
  318. }
  319. .nametaile {
  320. font-size: 30rpx;
  321. font-weight: 500;
  322. color: #333333;
  323. }
  324. .textstyle {
  325. font-size: 26rpx;
  326. color: #666666;
  327. font-weight: 400;
  328. }
  329. .phonezi {
  330. width: 160rpx;
  331. height: 54rpx;
  332. background: #F6F6F6;
  333. border-radius: 27rpx;
  334. font-size: 28rpx;
  335. font-family: PingFangSC-Regular, PingFang SC;
  336. font-weight: 400;
  337. color: #666666;
  338. display: flex;
  339. align-items: center;
  340. justify-content: center;
  341. }
  342. .jinxing {
  343. height: 30rpx;
  344. font-size: 30rpx;
  345. font-family: PingFangSC-Medium, PingFang SC;
  346. font-weight: 500;
  347. color: #EEAA3F;
  348. display: flex;
  349. align-items: center;
  350. }
  351. </style>