7 Commits
ymf_php ... ymf

Author SHA1 Message Date
cca8804e57 价格显示修改为获取接口 2025-12-16 09:53:52 +08:00
727d56e325 增加剧集解锁价格阶梯 2025-12-15 14:40:51 +08:00
16c36577e7 增加支付延迟,修复首页公告不显示 2025-10-29 10:27:23 +08:00
64b7c90278 去除生产环境打印 2025-08-25 16:30:46 +08:00
3091df43ee 版本升级,生成订单号等待300-600ms再支付 2025-08-25 16:14:21 +08:00
3bca9b1d81 1 2025-08-25 15:50:06 +08:00
ec6bd2a68b test 2025-08-25 15:19:49 +08:00
17 changed files with 1624 additions and 1433 deletions

View File

@@ -2,7 +2,8 @@
"version" : "1.0", "version" : "1.0",
"configurations" : [ "configurations" : [
{ {
"playground" : "custom", "customPlaygroundType" : "device",
"playground" : "standard",
"type" : "uni-app:app-android" "type" : "uni-app:app-android"
}, },
{ {

13
App.vue
View File

@@ -1,12 +1,19 @@
<script> <script>
export default { export default {
onLaunch: function() { onLaunch: function() {
console.log('App Launch 11111'); // 生产环境禁用所有 console 方法
if (process.env.NODE_ENV === 'production') {
const noop = () => {};
console.log = noop;
console.info = noop;
console.warn = noop;
console.error = noop;
}
console.log('App Launch ');
uni.setStorageSync('adRewardedNum', 0) uni.setStorageSync('adRewardedNum', 0)
}, },
onShow: function() { onShow: function() {},
},
onHide: function() { onHide: function() {
console.log('App Hide'); console.log('App Hide');
} }

View File

@@ -5,9 +5,6 @@ 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)
@@ -21,9 +18,6 @@ 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

@@ -16,11 +16,7 @@ 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
}
}) })
} }

View File

@@ -17,10 +17,7 @@ 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
}
}) })
} }

12
api/order/index.js Normal file
View File

@@ -0,0 +1,12 @@
import http from '@/http/http.js'
/**
* 获取最近观看
*/
export const getPayMoney = (data) => {
return http.request({
url: 'order/getPayMoney',
data: data,
method: 'POST'
})
}

View File

@@ -8,16 +8,15 @@ 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,10 +56,7 @@ 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
}
}) })
} }
@@ -100,16 +97,14 @@ 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
}) })
} }
//金币解锁 //金币解锁

View File

@@ -1,31 +1,19 @@
//打包时修改env的值即可 //打包时修改env的值即可
const env = 'php_production' //test,production,local const env = 'production' //test,production,local
export const encryptKey = '1234567890123456' // http数据加解密的key export const encryptKey = '1234567890123456' // http数据加解密的key
export const apiUrl = '/czg/app/' export const apiUrl = '/czg/'
// 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.21:8100', local: 'http://192.168.1.56:8787'
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://tv-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.21:8100', local: 'http://192.168.1.56:8787'
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://tv-ph.hnsiyao.cn',
php_test:'https://playlet.test.sxczgkj.com'
} }
export function returnShareUrl() { export function returnShareUrl() {
@@ -35,9 +23,6 @@ export function returnShareUrl() {
if (env === 'production') { if (env === 'production') {
return 'https://dj-h5.hnsiyao.cn' return 'https://dj-h5.hnsiyao.cn'
} }
if (env === 'php_production') {
return 'https://ph-h5.hnsiyao.cn'
}
if (env === 'local') { if (env === 'local') {
return AppConfig[env] return AppConfig[env]
} }

View File

@@ -225,7 +225,8 @@
</view> </view>
<view class="pay-list-item" @click="payBtnClick('money', 1)"> <view class="pay-list-item" @click="payBtnClick('money', 1)">
<!-- <image class="hot" src="@/static/images/hot.png" mode=""></image> --> <!-- <image class="hot" src="@/static/images/hot.png" mode=""></image> -->
<text class="u-font-28 font-bold">{{ nowDanjiPrice }}元解锁单集视频</text> <!-- <text class="u-font-28 font-bold">{{ nowDanjiPrice }}元解锁单集视频</text> -->
<text class="u-font-28 font-bold">{{ nowNewDanjiPrice }}元解锁单集视频</text>
</view> </view>
</view> </view>
</view> </view>
@@ -321,6 +322,7 @@
</template> </template>
<script setup> <script setup>
import {getPayMoney} from '@/api/order/index.js'
import { toBindWx } from '@/utils/wx.js'; import { toBindWx } from '@/utils/wx.js';
import { useCommonStore } from '@/store/common.js'; import { useCommonStore } from '@/store/common.js';
import { getElRect } from '@/utils/util.js'; import { getElRect } from '@/utils/util.js';
@@ -641,9 +643,16 @@ async function payConfirm() {
orderId: res.orders.ordersId orderId: res.orders.ordersId
}); });
} else { } else {
uni.showLoading()
console.log('延迟开始')
setTimeout(()=>{
uni.hideLoading()
console.log('延迟结束')
payOrder({ payOrder({
orderId: res.orders.ordersId orderId: res.orders.ordersId
}); });
},200)
} }
} else { } else {
} }
@@ -762,6 +771,8 @@ async function popupShow(key = 'show', item, index) {
} }
if (key == 'pay') { if (key == 'pay') {
const res = await Api.getPayTips(); const res = await Api.getPayTips();
await getDanjiPrice()
const numbers = extractNumbers(res); const numbers = extractNumbers(res);
console.log(numbers); console.log(numbers);
if (numbers.length >= 2) { if (numbers.length >= 2) {
@@ -1020,6 +1031,16 @@ const nowDanjiPrice = computed(() => {
return videoList.value[current.value].price; return videoList.value[current.value].price;
}); });
const nowNewDanjiPrice=ref(0);
async function getDanjiPrice(){
const res=await getPayMoney({
y_price:nowDanjiPrice.value,
})
nowNewDanjiPrice.value=res
}
function loadmore() { function loadmore() {
console.log('loadmore'); console.log('loadmore');
} }

View File

@@ -9,8 +9,7 @@ import {
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) {
@@ -23,7 +22,7 @@ function getHeader(data) {
} }
// 通用处理逻辑 // 通用处理逻辑
function commonsProcess(showLoading, httpReqCallback, isreturm, url) { function commonsProcess(showLoading, httpReqCallback, isreturm) {
// 判断是否请求完成(用作 是否loading // 判断是否请求完成(用作 是否loading
// 包括: 'ing', 'ingLoading', 'finish' // 包括: 'ing', 'ingLoading', 'finish'
let reqState = "ing"; let reqState = "ing";
@@ -50,9 +49,7 @@ function commonsProcess(showLoading, httpReqCallback, isreturm, url) {
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 {
@@ -78,7 +75,7 @@ function commonsProcess(showLoading, httpReqCallback, isreturm, url) {
// http响应码不正确 // http响应码不正确
if (statusCode != 200 && statusCode != 204 && statusCode != 201) { if (statusCode != 200 && statusCode != 204 && statusCode != 201) {
isShowErrorToast = true; isShowErrorToast = true;
infoBox.showToast(data.message || data.msg || "服务器异常"); infoBox.showToast(data.message || "服务器异常");
return Promise.reject(bodyData); // 跳转到catch函数 return Promise.reject(bodyData); // 跳转到catch函数
} }
if (bodyData.code == 401) { if (bodyData.code == 401) {
@@ -120,7 +117,7 @@ function commonsProcess(showLoading, httpReqCallback, isreturm, url) {
if (bodyData.code != 0) { if (bodyData.code != 0) {
infoBox.showToast(data.message || data.msg); infoBox.showToast(data.message);
return; return;
} }
@@ -137,8 +134,7 @@ function commonsProcess(showLoading, httpReqCallback, isreturm, url) {
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();
@@ -146,18 +142,17 @@ function commonsProcess(showLoading, httpReqCallback, isreturm, url) {
} }
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.message || res.msg).then(() => {}); infoBox.showToast(res.msg).then(() => {});
reject(); reject();
} }
if (res.code == 500) { if (res.code == 500) {
infoBox.showToast(res.message || res.msg || "服务器异常").then(() => {}); infoBox.showToast(res.msg || "服务器异常").then(() => {});
reject(); reject();
} }
reqFinishFunc(); // 请求完毕的动作 reqFinishFunc(); // 请求完毕的动作
@@ -212,10 +207,8 @@ 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),
@@ -225,7 +218,7 @@ function request(args) {
}, extParams) }, extParams)
) )
}, isreturm, url) }, isreturm)
} }
// 处理/ // 处理/
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.3.2", "versionName" : "1.3.4",
"versionCode" : 132, "versionCode" : 134,
"transformPx" : false, "transformPx" : false,
/* 5+App */ /* 5+App */
"app-plus" : { "app-plus" : {
@@ -150,8 +150,7 @@
"title" : "斯耀短剧", "title" : "斯耀短剧",
"template" : "template.html", "template" : "template.html",
"router" : { "router" : {
"mode" : "history", "mode" : "history"
"base" : ""
} }
} }
} }

297
package-lock.json generated
View File

@@ -1,110 +1,295 @@
{ {
"name": "抽奖转盘非固定图片可自定义传入奖项列表v2 v3兼容",
"version": "1.0.0",
"lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "lockfileVersion": 1,
"": {
"name": "抽奖转盘非固定图片可自定义传入奖项列表v2 v3兼容",
"version": "1.0.0",
"dependencies": { "dependencies": {
"lodash": "^4.17.21", "@babel/runtime": {
"uview-plus": "^3.3.62" "version": "7.26.0",
}, "resolved": "https://registry.npmmirror.com/@babel/runtime/-/runtime-7.26.0.tgz",
"devDependencies": { "integrity": "sha512-FDSOghenHTiToteC/QRlv2q3DhPZ/oOXTBoirfWNx1Cx3TMVcGWQtMMmQcSvb/JjpNeGzx8Pq/b4fKEJuWm1sw==",
"pinia-plugin-unistorage": "^0.1.2" "requires": {
"regenerator-runtime": "^0.14.0"
} }
}, },
"node_modules/clipboard": { "base64-js": {
"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==",
"dependencies": { "requires": {
"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"
} }
}, },
"node_modules/dayjs": { "concat-stream": {
"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=="
}, },
"node_modules/delegate": { "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=="
}, },
"node_modules/good-listener": { "gm-crypto": {
"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==",
"dependencies": { "requires": {
"delegate": "^3.1.2" "delegate": "^3.1.2"
} }
}, },
"node_modules/lodash": { "ieee754": {
"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=="
}, },
"node_modules/node_modules/pinia-plugin-unistorage": { "lru-cache": {
"version": "0.1.2", "version": "4.1.5",
"integrity": "sha512-WXit2cGnm5rG6CDTcLSLehNWhyJS/Yq7WEeeXAapZbCnqoPJxlszqg7rT8S+OP47az0h5nlajGo+LuyMxUQ2uw==", "resolved": "https://registry.npmmirror.com/lru-cache/-/lru-cache-4.1.5.tgz",
"extraneous": true, "integrity": "sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g==",
"devDependencies": { "requires": {
"@types/node": "^18.19.8", "pseudomap": "^1.0.2",
"bumpp": "^9.3.0", "yallist": "^2.1.2"
"pinia-plugin-persistedstate": "^3.2.1",
"unbuild": "^2.0.0"
} }
}, },
"node_modules/node_modules/pre-commit": { "mutation-observer": {
"version": "1.2.2", "version": "1.0.3",
"integrity": "sha512-qokTiqxD6GjODy5ETAIgzsRgnBWWQHQH2ghy86PU7mIn/wuWeTwF3otyNQZxWBwVn8XNr8Tdzj/QfUXpH+gRZA==", "resolved": "https://registry.npmmirror.com/mutation-observer/-/mutation-observer-1.0.3.tgz",
"extraneous": true, "integrity": "sha512-M/O/4rF2h776hV7qGMZUH3utZLO/jK7p8rnNgGkjKUw8zCGjRQPxB8z6+5l8+VjRUQ3dNYu4vjqXYLr+U8ZVNA=="
"hasInstallScript": true,
"dependencies": {
"cross-spawn": "^5.0.1",
"spawn-sync": "^1.0.15",
"which": "1.2.x"
}, },
"devDependencies": { "os-shim": {
"assume": "1.4.x", "version": "0.1.3",
"istanbul": "0.4.x", "resolved": "https://registry.npmmirror.com/os-shim/-/os-shim-0.1.3.tgz",
"mocha": "~3.2.0", "integrity": "sha512-jd0cvB8qQ5uVt0lvCIexBaROw1KyKm5sbulg2fWOHjETisuCzWyt+eTZKEMs8v6HwzoGs8xik26jg7eCM6pS+A=="
"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/select": { "node_modules/pre-commit": {
"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=="
}, },
"node_modules/tiny-emitter": { "shebang-command": {
"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=="
}, },
"node_modules/uview-plus": { "to-arraybuffer": {
"version": "3.5.10", "version": "1.0.1",
"resolved": "https://registry.npmmirror.com/uview-plus/-/uview-plus-3.5.10.tgz", "resolved": "https://registry.npmmirror.com/to-arraybuffer/-/to-arraybuffer-1.0.1.tgz",
"integrity": "sha512-sn92VKgfFqoBEpWrIULIZbd2z5Rf9iM8U/fKSCVVrU2kCFqcGp68IPr+gttQ7I+KZUVwdGLFECplQQJWytEZYA==", "integrity": "sha512-okFlQcoGTi4LQBG/PgSYblw9VOyptsz2KJZqc6qtgGdes8VktzUQkj4BI2blit072iS8VODNcMA+tvnS9dnuMA=="
"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"
}
}, },
"engines": { "vconsole": {
"HBuilderX": "^3.1.0", "version": "3.15.1",
"uni-app": "^4.66", "resolved": "https://registry.npmmirror.com/vconsole/-/vconsole-3.15.1.tgz",
"uni-app-x": "" "integrity": "sha512-KH8XLdrq9T5YHJO/ixrjivHfmF2PC2CdVoK6RWZB4yftMykYIaXY1mxZYAic70vADM54kpMQF+dYmvl5NRNy1g==",
} "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

@@ -165,6 +165,7 @@ onReachBottom(() => {
// 公告 // 公告
async function getMsg() { async function getMsg() {
let res = await messageselectMessage(); let res = await messageselectMessage();
console.log('res',res)
let arr = []; let arr = [];
let ids = uni.getStorageSync('ids'); let ids = uni.getStorageSync('ids');
res.list.forEach((ele) => { res.list.forEach((ele) => {
@@ -177,7 +178,7 @@ async function getMsg() {
arr.push(ele); arr.push(ele);
} }
}); });
datas.noticeList = arr; datas.noticeList = res.list;
if (arr.length) { if (arr.length) {
if (ids.length) { if (ids.length) {
uni.setStorageSync('ids', [...uni.getStorageSync('ids'), datas.noticeList[datas.cloneNum].id]); uni.setStorageSync('ids', [...uni.getStorageSync('ids'), datas.noticeList[datas.cloneNum].id]);

View File

@@ -3,54 +3,49 @@
<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="inputChange" /> <input class="input" type="number" :value="data.mobile" placeholder="请输入手机号" maxlength="11" data-key="mobile"
@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="inputChange" @confirm="toRegister" /> <input type="number" :value="data.code" placeholder="请输入验证码" maxlength="6" data-key="code"
@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 <input class="input" type="password" :value="data.password" placeholder="请设置新密码" placeholder-class="input-empty"
class="input" maxlength="20" minlength="6" data-key="password" @input="inputChange" @confirm="toRegister" />
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>
@@ -58,7 +53,7 @@
<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';
@@ -70,80 +65,70 @@ let data = reactive({
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 ) => {
let localQdCodeion = uni.getStorageSync('qdCodeion'); if (uni.getStorageSync('qdCodeion')) { data.qdCodeion = uni.getStorageSync('qdCodeion') }
if (localQdCodeion && localQdCodeion != 'null') { if (options.qdCode) { data.qdCodeion = options.qdCode }
data.qdCodeion = localQdCodeion; if (options.invitation ) { data.invitation = options.invitation }
}
if (options.qdCode && options.qdCode != 'null') {
data.qdCodeion = options.qdCode;
}
if (options.invitation) {
data.invitation = options.invitation;
}
console.log('localQdCodeion===', localQdCodeion); let res = await commonType(3)
console.log('options.qdCode===', typeof options.qdCode); data.isregisterCode = res.value
})
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();
console.log(res); uni.hideToast();
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 {
} catch (error) { uni.showModal({
console.log(error); showCancel: false,
uni.showToast({ title: '短信发送失败',
title: error.message, content: '请一分钟后再获取验证码'
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;
@@ -170,7 +155,7 @@ function inputChange(e) {
* @param {Object} e * @param {Object} e
*/ */
function radioChange(e) { function radioChange(e) {
data.checked = e; data.checked = e
} }
/** /**
@@ -182,92 +167,102 @@ function toLogin() {
}); });
} }
/** /**
* 注册 * 注册
*/ */
async function toRegister() { async function toRegister() {
const { mobile, password, code, checked, invitation, isregisterCode, qdCodeion } = data; const {
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,
@@ -276,7 +271,9 @@ async function toRegister() {
}); });
} }
uni.hideLoading(); uni.hideLoading();
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@@ -309,6 +306,7 @@ page {
font-size: 24rpx; font-size: 24rpx;
color: #333333; color: #333333;
margin-top: 50rpx; margin-top: 50rpx;
} }
.cuIcon::before{ .cuIcon::before{
width: 30rpx; width: 30rpx;
@@ -316,29 +314,28 @@ page {
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%;
@@ -396,9 +393,9 @@ page {
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;

View File

@@ -3,35 +3,28 @@
<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="inputChange" /> <input class="input" type="number" :value="mobile" placeholder="请输入手机号" maxlength="11" data-key="mobile"
@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="inputChange" @confirm="toLogin" /> <input type="number" :value="code" placeholder="请输入验证码" maxlength="6" data-key="code"
@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 <input class="input" type="password" :value="password" placeholder="请设置新密码" placeholder-class="input-empty"
class="input" maxlength="20" minlength="6" data-key="password" @input="inputChange" @confirm="toLogin" />
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">
@@ -46,21 +39,22 @@
</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: '',
@@ -69,45 +63,42 @@ let data = reactive({
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',
data: { }).then(res => {
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', { type: 88 }).then((res) => { this.$Request.getT('/common/type/88').then(res => {
if (res.code == 0) { if (res.code == 0) {
this.invitation = res.data.value; this.invitation = res.data.value;
} }
@@ -115,33 +106,35 @@ function showMa() {
} }
function sendMsg() { function sendMsg() {
const { mobile } = this; const {
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({
@@ -152,11 +145,14 @@ function sendMsg() {
} }
uni.hideLoading(); uni.hideLoading();
}); })
} }
} }
function countDown() { function countDown() {
const { count } = this; const {
count
} = this;
if (count === 1) { if (count === 1) {
this.count = 60; this.count = 60;
this.sending = false; this.sending = false;
@@ -175,96 +171,105 @@ function inputChange(e) {
} }
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 { mobile, password, code, checked, invitation, registerCode, qdCodeion } = this; const {
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 + '&inviterCode=' + invitation + '&platform=' + platform + '&qdCode=' + qdCodeion, url: 'app/Login/registerCode?password=' + password + '&phone=' + mobile + '&msg=' + code +
'&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({
@@ -316,11 +321,11 @@ page {
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;
} }
} }
@@ -328,7 +333,7 @@ page {
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;
} }
@@ -377,6 +382,7 @@ page {
} }
} }
.confirm-btn { .confirm-btn {
width: 100%; width: 100%;
height: 100rpx; height: 100rpx;
@@ -384,9 +390,9 @@ page {
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;

View File

@@ -1,8 +1,9 @@
<template> <template>
<view class="container"> <view class="container">
<up-navbar title="申请提现" :autoBack="true" bgColor="rgb(255, 117, 129)" leftIconColor="#FFF" :titleStyle="{ color: '#FFF' }"> <up-navbar title="申请提现" :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>
@@ -12,25 +13,26 @@
<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 <input type="digit" v-model="data.money" placeholder="请输入金额" @input="moneyInput"
type="digit" style="font-size: 32rpx;color: #333333;text-align: left;margin-left: 10rpx;width: 80%;" />
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> <view class="allbtn" @click="setAllMoney">
全部
</view> </view>
</view>
</view> </view>
<view class="witBtn" @click="goWithdraw"> {{data.isWithdraw?'立即提现':'观看广告提现'}} </view> <view class="witBtn" @click="goWithdraw"> {{data.isWithdraw?'立即提现':'观看广告提现'}} </view>
<view style="color: #666" @click="WithdrawalAlipay">提现到支付宝</view> <view style="color: #666;" @click="WithdrawalAlipay">
提现到支付宝
</view>
<view class="tab" style=""> <view class="tab" style="">
<view @click="linkTo('/pages/me/withdraw/realName')">实名认证</view> <view @click="linkTo('/pages/me/withdraw/realName')">实名认证</view>
<!-- <view @click="linkTo('/pages/me/withdraw/alipay')">提现账号</view> --> <!-- <view @click="linkTo('/pages/me/withdraw/alipay')">提现账号</view> -->
@@ -40,64 +42,60 @@
<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> <text style="margin-bottom: 8upx;color: green" v-if="item.state===0||item.state==3">
<text style="margin-bottom: 8upx; color: #fd6416" v-if="item.state === -1 || item.state === 2">提现失败</text> 提现</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">失败原因{{ item.refund }}</view> <view style="margin-bottom: 8upx;color: #FD6416" v-if="item.state===-1||item.state===2">
失败原因{{ 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
:show="data.ruleShow" <up-modal :show="data.ruleShow" confirm-text="知道了" title="规则说明" :title="data.rule_title"
confirm-text="知道了" :title-style="{fontWeight:'700'}" @confirm="ruleConfirm" confirm-color="rgb(255, 117, 129)">
title="规则说明" <view class="u-p-30 u-text-left">
:title="data.rule_title" <scroll-view scroll-y="true" style="max-height: 50vh;">
:title-style="{ fontWeight: '700' }" <rich-text style="text-align: justify;font-size: 18px;color: #666;"
@confirm="ruleConfirm" :nodes="data.rule_content"></rich-text>
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 <ad-rewarded-video ref="adRewardedw" :adpid="data.adpid" :loadnext="true" :url-callback="data.urlCallback"
ref="adRewardedw" @load="onadload" @close="onadclose" @error="onaderror">
:adpid="data.adpid" </ad-rewarded-video>
: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';
@@ -106,8 +104,8 @@ 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: [],
@@ -124,7 +122,7 @@ const data = reactive({
userInfo: null, userInfo: null,
ruleIndex: 0, ruleIndex: 0,
ruleList: [] ruleList: []
}); })
const adRewardedw = ref(null); const adRewardedw = ref(null);
onLoad(() => { onLoad(() => {
@@ -132,46 +130,47 @@ onLoad(() => {
// 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({ announcement({
type: 1 type: 1
}).then((res) => { }).then(res => {
data.ruleList = 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
} }
/** /**
* 规则弹窗打开 * 规则弹窗打开
@@ -179,35 +178,35 @@ function ruleInit() {
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) => { setTimeout(res => {
ruleInit(); ruleInit()
data.ruleShow = true; data.ruleShow = true
}, 300); }, 300)
} }
function getUserInfo() { function getUserInfo() {
selectUserById().then((res) => { selectUserById().then(res => {
data.userInfo = res; data.userInfo = res;
}); })
} }
function WithdrawalAlipay() { function WithdrawalAlipay() {
@@ -216,52 +215,53 @@ function WithdrawalAlipay() {
withdraw({ withdraw({
amount: data.money, amount: data.money,
isAlipay: 1 isAlipay: 1
}).then((res) => { }).then(res => {
data.money = ''; data.money = ''
uni.setStorageSync('adRewardedNum', 0); uni.setStorageSync('adRewardedNum', 0)
setTimeout(function() { setTimeout(function() {
getcashMoney(); getcashMoney()
}, 1500); }, 1500)
uni.showToast({ uni.showToast({
title: res.msg, title: res.msg,
icon: 'none' icon: 'none'
}); })
}); })
}else{ }else{
uni.showToast({ uni.showToast({
title: '请输入金额', title: "请输入金额",
icon: 'none' icon: 'none',
}); })
} }
} else { } else {
uni.showToast({ uni.showToast({
title: '请绑定支付宝', title: "请绑定支付宝",
icon: 'none' icon: 'none',
}); })
setTimeout(() => { setTimeout(() => {
// 未绑定信息 // 未绑定信息
linkTo('/pages/me/withdraw/alipay'); linkTo('/pages/me/withdraw/alipay')
}, 1500); }, 1500)
} }
} }
function back() { function back() {
uni.navigateBack(); 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))
} }
}); })
} }
/** /**
* 广告数据加载成功回调 * 广告数据加载成功回调
@@ -269,7 +269,7 @@ async function getCanCash() {
*/ */
function onadload(e) { function onadload(e) {
data.adRewardedShow = true; data.adRewardedShow = true;
uni.setStorageSync('adRewardedNum', 0); uni.setStorageSync('adRewardedNum', 0)
console.log('广告数据加载成功'); console.log('广告数据加载成功');
} }
@@ -279,13 +279,13 @@ function onadload(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)
} }
/** /**
@@ -293,24 +293,24 @@ function onaderror(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
} }
/** /**
@@ -323,16 +323,17 @@ function goWithdraw() {
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) {
@@ -343,7 +344,7 @@ function moneyInput(e) {
* 全部提现赋值 * 全部提现赋值
*/ */
function setAllMoney() { function setAllMoney() {
data.money = getMoneys(data.mayMoney); data.money = getMoneys(data.mayMoney)
} }
/** /**
@@ -352,21 +353,28 @@ function setAllMoney() {
* money:金额 * money:金额
* 保留两位小数&不四舍五入 * 保留两位小数&不四舍五入
*/ */
function getMoneys(num, decimal = 2, isInt = false) { function getMoneys(money) {
num = +num; if (!money || isNaN(money)) return "0.00";
num = num.toFixed(3).toString(); let num = parseFloat(money + '') + '';
const index = num.indexOf('.'); num = parseInt(money * 100 + '') / 100 + ''
if (index !== -1) {
num = num.substring(0, decimal + index + 1); let reg = /(-?\d+)(\d{4})/;
} else { while (reg.test(num)) {
num = num.substring(0); num = num.replace(reg, "$1,$2");
} }
//截取后保留两位小数
if (isInt) { let idx = num.indexOf('.')
return parseFloat(num); if (idx === -1) {
} else { num = num + '.00'
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;
} }
/** /**
@@ -376,7 +384,7 @@ 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];
@@ -384,14 +392,14 @@ function getMoneyDetail() {
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;
} }
@@ -401,12 +409,10 @@ function getExtractFei() {
/** /**
* 可提现金额 * 可提现金额
*/ */
const totalMoney = ref(0);
function getcashMoney() { function getcashMoney() {
selectUserMoney().then((res) => { selectUserMoney().then(res => {
data.mayMoney = getMoneys(res.amount) || 0; data.mayMoney = getMoneys(res.amount) || 0
totalMoney.value = res.amount || 0; })
});
} }
/** /**
@@ -425,34 +431,34 @@ function getMoney() {
}); });
withdraw({ withdraw({
amount: data.money amount: data.money
}) }).then(res => {
.then((res) => { console.log(res)
console.log(res); data.money = ''
data.money = ''; uni.setStorageSync('adRewardedNum', 0)
uni.setStorageSync('adRewardedNum', 0);
setTimeout(function() { setTimeout(function() {
getcashMoney(); getcashMoney()
}, 1500); }, 1500)
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',
@@ -463,56 +469,52 @@ function getOut() {
if (!data.userInfo.accountNo) { if (!data.userInfo.accountNo) {
uni.showToast({ uni.showToast({
icon: 'none', icon: 'none',
title: '请先实名认证' title: "请先实名认证"
}); });
setTimeout(() => { setTimeout(() => {
linkTo('/pages/me/withdraw/realName'); linkTo('/pages/me/withdraw/realName')
}, 1500); }, 1500)
return; return;
} }
console.log(data.mayMoney);
console.log(parseFloat(data.mayMoney)); if (parseFloat(data.mayMoney).toFixed(2) >= parseFloat(data.money)) {
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: content: '请仔细确认收款人信息\n\n收款人姓名:' + data.userInfo.certName +
'请仔细确认收款人信息\n\n收款人姓名:' + '\n\n提现金额:' + data
data.userInfo.certName + .money + '元\n\n收款人账号' + data.userInfo.accountNo + '',
'\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: "您的余额不足"
}); });
} }
} }
@@ -557,13 +559,13 @@ function getOut() {
.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;
} }
@@ -571,7 +573,7 @@ function getOut() {
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;
@@ -619,14 +621,14 @@ function getOut() {
} }
.moneyList { .moneyList {
text-align: left; text-align: left
} }
} }
.cash-top { .cash-top {
padding: 32upx 32upx 50upx 32upx; padding: 32upx 32upx 50upx 32upx;
/* border-bottom: 1px solid gainsboro; */ /* border-bottom: 1px solid gainsboro; */
background: #5074ff; background: #5074FF;
} }
.leiji { .leiji {
@@ -671,6 +673,7 @@ function getOut() {
} }
} }
.centre { .centre {
text-align: center; text-align: center;
padding: 200rpx 0; padding: 200rpx 0;