index.vue 8.9 KB

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