money.vue 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214
  1. <template>
  2. <app-layout>
  3. <view :class="[`nav main-between cross-center`]" style="background-color:#F84469;">
  4. <view class="nav-left">
  5. <view>{{custom_setting.menus.money.name}}</view>
  6. <view class="money">{{list.total_money?list.total_money:0}}元</view>
  7. </view>
  8. <view class="nav-right cross-center" @click="toDetail">
  9. <view style="background-color:#F84469;">{{custom_setting.menus.cash.name}}</view>
  10. </view>
  11. </view>
  12. <view class="info-item">
  13. <text>{{custom_setting.words.can_be_presented.name}}</text>
  14. <view class="use-money">{{list.money?list.money:0}}元</view>
  15. </view>
  16. <view class="info-item cash-money">
  17. <view class="money-info">
  18. <text>{{custom_setting.words.already_presented.name}}</text>
  19. <view class="use-money">{{list.cash_money?list.cash_money:0}}元</view>
  20. </view>
  21. <view>
  22. <text>{{custom_setting.words.pending_money.name}}</text>
  23. <view class="use-money">{{list.un_pay?list.un_pay:0}}元</view>
  24. </view>
  25. </view>
  26. <view @click="open=!open">
  27. <view class="info-item">
  28. <text>{{custom_setting.words.user_instructions.name}}</text>
  29. <view style="float:right">
  30. <image class="down" src="/static/image/share/img-share-down.png" v-if="open"></image>
  31. <image class="open" src="/static/image/share/img-share-right.png" v-else></image>
  32. </view>
  33. <text class="must" space="nbsp" v-if="open" v-text="config.content"></text>
  34. </view>
  35. </view>
  36. <view @click="toCash">
  37. <view class="submit">
  38. <button style="background-color:#F84469;">{{custom_setting.words.cash.name}}</button>
  39. </view>
  40. </view>
  41. </app-layout>
  42. </template>
  43. <script>
  44. import {mapState} from "vuex";
  45. export default {
  46. data() {
  47. return {
  48. open: false,
  49. list: [],
  50. config: []
  51. }
  52. },
  53. computed: {
  54. ...mapState({
  55. mall: state => state.mallConfig.mall,
  56. custom_setting: state => state.mallConfig.share_setting_custom,
  57. share_setting: state => state.mallConfig.share_setting,
  58. })
  59. },
  60. methods: {
  61. toCash() {
  62. uni.navigateTo({
  63. url: '/pages/share/cash/cash?money=' + this.list.money
  64. });
  65. },
  66. toDetail() {
  67. uni.navigateTo({
  68. url: '/pages/share/cash-detail/cash-detail'
  69. });
  70. },
  71. setting() {
  72. let that = this;
  73. that.$request({
  74. url: that.$api.share.setting,
  75. }).then(response=>{
  76. that.$hideLoading();
  77. if(response.code == 0) {
  78. that.config = response.msg.config;
  79. }else {
  80. uni.showToast({
  81. title: response.msg,
  82. icon: 'none',
  83. duration: 1000
  84. });
  85. }
  86. }).catch(response => {
  87. that.$hideLoading();
  88. });
  89. },
  90. },
  91. onLoad() {
  92. let that = this;
  93. uni.setNavigationBarTitle({
  94. title: that.custom_setting.menus.money.name
  95. });
  96. that.$showLoading({
  97. type: 'global',
  98. text: '加载中...'
  99. });
  100. that.$request({
  101. url: that.$api.share.brokerage,
  102. }).then(response=>{
  103. if(response.code == 0) {
  104. that.list = response.data.list;
  105. that.setting();
  106. }else {
  107. uni.showToast({
  108. title: response.msg,
  109. icon: 'none',
  110. duration: 1000
  111. });
  112. }
  113. }).catch(response => {
  114. that.$hideLoading();
  115. });
  116. }
  117. }
  118. </script>
  119. <style scoped lang="scss">
  120. .nav {
  121. padding: #{24rpx};
  122. height: #{160rpx};
  123. color: #fff;
  124. background-color: #ff4544;
  125. }
  126. .money {
  127. margin-top: #{15rpx};
  128. font-size: #{46rpx};
  129. }
  130. .nav-right {
  131. width: auto;
  132. height: #{112rpx};
  133. }
  134. .nav-right view {
  135. background-color: #ff4544;
  136. color: #fff;
  137. border: #{2rpx} solid #fff;
  138. padding: 0 #{30rpx};
  139. height: #{54rpx};
  140. line-height: #{52rpx};
  141. border-radius: #{27rpx};
  142. font-size: #{28rpx};
  143. }
  144. .nav-right button::after {
  145. border: 0;
  146. }
  147. .info-item {
  148. background-color: #fff;
  149. padding: #{24rpx};
  150. font-size: #{28rpx};
  151. width: 100%;
  152. color: #353535;
  153. }
  154. .info-item.cash-money {
  155. margin: #{20rpx} 0;
  156. }
  157. .use-money {
  158. float: right;
  159. color: #666;
  160. }
  161. .money-info {
  162. border-bottom: #{1rpx} solid #e2e2e2;
  163. padding-bottom: #{24rpx};
  164. margin-bottom: #{24rpx};
  165. }
  166. .open {
  167. width: #{16rpx};
  168. height: #{26rpx};
  169. }
  170. .down {
  171. height: #{16rpx};
  172. width: #{26rpx};
  173. }
  174. .submit {
  175. width: 90%;
  176. margin: #{40rpx} auto;
  177. }
  178. .submit button {
  179. color: #fff;
  180. font-size: #{30rpx};
  181. height: #{80rpx};
  182. border-radius: #{40rpx};
  183. line-height: #{80rpx};
  184. background: #ff4544;
  185. }
  186. button:active {
  187. background-color: rgba(0, 0, 0, 0.2);
  188. }
  189. .must {
  190. display: block;
  191. padding-top: #{24rpx};
  192. font-size: #{26rpx};
  193. }
  194. </style>