live.vue 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275
  1. <template>
  2. <view class="live">
  3. <view class="top">
  4. </view>
  5. <view class="head">
  6. <span class="cuIcon-back" @click="back"></span>
  7. <view class="case">
  8. 实况记录
  9. </view>
  10. </view>
  11. <view class="list">
  12. <view class="car_data">
  13. <view class="fat" v-for="item in form" :key="item.id">
  14. <view class="fat_title">{{item.name}}</view>
  15. <view class="sun" v-for="row in item.categoryList" :key="row.id">
  16. {{row.name}}
  17. <span>{{row.names}}</span>
  18. </view>
  19. </view>
  20. </view>
  21. <!-- 备注信息 -->
  22. <view class="car_data">
  23. <view class="fat">
  24. <view class="fat_title">备注信息</view>
  25. <view class="message" v-for="item in historyList" :key="item.id">
  26. <view class="top">
  27. <view class="left">
  28. <view class="img">
  29. <image :src="item.logo" mode=""></image>
  30. </view>
  31. <view class="name">
  32. {{item.merchantName}}<br />
  33. <span>{{item.createTime}}</span>
  34. </view>
  35. </view>
  36. <view class="play">
  37. <image src="/static/play.png" mode="" @click="play(item)"></image><br />
  38. 12.03
  39. </view>
  40. </view>
  41. <view class="content">
  42. {{item.msgContent}}
  43. </view>
  44. </view>
  45. </view>
  46. </view>
  47. </view>
  48. </view>
  49. </template>
  50. <script>
  51. import configService from '../../../common/service/config.service'
  52. export default {
  53. data() {
  54. return {
  55. taskId: 1,
  56. form: [],
  57. historyList: [{
  58. time: '2025.2.12 13:22:30',
  59. url: 'https://pic.rmb.bdstatic.com/bjh/news/9e4e3aca4eb384cf0ad43e26cae97135.jpeg',
  60. name: '用户昵称',
  61. content: '额外强制消费',
  62. type: 1,
  63. }, ],
  64. audioContext:null
  65. }
  66. },
  67. methods: {
  68. //返回
  69. back() {
  70. uni.navigateBack({
  71. delta: 1
  72. });
  73. },
  74. getLive() {
  75. console.log(this.taskId)
  76. this.$http.get("/merchant/localTsCustomerServiceDict/list?taskId=" + this.taskId + '&source=' + '1').then(
  77. res => {
  78. if (res.data.code == 200) {
  79. this.form = res.data.result
  80. let list = []
  81. this.form.forEach(item => {
  82. let temp = []
  83. item.categoryList.forEach(row => {
  84. if (row.idList.length > 0) {
  85. const idSet = new Set(row.idList);
  86. // Find the names that match the ids in idList
  87. const matchedNames = row.itemList
  88. .filter(item => idSet.has(item.id)) // Filter items where the id matches
  89. .map(item => item.name) // Extract the name from the matching items
  90. .join(','); // Join names with commas
  91. row.names = matchedNames;
  92. temp.push(row)
  93. }
  94. })
  95. item.categoryList = temp
  96. if(item.categoryList.length> 0){
  97. list.push(item)
  98. }
  99. })
  100. this.form = list
  101. }
  102. })
  103. },
  104. play(item){
  105. this.audioContext = uni.createInnerAudioContext();
  106. // this.audioContext.src = configService.apiUrl + '/'+item.recordUrl.split(',')[0];
  107. this.audioContext.src = 'https://your-domain.com/audio/example.mp3'
  108. console.log(this.audioContext)
  109. this.audioContext.play();
  110. },
  111. getHistroyList() {
  112. let data = {
  113. taskId: this.taskId
  114. }
  115. this.$http.post('/merchant/localTsCustomerServiceTaskMsg/queryList', data).then((res) => {
  116. console.log(res);
  117. this.historyList = res.data.result
  118. })
  119. },
  120. },
  121. onLoad(options) {
  122. this.taskId = options.taskId
  123. },
  124. mounted() {
  125. this.getLive()
  126. this.getHistroyList()
  127. }
  128. }
  129. </script>
  130. <style lang="scss" scoped>
  131. .live {
  132. width: 100vw;
  133. height: 100vh;
  134. background: #F8F8FA;
  135. display: flex;
  136. flex-direction: column;
  137. // overflow-y: auto;
  138. /*#ifdef APP-PLUS*/
  139. .top {
  140. width: 100%;
  141. height: var(--status-bar-height);
  142. background: #FFFFFF;
  143. }
  144. /*#endif*/
  145. .head {
  146. width: 100%;
  147. height: 112rpx;
  148. padding: 20rpx;
  149. display: flex;
  150. align-items: center;
  151. background: #FFFFFF;
  152. position: relative;
  153. .cuIcon-back {
  154. font-size: 40rpx;
  155. margin-right: 40rpx;
  156. }
  157. .case {
  158. position: absolute;
  159. left: 50%;
  160. transform: translateX(-50%);
  161. font-size: 36rpx;
  162. font-weight: 600;
  163. }
  164. }
  165. .list {
  166. flex: 1;
  167. overflow-y: auto;
  168. background: #F7F7F7;
  169. padding: 24rpx 30rpx;
  170. .car_data {
  171. width: 100%;
  172. .fat {
  173. background: #FFFFFF;
  174. padding: 20rpx;
  175. margin-bottom: 20rpx;
  176. border-radius: 10rpx;
  177. .fat_title {
  178. font-weight: 600;
  179. font-size: 30rpx;
  180. color: #333333;
  181. margin-bottom: 20rpx;
  182. }
  183. .sun {
  184. width: 100%;
  185. height: 73rpx;
  186. border-bottom: 1px solid #eee;
  187. display: flex;
  188. align-items: center;
  189. justify-content: space-between;
  190. font-size: 28rpx;
  191. color: #666666;
  192. span {
  193. color: #181818;
  194. }
  195. }
  196. .message {
  197. border-bottom: 1px solid #eee;
  198. padding-bottom: 16rpx;
  199. margin-bottom: 16rpx;
  200. .top {
  201. width: 100%;
  202. display: flex;
  203. align-items: center;
  204. justify-content: space-between;
  205. margin-bottom: 12rpx;
  206. .left {
  207. display: flex;
  208. align-items: center;
  209. .img {
  210. width: 68rpx;
  211. height: 68rpx;
  212. border-radius: 8rpx;
  213. overflow: hidden;
  214. margin-right: 12rpx;
  215. image {
  216. width: 100%;
  217. height: 100%;
  218. }
  219. }
  220. .name {
  221. font-size: 28rpx;
  222. color: #000000;
  223. span {
  224. font-size: 24rpx;
  225. color: #999999
  226. }
  227. }
  228. }
  229. .play {
  230. font-size: 24rpx;
  231. color: #000000;
  232. text-align: center;
  233. image {
  234. width: 40rpx;
  235. height: 40rpx;
  236. }
  237. }
  238. }
  239. .content {
  240. font-size: 26rpx;
  241. }
  242. }
  243. }
  244. }
  245. }
  246. }
  247. </style>