my_consulting.vue 8.4 KB

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