details.vue 8.1 KB

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