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,10 +1,10 @@
const ROOTPATH1 = "https://dj-api.hnsiyao.cn/sqx_fast/"; // // const ROOTPATH1 = "https://dj-api.hnsiyao.cn/sqx_fast/"; //
const ROOTPATH = "https://dj-api.hnsiyao.cn/sqx_fast/"; //后台服务域名 // const ROOTPATH = "https://dj-api.hnsiyao.cn/sqx_fast/"; //后台服务域名
const ROOTPATH2 = "https://dj-h5.hnsiyao.cn"; //后台服务域名 // const ROOTPATH2 = "https://dj-h5.hnsiyao.cn"; //后台服务域名
// const ROOTPATH1 = "https://video.hnsiyao.cn/sqx_fast/"; // const ROOTPATH1 = "https://video.hnsiyao.cn/sqx_fast/"; //
// const ROOTPATH = "https://video.hnsiyao.cn/sqx_fast/"; //后台服务域名 const ROOTPATH = "https://video.hnsiyao.cn/sqx_fast/"; //后台服务域名
// const ROOTPATH2 = "https://video-h5.hnsiyao.cn"; //后台服务域名 const ROOTPATH2 = "https://video-h5.hnsiyao.cn"; //后台服务域名
// const ROOTPATH1 = "http://192.168.1.5:8100/sqx_fast/"; // // const ROOTPATH1 = "http://192.168.1.5:8100/sqx_fast/"; //
// const ROOTPATH = "http://192.168.1.5:8100/sqx_fast/"; //后台服务域名 // const ROOTPATH = "http://192.168.1.5:8100/sqx_fast/"; //后台服务域名

View File

@@ -2,15 +2,15 @@
<view class=""> <view class="">
<u-sticky :enable="enableIos"> <u-sticky :enable="enableIos">
<view class="search-box-ios"> <view class="search-box-ios">
<u-search bg-color="#f2f2f2" style="width: 100%;" placeholder="搜索更多资源" v-model="keyword" <u-search bg-color="#f2f2f2" style="width: 100%;" placeholder="搜索更多资源" v-model="keywordIos"
:show-action="false" :animation="true" @search="getCourseList()"></u-search> :show-action="false" :animation="true" @search="getCourseListIos()"></u-search>
</view> </view>
</u-sticky> </u-sticky>
<view class="swiper flex align-center justify-center"> <view class="swiper flex align-center justify-center">
<view class="swiper-box"> <view class="swiper-box">
<swiper :indicator-dots="true" class="swiper " :autoplay="true" interval="5000" duration="500" <swiper :indicator-dots="true" class="swiper " :autoplay="true" interval="5000" duration="500"
:circular="true" style="width: 100%;height: 350rpx;"> :circular="true" style="width: 100%;height: 350rpx;">
<swiper-item v-for="(item,index) in swiperListIos" :key='index' @tap="goPage(item.url)"> <swiper-item v-for="(item,index) in swiperListIos" :key='index' @tap="goPageIos(item.url)">
<image :src="item.imageUrl" mode="scaleToFill" <image :src="item.imageUrl" mode="scaleToFill"
style="width: 100%;height: 100%;border-radius: 24rpx;"></image> style="width: 100%;height: 100%;border-radius: 24rpx;"></image>
</swiper-item> </swiper-item>
@@ -19,7 +19,7 @@
</view> </view>
<view class="padding-lr"> <view class="padding-lr">
<view class="" v-if="courseListIos.length"> <view class="" v-if="courseListIos.length">
<videoList @success="posterSuccess" :list="courseListIos" /> <videoList @success="posterSuccessIos" :list="courseListIos" />
</view> </view>
<empty title="暂无视频" :isShow='false' v-else></empty> <empty title="暂无视频" :isShow='false' v-else></empty>
<u-loadmore v-if="courseListIos.length > 0" :status="statusIos" /> <u-loadmore v-if="courseListIos.length > 0" :status="statusIos" />
@@ -44,16 +44,16 @@
courseListIos: [], //资源列表 courseListIos: [], //资源列表
pageIos: 1, pageIos: 1,
limitIos: 10, limitIos: 10,
pagesIos: 0,
sortIos: '', sortIos: '',
count: 0, keywordIos: '',
keyword: '', isPriceIos: '', //是否免费 2:免费
isPrice: '', //是否免费 2:免费
} }
}, },
onShow() { onShow() {
this.enableIos = true this.enableIos = true
this.getCourseList() this.getCourseListIos()
}, },
onHide() { onHide() {
this.enableIos = false this.enableIos = false
@@ -62,34 +62,34 @@
uni.setNavigationBarTitle({ uni.setNavigationBarTitle({
title: option.title title: option.title
}) })
this.getBannerList() this.getBannerListIos()
if (option.sort) { if (option.sort) {
this.sortIos = option.sort this.sortIos = option.sort
} }
if (option.isPrice) { if (option.isPrice) {
this.isPrice = option.isPrice this.isPriceIos = option.isPrice
} }
}, },
methods: { methods: {
goPage(url) { goPageIos(url) {
uni.navigateTo({ uni.navigateTo({
url: url url: url
}) })
}, },
//点击回调 //点击回调
posterSuccess(item) { posterSuccessIos(item) {
uni.navigateTo({ uni.navigateTo({
url: '/me/detail/detail?id=' + item.courseId + '&courseDetailsId=' + item.courseDetailsId url: '/me/detail/detail?id=' + item.courseId + '&courseDetailsId=' + item.courseDetailsId
}) })
}, },
//最新热播 //最新热播
getCourseList() { getCourseListIos() {
let data = { let data = {
limit: this.limitIos, limit: this.limitIos,
page: this.pageIos, page: this.pageIos,
sort: this.sortIos ? this.sortIos : '', sort: this.sortIos ? this.sortIos : '',
title: this.keyword, title: this.keywordIos,
} }
// #ifdef MP-WEIXIN // #ifdef MP-WEIXIN
data.wxShow = 1 data.wxShow = 1
@@ -97,13 +97,13 @@
// #ifdef MP-TOUTIAO // #ifdef MP-TOUTIAO
data.dyShow = 1 data.dyShow = 1
// #endif // #endif
if (this.isPrice) { if (this.isPriceIos) {
data.isPrice = this.isPrice data.isPrice = this.isPriceIos
} }
this.$u.api.courseList(data).then(res => { this.$u.api.courseList(data).then(res => {
if (res.code == 0) { if (res.code == 0) {
this.pages = res.data.totalPage this.pagesIos = res.data.totalPage
if (this.pageIos < this.pages) { if (this.pageIos < this.pagesIos) {
this.statusIos = 'loadmore' this.statusIos = 'loadmore'
} else { } else {
this.statusIos = 'nomore' this.statusIos = 'nomore'
@@ -128,7 +128,7 @@
}) })
}, },
// 获取轮播图列表 // 获取轮播图列表
getBannerList() { getBannerListIos() {
this.$u.api.bannerList({ this.$u.api.bannerList({
classify: '1' classify: '1'
}).then(res => { }).then(res => {
@@ -151,10 +151,10 @@
}, },
onReachBottom: function() { onReachBottom: function() {
if (this.pageIos < this.pages) { if (this.pageIos < this.pagesIos) {
this.pageIos += 1 this.pageIos += 1
this.statusIos = 'loading' this.statusIos = 'loading'
this.getCourseList() this.getCourseListIos()
} else { } else {
this.statusIos = 'nomore' this.statusIos = 'nomore'
@@ -163,7 +163,7 @@
}, },
onPullDownRefresh: function() { onPullDownRefresh: function() {
this.pageIos = 1; this.pageIos = 1;
this.getCourseList() this.getCourseListIos()
}, },
} }
</script> </script>

View File

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