personalCard.vue 4.4 KB

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