cm-seller-modal.vue 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208
  1. <template>
  2. <view class="seller-card" v-if="userId !== 0">
  3. <view class="seller-card-mine" v-if="!modal" @click="modal = true">
  4. <image
  5. :src="userInfo.image || 'https://static.caimei365.com/app/img/icon/default-head.png'"
  6. style="width: 100%;height: 100%;object-fit: contain;border-radius: 50%;"
  7. mode=""
  8. ></image>
  9. </view>
  10. <tui-modal class="sellerMode" @cancel="hideModal" :show="modal" custom>
  11. <view class="tui-modal-custom">
  12. <view class="close" @click="modal = false">
  13. <image
  14. src="https://static.caimei365.com/app/img/supplier-login/close.png"
  15. style="width: 100%;height: 100%;"
  16. mode=""
  17. ></image>
  18. </view>
  19. <view class="card" :style="{ backgroundImage: `url(${imgUrl})`, backgroundSize: '100% 100%' }">
  20. <view class="logo">
  21. <image
  22. src="https://static.caimei365.com/app/img/icon/logo-fanbai.png"
  23. mode=""
  24. class="titleImgUrl"
  25. ></image>
  26. </view>
  27. <view class="card-contain">
  28. <view style="display: flex;">
  29. <view class="card-head">
  30. <image
  31. :src="
  32. userInfo.image || 'https://static.caimei365.com/app/img/icon/default-head.png'
  33. "
  34. mode=""
  35. class="head"
  36. ></image>
  37. </view>
  38. <view class="card-info">
  39. <view class="card-info-head">
  40. <view class="card-name">{{ userInfo.linkMan }}</view>
  41. <view class="card-info-tab">客户经理</view>
  42. </view>
  43. <view class="card-info-iphone">{{ userInfo.contractMobile }}</view>
  44. </view>
  45. </view>
  46. <view class="card-qrcode">
  47. <view class="qrcode-message">
  48. <image
  49. :show-menu-by-longpress="true"
  50. :src="userInfo.qrCode || ''"
  51. class="qrcode"
  52. mode=""
  53. ></image>
  54. </view>
  55. <view class="tips">长按或扫二维码 联系我</view>
  56. </view>
  57. </view>
  58. </view>
  59. </view>
  60. </tui-modal>
  61. </view>
  62. </template>
  63. <script>
  64. export default {
  65. props: {
  66. sellerUserId: {
  67. type: Number,
  68. default: 0
  69. }
  70. },
  71. data() {
  72. return {
  73. modal: false,
  74. imgUrl: 'https://static.caimei365.com/app/img/icon/bg-card.png',
  75. userInfo: {},
  76. userId: ''
  77. }
  78. },
  79. mounted() {
  80. this.initData()
  81. },
  82. methods: {
  83. hideModal() {
  84. this.modal = false
  85. },
  86. initData() {
  87. this.userId = uni.getStorageSync('sellerUserId') || this.sellerUserId
  88. if(this.userId > 0) {
  89. this.getUserInfo()
  90. this.modal = true
  91. }
  92. },
  93. async getUserInfo() {
  94. const { data } = await this.SellerService.GetSellerHome({ userId: this.userId })
  95. this.userInfo = data
  96. }
  97. }
  98. }
  99. </script>
  100. <style lang="scss" scoped>
  101. .seller-card-mine {
  102. position: fixed;
  103. right: 20rpx;
  104. width: 80rpx;
  105. height: 80rpx;
  106. z-index: 99;
  107. bottom: 460rpx;
  108. border-radius: 50%;
  109. &::after {
  110. content: '客户经理';
  111. width: 100rpx;
  112. height: 30rpx;
  113. position: absolute;
  114. color: #fff;
  115. font-size: 18rpx;
  116. font-weight: bold;
  117. background-color: #FF5B00;
  118. bottom: 0;
  119. left: 0;
  120. border-radius: 20rpx;
  121. text-align: center;
  122. line-height: 30rpx;
  123. box-shadow: 0rpx 3rpx 6rpx 1rpx rgba(255,92,0,0.16);
  124. transform: translate(-12%, 70%);
  125. }
  126. }
  127. .tui-modal-custom {
  128. .close {
  129. position: fixed;
  130. right: -20px;
  131. top: -200rpx;
  132. width: 60rpx;
  133. height: 60rpx;
  134. }
  135. }
  136. .card {
  137. position: fixed;
  138. left: -34rpx;
  139. top: -150%;
  140. width: 702rpx;
  141. height: 340rpx;
  142. background: #ff5b00;
  143. border-radius: 16rpx;
  144. opacity: 1;
  145. margin: 0 auto;
  146. box-sizing: border-box;
  147. padding: 16rpx 32rpx;
  148. .titleImgUrl {
  149. width: 241rpx;
  150. height: 80rpx;
  151. }
  152. .card-contain {
  153. display: flex;
  154. align-items: center;
  155. justify-content: space-between;
  156. .head {
  157. width: 128rpx;
  158. height: 128rpx;
  159. border-radius: 50%;
  160. object-fit: contain;
  161. }
  162. .card-info {
  163. height: 128rpx;
  164. margin-left: 30rpx;
  165. }
  166. .card-info-head {
  167. display: flex;
  168. align-items: center;
  169. margin-bottom: 13rpx;
  170. .card-name {
  171. color: #ffffff;
  172. font-size: 40rpx;
  173. font-weight: bold;
  174. }
  175. .card-info-tab {
  176. width: 88rpx;
  177. height: 31rpx;
  178. background-color: #ffbb00;
  179. color: #fff;
  180. font-size: 22rpx;
  181. padding: 0 8rpx;
  182. margin-left: 10rpx;
  183. }
  184. }
  185. .card-info-iphone {
  186. color: #ffffff;
  187. font-size: 28rpx;
  188. }
  189. .card-qrcode {
  190. .qrcode {
  191. width: 126rpx;
  192. height: 126rpx;
  193. object-fit: contain;
  194. margin-bottom: 6rpx;
  195. }
  196. .tips {
  197. font-size: 18rpx;
  198. color: #fff;
  199. text-align: center;
  200. width: 126rpx;
  201. line-height: 24rpx;
  202. }
  203. }
  204. }
  205. }
  206. </style>