details.vue 8.3 KB

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