unbindFamilyCard.vue 2.5 KB

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