index.vue 4.4 KB

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