Merge branch 'ymf' of e.coding.net:g-cphe0354/duanju/new_app into gyq
@@ -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
|
data: data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
export const deleteUserByUserId = (data) => {
|
||||||
|
return http.request({
|
||||||
|
url: '/user/deleteUser',
|
||||||
|
method: 'post',
|
||||||
|
})
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* 帮助中心
|
* 帮助中心
|
||||||
*/
|
*/
|
||||||
@@ -63,6 +68,7 @@ export const collectVideoSummary = () => {
|
|||||||
method: 'GET'
|
method: 'GET'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
// 注销账号
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 金币
|
* 金币
|
||||||
|
|||||||
@@ -35,7 +35,8 @@ export const queryUserMoneyDetails = (data) => {
|
|||||||
*/
|
*/
|
||||||
export const updateUser = (data) => {
|
export const updateUser = (data) => {
|
||||||
return http.request({
|
return http.request({
|
||||||
url: '/user/updateUser',
|
url: '/user/bindAlipay',
|
||||||
|
method: 'POST',
|
||||||
params: data
|
params: data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,7 +27,8 @@ export const getUserSignData = (data) => {
|
|||||||
export const receiveGoods = (data) => {
|
export const receiveGoods = (data) => {
|
||||||
return http.request({
|
return http.request({
|
||||||
url: 'taskCenter/receiveGoods',
|
url: 'taskCenter/receiveGoods',
|
||||||
data
|
data,
|
||||||
|
method: 'POST',
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
// 任务-签到
|
// 任务-签到
|
||||||
|
|||||||
@@ -137,4 +137,14 @@ export function playStatus(data) {
|
|||||||
method: 'GET',
|
method: 'GET',
|
||||||
data
|
data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 获取支付次数提示
|
||||||
|
export function getPayTips(data){
|
||||||
|
return http.request({
|
||||||
|
url: 'course/getRedEnvelopeTips',
|
||||||
|
method: 'GET',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
|
|
||||||
//打包时修改env的值即可
|
//打包时修改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 = {
|
export const h5Config = {
|
||||||
production: 'https://dj-h5.hnsiyao.cn',
|
production: 'https://web.hnsiyao.cn',
|
||||||
test: 'https://web-api.hnsiyao.cn',
|
test: 'https://web-api.hnsiyao.cn',
|
||||||
local: 'http://192.168.1.41:8100'
|
local: 'http://192.168.1.41:8100'
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,27 +1,32 @@
|
|||||||
<template>
|
<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"
|
<!-- :controls="showControls" -->
|
||||||
play-btn-position="center"
|
<video class=" video" :show-fullscreen-btn="false" @controlstoggle="controlstoggles" v-if="showVideo"
|
||||||
:show-center-play-btn="false"
|
play-btn-position="bottom" :show-center-play-btn="true" :show-play-btn="true" @click.stop="videoClick()"
|
||||||
:show-play-btn="false"
|
@loadedmetadata="loadedmetadata" @timeupdate="timeupdate" @waiting="waiting()" object-fit="cover"
|
||||||
:controls="true"
|
@loadeddata="waiting()" @pause="onpause"
|
||||||
@click.stop="videoClick()"
|
|
||||||
@loadedmetadata="loadedmetadata"
|
|
||||||
@timeupdate="timeupdate" @waiting="waiting()" object-fit="cover" @pause="onpause"
|
|
||||||
@play="videoPlay('myVideo'+item.courseDetailsId,item.courseDetailsId)" :play-strategy="2"
|
@play="videoPlay('myVideo'+item.courseDetailsId,item.courseDetailsId)" :play-strategy="2"
|
||||||
:show-loading="true" codec="software" :muted="false" :loop="loop"
|
:show-loading="true" codec="software" :muted="false" :loop="loop" :enable-progress-gesture="false"
|
||||||
:enable-progress-gesture="false" :poster="item.titleImg" :ref="'myVideo'+item.courseDetailsId"
|
:poster="item.titleImg" :ref="'myVideo'+item.courseDetailsId" :autoplay="autoplay" @ended="ended"
|
||||||
:autoplay="autoplay" @ended="ended" :id="'myVideo'+item.courseDetailsId" :src="item.videoUrl"></video>
|
: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>
|
</image>
|
||||||
|
<!-- #ifdef APP -->
|
||||||
<view class="play-icon" v-if="videoIsLoadedmetadata&&showVideo&&!isPlying" @click.stop="videoClick()" :style="playStyle">
|
<view class="control-play-cover" v-if="showControls&&isIos" @click="playCoverClick()">
|
||||||
<image class="icon" src="@/static/images/play.png" mode=""></image>
|
|
||||||
</view>
|
</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">
|
<view class="info" v-if="!isCommand" :style="infoStyle">
|
||||||
<text class="color-fff" v-if="item.courseDetailsName">{{item.courseDetailsName}}</text>
|
<text class="color-fff" v-if="item.courseDetailsName">{{item.courseDetailsName}}</text>
|
||||||
<view v-if="item.content" v-html="item.content"></view>
|
<view v-if="item.content" v-html="item.content"></view>
|
||||||
@@ -64,6 +69,10 @@
|
|||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import * as Api from '@/api/video/index.js'
|
import * as Api from '@/api/video/index.js'
|
||||||
|
// #ifdef APP
|
||||||
|
const domModule = uni.requireNativePlugin('dom')
|
||||||
|
// #endif
|
||||||
|
import progressVue from './progress.vue'
|
||||||
import {
|
import {
|
||||||
computed,
|
computed,
|
||||||
nextTick,
|
nextTick,
|
||||||
@@ -79,13 +88,17 @@
|
|||||||
// #endif
|
// #endif
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
isAndriod:{
|
isIos:{
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: false
|
default: false
|
||||||
},
|
},
|
||||||
height:{
|
isAndriod: {
|
||||||
type:Number,
|
type: Boolean,
|
||||||
default:0
|
default: false
|
||||||
|
},
|
||||||
|
height: {
|
||||||
|
type: Number,
|
||||||
|
default: 0
|
||||||
},
|
},
|
||||||
item: {
|
item: {
|
||||||
type: Object,
|
type: Object,
|
||||||
@@ -111,7 +124,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
isTabbar:{
|
isTabbar: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: false
|
default: false
|
||||||
},
|
},
|
||||||
@@ -153,22 +166,47 @@
|
|||||||
type: Number,
|
type: Number,
|
||||||
default: 1
|
default: 1
|
||||||
},
|
},
|
||||||
showControls: {
|
showAndriod: {
|
||||||
type: Boolean,
|
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)
|
let autoplay = ref(props.item.videoUrl ? true : false)
|
||||||
|
|
||||||
const emits = defineEmits(['controlstoggles', 'disappear', 'appear', 'waiting', 'videoPlay', 'ended', 'dianzanClick',
|
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){
|
function progressScroll(e) {
|
||||||
popupShow('pay',props.item)
|
emits('progressScroll')
|
||||||
|
}
|
||||||
|
|
||||||
|
function progressScrollEnd(e) {
|
||||||
|
emits('progressScrollEnd')
|
||||||
|
}
|
||||||
|
|
||||||
|
function posterClick() {
|
||||||
|
if (!props.item.videoUrl) {
|
||||||
|
popupShow('pay', props.item)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function controlstoggles(e) {
|
function controlstoggles(e) {
|
||||||
|
showControls.value = e.detail.show
|
||||||
emits('controlstoggles', e)
|
emits('controlstoggles', e)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -179,21 +217,16 @@
|
|||||||
emits('toDetail')
|
emits('toDetail')
|
||||||
}
|
}
|
||||||
|
|
||||||
function waiting() {
|
|
||||||
|
|
||||||
}
|
let videoIsLoadedmetadata = ref(false)
|
||||||
|
|
||||||
let videoIsLoadedmetadata=ref(false)
|
function loadedmetadata() {
|
||||||
function loadedmetadata(){
|
console.log('loadedmetadata');
|
||||||
videoIsLoadedmetadata.value=true
|
videoIsLoadedmetadata.value = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
let isPlying = ref(false)
|
let isPlying = ref(false)
|
||||||
watch(() => isPlying.value, (newval) => {
|
|
||||||
console.log(newval);
|
|
||||||
emits('showInfo', newval)
|
|
||||||
})
|
|
||||||
|
|
||||||
|
|
||||||
//是否是第一次加载时的播放,不是暂停再播放
|
//是否是第一次加载时的播放,不是暂停再播放
|
||||||
@@ -216,6 +249,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
function timeupdate(e) {
|
function timeupdate(e) {
|
||||||
|
playPercent.value = e.detail.currentTime * 100 / e.detail.duration
|
||||||
//隐藏loding
|
//隐藏loding
|
||||||
uni.hideLoading()
|
uni.hideLoading()
|
||||||
if (isPlayFinish) {
|
if (isPlayFinish) {
|
||||||
@@ -229,31 +263,45 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
let videoBar = null
|
||||||
|
|
||||||
|
|
||||||
|
let watingTimer = null
|
||||||
|
|
||||||
function videoPlay() {
|
function videoPlay() {
|
||||||
if (isFirstPlay && !isPlayFinish) {
|
if (isFirstPlay && !isPlayFinish) {
|
||||||
sendPlayStatus('start')
|
sendPlayStatus('start')
|
||||||
}
|
}
|
||||||
|
|
||||||
isFirstPlay = false
|
isFirstPlay = false
|
||||||
isPlying.value = true
|
isPlying.value = true
|
||||||
|
clearTimeout(watingTimer)
|
||||||
|
watingTimer = setTimeout(() => {
|
||||||
|
isWaiting.value = false
|
||||||
|
}, 1000)
|
||||||
|
// showControls.value = false
|
||||||
// #ifdef H5
|
// #ifdef H5
|
||||||
emits('controlstoggles', {
|
videoBar = videoBar ? videoBar : document.querySelector('.uni-video-bar');
|
||||||
detail: {
|
videoBar.style.cssText = 'display:none;';
|
||||||
show: false
|
|
||||||
}
|
|
||||||
})
|
|
||||||
// #endif
|
// #endif
|
||||||
|
|
||||||
|
// #ifdef APP
|
||||||
|
if (!props.showAndriod) {}
|
||||||
|
// #endif
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function onpause() {
|
function onpause() {
|
||||||
isPlying.value = false
|
isPlying.value = false
|
||||||
|
// showControls.value = true
|
||||||
// #ifdef H5
|
// #ifdef H5
|
||||||
emits('controlstoggles', {
|
videoBar = videoBar ? videoBar : document.querySelector('.uni-video-bar');
|
||||||
detail: {
|
videoBar.style.cssText = '';
|
||||||
show: true
|
|
||||||
}
|
|
||||||
})
|
|
||||||
// #endif
|
// #endif
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -278,8 +326,36 @@
|
|||||||
emits('popupShow', key)
|
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() {
|
function videoClick() {
|
||||||
console.log('videoClick');
|
console.log('videoClick');
|
||||||
|
// #ifdef APP
|
||||||
|
// 兼容ios控制条和信息展示不同步
|
||||||
|
if (isPlying.value&&showControls.value) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
// #endif
|
||||||
|
|
||||||
if (video) {
|
if (video) {
|
||||||
if (isPlying.value) {
|
if (isPlying.value) {
|
||||||
video.pause()
|
video.pause()
|
||||||
@@ -305,17 +381,15 @@
|
|||||||
let video = null
|
let video = null
|
||||||
|
|
||||||
function disappear(e) {
|
function disappear(e) {
|
||||||
emits('disappear',e)
|
emits('disappear', e)
|
||||||
if (video) {
|
if (video) {
|
||||||
video.pause()
|
video.pause()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const showVideo = computed(() => {
|
const showVideo = computed(() => {
|
||||||
if(props.isAndriod){
|
if (props.isAndriod) {
|
||||||
console.log('props.nowIndex === props.index ');
|
return (props.nowIndex === props.index && props.item.videoUrl) ? true : false
|
||||||
console.log(props.nowIndex,props.index );
|
} else {
|
||||||
return (props.nowIndex === props.index && props.item.videoUrl) ?true :false
|
|
||||||
}else{
|
|
||||||
return props.current === props.index && props.item.videoUrl
|
return props.current === props.index && props.item.videoUrl
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@@ -330,7 +404,6 @@
|
|||||||
video = uni.createVideoContext('myVideo' + props.item.courseDetailsId)
|
video = uni.createVideoContext('myVideo' + props.item.courseDetailsId)
|
||||||
video.playbackRate(props.playSpeeds)
|
video.playbackRate(props.playSpeeds)
|
||||||
video.play()
|
video.play()
|
||||||
console.log('init play');
|
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('------')
|
console.error('------')
|
||||||
@@ -344,7 +417,6 @@
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
watch(() => showVideo.value, (newval) => {
|
watch(() => showVideo.value, (newval) => {
|
||||||
console.log('showVideo change:' + newval);
|
|
||||||
if (newval) {
|
if (newval) {
|
||||||
isFirstPlay = true
|
isFirstPlay = true
|
||||||
isPlayFinish = false
|
isPlayFinish = false
|
||||||
@@ -355,7 +427,7 @@
|
|||||||
video = null
|
video = null
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
const customStyle = computed(() => {
|
const customStyle = computed(() => {
|
||||||
// #ifdef H5
|
// #ifdef H5
|
||||||
return {
|
return {
|
||||||
@@ -366,26 +438,40 @@
|
|||||||
return {}
|
return {}
|
||||||
// #endif
|
// #endif
|
||||||
})
|
})
|
||||||
const playStyle=computed(()=>{
|
const playStyle = computed(() => {
|
||||||
if(isPlying.value){
|
if (isPlying.value) {
|
||||||
return {
|
return {
|
||||||
bottom:'0'
|
bottom: '0'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return {
|
return {
|
||||||
bottom: props.isTabbar ? (50+44 +'px') : '44px'
|
bottom: props.isTabbar ? (50 + 44 + 'px') : '44px'
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
const infoStyle = computed(() => {
|
const infoStyle = computed(() => {
|
||||||
|
// #ifdef H5
|
||||||
return {
|
return {
|
||||||
transform: `translateX(${(!isPlying.value||!props.item.videoUrl)?0:'-750rpx'})`
|
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(() => {
|
const rightStyle = computed(() => {
|
||||||
|
// #ifdef H5
|
||||||
return {
|
return {
|
||||||
transform: `translateX(${(!isPlying.value||!props.item.videoUrl)?'0':60}px)`
|
transform: `translateX(${(!isPlying.value||!props.item.videoUrl)?'0':60}px)`
|
||||||
}
|
}
|
||||||
|
// #endif
|
||||||
|
return {
|
||||||
|
transform: `translateX(${(showControls.value||!props.item.videoUrl)?'0':60}px)`
|
||||||
|
}
|
||||||
|
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@@ -396,6 +482,12 @@
|
|||||||
position: relative;
|
position: relative;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* 假设控制条的类名为 uni-video-controls */
|
||||||
|
.uni-video-controls {
|
||||||
|
transition: none !important;
|
||||||
|
-webkit-transition: none !important;
|
||||||
|
}
|
||||||
|
|
||||||
.box {
|
.box {
|
||||||
/* #ifdef H5 */
|
/* #ifdef H5 */
|
||||||
flex: 1;
|
flex: 1;
|
||||||
@@ -509,7 +601,8 @@
|
|||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
}
|
}
|
||||||
.play-icon{
|
|
||||||
|
.play-icon {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
left: 0;
|
left: 0;
|
||||||
right: 0;
|
right: 0;
|
||||||
@@ -517,12 +610,13 @@
|
|||||||
bottom: 0;
|
bottom: 0;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
$icon-size:80rpx;
|
$icon-size: 80rpx;
|
||||||
.icon{
|
|
||||||
|
.icon {
|
||||||
width: $icon-size;
|
width: $icon-size;
|
||||||
height: $icon-size;
|
height: $icon-size;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.hot {
|
.hot {
|
||||||
@@ -541,8 +635,28 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.progress {
|
||||||
|
padding: 20rpx;
|
||||||
|
position: absolute;
|
||||||
|
bottom: 20rpx;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
z-index: 1;
|
||||||
|
}
|
||||||
|
|
||||||
.zhifubao {
|
.zhifubao {
|
||||||
width: 56rpx;
|
width: 56rpx;
|
||||||
height: 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>
|
</style>
|
||||||
@@ -1,16 +1,17 @@
|
|||||||
<template>
|
<template>
|
||||||
<list v-if="showAndriod" :bounce="false" :loadmoreoffset="wHeight*3" :show-scrollbar="false" ref="listBox"
|
<list v-if="showAndriod" :bounce="false" :loadmoreoffset="wHeight*3" :show-scrollbar="false" ref="listBox"
|
||||||
:pagingEnabled="true" @loadmore="loadmore" :scrollable="true">
|
:pagingEnabled="true" @loadmore="loadmore" :scrollable="scrollable">
|
||||||
<cell v-for="(item,index) in list" :key="item.courseDetailsId" :ref="setRefList(index)">
|
<cell v-for="(item,index) in list" :key="item.courseDetailsId" :ref="setRefList(index)">
|
||||||
<view class="swipers-items" :style="boxStyle" @longpress="popupShow('speed')">
|
<view class="swipers-items" :style="boxStyle" @longpress="popupShow('speed')">
|
||||||
<list-item-vue :total="list.length" :item="item" :current="current" :isCollect="isCollect"
|
<list-item-vue :total="list.length" :item="item" :current="current" :isCollect="isCollect"
|
||||||
:isAndriod="isAndriod" :isTabbar="isTabbar" @playStatusChange="playStatusChange" :height="wHeight"
|
:isAndriod="isAndriod" :showAndriod="showAndriod" :isIos="isIos" :isH5="isH5" :isTabbar="isTabbar"
|
||||||
:isCommand="isCommand" :showControls="control.showControls" @toDetail="toDetail(item,index)"
|
@playStatusChange="playStatusChange" :height="wHeight" :isCommand="isCommand"
|
||||||
@itemMounted="itemMounted" @controlstoggles="controlstoggles" :index="index" :instance="instance"
|
:showControls="control.showControls" @toDetail="toDetail(item,index)" @itemMounted="itemMounted"
|
||||||
:nowIndex="nowIndex" @appear="appear($event,item,index)" :playSpeeds="playSpeeds"
|
@controlstoggles="controlstoggles" :index="index" :instance="instance" :nowIndex="nowIndex"
|
||||||
|
@appear="appear($event,item,index)" :playSpeeds="playSpeeds"
|
||||||
@disappear="disappear($event, item,index)" @dianzanClick="dianzanClick(item,index)"
|
@disappear="disappear($event, item,index)" @dianzanClick="dianzanClick(item,index)"
|
||||||
@share="share(item)" @zhuijuClick="zhuijuClick(item)"
|
@share="share(item)" @zhuijuClick="zhuijuClick(item)" @progressScroll="progressScroll"
|
||||||
@popupShow="popupShow($event,item,index)"></list-item-vue>
|
@progressScrollEnd="progressScrollEnd" @popupShow="popupShow($event,item,index)"></list-item-vue>
|
||||||
</view>
|
</view>
|
||||||
</cell>
|
</cell>
|
||||||
</list>
|
</list>
|
||||||
@@ -20,11 +21,12 @@
|
|||||||
@transition="transition" :indicator-dots="false" :autoplay="false" :interval="0" :duration="200">
|
@transition="transition" :indicator-dots="false" :autoplay="false" :interval="0" :duration="200">
|
||||||
<swiper-item v-for="(item,index) in videoList" :key="index">
|
<swiper-item v-for="(item,index) in videoList" :key="index">
|
||||||
<list-item-vue :total="list.length" :item="item" :isCommand="isCommand" :height="wHeight"
|
<list-item-vue :total="list.length" :item="item" :isCommand="isCommand" :height="wHeight"
|
||||||
:isAndriod="isAndriod" :isTabbar="isTabbar" @playStatusChange="playStatusChange"
|
:isAndriod="isAndriod" :showAndriod="showAndriod" :isIos="isIos" :isH5="isH5" :isTabbar="isTabbar"
|
||||||
:showControls="control.showControls" :current="current" :isCollect="isCollect"
|
@playStatusChange="playStatusChange" :showControls="control.showControls" :current="current"
|
||||||
@toDetail="toDetail(item,index)" @controlstoggles="controlstoggles" :playSpeeds="playSpeeds"
|
:isCollect="isCollect" @toDetail="toDetail(item,index)" @controlstoggles="controlstoggles"
|
||||||
:index="index" :nowIndex="nowIndex" @dianzanClick="dianzanClick(item,index)" @share="share(item)"
|
:playSpeeds="playSpeeds" :index="index" :nowIndex="nowIndex"
|
||||||
@zhuijuClick="zhuijuClick(item)" @popupShow="popupShow($event,item,index)"></list-item-vue>
|
@dianzanClick="dianzanClick(item,index)" @share="share(item)" @zhuijuClick="zhuijuClick(item)"
|
||||||
|
@popupShow="popupShow($event,item,index)"></list-item-vue>
|
||||||
</swiper-item>
|
</swiper-item>
|
||||||
</swiper>
|
</swiper>
|
||||||
</view>
|
</view>
|
||||||
@@ -146,7 +148,10 @@
|
|||||||
<up-icon name="close" :size="16" color="#333" bold @click="popupClose('pay')"></up-icon>
|
<up-icon name="close" :size="16" color="#333" bold @click="popupClose('pay')"></up-icon>
|
||||||
</view>
|
</view>
|
||||||
<view class="u-m-t-30">
|
<view class="u-m-t-30">
|
||||||
<text class=" color-999 u-font-24">每日前10次付款均可获取抽奖机会,抽奖保底抽中付款金额等额红包,红包可直接提现。当前为第1次付款</text>
|
<text class=" color-999 u-font-24">{{paytips}} </text>
|
||||||
|
</view>
|
||||||
|
<view class="u-m-t-30">
|
||||||
|
<text class=" color-999 u-font-24">注:抽奖机会仅当日可用,次日作废 </text>
|
||||||
</view>
|
</view>
|
||||||
<view class="colo-333 pay-list font-bold u-font-28 u-m-t-20">
|
<view class="colo-333 pay-list font-bold u-font-28 u-m-t-20">
|
||||||
<view class="pay-list-item" v-if="info&&info.price" @click="payBtnClick('money','all')">
|
<view class="pay-list-item" v-if="info&&info.price" @click="payBtnClick('money','all')">
|
||||||
@@ -168,7 +173,7 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</up-popup>
|
</up-popup>
|
||||||
|
|
||||||
|
|
||||||
<!-- 支付确认 -->
|
<!-- 支付确认 -->
|
||||||
<up-popup :show="popup.payTips" :round="10" @close="popupClose('payTips')" :customStyle="customStyle">
|
<up-popup :show="popup.payTips" :round="10" @close="popupClose('payTips')" :customStyle="customStyle">
|
||||||
@@ -222,13 +227,53 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</up-popup>
|
</up-popup>
|
||||||
|
<!-- 达到每天支付赠送抽奖次数上限时弹窗确认 -->
|
||||||
|
<up-popup :show="popup.payConfirm" mode="center" :round="22" @close="popupClose('payConfirm')"
|
||||||
|
:customStyle="payConfirmCustomStyle">
|
||||||
|
<view class="u-p-32">
|
||||||
|
<text class="u-font-32 color-333 font-bold u-text-center">付款确认</text>
|
||||||
|
<view class="u-p-l-14 u-p-r-14">
|
||||||
|
<view class="color-333 u-font-28 u-m-t-28 u-m-b-28 ">
|
||||||
|
<view class="u-flex u-flex-row">
|
||||||
|
<text class="u-font-28">今日已付款解锁{{payCount.canGetRedPackMax}}次,本次解锁后将</text>
|
||||||
|
<text class="no-get">不会获得</text>
|
||||||
|
</view>
|
||||||
|
<text class="u-font-28">抽奖机会,请确认是否继续付款
|
||||||
|
</text>
|
||||||
|
</view>
|
||||||
|
<view class="u-flex u-flex-row u-row-between gap-20 u-p-l-28 u-p-r-28">
|
||||||
|
<text class="cancel-btn" @click="popupClose('payConfirm')">取消</text>
|
||||||
|
<text class="confirm-btn" @click="continuePay()">继续付款</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</up-popup>
|
||||||
|
|
||||||
|
<!-- 绑定微信 -->
|
||||||
|
<up-popup :show="popup.bindWx" mode="center" :round="22" @close="popupClose('bindWx')"
|
||||||
|
:customStyle="payConfirmCustomStyle">
|
||||||
|
<view class="u-p-32">
|
||||||
|
<text class="u-font-32 color-333 font-bold u-text-center">绑定微信</text>
|
||||||
|
<view class="u-p-l-14 u-p-r-14">
|
||||||
|
<text class="u-text-center color-333 u-font-28 u-m-t-28 u-m-b-28 ">
|
||||||
|
请先绑定微信,再继续完成支付
|
||||||
|
</text>
|
||||||
|
<view class="u-flex u-flex-row u-row-between gap-20 u-p-l-28 u-p-r-28">
|
||||||
|
<text class="cancel-btn" @click="popupClose('bindWx')">取消</text>
|
||||||
|
<text class="confirm-btn" @click="bindWx()">立即绑定</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</up-popup>
|
||||||
<!-- #ifdef H5 -->
|
<!-- #ifdef H5 -->
|
||||||
<my-poster ref="refPoster"></my-poster>
|
<my-poster ref="refPoster"></my-poster>
|
||||||
<!-- #endif -->
|
<!-- #endif -->
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
|
import {
|
||||||
|
toBindWx
|
||||||
|
} from '@/utils/wx.js'
|
||||||
import {
|
import {
|
||||||
useCommonStore
|
useCommonStore
|
||||||
} from '@/store/common.js'
|
} from '@/store/common.js'
|
||||||
@@ -260,6 +305,27 @@
|
|||||||
getCurrentInstance,
|
getCurrentInstance,
|
||||||
onUnmounted
|
onUnmounted
|
||||||
} from 'vue';
|
} from 'vue';
|
||||||
|
|
||||||
|
//绑定微信
|
||||||
|
function bindWx(){
|
||||||
|
popupClose('bindWx')
|
||||||
|
toBindWx()
|
||||||
|
}
|
||||||
|
|
||||||
|
const payConfirmCustomStyle = {
|
||||||
|
width: '694rpx'
|
||||||
|
}
|
||||||
|
|
||||||
|
let scrollable = ref(true)
|
||||||
|
|
||||||
|
function progressScroll() {
|
||||||
|
scrollable.value = false
|
||||||
|
}
|
||||||
|
|
||||||
|
function progressScrollEnd() {
|
||||||
|
scrollable.value = true
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
let isH5 = false
|
let isH5 = false
|
||||||
// #ifdef H5
|
// #ifdef H5
|
||||||
@@ -273,6 +339,7 @@
|
|||||||
const refPoster = ref(null)
|
const refPoster = ref(null)
|
||||||
|
|
||||||
|
|
||||||
|
let paytips = ref('')
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
list: {
|
list: {
|
||||||
type: Array,
|
type: Array,
|
||||||
@@ -309,6 +376,8 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
const control = reactive({
|
const control = reactive({
|
||||||
showBack: true,
|
showBack: true,
|
||||||
showControls: true
|
showControls: true
|
||||||
@@ -328,7 +397,6 @@
|
|||||||
})
|
})
|
||||||
|
|
||||||
function controlstoggles(e) {
|
function controlstoggles(e) {
|
||||||
console.log(e);
|
|
||||||
control.showControls = e.detail.show
|
control.showControls = e.detail.show
|
||||||
control.showBack = control.showControls
|
control.showBack = control.showControls
|
||||||
}
|
}
|
||||||
@@ -389,9 +457,11 @@
|
|||||||
const popup = reactive({
|
const popup = reactive({
|
||||||
show: false,
|
show: false,
|
||||||
pay: false,
|
pay: false,
|
||||||
|
bindWx: false,
|
||||||
payTips: false,
|
payTips: false,
|
||||||
speed: false,
|
speed: false,
|
||||||
data: null,
|
data: null,
|
||||||
|
payConfirm: false,
|
||||||
payType: null
|
payType: null
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -459,7 +529,6 @@
|
|||||||
if (isFirst) {
|
if (isFirst) {
|
||||||
$mountedComponents[index] = true
|
$mountedComponents[index] = true
|
||||||
}
|
}
|
||||||
console.log('appear:' + index);
|
|
||||||
if (!initing) {
|
if (!initing) {
|
||||||
cacheIndex = index
|
cacheIndex = index
|
||||||
}
|
}
|
||||||
@@ -529,45 +598,67 @@
|
|||||||
if (num == 1) {
|
if (num == 1) {
|
||||||
data.courseDetailsId = popup.data.courseDetailsId
|
data.courseDetailsId = popup.data.courseDetailsId
|
||||||
}
|
}
|
||||||
|
try {
|
||||||
const res = num == '10' ? await Api.buyTenVideo(data) : await Api.buyVideo(data)
|
const res = num == '10' ? await Api.buyTenVideo(data) : await Api.buyVideo(data)
|
||||||
console.log(res);
|
if (res && res.code == 407) {
|
||||||
if (!res.orders) {
|
popupShow('bindWx')
|
||||||
return uni.showToast({
|
return
|
||||||
title: '创建订单失败',
|
}
|
||||||
icon: 'none'
|
if (!res || !res.orders) {
|
||||||
})
|
return uni.showToast({
|
||||||
}
|
title: '创建订单失败',
|
||||||
if (res) {
|
icon: 'none'
|
||||||
if (type == 'gold') {
|
|
||||||
goldPay({
|
|
||||||
orderId: res.orders.ordersId
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
payOrder({
|
|
||||||
orderId: res.orders.ordersId
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
if (res) {
|
||||||
|
if (type == 'gold') {
|
||||||
|
goldPay({
|
||||||
|
orderId: res.orders.ordersId
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
payOrder({
|
||||||
|
orderId: res.orders.ordersId
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.log(error);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function payBtnClick(type, num) {
|
|
||||||
|
|
||||||
|
async function payBtnClick(type, num) {
|
||||||
console.log(type, num);
|
console.log(type, num);
|
||||||
popup.payType = `${type}-${num}`
|
popup.payType = `${type}-${num}`
|
||||||
if (type == 'gold') {
|
if (type == 'gold') {
|
||||||
return payConfirm()
|
return payConfirm()
|
||||||
}
|
}
|
||||||
|
try {
|
||||||
|
if (payCount.now > payCount.canGetRedPackMax) {
|
||||||
|
popupShow('payConfirm')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
popupClose('show')
|
||||||
|
popupShow('payTips')
|
||||||
|
} catch (error) {}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function continuePay() {
|
||||||
|
popupClose('payConfirm')
|
||||||
popupClose('show')
|
popupClose('show')
|
||||||
popupShow('payTips')
|
popupShow('payTips')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function jiClick(item, index) {
|
function jiClick(item, index) {
|
||||||
initing = false
|
initing = false
|
||||||
let newCurrent = (current.value + 1) % 3;
|
let newCurrent = (current.value + 1) % 3;
|
||||||
@@ -594,10 +685,8 @@
|
|||||||
|
|
||||||
function goListPosition(index) {
|
function goListPosition(index) {
|
||||||
clearTimeout(positonmer)
|
clearTimeout(positonmer)
|
||||||
console.log('goListPosition:' + index)
|
|
||||||
const el = refList.value[index]
|
const el = refList.value[index]
|
||||||
if (initing) {
|
if (initing) {
|
||||||
console.log($mountedComponents);
|
|
||||||
if (!$mountedComponents[index]) {
|
if (!$mountedComponents[index]) {
|
||||||
positonmer = setTimeout(() => {
|
positonmer = setTimeout(() => {
|
||||||
goListPosition(index)
|
goListPosition(index)
|
||||||
@@ -634,7 +723,19 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function popupShow(key = 'show', item, index) {
|
const payCount = reactive({
|
||||||
|
canGetRedPackMax: 0,
|
||||||
|
now: 1,
|
||||||
|
})
|
||||||
|
|
||||||
|
function extractNumbers(str) {
|
||||||
|
const numbers = str.match(/\d+/g);
|
||||||
|
if (numbers) {
|
||||||
|
return numbers.map(num => parseInt(num, 10));
|
||||||
|
}
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
async function popupShow(key = 'show', item, index) {
|
||||||
console.log(key, item, 'debug');
|
console.log(key, item, 'debug');
|
||||||
console.log('key' + popup[key]);
|
console.log('key' + popup[key]);
|
||||||
console.log('popupShow');
|
console.log('popupShow');
|
||||||
@@ -648,6 +749,17 @@
|
|||||||
xuanjiInit()
|
xuanjiInit()
|
||||||
// #endif
|
// #endif
|
||||||
}
|
}
|
||||||
|
if (key == 'pay') {
|
||||||
|
const res = await Api.getPayTips()
|
||||||
|
const numbers = extractNumbers(res)
|
||||||
|
console.log(numbers);
|
||||||
|
if (numbers.length >= 2) {
|
||||||
|
payCount.canGetRedPackMax = numbers[0]
|
||||||
|
payCount.now = numbers[1]
|
||||||
|
console.log(payCount);
|
||||||
|
}
|
||||||
|
paytips.value = res
|
||||||
|
}
|
||||||
popup[key] = true
|
popup[key] = true
|
||||||
if (item) {
|
if (item) {
|
||||||
popup.data = item
|
popup.data = item
|
||||||
@@ -772,8 +884,11 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
function share(item) {
|
function share(item) {
|
||||||
|
const {
|
||||||
|
qdCode
|
||||||
|
} = uni.getStorageSync('userInfo') || {}
|
||||||
const urls = returnShareUrl() + '/me/detail/detail?id=' + item.courseId + '&courseDetailsId=' + item
|
const urls = returnShareUrl() + '/me/detail/detail?id=' + item.courseId + '&courseDetailsId=' + item
|
||||||
.courseDetailsId + '&invitation=' + uni.getStorageSync('invitationCode') + '&qdCode=' + this.qdCode;
|
.courseDetailsId + '&invitation=' + uni.getStorageSync('invitationCode') + '&qdCode=' + qdCode;
|
||||||
console.log(urls);
|
console.log(urls);
|
||||||
// #ifdef H5
|
// #ifdef H5
|
||||||
refPoster.value.make({
|
refPoster.value.make({
|
||||||
@@ -819,7 +934,8 @@
|
|||||||
setVideoList(item)
|
setVideoList(item)
|
||||||
}
|
}
|
||||||
|
|
||||||
const refPopup=ref(null)
|
const refPopup = ref(null)
|
||||||
|
|
||||||
function setVideoList(item) {
|
function setVideoList(item) {
|
||||||
|
|
||||||
|
|
||||||
@@ -827,7 +943,6 @@
|
|||||||
const lastIndex = listLen - 1
|
const lastIndex = listLen - 1
|
||||||
const index = props.list.findIndex(v => v.courseDetailsId == item.courseDetailsId)
|
const index = props.list.findIndex(v => v.courseDetailsId == item.courseDetailsId)
|
||||||
nowIndex.value = index
|
nowIndex.value = index
|
||||||
console.log('setVideoList nowIndex' + index);
|
|
||||||
let position = ''
|
let position = ''
|
||||||
if (index === 0) {
|
if (index === 0) {
|
||||||
position = 'start'
|
position = 'start'
|
||||||
@@ -862,7 +977,6 @@
|
|||||||
videoList.value = [props.list[index + 1], props.list[index - 1], item]
|
videoList.value = [props.list[index + 1], props.list[index - 1], item]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
console.log(videoList.value, 'debug');
|
|
||||||
if (!item.videoUrl) {
|
if (!item.videoUrl) {
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
@@ -1085,8 +1199,8 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
.ji-item:nth-of-type(3n) {
|
.ji-item:nth-of-type(3n) {
|
||||||
margin-right: 0;
|
margin-right: 0;
|
||||||
}
|
}
|
||||||
@@ -1193,4 +1307,22 @@
|
|||||||
border-radius: 10px 10px 0 0;
|
border-radius: 10px 10px 0 0;
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.cancel-btn,
|
||||||
|
.confirm-btn {
|
||||||
|
width: 210rpx;
|
||||||
|
height: 70rpx;
|
||||||
|
line-height: 70rpx;
|
||||||
|
text-align: center;
|
||||||
|
font-size: 32rpx;
|
||||||
|
color: #fff;
|
||||||
|
background: #ED838A;
|
||||||
|
box-shadow: inset 0rpx -6rpx 12rpx 0rpx rgba(255, 255, 255, 0.77);
|
||||||
|
border-radius: 40rpx 40rpx 40rpx 40rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.no-get {
|
||||||
|
color: #FF5560;
|
||||||
|
font-size: 32rpx;
|
||||||
|
}
|
||||||
</style>
|
</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>
|
||||||
45
http/http.js
@@ -7,6 +7,7 @@ import {
|
|||||||
reject
|
reject
|
||||||
} from "lodash";
|
} from "lodash";
|
||||||
import config from "@/commons/config.js";
|
import config from "@/commons/config.js";
|
||||||
|
|
||||||
// 测试服
|
// 测试服
|
||||||
let baseUrl = config.baseApiUrl + "app";
|
let baseUrl = config.baseApiUrl + "app";
|
||||||
const loadingShowTime = 200;
|
const loadingShowTime = 200;
|
||||||
@@ -73,8 +74,6 @@ function commonsProcess(showLoading, httpReqCallback, isreturm) {
|
|||||||
// http响应码不正确
|
// http响应码不正确
|
||||||
if (statusCode != 200 && statusCode != 204 && statusCode != 201) {
|
if (statusCode != 200 && statusCode != 204 && statusCode != 201) {
|
||||||
isShowErrorToast = true;
|
isShowErrorToast = true;
|
||||||
data.message =
|
|
||||||
data.message == "Bad credentials" ? "用户名或密码错误" : data.message;
|
|
||||||
infoBox.showToast(data.message || "服务器异常");
|
infoBox.showToast(data.message || "服务器异常");
|
||||||
return Promise.reject(bodyData); // 跳转到catch函数
|
return Promise.reject(bodyData); // 跳转到catch函数
|
||||||
}
|
}
|
||||||
@@ -88,11 +87,29 @@ function commonsProcess(showLoading, httpReqCallback, isreturm) {
|
|||||||
isShowErrorToast = true;
|
isShowErrorToast = true;
|
||||||
return Promise.reject(bodyData); // 跳转到catch函数
|
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) {
|
if (bodyData.code != 0) {
|
||||||
infoBox.showToast(data.message);
|
infoBox.showToast(data.message);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 加密数据
|
// 加密数据
|
||||||
if (!bodyData.data && bodyData.encryptData) {
|
if (!bodyData.data && bodyData.encryptData) {
|
||||||
return Promise.resolve({
|
return Promise.resolve({
|
||||||
@@ -100,16 +117,8 @@ function commonsProcess(showLoading, httpReqCallback, isreturm) {
|
|||||||
code: bodyData.code,
|
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);
|
return Promise.resolve(result);
|
||||||
})
|
})
|
||||||
@@ -122,14 +131,12 @@ function commonsProcess(showLoading, httpReqCallback, isreturm) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (res.code == 401) {
|
if (res.code == 401) {
|
||||||
infoBox.showToast(res.message || "请登录").then(() => {
|
uni.redirectTo({
|
||||||
uni.redirectTo({
|
url: "/pages/login/login",
|
||||||
url: "/pages/login/login",
|
|
||||||
});
|
|
||||||
reject();
|
|
||||||
});
|
});
|
||||||
|
reject();
|
||||||
}
|
}
|
||||||
if (res.code != 0) {
|
if (res.code != 0 && res.code != 401) {
|
||||||
infoBox.showToast(res.msg).then(() => {});
|
infoBox.showToast(res.msg).then(() => {});
|
||||||
reject();
|
reject();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,12 +1,21 @@
|
|||||||
{
|
{
|
||||||
"name" : "duanju-app-v3",
|
"name" : "斯耀短剧",
|
||||||
"appid" : "__UNI__E0B05B1",
|
"appid" : "__UNI__E0B05B1",
|
||||||
"description" : "",
|
"description" : "",
|
||||||
"versionName" : "2.3.4",
|
"versionName" : "1.3.0",
|
||||||
"versionCode" : 234,
|
"versionCode" : 130,
|
||||||
"transformPx" : false,
|
"transformPx" : false,
|
||||||
/* 5+App特有相关 */
|
/* 5+App特有相关 */
|
||||||
"app-plus" : {
|
"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,
|
"usingComponents" : true,
|
||||||
"nvueStyleCompiler" : "uni-app",
|
"nvueStyleCompiler" : "uni-app",
|
||||||
"compilerVersion" : 3,
|
"compilerVersion" : 3,
|
||||||
@@ -21,7 +30,8 @@
|
|||||||
"Camera" : {},
|
"Camera" : {},
|
||||||
"Push" : {},
|
"Push" : {},
|
||||||
"VideoPlayer" : {},
|
"VideoPlayer" : {},
|
||||||
"Canvas" : "nvue canvas" //使用Canvas模块
|
"Canvas" : "nvue canvas", //使用Canvas模块
|
||||||
|
"OAuth" : {}
|
||||||
},
|
},
|
||||||
/* 应用发布信息 */
|
/* 应用发布信息 */
|
||||||
"distribute" : {
|
"distribute" : {
|
||||||
@@ -65,6 +75,12 @@
|
|||||||
},
|
},
|
||||||
"ad" : {
|
"ad" : {
|
||||||
"ks" : {}
|
"ks" : {}
|
||||||
|
},
|
||||||
|
"oauth" : {
|
||||||
|
"weixin" : {
|
||||||
|
"appid" : "wx5001ff1af6c4781f",
|
||||||
|
"UniversalLinks" : ""
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"abiFilters" : [ "armeabi-v7a", "arm64-v8a", "x86" ],
|
"abiFilters" : [ "armeabi-v7a", "arm64-v8a", "x86" ],
|
||||||
|
|||||||
10
pages.json
@@ -32,7 +32,8 @@
|
|||||||
{
|
{
|
||||||
"path": "pages/task/index",
|
"path": "pages/task/index",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "任务大厅"
|
"navigationBarTitleText": "任务大厅",
|
||||||
|
"navigationStyle": "custom"
|
||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
"path": "pages/chasingDrama/index",
|
"path": "pages/chasingDrama/index",
|
||||||
@@ -209,6 +210,13 @@
|
|||||||
{
|
{
|
||||||
"navigationBarTitleText" : "兑换"
|
"navigationBarTitleText" : "兑换"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path" : "pages/login/bindWx",
|
||||||
|
"style" :
|
||||||
|
{
|
||||||
|
"navigationBarTitleText" : "绑定微信"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"globalStyle": {
|
"globalStyle": {
|
||||||
|
|||||||
@@ -26,7 +26,7 @@
|
|||||||
|
|
||||||
function seVideo(item) {
|
function seVideo(item) {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url:"/pages/video/detail?courseId="+item.courseId+"&courseDetailsId="+item.courseDetailsId
|
url: "/pages/video/detail?courseId=" + item.courseId + "&courseDetailsId=" + item.courseDetailsId
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
@@ -35,7 +35,7 @@
|
|||||||
.contentlist {
|
.contentlist {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: space-around;
|
justify-content: space-between;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
margin-top: 10rpx;
|
margin-top: 10rpx;
|
||||||
padding: 0 26rpx;
|
padding: 0 26rpx;
|
||||||
@@ -44,17 +44,19 @@
|
|||||||
border-radius: 21rpx 21rpx 21rpx 21rpx;
|
border-radius: 21rpx 21rpx 21rpx 21rpx;
|
||||||
width: 30%;
|
width: 30%;
|
||||||
margin-top: 20rpx;
|
margin-top: 20rpx;
|
||||||
|
text-align: center;
|
||||||
|
|
||||||
>view {
|
>view {
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
font-size: 25rpx;
|
font-size: 25rpx;
|
||||||
text-align: left;
|
text-align: left;
|
||||||
|
margin-left: 10rpx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.liststyle:last-child {
|
// .liststyle:last-child {
|
||||||
// margin-right: auto;
|
// margin-right: auto;
|
||||||
// margin-left: 6rpx;
|
// margin-left: 6rpx;
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
@@ -10,7 +10,7 @@
|
|||||||
</view> -->
|
</view> -->
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<template v-if="datas.setindexdata">
|
<template v-if="datas.isExamine">
|
||||||
<view class="gongao">
|
<view class="gongao">
|
||||||
<view class="gongaoicon">
|
<view class="gongaoicon">
|
||||||
公告
|
公告
|
||||||
@@ -18,7 +18,7 @@
|
|||||||
<swiper :autoplay="true" :vertical="true" :interval="4000" :circular="true" :indicator-dots="false"
|
<swiper :autoplay="true" :vertical="true" :interval="4000" :circular="true" :indicator-dots="false"
|
||||||
class="swiperstyle">
|
class="swiperstyle">
|
||||||
<swiper-item v-for="(item, index) in datas.noticeList" :key="index">
|
<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-item>
|
||||||
</swiper>
|
</swiper>
|
||||||
</view>
|
</view>
|
||||||
@@ -42,27 +42,41 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<contentlist :list='datas.list'></contentlist>
|
<contentlist :list='datas.list'></contentlist>
|
||||||
<image v-if="datas.setindexdata" @click="goMsg()" src="@/static/index/red-pack-new.gif"
|
<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>
|
style="width: 200rpx;height: 200rpx;position: fixed;right: 10rpx;bottom: 180rpx;" mode=""></image>
|
||||||
<up-modal :show="datas.version.show" :confirm-text="datas.version.confirmText"
|
<up-modal :show="datas.version.show" :confirm-text="datas.version.confirmText"
|
||||||
:showCancelButton="datas.version.cancelText!=''" @confirm='confirmUpdateVersion' :title="datas.version.title"
|
:showCancelButton="datas.version.cancelText!=''" @cancel="cancelUpdateVersion" @confirm='confirmUpdateVersion'
|
||||||
:title-style="{ fontWeight: '700' }" confirm-color="rgb(255, 117, 129)" @cancel="datas.version.show = false">
|
:title="datas.version.title" :title-style="{ fontWeight: '700' }" confirm-color="rgb(255, 117, 129)">
|
||||||
<view class="" style="padding-top: 30rpx;text-align: left;">
|
<view class="" style="padding-top: 30rpx;text-align: left;">
|
||||||
<scroll-view scroll-y="true" style="max-height: 50vh;">
|
<scroll-view scroll-y="true" style="max-height: 50vh;">
|
||||||
<rich-text style="color:#666" :nodes="datas.version.content"></rich-text>
|
<!-- <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>
|
</scroll-view>
|
||||||
</view>
|
</view>
|
||||||
</up-modal>
|
</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"
|
<!-- 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)">
|
confirm-color="rgb(255, 117, 129)">
|
||||||
<view class="u-p-30 u-text-left">
|
<view class="color-red u-text-left">
|
||||||
<scroll-view scroll-y="true" style="max-height: 50vh;">
|
<text>2025年2月8日将关闭网页访问,请及时下载最新APP</text>
|
||||||
<rich-text style="text-align: justify;font-size: 18px;color: #666;"
|
|
||||||
:nodes="datas.rule_content"></rich-text>
|
|
||||||
</scroll-view>
|
|
||||||
</view>
|
</view>
|
||||||
</up-modal>
|
</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 -->
|
||||||
|
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
@@ -97,11 +111,15 @@
|
|||||||
// console.log('cash:' + uni.getStorageSync('userInfo').userId + "" + new Date().getTime(), 'debug')
|
// console.log('cash:' + uni.getStorageSync('userInfo').userId + "" + new Date().getTime(), 'debug')
|
||||||
// 判断ios是否审核
|
// 判断ios是否审核
|
||||||
$common.init()
|
$common.init()
|
||||||
let sysInfo = uni.getSystemInfoSync()
|
// #ifdef H5
|
||||||
let isIos = sysInfo.platform == 'ios'
|
datas.isExamine = $common.isIosExamine
|
||||||
if (isIos) {
|
// #endif
|
||||||
datas.setindexdata = $common.isIosExamine
|
// let sysInfo = uni.getSystemInfoSync()
|
||||||
}
|
// let isIos = sysInfo.platform == 'ios'
|
||||||
|
// if (isIos) {
|
||||||
|
// datas.setindexdata = $common.setversion
|
||||||
|
// console.log(datas.setindexdata,'seaeasdas')
|
||||||
|
// }
|
||||||
})
|
})
|
||||||
let datas = reactive({
|
let datas = reactive({
|
||||||
noticeList: [], //公告列表
|
noticeList: [], //公告列表
|
||||||
@@ -110,13 +128,13 @@
|
|||||||
|
|
||||||
list: [], // 底部短剧内容
|
list: [], // 底部短剧内容
|
||||||
page: 1, // 首页推荐分页
|
page: 1, // 首页推荐分页
|
||||||
|
stopShow: true, //h5关闭弹窗
|
||||||
ruleShow: false,
|
ruleShow: false,
|
||||||
rule_title: '', // 首页弹窗标题
|
rule_title: '', // 首页弹窗标题
|
||||||
rule_content: '', // 首页弹窗内容
|
rule_content: '', // 首页弹窗内容
|
||||||
ruleIndex: 0,
|
ruleIndex: 0,
|
||||||
ruleList: [],
|
ruleList: [],
|
||||||
|
stopShows: false,
|
||||||
version: {
|
version: {
|
||||||
show: false,
|
show: false,
|
||||||
title: "",
|
title: "",
|
||||||
@@ -125,13 +143,13 @@
|
|||||||
cancelText: "",
|
cancelText: "",
|
||||||
downloadLink: ""
|
downloadLink: ""
|
||||||
},
|
},
|
||||||
setindexdata :"false"
|
setindexdata: false,
|
||||||
|
cloneNum: 0
|
||||||
})
|
})
|
||||||
onLoad(() => {
|
onLoad(() => {
|
||||||
versionUpdate()
|
versionUpdate()
|
||||||
getMsg()
|
getMsg()
|
||||||
getrecomVideo()
|
getrecomVideo()
|
||||||
datas.isExamine = $common.isIosExamine || 0
|
|
||||||
})
|
})
|
||||||
onReady(() => {
|
onReady(() => {
|
||||||
if (!uni.getStorageSync('ruleShow')) {
|
if (!uni.getStorageSync('ruleShow')) {
|
||||||
@@ -151,6 +169,50 @@
|
|||||||
++datas.page
|
++datas.page
|
||||||
getrecomVideo()
|
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 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() {
|
function versionUpdate() {
|
||||||
//#ifdef APP-PLUS
|
//#ifdef APP-PLUS
|
||||||
@@ -158,22 +220,25 @@
|
|||||||
//获取当前系统版本信息
|
//获取当前系统版本信息
|
||||||
plus.runtime.getProperty(plus.runtime.appid, widgetInfo => {
|
plus.runtime.getProperty(plus.runtime.appid, widgetInfo => {
|
||||||
//请求后台接口 解析数据 对比版本
|
//请求后台接口 解析数据 对比版本
|
||||||
selectNewApp().then( async res => {
|
selectNewApp().then(async res => {
|
||||||
res = res[0];
|
res = res[0];
|
||||||
console.log(uni.getSystemInfoSync().platform == 'ios',1101)
|
console.log(uni.getSystemInfoSync().platform == 'ios', 1101)
|
||||||
let version;
|
let version;
|
||||||
if (uni.getSystemInfoSync().platform == 'android') {
|
if (uni.getSystemInfoSync().platform == 'android') {
|
||||||
version = res.version
|
version = res.version
|
||||||
}
|
}
|
||||||
if (uni.getSystemInfoSync().platform == 'ios') {
|
if (uni.getSystemInfoSync().platform == 'ios') {
|
||||||
version = res.iosVersion
|
version = res.iosVersion
|
||||||
}
|
}
|
||||||
let isVersion = await $common.setversion(widgetInfo.version, version)
|
let isVersion = await $common.setversion(widgetInfo.version, version)
|
||||||
if ( isVersion == 1 ) {
|
datas.isExamine = $common.isIosExamine
|
||||||
|
console.log(isVersion, '')
|
||||||
|
if (isVersion == 1) {
|
||||||
datas.version.downloadLink = res.androidWgtUrl;
|
datas.version.downloadLink = res.androidWgtUrl;
|
||||||
datas.version.show = true;
|
datas.version.show = true;
|
||||||
datas.version.title = "发现新版本";
|
datas.version.title = "发现新版本";
|
||||||
datas.version.content = res.des;
|
datas.version.content = res.des;
|
||||||
|
uni.hideTabBar()
|
||||||
if (res.method == "true") {
|
if (res.method == "true") {
|
||||||
datas.version.confirmText = "立即更新"
|
datas.version.confirmText = "立即更新"
|
||||||
} else {
|
} else {
|
||||||
@@ -187,6 +252,11 @@
|
|||||||
//#endif
|
//#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function cancelUpdateVersion() {
|
||||||
|
uni.showTabBar()
|
||||||
|
datas.version.show = false
|
||||||
|
}
|
||||||
|
|
||||||
function confirmUpdateVersion() {
|
function confirmUpdateVersion() {
|
||||||
// plus.runtime.openURL(config.baseUrl + '/pages/login/appEq')
|
// plus.runtime.openURL(config.baseUrl + '/pages/login/appEq')
|
||||||
linkTo('/pages/login/download')
|
linkTo('/pages/login/download')
|
||||||
@@ -258,11 +328,8 @@
|
|||||||
url: '/pages/index/search/index'
|
url: '/pages/index/search/index'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
// 公告
|
|
||||||
async function getMsg() {
|
|
||||||
let res = await messageselectMessage()
|
|
||||||
datas.noticeList = res.list
|
|
||||||
}
|
|
||||||
//获取推荐视频
|
//获取推荐视频
|
||||||
async function getrecomVideo(sort, active = 1) {
|
async function getrecomVideo(sort, active = 1) {
|
||||||
datas.active = active
|
datas.active = active
|
||||||
@@ -286,12 +353,12 @@
|
|||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.indexStyle {
|
.indexStyle {
|
||||||
height: 555rpx;
|
height: 350rpx;
|
||||||
position: relative;
|
position: relative;
|
||||||
|
|
||||||
>image {
|
>image {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 555rpx;
|
height: 100%;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -323,11 +390,11 @@
|
|||||||
|
|
||||||
.gongao {
|
.gongao {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
bottom: 75rpx;
|
bottom: 85rpx;
|
||||||
left: 70rpx;
|
left: 70rpx;
|
||||||
border-radius: 21rpx 21rpx 21rpx 21rpx;
|
border-radius: 12rpx 12rpx 12rpx 12rpx;
|
||||||
width: 611rpx;
|
width: 611rpx;
|
||||||
height: 78rpx;
|
height: 60rpx;
|
||||||
background-color: rgba(255, 255, 255, .65);
|
background-color: rgba(255, 255, 255, .65);
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
@@ -337,10 +404,10 @@
|
|||||||
.gongaoicon {
|
.gongaoicon {
|
||||||
color: #ffffff;
|
color: #ffffff;
|
||||||
width: 98rpx;
|
width: 98rpx;
|
||||||
height: 50rpx;
|
height: 40rpx;
|
||||||
line-height: 50rpx;
|
line-height: 40rpx;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
font-size: 25rpx;
|
font-size: 20rpx;
|
||||||
background-image: url('../../static/index/gonggaobg.png');
|
background-image: url('../../static/index/gonggaobg.png');
|
||||||
background-size: 98rpx 50rpx;
|
background-size: 98rpx 50rpx;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -79,18 +79,22 @@
|
|||||||
}
|
}
|
||||||
if (datas.tabIndex == 1) {
|
if (datas.tabIndex == 1) {
|
||||||
if (datas.page == 1) {
|
if (datas.page == 1) {
|
||||||
|
datas.list = []
|
||||||
datas.list = res.records;
|
datas.list = res.records;
|
||||||
} else {
|
} else {
|
||||||
if (res.records.length) {
|
if (res.records.length) {
|
||||||
datas.list.push(...datas.list, res.records)
|
let arr = datas.list.concat(res.records)
|
||||||
|
datas.list = arr
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (datas.page == 1) {
|
if (datas.page == 1) {
|
||||||
|
datas.list = []
|
||||||
datas.list = res.list;
|
datas.list = res.list;
|
||||||
} else {
|
} else {
|
||||||
if (res.records.length) {
|
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;
|
// datas.total = res.page.totalCount;
|
||||||
|
|||||||
@@ -24,7 +24,8 @@
|
|||||||
<view class="t-r-title t-flex-row">活动规则</view>
|
<view class="t-r-title t-flex-row">活动规则</view>
|
||||||
<view class="t-rule">
|
<view class="t-rule">
|
||||||
<text>1.抽奖细则:每日前{{ freeNumDay }}次付款均可获得抽奖机会</text>
|
<text>1.抽奖细则:每日前{{ freeNumDay }}次付款均可获得抽奖机会</text>
|
||||||
<text>2.奖励说明:红包奖励将自动发放到红包余额,已绑定银行卡账号将会自动发起提现。其余奖品则需联系客服领取。</text>
|
<text>2.抽奖机会仅当日可用,次日作废(凌晨24点自动清零)</text>
|
||||||
|
<text>3.奖励说明:红包奖励将自动发放到红包余额,已绑定银行卡账号将会自动发起提现。其余奖品则需联系客服领取。</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</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">
|
<view class="content">
|
||||||
<image class="logo" src="/static/download/appLogo.png"></image>
|
<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>
|
<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>
|
</view>
|
||||||
|
|
||||||
@@ -32,7 +32,7 @@
|
|||||||
// #ifdef H5
|
// #ifdef H5
|
||||||
let u = window.navigator.userAgent;
|
let u = window.navigator.userAgent;
|
||||||
if ( uni.getSystemInfoSync().platform == 'ios') {
|
if ( uni.getSystemInfoSync().platform == 'ios') {
|
||||||
data.confirmBtn = "跳转网页版首页"
|
data.confirmBtn = "顺享短剧APP"
|
||||||
}
|
}
|
||||||
if ( u.toLowerCase().indexOf('micromessenger') !== -1) {
|
if ( u.toLowerCase().indexOf('micromessenger') !== -1) {
|
||||||
data.isWeixin = true
|
data.isWeixin = true
|
||||||
@@ -45,54 +45,22 @@
|
|||||||
console.log(uni.getSystemInfoSync().platform == 'android')
|
console.log(uni.getSystemInfoSync().platform == 'android')
|
||||||
if (uni.getSystemInfoSync().platform == 'android') {
|
if (uni.getSystemInfoSync().platform == 'android') {
|
||||||
commonType(49).then(res => {
|
commonType(49).then(res => {
|
||||||
console.log(res)
|
|
||||||
if (res && res.value) {
|
if (res && res.value) {
|
||||||
// #ifndef H5
|
// #ifndef H5
|
||||||
plus.runtime.openURL(res.value, function(res) {
|
plus.runtime.openURL(res.value, function(res) {});
|
||||||
|
|
||||||
});
|
|
||||||
// #endif
|
// #endif
|
||||||
// #ifdef H5
|
// #ifdef H5
|
||||||
uni.setClipboardData({
|
|
||||||
data: res.value,
|
|
||||||
success: r => {
|
|
||||||
// this.$queue.showToast('邀请码复制成功');
|
|
||||||
uni.showToast({
|
|
||||||
title: '邀请码复制成功',
|
|
||||||
icon: 'none',
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
window.location.href = res.value;
|
window.location.href = res.value;
|
||||||
// #endif
|
// #endif
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
commonType(50).then(res => {
|
// #ifndef H5
|
||||||
if (res && res.value) {
|
plus.runtime.openURL('https://apps.apple.com/cn/app/%E9%A1%BA%E4%BA%AB%E7%9F%AD%E5%89%A7/id6740074541', function(res) {});
|
||||||
// #ifndef H5
|
// #endif
|
||||||
plus.runtime.openURL(res.value, function(res) {
|
// #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
|
||||||
// #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
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -9,13 +9,17 @@
|
|||||||
<image class="img" src="/static/logo.png" mode="widthFix"></image>
|
<image class="img" src="/static/logo.png" mode="widthFix"></image>
|
||||||
</view>
|
</view>
|
||||||
<view class="quick-menu">
|
<view class="quick-menu">
|
||||||
<image class="icon" src="/static/me/logo_btn1.png" mode="aspectFit" @click="linkTo('/pages/share/index', true)"></image>
|
<image class="icon" src="/static/me/logo_btn1.png" mode="aspectFit"
|
||||||
<image class="icon" src="/static/me/logo_btn2.png" mode="aspectFit" @click="linkTo('/pages/me/message', true)"></image>
|
@click="linkTo('/pages/share/index', true)"></image>
|
||||||
<image class="icon" src="/static/me/logo_btn3.png" mode="aspectFit" @click="linkTo('/pages/me/contact', true)"></image>
|
<image class="icon" src="/static/me/logo_btn2.png" mode="aspectFit"
|
||||||
|
@click="linkTo('/pages/me/message', true)"></image>
|
||||||
|
<image class="icon" src="/static/me/logo_btn3.png" mode="aspectFit"
|
||||||
|
@click="linkTo('/pages/me/contact', true)"></image>
|
||||||
</view>
|
</view>
|
||||||
</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>
|
<image class="avatar" :src="userInfo.avatar || '/static/default_avatar.png'" mode="aspectFill">
|
||||||
|
</image>
|
||||||
<view class="info-wrap">
|
<view class="info-wrap">
|
||||||
<view class="name">{{ userInfo.phone || '请登录' }}</view>
|
<view class="name">{{ userInfo.phone || '请登录' }}</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -44,7 +48,7 @@
|
|||||||
<div @click="linkTo('/pages/me/gold_record', true)">
|
<div @click="linkTo('/pages/me/gold_record', true)">
|
||||||
<view class="btn">金币明细</view>
|
<view class="btn">金币明细</view>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
<div class="title-wrap" @click="linkTo('/pages/watching_history/watching_history?type=3', true)">
|
<div class="title-wrap" @click="linkTo('/pages/watching_history/watching_history?type=3', true)">
|
||||||
<view class="a">
|
<view class="a">
|
||||||
@@ -52,14 +56,10 @@
|
|||||||
<up-icon name="arrow-right"></up-icon>
|
<up-icon name="arrow-right"></up-icon>
|
||||||
</view>
|
</view>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<view class="history-list">
|
<view class="history-list">
|
||||||
<view
|
<view class="item" v-for="item in recordThree" :key="item.id"
|
||||||
class="item"
|
@click="linkTo(`/pages/video/detail?courseId=${item.courseId}&courseDetailsId=${item.courseDetailsId}`)">
|
||||||
v-for="item in recordThree"
|
|
||||||
:key="item.id"
|
|
||||||
@click="linkTo(`/pages/video/detail?courseId=${item.courseId}&courseDetailsId=${item.courseDetailsId}`)"
|
|
||||||
>
|
|
||||||
<image class="cover" :src="item.titleImg" mode="aspectFill"></image>
|
<image class="cover" :src="item.titleImg" mode="aspectFill"></image>
|
||||||
<view class="name">{{ item.title }}</view>
|
<view class="name">{{ item.title }}</view>
|
||||||
<view class="t">看到{{ item.courseDetailsName }}</view>
|
<view class="t">看到{{ item.courseDetailsName }}</view>
|
||||||
@@ -72,8 +72,8 @@
|
|||||||
<view class="card-wrap">
|
<view class="card-wrap">
|
||||||
<view class="menu-list">
|
<view class="menu-list">
|
||||||
<view class="item" @click="toTask">
|
<view class="item" @click="toTask">
|
||||||
<image class="icon" src="/static/me/menu_icon1.png" mode="aspectFit"></image>
|
<image class="icon" src="/static/me/Frame.png" mode="aspectFit"></image>
|
||||||
<view class="name">任务中心</view>
|
<view class="name">邀请好友</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="item" @click="linkTo('/pages/me/setting')">
|
<view class="item" @click="linkTo('/pages/me/setting')">
|
||||||
<image class="icon" src="/static/me/menu_icon2.png" mode="aspectFit"></image>
|
<image class="icon" src="/static/me/menu_icon2.png" mode="aspectFit"></image>
|
||||||
@@ -99,6 +99,13 @@
|
|||||||
<image class="icon" src="/static/me/menu_icon7.png" mode="aspectFit"></image>
|
<image class="icon" src="/static/me/menu_icon7.png" mode="aspectFit"></image>
|
||||||
<view class="name">关于我们</view>
|
<view class="name">关于我们</view>
|
||||||
</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')">
|
<view class="item" @click="linkTo('/pages/me/privacy')">
|
||||||
<image class="icon" src="/static/me/menu_icon8.png" mode="aspectFit"></image>
|
<image class="icon" src="/static/me/menu_icon8.png" mode="aspectFit"></image>
|
||||||
<view class="name">隐私政策</view>
|
<view class="name">隐私政策</view>
|
||||||
@@ -110,288 +117,359 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, reactive } from 'vue';
|
import {
|
||||||
import { onLoad,onShow, onPullDownRefresh } from '@dcloudio/uni-app';
|
ref,
|
||||||
import { selectByUserId, collectVideoSummary, selectUserMoney } from '@/api/me/me.js';
|
reactive
|
||||||
import { linkTo } from '@/utils/app.js';
|
} from 'vue';
|
||||||
import {
|
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
|
useCommonStore
|
||||||
} from '@/store/common.js'
|
} from '@/store/common.js'
|
||||||
|
import {toBindWx,bindStatus} from '@/utils/wx.js'
|
||||||
const $common = useCommonStore()
|
const $common = useCommonStore()
|
||||||
const userInfo = ref({});
|
const userInfo = ref({});
|
||||||
|
|
||||||
// 获取最近的三条观看历史
|
|
||||||
const recordThree = ref([]);
|
|
||||||
onShow(()=>{
|
|
||||||
// 判断ios是否审核
|
|
||||||
$common.init()
|
|
||||||
})
|
|
||||||
async function selectByUserIdAjax() {
|
|
||||||
try {
|
|
||||||
const res = await selectByUserId({ page: 1, limit: 3, classify: 3 });
|
|
||||||
recordThree.value = res.records;
|
|
||||||
} catch (error) {
|
|
||||||
console.log(error);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// 我的喜欢 我的追剧
|
|
||||||
const likeData = reactive({
|
|
||||||
likeCount: 0,
|
|
||||||
collectCount: 0
|
|
||||||
});
|
|
||||||
async function collectVideoSummaryAjax() {
|
|
||||||
try {
|
|
||||||
const res = await collectVideoSummary();
|
|
||||||
likeData.likeCount = res.likeCount;
|
|
||||||
likeData.collectCount = res.collectCount;
|
|
||||||
} catch (error) {
|
|
||||||
console.log(error);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 金币
|
|
||||||
const gold = ref(0);
|
|
||||||
const amount = ref(0);
|
|
||||||
async function selectUserMoneyAjax() {
|
|
||||||
try {
|
|
||||||
const res = await selectUserMoney();
|
|
||||||
gold.value = res.money;
|
|
||||||
amount.value = res.amount;
|
|
||||||
} catch (error) {
|
|
||||||
console.log(error);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 跳转任务中心
|
|
||||||
function toTask() {
|
|
||||||
uni.switchTab({
|
|
||||||
url: '/pages/task/index'
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
onPullDownRefresh(async () => {
|
|
||||||
await selectByUserIdAjax();
|
|
||||||
await collectVideoSummaryAjax();
|
|
||||||
await selectUserMoneyAjax();
|
|
||||||
userInfo.value = uni.getStorageSync('userInfo');
|
|
||||||
setTimeout(() => {
|
|
||||||
uni.stopPullDownRefresh();
|
|
||||||
}, 500);
|
|
||||||
});
|
|
||||||
|
|
||||||
onLoad(() => {
|
|
||||||
if(uni.getStorageSync('token')){
|
|
||||||
selectByUserIdAjax();
|
|
||||||
collectVideoSummaryAjax();
|
|
||||||
selectUserMoneyAjax();
|
|
||||||
userInfo.value = uni.getStorageSync('userInfo');
|
|
||||||
}
|
|
||||||
|
|
||||||
});
|
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(() => {
|
||||||
|
// 判断ios是否审核
|
||||||
|
$common.init()
|
||||||
|
})
|
||||||
|
async function selectByUserIdAjax() {
|
||||||
|
try {
|
||||||
|
const res = await selectByUserId({
|
||||||
|
page: 1,
|
||||||
|
limit: 3,
|
||||||
|
classify: 3
|
||||||
|
});
|
||||||
|
recordThree.value = res.records;
|
||||||
|
} catch (error) {
|
||||||
|
console.log(error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 我的喜欢 我的追剧
|
||||||
|
const likeData = reactive({
|
||||||
|
likeCount: 0,
|
||||||
|
collectCount: 0
|
||||||
|
});
|
||||||
|
async function collectVideoSummaryAjax() {
|
||||||
|
try {
|
||||||
|
const res = await collectVideoSummary();
|
||||||
|
likeData.likeCount = res.likeCount;
|
||||||
|
likeData.collectCount = res.collectCount;
|
||||||
|
} catch (error) {
|
||||||
|
console.log(error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 金币
|
||||||
|
const gold = ref(0);
|
||||||
|
const amount = ref(0);
|
||||||
|
async function selectUserMoneyAjax() {
|
||||||
|
try {
|
||||||
|
const res = await selectUserMoney();
|
||||||
|
gold.value = res.money;
|
||||||
|
amount.value = res.amount;
|
||||||
|
} catch (error) {
|
||||||
|
console.log(error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 跳转任务中心
|
||||||
|
function toTask() {
|
||||||
|
linkTo('/pages/share/index');
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
onPullDownRefresh(async () => {
|
||||||
|
await selectByUserIdAjax();
|
||||||
|
await collectVideoSummaryAjax();
|
||||||
|
await selectUserMoneyAjax();
|
||||||
|
userInfo.value = uni.getStorageSync('userInfo');
|
||||||
|
setTimeout(() => {
|
||||||
|
uni.stopPullDownRefresh();
|
||||||
|
}, 500);
|
||||||
|
});
|
||||||
|
|
||||||
|
onShow(() => {
|
||||||
|
if (uni.getStorageSync('token')) {
|
||||||
|
selectByUserIdAjax();
|
||||||
|
collectVideoSummaryAjax();
|
||||||
|
selectUserMoneyAjax();
|
||||||
|
userInfo.value = uni.getStorageSync('userInfo');
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
page {
|
page {
|
||||||
background: #f5f7ff;
|
background: #f5f7ff;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
$bgColor: #f5f7ff;
|
$bgColor: #f5f7ff;
|
||||||
|
|
||||||
.container {
|
.container {
|
||||||
font-size: 28upx;
|
font-size: 28upx;
|
||||||
color: #333;
|
color: #333;
|
||||||
}
|
|
||||||
.top-bg {
|
|
||||||
width: 100%;
|
|
||||||
height: 50%;
|
|
||||||
position: fixed;
|
|
||||||
top: 0;
|
|
||||||
left: 0;
|
|
||||||
background: linear-gradient(90deg, #ffe5ea 0, #e4f5fb 49%, #fff0ee);
|
|
||||||
&::after {
|
|
||||||
content: '';
|
|
||||||
height: 50%;
|
|
||||||
width: 100%;
|
|
||||||
background: linear-gradient(to bottom, transparent, $bgColor);
|
|
||||||
position: absolute;
|
|
||||||
bottom: 0;
|
|
||||||
left: 0;
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
.content {
|
.top-bg {
|
||||||
padding: 28upx;
|
width: 100%;
|
||||||
position: relative;
|
height: 50%;
|
||||||
.user-info {
|
position: fixed;
|
||||||
.logo-wrap {
|
top: 0;
|
||||||
display: flex;
|
left: 0;
|
||||||
align-items: center;
|
background: linear-gradient(90deg, #ffe5ea 0, #e4f5fb 49%, #fff0ee);
|
||||||
justify-content: space-between;
|
|
||||||
.logo {
|
&::after {
|
||||||
width: 160upx;
|
content: '';
|
||||||
.img {
|
height: 50%;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
display: block;
|
background: linear-gradient(to bottom, transparent, $bgColor);
|
||||||
|
position: absolute;
|
||||||
|
bottom: 0;
|
||||||
|
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;
|
||||||
|
height: $size;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.quick-menu {
|
|
||||||
|
.top {
|
||||||
display: flex;
|
display: flex;
|
||||||
gap: 20upx;
|
align-items: center;
|
||||||
|
padding-top: 40upx;
|
||||||
|
|
||||||
|
.avatar {
|
||||||
|
$size: 94upx;
|
||||||
|
width: $size;
|
||||||
|
height: $size;
|
||||||
|
border-radius: 50%;
|
||||||
|
margin-right: 12upx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.info-wrap {
|
||||||
|
flex: 1;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
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;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.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: '';
|
||||||
|
// width: $size;
|
||||||
|
// height: $size;
|
||||||
|
// border-radius: 8upx;
|
||||||
|
// transform: rotate(45deg);
|
||||||
|
// position: absolute;
|
||||||
|
// left: 50%;
|
||||||
|
// margin-left: $size * 0.5 * -1;
|
||||||
|
// bottom: $size * 0.3 * -1;
|
||||||
|
// background: inherit;
|
||||||
|
// }
|
||||||
|
.left {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
|
||||||
.icon {
|
.icon {
|
||||||
$size: 60upx;
|
$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%);
|
||||||
|
width: 144upx;
|
||||||
|
height: 56upx;
|
||||||
|
border-radius: 56upx;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
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;
|
||||||
|
grid-template-columns: repeat(3, 1fr);
|
||||||
|
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;
|
||||||
|
overflow: hidden;
|
||||||
|
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;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
margin-bottom: 32upx;
|
||||||
|
|
||||||
|
.icon {
|
||||||
|
$size: 56upx;
|
||||||
width: $size;
|
width: $size;
|
||||||
height: $size;
|
height: $size;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
.name {
|
||||||
.top {
|
font-size: 24upx;
|
||||||
display: flex;
|
margin-top: 8upx;
|
||||||
align-items: center;
|
color: #333;
|
||||||
padding-top: 40upx;
|
|
||||||
.avatar {
|
|
||||||
$size: 94upx;
|
|
||||||
width: $size;
|
|
||||||
height: $size;
|
|
||||||
border-radius: 50%;
|
|
||||||
margin-right: 12upx;
|
|
||||||
}
|
|
||||||
.info-wrap {
|
|
||||||
flex: 1;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
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;
|
|
||||||
justify-content: center;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
</style>
|
||||||
.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: '';
|
|
||||||
// width: $size;
|
|
||||||
// height: $size;
|
|
||||||
// border-radius: 8upx;
|
|
||||||
// transform: rotate(45deg);
|
|
||||||
// position: absolute;
|
|
||||||
// left: 50%;
|
|
||||||
// margin-left: $size * 0.5 * -1;
|
|
||||||
// bottom: $size * 0.3 * -1;
|
|
||||||
// background: inherit;
|
|
||||||
// }
|
|
||||||
.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%);
|
|
||||||
width: 144upx;
|
|
||||||
height: 56upx;
|
|
||||||
border-radius: 56upx;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
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;
|
|
||||||
grid-template-columns: repeat(3, 1fr);
|
|
||||||
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;
|
|
||||||
overflow: hidden;
|
|
||||||
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;
|
|
||||||
flex-direction: column;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
margin-bottom: 32upx;
|
|
||||||
.icon {
|
|
||||||
$size: 56upx;
|
|
||||||
width: $size;
|
|
||||||
height: $size;
|
|
||||||
}
|
|
||||||
.name {
|
|
||||||
font-size: 24upx;
|
|
||||||
margin-top: 8upx;
|
|
||||||
color: #333;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -21,6 +21,10 @@
|
|||||||
<view class="title">隐私协议</view>
|
<view class="title">隐私协议</view>
|
||||||
<up-icon name="arrow-right" />
|
<up-icon name="arrow-right" />
|
||||||
</view>
|
</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="item" @click="logout" v-if="token">
|
||||||
<view class="title">退出登录</view>
|
<view class="title">退出登录</view>
|
||||||
<up-icon name="arrow-right" />
|
<up-icon name="arrow-right" />
|
||||||
@@ -31,64 +35,98 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref } from 'vue';
|
import {
|
||||||
import { linkTo } from '@/utils/app.js';
|
ref
|
||||||
import { onLoad } from '@dcloudio/uni-app';
|
} from 'vue';
|
||||||
|
import {
|
||||||
const version = ref('');
|
linkTo
|
||||||
const token = ref('');
|
} from '@/utils/app.js';
|
||||||
|
import {
|
||||||
// 退出登录
|
onLoad
|
||||||
function logout() {
|
} from '@dcloudio/uni-app';
|
||||||
uni.showModal({
|
import {
|
||||||
title: '注意',
|
deleteUserByUserId
|
||||||
content: '确定要退出登录吗?',
|
} from '@/api/me/me.js'
|
||||||
success: (res) => {
|
import {
|
||||||
if (res.confirm) {
|
useCommonStore
|
||||||
uni.clearStorageSync();
|
} from '@/store/common.js'
|
||||||
uni.reLaunch({
|
const version = ref('');
|
||||||
url: '/pages/login/login'
|
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>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
.container {
|
.container {
|
||||||
font-size: 28upx;
|
font-size: 28upx;
|
||||||
color: #555;
|
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 {
|
.list {
|
||||||
width: 100%;
|
padding-bottom: 120upx;
|
||||||
height: 120upx;
|
|
||||||
display: flex;
|
.item {
|
||||||
justify-content: center;
|
padding: 32upx 28upx;
|
||||||
position: fixed;
|
border-bottom: 1upx solid #efefef;
|
||||||
bottom: 0;
|
display: flex;
|
||||||
left: 0;
|
align-items: center;
|
||||||
color: #999;
|
justify-content: space-between;
|
||||||
}
|
}
|
||||||
</style>
|
}
|
||||||
|
|
||||||
|
.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="请输入用户名" />
|
<input v-model="data.userInfo.userName" align="right" placeholder="请输入用户名" />
|
||||||
</template>
|
</template>
|
||||||
</up-cell>
|
</up-cell>
|
||||||
<up-cell title="手机">
|
<!-- <up-cell title="手机">
|
||||||
<template #value>
|
<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>
|
</template>
|
||||||
</up-cell>
|
</up-cell> -->
|
||||||
</up-cell-group>
|
</up-cell-group>
|
||||||
<view class="save" @click="save">保存</view>
|
<view class="save" @click="save">保存</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -62,7 +62,8 @@
|
|||||||
if (index === 0) {
|
if (index === 0) {
|
||||||
// 用户点击了预览当前图片
|
// 用户点击了预览当前图片
|
||||||
// 可以自己实现当前头像链接的读取
|
// 可以自己实现当前头像链接的读取
|
||||||
let url = data.userInfo.avatar;
|
console.log()
|
||||||
|
let url = data.userInfo.avatar||'../../static/default/avatar.png';
|
||||||
let arr = []
|
let arr = []
|
||||||
arr.push(url)
|
arr.push(url)
|
||||||
uni.previewImage({
|
uni.previewImage({
|
||||||
@@ -108,20 +109,20 @@
|
|||||||
})
|
})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if (!data.userInfo.phone) {
|
// if (!data.userInfo.phone) {
|
||||||
uni.showToast({
|
// uni.showToast({
|
||||||
title: "手机号不能空",
|
// title: "手机号不能空",
|
||||||
icon: "none"
|
// icon: "none"
|
||||||
})
|
// })
|
||||||
return
|
// return
|
||||||
}
|
// }
|
||||||
if (checkPhone(data.userInfo.phone) == false) {
|
// if (checkPhone(data.userInfo.phone) == false) {
|
||||||
uni.showToast({
|
// uni.showToast({
|
||||||
title: "手机号格式不正确",
|
// title: "手机号格式不正确",
|
||||||
icon: "none"
|
// icon: "none"
|
||||||
})
|
// })
|
||||||
return
|
// return
|
||||||
}
|
// }
|
||||||
|
|
||||||
uni.showModal({
|
uni.showModal({
|
||||||
title: '温馨提示',
|
title: '温馨提示',
|
||||||
@@ -132,7 +133,7 @@
|
|||||||
let res = await updateUsers({
|
let res = await updateUsers({
|
||||||
userName: data.userInfo.userName,
|
userName: data.userInfo.userName,
|
||||||
avatar: data.userInfo.avatar,
|
avatar: data.userInfo.avatar,
|
||||||
phone: data.userInfo.phone,
|
// phone: data.userInfo.phone,
|
||||||
})
|
})
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '保存成功',
|
title: '保存成功',
|
||||||
@@ -141,7 +142,7 @@
|
|||||||
let userInfo = uni.getStorageSync('userInfo');
|
let userInfo = uni.getStorageSync('userInfo');
|
||||||
userInfo.userName = data.userInfo.userName
|
userInfo.userName = data.userInfo.userName
|
||||||
userInfo.avatar = data.userInfo.avatar
|
userInfo.avatar = data.userInfo.avatar
|
||||||
userInfo.phone = data.userInfo.phone
|
// userInfo.phone = data.userInfo.phone
|
||||||
uni.setStorageSync('userInfo', userInfo);
|
uni.setStorageSync('userInfo', userInfo);
|
||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
uni.navigateBack()
|
uni.navigateBack()
|
||||||
|
|||||||
@@ -52,11 +52,42 @@
|
|||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
data.logining = true
|
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({
|
let res = await updateUser({
|
||||||
zhiFuBao: data.zhiFuBao,
|
zhiFuBao: data.zhiFuBao,
|
||||||
certName: data.zhiFuBaoName,
|
certName: data.zhiFuBaoName,
|
||||||
})
|
})
|
||||||
if( res) {
|
if(res) {
|
||||||
data.logining = false
|
data.logining = false
|
||||||
let userInfo = uni.getStorageSync('userInfo')
|
let userInfo = uni.getStorageSync('userInfo')
|
||||||
userInfo.zhiFuBao = data.zhiFuBao
|
userInfo.zhiFuBao = data.zhiFuBao
|
||||||
|
|||||||
@@ -1,17 +1,14 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="container">
|
<view class="container">
|
||||||
<up-navbar title="申请提现"
|
<up-navbar title="申请提现" :autoBack="true" bgColor="rgb(255, 117, 129)" leftIconColor="#FFF"
|
||||||
:autoBack="true"
|
:titleStyle="{color:'#FFF'}">
|
||||||
bgColor="rgb(255, 117, 129)"
|
<template #right>
|
||||||
leftIconColor="#FFF"
|
<view class="u-p-r-30 u-flex u-col-center" style="color: #fff;">
|
||||||
:titleStyle ="{color:'#FFF'}" >
|
<text class="rule-btn" @click="showRule">规则</text>
|
||||||
<template #right>
|
</view>
|
||||||
<view class="u-p-r-30 u-flex u-col-center" style="color: #fff;">
|
</template>
|
||||||
<text class="rule-btn" @click="showRule">规则</text>
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
</up-navbar>
|
</up-navbar>
|
||||||
|
|
||||||
<view class="content">
|
<view class="content">
|
||||||
<view class="title">可提现总额</view>
|
<view class="title">可提现总额</view>
|
||||||
<view class="mayMoney">¥ {{ data.mayMoney }}</view>
|
<view class="mayMoney">¥ {{ data.mayMoney }}</view>
|
||||||
@@ -22,17 +19,20 @@
|
|||||||
<view class="input" style="">
|
<view class="input" style="">
|
||||||
<view style="display: flex;align-items: center;">
|
<view style="display: flex;align-items: center;">
|
||||||
<view style="font-size: 40upx;color: #333333;">¥</view>
|
<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>
|
||||||
<view class="allbtn" @click="setAllMoney">
|
<view class="allbtn" @click="setAllMoney">
|
||||||
全部
|
全部
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
<view class="witBtn" @click="goWithdraw"> {{data.isWithdraw?'立即提现':'观看广告提现'}} </view>
|
<view class="witBtn" @click="goWithdraw"> {{data.isWithdraw?'立即提现':'观看广告提现'}} </view>
|
||||||
|
<view style="color: #666;" @click="WithdrawalAlipay">
|
||||||
|
提现到支付宝
|
||||||
|
</view>
|
||||||
<view class="tab" style="">
|
<view class="tab" style="">
|
||||||
<view @click="linkTo('/pages/me/withdraw/realName')">实名认证</view>
|
<view @click="linkTo('/pages/me/withdraw/realName')">实名认证</view>
|
||||||
<!-- <view @click="linkTo('/pages/me/withdraw/alipay')">提现账号</view> -->
|
<!-- <view @click="linkTo('/pages/me/withdraw/alipay')">提现账号</view> -->
|
||||||
@@ -72,22 +72,24 @@
|
|||||||
|
|
||||||
</view>
|
</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">
|
<view class="u-p-30 u-text-left">
|
||||||
<scroll-view scroll-y="true" style="max-height: 50vh;" >
|
<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>
|
<rich-text style="text-align: justify;font-size: 18px;color: #666;"
|
||||||
|
:nodes="data.rule_content"></rich-text>
|
||||||
</scroll-view>
|
</scroll-view>
|
||||||
</view>
|
</view>
|
||||||
</up-modal>
|
</up-modal>
|
||||||
|
|
||||||
<view style="width: 0;height: 0;overflow: hidden;">
|
<view style="width: 0;height: 0;overflow: hidden;">
|
||||||
<!-- 激励视频广告 -->
|
<!-- 激励视频广告 -->
|
||||||
<ad-rewarded-video ref="adRewardedw" :adpid="data.adpid" :loadnext="true"
|
<ad-rewarded-video ref="adRewardedw" :adpid="data.adpid" :loadnext="true" :url-callback="data.urlCallback"
|
||||||
:url-callback="data.urlCallback" @load="onadload" @close="onadclose" @error="onaderror">
|
@load="onadload" @close="onadclose" @error="onaderror">
|
||||||
</ad-rewarded-video>
|
</ad-rewarded-video>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -100,7 +102,7 @@
|
|||||||
import { commonType } from '@/api/init.js';
|
import { commonType } from '@/api/init.js';
|
||||||
import { linkTo } from '@/utils/app.js';
|
import { linkTo } from '@/utils/app.js';
|
||||||
|
|
||||||
let data = reactive({
|
const data = reactive({
|
||||||
ruleShow: false,
|
ruleShow: false,
|
||||||
rule_title: "",
|
rule_title: "",
|
||||||
rule_content: "",
|
rule_content: "",
|
||||||
@@ -121,22 +123,25 @@
|
|||||||
ruleIndex: 0,
|
ruleIndex: 0,
|
||||||
ruleList: []
|
ruleList: []
|
||||||
})
|
})
|
||||||
|
|
||||||
const adRewardedw = ref(null);
|
const adRewardedw = ref(null);
|
||||||
onLoad(() => {
|
onLoad(() => {
|
||||||
// if ( uni.getSystemInfoSync().platform == 'android' ) {
|
// if ( uni.getSystemInfoSync().platform == 'android' ) {
|
||||||
// data.adpid = 1531580352
|
// data.adpid = 1531580352
|
||||||
// }
|
// }
|
||||||
// if ( uni.getSystemInfoSync().platform == 'ios' ) {
|
// if ( uni.getSystemInfoSync().platform == 'ios' ) {
|
||||||
data.adpid = 1373604770
|
data.adpid = 1373604770
|
||||||
// }
|
// }
|
||||||
getExtractFei();
|
getExtractFei();
|
||||||
getMoneyDetail();
|
getMoneyDetail();
|
||||||
getCanCash()
|
getCanCash()
|
||||||
announcement({type: 1}).then(res=>{
|
announcement({
|
||||||
|
type: 1
|
||||||
|
}).then(res => {
|
||||||
data.ruleList = res
|
data.ruleList = res
|
||||||
ruleInit()
|
|
||||||
|
|
||||||
|
ruleInit()
|
||||||
|
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
onShow(() => {
|
onShow(() => {
|
||||||
@@ -144,13 +149,13 @@
|
|||||||
getUserInfo();
|
getUserInfo();
|
||||||
})
|
})
|
||||||
onReady(() => {
|
onReady(() => {
|
||||||
nextTick(()=>{
|
nextTick(() => {
|
||||||
data.adRewardedVideoloadNum = 0
|
data.adRewardedVideoloadNum = 0
|
||||||
adRewardedw.value.load();
|
adRewardedw.value.load();
|
||||||
data.ruleShow = true
|
data.ruleShow = true
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
onReachBottom(() => {
|
onReachBottom(() => {
|
||||||
if (data.page * data.limit < data.totalCount) {
|
if (data.page * data.limit < data.totalCount) {
|
||||||
data.page = data.page + 1;
|
data.page = data.page + 1;
|
||||||
@@ -163,6 +168,7 @@
|
|||||||
getMoneyDetail();
|
getMoneyDetail();
|
||||||
})
|
})
|
||||||
function ruleInit(){
|
function ruleInit(){
|
||||||
|
data.rule_content = ""
|
||||||
data.rule_title = data.ruleList[data.ruleIndex].title
|
data.rule_title = data.ruleList[data.ruleIndex].title
|
||||||
data.rule_content = data.ruleList[data.ruleIndex].content
|
data.rule_content = data.ruleList[data.ruleIndex].content
|
||||||
}
|
}
|
||||||
@@ -170,12 +176,12 @@
|
|||||||
* 规则弹窗打开
|
* 规则弹窗打开
|
||||||
*/
|
*/
|
||||||
function showRule() {
|
function showRule() {
|
||||||
if( data.ruleList.length <= 0) {
|
if (data.ruleList.length <= 0) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: "暂未配置规则",
|
title: "暂未配置规则",
|
||||||
icon: 'none'
|
icon: 'none'
|
||||||
})
|
})
|
||||||
return
|
return false;
|
||||||
}
|
}
|
||||||
ruleInit()
|
ruleInit()
|
||||||
data.ruleShow = true
|
data.ruleShow = true
|
||||||
@@ -184,23 +190,60 @@
|
|||||||
* 规则确认
|
* 规则确认
|
||||||
*/
|
*/
|
||||||
function ruleConfirm() {
|
function ruleConfirm() {
|
||||||
|
console.log(1)
|
||||||
data.ruleShow = false
|
data.ruleShow = false
|
||||||
data.ruleIndex++
|
data.ruleIndex++
|
||||||
if( data.ruleIndex >= data.ruleList.length) {
|
if (data.ruleIndex >= data.ruleList.length) {
|
||||||
data.ruleIndex = 0
|
data.ruleIndex = 0
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
setTimeout(res=>{
|
setTimeout(res => {
|
||||||
ruleInit()
|
ruleInit()
|
||||||
data.ruleShow = true
|
data.ruleShow = true
|
||||||
},300)
|
}, 300)
|
||||||
}
|
}
|
||||||
|
|
||||||
function getUserInfo() {
|
function getUserInfo() {
|
||||||
selectUserById().then(res=>{
|
selectUserById().then(res => {
|
||||||
data.userInfo = 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() {
|
function back() {
|
||||||
uni.navigateBack()
|
uni.navigateBack()
|
||||||
}
|
}
|
||||||
@@ -211,14 +254,14 @@
|
|||||||
canCash().then(res => {
|
canCash().then(res => {
|
||||||
data.isWithdraw = res;
|
data.isWithdraw = res;
|
||||||
console.log(res)
|
console.log(res)
|
||||||
if( uni.getStorageSync('adRewardedNum') >= 3 ){
|
if (uni.getStorageSync('adRewardedNum') >= 3) {
|
||||||
data.isWithdraw = true;
|
data.isWithdraw = true;
|
||||||
// uni.setStorageSync('adRewardedNum',0)
|
// uni.setStorageSync('adRewardedNum',0)
|
||||||
} else {
|
} else {
|
||||||
uni.setStorageSync('adRewardedNum',((uni.getStorageSync('adRewardedNum')||0)+1))
|
uni.setStorageSync('adRewardedNum', ((uni.getStorageSync('adRewardedNum') || 0) + 1))
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* 广告数据加载成功回调
|
* 广告数据加载成功回调
|
||||||
@@ -226,25 +269,25 @@
|
|||||||
*/
|
*/
|
||||||
function onadload(e) {
|
function onadload(e) {
|
||||||
data.adRewardedShow = true;
|
data.adRewardedShow = true;
|
||||||
uni.setStorageSync('adRewardedNum',0)
|
uni.setStorageSync('adRewardedNum', 0)
|
||||||
console.log('广告数据加载成功');
|
console.log('广告数据加载成功');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 广告加载失败回调
|
* 广告加载失败回调
|
||||||
* @param {Object} e
|
* @param {Object} e
|
||||||
*/
|
*/
|
||||||
function onaderror(e) {
|
function onaderror(e) {
|
||||||
if ( data.adRewardedVideoloadNum >=3 ) {
|
if (data.adRewardedVideoloadNum >= 3) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
data.adRewardedVideoloadNum++
|
data.adRewardedVideoloadNum++
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
adRewardedw.value.load();
|
adRewardedw.value.load();
|
||||||
}, 1000); // 10
|
}, 1000); // 10
|
||||||
console.log("广告加载失败",e)
|
console.log("广告加载失败", e)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 广告播放成功回调
|
* 广告播放成功回调
|
||||||
* @param {Object} e
|
* @param {Object} e
|
||||||
@@ -258,24 +301,24 @@
|
|||||||
extraKey: data.urlCallback.extra
|
extraKey: data.urlCallback.extra
|
||||||
})
|
})
|
||||||
console.log(res)
|
console.log(res)
|
||||||
uni.setStorageSync('adRewardedNum',0)
|
uni.setStorageSync('adRewardedNum', 0)
|
||||||
getCanCash()
|
getCanCash()
|
||||||
} else {
|
} else {
|
||||||
// 播放中途退出
|
// 播放中途退出
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function onNavigationBarButtonTap() {
|
function onNavigationBarButtonTap() {
|
||||||
console.log(1)
|
console.log(1)
|
||||||
data.ruleShow = true
|
data.ruleShow = true
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 提现触发
|
* 提现触发
|
||||||
*/
|
*/
|
||||||
function goWithdraw() {
|
function goWithdraw() {
|
||||||
if ( !data.isWithdraw ) {
|
if (!data.isWithdraw) {
|
||||||
if(!data.adRewardedShow){
|
if (!data.adRewardedShow) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
icon: 'none',
|
icon: 'none',
|
||||||
title: '广告加载失败,请稍后重试'
|
title: '广告加载失败,请稍后重试'
|
||||||
@@ -284,26 +327,56 @@
|
|||||||
}
|
}
|
||||||
data.urlCallback = {
|
data.urlCallback = {
|
||||||
userId: uni.getStorageSync('userInfo').userId,
|
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();
|
adRewardedw.value.show();
|
||||||
} else {
|
} else {
|
||||||
getOut()
|
getOut()
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function moneyInput(e) {
|
function moneyInput(e) {
|
||||||
data.money = e.detail.value.match(/^\d*(\.?\d{0,2})/g)[0] || null;
|
data.money = e.detail.value.match(/^\d*(\.?\d{0,2})/g)[0] || null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 全部提现赋值
|
* 全部提现赋值
|
||||||
*/
|
*/
|
||||||
function setAllMoney() {
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取提现记录
|
* 获取提现记录
|
||||||
*/
|
*/
|
||||||
@@ -321,7 +394,7 @@
|
|||||||
}, 500);
|
}, 500);
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取最低提现金额
|
* 获取最低提现金额
|
||||||
*/
|
*/
|
||||||
@@ -332,16 +405,16 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 可提现金额
|
* 可提现金额
|
||||||
*/
|
*/
|
||||||
function getcashMoney() {
|
function getcashMoney() {
|
||||||
selectUserMoney().then(res => {
|
selectUserMoney().then(res => {
|
||||||
data.mayMoney = res.amount || 0
|
data.mayMoney = getMoneys(res.amount) || 0
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 跳转
|
* 跳转
|
||||||
* @param {Object} url
|
* @param {Object} url
|
||||||
@@ -351,7 +424,7 @@
|
|||||||
url: url
|
url: url
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function getMoney() {
|
function getMoney() {
|
||||||
uni.showLoading({
|
uni.showLoading({
|
||||||
title: '提现中'
|
title: '提现中'
|
||||||
@@ -361,7 +434,7 @@
|
|||||||
}).then(res => {
|
}).then(res => {
|
||||||
console.log(res)
|
console.log(res)
|
||||||
data.money = ''
|
data.money = ''
|
||||||
uni.setStorageSync('adRewardedNum',0)
|
uni.setStorageSync('adRewardedNum', 0)
|
||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
getcashMoney()
|
getcashMoney()
|
||||||
}, 1500)
|
}, 1500)
|
||||||
@@ -369,7 +442,7 @@
|
|||||||
title: res.msg,
|
title: res.msg,
|
||||||
icon: 'none'
|
icon: 'none'
|
||||||
})
|
})
|
||||||
}).catch(res =>{
|
}).catch(res => {
|
||||||
if (res.code == 9991) {
|
if (res.code == 9991) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: res.msg,
|
title: res.msg,
|
||||||
@@ -378,14 +451,14 @@
|
|||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
linkTo('/pages/me/withdraw/alipay')
|
linkTo('/pages/me/withdraw/alipay')
|
||||||
}, 1500)
|
}, 1500)
|
||||||
}else{
|
} else {
|
||||||
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
function getOut() {
|
function getOut() {
|
||||||
|
|
||||||
if (!/^\d+(\.\d{1,2})?$/.test(data.money)) {
|
if (!/^\d+(\.\d{1,2})?$/.test(data.money)) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
icon: 'none',
|
icon: 'none',
|
||||||
@@ -394,13 +467,16 @@
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!data.userInfo.accountNo) {
|
if (!data.userInfo.accountNo) {
|
||||||
uni.showToast({ icon: 'none', title: "请先实名认证" });
|
uni.showToast({
|
||||||
setTimeout(()=>{
|
icon: 'none',
|
||||||
|
title: "请先实名认证"
|
||||||
|
});
|
||||||
|
setTimeout(() => {
|
||||||
linkTo('/pages/me/withdraw/realName')
|
linkTo('/pages/me/withdraw/realName')
|
||||||
},1500)
|
}, 1500)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (parseFloat(data.mayMoney).toFixed(2) >= parseFloat(data.money)) {
|
if (parseFloat(data.mayMoney).toFixed(2) >= parseFloat(data.money)) {
|
||||||
if (parseFloat(data.money).toFixed(2) >= parseFloat(data.cashMoney)) {
|
if (parseFloat(data.money).toFixed(2) >= parseFloat(data.cashMoney)) {
|
||||||
uni.showModal({
|
uni.showModal({
|
||||||
@@ -408,12 +484,13 @@
|
|||||||
content: '每日只可提现一次',
|
content: '每日只可提现一次',
|
||||||
success: (e) => {
|
success: (e) => {
|
||||||
if (e.confirm) {
|
if (e.confirm) {
|
||||||
setTimeout(()=>{
|
setTimeout(() => {
|
||||||
uni.showModal({
|
uni.showModal({
|
||||||
title: "提现申请提示",
|
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 + '',
|
.money + '元\n\n收款人账号:' + data.userInfo.accountNo + '',
|
||||||
|
|
||||||
success: (e) => {
|
success: (e) => {
|
||||||
if (e.confirm) {
|
if (e.confirm) {
|
||||||
console.log(data.money)
|
console.log(data.money)
|
||||||
@@ -422,12 +499,12 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},200)
|
}, 200)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
icon: 'none',
|
icon: 'none',
|
||||||
@@ -441,7 +518,6 @@
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
@@ -450,9 +526,10 @@
|
|||||||
background: white;
|
background: white;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
.nav{
|
|
||||||
|
.nav {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
|
||||||
position: fixed;
|
position: fixed;
|
||||||
background-color: #ff7581;
|
background-color: #ff7581;
|
||||||
left: 0;
|
left: 0;
|
||||||
@@ -461,46 +538,54 @@
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
padding: 100rpx 30rpx 15rpx 30rpx;
|
padding: 100rpx 30rpx 15rpx 30rpx;
|
||||||
.navTitle{
|
|
||||||
|
.navTitle {
|
||||||
color: #fff;
|
color: #fff;
|
||||||
font-size: 32rpx;
|
font-size: 32rpx;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
.ruleBtn{
|
|
||||||
|
.ruleBtn {
|
||||||
font-size: 30rpx;
|
font-size: 30rpx;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.content{
|
|
||||||
|
.content {
|
||||||
background-color: #ff7581;
|
background-color: #ff7581;
|
||||||
height: 500rpx;
|
height: 500rpx;
|
||||||
border-bottom-right-radius: 40rpx;
|
border-bottom-right-radius: 40rpx;
|
||||||
border-bottom-left-radius: 40rpx;
|
border-bottom-left-radius: 40rpx;
|
||||||
.title{
|
|
||||||
|
.title {
|
||||||
font-size: 32rpx;
|
font-size: 32rpx;
|
||||||
color: #FFFFFF;
|
color: #FFFFFF;
|
||||||
padding-top: 230rpx;
|
padding-top: 230rpx;
|
||||||
}
|
}
|
||||||
.mayMoney{
|
|
||||||
|
.mayMoney {
|
||||||
font-size: 40rpx;
|
font-size: 40rpx;
|
||||||
color: #FFFFFF;
|
color: #FFFFFF;
|
||||||
padding-top: 20rpx;
|
padding-top: 20rpx;
|
||||||
}
|
}
|
||||||
.val{
|
|
||||||
|
.val {
|
||||||
width: 90%;
|
width: 90%;
|
||||||
height: max-content
|
height: max-content;
|
||||||
;margin-left: 40rpx;
|
margin-left: 40rpx;
|
||||||
background-color: #FFFFFF;
|
background-color: #FFFFFF;
|
||||||
box-shadow: rgba(183, 183, 183, 0.3) 0px 1px 10px;
|
box-shadow: rgba(183, 183, 183, 0.3) 0px 1px 10px;
|
||||||
margin-top: 50rpx;
|
margin-top: 50rpx;
|
||||||
border-radius: 20rpx;
|
border-radius: 20rpx;
|
||||||
.input{
|
|
||||||
|
.input {
|
||||||
display: flex;
|
display: flex;
|
||||||
padding: 20rpx;
|
padding: 20rpx;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
}
|
}
|
||||||
.allbtn{
|
|
||||||
|
.allbtn {
|
||||||
font-size: 28rpx;
|
font-size: 28rpx;
|
||||||
color: #333333;
|
color: #333333;
|
||||||
background: #ff7581;
|
background: #ff7581;
|
||||||
@@ -510,7 +595,8 @@
|
|||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.witBtn{
|
|
||||||
|
.witBtn {
|
||||||
margin: 32rpx;
|
margin: 32rpx;
|
||||||
font-size: 36rpx;
|
font-size: 36rpx;
|
||||||
background: #ff7581;
|
background: #ff7581;
|
||||||
@@ -519,36 +605,39 @@
|
|||||||
height: 80rpx;
|
height: 80rpx;
|
||||||
line-height: 80rpx;
|
line-height: 80rpx;
|
||||||
}
|
}
|
||||||
.tab{
|
|
||||||
|
.tab {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
display: flex;
|
display: flex;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
justify-content: space-around;
|
justify-content: space-around;
|
||||||
>view{
|
|
||||||
|
>view {
|
||||||
font-size: 28rpx;
|
font-size: 28rpx;
|
||||||
color: #666;
|
color: #666;
|
||||||
padding-bottom: 60rpx;
|
padding-bottom: 60rpx;
|
||||||
padding-top: 20rpx;
|
padding-top: 20rpx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.moneyList{
|
|
||||||
|
.moneyList {
|
||||||
text-align: left
|
text-align: left
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.cash-top {
|
.cash-top {
|
||||||
padding: 32upx 32upx 50upx 32upx;
|
padding: 32upx 32upx 50upx 32upx;
|
||||||
/* border-bottom: 1px solid gainsboro; */
|
/* border-bottom: 1px solid gainsboro; */
|
||||||
background: #5074FF;
|
background: #5074FF;
|
||||||
}
|
}
|
||||||
|
|
||||||
.leiji {
|
.leiji {
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
color: #ffffff;
|
color: #ffffff;
|
||||||
margin-bottom: 10px;
|
margin-bottom: 10px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.rule-btn {
|
.rule-btn {
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
// padding: 2rpx 10rpx;
|
// padding: 2rpx 10rpx;
|
||||||
|
|||||||
@@ -55,7 +55,7 @@
|
|||||||
moneyType : data.moneyType,
|
moneyType : data.moneyType,
|
||||||
viewType: data.viewType,
|
viewType: data.viewType,
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
data.totalCount = res.total;
|
data.totalCount = res.totalCount;
|
||||||
if ( res.records.length > 0) {
|
if ( res.records.length > 0) {
|
||||||
data.list = [...data.list,...res.records];
|
data.list = [...data.list,...res.records];
|
||||||
}
|
}
|
||||||
@@ -65,6 +65,7 @@
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
onReachBottom(() => {
|
onReachBottom(() => {
|
||||||
|
console.log(1)
|
||||||
if (data.page*data.limit < data.totalCount) {
|
if (data.page*data.limit < data.totalCount) {
|
||||||
data.page = data.page + 1;
|
data.page = data.page + 1;
|
||||||
getMoney();
|
getMoney();
|
||||||
|
|||||||
@@ -1,71 +1,141 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="containerView">
|
<view class="containerView">
|
||||||
<up-cell-group label-width="80" :border="false">
|
<up-cell-group label-width="80" :border="false">
|
||||||
<up-cell :label-style="{ width: '100rpx' }" title="姓名">
|
<up-cell>
|
||||||
<template #right-icon> <up-input border="none" v-model="data.certName" placeholder="请输入姓名"></up-input> </template>
|
<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>
|
||||||
<up-cell title="身份证号码">
|
<up-cell>
|
||||||
<template #right-icon> <up-input border="none" v-model="data.certNum" placeholder="请输入身份证号码"></up-input> </template>
|
<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>
|
||||||
<up-cell title="银行卡号码">
|
<up-cell>
|
||||||
<template #right-icon> <up-input border="none" v-model="data.accountNo" placeholder="请输入银行卡号码"></up-input> </template>
|
<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>
|
||||||
<up-cell title="手机号">
|
<up-cell>
|
||||||
<template #right-icon> <up-input border="none" v-model="data.mobile" placeholder="请输入银行预留号码"></up-input> </template>
|
<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>
|
||||||
</up-cell-group>
|
</up-cell-group>
|
||||||
<button v-if="!data.isAccountNo" class="confirm-btn" @click="toLogin" :disabled="data.logining">认证</button>
|
<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-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;;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 style="font-size: 24upx;color: #999999;padding: 0 15rpx">否则将无法正常收款,请须知</view>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { reactive, nextTick, ref } from 'vue';
|
import {
|
||||||
import { onReady,onLoad,onShow } from '@dcloudio/uni-app'
|
reactive,
|
||||||
import { realNameAuth } from '@/api/me/withdraw.js';
|
nextTick,
|
||||||
import { selectUserById } from '@/api/user/user.js';
|
ref
|
||||||
import { commonType } from '@/api/init.js';
|
} 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({
|
let data = reactive({
|
||||||
certName: null,
|
certName: null,
|
||||||
mobile: null,
|
mobile: null,
|
||||||
certNum: null,
|
certNum: null,
|
||||||
accountNo: null,
|
accountNo: null,
|
||||||
isAccountNo: null,
|
isAccountNo: true,
|
||||||
logining: false
|
logining: false,
|
||||||
|
province: null,
|
||||||
|
city: null,
|
||||||
|
bankBranch: null
|
||||||
})
|
})
|
||||||
|
let inputdata = ref()
|
||||||
onLoad(() => {
|
onLoad(() => {
|
||||||
getUserInfo()
|
getUserInfo()
|
||||||
})
|
})
|
||||||
|
|
||||||
function getUserInfo () {
|
function setinput() {
|
||||||
selectUserById().then(res=>{
|
if (data.accountNo) {
|
||||||
if(res){
|
return data.accountNo.indexOf('****') != -1
|
||||||
|
} else {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function getUserInfo() {
|
||||||
|
selectUserById().then(res => {
|
||||||
|
if (res) {
|
||||||
data.certName = res.certName;
|
data.certName = res.certName;
|
||||||
data.mobile = res.mobile;
|
data.mobile = res.mobile;
|
||||||
if ( res.accountNo ) {
|
if (res.accountNo) {
|
||||||
|
inputdata.value = res
|
||||||
data.accountNo = res.accountNo;
|
data.accountNo = res.accountNo;
|
||||||
data.certNum = res.certNo;
|
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
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
function inputChange(e) {
|
function inputChange(e) {
|
||||||
const key = e.currentTarget.dataset.key;
|
const key = e.currentTarget.dataset.key;
|
||||||
data[key] = e.detail.value;
|
data[key] = e.detail.value;
|
||||||
}
|
}
|
||||||
|
|
||||||
async function toLogin() {
|
async function toLogin() {
|
||||||
|
|
||||||
if (!data.certName) {
|
if (!data.certName) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '请设置收款人姓名',
|
title: '请设置收款人姓名',
|
||||||
@@ -93,8 +163,11 @@
|
|||||||
mobile: data.mobile,
|
mobile: data.mobile,
|
||||||
certNum: data.certNum,
|
certNum: data.certNum,
|
||||||
accountNo: data.accountNo.replace(/\s+/g, ''),
|
accountNo: data.accountNo.replace(/\s+/g, ''),
|
||||||
|
province: data.province,
|
||||||
|
city: data.city,
|
||||||
|
bankBranch: data.bankBranch
|
||||||
})
|
})
|
||||||
if( res) {
|
if (res) {
|
||||||
data.logining = false
|
data.logining = false
|
||||||
let userInfo = uni.getStorageSync('userInfo')
|
let userInfo = uni.getStorageSync('userInfo')
|
||||||
userInfo.mobile = data.mobile
|
userInfo.mobile = data.mobile
|
||||||
@@ -114,10 +187,10 @@
|
|||||||
} else {
|
} else {
|
||||||
data.logining = false
|
data.logining = false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@@ -126,8 +199,12 @@
|
|||||||
background: #FFFFFF;
|
background: #FFFFFF;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.u-cell__body__content {
|
||||||
|
flex: 0 !important;
|
||||||
|
}
|
||||||
|
|
||||||
.containerView {
|
.containerView {
|
||||||
padding:30rpx;
|
padding: 30rpx;
|
||||||
position: relative;
|
position: relative;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
@@ -163,6 +240,7 @@
|
|||||||
color: #ffffff;
|
color: #ffffff;
|
||||||
font-size: 32rpx;
|
font-size: 32rpx;
|
||||||
border: none;
|
border: none;
|
||||||
|
|
||||||
&:after {
|
&:after {
|
||||||
border: none;
|
border: none;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<view style="background-color: #F3F4F8;">
|
<view class="container">
|
||||||
|
|
||||||
<view class="task_bg u-absolute">
|
<view class="task_bg u-absolute">
|
||||||
<image class="task_bg" src="@/static/task/task_bg.png"></image>
|
<image class="task_bg" src="@/static/task/task_bg.png"></image>
|
||||||
</view>
|
</view>
|
||||||
@@ -50,7 +49,8 @@
|
|||||||
<view v-else class="btn u-font-24 text-bold disabled">
|
<view v-else class="btn u-font-24 text-bold disabled">
|
||||||
{{ item.type == 1 ? item.buttonTitle : item.number ? `${item.discNumber}/${item.number}` : ( item.discNumber <= 0 ? item.buttonTitle : `剩余${item.discNumber}次`) }}
|
{{ item.type == 1 ? item.buttonTitle : item.number ? `${item.discNumber}/${item.number}` : ( item.discNumber <= 0 ? item.buttonTitle : `剩余${item.discNumber}次`) }}
|
||||||
</view>
|
</view>
|
||||||
<view v-if=" item.buttonUnderContent && item.buttonUnderUrl " class="u-font-22 tip" style="text-align: center;"
|
<view v-if=" item.buttonUnderContent && item.buttonUnderUrl " class="u-font-22 tip"
|
||||||
|
style="text-align: center;"
|
||||||
@click="goNav({id: item.id,buttonUrl: item.buttonUnderUrl, jumpType: 1,title: item.title, disabled: item.disabled, discNumber: item.discNumber})">
|
@click="goNav({id: item.id,buttonUrl: item.buttonUnderUrl, jumpType: 1,title: item.title, disabled: item.disabled, discNumber: item.discNumber})">
|
||||||
{{ item.buttonUnderContent}}
|
{{ item.buttonUnderContent}}
|
||||||
</view>
|
</view>
|
||||||
@@ -226,7 +226,12 @@
|
|||||||
})
|
})
|
||||||
onReady(() => {
|
onReady(() => {
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
|
datas.urlCallback = {
|
||||||
|
userId: uni.getStorageSync('userInfo').userId,
|
||||||
|
extra: uni.getStorageSync('userInfo').userId + "" + new Date().getTime(),
|
||||||
|
}
|
||||||
datas.adRewardedVideoloadNum = 0
|
datas.adRewardedVideoloadNum = 0
|
||||||
|
|
||||||
adRewarded.value.load();
|
adRewarded.value.load();
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
@@ -250,6 +255,10 @@
|
|||||||
}
|
}
|
||||||
datas.adRewardedVideoloadNum++
|
datas.adRewardedVideoloadNum++
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
|
datas.urlCallback = {
|
||||||
|
userId: uni.getStorageSync('userInfo').userId,
|
||||||
|
extra: uni.getStorageSync('userInfo').userId + "" + new Date().getTime(),
|
||||||
|
}
|
||||||
adRewarded.value.load();
|
adRewarded.value.load();
|
||||||
}, 1000); // 10
|
}, 1000); // 10
|
||||||
console.log("广告加载失败")
|
console.log("广告加载失败")
|
||||||
@@ -274,6 +283,10 @@
|
|||||||
let res = await state({
|
let res = await state({
|
||||||
extraKey: datas.urlCallback.extra
|
extraKey: datas.urlCallback.extra
|
||||||
})
|
})
|
||||||
|
datas.urlCallback = {
|
||||||
|
userId: uni.getStorageSync('userInfo').userId,
|
||||||
|
extra: uni.getStorageSync('userInfo').userId + "" + new Date().getTime(),
|
||||||
|
}
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '获得' + $common.freeDuration + '分钟免费时长',
|
title: '获得' + $common.freeDuration + '分钟免费时长',
|
||||||
icon: 'none'
|
icon: 'none'
|
||||||
@@ -282,128 +295,122 @@
|
|||||||
// 播放中途退出
|
// 播放中途退出
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
async function goNav(item, url) {
|
async function goNav(item) {
|
||||||
|
console.log(item, '请求参数')
|
||||||
// jumpType (integer, optional): 跳转类型 1 内部路径 2 外部路径 ,
|
// jumpType (integer, optional): 跳转类型 1 内部路径 2 外部路径 ,
|
||||||
// type (integer, optional): 任务类型 1 普通任务 2 打卡任务 9 其它 ,
|
// type (integer, optional): 任务类型 1 普通任务 2 打卡任务 9 其它 ,
|
||||||
if (url) {
|
// if (url) {
|
||||||
let urls = ''
|
// let urls = ''
|
||||||
if (url == '/pages/task/prizeList') {
|
// if (url == '/pages/task/prizeList') {
|
||||||
urls = url + '?source=2'
|
// urls = url + '?source=2'
|
||||||
}
|
// }
|
||||||
if (url == '/pages/task/receiveMember') {
|
// if (url == '/pages/task/receiveMember') {
|
||||||
urls = url + `?standard=${item.discNumber == null ? true : false}&taskId=${item.id}`
|
// urls = url + `?standard=${item.discNumber == null ? true : false}&taskId=${item.id}`
|
||||||
}
|
// }
|
||||||
uni.navigateTo({
|
// uni.navigateTo({
|
||||||
url: urls
|
// url: urls
|
||||||
})
|
// })
|
||||||
} else {
|
// } else {
|
||||||
console.log(item, '林区')
|
|
||||||
if (item.jumpType == 0) {
|
// }
|
||||||
if (item.buttonTitle.indexOf("领取") != -1) {
|
if (item.jumpType == 0) {
|
||||||
let res = await taskReceive({
|
if (item.buttonTitle.indexOf("领取") != -1) {
|
||||||
id: item.id
|
let res = await taskReceive({
|
||||||
|
id: item.id
|
||||||
|
})
|
||||||
|
if (res.code == 0) {
|
||||||
|
uni.showToast({
|
||||||
|
title: res.id == 15 ? '签到成功' : '领取成功',
|
||||||
|
icon: 'none'
|
||||||
})
|
})
|
||||||
if (res.code == 0) {
|
setTimeout(() => {
|
||||||
uni.showToast({
|
getTaskdata()
|
||||||
title: res.id == 15 ? '签到成功' : '领取成功',
|
getsignIn()
|
||||||
icon: 'none'
|
}, 1000)
|
||||||
})
|
} else {
|
||||||
setTimeout(() => {
|
uni.showToast({
|
||||||
getTaskdata()
|
title: res.msg,
|
||||||
getsignIn()
|
icon: 'none'
|
||||||
}, 1000)
|
|
||||||
} else {
|
|
||||||
uni.showToast({
|
|
||||||
title: res.msg,
|
|
||||||
icon: 'none'
|
|
||||||
})
|
|
||||||
}
|
|
||||||
} else if (item.title.indexOf("新人福利") != -1) {
|
|
||||||
let res = await taskReceive({
|
|
||||||
id: item.id
|
|
||||||
})
|
})
|
||||||
if (res.code == 0) {
|
}
|
||||||
uni.showToast({
|
} else if (item.title.indexOf("新人福利") != -1) {
|
||||||
title: res.id == 15 ? '签到成功' : '领取成功',
|
let res = await taskReceive({
|
||||||
icon: 'none'
|
id: item.id
|
||||||
})
|
})
|
||||||
setTimeout(() => {
|
if (res.code == 0) {
|
||||||
getTaskdata()
|
uni.showToast({
|
||||||
getsignIn()
|
title: res.id == 15 ? '签到成功' : '领取成功',
|
||||||
}, 1000)
|
icon: 'none'
|
||||||
} else {
|
})
|
||||||
uni.switchTab({
|
setTimeout(() => {
|
||||||
url: '/pages/index/index'
|
getTaskdata()
|
||||||
})
|
getsignIn()
|
||||||
}
|
}, 1000)
|
||||||
} else if (item.buttonTitle.indexOf("观看视频") != -1) {
|
|
||||||
// 首次加载广告
|
|
||||||
if (!datas.adRewardedShow) {
|
|
||||||
uni.showToast({
|
|
||||||
icon: 'none',
|
|
||||||
title: '广告加载失败,请稍后重试'
|
|
||||||
});
|
|
||||||
return
|
|
||||||
}
|
|
||||||
datas.urlCallback = {
|
|
||||||
userId: uni.getStorageSync('userId'),
|
|
||||||
extra: uni.getStorageSync('userId') + "" + new Date().getTime(),
|
|
||||||
}
|
|
||||||
adRewarded.value.show();
|
|
||||||
} else {
|
} else {
|
||||||
uni.switchTab({
|
uni.switchTab({
|
||||||
url: "/pages/index/index"
|
url: '/pages/index/index'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
} else if (item.jumpType == 1) {
|
} else if (item.buttonTitle.indexOf("观看视频") != -1) {
|
||||||
let buttonUrl = item.buttonUrl
|
// 首次加载广告
|
||||||
if (item.title && item.title.indexOf('每周打卡奖励') != -1) {
|
if (!datas.adRewardedShow) {
|
||||||
buttonUrl = item.buttonUrl + '?source=2'
|
uni.showToast({
|
||||||
|
icon: 'none',
|
||||||
uni.navigateTo({
|
title: '广告加载失败,请稍后重试'
|
||||||
url: buttonUrl
|
});
|
||||||
})
|
return
|
||||||
}
|
|
||||||
if (item.title && item.title.indexOf('每月打卡奖励1') != -1) {
|
|
||||||
buttonUrl = item.buttonUrl + '?source=3'
|
|
||||||
|
|
||||||
uni.navigateTo({
|
|
||||||
url: buttonUrl
|
|
||||||
})
|
|
||||||
}
|
|
||||||
if (item.title && item.title.indexOf('每月打卡奖励2') != -1) {
|
|
||||||
|
|
||||||
let res = await taskReceive({
|
|
||||||
id: item.id
|
|
||||||
})
|
|
||||||
if (res.code == 0) {
|
|
||||||
uni.showToast({
|
|
||||||
title: res.id == 15 ? '签到成功' : '领取成功',
|
|
||||||
icon: 'none'
|
|
||||||
})
|
|
||||||
setTimeout(() => {
|
|
||||||
getTaskdata()
|
|
||||||
getsignIn()
|
|
||||||
}, 1000)
|
|
||||||
} else {
|
|
||||||
uni.showToast({
|
|
||||||
title: res.msg,
|
|
||||||
icon: 'none'
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// buttonUrl =
|
|
||||||
// `${item.buttonUrl}?standard=${item.discNumber == null ? true : false}&taskId=${item.id}`
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
console.log(datas.urlCallback)
|
||||||
} else if (item.jumpType == 3) {
|
adRewarded.value.show();
|
||||||
|
} else {
|
||||||
uni.switchTab({
|
uni.switchTab({
|
||||||
url: item.buttonUrl
|
url: "/pages/index/index"
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
} else if (item.jumpType == 1) {
|
||||||
|
let buttonUrl = item.buttonUrl
|
||||||
|
if (item.title && item.title.indexOf('每周打卡奖励') != -1) {
|
||||||
|
buttonUrl = item.buttonUrl + '?source=2'
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
if (item.title && item.title.indexOf('每月打卡奖励1') != -1) {
|
||||||
|
buttonUrl = item.buttonUrl + '?source=3'
|
||||||
|
}
|
||||||
|
if (item.title && item.title.indexOf('每月打卡奖励2') != -1) {
|
||||||
|
|
||||||
|
// let res = await taskReceive({
|
||||||
|
// id: item.id
|
||||||
|
// })
|
||||||
|
// if (res.code == 0) {
|
||||||
|
// uni.showToast({
|
||||||
|
// title: res.id == 15 ? '签到成功' : '领取成功',
|
||||||
|
// icon: 'none'
|
||||||
|
// })
|
||||||
|
// setTimeout(() => {
|
||||||
|
// getTaskdata()
|
||||||
|
// getsignIn()
|
||||||
|
// }, 1000)
|
||||||
|
// } else {
|
||||||
|
// uni.showToast({
|
||||||
|
// title: res.msg,
|
||||||
|
// icon: 'none'
|
||||||
|
// })
|
||||||
|
// }
|
||||||
|
|
||||||
|
buttonUrl =
|
||||||
|
`${item.buttonUrl}?standard=${item.discNumber == null ? true : false}&taskId=${item.id}`
|
||||||
|
}
|
||||||
|
uni.navigateTo({
|
||||||
|
url: buttonUrl
|
||||||
|
})
|
||||||
|
|
||||||
|
} else if (item.jumpType == 3) {
|
||||||
|
uni.switchTab({
|
||||||
|
url: item.buttonUrl
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获得签到
|
// 获得签到
|
||||||
@@ -436,6 +443,21 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
|
page {
|
||||||
|
// min-height: 100vh;
|
||||||
|
}
|
||||||
|
|
||||||
|
.container {
|
||||||
|
/* #ifdef H5 */
|
||||||
|
min-height: calc(100vh - 96rpx);
|
||||||
|
/* #endif */
|
||||||
|
/* #ifndef H5 */
|
||||||
|
min-height: 100vh;
|
||||||
|
/* #endif */
|
||||||
|
background-color: #F3F4F8;
|
||||||
|
padding-top: 2rpx;
|
||||||
|
}
|
||||||
|
|
||||||
.u-absolute {
|
.u-absolute {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
}
|
}
|
||||||
@@ -446,8 +468,8 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.icon {
|
.icon {
|
||||||
position: relative;
|
position: absolute;
|
||||||
padding: 32rpx;
|
padding: 122rpx 32rpx 32rpx 32rpx;
|
||||||
|
|
||||||
.icon_title {
|
.icon_title {
|
||||||
color: #000000;
|
color: #000000;
|
||||||
@@ -475,13 +497,13 @@
|
|||||||
|
|
||||||
.contentTop {
|
.contentTop {
|
||||||
border-radius: 16rpx;
|
border-radius: 16rpx;
|
||||||
top: -115rpx;
|
// top: -115rpx;
|
||||||
padding: 20rpx;
|
padding: 20rpx;
|
||||||
margin-bottom: 32rpx;
|
margin-bottom: 32rpx;
|
||||||
position: relative;
|
position: relative;
|
||||||
background-color: #ffffff;
|
background-color: #ffffff;
|
||||||
color: #666666;
|
color: #666666;
|
||||||
margin: 32rpx;
|
margin: 282rpx 32rpx 32rpx 32rpx;
|
||||||
|
|
||||||
>view:first-child {
|
>view:first-child {
|
||||||
>image {
|
>image {
|
||||||
@@ -538,7 +560,7 @@
|
|||||||
|
|
||||||
.content {
|
.content {
|
||||||
border-radius: 16rpx;
|
border-radius: 16rpx;
|
||||||
top: -115rpx;
|
// top: -115rpx;
|
||||||
padding: 28rpx;
|
padding: 28rpx;
|
||||||
background-color: #ffffff;
|
background-color: #ffffff;
|
||||||
color: #666666;
|
color: #666666;
|
||||||
@@ -546,8 +568,8 @@
|
|||||||
margin-right: 32rpx;
|
margin-right: 32rpx;
|
||||||
position: relative;
|
position: relative;
|
||||||
border-radius: 16rpx;
|
border-radius: 16rpx;
|
||||||
top: -115rpx;
|
|
||||||
padding: 28rpx;
|
padding: 28rpx;
|
||||||
|
margin-bottom: 32rpx;
|
||||||
|
|
||||||
.cell {
|
.cell {
|
||||||
padding: 32rpx 0;
|
padding: 32rpx 0;
|
||||||
|
|||||||
@@ -57,10 +57,11 @@
|
|||||||
getCurrentInstance
|
getCurrentInstance
|
||||||
} from 'vue'
|
} from 'vue'
|
||||||
import {
|
import {
|
||||||
onLoad
|
onLoad,onShow
|
||||||
} from '@dcloudio/uni-app'
|
} from '@dcloudio/uni-app'
|
||||||
import {
|
import {
|
||||||
selectTaskCenterUserReward
|
selectTaskCenterUserReward,
|
||||||
|
receiveGoods
|
||||||
} from '@/api/task/index.js'
|
} from '@/api/task/index.js'
|
||||||
let datas = reactive({
|
let datas = reactive({
|
||||||
list: [],
|
list: [],
|
||||||
@@ -82,6 +83,8 @@
|
|||||||
if (options.taskId) {
|
if (options.taskId) {
|
||||||
datas.taskId = options.taskId
|
datas.taskId = options.taskId
|
||||||
}
|
}
|
||||||
|
})
|
||||||
|
onShow(()=>{
|
||||||
getList()
|
getList()
|
||||||
})
|
})
|
||||||
// 去兑换
|
// 去兑换
|
||||||
|
|||||||
@@ -40,20 +40,25 @@
|
|||||||
title: ''
|
title: ''
|
||||||
})
|
})
|
||||||
const refVideoList = ref(null)
|
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() {
|
async function init() {
|
||||||
/**
|
/**
|
||||||
* 如果是安卓則不做操作,如果是ios判斷是否審核,不審核不套裝
|
* 如果是安卓則不做操作,如果是ios判斷是否審核,不審核不套裝
|
||||||
*/
|
*/
|
||||||
// 是否审核,是否ios
|
// 是否审核,是否ios
|
||||||
if ($common.isIosExamine) {
|
if ($common.isIosExamine) {
|
||||||
const res = await Api.getVideoDetail(options)
|
getDetail()
|
||||||
isFirstLoad = false
|
|
||||||
Object.assign(state, res)
|
|
||||||
state.list = res.list
|
|
||||||
} else {
|
} else {
|
||||||
// ios是否登錄 ?
|
// ios是否登錄 ?
|
||||||
console.log(uni.getStorageSync('tokenTwo'),'提送hi')
|
console.log(uni.getStorageSync('tokenTwo'),'提送hi')
|
||||||
if (uni.getStorageSync('tokenTwo')) {
|
if (uni.getStorageSync('tokenTwo')) {
|
||||||
|
console.log('--------')
|
||||||
const res = await Api.getVideoDetail({...options,token:uni.getStorageSync('tokenTwo')})
|
const res = await Api.getVideoDetail({...options,token:uni.getStorageSync('tokenTwo')})
|
||||||
isFirstLoad = false
|
isFirstLoad = false
|
||||||
Object.assign(state, res)
|
Object.assign(state, res)
|
||||||
@@ -64,7 +69,7 @@
|
|||||||
phone: '18681817128'
|
phone: '18681817128'
|
||||||
})
|
})
|
||||||
uni.setStorageSync('tokenTwo', res.token)
|
uni.setStorageSync('tokenTwo', res.token)
|
||||||
init()
|
getDetail()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -98,7 +103,6 @@
|
|||||||
}
|
}
|
||||||
onLoad((opt) => {
|
onLoad((opt) => {
|
||||||
Object.assign(options, opt)
|
Object.assign(options, opt)
|
||||||
console.log(options);
|
|
||||||
init()
|
init()
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -109,19 +113,22 @@
|
|||||||
}) {}
|
}) {}
|
||||||
|
|
||||||
onShow(async () => {
|
onShow(async () => {
|
||||||
|
console.log(isFirstLoad)
|
||||||
if (!isFirstLoad) {
|
if (!isFirstLoad) {
|
||||||
await init()
|
await getDetail()
|
||||||
refVideoList.value.videoListUpdata()
|
refVideoList.value.videoListUpdata()
|
||||||
const drawRes = await Api.getDrawCount()
|
const drawRes = await Api.getDrawCount()
|
||||||
console.log(drawRes);
|
console.log(drawRes);
|
||||||
const nobuyCourseId = uni.getStorageSync('nobuyCourseId')
|
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')
|
uni.removeStorageSync('nobuyCourseId')
|
||||||
if (item) {
|
if (item) {
|
||||||
if (drawRes.count * 1 > 0 && nobuyCourseId !== null && nobuyCourseId !== undefined && item
|
if (drawRes.count * 1 > 0 && nobuyCourseId !== null && nobuyCourseId !== undefined && item
|
||||||
.videoUrl) {
|
.videoUrl) {
|
||||||
|
console.log('跳转抽奖')
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/pages/me/prizeDraw'
|
url: '/pages/index/prizeDraw/kevy-luckydraw'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
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 |
@@ -68,8 +68,8 @@ export const useCommonStore = defineStore("common", {
|
|||||||
},
|
},
|
||||||
setversion(a, b) {
|
setversion(a, b) {
|
||||||
return new Promise(async (resolve, reject) => {
|
return new Promise(async (resolve, reject) => {
|
||||||
// console.log('當前版本-' + a, '接口版本-' + b, '判斷值-' + this.isExamines)
|
|
||||||
this.isExamines = await this.compare(a, b)
|
this.isExamines = await this.compare(a, b)
|
||||||
|
console.log('判斷值-' + this.isExamines)
|
||||||
resolve(this.isExamines)
|
resolve(this.isExamines)
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
@@ -82,19 +82,24 @@ export const useCommonStore = defineStore("common", {
|
|||||||
const n1 = Number(arr1[i] || 0)
|
const n1 = Number(arr1[i] || 0)
|
||||||
const n2 = Number(arr2[i] || 0)
|
const n2 = Number(arr2[i] || 0)
|
||||||
// version1 > version2 返回1,如果 version1 < version2 返回-1,不然返回0
|
// version1 > version2 返回1,如果 version1 < version2 返回-1,不然返回0
|
||||||
if (n1 > n2) return 1
|
// 当前版 n1 接口版本是 n2
|
||||||
if (n1 < n2) return -1
|
// 1小于2 更新弹窗、抽奖等显示
|
||||||
|
if (n1 < n2) return 1
|
||||||
|
// 1大于2 更新弹窗、抽奖不显示
|
||||||
|
if (n1 > n2) return -1
|
||||||
}
|
}
|
||||||
|
// APP等于2 更新弹窗不显示‘抽奖显示
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
getters: {
|
getters: {
|
||||||
isIosExamine: function () {
|
isIosExamine: function() {
|
||||||
|
console.log(this.isExamines)
|
||||||
if (!this.isIos) {
|
if (!this.isIos) {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
if (this.isExamines == 1) {
|
if (this.isExamines == -1) {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
return true
|
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']
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||