complaintProgress.vue 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355
  1. <template>
  2. <view class="container" v-if="info">
  3. <!-- 头部订单信息区域 -->
  4. <view class="header">
  5. <view class="header_title">
  6. <view class="title_left">{{ info.title }}</view>
  7. <view class="title_right">{{ info.detailsVoList[0].progressType }}</view>
  8. </view>
  9. <view class="header_info">
  10. <view class="info_box">
  11. <view class="box_key">订单号</view>
  12. <view class="box_value">{{ info.bookingId }}</view>
  13. </view>
  14. <view class="info_box">
  15. <view class="box_key">投诉单号</view>
  16. <view class="box_value">{{ info.complaintId }}</view>
  17. </view>
  18. <view class="info_box">
  19. <view class="box_key">反馈时间</view>
  20. <view class="box_value">{{ info.dateTime.slice(0, 19) }}</view>
  21. </view>
  22. </view>
  23. </view>
  24. <!-- 进度详情区域 -->
  25. <view class="progress" v-if="info.detailsVoList">
  26. <view class="progress_title">进度详情</view>
  27. <!-- 进度条区域 -->
  28. <view class="progress_body">
  29. <!-- 每一个进度区域 -->
  30. <view class="body_item" v-for="(item, index) in info.detailsVoList" :key="index">
  31. <view class="item_left">
  32. <view class="left_top">{{ item.dateTime.slice(5, 10) }}</view>
  33. <view class="left_bottom">{{ item.dateTime.slice(11, 16) }}</view>
  34. <view class="left_dot"></view>
  35. </view>
  36. <view class="item_right">
  37. <view class="right_top">{{ item.progressType }}</view>
  38. <view class="right_bottom" v-if="item.title">标题:{{ item.title }}</view>
  39. <view class="right_bottom" v-if="item.content">问题描述:{{ item.content }}</view>
  40. <view class="right_bottom" v-if="item.progressType === '待处理'">问题跟进中</view>
  41. <view class="right_bottom" v-if="item.progressType === '处理中'">问题处理中</view>
  42. <view class="right_bottom" v-if="item.progressType === '已处理'">您的问题已处理</view>
  43. <!-- 图片区域 -->
  44. <view class="right_bottom" v-if="item.urlList.length">
  45. <view class="bottom_key">图片:</view>
  46. <view class="bottom_value">
  47. <img
  48. mode="aspectFill"
  49. v-for="(img, index2) in item.urlList"
  50. :key="index2"
  51. :src="img"
  52. v-if="img.indexOf('jpg') !== -1 || img.indexOf('png') !== -1"
  53. @click="handleClickImg(img, index2)"
  54. />
  55. <video
  56. id="myVideo"
  57. class="video"
  58. :show-fullscreen-btn="false"
  59. :show-play-btn="false"
  60. v-for="(video, index3) in item.urlList"
  61. :key="index3"
  62. v-if="video.indexOf('mp4') !== -1"
  63. :src="video"
  64. @fullscreenchange="fullscreenchange"
  65. @click="handleClickVideo"
  66. ></video>
  67. </view>
  68. </view>
  69. </view>
  70. </view>
  71. </view>
  72. </view>
  73. <!-- 底部按钮区域 -->
  74. <view class="foot">
  75. <view class="btn_phone">服务热线</view>
  76. <view class="btn_finish" v-if="info.detailsVoList[0].progressType !== '已处理'" @click="handleFinish">处理完成</view>
  77. </view>
  78. </view>
  79. </template>
  80. <script>
  81. var dayjs = require('dayjs')
  82. export default {
  83. data() {
  84. return {
  85. // 进度条列表数据
  86. list: [],
  87. id: '',
  88. // 进度详情数据
  89. info: null,
  90. videoContext: null,
  91. // 是否是全屏状态
  92. isFullScreen: false
  93. }
  94. },
  95. onReady() {
  96. this.videoContext = uni.createVideoContext('myVideo')
  97. },
  98. onLoad(options) {
  99. this.id = options.id
  100. this.getData()
  101. },
  102. methods: {
  103. // 进入全屏和退出全屏时触发的回调
  104. fullscreenchange(e) {
  105. this.isFullScreen = e.detail.fullScreen
  106. },
  107. // 点击视频控件时触发的回调
  108. handleClickVideo() {
  109. if (this.isFullScreen) {
  110. this.videoContext.stop()
  111. this.videoContext.exitFullScreen()
  112. } else {
  113. this.videoContext.requestFullScreen()
  114. this.videoContext.play()
  115. }
  116. },
  117. // 获取进度详情数据
  118. async getData() {
  119. const res = await this.$myRequest({
  120. url: '/mhotel/complaintprogressDetails.action',
  121. data: {
  122. complaintId: this.id
  123. }
  124. })
  125. // console.log(res)
  126. if (res.code === 200) {
  127. this.info = res.page
  128. }
  129. },
  130. // 处理完成按钮回调
  131. handleFinish() {
  132. uni.showModal({
  133. title: '提示',
  134. content: '确定处理完成了吗?',
  135. success: async (res) => {
  136. if (res.confirm) {
  137. let time = dayjs(new Date()).format('YYYY-MM-DD HH:mm:ss')
  138. const res = await this.$myRequest({
  139. url: '/mhotel/complaintresolutionComplaint.action',
  140. data: {
  141. complaintId: this.info.complaintId,
  142. createId: uni.getStorageSync('userInfo').id,
  143. createDate: time,
  144. modifyDate: time
  145. }
  146. })
  147. // console.log(res)
  148. if (res.code === 200) {
  149. uni.redirectTo({
  150. url: '/pagesSub/myComplaint/myComplaint'
  151. })
  152. }
  153. }
  154. }
  155. })
  156. },
  157. // 点击进度条图片回调
  158. handleClickImg(url, index) {
  159. // console.log(url)
  160. // console.log(index)
  161. if (this.videoContext) {
  162. this.videoContext.stop()
  163. }
  164. uni.previewImage({
  165. current: index,
  166. urls: [url]
  167. })
  168. }
  169. }
  170. }
  171. </script>
  172. <style lang="scss">
  173. .container {
  174. height: 100vh;
  175. overflow-y: auto;
  176. background-color: #f7f7f7;
  177. .header {
  178. box-sizing: border-box;
  179. padding: 0 30rpx;
  180. height: 290rpx;
  181. background-color: #fff;
  182. .header_title {
  183. display: flex;
  184. align-items: center;
  185. height: 89rpx;
  186. font-size: 28rpx;
  187. border-bottom: 1rpx solid #e5e5e5;
  188. .title_left {
  189. flex: 4;
  190. font-weight: bold;
  191. overflow: hidden;
  192. text-overflow: ellipsis;
  193. white-space: nowrap;
  194. }
  195. .title_right {
  196. flex: 1;
  197. text-align: end;
  198. color: #a6a6a6;
  199. }
  200. }
  201. .header_info {
  202. display: flex;
  203. flex-direction: column;
  204. justify-content: space-evenly;
  205. height: 200rpx;
  206. font-size: 28rpx;
  207. .info_box {
  208. display: flex;
  209. align-items: center;
  210. .box_key {
  211. width: 130rpx;
  212. color: #808080;
  213. }
  214. .box_value {
  215. color: #383838;
  216. }
  217. }
  218. }
  219. }
  220. .progress {
  221. box-sizing: border-box;
  222. padding: 0 30rpx;
  223. margin-top: 20rpx;
  224. background-color: #fff;
  225. .progress_title {
  226. display: flex;
  227. align-items: center;
  228. height: 89rpx;
  229. font-size: 28rpx;
  230. font-weight: bold;
  231. border-bottom: 1rpx solid #e5e5e5;
  232. }
  233. .progress_body {
  234. padding-top: 22rpx;
  235. padding-bottom: 47rpx;
  236. .body_item {
  237. display: flex;
  238. .item_left {
  239. position: relative;
  240. display: flex;
  241. flex-direction: column;
  242. align-items: center;
  243. padding-right: 20rpx;
  244. width: 100rpx;
  245. border-right: 1rpx dotted #a6a6a6;
  246. .left_top {
  247. font-size: 28rpx;
  248. }
  249. .left_bottom {
  250. font-size: 20rpx;
  251. }
  252. .left_dot {
  253. position: absolute;
  254. top: 18rpx;
  255. right: -8rpx;
  256. width: 16rpx;
  257. height: 16rpx;
  258. border-radius: 50%;
  259. background-color: #096562;
  260. }
  261. }
  262. .item_right {
  263. flex: 1;
  264. margin-top: -10rpx;
  265. margin-left: 30rpx;
  266. padding-bottom: 20rpx;
  267. overflow: hidden;
  268. .right_top {
  269. margin-bottom: 8rpx;
  270. font-weight: bold;
  271. font-size: 28rpx;
  272. }
  273. .right_bottom {
  274. display: flex;
  275. margin-bottom: 12rpx;
  276. font-size: 24rpx;
  277. color: #808080;
  278. .bottom_key {
  279. width: 75rpx;
  280. }
  281. .bottom_value {
  282. flex: 1;
  283. display: grid;
  284. grid-template-columns: repeat(auto-fill, 103rpx);
  285. gap: 12rpx;
  286. img {
  287. width: 103rpx;
  288. height: 122rpx;
  289. border-radius: 5rpx;
  290. }
  291. .video {
  292. width: 120rpx;
  293. height: 122rpx;
  294. border-radius: 5rpx;
  295. }
  296. }
  297. }
  298. }
  299. }
  300. }
  301. }
  302. .foot {
  303. display: flex;
  304. justify-content: space-between;
  305. box-sizing: border-box;
  306. padding: 66rpx 30rpx;
  307. font-size: 28rpx;
  308. .btn_phone {
  309. display: flex;
  310. justify-content: center;
  311. align-items: center;
  312. width: 330rpx;
  313. height: 84rpx;
  314. color: #096562;
  315. border-radius: 22rpx;
  316. border: 1rpx solid #096562;
  317. }
  318. .btn_finish {
  319. display: flex;
  320. justify-content: center;
  321. align-items: center;
  322. width: 330rpx;
  323. height: 84rpx;
  324. color: #fff;
  325. border-radius: 22rpx;
  326. background-color: #096562;
  327. }
  328. }
  329. }
  330. </style>