一些优化

This commit is contained in:
haomingming 2025-09-04 17:34:47 +08:00
parent b068fb00cc
commit 4659f30400
18 changed files with 508 additions and 87 deletions

View File

@ -297,6 +297,14 @@ const api = {
return request('/expertAPI/modifyMobile', data, 'post', false);
},
pointTicketlist(data){
return request('/expertAPI/pointTicketlist', data, 'post', false);
},
pointTicketExchange(data){
return request('/expertAPI/updateStatus', data, 'post', false);
},
smsSend(data){
return request('/expertAPI/smsSend', data, 'post', false);
},

View File

@ -23,7 +23,34 @@ const course_api = {
// 创建订单
createExcellencourseMixedOrder(id, order_pay_type, openid) {
return request('/expertPay/createExcellencourseOrder', {appid:"wx061c1f4e16a5f20f", openid: openid, excellencourse_id: id, order_pay_type: order_pay_type}, 'post', true);
let appid = "wx061c1f4e16a5f20f"
if (process.env.UNI_PLATFORM == "h5") {
appid = "wx061c1f4e16a5f20f"
} else if(process.env.UNI_PLATFORM == "mp-weixin") {
appid = "wx061c1f4e16a5f20f"
}else{
//app
appid = "wxbf3658f5e674667c"
}
return request('/expertPay/createExcellencourseOrder', {appid:appid, openid: openid, excellencourse_id: id, order_pay_type: order_pay_type}, 'post', true);
},
payExcellencourseOrderContinue(order_id, openid) {
let appid = "wx061c1f4e16a5f20f"
if (process.env.UNI_PLATFORM == "h5") {
appid = "wx061c1f4e16a5f20f"
} else if(process.env.UNI_PLATFORM == "mp-weixin") {
appid = "wx061c1f4e16a5f20f"
}else{
//app
appid = "wxbf3658f5e674667c"
}
return request('/expertPay/payExcellencourseOrderContinue', {order_id: order_id, appid:appid, openid: openid}, 'post', true);
},
cancelExcellencourseOrder(order_id) {
return request('/expertPay/cancelExcellencourseOrder', {excellencourse_order_id: order_id}, 'post', true);
},
// 订单列表

View File

@ -1,6 +1,6 @@
{
"name" : "uniapp",
"appid" : "__UNI__34144D0",
"appid" : "__UNI__C3DFBD4",
"description" : "",
"versionName" : "1.0.0",
"versionCode" : "100",
@ -44,7 +44,9 @@
],
"abiFilters" : [ "armeabi-v7a", "arm64-v8a", "x86" ]
},
"ios" : {},
"ios" : {
"dSYMs" : false
},
/* ios */
"sdkConfigs" : {
"oauth" : {
@ -55,7 +57,6 @@
}
},
"payment" : {
"appleiap" : {},
"weixin" : {
"__platform__" : [ "ios", "android" ],
"appid" : "wxbf3658f5e674667c",
@ -92,5 +93,8 @@
},
"usingComponents" : true
},
"vueVersion" : "3"
"vueVersion" : "3",
"uniStatistics" : {
"version" : "2"
}
}

View File

@ -748,6 +748,16 @@
{
"root": "pages_goods",
"pages": [
{
"path": "coupon/coupon",
"style": {
"navigationStyle": "custom",
"navigationBarTitleText": "积分券",
"app": {
"bounce": "none"
}
}
},
{
"path": "pointMall/pointMall",
"style": {
@ -824,7 +834,7 @@
"list": [
{
"name": "", //
"path": "pages_app/videoDetail/videoDetail", //
"path": "pages/index/index", //
"query": "" //onLoad
}
]

View File

@ -124,7 +124,7 @@
</view>
<!-- 浮动签到按钮 -->
<view class="floating-checkin" @click="performCheckin" :class="{ loading: loading }">
<!-- <view class="floating-checkin" @click="performCheckin" :class="{ loading: loading }">
<view class="checkin-icon">
<text class="calendar-icon">📅</text>
<text class="checkmark"></text>
@ -133,7 +133,7 @@
<text class="checkin-label">{{ loading ? '签到中...' : '点击签到' }}</text>
<text class="checkin-reward">+2</text>
</view>
</view>
</view> -->
<!-- 底部导航 -->
<view class="bottom-nav">
@ -249,10 +249,13 @@
//
const goToPointsCoupon = () => {
uni.showToast({
title: '积分券功能开发中',
icon: 'none'
uni.navigateTo({
url: '/pages_goods/coupon/coupon'
});
// uni.showToast({
// title: '',
// icon: 'none'
// });
};
const goToBuyPoints = () => {
@ -263,7 +266,7 @@
const goToPointsMall = () => {
uni.navigateTo({
url: '/pages_app/pointMall/pointMall'
url: '/pages_goods/pointMall/pointMall'
});
};

View File

@ -102,7 +102,8 @@
import eyeOpenImg from "@/static/eye_open.png"
import eyeCloseImg from "@/static/eye_close.png"
import api from "@/api/api.js"
import BASE_URL from "@/utils/config.js";
const customStyle = reactive({
height: "100rpx",
fontSize: "36rpx",
@ -226,16 +227,35 @@
uni.setStorageSync('DEV_AUTH_YX_TOKEN_App', result.YX_token);
uni.setStorageSync('userInfo', result.data);
}
}else{
if (BASE_URL.indexOf('dev') == -1) {
uni.setStorageSync('AUTH_TOKEN_App',result.access_token);
uni.setStorageSync('AUTH_YX_ACCID_App', result.YX_accid);
uni.setStorageSync('AUTH_YX_TOKEN_App', result.YX_token);
uni.setStorageSync('userInfo', result.data);
} else {
uni.setStorageSync('DEV_AUTH_TOKEN_App', result.access_token);
uni.setStorageSync('DEV_AUTH_YX_ACCID_App', result.YX_accid);
uni.setStorageSync('DEV_AUTH_YX_TOKEN_App', result.YX_token);
uni.setStorageSync('userInfo', result.data);
}
}
console.log(uni.getStorageSync('userInfo'))
console.log(1)
uni.hideLoading();
console.log(2)
uni.showToast({
title: '登录成功',
icon: 'success'
});
console.log(3)
uni.redirectTo({
url:'/pages_course/course/course'
url:'/pages/index/index'
})
console.log(4)
})
//
// setTimeout(() => {

View File

@ -295,17 +295,14 @@
<script setup>
import { ref, onMounted, onUnmounted } from 'vue'
import course_api from "@/api/course_api.js"
import { onLoad } from '@dcloudio/uni-app'
const courseId = ref(0)
onMounted(() => {
//
const pages = getCurrentPages()
const currentPage = pages[pages.length - 1]
const options = currentPage.options || {}
courseId.value = options.id
console.log('课程ID:', options.id)
onLoad((options) => {
courseId.value = options.id // App-Plus
console.log('课程ID:', options.id)
})
const courseId = ref(0)
//
@ -762,7 +759,6 @@ const updatePageData = (data) => {
}
}
//
onMounted(() => {
getSystemInfo()
startCountdown()

View File

@ -146,6 +146,8 @@
<script setup>
import { ref, onMounted } from 'vue'
import course_api from '@/api/course_api'
import { onLoad } from '@dcloudio/uni-app'
//
const statusBarHeight = ref(0)
@ -327,18 +329,17 @@ const onSortChange = (e) => {
filterCourses()
}
//
onMounted(() => {
//
const pages = getCurrentPages()
const currentPage = pages[pages.length - 1]
const options = currentPage.options || {}
onLoad((options) => {
type_id.value = options.type
special_type.value = options.special_type
special_name.value = options.special_name
console.log('特殊类型ID:', options.special_type)
console.log('类型ID:', options.type)
})
//
onMounted(() => {
getSystemInfo()
if(type_id.value > 0){
getSecondType()

View File

@ -90,6 +90,10 @@ import { ref, onMounted, computed } from 'vue'
import course_api from "@/api/course_api.js"
import { requestPayment } from '@/utils/payment.js'
import { onLoad } from '@dcloudio/uni-app'
//
const statusBarHeight = ref(0)
const navBarHeight = ref(88)
@ -201,14 +205,27 @@ const confirmPayment = () => {
return
}
order_pay_type.value = computeOrderPayType()
console.log('确认支付,支付方式:', { usePoints: usePoints.value, useBalance: useBalance.value, order_pay_type: order_pay_type.value })
let openid = ""
if (process.env.NODE_ENV === 'development') {
openid = uni.getStorageSync('DEV_APPID');
} else {
openid = uni.getStorageSync('AUTH_APPID');
if (process.env.UNI_PLATFORM == "h5") {
if (process.env.NODE_ENV === 'development') {
openid = uni.getStorageSync('DEV_APPID');
} else {
openid = uni.getStorageSync('AUTH_APPID');
}
} else if(process.env.UNI_PLATFORM == "mp-weixin") {
const {
envVersion
} = uni.getAccountInfoSync().miniProgram;
if (envVersion == "release") {
openid = uni.getStorageSync('DEV_APPID');
} else {
openid = uni.getStorageSync('AUTH_APPID');
}
}else{
//app
}
course_api.createExcellencourseMixedOrder(courseId.value, order_pay_type.value, openid).then(res => {
console.log('创建订单:', res)
@ -313,15 +330,13 @@ const updatePaymentMethod = () => {
}
}
onLoad((options) => {
courseId.value = options.id // App-Plus
console.log('课程ID:', options.id)
})
//
onMounted(() => {
//
const pages = getCurrentPages()
const currentPage = pages[pages.length - 1]
const options = currentPage.options || {}
courseId.value = options.id
console.log('课程ID:', options.id)
getSystemInfo()
getCourseInfo()
})

View File

@ -63,6 +63,8 @@
<script setup>
import { ref, onMounted } from 'vue'
import course_api from "@/api/course_api.js"
import { onLoad } from '@dcloudio/uni-app'
//
const statusBarHeight = ref(0)
@ -150,18 +152,17 @@ const goBack = () => {
uni.navigateBack()
}
//
onMounted(() => {
getSystemInfo()
//
const pages = getCurrentPages()
const currentPage = pages[pages.length - 1]
const options = currentPage.options || {}
onLoad((options) => {
is_commented.value = options.is_commented
courseId.value = options.id
console.log('课程ID:', options.id)
})
//
onMounted(() => {
getSystemInfo()
})
</script>
<style lang="scss">

View File

@ -122,6 +122,7 @@
<script setup>
import { ref, onMounted } from 'vue'
import course_api from "@/api/course_api.js"
import { onLoad } from '@dcloudio/uni-app'
const invoice_id = ref('')
@ -312,15 +313,14 @@ const loadInvoiceData = () => {
})
}
onLoad((options) => {
invoice_id.value = options.invoice_id // App-Plus
console.log('发票ID:', options.invoice_id)
})
onMounted(() => {
getSystemInfo()
const pages = getCurrentPages()
const currentPage = pages[pages.length - 1]
const options = currentPage.options || {}
invoice_id.value = options.invoice_id
if (!invoice_id.value) {
hasError.value = true
isLoading.value = false

View File

@ -67,8 +67,8 @@
</view>
<!-- 剩余时间仅未支付订单显示 -->
<view class="remaining-time" v-if="order.remainingTime && activeTab === 'unpaid'">
<text class="time-text">剩余时间: {{ order.remainingTime }}</text>
<view class="remaining-time" v-if="order.expire_time && activeTab === 'unpaid'">
<text class="time-text">剩余时间: {{ countdownDisplay[order.id] || formatCountdown(order.expire_time) }}</text>
</view>
<!-- 操作按钮 -->
@ -105,8 +105,9 @@
</template>
<script setup>
import { ref, computed, onMounted } from 'vue'
import { ref, computed, onMounted, onUnmounted } from 'vue'
import course_api from "@/api/course_api.js"
import { requestPayment } from "@/utils/payment.js"
//
const statusBarHeight = ref(0)
@ -114,6 +115,10 @@ const navBarHeight = ref(88)
const activeTab = ref('paid') // ""
//
const orderList = ref([])
//
const countdownTimer = ref(null)
//
const countdownDisplay = ref({})
//
const currentOrderList = computed(() => {
@ -136,7 +141,70 @@ const goBack = () => {
uni.navigateBack()
}
//
const formatCountdown = (timestamp) => {
if (!timestamp) return ''
const now = Math.floor(Date.now() / 1000) //
const expireTime = parseInt(timestamp) //
const remainingSeconds = expireTime - now
if (remainingSeconds <= 0) {
return '已过期'
}
const days = Math.floor(remainingSeconds / 86400)
const hours = Math.floor((remainingSeconds % 86400) / 3600)
const minutes = Math.floor((remainingSeconds % 3600) / 60)
const seconds = remainingSeconds % 60
if (days > 0) {
return `${days}${hours.toString().padStart(2, '0')}小时${minutes.toString().padStart(2, '0')}分钟`
} else if (hours > 0) {
return `${hours}小时${minutes.toString().padStart(2, '0')}分钟${seconds.toString().padStart(2, '0')}`
} else if (minutes > 0) {
return `${minutes}分钟${seconds.toString().padStart(2, '0')}`
} else {
return `${seconds}`
}
}
//
const updateCountdownDisplay = () => {
const currentList = orderList.value[activeTab.value] || []
currentList.forEach(order => {
if (order.expire_time) {
countdownDisplay.value[order.id] = formatCountdown(order.expire_time)
}
})
}
//
const startCountdown = () => {
if (countdownTimer.value) {
clearInterval(countdownTimer.value)
}
//
updateCountdownDisplay()
countdownTimer.value = setInterval(() => {
updateCountdownDisplay()
}, 1000)
}
//
const stopCountdown = () => {
if (countdownTimer.value) {
clearInterval(countdownTimer.value)
countdownTimer.value = null
}
}
const switchTab = (tab) => {
//
stopCountdown()
activeTab.value = tab
console.log('切换到标签:', tab)
getOrderList()
@ -157,12 +225,14 @@ const copyOrderNumber = (orderNumber) => {
const getSecondaryButtonText = (status) => {
switch (status) {
case 'pending':
case 'created':
return '取消订单'
case 'timeout':
case 'overtime':
return '支付超时'
case 'failed':
return '支付失败'
case 'canceled':
return '已取消'
default:
return '查看订单'
}
@ -170,11 +240,13 @@ const getSecondaryButtonText = (status) => {
const getPrimaryButtonText = (status) => {
switch (status) {
case 'pending':
return '继续支付'
case 'timeout':
case 'canceled':
return '已取消'
case 'overtime':
case 'failed':
return '查看课程'
case 'created':
return '继续支付'
default:
return '进入学习'
}
@ -182,7 +254,7 @@ const getPrimaryButtonText = (status) => {
const handleSecondaryAction = (order) => {
switch (order.status) {
case 'pending':
case 'created':
cancelOrder(order)
break
case 'timeout':
@ -196,7 +268,7 @@ const handleSecondaryAction = (order) => {
const handlePrimaryAction = (order) => {
switch (order.status) {
case 'pending':
case 'created':
continuePayment(order)
break
case 'timeout':
@ -214,11 +286,8 @@ const cancelOrder = (order) => {
content: '确定要取消这个订单吗?',
success: (res) => {
if (res.confirm) {
uni.showToast({
title: '订单已取消',
icon: 'success'
})
// API
//
cancelExcellencourseOrder(order)
}
}
})
@ -226,9 +295,8 @@ const cancelOrder = (order) => {
const continuePayment = (order) => {
console.log('继续支付订单:', order.id)
uni.navigateTo({
url: '/pages_course/course_payment/course_payment'
})
//
payExcellencourseOrderContinue(order)
}
const viewCourse = (order) => {
@ -290,11 +358,20 @@ const getOrderList = () => {
balancePayment: balanceCents > 0 ? toYuan(balanceCents) : null,
pointsPayment: points > 0 ? points : null,
actualPayment: toYuan(item.pay_account),
status: item.order_status === 'paid' ? 'paid' : 'created'
status: item.order_status,
expire_time: item.expire_time //
}
})
orderList.value[activeTab.value] = mapped
//
countdownDisplay.value = {}
//
if (activeTab.value === 'unpaid' && mapped.length > 0) {
startCountdown()
}
} else {
uni.showToast({ title: res.msg || '获取订单失败', icon: 'none' })
}
@ -303,11 +380,116 @@ const getOrderList = () => {
})
}
const payExcellencourseOrderContinue = (order) => {
//
uni.showLoading({ title: '处理中...' })
let openid = ""
if (process.env.UNI_PLATFORM == "h5") {
if (process.env.NODE_ENV === 'development') {
openid = uni.getStorageSync('DEV_APPID');
} else {
openid = uni.getStorageSync('AUTH_APPID');
}
} else if(process.env.UNI_PLATFORM == "mp-weixin") {
const {
envVersion
} = uni.getAccountInfoSync().miniProgram;
if (envVersion == "release") {
openid = uni.getStorageSync('DEV_APPID');
} else {
openid = uni.getStorageSync('AUTH_APPID');
}
}else{
//app
}
course_api.payExcellencourseOrderContinue(order.id, openid).then(res => {
console.log('继续支付订单:', res)
uni.hideLoading()
if (res.code == 200) {
const payParams = res.data.order
console.log(payParams)
requestPayment(
payParams,
//
(res) => {
uni.showToast({ title: '支付成功', icon: 'success' })
//
getOrderList()
},
//
(err) => {
console.error('支付失败', err)
uni.showToast({ title: '支付失败或取消', icon: 'none' })
}
)
} else {
uni.showToast({
title: res.msg || '继续支付失败',
icon: 'none',
duration: 3000
})
}
}).catch(err => {
uni.hideLoading()
console.error('继续支付订单失败:', err)
uni.showToast({
title: '网络错误,请重试',
icon: 'none',
duration: 3000
})
})
}
const cancelExcellencourseOrder = (order) => {
//
uni.showLoading({ title: '取消中...' })
course_api.cancelExcellencourseOrder(order.id).then(res => {
console.log('取消订单:', res)
uni.hideLoading()
if (res.code == 200) {
uni.showToast({
title: '订单已取消',
icon: 'success',
duration: 2000
})
//
setTimeout(() => {
getOrderList()
}, 1500)
} else {
uni.showToast({
title: res.msg || '取消订单失败',
icon: 'none',
duration: 3000
})
}
}).catch(err => {
uni.hideLoading()
console.error('取消订单失败:', err)
uni.showToast({
title: '网络错误,请重试',
icon: 'none',
duration: 3000
})
})
}
//
onMounted(() => {
getSystemInfo()
getOrderList()
})
onUnmounted(() => {
stopCountdown()
})
</script>
<style lang="scss">

View File

@ -0,0 +1,144 @@
<template>
<view class="coupon-page">
<uni-nav-bar
left-icon="left"
title="积分券"
@clickLeft="goBack"
fixed
color="#8B2316"
height="140rpx"
:border="false"
backgroundColor="#ffffff"
/>
<!-- 顶部 tabs -->
<view class="tabs">
<view
v-for="(tab, i) in tabs"
:key="tab.value"
class="tab-item"
:class="{ active: activeTab === i }"
@click="setActiveTab(i)"
>
<text class="tab-text">{{ tab.label }}</text>
</view>
</view>
<!-- 列表 -->
<scroll-view scroll-y class="list" :show-scrollbar="false">
<view v-if="currentList.length" class="card-wrap">
<view :class="['coupon-card', { gray: activeTab !== 0 }]" v-for="(item, idx) in currentList" :key="idx">
<view class="card-top" style="display: flex; padding: 32rpx 28rpx;">
<view class="card-left">
<text class="points">{{ item.points }}</text>
<text class="points-unit">积分券</text>
</view>
<view class="card-right" style="text-align: center;">
<view class="title">{{ item.title }}</view>
</view>
</view>
<view class="card-bottom" style="display: flex; background-color: #fff;color: #000; padding: 32rpx 28rpx;">
<view class="expire">有效期{{ item.expire }}</view>
<button class="btn" v-if="activeTab === 0" @click="goExchange(item)">在线兑换</button>
</view>
</view>
</view>
<view v-else class="empty">暂无数据</view>
</scroll-view>
</view>
</template>
<script setup>
import { ref, computed, onMounted } from 'vue'
import navTo from '@/utils/navTo.js'
import api from '@/api/api.js'
const tabs = [
{ label: '未兑换', value: '1' },
{ label: '已兑换', value: '2' },
{ label: '已过期', value: '3' },
{ label: '已作废', value: '4' }
]
const activeTab = ref(0)
onMounted(() => {
getPointTicketList()
})
//
const currentList = ref([])
const goBack = () => {
uni.navigateBack()
}
const goExchange = (item) => {
// 线
uni.showModal({
title: '确认兑换',
content: `将使用${item.points}积分券进行兑换,是否继续?`,
confirmText: '确认兑换',
cancelText: '再想想',
success: (res) => {
if (res.confirm) {
api.pointTicketExchange({uuid: item.uuid}).then(res => {
console.log(res)
if (res.code === 200 || res.code === '200') {
uni.showToast({ title: '兑换成功', icon: 'success' })
getPointTicketList()
}
})
}
}
})
}
const getPointTicketList = () => {
api.pointTicketlist({page: 1, status: activeTab.value+1}).then(res => {
const rows = (res && res.data && res.data.list ? res.data.list : []).map(r => ({
uuid: r.uuid,
points: r.point,
title: '肝胆相照',
expire: formatDate(r.end_date)
}))
currentList.value = rows
})
}
const setActiveTab = (i) => {
activeTab.value = i
getPointTicketList()
}
const formatDate = (seconds) => {
if (!seconds) return ''
const d = new Date(seconds * 1000)
const y = d.getFullYear()
const m = `${d.getMonth() + 1}`.padStart(2, '0')
const day = `${d.getDate()}`.padStart(2, '0')
return `${y}${m}${day}`
}
</script>
<style scoped>
.coupon-page{background:#f5f5f5;min-height:100vh}
.tabs{display:flex;align-items:center;justify-content:space-around;height:88rpx;background:#fff;border-bottom:1px solid #f0f0f0}
.tab-item{flex:1;display:flex;align-items:center;justify-content:center}
.tab-text{font-size:28rpx;color:#999}
.tab-item.active .tab-text{color:#8B2316;font-weight:600}
.list{height:calc(100vh - 88rpx - 140rpx);}
.card-wrap{padding:24rpx}
.coupon-card{display:flex;flex-direction: column; background:linear-gradient(90deg,#ff7381, #ff6a7a);border-radius:16rpx;color:#fff;position:relative;margin-bottom:24rpx}
.coupon-card.gray{background:#e5e5e5;color:#666}
.card-left{width:220rpx;display:flex;flex-direction:column;align-items:center;justify-content:center;border-right:2rpx solid rgba(255,255,255,.5)}
.points{font-size:80rpx;line-height:1}
.points-unit{font-size:28rpx;margin-top:12rpx}
.card-right{flex:1;padding-left:28rpx;display:flex;flex-direction:column;justify-content:center}
.title{font-size:40rpx;font-weight:600}
.expire{font-size:26rpx;opacity:.95;height:64rpx;line-height:64rpx;flex:3}
.btn{border: 1px solid #ff4b5a;flex:1;height:64rpx;line-height:64rpx;padding:0 28rpx;background:#fff;color:#ff4b5a;border-radius:100rpx;font-size:28rpx}
.empty{padding:120rpx 0;text-align:center;color:#999}
</style>

View File

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@ -1,4 +1,5 @@
import pageUrl from './pageUrl'
import BASE_URL from './config.js';
function navTo(obj) {
let token = '';
@ -8,13 +9,19 @@ function navTo(obj) {
}else{
token = uni.getStorageSync('DEV_AUTH_TOKEN_App');
}
}else if(process.env.UNI_PLATFORM == "mp-weixin") {
const { envVersion } = uni.getAccountInfoSync().miniProgram;
if (envVersion == "release") {
token = uni.getStorageSync('AUTH_TOKEN_App');
}else{
token = uni.getStorageSync('DEV_AUTH_TOKEN_App');
}
}else{
const { envVersion } = uni.getAccountInfoSync().miniProgram;
if (envVersion == "release") {
if (BASE_URL.indexOf('dev') == -1) {
token = uni.getStorageSync('AUTH_TOKEN_App');
}else{
} else {
token = uni.getStorageSync('DEV_AUTH_TOKEN_App');
}
}
}
if (!token) {
// let page_url = pageUrl();

View File

@ -63,12 +63,7 @@ export function requestPayment(orderInfo, successCallback, failCallback) {
uni.requestPayment({
provider: provider, // 可选值wxpay、alipay、appleiap 等
orderInfo: orderInfo.orderInfo, // 支付宝传 orderInfo微信可能传其它参数
timeStamp: orderInfo.timestamp,
nonceStr: orderInfo.noncestr,
package: orderInfo.package_str,
signType: orderInfo.signType || 'RSA',
paySign: orderInfo.sign,
orderInfo: orderInfo,
success: (res) => {
console.log(`${provider} 支付成功`, res);
successCallback && successCallback(res);

View File

@ -33,6 +33,13 @@ export const request = (url, data = {}, method = 'post', loading = false, conten
} else {
token = uni.getStorageSync('DEV_AUTH_TOKEN_App');
}
}else{
if (BASE_URL.indexOf('dev') == -1) {
token = uni.getStorageSync('AUTH_TOKEN_App');
} else {
token = uni.getStorageSync('DEV_AUTH_TOKEN_App');
}
}
let header = {
'content-type': contentType,
@ -66,6 +73,7 @@ export const request = (url, data = {}, method = 'post', loading = false, conten
if(token){
header['Authorization']='Bearer ' +token;
let userInfo= uni.getStorageSync('userInfo')
console.log(userInfo)
defaultData = {
version: '4.0.0',
user_uuid:userInfo.uuid,
@ -106,7 +114,7 @@ export const request = (url, data = {}, method = 'post', loading = false, conten
};
if(url.indexOf('manager/getSystemTimeStamp')!=-1){
e(res)
}else if (res.data.code == 200 || res.data.code ==1){
}else if (res.data.code == 200 || res.data.code == 1 || res.data.code == "1" || res.data.code == "200"){
e(res.data)
}else if (res.data.code == 401 || res.data.code == 403 || res.data.code ==
405 || res.data.code == 406 || res.data.code == 37006) {