yue.vue 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464
  1. <template>
  2. <view class="content">
  3. <image :src="$store.state.baseURL + art.image" mode="widthFix" class="logo"></image>
  4. <view class="art-info">
  5. <view class="tit">
  6. {{art.title}}
  7. </view>
  8. <view class="des">
  9. {{art.synopsis}}
  10. </view>
  11. <view class="join">
  12. 善款接受:{{$store.state.baseName}}
  13. </view>
  14. <view class="join">
  15. 执行机构:{{$store.state.baseName}}
  16. </view>
  17. <view class="share-num">
  18. <image src="../../static/icon/sharenum.png" mode=""></image>已有{{art.num}}人参与
  19. </view>
  20. <image src="../../static/icon/share1.png" mode="" class="share" @click="isShowBase = true"></image>
  21. </view>
  22. <view class="art-detail">
  23. <view class="de-tit flex">
  24. <view class="line"></view>
  25. <view class="ct">项目介绍</view>
  26. <view class="line"></view>
  27. </view>
  28. <view class="notice-item">
  29. <jyf-parser :html="description" ref="article"></jyf-parser>
  30. </view>
  31. </view>
  32. <view class="tc">
  33. </view>
  34. <view class="btn" v-show="!isOpen" @click="openTc">
  35. <view class="">
  36. 参与月捐
  37. </view>
  38. <view class="tip">开通月捐后,每月自动扣费,可随时取消</view>
  39. </view>
  40. <uni-popup ref="popup" type="bottom" @change="changeTc">
  41. <view class="tc-wrap">
  42. <view class="tit flex">
  43. <view class="">
  44. 捐款金额
  45. </view>
  46. <image src="../../static/icon/cl.png" mode="" @click="closeTc"></image>
  47. </view>
  48. <view class="m-list flex">
  49. <view class="mitem" v-for="item in list" :class="{'action': item == money}" @click="money = item">
  50. ¥{{item}}/月
  51. </view>
  52. </view>
  53. <view class="sy-wrap flex">
  54. <input type="number" placeholder="请输入自定义金额" class="user-inp" v-if="diy" v-model="money" />
  55. <view class="user-inp" v-if="!diy" @click="diy = true">自定义金额</view>
  56. <view @click="sy" class="flex" style="align-items: center;">
  57. <image src="../../static/icon/re.png" mode="" class="re"></image>
  58. <view class="sy">
  59. 随缘
  60. </view>
  61. </view>
  62. </view>
  63. <view class="" style="text-align: center;padding: 20rpx;">
  64. <checkbox style="transform:scale(0.7)" :value="isok" :checked="isok" @click="changeOK"/>我已阅读并同意<text style="color: #4768c9;" @click="openxy">用户协议</text>
  65. </view>
  66. <view class="" style="text-align: center;font-size: 24rpx;padding-top: 10rpx;color: red;">
  67. 开通月捐后,每月自动扣费,可随时取消
  68. </view>
  69. <view class="go" @click="go">
  70. 确认支付{{money}}元/月
  71. </view>
  72. </view>
  73. </uni-popup>
  74. <image v-if="isShowBase" src="../../static/images/shareimg.png" mode="" class="sharebase"
  75. @click="isShowBase = false"></image>
  76. </view>
  77. </template>
  78. <script>
  79. import {
  80. mapState,
  81. mapMutations
  82. } from 'vuex';
  83. import {
  84. saveUrl,
  85. interceptor
  86. } from '@/utils/loginUtils.js';
  87. import { weixindata } from '@/utils/wxAuthorized.js';
  88. import { getPlanInfo} from '@/api/money.js'
  89. import {
  90. details,
  91. deconstructArticle
  92. } from '@/api/info.js';
  93. import jyfParser from "@/components/jyf-parser/jyf-parser.vue";
  94. export default {
  95. components: {
  96. jyfParser
  97. },
  98. computed: {
  99. ...mapState('user', ['hasLogin', 'userInfo']),
  100. },
  101. data() {
  102. return {
  103. isok: false,
  104. isShowBase: false,
  105. diy: false,
  106. isOpen: false,
  107. money: 100,
  108. umoney: '',
  109. list: [50, 100, 200],
  110. description: '',
  111. art: {},
  112. id: 0
  113. }
  114. },
  115. onLoad(opt) {
  116. if(opt.id) {
  117. this.id = opt.id
  118. uni.setStorageSync('boai',this.id)
  119. this.getInfo()
  120. }else {
  121. let id = uni.getStorageSync('boai') || ''
  122. if(id) {
  123. this.id = id
  124. this.getInfo()
  125. }else {
  126. uni.switchTab({
  127. url:'/pages/index/index'
  128. })
  129. }
  130. }
  131. },
  132. methods: {
  133. openxy() {
  134. },
  135. changeOK(e) {
  136. // console.log(e);
  137. this.isok = !this.isok
  138. },
  139. go() {
  140. if(this.isok) {
  141. uni.showModal({
  142. title: '提示',
  143. content: '功能审核中...',
  144. success(res) {
  145. if (res.confirm) {
  146. console.log('用户点击确定');
  147. } else if (res.cancel) {
  148. console.log('用户点击取消');
  149. }
  150. }
  151. })
  152. }else {
  153. uni.showModal({
  154. title: '提示',
  155. content: '请先阅读并同意用户协议',
  156. success(res) {
  157. if (res.confirm) {
  158. console.log('用户点击确定');
  159. } else if (res.cancel) {
  160. console.log('用户点击取消');
  161. }
  162. }
  163. })
  164. }
  165. },
  166. goShare() {
  167. },
  168. getInfo() {
  169. getPlanInfo({
  170. id: this.id
  171. }).then(e => {
  172. this.art = e.data[0];
  173. if (this.art.text != null) {
  174. this.description = this.art.text.replace(/<img/g, "<img class='baseimg'");
  175. } //小程序商品详情图超出屏幕问题
  176. this.IndexShare(this.art.title,this.art.info)
  177. });
  178. },
  179. changeTc(e) {
  180. console.log(e);
  181. },
  182. closeTc() {
  183. this.$refs.popup.close()
  184. },
  185. openTc() {
  186. if (this.hasLogin) {
  187. uni.navigateTo({
  188. url:'/pages/index/pay?id=' + this.art.plan_id+ '&tit=' + this.art.title
  189. })
  190. } else {
  191. if(this.id) {
  192. uni.setStorageSync('boai',this.id)
  193. }
  194. saveUrl();
  195. uni.showModal({
  196. title: '登录',
  197. content: '您未登录,是否马上登陆?',
  198. success: e => {
  199. if (e.confirm) {
  200. interceptor();
  201. }
  202. },
  203. fail: e => {
  204. console.log(e);
  205. }
  206. });
  207. }
  208. },
  209. sy() {
  210. this.diy = true
  211. this.money = Math.floor(Math.random() * 500) + 1;
  212. },
  213. IndexShare(title,desc) {
  214. let obj = this;
  215. // let money = obj.money;
  216. let item = {
  217. link: this.$store.state.baseURL + '/index/#/pages/index/yue?id=' + obj.id , // 分享链接
  218. imgUrl: this.$store.state.baseURL + '/index/static/img/002.png',
  219. desc: desc,
  220. title: title,
  221. success() {
  222. console.log('分享成功');
  223. }
  224. };
  225. weixindata(item);
  226. },
  227. }
  228. }
  229. </script>
  230. <style lang="scss">
  231. .logo {
  232. width: 750rpx;
  233. }
  234. .art-info {
  235. background-color: #fff;
  236. padding: 0 30rpx 35rpx;
  237. margin-bottom: 20rpx;
  238. position: relative;
  239. .tit,
  240. .des {
  241. width: 80%;
  242. }
  243. .tit {
  244. font-weight: bold;
  245. font-size: 42rpx;
  246. color: #1B282E;
  247. padding-top: 30rpx;
  248. }
  249. .des {
  250. font-size: 28rpx;
  251. color: #898d8f;
  252. padding: 15rpx 0 30rpx;
  253. }
  254. .share-num {
  255. font-weight: 500;
  256. font-size: 24rpx;
  257. color: #FB2D42;
  258. image {
  259. width: 28rpx;
  260. height: 26rpx;
  261. vertical-align: bottom;
  262. margin-right: 8rpx;
  263. }
  264. }
  265. .share {
  266. width: 44rpx;
  267. height: 44rpx;
  268. position: absolute;
  269. right: 26rpx;
  270. top: 32rpx;
  271. }
  272. }
  273. .art-detail {
  274. width: 100%;
  275. background-color: #fff;
  276. padding: 30rpx;
  277. .de-tit {
  278. text-align: center;
  279. font-size: 31rpx;
  280. color: #898d8f;
  281. align-items: center;
  282. justify-content: center;
  283. .line {
  284. width: 38rpx;
  285. height: 2rpx;
  286. background-color: #E0E0DF;
  287. margin: 0 20rpx;
  288. }
  289. }
  290. }
  291. .tc {
  292. height: 99rpx;
  293. }
  294. .btn {
  295. width: 750rpx;
  296. height: 120rpx;
  297. background: #f3392c;
  298. position: fixed;
  299. bottom: 0;
  300. font-size: 36rpx;
  301. color: #FFFFFF;
  302. text-align: center;
  303. display: flex;
  304. flex-direction: column;
  305. justify-content: center;
  306. .tip {
  307. font-size: 24rpx;
  308. }
  309. }
  310. .tc-wrap {
  311. width: 750rpx;
  312. // height: 578rpx;
  313. background: #FFFFFF;
  314. border-radius: 30rpx 30rpx 0 0;
  315. padding: 0 31rpx 66rpx 32rpx;
  316. .tit {
  317. height: 114rpx;
  318. align-items: center;
  319. justify-content: space-between;
  320. font-weight: bold;
  321. font-size: 42rpx;
  322. color: #1E2B31;
  323. border-bottom: 1px solid #EDF0F2;
  324. image {
  325. width: 34rpx;
  326. height: 34rpx;
  327. }
  328. }
  329. .m-list {
  330. justify-content: space-between;
  331. padding: 30rpx 0;
  332. .mitem {
  333. width: 215rpx;
  334. line-height: 96rpx;
  335. background: #FFFFFF;
  336. border-radius: 5rpx;
  337. border: 1px solid #78919d;
  338. text-align: center;
  339. font-weight: bold;
  340. font-size: 29rpx;
  341. color: #1E2B31;
  342. }
  343. .action {
  344. background: #fdecee;
  345. border: 1px solid #ed3142;
  346. color: #ED3142;
  347. }
  348. }
  349. .sy-wrap {
  350. align-items: center;
  351. justify-content: space-between;
  352. }
  353. .user-inp {
  354. display: inline-block;
  355. width: 554rpx;
  356. height: 81rpx;
  357. line-height: 81rpx;
  358. background: #FFFFFF;
  359. border-radius: 5rpx;
  360. border: 1px solid #78919d;
  361. text-align: center;
  362. font-weight: bold;
  363. font-size: 29rpx;
  364. color: #1E2B31;
  365. }
  366. .re {
  367. width: 30rpx;
  368. height: 30rpx;
  369. margin-left: 33rpx;
  370. margin-right: 14rpx;
  371. }
  372. .sy {
  373. font-weight: bold;
  374. font-size: 29rpx;
  375. color: #0C0C0C;
  376. }
  377. .go {
  378. width: 100%;
  379. line-height: 94rpx;
  380. background: #f3392c;
  381. border-radius: 46rpx;
  382. text-align: center;
  383. font-weight: bold;
  384. font-size: 33rpx;
  385. color: #FFFFFF;
  386. margin-top: 20rpx;
  387. }
  388. }
  389. .notice_name {
  390. font-size: 35rpx !important;
  391. color: #303133;
  392. padding: 25rpx 25rpx 0rpx 25rpx;
  393. margin-bottom: 25rpx;
  394. }
  395. .course-video {
  396. width: 100%;
  397. height: 500rpx;
  398. }
  399. .notice-item {
  400. width: 100%;
  401. height: 100%;
  402. color: #666666;
  403. padding: 35rpx 0;
  404. font-size: 23rpx;
  405. padding-bottom: 30rpx;
  406. }
  407. .baseimg {
  408. max-width: 100%;
  409. height: auto;
  410. }
  411. .sharebase {
  412. display: block;
  413. position: fixed;
  414. top: 0;
  415. left: 0;
  416. width: 100%;
  417. height: 100%;
  418. }
  419. .join {
  420. padding-bottom: 10rpx;
  421. }
  422. </style>