index.vue 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197
  1. <template>
  2. <base-drawer mode="bottom" :visible="visible" background-color="transparent" mask maskClosable @close="closeDrawer">
  3. <view class="edit-balance rd-t-40rpx">
  4. <view class="title">赠送会员
  5. <view class="close acea-row row-center-wrapper" @tap="closeDrawer">
  6. <text class="iconfont icon-ic_close"></text>
  7. </view>
  8. </view>
  9. <view class="list">
  10. <view class="item acea-row row-between-wrapper">
  11. <view>会员到期日</view>
  12. <view class="time">{{userInfo.svip_overdue_time || '已过期/暂未开通'}}</view>
  13. </view>
  14. <view class="item acea-row row-between-wrapper">
  15. <view>剩余天数</view>
  16. <view class="time">{{userInfo.svip_over_day}}</view>
  17. </view>
  18. <view class="item acea-row row-between-wrapper">
  19. <view>修改付费会员</view>
  20. <view class="acea-row row-middle">
  21. <view class="itemn acea-row row-middle" :class="current == index?'on':''" v-for="(item, index) in navList" :key="index" @click="navTap(index)">
  22. <text class="iconfont" :class="current == index?'icon-ic_Selected':'icon-ic_unselect'"></text>
  23. <text>{{item}}</text>
  24. </view>
  25. </view>
  26. </view>
  27. <view class="item acea-row row-between-wrapper">
  28. <view>调整时长(天)</view>
  29. <view class="acea-row row-middle">
  30. <input type="numeric" v-model="numeral" placeholder="请输入时长" placeholder-class="placeholder"/>
  31. <text class="iconfont icon-ic_edit"></text>
  32. </view>
  33. </view>
  34. </view>
  35. <view class="footer acea-row row-between-wrapper">
  36. <view class="bnt acea-row row-center-wrapper" @click="closeDrawer">取消</view>
  37. <view class="bnt on acea-row row-center-wrapper" @click="define">确定</view>
  38. </view>
  39. </view>
  40. </base-drawer>
  41. </template>
  42. <script>
  43. import {
  44. postUserUpdate
  45. } from "@/api/admin";
  46. export default {
  47. props:{
  48. visible: {
  49. type: Boolean,
  50. default: false,
  51. },
  52. userInfo: {
  53. type: Object,
  54. default: () => {}
  55. }
  56. },
  57. data(){
  58. return{
  59. navList:['增加','减少'],
  60. current:0,
  61. numeral:0
  62. }
  63. },
  64. mounted: function() {},
  65. methods:{
  66. navTap(index){
  67. this.current = index
  68. },
  69. define(){
  70. if(this.numeral <=0){
  71. this.$util.Tips({
  72. title: '请填写有效时长'
  73. });
  74. return
  75. }
  76. postUserUpdate({
  77. type:2,
  78. uid:this.userInfo.uid,
  79. days_status:this.current+1,
  80. days:this.numeral
  81. }).then(res=>{
  82. this.$util.Tips({
  83. title: res.msg
  84. });
  85. this.numeral = 0
  86. this.$emit('successChange');
  87. }).catch(err=>{
  88. this.$util.Tips({
  89. title: err
  90. });
  91. })
  92. },
  93. closeDrawer() {
  94. this.numeral = 0
  95. this.$emit('closeDrawer');
  96. }
  97. }
  98. }
  99. </script>
  100. <style lang="scss" scoped>
  101. .edit-balance{
  102. background-color: #fff;
  103. padding-bottom: 60rpx;
  104. .title{
  105. text-align: center;
  106. height: 108rpx;
  107. line-height: 108rpx;
  108. font-size: 32rpx;
  109. font-family: PingFang SC, PingFang SC;
  110. font-weight: 600;
  111. color: #333333;
  112. position: relative;
  113. padding: 0 30rpx;
  114. .close{
  115. width: 36rpx;
  116. height: 36rpx;
  117. line-height: 36rpx;
  118. background: #EEEEEE;
  119. border-radius: 50%;
  120. position: absolute;
  121. right: 30rpx;
  122. top:38rpx;
  123. .iconfont {
  124. font-weight: 300;
  125. font-size: 20rpx;
  126. }
  127. }
  128. }
  129. .list{
  130. padding: 0 30rpx;
  131. .item{
  132. font-size: 28rpx;
  133. font-family: PingFang SC, PingFang SC;
  134. font-weight: 400;
  135. color: #333333;
  136. height: 72rpx;
  137. margin-bottom: 32rpx;
  138. box-sizing: border-box;
  139. .icon-ic_edit{
  140. color: #999999;
  141. }
  142. .time{
  143. color: #999999;
  144. }
  145. .itemn{
  146. margin-left: 50rpx;
  147. color: #999999;
  148. .iconfont {
  149. margin-top: 4rpx;
  150. color: #CCCCCC;
  151. margin-right: 14rpx;
  152. }
  153. &.on {
  154. color: #333333;
  155. .iconfont {
  156. color: #2A7EFB;
  157. }
  158. }
  159. }
  160. input {
  161. text-align: right;
  162. font-size: 36rpx;
  163. font-family: Regular;
  164. color: #FF7E00;
  165. }
  166. /deep/.uni-input-input{
  167. padding-right: 10rpx;
  168. }
  169. .placeholder{
  170. font-size: 28rpx;
  171. padding-right: 10rpx;
  172. padding: 6rpx 10rpx 0 0;
  173. }
  174. }
  175. }
  176. .footer{
  177. padding: 0 20rpx;
  178. margin-top: 90rpx;
  179. .bnt{
  180. width: 346rpx;
  181. height: 72rpx;
  182. border: 2rpx solid #2A7EFB;
  183. border-radius: 100rpx;
  184. font-size: 26rpx;
  185. font-family: PingFang SC, PingFang SC;
  186. font-weight: 500;
  187. color: #2A7EFB;
  188. &.on{
  189. background: #2A7EFB;
  190. color: #fff;
  191. }
  192. }
  193. }
  194. }
  195. </style>