Commit 752be9a3 by kyle

购买课程

parent 683ab072
...@@ -152,5 +152,13 @@ export default { ...@@ -152,5 +152,13 @@ export default {
// 个人信息查询 // 个人信息查询
queryInfo(params){ queryInfo(params){
return request(`${cffpURL}/user/queryInfo`, "POST", params) return request(`${cffpURL}/user/queryInfo`, "POST", params)
},
// 微信支付
wxAppPay(params){
return request(`${apiURL}/pay/wxAppPay`, "POST", params)
},
// 订单保存
saveOrder(params){
return request(`${cffpURL}/order/saveOrder`, "POST", params)
} }
} }
...@@ -19,27 +19,32 @@ ...@@ -19,27 +19,32 @@
/* 模块配置 */ /* 模块配置 */
"modules" : { "modules" : {
"Share" : {}, "Share" : {},
"Payment" : {} "Payment" : {},
"VideoPlayer" : {}
}, },
/* 应用发布信息 */ /* 应用发布信息 */
"distribute" : { "distribute" : {
/* android打包配置 */ /* android打包配置 */
"android" : { "android" : {
"permissions" : [ "permissions" : [
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>", "<uses-feature android:name=\"android.hardware.camera\"/>",
"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
"<uses-permission android:name=\"android.permission.VIBRATE\"/>",
"<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
"<uses-feature android:name=\"android.hardware.camera.autofocus\"/>", "<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_COARSE_LOCATION\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>", "<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
"<uses-permission android:name=\"android.permission.CAMERA\"/>", "<uses-permission android:name=\"android.permission.CAMERA\"/>",
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
"<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
"<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>", "<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>",
"<uses-permission android:name=\"android.permission.INTERNET\"/>",
"<uses-permission android:name=\"android.permission.MODIFY_AUDIO_SETTINGS\"/>",
"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
"<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
"<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>", "<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
"<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>", "<uses-permission android:name=\"android.permission.VIBRATE\"/>",
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>", "<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
"<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>", "<uses-permission android:name=\"android.permission.WRITE_EXTERNAL_STORAGE\"/>",
"<uses-feature android:name=\"android.hardware.camera\"/>",
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>" "<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
], ],
"minSdkVersion" : 21 "minSdkVersion" : 21
...@@ -50,7 +55,12 @@ ...@@ -50,7 +55,12 @@
}, },
/* SDK配置 */ /* SDK配置 */
"sdkConfigs" : { "sdkConfigs" : {
"share" : {}, "share" : {
"weixin" : {
"appid" : "wxec09b9be6cff4eb3",
"UniversalLinks" : ""
}
},
"ad" : {}, "ad" : {},
"payment" : { "payment" : {
"alipay" : { "alipay" : {
...@@ -61,7 +71,8 @@ ...@@ -61,7 +71,8 @@
"appid" : "wxec09b9be6cff4eb3", "appid" : "wxec09b9be6cff4eb3",
"UniversalLinks" : "" "UniversalLinks" : ""
} }
} },
"oauth" : {}
}, },
"splashscreen" : { "splashscreen" : {
"androidStyle" : "default", "androidStyle" : "default",
......
<template> <template>
<view class="container"> <view class="container">
<view class="certifyIntro"> <view class="certifyIntro" v-html="certificateInfo.cerIntroduce"></view>
{{certificateInfo.cerIntroduce}}
</view>
<view class="certifySignInfo"> <view class="certifySignInfo">
<view class="ulBox"> <view class="ulBox">
<view class="liBox"><text>报名时间:</text><text>{{certificateInfo.startDate}} - {{certificateInfo.endDate}}</text></view> <view class="liBox"><text>报名时间:</text><text>{{dateFormat(certificateInfo.startDate)}} - {{dateFormat(certificateInfo.endDate)}}</text></view>
<view class="liBox"><text>考试费用:</text><text>{{certificateInfo.examinationPrice}}</text></view> <view class="liBox"><text>考试费用:</text><text style="color: #F15A1F;">{{certificateInfo.examinationPrice}}</text></view>
<view class="liBox"><text>培训费用:</text><text>{{certificateInfo.trainPrice}}</text></view> <view class="liBox"><text>培训费用:</text><text style="color: #F15A1F;">{{certificateInfo.trainPrice}}</text></view>
<view class="liBox"><text>培训课程:</text><text>{{certificateInfo.courseName}}</text></view> <view class="liBox"><text>培训课程:</text><text>{{certificateInfo.courseName}}</text></view>
<view class="liBox"><text>培训方式:</text><text>{{certificateInfo.trainType == 1 ? '线上培训' : '/'}}</text></view> <view class="liBox"><text>培训方式:</text><text>{{certificateInfo.trainType == 1 ? '线上培训' : '/'}}</text></view>
<view class="liBox"><text>考试方式:</text><text>{{certificateInfo.examinationType == 1 ? '线上考试' : '/'}}</text></view> <view class="liBox"><text>考试方式:</text><text>{{certificateInfo.examinationType == 1 ? '线上考试' : '/'}}</text></view>
...@@ -26,14 +24,7 @@ ...@@ -26,14 +24,7 @@
<!-- 考试计划 --> <!-- 考试计划 -->
<view class="examPlanning"> <view class="examPlanning">
<h3>考试计划</h3> <h3>考试计划</h3>
<view class="content"> <view class="content" v-html="certificateInfo.examPlan"></view>
<h4>Ⅰ.考核类型</h4>
<view>理论考试:客观+主观题</view>
<h4>Ⅱ.考试内容</h4>
<view>考核内容包括:保险,财会,基金,信托</view>
<h4>Ⅲ.得分说明</h4>
<view>总分:客观题得分+主观题得分</view>
</view>
</view> </view>
<!-- 考试认证流程 --> <!-- 考试认证流程 -->
<view class="examProcessContainer"> <view class="examProcessContainer">
...@@ -87,6 +78,7 @@ ...@@ -87,6 +78,7 @@
<script> <script>
import api from "@/api/api"; import api from "@/api/api";
import dataHandling from "@/util/dataHandling";
export default { export default {
data() { data() {
return { return {
...@@ -105,7 +97,7 @@ ...@@ -105,7 +97,7 @@
api.queryCertificateInfo(params).then(res=>{ api.queryCertificateInfo(params).then(res=>{
console.log(res) console.log(res)
if(res['success']){ if(res['success']){
this.certificateInfo = res['data']; this.certificateInfo = res['data']['certificateInfo'];
} }
}) })
}, },
...@@ -113,6 +105,9 @@ ...@@ -113,6 +105,9 @@
uni.navigateTo({ uni.navigateTo({
url: '/pages/orderConfirm/orderConfirm' url: '/pages/orderConfirm/orderConfirm'
}); });
},
dateFormat(val){
return dataHandling.dateFormat(val,'yyyy-MM-dd')
} }
} }
} }
...@@ -157,11 +152,23 @@ ...@@ -157,11 +152,23 @@
} }
} }
.eqrocdeContent{
display: flex;
flex-direction: column;
align-items: center;
image{
width: 40% !important;
}
}
.certifyImgBox{ .certifyImgBox{
h3{ h3{
font-size: 32rpx; font-size: 32rpx;
margin-bottom: 30rpx; margin-bottom: 30rpx;
} }
image{
width: 70% !important;
transform: translateX(20%);
}
} }
.examProcessContainer{ .examProcessContainer{
h3{ h3{
......
<template> <template>
<view class="container"> <view class="container">
<!-- 课程banner图 --> <!-- 课程banner图 -->
<view class="courseBannerBox"></view> <view class="courseBannerBox">
<video :src="courseInfo.filePathOss" :initial-time="0" duration="180" object-fit="contain" class="videoBox" :poster="courseInfo.fileFirstImage" :title="courseInfo.fileTitle"></video>
</view>
<!-- 课程详情图 --> <!-- 课程详情图 -->
<view class="courseTitleContent"> <view class="courseTitleContent">
<view class="courseTitle"> <view class="courseTitle">
...@@ -28,10 +30,10 @@ ...@@ -28,10 +30,10 @@
<view class="tabContent"> <view class="tabContent">
<!-- 课程介绍 --> <!-- 课程介绍 -->
<view class="courseIntroContent" v-if="tabType===1"> <view class="courseIntroContent" v-if="tabType===1">
<view v-html="courseInfo?.fileIntroduce" class="richTextContent"></view> <view v-html="courseInfo.fileIntroduce" class="richTextContent"></view>
</view> </view>
<!-- 相关课程列表 --> <!-- 相关课程列表 -->
<view class="relationCourseListsContent" v-if="tabType===2"> <view class="relationCourseListsContent" v-show="tabType===2">
<view class="totalCourseCount">{{relatedCoursesLists ? relatedCoursesLists.length : 0}}</view> <view class="totalCourseCount">{{relatedCoursesLists ? relatedCoursesLists.length : 0}}</view>
<view class="courseItemContent" v-for="(item,index) in relatedCoursesLists" :key="item.fileId"> <view class="courseItemContent" v-for="(item,index) in relatedCoursesLists" :key="item.fileId">
<view class="courseInfoContent"> <view class="courseInfoContent">
...@@ -41,7 +43,7 @@ ...@@ -41,7 +43,7 @@
</view> </view>
</view> </view>
<view class="statusBtnContent"> <view class="statusBtnContent">
试听 <text>{{courseInfo.status === 1 ? '' : '播放'}}</text>
</view> </view>
</view> </view>
</view> </view>
...@@ -49,7 +51,7 @@ ...@@ -49,7 +51,7 @@
<view class="lecturerContent" v-if="tabType===3"> <view class="lecturerContent" v-if="tabType===3">
<view class="lecturerIntro"> <view class="lecturerIntro">
<view class="lecturerUrl"> <view class="lecturerUrl">
<!-- <img :src="{{lecturerInfo.lecturerUrl}}" alt="" srcset=""> --> <image :src="lecturerInfo.lecturerUrl"></image>
</view> </view>
<view> <view>
<p><text class="lecturerName">{{lecturerInfo.lecturerName}}</text></p> <p><text class="lecturerName">{{lecturerInfo.lecturerName}}</text></p>
...@@ -64,7 +66,7 @@ ...@@ -64,7 +66,7 @@
<view v-html="lecturerInfo?.lecturerIntroduce" class="lecturerText richTextContent"></view> <view v-html="lecturerInfo?.lecturerIntroduce" class="lecturerText richTextContent"></view>
</view> </view>
<!-- 购买按钮 --> <!-- 购买按钮 -->
<view class="buyBox" @click="buy()"> <view class="buyBox" @click="saveOrder()">
<text>购买</text> <text>购买</text>
</view> </view>
</view> </view>
...@@ -82,10 +84,43 @@ ...@@ -82,10 +84,43 @@
lecturerId:null, lecturerId:null,
tabType:3, tabType:3,
lecturerInfo:{}, lecturerInfo:{},
courseInfo:{} courseInfo:{},
relatedCoursesLists:[],
orderId:'',
userId:'1',
shareUserId:'',
shareCode:'',
shareReadId:'',
dataSource:'1'
}; };
}, },
methods:{ methods:{
// 订单保存
saveOrder(){
const param = {
productType:this.courseInfo.fileType,
productId:this.courseInfo.fileId,
userId:this.userId,
shareUserId:this.shareUserId,
shareReadId:this.shareReadId,
shareCode:this.shareCode,
dataSource:this.dataSource
}
api.saveOrder(param).then(res=>{
if(res['success']){
this.orderId = res['data']['id'];
uni.navigateTo({
url:`/pages/orderConfirm/orderConfirm?fileId=${this.fileId}&orderId=${this.orderId}`
})
}else{
uni.showToast({
title: res['message'],
duration: 2000
});
return;
}
})
},
// 切换tab // 切换tab
switchTab(type) { switchTab(type) {
this.tabType = type; this.tabType = type;
...@@ -129,18 +164,13 @@ ...@@ -129,18 +164,13 @@
console.log('相关课程详情',res); console.log('相关课程详情',res);
if(res['success']){ if(res['success']){
this.relatedCoursesLists = res['data']['data']; this.relatedCoursesLists = res['data']['data'];
console.log(this.relatedCoursesLists)
} }
}) })
}, },
// 秒转时分秒格式 // 秒转时分秒格式
secondsTransferPipe(value){ secondsTransferPipe(value){
return dataHandling.secondsTransferPipe(value) return dataHandling.secondsTransferPipe(value)
},
// 购买
buy(){
uni.navigateTo({
url:`/pages/orderConfirm/orderConfirm?fileId=${this.fileId}`
})
} }
...@@ -150,7 +180,6 @@ ...@@ -150,7 +180,6 @@
}, },
onLoad(option){ onLoad(option){
this.fileId = option.fileId; this.fileId = option.fileId;
this.courseDetail();
} }
} }
</script> </script>
...@@ -159,6 +188,12 @@ ...@@ -159,6 +188,12 @@
.courseBannerBox{ .courseBannerBox{
height: 300rpx; height: 300rpx;
background-color: #ebebeb; background-color: #ebebeb;
display: flex;
justify-content: center;
.videoBox{
max-width: 100%;
height: 100%;
}
} }
.courseTitleContent{ .courseTitleContent{
height: 150rpx; height: 150rpx;
......
<template> <template>
<view> <view>
<h4 v-if="cffpCourseInfos.length<=0" class="noListTip">暂无课程列表</h4> <h4 v-if="cffpCourseInfos.length<=0" class="noListTip">暂无课程列表</h4>
<ul v-if="cffpCourseInfos.length>0"> <view class="ulBox" v-if="cffpCourseInfos.length>0">
<li v-for="item in cffpCourseInfos" :key="item.fileId" @click="goDetail(item)"> <view class="liBox" v-for="item in cffpCourseInfos" :key="item.fileId" @click="goDetail(item)">
<course-item :thumbnailPath="item.displayImage" :title="item.fileTitle" :summaryBox="item.fileSynopsis" :dataList="{coursePrice:item.coursePrice,salesNumber:item.salesNumber}" :tagList="{v1:item.fileLecturerRanks,v2:item.fileLecturerName}"></course-item> <course-item :thumbnailPath="item.displayImage" :title="item.fileTitle" :summaryBox="item.fileSynopsis" :dataList="{coursePrice:item.coursePrice,salesNumber:item.salesNumber}" :tagList="{v1:item.fileLecturerRanks,v2:item.fileLecturerName}"></course-item>
</li> </view>
</ul> </view>
</view> </view>
</template> </template>
...@@ -25,7 +25,6 @@ ...@@ -25,7 +25,6 @@
courseItem courseItem
}, },
onLoad(){ onLoad(){
this.courseList();
}, },
methods:{ methods:{
goDetail(item){ goDetail(item){
...@@ -61,16 +60,14 @@ ...@@ -61,16 +60,14 @@
</script> </script>
<style lang="scss"> <style lang="scss">
ul,li{ .ulBox,.liBox{
list-style: none;
margin: 0;
padding: 0;
display: flex; display: flex;
} }
ul{ .ulBox{
flex-direction: column; flex-direction: column;
} }
li{ .liBox{
background-color: #fff; background-color: #fff;
border-radius: 20rpx; border-radius: 20rpx;
margin-bottom: 10rpx; margin-bottom: 10rpx;
......
...@@ -184,7 +184,7 @@ ...@@ -184,7 +184,7 @@
bottom: 0; bottom: 0;
left: 0; left: 0;
right: 0; right: 0;
margin: 0 auto; margin: 30% auto;
width: 60%; width: 60%;
border-radius: 80rpx; border-radius: 80rpx;
background-color: #20269B; background-color: #20269B;
......
...@@ -2,7 +2,9 @@ ...@@ -2,7 +2,9 @@
<view class="container"> <view class="container">
<!-- 课程详情 --> <!-- 课程详情 -->
<template v-if="courseInfoItem"> <template v-if="courseInfoItem">
<view class="courseItemBox">
<course-item :thumbnailPath="courseInfoItem.displayImage" :title="courseInfoItem.fileTitle" :summaryBox="courseInfoItem.fileSynopsis" :dataList="{coursePrice:courseInfoItem.coursePrice,salesNumber:courseInfoItem.salesNumber}" :tagList="{v1:courseInfoItem.fileLecturerRanks,v2:courseInfoItem.fileLecturerName}"></course-item> <course-item :thumbnailPath="courseInfoItem.displayImage" :title="courseInfoItem.fileTitle" :summaryBox="courseInfoItem.fileSynopsis" :dataList="{coursePrice:courseInfoItem.coursePrice,salesNumber:courseInfoItem.salesNumber}" :tagList="{v1:courseInfoItem.fileLecturerRanks,v2:courseInfoItem.fileLecturerName}"></course-item>
</view>
</template> </template>
<!-- 价格明细 --> <!-- 价格明细 -->
<view class="priceInfoContent"> <view class="priceInfoContent">
...@@ -10,9 +12,9 @@ ...@@ -10,9 +12,9 @@
<view><text>现价</text><text>¥{{courseInfoItem.coursePrice}}</text></view> <view><text>现价</text><text>¥{{courseInfoItem.coursePrice}}</text></view>
<view> <view>
<text @click="toggle(1,'bottom')">积分抵扣<i class="iconfont icon-31tishi"></i></text> <text @click="toggle(1,'bottom')">积分抵扣<i class="iconfont icon-31tishi"></i></text>
<text class="integralBox" @click="toggle(2,'bottom')">未选积分,可抵扣XXX<i class="iconfont icon-youjiantou"></i></text> <text class="integralBox" @click="toggle(2,'bottom')">未选积分,可抵扣{{deductionCore}}<i class="iconfont icon-youjiantou"></i></text>
</view> </view>
<view><text>合计</text><text>¥{{courseInfoItem.coursePrice}}</text></view> <view><text>合计</text><text>¥{{totalPrice}}</text></view>
</view> </view>
<!-- 支付方式 --> <!-- 支付方式 -->
<view class="paymentMethodContent"> <view class="paymentMethodContent">
...@@ -40,10 +42,10 @@ ...@@ -40,10 +42,10 @@
<!-- 底部 --> <!-- 底部 -->
<view class="totalContent"> <view class="totalContent">
<view class="priceInfoBox"> <view class="priceInfoBox">
<view>合计: <strong style="font-size: 36rpx;">¥{{courseInfoItem.coursePrice}}</strong></view> <view>合计: <strong style="font-size: 36rpx;">¥{{totalPrice}}</strong></view>
<view>共优惠:<strong style="color:#F15A1F">¥{{courseInfoItem.coursePrice}}</strong> </view> <view>共优惠:<strong style="color:#F15A1F">¥{{deductionCore * intergralInfo.preFortune }}</strong> </view>
</view> </view>
<view class="confirmOrder">提交订单</view> <view class="confirmOrder" @click="pay()">提交订单</view>
</view> </view>
<!-- 普通弹窗 --> <!-- 普通弹窗 -->
<uni-popup ref="popup" background-color="#fff"> <uni-popup ref="popup" background-color="#fff">
...@@ -59,8 +61,8 @@ ...@@ -59,8 +61,8 @@
<view style="display: flex;"> <view style="display: flex;">
<text>可抵扣</text> <text>可抵扣</text>
<view class="integralInfoBox"> <view class="integralInfoBox">
<text class="deductionCount">500</text> <text class="deductionCount">{{deductionCore * intergralInfo.preFortune}}</text>
<text>5000积分兑换</text> <text>{{deductionCore}}积分兑换</text>
</view> </view>
</view> </view>
<view class="selectRadio"> <view class="selectRadio">
...@@ -87,20 +89,20 @@ ...@@ -87,20 +89,20 @@
<view class="title"> <view class="title">
<text></text> <text></text>
<h3>{{popupTitle}}</h3> <h3>{{popupTitle}}</h3>
<i class="iconfont icon-guanbi" @click="closePopup(1)"></i> <i class="iconfont icon-guanbi" @click="closePopup(2)"></i>
</view> </view>
<view class="integralDeductionContent"> <view class="integralDeductionContent">
<view class="intergralItem"> <view class="intergralItem">
<text>可兑换积分:</text> <text>可兑换积分:</text>
<text>XXX积分</text> <text>{{intergralInfo.yesExchangeFortune}}积分</text>
</view> </view>
<view class="intergralItem"> <view class="intergralItem">
<text>本次兑换消耗积分:</text> <text>本次兑换消耗积分:</text>
<text>XXX积分</text> <text>{{deductionCore}}积分</text>
</view> </view>
<view class="intergralItem"> <view class="intergralItem">
<text>剩余可兑换积分:</text> <text>剩余可兑换积分:</text>
<text>XXX积分</text> <text>{{intergralInfo.yesExchangeFortune - deductionCore}}积分</text>
</view> </view>
<view class="confirmBtn" @click="closePopup(2)"> <view class="confirmBtn" @click="closePopup(2)">
确认兑换 确认兑换
...@@ -126,10 +128,52 @@ ...@@ -126,10 +128,52 @@
paymentMethod:1, paymentMethod:1,
popupTitle:'积分抵扣规则', popupTitle:'积分抵扣规则',
popupType:1, popupType:1,
isDeduction:true isDeduction:true,
userId:'1',
intergralInfo:{},
orderId:'1'
}
},
computed:{
totalPrice(){
if(this.isDeduction){
return this.courseInfoItem.coursePrice - this.deductionCore * this.intergralInfo.preFortune
}else{
return this.courseInfoItem.coursePrice;
}
},
deductionCore(){
if(this.courseInfoItem.coursePrice / this.intergralInfo.preFortune < this.intergralInfo.yesExchangeFortune){
return (this.courseInfoItem.coursePrice / this.intergralInfo.preFortune).toFixed(2)
}else{
return this.intergralInfo.yesExchangeFortune
}
} }
}, },
methods: { methods: {
// 支付
pay(){
if(this.paymentMethod===1){
const param = {
orderId:this.orderId,
amount:this.totalPrice,
paymentMethod:this.paymentMethod,
userId:this.userId
}
api.wxAppPay(param).then(res=>{
console.log(res)
})
}
},
// 积分查询
queryByUserIdFortuneStatistic(){
api.queryByUserIdFortuneStatistic({userId:this.userId}).then(res=>{
if(res['success']){
this.intergralInfo = res['data'];
this.intergralInfo.preFortune = 1.0;
}
})
},
// 课程详情页面 // 课程详情页面
courseDetail(){ courseDetail(){
api.courseDetail({fileId:this.fileId,userId:1}).then(res=>{ api.courseDetail({fileId:this.fileId,userId:1}).then(res=>{
...@@ -149,7 +193,9 @@ ...@@ -149,7 +193,9 @@
this.popupType = val; this.popupType = val;
// open 方法传入参数 等同在 uni-popup 组件上绑定 type属性 // open 方法传入参数 等同在 uni-popup 组件上绑定 type属性
if(this.popupType===3){ if(this.popupType===3){
if(this.isDeduction){
this.$refs.popup1.open(type); this.$refs.popup1.open(type);
}
}else{ }else{
this.$refs.popup.open(type); this.$refs.popup.open(type);
} }
...@@ -181,10 +227,12 @@ ...@@ -181,10 +227,12 @@
onLoad(option){ onLoad(option){
console.log(option) console.log(option)
this.fileId = option.fileId; this.fileId = option.fileId;
this.orderId = option.orderId;
}, },
mounted() { mounted() {
this.courseDetail(); this.courseDetail();
this.queryByUserIdFortuneStatistic()
} }
} }
</script> </script>
...@@ -193,6 +241,10 @@ ...@@ -193,6 +241,10 @@
.container{ .container{
position: relative; position: relative;
height: 100%; height: 100%;
.courseItemBox{
padding: 20rpx 30rpx;
background-color: #fff;
}
.popup-content{ .popup-content{
.title{ .title{
display: flex; display: flex;
......
...@@ -120,7 +120,7 @@ ...@@ -120,7 +120,7 @@
{title:'我的邀请码',icon:'shareEcode',link:'',isOpen:true,isShow:true}, {title:'我的邀请码',icon:'shareEcode',link:'',isOpen:true,isShow:true},
{title:'我的卡包',icon:'card',link:'',isOpen:true,isShow:false}, {title:'我的卡包',icon:'card',link:'',isOpen:true,isShow:false},
{title:'我的认证',icon:'myCertify',link:'/pages/myCertify/myCertify',isOpen:true,isShow:true}, {title:'我的认证',icon:'myCertify',link:'/pages/myCertify/myCertify',isOpen:true,isShow:true},
{title:'申请修改公司周边',icon:'message',link:'',isOpen:true,isShow:true}, {title:'申请修改公司周边',icon:'setting',link:'',isOpen:true,isShow:true},
{title:'我的消息',icon:'message',link:'/pages/systemMsg/system_msg',isOpen:true,isShow:true}, {title:'我的消息',icon:'message',link:'/pages/systemMsg/system_msg',isOpen:true,isShow:true},
{title:'系统设置',icon:'setting',link:'',isOpen:true,isShow:false} {title:'系统设置',icon:'setting',link:'',isOpen:true,isShow:false}
] ]
......
...@@ -33,10 +33,22 @@ export default{ ...@@ -33,10 +33,22 @@ export default{
return h + ':' + m + ':' + s; return h + ':' + m + ':' + s;
}, },
// 日期格式化 // 日期格式化
dateFormat(val:number){ dateFormat(val:number,format='yyyy-MM-dd hh:mm:ss'){
if(val){ if(val){
const date = new Date(val); const date = new Date(val);
return date.getFullYear() + '-' + (date.getMonth() + 1) + '-' + date.getDate() + ' ' + date.getHours() + ':' + date.getMinutes() + ':' + date.getSeconds() const year = date.getFullYear();
const month = (date.getMonth() + 1) <10 ? '0' + (date.getMonth() + 1) : (date.getMonth() + 1);
const day = date.getDate() < 10 ? '0' + date.getDate() : date.getDate();
const hours = date.getHours() < 10 ? '0' + date.getHours() : date.getHours();
const minutes = date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes();
const seconds = date.getSeconds() < 10 ? '0' + date.getSeconds() : date.getSeconds();
if(format === 'yyyy-MM-dd'){
return year + '-' + month + '-' + day
}else if(format === 'yyyy-MM-dd hh:mm:ss'){
return year + '-' + month + '-' + day + ' ' + hours + ':' + minutes+ ':' + seconds
}
}else { }else {
return val; return val;
} }
......
...@@ -9,9 +9,9 @@ export const interceptor = () => { ...@@ -9,9 +9,9 @@ export const interceptor = () => {
invoke(args) { invoke(args) {
// console.log('请求拦截器',args); // console.log('请求拦截器',args);
// 加载loading // 加载loading
uni.showLoading({ // uni.showLoading({
title: '加载中...' // title: '加载中...'
}); // });
// 当本地没有token,并且接口地址没在白名单内,需要重新获取token // 当本地没有token,并且接口地址没在白名单内,需要重新获取token
if (!uni.getStorageSync('uni-token') && !whiteApiList.includes(args.url)) { if (!uni.getStorageSync('uni-token') && !whiteApiList.includes(args.url)) {
...@@ -27,7 +27,7 @@ export const interceptor = () => { ...@@ -27,7 +27,7 @@ export const interceptor = () => {
// console.log(res) // console.log(res)
} }
}) })
uni.hideLoading(); // uni.hideLoading();
} }
// request 触发前拼接 url // request 触发前拼接 url
...@@ -41,16 +41,16 @@ export const interceptor = () => { ...@@ -41,16 +41,16 @@ export const interceptor = () => {
// 响应拦截器,可以对数据进行预处理 // 响应拦截器,可以对数据进行预处理
success() { success() {
uni.hideLoading() // uni.hideLoading()
// console.log(args); // console.log(args);
}, },
fail() { fail() {
// console.log('interceptor-fail', err) // console.log('interceptor-fail', err)
// console.log('请求失败') // console.log('请求失败')
uni.hideLoading() // uni.hideLoading()
}, },
complete() { complete() {
uni.hideLoading() // uni.hideLoading()
} }
}) })
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment