personalCard.vue 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238
  1. <template>
  2. <view class="content">
  3. <view class="top-box">
  4. <image class="bgImg" src="http://dmsphoto.66km.com.cn/thFiles/C5E37DF6-452F-4FA4-877D-7620E10440C3.png"></image>
  5. <image class="headerImg" :src="avatarStr">
  6. </image>
  7. <view class="txtInfo-box">
  8. <text class="name">{{adInfo.name}}</text>
  9. <text class="work">服务顾问</text>
  10. </view>
  11. </view>
  12. <view class="address-box" @click="addressOpra">
  13. <view class="address-info">
  14. <text class="store-name">{{shopNameStr}}</text>
  15. <text
  16. class="store-address">{{addressStr?addressStr:''}}</text>
  17. </view>
  18. <view class="address-arrow">
  19. <image src="../../static/img/little_rightArrow.png" mode="aspectFit"></image>
  20. </view>
  21. </view>
  22. <view class="bottom-box">
  23. <button open-type="share" class="share-btn-box">
  24. <view class="share-btn">分享名片</view>
  25. </button>
  26. <view class="call-btn" :style="{background:'#'+themeColor}" @click="callOpra">拨号</view>
  27. </view>
  28. </view>
  29. </template>
  30. <script>
  31. export default {
  32. data() {
  33. return {
  34. adInfo: {
  35. shopName:'',
  36. shopInfo:{
  37. shopName:''
  38. },
  39. },
  40. themeColor:'',
  41. }
  42. },
  43. onLoad(e) {
  44. // console.log('个人名片传递的参数', e.adInfo);
  45. this.adInfo = JSON.parse(e.adInfo)
  46. console.log('个人名片传递的参数', this.adInfo);
  47. this.themeColor = uni.getStorageSync("themeColor");
  48. },
  49. computed: {
  50. avatarStr(){
  51. return this.adInfo.avatar ? this.adInfo.avatar : '../../static/timg/pic_def_ava@2x.png'
  52. },
  53. shopNameStr(){
  54. if (this.adInfo.shopName) {
  55. // console.log('this.adInfo.shopName = ',this.adInfo.shopName)
  56. return this.adInfo.shopName
  57. }
  58. else if(this.adInfo.shopInfo.shopName){
  59. // console.log('this.adInfo.shopInfo.shopName = ',this.adInfo.shopInfo.shopName)
  60. return this.adInfo.shopInfo.shopName
  61. }else{
  62. var k=''
  63. return k
  64. }
  65. },
  66. addressStr() {
  67. if (this.adInfo.provinceName) {
  68. return this.adInfo.provinceName + this.adInfo.cityName + this.adInfo.areaName + this.adInfo.address
  69. }
  70. else
  71. {
  72. return this.adInfo.shopInfo.provinceName + this.adInfo.shopInfo.cityName + this.adInfo.shopInfo.areaName + (this.adInfo.shopInfo.Address ? this.adInfo.shopInfo.Address :'')
  73. }
  74. },
  75. },
  76. methods: {
  77. // 拨号
  78. callOpra() {
  79. if (this.adInfo.phone) {
  80. uni.makePhoneCall({
  81. phoneNumber: this.adInfo.phone,
  82. success(e) {
  83. console.log(e)
  84. },
  85. fail: function(e) {
  86. console.log(e)
  87. }
  88. })
  89. }
  90. else
  91. {
  92. uni.showToast({
  93. title:'没有电话信息',
  94. icon: "none",
  95. duration:2000
  96. })
  97. }
  98. },
  99. // 门店地址
  100. addressOpra() {
  101. // uni.switchTab({
  102. // url:'/pages/index/index'
  103. // })
  104. uni.navigateTo({
  105. url:'onlineBooking?naShopId='+this.adInfo.shopID
  106. })
  107. }
  108. }
  109. }
  110. </script>
  111. <style scoped lang="scss">
  112. /* 背景图 & 头像 */
  113. .top-box {
  114. text-align: center;
  115. border-bottom: 1rpx solid #eee;
  116. }
  117. .bgImg {
  118. width: 100%;
  119. height: 426rpx;
  120. }
  121. .headerImg {
  122. width: 272rpx;
  123. height: 272rpx;
  124. border-radius: 50%;
  125. border: 6rpx solid #A38E21;
  126. margin-top: -136rpx;
  127. }
  128. /* 名片信息 */
  129. .txtInfo-box {
  130. display: flex;
  131. flex-direction: column;
  132. margin-top: 34rpx;
  133. margin-bottom: 32rpx;
  134. }
  135. .name {
  136. font-size: 44rpx;
  137. font-weight: 500;
  138. color: #333;
  139. }
  140. .work {
  141. color: #666;
  142. font-size: 28rpx;
  143. margin-top: 10rpx;
  144. }
  145. /* 地址信息 */
  146. .address-box {
  147. display: flex;
  148. margin-top: 33rpx;
  149. margin-bottom: 33rpx;
  150. }
  151. .address-info {
  152. flex: 1;
  153. display: flex;
  154. flex-direction: column;
  155. margin-left: 44rpx;
  156. }
  157. .address-arrow {
  158. width: 60rpx;
  159. }
  160. .address-arrow image {
  161. width: 30rpx;
  162. height: 100%;
  163. }
  164. .store-name {
  165. font-size: 30rpx;
  166. font-weight: 500;
  167. color: #3c3c3c;
  168. }
  169. .store-address {
  170. margin-top: 12rpx;
  171. font-size: 24rpx;
  172. color: #999;
  173. }
  174. /* 底部 */
  175. .bottom-box {
  176. bottom: 0;
  177. position: fixed;
  178. background: white;
  179. width: 100%;
  180. display: flex;
  181. box-shadow: 0px -2px 10px 0px rgba(153, 153, 153, 0.2000);
  182. padding-bottom: env(safe-area-inset-bottom);
  183. height: 120rpx;
  184. }
  185. button::after {
  186. border: none;
  187. }
  188. .share-btn-box {
  189. width: 375rpx;
  190. background: #FFFFFF;
  191. margin: 0;
  192. padding: 0;
  193. .share-btn {
  194. margin: 20rpx;
  195. background-color: #F4F5F7;
  196. border-radius: 37rpx;
  197. font-size: 28rpx;
  198. color: #000;
  199. text-align: center;
  200. line-height: 74rpx;
  201. }
  202. }
  203. .call-btn {
  204. flex: 1;
  205. margin: 20rpx;
  206. background-color: #D53533;
  207. border-radius: 37rpx;
  208. font-size: 28rpx;
  209. color: white;
  210. text-align: center;
  211. line-height: 74rpx;
  212. }
  213. </style>