style1.php 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362
  1. <template id="member-info-style1">
  2. <div class="member-info-style1" :style="[cardStyle]">
  3. <div class="icon-info" :style="iconStyle">
  4. <!-- <div class="icon" v-if="permission.memberCode">
  5. <i class="iconfont icon-a-31erweima"></i>
  6. </div> -->
  7. <div class="icon" v-if="permission.set">
  8. <i class="iconfont icon-shezhi"></i>
  9. </div>
  10. <!-- <div class="icon" v-if="permission.news">
  11. <i class="iconfont icon-xiaoxi"></i>
  12. </div> -->
  13. </div>
  14. <div class="user-info flex">
  15. <div class="user-avarat">
  16. <img class="default_picture" :src="static_img_prefix+'/default_picture.png'" />
  17. </div>
  18. <div class="flex">
  19. <div class="user-top flex-y-center">
  20. <div class="user-name" :style="{color:levelStyle.nameColor}">张三还是李四</div>
  21. </div>
  22. <div class="flex-y-center user-level-box" v-if="permission.level">
  23. <div class="user-level" :style="{ color: levelStyle.levelColor, backgroundColor: levelStyle.levelBgColor }">
  24. <img class="level-icon" src="resources/img/decorate/mp.png" alt="">
  25. 普通会员
  26. </div>
  27. <div class="user-auto" >
  28. <img class="auto-icon" :src="static_img_prefix+'/diy/member-info/auth.png'" />
  29. 已认证
  30. </div>
  31. </div>
  32. <div class="user-level-box">
  33. <div class="invite_code" :style="{ color: levelStyle.nameColor }">
  34. 邀请码:HN678910
  35. </div>
  36. <el-divider direction="vertical" style="color:#FFF"></el-divider>
  37. <div class="user-id" :style="{ color: levelStyle.nameColor}">
  38. ID:123456
  39. </div>
  40. </div>
  41. </div>
  42. <div class="nav-right" v-if="permission.centerPage" :style="{color:levelStyle.nameColor}">
  43. <i class="el-icon-arrow-right"></i>
  44. </div>
  45. </div>
  46. <div class="assets-info">
  47. <!-- 循环渲染 后台组件无法滚动,处理为只显示三个-->
  48. <div :class="currencyClass" :style="[assetStyle]">
  49. <template v-for="(item,index) in assetList">
  50. <div :key="index" v-if="index<showNum">
  51. <div class="moeny">100</div>
  52. <div>{{item.title}}</div>
  53. </div>
  54. </template>
  55. </div>
  56. <div :style="hyphenStyle" class="indicator">
  57. <div class="indeic-1"></div>
  58. <div class="indeic-2"></div>
  59. </div>
  60. </div>
  61. </div>
  62. </template>
  63. <script>
  64. Vue.component('member-info-style1', {
  65. name: "member-info-style1",
  66. props: {
  67. activeItem: {
  68. type: Object,
  69. default () {
  70. return {}
  71. }
  72. }
  73. },
  74. template: '#member-info-style1',
  75. data() {
  76. return {
  77. static_img_prefix: '<?= Yii::getAlias('@attachurl') ?>'+'/static',
  78. showNum:50
  79. }
  80. },
  81. computed: {
  82. hyphenStyle(){
  83. let currencyStyle = this.activeItem.data.currencyStyle || 1
  84. let style = {}
  85. if(currencyStyle == 1){
  86. style['text-align'] = 'center'
  87. }else{
  88. style['display'] = 'none'
  89. }
  90. return style
  91. },
  92. currencyClass(){
  93. let currencyStyle = this.activeItem.data.currencyStyle || 1
  94. this.showNum = currencyStyle == 1 ? 3 : 50;
  95. return currencyStyle == 1 ? 'flex' : 'assets-info-grid';
  96. },
  97. iconStyle() {
  98. let obj = {
  99. color: this.activeItem.computedStyle.iconColor || '#fff',
  100. 'background-color': this.activeItem.computedStyle.iconBgColor || '#000',
  101. }
  102. return obj
  103. },
  104. cardStyle() {
  105. var bgColor = this.activeItem.computedStyle.tabSelectColor
  106. var shadowColor = this.activeItem.computedStyle.cardShadowColor
  107. var type = this.activeItem.computedStyle.cardBgType
  108. var brTop = this.activeItem.computedStyle.compRadiusTop,
  109. brBottom = this.activeItem.computedStyle.compRadiusBot;
  110. brTop = brTop == undefined ? 10 : brTop
  111. brBottom = brBottom == undefined ? 10 : brBottom
  112. var style = {
  113. borderRadius: `${brTop}px ${brTop}px ${brBottom}px ${brBottom}px`
  114. }
  115. if(bgColor != null){
  116. style['backgroundColor']= `${bgColor}`
  117. }
  118. if (shadowColor) {
  119. style['box-shadow'] = `${shadowColor} 0px 0px 25px`
  120. }
  121. if (type == 2) {
  122. style.backgroundImage = `url(${this.activeItem.computedStyle.tabSelectImg})`
  123. style.backgroundSize = `cover`
  124. }
  125. return style
  126. },
  127. levelStyle() {
  128. let {
  129. nameColor,
  130. memColor,
  131. memBgColor
  132. } = this.activeItem.computedStyle
  133. var obj = {
  134. nameColor: nameColor || '#fff',
  135. levelColor: memColor || '#fff',
  136. levelBgColor: memBgColor || '#000',
  137. }
  138. return obj
  139. },
  140. assetStyle() {
  141. var {
  142. assetColor
  143. } = this.activeItem.computedStyle
  144. return {
  145. color: assetColor
  146. }
  147. },
  148. permission() {
  149. let obj = {
  150. memberCode: false,
  151. level: false,
  152. set: false,
  153. centerPage: false
  154. }
  155. let type = ['memberCode', 'level', 'set', 'centerPage']
  156. let data = this.activeItem.computedStyle.contentList1 || [0, 1, 2, 3]
  157. data.forEach((index) => {
  158. const key = type[index]
  159. obj[key] = true
  160. })
  161. console.log('会员组件',obj)
  162. return obj
  163. },
  164. assetList() {
  165. let data = this.activeItem.data.contentList2 || []
  166. if (data.length) {
  167. const list = this.$capitals.filter(item => {
  168. return data.indexOf(item.code) !== -1
  169. })
  170. return list
  171. }
  172. return []
  173. }
  174. }
  175. });
  176. </script>
  177. <style lang="scss" scoped>
  178. .flex-y-center {
  179. display: flex;
  180. align-items: center;
  181. }
  182. .member-info-style1 {
  183. padding: 30px 20px 16px 20px;
  184. background-color: #E40A0A;
  185. position: relative;
  186. overflow: auto;
  187. .icon-info {
  188. position: absolute;
  189. display: flex;
  190. align-items: center;
  191. justify-content: center;
  192. right: 0;
  193. top: 0;
  194. width: 28px;
  195. height: 23px;
  196. border-radius: 0px 0 0px 12px;
  197. }
  198. /* .icon-info .icon {
  199. width: 24px;
  200. height: 24px;
  201. } */
  202. .icon-info .icon>i {
  203. font-size: 15px;
  204. }
  205. .user-avarat {
  206. width: 65px;
  207. height: 65px;
  208. margin-right: 12px;
  209. border-radius: 50%;
  210. background-color: #eee;
  211. .default_picture {
  212. width: 60px;
  213. height: 60px;
  214. }
  215. }
  216. .nav-right {
  217. display: flex;
  218. position: absolute;
  219. top: 50%;
  220. right: 0;
  221. transform: translateY(-50%);
  222. color: #fff;
  223. font-size: 12px;
  224. align-items: center;
  225. }
  226. .el-icon-arrow-right {
  227. font-size: 16px;
  228. }
  229. .user-info {
  230. position: relative;
  231. }
  232. .user-info>.flex {
  233. flex-direction: column;
  234. justify-content: center;
  235. }
  236. .user-name {
  237. font-size:14px;
  238. font-weight: bold;
  239. }
  240. .user-level-box {
  241. display: flex;
  242. align-items: center;
  243. flex-wrap: wrap;
  244. margin-top: 8px;
  245. }
  246. .user-level {
  247. display: flex;
  248. align-items: center;
  249. color: #FFF;
  250. background: #000;
  251. height: 15px;
  252. line-height: 15px;
  253. border-radius: 20px;
  254. text-align: right;
  255. padding-right: 8px;
  256. font-size: 11px;
  257. font-weight: bold;
  258. white-space:nowrap;
  259. margin-right: 6px;
  260. }
  261. .user-level>.level-icon {
  262. width: 16px;
  263. height: 16px;
  264. border-radius: 50%;
  265. margin-right: 4px;
  266. }
  267. .user-auto {
  268. margin-left:4px;
  269. background: #FFE7D2;
  270. border: 1px solid #FF8720;
  271. display: flex;
  272. align-items: center;
  273. color: #FF8720;
  274. height: 16px;
  275. line-height: 16px;
  276. border-radius: 20px;
  277. text-align: right;
  278. padding-right: 8px;
  279. font-size: 10px;
  280. white-space:nowrap;
  281. .auto-icon {
  282. width: 16px;
  283. height: 16px;
  284. border-radius: 50%;
  285. margin-right: 3px;
  286. margin-left: -7px;
  287. }
  288. }
  289. .invite_code ,.user-id{
  290. display: flex;
  291. align-items: center;
  292. color: #333;
  293. background: transparent ;
  294. height: 16px;
  295. line-height: 16px;
  296. border-radius: 20px;
  297. padding: 0 6px;
  298. font-size: 11px;
  299. }
  300. .assets-info {
  301. font-size: 12px;
  302. color: #fff;
  303. padding-top:30px;
  304. }
  305. .assets-info .moeny {
  306. font-size: 16px;
  307. line-height: 1.5;
  308. font-weight: bold;
  309. }
  310. .assets-info>.flex>div {
  311. flex: 1;
  312. text-align: center;
  313. }
  314. .assets-info-grid {
  315. display: grid;
  316. grid-template-columns: 1fr 1fr 1fr;
  317. grid-template-rows: 1fr;
  318. grid-row-gap: 20px;
  319. }
  320. .assets-info-grid > div {
  321. text-align: center;
  322. }
  323. .indicator{
  324. display: flex;
  325. justify-content: center;
  326. padding-top:20px;
  327. }
  328. .indicator > div {
  329. width: 14px;
  330. height: 3px;
  331. background: #FFFFFF;
  332. border-radius: 2px 2px 2px 2px;
  333. }
  334. .indeic-2 {
  335. margin-left:4px;
  336. opacity: 0.4;
  337. }
  338. }
  339. </style>