index.vue 8.9 KB

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