style1.php 6.9 KB

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