Commit 68de31b4 by yuzhenWang

增加index.html解析参数

parent 69523651
...@@ -3,6 +3,36 @@ ...@@ -3,6 +3,36 @@
<head> <head>
<meta charset="UTF-8" /> <meta charset="UTF-8" />
<script> <script>
// ============ 新增:解析 URL 参数并设置状态栏占位 ============
//解决项目以h5的方式内嵌到app的webview中,手机状态栏和页面顶部内容重叠的问题
(function() {
function getQueryParam(name) {
// 从 hash 中提取查询参数
const hash = window.location.hash;
const queryIndex = hash.indexOf('?');
console.log('queryIndex', queryIndex);
if (queryIndex === -1) return null;
const queryString = hash.substring(queryIndex + 1);
const reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)');
const r = queryString.match(reg);
console.log('匹配结果', r);
if (r != null) return decodeURIComponent(r[2]);
return null;
}
const statusBarHeight = getQueryParam('statusBarHeight');
console.log('状态栏高度', statusBarHeight);
if (statusBarHeight) {
const height = parseInt(statusBarHeight, 10);
if (!isNaN(height) && height > 0) {
document.write('<style>' +
'html, body { margin:0; padding:0; height:100%; overflow:hidden; }' +
'body { padding-top: ' + height + 'px; box-sizing: border-box; }' +
'#app { height: 100%; overflow-y: auto; }' +
'</style>');
}
}
})();
// ============ 新增结束 ============
var coverSupport = 'CSS' in window && typeof CSS.supports === 'function' && (CSS.supports('top: env(a)') || var coverSupport = 'CSS' in window && typeof CSS.supports === 'function' && (CSS.supports('top: env(a)') ||
CSS.supports('top: constant(a)')) CSS.supports('top: constant(a)'))
document.write( document.write(
......
...@@ -29,7 +29,8 @@ ...@@ -29,7 +29,8 @@
<!-- 家办商城跳cffp的分享功能 --> <!-- 家办商城跳cffp的分享功能 -->
<!-- #ifdef H5 --> <!-- #ifdef H5 -->
<!-- v-if="!generatedImage" --> <!-- v-if="!generatedImage" -->
<view class="generateImageBox" ref="captureElement" v-if="!generatedImage"> <!-- 生成海报逻辑暂不需要 -->
<!-- <view class="generateImageBox" ref="captureElement" v-if="!generatedImage">
<view class="imgBox"> <view class="imgBox">
<img class="posterImg" @load="handleBgImageLoad" @error="handleBgImageError" style="display: block;" <img class="posterImg" @load="handleBgImageLoad" @error="handleBgImageError" style="display: block;"
:src="sharePosterItem.fileFirstImage+'?t='+Math.random()" crossorigin="anonymous" alt="防缓存图片" /> :src="sharePosterItem.fileFirstImage+'?t='+Math.random()" crossorigin="anonymous" alt="防缓存图片" />
...@@ -53,7 +54,7 @@ ...@@ -53,7 +54,7 @@
识别二维码查看商品 识别二维码查看商品
</view> </view>
</view> </view>
<!-- 二维码容器 -->
<view class="qrcode-container"> <view class="qrcode-container">
<canvas canvas-id="qrcode" class="qrcode-canvas" <canvas canvas-id="qrcode" class="qrcode-canvas"
:style="{width: qrCodeSize + 'px', height: qrCodeSize + 'px'}"></canvas> :style="{width: qrCodeSize + 'px', height: qrCodeSize + 'px'}"></canvas>
...@@ -61,7 +62,7 @@ ...@@ -61,7 +62,7 @@
</view> </view>
</view> </view>
</view> </view> -->
<!-- #endif --> <!-- #endif -->
<view class="productBox"> <view class="productBox">
<view class="productList" :style="{marginTop}"> <view class="productList" :style="{marginTop}">
......
<template> <template>
<view class="container"> <view class="container">
<!-- 禁用弹窗 --> <!-- 禁用弹窗 -->
<restrictedTip ref="restrictedTip"/> <restrictedTip ref="restrictedTip" />
<view style="flex: 1;"> <view style="flex: 1;">
<!-- #ifdef APP --> <!-- #ifdef APP -->
<view class="backArrow"> <view class="backArrow">
<text class="iconfont icon-youjiantou zuojiantou" style="left: 5rpx;" @click="goBack()"></text> <text class="iconfont icon-youjiantou zuojiantou" style="left: 5rpx;" @click="goBack()"></text>
</view> </view>
<!-- #endif --> <!-- #endif -->
<!-- 课程详情 --> <!-- 课程详情 -->
<template v-if="courseInfoItem"> <template v-if="courseInfoItem">
<view class="courseItemBox" > <view class="courseItemBox">
<course-item :thumbnailPath="courseInfoItem.displayImage" :title="courseInfoItem.fileTitle" <course-item :thumbnailPath="courseInfoItem.displayImage" :title="courseInfoItem.fileTitle"
:summaryBox="courseInfoItem.fileSynopsis" :summaryBox="courseInfoItem.fileSynopsis"
:dataList="{coursePrice:courseInfoItem.coursePrice,salesNumber:courseInfoItem.salesNumber}" :dataList="{coursePrice:courseInfoItem.coursePrice,salesNumber:courseInfoItem.salesNumber}"
:fileLecturerId="courseInfoItem.fileLecturerId" :fileId="fileId"></course-item> :fileLecturerId="courseInfoItem.fileLecturerId" :fileId="fileId"></course-item>
</view> </view>
</template> </template>
<!-- 价格明细 --> <!-- 价格明细 -->
<view class="priceInfoContent"> <view class="priceInfoContent">
<h4>价格明细</h4> <h4>价格明细</h4>
<view ><text class="txtFont">现价</text><text>¥{{Number(courseInfoItem.coursePrice).toFixed(2)}}</text></view> <view><text class="txtFont">现价</text><text>¥{{Number(courseInfoItem.coursePrice).toFixed(2)}}</text>
</view>
<view>
<text class="txtFont" @click="toggle(1,'bottom')">积分抵扣<i
class="iconfont icon-31tishi txtFont"></i></text>
<text class="integralBox" @click="toggle(2,'bottom')"
v-if="intergralInfo.preFortune">{{isDeduction != 'true' ? '未选' : '已选'}}积分,可抵扣{{deductionCore}}<i
class="iconfont icon-youjiantou iconStyle"></i></text>
<text style="color: #666666;font-size: 30rpx;" v-else>暂无积分</text>
</view>
<view><text class="txtFont">合计</text>
<text v-if="isRedirect == 1">{{calculatedPrice}}</text>
<text v-else>¥{{Number(totalPrice).toFixed(2)}}</text>
</view>
</view>
<!-- 支付方式 -->
<view class="paymentMethodContent">
<h4>选择支付方式</h4>
<view @click="selectPaymentMethod(2)">
<view class="paymentItem" v-if="runEnv!=='wechat-miniprogram'">
<view> <view>
<text class="txtFont" @click="toggle(1,'bottom')">积分抵扣<i class="iconfont icon-31tishi txtFont"></i></text> <i class="iconfont icon-zhifubao"></i>
<text class="integralBox" @click="toggle(2,'bottom')" <text class="txtFont">支付宝支付</text>
v-if="intergralInfo.preFortune">{{isDeduction != 'true' ? '未选' : '已选'}}积分,可抵扣{{deductionCore}}<i
class="iconfont icon-youjiantou iconStyle"></i></text>
<text style="color: #666666;font-size: 30rpx;" v-else>暂无积分</text>
</view> </view>
<view><text class="txtFont">合计</text> <view class="selectRadio" :class="{'actived':paymentMethod===2}">
<text v-if="isRedirect == 1">{{calculatedPrice}}</text> <i class="iconfont icon-duihao txtFont"></i>
<text v-else>¥{{Number(totalPrice).toFixed(2)}}</text>
</view> </view>
</view> </view>
<!-- 支付方式 -->
<view class="paymentMethodContent"> </view>
<h4>选择支付方式</h4> <view class="paymentItem" @click="selectPaymentMethod(1)" v-if="deviceType==3">
<view @click="selectPaymentMethod(2)" > <view>
<view class="paymentItem" v-if="runEnv!=='wechat-miniprogram'"> <i class="iconfont icon-py_weixinzhifu txtFont"></i>
<view> <text>微信支付</text>
<i class="iconfont icon-zhifubao"></i> </view>
<text class="txtFont">支付宝支付</text> <view class="selectRadio" :class="{'actived':paymentMethod===1}">
</view> <i class="iconfont icon-duihao txtFont"></i>
<view class="selectRadio" :class="{'actived':paymentMethod===2}"> </view>
<i class="iconfont icon-duihao txtFont"></i> </view>
</view> <!-- #ifdef APP-PLUS -->
</view> <!-- <view class="paymentItem" @click="selectPaymentMethod(1)">
</view>
<view class="paymentItem" @click="selectPaymentMethod(1)" v-if="deviceType==3">
<view>
<i class="iconfont icon-py_weixinzhifu txtFont"></i>
<text>微信支付</text>
</view>
<view class="selectRadio" :class="{'actived':paymentMethod===1}">
<i class="iconfont icon-duihao txtFont"></i>
</view>
</view>
<!-- #ifdef APP-PLUS -->
<!-- <view class="paymentItem" @click="selectPaymentMethod(1)">
<view> <view>
<i class="iconfont icon-py_weixinzhifu"></i> <i class="iconfont icon-py_weixinzhifu"></i>
<text>微信支付</text> <text>微信支付</text>
...@@ -69,10 +71,10 @@ ...@@ -69,10 +71,10 @@
<i class="iconfont icon-duihao"></i> <i class="iconfont icon-duihao"></i>
</view> </view>
</view> --> </view> -->
<!-- #endif --> <!-- #endif -->
</view> </view>
</view> </view>
<!-- 底部 --> <!-- 底部 -->
<view class="totalContent"> <view class="totalContent">
<view class="priceInfoBox"> <view class="priceInfoBox">
...@@ -110,7 +112,8 @@ ...@@ -110,7 +112,8 @@
</view> </view>
<view v-if="popupType===1"><text>1积分=1元,积分抵扣如同现金,所有产品均可使用</text></view> <view v-if="popupType===1"><text>1积分=1元,积分抵扣如同现金,所有产品均可使用</text></view>
<view v-if="popupType===2"> <view v-if="popupType===2">
<view class="deductionInfoItem" :class="{'actived':isDeduction == 'true'}" @click="selectDeduction(true)"> <view class="deductionInfoItem" :class="{'actived':isDeduction == 'true'}"
@click="selectDeduction(true)">
<view style="display: flex;"> <view style="display: flex;">
<text>可抵扣</text> <text>可抵扣</text>
<view class="integralInfoBox"> <view class="integralInfoBox">
...@@ -122,7 +125,8 @@ ...@@ -122,7 +125,8 @@
<i class="iconfont icon-duihao " style="font-size: 28rpx;"></i> <i class="iconfont icon-duihao " style="font-size: 28rpx;"></i>
</view> </view>
</view> </view>
<view class="deductionInfoItem" :class="{'actived':isDeduction == 'false'}" @click="selectDeduction(false)"> <view class="deductionInfoItem" :class="{'actived':isDeduction == 'false'}"
@click="selectDeduction(false)">
<view> <view>
<text>不使用积分抵扣</text> <text>不使用积分抵扣</text>
</view> </view>
...@@ -170,7 +174,7 @@ ...@@ -170,7 +174,7 @@
<view class="tips"> <view class="tips">
<!-- <view class="text-center">请点击右上角菜单</view> --> <!-- <view class="text-center">请点击右上角菜单</view> -->
<view style="line-height: 60rpx;">戳这里,点击<text class="iconfont icon-liulanqi"></text> <view style="line-height: 60rpx;">戳这里,点击<text class="iconfont icon-liulanqi"></text>
按钮,使用系统浏览器打开页面完成支付,完成后请返回微信,到【我的->成交订单】下,查看购买订单。</view> 按钮,使用系统浏览器打开页面完成支付,完成后请返回微信,到【我的->成交订单】下,查看购买订单。</view>
</view> </view>
</view> </view>
</view> </view>
...@@ -180,8 +184,8 @@ ...@@ -180,8 +184,8 @@
<script> <script>
import api from "@/api/api"; import api from "@/api/api";
import courseItem from "@/components/courseItem/courseItem.vue"; import courseItem from "@/components/courseItem/courseItem.vue";
import {apiURL,companyInfo,shareURL} from "@/environments/environment"; import { apiURL, companyInfo, shareURL } from "@/environments/environment";
import {nextTick} from "vue"; import { nextTick } from "vue";
import common from '../../common/common'; import common from '../../common/common';
import { initJssdkShare, setWechatShare } from '@/util/fiveshare'; import { initJssdkShare, setWechatShare } from '@/util/fiveshare';
import dataHandling from "@/util/dataHandling"; import dataHandling from "@/util/dataHandling";
...@@ -215,10 +219,10 @@ ...@@ -215,10 +219,10 @@
isRedirect: null, isRedirect: null,
amount: 0, amount: 0,
calculatedPrice: 0, calculatedPrice: 0,
dataToken:'', dataToken: '',
oldToken:'',//原始用户token oldToken: '', //原始用户token
pollTimer:'', pollTimer: '',
runEnv:dataHandling.h5RuntimeEnv() runEnv: dataHandling.h5RuntimeEnv()
} }
}, },
computed: { computed: {
...@@ -239,38 +243,38 @@ ...@@ -239,38 +243,38 @@
} }
} }
}, },
methods: { methods: {
queryInfo() { queryInfo() {
api.queryInfo({userId:uni.getStorageSync('cffp_userId')}).then(res=>{ api.queryInfo({ userId: uni.getStorageSync('cffp_userId') }).then(res => {
// 保存用户得个人信息 // 保存用户得个人信息
if (res['success']) { if (res['success']) {
delete res.data.commonResult delete res.data.commonResult
const cffp_userInfo = { const cffp_userInfo = {
...res.data ...res.data
} }
// 账号禁用用户 // 账号禁用用户
if(res.data.userIsActive&&res.data.userIsActive==2){ if (res.data.userIsActive && res.data.userIsActive == 2) {
this.$refs.restrictedTip.open() this.$refs.restrictedTip.open()
uni.setStorageSync('userIsActive',String(res.data.userIsActive)) uni.setStorageSync('userIsActive', String(res.data.userIsActive))
return return
} }
if(res.data.userIsActive&&res.data.userIsActive!=2){ if (res.data.userIsActive && res.data.userIsActive != 2) {
this.$refs.restrictedTip.close() this.$refs.restrictedTip.close()
uni.removeStorageSync('userIsActive') uni.removeStorageSync('userIsActive')
} }
uni.setStorageSync('cffp_userInfo', JSON.stringify(cffp_userInfo)); uni.setStorageSync('cffp_userInfo', JSON.stringify(cffp_userInfo));
uni.setStorageSync('user_mobile', res.data.mobile) uni.setStorageSync('user_mobile', res.data.mobile)
} }
}) })
}, },
goBack() { goBack() {
uni.navigateBack({ uni.navigateBack({
delta: 1 delta: 1
}); });
}, },
// 支付 // 支付
...@@ -290,7 +294,7 @@ ...@@ -290,7 +294,7 @@
fileId: this.fileId, fileId: this.fileId,
companyType: companyInfo.companyType, companyType: companyInfo.companyType,
} }
if (this.paymentMethod == 1) { if (this.paymentMethod == 1) {
// APP:微信app支付 // APP:微信app支付
// #ifdef APP-PLUS // #ifdef APP-PLUS
...@@ -298,16 +302,17 @@ ...@@ -298,16 +302,17 @@
api.unifiedPay(param).then(res => { api.unifiedPay(param).then(res => {
this.paymentBtnDisabled = false; this.paymentBtnDisabled = false;
if (res['success']) { if (res['success']) {
const prepayId = res['data']['prepayId'];//统一下单订单号 如果为空,代表0元订单支付成功 const prepayId = res['data']['prepayId']; //统一下单订单号 如果为空,代表0元订单支付成功
if(prepayId){ if (prepayId) {
const orderInfoParam = { const orderInfoParam = {
"appid": res['data']['appid'], // 微信开放平台 - 应用 - AppId,注意和微信小程序、公众号 AppId 可能不一致 "appid": res['data'][
"noncestr": res['data']['noncestr'], // 随机字符串 'appid'], // 微信开放平台 - 应用 - AppId,注意和微信小程序、公众号 AppId 可能不一致
"package": res['data']['packAge'], // 固定值 "noncestr": res['data']['noncestr'], // 随机字符串
"package": res['data']['packAge'], // 固定值
"partnerid": res['data']['partnerid'], // 微信支付商户号 "partnerid": res['data']['partnerid'], // 微信支付商户号
"prepayid": prepayId, // 统一下单订单号 "prepayid": prepayId, // 统一下单订单号
"timestamp": res['data']['timeStamp'], // 时间戳(单位:秒) "timestamp": res['data']['timeStamp'], // 时间戳(单位:秒)
"sign": res['data']['sign'] // 签名,这里用的 MD5/RSA 签名 "sign": res['data']['sign'] // 签名,这里用的 MD5/RSA 签名
} }
let _this = this let _this = this
uni.requestPayment({ uni.requestPayment({
...@@ -324,7 +329,7 @@ ...@@ -324,7 +329,7 @@
}) })
} }
}); });
}else { } else {
uni.navigateTo({ uni.navigateTo({
url: `/pages/orderStatus/orderStatus?orderId=${this.orderId}&fileId=${this.fileId}&orderStatus=2&userId=${this.userId}&isRedirect=1` url: `/pages/orderStatus/orderStatus?orderId=${this.orderId}&fileId=${this.fileId}&orderStatus=2&userId=${this.userId}&isRedirect=1`
}) })
...@@ -348,13 +353,13 @@ ...@@ -348,13 +353,13 @@
//deviceType:PC为1,移动端为2,微信为3 //deviceType:PC为1,移动端为2,微信为3
if (this.deviceType == 3) { if (this.deviceType == 3) {
// 向小程序通信 // 向小程序通信
if(dataHandling.h5RuntimeEnv()=='wechat-miniprogram'){ if (dataHandling.h5RuntimeEnv() == 'wechat-miniprogram') {
this.paymentBtnDisabled = false; this.paymentBtnDisabled = false;
// 跳转到小程序消息接收中转页面,拉起小程序的支付 // 跳转到小程序消息接收中转页面,拉起小程序的支付
wx.miniProgram.navigateTo({ wx.miniProgram.navigateTo({
url: `/myPackageA/h5Pay/appYdhomeofficePay?param=${encodeURIComponent(JSON.stringify(param))}` url: `/myPackageA/h5Pay/appYdhomeofficePay?param=${encodeURIComponent(JSON.stringify(param))}`
}) })
return return
} }
let _this = this let _this = this
...@@ -366,7 +371,7 @@ ...@@ -366,7 +371,7 @@
// }) // })
api.wxAuthorize(param).then((res) => { api.wxAuthorize(param).then((res) => {
_this.paymentBtnDisabled = false; _this.paymentBtnDisabled = false;
if (res['success']) { if (res['success']) {
if (param.amount == '0.00') { if (param.amount == '0.00') {
uni.navigateTo({ uni.navigateTo({
...@@ -376,7 +381,7 @@ ...@@ -376,7 +381,7 @@
} else { } else {
window.location.href = res['data']['paymentForm']['action']; window.location.href = res['data']['paymentForm']['action'];
} }
}else{ } else {
uni.showToast({ uni.showToast({
title: res['message'], title: res['message'],
duration: 2000, duration: 2000,
...@@ -402,7 +407,7 @@ ...@@ -402,7 +407,7 @@
provider: 'alipay', provider: 'alipay',
orderInfo: aliOrderString, orderInfo: aliOrderString,
success: function(resp) { success: function(resp) {
uni.navigateTo({ uni.navigateTo({
url: `/pages/orderStatus/orderStatus?orderId=${_this.orderId}&fileId=${_this.fileId}&orderStatus=2&userId=${_this.userId}&isRedirect=1` url: `/pages/orderStatus/orderStatus?orderId=${_this.orderId}&fileId=${_this.fileId}&orderStatus=2&userId=${_this.userId}&isRedirect=1`
}) })
...@@ -458,8 +463,8 @@ ...@@ -458,8 +463,8 @@
} }
}, },
getunifiedPay(param){ getunifiedPay(param) {
api.unifiedPay(param).then((res) => { api.unifiedPay(param).then((res) => {
const data = res['data']; const data = res['data'];
this.paymentBtnDisabled = false; this.paymentBtnDisabled = false;
...@@ -507,7 +512,7 @@ ...@@ -507,7 +512,7 @@
}).then(res => { }).then(res => {
if (res['success']) { if (res['success']) {
this.courseInfoItem = res['data']['data']; this.courseInfoItem = res['data']['data'];
console.log('this.courseInfoItem',this.courseInfoItem); console.log('this.courseInfoItem', this.courseInfoItem);
} }
}) })
}, },
...@@ -538,10 +543,10 @@ ...@@ -538,10 +543,10 @@
// 关闭弹出层 // 关闭弹出层
closePopup(val) { closePopup(val) {
if (val === 1) { if (val === 1) {
this.$refs.popup.close() this.$refs.popup.close()
if(this.isDeduction == 'true'){ if (this.isDeduction == 'true') {
this.toggle(3,'center') this.toggle(3, 'center')
} }
} else { } else {
this.$refs.popup1.close() this.$refs.popup1.close()
...@@ -572,122 +577,136 @@ ...@@ -572,122 +577,136 @@
}, 500) }, 500)
} }
}, },
reLogin(option,flag){ reLogin(option, flag) {
uni.showLoading({ uni.showLoading({
title: '加载中...' title: '加载中...'
}); });
const params = { const params = {
loginType:'5', loginType: '5',
authToken: uni.getStorageSync('dataToken'), authToken: uni.getStorageSync('dataToken'),
visitorUuid:uni.getStorageSync('visitorUuid')?uni.getStorageSync('visitorUuid'):dataHandling.uuid() visitorUuid: uni.getStorageSync('visitorUuid') ? uni.getStorageSync('visitorUuid') : dataHandling
} .uuid()
api.loginVerification(params).then((res)=>{ }
if(res['success']){ api.loginVerification(params).then((res) => {
if (res['success']) {
// 之前没使用过系统没有userid,登录并写入缓存
if(flag=='1'){ // 之前没使用过系统没有userid,登录并写入缓存
uni.setStorageSync('isLogin','1'); if (flag == '1') {
uni.setStorageSync('loginType','codelogin'); uni.setStorageSync('isLogin', '1');
uni.setStorageSync('cffp_userId', res.data.userId); uni.setStorageSync('loginType', 'codelogin');
uni.setStorageSync('uni-token', res.data['token']); uni.setStorageSync('cffp_userId', res.data.userId);
uni.setStorageSync('visitorUuid', res.data['visitorUuid']); uni.setStorageSync('uni-token', res.data['token']);
}else if(flag=='2'){ uni.setStorageSync('visitorUuid', res.data['visitorUuid']);
// 有userid,直接可以购买但付款人只是帮订单账号付钱,购买成功还是进入到付款人的账号 } else if (flag == '2') {
this.oldToken = uni.getStorageSync('uni-token') // 有userid,直接可以购买但付款人只是帮订单账号付钱,购买成功还是进入到付款人的账号
uni.setStorageSync('oldToken', this.oldToken); this.oldToken = uni.getStorageSync('uni-token')
uni.setStorageSync('uni-token', res.data['token']); uni.setStorageSync('oldToken', this.oldToken);
} uni.setStorageSync('uni-token', res.data['token']);
this.userId = res.data.userId
this.dataToken = ''
}else{
uni.showToast({
title: res['message'],
duration: 2000,
icon: 'none'
})
} }
}) this.userId = res.data.userId
uni.hideLoading() this.dataToken = ''
} else {
uni.showToast({
title: res['message'],
duration: 2000,
icon: 'none'
})
}
})
uni.hideLoading()
}, },
}, },
onLoad(option) { onLoad(option) {
if(uni.getStorageSync('dataToken')){ if (uni.getStorageSync('dataToken')) {
this.dataToken = uni.getStorageSync('dataToken') this.dataToken = uni.getStorageSync('dataToken')
} }
if(uni.getStorageSync('dataToken')){ if (uni.getStorageSync('dataToken')) {
// 没有使用过系统或者之前使用过但未登录 // 没有使用过系统或者之前使用过但未登录
if(!uni.getStorageSync('cffp_userId')|| (uni.getStorageSync('cffp_userId')&&uni.getStorageSync('loginType')=='visitor')){ if (!uni.getStorageSync('cffp_userId') || (uni.getStorageSync('cffp_userId') && uni.getStorageSync(
this.reLogin(option,'1') 'loginType') == 'visitor')) {
}else if(uni.getStorageSync('cffp_userId')!=option.userId){ this.reLogin(option, '1')
} else if (uni.getStorageSync('cffp_userId') != option.userId) {
// 付钱的人和分享的人不一样 // 付钱的人和分享的人不一样
this.reLogin(option,'2') this.reLogin(option, '2')
} }
} }
dataHandling.pocessTracking(
'购买',
`用户进入到订单确认页`,
'进入',
2,
'订单确认页',
'',
`/pages/orderConfirm/orderConfirm?fileId=${option.fileId}&orderId=${option.orderId}&userId=${option.userId}`
)
this.fileId = Number(option.fileId); this.fileId = Number(option.fileId);
this.orderId = option.orderId; this.orderId = option.orderId;
if (option.userId) { if (option.userId) {
this.userId = option.userId; this.userId = option.userId;
} }
this.isRedirect = option.isRedirect; this.isRedirect = option.isRedirect;
if (this.isRedirect == 1 && option.userId) { if (this.isRedirect == 1 && option.userId) {
uni.request({ uni.request({
url: `${apiURL}/authorize/obtainToken`, url: `${apiURL}/authorize/obtainToken`,
method: 'POST', method: 'POST',
data: {ticket:'uni-app', loginId:option.userId}, data: { ticket: 'uni-app', loginId: option.userId },
success: (res) => { success: (res) => {
if (res.statusCode === 200) { if (res.statusCode === 200) {
uni.setStorageSync('uni-token', res.data['data']['token']); uni.setStorageSync('uni-token', res.data['data']['token']);
uni.setStorageSync('cffp_userId', option.userId); uni.setStorageSync('cffp_userId', option.userId);
uni.setStorageSync('isLogin','1'); uni.setStorageSync('isLogin', '1');
uni.setStorageSync('isH5', 1); uni.setStorageSync('isH5', 1);
this.courseDetailLoad(option); this.courseDetailLoad(option);
} }
} }
}); });
}else{ } else {
this.courseDetailLoad(option); this.courseDetailLoad(option);
} }
}, },
onShow() { onShow() {
if(uni.getStorageSync('loginType')=='codelogin'){ if (uni.getStorageSync('loginType') == 'codelogin') {
this.queryInfo() this.queryInfo()
} }
// #ifdef H5 // #ifdef H5
initJssdkShare(() => { initJssdkShare(() => {
setWechatShare(); setWechatShare();
}, window.location.href); }, window.location.href);
// #endif // #endif
}, },
beforeUnmount() { beforeUnmount() {
// window.removeEventListener('pageshow', this.handlePageShow); // window.removeEventListener('pageshow', this.handlePageShow);
}, },
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
::v-deep .uni-popup .uni-popup__wrapper{ ::v-deep .uni-popup .uni-popup__wrapper {
margin: 0 !important; margin: 0 !important;
} }
.container { .container {
// position: relative; // position: relative;
width: 100%; width: 100%;
box-sizing: border-box; box-sizing: border-box;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
.backArrow{
.backArrow {
box-sizing: border-box; box-sizing: border-box;
display: flex; display: flex;
height: 100rpx; height: 100rpx;
...@@ -698,15 +717,18 @@ ...@@ -698,15 +717,18 @@
margin-bottom: 10rpx; margin-bottom: 10rpx;
color: #333333; color: #333333;
background-color: #fff; background-color: #fff;
text:nth-child(2){
text:nth-child(2) {
width: 100%; width: 100%;
text-align: center; text-align: center;
position: absolute; position: absolute;
} }
} }
.txtFont{
.txtFont {
font-size: 27rpx; font-size: 27rpx;
} }
.courseItemBox { .courseItemBox {
margin: 20rpx; margin: 20rpx;
border-radius: 10rpx; border-radius: 10rpx;
...@@ -719,6 +741,7 @@ ...@@ -719,6 +741,7 @@
padding: 20rpx; padding: 20rpx;
box-sizing: border-box; box-sizing: border-box;
width: 100%; width: 100%;
.title { .title {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
...@@ -872,7 +895,7 @@ ...@@ -872,7 +895,7 @@
view { view {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
text { text {
&:last-child { &:last-child {
font-weight: bold; font-weight: bold;
...@@ -913,8 +936,8 @@ ...@@ -913,8 +936,8 @@
.paymentMethodContent { .paymentMethodContent {
margin-top: 20rpx; margin-top: 20rpx;
.paymentItem { .paymentItem {
display: flex; display: flex;
align-items: center; align-items: center;
...@@ -1005,7 +1028,8 @@ ...@@ -1005,7 +1028,8 @@
justify-content: flex-end; justify-content: flex-end;
z-index: 100000; z-index: 100000;
background: rgba(0, 0, 0, 0.8); background: rgba(0, 0, 0, 0.8);
.icon-liulanqi{
.icon-liulanqi {
margin: 0px 10rpx; margin: 0px 10rpx;
color: #3b43d5; color: #3b43d5;
background: #fff; background: #fff;
...@@ -1013,9 +1037,10 @@ ...@@ -1013,9 +1037,10 @@
border-radius: 8rpx; border-radius: 8rpx;
font-size: 36rpx; font-size: 36rpx;
} }
.guideImgBox { .guideImgBox {
margin: 20px auto; margin: 20px auto;
uni-image { uni-image {
width: 25% !important; width: 25% !important;
position: absolute; position: absolute;
...@@ -1023,7 +1048,7 @@ ...@@ -1023,7 +1048,7 @@
top: 0; top: 0;
} }
} }
.tips { .tips {
margin-top: 20%; margin-top: 20%;
padding: 0 30px; padding: 0 30px;
...@@ -1043,4 +1068,4 @@ ...@@ -1043,4 +1068,4 @@
text-align: justify; text-align: justify;
letter-spacing: 1px; letter-spacing: 1px;
} }
</style> </style>
\ No newline at end of file
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