You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.
< template >
< view class = "container" >
< view class = "success" >
< view class = "result" >
< image class = "icon" src = "/static/pay/success.png" > < / image >
< text class = "text" > 支付成功 ! < / text >
< / view >
< view class = "amount" > ¥ { { amount } } < / view >
< view class = "point" v-if ="point > 0 && amount > 0.1">使用{{ point }}积分</view>
</view>
<view v-if="false" class="attention">
<view class="result"><image class="icon" src="/static/pay/success.png"></image>使用失败</view>
</view>
<view class="confirm" @click="doConfirm()" > 确 定 < / view >
< / view >
< / template >
< script >
import * as MessageApi from '@/api/message'
export default {
data ( ) {
return {
amount : 0 ,
point : 0 ,
}
} ,
/**
* 生命周期函数--监听页面加载
*/
onLoad ( options ) {
// 当前页面参数
this . amount = options . amount ? options . amount : 0
this . point = options . point ? options . point : 0
} ,
methods : {
/**
* 确定
* */
doConfirm ( ) {
const app = this
// #ifdef MP-WEIXIN
MessageApi . getSubTemplate ( { keys : "balanceChange,pointChange" } ) . then ( result => {
const templateIds = result . data
wx . requestSubscribeMessage ( { tmplIds : templateIds ,
success ( res ) {
console . log ( "调用成功!" )
} , fail ( res ) {
console . log ( "调用失败:" , res )
} , complete ( ) {
app . $navTo ( 'pages/index/index' )
} } )
} )
// #endif
// #ifndef MP-WEIXIN
app . $navTo ( 'pages/index/index' )
// #endif
}
}
}
< / script >
< style lang = "scss" scoped >
. success {
width : 100 % ;
text - align : center ;
margin - top : 200 rpx ;
. result {
font - size : 35 rpx ;
text - align : center ;
padding : 10 rpx 10 rpx 10 rpx 50 rpx ;
height : 70 rpx ;
. icon {
width : 45 rpx ;
height : 45 rpx ;
display : inline - block ;
box - sizing : border - box ;
vertical - align : middle ;
}
. text {
text - align : center ;
height : 100 % ;
display : inline - block ;
box - sizing : border - box ;
vertical - align : middle ;
color : # 00 B83F ;
font - weight : bold ;
}
}
. amount {
font - weight : bold ;
font - size : 65 rpx ;
margin - top : 50 rpx ;
margin - bottom : 50 rpx ;
color : # 000000 ;
}
. point {
font - size : 30 rpx ;
}
}
. attention {
width : 100 % ;
text - align : center ;
margin - top : 14 rpx ;
}
. confirm {
flex : 1 ;
font - size : 28 rpx ;
height : 80 rpx ;
line - height : 80 rpx ;
text - align : center ;
color : # fff ;
border - radius : 40 rpx ;
width : 300 rpx ;
margin : 50 rpx auto ;
background : $fuint - theme ;
}
< / style >