yue.vue 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448
  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. this.id = opt.id
  117. this.getInfo()
  118. },
  119. methods: {
  120. openxy() {
  121. },
  122. changeOK(e) {
  123. // console.log(e);
  124. this.isok = !this.isok
  125. },
  126. go() {
  127. if(this.isok) {
  128. uni.showModal({
  129. title: '提示',
  130. content: '功能审核中...',
  131. success(res) {
  132. if (res.confirm) {
  133. console.log('用户点击确定');
  134. } else if (res.cancel) {
  135. console.log('用户点击取消');
  136. }
  137. }
  138. })
  139. }else {
  140. uni.showModal({
  141. title: '提示',
  142. content: '请先阅读并同意用户协议',
  143. success(res) {
  144. if (res.confirm) {
  145. console.log('用户点击确定');
  146. } else if (res.cancel) {
  147. console.log('用户点击取消');
  148. }
  149. }
  150. })
  151. }
  152. },
  153. goShare() {
  154. },
  155. getInfo() {
  156. getPlanInfo({
  157. id: this.id
  158. }).then(e => {
  159. this.art = e.data[0];
  160. if (this.art.text != null) {
  161. this.description = this.art.text.replace(/<img/g, "<img class='baseimg'");
  162. } //小程序商品详情图超出屏幕问题
  163. this.IndexShare(this.art.title,this.art.info)
  164. });
  165. },
  166. changeTc(e) {
  167. console.log(e);
  168. },
  169. closeTc() {
  170. this.$refs.popup.close()
  171. },
  172. openTc() {
  173. if (this.hasLogin) {
  174. uni.navigateTo({
  175. url:'/pages/index/pay?id=' + this.art.plan_id+ '&tit=' + this.art.title
  176. })
  177. } else {
  178. saveUrl();
  179. uni.showModal({
  180. title: '登录',
  181. content: '您未登录,是否马上登陆?',
  182. success: e => {
  183. if (e.confirm) {
  184. interceptor();
  185. }
  186. },
  187. fail: e => {
  188. console.log(e);
  189. }
  190. });
  191. }
  192. },
  193. sy() {
  194. this.diy = true
  195. this.money = Math.floor(Math.random() * 500) + 1;
  196. },
  197. IndexShare(title,desc) {
  198. let obj = this;
  199. // let money = obj.money;
  200. let item = {
  201. link: this.$store.state.baseURL + '/index/#/pages/index/yue?id=' + obj.id , // 分享链接
  202. imgUrl: this.$store.state.baseURL + '/index/static/img/002.png',
  203. desc: desc,
  204. title: title,
  205. success() {
  206. console.log('分享成功');
  207. }
  208. };
  209. weixindata(item);
  210. },
  211. }
  212. }
  213. </script>
  214. <style lang="scss">
  215. .logo {
  216. width: 750rpx;
  217. }
  218. .art-info {
  219. background-color: #fff;
  220. padding: 0 30rpx 35rpx;
  221. margin-bottom: 20rpx;
  222. position: relative;
  223. .tit,
  224. .des {
  225. width: 80%;
  226. }
  227. .tit {
  228. font-weight: bold;
  229. font-size: 42rpx;
  230. color: #1B282E;
  231. padding-top: 30rpx;
  232. }
  233. .des {
  234. font-size: 28rpx;
  235. color: #898d8f;
  236. padding: 15rpx 0 30rpx;
  237. }
  238. .share-num {
  239. font-weight: 500;
  240. font-size: 24rpx;
  241. color: #FB2D42;
  242. image {
  243. width: 28rpx;
  244. height: 26rpx;
  245. vertical-align: bottom;
  246. margin-right: 8rpx;
  247. }
  248. }
  249. .share {
  250. width: 44rpx;
  251. height: 44rpx;
  252. position: absolute;
  253. right: 26rpx;
  254. top: 32rpx;
  255. }
  256. }
  257. .art-detail {
  258. width: 100%;
  259. background-color: #fff;
  260. padding: 30rpx;
  261. .de-tit {
  262. text-align: center;
  263. font-size: 31rpx;
  264. color: #898d8f;
  265. align-items: center;
  266. justify-content: center;
  267. .line {
  268. width: 38rpx;
  269. height: 2rpx;
  270. background-color: #E0E0DF;
  271. margin: 0 20rpx;
  272. }
  273. }
  274. }
  275. .tc {
  276. height: 99rpx;
  277. }
  278. .btn {
  279. width: 750rpx;
  280. height: 120rpx;
  281. background: #f3392c;
  282. position: fixed;
  283. bottom: 0;
  284. font-size: 36rpx;
  285. color: #FFFFFF;
  286. text-align: center;
  287. display: flex;
  288. flex-direction: column;
  289. justify-content: center;
  290. .tip {
  291. font-size: 24rpx;
  292. }
  293. }
  294. .tc-wrap {
  295. width: 750rpx;
  296. // height: 578rpx;
  297. background: #FFFFFF;
  298. border-radius: 30rpx 30rpx 0 0;
  299. padding: 0 31rpx 66rpx 32rpx;
  300. .tit {
  301. height: 114rpx;
  302. align-items: center;
  303. justify-content: space-between;
  304. font-weight: bold;
  305. font-size: 42rpx;
  306. color: #1E2B31;
  307. border-bottom: 1px solid #EDF0F2;
  308. image {
  309. width: 34rpx;
  310. height: 34rpx;
  311. }
  312. }
  313. .m-list {
  314. justify-content: space-between;
  315. padding: 30rpx 0;
  316. .mitem {
  317. width: 215rpx;
  318. line-height: 96rpx;
  319. background: #FFFFFF;
  320. border-radius: 5rpx;
  321. border: 1px solid #78919d;
  322. text-align: center;
  323. font-weight: bold;
  324. font-size: 29rpx;
  325. color: #1E2B31;
  326. }
  327. .action {
  328. background: #fdecee;
  329. border: 1px solid #ed3142;
  330. color: #ED3142;
  331. }
  332. }
  333. .sy-wrap {
  334. align-items: center;
  335. justify-content: space-between;
  336. }
  337. .user-inp {
  338. display: inline-block;
  339. width: 554rpx;
  340. height: 81rpx;
  341. line-height: 81rpx;
  342. background: #FFFFFF;
  343. border-radius: 5rpx;
  344. border: 1px solid #78919d;
  345. text-align: center;
  346. font-weight: bold;
  347. font-size: 29rpx;
  348. color: #1E2B31;
  349. }
  350. .re {
  351. width: 30rpx;
  352. height: 30rpx;
  353. margin-left: 33rpx;
  354. margin-right: 14rpx;
  355. }
  356. .sy {
  357. font-weight: bold;
  358. font-size: 29rpx;
  359. color: #0C0C0C;
  360. }
  361. .go {
  362. width: 100%;
  363. line-height: 94rpx;
  364. background: #f3392c;
  365. border-radius: 46rpx;
  366. text-align: center;
  367. font-weight: bold;
  368. font-size: 33rpx;
  369. color: #FFFFFF;
  370. margin-top: 20rpx;
  371. }
  372. }
  373. .notice_name {
  374. font-size: 35rpx !important;
  375. color: #303133;
  376. padding: 25rpx 25rpx 0rpx 25rpx;
  377. margin-bottom: 25rpx;
  378. }
  379. .course-video {
  380. width: 100%;
  381. height: 500rpx;
  382. }
  383. .notice-item {
  384. width: 100%;
  385. height: 100%;
  386. color: #666666;
  387. padding: 35rpx 0;
  388. font-size: 23rpx;
  389. padding-bottom: 30rpx;
  390. }
  391. .baseimg {
  392. max-width: 100%;
  393. height: auto;
  394. }
  395. .sharebase {
  396. display: block;
  397. position: fixed;
  398. top: 0;
  399. left: 0;
  400. width: 100%;
  401. height: 100%;
  402. }
  403. .join {
  404. padding-bottom: 10rpx;
  405. }
  406. </style>