jfchange.vue 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283
  1. <template>
  2. <view class="content">
  3. <view class="content-money">
  4. <view class="flex " style="width: 750rpx;justify-content: space-around;margin-left: 0;">
  5. <view class="buttom">
  6. <view class="icon">{{ userInfo.integral | getMoneyStyle }}</view>
  7. <text class="text">可转账积分</text>
  8. </view>
  9. </view>
  10. </view>
  11. <view class="row-box margin-t-20">
  12. <view class="title">转账积分</view>
  13. <view class="row">
  14. <input class="input" type="number" v-model="withdrawal" placeholder="请输入转账积分"
  15. placeholder-class="placeholder" />
  16. <view class="buttom" @click="withdrawal = userInfo.integral">全部积分</view>
  17. </view>
  18. </view>
  19. <view class="row-box margin-t-20">
  20. <view class="title">用户ID</view>
  21. <view class="row">
  22. <input class="input" type="number" v-model="uid" placeholder="请填写转账到的用户ID"
  23. placeholder-class="placeholder" />
  24. </view>
  25. </view>
  26. <button class="add-btn up" @click="confirm">提交申请</button>
  27. <!-- <button class="add-btn modified" v-if="!weichatBsrowser" @click="navTo('/pages/money/account')">账号管理</button> -->
  28. </view>
  29. </template>
  30. <script>
  31. import {
  32. getMoneyStyle
  33. } from '@/utils/rocessor.js';
  34. import {
  35. tradeUser
  36. } from '@/api/new.js';
  37. import {
  38. getUserInfo
  39. } from '@/api/user.js';
  40. import {
  41. mapState,
  42. mapMutations
  43. } from 'vuex';
  44. export default {
  45. filters: {
  46. getMoneyStyle
  47. },
  48. computed: {
  49. ...mapState('user', ['userInfo', 'hasLogin'])
  50. },
  51. data() {
  52. return {
  53. type: 'bank', //提现方式
  54. money: '0.00', //可提现金额
  55. freeze: '0.0', //冻结金额
  56. withdrawal: '',
  57. uid: '', //提现金额
  58. };
  59. },
  60. onLoad(options) {},
  61. methods: {
  62. ...mapMutations('user', ['setUserInfo']),
  63. // 跳转
  64. navTo(url) {
  65. uni.navigateTo({
  66. url: url
  67. });
  68. },
  69. // 提交
  70. confirm() {
  71. let obj = this
  72. let data = {
  73. num: this.withdrawal, //金额
  74. uid: this.uid //0佣金1余额
  75. };
  76. tradeUser(data)
  77. .then(e => {
  78. getUserInfo({})
  79. .then(({
  80. data
  81. }) => {
  82. this.setUserInfo(data);
  83. })
  84. .catch(e => {
  85. console.log(e);
  86. });
  87. uni.showToast({
  88. title: '申请成功!',
  89. duration: 2000,
  90. position: 'top'
  91. });
  92. })
  93. .catch(e => {
  94. console.log();
  95. });
  96. }
  97. }
  98. };
  99. </script>
  100. <style lang="scss">
  101. page {
  102. height: 100%;
  103. }
  104. .content-money {
  105. padding: 30rpx 0;
  106. background: #ffffff;
  107. }
  108. .flex {
  109. background-color: #ffffff;
  110. text-align: center;
  111. margin: 0 30rpx;
  112. border-radius: $border-radius-sm;
  113. .buttom {
  114. font-size: $font-lg;
  115. width: 50%;
  116. }
  117. .interval {
  118. width: 2px;
  119. height: 60rpx;
  120. background-color: #eeeeee;
  121. }
  122. .icon {
  123. background-size: 100%;
  124. font-size: 42rpx;
  125. color: $font-color-dark;
  126. font-weight: bold;
  127. background-repeat: no-repeat;
  128. background-position: center;
  129. }
  130. .text {
  131. color: $font-color-light;
  132. }
  133. }
  134. .row-box {
  135. padding: 20rpx 30rpx;
  136. background: #fff;
  137. .title {
  138. font-size: $font-base + 2rpx;
  139. color: $font-color-dark;
  140. }
  141. .row {
  142. display: flex;
  143. align-items: center;
  144. position: relative;
  145. height: 80rpx;
  146. .tit {
  147. flex-shrink: 0;
  148. width: 40rpx;
  149. font-size: 30rpx;
  150. color: $font-color-dark;
  151. }
  152. .input {
  153. flex: 1;
  154. font-size: 30rpx;
  155. color: $font-color-dark;
  156. }
  157. .iconlocation {
  158. font-size: 36rpx;
  159. color: $font-color-light;
  160. }
  161. .buttom {
  162. font-size: $font-base;
  163. }
  164. }
  165. }
  166. .add-btn {
  167. background: linear-gradient(-90deg, #FAC545, #FFE000);
  168. border-radius: 10px;
  169. width: 690rpx;
  170. height: 80rpx;
  171. margin: 0 auto;
  172. margin-top: 30rpx;
  173. font-size: $font-lg;
  174. border-radius: 10rpx;
  175. color: #6B4216;
  176. &.up {
  177. background-color: $base-color;
  178. color: #fff;
  179. }
  180. }
  181. .list {
  182. padding-left: 30rpx;
  183. margin-top: 30rpx;
  184. background-color: #ffffff;
  185. .box {
  186. display: flex;
  187. align-items: center;
  188. width: 100%;
  189. height: 120rpx;
  190. border-bottom: 1px solid $border-color-light;
  191. .icon {
  192. font-size: 48rpx;
  193. padding-right: 20rpx;
  194. .icon-img {
  195. height: 50rpx;
  196. width: 50rpx;
  197. }
  198. }
  199. .iconweixin1 {
  200. color: #18bf16;
  201. }
  202. .iconzhifubao {
  203. color: #08aaec;
  204. }
  205. .title-box {
  206. flex-grow: 1;
  207. text-align: left;
  208. .title {
  209. font-size: $font-base + 2rpx;
  210. color: $font-color-base;
  211. }
  212. .node {
  213. font-size: $font-sm;
  214. color: $font-color-light;
  215. }
  216. }
  217. }
  218. }
  219. /deep/ .uni-radio-input {
  220. width: 45rpx;
  221. height: 45rpx;
  222. }
  223. .row {
  224. display: flex;
  225. align-items: center;
  226. position: relative;
  227. padding: 0 30upx;
  228. height: 110upx;
  229. background: #fff;
  230. .tit {
  231. flex-shrink: 0;
  232. width: 250upx;
  233. font-size: 30upx;
  234. color: $font-color-dark;
  235. }
  236. .input {
  237. flex: 1;
  238. font-size: 30upx;
  239. color: $font-color-dark;
  240. }
  241. .iconlocation {
  242. font-size: 36upx;
  243. color: $font-color-light;
  244. }
  245. }
  246. .tip {
  247. padding: 20rpx;
  248. color: #FD3B39;
  249. }
  250. </style>