index文件夹修改

This commit is contained in:
GaoHao
2024-12-23 16:38:42 +08:00
parent 5a55632bc0
commit 54250730ce
3 changed files with 74 additions and 74 deletions

View File

@@ -1,44 +1,44 @@
<template>
<view>
<view class="bg-white padding-sm margin flex" style="border-radius: 24rpx;">
<u-image width="200rpx" height="200rpx" border-radius="10rpx" :src="courseList.titleImg">
<u-image width="200rpx" height="200rpx" border-radius="10rpx" :src="courseListIos.titleImg">
</u-image>
<view class="flex flex-direction justify-between margin-left-sm" style="width:420rpx;">
<view class="text-bold text-black margin-top-xs u-line-1 text-lg">{{courseList.title}}
<view class="text-bold text-black margin-top-xs u-line-1 text-lg">{{courseListIos.title}}
</view>
<!-- <view class="text-gray text-26 margin-top">最近在学{{courseList.payNum}}</view> -->
<!-- <view class="text-gray text-26 margin-top">最近在学{{courseListIos.payNum}}</view> -->
<view class="flex justify-between ">
<view class=" text-bold " style="color: #FF8211;">¥<text
style="font-size: 42rpx;">{{courseList.price}}</text></view>
style="font-size: 42rpx;">{{courseListIos.price}}</text></view>
</view>
</view>
</view>
<view class="popup_pay">
<view class="popup_pay_ios">
<view class="text-lg text-bold">支付方式</view>
<view class="flex align-center justify-between" style="height: 100upx;" v-for="(item,index) in openLists"
<view class="flex align-center justify-between" style="height: 100upx;" v-for="(item,index) in openListsIos"
:key='index'>
<image :src="item.image" style="width: 55upx;height: 55upx;border-radius: 50upx;">
</image>
<view style="font-size: 30upx;margin-left: 20upx;width: 70%;">
{{item.text}}
</view>
<radio-group name="openWay" style="margin-left: 45upx;" @tap.stop='selectWay(item)'>
<label class="tui-radio">
<radio color="red" :checked="openWay === item.id ? true : false" />
<radio-group name="openWay" style="margin-left: 45upx;" @tap.stop='selectWayIos(item)'>
<label >
<radio color="red" :checked="openWayIos === item.id ? true : false" />
</label>
</radio-group>
</view>
<!-- <view class="pay_btn" @click="pay()">确认支付</view> -->
<!-- <view class="pay_btn" @click="payIos()">确认支付</view> -->
</view>
<view class="taber">
<view class="taber_ios">
<view class="flex align-center" style="color: #FF8211;">
<text style="color: #333;">实付款</text>
<view class=" text-bold " style="color: #FF8211;">¥<text
style="font-size: 42rpx;">{{courseList.price}}</text></view>
style="font-size: 42rpx;">{{courseListIos.price}}</text></view>
</view>
<view class="btn" @click="pay">确定并支付</view>
<view class="btn_ios" @click="payIos">确定并支付</view>
</view>
</view>
</template>
@@ -47,17 +47,17 @@
export default {
data() {
return {
courseId: '',
courseList: [],
courseIdIos: '',
courseListIos: [],
openLists: [],
openWay: 1,
flag: true
openListsIos: [],
openWayIos: 1,
flagIos: true
}
},
onLoad(option) {
// #ifdef APP
this.openLists = [{
this.openListsIos = [{
image: '../../../static/images/index/weixin.png',
text: '微信支付',
id: 1
@@ -66,22 +66,22 @@
text: '支付宝',
id: 2
}],
this.openWay = 1;
this.openWayIos = 1;
// #endif
// #ifdef MP-WEIXIN
this.openLists = [{
this.openListsIos = [{
image: '../../../static/images/index/weixin.png',
text: '微信支付',
id: 1
}],
this.openWay = 1;
this.openWayIos = 1;
// #endif
// #ifdef H5
let ua = navigator.userAgent.toLowerCase();
if (ua.indexOf('micromessenger') !== -1) {
this.openLists = [{
this.openListsIos = [{
image: '../../../static/images/index/weixin.png',
text: '微信支付',
id: 1
@@ -90,39 +90,39 @@
text: '支付宝',
id: 2
}],
this.openWay = 1;
this.openWayIos = 1;
} else {
this.openLists = [{
this.openListsIos = [{
image: '../../../static/images/index/zhifubao.png',
text: '支付宝',
id: 2
}],
this.openWay = 2;
this.openWayIos = 2;
}
// this.openLists = [{
// this.openListsIos = [{
// image: '../../../static/images/index/zhifubao.png',
// text: '支付宝',
// id: 2
// }],
// this.openWay = 2;
// this.openWayIos = 2;
// #endif
if (option.courseId) {
this.courseId = option.courseId
this.getDataList(this.courseId)
this.courseIdIos = option.courseId
this.getDataListIos(this.courseIdIos)
}
},
methods: {
selectWay(e) {
this.openWay = e.id;
selectWayIos(e) {
this.openWayIos = e.id;
},
// 资源详情
getDataList(id) {
getDataListIos(id) {
let data = {
id
}
this.$u.api.courseDet(data).then(res => {
if (res.code == 0) {
this.courseList = res.data
this.courseListIos = res.data
} else {
uni.showToast({
title: res.msg,
@@ -133,12 +133,12 @@
})
},
pay() {
payIos() {
let that = this
if (that.flag) {
that.flag = false
if (that.flagIos) {
that.flagIos = false
let data = {
courseId: that.courseList.courseId
courseId: that.courseListIos.courseId
}
that.$u.api.courseOrder(data).then(res => {
if (res.code == 0 && res.data.flag == 1) {
@@ -146,12 +146,12 @@
title: '已获取资源',
icon: 'success'
})
that.getDataList(that.courseId);
that.getDataListIos(that.courseIdIos);
} else if (res.code == 0 && res.data.flag == 2) {
uni.showLoading({
title: '支付中...'
})
if (that.openWay == 1) {
if (that.openWayIos == 1) {
// #ifdef MP-WEIXIN
that.$u.post('app/wxPay/wxPayJsApiOrder?orderId=' + res.data.orders.ordersId, {})
.then(
@@ -219,7 +219,7 @@
}
});
// #endif
} else if (that.openWay == 2) {
} else if (that.openWayIos == 2) {
// #ifdef H5
that.$u.post('/app/aliPay/payOrder?orderId=' + res.data.orders.ordersId +
'&classify=2').then(
@@ -261,11 +261,11 @@
icon: 'none',
// duration: 1500
})
// that.getDataList(that.courseId);
// that.getDataListIos(that.courseId);
}
})
setTimeout(() => {
that.flag = true
that.flagIos = true
}, 1500)
}
@@ -364,14 +364,14 @@
background: #F5F5F5;
}
.popup_pay {
.popup_pay_ios {
background: #FFFFFF;
border-radius: 24rpx;
margin: 30rpx 30rpx;
padding: 30rpx 30rpx 20rpx 30rpx;
}
.taber {
.taber_ios {
position: fixed;
bottom: 0;
left: 0;
@@ -384,7 +384,7 @@
justify-content: space-between;
}
.btn {
.btn_ios {
width: 260rpx;
height: 78rpx;
background: #5074FF;