unbindFamilyCard.vue 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. <template>
  2. <view class="page">
  3. <!-- 钱包 -->
  4. <view class="recharge-me ">
  5. <view class="wallet-content">
  6. <view class="h-balance-wrap">
  7. <view class="h-balance">
  8. <view v-if="type == 1" class="recharge-balance">
  9. <view class="name">已用额度</view>
  10. <view class="Number" style="font-size: 48rpx">{{ data.amount || 0 }}</view>
  11. </view>
  12. <view v-if="type == 2" class="recharge-balance">
  13. <view class="name">剩余额度</view>
  14. <view class="Number" style="font-size: 48rpx">{{ data.totalBalance || 0 }}</view>
  15. </view>
  16. <text class="openUnbind" @click="openUnbindpopup">解绑</text>
  17. </view>
  18. <view class="cardMsg flex-row">
  19. <text>赠送会员编号:</text>
  20. <text>{{ data.userNo }}</text>
  21. </view>
  22. <view class="cardMsg flex-row ">
  23. <text v-if="type == 1">赠送时间:</text>
  24. <text v-if="type == 2">收到时间:</text>
  25. <text>{{ data.createTime }}</text>
  26. </view>
  27. </view>
  28. <text class="record">使用记录</text>
  29. <view v-if="data.id">
  30. <mescroll-item ref="MescrollItem" :i="0" :index="0" :cardId="data.id" :height="scrollViewHeight">
  31. </mescroll-item>
  32. </view>
  33. </view>
  34. </view>
  35. <uni-popup ref="unbindpopup" type="dialog">
  36. <uni-popup-dialog type="warn" title="警告" content="请确认是否要解除绑定该亲情卡" @confirm="untieCard"
  37. ></uni-popup-dialog>
  38. </uni-popup>
  39. </view>
  40. </template>
  41. <script>
  42. import MescrollItem from "./module/mescrollUni-item.vue";
  43. export default {
  44. components: {
  45. MescrollItem
  46. },
  47. data() {
  48. return {
  49. type:0,
  50. data: {},
  51. scrollViewHeight: '',
  52. };
  53. },
  54. onLoad(option) {
  55. this.type = option.type;
  56. this.data = JSON.parse(option.data)
  57. console.log(this.data)
  58. let sysInfo = uni.getSystemInfoSync()
  59. this.scrollViewHeight = sysInfo.windowHeight - (sysInfo.windowWidth / 750) * 500 + 'px'
  60. console.log(' this.scrollViewHeight', this.scrollViewHeight)
  61. },
  62. onShow() {
  63. },
  64. methods: {
  65. openUnbindpopup() {
  66. this.$refs.unbindpopup.open()
  67. },
  68. //解除绑定
  69. untieCard() {
  70. console.log(this.data)
  71. this.$api.untieCard({
  72. cardId: this.data.id
  73. }).then((res) => {
  74. uni.showToast({
  75. icon: 'success',
  76. duration: 2000,
  77. title: '解绑成功'
  78. });
  79. setTimeout(() => {
  80. uni.redirectTo({
  81. url: '/myPages/familyCard/index'
  82. });
  83. }, 2000)
  84. })
  85. },
  86. },
  87. };
  88. </script>
  89. <style scoped lang="scss">
  90. @import '../../../common/css/common.css';
  91. @import './familyCard.scss';
  92. </style>