Compare commits
76 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 81fa4da0e8 | |||
| dd666f0d82 | |||
| 90ecd6621d | |||
| a43b7ad2f8 | |||
| 85d0f092c0 | |||
| 64f8618802 | |||
| a38c068db0 | |||
| 3afc1b13d1 | |||
| a859805009 | |||
|
|
b24bc98e1c | ||
|
|
0714342cee | ||
|
|
128fd2b716 | ||
|
|
092704162d | ||
|
|
716ef3657a | ||
|
|
e8944b3ad1 | ||
|
|
46b0576abc | ||
|
|
15c83db6f7 | ||
|
|
8c6e586af2 | ||
|
|
371f72931c | ||
|
|
94599e7227 | ||
| 792a70b7ed | |||
|
|
3f30b20a4c | ||
|
|
a56aabb05a | ||
| 0e3c553990 | |||
|
|
3b1c7ea31f | ||
|
|
be21975449 | ||
|
|
19f6cadae7 | ||
| 9dbf88174e | |||
| 93f4aca944 | |||
|
|
9a33f5ebb1 | ||
|
|
65a6cb04e9 | ||
| d522437135 | |||
|
|
ab588d4123 | ||
|
|
a1c95f7f1b | ||
|
|
0c5e5798ea | ||
| 6f1149fae2 | |||
|
|
b4a7890f8a | ||
|
|
08b63c3a88 | ||
| 8f0729606e | |||
| 91e8d66941 | |||
| 1550bcd19c | |||
|
|
f8bd53596b | ||
| fa809e7b0b | |||
| 896287e5cf | |||
|
|
ef55dc901e | ||
| 1be09bf67a | |||
|
|
d1153659cb | ||
|
|
fffcdf483b | ||
|
|
f0e2797e8e | ||
|
|
46ac9db29d | ||
|
|
3fbca65f86 | ||
|
|
3b472eac65 | ||
|
|
d7a8578b0a | ||
|
|
2ba92103f9 | ||
|
|
a60986d0ca | ||
|
|
88cdceb780 | ||
|
|
6422392967 | ||
|
|
fe79e54917 | ||
|
|
ec8e849bf5 | ||
|
|
d7626a24b8 | ||
|
|
6cc92c111f | ||
|
|
2d5c5d2ba9 | ||
|
|
f67ff84af3 | ||
|
|
c72c0e9baf | ||
|
|
0a25834082 | ||
|
|
ec35f4bfb1 | ||
|
|
949403dd0d | ||
|
|
c05ee20821 | ||
|
|
b5d902a99d | ||
|
|
ccf9625f41 | ||
|
|
bb197f1236 | ||
|
|
8674f1974d | ||
|
|
1674a62fec | ||
|
|
18549d562f | ||
|
|
45316112b4 | ||
| f29542844a |
@@ -2,7 +2,7 @@
|
||||
"version" : "1.0",
|
||||
"configurations" : [
|
||||
{
|
||||
"playground" : "standard",
|
||||
"playground" : "custom",
|
||||
"type" : "uni-app:app-android"
|
||||
},
|
||||
{
|
||||
|
||||
2
App.vue
@@ -1,7 +1,7 @@
|
||||
<script>
|
||||
export default {
|
||||
onLaunch: function() {
|
||||
console.log('App Launch');
|
||||
console.log('App Launch ');
|
||||
uni.setStorageSync('adRewardedNum',0)
|
||||
|
||||
},
|
||||
|
||||
@@ -54,3 +54,22 @@ export const bind = (data) => {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 绑定微信
|
||||
*/
|
||||
export const $bindWx = (data) => {
|
||||
return http.request({
|
||||
url: 'Login/bindWx',
|
||||
method: 'POST',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 绑定微信状态
|
||||
export const $bindStatus = (data) => {
|
||||
return http.request({
|
||||
url: 'Login/bindStatus',
|
||||
method: 'GET',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
@@ -42,7 +42,12 @@ export const sendMessage = (data) => {
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
export const deleteUserByUserId = (data) => {
|
||||
return http.request({
|
||||
url: '/user/deleteUser',
|
||||
method: 'post',
|
||||
})
|
||||
}
|
||||
/**
|
||||
* 帮助中心
|
||||
*/
|
||||
@@ -63,6 +68,7 @@ export const collectVideoSummary = () => {
|
||||
method: 'GET'
|
||||
})
|
||||
}
|
||||
// 注销账号
|
||||
|
||||
/**
|
||||
* 金币
|
||||
|
||||
@@ -35,7 +35,8 @@ export const queryUserMoneyDetails = (data) => {
|
||||
*/
|
||||
export const updateUser = (data) => {
|
||||
return http.request({
|
||||
url: '/user/updateUser',
|
||||
url: '/user/bindAlipay',
|
||||
method: 'POST',
|
||||
params: data
|
||||
})
|
||||
}
|
||||
|
||||
@@ -27,7 +27,8 @@ export const getUserSignData = (data) => {
|
||||
export const receiveGoods = (data) => {
|
||||
return http.request({
|
||||
url: 'taskCenter/receiveGoods',
|
||||
data
|
||||
data,
|
||||
method: 'POST',
|
||||
})
|
||||
}
|
||||
// 任务-签到
|
||||
|
||||
@@ -138,3 +138,13 @@ export function playStatus(data) {
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
// 获取支付次数提示
|
||||
export function getPayTips(data){
|
||||
return http.request({
|
||||
url: 'course/getRedEnvelopeTips',
|
||||
method: 'GET',
|
||||
data
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
@@ -1,14 +1,13 @@
|
||||
|
||||
//打包时修改env的值即可
|
||||
const env='test' //test , production,local
|
||||
const env = 'production' //test,production,local
|
||||
|
||||
export const encryptKey='1234567890123456' // http数据加解密的key
|
||||
export const encryptKey = '1234567890123456' // http数据加解密的key
|
||||
|
||||
export const apiUrl='/czg/'
|
||||
export const apiUrl = '/czg/'
|
||||
export const h5Config = {
|
||||
production: 'https://dj-h5.hnsiyao.cn',
|
||||
production: 'https://web.hnsiyao.cn',
|
||||
test: 'https://web-api.hnsiyao.cn',
|
||||
local: 'http://192.168.1.41:8100'
|
||||
local: 'http://192.168.1.21:8100'
|
||||
}
|
||||
|
||||
export const AppConfig = {
|
||||
@@ -17,30 +16,30 @@ export const AppConfig = {
|
||||
local: 'http://192.168.1.41:8100'
|
||||
}
|
||||
|
||||
export function returnShareUrl(){
|
||||
if(env==='test'){
|
||||
export function returnShareUrl() {
|
||||
if (env === 'test') {
|
||||
return 'https://video-h5.hnsiyao.cn'
|
||||
}
|
||||
if(env==='production'){
|
||||
if (env === 'production') {
|
||||
return 'https://dj-h5.hnsiyao.cn'
|
||||
}
|
||||
if(env==='local'){
|
||||
if (env === 'local') {
|
||||
return AppConfig[env]
|
||||
}
|
||||
}
|
||||
// #ifdef H5
|
||||
export default{
|
||||
baseUrl:h5Config[env],
|
||||
baseApiUrl:h5Config[env]+apiUrl,
|
||||
shareUrl:returnShareUrl()
|
||||
export default {
|
||||
baseUrl: h5Config[env],
|
||||
baseApiUrl: h5Config[env] + apiUrl,
|
||||
shareUrl: returnShareUrl()
|
||||
}
|
||||
// #endif
|
||||
|
||||
|
||||
// #ifdef APP
|
||||
export default{
|
||||
baseUrl:AppConfig[env],
|
||||
baseApiUrl:AppConfig[env]+apiUrl,
|
||||
shareUrl:returnShareUrl()
|
||||
export default {
|
||||
baseUrl: AppConfig[env],
|
||||
baseApiUrl: AppConfig[env] + apiUrl,
|
||||
shareUrl: returnShareUrl()
|
||||
}
|
||||
// #endif
|
||||
69
components/disable-mask/disable-mask.vue
Normal file
@@ -0,0 +1,69 @@
|
||||
<template>
|
||||
<view class="container">
|
||||
<view class="dialog">
|
||||
<view class="title">
|
||||
<text class="t">风险提示</text>
|
||||
</view>
|
||||
<view class="content">
|
||||
<text class="t">您的账号暂不可用,详情请联系客服</text>
|
||||
</view>
|
||||
<view class="footer">
|
||||
<navigator class="btn" url="/pages/me/contact" style="height: 40px">
|
||||
<text class="t">去联系客服</text>
|
||||
</navigator>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script></script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.container {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
z-index: 99999999;
|
||||
background-color: rgba(0, 0, 0, 0.6);
|
||||
backdrop-filter: blur(3px);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
.dialog {
|
||||
width: 90%;
|
||||
background-color: #fff;
|
||||
border-radius: 20upx;
|
||||
.title {
|
||||
height: 100upx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
.t {
|
||||
font-size: 32upx;
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
.content {
|
||||
padding: 0 50upx;
|
||||
}
|
||||
.footer {
|
||||
padding: 80upx 28upx 28upx;
|
||||
display: flex;
|
||||
.btn {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background-color: #dd8591;
|
||||
color: #fff;
|
||||
border-radius: 12upx;
|
||||
.t {
|
||||
font-size: 28upx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -1,26 +1,31 @@
|
||||
<template>
|
||||
<view class="item" @appear="appear" @disappear="disappear" @click.stop :style="{height:height+'px'}" :key="index">
|
||||
<view class="item" @appear="appear" @disappear="disappear" @click.stop :style="{height:height+'px'}" :key="index">
|
||||
|
||||
<video class="u-flex-1 video" :show-fullscreen-btn="false" @controlstoggle="controlstoggles" v-if="showVideo"
|
||||
play-btn-position="center"
|
||||
:show-center-play-btn="false"
|
||||
:show-play-btn="false"
|
||||
:controls="true"
|
||||
@click.stop="videoClick()"
|
||||
@loadedmetadata="loadedmetadata"
|
||||
@timeupdate="timeupdate" @waiting="waiting()" object-fit="cover" @pause="onpause"
|
||||
<!-- :controls="showControls" -->
|
||||
<video class=" video" :show-fullscreen-btn="false" @controlstoggle="controlstoggles" v-if="showVideo"
|
||||
play-btn-position="bottom" :show-center-play-btn="true" :show-play-btn="true" @click.stop="videoClick()"
|
||||
@loadedmetadata="loadedmetadata" @timeupdate="timeupdate" @waiting="waiting()" object-fit="cover"
|
||||
@loadeddata="waiting()" @pause="onpause"
|
||||
@play="videoPlay('myVideo'+item.courseDetailsId,item.courseDetailsId)" :play-strategy="2"
|
||||
:show-loading="true" codec="software" :muted="false" :loop="loop"
|
||||
:enable-progress-gesture="false" :poster="item.titleImg" :ref="'myVideo'+item.courseDetailsId"
|
||||
:autoplay="autoplay" @ended="ended" :id="'myVideo'+item.courseDetailsId" :src="item.videoUrl"></video>
|
||||
:show-loading="true" codec="software" :muted="false" :loop="loop" :enable-progress-gesture="false"
|
||||
:poster="item.titleImg" :ref="'myVideo'+item.courseDetailsId" :autoplay="autoplay" @ended="ended"
|
||||
:id="'myVideo'+item.courseDetailsId" :src="item.videoUrl"></video>
|
||||
|
||||
<image class="poster" v-else @click.stop="posterClick" :src="item.titleImg"
|
||||
mode="aspectFill">
|
||||
|
||||
<image class="poster" v-else @click.stop="posterClick" :src="item.titleImg" mode="aspectFill">
|
||||
</image>
|
||||
|
||||
<view class="play-icon" v-if="videoIsLoadedmetadata&&showVideo&&!isPlying" @click.stop="videoClick()" :style="playStyle">
|
||||
<image class="icon" src="@/static/images/play.png" mode=""></image>
|
||||
<!-- #ifdef APP -->
|
||||
<view class="control-play-cover" v-if="showControls&&isIos" @click="playCoverClick()">
|
||||
</view>
|
||||
<!-- #endif -->
|
||||
|
||||
<!-- <view class="progress" v-if="showVideo&&!isPlying" @click.stop>
|
||||
<progress-vue @touchstart="progressScroll" @touchend="progressScrollEnd"></progress-vue>
|
||||
</view> -->
|
||||
|
||||
<!-- <view class="play-icon" v-if="showVideo&&!isPlying" @click.stop="playIconClick()" :style="playStyle">
|
||||
<image class="icon" src="@/static/images/play.png" mode=""></image>
|
||||
</view> -->
|
||||
|
||||
<view class="info" v-if="!isCommand" :style="infoStyle">
|
||||
<text class="color-fff" v-if="item.courseDetailsName">{{item.courseDetailsName}}</text>
|
||||
@@ -64,6 +69,10 @@
|
||||
|
||||
<script setup>
|
||||
import * as Api from '@/api/video/index.js'
|
||||
// #ifdef APP
|
||||
const domModule = uni.requireNativePlugin('dom')
|
||||
// #endif
|
||||
import progressVue from './progress.vue'
|
||||
import {
|
||||
computed,
|
||||
nextTick,
|
||||
@@ -79,13 +88,17 @@
|
||||
// #endif
|
||||
|
||||
const props = defineProps({
|
||||
isAndriod:{
|
||||
isIos:{
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
height:{
|
||||
type:Number,
|
||||
default:0
|
||||
isAndriod: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
height: {
|
||||
type: Number,
|
||||
default: 0
|
||||
},
|
||||
item: {
|
||||
type: Object,
|
||||
@@ -111,7 +124,7 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
isTabbar:{
|
||||
isTabbar: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
@@ -153,22 +166,47 @@
|
||||
type: Number,
|
||||
default: 1
|
||||
},
|
||||
showControls: {
|
||||
showAndriod: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
default: false
|
||||
}
|
||||
})
|
||||
|
||||
let isWaiting = ref(true)
|
||||
|
||||
function waiting() {
|
||||
console.log('waiting');
|
||||
isWaiting.value = true
|
||||
}
|
||||
|
||||
let showControls = ref(props.showAndriod?false:true)
|
||||
|
||||
let playPercent = ref(0)
|
||||
|
||||
|
||||
let autoplay = ref(props.item.videoUrl ? true : false)
|
||||
|
||||
const emits = defineEmits(['controlstoggles', 'disappear', 'appear', 'waiting', 'videoPlay', 'ended', 'dianzanClick',
|
||||
'share', 'zhuijuClick', 'popupShow', 'itemMounted', 'toDetail', 'showInfo', 'playStatusChange'
|
||||
'share', 'zhuijuClick', 'popupShow', 'itemMounted', 'toDetail', 'playStatusChange', 'progressScroll',
|
||||
'progressScrollEnd'
|
||||
])
|
||||
function posterClick(){
|
||||
if(!props.item.videoUrl){
|
||||
popupShow('pay',props.item)
|
||||
|
||||
function progressScroll(e) {
|
||||
emits('progressScroll')
|
||||
}
|
||||
|
||||
function progressScrollEnd(e) {
|
||||
emits('progressScrollEnd')
|
||||
}
|
||||
|
||||
function posterClick() {
|
||||
if (!props.item.videoUrl) {
|
||||
popupShow('pay', props.item)
|
||||
}
|
||||
}
|
||||
|
||||
function controlstoggles(e) {
|
||||
showControls.value = e.detail.show
|
||||
emits('controlstoggles', e)
|
||||
}
|
||||
|
||||
@@ -179,21 +217,16 @@
|
||||
emits('toDetail')
|
||||
}
|
||||
|
||||
function waiting() {
|
||||
|
||||
}
|
||||
let videoIsLoadedmetadata = ref(false)
|
||||
|
||||
let videoIsLoadedmetadata=ref(false)
|
||||
function loadedmetadata(){
|
||||
videoIsLoadedmetadata.value=true
|
||||
function loadedmetadata() {
|
||||
console.log('loadedmetadata');
|
||||
videoIsLoadedmetadata.value = true
|
||||
}
|
||||
|
||||
|
||||
let isPlying = ref(false)
|
||||
watch(() => isPlying.value, (newval) => {
|
||||
console.log(newval);
|
||||
emits('showInfo', newval)
|
||||
})
|
||||
|
||||
|
||||
//是否是第一次加载时的播放,不是暂停再播放
|
||||
@@ -216,6 +249,7 @@
|
||||
}
|
||||
|
||||
function timeupdate(e) {
|
||||
playPercent.value = e.detail.currentTime * 100 / e.detail.duration
|
||||
//隐藏loding
|
||||
uni.hideLoading()
|
||||
if (isPlayFinish) {
|
||||
@@ -229,31 +263,45 @@
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
let videoBar = null
|
||||
|
||||
|
||||
let watingTimer = null
|
||||
|
||||
function videoPlay() {
|
||||
if (isFirstPlay && !isPlayFinish) {
|
||||
sendPlayStatus('start')
|
||||
}
|
||||
|
||||
isFirstPlay = false
|
||||
isPlying.value = true
|
||||
clearTimeout(watingTimer)
|
||||
watingTimer = setTimeout(() => {
|
||||
isWaiting.value = false
|
||||
}, 1000)
|
||||
// showControls.value = false
|
||||
// #ifdef H5
|
||||
emits('controlstoggles', {
|
||||
detail: {
|
||||
show: false
|
||||
}
|
||||
})
|
||||
videoBar = videoBar ? videoBar : document.querySelector('.uni-video-bar');
|
||||
videoBar.style.cssText = 'display:none;';
|
||||
// #endif
|
||||
|
||||
// #ifdef APP
|
||||
if (!props.showAndriod) {}
|
||||
// #endif
|
||||
|
||||
|
||||
}
|
||||
|
||||
function onpause() {
|
||||
isPlying.value = false
|
||||
// showControls.value = true
|
||||
// #ifdef H5
|
||||
emits('controlstoggles', {
|
||||
detail: {
|
||||
show: true
|
||||
}
|
||||
})
|
||||
videoBar = videoBar ? videoBar : document.querySelector('.uni-video-bar');
|
||||
videoBar.style.cssText = '';
|
||||
// #endif
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -278,8 +326,36 @@
|
||||
emits('popupShow', key)
|
||||
}
|
||||
|
||||
function playCoverClick() {
|
||||
console.log('playCoverClick');
|
||||
if (video) {
|
||||
if (isPlying.value) {
|
||||
video.pause()
|
||||
} else {
|
||||
video.play()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function playIconClick(){
|
||||
if (video) {
|
||||
if (isPlying.value) {
|
||||
video.pause()
|
||||
} else {
|
||||
video.play()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function videoClick() {
|
||||
console.log('videoClick');
|
||||
// #ifdef APP
|
||||
// 兼容ios控制条和信息展示不同步
|
||||
if (isPlying.value&&showControls.value) {
|
||||
return
|
||||
}
|
||||
// #endif
|
||||
|
||||
if (video) {
|
||||
if (isPlying.value) {
|
||||
video.pause()
|
||||
@@ -305,17 +381,15 @@
|
||||
let video = null
|
||||
|
||||
function disappear(e) {
|
||||
emits('disappear',e)
|
||||
emits('disappear', e)
|
||||
if (video) {
|
||||
video.pause()
|
||||
}
|
||||
}
|
||||
const showVideo = computed(() => {
|
||||
if(props.isAndriod){
|
||||
console.log('props.nowIndex === props.index ');
|
||||
console.log(props.nowIndex,props.index );
|
||||
return (props.nowIndex === props.index && props.item.videoUrl) ?true :false
|
||||
}else{
|
||||
if (props.isAndriod) {
|
||||
return (props.nowIndex === props.index && props.item.videoUrl) ? true : false
|
||||
} else {
|
||||
return props.current === props.index && props.item.videoUrl
|
||||
}
|
||||
})
|
||||
@@ -330,7 +404,6 @@
|
||||
video = uni.createVideoContext('myVideo' + props.item.courseDetailsId)
|
||||
video.playbackRate(props.playSpeeds)
|
||||
video.play()
|
||||
console.log('init play');
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('------')
|
||||
@@ -344,7 +417,6 @@
|
||||
}
|
||||
})
|
||||
watch(() => showVideo.value, (newval) => {
|
||||
console.log('showVideo change:' + newval);
|
||||
if (newval) {
|
||||
isFirstPlay = true
|
||||
isPlayFinish = false
|
||||
@@ -366,26 +438,40 @@
|
||||
return {}
|
||||
// #endif
|
||||
})
|
||||
const playStyle=computed(()=>{
|
||||
if(isPlying.value){
|
||||
const playStyle = computed(() => {
|
||||
if (isPlying.value) {
|
||||
return {
|
||||
bottom:'0'
|
||||
bottom: '0'
|
||||
}
|
||||
}
|
||||
return {
|
||||
bottom: props.isTabbar ? (50+44 +'px') : '44px'
|
||||
bottom: props.isTabbar ? (50 + 44 + 'px') : '44px'
|
||||
}
|
||||
})
|
||||
const infoStyle = computed(() => {
|
||||
// #ifdef H5
|
||||
return {
|
||||
transform: `translateX(${(!isPlying.value||!props.item.videoUrl)?0:'-750rpx'})`
|
||||
}
|
||||
// #endif
|
||||
return {
|
||||
transform: `translateX(${(showControls.value||!props.item.videoUrl)?0:'-750rpx'})`
|
||||
}
|
||||
// return {
|
||||
// transform: `translateX(${(!isPlying.value||!props.item.videoUrl)?0:'-750rpx'})`
|
||||
// }
|
||||
})
|
||||
|
||||
const rightStyle = computed(() => {
|
||||
// #ifdef H5
|
||||
return {
|
||||
transform: `translateX(${(!isPlying.value||!props.item.videoUrl)?'0':60}px)`
|
||||
}
|
||||
// #endif
|
||||
return {
|
||||
transform: `translateX(${(showControls.value||!props.item.videoUrl)?'0':60}px)`
|
||||
}
|
||||
|
||||
})
|
||||
</script>
|
||||
|
||||
@@ -396,6 +482,12 @@
|
||||
position: relative;
|
||||
}
|
||||
|
||||
/* 假设控制条的类名为 uni-video-controls */
|
||||
.uni-video-controls {
|
||||
transition: none !important;
|
||||
-webkit-transition: none !important;
|
||||
}
|
||||
|
||||
.box {
|
||||
/* #ifdef H5 */
|
||||
flex: 1;
|
||||
@@ -509,7 +601,8 @@
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
.play-icon{
|
||||
|
||||
.play-icon {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
right: 0;
|
||||
@@ -517,8 +610,9 @@
|
||||
bottom: 0;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
$icon-size:80rpx;
|
||||
.icon{
|
||||
$icon-size: 80rpx;
|
||||
|
||||
.icon {
|
||||
width: $icon-size;
|
||||
height: $icon-size;
|
||||
}
|
||||
@@ -541,8 +635,28 @@
|
||||
}
|
||||
}
|
||||
|
||||
.progress {
|
||||
padding: 20rpx;
|
||||
position: absolute;
|
||||
bottom: 20rpx;
|
||||
left: 0;
|
||||
right: 0;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.zhifubao {
|
||||
width: 56rpx;
|
||||
height: 56rpx;
|
||||
}
|
||||
|
||||
.control-play-cover {
|
||||
position: absolute;
|
||||
left: 10px;
|
||||
bottom: 0;
|
||||
width: 38px;
|
||||
height: 44px;
|
||||
// background-color: red;
|
||||
background-color: transparent;
|
||||
z-index: 1;
|
||||
}
|
||||
</style>
|
||||
68
components/my-video-list/progress.vue
Normal file
@@ -0,0 +1,68 @@
|
||||
<template>
|
||||
<view class="progress-box">
|
||||
<view class="line" :style="{width:percent+'px'}">
|
||||
</view>
|
||||
<view class="block" @touchstart="progressTouchStart" @touchmove="progressTouchMove"
|
||||
:style="{transform:'translateX('+percent+'px)'}"
|
||||
@touchend="progressTouchEnd"></view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import {
|
||||
ref
|
||||
} from 'vue';
|
||||
const props=defineProps({
|
||||
})
|
||||
|
||||
|
||||
let percent=ref(50)
|
||||
//进度条
|
||||
let progressIsTouch = false
|
||||
let start = 0
|
||||
function progressTouchStart(e) {
|
||||
console.log(e);
|
||||
start = e.touches[0].clientX
|
||||
progressIsTouch = true
|
||||
}
|
||||
|
||||
function progressTouchMove(e) {
|
||||
console.log(e);
|
||||
const step = 1;
|
||||
playPercent.value += step
|
||||
}
|
||||
|
||||
function progressTouchEnd(e) {
|
||||
console.log(e);
|
||||
progressIsTouch = false
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.progress-box {
|
||||
border-radius: 20px;
|
||||
height: 5px;
|
||||
margin: 4px 0;
|
||||
background-color: rgba(255, 255, 255, .6);
|
||||
box-shadow: 0 0 1px #eee;
|
||||
flex-direction: row;
|
||||
overflow: visible;
|
||||
.line {
|
||||
background-color: #fff;
|
||||
border-radius: 20px;
|
||||
overflow: visible;
|
||||
}
|
||||
$block-size: 8px;
|
||||
.block {
|
||||
top: -1px;
|
||||
left: 0;
|
||||
position: absolute;
|
||||
z-index: 2;
|
||||
width: $block-size;
|
||||
height: $block-size;
|
||||
background-color: #fff;
|
||||
border-radius: 50%;
|
||||
box-shadow: 0 0 1px #eee;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
54
http/http.js
@@ -7,6 +7,7 @@ import {
|
||||
reject
|
||||
} from "lodash";
|
||||
import config from "@/commons/config.js";
|
||||
|
||||
// 测试服
|
||||
let baseUrl = config.baseApiUrl + "app";
|
||||
const loadingShowTime = 200;
|
||||
@@ -60,6 +61,7 @@ function commonsProcess(showLoading, httpReqCallback, isreturm) {
|
||||
if (isreturm) {
|
||||
return Promise.resolve(bodyData);
|
||||
}
|
||||
|
||||
if (statusCode == 500) {
|
||||
isShowErrorToast = true;
|
||||
return Promise.reject(bodyData); // 跳转到catch函数
|
||||
@@ -73,8 +75,6 @@ function commonsProcess(showLoading, httpReqCallback, isreturm) {
|
||||
// http响应码不正确
|
||||
if (statusCode != 200 && statusCode != 204 && statusCode != 201) {
|
||||
isShowErrorToast = true;
|
||||
data.message =
|
||||
data.message == "Bad credentials" ? "用户名或密码错误" : data.message;
|
||||
infoBox.showToast(data.message || "服务器异常");
|
||||
return Promise.reject(bodyData); // 跳转到catch函数
|
||||
}
|
||||
@@ -83,11 +83,39 @@ function commonsProcess(showLoading, httpReqCallback, isreturm) {
|
||||
isShowErrorToast = true;
|
||||
return Promise.reject(bodyData); // 跳转到catch函数
|
||||
}
|
||||
if (bodyData.code == 701) {
|
||||
uni.clearStorageSync()
|
||||
uni.reLaunch({
|
||||
url: '/pages/login/login'
|
||||
})
|
||||
return Promise.reject(bodyData); // 跳转到catch函数
|
||||
}
|
||||
if (bodyData.code == 702) {
|
||||
return Promise.reject(bodyData); // 跳转到catch函数
|
||||
}
|
||||
if (bodyData.code == 500) {
|
||||
// 提示信息
|
||||
isShowErrorToast = true;
|
||||
return Promise.reject(bodyData); // 跳转到catch函数
|
||||
}
|
||||
|
||||
|
||||
let result = null;
|
||||
if (bodyData.hasOwnProperty('data')) {
|
||||
result = bodyData.data
|
||||
} else if (bodyData.hasOwnProperty('page')) {
|
||||
result = bodyData.page
|
||||
} else {
|
||||
result = bodyData
|
||||
}
|
||||
|
||||
//未绑定微信
|
||||
if (bodyData.code == 407) {
|
||||
return Promise.resolve(result);
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (bodyData.code != 0) {
|
||||
infoBox.showToast(data.message);
|
||||
return;
|
||||
@@ -100,16 +128,8 @@ function commonsProcess(showLoading, httpReqCallback, isreturm) {
|
||||
code: bodyData.code,
|
||||
});
|
||||
}
|
||||
let result=null;
|
||||
if(bodyData.hasOwnProperty('data')){
|
||||
result=bodyData.data
|
||||
}
|
||||
else if(bodyData.hasOwnProperty('page')){
|
||||
result=bodyData.page
|
||||
}
|
||||
else{
|
||||
result=bodyData
|
||||
}
|
||||
|
||||
|
||||
// 构造请求成功的响应数据
|
||||
return Promise.resolve(result);
|
||||
})
|
||||
@@ -122,14 +142,12 @@ function commonsProcess(showLoading, httpReqCallback, isreturm) {
|
||||
}
|
||||
|
||||
if (res.code == 401) {
|
||||
infoBox.showToast(res.message || "请登录").then(() => {
|
||||
uni.redirectTo({
|
||||
url: "/pages/login/login",
|
||||
});
|
||||
reject();
|
||||
uni.redirectTo({
|
||||
url: "/pages/login/login",
|
||||
});
|
||||
reject();
|
||||
}
|
||||
if (res.code != 0) {
|
||||
if (res.code != 0 && res.code != 401) {
|
||||
infoBox.showToast(res.msg).then(() => {});
|
||||
reject();
|
||||
}
|
||||
|
||||
@@ -1,12 +1,21 @@
|
||||
{
|
||||
"name" : "duanju-app-v3",
|
||||
"name" : "斯耀短剧",
|
||||
"appid" : "__UNI__E0B05B1",
|
||||
"description" : "",
|
||||
"versionName" : "2.3.4",
|
||||
"versionCode" : 234,
|
||||
"versionName" : "1.3.2",
|
||||
"versionCode" : 132,
|
||||
"transformPx" : false,
|
||||
/* 5+App特有相关 */
|
||||
"app-plus" : {
|
||||
"app" : {
|
||||
"name" : "斯耀短剧1",
|
||||
"pkgName" : "com.hnsiyao.duanju" // 安卓包名
|
||||
},
|
||||
"ios" : {
|
||||
"name" : "顺享短剧2",
|
||||
"app-category" : "public.app-category.utilities",
|
||||
"bundleID" : "com.hnsiyao.duanju" // iOS bundle ID
|
||||
},
|
||||
"usingComponents" : true,
|
||||
"nvueStyleCompiler" : "uni-app",
|
||||
"compilerVersion" : 3,
|
||||
@@ -21,7 +30,8 @@
|
||||
"Camera" : {},
|
||||
"Push" : {},
|
||||
"VideoPlayer" : {},
|
||||
"Canvas" : "nvue canvas" //使用Canvas模块
|
||||
"Canvas" : "nvue canvas", //使用Canvas模块
|
||||
"OAuth" : {}
|
||||
},
|
||||
/* 应用发布信息 */
|
||||
"distribute" : {
|
||||
@@ -65,6 +75,12 @@
|
||||
},
|
||||
"ad" : {
|
||||
"ks" : {}
|
||||
},
|
||||
"oauth" : {
|
||||
"weixin" : {
|
||||
"appid" : "wx5001ff1af6c4781f",
|
||||
"UniversalLinks" : ""
|
||||
}
|
||||
}
|
||||
},
|
||||
"abiFilters" : [ "armeabi-v7a", "arm64-v8a", "x86" ],
|
||||
|
||||
10
pages.json
@@ -32,7 +32,8 @@
|
||||
{
|
||||
"path": "pages/task/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "任务大厅"
|
||||
"navigationBarTitleText": "任务大厅",
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
}, {
|
||||
"path": "pages/chasingDrama/index",
|
||||
@@ -209,6 +210,13 @@
|
||||
{
|
||||
"navigationBarTitleText" : "兑换"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path" : "pages/login/bindWx",
|
||||
"style" :
|
||||
{
|
||||
"navigationBarTitleText" : "绑定微信"
|
||||
}
|
||||
}
|
||||
],
|
||||
"globalStyle": {
|
||||
|
||||
@@ -52,14 +52,17 @@
|
||||
<emprty-card v-if="!data.list2.length" />
|
||||
</view>
|
||||
</view>
|
||||
<disable-mask v-if="disableShow"></disable-mask>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { reactive } from 'vue';
|
||||
import { reactive, ref } from 'vue';
|
||||
import { selectByUserId } from '@/api/me/me.js';
|
||||
import { onLoad, onPullDownRefresh, onReachBottom } from '@dcloudio/uni-app';
|
||||
import { linkTo } from '@/utils/app.js';
|
||||
|
||||
const disableShow = ref(false);
|
||||
|
||||
// 获取数据
|
||||
async function selectByUserIdAjax() {
|
||||
try {
|
||||
@@ -69,6 +72,11 @@ async function selectByUserIdAjax() {
|
||||
data.list2 = res2.records;
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
if (error.code == 702) {
|
||||
disableShow.value = true;
|
||||
} else {
|
||||
disableShow.value = false;
|
||||
}
|
||||
}
|
||||
setTimeout(() => {
|
||||
uni.stopPullDownRefresh();
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
|
||||
function seVideo(item) {
|
||||
uni.navigateTo({
|
||||
url:"/pages/video/detail?courseId="+item.courseId+"&courseDetailsId="+item.courseDetailsId
|
||||
url: "/pages/video/detail?courseId=" + item.courseId + "&courseDetailsId=" + item.courseDetailsId
|
||||
})
|
||||
}
|
||||
</script>
|
||||
@@ -35,7 +35,7 @@
|
||||
.contentlist {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-around;
|
||||
justify-content: space-between;
|
||||
flex-wrap: wrap;
|
||||
margin-top: 10rpx;
|
||||
padding: 0 26rpx;
|
||||
@@ -44,17 +44,19 @@
|
||||
border-radius: 21rpx 21rpx 21rpx 21rpx;
|
||||
width: 30%;
|
||||
margin-top: 20rpx;
|
||||
text-align: center;
|
||||
|
||||
>view {
|
||||
font-weight: 400;
|
||||
font-size: 25rpx;
|
||||
text-align: left;
|
||||
margin-left: 10rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.liststyle:last-child {
|
||||
// margin-right: auto;
|
||||
// margin-left: 6rpx;
|
||||
}
|
||||
// .liststyle:last-child {
|
||||
// margin-right: auto;
|
||||
// margin-left: 6rpx;
|
||||
// }
|
||||
}
|
||||
</style>
|
||||
@@ -1,7 +1,6 @@
|
||||
<template>
|
||||
<view class="indexStyle">
|
||||
<image src="@/static/index/indexbh.png" mode="">
|
||||
</image>
|
||||
<image src="@/static/index/indexbh.png" mode=""></image>
|
||||
<view class="indexStyleTwo">
|
||||
<image src="@/static/logo.png" mode=""></image>
|
||||
<!-- <view @tap="moreVideo">
|
||||
@@ -10,365 +9,430 @@
|
||||
</view> -->
|
||||
</view>
|
||||
|
||||
<template v-if="datas.setindexdata">
|
||||
<template v-if="datas.isExamine">
|
||||
<view class="gongao">
|
||||
<view class="gongaoicon">
|
||||
公告
|
||||
</view>
|
||||
<swiper :autoplay="true" :vertical="true" :interval="4000" :circular="true" :indicator-dots="false"
|
||||
class="swiperstyle">
|
||||
<view class="gongaoicon">公告</view>
|
||||
<swiper :autoplay="true" :vertical="true" :interval="4000" :circular="true" :indicator-dots="false" class="swiperstyle">
|
||||
<swiper-item v-for="(item, index) in datas.noticeList" :key="index">
|
||||
<view style="height: 80rpx;line-height: 80rpx;">{{ item.title }}</view>
|
||||
<view style="height: 80rpx; line-height: 80rpx; font-size: 14px">{{ item.title }}</view>
|
||||
</swiper-item>
|
||||
</swiper>
|
||||
</view>
|
||||
</template>
|
||||
</view>
|
||||
<view class="navTop">
|
||||
<view :class="datas.active == 1 ? 'navTop-active' : ''" @tap="getrecomVideo('', 1)">
|
||||
最新
|
||||
</view>
|
||||
<view :class="datas.active == 2 ? 'navTop-active' : ''" @tap="getrecomVideo('1', 2)">
|
||||
排行
|
||||
</view>
|
||||
<view :class="datas.active == 3 ? 'navTop-active' : ''" @tap="getrecomVideo('2', 3)">
|
||||
最热
|
||||
</view>
|
||||
<view :class="datas.active == 4 ? 'navTop-active' : ''" @tap="getrecomVideo('1', 4)">
|
||||
剧情
|
||||
</view>
|
||||
<view :class="datas.active == 5 ? 'navTop-active' : ''" @tap="getrecomVideo('2', 5)">
|
||||
飙升
|
||||
</view>
|
||||
<view :class="datas.active == 1 ? 'navTop-active' : ''" @tap="getrecomVideo('', 1)">最新</view>
|
||||
<view :class="datas.active == 2 ? 'navTop-active' : ''" @tap="getrecomVideo('1', 2)">排行</view>
|
||||
<view :class="datas.active == 3 ? 'navTop-active' : ''" @tap="getrecomVideo('2', 3)">最热</view>
|
||||
<view :class="datas.active == 4 ? 'navTop-active' : ''" @tap="getrecomVideo('1', 4)">剧情</view>
|
||||
<view :class="datas.active == 5 ? 'navTop-active' : ''" @tap="getrecomVideo('2', 5)">飙升</view>
|
||||
</view>
|
||||
<contentlist :list='datas.list'></contentlist>
|
||||
<image v-if="datas.setindexdata" @click="goMsg()" src="@/static/index/red-pack-new.gif"
|
||||
style="width: 200rpx;height: 200rpx;position: fixed;right: 10rpx;bottom: 180rpx;" mode=""></image>
|
||||
<up-modal :show="datas.version.show" :confirm-text="datas.version.confirmText"
|
||||
:showCancelButton="datas.version.cancelText!=''" @confirm='confirmUpdateVersion' :title="datas.version.title"
|
||||
:title-style="{ fontWeight: '700' }" confirm-color="rgb(255, 117, 129)" @cancel="datas.version.show = false">
|
||||
<view class="" style="padding-top: 30rpx;text-align: left;">
|
||||
<scroll-view scroll-y="true" style="max-height: 50vh;">
|
||||
<rich-text style="color:#666" :nodes="datas.version.content"></rich-text>
|
||||
<contentlist :list="datas.list"></contentlist>
|
||||
<image
|
||||
v-if="datas.isExamine"
|
||||
@click="goMsg()"
|
||||
src="@/static/index/red-pack-new.gif"
|
||||
style="width: 200rpx; height: 200rpx; position: fixed; right: 10rpx; bottom: 180rpx"
|
||||
mode=""
|
||||
></image>
|
||||
<up-modal
|
||||
:show="datas.version.show"
|
||||
:confirm-text="datas.version.confirmText"
|
||||
:showCancelButton="datas.version.cancelText != ''"
|
||||
@cancel="cancelUpdateVersion"
|
||||
@confirm="confirmUpdateVersion"
|
||||
:title="datas.version.title"
|
||||
:title-style="{ fontWeight: '700' }"
|
||||
confirm-color="rgb(255, 117, 129)"
|
||||
>
|
||||
<view class="" style="padding-top: 30rpx; text-align: left">
|
||||
<scroll-view scroll-y="true" style="max-height: 50vh">
|
||||
<!-- <rich-text style="color:#666" :nodes="datas.version.content"></rich-text> -->
|
||||
<view style="text-align: justify; font-size: 18px; color: #666" v-html="datas.version.content"></view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</up-modal>
|
||||
<up-modal :show="datas.ruleShow" v-if="$common.isIosExamine&&!datas.version.show" confirm-text="知道了" title="规则说明"
|
||||
:title="datas.rule_title" :title-style="{fontWeight:'700'}" @confirm="ruleConfirm"
|
||||
confirm-color="rgb(255, 117, 129)">
|
||||
<view class="u-p-30 u-text-left">
|
||||
<scroll-view scroll-y="true" style="max-height: 50vh;">
|
||||
<rich-text style="text-align: justify;font-size: 18px;color: #666;"
|
||||
:nodes="datas.rule_content"></rich-text>
|
||||
</scroll-view>
|
||||
|
||||
<!-- h5关闭通知 -->
|
||||
<!-- #ifdef H5 -->
|
||||
<up-modal
|
||||
:show="datas.stopShow"
|
||||
cancel-text="知道了"
|
||||
show-cancel-button
|
||||
confirm-text="去下载"
|
||||
title="重要通知"
|
||||
@cancel="stopCancel"
|
||||
:title="datas.rule_title"
|
||||
:title-style="{ fontWeight: '700' }"
|
||||
@confirm="stopConfirm"
|
||||
confirm-color="rgb(255, 117, 129)"
|
||||
>
|
||||
<view class="color-red u-text-left">
|
||||
<text>2025年2月8日将关闭网页访问,请及时下载最新APP</text>
|
||||
</view>
|
||||
</up-modal>
|
||||
<!-- #endif -->
|
||||
|
||||
<!-- 公告弹窗 -->
|
||||
<up-modal :show="datas.stopShows && datas.isExamine" :showConfirmButton="true" title="公告" @confirm="confirmEvent">
|
||||
<view class="color-red u-text-left">
|
||||
<view style="text-align: justify; font-size: 18px; color: #666" v-html="datas.noticeList[datas.cloneNum].title"></view>
|
||||
</view>
|
||||
</up-modal>
|
||||
<!-- #ifdef APP -->
|
||||
<!-- #endif -->
|
||||
<disable-mask v-if="disableMaskVisable"></disable-mask>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import {
|
||||
reactive,
|
||||
nextTick
|
||||
} from 'vue';
|
||||
import {
|
||||
announcement,
|
||||
messageselectMessage,
|
||||
courseselectCourse
|
||||
} from '@/api/index/index.js'
|
||||
import {
|
||||
onLoad,
|
||||
onReady,
|
||||
onReachBottom,
|
||||
onShow
|
||||
} from '@dcloudio/uni-app'
|
||||
import contentlist from './components/contentlist.vue'
|
||||
import {
|
||||
selectNewApp
|
||||
} from '@/api/user/user.js';
|
||||
import config from '@/commons/config.js';
|
||||
import {
|
||||
linkTo
|
||||
} from '@/utils/app.js';
|
||||
import {
|
||||
useCommonStore
|
||||
} from '@/store/common.js'
|
||||
const $common = useCommonStore()
|
||||
onShow(() => {
|
||||
console.log('cash:' + uni.getStorageSync('userInfo').userId + "" + new Date().getTime(), 'debug')
|
||||
// 判断ios是否审核
|
||||
$common.init()
|
||||
let sysInfo = uni.getSystemInfoSync()
|
||||
let isIos = sysInfo.platform == 'ios'
|
||||
if (isIos) {
|
||||
datas.setindexdata = $common.isIosExamine
|
||||
}
|
||||
})
|
||||
let datas = reactive({
|
||||
noticeList: [], //公告列表
|
||||
import { reactive, nextTick, ref } from 'vue';
|
||||
import { announcement, messageselectMessage, courseselectCourse } from '@/api/index/index.js';
|
||||
import { onLoad, onReady, onReachBottom, onShow } from '@dcloudio/uni-app';
|
||||
import contentlist from './components/contentlist.vue';
|
||||
import { selectNewApp } from '@/api/user/user.js';
|
||||
import config from '@/commons/config.js';
|
||||
import { linkTo } from '@/utils/app.js';
|
||||
import { useCommonStore } from '@/store/common.js';
|
||||
const $common = useCommonStore();
|
||||
onShow(() => {
|
||||
// console.log('cash:' + uni.getStorageSync('userInfo').userId + "" + new Date().getTime(), 'debug')
|
||||
// 判断ios是否审核
|
||||
$common.init();
|
||||
// #ifdef H5
|
||||
datas.isExamine = $common.isIosExamine;
|
||||
// #endif
|
||||
// let sysInfo = uni.getSystemInfoSync()
|
||||
// let isIos = sysInfo.platform == 'ios'
|
||||
// if (isIos) {
|
||||
// datas.setindexdata = $common.setversion
|
||||
// console.log(datas.setindexdata,'seaeasdas')
|
||||
// }
|
||||
getrecomVideo();
|
||||
});
|
||||
|
||||
active: 1, // 最新、最热。。。切换顶部导航栏
|
||||
const disableMaskVisable = ref(false);
|
||||
|
||||
list: [], // 底部短剧内容
|
||||
page: 1, // 首页推荐分页
|
||||
let datas = reactive({
|
||||
noticeList: [], //公告列表
|
||||
|
||||
ruleShow: false,
|
||||
rule_title: '', // 首页弹窗标题
|
||||
rule_content: '', // 首页弹窗内容
|
||||
ruleIndex: 0,
|
||||
ruleList: [],
|
||||
active: 1, // 最新、最热。。。切换顶部导航栏
|
||||
|
||||
version: {
|
||||
show: false,
|
||||
title: "",
|
||||
content: "",
|
||||
confirmText: "",
|
||||
cancelText: "",
|
||||
},
|
||||
setindexdata :"false"
|
||||
})
|
||||
onLoad(() => {
|
||||
versionUpdate()
|
||||
getMsg()
|
||||
getrecomVideo()
|
||||
datas.isExamine = $common.isIosExamine || 0
|
||||
})
|
||||
onReady(() => {
|
||||
if (!uni.getStorageSync('ruleShow')) {
|
||||
announcement({
|
||||
type: 0
|
||||
}).then(res => {
|
||||
list: [], // 底部短剧内容
|
||||
page: 1, // 首页推荐分页
|
||||
stopShow: true, //h5关闭弹窗
|
||||
ruleShow: false,
|
||||
rule_title: '', // 首页弹窗标题
|
||||
rule_content: '', // 首页弹窗内容
|
||||
ruleIndex: 0,
|
||||
ruleList: [],
|
||||
stopShows: false,
|
||||
version: {
|
||||
show: false,
|
||||
title: '',
|
||||
content: '',
|
||||
confirmText: '',
|
||||
cancelText: '',
|
||||
downloadLink: ''
|
||||
},
|
||||
setindexdata: false,
|
||||
cloneNum: 0
|
||||
});
|
||||
onLoad(() => {
|
||||
versionUpdate();
|
||||
getMsg();
|
||||
});
|
||||
onReady(() => {
|
||||
if (!uni.getStorageSync('ruleShow')) {
|
||||
announcement({
|
||||
type: 0
|
||||
})
|
||||
.then((res) => {
|
||||
if (res) {
|
||||
datas.ruleShow = true
|
||||
datas.ruleList = res
|
||||
ruleInit()
|
||||
datas.ruleShow = true;
|
||||
datas.ruleList = res;
|
||||
ruleInit();
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
})
|
||||
onReachBottom(() => {
|
||||
++datas.page
|
||||
getrecomVideo()
|
||||
})
|
||||
|
||||
function versionUpdate() {
|
||||
//#ifdef APP-PLUS
|
||||
plus.screen.lockOrientation('portrait-primary'); //竖屏正方向锁定
|
||||
//获取当前系统版本信息
|
||||
plus.runtime.getProperty(plus.runtime.appid, widgetInfo => {
|
||||
//请求后台接口 解析数据 对比版本
|
||||
selectNewApp().then(res => {
|
||||
res = res[0];
|
||||
let version;
|
||||
if (uni.getSystemInfoSync().platform == 'android') {
|
||||
version = res.version
|
||||
}
|
||||
if (uni.getSystemInfoSync().platform == 'ios') {
|
||||
version = res.iosVersion
|
||||
$common.setversion(widgetInfo.version, version)
|
||||
}
|
||||
version = res.version
|
||||
// && uni.getSystemInfoSync().platform == 'android'
|
||||
if (widgetInfo.version < version) {
|
||||
let downloadLink = '';
|
||||
let androidLink = res.androidWgtUrl;
|
||||
let iosLink = res.iosWgtUrl;
|
||||
datas.version.show = true;
|
||||
datas.version.title = "发现新版本";
|
||||
datas.version.content = res.des;
|
||||
if (res.method == "true") {
|
||||
datas.version.confirmText = "立即更新"
|
||||
} else {
|
||||
datas.version.confirmText = "立即更新"
|
||||
datas.version.cancelText = "下次更新"
|
||||
|
||||
}
|
||||
}
|
||||
.catch((err) => {
|
||||
console.log(err);
|
||||
});
|
||||
});
|
||||
//#endif
|
||||
}
|
||||
});
|
||||
onReachBottom(() => {
|
||||
++datas.page;
|
||||
getrecomVideo();
|
||||
});
|
||||
// 公告
|
||||
async function getMsg() {
|
||||
let res = await messageselectMessage();
|
||||
let arr = [];
|
||||
let ids = uni.getStorageSync('ids');
|
||||
res.list.forEach((ele) => {
|
||||
if (ids.length) {
|
||||
if (ids.indexOf(ele.id) == -1) {
|
||||
arr.push(ele);
|
||||
}
|
||||
} else {
|
||||
uni.setStorageSync('ids', [res.list[0].id]);
|
||||
arr.push(ele);
|
||||
}
|
||||
});
|
||||
datas.noticeList = arr;
|
||||
if (arr.length) {
|
||||
if (ids.length) {
|
||||
uni.setStorageSync('ids', [...uni.getStorageSync('ids'), datas.noticeList[datas.cloneNum].id]);
|
||||
}
|
||||
datas.stopShows = true;
|
||||
}
|
||||
}
|
||||
|
||||
function confirmUpdateVersion() {
|
||||
// plus.runtime.openURL(config.baseUrl + '/pages/login/appEq')
|
||||
linkTo('/pages/login/download')
|
||||
return
|
||||
uni.showLoading({
|
||||
title: '下载中...',
|
||||
mask: true
|
||||
});
|
||||
if (uni.getSystemInfoSync().platform == 'android') {
|
||||
uni.downloadFile({
|
||||
url: androidLink,
|
||||
success: downloadResult => {
|
||||
console.log(downloadResult)
|
||||
if (downloadResult.statusCode === 200) {
|
||||
plus.runtime.install(
|
||||
downloadResult.tempFilePath, {
|
||||
force: false
|
||||
},
|
||||
d => {
|
||||
console.log('install success...');
|
||||
plus.runtime
|
||||
.restart();
|
||||
},
|
||||
e => {
|
||||
console.log(e)
|
||||
console.error('install fail...');
|
||||
}
|
||||
);
|
||||
}
|
||||
function confirmEvent() {
|
||||
datas.stopShows = false;
|
||||
if (datas.cloneNum < datas.noticeList.length - 1) {
|
||||
++datas.cloneNum;
|
||||
uni.setStorageSync('ids', [...uni.getStorageSync('ids'), datas.noticeList[datas.cloneNum].id]);
|
||||
datas.stopShows = true;
|
||||
}
|
||||
}
|
||||
|
||||
function stopConfirm() {
|
||||
datas.stopShow = false;
|
||||
uni.navigateTo({
|
||||
url: '/pages/login/download'
|
||||
});
|
||||
}
|
||||
|
||||
function stopCancel() {
|
||||
datas.stopShow = false;
|
||||
}
|
||||
|
||||
function versionUpdate() {
|
||||
//#ifdef APP-PLUS
|
||||
plus.screen.lockOrientation('portrait-primary'); //竖屏正方向锁定
|
||||
//获取当前系统版本信息
|
||||
plus.runtime.getProperty(plus.runtime.appid, (widgetInfo) => {
|
||||
//请求后台接口 解析数据 对比版本
|
||||
selectNewApp().then(async (res) => {
|
||||
res = res[0];
|
||||
console.log(uni.getSystemInfoSync().platform == 'ios', 1101);
|
||||
let version;
|
||||
if (uni.getSystemInfoSync().platform == 'android') {
|
||||
version = res.version;
|
||||
}
|
||||
if (uni.getSystemInfoSync().platform == 'ios') {
|
||||
version = res.iosVersion;
|
||||
}
|
||||
let isVersion = await $common.setversion(widgetInfo.version, version);
|
||||
datas.isExamine = $common.isIosExamine;
|
||||
console.log(isVersion, '');
|
||||
if (isVersion == 1) {
|
||||
datas.version.downloadLink = res.androidWgtUrl;
|
||||
datas.version.show = true;
|
||||
datas.version.title = '发现新版本';
|
||||
datas.version.content = res.des;
|
||||
uni.hideTabBar();
|
||||
if (res.method == 'true') {
|
||||
datas.version.confirmText = '立即更新';
|
||||
} else {
|
||||
datas.version.confirmText = '立即更新';
|
||||
datas.version.cancelText = '下次更新';
|
||||
}
|
||||
});
|
||||
}
|
||||
if (uni.getSystemInfoSync().platform == 'ios') {
|
||||
plus.runtime.openURL(iosLink, function(res) {});
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
//#endif
|
||||
}
|
||||
|
||||
function ruleInit() {
|
||||
datas.rule_title = datas.ruleList[datas.ruleIndex].title
|
||||
datas.rule_content = datas.ruleList[datas.ruleIndex].content
|
||||
}
|
||||
/**
|
||||
* 规则确认
|
||||
*/
|
||||
function ruleConfirm() {
|
||||
datas.ruleShow = false
|
||||
datas.ruleIndex++
|
||||
if (datas.ruleIndex >= datas.ruleList.length) {
|
||||
datas.ruleIndex = 0
|
||||
uni.setStorageSync('ruleShow', true)
|
||||
return
|
||||
}
|
||||
setTimeout(res => {
|
||||
ruleInit()
|
||||
datas.ruleShow = true
|
||||
}, 300)
|
||||
}
|
||||
function cancelUpdateVersion() {
|
||||
uni.showTabBar();
|
||||
datas.version.show = false;
|
||||
}
|
||||
|
||||
// 跳转公告链接
|
||||
function goMsg(url) {
|
||||
uni.navigateTo({
|
||||
url: '/pages/index/prizeDraw/kevy-luckydraw'
|
||||
function confirmUpdateVersion() {
|
||||
// plus.runtime.openURL(config.baseUrl + '/pages/login/appEq')
|
||||
linkTo('/pages/login/download');
|
||||
return;
|
||||
uni.showLoading({
|
||||
title: '下载中...',
|
||||
mask: true
|
||||
});
|
||||
if (uni.getSystemInfoSync().platform == 'android') {
|
||||
uni.downloadFile({
|
||||
url: datas.version.downloadLink,
|
||||
success: (downloadResult) => {
|
||||
console.log(downloadResult);
|
||||
if (downloadResult.statusCode === 200) {
|
||||
plus.runtime.install(
|
||||
downloadResult.tempFilePath,
|
||||
{
|
||||
force: false
|
||||
},
|
||||
(d) => {
|
||||
console.log('install success...');
|
||||
plus.runtime.restart();
|
||||
},
|
||||
(e) => {
|
||||
console.log(e);
|
||||
console.error('install fail...');
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
if (uni.getSystemInfoSync().platform == 'ios') {
|
||||
plus.runtime.openURL(datas.version.downloadLink, function (res) {});
|
||||
}
|
||||
}
|
||||
|
||||
// 搜索跳转
|
||||
function moreVideo() {
|
||||
uni.navigateTo({
|
||||
url: '/pages/index/search/index'
|
||||
});
|
||||
function ruleInit() {
|
||||
datas.rule_title = datas.ruleList[datas.ruleIndex].title;
|
||||
datas.rule_content = datas.ruleList[datas.ruleIndex].content;
|
||||
}
|
||||
/**
|
||||
* 规则确认
|
||||
*/
|
||||
function ruleConfirm() {
|
||||
datas.ruleShow = false;
|
||||
datas.ruleIndex++;
|
||||
if (datas.ruleIndex >= datas.ruleList.length) {
|
||||
datas.ruleIndex = 0;
|
||||
uni.setStorageSync('ruleShow', true);
|
||||
return;
|
||||
}
|
||||
// 公告
|
||||
async function getMsg() {
|
||||
let res = await messageselectMessage()
|
||||
datas.noticeList = res.list
|
||||
}
|
||||
//获取推荐视频
|
||||
async function getrecomVideo(sort, active = 1) {
|
||||
datas.active = active
|
||||
setTimeout((res) => {
|
||||
ruleInit();
|
||||
datas.ruleShow = true;
|
||||
}, 300);
|
||||
}
|
||||
|
||||
// 跳转公告链接
|
||||
function goMsg(url) {
|
||||
uni.navigateTo({
|
||||
url: '/pages/index/prizeDraw/kevy-luckydraw'
|
||||
});
|
||||
}
|
||||
|
||||
// 搜索跳转
|
||||
function moreVideo() {
|
||||
uni.navigateTo({
|
||||
url: '/pages/index/search/index'
|
||||
});
|
||||
}
|
||||
|
||||
//获取推荐视频
|
||||
async function getrecomVideo(sort, active = 1) {
|
||||
try {
|
||||
datas.active = active;
|
||||
if (sort) {
|
||||
datas.page = 1
|
||||
datas.page = 1;
|
||||
}
|
||||
let res = await courseselectCourse({
|
||||
page: datas.page,
|
||||
limit: 12,
|
||||
sort: sort,
|
||||
classifyId: ''
|
||||
})
|
||||
});
|
||||
|
||||
console.log('getrecomVideo===', res);
|
||||
|
||||
if (datas.page == 1) {
|
||||
datas.list = res.list
|
||||
datas.list = res.list;
|
||||
} else {
|
||||
datas.list = [...datas.list, ...res.list]
|
||||
datas.list = [...datas.list, ...res.list];
|
||||
}
|
||||
} catch (error) {
|
||||
console.log('getrecomVideo.error===', error);
|
||||
if (error.code == 702) {
|
||||
disableMaskVisable.value = true;
|
||||
} else {
|
||||
disableMaskVisable.value = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.indexStyle {
|
||||
height: 555rpx;
|
||||
position: relative;
|
||||
|
||||
>image {
|
||||
width: 100%;
|
||||
height: 555rpx;
|
||||
position: absolute;
|
||||
|
||||
}
|
||||
|
||||
.indexStyleTwo {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 88rpx 25rpx;
|
||||
|
||||
>image {
|
||||
width: 187rpx;
|
||||
height: 50rpx;
|
||||
}
|
||||
|
||||
>view {
|
||||
z-index: 50;
|
||||
width: 236rpx;
|
||||
line-height: 43rpx;
|
||||
background: rgba(255, 255, 255, 0.29);
|
||||
border-radius: 7rpx 7rpx 7rpx 7rpx;
|
||||
font-weight: 400;
|
||||
font-size: 21rpx;
|
||||
color: rgba(255, 255, 255, 0.85);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
}
|
||||
|
||||
.gongao {
|
||||
position: absolute;
|
||||
bottom: 75rpx;
|
||||
left: 70rpx;
|
||||
border-radius: 21rpx 21rpx 21rpx 21rpx;
|
||||
width: 611rpx;
|
||||
height: 78rpx;
|
||||
background-color: rgba(255, 255, 255, .65);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 12rpx;
|
||||
box-sizing: border-box;
|
||||
|
||||
.gongaoicon {
|
||||
color: #ffffff;
|
||||
width: 98rpx;
|
||||
height: 50rpx;
|
||||
line-height: 50rpx;
|
||||
text-align: center;
|
||||
font-size: 25rpx;
|
||||
background-image: url('../../static/index/gonggaobg.png');
|
||||
background-size: 98rpx 50rpx;
|
||||
}
|
||||
|
||||
.swiperstyle {
|
||||
height: 78rpx;
|
||||
width: 80%;
|
||||
}
|
||||
}
|
||||
.indexStyle {
|
||||
height: 350rpx;
|
||||
position: relative;
|
||||
|
||||
> image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
position: absolute;
|
||||
}
|
||||
|
||||
.navTop-active {
|
||||
color: #cb5d68;
|
||||
}
|
||||
|
||||
.navTop {
|
||||
.indexStyleTwo {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 0 20rpx;
|
||||
padding: 88rpx 25rpx;
|
||||
|
||||
>view {
|
||||
background-color: #f0f0f0;
|
||||
margin-left: 20rpx;
|
||||
padding: 6rpx 20rpx
|
||||
> image {
|
||||
width: 187rpx;
|
||||
height: 50rpx;
|
||||
}
|
||||
|
||||
> view {
|
||||
z-index: 50;
|
||||
width: 236rpx;
|
||||
line-height: 43rpx;
|
||||
background: rgba(255, 255, 255, 0.29);
|
||||
border-radius: 7rpx 7rpx 7rpx 7rpx;
|
||||
font-weight: 400;
|
||||
font-size: 21rpx;
|
||||
color: rgba(255, 255, 255, 0.85);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
}
|
||||
|
||||
.gongao {
|
||||
position: absolute;
|
||||
bottom: 85rpx;
|
||||
left: 70rpx;
|
||||
border-radius: 12rpx 12rpx 12rpx 12rpx;
|
||||
width: 611rpx;
|
||||
height: 60rpx;
|
||||
background-color: rgba(255, 255, 255, 0.65);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 12rpx;
|
||||
box-sizing: border-box;
|
||||
|
||||
.gongaoicon {
|
||||
color: #ffffff;
|
||||
width: 98rpx;
|
||||
height: 40rpx;
|
||||
line-height: 40rpx;
|
||||
text-align: center;
|
||||
font-size: 20rpx;
|
||||
background-image: url('../../static/index/gonggaobg.png');
|
||||
background-size: 98rpx 50rpx;
|
||||
}
|
||||
|
||||
.swiperstyle {
|
||||
height: 78rpx;
|
||||
width: 80%;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.navTop-active {
|
||||
color: #cb5d68;
|
||||
}
|
||||
|
||||
.navTop {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 0 20rpx;
|
||||
|
||||
> view {
|
||||
background-color: #f0f0f0;
|
||||
margin-left: 20rpx;
|
||||
padding: 6rpx 20rpx;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -79,18 +79,22 @@
|
||||
}
|
||||
if (datas.tabIndex == 1) {
|
||||
if (datas.page == 1) {
|
||||
datas.list = []
|
||||
datas.list = res.records;
|
||||
} else {
|
||||
if (res.records.length) {
|
||||
datas.list.push(...datas.list, res.records)
|
||||
let arr = datas.list.concat(res.records)
|
||||
datas.list = arr
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (datas.page == 1) {
|
||||
datas.list = []
|
||||
datas.list = res.list;
|
||||
} else {
|
||||
if (res.records.length) {
|
||||
datas.list.push(...datas.list, res.list)
|
||||
let arr = datas.list.concat(res.records)
|
||||
datas.list = arr
|
||||
}
|
||||
}
|
||||
// datas.total = res.page.totalCount;
|
||||
|
||||
@@ -24,7 +24,8 @@
|
||||
<view class="t-r-title t-flex-row">活动规则</view>
|
||||
<view class="t-rule">
|
||||
<text>1.抽奖细则:每日前{{ freeNumDay }}次付款均可获得抽奖机会</text>
|
||||
<text>2.奖励说明:红包奖励将自动发放到红包余额,已绑定银行卡账号将会自动发起提现。其余奖品则需联系客服领取。</text>
|
||||
<text>2.抽奖机会仅当日可用,次日作废(凌晨24点自动清零)</text>
|
||||
<text>3.奖励说明:红包奖励将自动发放到红包余额,已绑定银行卡账号将会自动发起提现。其余奖品则需联系客服领取。</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
86
pages/login/bindWx.vue
Normal file
@@ -0,0 +1,86 @@
|
||||
<template>
|
||||
<view class="u-p-30 min-page u-flex u-flex-col u-row-center u-col-center">
|
||||
|
||||
<view class="u-relative w-full">
|
||||
<view class="u-absolute u-flex u-row-center wx-box" >
|
||||
<image src="@/static/images/wx.png" class="img" mode=""></image>
|
||||
</view>
|
||||
<up-button type="" class="" :custom-style="customStyl" @click="bindwx">绑定微信</up-button>
|
||||
<up-button type="" @click="navback">取消</up-button>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import {
|
||||
onShow,onHide,onUnload,onLoad
|
||||
} from '@dcloudio/uni-app'
|
||||
import {
|
||||
$bindWx
|
||||
} from '@/api/login/login.js'
|
||||
import {
|
||||
bindWx
|
||||
} from '@/utils/wx.js'
|
||||
import color from '@/commons/color.js'
|
||||
import {
|
||||
reactive
|
||||
} from 'vue';
|
||||
|
||||
const customStyl = reactive({
|
||||
backgroundColor: color.main,
|
||||
color: '#fff'
|
||||
})
|
||||
|
||||
function navback() {
|
||||
uni.navigateBack()
|
||||
}
|
||||
function clear(){
|
||||
clearTimeout(timer)
|
||||
}
|
||||
let timer=null
|
||||
async function bindwx() {
|
||||
const code =await bindWx()
|
||||
const res = await $bindWx({
|
||||
code
|
||||
})
|
||||
console.log(res);
|
||||
if (res) {
|
||||
uni.showToast({
|
||||
title: '绑定微信成功',
|
||||
icon: 'none'
|
||||
})
|
||||
clear()
|
||||
timer=setTimeout(()=>{
|
||||
uni.navigateBack()
|
||||
},1500)
|
||||
}else{
|
||||
uni.showToast({
|
||||
title: '绑定微失败',
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
onUnload(() => {
|
||||
clear()
|
||||
})
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.wx-box{
|
||||
position: absolute;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 100%;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
transform: translateY(-100rpx);
|
||||
.img{
|
||||
width: 200rpx;
|
||||
height: 200rpx;
|
||||
}
|
||||
}
|
||||
|
||||
</style>
|
||||
@@ -4,9 +4,9 @@
|
||||
|
||||
<view class="content">
|
||||
<image class="logo" src="/static/download/appLogo.png"></image>
|
||||
<view style="font-size: 40rpx;margin-top: 22rpx;color: #FFFFFF;font-weight: bold;">斯耀短剧APP</view>
|
||||
<view style="font-size: 40rpx;margin-top: 22rpx;color: #FFFFFF;font-weight: bold;">{{data.confirmBtn}}</view>
|
||||
<view style="font-size: 28rpx;margin-top: 16rpx;color: #FFFFFF;font-weight: bold;">海量电子榨菜 免费又过瘾</view>
|
||||
<button class="confirm-btn" @click="download">{{data.confirmBtn}}</button>
|
||||
<button class="confirm-btn" @click="download">点击下载{{data.confirmBtn}}</button>
|
||||
|
||||
</view>
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
// #ifdef H5
|
||||
let u = window.navigator.userAgent;
|
||||
if ( uni.getSystemInfoSync().platform == 'ios') {
|
||||
data.confirmBtn = "跳转网页版首页"
|
||||
data.confirmBtn = "顺享短剧APP"
|
||||
}
|
||||
if ( u.toLowerCase().indexOf('micromessenger') !== -1) {
|
||||
data.isWeixin = true
|
||||
@@ -45,54 +45,22 @@
|
||||
console.log(uni.getSystemInfoSync().platform == 'android')
|
||||
if (uni.getSystemInfoSync().platform == 'android') {
|
||||
commonType(49).then(res => {
|
||||
console.log(res)
|
||||
if (res && res.value) {
|
||||
// #ifndef H5
|
||||
plus.runtime.openURL(res.value, function(res) {
|
||||
|
||||
});
|
||||
plus.runtime.openURL(res.value, function(res) {});
|
||||
// #endif
|
||||
// #ifdef H5
|
||||
uni.setClipboardData({
|
||||
data: res.value,
|
||||
success: r => {
|
||||
// this.$queue.showToast('邀请码复制成功');
|
||||
uni.showToast({
|
||||
title: '邀请码复制成功',
|
||||
icon: 'none',
|
||||
});
|
||||
}
|
||||
});
|
||||
window.location.href = res.value;
|
||||
// #endif
|
||||
}
|
||||
});
|
||||
} else {
|
||||
commonType(50).then(res => {
|
||||
if (res && res.value) {
|
||||
// #ifndef H5
|
||||
plus.runtime.openURL(res.value, function(res) {
|
||||
|
||||
});
|
||||
// #endif
|
||||
// #ifdef H5
|
||||
uni.setClipboardData({
|
||||
data: res.value,
|
||||
success: r => {
|
||||
uni.showToast({
|
||||
title: '邀请码复制成功',
|
||||
icon: 'none',
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
uni.switchTab({
|
||||
url: '/pages/index/index'
|
||||
})
|
||||
// window.location.href = res.data.value;
|
||||
// #endif
|
||||
}
|
||||
});
|
||||
// #ifndef H5
|
||||
plus.runtime.openURL('https://apps.apple.com/cn/app/%E9%A1%BA%E4%BA%AB%E7%9F%AD%E5%89%A7/id6740074541', function(res) {});
|
||||
// #endif
|
||||
// #ifdef H5
|
||||
window.location.href = 'https://apps.apple.com/cn/app/%E9%A1%BA%E4%BA%AB%E7%9F%AD%E5%89%A7/id6740074541';
|
||||
// #endif
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
<image class="icon" src="/static/me/logo_btn3.png" mode="aspectFit" @click="linkTo('/pages/me/contact', true)"></image>
|
||||
</view>
|
||||
</view>
|
||||
<view class="top" @click="linkTo(userInfo.phone?'/pages/me/userInfo':'/pages/login/login')">
|
||||
<view class="top" @click="linkTo(userInfo.phone ? '/pages/me/userInfo' : '/pages/login/login')">
|
||||
<image class="avatar" :src="userInfo.avatar || '/static/default_avatar.png'" mode="aspectFill"></image>
|
||||
<view class="info-wrap">
|
||||
<view class="name">{{ userInfo.phone || '请登录' }}</view>
|
||||
@@ -29,7 +29,7 @@
|
||||
<view class="title">我的追剧</view>
|
||||
<view class="num">{{ likeData.collectCount }}</view>
|
||||
</navigator>
|
||||
<view class="item" v-if="$common.isIosExamine" @click="linkTo('/pages/me/withdraw/index',true)">
|
||||
<view class="item" v-if="$common.isIosExamine" @click="linkTo('/pages/me/withdraw/index', true)">
|
||||
<view class="title">我的红包</view>
|
||||
<view class="num">{{ amount || 0 }}</view>
|
||||
</view>
|
||||
@@ -44,7 +44,6 @@
|
||||
<div @click="linkTo('/pages/me/gold_record', true)">
|
||||
<view class="btn">金币明细</view>
|
||||
</div>
|
||||
|
||||
</view>
|
||||
<div class="title-wrap" @click="linkTo('/pages/watching_history/watching_history?type=3', true)">
|
||||
<view class="a">
|
||||
@@ -72,8 +71,8 @@
|
||||
<view class="card-wrap">
|
||||
<view class="menu-list">
|
||||
<view class="item" @click="toTask">
|
||||
<image class="icon" src="/static/me/menu_icon1.png" mode="aspectFit"></image>
|
||||
<view class="name">任务中心</view>
|
||||
<image class="icon" src="/static/me/Frame.png" mode="aspectFit"></image>
|
||||
<view class="name">邀请好友</view>
|
||||
</view>
|
||||
<view class="item" @click="linkTo('/pages/me/setting')">
|
||||
<image class="icon" src="/static/me/menu_icon2.png" mode="aspectFit"></image>
|
||||
@@ -99,6 +98,13 @@
|
||||
<image class="icon" src="/static/me/menu_icon7.png" mode="aspectFit"></image>
|
||||
<view class="name">关于我们</view>
|
||||
</view> -->
|
||||
<!-- #ifndef H5 -->
|
||||
<view class="item" @click="bindwx" v-if="!isBindWx">
|
||||
<image class="icon" src="/static/me/bind_wx.png" mode="aspectFit"></image>
|
||||
<view class="name">绑定微信</view>
|
||||
</view>
|
||||
<!-- #endif -->
|
||||
|
||||
<view class="item" @click="linkTo('/pages/me/privacy')">
|
||||
<image class="icon" src="/static/me/menu_icon8.png" mode="aspectFit"></image>
|
||||
<view class="name">隐私政策</view>
|
||||
@@ -107,30 +113,64 @@
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<disable-mask v-if="disableShow"></disable-mask>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, reactive } from 'vue';
|
||||
import { onLoad,onShow, onPullDownRefresh } from '@dcloudio/uni-app';
|
||||
import { onLoad, onShow, onPullDownRefresh } from '@dcloudio/uni-app';
|
||||
import { selectByUserId, collectVideoSummary, selectUserMoney } from '@/api/me/me.js';
|
||||
import { linkTo } from '@/utils/app.js';
|
||||
import {
|
||||
useCommonStore
|
||||
} from '@/store/common.js'
|
||||
const $common = useCommonStore()
|
||||
import { useCommonStore } from '@/store/common.js';
|
||||
import { toBindWx, bindStatus } from '@/utils/wx.js';
|
||||
|
||||
const disableShow = ref(false);
|
||||
|
||||
const $common = useCommonStore();
|
||||
const userInfo = ref({});
|
||||
|
||||
let isBindWx = ref(false);
|
||||
async function bindwx() {
|
||||
if (isBindWx.value) {
|
||||
uni.showToast({
|
||||
title: '已绑定微信,请勿重复绑定',
|
||||
icon: 'none'
|
||||
});
|
||||
return;
|
||||
}
|
||||
isBindWx.value = await bindStatus();
|
||||
console.log(isBindWx.value);
|
||||
if (isBindWx.value) {
|
||||
uni.showToast({
|
||||
title: '已绑定微信,请勿重复绑定',
|
||||
icon: 'none'
|
||||
});
|
||||
return;
|
||||
} else {
|
||||
toBindWx();
|
||||
}
|
||||
}
|
||||
|
||||
// 获取最近的三条观看历史
|
||||
const recordThree = ref([]);
|
||||
onShow(()=>{
|
||||
onShow(() => {
|
||||
// 判断ios是否审核
|
||||
$common.init()
|
||||
})
|
||||
$common.init();
|
||||
});
|
||||
async function selectByUserIdAjax() {
|
||||
try {
|
||||
const res = await selectByUserId({ page: 1, limit: 3, classify: 3 });
|
||||
const res = await selectByUserId({
|
||||
page: 1,
|
||||
limit: 3,
|
||||
classify: 3
|
||||
});
|
||||
recordThree.value = res.records;
|
||||
} catch (error) {
|
||||
if (error.code == 702) {
|
||||
disableShow.value = true;
|
||||
} else {
|
||||
disableShow.value = false;
|
||||
}
|
||||
console.log(error);
|
||||
}
|
||||
}
|
||||
@@ -164,9 +204,7 @@ async function selectUserMoneyAjax() {
|
||||
|
||||
// 跳转任务中心
|
||||
function toTask() {
|
||||
uni.switchTab({
|
||||
url: '/pages/task/index'
|
||||
});
|
||||
linkTo('/pages/share/index');
|
||||
}
|
||||
|
||||
onPullDownRefresh(async () => {
|
||||
@@ -179,14 +217,13 @@ onPullDownRefresh(async () => {
|
||||
}, 500);
|
||||
});
|
||||
|
||||
onLoad(() => {
|
||||
if(uni.getStorageSync('token')){
|
||||
onShow(() => {
|
||||
if (uni.getStorageSync('token')) {
|
||||
selectByUserIdAjax();
|
||||
collectVideoSummaryAjax();
|
||||
selectUserMoneyAjax();
|
||||
userInfo.value = uni.getStorageSync('userInfo');
|
||||
}
|
||||
|
||||
});
|
||||
</script>
|
||||
|
||||
@@ -202,6 +239,7 @@ $bgColor: #f5f7ff;
|
||||
font-size: 28upx;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.top-bg {
|
||||
width: 100%;
|
||||
height: 50%;
|
||||
@@ -209,6 +247,7 @@ $bgColor: #f5f7ff;
|
||||
top: 0;
|
||||
left: 0;
|
||||
background: linear-gradient(90deg, #ffe5ea 0, #e4f5fb 49%, #fff0ee);
|
||||
|
||||
&::after {
|
||||
content: '';
|
||||
height: 50%;
|
||||
@@ -219,24 +258,30 @@ $bgColor: #f5f7ff;
|
||||
left: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.content {
|
||||
padding: 28upx;
|
||||
position: relative;
|
||||
|
||||
.user-info {
|
||||
.logo-wrap {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
|
||||
.logo {
|
||||
width: 160upx;
|
||||
|
||||
.img {
|
||||
width: 100%;
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
|
||||
.quick-menu {
|
||||
display: flex;
|
||||
gap: 20upx;
|
||||
|
||||
.icon {
|
||||
$size: 60upx;
|
||||
width: $size;
|
||||
@@ -244,10 +289,12 @@ $bgColor: #f5f7ff;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.top {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding-top: 40upx;
|
||||
|
||||
.avatar {
|
||||
$size: 94upx;
|
||||
width: $size;
|
||||
@@ -255,6 +302,7 @@ $bgColor: #f5f7ff;
|
||||
border-radius: 50%;
|
||||
margin-right: 12upx;
|
||||
}
|
||||
|
||||
.info-wrap {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
@@ -262,18 +310,22 @@ $bgColor: #f5f7ff;
|
||||
font-size: 32upx;
|
||||
}
|
||||
}
|
||||
|
||||
.btm {
|
||||
display: flex;
|
||||
padding: 40upx 0;
|
||||
|
||||
.item {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
|
||||
.title {
|
||||
font-size: 28upx;
|
||||
}
|
||||
|
||||
.num {
|
||||
font-weight: bold;
|
||||
display: flex;
|
||||
@@ -283,17 +335,20 @@ $bgColor: #f5f7ff;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.card-wrap {
|
||||
background: #fff;
|
||||
border-radius: 16upx;
|
||||
overflow: hidden;
|
||||
margin-bottom: 28upx;
|
||||
|
||||
.gold-wrap {
|
||||
background: #f2b5b5;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
padding: 20upx 28upx;
|
||||
position: relative;
|
||||
|
||||
// &::after {
|
||||
// $size: 40upx;
|
||||
// content: '';
|
||||
@@ -310,17 +365,20 @@ $bgColor: #f5f7ff;
|
||||
.left {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
.icon {
|
||||
$size: 52upx;
|
||||
width: $size;
|
||||
height: $size;
|
||||
margin-right: 20upx;
|
||||
}
|
||||
|
||||
.num {
|
||||
color: #fff;
|
||||
font-size: 32upx;
|
||||
}
|
||||
}
|
||||
|
||||
.btn {
|
||||
color: #977641;
|
||||
background: linear-gradient(90deg, #fee7bc 0%, #fdcc89 100%);
|
||||
@@ -333,17 +391,21 @@ $bgColor: #f5f7ff;
|
||||
font-size: 24upx;
|
||||
}
|
||||
}
|
||||
|
||||
.title-wrap {
|
||||
padding: 28upx;
|
||||
|
||||
.a {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
|
||||
.t {
|
||||
font-size: 28upx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.history-list {
|
||||
padding: 0 28upx 28upx;
|
||||
display: grid;
|
||||
@@ -351,12 +413,14 @@ $bgColor: #f5f7ff;
|
||||
grid-template-rows: 1fr;
|
||||
grid-column-gap: 28upx;
|
||||
grid-row-gap: 28upx;
|
||||
|
||||
.item {
|
||||
.cover {
|
||||
width: 100%;
|
||||
height: 280upx;
|
||||
border-radius: 20upx;
|
||||
}
|
||||
|
||||
.name {
|
||||
font-size: 28upx;
|
||||
width: 160upx;
|
||||
@@ -364,16 +428,19 @@ $bgColor: #f5f7ff;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.t {
|
||||
color: #999;
|
||||
font-size: 24upx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.menu-list {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
padding: 28upx 0 0;
|
||||
|
||||
.item {
|
||||
flex: 0 0 25%;
|
||||
display: flex;
|
||||
@@ -381,11 +448,13 @@ $bgColor: #f5f7ff;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
margin-bottom: 32upx;
|
||||
|
||||
.icon {
|
||||
$size: 56upx;
|
||||
width: $size;
|
||||
height: $size;
|
||||
}
|
||||
|
||||
.name {
|
||||
font-size: 24upx;
|
||||
margin-top: 8upx;
|
||||
|
||||
@@ -21,6 +21,10 @@
|
||||
<view class="title">隐私协议</view>
|
||||
<up-icon name="arrow-right" />
|
||||
</view>
|
||||
<view class="item" @click="outuser" v-if="token&&!isExamine">
|
||||
<view class="title">注销账号</view>
|
||||
<up-icon name="arrow-right" />
|
||||
</view>
|
||||
<view class="item" @click="logout" v-if="token">
|
||||
<view class="title">退出登录</view>
|
||||
<up-icon name="arrow-right" />
|
||||
@@ -31,64 +35,98 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref } from 'vue';
|
||||
import { linkTo } from '@/utils/app.js';
|
||||
import { onLoad } from '@dcloudio/uni-app';
|
||||
|
||||
const version = ref('');
|
||||
const token = ref('');
|
||||
|
||||
// 退出登录
|
||||
function logout() {
|
||||
uni.showModal({
|
||||
title: '注意',
|
||||
content: '确定要退出登录吗?',
|
||||
success: (res) => {
|
||||
if (res.confirm) {
|
||||
uni.clearStorageSync();
|
||||
uni.reLaunch({
|
||||
url: '/pages/login/login'
|
||||
});
|
||||
import {
|
||||
ref
|
||||
} from 'vue';
|
||||
import {
|
||||
linkTo
|
||||
} from '@/utils/app.js';
|
||||
import {
|
||||
onLoad
|
||||
} from '@dcloudio/uni-app';
|
||||
import {
|
||||
deleteUserByUserId
|
||||
} from '@/api/me/me.js'
|
||||
import {
|
||||
useCommonStore
|
||||
} from '@/store/common.js'
|
||||
const version = ref('');
|
||||
const token = ref('');
|
||||
let isExamine = ref(false)
|
||||
// 注销账号
|
||||
function outuser() {
|
||||
uni.showModal({
|
||||
title: '注意',
|
||||
content: '确定要注销账号吗?',
|
||||
success: async (res) => {
|
||||
if (res.confirm) {
|
||||
let userInfo = uni.getStorageSync('userInfo')
|
||||
let res = await deleteUserByUserId(userInfo.userId)
|
||||
if (res.code == 0) {
|
||||
uni.reLaunch({
|
||||
url: '/pages/login/login'
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
// 退出登录
|
||||
function logout() {
|
||||
uni.showModal({
|
||||
title: '注意',
|
||||
content: '确定要退出登录吗?',
|
||||
success: (res) => {
|
||||
if (res.confirm) {
|
||||
uni.clearStorageSync();
|
||||
uni.reLaunch({
|
||||
url: '/pages/login/login'
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
const $common = useCommonStore()
|
||||
onLoad(() => {
|
||||
token.value = uni.getStorageSync('token');
|
||||
const systemInfo = uni.getSystemInfoSync();
|
||||
//#ifdef APP-PLUS
|
||||
version.value = systemInfo.appWgtVersion;
|
||||
//#endif
|
||||
// #ifdef H5
|
||||
version.value = systemInfo.appVersion;
|
||||
// #endif
|
||||
$common.init()
|
||||
isExamine.value = $common.isIosExamine
|
||||
});
|
||||
}
|
||||
|
||||
onLoad(() => {
|
||||
token.value = uni.getStorageSync('token');
|
||||
const systemInfo = uni.getSystemInfoSync();
|
||||
//#ifdef APP-PLUS
|
||||
version.value = systemInfo.appWgtVersion;
|
||||
//#endif
|
||||
// #ifdef H5
|
||||
version.value = systemInfo.appVersion;
|
||||
// #endif
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.container {
|
||||
font-size: 28upx;
|
||||
color: #555;
|
||||
}
|
||||
.list {
|
||||
padding-bottom: 120upx;
|
||||
.item {
|
||||
padding: 32upx 28upx;
|
||||
border-bottom: 1upx solid #efefef;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
.container {
|
||||
font-size: 28upx;
|
||||
color: #555;
|
||||
}
|
||||
|
||||
.list {
|
||||
padding-bottom: 120upx;
|
||||
|
||||
.item {
|
||||
padding: 32upx 28upx;
|
||||
border-bottom: 1upx solid #efefef;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
}
|
||||
}
|
||||
|
||||
.version {
|
||||
width: 100%;
|
||||
height: 120upx;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
color: #999;
|
||||
}
|
||||
}
|
||||
.version {
|
||||
width: 100%;
|
||||
height: 120upx;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
color: #999;
|
||||
}
|
||||
</style>
|
||||
@@ -12,11 +12,11 @@
|
||||
<input v-model="data.userInfo.userName" align="right" placeholder="请输入用户名" />
|
||||
</template>
|
||||
</up-cell>
|
||||
<up-cell title="手机">
|
||||
<!-- <up-cell title="手机">
|
||||
<template #value>
|
||||
<input :disabled="data.userInfo.phone?true:false" v-model="data.userInfo.phone" align="right" placeholder="请输入联系电话" />
|
||||
<input v-model="data.userInfo.phone" align="right" placeholder="请输入联系电话" />
|
||||
</template>
|
||||
</up-cell>
|
||||
</up-cell> -->
|
||||
</up-cell-group>
|
||||
<view class="save" @click="save">保存</view>
|
||||
</view>
|
||||
@@ -62,7 +62,8 @@
|
||||
if (index === 0) {
|
||||
// 用户点击了预览当前图片
|
||||
// 可以自己实现当前头像链接的读取
|
||||
let url = data.userInfo.avatar;
|
||||
console.log()
|
||||
let url = data.userInfo.avatar||'../../static/default/avatar.png';
|
||||
let arr = []
|
||||
arr.push(url)
|
||||
uni.previewImage({
|
||||
@@ -108,20 +109,20 @@
|
||||
})
|
||||
return
|
||||
}
|
||||
if (!data.userInfo.phone) {
|
||||
uni.showToast({
|
||||
title: "手机号不能空",
|
||||
icon: "none"
|
||||
})
|
||||
return
|
||||
}
|
||||
if (checkPhone(data.userInfo.phone) == false) {
|
||||
uni.showToast({
|
||||
title: "手机号格式不正确",
|
||||
icon: "none"
|
||||
})
|
||||
return
|
||||
}
|
||||
// if (!data.userInfo.phone) {
|
||||
// uni.showToast({
|
||||
// title: "手机号不能空",
|
||||
// icon: "none"
|
||||
// })
|
||||
// return
|
||||
// }
|
||||
// if (checkPhone(data.userInfo.phone) == false) {
|
||||
// uni.showToast({
|
||||
// title: "手机号格式不正确",
|
||||
// icon: "none"
|
||||
// })
|
||||
// return
|
||||
// }
|
||||
|
||||
uni.showModal({
|
||||
title: '温馨提示',
|
||||
@@ -132,7 +133,7 @@
|
||||
let res = await updateUsers({
|
||||
userName: data.userInfo.userName,
|
||||
avatar: data.userInfo.avatar,
|
||||
phone: data.userInfo.phone,
|
||||
// phone: data.userInfo.phone,
|
||||
})
|
||||
uni.showToast({
|
||||
title: '保存成功',
|
||||
@@ -141,7 +142,7 @@
|
||||
let userInfo = uni.getStorageSync('userInfo');
|
||||
userInfo.userName = data.userInfo.userName
|
||||
userInfo.avatar = data.userInfo.avatar
|
||||
userInfo.phone = data.userInfo.phone
|
||||
// userInfo.phone = data.userInfo.phone
|
||||
uni.setStorageSync('userInfo', userInfo);
|
||||
setTimeout(function() {
|
||||
uni.navigateBack()
|
||||
|
||||
@@ -8,10 +8,13 @@
|
||||
<template #right-icon> <up-input border="none" v-model="data.zhiFuBao" placeholder="请输入要绑定的支付宝手机号"></up-input> </template>
|
||||
</up-cell>
|
||||
</up-cell-group>
|
||||
<button class="confirm-btn" @click="toLogin"
|
||||
:disabled="data.logining">绑定账户</button>
|
||||
<view style="font-size: 24upx;color: #999999;padding: 0 15rpx;margin-top: 32rpx;margin-bottom: 10rpx;">请正确填写收款人的支付宝账户和真实的收款人姓名</view>
|
||||
<view style="font-size: 24upx;color: #999999;padding: 0 15rpx">否则将无法正常收款,请须知</view>
|
||||
<view class="u-flex u-row-center">
|
||||
<button class="confirm-btn" @click="toLogin"
|
||||
:disabled="data.logining">绑定账户</button>
|
||||
</view>
|
||||
|
||||
<view style="font-size: 24upx;color: #999999;padding: 0 15rpx;margin-top: 32rpx;margin-bottom: 10rpx;text-align: center;">请正确填写收款人的支付宝账户和真实的收款人姓名</view>
|
||||
<view style="font-size: 24upx;color: #999999;padding: 0 15rpx;text-align: center;">否则将无法正常收款,请须知</view>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
@@ -52,11 +55,42 @@
|
||||
})
|
||||
} else {
|
||||
data.logining = true
|
||||
|
||||
|
||||
// this.$u.post('app/user/updateUser?zhiFuBao=' + zhiFuBao + '&certName=' + zhiFuBaoName + '&certNum=' + certNum).then(
|
||||
// res => {
|
||||
// console.log(res);
|
||||
// if (res.code === 0) {
|
||||
// uni.setStorageSync('zhiFuBao', zhiFuBao)
|
||||
// uni.setStorageSync('zhiFuBaoName', zhiFuBaoName)
|
||||
// uni.setStorageSync('certNum', certNum)
|
||||
|
||||
// uni.showToast({
|
||||
// title: '修改成功',
|
||||
// icon: 'none',
|
||||
// complete() {
|
||||
// setTimeout(function () {
|
||||
// uni.navigateBack();
|
||||
// }, 1000)
|
||||
// }
|
||||
// })
|
||||
// } else {
|
||||
// uni.showToast({
|
||||
// title: res.msg || '修改失败',
|
||||
// icon: 'none'
|
||||
// })
|
||||
// }
|
||||
|
||||
|
||||
// });
|
||||
|
||||
|
||||
|
||||
let res = await updateUser({
|
||||
zhiFuBao: data.zhiFuBao,
|
||||
certName: data.zhiFuBaoName,
|
||||
})
|
||||
if( res) {
|
||||
if(res) {
|
||||
data.logining = false
|
||||
let userInfo = uni.getStorageSync('userInfo')
|
||||
userInfo.zhiFuBao = data.zhiFuBao
|
||||
|
||||
@@ -1,15 +1,12 @@
|
||||
<template>
|
||||
<view class="container">
|
||||
<up-navbar title="申请提现"
|
||||
:autoBack="true"
|
||||
bgColor="rgb(255, 117, 129)"
|
||||
leftIconColor="#FFF"
|
||||
:titleStyle ="{color:'#FFF'}" >
|
||||
<template #right>
|
||||
<view class="u-p-r-30 u-flex u-col-center" style="color: #fff;">
|
||||
<text class="rule-btn" @click="showRule">规则</text>
|
||||
</view>
|
||||
</template>
|
||||
<up-navbar title="申请提现" :autoBack="true" bgColor="rgb(255, 117, 129)" leftIconColor="#FFF"
|
||||
:titleStyle="{color:'#FFF'}">
|
||||
<template #right>
|
||||
<view class="u-p-r-30 u-flex u-col-center" style="color: #fff;">
|
||||
<text class="rule-btn" @click="showRule">规则</text>
|
||||
</view>
|
||||
</template>
|
||||
</up-navbar>
|
||||
|
||||
<view class="content">
|
||||
@@ -22,7 +19,8 @@
|
||||
<view class="input" style="">
|
||||
<view style="display: flex;align-items: center;">
|
||||
<view style="font-size: 40upx;color: #333333;">¥</view>
|
||||
<input type="digit" v-model="data.money" placeholder="请输入金额" @input="moneyInput" style="font-size: 32rpx;color: #333333;text-align: left;margin-left: 10rpx;width: 80%;" />
|
||||
<input type="digit" v-model="data.money" placeholder="请输入金额" @input="moneyInput"
|
||||
style="font-size: 32rpx;color: #333333;text-align: left;margin-left: 10rpx;width: 80%;" />
|
||||
</view>
|
||||
<view class="allbtn" @click="setAllMoney">
|
||||
全部
|
||||
@@ -32,7 +30,9 @@
|
||||
|
||||
</view>
|
||||
<view class="witBtn" @click="goWithdraw"> {{data.isWithdraw?'立即提现':'观看广告提现'}} </view>
|
||||
|
||||
<view style="color: #666;" @click="WithdrawalAlipay">
|
||||
提现到支付宝
|
||||
</view>
|
||||
<view class="tab" style="">
|
||||
<view @click="linkTo('/pages/me/withdraw/realName')">实名认证</view>
|
||||
<!-- <view @click="linkTo('/pages/me/withdraw/alipay')">提现账号</view> -->
|
||||
@@ -73,18 +73,20 @@
|
||||
</view>
|
||||
|
||||
|
||||
<up-modal :show="data.ruleShow" confirm-text="知道了" title="规则说明" :title="data.rule_title" :title-style="{fontWeight:'700'}" @confirm="ruleConfirm" confirm-color="rgb(255, 117, 129)">
|
||||
<up-modal :show="data.ruleShow" confirm-text="知道了" title="规则说明" :title="data.rule_title"
|
||||
:title-style="{fontWeight:'700'}" @confirm="ruleConfirm" confirm-color="rgb(255, 117, 129)">
|
||||
<view class="u-p-30 u-text-left">
|
||||
<scroll-view scroll-y="true" style="max-height: 50vh;" >
|
||||
<rich-text style="text-align: justify;font-size: 18px;color: #666;" :nodes="data.rule_content"></rich-text>
|
||||
<scroll-view scroll-y="true" style="max-height: 50vh;">
|
||||
<rich-text style="text-align: justify;font-size: 18px;color: #666;"
|
||||
:nodes="data.rule_content"></rich-text>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</up-modal>
|
||||
|
||||
<view style="width: 0;height: 0;overflow: hidden;">
|
||||
<!-- 激励视频广告 -->
|
||||
<ad-rewarded-video ref="adRewardedw" :adpid="data.adpid" :loadnext="true"
|
||||
:url-callback="data.urlCallback" @load="onadload" @close="onadclose" @error="onaderror">
|
||||
<ad-rewarded-video ref="adRewardedw" :adpid="data.adpid" :loadnext="true" :url-callback="data.urlCallback"
|
||||
@load="onadload" @close="onadclose" @error="onaderror">
|
||||
</ad-rewarded-video>
|
||||
</view>
|
||||
|
||||
@@ -100,7 +102,7 @@
|
||||
import { commonType } from '@/api/init.js';
|
||||
import { linkTo } from '@/utils/app.js';
|
||||
|
||||
let data = reactive({
|
||||
const data = reactive({
|
||||
ruleShow: false,
|
||||
rule_title: "",
|
||||
rule_content: "",
|
||||
@@ -125,16 +127,19 @@
|
||||
const adRewardedw = ref(null);
|
||||
onLoad(() => {
|
||||
// if ( uni.getSystemInfoSync().platform == 'android' ) {
|
||||
// data.adpid = 1531580352
|
||||
// data.adpid = 1531580352
|
||||
// }
|
||||
// if ( uni.getSystemInfoSync().platform == 'ios' ) {
|
||||
data.adpid = 1373604770
|
||||
data.adpid = 1373604770
|
||||
// }
|
||||
getExtractFei();
|
||||
getMoneyDetail();
|
||||
getCanCash()
|
||||
announcement({type: 1}).then(res=>{
|
||||
announcement({
|
||||
type: 1
|
||||
}).then(res => {
|
||||
data.ruleList = res
|
||||
|
||||
ruleInit()
|
||||
|
||||
})
|
||||
@@ -144,7 +149,7 @@
|
||||
getUserInfo();
|
||||
})
|
||||
onReady(() => {
|
||||
nextTick(()=>{
|
||||
nextTick(() => {
|
||||
data.adRewardedVideoloadNum = 0
|
||||
adRewardedw.value.load();
|
||||
data.ruleShow = true
|
||||
@@ -163,6 +168,7 @@
|
||||
getMoneyDetail();
|
||||
})
|
||||
function ruleInit(){
|
||||
data.rule_content = ""
|
||||
data.rule_title = data.ruleList[data.ruleIndex].title
|
||||
data.rule_content = data.ruleList[data.ruleIndex].content
|
||||
}
|
||||
@@ -170,12 +176,12 @@
|
||||
* 规则弹窗打开
|
||||
*/
|
||||
function showRule() {
|
||||
if( data.ruleList.length <= 0) {
|
||||
if (data.ruleList.length <= 0) {
|
||||
uni.showToast({
|
||||
title: "暂未配置规则",
|
||||
icon: 'none'
|
||||
})
|
||||
return
|
||||
return false;
|
||||
}
|
||||
ruleInit()
|
||||
data.ruleShow = true
|
||||
@@ -184,23 +190,60 @@
|
||||
* 规则确认
|
||||
*/
|
||||
function ruleConfirm() {
|
||||
console.log(1)
|
||||
data.ruleShow = false
|
||||
data.ruleIndex++
|
||||
if( data.ruleIndex >= data.ruleList.length) {
|
||||
if (data.ruleIndex >= data.ruleList.length) {
|
||||
data.ruleIndex = 0
|
||||
return
|
||||
}
|
||||
setTimeout(res=>{
|
||||
setTimeout(res => {
|
||||
ruleInit()
|
||||
data.ruleShow = true
|
||||
},300)
|
||||
}, 300)
|
||||
}
|
||||
|
||||
function getUserInfo() {
|
||||
selectUserById().then(res=>{
|
||||
selectUserById().then(res => {
|
||||
data.userInfo = res;
|
||||
})
|
||||
}
|
||||
|
||||
function WithdrawalAlipay() {
|
||||
if (data.userInfo.zhiFuBao) {
|
||||
if (data.money) {
|
||||
withdraw({
|
||||
amount: data.money,
|
||||
isAlipay: 1
|
||||
}).then(res => {
|
||||
data.money = ''
|
||||
uni.setStorageSync('adRewardedNum', 0)
|
||||
setTimeout(function() {
|
||||
getcashMoney()
|
||||
}, 1500)
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
icon: 'none'
|
||||
})
|
||||
})
|
||||
}else{
|
||||
uni.showToast({
|
||||
title: "请输入金额",
|
||||
icon: 'none',
|
||||
})
|
||||
}
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: "请绑定支付宝",
|
||||
icon: 'none',
|
||||
})
|
||||
setTimeout(() => {
|
||||
// 未绑定信息
|
||||
linkTo('/pages/me/withdraw/alipay')
|
||||
}, 1500)
|
||||
}
|
||||
}
|
||||
|
||||
function back() {
|
||||
uni.navigateBack()
|
||||
}
|
||||
@@ -211,11 +254,11 @@
|
||||
canCash().then(res => {
|
||||
data.isWithdraw = res;
|
||||
console.log(res)
|
||||
if( uni.getStorageSync('adRewardedNum') >= 3 ){
|
||||
if (uni.getStorageSync('adRewardedNum') >= 3) {
|
||||
data.isWithdraw = true;
|
||||
// uni.setStorageSync('adRewardedNum',0)
|
||||
} else {
|
||||
uni.setStorageSync('adRewardedNum',((uni.getStorageSync('adRewardedNum')||0)+1))
|
||||
uni.setStorageSync('adRewardedNum', ((uni.getStorageSync('adRewardedNum') || 0) + 1))
|
||||
}
|
||||
})
|
||||
|
||||
@@ -226,7 +269,7 @@
|
||||
*/
|
||||
function onadload(e) {
|
||||
data.adRewardedShow = true;
|
||||
uni.setStorageSync('adRewardedNum',0)
|
||||
uni.setStorageSync('adRewardedNum', 0)
|
||||
console.log('广告数据加载成功');
|
||||
}
|
||||
|
||||
@@ -235,14 +278,14 @@
|
||||
* @param {Object} e
|
||||
*/
|
||||
function onaderror(e) {
|
||||
if ( data.adRewardedVideoloadNum >=3 ) {
|
||||
if (data.adRewardedVideoloadNum >= 3) {
|
||||
return
|
||||
}
|
||||
data.adRewardedVideoloadNum++
|
||||
setTimeout(() => {
|
||||
adRewardedw.value.load();
|
||||
}, 1000); // 10
|
||||
console.log("广告加载失败",e)
|
||||
console.log("广告加载失败", e)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -258,7 +301,7 @@
|
||||
extraKey: data.urlCallback.extra
|
||||
})
|
||||
console.log(res)
|
||||
uni.setStorageSync('adRewardedNum',0)
|
||||
uni.setStorageSync('adRewardedNum', 0)
|
||||
getCanCash()
|
||||
} else {
|
||||
// 播放中途退出
|
||||
@@ -267,15 +310,15 @@
|
||||
|
||||
function onNavigationBarButtonTap() {
|
||||
console.log(1)
|
||||
data.ruleShow = true
|
||||
data.ruleShow = true
|
||||
}
|
||||
|
||||
/**
|
||||
* 提现触发
|
||||
*/
|
||||
function goWithdraw() {
|
||||
if ( !data.isWithdraw ) {
|
||||
if(!data.adRewardedShow){
|
||||
if (!data.isWithdraw) {
|
||||
if (!data.adRewardedShow) {
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
title: '广告加载失败,请稍后重试'
|
||||
@@ -284,7 +327,7 @@
|
||||
}
|
||||
data.urlCallback = {
|
||||
userId: uni.getStorageSync('userInfo').userId,
|
||||
extra: 'cash:'+uni.getStorageSync('userInfo').userId + "" + new Date().getTime(),
|
||||
extra: 'cash:' + uni.getStorageSync('userInfo').userId + "" + new Date().getTime(),
|
||||
}
|
||||
adRewardedw.value.show();
|
||||
} else {
|
||||
@@ -301,7 +344,37 @@
|
||||
* 全部提现赋值
|
||||
*/
|
||||
function setAllMoney() {
|
||||
data.money = data.mayMoney.toFixed(2)
|
||||
data.money = getMoneys(data.mayMoney)
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* 金额格式化
|
||||
* money:金额
|
||||
* 保留两位小数&不四舍五入
|
||||
*/
|
||||
function getMoneys(money) {
|
||||
if (!money || isNaN(money)) return "0.00";
|
||||
let num = parseFloat(money + '') + '';
|
||||
num = parseInt(money * 100 + '') / 100 + ''
|
||||
|
||||
let reg = /(-?\d+)(\d{4})/;
|
||||
while (reg.test(num)) {
|
||||
num = num.replace(reg, "$1,$2");
|
||||
}
|
||||
|
||||
let idx = num.indexOf('.')
|
||||
if (idx === -1) {
|
||||
num = num + '.00'
|
||||
}
|
||||
|
||||
if (idx > 0) {
|
||||
let num_per = num.substring(0, idx) + '.'
|
||||
let num_next = num.substring(idx + 1).padEnd(2, '0')
|
||||
num = num_per + num_next
|
||||
}
|
||||
|
||||
return num;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -338,7 +411,7 @@
|
||||
*/
|
||||
function getcashMoney() {
|
||||
selectUserMoney().then(res => {
|
||||
data.mayMoney = res.amount || 0
|
||||
data.mayMoney = getMoneys(res.amount) || 0
|
||||
})
|
||||
}
|
||||
|
||||
@@ -361,7 +434,7 @@
|
||||
}).then(res => {
|
||||
console.log(res)
|
||||
data.money = ''
|
||||
uni.setStorageSync('adRewardedNum',0)
|
||||
uni.setStorageSync('adRewardedNum', 0)
|
||||
setTimeout(function() {
|
||||
getcashMoney()
|
||||
}, 1500)
|
||||
@@ -369,7 +442,7 @@
|
||||
title: res.msg,
|
||||
icon: 'none'
|
||||
})
|
||||
}).catch(res =>{
|
||||
}).catch(res => {
|
||||
if (res.code == 9991) {
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
@@ -378,7 +451,7 @@
|
||||
setTimeout(function() {
|
||||
linkTo('/pages/me/withdraw/alipay')
|
||||
}, 1500)
|
||||
}else{
|
||||
} else {
|
||||
|
||||
}
|
||||
})
|
||||
@@ -394,10 +467,13 @@
|
||||
return;
|
||||
}
|
||||
if (!data.userInfo.accountNo) {
|
||||
uni.showToast({ icon: 'none', title: "请先实名认证" });
|
||||
setTimeout(()=>{
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
title: "请先实名认证"
|
||||
});
|
||||
setTimeout(() => {
|
||||
linkTo('/pages/me/withdraw/realName')
|
||||
},1500)
|
||||
}, 1500)
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -408,10 +484,11 @@
|
||||
content: '每日只可提现一次',
|
||||
success: (e) => {
|
||||
if (e.confirm) {
|
||||
setTimeout(()=>{
|
||||
setTimeout(() => {
|
||||
uni.showModal({
|
||||
title: "提现申请提示",
|
||||
content: '请仔细确认收款人信息\n\n收款人姓名:' + data.userInfo.certName + '\n\n提现金额:' + data
|
||||
content: '请仔细确认收款人信息\n\n收款人姓名:' + data.userInfo.certName +
|
||||
'\n\n提现金额:' + data
|
||||
.money + '元\n\n收款人账号:' + data.userInfo.accountNo + '',
|
||||
|
||||
success: (e) => {
|
||||
@@ -422,7 +499,7 @@
|
||||
}
|
||||
}
|
||||
});
|
||||
},200)
|
||||
}, 200)
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -441,7 +518,6 @@
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@@ -450,7 +526,8 @@
|
||||
background: white;
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
.nav{
|
||||
|
||||
.nav {
|
||||
width: 100%;
|
||||
|
||||
position: fixed;
|
||||
@@ -461,46 +538,54 @@
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 100rpx 30rpx 15rpx 30rpx;
|
||||
.navTitle{
|
||||
|
||||
.navTitle {
|
||||
color: #fff;
|
||||
font-size: 32rpx;
|
||||
font-weight: bold;
|
||||
}
|
||||
.ruleBtn{
|
||||
|
||||
.ruleBtn {
|
||||
font-size: 30rpx;
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
.content{
|
||||
|
||||
.content {
|
||||
background-color: #ff7581;
|
||||
height: 500rpx;
|
||||
border-bottom-right-radius: 40rpx;
|
||||
border-bottom-left-radius: 40rpx;
|
||||
.title{
|
||||
|
||||
.title {
|
||||
font-size: 32rpx;
|
||||
color: #FFFFFF;
|
||||
padding-top: 230rpx;
|
||||
}
|
||||
.mayMoney{
|
||||
|
||||
.mayMoney {
|
||||
font-size: 40rpx;
|
||||
color: #FFFFFF;
|
||||
padding-top: 20rpx;
|
||||
}
|
||||
.val{
|
||||
|
||||
.val {
|
||||
width: 90%;
|
||||
height: max-content
|
||||
;margin-left: 40rpx;
|
||||
height: max-content;
|
||||
margin-left: 40rpx;
|
||||
background-color: #FFFFFF;
|
||||
box-shadow: rgba(183, 183, 183, 0.3) 0px 1px 10px;
|
||||
margin-top: 50rpx;
|
||||
border-radius: 20rpx;
|
||||
.input{
|
||||
|
||||
.input {
|
||||
display: flex;
|
||||
padding: 20rpx;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
.allbtn{
|
||||
|
||||
.allbtn {
|
||||
font-size: 28rpx;
|
||||
color: #333333;
|
||||
background: #ff7581;
|
||||
@@ -510,7 +595,8 @@
|
||||
flex-shrink: 0;
|
||||
}
|
||||
}
|
||||
.witBtn{
|
||||
|
||||
.witBtn {
|
||||
margin: 32rpx;
|
||||
font-size: 36rpx;
|
||||
background: #ff7581;
|
||||
@@ -519,19 +605,22 @@
|
||||
height: 80rpx;
|
||||
line-height: 80rpx;
|
||||
}
|
||||
.tab{
|
||||
|
||||
.tab {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
width: 100%;
|
||||
justify-content: space-around;
|
||||
>view{
|
||||
|
||||
>view {
|
||||
font-size: 28rpx;
|
||||
color: #666;
|
||||
padding-bottom: 60rpx;
|
||||
padding-top: 20rpx;
|
||||
}
|
||||
}
|
||||
.moneyList{
|
||||
|
||||
.moneyList {
|
||||
text-align: left
|
||||
}
|
||||
}
|
||||
|
||||
@@ -55,7 +55,7 @@
|
||||
moneyType : data.moneyType,
|
||||
viewType: data.viewType,
|
||||
}).then(res => {
|
||||
data.totalCount = res.total;
|
||||
data.totalCount = res.totalCount;
|
||||
if ( res.records.length > 0) {
|
||||
data.list = [...data.list,...res.records];
|
||||
}
|
||||
@@ -65,6 +65,7 @@
|
||||
})
|
||||
}
|
||||
onReachBottom(() => {
|
||||
console.log(1)
|
||||
if (data.page*data.limit < data.totalCount) {
|
||||
data.page = data.page + 1;
|
||||
getMoney();
|
||||
|
||||
@@ -1,59 +1,129 @@
|
||||
<template>
|
||||
<view class="containerView">
|
||||
<up-cell-group label-width="80" :border="false">
|
||||
<up-cell :label-style="{ width: '100rpx' }" title="姓名">
|
||||
<template #right-icon> <up-input border="none" v-model="data.certName" placeholder="请输入姓名"></up-input> </template>
|
||||
<up-cell>
|
||||
<template #title>
|
||||
<view style="width: 90px;">姓名</view>
|
||||
</template>
|
||||
<template #right-icon> <up-input border="none" :disabled="setinput()" v-model="data.certName"
|
||||
placeholder="请输入姓名"></up-input>
|
||||
</template>
|
||||
</up-cell>
|
||||
<up-cell title="身份证号码">
|
||||
<template #right-icon> <up-input border="none" v-model="data.certNum" placeholder="请输入身份证号码"></up-input> </template>
|
||||
<up-cell>
|
||||
<template #title>
|
||||
<view style="width: 90px;">身份证号码</view>
|
||||
</template>
|
||||
<template #right-icon> <up-input border="none" v-model="data.certNum" :disabled="setinput()"
|
||||
placeholder="请输入身份证号码"></up-input>
|
||||
</template>
|
||||
</up-cell>
|
||||
<up-cell title="银行卡号码">
|
||||
<template #right-icon> <up-input border="none" v-model="data.accountNo" placeholder="请输入银行卡号码"></up-input> </template>
|
||||
<up-cell>
|
||||
<template #title>
|
||||
<view style="width: 90px;">银行卡号码</view>
|
||||
</template>
|
||||
<template #right-icon> <up-input border="none" :disabled="setinput()" v-model="data.accountNo"
|
||||
placeholder="请输入银行卡号码"></up-input> </template>
|
||||
</up-cell>
|
||||
<up-cell title="手机号">
|
||||
<template #right-icon> <up-input border="none" v-model="data.mobile" placeholder="请输入银行预留号码"></up-input> </template>
|
||||
<up-cell>
|
||||
<template #title>
|
||||
<view style="width: 90px;">手机号</view>
|
||||
</template>
|
||||
<template #right-icon> <up-input border="none" :disabled="setinput()" v-model="data.mobile"
|
||||
placeholder="请输入银行预留号码"></up-input> </template>
|
||||
</up-cell>
|
||||
<up-cell>
|
||||
<template #title>
|
||||
<view style="width: 90px;">开户省份</view>
|
||||
</template>
|
||||
<template #right-icon> <up-input border="none" v-model="data.province"
|
||||
placeholder="请输入银行开户省份"></up-input> </template>
|
||||
</up-cell>
|
||||
<up-cell>
|
||||
<template #title>
|
||||
<view style="width: 90px;">开户市区</view>
|
||||
</template>
|
||||
<template #right-icon> <up-input border="none" v-model="data.city" placeholder="请输入银行开户市区"></up-input>
|
||||
</template>
|
||||
</up-cell>
|
||||
<up-cell>
|
||||
<template #title>
|
||||
<view style="width: 90px;">开户行</view>
|
||||
</template>
|
||||
<template #right-icon> <up-input border="none" v-model="data.bankBranch"
|
||||
placeholder="请输入银行开户行"></up-input> </template>
|
||||
</up-cell>
|
||||
</up-cell-group>
|
||||
<button v-if="!data.isAccountNo" class="confirm-btn" @click="toLogin" :disabled="data.logining">认证</button>
|
||||
<view style="font-size: 24upx;color: #999999;padding: 0 15rpx;margin-top: 32rpx;margin-bottom: 10rpx;">请正确填写收款人的银行卡号和真实的收款人姓名</view>
|
||||
<button v-if="data.isAccountNo" class="confirm-btn" @click="toLogin" :disabled="data.logining">认证</button>
|
||||
<view style="font-size: 24upx;color: #999999;padding: 0 15rpx;margin-top: 32rpx;margin-bottom: 10rpx;">
|
||||
请正确填写收款人的银行卡号和真实的收款人姓名</view>
|
||||
<view style="font-size: 24upx;color: #999999;padding: 0 15rpx;;margin-bottom: 10rpx;">手机号需是银行卡银行卡预留手机号</view>
|
||||
<view style="font-size: 24upx;color: #999999;padding: 0 15rpx;;margin-bottom: 10rpx;">银行卡号需与收款人姓名一致</view>
|
||||
<view style="font-size: 24upx;color: #999999;padding: 0 15rpx;;margin-bottom: 10rpx;">身份证信息仅可使用一次</view>
|
||||
<view style="font-size: 24upx;color: #999999;padding: 0 15rpx">否则将无法正常收款,请须知</view>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { reactive, nextTick, ref } from 'vue';
|
||||
import { onReady,onLoad,onShow } from '@dcloudio/uni-app'
|
||||
import { realNameAuth } from '@/api/me/withdraw.js';
|
||||
import { selectUserById } from '@/api/user/user.js';
|
||||
import { commonType } from '@/api/init.js';
|
||||
import {
|
||||
reactive,
|
||||
nextTick,
|
||||
ref
|
||||
} from 'vue';
|
||||
import {
|
||||
onReady,
|
||||
onLoad,
|
||||
onShow
|
||||
} from '@dcloudio/uni-app'
|
||||
import {
|
||||
realNameAuth
|
||||
} from '@/api/me/withdraw.js';
|
||||
import {
|
||||
selectUserById
|
||||
} from '@/api/user/user.js';
|
||||
import {
|
||||
commonType
|
||||
} from '@/api/init.js';
|
||||
|
||||
let data = reactive({
|
||||
certName: null,
|
||||
mobile: null,
|
||||
certNum: null,
|
||||
accountNo: null,
|
||||
isAccountNo: null,
|
||||
logining: false
|
||||
isAccountNo: true,
|
||||
logining: false,
|
||||
province: null,
|
||||
city: null,
|
||||
bankBranch: null
|
||||
})
|
||||
|
||||
let inputdata = ref()
|
||||
onLoad(() => {
|
||||
getUserInfo()
|
||||
})
|
||||
|
||||
function getUserInfo () {
|
||||
selectUserById().then(res=>{
|
||||
if(res){
|
||||
function setinput() {
|
||||
if (data.accountNo) {
|
||||
return data.accountNo.indexOf('****') != -1
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
function getUserInfo() {
|
||||
selectUserById().then(res => {
|
||||
if (res) {
|
||||
data.certName = res.certName;
|
||||
data.mobile = res.mobile;
|
||||
if ( res.accountNo ) {
|
||||
if (res.accountNo) {
|
||||
inputdata.value = res
|
||||
data.accountNo = res.accountNo;
|
||||
data.certNum = res.certNo;
|
||||
}
|
||||
data.isAccountNo = res.accountNo;
|
||||
if (res.accountNo && res.province && res.city && res.bankBranch) {
|
||||
data.province = res.province;
|
||||
data.city = res.city;
|
||||
data.bankBranch = res.bankBranch;
|
||||
data.isAccountNo = false
|
||||
}
|
||||
}
|
||||
|
||||
})
|
||||
@@ -93,8 +163,11 @@
|
||||
mobile: data.mobile,
|
||||
certNum: data.certNum,
|
||||
accountNo: data.accountNo.replace(/\s+/g, ''),
|
||||
province: data.province,
|
||||
city: data.city,
|
||||
bankBranch: data.bankBranch
|
||||
})
|
||||
if( res) {
|
||||
if (res) {
|
||||
data.logining = false
|
||||
let userInfo = uni.getStorageSync('userInfo')
|
||||
userInfo.mobile = data.mobile
|
||||
@@ -126,8 +199,12 @@
|
||||
background: #FFFFFF;
|
||||
}
|
||||
|
||||
.u-cell__body__content {
|
||||
flex: 0 !important;
|
||||
}
|
||||
|
||||
.containerView {
|
||||
padding:30rpx;
|
||||
padding: 30rpx;
|
||||
position: relative;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
@@ -163,6 +240,7 @@
|
||||
color: #ffffff;
|
||||
font-size: 32rpx;
|
||||
border: none;
|
||||
|
||||
&:after {
|
||||
border: none;
|
||||
}
|
||||
|
||||
@@ -9,7 +9,10 @@
|
||||
reactive
|
||||
} from 'vue'
|
||||
import {
|
||||
onShow,onHide,onUnload,onLoad
|
||||
onShow,
|
||||
onHide,
|
||||
onUnload,
|
||||
onLoad
|
||||
} from '@dcloudio/uni-app'
|
||||
import {
|
||||
getOrderInfo
|
||||
@@ -18,7 +21,6 @@
|
||||
orderId: '',
|
||||
timer: null,
|
||||
timer1: null,
|
||||
maxAjaxNum: 5,
|
||||
ajaxNum: 0,
|
||||
url: null, //要打开的外部链接
|
||||
viewerUrl: '/hybrid/html/web/viewer.html',
|
||||
@@ -32,64 +34,92 @@
|
||||
getOrderInfo({
|
||||
orderId: state.orderId
|
||||
}).then(res => {
|
||||
state.ajaxNum+=1
|
||||
|
||||
console.log(res);
|
||||
if (res == 1) {
|
||||
uni.hideLoading()
|
||||
const sysInfo = uni.getSystemInfoSync();
|
||||
let isIos = sysInfo.platform == 'ios'
|
||||
uni.showToast({
|
||||
title: '支付成功',
|
||||
icon: 'none'
|
||||
})
|
||||
if (isIos) {
|
||||
uni.navigateBack()
|
||||
uni.showToast({
|
||||
title: '支付成功',
|
||||
icon: 'none'
|
||||
})
|
||||
setTimeout(() => {
|
||||
uni.navigateBack()
|
||||
}, 1500)
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: '支付成功',
|
||||
icon: 'none'
|
||||
})
|
||||
state.timer1 = setTimeout(() => {
|
||||
cleartimer()
|
||||
uni.navigateBack()
|
||||
}, 500)
|
||||
}
|
||||
} else {
|
||||
|
||||
}
|
||||
|
||||
if(state.ajaxNum>=state.maxAjaxNum){
|
||||
if (executionCount >= maxExecutions) {
|
||||
console.log(`已达到最大执行次数(${maxExecutions}),定时器停止`);
|
||||
uni.navigateBack()
|
||||
cleartimer()
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function cleartimer(){
|
||||
function cleartimer() {
|
||||
console.log('cleartimer');
|
||||
uni.hideLoading()
|
||||
clearInterval(state.timer)
|
||||
clearTimeout(state.timer)
|
||||
clearTimeout(state.timer1)
|
||||
state.timer=null
|
||||
state.timer1=null
|
||||
state.ajaxNum=0
|
||||
state.timer = null
|
||||
state.timer1 = null
|
||||
}
|
||||
|
||||
let runOnetime = 2000; // 初始间隔2秒
|
||||
let executionCount = 0; // 执行计数
|
||||
const maxExecutions = 5; // 最大执行次数
|
||||
|
||||
function startDynamicTimer() {
|
||||
let lastExecutionTime = Date.now();
|
||||
function executeAndReschedule() {
|
||||
// 检查是否达到最大执行次数
|
||||
if (executionCount >= maxExecutions) {
|
||||
console.log(`已达到最大执行次数(${maxExecutions}),定时器停止`);
|
||||
uni.navigateBack()
|
||||
cleartimer()
|
||||
return;
|
||||
}
|
||||
const currentTime = Date.now();
|
||||
const elapsed = currentTime - lastExecutionTime;
|
||||
lastExecutionTime = currentTime;
|
||||
getOrder();
|
||||
// 增加计数
|
||||
executionCount++;
|
||||
console.log('executionCount',executionCount);
|
||||
// 计算新的间隔:在上一次间隔基础上增加2秒
|
||||
runOnetime += 2000;
|
||||
// 如果未达到最大次数,安排下一次执行
|
||||
console.log('executionCount < maxExecutions',executionCount < maxExecutions);
|
||||
console.log(executionCount , maxExecutions);
|
||||
if (executionCount < maxExecutions) {
|
||||
state.timer = setTimeout(executeAndReschedule, runOnetime);
|
||||
}
|
||||
}
|
||||
|
||||
// 启动第一个定时器
|
||||
state.timer = setTimeout(executeAndReschedule, runOnetime);
|
||||
}
|
||||
|
||||
onShow(() => {
|
||||
executionCount=0;
|
||||
// #ifdef APP
|
||||
uni.showLoading({
|
||||
title: '支付中'
|
||||
})
|
||||
// #endif
|
||||
state.ajaxNum=0;
|
||||
runOnetime = 2000;
|
||||
getOrder()
|
||||
clearInterval(state.timer)
|
||||
state.timer=setInterval(()=>{
|
||||
getOrder()
|
||||
},2000)
|
||||
clearTimeout(state.timer)
|
||||
// 启动动态定时器
|
||||
startDynamicTimer();
|
||||
})
|
||||
onHide(() => {
|
||||
console.log('onHide');
|
||||
|
||||
1119
pages/task/index.vue
@@ -57,10 +57,11 @@
|
||||
getCurrentInstance
|
||||
} from 'vue'
|
||||
import {
|
||||
onLoad
|
||||
onLoad,onShow
|
||||
} from '@dcloudio/uni-app'
|
||||
import {
|
||||
selectTaskCenterUserReward
|
||||
selectTaskCenterUserReward,
|
||||
receiveGoods
|
||||
} from '@/api/task/index.js'
|
||||
let datas = reactive({
|
||||
list: [],
|
||||
@@ -82,6 +83,8 @@
|
||||
if (options.taskId) {
|
||||
datas.taskId = options.taskId
|
||||
}
|
||||
})
|
||||
onShow(()=>{
|
||||
getList()
|
||||
})
|
||||
// 去兑换
|
||||
|
||||
@@ -40,20 +40,25 @@
|
||||
title: ''
|
||||
})
|
||||
const refVideoList = ref(null)
|
||||
async function getDetail(){
|
||||
const res = await Api.getVideoDetail(options)
|
||||
isFirstLoad = false
|
||||
Object.assign(state, res)
|
||||
state.list = res.list
|
||||
}
|
||||
|
||||
async function init() {
|
||||
/**
|
||||
* 如果是安卓則不做操作,如果是ios判斷是否審核,不審核不套裝
|
||||
*/
|
||||
// 是否审核,是否ios
|
||||
if ($common.isIosExamine) {
|
||||
const res = await Api.getVideoDetail(options)
|
||||
isFirstLoad = false
|
||||
Object.assign(state, res)
|
||||
state.list = res.list
|
||||
getDetail()
|
||||
} else {
|
||||
// ios是否登錄 ?
|
||||
console.log(uni.getStorageSync('tokenTwo'),'提送hi')
|
||||
if (uni.getStorageSync('tokenTwo')) {
|
||||
console.log('--------')
|
||||
const res = await Api.getVideoDetail({...options,token:uni.getStorageSync('tokenTwo')})
|
||||
isFirstLoad = false
|
||||
Object.assign(state, res)
|
||||
@@ -64,7 +69,7 @@
|
||||
phone: '18681817128'
|
||||
})
|
||||
uni.setStorageSync('tokenTwo', res.token)
|
||||
init()
|
||||
getDetail()
|
||||
}
|
||||
|
||||
|
||||
@@ -98,7 +103,6 @@
|
||||
}
|
||||
onLoad((opt) => {
|
||||
Object.assign(options, opt)
|
||||
console.log(options);
|
||||
init()
|
||||
})
|
||||
|
||||
@@ -109,19 +113,22 @@
|
||||
}) {}
|
||||
|
||||
onShow(async () => {
|
||||
console.log(isFirstLoad)
|
||||
if (!isFirstLoad) {
|
||||
await init()
|
||||
await getDetail()
|
||||
refVideoList.value.videoListUpdata()
|
||||
const drawRes = await Api.getDrawCount()
|
||||
console.log(drawRes);
|
||||
const nobuyCourseId = uni.getStorageSync('nobuyCourseId')
|
||||
const item = state.list.find(v => v.courseId == nobuyCourseId)
|
||||
const item = state.list.find(v => v.courseDetailsId == nobuyCourseId)
|
||||
console.log(item)
|
||||
uni.removeStorageSync('nobuyCourseId')
|
||||
if (item) {
|
||||
if (drawRes.count * 1 > 0 && nobuyCourseId !== null && nobuyCourseId !== undefined && item
|
||||
.videoUrl) {
|
||||
console.log('跳转抽奖')
|
||||
uni.navigateTo({
|
||||
url: '/pages/me/prizeDraw'
|
||||
url: '/pages/index/prizeDraw/kevy-luckydraw'
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,93 +1,168 @@
|
||||
<template>
|
||||
<view class="min-page " >
|
||||
<view class="min-page">
|
||||
<!-- <up-button @click="toDetail">toDetail</up-button> -->
|
||||
<my-video-list isCommand isTabbar v-if="state.list.length" @swiperChange="swiperChange" :list="state.list" @update="update"
|
||||
<my-video-list
|
||||
isCommand
|
||||
isTabbar
|
||||
v-if="state.list.length"
|
||||
@swiperChange="swiperChange"
|
||||
:list="state.list"
|
||||
@update="update"
|
||||
:info="state"
|
||||
></my-video-list>
|
||||
|
||||
|
||||
@errorHandle="errorHandle"
|
||||
></my-video-list>
|
||||
</view>
|
||||
<view class="mask" v-if="maskShow">
|
||||
<view class="content">
|
||||
<view class="title">
|
||||
<text class="t">风险提示</text>
|
||||
</view>
|
||||
<view class="text">
|
||||
<text>您的账号暂不可用,详情请联系客服</text>
|
||||
</view>
|
||||
<div class="btn-wrap">
|
||||
<text class="btn" @click="toContact">去联系客服</text>
|
||||
</div>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
|
||||
<script setup>
|
||||
import {
|
||||
onLoad,
|
||||
onShow
|
||||
} from '@dcloudio/uni-app'
|
||||
import * as Api from '@/api/video/index.js'
|
||||
import {
|
||||
computed,
|
||||
reactive,
|
||||
ref
|
||||
} from 'vue'
|
||||
import {
|
||||
slice
|
||||
} from 'lodash'
|
||||
import { onLoad, onShow } from '@dcloudio/uni-app';
|
||||
import * as Api from '@/api/video/index.js';
|
||||
import { computed, reactive, ref } from 'vue';
|
||||
import { slice } from 'lodash';
|
||||
|
||||
const maskShow = ref(false);
|
||||
|
||||
function toDetail() {
|
||||
uni.navigateTo({
|
||||
url: '/pages/video/detail?courseId=1208'
|
||||
})
|
||||
function toContact() {
|
||||
uni.navigateTo({
|
||||
url: '/pages/me/contact'
|
||||
});
|
||||
}
|
||||
|
||||
function toDetail() {
|
||||
uni.navigateTo({
|
||||
url: '/pages/video/detail?courseId=1208'
|
||||
});
|
||||
}
|
||||
let options = {};
|
||||
const state = reactive({
|
||||
collect: 0,
|
||||
current: {},
|
||||
list: [],
|
||||
price: 0,
|
||||
title: ''
|
||||
});
|
||||
|
||||
// 接收错误信息
|
||||
const errorHandle = (error) => {
|
||||
console.log('errorHandle.60===', error);
|
||||
if (error.code == 702) {
|
||||
maskShow.value = true;
|
||||
} else {
|
||||
maskShow.value = false;
|
||||
}
|
||||
let options = {}
|
||||
const state = reactive({
|
||||
collect: 0,
|
||||
current: {},
|
||||
list: [],
|
||||
price: 0,
|
||||
title: ''
|
||||
})
|
||||
async function init() {
|
||||
const res = await Api.tuijianVideo(options)
|
||||
state.current = res.list[0]
|
||||
Object.assign(state, res)
|
||||
state.list = res.list
|
||||
};
|
||||
|
||||
async function init() {
|
||||
try {
|
||||
const res = await Api.tuijianVideo(options);
|
||||
state.current = res.list[0];
|
||||
Object.assign(state, res);
|
||||
state.list = res.list;
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
if (error.code == 702) {
|
||||
maskShow.value = true;
|
||||
} else {
|
||||
maskShow.value = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function update({
|
||||
index,
|
||||
item
|
||||
}) {
|
||||
state.list[index] = item
|
||||
}
|
||||
onLoad((opt) => {
|
||||
Object.assign(options, opt)
|
||||
init()
|
||||
})
|
||||
function update({ index, item }) {
|
||||
state.list[index] = item;
|
||||
}
|
||||
onLoad((opt) => {
|
||||
Object.assign(options, opt);
|
||||
init();
|
||||
});
|
||||
|
||||
function swiperChange({
|
||||
current,
|
||||
direction,
|
||||
data
|
||||
}) {}
|
||||
function swiperChange({ current, direction, data }) {}
|
||||
|
||||
onShow(() => {
|
||||
|
||||
})
|
||||
onShow(() => {});
|
||||
</script>
|
||||
|
||||
<style>
|
||||
page{
|
||||
height: calc(100vh - 50px);
|
||||
overflow: hidden;
|
||||
}
|
||||
page {
|
||||
height: calc(100vh - 50px);
|
||||
overflow: hidden;
|
||||
}
|
||||
</style>
|
||||
<style lang="scss" scoped>
|
||||
.min-page {
|
||||
/* #ifdef H5 */
|
||||
height: calc(100vh - 50px);
|
||||
/* #endif */
|
||||
/* #ifdef APP */
|
||||
height: 100vh;
|
||||
/* #endif */
|
||||
background-color: #000;
|
||||
overflow: hidden;
|
||||
flex: 1;
|
||||
}
|
||||
.min-page {
|
||||
/* #ifdef H5 */
|
||||
height: calc(100vh - 50px);
|
||||
/* #endif */
|
||||
/* #ifdef APP */
|
||||
height: 100vh;
|
||||
/* #endif */
|
||||
background-color: #000;
|
||||
overflow: hidden;
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.u-popup {
|
||||
position: fixed;
|
||||
.u-popup {
|
||||
position: fixed;
|
||||
}
|
||||
.mask {
|
||||
width: 750upx;
|
||||
height: 1700upx;
|
||||
background-color: rgba(0, 0, 0, 0.6);
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
z-index: 99999;
|
||||
.content {
|
||||
width: 680upx;
|
||||
height: 420upx;
|
||||
background-color: #fff;
|
||||
border-radius: 20upx;
|
||||
.title {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
height: 100upx;
|
||||
.t {
|
||||
font-size: 32upx;
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
.text {
|
||||
padding: 50upx 28upx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.btn-wrap {
|
||||
display: flex;
|
||||
padding: 50upx 28upx 28upx;
|
||||
.btn {
|
||||
flex: 1;
|
||||
height: 80upx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background-color: #dd8591;
|
||||
color: #fff;
|
||||
border-radius: 12upx;
|
||||
text-align: center;
|
||||
line-height: 80upx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
1
static/icon_address.svg
Normal file
@@ -0,0 +1 @@
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1745978289560" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="7345" xmlns:xlink="http://www.w3.org/1999/xlink" width="256" height="256"><path d="M510.864642 313.983087c-62.33879 0-112.889093 50.54928-112.889093 112.887047 0 62.340837 50.54928 112.89114 112.889093 112.89114 62.339814 0 112.890117-50.550303 112.890117-112.89114C623.755782 364.532367 573.204455 313.983087 510.864642 313.983087z" fill="#FF723B" p-id="7346"></path><path d="M511.999488 64.021106c-247.27171 0-447.724091 200.452381-447.724091 447.724091s200.452381 447.724091 447.724091 447.724091 447.724091-200.453405 447.724091-447.724091S759.271198 64.021106 511.999488 64.021106zM510.864642 798.860357c0 0-217.552851-168.727843-217.552851-379.73972 0-113.02724 97.376795-196.535165 217.552851-196.535165 120.175033 0 217.553874 83.507926 217.553874 196.535165C728.418516 630.132514 510.864642 798.860357 510.864642 798.860357z" fill="#FF723B" p-id="7347"></path></svg>
|
||||
|
After Width: | Height: | Size: 1.1 KiB |
BIN
static/images/wx.png
Normal file
|
After Width: | Height: | Size: 5.3 KiB |
|
Before Width: | Height: | Size: 258 KiB After Width: | Height: | Size: 129 KiB |
BIN
static/logo.png
|
Before Width: | Height: | Size: 3.9 KiB After Width: | Height: | Size: 3.5 KiB |
BIN
static/me/Frame.png
Normal file
|
After Width: | Height: | Size: 1.4 KiB |
BIN
static/me/bind_wx.png
Normal file
|
After Width: | Height: | Size: 6.6 KiB |
|
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 29 KiB |
@@ -67,23 +67,39 @@ export const useCommonStore = defineStore("common", {
|
||||
}
|
||||
},
|
||||
setversion(a, b) {
|
||||
// a是當前應用的版本號 b是接口拿的
|
||||
let appversion = (a.split('.').join('')) * 1
|
||||
let resversion = (b.split('.').join('')) * 1
|
||||
console.log('當前版本-' + appversion, '接口版本-' + resversion, '返回-' + this.isIosExamine,'判斷值-'+this.isExamines)
|
||||
if (appversion > resversion) {
|
||||
// 再審核
|
||||
this.isExamines = 1
|
||||
return new Promise(async (resolve, reject) => {
|
||||
this.isExamines = await this.compare(a, b)
|
||||
console.log('判斷值-' + this.isExamines)
|
||||
resolve(this.isExamines)
|
||||
})
|
||||
},
|
||||
// 判断版本号
|
||||
compare(version1, version2) {
|
||||
let arr1 = version1.split(".");
|
||||
let arr2 = version2.split(".");
|
||||
let length = Math.max(arr1.length, arr2.length);
|
||||
for (let i = 0; i < length; i++) {
|
||||
const n1 = Number(arr1[i] || 0)
|
||||
const n2 = Number(arr2[i] || 0)
|
||||
// version1 > version2 返回1,如果 version1 < version2 返回-1,不然返回0
|
||||
// 当前版 n1 接口版本是 n2
|
||||
// 1小于2 更新弹窗、抽奖等显示
|
||||
if (n1 < n2) return 1
|
||||
// 1大于2 更新弹窗、抽奖不显示
|
||||
if (n1 > n2) return -1
|
||||
}
|
||||
// APP等于2 更新弹窗不显示‘抽奖显示
|
||||
return 0
|
||||
}
|
||||
|
||||
},
|
||||
getters: {
|
||||
isIosExamine: function() {
|
||||
console.log(this.isExamines)
|
||||
if (!this.isIos) {
|
||||
return true
|
||||
}
|
||||
if (this.isExamines == 1) {
|
||||
if (this.isExamines == -1) {
|
||||
return false
|
||||
}
|
||||
return true
|
||||
|
||||
45
utils/wx.js
Normal file
@@ -0,0 +1,45 @@
|
||||
import {
|
||||
$bindWx,
|
||||
$bindStatus
|
||||
} from '@/api/login/login.js'
|
||||
|
||||
// 绑定状态
|
||||
export async function bindStatus() {
|
||||
const res = await $bindStatus()
|
||||
return res.wxBind ? true : false;
|
||||
}
|
||||
export function toBindWx() {
|
||||
uni.navigateTo({
|
||||
url: '/pages/login/bindWx'
|
||||
})
|
||||
|
||||
}
|
||||
//绑定微信
|
||||
export async function bindWx() {
|
||||
console.log('bindWx');
|
||||
const isBind = await bindStatus()
|
||||
if (isBind) {
|
||||
uni.showToast({
|
||||
title: '已绑定微信,请勿重复绑定',
|
||||
icon: 'none'
|
||||
})
|
||||
return
|
||||
}
|
||||
return new Promise((reslove, reject) => {
|
||||
uni.login({
|
||||
"provider": "weixin",
|
||||
"onlyAuthorize": true, // 微信登录仅请求授权认证
|
||||
success: function(loginRes) {
|
||||
console.log(loginRes);
|
||||
reslove(loginRes.code)
|
||||
},
|
||||
fail: function(err) {
|
||||
// 登录授权失败
|
||||
// err.code是错误码
|
||||
console.log(err);
|
||||
reject()
|
||||
}
|
||||
});
|
||||
})
|
||||
|
||||
}
|
||||
11
vue.config.js
Normal file
@@ -0,0 +1,11 @@
|
||||
module.exports = {
|
||||
productionSourceMap: false, // 生产打包时不输出map文件,增加打包速度
|
||||
configureWebpack: config => {
|
||||
if (process.env.NODE_ENV === 'production') {
|
||||
config.optimization.minimizer[0].options.terserOptions.compress.warnings = false
|
||||
config.optimization.minimizer[0].options.terserOptions.compress.drop_console = true
|
||||
config.optimization.minimizer[0].options.terserOptions.compress.drop_debugger = true
|
||||
config.optimization.minimizer[0].options.terserOptions.compress.pure_funcs = ['console.log']
|
||||
}
|
||||
}
|
||||
}
|
||||