dmUserInfo.vue 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366
  1. <template>
  2. <view class="item-user">
  3. <image class="u-header" :src="headUrl || '../../static/icons/icon_placeheader@2x.png'" mode="aspectFit"></image>
  4. <view class="u-center">
  5. <view class="u-center-top">
  6. <text class="u-name">{{name || '未知用户'}}</text>
  7. <image class="u-gender" v-if="gender=='女'" src="../../static/icons/female.png" mode="aspectFit"></image>
  8. <image class="u-gender" v-if="gender=='男'" src="../../static/icons/man.png" mode="aspectFit"></image>
  9. <image class="u-terminal" :src="terminalFlag(terminal)" mode="aspectFit" v-if="isShowTerminal"></image>
  10. </view>
  11. <view style="display: flex;flex-direction: row;align-items: center;margin-top: 10rpx;" @click.stop='copyMobile(mobile)'>
  12. <text class="u-mobile" >{{mobile}}</text>
  13. <image src="../../static/icons/icon_copy.png" mode="" style="width: 18rpx;height: 18rpx; margin-left: 10rpx;"></image>
  14. </view>
  15. </view>
  16. <view v-if="isLevelStyle">
  17. <view v-if="typeNew!='none'">
  18. <view class="u-right" v-if="typeNew=='type1'">
  19. <view class="u-right-t" :style="{'background-color':bgColor}">
  20. <text class="u-level" :style="{'color':textColor}">{{grade || '-'}}</text>
  21. <text class="u-score" :style="{'background':'linear-gradient(110deg, transparent 9px, '+scoreBgColor+' 0)'}">{{score || 0}}</text>
  22. </view>
  23. <text class="u-score-title">AI等级/客户等级</text>
  24. </view>
  25. <view class="u-right" v-if="typeNew=='type2'">
  26. <view class="u-right-t2" :style="{'background-color':bgColor}">
  27. <text class="u-level" :style="{'color':textColor}">{{grade || '-'}}</text>
  28. </view>
  29. <text class="u-score-title">AI等级</text>
  30. </view>
  31. <view class="u-right" v-if="typeNew=='type3'">
  32. <view class="u-right-t3" :style="{'background-color':scoreBgColor}">
  33. <text class="u-score">{{score || '-'}}</text>
  34. </view>
  35. <text class="u-score-title">客户等级</text>
  36. </view>
  37. </view>
  38. </view>
  39. <view v-else>
  40. <view class="u-right" v-if="type!='none'">
  41. <view class="u-right-t" :style="{'background-color':bgColor}" v-if="type=='type1'">
  42. <text class="u-level" :style="{'color':textColor}">{{grade || ' -'}}</text>
  43. <text class="u-score" :style="{'background':'linear-gradient(110deg, transparent 18rpx, '+scoreBgColor+' 0)'}">{{score || 0}}</text>
  44. </view>
  45. <view class="u-right-t2" :style="{'background-color':bgColor}" v-if="type=='type2'">
  46. <text class="u-level" :style="{'color':textColor}">{{grade || ' -'}}</text>
  47. </view>
  48. <view class="u-right-t3" :style="{'background-color':bgColor}" v-if="type=='type3'">
  49. <text class="u-level" :style="{'color':textColor}">{{grade || ' -'}}</text>
  50. </view>
  51. <view class="u-right-t4" :style="{'background-color':themeColor}" v-if="type=='type4'">
  52. {{type4Mark}}
  53. </view>
  54. <block v-if="type != 'type4'">
  55. <text class="u-score-title">{{describe}}</text>
  56. </block>
  57. </view>
  58. </view>
  59. </view>
  60. </template>
  61. <script>
  62. export default {
  63. props: {
  64. headUrl:String,
  65. name: String,
  66. mobile: String,
  67. grade: {
  68. type:[String,Number],
  69. default:'-'
  70. },
  71. score:{
  72. type:[String,Number],
  73. default:'-'
  74. },
  75. terminal:{
  76. type:[String,Number],
  77. default:0
  78. },
  79. // none:没有
  80. type: {
  81. type: String,
  82. default: 'type1' // type1 : 通用 type2: 只有A、B、C、D这样的 typy3: 纯文字的
  83. },
  84. describe:{
  85. type:String,
  86. default:'AI等级/把控分'
  87. },
  88. bgColor:{ //整个标签的背景色
  89. type:String,
  90. default:"#FFF6E5"
  91. },
  92. textColor:{ //文字颜色,A,B,C,D 颜色
  93. type:String,
  94. default:"#FEC350"
  95. },
  96. scoreBgColor:{ //分数背景色
  97. type:String,
  98. default:"#FEC350"
  99. },
  100. isShowTerminal: {
  101. type: Boolean,
  102. default: false
  103. },
  104. isLevelStyle: {
  105. type: Boolean,
  106. default: true
  107. },
  108. type4Mark: {
  109. type: String,
  110. default: '多权益人'
  111. },
  112. gender: {
  113. type: String,
  114. default: ''
  115. }
  116. },
  117. data() {
  118. return {
  119. themeColor:'',
  120. themeColor25:'',
  121. typeNew: "none"
  122. }
  123. },
  124. mounted() {
  125. let app = getApp();
  126. this.globalData = app.globalData;
  127. this.themeColor = this.globalData.themeColor;
  128. this.themeColor25 = this.globalData.themeColor25;
  129. this.fuzhuColor = this.globalData.fuzhuColor;
  130. this.fuzhuColor50 = this.globalData.fuzhuColor50;
  131. // console.log("主题色",this.themeColor)
  132. this.judgeCurrentType();
  133. },
  134. computed:{
  135. },
  136. watch:{
  137. grade:{
  138. handler(newName, oldName) {
  139. this.judgeCurrentType();
  140. },
  141. immediate: true
  142. },
  143. score:{
  144. handler(newName, oldName) {
  145. this.judgeCurrentType();
  146. },
  147.    immediate: true
  148. }
  149. },
  150. methods: {
  151. judgeCurrentType(){
  152. if (this.grade && this.score) {
  153. if (this.grade != '-' && this.score != '-') {
  154. this.typeNew = "type1";
  155. } else if (this.grade != '-') {
  156. this.typeNew = "type2";
  157. } else if (this.score != '-') {
  158. this.typeNew = "type3";
  159. } else {
  160. this.typeNew = "none";
  161. }
  162. } else {
  163. if (this.grade && this.grade!= '-') {
  164. this.typeNew = "type2";
  165. } else if (this.score && this.score != '-') {
  166. this.typeNew = "type3";
  167. } else {
  168. this.typeNew = "none";
  169. }
  170. }
  171. },
  172. terminalFlag(){
  173. // 平台 1:微信,2:抖音,3:百度,4:头条,5:支付宝,6:QQ小程序,7:其他
  174. if (this.terminal == 1){
  175. return '../../static/platforms/platform_weixin.png'
  176. }else if(this.terminal == 2){
  177. return '../../static/platforms/platform_douyin.png'
  178. }else if(this.terminal == 3){
  179. return '../../static/platforms/platform_baidu.png'
  180. }else if(this.terminal == 4){
  181. return '../../static/platforms/platform_toutiao.png'
  182. }else if(this.terminal == 5){
  183. return '../../static/platforms/platform_zhifubao.png'
  184. }else if(this.terminal == 6){
  185. return '../../static/platforms/platform_QQ.png'
  186. }else if(this.terminal == 7){
  187. return '../../static/platforms/platform_qita.png'
  188. }
  189. },
  190. copyMobile(mobile){
  191. uni.setClipboardData({
  192. data: mobile,
  193. success: () => {
  194. uni.showToast({
  195. icon:'none',
  196. title: '已复制手机号码到粘贴板'
  197. })
  198. }
  199. })
  200. }
  201. },
  202. }
  203. </script>
  204. <style scoped lang="scss">
  205. .item-user{
  206. display: flex;
  207. width: 100%;
  208. padding: 0 30rpx;
  209. box-sizing: border-box;
  210. .u-header{
  211. margin-top: 40rpx;
  212. width: 72rpx;
  213. height: 72rpx;
  214. border-radius: 36rpx;
  215. }
  216. .u-center{
  217. margin-left: 18rpx;
  218. display: flex;
  219. flex-direction: column;
  220. flex: 1;
  221. .u-center-top{
  222. margin-top: 38rpx;
  223. display: flex;
  224. align-items: center;
  225. .u-name{
  226. font-size: 28rpx;
  227. font-family: Verdana, 'Verdana-Bold';
  228. font-weight: 700;
  229. text-align: left;
  230. line-height: 40rpx;
  231. color: #666666;
  232. }
  233. .u-gender {
  234. width: 33rpx;
  235. height: 33rpx;
  236. margin-left: 8rpx;
  237. }
  238. .u-terminal{
  239. margin-left: 10rpx;
  240. height: 40rpx;
  241. width: 50px;
  242. }
  243. }
  244. .u-mobile{
  245. line-height: 30rpx;
  246. font-size: 24rpx;
  247. font-family: Verdana, 'Verdana-Regular';
  248. font-weight: 400;
  249. text-align: left;
  250. color: #666666;
  251. }
  252. }
  253. .u-right{
  254. margin-top: 30rpx;
  255. margin-left: 28rpx;
  256. display: flex;
  257. flex-direction: column;
  258. align-items: flex-end;
  259. .u-right-t{
  260. width: 152rpx;
  261. height: 50rpx;
  262. border-radius: 8rpx;
  263. display: flex;
  264. .u-level{
  265. flex: 1;
  266. padding-left: 18rpx;
  267. line-height: 50rpx;
  268. font-size: 48rpx;
  269. font-family: 'DIN Alternate', 'DIN Alternate-Bold';
  270. font-weight: 700;
  271. }
  272. .u-score{
  273. width: 95rpx;
  274. height: 50rpx;
  275. padding-left: 15rpx;
  276. text-align: center;
  277. line-height: 50rpx;
  278. font-size: 48rpx;
  279. font-family: 'DIN Alternate', 'DIN Alternate-Bold';
  280. font-weight: 700;
  281. color: #fff;
  282. border-radius: 0rpx 8rpx 8rpx 0rpx;
  283. box-sizing: border-box;
  284. }
  285. }
  286. .u-right-t2{
  287. width: 80rpx;
  288. height: 50rpx;
  289. border-radius: 8rpx;
  290. display: flex;
  291. .u-level{
  292. width: 80rpx;
  293. line-height: 50rpx;
  294. font-size: 48rpx;
  295. font-family: 'DIN Alternate', 'DIN Alternate-Bold';
  296. font-weight: 700;
  297. text-align: center;
  298. }
  299. }
  300. .u-right-t3{
  301. height: 50rpx;
  302. border-radius: 8rpx;
  303. display: flex;
  304. .u-level{
  305. padding-left: 10rpx;
  306. padding-right: 10rpx;
  307. line-height: 50rpx;
  308. font-size: 28rpx;
  309. font-family: Verdana, Verdana-Bold;
  310. font-weight: 700;
  311. text-align: center;
  312. }
  313. .u-score {
  314. width: 95rpx;
  315. height: 50rpx;
  316. text-align: center;
  317. line-height: 50rpx;
  318. font-size: 48rpx;
  319. font-family: 'DIN Alternate', 'DIN Alternate-Bold';
  320. font-weight: 700;
  321. color: #fff;
  322. border-radius: 0rpx 8rpx 8rpx 0rpx;
  323. box-sizing: border-box;
  324. }
  325. }
  326. .u-right-t4 {
  327. margin-top: 20rpx;
  328. height: 50rpx;
  329. padding: 0 12rpx;
  330. box-sizing: border-box;
  331. font-size: 28rpx;
  332. font-family: DIN Alternate, DIN Alternate-Bold;
  333. font-weight: 700;
  334. text-align: center;
  335. color: #ffffff;
  336. line-height: 50rpx;
  337. border-radius: 8rpx;
  338. }
  339. .u-score-title{
  340. margin-top: 4rpx;
  341. font-size: 20rpx;
  342. font-family: Verdana, Verdana-Regular;
  343. font-weight: 400;
  344. text-align: right;
  345. color: #999999;
  346. }
  347. }
  348. }
  349. </style>