index.vue 8.0 KB

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