summary.vue 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235
  1. <template>
  2. <app-layout>
  3. <view class="summary-head">
  4. <image class="shop-pic" :src="shop.store.pic_url && shop.store.pic_url[0].pic_url" lazy-load></image>
  5. <view class="home cross-center" @click="navHome">
  6. <image src="../image/arrow-left-white.png"></image>
  7. <view>返回店铺首页</view>
  8. </view>
  9. <image class="cover-pic" :src="shop.store.cover_url" lazy-load></image>
  10. </view>
  11. <view class="summary-info">
  12. <view class="summary-name">{{shop.store.name}}</view>
  13. <view v-if="mchSetting.is_web_service" @click="navCs"
  14. class="summary-contact main-center cross-center dir-left-nowrap">
  15. <image :src="mchSetting.web_service_pic ? mchSetting.web_service_pic : '/plugins/mch/images/summary-blue.png'"></image>
  16. <view>在线沟通</view>
  17. </view>
  18. <view class="dir-left-nowrap tag" v-if="shop.store.scope">
  19. <image class="box-grow-0" src="./../image/summary-yw.png"></image>
  20. <view>{{shop.store.scope}}</view>
  21. </view>
  22. <view class="dir-left-nowrap tag" v-if="shop.store.mobile">
  23. <image class="box-grow-0" src="./../image/summary-phone.png"></image>
  24. <view class="dir-left-nowrap">
  25. <view class="max">{{shop.mobile}}</view>
  26. <view @click="callPhone" class="box-grow-0 main-center cross-center tv">拨号</view>
  27. </view>
  28. </view>
  29. <view class="dir-left-nowrap tag" v-if="shop.store.address">
  30. <image class="box-grow-0" src="./../image/summary-address.png"></image>
  31. <view class="dir-left-nowrap">
  32. <view class="max">{{shop.store.address}}</view>
  33. <view @click="mapPower" class="box-grow-0 main-center cross-center tv">导航
  34. </view>
  35. </view>
  36. </view>
  37. <view class="dir-left-nowrap tag" v-if="shop.store.description">
  38. <image class="box-grow-0" src="./../image/summary-synopsis.png"></image>
  39. <view>{{shop.store.description}}</view>
  40. </view>
  41. </view>
  42. <view v-if="shop.store.latitude>0 && shop.store.longitude>0" class="main-center summary-end">
  43. <map :longitude="shop.store.longitude" :markers="markers" :latitude="shop.store.latitude"
  44. class="map"></map>
  45. </view>
  46. </app-layout>
  47. </template>
  48. <script>
  49. export default {
  50. name: "summary",
  51. components: {},
  52. data() {
  53. return {
  54. markers: [],
  55. shop: {store: {}},
  56. mchSetting: {},
  57. }
  58. },
  59. onLoad(options) { this.$commonLoad.onload(options);
  60. const self = this;
  61. self.$showLoading();
  62. self.$request({
  63. url: self.$api.mch.detail,
  64. data: {
  65. id: options.mch_id,
  66. }
  67. }).then(info => {
  68. self.$hideLoading();
  69. if (info.code === 0) {
  70. let shop = info.data.detail;
  71. let markers = [{
  72. iconPath: "./../image/summary-map.png",
  73. id: 0,
  74. width: 43,
  75. height: 43,
  76. longitude: shop.store.longitude,
  77. latitude: shop.store.latitude,
  78. }];
  79. [
  80. self.markers,
  81. self.shop,
  82. self.mchSetting
  83. ] = [
  84. markers,
  85. shop,
  86. info.data.mchSetting
  87. ]
  88. }
  89. }).catch(e => {
  90. self.$hideLoading();
  91. })
  92. },
  93. methods: {
  94. navHome() {
  95. uni.redirectTo({url: `/plugins/mch/shop/shop?mch_id=` + this.shop.id});
  96. },
  97. navCs() {
  98. uni.navigateTo({url: `/pages/web/web?url=` + this.mchSetting.web_service_url});
  99. },
  100. callPhone() {
  101. const phoneNumber = this.shop.mobile;
  102. uni.makePhoneCall({
  103. phoneNumber: phoneNumber
  104. })
  105. },
  106. mapPower() {
  107. const shop = this.shop;
  108. uni.openLocation({
  109. latitude: parseFloat(shop.store.latitude),
  110. longitude: parseFloat(shop.store.longitude),
  111. name: shop.store.name,
  112. address: shop.store.address,
  113. });
  114. openLocation
  115. }
  116. },
  117. }
  118. </script>
  119. <style scoped lang="scss">
  120. .summary-head {
  121. height: #{200rpx};
  122. width: 100%;
  123. position: relative;
  124. .shop-pic {
  125. height: 100%;
  126. width: 100%;
  127. opacity: 0.8;
  128. }
  129. .home {
  130. position: absolute;
  131. top: #{55rpx};
  132. left: #{0rpx};
  133. background: #ff4544;
  134. border-radius: 0 #{28rpx} #{28rpx} 0;
  135. height: #{56rpx};
  136. }
  137. .home view {
  138. color: #fff;
  139. font-size: #{26rpx};
  140. padding-right: #{24rpx};
  141. }
  142. .home image {
  143. height: #{22rpx};
  144. width: #{12rpx};
  145. margin: #{12rpx};
  146. }
  147. .cover-pic {
  148. border-radius: #{16rpx};
  149. position: absolute;
  150. top: #{130rpx};
  151. left: #{305rpx};
  152. height: #{140rpx};
  153. width: #{140rpx};
  154. }
  155. }
  156. .summary-info {
  157. margin: #{100rpx} #{55rpx} 0 #{55rpx};
  158. .summary-name {
  159. text-align: center;
  160. color: #353535;
  161. }
  162. .summary-contact {
  163. height: #{80rpx};
  164. width: #{360rpx};
  165. margin: #{40rpx} auto;
  166. color: #5292ed;
  167. font-size: #{28rpx};
  168. border-radius: #{40rpx};
  169. border: #{1rpx} solid #5292ed;
  170. }
  171. .summary-contact image {
  172. height: #{32rpx};
  173. width: #{32rpx};
  174. margin-right: #{16rpx};
  175. }
  176. .tag {
  177. margin: #{15rpx} 0;
  178. }
  179. .tag > image {
  180. padding-top: #{5rpx};
  181. height: #{32rpx};
  182. width: #{32rpx};
  183. }
  184. .tag > view {
  185. margin-left: #{24rpx};
  186. font-size: #{28rpx};
  187. color: #353535;
  188. }
  189. .tag .max {
  190. max-width: #{448rpx};
  191. }
  192. .tag .tv {
  193. text-align: center;
  194. display: inline-block;
  195. border-radius: #{22rpx};
  196. margin: 0 #{32rpx};
  197. padding: 0 #{20rpx};
  198. font-size: #{26rpx};
  199. height: #{44rpx};
  200. line-height: #{44rpx};
  201. border: 1px solid #5292ed;
  202. color: #5292ed;
  203. }
  204. }
  205. .summary-end {
  206. margin: #{36rpx} 0;
  207. }
  208. .map {
  209. width: #{640rpx};
  210. height: #{560rpx};
  211. }
  212. </style>