detail.vue 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. <template>
  2. <view>
  3. <swiper class="screen-swiper square-dot" :indicator-dots="true" :circular="true"
  4. :autoplay="true" interval="5000" duration="500">
  5. <swiper-item v-for="(item,index) in agent.picall" :key="index">
  6. <image :src="item" mode="aspectFill"></image>
  7. </swiper-item>
  8. </swiper>
  9. <view class="bg-white padding text-xl text-black text-bold margin-bottom-sm">
  10. {{agent.title}}
  11. </view>
  12. <view class="cu-list menu margin-bottom-sm sm-border">
  13. <view class="cu-item arrow">
  14. <view class="content">
  15. <text class="cuIcon-phone text-grey"></text>
  16. <text class="text-grey">门店电话</text>
  17. </view>
  18. <view class="action" @tap="makePhone()">
  19. <text class="text-grey">{{agent.telephone}}</text>
  20. </view>
  21. </view>
  22. <view class="cu-item">
  23. <view class="content">
  24. <text class="cuIcon-similar text-grey"></text>
  25. <text class="text-grey">所在市区</text>
  26. </view>
  27. <view class="action">
  28. <text class="text-grey">{{agent.province}} {{agent.city}} {{agent.district}}</text>
  29. </view>
  30. </view>
  31. <view class="cu-item arrow">
  32. <view class="content">
  33. <text class="cuIcon-location text-grey"></text>
  34. <text class="text-grey">详细地址</text>
  35. </view>
  36. <view class="action basis-lg text-right text-cut" @tap="setAddress()">
  37. <text class="text-grey">{{agent.address}}</text>
  38. </view>
  39. </view>
  40. </view>
  41. <view class="cu-bar bg-white solids-bottom">
  42. <view class="action">
  43. <text class="cuIcon-titles text-blue"></text> 门店介绍
  44. </view>
  45. </view>
  46. <view class="echo-article-details bg-white margin-bottom-sm">
  47. <u-parse :content="agent.details" noData="详情内容..." @navigate="navigate"></u-parse>
  48. </view>
  49. </view>
  50. </template>
  51. <script>
  52. import uParse from '@/components/gaoyia-parse/parse.vue';
  53. var _this;
  54. export default {
  55. components: {
  56. uParse
  57. },
  58. data() {
  59. return {
  60. userinfo: {},
  61. agent: {}
  62. }
  63. },
  64. onLoad: function(option) {
  65. _this = this;
  66. var agentid = option.agentid || 0;
  67. _this.userinfo = uni.getStorageSync('userinfo');
  68. _this.$req.ajax({
  69. path: "agent/getagent",
  70. data: {
  71. agentid: agentid
  72. }
  73. }).then((data) => {
  74. _this.agent = data.agent;
  75. }).catch((err) => {
  76. uni.showModal({
  77. title: '信息提示',
  78. content: err,
  79. showCancel: false
  80. });
  81. });
  82. },
  83. onShareAppMessage: function(res) {
  84. return {
  85. title: _this.agent.title,
  86. path: "/pages/agent/detail?agentid="+_this.agent.id
  87. }
  88. },
  89. methods: {
  90. setAddress: function() {
  91. uni.openLocation({
  92. latitude: parseFloat(_this.agent.latitude),
  93. longitude: parseFloat(_this.agent.longitude),
  94. name: _this.agent.agentname,
  95. address: _this.agent.city + " " + _this.agent.district + " " + _this.agent.address,
  96. success: function () {
  97. console.log('success');
  98. }
  99. });
  100. },
  101. makePhone: function() {
  102. uni.makePhoneCall({
  103. phoneNumber: _this.agent.telephone
  104. });
  105. },
  106. goPage: function(pageurl) {
  107. uni.navigateTo({
  108. url: pageurl,
  109. fail: function(){
  110. uni.switchTab({
  111. url: pageurl
  112. });
  113. }
  114. });
  115. },
  116. goDetail: function(partjobid) {
  117. uni.navigateTo({
  118. url: '/pages/partjob/detail?partjobid=' + partjobid
  119. });
  120. },
  121. navigate: function(href, e) {
  122. // #ifdef H5
  123. location.href = href;
  124. // #endif
  125. // #ifndef H5
  126. uni.navigateTo({
  127. url: '/pages/tool/webview?pagesrc=' + encodeURIComponent(href)
  128. });
  129. // #endif
  130. }
  131. }
  132. }
  133. </script>
  134. <style lang="scss">
  135. </style>