123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122 |
- <template>
- <view class="index">
- <image mode="center" :src="form.pic" />
- <view class="buy">
- <button type="buy" circle @click="getSubmit">立即购买</button>
- <span>
- <radio-group @change="getChange">
- <radio :value="value" />
- </radio-group>
- <text>购买即视为同意</text>
- <navigator url="/pages/imusic/agreement">《场景歌单付费协议》</navigator>
- <navigator url="/pages/imusic/service">《音乐服务许可协议》</navigator>
- </span>
- </view>
- </view>
- </template>
- <script>
- import { detail } from '@/api/imusic.js'
- export default {
- data() {
- return {
- form: {},
- // 是否同意
- value: '0',
- id: ''
- }
- },
- onLoad(e) {
- if (e.id) {
- this.getDetail(e.id)
- this.id = e.id
- }
- },
- methods: {
- getDetail(e) {
- detail({ id: e }).then(res => {
- if (res.data.code === 0) {
- this.form = res.data.data
- }
- })
- },
- getChange() {
- this.value = '1'
- },
- // 立即购买
- getSubmit() {
- if (this.value === '1') {
- clickPay.postMessage(`{\"id\":\"${this.id}\", \"type\":15}`)
- } else {
- uni.showToast({
- title: '请先阅读并勾选协议',
- icon: 'none'
- })
- }
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- .index {
- width: 100%;
- height: 100%;
- overflow-y: hidden;
- }
- uni-image {
- width: 100%;
- height: 100%;
- }
- .buy {
- position: fixed;
- bottom: 0;
- width: 100%;
- height: 232rpx;
- overflow: hidden;
- }
- .buy::before {
- content: '';
- display: block;
- height: 232rpx;
- background: rgba(18, 18, 18, 0.4);
- backdrop-filter: blur(16rpx);
- }
- button {
- width: 92%;
- font-weight: bold;
- position: absolute;
- top: 24rpx;
- left: 50%;
- transform: translate(-50%);
- }
- navigator {
- display: inline;
- color: #FFF;
- }
- span {
- display: flex;
- justify-content: center;
- align-items: center;
- position: absolute;
- bottom: 60rpx;
- width: 100%;
- text-align: center;
- font-size: 24rpx;
- color: #d5d5d5;
- }
- ::v-deep uni-radio .uni-radio-input {
- width: 24rpx;
- height: 24rpx;
- background: none;
- }
- </style>
|