style1.php 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203
  1. <template id="commission-info-style1">
  2. <div class="commission-info-style1" :style="[cardStyle]">
  3. <div class="my-income-container">
  4. <span :style="[myIncomeStyle]">{{cardText}}</span>
  5. </div>
  6. <div class="money-container">
  7. <span class="money-container-item-1" :style="[moneyStyle]">
  8. <span v-if="getIsHiddenUnit">¥</span>
  9. <span>0.94</span>
  10. </span>
  11. <span class="money-container-item-2" :style="[withdrawBtnStyle]">提现</span>
  12. </div>
  13. <div v-if="getIsHiddenDetail">
  14. <span class="account-container-item" :style="[accountDetailsBtnStyle]">账单详情</span>
  15. </div>
  16. <div class="remind-container">
  17. <span class="remind-container-item" :style="[reminderStyle]">
  18. <span class="remind-container-item-1"> <img style="max-width: 24px;max-height: height 24px;" :src="getRemindImg"></span>
  19. <span>{{remindText}}</span>
  20. </span>
  21. </div>
  22. </div>
  23. </template>
  24. <script>
  25. Vue.component('commission-info-style1', {
  26. name: "commission-info-style1",
  27. props: {
  28. activeItem: {
  29. type: Object,
  30. default () {
  31. return {}
  32. }
  33. }
  34. },
  35. template: '#commission-info-style1',
  36. data() {
  37. return {
  38. remindText: '每月25~31号可提现结算收益',
  39. cardText: '我的收益(元)',
  40. }
  41. },
  42. watch: {
  43. "activeItem.data": {
  44. handler(newVal, oldVal) {
  45. if (newVal && !deepEqual(newVal, oldVal)) {
  46. if (newVal.reminderInfo) {
  47. this.remindText = newVal.reminderInfo.text
  48. }
  49. if (newVal.dependentInfo) {
  50. this.cardText = newVal.dependentInfo.cardText
  51. }
  52. }
  53. },
  54. immediate: true
  55. },
  56. },
  57. computed: {
  58. cardStyle() {
  59. var bgColor = this.activeItem.computedStyle.tabSelectColor
  60. var shadowColor = this.activeItem.computedStyle.cardShadowColor
  61. var type = this.activeItem.computedStyle.cardBgType
  62. var brTop = this.activeItem.computedStyle.compRadiusTop,
  63. brBottom = this.activeItem.computedStyle.compRadiusBot;
  64. var style = {
  65. backgroundColor: `${bgColor}`,
  66. borderRadius: `${brTop}px ${brTop}px ${brBottom}px ${brBottom}px`
  67. }
  68. if (shadowColor) {
  69. style['box-shadow'] = `${shadowColor} 0px 0px 25px`
  70. }
  71. if (type == 2) {
  72. style.backgroundImage = `url(${this.activeItem.computedStyle.tabSelectImg})`
  73. style.backgroundSize = `cover`
  74. }
  75. return style
  76. },
  77. withdrawBtnStyle() {
  78. return {
  79. backgroundColor: this.activeItem.computedStyle.withdrawBtnColor
  80. }
  81. },
  82. accountDetailsBtnStyle() {
  83. let style = {
  84. backgroundColor: this.activeItem.computedStyle.accountDetailsBtnColor
  85. }
  86. return style
  87. },
  88. myIncomeStyle() {
  89. return {
  90. color: this.activeItem.computedStyle.myIncomeColor,
  91. fontSize: '17px'
  92. }
  93. },
  94. moneyStyle() {
  95. return {
  96. color: this.activeItem.computedStyle.moneyColor,
  97. fontSize: '24px'
  98. }
  99. },
  100. reminderStyle() {
  101. return {
  102. backgroundColor: this.activeItem.computedStyle.reminderBgColor
  103. }
  104. },
  105. getRemindImg() {
  106. let remindImg = this.activeItem.computedStyle.reminderImg
  107. return remindImg ? remindImg : 'resources/img/decorate/commission-info/bell.png'
  108. },
  109. getIsHiddenDetail() {
  110. let dependentInfo = this.activeItem.data.dependentInfo || {}
  111. return dependentInfo.isHiddenDetail == 1 ? false : true
  112. },
  113. getIsHiddenUnit() {
  114. let dependentInfo = this.activeItem.data.dependentInfo || {}
  115. return dependentInfo.isHiddenUnit == 1 ? false : true
  116. },
  117. permission() {
  118. let obj = {
  119. memberCode: false,
  120. news: false,
  121. set: false,
  122. centerPage: false
  123. }
  124. let type = ['memberCode', 'news', 'set', 'centerPage']
  125. let data = this.activeItem.computedStyle.contentList1 || [0, 1, 2, 3]
  126. data.forEach((index) => {
  127. const key = type[index]
  128. obj[key] = true
  129. })
  130. return obj
  131. },
  132. }
  133. });
  134. </script>
  135. <style>
  136. .commission-info-style1 {
  137. padding: 8px;
  138. background-color: #E40A0A;
  139. }
  140. .my-income-container {
  141. padding: 10px 0 0 13px;
  142. }
  143. .money-container {
  144. display: flex;
  145. justify-content: space-between;
  146. padding: 4px 10px;
  147. }
  148. .money-container-item-1 {
  149. display: flex;
  150. align-items: center;
  151. color: #fff;
  152. font-weight: bold;
  153. font-size: 26px
  154. }
  155. .money-container-item-2 {
  156. display: inline-block;
  157. padding: 6px 30px;
  158. border-radius: 20px;
  159. color: #fff
  160. }
  161. .remind-container {
  162. padding-top: 6px;
  163. padding-bottom: 10px;
  164. color: #fff;
  165. }
  166. .remind-container-item {
  167. display: inline-flex;
  168. align-items: center;
  169. padding: 0 10px;
  170. border-radius: 20px;
  171. color: #fff;
  172. margin-left: 10px;
  173. }
  174. .remind-container-item-1 {
  175. display: inline-block;
  176. padding-right: 3px;
  177. padding-top: 2px;
  178. }
  179. .account-container {
  180. padding: 10px 0
  181. }
  182. .account-container-item {
  183. display: inline-block;
  184. padding: 6px 30px;
  185. border-radius: 20px;
  186. color: #fff;
  187. margin-left: 10px;
  188. }
  189. </style>