unbindFamilyCard.vue 2.5 KB

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