0315
This commit is contained in:
@@ -1,24 +1,26 @@
|
|||||||
{ // launch.json 配置了启动调试时相关设置,configurations下节点名称可为 app-plus/h5/mp-weixin/mp-baidu/mp-alipay/mp-qq/mp-toutiao/mp-360/
|
{
|
||||||
|
// launch.json 配置了启动调试时相关设置,configurations下节点名称可为 app-plus/h5/mp-weixin/mp-baidu/mp-alipay/mp-qq/mp-toutiao/mp-360/
|
||||||
// launchtype项可配置值为local或remote, local代表前端连本地云函数,remote代表前端连云端云函数
|
// launchtype项可配置值为local或remote, local代表前端连本地云函数,remote代表前端连云端云函数
|
||||||
"version" : "0.0",
|
"version" : "0.0",
|
||||||
"configurations": [{
|
"configurations" : [
|
||||||
"app-plus" :
|
|
||||||
{
|
{
|
||||||
|
"app-plus" : {
|
||||||
"launchtype" : "local"
|
"launchtype" : "local"
|
||||||
},
|
},
|
||||||
"default" :
|
"default" : {
|
||||||
{
|
|
||||||
"launchtype" : "local"
|
"launchtype" : "local"
|
||||||
},
|
},
|
||||||
"h5" :
|
"h5" : {
|
||||||
{
|
|
||||||
"launchtype" : "local"
|
"launchtype" : "local"
|
||||||
},
|
},
|
||||||
"mp-weixin" :
|
"mp-weixin" : {
|
||||||
{
|
|
||||||
"launchtype" : "local"
|
"launchtype" : "local"
|
||||||
},
|
},
|
||||||
"type" : "uniCloud"
|
"type" : "uniCloud"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"playground" : "custom",
|
||||||
|
"type" : "uni-app:app-ios"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -85,7 +85,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"splashscreen" : {
|
"splashscreen" : {
|
||||||
"iosStyle" : "storyboard",
|
"iosStyle" : "common",
|
||||||
"androidStyle" : "default",
|
"androidStyle" : "default",
|
||||||
"useOriginalMsgbox" : true
|
"useOriginalMsgbox" : true
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -6,14 +6,14 @@
|
|||||||
<view class="vip_top">
|
<view class="vip_top">
|
||||||
<view class="now_vip">
|
<view class="now_vip">
|
||||||
<image src="../../static/icon/mine_card.png" alt=""></image>
|
<image src="../../static/icon/mine_card.png" alt=""></image>
|
||||||
<text>
|
<view class="text">
|
||||||
<image src="../../static/icon/mine_v.png" alt=""></image>
|
<image src="../../static/icon/mine_v.png" alt=""></image>
|
||||||
疯子读书会员
|
疯子读书会员
|
||||||
<br>
|
<br>
|
||||||
<i>VIPFENGZIDUSHU</i>
|
<i>VIPFENGZIDUSHU</i>
|
||||||
<br>
|
<br>
|
||||||
<b>加入会员立项4项特权</b>
|
<b>加入会员立项4项特权</b>
|
||||||
</text>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="vip_quan">
|
<view class="vip_quan">
|
||||||
@@ -75,11 +75,27 @@
|
|||||||
</u-radio-group>
|
</u-radio-group>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="agree_wo">* 我已阅读并同意《会员服务协议》</view>
|
<view class="agree_wo" style="float: left; display: flex;">
|
||||||
|
<radio-group class="agree">
|
||||||
|
<view v-for="(item, index) in argee" :key="index" >
|
||||||
|
<radio class="agreeRadio" :value="item.id" :checked="item.id==radioValue" @click="radioCheck(index)"></radio>
|
||||||
|
<!-- <view>{{item.value}}</view> -->
|
||||||
|
</view>
|
||||||
|
</radio-group>
|
||||||
|
<view>* 我已阅读并同意<span class="highlight" @click="showXieyi">《会员服务协议》</span></view></view>
|
||||||
|
|
||||||
<view class="vip_btn">
|
<view class="vip_btn">
|
||||||
<view @click="goPoinBuy">立即开通会员</view>
|
<view @click="goPoinBuy">立即开通会员</view>
|
||||||
</view>
|
</view>
|
||||||
|
<!-- 充值协议 -->
|
||||||
|
<u-popup :show="xieyiShow" :round="10" @close="xieyiShow=false">
|
||||||
|
<view class="tanchu">
|
||||||
|
<view class="dp_title">会员服务协议</view>
|
||||||
|
<view style="max-height: 1000rpx;overflow-y: scroll;">
|
||||||
|
<view v-html="xieyi.content"></view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</u-popup>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -95,6 +111,16 @@
|
|||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
xieyiShow : false,
|
||||||
|
xieyi:{
|
||||||
|
title:'',
|
||||||
|
content:''
|
||||||
|
},
|
||||||
|
argee:[
|
||||||
|
{value:false,id:'1'}
|
||||||
|
|
||||||
|
] ,// 同意权限
|
||||||
|
radioValue:'',
|
||||||
stepsVc: {},
|
stepsVc: {},
|
||||||
vcList: [],
|
vcList: [],
|
||||||
userMes:{},
|
userMes:{},
|
||||||
@@ -135,7 +161,29 @@
|
|||||||
},
|
},
|
||||||
//方法
|
//方法
|
||||||
methods: {
|
methods: {
|
||||||
|
showXieyi(){
|
||||||
|
this.$http
|
||||||
|
.get(`sys/agreement/list?key=member`)
|
||||||
|
.then(res => {
|
||||||
|
this.xieyi = res.page.list[0]
|
||||||
|
this.xieyiShow = true
|
||||||
|
})
|
||||||
|
|
||||||
|
},
|
||||||
|
radioCheck (index) {
|
||||||
|
this.argee.forEach((item =>{
|
||||||
|
item.isCheck = false
|
||||||
|
}))
|
||||||
|
if(this.radioValue==this.argee[index].id) {
|
||||||
|
this.radioValue =null
|
||||||
|
}else {
|
||||||
|
this.radioValue = this.argee[index].id
|
||||||
|
}
|
||||||
|
// console.log(this.radioValue)
|
||||||
|
},
|
||||||
goPoinBuy(){
|
goPoinBuy(){
|
||||||
|
if(this.radioValue == '1'){
|
||||||
|
|
||||||
if(this.stepsVc.money > this.userMes.peanutCoin){
|
if(this.stepsVc.money > this.userMes.peanutCoin){
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title:'疯币不足,请充值',
|
title:'疯币不足,请充值',
|
||||||
@@ -146,6 +194,13 @@
|
|||||||
}else{
|
}else{
|
||||||
this.kaiVip()
|
this.kaiVip()
|
||||||
}
|
}
|
||||||
|
}else{
|
||||||
|
uni.showToast({
|
||||||
|
title:'请勾选服务协议',
|
||||||
|
icon:'error'
|
||||||
|
})
|
||||||
|
return false
|
||||||
|
}
|
||||||
},
|
},
|
||||||
// 充值疯币
|
// 充值疯币
|
||||||
buPoint() {
|
buPoint() {
|
||||||
@@ -290,6 +345,115 @@
|
|||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
@import '@/style/mixin.scss';
|
@import '@/style/mixin.scss';
|
||||||
|
.agreeRadio{ zoom: .8;}
|
||||||
|
.tanchu {
|
||||||
|
padding: 40rpx 30rpx 40rpx 30rpx;
|
||||||
|
position: relative;
|
||||||
|
|
||||||
|
|
||||||
|
.dp_title {
|
||||||
|
font-size: 32rpx;
|
||||||
|
margin-bottom: 50rpx;
|
||||||
|
color: #555;
|
||||||
|
text-align: center;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dp_add {
|
||||||
|
position: absolute;
|
||||||
|
top: 40rpx;
|
||||||
|
right: 30rpx;
|
||||||
|
font-size: 22rpx;
|
||||||
|
background-color: #fd6004;
|
||||||
|
color: #fff;
|
||||||
|
border-radius: 10rpx;
|
||||||
|
padding: 5rpx 10rpx;
|
||||||
|
|
||||||
|
.u-icon {
|
||||||
|
display: inline-block;
|
||||||
|
margin-right: 5rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.addressItem {
|
||||||
|
border: 2px dashed #d9d9d9;
|
||||||
|
border-radius: 10rpx;
|
||||||
|
width: 100%;
|
||||||
|
display: flex;
|
||||||
|
padding: 20rpx 10rpx;
|
||||||
|
margin: 25rpx 0 0 0;
|
||||||
|
align-items: center;
|
||||||
|
background-color: #fff;
|
||||||
|
|
||||||
|
.addrContent {
|
||||||
|
margin-left: 40rpx;
|
||||||
|
flex: 1;
|
||||||
|
|
||||||
|
.addrContentTop {
|
||||||
|
display: flex;
|
||||||
|
align-items: flex-end;
|
||||||
|
margin: 0 0 15rpx 0;
|
||||||
|
position: relative;
|
||||||
|
|
||||||
|
.userName {
|
||||||
|
font-size: 35rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
margin-right: 30rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.userTel {
|
||||||
|
font-size: 25rpx;
|
||||||
|
color: #888;
|
||||||
|
}
|
||||||
|
|
||||||
|
.userMoren {
|
||||||
|
border: 1px solid #fd6004;
|
||||||
|
color: #fd6004;
|
||||||
|
padding: 3rpx 10rpx;
|
||||||
|
font-size: 22rpx;
|
||||||
|
border-radius: 10rpx;
|
||||||
|
margin: 0 0 0 20rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.chooseCheck {
|
||||||
|
position: absolute;
|
||||||
|
top: 3rpx;
|
||||||
|
right: 6rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.addrContentBottom {
|
||||||
|
font-size: 32rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.addressItem.addItem_style {
|
||||||
|
border-color: #fd6004;
|
||||||
|
}
|
||||||
|
|
||||||
|
.youhuiItem {
|
||||||
|
border: 1px solid #d9d9d9;
|
||||||
|
border-radius: 10rpx;
|
||||||
|
width: 100%;
|
||||||
|
display: flex;
|
||||||
|
padding: 20rpx 10rpx;
|
||||||
|
margin: 25rpx 0 0 0;
|
||||||
|
align-items: center;
|
||||||
|
background-color: #fff;
|
||||||
|
font-size: 30rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.youhuiItem>view {
|
||||||
|
float: left;
|
||||||
|
}
|
||||||
|
|
||||||
|
.youhuiItem.youItem_style {
|
||||||
|
border-color: #fd6004;
|
||||||
|
}
|
||||||
|
}
|
||||||
.chongBtn {
|
.chongBtn {
|
||||||
background-color: #54a966;
|
background-color: #54a966;
|
||||||
color: #fff !important;
|
color: #fff !important;
|
||||||
@@ -320,8 +484,15 @@
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
height: 410rpx;
|
height: 410rpx;
|
||||||
}
|
}
|
||||||
|
.text{margin-top: 60rpx;
|
||||||
text {
|
font-size: 50upx;
|
||||||
|
line-height: 80upx;
|
||||||
|
color: #977749;
|
||||||
|
font-weight: bold;
|
||||||
|
position: absolute;
|
||||||
|
left: 80rpx;
|
||||||
|
top: 3rpx;}
|
||||||
|
.text {
|
||||||
margin-top: 60rpx;
|
margin-top: 60rpx;
|
||||||
font-size: 50upx;
|
font-size: 50upx;
|
||||||
line-height: 80upx;
|
line-height: 80upx;
|
||||||
|
|||||||
@@ -20,7 +20,8 @@
|
|||||||
|
|
||||||
<view class="cf_radio">
|
<view class="cf_radio">
|
||||||
<u-radio-group v-model="payType">
|
<u-radio-group v-model="payType">
|
||||||
<view style="width: 100%;" v-if="isAndroid">
|
<!-- #ifdef MP-WEIXIN -->
|
||||||
|
<view style="width: 100%;" >
|
||||||
<view v-for="(item, index) in paylist" @click="choseType(item.id)"
|
<view v-for="(item, index) in paylist" @click="choseType(item.id)"
|
||||||
:class="payType == item.id?'Tab_xf cf_xuanx':'cf_xuanx'">
|
:class="payType == item.id?'Tab_xf cf_xuanx':'cf_xuanx'">
|
||||||
<image :src="item.img"></image>
|
<image :src="item.img"></image>
|
||||||
@@ -30,7 +31,9 @@
|
|||||||
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view style="width: 100%;" v-else>
|
<!-- #endif -->
|
||||||
|
<!-- #ifdef APP-IOS -->
|
||||||
|
<view style="width: 100%;" >
|
||||||
<view v-for="(item, index) in iosPaylist" @click="choseType(item.id)"
|
<view v-for="(item, index) in iosPaylist" @click="choseType(item.id)"
|
||||||
:class="payType == item.id?'Tab_xf cf_xuanx':'cf_xuanx'">
|
:class="payType == item.id?'Tab_xf cf_xuanx':'cf_xuanx'">
|
||||||
<image :src="item.img"></image>
|
<image :src="item.img"></image>
|
||||||
@@ -40,15 +43,36 @@
|
|||||||
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
<!-- #endif -->
|
||||||
</u-radio-group>
|
</u-radio-group>
|
||||||
</view>
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="agree_wo flexbox" style="float: left; display: flex;" >
|
||||||
|
<radio-group class="agree">
|
||||||
|
<view v-for="(item, index) in argee" :key="index" >
|
||||||
|
<radio class="agreeRadio" :value="item.id" :checked="item.id==radioValue" @click="radioCheck(index)"></radio>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
<view class="agree_wo">* 我已阅读并同意《会员服务协议》</view>
|
</radio-group>
|
||||||
<view class="char_btn">
|
<view>* 我已阅读并同意<span class="highlight" @click="showXieyi">《增值服务协议》</span></view>
|
||||||
<view @click="kaiChar" v-if="isAndroid">立即充值</view>
|
|
||||||
<view @click="iosPay" v-else>立即充值</view>
|
|
||||||
</view>
|
</view>
|
||||||
|
<view class="char_btn">
|
||||||
|
<!-- #ifdef MP-WEIXIN -->
|
||||||
|
<view @click="kaiChar">立即充值</view>
|
||||||
|
<!-- #endif -->
|
||||||
|
<!-- #ifdef APP-IOS -->
|
||||||
|
<view @click="iosPay" >立即充值</view>
|
||||||
|
<!-- #endif -->
|
||||||
|
</view>
|
||||||
|
<!-- 充值协议 -->
|
||||||
|
<u-popup :show="xieyiShow" :round="10" @close="xieyiShow=false">
|
||||||
|
<view class="tanchu">
|
||||||
|
<view class="dp_title">增值服务协议</view>
|
||||||
|
<view style="max-height: 1000rpx;overflow-y: scroll;">
|
||||||
|
<view v-html="xieyi.content"></view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</u-popup>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -68,11 +92,26 @@
|
|||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
xieyi:{
|
||||||
|
title:'',
|
||||||
|
content:''
|
||||||
|
},
|
||||||
|
xieyiShow:false,
|
||||||
stepsCj: {},
|
stepsCj: {},
|
||||||
cjList: [],
|
cjList: [],
|
||||||
|
argee:[
|
||||||
|
{value:false,id:'1'}
|
||||||
|
|
||||||
|
] ,// 同意权限
|
||||||
|
radioValue:'',
|
||||||
|
orderSn:'', // 订单sn
|
||||||
productid: '',
|
productid: '',
|
||||||
isAndroid: true, // 是否为安卓环境
|
isAndroid: true, // 是否为安卓环境
|
||||||
|
|
||||||
payType: 2,
|
payType: 2,
|
||||||
|
// #ifdef APP-IOS
|
||||||
|
payType: 3,
|
||||||
|
// #endif
|
||||||
paylist: [{
|
paylist: [{
|
||||||
title: '支付宝',
|
title: '支付宝',
|
||||||
id: 2,
|
id: 2,
|
||||||
@@ -84,13 +123,11 @@
|
|||||||
img: '../../static/icon/pay_2.png'
|
img: '../../static/icon/pay_2.png'
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
iosPaylist: [
|
iosPaylist: [{
|
||||||
{
|
title: 'IOS支付',
|
||||||
title: 'ios内购',
|
|
||||||
id: 3,
|
id: 3,
|
||||||
img: '../../static/icon/pay_2.png'
|
img: '../../static/icon/pay_2.png'
|
||||||
}
|
}],
|
||||||
],
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
//第一次加载
|
//第一次加载
|
||||||
@@ -98,89 +135,132 @@
|
|||||||
// 隐藏原生的tabbar
|
// 隐藏原生的tabbar
|
||||||
uni.hideTabBar();
|
uni.hideTabBar();
|
||||||
this.getData();
|
this.getData();
|
||||||
this.getIapChannels()
|
|
||||||
},
|
},
|
||||||
//页面显示
|
//页面显示
|
||||||
onShow() {
|
onShow() {
|
||||||
// 隐藏原生的tabbar
|
// 隐藏原生的tabbar
|
||||||
uni.hideTabBar();
|
uni.hideTabBar();
|
||||||
this.requestIapOrder()
|
// this.requestIapOrder()
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
...mapState(['userInfo']),
|
...mapState(['userInfo']),
|
||||||
},
|
},
|
||||||
//方法
|
//方法
|
||||||
methods: {
|
methods: {
|
||||||
// 获取应用内支付对象
|
showXieyi(){
|
||||||
getIapChannels() {
|
this.$http
|
||||||
console.log('------getIapChannels' );
|
.get(`sys/agreement/list?key=pay`)
|
||||||
let _this = this;
|
.then(res => {
|
||||||
plus.payment.getChannels(function(channels){
|
this.xieyi = res.page.list[0]
|
||||||
for (let i in channels) {
|
this.xieyiShow = true
|
||||||
let channel = channels[i];
|
})
|
||||||
// 获取 id 为 'appleiap' 的 channel
|
|
||||||
if (channel.id == 'appleiap') {
|
},
|
||||||
_this.iap = channel;
|
radioCheck (index) { // 勾选用户协议
|
||||||
_this.requestIapOrder();
|
this.argee.forEach((item =>{
|
||||||
|
item.isCheck = false
|
||||||
|
}))
|
||||||
|
if(this.radioValue==this.argee[index].id) {
|
||||||
|
this.radioValue =null
|
||||||
|
}else {
|
||||||
|
this.radioValue = this.argee[index].id
|
||||||
|
}
|
||||||
|
// console.log(this.radioValue)
|
||||||
|
},
|
||||||
|
iphonepay() {
|
||||||
|
const that = this
|
||||||
|
uni.showLoading({
|
||||||
|
title: '检测支付环境...',
|
||||||
|
mask: true
|
||||||
|
})
|
||||||
|
plus.payment.getChannels((channels) => {
|
||||||
|
for (var i in channels) {
|
||||||
|
// 判断是否苹果支付
|
||||||
|
if (channels[i].id === 'appleiap') {
|
||||||
|
that.iapChannel = channels[i]
|
||||||
|
that.requestOrder()
|
||||||
|
consle.log(666666666)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}, function(e){
|
})
|
||||||
showToasts("获取iap支付通道失败:" + e.message);
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
// 获取到支付对象后,初始化支付项目列表
|
requestOrder() {
|
||||||
requestIapOrder() {
|
uni.showLoading({
|
||||||
console.log('------requestIapOrder' );
|
title: '到这...',
|
||||||
// #ifdef APP-PLUS
|
mask: true
|
||||||
let ids = [this.productid];
|
})
|
||||||
this.iap.requestOrder(ids, function(res) {
|
const that = this
|
||||||
console.log(res);
|
// ['xxxxx'] 是平台申请拿到的内购商品的id
|
||||||
this.iapOrder = true;
|
that.iapChannel.requestOrder(that.stepsCj.priceTypeId, function(event) {
|
||||||
}, function(e) {
|
// uni.hideLoading()
|
||||||
this.vm.jumpPay = false;
|
console.log(event)
|
||||||
showToasts("获取订单信息失败:" + e.code);
|
for (var index in event) {
|
||||||
});
|
var OrderItem = event[index]
|
||||||
// #endif
|
console.log(OrderItem)
|
||||||
},
|
that.topay(OrderItem.productid)
|
||||||
// 支付
|
}
|
||||||
goApplePay() {
|
}, function(erroemsg) {
|
||||||
console.log('------goApplePay' );
|
//uni.hideLoading()
|
||||||
// 获取订单
|
// uni.showToast({
|
||||||
let _this = this;
|
|
||||||
payApply().then(res => {
|
// })
|
||||||
// 发起支付
|
uni.showToast({
|
||||||
plus.payment.request(this.iap, {
|
title: "获取支付通道失败:",
|
||||||
productid: this.productid,
|
icon: 'none'
|
||||||
username: res.data.out_trade_no,
|
})
|
||||||
}, function(result){
|
|
||||||
console.log(result);
|
|
||||||
_this.appleNotify(result);
|
|
||||||
}, function(e){
|
|
||||||
// console.log(e);
|
|
||||||
this.vm.jumpPay = false;
|
|
||||||
showToasts("支付失败");
|
|
||||||
});
|
|
||||||
}).catch(err => {
|
|
||||||
showToasts(err.message || '获取数据失败');
|
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
appleNotify(notifyData) {
|
topay(id) {
|
||||||
console.log('------appleNotify' );
|
const that = this
|
||||||
|
uni.showLoading({
|
||||||
// 关闭支付弹窗
|
title: '充值中请勿离开',
|
||||||
this.popPayClose();
|
mask: true
|
||||||
|
})
|
||||||
// 支付成功
|
uni.requestPayment({
|
||||||
appleNotify({notify: notifyData}).then(res => {
|
provider: 'appleiap',
|
||||||
console.log(res);
|
orderInfo: {
|
||||||
if(res.data == 1) {
|
productid: id,
|
||||||
this.$emit('apply-pay-success');
|
username: 'ordersn', // 用户标识
|
||||||
}
|
optimize: true // 设置 optimize: true 解决丢单问题
|
||||||
}).catch(err => {
|
|
||||||
showToasts("支付失败");
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
// 回调处理,这里是用的前端回调返回给服务端处理
|
success: (res => {
|
||||||
|
uni.hideLoading()
|
||||||
|
let data= {
|
||||||
|
receipt:res.transactionReceipt, // 校验体
|
||||||
|
TransactionID: this.orderSn,
|
||||||
|
transactionId: res.transactionIdentifier //交易id
|
||||||
|
}
|
||||||
|
const orderId = this.orderId //这个订单id 是由后端返回的
|
||||||
|
const transactionId = res.transactionIdentifier //交易id
|
||||||
|
const payload = res.transactionReceipt //校验体
|
||||||
|
$http.request({
|
||||||
|
url: "/apple/applePay",
|
||||||
|
method: "POST", // POST、GET、PUT、DELETE,具体说明查看官方文档
|
||||||
|
data,
|
||||||
|
header: { //默认 无 说明:请求头
|
||||||
|
'Content-Type': 'application/json'
|
||||||
|
},
|
||||||
|
}).then(res => {
|
||||||
|
console.log(res)
|
||||||
|
uni.showToast({
|
||||||
|
title: '充值成功'
|
||||||
|
})
|
||||||
|
// 进行后续操作
|
||||||
|
///that.getUserInfo()
|
||||||
|
})
|
||||||
|
}),
|
||||||
|
fail: (e) => {
|
||||||
|
uni.hideLoading()
|
||||||
|
uni.showModal({
|
||||||
|
content: "支付失败",
|
||||||
|
showCancel: false
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
getDevName() {
|
getDevName() {
|
||||||
// 获取使用环境
|
// 获取使用环境
|
||||||
if (uni.getSystemInfoSync().platform === 'android') {
|
if (uni.getSystemInfoSync().platform === 'android') {
|
||||||
@@ -207,6 +287,7 @@
|
|||||||
// 点击充值金额
|
// 点击充值金额
|
||||||
chosPric(e) {
|
chosPric(e) {
|
||||||
this.stepsCj = e
|
this.stepsCj = e
|
||||||
|
console.log(e)
|
||||||
},
|
},
|
||||||
|
|
||||||
// 选择支付方式
|
// 选择支付方式
|
||||||
@@ -216,6 +297,8 @@
|
|||||||
},
|
},
|
||||||
//ios充值
|
//ios充值
|
||||||
iosPay() {
|
iosPay() {
|
||||||
|
if(this.radioValue == '1'){
|
||||||
|
|
||||||
let that = this
|
let that = this
|
||||||
|
|
||||||
let data = {
|
let data = {
|
||||||
@@ -238,12 +321,22 @@
|
|||||||
},
|
},
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
console.log(res)
|
console.log(res)
|
||||||
|
this.orderSn = res.orderSn
|
||||||
|
// this.topay(15)
|
||||||
|
this.iphonepay()
|
||||||
})
|
})
|
||||||
|
}else{
|
||||||
|
uni.showToast({
|
||||||
|
title:'请勾选服务协议',
|
||||||
|
icon:'error'
|
||||||
|
})
|
||||||
|
}
|
||||||
},
|
},
|
||||||
// 充值
|
// 充值
|
||||||
kaiChar() {
|
kaiChar() {
|
||||||
let that = this
|
if(this.radioValue == '1'){
|
||||||
|
|
||||||
|
let that = this
|
||||||
let data = {
|
let data = {
|
||||||
userId: that.userInfo.id, //下单人ID
|
userId: that.userInfo.id, //下单人ID
|
||||||
userPhone: that.userInfo.tel, //收货人手机号
|
userPhone: that.userInfo.tel, //收货人手机号
|
||||||
@@ -286,7 +379,13 @@
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
}else{
|
||||||
|
uni.showToast({
|
||||||
|
title:'请勾选 已阅读会员服务协议',
|
||||||
|
icon:'error'
|
||||||
|
})
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
},
|
},
|
||||||
@@ -303,7 +402,117 @@
|
|||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
|
||||||
@import '@/style/mixin.scss';
|
@import '@/style/mixin.scss';
|
||||||
|
.tanchu {
|
||||||
|
padding: 40rpx 30rpx 40rpx 30rpx;
|
||||||
|
position: relative;
|
||||||
|
|
||||||
|
|
||||||
|
.dp_title {
|
||||||
|
font-size: 32rpx;
|
||||||
|
margin-bottom: 50rpx;
|
||||||
|
color: #555;
|
||||||
|
text-align: center;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dp_add {
|
||||||
|
position: absolute;
|
||||||
|
top: 40rpx;
|
||||||
|
right: 30rpx;
|
||||||
|
font-size: 22rpx;
|
||||||
|
background-color: #fd6004;
|
||||||
|
color: #fff;
|
||||||
|
border-radius: 10rpx;
|
||||||
|
padding: 5rpx 10rpx;
|
||||||
|
|
||||||
|
.u-icon {
|
||||||
|
display: inline-block;
|
||||||
|
margin-right: 5rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.addressItem {
|
||||||
|
border: 2px dashed #d9d9d9;
|
||||||
|
border-radius: 10rpx;
|
||||||
|
width: 100%;
|
||||||
|
display: flex;
|
||||||
|
padding: 20rpx 10rpx;
|
||||||
|
margin: 25rpx 0 0 0;
|
||||||
|
align-items: center;
|
||||||
|
background-color: #fff;
|
||||||
|
|
||||||
|
.addrContent {
|
||||||
|
margin-left: 40rpx;
|
||||||
|
flex: 1;
|
||||||
|
|
||||||
|
.addrContentTop {
|
||||||
|
display: flex;
|
||||||
|
align-items: flex-end;
|
||||||
|
margin: 0 0 15rpx 0;
|
||||||
|
position: relative;
|
||||||
|
|
||||||
|
.userName {
|
||||||
|
font-size: 35rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
margin-right: 30rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.userTel {
|
||||||
|
font-size: 25rpx;
|
||||||
|
color: #888;
|
||||||
|
}
|
||||||
|
|
||||||
|
.userMoren {
|
||||||
|
border: 1px solid #fd6004;
|
||||||
|
color: #fd6004;
|
||||||
|
padding: 3rpx 10rpx;
|
||||||
|
font-size: 22rpx;
|
||||||
|
border-radius: 10rpx;
|
||||||
|
margin: 0 0 0 20rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.chooseCheck {
|
||||||
|
position: absolute;
|
||||||
|
top: 3rpx;
|
||||||
|
right: 6rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.addrContentBottom {
|
||||||
|
font-size: 32rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.addressItem.addItem_style {
|
||||||
|
border-color: #fd6004;
|
||||||
|
}
|
||||||
|
|
||||||
|
.youhuiItem {
|
||||||
|
border: 1px solid #d9d9d9;
|
||||||
|
border-radius: 10rpx;
|
||||||
|
width: 100%;
|
||||||
|
display: flex;
|
||||||
|
padding: 20rpx 10rpx;
|
||||||
|
margin: 25rpx 0 0 0;
|
||||||
|
align-items: center;
|
||||||
|
background-color: #fff;
|
||||||
|
font-size: 30rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.youhuiItem>view {
|
||||||
|
float: left;
|
||||||
|
}
|
||||||
|
|
||||||
|
.youhuiItem.youItem_style {
|
||||||
|
border-color: #fd6004;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.agreeRadio{ zoom: .8;}
|
||||||
|
|
||||||
.cha_jine {
|
.cha_jine {
|
||||||
margin: 40rpx 50rpx 0 50rpx;
|
margin: 40rpx 50rpx 0 50rpx;
|
||||||
@@ -363,7 +572,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.highlight{color: $uni-color-primary;}
|
||||||
.cha_fangsh {
|
.cha_fangsh {
|
||||||
margin: 40rpx 50rpx 0 50rpx;
|
margin: 40rpx 50rpx 0 50rpx;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user