about.vue 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  1. <template>
  2. <view class="pages">
  3. <u-navbar
  4. :title="navbarTitle"
  5. :autoBack="true"
  6. :safeAreaInsetTop="true"
  7. >
  8. </u-navbar>
  9. <view class="page-wrap">
  10. <u-subsection
  11. class="subsection"
  12. :customStyle="{height: '66rpx'}"
  13. :list="typeList"
  14. mode="subsection"
  15. activeColor="#00A447"
  16. @change="sectionChange"
  17. :current="curNow"></u-subsection>
  18. <view class="content">
  19. <view class="" v-if="curNow==0">
  20. <!-- <view class="name">贵州旭烁食品有限公司简介</view> -->
  21. <view class="u-content" style="margin-top: 40rpx;">
  22. <u-parse :content="pageData.xsIntro"></u-parse>
  23. </view>
  24. <view class="contact">
  25. <view class="item">联系电话:{{pageData.xsMobile}}</view>
  26. <view class="item">营业世间:{{pageData.xsServiceTime}}</view>
  27. <view class="item">旭烁地址:{{pageData.xsAddress}}</view>
  28. </view>
  29. </view>
  30. <view class="" v-if="curNow==1">
  31. <view class="u-content" style="margin-top: 40rpx;">
  32. <u-parse :content="pageData.shopIntro"></u-parse>
  33. </view>
  34. <view class="contact">
  35. <view class="item">联系电话:{{pageData.shopMobile}}</view>
  36. <view class="item">营业世间:{{pageData.shopServiceTime}}</view>
  37. <view class="item">商行地址:{{pageData.shopAddress}}</view>
  38. </view>
  39. </view>
  40. <!-- <img :src="pageData.uxImg" style="width: 100%;" alt=""> -->
  41. <view class="map-wrap" @click="mapClick">
  42. <map style="width: 100%; height: 340rpx;" :latitude="latitude" :longitude="longitude" :markers="covers"></map>
  43. </view>
  44. </view>
  45. </view>
  46. </view>
  47. </template>
  48. <script>
  49. export default {
  50. components:{
  51. },
  52. data() {
  53. return {
  54. staticUrl:this.$commonConfig.staticUrl,
  55. latitude: 30.659462,
  56. longitude: 104.065735,
  57. covers: [], //存放标记点数组
  58. navbarTitle:'',
  59. typeList:['旭烁简介','商行简介'],
  60. curNow:0,
  61. pageData:{}
  62. }
  63. },
  64. watch:{
  65. curNow: {
  66. handler(newVal, oldVal){
  67. console.log('newVal',newVal);
  68. this.navbarTitle = this.typeList[newVal];
  69. this.getIntro();
  70. },
  71. immediate: true
  72. }
  73. },
  74. onLoad() {
  75. },
  76. methods: {
  77. sectionChange(index){
  78. this.curNow = index;
  79. },
  80. getIntro(){
  81. let type = this.curNow + 1;
  82. this.$u.api.xsGetIntro({type:type}).then(res=>{
  83. this.pageData = res.data;
  84. this.setCovers(this.latitude,this.longitude);
  85. // console.log('res',res);
  86. }).catch(err=>{
  87. console.log('xsGetIntro',err.data);
  88. })
  89. },
  90. //设置点位
  91. setCovers(latitude, longitude) {
  92. let location = {
  93. id: 0,
  94. latitude: Number(latitude),
  95. longitude: Number(longitude),
  96. width: uni.upx2px(50),
  97. height: uni.upx2px(55),
  98. iconPath:this.$commonConfig.staticUrl+ '/img/mapicon.png'
  99. // iconPath: './../../static/location.png'
  100. }
  101. this.covers = [location]
  102. },
  103. mapClick(){
  104. if(this.curNow==0){
  105. uni.openLocation({
  106. latitude:this.latitude, //维度
  107. longitude: this.longitude, //经度
  108. name: "旭烁地址", //目的地定位名称
  109. scale: 15, //缩放比例
  110. address: this.pageData.xsAddress //导航详细地址
  111. })
  112. }else{
  113. uni.openLocation({
  114. latitude:this.latitude, //维度
  115. longitude: this.longitude, //经度
  116. name: "商行地址", //目的地定位名称
  117. scale: 15, //缩放比例
  118. address: this.pageData.shopAddress //导航详细地址
  119. })
  120. }
  121. }
  122. }
  123. }
  124. </script>
  125. <style>
  126. page{
  127. background-color: #F9F9F9;
  128. }
  129. </style>
  130. <style lang="scss" scoped>
  131. .content{
  132. font-size: 26rpx;
  133. font-weight: 400;
  134. color: #666666;
  135. line-height: 44rpx;
  136. .name{
  137. font-size: 32rpx;
  138. font-weight: 600;
  139. color: #333333;
  140. line-height: 45rpx;
  141. text-align: center;
  142. margin-top: 34rpx;
  143. margin-bottom: 30rpx;
  144. }
  145. .title{
  146. font-size: 30rpx;
  147. font-weight: 400;
  148. color: #333333;
  149. line-height: 50rpx;
  150. margin: 30rpx auto 15rpx;
  151. }
  152. .xsIntro{
  153. font-size: 24rpx;
  154. font-weight: 400;
  155. color: #999999;
  156. line-height: 33rpx;
  157. margin: 20rpx auto 50rpx;
  158. }
  159. .contact{
  160. margin: 30rpx 0;
  161. font-size: 32rpx;
  162. font-weight: 400;
  163. color: #333333;
  164. line-height: 50rpx;
  165. .item{
  166. margin-bottom: 10rpx;
  167. }
  168. }
  169. }
  170. .map-wrap{
  171. margin: 20rpx 0;
  172. }
  173. </style>