index.vue 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449
  1. <template>
  2. <view :data-theme="theme" class="user_payment">
  3. <workNavBar titleText="工作台" bagColor="#f5f5f5" :iconColor="iconColor" :textColor="iconColor" :isScrolling="isScrolling" showBack>
  4. <view class="word_header_text">
  5. <view class="text-box line1 wx-text-box">
  6. 资金转入
  7. </view>
  8. </view>
  9. </workNavBar>
  10. <form @submit="submitSub" report-submit='true'>
  11. <view class="payment-top acea-row row-column row-center-wrapper">
  12. <span class="name1">转入至</span>
  13. <span class="name2"><text class="iconfont icon-yue"></text>余额</span>
  14. </view>
  15. <view class="payment">
  16. <view class="tip">
  17. <view class="pay-money">
  18. 转入金额
  19. </view>
  20. <view class='input'><text>¥</text>
  21. <input placeholder="0.00" type='number' v-model="toPrice" placeholder-class='placeholder'></input></view>
  22. <view class="tips-title">
  23. <view style="font-weight: bold; font-size: 26rpx;">提示:</view>
  24. <view style="margin-top: 10rpx;">
  25. 当前收益为 <text class=' mr10'>¥{{nowMoney || 0}}, </text>
  26. <text class="font-color" @click="getAll">全部转入</text>
  27. </view>
  28. </view>
  29. <view class="tips-box">
  30. <view class="tips mt-30">注意事项:</view>
  31. <view class="tips-samll" v-for="item in noticeList" :key="item">
  32. {{ item }}
  33. </view>
  34. </view>
  35. </view>
  36. <button class='but' :class="parseFloat(this.nowMoney)<=0?'bg-color-hui':''" formType="submit"> 立即转入</button>
  37. <view class="alipaysubmit" v-html="formContent"></view>
  38. </view>
  39. </form>
  40. </view>
  41. </template>
  42. <script>
  43. // +----------------------------------------------------------------------
  44. // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
  45. // +----------------------------------------------------------------------
  46. // | Copyright (c) 2016~2025 https://www.crmeb.com All rights reserved.
  47. // +----------------------------------------------------------------------
  48. // | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
  49. // +----------------------------------------------------------------------
  50. // | Author: CRMEB Team <admin@crmeb.com>
  51. // +----------------------------------------------------------------------
  52. import workNavBar from '../components/workNavBar.vue';
  53. import {
  54. transferIn,
  55. getRechargeApi
  56. } from '@/api/user.js';
  57. import {
  58. toLogin
  59. } from '@/libs/login.js';
  60. import {
  61. mapGetters
  62. } from "vuex";
  63. import {Debounce} from '@/utils/validate.js'
  64. let app = getApp();
  65. export default {
  66. components: {
  67. workNavBar
  68. },
  69. data() {
  70. let that = this;
  71. return {
  72. toPrice: '',
  73. placeholder: "0.00",
  74. packageList: [],
  75. noticeList: [],
  76. theme:app.globalData.theme,
  77. formContent:'',
  78. nowMoney: 0,
  79. iconColor: '#000000'
  80. };
  81. },
  82. watch:{
  83. isLogin:{
  84. handler:function(newV,oldV){
  85. if(newV){
  86. this.getRecharge();
  87. }
  88. },
  89. deep:true
  90. }
  91. },
  92. computed: mapGetters(['isLogin', 'systemPlatform','userInfo']),
  93. onLoad(options) {
  94. this.nowMoney = options.brokeragePrice
  95. if (this.isLogin) {
  96. this.getRecharge();
  97. } else {
  98. toLogin();
  99. }
  100. },
  101. methods: {
  102. /**
  103. * 充值额度选择
  104. */
  105. getRecharge() {
  106. getRechargeApi()
  107. .then(res => {
  108. this.noticeList = res.data.noticeList || [];
  109. })
  110. .catch(res => {
  111. this.$dialog.toast({
  112. mes: res
  113. });
  114. });
  115. },
  116. getAll(){
  117. if(parseFloat(this.nowMoney)<=0) {
  118. return this.$util.Tips({
  119. title: '您暂无收益'
  120. });
  121. }
  122. this.toPrice = this.nowMoney
  123. },
  124. navRecharges: function(index) {
  125. this.active = index;
  126. },
  127. /*
  128. * 立即转入
  129. */
  130. submitSub: Debounce(function(e) {
  131. let that = this
  132. if(parseFloat(that.nowMoney)<=0) {
  133. return
  134. }
  135. // 转入余额
  136. if (parseFloat(that.toPrice) < 0 || parseFloat(that.toPrice) == NaN || that.toPrice == undefined || that.toPrice == "") {
  137. return that.$util.Tips({
  138. title: '请输入金额'
  139. });
  140. }
  141. uni.showModal({
  142. title: '转入余额',
  143. content: '转入余额后无法再次转出,确认是否转入余额',
  144. success(res) {
  145. if (res.confirm) {
  146. transferIn({
  147. price: parseFloat(that.toPrice)
  148. }).then(res => {
  149. return that.$util.Tips({
  150. title: '转入成功',
  151. icon: 'success'
  152. }, {
  153. tab: 5,
  154. url: '/pages/rider_index/cashwithdrawal/index'
  155. });
  156. }).catch(err=>{
  157. return that.$util.Tips({
  158. title: err
  159. });
  160. })
  161. } else if (res.cancel) {
  162. return that.$util.Tips({
  163. title: '已取消'
  164. });
  165. }
  166. },
  167. })
  168. })
  169. }
  170. }
  171. </script>
  172. <style lang="scss">
  173. .user_payment{
  174. height: 100vh;
  175. background-color: #fff;
  176. }
  177. .payment {
  178. position: relative;
  179. top: -60rpx;
  180. width: 100%;
  181. background-color: #fff;
  182. border-radius: 10rpx;
  183. padding-top: 25rpx;
  184. border-top-right-radius: 14rpx;
  185. border-top-left-radius: 14rpx;
  186. }
  187. .payment .nav {
  188. height: 75rpx;
  189. line-height: 75rpx;
  190. padding: 0 100rpx;
  191. }
  192. .payment .nav .item {
  193. font-size: 30rpx;
  194. color: #333;
  195. }
  196. .payment .nav .item.on {
  197. font-weight: bold;
  198. @include tab_border_bottom(theme);
  199. }
  200. .payment .input {
  201. display: flex;
  202. align-items: center;
  203. border-bottom: 1px dashed #dddddd;
  204. margin: 32rpx auto 0 auto;
  205. padding-bottom: 20rpx;
  206. font-size: 56rpx;
  207. color: #333333;
  208. flex-wrap: nowrap;
  209. }
  210. .payment .input text {
  211. // padding-left: 106rpx;
  212. }
  213. .payment .input input {
  214. width: 310rpx;
  215. height: 94rpx;
  216. text-align: center;
  217. font-size: 70rpx;
  218. }
  219. .payment .placeholder {
  220. color: #d0d0d0;
  221. height: 100%;
  222. line-height: 94rpx;
  223. }
  224. .payment .tip {
  225. font-size: 26rpx;
  226. color: #888888;
  227. padding: 0 30rpx;
  228. // margin-top: 25rpx;
  229. }
  230. .payment .but {
  231. color: #fff;
  232. font-size: 30rpx;
  233. width: 700rpx;
  234. height: 86rpx;
  235. border-radius: 43rpx;
  236. margin: 50rpx auto 0 auto;
  237. @include linear-gradient(theme);
  238. line-height: 86rpx;
  239. }
  240. .payment-top {
  241. width: 100%;
  242. height: 278rpx;
  243. @include main_bg_color(theme);
  244. .name1 {
  245. font-size: 26rpx;
  246. color: rgba(255, 255, 255, 0.8);
  247. margin-top: -38rpx;
  248. margin-bottom: 16rpx;
  249. }
  250. .name2 {
  251. font-size: 36rpx;
  252. color: rgba(255, 255, 255, 0.8);
  253. }
  254. .icon-yue {
  255. font-size: 42rpx;
  256. margin-right: 8rpx;
  257. }
  258. .pic {
  259. font-size: 32rpx;
  260. color: #fff;
  261. }
  262. .pic-font {
  263. font-size: 78rpx;
  264. color: #fff;
  265. }
  266. }
  267. .picList {
  268. display: flex;
  269. flex-wrap: wrap;
  270. margin: 30rpx 0;
  271. .pic-box {
  272. width: 32%;
  273. height: auto;
  274. border-radius: 20rpx;
  275. margin-top: 21rpx;
  276. padding: 20rpx 0;
  277. margin-right: 12rpx;
  278. &:nth-child(3n) {
  279. margin-right: 0;
  280. }
  281. }
  282. .pic-box-color {
  283. background-color: #f4f4f4;
  284. color: #656565;
  285. }
  286. .pic-number {
  287. font-size: 22rpx;
  288. }
  289. .pic-number-pic {
  290. font-size: 38rpx;
  291. margin-right: 10rpx;
  292. text-align: center;
  293. }
  294. }
  295. .pic-box-color-active {
  296. @include linear-gradient(theme);
  297. color: #fff !important;
  298. }
  299. .tips-box {
  300. .tips {
  301. font-size: 28rpx;
  302. color: #333333;
  303. font-weight: 800;
  304. margin-bottom: 14rpx;
  305. margin-top: 20rpx;
  306. }
  307. .tips-samll {
  308. font-size: 24rpx;
  309. color: #333333;
  310. margin-bottom: 14rpx;
  311. }
  312. .tip-box {
  313. margin-top: 30rpx;
  314. }
  315. }
  316. .tips-title {
  317. margin-top: 20rpx;
  318. font-size: 24rpx;
  319. color: #333;
  320. }
  321. .wrapper .item textarea {
  322. background-color: #f9f9f9;
  323. width: auto !important;
  324. height: 140rpx;
  325. border-radius: 14rpx;
  326. margin-top: 30rpx;
  327. padding: 15rpx;
  328. box-sizing: border-box;
  329. font-weight: 400;
  330. }
  331. .px-30{
  332. padding-left: 30rpx;
  333. padding-rigt: 30rpx;
  334. }
  335. .wrapper .item .placeholder {
  336. color: #ccc;
  337. }
  338. .wrapper .item .list {
  339. margin-top: 35rpx;
  340. }
  341. .wrapper .item .list .payItem {
  342. border: 1px solid #eee;
  343. border-radius: 14rpx;
  344. height: 86rpx;
  345. width: 95%;
  346. box-sizing: border-box;
  347. margin-top: 20rpx;
  348. font-size: 28rpx;
  349. color: #282828;
  350. }
  351. .wrapper .item .list .payItem.on {
  352. // border-color: #fc5445;
  353. @include coupons_border_color(theme);
  354. color: $theme-color;
  355. }
  356. .name {
  357. width: 50%;
  358. text-align: center;
  359. border-right: 1px solid #eee;
  360. }
  361. .name .iconfont {
  362. width: 44rpx;
  363. height: 44rpx;
  364. border-radius: 50%;
  365. text-align: center;
  366. line-height: 44rpx;
  367. background-color: #fe960f;
  368. color: #fff;
  369. font-size: 30rpx;
  370. margin-right: 15rpx;
  371. }
  372. .name .iconfont.icon-weixin2 {
  373. background-color: #41b035;
  374. }
  375. .name .iconfont.icon-zhifubao {
  376. background-color: #00AAEA;
  377. }
  378. .payItem .tip {
  379. width: 49%;
  380. text-align: center;
  381. font-size: 26rpx;
  382. color: #aaa;
  383. }
  384. .pay-money {
  385. margin-top: 30rpx;
  386. color: #333;
  387. }
  388. .word_header_text {
  389. /* #ifdef H5 */
  390. margin-top: 20rpx;
  391. /* #endif */
  392. color: #fff;
  393. text-align: center;
  394. display: flex;
  395. align-items: center;
  396. justify-content: center;
  397. .popup-box {
  398. text-align: right;
  399. width: 180rpx;
  400. overflow: hidden;
  401. white-space: nowrap;
  402. text-overflow: ellipsis;
  403. }
  404. .icon-xiangxia {
  405. font-size: 18rpx;
  406. }
  407. }
  408. .wx-text-box{
  409. max-width: 240rpx;
  410. }
  411. .text-box {
  412. flex: 1;
  413. padding-left: 16rpx;
  414. color: #000000;
  415. }
  416. </style>