43 Commits

Author SHA1 Message Date
gyq
07637f1986 test 2025-08-25 15:51:40 +08:00
gyq
50a5e7672c Merge branch 'ymf_php' of e.coding.net:g-cphe0354/duanju/new_app into gyq_php 2025-08-20 16:23:55 +08:00
gyq
efce59d822 优化提现界面的小数展示 2025-08-20 16:23:23 +08:00
5bf0a4e686 请求地址修改 2025-08-11 09:31:48 +08:00
gyq
855a884c4c 切换正式PHP 2025-08-08 09:27:29 +08:00
gyq
85205caa74 优化 2025-08-05 21:42:19 +08:00
gyq
fbfc97bc3f 去除打包/h5/ 2025-08-05 19:01:34 +08:00
gyq
d5bd741dde Merge branch 'ymf_php' of e.coding.net:g-cphe0354/duanju/new_app into gyq_php 2025-08-05 18:54:55 +08:00
gyq
709eff18c3 优化注册渠道码 2025-08-05 18:54:40 +08:00
1eb645705d 部分接口调整,修复提现页面点击弹窗确认按钮卡死问题 2025-08-05 18:03:10 +08:00
gyq
c65d4a0e78 优化 2025-08-04 14:21:12 +08:00
d3dc2e8a87 代码合并 2025-08-01 10:24:08 +08:00
80c07fe756 修复部分问题 2025-08-01 10:21:14 +08:00
gyq
4d85921b48 1 2025-07-31 17:58:07 +08:00
gyq
b01479803a Merge branch 'ymf_php' of e.coding.net:g-cphe0354/duanju/new_app into gyq_php 2025-07-31 17:55:03 +08:00
gyq
fc64e7b77b 优化 2025-07-31 17:54:23 +08:00
gyq
4306ba1900 更改部分接口传参方式 2025-07-16 09:38:30 +08:00
7c2b8b7840 增加本地测试链接 2025-07-15 17:09:49 +08:00
gyq
d1621e78f1 优化 2025-07-07 09:29:14 +08:00
81fa4da0e8 修改正式环境 2025-06-30 14:23:39 +08:00
dd666f0d82 修改支付请求订单详情时间每请求一次加2秒,调整绑定支付宝页面样式 2025-06-30 14:21:51 +08:00
gyq
90ecd6621d 版本升级 2025-05-26 15:19:54 +08:00
gyq
a43b7ad2f8 优化禁用弹窗 2025-05-26 14:16:19 +08:00
gyq
85d0f092c0 新增禁用弹窗 2025-05-24 18:16:56 +08:00
gyq
64f8618802 优化 2025-05-24 10:27:42 +08:00
gyq
a38c068db0 Merge branch 'ymf' of e.coding.net:g-cphe0354/duanju/new_app into gyq 2025-05-24 10:24:00 +08:00
gyq
3afc1b13d1 1 2025-05-07 17:48:36 +08:00
a859805009 增加绑定微信功能界面,增加每日解锁支付超过最大获取抽奖次数时弹窗提醒,增加视频解锁创建订单提示未绑定微信407状态时跳转绑定微信界面 2025-03-27 18:09:21 +08:00
duan
b24bc98e1c 修改实名认证 2025-03-21 15:24:18 +08:00
duan
0714342cee 修改实名参数 2025-03-21 11:36:04 +08:00
duan
128fd2b716 添加注销功能 2025-03-06 13:56:54 +08:00
duan
092704162d 修改版本提交代码 2025-03-05 13:38:26 +08:00
duan
716ef3657a 修改公告拦保存到本地 2025-03-05 13:27:30 +08:00
duan
e8944b3ad1 修改版本号 2025-03-01 18:40:00 +08:00
duan
46b0576abc 首页公告弹窗功能 2025-03-01 18:35:25 +08:00
duan
15c83db6f7 修改isalipay0为1 2025-03-01 14:57:50 +08:00
duan
8c6e586af2 打包修改 2025-02-28 10:17:21 +08:00
duan
371f72931c 修改字段提交 2025-02-28 09:57:10 +08:00
duan
94599e7227 修改logo优化任务跳转 2025-02-27 11:16:56 +08:00
792a70b7ed 修复支付不跳转转盘抽奖问题 2025-02-26 10:37:28 +08:00
duan
3f30b20a4c Merge branch 'test' of https://e.coding.net/g-cphe0354/duanju/new_app into test 2025-02-25 15:11:15 +08:00
duan
a56aabb05a 修改问题 2025-02-25 15:10:11 +08:00
0e3c553990 修改分享qdCode 2025-02-11 09:10:11 +08:00
39 changed files with 4278 additions and 3611 deletions

View File

@@ -1,7 +1,7 @@
<script> <script>
export default { export default {
onLaunch: function() { onLaunch: function() {
console.log('App Launch '); console.log('App Launch 11111');
uni.setStorageSync('adRewardedNum',0) uni.setStorageSync('adRewardedNum',0)
}, },

View File

@@ -5,6 +5,9 @@ export async function init() {
//热搜词 //热搜词
http.request({ http.request({
url: 'common/type/249', url: 'common/type/249',
data: {
type: 249
}
}).then(res => { }).then(res => {
if (res.code == 0) { if (res.code == 0) {
uni.setStorageSync('moreSearch', res.data.value) uni.setStorageSync('moreSearch', res.data.value)
@@ -18,6 +21,9 @@ export async function init() {
export const commonType = (num) => { export const commonType = (num) => {
return http.request({ return http.request({
url: `/common/type/${num}`, url: `/common/type/${num}`,
data:{
type: num
}
}) })
} }

View File

@@ -14,9 +14,13 @@ export const login = (data) => {
/** /**
* 发送验证码 * 发送验证码
*/ */
export const setSendMsg = (mobile,type) => { export const setSendMsg = (mobile, type) => {
return http.request({ return http.request({
url: '/Login/sendMsg/' + mobile + '/'+type url: '/Login/sendMsg/' + mobile + '/' + type,
data: {
phone: mobile,
event: type
}
}) })
} }
@@ -54,3 +58,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
})
}

View File

@@ -17,7 +17,10 @@ export const selectByUserId = (data) => {
export const commonType = (type) => { export const commonType = (type) => {
return http.request({ return http.request({
url: `/common/type/${type}`, url: `/common/type/${type}`,
method: 'GET' method: 'GET',
data: {
type: type
}
}) })
} }
@@ -42,7 +45,12 @@ export const sendMessage = (data) => {
data: data data: data
}) })
} }
export const deleteUserByUserId = (data) => {
return http.request({
url: '/user/deleteUser',
method: 'post',
})
}
/** /**
* 帮助中心 * 帮助中心
*/ */
@@ -63,6 +71,7 @@ export const collectVideoSummary = () => {
method: 'GET' method: 'GET'
}) })
} }
// 注销账号
/** /**
* 金币 * 金币

View File

@@ -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
}) })
} }

View File

@@ -8,15 +8,16 @@ export const selectNewApp = (data) => {
return http.request({ return http.request({
url: '/user/selectNewApp', url: '/user/selectNewApp',
data: data, data: data,
method: 'POST',
}) })
} }
/** /**
* 获取用户信息 * 获取用户信息
*/ */
export const selectUserById = (data) => { export const selectUserById = (data) => {
return http.request({ return http.request({
url: '/user/selectUserById', url: '/user/selectUserById',
method: 'get',
data: data data: data
}) })
} }

View File

@@ -56,7 +56,10 @@ export function insertHistory(data) {
export function getJinbiBili(data) { export function getJinbiBili(data) {
return http.request({ return http.request({
url: 'common/type/914', url: 'common/type/914',
data data: {
...data,
type: 914
}
}) })
} }
@@ -97,14 +100,16 @@ export function payOrder(data) {
// #endif // #endif
return http.request({ return http.request({
url: 'wuyou/payOrder/' + data.orderId + '?payType=' + payType, url: 'wuyou/payOrder/' + data.orderId + '?payType=' + payType,
method: 'GET' method: 'GET',
data:data
}) })
} }
//获取订单支付状态 //获取订单支付状态
export function getOrderInfo(data) { export function getOrderInfo(data) {
return http.request({ return http.request({
url: 'wuyou/queryOrder/' + data.orderId, url: 'wuyou/queryOrder/' + data.orderId,
method: 'GET' method: 'GET',
data:data
}) })
} }
//金币解锁 //金币解锁
@@ -140,7 +145,7 @@ export function playStatus(data) {
} }
// 获取支付次数提示 // 获取支付次数提示
export function getPayTips(data){ export function getPayTips(data) {
return http.request({ return http.request({
url: 'course/getRedEnvelopeTips', url: 'course/getRedEnvelopeTips',
method: 'GET', method: 'GET',

View File

@@ -1,46 +1,60 @@
//打包时修改env的值即可 //打包时修改env的值即可
const env='test' //test , production,local const env = 'php_production' //test,production,local
export const encryptKey='1234567890123456' // http数据加解密的key export const encryptKey = '1234567890123456' // http数据加解密的key
export const apiUrl='/czg/' export const apiUrl = '/czg/app/'
// export const apiUrl = '/api/'
export const h5Config = { export const h5Config = {
production: 'https://web.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.21:8100',
local: 'http://192.168.1.43:1333',
zhangsong_local:'http://192.168.1.54:1024',
hong:'http://192.168.1.31:8080',
php_production:'https://ph.hnsiyao.cn',
php_test:'https://playlet.test.sxczgkj.com',
} }
export const AppConfig = { export const AppConfig = {
production: 'https://dj-api.hnsiyao.cn', production: 'https://dj-api.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.21:8100',
local: 'http://192.168.1.43:1333',
zhangsong_local:'http://192.168.1.54:1024',
hong:'http://192.168.1.31:8080',
php_production:'https://ph.hnsiyao.cn',
php_test:'https://playlet.test.sxczgkj.com'
} }
export function returnShareUrl(){ export function returnShareUrl() {
if(env==='test'){ if (env === 'test') {
return 'https://video-h5.hnsiyao.cn' return 'https://video-h5.hnsiyao.cn'
} }
if(env==='production'){ if (env === 'production') {
return 'https://dj-h5.hnsiyao.cn' return 'https://dj-h5.hnsiyao.cn'
} }
if(env==='local'){ if (env === 'php_production') {
return 'https://ph-h5.hnsiyao.cn'
}
if (env === 'local') {
return AppConfig[env] return AppConfig[env]
} }
} }
// #ifdef H5 // #ifdef H5
export default{ export default {
baseUrl:h5Config[env], baseUrl: h5Config[env],
baseApiUrl:h5Config[env]+apiUrl, baseApiUrl: h5Config[env] + apiUrl,
shareUrl:returnShareUrl() shareUrl: returnShareUrl()
} }
// #endif // #endif
// #ifdef APP // #ifdef APP
export default{ export default {
baseUrl:AppConfig[env], baseUrl: AppConfig[env],
baseApiUrl:AppConfig[env]+apiUrl, baseApiUrl: AppConfig[env] + apiUrl,
shareUrl:returnShareUrl() shareUrl: returnShareUrl()
} }
// #endif // #endif

View File

@@ -0,0 +1,69 @@
<template>
<view class="container">
<view class="dialog">
<view class="title">
<text class="t">风险提示</text>
</view>
<view class="content">
<text class="t">您的账号暂不可用详情请联系客服</text>
</view>
<view class="footer">
<navigator class="btn" url="/pages/me/contact" style="height: 40px">
<text class="t">去联系客服</text>
</navigator>
</view>
</view>
</view>
</template>
<script></script>
<style scoped lang="scss">
.container {
width: 100%;
height: 100%;
position: fixed;
top: 0;
left: 0;
z-index: 99999999;
background-color: rgba(0, 0, 0, 0.6);
backdrop-filter: blur(3px);
display: flex;
align-items: center;
justify-content: center;
.dialog {
width: 90%;
background-color: #fff;
border-radius: 20upx;
.title {
height: 100upx;
display: flex;
align-items: center;
justify-content: center;
.t {
font-size: 32upx;
font-weight: bold;
}
}
.content {
padding: 0 50upx;
}
.footer {
padding: 80upx 28upx 28upx;
display: flex;
.btn {
flex: 1;
display: flex;
align-items: center;
justify-content: center;
background-color: #dd8591;
color: #fff;
border-radius: 12upx;
.t {
font-size: 28upx;
}
}
}
}
}
</style>

File diff suppressed because it is too large Load Diff

View File

@@ -7,8 +7,10 @@ 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";
let baseUrl = config.baseApiUrl;
const loadingShowTime = 200; const loadingShowTime = 200;
function getHeader(data) { function getHeader(data) {
@@ -21,7 +23,7 @@ function getHeader(data) {
} }
// 通用处理逻辑 // 通用处理逻辑
function commonsProcess(showLoading, httpReqCallback, isreturm) { function commonsProcess(showLoading, httpReqCallback, isreturm, url) {
// 判断是否请求完成(用作 是否loading // 判断是否请求完成(用作 是否loading
// 包括: 'ing', 'ingLoading', 'finish' // 包括: 'ing', 'ingLoading', 'finish'
let reqState = "ing"; let reqState = "ing";
@@ -48,7 +50,9 @@ function commonsProcess(showLoading, httpReqCallback, isreturm) {
return httpReqCallback() return httpReqCallback()
.then((httpData) => { .then((httpData) => {
// console.log(url);
// console.log('httpData');
// console.log(httpData);
reqFinishFunc(); // 请求完毕的动作 reqFinishFunc(); // 请求完毕的动作
// 从http响应数据中解构响应数据 [ 响应码、 bodyData ] // 从http响应数据中解构响应数据 [ 响应码、 bodyData ]
let { let {
@@ -60,6 +64,7 @@ function commonsProcess(showLoading, httpReqCallback, isreturm) {
if (isreturm) { if (isreturm) {
return Promise.resolve(bodyData); return Promise.resolve(bodyData);
} }
if (statusCode == 500) { if (statusCode == 500) {
isShowErrorToast = true; isShowErrorToast = true;
return Promise.reject(bodyData); // 跳转到catch函数 return Promise.reject(bodyData); // 跳转到catch函数
@@ -73,7 +78,7 @@ 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;
infoBox.showToast(data.message || "服务器异常"); infoBox.showToast(data.message || data.msg || "服务器异常");
return Promise.reject(bodyData); // 跳转到catch函数 return Promise.reject(bodyData); // 跳转到catch函数
} }
if (bodyData.code == 401) { if (bodyData.code == 401) {
@@ -81,13 +86,41 @@ function commonsProcess(showLoading, httpReqCallback, isreturm) {
isShowErrorToast = true; isShowErrorToast = true;
return Promise.reject(bodyData); // 跳转到catch函数 return Promise.reject(bodyData); // 跳转到catch函数
} }
if (bodyData.code == 701) {
uni.clearStorageSync()
uni.reLaunch({
url: '/pages/login/login'
})
return Promise.reject(bodyData); // 跳转到catch函数
}
if (bodyData.code == 702) {
return Promise.reject(bodyData); // 跳转到catch函数
}
if (bodyData.code == 500) { if (bodyData.code == 500) {
// 提示信息 // 提示信息
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 || data.msg);
return; return;
} }
@@ -98,21 +131,14 @@ 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);
}) })
.catch((res) => { .catch((res) => {
console.log('catch res');
console.log(res);
if (res.status == 404) { if (res.status == 404) {
infoBox.showToast("接口404").then(() => {}); infoBox.showToast("接口404").then(() => {});
reject(); reject();
@@ -120,17 +146,18 @@ function commonsProcess(showLoading, httpReqCallback, isreturm) {
} }
if (res.code == 401) { if (res.code == 401) {
uni.clearStorageSync()
uni.redirectTo({ uni.redirectTo({
url: "/pages/login/login", url: "/pages/login/login",
}); });
reject(); reject();
} }
if (res.code != 0&&res.code != 401) { if (res.code != 0 && res.code != 401) {
infoBox.showToast(res.msg).then(() => {}); infoBox.showToast(res.message || res.msg).then(() => {});
reject(); reject();
} }
if (res.code == 500) { if (res.code == 500) {
infoBox.showToast(res.msg || "服务器异常").then(() => {}); infoBox.showToast(res.message || res.msg || "服务器异常").then(() => {});
reject(); reject();
} }
reqFinishFunc(); // 请求完毕的动作 reqFinishFunc(); // 请求完毕的动作
@@ -185,8 +212,10 @@ function request(args) {
url = url + '?' + (result.slice(0, result.length - 1)) url = url + '?' + (result.slice(0, result.length - 1))
params = null params = null
} }
let headerObject = {} let headerObject = {}
return commonsProcess(showLoading, () => { return commonsProcess(showLoading, () => {
return uni.request( return uni.request(
Object.assign({ Object.assign({
url: slash(baseUrl, url), url: slash(baseUrl, url),
@@ -196,7 +225,7 @@ function request(args) {
}, extParams) }, extParams)
) )
}, isreturm) }, isreturm, url)
} }
// 处理/ // 处理/
function slash(baseUrl, url) { function slash(baseUrl, url) {

View File

@@ -2,8 +2,8 @@
"name" : "斯耀短剧", "name" : "斯耀短剧",
"appid" : "__UNI__E0B05B1", "appid" : "__UNI__E0B05B1",
"description" : "", "description" : "",
"versionName" : "1.2.5", "versionName" : "1.3.2",
"versionCode" : 125, "versionCode" : 132,
"transformPx" : false, "transformPx" : false,
/* 5+App */ /* 5+App */
"app-plus" : { "app-plus" : {
@@ -30,7 +30,8 @@
"Camera" : {}, "Camera" : {},
"Push" : {}, "Push" : {},
"VideoPlayer" : {}, "VideoPlayer" : {},
"Canvas" : "nvue canvas" //使用Canvas模块 "Canvas" : "nvue canvas", //使用Canvas模块
"OAuth" : {}
}, },
/* */ /* */
"distribute" : { "distribute" : {
@@ -74,6 +75,12 @@
}, },
"ad" : { "ad" : {
"ks" : {} "ks" : {}
},
"oauth" : {
"weixin" : {
"appid" : "wx5001ff1af6c4781f",
"UniversalLinks" : ""
}
} }
}, },
"abiFilters" : [ "armeabi-v7a", "arm64-v8a", "x86" ], "abiFilters" : [ "armeabi-v7a", "arm64-v8a", "x86" ],
@@ -143,7 +150,8 @@
"title" : "斯耀短剧", "title" : "斯耀短剧",
"template" : "template.html", "template" : "template.html",
"router" : { "router" : {
"mode" : "history" "mode" : "history",
"base" : ""
} }
} }
} }

295
package-lock.json generated
View File

@@ -1,295 +1,110 @@
{ {
"name": "抽奖转盘非固定图片可自定义传入奖项列表v2 v3兼容",
"version": "1.0.0",
"lockfileVersion": 3,
"requires": true, "requires": true,
"lockfileVersion": 1, "packages": {
"": {
"name": "抽奖转盘非固定图片可自定义传入奖项列表v2 v3兼容",
"version": "1.0.0",
"dependencies": { "dependencies": {
"@babel/runtime": { "lodash": "^4.17.21",
"version": "7.26.0", "uview-plus": "^3.3.62"
"resolved": "https://registry.npmmirror.com/@babel/runtime/-/runtime-7.26.0.tgz", },
"integrity": "sha512-FDSOghenHTiToteC/QRlv2q3DhPZ/oOXTBoirfWNx1Cx3TMVcGWQtMMmQcSvb/JjpNeGzx8Pq/b4fKEJuWm1sw==", "devDependencies": {
"requires": { "pinia-plugin-unistorage": "^0.1.2"
"regenerator-runtime": "^0.14.0"
} }
}, },
"base64-js": { "node_modules/clipboard": {
"version": "1.5.1",
"resolved": "https://registry.npmmirror.com/base64-js/-/base64-js-1.5.1.tgz",
"integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA=="
},
"buffer": {
"version": "5.7.1",
"resolved": "https://registry.npmmirror.com/buffer/-/buffer-5.7.1.tgz",
"integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==",
"requires": {
"base64-js": "^1.3.1",
"ieee754": "^1.1.13"
}
},
"buffer-from": {
"version": "1.1.2",
"resolved": "https://registry.npmmirror.com/buffer-from/-/buffer-from-1.1.2.tgz",
"integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ=="
},
"clipboard": {
"version": "2.0.11", "version": "2.0.11",
"resolved": "https://registry.npmmirror.com/clipboard/-/clipboard-2.0.11.tgz", "resolved": "https://registry.npmmirror.com/clipboard/-/clipboard-2.0.11.tgz",
"integrity": "sha512-C+0bbOqkezLIsmWSvlsXS0Q0bmkugu7jcfMIACB+RDEntIzQIkdr148we28AfSloQLRdZlYL/QYyrq05j/3Faw==", "integrity": "sha512-C+0bbOqkezLIsmWSvlsXS0Q0bmkugu7jcfMIACB+RDEntIzQIkdr148we28AfSloQLRdZlYL/QYyrq05j/3Faw==",
"requires": { "dependencies": {
"good-listener": "^1.2.2", "good-listener": "^1.2.2",
"select": "^1.1.2", "select": "^1.1.2",
"tiny-emitter": "^2.0.0" "tiny-emitter": "^2.0.0"
} }
}, },
"concat-stream": { "node_modules/dayjs": {
"version": "1.6.2",
"resolved": "https://registry.npmmirror.com/concat-stream/-/concat-stream-1.6.2.tgz",
"integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==",
"requires": {
"buffer-from": "^1.0.0",
"inherits": "^2.0.3",
"readable-stream": "^2.2.2",
"typedarray": "^0.0.6"
}
},
"copy-text-to-clipboard": {
"version": "3.2.0",
"resolved": "https://registry.npmmirror.com/copy-text-to-clipboard/-/copy-text-to-clipboard-3.2.0.tgz",
"integrity": "sha512-RnJFp1XR/LOBDckxTib5Qjr/PMfkatD0MUCQgdpqS8MdKiNUzBjAQBEN6oUy+jW7LI93BBG3DtMB2KOOKpGs2Q=="
},
"core-js": {
"version": "3.40.0",
"resolved": "https://registry.npmmirror.com/core-js/-/core-js-3.40.0.tgz",
"integrity": "sha512-7vsMc/Lty6AGnn7uFpYT56QesI5D2Y/UkgKounk87OP9Z2H9Z8kj6jzcSGAxFmUtDOS0ntK6lbQz+Nsa0Jj6mQ=="
},
"core-util-is": {
"version": "1.0.3",
"resolved": "https://registry.npmmirror.com/core-util-is/-/core-util-is-1.0.3.tgz",
"integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ=="
},
"cross-spawn": {
"version": "5.1.0",
"resolved": "https://registry.npmmirror.com/cross-spawn/-/cross-spawn-5.1.0.tgz",
"integrity": "sha512-pTgQJ5KC0d2hcY8eyL1IzlBPYjTkyH72XRZPnLyKus2mBfNjQs3klqbJU2VILqZryAZUt9JOb3h/mWMy23/f5A==",
"requires": {
"lru-cache": "^4.0.1",
"shebang-command": "^1.2.0",
"which": "^1.2.9"
}
},
"dayjs": {
"version": "1.11.13", "version": "1.11.13",
"resolved": "https://registry.npmmirror.com/dayjs/-/dayjs-1.11.13.tgz", "resolved": "https://registry.npmmirror.com/dayjs/-/dayjs-1.11.13.tgz",
"integrity": "sha512-oaMBel6gjolK862uaPQOVTA7q3TZhuSvuMQAAglQDOWYO9A91IrAOUJEyKVlqJlHE0vq5p5UXxzdPfMH/x6xNg==" "integrity": "sha512-oaMBel6gjolK862uaPQOVTA7q3TZhuSvuMQAAglQDOWYO9A91IrAOUJEyKVlqJlHE0vq5p5UXxzdPfMH/x6xNg=="
}, },
"delegate": { "node_modules/delegate": {
"version": "3.2.0", "version": "3.2.0",
"resolved": "https://registry.npmmirror.com/delegate/-/delegate-3.2.0.tgz", "resolved": "https://registry.npmmirror.com/delegate/-/delegate-3.2.0.tgz",
"integrity": "sha512-IofjkYBZaZivn0V8nnsMJGBr4jVLxHDheKSW88PyxS5QC4Vo9ZbZVvhzlSxY87fVq3STR6r+4cGepyHkcWOQSw==" "integrity": "sha512-IofjkYBZaZivn0V8nnsMJGBr4jVLxHDheKSW88PyxS5QC4Vo9ZbZVvhzlSxY87fVq3STR6r+4cGepyHkcWOQSw=="
}, },
"gm-crypto": { "node_modules/good-listener": {
"version": "0.1.12",
"resolved": "https://registry.npmmirror.com/gm-crypto/-/gm-crypto-0.1.12.tgz",
"integrity": "sha512-ercd9ionBqxR+/FCXICr0eo+jzC8BvSK0j9L7/eB0uwbyjgeMPTdBNrcQTqIuRXOtOAKSGsTNvtLYFnIxNEoFg==",
"requires": {
"buffer": "^5.7.0",
"jsbn": "^1.1.0",
"to-arraybuffer": "^1.0.1"
}
},
"good-listener": {
"version": "1.2.2", "version": "1.2.2",
"resolved": "https://registry.npmmirror.com/good-listener/-/good-listener-1.2.2.tgz", "resolved": "https://registry.npmmirror.com/good-listener/-/good-listener-1.2.2.tgz",
"integrity": "sha512-goW1b+d9q/HIwbVYZzZ6SsTr4IgE+WA44A0GmPIQstuOrgsFcT7VEJ48nmr9GaRtNu0XTKacFLGnBPAM6Afouw==", "integrity": "sha512-goW1b+d9q/HIwbVYZzZ6SsTr4IgE+WA44A0GmPIQstuOrgsFcT7VEJ48nmr9GaRtNu0XTKacFLGnBPAM6Afouw==",
"requires": { "dependencies": {
"delegate": "^3.1.2" "delegate": "^3.1.2"
} }
}, },
"ieee754": { "node_modules/lodash": {
"version": "1.2.1",
"resolved": "https://registry.npmmirror.com/ieee754/-/ieee754-1.2.1.tgz",
"integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA=="
},
"inherits": {
"version": "2.0.4",
"resolved": "https://registry.npmmirror.com/inherits/-/inherits-2.0.4.tgz",
"integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ=="
},
"isarray": {
"version": "1.0.0",
"resolved": "https://registry.npmmirror.com/isarray/-/isarray-1.0.0.tgz",
"integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ=="
},
"isexe": {
"version": "2.0.0",
"resolved": "https://registry.npmmirror.com/isexe/-/isexe-2.0.0.tgz",
"integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw=="
},
"jsbn": {
"version": "1.1.0",
"resolved": "https://registry.npmmirror.com/jsbn/-/jsbn-1.1.0.tgz",
"integrity": "sha512-4bYVV3aAMtDTTu4+xsDYa6sy9GyJ69/amsu9sYF2zqjiEoZA5xJi3BrfX3uY+/IekIu7MwdObdbDWpoZdBv3/A=="
},
"lodash": {
"version": "4.17.21", "version": "4.17.21",
"resolved": "https://registry.npmmirror.com/lodash/-/lodash-4.17.21.tgz", "resolved": "https://registry.npmmirror.com/lodash/-/lodash-4.17.21.tgz",
"integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg=="
}, },
"lru-cache": { "node_modules/node_modules/pinia-plugin-unistorage": {
"version": "4.1.5", "version": "0.1.2",
"resolved": "https://registry.npmmirror.com/lru-cache/-/lru-cache-4.1.5.tgz", "integrity": "sha512-WXit2cGnm5rG6CDTcLSLehNWhyJS/Yq7WEeeXAapZbCnqoPJxlszqg7rT8S+OP47az0h5nlajGo+LuyMxUQ2uw==",
"integrity": "sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g==", "extraneous": true,
"requires": { "devDependencies": {
"pseudomap": "^1.0.2", "@types/node": "^18.19.8",
"yallist": "^2.1.2" "bumpp": "^9.3.0",
"pinia-plugin-persistedstate": "^3.2.1",
"unbuild": "^2.0.0"
} }
}, },
"mutation-observer": { "node_modules/node_modules/pre-commit": {
"version": "1.0.3", "version": "1.2.2",
"resolved": "https://registry.npmmirror.com/mutation-observer/-/mutation-observer-1.0.3.tgz", "integrity": "sha512-qokTiqxD6GjODy5ETAIgzsRgnBWWQHQH2ghy86PU7mIn/wuWeTwF3otyNQZxWBwVn8XNr8Tdzj/QfUXpH+gRZA==",
"integrity": "sha512-M/O/4rF2h776hV7qGMZUH3utZLO/jK7p8rnNgGkjKUw8zCGjRQPxB8z6+5l8+VjRUQ3dNYu4vjqXYLr+U8ZVNA==" "extraneous": true,
"hasInstallScript": true,
"dependencies": {
"cross-spawn": "^5.0.1",
"spawn-sync": "^1.0.15",
"which": "1.2.x"
}, },
"os-shim": { "devDependencies": {
"version": "0.1.3", "assume": "1.4.x",
"resolved": "https://registry.npmmirror.com/os-shim/-/os-shim-0.1.3.tgz", "istanbul": "0.4.x",
"integrity": "sha512-jd0cvB8qQ5uVt0lvCIexBaROw1KyKm5sbulg2fWOHjETisuCzWyt+eTZKEMs8v6HwzoGs8xik26jg7eCM6pS+A==" "mocha": "~3.2.0",
"pre-commit": "git://github.com/observing/pre-commit.git"
}
}, },
"node_modules/pinia-plugin-unistorage": { "node_modules/pinia-plugin-unistorage": {
"version": "0.1.2", "version": "0.1.2",
"resolved": "https://registry.npmmirror.com/pinia-plugin-unistorage/-/pinia-plugin-unistorage-0.1.2.tgz", "resolved": "https://registry.npmmirror.com/pinia-plugin-unistorage/-/pinia-plugin-unistorage-0.1.2.tgz",
"integrity": "sha512-WXit2cGnm5rG6CDTcLSLehNWhyJS/Yq7WEeeXAapZbCnqoPJxlszqg7rT8S+OP47az0h5nlajGo+LuyMxUQ2uw==", "integrity": "sha512-WXit2cGnm5rG6CDTcLSLehNWhyJS/Yq7WEeeXAapZbCnqoPJxlszqg7rT8S+OP47az0h5nlajGo+LuyMxUQ2uw==",
"dev": true, "dev": true
"license": "MIT"
}, },
"node_modules/pre-commit": { "node_modules/select": {
"version": "1.2.2",
"resolved": "https://registry.npmmirror.com/pre-commit/-/pre-commit-1.2.2.tgz",
"integrity": "sha512-qokTiqxD6GjODy5ETAIgzsRgnBWWQHQH2ghy86PU7mIn/wuWeTwF3otyNQZxWBwVn8XNr8Tdzj/QfUXpH+gRZA==",
"requires": {
"cross-spawn": "^5.0.1",
"spawn-sync": "^1.0.15",
"which": "1.2.x"
}
},
"process-nextick-args": {
"version": "2.0.1",
"resolved": "https://registry.npmmirror.com/process-nextick-args/-/process-nextick-args-2.0.1.tgz",
"integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag=="
},
"pseudomap": {
"version": "1.0.2",
"resolved": "https://registry.npmmirror.com/pseudomap/-/pseudomap-1.0.2.tgz",
"integrity": "sha512-b/YwNhb8lk1Zz2+bXXpS/LK9OisiZZ1SNsSLxN1x2OXVEhW2Ckr/7mWE5vrC1ZTiJlD9g19jWszTmJsB+oEpFQ=="
},
"readable-stream": {
"version": "2.3.8",
"resolved": "https://registry.npmmirror.com/readable-stream/-/readable-stream-2.3.8.tgz",
"integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==",
"requires": {
"core-util-is": "~1.0.0",
"inherits": "~2.0.3",
"isarray": "~1.0.0",
"process-nextick-args": "~2.0.0",
"safe-buffer": "~5.1.1",
"string_decoder": "~1.1.1",
"util-deprecate": "~1.0.1"
}
},
"regenerator-runtime": {
"version": "0.14.1",
"resolved": "https://registry.npmmirror.com/regenerator-runtime/-/regenerator-runtime-0.14.1.tgz",
"integrity": "sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw=="
},
"safe-buffer": {
"version": "5.1.2",
"resolved": "https://registry.npmmirror.com/safe-buffer/-/safe-buffer-5.1.2.tgz",
"integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g=="
},
"select": {
"version": "1.1.2", "version": "1.1.2",
"resolved": "https://registry.npmmirror.com/select/-/select-1.1.2.tgz", "resolved": "https://registry.npmmirror.com/select/-/select-1.1.2.tgz",
"integrity": "sha512-OwpTSOfy6xSs1+pwcNrv0RBMOzI39Lp3qQKUTPVVPRjCdNa5JH/oPRiqsesIskK8TVgmRiHwO4KXlV2Li9dANA==" "integrity": "sha512-OwpTSOfy6xSs1+pwcNrv0RBMOzI39Lp3qQKUTPVVPRjCdNa5JH/oPRiqsesIskK8TVgmRiHwO4KXlV2Li9dANA=="
}, },
"shebang-command": { "node_modules/tiny-emitter": {
"version": "1.2.0",
"resolved": "https://registry.npmmirror.com/shebang-command/-/shebang-command-1.2.0.tgz",
"integrity": "sha512-EV3L1+UQWGor21OmnvojK36mhg+TyIKDh3iFBKBohr5xeXIhNBcx8oWdgkTEEQ+BEFFYdLRuqMfd5L84N1V5Vg==",
"requires": {
"shebang-regex": "^1.0.0"
}
},
"shebang-regex": {
"version": "1.0.0",
"resolved": "https://registry.npmmirror.com/shebang-regex/-/shebang-regex-1.0.0.tgz",
"integrity": "sha512-wpoSFAxys6b2a2wHZ1XpDSgD7N9iVjg29Ph9uV/uaP9Ex/KXlkTZTeddxDPSYQpgvzKLGJke2UU0AzoGCjNIvQ=="
},
"spawn-sync": {
"version": "1.0.15",
"resolved": "https://registry.npmmirror.com/spawn-sync/-/spawn-sync-1.0.15.tgz",
"integrity": "sha512-9DWBgrgYZzNghseho0JOuh+5fg9u6QWhAWa51QC7+U5rCheZ/j1DrEZnyE0RBBRqZ9uEXGPgSSM0nky6burpVw==",
"requires": {
"concat-stream": "^1.4.7",
"os-shim": "^0.1.2"
}
},
"string_decoder": {
"version": "1.1.1",
"resolved": "https://registry.npmmirror.com/string_decoder/-/string_decoder-1.1.1.tgz",
"integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",
"requires": {
"safe-buffer": "~5.1.0"
}
},
"tiny-emitter": {
"version": "2.1.0", "version": "2.1.0",
"resolved": "https://registry.npmmirror.com/tiny-emitter/-/tiny-emitter-2.1.0.tgz", "resolved": "https://registry.npmmirror.com/tiny-emitter/-/tiny-emitter-2.1.0.tgz",
"integrity": "sha512-NB6Dk1A9xgQPMoGqC5CVXn123gWyte215ONT5Pp5a0yt4nlEoO1ZWeCwpncaekPHXO60i47ihFnZPiRPjRMq4Q==" "integrity": "sha512-NB6Dk1A9xgQPMoGqC5CVXn123gWyte215ONT5Pp5a0yt4nlEoO1ZWeCwpncaekPHXO60i47ihFnZPiRPjRMq4Q=="
}, },
"to-arraybuffer": { "node_modules/uview-plus": {
"version": "1.0.1", "version": "3.5.10",
"resolved": "https://registry.npmmirror.com/to-arraybuffer/-/to-arraybuffer-1.0.1.tgz", "resolved": "https://registry.npmmirror.com/uview-plus/-/uview-plus-3.5.10.tgz",
"integrity": "sha512-okFlQcoGTi4LQBG/PgSYblw9VOyptsz2KJZqc6qtgGdes8VktzUQkj4BI2blit072iS8VODNcMA+tvnS9dnuMA==" "integrity": "sha512-sn92VKgfFqoBEpWrIULIZbd2z5Rf9iM8U/fKSCVVrU2kCFqcGp68IPr+gttQ7I+KZUVwdGLFECplQQJWytEZYA==",
}, "dependencies": {
"typedarray": {
"version": "0.0.6",
"resolved": "https://registry.npmmirror.com/typedarray/-/typedarray-0.0.6.tgz",
"integrity": "sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA=="
},
"util-deprecate": {
"version": "1.0.2",
"resolved": "https://registry.npmmirror.com/util-deprecate/-/util-deprecate-1.0.2.tgz",
"integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw=="
},
"uview-plus": {
"version": "3.3.61",
"resolved": "https://registry.npmmirror.com/uview-plus/-/uview-plus-3.3.61.tgz",
"integrity": "sha512-1IdZMYd7KuByW+bfBseEuSaKcYB6F4q8bGqAru1UDKIkRVTxkPlqvsTE8Q0+I0+jk6q1ov1KbGFDuyXxVzXcCg==",
"requires": {
"clipboard": "^2.0.11", "clipboard": "^2.0.11",
"dayjs": "^1.11.3" "dayjs": "^1.11.3"
}
}, },
"vconsole": { "engines": {
"version": "3.15.1", "HBuilderX": "^3.1.0",
"resolved": "https://registry.npmmirror.com/vconsole/-/vconsole-3.15.1.tgz", "uni-app": "^4.66",
"integrity": "sha512-KH8XLdrq9T5YHJO/ixrjivHfmF2PC2CdVoK6RWZB4yftMykYIaXY1mxZYAic70vADM54kpMQF+dYmvl5NRNy1g==", "uni-app-x": ""
"requires": {
"@babel/runtime": "^7.17.2",
"copy-text-to-clipboard": "^3.0.1",
"core-js": "^3.11.0",
"mutation-observer": "^1.0.3"
} }
},
"which": {
"version": "1.2.14",
"resolved": "https://registry.npmmirror.com/which/-/which-1.2.14.tgz",
"integrity": "sha512-16uPglFkRPzgiUXYMi1Jf8Z5EzN1iB4V0ZtMXcHZnwsBtQhhHeCqoWw7tsUY42hJGNDWtUsVLTjakIa5BgAxCw==",
"requires": {
"isexe": "^2.0.0"
}
},
"yallist": {
"version": "2.1.2",
"resolved": "https://registry.npmmirror.com/yallist/-/yallist-2.1.2.tgz",
"integrity": "sha512-ncTzHV7NvsQZkYe1DW7cbDLm0YpzHmZF5r/iyP3ZnQtMiJ+pjzisCiMNI+Sj+xQF5pXhSHxSB3uDbsBTzY/c2A=="
} }
} }
} }

View File

@@ -210,6 +210,13 @@
{ {
"navigationBarTitleText" : "兑换" "navigationBarTitleText" : "兑换"
} }
},
{
"path" : "pages/login/bindWx",
"style" :
{
"navigationBarTitleText" : "绑定微信"
}
} }
], ],
"globalStyle": { "globalStyle": {

View File

@@ -52,14 +52,17 @@
<emprty-card v-if="!data.list2.length" /> <emprty-card v-if="!data.list2.length" />
</view> </view>
</view> </view>
<disable-mask v-if="disableShow"></disable-mask>
</template> </template>
<script setup> <script setup>
import { reactive } from 'vue'; import { reactive, ref } from 'vue';
import { selectByUserId } from '@/api/me/me.js'; import { selectByUserId } from '@/api/me/me.js';
import { onLoad, onPullDownRefresh, onReachBottom } from '@dcloudio/uni-app'; import { onLoad, onPullDownRefresh, onReachBottom } from '@dcloudio/uni-app';
import { linkTo } from '@/utils/app.js'; import { linkTo } from '@/utils/app.js';
const disableShow = ref(false);
// 获取数据 // 获取数据
async function selectByUserIdAjax() { async function selectByUserIdAjax() {
try { try {
@@ -69,6 +72,11 @@ async function selectByUserIdAjax() {
data.list2 = res2.records; data.list2 = res2.records;
} catch (error) { } catch (error) {
console.log(error); console.log(error);
if (error.code == 702) {
disableShow.value = true;
} else {
disableShow.value = false;
}
} }
setTimeout(() => { setTimeout(() => {
uni.stopPullDownRefresh(); uni.stopPullDownRefresh();

View File

@@ -1,7 +1,6 @@
<template> <template>
<view class="indexStyle"> <view class="indexStyle">
<image src="@/static/index/indexbh.png" mode=""> <image src="@/static/index/indexbh.png" mode=""></image>
</image>
<view class="indexStyleTwo"> <view class="indexStyleTwo">
<image src="@/static/logo.png" mode=""></image> <image src="@/static/logo.png" mode=""></image>
<!-- <view @tap="moreVideo"> <!-- <view @tap="moreVideo">
@@ -12,103 +11,95 @@
<template v-if="datas.isExamine"> <template v-if="datas.isExamine">
<view class="gongao"> <view class="gongao">
<view class="gongaoicon"> <view class="gongaoicon">公告</view>
公告 <swiper :autoplay="true" :vertical="true" :interval="4000" :circular="true" :indicator-dots="false" class="swiperstyle">
</view>
<swiper :autoplay="true" :vertical="true" :interval="4000" :circular="true" :indicator-dots="false"
class="swiperstyle">
<swiper-item v-for="(item, index) in datas.noticeList" :key="index"> <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>
</template> </template>
</view> </view>
<view class="navTop"> <view class="navTop">
<view :class="datas.active == 1 ? 'navTop-active' : ''" @tap="getrecomVideo('', 1)"> <view :class="datas.active == 1 ? 'navTop-active' : ''" @tap="getrecomVideo('', 1)">最新</view>
最新 <view :class="datas.active == 2 ? 'navTop-active' : ''" @tap="getrecomVideo('1', 2)">排行</view>
<view :class="datas.active == 3 ? 'navTop-active' : ''" @tap="getrecomVideo('2', 3)">最热</view>
<view :class="datas.active == 4 ? 'navTop-active' : ''" @tap="getrecomVideo('1', 4)">剧情</view>
<view :class="datas.active == 5 ? 'navTop-active' : ''" @tap="getrecomVideo('2', 5)">飙升</view>
</view> </view>
<view :class="datas.active == 2 ? 'navTop-active' : ''" @tap="getrecomVideo('1', 2)"> <contentlist :list="datas.list"></contentlist>
排行 <image
</view> v-if="datas.isExamine"
<view :class="datas.active == 3 ? 'navTop-active' : ''" @tap="getrecomVideo('2', 3)"> @click="goMsg()"
最热 src="@/static/index/red-pack-new.gif"
</view> style="width: 200rpx; height: 200rpx; position: fixed; right: 10rpx; bottom: 180rpx"
<view :class="datas.active == 4 ? 'navTop-active' : ''" @tap="getrecomVideo('1', 4)"> mode=""
剧情 ></image>
</view> <up-modal
<view :class="datas.active == 5 ? 'navTop-active' : ''" @tap="getrecomVideo('2', 5)"> :show="datas.version.show"
飙升 :confirm-text="datas.version.confirmText"
</view> :showCancelButton="datas.version.cancelText != ''"
</view> @cancel="cancelUpdateVersion"
<contentlist :list='datas.list'></contentlist> @confirm="confirmUpdateVersion"
<image v-if="datas.isExamine" @click="goMsg()" src="@/static/index/red-pack-new.gif" :title="datas.version.title"
style="width: 200rpx;height: 200rpx;position: fixed;right: 10rpx;bottom: 180rpx;" mode=""></image> :title-style="{ fontWeight: '700' }"
<up-modal :show="datas.version.show" :confirm-text="datas.version.confirmText" confirm-color="rgb(255, 117, 129)"
:showCancelButton="datas.version.cancelText!=''" @cancel="cancelUpdateVersion" @confirm='confirmUpdateVersion' >
:title="datas.version.title" :title-style="{ fontWeight: '700' }" confirm-color="rgb(255, 117, 129)"> <view class="" style="padding-top: 30rpx; text-align: left">
<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> <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>
<!-- h5关闭通知 --> <!-- h5关闭通知 -->
<!-- #ifdef H5 --> <!-- #ifdef H5 -->
<up-modal :show="datas.stopShow" <up-modal
:show="datas.stopShow"
cancel-text="知道了" cancel-text="知道了"
show-cancel-button show-cancel-button
confirm-text="去下载" title="重要通知" confirm-text="去下载"
title="重要通知"
@cancel="stopCancel" @cancel="stopCancel"
:title="datas.rule_title" :title-style="{fontWeight:'700'}" @confirm="stopConfirm" :title="datas.rule_title"
confirm-color="rgb(255, 117, 129)"> :title-style="{ fontWeight: '700' }"
@confirm="stopConfirm"
confirm-color="rgb(255, 117, 129)"
>
<view class="color-red u-text-left"> <view class="color-red u-text-left">
<text>2025年2月8日将关闭网页访问请及时下载最新APP</text> <text>2025年2月8日将关闭网页访问请及时下载最新APP</text>
</view> </view>
</up-modal> </up-modal>
<!-- #endif --> <!-- #endif -->
<!-- 公告弹窗 -->
<up-modal :show="datas.stopShows && datas.isExamine" :showConfirmButton="true" title="公告" @confirm="confirmEvent">
<view class="color-red u-text-left">
<view style="text-align: justify; font-size: 18px; color: #666" v-html="datas.noticeList[datas.cloneNum].title"></view>
</view>
</up-modal>
<!-- #ifdef APP -->
<!-- #endif -->
<disable-mask v-if="disableMaskVisable"></disable-mask>
</template> </template>
<script setup> <script setup>
import { import { reactive, nextTick, ref } from 'vue';
reactive, import { announcement, messageselectMessage, courseselectCourse } from '@/api/index/index.js';
nextTick import { onLoad, onReady, onReachBottom, onShow } from '@dcloudio/uni-app';
} from 'vue'; import contentlist from './components/contentlist.vue';
import { import { selectNewApp } from '@/api/user/user.js';
announcement, import config from '@/commons/config.js';
messageselectMessage, import { linkTo } from '@/utils/app.js';
courseselectCourse import { useCommonStore } from '@/store/common.js';
} from '@/api/index/index.js' const $common = useCommonStore();
import { onShow(() => {
onLoad,
onReady,
onReachBottom,
onShow
} from '@dcloudio/uni-app'
import contentlist from './components/contentlist.vue'
import {
selectNewApp
} from '@/api/user/user.js';
import config from '@/commons/config.js';
import {
linkTo
} from '@/utils/app.js';
import {
useCommonStore
} from '@/store/common.js'
const $common = useCommonStore()
onShow(() => {
// console.log('cash:' + uni.getStorageSync('userInfo').userId + "" + new Date().getTime(), 'debug') // console.log('cash:' + uni.getStorageSync('userInfo').userId + "" + new Date().getTime(), 'debug')
// 判断ios是否审核 // 判断ios是否审核
$common.init() $common.init();
// #ifdef H5 // #ifdef H5
datas.isExamine = $common.isIosExamine datas.isExamine = $common.isIosExamine;
// #endif // #endif
// let sysInfo = uni.getSystemInfoSync() // let sysInfo = uni.getSystemInfoSync()
// let isIos = sysInfo.platform == 'ios' // let isIos = sysInfo.platform == 'ios'
@@ -116,111 +107,151 @@
// datas.setindexdata = $common.setversion // datas.setindexdata = $common.setversion
// console.log(datas.setindexdata,'seaeasdas') // console.log(datas.setindexdata,'seaeasdas')
// } // }
}) getrecomVideo();
let datas = reactive({ });
const disableMaskVisable = ref(false);
let datas = reactive({
noticeList: [], //公告列表 noticeList: [], //公告列表
active: 1, // 最新、最热。。。切换顶部导航栏 active: 1, // 最新、最热。。。切换顶部导航栏
list: [], // 底部短剧内容 list: [], // 底部短剧内容
page: 1, // 首页推荐分页 page: 1, // 首页推荐分页
stopShow:true,//h5关闭弹窗 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: '',
content: "", content: '',
confirmText: "", confirmText: '',
cancelText: "", cancelText: '',
downloadLink: "" downloadLink: ''
}, },
setindexdata: false setindexdata: false,
}) cloneNum: 0
onLoad(() => { });
versionUpdate() onLoad(() => {
getMsg() versionUpdate();
getrecomVideo() getMsg();
}) });
onReady(() => { onReady(() => {
if (!uni.getStorageSync('ruleShow')) { if (!uni.getStorageSync('ruleShow')) {
announcement({ announcement({
type: 0 type: 0
}).then(res => { })
.then((res) => {
if (res) { if (res) {
datas.ruleShow = true datas.ruleShow = true;
datas.ruleList = res datas.ruleList = res;
ruleInit() ruleInit();
} }
}) })
.catch((err) => {
console.log(err);
});
} }
});
onReachBottom(() => {
++datas.page;
getrecomVideo();
});
// 公告
async function getMsg() {
let res = await messageselectMessage();
let arr = [];
let ids = uni.getStorageSync('ids');
res.list.forEach((ele) => {
if (ids.length) {
if (ids.indexOf(ele.id) == -1) {
arr.push(ele);
}
} else {
uni.setStorageSync('ids', [res.list[0].id]);
arr.push(ele);
}
});
datas.noticeList = arr;
if (arr.length) {
if (ids.length) {
uni.setStorageSync('ids', [...uni.getStorageSync('ids'), datas.noticeList[datas.cloneNum].id]);
}
datas.stopShows = true;
}
}
}) function confirmEvent() {
onReachBottom(() => { datas.stopShows = false;
++datas.page if (datas.cloneNum < datas.noticeList.length - 1) {
getrecomVideo() ++datas.cloneNum;
}) uni.setStorageSync('ids', [...uni.getStorageSync('ids'), datas.noticeList[datas.cloneNum].id]);
datas.stopShows = true;
}
}
function stopConfirm(){ function stopConfirm() {
datas.stopShow=false datas.stopShow = false;
uni.navigateTo({ uni.navigateTo({
url:'/pages/login/download' url: '/pages/login/download'
}) });
} }
function stopCancel(){
datas.stopShow=false function stopCancel() {
} datas.stopShow = false;
function versionUpdate() { }
function versionUpdate() {
//#ifdef APP-PLUS //#ifdef APP-PLUS
plus.screen.lockOrientation('portrait-primary'); //竖屏正方向锁定 plus.screen.lockOrientation('portrait-primary'); //竖屏正方向锁定
//获取当前系统版本信息 //获取当前系统版本信息
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);
datas.isExamine = $common.isIosExamine datas.isExamine = $common.isIosExamine;
console.log(isVersion, '') console.log(isVersion, '');
if (isVersion == 1) { 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() uni.hideTabBar();
if (res.method == "true") { if (res.method == 'true') {
datas.version.confirmText = "立即更新" datas.version.confirmText = '立即更新';
} else { } else {
datas.version.confirmText = "立即更新" datas.version.confirmText = '立即更新';
datas.version.cancelText = "下次更新" datas.version.cancelText = '下次更新';
} }
} }
}); });
}); });
//#endif //#endif
} }
function cancelUpdateVersion() { function cancelUpdateVersion() {
uni.showTabBar() uni.showTabBar();
datas.version.show = false 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');
return return;
uni.showLoading({ uni.showLoading({
title: '下载中...', title: '下载中...',
mask: true mask: true
@@ -228,20 +259,20 @@
if (uni.getSystemInfoSync().platform == 'android') { if (uni.getSystemInfoSync().platform == 'android') {
uni.downloadFile({ uni.downloadFile({
url: datas.version.downloadLink, url: datas.version.downloadLink,
success: downloadResult => { success: (downloadResult) => {
console.log(downloadResult) console.log(downloadResult);
if (downloadResult.statusCode === 200) { if (downloadResult.statusCode === 200) {
plus.runtime.install( plus.runtime.install(
downloadResult.tempFilePath, { downloadResult.tempFilePath,
{
force: false force: false
}, },
d => { (d) => {
console.log('install success...'); console.log('install success...');
plus.runtime plus.runtime.restart();
.restart();
}, },
e => { (e) => {
console.log(e) console.log(e);
console.error('install fail...'); console.error('install fail...');
} }
); );
@@ -250,80 +281,86 @@
}); });
} }
if (uni.getSystemInfoSync().platform == 'ios') { if (uni.getSystemInfoSync().platform == 'ios') {
plus.runtime.openURL(datas.version.downloadLink, function(res) {}); plus.runtime.openURL(datas.version.downloadLink, function (res) {});
}
} }
}
function ruleInit() { function ruleInit() {
datas.rule_title = datas.ruleList[datas.ruleIndex].title datas.rule_title = datas.ruleList[datas.ruleIndex].title;
datas.rule_content = datas.ruleList[datas.ruleIndex].content datas.rule_content = datas.ruleList[datas.ruleIndex].content;
} }
/** /**
* 规则确认 * 规则确认
*/ */
function ruleConfirm() { function ruleConfirm() {
datas.ruleShow = false datas.ruleShow = false;
datas.ruleIndex++ datas.ruleIndex++;
if (datas.ruleIndex >= datas.ruleList.length) { if (datas.ruleIndex >= datas.ruleList.length) {
datas.ruleIndex = 0 datas.ruleIndex = 0;
uni.setStorageSync('ruleShow', true) uni.setStorageSync('ruleShow', true);
return return;
}
setTimeout(res => {
ruleInit()
datas.ruleShow = true
}, 300)
} }
setTimeout((res) => {
ruleInit();
datas.ruleShow = true;
}, 300);
}
// 跳转公告链接 // 跳转公告链接
function goMsg(url) { function goMsg(url) {
uni.navigateTo({ uni.navigateTo({
url: '/pages/index/prizeDraw/kevy-luckydraw' url: '/pages/index/prizeDraw/kevy-luckydraw'
}); });
} }
// 搜索跳转 // 搜索跳转
function moreVideo() { function moreVideo() {
uni.navigateTo({ uni.navigateTo({
url: '/pages/index/search/index' url: '/pages/index/search/index'
}); });
} }
// 公告
async function getMsg() { //获取推荐视频
let res = await messageselectMessage() async function getrecomVideo(sort, active = 1) {
datas.noticeList = res.list try {
} datas.active = active;
//获取推荐视频
async function getrecomVideo(sort, active = 1) {
datas.active = active
if (sort) { if (sort) {
datas.page = 1 datas.page = 1;
} }
let res = await courseselectCourse({ let res = await courseselectCourse({
page: datas.page, page: datas.page,
limit: 12, limit: 12,
sort: sort, sort: sort,
classifyId: '' classifyId: ''
}) });
console.log('getrecomVideo===', res);
if (datas.page == 1) { if (datas.page == 1) {
datas.list = res.list datas.list = res.list;
} else { } else {
datas.list = [...datas.list, ...res.list] datas.list = [...datas.list, ...res.list];
}
} catch (error) {
console.log('getrecomVideo.error===', error);
if (error.code == 702) {
disableMaskVisable.value = true;
} else {
disableMaskVisable.value = false;
} }
} }
}
</script> </script>
<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;
} }
.indexStyleTwo { .indexStyleTwo {
@@ -332,12 +369,12 @@
justify-content: space-between; justify-content: space-between;
padding: 88rpx 25rpx; padding: 88rpx 25rpx;
>image { > image {
width: 187rpx; width: 187rpx;
height: 50rpx; height: 50rpx;
} }
>view { > view {
z-index: 50; z-index: 50;
width: 236rpx; width: 236rpx;
line-height: 43rpx; line-height: 43rpx;
@@ -353,12 +390,12 @@
.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, 0.65);
display: flex; display: flex;
align-items: center; align-items: center;
padding: 12rpx; padding: 12rpx;
@@ -367,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;
} }
@@ -380,23 +417,22 @@
width: 80%; width: 80%;
} }
} }
}
} .navTop-active {
.navTop-active {
color: #cb5d68; color: #cb5d68;
} }
.navTop { .navTop {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
padding: 0 20rpx; padding: 0 20rpx;
>view { > view {
background-color: #f0f0f0; background-color: #f0f0f0;
margin-left: 20rpx; margin-left: 20rpx;
padding: 6rpx 20rpx padding: 6rpx 20rpx;
}
} }
}
</style> </style>

View File

@@ -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;

View File

@@ -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
View 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>

View File

@@ -1,134 +1,149 @@
<template> <template>
<view class="container"> <view class="container">
<view class="bg" > <view class="bg">
<image src="../../static/default/i_bg.png" style="width: 100%;height:100%" mode="aspectFill"></image> <image src="../../static/default/i_bg.png" style="width: 100%; height: 100%" mode="aspectFill"></image>
</view> </view>
<view class="wrapper u-relative" style="padding-top: 48rpx;box-sizing: border-box;"> <view class="wrapper u-relative" style="padding-top: 48rpx; box-sizing: border-box">
<view class="nav" style="width: 100%;height: 96rpx;"></view> <view class="nav" style="width: 100%; height: 96rpx"></view>
<view class="input-content"> <view class="input-content">
<view style="font-size: 58rpx;font-weight: bold;color: #333;margin-bottom: 48rpx;">注册</view> <view style="font-size: 58rpx; font-weight: bold; color: #333; margin-bottom: 48rpx">注册</view>
<view class="cu-form-group"> <view class="cu-form-group">
<view class="title">手机号</view> <view class="title">手机号</view>
<view class="input" style="padding-left: 20rpx;"> <view class="input" style="padding-left: 20rpx">
<input class="input" type="number" :value="data.mobile" placeholder="请输入手机号" maxlength="11" data-key="mobile" <input class="input" type="number" :value="data.mobile" placeholder="请输入手机号" maxlength="11" data-key="mobile" @input="inputChange" />
@input="inputChange" />
</view> </view>
</view> </view>
<view class="cu-form-group"> <view class="cu-form-group">
<text class="title">验证码</text> <text class="title">验证码</text>
<view class="input flex" style="padding-left: 20rpx;padding-right: 20rpx;"> <view class="input flex" style="padding-left: 20rpx; padding-right: 20rpx">
<input type="number" :value="data.code" placeholder="请输入验证码" maxlength="6" data-key="code" <input type="number" :value="data.code" placeholder="请输入验证码" maxlength="6" data-key="code" @input="inputChange" @confirm="toRegister" />
@input="inputChange" @confirm="toRegister" />
<button class="send-msg" @click="sendMsg" :disabled="data.sending">{{ data.sendTime }}</button> <button class="send-msg" @click="sendMsg" :disabled="data.sending">{{ data.sendTime }}</button>
</view> </view>
</view> </view>
<view class="cu-form-group"> <view class="cu-form-group">
<text class="title">设置密码</text> <text class="title">设置密码</text>
<view class="input" style="padding-left: 20rpx;"> <view class="input" style="padding-left: 20rpx">
<input class="input" type="password" :value="data.password" placeholder="请设置新密码" placeholder-class="input-empty" <input
maxlength="20" minlength="6" data-key="password" @input="inputChange" @confirm="toRegister" /> class="input"
type="password"
:value="data.password"
placeholder="请设置新密码"
placeholder-class="input-empty"
maxlength="20"
minlength="6"
data-key="password"
@input="inputChange"
@confirm="toRegister"
/>
</view> </view>
</view> </view>
<button class="confirm-btn" @click="toRegister">注册</button> <button class="confirm-btn" @click="toRegister">注册</button>
<button class="confirm-btn" @click="toLogin">登录</button> <button class="confirm-btn" @click="toLogin">登录</button>
</view> </view>
<view class="footerView"> <view class="footerView">
<u-checkbox-group> <u-checkbox-group>
<u-checkbox v-model="data.checked" label-size='24upx' shape="circle" @change="radioChange"></u-checkbox> <u-checkbox v-model="data.checked" label-size="24upx" shape="circle" @change="radioChange"></u-checkbox>
</u-checkbox-group> </u-checkbox-group>
<view>注册即同意</view> <view>注册即同意</view>
<!-- 协议地址 --> <!-- 协议地址 -->
<view @click="linkTo('/pages/me/privacy')" style="color: #37A6FF;">隐私政策</view> <view @click="linkTo('/pages/me/privacy')" style="color: #37a6ff">隐私政策</view>
<view @click="linkTo('/pages/me/agreement')" style="color: #37A6FF;">用户服务协议</view> <view @click="linkTo('/pages/me/agreement')" style="color: #37a6ff">用户服务协议</view>
</view> </view>
</view> </view>
</view> </view>
</template> </template>
<script setup> <script setup>
import { reactive } from 'vue'; import { reactive } from 'vue';
import { onLoad} from '@dcloudio/uni-app' import { onLoad } from '@dcloudio/uni-app';
import {setSendMsg,register} from '@/api/login/login.js'; import { setSendMsg, register } from '@/api/login/login.js';
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({ let data = reactive({
code: '', code: '',
mobile: '', mobile: '',
password: '', password: '',
sending: false, sending: false,
sendTime: '获取验证码', sendTime: '获取验证码',
count: 60, count: 60,
relation: "", relation: '',
invitation: '', invitation: '',
isregisterCode: '', isregisterCode: '',
qdCodeion: '', //渠道码 qdCodeion: '', //渠道码
checked: false, checked: false
}) });
onLoad(async ( options ) => { onLoad(async (options) => {
if (uni.getStorageSync('qdCodeion')) { data.qdCodeion = uni.getStorageSync('qdCodeion') } let localQdCodeion = uni.getStorageSync('qdCodeion');
if (options.qdCode) { data.qdCodeion = options.qdCode } if (localQdCodeion && localQdCodeion != 'null') {
if (options.invitation ) { data.invitation = options.invitation } data.qdCodeion = localQdCodeion;
}
if (options.qdCode && options.qdCode != 'null') {
data.qdCodeion = options.qdCode;
}
if (options.invitation) {
data.invitation = options.invitation;
}
let res = await commonType(3) console.log('localQdCodeion===', localQdCodeion);
data.isregisterCode = res.value console.log('options.qdCode===', typeof options.qdCode);
})
/** let res = await commonType(3);
data.isregisterCode = res.value;
});
/**
* 发送验证码 * 发送验证码
*/ */
async function sendMsg () { async function sendMsg() {
try {
if (!data.mobile) { if (!data.mobile) {
uni.showToast({ uni.showToast({
title: '请输入手机号', title: '请输入手机号',
icon: 'none', icon: 'none'
}) });
} else if (data.mobile.length !== 11) { } else if (data.mobile.length !== 11) {
uni.showToast({ uni.showToast({
title: '请输入正确的手机号', title: '请输入正确的手机号',
icon: 'none', icon: 'none'
}) });
} else { } else {
uni.showLoading({ uni.showLoading({
title: '正在发送验证码...' title: '正在发送验证码...'
}) });
let res = await setSendMsg(data.mobile,'login') let res = await setSendMsg(data.mobile, 'login');
uni.hideLoading();
uni.hideToast(); console.log(res);
if( res ){
data.sending = true; data.sending = true;
uni.showToast({ uni.showToast({
title: '验证码发送成功请注意查收', title: '验证码发送成功请注意查收',
icon: 'none', icon: 'none',
duration: 1000 duration: 1000
}) });
countDown(); countDown();
} else { }
uni.showModal({ } catch (error) {
showCancel: false, console.log(error);
title: '短信发送失败', uni.showToast({
content: '请一分钟后再获取验证码' title: error.message,
icon: 'none',
duration: 1000
}); });
} }
uni.hideLoading();
}
} /**
}
/**
* 验证码倒计时 * 验证码倒计时
*/ */
function countDown() { function countDown() {
console.log(data.count) console.log(data.count);
if (data.count === 1) { if (data.count === 1) {
data.count = 60; data.count = 60;
data.sending = false; data.sending = false;
@@ -139,130 +154,120 @@
data.sendTime = data.count - 1 + '秒后重新获取'; data.sendTime = data.count - 1 + '秒后重新获取';
setTimeout(countDown.bind(this), 1000); setTimeout(countDown.bind(this), 1000);
} }
} }
/** /**
* 获取注册值 * 获取注册值
* @param {Object} e * @param {Object} e
*/ */
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;
} }
/** /**
* 是否同意协议 * 是否同意协议
* @param {Object} e * @param {Object} e
*/ */
function radioChange(e) { function radioChange(e) {
data.checked = e data.checked = e;
} }
/** /**
* 登录 * 登录
*/ */
function toLogin() { function toLogin() {
uni.reLaunch({ uni.reLaunch({
url: '/pages/login/login' url: '/pages/login/login'
}); });
} }
/**
/**
* 注册 * 注册
*/ */
async function toRegister() { async function toRegister() {
const { const { mobile, password, code, checked, invitation, isregisterCode, qdCodeion } = data;
mobile,
password,
code,
checked,
invitation,
isregisterCode,
qdCodeion
} = data;
if (!mobile) { if (!mobile) {
uni.showToast({ uni.showToast({
title: '请输入账号', title: '请输入账号',
icon: 'none', icon: 'none',
duration: 1000 duration: 1000
}) });
return return;
} }
if (!code) { if (!code) {
uni.showToast({ uni.showToast({
title: '请输入验证码', title: '请输入验证码',
icon: 'none', icon: 'none',
duration: 1000 duration: 1000
}) });
return return;
} }
if (!password) { if (!password) {
uni.showToast({ uni.showToast({
title: '请设置密码', title: '请设置密码',
icon: 'none', icon: 'none',
duration: 1000 duration: 1000
}) });
return return;
} }
if (password.length < 6) { if (password.length < 6) {
uni.showToast({ uni.showToast({
title: '密码位数必须大于六位', title: '密码位数必须大于六位',
icon: 'none', icon: 'none',
duration: 1000 duration: 1000
}) });
return return;
} }
if (invitation.length == 0 && isregisterCode == '是') { if (invitation.length == 0 && isregisterCode == '是') {
uni.showToast({ uni.showToast({
title: '请输入邀请码', title: '请输入邀请码',
icon: 'none', icon: 'none',
duration: 1000 duration: 1000
}) });
return return;
} }
if (!checked) { if (!checked) {
uni.showToast({ uni.showToast({
title: '请先同意《隐私政策》和《用户协议》', title: '请先同意《隐私政策》和《用户协议》',
icon: 'none', icon: 'none',
duration: 1000 duration: 1000
}) });
return return;
} }
data.logining = true; data.logining = true;
uni.showLoading({ uni.showLoading({
title: '注册中...' title: '注册中...'
}) });
let platform = '' let platform = '';
// #ifdef APP // #ifdef APP
platform = 'app' platform = 'app';
// #endif // #endif
// #ifdef H5 // #ifdef H5
platform = 'h5' platform = 'h5';
// #endif // #endif
let res = await register({ let res = await register({
password: password, password: password,
phone: mobile, phone: mobile,
msg: code, msg: code,
inviterCode: invitation, inviterCode: invitation,
platform: platform, platform: platform,
qdCode: qdCodeion, qdCode: qdCodeion
}) });
if (res.code === 0) { if (res.code === 0) {
uni.setStorageSync('token', res.token) uni.setStorageSync('token', res.token);
uni.setStorageSync('userInfo', res.user) uni.setStorageSync('userInfo', res.user);
uni.showToast({ uni.showToast({
title: '注册成功', title: '注册成功',
icon: 'none' icon: 'none'
}) });
setTimeout(function() { setTimeout(function () {
uni.switchTab({ uni.switchTab({
url: '/pages/index/index' url: '/pages/index/index'
}); });
}, 1000) }, 1000);
} else { } else {
uni.showModal({ uni.showModal({
showCancel: false, showCancel: false,
@@ -271,34 +276,32 @@
}); });
} }
uni.hideLoading(); uni.hideLoading();
}
}
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
page { page {
background: #ffffff; background: #ffffff;
} }
*{ * {
box-sizing: border-box; box-sizing: border-box;
} }
.bg{ .bg {
position: absolute; position: absolute;
width: 100%; width: 100%;
height: 100%; height: 100%;
overflow: hidden; overflow: hidden;
top: 0; top: 0;
} }
.wrapper{ .wrapper {
position: relative; position: relative;
padding-top: 48rpx; padding-top: 48rpx;
box-sizing: border-box; box-sizing: border-box;
} }
.flex{ .flex {
display: flex; display: flex;
} }
.footerView { .footerView {
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
@@ -306,68 +309,68 @@
font-size: 24rpx; font-size: 24rpx;
color: #333333; color: #333333;
margin-top: 50rpx; margin-top: 50rpx;
}
} .cuIcon::before {
.cuIcon::before{
width: 30rpx; width: 30rpx;
height: 30rpx; height: 30rpx;
margin-right: 12rpx; margin-right: 12rpx;
} }
.cuIcon-round::before { .cuIcon-round::before {
content: "\e6d7"; content: '\e6d7';
} }
.cuIcon-radiobox:before { .cuIcon-radiobox:before {
content: "\e75b"; content: '\e75b';
color: #37A6FF; color: #37a6ff;
} }
.send-msg { .send-msg {
flex-shrink: 0;
line-height: initial; line-height: initial;
font-weight: 400; font-weight: 400;
font-size: 28rpx; font-size: 28rpx;
color: #EC6F48; color: #ec6f48;
border: none; border: none;
background-color: transparent; background-color: transparent;
margin: 0; margin: 0;
padding: 0; padding: 0;
} white-space: nowrap;
.send-msg::after{ }
.send-msg::after {
border: none; border: none;
background-color: transparent; background-color: transparent;
} }
.container {
.container {
position: relative; position: relative;
width: 100%; width: 100%;
height: 100%; height: 100%;
overflow: hidden; overflow: hidden;
background: #ffffff; background: #ffffff;
box-sizing: border-box; box-sizing: border-box;
} }
.wrapper { .wrapper {
min-height: 100vh; min-height: 100vh;
position: relative; position: relative;
z-index: 90; z-index: 90;
} }
.input-content { .input-content {
padding: 0 56rpx; padding: 0 56rpx;
} }
.cu-form-group{ .cu-form-group {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: flex-start; align-items: flex-start;
margin-bottom: 48rpx; margin-bottom: 48rpx;
background-color: transparent; background-color: transparent;
padding: 0; padding: 0;
.title{ .title {
margin-bottom: 32rpx; margin-bottom: 32rpx;
font-weight: 400; font-weight: 400;
font-size: 28rpx; font-size: 28rpx;
color: #333333; color: #333333;
} }
.input{ .input {
width: 100%; width: 100%;
// height: 84rpx; // height: 84rpx;
// line-height: 84rpx; // line-height: 84rpx;
@@ -377,28 +380,28 @@
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
input{ input {
height: 84rpx!important; height: 84rpx !important;
}
v-deep .uni-input-input{
height: 84rpx!important;
} }
v-deep .uni-input-input {
height: 84rpx !important;
} }
} }
}
.confirm-btn { .confirm-btn {
width: 100%; width: 100%;
height: 100rpx; height: 100rpx;
text-align: center; text-align: center;
line-height: 100rpx; line-height: 100rpx;
border-radius: 16rpx; border-radius: 16rpx;
margin-top: 40rpx; margin-top: 40rpx;
background: #EC6F48; background: #ec6f48;
font-size: 32rpx; font-size: 32rpx;
color: #FFFFFF; color: #ffffff;
&:after { &:after {
border: none; border: none;
} }
} }
</style> </style>

View File

@@ -1,30 +1,37 @@
<template> <template>
<view class="container"> <view class="container">
<view class="bg" > <view class="bg">
<image src="../../static/default/i_bg.png" style="width: 100%;height:100%" mode="aspectFill"></image> <image src="../../static/default/i_bg.png" style="width: 100%; height: 100%" mode="aspectFill"></image>
</view> </view>
<view class="wrapper u-relative" style="padding-top: 48rpx;box-sizing: border-box;"> <view class="wrapper u-relative" style="padding-top: 48rpx; box-sizing: border-box">
<view class="input-content"> <view class="input-content">
<view style="font-size: 58rpx;font-weight: bold;color: #333;margin-bottom: 48rpx;">注册</view> <view style="font-size: 58rpx; font-weight: bold; color: #333; margin-bottom: 48rpx">注册</view>
<view class="cu-form-group" > <view class="cu-form-group">
<view class="title">手机号</view> <view class="title">手机号</view>
<input class="input" type="number" :value="mobile" placeholder="请输入手机号" maxlength="11" data-key="mobile" <input class="input" type="number" :value="mobile" placeholder="请输入手机号" maxlength="11" data-key="mobile" @input="inputChange" />
@input="inputChange" />
</view> </view>
<view class="cu-form-group" > <view class="cu-form-group">
<text class="title">验证码</text> <text class="title">验证码</text>
<view class="input flex"> <view class="input flex">
<input type="number" :value="code" placeholder="请输入验证码" maxlength="6" data-key="code" <input type="number" :value="code" placeholder="请输入验证码" maxlength="6" data-key="code" @input="inputChange" @confirm="toLogin" />
@input="inputChange" @confirm="toLogin" />
<button class="send-msg" @click="sendMsg" :disabled="sending">{{ sendTime }}</button> <button class="send-msg" @click="sendMsg" :disabled="sending">{{ sendTime }}</button>
</view> </view>
</view> </view>
<view class="cu-form-group" > <view class="cu-form-group">
<text class="title">设置密码</text> <text class="title">设置密码</text>
<input class="input" type="password" :value="password" placeholder="请设置新密码" placeholder-class="input-empty" <input
maxlength="20" minlength="6" data-key="password" @input="inputChange" @confirm="toLogin" /> class="input"
type="password"
:value="password"
placeholder="请设置新密码"
placeholder-class="input-empty"
maxlength="20"
minlength="6"
data-key="password"
@input="inputChange"
@confirm="toLogin"
/>
</view> </view>
<!-- <view class="cu-form-group" <!-- <view class="cu-form-group"
style="border: 2upx solid whitesmoke;margin-bottom: 20px;border-radius: 30px"> style="border: 2upx solid whitesmoke;margin-bottom: 20px;border-radius: 30px">
@@ -39,102 +46,102 @@
</view> </view>
<view class="footerView"> <view class="footerView">
<u-checkbox-group> <u-checkbox-group>
<u-checkbox v-model="checked" label-size='24upx' shape="circle" @change="radioChange"></u-checkbox> <u-checkbox v-model="checked" label-size="24upx" shape="circle" @change="radioChange"></u-checkbox>
</u-checkbox-group> </u-checkbox-group>
<view>同意</view> <view>同意</view>
<!-- 协议地址 --> <!-- 协议地址 -->
<navigator url="/me/setting/mimi" open-type="navigate" style="color: #37A6FF;">隐私政策</navigator> <navigator url="/me/setting/mimi" open-type="navigate" style="color: #37a6ff">隐私政策</navigator>
<navigator url="/me/setting/xieyi" open-type="navigate" style="color: #37A6FF;">用户协议</navigator> <navigator url="/me/setting/xieyi" open-type="navigate" style="color: #37a6ff">用户协议</navigator>
</view> </view>
</view> </view>
</view> </view>
</template> </template>
<script setup> <script setup>
import { reactive } from 'vue'; import { reactive } from 'vue';
import { onLoad} from '@dcloudio/uni-app' import { onLoad } from '@dcloudio/uni-app';
import http from '@/http/http.js'; import http from '@/http/http.js';
let data = reactive({ let data = reactive({
code: '', code: '',
mobile: '', mobile: '',
password: '', password: '',
sending: false, sending: false,
sendTime: '获取验证码', sendTime: '获取验证码',
count: 60, count: 60,
relation: "", relation: '',
invitation: '', invitation: '',
registerCode: '', registerCode: '',
qdCodeion: '', //渠道码 qdCodeion: '', //渠道码
checked: false, checked: false
}) });
onLoad(( options ) => { onLoad((options) => {
let relation = e.invitation let relation = e.invitation;
if (relation) { if (relation) {
this.relation = relation; this.relation = relation;
this.invitation = relation; this.invitation = relation;
} }
if (e.qdCode) { if (e.qdCode) {
this.qdCodeion = e.qdCode this.qdCodeion = e.qdCode;
} }
http.request({ http.request({
url:'app/common/type/3', url: 'app/common/type/3',
}).then(res => { data: {
type: 3
}
}).then((res) => {
if (res.code == 0) { if (res.code == 0) {
this.registerCode = res.data.value this.registerCode = res.data.value;
} }
}); });
}) });
/** /**
* 是否同意协议 * 是否同意协议
* @param {Object} e * @param {Object} e
*/ */
function radioChange(e) { function radioChange(e) {
this.checked = e this.checked = e;
} }
function showMa() { function showMa() {
//查询官方邀请码 //查询官方邀请码
this.$Request.getT('/common/type/88').then(res => { this.$Request.getT('/common/type/88', { type: 88 }).then((res) => {
if (res.code == 0) { if (res.code == 0) {
this.invitation = res.data.value; this.invitation = res.data.value;
} }
}); });
} }
function sendMsg() { function sendMsg() {
const { const { mobile } = this;
mobile
} = this;
if (!mobile) { if (!mobile) {
uni.showToast({ uni.showToast({
title: '请输入手机号', title: '请输入手机号',
icon: 'none', icon: 'none',
duration: 1000 duration: 1000
}) });
} else if (mobile.length !== 11) { } else if (mobile.length !== 11) {
uni.showToast({ uni.showToast({
title: '请输入正确的手机号', title: '请输入正确的手机号',
icon: 'none', icon: 'none',
duration: 1000 duration: 1000
}) });
} else { } else {
uni.showLoading({ uni.showLoading({
title: '正在发送验证码...' title: '正在发送验证码...'
}) });
http.request({ http.request({
url:'app/Login/sendMsg/' + mobile + '/login', url: 'app/Login/sendMsg/' + mobile + '/login'
}).then(res => { }).then((res) => {
if (res.code === 0) { if (res.code === 0) {
this.sending = true; this.sending = true;
uni.showToast({ uni.showToast({
title: '验证码发送成功请注意查收', title: '验证码发送成功请注意查收',
icon: 'none', icon: 'none',
duration: 1000 duration: 1000
}) });
this.countDown(); this.countDown();
} else { } else {
uni.showModal({ uni.showModal({
@@ -145,14 +152,11 @@
} }
uni.hideLoading(); uni.hideLoading();
}) });
} }
} }
function countDown() { function countDown() {
const { const { count } = this;
count
} = this;
if (count === 1) { if (count === 1) {
this.count = 60; this.count = 60;
this.sending = false; this.sending = false;
@@ -163,113 +167,104 @@
this.sendTime = count - 1 + '秒后重新获取'; this.sendTime = count - 1 + '秒后重新获取';
setTimeout(this.countDown.bind(this), 1000); setTimeout(this.countDown.bind(this), 1000);
} }
} }
function inputChange(e) { function inputChange(e) {
const key = e.currentTarget.dataset.key; const key = e.currentTarget.dataset.key;
this[key] = e.detail.value; this[key] = e.detail.value;
} }
function toLogin() { function toLogin() {
console.log("123"); console.log('123');
uni.reLaunch({ uni.reLaunch({
url: '/pages/login/login' url: '/pages/login/login'
}); });
} }
function toRegister() { function toRegister() {
const { const { mobile, password, code, checked, invitation, registerCode, qdCodeion } = this;
mobile,
password,
code,
checked,
invitation,
registerCode,
qdCodeion
} = this;
if (!mobile) { if (!mobile) {
uni.showToast({ uni.showToast({
title: '请输入账号', title: '请输入账号',
icon: 'none', icon: 'none',
duration: 1000 duration: 1000
}) });
return return;
} }
if (!code) { if (!code) {
uni.showToast({ uni.showToast({
title: '请输入验证码', title: '请输入验证码',
icon: 'none', icon: 'none',
duration: 1000 duration: 1000
}) });
return return;
} }
if (!password) { if (!password) {
uni.showToast({ uni.showToast({
title: '请设置密码', title: '请设置密码',
icon: 'none', icon: 'none',
duration: 1000 duration: 1000
}) });
return return;
} }
if (password.length < 6) { if (password.length < 6) {
uni.showToast({ uni.showToast({
title: '密码位数必须大于六位', title: '密码位数必须大于六位',
icon: 'none', icon: 'none',
duration: 1000 duration: 1000
}) });
return return;
} }
if (invitation.length == 0 && registerCode == '是') { if (invitation.length == 0 && registerCode == '是') {
uni.showToast({ uni.showToast({
title: '请输入邀请码', title: '请输入邀请码',
icon: 'none', icon: 'none',
duration: 1000 duration: 1000
}) });
return return;
} }
if (!checked) { if (!checked) {
uni.showToast({ uni.showToast({
title: '请先同意《隐私政策》和《用户协议》', title: '请先同意《隐私政策》和《用户协议》',
icon: 'none', icon: 'none',
duration: 1000 duration: 1000
}) });
return return;
} }
this.logining = true; this.logining = true;
uni.showLoading({ uni.showLoading({
title: '注册中...' title: '注册中...'
}) });
let platform = '' let platform = '';
// #ifdef APP // #ifdef APP
platform = 'app' platform = 'app';
// #endif // #endif
// #ifdef H5 // #ifdef H5
platform = 'h5' platform = 'h5';
// #endif // #endif
http.request({ http.request({
url: 'app/Login/registerCode?password=' + password + '&phone=' + mobile + '&msg=' + code + url: 'app/Login/registerCode?password=' + password + '&phone=' + mobile + '&msg=' + code + '&inviterCode=' + invitation + '&platform=' + platform + '&qdCode=' + qdCodeion,
'&inviterCode=' + invitation + '&platform=' + platform + '&qdCode=' + qdCodeion,
method: 'post' method: 'post'
}).then(res => { }).then((res) => {
if (res.code === 0) { if (res.code === 0) {
// this.$queue.remove('invitation'); // this.$queue.remove('invitation');
uni.setStorageSync('token', res.token) uni.setStorageSync('token', res.token);
uni.setStorageSync('userId', res.user.userId) uni.setStorageSync('userId', res.user.userId);
uni.setStorageSync('phone', res.user.phone) uni.setStorageSync('phone', res.user.phone);
uni.setStorageSync('invitationCode', res.user.invitationCode) uni.setStorageSync('invitationCode', res.user.invitationCode);
//设置渠道码 //设置渠道码
if (res.user.qdCode) { if (res.user.qdCode) {
uni.setStorageSync('qdCode', res.user.qdCode) uni.setStorageSync('qdCode', res.user.qdCode);
} }
uni.showToast({ uni.showToast({
title: '注册成功', title: '注册成功',
icon: 'none' icon: 'none'
}) });
setTimeout(function() { setTimeout(function () {
uni.navigateTo({ uni.navigateTo({
url: '/pages/login/appEq' url: '/pages/login/appEq'
}) });
}, 1000) }, 1000);
} else { } else {
uni.hideLoading(); uni.hideLoading();
uni.showModal({ uni.showModal({
@@ -279,32 +274,32 @@
}); });
} }
}); });
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
page { page {
background: #fff; background: #fff;
} }
*{ * {
box-sizing: border-box; box-sizing: border-box;
} }
.flex{ .flex {
display: flex; display: flex;
} }
.bg{ .bg {
position: absolute; position: absolute;
width: 100%; width: 100%;
height: 100%; height: 100%;
overflow: hidden; overflow: hidden;
top: 0; top: 0;
} }
.wrapper{ .wrapper {
position: relative; position: relative;
padding-top: 48rpx; padding-top: 48rpx;
box-sizing: border-box; box-sizing: border-box;
} }
.footerView { .footerView {
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
@@ -315,63 +310,63 @@
// left: 0; // left: 0;
// right: 0; // right: 0;
// bottom: 178rpx; // bottom: 178rpx;
.cuIcon::before{ .cuIcon::before {
width: 30rpx; width: 30rpx;
height: 30rpx; height: 30rpx;
margin-right: 12rpx; margin-right: 12rpx;
} }
.cuIcon-round::before { .cuIcon-round::before {
content: "\e6d7"; content: '\e6d7';
} }
.cuIcon-radiobox:before { .cuIcon-radiobox:before {
content: "\e75b"; content: '\e75b';
color: #37A6FF; color: #37a6ff;
}
} }
}
.send-msg { .send-msg {
line-height: initial; line-height: initial;
font-weight: 400; font-weight: 400;
font-size: 28rpx; font-size: 28rpx;
color: #EC6F48; color: #ec6f48;
border: none; border: none;
background-color: transparent!important; background-color: transparent !important;
} }
.send-msg::after{ .send-msg::after {
border: none; border: none;
background-color: transparent; background-color: transparent;
} }
.container { .container {
position: relative; position: relative;
width: 100%; width: 100%;
height: 100%; height: 100%;
overflow: hidden; overflow: hidden;
background: #fff; background: #fff;
} }
.wrapper { .wrapper {
position: relative; position: relative;
z-index: 90; z-index: 90;
min-height: 100vh; min-height: 100vh;
} }
.input-content { .input-content {
padding: 0 56rpx; padding: 0 56rpx;
.cu-form-group{ .cu-form-group {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: flex-start; align-items: flex-start;
margin-bottom: 48rpx; margin-bottom: 48rpx;
background-color: transparent; background-color: transparent;
padding: 0; padding: 0;
.title{ .title {
margin-bottom: 32rpx; margin-bottom: 32rpx;
font-weight: 400; font-weight: 400;
font-size: 28rpx; font-size: 28rpx;
color: #333333; color: #333333;
} }
.input{ .input {
width: 100%; width: 100%;
height: 84rpx; height: 84rpx;
line-height: 84rpx; line-height: 84rpx;
@@ -380,22 +375,21 @@
padding: 22rpx 32rpx 22rpx 24rpx; padding: 22rpx 32rpx 22rpx 24rpx;
} }
} }
} }
.confirm-btn {
.confirm-btn {
width: 100%; width: 100%;
height: 100rpx; height: 100rpx;
text-align: center; text-align: center;
line-height: 100rpx; line-height: 100rpx;
border-radius: 16rpx; border-radius: 16rpx;
margin-top: 40rpx; margin-top: 40rpx;
background: #EC6F48; background: #ec6f48;
font-size: 32rpx; font-size: 32rpx;
color: #FFFFFF; color: #ffffff;
&:after { &:after {
border: none; border: none;
} }
} }
</style> </style>

View File

@@ -14,7 +14,7 @@
<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_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>
@@ -29,7 +29,7 @@
<view class="title">我的追剧</view> <view class="title">我的追剧</view>
<view class="num">{{ likeData.collectCount }}</view> <view class="num">{{ likeData.collectCount }}</view>
</navigator> </navigator>
<view class="item" v-if="$common.isIosExamine" @click="linkTo('/pages/me/withdraw/index',true)"> <view class="item" v-if="$common.isIosExamine" @click="linkTo('/pages/me/withdraw/index', true)">
<view class="title">我的红包</view> <view class="title">我的红包</view>
<view class="num">{{ amount || 0 }}</view> <view class="num">{{ amount || 0 }}</view>
</view> </view>
@@ -44,7 +44,6 @@
<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">
@@ -72,8 +71,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 +98,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>
@@ -107,30 +113,64 @@
</view> </view>
</view> </view>
</view> </view>
<disable-mask v-if="disableShow"></disable-mask>
</template> </template>
<script setup> <script setup>
import { ref, reactive } from 'vue'; import { ref, reactive } from 'vue';
import { onLoad,onShow, onPullDownRefresh } from '@dcloudio/uni-app'; import { onLoad, onShow, onPullDownRefresh } from '@dcloudio/uni-app';
import { selectByUserId, collectVideoSummary, selectUserMoney } from '@/api/me/me.js'; import { selectByUserId, collectVideoSummary, selectUserMoney } from '@/api/me/me.js';
import { linkTo } from '@/utils/app.js'; import { linkTo } from '@/utils/app.js';
import { import { useCommonStore } from '@/store/common.js';
useCommonStore import { toBindWx, bindStatus } from '@/utils/wx.js';
} from '@/store/common.js'
const $common = useCommonStore() const disableShow = ref(false);
const $common = useCommonStore();
const userInfo = ref({}); const userInfo = ref({});
let isBindWx = ref(false);
async function bindwx() {
if (isBindWx.value) {
uni.showToast({
title: '已绑定微信,请勿重复绑定',
icon: 'none'
});
return;
}
isBindWx.value = await bindStatus();
console.log(isBindWx.value);
if (isBindWx.value) {
uni.showToast({
title: '已绑定微信,请勿重复绑定',
icon: 'none'
});
return;
} else {
toBindWx();
}
}
// 获取最近的三条观看历史 // 获取最近的三条观看历史
const recordThree = ref([]); const recordThree = ref([]);
onShow(()=>{ onShow(() => {
// 判断ios是否审核 // 判断ios是否审核
$common.init() $common.init();
}) });
async function selectByUserIdAjax() { async function selectByUserIdAjax() {
try { try {
const res = await selectByUserId({ page: 1, limit: 3, classify: 3 }); const res = await selectByUserId({
page: 1,
limit: 3,
classify: 3
});
recordThree.value = res.records; recordThree.value = res.records;
} catch (error) { } catch (error) {
if (error.code == 702) {
disableShow.value = true;
} else {
disableShow.value = false;
}
console.log(error); console.log(error);
} }
} }
@@ -164,9 +204,7 @@ async function selectUserMoneyAjax() {
// 跳转任务中心 // 跳转任务中心
function toTask() { function toTask() {
uni.switchTab({ linkTo('/pages/share/index');
url: '/pages/task/index'
});
} }
onPullDownRefresh(async () => { onPullDownRefresh(async () => {
@@ -180,13 +218,12 @@ onPullDownRefresh(async () => {
}); });
onShow(() => { onShow(() => {
if(uni.getStorageSync('token')){ if (uni.getStorageSync('token')) {
selectByUserIdAjax(); selectByUserIdAjax();
collectVideoSummaryAjax(); collectVideoSummaryAjax();
selectUserMoneyAjax(); selectUserMoneyAjax();
userInfo.value = uni.getStorageSync('userInfo'); userInfo.value = uni.getStorageSync('userInfo');
} }
}); });
</script> </script>
@@ -202,6 +239,7 @@ $bgColor: #f5f7ff;
font-size: 28upx; font-size: 28upx;
color: #333; color: #333;
} }
.top-bg { .top-bg {
width: 100%; width: 100%;
height: 50%; height: 50%;
@@ -209,6 +247,7 @@ $bgColor: #f5f7ff;
top: 0; top: 0;
left: 0; left: 0;
background: linear-gradient(90deg, #ffe5ea 0, #e4f5fb 49%, #fff0ee); background: linear-gradient(90deg, #ffe5ea 0, #e4f5fb 49%, #fff0ee);
&::after { &::after {
content: ''; content: '';
height: 50%; height: 50%;
@@ -219,24 +258,30 @@ $bgColor: #f5f7ff;
left: 0; left: 0;
} }
} }
.content { .content {
padding: 28upx; padding: 28upx;
position: relative; position: relative;
.user-info { .user-info {
.logo-wrap { .logo-wrap {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
.logo { .logo {
width: 160upx; width: 160upx;
.img { .img {
width: 100%; width: 100%;
display: block; display: block;
} }
} }
.quick-menu { .quick-menu {
display: flex; display: flex;
gap: 20upx; gap: 20upx;
.icon { .icon {
$size: 60upx; $size: 60upx;
width: $size; width: $size;
@@ -244,10 +289,12 @@ $bgColor: #f5f7ff;
} }
} }
} }
.top { .top {
display: flex; display: flex;
align-items: center; align-items: center;
padding-top: 40upx; padding-top: 40upx;
.avatar { .avatar {
$size: 94upx; $size: 94upx;
width: $size; width: $size;
@@ -255,6 +302,7 @@ $bgColor: #f5f7ff;
border-radius: 50%; border-radius: 50%;
margin-right: 12upx; margin-right: 12upx;
} }
.info-wrap { .info-wrap {
flex: 1; flex: 1;
display: flex; display: flex;
@@ -262,18 +310,22 @@ $bgColor: #f5f7ff;
font-size: 32upx; font-size: 32upx;
} }
} }
.btm { .btm {
display: flex; display: flex;
padding: 40upx 0; padding: 40upx 0;
.item { .item {
flex: 1; flex: 1;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
.title { .title {
font-size: 28upx; font-size: 28upx;
} }
.num { .num {
font-weight: bold; font-weight: bold;
display: flex; display: flex;
@@ -283,17 +335,20 @@ $bgColor: #f5f7ff;
} }
} }
} }
.card-wrap { .card-wrap {
background: #fff; background: #fff;
border-radius: 16upx; border-radius: 16upx;
overflow: hidden; overflow: hidden;
margin-bottom: 28upx; margin-bottom: 28upx;
.gold-wrap { .gold-wrap {
background: #f2b5b5; background: #f2b5b5;
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
padding: 20upx 28upx; padding: 20upx 28upx;
position: relative; position: relative;
// &::after { // &::after {
// $size: 40upx; // $size: 40upx;
// content: ''; // content: '';
@@ -310,17 +365,20 @@ $bgColor: #f5f7ff;
.left { .left {
display: flex; display: flex;
align-items: center; align-items: center;
.icon { .icon {
$size: 52upx; $size: 52upx;
width: $size; width: $size;
height: $size; height: $size;
margin-right: 20upx; margin-right: 20upx;
} }
.num { .num {
color: #fff; color: #fff;
font-size: 32upx; font-size: 32upx;
} }
} }
.btn { .btn {
color: #977641; color: #977641;
background: linear-gradient(90deg, #fee7bc 0%, #fdcc89 100%); background: linear-gradient(90deg, #fee7bc 0%, #fdcc89 100%);
@@ -333,17 +391,21 @@ $bgColor: #f5f7ff;
font-size: 24upx; font-size: 24upx;
} }
} }
.title-wrap { .title-wrap {
padding: 28upx; padding: 28upx;
.a { .a {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
.t { .t {
font-size: 28upx; font-size: 28upx;
} }
} }
} }
.history-list { .history-list {
padding: 0 28upx 28upx; padding: 0 28upx 28upx;
display: grid; display: grid;
@@ -351,12 +413,14 @@ $bgColor: #f5f7ff;
grid-template-rows: 1fr; grid-template-rows: 1fr;
grid-column-gap: 28upx; grid-column-gap: 28upx;
grid-row-gap: 28upx; grid-row-gap: 28upx;
.item { .item {
.cover { .cover {
width: 100%; width: 100%;
height: 280upx; height: 280upx;
border-radius: 20upx; border-radius: 20upx;
} }
.name { .name {
font-size: 28upx; font-size: 28upx;
width: 160upx; width: 160upx;
@@ -364,16 +428,19 @@ $bgColor: #f5f7ff;
text-overflow: ellipsis; text-overflow: ellipsis;
white-space: nowrap; white-space: nowrap;
} }
.t { .t {
color: #999; color: #999;
font-size: 24upx; font-size: 24upx;
} }
} }
} }
.menu-list { .menu-list {
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
padding: 28upx 0 0; padding: 28upx 0 0;
.item { .item {
flex: 0 0 25%; flex: 0 0 25%;
display: flex; display: flex;
@@ -381,11 +448,13 @@ $bgColor: #f5f7ff;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
margin-bottom: 32upx; margin-bottom: 32upx;
.icon { .icon {
$size: 56upx; $size: 56upx;
width: $size; width: $size;
height: $size; height: $size;
} }
.name { .name {
font-size: 24upx; font-size: 24upx;
margin-top: 8upx; margin-top: 8upx;

View File

@@ -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,15 +35,44 @@
</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';
import {
deleteUserByUserId
} from '@/api/me/me.js'
import {
useCommonStore
} from '@/store/common.js'
const version = ref('');
const token = ref('');
let isExamine = ref(false)
// 注销账号
function outuser() {
uni.showModal({
title: '注意',
content: '确定要注销账号吗?',
success: async (res) => {
if (res.confirm) {
let userInfo = uni.getStorageSync('userInfo')
let res = await deleteUserByUserId(userInfo.userId)
if (res.code == 0) {
uni.reLaunch({
url: '/pages/login/login'
});
}
}
}
});
}
// 退出登录
function logout() {
uni.showModal({ uni.showModal({
title: '注意', title: '注意',
content: '确定要退出登录吗?', content: '确定要退出登录吗?',
@@ -52,9 +85,9 @@ function logout() {
} }
} }
}); });
} }
const $common = useCommonStore()
onLoad(() => { onLoad(() => {
token.value = uni.getStorageSync('token'); token.value = uni.getStorageSync('token');
const systemInfo = uni.getSystemInfoSync(); const systemInfo = uni.getSystemInfoSync();
//#ifdef APP-PLUS //#ifdef APP-PLUS
@@ -63,16 +96,20 @@ onLoad(() => {
// #ifdef H5 // #ifdef H5
version.value = systemInfo.appVersion; version.value = systemInfo.appVersion;
// #endif // #endif
}); $common.init()
isExamine.value = $common.isIosExamine
});
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.container { .container {
font-size: 28upx; font-size: 28upx;
color: #555; color: #555;
} }
.list {
.list {
padding-bottom: 120upx; padding-bottom: 120upx;
.item { .item {
padding: 32upx 28upx; padding: 32upx 28upx;
border-bottom: 1upx solid #efefef; border-bottom: 1upx solid #efefef;
@@ -80,8 +117,9 @@ onLoad(() => {
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
} }
} }
.version {
.version {
width: 100%; width: 100%;
height: 120upx; height: 120upx;
display: flex; display: flex;
@@ -90,5 +128,5 @@ onLoad(() => {
bottom: 0; bottom: 0;
left: 0; left: 0;
color: #999; color: #999;
} }
</style> </style>

View File

@@ -8,10 +8,13 @@
<template #right-icon> <up-input border="none" v-model="data.zhiFuBao" placeholder="请输入要绑定的支付宝手机号"></up-input> </template> <template #right-icon> <up-input border="none" v-model="data.zhiFuBao" placeholder="请输入要绑定的支付宝手机号"></up-input> </template>
</up-cell> </up-cell>
</up-cell-group> </up-cell-group>
<view class="u-flex u-row-center">
<button class="confirm-btn" @click="toLogin" <button class="confirm-btn" @click="toLogin"
:disabled="data.logining">绑定账户</button> :disabled="data.logining">绑定账户</button>
<view style="font-size: 24upx;color: #999999;padding: 0 15rpx;margin-top: 32rpx;margin-bottom: 10rpx;">请正确填写收款人的支付宝账户和真实的收款人姓名</view> </view>
<view style="font-size: 24upx;color: #999999;padding: 0 15rpx">否则将无法正常收款请须知</view>
<view style="font-size: 24upx;color: #999999;padding: 0 15rpx;margin-top: 32rpx;margin-bottom: 10rpx;text-align: center;">请正确填写收款人的支付宝账户和真实的收款人姓名</view>
<view style="font-size: 24upx;color: #999999;padding: 0 15rpx;text-align: center;">否则将无法正常收款请须知</view>
</view> </view>
</template> </template>
@@ -52,11 +55,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

View File

@@ -1,12 +1,8 @@
<template> <template>
<view class="container"> <view class="container">
<up-navbar title="申请提现" <up-navbar title="申请提现" :autoBack="true" bgColor="rgb(255, 117, 129)" leftIconColor="#FFF" :titleStyle="{ color: '#FFF' }">
:autoBack="true"
bgColor="rgb(255, 117, 129)"
leftIconColor="#FFF"
:titleStyle ="{color:'#FFF'}" >
<template #right> <template #right>
<view class="u-p-r-30 u-flex u-col-center" style="color: #fff;"> <view class="u-p-r-30 u-flex u-col-center" style="color: #fff">
<text class="rule-btn" @click="showRule">规则</text> <text class="rule-btn" @click="showRule">规则</text>
</view> </view>
</template> </template>
@@ -16,23 +12,25 @@
<view class="title">可提现总额</view> <view class="title">可提现总额</view>
<view class="mayMoney">¥ {{ data.mayMoney }}</view> <view class="mayMoney">¥ {{ data.mayMoney }}</view>
<view class="val" style=""> <view class="val" style="">
<view style="display: flex;flex-direction: row;padding: 20upx;"> <view style="display: flex; flex-direction: row; padding: 20upx">
<view style="font-size: 32upx;color: #333333;">提现金额</view> <view style="font-size: 32upx; color: #333333">提现金额</view>
</view> </view>
<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 class="witBtn" @click="goWithdraw">{{ data.isWithdraw ? '立即提现' : '观看广告提现' }}</view>
</view> <view style="color: #666" @click="WithdrawalAlipay">提现到支付宝</view>
<view class="witBtn" @click="goWithdraw"> {{data.isWithdraw?'立即提现':'观看广告提现'}} </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> -->
@@ -42,69 +40,74 @@
<view class="moneyList u-p-b-30"> <view class="moneyList u-p-b-30">
<view v-if="data.list.length" v-for="(item, index) in data.list" :key="index" class="item"> <view v-if="data.list.length" v-for="(item, index) in data.list" :key="index" class="item">
<view> <view>
<view style="margin-bottom: 8upx;text-align: right;"> <view style="margin-bottom: 8upx; text-align: right">
<text style="margin-bottom: 8upx;color: green" v-if="item.state===1"> 提现成功</text> <text style="margin-bottom: 8upx; color: green" v-if="item.state === 1">提现成功</text>
<text style="margin-bottom: 8upx;color: green" v-if="item.state===0||item.state==3"> <text style="margin-bottom: 8upx; color: green" v-if="item.state === 0 || item.state == 3">提现中</text>
提现</text> <text style="margin-bottom: 8upx; color: #fd6416" v-if="item.state === -1 || item.state === 2">提现失败</text>
<text style="margin-bottom: 8upx;color: #FD6416" v-if="item.state===-1||item.state===2">
提现失败
</text>
</view> </view>
<view style="color: #999999;font-size: 28upx;"> <view style="color: #999999; font-size: 28upx">
<view style="margin-bottom: 8upx"> 收款人账号{{ item.zhifubao }}</view> <view style="margin-bottom: 8upx">收款人账号{{ item.zhifubao }}</view>
<view style="margin-bottom: 8upx"> 收款人姓名{{ item.zhifubaoName }}</view> <view style="margin-bottom: 8upx">收款人姓名{{ item.zhifubaoName }}</view>
<view style="margin-bottom: 8upx"> 发起时间{{ item.createAt }}</view> <view style="margin-bottom: 8upx">发起时间{{ item.createAt }}</view>
<view style="margin-bottom: 8upx" v-if="item.state===1">成功时间 {{ item.outAt }}</view> <view style="margin-bottom: 8upx" v-if="item.state === 1">成功时间 {{ item.outAt }}</view>
<view style="margin-bottom: 8upx;color: #FD6416" v-if="item.state===-1||item.state===2"> <view style="margin-bottom: 8upx; color: #fd6416" v-if="item.state === -1 || item.state === 2">失败原因{{ item.refund }}</view>
失败原因{{ item.refund }}
</view>
<view style="margin-bottom: 8upx;text-align: right;"> <view style="margin-bottom: 8upx; text-align: right">
<!-- 提现金额 --> <!-- 提现金额 -->
<text style="color: #FD6416;font-size: 32upx;font-weight: 600"> {{ item.money }}</text> <text style="color: #fd6416; font-size: 32upx; font-weight: 600">{{ item.money }}</text>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
<emprty-card v-if="!data.list.length" /> <emprty-card v-if="!data.list.length" />
</view> </view>
</view> </view>
<up-modal
<up-modal :show="data.ruleShow" confirm-text="知道了" title="规则说明" :title="data.rule_title" :title-style="{fontWeight:'700'}" @confirm="ruleConfirm" confirm-color="rgb(255, 117, 129)"> :show="data.ruleShow"
<view class="u-p-30 u-text-left"> confirm-text="知道了"
<scroll-view scroll-y="true" style="max-height: 50vh;" > title="规则说明"
<!-- <rich-text style="text-align: justify;font-size: 18px;color: #666;" :nodes="data.rule_content"></rich-text> --> :title="data.rule_title"
<view style="text-align: justify;font-size: 18px;color: #666;" v-html="data.rule_content"></view> :title-style="{ fontWeight: '700' }"
@confirm="ruleConfirm"
confirm-color="rgb(255, 117, 129)"
>
<view class="u-p-30 u-text-left" v-if="data.ruleShow">
<scroll-view scroll-y="true" style="max-height: 50vh">
<rich-text style="text-align: justify; font-size: 18px; color: #666" :nodes="data.rule_content"></rich-text>
</scroll-view> </scroll-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
:url-callback="data.urlCallback" @load="onadload" @close="onadclose" @error="onaderror"> ref="adRewardedw"
</ad-rewarded-video> :adpid="data.adpid"
:loadnext="true"
:url-callback="data.urlCallback"
@load="onadload"
@close="onadclose"
@error="onaderror"
></ad-rewarded-video>
</view> </view>
</view> </view>
</template> </template>
<script setup> <script setup>
import { reactive, nextTick, ref } from 'vue'; import { reactive, nextTick, ref } from 'vue';
import { onReady,onLoad,onShow,onLaunch,onPullDownRefresh, onReachBottom } from '@dcloudio/uni-app' import { onReady, onLoad, onShow, onLaunch, onPullDownRefresh, onReachBottom } from '@dcloudio/uni-app';
import { selectUserMoney, selectPayDetails, canCash, state, withdraw } from '@/api/me/withdraw.js'; import { selectUserMoney, selectPayDetails, canCash, state, withdraw } from '@/api/me/withdraw.js';
import { selectUserById } from '@/api/user/user.js'; import { selectUserById } from '@/api/user/user.js';
import { announcement } from '@/api/index/index.js'; import { announcement } from '@/api/index/index.js';
import { commonType } from '@/api/init.js'; import { commonType } from '@/api/init.js';
import { linkTo } from '@/utils/app.js'; import { linkTo } from '@/utils/app.js';
const data = reactive({ const data = reactive({
ruleShow: false, ruleShow: false,
rule_title: "", rule_title: '',
rule_content: "", rule_content: '',
money: '', money: '',
mayMoney: '0', mayMoney: '0',
list: [], list: [],
@@ -121,231 +124,259 @@
userInfo: null, userInfo: null,
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({
data.ruleList = res type: 1
}).then((res) => {
data.ruleList = res;
ruleInit() ruleInit();
});
}) });
}) onShow(() => {
onShow(() => { getcashMoney();
getcashMoney()
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;
getMoneyDetail(); getMoneyDetail();
} }
}) });
onPullDownRefresh(() => { onPullDownRefresh(() => {
data.page = 1; data.page = 1;
data.list = [] data.list = [];
getMoneyDetail(); getMoneyDetail();
}) });
function ruleInit(){ function ruleInit() {
data.rule_content = "" 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;
} }
/** /**
* 规则弹窗打开 * 规则弹窗打开
*/ */
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 false; return false;
} }
ruleInit() ruleInit();
data.ruleShow = true data.ruleShow = true;
} }
/** /**
* 规则确认 * 规则确认
*/ */
function ruleConfirm() { function ruleConfirm() {
console.log(1) 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=>{
ruleInit()
data.ruleShow = true
},300)
} }
setTimeout((res) => {
ruleInit();
data.ruleShow = true;
}, 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'
});
} }
function back() { } else {
uni.navigateBack() uni.showToast({
title: '请绑定支付宝',
icon: 'none'
});
setTimeout(() => {
// 未绑定信息
linkTo('/pages/me/withdraw/alipay');
}, 1500);
} }
/** }
function back() {
uni.navigateBack();
}
/**
* 获取看广告状态 * 获取看广告状态
*/ */
async function getCanCash() { async function getCanCash() {
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);
} }
}) });
}
} /**
/**
* 广告数据加载成功回调 * 广告数据加载成功回调
* @param {Object} e * @param {Object} e
*/ */
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
*/ */
async function onadclose(e) { async function onadclose(e) {
const detail = e.detail const detail = e.detail;
if (detail && detail.isEnded) { if (detail && detail.isEnded) {
// 正常播放结束 // 正常播放结束
console.log(data.urlCallback.extra) console.log(data.urlCallback.extra);
let res = await state({ let res = await state({
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: '广告加载失败,请稍后重试'
}); });
return return;
} }
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 = getMoneys(data.mayMoney) data.money = getMoneys(data.mayMoney);
} }
/** /**
* *
* 金额格式化 * 金额格式化
* money:金额 * money:金额
* 保留两位小数&不四舍五入 * 保留两位小数&不四舍五入
*/ */
function getMoneys (money) { function getMoneys(num, decimal = 2, isInt = false) {
if (!money || isNaN(money)) return "0.00"; num = +num;
let num = parseFloat(money + '') + ''; num = num.toFixed(3).toString();
num = parseInt(money * 100 + '') / 100 + '' const index = num.indexOf('.');
if (index !== -1) {
let reg = /(-?\d+)(\d{4})/; num = num.substring(0, decimal + index + 1);
while (reg.test(num)) { } else {
num = num.replace(reg, "$1,$2"); num = num.substring(0);
} }
//截取后保留两位小数
let idx = num.indexOf('.') if (isInt) {
if (idx === -1) { return parseFloat(num);
num = num + '.00' } else {
return parseFloat(num).toFixed(decimal);
} }
}
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;
}
/**
* 获取提现记录 * 获取提现记录
*/ */
function getMoneyDetail() { function getMoneyDetail() {
selectPayDetails({ selectPayDetails({
page: data.page, page: data.page,
limit: data.limit limit: data.limit
}).then(res => { }).then((res) => {
data.totalCount = res.totalCount; data.totalCount = res.totalCount;
if (res.list.length > 0) { if (res.list.length > 0) {
data.list = [...data.list, ...res.list]; data.list = [...data.list, ...res.list];
@@ -353,73 +384,75 @@
setTimeout(() => { setTimeout(() => {
uni.stopPullDownRefresh(); uni.stopPullDownRefresh();
}, 500); }, 500);
}) });
} }
/** /**
* 获取最低提现金额 * 获取最低提现金额
*/ */
function getExtractFei() { function getExtractFei() {
commonType(112).then(res => { commonType(112).then((res) => {
if (res && res.value) { if (res && res.value) {
data.cashMoney = res.value; data.cashMoney = res.value;
} }
}); });
} }
/** /**
* 可提现金额 * 可提现金额
*/ */
function getcashMoney() { const totalMoney = ref(0);
selectUserMoney().then(res => { function getcashMoney() {
data.mayMoney = getMoneys(res.amount) || 0 selectUserMoney().then((res) => {
}) data.mayMoney = getMoneys(res.amount) || 0;
} totalMoney.value = res.amount || 0;
});
}
/** /**
* 跳转 * 跳转
* @param {Object} url * @param {Object} url
*/ */
function navTo(url) { function navTo(url) {
uni.navigateTo({ uni.navigateTo({
url: url url: url
}); });
} }
function getMoney() { function getMoney() {
uni.showLoading({ uni.showLoading({
title: '提现中' title: '提现中'
}); });
withdraw({ withdraw({
amount: data.money amount: data.money
}).then(res => { })
console.log(res) .then((res) => {
data.money = '' console.log(res);
uni.setStorageSync('adRewardedNum',0) data.money = '';
setTimeout(function() { uni.setStorageSync('adRewardedNum', 0);
getcashMoney() setTimeout(function () {
}, 1500) getcashMoney();
}, 1500);
uni.showToast({ uni.showToast({
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,
icon: 'none' icon: 'none'
}) });
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',
@@ -428,63 +461,71 @@
return; return;
} }
if (!data.userInfo.accountNo) { if (!data.userInfo.accountNo) {
uni.showToast({ icon: 'none', title: "请先实名认证" }); uni.showToast({
setTimeout(()=>{ icon: 'none',
linkTo('/pages/me/withdraw/realName') title: '请先实名认证'
},1500) });
setTimeout(() => {
linkTo('/pages/me/withdraw/realName');
}, 1500);
return; return;
} }
console.log(data.mayMoney);
if (parseFloat(data.mayMoney).toFixed(2) >= parseFloat(data.money)) { console.log(parseFloat(data.mayMoney));
if (totalMoney.value * 1 >= 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({
title: "提现申请提示", title: '提现申请提示',
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:
.money + '元\n\n收款人账号:' + data.userInfo.accountNo + '', '请仔细确认收款人信息\n\n收款人姓名:' +
data.userInfo.certName +
'\n\n提现金额:' +
data.money +
'元\n\n收款人账号' +
data.userInfo.accountNo +
'',
success: (e) => { success: (e) => {
if (e.confirm) { if (e.confirm) {
console.log(data.money) console.log(data.money);
getMoney(); getMoney();
getMoneyDetail(); getMoneyDetail();
} }
} }
}); });
},200) }, 200);
} }
} }
}); });
} else { } else {
uni.showToast({ uni.showToast({
icon: 'none', icon: 'none',
title: "提现金额必须大于或等于" + data.cashMoney + "元才可提现" title: '提现金额必须大于或等于' + data.cashMoney + '元才可提现'
}); });
} }
} else { } else {
uni.showToast({ uni.showToast({
icon: 'none', icon: 'none',
title: "您的余额不足" title: '您的余额不足'
}); });
} }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.container { .container {
text-align: center; text-align: center;
background: white; background: white;
position: absolute; position: absolute;
width: 100%; width: 100%;
.nav{
.nav {
width: 100%; width: 100%;
position: fixed; position: fixed;
@@ -495,46 +536,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;
@@ -544,7 +593,8 @@
flex-shrink: 0; flex-shrink: 0;
} }
} }
.witBtn{
.witBtn {
margin: 32rpx; margin: 32rpx;
font-size: 36rpx; font-size: 36rpx;
background: #ff7581; background: #ff7581;
@@ -553,27 +603,30 @@
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{
text-align: left .moneyList {
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 {
@@ -581,29 +634,29 @@
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;
// border: 1px solid rgba(255, 255, 255, .8); // border: 1px solid rgba(255, 255, 255, .8);
// border-radius: 4rpx; // border-radius: 4rpx;
} }
.view2-view-text { .view2-view-text {
font-size: 14px; font-size: 14px;
color: #000000; color: #000000;
margin-left: 20upx; margin-left: 20upx;
width: 80%; width: 80%;
} }
.view2-view-image-right { .view2-view-image-right {
width: 18upx; width: 18upx;
height: 30upx; height: 30upx;
margin-left: 50upx; margin-left: 50upx;
} }
.moneyList { .moneyList {
.item { .item {
background: white; background: white;
padding: 32rpx; padding: 32rpx;
@@ -616,10 +669,9 @@
.item:first-child { .item:first-child {
margin-top: 0; margin-top: 0;
} }
} }
.centre {
.centre {
text-align: center; text-align: center;
padding: 200rpx 0; padding: 200rpx 0;
font-size: 32rpx; font-size: 32rpx;
@@ -648,5 +700,5 @@
font-size: 34rpx; font-size: 34rpx;
background: #ff7581; background: #ff7581;
} }
} }
</style> </style>

View File

@@ -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();

View File

@@ -2,62 +2,128 @@
<view class="containerView"> <view class="containerView">
<up-cell-group label-width="80" :border="false"> <up-cell-group label-width="80" :border="false">
<up-cell> <up-cell>
<template #title> <view style="width: 90px;">姓名</view></template> <template #title>
<template #right-icon> <up-input border="none" v-model="data.certName" placeholder="请输入姓名"></up-input> </template> <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> <up-cell>
<template #title> <view style="width: 90px;">身份证号码</view></template> <template #title>
<template #right-icon> <up-input border="none" v-model="data.certNum" placeholder="请输入身份证号码"></up-input> </template> <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> <up-cell>
<template #title> <view style="width: 90px;">银行卡号码</view></template> <template #title>
<template #right-icon> <up-input border="none" v-model="data.accountNo" placeholder="请输入银行卡号码"></up-input> </template> <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> <up-cell>
<template #title> <view style="width: 90px;">手机号</view></template> <template #title>
<template #right-icon> <up-input border="none" v-model="data.mobile" placeholder="请输入银行预留号码"></up-input> </template> <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
}
} }
}) })
@@ -97,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
@@ -129,11 +198,13 @@
page { page {
background: #FFFFFF; background: #FFFFFF;
} }
.u-cell__body__content{
flex: 0!important; .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%;
@@ -169,6 +240,7 @@
color: #ffffff; color: #ffffff;
font-size: 32rpx; font-size: 32rpx;
border: none; border: none;
&:after { &:after {
border: none; border: none;
} }

View File

@@ -9,7 +9,10 @@
reactive reactive
} from 'vue' } from 'vue'
import { import {
onShow,onHide,onUnload,onLoad onShow,
onHide,
onUnload,
onLoad
} from '@dcloudio/uni-app' } from '@dcloudio/uni-app'
import { import {
getOrderInfo getOrderInfo
@@ -18,7 +21,6 @@
orderId: '', orderId: '',
timer: null, timer: null,
timer1: null, timer1: null,
maxAjaxNum: 5,
ajaxNum: 0, ajaxNum: 0,
url: null, //要打开的外部链接 url: null, //要打开的外部链接
viewerUrl: '/hybrid/html/web/viewer.html', viewerUrl: '/hybrid/html/web/viewer.html',
@@ -32,64 +34,92 @@
getOrderInfo({ getOrderInfo({
orderId: state.orderId orderId: state.orderId
}).then(res => { }).then(res => {
state.ajaxNum+=1
console.log(res); console.log(res);
if (res == 1) { if (res == 1) {
uni.hideLoading() uni.hideLoading()
const sysInfo = uni.getSystemInfoSync(); const sysInfo = uni.getSystemInfoSync();
let isIos = sysInfo.platform == 'ios' let isIos = sysInfo.platform == 'ios'
if (isIos) {
uni.navigateBack()
uni.showToast({ uni.showToast({
title: '支付成功', title: '支付成功',
icon: 'none' icon: 'none'
}) })
if (isIos) {
uni.navigateBack()
setTimeout(() => { setTimeout(() => {
uni.navigateBack() uni.navigateBack()
}, 1500) }, 1500)
} else { } else {
uni.showToast({
title: '支付成功',
icon: 'none'
})
state.timer1 = setTimeout(() => { state.timer1 = setTimeout(() => {
cleartimer()
uni.navigateBack() uni.navigateBack()
}, 500) }, 500)
} }
} else { } else {
} }
if (executionCount >= maxExecutions) {
if(state.ajaxNum>=state.maxAjaxNum){ console.log(`已达到最大执行次数(${maxExecutions}),定时器停止`);
uni.navigateBack() uni.navigateBack()
cleartimer() cleartimer()
} }
}); });
} }
function cleartimer(){ function cleartimer() {
console.log('cleartimer'); console.log('cleartimer');
uni.hideLoading() uni.hideLoading()
clearInterval(state.timer) clearTimeout(state.timer)
clearTimeout(state.timer1) clearTimeout(state.timer1)
state.timer=null state.timer = null
state.timer1=null state.timer1 = null
state.ajaxNum=0
} }
let runOnetime = 2000; // 初始间隔2秒
let executionCount = 0; // 执行计数
const maxExecutions = 5; // 最大执行次数
function startDynamicTimer() {
let lastExecutionTime = Date.now();
function executeAndReschedule() {
// 检查是否达到最大执行次数
if (executionCount >= maxExecutions) {
console.log(`已达到最大执行次数(${maxExecutions}),定时器停止`);
uni.navigateBack()
cleartimer()
return;
}
const currentTime = Date.now();
const elapsed = currentTime - lastExecutionTime;
lastExecutionTime = currentTime;
getOrder();
// 增加计数
executionCount++;
console.log('executionCount',executionCount);
// 计算新的间隔在上一次间隔基础上增加2秒
runOnetime += 2000;
// 如果未达到最大次数,安排下一次执行
console.log('executionCount < maxExecutions',executionCount < maxExecutions);
console.log(executionCount , maxExecutions);
if (executionCount < maxExecutions) {
state.timer = setTimeout(executeAndReschedule, runOnetime);
}
}
// 启动第一个定时器
state.timer = setTimeout(executeAndReschedule, runOnetime);
}
onShow(() => { onShow(() => {
executionCount=0;
// #ifdef APP // #ifdef APP
uni.showLoading({ uni.showLoading({
title: '支付中' title: '支付中'
}) })
// #endif // #endif
state.ajaxNum=0; runOnetime = 2000;
getOrder() getOrder()
clearInterval(state.timer) clearTimeout(state.timer)
state.timer=setInterval(()=>{ // 启动动态定时器
getOrder() startDynamicTimer();
},2000)
}) })
onHide(() => { onHide(() => {
console.log('onHide'); console.log('onHide');

View File

@@ -9,376 +9,379 @@
<image class="task_icon2" src="@/static/task/task_icon2.png"></image> <image class="task_icon2" src="@/static/task/task_icon2.png"></image>
</view> </view>
<view class="contentTop "> <view class="contentTop">
<view> <view>
<image src="@/static/task/renwubg.png" mode=""></image> <image src="@/static/task/renwubg.png" mode=""></image>
<view>已连续签到 <text class="num">{{ datas.signDays }}</text> </view> <view>
已连续签到
<text class="num">{{ datas.signDays }}</text>
</view>
</view> </view>
<view class="contentTopTwo"> <view class="contentTopTwo">
<view v-for="item in datas.signInList" :key="item.id" <view v-for="item in datas.signInList" :key="item.id" :style="item.status == 1 ? 'color:#EFA765' : 'color:#999'">
:style="item.status == 1 ? 'color:#EFA765' : 'color:#999'"> <text class="" style="font-size: 28rpx">
<text class="" style="font-size: 28rpx;">
{{ item.status == 1 ? '已签到' : '待签到' }} {{ item.status == 1 ? '已签到' : '待签到' }}
</text> </text>
<view :style="item.status == 1 ? 'color:#999' : 'color:#EFA765'"> <view :style="item.status == 1 ? 'color:#999' : 'color:#EFA765'">
{{ item.signDay.substr(5, 8) }} {{ item.signDay.substr(5, 8) }}
</view> </view>
<image v-if="item.status == 0" src="@/static/task/xing (1).png" mode=""></image> <image v-if="item.status == 0" src="@/static/task/xing (1).png" mode=""></image>
<image v-else src="@/static/task/xing (2).png" mode=""> </image> <image v-else src="@/static/task/xing (2).png" mode=""></image>
</view> </view>
</view> </view>
</view> </view>
<view class="content " v-if="datas.list.length"> <view class="content" v-if="datas.list.length">
<view class="cell " v-for="(item, index) in datas.list" :key="index"> <view class="cell" v-for="(item, index) in datas.list" :key="index">
<view class="cell_left "> <view class="cell_left">
<view class="cell_title "> <view class="cell_title">
<view class=" title" :style="{ alignSelf: item.rewardImg ? 'center' : 'flex-start' }">{{ <view class="title" :style="{ alignSelf: item.rewardImg ? 'center' : 'flex-start' }">{{ item.title }}</view>
item.title
}}</view>
<image v-if="item.rewardImg" class="cell_icon" :src="item.rewardImg" mode=""></image> <image v-if="item.rewardImg" class="cell_icon" :src="item.rewardImg" mode=""></image>
<view class="tip">{{ item.rewardDetail }}</view> <view class="tip">{{ item.rewardDetail }}</view>
</view> </view>
<view class="subhead ">{{ item.detail }}</view> <view class="subhead">{{ item.detail }}</view>
</view> </view>
<view class="cell_right "> <view class="cell_right">
<view v-if=" item.disabled " class="btn u-font-24 text-bold" <view v-if="item.disabled" class="btn u-font-24 text-bold" :style="{ backgroundColor: item.buttonBgColor, color: item.buttonFontColor }" @click="goNav(item)">
:style="{backgroundColor: item.buttonBgColor,color: item.buttonFontColor }" {{
@click="goNav(item)"> item.type == 1
{{ item.type == 1 ? item.buttonTitle : item.number ? `${item.discNumber}/${item.number}` : ( item.discNumber <= 0 ? item.buttonTitle : `剩余${item.discNumber}`) }} ? item.buttonTitle
: item.number
? `${item.discNumber}/${item.number}`
: item.discNumber <= 0
? item.buttonTitle
: `剩余${item.discNumber}`
}}
</view> </view>
<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" <view
style="text-align: center;" v-if="item.buttonUnderContent && item.buttonUnderUrl"
@click="goNav({id: item.id,buttonUrl: item.buttonUnderUrl, jumpType: 1,title: item.title, disabled: item.disabled, discNumber: item.discNumber})"> class="u-font-22 tip"
{{ item.buttonUnderContent}} style="text-align: center"
@click="goNav({ id: item.id, buttonUrl: item.buttonUnderUrl, jumpType: 1, title: item.title, disabled: item.disabled, discNumber: item.discNumber })"
>
{{ item.buttonUnderContent }}
</view> </view>
</view> </view>
</view> </view>
</view> </view>
<!-- 激励视频广告 --> <!-- 激励视频广告 -->
<view style="width: 0;height: 0;overflow: hidden;"> <view style="width: 0; height: 0; overflow: hidden">
<!-- 激励视频广告 --> <!-- 激励视频广告 -->
<ad-rewarded-video ref="adRewarded" :adpid="datas.adpid" :loadnext="true" :url-callback="datas.urlCallback" <ad-rewarded-video
@load="onadload" @close="onadclose" @error="onaderror"> ref="adRewarded"
</ad-rewarded-video> :adpid="datas.adpid"
:loadnext="true"
:url-callback="datas.urlCallback"
@load="onadload"
@close="onadclose"
@error="onaderror"
></ad-rewarded-video>
</view> </view>
</view> </view>
<disable-mask v-if="disableShow"></disable-mask>
</template> </template>
<script setup> <script setup>
import { import { useCommonStore } from '@/store/common.js';
useCommonStore const $common = useCommonStore();
} from '@/store/common.js' import { selectUserMoney, selectPayDetails, canCash, state, withdraw } from '@/api/me/withdraw.js';
const $common = useCommonStore() import { reactive, ref, getCurrentInstance, nextTick } from 'vue';
import { import { onShow, onReady, onReachBottom } from '@dcloudio/uni-app';
selectUserMoney, import { getUserSignData, selectTaskCenter, taskReceive } from '@/api/task/index.js';
selectPayDetails,
canCash, const disableShow = ref(false);
state,
withdraw const currentInstance = getCurrentInstance();
} from '@/api/me/withdraw.js'; let datas = reactive({
import {
reactive,
ref,
getCurrentInstance,
nextTick
} from "vue";
import {
onShow,
onReady,
onReachBottom
} from '@dcloudio/uni-app'
import {
getUserSignData,
selectTaskCenter,
taskReceive
} from '@/api/task/index.js'
const currentInstance = getCurrentInstance()
let datas = reactive({
signDays: 0, signDays: 0,
signInList: [], signInList: [],
list: [], list: [],
urlCallback: {}, urlCallback: {},
adpid: null, adpid: null,
adRewardedShow: false, adRewardedShow: false,
adRewardedVideoloadNum: 0, adRewardedVideoloadNum: 0
});
}) const adRewarded = ref(null);
const adRewarded = ref(null); onShow(() => {
onShow(() => {
// $common.init() // $common.init()
// if ( uni.getSystemInfoSync().platform == 'android' ) { // if ( uni.getSystemInfoSync().platform == 'android' ) {
// datas.adpid = 1531580352 // datas.adpid = 1531580352
// } // }
// if ( uni.getSystemInfoSync().platform == 'ios' ) { // if ( uni.getSystemInfoSync().platform == 'ios' ) {
datas.adpid = 1373604770 datas.adpid = 1373604770;
// } // }
if (uni.getStorageSync("token")) { if (uni.getStorageSync('token')) {
getTaskdata() getTaskdata();
getsignIn() getsignIn();
getCanCash() getCanCash();
} else { } else {
datas.signDays = 0 datas.signDays = 0;
const dateArray = []; const dateArray = [];
datas.signInList = [] datas.signInList = [];
for (let i = 0; i < 7; i++) { for (let i = 0; i < 7; i++) {
const date = new Date(Date.now() + i * 24 * 60 * 60 * 1000); const date = new Date(Date.now() + i * 24 * 60 * 60 * 1000);
const year = date.getFullYear(); const year = date.getFullYear();
const month = date.getMonth() + 1 < 10 ? `0${date.getMonth() + 1}` : date.getMonth() + const month = date.getMonth() + 1 < 10 ? `0${date.getMonth() + 1}` : date.getMonth() + 1;
1;
const day = date.getDate() < 10 ? `0${date.getDate()}` : date.getDate(); const day = date.getDate() < 10 ? `0${date.getDate()}` : date.getDate();
dateArray.push(`${year}-${month}-${day}`); dateArray.push(`${year}-${month}-${day}`);
} }
dateArray.forEach(ele => { dateArray.forEach((ele) => {
datas.signInList.push({ datas.signInList.push({
"signDay": ele, signDay: ele,
"status": "0", status: '0'
}) });
}) });
datas.list = [{ datas.list = [
"id": 1, {
"title": "每日打卡奖励", id: 1,
"type": 2, title: '每日打卡奖励',
"detail": "解锁3集视频即可领取", type: 2,
"rewardDetail": "奖励666金币", detail: '解锁3集视频即可领取',
"number": 3, rewardDetail: '奖励666金币',
"buttonTitle": "", number: 3,
"jumpType": 1, buttonTitle: '',
"buttonUrl": "", jumpType: 1,
"buttonUnderContent": "", buttonUrl: '',
"buttonUnderUrl": "", buttonUnderContent: '',
"updateTime": "2025-01-06 18:08:49", buttonUnderUrl: '',
"sort": 0, updateTime: '2025-01-06 18:08:49',
"shows": 1, sort: 0,
"discNumber": 0, shows: 1,
"disabled": false discNumber: 0,
disabled: false
}, },
{ {
"id": 17, id: 17,
"title": "每周打卡奖励", title: '每周打卡奖励',
"type": 2, type: 2,
"detail": "当月签到满7天即可免费领取", detail: '当月签到满7天即可免费领取',
"rewardImg": "https://short-video.hnsiyao.cn/20241210/8aca569a9d544e819f542ce8aa7e7ce5.png", rewardImg: 'https://short-video.hnsiyao.cn/20241210/8aca569a9d544e819f542ce8aa7e7ce5.png',
"rewardDetail": "", rewardDetail: '',
"number": 7, number: 7,
"buttonTitle": "立即领取", buttonTitle: '立即领取',
"buttonBgColor": "#EC6F48", buttonBgColor: '#EC6F48',
"buttonFontColor": "#fff", buttonFontColor: '#fff',
"jumpType": 1, jumpType: 1,
"buttonUrl": "/pages/task/receiveMember", buttonUrl: '/pages/task/receiveMember',
"buttonUnderContent": "", buttonUnderContent: '',
"buttonUnderUrl": "/pages/task/receiveMember", buttonUnderUrl: '/pages/task/receiveMember',
"createTime": "2024-12-10 17:43:42", createTime: '2024-12-10 17:43:42',
"updateTime": "2024-12-25 09:52:09", updateTime: '2024-12-25 09:52:09',
"sort": 5, sort: 5,
"shows": 1, shows: 1,
"discNumber": 0, discNumber: 0,
"disabled": false disabled: false
}, },
{ {
"id": 17, id: 17,
"title": "每月打卡奖励1", title: '每月打卡奖励1',
"type": 2, type: 2,
"detail": "当月签到满25天即可免费领取", detail: '当月签到满25天即可免费领取',
"rewardImg": "https://short-video.hnsiyao.cn/20241210/8aca569a9d544e819f542ce8aa7e7ce5.png", rewardImg: 'https://short-video.hnsiyao.cn/20241210/8aca569a9d544e819f542ce8aa7e7ce5.png',
"rewardDetail": "会员免费领", rewardDetail: '会员免费领',
"number": 25, number: 25,
"buttonTitle": "立即领取", buttonTitle: '立即领取',
"buttonBgColor": "#EC6F48", buttonBgColor: '#EC6F48',
"buttonFontColor": "#fff", buttonFontColor: '#fff',
"jumpType": 1, jumpType: 1,
"buttonUrl": "/pages/task/receiveMember", buttonUrl: '/pages/task/receiveMember',
"buttonUnderContent": "", buttonUnderContent: '',
"buttonUnderUrl": "/pages/task/receiveMember", buttonUnderUrl: '/pages/task/receiveMember',
"createTime": "2024-12-10 17:43:42", createTime: '2024-12-10 17:43:42',
"updateTime": "2024-12-25 09:52:09", updateTime: '2024-12-25 09:52:09',
"sort": 5, sort: 5,
"shows": 1, shows: 1,
"discNumber": 0, discNumber: 0,
"disabled": false disabled: false
}, },
{ {
"id": 17, id: 17,
"title": "每月打卡奖励2", title: '每月打卡奖励2',
"type": 2, type: 2,
"detail": "当月签到满25天即可免费领取", detail: '当月签到满25天即可免费领取',
"rewardImg": "https://short-video.hnsiyao.cn/20241210/8aca569a9d544e819f542ce8aa7e7ce5.png", rewardImg: 'https://short-video.hnsiyao.cn/20241210/8aca569a9d544e819f542ce8aa7e7ce5.png',
"rewardDetail": "", rewardDetail: '',
"number": 25, number: 25,
"buttonTitle": "立即领取", buttonTitle: '立即领取',
"buttonBgColor": "#EC6F48", buttonBgColor: '#EC6F48',
"buttonFontColor": "#fff", buttonFontColor: '#fff',
"jumpType": 1, jumpType: 1,
"buttonUrl": "/pages/task/receiveMember", buttonUrl: '/pages/task/receiveMember',
"buttonUnderContent": "", buttonUnderContent: '',
"buttonUnderUrl": "/pages/task/receiveMember", buttonUnderUrl: '/pages/task/receiveMember',
"createTime": "2024-12-10 17:43:42", createTime: '2024-12-10 17:43:42',
"updateTime": "2024-12-25 09:52:09", updateTime: '2024-12-25 09:52:09',
"sort": 5, sort: 5,
"shows": 1, shows: 1,
"discNumber": 0, discNumber: 0,
"disabled": false disabled: false
} }
] ];
} }
}) });
onReady(() => { onReady(() => {
nextTick(() => { nextTick(() => {
datas.urlCallback = { datas.urlCallback = {
userId: uni.getStorageSync('userInfo').userId, userId: uni.getStorageSync('userInfo').userId,
extra: uni.getStorageSync('userInfo').userId + "" + new Date().getTime(), extra: uni.getStorageSync('userInfo').userId + '' + new Date().getTime()
} };
datas.adRewardedVideoloadNum = 0 datas.adRewardedVideoloadNum = 0;
adRewarded.value.load(); adRewarded.value.load();
}) });
}) });
/** /**
* 获取看广告状态 * 获取看广告状态
*/ */
async function getCanCash() { async function getCanCash() {
canCash().then(res => { canCash().then((res) => {
datas.isWithdraw = !res; datas.isWithdraw = !res;
}) });
}
} /**
/**
* 广告加载失败回调 * 广告加载失败回调
* @param {Object} e * @param {Object} e
*/ */
function onaderror(e) { function onaderror(e) {
if (datas.adRewardedVideoloadNum >= 3) { if (datas.adRewardedVideoloadNum >= 3) {
return return;
} }
datas.adRewardedVideoloadNum++ datas.adRewardedVideoloadNum++;
setTimeout(() => { setTimeout(() => {
datas.urlCallback = { datas.urlCallback = {
userId: uni.getStorageSync('userInfo').userId, userId: uni.getStorageSync('userInfo').userId,
extra: uni.getStorageSync('userInfo').userId + "" + new Date().getTime(), extra: uni.getStorageSync('userInfo').userId + '' + new Date().getTime()
} };
adRewarded.value.load(); adRewarded.value.load();
}, 1000); // 10 }, 1000); // 10
console.log("广告加载失败") console.log('广告加载失败');
} }
/** /**
* 广告数据加载成功回调 * 广告数据加载成功回调
* @param {Object} e * @param {Object} e
*/ */
function onadload(e) { function onadload(e) {
datas.adRewardedShow = true; datas.adRewardedShow = true;
console.log('广告数据加载成功'); console.log('广告数据加载成功');
} }
/** /**
* 广告播放成功回调 * 广告播放成功回调
* @param {Object} e * @param {Object} e
*/ */
async function onadclose(e) { async function onadclose(e) {
const detail = e.detail const detail = e.detail;
if (detail && detail.isEnded) { if (detail && detail.isEnded) {
// 正常播放结束 // 正常播放结束
let res = await state({ let res = await state({
extraKey: datas.urlCallback.extra extraKey: datas.urlCallback.extra
}) });
datas.urlCallback = { datas.urlCallback = {
userId: uni.getStorageSync('userInfo').userId, userId: uni.getStorageSync('userInfo').userId,
extra: uni.getStorageSync('userInfo').userId + "" + new Date().getTime(), extra: uni.getStorageSync('userInfo').userId + '' + new Date().getTime()
} };
uni.showToast({ uni.showToast({
title: '获得' + $common.freeDuration + '分钟免费时长', title: '获得' + $common.freeDuration + '分钟免费时长',
icon: 'none' icon: 'none'
}) });
} else { } else {
// 播放中途退出 // 播放中途退出
} }
} }
async function goNav(item, url) { async function goNav(item) {
console.log(item, url, '调试111') 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.jumpType == 0) {
if (item.buttonTitle.indexOf("领取") != -1) { if (item.buttonTitle.indexOf('领取') != -1) {
let res = await taskReceive({ let res = await taskReceive({
id: item.id id: item.id
}) });
if (res.code == 0) { if (res.code == 0) {
uni.showToast({ uni.showToast({
title: res.id == 15 ? '签到成功' : '领取成功', title: res.id == 15 ? '签到成功' : '领取成功',
icon: 'none' icon: 'none'
}) });
setTimeout(() => { setTimeout(() => {
getTaskdata() getTaskdata();
getsignIn() getsignIn();
}, 1000) }, 1000);
} else { } else {
uni.showToast({ uni.showToast({
title: res.msg, title: res.msg,
icon: 'none' icon: 'none'
}) });
} }
} else if (item.title.indexOf("新人福利") != -1) { } else if (item.title.indexOf('新人福利') != -1) {
let res = await taskReceive({ let res = await taskReceive({
id: item.id id: item.id
}) });
if (res.code == 0) { if (res.code == 0) {
uni.showToast({ uni.showToast({
title: res.id == 15 ? '签到成功' : '领取成功', title: res.id == 15 ? '签到成功' : '领取成功',
icon: 'none' icon: 'none'
}) });
setTimeout(() => { setTimeout(() => {
getTaskdata() getTaskdata();
getsignIn() getsignIn();
}, 1000) }, 1000);
} else { } else {
uni.switchTab({ uni.switchTab({
url: '/pages/index/index' url: '/pages/index/index'
}) });
} }
} else if (item.buttonTitle.indexOf("观看视频") != -1) { } else if (item.buttonTitle.indexOf('观看视频') != -1) {
// 首次加载广告 // 首次加载广告
if (!datas.adRewardedShow) { if (!datas.adRewardedShow) {
uni.showToast({ uni.showToast({
icon: 'none', icon: 'none',
title: '广告加载失败,请稍后重试' title: '广告加载失败,请稍后重试'
}); });
return return;
} }
console.log(datas.urlCallback) console.log(datas.urlCallback);
adRewarded.value.show(); 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.jumpType == 1) {
let buttonUrl = item.buttonUrl let buttonUrl = item.buttonUrl;
if (item.title && item.title.indexOf('每周打卡奖励') != -1) { if (item.title && item.title.indexOf('每周打卡奖励') != -1) {
buttonUrl = item.buttonUrl + '?source=2' buttonUrl = item.buttonUrl + '?source=2';
} }
if (item.title && item.title.indexOf('每月打卡奖励1') != -1) { if (item.title && item.title.indexOf('每月打卡奖励1') != -1) {
buttonUrl = item.buttonUrl + '?source=3' buttonUrl = item.buttonUrl + '?source=3';
} }
if (item.title && item.title.indexOf('每月打卡奖励2') != -1) { if (item.title && item.title.indexOf('每月打卡奖励2') != -1) {
// let res = await taskReceive({ // let res = await taskReceive({
// id: item.id // id: item.id
// }) // })
@@ -398,75 +401,80 @@
// }) // })
// } // }
buttonUrl = buttonUrl = `${item.buttonUrl}?standard=${item.discNumber == null ? true : false}&taskId=${item.id}`;
`${item.buttonUrl}?standard=${item.discNumber == null ? true : false}&taskId=${item.id}`
} }
uni.navigateTo({ uni.navigateTo({
url: buttonUrl url: buttonUrl
}) });
} else if (item.jumpType == 3) { } else if (item.jumpType == 3) {
uni.switchTab({ uni.switchTab({
url: item.buttonUrl url: item.buttonUrl
}) });
}
} }
}
// 获得签到
async function getsignIn() {
try {
let res = await getUserSignData();
datas.signInList = res.recordList;
datas.signDays = res.signDays;
} catch (error) {
if (error.code == 702) {
disableShow.value = true;
} else {
disableShow.value = false;
} }
// 获得签到
async function getsignIn() {
let res = await getUserSignData()
datas.signInList = res.recordList
datas.signDays = res.signDays
} }
// 获取任务列表 }
async function getTaskdata() { // 获取任务列表
let res = await selectTaskCenter() async function getTaskdata() {
let arrData = [] let res = await selectTaskCenter();
let arrData = [];
if (!$common.isIosExamine) { if (!$common.isIosExamine) {
res.forEach(ele => { res.forEach((ele) => {
if (ele.title.indexOf('分享奖励') == -1 && ele.title.indexOf('新人福利') == -1 && if (ele.title.indexOf('分享奖励') == -1 && ele.title.indexOf('新人福利') == -1 && ele.title.indexOf('观看视频奖励') == -1) {
ele.title.indexOf('观看视频奖励') == -1) { arrData.push(ele);
arrData.push(ele)
} }
}) });
datas.list = arrData datas.list = arrData;
} else { } else {
// res.forEach(ele => { // res.forEach(ele => {
// if (ele.title.indexOf('观看视频奖励') == -1) { // if (ele.title.indexOf('观看视频奖励') == -1) {
// arrData.push(ele) // arrData.push(ele)
// } // }
// }) // })
datas.list = res datas.list = res;
}
} }
}
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
page{ page {
// min-height: 100vh; // min-height: 100vh;
} }
.container{
.container {
/* #ifdef H5 */ /* #ifdef H5 */
min-height: calc(100vh - 96rpx); min-height: calc(100vh - 96rpx);
/* #endif */ /* #endif */
/* #ifndef H5 */ /* #ifndef H5 */
min-height: 100vh; min-height: 100vh;
/* #endif */ /* #endif */
background-color: #F3F4F8; background-color: #f3f4f8;
padding-top: 2rpx; padding-top: 2rpx;
} }
.u-absolute {
position: absolute;
}
.task_bg { .u-absolute {
position: absolute;
}
.task_bg {
width: 100% !important; width: 100% !important;
height: 494rpx !important; height: 494rpx !important;
} }
.icon { .icon {
position: absolute; position: absolute;
padding: 122rpx 32rpx 32rpx 32rpx; padding: 122rpx 32rpx 32rpx 32rpx;
@@ -492,9 +500,9 @@
top: -40rpx; top: -40rpx;
position: relative; position: relative;
} }
} }
.contentTop { .contentTop {
border-radius: 16rpx; border-radius: 16rpx;
// top: -115rpx; // top: -115rpx;
padding: 20rpx; padding: 20rpx;
@@ -504,24 +512,24 @@
color: #666666; color: #666666;
margin: 282rpx 32rpx 32rpx 32rpx; margin: 282rpx 32rpx 32rpx 32rpx;
>view:first-child { > view:first-child {
>image { > image {
width: 100%; width: 100%;
height: 78rpx; height: 78rpx;
position: absolute; position: absolute;
left: 0; left: 0;
top: 0; top: 0;
z-index: 1 z-index: 1;
} }
>view { > view {
z-index: 9999; z-index: 9999;
position: absolute; position: absolute;
text-align: center; text-align: center;
width: 98%; width: 98%;
.num { .num {
color: #EC6F48; color: #ec6f48;
margin: 0 10rpx; margin: 0 10rpx;
} }
} }
@@ -533,19 +541,19 @@
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
>view { > view {
position: relative; position: relative;
>view { > view {
display: flex; display: flex;
margin-top: 20rpx; margin-top: 20rpx;
width: 100%; width: 100%;
height: 94rpx; height: 94rpx;
background: linear-gradient(180deg, #FFF7E3 0%, #FFFFFF 100%); background: linear-gradient(180deg, #fff7e3 0%, #ffffff 100%);
border-radius: 14rpx 14rpx 0rpx 0rpx; border-radius: 14rpx 14rpx 0rpx 0rpx;
} }
>image { > image {
width: 52rpx; width: 52rpx;
height: 48rpx; height: 48rpx;
position: absolute; position: absolute;
@@ -554,10 +562,9 @@
} }
} }
} }
}
} .content {
.content {
border-radius: 16rpx; border-radius: 16rpx;
// top: -115rpx; // top: -115rpx;
padding: 28rpx; padding: 28rpx;
@@ -569,9 +576,10 @@
border-radius: 16rpx; border-radius: 16rpx;
padding: 28rpx; padding: 28rpx;
margin-bottom: 32rpx; margin-bottom: 32rpx;
.cell { .cell {
padding: 32rpx 0; padding: 32rpx 0;
border-bottom: 2rpx solid #EBEBEB; border-bottom: 2rpx solid #ebebeb;
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
@@ -599,7 +607,7 @@
.tip { .tip {
margin-left: 22rpx; margin-left: 22rpx;
color: #FC5B67; color: #fc5b67;
font-size: 24rpx; font-size: 24rpx;
} }
} }
@@ -621,15 +629,15 @@
height: 56rpx; height: 56rpx;
line-height: 56rpx; line-height: 56rpx;
text-align: center; text-align: center;
background-color: #EC6F48; background-color: #ec6f48;
color: #FFFFFF; color: #ffffff;
border-radius: 12rpx 12rpx 12rpx 12rpx; border-radius: 12rpx 12rpx 12rpx 12rpx;
font-size: 24rpx; font-size: 24rpx;
font-weight: bold; font-weight: bold;
} }
.tip { .tip {
color: #EC6F48; color: #ec6f48;
height: 44rpx; height: 44rpx;
line-height: 44rpx; line-height: 44rpx;
margin-top: 5rpx; margin-top: 5rpx;
@@ -637,20 +645,19 @@
} }
.opt { .opt {
color: #D39B7E; color: #d39b7e;
background-color: #FBF3EB; background-color: #fbf3eb;
} }
.disabled { .disabled {
color: #999999; color: #999999;
background-color: #E2E2E2; background-color: #e2e2e2;
} }
} }
} }
.cell:last-child { .cell:last-child {
border-bottom: none; border-bottom: none;
} }
} }
</style> </style>

View File

@@ -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()
} }
@@ -108,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'
}) })
} }
} }

View File

@@ -1,81 +1,107 @@
<template> <template>
<view class="min-page " > <view class="min-page">
<!-- <up-button @click="toDetail">toDetail</up-button> --> <!-- <up-button @click="toDetail">toDetail</up-button> -->
<my-video-list isCommand isTabbar v-if="state.list.length" @swiperChange="swiperChange" :list="state.list" @update="update" <my-video-list
isCommand
isTabbar
v-if="state.list.length"
@swiperChange="swiperChange"
:list="state.list"
@update="update"
:info="state" :info="state"
@errorHandle="errorHandle"
></my-video-list> ></my-video-list>
</view>
<view class="mask" v-if="maskShow">
<view class="content">
<view class="title">
<text class="t">风险提示</text>
</view>
<view class="text">
<text>您的账号暂不可用,详情请联系客服</text>
</view>
<div class="btn-wrap">
<text class="btn" @click="toContact">去联系客服</text>
</div>
</view>
</view> </view>
</template> </template>
<script setup> <script setup>
import { import { onLoad, onShow } from '@dcloudio/uni-app';
onLoad, import * as Api from '@/api/video/index.js';
onShow import { computed, reactive, ref } from 'vue';
} from '@dcloudio/uni-app' import { slice } from 'lodash';
import * as Api from '@/api/video/index.js'
import {
computed,
reactive,
ref
} from 'vue'
import {
slice
} from 'lodash'
const maskShow = ref(false);
function toDetail() { function toContact() {
uni.navigateTo({
url: '/pages/me/contact'
});
}
function toDetail() {
uni.navigateTo({ uni.navigateTo({
url: '/pages/video/detail?courseId=1208' url: '/pages/video/detail?courseId=1208'
}) });
} }
let options = {} let options = {};
const state = reactive({ const state = reactive({
collect: 0, collect: 0,
current: {}, current: {},
list: [], list: [],
price: 0, price: 0,
title: '' title: ''
}) });
async function init() {
const res = await Api.tuijianVideo(options) // 接收错误信息
state.current = res.list[0] const errorHandle = (error) => {
Object.assign(state, res) console.log('errorHandle.60===', error);
state.list = res.list if (error.code == 702) {
maskShow.value = true;
} else {
maskShow.value = false;
} }
};
function update({ async function init() {
index, try {
item const res = await Api.tuijianVideo(options);
}) { state.current = res.list[0];
state.list[index] = item Object.assign(state, res);
state.list = res.list;
} catch (error) {
console.log(error);
if (error.code == 702) {
maskShow.value = true;
} else {
maskShow.value = false;
} }
onLoad((opt) => { }
Object.assign(options, opt) }
init()
})
function swiperChange({ function update({ index, item }) {
current, state.list[index] = item;
direction, }
data onLoad((opt) => {
}) {} Object.assign(options, opt);
init();
});
onShow(() => { function swiperChange({ current, direction, data }) {}
}) onShow(() => {});
</script> </script>
<style> <style>
page{ page {
height: calc(100vh - 50px); height: calc(100vh - 50px);
overflow: hidden; overflow: hidden;
} }
</style> </style>
<style lang="scss" scoped> <style lang="scss" scoped>
.min-page { .min-page {
/* #ifdef H5 */ /* #ifdef H5 */
height: calc(100vh - 50px); height: calc(100vh - 50px);
/* #endif */ /* #endif */
@@ -85,9 +111,58 @@
background-color: #000; background-color: #000;
overflow: hidden; overflow: hidden;
flex: 1; flex: 1;
} }
.u-popup { .u-popup {
position: fixed; position: fixed;
}
.mask {
width: 750upx;
height: 1700upx;
background-color: rgba(0, 0, 0, 0.6);
position: fixed;
top: 0;
left: 0;
display: flex;
align-items: center;
justify-content: center;
z-index: 99999;
.content {
width: 680upx;
height: 420upx;
background-color: #fff;
border-radius: 20upx;
.title {
display: flex;
align-items: center;
justify-content: center;
height: 100upx;
.t {
font-size: 32upx;
font-weight: bold;
} }
}
.text {
padding: 50upx 28upx;
display: flex;
align-items: center;
}
.btn-wrap {
display: flex;
padding: 50upx 28upx 28upx;
.btn {
flex: 1;
height: 80upx;
display: flex;
align-items: center;
justify-content: center;
background-color: #dd8591;
color: #fff;
border-radius: 12upx;
text-align: center;
line-height: 80upx;
}
}
}
}
</style> </style>

1
static/icon_address.svg Normal file
View File

@@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1745978289560" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="7345" xmlns:xlink="http://www.w3.org/1999/xlink" width="256" height="256"><path d="M510.864642 313.983087c-62.33879 0-112.889093 50.54928-112.889093 112.887047 0 62.340837 50.54928 112.89114 112.889093 112.89114 62.339814 0 112.890117-50.550303 112.890117-112.89114C623.755782 364.532367 573.204455 313.983087 510.864642 313.983087z" fill="#FF723B" p-id="7346"></path><path d="M511.999488 64.021106c-247.27171 0-447.724091 200.452381-447.724091 447.724091s200.452381 447.724091 447.724091 447.724091 447.724091-200.453405 447.724091-447.724091S759.271198 64.021106 511.999488 64.021106zM510.864642 798.860357c0 0-217.552851-168.727843-217.552851-379.73972 0-113.02724 97.376795-196.535165 217.552851-196.535165 120.175033 0 217.553874 83.507926 217.553874 196.535165C728.418516 630.132514 510.864642 798.860357 510.864642 798.860357z" fill="#FF723B" p-id="7347"></path></svg>

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
static/images/wx.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 258 KiB

After

Width:  |  Height:  |  Size: 129 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 KiB

After

Width:  |  Height:  |  Size: 3.5 KiB

BIN
static/me/Frame.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

BIN
static/me/bind_wx.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 29 KiB

45
utils/wx.js Normal file
View 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()
}
});
})
}