style1.php 11 KB

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