| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114 | <template>	<app-layout>		<app-math-card v-for="(item,index) in mathLists"					   :key="index"					   :cover-image="item.coverImage"					   :title="item.title"					   :index="index"					   :custom-style="{marginLeft:index % 2 === 1 ? '20rpx' : 0}"					   @open="handleOpen"		>		</app-math-card>		<u-modal v-model="modal.show"				 :show-cancel-button="true"				 cancel-text="放弃机会"				 cancel-color="#CCCCCC"				 confirm-text="购买"				 confirm-color="#046E64"				 @confirm="handleConfirmBuy"		>			<view class="slot-content">				<view class="title">{{modal.title}}</view>				<view class="sub-title">{{modal.subTitle}}</view>			</view>		</u-modal>	</app-layout></template><script>	import appLayout from "@/components/app-layout"	import appMathCard from "@/components/index/app-math-card"	import mathLists from "@/core/math-lists.js"	export default {		components:{			appLayout,			appMathCard		},		data() {			return {				mathLists: mathLists,				modal:{					show: false,					title: '该功能需开通永久使用',					subTitle: '做桥架不求人,让你秒变大师',				},				scene: '',				setting: null			}		},		methods: {			handleOpen(index){				if(this.setting.review_mode) return				if(this.vuex_user_data.is_vip == 0){					this.modal.show = true					/*if(this.$platform === 'ios'){						uni.showModal({							title: '提示',							content: '由于相关规范,iOS功能暂不可用',							success: function (res) {								// res.confirm res.cancel							}						});					}else{						this.modal.show = true					}*/				}else{					this.$jump({url: mathLists[index].url,type:'to'})				}			},			handleConfirmBuy(){				this.$jump({url:'/pages/my/member',type:'to'})			},			handleBind(){				this.$u.api.userBind({scene:this.scene}).then(res => {					this.$u.vuex(this.$const.USER_SCENE, null);				})			},			getSetting(){				this.$u.api.settingGet().then(data => {					this.setting = data;				})			},		},		onLoad(options){			this.scene = options.scene;			console.log('-->data',this.scene)			if(this.scene){				this.$u.vuex(this.$const.USER_SCENE,this.scene);				this.handleBind()			}			this.getSetting();		},		onShareAppMessage() {			return this.$util.shareMessage(this.vuex_user_data);		},	}</script><style lang="scss" scoped>	.slot-content{		text-align: center;		padding: 36rpx 0;		.title{			font-size: 36rpx;			font-weight: 600;			color: #333333;			padding: 12rpx 0;		}		.sub-title{			font-size: 28rpx;			color: #999999;		}	}</style>
 |