details.vue 8.4 KB

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