details.vue 9.7 KB

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