cm-seller-modal.vue 6.9 KB

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