Просмотр исходного кода

feat:请亲卡剩余赠送次数

zhanghui 2 лет назад
Родитель
Сommit
a36a6f69ab
2 измененных файлов с 25 добавлено и 2 удалено
  1. 8 0
      common/js/api.js
  2. 17 2
      myPages/familyCard/giveFamilyCard/giveFamilyCard.vue

+ 8 - 0
common/js/api.js

@@ -864,5 +864,13 @@ export default {
         })
     },
 
+    //查询剩余可赠送次数
+    presentCount(){
+        return request({
+            url: '/member/loveCard/presentCount',
+            method: 'GET'
+        })
+    }
+
 
 }

+ 17 - 2
myPages/familyCard/giveFamilyCard/giveFamilyCard.vue

@@ -12,7 +12,9 @@
     </u--form>
     <view class="op-btn-wrap">
       <view class="h-btn" @click="handleGive">
-        <text>确定</text>
+        <text>确定
+          <text class="presentCount" v-if="count !== null">(剩余可赠送{{count}}次)</text>
+        </text>
       </view>
     </view>
   </view>
@@ -24,9 +26,13 @@ export default {
   data() {
     return {
       userInfo: {},
-      giveUser: {}
+      giveUser: {},
+      count:null
     }
   },
+  onShow(){
+    this.presentCount()
+  },
   methods: {
     handleGive() {
       this.giveUser.memberNo = "Vip." + this.userInfo.memberNo
@@ -40,6 +46,11 @@ export default {
               uni.navigateBack({delta : 1})
           }
       )
+    },
+    presentCount(){
+      this.$api.presentCount().then(res=>{
+        this.count = res.data.data
+      })
     }
   }
 }
@@ -59,4 +70,8 @@ export default {
   border-radius: 27px;
   line-height: 42px;
 }
+  .presentCount{
+    font-size: 24rpx;
+    color: #666666;
+  }
 </style>