Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
CFFP-HB
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chao Sun
CFFP-HB
Commits
19cf257f
Commit
19cf257f
authored
Apr 09, 2026
by
yuzhenWang
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev' into 'master'
Dev See merge request
!106
parents
3b356c45
14704ba0
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
359 additions
and
331 deletions
+359
-331
components/commonTimePicker/commonTimePicker.vue
+302
-273
index.html
+2
-13
pages/courseDetail/courseDetail.vue
+18
-18
pages/lanch/index.vue
+5
-3
pages/orderConfirm/orderConfirm.vue
+29
-22
pages/pointsExchange/customDatePop.vue
+1
-0
util/fiveshare.ts
+2
-2
No files found.
components/commonTimePicker/commonTimePicker.vue
View file @
19cf257f
...
...
@@ -3,43 +3,39 @@
<view
class=
"timeTitle"
>
<view
class=
""
v-if=
"initDate"
>
<text
style=
"font-size: 30rpx;"
>
{{
initDate
}}
</text>
<text
v-if=
"iconDirection== 'down'"
class=
"iconfont icon-xiajiantou iconStyle"
:style=
"
{color:iconColor?iconColor:''}">
</text>
<text
v-if=
"iconDirection== 'right'"
class=
"iconfont icon-youjiantou iconStyle"
></text>
<text
v-if=
"iconDirection == 'down'"
class=
"iconfont icon-xiajiantou iconStyle"
:style=
"
{color: iconColor || ''}">
</text>
<text
v-if=
"iconDirection == 'right'"
class=
"iconfont icon-youjiantou iconStyle"
></text>
</view>
<view
class=
"emptyTxt"
v-else
>
<text
v-if=
"startTxt"
:style=
"
{fontSize: placeholderSize}">
{{
startTxt
}}
</text>
<text
v-if=
"endTxt"
:style=
"
{fontSize: placeholderSize}">
{{
endTxt
}}
</text>
<text
v-if=
"iconDirection == 'down'"
class=
"iconfont icon-xiajiantou iconStyle"
></text>
<text
v-if=
"iconDirection == 'right'"
class=
"iconfont icon-youjiantou iconStyle"
></text>
</view>
<view
class=
"emptyTxt"
v-else
>
<text
v-if=
"startTxt"
:style=
"
{fontSize:placeholderSize}">
{{
startTxt
}}
</text>
<text
v-if=
"endTxt"
:style=
"
{fontSize:placeholderSize}">
{{
endTxt
}}
</text>
<text
v-if=
"iconDirection== 'down'"
class=
"iconfont icon-xiajiantou iconStyle"
></text>
<text
v-if=
"iconDirection== 'right'"
class=
"iconfont icon-youjiantou iconStyle"
></text>
</view>
</view>
<uni-popup
ref=
"timePopup"
type=
"bottom"
:maskClick=
"false"
>
<view
class=
"timeBox"
>
<view
class=
"titleBox"
>
<view
@
click=
"cancle"
style=
"color:#333;"
>
取消
</view>
<view
style=
"color:#20279b;"
@
click=
"confirm"
>
确定
</view>
<view
@
click=
"cancel"
style=
"color:#333;"
>
取消
</view>
<view
style=
"color:#20279b;"
@
click=
"confirm"
>
确定
</view>
</view>
<picker-view
:indicator-style=
"indicatorStyle"
:value=
"value"
@
change=
"bindChange"
class=
"picker-view"
>
<picker-view
:indicator-style=
"indicatorStyle"
:value=
"value"
@
change=
"bindChange"
class=
"picker-view"
>
<picker-view-column
v-if=
"showYear"
>
<view
class=
"item"
v-for=
"(item,index) in years"
:key=
"index"
>
<view
class=
"item"
v-for=
"(item,
index) in years"
:key=
"index"
>
<view
class=
"myItem"
:class=
"
{ 'selected': currentValue[0] === index }">
{{
item
}}
年
</view>
</view>
</picker-view-column>
<picker-view-column
v-if=
"showMonth"
>
<view
class=
"item"
v-for=
"(item,index) in months"
:key=
"index"
>
<view
class=
"item"
v-for=
"(item,
index) in months"
:key=
"index"
>
<view
class=
"myItem"
:class=
"
{ 'selected': currentValue[1] === index }">
{{
item
}}
月
</view>
</view>
</picker-view-column>
<picker-view-column
v-if=
"showDay"
>
<view
class=
"item"
v-for=
"(item,index) in days"
:key=
"index"
>
<view
class=
"item"
v-for=
"(item,
index) in days"
:key=
"index"
>
<view
class=
"myItem"
:class=
"
{ 'selected': currentValue[2] === index }">
{{
item
}}
日
</view>
...
...
@@ -50,284 +46,316 @@
</uni-popup>
</view>
</
template
>
<
script
>
import
dataHandling
from
"@/util/dataHandling"
;
import
dayjs
from
'dayjs'
;
export
default
{
name
:
'CommonTimePicker'
,
props
:
{
timeData
:
{
//方便组件回显日期
type
:
Object
,
default
:
()
=>
({})
},
iconDirection
:
{
//箭头的方向
type
:
String
,
default
:
'down'
},
iconColor
:{
type
:
String
,
default
:
'#000'
},
visible
:
{
//显示组件
type
:
Boolean
,
default
:
false
},
showYear
:
{
//展示年份
type
:
Boolean
,
default
:
true
},
showMonth
:
{
//展示月份
type
:
Boolean
,
default
:
true
},
showDay
:
{
//展示日子
type
:
Boolean
,
default
:
false
},
birthDay
:{
//是否是出生日期组件 影响到组件时间范围
type
:
Boolean
,
default
:
false
},
startTxt
:
{
//开始的文字
type
:
String
,
default
:
''
},
endTxt
:
{
//结束的文字的文字
type
:
String
,
default
:
''
},
placeholderSize
:
{
//结束的文字的文字
type
:
String
,
default
:
'30rpx'
},
yearStart
:
{
//限制开始年份
type
:
Number
,
default
:
2025
},
yearEnd
:
{
//限制结束年份
type
:
Number
,
},
import
dataHandling
from
"@/util/dataHandling"
;
import
dayjs
from
'dayjs'
;
export
default
{
name
:
'CommonTimePicker'
,
props
:
{
timeData
:
{
type
:
Object
,
default
:
()
=>
({})
},
data
:
function
()
{
const
date
=
new
Date
()
const
years
=
[]
const
months
=
[]
const
days
=
[]
const
day
=
this
.
timeData
.
day
||
dataHandling
.
getDateParts
().
day
const
currentYear
=
this
.
yearEnd
||
date
.
getFullYear
()
// 初始值优先使用传入的timeData,没有则使用当前日期
const
initialYear
=
this
.
timeData
.
year
||
dataHandling
.
getDateParts
().
year
const
initialMonth
=
this
.
timeData
.
month
||
dataHandling
.
getDateParts
().
month
const
startYear
=
this
.
yearStart
for
(
let
i
=
startYear
;
i
<=
currentYear
;
i
++
)
{
years
.
push
(
i
)
iconDirection
:
{
type
:
String
,
default
:
'down'
},
iconColor
:
{
type
:
String
,
default
:
'#000'
},
visible
:
{
type
:
Boolean
,
default
:
false
},
showYear
:
{
type
:
Boolean
,
default
:
true
},
showMonth
:
{
type
:
Boolean
,
default
:
true
},
showDay
:
{
type
:
Boolean
,
default
:
false
},
birthDay
:
{
type
:
Boolean
,
default
:
false
},
startTxt
:
{
type
:
String
,
default
:
''
},
endTxt
:
{
type
:
String
,
default
:
''
},
placeholderSize
:
{
type
:
String
,
default
:
'30rpx'
},
yearStart
:
{
type
:
Number
,
default
:
2025
},
yearEnd
:
{
type
:
Number
,
},
},
data
()
{
const
date
=
new
Date
();
const
currentYear
=
this
.
yearEnd
||
date
.
getFullYear
();
const
startYear
=
this
.
yearStart
;
// 年份数组
const
years
=
[];
for
(
let
i
=
startYear
;
i
<=
currentYear
;
i
++
)
{
years
.
push
(
i
);
}
// 月份数组
const
months
=
[];
for
(
let
i
=
1
;
i
<=
12
;
i
++
)
{
months
.
push
(
i
);
}
// 内部默认值:使用当前日期(仅用于弹窗初始显示,不影响外部展示)
let
defaultYear
=
date
.
getFullYear
();
let
defaultMonth
=
date
.
getMonth
()
+
1
;
let
defaultDay
=
date
.
getDate
();
// 如果传入了 timeData 且有效,则使用传入值作为内部默认值
if
(
this
.
timeData
&&
(
this
.
timeData
.
year
||
this
.
timeData
.
month
||
this
.
timeData
.
day
))
{
if
(
this
.
timeData
.
year
)
defaultYear
=
this
.
timeData
.
year
;
if
(
this
.
timeData
.
month
)
defaultMonth
=
this
.
timeData
.
month
;
if
(
this
.
timeData
.
day
)
defaultDay
=
this
.
timeData
.
day
;
}
// 保证年份在范围内
if
(
defaultYear
<
startYear
)
defaultYear
=
startYear
;
if
(
defaultYear
>
currentYear
)
defaultYear
=
currentYear
;
if
(
defaultMonth
<
1
)
defaultMonth
=
1
;
if
(
defaultMonth
>
12
)
defaultMonth
=
12
;
// 根据年月计算正确天数
const
maxDay
=
this
.
getDaysInMonth
(
defaultYear
,
defaultMonth
);
if
(
defaultDay
>
maxDay
)
defaultDay
=
maxDay
;
const
days
=
[];
for
(
let
i
=
1
;
i
<=
maxDay
;
i
++
)
{
days
.
push
(
i
);
}
const
yearIndex
=
Math
.
max
(
0
,
years
.
indexOf
(
defaultYear
));
const
monthIndex
=
Math
.
max
(
0
,
defaultMonth
-
1
);
const
dayIndex
=
Math
.
max
(
0
,
defaultDay
-
1
);
return
{
years
,
months
,
days
,
year
:
defaultYear
,
month
:
defaultMonth
,
day
:
defaultDay
,
value
:
[
yearIndex
,
monthIndex
,
dayIndex
],
currentValue
:
[
yearIndex
,
monthIndex
,
dayIndex
],
indicatorStyle
:
`height: 50px;`
,
initDate
:
''
,
// 初始不显示任何日期,占位符优先
};
},
watch
:
{
visible
:
{
handler
(
newVal
)
{
if
(
newVal
)
this
.
$refs
.
timePopup
.
open
();
}
for
(
let
i
=
1
;
i
<=
12
;
i
++
)
{
months
.
push
(
i
)
},
timeData
:
{
deep
:
true
,
immediate
:
true
,
handler
(
newVal
)
{
if
(
newVal
&&
(
newVal
.
year
||
newVal
.
month
||
newVal
.
day
))
{
this
.
updateSelectedDate
(
newVal
);
}
else
{
// 没有传入有效日期时,清空显示
this
.
initDate
=
''
;
}
}
for
(
let
i
=
1
;
i
<=
31
;
i
++
)
{
days
.
push
(
i
)
},
year
()
{
if
(
this
.
showDay
)
this
.
updateDaysAndAdjust
();
},
month
()
{
if
(
this
.
showDay
)
this
.
updateDaysAndAdjust
();
}
},
methods
:
{
getDaysInMonth
(
year
,
month
)
{
return
new
Date
(
year
,
month
,
0
).
getDate
();
},
updateDaysAndAdjust
()
{
const
maxDay
=
this
.
getDaysInMonth
(
this
.
year
,
this
.
month
);
const
newDays
=
[];
for
(
let
i
=
1
;
i
<=
maxDay
;
i
++
)
{
newDays
.
push
(
i
);
}
this
.
days
=
newDays
;
return
{
title
:
'picker-view'
,
years
,
months
,
year
:
initialYear
,
month
:
initialMonth
,
day
:
this
.
timeData
.
day
||
day
,
value
:
[
Math
.
max
(
0
,
years
.
indexOf
(
initialYear
)),
Math
.
max
(
0
,
initialMonth
-
1
),
Math
.
max
(
0
,
(
this
.
timeData
.
day
||
day
)
-
1
)
],
days
,
indicatorStyle
:
`height: 50px;`
,
initDate
:
this
.
generateDateString
({
year
:
this
.
timeData
.
year
,
month
:
this
.
timeData
.
month
,
day
:
this
.
timeData
.
day
}),
currentValue
:
[
Math
.
max
(
0
,
years
.
indexOf
(
initialYear
)),
Math
.
max
(
0
,
initialMonth
-
1
),
Math
.
max
(
0
,
(
this
.
timeData
.
day
||
day
)
-
1
)
]
if
(
this
.
day
>
maxDay
)
{
this
.
day
=
maxDay
;
}
const
dayIndex
=
Math
.
max
(
0
,
this
.
day
-
1
);
if
(
this
.
currentValue
.
length
>=
3
)
this
.
currentValue
[
2
]
=
dayIndex
;
if
(
this
.
value
.
length
>=
3
)
this
.
value
[
2
]
=
dayIndex
;
},
watch
:
{
visible
:
{
deep
:
true
,
handler
(
newVal
)
{
if
(
newVal
)
this
.
$refs
.
timePopup
.
open
()
}
},
birthDay
:
{
immediate
:
true
,
handler
(
newVal
)
{
this
.
updateYears
(
newVal
)
}
},
timeData
:
{
deep
:
true
,
immediate
:
true
,
handler
(
newVal
)
{
if
(
newVal
&&
(
newVal
.
year
||
newVal
.
month
||
newVal
.
day
))
{
this
.
updateSelectedDate
(
newVal
)
}
}
generateDateString
(
dateObj
)
{
const
parts
=
[];
if
(
this
.
showYear
&&
dateObj
.
year
)
parts
.
push
(
dateObj
.
year
);
if
(
this
.
showMonth
&&
dateObj
.
month
)
{
const
month
=
dateObj
.
month
<
10
?
'0'
+
dateObj
.
month
:
dateObj
.
month
;
parts
.
push
(
month
);
}
if
(
this
.
showDay
&&
dateObj
.
day
)
{
const
day
=
dateObj
.
day
<
10
?
'0'
+
dateObj
.
day
:
dateObj
.
day
;
parts
.
push
(
day
);
}
return
parts
.
join
(
'-'
);
},
methods
:
{
generateDateString
(
dateObj
)
{
const
parts
=
[];
if
(
this
.
showYear
&&
dateObj
.
year
)
{
parts
.
push
(
dateObj
.
year
);
}
if
(
this
.
showMonth
&&
dateObj
.
month
)
{
const
month
=
dateObj
.
month
<
10
?
'0'
+
dateObj
.
month
:
dateObj
.
month
;
parts
.
push
(
month
);
}
if
(
this
.
showDay
&&
dateObj
.
day
)
{
const
day
=
dateObj
.
day
<
10
?
'0'
+
dateObj
.
day
:
dateObj
.
day
;
parts
.
push
(
day
);
}
return
parts
.
join
(
'-'
);
},
updateYears
(
isBirthDay
)
{
// 更新年份范围
const
date
=
new
Date
()
const
currentYear
=
this
.
yearEnd
||
date
.
getFullYear
()
const
startYear
=
this
.
yearStart
this
.
years
=
[]
for
(
let
i
=
startYear
;
i
<=
currentYear
;
i
++
)
{
this
.
years
.
push
(
i
)
}
// 确保当前选中的年份在新范围内
const
yearIndex
=
this
.
years
.
indexOf
(
this
.
year
)
updateSelectedDate
(
dateObj
)
{
if
(
!
dateObj
)
return
;
let
needUpdateDays
=
false
;
if
(
dateObj
.
year
&&
this
.
years
.
includes
(
dateObj
.
year
))
{
this
.
year
=
dateObj
.
year
;
const
yearIndex
=
this
.
years
.
indexOf
(
dateObj
.
year
);
if
(
yearIndex
>=
0
)
{
this
.
currentValue
[
0
]
=
yearIndex
this
.
value
[
0
]
=
yearIndex
}
else
{
// 如果当前年份不在新范围内,选择最近的年份
const
newYearIndex
=
Math
.
max
(
0
,
this
.
years
.
length
-
1
)
this
.
year
=
this
.
years
[
newYearIndex
]
this
.
currentValue
[
0
]
=
newYearIndex
this
.
value
[
0
]
=
newYearIndex
}
},
updateSelectedDate
(
dateObj
)
{
// 更新选中的日期
if
(
dateObj
.
year
)
{
this
.
year
=
dateObj
.
year
const
yearIndex
=
this
.
years
.
indexOf
(
dateObj
.
year
)
if
(
yearIndex
>=
0
)
{
this
.
currentValue
[
0
]
=
yearIndex
this
.
value
[
0
]
=
yearIndex
}
}
if
(
dateObj
.
month
)
{
this
.
month
=
dateObj
.
month
const
monthIndex
=
Math
.
max
(
0
,
dateObj
.
month
-
1
)
this
.
currentValue
[
1
]
=
monthIndex
this
.
value
[
1
]
=
monthIndex
this
.
currentValue
[
0
]
=
yearIndex
;
this
.
value
[
0
]
=
yearIndex
;
}
if
(
dateObj
.
day
)
{
this
.
day
=
dateObj
.
day
const
dayIndex
=
Math
.
max
(
0
,
dateObj
.
day
-
1
)
this
.
currentValue
[
2
]
=
dayIndex
this
.
value
[
2
]
=
dayIndex
}
// 更新显示的日期文本
this
.
initDate
=
this
.
generateDateString
({
year
:
this
.
year
,
month
:
this
.
month
,
day
:
this
.
day
})
},
bindChange
:
dataHandling
.
debounce
(
function
(
e
)
{
const
val
=
e
.
detail
.
value
;
needUpdateDays
=
true
;
}
if
(
dateObj
.
month
&&
dateObj
.
month
>=
1
&&
dateObj
.
month
<=
12
)
{
this
.
month
=
dateObj
.
month
;
const
monthIndex
=
dateObj
.
month
-
1
;
this
.
currentValue
[
1
]
=
monthIndex
;
this
.
value
[
1
]
=
monthIndex
;
needUpdateDays
=
true
;
}
if
(
dateObj
.
day
&&
this
.
showDay
)
{
this
.
day
=
dateObj
.
day
;
}
if
(
needUpdateDays
&&
this
.
showDay
)
{
this
.
updateDaysAndAdjust
();
}
else
if
(
dateObj
.
day
&&
this
.
showDay
)
{
const
maxDay
=
this
.
getDaysInMonth
(
this
.
year
,
this
.
month
);
if
(
this
.
day
>
maxDay
)
this
.
day
=
maxDay
;
const
dayIndex
=
this
.
day
-
1
;
this
.
currentValue
[
2
]
=
dayIndex
;
this
.
value
[
2
]
=
dayIndex
;
}
// 更新显示文本
this
.
initDate
=
this
.
generateDateString
({
year
:
this
.
year
,
month
:
this
.
month
,
day
:
this
.
day
});
},
bindChange
:
dataHandling
.
debounce
(
function
(
e
)
{
const
val
=
e
.
detail
.
value
;
if
(
this
.
showYear
&&
val
[
0
]
!==
undefined
)
this
.
year
=
this
.
years
[
val
[
0
]];
if
(
this
.
showMonth
&&
val
[
1
]
!==
undefined
)
this
.
month
=
this
.
months
[
val
[
1
]];
if
(
this
.
showDay
)
{
const
maxDay
=
this
.
getDaysInMonth
(
this
.
year
,
this
.
month
);
const
newDays
=
[];
for
(
let
i
=
1
;
i
<=
maxDay
;
i
++
)
newDays
.
push
(
i
);
this
.
days
=
newDays
;
let
dayIndex
=
val
[
2
]
||
0
;
if
(
dayIndex
>=
this
.
days
.
length
)
dayIndex
=
this
.
days
.
length
-
1
;
this
.
day
=
this
.
days
[
dayIndex
];
this
.
currentValue
=
[
val
[
0
],
val
[
1
],
dayIndex
];
this
.
value
=
[
val
[
0
],
val
[
1
],
dayIndex
];
}
else
{
this
.
currentValue
=
val
;
this
.
year
=
this
.
years
[
val
[
0
]];
this
.
month
=
this
.
months
[
val
[
1
]];
this
.
day
=
this
.
days
[
val
[
2
]];
},
50
),
cancle
(){
this
.
$emit
(
'closeTime'
,
false
)
this
.
$refs
.
timePopup
.
close
()
},
confirm
(){
console
.
log
(
'currentValue'
,
this
.
currentValue
);
this
.
initDate
=
this
.
generateDateString
({
year
:
this
.
year
,
month
:
this
.
month
,
day
:
this
.
day
})
this
.
$refs
.
timePopup
.
close
()
this
.
$emit
(
'confirmDate'
,
{
year
:
this
.
year
,
month
:
this
.
month
,
day
:
this
.
day
})
this
.
value
=
val
;
}
},
50
),
cancel
()
{
this
.
$emit
(
'closeTime'
,
false
);
this
.
$refs
.
timePopup
.
close
();
},
confirm
()
{
if
(
this
.
showDay
)
{
const
maxDay
=
this
.
getDaysInMonth
(
this
.
year
,
this
.
month
);
if
(
this
.
day
>
maxDay
)
{
this
.
day
=
maxDay
;
this
.
currentValue
[
2
]
=
maxDay
-
1
;
this
.
value
[
2
]
=
maxDay
-
1
;
}
}
this
.
initDate
=
this
.
generateDateString
({
year
:
this
.
year
,
month
:
this
.
month
,
day
:
this
.
day
});
this
.
$refs
.
timePopup
.
close
();
this
.
$emit
(
'confirmDate'
,
{
year
:
this
.
year
,
month
:
this
.
month
,
day
:
this
.
day
});
}
}
};
</
script
>
<
style
lang=
"scss"
scoped
>
::v-deep
.uni-popup
.uni-popup__wrapper
{
margin
:
0
!important
;
::v-deep
.uni-popup
.uni-popup__wrapper
{
margin
:
0
!important
;
}
.timeTitle
{
font-size
:
35
rpx
;
.emptyTxt
{
color
:
gray
;
font-size
:
31
rpx
;
display
:
flex
;
align-items
:
center
;
}
.timeTitle
{
}
.timeBox
{
width
:
100%
;
background-color
:
#fff
;
border-radius
:
10
rpx
10
rpx
0
0
;
.titleBox
{
display
:
flex
;
align-items
:
center
;
justify-content
:
space-between
;
font-size
:
35
rpx
;
.emptyTxt{
color
:
gray
;
font-size
:
31
rpx
;
display
:
flex
;
align-items
:
center
;
}
padding
:
20
rpx
30
rpx
;
}
.
timeBox
{
.
picker-view
{
width
:
100%
;
background-color
:
#fff
;
border-radius
:
10
rpx
10
rpx
0
0
;
.titleBox{
display
:
flex
;
align-items
:
center
;
justify-content
:
space-between
;
font-size
:
35
rpx
;
padding
:
20
rpx
30
rpx
;
}
.picker-view
{
width
:
100%
;
height
:
600
rpx
;
margin-top
:
20
rpx
;
}
.item
{
text-align
:
center
;
display
:
flex
;
align-items
:
center
;
justify-content
:
center
;
.myItem
{
padding
:
10
rpx
;
border-radius
:
10
rpx
;
color
:
#000
;
transition
:
transform
0.2s
ease
;
&.selected
{
transform
:
scale
(
1.05
);
color
:
#20279b
;
font-weight
:
bold
;
}
height
:
600
rpx
;
margin-top
:
20
rpx
;
}
.item
{
text-align
:
center
;
display
:
flex
;
align-items
:
center
;
justify-content
:
center
;
.myItem
{
padding
:
10
rpx
;
border-radius
:
10
rpx
;
color
:
#000
;
transition
:
transform
0.2s
ease
;
&.selected
{
transform
:
scale
(
1.05
);
color
:
#20279b
;
font-weight
:
bold
;
}
}
}
</
style
>
}
</
style
>
\ No newline at end of file
index.html
View file @
19cf257f
...
...
@@ -41,18 +41,6 @@
<!--app-html-->
</div>
<script
type=
"module"
src=
"/main.js"
></script>
<!-- uni 的 SDK,必须引用。 -->
<!-- <script type="text/javascript" src="/static/uni.webview.1.5.4.js"></script>
<script type="text/javascript">
// 验证脚本是否加载成功(调试关键:控制台打印 webViewJs 确认)
const webViewJs = window.uni?.webView;
if (!webViewJs) {
console.error('uni.webview.js 加载失败!请检查路径是否正确');
} else {
console.log('uni.webview.js 加载成功', webViewJs);
// 将 webViewJs 挂载到 window 全局,供 Vue 组件访问
window.webViewJs = webViewJs;
}
</script> -->
</body>
</html>
\ No newline at end of file
pages/courseDetail/courseDetail.vue
View file @
19cf257f
...
...
@@ -747,25 +747,25 @@
// 如果是商城跳转到cffp得购买直接弹出海报框
if
(
this
.
mpCffp
){
// if(uni.getStorageSync('posterItem')){
// this.shareItem = JSON.parse(JSON.stringify(uni.getStorageSync('posterItem')))
// }
//
if(this.mpCffp){
//
// if(uni.getStorageSync('posterItem')){
//
// this.shareItem = JSON.parse(JSON.stringify(uni.getStorageSync('posterItem')))
//
// }
// 因为是从家办商城小程序跳转到cffp的,所以这里购买要带家办商城的token,
let
dataToken
=
uni
.
getStorageSync
(
'dataToken'
)
console
.
log
(
'家办商城dataToken'
,
dataToken
);
this
.
posterShareTxt
=
'保存图片扫码下单'
this
.
posterDesTxt
=
'扫码下单'
let
newLink
=
shareURL
+
`/pages/orderConfirm/orderConfirm?fileId=
${
this
.
fileId
}
&orderId=
${
this
.
orderId
}
&userId=
${
this
.
userId
}
&dataToken=
${
encodeURIComponent
(
dataToken
)}
`
// let newLink = shareURL + `/pages/lanch/index?fileId=${this.fileId}&orderId=${this.orderId}&userId=${this.userId}&dataToken=${encodeURIComponent(dataToken)}&landingPage=orderConfirm`
console
.
log
(
'newLink'
,
newLink
);
this
.
qrCodeUrl
=
newLink
this
.
showImg
=
true
this
.
isOrderLoading
=
true
,
this
.
posterImgType
=
'orderPoster'
return
}
//
// 因为是从家办商城小程序跳转到cffp的,所以这里购买要带家办商城的token,
//
let dataToken = uni.getStorageSync('dataToken')
//
console.log('家办商城dataToken',dataToken);
//
this.posterShareTxt = '保存图片扫码下单'
//
this.posterDesTxt = '扫码下单'
//
let newLink = shareURL + `/pages/orderConfirm/orderConfirm?fileId=${this.fileId}&orderId=${this.orderId}&userId=${this.userId}&dataToken=${encodeURIComponent(dataToken)}`
//
// let newLink = shareURL + `/pages/lanch/index?fileId=${this.fileId}&orderId=${this.orderId}&userId=${this.userId}&dataToken=${encodeURIComponent(dataToken)}&landingPage=orderConfirm`
//
console.log('newLink',newLink);
//
this.qrCodeUrl = newLink
//
this.showImg = true
//
this.isOrderLoading = true,
//
this.posterImgType = 'orderPoster'
//
return
//
}
uni
.
navigateTo
({
url
:
`/pages/orderConfirm/orderConfirm?fileId=
${
this
.
fileId
}
&orderId=
${
this
.
orderId
}
&userId=
${
this
.
userId
}
`
})
...
...
pages/lanch/index.vue
View file @
19cf257f
...
...
@@ -93,9 +93,7 @@
}
else
if
(
landingPage
==
'sfpIndex'
)
{
uni
.
reLaunch
({
url
:
`/sfp/index/index`
})
}
else
if
(
landingPage
==
'orderStatus'
)
{
uni
.
reLaunch
({
url
:
`/pages/orderStatus/orderStatus?orderStatus=2`
})
}
else
if
(
landingPage
==
'courseDetail'
)
{
}
else
if
(
landingPage
==
'courseDetail'
)
{
if
(
jumpInfo
.
value
.
noShare
){
uni
.
reLaunch
({
url
:
`/pages/courseDetail/courseDetail?fileId=
${
jumpInfo
.
value
.
fileId
}
&noShare=1`
})
}
else
{
...
...
@@ -123,6 +121,10 @@
uni
.
reLaunch
({
url
:
'/pages/personalCenter/personalCenter'
})
}
else
if
(
landingPage
==
'orderStatus'
){
uni
.
reLaunch
({
url
:
`/pages/orderStatus/orderStatus?orderId=
${
jumpInfo
.
value
.
orderId
}
&fileId=
${
jumpInfo
.
value
.
fileId
}
&orderStatus=2&userId=
${
res
.
data
.
userId
}
`
})
}
}
else
{
uni
.
showToast
({
...
...
pages/orderConfirm/orderConfirm.vue
View file @
19cf257f
...
...
@@ -36,14 +36,17 @@
<!-- 支付方式 -->
<view
class=
"paymentMethodContent"
>
<h4>
选择支付方式
</h4>
<view
class=
"paymentItem"
@
click=
"selectPaymentMethod(2)"
>
<view>
<i
class=
"iconfont icon-zhifubao"
></i>
<text
class=
"txtFont"
>
支付宝支付
</text>
</view>
<view
class=
"selectRadio"
:class=
"{'actived':paymentMethod===2}"
>
<i
class=
"iconfont icon-duihao txtFont"
></i>
<view
@
click=
"selectPaymentMethod(2)"
>
<view
class=
"paymentItem"
v-if=
"runEnv!=='wechat-miniprogram'"
>
<view>
<i
class=
"iconfont icon-zhifubao"
></i>
<text
class=
"txtFont"
>
支付宝支付
</text>
</view>
<view
class=
"selectRadio"
:class=
"{'actived':paymentMethod===2}"
>
<i
class=
"iconfont icon-duihao txtFont"
></i>
</view>
</view>
</view>
<view
class=
"paymentItem"
@
click=
"selectPaymentMethod(1)"
v-if=
"deviceType==3"
>
<view>
...
...
@@ -210,7 +213,8 @@
calculatedPrice
:
0
,
dataToken
:
''
,
oldToken
:
''
,
//原始用户token
pollTimer
:
''
pollTimer
:
''
,
runEnv
:
dataHandling
.
h5RuntimeEnv
()
}
},
computed
:
{
...
...
@@ -255,8 +259,8 @@
isPayOrAuth
:
''
,
fileId
:
this
.
fileId
,
companyType
:
companyInfo
.
companyType
,
hiddenPage
:
'cffpH5Pay'
}
if
(
this
.
paymentMethod
==
1
)
{
// APP:微信app支付
// #ifdef APP-PLUS
...
...
@@ -314,24 +318,25 @@
//deviceType:PC为1,移动端为2,微信为3
if
(
this
.
deviceType
==
3
)
{
// 向小程序通信
// if(dataHandling.h5RuntimeEnv()=='wechat-miniprogram'){
// uni.setStorageSync('pendingPayOrder',JSON.stringify(param))
// console.log('向小程序通信');
// // 跳转到小程序消息接收中转页面,拉起小程序的支付
// wx.miniProgram.navigateTo({
// url: `/myPackageA/h5Pay/appYdhomeofficePay?param=${encodeURIComponent(JSON.stringify(param))}`
// })
if
(
dataHandling
.
h5RuntimeEnv
()
==
'wechat-miniprogram'
){
this
.
paymentBtnDisabled
=
false
;
// 跳转到小程序消息接收中转页面,拉起小程序的支付
wx
.
miniProgram
.
navigateTo
({
url
:
`/myPackageA/h5Pay/appYdhomeofficePay?param=
${
encodeURIComponent
(
JSON
.
stringify
(
param
))}
`
})
//
return
//
}
return
}
let
_this
=
this
param
.
isPayOrAuth
=
1
;
// uni.showToast({
// title: JSON.stringify(param),
// duration: 10000,
// icon: 'none'
// })
api
.
wxAuthorize
(
param
).
then
((
res
)
=>
{
_this
.
paymentBtnDisabled
=
false
;
if
(
res
[
'success'
])
{
if
(
param
.
amount
==
'0.00'
)
{
uni
.
navigateTo
({
...
...
@@ -424,6 +429,7 @@
},
getunifiedPay
(
param
){
api
.
unifiedPay
(
param
).
then
((
res
)
=>
{
const
data
=
res
[
'data'
];
this
.
paymentBtnDisabled
=
false
;
...
...
@@ -471,6 +477,7 @@
}).
then
(
res
=>
{
if
(
res
[
'success'
])
{
this
.
courseInfoItem
=
res
[
'data'
][
'data'
];
console
.
log
(
'this.courseInfoItem'
,
this
.
courseInfoItem
);
}
})
},
...
...
pages/pointsExchange/customDatePop.vue
View file @
19cf257f
...
...
@@ -400,6 +400,7 @@
this
.
$emit
(
'comfirm'
,{
year
:
this
.
year
,
month
:
this
.
month
,
current
:
this
.
current
,
timeType
:
'8'
})
}
if
(
this
.
current
==
'2'
){
console
.
log
(
'this.currentDate'
,
this
.
currentDate
);
if
(
!
this
.
currentDate
.
length
){
uni
.
showToast
({
title
:
`请选择时间`
,
...
...
util/fiveshare.ts
View file @
19cf257f
...
...
@@ -15,7 +15,7 @@ export function initJssdkShare(callback, url) {
url
:
url
,
systemType
:
uni
.
getStorageSync
(
'addSystemType'
)
||
'1'
};
// 后端的自定义分享接口,拿到分享的appId、signature等信息
api
.
Wxshare
(
WxConfigRequestVO
).
then
(
res
=>
{
jWeixin
.
config
({
debug
:
false
,
// 生产环境关闭调试
...
...
@@ -81,7 +81,7 @@ export function setWechatShare(data) {
});
});
}
// data是穿的参数 url是当前页面的链接
//
在页面上直接调用此方法实现h5的自定义分享
data是穿的参数 url是当前页面的链接
export
function
hshare
(
data
,
url
){
console
.
log
(
'data,url'
,
data
,
url
);
// 确保分享的链接不包含时间戳
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment