complaintProgress.vue 7.8 KB

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