123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304 |
- <template>
- <view class="content">
- <image src="../../static/img/b-top.png" mode="" class="b-top"></image>
- <view class="wrap-wrap">
- <view class="u-wrap">
- <view class="top flex">
- <image :src="userInfo.avatar" mode="" class="uavt"></image>
- <view class="name">
- <view class="clamp">
- {{userInfo.nickname}}
- </view>
- <view class="val">
- {{info.is_signing == 0 ?'已开通自动续费':'已解约'}}
- </view>
- </view>
- <view class="btn" @click="qx" v-if="info.is_signing == 0">
- 取消续费
- </view>
- </view>
- <view class="type">
- 按月捐款
- </view>
- <view class="price">
- ¥{{info.price}}/月 每月自动续费
- </view>
- </view>
- </view>
-
- <view class="xq">
- <view class="j-tit">
- <text>捐款详情</text>
- </view>
- <view class="line flex">
- <image src="../../static/icon/dk1.png" mode=""></image>
- <view class="name">
- 捐款项目
- </view>
- <view class="val">
- {{info.order_name}}
- </view>
- </view>
- <view class="line flex">
- <image src="../../static/icon/dk2.png" mode=""></image>
- <view class="name">
- 每月捐款金额
- </view>
- <view class="val">
- {{info.price}}元
- </view>
- </view>
-
- </view>
- <view class="xq" v-if="list.length > 0">
- <view class="j-tit">
- <text>月捐记录</text>
- </view>
- <view class="box">
- <view class="box-item" v-for="item in list" :key="item.id" >
- <view class="main">
- <view class="main-left">
- <view class="project">
- {{item.order_name}}
- </view>
- <view class="time">
- {{item.paytime_text}}
- </view>
- </view>
- <view class="mian-right">
- {{item.amount}}元
- </view>
- </view>
-
- </view>
- </view>
- </view>
- </view>
- </template>
- <script>
- import {
- mapState,
- mapMutations
- } from 'vuex';
- import { getInfo,qxyue } from '@/api/money.js'
- export default {
- data() {
- return {
- list: [],
- info: {},
- id: 0,
- plan_id:0
- }
- },
- computed: {
- ...mapState('user', ['hasLogin', 'userInfo']),
- },
- onLoad(opt) {
- this.id = opt.id;
- this.plan_id = opt.plan_id;
- console.log(opt.id,opt.plan_id,this.id,this.plan_id);
- this.getInfo();
- },
- methods: {
- qx() {
- let that = this
- uni.showModal({
- title: '提示',
- content: '您确定要取消当前的公益月捐?',
- success(res) {
- if (res.confirm) {
- console.log('用户点击确定');
- qxyue({
- id:that.id,
- plan_id:that.plan_id,
- }).then(res => {
-
- uni.showToast({
- title: '解约成功',
- duration: 2000
- });
- that.info.is_signing = 1
-
- setTimeout(()=> {
- uni.navigateTo({
- url:'/pages/user/user'
- })
- },1500)
-
- })
- } else if (res.cancel) {
- console.log('用户点击取消');
- }
-
- }
- })
- },
- getInfo() {
- getInfo({
- id:this.id,
- plan_id:this.plan_id,
- page:1,
- limit:100
- }).then(res => {
- this.info = res.data.data
- this.list = res.data.list
- })
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- .b-top {
- width: 750rpx;
- height: 312rpx;
- }
- .wrap-wrap {
- background-color: #fff;
- padding-bottom:45rpx;
- }
- .u-wrap {
- width: 655rpx;
- height: 324rpx;
- background: linear-gradient(225deg, #FFEED2 0%, #FED591 100%);
- border-radius: 24rpx;
- margin:-200rpx auto 0;
- position: relative;
- padding: 28rpx 36rpx;
- .top {
- align-items: center;
- * {
- flex-shrink: 0;
- }
- .uavt {
- width: 90rpx;
- height: 90rpx;
- border-radius: 50%;
- background-color: #eee;
- }
- .btn {
- width: 190rpx;
- height:70rpx;
- height: 70rpx;
- background: #3A3A3B;
- border-radius: 35rpx;
- font-size: 30rpx;
- color: #FFFFFF;
- text-align: center;
- display: flex;
- justify-content: center;
- align-items: center;
- }
- .name {
- padding-left: 10rpx;
- flex-grow: 1;
- font-weight: 500;
- font-size: 30rpx;
- color: #333333;
- .val {
- font-weight: 500;
- font-size: 20rpx;
- color: #af9c7c;
- }
- }
- }
-
- .type {
- font-weight: bold;
- font-size: 40rpx;
- color: #6B4216;
- position: absolute;
- bottom: 75rpx;
- }
- .price {
- font-weight: 500;
- font-size: 28rpx;
- color: #6B4216;
- position: absolute;
- bottom: 28rpx;
- }
- }
- .xq {
- margin: 20rpx 0;
- background-color: #fff;
- padding: 45rpx 0;
- .line {
- align-items: center;
- padding: 30rpx 27rpx 30rpx 33rpx;
- * {
- flex-shrink: 0;
- }
- image {
- width: 34rpx;
- height: 34rpx;
- }
- .name {
- font-weight: bold;
- font-size: 30rpx;
- color: #333333;
- padding-left: 12rpx;
- }
- .val {
- flex-grow: 1;
- font-size: 26rpx;
- color: #666666;
- text-align: right;
- }
- }
- }
- .j-tit {
- font-weight: bold;
- font-size: 32rpx;
- color: #1D2023;
- text-align: center;
- padding-bottom: 30rpx;
- }
- .box {
- padding: 0 24rpx;
-
- .box-item {
- padding: 24rpx 0;
- border-bottom: 1rpx solid #e0e0e0;
-
- .header {
- color: #999999;
- font-size: 24rpx;
- }
-
- .main {
- margin-top: 22rpx;
- display: flex;
- justify-content: space-between;
-
- .mian-right {
- display: flex;
- flex-direction: column;
- justify-content: flex-end;
- }
-
- .main-left {
- .project {
- color: #333;
- font-size: 28rpx;
- }
-
- .time {
- margin-top: 6rpx;
- color: #999999;
- font-size: 22rpx;
- }
- }
- }
- }
-
- }
- </style>
|