giveFamilyCard.vue 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. <template>
  2. <view class="box">
  3. <u--form labelPosition="top" :model="userInfo" ref="form1">
  4. <u-form-item labelWidth="auto" labelAlign="right" label="被赠送会员编号" prop="phone">
  5. <u--input v-model="userInfo.memberNo" placeholder="请输入被赠送会员编号" border="bottom"
  6. ></u--input>
  7. </u-form-item>
  8. <u-form-item labelWidth="auto" labelAlign="right" label="被赠送会员手机号" prop="smsCode" width="120">
  9. <u--input v-model="userInfo.memberPhone" placeholder="请输入被赠送会员手机号" border="bottom"
  10. ></u--input>
  11. </u-form-item>
  12. </u--form>
  13. <view class="op-btn-wrap">
  14. <view class="h-btn" @click="handleGive">
  15. <text>确定
  16. <text class="presentCount" v-if="count !== null">(剩余可赠送{{count}}次)</text>
  17. </text>
  18. </view>
  19. </view>
  20. </view>
  21. </template>
  22. <script>
  23. export default {
  24. name: "giveFamilyCard",
  25. data() {
  26. return {
  27. userInfo: {},
  28. giveUser: {},
  29. count:null
  30. }
  31. },
  32. onShow(){
  33. this.presentCount()
  34. },
  35. methods: {
  36. handleGive() {
  37. this.giveUser.memberNo = "Vip." + this.userInfo.memberNo
  38. this.giveUser.memberPhone = this.userInfo.memberPhone
  39. this.$api.giveFamilyCard(this.giveUser).then((res) => {
  40. console.log(res)
  41. uni.showToast({
  42. duration: 2000,
  43. title: '赠送成功'
  44. });
  45. uni.navigateBack({delta : 1})
  46. }
  47. )
  48. },
  49. presentCount(){
  50. this.$api.presentCount().then(res=>{
  51. this.count = res.data.data
  52. })
  53. }
  54. }
  55. }
  56. </script>
  57. <style scoped>
  58. .box {
  59. padding: 24rpx 32rpx;
  60. }
  61. .h-btn {
  62. margin: 48rpx auto;
  63. text-align: center;
  64. width: 80vw;
  65. height: 42px;
  66. background: #FFE05C;
  67. border-radius: 27px;
  68. line-height: 42px;
  69. }
  70. .presentCount{
  71. font-size: 24rpx;
  72. color: #666666;
  73. }
  74. </style>