cm-seller-modal.vue 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221
  1. <template>
  2. <view class="seller-card" v-if="userId > 0">
  3. <view class="seller-card-mine" v-if="!modal" @click="changeModal">
  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="changeModal">
  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 && userInfo.contractMobile.replace(/(?=(\d{4})+$)/g,"-") }}</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">
  56. <view class="">
  57. 长按或扫二维码
  58. </view>
  59. <view style="white-space: nowrap;">——联系我——</view>
  60. </view>
  61. </view>
  62. </view>
  63. </view>
  64. </tui-modal>
  65. </view>
  66. </template>
  67. <script>
  68. export default {
  69. props: {
  70. sellerUserId: {
  71. type: Number,
  72. default: 0
  73. }
  74. },
  75. data() {
  76. return {
  77. modal: false,
  78. imgUrl: 'https://static.caimei365.com/app/img/icon/bg-card.png',
  79. userInfo: {},
  80. userId: ''
  81. }
  82. },
  83. mounted() {
  84. this.initData()
  85. },
  86. methods: {
  87. hideModal() {
  88. this.modal = false
  89. uni.setStorageSync('sellerCardChange', 2)
  90. },
  91. initData() {
  92. this.userId = uni.getStorageSync('sellerUserId') || this.sellerUserId
  93. if(this.userId > 0) {
  94. this.getUserInfo()
  95. if (uni.getStorageSync('sellerCardChange') === 1) {
  96. this.modal = true
  97. } else {
  98. this.modal = false
  99. }
  100. }
  101. },
  102. async getUserInfo() {
  103. const { data } = await this.SellerService.GetSellerHome({ userId: this.userId })
  104. this.userInfo = data
  105. },
  106. changeModal() {
  107. this.modal = !this.modal
  108. uni.setStorageSync('sellerCardChange', this.modal ? 1 : 2)
  109. }
  110. }
  111. }
  112. </script>
  113. <style lang="scss" scoped>
  114. .seller-card-mine {
  115. position: fixed;
  116. right: 20rpx;
  117. width: 80rpx;
  118. height: 80rpx;
  119. z-index: 99;
  120. bottom: 460rpx;
  121. border-radius: 50%;
  122. &::after {
  123. content: '客户经理';
  124. width: 100rpx;
  125. height: 30rpx;
  126. position: absolute;
  127. color: #fff;
  128. font-size: 18rpx;
  129. font-weight: bold;
  130. background-color: #FF5B00;
  131. bottom: 0;
  132. left: 0;
  133. border-radius: 20rpx;
  134. text-align: center;
  135. line-height: 30rpx;
  136. box-shadow: 0rpx 3rpx 6rpx 1rpx rgba(255,92,0,0.16);
  137. transform: translate(-12%, 70%);
  138. }
  139. }
  140. .tui-modal-custom {
  141. .close {
  142. position: fixed;
  143. right: -20px;
  144. top: -200rpx;
  145. width: 60rpx;
  146. height: 60rpx;
  147. }
  148. }
  149. .card {
  150. position: fixed;
  151. left: -34rpx;
  152. top: -150%;
  153. width: 702rpx;
  154. height: 340rpx;
  155. background: #ff5b00;
  156. border-radius: 16rpx;
  157. opacity: 1;
  158. margin: 0 auto;
  159. box-sizing: border-box;
  160. padding: 16rpx 32rpx;
  161. .titleImgUrl {
  162. width: 241rpx;
  163. height: 80rpx;
  164. }
  165. .card-contain {
  166. display: flex;
  167. align-items: center;
  168. justify-content: space-between;
  169. .head {
  170. width: 128rpx;
  171. height: 128rpx;
  172. border-radius: 50%;
  173. object-fit: contain;
  174. }
  175. .card-info {
  176. height: 128rpx;
  177. margin-left: 30rpx;
  178. }
  179. .card-info-head {
  180. display: flex;
  181. align-items: center;
  182. margin-bottom: 13rpx;
  183. .card-name {
  184. color: #ffffff;
  185. font-size: 40rpx;
  186. font-weight: bold;
  187. }
  188. .card-info-tab {
  189. width: 88rpx;
  190. height: 31rpx;
  191. background-color: #ffbb00;
  192. color: #fff;
  193. font-size: 22rpx;
  194. padding: 0 8rpx;
  195. margin-left: 10rpx;
  196. }
  197. }
  198. .card-info-iphone {
  199. color: #ffffff;
  200. font-size: 28rpx;
  201. }
  202. .card-qrcode {
  203. .qrcode {
  204. width: 126rpx;
  205. height: 126rpx;
  206. object-fit: contain;
  207. margin-bottom: 6rpx;
  208. }
  209. .tips {
  210. font-size: 18rpx;
  211. color: #fff;
  212. text-align: center;
  213. width: 126rpx;
  214. line-height: 24rpx;
  215. }
  216. }
  217. }
  218. }
  219. </style>