Commit 9d159137 by sunchao

Merge branch 'dev' of http://139.224.139.2:9091/chaosun/CFFP into dev

parents 300b5e3a 75360b47
import request from "../util/request";
import {baseURL,apiURL,cffpURL} from "../environments/environment";
export default {
//查看token是否已经失效
checkToken(){
const params = {
token:uni.getStorageSync('uni-token'),
ticket:'uni-app'
}
return request(`${baseURL}/api/authorize/checkToken`, "POST", params)
},
// 获取token
obtainToken(){
const params = {
ticket:'uni-app'
}
return request(`${baseURL}/api/authorize/obtainToken`, "POST", params)
},
//获取验证码
verificationCode(params){
return request(`${baseURL}/api/verificationCode`, "POST", params)
},
//登录接口
loginVerification(params){
return request(`${cffpURL}/user/loginVerification`, "POST", params)
},
//注册接口
register(params){
return request(`${cffpURL}/user/register`, "POST", params)
},
//重置密码
resetPassword(params){
return request(`${cffpURL}/user/resetPassword`, "POST", params)
},
// 课程查询列表接口
courseList(params){
return request(`${cffpURL}/course/list`,"POST",params)
},
// 讲师信息查询
lecturerQuery(params){
return request(`${apiURL}/college/lecturerQuery`, "POST", params)
},
//账户信息获取
queryAreaCenterInfo(params){
return request(`${cffpURL}/areaCenter/queryAreaCenterInfo`, "POST", params)
},
//公告列表
announcementQuery(params){
return request(`${apiURL}/market/announcementQuery`, "POST", params)
},
//消息列表
querySystemMessage(params){
return request(`${apiURL}/systemMessage/querySystemMessage`, "POST", params)
},
//清除站内消息
oneKeyRead(params){
return request(`${apiURL}/systemMessage/oneKeyRead`, "POST", params)
},
//消息详情&单个阅读
querySystemMessageDetail(params){
return request(`${apiURL}/systemMessage/querySystemMessageDetail`, "POST", params)
},
// 学习认证列表
querySignupList(params){
return request(`${cffpURL}/certificate/querySignupList`, "POST", params)
},
// 个人认证列表
userCertificateList(params){
return request(`${cffpURL}/certificate/userCertificateList`, "POST", params)
},
// 认证详情
queryCertificateInfo(params){
return request(`${cffpURL}/certificate/queryCertificateInfo`, "POST", params)
},
// 课程详情
courseDetail(params){
return request(`${cffpURL}/course/detail`, "POST", params)
},
// 相关课程黎贝澳查询
relatedCoursesList(params){
return request(`${cffpURL}/course/relatedCoursesList`, "POST", params)
},
//邀请加盟与申请加盟保存接口
saveApplyInfo(params){
return request(`${cffpURL}/partner/saveApplyInfo`, "POST", params)
},
// 查询所属组织List
queryOrgList(params){
return request(`${cffpURL}/orgInfo/queryOrgList`, "POST", params)
},
//学习认证列表
queryCertificateList(params){
return request(`${cffpURL}/certificate/queryCertificateList`, "POST", params)
},
//学习认证结果
userCertificateResult(params){
return request(`${cffpURL}/certificate/userCertificateList`, "POST", params)
},
// 我的学习,学习记录
userStudyList(params){
return request(`${cffpURL}/study/userStudyList`, "POST", params)
},
// 我的分享
userShareQuery(params){
return request(`${cffpURL}/share/userShareQuery`, "POST", params)
},
// 订单详情
userCourseInfo(params){
return request(`${cffpURL}/course/userCourseInfo`, "POST", params)
},
//我的积分查询接口
findByUserIdForFortuneStatistic(params){
return request(`${apiURL}/fortune/findByUserIdForFortuneStatistic`, "POST", params)
},
//我的积分明细
findForExchangeStatisticDtl(params){
return request(`${apiURL}/fortune/findForExchangeStatisticDtl`, "POST", params)
},
//分类查询
dropOptionsQuery(params){
return request(`${apiURL}/metadata/dropOptionsQuery`, "POST", params)
},
// 销售课程统计
userCourseCount(params){
return request(`${cffpURL}/course/userCourseCount`, "POST", params)
},
// 销售课程列表查询
userCourseList(params){
return request(`${cffpURL}/course/userCourseList`, "POST", params)
},
// 分享课程列表查询
userShareCourseList(params){
return request(`${cffpURL}/course/userShareCourseList`, "POST", params)
},
//积分兑换查询
queryByUserIdFortuneStatistic(params){
return request(`${apiURL}/fortune/queryByUserIdFortuneStatistic`, "POST", params)
},
//积分兑换记录查询
findByUserIdForWithdralHis(params){
return request(`${apiURL}/fortune/findByUserIdForWithdralHis`, "POST", params)
},
//提现明细接口
findByUserIdForWithdralDtl(params){
return request(`${apiURL}/fortune/findByUserIdForWithdralDtl`, "POST", params)
},
// 我的售后
userAfterSales(params){
return request(`${cffpURL}/course/userAfterSales`, "POST", params)
},
// 售后详情
userAfterSalesDtl(params){
return request(`${cffpURL}/course/userAfterSalesDtl`, "POST", params)
},
// 个人信息查询
queryInfo(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)
},
//去提现接口
goFortuneWithdrawal(params){
return request(`${apiURL}/fortune/goFortuneWithdrawal`, "POST", params)
},
// 支付宝支付
aliAppPay(params){
return request(`${apiURL}/aliPay/aliAppPay`, "POST", params)
},
// 分享链接列表
userShareLinkList(params){
return request(`${cffpURL}/share/userShareLinkList`, "POST", params)
},
// 分享阅读列表
userShareReadList(params){
return request(`${cffpURL}/share/userShareReadList`, "POST", params)
},
// 分享购买列表
userShareBuyList(params){
return request(`${cffpURL}/share/userShareBuyList`, "POST", params)
},
// 我的分享统计
userShareCount(params){
return request(`${cffpURL}/share/userShareCount`, "POST", params)
},
// 退课明细
userRefundCourseDtl(params){
return request(`${cffpURL}/course/userRefundCourseDtl`, "POST", params)
},
//查询证件类型
erpInitialize(params){
return request(`${apiURL}/erp/erpInitialize`, "POST", params)
},
//获取职业类别
occupationQry(params){
return request(`${apiURL}/metadata/occupationQry`, "POST", params)
},
// 邀请列表查询
queryInviteList(params){
return request(`${cffpURL}/partner/queryInviteList`, "POST", params)
},
// 视频播放轨迹保存
saveVideoPlayback(params){
return request(`${apiURL}/videoPlay/saveVideoPlayback`, "POST", params)
},
// 查询视频播放最新记录
findVideoPlayback(params){
return request(`${apiURL}/videoPlay/findVideoPlayback`, "POST", params)
},
// 教育等级查询
educationLevelQuery() {
return request(`${apiURL}/metadata/educationLevelQuery`, "GET")
},
// 退课列表
queryDropCourseList(params){
return request(`${cffpURL}/course/queryDropCourseList`, "POST", params)
},
// 我的团队
queryMyTeamInfo(params){
return request(`${cffpURL}/orgInfo/queryMyTeamInfo`, "POST", params)
},
// 我的团队展开
queryTeamDetail(params){
return request(`${cffpURL}/orgInfo/teamDetail`, "POST", params)
},
// 团队业绩
queryTeamAchievement(params){
return request(`${cffpURL}/orgInfo/queryTeamAchievement`, "POST", params)
},
// 学习统计
userStudyCount(params){
return request(`${cffpURL}/study/userStudyCount`, "POST", params)
},
// 我的团队展开LIST
teamDetail(params){
return request(`${cffpURL}/orgInfo/teamDetail`, "POST", params)
},
// 课程包学习进度明细
userCoursePackBar(params){
return request(`${cffpURL}/study/userCoursePackBar`, "POST", params)
},
// 学习明细
userStudyTime(params){
return request(`${cffpURL}/study/userStudyTime`, "POST", params)
},
//合同声明
listQuery(params){
return request(`${cffpURL}/contract/listQuery`, "POST", params)
},
// 个人信息修改
updateinfo(params){
return request(`${cffpURL}/user/update`, "POST", params)
},
// 上传接口
uploadFile(params){
return request(`${cffpURL}/api/file/upload`, "POST", params)
},
// 认证--查询个人信息
querySignUpInfo(params){
return request(`${cffpURL}/user/querySignUpInfo`, "POST", params)
},
// 认证--上传就个人信息
uploadSignUpUserInfo(params){
return request(`${cffpURL}/user/uploadSignUpUserInfo`, "POST", params)
},
//查询申请加盟信息
queryById(params){
return request(`${cffpURL}/partner/queryById`, "POST",params)
},
//支付宝去提现
aliWithdrawal(params){
return request(`${apiURL}/aliPay/aliWithdrawal`, "POST", params)
},
//微信去提现
wxWithdrawal(params){
return request(`${apiURL}/pay/wxWithdrawal`, "POST", params)
},
//保存base64电子签名
saveDigitalSignatures(params){
return request(`${cffpURL}/partner/saveDigitalSignatures`, "POST", params)
},
// 退款
unifiedRefund(params){
return request(`${apiURL}/pay/unifiedRefund`, "POST", params)
},
//判断是否授权
isAuth(params){
return request(`${apiURL}/aliPay/isAuth`, "POST", params)
},
// 账号注销
cancellation(params){
return request(`${apiURL}/cffp/user/cancellation`, "POST", params)
},
// 用户分享
userShare(params){
return request(`${apiURL}/cffp/share/userShare`, "POST", params)
},
// 用户阅读
userRead(params){
return request(`${apiURL}/cffp/share/userRead`, "POST", params)
},
//H5 分享
Wxshare(params){
return request(`${apiURL}/wxConfig`, "POST", params)
},
//支付宝网页支付
aliWapPay(params){
return request(`${apiURL}/aliPay/aliWapPay`, "POST", params)
},
//统一支付接口
unifiedPay(params){
return request(`${apiURL}/pay/unifiedPay`, "POST", params)
},
// 保单单利复利计算
irrAndSimpleCalcute(params) {
return request(`${baseURL}/api/sfp/calcuteUtil/irrAndSimpleCalcute`, "POST", params)
},
// 获取unionId
getWxUserInfo(params){
return request(`${baseURL}/api/getWxUserInfo`, "POST", params)
},
//增额寿和年金(单利复利)计算结果查询接口
queryIrrAndSimple(params){
return request(`${baseURL}/api/sfp/calcuteUtil/queryIrrAndSimple`, "POST", params)
},
//获取城市
provCityQry(params){
return request(`${baseURL}/api/metadata/provCityQry`, "POST", params)
},
//购房能力测算
housePurchasePlanAnalysis(params){
return request(`${baseURL}/api/sfp/calcuteUtil/housePurchasePlanAnalysis`, "POST", params)
},
// 各城市商品住宅销售价格查询接口
queryCommercialHousingPrice(params){
return request(`${baseURL}/api/sfp/calcuteConfig/queryCommercialHousingPrice`, "POST", params)
},
// 子女教育测算
educationEstimate(params){
return request(`${baseURL}/api/sfp/calcuteUtil/educationEstimate`, "POST", params)
},
//微信认证
wxAuthorize(params){
return request(`${baseURL}/api/pay/wxAuthorize`, "POST", params)
},
//验证验证码是否正确
verification(params){
return request(`${cffpURL}/user/verification`, "POST", params)
}
}
import request from "../util/request";
import {baseURL,apiURL,cffpURL} from "../environments/environment";
export default {
//查看token是否已经失效
checkToken(){
const params = {
token:uni.getStorageSync('uni-token'),
ticket:'uni-app'
}
return request(`${baseURL}/api/authorize/checkToken`, "POST", params)
},
// 获取token
obtainToken(){
const params = {
ticket:'uni-app',
loginId:null
}
let h5userId = uni.getStorageSync('cffp_userId');
if (h5userId) {
params.loginId = h5userId;
}
return request(`${baseURL}/api/authorize/obtainToken`, "POST", params)
},
//获取验证码
verificationCode(params){
return request(`${baseURL}/api/verificationCode`, "POST", params)
},
//登录接口
loginVerification(params){
return request(`${cffpURL}/user/loginVerification`, "POST", params)
},
//注册接口
register(params){
return request(`${cffpURL}/user/register`, "POST", params)
},
//重置密码
resetPassword(params){
return request(`${cffpURL}/user/resetPassword`, "POST", params)
},
// 课程查询列表接口
courseList(params){
return request(`${cffpURL}/course/list`,"POST",params)
},
// 讲师信息查询
lecturerQuery(params){
return request(`${apiURL}/college/lecturerQuery`, "POST", params)
},
//账户信息获取
queryAreaCenterInfo(params){
return request(`${cffpURL}/areaCenter/queryAreaCenterInfo`, "POST", params)
},
//公告列表
announcementQuery(params){
return request(`${apiURL}/market/announcementQuery`, "POST", params)
},
//消息列表
querySystemMessage(params){
return request(`${apiURL}/systemMessage/querySystemMessage`, "POST", params)
},
//清除站内消息
oneKeyRead(params){
return request(`${apiURL}/systemMessage/oneKeyRead`, "POST", params)
},
//消息详情&单个阅读
querySystemMessageDetail(params){
return request(`${apiURL}/systemMessage/querySystemMessageDetail`, "POST", params)
},
// 学习认证列表
querySignupList(params){
return request(`${cffpURL}/certificate/querySignupList`, "POST", params)
},
// 个人认证列表
userCertificateList(params){
return request(`${cffpURL}/certificate/userCertificateList`, "POST", params)
},
// 认证详情
queryCertificateInfo(params){
return request(`${cffpURL}/certificate/queryCertificateInfo`, "POST", params)
},
// 课程详情
courseDetail(params){
return request(`${cffpURL}/course/detail`, "POST", params)
},
// 相关课程黎贝澳查询
relatedCoursesList(params){
return request(`${cffpURL}/course/relatedCoursesList`, "POST", params)
},
//邀请加盟与申请加盟保存接口
saveApplyInfo(params){
return request(`${cffpURL}/partner/saveApplyInfo`, "POST", params)
},
// 查询所属组织List
queryOrgList(params){
return request(`${cffpURL}/orgInfo/queryOrgList`, "POST", params)
},
//学习认证列表
queryCertificateList(params){
return request(`${cffpURL}/certificate/queryCertificateList`, "POST", params)
},
//学习认证结果
userCertificateResult(params){
return request(`${cffpURL}/certificate/userCertificateList`, "POST", params)
},
// 我的学习,学习记录
userStudyList(params){
return request(`${cffpURL}/study/userStudyList`, "POST", params)
},
// 我的分享
userShareQuery(params){
return request(`${cffpURL}/share/userShareQuery`, "POST", params)
},
// 订单详情
userCourseInfo(params){
return request(`${cffpURL}/course/userCourseInfo`, "POST", params)
},
//我的积分查询接口
findByUserIdForFortuneStatistic(params){
return request(`${apiURL}/fortune/findByUserIdForFortuneStatistic`, "POST", params)
},
//我的积分明细
findForExchangeStatisticDtl(params){
return request(`${apiURL}/fortune/findForExchangeStatisticDtl`, "POST", params)
},
//分类查询
dropOptionsQuery(params){
return request(`${apiURL}/metadata/dropOptionsQuery`, "POST", params)
},
// 销售课程统计
userCourseCount(params){
return request(`${cffpURL}/course/userCourseCount`, "POST", params)
},
// 销售课程列表查询
userCourseList(params){
return request(`${cffpURL}/course/userCourseList`, "POST", params)
},
// 分享课程列表查询
userShareCourseList(params){
return request(`${cffpURL}/course/userShareCourseList`, "POST", params)
},
//积分兑换查询
queryByUserIdFortuneStatistic(params){
return request(`${apiURL}/fortune/queryByUserIdFortuneStatistic`, "POST", params)
},
//积分兑换记录查询
findByUserIdForWithdralHis(params){
return request(`${apiURL}/fortune/findByUserIdForWithdralHis`, "POST", params)
},
//提现明细接口
findByUserIdForWithdralDtl(params){
return request(`${apiURL}/fortune/findByUserIdForWithdralDtl`, "POST", params)
},
// 我的售后
userAfterSales(params){
return request(`${cffpURL}/course/userAfterSales`, "POST", params)
},
// 售后详情
userAfterSalesDtl(params){
return request(`${cffpURL}/course/userAfterSalesDtl`, "POST", params)
},
// 个人信息查询
queryInfo(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)
},
//去提现接口
goFortuneWithdrawal(params){
return request(`${apiURL}/fortune/goFortuneWithdrawal`, "POST", params)
},
// 支付宝支付
aliAppPay(params){
return request(`${apiURL}/aliPay/aliAppPay`, "POST", params)
},
// 分享链接列表
userShareLinkList(params){
return request(`${cffpURL}/share/userShareLinkList`, "POST", params)
},
// 分享阅读列表
userShareReadList(params){
return request(`${cffpURL}/share/userShareReadList`, "POST", params)
},
// 分享购买列表
userShareBuyList(params){
return request(`${cffpURL}/share/userShareBuyList`, "POST", params)
},
// 我的分享统计
userShareCount(params){
return request(`${cffpURL}/share/userShareCount`, "POST", params)
},
// 退课明细
userRefundCourseDtl(params){
return request(`${cffpURL}/course/userRefundCourseDtl`, "POST", params)
},
//查询证件类型
erpInitialize(params){
return request(`${apiURL}/erp/erpInitialize`, "POST", params)
},
//获取职业类别
occupationQry(params){
return request(`${apiURL}/metadata/occupationQry`, "POST", params)
},
// 邀请列表查询
queryInviteList(params){
return request(`${cffpURL}/partner/queryInviteList`, "POST", params)
},
// 视频播放轨迹保存
saveVideoPlayback(params){
return request(`${apiURL}/videoPlay/saveVideoPlayback`, "POST", params)
},
// 查询视频播放最新记录
findVideoPlayback(params){
return request(`${apiURL}/videoPlay/findVideoPlayback`, "POST", params)
},
// 教育等级查询
educationLevelQuery() {
return request(`${apiURL}/metadata/educationLevelQuery`, "GET")
},
// 退课列表
queryDropCourseList(params){
return request(`${cffpURL}/course/queryDropCourseList`, "POST", params)
},
// 我的团队
queryMyTeamInfo(params){
return request(`${cffpURL}/orgInfo/queryMyTeamInfo`, "POST", params)
},
// 我的团队展开
queryTeamDetail(params){
return request(`${cffpURL}/orgInfo/teamDetail`, "POST", params)
},
// 团队业绩
queryTeamAchievement(params){
return request(`${cffpURL}/orgInfo/queryTeamAchievement`, "POST", params)
},
// 学习统计
userStudyCount(params){
return request(`${cffpURL}/study/userStudyCount`, "POST", params)
},
// 我的团队展开LIST
teamDetail(params){
return request(`${cffpURL}/orgInfo/teamDetail`, "POST", params)
},
// 课程包学习进度明细
userCoursePackBar(params){
return request(`${cffpURL}/study/userCoursePackBar`, "POST", params)
},
// 学习明细
userStudyTime(params){
return request(`${cffpURL}/study/userStudyTime`, "POST", params)
},
//合同声明
listQuery(params){
return request(`${cffpURL}/contract/listQuery`, "POST", params)
},
// 个人信息修改
updateinfo(params){
return request(`${cffpURL}/user/update`, "POST", params)
},
// 上传接口
uploadFile(params){
return request(`${cffpURL}/api/file/upload`, "POST", params)
},
// 认证--查询个人信息
querySignUpInfo(params){
return request(`${cffpURL}/user/querySignUpInfo`, "POST", params)
},
// 认证--上传就个人信息
uploadSignUpUserInfo(params){
return request(`${cffpURL}/user/uploadSignUpUserInfo`, "POST", params)
},
//查询申请加盟信息
queryById(params){
return request(`${cffpURL}/partner/queryById`, "POST",params)
},
//支付宝去提现
aliWithdrawal(params){
return request(`${apiURL}/aliPay/aliWithdrawal`, "POST", params)
},
//微信去提现
wxWithdrawal(params){
return request(`${apiURL}/pay/wxWithdrawal`, "POST", params)
},
//保存base64电子签名
saveDigitalSignatures(params){
return request(`${cffpURL}/partner/saveDigitalSignatures`, "POST", params)
},
// 退款
unifiedRefund(params){
return request(`${apiURL}/pay/unifiedRefund`, "POST", params)
},
//判断是否授权
isAuth(params){
return request(`${apiURL}/aliPay/isAuth`, "POST", params)
},
// 账号注销
cancellation(params){
return request(`${apiURL}/cffp/user/cancellation`, "POST", params)
},
// 用户分享
userShare(params){
return request(`${apiURL}/cffp/share/userShare`, "POST", params)
},
// 用户阅读
userRead(params){
return request(`${apiURL}/cffp/share/userRead`, "POST", params)
},
//H5 分享
Wxshare(params){
return request(`${apiURL}/wxConfig`, "POST", params)
},
//支付宝网页支付
aliWapPay(params){
return request(`${apiURL}/aliPay/aliWapPay`, "POST", params)
},
//统一支付接口
unifiedPay(params){
return request(`${apiURL}/pay/unifiedPay`, "POST", params)
},
// 保单单利复利计算
irrAndSimpleCalcute(params) {
return request(`${baseURL}/api/sfp/calcuteUtil/irrAndSimpleCalcute`, "POST", params)
},
// 获取unionId
getWxUserInfo(params){
return request(`${baseURL}/api/getWxUserInfo`, "POST", params)
},
//增额寿和年金(单利复利)计算结果查询接口
queryIrrAndSimple(params){
return request(`${baseURL}/api/sfp/calcuteUtil/queryIrrAndSimple`, "POST", params)
},
//获取城市
provCityQry(params){
return request(`${baseURL}/api/metadata/provCityQry`, "POST", params)
},
//购房能力测算
housePurchasePlanAnalysis(params){
return request(`${baseURL}/api/sfp/calcuteUtil/housePurchasePlanAnalysis`, "POST", params)
},
// 各城市商品住宅销售价格查询接口
queryCommercialHousingPrice(params){
return request(`${baseURL}/api/sfp/calcuteConfig/queryCommercialHousingPrice`, "POST", params)
},
// 子女教育测算
educationEstimate(params){
return request(`${baseURL}/api/sfp/calcuteUtil/educationEstimate`, "POST", params)
},
//微信认证
wxAuthorize(params){
return request(`${baseURL}/api/pay/wxAuthorize`, "POST", params)
},
//验证验证码是否正确
verification(params){
return request(`${cffpURL}/user/verification`, "POST", params)
}
}
......@@ -47,10 +47,12 @@
"<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_CONTACTS\"/>",
"<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
"<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
"<uses-permission android:name=\"android.permission.VIBRATE\"/>",
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
"<uses-permission android:name=\"android.permission.WRITE_CONTACTS\"/>",
"<uses-permission android:name=\"android.permission.WRITE_EXTERNAL_STORAGE\"/>",
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
],
......@@ -93,7 +95,9 @@
"appid" : "wx3ec6ac74a8c074be",
"UniversalLinks" : "https://mapp.cffp.org.cn/app/"
}
}
},
"maps" : {},
"geolocation" : {}
},
"splashscreen" : {
"androidStyle" : "common",
......
<template>
<view class="container">
<!-- 课程详情 -->
<template v-if="courseInfoItem">
<view class="courseItemBox" style="padding-top:80rpx">
<view class="iconfont icon-youjiantou zuojiantou" @click="goBack()" style="top:18rpx">
</view>
<course-item :thumbnailPath="courseInfoItem.displayImage" :title="courseInfoItem.fileTitle"
:summaryBox="courseInfoItem.fileSynopsis"
:dataList="{coursePrice:courseInfoItem.coursePrice,salesNumber:courseInfoItem.salesNumber}"
:fileLecturerId="courseInfoItem.fileLecturerId" :fileId="fileId"></course-item>
</view>
</template>
<!-- 价格明细 -->
<view class="priceInfoContent">
<h4>价格明细</h4>
<view><text>现价</text><text>¥{{Number(courseInfoItem.coursePrice).toFixed(2)}}</text></view>
<view>
<text @click="toggle(1,'bottom')">积分抵扣<i class="iconfont icon-31tishi"></i></text>
<text class="integralBox" @click="toggle(2,'bottom')"
v-if="intergralInfo.preFortune">{{isDeduction != 'true' ? '未选' : '已选'}}积分,可抵扣{{deductionCore}}<i
class="iconfont icon-youjiantou"></i></text>
<text style="color: #666666;font-size: 30rpx;" v-else>暂无积分</text>
</view>
<view><text>合计</text>
<text v-if="isRedirect == 1">{{calculatedPrice}}</text>
<text v-else>¥{{Number(totalPrice).toFixed(2)}}</text>
</view>
</view>
<!-- 支付方式 -->
<view class="paymentMethodContent">
<h4>选择支付方式</h4>
<view class="paymentItem" @click="selectPaymentMethod(2)">
<view>
<i class="iconfont icon-zhifubao"></i>
<text>支付宝支付</text>
</view>
<view class="selectRadio" :class="{'actived':paymentMethod===2}">
<i class="iconfont icon-duihao"></i>
</view>
</view>
<view class="paymentItem" @click="selectPaymentMethod(1)" v-if="deviceType==3">
<view>
<i class="iconfont icon-py_weixinzhifu"></i>
<text>微信支付</text>
</view>
<view class="selectRadio" :class="{'actived':paymentMethod===1}">
<i class="iconfont icon-duihao"></i>
</view>
</view>
<!-- #ifdef APP-PLUS -->
<!-- <view class="paymentItem" @click="selectPaymentMethod(1)">
<view>
<i class="iconfont icon-py_weixinzhifu"></i>
<text>微信支付</text>
</view>
<view class="selectRadio" :class="{'actived':paymentMethod===1}">
<i class="iconfont icon-duihao"></i>
</view>
</view> -->
<!-- #endif -->
</view>
<!-- 底部 -->
<view class="totalContent">
<view class="priceInfoBox">
<view>合计:
<strong v-if="isRedirect == 1">{{calculatedPrice}}</strong>
<strong v-else style="font-size: 36rpx;">¥{{totalPrice}}</strong>
</view>
<view class="" v-if="isRedirect == 1">
<view>共优惠:<strong style="color:#F15A1F">
<text v-if="isDeduction == 'true'">{{deductionCore}}</text>
<text style="color:#F15A1F" v-else>0</text>
</strong>
</view>
</view>
<view class="" v-else>
<view>共优惠:<strong style="color:#F15A1F"
v-if="isDeduction == 'true'">¥{{Number(deductionCore * intergralInfo.preFortune).toFixed(2)}}</strong>
<text style="color:#F15A1F" v-else>0</text>
</view>
</view>
</view>
<view class="confirmOrder" :class="{'gray':paymentBtnDisabled}" @click="pay()">提交订单</view>
</view>
<view v-html="payForm">
</view>
<!-- 普通弹窗 -->
<uni-popup ref="popup" background-color="#fff">
<view class="popup-content">
<view class="title">
<text></text>
<h3>{{popupTitle}}</h3>
<i class="iconfont icon-guanbi" @click="closePopup(1)"></i>
</view>
<view v-if="popupType===1"><text>1积分=1元,积分抵扣如同现金,所有课程均可使用.</text></view>
<view v-if="popupType===2">
<view class="deductionInfoItem" :class="{'actived':isDeduction == 'true'}" @click="selectDeduction(true)">
<view style="display: flex;">
<text>可抵扣</text>
<view class="integralInfoBox">
<text class="deductionCount">¥{{deductionCore * intergralInfo.preFortune || '0'}}</text>
<text>需{{deductionCore}}积分兑换</text>
</view>
</view>
<view class="selectRadio">
<i class="iconfont icon-duihao"></i>
</view>
</view>
<view class="deductionInfoItem" :class="{'actived':isDeduction == 'false'}" @click="selectDeduction(false)">
<view>
<text>不使用积分抵扣</text>
</view>
<view class="selectRadio">
<i class="iconfont icon-duihao"></i>
</view>
</view>
<view class="confirmBtn" @click="closePopup(1);">
确认
</view>
</view>
</view>
</uni-popup>
<view class="popupContainer">
<uni-popup ref="popup1" background-color="#fff">
<view class="popup1-content">
<view class="title">
<text></text>
<h3>{{popupTitle}}</h3>
<i class="iconfont icon-guanbi" @click="closePopup(2)"></i>
</view>
<view class="integralDeductionContent">
<view class="intergralItem">
<text>可兑换积分:</text>
<text>{{intergralInfo.yesExchangeFortune}}积分</text>
</view>
<view class="intergralItem">
<text>本次兑换消耗积分:</text>
<text>{{deductionCore}}积分</text>
</view>
<view class="intergralItem">
<text>剩余可兑换积分:</text>
<text>{{(intergralInfo.yesExchangeFortune - deductionCore).toFixed(2)}}积分</text>
</view>
<view class="confirmBtn" @click="closePopup(2)">
确认兑换
</view>
</view>
</view>
</uni-popup>
</view>
<view class="markBox" @click="tipsFlag=false" v-if="tipsFlag">
<view class="guideImgBox">
<image src="../../static/Group132.png" mode="widthFix"></image>
<view class="tips">
<!-- <view class="text-center">请点击右上角菜单</view> -->
<view style="line-height: 60rpx;">戳这里,点击<text class="iconfont icon-liulanqi"></text>
按钮,使用系统浏览器打开页面完成支付,完成后请返回微信,到【销售课程】下,查看购买订单。</view>
</view>
</view>
</view>
</view>
</template>
<script>
import api from "@/api/api";
import courseItem from "@/components/courseItem/courseItem.vue";
import {
nextTick
} from "vue";
import common from '../../common/common';
export default {
components: {
courseItem
},
data() {
return {
courseInfoItem: {},
fileId: null,
paymentMethod: 2,
popupTitle: '积分抵扣规则',
popupType: 1,
isDeduction: 'false',
userId: uni.getStorageSync('cffp_userId'),
intergralInfo: {},
orderId: '',
paymentBtnDisabled: false,
action: '',
params: '',
actionType: '',
charset: '',
contentType: '',
payForm: '',
deviceType: '',
tipsFlag: false,
isRedirect: null,
amount: 0,
calculatedPrice: 0
}
},
computed: {
totalPrice() {
if (this.isDeduction == "true") {
return (this.courseInfoItem.coursePrice - (this.deductionCore * this.intergralInfo.preFortune))
.toFixed(2)
} else {
return this.courseInfoItem.coursePrice;
}
},
deductionCore() {
if (this.courseInfoItem.coursePrice / this.intergralInfo.preFortune < this.intergralInfo
.yesExchangeFortune) {
return parseFloat((this.courseInfoItem.coursePrice / this.intergralInfo.preFortune)).toFixed(2)
} else {
return this.intergralInfo.yesExchangeFortune
}
}
},
methods: {
goBack() {
uni.navigateBack({
delta: 1
});
},
// 支付
pay() {
if (this.paymentBtnDisabled) {
return false;
}
this.paymentBtnDisabled = true;
let param = {
orderId: this.orderId,
amount: this.isRedirect == 1 ? this.calculatedPrice : this.totalPrice,
paymentMethod: this.paymentMethod,
userId: this.userId,
integralExchange: this.isDeduction == "true" ? this.deductionCore : 0,
paymentType: '',
isPayOrAuth: '',
fileId: this.fileId
}
if (this.paymentMethod == 1) {
// APP:微信app支付
// #ifdef APP-PLUS
param.paymentType = 1;
api.unifiedPay(param).then(res => {
console.log(res)
this.paymentBtnDisabled = false;
})
// #endif
// #ifdef H5
param.paymentType = 2;
//deviceType:PC为1,移动端为2,微信为3
if (this.deviceType == 3) {
let _this = this
param.isPayOrAuth = 1;
// } else {
api.wxAuthorize(param).then((res) => {
_this.paymentBtnDisabled = false;
if (res['success']) {
if (param.amount == '0.00') {
uni.navigateTo({
url: `/pages/orderStatus/orderStatus?orderId=${_this.orderId}&fileId=${_this.fileId}&orderStatus=2&userId=${_this.userId}`
})
return false
} else {
window.location.href = res['data']['paymentForm']['action'];
}
}
})
// }
} else {
//微信二维码支付
}
// #endif
} else if (this.paymentMethod == 2) {
// APP:支付宝app支付
// #ifdef APP-PLUS
param.paymentType = 1;
api.unifiedPay(param).then(res => {
this.paymentBtnDisabled = false;
if (res['success']) {
const aliOrderString = res['data']['aliOrderString'];
let _this = this
if (aliOrderString) {
uni.requestPayment({
provider: 'alipay',
orderInfo: aliOrderString,
success: function(resp) {
uni.navigateTo({
url: `/pages/orderStatus/orderStatus?orderId=${_this.orderId}&fileId=${_this.fileId}&orderStatus=2&userId=${_this.userId}&isRedirect=1`
})
},
fail: function(err) {
console.log('fail:' + JSON.stringify(err));
uni.navigateTo({
url: `/pages/orderStatus/orderStatus?orderId=${_this.orderId}&fileId=${_this.fileId}&orderStatus=1&userId=${_this.userId}&isRedirect=1`
})
}
});
} else {
uni.navigateTo({
url: `/pages/orderStatus/orderStatus?orderId=${this.orderId}&fileId=${this.fileId}&orderStatus=2&userId=${this.userId}&isRedirect=1`
})
}
} else {
uni.showModal({
content: res['message'],
success: function(res) {
if (res.confirm) {
console.log('用户点击确定');
} else if (res.cancel) {
console.log('用户点击取消');
}
}
});
}
})
// #endif
//#ifdef H5
//支付宝h5支付
param.paymentType = 2;
this.amount = this.totalPrice;
if (this.deviceType == 3) {
if (param.amount == '0.00') {
this.getunifiedPay(param)
return false
} else {
this.tipsFlag = true;
this.amount = this.totalPrice;
this.paymentBtnDisabled = false;
let deductionCore = this.isDeduction == "true" ? parseFloat(this.deductionCore) : 0;
let url = window.location.href +
`&isRedirect=1&amount=${this.amount}&isDeduction=${this.isDeduction}&deductionCore=${deductionCore}&jumptime=${new Date()}`;
window.history.replaceState(null, '', url);
return;
}
}
this.getunifiedPay(param)
//#endif
}
},
getunifiedPay(param){
api.unifiedPay(param).then((res) => {
const data = res['data'];
this.paymentBtnDisabled = false;
if (res['success']) {
if (data.orderStatus != null && data.orderStatus != '') {
uni.navigateTo({
url: `/pages/orderStatus/orderStatus?orderId=${this.orderId}&fileId=${this.fileId}&orderStatus=2&userId=${this.userId}`
})
return false
}
this.payForm = res['data']['aliOrderString'];
this.$nextTick(() => {
console.log(document.forms)
document.forms['punchout_form'].submit();
})
} else {
uni.showModal({
content: res['message'],
success: function(res) {
if (res.confirm) {
console.log('用户点击确定');
} else if (res.cancel) {
console.log('用户点击取消');
}
}
});
}
})
},
// 积分查询
queryByUserIdFortuneStatistic() {
api.queryByUserIdFortuneStatistic({
userId: this.userId
}).then(res => {
if (res['success']) {
this.intergralInfo = res['data'];
this.intergralInfo.preFortune = 1.0;
}
})
},
// 课程详情页面
courseDetail() {
api.courseDetail({
fileId: this.fileId,
userId: this.userId
}).then(res => {
console.log('课程详情', res);
if (res['success']) {
this.courseInfoItem = res['data']['data'];
}
})
},
// 选择支付方式
selectPaymentMethod(value) {
this.paymentMethod = value;
},
// 从下往上弹出
toggle(val, type) {
// type 1为积分抵扣规则,2为优惠详情
this.popupType = val;
// open 方法传入参数 等同在 uni-popup 组件上绑定 type属性
if (this.popupType === 3) {
if (this.isDeduction) {
this.$refs.popup1.open(type);
}
} else {
this.$refs.popup.open(type);
}
if (this.popupType === 1) {
this.popupTitle = '积分抵扣规则'
} else if (this.popupType === 2) {
this.popupTitle = '优惠详情'
} else if (this.popupType === 3) {
this.popupTitle = '积分兑换'
}
},
// 关闭弹出层
closePopup(val) {
if (val === 1) {
this.$refs.popup.close()
if(this.isDeduction == 'true'){
this.toggle(3,'center')
}
} else {
this.$refs.popup1.close()
}
},
// 选择是否抵扣
selectDeduction(type) {
this.isDeduction = String(type);
},
// 确认积分兑换
confirmIntergralDeduction() {
},
},
onLoad(option) {
this.fileId = option.fileId;
this.orderId = option.orderId;
if (option.userId) {
this.userId = option.userId
}
this.courseDetail();
this.queryByUserIdFortuneStatistic()
this.deviceType = common.checkDeviceType();
if (this.deviceType == 3) {
this.paymentMethod = 1;
}
this.isRedirect = option.isRedirect;
if (this.isRedirect == 1) {
this.deductionCore = option.deductionCore;
this.amount = Number(option.amount);
this.isDeduction = String(option.isDeduction);
this.calculatedPrice = Number(this.amount);
setTimeout(() => {
this.pay();
}, 500)
}
},
mounted() {}
}
</script>
<style lang="scss">
.container {
position: relative;
height: 95vh;
.courseItemBox {
padding: 20rpx 30rpx;
background-color: #fff;
}
.popup-content {
.title {
display: flex;
justify-content: space-between;
align-items: baseline;
h3 {
text-align: center;
color: #333;
font-size: 32rpx;
margin-bottom: 30rpx;
}
.iconfont {
color: #999;
}
}
text {
color: #666;
font-size: 30rpx;
}
.deductionInfoItem {
display: flex;
justify-content: space-between;
align-items: center;
color: #333;
font-size: 30rpx;
padding: 10rpx 30rpx;
background-color: #F5f5f5;
border-radius: 20rpx;
min-height: 90rpx;
margin-top: 30rpx;
.integralInfoBox {
display: flex;
flex-direction: column;
margin-left: 10rpx;
text {
font-size: 30rpx;
color: #333333;
}
.deductionCount {
font-size: 36rpx;
color: #F15A1F;
}
}
.selectRadio {
color: #D8D8D8;
width: 40rpx;
height: 40rpx;
border: 1px solid #D8D8D8;
border-radius: 50%;
display: flex;
justify-content: center;
align-items: center;
}
&.actived {
border: 3rpx solid #20269B;
background-color: #fff;
.selectRadio {
background-color: #20269B;
color: #fff;
}
}
}
.integralDeductionContent {
.intergralItem {
display: flex;
justify-content: space-between;
margin-bottom: 10rpx;
}
}
.confirmBtn {
border-radius: 80rpx;
height: 80rpx;
width: 60%;
background-color: #20269B;
color: #fff;
margin: 64rpx auto 0;
display: flex;
justify-content: center;
align-items: center;
}
}
.popup1-content {
padding: 30rpx 34rpx 20rpx 42rpx;
border-radius: 20rpx;
.title {
display: flex;
justify-content: space-between;
align-items: baseline;
h3 {
text-align: center;
color: #333;
font-size: 32rpx;
margin-bottom: 30rpx;
}
.iconfont {
color: #999;
}
}
.integralDeductionContent {
.intergralItem {
display: flex;
justify-content: space-between;
color: #333;
font-size: 30rpx;
margin-bottom: 10rpx;
}
}
.confirmBtn {
border-radius: 80rpx;
height: 80rpx;
width: 60%;
background-color: #20269B;
color: #fff;
margin: 64rpx auto 0;
display: flex;
justify-content: center;
align-items: center;
}
}
.priceInfoContent,
.paymentMethodContent,
.totalContent {
background-color: #fff;
margin: 0 10rpx;
padding: 20rpx;
}
.priceInfoContent {
view {
display: flex;
justify-content: space-between;
text {
&:last-child {
font-weight: bold;
}
&.integralBox {
color: #FA6900;
font-weight: normal;
.iconfont {
color: #999;
}
}
}
.iconfont {
margin-left: 10rpx;
}
}
}
.priceInfoContent,
.paymentMethodContent {
border-bottom: 5px solid #fbfbfb;
color: #333;
h4 {
font-size: 32rpx;
margin-bottom: 20rpx;
}
view {
margin-bottom: 10rpx;
}
}
.paymentMethodContent {
.paymentItem {
display: flex;
align-items: center;
justify-content: space-between;
view {
display: flex;
align-items: center;
}
.icon-zhifubao {
color: #5A9EF7;
font-size: 60rpx;
margin-right: 20rpx;
}
.icon-py_weixinzhifu {
color: #09BB07;
font-size: 60rpx;
margin-right: 20rpx;
}
.selectRadio {
width: 40rpx;
height: 40rpx;
display: flex;
justify-content: center;
align-items: center;
border-radius: 50%;
border: 1px solid #D8D8D8;
color: transparent;
&.actived {
background-color: #0A2F99;
color: #fff;
}
}
}
}
.totalContent {
position: absolute;
bottom: 0;
left: 0;
width: 100%;
padding: 40rpx 28rpx;
display: flex;
align-items: center;
justify-content: space-between;
box-sizing: border-box;
.priceInfoBox {
font-size: 30rpx;
color: #333;
view:first-child {
margin-bottom: 10rpx;
}
}
.confirmOrder {
background-color: #20269B;
color: #fff;
padding: 14rpx 38rpx;
border-radius: 80rpx;
}
.gray {
background: #666;
}
}
}
.markBox {
position: fixed;
left: 0;
top: 0;
bottom: 0;
right: 0;
width: 100%;
height: 100%;
color: #fff;
display: flex;
justify-content: flex-end;
z-index: 100000;
background: rgba(0, 0, 0, 0.8);
.icon-liulanqi{
margin: 0px 10rpx;
color: #3b43d5;
background: #fff;
padding: 6rpx;
border-radius: 8rpx;
font-size: 36rpx;
}
.guideImgBox {
margin: 20px auto;
uni-image {
width: 25% !important;
position: absolute;
right: 0;
top: 0;
}
}
.tips {
margin-top: 20%;
padding: 0 30px;
}
}
// .iconfont {
// position: absolute;
// right: 8%;
// font-size: 40px;
// top: 2px;
// font-weight: bold;
// }
.tips p {
font-size: 18px;
margin-top: 10px;
text-align: justify;
letter-spacing: 1px;
}
</style>
<template>
<view class="container">
<!-- 课程详情 -->
<template v-if="courseInfoItem">
<view class="courseItemBox" style="padding-top:80rpx">
<view class="iconfont icon-youjiantou zuojiantou" @click="goBack()" style="top:18rpx">
</view>
<course-item :thumbnailPath="courseInfoItem.displayImage" :title="courseInfoItem.fileTitle"
:summaryBox="courseInfoItem.fileSynopsis"
:dataList="{coursePrice:courseInfoItem.coursePrice,salesNumber:courseInfoItem.salesNumber}"
:fileLecturerId="courseInfoItem.fileLecturerId" :fileId="fileId"></course-item>
</view>
</template>
<!-- 价格明细 -->
<view class="priceInfoContent">
<h4>价格明细</h4>
<view><text>现价</text><text>¥{{Number(courseInfoItem.coursePrice).toFixed(2)}}</text></view>
<view>
<text @click="toggle(1,'bottom')">积分抵扣<i class="iconfont icon-31tishi"></i></text>
<text class="integralBox" @click="toggle(2,'bottom')"
v-if="intergralInfo.preFortune">{{isDeduction != 'true' ? '未选' : '已选'}}积分,可抵扣{{deductionCore}}<i
class="iconfont icon-youjiantou"></i></text>
<text style="color: #666666;font-size: 30rpx;" v-else>暂无积分</text>
</view>
<view><text>合计</text>
<text v-if="isRedirect == 1">{{calculatedPrice}}</text>
<text v-else>¥{{Number(totalPrice).toFixed(2)}}</text>
</view>
</view>
<!-- 支付方式 -->
<view class="paymentMethodContent">
<h4>选择支付方式</h4>
<view class="paymentItem" @click="selectPaymentMethod(2)">
<view>
<i class="iconfont icon-zhifubao"></i>
<text>支付宝支付</text>
</view>
<view class="selectRadio" :class="{'actived':paymentMethod===2}">
<i class="iconfont icon-duihao"></i>
</view>
</view>
<view class="paymentItem" @click="selectPaymentMethod(1)" v-if="deviceType==3">
<view>
<i class="iconfont icon-py_weixinzhifu"></i>
<text>微信支付</text>
</view>
<view class="selectRadio" :class="{'actived':paymentMethod===1}">
<i class="iconfont icon-duihao"></i>
</view>
</view>
<!-- #ifdef APP-PLUS -->
<!-- <view class="paymentItem" @click="selectPaymentMethod(1)">
<view>
<i class="iconfont icon-py_weixinzhifu"></i>
<text>微信支付</text>
</view>
<view class="selectRadio" :class="{'actived':paymentMethod===1}">
<i class="iconfont icon-duihao"></i>
</view>
</view> -->
<!-- #endif -->
</view>
<!-- 底部 -->
<view class="totalContent">
<view class="priceInfoBox">
<view>合计:
<strong v-if="isRedirect == 1">{{calculatedPrice}}</strong>
<strong v-else style="font-size: 36rpx;">¥{{totalPrice}}</strong>
</view>
<view class="" v-if="isRedirect == 1">
<view>共优惠:<strong style="color:#F15A1F">
<text v-if="isDeduction == 'true'">{{deductionCore}}</text>
<text style="color:#F15A1F" v-else>0</text>
</strong>
</view>
</view>
<view class="" v-else>
<view>共优惠:<strong style="color:#F15A1F"
v-if="isDeduction == 'true'">¥{{Number(deductionCore * intergralInfo.preFortune).toFixed(2)}}</strong>
<text style="color:#F15A1F" v-else>0</text>
</view>
</view>
</view>
<view class="confirmOrder" :class="{'gray':paymentBtnDisabled}" @click="pay()">提交订单</view>
</view>
<view v-html="payForm">
</view>
<!-- 普通弹窗 -->
<uni-popup ref="popup" background-color="#fff">
<view class="popup-content">
<view class="title">
<text></text>
<h3>{{popupTitle}}</h3>
<i class="iconfont icon-guanbi" @click="closePopup(1)"></i>
</view>
<view v-if="popupType===1"><text>1积分=1元,积分抵扣如同现金,所有课程均可使用.</text></view>
<view v-if="popupType===2">
<view class="deductionInfoItem" :class="{'actived':isDeduction == 'true'}" @click="selectDeduction(true)">
<view style="display: flex;">
<text>可抵扣</text>
<view class="integralInfoBox">
<text class="deductionCount">¥{{deductionCore * intergralInfo.preFortune || '0'}}</text>
<text>需{{deductionCore}}积分兑换</text>
</view>
</view>
<view class="selectRadio">
<i class="iconfont icon-duihao"></i>
</view>
</view>
<view class="deductionInfoItem" :class="{'actived':isDeduction == 'false'}" @click="selectDeduction(false)">
<view>
<text>不使用积分抵扣</text>
</view>
<view class="selectRadio">
<i class="iconfont icon-duihao"></i>
</view>
</view>
<view class="confirmBtn" @click="closePopup(1);">
确认
</view>
</view>
</view>
</uni-popup>
<view class="popupContainer">
<uni-popup ref="popup1" background-color="#fff">
<view class="popup1-content">
<view class="title">
<text></text>
<h3>{{popupTitle}}</h3>
<i class="iconfont icon-guanbi" @click="closePopup(2)"></i>
</view>
<view class="integralDeductionContent">
<view class="intergralItem">
<text>可兑换积分:</text>
<text>{{intergralInfo.yesExchangeFortune}}积分</text>
</view>
<view class="intergralItem">
<text>本次兑换消耗积分:</text>
<text>{{deductionCore}}积分</text>
</view>
<view class="intergralItem">
<text>剩余可兑换积分:</text>
<text>{{(intergralInfo.yesExchangeFortune - deductionCore).toFixed(2)}}积分</text>
</view>
<view class="confirmBtn" @click="closePopup(2)">
确认兑换
</view>
</view>
</view>
</uni-popup>
</view>
<view class="markBox" @click="tipsFlag=false" v-if="tipsFlag">
<view class="guideImgBox">
<image src="../../static/Group132.png" mode="widthFix"></image>
<view class="tips">
<!-- <view class="text-center">请点击右上角菜单</view> -->
<view style="line-height: 60rpx;">戳这里,点击<text class="iconfont icon-liulanqi"></text>
按钮,使用系统浏览器打开页面完成支付,完成后请返回微信,到【销售课程】下,查看购买订单。</view>
</view>
</view>
</view>
</view>
</template>
<script>
import api from "@/api/api";
import courseItem from "@/components/courseItem/courseItem.vue";
import {
nextTick
} from "vue";
import common from '../../common/common';
export default {
components: {
courseItem
},
data() {
return {
courseInfoItem: {},
fileId: null,
paymentMethod: 2,
popupTitle: '积分抵扣规则',
popupType: 1,
isDeduction: 'false',
userId: uni.getStorageSync('cffp_userId'),
intergralInfo: {},
orderId: '',
paymentBtnDisabled: false,
action: '',
params: '',
actionType: '',
charset: '',
contentType: '',
payForm: '',
deviceType: '',
tipsFlag: false,
isRedirect: null,
amount: 0,
calculatedPrice: 0
}
},
computed: {
totalPrice() {
if (this.isDeduction == "true") {
return (this.courseInfoItem.coursePrice - (this.deductionCore * this.intergralInfo.preFortune))
.toFixed(2)
} else {
return this.courseInfoItem.coursePrice;
}
},
deductionCore() {
if (this.courseInfoItem.coursePrice / this.intergralInfo.preFortune < this.intergralInfo
.yesExchangeFortune) {
return parseFloat((this.courseInfoItem.coursePrice / this.intergralInfo.preFortune)).toFixed(2)
} else {
return this.intergralInfo.yesExchangeFortune
}
}
},
methods: {
goBack() {
uni.navigateBack({
delta: 1
});
},
// 支付
pay() {
if (this.paymentBtnDisabled) {
return false;
}
this.paymentBtnDisabled = true;
let param = {
orderId: this.orderId,
amount: this.isRedirect == 1 ? this.calculatedPrice : this.totalPrice,
paymentMethod: this.paymentMethod,
userId: this.userId,
integralExchange: this.isDeduction == "true" ? this.deductionCore : 0,
paymentType: '',
isPayOrAuth: '',
fileId: this.fileId
}
if (this.paymentMethod == 1) {
// APP:微信app支付
// #ifdef APP-PLUS
param.paymentType = 1;
api.unifiedPay(param).then(res => {
console.log(res)
this.paymentBtnDisabled = false;
})
// #endif
// #ifdef H5
param.paymentType = 2;
//deviceType:PC为1,移动端为2,微信为3
if (this.deviceType == 3) {
let _this = this
param.isPayOrAuth = 1;
// } else {
api.wxAuthorize(param).then((res) => {
_this.paymentBtnDisabled = false;
if (res['success']) {
if (param.amount == '0.00') {
uni.navigateTo({
url: `/pages/orderStatus/orderStatus?orderId=${_this.orderId}&fileId=${_this.fileId}&orderStatus=2&userId=${_this.userId}`
})
return false
} else {
window.location.href = res['data']['paymentForm']['action'];
}
}
})
// }
} else {
//微信二维码支付
}
// #endif
} else if (this.paymentMethod == 2) {
// APP:支付宝app支付
// #ifdef APP-PLUS
param.paymentType = 1;
api.unifiedPay(param).then(res => {
this.paymentBtnDisabled = false;
if (res['success']) {
const aliOrderString = res['data']['aliOrderString'];
let _this = this
if (aliOrderString) {
uni.requestPayment({
provider: 'alipay',
orderInfo: aliOrderString,
success: function(resp) {
uni.navigateTo({
url: `/pages/orderStatus/orderStatus?orderId=${_this.orderId}&fileId=${_this.fileId}&orderStatus=2&userId=${_this.userId}&isRedirect=1`
})
},
fail: function(err) {
console.log('fail:' + JSON.stringify(err));
uni.navigateTo({
url: `/pages/orderStatus/orderStatus?orderId=${_this.orderId}&fileId=${_this.fileId}&orderStatus=1&userId=${_this.userId}&isRedirect=1`
})
}
});
} else {
uni.navigateTo({
url: `/pages/orderStatus/orderStatus?orderId=${this.orderId}&fileId=${this.fileId}&orderStatus=2&userId=${this.userId}&isRedirect=1`
})
}
} else {
uni.showModal({
content: res['message'],
success: function(res) {
if (res.confirm) {
console.log('用户点击确定');
} else if (res.cancel) {
console.log('用户点击取消');
}
}
});
}
})
// #endif
//#ifdef H5
//支付宝h5支付
param.paymentType = 2;
this.amount = this.totalPrice;
if (this.deviceType == 3) {
if (param.amount == '0.00') {
this.getunifiedPay(param)
return false
} else {
this.tipsFlag = true;
this.amount = this.totalPrice;
this.paymentBtnDisabled = false;
let deductionCore = this.isDeduction == "true" ? parseFloat(this.deductionCore) : 0;
let url = window.location.href +
`&isRedirect=1&amount=${this.amount}&isDeduction=${this.isDeduction}&deductionCore=${deductionCore}&jumptime=${new Date()}`;
window.history.replaceState(null, '', url);
return;
}
}
this.getunifiedPay(param)
//#endif
}
},
getunifiedPay(param){
api.unifiedPay(param).then((res) => {
const data = res['data'];
this.paymentBtnDisabled = false;
if (res['success']) {
if (data.orderStatus != null && data.orderStatus != '') {
uni.navigateTo({
url: `/pages/orderStatus/orderStatus?orderId=${this.orderId}&fileId=${this.fileId}&orderStatus=2&userId=${this.userId}`
})
return false
}
this.payForm = res['data']['aliOrderString'];
this.$nextTick(() => {
console.log(document.forms)
document.forms['punchout_form'].submit();
})
} else {
uni.showModal({
content: res['message'],
success: function(res) {
if (res.confirm) {
console.log('用户点击确定');
} else if (res.cancel) {
console.log('用户点击取消');
}
}
});
}
})
},
// 积分查询
queryByUserIdFortuneStatistic() {
api.queryByUserIdFortuneStatistic({
userId: this.userId
}).then(res => {
if (res['success']) {
this.intergralInfo = res['data'];
this.intergralInfo.preFortune = 1.0;
}
})
},
// 课程详情页面
courseDetail() {
api.courseDetail({
fileId: this.fileId,
userId: this.userId
}).then(res => {
console.log('课程详情', res);
if (res['success']) {
this.courseInfoItem = res['data']['data'];
}
})
},
// 选择支付方式
selectPaymentMethod(value) {
this.paymentMethod = value;
},
// 从下往上弹出
toggle(val, type) {
// type 1为积分抵扣规则,2为优惠详情
this.popupType = val;
// open 方法传入参数 等同在 uni-popup 组件上绑定 type属性
if (this.popupType === 3) {
if (this.isDeduction) {
this.$refs.popup1.open(type);
}
} else {
this.$refs.popup.open(type);
}
if (this.popupType === 1) {
this.popupTitle = '积分抵扣规则'
} else if (this.popupType === 2) {
this.popupTitle = '优惠详情'
} else if (this.popupType === 3) {
this.popupTitle = '积分兑换'
}
},
// 关闭弹出层
closePopup(val) {
if (val === 1) {
this.$refs.popup.close()
if(this.isDeduction == 'true'){
this.toggle(3,'center')
}
} else {
this.$refs.popup1.close()
}
},
// 选择是否抵扣
selectDeduction(type) {
this.isDeduction = String(type);
},
// 确认积分兑换
confirmIntergralDeduction() {
},
},
onLoad(option) {
this.fileId = option.fileId;
this.orderId = option.orderId;
if (option.userId) {
this.userId = option.userId;
}
this.isRedirect = option.isRedirect;
if (this.isRedirect == 1 && uni.getStorageSync('cffp_userId')) {
uni.request({
url: '/api/authorize/obtainToken',
method: 'POST',
data: {ticket:'uni-app', loginId:uni.getStorageSync('cffp_userId')},
success: (res) => {
if (res.statusCode === 200) {
uni.setStorageSync('uni-token', res.data['data']['token']);
uni.setStorageSync('isLogin','1');
uni.setStorageSync('isH5', 1);
}
}
});
}
this.courseDetail();
this.queryByUserIdFortuneStatistic()
this.deviceType = common.checkDeviceType();
if (this.deviceType == 3) {
this.paymentMethod = 1;
}
if (this.isRedirect == 1) {
this.deductionCore = option.deductionCore;
this.amount = Number(option.amount);
this.isDeduction = String(option.isDeduction);
this.calculatedPrice = Number(this.amount);
setTimeout(() => {
this.pay();
}, 500)
}
},
mounted() {}
}
</script>
<style lang="scss">
.container {
position: relative;
height: 95vh;
.courseItemBox {
padding: 20rpx 30rpx;
background-color: #fff;
}
.popup-content {
.title {
display: flex;
justify-content: space-between;
align-items: baseline;
h3 {
text-align: center;
color: #333;
font-size: 32rpx;
margin-bottom: 30rpx;
}
.iconfont {
color: #999;
}
}
text {
color: #666;
font-size: 30rpx;
}
.deductionInfoItem {
display: flex;
justify-content: space-between;
align-items: center;
color: #333;
font-size: 30rpx;
padding: 10rpx 30rpx;
background-color: #F5f5f5;
border-radius: 20rpx;
min-height: 90rpx;
margin-top: 30rpx;
.integralInfoBox {
display: flex;
flex-direction: column;
margin-left: 10rpx;
text {
font-size: 30rpx;
color: #333333;
}
.deductionCount {
font-size: 36rpx;
color: #F15A1F;
}
}
.selectRadio {
color: #D8D8D8;
width: 40rpx;
height: 40rpx;
border: 1px solid #D8D8D8;
border-radius: 50%;
display: flex;
justify-content: center;
align-items: center;
}
&.actived {
border: 3rpx solid #20269B;
background-color: #fff;
.selectRadio {
background-color: #20269B;
color: #fff;
}
}
}
.integralDeductionContent {
.intergralItem {
display: flex;
justify-content: space-between;
margin-bottom: 10rpx;
}
}
.confirmBtn {
border-radius: 80rpx;
height: 80rpx;
width: 60%;
background-color: #20269B;
color: #fff;
margin: 64rpx auto 0;
display: flex;
justify-content: center;
align-items: center;
}
}
.popup1-content {
padding: 30rpx 34rpx 20rpx 42rpx;
border-radius: 20rpx;
.title {
display: flex;
justify-content: space-between;
align-items: baseline;
h3 {
text-align: center;
color: #333;
font-size: 32rpx;
margin-bottom: 30rpx;
}
.iconfont {
color: #999;
}
}
.integralDeductionContent {
.intergralItem {
display: flex;
justify-content: space-between;
color: #333;
font-size: 30rpx;
margin-bottom: 10rpx;
}
}
.confirmBtn {
border-radius: 80rpx;
height: 80rpx;
width: 60%;
background-color: #20269B;
color: #fff;
margin: 64rpx auto 0;
display: flex;
justify-content: center;
align-items: center;
}
}
.priceInfoContent,
.paymentMethodContent,
.totalContent {
background-color: #fff;
margin: 0 10rpx;
padding: 20rpx;
}
.priceInfoContent {
view {
display: flex;
justify-content: space-between;
text {
&:last-child {
font-weight: bold;
}
&.integralBox {
color: #FA6900;
font-weight: normal;
.iconfont {
color: #999;
}
}
}
.iconfont {
margin-left: 10rpx;
}
}
}
.priceInfoContent,
.paymentMethodContent {
border-bottom: 5px solid #fbfbfb;
color: #333;
h4 {
font-size: 32rpx;
margin-bottom: 20rpx;
}
view {
margin-bottom: 10rpx;
}
}
.paymentMethodContent {
.paymentItem {
display: flex;
align-items: center;
justify-content: space-between;
view {
display: flex;
align-items: center;
}
.icon-zhifubao {
color: #5A9EF7;
font-size: 60rpx;
margin-right: 20rpx;
}
.icon-py_weixinzhifu {
color: #09BB07;
font-size: 60rpx;
margin-right: 20rpx;
}
.selectRadio {
width: 40rpx;
height: 40rpx;
display: flex;
justify-content: center;
align-items: center;
border-radius: 50%;
border: 1px solid #D8D8D8;
color: transparent;
&.actived {
background-color: #0A2F99;
color: #fff;
}
}
}
}
.totalContent {
position: absolute;
bottom: 0;
left: 0;
width: 100%;
padding: 40rpx 28rpx;
display: flex;
align-items: center;
justify-content: space-between;
box-sizing: border-box;
.priceInfoBox {
font-size: 30rpx;
color: #333;
view:first-child {
margin-bottom: 10rpx;
}
}
.confirmOrder {
background-color: #20269B;
color: #fff;
padding: 14rpx 38rpx;
border-radius: 80rpx;
}
.gray {
background: #666;
}
}
}
.markBox {
position: fixed;
left: 0;
top: 0;
bottom: 0;
right: 0;
width: 100%;
height: 100%;
color: #fff;
display: flex;
justify-content: flex-end;
z-index: 100000;
background: rgba(0, 0, 0, 0.8);
.icon-liulanqi{
margin: 0px 10rpx;
color: #3b43d5;
background: #fff;
padding: 6rpx;
border-radius: 8rpx;
font-size: 36rpx;
}
.guideImgBox {
margin: 20px auto;
uni-image {
width: 25% !important;
position: absolute;
right: 0;
top: 0;
}
}
.tips {
margin-top: 20%;
padding: 0 30px;
}
}
// .iconfont {
// position: absolute;
// right: 8%;
// font-size: 40px;
// top: 2px;
// font-weight: bold;
// }
.tips p {
font-size: 18px;
margin-top: 10px;
text-align: justify;
letter-spacing: 1px;
}
</style>
......@@ -363,7 +363,7 @@
chart.setOption(this.option);
});
},
checkToken(){
/* checkToken(){
api.checkToken().then(res=>{
if(res['success']){}else{
api.obtainToken().then(res=>{
......@@ -373,7 +373,7 @@
})
}
})
},
}, */
radioChange: function(evt) {
for (let i = 0; i < this.chartsLegends.length; i++) {
if (this.chartsLegends[i].value === evt.detail.value) {
......@@ -738,7 +738,7 @@
// this.$refs.chart.init(echarts, chart => {
// chart.setOption(this.option);
// });
this.checkToken();
//this.checkToken();
}
}
</script>
......
......@@ -261,7 +261,7 @@
url:'/pages/product/finance-calculator'
})
},
checkToken(){
/* checkToken(){
api.checkToken().then(res=>{
if(res['success']){}else{
api.obtainToken().then(res=>{
......@@ -271,7 +271,7 @@
})
}
})
},
}, */
getFollowData(e){
this.isNeedOfficialAccountQrcode= ref(e);
console.log('父组件拿到值了',e);
......@@ -634,7 +634,7 @@
}
},
mounted() {
this.checkToken();
//this.checkToken();
}
}
......
// import {baseURL,apiURL,cffpURL} from "../environments/environment";
// 白名单,不需要携带token就允许被访问的接口
const whiteApiList = [`/api/authorize/obtainToken`, `/api/authorize/checkToken`];
export const interceptor = () => {
uni.addInterceptor('request', {
// 请求拦截器
invoke(args) {
// console.log('请求拦截器',args);
// 加载loading
// uni.showLoading({
// title: '加载中...'
// });
// 当本地没有token,并且接口地址没在白名单内,需要重新获取token
if (!uni.getStorageSync('uni-token') && !whiteApiList.includes(args.url)) {
uni.request({
url: '/api/authorize/obtainToken',
method: 'POST',
data: { ticket: 'uni-app' },
success: (res) => {
if (res.statusCode === 200) {
uni.setStorageSync('uni-token', res.data['data']['token']);
window.location.href = window.location.href + '?' + 't_reload=' + new Date().getTime();
}
// console.log(res)
}
})
// uni.hideLoading();
}
// request 触发前拼接 url
//设置请求头及token
args.header = {
'content-type': args.method === 'POST' ? 'application/json' : 'application/x-www-form-urlencoded',
'X-Authorization': uni.getStorageSync('uni-token') ? uni.getStorageSync('uni-token') : '',
// 'Access-Control-Allow-Headers': 'appId',
// 'Access-Control-Allow-Methods': 'POST, GET, OPTIONS',
// 'Access-Control-Max-Age': 86400,
}
// console.log(args.header)
},
// 响应拦截器,可以对数据进行预处理
success() {
// uni.hideLoading()
// console.log(args);
},
fail() {
// console.log('interceptor-fail', err)
// console.log('请求失败')
// uni.hideLoading()
},
complete() {
// uni.hideLoading()
}
})
}
// import {baseURL,apiURL,cffpURL} from "../environments/environment";
// 白名单,不需要携带token就允许被访问的接口
const whiteApiList = [`/api/authorize/obtainToken`, `/api/authorize/checkToken`];
export const interceptor = () => {
uni.addInterceptor('request', {
// 请求拦截器
invoke(args) {
// console.log('请求拦截器',args);
// 加载loading
// uni.showLoading({
// title: '加载中...'
// });
// 当本地没有token,并且接口地址没在白名单内,需要重新获取token
if (!uni.getStorageSync('uni-token') && !whiteApiList.includes(args.url)) {
const params = {
ticket:'uni-app',
loginId:null
}
let h5userId = uni.getStorageSync('cffp_userId');
if (h5userId) {
params.loginId = h5userId;
}
uni.request({
url: '/api/authorize/obtainToken',
method: 'POST',
data: params,
success: (res) => {
if (res.statusCode === 200) {
uni.setStorageSync('uni-token', res.data['data']['token']);
window.location.href = window.location.href + '?' + 't_reload=' + new Date().getTime();
}
}
})
}
// request 触发前拼接 url
//设置请求头及token
args.header = {
'content-type': args.method === 'POST' ? 'application/json' : 'application/x-www-form-urlencoded',
'X-Authorization': uni.getStorageSync('uni-token') ? uni.getStorageSync('uni-token') : '',
// 'Access-Control-Allow-Headers': 'appId',
// 'Access-Control-Allow-Methods': 'POST, GET, OPTIONS',
// 'Access-Control-Max-Age': 86400,
}
// console.log(args.header)
},
// 响应拦截器,可以对数据进行预处理
success() {
// uni.hideLoading()
// console.log(args);
},
fail() {
// console.log('interceptor-fail', err)
// console.log('请求失败')
// uni.hideLoading()
},
complete() {
// 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