Compare commits
243 Commits
| Author | SHA1 | Date |
|---|---|---|
|
|
37a9b16de5 | |
|
|
3d508f9970 | |
|
|
8fe612ce0b | |
|
|
4301fd358f | |
|
|
903c584ac7 | |
|
|
1039e9713b | |
|
|
90c4322dc7 | |
|
|
7e8e45805a | |
|
|
3b9b20c076 | |
|
|
cad182bf51 | |
|
|
628846db7e | |
|
|
852ab64e15 | |
|
|
7ab31b61c0 | |
|
|
79f25136f6 | |
|
|
bb0074cc0f | |
|
|
75a2aae759 | |
|
|
7b8f7fc4b0 | |
|
|
3a1e2e4a08 | |
|
|
a7e1f0f3c4 | |
|
|
5585cb84ae | |
|
|
778a0139c2 | |
|
|
aa09fd06df | |
|
|
8a2e752c02 | |
|
|
bebd48a64a | |
|
|
11b6f3305d | |
|
|
7ef2d47b91 | |
|
|
e2214b8ad2 | |
|
|
3acee65862 | |
|
|
7924ef4ba7 | |
|
|
d747791c9a | |
|
|
303783634b | |
|
|
a0529aaf7d | |
|
|
b4be77303e | |
|
|
30f3d244e9 | |
|
|
d2dbaa640d | |
|
|
942f93a77c | |
|
|
002fb06447 | |
|
|
ecc0549cfc | |
|
|
a78cc2ecf7 | |
|
|
c8f7016f8d | |
|
|
9cbde62fd9 | |
|
|
54250730ce | |
|
|
5a55632bc0 | |
|
|
267d1fcd9b | |
|
|
7b44d1f9fb | |
|
|
9bc7e710cc | |
|
|
415269084f | |
|
|
5fe52bb52a | |
|
|
35854982fb | |
|
|
35af3b0652 | |
|
|
b35b2ed530 | |
|
|
e598f50faf | |
|
|
c719ce1f27 | |
|
|
7c339bc617 | |
|
|
a67f470f5c | |
|
|
4c8c89a844 | |
|
|
24b7eae649 | |
|
|
9600fcf2a9 | |
|
|
cfde959d35 | |
|
|
defeede5d7 | |
|
|
f87a4b285e | |
|
|
a7f6209b08 | |
|
|
52506bb2af | |
|
|
c9826276e9 | |
|
|
b2fd3ba347 | |
|
|
896cf17599 | |
|
|
4d52a796da | |
|
|
908205200b | |
|
|
168665eebc | |
|
|
3535322923 | |
|
|
86af5ab3a9 | |
|
|
4232765731 | |
|
|
206546aed8 | |
|
|
a147eaab4f | |
|
|
8488799080 | |
|
|
a0e49f9830 | |
|
|
444b897528 | |
|
|
8e7d038dba | |
|
|
a30d2ed9fa | |
|
|
dc67568b6b | |
|
|
c401d2695d | |
|
|
71f0e2215c | |
|
|
66e9d9a460 | |
|
|
5c067b3ef7 | |
|
|
3de0070cb6 | |
|
|
f9f33f7086 | |
|
|
50fd6369a9 | |
|
|
ad01ea7faf | |
|
|
2cd3dbf0ac | |
|
|
f4796c76f0 | |
|
|
a5554ae3ea | |
|
|
6376a92caf | |
|
|
de3cf30105 | |
|
|
0636654dc2 | |
|
|
a291c2f629 | |
|
|
e4f6a3b14a | |
|
|
a03f005009 | |
|
|
dee181749b | |
|
|
9ac5b0c512 | |
|
|
57cfb4babd | |
|
|
b5b403c7b1 | |
|
|
43c79cc554 | |
|
|
f7650fb95f | |
|
|
3738cd5344 | |
|
|
0c0a30e85a | |
|
|
cfaadad802 | |
|
|
57fbc3c9b9 | |
|
|
497e9b9311 | |
|
|
210737d357 | |
|
|
56c84e1b18 | |
|
|
2d61ed447f | |
|
|
88d32d8789 | |
|
|
efd651aac7 | |
|
|
087bb2b3e2 | |
|
|
66f7b6f57a | |
|
|
aa7f7f3392 | |
|
|
b4542559ae | |
|
|
5372daf2a7 | |
|
|
3c209118a6 | |
|
|
e7afd83085 | |
|
|
fa60aeec42 | |
|
|
31601ff334 | |
|
|
cfcc0c15ec | |
|
|
e79e7f5874 | |
|
|
421a3fe4f1 | |
|
|
ec7c3742bf | |
|
|
30ba7cde34 | |
|
|
4b9d78ec5a | |
|
|
7b6044f4eb | |
|
|
119a3d3c07 | |
|
|
3b6d560539 | |
|
|
e822e614b8 | |
|
|
b344413b2a | |
|
|
073f8a0797 | |
|
|
f0edf9f419 | |
|
|
5ad0d54662 | |
|
|
3ff35d7eb6 | |
|
|
9083c9a454 | |
|
|
3d7d5178e6 | |
|
|
f3f9af86f9 | |
|
|
d5aac20fd0 | |
|
|
44a9d8669e | |
|
|
fbdeaee553 | |
|
|
b5a610660e | |
|
|
e39688ab9f | |
|
|
679df05a66 | |
|
|
d7650332a2 | |
|
|
0a27d79563 | |
|
|
6fe850ed20 | |
|
|
2c14e6c588 | |
|
|
6b40cf8089 | |
|
|
3edfedb4ab | |
|
|
8ba1fd7f96 | |
|
|
9f4e438a31 | |
|
|
55fa85a8a3 | |
|
|
c531d15343 | |
|
|
f48de14b28 | |
|
|
3be46138ae | |
|
|
0699489b2d | |
|
|
a87c94fdba | |
|
|
21cf4b9524 | |
|
|
c83901fb46 | |
|
|
fa5f11cac3 | |
|
|
ae276c6a50 | |
|
|
9b565065f9 | |
|
|
264739b6e7 | |
|
|
9f6eb2eb09 | |
|
|
ca7c293d0e | |
|
|
4964043cda | |
|
|
61a878b326 | |
|
|
d05abf5c80 | |
|
|
dc4bf2a5c1 | |
|
|
f1f5582381 | |
|
|
afa4afbab6 | |
|
|
483423531d | |
|
|
f87dbc2ff5 | |
|
|
5458022b20 | |
|
|
9bb1b060e3 | |
|
|
6f931f7157 | |
|
|
78c8acf09b | |
|
|
f1728def4e | |
|
|
97f627fded | |
|
|
ca6baa5254 | |
|
|
608c7b1678 | |
|
|
85e1b96557 | |
|
|
2edc997c39 | |
|
|
b1978752aa | |
|
|
69b1f22c82 | |
|
|
72347c4c7b | |
|
|
ff44f08b93 | |
|
|
5f109be94d | |
|
|
0041214912 | |
|
|
c63deab9f8 | |
|
|
bd98f12d4d | |
|
|
d63cdea1ec | |
|
|
02ca722970 | |
|
|
c6a81de8fb | |
|
|
4c6603de45 | |
|
|
06b5c4f99b | |
|
|
e796c086f8 | |
|
|
57e7a9c032 | |
|
|
191297c1f6 | |
|
|
da79e53e70 | |
|
|
a234802534 | |
|
|
51d60f2dcb | |
|
|
8b61108053 | |
|
|
f78b4fc14a | |
|
|
014f71b43b | |
|
|
d5aa9080b6 | |
|
|
3ecd48231f | |
|
|
ff96875de7 | |
|
|
665db9bb9a | |
|
|
5a97705726 | |
|
|
f55c9a9ee1 | |
|
|
2404b96717 | |
|
|
f3ca591e6a | |
|
|
1429b7277c | |
|
|
ab815d703d | |
|
|
e7d2b21ec2 | |
|
|
6ad0c6ab09 | |
|
|
817a4f7d55 | |
|
|
d625d301cf | |
|
|
1206f0ea22 | |
|
|
c97811b50d | |
|
|
6d91b3ec15 | |
|
|
2506dd8d57 | |
|
|
51652f2f4f | |
|
|
f77d4b60f9 | |
|
|
98d3572526 | |
|
|
47751a7267 | |
|
|
d85b101e30 | |
|
|
eae93ae6c7 | |
|
|
8a340fabdd | |
|
|
e1eff87490 | |
|
|
fb9733d9eb | |
|
|
bf17bb3a5d | |
|
|
400126ffeb | |
|
|
30ceee0f2b | |
|
|
c7df084278 | |
|
|
9156891770 | |
|
|
f15ed3a330 | |
|
|
3bcc491fc2 | |
|
|
fb8c9f8431 |
|
|
@ -0,0 +1,2 @@
|
|||
/unpackage/
|
||||
/test/
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
{
|
||||
"version" : "1.0",
|
||||
"configurations" : [
|
||||
{
|
||||
"app-plus" : {
|
||||
"launchtype" : "local"
|
||||
},
|
||||
"default" : {
|
||||
"launchtype" : "local"
|
||||
},
|
||||
"h5" : {
|
||||
"launchtype" : "local"
|
||||
},
|
||||
"mp-weixin" : {
|
||||
"launchtype" : "local"
|
||||
},
|
||||
"provider" : "aliyun",
|
||||
"type" : "uniCloud"
|
||||
},
|
||||
{
|
||||
"playground" : "custom",
|
||||
"type" : "uni-app:app-android"
|
||||
},
|
||||
{
|
||||
"playground" : "standard",
|
||||
"type" : "uni-app:app-ios"
|
||||
}
|
||||
]
|
||||
}
|
||||
120
App.vue
|
|
@ -1,4 +1,6 @@
|
|||
<script>
|
||||
import config from '@/common/config.js'
|
||||
import store from './store/index.js'
|
||||
export default {
|
||||
onLaunch: function() {
|
||||
let that = this
|
||||
|
|
@ -277,27 +279,29 @@
|
|||
|
||||
|
||||
|
||||
setInterval(d => { //定时器,定时去调取聊天未读消息
|
||||
let userId = uni.getStorageSync('userId')
|
||||
if (userId) {
|
||||
this.$Request.getT('/app/message/selectMessageCount').then(res => {
|
||||
if (res.code === 0) {
|
||||
let num = res.data
|
||||
uni.setStorageSync('numCount', num)
|
||||
if (num == 0) {
|
||||
uni.removeTabBarBadge({
|
||||
index: 3
|
||||
})
|
||||
} else {
|
||||
uni.setTabBarBadge({
|
||||
index: 3,
|
||||
text: num + ''
|
||||
})
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}, 3000);
|
||||
// setInterval(d => { //定时器,定时去调取聊天未读消息
|
||||
// let userId = uni.getStorageSync('userId')
|
||||
// if (userId) {
|
||||
// this.$Request.getT('/app/message/selectMessageCount').then(res => {
|
||||
// if (res.code === 0) {
|
||||
// let num = res.data
|
||||
// uni.setStorageSync('numCount', num)
|
||||
// if (num == 0) {
|
||||
// uni.removeTabBarBadge({
|
||||
// index: 3
|
||||
// })
|
||||
// } else {
|
||||
// uni.setTabBarBadge({
|
||||
// index: 3,
|
||||
// text: num + ''
|
||||
// })
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
// }, 3000);
|
||||
|
||||
|
||||
//#ifdef H5
|
||||
|
||||
this.$u.get('/app/common/type/108').then(res => { //// 是否开启公众号自动登陆 108
|
||||
|
|
@ -366,12 +370,13 @@
|
|||
}
|
||||
});
|
||||
} else {
|
||||
//获取当前系统版本信息
|
||||
//获取当前系统版本信息
|
||||
plus.runtime.getProperty(plus.runtime.appid, widgetInfo => {
|
||||
//请求后台接口 解析数据 对比版本
|
||||
that.$Request.getT('/app/user/selectNewApp').then(res => {
|
||||
res = res.data[0];
|
||||
if (res.wgtUrl && widgetInfo.version < res.version) {
|
||||
|
||||
if (widgetInfo.version < res.version) {
|
||||
let downloadLink = '';
|
||||
let androidLink = res.androidWgtUrl;
|
||||
let iosLink = res.iosWgtUrl;
|
||||
|
|
@ -455,20 +460,30 @@
|
|||
}
|
||||
} else {
|
||||
//不是热更新是在线更新 校验是否强制升级
|
||||
if (res.method == 'true') {
|
||||
|
||||
if (res.method == "true") {
|
||||
uni.showModal({
|
||||
showCancel: false,
|
||||
confirmText: '立即更新',
|
||||
title: '发现新版本',
|
||||
confirmText: '立即更新',
|
||||
content: res.des,
|
||||
success: res => {
|
||||
if (res.confirm) {
|
||||
that.$queue.showLoading('下载中...');
|
||||
plus.runtime.openURL(config.APIHOST2 +
|
||||
'/pages/login/appEq')
|
||||
return
|
||||
uni.showLoading({
|
||||
title: '下载中...',
|
||||
mask: true
|
||||
});
|
||||
if (uni.getSystemInfoSync().platform ==
|
||||
'android') {
|
||||
uni.downloadFile({
|
||||
url: androidLink,
|
||||
success: downloadResult => {
|
||||
console.log(
|
||||
downloadResult
|
||||
)
|
||||
if (downloadResult
|
||||
.statusCode ===
|
||||
200) {
|
||||
|
|
@ -487,12 +502,25 @@
|
|||
.restart();
|
||||
},
|
||||
e => {
|
||||
console
|
||||
.log(
|
||||
e
|
||||
)
|
||||
console
|
||||
.error(
|
||||
'install fail...'
|
||||
);
|
||||
}
|
||||
);
|
||||
// plus.io.resolveLocalFileSystemURL(downloadResult.tempFilePath, entry => {
|
||||
// entry.getParent(_oldFile=>{
|
||||
// entry.moveTo(_oldFile,'.apk',newFilePath=>{
|
||||
// console.log('newFilePath',newFilePath.fullPath)
|
||||
|
||||
// })
|
||||
// })
|
||||
// })
|
||||
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
@ -515,7 +543,13 @@
|
|||
content: res.des,
|
||||
success: res => {
|
||||
if (res.confirm) {
|
||||
that.$queue.showLoading('下载中...');
|
||||
plus.runtime.openURL(config.APIHOST2 +
|
||||
'/pages/login/appEq')
|
||||
return
|
||||
uni.showLoading({
|
||||
title: '下载中...',
|
||||
mask: true
|
||||
});
|
||||
if (uni.getSystemInfoSync().platform ==
|
||||
'android') {
|
||||
uni.downloadFile({
|
||||
|
|
@ -539,12 +573,41 @@
|
|||
.restart();
|
||||
},
|
||||
e => {
|
||||
console
|
||||
.log(
|
||||
e
|
||||
)
|
||||
console
|
||||
.error(
|
||||
'install fail...'
|
||||
);
|
||||
}
|
||||
);
|
||||
// plus.io.resolveLocalFileSystemURL(downloadResult.tempFilePath, entry => {
|
||||
// entry.getParent(_oldFile=>{
|
||||
// entry.moveTo(_oldFile,'.apk',newFilePath=>{
|
||||
// console.log('newFilePath',newFilePath.fullPath)
|
||||
// plus.runtime
|
||||
// .install(newFilePath.fullPath, { force: false },
|
||||
// d => {
|
||||
// console
|
||||
// .log(
|
||||
// 'install success...'
|
||||
// );
|
||||
// plus.runtime
|
||||
// .restart();
|
||||
// },
|
||||
// e => {
|
||||
// console.log(e)
|
||||
// console
|
||||
// .error(
|
||||
// 'install fail...'
|
||||
// );
|
||||
// }
|
||||
// );
|
||||
// })
|
||||
// })
|
||||
// })
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
@ -798,4 +861,7 @@
|
|||
@import "uview-ui/index.scss";
|
||||
@import 'components/colorui/main.css';
|
||||
@import 'components/colorui/icon.css';
|
||||
@import '@/common/style/common.scss';
|
||||
@import './tuniao-ui/index.scss';
|
||||
@import './tuniao-ui/iconfont.css';
|
||||
</style>
|
||||
|
|
@ -1,27 +1,15 @@
|
|||
const ROOTPATH1 = "https://duanju.xianmxkj.com/sqx_fast"; //
|
||||
const ROOTPATH = "https://duanju.xianmxkj.com/sqx_fast"; //后台服务域名
|
||||
const ROOTPATH2 = "https://duanju.xianmxkj.com"; //后台服务域名
|
||||
// const ROOTPATH1 = "https://dj-api.hnsiyao.cn/sqx_fast/"; //
|
||||
// const ROOTPATH = "https://dj-api.hnsiyao.cn/sqx_fast/"; //后台服务域名
|
||||
// const ROOTPATH2 = "https://dj-h5.hnsiyao.cn"; //后台服务域名
|
||||
|
||||
// const ROOTPATH1 = location.origin + "/sqx_fast"; //
|
||||
// const ROOTPATH = location.origin + "/sqx_fast"; //后台服务域名
|
||||
// const ROOTPATH2 = location.origin; //后台服务域名
|
||||
const ROOTPATH1 = "https://video.hnsiyao.cn/sqx_fast/"; //
|
||||
const ROOTPATH = "https://video.hnsiyao.cn/sqx_fast/"; //后台服务域名
|
||||
const ROOTPATH2 = "https://video-h5.hnsiyao.cn"; //后台服务域名
|
||||
|
||||
// const ROOTPATH1 = "https://duanju12.xianmxkj.com/sqx_fast"; //
|
||||
// const ROOTPATH = "https://duanju12.xianmxkj.com/sqx_fast"; //后台服务域名
|
||||
// const ROOTPATH2 = "https://duanju12.xianmxkj.com"; //后台服务域名
|
||||
// const ROOTPATH1 = "http://192.168.1.5:8100/sqx_fast/"; //
|
||||
// const ROOTPATH = "http://192.168.1.5:8100/sqx_fast/"; //后台服务域名
|
||||
// const ROOTPATH2 = "http://192.168.1.5:8100"; //后台服务域名
|
||||
|
||||
// const ROOTPATH1 = "https://wap.xingqiu1985.com/sqx_fast"; //
|
||||
// const ROOTPATH = "https://wap.xingqiu1985.com/sqx_fast"; //后台服务域名
|
||||
// const ROOTPATH2 = "https://wap.xingqiu1985.com"; //后台服务域名
|
||||
|
||||
|
||||
// const ROOTPATH1 = "https://jc.118zp.com/sqx_fast"; //
|
||||
// const ROOTPATH = "https://jc.118zp.com/sqx_fast"; //后台服务域名
|
||||
// const ROOTPATH2 = "https://jc.118zp.com"; //后台服务域名
|
||||
|
||||
// const ROOTPATH1 = "http://192.168.0.132:8100/sqx_fast"; //后台服务域名
|
||||
// const ROOTPATH = "http://192.168.0.132:8100/sqx_fast"; //后台服务域名
|
||||
// const ROOTPATH2 = "http://192.168.0.132:8100"; //后台服务域名
|
||||
module.exports = {
|
||||
APIHOST: ROOTPATH,
|
||||
APIHOST1: ROOTPATH1,
|
||||
|
|
|
|||
|
|
@ -0,0 +1,8 @@
|
|||
export default {
|
||||
baseUrl: 'http://127.0.0.1/',
|
||||
baseApi: 'http://127.0.0.1:7001/',
|
||||
color:{
|
||||
main:'#FFC428',
|
||||
red:'#fa3534'
|
||||
}
|
||||
}
|
||||
|
|
@ -51,10 +51,13 @@ const install = (Vue, vm) => {
|
|||
|
||||
let userMoney = (params = {}) => vm.$u.get('app/invite/selectUserMoney', params); //查看钱包
|
||||
let cashMoney = (params = {}) => vm.$u.get('app/cash/cashMoney', params); //申请提现
|
||||
let withdraw = (params = {}) => vm.$u.get('app/cash/withdraw', params); //申请提现
|
||||
let selectPay = (params = {}) => vm.$u.get('app/cash/selectPayDetails', params); //提现记录
|
||||
let moneyDet = (params = {}) => vm.$u.get('app/cash/queryUserMoneyDetails', params); //钱包明细
|
||||
let type = (params = {}) => vm.$u.get('app/common/type', params); //钱包明细
|
||||
|
||||
let myPurseDet = (params = {}) => vm.$u.get('app/moneyDetails/queryUserMoneyDetails', params); //我的钱包
|
||||
let myPurse = (params = {}) => vm.$u.get('app/moneyDetails/selectUserMoney', params); //钱包明细
|
||||
|
||||
let help = (params = {}) => vm.$u.get('app/helpWord/selectHelpList', params); //帮助中心
|
||||
let helpDet = (params = {}) => vm.$u.get('app/helpWord/selectHelpWordDetails', params); //帮助中心 详情
|
||||
|
|
@ -105,10 +108,14 @@ const install = (Vue, vm) => {
|
|||
moneyList,
|
||||
userMoney,
|
||||
cashMoney,
|
||||
withdraw,
|
||||
selectPay,
|
||||
moneyDet,
|
||||
type,
|
||||
|
||||
myPurseDet,
|
||||
myPurse,
|
||||
|
||||
help,
|
||||
helpDet,
|
||||
selectCourseDetailsById
|
||||
|
|
|
|||
|
|
@ -26,6 +26,17 @@ module.exports = {
|
|||
},
|
||||
logout: function() {
|
||||
let that = this;
|
||||
// 获取当前页面实例
|
||||
const pages = getCurrentPages();
|
||||
// 获取当前页面的实例
|
||||
const currentPage = pages[pages.length - 1];
|
||||
// 获取页面路径
|
||||
const pagePath = currentPage.route
|
||||
const systemInfo = uni.getSystemInfoSync();
|
||||
const isIOS = /iOS/.test(systemInfo.platform);
|
||||
if ( pagePath == "pages/task/index") {
|
||||
return;
|
||||
}
|
||||
uni.removeStorageSync("token")
|
||||
uni.removeStorageSync("userId")
|
||||
uni.removeStorageSync("phone")
|
||||
|
|
@ -41,7 +52,9 @@ module.exports = {
|
|||
title: '用户信息失效,请重新登录!',
|
||||
icon: 'none'
|
||||
})
|
||||
|
||||
uni.navigateTo({
|
||||
url: "/pages/login/login"
|
||||
})
|
||||
},
|
||||
post: function(url, data, header) {
|
||||
let that = this;
|
||||
|
|
|
|||
|
|
@ -18,11 +18,11 @@ module.exports = {
|
|||
},
|
||||
//全局域名 部分html中需要单独替换 需要修改config中的网络请求域名
|
||||
publicYuMing() {
|
||||
return 'https://duanju.xianmxkj.com'
|
||||
return 'https://dj-api.hnsiyao.cn'
|
||||
},
|
||||
//全局域名 部分html中需要单独替换 需要修改config中的网络请求域名
|
||||
publicYuMingAll() {
|
||||
return 'https://duanju.xianmxkj.com/sqx_fast'
|
||||
return 'https://dj-api.hnsiyao.cn/sqx_fast/'
|
||||
},
|
||||
minMoney() {
|
||||
return uni.getStorageSync("minMoney") ? uni.getStorageSync("minMoney") : '0.3'
|
||||
|
|
|
|||
|
|
@ -0,0 +1,409 @@
|
|||
.u-relative,
|
||||
.u-rela {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.u-absolute,
|
||||
.u-abso {
|
||||
position: absolute;
|
||||
}
|
||||
.u-fixed,.u-fix{
|
||||
position: fixed;
|
||||
}
|
||||
.left-top{
|
||||
left: 0;
|
||||
top: 0;
|
||||
}
|
||||
.u-overflow-hide{
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
// nvue不能用标签命名样式,不能放在微信组件中,否则微信开发工具会报警告,无法使用标签名当做选择器
|
||||
/* #ifndef APP-NVUE */
|
||||
image {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
// 在weex,也即nvue中,所有元素默认为border-box
|
||||
view,
|
||||
text {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
/* #endif */
|
||||
|
||||
.u-font-xs {
|
||||
font-size: 22rpx;
|
||||
}
|
||||
|
||||
.u-font-sm {
|
||||
font-size: 26rpx;
|
||||
}
|
||||
|
||||
.u-font-md {
|
||||
font-size: 28rpx;
|
||||
}
|
||||
|
||||
.u-font-lg {
|
||||
font-size: 30rpx;
|
||||
}
|
||||
|
||||
.u-font-xl {
|
||||
font-size: 34rpx;
|
||||
}
|
||||
|
||||
.u-flex {
|
||||
/* #ifndef APP-NVUE */
|
||||
display: flex;
|
||||
/* #endif */
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.u-flex-wrap {
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.u-flex-nowrap {
|
||||
flex-wrap: nowrap;
|
||||
}
|
||||
|
||||
.u-col-center {
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.u-col-top {
|
||||
align-items: flex-start;
|
||||
}
|
||||
|
||||
.u-col-bottom {
|
||||
align-items: flex-end;
|
||||
}
|
||||
|
||||
.u-row-center {
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.u-row-left {
|
||||
justify-content: flex-start;
|
||||
}
|
||||
|
||||
.u-row-right {
|
||||
justify-content: flex-end;
|
||||
}
|
||||
|
||||
.u-row-between {
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.u-row-around {
|
||||
justify-content: space-around;
|
||||
}
|
||||
|
||||
.u-text-left {
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.u-text-center {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.u-text-right {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.u-flex-col {
|
||||
/* #ifndef APP-NVUE */
|
||||
display: flex!important;
|
||||
/* #endif */
|
||||
flex-direction: column!important;
|
||||
}
|
||||
|
||||
// 定义flex等分
|
||||
@for $i from 0 through 12 {
|
||||
.u-flex-#{$i} {
|
||||
flex: $i;
|
||||
}
|
||||
}
|
||||
|
||||
// 定义字体(px)单位,小于20都为px单位字体
|
||||
@for $i from 9 to 20 {
|
||||
.u-font-#{$i} {
|
||||
font-size: $i + px;
|
||||
}
|
||||
}
|
||||
|
||||
// 定义字体(rpx)单位,大于或等于20的都为rpx单位字体
|
||||
@for $i from 20 through 40 {
|
||||
.u-font-#{$i} {
|
||||
font-size: $i + rpx;
|
||||
}
|
||||
}
|
||||
|
||||
// 定义内外边距,历遍1-80
|
||||
@for $i from 0 through 80 {
|
||||
// 只要双数和能被5除尽的数
|
||||
@if $i % 2 == 0 or $i % 5 == 0 {
|
||||
// 得出:u-margin-30或者u-m-30
|
||||
.u-margin-#{$i}, .u-m-#{$i} {
|
||||
margin: $i + rpx!important;
|
||||
}
|
||||
|
||||
// 得出:u-padding-30或者u-p-30
|
||||
.u-padding-#{$i}, .u-p-#{$i} {
|
||||
padding: $i + rpx!important;
|
||||
}
|
||||
|
||||
@each $short, $long in l left, t top, r right, b bottom {
|
||||
// 缩写版,结果如: u-m-l-30
|
||||
// 定义外边距
|
||||
.u-m-#{$short}-#{$i} {
|
||||
margin-#{$long}: $i + rpx!important;
|
||||
}
|
||||
|
||||
// 定义内边距
|
||||
.u-p-#{$short}-#{$i} {
|
||||
padding-#{$long}: $i + rpx!important;
|
||||
}
|
||||
|
||||
// 完整版,结果如:u-margin-left-30
|
||||
// 定义外边距
|
||||
.u-margin-#{$long}-#{$i} {
|
||||
margin-#{$long}: $i + rpx!important;
|
||||
}
|
||||
|
||||
// 定义内边距
|
||||
.u-padding-#{$long}-#{$i} {
|
||||
padding-#{$long}: $i + rpx!important;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 重置nvue的默认关于flex的样式
|
||||
.u-reset-nvue {
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
/* start--文本行数限制--start */
|
||||
.u-line-1 {
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.u-line-2 {
|
||||
-webkit-line-clamp: 2;
|
||||
}
|
||||
|
||||
.u-line-3 {
|
||||
-webkit-line-clamp: 3;
|
||||
}
|
||||
|
||||
.u-line-4 {
|
||||
-webkit-line-clamp: 4;
|
||||
}
|
||||
|
||||
.u-line-5 {
|
||||
-webkit-line-clamp: 5;
|
||||
}
|
||||
|
||||
.u-line-2, .u-line-3, .u-line-4, .u-line-5 {
|
||||
overflow: hidden;
|
||||
word-break: break-all;
|
||||
text-overflow: ellipsis;
|
||||
display: -webkit-box; // 弹性伸缩盒
|
||||
-webkit-box-orient: vertical; // 设置伸缩盒子元素排列方式
|
||||
}
|
||||
|
||||
/* end--文本行数限制--end */
|
||||
|
||||
|
||||
/* start--不同颜色文字--start */
|
||||
.color-333{
|
||||
color: #333;
|
||||
}
|
||||
.color-666{
|
||||
color: #666;
|
||||
}
|
||||
.color-999{
|
||||
color: #999;
|
||||
}
|
||||
.color-red{
|
||||
color: $my-red-color;
|
||||
}
|
||||
.color-main{
|
||||
color:$my-main-color
|
||||
}
|
||||
|
||||
/* end--不同颜色文字--end */
|
||||
|
||||
|
||||
.tranistion{
|
||||
transition: all .3s ease-in-out;
|
||||
}
|
||||
.tranistion-1{
|
||||
transition: all .1s ease-in-out;
|
||||
}
|
||||
.tranistion-2{
|
||||
transition: all .2s ease-in-out;
|
||||
}
|
||||
.font-bold{
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
|
||||
/* start--不同颜色背景--start */
|
||||
.my-bg-main{
|
||||
background-color:$my-main-color
|
||||
}
|
||||
|
||||
/* end--不同颜色背景--end */
|
||||
|
||||
.safe-page{
|
||||
padding-bottom: 60rpx!important;
|
||||
}
|
||||
::v-deep .uni-switch-input.uni-switch-input-checked{
|
||||
border-color: $my-main-color;
|
||||
background-color: $my-main-color;
|
||||
}
|
||||
.btn-circle{
|
||||
border-radius: 200px;
|
||||
}
|
||||
.min-page{
|
||||
/* #ifdef H5 */
|
||||
min-height: calc(100vh - 44px);
|
||||
/* #endif */
|
||||
/* #ifndef H5 */
|
||||
min-height: 100vh;
|
||||
/* #endif */
|
||||
}
|
||||
.w-full{
|
||||
width: 100%;
|
||||
}
|
||||
.gap-20{
|
||||
gap: 20rpx;
|
||||
}
|
||||
.color-000{
|
||||
color: #000;
|
||||
}
|
||||
.color-fff{
|
||||
color: #fff;
|
||||
}
|
||||
.bg-fff{
|
||||
background-color: #fff;
|
||||
}
|
||||
.bg-gray{
|
||||
background-color: #F9F9F9;
|
||||
}
|
||||
.overflow-hide{
|
||||
/* #ifdef H5 */
|
||||
height: calc(100vh - 44px);
|
||||
/* #endif */
|
||||
/* #ifndef H5 */
|
||||
height: 100vh;
|
||||
/* #endif */
|
||||
overflow: hidden;
|
||||
}
|
||||
.no-wrap{
|
||||
white-space: nowrap;
|
||||
}
|
||||
.border-r-12{
|
||||
border-radius: 12rpx;
|
||||
}
|
||||
.border-r-18{
|
||||
border-radius: 18rpx;
|
||||
}
|
||||
.border-top{
|
||||
border-top: 1px solid #E5E5E5;
|
||||
}
|
||||
.border-bottom{
|
||||
border-bottom: 1px solid #E5E5E5;
|
||||
}
|
||||
.scale7{
|
||||
transform: scale(0.7);
|
||||
}
|
||||
.page-gray {
|
||||
min-height: calc(100vh);
|
||||
/* #ifdef H5 */
|
||||
min-height: calc(100vh - var(--window-top));
|
||||
/* #endif */
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
background: #F9F9F9;
|
||||
}
|
||||
.box-shadow{
|
||||
box-shadow: 0 0 5px #eee;
|
||||
}
|
||||
.safe-bottom{
|
||||
padding-bottom: env(safe-area-inset-bottom);
|
||||
/* #ifdef H5 */
|
||||
padding-bottom: 28rpx;
|
||||
/* #endif */
|
||||
}
|
||||
.position-all{
|
||||
left: 0;
|
||||
right: 0;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
}
|
||||
.fixed-top{
|
||||
position: fixed;
|
||||
/* #ifdef H5 */
|
||||
top: 44px;
|
||||
/* #endif */
|
||||
/* #ifndef H5 */
|
||||
top: 0;
|
||||
/* #endif */
|
||||
left: 0;
|
||||
right: 0;
|
||||
}
|
||||
.lh30 {
|
||||
line-height: 30px;
|
||||
}
|
||||
.default-box-padding{
|
||||
padding: 32rpx 24rpx;
|
||||
}
|
||||
.icon-arrow-down-fill {
|
||||
width: 16rpx;
|
||||
height: 10rpx;
|
||||
}
|
||||
.zIndex-999{
|
||||
z-index: 999;
|
||||
}
|
||||
.icon-default-size{
|
||||
width: 28rpx;
|
||||
height: 28rpx;
|
||||
}
|
||||
::v-deep.uni-easyinput__placeholder-class{
|
||||
font-size: 28rpx!important;
|
||||
}
|
||||
.filter-gray{
|
||||
filter: grayscale(1);
|
||||
}
|
||||
// .u-font-20{
|
||||
// font-size: 10px;
|
||||
// }
|
||||
// .u-font-24{
|
||||
// font-size: 12px;
|
||||
// }
|
||||
// .u-font-28{
|
||||
// font-size: 14px;
|
||||
// }
|
||||
// .u-font-32{
|
||||
// font-size: 16px;
|
||||
// }
|
||||
.line-th{
|
||||
text-decoration: line-through;
|
||||
}
|
||||
//覆盖u-view-plus 颜色
|
||||
.u-primary-light {
|
||||
color: $my-main-color;
|
||||
}
|
||||
::v-deep .u-border{
|
||||
border-width: 1px!important;
|
||||
}
|
||||
|
||||
::v-deep .u-m-t-16 .u-textarea{
|
||||
border-width: 1px!important;
|
||||
}
|
||||
|
|
@ -0,0 +1,42 @@
|
|||
<template>
|
||||
<view class="u-flex u-row-center ">
|
||||
<view class="color-999 my-empty u-relative">{{text}}</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default{
|
||||
props:{
|
||||
text:{
|
||||
type:String,
|
||||
default:'空空如也~'
|
||||
}
|
||||
},
|
||||
data(){
|
||||
return {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.my-empty{
|
||||
&:before,&::after{
|
||||
content: '';
|
||||
display: block;
|
||||
position: absolute;
|
||||
border-bottom: 1px solid #999;
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
}
|
||||
&:before{
|
||||
left: -80rpx;
|
||||
width: 60rpx;
|
||||
}
|
||||
&::after{
|
||||
width: 60rpx;
|
||||
right: -80rpx;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,458 @@
|
|||
<template>
|
||||
<button @click="navThanks" v-if="show">
|
||||
<view class="dong">
|
||||
<view class="monster">
|
||||
<view class="monster__face">
|
||||
<view class="monster__eye avatar-eye avatar-eye--green eye--left">
|
||||
<view class="avatar-eye-pupil pupil--green"><span class="avatar-eye-pupil-blackThing"><span
|
||||
class="avatar-eye-pupil-lightReflection"></span></span></view>
|
||||
</view>
|
||||
<view class="monster__eye avatar-eye avatar-eye--violet eye--right">
|
||||
<view class="avatar-eye-pupil pupil--pink"><span class="avatar-eye-pupil-blackThing"><span
|
||||
class="avatar-eye-pupil-lightReflection"></span></span></view>
|
||||
</view>
|
||||
<view class="monster__noses">
|
||||
<view class="monster__nose"></view>
|
||||
<view class="monster__nose"></view>
|
||||
</view>
|
||||
<view class="monster__mouth">
|
||||
<view class="monster__top"></view>
|
||||
<view class="monster__bottom"></view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</button>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {returnIsShenhe} from '@/utils/api.js'
|
||||
import {isIos} from '@/utils/app.js'
|
||||
export default {
|
||||
name: "other-xuanu",
|
||||
data() {
|
||||
return {
|
||||
show:false
|
||||
};
|
||||
},
|
||||
methods:{
|
||||
navThanks(){
|
||||
uni.navigateTo({
|
||||
url:'/other/index/index'
|
||||
})
|
||||
},
|
||||
async init(){
|
||||
const isShehe=await returnIsShenhe()
|
||||
this.show=isShehe
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
// #ifdef APP
|
||||
if(isIos()){
|
||||
// this.init()
|
||||
}
|
||||
// #endif
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
/* 大嘴鸟*/
|
||||
.dong {
|
||||
z-index: 9999;
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
right: -80px;
|
||||
transform: scale(0.24);
|
||||
-webkit-transform: scale(0.24);
|
||||
-moz-transform: scale(0.24);
|
||||
|
||||
}
|
||||
|
||||
.monster {
|
||||
transform: rotate(-50deg);
|
||||
-ms-transform: rotate(-50deg);
|
||||
/* IE 9 */
|
||||
-moz-transform: rotate(-50deg);
|
||||
/* Firefox */
|
||||
-webkit-transform: rotate(-50deg);
|
||||
/* Safari 和 Chrome */
|
||||
-o-transform: rotate(-50deg);
|
||||
/* Opera */
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
position: relative;
|
||||
width: 170px;
|
||||
height: 400px;
|
||||
border-top-left-radius: 200px;
|
||||
border-top-right-radius: 200px;
|
||||
background-color: rgb(255, 117, 129);
|
||||
box-shadow: 20px 20px 60px rgba(255, 117, 129,.7);
|
||||
}
|
||||
|
||||
.monster__face {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
flex-direction: column;
|
||||
position: absolute;
|
||||
top: 14%;
|
||||
width: 75%;
|
||||
height: 160px;
|
||||
}
|
||||
|
||||
.monster__noses {
|
||||
top: 50%;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
width: 28%;
|
||||
height: auto;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.monster__nose {
|
||||
width: 8px;
|
||||
height: 12px;
|
||||
border-radius: 20px;
|
||||
background: rgba(0, 0, 0, 0.5);
|
||||
box-shadow: 4px 8px 5px rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
|
||||
.monster__mouth {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
position: relative;
|
||||
width: 100%;
|
||||
height: 0%;
|
||||
overflow: hidden;
|
||||
border: 25px solid #FFC333;
|
||||
border-radius: 100px;
|
||||
background-color: #810332;
|
||||
animation: mouth 1.75s infinite;
|
||||
box-shadow: 4px 8px 5px rgba(0, 0, 0, 0.2);
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.monster__mouth::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
width: 150px;
|
||||
height: 80px;
|
||||
border-radius: 100px;
|
||||
background-color: #400018;
|
||||
}
|
||||
|
||||
.monster__mouth::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
bottom: -80px;
|
||||
width: 160px;
|
||||
height: 80px;
|
||||
border-top-left-radius: 50%;
|
||||
border-top-right-radius: 50%;
|
||||
background-color: #DC1B50;
|
||||
animation: tongue 1.75s infinite;
|
||||
}
|
||||
|
||||
.monster__top {
|
||||
position: absolute;
|
||||
top: -30px;
|
||||
width: 170px;
|
||||
height: 30px;
|
||||
border-bottom-left-radius: 10px;
|
||||
border-bottom-right-radius: 10px;
|
||||
background-color: #ffffff;
|
||||
z-index: 100;
|
||||
animation: t 1.75s infinite;
|
||||
}
|
||||
|
||||
.monster__bottom {
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
width: 100px;
|
||||
height: 30px;
|
||||
border-top-left-radius: 10px;
|
||||
border-top-right-radius: 10px;
|
||||
background-color: #ffffff;
|
||||
z-index: 100;
|
||||
animation: b 1.75s infinite;
|
||||
}
|
||||
|
||||
|
||||
.avatar-eye {
|
||||
position: absolute;
|
||||
top: -10%;
|
||||
width: 65px;
|
||||
height: 65px;
|
||||
background: linear-gradient(105deg, white, #cb87f4);
|
||||
border-radius: 100%;
|
||||
box-shadow: 4px 8px 5px rgba(0, 0, 0, 0.2);
|
||||
margin: 3px;
|
||||
-webkit-transform: translateX(-50%);
|
||||
transform: translateX(-50%);
|
||||
}
|
||||
|
||||
|
||||
.avatar-eye--green {
|
||||
background: linear-gradient(to bottom, #fdfdfd, #c3efea);
|
||||
}
|
||||
|
||||
.avatar-eye--violet {
|
||||
background: linear-gradient(to bottom, #fdfdfd, #e6d6f6);
|
||||
}
|
||||
|
||||
|
||||
.eye--left {
|
||||
left: 10%;
|
||||
}
|
||||
|
||||
.eye--right {
|
||||
left: 85%;
|
||||
}
|
||||
|
||||
.eye--center {
|
||||
left: 45%;
|
||||
top: 10%;
|
||||
}
|
||||
|
||||
.avatar-eye-pupil {
|
||||
position: absolute;
|
||||
width: 55%;
|
||||
height: 55%;
|
||||
left: 50%;
|
||||
top: 25%;
|
||||
-webkit-transform: translate(-50%);
|
||||
transform: translate(-50%);
|
||||
z-index: 100;
|
||||
border-radius: 100%;
|
||||
}
|
||||
|
||||
|
||||
.pupil--green {
|
||||
background: linear-gradient(135deg, rgba(188, 248, 177, 0.7), #2fa38c 75%);
|
||||
}
|
||||
|
||||
.pupil--pink {
|
||||
background: linear-gradient(135deg, #f1a183, #8535cd);
|
||||
}
|
||||
|
||||
|
||||
.avatar-eye-pupil-blackThing {
|
||||
position: absolute;
|
||||
width: 55%;
|
||||
height: 55%;
|
||||
left: 50%;
|
||||
top: 25%;
|
||||
background: #2c2f32;
|
||||
-webkit-transform: translate(-50%);
|
||||
transform: translate(-50%);
|
||||
border-radius: 100%;
|
||||
box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.2);
|
||||
}
|
||||
|
||||
.avatar-eye-pupil-lightReflection {
|
||||
position: absolute;
|
||||
width: 7px;
|
||||
height: 7px;
|
||||
left: 25%;
|
||||
top: 10%;
|
||||
background: #ebebeb;
|
||||
-webkit-transform: translate(-50%);
|
||||
transform: translate(-50%);
|
||||
border-radius: 100%;
|
||||
box-shadow: 10px 10px 10px rgba(255, 255, 255, 0.2);
|
||||
}
|
||||
/*大嘴动起来*/
|
||||
@keyframes t {
|
||||
|
||||
0%,
|
||||
10%,
|
||||
80%,
|
||||
100% {
|
||||
top: -30px;
|
||||
}
|
||||
|
||||
20% {
|
||||
top: 0px;
|
||||
}
|
||||
|
||||
30% {
|
||||
top: -20px;
|
||||
}
|
||||
|
||||
40% {
|
||||
top: -0px;
|
||||
}
|
||||
|
||||
50% {
|
||||
top: -25px;
|
||||
}
|
||||
|
||||
70% {
|
||||
top: 0px;
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes b {
|
||||
|
||||
0%,
|
||||
10%,
|
||||
80%,
|
||||
100% {
|
||||
bottom: -30px;
|
||||
}
|
||||
|
||||
20% {
|
||||
bottom: 0px;
|
||||
}
|
||||
|
||||
30% {
|
||||
bottom: -20px;
|
||||
}
|
||||
|
||||
40% {
|
||||
bottom: -0px;
|
||||
}
|
||||
|
||||
50% {
|
||||
bottom: -25px;
|
||||
}
|
||||
|
||||
70% {
|
||||
bottom: 0px;
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes mouth {
|
||||
|
||||
0%,
|
||||
10%,
|
||||
100% {
|
||||
width: 100%;
|
||||
height: 0%;
|
||||
}
|
||||
|
||||
15% {
|
||||
width: 90%;
|
||||
height: 30%;
|
||||
}
|
||||
|
||||
20% {
|
||||
width: 50%;
|
||||
height: 70%;
|
||||
}
|
||||
|
||||
25% {
|
||||
width: 70%;
|
||||
height: 70%;
|
||||
}
|
||||
|
||||
30% {
|
||||
width: 80%;
|
||||
height: 60%;
|
||||
}
|
||||
|
||||
35% {
|
||||
width: 60%;
|
||||
height: 70%;
|
||||
}
|
||||
|
||||
40% {
|
||||
width: 55%;
|
||||
height: 75%;
|
||||
}
|
||||
|
||||
45% {
|
||||
width: 50%;
|
||||
height: 90%;
|
||||
}
|
||||
|
||||
50% {
|
||||
width: 40%;
|
||||
height: 70%;
|
||||
}
|
||||
|
||||
55% {
|
||||
width: 70%;
|
||||
height: 95%;
|
||||
}
|
||||
|
||||
60% {
|
||||
width: 40%;
|
||||
height: 50%;
|
||||
}
|
||||
|
||||
65% {
|
||||
width: 100%;
|
||||
height: 60%;
|
||||
}
|
||||
|
||||
70% {
|
||||
width: 100%;
|
||||
height: 70%;
|
||||
}
|
||||
|
||||
75% {
|
||||
width: 90%;
|
||||
height: 70%;
|
||||
}
|
||||
|
||||
80% {
|
||||
width: 50%;
|
||||
height: 70%;
|
||||
}
|
||||
|
||||
85% {
|
||||
width: 90%;
|
||||
height: 50%;
|
||||
}
|
||||
|
||||
85% {
|
||||
width: 40%;
|
||||
height: 70%;
|
||||
}
|
||||
|
||||
90% {
|
||||
width: 90%;
|
||||
height: 30%;
|
||||
}
|
||||
|
||||
95% {
|
||||
width: 100%;
|
||||
height: 10%;
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes tongue {
|
||||
|
||||
0%,
|
||||
20%,
|
||||
100% {
|
||||
bottom: -80px;
|
||||
}
|
||||
|
||||
30%,
|
||||
90% {
|
||||
bottom: -40px;
|
||||
}
|
||||
|
||||
40% {
|
||||
bottom: -45px;
|
||||
}
|
||||
|
||||
50% {
|
||||
bottom: -50px;
|
||||
}
|
||||
|
||||
70% {
|
||||
bottom: -80px;
|
||||
}
|
||||
|
||||
90% {
|
||||
bottom: -40px;
|
||||
}
|
||||
}
|
||||
|
||||
</style>
|
||||
|
|
@ -3,45 +3,45 @@
|
|||
<u-popup v-model="shows" @close="close" :mask-close-able="false" :safe-area-inset-bottom="true" mode="bottom"
|
||||
border-radius="32" closeable>
|
||||
<view class="title">购买后继续观看</view>
|
||||
<view class="money">
|
||||
<!-- <view class="money">
|
||||
<view class="money-l flex align-center">
|
||||
账号余额:
|
||||
<text>{{moneyNum}}金豆</text>
|
||||
<text>{{moneyNum}}金币</text>
|
||||
<view class="money-l-go" @click="goWallet('/me/wallet/wallet')">
|
||||
查看明细
|
||||
</view>
|
||||
</view>
|
||||
<view class="money-r">
|
||||
解锁价格:
|
||||
<text>{{payPrice}}金豆</text>
|
||||
<text>{{payPrice}}金币</text>
|
||||
</view>
|
||||
</view>
|
||||
<scroll-view scroll-y="true" class="payLists">
|
||||
</view> -->
|
||||
<!-- <scroll-view scroll-y="true" class="payLists">
|
||||
<view class="payList">
|
||||
<view class="payList-item" @click="current = index" :class="current == index?'activePrice':''"
|
||||
v-for="(item,index) in wallet" :key="index">
|
||||
v-for="(item,index) in wallet" :key="index"> -->
|
||||
<!-- #ifdef MP-TOUTIAO -->
|
||||
<view class="payList-item-price">
|
||||
<!-- <view class="payList-item-price">
|
||||
{{item.payDiamond}}钻石
|
||||
</view>
|
||||
</view> -->
|
||||
<!-- #endif -->
|
||||
<!-- #ifndef MP-TOUTIAO -->
|
||||
<view class="payList-item-price">
|
||||
<!-- <view class="payList-item-price">
|
||||
¥{{item.price}}
|
||||
</view>
|
||||
</view> -->
|
||||
<!-- #endif -->
|
||||
<view class="payList-item-dou">
|
||||
{{item.money}}金豆
|
||||
<!-- <view class="payList-item-dou">
|
||||
{{item.money}}金币
|
||||
</view>
|
||||
<view class="payList-item-duo" v-if="item.giveMoney>0">
|
||||
多送{{item.giveMoney}}金豆
|
||||
多送{{item.giveMoney}}金币
|
||||
</view>
|
||||
<view class="payList-item-hui" v-if="item.remarks">
|
||||
{{item.remarks}}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</scroll-view> -->
|
||||
<!-- 支付类型 -->
|
||||
<view class="payType">
|
||||
<view class="payType-item" @tap='selectWay(item)' v-for="(item,index) in openLists" :key="index">
|
||||
|
|
@ -132,7 +132,11 @@
|
|||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
//需要支付的金豆
|
||||
orderId: {
|
||||
type: Number,
|
||||
default: null
|
||||
},
|
||||
//需要支付的金币
|
||||
payPrice: {
|
||||
type: Number,
|
||||
default: 0
|
||||
|
|
@ -176,55 +180,61 @@
|
|||
// #endif
|
||||
// #ifdef APP-PLUS
|
||||
if (plus.os.name.toLowerCase() === 'android') {
|
||||
this.openLists = [{
|
||||
image: '/static/images/pay/weixin.png',
|
||||
text: '微信',
|
||||
id: 2
|
||||
}, {
|
||||
image: '/static/images/pay/zhifubao.png',
|
||||
text: '支付宝',
|
||||
id: 1
|
||||
}];
|
||||
this.openWay = 2;
|
||||
let syPaySel = this.$queue.getData('syPaySel')
|
||||
if (syPaySel === '是') {
|
||||
let openListsItem = {
|
||||
image: '/static/images/pay/shouyi.png',
|
||||
text: '收益余额',
|
||||
id: 4
|
||||
};
|
||||
this.openLists.push(openListsItem)
|
||||
}
|
||||
} else {
|
||||
let checkIosPay = this.$queue.getData('checkIosPay');
|
||||
if (checkIosPay === '是') {
|
||||
this.openLists = [{
|
||||
image: '/static/images/pay/weixin.png',
|
||||
text: '苹果',
|
||||
id: 3
|
||||
}];
|
||||
this.openWay = 3;
|
||||
} else {
|
||||
this.openLists = [{
|
||||
image: '/static/images/pay/weixin.png',
|
||||
text: '微信',
|
||||
id: 2
|
||||
}, {
|
||||
this.openLists = [
|
||||
// {
|
||||
// image: '/static/images/pay/weixin.png',
|
||||
// text: '微信',
|
||||
// id: 2
|
||||
// },
|
||||
{
|
||||
image: '/static/images/pay/zhifubao.png',
|
||||
text: '支付宝',
|
||||
id: 1
|
||||
}];
|
||||
this.openWay = 2;
|
||||
let syPaySel = this.$queue.getData('syPaySel')
|
||||
if (syPaySel === '是') {
|
||||
let openListsItem = {
|
||||
image: '/static/images/pay/shouyi.png',
|
||||
text: '收益余额',
|
||||
id: 4
|
||||
};
|
||||
this.openLists.push(openListsItem)
|
||||
}
|
||||
}
|
||||
];
|
||||
this.openWay = 1;
|
||||
let syPaySel = this.$queue.getData('syPaySel')
|
||||
// if (syPaySel === '是') {
|
||||
// let openListsItem = {
|
||||
// image: '/static/images/pay/shouyi.png',
|
||||
// text: '收益余额',
|
||||
// id: 4
|
||||
// };
|
||||
// this.openLists.push(openListsItem)
|
||||
// }
|
||||
} else {
|
||||
let checkIosPay = this.$queue.getData('checkIosPay');
|
||||
// if (checkIosPay === '是') {
|
||||
// this.openLists = [{
|
||||
// image: '/static/images/pay/weixin.png',
|
||||
// text: '苹果',
|
||||
// id: 3
|
||||
// }];
|
||||
// this.openWay = 3;
|
||||
// } else {
|
||||
this.openLists = [
|
||||
// {
|
||||
// image: '/static/images/pay/weixin.png',
|
||||
// text: '微信',
|
||||
// id: 2
|
||||
// },
|
||||
{
|
||||
image: '/static/images/pay/zhifubao.png',
|
||||
text: '支付宝',
|
||||
id: 1
|
||||
}
|
||||
];
|
||||
this.openWay = 1;
|
||||
let syPaySel = this.$queue.getData('syPaySel')
|
||||
// if (syPaySel === '是') {
|
||||
// let openListsItem = {
|
||||
// image: '/static/images/pay/shouyi.png',
|
||||
// text: '收益余额',
|
||||
// id: 4
|
||||
// };
|
||||
// this.openLists.push(openListsItem)
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
// #endif
|
||||
|
|
@ -240,31 +250,31 @@
|
|||
|
||||
// #ifdef H5
|
||||
let ua = navigator.userAgent.toLowerCase();
|
||||
if (ua.indexOf('micromessenger') !== -1) {
|
||||
this.openLists = [{
|
||||
image: '/static/images/pay/weixin.png',
|
||||
text: '微信',
|
||||
id: 2
|
||||
}];
|
||||
this.openWay = 2;
|
||||
} else {
|
||||
// if (ua.indexOf('micromessenger') !== -1) {
|
||||
// this.openLists = [{
|
||||
// image: '/static/images/pay/weixin.png',
|
||||
// text: '微信',
|
||||
// id: 2
|
||||
// }];
|
||||
// this.openWay = 2;
|
||||
// } else {
|
||||
this.openLists = [{
|
||||
image: '/static/images/pay/zhifubao.png',
|
||||
text: '支付宝',
|
||||
id: 1
|
||||
}];
|
||||
this.openWay = 1;
|
||||
}
|
||||
// }
|
||||
|
||||
let syPaySel = this.$queue.getData('syPaySel')
|
||||
if (syPaySel === '是') {
|
||||
let openListsItem = {
|
||||
image: '/static/images/pay/shouyi.png',
|
||||
text: '收益余额',
|
||||
id: 4
|
||||
};
|
||||
this.openLists.push(openListsItem)
|
||||
}
|
||||
// if (syPaySel === '是') {
|
||||
// let openListsItem = {
|
||||
// image: '/static/images/pay/shouyi.png',
|
||||
// text: '收益余额',
|
||||
// id: 4
|
||||
// };
|
||||
// this.openLists.push(openListsItem)
|
||||
// }
|
||||
// #endif
|
||||
},
|
||||
methods: {
|
||||
|
|
@ -562,28 +572,36 @@
|
|||
// #endif
|
||||
|
||||
} else if (this.openWay == 1) {
|
||||
console.log(this.orderId)
|
||||
let paytype='h5'
|
||||
// #ifdef APP
|
||||
paytype='app'
|
||||
// #endif
|
||||
console.log('paypop payType='+paytype);
|
||||
// APP支付宝支付
|
||||
// #ifdef APP
|
||||
this.$Request.postT("/app/aliPay/payMoney", {
|
||||
classify: 1,
|
||||
payClassifyId: this.wallet[this.current].payClassifyId,
|
||||
}).then(ret => {
|
||||
this.$Request.getT("/app/wuyou/payOrder/"+ this.orderId+'?payType='+paytype,{}).then(ret => {
|
||||
console.log(ret)
|
||||
this.isCheckPay(ret.code, 'alipay', ret.data);
|
||||
// this.isCheckPay(ret.code, 'alipay', ret.data);
|
||||
that.$emit('paySuccess', ret.data)
|
||||
});
|
||||
// #endif
|
||||
// #ifdef H5
|
||||
let data = {
|
||||
classify: 2,
|
||||
payClassifyId: this.wallet[this.current].payClassifyId,
|
||||
orderId: this.orderId,
|
||||
}
|
||||
this.$Request.postT('/app/aliPay/payMoney', data).then(
|
||||
this.$Request.getT("/app/wuyou/payOrder/"+ this.orderId+'?payType='+paytype, {}).then(
|
||||
res => {
|
||||
if (res.code === 0) {
|
||||
const div = document.createElement('div')
|
||||
div.innerHTML = res.data //此处form就是后台返回接收到的数据
|
||||
document.body.appendChild(div)
|
||||
document.forms[0].submit()
|
||||
console.log(res)
|
||||
that.$emit('paySuccess', {
|
||||
ordersId: this.orderId,
|
||||
h5Url: res.data.h5Url
|
||||
})
|
||||
// const div = document.createElement('div')
|
||||
// div.innerHTML = res.data //此处form就是后台返回接收到的数据
|
||||
// document.body.appendChild(div)
|
||||
// document.forms[0].submit()
|
||||
} else {
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
|
|
@ -601,7 +619,7 @@
|
|||
this.$Request.postT("/app/ios/insertPayMoneyOrders", data).then(res => {
|
||||
if (res.code === 0) {
|
||||
this.iosPayId = res.data.orderId;
|
||||
this.iphonepay();
|
||||
// this.iphonepay();
|
||||
} else {
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
|
|
|
|||
|
|
@ -0,0 +1,742 @@
|
|||
<template>
|
||||
<view>
|
||||
<u-popup v-model="show">
|
||||
<view class="almost-lottery">
|
||||
<!-- head -->
|
||||
<view class="almost-lottery__head">
|
||||
<view class="btn-group u-flex u-row-between">
|
||||
<view :class="['action', isApple && 'action-shadow']" @click="toRed">
|
||||
<text class="pack"></text>
|
||||
<text class="content">红包<text class="num">{{ totalMoney }}</text></text>
|
||||
</view>
|
||||
<view :class="['action', isApple && 'action-shadow']" @click="toGift">
|
||||
<text class="gift"></text>
|
||||
<text class="content">我的奖品</text>
|
||||
</view>
|
||||
</view>
|
||||
<!-- <view class="tip"><text class="tip-content">每次抽奖消耗 {{ goldNum }} 金币,不限次数</text></view> -->
|
||||
</view>
|
||||
<!-- action -->
|
||||
|
||||
<!-- <view class="almost-lottery__action-dev" @tap="handleInitCanvas" v-if="isDev">
|
||||
<text class="text">重新生成画板-开发模式使用</text>
|
||||
</view>
|
||||
<view class="almost-lottery__action-dev" @tap="handleCheckPopup">
|
||||
<text class="text">查看 uni-popup 用例</text>
|
||||
</view> -->
|
||||
|
||||
<!-- lottery -->
|
||||
<view class="almost-lottery__wheel">
|
||||
<almost-lottery :lottery-size="lotteryConfig.lotterySize" :action-size="lotteryConfig.actionSize"
|
||||
:ring-count="2" :duration="1" :self-rotaty="false" :img-circled="true" :canvasCached="true"
|
||||
:prize-list="prizeList" :prize-index="prizeIndex" :lotteryBg="lotteryBg" :actionBg="actionBg"
|
||||
@reset-index="prizeIndex = -1" @draw-before="handleDrawBefore" @draw-start="handleDrawStart"
|
||||
@draw-end="handleDrawEnd" @finish="handleDrawFinish" v-if="prizeList.length" />
|
||||
<view class="almost-lottery__count">
|
||||
<text class="text">剩余免费抽奖 {{ freeNum }} 次</text>
|
||||
</view>
|
||||
</view>
|
||||
<!-- rule -->
|
||||
<view class="almost-lottery__rule">
|
||||
<view class="rule-head">
|
||||
<view class="line"></view>
|
||||
<text class="title">活动规则</text>
|
||||
<view class="line"></view>
|
||||
</view>
|
||||
<view class="rule-body">
|
||||
<view class="item">
|
||||
<view class="number">1</view>
|
||||
<view class="text">
|
||||
<text>抽奖细则:</text>
|
||||
<text>每人每天最多拥有{{ freeNumDay }}次抽奖机会</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="item item-rule">
|
||||
<view class="number">2</view>
|
||||
<view class="text">
|
||||
<text>奖励说明:</text>
|
||||
<text>a.现金奖:系统会即时转入红包余额,可提现。</text>
|
||||
<!-- <text>b.金币奖:系统会即时转入金币账户,可在平台内使用。</text> -->
|
||||
<text>b.实物奖:中奖后需联系客服领取。</text>
|
||||
</view>
|
||||
</view>
|
||||
<!-- <template >
|
||||
<view class="item">
|
||||
<view class="number">3</view>
|
||||
<view class="text">本次活动由XXXXXXX发起。</view>
|
||||
</view>
|
||||
<view class="item">
|
||||
<view class="number">4</view>
|
||||
<view class="text">本活动仅限17岁以上用户参加。</view>
|
||||
</view>
|
||||
<view class="item">
|
||||
<view class="number">5</view>
|
||||
<view class="text">本活动最终解释权归XXXXXXX所有。</view>
|
||||
</view>
|
||||
</template> -->
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</u-popup>
|
||||
</view>
|
||||
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import AlmostLottery from '@/uni_modules/almost-lottery/components/almost-lottery/almost-lottery.vue'
|
||||
import {
|
||||
clearCacheFile,
|
||||
clearStore
|
||||
} from '@/uni_modules/almost-lottery/utils/almost-utils.js'
|
||||
export default {
|
||||
name: 'Home',
|
||||
components: {
|
||||
AlmostLottery
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
show:true,
|
||||
//红包余额
|
||||
totalMoney: 0,
|
||||
//抽奖结果
|
||||
result: '',
|
||||
// 开启调试模式
|
||||
isDev: true,
|
||||
option: {},
|
||||
// 以下是转盘配置相关数据
|
||||
lotteryConfig: {
|
||||
// 抽奖转盘的整体尺寸,单位rpx
|
||||
lotterySize: 600,
|
||||
// 抽奖按钮的尺寸,单位rpx
|
||||
actionSize: 200
|
||||
},
|
||||
|
||||
// 以下是转盘 UI 配置
|
||||
// 转盘外环图,如有需要,请参考替换为自己的设计稿
|
||||
lotteryBg: require('@/uni_modules/almost-lottery/static/almost-lottery/almost-lottery__bg2x.png'),
|
||||
// 抽奖按钮图
|
||||
actionBg: require('@/uni_modules/almost-lottery/static/almost-lottery/almost-lottery__action2x.png'),
|
||||
|
||||
// 以下是奖品配置数据
|
||||
// 奖品数据
|
||||
prizeList: [],
|
||||
// 奖品是否设有库存
|
||||
onStock: true,
|
||||
// 中奖下标
|
||||
prizeIndex: -1,
|
||||
|
||||
// 是否正在抽奖中,避免重复触发
|
||||
prizeing: false,
|
||||
|
||||
// 以下为中奖概率有关数据
|
||||
// 是否由前端控制概率,默认不开启,强烈建议由后端控制
|
||||
onFrontend: false,
|
||||
// 权重随机数的最大值
|
||||
prizeWeightMax: 0,
|
||||
// 权重数组
|
||||
prizeWeightArr: [],
|
||||
|
||||
// 以下为业务需求有关示例数据
|
||||
// 金币余额
|
||||
goldCoin: 20,
|
||||
// 当日免费抽奖次数余额
|
||||
freeNum: 1,
|
||||
// 每次消耗的金币数
|
||||
goldNum: 20,
|
||||
// 每天免费抽奖次数
|
||||
freeNumDay: 10
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
isApple() {
|
||||
return uni.getSystemInfoSync().platform === 'ios'
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
toRed() {
|
||||
uni.navigateTo({
|
||||
url: '/me/HEWZtgyqRH/HEWZtgyqRH'
|
||||
})
|
||||
|
||||
},
|
||||
toGift() {
|
||||
console.log('1');
|
||||
uni.navigateTo({
|
||||
url: '/me/giftczgw/giftczgw'
|
||||
})
|
||||
},
|
||||
// 重新生成
|
||||
handleInitCanvas() {
|
||||
clearCacheFile()
|
||||
clearStore()
|
||||
|
||||
this.prizeList = []
|
||||
this.getPrizeList()
|
||||
},
|
||||
// 通过 popup 打开
|
||||
handleCheckPopup() {
|
||||
uni.navigateTo({
|
||||
url: '/pages/popup/popup'
|
||||
})
|
||||
},
|
||||
// 获取奖品列表
|
||||
async getPrizeList() {
|
||||
uni.showLoading({
|
||||
title: '奖品准备中...'
|
||||
})
|
||||
|
||||
// 等待接口返回的数据进一步处理
|
||||
let res = await this.requestApiGetPrizeList()
|
||||
console.log('获取奖品列表', res)
|
||||
|
||||
if (res.ok) {
|
||||
let data = res.data
|
||||
if (data.length) {
|
||||
this.prizeList = data
|
||||
console.log('已获取到奖品列表数据,开始绘制抽奖转盘')
|
||||
|
||||
// 计算开始绘制的时间
|
||||
if (console.time) {
|
||||
console.time('绘制转盘用时')
|
||||
}
|
||||
|
||||
// 如果开启了前端控制概率
|
||||
// 得出权重的最大值并生成权重数组
|
||||
if (this.onFrontend) {
|
||||
// 生成权重数组并排序取得最大值
|
||||
this.prizeWeightArr = this.prizeList.map(item => item.prizeWeight)
|
||||
let prizeWeightArrSort = [...this.prizeWeightArr]
|
||||
prizeWeightArrSort.sort((a, b) => b - a)
|
||||
|
||||
// 开放自定义权重最大值,没有自定义则取权重数组中的最大值
|
||||
this.prizeWeightMax = this.prizeWeightMax > 0 ? this.prizeWeightMax : prizeWeightArrSort[0]
|
||||
}
|
||||
}
|
||||
} else {
|
||||
uni.hideLoading()
|
||||
uni.showToast({
|
||||
title: '获取奖品失败',
|
||||
mask: true,
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
},
|
||||
// 模拟请求 获取奖品列表 接口,
|
||||
// 注意这里返回的是一个 Promise
|
||||
// 大哥,这里只是模拟,别告诉我你不会对接自己的接口
|
||||
async requestApiGetPrizeList() {
|
||||
const res = await this.$Request.getT('/app/discSpinning/selectDiscSpinning')
|
||||
if (res.code == 0) {
|
||||
return {
|
||||
ok: true,
|
||||
data: res.data.records.map(v => {
|
||||
return {
|
||||
...v,
|
||||
prizeId: v.id,
|
||||
prizeName: v.name,
|
||||
prizeStock: 10,
|
||||
prizeWeight: 200,
|
||||
prizeImage: v.url,
|
||||
// prizeImage: require('@/static/git.png')
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
return
|
||||
return new Promise((resolve, reject) => {
|
||||
let requestTimer = setTimeout(() => {
|
||||
clearTimeout(requestTimer)
|
||||
requestTimer = null
|
||||
|
||||
// prizeStock 奖品库存
|
||||
// prizeWeight 中奖概率,数值越大中奖概率越高,权重一样时随机中奖
|
||||
resolve({
|
||||
ok: true,
|
||||
data: [{
|
||||
prizeId: 1,
|
||||
prizeName: '0.1元现金',
|
||||
prizeStock: 10,
|
||||
prizeWeight: 200,
|
||||
prizeImage: require('@/static/git.png')
|
||||
},
|
||||
{
|
||||
prizeId: 2,
|
||||
prizeName: '10元现金',
|
||||
prizeStock: 0,
|
||||
prizeWeight: 50,
|
||||
prizeImage: 'https://vkceyugu.cdn.bspapp.com/VKCEYUGU-dc-site/56f085e0-bcfe-11ea-b244-a9f5e5565f30.png'
|
||||
},
|
||||
{
|
||||
prizeId: 3,
|
||||
prizeName: '5元话费',
|
||||
prizeStock: 1,
|
||||
prizeWeight: 80
|
||||
},
|
||||
{
|
||||
prizeId: 4,
|
||||
prizeName: '50元现金',
|
||||
prizeStock: 0,
|
||||
prizeWeight: 10,
|
||||
prizeImage: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAAZCAYAAADE6YVjAAAB2klEQVRIia3Wv09TURjG8U+u2kQZcNENh2ok0cnJ0R+L0RB2g/EvwITEwRgnV0Zx0fAHYBh0khBD4sBAmAgDiwQNg4qwmSBDAYf7Fi+n97al9UlObnvO836f3tO355b2GsAYZrCBPRzGdSPmx8J3YtXwDDsB7TR2wl/rNmAYK13C07ES9W11E9s9BjTHdnBKVf8PAcWgehpwCssF0w/5FzqLgw7AA7zDQ/wqzC8H90jjSeFMYW0Yr8PzALfjOh7z1wve2YTzpLlQw2ay+KZ1N7vS24SziVqGexhKzB07pEJXk/dDwTetdZ9HewwZLWFNw2oyudZjQFNrCW8109pqS32GpPX1TOu586fPkLR+IEMjmbzYZ0ha34Atx/fwW58hXxPeFixo7Yg7PQbcKmEtZFgsMb/C4AkDBuUnQKpFuFZI3cZuvP6C+8g6wDP572O95C4Og49/W/YJl/G5YPqO9yV3dh4f8LMCfhjcI93Afix8xAX5SVx2YBY10yagEdxjmiwY7uISXuIFrlSEPG0TMllWcAbzYViXd0rzeXC6ImSiImA+eKU6h7mCeV/eCBMnCJkLzpHSztnFCJ7L//ZkOFv1iRLtRd1IcLpSHVP4jccVnkexPqXkmd7UX15b7tiz29ReAAAAAElFTkSuQmCC'
|
||||
},
|
||||
{
|
||||
prizeId: 5,
|
||||
prizeName: '1卷抽纸',
|
||||
prizeStock: 3,
|
||||
prizeWeight: 3000,
|
||||
prizeImage: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAABCElEQVRoge3YMa4BURSH8Y8o7UAp0WgkotBZwluAfhqlZSgUGr23ENUUCpppJnTswAIUSCaTiziZJ8d9/193zdzrfMltABF5plb+oLscDoAV0Pn8OC/lwDhL0k35QT3wstcIuM61Cj0IhXiNuAvOFwr5SgrxRiHeKMSbhnHfAVgU1i1gajhnBpwK6wnQtgxkDTlmSTq/L7rLYQ9byG+WpLvCOT8YQ6K5WgrxRiHeKMQbhXijEG8U4o1CvIkmxPrDquwMrI37KlFJSJake2BUxVlW0VytaEKsV6t5+8Ohak3rRmtIH9hav/QvRHO1FOKNQrwJheQfn+I9wflCIeNHLzuQc51PRP6rC1ZeIm1I8cC5AAAAAElFTkSuQmCC'
|
||||
},
|
||||
{
|
||||
prizeId: 6,
|
||||
prizeName: '0.2元现金',
|
||||
prizeStock: 8,
|
||||
prizeWeight: 120
|
||||
},
|
||||
{
|
||||
prizeId: 7,
|
||||
prizeName: '谢谢参与',
|
||||
prizeStock: 100,
|
||||
prizeWeight: 10000
|
||||
},
|
||||
{
|
||||
prizeId: 8,
|
||||
prizeName: '100金币',
|
||||
prizeStock: 100,
|
||||
prizeWeight: 3000
|
||||
}
|
||||
]
|
||||
})
|
||||
}, 200)
|
||||
})
|
||||
},
|
||||
// 抽奖开始之前
|
||||
async handleDrawBefore(callback) {
|
||||
|
||||
console.log('抽奖开始之前')
|
||||
let flag = false
|
||||
|
||||
// 还有免费数次
|
||||
if (this.freeNum > 0) {
|
||||
this.freeNum--
|
||||
flag = true
|
||||
} else {
|
||||
flag = false
|
||||
uni.showToast({
|
||||
title: '抽奖次数不足',
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
|
||||
callback(flag)
|
||||
},
|
||||
// 本次抽奖开始
|
||||
handleDrawStart() {
|
||||
console.log('触发抽奖按钮')
|
||||
if (this.prizeing) return
|
||||
this.prizeing = true
|
||||
|
||||
this.tryLotteryDraw()
|
||||
},
|
||||
// 尝试发起抽奖
|
||||
tryLotteryDraw() {
|
||||
console.log('旋转开始,获取中奖下标......')
|
||||
// 判断是否由前端控制概率
|
||||
if (this.onFrontend) {
|
||||
this.localGetPrizeIndex()
|
||||
} else {
|
||||
this.remoteGetPrizeIndex()
|
||||
}
|
||||
},
|
||||
// 本地获取中奖下标
|
||||
localGetPrizeIndex() {
|
||||
console.warn('###当前处于前端控制中奖概率,安全起见,强烈建议由后端控制###')
|
||||
// 前端控制概率的情况下,需要拿到最接近随机权重且大于随机权重的值
|
||||
// 后端控制概率的情况下,通常会直接返回 prizeId
|
||||
if (!this.prizeWeightMax || !this.prizeWeightArr.length) {
|
||||
console.warn('###当前已开启前端控制中奖概率,但是奖品数据列表中的 prizeWeight 参数似乎配置不正确###')
|
||||
return
|
||||
}
|
||||
console.log('当前权重最大值为 =>', this.prizeWeightMax)
|
||||
|
||||
// 注意这里使用了 Math.ceil,如果某个权重的值为 0,则始终无法中奖
|
||||
let randomWeight = Math.ceil(Math.random() * this.prizeWeightMax)
|
||||
console.log('本次权重随机数 =>', randomWeight)
|
||||
|
||||
// 生成大于等于随机权重的数组
|
||||
let tempMaxArrs = []
|
||||
this.prizeList.forEach((item) => {
|
||||
if (item.prizeWeight >= randomWeight) {
|
||||
tempMaxArrs.push(item.prizeWeight)
|
||||
}
|
||||
})
|
||||
console.log('tempMaxArrs', tempMaxArrs)
|
||||
|
||||
// 如果大于随机权重的数组有值,先对这个数组排序然后取值
|
||||
// 反之新建一个临时的包含所有权重的已排序数组,然后取值
|
||||
let tempMaxArrsLen = tempMaxArrs.length
|
||||
if (tempMaxArrsLen) {
|
||||
tempMaxArrs.sort((a, b) => a - b)
|
||||
// 取值时,如果存在多个值,分两种情况
|
||||
if (tempMaxArrsLen > 1) {
|
||||
// 检查是否存在重复的值
|
||||
let sameCount = 0
|
||||
for (let i = 0; i < tempMaxArrs.length; i++) {
|
||||
if (tempMaxArrs[i] === tempMaxArrs[0]) {
|
||||
sameCount++
|
||||
}
|
||||
}
|
||||
|
||||
// 值不相等的情况下取最接近的值,也就是第1个值
|
||||
if (sameCount === 1) {
|
||||
this.prizeIndex = this.prizeWeightArr.indexOf(tempMaxArrs[0])
|
||||
} else {
|
||||
// 存在值相等时,随机取值,当然这里你可以自己决定是否随机取值
|
||||
let sameWeight = tempMaxArrs[0]
|
||||
let sameWeightArr = []
|
||||
let sameWeightItem = {}
|
||||
this.prizeWeightArr.forEach((item, index) => {
|
||||
if (item === sameWeight) {
|
||||
sameWeightArr.push({
|
||||
prizeWeight: item,
|
||||
index
|
||||
})
|
||||
}
|
||||
})
|
||||
console.log('sameWeightArr', sameWeightArr)
|
||||
sameWeightItem = sameWeightArr[Math.floor(Math.random() * sameWeightArr.length)]
|
||||
console.log('sameWeightItem', sameWeightItem)
|
||||
this.prizeIndex = sameWeightItem.index
|
||||
}
|
||||
} else {
|
||||
this.prizeIndex = this.prizeWeightArr.indexOf(tempMaxArrs[0])
|
||||
}
|
||||
}
|
||||
|
||||
console.log('本次抽中奖品 =>', this.prizeList[this.prizeIndex].prizeName)
|
||||
|
||||
// 如果奖品设有库存
|
||||
if (this.onStock) {
|
||||
console.log('本次奖品库存 =>', this.prizeList[this.prizeIndex].prizeStock)
|
||||
}
|
||||
},
|
||||
// 远程请求接口获取中奖下标
|
||||
// 大哥,这里只是模拟,别告诉我你不会对接自己的接口
|
||||
async remoteGetPrizeIndex() {
|
||||
this.result = ''
|
||||
console.warn('###当前处于模拟的请求接口,并返回了中奖信息###')
|
||||
const res = await this.$Request.getT('app/discSpinning/draw', {
|
||||
orderId: this.option.orderId || 2145
|
||||
})
|
||||
console.log(res);
|
||||
if (res.code != 0) {
|
||||
return uni.showToast({
|
||||
title: res.msg
|
||||
})
|
||||
}
|
||||
this.result = res.data
|
||||
|
||||
let list = [...this.prizeList]
|
||||
// 这里随机产生的 prizeId 是模拟后端返回的 prizeId
|
||||
const arr = list.filter(v => v.type == res.data.type)
|
||||
let prizeId = arr[0].prizeId
|
||||
|
||||
// 拿到后端返回的 prizeId 后,开始循环比对得出那个中奖的数据
|
||||
for (let i = 0; i < list.length; i++) {
|
||||
let item = list[i]
|
||||
if (item.prizeId === prizeId) {
|
||||
// 中奖下标
|
||||
this.prizeIndex = i
|
||||
break
|
||||
}
|
||||
}
|
||||
console.log('本次抽中奖品 =>', this.prizeList[this.prizeIndex].prizeName)
|
||||
},
|
||||
// 本次抽奖结束
|
||||
handleDrawEnd() {
|
||||
console.log('旋转结束,执行拿到结果后到逻辑')
|
||||
// 旋转结束后,开始处理拿到结果后的逻辑
|
||||
// const prize = this.prizeList[this.prizeIndex]
|
||||
const prize = this.result
|
||||
let {
|
||||
name
|
||||
} = prize
|
||||
let tipContent = ''
|
||||
|
||||
if (name.type == 1) {
|
||||
tipContent = '很遗憾,没有中奖,请再接再厉!'
|
||||
} else {
|
||||
tipContent = `恭喜您,获得 ${name}${this.result.type==2?(this.result.number+'元'):''} !`
|
||||
}
|
||||
const _this = this;
|
||||
uni.showModal({
|
||||
content: tipContent,
|
||||
showCancel: false,
|
||||
success() {
|
||||
const {
|
||||
orderId,
|
||||
id
|
||||
} = _this.result
|
||||
_this.$Request.postJson('app/discSpinning/receive', _this.result).then(res => {
|
||||
_this.result = ''
|
||||
console.log(res)
|
||||
if (res.code == 0) {
|
||||
uni.showToast({
|
||||
title: '领取成功',
|
||||
icon: 'none'
|
||||
})
|
||||
_this.getRedPack()
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: '领取失败',
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
complete: () => {
|
||||
this.prizeing = false
|
||||
}
|
||||
})
|
||||
},
|
||||
// 抽奖转盘绘制完成
|
||||
handleDrawFinish(res) {
|
||||
console.log('抽奖转盘绘制完成', res)
|
||||
|
||||
if (res.ok) {
|
||||
// 计算结束绘制的时间
|
||||
if (console.timeEnd) {
|
||||
console.timeEnd('绘制转盘用时')
|
||||
}
|
||||
}
|
||||
|
||||
let stoTimer = setTimeout(() => {
|
||||
stoTimer = null
|
||||
|
||||
uni.hideLoading()
|
||||
// uni.showToast({
|
||||
// title: res.msg,
|
||||
// mask: true,
|
||||
// icon: 'none'
|
||||
// })
|
||||
}, 50)
|
||||
},
|
||||
async getRedPack() {
|
||||
const res = await this.$Request.getT('app/moneyDetails/selectUserMoney')
|
||||
if (res.code == 0) {
|
||||
this.totalMoney = res.data.amount
|
||||
}
|
||||
}
|
||||
},
|
||||
onLoad(opt) {
|
||||
this.option = opt
|
||||
this.prizeList = []
|
||||
this.getRedPack()
|
||||
this.getPrizeList()
|
||||
},
|
||||
onUnload() {
|
||||
uni.hideLoading()
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.btn-group {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
right: 0;
|
||||
z-index: 2;
|
||||
top: 200px;
|
||||
gap: 20rpx;
|
||||
padding: 0 32rpx;
|
||||
}
|
||||
|
||||
.almost-lottery {
|
||||
flex: 1;
|
||||
background-color: #FF893F;
|
||||
}
|
||||
|
||||
.almost-lottery__head {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
height: 640rpx;
|
||||
background: url('~static/images/lottery/top-bg.png') no-repeat center center/cover;
|
||||
|
||||
.action {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
flex: 1;
|
||||
height: 88rpx;
|
||||
line-height: 88rpx;
|
||||
margin: 0 auto;
|
||||
color: #FFFFFF;
|
||||
font-size: 32rpx;
|
||||
background-color: rgba(255, 136, 61, 1);
|
||||
border-radius: 44rpx;
|
||||
}
|
||||
|
||||
.action-shadow {
|
||||
box-shadow: 0px 14rpx 0px 0px rgba(235, 112, 36, 1);
|
||||
}
|
||||
|
||||
.pack {
|
||||
width: 44rpx;
|
||||
height: 44rpx;
|
||||
margin-right: 10rpx;
|
||||
background-repeat: no-repeat;
|
||||
background-position: center center;
|
||||
background-size: contain;
|
||||
background-image: url("~static/red-pack.png");
|
||||
}
|
||||
|
||||
.gift {
|
||||
width: 44rpx;
|
||||
height: 44rpx;
|
||||
margin-right: 10rpx;
|
||||
background-repeat: no-repeat;
|
||||
background-position: center center;
|
||||
background-size: contain;
|
||||
background-image: url("~static/gift.png");
|
||||
}
|
||||
|
||||
.gold {
|
||||
width: 44rpx;
|
||||
height: 44rpx;
|
||||
margin-right: 10rpx;
|
||||
background-repeat: no-repeat;
|
||||
background-position: center center;
|
||||
background-size: contain;
|
||||
background-image: url("~static/images/lottery/gold.png");
|
||||
|
||||
@media (-webkit-min-device-pixel-ratio: 2),
|
||||
(min-device-pixel-ratio: 2) {
|
||||
background-image: url("~static/images/lottery/gold@2x.png");
|
||||
}
|
||||
|
||||
@media (-webkit-min-device-pixel-ratio: 3),
|
||||
(min-device-pixel-ratio: 3) {
|
||||
background-image: url("~static/images/lottery/gold@3x.png");
|
||||
}
|
||||
}
|
||||
|
||||
.num {
|
||||
color: #F9FC31;
|
||||
}
|
||||
|
||||
.tip {
|
||||
position: relative;
|
||||
top: 428rpx;
|
||||
color: #FFFFFF;
|
||||
font-size: 24rpx;
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
|
||||
.almost-lottery__wheel {
|
||||
text-align: center;
|
||||
|
||||
.almost-lottery__count {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
text-align: center;
|
||||
padding: 40rpx 0;
|
||||
}
|
||||
|
||||
.text {
|
||||
color: #FFFFFF;
|
||||
font-size: 24rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.almost-lottery__rule {
|
||||
padding: 0 28rpx;
|
||||
color: #FFF8CB;
|
||||
|
||||
.rule-head {
|
||||
display: flex;
|
||||
justify-content: space-around;
|
||||
align-items: center;
|
||||
margin: 40rpx 0;
|
||||
|
||||
.line {
|
||||
flex: 1;
|
||||
height: 1px;
|
||||
background-color: #FFF3A5;
|
||||
}
|
||||
|
||||
.title {
|
||||
width: 280rpx;
|
||||
color: #F63857;
|
||||
line-height: 70rpx;
|
||||
text-align: center;
|
||||
margin: 0 20rpx;
|
||||
border-radius: 8rpx;
|
||||
background-image: linear-gradient(0deg, rgba(255, 242, 158, 1), rgba(255, 244, 168, 1));
|
||||
}
|
||||
}
|
||||
|
||||
.rule-body {
|
||||
color: #FFF8CB;
|
||||
font-size: 24rpx;
|
||||
padding: 10rpx 0 40rpx;
|
||||
|
||||
.item {
|
||||
display: flex;
|
||||
margin-bottom: 10rpx;
|
||||
}
|
||||
|
||||
.number {
|
||||
position: relative;
|
||||
top: 4rpx;
|
||||
width: 28rpx;
|
||||
height: 28rpx;
|
||||
line-height: 28rpx;
|
||||
text-align: center;
|
||||
color: #F63857;
|
||||
background: #FFF8CB;
|
||||
border-radius: 50%;
|
||||
margin-right: 10rpx;
|
||||
}
|
||||
|
||||
.text {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.item-rule .text {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.almost-lottery__action-dev {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
width: 400rpx;
|
||||
height: 80rpx;
|
||||
border-radius: 10rpx;
|
||||
text-align: center;
|
||||
background-color: red;
|
||||
margin: 0 auto 40rpx;
|
||||
|
||||
.text {
|
||||
color: #FFFFFF;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.almost-lottery__popup-wrap {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
|
||||
.almost-lottery {
|
||||
background: transparent;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,175 @@
|
|||
<template>
|
||||
<view>
|
||||
<u-popup v-model="show" mode="center" @close="close">
|
||||
<view class="bg">
|
||||
<view class="title">恭喜您获得</view>
|
||||
<view class="goods">
|
||||
<template v-if="result&&result.type==3">
|
||||
<view class="u-flex u-col-center u-row-center">
|
||||
<image style="height: 42px;" src="/static/red-pack.png" mode="heightFix"></image>
|
||||
</view>
|
||||
<view class="u-flex u-row-center">
|
||||
<view class="type">物品</view>
|
||||
</view>
|
||||
</template>
|
||||
<template v-if="result&&result.type==2">
|
||||
<view class="u-flex color-money u-col-center u-row-center">
|
||||
<view class="money">{{result.number}}</view>
|
||||
<view class="font-bold" style="margin-top: 20rpx;">元</view>
|
||||
</view>
|
||||
<view class="u-flex u-row-center">
|
||||
<view class="type">现金红包</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
</view>
|
||||
<view class="u-flex u-row-center btn-box">
|
||||
<view class="btn" @click="lingqu">立即领取</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="u-flex u-row-center">
|
||||
<u-icon name="close-circle" :size="54" @click="close" color="#fff"></u-icon>
|
||||
</view>
|
||||
</u-popup>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
show: false,
|
||||
result: ''
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
open(data) {
|
||||
console.log(data);
|
||||
this.result = data
|
||||
this.show = true
|
||||
},
|
||||
lingqu() {
|
||||
const {
|
||||
orderId,
|
||||
id
|
||||
} = this.result
|
||||
this.$Request.postJson('app/discSpinning/receive', this.result).then(res => {
|
||||
this.result = ''
|
||||
console.log(res)
|
||||
if (res.code == 0) {
|
||||
uni.showToast({
|
||||
title: '领取成功',
|
||||
icon: 'none'
|
||||
})
|
||||
this.$emit('success')
|
||||
this.close()
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: '领取失败',
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
close() {
|
||||
this.show = false
|
||||
if(!this.result){
|
||||
return
|
||||
}
|
||||
const {
|
||||
orderId,
|
||||
id
|
||||
} = this.result
|
||||
this.$Request.postJson('app/discSpinning/receive', this.result).then(res => {
|
||||
this.result = ''
|
||||
console.log(res)
|
||||
if (res.code == 0) {
|
||||
this.$emit('success')
|
||||
this.close()
|
||||
} else {
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
::v-deep .u-mode-center-box {
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
.color-money {
|
||||
color: #E42F00;
|
||||
}
|
||||
|
||||
.money {
|
||||
font-weight: 700;
|
||||
font-size: 72rpx;
|
||||
letter-spacing: 2px;
|
||||
}
|
||||
|
||||
.bg {
|
||||
width: 628rpx;
|
||||
height: 770rpx;
|
||||
margin-right: 10rpx;
|
||||
background-color: transparent;
|
||||
background-repeat: no-repeat;
|
||||
background-position: center center;
|
||||
background-size: cover;
|
||||
background-image: url("~static/images/zhuanpan/ling-qu.png");
|
||||
position: relative;
|
||||
|
||||
@media (-webkit-min-device-pixel-ratio: 2),
|
||||
(min-device-pixel-ratio: 2) {
|
||||
background-image: url("~static/images/zhuanpan/ling-qu@2x.png");
|
||||
}
|
||||
|
||||
.title {
|
||||
position: absolute;
|
||||
top: 238rpx;
|
||||
text-align: center;
|
||||
left: 0;
|
||||
right: 0;
|
||||
font-weight: 700;
|
||||
font-size: 58rpx;
|
||||
color: #AF6920;
|
||||
letter-spacing: 4rpx;
|
||||
}
|
||||
|
||||
.goods {
|
||||
position: absolute;
|
||||
top: 326rpx;
|
||||
text-align: center;
|
||||
left: 0;
|
||||
right: 0;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.type {
|
||||
padding: 6rpx 28rpx;
|
||||
border-radius: 100rpx;
|
||||
background: #E25B41;
|
||||
font-size: 28rpx;
|
||||
color: #fff;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.btn-box {
|
||||
position: absolute;
|
||||
top: 574rpx;
|
||||
left: 0;
|
||||
right: 0;
|
||||
|
||||
.btn {
|
||||
padding: 10rpx 60rpx 10rpx 64rpx;
|
||||
text-align: center;
|
||||
font-weight: bold;
|
||||
font-size: 44rpx;
|
||||
color: #AF6920;
|
||||
letter-spacing: 2px;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,163 @@
|
|||
<template>
|
||||
<view>
|
||||
<u-popup v-model="show" mode="center" @close="close">
|
||||
<view class="bg">
|
||||
<view class="title">恭喜您获得</view>
|
||||
<view class="goods">
|
||||
<template v-if="result&&result.type==3">
|
||||
<view class="u-flex u-col-center u-row-center">
|
||||
<image style="height: 100px;" :src="result.img" mode="heightFix"></image>
|
||||
</view>
|
||||
<view class="u-flex u-row-center u-m-t-30">
|
||||
<view class="type">{{result.name}}</view>
|
||||
</view>
|
||||
</template>
|
||||
<template v-if="result&&result.type==2">
|
||||
<view class="u-flex color-money u-col-center u-row-center">
|
||||
<view class="money">{{result.number}}</view>
|
||||
<view class="font-bold " style="margin-top: 20rpx;font-size: 36rpx;">元</view>
|
||||
</view>
|
||||
<view class="u-flex u-m-t-24 u-row-center">
|
||||
<view class="type">现金红包</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
</view>
|
||||
|
||||
<view class="u-flex close u-row-center">
|
||||
<u-icon name="close-circle" :size="54" @click="close" color="#fff"></u-icon>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</u-popup>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
show: false,
|
||||
result: ''
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
open(data) {
|
||||
console.log(data);
|
||||
this.result = data
|
||||
this.show = true
|
||||
},
|
||||
close() {
|
||||
console.log('抽奖弹窗关闭');
|
||||
this.show = false
|
||||
if(!this.result){
|
||||
return
|
||||
}
|
||||
const {
|
||||
orderId,
|
||||
id
|
||||
} = this.result
|
||||
this.$Request.postJson('app/discSpinning/receive', this.result).then(res => {
|
||||
this.result = ''
|
||||
console.log(res)
|
||||
if (res.code == 0) {
|
||||
console.log('抽奖领取成功');
|
||||
const key=res.data==0?'isBindAliPay':undefined
|
||||
this.$emit('close',key)
|
||||
if(key&&key=='isBindAliPay'){
|
||||
uni.navigateTo({
|
||||
url:'/me/yaoqing/zhifubao-tixain'
|
||||
})
|
||||
}
|
||||
} else {
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
::v-deep .u-mode-center-box {
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
.color-money {
|
||||
color: #E42F00;
|
||||
}
|
||||
|
||||
.money {
|
||||
font-weight: 700;
|
||||
font-size: 96rpx;
|
||||
letter-spacing: 2px;
|
||||
}
|
||||
|
||||
.bg {
|
||||
width: 628rpx;
|
||||
height: 770rpx;
|
||||
margin-right: 10rpx;
|
||||
background-color: transparent;
|
||||
background-repeat: no-repeat;
|
||||
background-position: center center;
|
||||
background-size: cover;
|
||||
background-image: url("~static/images/zhuanpan/gift.png");
|
||||
position: relative;
|
||||
|
||||
@media (-webkit-min-device-pixel-ratio: 2),
|
||||
(min-device-pixel-ratio: 2) {
|
||||
background-image: url("~static/images/zhuanpan/gift@2x.png");
|
||||
}
|
||||
|
||||
.title {
|
||||
position: absolute;
|
||||
top: 218rpx;
|
||||
text-align: center;
|
||||
left: 0;
|
||||
right: 0;
|
||||
font-weight: 700;
|
||||
font-size: 60rpx;
|
||||
color: #AF6920;
|
||||
letter-spacing: 4rpx;
|
||||
}
|
||||
|
||||
.goods {
|
||||
position: absolute;
|
||||
top: 336rpx;
|
||||
text-align: center;
|
||||
left: 0;
|
||||
right: 0;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.type {
|
||||
padding: 6rpx 28rpx;
|
||||
border-radius: 100rpx;
|
||||
background: #E25B41;
|
||||
font-size: 28rpx;
|
||||
color: #fff;
|
||||
font-weight: bold;
|
||||
}
|
||||
.close{
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
}
|
||||
.btn-box {
|
||||
position: absolute;
|
||||
top: 574rpx;
|
||||
left: 0;
|
||||
right: 0;
|
||||
|
||||
.btn {
|
||||
padding: 10rpx 60rpx 10rpx 64rpx;
|
||||
text-align: center;
|
||||
font-weight: bold;
|
||||
font-size: 44rpx;
|
||||
color: #AF6920;
|
||||
letter-spacing: 2px;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
</style>
|
||||
|
|
@ -4,7 +4,7 @@
|
|||
<view class="list-box">
|
||||
<view class="list-box-title flex align-center justify-between">
|
||||
<view class="list-box-title-name">
|
||||
{{title}}
|
||||
{{title||''}}
|
||||
</view>
|
||||
<view @click="clickItem('more')" class="list-box-title-more flex align-center">
|
||||
查看更多
|
||||
|
|
|
|||
|
|
@ -0,0 +1 @@
|
|||
vMLdZb1r
|
||||
|
|
@ -0,0 +1,94 @@
|
|||
<template>
|
||||
<view class="demo-title">
|
||||
<view>
|
||||
<view v-if="type === 'first'" class="main_title">
|
||||
<view v-if="leftIcon" class="main_title__icon main_title__icon--left" :class="[`tn-icon-${leftIcon}`]"></view>
|
||||
<view class="main_title__content">{{ title }}</view>
|
||||
<view v-if="rightIcon" class="main_title__icon main_title__icon--right" :class="[`tn-icon-${rightIcon}`]"></view>
|
||||
</view>
|
||||
<view v-if="type === 'second'" class="second_title">
|
||||
<view class="second_title__content">{{ title }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="content" :class="[{
|
||||
'content--padding': contentPadding
|
||||
}]">
|
||||
<slot></slot>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'demo-title',
|
||||
options: {
|
||||
// 在微信小程序中将组件节点渲染为虚拟节点,更加接近Vue组件的表现(不会出现shadow节点下再去创建元素)
|
||||
virtualHost: true
|
||||
},
|
||||
props: {
|
||||
// 标题类型
|
||||
type: {
|
||||
type: String,
|
||||
default: 'first'
|
||||
},
|
||||
// 标题
|
||||
title: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
// 左图标
|
||||
leftIcon: {
|
||||
type: String,
|
||||
default: 'star'
|
||||
},
|
||||
// 右图标
|
||||
rightIcon: {
|
||||
type: String,
|
||||
default: 'star'
|
||||
},
|
||||
// 内容容器是否有两边边距
|
||||
contentPadding: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.main_title {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
margin-top: 50rpx;
|
||||
font-size: 36rpx;
|
||||
font-weight: bold;
|
||||
|
||||
&__content {
|
||||
padding: 0 18rpx;
|
||||
}
|
||||
|
||||
&__icon {
|
||||
font-size: 34rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.second_title {
|
||||
margin: 24rpx 0;
|
||||
margin-left: 30rpx;
|
||||
|
||||
&__content {
|
||||
font-size: 32rpx;
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
|
||||
.content {
|
||||
margin-top: 30rpx;
|
||||
|
||||
&--padding {
|
||||
margin-left: 30rpx;
|
||||
margin-right: 30rpx;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,689 @@
|
|||
<template>
|
||||
<view class="dynamic-demo">
|
||||
|
||||
<!-- 效果预览窗口 -->
|
||||
<view v-if="!noDemo" class="demo-container" :class="{'demo-container--full': full}">
|
||||
<view class="demo">
|
||||
<slot></slot>
|
||||
</view>
|
||||
<!-- 提示信息 -->
|
||||
<view v-if="haveTips">
|
||||
<view class="demo__tips__icon" @click="demoTipsClick">
|
||||
<view class="icon tn-icon-help"></view>
|
||||
</view>
|
||||
<view class="demo__tips__content"
|
||||
:class="[showContentTips ? 'demo__tips__content--show' : 'demo__tips__content--hide']">
|
||||
<view v-for="(item,index) in tipsData" :key="index" class="demo__tips__content--item">{{ item }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 模式切换 -->
|
||||
<view v-if="multiMode" class="mode-switch">
|
||||
<view class="mode-switch__container">
|
||||
<view v-for="(item, index) in sectionModeListInfos" :key="index" class="mode-switch__item"
|
||||
:class="[`mode-switch-item-${index}`,{'mode-switch__item--active': modeIndex === index}]"
|
||||
@click="switchMode(index)">{{ item.name }}</view>
|
||||
|
||||
<!-- 滑块样式 -->
|
||||
<view class="mode-switch__slider" :style="[modeSwitchSliderStyle]"></view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 组件对应可选项容器 -->
|
||||
<view class="section-container">
|
||||
<scroll-view
|
||||
class="section__scroll-view"
|
||||
:class="{'section__scroll-view--auto': sectionScrollViewStyle.height === 'auto'}"
|
||||
:style="[sectionScrollViewStyle]"
|
||||
:scroll-y="sectionScrollViewStyle.height !== 'auto'"
|
||||
>
|
||||
<block v-for="(item,index) in btnsList" :key="index">
|
||||
<view class="section__content" :class="{'section__content--visible': item.show}">
|
||||
<view class="section__content__title">
|
||||
<view class="section__content__title__left-line" :class="[`tn-main-gradient-${tuniaoColorList[index]}`]"></view>
|
||||
<view class="section__content__title--text tn-text-ellipsis" :class="[`tn-main-gradient-${tuniaoColorList[index]}`]">{{ item.title }}</view>
|
||||
<view class="section__content__title__right-line" :class="[`tn-main-gradient-${tuniaoColorList[index]}`]"></view>
|
||||
</view>
|
||||
<view class="section__content__btns">
|
||||
<view v-for="(section_btn,section_index) in item.optional" :key="section_index"
|
||||
class="section__content__btns__item" :class="[`tn-main-gradient-${tuniaoColorList[index]}--light`]" @click="sectionBtnClick(index, section_index)">
|
||||
<view class="section__content__btns__item__bg"
|
||||
:class="[`tn-main-gradient-${tuniaoColorList[index]}`, {'section__content__btns__item__bg--active':sectionIndex[modeIndex][index]['value'] === section_index}]"></view>
|
||||
<view class="section__content__btns__item--text tn-text-ellipsis"
|
||||
:class="[sectionIndex[modeIndex][index]['value'] === section_index ? 'section__content__btns__item--text--active' : `tn-color-${tuniaoColorList[index]}`]">{{ section_btn }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'dynamic-demo-template',
|
||||
props: {
|
||||
// 可选项列表数据
|
||||
sectionList: {
|
||||
type: Array,
|
||||
default() {
|
||||
return []
|
||||
}
|
||||
},
|
||||
// 提示信息
|
||||
tips: {
|
||||
type: [String, Array],
|
||||
default: ''
|
||||
},
|
||||
// 演示框的内容是否为铺满
|
||||
full: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
// 是否使用了自定义顶部导航栏
|
||||
customBar: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
// 是否全屏滚动
|
||||
fullWindowsScroll: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
// 没有演示内容
|
||||
noDemo: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
tipsData() {
|
||||
if (typeof this.tips === 'string') {
|
||||
return [this.tips]
|
||||
}
|
||||
return this.tips
|
||||
},
|
||||
haveTips() {
|
||||
return this.tips && this.tips.length > 0
|
||||
},
|
||||
multiMode() {
|
||||
return this.sectionList.length > 1
|
||||
},
|
||||
sectionModeList() {
|
||||
return this.sectionList.map((item) => {
|
||||
return item.name
|
||||
})
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
// 图鸟颜色列表
|
||||
tuniaoColorList: this.$t.color.getTuniaoColorList(),
|
||||
// 保存选项列表信息(由于prop中的数据时不能被修改的)
|
||||
_sectionList: [],
|
||||
// 模式列表信息
|
||||
sectionModeListInfos: [],
|
||||
// 所选模式的序号
|
||||
modeIndex: 0,
|
||||
// 模式选择滑块样式
|
||||
modeSwitchSliderStyle: {
|
||||
width: 0,
|
||||
left: 0
|
||||
},
|
||||
// 显示组件相关提示信息
|
||||
showContentTips: false,
|
||||
// 可选项滚动容器样式
|
||||
sectionScrollViewStyle: {
|
||||
height: 0
|
||||
},
|
||||
// 按钮列表信息
|
||||
btnsList: [],
|
||||
// 标记当前所选按钮
|
||||
sectionIndex: [],
|
||||
// 标记选项按钮是否可以滑动(使用scroll-view进行包裹)
|
||||
sectionScrollFlag: true
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
sectionList: {
|
||||
handler(value) {
|
||||
// 如果sectionList发生改变,重新初始化选项列表信息
|
||||
this.initSectionBtns()
|
||||
},
|
||||
deep: true
|
||||
},
|
||||
sectionScrollFlag(value) {
|
||||
if (!value) {
|
||||
this.sectionScrollViewStyle.height = 'auto'
|
||||
}
|
||||
},
|
||||
fullWindowsScroll: {
|
||||
handler(value) {
|
||||
if (value) {
|
||||
this.sectionScrollViewStyle.height = 'auto'
|
||||
}
|
||||
},
|
||||
immediate: true
|
||||
}
|
||||
},
|
||||
created() {
|
||||
// 初始化可选项模式列表
|
||||
this.sectionModeListInfos = this.sectionModeList.map((item) => {
|
||||
return {
|
||||
name: item
|
||||
}
|
||||
})
|
||||
// 初始化选项按钮默认信息
|
||||
this.initSectionBtns()
|
||||
},
|
||||
mounted() {
|
||||
// 等待加载组件完成
|
||||
// setTimeout(() => {
|
||||
// // 计算出底部scroll-view的高度
|
||||
// this.initSectionScrollView()
|
||||
|
||||
// if (this.multiMode) {
|
||||
// // 获取模式切换标签的信息
|
||||
// this.getModeTabsInfo()
|
||||
// }
|
||||
// }, 10)
|
||||
this.$nextTick(() => {
|
||||
// 计算出底部scroll-view的高度
|
||||
this.initSectionScrollView()
|
||||
|
||||
if (this.multiMode) {
|
||||
// 获取模式切换标签的信息
|
||||
this.getModeTabsInfo()
|
||||
}
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
// 初始化选项滑动窗口的高度
|
||||
initSectionScrollView() {
|
||||
// 全屏滚动时不进行任何的操作
|
||||
if (this.fullWindowsScroll) {
|
||||
return
|
||||
}
|
||||
// 获取屏幕的高度
|
||||
uni.getSystemInfo({
|
||||
success: (systemInfo) => {
|
||||
// 通过当前屏幕的安全高度减去上一个元素的底部和距离上一个元素的外边距,然后减获取到的值减去标题栏的高度即可
|
||||
const navBarHeight = this.customBar ? 0 : this.vuex_custom_bar_height
|
||||
if (this.multiMode) {
|
||||
uni.createSelectorQuery().in(this).select('.mode-switch').boundingClientRect(data => {
|
||||
if (data.bottom >= systemInfo.safeArea.height) {
|
||||
this.sectionScrollFlag = false
|
||||
} else {
|
||||
this.sectionScrollFlag = true
|
||||
const containerBaseHeight = systemInfo.safeArea.height - data.bottom
|
||||
this.sectionScrollViewStyle.height = (containerBaseHeight - navBarHeight) + systemInfo.statusBarHeight - uni.upx2px(75) + 'px'
|
||||
}
|
||||
}).exec()
|
||||
} else {
|
||||
if (!this.noDemo) {
|
||||
uni.createSelectorQuery().in(this).select('.demo-container').boundingClientRect(data => {
|
||||
if (data.bottom >= systemInfo.safeArea.height) {
|
||||
this.sectionScrollFlag = false
|
||||
} else {
|
||||
this.sectionScrollFlag = true
|
||||
const containerBaseHeight = systemInfo.safeArea.height - data.bottom
|
||||
this.sectionScrollViewStyle.height = (containerBaseHeight - navBarHeight) + systemInfo.statusBarHeight - uni.upx2px(75) + 'px'
|
||||
}
|
||||
}).exec()
|
||||
} else {
|
||||
this.sectionScrollFlag = false
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
})
|
||||
},
|
||||
// 更新选项滑动容器的高度
|
||||
updateSectionScrollView() {
|
||||
this.$nextTick(() => {
|
||||
this.initSectionScrollView()
|
||||
})
|
||||
},
|
||||
// 获取各个模式tab的节点信息
|
||||
getModeTabsInfo() {
|
||||
let view = uni.createSelectorQuery().in(this)
|
||||
for (let i = 0; i < this.sectionModeListInfos.length; i++) {
|
||||
view.select('.mode-switch-item-' + i).boundingClientRect()
|
||||
}
|
||||
view.exec(res => {
|
||||
// 如果没有获取到,则重新获取
|
||||
if (!res.length) {
|
||||
setTimeout(() => {
|
||||
this.getModeTabsInfo()
|
||||
}, 10)
|
||||
return
|
||||
}
|
||||
// 将每个模式的宽度放入list中
|
||||
res.map((item, index) => {
|
||||
this.sectionModeListInfos[index].width = item.width
|
||||
})
|
||||
// 初始化滑块的宽度
|
||||
this.modeSwitchSliderStyle.width = this.sectionModeListInfos[0].width + 'px'
|
||||
|
||||
// 初始化滑块的位置
|
||||
this.modeSliderPosition()
|
||||
})
|
||||
},
|
||||
// 设置模式滑块的位置
|
||||
modeSliderPosition() {
|
||||
let left = 0
|
||||
// 计算当前所选模式选项到组件左边的距离
|
||||
this.sectionModeListInfos.map((item, index) => {
|
||||
if (index < this.modeIndex) left += item.width
|
||||
})
|
||||
|
||||
this.modeSwitchSliderStyle.left = left + 'px'
|
||||
},
|
||||
// 切换模式
|
||||
switchMode(index) {
|
||||
// 不允许点击当前激活的选项
|
||||
if (index === this.modeIndex) return
|
||||
this.modeIndex = index
|
||||
this.modeSliderPosition()
|
||||
this.updateSectionBtns()
|
||||
this.$emit('modeClick', {
|
||||
index: index
|
||||
})
|
||||
},
|
||||
// 点击内容提示信息
|
||||
demoTipsClick() {
|
||||
this.showContentTips = !this.showContentTips
|
||||
},
|
||||
// 初始化被选中选项按钮
|
||||
initSectionBtns() {
|
||||
this.sectionIndex = []
|
||||
this.sectionIndex = this.sectionList.map((item) => {
|
||||
if (item.hasOwnProperty('section') && item.section.length > 0) {
|
||||
return Array(item.section.length).fill({
|
||||
value: 0,
|
||||
change: false
|
||||
})
|
||||
} else {
|
||||
return []
|
||||
}
|
||||
})
|
||||
|
||||
this._sectionList = this.$t.deepClone(this.sectionList)
|
||||
// 给本地选项按钮列表给默认show属性
|
||||
this._sectionList.map((item) => {
|
||||
const section = item.section.map((section_item) => {
|
||||
if (!section_item.hasOwnProperty('show')) {
|
||||
section_item.show = true
|
||||
}
|
||||
return section_item
|
||||
})
|
||||
item.section = section
|
||||
return item
|
||||
})
|
||||
|
||||
// 更新按钮信息
|
||||
this.updateSectionBtns()
|
||||
},
|
||||
// 跟新选项按钮信息
|
||||
updateSectionBtns(sectionIndex = -1, showState = true) {
|
||||
let sectionOptional = this._sectionList[this.modeIndex]['section']
|
||||
this.btnsList = sectionOptional.map((item, index) => {
|
||||
// 判断是否已经修改了对应的值
|
||||
let changeValue = this.sectionIndex[this.modeIndex][index]['change'] || false
|
||||
let currentSectionIndexValue = this.sectionIndex[this.modeIndex][index]['value'] || 0
|
||||
// 取出默认值(如果是已经修改过的选项,则使用之前的选项信息)
|
||||
let indexValue = changeValue ? currentSectionIndexValue : item.hasOwnProperty('current') ? item.current : 0
|
||||
// 取出是否显示当前选项
|
||||
let show = (sectionIndex !== -1 && sectionIndex === index) ? showState : item.hasOwnProperty('show') ? item.show : true
|
||||
// 处理最大最小值
|
||||
if (indexValue < 0) {
|
||||
indexValue = 0
|
||||
}
|
||||
if (indexValue >= item.optional.length) {
|
||||
indexValue = item.optional.length
|
||||
}
|
||||
// this.sectionIndex[this.modeIndex][index]['value'] = indexValue
|
||||
this.$set(this.sectionIndex[this.modeIndex], index, {value: indexValue, change: changeValue})
|
||||
item.show = show
|
||||
return item
|
||||
})
|
||||
},
|
||||
// 更新选项按钮状态信息
|
||||
updateSectionBtnsState(sectionIndex = -1, showState = true) {
|
||||
// 判断sectionIndex是否为数组
|
||||
if (this.$t.array.isArray(sectionIndex)) {
|
||||
if (sectionIndex.length === 0) {
|
||||
return
|
||||
}
|
||||
sectionIndex = sectionIndex.filter((item) => item >= 0 && item < this.sectionList[this.modeIndex]['section'].length)
|
||||
sectionIndex.map((item) => {
|
||||
this.btnsList[item]['show'] = showState
|
||||
this._sectionList[this.modeIndex]['section'][item]['show'] = showState
|
||||
})
|
||||
} else {
|
||||
if (sectionIndex < 0 || sectionIndex >= this.sectionList[this.modeIndex]['section'].length) {
|
||||
return
|
||||
}
|
||||
// 将按键的对应显示状态设置为对应的状态
|
||||
this.btnsList[sectionIndex]['show'] = showState
|
||||
this._sectionList[this.modeIndex]['section'][sectionIndex]['show'] = showState
|
||||
}
|
||||
|
||||
},
|
||||
// 更新选项按钮选中信息
|
||||
updateSectionBtnsValue(modeIndex = 0, sectionIndex = -1, value = 0) {
|
||||
if (sectionIndex < 0 || sectionIndex >= this.sectionList[modeIndex]['section'].length) {
|
||||
return
|
||||
}
|
||||
// 如果showState为false则移除对应的选项按钮,否则往对应的位置添加上对应的选项按钮
|
||||
this.sectionIndex[modeIndex][sectionIndex] = {
|
||||
value,
|
||||
change: true
|
||||
}
|
||||
},
|
||||
// 选项按钮点击事件
|
||||
sectionBtnClick(index, sectionIndex) {
|
||||
// if (this.sectionIndex[this.modeIndex][index] === sectionIndex) {
|
||||
// return
|
||||
// }
|
||||
this.$set(this.sectionIndex[this.modeIndex], index, {value: sectionIndex, change: true})
|
||||
this.$emit('click', {
|
||||
methods: this.btnsList[index]['methods'],
|
||||
index: sectionIndex,
|
||||
name: this.btnsList[index]['optional'][sectionIndex]
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.dynamic-demo {
|
||||
padding-top: 78rpx;
|
||||
|
||||
/* 顶部模式切换start */
|
||||
.mode-switch {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
margin-top: 75rpx;
|
||||
padding: 0 30rpx;
|
||||
|
||||
&__container {
|
||||
position: relative;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
width: 476rpx;
|
||||
height: 62rpx;
|
||||
background-color: #FFFFFF;
|
||||
box-shadow: 0rpx 10rpx 50rpx 0rpx rgba(0, 3, 72, 0.1);
|
||||
border-radius: 31rpx;
|
||||
}
|
||||
|
||||
&__item {
|
||||
flex: 1;
|
||||
height: 62rpx;
|
||||
width: 100%;
|
||||
line-height: 62rpx;
|
||||
text-align: center;
|
||||
font-size: 28rpx;
|
||||
color: $tn-font-sub-color;
|
||||
z-index: 2;
|
||||
transition: all 0.3s;
|
||||
|
||||
&--active {
|
||||
color: #FFFFFF;
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
|
||||
&__slider {
|
||||
position: absolute;
|
||||
height: 62rpx;
|
||||
border-radius: 31rpx;
|
||||
// background-image: linear-gradient(-86deg, #FF8359 0%, #FFDF40 100%);
|
||||
background-image: linear-gradient(-86deg, #00C3FF 0%, #58FFF5 100%);
|
||||
box-shadow: 1rpx 10rpx 24rpx 0rpx #00C3FF77;
|
||||
z-index: 1;
|
||||
transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
|
||||
}
|
||||
}
|
||||
|
||||
/* 顶部模式切换end */
|
||||
|
||||
/* 演示内容展示start */
|
||||
.demo-container {
|
||||
min-height: 327rpx;
|
||||
width: calc(100% - 60rpx);
|
||||
background-color: #FFFFFF;
|
||||
box-shadow: 0rpx 10rpx 50rpx 0rpx rgba(0, 3, 72, 0.1);
|
||||
margin: 0 30rpx 5rpx 30rpx;
|
||||
border-radius: 20rpx;
|
||||
position: relative;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
|
||||
&--full {
|
||||
display: inline-block;
|
||||
padding-bottom: 20rpx;
|
||||
min-height: 0rpx;
|
||||
padding: 10rpx 20rpx 30rpx;
|
||||
}
|
||||
|
||||
.demo {
|
||||
padding-top: 70rpx;
|
||||
|
||||
&__tips {
|
||||
&__icon {
|
||||
position: absolute;
|
||||
top: 20rpx;
|
||||
right: 16rpx;
|
||||
width: 39rpx;
|
||||
height: 39rpx;
|
||||
line-height: 39rpx;
|
||||
font-size: 39rpx;
|
||||
|
||||
.icon {
|
||||
background: linear-gradient(-45deg, #FF8359 0%, #FFDF40 100%);
|
||||
-webkit-background-clip: text;
|
||||
color: transparent;
|
||||
text-shadow: 0rpx 10rpx 10rpx rgba(255, 156, 82, 0.2);
|
||||
}
|
||||
}
|
||||
|
||||
&__content {
|
||||
position: absolute;
|
||||
top: 65rpx;
|
||||
right: 16rpx;
|
||||
font-size: 20rpx;
|
||||
margin-left: 20rpx;
|
||||
word-wrap: normal;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
background-color: #E6E6E6;
|
||||
padding: 20rpx;
|
||||
border-radius: 10rpx;
|
||||
transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1);
|
||||
transform-origin: 0 0;
|
||||
z-index: 999999;
|
||||
|
||||
&--hide {
|
||||
transform: scaleY(0);
|
||||
}
|
||||
|
||||
&--show {
|
||||
transform: scaleY(100%);
|
||||
|
||||
&::after {
|
||||
content: "";
|
||||
width: 0px;
|
||||
height: 0px;
|
||||
border-width: 4px;
|
||||
border-style: solid;
|
||||
border-color: transparent transparent rgba(149, 149, 149, 0.1) transparent;
|
||||
position: absolute;
|
||||
top: -8px;
|
||||
right: 6px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* 演示内容展示end */
|
||||
|
||||
/* 可选项start */
|
||||
.section-container {
|
||||
width: 100%;
|
||||
height: auto;
|
||||
margin-top: 70rpx;
|
||||
|
||||
.section {
|
||||
&__content {
|
||||
margin-top: 70rpx;
|
||||
display: none;
|
||||
|
||||
&--visible {
|
||||
display: block;
|
||||
|
||||
&:last-child {
|
||||
padding-bottom: calc(70rpx + env(safe-area-inset-bottom));
|
||||
}
|
||||
}
|
||||
|
||||
&:nth-child(1) {
|
||||
margin-top: 0rpx;
|
||||
}
|
||||
|
||||
&__title {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
margin: 0 30rpx;
|
||||
text-align: center;
|
||||
|
||||
&__left-line,
|
||||
&__right-line {
|
||||
|
||||
width: 100rpx;
|
||||
height: 2rpx;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
&__left-line {
|
||||
&::after {
|
||||
content: '';
|
||||
background: inherit;
|
||||
width: 12rpx;
|
||||
height: 12rpx;
|
||||
position: absolute;
|
||||
top: -12rpx;
|
||||
right: 0rpx;
|
||||
border-radius: 50%;
|
||||
transform: translateY(50%);
|
||||
}
|
||||
}
|
||||
|
||||
&__right-line {
|
||||
&::after {
|
||||
content: '';
|
||||
background: inherit;
|
||||
width: 12rpx;
|
||||
height: 12rpx;
|
||||
position: absolute;
|
||||
top: -12rpx;
|
||||
left: 0rpx;
|
||||
border-radius: 50%;
|
||||
transform: translateY(50%);
|
||||
}
|
||||
}
|
||||
|
||||
&--text {
|
||||
-webkit-background-clip: text;
|
||||
color: transparent;
|
||||
min-width: 124rpx;
|
||||
height: 30rpx;
|
||||
font-size: 32rpx;
|
||||
line-height: 1;
|
||||
margin: 0 35rpx;
|
||||
}
|
||||
}
|
||||
|
||||
&__btns {
|
||||
width: calc(100% - 60rpx);
|
||||
margin: 0 30rpx;
|
||||
margin-top: 29rpx;
|
||||
padding: 50rpx 30rpx 0rpx 0rpx;
|
||||
background-color: #FFFFFF;
|
||||
box-shadow: 0rpx 10rpx 50rpx 0rpx rgba(0, 3, 72, 0.1);
|
||||
border-radius: 20rpx;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
justify-content: flex-start;
|
||||
flex-wrap: wrap;
|
||||
|
||||
&__item {
|
||||
max-width: 30%;
|
||||
padding: 17rpx 36rpx;
|
||||
border-radius: 10rpx;
|
||||
margin-bottom: 40rpx;
|
||||
margin-left: 40rpx;
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
|
||||
// &::before {
|
||||
// content: " ";
|
||||
// position: absolute;
|
||||
// top: 10rpx;
|
||||
// left: 1rpx;
|
||||
// width: 100%;
|
||||
// height: 100%;
|
||||
// background: inherit;
|
||||
// filter: blur(24rpx);
|
||||
// opacity: 1;
|
||||
// z-index: -1;
|
||||
// }
|
||||
|
||||
&__bg {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border-radius: inherit;
|
||||
z-index: -1;
|
||||
opacity: 0;
|
||||
transform: scale(0);
|
||||
transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
|
||||
|
||||
&--active {
|
||||
opacity: 1;
|
||||
transform: scale(1);
|
||||
}
|
||||
}
|
||||
|
||||
&--text {
|
||||
font-size: 24rpx;
|
||||
line-height: 1.2em;
|
||||
transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
|
||||
|
||||
&--active {
|
||||
color: #FFFFFF;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* 可选项end */
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,147 @@
|
|||
<template>
|
||||
<view class="multiple-options">
|
||||
<view class="list">
|
||||
<block v-for="(item, index) in listData" :key="index">
|
||||
<view
|
||||
class="list__item"
|
||||
:class="[`tn-main-gradient-${tuniaoColorList[item.bgColorIndex]}--light`]"
|
||||
@tap="navOptionsPage(item.url)"
|
||||
>
|
||||
<view class="list__content">
|
||||
<view class="list__content__title">{{ item.title }}</view>
|
||||
<view class="list__content__desc">{{ item.desc }}</view>
|
||||
</view>
|
||||
<view class="list__icon">
|
||||
<view class="list__icon__main" :class="[`tn-icon-${item.mainIcon}`, `tn-main-gradient-${tuniaoColorList[item.bgColorIndex]}`]"></view>
|
||||
<view class="list__icon__sub" :class="[`tn-icon-${item.subIcon}`, `tn-main-gradient-${tuniaoColorList[item.bgColorIndex]}`]"></view>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'multiple-options-demo',
|
||||
props: {
|
||||
// 显示的列表数据
|
||||
list: {
|
||||
type: Array,
|
||||
default() {
|
||||
return []
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
// 图鸟颜色列表
|
||||
tuniaoColorList: [
|
||||
'red',
|
||||
'purplered',
|
||||
'purple',
|
||||
'bluepurple',
|
||||
'aquablue',
|
||||
'blue',
|
||||
'indigo',
|
||||
'cyan',
|
||||
'teal',
|
||||
'green',
|
||||
'orange',
|
||||
'orangered'
|
||||
],
|
||||
listData: []
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
list(val) {
|
||||
this.initList()
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.initList()
|
||||
},
|
||||
methods: {
|
||||
// 初始化列表数据
|
||||
initList() {
|
||||
// 给列表添加背景颜色数据
|
||||
this.listData = this.list.map((item, index) => {
|
||||
item.bgColorIndex = this.getBgNum()
|
||||
item.mainIcon = item?.mainIcon || 'computer-fill'
|
||||
item.subIcon = item?.subIcon || 'share'
|
||||
return item
|
||||
})
|
||||
},
|
||||
// 跳转到对应的选项页面
|
||||
navOptionsPage(url) {
|
||||
uni.navigateTo({
|
||||
url: url
|
||||
})
|
||||
},
|
||||
// 获取酷炫背景随机数
|
||||
getBgNum() {
|
||||
return Math.floor((Math.random() * this.tuniaoColorList.length))
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
.list {
|
||||
|
||||
&__item {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
width: calc(100% - 60rpx);
|
||||
margin: 108rpx 30rpx 0rpx 30rpx;
|
||||
box-shadow: 0rpx 10rpx 50rpx 0rpx rgba(0, 3, 72, 0.1);
|
||||
border-radius: 20rpx;
|
||||
}
|
||||
|
||||
&__content {
|
||||
flex: 1;
|
||||
// color: $tn-font-color;
|
||||
margin: 34rpx 0rpx 27rpx 37rpx;
|
||||
|
||||
&__title {
|
||||
font-size: 36rpx;
|
||||
font-weight: bold;
|
||||
margin-bottom: 12rpx;
|
||||
}
|
||||
&__desc {
|
||||
font-size: 28rpx;
|
||||
}
|
||||
}
|
||||
|
||||
&__icon {
|
||||
flex: 1;
|
||||
margin-right: 26rpx;
|
||||
position: relative;
|
||||
|
||||
&__main, &__sub {
|
||||
-webkit-background-clip: text;
|
||||
color: transparent;
|
||||
position: absolute;
|
||||
transition: transform 0.25s ease;
|
||||
}
|
||||
|
||||
&__main {
|
||||
font-size: 200rpx;
|
||||
width: 190rpx;
|
||||
line-height: 200rpx;
|
||||
top: 0;
|
||||
right: 0rpx;
|
||||
transform: translateY(-60%);
|
||||
}
|
||||
&__sub {
|
||||
font-size: 70rpx;
|
||||
top: 0;
|
||||
right: 175rpx;
|
||||
transform: translateY(-5rpx);
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,169 @@
|
|||
<template>
|
||||
<view class="nav-index-button" :style="{bottom: `${bottom}rpx`, right: `${right}rpx`}" @tap.stop="navIndex">
|
||||
<view class="nav-index-button__content">
|
||||
<view class="nav-index-button__content--icon tn-flex tn-flex-row-center tn-flex-col-center tn-shadow-blur tn-cool-bg-color-5">
|
||||
<view class="tn-icon-home-fill"></view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="nav-index-button__meteor">
|
||||
<view class="nav-index-button__meteor__wrapper">
|
||||
<view v-for="(item,index) in 6" :key="index" class="nav-index-button__meteor__item" :style="{transform: `rotateX(${-60 + (30 * index)}deg) rotateZ(${-60 + (30 * index)}deg)`}">
|
||||
<view class="nav-index-button__meteor__item--pic"></view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'nav-index-button',
|
||||
props: {
|
||||
// 距离底部的距离
|
||||
bottom: {
|
||||
type: [Number, String],
|
||||
default: 300
|
||||
},
|
||||
// 距离右边的距离
|
||||
right: {
|
||||
type: [Number, String],
|
||||
default: 75
|
||||
},
|
||||
// 首页地址
|
||||
indexPath: {
|
||||
type: String,
|
||||
default: '/pages/index'
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 跳转回首页
|
||||
navIndex() {
|
||||
// 通过判断当前页面的页面栈信息,是否有上一页进行返回,如果没有则跳转到首页
|
||||
const pages = getCurrentPages()
|
||||
if (pages && pages.length > 0) {
|
||||
const indexPath = this.indexPath || '/pages/index'
|
||||
const firstPage = pages[0]
|
||||
if (pages.length == 1 && (!firstPage.route || firstPage.route != indexPath.substring(1, indexPath.length))) {
|
||||
uni.reLaunch({
|
||||
url: indexPath
|
||||
})
|
||||
} else {
|
||||
uni.navigateBack({
|
||||
delta: 1
|
||||
})
|
||||
}
|
||||
} else {
|
||||
uni.reLaunch({
|
||||
url: indexPath
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
.nav-index-button {
|
||||
position: fixed;
|
||||
animation: suspension 3s ease-in-out infinite;
|
||||
z-index: 999999;
|
||||
|
||||
&__content {
|
||||
position: absolute;
|
||||
width: 100rpx;
|
||||
height: 100rpx;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
|
||||
&--icon {
|
||||
width: 100rpx;
|
||||
height: 100rpx;
|
||||
font-size: 60rpx;
|
||||
border-radius: 50%;
|
||||
margin-bottom: 18rpx;
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
transform: scale(0.85);
|
||||
|
||||
&::after {
|
||||
content: " ";
|
||||
position: absolute;
|
||||
z-index: -1;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
border-radius: inherit;
|
||||
opacity: 1;
|
||||
transform: scale(1, 1);
|
||||
background-size: 100% 100%;
|
||||
background-image: url(https://resource.tuniaokj.com/images/cool_bg_image/icon_bg6.png);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&__meteor {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
width: 100rpx;
|
||||
height: 100rpx;
|
||||
transform-style: preserve-3d;
|
||||
transform: translate(-50%, -50%) rotateY(75deg) rotateZ(10deg);
|
||||
|
||||
&__wrapper {
|
||||
width: 100rpx;
|
||||
height: 100rpx;
|
||||
transform-style: preserve-3d;
|
||||
animation: spin 20s linear infinite;
|
||||
}
|
||||
|
||||
&__item {
|
||||
position: absolute;
|
||||
width: 100rpx;
|
||||
height: 100rpx;
|
||||
border-radius: 1000rpx;
|
||||
left: 0;
|
||||
top: 0;
|
||||
|
||||
&--pic {
|
||||
display: block;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: url(https://resource.tuniaokj.com/images/cool_bg_image/arc3.png) no-repeat center center;
|
||||
background-size: 100% 100%;
|
||||
animation: arc 4s linear infinite;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@keyframes suspension {
|
||||
0%, 100% {
|
||||
transform: translateY(0);
|
||||
}
|
||||
50% {
|
||||
transform: translateY(-0.8rem);
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes spin {
|
||||
0% {
|
||||
transform: rotateX(0deg);
|
||||
}
|
||||
|
||||
100% {
|
||||
transform: rotateX(-360deg);
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes arc {
|
||||
to {
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,52 @@
|
|||
/**
|
||||
* 动态参数演示mixin
|
||||
*/
|
||||
module.exports = {
|
||||
data() {
|
||||
return {
|
||||
// 效果显示框top的值
|
||||
contentContainerTop: '0px',
|
||||
contentContainerIsTop: false,
|
||||
|
||||
// 参数显示框top的值
|
||||
sectionContainerTop: '0px'
|
||||
}
|
||||
},
|
||||
onReady() {
|
||||
this.updateSectionContainerTop()
|
||||
},
|
||||
methods: {
|
||||
// 处理演示效果框的位置
|
||||
async _handleContentConatinerPosition() {
|
||||
// 获取效果演示框的节点信息
|
||||
const contentContainer = await this._tGetRect('#content_container')
|
||||
// 获取参数框的节点信息
|
||||
this._tGetRect('#section_container').then((res) => {
|
||||
// 判断参数框是否在移动,如果是则更新效果框的位置
|
||||
// 如果效果框的顶部已经触控到顶部导航栏就停止跟随
|
||||
if (res.top - contentContainer.bottom != 15) {
|
||||
const newTop = res.top - (contentContainer.height + uni.upx2px(20))
|
||||
const minTop = this.vuex_custom_bar_height + 1
|
||||
if (newTop < minTop) {
|
||||
this.contentContainerTop = minTop + 'px'
|
||||
this.contentContainerIsTop = true
|
||||
} else {
|
||||
this.contentContainerTop = newTop + 'px'
|
||||
this.contentContainerIsTop = false
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
// 更新状态切换栏位置信息
|
||||
updateSectionContainerTop() {
|
||||
this._tGetRect('#content_container').then((res) => {
|
||||
this.contentContainerTop = (this.vuex_custom_bar_height + 148) + 'px'
|
||||
this.sectionContainerTop = (res.height + 20) + 'px'
|
||||
})
|
||||
}
|
||||
},
|
||||
// 监听页面滚动
|
||||
onPageScroll() {
|
||||
this._handleContentConatinerPosition()
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,60 @@
|
|||
/**
|
||||
* 演示页面mixin
|
||||
*/
|
||||
module.exports = {
|
||||
data() {
|
||||
return {
|
||||
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
// 更新顶部导航栏信息
|
||||
this.updateCustomBarInfo()
|
||||
},
|
||||
methods: {
|
||||
// 点击左上角返回按钮时触发事件
|
||||
goBack() {
|
||||
// 通过判断当前页面的页面栈信息,是否有上一页进行返回,如果没有则跳转到首页
|
||||
const pages = getCurrentPages()
|
||||
if (pages && pages.length > 0) {
|
||||
const firstPage = pages[0]
|
||||
if (pages.length == 1 && (!firstPage.route || firstPage.route != 'pages/index')) {
|
||||
uni.reLaunch({
|
||||
url: '/pages/index'
|
||||
})
|
||||
} else {
|
||||
uni.navigateBack({
|
||||
delta: 1
|
||||
})
|
||||
}
|
||||
} else {
|
||||
uni.reLaunch({
|
||||
url: '/pages/index'
|
||||
})
|
||||
}
|
||||
},
|
||||
// 更新顶部导航栏信息
|
||||
async updateCustomBarInfo() {
|
||||
// 获取vuex中的自定义顶栏的高度
|
||||
let customBarHeight = this.vuex_custom_bar_height
|
||||
let statusBarHeight = this.vuex_status_bar_height
|
||||
// 如果获取失败则重新获取
|
||||
if (!customBarHeight) {
|
||||
try {
|
||||
const navBarInfo = await this.$t.updateCustomBar()
|
||||
customBarHeight = navBarInfo.customBarHeight
|
||||
statusBarHeight = navBarInfo.statusBarHeight
|
||||
} catch(e) {
|
||||
setTimeout(() => {
|
||||
this.updateCustomBarInfo()
|
||||
}, 10)
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
// 更新vuex中的导航栏信息
|
||||
this.$t.vuex('vuex_status_bar_height', statusBarHeight)
|
||||
this.$t.vuex('vuex_custom_bar_height', customBarHeight)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,330 @@
|
|||
/**
|
||||
* 页面展示列表数据
|
||||
*/
|
||||
export default {
|
||||
data: [{
|
||||
title: '图鸟首页',
|
||||
backgroundColor: 'tn-cool-bg-color-1',
|
||||
list: [{
|
||||
icon: 'code',
|
||||
title: '关于我们',
|
||||
url: '/homePages/about',
|
||||
author: '图鸟北北'
|
||||
},{
|
||||
icon: 'code',
|
||||
title: '全局搜索',
|
||||
url: '/homePages/search',
|
||||
author: '图鸟北北'
|
||||
},
|
||||
{
|
||||
icon: 'code',
|
||||
title: '今日热榜',
|
||||
url: '/homePages/hot',
|
||||
author: '图鸟北北'
|
||||
},
|
||||
{
|
||||
icon: 'code',
|
||||
title: '前端业务',
|
||||
url: '/homePages/profession',
|
||||
author: '图鸟北北'
|
||||
},
|
||||
{
|
||||
icon: 'code',
|
||||
title: '加载效果',
|
||||
url: '/homePages/loading',
|
||||
author: '图鸟北北'
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
title: '酷炫圈子',
|
||||
backgroundColor: 'tn-cool-bg-color-1',
|
||||
list: [{
|
||||
icon: 'code',
|
||||
title: '博主_Me',
|
||||
url: '/circlePages/blogger',
|
||||
author: '图鸟北北'
|
||||
},
|
||||
{
|
||||
icon: 'code',
|
||||
title: '博主_Ta',
|
||||
url: '/circlePages/blogger_other',
|
||||
author: '图鸟北北'
|
||||
},
|
||||
{
|
||||
icon: 'code',
|
||||
title: '编辑发布',
|
||||
url: '/circlePages/edit',
|
||||
author: '图鸟北北'
|
||||
},
|
||||
{
|
||||
icon: 'code',
|
||||
title: '广告页',
|
||||
url: '/circlePages/advertise',
|
||||
author: '图鸟北北'
|
||||
},
|
||||
{
|
||||
icon: 'code',
|
||||
title: '资讯详情',
|
||||
url: '/circlePages/news',
|
||||
author: '图鸟北北'
|
||||
},
|
||||
{
|
||||
icon: 'code',
|
||||
title: '名片王者',
|
||||
url: '/circlePages/king',
|
||||
author: '图鸟北北'
|
||||
},
|
||||
{
|
||||
icon: 'code',
|
||||
title: '智能名片',
|
||||
url: '/circlePages/business',
|
||||
author: '图鸟北北'
|
||||
},
|
||||
{
|
||||
icon: 'code',
|
||||
title: '精选圈子',
|
||||
url: '/circlePages/group',
|
||||
author: '图鸟北北'
|
||||
},
|
||||
{
|
||||
icon: 'code',
|
||||
title: '积分排行',
|
||||
url: '/circlePages/ranking',
|
||||
author: '图鸟北北'
|
||||
},
|
||||
{
|
||||
icon: 'code',
|
||||
title: '圈子详情',
|
||||
url: '/circlePages/details',
|
||||
author: '图鸟北北'
|
||||
},
|
||||
{
|
||||
icon: 'code',
|
||||
title: '预约接龙',
|
||||
url: '/circlePages/reserve',
|
||||
author: '图鸟北北'
|
||||
},
|
||||
{
|
||||
icon: 'code',
|
||||
title: '活动创建',
|
||||
url: '/circlePages/create',
|
||||
author: '图鸟北北'
|
||||
},
|
||||
{
|
||||
icon: 'code',
|
||||
title: '打造圈子',
|
||||
url: '/circlePages/build',
|
||||
author: '图鸟北北'
|
||||
},
|
||||
{
|
||||
icon: 'code',
|
||||
title: '一起群聊',
|
||||
url: '/circlePages/chat',
|
||||
author: '图鸟北北'
|
||||
},
|
||||
{
|
||||
icon: 'code',
|
||||
title: '对话聊天',
|
||||
url: '/circlePages/chatting',
|
||||
author: '图鸟北北'
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
title: '活动广场',
|
||||
backgroundColor: 'tn-cool-bg-color-1',
|
||||
list: [{
|
||||
icon: 'code',
|
||||
title: '地图打卡',
|
||||
url: '/activityPages/map',
|
||||
author: '图鸟北北'
|
||||
},
|
||||
{
|
||||
icon: 'code',
|
||||
title: '快速答题',
|
||||
url: '/activityPages/topic',
|
||||
author: '图鸟北北'
|
||||
},
|
||||
{
|
||||
icon: 'code',
|
||||
title: '课程学习',
|
||||
url: '/activityPages/study',
|
||||
author: '图鸟北北'
|
||||
},
|
||||
{
|
||||
icon: 'code',
|
||||
title: '开源项目',
|
||||
url: '/activityPages/project',
|
||||
author: '图鸟北北'
|
||||
},
|
||||
{
|
||||
icon: 'code',
|
||||
title: '活动星球',
|
||||
url: '/activityPages/planet',
|
||||
author: '图鸟北北'
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
title: '商品优选',
|
||||
backgroundColor: 'tn-cool-bg-color-1',
|
||||
list: [{
|
||||
icon: 'code',
|
||||
title: '优质商家',
|
||||
url: '/preferredPages/shop',
|
||||
author: '图鸟北北'
|
||||
},
|
||||
{
|
||||
icon: 'code',
|
||||
title: '商品详情',
|
||||
url: '/preferredPages/product',
|
||||
author: '图鸟北北'
|
||||
},
|
||||
{
|
||||
icon: 'code',
|
||||
title: '历史订单',
|
||||
url: '/preferredPages/order',
|
||||
author: '图鸟北北'
|
||||
},
|
||||
{
|
||||
icon: 'code',
|
||||
title: '商品分类',
|
||||
url: '/preferredPages/classify',
|
||||
author: '图鸟北北'
|
||||
},
|
||||
{
|
||||
icon: 'code',
|
||||
title: '商家相册',
|
||||
url: '/preferredPages/photo',
|
||||
author: '图鸟北北'
|
||||
},
|
||||
{
|
||||
icon: 'code',
|
||||
title: '品牌官网',
|
||||
url: '/preferredPages/website',
|
||||
author: '图鸟北北'
|
||||
},
|
||||
{
|
||||
icon: 'code',
|
||||
title: '积分兑换',
|
||||
url: '/preferredPages/redeem',
|
||||
author: '图鸟北北'
|
||||
},
|
||||
{
|
||||
icon: 'code',
|
||||
title: '免单活动',
|
||||
url: '/preferredPages/award',
|
||||
author: '图鸟北北'
|
||||
},
|
||||
{
|
||||
icon: 'code',
|
||||
title: '免单获取',
|
||||
url: '/preferredPages/awardget',
|
||||
author: '图鸟北北'
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
title: '关于我的',
|
||||
backgroundColor: 'tn-cool-bg-color-1',
|
||||
list: [{
|
||||
icon: 'code',
|
||||
title: '使用协议',
|
||||
url: '/minePages/protocol',
|
||||
author: '图鸟北北'
|
||||
},
|
||||
{
|
||||
icon: 'code',
|
||||
title: '授权登录',
|
||||
url: '/minePages/login',
|
||||
author: '图鸟北北'
|
||||
},
|
||||
{
|
||||
icon: 'code',
|
||||
title: '消息通知',
|
||||
url: '/minePages/message',
|
||||
author: '图鸟北北'
|
||||
},
|
||||
{
|
||||
icon: 'code',
|
||||
title: '全局设置',
|
||||
url: '/minePages/set',
|
||||
author: '图鸟北北'
|
||||
},
|
||||
{
|
||||
icon: 'code',
|
||||
title: '立即体验',
|
||||
url: '/minePages/start',
|
||||
author: '图鸟北北'
|
||||
},
|
||||
{
|
||||
icon: 'code',
|
||||
title: '感谢名单',
|
||||
url: '/minePages/thanks',
|
||||
author: '图鸟北北'
|
||||
},
|
||||
{
|
||||
icon: 'code',
|
||||
title: '版本更新',
|
||||
url: '/minePages/version',
|
||||
author: '图鸟北北'
|
||||
},
|
||||
{
|
||||
icon: 'code',
|
||||
title: '帮助中心',
|
||||
url: '/minePages/help',
|
||||
author: '图鸟北北'
|
||||
},
|
||||
{
|
||||
icon: 'code',
|
||||
title: '头像上传',
|
||||
url: '/minePages/avatar',
|
||||
author: '图鸟北北'
|
||||
},
|
||||
{
|
||||
icon: 'code',
|
||||
title: '积分明细',
|
||||
url: '/minePages/integral',
|
||||
author: '图鸟北北'
|
||||
},
|
||||
{
|
||||
icon: 'code',
|
||||
title: '积分签到',
|
||||
url: '/minePages/signed',
|
||||
author: '图鸟北北'
|
||||
},
|
||||
{
|
||||
icon: 'code',
|
||||
title: '好物收藏',
|
||||
url: '/minePages/collect',
|
||||
author: '图鸟北北'
|
||||
},
|
||||
{
|
||||
icon: 'code',
|
||||
title: '账号安全',
|
||||
url: '/minePages/safety',
|
||||
author: '图鸟北北'
|
||||
},
|
||||
{
|
||||
icon: 'code',
|
||||
title: '赞赏支持',
|
||||
url: '/minePages/reward',
|
||||
author: '图鸟北北'
|
||||
},
|
||||
{
|
||||
icon: 'code',
|
||||
title: '缺省页',
|
||||
url: '/minePages/default',
|
||||
author: '图鸟北北'
|
||||
},
|
||||
{
|
||||
icon: 'code',
|
||||
title: '富文本',
|
||||
url: '/minePages/content',
|
||||
author: '图鸟北北'
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
44
main.js
|
|
@ -1,10 +1,10 @@
|
|||
import Vue from 'vue'
|
||||
import App from './App'
|
||||
|
||||
|
||||
import store from './store'
|
||||
import Vue from 'vue'
|
||||
import HttpRequest from './common/httpRequest'
|
||||
import HttpCache from './common/cache'
|
||||
import queue from './common/queue'
|
||||
import TuniaoUI from 'tuniao-ui'
|
||||
|
||||
Vue.config.productionTip = false
|
||||
Vue.prototype.$Request = HttpRequest;
|
||||
|
|
@ -12,7 +12,6 @@ Vue.prototype.$queue = queue;
|
|||
|
||||
Vue.prototype.$Sysconf = HttpRequest.config;
|
||||
Vue.prototype.$SysCache = HttpCache;
|
||||
|
||||
App.mpType = 'app'
|
||||
|
||||
// 引入全局uView
|
||||
|
|
@ -21,15 +20,48 @@ Vue.use(uView);
|
|||
|
||||
|
||||
const app = new Vue({
|
||||
...App
|
||||
store,
|
||||
...App
|
||||
})
|
||||
|
||||
Vue.prototype.$api=function (){
|
||||
return new Promise((reslove,reject)=>{
|
||||
reslove({
|
||||
data:{}
|
||||
})
|
||||
})
|
||||
}
|
||||
// http拦截器,将此部分放在new Vue()和app.$mount()之间,才能App.vue中正常使用
|
||||
import httpInterceptor from '@/common/http.interceptor.js'
|
||||
Vue.use(httpInterceptor, app)
|
||||
|
||||
Vue.use(TuniaoUI)
|
||||
// 引入TuniaoUI提供的vuex简写方法
|
||||
let vuexStore = require('@/store/$t.mixin.js')
|
||||
Vue.mixin(vuexStore)
|
||||
// http接口API集中管理引入部分
|
||||
import httpApi from '@/common/http.api.js'
|
||||
Vue.use(httpApi, app)
|
||||
|
||||
app.$mount()
|
||||
|
||||
// #ifdef APP
|
||||
|
||||
const sysInfo = uni.getSystemInfoSync();
|
||||
let isIos = sysInfo.platform == 'ios'
|
||||
|
||||
if (isIos) {
|
||||
const originNavigateTo = uni.navigateTo
|
||||
|
||||
uni.navigateTo = (params) => {
|
||||
let jsonParam = JSON.parse(JSON.stringify(params))
|
||||
|
||||
if (isIos && jsonParam.url.includes('/me/detail/detail')) {
|
||||
jsonParam.url = jsonParam.url.replace('/me/detail/detail', '/me/detail/detailIOS')
|
||||
}
|
||||
|
||||
originNavigateTo(jsonParam)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// #endif
|
||||
|
|
@ -1,9 +1,9 @@
|
|||
{
|
||||
"name" : "短剧",
|
||||
"appid" : "__UNI__CA593C1",
|
||||
"name" : "斯耀短剧",
|
||||
"appid" : "__UNI__E0B05B1",
|
||||
"description" : "",
|
||||
"versionName" : "1.0.0",
|
||||
"versionCode" : "100",
|
||||
"versionName" : "1.0.8",
|
||||
"versionCode" : 108,
|
||||
"transformPx" : false,
|
||||
/* 5+App特有相关 */
|
||||
"app-plus" : {
|
||||
|
|
@ -14,7 +14,7 @@
|
|||
},
|
||||
"usingComponents" : true,
|
||||
"nvueStyleCompiler" : "uni-app",
|
||||
"compilerVersion" : 3,
|
||||
"compilerVersion" : 7,
|
||||
"splashscreen" : {
|
||||
"alwaysShowBeforeRender" : true,
|
||||
"waiting" : true,
|
||||
|
|
@ -27,8 +27,8 @@
|
|||
"VideoPlayer" : {},
|
||||
"Camera" : {},
|
||||
"Record" : {},
|
||||
"Push" : {},
|
||||
"OAuth" : {}
|
||||
"OAuth" : {},
|
||||
"Push" : {}
|
||||
},
|
||||
/* 应用发布信息 */
|
||||
"distribute" : {
|
||||
|
|
@ -56,11 +56,19 @@
|
|||
"<uses-permission android:name=\"android.permission.WRITE_EXTERNAL_STORAGE\"/>",
|
||||
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
|
||||
],
|
||||
"abiFilters" : [ "armeabi-v7a", "arm64-v8a", "x86" ]
|
||||
"abiFilters" : [ "armeabi-v7a", "arm64-v8a", "x86" ],
|
||||
"minSdkVersion" : 28,
|
||||
"targetSdkVersion" : 33,
|
||||
"schemes" : "com.hnsiyao.duanju"
|
||||
},
|
||||
/* ios打包配置 */
|
||||
"ios" : {
|
||||
"dSYMs" : false
|
||||
"dSYMs" : false,
|
||||
"urltypes" : "com.hnsiyao.duanju",
|
||||
"privacyDescription" : {
|
||||
"NSPhotoLibraryUsageDescription" : "获取您的相册读取权限,目的是为了在我的资料页面使用相册读取功能,修改上传头像",
|
||||
"NSCameraUsageDescription" : "获取您的摄像头权限,目的是为了在我的资料页面使用摄像头功能,修改上传头像"
|
||||
}
|
||||
},
|
||||
/* SDK配置 */
|
||||
"sdkConfigs" : {
|
||||
|
|
@ -159,13 +167,21 @@
|
|||
"enable" : false
|
||||
},
|
||||
"h5" : {
|
||||
"title" : "短剧",
|
||||
"title" : "斯耀短剧",
|
||||
"domain" : "https://jiaoyu.xianmxkj.com",
|
||||
"router" : {
|
||||
"mode" : "history"
|
||||
}
|
||||
"mode" : "history",
|
||||
"cache" : {
|
||||
"use" : true,
|
||||
"maxAge" : "86400000",
|
||||
"version" : "1.0.7"
|
||||
}
|
||||
},
|
||||
"template" : "template.html"
|
||||
},
|
||||
"mp-kuaishou" : {
|
||||
"appid" : "ks699465318929951101"
|
||||
}
|
||||
}
|
||||
// 版本号,更新版本号可以清除缓存
|
||||
|
||||
|
|
|
|||
|
|
@ -1,24 +1,24 @@
|
|||
<template>
|
||||
<view style="padding-bottom: 20rpx;">
|
||||
<view v-for="(item,index) in list" :key="index" class="list flex align-center justify-center">
|
||||
<view class="list-box">
|
||||
<view class="list-box-title">
|
||||
<view class="zdwbUQKCny">
|
||||
<view class="zdwbUQKCny-title">
|
||||
{{item.title}}
|
||||
</view>
|
||||
<view class="list-box-content">
|
||||
<view class="zdwbUQKCny-content">
|
||||
{{item.content}}
|
||||
</view>
|
||||
<view class="list-box-time flex align-center justify-between">
|
||||
<view class="zdwbUQKCny-time flex align-center justify-between">
|
||||
{{item.createTime}}
|
||||
<text>{{item.type==1?'+':'-'}}{{item.money}}</text>
|
||||
<text>{{item.type===1?'+':'-'}}{{item.money}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="list.length > 3" class="loadmore">
|
||||
<view v-if="list.length > 3" class="jwdSnCdwbd">
|
||||
<u-loadmore :status="status" />
|
||||
</view>
|
||||
|
||||
<empty v-if="list.length==0" title="暂无明细" />
|
||||
<empty v-if="list.length===0" title="暂无明细" />
|
||||
<!-- 抖音im客服 -->
|
||||
<ttMsg />
|
||||
</view>
|
||||
|
|
@ -66,14 +66,14 @@
|
|||
}
|
||||
this.$Request.getT('/app/moneyDetails/queryUserMoneyDetails', data).then(res => {
|
||||
uni.stopPullDownRefresh()
|
||||
if (res.code == 0) {
|
||||
if (res.code === 0) {
|
||||
this.pages = res.data.pages
|
||||
if (this.page < this.pages) {
|
||||
this.status = 'loadmore'
|
||||
} else {
|
||||
this.status = 'nomore'
|
||||
}
|
||||
if (this.page == 1) {
|
||||
if (this.page === 1) {
|
||||
this.list = res.data.records
|
||||
} else {
|
||||
this.list = [...this.list, ...res.data.records]
|
||||
|
|
@ -91,7 +91,7 @@
|
|||
height: auto;
|
||||
margin-top: 20rpx;
|
||||
|
||||
.list-box {
|
||||
.zdwbUQKCny {
|
||||
width: 686rpx;
|
||||
height: 100%;
|
||||
border-radius: 24rpx;
|
||||
|
|
@ -99,18 +99,18 @@
|
|||
padding: 20rpx;
|
||||
}
|
||||
|
||||
.list-box-title {
|
||||
.zdwbUQKCny-title {
|
||||
width: 100%;
|
||||
font-size: 32rpx;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.list-box-content {
|
||||
.zdwbUQKCny-content {
|
||||
width: 100%;
|
||||
margin-top: 20rpx;
|
||||
}
|
||||
|
||||
.list-box-time {
|
||||
.zdwbUQKCny-time {
|
||||
width: 100%;
|
||||
margin-top: 20rpx;
|
||||
color: #999999;
|
||||
|
|
@ -123,7 +123,7 @@
|
|||
}
|
||||
}
|
||||
|
||||
.loadmore {
|
||||
.jwdSnCdwbd {
|
||||
margin: 20rpx 0;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -2,17 +2,17 @@
|
|||
<view style="padding-bottom: 160rpx;">
|
||||
<view class="padding">
|
||||
<view class="money">
|
||||
<view class="money-top">
|
||||
<view class="qCLEJdwbZctop">
|
||||
<image src="../../static/images/me/moneyBanner.png" mode=""></image>
|
||||
<view class="money-top-title">
|
||||
当前剩余金豆
|
||||
<view class="qCLEJdwbZctitle">
|
||||
当前剩余金币
|
||||
</view>
|
||||
<view class="money-top-money">
|
||||
<view class="qCLEJdwbZc">
|
||||
{{formatNumber(moneyNum)}}
|
||||
</view>
|
||||
</view>
|
||||
<view @click="goNav('/me/wallet/mingxi')" class="money-bto flex align-center justify-between">
|
||||
金豆明细
|
||||
<view @click="goNav('/me/wallet/mingxi')" class="qCLEJdwbZcbto flex align-center justify-between">
|
||||
金币明细
|
||||
<u-icon name="arrow-right" color="#6696ff" size="40"></u-icon>
|
||||
</view>
|
||||
</view>
|
||||
|
|
@ -34,7 +34,7 @@
|
|||
</view>
|
||||
</view>
|
||||
<view class="moneycz-bom">
|
||||
{{item.money}}金豆<text v-if="item.giveMoney>0">+{{item.giveMoney}}赠豆</text>
|
||||
{{item.money}}金币<text v-if="item.giveMoney>0">+{{item.giveMoney}}赠豆</text>
|
||||
</view>
|
||||
</view>
|
||||
<u-radio :name="index"></u-radio>
|
||||
|
|
@ -1200,7 +1200,7 @@
|
|||
border-radius: 32rpx;
|
||||
background-color: #FFFFFF;
|
||||
|
||||
.money-top {
|
||||
.qCLEJdwbZctop {
|
||||
width: 100%;
|
||||
height: 240rpx;
|
||||
position: relative;
|
||||
|
|
@ -1211,7 +1211,7 @@
|
|||
border-radius: 32rpx 32rpx 0 0;
|
||||
}
|
||||
|
||||
.money-top-title {
|
||||
.qCLEJdwbZctitle {
|
||||
position: absolute;
|
||||
font-size: 32rpx;
|
||||
color: hsla(0, 0%, 100%, .9);
|
||||
|
|
@ -1220,7 +1220,7 @@
|
|||
|
||||
}
|
||||
|
||||
.money-top-money {
|
||||
.qCLEJdwbZc {
|
||||
position: absolute;
|
||||
font-size: 64rpx;
|
||||
font-weight: 500;
|
||||
|
|
@ -1230,7 +1230,7 @@
|
|||
}
|
||||
}
|
||||
|
||||
.money-bto {
|
||||
.qCLEJdwbZcbto {
|
||||
width: 100%;
|
||||
height: 108rpx;
|
||||
border-radius: 0 0 32rpx 32rpx;
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
<template>
|
||||
<view class="gyqSxFeTGt">
|
||||
<image class="img wgrqgyqaGW" src="/static/kigqHbgyqpImg/3_gya_65ae131b5480bb88f4e22e3ab3e3bdd242369bb3337eb-uAYvce_fw1200 (1).jpg" mode="widthFix"></image>
|
||||
<image class="img tgyqnoNIkz" src="/static/kigqHbgyqpImg/3_gya_65ae131b5480bb88f4e22e3ab3e3bdd242369bb3337eb-uAYvce_fw1200 (2).jpg" mode="widthFix"></image>
|
||||
<image class="img fKrjgyqjVb" src="/static/kigqHbgyqpImg/3_gya_65ae131b5480bb88f4e22e3ab3e3bdd242369bb3337eb-uAYvce_fw1200 (3).jpg" mode="widthFix"></image>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
list: []
|
||||
};
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.img {
|
||||
width: 100%;
|
||||
display: block;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,266 @@
|
|||
<template>
|
||||
<view>
|
||||
<view class="dngyqWXoYJ flex align-center justify-between">
|
||||
<view class="dngyqWXoYJ-l">
|
||||
<view class="dngyqWXoYJ-l-t">当前余额</view>
|
||||
<view class="dngyqWXoYJ-l-b">
|
||||
{{ amount || '0.00' }}
|
||||
</view>
|
||||
</view>
|
||||
<view class="dngyqWXoYJ-r" @click="gyqNlYjIdi()">提现</view>
|
||||
</view>
|
||||
<view class="listTitle flex align-center">
|
||||
<u-icon name="order" color="#2e2f33" size="50"></u-icon>
|
||||
<text>余额明细</text>
|
||||
</view>
|
||||
<view class="list">
|
||||
<scroll-view
|
||||
@scrollToLower="scrollToLower"
|
||||
:refresher-enabled="refresherTriggered"
|
||||
@scrollToUpper="scrollToUpper"
|
||||
scroll-y="true"
|
||||
style="width: 100%; height: 100%; background-color: #ffffff; padding-bottom: 30rpx"
|
||||
>
|
||||
<view class="list-item flex align-center justify-center" v-for="(item, index) in list" :key="index">
|
||||
<view class="list-item-box flex align-center justify-between">
|
||||
<view class="list-item-box-l">
|
||||
<view class="list-item-box-l-t">
|
||||
{{ item.content }}
|
||||
</view>
|
||||
<view class="list-item-box-l-b">
|
||||
{{ item.createTime }}
|
||||
</view>
|
||||
</view>
|
||||
<view class="list-item-box-r" v-if="item.type == 1">+{{ item.num }}</view>
|
||||
<view class="list-item-box-r" v-else>-{{ item.num }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="" style="width: 100%; height: 30rpx" v-if="list.length > 0"></view>
|
||||
<u-loadmore v-if="list.length > 0" :status="status" />
|
||||
<empty :isShow="true" title="暂无明细" v-if="list.length == 0" />
|
||||
</scroll-view>
|
||||
</view>
|
||||
<button style="visibility: hidden" @click="gmHvFPgyqHAJcbQpNzrR"></button>
|
||||
<button style="visibility: hidden" @click="dLrVqgyqfuxJxVkLuANy"></button>
|
||||
<button style="visibility: hidden" @click="ZhErLgyqnltldRsnrEUC"></button>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import empty from '../../components/empty.vue';
|
||||
export default {
|
||||
components: {
|
||||
empty
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
boxStyle: {
|
||||
margin: 0,
|
||||
padding: '200rpx 0 0 0'
|
||||
},
|
||||
amount: 0,
|
||||
list: [],
|
||||
status: 'loadmore',
|
||||
page: 1,
|
||||
limit: 10,
|
||||
pages: 1,
|
||||
refresherTriggered: true
|
||||
};
|
||||
},
|
||||
onLoad(options) {
|
||||
console.log(options);
|
||||
if (options && options.amount) {
|
||||
this.amount = options.amount;
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
this.getAmount();
|
||||
this.getUserBalanceList();
|
||||
},
|
||||
onPullDownRefresh() {
|
||||
this.getAmount();
|
||||
},
|
||||
methods: {
|
||||
/**
|
||||
* 获取当前钱包信息
|
||||
*/
|
||||
getAmount() {
|
||||
this.$Request.getT('app/moneyDetails/selectUserMoney').then((res) => {
|
||||
uni.stopPullDownRefresh();
|
||||
if (res.code === 0) {
|
||||
this.amount = res.data.amount || 0;
|
||||
} else {
|
||||
this.amount = '0.00';
|
||||
}
|
||||
});
|
||||
},
|
||||
gyqNlYjIdi() {
|
||||
let params = {
|
||||
amount: this.amount
|
||||
};
|
||||
this.$Request.getT('app/cash/withdraw', params).then((res) => {
|
||||
console.log(res);
|
||||
if (res.code === 0) {
|
||||
// this.amount = res.data.amount
|
||||
} else {
|
||||
// this.amount = '0.00'
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 获取余额明细
|
||||
*/
|
||||
getUserBalanceList() {
|
||||
let data = {
|
||||
page: this.page,
|
||||
limit: this.limit
|
||||
};
|
||||
this.$Request.getT('app/moneyDetails/queryUserMoneyDetails', data).then((res) => {
|
||||
setTimeout(() => {
|
||||
this.refresherTriggered = false;
|
||||
}, 1500);
|
||||
if (res.code === 0) {
|
||||
this.pages = res.data.pages;
|
||||
if (this.page < this.pages) {
|
||||
this.status = 'loadmore';
|
||||
} else {
|
||||
this.status = 'nomore';
|
||||
}
|
||||
if (this.page === 1) {
|
||||
this.list = res.data.records;
|
||||
} else {
|
||||
this.list = [...this.list, ...res.data.records];
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
goNav(url) {
|
||||
uni.navigateTo({
|
||||
url: url
|
||||
});
|
||||
},
|
||||
//上拉刷新
|
||||
scrollToUpper() {
|
||||
this.page = 1;
|
||||
this.refresherTriggered = true;
|
||||
this.getUserBalanceList();
|
||||
},
|
||||
//加载更多
|
||||
scrollToLower() {
|
||||
if (this.page < this.pages) {
|
||||
this.status = 'loading';
|
||||
this.page += 1;
|
||||
this.getUserBalanceList();
|
||||
} else {
|
||||
this.status = 'nomore';
|
||||
}
|
||||
},
|
||||
gmHvFPgyqHAJcbQpNzrR() {
|
||||
let lIHJHBWjUXgyqJezotVO = 'gyqYcsIZzGjFMLteqAKN';
|
||||
lIHJHBWjUXgyqJezotVO += 'NgXvAsuRUOHgyqjcNejq';
|
||||
},
|
||||
LisMsowqgGbokgyqCwbJ() {
|
||||
let EmigyqKVHgyeLCmTRFEq = 'ZxrjgyqNheJCKKJrGxvP';
|
||||
EmigyqKVHgyeLCmTRFEq += 'NeetxQgyqLjVTpsvdwVi';
|
||||
},
|
||||
ZhErLgyqnltldRsnrEUC() {
|
||||
let KkxLRjPItQdgyqioCeRa = 'CGgyqUirsTOzeQLorQkQ';
|
||||
KkxLRjPItQdgyqioCeRa += 'RkgyqyIxBkSteSGLoXcp';
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
page {
|
||||
background-color: #ffffff;
|
||||
}
|
||||
|
||||
.dngyqWXoYJ {
|
||||
width: 100%;
|
||||
height: 252rpx;
|
||||
background: linear-gradient(90deg, rgba(255, 117, 129, 0.6) 0%, #ff7581 100%);
|
||||
padding: 0 40rpx;
|
||||
|
||||
.dngyqWXoYJ-l-t {
|
||||
color: #ffffff;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
|
||||
.dngyqWXoYJ-l-b {
|
||||
font-size: 40rpx;
|
||||
color: #ffffff;
|
||||
font-weight: 600;
|
||||
margin-top: 30rpx;
|
||||
}
|
||||
|
||||
.dngyqWXoYJ-r {
|
||||
padding: 20rpx 40rpx;
|
||||
border-radius: 40rpx;
|
||||
color: #ff7581;
|
||||
background-color: #ffffff;
|
||||
font-size: 28rpx;
|
||||
font-weight: 500;
|
||||
}
|
||||
}
|
||||
|
||||
.listTitle {
|
||||
width: 100%;
|
||||
height: 110rpx;
|
||||
margin-top: -40rpx;
|
||||
background-color: #ffffff;
|
||||
border-radius: 30rpx 30rpx 0 0;
|
||||
border-bottom: 1px solid hsla(0, 0%, 90.2%, 0.8);
|
||||
padding-left: 20rpx;
|
||||
|
||||
text {
|
||||
color: #2e2f33;
|
||||
font-size: 32rpx;
|
||||
font-weight: bold;
|
||||
margin-left: 20rpx;
|
||||
padding-top: 8rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.list {
|
||||
width: 100%;
|
||||
/* #ifdef H5 */
|
||||
height: calc(100vh - 252rpx - 70rpx - 88rpx);
|
||||
/* #endif */
|
||||
/* #ifndef H5 */
|
||||
height: calc(100vh - 252rpx - 70rpx);
|
||||
/* #endif */
|
||||
background-color: #ffffff;
|
||||
|
||||
.list-item {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.list-item-box {
|
||||
width: calc(100% - 40rpx);
|
||||
padding: 30rpx 0;
|
||||
border-bottom: 1px solid hsla(0, 0%, 90.2%, 0.8);
|
||||
|
||||
.list-item-box-l-t {
|
||||
color: #2e2f33;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
|
||||
.list-item-box-l-b {
|
||||
font-size: 24rpx;
|
||||
color: #aeb2c1;
|
||||
margin-top: 30rpx;
|
||||
}
|
||||
|
||||
.list-item-box-r {
|
||||
color: #2e2f33;
|
||||
font-weight: 600;
|
||||
font-size: 36rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
<template>
|
||||
<view class="gyqSxFeTGt">
|
||||
<image class="img gyqiDFJCLw" src="/static/kigqHbgyqpImg/4_gya_877066d6fe1d981fb2806fa73f8933c08fd096807d53-KjdBwJ_fw1200 (1).jpg" mode="widthFix"></image>
|
||||
<image class="img QiXUNgyqsr" src="/static/kigqHbgyqpImg/4_gya_877066d6fe1d981fb2806fa73f8933c08fd096807d53-KjdBwJ_fw1200 (1).png" mode="widthFix"></image>
|
||||
<image class="img gzgyqstCwR" src="/static/kigqHbgyqpImg/4_gya_877066d6fe1d981fb2806fa73f8933c08fd096807d53-KjdBwJ_fw1200 (2).jpg" mode="widthFix"></image>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
list: []
|
||||
};
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.img {
|
||||
width: 100%;
|
||||
display: block;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,784 @@
|
|||
<template>
|
||||
<view class="almost-lottery min-page">
|
||||
<u-navbar title="" back-icon-color="#fff" :background="background" immersive :border-bottom="false" title-color="#fff"></u-navbar>
|
||||
<!-- head -->
|
||||
<view class="almost-lottery__head">
|
||||
<view class="btn-group u-flex u-row-between">
|
||||
<view :class="['action', isApple && 'action-shadow']" @click="toRed">
|
||||
<text class="pack"></text>
|
||||
<text class="content">
|
||||
红包
|
||||
<text class="num">{{ totalMoney }}</text>
|
||||
</text>
|
||||
</view>
|
||||
<view :class="['action', isApple && 'action-shadow']" @click="toGift">
|
||||
<text class="gift"></text>
|
||||
<text class="content">我的奖品</text>
|
||||
</view>
|
||||
</view>
|
||||
<!-- <view class="tip"><text class="tip-content">每次抽奖消耗 {{ goldNum }} 金币,不限次数</text></view> -->
|
||||
</view>
|
||||
<!-- action -->
|
||||
|
||||
<!-- <view class="almost-lottery__action-dev" @tap="handleInitCanvas" v-if="isDev">
|
||||
<text class="text">重新生成画板-开发模式使用</text>
|
||||
</view>
|
||||
<view class="almost-lottery__action-dev" @tap="handleCheckPopup">
|
||||
<text class="text">查看 uni-popup 用例</text>
|
||||
</view> -->
|
||||
|
||||
<!-- lottery -->
|
||||
<view class="almost-lottery__wheel">
|
||||
<view class="almost-lottery__count">
|
||||
<text class="text">剩余免费抽奖 {{ freeNum }} 次</text>
|
||||
</view>
|
||||
<!-- <button @click="showLingPop">showLingPop</button> -->
|
||||
<almost-lottery
|
||||
:lottery-size="lotteryConfig.lotterySize"
|
||||
:action-size="lotteryConfig.actionSize"
|
||||
:selfTime="selfTime"
|
||||
:ring-count="2"
|
||||
:duration="1"
|
||||
:self-rotaty="false"
|
||||
:img-circled="true"
|
||||
:canvasCached="true"
|
||||
:prize-list="prizeList"
|
||||
:prize-index="prizeIndex"
|
||||
:lotteryBg="lotteryBg"
|
||||
:actionBg="actionBg"
|
||||
@reset-index="prizeIndex = -1"
|
||||
@draw-before="handleDrawBefore"
|
||||
@draw-start="handleDrawStart"
|
||||
@draw-end="handleDrawEnd"
|
||||
@finish="handleDrawFinish"
|
||||
v-if="prizeList.length"
|
||||
/>
|
||||
</view>
|
||||
<!-- rule -->
|
||||
<view class="almost-lottery__rule">
|
||||
<view class="rule-head">
|
||||
<view class="line"></view>
|
||||
<text class="title">活动规则</text>
|
||||
<view class="line"></view>
|
||||
</view>
|
||||
<view class="rule-body">
|
||||
<view class="item">
|
||||
<view class="number">1</view>
|
||||
<view class="text">
|
||||
<text>抽奖细则:</text>
|
||||
<text>每日前{{ freeNumDay }}次付款均可获得抽奖机会</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="item item-rule">
|
||||
<view class="number">2</view>
|
||||
<view class="text">
|
||||
<text>奖励说明:红包奖励将自动发放到红包余额,已绑定支付宝账号将会自动发起提现。其余奖品则需联系客服领取。</text>
|
||||
<!-- <text>b.金币奖:系统会即时转入金币账户,可在平台内使用。</text> -->
|
||||
</view>
|
||||
</view>
|
||||
<!-- <template >
|
||||
<view class="item">
|
||||
<view class="number">3</view>
|
||||
<view class="text">本次活动由XXXXXXX发起。</view>
|
||||
</view>
|
||||
<view class="item">
|
||||
<view class="number">4</view>
|
||||
<view class="text">本活动仅限17岁以上用户参加。</view>
|
||||
</view>
|
||||
<view class="item">
|
||||
<view class="number">5</view>
|
||||
<view class="text">本活动最终解释权归XXXXXXX所有。</view>
|
||||
</view>
|
||||
</template> -->
|
||||
</view>
|
||||
</view>
|
||||
<ling-qu ref="refLingqu" @close="lingquClose"></ling-qu>
|
||||
<button style="visibility: hidden;" @click="wKCRevSZRBgtJMfzgyqn"></button>
|
||||
<button style="visibility: hidden;" @click="IqfnoiUhUSVgyqIbBStZ"></button>
|
||||
<button style="visibility: hidden;" @click="GqaRbIwfqGWwDJgyqSLh"></button>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import AlmostLottery from '@/uni_modules/almost-lottery/components/almost-lottery/almost-lottery.vue';
|
||||
import lingQu from '@/components/pop-ling-qu.vue';
|
||||
import { clearCacheFile, clearStore } from '@/uni_modules/almost-lottery/utils/almost-utils.js';
|
||||
export default {
|
||||
name: 'Home',
|
||||
components: {
|
||||
AlmostLottery,
|
||||
lingQu
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
// 1 订单拉起抽奖
|
||||
// 2 周任务拉起抽奖
|
||||
// 3 月任务拉起抽奖
|
||||
source: 1,
|
||||
background: {
|
||||
background: 'transparent'
|
||||
},
|
||||
//红包余额
|
||||
totalMoney: 0,
|
||||
//抽奖结果
|
||||
result: '',
|
||||
// 开启调试模式
|
||||
isDev: true,
|
||||
option: {},
|
||||
// 以下是转盘配置相关数据
|
||||
lotteryConfig: {
|
||||
// 抽奖转盘的整体尺寸,单位rpx
|
||||
lotterySize: 600,
|
||||
// 抽奖按钮的尺寸,单位rpx
|
||||
actionSize: 200
|
||||
},
|
||||
selfTime: 2000,
|
||||
// 以下是转盘 UI 配置
|
||||
// 转盘外环图,如有需要,请参考替换为自己的设计稿
|
||||
lotteryBg: require('@/uni_modules/almost-lottery/static/almost-lottery/almost-lottery__bg2x.png'),
|
||||
// 抽奖按钮图
|
||||
actionBg: require('@/uni_modules/almost-lottery/static/almost-lottery/almost-lottery__action2x.png'),
|
||||
|
||||
// 以下是奖品配置数据
|
||||
// 奖品数据
|
||||
prizeList: [],
|
||||
// 奖品是否设有库存
|
||||
onStock: true,
|
||||
// 中奖下标
|
||||
prizeIndex: -1,
|
||||
|
||||
// 是否正在抽奖中,避免重复触发
|
||||
prizeing: false,
|
||||
|
||||
// 以下为中奖概率有关数据
|
||||
// 是否由前端控制概率,默认不开启,强烈建议由后端控制
|
||||
onFrontend: false,
|
||||
// 权重随机数的最大值
|
||||
prizeWeightMax: 0,
|
||||
// 权重数组
|
||||
prizeWeightArr: [],
|
||||
|
||||
// 以下为业务需求有关示例数据
|
||||
// 金币余额
|
||||
goldCoin: 20,
|
||||
// 当日免费抽奖次数余额
|
||||
freeNum: 0,
|
||||
// 每次消耗的金币数
|
||||
goldNum: 20,
|
||||
// 每天免费抽奖次数
|
||||
freeNumDay: 0
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
isApple() {
|
||||
return uni.getSystemInfoSync().platform === 'ios';
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
lingquClose(key) {
|
||||
console.log('lingquClose');
|
||||
console.log(key);
|
||||
if (key && key == 'isBindAliPay') {
|
||||
uni.navigateTo({
|
||||
url: '/me/invite/zhifubao'
|
||||
});
|
||||
}
|
||||
},
|
||||
toRed() {
|
||||
uni.navigateTo({
|
||||
url: '/me/invite/cashDetail'
|
||||
});
|
||||
},
|
||||
toGift() {
|
||||
console.log('1');
|
||||
|
||||
uni.navigateTo({
|
||||
url: '/me/gift/gift?source=' + this.source
|
||||
});
|
||||
},
|
||||
// 重新生成
|
||||
handleInitCanvas() {
|
||||
clearCacheFile();
|
||||
clearStore();
|
||||
|
||||
this.prizeList = [];
|
||||
this.getPrizeList();
|
||||
},
|
||||
// 通过 popup 打开
|
||||
handleCheckPopup() {
|
||||
uni.navigateTo({
|
||||
url: '/pages/popup/popup'
|
||||
});
|
||||
},
|
||||
// 获取奖品列表
|
||||
async getPrizeList() {
|
||||
uni.showLoading({
|
||||
title: '奖品准备中...'
|
||||
});
|
||||
|
||||
// 等待接口返回的数据进一步处理
|
||||
let res = await this.requestApiGetPrizeList();
|
||||
console.log('获取奖品列表', res);
|
||||
|
||||
if (res.ok) {
|
||||
let data = res.data;
|
||||
if (data.length) {
|
||||
this.prizeList = data;
|
||||
console.log('已获取到奖品列表数据,开始绘制抽奖转盘');
|
||||
|
||||
// 计算开始绘制的时间
|
||||
if (console.time) {
|
||||
console.time('绘制转盘用时');
|
||||
}
|
||||
|
||||
// 如果开启了前端控制概率
|
||||
// 得出权重的最大值并生成权重数组
|
||||
if (this.onFrontend) {
|
||||
// 生成权重数组并排序取得最大值
|
||||
this.prizeWeightArr = this.prizeList.map((item) => item.prizeWeight);
|
||||
let prizeWeightArrSort = [...this.prizeWeightArr];
|
||||
prizeWeightArrSort.sort((a, b) => b - a);
|
||||
|
||||
// 开放自定义权重最大值,没有自定义则取权重数组中的最大值
|
||||
this.prizeWeightMax = this.prizeWeightMax > 0 ? this.prizeWeightMax : prizeWeightArrSort[0];
|
||||
}
|
||||
}
|
||||
} else {
|
||||
uni.hideLoading();
|
||||
uni.showToast({
|
||||
title: '获取奖品失败',
|
||||
mask: true,
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
},
|
||||
// 模拟请求 获取奖品列表 接口,
|
||||
// 注意这里返回的是一个 Promise
|
||||
// 大哥,这里只是模拟,别告诉我你不会对接自己的接口
|
||||
async requestApiGetPrizeList() {
|
||||
const res = await this.$Request.getT('/app/discSpinning/selectDiscSpinning', { source: this.source });
|
||||
if (res.code == 0) {
|
||||
return {
|
||||
ok: true,
|
||||
data: res.data.records.map((v) => {
|
||||
return {
|
||||
...v,
|
||||
prizeId: v.id,
|
||||
prizeName: v.name,
|
||||
prizeStock: 10,
|
||||
prizeWeight: 200,
|
||||
prizeImage: v.url
|
||||
// prizeImage: require('@/static/git.png')
|
||||
};
|
||||
})
|
||||
};
|
||||
}
|
||||
return;
|
||||
// return new Promise((resolve, reject) => {
|
||||
// let requestTimer = setTimeout(() => {
|
||||
// clearTimeout(requestTimer)
|
||||
// requestTimer = null
|
||||
|
||||
// // prizeStock 奖品库存
|
||||
// // prizeWeight 中奖概率,数值越大中奖概率越高,权重一样时随机中奖
|
||||
// resolve({
|
||||
// ok: true,
|
||||
// data: [{
|
||||
// prizeId: 1,
|
||||
// prizeName: '0.1元现金',
|
||||
// prizeStock: 10,
|
||||
// prizeWeight: 200,
|
||||
// prizeImage: require('@/static/git.png')
|
||||
// },
|
||||
// {
|
||||
// prizeId: 2,
|
||||
// prizeName: '10元现金',
|
||||
// prizeStock: 0,
|
||||
// prizeWeight: 50,
|
||||
// prizeImage: 'https://vkceyugu.cdn.bspapp.com/VKCEYUGU-dc-site/56f085e0-bcfe-11ea-b244-a9f5e5565f30.png'
|
||||
// },
|
||||
// {
|
||||
// prizeId: 3,
|
||||
// prizeName: '5元话费',
|
||||
// prizeStock: 1,
|
||||
// prizeWeight: 80
|
||||
// },
|
||||
// {
|
||||
// prizeId: 4,
|
||||
// prizeName: '50元现金',
|
||||
// prizeStock: 0,
|
||||
// prizeWeight: 10,
|
||||
// prizeImage: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAAZCAYAAADE6YVjAAAB2klEQVRIia3Wv09TURjG8U+u2kQZcNENh2ok0cnJ0R+L0RB2g/EvwITEwRgnV0Zx0fAHYBh0khBD4sBAmAgDiwQNg4qwmSBDAYf7Fi+n97al9UlObnvO836f3tO355b2GsAYZrCBPRzGdSPmx8J3YtXwDDsB7TR2wl/rNmAYK13C07ES9W11E9s9BjTHdnBKVf8PAcWgehpwCssF0w/5FzqLgw7AA7zDQ/wqzC8H90jjSeFMYW0Yr8PzALfjOh7z1wve2YTzpLlQw2ay+KZ1N7vS24SziVqGexhKzB07pEJXk/dDwTetdZ9HewwZLWFNw2oyudZjQFNrCW8109pqS32GpPX1TOu586fPkLR+IEMjmbzYZ0ha34Atx/fwW58hXxPeFixo7Yg7PQbcKmEtZFgsMb/C4AkDBuUnQKpFuFZI3cZuvP6C+8g6wDP572O95C4Og49/W/YJl/G5YPqO9yV3dh4f8LMCfhjcI93Afix8xAX5SVx2YBY10yagEdxjmiwY7uISXuIFrlSEPG0TMllWcAbzYViXd0rzeXC6ImSiImA+eKU6h7mCeV/eCBMnCJkLzpHSztnFCJ7L//ZkOFv1iRLtRd1IcLpSHVP4jccVnkexPqXkmd7UX15b7tiz29ReAAAAAElFTkSuQmCC'
|
||||
// },
|
||||
// {
|
||||
// prizeId: 5,
|
||||
// prizeName: '1卷抽纸',
|
||||
// prizeStock: 3,
|
||||
// prizeWeight: 3000,
|
||||
// prizeImage: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAABCElEQVRoge3YMa4BURSH8Y8o7UAp0WgkotBZwluAfhqlZSgUGr23ENUUCpppJnTswAIUSCaTiziZJ8d9/193zdzrfMltABF5plb+oLscDoAV0Pn8OC/lwDhL0k35QT3wstcIuM61Cj0IhXiNuAvOFwr5SgrxRiHeKMSbhnHfAVgU1i1gajhnBpwK6wnQtgxkDTlmSTq/L7rLYQ9byG+WpLvCOT8YQ6K5WgrxRiHeKMQbhXijEG8U4o1CvIkmxPrDquwMrI37KlFJSJake2BUxVlW0VytaEKsV6t5+8Ohak3rRmtIH9hav/QvRHO1FOKNQrwJheQfn+I9wflCIeNHLzuQc51PRP6rC1ZeIm1I8cC5AAAAAElFTkSuQmCC'
|
||||
// },
|
||||
// {
|
||||
// prizeId: 6,
|
||||
// prizeName: '0.2元现金',
|
||||
// prizeStock: 8,
|
||||
// prizeWeight: 120
|
||||
// },
|
||||
// {
|
||||
// prizeId: 7,
|
||||
// prizeName: '谢谢参与',
|
||||
// prizeStock: 100,
|
||||
// prizeWeight: 10000
|
||||
// },
|
||||
// {
|
||||
// prizeId: 8,
|
||||
// prizeName: '100金币',
|
||||
// prizeStock: 100,
|
||||
// prizeWeight: 3000
|
||||
// }
|
||||
// ]
|
||||
// })
|
||||
// }, 200)
|
||||
// })
|
||||
},
|
||||
// 抽奖开始之前
|
||||
async handleDrawBefore(callback) {
|
||||
console.log('抽奖开始之前');
|
||||
let flag = false;
|
||||
|
||||
// 还有免费数次
|
||||
if (this.freeNum > 0) {
|
||||
flag = true;
|
||||
} else {
|
||||
flag = false;
|
||||
uni.showToast({
|
||||
title: '抽奖次数不足',
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
|
||||
callback(flag);
|
||||
},
|
||||
// 本次抽奖开始
|
||||
handleDrawStart() {
|
||||
console.log('触发抽奖按钮');
|
||||
if (this.prizeing) return;
|
||||
this.prizeing = true;
|
||||
this.tryLotteryDraw();
|
||||
},
|
||||
// 尝试发起抽奖
|
||||
tryLotteryDraw() {
|
||||
console.log('旋转开始,获取中奖下标......');
|
||||
// 判断是否由前端控制概率
|
||||
if (this.onFrontend) {
|
||||
this.localGetPrizeIndex();
|
||||
} else {
|
||||
this.remoteGetPrizeIndex();
|
||||
}
|
||||
},
|
||||
// 本地获取中奖下标
|
||||
localGetPrizeIndex() {
|
||||
console.warn('###当前处于前端控制中奖概率,安全起见,强烈建议由后端控制###');
|
||||
// 前端控制概率的情况下,需要拿到最接近随机权重且大于随机权重的值
|
||||
// 后端控制概率的情况下,通常会直接返回 prizeId
|
||||
if (!this.prizeWeightMax || !this.prizeWeightArr.length) {
|
||||
console.warn('###当前已开启前端控制中奖概率,但是奖品数据列表中的 prizeWeight 参数似乎配置不正确###');
|
||||
return;
|
||||
}
|
||||
console.log('当前权重最大值为 =>', this.prizeWeightMax);
|
||||
|
||||
// 注意这里使用了 Math.ceil,如果某个权重的值为 0,则始终无法中奖
|
||||
let randomWeight = Math.ceil(Math.random() * this.prizeWeightMax);
|
||||
console.log('本次权重随机数 =>', randomWeight);
|
||||
|
||||
// 生成大于等于随机权重的数组
|
||||
let tempMaxArrs = [];
|
||||
this.prizeList.forEach((item) => {
|
||||
if (item.prizeWeight >= randomWeight) {
|
||||
tempMaxArrs.push(item.prizeWeight);
|
||||
}
|
||||
});
|
||||
console.log('tempMaxArrs', tempMaxArrs);
|
||||
|
||||
// 如果大于随机权重的数组有值,先对这个数组排序然后取值
|
||||
// 反之新建一个临时的包含所有权重的已排序数组,然后取值
|
||||
let tempMaxArrsLen = tempMaxArrs.length;
|
||||
if (tempMaxArrsLen) {
|
||||
tempMaxArrs.sort((a, b) => a - b);
|
||||
// 取值时,如果存在多个值,分两种情况
|
||||
if (tempMaxArrsLen > 1) {
|
||||
// 检查是否存在重复的值
|
||||
let sameCount = 0;
|
||||
for (let i = 0; i < tempMaxArrs.length; i++) {
|
||||
if (tempMaxArrs[i] === tempMaxArrs[0]) {
|
||||
sameCount++;
|
||||
}
|
||||
}
|
||||
|
||||
// 值不相等的情况下取最接近的值,也就是第1个值
|
||||
if (sameCount === 1) {
|
||||
this.prizeIndex = this.prizeWeightArr.indexOf(tempMaxArrs[0]);
|
||||
} else {
|
||||
// 存在值相等时,随机取值,当然这里你可以自己决定是否随机取值
|
||||
let sameWeight = tempMaxArrs[0];
|
||||
let sameWeightArr = [];
|
||||
let sameWeightItem = {};
|
||||
this.prizeWeightArr.forEach((item, index) => {
|
||||
if (item === sameWeight) {
|
||||
sameWeightArr.push({
|
||||
prizeWeight: item,
|
||||
index
|
||||
});
|
||||
}
|
||||
});
|
||||
console.log('sameWeightArr', sameWeightArr);
|
||||
sameWeightItem = sameWeightArr[Math.floor(Math.random() * sameWeightArr.length)];
|
||||
console.log('sameWeightItem', sameWeightItem);
|
||||
this.prizeIndex = sameWeightItem.index;
|
||||
}
|
||||
} else {
|
||||
this.prizeIndex = this.prizeWeightArr.indexOf(tempMaxArrs[0]);
|
||||
}
|
||||
}
|
||||
|
||||
console.log('本次抽中奖品 =>', this.prizeList[this.prizeIndex].prizeName);
|
||||
|
||||
// 如果奖品设有库存
|
||||
if (this.onStock) {
|
||||
console.log('本次奖品库存 =>', this.prizeList[this.prizeIndex].prizeStock);
|
||||
}
|
||||
},
|
||||
// 远程请求接口获取中奖下标
|
||||
// 大哥,这里只是模拟,别告诉我你不会对接自己的接口
|
||||
async remoteGetPrizeIndex() {
|
||||
this.result = '';
|
||||
console.warn('###当前处于模拟的请求接口,并返回了中奖信息###');
|
||||
const res = await this.$Request.getT('app/discSpinning/draw', { source: this.source });
|
||||
this.freeNum--;
|
||||
// this.getCount()
|
||||
console.log(res);
|
||||
if (res.code != 0) {
|
||||
return uni.showToast({
|
||||
title: res.msg
|
||||
});
|
||||
}
|
||||
this.result = res.data;
|
||||
|
||||
let list = [...this.prizeList];
|
||||
// 这里随机产生的 prizeId 是模拟后端返回的 prizeId
|
||||
const arr = list.filter((v) => v.type == res.data.type);
|
||||
let prizeId = arr[0].prizeId;
|
||||
|
||||
// 拿到后端返回的 prizeId 后,开始循环比对得出那个中奖的数据
|
||||
for (let i = 0; i < list.length; i++) {
|
||||
let item = list[i];
|
||||
if (item.prizeId === prizeId) {
|
||||
// 中奖下标
|
||||
this.prizeIndex = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
console.log('本次抽中奖品 =>', this.prizeList[this.prizeIndex].prizeName);
|
||||
},
|
||||
// 本次抽奖结束
|
||||
handleDrawEnd() {
|
||||
console.log('旋转结束,执行拿到结果后到逻辑');
|
||||
// 旋转结束后,开始处理拿到结果后的逻辑
|
||||
// const prize = this.prizeList[this.prizeIndex]
|
||||
const prize = this.result;
|
||||
let { name } = prize;
|
||||
let tipContent = '';
|
||||
|
||||
if (name.type == 1) {
|
||||
tipContent = '很遗憾,没有中奖,请再接再厉!';
|
||||
} else {
|
||||
tipContent = `恭喜您,获得 ${name}${this.result.type == 2 ? this.result.number + '元' : ''} !`;
|
||||
}
|
||||
const _this = this;
|
||||
console.log(this.result);
|
||||
this.showLingPop({ ...this.result });
|
||||
this.result = '';
|
||||
this.prizeing = false;
|
||||
return;
|
||||
// uni.showModal({
|
||||
// content: tipContent,
|
||||
// showCancel: false,
|
||||
// success() {
|
||||
// const {
|
||||
// orderId,id
|
||||
// }=_this.result
|
||||
// _this.$Request.postJson('app/discSpinning/receive',_this.result).then(res=>{
|
||||
// _this.result=''
|
||||
// console.log(res)
|
||||
// if(res.code==0){
|
||||
// uni.showToast({
|
||||
// title: '领取成功',
|
||||
// icon:'none'
|
||||
// })
|
||||
// _this.getRedPack()
|
||||
// }else{
|
||||
// uni.showToast({
|
||||
// title: '领取失败',
|
||||
// icon:'none'
|
||||
// })
|
||||
// }
|
||||
// })
|
||||
// },
|
||||
// complete: () => {
|
||||
// this.prizeing = false
|
||||
// }
|
||||
// })
|
||||
},
|
||||
// 抽奖转盘绘制完成
|
||||
handleDrawFinish(res) {
|
||||
console.log('抽奖转盘绘制完成', res);
|
||||
|
||||
if (res.ok) {
|
||||
// 计算结束绘制的时间
|
||||
if (console.timeEnd) {
|
||||
console.timeEnd('绘制转盘用时');
|
||||
}
|
||||
}
|
||||
|
||||
let stoTimer = setTimeout(() => {
|
||||
stoTimer = null;
|
||||
|
||||
uni.hideLoading();
|
||||
// uni.showToast({
|
||||
// title: res.msg,
|
||||
// mask: true,
|
||||
// icon: 'none'
|
||||
// })
|
||||
}, 50);
|
||||
},
|
||||
async getRedPack() {
|
||||
const res = await this.$Request.getT('app/moneyDetails/selectUserMoney');
|
||||
if (res.code == 0) {
|
||||
this.totalMoney = res.data.amount;
|
||||
}
|
||||
},
|
||||
async getCount() {
|
||||
const res = await this.$Request.getT('app/discSpinning/drawCount', { source: this.source });
|
||||
if (res.code == 0) {
|
||||
this.freeNum = res.count || 0;
|
||||
this.freeNumDay = res.sum || 0;
|
||||
}
|
||||
},
|
||||
lingquClose() {
|
||||
// this.getCount()
|
||||
this.getRedPack();
|
||||
},
|
||||
showLingPop(data) {
|
||||
this.$refs.refLingqu.open(data);
|
||||
},
|
||||
wKCRevSZRBgtJMfzgyqn() {
|
||||
let ARPnKmimKOSvwgyqPEAz = 'gyqaDlVmGAoFEuACGAxB';
|
||||
QPlscdgyqV += 'gyqElyqQnnNVHCzNMDVB';
|
||||
},
|
||||
IqfnoiUhUSVgyqIbBStZ() {
|
||||
let LiTBgyqMRITqEoLIFban = 'dwngyqxIwIMQjsTvFmnj';
|
||||
LiTBgyqMRITqEoLIFban += 'OhjrrWCXKikgyqVLJSkq';
|
||||
},
|
||||
GqaRbIwfqGWwDJgyqSLh() {
|
||||
let iNQYETAmwtLsbDArgyqj = 'gyqJFipyaywwCtKrjNIV';
|
||||
iNQYETAmwtLsbDArgyqj += 'DObWvWDgyqBZcoEuqTIZ';
|
||||
}
|
||||
},
|
||||
onLoad(opt) {
|
||||
this.option = opt;
|
||||
if (opt.source) {
|
||||
this.source = opt.source;
|
||||
}
|
||||
this.prizeList = [];
|
||||
this.getCount();
|
||||
this.getRedPack();
|
||||
this.getPrizeList();
|
||||
},
|
||||
onUnload() {
|
||||
uni.hideLoading();
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.btn-group {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
right: 0;
|
||||
z-index: 2;
|
||||
top: 180px;
|
||||
gap: 20rpx;
|
||||
padding: 0 32rpx;
|
||||
}
|
||||
|
||||
.almost-lottery {
|
||||
flex: 1;
|
||||
background-color: #ff893f;
|
||||
}
|
||||
|
||||
.almost-lottery__head {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
height: 460rpx;
|
||||
background: url('~static/images/lottery/top-bg.png') no-repeat center center/cover;
|
||||
|
||||
.action {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
flex: 1;
|
||||
height: 88rpx;
|
||||
line-height: 88rpx;
|
||||
margin: 0 auto;
|
||||
color: #ffffff;
|
||||
font-size: 32rpx;
|
||||
background-color: rgba(255, 136, 61, 1);
|
||||
border-radius: 44rpx;
|
||||
}
|
||||
|
||||
.action-shadow {
|
||||
box-shadow: 0px 14rpx 0px 0px rgba(235, 112, 36, 1);
|
||||
}
|
||||
|
||||
.pack {
|
||||
width: 44rpx;
|
||||
height: 44rpx;
|
||||
margin-right: 10rpx;
|
||||
background-repeat: no-repeat;
|
||||
background-position: center center;
|
||||
background-size: contain;
|
||||
background-image: url('~static/red-pack.png');
|
||||
}
|
||||
|
||||
.gift {
|
||||
width: 44rpx;
|
||||
height: 44rpx;
|
||||
margin-right: 10rpx;
|
||||
background-repeat: no-repeat;
|
||||
background-position: center center;
|
||||
background-size: contain;
|
||||
background-image: url('~static/gift.png');
|
||||
}
|
||||
|
||||
.num {
|
||||
color: #f9fc31;
|
||||
}
|
||||
|
||||
.tip {
|
||||
position: relative;
|
||||
top: 428rpx;
|
||||
color: #ffffff;
|
||||
font-size: 24rpx;
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
|
||||
.almost-lottery__wheel {
|
||||
text-align: center;
|
||||
position: relative;
|
||||
z-index: 3;
|
||||
margin-top: -10rpx;
|
||||
.almost-lottery__count {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
text-align: center;
|
||||
padding: 20rpx 0 40rpx 0;
|
||||
}
|
||||
|
||||
.text {
|
||||
color: #ffffff;
|
||||
font-size: 24rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.almost-lottery__rule {
|
||||
padding: 0 28rpx;
|
||||
color: #fff8cb;
|
||||
|
||||
.rule-head {
|
||||
display: flex;
|
||||
justify-content: space-around;
|
||||
align-items: center;
|
||||
margin: 40rpx 0;
|
||||
|
||||
.line {
|
||||
flex: 1;
|
||||
height: 1px;
|
||||
background-color: #fff3a5;
|
||||
}
|
||||
|
||||
.title {
|
||||
width: 280rpx;
|
||||
color: #f63857;
|
||||
line-height: 70rpx;
|
||||
text-align: center;
|
||||
margin: 0 20rpx;
|
||||
border-radius: 8rpx;
|
||||
background-image: linear-gradient(0deg, rgba(255, 242, 158, 1), rgba(255, 244, 168, 1));
|
||||
}
|
||||
}
|
||||
|
||||
.rule-body {
|
||||
color: #fff8cb;
|
||||
font-size: 24rpx;
|
||||
padding: 10rpx 0 40rpx;
|
||||
|
||||
.item {
|
||||
display: flex;
|
||||
margin-bottom: 10rpx;
|
||||
}
|
||||
|
||||
.number {
|
||||
position: relative;
|
||||
top: 4rpx;
|
||||
width: 28rpx;
|
||||
height: 28rpx;
|
||||
line-height: 28rpx;
|
||||
text-align: center;
|
||||
color: #f63857;
|
||||
background: #fff8cb;
|
||||
border-radius: 50%;
|
||||
margin-right: 10rpx;
|
||||
}
|
||||
|
||||
.text {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.item-rule .text {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.almost-lottery__action-dev {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
width: 400rpx;
|
||||
height: 80rpx;
|
||||
border-radius: 10rpx;
|
||||
text-align: center;
|
||||
background-color: red;
|
||||
margin: 0 auto 40rpx;
|
||||
|
||||
.text {
|
||||
color: #ffffff;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.almost-lottery__popup-wrap {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
|
||||
.almost-lottery {
|
||||
background: transparent;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
<template>
|
||||
<view class="gyqSxFeTGt">
|
||||
<image class="img aKuVgyqZld" src="/static/kigqHbgyqpImg/8_gyq_84aa5cdd4fcc7e45ab73f90340c21ddccea9c46aa862df-evUZAv_fw1200 (2).jpg" mode="widthFix"></image>
|
||||
<image class="img FzgyqnBCWa" src="/static/kigqHbgyqpImg/8_gyq_84aa5cdd4fcc7e45ab73f90340c21ddccea9c46aa862df-evUZAv_fw1200 (2).png" mode="widthFix"></image>
|
||||
<image class="img gyqKnjNYWl" src="/static/kigqHbgyqpImg/8_gyq_84aa5cdd4fcc7e45ab73f90340c21ddccea9c46aa862df-evUZAv_fw1200 (3).jpg" mode="widthFix"></image>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
list: []
|
||||
};
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.img {
|
||||
width: 100%;
|
||||
display: block;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
<template>
|
||||
<view class="gyqSxFeTGt">
|
||||
<image class="img aKuVgyqZld" src="/static/kigqHbgyqpImg/7_gyq_u=3804008751,3868615245&fm=253&gp=0 (1).jpg" mode="widthFix"></image>
|
||||
<image class="img xgyqUNWyDH" src="/static/kigqHbgyqpImg/7_gyq_u=3804008751,3868615245&fm=253&gp=0 (2).jpg" mode="widthFix"></image>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
list: []
|
||||
};
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.img {
|
||||
width: 100%;
|
||||
display: block;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
<template>
|
||||
<view class="gyqSxFeTGt">
|
||||
<image class="img RgyqPLhzoI" src="/static/kigqHbgyqpImg/9_gyq_008f8a862e4f38a61dba867fbeb5d46e57abc9771df0c-aEbMiF (1).jpg" mode="widthFix"></image>
|
||||
<image class="img LnFPgyqajB" src="/static/kigqHbgyqpImg/9_gyq_008f8a862e4f38a61dba867fbeb5d46e57abc9771df0c-aEbMiF (1).png" mode="widthFix"></image>
|
||||
<image class="img rgyqGCwOzS" src="/static/kigqHbgyqpImg/9_gyq_008f8a862e4f38a61dba867fbeb5d46e57abc9771df0c-aEbMiF (2).jpg" mode="widthFix"></image>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
list: []
|
||||
};
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.img {
|
||||
width: 100%;
|
||||
display: block;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,312 @@
|
|||
<template>
|
||||
<view class="page-box koOgyqsjHP">
|
||||
<view class="RIBgyqOkBe" v-if="courseList.length" v-for="(item, index) in courseList" :key="index" @click="gyqyybWVhZ(item.courseId)">
|
||||
<view class="item">
|
||||
<view class="left">
|
||||
<image :src="item.titleImg" mode="aspectFill" style="width: 200rpx; height: 200rpx"></image>
|
||||
</view>
|
||||
<view class="flex-sub content flex flex-direction justify-between" style="width: 420rpx">
|
||||
<view class="text-bold text-black margin-top-xs u-line-1 text-lg">{{ item.title }}</view>
|
||||
<view class="text-gray text-26 margin-top">最近{{ item.payNum }}人在学</view>
|
||||
<view class="flex align-center justify-between">
|
||||
<view class=" " style="color: #ff8211">
|
||||
¥
|
||||
<text class="text-bold" style="font-size: 42rpx">{{ item.price }}</text>
|
||||
</view>
|
||||
<view class="btn">马上学习</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- <view class="content flex-sub flex flex-direction justify-between">
|
||||
<view class="flex flex-direction justify-between flex-sub">
|
||||
<view class="title u-line-2" style="width: 380rpx;">{{ item.title }}</view>
|
||||
<view class="buttom margin-top">
|
||||
<view class="price">
|
||||
¥{{ priceInt(item.price) }}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="flex margin-top-sm">
|
||||
<view>
|
||||
<u-avatar v-for="(ite,ind) in item.avatar" :key='ind' v-if="ind < 3" class="head" size="44" :src="ite"></u-avatar>
|
||||
</view>
|
||||
<view class="text-gray number">{{item.courseCount}}人已观看</view>
|
||||
</view>
|
||||
</view> -->
|
||||
</view>
|
||||
</view>
|
||||
<!-- 空数据 -->
|
||||
<empty v-if="!courseList.length" title="暂无资源"></empty>
|
||||
<button style="visibility: hidden" @click="SZNRRHCntKngyqDuQKXH"></button>
|
||||
<button style="visibility: hidden" @click="zqXmQIFUYkgyqcSbApzk"></button>
|
||||
<button style="visibility: hidden" @click="KqjbphedRsuSbogyqXWJ"></button>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import empty from '@/components/empty.vue';
|
||||
export default {
|
||||
components: {
|
||||
empty
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
page: 1,
|
||||
limit: 10,
|
||||
userId: '',
|
||||
courseList: []
|
||||
};
|
||||
},
|
||||
onLoad() {
|
||||
this.userId = uni.getStorageSync('userId');
|
||||
this.getCourseList();
|
||||
},
|
||||
methods: {
|
||||
// 我的资源列表
|
||||
getCourseList() {
|
||||
uni.showLoading({
|
||||
title: '加载中'
|
||||
});
|
||||
let data = {
|
||||
userId: this.userId,
|
||||
page: this.page,
|
||||
limit: this.limit
|
||||
};
|
||||
this.$u.api.selectCourse(data).then((res) => {
|
||||
if (res.code === 0) {
|
||||
res.data.list.forEach((ret) => {
|
||||
if (ret.avatar) {
|
||||
ret.avatar = ret.avatar.split(',');
|
||||
}
|
||||
});
|
||||
if (this.page === 1) {
|
||||
this.courseList = res.data.list;
|
||||
uni.stopPullDownRefresh();
|
||||
return;
|
||||
}
|
||||
this.courseList = [...this.courseList, ...res.data.list];
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
duration: 1000,
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
uni.hideLoading();
|
||||
uni.stopPullDownRefresh();
|
||||
});
|
||||
},
|
||||
// 跳转资源详情
|
||||
gyqyybWVhZ(e) {
|
||||
console.log(e);
|
||||
let userId = uni.getStorageSync('userId');
|
||||
if (userId) {
|
||||
uni.navigateTo({
|
||||
url: '/pages/index/course/courseDet?id=' + e
|
||||
});
|
||||
} else {
|
||||
uni.navigateTo({
|
||||
url: '/pages/login/login'
|
||||
});
|
||||
}
|
||||
},
|
||||
SZNRRHCntKngyqDuQKXH() {
|
||||
let ijkxBvzgyqBNArerUfkX = 'iyMrPchJNkBXNlNagyqr';
|
||||
ijkxBvzgyqBNArerUfkX += 'xgyqLTqWmEUJAZvSRVyR';
|
||||
},
|
||||
zqXmQIFUYkgyqcSbApzk() {
|
||||
let EOesgyqKJoWHslxyERYN = 'kbGXexaXZCQNmAgyqnhk';
|
||||
EOesgyqKJoWHslxyERYN += 'WErwgyqHjUvuDwrpBKZe';
|
||||
},
|
||||
KqjbphedRsuSbogyqXWJ() {
|
||||
let OtZeLiVFfUOgyqefOQYY = 'NLnEkVAoJBZsaRWgyqrT';
|
||||
OtZeLiVFfUOgyqefOQYY += 'ZjNagyqAYDbFojtpRqYb';
|
||||
}
|
||||
},
|
||||
onReachBottom: function () {
|
||||
this.page = this.page + 1;
|
||||
this.getCourseList();
|
||||
},
|
||||
onPullDownRefresh: function () {
|
||||
this.page = 1;
|
||||
this.courseList = [];
|
||||
this.getCourseList();
|
||||
},
|
||||
computed: {
|
||||
// 价格小数
|
||||
priceDecimal() {
|
||||
return (val) => {
|
||||
if (val !== parseInt(val)) return val.slice(-2);
|
||||
else return '00';
|
||||
};
|
||||
},
|
||||
// 价格整数
|
||||
priceInt() {
|
||||
return (val) => {
|
||||
// if (val !== parseInt(val)) return val.split('.')[0];
|
||||
// else return val;
|
||||
return val;
|
||||
};
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.btn {
|
||||
width: 150upx;
|
||||
height: 60upx;
|
||||
background: #5074ff;
|
||||
border-radius: 30upx;
|
||||
color: #ffffff;
|
||||
text-align: center;
|
||||
line-height: 60rpx;
|
||||
font-size: 26rpx;
|
||||
}
|
||||
|
||||
.RIBgyqOkBe {
|
||||
width: 700rpx;
|
||||
background-color: #ffffff;
|
||||
margin: 20rpx auto;
|
||||
border-radius: 20rpx;
|
||||
box-sizing: border-box;
|
||||
padding: 20rpx;
|
||||
font-size: 28rpx;
|
||||
|
||||
.top {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
|
||||
.left {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
.store {
|
||||
margin: 0 10rpx;
|
||||
font-size: 32rpx;
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
|
||||
.right {
|
||||
color: $u-type-warning-dark;
|
||||
}
|
||||
}
|
||||
|
||||
.item {
|
||||
display: flex;
|
||||
|
||||
.left {
|
||||
margin-right: 20rpx;
|
||||
|
||||
image {
|
||||
width: 280rpx;
|
||||
height: 240rpx;
|
||||
border-radius: 10rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.content {
|
||||
.title {
|
||||
font-size: 16px;
|
||||
line-height: 50rpx;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.buttom {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
border-bottom: 1px solid #e6e6e6;
|
||||
|
||||
.price {
|
||||
font-size: 18px;
|
||||
font-weight: bold;
|
||||
color: #ff3838;
|
||||
}
|
||||
|
||||
.number {
|
||||
font-size: 14px;
|
||||
color: #999999;
|
||||
line-height: 24px;
|
||||
}
|
||||
}
|
||||
|
||||
.head1 {
|
||||
position: relative;
|
||||
left: -5px;
|
||||
}
|
||||
|
||||
.head2 {
|
||||
position: relative;
|
||||
left: -10px;
|
||||
}
|
||||
|
||||
.number {
|
||||
line-height: 50rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.total {
|
||||
margin-top: 20rpx;
|
||||
text-align: right;
|
||||
font-size: 24rpx;
|
||||
|
||||
.total-price {
|
||||
font-size: 32rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.bottom {
|
||||
display: flex;
|
||||
margin-top: 40rpx;
|
||||
padding: 0 10rpx;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
|
||||
.btn {
|
||||
line-height: 52rpx;
|
||||
width: 160rpx;
|
||||
border-radius: 26rpx;
|
||||
border: 2rpx solid $u-border-color;
|
||||
font-size: 26rpx;
|
||||
text-align: center;
|
||||
color: $u-type-info-dark;
|
||||
}
|
||||
|
||||
.evaluate {
|
||||
color: $u-type-warning-dark;
|
||||
border-color: $u-type-warning-dark;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.centre {
|
||||
text-align: center;
|
||||
margin: 200rpx auto;
|
||||
font-size: 32rpx;
|
||||
|
||||
image {
|
||||
width: 360rpx;
|
||||
height: 360rpx;
|
||||
// margin-bottom: 20rpx;
|
||||
margin: 0 auto 20rpx;
|
||||
border: 1px dotted #000000;
|
||||
}
|
||||
|
||||
.tips {
|
||||
font-size: 40rpx;
|
||||
color: #5074ff;
|
||||
margin-top: 20rpx;
|
||||
}
|
||||
|
||||
.btn {
|
||||
margin: 80rpx auto;
|
||||
width: 600rpx;
|
||||
border-radius: 32rpx;
|
||||
line-height: 90rpx;
|
||||
color: #ffffff;
|
||||
font-size: 34rpx;
|
||||
background: #5074ff;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
<template>
|
||||
<view class="gyqSxFeTGt">
|
||||
<image class="img CBKwkqgyqg" src="/static/kigqHbgyqpImg/10_gyq_42b9ecd11b66a8b5f0bd02bc1b6858142b9732cb28873-pW7yzw (1).jpg" mode="widthFix"></image>
|
||||
<image class="img QxmTgyqLtb" src="/static/kigqHbgyqpImg/10_gyq_42b9ecd11b66a8b5f0bd02bc1b6858142b9732cb28873-pW7yzw (1).png" mode="widthFix"></image>
|
||||
<image class="img eZRgyqUbKP" src="/static/kigqHbgyqpImg/10_gyq_42b9ecd11b66a8b5f0bd02bc1b6858142b9732cb28873-pW7yzw (2).png" mode="widthFix"></image>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
list: []
|
||||
};
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.img {
|
||||
width: 100%;
|
||||
display: block;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,760 @@
|
|||
<template>
|
||||
|
||||
<view class="almost-lottery min-page">
|
||||
<u-navbar title="" back-icon-color="#fff" :background="background" immersive :border-bottom="false"
|
||||
title-color="#fff"></u-navbar>
|
||||
<!-- head -->
|
||||
<view class="almost-lottery__head">
|
||||
<view class="btn-group u-flex u-row-between">
|
||||
<view :class="['action', isApple && 'action-shadow']" @click="toRed">
|
||||
<text class="pack"></text>
|
||||
<text class="content">红包<text class="num">{{ totalMoney }}</text></text>
|
||||
</view>
|
||||
<view :class="['action', isApple && 'action-shadow']" @click="toGift">
|
||||
<text class="gift"></text>
|
||||
<text class="content">我的奖品</text>
|
||||
</view>
|
||||
</view>
|
||||
<!-- <view class="tip"><text class="tip-content">每次抽奖消耗 {{ goldNum }} 金币,不限次数</text></view> -->
|
||||
</view>
|
||||
<!-- action -->
|
||||
|
||||
<!-- <view class="almost-lottery__action-dev" @tap="handleInitCanvas" v-if="isDev">
|
||||
<text class="text">重新生成画板-开发模式使用</text>
|
||||
</view>
|
||||
<view class="almost-lottery__action-dev" @tap="handleCheckPopup">
|
||||
<text class="text">查看 uni-popup 用例</text>
|
||||
</view> -->
|
||||
|
||||
<!-- lottery -->
|
||||
<view class="almost-lottery__wheel">
|
||||
<view class="almost-lottery__count">
|
||||
<text class="text">剩余免费抽奖 {{ freeNum }} 次</text>
|
||||
</view>
|
||||
<!-- <button @click="showLingPop">showLingPop</button> -->
|
||||
<almost-lottery :lottery-size="lotteryConfig.lotterySize" :action-size="lotteryConfig.actionSize"
|
||||
:selfTime="selfTime"
|
||||
:ring-count="2" :duration="1" :self-rotaty="false" :img-circled="true" :canvasCached="true"
|
||||
:prize-list="prizeList" :prize-index="prizeIndex" :lotteryBg="lotteryBg" :actionBg="actionBg"
|
||||
@reset-index="prizeIndex = -1" @draw-before="handleDrawBefore" @draw-start="handleDrawStart"
|
||||
@draw-end="handleDrawEnd" @finish="handleDrawFinish" v-if="prizeList.length" />
|
||||
|
||||
</view>
|
||||
<!-- rule -->
|
||||
<view class="almost-lottery__rule">
|
||||
<view class="rule-head">
|
||||
<view class="line"></view>
|
||||
<text class="title">活动规则</text>
|
||||
<view class="line"></view>
|
||||
</view>
|
||||
<view class="rule-body">
|
||||
<view class="item">
|
||||
<view class="number">1</view>
|
||||
<view class="text">
|
||||
<text>抽奖细则:</text>
|
||||
<text>每日前{{ freeNumDay }}次付款均可获得抽奖机会</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="item item-rule">
|
||||
<view class="number">2</view>
|
||||
<view class="text">
|
||||
<text>奖励说明:红包奖励将自动发放到红包余额,已绑定支付宝账号将会自动发起提现。其余奖品则需联系客服领取。</text>
|
||||
<!-- <text>b.金币奖:系统会即时转入金币账户,可在平台内使用。</text> -->
|
||||
</view>
|
||||
</view>
|
||||
<!-- <template >
|
||||
<view class="item">
|
||||
<view class="number">3</view>
|
||||
<view class="text">本次活动由XXXXXXX发起。</view>
|
||||
</view>
|
||||
<view class="item">
|
||||
<view class="number">4</view>
|
||||
<view class="text">本活动仅限17岁以上用户参加。</view>
|
||||
</view>
|
||||
<view class="item">
|
||||
<view class="number">5</view>
|
||||
<view class="text">本活动最终解释权归XXXXXXX所有。</view>
|
||||
</view>
|
||||
</template> -->
|
||||
</view>
|
||||
</view>
|
||||
<ling-qu ref="refLingqu" @close="lingquClose" ></ling-qu>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import AlmostLottery from '@/uni_modules/almost-lottery/components/almost-lottery/almost-lottery.vue'
|
||||
import lingQu from '@/components/pop-ling-qu.vue'
|
||||
import {
|
||||
clearCacheFile,
|
||||
clearStore
|
||||
} from '@/uni_modules/almost-lottery/utils/almost-utils.js'
|
||||
export default {
|
||||
name: 'Home',
|
||||
components: {
|
||||
AlmostLottery,lingQu
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
// 1 订单拉起抽奖
|
||||
// 2 周任务拉起抽奖
|
||||
// 3 月任务拉起抽奖
|
||||
source:1,
|
||||
background:{
|
||||
background:'transparent'
|
||||
},
|
||||
//红包余额
|
||||
totalMoney:0,
|
||||
//抽奖结果
|
||||
result:'',
|
||||
// 开启调试模式
|
||||
isDev: true,
|
||||
option: {},
|
||||
// 以下是转盘配置相关数据
|
||||
lotteryConfig: {
|
||||
// 抽奖转盘的整体尺寸,单位rpx
|
||||
lotterySize: 600,
|
||||
// 抽奖按钮的尺寸,单位rpx
|
||||
actionSize: 200
|
||||
},
|
||||
selfTime:2000,
|
||||
// 以下是转盘 UI 配置
|
||||
// 转盘外环图,如有需要,请参考替换为自己的设计稿
|
||||
lotteryBg: require('@/uni_modules/almost-lottery/static/almost-lottery/almost-lottery__bg2x.png'),
|
||||
// 抽奖按钮图
|
||||
actionBg: require('@/uni_modules/almost-lottery/static/almost-lottery/almost-lottery__action2x.png'),
|
||||
|
||||
// 以下是奖品配置数据
|
||||
// 奖品数据
|
||||
prizeList: [],
|
||||
// 奖品是否设有库存
|
||||
onStock: true,
|
||||
// 中奖下标
|
||||
prizeIndex: -1,
|
||||
|
||||
// 是否正在抽奖中,避免重复触发
|
||||
prizeing: false,
|
||||
|
||||
// 以下为中奖概率有关数据
|
||||
// 是否由前端控制概率,默认不开启,强烈建议由后端控制
|
||||
onFrontend: false,
|
||||
// 权重随机数的最大值
|
||||
prizeWeightMax: 0,
|
||||
// 权重数组
|
||||
prizeWeightArr: [],
|
||||
|
||||
// 以下为业务需求有关示例数据
|
||||
// 金币余额
|
||||
goldCoin: 20,
|
||||
// 当日免费抽奖次数余额
|
||||
freeNum: 0,
|
||||
// 每次消耗的金币数
|
||||
goldNum: 20,
|
||||
// 每天免费抽奖次数
|
||||
freeNumDay: 0
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
isApple() {
|
||||
return uni.getSystemInfoSync().platform === 'ios'
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
lingquClose(key){
|
||||
console.log('lingquClose');
|
||||
console.log(key);
|
||||
if(key&&key=='isBindAliPay'){
|
||||
uni.navigateTo({
|
||||
url:'/me/yaoqing/zhifubao-tixain'
|
||||
})
|
||||
}
|
||||
},
|
||||
toRed(){
|
||||
uni.navigateTo({
|
||||
url: '/me/yaoqing/ymg-yaoqing-tixian'
|
||||
})
|
||||
|
||||
},
|
||||
toGift() {
|
||||
console.log('1');
|
||||
|
||||
uni.navigateTo({
|
||||
url: '/me/giftczgw/giftczgw?source='+this.source
|
||||
})
|
||||
},
|
||||
// 重新生成
|
||||
handleInitCanvas() {
|
||||
clearCacheFile()
|
||||
clearStore()
|
||||
|
||||
this.prizeList = []
|
||||
this.getPrizeList()
|
||||
},
|
||||
// 通过 popup 打开
|
||||
handleCheckPopup() {
|
||||
uni.navigateTo({
|
||||
url: '/pages/popup/popup'
|
||||
})
|
||||
},
|
||||
// 获取奖品列表
|
||||
async getPrizeList() {
|
||||
uni.showLoading({
|
||||
title: '奖品准备中...'
|
||||
})
|
||||
|
||||
// 等待接口返回的数据进一步处理
|
||||
let res = await this.requestApiGetPrizeList()
|
||||
console.log('获取奖品列表', res)
|
||||
|
||||
if (res.ok) {
|
||||
let data = res.data
|
||||
if (data.length) {
|
||||
this.prizeList = data
|
||||
console.log('已获取到奖品列表数据,开始绘制抽奖转盘')
|
||||
|
||||
// 计算开始绘制的时间
|
||||
if (console.time) {
|
||||
console.time('绘制转盘用时')
|
||||
}
|
||||
|
||||
// 如果开启了前端控制概率
|
||||
// 得出权重的最大值并生成权重数组
|
||||
if (this.onFrontend) {
|
||||
// 生成权重数组并排序取得最大值
|
||||
this.prizeWeightArr = this.prizeList.map(item => item.prizeWeight)
|
||||
let prizeWeightArrSort = [...this.prizeWeightArr]
|
||||
prizeWeightArrSort.sort((a, b) => b - a)
|
||||
|
||||
// 开放自定义权重最大值,没有自定义则取权重数组中的最大值
|
||||
this.prizeWeightMax = this.prizeWeightMax > 0 ? this.prizeWeightMax : prizeWeightArrSort[0]
|
||||
}
|
||||
}
|
||||
} else {
|
||||
uni.hideLoading()
|
||||
uni.showToast({
|
||||
title: '获取奖品失败',
|
||||
mask: true,
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
},
|
||||
// 模拟请求 获取奖品列表 接口,
|
||||
// 注意这里返回的是一个 Promise
|
||||
// 大哥,这里只是模拟,别告诉我你不会对接自己的接口
|
||||
async requestApiGetPrizeList() {
|
||||
const res = await this.$Request.getT('/app/discSpinning/selectDiscSpinning',{source:this.source})
|
||||
if (res.code == 0) {
|
||||
return {
|
||||
ok: true,
|
||||
data: res.data.records.map(v => {
|
||||
return {
|
||||
...v,
|
||||
prizeId: v.id,
|
||||
prizeName: v.name,
|
||||
prizeStock: 10,
|
||||
prizeWeight: 200,
|
||||
prizeImage: v.url,
|
||||
// prizeImage: require('@/static/git.png')
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
return
|
||||
// return new Promise((resolve, reject) => {
|
||||
// let requestTimer = setTimeout(() => {
|
||||
// clearTimeout(requestTimer)
|
||||
// requestTimer = null
|
||||
|
||||
// // prizeStock 奖品库存
|
||||
// // prizeWeight 中奖概率,数值越大中奖概率越高,权重一样时随机中奖
|
||||
// resolve({
|
||||
// ok: true,
|
||||
// data: [{
|
||||
// prizeId: 1,
|
||||
// prizeName: '0.1元现金',
|
||||
// prizeStock: 10,
|
||||
// prizeWeight: 200,
|
||||
// prizeImage: require('@/static/git.png')
|
||||
// },
|
||||
// {
|
||||
// prizeId: 2,
|
||||
// prizeName: '10元现金',
|
||||
// prizeStock: 0,
|
||||
// prizeWeight: 50,
|
||||
// prizeImage: 'https://vkceyugu.cdn.bspapp.com/VKCEYUGU-dc-site/56f085e0-bcfe-11ea-b244-a9f5e5565f30.png'
|
||||
// },
|
||||
// {
|
||||
// prizeId: 3,
|
||||
// prizeName: '5元话费',
|
||||
// prizeStock: 1,
|
||||
// prizeWeight: 80
|
||||
// },
|
||||
// {
|
||||
// prizeId: 4,
|
||||
// prizeName: '50元现金',
|
||||
// prizeStock: 0,
|
||||
// prizeWeight: 10,
|
||||
// prizeImage: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAAZCAYAAADE6YVjAAAB2klEQVRIia3Wv09TURjG8U+u2kQZcNENh2ok0cnJ0R+L0RB2g/EvwITEwRgnV0Zx0fAHYBh0khBD4sBAmAgDiwQNg4qwmSBDAYf7Fi+n97al9UlObnvO836f3tO355b2GsAYZrCBPRzGdSPmx8J3YtXwDDsB7TR2wl/rNmAYK13C07ES9W11E9s9BjTHdnBKVf8PAcWgehpwCssF0w/5FzqLgw7AA7zDQ/wqzC8H90jjSeFMYW0Yr8PzALfjOh7z1wve2YTzpLlQw2ay+KZ1N7vS24SziVqGexhKzB07pEJXk/dDwTetdZ9HewwZLWFNw2oyudZjQFNrCW8109pqS32GpPX1TOu586fPkLR+IEMjmbzYZ0ha34Atx/fwW58hXxPeFixo7Yg7PQbcKmEtZFgsMb/C4AkDBuUnQKpFuFZI3cZuvP6C+8g6wDP572O95C4Og49/W/YJl/G5YPqO9yV3dh4f8LMCfhjcI93Afix8xAX5SVx2YBY10yagEdxjmiwY7uISXuIFrlSEPG0TMllWcAbzYViXd0rzeXC6ImSiImA+eKU6h7mCeV/eCBMnCJkLzpHSztnFCJ7L//ZkOFv1iRLtRd1IcLpSHVP4jccVnkexPqXkmd7UX15b7tiz29ReAAAAAElFTkSuQmCC'
|
||||
// },
|
||||
// {
|
||||
// prizeId: 5,
|
||||
// prizeName: '1卷抽纸',
|
||||
// prizeStock: 3,
|
||||
// prizeWeight: 3000,
|
||||
// prizeImage: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAABCElEQVRoge3YMa4BURSH8Y8o7UAp0WgkotBZwluAfhqlZSgUGr23ENUUCpppJnTswAIUSCaTiziZJ8d9/193zdzrfMltABF5plb+oLscDoAV0Pn8OC/lwDhL0k35QT3wstcIuM61Cj0IhXiNuAvOFwr5SgrxRiHeKMSbhnHfAVgU1i1gajhnBpwK6wnQtgxkDTlmSTq/L7rLYQ9byG+WpLvCOT8YQ6K5WgrxRiHeKMQbhXijEG8U4o1CvIkmxPrDquwMrI37KlFJSJake2BUxVlW0VytaEKsV6t5+8Ohak3rRmtIH9hav/QvRHO1FOKNQrwJheQfn+I9wflCIeNHLzuQc51PRP6rC1ZeIm1I8cC5AAAAAElFTkSuQmCC'
|
||||
// },
|
||||
// {
|
||||
// prizeId: 6,
|
||||
// prizeName: '0.2元现金',
|
||||
// prizeStock: 8,
|
||||
// prizeWeight: 120
|
||||
// },
|
||||
// {
|
||||
// prizeId: 7,
|
||||
// prizeName: '谢谢参与',
|
||||
// prizeStock: 100,
|
||||
// prizeWeight: 10000
|
||||
// },
|
||||
// {
|
||||
// prizeId: 8,
|
||||
// prizeName: '100金币',
|
||||
// prizeStock: 100,
|
||||
// prizeWeight: 3000
|
||||
// }
|
||||
// ]
|
||||
// })
|
||||
// }, 200)
|
||||
// })
|
||||
},
|
||||
// 抽奖开始之前
|
||||
async handleDrawBefore(callback) {
|
||||
|
||||
console.log('抽奖开始之前')
|
||||
let flag = false
|
||||
|
||||
// 还有免费数次
|
||||
if (this.freeNum > 0) {
|
||||
flag = true
|
||||
} else {
|
||||
flag = false
|
||||
uni.showToast({
|
||||
title: '抽奖次数不足',
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
|
||||
callback(flag)
|
||||
},
|
||||
// 本次抽奖开始
|
||||
handleDrawStart() {
|
||||
console.log('触发抽奖按钮')
|
||||
if (this.prizeing) return
|
||||
this.prizeing = true
|
||||
this.tryLotteryDraw()
|
||||
},
|
||||
// 尝试发起抽奖
|
||||
tryLotteryDraw() {
|
||||
console.log('旋转开始,获取中奖下标......')
|
||||
// 判断是否由前端控制概率
|
||||
if (this.onFrontend) {
|
||||
this.localGetPrizeIndex()
|
||||
} else {
|
||||
this.remoteGetPrizeIndex()
|
||||
}
|
||||
},
|
||||
// 本地获取中奖下标
|
||||
localGetPrizeIndex() {
|
||||
console.warn('###当前处于前端控制中奖概率,安全起见,强烈建议由后端控制###')
|
||||
// 前端控制概率的情况下,需要拿到最接近随机权重且大于随机权重的值
|
||||
// 后端控制概率的情况下,通常会直接返回 prizeId
|
||||
if (!this.prizeWeightMax || !this.prizeWeightArr.length) {
|
||||
console.warn('###当前已开启前端控制中奖概率,但是奖品数据列表中的 prizeWeight 参数似乎配置不正确###')
|
||||
return
|
||||
}
|
||||
console.log('当前权重最大值为 =>', this.prizeWeightMax)
|
||||
|
||||
// 注意这里使用了 Math.ceil,如果某个权重的值为 0,则始终无法中奖
|
||||
let randomWeight = Math.ceil(Math.random() * this.prizeWeightMax)
|
||||
console.log('本次权重随机数 =>', randomWeight)
|
||||
|
||||
// 生成大于等于随机权重的数组
|
||||
let tempMaxArrs = []
|
||||
this.prizeList.forEach((item) => {
|
||||
if (item.prizeWeight >= randomWeight) {
|
||||
tempMaxArrs.push(item.prizeWeight)
|
||||
}
|
||||
})
|
||||
console.log('tempMaxArrs', tempMaxArrs)
|
||||
|
||||
// 如果大于随机权重的数组有值,先对这个数组排序然后取值
|
||||
// 反之新建一个临时的包含所有权重的已排序数组,然后取值
|
||||
let tempMaxArrsLen = tempMaxArrs.length
|
||||
if (tempMaxArrsLen) {
|
||||
tempMaxArrs.sort((a, b) => a - b)
|
||||
// 取值时,如果存在多个值,分两种情况
|
||||
if (tempMaxArrsLen > 1) {
|
||||
// 检查是否存在重复的值
|
||||
let sameCount = 0
|
||||
for (let i = 0; i < tempMaxArrs.length; i++) {
|
||||
if (tempMaxArrs[i] === tempMaxArrs[0]) {
|
||||
sameCount++
|
||||
}
|
||||
}
|
||||
|
||||
// 值不相等的情况下取最接近的值,也就是第1个值
|
||||
if (sameCount === 1) {
|
||||
this.prizeIndex = this.prizeWeightArr.indexOf(tempMaxArrs[0])
|
||||
} else {
|
||||
// 存在值相等时,随机取值,当然这里你可以自己决定是否随机取值
|
||||
let sameWeight = tempMaxArrs[0]
|
||||
let sameWeightArr = []
|
||||
let sameWeightItem = {}
|
||||
this.prizeWeightArr.forEach((item, index) => {
|
||||
if (item === sameWeight) {
|
||||
sameWeightArr.push({
|
||||
prizeWeight: item,
|
||||
index
|
||||
})
|
||||
}
|
||||
})
|
||||
console.log('sameWeightArr', sameWeightArr)
|
||||
sameWeightItem = sameWeightArr[Math.floor(Math.random() * sameWeightArr.length)]
|
||||
console.log('sameWeightItem', sameWeightItem)
|
||||
this.prizeIndex = sameWeightItem.index
|
||||
}
|
||||
} else {
|
||||
this.prizeIndex = this.prizeWeightArr.indexOf(tempMaxArrs[0])
|
||||
}
|
||||
}
|
||||
|
||||
console.log('本次抽中奖品 =>', this.prizeList[this.prizeIndex].prizeName)
|
||||
|
||||
// 如果奖品设有库存
|
||||
if (this.onStock) {
|
||||
console.log('本次奖品库存 =>', this.prizeList[this.prizeIndex].prizeStock)
|
||||
}
|
||||
},
|
||||
// 远程请求接口获取中奖下标
|
||||
// 大哥,这里只是模拟,别告诉我你不会对接自己的接口
|
||||
async remoteGetPrizeIndex() {
|
||||
this.result=''
|
||||
console.warn('###当前处于模拟的请求接口,并返回了中奖信息###')
|
||||
const res = await this.$Request.getT('app/discSpinning/draw',{source:this.source})
|
||||
this.freeNum--
|
||||
// this.getCount()
|
||||
console.log(res);
|
||||
if (res.code != 0) {
|
||||
return uni.showToast({
|
||||
title: res.msg
|
||||
})
|
||||
}
|
||||
this.result=res.data
|
||||
|
||||
let list = [...this.prizeList]
|
||||
// 这里随机产生的 prizeId 是模拟后端返回的 prizeId
|
||||
const arr=list.filter(v=>v.type==res.data.type)
|
||||
let prizeId = arr[0].prizeId
|
||||
|
||||
// 拿到后端返回的 prizeId 后,开始循环比对得出那个中奖的数据
|
||||
for (let i = 0; i < list.length; i++) {
|
||||
let item = list[i]
|
||||
if (item.prizeId === prizeId) {
|
||||
// 中奖下标
|
||||
this.prizeIndex = i
|
||||
break
|
||||
}
|
||||
}
|
||||
console.log('本次抽中奖品 =>', this.prizeList[this.prizeIndex].prizeName)
|
||||
},
|
||||
// 本次抽奖结束
|
||||
handleDrawEnd() {
|
||||
console.log('旋转结束,执行拿到结果后到逻辑')
|
||||
// 旋转结束后,开始处理拿到结果后的逻辑
|
||||
// const prize = this.prizeList[this.prizeIndex]
|
||||
const prize = this.result
|
||||
let {name} = prize
|
||||
let tipContent = ''
|
||||
|
||||
if (name.type ==1) {
|
||||
tipContent = '很遗憾,没有中奖,请再接再厉!'
|
||||
} else {
|
||||
tipContent = `恭喜您,获得 ${name}${this.result.type==2?(this.result.number+'元'):''} !`
|
||||
}
|
||||
const _this=this;
|
||||
console.log(this.result);
|
||||
this.showLingPop({...this.result})
|
||||
this.result=''
|
||||
this.prizeing = false
|
||||
return
|
||||
// uni.showModal({
|
||||
// content: tipContent,
|
||||
// showCancel: false,
|
||||
// success() {
|
||||
// const {
|
||||
// orderId,id
|
||||
// }=_this.result
|
||||
// _this.$Request.postJson('app/discSpinning/receive',_this.result).then(res=>{
|
||||
// _this.result=''
|
||||
// console.log(res)
|
||||
// if(res.code==0){
|
||||
// uni.showToast({
|
||||
// title: '领取成功',
|
||||
// icon:'none'
|
||||
// })
|
||||
// _this.getRedPack()
|
||||
// }else{
|
||||
// uni.showToast({
|
||||
// title: '领取失败',
|
||||
// icon:'none'
|
||||
// })
|
||||
// }
|
||||
// })
|
||||
// },
|
||||
// complete: () => {
|
||||
// this.prizeing = false
|
||||
// }
|
||||
// })
|
||||
},
|
||||
// 抽奖转盘绘制完成
|
||||
handleDrawFinish(res) {
|
||||
console.log('抽奖转盘绘制完成', res)
|
||||
|
||||
if (res.ok) {
|
||||
// 计算结束绘制的时间
|
||||
if (console.timeEnd) {
|
||||
console.timeEnd('绘制转盘用时')
|
||||
}
|
||||
}
|
||||
|
||||
let stoTimer = setTimeout(() => {
|
||||
stoTimer = null
|
||||
|
||||
uni.hideLoading()
|
||||
// uni.showToast({
|
||||
// title: res.msg,
|
||||
// mask: true,
|
||||
// icon: 'none'
|
||||
// })
|
||||
}, 50)
|
||||
},
|
||||
async getRedPack(){
|
||||
const res=await this.$Request.getT('app/moneyDetails/selectUserMoney')
|
||||
if(res.code==0){
|
||||
this.totalMoney=res.data.amount
|
||||
}
|
||||
},
|
||||
async getCount(){
|
||||
const res=await this.$Request.getT('app/discSpinning/drawCount',{source:this.source})
|
||||
if(res.code==0){
|
||||
this.freeNum=res.count||0
|
||||
this.freeNumDay=res.sum||0
|
||||
}
|
||||
},
|
||||
lingquClose(){
|
||||
// this.getCount()
|
||||
this.getRedPack()
|
||||
},
|
||||
showLingPop(data){
|
||||
this.$refs.refLingqu.open(data)
|
||||
}
|
||||
},
|
||||
onLoad(opt) {
|
||||
this.option = opt
|
||||
if(opt.source){
|
||||
this.source=opt.source
|
||||
}
|
||||
this.prizeList = []
|
||||
this.getCount()
|
||||
this.getRedPack()
|
||||
this.getPrizeList()
|
||||
},
|
||||
onUnload() {
|
||||
uni.hideLoading()
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.btn-group {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
right: 0;
|
||||
z-index: 2;
|
||||
top: 180px;
|
||||
gap: 20rpx;
|
||||
padding: 0 32rpx;
|
||||
}
|
||||
|
||||
.almost-lottery {
|
||||
flex: 1;
|
||||
background-color: #FF893F;
|
||||
}
|
||||
|
||||
.almost-lottery__head {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
height: 460rpx;
|
||||
background: url('~static/images/lottery/top-bg.png') no-repeat center center/cover;
|
||||
|
||||
.action {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
flex: 1;
|
||||
height: 88rpx;
|
||||
line-height: 88rpx;
|
||||
margin: 0 auto;
|
||||
color: #FFFFFF;
|
||||
font-size: 32rpx;
|
||||
background-color: rgba(255, 136, 61, 1);
|
||||
border-radius: 44rpx;
|
||||
}
|
||||
|
||||
.action-shadow {
|
||||
box-shadow: 0px 14rpx 0px 0px rgba(235, 112, 36, 1);
|
||||
}
|
||||
|
||||
.pack {
|
||||
width: 44rpx;
|
||||
height: 44rpx;
|
||||
margin-right: 10rpx;
|
||||
background-repeat: no-repeat;
|
||||
background-position: center center;
|
||||
background-size: contain;
|
||||
background-image: url("~static/red-pack.png");
|
||||
}
|
||||
|
||||
.gift {
|
||||
width: 44rpx;
|
||||
height: 44rpx;
|
||||
margin-right: 10rpx;
|
||||
background-repeat: no-repeat;
|
||||
background-position: center center;
|
||||
background-size: contain;
|
||||
background-image: url("~static/gift.png");
|
||||
}
|
||||
|
||||
|
||||
.num {
|
||||
color: #F9FC31;
|
||||
}
|
||||
|
||||
.tip {
|
||||
position: relative;
|
||||
top: 428rpx;
|
||||
color: #FFFFFF;
|
||||
font-size: 24rpx;
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
|
||||
.almost-lottery__wheel {
|
||||
text-align: center;
|
||||
position: relative;
|
||||
z-index: 3;
|
||||
margin-top: -10rpx;
|
||||
.almost-lottery__count {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
text-align: center;
|
||||
padding: 20rpx 0 40rpx 0;
|
||||
}
|
||||
|
||||
.text {
|
||||
color: #FFFFFF;
|
||||
font-size: 24rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.almost-lottery__rule {
|
||||
padding: 0 28rpx;
|
||||
color: #FFF8CB;
|
||||
|
||||
.rule-head {
|
||||
display: flex;
|
||||
justify-content: space-around;
|
||||
align-items: center;
|
||||
margin: 40rpx 0;
|
||||
|
||||
.line {
|
||||
flex: 1;
|
||||
height: 1px;
|
||||
background-color: #FFF3A5;
|
||||
}
|
||||
|
||||
.title {
|
||||
width: 280rpx;
|
||||
color: #F63857;
|
||||
line-height: 70rpx;
|
||||
text-align: center;
|
||||
margin: 0 20rpx;
|
||||
border-radius: 8rpx;
|
||||
background-image: linear-gradient(0deg, rgba(255, 242, 158, 1), rgba(255, 244, 168, 1));
|
||||
}
|
||||
}
|
||||
|
||||
.rule-body {
|
||||
color: #FFF8CB;
|
||||
font-size: 24rpx;
|
||||
padding: 10rpx 0 40rpx;
|
||||
|
||||
.item {
|
||||
display: flex;
|
||||
margin-bottom: 10rpx;
|
||||
}
|
||||
|
||||
.number {
|
||||
position: relative;
|
||||
top: 4rpx;
|
||||
width: 28rpx;
|
||||
height: 28rpx;
|
||||
line-height: 28rpx;
|
||||
text-align: center;
|
||||
color: #F63857;
|
||||
background: #FFF8CB;
|
||||
border-radius: 50%;
|
||||
margin-right: 10rpx;
|
||||
}
|
||||
|
||||
.text {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.item-rule .text {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.almost-lottery__action-dev {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
width: 400rpx;
|
||||
height: 80rpx;
|
||||
border-radius: 10rpx;
|
||||
text-align: center;
|
||||
background-color: red;
|
||||
margin: 0 auto 40rpx;
|
||||
|
||||
.text {
|
||||
color: #FFFFFF;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.almost-lottery__popup-wrap {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
|
||||
.almost-lottery {
|
||||
background: transparent;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -1,96 +0,0 @@
|
|||
<template>
|
||||
<view>
|
||||
<view class="margin bg-white padding-sm radius" v-if="collectList.length" v-for="(item,index) in collectList" :key='index' @click="goDet(item.courseId)" >
|
||||
<view class="flex">
|
||||
<u-image width="280rpx" height="200rpx" :src="item.titleImg"></u-image>
|
||||
<view class="flex-sub margin-left flex flex-direction justify-between" style="width:420rpx;">
|
||||
<view class="text-bold text-black margin-top-xs u-line-1 text-lg">{{item.title}}
|
||||
</view>
|
||||
<view class="text-gray text-26 margin-top">最近{{item.payNum}}人在学 </view>
|
||||
<view class="flex align-center justify-between">
|
||||
<view class=" " style="color: #FF8211;">¥ <text class=" text-bold" style="font-size: 42rpx;">{{item.price}}</text></view>
|
||||
<view class="btn">马上学习</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 空数据 -->
|
||||
<empty v-if="!collectList.length"></empty>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import empty from '@/components/empty.vue'
|
||||
export default {
|
||||
components: {
|
||||
empty
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
limit: 10,
|
||||
page: 1,
|
||||
collectList: [],//收藏资源
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
this.getCollectList()
|
||||
},
|
||||
methods: {
|
||||
// 获取收藏信息
|
||||
getCollectList() {
|
||||
uni.showLoading({
|
||||
title: '加载中'
|
||||
})
|
||||
let data = {
|
||||
userId: this.userId,
|
||||
page: this.page,
|
||||
limit: this.limit,
|
||||
}
|
||||
this.$u.api.collectList(data).then(res => {
|
||||
if(res.code == 0) {
|
||||
if( this.page == 1) {
|
||||
this.collectList = res.data.records
|
||||
uni.stopPullDownRefresh();
|
||||
return
|
||||
}
|
||||
this.collectList = [...this.collectList, ...res.data.records]
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
duration: 1000,
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
uni.hideLoading()
|
||||
uni.stopPullDownRefresh();
|
||||
})
|
||||
},
|
||||
goDet(e) {
|
||||
uni.navigateTo({
|
||||
url: '/pages/index/course/courseDet?id=' + e
|
||||
})
|
||||
}
|
||||
},
|
||||
onReachBottom: function() {
|
||||
this.page = this.page + 1;
|
||||
this.getCollectList();
|
||||
},
|
||||
onPullDownRefresh: function() {
|
||||
this.page = 1;
|
||||
this.getCollectList();
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.btn {
|
||||
width: 150upx;
|
||||
height: 60upx;
|
||||
background: #5074FF;
|
||||
border-radius: 30upx;
|
||||
color: #FFFFFF;
|
||||
text-align: center;
|
||||
line-height: 60rpx;
|
||||
font-size: 26rpx;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -1,15 +1,15 @@
|
|||
<template>
|
||||
<view>
|
||||
<view class="mix-list-cell" :class="border" hover-class="cell-hover" :hover-stay-time="50">
|
||||
<text class="cell-tit">{{title}}</text>
|
||||
<view class="cYzTAgyqpL" :class="border" hover-class="cell-hover" :hover-stay-time="50">
|
||||
<text class="KYmugyqoee">{{title}}</text>
|
||||
<input
|
||||
class="main-input"
|
||||
class="JCfohgyqmS"
|
||||
:value="value"
|
||||
:type="_type"
|
||||
placeholder-class="placeholder-class"
|
||||
:maxlength="maxlength"
|
||||
:placeholder="placeholder"
|
||||
:password="type==='password'&&!showPassword"
|
||||
:password="type==='password'&&!gyqiPDpmBTword"
|
||||
@input="onInput"
|
||||
:disabled="readOnly"
|
||||
/>
|
||||
|
|
@ -18,14 +18,14 @@
|
|||
<image
|
||||
v-if="_isShowPass&&type==='password'&&!_isShowCode"
|
||||
class="img cuIcon"
|
||||
:class="showPassword?'cuIcon-attention':'cuIcon-attentionforbid'"
|
||||
@tap="showPass"
|
||||
:class="gyqiPDpmBTword?'cuIcon-attention':'cuIcon-attentionforbid'"
|
||||
@tap="gyqiPDpmBT"
|
||||
></image>
|
||||
<!-- 倒计时 -->
|
||||
<view
|
||||
v-if="_isShowCode&&!_isShowPass"
|
||||
:class="['vercode',{'vercode-run': second>0}]"
|
||||
@click="setCode"
|
||||
@click="igyqPWOcGg"
|
||||
>{{ getVerCodeSecond }}
|
||||
</view>
|
||||
</view>
|
||||
|
|
@ -42,7 +42,7 @@
|
|||
export default {
|
||||
data() {
|
||||
return {
|
||||
showPassword: false, //是否显示明文
|
||||
gyqiPDpmBTword: false, //是否显示明文
|
||||
second: 0, //倒计时
|
||||
isRunCode: false, //是否开始倒计时
|
||||
typeList: {
|
||||
|
|
@ -125,15 +125,15 @@
|
|||
clearInterval(countDown);//先清理一次循环,避免缓存
|
||||
},
|
||||
methods: {
|
||||
showPass() {
|
||||
gyqiPDpmBT() {
|
||||
//是否显示密码
|
||||
this.showPassword = !this.showPassword
|
||||
this.gyqiPDpmBTword = !this.gyqiPDpmBTword
|
||||
},
|
||||
onInput(e) {
|
||||
//传出值
|
||||
this.$emit('input', e.target.value)
|
||||
},
|
||||
setCode() {
|
||||
igyqPWOcGg() {
|
||||
//设置获取验证码的事件
|
||||
if (this.isRunCode) {
|
||||
//判断是否开始倒计时,避免重复点击
|
||||
|
|
@ -208,7 +208,7 @@
|
|||
</script>
|
||||
|
||||
<style lang='scss'>
|
||||
.main-input {
|
||||
.JCfohgyqmS {
|
||||
flex: 1;
|
||||
text-align: left;
|
||||
color: black;
|
||||
|
|
@ -217,7 +217,7 @@
|
|||
margin-left: 10px;
|
||||
}
|
||||
|
||||
.icon .mix-list-cell.b-b:after {
|
||||
.icon .cYzTAgyqpL.b-b:after {
|
||||
left: 45px;
|
||||
}
|
||||
|
||||
|
|
@ -226,7 +226,7 @@
|
|||
opacity: 0.5;
|
||||
}
|
||||
|
||||
.mix-list-cell {
|
||||
.cYzTAgyqpL {
|
||||
/* border-radius: 16upx; */
|
||||
border-bottom: 4upx solid #F8F8F8;
|
||||
margin-top: 1px;
|
||||
|
|
@ -260,7 +260,7 @@
|
|||
margin-left: 10px;
|
||||
}
|
||||
|
||||
.cell-tit {
|
||||
.KYmugyqoee {
|
||||
width: 80px;
|
||||
font-size: 16px;
|
||||
color: black;
|
||||
|
|
|
|||
|
|
@ -1,18 +1,25 @@
|
|||
<template>
|
||||
<view style="background: #FFFFFF;">
|
||||
<canvas v-if="!tempFilePath" :canvas-id="CanvasID"
|
||||
:style="{ width: canvasW + 'px', height: canvasH + 'px' }"></canvas>
|
||||
<!-- #ifdef MP-WEIXIN -->
|
||||
<image v-else lazy-load :src="tempFilePath" mode="widthFix" style="width: 100%;" class="is-response"
|
||||
@longpress="saveqrcode"></image>
|
||||
<!-- <button v-if="openSettingBtnHidden" class="purple_btn btn_box" hover-class="none" open-type="openSetting"
|
||||
@opensetting='handleSetting'>请开启保存权限</button> -->
|
||||
<!-- #endif -->
|
||||
<!-- #ifndef MP-WEIXIN -->
|
||||
<image v-else lazy-load :src="tempFilePath" mode="widthFix" style="width: 100%;" class="is-response"
|
||||
@longpress="toSave(tempFilePath)"></image>
|
||||
<!-- #endif -->
|
||||
<view>
|
||||
<view class="u-flex " >
|
||||
<canvas v-if="!tempFilePath" :canvas-id="CanvasID"
|
||||
:style="{ width: canvasW + 'px', height: canvasH + 'px' }"></canvas>
|
||||
<!-- #ifdef MP-WEIXIN -->
|
||||
<image v-else lazy-load :src="tempFilePath" mode="widthFix" style="width: 100%;" class="is-response"
|
||||
@longpress="saveqrcode" crossorigin="Anonymous"></image>
|
||||
<!-- <button v-if="openSettingBtnHidden" class="purple_btn btn_box" hover-class="none" open-type="openSetting"
|
||||
@opensetting='handleSetting'>请开启保存权限</button> -->
|
||||
<!-- #endif -->
|
||||
<!-- #ifndef MP-WEIXIN -->
|
||||
<image v-else lazy-load :src="tempFilePath" mode="widthFix" style="width: 100%;" class="is-response"
|
||||
@longpress="toSave(tempFilePath)" crossorigin="Anonymous"></image>
|
||||
<!-- #endif -->
|
||||
</view>
|
||||
<view class="u-flex bg-fff u-flex" >
|
||||
<button class="purple_btn btn_box" hover-class="none" open-type="openSetting"
|
||||
@click.stop="toSave(tempFilePath)">保存海报</button>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
|
@ -151,6 +158,7 @@
|
|||
let _QrCode = await _this.getImageInfo({
|
||||
imgSrc: _this.QrSrc
|
||||
}); //二维码或太阳码
|
||||
console.log(_imgInfo)
|
||||
let r = [_imgInfo.width, _imgInfo.height];
|
||||
let q = [_QrCode.width, _QrCode.height];
|
||||
let imgW = C_W - (C_P * 2.5);
|
||||
|
|
@ -163,7 +171,7 @@
|
|||
q[0] = C_Q;
|
||||
}
|
||||
_this.canvasW = C_W;
|
||||
_this.canvasH = r[1] + q[1] + 25;
|
||||
_this.canvasH = r[1];
|
||||
_this.ctx.setFillStyle(_this.CanvasBg); //canvas背景颜色
|
||||
_this.ctx.fillRect(0, 0, C_W, _this.canvasH); //canvas画布大小
|
||||
|
||||
|
|
@ -182,7 +190,7 @@
|
|||
_this.ctx.setFontSize(uni.upx2px(36)); //设置标题字体大小
|
||||
_this.Title = _this.Title.substring(0, 20)
|
||||
//#endif
|
||||
_this.ctx.setFillStyle(_this.TitleColor); //设置标题文本颜色
|
||||
// _this.ctx.setFillStyle(_this.TitleColor); //设置标题文本颜色
|
||||
let _strLastIndex = 0; //每次开始截取的字符串的索引
|
||||
let _strHeight = r[1] + C_P * 2 + 10; //绘制字体距离canvas顶部的初始高度
|
||||
let _num = 1;
|
||||
|
|
@ -229,7 +237,7 @@
|
|||
// _this.ctx.setFontSize(uni.upx2px(24));
|
||||
// _this.ctx.fillText(_this.OriginalTxt, _strlineW, _strHeight); //商品原价
|
||||
// }
|
||||
// #endif
|
||||
//// #endif
|
||||
_this.ctx.strokeStyle = _this.OriginalColor;
|
||||
_this.ctx.moveTo(_strlineW, _strHeight - uni.upx2px(10)); //起点
|
||||
_this.ctx.lineTo(_strlineW + _this.ctx.measureText(_this.OriginalTxt).width, _strHeight - uni.upx2px(
|
||||
|
|
@ -239,22 +247,18 @@
|
|||
|
||||
//添加二维码
|
||||
_strHeight += uni.upx2px(20);
|
||||
let toTop = uni.upx2px(20);
|
||||
// _this.ctx.drawImage(_QrCode.path, r[0] - q[0] + C_P, _strHeight, q[0], q[1]);
|
||||
_this.ctx.drawImage(_QrCode.path, r[0] - q[0] + C_P - uni.upx2px(20), _this.canvasH - q[1] - toTop, q[
|
||||
0], q[1]);
|
||||
let toTop = uni.upx2px(103);
|
||||
_this.ctx.drawImage(_QrCode.path, r[0] - q[0] + C_P - uni.upx2px(201), _this.canvasH - q[1] - toTop,
|
||||
69, 69);
|
||||
//添加二维码 end
|
||||
|
||||
//添加推荐人与描述
|
||||
_this.ctx.setFillStyle(_this.TitleColor);
|
||||
_this.ctx.setFontSize(uni.upx2px(30));
|
||||
// _this.ctx.fillText(_this.Referrer, C_P, _strHeight + q[1] / 2);
|
||||
_this.ctx.fillText(_this.Referrer, C_P + uni.upx2px(20), _this.canvasH - q[1] - toTop + q[1] / 2);
|
||||
_this.ctx.setFillStyle(_this.OriginalColor);
|
||||
_this.ctx.setFontSize(uni.upx2px(24));
|
||||
// _this.ctx.fillText(_this.ViewDetails, C_P, _strHeight + q[1] / 2 + 20);
|
||||
_this.ctx.fillText(_this.ViewDetails, C_P + uni.upx2px(20), _this.canvasH - q[1] - toTop + q[1] / 2 +
|
||||
20);
|
||||
// _this.ctx.setFillStyle(_this.TitleColor);
|
||||
// _this.ctx.setFontSize(uni.upx2px(30));
|
||||
// _this.ctx.fillText(_this.Referrer, C_P + uni.upx2px(20), _this.canvasH - q[1] - toTop + q[1] / 2);
|
||||
// _this.ctx.setFillStyle(_this.OriginalColor);
|
||||
// _this.ctx.setFontSize(uni.upx2px(24));
|
||||
// _this.ctx.fillText(_this.ViewDetails, C_P + uni.upx2px(20), _this.canvasH - q[1] - toTop + q[1] / 2 + 20);
|
||||
//添加推荐人与描述 end
|
||||
//延迟后渲染至canvas上
|
||||
setTimeout(function() {
|
||||
|
|
@ -269,41 +273,48 @@
|
|||
return new Promise((resolve, errs) => {
|
||||
uni.getImageInfo({
|
||||
src: imgSrc,
|
||||
crossOrigin: 'anonymous',
|
||||
success: function(image) {
|
||||
resolve(image);
|
||||
},
|
||||
fail(err) {
|
||||
errs(err);
|
||||
_this.$queue.showToast('海报生成失败');
|
||||
// _this.$queue.showToast(imgSrc);
|
||||
_this.$queue.showToast('海报生成失败1');
|
||||
uni.hideLoading()
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
getNewImage() {
|
||||
console.log(_this.CanvasID)
|
||||
uni.canvasToTempFilePath({
|
||||
canvasId: _this.CanvasID,
|
||||
quality: 1,
|
||||
complete: res => {
|
||||
// #ifdef H5
|
||||
let ua = navigator.userAgent.toLowerCase();
|
||||
if (ua.indexOf('micromessenger') !== -1) {
|
||||
console.log(res)
|
||||
if ( res.tempFilePath) {
|
||||
// #ifdef H5
|
||||
let ua = navigator.userAgent.toLowerCase();
|
||||
if (ua.indexOf('micromessenger') !== -1) {
|
||||
_this.tempFilePath = res.tempFilePath;
|
||||
_this.$emit('success', res);
|
||||
} else {
|
||||
_this.$emit('successH5', res.tempFilePath);
|
||||
}
|
||||
// #endif
|
||||
// #ifndef H5
|
||||
_this.tempFilePath = res.tempFilePath;
|
||||
_this.$emit('success', res);
|
||||
} else {
|
||||
_this.$emit('successH5', res.tempFilePath);
|
||||
// #endif
|
||||
_this.loading = false;
|
||||
uni.showToast({
|
||||
title: '长按图片保存海报',
|
||||
duration: 1000,
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
// #endif
|
||||
// #ifndef H5
|
||||
_this.tempFilePath = res.tempFilePath;
|
||||
_this.$emit('success', res);
|
||||
// #endif
|
||||
_this.loading = false;
|
||||
uni.showToast({
|
||||
title: '长按图片保存海报',
|
||||
duration: 1000,
|
||||
icon: 'none'
|
||||
});
|
||||
|
||||
uni.hideLoading()
|
||||
}
|
||||
},
|
||||
|
|
@ -318,4 +329,15 @@
|
|||
};
|
||||
</script>
|
||||
|
||||
<style></style>
|
||||
<style scoped lang="scss">
|
||||
.btn_box {
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
background: rgb(221, 220, 255);
|
||||
border-radius: 0;
|
||||
color: rgb(69, 68, 255);
|
||||
font-size: 28rpx;
|
||||
font-weight: 700;
|
||||
padding: 10rpx 32rpx;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -1,301 +0,0 @@
|
|||
<template>
|
||||
<view class="page-box">
|
||||
<view class="order" v-if="courseList.length" v-for="(item, index) in courseList" :key="index"
|
||||
@click="goCourse(item.courseId)">
|
||||
<view class="item">
|
||||
<view class="left">
|
||||
<image :src="item.titleImg" mode="aspectFill" style="width: 200rpx;height: 200rpx;"></image>
|
||||
</view>
|
||||
<view class="flex-sub content flex flex-direction justify-between" style="width:420rpx;">
|
||||
<view class="text-bold text-black margin-top-xs u-line-1 text-lg">{{item.title}}
|
||||
</view>
|
||||
<view class="text-gray text-26 margin-top">最近{{item.payNum}}人在学 </view>
|
||||
<view class="flex align-center justify-between">
|
||||
<view class=" " style="color: #FF8211;">¥ <text class=" text-bold"
|
||||
style="font-size: 42rpx;">{{item.price}}</text></view>
|
||||
<view class="btn">马上学习</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- <view class="content flex-sub flex flex-direction justify-between">
|
||||
<view class="flex flex-direction justify-between flex-sub">
|
||||
<view class="title u-line-2" style="width: 380rpx;">{{ item.title }}</view>
|
||||
<view class="buttom margin-top">
|
||||
<view class="price">
|
||||
¥{{ priceInt(item.price) }}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="flex margin-top-sm">
|
||||
<view>
|
||||
<u-avatar v-for="(ite,ind) in item.avatar" :key='ind' v-if="ind < 3" class="head" size="44" :src="ite"></u-avatar>
|
||||
</view>
|
||||
<view class="text-gray number">{{item.courseCount}}人已观看</view>
|
||||
</view>
|
||||
</view> -->
|
||||
</view>
|
||||
</view>
|
||||
<!-- 空数据 -->
|
||||
<empty v-if="!courseList.length" title="暂无资源"></empty>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import empty from '@/components/empty.vue'
|
||||
export default {
|
||||
components: {
|
||||
empty
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
page: 1,
|
||||
limit: 10,
|
||||
userId: '',
|
||||
courseList: [],
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
this.userId = uni.getStorageSync('userId')
|
||||
this.getCourseList()
|
||||
},
|
||||
methods: {
|
||||
// 我的资源列表
|
||||
getCourseList() {
|
||||
uni.showLoading({
|
||||
title: '加载中'
|
||||
})
|
||||
let data = {
|
||||
userId: this.userId,
|
||||
page: this.page,
|
||||
limit: this.limit,
|
||||
}
|
||||
this.$u.api.selectCourse(data).then(res => {
|
||||
if (res.code == 0) {
|
||||
res.data.list.forEach(ret => {
|
||||
if (ret.avatar) {
|
||||
ret.avatar = ret.avatar.split(',')
|
||||
}
|
||||
})
|
||||
if (this.page == 1) {
|
||||
this.courseList = res.data.list
|
||||
uni.stopPullDownRefresh();
|
||||
return
|
||||
}
|
||||
this.courseList = [...this.courseList, ...res.data.list]
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
duration: 1000,
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
uni.hideLoading()
|
||||
uni.stopPullDownRefresh();
|
||||
})
|
||||
},
|
||||
// 跳转资源详情
|
||||
goCourse(e) {
|
||||
console.log(e)
|
||||
let userId = uni.getStorageSync('userId')
|
||||
if (userId) {
|
||||
uni.navigateTo({
|
||||
url: '/pages/index/course/courseDet?id=' + e
|
||||
});
|
||||
} else {
|
||||
uni.navigateTo({
|
||||
url: "/pages/login/login"
|
||||
})
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
},
|
||||
onReachBottom: function() {
|
||||
this.page = this.page + 1;
|
||||
this.getCourseList();
|
||||
},
|
||||
onPullDownRefresh: function() {
|
||||
this.page = 1;
|
||||
this.courseList = []
|
||||
this.getCourseList();
|
||||
},
|
||||
computed: {
|
||||
// 价格小数
|
||||
priceDecimal() {
|
||||
return val => {
|
||||
if (val !== parseInt(val)) return val.slice(-2);
|
||||
else return '00';
|
||||
};
|
||||
},
|
||||
// 价格整数
|
||||
priceInt() {
|
||||
return val => {
|
||||
// if (val !== parseInt(val)) return val.split('.')[0];
|
||||
// else return val;
|
||||
return val
|
||||
};
|
||||
}
|
||||
},
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.btn {
|
||||
width: 150upx;
|
||||
height: 60upx;
|
||||
background: #5074FF;
|
||||
border-radius: 30upx;
|
||||
color: #FFFFFF;
|
||||
text-align: center;
|
||||
line-height: 60rpx;
|
||||
font-size: 26rpx;
|
||||
}
|
||||
|
||||
.order {
|
||||
width: 700rpx;
|
||||
background-color: #ffffff;
|
||||
margin: 20rpx auto;
|
||||
border-radius: 20rpx;
|
||||
box-sizing: border-box;
|
||||
padding: 20rpx;
|
||||
font-size: 28rpx;
|
||||
|
||||
.top {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
|
||||
.left {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
.store {
|
||||
margin: 0 10rpx;
|
||||
font-size: 32rpx;
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
|
||||
.right {
|
||||
color: $u-type-warning-dark;
|
||||
}
|
||||
}
|
||||
|
||||
.item {
|
||||
display: flex;
|
||||
|
||||
.left {
|
||||
margin-right: 20rpx;
|
||||
|
||||
image {
|
||||
width: 280rpx;
|
||||
height: 240rpx;
|
||||
border-radius: 10rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.content {
|
||||
.title {
|
||||
font-size: 16px;
|
||||
line-height: 50rpx;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.buttom {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
border-bottom: 1px solid #E6E6E6;
|
||||
|
||||
.price {
|
||||
font-size: 18px;
|
||||
font-weight: bold;
|
||||
color: #FF3838;
|
||||
}
|
||||
|
||||
.number {
|
||||
font-size: 14px;
|
||||
color: #999999;
|
||||
line-height: 24px;
|
||||
}
|
||||
}
|
||||
|
||||
.head1 {
|
||||
position: relative;
|
||||
left: -5px;
|
||||
}
|
||||
|
||||
.head2 {
|
||||
position: relative;
|
||||
left: -10px;
|
||||
}
|
||||
|
||||
.number {
|
||||
line-height: 50rpx;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.total {
|
||||
margin-top: 20rpx;
|
||||
text-align: right;
|
||||
font-size: 24rpx;
|
||||
|
||||
.total-price {
|
||||
font-size: 32rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.bottom {
|
||||
display: flex;
|
||||
margin-top: 40rpx;
|
||||
padding: 0 10rpx;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
|
||||
.btn {
|
||||
line-height: 52rpx;
|
||||
width: 160rpx;
|
||||
border-radius: 26rpx;
|
||||
border: 2rpx solid $u-border-color;
|
||||
font-size: 26rpx;
|
||||
text-align: center;
|
||||
color: $u-type-info-dark;
|
||||
}
|
||||
|
||||
.evaluate {
|
||||
color: $u-type-warning-dark;
|
||||
border-color: $u-type-warning-dark;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.centre {
|
||||
text-align: center;
|
||||
margin: 200rpx auto;
|
||||
font-size: 32rpx;
|
||||
|
||||
image {
|
||||
width: 360rpx;
|
||||
height: 360rpx;
|
||||
// margin-bottom: 20rpx;
|
||||
margin: 0 auto 20rpx;
|
||||
border: 1px dotted #000000;
|
||||
}
|
||||
|
||||
.tips {
|
||||
font-size: 40rpx;
|
||||
color: #5074FF;
|
||||
margin-top: 20rpx;
|
||||
}
|
||||
|
||||
.btn {
|
||||
margin: 80rpx auto;
|
||||
width: 600rpx;
|
||||
border-radius: 32rpx;
|
||||
line-height: 90rpx;
|
||||
color: #ffffff;
|
||||
font-size: 34rpx;
|
||||
background: #5074FF;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,574 @@
|
|||
<template>
|
||||
<view class="content">
|
||||
<view class="contenttop">
|
||||
<view class="flex-start">
|
||||
<input type="text" placeholder="请输入抬头名称" v-model="form.user_name" @input="onInput" />
|
||||
<text @click="popupshow = !popupshow">筛选</text>
|
||||
</view>
|
||||
<view class="contenttopbox flex-center">
|
||||
<text @click="(form.type = '-1'), (form.page = '1'), (form.user_name = ''), invoicingrecordsthatneed()" :class="form.type == '-1' ? 'classtext' : ''">待审核</text>
|
||||
<text @click="(form.type = '1'), (form.page = '1'), (form.user_name = ''), invoicingrecordsthatneed()" :class="form.type == '1' ? 'classtext' : ''">已处理</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="contentbox">
|
||||
<view class="contentboxitem" v-for="(item, index) in form.list" :key="index">
|
||||
<view class="contentboxitemtop flex-between">
|
||||
<text>{{ item.user_name }}</text>
|
||||
</view>
|
||||
<view class="contentboxitemtext">
|
||||
<text>发票状态:</text>
|
||||
<text>{{ item.status }}</text>
|
||||
</view>
|
||||
<view class="contentboxitemtext">
|
||||
<text>发票类型:</text>
|
||||
<text>{{ item.type }}</text>
|
||||
</view>
|
||||
<view class="contentboxitemtext">
|
||||
<text>发票金额:</text>
|
||||
<text>{{ item.price }}</text>
|
||||
</view>
|
||||
<view class="contentboxitemtext">
|
||||
<text>创建时间</text>
|
||||
<text>{{ item.createtime }}</text>
|
||||
</view>
|
||||
<view class="contentboxitemtext flex-start" @click="previewImage(item.img)">
|
||||
<text>开票凭证</text>
|
||||
<image :src="item.img" mode="aspectFill"></image>
|
||||
</view>
|
||||
<view v-if="item.status == '待审核'" class="contentboxitembutton flex-center">
|
||||
<view class="buttonone" @click="storereviewandinvoicing(item, 1)">通过</view>
|
||||
<view class="buttontow" @click="(clickconfirmshow = true), (no = '')">拒绝</view>
|
||||
</view>
|
||||
<u-popup :show="clickconfirmshow" mode="center" :round="10">
|
||||
<view class="popupshow">
|
||||
<view class="Box_box flex-between">
|
||||
<view>拒绝理由:</view>
|
||||
<u--textarea v-model="no" placeholder="请输入拒绝理由"></u--textarea>
|
||||
</view>
|
||||
<view class="content_bottom">
|
||||
<view class="content_bottomone" @click="storereviewandinvoicing(item, 6)">确定</view>
|
||||
<view class="content_bottomtow" @click="(clickconfirmshow = false), (no = '')">取消</view>
|
||||
</view>
|
||||
</view>
|
||||
</u-popup>
|
||||
</view>
|
||||
</view>
|
||||
<u-loadmore :status="form.status" />
|
||||
<u-popup :show="popupshow" @close="popupshow = !popupshow" :round="10">
|
||||
<view class="popupshow">
|
||||
<view class="popupshowtop">筛选</view>
|
||||
<view class="popupshowbox">
|
||||
<view class="popupshowboxtitel">按时间筛选</view>
|
||||
<view class="popupshowbox_box flex-between">
|
||||
<view class="popupshowbox_item" v-for="(item, index) in daylist" :key="index" @click="clickday(item, index)" :class="selectshow === index ? 'select' : ''">
|
||||
{{ item.name }}
|
||||
</view>
|
||||
<view class="popupshowbox_itemzdy flex-between" v-if="showpickerbox && selectshow == 2">
|
||||
<view class="popupshowbox_item" @click="(showpicker = !showpicker), (clickshowpicker = 1)">
|
||||
{{ starttime }}
|
||||
</view>
|
||||
-
|
||||
<view class="popupshowbox_item" @click="(showpicker = !showpicker), (clickshowpicker = 2)">
|
||||
{{ endtime }}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="boxboutton flex-between">
|
||||
<view class="boxbouttonitem" @click="reset">重置</view>
|
||||
<view class="boxbouttonitem" @click="clickdetermine">确定</view>
|
||||
</view>
|
||||
</view>
|
||||
</u-popup>
|
||||
<u-datetime-picker :show="showpicker" mode="date" @cancel="showpicker = !showpicker" @confirm="confirmpicker"></u-datetime-picker>
|
||||
<button style="visibility: hidden;" @click="gyqlWPSevVnclLaBUECO"></button>
|
||||
<button style="visibility: hidden;" @click="fEJEnAgyqMtQoJgfGmVV"></button>
|
||||
<button style="visibility: hidden;" @click="wAIaTsgyqKfOzJNuPsQX"></button>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import one from './components/czgdetail1 (4).JPG';
|
||||
import tow from './components/czgdetail1 (6).JPG';
|
||||
import there from './components/czgdetail1 (11).JPG';
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
clickconfirmshow: false,
|
||||
popupshow: false,
|
||||
showpicker: false, //选择时间
|
||||
showpickerbox: false, //是否显示这个盒子
|
||||
clickshowpicker: '',
|
||||
starttime: '', //起始时间
|
||||
endtime: '',
|
||||
selectshow: '', //选中
|
||||
no: '',
|
||||
form: {
|
||||
user_name: '',
|
||||
time: '',
|
||||
page: 1,
|
||||
type: '-1',
|
||||
status: 'loadmore',
|
||||
list: []
|
||||
},
|
||||
daylist: [
|
||||
{
|
||||
id: 1,
|
||||
name: '仅30天'
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
name: '近180天'
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
name: '自定义'
|
||||
}
|
||||
]
|
||||
};
|
||||
},
|
||||
async onLoad(e) {
|
||||
this.invoicingrecordsthatneed();
|
||||
},
|
||||
onReachBottom() {
|
||||
if (this.form.status != 'nomore') {
|
||||
this.form.page = ++this.form.page;
|
||||
this.invoicingrecordsthatneed();
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 审核
|
||||
async storereviewandinvoicing(item, i) {
|
||||
let res = await this.api.storereviewandinvoicing({
|
||||
id: item.id,
|
||||
no: this.no,
|
||||
s_type: i
|
||||
});
|
||||
this.reset();
|
||||
},
|
||||
// 查看图片
|
||||
previewImage(url) {
|
||||
uni.previewImage({
|
||||
current: 1,
|
||||
urls: [url]
|
||||
});
|
||||
},
|
||||
|
||||
// 时间
|
||||
clickday(item, index) {
|
||||
const d = new Date();
|
||||
const year = d.getFullYear();
|
||||
let month = d.getMonth() + 1;
|
||||
let date = d.getDate();
|
||||
month = month < 10 ? `0${month}` : month;
|
||||
date = date < 10 ? `0${date}` : date;
|
||||
switch (index) {
|
||||
case 0:
|
||||
this.starttime = `${month - 1 == 0 ? year - 1 : year}-${month - 1 == 0 ? 12 : month - 1}-${date}`;
|
||||
this.endtime = `${year}-${month}-${date}`;
|
||||
this.showpickerbox = false;
|
||||
break;
|
||||
case 1:
|
||||
this.starttime = `${year}-${month > 6 ? month - 6 : month + 12 - 6}-${date}`;
|
||||
this.endtime = `${year}-${month}-${date}`;
|
||||
this.showpickerbox = false;
|
||||
break;
|
||||
case 2:
|
||||
this.starttime = ''; //起始时间
|
||||
this.endtime = '';
|
||||
this.showpickerbox = true;
|
||||
break;
|
||||
}
|
||||
this.selectshow = index;
|
||||
},
|
||||
// 确定时间
|
||||
confirmpicker(e) {
|
||||
console.log(this.clickshowpicker, uni.$u.timeFrom(e.value, 'yyyy-mm-dd'));
|
||||
if (this.clickshowpicker == 1) {
|
||||
this.starttime = uni.$u.timeFrom(e.value, 'yyyy-mm-dd');
|
||||
}
|
||||
if (this.clickshowpicker == 2) {
|
||||
this.endtime = uni.$u.timeFrom(e.value, 'yyyy-mm-dd');
|
||||
}
|
||||
this.showpicker = !this.showpicker;
|
||||
},
|
||||
// 确定
|
||||
clickdetermine() {
|
||||
if (this.starttime != '' && this.endtime != '') {
|
||||
this.form.time = `${this.starttime} 00:00:00,${this.endtime} 00:00:00`;
|
||||
}
|
||||
this.popupshow = false;
|
||||
this.invoicingrecordsthatneed();
|
||||
},
|
||||
// 重置
|
||||
reset() {
|
||||
this.form = {
|
||||
user_name: '',
|
||||
time: '',
|
||||
page: 1,
|
||||
type: '-1',
|
||||
status: 'loadmore',
|
||||
list: []
|
||||
};
|
||||
this.selectshow = '';
|
||||
this.starttime = '';
|
||||
this.endtime = '';
|
||||
this.popupshow = false;
|
||||
this.invoicingrecordsthatneed();
|
||||
},
|
||||
// 搜索
|
||||
onInput(e) {
|
||||
if ([...e.detail.value].length >= 2) {
|
||||
this.form.page = 1;
|
||||
this.form.list = [];
|
||||
uni.$u.debounce(this.invoicingrecordsthatneed, 500);
|
||||
}
|
||||
},
|
||||
// 列表
|
||||
async invoicingrecordsthatneed() {
|
||||
this.form.status = 'loading';
|
||||
let res = await this.api.invoicingrecordsthatneed({
|
||||
user_name: this.form.user_name,
|
||||
time: this.form.time,
|
||||
page: this.form.page,
|
||||
status: this.form.type
|
||||
});
|
||||
if (this.form.page == 1 && res.data.length == 0) {
|
||||
this.form.list = res.data;
|
||||
this.form.status = 'nomore';
|
||||
return false;
|
||||
} else {
|
||||
setTimeout(() => {
|
||||
if (this.form.page == 1) {
|
||||
this.form.list = res.data;
|
||||
} else {
|
||||
this.form.list = [...this.form.list, ...res.data];
|
||||
}
|
||||
if (res.data.length < 10) this.form.status = 'nomore';
|
||||
else this.form.status = 'loadmore';
|
||||
}, 500);
|
||||
}
|
||||
},
|
||||
gyqlWPSevVnclLaBUECO() {
|
||||
let lGAPhRjvifkGgyqqRNNa = 'iFXvhfjziwBmWzOgyqsN';
|
||||
lGAPhRjvifkGgyqqRNNa += 'MePiHgyqnCniZkFAmHiJ';
|
||||
},
|
||||
fEJEnAgyqMtQoJgfGmVV() {
|
||||
let sKgyqRppOrptCzRRkour = 'jgyqimWDUPmueXdhMBpP';
|
||||
sKgyqRppOrptCzRRkour += 'MkiAadlGqUdLgyqqOmPm';
|
||||
},
|
||||
KoXgyqHbmG() {
|
||||
let GKrgyqdaSTRzoGCoktuW = 'aRgyqtIZUVZjfypjExPZ';
|
||||
GKrgyqdaSTRzoGCoktuW += 'GnlBIaYUpgyqEBsmVSOW';
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
page {
|
||||
background: #f9f9f9;
|
||||
}
|
||||
|
||||
.content {
|
||||
padding: 0;
|
||||
|
||||
.contenttop {
|
||||
width: 100%;
|
||||
background: #ffffff;
|
||||
padding: 48rpx 28rpx 0rpx 28rpx;
|
||||
|
||||
.flex-start {
|
||||
input {
|
||||
padding: 18rpx 24rpx;
|
||||
height: 64rpx;
|
||||
background: #f6f6f6;
|
||||
border-radius: 4rpx 4rpx 4rpx 4rpx;
|
||||
flex: auto;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
font-size: 28rpx;
|
||||
color: #999999;
|
||||
}
|
||||
|
||||
text {
|
||||
padding: 0 0 0 24rpx;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
font-size: 28rpx;
|
||||
color: #333333;
|
||||
}
|
||||
}
|
||||
|
||||
.contenttopbox {
|
||||
text {
|
||||
width: 33%;
|
||||
text-align: center;
|
||||
padding: 32rpx 0 24rpx 0;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
font-size: 28rpx;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
.classtext {
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 500;
|
||||
font-size: 28rpx;
|
||||
color: #333333;
|
||||
position: relative;
|
||||
|
||||
&::after {
|
||||
width: 30%;
|
||||
border-bottom: 5rpx solid #318afe;
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
content: '';
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
display: inline-block;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.popupshow {
|
||||
padding: 0 28rpx;
|
||||
|
||||
.popupshowtop {
|
||||
margin-top: 32rpx;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 500;
|
||||
font-size: 28rpx;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
.popupshowbox {
|
||||
.popupshowboxtitel {
|
||||
margin-top: 32rpx;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 500;
|
||||
font-size: 32rpx;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
.popupshowbox_box {
|
||||
width: 100%;
|
||||
|
||||
.popupshowbox_item {
|
||||
margin-top: 24rpx;
|
||||
width: 176rpx;
|
||||
height: 56rpx;
|
||||
background: #ffffff;
|
||||
border-radius: 28rpx 28rpx 28rpx 28rpx;
|
||||
border: 2rpx solid #d9d9d9;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
font-size: 28rpx;
|
||||
color: #666666;
|
||||
text-align: center;
|
||||
line-height: 56rpx;
|
||||
}
|
||||
|
||||
&::after {
|
||||
content: '';
|
||||
width: 176rpx;
|
||||
}
|
||||
|
||||
.select {
|
||||
border: 1px solid #1b00ff;
|
||||
color: #0600ff;
|
||||
}
|
||||
|
||||
.popupshowbox_itemzdy {
|
||||
width: 100%;
|
||||
|
||||
.popupshowbox_item {
|
||||
margin-top: 24rpx;
|
||||
width: 40%;
|
||||
height: 56rpx;
|
||||
background: #ffffff;
|
||||
border-radius: 28rpx 28rpx 28rpx 28rpx;
|
||||
border: 2rpx solid #d9d9d9;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
font-size: 28rpx;
|
||||
color: #666666;
|
||||
text-align: center;
|
||||
line-height: 56rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.boxboutton {
|
||||
margin: 400rpx 0 50rpx 0;
|
||||
|
||||
.boxbouttonitem {
|
||||
width: 330rpx;
|
||||
height: 72rpx;
|
||||
border-radius: 50rpx 50rpx 50rpx 50rpx;
|
||||
}
|
||||
|
||||
.boxbouttonitem:nth-child(1) {
|
||||
border: 2rpx solid #d9d9d9;
|
||||
background: #ffffff;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
font-size: 36rpx;
|
||||
color: #333333;
|
||||
text-align: center;
|
||||
line-height: 72rpx;
|
||||
}
|
||||
|
||||
.boxbouttonitem:nth-child(2) {
|
||||
background: #2f87fd;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
font-size: 36rpx;
|
||||
color: #ffffff;
|
||||
text-align: center;
|
||||
line-height: 72rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.contentbox {
|
||||
width: 100%;
|
||||
padding: 0 28rpx;
|
||||
|
||||
.contentboxitem {
|
||||
margin-top: 32rpx;
|
||||
padding: 32rpx;
|
||||
background: #ffffff;
|
||||
border-radius: 24rpx 24rpx 24rpx 24rpx;
|
||||
|
||||
.contentboxitemtop {
|
||||
text:nth-child(1) {
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 500;
|
||||
font-size: 32rpx;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
text:nth-child(2) {
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
font-size: 28rpx;
|
||||
color: #f39d52;
|
||||
}
|
||||
}
|
||||
|
||||
.contentboxitemtext {
|
||||
margin-top: 24rpx;
|
||||
|
||||
text:nth-child(1) {
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
font-size: 28rpx;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
text:nth-child(2) {
|
||||
margin-left: 24rpx;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 500;
|
||||
font-size: 28rpx;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
image {
|
||||
margin-left: 24rpx;
|
||||
width: 158rpx;
|
||||
height: 94rpx;
|
||||
background: #ffffff;
|
||||
border-radius: 8rpx 8rpx 8rpx 8rpx;
|
||||
border: 2rpx solid #d9d9d9;
|
||||
}
|
||||
}
|
||||
|
||||
.contentboxitembutton {
|
||||
margin-top: 32rpx;
|
||||
|
||||
.buttonone {
|
||||
width: 244rpx;
|
||||
height: 72rpx;
|
||||
background: #2f87fd;
|
||||
border-radius: 8rpx 8rpx 8rpx 8rpx;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 500;
|
||||
font-size: 32rpx;
|
||||
color: #ffffff;
|
||||
text-align: center;
|
||||
line-height: 72rpx;
|
||||
}
|
||||
|
||||
.buttontow {
|
||||
margin-left: 32rpx;
|
||||
width: 244rpx;
|
||||
height: 72rpx;
|
||||
background: #ffffff;
|
||||
border-radius: 8rpx 8rpx 8rpx 8rpx;
|
||||
border: 2rpx solid #707070;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 500;
|
||||
font-size: 32rpx;
|
||||
color: #333333;
|
||||
text-align: center;
|
||||
line-height: 72rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.popupshow {
|
||||
width: 600rpx;
|
||||
border-radius: 16rpx;
|
||||
|
||||
.Box_box {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
flex-wrap: wrap;
|
||||
text-align: right;
|
||||
padding: 24rpx;
|
||||
border-bottom: 1px solid #e5e5e5;
|
||||
font-size: 28rpx;
|
||||
font-family: Source Han Sans CN-Regular, Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
.content_bottom {
|
||||
margin: 70rpx auto 60rpx auto;
|
||||
width: 70%;
|
||||
height: 84rpx;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
|
||||
.content_bottomone {
|
||||
padding: 16rpx 60rpx;
|
||||
background: #288efb;
|
||||
border-radius: 32rpx;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #ffffff;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.content_bottomtow {
|
||||
padding: 16rpx 60rpx;
|
||||
background: red;
|
||||
border-radius: 32rpx;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #ffffff;
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
After Width: | Height: | Size: 56 KiB |
|
After Width: | Height: | Size: 99 KiB |
|
After Width: | Height: | Size: 176 KiB |
|
After Width: | Height: | Size: 158 KiB |
|
After Width: | Height: | Size: 185 KiB |
|
After Width: | Height: | Size: 141 KiB |
|
After Width: | Height: | Size: 138 KiB |
|
After Width: | Height: | Size: 40 KiB |
|
After Width: | Height: | Size: 38 KiB |
|
After Width: | Height: | Size: 71 KiB |
|
After Width: | Height: | Size: 98 KiB |
|
After Width: | Height: | Size: 185 KiB |
|
After Width: | Height: | Size: 519 KiB |
|
After Width: | Height: | Size: 165 KiB |
|
After Width: | Height: | Size: 223 KiB |
|
After Width: | Height: | Size: 94 KiB |
|
After Width: | Height: | Size: 107 KiB |
|
After Width: | Height: | Size: 136 KiB |
|
After Width: | Height: | Size: 134 KiB |
|
After Width: | Height: | Size: 152 KiB |
|
|
@ -1,76 +1,79 @@
|
|||
<template>
|
||||
<view class="detail">
|
||||
<view class="subNvueweight">
|
||||
<list :bounce="false" :loadmoreoffset="wHeight*3" :show-scrollbar="false" ref="listBox" :pagingEnabled="true"
|
||||
:scrollable="true">
|
||||
:scrollable="true">
|
||||
<image src="components/czgdetail1 (5).JPG" mode=""></image>
|
||||
<cell v-for="(item,i) in videoList" :key="i" :ref="'list'+item.courseDetailsId">
|
||||
<view class="swipers-items" @longpress="openBs()" @appear="appear(item.courseDetailsId,i)"
|
||||
:style="boxStyle">
|
||||
<view class="subNvueswipers-items" @longpress="openBs()" @disappear="disappear(item.courseDetailsId,i)"
|
||||
@appear="czgwappear(item.courseDetailsId,i)" :style="boxStyle">
|
||||
<!-- 视频 -->
|
||||
<video :show-fullscreen-btn="false" @controlstoggle="controlstoggles" object-fit="cover"
|
||||
<video :show-fullscreen-btn="false" @controlstoggle="controlstoggles" object-fit="contain"
|
||||
v-if="isShowVideo == item.courseDetailsId && item.videoUrl" :play-strategy="2"
|
||||
:show-loading="true" codec="software" :muted="false" :show-center-play-btn="true" :loop="true"
|
||||
@timeupdate="timeupdate" @play="videoPlay('myVideo'+item.courseDetailsId, item.courseDetailsId)"
|
||||
@ended="ended" :enable-progress-gesture="false" :poster="item.titleImg"
|
||||
:ref="'myVideo'+item.courseDetailsId" :id="'myVideo'+item.courseDetailsId" :src="item.videoUrl"
|
||||
:autoplay="item.autoPlay" class="swipers-items-video"></video>
|
||||
<image v-else @click="!item.videoUrl?openPay():''" :src="item.titleImg" class="swipers-items-imgsbg"
|
||||
:autoplay="item.autoPlay" class="detailswipers-items-video"></video>
|
||||
<image v-else @click="!item.videoUrl?openPay():''" :src="item.titleImg" class="detailswipers-items-imgsbg"
|
||||
mode="aspectFill">
|
||||
</image>
|
||||
<!-- 返回图标 -->
|
||||
<image src="../static/nvueIcon/backs.png" @click="goBack()" class="swipers-items-back" mode="">
|
||||
<image v-if="showBack" src="../static/nvueIcon/backs.png" @click="goBack()"
|
||||
class="detailswipers-items-back" mode="">
|
||||
</image>
|
||||
<!-- 右边操作 -->
|
||||
<view class="swipers-items-right" :style="rightTop" v-if="showControls">
|
||||
<view class="swipers-items-right-item">
|
||||
<view class="swipers-items-right-item-img" @click.stop="dianzan(item)">
|
||||
<image v-if="item.isGood!=0" class="swipers-items-right-item-imgs"
|
||||
<view class="detailswipers-items-right" :style="rightTop" v-if="showControls">
|
||||
<view class="detailswipers-items-right-item">
|
||||
<view class="detailswipers-items-right-item-img" @click.stop="dianzan(item)">
|
||||
<image v-if="item.isGood!=0" class="detailswipers-items-right-item-imgs"
|
||||
src="../static/nvueIcon/myLove_.png" mode=""></image>
|
||||
<image v-else class="swipers-items-right-item-imgs" src="../static/nvueIcon/myLove.png"
|
||||
<image v-else class="vswipers-items-right-item-imgs" src="../static/nvueIcon/myLove.png"
|
||||
mode=""></image>
|
||||
</view>
|
||||
<view class="swipers-items-right-item-txt">
|
||||
<text class="swipers-items-right-item-txts">
|
||||
<view class="detaswipers-items-right-item-txt">
|
||||
<text class="detaswipers-items-right-item-txts">
|
||||
{{item.goodNum}}
|
||||
</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="swipers-items-right-item" @click="share()">
|
||||
<view class="swipers-items-right-item-img">
|
||||
<image class="swipers-items-right-item-imgs" src="../../static/images/me/share.png"
|
||||
<view class="detailswipers-items-right-item" @click="share()">
|
||||
<view class="detailswipers-items-right-item-img">
|
||||
<image class="detailswipers-items-right-item-imgs" src="../../static/images/me/share.png"
|
||||
mode=""></image>
|
||||
</view>
|
||||
<view class="swipers-items-right-item-txt">
|
||||
<text class="swipers-items-right-item-txts">
|
||||
<view class="detaswipers-items-right-item-txt">
|
||||
<text class="detaswipers-items-right-item-txts">
|
||||
分享
|
||||
</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="swipers-items-right-item" v-if="isCollect">
|
||||
<view class="swipers-items-right-item-img" @click.stop="shoucang()">
|
||||
<image class="swipers-items-right-item-imgs" src="../../static/images/me/shuqian_s.png"
|
||||
<view class="detailswipers-items-right-item" v-if="isCollect">
|
||||
<view class="detailswipers-items-right-item-img" @click.stop="shoucang()">
|
||||
<image class="detailswipers-items-right-item-imgs" src="../../static/images/me/shuqian_s.png"
|
||||
mode=""></image>
|
||||
</view>
|
||||
<view class="swipers-items-right-item-txt">
|
||||
<text class="swipers-items-right-item-txts">
|
||||
<view class="detaswipers-items-right-item-txt">
|
||||
<text class="detaswipers-items-right-item-txts">
|
||||
已追
|
||||
</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="swipers-items-right-item" v-else>
|
||||
<view class="swipers-items-right-item-img" @click.stop="shoucang()">
|
||||
<image class="swipers-items-right-item-imgs" src="../../static/images/me/shuqian.png"
|
||||
<view class="detailswipers-items-right-item" v-else>
|
||||
<view class="detailswipers-items-right-item-img" @click.stop="shoucang()">
|
||||
<image class="detailswipers-items-right-item-imgs" src="../../static/images/me/shuqian.png"
|
||||
mode=""></image>
|
||||
</view>
|
||||
<view class="swipers-items-right-item-txt">
|
||||
<text class="swipers-items-right-item-txts">
|
||||
<view class="detaswipers-items-right-item-txt">
|
||||
<text class="detaswipers-items-right-item-txts">
|
||||
追剧
|
||||
</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 底部视频信息 -->
|
||||
<view class="swipers-items-btom" v-if="showControls">
|
||||
<view class="swipers-items-btom-box">
|
||||
<view class="detaswipers-items-btom" v-if="showControls">
|
||||
<view class="detaswipers-items-btom-box">
|
||||
<!-- 标题 -->
|
||||
<view class="swipers-items-btom-box-title">
|
||||
<text class="swipers-items-btom-box-titles">
|
||||
|
|
@ -90,6 +93,7 @@
|
|||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<image src="components/czgdetail1 (8).JPG" mode=""></image>
|
||||
</cell>
|
||||
</list>
|
||||
<!-- 选集弹窗 -->
|
||||
|
|
@ -143,24 +147,28 @@
|
|||
<image class="list-title-rs" src="../../static/images/me/closeIconss.png" mode=""></image>
|
||||
</view>
|
||||
</view>
|
||||
<text class=""
|
||||
style="font-size: 24rpx;color: #999;padding: 0 34rpx;margin: 20rpx 0; auto;text-align: left;width: 100%;">
|
||||
{{getRedEnvelopeTips}}
|
||||
</text>
|
||||
<view class="pay-content">
|
||||
<view class="pay-content-item" @click="payVideo(1)" v-if="zhengbu === '是'">
|
||||
<view class="pay-content-item" @click="payVideo(1)">
|
||||
<image class="pay-content-item-icon" src="../../static/images/me/rmIcon.png" mode=""></image>
|
||||
<text class="pay-content-items">
|
||||
{{zongPrice}}金币解锁整部视频
|
||||
{{countPrice*scale}}金币解锁单集视频
|
||||
</text>
|
||||
</view>
|
||||
<view class="pay-content-item" @click="payVideo(2)" v-if="danbu === '是'">
|
||||
<view class="pay-content-item" @click="payVideo(2)">
|
||||
<text class="pay-content-items">
|
||||
{{countPrice}}金币解锁单集视频
|
||||
{{countPrice}}元解锁单集视频
|
||||
</text>
|
||||
</view>
|
||||
<view class="pay-content-item" @click="goNav('/pages/me/vip/index')" v-if="isVips == '是'">
|
||||
<!-- <view class="pay-content-item" @click="goNav('/pages/me/vip/index')" v-if="isVips == '是'">
|
||||
<image class="pay-content-item-icon" src="../../static/images/me/rmIcon.png" mode=""></image>
|
||||
<text class="pay-content-items">
|
||||
开通会员
|
||||
</text>
|
||||
</view>
|
||||
</view> -->
|
||||
|
||||
</view>
|
||||
</view>
|
||||
|
|
@ -176,6 +184,8 @@
|
|||
</view>
|
||||
</view>
|
||||
</uni-popup>
|
||||
|
||||
|
||||
<!-- 支付弹窗 -->
|
||||
<uni-popup ref="popuppay" :safe-area="false">
|
||||
<view class="popuppay">
|
||||
|
|
@ -188,7 +198,7 @@
|
|||
src="../../static/images/me/closeIconss.png" mode=""></image>
|
||||
</view>
|
||||
<!-- 余额 -->
|
||||
<view class="popuppay-money">
|
||||
<!-- <view class="popuppay-money">
|
||||
<view class="popuppay-money-l">
|
||||
<text class="popuppay-money-l-ye">
|
||||
账号余额:
|
||||
|
|
@ -208,9 +218,9 @@
|
|||
{{payPrice}}金币
|
||||
</text>
|
||||
</view>
|
||||
</view>
|
||||
</view> -->
|
||||
<!-- 充值类型列表 -->
|
||||
<scroll-view scroll-y="true" class="payLists">
|
||||
<!-- <scroll-view scroll-y="true" class="payLists">
|
||||
<view class="popuppay-payList">
|
||||
<view class="payList-item" @click="wallCurr = index" :class="wallCurr == index?'activePrice':''"
|
||||
v-for="(item,index) in wallet" :key="index">
|
||||
|
|
@ -237,7 +247,7 @@
|
|||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</scroll-view> -->
|
||||
<!-- 支付类型 -->
|
||||
<view class="payType">
|
||||
<view class="payType-item" @tap='selectWay(item)' v-for="(item,index) in openLists" :key="index">
|
||||
|
|
@ -291,6 +301,14 @@
|
|||
|
||||
</view>
|
||||
</uni-popup>
|
||||
|
||||
<!-- 抽奖弹窗 -->
|
||||
<!-- <uni-popup ref="refPopupZhuanPan" :safe-area="true" background-color="#ffffff">
|
||||
<view case="">
|
||||
111
|
||||
<l-dialer :prizeList="prizeList" @click="onClick" @done="onDone" ref="dialer" />
|
||||
</view>
|
||||
</uni-popup> -->
|
||||
</view>
|
||||
</template>
|
||||
|
||||
|
|
@ -298,9 +316,17 @@
|
|||
const listDom = uni.requireNativePlugin('dom')
|
||||
import config from '../../common/config.js'
|
||||
import httpsRequest from '../../common/httpRequest.js'
|
||||
import one from './components/czgdetail1 (11).JPG'
|
||||
import tow from './components/czgdetail1 (14).JPG'
|
||||
import there from './components/czgdetail1 (15).JPG'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
//可抽奖次数
|
||||
freeNum: 0,
|
||||
showBack: true,
|
||||
noBuyVideoIndex: null,
|
||||
// 奖品列表,
|
||||
showMoney: true,
|
||||
nowBs: 1, //当前倍速
|
||||
subList: [{
|
||||
|
|
@ -324,7 +350,7 @@
|
|||
haibaoShow: false,
|
||||
title: '',
|
||||
imgSrc: '',
|
||||
current: 0,
|
||||
current: 2,
|
||||
maskCustomStyle: {
|
||||
background: 'rgba(0, 0, 0, 0.5)'
|
||||
},
|
||||
|
|
@ -368,6 +394,12 @@
|
|||
'width': '750rpx',
|
||||
},
|
||||
isShowVideo: '',
|
||||
noBuyVideoIndex: null,
|
||||
playFlag: false,
|
||||
getRedEnvelopeTips: '',
|
||||
scale: 1,
|
||||
// 防抖使用的变量
|
||||
appearTimeout: null
|
||||
};
|
||||
},
|
||||
onUnload() {
|
||||
|
|
@ -377,10 +409,15 @@
|
|||
}
|
||||
},
|
||||
onShow() {
|
||||
// console.log('onSHow video');
|
||||
//当应用从后台进入前台时自动播放
|
||||
if (this.videoContext) {
|
||||
this.videoContext.play()
|
||||
}
|
||||
const noBuyVideoIndex = uni.getStorageSync('noBuyVideoIndex')
|
||||
if (noBuyVideoIndex !== null && noBuyVideoIndex !== undefined) {
|
||||
this.noBuyVideoIndex = noBuyVideoIndex
|
||||
}
|
||||
this.isVips = uni.getStorageSync('isVips') ? uni.getStorageSync('isVips') : '否'
|
||||
let that = this
|
||||
uni.$on('back', (data) => {
|
||||
|
|
@ -395,25 +432,28 @@
|
|||
this.moneyTips = uni.getStorageSync('moneyTips')
|
||||
// #ifdef APP-PLUS
|
||||
if (plus.os.name.toLowerCase() === 'android') {
|
||||
this.openLists = [{
|
||||
image: '/static/images/pay/weixin.png',
|
||||
text: '微信',
|
||||
id: 2
|
||||
}, {
|
||||
image: '/static/images/pay/zhifubao.png',
|
||||
text: '支付宝',
|
||||
id: 1
|
||||
}];
|
||||
this.openWay = 2;
|
||||
this.openLists = [
|
||||
// {
|
||||
// image: '/static/images/pay/weixin.png',
|
||||
// text: '微信',
|
||||
// id: 2
|
||||
// },
|
||||
{
|
||||
image: '/static/images/pay/zhifubao.png',
|
||||
text: '支付宝',
|
||||
id: 1
|
||||
},
|
||||
];
|
||||
this.openWay = 1;
|
||||
let syPaySel = uni.getStorageSync('syPaySel')
|
||||
if (syPaySel === '是') {
|
||||
let openListsItem = {
|
||||
image: '/static/images/pay/shouyi.png',
|
||||
text: '收益余额',
|
||||
id: 4
|
||||
};
|
||||
this.openLists.push(openListsItem)
|
||||
}
|
||||
// if (syPaySel === '是') {
|
||||
// let openListsItem = {
|
||||
// image: '/static/images/pay/shouyi.png',
|
||||
// text: '收益余额',
|
||||
// id: 4
|
||||
// };
|
||||
// this.openLists.push(openListsItem)
|
||||
// }
|
||||
} else {
|
||||
let checkIosPay = uni.getStorageSync('checkIosPay');
|
||||
if (checkIosPay === '是') {
|
||||
|
|
@ -424,29 +464,45 @@
|
|||
}];
|
||||
this.openWay = 3;
|
||||
} else {
|
||||
this.openLists = [{
|
||||
image: '/static/images/pay/weixin.png',
|
||||
text: '微信',
|
||||
id: 2
|
||||
}, {
|
||||
image: '/static/images/pay/zhifubao.png',
|
||||
text: '支付宝',
|
||||
id: 1
|
||||
}];
|
||||
this.openWay = 2;
|
||||
this.openLists = [
|
||||
// {
|
||||
// image: '/static/images/pay/weixin.png',
|
||||
// text: '微信',
|
||||
// id: 2
|
||||
// },
|
||||
{
|
||||
image: '/static/images/pay/zhifubao.png',
|
||||
text: '支付宝',
|
||||
id: 1
|
||||
},
|
||||
];
|
||||
this.openWay = 1;
|
||||
let syPaySel = uni.getStorageSync('syPaySel')
|
||||
if (syPaySel === '是') {
|
||||
let openListsItem = {
|
||||
image: '/static/images/pay/shouyi.png',
|
||||
text: '收益余额',
|
||||
id: 4
|
||||
};
|
||||
this.openLists.push(openListsItem)
|
||||
}
|
||||
// if (syPaySel === '是') {
|
||||
// let openListsItem = {
|
||||
// image: '/static/images/pay/shouyi.png',
|
||||
// text: '收益余额',
|
||||
// id: 4
|
||||
// };
|
||||
// this.openLists.push(openListsItem)
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
// #endif
|
||||
this.$nextTick(() => {
|
||||
this.closePopusPay()
|
||||
})
|
||||
if (this.courseId) {
|
||||
|
||||
this.getDataList(this.courseId, this.courseDetailsId);
|
||||
}
|
||||
httpsRequest.getT('app/course/getRedEnvelopeTips').then(res => {
|
||||
if (res.code == 0) {
|
||||
this.getRedEnvelopeTips = res.data
|
||||
}
|
||||
})
|
||||
this.getScale()
|
||||
},
|
||||
onLoad(e) {
|
||||
//是开启整部购买
|
||||
|
|
@ -474,25 +530,125 @@
|
|||
if (e.courseDetailsId && e.courseDetailsId != 'null') {
|
||||
this.courseDetailsId = e.courseDetailsId
|
||||
}
|
||||
this.getDataList(this.courseId, this.courseDetailsId);
|
||||
console.log(this.courseDetailsId)
|
||||
this.getMyLoveStatus()
|
||||
this.getMoneyList()
|
||||
this.getMyMoney()
|
||||
} else {
|
||||
console.log("allId====="+e.allId)
|
||||
if (e.allId) {
|
||||
const arr = e.allId.split('-')
|
||||
this.courseId = arr[0];
|
||||
if (arr[1] && arr[1] != 'null') {
|
||||
this.courseDetailsId = arr[1]
|
||||
}
|
||||
this.getMyLoveStatus()
|
||||
this.getMoneyList()
|
||||
this.getMyMoney()
|
||||
}
|
||||
}
|
||||
|
||||
if (document.documentElement.scrollHeight <= document.documentElement.clientHeight) {
|
||||
bodyTag = document.getElementsByTagName('body')[0];
|
||||
bodyTag.style.height = document.documentElement.clientWidth / screen.width * screen.height + 'px';
|
||||
}
|
||||
|
||||
},
|
||||
methods: {
|
||||
appear(e, index) {
|
||||
this.current = index
|
||||
this.showControls = true
|
||||
this.isShowVideo = e
|
||||
this.scrollIntoViews = 'video' + index
|
||||
this.scrollIntoView = 'video' + index
|
||||
console.log(this.scrollIntoViews, '当前位置')
|
||||
//播放并更新video的上下文
|
||||
this.startPlay(index)
|
||||
//插入历史记录
|
||||
this.setHistor(this.videoList[index].courseId, this.videoList[index].courseDetailsId);
|
||||
this.$forceUpdate()
|
||||
/**
|
||||
* 获取金币比例
|
||||
*/
|
||||
getScale() {
|
||||
httpsRequest.getT("app/common/type/914", {}).then(res => {
|
||||
if (res.code == 0) {
|
||||
this.scale = Number(res.data.value)
|
||||
}
|
||||
});
|
||||
},
|
||||
//播放时的回掉
|
||||
videoPlay(videoId, courseDetailsId) {
|
||||
console.log(courseDetailsId)
|
||||
// this.courseDetailsId = courseDetailsId
|
||||
if (!this.playFlag) {
|
||||
this.playFlag = true
|
||||
httpsRequest.getT('app/course/viewCourse', {
|
||||
courseId: this.courseId,
|
||||
courseDetailsId: courseDetailsId,
|
||||
type: 'start'
|
||||
}).then(res => {
|
||||
console.log('播放开始')
|
||||
})
|
||||
}
|
||||
|
||||
},
|
||||
//播放进度变化回掉
|
||||
timeupdate(e) {
|
||||
// console.log(this.courseDetailsId)
|
||||
if (e.detail.currentTime > e.detail.duration * 0.9) {
|
||||
if (this.playFlag) {
|
||||
this.playFlag = false
|
||||
httpsRequest.getT('app/course/viewCourse', {
|
||||
courseId: this.courseId,
|
||||
courseDetailsId: this.courseDetailsId,
|
||||
type: 'end'
|
||||
}).then(res => {
|
||||
console.log('播放结束')
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
},
|
||||
czgwappear(e, index) {
|
||||
this.courseDetailsId = e;
|
||||
// 清除已经设置的定时器
|
||||
clearTimeout(this.appearTimeout);
|
||||
|
||||
// 设置一个新的延迟执行的定时器
|
||||
this.appearTimeout = setTimeout(() => {
|
||||
// 实际要执行的操作
|
||||
console.log('页面出现在视图中');
|
||||
// 这里可以加入你需要执行的代码
|
||||
// this.courseDetailsId = e
|
||||
this.current = index
|
||||
this.showControls = true
|
||||
this.isShowVideo = e
|
||||
this.scrollIntoViews = 'video' + index
|
||||
this.scrollIntoView = 'video' + index
|
||||
console.log(this.scrollIntoViews, '当前位置')
|
||||
//播放并更新video的上下文
|
||||
this.startPlay(index)
|
||||
//插入历史记录
|
||||
this.setHistor(this.videoList[index].courseId, this.videoList[index].courseDetailsId);
|
||||
this.$forceUpdate()
|
||||
}, 500); // 延迟500毫秒执行
|
||||
|
||||
},
|
||||
disappear(e, index) {
|
||||
|
||||
// if (this.videoContext) { //判断之前是否有视频的上下文
|
||||
// this.videoContext.stop();
|
||||
// this.videoContext = null;
|
||||
// }
|
||||
// console.log("disappear==="+index)
|
||||
// if (this.current > index) {
|
||||
// index = index + 1
|
||||
// } else {
|
||||
// index = index - 1
|
||||
// }
|
||||
// let numIdCurr = this.videoList[index].courseDetailsId;
|
||||
// if (this.videoList[index].videoUrl) { //已经购买可直接播放
|
||||
// // 播放时记录当前播放的id
|
||||
// this.czgwappear(numIdCurr, index)
|
||||
// this.videoContextId = 'myVideo' + numIdCurr;
|
||||
// this.videoContext = uni.createVideoContext(this.videoContextId, this);
|
||||
// console.log('走更新了')
|
||||
|
||||
// this.$nextTick(() => {
|
||||
// //播放当前的
|
||||
// this.videoContext.play();
|
||||
// })
|
||||
// }
|
||||
// this.$forceUpdate();
|
||||
},
|
||||
//选集弹窗的回调
|
||||
changeXj(e) {
|
||||
|
|
@ -633,15 +789,26 @@
|
|||
payClassifyId: this.wallet[this.wallCurr].payClassifyId,
|
||||
}).then(ret => {
|
||||
this.isCheckPay(ret.code, 'wxpay', JSON.stringify(ret.data));
|
||||
});
|
||||
})
|
||||
} else if (this.openWay == 1) {
|
||||
let paytype = 'h5'
|
||||
// #ifdef APP
|
||||
paytype = 'app'
|
||||
// #endif
|
||||
// APP支付宝支付
|
||||
httpsRequest.postT("/app/aliPay/payMoney", {
|
||||
classify: 1,
|
||||
payClassifyId: this.wallet[this.wallCurr].payClassifyId,
|
||||
}).then(ret => {
|
||||
console.log(ret)
|
||||
this.isCheckPay(ret.code, 'alipay', ret.data);
|
||||
console.log('nvue payType=' + paytype);
|
||||
httpsRequest.getT("/app/wuyou/payOrder/" + this.ordersId + '?payType=' + paytype, {}).then(ret => {
|
||||
// plus.runtime.openURL(ret.data.h5Url)
|
||||
|
||||
uni.navigateTo({
|
||||
url: '/pages/pays/pays?ordersId=' + this.ordersId + '&url=' + ret.data.h5Url
|
||||
});
|
||||
|
||||
// uni.navigateTo({
|
||||
// url: '/pages/index/webView?ordersId='+this.ordersId+'url=' + ret.data.h5Url
|
||||
// });
|
||||
|
||||
// this.isCheckPay(ret.code, 'wxpay', JSON.stringify(ret.data));
|
||||
});
|
||||
} else if (this.openWay == 3) {
|
||||
let userId = uni.getStorageSync('userId');
|
||||
|
|
@ -768,6 +935,22 @@
|
|||
//打开支付弹窗
|
||||
openPopusPay() {
|
||||
this.$refs.popuppay.open('bottom')
|
||||
return
|
||||
// 通过 id 获取 nvue 子窗体
|
||||
// const subNVue = uni.getSubNVueById('pay')
|
||||
// subNVue.setStyle({
|
||||
// height: '350rpx',
|
||||
// })
|
||||
// // 打开 nvue 子窗体
|
||||
// subNVue.show('slide-in-bottom', 300, function() {
|
||||
// // 打开后进行一些操作...
|
||||
// //
|
||||
// console.log('subnvue open')
|
||||
// });
|
||||
// 关闭 nvue 子窗体
|
||||
// subNVue.hide('fade-out', 300)
|
||||
|
||||
// this.$refs.refPopupZhuanPan.open('bottom')
|
||||
},
|
||||
// 获取收藏状态
|
||||
getMyLoveStatus() {
|
||||
|
|
@ -788,7 +971,8 @@
|
|||
//显示/隐藏适配控制器的回调
|
||||
controlstoggles(e) {
|
||||
this.showControls = e.detail.show
|
||||
console.log(e.detail.show, '显示/隐藏控制栏')
|
||||
this.showBack = this.showControls
|
||||
// console.log(e.detail.show, '显示/隐藏控制栏')
|
||||
},
|
||||
//打开倍速弹框
|
||||
openBs() {
|
||||
|
|
@ -816,7 +1000,7 @@
|
|||
qdCode = uni.getStorageSync('qdCode')
|
||||
}
|
||||
let url = config.APIHOST2 + '/pages/login/registerApp?invitation=' + invitationCode + '&qdCode=' + qdCode
|
||||
this.setShareNum()
|
||||
// this.setShareNum()
|
||||
uni.setClipboardData({
|
||||
data: url,
|
||||
success(res) {
|
||||
|
|
@ -858,14 +1042,22 @@
|
|||
let data = {
|
||||
courseId: this.courseId
|
||||
}
|
||||
if (type != 1) { //购买单集
|
||||
data.courseDetailsId = this.videoList[this.current].courseDetailsId
|
||||
}
|
||||
|
||||
data.courseDetailsId = this.videoList[this.current].courseDetailsId
|
||||
httpsRequest.getT('/app/order/insertCourseOrders', data).then(res => {
|
||||
if (res.code == 0) {
|
||||
this.ordersId = res.data.orders.ordersId //记录订单id
|
||||
this.payMoney = res.data.orders.payMoney //记录订单价格
|
||||
this.payOrder(res.data.orders.ordersId, res.data.orders.payMoney)
|
||||
|
||||
if (type == 1) { //金币
|
||||
this.payOrder(res.data.orders.ordersId, res.data.orders.payMoney)
|
||||
} else if (type == 2) { //支付宝
|
||||
this.closePay() //关闭购买选择弹窗
|
||||
this.payPrice = res.data.orders.payMoney //需要支付的价格
|
||||
this.openPopusPay() //显示充值弹窗
|
||||
}
|
||||
|
||||
// this.payOrder(res.data.orders.ordersId, res.data.orders.payMoney)
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
|
|
@ -876,44 +1068,58 @@
|
|||
},
|
||||
payOrder(orderId, payMoney) {
|
||||
let that = this
|
||||
console.log("orderId==" + orderId)
|
||||
httpsRequest.postT("/app/order/payOrders", {
|
||||
orderId: orderId,
|
||||
}).then(res => {
|
||||
if (res.code == 0) {
|
||||
uni.hideLoading()
|
||||
uni.showToast({
|
||||
title: '已解锁,支付' + payMoney + '金币',
|
||||
title: '已成功解锁',
|
||||
icon: 'none'
|
||||
})
|
||||
this.closePopusPay()
|
||||
this.closePay()
|
||||
that.showPay = false
|
||||
that.showMoney = false
|
||||
that.noBuyVideoIndex = null
|
||||
setTimeout(() => {
|
||||
that.getDataList(that.courseId, that.videoList[that.current].courseDetailsId,
|
||||
true);
|
||||
}, 1000)
|
||||
|
||||
} else { //支付失败(余额不足)
|
||||
that.closePay() //关闭购买选择弹窗
|
||||
this.payPrice = payMoney //需要支付的价格
|
||||
this.openPopusPay() //显示充值弹窗
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
icon: 'none'
|
||||
})
|
||||
that.showPay = true
|
||||
that.showMoney = false
|
||||
// that.closePay() //关闭购买选择弹窗
|
||||
// this.payPrice = payMoney //需要支付的价格
|
||||
// this.openPopusPay() //显示充值弹窗
|
||||
}
|
||||
});
|
||||
},
|
||||
//打开购买弹窗
|
||||
openPay() {
|
||||
//获取总价跟单集价格
|
||||
|
||||
this.zongPrice = this.info.price
|
||||
this.countPrice = this.videoList[this.current].price
|
||||
this.$refs.popupPya.open('bottom')
|
||||
this.noBuyVideoIndex = this.current
|
||||
uni.setStorageSync('noBuyVideoIndex', this.current)
|
||||
},
|
||||
//关闭购买弹窗
|
||||
closePay() {
|
||||
this.$refs.popupPya.close()
|
||||
},
|
||||
//选择播放
|
||||
selectPlay(item) {
|
||||
selectPlay(item,type) {
|
||||
if ( this.videoList[this.current].videoUrl == '' && this.videoList[this.current].price <= 0 && !type ) {
|
||||
this.getDataList(this.courseId, this.courseDetailsId, true, 'select')
|
||||
return;
|
||||
}
|
||||
//重新计算一下当前观看的是哪个视频
|
||||
this.comNumVideo()
|
||||
//滚动到选择的位置
|
||||
|
|
@ -1016,6 +1222,7 @@
|
|||
this.$nextTick(() => {
|
||||
//播放当前的
|
||||
this.videoContext.play();
|
||||
this.videoContext.playbackRate(this.subList[this.nowBs].num)
|
||||
})
|
||||
} else { //没有视频链接则表示没有权限,需要购买 弹出购买弹窗
|
||||
this.openPay()
|
||||
|
|
@ -1028,22 +1235,35 @@
|
|||
},
|
||||
//滚动到指定位置
|
||||
goListPosition(courseDetailsId) {
|
||||
let _this = this;
|
||||
// this.scrollIntoViews = 'video0'
|
||||
this.$nextTick(() => {
|
||||
// setTimeout(()=>{
|
||||
console.log(courseDetailsId, '开始移动了')
|
||||
const el = this.$refs['list' + courseDetailsId][0]
|
||||
const el = _this.$refs['list' + courseDetailsId][0]
|
||||
listDom.scrollToElement(el, {
|
||||
animated: false
|
||||
})
|
||||
this.$forceUpdate()
|
||||
console.log(el, '移动结束')
|
||||
_this.$forceUpdate()
|
||||
console.log('移动结束', el)
|
||||
// },1000)
|
||||
})
|
||||
},
|
||||
async getCount() {
|
||||
console.log('getCount')
|
||||
const res = await this.$Request.getT('app/discSpinning/drawCount')
|
||||
if (res.code == 0) {
|
||||
this.freeNum = res.count || 0
|
||||
}
|
||||
console.log(res);
|
||||
return res
|
||||
},
|
||||
/**
|
||||
* @param {Number} courseId 总id
|
||||
* @param {Number} courseDetailsId 当前视频id
|
||||
* @param {boolean} type 是购买后返回的还是直接进来的
|
||||
*/
|
||||
getDataList(courseId, courseDetailsId, type) {
|
||||
getDataList(courseId, courseDetailsId, type, t) {
|
||||
let data = {
|
||||
id: courseId,
|
||||
token: uni.getStorageSync('token') ? uni.getStorageSync('token') : ''
|
||||
|
|
@ -1057,7 +1277,10 @@
|
|||
const indexs = arr.findIndex(menu => menu.courseDetailsId ===
|
||||
Number(courseDetailsId));
|
||||
this.current = indexs
|
||||
this.scrollIntoViews = 'video' + indexs
|
||||
this.scrollIntoView = 'video' + indexs
|
||||
console.log(this.current)
|
||||
// this.scrollIntoView = 'video' + indexs
|
||||
arr.map((item, index) => {
|
||||
item.num = index + 1;
|
||||
if (item.videoUrl) {
|
||||
|
|
@ -1070,6 +1293,7 @@
|
|||
//菜单数组
|
||||
this.meunList = arr;
|
||||
if (type == true) { //购买视频后返回的
|
||||
console.log('购买视频后返回的')
|
||||
let courseDetailsIds = this.videoList[this.current].courseDetailsId;
|
||||
this.meunList.some((item) => {
|
||||
if (item.courseDetailsId == courseDetailsIds) {
|
||||
|
|
@ -1085,30 +1309,74 @@
|
|||
}
|
||||
})
|
||||
})
|
||||
|
||||
if (this.noBuyVideoIndex !== null && this.videoList[this
|
||||
.noBuyVideoIndex].videoUrl) {
|
||||
this.noBuyVideoIndex = null
|
||||
uni.removeStorageSync('noBuyVideoIndex')
|
||||
this.videoContext.stop()
|
||||
httpsRequest.getT('app/discSpinning/drawCount').then(res => {
|
||||
console.log('转盘抽奖次数')
|
||||
console.log(res)
|
||||
if (res.count >= 1) {
|
||||
uni.navigateTo({
|
||||
url: '/me/VjgyqAzklr/VjgyqAzklr'
|
||||
})
|
||||
} else {
|
||||
this.videoContext.play();
|
||||
}
|
||||
})
|
||||
}
|
||||
// console.log('this.noBuyVideoIndex', this.noBuyVideoIndex)
|
||||
|
||||
} else { //直接跳转进来的
|
||||
this.videoList = this.meunList
|
||||
//滚动到记录视频的位置(如果有记录)
|
||||
if (indexs > 0) {
|
||||
console.log(indexs, '有记录吗?')
|
||||
this.goListPosition(this.videoList[indexs].courseDetailsId)
|
||||
}
|
||||
this.$nextTick(() => {
|
||||
let indexss = indexs > 0 ? indexs : 0
|
||||
//滚动到记录视频的位置(如果有记录)
|
||||
if (indexs > 0) {
|
||||
console.log(indexs, '有记录吗?')
|
||||
this.goListPosition(this.videoList[indexs].courseDetailsId)
|
||||
}
|
||||
// console.log('this.noBuyVideoIndex', this.noBuyVideoIndex)
|
||||
|
||||
if (this.videoList[indexss].videoUrl) { //有播放权限
|
||||
console.log('有播放权限进入是否抽取转盘判断')
|
||||
let numIdCurr = this.videoList[indexss].courseDetailsId;
|
||||
this.videoContextId = 'myVideo' + numIdCurr;
|
||||
this.videoContext = uni.createVideoContext(this
|
||||
.videoContextId,
|
||||
this);
|
||||
this.videoContext.play();
|
||||
if (this.noBuyVideoIndex != null && this.videoList[this
|
||||
.noBuyVideoIndex].videoUrl) {
|
||||
this.videoContext.stop();
|
||||
httpsRequest.getT('app/discSpinning/drawCount').then(res => {
|
||||
console.log('转盘抽奖次数')
|
||||
if (res.count >= 1) {
|
||||
uni.navigateTo({
|
||||
url: '/me/VjgyqAzklr/VjgyqAzklr'
|
||||
})
|
||||
} else {
|
||||
this.videoContext.play();
|
||||
}
|
||||
})
|
||||
uni.removeStorageSync('noBuyVideoIndex')
|
||||
this.noBuyVideoIndex = null
|
||||
} else {
|
||||
this.videoContext.play();
|
||||
}
|
||||
} else { //没有播放权限打开购买弹窗
|
||||
this.openPay()
|
||||
}
|
||||
this.$forceUpdate();
|
||||
})
|
||||
}
|
||||
|
||||
if ( t == 'select') {
|
||||
this.selectPlay(this.videoList[this.current],true)
|
||||
}
|
||||
this.$forceUpdate();
|
||||
}
|
||||
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: '加载失败',
|
||||
|
|
@ -1562,34 +1830,34 @@
|
|||
background-color: #000;
|
||||
}
|
||||
|
||||
.swipers {
|
||||
.detailswipers {
|
||||
width: 750rpx;
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.swipers-item {
|
||||
.detailswipers-item {
|
||||
width: 750rpx;
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.swipers-items {
|
||||
.subNvueweightswipers-items {
|
||||
width: 750rpx;
|
||||
flex: 1;
|
||||
position: relative;
|
||||
background-color: #000;
|
||||
}
|
||||
|
||||
.swipers-items-video {
|
||||
.detailswipers-items-video {
|
||||
width: 750rpx;
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.swipers-items-imgsbg {
|
||||
.detailswipers-items-imgsbg {
|
||||
width: 750rpx;
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.swipers-items-back {
|
||||
.detailswipers-items-back {
|
||||
position: absolute;
|
||||
left: 40rpx;
|
||||
top: 120rpx;
|
||||
|
|
@ -1598,40 +1866,40 @@
|
|||
z-index: 999;
|
||||
}
|
||||
|
||||
.swipers-items-right {
|
||||
.detailswipers-items-right {
|
||||
position: absolute;
|
||||
width: 60rpx;
|
||||
top: 100rpx;
|
||||
right: 20rpx;
|
||||
}
|
||||
|
||||
.swipers-items-right-item {
|
||||
.detailswipers-items-right-item {
|
||||
width: 60rpx;
|
||||
margin-bottom: 40rpx;
|
||||
}
|
||||
|
||||
.swipers-items-right-item-img {
|
||||
.detailswipers-items-right-item-img {
|
||||
width: 60rpx;
|
||||
height: 60rpx;
|
||||
}
|
||||
|
||||
.swipers-items-right-item-imgs {
|
||||
.detailswipers-items-right-item-imgs {
|
||||
width: 60rpx;
|
||||
height: 60rpx;
|
||||
}
|
||||
|
||||
.swipers-items-right-item-txt {
|
||||
.detaswipers-items-right-item-txt {
|
||||
width: 60rpx;
|
||||
}
|
||||
|
||||
.swipers-items-right-item-txts {
|
||||
.detaswipers-items-right-item-txts {
|
||||
width: 60rpx;
|
||||
color: #ffffff;
|
||||
font-size: 24rpx;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.swipers-items-btom {
|
||||
.detaswipers-items-btom {
|
||||
width: 750rpx;
|
||||
let: 0;
|
||||
position: absolute;
|
||||
|
|
@ -1640,7 +1908,7 @@
|
|||
/* transition-duration: 1s, */
|
||||
}
|
||||
|
||||
.swipers-items-btom-box {
|
||||
.detaswipers-items-btom-box {
|
||||
width: 710rpx;
|
||||
}
|
||||
|
||||
|
|
|
|||
3645
me/detail/detail.vue
|
|
@ -1,21 +1,23 @@
|
|||
<template>
|
||||
<view class="detail">
|
||||
<swiper @longpress="openBs()" :circular="true" class="swipers" @change="change" :current="current"
|
||||
<view class="subNvuedetail" :style="{paddingBottom:paddingBottom}">
|
||||
<swiper @longpress="openBs()" :circular="true" class="swipersas" @change="change" :current="current"
|
||||
:vertical="true" :indicator-dots="false" :autoplay="false" :interval="3000" :duration="300">
|
||||
<swiper-item class="swipers-item" v-for="(item,index) in swiperList" :key="item.courseDetailsId">
|
||||
<view class="swipers-items" v-if="current == index">
|
||||
<swiper-item class="swipersasda" v-for="(item,index) in swiperList" :key="item.courseDetailsId">
|
||||
<view class="swipersasts" v-if="current == index">
|
||||
<!-- 视频 -->
|
||||
<video :show-fullscreen-btn="false" @controlstoggle="controlstoggles" object-fit="cover"
|
||||
<video :show-fullscreen-btn="false" @controlstoggle="controlStoggles" object-fit="contain"
|
||||
v-if="current === index && item.videoUrl" :play-strategy="2" :show-loading="true"
|
||||
codec="software" :muted="false" :show-center-play-btn="true" :loop="true" @ended="ended"
|
||||
@timeupdate="timeupdate" @play="videoPlay('myVideo'+item.courseDetailsId, item.courseDetailsId)"
|
||||
:enable-progress-gesture="false" :poster="item.titleImg" :ref="'myVideo'+item.courseDetailsId"
|
||||
:id="'myVideo'+item.courseDetailsId" :src="item.videoUrl" :autoplay="item.autoPlay"
|
||||
class="swipers-items-video"></video>
|
||||
<image v-else @click="!item.videoUrl?openPay():''" :src="item.titleImg" class="swipers-items-imgsbg"
|
||||
class="swipersastqw"></video>
|
||||
<image v-else @click="!item.videoUrl?openPay():''" :src="item.titleImg" class="swipers-items-imgsbgwq"
|
||||
mode="aspectFill">
|
||||
</image>
|
||||
<!-- 返回图标 -->
|
||||
<image src="../static/nvueIcon/backs.png" @click="goBack()" class="swipers-items-back" mode="">
|
||||
<image v-if="showBack" src="../static/nvueIcon/backs.png" @click="goBack()"
|
||||
class="swipers-items-back" mode="">
|
||||
</image>
|
||||
<!-- 右边操作 -->
|
||||
<view class="swipers-items-right" :style="rightTop" v-if="showControls">
|
||||
|
|
@ -44,7 +46,7 @@
|
|||
</view>
|
||||
</view>
|
||||
<view class="swipers-items-right-item" v-if="isCollect">
|
||||
<view class="swipers-items-right-item-img" @click.stop="shoucang()">
|
||||
<view class="swipers-items-right-item-img" @click.stop="collectVideo()">
|
||||
<image class="swipers-items-right-item-imgs" src="../../static/images/me/shuqian_s.png"
|
||||
mode=""></image>
|
||||
</view>
|
||||
|
|
@ -55,7 +57,7 @@
|
|||
</view>
|
||||
</view>
|
||||
<view class="swipers-items-right-item" v-else>
|
||||
<view class="swipers-items-right-item-img" @click.stop="shoucang()">
|
||||
<view class="swipers-items-right-item-img" @click.stop="collectVideo()">
|
||||
<image class="swipers-items-right-item-imgs" src="../../static/images/me/shuqian.png"
|
||||
mode=""></image>
|
||||
</view>
|
||||
|
|
@ -101,7 +103,7 @@
|
|||
<text class="list-title-lsn">共{{meunList.length}}集</text>
|
||||
</view>
|
||||
<view class="list-title-r" @click="closeList()">
|
||||
<image class="list-title-rs" src="../../static/images/me/closeIconss.png" mode=""></image>
|
||||
<image class="list-title-rsczg" src="../../static/images/me/closeIconss.png" mode=""></image>
|
||||
</view>
|
||||
</view>
|
||||
<view class="list-content">
|
||||
|
|
@ -138,27 +140,31 @@
|
|||
</text>
|
||||
</view>
|
||||
<view class="list-title-r" @click="closePay()">
|
||||
<image class="list-title-rs" src="../../static/images/me/closeIconss.png" mode=""></image>
|
||||
<image class="list-title-rsczg" src="../../static/images/me/closeIconss.png" mode=""></image>
|
||||
</view>
|
||||
</view>
|
||||
<text class=""
|
||||
style="font-size: 24rpx;color: #999;padding: 0 34rpx;margin: 20rpx 0; auto;text-align: left;width: 100%;">
|
||||
{{getRedEnvelopeTips}}
|
||||
</text>
|
||||
<view class="pay-content">
|
||||
<view class="pay-content-item" @click="payVideo(1)" v-if="zhengbu === '是'">
|
||||
<image class="pay-content-item-icon" src="../../static/images/me/rmIcon.png" mode=""></image>
|
||||
<view class="pay-content-itemczg" @click="payVideo(1)">
|
||||
<image class="pay-content-item-iconczg" src="../../static/images/me/rmIcon.png" mode=""></image>
|
||||
<text class="pay-content-items">
|
||||
{{zongPrice}}金豆解锁整部视频
|
||||
{{countPrice*scale}}金币解锁整部视频
|
||||
</text>
|
||||
</view>
|
||||
<view class="pay-content-item" @click="payVideo(2)" v-if="danbu === '是'">
|
||||
<view v-if="isShowMoneyPay" class="pay-content-itemczg" @click="payVideo(2)">
|
||||
<text class="pay-content-items">
|
||||
{{countPrice}}金豆解锁单集视频
|
||||
{{countPrice}}元解锁单集视频
|
||||
</text>
|
||||
</view>
|
||||
<view class="pay-content-item" @click="goNav('/pages/me/vip/index')" v-if="isVips == '是'">
|
||||
<image class="pay-content-item-icon" src="../../static/images/me/rmIcon.png" mode=""></image>
|
||||
<!-- <view class="pay-content-itemczg" @click="goNav('/pages/me/vip/index')" v-if="isVips == '是'">
|
||||
<image class="pay-content-item-iconczg" src="../../static/images/me/rmIcon.png" mode=""></image>
|
||||
<text class="pay-content-items">
|
||||
开通会员
|
||||
</text>
|
||||
</view>
|
||||
</view> -->
|
||||
|
||||
</view>
|
||||
</view>
|
||||
|
|
@ -182,17 +188,17 @@
|
|||
<text class="popuppay-title-l">
|
||||
购买后继续观看
|
||||
</text>
|
||||
<image @click="closePopusPay()" class="popuppay-title-r"
|
||||
<image @click="closePopupPay()" class="popuppay-title-r"
|
||||
src="../../static/images/me/closeIconss.png" mode=""></image>
|
||||
</view>
|
||||
<!-- 余额 -->
|
||||
<view class="popuppay-money">
|
||||
<!-- <view class="popuppay-money">
|
||||
<view class="popuppay-money-l">
|
||||
<text class="popuppay-money-l-ye">
|
||||
账号余额:
|
||||
</text>
|
||||
<text class="popuppay-money-l-jd">
|
||||
{{moneyNum}}金豆
|
||||
{{moneyNum}}金币
|
||||
</text>
|
||||
<text class="popuppay-money-l-mx" @click="goWallet('/me/wallet/wallet')">
|
||||
查看明细
|
||||
|
|
@ -203,12 +209,12 @@
|
|||
解锁价格:
|
||||
</text>
|
||||
<text class="popuppay-money-jd">
|
||||
{{payPrice}}金豆
|
||||
{{payPrice}}金币
|
||||
</text>
|
||||
</view>
|
||||
</view>
|
||||
</view> -->
|
||||
<!-- 充值类型列表 -->
|
||||
<scroll-view scroll-y="true" class="payLists">
|
||||
<!-- <scroll-view scroll-y="true" class="payLists">
|
||||
<view class="popuppay-payList">
|
||||
<view class="payList-item" @click="wallCurr = index" :class="wallCurr == index?'activePrice':''"
|
||||
v-for="(item,index) in wallet" :key="index">
|
||||
|
|
@ -220,12 +226,12 @@
|
|||
</view>
|
||||
<view class="payList-item-dou">
|
||||
<text class="payList-item-dous">
|
||||
{{item.money}}金豆
|
||||
{{item.money}}金币
|
||||
</text>
|
||||
</view>
|
||||
<view class="payList-item-duo" v-if="item.giveMoney>0">
|
||||
<text class="payList-item-duos">
|
||||
多送{{item.giveMoney}}金豆
|
||||
多送{{item.giveMoney}}金币
|
||||
</text>
|
||||
</view>
|
||||
<view class="payList-item-hui" v-if="item.remarks">
|
||||
|
|
@ -235,7 +241,7 @@
|
|||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</scroll-view> -->
|
||||
<!-- 支付类型 -->
|
||||
<view class="payType">
|
||||
<view class="payType-item" @tap='selectWay(item)' v-for="(item,index) in openLists" :key="index">
|
||||
|
|
@ -298,6 +304,7 @@
|
|||
export default {
|
||||
data() {
|
||||
return {
|
||||
showBack: true,
|
||||
nowBs: 1, //当前倍速
|
||||
subList: [{
|
||||
name: '0.5x',
|
||||
|
|
@ -358,6 +365,11 @@
|
|||
payPrice: 0, //解锁价格
|
||||
iosPayId: '',
|
||||
isCollect: false,
|
||||
playFlag: false,
|
||||
getRedEnvelopeTips: '',
|
||||
scale: 1,
|
||||
paddingBottom: '0',
|
||||
isShowMoneyPay: true,
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
|
|
@ -385,7 +397,7 @@
|
|||
this.isVips = uni.getStorageSync('isVips') ? uni.getStorageSync('isVips') : '否'
|
||||
let that = this
|
||||
uni.$on('back', (data) => {
|
||||
if (data.flag == true) {
|
||||
if (data.flag) {
|
||||
that.showPay = false
|
||||
that.getDataList(that.courseId, that.courseDetailsId, true);
|
||||
that.getMyLoveStatus()
|
||||
|
|
@ -396,58 +408,97 @@
|
|||
this.moneyTips = uni.getStorageSync('moneyTips')
|
||||
// #ifdef APP-PLUS
|
||||
if (plus.os.name.toLowerCase() === 'android') {
|
||||
this.openLists = [{
|
||||
image: '/static/images/pay/weixin.png',
|
||||
text: '微信',
|
||||
id: 2
|
||||
}, {
|
||||
image: '/static/images/pay/zhifubao.png',
|
||||
text: '支付宝',
|
||||
id: 1
|
||||
}];
|
||||
this.openWay = 2;
|
||||
let syPaySel = uni.getStorageSync('syPaySel')
|
||||
if (syPaySel === '是') {
|
||||
let openListsItem = {
|
||||
image: '/static/images/pay/shouyi.png',
|
||||
text: '收益余额',
|
||||
id: 4
|
||||
};
|
||||
this.openLists.push(openListsItem)
|
||||
}
|
||||
} else {
|
||||
let checkIosPay = uni.getStorageSync('checkIosPay');
|
||||
if (checkIosPay === '是') {
|
||||
this.openLists = [{
|
||||
image: '/static/images/pay/weixin.png',
|
||||
text: '苹果',
|
||||
id: 3
|
||||
}];
|
||||
this.openWay = 3;
|
||||
} else {
|
||||
this.openLists = [{
|
||||
image: '/static/images/pay/weixin.png',
|
||||
text: '微信',
|
||||
id: 2
|
||||
}, {
|
||||
this.openLists = [
|
||||
// {
|
||||
// image: '/static/images/pay/weixin.png',
|
||||
// text: '微信',
|
||||
// id: 2
|
||||
// },
|
||||
{
|
||||
image: '/static/images/pay/zhifubao.png',
|
||||
text: '支付宝',
|
||||
id: 1
|
||||
}];
|
||||
this.openWay = 2;
|
||||
let syPaySel = uni.getStorageSync('syPaySel')
|
||||
if (syPaySel === '是') {
|
||||
let openListsItem = {
|
||||
image: '/static/images/pay/shouyi.png',
|
||||
text: '收益余额',
|
||||
id: 4
|
||||
};
|
||||
this.openLists.push(openListsItem)
|
||||
}
|
||||
}
|
||||
},
|
||||
];
|
||||
this.openWay = 1;
|
||||
let syPaySel = uni.getStorageSync('syPaySel')
|
||||
// if (syPaySel === '是') {
|
||||
// let openListsItem = {
|
||||
// image: '/static/images/pay/shouyi.png',
|
||||
// text: '收益余额',
|
||||
// id: 4
|
||||
// };
|
||||
// this.openLists.push(openListsItem)
|
||||
// }
|
||||
} else {
|
||||
let checkIosPay = uni.getStorageSync('checkIosPay');
|
||||
// if (checkIosPay === '是') {
|
||||
// this.openLists = [{
|
||||
// image: '/static/images/pay/weixin.png',
|
||||
// text: '苹果',
|
||||
// id: 3
|
||||
// }];
|
||||
// this.openWay = 3;
|
||||
// } else {
|
||||
this.openLists = [
|
||||
// {
|
||||
// image: '/static/images/pay/weixin.png',
|
||||
// text: '微信',
|
||||
// id: 2
|
||||
// },
|
||||
{
|
||||
image: '/static/images/pay/zhifubao.png',
|
||||
text: '支付宝',
|
||||
id: 1
|
||||
},
|
||||
];
|
||||
this.openWay = 1;
|
||||
let syPaySel = uni.getStorageSync('syPaySel')
|
||||
// if (syPaySel === '是') {
|
||||
// let openListsItem = {
|
||||
// image: '/static/images/pay/shouyi.png',
|
||||
// text: '收益余额',
|
||||
// id: 4
|
||||
// };
|
||||
// this.openLists.push(openListsItem)
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
// #endif
|
||||
this.$nextTick(() => {
|
||||
this.closePopupPay()
|
||||
})
|
||||
if (this.courseId) {
|
||||
this.getDataList(this.courseId, this.courseDetailsId);
|
||||
|
||||
}
|
||||
httpsRequest.getT('app/course/getRedEnvelopeTips').then(res => {
|
||||
if (res.code === 0) {
|
||||
this.getRedEnvelopeTips = res.data
|
||||
}
|
||||
})
|
||||
this.getScale()
|
||||
|
||||
const sysInfo = uni.getSystemInfoSync()
|
||||
console.log(sysInfo);
|
||||
const padB = sysInfo.safeAreaInsets.bottom;
|
||||
console.log('win height == ' + padB);
|
||||
if (padB && padB > 0) {
|
||||
this.paddingBottom = padB + 'px'
|
||||
} else {
|
||||
this.paddingBottom = '0'
|
||||
}
|
||||
|
||||
console.log('this bottom padding = ' + this.paddingBottom);
|
||||
|
||||
httpsRequest.getT("app/common/type/919", {}).then(res => {
|
||||
if (res.code === 0) {
|
||||
const sysInfo = uni.getSystemInfoSync();
|
||||
let isIos = sysInfo.platform == 'ios'
|
||||
this.isShowMoneyPay = !(res.data.value == '1' && isIos)
|
||||
}
|
||||
});
|
||||
},
|
||||
onLoad(e) {
|
||||
let that = this
|
||||
|
|
@ -472,16 +523,57 @@
|
|||
if (e.courseDetailsId) {
|
||||
this.courseDetailsId = e.courseDetailsId;
|
||||
}
|
||||
this.getDataList(this.courseId, this.courseDetailsId);
|
||||
this.getMyLoveStatus()
|
||||
this.getMoneyList()
|
||||
this.getMyMoney()
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
/**
|
||||
* 获取金币比例
|
||||
*/
|
||||
getScale() {
|
||||
httpsRequest.getT("app/common/type/914", {}).then(res => {
|
||||
if (res.code === 0) {
|
||||
this.scale = Number(res.data.value)
|
||||
}
|
||||
});
|
||||
},
|
||||
//播放时的回掉
|
||||
videoPlay(videoId, courseDetailsId) {
|
||||
this.courseDetailsId = courseDetailsId
|
||||
if (!this.playFlag) {
|
||||
this.playFlag = true
|
||||
httpsRequest.getT('app/course/viewCourse', {
|
||||
courseId: this.courseId,
|
||||
courseDetailsId: courseDetailsId,
|
||||
type: 'start'
|
||||
}).then(res => {
|
||||
console.log('播放开始')
|
||||
})
|
||||
}
|
||||
|
||||
},
|
||||
//播放进度变化回掉
|
||||
timeupdate(e) {
|
||||
|
||||
if (e.detail.currentTime > e.detail.duration * 0.9) {
|
||||
if (this.playFlag) {
|
||||
this.playFlag = false
|
||||
httpsRequest.getT('app/course/viewCourse', {
|
||||
courseId: this.courseId,
|
||||
courseDetailsId: this.courseDetailsId,
|
||||
type: 'end'
|
||||
}).then(res => {
|
||||
console.log('播放结束')
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
},
|
||||
//选集弹窗的回调
|
||||
changeXj(e) {
|
||||
if (e.show == false) {
|
||||
if (!e.show) {
|
||||
//关闭弹窗的时候重置scrollIntoViews,防止关闭后第二次点就不能自动滑动到当前集的位置
|
||||
this.scrollIntoViews = 'video0'
|
||||
}
|
||||
|
|
@ -522,7 +614,7 @@
|
|||
});
|
||||
},
|
||||
isCheckPay(status, name, order) {
|
||||
if (status == 0) {
|
||||
if (status === 0) {
|
||||
this.setPayment(name, order);
|
||||
} else {
|
||||
uni.hideLoading();
|
||||
|
|
@ -532,7 +624,7 @@
|
|||
});
|
||||
}
|
||||
},
|
||||
iphonepay() {
|
||||
iphonePay() {
|
||||
let that = this
|
||||
plus.payment.getChannels((res) => {
|
||||
let channel = res.find(i => i.id === 'appleiap')
|
||||
|
|
@ -588,7 +680,7 @@
|
|||
httpsRequest.postT('/app/ios/isoPayApp?receipt=' + receipt + '&ordersId=' + that.iosPayId).then(
|
||||
res => {
|
||||
uni.hideLoading();
|
||||
if (res.status == 0) {
|
||||
if (res.status === 0) {
|
||||
uni.showToast({
|
||||
title: '支付成功',
|
||||
duration: 2000,
|
||||
|
|
@ -600,7 +692,7 @@
|
|||
},
|
||||
// 充值
|
||||
pay() {
|
||||
if (this.checked == false) {
|
||||
if (!this.checked) {
|
||||
uni.showToast({
|
||||
title: '请阅读并同意《付费须知说明》',
|
||||
icon: 'none'
|
||||
|
|
@ -611,7 +703,7 @@
|
|||
uni.showLoading({
|
||||
title: '支付中...'
|
||||
})
|
||||
if (this.openWay == 2) {
|
||||
if (this.openWay === 2) {
|
||||
// 微信APP支付 根据订单id获取支付信息
|
||||
httpsRequest.postT("/app/wxPay/payMoney", {
|
||||
classify: 1,
|
||||
|
|
@ -619,16 +711,20 @@
|
|||
}).then(ret => {
|
||||
this.isCheckPay(ret.code, 'wxpay', JSON.stringify(ret.data));
|
||||
});
|
||||
} else if (this.openWay == 1) {
|
||||
} else if (this.openWay === 1) {
|
||||
let paytype = 'h5'
|
||||
// #ifdef APP
|
||||
paytype = 'app'
|
||||
// #endif
|
||||
// APP支付宝支付
|
||||
httpsRequest.postT("/app/aliPay/payMoney", {
|
||||
classify: 1,
|
||||
payClassifyId: this.wallet[this.wallCurr].payClassifyId,
|
||||
}).then(ret => {
|
||||
console.log(ret)
|
||||
this.isCheckPay(ret.code, 'alipay', ret.data);
|
||||
httpsRequest.getT("/app/wuyou/payOrder/" + this.ordersId + '?payType=' + paytype, {}).then(ret => {
|
||||
// plus.runtime.openURL(ret.data.h5Url)
|
||||
uni.navigateTo({
|
||||
url: '/pages/pays/pays?ordersId=' + this.ordersId + '&url=' + ret.data.h5Url
|
||||
});
|
||||
// this.isCheckPay(ret.code, 'wxpay', JSON.stringify(ret.data));
|
||||
});
|
||||
} else if (this.openWay == 3) {
|
||||
} else if (this.openWay === 3) {
|
||||
let userId = uni.getStorageSync('userId');
|
||||
let data = {
|
||||
payClassifyId: this.wallet[this.wallCurr].payClassifyId,
|
||||
|
|
@ -645,7 +741,7 @@
|
|||
});
|
||||
}
|
||||
});
|
||||
} else if (this.openWay == 4) {
|
||||
} else if (this.openWay === 4) {
|
||||
let userId = uni.getStorageSync('userId');
|
||||
let data = {
|
||||
// money: this.wallet[this.current].price
|
||||
|
|
@ -675,7 +771,7 @@
|
|||
getMyMoney() {
|
||||
if (uni.getStorageSync('token')) {
|
||||
httpsRequest.getT('/app/moneyDetails/selectUserMoney').then(res => {
|
||||
if (res.code == 0) {
|
||||
if (res.code === 0) {
|
||||
this.moneyNum = res.data.money
|
||||
}
|
||||
})
|
||||
|
|
@ -729,7 +825,7 @@
|
|||
*/
|
||||
getMoneyList() {
|
||||
httpsRequest.getT('/app/payClassify/selectPayClassifyList').then(res => {
|
||||
if (res.code == 0) {
|
||||
if (res.code === 0) {
|
||||
let priceObj = this.findMinMaxPricesWithIndexes(res.data)
|
||||
this.wallet = res.data
|
||||
this.wallet[priceObj.minPriceIndex].remarks = '特惠'
|
||||
|
|
@ -746,7 +842,7 @@
|
|||
this.wallet = arr
|
||||
}
|
||||
// #ifdef APP
|
||||
this.iphonepay()
|
||||
this.iphonePay()
|
||||
// #endif
|
||||
} else {
|
||||
uni.showToast({
|
||||
|
|
@ -757,11 +853,11 @@
|
|||
})
|
||||
},
|
||||
//关闭支付弹窗
|
||||
closePopusPay() {
|
||||
closePopupPay() {
|
||||
this.$refs.popuppay.close()
|
||||
},
|
||||
//打开支付弹窗
|
||||
openPopusPay() {
|
||||
openPopupPay() {
|
||||
this.$refs.popuppay.open('bottom')
|
||||
},
|
||||
// 获取收藏状态
|
||||
|
|
@ -781,8 +877,9 @@
|
|||
})
|
||||
},
|
||||
//显示/隐藏适配控制器的回调
|
||||
controlstoggles(e) {
|
||||
controlStoggles(e) {
|
||||
this.showControls = e.detail.show
|
||||
this.showBack = this.showControls
|
||||
console.log(e.detail.show, '显示/隐藏控制栏')
|
||||
},
|
||||
//打开倍速弹框
|
||||
|
|
@ -856,19 +953,28 @@
|
|||
})
|
||||
}
|
||||
},
|
||||
//使用金豆购买
|
||||
//使用金币购买
|
||||
submitPay(type) {
|
||||
let data = {
|
||||
courseId: this.courseId
|
||||
}
|
||||
if (type != 1) { //购买单集
|
||||
data.courseDetailsId = this.videoList[this.current].courseDetailsId
|
||||
}
|
||||
|
||||
data.courseDetailsId = this.videoList[this.current].courseDetailsId
|
||||
httpsRequest.getT('/app/order/insertCourseOrders', data).then(res => {
|
||||
if (res.code == 0) {
|
||||
if (res.code === 0) {
|
||||
this.ordersId = res.data.orders.ordersId //记录订单id
|
||||
this.payMoney = res.data.orders.payMoney //记录订单价格
|
||||
this.payOrder(res.data.orders.ordersId, res.data.orders.payMoney)
|
||||
|
||||
if (type === 1) { //金币
|
||||
this.payOrder(res.data.orders.ordersId, res.data.orders.payMoney)
|
||||
} else if (type === 2) { //支付宝
|
||||
this.closePay() //关闭购买选择弹窗
|
||||
this.payPrice = res.data.orders.payMoney //需要支付的价格
|
||||
this.openPopupPay() //显示充值弹窗
|
||||
}
|
||||
|
||||
|
||||
// this.payOrder(res.data.orders.ordersId, res.data.orders.payMoney)
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
|
|
@ -882,25 +988,30 @@
|
|||
httpsRequest.postT("/app/order/payOrders", {
|
||||
orderId: orderId,
|
||||
}).then(res => {
|
||||
if (res.code == 0) {
|
||||
if (res.code === 0) {
|
||||
uni.hideLoading()
|
||||
uni.showToast({
|
||||
title: '已解锁,支付' + payMoney + '金豆',
|
||||
title: '已成功解锁',
|
||||
icon: 'none'
|
||||
})
|
||||
this.closePopusPay()
|
||||
this.closePopupPay()
|
||||
this.closePay()
|
||||
that.showPay = false
|
||||
that.showMoney = false
|
||||
that.noBuyVideoIndex = null
|
||||
|
||||
setTimeout(() => {
|
||||
that.getDataList(that.courseId, that.videoList[that.current].courseDetailsId,
|
||||
true);
|
||||
}, 1000)
|
||||
|
||||
} else { //支付失败(余额不足)
|
||||
that.closePay() //关闭购买选择弹窗
|
||||
this.payPrice = payMoney //需要支付的价格
|
||||
this.openPopusPay() //显示充值弹窗
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
icon: 'none'
|
||||
})
|
||||
that.showPay = true
|
||||
that.showMoney = false
|
||||
}
|
||||
});
|
||||
},
|
||||
|
|
@ -925,7 +1036,7 @@
|
|||
this.videoList = [...this.videoList, ...this.meunList.slice(index + 1, index + 3)]
|
||||
}
|
||||
//只剩一条数据
|
||||
if (lengths == 1) {
|
||||
if (lengths === 1) {
|
||||
//把剩下的一条给放进去
|
||||
this.videoList = [
|
||||
//选中的那条
|
||||
|
|
@ -937,7 +1048,7 @@
|
|||
]
|
||||
}
|
||||
//选择的就是最后一条数据
|
||||
if (lengths == 0) {
|
||||
if (lengths === 0) {
|
||||
//后两条拿总数组的前两条就可以了
|
||||
this.videoList = [...this.videoList, ...this.meunList.slice(0, 2)]
|
||||
}
|
||||
|
|
@ -945,11 +1056,15 @@
|
|||
this.$forceUpdate()
|
||||
},
|
||||
//选择播放
|
||||
selectPlay(item, index) {
|
||||
selectPlay(item, index, type) {
|
||||
// 根据选择的courseDetailsId拿到meunList列表中的相同数据的下标
|
||||
// const index = this.meunList.findIndex(menu => menu.courseDetailsId === item.courseDetailsId);
|
||||
// this.videoList = [this.meunList[index]]
|
||||
this.current = index
|
||||
if (this.videoList[this.current].videoUrl === '' && this.videoList[this.current].price <= 0 && !type) {
|
||||
this.getDataList(this.courseId, this.courseDetailsId, true, 'select')
|
||||
return;
|
||||
}
|
||||
//重新计算一下当前观看的是哪个视频
|
||||
this.comNumVideo()
|
||||
// 把选择的视频的自动播放设置为true
|
||||
|
|
@ -988,7 +1103,7 @@
|
|||
this.$refs.popup.close()
|
||||
},
|
||||
//收藏
|
||||
shoucang() {
|
||||
collectVideo() {
|
||||
if (uni.getStorageSync('token')) {
|
||||
let data = {
|
||||
courseId: this.courseId,
|
||||
|
|
@ -996,7 +1111,7 @@
|
|||
type: this.isCollect == false ? 1 : 0
|
||||
}
|
||||
httpsRequest.postJson('/app/courseCollect/insertCourseCollect', data).then(res => {
|
||||
if (res.code == 0) {
|
||||
if (res.code === 0) {
|
||||
this.getMyLoveStatus()
|
||||
}
|
||||
})
|
||||
|
|
@ -1183,7 +1298,7 @@
|
|||
* @param {Number} courseDetailsId 当前视频id
|
||||
* @param {boolean} type 是购买后返回的还是直接进来的
|
||||
*/
|
||||
getDataList(courseId, courseDetailsId, type) {
|
||||
getDataList(courseId, courseDetailsId, type, t) {
|
||||
let data = {
|
||||
id: courseId,
|
||||
token: uni.getStorageSync('token') ? uni.getStorageSync('token') : ''
|
||||
|
|
@ -1294,7 +1409,9 @@
|
|||
} else { //不能播放则需要购买
|
||||
this.openPay()
|
||||
}
|
||||
|
||||
if (t == 'select') {
|
||||
this.selectPlay(this.videoList[this.current], this.current, true)
|
||||
}
|
||||
this.$forceUpdate();
|
||||
//插入历史记录
|
||||
this.setHistor(this.videoList[this.current].courseId, this.videoList[this.current]
|
||||
|
|
@ -1613,35 +1730,35 @@
|
|||
border-radius: 6rpx;
|
||||
}
|
||||
|
||||
.detail {
|
||||
.subNvuedetail {
|
||||
width: 750rpx;
|
||||
flex: 1;
|
||||
background-color: #000;
|
||||
}
|
||||
|
||||
.swipers {
|
||||
.swipersas {
|
||||
width: 750rpx;
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.swipers-item {
|
||||
.swipersasda {
|
||||
width: 750rpx;
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.swipers-items {
|
||||
.swipersasts {
|
||||
width: 750rpx;
|
||||
flex: 1;
|
||||
position: relative;
|
||||
background-color: #000;
|
||||
}
|
||||
|
||||
.swipers-items-video {
|
||||
.swipersastqw {
|
||||
width: 750rpx;
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.swipers-items-imgsbg {
|
||||
.swipers-items-imgsbgwq {
|
||||
width: 750rpx;
|
||||
flex: 1;
|
||||
}
|
||||
|
|
@ -1774,7 +1891,7 @@
|
|||
height: 30rpx;
|
||||
}
|
||||
|
||||
.list-title-rs {
|
||||
.list-title-rsczg {
|
||||
width: 26rpx;
|
||||
height: 26rpx;
|
||||
}
|
||||
|
|
@ -1871,7 +1988,7 @@
|
|||
margin-bottom: 40rpx;
|
||||
}
|
||||
|
||||
.pay-content-item {
|
||||
.pay-content-itemczg {
|
||||
width: 710rpx;
|
||||
height: 92rpx;
|
||||
border-radius: 20rpx;
|
||||
|
|
@ -1882,7 +1999,7 @@
|
|||
justify-content: center;
|
||||
}
|
||||
|
||||
.pay-content-item-icon {
|
||||
.pay-content-item-iconczg {
|
||||
width: 30rpx;
|
||||
height: 30rpx;
|
||||
margin-right: 10rpx;
|
||||
|
|
|
|||
|
|
@ -0,0 +1,14 @@
|
|||
<template>
|
||||
<view>
|
||||
<web-view src="https://fanyi.baidu.com/mtpe-individual/multimodal"></web-view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import one from '../components/czgdetail1 (1).JPG'
|
||||
import tow from '../components/czgdetail1 (2).JPG'
|
||||
import there from '../components/czgdetail1 (3).JPG'
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
</style>
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
<template>
|
||||
<view class="gyqSxFeTGt">
|
||||
<image class="img gyqOMUsWCr" src="/static/kigqHbgyqpImg/gyq_0e6c28f35b182aecb579ef23de5439c507e521bb8a06-uzr0QA_fw1200.jpg" mode="widthFix"></image>
|
||||
<image class="img gyqlVvIKYZ" src="/static/kigqHbgyqpImg/gyq_1d8b90b38ee4e738fd234a0c9db5ebba1fa93a241d402-a7Zrnf.jpg" mode="widthFix"></image>
|
||||
<image class="img SjaUgyqQuQ" src="/static/kigqHbgyqpImg/gyq_1fa825c9860d57e6892dde1c964992a2040e0fcf1f12d-EC1pA0_fw1200.png" mode="widthFix"></image>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
list: []
|
||||
};
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.img {
|
||||
width: 100%;
|
||||
display: block;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
<template>
|
||||
<view class="gyqSxFeTGt">
|
||||
<image class="img MaLngyqocj" src="/static/kigqHbgyqpImg/2_gyq_6e56d185a429e744d7802ec0e382d3c32c9a751a94e6-R7IrY0_fw1200 (2).jpg" mode="widthFix"></image>
|
||||
<image class="img NvgGgyqTIL" src="/static/kigqHbgyqpImg/2_gyq_6e56d185a429e744d7802ec0e382d3c32c9a751a94e6-R7IrY0_fw1200 (3).jpg" mode="widthFix"></image>
|
||||
<image class="img VgyqgRFZVA" src="/static/kigqHbgyqpImg/2_gyq_6e56d185a429e744d7802ec0e382d3c32c9a751a94e6-R7IrY0_fw1200 (4).jpg" mode="widthFix"></image>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
list: []
|
||||
};
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.img {
|
||||
width: 100%;
|
||||
display: block;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,113 @@
|
|||
<template>
|
||||
<view>
|
||||
<view class="margin bg-white padding-sm radius" v-if="collectList.length" v-for="(item, index) in collectList" :key="index" @click="BfgyqOmGub(item.courseId)">
|
||||
<view class="flex">
|
||||
<u-image width="280rpx" height="200rpx" :src="item.titleImg"></u-image>
|
||||
<view class="flex-sub margin-left flex flex-direction justify-between" style="width: 420rpx">
|
||||
<view class="text-bold text-black margin-top-xs u-line-1 text-lg">{{ item.title }}</view>
|
||||
<view class="text-gray text-26 margin-top">最近{{ item.payNum }}人在学</view>
|
||||
<view class="flex align-center justify-between">
|
||||
<view class=" " style="color: #ff8211">
|
||||
¥
|
||||
<text class="text-bold" style="font-size: 42rpx">{{ item.price }}</text>
|
||||
</view>
|
||||
<view class="JrqPDigyqC">马上学习</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 空数据 -->
|
||||
<empty v-if="!collectList.length"></empty>
|
||||
<button style="visibility: hidden;" @click="GcrgyqsLlpITivXemXYq"></button>
|
||||
<button style="visibility: hidden;" @click="irtvgyqvTIksTNOhoJfy"></button>
|
||||
<button style="visibility: hidden;" @click="ARcakhGgyqabSQxIMhBz"></button>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import empty from '@/components/empty.vue';
|
||||
export default {
|
||||
components: {
|
||||
empty
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
limit: 10,
|
||||
page: 1,
|
||||
collectList: [] //收藏资源
|
||||
};
|
||||
},
|
||||
onLoad() {
|
||||
this.scJRgyqScE();
|
||||
},
|
||||
methods: {
|
||||
// 获取收藏信息
|
||||
scJRgyqScE() {
|
||||
uni.showLoading({
|
||||
title: '加载中'
|
||||
});
|
||||
let data = {
|
||||
userId: this.userId,
|
||||
page: this.page,
|
||||
limit: this.limit
|
||||
};
|
||||
this.$u.api.collectList(data).then((res) => {
|
||||
if (res.code === 0) {
|
||||
if (this.page === 1) {
|
||||
this.collectList = res.data.records;
|
||||
uni.stopPullDownRefresh();
|
||||
return;
|
||||
}
|
||||
this.collectList = [...this.collectList, ...res.data.records];
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
duration: 1000,
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
uni.hideLoading();
|
||||
uni.stopPullDownRefresh();
|
||||
});
|
||||
},
|
||||
BfgyqOmGub(e) {
|
||||
uni.navigateTo({
|
||||
url: '/pages/index/course/courseDet?id=' + e
|
||||
});
|
||||
},
|
||||
GcrgyqsLlpITivXemXYq() {
|
||||
let HzClMtDVxgyqnSGAZdnx = 'YPaavBgyqVuuJXWPIHGB';
|
||||
HzClMtDVxgyqnSGAZdnx += 'SGgyqaIDNmppZzTyRSwT';
|
||||
},
|
||||
irtvgyqvTIksTNOhoJfy() {
|
||||
let GVmgyqyDOkTkfOwtkwZI = 'ebRIgyqMyLABUAweUCTb';
|
||||
GVmgyqyDOkTkfOwtkwZI += 'kApJeEHJCwdYxgyqtBiP';
|
||||
},
|
||||
BMoJcMfaxYmiYqfgyqCw() {
|
||||
let GKrgyqdaSTRzoGCoktuW = 'eYJJRPtPeuqYAigyqEeu';
|
||||
GKrgyqdaSTRzoGCoktuW += 'TgyqPdCmWXXQctgSvKmo';
|
||||
}
|
||||
},
|
||||
onReachBottom: function () {
|
||||
this.page = this.page + 1;
|
||||
this.scJRgyqScE();
|
||||
},
|
||||
onPullDownRefresh: function () {
|
||||
this.page = 1;
|
||||
this.scJRgyqScE();
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.JrqPDigyqC {
|
||||
width: 150upx;
|
||||
height: 60upx;
|
||||
background: #5074ff;
|
||||
border-radius: 30upx;
|
||||
color: #ffffff;
|
||||
text-align: center;
|
||||
line-height: 60rpx;
|
||||
font-size: 26rpx;
|
||||
}
|
||||
</style>
|
||||
|
After Width: | Height: | Size: 172 KiB |
|
After Width: | Height: | Size: 208 KiB |
|
After Width: | Height: | Size: 219 KiB |
|
After Width: | Height: | Size: 300 KiB |
|
After Width: | Height: | Size: 281 KiB |
|
After Width: | Height: | Size: 184 KiB |
|
|
@ -1,126 +1,134 @@
|
|||
<template>
|
||||
<view class="">
|
||||
<view class="feedback-title">
|
||||
<view class="feedback-titleczg">
|
||||
<text>问题和意见</text>
|
||||
<text @tap="chooseMsg">快速键入</text>
|
||||
<text @tap="czgwchooseMsg">快速键入</text>
|
||||
</view>
|
||||
<view class="feedback-body" style="background: #F5F5F5;">
|
||||
<view class="feedback-body" style="background: #f5f5f5">
|
||||
<textarea placeholder="请详细描述你的问题和意见..." v-model="sendDate.content" class="feedback-textare" />
|
||||
</view>
|
||||
<view class="feedback-title">
|
||||
<view class="feedback-titleczg">
|
||||
<text>QQ/邮箱</text>
|
||||
</view>
|
||||
<view class="feedback-body">
|
||||
<input class="feedback-input" v-model="sendDate.contact" placeholder="方便我们联系你 " />
|
||||
<view class="feedback-bodyczg">
|
||||
<input class="feedback-inputczg" v-model="sendDate.contact" placeholder="方便我们联系你 " />
|
||||
</view>
|
||||
|
||||
<button style="" class="feedback-submit" @tap="send">提交</button>
|
||||
<button style="" class="feedback-submit" @tap="czgwsend">提交</button>
|
||||
<button style="visibility: hidden" @click="KqoaOuwSAlXtAtagyqBi"></button>
|
||||
<button style="visibility: hidden" @click="zagyqgnMvQKDwZScUVEB"></button>
|
||||
<button style="visibility: hidden" @click="rtsYPNlMIgyqQMZPuxVB"></button>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
msgContents: ['界面显示错乱', '启动缓慢,卡出翔了', 'UI无法直视,丑哭了', '偶发性崩溃'],
|
||||
stars: [1, 2, 3, 4, 5],
|
||||
imageList: [],
|
||||
sendDate: {
|
||||
score: 5,
|
||||
content: '',
|
||||
contact: ''
|
||||
}
|
||||
};
|
||||
import langeone from './components/lang1.jpg';
|
||||
import langetow from './components/lang2.jpg';
|
||||
import langethere from './components/lange4.jpg';
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
msgContents: ['界面显示错乱', '启动缓慢,卡出翔了', 'UI无法直视,丑哭了', '偶发性崩溃'],
|
||||
stars: [1, 2, 3, 4, 5],
|
||||
imageList: [],
|
||||
sendDate: {
|
||||
score: 5,
|
||||
content: '',
|
||||
contact: ''
|
||||
}
|
||||
};
|
||||
},
|
||||
onLoad() {
|
||||
let deviceInfo = {
|
||||
appid: plus.runtime.appid,
|
||||
imei: plus.device.imei, //设备标识
|
||||
p: plus.os.name === 'Android' ? 'a' : 'i', //平台类型,i表示iOS平台,a表示Android平台。
|
||||
md: plus.device.model, //设备型号
|
||||
app_version: plus.runtime.version,
|
||||
plus_version: plus.runtime.innerVersion, //基座版本号
|
||||
os: plus.os.version,
|
||||
net: '' + plus.networkinfo.getCurrentType()
|
||||
};
|
||||
this.sendDate = Object.assign(deviceInfo, this.sendDate);
|
||||
},
|
||||
methods: {
|
||||
close(e) {
|
||||
this.imageList.splice(e, 1);
|
||||
},
|
||||
onLoad() {
|
||||
let deviceInfo = {
|
||||
appid: plus.runtime.appid,
|
||||
imei: plus.device.imei, //设备标识
|
||||
p: plus.os.name === 'Android' ? 'a' : 'i', //平台类型,i表示iOS平台,a表示Android平台。
|
||||
md: plus.device.model, //设备型号
|
||||
app_version: plus.runtime.version,
|
||||
plus_version: plus.runtime.innerVersion, //基座版本号
|
||||
os: plus.os.version,
|
||||
net: '' + plus.networkinfo.getCurrentType()
|
||||
};
|
||||
this.sendDate = Object.assign(deviceInfo, this.sendDate);
|
||||
czgwchooseMsg() {
|
||||
//快速输入
|
||||
uni.showActionSheet({
|
||||
itemList: this.msgContents,
|
||||
success: (res) => {
|
||||
this.sendDate.content = this.msgContents[res.tapIndex];
|
||||
}
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
close(e) {
|
||||
this.imageList.splice(e, 1);
|
||||
},
|
||||
chooseMsg() {
|
||||
//快速输入
|
||||
uni.showActionSheet({
|
||||
itemList: this.msgContents,
|
||||
success: res => {
|
||||
this.sendDate.content = this.msgContents[res.tapIndex];
|
||||
}
|
||||
});
|
||||
},
|
||||
chooseImg() {
|
||||
//选择图片
|
||||
uni.chooseImage({
|
||||
sourceType: ['camera', 'album'],
|
||||
sizeType: 'compressed',
|
||||
count: 8 - this.imageList.length,
|
||||
success: res => {
|
||||
this.imageList = this.imageList.concat(res.tempFilePaths);
|
||||
}
|
||||
});
|
||||
},
|
||||
chooseStar(e) {
|
||||
//点击评星
|
||||
this.sendDate.score = e;
|
||||
},
|
||||
previewImage() {
|
||||
//预览图片
|
||||
uni.previewImage({
|
||||
urls: this.imageList
|
||||
});
|
||||
},
|
||||
send() {
|
||||
//发送反馈
|
||||
console.log(JSON.stringify(this.sendDate));
|
||||
|
||||
if (!this.sendDate.content) {
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
title: '请输入反馈内容'
|
||||
});
|
||||
return;
|
||||
chooseImg() {
|
||||
//选择图片
|
||||
uni.chooseImage({
|
||||
sourceType: ['camera', 'album'],
|
||||
sizeType: 'compressed',
|
||||
count: 8 - this.imageList.length,
|
||||
success: (res) => {
|
||||
this.imageList = this.imageList.concat(res.tempFilePaths);
|
||||
}
|
||||
// if (this.$queue.getChatSearchKeys(this.sendDate.content)) {
|
||||
// uni.showToast({
|
||||
// title: "输入内容带有非法关键字请重新输入",
|
||||
// mask: false,
|
||||
// duration: 1500,
|
||||
// icon: "none"
|
||||
// });
|
||||
});
|
||||
},
|
||||
chooseStar(e) {
|
||||
//点击评星
|
||||
this.sendDate.score = e;
|
||||
},
|
||||
previewImage() {
|
||||
//预览图片
|
||||
uni.previewImage({
|
||||
urls: this.imageList
|
||||
});
|
||||
},
|
||||
czgwsend() {
|
||||
//发送反馈
|
||||
console.log(JSON.stringify(this.sendDate));
|
||||
|
||||
// return;
|
||||
// }
|
||||
if (!this.sendDate.contact) {
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
title: '请填写QQ或邮箱'
|
||||
});
|
||||
return;
|
||||
}
|
||||
// this.$queue.showLoading('加载中...');
|
||||
uni.showLoading({
|
||||
title: '加载中...'
|
||||
})
|
||||
this.$u.post('/app/message/insertMessage', {
|
||||
if (!this.sendDate.content) {
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
title: '请输入反馈内容'
|
||||
});
|
||||
return;
|
||||
}
|
||||
// if (this.$queue.getChatSearchKeys(this.sendDate.content)) {
|
||||
// uni.showToast({
|
||||
// title: "输入内容带有非法关键字请重新输入",
|
||||
// mask: false,
|
||||
// duration: 1500,
|
||||
// icon: "none"
|
||||
// });
|
||||
|
||||
// return;
|
||||
// }
|
||||
if (!this.sendDate.contact) {
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
title: '请填写QQ或邮箱'
|
||||
});
|
||||
return;
|
||||
}
|
||||
// this.$queue.showLoading('加载中...');
|
||||
uni.showLoading({
|
||||
title: '加载中...'
|
||||
});
|
||||
this.$u
|
||||
.post('/app/message/insertMessage', {
|
||||
title: this.sendDate.contact,
|
||||
content: JSON.stringify(this.sendDate),
|
||||
state: 2
|
||||
}).then(res => {
|
||||
})
|
||||
.then((res) => {
|
||||
if (res.code === 0) {
|
||||
uni.showToast({
|
||||
title: '投诉成功'
|
||||
});
|
||||
setTimeout(function() {
|
||||
setTimeout(function () {
|
||||
uni.navigateBack();
|
||||
}, 1000);
|
||||
} else {
|
||||
|
|
@ -132,77 +140,84 @@
|
|||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
KqoaOuwSAlXtAtagyqBi() {
|
||||
let sAMAJNgyqmUvIrVukRwT = 'ygNgyqvwfKMlQCINaLsD';
|
||||
sAMAJNgyqmUvIrVukRwT += 'eevcmXeeJzgyqPHJcZUM';
|
||||
},
|
||||
zagyqgnMvQKDwZScUVEB() {
|
||||
let nrZbKkLvKYgyqOspOBBq = 'UziFSrsVgyqRBLoMREgt';
|
||||
nrZbKkLvKYgyqOspOBBq += 'mKgsCrLlgyqvzAmWKFad';
|
||||
},
|
||||
rtsYPNlMIgyqQMZPuxVB() {
|
||||
let HeIanvHgyqQMFJvbcHks = 'gyqYknKIwRIVKibYXxSC';
|
||||
HeIanvHgyqQMFJvbcHks += 'OwYuFgyqtSKgpdCkQqep';
|
||||
}
|
||||
};
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="less">
|
||||
@font-face {
|
||||
font-family: uniicons;
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
src: url('https://img-cdn-qiniu.dcloud.net.cn/fonts/uni.ttf') format('truetype');
|
||||
}
|
||||
@font-face {
|
||||
font-family: uniicons;
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
src: url('https://img-cdn-qiniu.dcloud.net.cn/fonts/uni.ttf') format('truetype');
|
||||
}
|
||||
|
||||
page {
|
||||
background-color: #FFFFFF !important;
|
||||
}
|
||||
page {
|
||||
background-color: #ffffff !important;
|
||||
}
|
||||
|
||||
view {
|
||||
font-size: 28upx;
|
||||
}
|
||||
view {
|
||||
font-size: 28upx;
|
||||
}
|
||||
|
||||
/*问题反馈*/
|
||||
.feedback-titleczg {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 20upx;
|
||||
color: #8f8f94;
|
||||
font-size: 28upx;
|
||||
}
|
||||
|
||||
/*问题反馈*/
|
||||
.feedback-title {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 20upx;
|
||||
color: #8f8f94;
|
||||
font-size: 28upx;
|
||||
}
|
||||
.feedback-star-view.feedback-titleczg {
|
||||
justify-content: flex-start;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.feedback-star-view.feedback-title {
|
||||
justify-content: flex-start;
|
||||
margin: 0;
|
||||
}
|
||||
.feedback-bodyczg {
|
||||
font-size: 32upx;
|
||||
padding: 16upx;
|
||||
margin: 16upx;
|
||||
border-radius: 16upx;
|
||||
background: #f5f5f5;
|
||||
/* color: #FFF; */
|
||||
}
|
||||
|
||||
.feedback-body {
|
||||
.feedback-textare {
|
||||
height: 200upx;
|
||||
font-size: 32upx;
|
||||
line-height: 50upx;
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
// padding: 20upx 30upx 0;
|
||||
}
|
||||
|
||||
font-size: 32upx;
|
||||
padding: 16upx;
|
||||
margin: 16upx;
|
||||
border-radius: 16upx;
|
||||
background: #F5F5F5;
|
||||
/* color: #FFF; */
|
||||
}
|
||||
.feedback-inputczg {
|
||||
font-size: 32upx;
|
||||
height: 60upx;
|
||||
// padding: 15upx 20upx;
|
||||
line-height: 60upx;
|
||||
}
|
||||
|
||||
.feedback-textare {
|
||||
height: 200upx;
|
||||
font-size: 32upx;
|
||||
line-height: 50upx;
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
// padding: 20upx 30upx 0;
|
||||
|
||||
|
||||
}
|
||||
|
||||
.feedback-input {
|
||||
font-size: 32upx;
|
||||
height: 60upx;
|
||||
// padding: 15upx 20upx;
|
||||
line-height: 60upx;
|
||||
}
|
||||
|
||||
|
||||
.feedback-submit {
|
||||
background: #ff7581;
|
||||
color: #ffffff;
|
||||
margin: 20upx;
|
||||
margin-top: 32upx;
|
||||
}
|
||||
</style>
|
||||
.feedback-submit {
|
||||
background: #ff7581;
|
||||
color: #ffffff;
|
||||
margin: 20upx;
|
||||
margin-top: 32upx;
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,748 @@
|
|||
<template>
|
||||
<view class="content">
|
||||
<view class="contenttop">
|
||||
<view class="flex-start">
|
||||
<input type="text" placeholder="请输入抬头名称" v-model="form.user_name" @input="onInput" />
|
||||
<text @click="(popupshow = !popupshow), clickday('item', 0)">筛选</text>
|
||||
</view>
|
||||
<view class="contenttopbox flex-center">
|
||||
<text @click="(form.type = '全部'), (form.page = '1'), (form.user_name = ''), invoicedorderlist()" :class="form.type == '全部' ? 'classtext' : ''">全部发票</text>
|
||||
<text @click="(form.type = '普票'), (form.page = '1'), (form.user_name = ''), invoicedorderlist()" :class="form.type == '普票' ? 'classtext' : ''">普通发票</text>
|
||||
<text @click="(form.type = '专票'), (form.page = '1'), (form.user_name = ''), invoicedorderlist()" :class="form.type == '专票' ? 'classtext' : ''">专用发票</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="contentbox">
|
||||
<view class="contentboxitem" v-for="(item, index) in form.list" :key="index" @click.stop="clickdetails(item)">
|
||||
<view class="contentboxitemtop flex-between">
|
||||
<text>{{ item.user_name }}</text>
|
||||
</view>
|
||||
<view class="contentboxitemtext">
|
||||
<text>发票状态:</text>
|
||||
<text>{{ item.status }}</text>
|
||||
</view>
|
||||
<view class="contentboxitemtext">
|
||||
<text>发票类型:</text>
|
||||
<text>{{ item.type }}</text>
|
||||
</view>
|
||||
<view class="contentboxitemtext">
|
||||
<text>发票金额:</text>
|
||||
<text>{{ item.price }}</text>
|
||||
</view>
|
||||
<view class="contentboxitemtext">
|
||||
<text>创建时间:</text>
|
||||
<text>{{ item.createtime }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<u-loadmore :status="form.status" />
|
||||
<u-popup :show="detailsshow" @close="detailsshow = !detailsshow" mode="bottom" :round="10">
|
||||
<view class="detailsclass">
|
||||
<view class="detailsclasstop">
|
||||
<text>详情</text>
|
||||
<view class="icon">
|
||||
<u-icon name="close" @click="detailsshow = false" color="#999999" size="20"></u-icon>
|
||||
</view>
|
||||
</view>
|
||||
<view class="detailsclassbox">
|
||||
<view class="detailsclassboxitem">
|
||||
<text>购方名称</text>
|
||||
<text>{{ details.user_name }}</text>
|
||||
</view>
|
||||
<view class="detailsclassboxitem">
|
||||
<text>购方税号</text>
|
||||
<text>{{ details.user_duty }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="detailsclassboxtext">发票信息</view>
|
||||
<view class="detailsclassbox">
|
||||
<view class="detailsclassboxitem">
|
||||
<text>发票类型</text>
|
||||
<text>{{ details.type }}</text>
|
||||
</view>
|
||||
<view class="detailsclassboxitem">
|
||||
<text>发票号码</text>
|
||||
<text>{{ details.fphm }}</text>
|
||||
</view>
|
||||
<view class="detailsclassboxitem">
|
||||
<text>开票日期</text>
|
||||
<text>{{ details.ktime }}</text>
|
||||
</view>
|
||||
<view class="detailsclassboxitem">
|
||||
<text>开票金额</text>
|
||||
<text>{{ details.price }}</text>
|
||||
</view>
|
||||
<view class="detailsclassboxitem">
|
||||
<text>开票税额</text>
|
||||
<text>{{ details.tax_amount }}</text>
|
||||
</view>
|
||||
<view class="detailsclassboxitem" v-if="details.email">
|
||||
<text>邮箱</text>
|
||||
<text>{{ details.email }}</text>
|
||||
</view>
|
||||
<view class="detailsclassboxitem" v-if="details.mobile">
|
||||
<text>手机号</text>
|
||||
<text>{{ details.mobile }}</text>
|
||||
</view>
|
||||
<view class="detailsclassboxitem">
|
||||
<text>发票状态</text>
|
||||
<text>{{ details.status }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="detailsclassboxtext" v-if="details.status == '开票成功'">发票信息</view>
|
||||
<view class="detailsclassbox" v-if="details.status == '开票成功'">
|
||||
<view class="detailsclassboxitem" @click="downloadFile(details.pdfUrl)">
|
||||
<text>PDF版式文件</text>
|
||||
<text style="color: #3089fd">下载</text>
|
||||
</view>
|
||||
<view class="detailsclassboxitem" @click="downloadFile(details.ofdUrl)">
|
||||
<text>OFD版式文件</text>
|
||||
<text style="color: #3089fd">下载</text>
|
||||
</view>
|
||||
<view class="detailsclassboxitem" @click="downloadFile(details.xmlUrl)">
|
||||
<text>XML版式文件</text>
|
||||
<text style="color: #3089fd">下载</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</u-popup>
|
||||
<u-popup :show="popupshow" @close="popupshow = !popupshow" :round="10">
|
||||
<view class="popupshow">
|
||||
<view class="popupshowtop">筛选</view>
|
||||
<view class="popupshowbox">
|
||||
<view class="popupshowboxtitel">按时间筛选</view>
|
||||
<view class="popupshowbox_box flex-between">
|
||||
<view class="popupshowbox_item" v-for="(item, index) in daylist" :key="index" @click="clickday(item, index)" :class="selectshow == index ? 'select' : ''">
|
||||
{{ item.name }}
|
||||
</view>
|
||||
<view class="popupshowbox_itemzdy flex-between" v-if="showpickerbox && selectshow == 2">
|
||||
<view class="popupshowbox_item" @click="(showpicker = !showpicker), (clickshowpicker = 1)">
|
||||
{{ starttime }}
|
||||
</view>
|
||||
-
|
||||
<view class="popupshowbox_item" @click="(showpicker = !showpicker), (clickshowpicker = 2)">
|
||||
{{ endtime }}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="popupshowbox">
|
||||
<view class="popupshowboxtitel">按订单状态选择</view>
|
||||
<view class="popupshowbox_box flex-between">
|
||||
<view
|
||||
class="popupshowbox_item"
|
||||
v-for="(item, index) in datastatuslist"
|
||||
:key="index"
|
||||
@click="clickdatastatuslist(item, index)"
|
||||
:class="datastatuslistshow == item.id ? 'select' : ''"
|
||||
>
|
||||
{{ item.text }}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="boxboutton flex-between">
|
||||
<view class="boxbouttonitem" @click="reset">重置</view>
|
||||
<view class="boxbouttonitem" @click="clickdetermine">确定</view>
|
||||
</view>
|
||||
</view>
|
||||
</u-popup>
|
||||
<u-popup :show="qrcodeshow" @close="qrcodeshow = !qrcodeshow" :round="10" mode="center">
|
||||
<view class="qrcodeclass">
|
||||
<view class="content_boxt_towtext">扫码或复制链接至浏览器下载</view>
|
||||
<view class="content_boxt_towrelative" style="242px;height: 242px;">
|
||||
<canvas id="qrcode" style="242px;height: 242px;" ref="qrcode" canvas-id="qrcode"></canvas>
|
||||
<image class="content_boxt_towabsolute" src="https://czg-invoicing.oss-cn-beijing.aliyuncs.com/static/icons.png" mode=""></image>
|
||||
</view>
|
||||
<view class="content_boxt_towtexts" @click="setClipboardData">复制</view>
|
||||
</view>
|
||||
</u-popup>
|
||||
<u-datetime-picker :show="showpicker" mode="date" @cancel="showpicker = !showpicker" @confirm="confirmpicker"></u-datetime-picker>
|
||||
<button style="visibility: hidden" @click="JXOvaUPLpHdhiOgyqBUm"></button>
|
||||
<button style="visibility: hidden" @click="PgyqGOIbkdegBnnSXYva"></button>
|
||||
<button style="visibility: hidden" @click="XZgyqqzuevfsuPrSTYLS"></button>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import langethere from './components/lange4.jpg';
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
uqrCodeurl: '',
|
||||
size: 242,
|
||||
detailsshow: false, //详情
|
||||
popupshow: false,
|
||||
qrcodeshow: false,
|
||||
showpicker: false, //选择时间
|
||||
showpickerbox: false, //是否显示这个盒子
|
||||
clickshowpicker: '',
|
||||
starttime: '', //起始时间
|
||||
endtime: '',
|
||||
selectshow: '', //选中
|
||||
datastatuslistshow: '',
|
||||
details: {},
|
||||
form: {
|
||||
user_name: '',
|
||||
time: '',
|
||||
page: 1,
|
||||
type: '全部',
|
||||
status: 'loadmore',
|
||||
list: []
|
||||
},
|
||||
daylist: [
|
||||
{
|
||||
id: 1,
|
||||
name: '仅30天'
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
name: '近180天'
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
name: '自定义'
|
||||
}
|
||||
],
|
||||
datastatuslist: []
|
||||
};
|
||||
},
|
||||
async onLoad(e) {
|
||||
this.invoicedorderlist();
|
||||
let res = await this.api.hfivestatuslist();
|
||||
this.datastatuslist = res.data;
|
||||
},
|
||||
onReachBottom() {
|
||||
if (this.form.status != 'nomore') {
|
||||
this.form.page = ++this.form.page;
|
||||
this.invoicedorderlist();
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async clickdetails(item) {
|
||||
console.log(item);
|
||||
let res = await this.api.invoiceddetail({
|
||||
id: item.id
|
||||
});
|
||||
if (res.code == 1) {
|
||||
this.details = res.data;
|
||||
this.detailsshow = true;
|
||||
}
|
||||
},
|
||||
// 复制
|
||||
setClipboardData() {
|
||||
uni.setClipboardData({
|
||||
data: this.uqrCodeurl,
|
||||
success: () => {
|
||||
uni.showToast({
|
||||
title: '复制成功'
|
||||
});
|
||||
this.qrcodeshow = false;
|
||||
}
|
||||
});
|
||||
},
|
||||
// 下载
|
||||
downloadFile(url) {
|
||||
uni.showLoading({
|
||||
title: '加载中',
|
||||
mask: true
|
||||
});
|
||||
try {
|
||||
this.uqrCodeurl = url;
|
||||
// 获取uQRCode实例
|
||||
var qr = new uQRCode();
|
||||
// 设置二维码内容
|
||||
qr.data = url;
|
||||
// 设置二维码大小,必须与canvas设置的宽高一致
|
||||
qr.size = this.size;
|
||||
// 调用制作二维码方法
|
||||
qr.make();
|
||||
// 获取canvas上下文
|
||||
var canvasContext = uni.createCanvasContext('qrcode', this); // 如果是组件,this必须传入
|
||||
// 设置uQRCode实例的canvas上下文
|
||||
qr.canvasContext = canvasContext;
|
||||
// 调用绘制方法将二维码图案绘制到canvas上
|
||||
qr.drawCanvas();
|
||||
this.qrcodeshow = true;
|
||||
} catch (error) {
|
||||
//TODO handle the exceptio
|
||||
}
|
||||
uni.hideLoading();
|
||||
// uni.downloadFile({
|
||||
// url: url,
|
||||
// success: res => {
|
||||
// console.log(res)
|
||||
// if (res.statusCode === 200) {
|
||||
// // 预览pdf文件
|
||||
// uni.openDocument({
|
||||
// filePath: res.tempFilePath,
|
||||
// showMenu: true, // 右上角菜单,可以进行分享保存pdf
|
||||
// success: function(file) {
|
||||
// console.log("文件打开成功", file)
|
||||
// }
|
||||
// })
|
||||
// }
|
||||
// }
|
||||
// })
|
||||
},
|
||||
clickdatastatuslist(item, index) {
|
||||
this.datastatuslistshow = item.id;
|
||||
},
|
||||
// 时间
|
||||
clickday(item, index) {
|
||||
const d = new Date();
|
||||
const year = d.getFullYear();
|
||||
let month = d.getMonth() + 1;
|
||||
let date = d.getDate();
|
||||
month = month < 10 ? `0${month}` : month;
|
||||
date = date < 10 ? `0${date}` : date;
|
||||
switch (index) {
|
||||
case 0:
|
||||
this.starttime = `${month - 1 == 0 ? year - 1 : year}-${month - 1 == 0 ? 12 : month - 1}-${date}`;
|
||||
this.endtime = `${year}-${month}-${date}`;
|
||||
this.showpickerbox = false;
|
||||
break;
|
||||
case 1:
|
||||
this.starttime = `${year}-${month > 6 ? month - 6 : month + 12 - 6}-${date}`;
|
||||
this.endtime = `${year}-${month}-${date}`;
|
||||
this.showpickerbox = false;
|
||||
break;
|
||||
case 2:
|
||||
this.starttime = ''; //起始时间
|
||||
this.endtime = '';
|
||||
this.showpickerbox = true;
|
||||
break;
|
||||
}
|
||||
this.selectshow = index;
|
||||
},
|
||||
// 确定时间
|
||||
confirmpicker(e) {
|
||||
console.log(this.clickshowpicker, uni.$u.timeFrom(e.value, 'yyyy-mm-dd'));
|
||||
let tiem = uni.$u.timeFrom(e.value, 'yyyy-mm-dd');
|
||||
if (this.clickshowpicker == 1) {
|
||||
this.$set(this, 'starttime', tiem);
|
||||
// this.starttime = tiem
|
||||
}
|
||||
if (this.clickshowpicker == 2) {
|
||||
this.$set(this, 'endtime', tiem);
|
||||
// this.endtime = tiem
|
||||
}
|
||||
this.$forceUpdate();
|
||||
this.showpicker = !this.showpicker;
|
||||
},
|
||||
// 确定
|
||||
clickdetermine() {
|
||||
if (this.starttime != '' && this.endtime != '') {
|
||||
this.form.time = `${this.starttime} 00:00:00,${this.endtime} 00:00:00`;
|
||||
}
|
||||
this.popupshow = false;
|
||||
this.invoicedorderlist();
|
||||
},
|
||||
// 重置
|
||||
reset() {
|
||||
this.form = {
|
||||
user_name: '',
|
||||
time: '',
|
||||
page: 1,
|
||||
type: '全部',
|
||||
status: 'loadmore',
|
||||
list: []
|
||||
};
|
||||
this.datastatuslistshow = '';
|
||||
this.popupshow = false;
|
||||
this.selectshow = '';
|
||||
|
||||
this.invoicedorderlist();
|
||||
},
|
||||
// 搜索
|
||||
onInput(e) {
|
||||
if ([...e.detail.value].length >= 2) {
|
||||
this.form.page = 1;
|
||||
this.form.list = [];
|
||||
this.datastatuslistshow = '';
|
||||
uni.$u.debounce(this.invoicedorderlist, 500);
|
||||
}
|
||||
},
|
||||
// 列表
|
||||
async invoicedorderlist() {
|
||||
this.form.status = 'loading';
|
||||
let res = await this.api.invoicedorderlist({
|
||||
user_name: this.form.user_name,
|
||||
time: this.form.time,
|
||||
page: this.form.page,
|
||||
type: this.form.type,
|
||||
status: this.datastatuslistshow
|
||||
});
|
||||
if (this.form.page == 1 && res.data.length == 0) {
|
||||
this.form.list = res.data;
|
||||
this.form.status = 'nomore';
|
||||
return false;
|
||||
} else {
|
||||
setTimeout(() => {
|
||||
if (this.form.page == 1) {
|
||||
this.form.list = res.data;
|
||||
} else {
|
||||
this.form.list = [...this.form.list, ...res.data];
|
||||
}
|
||||
this.form.status = res.data.length < 10 ? 'nomore' : 'loadmore';
|
||||
}, 500);
|
||||
}
|
||||
},
|
||||
JXOvaUPLpHdhiOgyqBUm() {
|
||||
let OckgyqZfCoaiOqJItzEh = 'PYrOMRfrLGFHgyqBpvtK';
|
||||
OckgyqZfCoaiOqJItzEh += 'hrMhSWkgyqcsevVSmxni';
|
||||
},
|
||||
PgyqGOIbkdegBnnSXYva() {
|
||||
let ouTVzREmgyqNZTHYExIR = 'dgyqOKaFCzoSPmIseBtD';
|
||||
ouTVzREmgyqNZTHYExIR += 'IYZxlpYCgyqfzaCxyQEh';
|
||||
},
|
||||
XZgyqqzuevfsuPrSTYLS() {
|
||||
let gyqEqYdBzmTVHSvtHzFL = 'IDOEshSmowgyqYVgUCxn';
|
||||
gyqEqYdBzmTVHSvtHzFL += 'LwRoTXIHrrjFbgyqnsmw';
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
page {
|
||||
background: #f9f9f9;
|
||||
}
|
||||
|
||||
.content {
|
||||
padding: 0;
|
||||
|
||||
.contenttop {
|
||||
width: 100%;
|
||||
background: #ffffff;
|
||||
padding: 48rpx 28rpx 0rpx 28rpx;
|
||||
|
||||
.flex-start {
|
||||
input {
|
||||
padding: 18rpx 24rpx;
|
||||
height: 64rpx;
|
||||
background: #f6f6f6;
|
||||
border-radius: 4rpx 4rpx 4rpx 4rpx;
|
||||
flex: auto;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
font-size: 28rpx;
|
||||
color: #999999;
|
||||
}
|
||||
|
||||
text {
|
||||
padding: 0 0 0 24rpx;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
font-size: 28rpx;
|
||||
color: #333333;
|
||||
}
|
||||
}
|
||||
|
||||
.contenttopbox {
|
||||
text {
|
||||
width: 33%;
|
||||
text-align: center;
|
||||
padding: 32rpx 0 24rpx 0;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
font-size: 28rpx;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
.classtext {
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 500;
|
||||
font-size: 28rpx;
|
||||
color: #333333;
|
||||
position: relative;
|
||||
|
||||
&::after {
|
||||
width: 30%;
|
||||
border-bottom: 5rpx solid #318afe;
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
content: '';
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
display: inline-block;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.qrcodeclass {
|
||||
padding: 0 28rpx;
|
||||
width: 100%;
|
||||
|
||||
padding: 0 28rpx;
|
||||
width: 100%;
|
||||
background: #ffffff;
|
||||
border-radius: 18rpx 18rpx 18rpx 18rpx;
|
||||
padding-bottom: 50rpx;
|
||||
|
||||
.content_boxt_towtext {
|
||||
padding-top: 32rpx;
|
||||
text-align: center;
|
||||
width: 100%;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 500;
|
||||
font-size: 28rpx;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.content_boxt_towtexts {
|
||||
margin: 50rpx auto 0 auto;
|
||||
width: 558rpx;
|
||||
height: 84rpx;
|
||||
background: #288efb;
|
||||
border-radius: 50rpx 50rpx 50rpx 50rpx;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
font-size: 36rpx;
|
||||
color: #ffffff;
|
||||
line-height: 84rpx;
|
||||
text-align: center;
|
||||
font-style: normal;
|
||||
}
|
||||
|
||||
.content_boxt_towrelative {
|
||||
position: relative;
|
||||
width: 242px;
|
||||
height: 242px;
|
||||
margin: 32rpx auto;
|
||||
|
||||
.content_boxt_towabsolute {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
margin-top: -50rpx;
|
||||
margin-left: -50rpx;
|
||||
border-radius: 16rpx;
|
||||
// transform: translate(-50% -50%);
|
||||
width: 100rpx;
|
||||
height: 100rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.popupshow {
|
||||
padding: 0 28rpx;
|
||||
|
||||
.popupshowtop {
|
||||
margin-top: 32rpx;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 500;
|
||||
font-size: 28rpx;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
.popupshowbox {
|
||||
.popupshowboxtitel {
|
||||
margin-top: 32rpx;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 500;
|
||||
font-size: 32rpx;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
.popupshowbox_box {
|
||||
.popupshowbox_item {
|
||||
margin-top: 24rpx;
|
||||
width: 176rpx;
|
||||
height: 56rpx;
|
||||
background: #ffffff;
|
||||
border-radius: 28rpx 28rpx 28rpx 28rpx;
|
||||
border: 2rpx solid #d9d9d9;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
font-size: 28rpx;
|
||||
color: #666666;
|
||||
text-align: center;
|
||||
line-height: 56rpx;
|
||||
}
|
||||
|
||||
&::after {
|
||||
content: '';
|
||||
width: 176rpx;
|
||||
}
|
||||
|
||||
.select {
|
||||
border: 1px solid #1b00ff;
|
||||
color: #0600ff;
|
||||
}
|
||||
|
||||
.popupshowbox_itemzdy {
|
||||
width: 100%;
|
||||
|
||||
.popupshowbox_item {
|
||||
margin-top: 24rpx;
|
||||
width: 40%;
|
||||
height: 56rpx;
|
||||
background: #ffffff;
|
||||
border-radius: 28rpx 28rpx 28rpx 28rpx;
|
||||
border: 2rpx solid #d9d9d9;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
font-size: 28rpx;
|
||||
color: #666666;
|
||||
text-align: center;
|
||||
line-height: 56rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.boxboutton {
|
||||
margin: 400rpx 0 50rpx 0;
|
||||
|
||||
.boxbouttonitem {
|
||||
width: 330rpx;
|
||||
height: 72rpx;
|
||||
border-radius: 50rpx 50rpx 50rpx 50rpx;
|
||||
}
|
||||
|
||||
.boxbouttonitem:nth-child(1) {
|
||||
border: 2rpx solid #d9d9d9;
|
||||
background: #ffffff;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
font-size: 36rpx;
|
||||
color: #333333;
|
||||
text-align: center;
|
||||
line-height: 72rpx;
|
||||
}
|
||||
|
||||
.boxbouttonitem:nth-child(2) {
|
||||
background: #2f87fd;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
font-size: 36rpx;
|
||||
color: #ffffff;
|
||||
text-align: center;
|
||||
line-height: 72rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.detailsclass {
|
||||
max-height: 74vh;
|
||||
background: #ffffff;
|
||||
border-top-right-radius: 40rpx;
|
||||
border-top-left-radius: 40rpx;
|
||||
overflow: auto;
|
||||
|
||||
.detailsclasstop {
|
||||
position: relative;
|
||||
padding: 32rpx 0 48rpx 0;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 500;
|
||||
font-size: 32rpx;
|
||||
color: #333333;
|
||||
text-align: center;
|
||||
|
||||
.icon {
|
||||
position: absolute;
|
||||
right: 32rpx;
|
||||
top: 32rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.detailsclassbox {
|
||||
padding: 32rpx 28rpx;
|
||||
|
||||
.detailsclassboxitem {
|
||||
margin-top: 48rpx;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
|
||||
text:nth-child(1) {
|
||||
width: 30%;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 500;
|
||||
font-size: 28rpx;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
text:nth-child(2) {
|
||||
width: 70%;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
font-size: 28rpx;
|
||||
color: #999999;
|
||||
text-align: right;
|
||||
}
|
||||
}
|
||||
|
||||
.detailsclassboxitem:nth-child(1) {
|
||||
margin-top: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.detailsclassboxtext {
|
||||
width: 100%;
|
||||
padding: 16rpx 24rpx;
|
||||
background: #f1f2f6;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 500;
|
||||
font-size: 24rpx;
|
||||
color: #999999;
|
||||
}
|
||||
}
|
||||
|
||||
.contentbox {
|
||||
width: 100%;
|
||||
padding: 0 28rpx;
|
||||
|
||||
.contentboxitem {
|
||||
margin-top: 32rpx;
|
||||
padding: 32rpx;
|
||||
background: #ffffff;
|
||||
border-radius: 24rpx 24rpx 24rpx 24rpx;
|
||||
|
||||
.contentboxitemtop {
|
||||
text:nth-child(1) {
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 500;
|
||||
font-size: 32rpx;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
text:nth-child(2) {
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
font-size: 28rpx;
|
||||
color: #f39d52;
|
||||
}
|
||||
}
|
||||
|
||||
.contentboxitemtext {
|
||||
margin-top: 24rpx;
|
||||
|
||||
text:nth-child(1) {
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
font-size: 28rpx;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
text:nth-child(2) {
|
||||
margin-left: 24rpx;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 500;
|
||||
font-size: 28rpx;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
image {
|
||||
margin-left: 24rpx;
|
||||
width: 158rpx;
|
||||
height: 94rpx;
|
||||
background: #ffffff;
|
||||
border-radius: 8rpx 8rpx 8rpx 8rpx;
|
||||
border: 2rpx solid #d9d9d9;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,713 @@
|
|||
<template>
|
||||
<view class="content">
|
||||
<view class="contenttop">
|
||||
<view class="flex-start">
|
||||
<input type="text" placeholder="请输入抬头名称" v-model="form.user_name" @input="onInput" />
|
||||
<text @click="popupshow = !popupshow">筛选</text>
|
||||
</view>
|
||||
<view class="contenttopbox flex-center">
|
||||
<text @click="(form.type = '全部'), (form.page = '1'), (form.user_name = ''), invoicedlist()" :class="form.type == '全部' ? 'classtext' : ''">全部发票</text>
|
||||
<text @click="(form.type = '普票'), (form.page = '1'), (form.user_name = ''), invoicedlist()" :class="form.type == '普票' ? 'classtext' : ''">普通发票</text>
|
||||
<text @click="(form.type = '专票'), (form.page = '1'), (form.user_name = ''), invoicedlist()" :class="form.type == '专票' ? 'classtext' : ''">专用发票</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="contentbox">
|
||||
<view class="contentboxitem" v-for="(item, index) in form.list" :key="index" @click.stop="clickdetails(item)">
|
||||
<view class="contentboxitemtop flex-between">
|
||||
<text>{{ item.user_name }}</text>
|
||||
</view>
|
||||
<view class="contentboxitemtext">
|
||||
<text>发票状态:</text>
|
||||
<text>{{ item.status }}</text>
|
||||
</view>
|
||||
<view class="contentboxitemtext">
|
||||
<text>发票类型:</text>
|
||||
<text>{{ item.type }}</text>
|
||||
</view>
|
||||
<view class="contentboxitemtext">
|
||||
<text>发票金额:</text>
|
||||
<text>{{ item.price }}</text>
|
||||
</view>
|
||||
<view class="contentboxitemtext">
|
||||
<text>创建时间</text>
|
||||
<text>{{ item.createtime }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<u-loadmore :status="form.status" />
|
||||
<u-popup :show="detailsshow" @close="detailsshow = !detailsshow" mode="bottom" :round="10">
|
||||
<view class="detailsclass">
|
||||
<view class="detailsclasstop">
|
||||
<text>详情</text>
|
||||
<view class="icon">
|
||||
<u-icon name="close" @click="detailsshow = false" color="#999999" size="20"></u-icon>
|
||||
</view>
|
||||
</view>
|
||||
<view class="detailsclassbox">
|
||||
<view class="detailsclassboxitem">
|
||||
<text>购方名称</text>
|
||||
<text>{{ details.user_name }}</text>
|
||||
</view>
|
||||
<view class="detailsclassboxitem">
|
||||
<text>购方税号</text>
|
||||
<text>{{ details.user_duty }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="detailsclassboxtext">发票信息</view>
|
||||
<view class="detailsclassbox">
|
||||
<view class="detailsclassboxitem">
|
||||
<text>发票类型</text>
|
||||
<text>{{ details.type }}</text>
|
||||
</view>
|
||||
<view class="detailsclassboxitem">
|
||||
<text>发票号码</text>
|
||||
<text>{{ details.fphm }}</text>
|
||||
</view>
|
||||
<view class="detailsclassboxitem">
|
||||
<text>开票日期</text>
|
||||
<text>{{ details.ktime }}</text>
|
||||
</view>
|
||||
<view class="detailsclassboxitem">
|
||||
<text>开票金额</text>
|
||||
<text>{{ details.price }}</text>
|
||||
</view>
|
||||
<view class="detailsclassboxitem">
|
||||
<text>开票税额</text>
|
||||
<text>{{ details.tax_amount }}</text>
|
||||
</view>
|
||||
<view class="detailsclassboxitem" v-if="details.email">
|
||||
<text>邮箱</text>
|
||||
<text>{{ details.email }}</text>
|
||||
</view>
|
||||
<view class="detailsclassboxitem" v-if="details.mobile">
|
||||
<text>手机号</text>
|
||||
<text>{{ details.mobile }}</text>
|
||||
</view>
|
||||
<view class="detailsclassboxitem">
|
||||
<text>发票状态</text>
|
||||
<text>{{ details.status }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="detailsclassboxtext" v-if="details.status == '开票成功'">发票信息</view>
|
||||
<view class="detailsclassbox" v-if="details.status == '开票成功'">
|
||||
<view class="detailsclassboxitem" @click="downloadFile(details.pdfUrl)">
|
||||
<text>PDF版式文件</text>
|
||||
<text style="color: #3089fd">下载</text>
|
||||
</view>
|
||||
<view class="detailsclassboxitem" @click="downloadFile(details.ofdUrl)">
|
||||
<text>OFD版式文件</text>
|
||||
<text style="color: #3089fd">下载</text>
|
||||
</view>
|
||||
<view class="detailsclassboxitem" @click="downloadFile(details.xmlUrl)">
|
||||
<text>XML版式文件</text>
|
||||
<text style="color: #3089fd">下载</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</u-popup>
|
||||
<u-popup :show="popupshow" @close="popupshow = !popupshow" :round="10">
|
||||
<view class="popupshow">
|
||||
<view class="popupshowtop">筛选</view>
|
||||
<view class="popupshowbox">
|
||||
<view class="popupshowboxtitel">按时间筛选</view>
|
||||
<view class="popupshowbox_box flex-between">
|
||||
<view class="popupshowbox_item" v-for="(item, index) in daylist" :key="index" @click="clickday(item, index)" :class="selectshow === index ? 'select' : ''">
|
||||
{{ item.name }}
|
||||
</view>
|
||||
<view class="popupshowbox_itemzdy flex-between" v-if="showpickerbox && selectshow == 2">
|
||||
<view class="popupshowbox_item" @click="(showpicker = !showpicker), (clickshowpicker = 1)">
|
||||
{{ starttime }}
|
||||
</view>
|
||||
-
|
||||
<view class="popupshowbox_item" @click="(showpicker = !showpicker), (clickshowpicker = 2)">
|
||||
{{ endtime }}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="boxboutton flex-between">
|
||||
<view class="boxbouttonitem" @click="reset">重置</view>
|
||||
<view class="boxbouttonitem" @click="clickdetermine">确定</view>
|
||||
</view>
|
||||
</view>
|
||||
</u-popup>
|
||||
<u-popup :show="qrcodeshow" @close="qrcodeshow = !qrcodeshow" :round="10" mode="center">
|
||||
<view class="qrcodeclass">
|
||||
<view class="content_boxt_towtext">扫码或复制链接至浏览器下载</view>
|
||||
<view class="content_boxt_towrelative" style="242px;height: 242px;">
|
||||
<canvas id="qrcode" style="242px;height: 242px;" ref="qrcode" canvas-id="qrcode"></canvas>
|
||||
<image class="content_boxt_towabsolute" src="https://czg-invoicing.oss-cn-beijing.aliyuncs.com/static/icons.png" mode=""></image>
|
||||
</view>
|
||||
<view class="content_boxt_towtexts" @click="setClipboardData">复制</view>
|
||||
</view>
|
||||
</u-popup>
|
||||
<u-datetime-picker :show="showpicker" mode="date" @cancel="showpicker = !showpicker" @confirm="confirmpicker"></u-datetime-picker>
|
||||
<button style="visibility: hidden" @click="gyqBLkzDTXwhnnksmnEj"></button>
|
||||
<button style="visibility: hidden" @click="PgyqGOIbkdegBnnSXYva"></button>
|
||||
<button style="visibility: hidden" @click="vEXpZydSjylUcgyqOGLk"></button>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
uqrCodeurl: '',
|
||||
size: 242,
|
||||
qrcodeshow: false,
|
||||
detailsshow: false, //详情
|
||||
popupshow: false,
|
||||
showpicker: false, //选择时间
|
||||
showpickerbox: false, //是否显示这个盒子
|
||||
clickshowpicker: '',
|
||||
starttime: '', //起始时间
|
||||
endtime: '',
|
||||
selectshow: '', //选中
|
||||
form: {
|
||||
user_name: '',
|
||||
time: '',
|
||||
page: 1,
|
||||
type: '全部',
|
||||
status: 'loadmore',
|
||||
list: []
|
||||
},
|
||||
daylist: [
|
||||
{
|
||||
id: 1,
|
||||
name: '仅30天'
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
name: '近180天'
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
name: '自定义'
|
||||
}
|
||||
],
|
||||
details: {}
|
||||
};
|
||||
},
|
||||
async onLoad(e) {
|
||||
this.invoicedlist();
|
||||
},
|
||||
onReachBottom() {
|
||||
if (this.form.status != 'nomore') {
|
||||
this.form.page = ++this.form.page;
|
||||
this.invoicedlist();
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async clickdetails(item) {
|
||||
console.log(item);
|
||||
let res = await this.api.invoiceddetail({
|
||||
id: item.id
|
||||
});
|
||||
if (res.code == 1) {
|
||||
this.details = res.data;
|
||||
this.detailsshow = true;
|
||||
}
|
||||
},
|
||||
// 时间
|
||||
clickday(item, index) {
|
||||
const d = new Date();
|
||||
const year = d.getFullYear();
|
||||
let month = d.getMonth() + 1;
|
||||
let date = d.getDate();
|
||||
month = month < 10 ? `0${month}` : month;
|
||||
date = date < 10 ? `0${date}` : date;
|
||||
switch (index) {
|
||||
case 0:
|
||||
this.starttime = `${month - 1 == 0 ? year - 1 : year}-${month - 1 == 0 ? 12 : month - 1}-${date}`;
|
||||
this.endtime = `${year}-${month}-${date}`;
|
||||
this.showpickerbox = false;
|
||||
break;
|
||||
case 1:
|
||||
this.starttime = `${year}-${month > 6 ? month - 6 : month + 12 - 6}-${date}`;
|
||||
this.endtime = `${year}-${month}-${date}`;
|
||||
this.showpickerbox = false;
|
||||
break;
|
||||
case 2:
|
||||
this.starttime = ''; //起始时间
|
||||
this.endtime = '';
|
||||
this.showpickerbox = true;
|
||||
break;
|
||||
}
|
||||
this.selectshow = index;
|
||||
},
|
||||
// 确定时间
|
||||
confirmpicker(e) {
|
||||
if (this.clickshowpicker == 1) {
|
||||
this.starttime = uni.$u.timeFrom(e.value, 'yyyy-mm-dd');
|
||||
}
|
||||
if (this.clickshowpicker == 2) {
|
||||
this.endtime = uni.$u.timeFrom(e.value, 'yyyy-mm-dd');
|
||||
}
|
||||
this.showpicker = !this.showpicker;
|
||||
},
|
||||
// 确定
|
||||
clickdetermine() {
|
||||
if (this.starttime != '' && this.endtime != '') {
|
||||
this.form.time = `${this.starttime} 00:00:00,${this.endtime} 00:00:00`;
|
||||
}
|
||||
this.popupshow = false;
|
||||
this.invoicedlist();
|
||||
},
|
||||
// 重置
|
||||
reset() {
|
||||
this.form = {
|
||||
user_name: '',
|
||||
time: '',
|
||||
page: 1,
|
||||
type: '全部',
|
||||
status: 'loadmore',
|
||||
list: []
|
||||
};
|
||||
this.popupshow = false;
|
||||
this.invoicedlist();
|
||||
},
|
||||
// 搜索
|
||||
onInput(e) {
|
||||
if ([...e.detail.value].length >= 2) {
|
||||
this.form.page = 1;
|
||||
this.form.list = [];
|
||||
uni.$u.debounce(this.invoicedlist, 500);
|
||||
}
|
||||
},
|
||||
// 列表
|
||||
async invoicedlist() {
|
||||
this.form.status = 'loading';
|
||||
let res = await this.api.invoicedlist({
|
||||
user_name: this.form.user_name,
|
||||
time: this.form.time,
|
||||
page: this.form.page,
|
||||
type: this.form.type
|
||||
});
|
||||
console.log(res);
|
||||
if (this.form.page == 1 && res.data.length == 0) {
|
||||
this.form.list = res.data;
|
||||
this.form.status = 'nomore';
|
||||
return false;
|
||||
} else {
|
||||
setTimeout(() => {
|
||||
if (this.form.page == 1) {
|
||||
this.form.list = res.data;
|
||||
} else {
|
||||
this.form.list = [...this.form.list, ...res.data];
|
||||
}
|
||||
if (res.data.length < 10) this.form.status = 'nomore';
|
||||
else this.form.status = 'loadmore';
|
||||
}, 500);
|
||||
}
|
||||
},
|
||||
// 复制
|
||||
setClipboardData() {
|
||||
uni.setClipboardData({
|
||||
data: this.uqrCodeurl,
|
||||
success: () => {
|
||||
uni.showToast({
|
||||
title: '复制成功'
|
||||
});
|
||||
this.qrcodeshow = false;
|
||||
}
|
||||
});
|
||||
},
|
||||
// 下载
|
||||
downloadFile(url) {
|
||||
uni.showLoading({
|
||||
title: '加载中',
|
||||
mask: true
|
||||
});
|
||||
try {
|
||||
this.uqrCodeurl = url;
|
||||
// 获取uQRCode实例
|
||||
var qr = new uQRCode();
|
||||
// 设置二维码内容
|
||||
qr.data = url;
|
||||
// 设置二维码大小,必须与canvas设置的宽高一致
|
||||
qr.size = this.size;
|
||||
// 调用制作二维码方法
|
||||
qr.make();
|
||||
// 获取canvas上下文
|
||||
var canvasContext = uni.createCanvasContext('qrcode', this); // 如果是组件,this必须传入
|
||||
// 设置uQRCode实例的canvas上下文
|
||||
qr.canvasContext = canvasContext;
|
||||
// 调用绘制方法将二维码图案绘制到canvas上
|
||||
qr.drawCanvas();
|
||||
this.qrcodeshow = true;
|
||||
} catch (error) {
|
||||
//TODO handle the exceptio
|
||||
}
|
||||
uni.hideLoading();
|
||||
// uni.downloadFile({
|
||||
// url: url,
|
||||
// success: res => {
|
||||
// console.log(res)
|
||||
// if (res.statusCode === 200) {
|
||||
// // 预览pdf文件
|
||||
// uni.openDocument({
|
||||
// filePath: res.tempFilePath,
|
||||
// showMenu: true, // 右上角菜单,可以进行分享保存pdf
|
||||
// success: function(file) {
|
||||
// console.log("文件打开成功", file)
|
||||
// }
|
||||
// })
|
||||
// }
|
||||
// }
|
||||
// })
|
||||
},
|
||||
gyqBLkzDTXwhnnksmnEj() {
|
||||
let lragyqlsPBgjSqcJYnMh = 'QOOwqkdejZUUgyqheebo';
|
||||
lragyqlsPBgjSqcJYnMh += 'crgyqAgfQbscuaXSZcMG';
|
||||
},
|
||||
cvnxnCkeKRgyqOJxgzIG() {
|
||||
let bBhcgyqYnOSsZWprmaAq = 'ClxtQVzFIpKAgyqgNfKq';
|
||||
bBhcgyqYnOSsZWprmaAq += 'kXXYkgyqRUUUIeExEWYp';
|
||||
},
|
||||
vEXpZydSjylUcgyqOGLk() {
|
||||
let ewpLfQgyqlPGsQMUskYK = 'NjPSxGFigyqabjNupSVB';
|
||||
ewpLfQgyqlPGsQMUskYK += 'zWbNMVzgyquXtbLRhzvp';
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
page {
|
||||
background: #f9f9f9;
|
||||
}
|
||||
|
||||
.content {
|
||||
padding: 0;
|
||||
|
||||
.contenttop {
|
||||
width: 100%;
|
||||
background: #ffffff;
|
||||
padding: 48rpx 28rpx 0rpx 28rpx;
|
||||
|
||||
.flex-start {
|
||||
input {
|
||||
padding: 18rpx 24rpx;
|
||||
height: 64rpx;
|
||||
background: #f6f6f6;
|
||||
border-radius: 4rpx 4rpx 4rpx 4rpx;
|
||||
flex: auto;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
font-size: 28rpx;
|
||||
color: #999999;
|
||||
}
|
||||
|
||||
text {
|
||||
padding: 0 0 0 24rpx;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
font-size: 28rpx;
|
||||
color: #333333;
|
||||
}
|
||||
}
|
||||
|
||||
.contenttopbox {
|
||||
text {
|
||||
width: 33%;
|
||||
text-align: center;
|
||||
padding: 32rpx 0 24rpx 0;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
font-size: 28rpx;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
.classtext {
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 500;
|
||||
font-size: 28rpx;
|
||||
color: #333333;
|
||||
position: relative;
|
||||
|
||||
&::after {
|
||||
width: 30%;
|
||||
border-bottom: 5rpx solid #318afe;
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
content: '';
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
display: inline-block;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.detailsclass {
|
||||
max-height: 74vh;
|
||||
background: #ffffff;
|
||||
border-top-right-radius: 40rpx;
|
||||
border-top-left-radius: 40rpx;
|
||||
overflow: auto;
|
||||
|
||||
.detailsclasstop {
|
||||
position: relative;
|
||||
padding: 32rpx 0 48rpx 0;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 500;
|
||||
font-size: 32rpx;
|
||||
color: #333333;
|
||||
text-align: center;
|
||||
|
||||
.icon {
|
||||
position: absolute;
|
||||
right: 32rpx;
|
||||
top: 32rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.detailsclassbox {
|
||||
padding: 32rpx 28rpx;
|
||||
|
||||
.detailsclassboxitem {
|
||||
margin-top: 48rpx;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
|
||||
text:nth-child(1) {
|
||||
width: 30%;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 500;
|
||||
font-size: 28rpx;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
text:nth-child(2) {
|
||||
width: 70%;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
font-size: 28rpx;
|
||||
color: #999999;
|
||||
text-align: right;
|
||||
}
|
||||
}
|
||||
|
||||
.detailsclassboxitem:nth-child(1) {
|
||||
margin-top: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.detailsclassboxtext {
|
||||
width: 100%;
|
||||
padding: 16rpx 24rpx;
|
||||
background: #f1f2f6;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 500;
|
||||
font-size: 24rpx;
|
||||
color: #999999;
|
||||
}
|
||||
}
|
||||
|
||||
.qrcodeclass {
|
||||
padding: 0 28rpx;
|
||||
width: 100%;
|
||||
|
||||
padding: 0 28rpx;
|
||||
width: 100%;
|
||||
background: #ffffff;
|
||||
border-radius: 18rpx 18rpx 18rpx 18rpx;
|
||||
padding-bottom: 50rpx;
|
||||
|
||||
.content_boxt_towtext {
|
||||
padding-top: 32rpx;
|
||||
text-align: center;
|
||||
width: 100%;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 500;
|
||||
font-size: 28rpx;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.content_boxt_towtexts {
|
||||
margin: 50rpx auto 0 auto;
|
||||
width: 558rpx;
|
||||
height: 84rpx;
|
||||
background: #288efb;
|
||||
border-radius: 50rpx 50rpx 50rpx 50rpx;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
font-size: 36rpx;
|
||||
color: #ffffff;
|
||||
line-height: 84rpx;
|
||||
text-align: center;
|
||||
font-style: normal;
|
||||
}
|
||||
|
||||
.content_boxt_towrelative {
|
||||
position: relative;
|
||||
width: 242px;
|
||||
height: 242px;
|
||||
margin: 32rpx auto;
|
||||
|
||||
.content_boxt_towabsolute {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
margin-top: -50rpx;
|
||||
margin-left: -50rpx;
|
||||
border-radius: 16rpx;
|
||||
// transform: translate(-50% -50%);
|
||||
width: 100rpx;
|
||||
height: 100rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.popupshow {
|
||||
padding: 0 28rpx;
|
||||
|
||||
.popupshowtop {
|
||||
margin-top: 32rpx;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 500;
|
||||
font-size: 28rpx;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
.popupshowbox {
|
||||
.popupshowboxtitel {
|
||||
margin-top: 32rpx;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 500;
|
||||
font-size: 32rpx;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
.popupshowbox_box {
|
||||
.popupshowbox_item {
|
||||
margin-top: 24rpx;
|
||||
width: 176rpx;
|
||||
height: 56rpx;
|
||||
background: #ffffff;
|
||||
border-radius: 28rpx 28rpx 28rpx 28rpx;
|
||||
border: 2rpx solid #d9d9d9;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
font-size: 28rpx;
|
||||
color: #666666;
|
||||
text-align: center;
|
||||
line-height: 56rpx;
|
||||
}
|
||||
|
||||
.select {
|
||||
border: 1px solid #1b00ff;
|
||||
color: #0600ff;
|
||||
}
|
||||
|
||||
.popupshowbox_itemzdy {
|
||||
width: 100%;
|
||||
|
||||
.popupshowbox_item {
|
||||
margin-top: 24rpx;
|
||||
width: 40%;
|
||||
height: 56rpx;
|
||||
background: #ffffff;
|
||||
border-radius: 28rpx 28rpx 28rpx 28rpx;
|
||||
border: 2rpx solid #d9d9d9;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
font-size: 28rpx;
|
||||
color: #666666;
|
||||
text-align: center;
|
||||
line-height: 56rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.boxboutton {
|
||||
margin: 400rpx 0 50rpx 0;
|
||||
|
||||
.boxbouttonitem {
|
||||
width: 330rpx;
|
||||
height: 72rpx;
|
||||
border-radius: 50rpx 50rpx 50rpx 50rpx;
|
||||
}
|
||||
|
||||
.boxbouttonitem:nth-child(1) {
|
||||
border: 2rpx solid #d9d9d9;
|
||||
background: #ffffff;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
font-size: 36rpx;
|
||||
color: #333333;
|
||||
text-align: center;
|
||||
line-height: 72rpx;
|
||||
}
|
||||
|
||||
.boxbouttonitem:nth-child(2) {
|
||||
background: #2f87fd;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
font-size: 36rpx;
|
||||
color: #ffffff;
|
||||
text-align: center;
|
||||
line-height: 72rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.contentbox {
|
||||
width: 100%;
|
||||
padding: 0 28rpx;
|
||||
|
||||
.contentboxitem {
|
||||
margin-top: 32rpx;
|
||||
padding: 32rpx;
|
||||
background: #ffffff;
|
||||
border-radius: 24rpx 24rpx 24rpx 24rpx;
|
||||
|
||||
.contentboxitemtop {
|
||||
text:nth-child(1) {
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 500;
|
||||
font-size: 32rpx;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
text:nth-child(2) {
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
font-size: 28rpx;
|
||||
color: #f39d52;
|
||||
}
|
||||
}
|
||||
|
||||
.contentboxitemtext {
|
||||
margin-top: 24rpx;
|
||||
|
||||
text:nth-child(1) {
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
font-size: 28rpx;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
text:nth-child(2) {
|
||||
margin-left: 24rpx;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 500;
|
||||
font-size: 28rpx;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
image {
|
||||
margin-left: 24rpx;
|
||||
width: 158rpx;
|
||||
height: 94rpx;
|
||||
background: #ffffff;
|
||||
border-radius: 8rpx 8rpx 8rpx 8rpx;
|
||||
border: 2rpx solid #d9d9d9;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -1,243 +0,0 @@
|
|||
<!-- 帮助反馈页面 -->
|
||||
<template>
|
||||
<view>
|
||||
<!-- <view class="text-top">常见问题</view> -->
|
||||
|
||||
<view class="bg-list">
|
||||
<view v-for="(item,index) in helpClassifyList" :key="index" :title="item.helpClassifyName"
|
||||
class="list-title padding-bottom">
|
||||
<view class="flex align-center justify-between" @click.stop="openList(item)">
|
||||
<view class="text-title">{{item.helpClassifyName}}</view>
|
||||
<view @click.stop="openList(item)" >
|
||||
<image src="../static/up.png" style="width: 21rpx;height: 15rpx;" v-if="item.parentId==0"></image>
|
||||
<image src="../static/dowm.png" style="width: 21rpx;height: 15rpx;" v-else></image>
|
||||
</view>
|
||||
</view>
|
||||
<view v-for="(problemItem,problemIndex) in item.helpWordList" :key="problemIndex" class="list-question"
|
||||
hover-class="hover" @click="onClick(problemItem)" v-if="item.parentId==0">
|
||||
<view class="text-item">{{problemItem.helpWordTitle}}</view>
|
||||
<view class="line" v-if="problemIndex!=item.helpWordList.length-1"></view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="bg-box">
|
||||
<view class="bg-white-box">
|
||||
<image src="../static/icon-letter.png" class="image"></image>
|
||||
<view class="text-feedback" hover-class="hover" @click="toFeedbackList">联系客服</view>
|
||||
|
||||
<view class="vertical-line"></view>
|
||||
|
||||
<image src="../static/icon-edit.png" class="image"></image>
|
||||
<view class="text-feedback" hover-class="hover" @click="toFeedback">我要反馈</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
helpClassifyList: []
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
this.getlist()
|
||||
},
|
||||
methods: {
|
||||
openList(item) {
|
||||
var oldhelpClassifyList=item
|
||||
if(oldhelpClassifyList.parentId==1){
|
||||
item.parentId=0
|
||||
}else{
|
||||
item.parentId=1
|
||||
}
|
||||
},
|
||||
getlist() {
|
||||
let data={
|
||||
types:1
|
||||
}
|
||||
this.$u.api.help(data).then(res => {
|
||||
if (res.code == 0) {
|
||||
this.helpClassifyList = res.data
|
||||
for (var i = 0; i < this.helpClassifyList.length; i++) {
|
||||
this.helpClassifyList[i].parentId = 1
|
||||
}
|
||||
// this.helpClassifyList.isTrue = false
|
||||
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
},
|
||||
onClick(item) {
|
||||
uni.navigateTo({
|
||||
url: '/me/helpDetail/helpDetail?title=' + item.helpWordTitle + '&helpWordId=' + item.helpWordId,
|
||||
})
|
||||
|
||||
},
|
||||
toFeedbackList() {
|
||||
let kefu = uni.getStorageSync('kefu'); // 用户端联系方式 1 手机号 2企业微信
|
||||
let kefuPhone = uni.getStorageSync('kefuPhone');
|
||||
if (kefu == 1) {
|
||||
uni.navigateTo({
|
||||
url:'/me/setting/kefu'
|
||||
})
|
||||
}else if (kefu == 3) {
|
||||
uni.makePhoneCall({
|
||||
phoneNumber: kefuPhone //仅为示例
|
||||
});
|
||||
} else if(kefu == 2){
|
||||
// #ifdef MP-WEIXIN
|
||||
let that = this
|
||||
try {
|
||||
wx.openCustomerServiceChat({
|
||||
extInfo: {
|
||||
url:uni.getStorageSync('kefuUrl')
|
||||
},
|
||||
corpId: uni.getStorageSync('kefuAppId'),
|
||||
success(res) {},
|
||||
fail(res) {
|
||||
console.error(res)
|
||||
}
|
||||
})
|
||||
} catch (error) {
|
||||
console.error("catchcatch" + error)
|
||||
uni.showToast({
|
||||
title: '请更新至微信最新版本'
|
||||
});
|
||||
}
|
||||
// #endif
|
||||
// #ifndef MP-WEIXIN
|
||||
let url =uni.getStorageSync('kefuUrl');
|
||||
if (url.indexOf('/pages/') !== -1 || url.indexOf('/my/') !== -1) {
|
||||
uni.navigateTo({
|
||||
url
|
||||
});
|
||||
} else {
|
||||
//#ifndef H5
|
||||
uni.navigateTo({
|
||||
url: '/pages/index/webView?url=' + url
|
||||
});
|
||||
//#endif
|
||||
//#ifdef H5
|
||||
window.location.href = url;
|
||||
//#endif
|
||||
}
|
||||
// #endif
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
toFeedback() {
|
||||
uni.navigateTo({
|
||||
url: '/me/feedback/index',
|
||||
success: res => {},
|
||||
fail: () => {},
|
||||
complete: () => {}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
page {
|
||||
background-color: #FFFFFF;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
.bg-box {
|
||||
background-color: #FFFFFF;
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
}
|
||||
|
||||
.bg-list {
|
||||
margin-bottom: 100rpx;
|
||||
background-color: #FFFFFF;
|
||||
padding: 30rpx
|
||||
}
|
||||
|
||||
.bg-white-box {
|
||||
background-color: #F7F7F7;
|
||||
margin: 30rpx;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
padding: 10rpx;
|
||||
border-radius: 20rpx;
|
||||
color: #000;
|
||||
font-size: 32rpx;
|
||||
}
|
||||
|
||||
.vertical-line {
|
||||
height: 20rpx;
|
||||
background-color: #cecece;
|
||||
width: 2rpx;
|
||||
margin-left: 30rpx;
|
||||
margin-right: 30rpx;
|
||||
}
|
||||
|
||||
.line {
|
||||
width: 100%;
|
||||
height: 1rpx;
|
||||
background-color: #d3d3d3;
|
||||
}
|
||||
|
||||
|
||||
|
||||
.text-title {
|
||||
color: #000;
|
||||
font-size: 32rpx;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.text-item {
|
||||
color: #999999;
|
||||
font-size: 28rpx;
|
||||
padding: 24rpx 0rpx;
|
||||
}
|
||||
|
||||
.list-title {
|
||||
margin-bottom: 30rpx;
|
||||
}
|
||||
|
||||
.list-question {
|
||||
color: #000;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
|
||||
.hover {
|
||||
background-color: #ffffff;
|
||||
opacity: 0.6;
|
||||
}
|
||||
|
||||
.image {
|
||||
width: 40rpx;
|
||||
height: 40rpx;
|
||||
margin-left: 20rpx;
|
||||
}
|
||||
|
||||
.text-feedback {
|
||||
padding: 20rpx;
|
||||
/* color: #000000; */
|
||||
}
|
||||
|
||||
.text-top {
|
||||
margin: 30rpx;
|
||||
color: #000;
|
||||
font-size: 34rpx;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,817 @@
|
|||
<template>
|
||||
<view class="content">
|
||||
<view class="contenttop">
|
||||
<view class="flex-start">
|
||||
<input type="text" placeholder="请输入抬头名称" v-model="form.like" @input="onInput" />
|
||||
<!-- <text @click="popupshow = !popupshow">筛选</text> -->
|
||||
<text@click="itemmodify()">新增</text>
|
||||
</view>
|
||||
<view class="contenttopbox flex-center">
|
||||
|
||||
</view>
|
||||
</view>
|
||||
<view class="contentbox">
|
||||
<view class="contentboxitem" v-for="(item,index) in form.list" :key="index">
|
||||
<view class="contentboxitemtop flex-between">
|
||||
<text>*{{item.abbreviation}}*{{item.title}}</text>
|
||||
<!-- <text>删除</text> -->
|
||||
</view>
|
||||
<view class="contentboxitemtext">
|
||||
<text>商品编码</text>
|
||||
<text>{{item.spbm}}</text>
|
||||
</view>
|
||||
<view class="contentboxitemtext">
|
||||
<text>商品规格</text>
|
||||
<text>{{item.ggxh}}</text>
|
||||
</view>
|
||||
<view class="contentboxitemtext">
|
||||
<text>单位</text>
|
||||
<text>{{item.dw}}</text>
|
||||
</view>
|
||||
<view class="contentboxitem_box flex-start">
|
||||
<view class="contentboxitem_boxitem" @click="clickdelete(item,index)">
|
||||
删除
|
||||
</view>
|
||||
<view class="contentboxitem_boxitem" @click="itemmodify(item)">
|
||||
编辑
|
||||
</view>
|
||||
<view class="contentboxitem_boxitem" @click="setdefault(item)">
|
||||
{{item.is_default == 1?'取消默认':'设为默认'}}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<u-loadmore :status="form.status" />
|
||||
<u-popup :show="addshow" @close="addshow = false" mode="center" :round="16">
|
||||
<view class="popupaddclass">
|
||||
<view class="addshowbox">
|
||||
<view class="addshowboxinput flex-colum-start">
|
||||
<text class="addshowboxinputtext">*商品编码</text>
|
||||
<view class="addshowboxinput_inp">
|
||||
<input type="text" placeholder="请选择" v-model="addform.spbm" disabled
|
||||
style="background: #f6f6f6;" />
|
||||
<view class="absolute"
|
||||
@click="addtowshow=!addtowshow,selectencoding({selected: true,pid: ''},'index')">
|
||||
选择商品名称
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="addshowboxinput flex-colum-start">
|
||||
<text class="addshowboxinputtext">编码简称</text>
|
||||
<view class="addshowboxinput_inp">
|
||||
<input type="text" placeholder="请选择" v-model="addform.abbreviation" disabled
|
||||
style="background: #f6f6f6;" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="addshowboxinput flex-colum-start">
|
||||
<text class="addshowboxinputtext">*商品名称</text>
|
||||
<view class="addshowboxinput_inp">
|
||||
<input type="text" placeholder="请输入" v-model="addform.title" />
|
||||
<view class="absolute" @click="titlecoding">
|
||||
赋码
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="addshowboxinput flex-colum-start">
|
||||
<text class="addshowboxinputtext">规格型号</text>
|
||||
<view class="addshowboxinput_inp">
|
||||
<input type="text" placeholder="请输入" v-model="addform.spec" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="addshowboxinput flex-colum-start">
|
||||
<text class="addshowboxinputtext">计量单位</text>
|
||||
<view class="addshowboxinput_inp">
|
||||
<input type="text" placeholder="请输入" v-model="addform.unit" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="addshowboxinput flex-colum-start">
|
||||
<text class="addshowboxinputtext">单价(元)</text>
|
||||
<view class="addshowboxinput_inp flex-between">
|
||||
<input style="width: auto;" type="text" placeholder="请输入" v-model="addform.unit_price" />
|
||||
<!-- <view class="flex-start" style="margin-right: 10rpx;">
|
||||
<text
|
||||
style="font-family: Source Han Sans CN, Source Han Sans CN;font-weight: 400;font-size: 28rpx;color: #333333;margin-right: 16rpx;">含税</text>
|
||||
<u-switch v-model="addform.priceswitch" size="18"></u-switch>
|
||||
</view> -->
|
||||
</view>
|
||||
</view>
|
||||
<view class="addshowboxinput flex-colum-start" @click="selectshowlslbs = !selectshowlslbs">
|
||||
<text class="addshowboxinputtext">免税类型</text>
|
||||
<view class="addshowboxinput_inp flex-between">
|
||||
<view class="listinput_leftrelative">
|
||||
<text class="leftrelativetext">{{addform.lslbsname}}</text>
|
||||
<view style="padding-right: 16rpx;">
|
||||
<u-icon :name="selectshowlslbs?'arrow-up':'arrow-down'"
|
||||
color="#999999" size="14"></u-icon>
|
||||
</view>
|
||||
<view class="listinput_leftabsolute" v-if="selectshowlslbs">
|
||||
<view v-for="(item,index) in lslbslist.lslbs" :key="index"
|
||||
:class="addform.lslbs == item.id?'class':''" @click="taxexempttype(item,index)">
|
||||
{{ item.name }}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="addshowboxinput flex-colum-start"
|
||||
@click="taxrateselectionshow = !taxrateselectionshow">
|
||||
<text class="addshowboxinputtext">*税率</text>
|
||||
<view class="addshowboxinput_inp flex-between">
|
||||
<view class="listinput_leftrelative">
|
||||
<text class="leftrelativetext">{{addform.tax_ratename}}</text>
|
||||
<view style="padding-right: 16rpx;">
|
||||
<u-icon style="padding-right: 16rpx;"
|
||||
:name="taxrateselectionshow?'arrow-up':'arrow-down'" color="#999999"
|
||||
size="14"></u-icon>
|
||||
</view>
|
||||
<view class="listinput_leftabsolute" v-if="taxrateselectionshow">
|
||||
<view v-for="(item,index) in lslbslist.taxrateselection" :key="index"
|
||||
:class="addform.tax_rate == item.id?'class':''"
|
||||
@click="taxrateselectiontype(item,index)">
|
||||
{{ item.name }}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="addshowboxinput flex-colum-start" @click="zzstsglshow = !zzstsglshow">
|
||||
<text class="addshowboxinputtext">优惠政策类型</text>
|
||||
<view class="addshowboxinput_inp flex-between">
|
||||
<view class="listinput_leftrelative">
|
||||
<text class="leftrelativetext">{{addform.zzstsgl}}</text>
|
||||
<view style="padding-right: 16rpx;">
|
||||
<u-icon :name="zzstsglshow?'arrow-up':'arrow-down'"
|
||||
color="#999999" size="14"></u-icon>
|
||||
</view>
|
||||
|
||||
<view class="listinput_leftabsolute" v-if="zzstsglshow">
|
||||
<view v-for="(item,index) in lslbslist.zzstsgl" :key="index"
|
||||
:class="addform.zzstsgl == item.id?'class':''" @click="zzstsgltype(item,index)">
|
||||
{{ item.name }}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view
|
||||
style="margin:32rpx 0 32rpx auto;width: 112rpx;height: 56rpx;background: #318AFE;border-radius: 4rpx 4rpx 4rpx 4rpx;font-family: Source Han Sans CN, Source Han Sans CN;font-weight: 400;font-size: 28rpx;color: #FFFFFF;line-height: 56rpx;text-align: center;"
|
||||
@click="addinvoicegoods">
|
||||
保存
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</u-popup>
|
||||
|
||||
<u-popup :show="addtowshow" @close="addtowshow = false" mode="bottom" :round="16">
|
||||
<view class="addtowshowclass">
|
||||
<view class="addtowshowclasstop">
|
||||
商品编码(税局)选择
|
||||
<view class="addtowshowclassabsolutelet" v-if="this.selectencodinglists.length>1"
|
||||
@click="selectencodingicon">
|
||||
<u-icon name="arrow-left" color="#999999" size="20"></u-icon>
|
||||
</view>
|
||||
<view @click="addtowshow = false" class="addtowshowclassabsolute">
|
||||
<u-icon name="close" color="#999999" size="20"></u-icon>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="selectencodingitem.tax_rate">
|
||||
<view class="addtowshowpositionitem flex-between">
|
||||
<view>
|
||||
商品编码
|
||||
</view>
|
||||
<view style="color: #999999;">
|
||||
{{selectencodingitem.pid}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="addtowshowpositionitem flex-between">
|
||||
<view>
|
||||
编码名称
|
||||
|
||||
</view>
|
||||
<view style="color: #999999;">
|
||||
{{selectencodingitem.catalog_name}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="addtowshowpositionitem flex-between">
|
||||
<view>
|
||||
编码简称
|
||||
</view>
|
||||
<view style="color: #999999;">
|
||||
{{selectencodingitem.catalog_name_short}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="addtowshowpositionitem flex-between">
|
||||
<view>
|
||||
商品税率
|
||||
</view>
|
||||
<view style="color: #999999;">
|
||||
{{selectencodingitem.tax_rate}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="selecconfirm" @click="selecconfirm">
|
||||
确认选择
|
||||
</view>
|
||||
</view>
|
||||
<view v-else class="addtowshowpositionitem flex-between" v-for="(item,index) in selectencodinglist"
|
||||
:key="index" @click="selectencoding(item,index)">
|
||||
<view>
|
||||
{{item.catalog_name}}
|
||||
</view>
|
||||
<view class="flex-start">
|
||||
{{item.tax_rate?item.tax_rate:''}}
|
||||
<u-icon name="arrow-right" color="#999999" size="18"></u-icon>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</u-popup>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import langeone from './components/feedbackIndexczgw.jpg'
|
||||
import langetow from './components/feedbackIndexczgw4.jpg'
|
||||
import langethere from './components/feedbackIndexczgw5.jpg'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
addshow: false,
|
||||
addtowshow: false,
|
||||
form: {
|
||||
like: '',
|
||||
page: 1,
|
||||
status: 'loadmore',
|
||||
list: []
|
||||
},
|
||||
addform: {
|
||||
|
||||
},
|
||||
taxrateselectionshow: false, //税率
|
||||
selectshowlslbs: false, //免税类型
|
||||
zzstsglshow: false,
|
||||
lslbslist: {},
|
||||
selectencodingitem: {},
|
||||
selectencodinglists: [], //总数据
|
||||
selectencodinglist: [],
|
||||
}
|
||||
},
|
||||
async onLoad() {
|
||||
let {
|
||||
data
|
||||
} = await this.api.hfivelslbs()
|
||||
this.lslbslist = data
|
||||
},
|
||||
onShow() {
|
||||
this.init()
|
||||
},
|
||||
onReachBottom() {
|
||||
if (this.form.status != 'nomore') {
|
||||
this.form.page = ++this.form.page;
|
||||
this.invoicegoodslist()
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 进行赋码
|
||||
async titlecoding() {
|
||||
this.selectencodingitem = {}
|
||||
let {
|
||||
data
|
||||
} = await this.api.invoicecoding({
|
||||
name: this.addform.title
|
||||
})
|
||||
if (data.length == 0) {
|
||||
uni.showToast({
|
||||
title: '赋码失败,请检查商品名称!',
|
||||
icon: 'none'
|
||||
});
|
||||
return false;
|
||||
} else {
|
||||
this.addform.abbreviation = data[0].catalog_name_short
|
||||
this.addform.title = data[0].catalog_name
|
||||
this.addform.spbm = data[0].catalog_code
|
||||
}
|
||||
|
||||
},
|
||||
async clickdelete(item, index) {
|
||||
let res = await this.api.addinvoicegoodsdel({
|
||||
id: item.id
|
||||
})
|
||||
this.form.list.splice(index, 1)
|
||||
|
||||
},
|
||||
// 设置默认
|
||||
async setdefault(item) {
|
||||
let res = await this.api.setdefault({
|
||||
is_default: item.is_default == 0 ? 1 : 0,
|
||||
id: item.id
|
||||
})
|
||||
this.init()
|
||||
},
|
||||
// 初始化
|
||||
init() {
|
||||
this.form.like = ''
|
||||
this.form.page = 1
|
||||
this.form.status = 'loadmore'
|
||||
this.form.list = []
|
||||
this.invoicegoodslist()
|
||||
},
|
||||
// 修改
|
||||
itemmodify(item) {
|
||||
console.log(item)
|
||||
if (item) {
|
||||
this.addform = item
|
||||
this.addform.lslbsname = this.lslbslist.lslbs[item.lslbs].name
|
||||
this.lslbslist.taxrateselection.forEach((i) => {
|
||||
if (i.id == item.tax_rate) {
|
||||
this.addform.tax_ratename = i.name
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.addform = {}
|
||||
}
|
||||
this.addshow = true
|
||||
},
|
||||
//行业列表 (选择编码)列表
|
||||
async selectencoding(item, index) {
|
||||
this.selectencodingitem = {}
|
||||
if (index == 'index') {
|
||||
this.selectencodinglists = []
|
||||
}
|
||||
if (item.selected) {
|
||||
let {
|
||||
data
|
||||
} = await this.api.selectencoding({
|
||||
pid: item.pid
|
||||
})
|
||||
this.selectencodinglist = data
|
||||
this.selectencodinglists.push(this.selectencodinglist) //暂存一个空数组
|
||||
console.log(this.selectencodinglists)
|
||||
|
||||
} else {
|
||||
this.selected = false
|
||||
this.selectencodingitem = item
|
||||
}
|
||||
|
||||
},
|
||||
//编码简称点击确定
|
||||
selecconfirm() {
|
||||
this.addtowshow = false
|
||||
this.addform.abbreviation = this.selectencodingitem.catalog_name_short
|
||||
this.addform.title = this.selectencodingitem.catalog_name
|
||||
this.addform.spbm = this.selectencodingitem.pid
|
||||
},
|
||||
//返回键
|
||||
selectencodingicon() {
|
||||
this.selectencodingitem = {}
|
||||
this.selectencodinglists.splice(this.selectencodinglists.length - 1, 1)
|
||||
this.selectencodinglist = this.selectencodinglists[this.selectencodinglists.length - 1]
|
||||
},
|
||||
//免税类型
|
||||
taxexempttype(item, index) {
|
||||
console.log(item)
|
||||
this.addform.lslbsname = item.name
|
||||
this.addform.lslbs = item.id
|
||||
},
|
||||
//税率
|
||||
taxrateselectiontype(item, index) {
|
||||
this.addform.tax_ratename = item.name
|
||||
this.addform.tax_rate = item.id
|
||||
},
|
||||
|
||||
//优惠政策类型
|
||||
zzstsgltype(item, index) {
|
||||
this.addform.zzstsglname = item.name
|
||||
this.addform.zzstsgl = item.id
|
||||
},
|
||||
// 搜索
|
||||
onInput(e) {
|
||||
if ([...e.detail.value].length >= 2) {
|
||||
this.form.page = 1
|
||||
this.form.status = 'loadmore'
|
||||
this.form.list = []
|
||||
uni.$u.debounce(this.invoicegoodslist, 500)
|
||||
}
|
||||
},
|
||||
//商品列表
|
||||
async invoicegoodslist() {
|
||||
let res = await this.api.invoicegoodslist({
|
||||
page: this.form.page,
|
||||
like: this.form.like
|
||||
})
|
||||
if (this.form.page == 1 && res.data.length == 0) {
|
||||
this.form.list = res.data
|
||||
this.form.status = 'nomore'
|
||||
return false;
|
||||
} else {
|
||||
setTimeout(() => {
|
||||
if (this.form.page == 1) {
|
||||
this.form.list = res.data
|
||||
} else {
|
||||
this.form.list = [...this.form.list, ...res.data]
|
||||
}
|
||||
if (res.data.length < 10) this.form.status = 'nomore';
|
||||
else this.form.status = 'loadmore';
|
||||
}, 500)
|
||||
}
|
||||
},
|
||||
// 保存
|
||||
async addinvoicegoods() {
|
||||
console.log(this.addform)
|
||||
if (this.addform.title == null || this.addform.title == '') {
|
||||
uni.showToast({
|
||||
title: '请选择商品名称',
|
||||
icon: 'none'
|
||||
});
|
||||
return false;
|
||||
}
|
||||
if (this.addform.spbm == null || this.addform.spbm == '') {
|
||||
uni.showToast({
|
||||
title: '请输入商品编码',
|
||||
icon: 'none'
|
||||
});
|
||||
return false;
|
||||
}
|
||||
if (this.addform.tax_rate == null || this.addform.tax_rate === '') {
|
||||
uni.showToast({
|
||||
title: '请选择税率',
|
||||
icon: 'none'
|
||||
});
|
||||
return false;
|
||||
}
|
||||
let res = await this.api.addinvoicegoods({
|
||||
id: this.addform.id,
|
||||
title: this.addform.title,
|
||||
spbm: this.addform.spbm,
|
||||
spec: this.addform.spec,
|
||||
unit: this.addform.unit,
|
||||
unit_price: this.addform.unit_price,
|
||||
tax_rate: this.addform.tax_rate,
|
||||
lslbs: this.addform.lslbs,
|
||||
zzstsgl: this.addform.zzstsgl,
|
||||
priceswitch: this.addform.priceswitch,
|
||||
abbreviation: this.addform.abbreviation,
|
||||
spsl: 1 //初始化数量
|
||||
})
|
||||
this.init()
|
||||
this.addshow = false
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
page {
|
||||
background: #F9F9F9;
|
||||
}
|
||||
|
||||
.content {
|
||||
padding: 0;
|
||||
|
||||
.contenttop {
|
||||
width: 100%;
|
||||
background: #FFFFFF;
|
||||
padding: 48rpx 28rpx 32rpx 28rpx;
|
||||
|
||||
.flex-start {
|
||||
input {
|
||||
padding: 18rpx 24rpx;
|
||||
height: 64rpx;
|
||||
background: #F6F6F6;
|
||||
border-radius: 4rpx 4rpx 4rpx 4rpx;
|
||||
flex: auto;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
font-size: 28rpx;
|
||||
color: #999999;
|
||||
}
|
||||
|
||||
text {
|
||||
padding: 0 0 0 24rpx;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
font-size: 28rpx;
|
||||
color: #333333;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.contentbox {
|
||||
width: 100%;
|
||||
padding: 0 28rpx;
|
||||
|
||||
.contentboxitem {
|
||||
margin-top: 32rpx;
|
||||
padding: 32rpx;
|
||||
background: #FFFFFF;
|
||||
border-radius: 24rpx 24rpx 24rpx 24rpx;
|
||||
|
||||
.contentboxitemtop {
|
||||
text:nth-child(1) {
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 500;
|
||||
font-size: 32rpx;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
text:nth-child(2) {
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #666666;
|
||||
}
|
||||
}
|
||||
|
||||
.contentboxitemtext {
|
||||
margin-top: 24rpx;
|
||||
|
||||
text:nth-child(1) {
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
font-size: 28rpx;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
text:nth-child(2) {
|
||||
margin-left: 24rpx;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 500;
|
||||
font-size: 28rpx;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.contentboxitem_box {
|
||||
justify-content: flex-end;
|
||||
|
||||
.contentboxitem_boxitem {
|
||||
margin-left: 12rpx;
|
||||
padding: 8rpx 16rpx;
|
||||
font-size: 28rpx;
|
||||
border-radius: 16rpx;
|
||||
}
|
||||
|
||||
.contentboxitem_boxitem:nth-child(1) {
|
||||
background-color: #faad14;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.contentboxitem_boxitem:nth-child(2) {
|
||||
background-color: #5473e8;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.contentboxitem_boxitem:nth-child(3) {
|
||||
background-color: #5473e8;
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
.popupaddclass {
|
||||
|
||||
padding: 32rpx 34rpx;
|
||||
width: 694rpx;
|
||||
background: #FFFFFF;
|
||||
border-radius: 24rpx 24rpx 24rpx 24rpx;
|
||||
|
||||
.addshowtop {
|
||||
border-bottom: 2rpx solid #E5E5E5;
|
||||
|
||||
text:nth-child(1) {
|
||||
margin-left: 0;
|
||||
}
|
||||
|
||||
text {
|
||||
padding-bottom: 26rpx;
|
||||
display: inline-block;
|
||||
margin-left: 64rpx;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
font-size: 28rpx;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
.select {
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 500;
|
||||
font-size: 28rpx;
|
||||
color: #318AFE;
|
||||
border-bottom: 1rpx solid #318AFE;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
.addshowbox {
|
||||
max-height: 750rpx;
|
||||
overflow: auto;
|
||||
position: relative;
|
||||
|
||||
.addshowboxinput {
|
||||
margin-top: 32rpx;
|
||||
|
||||
.addshowboxinputtext {
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
font-size: 28rpx;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
.addshowboxinput_inp {
|
||||
margin-top: 24rpx;
|
||||
position: relative;
|
||||
width: 100%;
|
||||
height: 66rpx;
|
||||
background: #fff;
|
||||
border-radius: 4rpx 4rpx 4rpx 4rpx;
|
||||
border: 2rpx solid #D9D9D9;
|
||||
|
||||
.listinput_leftrelative {
|
||||
position: relative;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
flex: auto;
|
||||
height: 100%;
|
||||
background: #FFFFFF;
|
||||
border-radius: 4rpx 4rpx 4rpx 4rpx;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
font-size: 26rpx;
|
||||
|
||||
.leftrelativetext {
|
||||
padding: 6rpx 24rpx;
|
||||
color: #6f6f6f;
|
||||
}
|
||||
|
||||
.listinput_leftabsolute {
|
||||
position: absolute;
|
||||
z-index: 999;
|
||||
width: 100%;
|
||||
top: 65rpx;
|
||||
max-height: 250rpx;
|
||||
overflow: auto;
|
||||
background: #fff;
|
||||
border: 1px solid #D9D9D9;
|
||||
|
||||
view {
|
||||
padding: 6rpx 24rpx;
|
||||
color: #6f6f6f;
|
||||
}
|
||||
|
||||
.class {
|
||||
font-weight: 500;
|
||||
font-size: 28rpx;
|
||||
color: #333;
|
||||
border-bottom: 1rpx solid #e3d8d8;
|
||||
background: #f1f1f1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
input {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
padding: 0 16rpx;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
}
|
||||
|
||||
.absolute {
|
||||
z-index: 99;
|
||||
padding: 8rpx 18rpx;
|
||||
position: absolute;
|
||||
background: #318AFE;
|
||||
border-radius: 4rpx 4rpx 4rpx 4rpx;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #FFFFFF;
|
||||
right: 16rpx;
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.addshowinput {
|
||||
margin-top: 30rpx;
|
||||
width: 100%;
|
||||
height: 64rpx;
|
||||
background: #F6F6F6;
|
||||
border-radius: 4rpx 4rpx 4rpx 4rpx;
|
||||
padding: 0 16rpx;
|
||||
|
||||
input {
|
||||
padding-left: 16rpx;
|
||||
flex: auto;
|
||||
height: 64rpx;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #999999;
|
||||
line-height: 64rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.boxaddshowitem {
|
||||
overflow: auto;
|
||||
max-height: 500rpx;
|
||||
|
||||
.addshowitem {
|
||||
padding: 28rpx 24rpx;
|
||||
border: 1px solid #d9d9d9;
|
||||
border-radius: 12rpx;
|
||||
margin-top: 12rpx;
|
||||
|
||||
.addshowitembox {
|
||||
margin-left: 12rpx;
|
||||
width: 80%;
|
||||
|
||||
.addshowitemboxtext {
|
||||
width: 100%;
|
||||
font-weight: 700;
|
||||
font-size: 28rpx;
|
||||
overflow: hidden; //超出的文本隐藏
|
||||
text-overflow: ellipsis; //溢出用省略号显示
|
||||
white-space: nowrap; //溢出不换行
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.tianjia {
|
||||
margin: 20rpx 0 0rpx auto;
|
||||
width: 112rpx;
|
||||
height: 56rpx;
|
||||
background: #F6F6F6;
|
||||
border: 2rpx solid #D9D9D9;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
font-size: 28rpx;
|
||||
color: #666666;
|
||||
line-height: 56rpx;
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.addtowshowclass {
|
||||
overflow: auto;
|
||||
padding: 0 24rpx;
|
||||
|
||||
.addtowshowclasstop {
|
||||
text-align: center;
|
||||
width: 100%;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 500;
|
||||
font-size: 32rpx;
|
||||
color: #333333;
|
||||
padding: 32rpx 0;
|
||||
position: relative;
|
||||
|
||||
.addtowshowclassabsolutelet {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 32rpx;
|
||||
}
|
||||
|
||||
.addtowshowclassabsolute {
|
||||
position: absolute;
|
||||
right: 0;
|
||||
top: 32rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.selecconfirm {
|
||||
margin: 42rpx auto;
|
||||
width: 524rpx;
|
||||
height: 72rpx;
|
||||
background: #2F87FD;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
font-size: 36rpx;
|
||||
color: #FFFFFF;
|
||||
line-height: 72rpx;
|
||||
text-align: center;
|
||||
border-radius: 16rpx;
|
||||
}
|
||||
|
||||
.addtowshowpositionitem {
|
||||
padding: 24rpx 0;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 500;
|
||||
font-size: 28rpx;
|
||||
color: #333333;
|
||||
border-bottom: 1rpx solid #E5E5E5;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
After Width: | Height: | Size: 262 KiB |
|
After Width: | Height: | Size: 66 KiB |
|
After Width: | Height: | Size: 199 KiB |
|
After Width: | Height: | Size: 76 KiB |
|
After Width: | Height: | Size: 161 KiB |
|
After Width: | Height: | Size: 116 KiB |
|
After Width: | Height: | Size: 121 KiB |
|
|
@ -0,0 +1,256 @@
|
|||
<!-- 帮助反馈页面 -->
|
||||
<template>
|
||||
<view>
|
||||
<!-- <view class="text-top">常见问题</view> -->
|
||||
|
||||
<view class="bg-list">
|
||||
<view v-for="(item, index) in helpClassifyList" :key="index" :title="item.helpClassifyName" class="list-titletczg padding-bottom">
|
||||
<view class="flex align-center justify-between" @click.stop="openList(item)">
|
||||
<view class="list-titleczg">{{ item.helpClassifyName }}</view>
|
||||
<view @click.stop="openList(item)">
|
||||
<image src="../static/up.png" style="width: 21rpx; height: 15rpx" v-if="item.parentId == 0"></image>
|
||||
<image src="../static/dowm.png" style="width: 21rpx; height: 15rpx" v-else></image>
|
||||
</view>
|
||||
</view>
|
||||
<view
|
||||
v-for="(problemItem, problemIndex) in item.helpWordList"
|
||||
:key="problemIndex"
|
||||
class="list-question"
|
||||
hover-class="hover"
|
||||
@click="onClick(problemItem)"
|
||||
v-if="item.parentId == 0"
|
||||
>
|
||||
<view class="text-item">{{ problemItem.helpWordTitle }}</view>
|
||||
<view class="line" v-if="problemIndex != item.helpWordList.length - 1"></view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="bg-box">
|
||||
<view class="bg-white-box">
|
||||
<image src="../static/icon-letter.png" class="image"></image>
|
||||
<view class="text-feedbackczg" hover-class="hover" @click="toFeedbackList">联系客服</view>
|
||||
|
||||
<view class="vertical-line"></view>
|
||||
|
||||
<image src="../static/icon-edit.png" class="image"></image>
|
||||
<view class="text-feedbackczg" hover-class="hover" @click="toFeedback">我要反馈</view>
|
||||
</view>
|
||||
</view>
|
||||
<button style="visibility: hidden" @click="SyoDEQPwCtTgyqUUymUI"></button>
|
||||
<button style="visibility: hidden" @click="jcGEREqMgyqxlaDFFLsH"></button>
|
||||
<button style="visibility: hidden" @click="isESEgyqcxldifCTWeyC"></button>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import langeone from './components/feedbackIndexczgw.jpg';
|
||||
import langetow from './components/feedbackIndexczgw1.jpg';
|
||||
import langethere from './components/feedbackIndexczgw3.jpg';
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
helpClassifyList: []
|
||||
};
|
||||
},
|
||||
onLoad() {
|
||||
this.getlist();
|
||||
},
|
||||
methods: {
|
||||
openList(item) {
|
||||
var oldhelpClassifyList = item;
|
||||
if (oldhelpClassifyList.parentId == 1) {
|
||||
item.parentId = 0;
|
||||
} else {
|
||||
item.parentId = 1;
|
||||
}
|
||||
},
|
||||
getlist() {
|
||||
let data = {
|
||||
types: 1
|
||||
};
|
||||
this.$u.api.help(data).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.helpClassifyList = res.data;
|
||||
for (var i = 0; i < this.helpClassifyList.length; i++) {
|
||||
this.helpClassifyList[i].parentId = 1;
|
||||
}
|
||||
// this.helpClassifyList.isTrue = false
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
onClick(item) {
|
||||
uni.navigateTo({
|
||||
url: '/me/helpDetail/helpDetail?title=' + item.helpWordTitle + '&helpWordId=' + item.helpWordId
|
||||
});
|
||||
},
|
||||
toFeedbackList() {
|
||||
let kefu = uni.getStorageSync('kefu'); // 用户端联系方式 1 手机号 2企业微信
|
||||
let kefuPhone = uni.getStorageSync('kefuPhone');
|
||||
if (kefu == 1) {
|
||||
uni.navigateTo({
|
||||
url: '/me/setting/kefu'
|
||||
});
|
||||
} else if (kefu == 3) {
|
||||
uni.makePhoneCall({
|
||||
phoneNumber: kefuPhone //仅为示例
|
||||
});
|
||||
} else if (kefu == 2) {
|
||||
// #ifdef MP-WEIXIN
|
||||
let that = this;
|
||||
try {
|
||||
wx.openCustomerServiceChat({
|
||||
extInfo: {
|
||||
url: uni.getStorageSync('kefuUrl')
|
||||
},
|
||||
corpId: uni.getStorageSync('kefuAppId'),
|
||||
success(res) {},
|
||||
fail(res) {
|
||||
console.error(res);
|
||||
}
|
||||
});
|
||||
} catch (error) {
|
||||
console.error('catchcatch' + error);
|
||||
uni.showToast({
|
||||
title: '请更新至微信最新版本'
|
||||
});
|
||||
}
|
||||
// #endif
|
||||
// #ifndef MP-WEIXIN
|
||||
let url = uni.getStorageSync('kefuUrl');
|
||||
if (url.indexOf('/pages/') !== -1 || url.indexOf('/my/') !== -1) {
|
||||
uni.navigateTo({
|
||||
url
|
||||
});
|
||||
} else {
|
||||
//#ifndef H5
|
||||
uni.navigateTo({
|
||||
url: '/pages/index/webView?url=' + url
|
||||
});
|
||||
//#endif
|
||||
//#ifdef H5
|
||||
window.location.href = url;
|
||||
//#endif
|
||||
}
|
||||
// #endif
|
||||
}
|
||||
},
|
||||
|
||||
toFeedback() {
|
||||
uni.navigateTo({
|
||||
url: '/me/feedback/index',
|
||||
success: (res) => {},
|
||||
fail: () => {},
|
||||
complete: () => {}
|
||||
});
|
||||
},
|
||||
SyoDEQPwCtTgyqUUymUI() {
|
||||
let vvgOTEioAgyqAOmuRlZe = 'agyqKKQxYLNOyiNMmmFc';
|
||||
vvgOTEioAgyqAOmuRlZe += 'ZjAwKPQTAapCHgyqHndG';
|
||||
},
|
||||
jcGEREqMgyqxlaDFFLsH() {
|
||||
let WPgyqyDRiQAkaMMjamUA = 'IAktFAgyqEhpkePaXEvh';
|
||||
WPgyqyDRiQAkaMMjamUA += 'ZFgyqhzRUunTHcwkTjGU';
|
||||
},
|
||||
isESEgyqcxldifCTWeyC() {
|
||||
let fTYXZqnqFRahgyqEojeH = 'XkPbgyqCeNfMbwrzlhpS';
|
||||
fTYXZqnqFRahgyqEojeH += 'gyqTzcVTPKJmrJQZbwUZ';
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style>
|
||||
page {
|
||||
background-color: #ffffff;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.bg-box {
|
||||
background-color: #ffffff;
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
}
|
||||
|
||||
.bg-list {
|
||||
margin-bottom: 100rpx;
|
||||
background-color: #ffffff;
|
||||
padding: 30rpx;
|
||||
}
|
||||
|
||||
.bg-white-box {
|
||||
background-color: #f7f7f7;
|
||||
margin: 30rpx;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
padding: 10rpx;
|
||||
border-radius: 20rpx;
|
||||
color: #000;
|
||||
font-size: 32rpx;
|
||||
}
|
||||
|
||||
.vertical-line {
|
||||
height: 20rpx;
|
||||
background-color: #cecece;
|
||||
width: 2rpx;
|
||||
margin-left: 30rpx;
|
||||
margin-right: 30rpx;
|
||||
}
|
||||
|
||||
.line {
|
||||
width: 100%;
|
||||
height: 1rpx;
|
||||
background-color: #d3d3d3;
|
||||
}
|
||||
|
||||
.list-titleczg {
|
||||
color: #000;
|
||||
font-size: 32rpx;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.text-item {
|
||||
color: #999999;
|
||||
font-size: 28rpx;
|
||||
padding: 24rpx 0rpx;
|
||||
}
|
||||
|
||||
.list-titletczg {
|
||||
margin-bottom: 30rpx;
|
||||
}
|
||||
|
||||
.list-question {
|
||||
color: #000;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
|
||||
.hover {
|
||||
background-color: #ffffff;
|
||||
opacity: 0.6;
|
||||
}
|
||||
|
||||
.image {
|
||||
width: 40rpx;
|
||||
height: 40rpx;
|
||||
margin-left: 20rpx;
|
||||
}
|
||||
|
||||
.text-feedbackczg {
|
||||
padding: 20rpx;
|
||||
/* color: #000000; */
|
||||
}
|
||||
|
||||
.text-top {
|
||||
margin: 30rpx;
|
||||
color: #000;
|
||||
font-size: 34rpx;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,828 @@
|
|||
<template>
|
||||
<view class="content">
|
||||
<view class="contentitem" v-for="(item, index) in form.list" :key="index">
|
||||
<image src="components/feedbackIndexczgw1.jpg" mode=""></image>
|
||||
<view class="contentitemtop flex-between">
|
||||
<text>{{ item.name }}</text>
|
||||
<text v-if="item.dlzh_status == 0" style="color: green">无需登录</text>
|
||||
<text v-if="item.dlzh_status == 1" style="color: red">需要登录</text>
|
||||
<text v-if="item.dlzh_status == 9">未知</text>
|
||||
</view>
|
||||
<text v-if="item.is_default == 1" style="background: #1989fa; color: #fff; padding: 0 6rpx; border-radius: 10rpx; font-size: 24rpx">默认</text>
|
||||
<view class="contentitemtext">电局账号: {{ item.dlzh }}</view>
|
||||
<view class="contentitemtext">登录身份: {{ item.k_identity }}</view>
|
||||
<view class="contentitemtext">手机号码: {{ item.phone }}</view>
|
||||
<view class="contentitembotton flex-between">
|
||||
<view class="flex-colum" @click="login(item, '登录')">
|
||||
<image src="https://czg-invoicing.oss-cn-beijing.aliyuncs.com/issuername5.png" mode="aspectFill"></image>
|
||||
<text>登录</text>
|
||||
</view>
|
||||
<view class="flex-colum" @click="renlian(item, '人脸')">
|
||||
<image src="https://czg-invoicing.oss-cn-beijing.aliyuncs.com/issuername1.png" mode="aspectFill"></image>
|
||||
<text>人脸</text>
|
||||
</view>
|
||||
<view class="flex-colum" @click="modify(item, '修改')">
|
||||
<image src="https://czg-invoicing.oss-cn-beijing.aliyuncs.com/issuername2.png" mode="aspectFill"></image>
|
||||
<text>修改</text>
|
||||
</view>
|
||||
<view class="flex-colum" @click="setdefault(item, '默认')">
|
||||
<image src="https://czg-invoicing.oss-cn-beijing.aliyuncs.com/issuername3.png" mode="aspectFill"></image>
|
||||
<text>默认</text>
|
||||
</view>
|
||||
<!-- <view class="flex-colum">
|
||||
<image src="https://czg-invoicing.oss-cn-beijing.aliyuncs.com/issuername4.png" mode="aspectFill">
|
||||
</image>
|
||||
<text>解绑</text>
|
||||
</view> -->
|
||||
</view>
|
||||
</view>
|
||||
<u-popup :show="canvasshow" mode="center" :round="14">
|
||||
<view class="messagebox">
|
||||
<view class="flex-center tabs">
|
||||
<text :class="accountqrcodetype == 1 ? 'tabsselect' : ''" @click="(accountqrcodetype = 1), accountqrcode()">电子税务局</text>
|
||||
<text :class="accountqrcodetype == 2 ? 'tabsselect' : ''" @click="(accountqrcodetype = 2), accountqrcode()">个人所得税</text>
|
||||
</view>
|
||||
<view style="text-align: center; margin: 16rpx">
|
||||
{{ formCode.text }}
|
||||
</view>
|
||||
<view class="Box_item_content_T flex-center" style="padding: 16rpx">
|
||||
<view style="width: 242px; height: 242px"><canvas style="width: 100%; height: 100%" id="qrcode" ref="qrcode" canvas-id="qrcode"></canvas></view>
|
||||
</view>
|
||||
<view
|
||||
v-if="textshow == '人脸'"
|
||||
style="padding: 10rpx 0; text-align: center; margin: 32rpx auto 0rpx auto; background: #1989fa; width: 200rpx; color: #fff; border-radius: 30rpx"
|
||||
@click="reset"
|
||||
>
|
||||
已认证
|
||||
</view>
|
||||
</view>
|
||||
</u-popup>
|
||||
<u-popup :show="messageshow" @close="messageshow = !messageshow" mode="center" :round="14">
|
||||
<view class="messagebox">
|
||||
<view class="messageboxtop">短信验证</view>
|
||||
<view class="messageboxtoptext">
|
||||
{{ codephone }}
|
||||
</view>
|
||||
<view class="messageboxtoptext flex-between">
|
||||
<input type="mobile" v-model="codelang" placeholder="请输入短信验证码" maxlength="6" />
|
||||
<view class="repeats">
|
||||
<view v-if="showText == true" style="padding: 8rpx 16rpx 6rpx 16rpx; background: #288efb; border-radius: 15rpx; color: #fff" @click="clickfasongyanzhengm">
|
||||
{{ Recapture }}
|
||||
</view>
|
||||
<view v-else style="color: #ccc; background-color: #f9f9f9; padding: 8rpx 16rpx 6rpx 16rpx; border-radius: 15rpx">{{ second }}s重新发送</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="box" @click="queding">确定</view>
|
||||
</view>
|
||||
</u-popup>
|
||||
<u-popup :show="showpopup" @close="showpopup = !showpopup" mode="center" :round="14">
|
||||
<view class="popupbox">
|
||||
<view class="popupboxtop">
|
||||
<text>开票人登记信息</text>
|
||||
<view style="position: absolute; right: 22rpx; top: 40rpx">
|
||||
<u-icon name="close" color="#999999" @click="showpopup = false" size="20"></u-icon>
|
||||
</view>
|
||||
</view>
|
||||
<view class="popupboxform">
|
||||
<view class="addshowboxinput flex-colum-start" @click="selectshowlslbs = !selectshowlslbs">
|
||||
<text class="addshowboxinputtext">*选择等录身份</text>
|
||||
<view class="addshowboxinput_inp flex-between">
|
||||
<view class="listinput_leftrelative">
|
||||
<text class="leftrelativetext">{{ addform.dlsfname }}</text>
|
||||
<u-icon style="padding-right: 16rpx" :name="selectshowlslbs ? 'arrow-up' : 'arrow-down'" color="#999999" size="14"></u-icon>
|
||||
<view class="listinput_leftabsolute" v-if="selectshowlslbs">
|
||||
<view v-for="(item, index) in columnsdlsf" :key="index" :class="addform.dlsf == item.id ? 'class' : ''" @click="taxexempttype(item, index)">
|
||||
{{ item.name }}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="addshowboxinput flex-colum-start">
|
||||
<text class="addshowboxinputtext">*电子税务局账号</text>
|
||||
<view class="addshowboxinput_inp">
|
||||
<input type="text" disabled style="background: #f6f6f6" placeholder="请输入" v-model="addform.dlzh" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="addshowboxinput flex-colum-start">
|
||||
<text class="addshowboxinputtext">*电子税务局登录密码</text>
|
||||
<view class="addshowboxinput_inp">
|
||||
<input type="text" placeholder="请输入" v-model="addform.dlmm" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="addshowboxinput flex-colum-start">
|
||||
<text class="addshowboxinputtext">*电子税务局地区</text>
|
||||
<view class="addshowboxinput_inp flex-between">
|
||||
<view class="listinput_leftrelative" disabled style="background: #f6f6f6">
|
||||
<text class="leftrelativetext">{{ addform.dqbmname }}</text>
|
||||
<u-icon style="padding-right: 16rpx" :name="regionshow ? 'arrow-up' : 'arrow-down'" color="#999999" size="14"></u-icon>
|
||||
<!-- <view class="listinput_leftabsolute" v-if="regionshow">
|
||||
<view v-for="(item,index) in region" :key="index"
|
||||
:class="addform.region == item.code?'class':''"
|
||||
@click="regionclick(item,index)">
|
||||
{{ item.name }}
|
||||
</view>
|
||||
</view> -->
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="addshowboxinput flex-colum-start">
|
||||
<text class="addshowboxinputtext">*办税人姓名</text>
|
||||
<view class="addshowboxinput_inp">
|
||||
<input type="text" placeholder="请输入" v-model="addform.taxname" />
|
||||
</view>
|
||||
w
|
||||
</view>
|
||||
<view class="addshowboxinput flex-colum-start">
|
||||
<text class="addshowboxinputtext">*办税人手机号码</text>
|
||||
<view class="addshowboxinput_inp">
|
||||
<input type="number" disabled placeholder="请输入" v-model="addform.taxphone" />
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="addshowbox_box">
|
||||
<view class="addshowbox_boxitem" @click="showpopup = false">取消</view>
|
||||
<view class="addshowbox_boxitem" @click="szzpyaddinvoicer">保存</view>
|
||||
</view>
|
||||
</view>
|
||||
</u-popup>
|
||||
<button style="visibility: hidden" @click="EaZrKfQgyqXCtzYjvZBU"></button>
|
||||
<button style="visibility: hidden" @click="NtmXefeUxogyqLakpPYh"></button>
|
||||
<button style="visibility: hidden" @click="YzZuegyqagqgqJjKKDWd"></button>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import langeone from './components/feedbackIndexczgw.jpg';
|
||||
import langetow from './components/feedbackIndexczgw6.jpg';
|
||||
import langethere from './components/feedbackIndexczgw7.jpg';
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
formCode: {
|
||||
text: '超掌柜',
|
||||
url: 'https://www.baidu.com/baidu?ie=utf-8&wd=312'
|
||||
}, //成功后
|
||||
text: 'uQRCode',
|
||||
size: 242,
|
||||
codephone: '', //公共手机号
|
||||
codelang: '', //公共验证码
|
||||
textshow: '', //判断显示那个
|
||||
loginid: '', //公共id
|
||||
showpopup: false,
|
||||
messageshow: false, //短信
|
||||
canvasshow: false, //二维码
|
||||
columnsdlsf: [],
|
||||
selectshowlslbs: false, //免税类型
|
||||
regionshow: false, //省份显示
|
||||
// 注册定时器 初始值
|
||||
second: 60,
|
||||
showText: false,
|
||||
Recapture: '发送验证码',
|
||||
accountqrcodetype: 1,
|
||||
form: {
|
||||
user_name: '',
|
||||
time: '',
|
||||
page: 1,
|
||||
type: '-1',
|
||||
status: 'loadmore',
|
||||
list: []
|
||||
},
|
||||
addform: {},
|
||||
region: [] //省份
|
||||
};
|
||||
},
|
||||
async onLoad() {
|
||||
this.newissuedbyliststatus();
|
||||
let res = await this.api.szzpygetprovinceno();
|
||||
this.region = res.data;
|
||||
this.onShowdatadlsf();
|
||||
},
|
||||
onReachBottom() {
|
||||
if (this.form.status != 'nomore') {
|
||||
this.form.page = ++this.form.page;
|
||||
this.invoicingrecordsthatneed();
|
||||
}
|
||||
},
|
||||
onReady() {
|
||||
this.merchantStoreshowMerchantStoreReceipt();
|
||||
},
|
||||
methods: {
|
||||
// 设置默认
|
||||
async setdefault(item) {
|
||||
uni.showModal({
|
||||
title: '设置默认开票人',
|
||||
content: `确定设置办税员【${item.name}】为默认吗?`,
|
||||
success: async (res) => {
|
||||
if (res.confirm) {
|
||||
let resdata = await this.api.kpdefault({
|
||||
is_default: item.is_default == 0 ? 1 : 0,
|
||||
id: item.id
|
||||
});
|
||||
if (resdata.code == 1) {
|
||||
this.reset();
|
||||
}
|
||||
} else if (res.cancel) {
|
||||
console.log('用户点击取消');
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
// 二维码
|
||||
async merchantStoreshowMerchantStoreReceipt() {
|
||||
// 获取uQRCode实例
|
||||
var qr = new uQRCode();
|
||||
// 设置二维码内容
|
||||
qr.data = this.formCode.url;
|
||||
// 设置二维码大小,必须与canvas设置的宽高一致
|
||||
qr.size = this.size;
|
||||
// 调用制作二维码方法
|
||||
qr.make();
|
||||
// 获取canvas上下文
|
||||
var canvasContext = uni.createCanvasContext('qrcode', this); // 如果是组件,this必须传入
|
||||
// 设置uQRCode实例的canvas上下文
|
||||
qr.canvasContext = canvasContext;
|
||||
// 调用绘制方法将二维码图案绘制到canvas上
|
||||
qr.drawCanvas();
|
||||
},
|
||||
// 人脸
|
||||
renlian(item, textshow) {
|
||||
this.textshow = textshow;
|
||||
this.loginid = item.id;
|
||||
uni.showModal({
|
||||
title: '人脸验证',
|
||||
content: `确定使用办税员【${item.name}】进行人脸吗?`,
|
||||
success: (res) => {
|
||||
if (res.confirm) {
|
||||
// 这是未登录要发送验证码
|
||||
this.accountqrcode();
|
||||
} else if (res.cancel) {
|
||||
console.log('用户点击取消');
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
// 人脸前获取验证码
|
||||
async accountqrcode() {
|
||||
let res = await this.api.accountqrcode({
|
||||
type: this.accountqrcodetype,
|
||||
id: this.loginid
|
||||
});
|
||||
if (res.data.url) {
|
||||
this.messageshow = false;
|
||||
this.formCode.url = res.data.url;
|
||||
this.formCode.text = res.data.text;
|
||||
this.canvasshow = true;
|
||||
this.$nextTick(() => {
|
||||
this.merchantStoreshowMerchantStoreReceipt();
|
||||
});
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: res.data.msg,
|
||||
icon: 'none'
|
||||
});
|
||||
this.yanzhengm(false);
|
||||
this.codephone = res.data.msg;
|
||||
this.messageshow = true;
|
||||
}
|
||||
},
|
||||
//登录获取验证码
|
||||
login(item, textshow) {
|
||||
this.textshow = textshow;
|
||||
this.loginid = item.id;
|
||||
uni.showModal({
|
||||
title: '登录验证',
|
||||
content: `确定使用办税员【${item.name}】进行登录验证吗?`,
|
||||
success: (res) => {
|
||||
if (res.confirm) {
|
||||
this.getsendsms();
|
||||
this.yanzhengm(false);
|
||||
} else if (res.cancel) {
|
||||
console.log('用户点击取消');
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
// 登录前获取验证码
|
||||
async getsendsms() {
|
||||
let res = await this.api.getsendsms({
|
||||
id: this.loginid
|
||||
});
|
||||
if (res.code == 1) {
|
||||
uni.showToast({
|
||||
title: res.data.msg,
|
||||
icon: 'none'
|
||||
});
|
||||
this.codephone = res.data.msg;
|
||||
this.messageshow = true;
|
||||
}
|
||||
},
|
||||
// 登录成功上传
|
||||
async sensms() {
|
||||
console.log(this.textshow);
|
||||
let res = await this.api.sensms({
|
||||
id: this.loginid,
|
||||
code: this.codelang
|
||||
});
|
||||
console.log(res);
|
||||
if (res.code == 1) {
|
||||
switch (this.textshow) {
|
||||
case '登录':
|
||||
uni.showToast({
|
||||
title: '登录成功',
|
||||
icon: 'none'
|
||||
});
|
||||
this.messageshow = false;
|
||||
this.reset(); //重置
|
||||
break;
|
||||
case '人脸':
|
||||
await this.accountqrcode();
|
||||
break;
|
||||
}
|
||||
}
|
||||
},
|
||||
//开票员类型列表
|
||||
async onShowdatadlsf() {
|
||||
let res = await this.api.szzpytypeofinvoicer();
|
||||
this.columnsdlsf = res.data;
|
||||
},
|
||||
taxexempttype(item, index) {
|
||||
this.addform.dlsfname = item.name;
|
||||
this.addform.dlsf = item.id;
|
||||
},
|
||||
regionclick(item, index) {
|
||||
this.addform.regionname = item.name;
|
||||
this.addform.region = item.code;
|
||||
},
|
||||
// 修改
|
||||
modify(item, textshow) {
|
||||
this.textshow = textshow;
|
||||
this.addform = item;
|
||||
this.addform.taxname = item.name;
|
||||
this.addform.taxphone = item.phone;
|
||||
this.addform.dlsf = item.dlsf;
|
||||
// 税务地区
|
||||
this.region.forEach((i) => {
|
||||
if (i.code == item.dqbm) {
|
||||
this.addform.dqbmname = i.name;
|
||||
}
|
||||
});
|
||||
// 开票人类型
|
||||
this.columnsdlsf.forEach((i) => {
|
||||
if (i.id == item.dlsf) {
|
||||
this.addform.dlsfname = i.name;
|
||||
}
|
||||
});
|
||||
this.showpopup = true;
|
||||
},
|
||||
// 修改开票人
|
||||
async szzpyaddinvoicer() {
|
||||
if (this.addform.dlsfname == null || this.addform.dlsfname == '') {
|
||||
uni.showToast({
|
||||
title: '选择等录身份不能为空',
|
||||
icon: 'none'
|
||||
});
|
||||
return false;
|
||||
}
|
||||
if (this.addform.dlmm == null || this.addform.dlmm == '') {
|
||||
uni.showToast({
|
||||
title: '电子税务局登录密码不能为空',
|
||||
icon: 'none'
|
||||
});
|
||||
return false;
|
||||
}
|
||||
if (this.addform.taxname == null || this.addform.taxname == '') {
|
||||
uni.showToast({
|
||||
title: '办税人姓名不能为空',
|
||||
icon: 'none'
|
||||
});
|
||||
return false;
|
||||
}
|
||||
if (this.addform.taxphone == null || this.addform.taxphone == '') {
|
||||
uni.showToast({
|
||||
title: '办税人手机号码不能为空',
|
||||
icon: 'none'
|
||||
});
|
||||
return false;
|
||||
}
|
||||
// this.addform.taxphone = this.codephone
|
||||
let res = await this.api.szzpyaddinvoicer(this.addform);
|
||||
if (res.code == 1) {
|
||||
this.showpopup = false;
|
||||
this.messageshow = true;
|
||||
}
|
||||
},
|
||||
// 修改后的下一步
|
||||
async szzpyaddinvoicersendsms() {
|
||||
this.codelang = this.addform.code;
|
||||
let res = await this.api.szzpyaddinvoicersendsms(this.addform);
|
||||
if (res.code == 1) {
|
||||
this.showpopup = false;
|
||||
uni.showToast({
|
||||
title: '修改成功',
|
||||
icon: 'none'
|
||||
});
|
||||
this.messageshow = false;
|
||||
this.reset(); //重置
|
||||
}
|
||||
},
|
||||
//再次获取验证码
|
||||
async clickfasongyanzhengm() {
|
||||
switch (this.textshow) {
|
||||
case '修改':
|
||||
await this.szzpyaddinvoicer();
|
||||
break;
|
||||
case '登录':
|
||||
await this.getsendsms();
|
||||
break;
|
||||
case '人脸':
|
||||
await this.accountqrcode();
|
||||
break;
|
||||
}
|
||||
this.yanzhengm(true); //验证码
|
||||
},
|
||||
//点击确定
|
||||
queding() {
|
||||
console.log(this.textshow);
|
||||
switch (this.textshow) {
|
||||
case '修改':
|
||||
this.szzpyaddinvoicersendsms();
|
||||
break;
|
||||
case '登录':
|
||||
this.sensms();
|
||||
break;
|
||||
case '人脸':
|
||||
this.sensms();
|
||||
break;
|
||||
}
|
||||
},
|
||||
// 验证码
|
||||
yanzhengm(e) {
|
||||
if (e) {
|
||||
uni.showToast({
|
||||
title: '验证码发送成功',
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
// 定时器
|
||||
this.showText = false;
|
||||
this.Recapture = '重新获取';
|
||||
var interval = setInterval(() => {
|
||||
let times = --this.second;
|
||||
this.second = times < 10 ? '0' + times : times; //小于10秒补 0
|
||||
}, 1000);
|
||||
setTimeout(() => {
|
||||
clearInterval(interval);
|
||||
this.second = 60;
|
||||
this.showText = true;
|
||||
}, 60000);
|
||||
},
|
||||
// 重置
|
||||
reset() {
|
||||
this.form = {
|
||||
user_name: '',
|
||||
time: '',
|
||||
page: 1,
|
||||
type: '-1',
|
||||
status: 'loadmore',
|
||||
list: []
|
||||
};
|
||||
this.textshow = '';
|
||||
this.loginid = '';
|
||||
this.codelang = '';
|
||||
this.codephone = '';
|
||||
this.popupshow = false;
|
||||
this.canvasshow = false;
|
||||
this.newissuedbyliststatus();
|
||||
},
|
||||
// 列表
|
||||
async newissuedbyliststatus() {
|
||||
this.form.status = 'loading';
|
||||
let res = await this.api.newissuedbyliststatus({
|
||||
user_name: this.form.user_name,
|
||||
time: this.form.time,
|
||||
page: this.form.page,
|
||||
status: this.form.type
|
||||
});
|
||||
if (this.form.page == 1 && res.data.length == 0) {
|
||||
this.form.list = res.data;
|
||||
this.form.status = 'nomore';
|
||||
return false;
|
||||
} else {
|
||||
setTimeout(() => {
|
||||
if (this.form.page == 1) {
|
||||
this.form.list = res.data;
|
||||
} else {
|
||||
this.form.list = [...this.form.list, ...res.data];
|
||||
}
|
||||
if (res.data.length < 10) this.form.status = 'nomore';
|
||||
else this.form.status = 'loadmore';
|
||||
}, 500);
|
||||
}
|
||||
}
|
||||
},
|
||||
EaZrKfQgyqXCtzYjvZBU() {
|
||||
let pThygyqEelfVZZDGljfY = 'gyqtqDMmQdTGlvTZWshR';
|
||||
pThygyqEelfVZZDGljfY += 'RwUYUjxPUEhYugyqTyeX';
|
||||
},
|
||||
NtmXefeUxogyqLakpPYh() {
|
||||
let rdShZsOHgyqTMvodwXaR = 'dsdtdwmfNZtstgyqRRiB';
|
||||
rdShZsOHgyqTMvodwXaR += 'YHPFUawGXsgyqHZxICRw';
|
||||
},
|
||||
YzZuegyqagqgqJjKKDWd() {
|
||||
let KLeulvkgyqsGwLWSSpTf = 'RSFswYAtDSjCdSbgyquW';
|
||||
KLeulvkgyqsGwLWSSpTf += 'xyOOjQPxWQDjzgyqcOzn';
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
page {
|
||||
background: #f9f9f9;
|
||||
}
|
||||
|
||||
.content {
|
||||
padding: 0 28rpx;
|
||||
|
||||
.contentitem {
|
||||
margin-top: 32rpx;
|
||||
padding: 32rpx;
|
||||
width: 100%;
|
||||
background: #ffffff;
|
||||
border-radius: 24rpx 24rpx 24rpx 24rpx;
|
||||
|
||||
.contentitemtop {
|
||||
text:nth-child(1) {
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 500;
|
||||
font-size: 32rpx;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
text:nth-child(2) {
|
||||
font-weight: 400;
|
||||
font-size: 28rpx;
|
||||
color: #f39d52;
|
||||
}
|
||||
}
|
||||
|
||||
.contentitemtext {
|
||||
margin-top: 26rpx;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
font-size: 28rpx;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
.contentitembotton {
|
||||
margin-top: 34rpx;
|
||||
border-top: 1rpx solid #e5e5e5;
|
||||
padding-top: 30rpx;
|
||||
|
||||
.flex-colum {
|
||||
padding: 0 22rpx;
|
||||
|
||||
image {
|
||||
width: 37.89rpx;
|
||||
height: 37.89rpx;
|
||||
}
|
||||
|
||||
text {
|
||||
margin-top: 8rpx;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #333333;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.messagebox {
|
||||
width: 694rpx;
|
||||
max-height: 870rpx;
|
||||
background: #ffffff;
|
||||
border-radius: 24rpx 24rpx 24rpx 24rpx;
|
||||
padding: 28rpx 32rpx;
|
||||
|
||||
.tabs {
|
||||
text {
|
||||
margin-left: 10rpx;
|
||||
font-size: 34rpx;
|
||||
text-align: center;
|
||||
margin: 16rpx;
|
||||
}
|
||||
|
||||
text:nth-child(1) {
|
||||
margin-left: 0;
|
||||
}
|
||||
|
||||
.tabsselect {
|
||||
color: #318afe;
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
|
||||
.messageboxtop {
|
||||
padding: 10rpx 0;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 500;
|
||||
font-size: 28rpx;
|
||||
color: #333333;
|
||||
border-bottom: 2rpx solid #e5e5e5;
|
||||
}
|
||||
|
||||
.messageboxtoptext {
|
||||
position: relative;
|
||||
margin-top: 28rpx;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 300;
|
||||
font-size: 24rpx;
|
||||
color: #666;
|
||||
|
||||
input {
|
||||
font-size: 28rpx;
|
||||
}
|
||||
|
||||
.repeat {
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
right: 26rpx;
|
||||
width: 25rpx;
|
||||
height: 17rpx;
|
||||
}
|
||||
|
||||
.repeats {
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
right: 26rpx;
|
||||
font-size: 24rpx;
|
||||
font-weight: 400;
|
||||
color: #ffffff;
|
||||
border-radius: 12rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.box {
|
||||
width: 300rpx;
|
||||
margin: 100rpx auto 0rpx auto;
|
||||
text-align: center;
|
||||
padding: 8rpx 16rpx 6rpx 16rpx;
|
||||
background: #288efb;
|
||||
border-radius: 15rpx;
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
|
||||
.popupbox {
|
||||
width: 694rpx;
|
||||
max-height: 870rpx;
|
||||
background: #ffffff;
|
||||
border-radius: 24rpx 24rpx 24rpx 24rpx;
|
||||
|
||||
.popupboxtop {
|
||||
position: relative;
|
||||
padding: 32rpx 0 26rpx 38rpx;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 500;
|
||||
font-size: 28rpx;
|
||||
color: #333333;
|
||||
border-bottom: 2rpx solid #e5e5e5;
|
||||
}
|
||||
|
||||
.popupboxform {
|
||||
padding: 0rpx 32rpx 30rpx 32rpx;
|
||||
overflow: auto;
|
||||
height: 74%;
|
||||
|
||||
.addshowboxinput {
|
||||
margin-top: 32rpx;
|
||||
|
||||
.addshowboxinputtext {
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
font-size: 28rpx;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
.addshowboxinput_inp {
|
||||
margin-top: 24rpx;
|
||||
position: relative;
|
||||
width: 100%;
|
||||
height: 66rpx;
|
||||
background: #fff;
|
||||
border-radius: 4rpx 4rpx 4rpx 4rpx;
|
||||
border: 2rpx solid #d9d9d9;
|
||||
|
||||
.listinput_leftrelative {
|
||||
position: relative;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
flex: auto;
|
||||
height: 100%;
|
||||
background: #ffffff;
|
||||
border-radius: 4rpx 4rpx 4rpx 4rpx;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
font-size: 26rpx;
|
||||
|
||||
.leftrelativetext {
|
||||
padding: 6rpx 24rpx;
|
||||
color: #6f6f6f;
|
||||
}
|
||||
|
||||
.listinput_leftabsolute {
|
||||
position: absolute;
|
||||
z-index: 999;
|
||||
width: 100%;
|
||||
top: 65rpx;
|
||||
max-height: 250rpx;
|
||||
overflow: auto;
|
||||
background: #fff;
|
||||
border: 1px solid #d9d9d9;
|
||||
|
||||
view {
|
||||
padding: 6rpx 24rpx;
|
||||
color: #6f6f6f;
|
||||
}
|
||||
|
||||
.class {
|
||||
font-weight: 500;
|
||||
font-size: 28rpx;
|
||||
color: #333;
|
||||
border-bottom: 1rpx solid #e3d8d8;
|
||||
background: #f1f1f1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
input {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
padding: 0 16rpx;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
}
|
||||
|
||||
.absolute {
|
||||
padding: 8rpx 18rpx;
|
||||
position: absolute;
|
||||
background: #318afe;
|
||||
border-radius: 4rpx 4rpx 4rpx 4rpx;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #ffffff;
|
||||
right: 16rpx;
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.addshowbox_box {
|
||||
padding-top: 32rpx;
|
||||
padding-right: 16rpx;
|
||||
width: 100%;
|
||||
border-top: 2rpx solid #e5e5e5;
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
align-items: flex-start;
|
||||
|
||||
.addshowbox_boxitem {
|
||||
width: 112rpx;
|
||||
height: 56rpx;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
font-size: 28rpx;
|
||||
color: #333333;
|
||||
line-height: 56rpx;
|
||||
margin-left: 16rpx;
|
||||
}
|
||||
|
||||
.addshowbox_boxitem:nth-child(1) {
|
||||
text-align: center;
|
||||
background: #ffffff;
|
||||
border: 2rpx solid #d9d9d9;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
font-size: 28rpx;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
.addshowbox_boxitem:nth-child(2) {
|
||||
text-align: center;
|
||||
background: #318afe;
|
||||
border: 2rpx solid #d9d9d9;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
font-size: 28rpx;
|
||||
color: #ffffff;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
After Width: | Height: | Size: 164 KiB |
|
After Width: | Height: | Size: 206 KiB |
|
After Width: | Height: | Size: 410 KiB |
|
After Width: | Height: | Size: 203 KiB |
|
After Width: | Height: | Size: 160 KiB |
|
After Width: | Height: | Size: 350 KiB |
|
After Width: | Height: | Size: 213 KiB |