integraldh.vue 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. <template>
  2. <view>
  3. <view class="integral-log-header">
  4. <image class="bg" :src="statics.integralLogHeader"></image>
  5. <view class="main pd24_20">
  6. <view class="flex alcenter space">
  7. <view>
  8. <view class="flex alcenter">
  9. <text class="ft14 cl-w">当前积分</text>
  10. <navigator open-type="redirect" url="/pages/client/integral/role">
  11. <text class="ml5 iconfont iconbtn_question cl-w ft20"></text>
  12. </navigator>
  13. </view>
  14. <view class="mt16 flex alcenter">
  15. <image :src="statics.integralImg01" style="width: 40rpx; height: 40rpx;"></image>
  16. <text class="ml10 ft20 cl-w ftw600">{{userinfo.score}}</text>
  17. </view>
  18. </view>
  19. <view class="btn-integral">
  20. <view class="ft14 mb10">兑换说明:</view>
  21. {{userinfo.config.jfdhsm}}
  22. </view>
  23. </view>
  24. </view>
  25. </view>
  26. <view class="integral-log-main pd16_15">
  27. <view class="ft18">兑换数量:</view>
  28. <input class="ft14 mt16" type="digit" placeholder="请输入兑换数量" style="border: 1px solid #ddd; height: 80upx; line-height: 80upx; border-radius: 16upx; padding: 10upx;" v-model="sum" />
  29. <button @click="duihuan()" class="btn-vip-money ft18 mt20" style="width: 80%; background: rgb(0, 198, 87); color: #ffffff; text-align: center; height: 100upx; line-height: 100upx;">提交兑换</button>
  30. </view>
  31. </view>
  32. </template>
  33. <script>
  34. export default{
  35. data(){
  36. return {
  37. sum: '',
  38. userinfo:[],
  39. listData: [],
  40. last_id: 0,
  41. reload: true,
  42. status: 'more',
  43. userinfo:[],
  44. contentText: {
  45. contentdown: '上拉加载更多',
  46. contentrefresh: '加载中',
  47. contentnomore: '没有数据了'
  48. }
  49. }
  50. },
  51. onReachBottom() {
  52. },
  53. onLoad(){
  54. this.ongrzlTap()
  55. },
  56. methods:{
  57. duihuan(){
  58. let data = {};
  59. data.token = uni.getStorageSync("userinfo").token;
  60. data.uid = uni.getStorageSync("userinfo").id;
  61. if(!this.sum){
  62. uni.showToast({
  63. icon: 'none',
  64. title: '请输入兑换数量'
  65. });
  66. return;
  67. }
  68. data.sum=this.sum
  69. uni.request({
  70. url: this.configs.webUrl+'/api/user/duihuan',
  71. data: data,
  72. success: res =>{
  73. if(res.data.code==1){
  74. this.ongrzlTap()
  75. uni.showToast({ title: res.data.msg,icon:"none" });
  76. }else{
  77. uni.showToast({ title: res.data.msg,icon:"none" });
  78. }
  79. },
  80. fail: (data, code) => {
  81. }
  82. });
  83. },
  84. async ongrzlTap(){
  85. let data = {};
  86. data.token = uni.getStorageSync("userinfo").token;
  87. data.uid = uni.getStorageSync("userinfo").id;
  88. uni.request({
  89. url: this.configs.webUrl+'/api/user/index',
  90. data: data,
  91. success: res =>{
  92. if(res.data.code==1){
  93. let ionfo=res.data.data
  94. this.userinfo=ionfo
  95. }else{
  96. uni.showToast({ title: res.data.msg,icon:"none" });
  97. }
  98. },
  99. fail: (data, code) => {
  100. //console.log('fail' + JSON.stringify(data));
  101. }
  102. });
  103. },
  104. }
  105. }
  106. </script>
  107. <style>
  108. .integral-log-header{
  109. position: relative;
  110. height: 252rpx;
  111. }
  112. .integral-log-header .bg{
  113. width: 100%;
  114. height: 252rpx;
  115. }
  116. .integral-log-header .main{
  117. height: 252rpx;
  118. width: 100%;
  119. position: absolute;
  120. left: 0;
  121. top: 0;
  122. }
  123. .btn-integral{
  124. color:#ffffff;
  125. font-size: 24rpx;
  126. }
  127. .integral-log-main{
  128. background: #FFFFFF;
  129. min-height: 1400rpx;
  130. position: relative;
  131. margin-top: -32rpx;
  132. border-radius: 32rpx 32rpx 0rpx 0rpx;
  133. }
  134. </style>