lookHome.vue 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287
  1. <template>
  2. <view class="content">
  3. <u-loading-page loading-mode='spinner' image="/static/imgs/logo.png" iconSize='60' :loading='loading'></u-loading-page>
  4. <view v-if='!loading'>
  5. <view v-if='fileList.length>0||companyData.companyName||companyData.companyIntroduction||companyData.scopeOfBusiness||companyData.companyAddress||companyData.phone||companyData.portraiture||companyData.postbox'>
  6. <view v-if='fileList.length>0' class="swiper-wrap">
  7. <u-swiper :list="fileList"
  8. autoplay
  9. imgMode='aspectFill'
  10. height='260'
  11. circular
  12. @change="e => current = e.current" @click="click">
  13. <view slot="indicator" class="indicator">
  14. <view
  15. class="indicator__dot"
  16. v-for="(item, index) in fileList"
  17. :key="index"
  18. :class="[index === current && 'indicator__dot--active']">
  19. </view>
  20. </view>
  21. </u-swiper>
  22. </view>
  23. <view v-if='companyData.companyName' class="company-title row flex flex-between line" >
  24. <view class='title' >{{companyData.companyName}}</view>
  25. </view>
  26. <view v-if='companyData.companyIntroduction||companyData.scopeOfBusiness||companyData.companyAddress||companyData.phone||companyData.portraiture||companyData.postbox' class="content1" >
  27. <view v-if='companyData.companyIntroduction' class="intro top-m">
  28. <view class="title">基本信息</view>
  29. <view class='content'>{{companyData.companyIntroduction}}</view>
  30. </view>
  31. <view v-if='companyData.scopeOfBusiness' class="scope top-m">
  32. <view class="title">业务范围</view>
  33. <view class='content'>{{companyData.scopeOfBusiness}}</view>
  34. </view>
  35. <view v-if='companyData.companyAddress||companyData.phone||companyData.portraiture||companyData.postbox' class='compInformation' >
  36. <view v-if="companyData.companyAddress" class="row flex top-m align-item-center">
  37. <view class='image-wrap'>
  38. <image style='width:24rpx;height:31rpx;' src="../../static/imgs/mySet/home/address.png" mode=""></image>
  39. </view>
  40. <view>地址:{{companyData.companyAddress}}</view>
  41. </view>
  42. <view v-if="companyData.phone" class="row flex top-m align-item-center">
  43. <view class='image-wrap'>
  44. <image style='width:27rpx;height:28rpx;' src="../../static/imgs/mySet/home/phone.png" mode=""></image>
  45. </view>
  46. <view>电话:{{companyData.phone}}</view>
  47. </view>
  48. <view v-if="companyData.portraiture" class="row flex top-m align-item-center">
  49. <view class='image-wrap'>
  50. <image style='width:27rpx;height:28rpx;' src="../../static/imgs/mySet/home/portraiture.png" mode=""></image>
  51. </view>
  52. <view>座机:{{companyData.portraiture}}</view>
  53. </view>
  54. <view v-if="companyData.postbox" class="row flex top-m align-item-center">
  55. <view class='image-wrap'>
  56. <image style='width:29rpx;height:25rpx;' src="../../static/imgs/mySet/home/postbox.png" mode=""></image>
  57. </view>
  58. <view>邮箱:{{companyData.postbox}}</view>
  59. </view>
  60. </view>
  61. </view>
  62. </view>
  63. <view style='position:relative;height:100vh;' v-if='fileList.length==0&&!companyData.companyName&&!companyData.companyIntroduction&&!companyData.scopeOfBusiness&&!companyData.companyAddress&&!companyData.phone&&!companyData.portraiture&&!companyData.postbox'>
  64. <image class='notavailable' src="../../static/imgs/notavailable.png" mode=""></image>
  65. </view>
  66. </view>
  67. <u-toast ref="uToast"></u-toast>
  68. </view>
  69. </template>
  70. <script>
  71. import uploadImage from '@/components/ossutil/uploadFile.js';
  72. export default {
  73. data() {
  74. return {
  75. companyData:{
  76. commonId:''
  77. },
  78. userInfo:{},
  79. fileList:[],
  80. fileList1:[],
  81. editstatus:false,
  82. id:'',
  83. current:0,
  84. loading:true,
  85. }
  86. },
  87. onLoad(options) {
  88. this.id=options.id
  89. uni.showLoading({
  90. title: '数据加载中'
  91. })
  92. this.getList()
  93. },
  94. onShow() {
  95. this.userInfo = uni.getStorageSync("userInfo")
  96. this.companyData.commonId=uni.getStorageSync("userInfo").id
  97. console.log(1111111111)
  98. // this.getList()
  99. },
  100. onUnload(){
  101. this.id=''
  102. },
  103. methods: {
  104. getList(){
  105. var that=this
  106. var data={}
  107. if(this.id){
  108. data={
  109. id:this.id,
  110. }
  111. }
  112. this.$request.baseRequest('admin.unimall.personalHomepageInfo', 'get',data, failres => {
  113. console.log('res+++++', failres.errmsg)
  114. uni.showToast({
  115. icon:"none",
  116. title: failres.errmsg,
  117. duration: 3000
  118. });
  119. uni.hideLoading()
  120. }).then(res => {
  121. console.log(res)
  122. this.companyData=res.data
  123. if(res.data.addressUrl){
  124. var arr=res.data.addressUrl.split(',')
  125. this.fileList1=[]
  126. for(var i=0;i<arr.length;i++){
  127. if(arr[i]){
  128. this.fileList1.push({url:arr[i]})
  129. }
  130. }
  131. this.fileList=arr
  132. }else{
  133. this.fileList1=[]
  134. this.fileList=[]
  135. }
  136. setTimeout(()=>{
  137. that.loading=false
  138. },1000)
  139. // if (res.errno == 200) {
  140. uni.hideLoading()
  141. // }
  142. })
  143. },
  144. change(){
  145. },
  146. click(index){
  147. console.log(index)
  148. uni.previewImage({
  149. current: index, // 当前显示图片的索引值
  150. urls: this.fileList, // 需要预览的图片列表,photoList要求必须是数组
  151. loop:true, // 是否可循环预览
  152. })
  153. },
  154. }
  155. }
  156. </script>
  157. <style scoped lang="scss">
  158. /deep/.u-border {
  159. border-color: #E6E6E6!important;
  160. }
  161. .content{
  162. }
  163. .indicator {
  164. background:rgba(10, 23, 61, 0.5);
  165. padding: 9rpx 5rpx;
  166. border-radius: 20rpx;
  167. @include flex(row);
  168. justify-content: center;
  169. &__dot {
  170. height: 6px;
  171. width: 6px;
  172. border-radius: 100px;
  173. background-color: rgba(255, 255, 255, 0.5);
  174. margin: 0 5px;
  175. transition: background-color 0.3s;
  176. &--active {
  177. background-color: #ffffff;
  178. }
  179. }
  180. }
  181. .top{
  182. width: 100vw;
  183. height: 135rpx;
  184. background: #112253;
  185. border-radius: 0px 0px 20rpx 20rpx;
  186. }
  187. .content1{
  188. margin: 0rpx 0 120rpx 0;
  189. background-color: #fff;
  190. border-radius: 20rpx 20rpx 0 0;
  191. padding:10rpx 20rpx;
  192. box-sizing: border-box;
  193. .row{
  194. padding-bottom: 24rpx;
  195. }
  196. .line{
  197. border-bottom: 1px solid #E6E6E6;
  198. }
  199. .top-m{
  200. margin-top: 24rpx;
  201. }
  202. .qyfc{
  203. margin: 24rpx 0;
  204. }
  205. }
  206. .content1-edit{
  207. position: relative;
  208. top: -230rpx;
  209. margin: 20rpx 20rpx 120rpx 20rpx;
  210. border-radius: 20rpx;
  211. padding:20rpx;
  212. }
  213. .footer{
  214. position: fixed;
  215. bottom: 80rpx;
  216. width: calc(100% - 40rpx);
  217. padding: 0 20rpx;
  218. z-index: 999;
  219. }
  220. .button{
  221. color: #fff;
  222. background-color: #112253;
  223. border-radius: 20rpx;
  224. padding:10rpx;
  225. font-size:28rpx;
  226. }
  227. .company-title{
  228. margin:30rpx 20rpx;
  229. .button{
  230. padding:10rpx 20rpx;
  231. width:96rpx;
  232. }
  233. }
  234. .company-title .title{
  235. color:#112253;
  236. font-size:36rpx;
  237. font-weight: bold;
  238. }
  239. .title{
  240. font-size:32rpx;
  241. font-weight: bold;
  242. color: #1A1A1A;
  243. }
  244. .content{
  245. font-size: 28rpx;
  246. font-weight: 500;
  247. color: #666666;
  248. }
  249. .compInformation{
  250. margin:20rpx 0;
  251. background:#F7F7F7;
  252. color:#112253;
  253. font-size: 28rpx;
  254. font-weight: 500;
  255. padding:10rpx 30rpx;
  256. border-radius:20rpx;
  257. }
  258. .image-wrap{
  259. width:50rpx;
  260. position:relative;
  261. top:2rpx;
  262. }
  263. .input-title{
  264. margin-right:10rpx;
  265. }
  266. .notavailable{
  267. width:252rpx;height:348rpx;
  268. position: absolute;
  269. top: 50%;
  270. left: 50%;
  271. transform: translateX(-50%) translateY(-50%);
  272. }
  273. </style>