my_consulting.vue 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342
  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. export default {
  70. onLoad(options) {
  71. },
  72. mounted() {
  73. this.getordersList()
  74. },
  75. data() {
  76. return {
  77. value1: 0, //全部类型
  78. value2: 0, //全部状态
  79. value3: 1, //时间正序
  80. options1: [{
  81. value: 0,
  82. label: "全部类型"
  83. },
  84. {
  85. value: 1,
  86. label: "电话咨询"
  87. },
  88. {
  89. value: 2,
  90. label: "图文咨询"
  91. },
  92. ],
  93. options2: [{
  94. value: 0,
  95. label: "全部状态"
  96. },
  97. {
  98. value: 1,
  99. label: "未支付"
  100. },
  101. {
  102. value: 2,
  103. label: "待接单"
  104. },
  105. {
  106. value: 3,
  107. label: "进行中"
  108. },
  109. {
  110. value: 4,
  111. label: "已完成"
  112. },
  113. {
  114. value: 5,
  115. label: "已取消"
  116. },
  117. ],
  118. options3: [{
  119. value: 0,
  120. label: "时间正序"
  121. },
  122. {
  123. value: 1,
  124. label: "时间倒序"
  125. },
  126. ],
  127. ordersList: [],
  128. pageindex: 1,
  129. show: false,
  130. showpinjia: false,
  131. ratevalue: "",
  132. count: 5,
  133. content: "",
  134. currentorder: "",
  135. evaluateindex: ""
  136. }
  137. },
  138. onReachBottom() {
  139. this.getordersList()
  140. },
  141. methods: {
  142. evaluate(item, index) {
  143. this.showpinjia = true
  144. this.currentorder = item
  145. this.evaluateindex = index
  146. },
  147. determinepop: async function() {
  148. let res = await this.$request.post("/api/v1/evaluate/sumbitEvaluate", {
  149. order_id: this.currentorder.id,
  150. docter_id: this.currentorder.docter_id,
  151. score: this.ratevalue,
  152. content: this.content
  153. })
  154. console.log(res)
  155. if (res.status == 0) {
  156. uni.showToast({
  157. title: "评价成功",
  158. icon: "none",
  159. duration: 500
  160. })
  161. this.ordersList[this.evaluateindex].is_evaluate = 1
  162. setTimeout(() => {
  163. this.showpinjia = false
  164. }, 500)
  165. this.$forceUpdate()
  166. }
  167. },
  168. concelpop() {
  169. this.content = ""
  170. this.showpinjia = false
  171. },
  172. typechange(value) {
  173. this.value1 = value
  174. this.pageindex = 1
  175. this.ordersList = []
  176. this.getordersList()
  177. },
  178. paychange(value) {
  179. this.value2 = value
  180. this.pageindex = 1
  181. this.ordersList = []
  182. this.getordersList()
  183. },
  184. timechange(value) {
  185. this.value3 = value
  186. this.pageindex = 1
  187. this.ordersList = []
  188. this.getordersList()
  189. },
  190. getordersList: async function() {
  191. let res = await this.$request.post("/api/v1/order/orderList", {
  192. page: this.pageindex,
  193. list_type: this.value1,
  194. product_type: this.value1,
  195. order_status: this.value2,
  196. time_sort: this.value3
  197. })
  198. if (res.status == 0) {
  199. if (this.pageindex > res.data.last_page) {
  200. uni.showToast({
  201. title: "没有更多了",
  202. icon: "none"
  203. })
  204. } else {
  205. this.ordersList = this.ordersList.concat(res.data.data)
  206. this.ordersList.forEach((item, index) => {
  207. if (item.docter == null) {
  208. this.ordersList.splice(index, 1)
  209. }
  210. })
  211. this.ordersList.forEach((item, index) => {
  212. if (item.product_type == 6) {
  213. this.ordersList.splice(index, 1)
  214. }
  215. })
  216. this.ordersList.forEach((item, index) => {
  217. if (item.product_type != 1 && item.product_type != 2) {
  218. this.ordersList.splice(index, 1)
  219. }
  220. })
  221. this.ordersList.forEach((item, index) => {
  222. if (item.product_type == 3) {
  223. this.ordersList.splice(index, 1)
  224. }
  225. })
  226. console.log(this.ordersList)
  227. this.pageindex++
  228. }
  229. }
  230. if (this.ordersList.length == 0) {
  231. this.show = true
  232. } else {
  233. this.show = false
  234. }
  235. },
  236. pinjia() {
  237. },
  238. goinfoorder(e) {
  239. uni.navigateTo({
  240. url: "consultingInfo?id=" + e.currentTarget.dataset.id
  241. })
  242. },
  243. gosuggest(item) {
  244. uni.navigateTo({
  245. url: "opinionInfo?id=" + item.suggest.id
  246. })
  247. },
  248. gotoeva() {
  249. uni.navigateTo({
  250. url: "../me_evaluate"
  251. })
  252. }
  253. }
  254. };
  255. </script>
  256. <style lang="scss">
  257. page {
  258. background-color: #fff;
  259. }
  260. .cancel {
  261. width: 240rpx;
  262. height: 78rpx;
  263. border-radius: 16rpx;
  264. border: 2rpx solid #0B73B9;
  265. color: #0B73B9;
  266. font-size: 32rpx;
  267. }
  268. .determine {
  269. width: 240rpx;
  270. height: 78rpx;
  271. background: #0B73B9;
  272. border-radius: 16rpx;
  273. color: #fff;
  274. font-size: 32rpx;
  275. }
  276. .textareastyle {
  277. width: 560rpx;
  278. height: 269rpx;
  279. padding: 25rpx;
  280. border: 1px solid #C0C0C0;
  281. border-radius: 16rpx;
  282. font-size: 28rpx;
  283. }
  284. .main {}
  285. .text_style {
  286. font-weight: 400;
  287. margin-left: 15rpx;
  288. background-color: #E5F5FF;
  289. color: #0B73B9;
  290. width: 100rpx;
  291. height: 28rpx;
  292. font-size: 20rpx;
  293. border-radius: 10rpx;
  294. text-align: center;
  295. align-items: center;
  296. }
  297. .nametaile {
  298. font-size: 30rpx;
  299. font-weight: 500;
  300. color: #333333;
  301. }
  302. .textstyle {
  303. font-size: 26rpx;
  304. color: #666666;
  305. font-weight: 400;
  306. }
  307. .phonezi {
  308. width: 160rpx;
  309. height: 54rpx;
  310. background: #F6F6F6;
  311. border-radius: 27rpx;
  312. font-size: 28rpx;
  313. font-family: PingFangSC-Regular, PingFang SC;
  314. font-weight: 400;
  315. color: #666666;
  316. display: flex;
  317. align-items: center;
  318. justify-content: center;
  319. }
  320. .jinxing {
  321. height: 30rpx;
  322. font-size: 30rpx;
  323. font-family: PingFangSC-Medium, PingFang SC;
  324. font-weight: 500;
  325. color: #EEAA3F;
  326. display: flex;
  327. align-items: center;
  328. }
  329. </style>