lookHome.vue 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285
  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. this.$refs.uToast.show({
  114. type: 'error',
  115. message: failres.errmsg,
  116. })
  117. uni.hideLoading()
  118. }).then(res => {
  119. console.log(res)
  120. this.companyData=res.data
  121. if(res.data.addressUrl){
  122. var arr=res.data.addressUrl.split(',')
  123. this.fileList1=[]
  124. for(var i=0;i<arr.length;i++){
  125. if(arr[i]){
  126. this.fileList1.push({url:arr[i]})
  127. }
  128. }
  129. this.fileList=arr
  130. }else{
  131. this.fileList1=[]
  132. this.fileList=[]
  133. }
  134. setTimeout(()=>{
  135. that.loading=false
  136. },1000)
  137. // if (res.errno == 200) {
  138. uni.hideLoading()
  139. // }
  140. })
  141. },
  142. change(){
  143. },
  144. click(index){
  145. console.log(index)
  146. uni.previewImage({
  147. current: index, // 当前显示图片的索引值
  148. urls: this.fileList, // 需要预览的图片列表,photoList要求必须是数组
  149. loop:true, // 是否可循环预览
  150. })
  151. },
  152. }
  153. }
  154. </script>
  155. <style scoped lang="scss">
  156. /deep/.u-border {
  157. border-color: #E6E6E6!important;
  158. }
  159. .content{
  160. }
  161. .indicator {
  162. background:rgba(10, 23, 61, 0.5);
  163. padding: 9rpx 5rpx;
  164. border-radius: 20rpx;
  165. @include flex(row);
  166. justify-content: center;
  167. &__dot {
  168. height: 6px;
  169. width: 6px;
  170. border-radius: 100px;
  171. background-color: rgba(255, 255, 255, 0.5);
  172. margin: 0 5px;
  173. transition: background-color 0.3s;
  174. &--active {
  175. background-color: #ffffff;
  176. }
  177. }
  178. }
  179. .top{
  180. width: 100vw;
  181. height: 135rpx;
  182. background: #112253;
  183. border-radius: 0px 0px 20rpx 20rpx;
  184. }
  185. .content1{
  186. margin: 0rpx 0 120rpx 0;
  187. background-color: #fff;
  188. border-radius: 20rpx 20rpx 0 0;
  189. padding:10rpx 20rpx;
  190. box-sizing: border-box;
  191. .row{
  192. padding-bottom: 24rpx;
  193. }
  194. .line{
  195. border-bottom: 1px solid #E6E6E6;
  196. }
  197. .top-m{
  198. margin-top: 24rpx;
  199. }
  200. .qyfc{
  201. margin: 24rpx 0;
  202. }
  203. }
  204. .content1-edit{
  205. position: relative;
  206. top: -230rpx;
  207. margin: 20rpx 20rpx 120rpx 20rpx;
  208. border-radius: 20rpx;
  209. padding:20rpx;
  210. }
  211. .footer{
  212. position: fixed;
  213. bottom: 80rpx;
  214. width: calc(100% - 40rpx);
  215. padding: 0 20rpx;
  216. z-index: 999;
  217. }
  218. .button{
  219. color: #fff;
  220. background-color: #112253;
  221. border-radius: 20rpx;
  222. padding:10rpx;
  223. font-size:28rpx;
  224. }
  225. .company-title{
  226. margin:30rpx 20rpx;
  227. .button{
  228. padding:10rpx 20rpx;
  229. width:96rpx;
  230. }
  231. }
  232. .company-title .title{
  233. color:#112253;
  234. font-size:36rpx;
  235. font-weight: bold;
  236. }
  237. .title{
  238. font-size:32rpx;
  239. font-weight: bold;
  240. color: #1A1A1A;
  241. }
  242. .content{
  243. font-size: 28rpx;
  244. font-weight: 500;
  245. color: #666666;
  246. }
  247. .compInformation{
  248. margin:20rpx 0;
  249. background:#F7F7F7;
  250. color:#112253;
  251. font-size: 28rpx;
  252. font-weight: 500;
  253. padding:10rpx 30rpx;
  254. border-radius:20rpx;
  255. }
  256. .image-wrap{
  257. width:50rpx;
  258. position:relative;
  259. top:2rpx;
  260. }
  261. .input-title{
  262. margin-right:10rpx;
  263. }
  264. .notavailable{
  265. width:252rpx;height:348rpx;
  266. position: absolute;
  267. top: 50%;
  268. left: 50%;
  269. transform: translateX(-50%) translateY(-50%);
  270. }
  271. </style>