You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

361 lines
10 KiB

6 months ago
  1. <template>
  2. <view>
  3. <view class="tabr" :style="{top:headerTop}">
  4. <view :class="{on:typeClass=='valid'}" @tap="switchType('valid')">提现申请</view><view :class="{on:typeClass=='invalid'}" @tap="switchType('invalid')">提现记录</view>
  5. <view class="border" :class="typeClass"></view>
  6. </view>
  7. <view class="place" ></view>
  8. <view class="list">
  9. <!-- 申请提现 -->
  10. <view class="sub-list valid" :class="subState">
  11. <view class="txmain">
  12. <view class="moneytitle">可提现金额<span>{{userinfo['yue']}}</span></view>
  13. <view class="moneytip">提现金额<input type="text" v-model="inputAmount" placeholder="输入提现金额" @input='inputamountchange'/><view class="all" @click="settmoney()">全部</view></view>
  14. <view class="btnContent">
  15. <view
  16. class="btn df"
  17. @click="submit"
  18. >提交</view>
  19. </view>
  20. </view>
  21. </view>
  22. <view class="sub-list invalid" :class="subState">
  23. <view class="listtitle">
  24. <view class="listmoney">提现金额</view>
  25. <view class="listtime">申请时间</view>
  26. <view class="liststate">状态</view>
  27. </view>
  28. <view class="tis" v-if="couponValidList.length==0">暂无数据~</view>
  29. <view class="row" v-for="(row,index) in couponValidList" :key="index" >
  30. <view class="listvalue">
  31. <view class="valuemoney">{{row.money}}</view>
  32. <view class="valuetime">{{row.addtime}}</view>
  33. <view class="valuestate">{{row.state == 1?'已提现':(row.state == 2?'已拒绝':'待到账') }}</view>
  34. </view>
  35. </view>
  36. </view>
  37. </view>
  38. </view>
  39. </template>
  40. <script>
  41. export default {
  42. data() {
  43. return {
  44. showcan:false,
  45. inputAmount:'',//金额
  46. getmoney:20,
  47. userinfo:[],
  48. couponValidList:[],
  49. headerTop:0,
  50. //控制滑动效果
  51. typeClass:'valid',
  52. subState:'',
  53. theIndex:null,
  54. oldIndex:null,
  55. isStop:false
  56. }
  57. },
  58. onPageScroll(e){
  59. },
  60. //下拉刷新,需要自己在page.json文件中配置开启页面下拉刷新 "enablePullDownRefresh": true
  61. onPullDownRefresh() {
  62. setTimeout(function () {
  63. uni.stopPullDownRefresh();
  64. }, 1000);
  65. },
  66. onLoad(option) {
  67. let getphone = parseInt(option.phone);
  68. let getuserinfo=uni.getStorageSync('userinfo');
  69. this.getuserinfo(getuserinfo.uid,getuserinfo.aid);
  70. //兼容H5下排序栏位置
  71. // #ifdef H5
  72. //定时器方式循环获取高度为止,这么写的原因是onLoad中head未必已经渲染出来。
  73. let Timer = setInterval(()=>{
  74. let uniHead = document.getElementsByTagName('uni-page-head');
  75. if(uniHead.length>0){
  76. this.headerTop = uniHead[0].offsetHeight+'px';
  77. clearInterval(Timer);//清除定时器
  78. }
  79. },1);
  80. // #endif
  81. },
  82. methods: {
  83. async getuserinfo(uid,aid) {
  84. let reinfo=await this.$api.userinfo({action:'userinfo',uid:uid,aid:aid});
  85. this.userinfo=reinfo.data;
  86. this.getmoney=reinfo.data.yue
  87. },
  88. //提现列表
  89. async tixlist(uid,aid){
  90. let info= await this.$api.tixlist({action:'tixlist',uid:uid,aid:aid});
  91. this.couponValidList=info.data;
  92. },
  93. //申请提现
  94. async sqtixian(uid,money,aid){
  95. let info= await this.$api.sqtixian({action:'sqtixian',uid:uid,sqmoney:money,aid:aid});
  96. if(info.code==1){
  97. uni.showModal({
  98. title: '成功提示',
  99. content: info.msg,
  100. confirmText: '确定',
  101. showCancel:this.showcan,
  102. success: function(res) {
  103. if (res.confirm) {
  104. uni.navigateBack({
  105. delta:1
  106. })
  107. }
  108. }
  109. });
  110. }else{
  111. uni.showToast({title:info.msg,duration:1500,icon:'none'});
  112. }
  113. },
  114. inputamountchange(val){
  115. if(val.target.value>this.getmoney){
  116. uni.showToast({title:'提现金额不可超过余额',duration:1500,icon:'none'});
  117. this.inputAmount=this.getmoney
  118. }
  119. console.log(val.target.value,'输入')
  120. },
  121. settmoney(){
  122. this.inputAmount=this.getmoney
  123. },
  124. submit(){
  125. let t=this;
  126. let getuserinfo=uni.getStorageSync('userinfo');
  127. if(this.inputAmount<=0){
  128. uni.showToast({title:'提现金额无效',duration:1500,icon:'none'});
  129. return '';
  130. }
  131. uni.showModal({
  132. title: '温馨提示',
  133. content: '提现金额为:'+this.inputAmount,
  134. confirmText: '确定',
  135. success: function(res) {
  136. if (res.confirm) {
  137. t.sqtixian(getuserinfo.uid,t.inputAmount,getuserinfo.aid)
  138. }
  139. }
  140. });
  141. },
  142. switchType(type){
  143. if(this.typeClass==type){
  144. return ;
  145. }
  146. let getuserinfo=uni.getStorageSync('userinfo')
  147. this.tixlist(getuserinfo.uid,getuserinfo.aid);
  148. this.getuserinfo(getuserinfo.uid);
  149. uni.pageScrollTo({
  150. scrollTop:0,
  151. duration:0
  152. })
  153. this.typeClass = type;
  154. this.subState = this.typeClass==''?'':'show'+type;
  155. setTimeout(()=>{
  156. this.oldIndex = null;
  157. this.theIndex = null;
  158. this.subState = this.typeClass=='valid'?'':this.subState;
  159. },200)
  160. },
  161. }
  162. }
  163. </script>
  164. <style lang="scss">
  165. view{
  166. display: flex;
  167. flex-wrap: wrap;
  168. }
  169. page{position: relative;background-color: #f5f5f5;}
  170. @font-face {font-family:"HMfont-home";src:url('data:application/x-font-woff2;charset=utf-8;base64,d09GMgABAAAAAAYcAAsAAAAAC7AAAAXPAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHEIGVgCDMgqKTIgRATYCJAMUCwwABCAFhG0HShufCciemjxtEyiE0MJUUYjN7gIePI911ftJqrY61RxhAeHWc1taR0BXaRAvS0cGxd7FXycwvQF4WLxnP3czaSZwFdHkmjTO77s3Gq8T2hKtbaWhlUQDcsL+/+Ne1UzbGprPvsVxjwUYCnAsmHRvDnUssKU9L4hXRPoIr6uBbOALl0MAS25cYBo2vnuELAZbIlAwchg7gGxBi+mgCp7CbTjUIPNx8NQMdRvAvOj75TNe4oHC0di7th18Poajd/VebNbx/+gZoODNZwbEo0ADJQEYkPGN1pEkEnHJSGqbliepC2DxUKi5FjV4MezF5v+HTHgiuXWsoGb5wzMgLrY0CPi6M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3JHT8o6/XIBCneoIDkQRII9yLpLvBKenqYu3JHobtpKAm5KaAX9q76sXoK+D99XnsCINpCVsB/+oHu/rvYjG+TOQ/62Nb86vnfh5kHD1Lmofs/A00KH24ZZN6vgEccMYbA1jlGa/e4Wq4j5YGAzxX/A9/y2Xcm8GAeeTKZ9yOTJ2egyEU2aDwKog2+JDj4VAQXjzpgKUH80T6JdCGBmABQnOEMhCgbQRHmHGiinEcb/H1wSOE9uERFg6WzJJ7Sp7AMsw3G08CiMZb3xroKVWFcg5WPC++JtaWBkRdE9GcyTD6Anm4e5cQlKWTMsUfXHuxmt24MVndRZYxjVyNJUrFTF1WgkbVa283Sdtzdq5vWtFrRIkOeBhgQAyyIMUg5PkgdI1QUmGC6Rb7y9fcQLDYSA4yOjjrnM4SBCT8/4okbHgT0pVQhddxLeVccWDbphmEGpFrMV5FB4tBMSE5UBenUvJEAMcJildoRYY0d3HFSNVW6ur5cfox5f8Gu9qkdUaLFiCMugWnDTI73+IGaGO6Lk55LyUwYCpERZwMAAA==') format('woff2');}
  171. .icon {
  172. font-family:"HMfont-home" !important;
  173. font-size:60upx;
  174. font-style:normal;
  175. color:#000000;
  176. &.jia {
  177. &:before{content:"\e641";}
  178. }
  179. &.jian {
  180. &:before{content:"\e643";}
  181. }
  182. &.shixiao {
  183. &:before{content:"\e669";}
  184. }
  185. }
  186. .hidden{
  187. display: none !important;
  188. }
  189. .place{
  190. width: 100%;
  191. height: 95upx;
  192. }
  193. .tabr{
  194. background-color: #fff;
  195. width: 100%;
  196. height: 95upx;
  197. padding: 0 3%;
  198. border-bottom: solid 1upx #dedede;
  199. position: fixed;
  200. top: 0;
  201. z-index: 10;
  202. view{
  203. width: 50%;
  204. height: 90upx;
  205. justify-content: center;
  206. align-items: center;
  207. font-size: 32upx;
  208. color: #999;
  209. }
  210. .on{
  211. color: #f06c7a;
  212. }
  213. .border{
  214. height: 4upx;
  215. background-color: #f06c7a;
  216. transition: all .3s ease-out;
  217. &.invalid{
  218. transform: translate3d(100%,0,0);
  219. }
  220. }
  221. }
  222. .list{
  223. width: 100%;
  224. display: block;
  225. position: relative;
  226. }
  227. @keyframes showValid {
  228. 0% {transform: translateX(-100%);}100% {transform: translateX(0);}
  229. }
  230. @keyframes showInvalid {
  231. 0% {transform: translateX(0);}100% {transform: translateX(-100%);}
  232. }
  233. .sub-list{
  234. &.invalid{
  235. position: absolute;
  236. top: 0;
  237. left:100%;
  238. display: none;
  239. }
  240. &.showvalid{
  241. display: flex;
  242. animation: showValid 0.20s linear both;
  243. }
  244. &.showinvalid{
  245. display: flex;
  246. animation: showInvalid 0.20s linear both;
  247. }
  248. width: 100%;
  249. // padding: 20upx 0 120upx 0;
  250. .tis{
  251. width: 100%;
  252. height: 60upx;
  253. justify-content: center;
  254. align-items: center;
  255. color: #C0C0C0;
  256. font-size: 32upx;
  257. }
  258. .btnContent {
  259. padding: 0 30rpx;
  260. width: 100%;
  261. .btn {
  262. height: 80rpx;
  263. background: linear-gradient(
  264. 90deg,
  265. #62B9F2,
  266. #50BAFE
  267. );
  268. border-radius: 40rpx;
  269. font-size: 28rpx;
  270. font-family: SourceHanSansSC-Regular;
  271. font-weight: 400;
  272. display: flex;
  273. justify-content: center;
  274. align-items: center;
  275. color: rgba(255, 255, 255, 1);
  276. width: 53%;
  277. margin: 0 auto;
  278. }
  279. }
  280. }
  281. .txmain{
  282. display: flex;
  283. justify-content: center;
  284. margin: 20upx;
  285. .all{
  286. color: red;
  287. padding: 10upx;
  288. background-color: #fff;
  289. border-radius: 8rpx;
  290. font-size: 30rpx;
  291. margin-right: 30rpx;
  292. }
  293. }
  294. .moneytitle{
  295. margin: 20rpx;
  296. font-size: 35rpx;
  297. font-family: SourceHanSansCN-Regular;
  298. font-weight: 400;
  299. color: rgba(153, 153, 153, 1);
  300. span{
  301. color: red;
  302. }
  303. }
  304. .moneytip{
  305. margin: 25rpx;
  306. font-size: 35rpx;
  307. font-family: SourceHanSansCN-Regular;
  308. font-weight: 400;
  309. color: rgba(153, 153, 153, 1);
  310. input{
  311. width: 290rpx;
  312. font-size: 35rpx;
  313. color: red;
  314. }
  315. }
  316. .listtitle{
  317. width: 100%;
  318. display: flex;
  319. justify-content: space-around;
  320. padding: 15upx;
  321. font-size: 32upx;
  322. background-color: #00BCA2;
  323. color: #fff;
  324. }
  325. .row{
  326. width:100%;
  327. .listvalue{
  328. width: 100%;
  329. height: 50rpx;
  330. display: flex;
  331. justify-content: space-around;
  332. align-items: center;
  333. padding: 5px;
  334. color:#666666;
  335. .valuetime{
  336. font-size: 30rpx;
  337. font-family: SourceHanSansCN-Regular;
  338. font-weight: 400;
  339. color: rgba(153, 153, 153, 1);
  340. }
  341. .valuestate,.valuemoney{
  342. font-size: 28upx;
  343. }
  344. }
  345. }
  346. </style>