|
@@ -22,65 +22,96 @@
|
|
|
<view>原价:<text class="original-price">¥598</text></view>
|
|
|
<view class="discount-price">活动价:¥198</view>
|
|
|
</view>
|
|
|
- <radio-group @change="radioChange" class="pay-type-box" >
|
|
|
+ <radio-group @change="radioChange" class="pay-type-box">
|
|
|
<view class="type-radio-title">支付方式</view>
|
|
|
<view class="type-radio-content">
|
|
|
<view class="type-radio-box">
|
|
|
<icon class="wx-radio"></icon>
|
|
|
<text>微信</text>
|
|
|
<radio value="weixin" :checked="payType==='weixin'" activeBackgroundColor="transparent"
|
|
|
- :class="{'radio-checked': payType==='weixin'}"/>
|
|
|
+ :class="{'radio-checked': payType==='weixin'}" />
|
|
|
</view>
|
|
|
<view class="type-radio-box">
|
|
|
<icon class="zfb-radio"></icon>
|
|
|
<text>支付宝</text>
|
|
|
<radio value="zhifubao" :checked="payType==='zhifubao'" activeBackgroundColor="transparent"
|
|
|
- :class="{'radio-checked': payType==='zhifubao'}" style="margin-right: 0;"/>
|
|
|
+ :class="{'radio-checked': payType==='zhifubao'}" style="margin-right: 0;" />
|
|
|
</view>
|
|
|
</view>
|
|
|
</radio-group>
|
|
|
- <view class="open-svip-btn">立即开通</view>
|
|
|
+ <view class="open-svip-btn" @click="creatOrder">立即开通</view>
|
|
|
</view>
|
|
|
<CustomTabBar></CustomTabBar>
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
|
-import {ref} from "vue";
|
|
|
-import CustomTabBar from '@/components/custom-tabbar/custom-tabbar.vue';
|
|
|
-let payType = ref('weixin')
|
|
|
-const svipArr = [
|
|
|
- {
|
|
|
- iconPath: 'static/images/pay/svip-list-icon1.png',
|
|
|
- title:'学习资源,随心畅学',
|
|
|
- content: `解锁全年级数学优质学习资源,满足多样<br/>学习需求`
|
|
|
- },
|
|
|
- {
|
|
|
- iconPath: 'static/images/pay/svip-list-icon2.png',
|
|
|
- title:'名师打造,优质路径',
|
|
|
- content: '资深名师精心规划学习路径,引领高效提升方向'
|
|
|
- },
|
|
|
- {
|
|
|
- iconPath: 'static/images/pay/svip-list-icon3.png',
|
|
|
- title:'进度分析,个性贴心',
|
|
|
- content: '优先参与丰富真题测试,精准洞察学习状况'
|
|
|
- },
|
|
|
- {
|
|
|
- iconPath: 'static/images/pay/svip-list-icon4.png',
|
|
|
- title:'真题测试,优先体验',
|
|
|
- content: '成为会员,即刻畅享专属权益,开启无忧学习之旅'
|
|
|
- }
|
|
|
-];
|
|
|
-function radioChange(data){
|
|
|
- payType.value = data.detail.value;
|
|
|
-}
|
|
|
-
|
|
|
-function goBack(data){
|
|
|
- uni.redirectTo({
|
|
|
- url: '/pages/study/index'
|
|
|
+ import {
|
|
|
+ ref
|
|
|
+ } from "vue";
|
|
|
+ import {
|
|
|
+ orderAdd
|
|
|
+ } from "@/api/order.js"
|
|
|
+ import CustomTabBar from '@/components/custom-tabbar/custom-tabbar.vue';
|
|
|
+ import cacheManager from "@/utils/cacheManager.js";
|
|
|
+ import {
|
|
|
+ onLoad,
|
|
|
+ onReady
|
|
|
+ } from '@dcloudio/uni-app';
|
|
|
+ import {
|
|
|
+ toast,
|
|
|
+ getUserIdentity
|
|
|
+ } from "@/utils/common";
|
|
|
+ let payType = ref('weixin')
|
|
|
+ let cardId = ref('')
|
|
|
+ const svipArr = [{
|
|
|
+ iconPath: 'static/images/pay/svip-list-icon1.png',
|
|
|
+ title: '学习资源,随心畅学',
|
|
|
+ content: `解锁全年级数学优质学习资源,满足多样<br/>学习需求`
|
|
|
+ },
|
|
|
+ {
|
|
|
+ iconPath: 'static/images/pay/svip-list-icon2.png',
|
|
|
+ title: '名师打造,优质路径',
|
|
|
+ content: '资深名师精心规划学习路径,引领高效提升方向'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ iconPath: 'static/images/pay/svip-list-icon3.png',
|
|
|
+ title: '进度分析,个性贴心',
|
|
|
+ content: '优先参与丰富真题测试,精准洞察学习状况'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ iconPath: 'static/images/pay/svip-list-icon4.png',
|
|
|
+ title: '真题测试,优先体验',
|
|
|
+ content: '成为会员,即刻畅享专属权益,开启无忧学习之旅'
|
|
|
+ }
|
|
|
+ ];
|
|
|
+ onLoad((options) => {
|
|
|
+ cardId.value = options.cardId
|
|
|
})
|
|
|
-}
|
|
|
|
|
|
+ function radioChange(data) {
|
|
|
+ payType.value = data.detail.value;
|
|
|
+ }
|
|
|
+
|
|
|
+ function creatOrder(data) {
|
|
|
+ let req = {
|
|
|
+ cardId:cardId.value
|
|
|
+ }
|
|
|
+ orderAdd(req).then(res=>{
|
|
|
+ console.log('res');
|
|
|
+ cacheManager.updateObject('auth',{cardList:[cardId.value]})
|
|
|
+ toast('开通成功!')
|
|
|
+ uni.redirectTo({
|
|
|
+ url: '/pages/study/index'
|
|
|
+ })
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+ function goBack(data) {
|
|
|
+ uni.redirectTo({
|
|
|
+ url: '/pages/study/index'
|
|
|
+ })
|
|
|
+ }
|
|
|
</script>
|
|
|
|
|
|
<style>
|