bonus.vue 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192
  1. <template>
  2. <app-layout>
  3. <view class="header cross-center dir-top-nowrap" :style="{'background-image': `url(${region.stock})`}">
  4. <view>{{setting.form && setting.form.bouns ? setting.form.bouns : '代理分红'}}(元)</view>
  5. <view class="detail-price">{{detail.all_bonus ? detail.all_bonus : '0.00'}}</view>
  6. <view @click="toDetail" class="to-cash">
  7. <text>{{cash_detail?cash_detail:'提现明细'}}</text>
  8. <image class="arrow-right" src='/static/image/icon/arrow-right-white.png'></image>
  9. </view>
  10. </view>
  11. <view class="cell">
  12. <view class="main-between cell-item">
  13. <view class="label">{{setting.form && setting.form.total_bonus_text ? setting.form.total_bonus_text : '可提现分红'}}</view>
  14. <view>{{detail.total_bonus ? detail.total_bonus: '0.00'}}元</view>
  15. </view>
  16. </view>
  17. <view class="cell">
  18. <view class="main-between cell-item">
  19. <view class="label">{{setting.form && setting.form.cash_bonus_text ? setting.form.cash_bonus_text : '已提现分红'}}</view>
  20. <view>{{detail.cash_bonus ? detail.cash_bonus : '0.00'}}元</view>
  21. </view>
  22. <view class="main-between cell-item">
  23. <view class="label">{{setting.form && setting.form.loading_bonus_text ? setting.form.loading_bonus_text : '待打款分红'}}</view>
  24. <view>{{detail.loading_bonus ? detail.loading_bonus : '0.00'}}元</view>
  25. </view>
  26. </view>
  27. <view @click="show=!show" class="cell">
  28. <view class="main-between cell-item">
  29. <view class="label">用户须知</view>
  30. <view>
  31. <image :class="['arrow-right',`${show ? 'show' : ''}`,]" src='/static/image/icon/arrow-right.png'></image>
  32. </view>
  33. </view>
  34. <view v-if="show" class="content">
  35. <text>{{detail.user_instructions}}</text>
  36. </view>
  37. </view>
  38. <view @click="toCash" class="cash">{{setting.form && setting.form.to_cash ? setting.form.to_cash : '我要提现'}}</view>
  39. </app-layout>
  40. </template>
  41. <script>
  42. import { mapState } from "vuex";
  43. export default {
  44. data() {
  45. return {
  46. show: false,
  47. cash_detail: '',
  48. setting: {},
  49. detail: {}
  50. }
  51. },
  52. computed: {
  53. ...mapState({
  54. region: state => state.mallConfig.__wxapp_img.region,
  55. })
  56. },
  57. methods: {
  58. toCash() {
  59. uni.navigateTo({
  60. url: '/plugins/region/cash/cash'
  61. });
  62. },
  63. toDetail() {
  64. let name = this.cash_detail ? this.cash_detail : '';
  65. uni.navigateTo({
  66. url: '/plugins/region/cash-detail/cash-detail?name=' + name
  67. });
  68. },
  69. getSetting() {
  70. let that = this;
  71. that.$showLoading({
  72. type: 'global',
  73. text: '加载中...'
  74. });
  75. that.$request({
  76. url: that.$api.region.setting,
  77. }).then(response=>{
  78. that.getInfo();
  79. if(response.code == 0) {
  80. that.setting = response.data;
  81. }else {
  82. uni.showToast({
  83. title: response.msg,
  84. icon: 'none',
  85. duration: 1000
  86. });
  87. }
  88. }).catch(response => {
  89. that.$hideLoading();
  90. uni.hideLoading();
  91. });
  92. },
  93. getInfo() {
  94. let that = this;
  95. that.$request({
  96. url: that.$api.region.info,
  97. }).then(response=>{
  98. that.$hideLoading();
  99. if(response.code == 0) {
  100. that.detail = response.data;
  101. }else {
  102. uni.showToast({
  103. title: response.msg,
  104. icon: 'none',
  105. duration: 1000
  106. });
  107. }
  108. }).catch(response => {
  109. that.$hideLoading();
  110. });
  111. },
  112. },
  113. onLoad(options) { this.$commonLoad.onload(options);
  114. this.getSetting();
  115. if(options.name) {
  116. uni.setNavigationBarTitle({
  117. title: options.name,
  118. })
  119. }
  120. if(options.cash_detail) {
  121. this.cash_detail = options.cash_detail;
  122. }
  123. }
  124. }
  125. </script>
  126. <style scoped lang="scss">
  127. .arrow-right {
  128. height:#{20rpx};
  129. width:#{12rpx};
  130. }
  131. .arrow-right.show {
  132. transform:rotate(90deg);
  133. }
  134. .header {
  135. height: #{300rpx};
  136. width: 100%;
  137. background-size: 100% 100%;
  138. color: #fff;
  139. font-size: #{28rpx};
  140. padding: #{50rpx} 0;
  141. .detail-price {
  142. font-size: #{80rpx};
  143. font-family: DIN;
  144. margin: #{10rpx} 0 #{24rpx};
  145. }
  146. .to-cash {
  147. font-size: #{26rpx};
  148. .arrow-right {
  149. margin-left:#{16rpx};
  150. }
  151. }
  152. }
  153. .cell {
  154. font-size: #{28rpx};
  155. color: #666666;
  156. margin: #{20rpx} #{24rpx} 0;
  157. width: #{702rpx};
  158. background-color: #fff;
  159. padding: 0 #{32rpx};
  160. border-radius: #{8rpx};
  161. .cell-item {
  162. border-top: #{2rpx} solid #e2e2e2;
  163. height: #{96rpx};
  164. line-height: #{96rpx};
  165. .label {
  166. color: #353535;
  167. }
  168. }
  169. .cell-item:first-of-type {
  170. border-top: 0;
  171. }
  172. .content {
  173. font-size: #353535;
  174. padding-bottom: #{24rpx};
  175. }
  176. }
  177. .cash {
  178. width: #{702rpx};
  179. height: #{80rpx};
  180. line-height: #{80rpx};
  181. text-align: center;
  182. margin: #{40rpx} auto 0;
  183. border-radius: #{40rpx};
  184. background-color: #ff4544;
  185. color: #fff;
  186. font-size: #{32rpx};
  187. }
  188. </style>