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