unbindFamilyCard.vue 3.0 KB

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