details.vue 7.8 KB

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