record-details.vue 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324
  1. <template>
  2. <view class="container qualifications" :style="{ paddingBottom: isIphoneX ? '68rpx' : '0' }">
  3. <view class="remarks-content">
  4. <view class="list-view-title">
  5. <view class="list-view-h1"
  6. >咨询人:<text>{{ remarksParams.questionMan }}</text></view
  7. >
  8. </view>
  9. <view class="list-view-title">
  10. <view class="list-view-h1"
  11. >咨询类别:{{ remarksParams.consultBack ? remarksParams.consultBack : '无' }}</view
  12. >
  13. </view>
  14. <view class="list-view-title">
  15. <view class="list-view-h1">
  16. 机构类型:<text>{{ remarksParams.clubType ? remarksParams.clubType : '无' }}</text>
  17. </view>
  18. </view>
  19. <view class="list-view-title"> <view class="list-view-h1">关键词记录:</view> </view>
  20. <view class="tui-remarks-content">
  21. <text class="tui-remarks-span" v-for="(label, labelIndex) in remarksParams.remarks" :key="labelIndex">
  22. {{ label.label }}
  23. </text>
  24. </view>
  25. <view class="list-view-title">
  26. <view class="list-view-h1"
  27. >价格敏感度:<text>{{ remarksParams.pinceSensitve | pinceFilters }}</text>
  28. </view>
  29. </view>
  30. <view class="list-view-title">
  31. <view class="list-view-h1"
  32. >意向程度:<text>{{ remarksParams.satisfied | intenActionsFilters }}</text></view
  33. >
  34. </view>
  35. <view class="list-view-title">
  36. <view class="list-view-h1"
  37. >跟进状态:<text>{{ remarksParams.followup | followupFilters }}</text></view
  38. >
  39. </view>
  40. <view class="list-view-title">
  41. <view class="list-view-h1"
  42. >额外说明:<text>{{ remarksParams.extra ? remarksParams.extra : '无' }}</text></view
  43. >
  44. </view>
  45. <view class="list-view-title" v-if="remarksParams.imageList.length > 0">
  46. <view class="list-view-h1">图片</view>
  47. </view>
  48. <view class="list-view-upload clearfix" v-if="remarksParams.imageList.length > 0">
  49. <view class="photo-item" v-for="(image, imageIndex) in remarksParams.imageList" :key="imageIndex">
  50. <image
  51. :src="image"
  52. mode="aspectFill"
  53. @click.stop="previewImg(remarksParams.imageList, imageIndex)"
  54. ></image>
  55. </view>
  56. </view>
  57. <view class="list-view-title" v-if="remarksParams.fileList.length > 0">
  58. <view class="list-view-h1">文件</view>
  59. </view>
  60. <view
  61. class="list-view"
  62. v-for="(file, fileIndex) in remarksParams.fileList"
  63. :key="fileIndex"
  64. v-if="remarksParams.fileList.length > 0"
  65. >
  66. <view class="list-view-text">
  67. <view class="input">{{ file.fileName }}</view>
  68. <view class="delbtn" @click.stop="previewFile(file)">预览</view>
  69. <!-- <view class="delbtn down" @click.stop="previewFile(file)">下载</view> -->
  70. </view>
  71. </view>
  72. </view>
  73. </view>
  74. </template>
  75. <script>
  76. import { mapState, mapMutations } from 'vuex'
  77. import authorize from '@/common/config/authorize.js'
  78. import { uploadFileImage, uploadFilePdfDocDocx } from '@/services/public.js'
  79. var isPreviewImg
  80. export default {
  81. data() {
  82. return {
  83. isIphoneX: this.$store.state.isIphoneX,
  84. productActions: [],
  85. remarksParams: {},
  86. remarksId: 0,
  87. categorys: '产品,二手,耗材'
  88. }
  89. },
  90. onLoad(option) {
  91. console.log(option)
  92. this.remarksId = option.remarksId
  93. this.getUserRemarksVisitDetail()
  94. },
  95. filters: {
  96. followupFilters(value) {
  97. // 订单来源
  98. const map = {
  99. 1: '跟进中',
  100. 2: '跟进完成',
  101. 3: '已放弃'
  102. }
  103. return map[value]
  104. },
  105. pinceFilters(value) {
  106. // 意向
  107. const map = {
  108. 1: '敏感',
  109. 2: '适中',
  110. 3: '不敏感',
  111. 4: '不明确'
  112. }
  113. return map[value]
  114. },
  115. intenActionsFilters(value) {
  116. // 意向
  117. const map = {
  118. 1: '意向强烈',
  119. 2: '意向一般',
  120. 3: '意向平淡',
  121. 4: '随便看看'
  122. }
  123. return map[value]
  124. }
  125. },
  126. methods: {
  127. ...mapMutations(['login']),
  128. getUserRemarksVisitDetail() {
  129. //资料详情
  130. this.UserService.getUserRemarksVisitDetail({
  131. remarksId: this.remarksId
  132. })
  133. .then(response => {
  134. this.remarksParams = response.data
  135. })
  136. .catch(error => {
  137. this.$util.msg(error.msg, 2000)
  138. })
  139. },
  140. previewImg(image, index) {
  141. //顶部商品图片预览
  142. isPreviewImg = true
  143. let previewUrls = image
  144. uni.previewImage({
  145. current: index, //图片索引
  146. urls: previewUrls, //必须是http图片,本地图片无效
  147. longPressActions: ''
  148. })
  149. },
  150. previewFile(file) {
  151. //预览文件
  152. this.openDocument(file)
  153. },
  154. openDocument(file) {
  155. // 打开文档
  156. uni.showLoading({
  157. title: '加载中'
  158. })
  159. // 获取文件后缀
  160. const index = file.fileName.lastIndexOf('.')
  161. const suffix = file.fileName.substring(index + 1)
  162. // 下载文件
  163. uni.downloadFile({
  164. url: file.fileUrl,
  165. success(res) {
  166. const filePath = res.tempFilePath
  167. console.log(filePath)
  168. // 打开文件
  169. uni.openDocument({
  170. filePath: filePath,
  171. fileType: suffix,
  172. success(res) {
  173. uni.showToast({
  174. icon: 'success',
  175. title: '打开成功',
  176. duration: 1200
  177. })
  178. uni.hideLoading()
  179. },
  180. fail(err) {
  181. if (err.errMsg.indexOf('fail filetype not supported')) {
  182. uni.showModal({
  183. content: '不支持的文件预览',
  184. cancelColor: '#666',
  185. confirmColor: '#E15616'
  186. })
  187. }
  188. uni.hideLoading()
  189. }
  190. })
  191. },
  192. fail(err) {
  193. uni.showToast({
  194. title: JSON.stringify(err),
  195. icon: 'none',
  196. duration: 5000
  197. })
  198. uni.hideLoading()
  199. }
  200. })
  201. }
  202. },
  203. onShow() {}
  204. }
  205. </script>
  206. <style lang="scss">
  207. page {
  208. height: auto;
  209. background: #ffffff;
  210. }
  211. .remarks-content {
  212. width: 100%;
  213. height: auto;
  214. box-sizing: border-box;
  215. padding: 0 24rpx;
  216. padding-bottom: 80rpx;
  217. .list-view-title {
  218. width: 100%;
  219. height: auto;
  220. margin-bottom: 16rpx;
  221. margin-top: 40rpx;
  222. .list-view-h1 {
  223. line-height: 40rpx;
  224. font-size: $font-size-30;
  225. color: #333333;
  226. text-align: left;
  227. font-weight: bold;
  228. text {
  229. color: #666666;
  230. font-weight: normal;
  231. }
  232. }
  233. }
  234. .tui-remarks-content {
  235. width: 100%;
  236. height: auto;
  237. margin-bottom: 24rpx;
  238. .tui-remarks-span {
  239. height: 48rpx;
  240. line-height: 48rpx;
  241. text-align: center;
  242. padding: 0 20rpx;
  243. background-color: #f7f7f7;
  244. font-size: $font-size-26;
  245. color: #666666;
  246. border-radius: 25rpx;
  247. display: inline-block;
  248. margin-right: 24rpx;
  249. margin-bottom: 24rpx;
  250. &:nth-child(4n) {
  251. margin-right: none;
  252. }
  253. }
  254. }
  255. .list-view {
  256. width: 100%;
  257. height: auto;
  258. margin-top: 20rpx;
  259. .list-view-text {
  260. width: 100%;
  261. float: left;
  262. .input {
  263. width: 500rpx;
  264. height: 50rpx;
  265. box-sizing: border-box;
  266. line-height: 50rpx;
  267. color: #333333;
  268. text-overflow: ellipsis;
  269. overflow: hidden;
  270. display: -webkit-box;
  271. -webkit-line-clamp: 1;
  272. line-clamp: 1;
  273. -webkit-box-orient: vertical;
  274. float: left;
  275. font-size: 26rpx;
  276. }
  277. .delbtn {
  278. width: 96rpx;
  279. height: 44rpx;
  280. border-radius: 8rpx;
  281. font-size: $font-size-24;
  282. color: #e15616;
  283. line-height: 44rpx;
  284. text-align: center;
  285. float: left;
  286. &.down {
  287. color: #1890f9;
  288. }
  289. }
  290. }
  291. }
  292. .list-view-upload {
  293. width: 100%;
  294. height: auto;
  295. .photo-item {
  296. display: inline-block;
  297. width: 112rpx;
  298. height: 112rpx;
  299. margin: 10rpx 0;
  300. margin-right: 25rpx;
  301. border-radius: 10rpx;
  302. border: 1px solid #f5f5f5;
  303. position: relative;
  304. float: left;
  305. image {
  306. width: 112rpx;
  307. height: 112rpx;
  308. border-radius: 10rpx;
  309. }
  310. }
  311. .photo-list {
  312. width: 100%;
  313. height: 116rpx;
  314. overflow: hidden;
  315. white-space: nowrap;
  316. display: flex;
  317. align-items: flex-start;
  318. }
  319. }
  320. }
  321. </style>