dk.vue 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304
  1. <template>
  2. <view class="content">
  3. <image src="../../static/img/b-top.png" mode="" class="b-top"></image>
  4. <view class="wrap-wrap">
  5. <view class="u-wrap">
  6. <view class="top flex">
  7. <image :src="userInfo.avatar" mode="" class="uavt"></image>
  8. <view class="name">
  9. <view class="clamp">
  10. {{userInfo.nickname}}
  11. </view>
  12. <view class="val">
  13. {{info.is_signing == 0 ?'已开通自动续费':'已解约'}}
  14. </view>
  15. </view>
  16. <view class="btn" @click="qx" v-if="info.is_signing == 0">
  17. 取消续费
  18. </view>
  19. </view>
  20. <view class="type">
  21. 按月捐款
  22. </view>
  23. <view class="price">
  24. ¥{{info.price}}/月 每月自动续费
  25. </view>
  26. </view>
  27. </view>
  28. <view class="xq">
  29. <view class="j-tit">
  30. <text>捐款详情</text>
  31. </view>
  32. <view class="line flex">
  33. <image src="../../static/icon/dk1.png" mode=""></image>
  34. <view class="name">
  35. 捐款项目
  36. </view>
  37. <view class="val">
  38. {{info.order_name}}
  39. </view>
  40. </view>
  41. <view class="line flex">
  42. <image src="../../static/icon/dk2.png" mode=""></image>
  43. <view class="name">
  44. 每月捐款金额
  45. </view>
  46. <view class="val">
  47. {{info.price}}
  48. </view>
  49. </view>
  50. <!-- <view class="line flex">
  51. <image src="../../static/icon/dk3.png" mode=""></image>
  52. <view class="name">
  53. 支付方式
  54. </view>
  55. <view class="val">
  56. 微信支付
  57. </view>
  58. </view> -->
  59. </view>
  60. <view class="xq" v-if="list.length > 0">
  61. <view class="j-tit">
  62. <text>月捐记录</text>
  63. </view>
  64. <view class="box">
  65. <view class="box-item" v-for="item in list" :key="item.id" >
  66. <view class="main">
  67. <view class="main-left">
  68. <view class="project">
  69. {{item.order_name}}
  70. </view>
  71. <view class="time">
  72. {{item.paytime_text}}
  73. </view>
  74. </view>
  75. <view class="mian-right">
  76. {{item.amount}}
  77. </view>
  78. </view>
  79. </view>
  80. </view>
  81. </view>
  82. </view>
  83. </template>
  84. <script>
  85. import {
  86. mapState,
  87. mapMutations
  88. } from 'vuex';
  89. import { getInfo,qxyue } from '@/api/money.js'
  90. export default {
  91. data() {
  92. return {
  93. list: [],
  94. info: {},
  95. id: 0,
  96. plan_id:0
  97. }
  98. },
  99. computed: {
  100. ...mapState('user', ['hasLogin', 'userInfo']),
  101. },
  102. onLoad(opt) {
  103. this.id = opt.id;
  104. this.plan_id = opt.plan_id;
  105. console.log(opt.id,opt.plan_id,this.id,this.plan_id);
  106. this.getInfo();
  107. },
  108. methods: {
  109. qx() {
  110. let that = this
  111. uni.showModal({
  112. title: '提示',
  113. content: '您确定要取消当前的公益月捐?',
  114. success(res) {
  115. if (res.confirm) {
  116. console.log('用户点击确定');
  117. qxyue({
  118. id:that.id,
  119. plan_id:that.plan_id,
  120. }).then(res => {
  121. // console.log();
  122. uni.showToast({
  123. title: '解约成功',
  124. duration: 2000
  125. });
  126. that.info.is_signing = 1
  127. // that.getInfo()
  128. setTimeout(()=> {
  129. uni.navigateTo({
  130. url:'/pages/user/user'
  131. })
  132. },1500)
  133. })
  134. } else if (res.cancel) {
  135. console.log('用户点击取消');
  136. }
  137. }
  138. })
  139. },
  140. getInfo() {
  141. getInfo({
  142. id:this.id,
  143. plan_id:this.plan_id,
  144. page:1,
  145. limit:100
  146. }).then(res => {
  147. this.info = res.data.data
  148. this.list = res.data.list
  149. })
  150. }
  151. }
  152. }
  153. </script>
  154. <style lang="scss" scoped>
  155. .b-top {
  156. width: 750rpx;
  157. height: 312rpx;
  158. }
  159. .wrap-wrap {
  160. background-color: #fff;
  161. padding-bottom:45rpx;
  162. }
  163. .u-wrap {
  164. width: 655rpx;
  165. height: 324rpx;
  166. background: linear-gradient(225deg, #FFEED2 0%, #FED591 100%);
  167. border-radius: 24rpx;
  168. margin:-200rpx auto 0;
  169. position: relative;
  170. padding: 28rpx 36rpx;
  171. .top {
  172. align-items: center;
  173. * {
  174. flex-shrink: 0;
  175. }
  176. .uavt {
  177. width: 90rpx;
  178. height: 90rpx;
  179. border-radius: 50%;
  180. background-color: #eee;
  181. }
  182. .btn {
  183. width: 190rpx;
  184. height:70rpx;
  185. height: 70rpx;
  186. background: #3A3A3B;
  187. border-radius: 35rpx;
  188. font-size: 30rpx;
  189. color: #FFFFFF;
  190. text-align: center;
  191. display: flex;
  192. justify-content: center;
  193. align-items: center;
  194. }
  195. .name {
  196. padding-left: 10rpx;
  197. flex-grow: 1;
  198. font-weight: 500;
  199. font-size: 30rpx;
  200. color: #333333;
  201. .val {
  202. font-weight: 500;
  203. font-size: 20rpx;
  204. color: #af9c7c;
  205. }
  206. }
  207. }
  208. .type {
  209. font-weight: bold;
  210. font-size: 40rpx;
  211. color: #6B4216;
  212. position: absolute;
  213. bottom: 75rpx;
  214. }
  215. .price {
  216. font-weight: 500;
  217. font-size: 28rpx;
  218. color: #6B4216;
  219. position: absolute;
  220. bottom: 28rpx;
  221. }
  222. }
  223. .xq {
  224. margin: 20rpx 0;
  225. background-color: #fff;
  226. padding: 45rpx 0;
  227. .line {
  228. align-items: center;
  229. padding: 30rpx 27rpx 30rpx 33rpx;
  230. * {
  231. flex-shrink: 0;
  232. }
  233. image {
  234. width: 34rpx;
  235. height: 34rpx;
  236. }
  237. .name {
  238. font-weight: bold;
  239. font-size: 30rpx;
  240. color: #333333;
  241. padding-left: 12rpx;
  242. }
  243. .val {
  244. flex-grow: 1;
  245. font-size: 26rpx;
  246. color: #666666;
  247. text-align: right;
  248. }
  249. }
  250. }
  251. .j-tit {
  252. font-weight: bold;
  253. font-size: 32rpx;
  254. color: #1D2023;
  255. text-align: center;
  256. padding-bottom: 30rpx;
  257. }
  258. .box {
  259. padding: 0 24rpx;
  260. .box-item {
  261. padding: 24rpx 0;
  262. border-bottom: 1rpx solid #e0e0e0;
  263. .header {
  264. color: #999999;
  265. font-size: 24rpx;
  266. }
  267. .main {
  268. margin-top: 22rpx;
  269. display: flex;
  270. justify-content: space-between;
  271. .mian-right {
  272. display: flex;
  273. flex-direction: column;
  274. justify-content: flex-end;
  275. }
  276. .main-left {
  277. .project {
  278. color: #333;
  279. font-size: 28rpx;
  280. }
  281. .time {
  282. margin-top: 6rpx;
  283. color: #999999;
  284. font-size: 22rpx;
  285. }
  286. }
  287. }
  288. }
  289. }
  290. </style>