details.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606
  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. <tui-skeleton
  22. v-if="skeletonShow"
  23. backgroundColor="#fafafa"
  24. borderRadius="10rpx"
  25. :isLoading="true"
  26. :loadingType="5"
  27. />
  28. <view class="remarks-content clearfix" v-else>
  29. <view class="list-view-title">
  30. <view class="list-view-h1">
  31. 沟通情况:
  32. <template v-if="remarksParams.communicationSituation === 0">
  33. <text>已沟通</text>
  34. <text v-if="remarksParams.communicationMethods === 1"> (电话) </text>
  35. <text v-if="remarksParams.communicationMethods === 2"> (微信) </text>
  36. <text v-if="remarksParams.communicationMethods ==='1,2' || remarksParams.communicationMethods ==='2,1'"> (电话,微信) </text>
  37. </template>
  38. <template v-else>
  39. <text> 联系不上 </text>
  40. </template>
  41. </view>
  42. </view>
  43. <view class="list-view-title">
  44. <view class="list-view-h1"
  45. >咨询人:<text> {{ remarksParams.questionMan }} </text></view
  46. >
  47. </view>
  48. <view class="list-view-title" v-if="remarksParams.consultBack">
  49. <view class="list-view-h1">
  50. 咨询类别:<text>{{ remarksParams.consultBack ? remarksParams.consultBack : '无' }}</text>
  51. </view>
  52. </view>
  53. <view class="list-view-title" v-if="remarksParams.customerSource">
  54. <view class="list-view-h1">
  55. 客户来源:
  56. <text>{{ remarksParams.customerSource | sourceActionsFilters }}</text>
  57. </view>
  58. </view>
  59. <view class="list-view-title" v-if="remarksParams.customerGender">
  60. <view class="list-view-h1">
  61. 客户性别:
  62. <text>{{ remarksParams.customerGender | genderActionsFilters }}</text>
  63. </view>
  64. </view>
  65. <view class="list-view-title" v-if="remarksParams.customerAge">
  66. <view class="list-view-h1">
  67. 客户年龄:
  68. <text>{{ remarksParams.customerAge }}</text>
  69. </view>
  70. </view>
  71. <view class="list-view-title" v-if="remarksParams.groupAddition">
  72. <view class="list-view-h1">
  73. 加群情况:
  74. <text>{{ remarksParams.groupAddition | additiveActionsFilters }}</text>
  75. </view>
  76. </view>
  77. <view class="list-view-title" v-if="remarksParams.productName"> <view class="list-view-h1">咨询商品:</view> </view>
  78. <view class="tui-remarks-content" v-if="remarksParams.productName">
  79. <view class="tui-remarks-goods">
  80. <view class="goods-image"> <image :src="remarksParams.mainImage" mode=""></image> </view>
  81. <view class="goods-main">
  82. <view class="name"> {{ remarksParams.productName }} </view>
  83. <view class="shop"> 供应商:{{ remarksParams.shopName }} </view>
  84. </view>
  85. </view>
  86. </view>
  87. <template v-if="labelsList.length>0">
  88. <view class="list-view-title"> <view class="list-view-h1">标签记录:</view> </view>
  89. <view class="tui-remarks-content">
  90. <text class="tui-remarks-span" v-for="(label, labelIndex) in labelsList" :key="labelIndex">
  91. {{ label.label }}
  92. </text>
  93. </view>
  94. </template>
  95. <view class="list-view-title" v-if="remarksParams.status">
  96. <view class="list-view-h1"
  97. >关联报备:<text>{{ remarksParams.reportText }}</text></view
  98. >
  99. </view>
  100. <view class="tui-remarks-content" v-if="remarksParams.status">
  101. <view class="tui-remarks-text">
  102. <view
  103. class="txt"
  104. :class="{
  105. reviewed: remarksParams.status == 1,
  106. approved: remarksParams.status == 2,
  107. failed: remarksParams.status == 3
  108. }"
  109. >{{ remarksParams.status | statusFilters }}</view
  110. >
  111. <view class="txm" v-if="remarksParams.auditText">{{ remarksParams.auditText }}</view>
  112. </view>
  113. </view>
  114. <view class="list-view-title" v-if="remarksParams.pinceSensitve">
  115. <view class="list-view-h1"
  116. >价格敏感度:<text>{{ remarksParams.pinceSensitve | pinceFilters }}</text>
  117. </view>
  118. </view>
  119. <view class="list-view-title" v-if="remarksParams.satisfied">
  120. <view class="list-view-h1"
  121. >意向程度:<text>{{ remarksParams.satisfied | intenActionsFilters }}</text></view
  122. >
  123. </view>
  124. <view class="list-view-title" v-if="remarksParams.followup">
  125. <view class="list-view-h1"
  126. >跟进状态:<text>{{ remarksParams.followup | followupFilters }}</text></view
  127. >
  128. </view>
  129. <view class="list-view-title" v-if="remarksParams.extra">
  130. <view class="list-view-h1"
  131. >额外说明:<text>{{ remarksParams.extra ? remarksParams.extra : '无' }}</text></view
  132. >
  133. </view>
  134. <view class="list-view-title" v-if="remarksParams.imageList.length > 0">
  135. <view class="list-view-h1">图片</view>
  136. </view>
  137. <view class="list-view-upload clearfix" v-if="remarksParams.imageList.length > 0">
  138. <view class="photo-item" v-for="(image, imageIndex) in remarksParams.imageList" :key="imageIndex">
  139. <image
  140. :src="image"
  141. mode="aspectFill"
  142. @click.stop="previewImg(remarksParams.imageList, imageIndex)"
  143. ></image>
  144. </view>
  145. </view>
  146. <view class="list-view-title" v-if="remarksParams.fileList.length > 0">
  147. <view class="list-view-h1">文件</view>
  148. </view>
  149. <view
  150. class="list-view"
  151. v-for="(file, fileIndex) in remarksParams.fileList"
  152. :key="fileIndex"
  153. v-if="remarksParams.fileList.length > 0"
  154. >
  155. <view class="list-view-text">
  156. <view class="input">{{ file.fileName }}</view>
  157. <view class="delbtn" @click.stop="previewFile(file)">预览</view>
  158. <!-- <view class="delbtn down" @click.stop="downloadFile(file)">下载</view> -->
  159. </view>
  160. </view>
  161. </view>
  162. </view>
  163. </template>
  164. <script>
  165. import { mapState, mapMutations } from 'vuex'
  166. import authorize from '@/common/config/authorize.js'
  167. import { uploadFileImage, uploadFilePdfDocDocx } from '@/services/public.js'
  168. var isPreviewImg
  169. export default {
  170. data() {
  171. return {
  172. isIphoneX: this.$store.state.isIphoneX,
  173. productActions: [],
  174. remarksParams: {},
  175. remarksId: 0,
  176. clubUserId: 0,
  177. clubInfo: {},
  178. userInfo: {},
  179. categorys: '',
  180. skeletonShow:true,
  181. labelsList:[]
  182. }
  183. },
  184. onLoad(option) {
  185. console.log(option)
  186. this.remarksId = option.remarksId
  187. this.getUserClubRemarksDetail()
  188. },
  189. filters: {
  190. statusFilters(value) {
  191. // 订单来源
  192. const map = {
  193. 1: '报备待审核',
  194. 2: '报备审核通过',
  195. 3: '报备审核未通过'
  196. }
  197. return map[value]
  198. },
  199. followupFilters(value) {
  200. // 订单来源
  201. const map = {
  202. 1: '跟进中',
  203. 2: '跟进完成',
  204. 3: '已放弃'
  205. }
  206. return map[value]
  207. },
  208. pinceFilters(value) {
  209. // 意向
  210. const map = {
  211. 1: '敏感',
  212. 2: '适中',
  213. 3: '不敏感',
  214. 4: '不明确'
  215. }
  216. return map[value]
  217. },
  218. intenActionsFilters(value) {
  219. // 意向
  220. const map = {
  221. 1: '意向强烈',
  222. 2: '意向一般',
  223. 3: '意向平淡',
  224. 4: '随便看看'
  225. }
  226. return map[value]
  227. },
  228. sourceActionsFilters(value) {
  229. // 客户来源
  230. const map = {
  231. 0: '搜素引擎',
  232. 1: '小程序',
  233. 2: '公众号',
  234. 3: '小红书',
  235. 4: '微博',
  236. 5: '搜狐',
  237. 7: '抖音',
  238. 8: '视频号',
  239. 9: '朋友推荐',
  240. 6: '其他',
  241. }
  242. return map[value]
  243. },
  244. genderActionsFilters(value) {
  245. // 客户性别
  246. const map = {
  247. 0: '男',
  248. 1: '女'
  249. }
  250. return map[value]
  251. },
  252. additiveActionsFilters(value) {
  253. // 加群情况
  254. const map = {
  255. 0: '已加群',
  256. 1: '未加群'
  257. }
  258. return map[value]
  259. }
  260. },
  261. methods: {
  262. ...mapMutations(['login']),
  263. async getUserClubRemarksDetail() {
  264. //备注详情
  265. try{
  266. const res = await this.UserService.getUserClubRemarksDetail({ remarksId: this.remarksId })
  267. const data = res.data
  268. this.remarksParams = data
  269. const remarks = data.remarks ? data.remarks :[]
  270. const stateKeyword = data.stateKeyword ? data.stateKeyword :[]
  271. const trendsKeyword = data.trendsKeyword ? data.trendsKeyword :[]
  272. this.labelsList = [...remarks,...stateKeyword,...trendsKeyword]
  273. this.clubUserId = res.data.userId
  274. this.getCulbInfo(res.data.userId)
  275. setTimeout(()=>{
  276. this.skeletonShow = false
  277. },500)
  278. }catch(error){
  279. this.$util.msg(error.msg, 2000)
  280. }
  281. },
  282. getCulbInfo(userId) {
  283. // 查询机构信息
  284. this.UserService.OrganizationUpdateModifyInfo({ userId: userId })
  285. .then(response => {
  286. this.clubInfo = response.data.club
  287. this.userInfo = response.data.user
  288. })
  289. .catch(error => {
  290. console.log('=============>', error.msg)
  291. })
  292. },
  293. previewImg(image, index) {
  294. //顶部商品图片预览
  295. isPreviewImg = true
  296. let previewUrls = image
  297. uni.previewImage({
  298. current: index, //图片索引
  299. urls: previewUrls, //必须是http图片,本地图片无效
  300. longPressActions: ''
  301. })
  302. },
  303. previewFile(file) {
  304. //预览文件
  305. this.openDocument(file)
  306. },
  307. openDocument(file) {
  308. // 打开文档
  309. uni.showLoading({ title: '加载中' })
  310. // 获取文件后缀
  311. const index = file.fileName.lastIndexOf('.')
  312. const suffix = file.fileName.substring(index + 1)
  313. // 下载文件
  314. uni.downloadFile({
  315. url: file.fileUrl,
  316. success(res) {
  317. const filePath = res.tempFilePath
  318. // 打开文件
  319. uni.openDocument({
  320. filePath: filePath,
  321. fileType: suffix,
  322. success(res) {
  323. uni.showToast({
  324. icon: 'success',
  325. title: '打开成功',
  326. duration: 1200
  327. })
  328. uni.hideLoading()
  329. },
  330. fail(err) {
  331. if (err.errMsg.indexOf('fail filetype not supported')) {
  332. uni.showModal({
  333. content: '不支持的文件预览',
  334. cancelColor: '#666',
  335. confirmColor: '#FF5B00'
  336. })
  337. }
  338. uni.hideLoading()
  339. }
  340. })
  341. },
  342. fail(err) {
  343. uni.showToast({
  344. title: JSON.stringify(err),
  345. icon: 'none',
  346. duration: 5000
  347. })
  348. uni.hideLoading()
  349. }
  350. })
  351. },
  352. downloadFile(file) {
  353. let self = this
  354. // 下载文件
  355. wx.downloadFile({
  356. url: file.fileUrl,
  357. success(res) {
  358. console.log('保存文件路勁============>', res.tempFilePath)
  359. wx.saveFile({
  360. tempFilePath: res.tempFilePath,
  361. success(res) {
  362. self.$util.msg('下载成功', 2000)
  363. setTimeout(() => {
  364. self.openDocument(file)
  365. }, 2000)
  366. },
  367. fail(error) {
  368. self.$util.msg('下载失败', 2000)
  369. }
  370. })
  371. }
  372. })
  373. },
  374. handleClickClunInfo() {
  375. //修改机构资料
  376. if (this.userInfo.userIdentity === 2) {
  377. this.$api.navigateTo(`/pages/seller/login/apply?userID=${this.userInfo.userId}`)
  378. } else if (this.userInfo.userIdentity === 4) {
  379. this.$api.navigateTo(`/pages/seller/login/information?userID=${this.userInfo.userId}`)
  380. }
  381. }
  382. },
  383. onShow() {}
  384. }
  385. </script>
  386. <style lang="scss">
  387. page {
  388. height: auto;
  389. background: #ffffff;
  390. }
  391. .remarks-content-club {
  392. width: 100%;
  393. height: 252rpx;
  394. padding: 24rpx;
  395. box-sizing: border-box;
  396. border-bottom: 20rpx solid #f7f7f7;
  397. .content-club-le {
  398. width: 660rpx;
  399. float: left;
  400. .club-le-text {
  401. width: 100%;
  402. height: 60rpx;
  403. line-height: 60rpx;
  404. font-size: $font-size-28;
  405. color: #333333;
  406. .label {
  407. color: #999999;
  408. &.phone {
  409. margin-left: 48rpx;
  410. }
  411. }
  412. }
  413. }
  414. .content-club-ri {
  415. width: 40rpx;
  416. height: 160rpx;
  417. float: right;
  418. line-height: 160rpx;
  419. text-align: center;
  420. color: #b2b2b2;
  421. }
  422. }
  423. .remarks-content {
  424. width: 100%;
  425. height: auto;
  426. box-sizing: border-box;
  427. padding: 0 24rpx;
  428. padding-bottom: 80rpx;
  429. .list-view-title {
  430. width: 100%;
  431. height: auto;
  432. margin-bottom: 16rpx;
  433. margin-top: 30rpx;
  434. .list-view-h1 {
  435. line-height: 40rpx;
  436. font-size: $font-size-30;
  437. color: #333333;
  438. text-align: left;
  439. font-weight: bold;
  440. text {
  441. color: #666666;
  442. font-weight: normal;
  443. }
  444. }
  445. }
  446. .tui-remarks-content {
  447. width: 100%;
  448. height: auto;
  449. margin-bottom: 24rpx;
  450. .tui-remarks-text {
  451. width: 100%;
  452. box-sizing: border-box;
  453. background-color: #f7f7f7;
  454. padding: 26rpx;
  455. border-radius: 6rpx;
  456. .txt {
  457. line-height: 36rpx;
  458. color: #0db26d;
  459. font-size: 26rpx;
  460. &.reviewed{
  461. color: #FF5B00;
  462. }
  463. &.approved{
  464. color: #0DB26D;
  465. }
  466. &.failed{
  467. color: #F94B4B;
  468. }
  469. }
  470. .txm {
  471. line-height: 36rpx;
  472. color: #666666;
  473. font-size: 26rpx;
  474. }
  475. }
  476. .tui-remarks-goods {
  477. width: 100%;
  478. height: 180rpx;
  479. box-sizing: border-box;
  480. background-color: #f7f7f7;
  481. padding: 26rpx;
  482. border-radius: 6rpx;
  483. .goods-image {
  484. width: 128rpx;
  485. height: 128rpx;
  486. float: left;
  487. image {
  488. width: 128rpx;
  489. height: 128rpx;
  490. display: block;
  491. border-radius: 4rpx;
  492. }
  493. }
  494. .goods-main {
  495. width: 522rpx;
  496. height: 128rpx;
  497. box-sizing: border-box;
  498. padding: 0 32rpx;
  499. float: right;
  500. .name {
  501. width: 100%;
  502. height: 60rpx;
  503. box-sizing: border-box;
  504. line-height: 60rpx;
  505. color: #333333;
  506. text-overflow: ellipsis;
  507. overflow: hidden;
  508. display: -webkit-box;
  509. -webkit-line-clamp: 1;
  510. line-clamp: 1;
  511. -webkit-box-orient: vertical;
  512. font-size: 26rpx;
  513. }
  514. .shop {
  515. line-height: 60rpx;
  516. color: #999999;
  517. font-size: 26rpx;
  518. }
  519. }
  520. }
  521. .tui-remarks-span {
  522. height: 48rpx;
  523. line-height: 48rpx;
  524. text-align: center;
  525. padding: 0 20rpx;
  526. background-color: #f7f7f7;
  527. font-size: $font-size-26;
  528. color: #666666;
  529. border-radius: 25rpx;
  530. display: inline-block;
  531. margin-right: 24rpx;
  532. margin-bottom: 24rpx;
  533. &:nth-child(4n) {
  534. margin-right: none;
  535. }
  536. }
  537. }
  538. .list-view {
  539. width: 100%;
  540. height: auto;
  541. margin-top: 20rpx;
  542. .list-view-text {
  543. width: 100%;
  544. float: left;
  545. .input {
  546. width: 500rpx;
  547. height: 50rpx;
  548. box-sizing: border-box;
  549. line-height: 50rpx;
  550. color: #333333;
  551. text-overflow: ellipsis;
  552. overflow: hidden;
  553. display: -webkit-box;
  554. -webkit-line-clamp: 1;
  555. line-clamp: 1;
  556. -webkit-box-orient: vertical;
  557. float: left;
  558. font-size: 26rpx;
  559. }
  560. .delbtn {
  561. width: 96rpx;
  562. height: 44rpx;
  563. font-size: $font-size-24;
  564. color: #FF5B00;
  565. line-height: 44rpx;
  566. text-align: center;
  567. float: left;
  568. &.down {
  569. color: #1890f9;
  570. }
  571. }
  572. }
  573. }
  574. .list-view-upload {
  575. width: 100%;
  576. height: auto;
  577. .photo-item {
  578. display: inline-block;
  579. width: 112rpx;
  580. height: 112rpx;
  581. margin: 10rpx 0;
  582. margin-right: 25rpx;
  583. border-radius: 10rpx;
  584. border: 1px solid #f5f5f5;
  585. position: relative;
  586. float: left;
  587. image {
  588. width: 112rpx;
  589. height: 112rpx;
  590. border-radius: 10rpx;
  591. }
  592. }
  593. .photo-list {
  594. width: 100%;
  595. height: 116rpx;
  596. overflow: hidden;
  597. white-space: nowrap;
  598. display: flex;
  599. align-items: flex-start;
  600. }
  601. }
  602. }
  603. </style>