lookHome.vue 7.4 KB

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