cm-seller-modal.vue 7.1 KB

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