[盘债计算器]

This commit is contained in:
2023-06-21 17:04:42 +08:00
commit f2e1454a83
37 changed files with 4165 additions and 0 deletions

28
.gitignore vendored Normal file
View File

@@ -0,0 +1,28 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*
node_modules
.DS_Store
dist
dist-ssr
coverage
*.local
/cypress/videos/
/cypress/screenshots/
# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?

78
App.vue Normal file
View File

@@ -0,0 +1,78 @@
<script>
export default {
onLaunch: function() {
console.log('App Launch')
},
onShow: function() {
console.log('App Show')
},
onHide: function() {
console.log('App Hide')
}
}
</script>
<style>
/*每个页面公共css */
page {
background-color: #f7faff;
}
/* 文字截取 */
.nowrap {
max-width: 100%;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.nowrap-multi {
display: -webkit-box;
overflow: hidden;
text-overflow: ellipsis;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
}
/* 水平居中 */
.pack-center {
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-box-pack: center;
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
z-index: -1;
}
/* 页面信息提醒 */
.pages-hint {
width: 100%;
text-align: center;
color: #747788;
font-size: 28rpx;
background: white;
}
.pages-hint image {
width: 220rpx;
height: 220rpx;
}
/* 上拉加载 */
.pagesLoding{
text-align: center;
line-height: 90rpx;
color: gray;
}
.pagesLoding-icon{
width: 28rpx;
height: 28rpx;
vertical-align: middle;
margin-right: 10rpx;
margin-bottom: 3rpx;
}
</style>

159
apis/index.js Normal file
View File

@@ -0,0 +1,159 @@
/**
* 手太欠
* 愿这世界都如故事里一样 美好而动人~
*/
import store from '@/store'
// 基础配置
const config = {
apiUrl : 'http://debt.douhuofalv.com/api/', // 正式环境
timeout : 60000
}
let loginHintState = false
// 网络请求
const request = (parameter, hideLoding) => {
// 检查url配置
if(parameter.url === 'undefined' || parameter.url === ''){
uni.showToast({
title: '请求地址不能为空',
icon : 'none'
})
return
}
// 注入header
config.header = {
'Accept': 'application/json',
'Authorization': store.getters.getToken || ''
}
// 加载提示
if(!hideLoding) uni.showLoading({
title: '加载中',
mask : true
});
// 请求实例
return new Promise((resolve, reject) => {
uni.request({
url : config.apiUrl + parameter.url,
timeout : config.timeout,
header : config.header || {},
data : parameter.data || {},
method : parameter.method || 'GET',
success : res => {
if (res.header.Authorization){
updateToken('token', res.header.Authorization)
}
if(res.statusCode === 200){
uni.hideLoading()
const resolveData = res.data
if(resolveData.status_code === 200) {
resolve(resolveData.data)
return
}
if(resolveData.status_code === 401) {
loginHint()
return
}
reject(resolveData)
return
}
errToast(res.statusCode)
}
})
})
}
// 文件上传
const uploading = (paths, driver) => {
uni.showLoading({
title: '上传中',
mask : true
});
// 注入header
config.header = {
'Accept': 'application/json',
'Authorization': store.getters.getToken || ''
}
// 上传图片
return new Promise((resolve, reject) => {
uni.uploadFile({
url : config.apiUrl + 'storage/uploads',
files : paths,
header : config.header || {},
formData: driver || {},
success : res=>{
if(res.statusCode === 200){
uni.hideLoading()
let updData = JSON.parse(res.data)
if(updData.status_code === 200){
resolve(updData.data)
return
}
reject(updData)
return
}
errToast(res.statusCode)
}
})
})
}
// 处理一些http请求错误提示
const errToast = (code) => {
switch (code){
case 404:
uni.showToast({
title: code + '接口不存在,请联系系统管理员',
icon : 'none'
})
break;
case 405:
uni.showToast({
title: code + '请检查接口请求方式错误',
icon : 'none'
})
break;
case 500:
uni.showToast({
title: code + '服务端错误,请检查服务器信息',
icon : 'none'
})
break;
}
}
// 更新token
const updateToken = (token) => {
store.commit('setToken', token)
}
// 处理登录提示
const loginHint = () => {
if( loginHintState ) return
if(!loginHintState) loginHintState = true
updateToken('')
uni.showModal({
title: '登录提示',
content: '您的登录信息已过期,请重新登录',
confirmColor: '#8b64fd',
showCancel:false,
success: res=> {
loginHintState = false
if (res.confirm) uni.reLaunch({
url:'/pages/index/index'
})
}
})
}
export {
request,
uploading,
config
}

View File

@@ -0,0 +1,29 @@
/**
* 手太欠
* 愿这世界都如故事里一样 美好而动人~
*/
import { request } from '../index'
// 微信授权登录(获取跳转地址)
const authFollow = (data) => {
return request({
url : 'user/auth/official/url',
data: data
})
}
// 微信登录传入code
const wechatCode = (data) => {
return request({
url : 'user/auth/official/openid',
method: 'POST',
data: data
})
}
export {
authFollow,
wechatCode
}

67
apis/interfaces/index.js Normal file
View File

@@ -0,0 +1,67 @@
/**
* 手太欠
* 愿这世界都如故事里一样 美好而动人~
*/
import { request } from '../index'
// 计算前置接口
const Init = (data) => {
return request({
url : 'init',
data: data
})
}
// 开始计算
const Debt = (data) => {
return request({
url : 'debt',
method: 'POST',
data: data
})
}
// 完善用户信息
const Info = (data) => {
return request({
url : 'userinfo',
method: 'POST',
data: data
})
}
// 查看结果
const Lists = (data) => {
return request({
url : 'lists',
data: data
})
}
// 客户管理
const Clients = (data) => {
return request({
url : 'clients',
data: data
})
}
// 删除结果
const logDel = (log_id) => {
return request({
url : 'debt/' + log_id,
method: 'DELETE'
})
}
export {
Init,
Debt,
Info,
Lists,
Clients,
logDel
}

View File

@@ -0,0 +1,18 @@
export default function h5Copy(content) {
if (!document.queryCommandSupported('copy')) {
// 不支持
return false
}
let textarea = document.createElement("textarea")
textarea.value = content
textarea.readOnly = "readOnly"
document.body.appendChild(textarea)
textarea.select() // 选择对象
textarea.setSelectionRange(0, content.length) //核心
let result = document.execCommand("copy") // 执行浏览器复制命令
textarea.remove()
return result
}

18
main.js Normal file
View File

@@ -0,0 +1,18 @@
import Vue from 'vue'
import App from './App'
import store from './store'
// 导入组件库-海报
import VueCanvasPoster from 'vue-canvas-poster'
// 注册组件库-海报
Vue.use(VueCanvasPoster)
Vue.prototype.$store = store
App.mpType = 'app'
const app = new Vue({
...App
})
app.$mount()

82
manifest.json Normal file
View File

@@ -0,0 +1,82 @@
{
"name" : "盘债计算器",
"appid" : "__UNI__59922A2",
"description" : "",
"versionName" : "1.0.0",
"versionCode" : "100",
"transformPx" : false,
/* 5+App */
"app-plus" : {
"usingComponents" : true,
"nvueStyleCompiler" : "uni-app",
"compilerVersion" : 3,
"splashscreen" : {
"alwaysShowBeforeRender" : true,
"waiting" : true,
"autoclose" : true,
"delay" : 0
},
/* */
"modules" : {},
/* */
"distribute" : {
/* android */
"android" : {
"permissions" : [
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
"<uses-permission android:name=\"android.permission.VIBRATE\"/>",
"<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
"<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.CAMERA\"/>",
"<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>",
"<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
"<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
"<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
"<uses-feature android:name=\"android.hardware.camera\"/>",
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
]
},
/* ios */
"ios" : {},
/* SDK */
"sdkConfigs" : {}
}
},
/* */
"quickapp" : {},
/* */
"mp-weixin" : {
"appid" : "",
"setting" : {
"urlCheck" : false
},
"usingComponents" : true
},
"mp-alipay" : {
"usingComponents" : true
},
"mp-baidu" : {
"usingComponents" : true
},
"mp-toutiao" : {
"usingComponents" : true
},
"uniStatistics" : {
"enable" : false
},
"vueVersion" : "2",
"h5" : {
"router" : {
"mode" : "history",
"base" : "/"
},
"title" : "盘债计算器",
"devServer" : {
"https" : false
}
}
}

79
package-lock.json generated Normal file
View File

@@ -0,0 +1,79 @@
{
"requires": true,
"lockfileVersion": 1,
"dependencies": {
"@babel/parser": {
"version": "7.22.5",
"resolved": "https://registry.npmmirror.com/@babel/parser/-/parser-7.22.5.tgz",
"integrity": "sha512-DFZMC9LJUG9PLOclRC32G63UXwzqS2koQC8dkx+PLdmt1xSePYpbT/NbsrJy8Q/muXz7o/h/d4A7Fuyixm559Q=="
},
"@vue/compiler-sfc": {
"version": "2.7.14",
"resolved": "https://registry.npmmirror.com/@vue/compiler-sfc/-/compiler-sfc-2.7.14.tgz",
"integrity": "sha512-aNmNHyLPsw+sVvlQFQ2/8sjNuLtK54TC6cuKnVzAY93ks4ZBrvwQSnkkIh7bsbNhum5hJBS00wSDipQ937f5DA==",
"requires": {
"@babel/parser": "^7.18.4",
"postcss": "^8.4.14",
"source-map": "^0.6.1"
}
},
"core-js": {
"version": "2.6.12",
"resolved": "https://registry.npmmirror.com/core-js/-/core-js-2.6.12.tgz",
"integrity": "sha512-Kb2wC0fvsWfQrgk8HU5lW6U/Lcs8+9aaYcy4ZFc6DDlo4nZ7n70dEgE5rtR0oG6ufKDUnrwfWL1mXR5ljDatrQ=="
},
"csstype": {
"version": "3.1.2",
"resolved": "https://registry.npmmirror.com/csstype/-/csstype-3.1.2.tgz",
"integrity": "sha512-I7K1Uu0MBPzaFKg4nI5Q7Vs2t+3gWWW648spaF+Rg7pI9ds18Ugn+lvg4SHczUdKlHI5LWBXyqfS8+DufyBsgQ=="
},
"nanoid": {
"version": "3.3.6",
"resolved": "https://registry.npmmirror.com/nanoid/-/nanoid-3.3.6.tgz",
"integrity": "sha512-BGcqMMJuToF7i1rt+2PWSNVnWIkGCU78jBG3RxO/bZlnZPK2Cmi2QaffxGO/2RvWi9sL+FAiRiXMgsyxQ1DIDA=="
},
"picocolors": {
"version": "1.0.0",
"resolved": "https://registry.npmmirror.com/picocolors/-/picocolors-1.0.0.tgz",
"integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ=="
},
"postcss": {
"version": "8.4.24",
"resolved": "https://registry.npmmirror.com/postcss/-/postcss-8.4.24.tgz",
"integrity": "sha512-M0RzbcI0sO/XJNucsGjvWU9ERWxb/ytp1w6dKtxTKgixdtQDq4rmx/g8W1hnaheq9jgwL/oyEdH5Bc4WwJKMqg==",
"requires": {
"nanoid": "^3.3.6",
"picocolors": "^1.0.0",
"source-map-js": "^1.0.2"
}
},
"source-map": {
"version": "0.6.1",
"resolved": "https://registry.npmmirror.com/source-map/-/source-map-0.6.1.tgz",
"integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g=="
},
"source-map-js": {
"version": "1.0.2",
"resolved": "https://registry.npmmirror.com/source-map-js/-/source-map-js-1.0.2.tgz",
"integrity": "sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw=="
},
"vue": {
"version": "2.7.14",
"resolved": "https://registry.npmmirror.com/vue/-/vue-2.7.14.tgz",
"integrity": "sha512-b2qkFyOM0kwqWFuQmgd4o+uHGU7T+2z3T+WQp8UBjADfEv2n4FEMffzBmCKNP0IGzOEEfYjvtcC62xaSKeQDrQ==",
"requires": {
"@vue/compiler-sfc": "2.7.14",
"csstype": "^3.1.0"
}
},
"vue-canvas-poster": {
"version": "1.2.1",
"resolved": "https://registry.npmmirror.com/vue-canvas-poster/-/vue-canvas-poster-1.2.1.tgz",
"integrity": "sha512-YY5ygbeQSqhiJyj6QXYgSRZ6Ywhvi1gVsfcvBIoCx4Yq9E/gAV32uOhnZz45qsklP86uGc9ypKJAXiX6Dzrdxw==",
"requires": {
"core-js": "^2.6.5",
"vue": "^2.6.10"
}
}
}
}

61
pages.json Normal file
View File

@@ -0,0 +1,61 @@
{
"pages": [
{
"path": "pages/index/index",
"style": {
"navigationBarTitleText": "盘债计算器"
}
},
{
"path": "pages/index/perfect",
"style": {
"navigationBarTitleText": "完善个人信息"
}
},
{
"path": "pages/index/clients",
"style": {
"navigationBarTitleText": "客户管理"
}
},
{
"path": "pages/index/custom",
"style": {
"navigationBarTitleText": "客户管理"
}
},
{
"path": "pages/result/result",
"style": {
"navigationBarTitleText": "盘债计算器"
}
},
{
"path": "pages/result/other",
"style": {
"navigationBarTitleText": "盘债计算器"
}
},
{
"path": "pages/result/history",
"style": {
"navigationBarTitleText": "历史记录"
}
},
{
"path": "pages/webview/webview",
"style": {
"navigationBarTitleText": "微信授权"
}
}
],
"globalStyle": {
"navigationBarTextStyle": "black",
"navigationBarTitleText": "盘债计算器",
"navigationBarBackgroundColor": "#F8F8F8",
"backgroundColor": "#F8F8F8",
"navigationStyle":"custom"
},
"uniIdRouter": {}
}

565
pages/index/clients.vue Normal file
View File

@@ -0,0 +1,565 @@
<template>
<view class="content">
<block v-if="listsArr.length > 0">
<image class="indexTop" src="/static/index_top.png" mode="scaleToFill"></image>
<view class="indexTips">
<view class="indexTips-name">计算历史记录</view>
<view class="indexTips-text">根据您填写的内容生成以下结果</view>
</view>
<view class="indexCont">
<view class="indexCont-white" v-for="(item, index) in listsArr" :key="index">
<view class="resultTitle">
{{item.institution}}
</view>
<view class="resultList">
<view class="item">
<view class="item-label">
<view class="item-label-name">
欠款金额
</view>
<view class="item-label-text">
{{item.total}}
</view>
</view>
<view class="item-label">
<view class="item-label-name">
首付金额
</view>
<view class="item-label-text" v-if="item.base">
{{item.base.first_amount}}
</view>
</view>
<view class="item-label">
<view class="item-label-name">
分期金额
</view>
<view class="item-label-text" v-if="item.base">
{{item.base.periods_amount}}
</view>
</view>
<view class="item-label">
<view class="item-label-name">
分期期数
</view>
<view class="item-label-text" v-if="item.base">
{{item.base.periods}}
</view>
</view>
<view class="item-label">
<view class="item-label-name">
手续费费率
</view>
<view class="item-label-text" v-if="item.base">
{{item.base.tax}}%
</view>
</view>
<view class="item-label">
<view class="item-label-name">
每期还款本金
</view>
<view class="item-label-text" v-if="item.base">
{{item.base.every_total}}
</view>
</view>
<view class="item-label">
<view class="item-label-name">
每期还款手续费
</view>
<view class="item-label-text" v-if="item.base">
{{item.base.every_tax}}
</view>
</view>
<view class="item-label">
<view class="item-label-name">
总还款金额
</view>
<view class="item-label-text" v-if="item.base">
{{item.base.total}}
</view>
</view>
<view class="item-label">
<view class="item-label-name">
总还款本金
</view>
<view class="item-label-text" v-if="item.base">
{{item.base.principal}}
</view>
</view>
<view class="item-label">
<view class="item-label-name">
总还款手续费
</view>
<view class="item-label-text" v-if="item.base">
{{item.base.tax_amount}}
</view>
</view>
</view>
<view class="tips">温馨提示{{item.description}}</view>
<view class="see">
<view class="see-go" @click="generalClick(item)">点击查看还款计划表</view>
</view>
</view>
</view>
</view>
</block>
<view class="pack-center pages-hint" v-else>
<image src="https://cdn.shuiganying.com/images/2023/04/04/40b2f4bfe2dfb828688fcd3766d6b541.png"></image>
<view class="reportTips">
<view class="reportTips-title">暂无数据</view>
<view class="reportTips-text">抱歉暂没有历史记录</view>
</view>
</view>
<!-- 还款计划表弹出 -->
<view class="tipsBack" v-if="generalShow" :catchtouchmove="true"></view>
<view class="tipsCont" v-if="generalShow" :catchtouchmove="true">
<view class="tipsWhite">
<view class="tipsTitle">还款计划表单位</view>
<view class="tipsList">
<view class="tipsList-tab">
<view class="tips-tab-item">期数</view>
<view class="tips-tab-item">还款金额</view>
<view class="tips-tab-item">本金</view>
<view class="tips-tab-item">手续费</view>
</view>
<view class="tipsList-data">
<view class="tipsList-label" v-for="(items, index) in timeArr" :key="index">
<view class="tips-label-item">{{index+1}}</view>
<view class="tips-label-item">{{items.total}}</view>
<view class="tips-label-item">{{items.principal}}</view>
<view class="tips-label-item">{{items.tax}}</view>
</view>
<view class="tipsList-label">
<view class="tips-label-item">合计</view>
<view class="tips-label-item">{{timeAll.total}}</view>
<view class="tips-label-item">{{timeAll.principal}}</view>
<view class="tips-label-item">{{timeAll.tax}}</view>
</view>
</view>
</view>
<view class="tipsWhite-btn">
<view @click="otherSee" class="tipsWhite-btn-go">
其他还款方式
</view>
</view>
<image class="close" @click="generalShow = false" src="/static/close.png" mode="widthFix"></image>
</view>
</view>
<!-- 数据缓冲阶段 -->
<view class="pack-center pages-hint grey" v-if="paySuccess">
<image src="/static/loadingGif.gif"></image>
<view>加载中...</view>
</view>
</view>
</template>
<script>
import { Lists } from '@/apis/interfaces/index'
export default {
data() {
return {
listsArr : [], // 结果列表
timeArr : [], // 还款计划表列表
timeAll : '', // 还款计划表总计
otherArr : '', // 其他携带数据
userId : '',
generalShow: false,
paySuccess : true,
}
},
onLoad(options) {
this.userId = options.user_id
},
onShow() {
// 获取历史结果
this.listsInfo()
},
methods: {
// 历史结果
listsInfo() {
Lists({
user_id: this.userId
}).then(res => {
this.paySuccess = false
this.listsArr = res
}).catch(err => {
uni.showToast({
title: err.message,
icon: "none"
})
})
},
// 查看还款计划表
generalClick(arr){
this.otherArr = arr
this.timeArr = arr.project
this.timeAll = arr.project_total
this.generalShow = !this.generalShow
},
// 其他方式
otherSee() {
let newData = JSON.stringify(this.otherArr);
uni.navigateTo({
url: `/pages/result/other?data=${encodeURIComponent(newData)}`
})
this.generalShow = false
}
}
}
</script>
<style>
.indexTop {
width: 100%;
height: 440rpx;
}
.indexTips {
position: absolute;
top: 0;
left: 0;
padding: 60rpx 40rpx 0;
box-sizing: border-box;
color: #fff;
}
.indexTips-name {
font-weight: 600;
font-size: 44rpx;
}
.indexTips-text {
margin-top: 20rpx;
font-size: 28rpx;
}
.indexCont {
width: 100%;
padding: 30rpx;
box-sizing: border-box;
position: absolute;
margin-top: 200rpx;
top: 0;
left: 0;
}
.indexCont-white {
height: 100%;
background: white;
border-radius: 20rpx;
padding: 30rpx;
box-sizing: border-box;
margin-bottom: 30rpx;
}
.resultTitle {
font-weight: 600;
font-size: 34rpx;
color: #0c58d2;
margin-bottom: 20rpx;
}
.item-label {
line-height: 48rpx;
padding: 15rpx 0;
display: flex;
margin-right: 20rpx;
font-weight: 400;
}
.item-label-name {
color: #999999;
}
.textShadow {
filter: blur(6px);
}
.tips {
font-weight: 400;
background-color: #f7faff;
border-radius: 10rpx;
padding: 20rpx 30rpx;
text-align: justify;
box-sizing: border-box;
font-size: 26rpx;
color: #999999;
line-height: 40rpx;
margin-top: 20rpx;
}
.see {
text-align: center;
margin-top: 30rpx;
}
.see-go {
display: inline-block;
border: 2rpx solid #0c58d2;
color: #0c58d2;
line-height: 74rpx;
padding: 0 25rpx;
border-radius: 10rpx;
}
.indexLock {
width: 34rpx;
vertical-align: -4rpx;
margin-right: 10rpx;
}
/* 计划表弹出 */
.tipsBack {
position: fixed;
width: 100vw;
height: 100vh;
left: 0;
top: 0;
z-index: 9;
background-color: rgba(0, 0, 0, .6);
}
.tipsCont {
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-box-pack: center;
position: fixed;
left: 0;
right: 0;
top: 0;
bottom: 0;
z-index: 10;
padding: 0 10%;
box-sizing: border-box;
text-align: center;
}
.tipsWhite {
background-color: #ffffff;
border-radius: 20rpx;
padding: 30rpx;
box-sizing: border-box;
position: relative;
}
.close {
position: absolute;
left: calc(50% - 35rpx);
width: 70rpx;
bottom: -120rpx;
z-index: 999;
}
.tipsTitle {
font-weight: 600;
font-size: 34rpx;
}
.tipsList {
margin: 20rpx 0;
font-size: 28rpx;
font-weight: 400;
}
.tipsList-tab {
display: flex;
background: #e5edf8;
line-height: 90rpx;
border-radius: 20rpx 20rpx 0 0;
}
.tips-tab-item, .tips-label-item {
flex: 4;
text-align: center;
}
.tipsList-data {
background: #fafafa;
border-radius: 0 0 20rpx 20rpx;
max-height: 30vh;
overflow: hidden;
overflow-y: scroll;
}
.tipsList-label {
display: flex;
line-height: 80rpx;
border-bottom: 2rpx solid #eeeeee;
}
.tipsList-label:last-child {
border: none;
}
.tipsWhite-btn {
text-align: center;
padding: 30rpx 0 20rpx;
}
.tipsWhite-btn-go {
display: inline-block;
width: 70%;
line-height: 88rpx;
border-radius: 80rpx;
background-color: #0c58d2;
color: #fff;
}
.postertBack {
width: 100vw;
height: 100vh;
position: fixed;
background-color: rgba(0,0,0,.6);
left: 0;
top: 0;
z-index: 999;
}
.postertCont {
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-box-pack: center;
position: fixed;
left: 0;
right: 0;
top: 0;
bottom: 0;
z-index: 1000;
padding: 0 10%;
box-sizing: border-box;
}
.postertContTop {
top: -200rpx;
}
.poster-back {
position: relative;
padding-top: 100%;
width: 100%;
}
.poster-img, .poster-Cont {
position: absolute;
width: 100%;
height: 100%;
left: 0;
top: 0;
}
.poster-Cont {
padding: 50rpx;
box-sizing: border-box;
color: #fff;
}
.poster-Cont-code {
background: #fff;
border-radius: 20rpx;
padding: 30rpx;
box-sizing: border-box;
}
.poster-Cont-code image {
width: 100%;
}
.poster-Cont-url {
display: flex;
padding: 30rpx 0 40rpx;
}
.poster-url-number {
flex: 1;
padding-right: 20rpx;
box-sizing: border-box;
}
.poster-url-copy {
font-weight: 600;
}
.poster-Cont-btn {
text-align: center;
}
.poster-Cont-down {
display: inline-block;
width: 80%;
background-color: #fff;
border-radius: 80rpx;
line-height: 90rpx;
color: #051437;
font-weight: 600;
}
.poster-Cont-down-img {
width: 40rpx;
margin-left: 15rpx;
vertical-align: -8rpx;
animation: bounce-down 2s linear infinite;
}
@keyframes bounce-down {
25% {
transform: translateX(-4px);
}
50%,
100% {
transform: translateX(0);
}
75% {
transform: translateX(4px);
}
}
.sign-img-btn {
position: absolute;
left: calc(50% - 35rpx);
width: 70rpx;
top: calc(100% + 240rpx);
z-index: 999;
}
.poster-img-btn {
width: 70rpx;
display: block;
margin: 30rpx auto 0;
}
/* 暂无数据 */
.reportTips-title {
color: #000;
font-size: 34rpx;
line-height: 80rpx;
}
.reportTips-text {
font-size: 26rpx;
}
.reportTips-btn {
background-color: #3b7cff;
display: inline-block;
color: #fff;
line-height: 78rpx;
padding: 0 60rpx;
border-radius: 10rpx;
margin-top: 50rpx;
}
.pack-center {
z-index: 99999;
}
.grey {
background-color: #f9f9f9;
z-index: 9999999;
}
</style>

114
pages/index/custom.vue Normal file
View File

@@ -0,0 +1,114 @@
<template>
<view class="content">
<view v-if="listsArr.length > 0">
<navigator hover-class="none" :url="'/pages/index/clients?user_id=' + item.user_id" class="list" v-for="(item, index) in listsArr" :key="index">
<image class="list-cover" :src="item.avatar ? item.avatar : '/static/user_default.png'" mode="aspectFill"></image>
<view class="list-cont">
<view class="list-name">{{item.nickname}}</view>
<view class="list-phone">{{item.username}}</view>
</view>
<view class="list-btn">计算结果></view>
</navigator>
</view>
<view class="pack-center pages-hint" v-else>
<image src="https://cdn.shuiganying.com/images/2023/04/04/40b2f4bfe2dfb828688fcd3766d6b541.png"></image>
<view class="reportTips">
<view class="reportTips-title">暂无数据</view>
<view class="reportTips-text">抱歉暂没有历史记录</view>
</view>
</view>
</view>
</template>
<script>
import { Clients } from '@/apis/interfaces/index'
export default {
data() {
return {
listsArr : [] // 结果列表
}
},
onShow() {
this.listsInfo()
},
methods: {
listsInfo() {
Clients().then(res => {
this.listsArr = res
}).catch(err => {
uni.showToast({
title: err.message,
icon: "none"
})
})
}
}
}
</script>
<style>
.list {
position: relative;
padding: 24rpx 30rpx 24rpx 140rpx;
min-height: 80rpx;
background-color: #fff;
}
.list-cover {
width: 80rpx;
height: 80rpx;
border-radius: 50%;
position: absolute;
top: 24rpx;
left: 24rpx;
background: #808080;
}
.list-cont {
width: calc(100% - 180rpx);
}
.list-name {
height: 50rpx;
line-height: 50rpx;
font-size: 32rpx;
font-weight: bold;
color: #333;
}
.list-phone {
height: 30rpx;
line-height:30rpx;
font-size: 24rpx;
color: #999;
}
.list::before {
position: absolute;
left: 30rpx;
right: 0;
bottom: 0;
height: 1rpx;
background: #FAFAFA;
content: "";
}
.list:last-child::before {
display: none;
}
.list-btn {
display: inline-block;
background-color: #0352c8;
color: #ffffff;
border-radius: 80rpx;
line-height: 64rpx;
padding: 0 20rpx;
position: absolute;
right: 30rpx;
top: 30rpx;
font-size: 24rpx;
}
</style>

931
pages/index/index.vue Normal file
View File

@@ -0,0 +1,931 @@
<template>
<view class="content">
<image class="indexTop" src="/static/index_top.png" mode="scaleToFill"></image>
<view class="indexTips">
<view class="indexTips-name">欢迎使用盘债计算器</view>
<view class="indexTips-text">请填写以下内容 <image class="indexTips-warm" @click="warmClick" src="/static/warm.png" mode="widthFix"></image></view>
</view>
<view class="indexCont">
<view class="indexCont-white">
<view class="indexUser" v-if="userLogin">
<block v-if="inviteUser.user_id != ''">
<view class="indexUser-left">
<view class="indexUser-head"><image :src="inviteUser.avatar ? inviteUser.avatar : '/static/user_default.png' " mode="aspectFill"></image></view>
<view class="indexUser-text">
<view class="indexUser-name">
{{inviteUser.realname ? inviteUser.realname : '--'}} <text class="indexUser-number">{{inviteUser.username ? inviteUser.username : '--'}}</text>
</view>
<view class="indexUser-tips">
详细业务咨询请联系我
</view>
</view>
</view>
<image class="indexUser-tel" @click="callPhone" src="/static/tel.png" mode="aspectFill"></image>
</block>
<block v-else>
<view class="indexUser-left">
<view class="indexUser-head"><image :src="serviceData.avatar" mode="aspectFill"></image></view>
<view class="indexUser-text">
<view class="indexUser-name">
{{serviceData.realname}} <text class="indexUser-number">{{serviceData.username}}</text>
</view>
<view class="indexUser-tips">
详细业务咨询请联系客服
</view>
</view>
</view>
<image class="indexUser-tel" @click="callPhone" src="/static/tel.png" mode="aspectFill"></image>
</block>
</view>
<view class="list">
<block v-for="(item, index) in serviceArr" :key="index">
<view class="listName">
机构{{index + 1}}
<view class="list-remove" @click="onRemove(index)" v-if="index > 0">
<image src="/static/removeIcon.png" mode="widthFix"></image>删除
</view>
</view>
<view class="listItem">
<view class="listItem-name">
{{item.titleName}}
</view>
<view class="listItem-picker">
<block v-if="objectArray != ''">
<picker :disabled="!canSettle" :range="objectArray" :value="item.pickerIndex" :range-key="'title'" class="listItem-picker-add" @change="($event) => item.pickerIndex = $event.detail.value">
<view class="uni-input" v-if="objectArray[item.pickerIndex]">{{objectArray[item.pickerIndex].title}}</view>
</picker>
</block>
<view class="listItem-picker-add" v-else>请先登录</view>
<image src="/static/basic_down.png" class="listItem-picker-img" mode="widthFix"></image>
</view>
</view>
<view class="listItem">
<view class="listItem-name">
{{item.priceName}}
</view>
<view class="listItem-picker">
<input v-if="userLogin" type="number" :disabled="!canSettle" placeholder="请输入欠款金额" placeholder-class="placeholderClass" @input="($event) => item.priceValue = $event.detail.value" />
<view class="listItem-picker-add" v-else>请先登录</view>
</view>
</view>
</block>
</view>
<view class="listAdd">
<view class="listAdd-btn" @click="addPush">
<image src="/static/add.png" mode="widthFix"></image>添加新机构
</view>
</view>
</view>
</view>
<view class="listSubmit">
<view class="listSubmit-btn" :class="{active: !canSettle}" @click="onSubmit" v-if="userLogin">
{{canRemark}}<block v-if="canSettle"><block v-if="numberCount.have_count > 0 && numberCount.have_count <= 5">(剩余次数{{numberCount.have_count}})</block></block>
</view>
<view class="listSubmit-btn" @click="onLogin" v-else>
请先登录
</view>
</view>
<!-- 漂浮窗 -->
<view class="showy" v-if="userLogin">
<navigator hover-class="none" url="/pages/index/custom" class="showy-item" v-if="isSalesman">
<image class="showy-item-img" src="/static/record.png" mode="widthFix"></image>
<view class="showy-item-name"><text>客户</text><text>管理</text></view>
</navigator>
<view class="showy-item" @click="isImgLay = true">
<image class="showy-item-img" src="/static/share.png" mode="widthFix"></image>
<view class="showy-item-name">分享</view>
<view class="showy-item-number" v-if="numberCount.share_balance > 0">+{{numberCount.share_add}}</view>
</view>
<view class="showy-item">
<image class="showy-item-img" src="/static/record.png" mode="widthFix"></image>
<view class="showy-item-name" @click="historyClick"><text>历史</text><text>记录</text></view>
<view class="showy-item-number" v-if="numberCount.use_count > 0">{{numberCount.use_count}}</view>
</view>
</view>
<!-- 邀请好友弹出 -->
<view class="postertBack" v-if="isImgLay"></view>
<view class="postertCont postertContTop" v-if="isImgLay">
<view class="poster-back">
<image class="poster-img" src="/static/share_back.png" mode="widthFix"></image>
<view class="poster-Cont">
<view class="poster-Cont-code">
<image :src="canShare.qrcode" mode="widthFix"></image>
</view>
<view class="poster-Cont-url">
<view class="nowrap poster-url-number" @click="copyUrl(canShare.url)">地址{{canShare.url}}/</view>
<view class="poster-url-copy">复制</view>
</view>
<view class="poster-Cont-btn">
<view class="poster-Cont-down" @click="shareClick">保存图片分享好友<image class="poster-Cont-down-img" src="/static/hand.png" mode="widthFix"></image></view>
</view>
</view>
<image class="sign-img-btn" src="/static/close.png" @click="isImgLay = false" mode="widthFix"></image>
</view>
</view>
<!-- 长按保存 -->
<view class="postertBack" v-if="isImgLong"></view>
<view class="postertCont" v-if="isImgLong">
<view class="poster-back">
<image v-if="isImgLong" class="poster-img" :src="posterImg" mode="widthFix"></image>
<view class="poster-Cont-btn" style="margin-top: 40rpx; text-align: center;">
<view class="poster-Cont-down">请长按图片保存本地</view>
<image class="poster-img-btn" src="/static/close.png" @click="isImgLong = false" mode="widthFix"></image>
</view>
</view>
</view>
<!-- 海报canvas -->
<vue-canvas-poster :widthPixels="1000" :painting="paintings" @success="saveSuccess" @fail="saveFail"></vue-canvas-poster>
<!-- 提交缓冲阶段 -->
<view class="pack-center pages-hint grey" v-if="paySuccess">
<image src="/static/loadingGif.gif"></image>
<view>计算结果中...</view>
</view>
<!-- 是否确定提交计算 -->
<view class="tipsBack" v-if="generalShow"></view>
<view class="tipsCont" v-if="generalShow">
<view class="tipsWhite">
<image class="tipsCont-img" src="/static/tips.png" mode="widthFix"></image>
<view class="tipsWhite-top">
<view class="tipsWhite-name">
计算提示
</view>
<view class="tipsWhite-text">
请确认提交的数据是否准确确定后进行提交
</view>
</view>
<view class="tipsWhite-btn">
<view class="tipsWhite-btn-go" @click="generalShow = false">
暂不提交
</view>
<view class="tipsWhite-btn-go" @click="judgeGeneral">
立即提交
</view>
</view>
</view>
</view>
</view>
</template>
<script>
import { VueCanvasPoster } from 'vue-canvas-poster'
import { authFollow, wechatCode } from '@/apis/interfaces/authUrl'
import { Init, Debt } from '@/apis/interfaces/index'
import h5Copy from '@/js_sdk/junyi-h5-copy/junyi-h5-copy/junyi-h5-copy.js'
export default {
components: {
VueCanvasPoster
},
data() {
return {
userLogin : false, // 是否登录
canRemark : '', // 按钮文字
canSettle : false, // 是否计算
canShare : '', // 分享数据
serviceData: '', // 客服信息
inviteUser : '', // 用户信息
serviceArr : [],
blurValue : '',
numberCount: '', // 计算次数
haveCount : '', // 用户计算
objectArray: [], // 机构列表
isSalesman : '', // 客户管理
paySuccess : false, // 计算结果
generalShow: false, // 是否提交
// 海报
isImgLay : false, // 是否显示图片弹出层
isImgLong : false,// 长按保存图片
paintings : {
width: "375px",
height: "375px",
borderRadius: "10px",
background: "#ffffff",
views: [
//海报背景
{
type: "image",
url: "/static/share_downback.png",
css: {
top: "0",
left: "0",
width: "375px",
height: "375px",
mode: 'aspectFill'
},
},
//二维码
{
type: "image",
url: "",
css: {
top: "60px",
left: "60px",
width: "255px",
height: "255px",
mode: 'aspectFill'
},
}
],
},
posterImg : "", //生成的海报图片路径
}
},
onLoad(options) {
// 邀请码数据
if(options != '') {
this.$store.commit('setInvite', options.invite)
this.$store.commit('setShareUser', options.share_user)
this.$store.commit('setLockId', options.lock_id)
}
},
onShow() {
if(this.$store.getters.getToken) {
this.userLogin = true
// 获取计算前置接口
this.preUrl()
return
}
this.userLogin = false
},
created() {
// 新增卡片
this.serviceArr.push({
titleName : '机构名称',
priceName : '欠款金额',
pickerIndex: 0,
priceValue : '',
})
},
methods: {
// 计算前置接口
preUrl() {
Init().then(res => {
this.serviceData = res.service
this.isSalesman = res.is_salesman
this.inviteUser = res.invite_user
this.canShare = res.share
this.canSettle = res.can_settle
this.canRemark = res.can_remark
this.numberCount = res.count
this.haveCount = res.count.have_count - 1
this.objectArray = res.institution
this.paintings.views[1].url = res.share.qrcode
}).catch(err => {
this.userLogin = false
uni.showToast({
title: err.message,
icon: "none"
})
})
},
// 新增表单数据
addPush(){
if(this.$store.getters.getToken) {
// 是否可以计算
if(this.canSettle) {
if(this.haveCount != 0) {
this.serviceArr.push({
titleName : '机构名称',
priceName : '欠款金额',
pickerIndex: 0,
priceValue : '',
})
this.haveCount --
} else {
uni.showToast({
title: '抱歉,没有次数啦',
icon: "none"
})
}
return
}
uni.showToast({
title: this.canRemark,
icon: "none"
})
return
}
uni.showToast({
title: '请先登录',
icon: "none"
})
},
// 移出选项
onRemove(index){
this.serviceArr.splice(index, 1)
this.haveCount ++
},
// 提交订单数据-确认
onSubmit(){
// 已完善信息
if(this.$store.getters.getPassInfo != 'false') {
if(this.canSettle) {
this.generalShow = true
return
}
uni.showToast({
title: this.canRemark,
icon: "none"
})
return
}
// 完善个人信息
uni.navigateTo({
url: '/pages/index/perfect'
})
},
// 提交订单数据
judgeGeneral() {
this.generalShow = false
let SubmitAdd = this.serviceArr.map(obj => {
return {
institution_id : this.objectArray[obj.pickerIndex].id,
total : obj.priceValue,
}
})
Debt({
invite : this.$store.getters.getInvite,
lock_id : this.$store.getters.getLockId,
data : SubmitAdd
}).then(res => {
this.paySuccess = true
this.serviceArr.splice(0,this.serviceArr.length);//清空数组
this.serviceArr.push({
titleName : '机构名称',
priceName : '欠款金额',
pickerIndex: 0,
priceValue : '',
})
// 跳转结果页面
setTimeout(()=>{
this.paySuccess = false
uni.navigateTo({
url: '/pages/result/result'
})
},3000)
}).catch(err => {
uni.showToast({
title: err.message,
icon: "none"
})
})
},
// 微信授权登录
onLogin() {
authFollow({
url: 'http://debtwww.douhuofalv.com/pages/webview/webview',
scopes: ''
}).then(res => {
window.location.href = res
}).catch(err => {
uni.showToast({
title: err.message,
icon: "none"
})
})
},
// 查看历史记录
historyClick() {
uni.navigateTo({
url: '/pages/result/history'
})
},
// 拨打电话
callPhone(e) {
uni.makePhoneCall({
phoneNumber: this.inviteUser.username
})
},
// 查看温馨提示
warmClick() {
uni.showModal({
title: '温馨提示',
content: '新用户可免费计算2个机构每邀请1名用户完成计算可增加1个机构计算份额。用户计算机构份额上限为5个。',
showCancel: false,
success: res=> {
if (res.confirm) {
console.log('用户点击确定');
} else if (res.cancel) {
console.log('用户点击取消');
}
}
});
},
// 复制订单号
copyUrl(val) {
const result = h5Copy(val)
if (result === false) {
uni.showToast({
title:'不支持',
})
return
}
uni.showToast({
title:'复制成功',
icon:'none'
})
},
// 下载海报
shareClick (){
this.isImgLay = false
this.isImgLong = true
},
saveSuccess(src) {
this.posterImg = src;
},
saveFail(err) {},
}
}
</script>
<style>
.indexTop {
width: 100%;
height: 440rpx;
}
.indexTips {
position: absolute;
top: 0;
left: 0;
padding: 60rpx 40rpx 0;
box-sizing: border-box;
color: #fff;
}
.indexTips-name {
font-weight: 600;
font-size: 44rpx;
}
.indexTips-text {
margin-top: 20rpx;
font-size: 28rpx;
display: flex;
}
.indexTips-warm {
width: 34rpx;
margin-left: 15rpx;
margin-top: 2rpx;
}
.indexCont {
width: 100%;
padding: 30rpx;
box-sizing: border-box;
position: absolute;
margin-top: 200rpx;
top: 0;
left: 0;
border-bottom: 140rpx solid transparent;
}
.indexCont-white {
height: 100%;
background: white;
border-radius: 20rpx;
}
.indexUser {
display: flex;
border-bottom: 4rpx solid #f7faff;
padding: 40rpx 30rpx;
box-sizing: border-box;
}
.indexUser-left {
display: flex;
flex: 1;
}
.indexUser-head {
width: 110rpx;
height: 110rpx;
border-radius: 100%;
background-color: #e5ecf6;
border: 6rpx solid #e5ecf6;
box-sizing: border-box;
}
.indexUser-head image {
border-radius: 100%;
width: 100%;
height: 100%;
}
.indexUser-text {
width: calc(100% - 150rpx);
padding: 0 20rpx;
box-sizing: border-box;
}
.indexUser-name {
font-weight: 600;
display: flex;
font-size: 34rpx;
line-height: 58rpx;
}
.indexUser-tips {
font-size: 28rpx;
}
.indexUser-number {
font-size: 30rpx;
font-weight: normal;
padding-left: 20rpx;
box-sizing: border-box;
line-height: 62rpx;
color: #666666;
display: inline-block;
}
.indexUser-tel {
width: 60rpx;
height: 60rpx;
margin-top: 30rpx;
}
.list {
padding: 20rpx 30rpx;
box-sizing: border-box;
}
.listName {
color: #0c58d2;
font-weight: 600;
font-size: 34rpx;
margin: 30rpx 0 ;
position: relative;
}
.list-remove {
background-color: #FBE7EE;
display: inline-block;
position: absolute;
padding: 0 20rpx;
font-size: 26rpx;
font-weight: normal;
line-height: 44rpx;
color: #d4155a;
border-radius: 50rpx;
top: 0;
right: 0;
}
.list-remove image {
width: 24rpx;
height: 24rpx;
margin-right: 10rpx;
vertical-align: -2rpx;
}
.listItem-name {
margin: 30rpx 0;
}
.listItem-picker {
background-color: #f7faff;
border-radius: 15rpx;
height: 90rpx;
line-height: 90rpx;
padding: 0 30rpx;
box-sizing: border-box;
position: relative;
}
.listItem-picker input {
display: block;
height: 100%;
background-color: transparent;
}
.listItem-picker-img {
width: 30rpx;
position: absolute;
right: 30rpx;
top: 30rpx;
}
.listAdd {
text-align: center;
color: #0c58d2;
padding: 40rpx 0 40rpx;
}
.listAdd-btn image {
width: 30rpx;
vertical-align: middle;
margin-right: 10rpx;
}
.listSubmit {
position: fixed;
width: 100%;
bottom: 0;
left: 0;
background-color: #f7faff;
text-align: center;
height: 120rpx;
}
.listSubmit-btn {
width: 90%;
display: inline-block;
background-color: #0352c8;
text-align: center;
line-height: 90rpx;
border-radius: 100rpx;
color: #fff;
}
.listSubmit-btn.active {
background-color: #dcdcdc;
color: #666;
}
/* 漂浮窗 */
.showy {
position: fixed;
right: 0;
bottom: 15%;
background-color: #fff;
box-shadow: 0 0 20rpx rgba(3, 96, 217, .1);
z-index: 999;
border-radius: 60rpx 0 0 60rpx;
padding: 30rpx 0;
}
.showy-item {
text-align: center;
padding: 20rpx 30rpx 10rpx 35rpx;
font-size: 26rpx;
position: relative;
}
.showy-item-number {
position: absolute;
right: 5rpx;
top: 0;
background-color: #ff7171;
color: #fff;
font-size: 22rpx;
border-radius: 80rpx;
padding: 0 10rpx;
transform: scale(0.83);
line-height: 40rpx;
}
.showy-item-img {
width: 44rpx;
}
.showy-item-name text {
display: block;
}
.postertBack {
width: 100vw;
height: 100vh;
position: fixed;
background-color: rgba(0,0,0,.6);
left: 0;
top: 0;
z-index: 999;
}
.postertCont {
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-box-pack: center;
position: fixed;
left: 0;
right: 0;
top: 0;
bottom: 0;
z-index: 1000;
padding: 0 10%;
box-sizing: border-box;
}
.postertContTop {
top: -200rpx;
}
.poster-back {
position: relative;
padding-top: 100%;
width: 100%;
}
.poster-img, .poster-Cont {
position: absolute;
width: 100%;
height: 100%;
left: 0;
top: 0;
}
.poster-Cont {
padding: 50rpx;
box-sizing: border-box;
color: #fff;
}
.poster-Cont-code {
background: #fff;
border-radius: 20rpx;
padding: 30rpx;
box-sizing: border-box;
}
.poster-Cont-code image {
width: 100%;
}
.poster-Cont-url {
display: flex;
padding: 30rpx 0 40rpx;
}
.poster-url-number {
flex: 1;
padding-right: 20rpx;
box-sizing: border-box;
}
.poster-url-copy {
font-weight: 600;
}
.poster-Cont-btn {
text-align: center;
}
.poster-Cont-down {
display: inline-block;
width: 80%;
background-color: #fff;
border-radius: 80rpx;
line-height: 90rpx;
color: #051437;
font-weight: 600;
}
.poster-Cont-down-img {
width: 40rpx;
margin-left: 15rpx;
vertical-align: -8rpx;
animation: bounce-down 2s linear infinite;
}
@keyframes bounce-down {
25% {
transform: translateX(-4px);
}
50%,
100% {
transform: translateX(0);
}
75% {
transform: translateX(4px);
}
}
.sign-img-btn {
position: absolute;
left: calc(50% - 35rpx);
width: 70rpx;
top: calc(100% + 240rpx);
z-index: 999;
}
.poster-img-btn {
width: 70rpx;
display: block;
margin: 30rpx auto 0;
}
.grey {
background-color: #f9f9f9;
z-index: 999999;
}
/* 是否确认提交 */
.tipsBack {
position: fixed;
width: 100vw;
height: 100vh;
left: 0;
top: 0;
z-index: 9999;
background-color: rgba(0, 0, 0, .8);
}
.tipsCont {
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-box-pack: center;
position: fixed;
left: 0;
right: 0;
top: 0;
bottom: 0;
z-index: 10000;
padding: 0 10%;
box-sizing: border-box;
}
.tipsWhite {
background-color: #ffffff;
border-radius: 20rpx;
overflow: hidden;
}
.tipsWhite-top {
padding: $padding;
box-sizing: border-box;
text-align: center;
}
.tipsCont-img {
width: 100%;
}
.tipsWhite-name {
text-align: center;
color: #111111;
font-size: 34rpx;
font-weight: 600;
margin-bottom: 15rpx;
}
.tipsWhite-text {
font-size: 30rpx;
color: #666666;
line-height: 48rpx;
padding: 0 50rpx;
box-sizing: border-box;
}
.tipsWhite-btn {
display: flex;
padding: 30rpx 10rpx;
box-sizing: border-box;
}
.tipsWhite-btn-go {
flex: 2;
color: #fff;
margin: 0 15rpx;
height: 80rpx;
line-height: 80rpx;
text-align: center;
border: 2rpx solid #F6F6F6;
background-color: #007df5;
border-radius: 20rpx;
}
.tipsWhite-btn-go:first-child {
color: #333333;
background-color: #ffffff;
border: 2rpx solid #cccccc;
}
</style>

180
pages/index/perfect.vue Normal file
View File

@@ -0,0 +1,180 @@
<template>
<view class="content">
<image class="indexTop" src="/static/index_top.png" mode="scaleToFill"></image>
<view class="indexTips">
<view class="indexTips-name">完善个人信息</view>
<view class="indexTips-text">请您填写的以下内容</view>
</view>
<view class="indexCont">
<view class="indexCont-white">
<view class="item">
<view class="item-label">
<view class="item-label-name">
姓名
</view>
<input class="item-label-text" type="text" v-model="name" placeholder="输入您的姓名" maxlength="4" />
</view>
<view class="item-label">
<view class="item-label-name">
手机号
</view>
<input class="item-label-text" type="text" v-model="tel" placeholder="输入您的手机号" maxlength="11" />
</view>
</view>
</view>
<view class="return" @click="submitTo" v-if="enjoin">提交信息</view>
<view class="return active" v-else>提交信息...</view>
</view>
</view>
</template>
<script>
import { Info } from '@/apis/interfaces/index'
export default {
data() {
return {
name : '',
tel : '',
enjoin: true
}
},
created() {
},
methods: {
submitTo() {
Info({
mobileNo: this.tel,
nickname: this.name
}).then(res => {
this.enjoin = false
uni.showToast({
title: res,
icon: "none"
})
this.$store.commit('setPassInfo', true)
// 跳转首页
setTimeout(()=>{
uni.navigateTo({
url: '/pages/index/index'
})
},3000)
}).catch(err => {
uni.showToast({
title: err.message,
icon: "none"
})
})
}
}
}
</script>
<style>
.indexTop {
width: 100%;
height: 440rpx;
}
.indexTips {
position: absolute;
top: 0;
left: 0;
padding: 60rpx 40rpx 0;
box-sizing: border-box;
color: #fff;
}
.indexTips-name {
font-weight: 600;
font-size: 44rpx;
}
.indexTips-text {
margin-top: 20rpx;
font-size: 28rpx;
}
.indexCont {
width: 100%;
padding: 30rpx;
box-sizing: border-box;
position: absolute;
margin-top: 240rpx;
top: 0;
left: 0;
}
.indexCont-white {
height: 100%;
background: white;
border-radius: 20rpx;
padding: 50rpx;
box-sizing: border-box;
margin-bottom: 30rpx;
position: relative;
}
.indexCont-white::after,
.indexCont-white::before {
position: absolute;
content: '';
background-color: rgba(255, 255, 255, .4);
left: 20rpx;
border-radius: 20rpx 20rpx 0 0;
}
.indexCont-white::after {
z-index: 2;
width: calc(100% - 40rpx);
left: 20rpx;
top: -25rpx;
height: 25px;
}
.indexCont-white::before {
z-index: 1;
width: calc(100% - 80rpx);
left: 40rpx;
top: -50rpx;
height: 50rpx;
}
.item-label {
margin-bottom: 60rpx;
}
.item-label:last-child {
margin-bottom: 0;
}
.item-label-name {
font-weight: 600;
margin-bottom: 30rpx;
}
.item-label-text {
background-color: #f7faff;
border-radius: 15rpx;
height: 90rpx;
line-height: 90rpx;
padding: 0 30rpx;
}
.return {
margin-top: 90rpx;
width: 100%;
background-color: #fff;
border-radius: 80rpx;
line-height: 88rpx;
text-align: center;
color: #0c58d2;
border: 2rpx solid #0c58d2;
}
.return.active {
border-color: #999;
color: #999;
}
</style>

708
pages/result/history.vue Normal file
View File

@@ -0,0 +1,708 @@
<template>
<view class="content">
<block v-if="listsArr.length > 0">
<image class="indexTop" src="/static/index_top.png" mode="scaleToFill"></image>
<view class="indexTips">
<view class="indexTips-name">计算历史记录</view>
<view class="indexTips-text">根据您填写的内容生成以下结果</view>
</view>
<view class="indexCont">
<view class="indexCont-white" v-for="(item, index) in listsArr" :key="index">
<view class="resultTitle">
{{item.institution}}
</view>
<view class="resultDel" v-if="isSalesman" @click="resultClick(index, item.log_id)">删除记录</view>
<view class="resultList">
<view class="item">
<view class="item-label">
<view class="item-label-name">
欠款金额
</view>
<view class="item-label-text">
{{item.total}}
</view>
</view>
<view :class="{textShadow: item.status != '1'}">
<view class="item-label">
<view class="item-label-name">
首付金额
</view>
<view class="item-label-text">
{{item.base.first_amount}}
</view>
</view>
<view class="item-label">
<view class="item-label-name">
分期金额
</view>
<view class="item-label-text">
{{item.base.periods_amount}}
</view>
</view>
<view class="item-label">
<view class="item-label-name">
分期期数
</view>
<view class="item-label-text">
{{item.base.periods}}
</view>
</view>
<view class="item-label">
<view class="item-label-name">
手续费费率
</view>
<view class="item-label-text">
{{item.base.tax}}%
</view>
</view>
<view class="item-label">
<view class="item-label-name">
每期还款本金
</view>
<view class="item-label-text">
{{item.base.every_total}}
</view>
</view>
<view class="item-label">
<view class="item-label-name">
每期还款手续费
</view>
<view class="item-label-text">
{{item.base.every_tax}}
</view>
</view>
<view class="item-label">
<view class="item-label-name">
总还款金额
</view>
<view class="item-label-text">
{{item.base.total}}
</view>
</view>
<view class="item-label">
<view class="item-label-name">
总还款本金
</view>
<view class="item-label-text">
{{item.base.principal}}
</view>
</view>
<view class="item-label">
<view class="item-label-name">
总还款手续费
</view>
<view class="item-label-text">
{{item.base.tax_amount}}
</view>
</view>
</view>
</view>
<view class="tips">温馨提示{{item.description}}</view>
<view class="see">
<view class="see-go" @click="generalClick(item)" v-if="item.status == '1'">点击查看还款计划表</view>
<view class="see-go" @click="unlockClick(item.share)" v-else><image class="indexLock" src="/static/lock.png" mode="widthFix"></image>分享二维码解锁次数</view>
</view>
</view>
</view>
</view>
</block>
<view class="pack-center pages-hint" v-else>
<image src="https://cdn.shuiganying.com/images/2023/04/04/40b2f4bfe2dfb828688fcd3766d6b541.png"></image>
<view class="reportTips">
<view class="reportTips-title">暂无数据</view>
<view class="reportTips-text">抱歉暂没有历史记录</view>
</view>
</view>
<!-- 还款计划表弹出 -->
<view class="tipsBack" v-if="generalShow" :catchtouchmove="true"></view>
<view class="tipsCont" v-if="generalShow" :catchtouchmove="true">
<view class="tipsWhite">
<view class="tipsTitle">还款计划表单位</view>
<view class="tipsList">
<view class="tipsList-tab">
<view class="tips-tab-item">期数</view>
<view class="tips-tab-item">还款金额</view>
<view class="tips-tab-item">本金</view>
<view class="tips-tab-item">手续费</view>
</view>
<view class="tipsList-data">
<view class="tipsList-label" v-for="(items, index) in timeArr" :key="index">
<view class="tips-label-item">{{index+1}}</view>
<view class="tips-label-item">{{items.total}}</view>
<view class="tips-label-item">{{items.principal}}</view>
<view class="tips-label-item">{{items.tax}}</view>
</view>
<view class="tipsList-label">
<view class="tips-label-item">合计</view>
<view class="tips-label-item">{{timeAll.total}}</view>
<view class="tips-label-item">{{timeAll.principal}}</view>
<view class="tips-label-item">{{timeAll.tax}}</view>
</view>
</view>
</view>
<view class="tipsWhite-btn">
<view @click="otherSee" class="tipsWhite-btn-go">
其他还款方式
</view>
</view>
<image class="close" @click="generalShow = false" src="/static/close.png" mode="widthFix"></image>
</view>
</view>
<!-- 邀请好友弹出 -->
<view class="postertBack" v-if="isImgLay"></view>
<view class="postertCont postertContTop" v-if="isImgLay">
<view class="poster-back">
<image class="poster-img" src="/static/share_back.png" mode="widthFix"></image>
<view class="poster-Cont">
<view class="poster-Cont-code">
<image :src="canShare.qrcode" mode="widthFix"></image>
</view>
<view class="poster-Cont-url">
<view class="nowrap poster-url-number" @click="copyUrl(canShare.url)">地址{{canShare.url}}/</view>
<view class="poster-url-copy">复制</view>
</view>
<view class="poster-Cont-btn">
<view class="poster-Cont-down" @click="shareClick">保存图片分享好友<image class="poster-Cont-down-img" src="/static/hand.png" mode="widthFix"></image></view>
</view>
</view>
<image class="sign-img-btn" src="/static/close.png" @click="isImgLay = false" mode="widthFix"></image>
</view>
</view>
<!-- 长按保存 -->
<view class="postertBack" v-if="isImgLong"></view>
<view class="postertCont" v-if="isImgLong">
<view class="poster-back">
<image v-if="isImgLong" class="poster-img" :src="posterImg" mode="widthFix"></image>
<view class="poster-Cont-btn" style="margin-top: 40rpx; text-align: center;">
<view class="poster-Cont-down">请长按图片保存本地</view>
<image class="poster-img-btn" src="/static/close.png" @click="isImgLong = false" mode="widthFix"></image>
</view>
</view>
</view>
<!-- 海报canvas -->
<vue-canvas-poster :widthPixels="1000" :painting="paintings" @success="saveSuccess" @fail="saveFail"></vue-canvas-poster>
<!-- 数据缓冲阶段 -->
<view class="pack-center pages-hint grey" v-if="paySuccess">
<image src="/static/loadingGif.gif"></image>
<view>加载中...</view>
</view>
</view>
</template>
<script>
import { Init, Lists, logDel } from '@/apis/interfaces/index'
import { VueCanvasPoster } from 'vue-canvas-poster'
export default {
components: {
VueCanvasPoster
},
data() {
return {
listsArr : [], // 结果列表
timeArr : [], // 还款计划表列表
timeAll : '', // 还款计划表总计
otherArr : '', // 其他携带数据
isSalesman : '', // 客户管理
generalShow: false,
paySuccess : true,
// 海报
canShare : '', // 分享图片
isImgLay : false, // 是否显示图片弹出层
isImgLong : false,// 长按保存图片
paintings : {
width: "375px",
height: "375px",
borderRadius: "10px",
background: "#ffffff",
views: [
//海报背景
{
type: "image",
url: "/static/share_downback.png",
css: {
top: "0",
left: "0",
width: "375px",
height: "375px",
mode: 'aspectFill'
},
},
//二维码
{
type: "image",
url: "",
css: {
top: "60px",
left: "60px",
width: "255px",
height: "255px",
mode: 'aspectFill'
},
}
],
},
posterImg: "", //生成的海报图片路径
}
},
onShow() {
Init().then(res => {
this.isSalesman = res.is_salesman
}).catch(err => {
uni.showToast({
title: err.message,
icon: "none"
})
})
// 获取历史结果
this.listsInfo()
},
methods: {
// 历史结果
listsInfo() {
Lists().then(res => {
this.paySuccess = false
this.listsArr = res
}).catch(err => {
uni.showToast({
title: err.message,
icon: "none"
})
})
},
// 删除结果
resultClick(index, id) {
uni.showModal({
title: '删除确认',
content: '是否删除此计算记录',
success: res=> {
if (res.confirm) {
logDel(id).then(res => {
this.listsArr.splice(index, 1)
}).catch(err => {
uni.showToast({
title: err.message,
icon: "none"
})
})
} else if (res.cancel) {
console.log('用户点击取消');
}
}
});
},
// 查看还款计划表
generalClick(arr){
this.otherArr = arr
this.timeArr = arr.project
this.timeAll = arr.project_total
this.generalShow = !this.generalShow
},
// 其他方式
otherSee() {
let newData = JSON.stringify(this.otherArr);
uni.navigateTo({
url: `/pages/result/other?data=${encodeURIComponent(newData)}`
})
this.generalShow = false
},
// 显示海报
unlockClick(share) {
this.paintings.views[1].url = share.qrcode
this.isImgLay = true
this.canShare = share
},
// 下载海报
shareClick (){
this.isImgLay = false
this.isImgLong = true
},
saveSuccess(src) {
this.posterImg = src;
},
saveFail(err) {},
}
}
</script>
<style>
.indexTop {
width: 100%;
height: 440rpx;
}
.indexTips {
position: absolute;
top: 0;
left: 0;
padding: 60rpx 40rpx 0;
box-sizing: border-box;
color: #fff;
}
.indexTips-name {
font-weight: 600;
font-size: 44rpx;
}
.indexTips-text {
margin-top: 20rpx;
font-size: 28rpx;
}
.indexCont {
width: 100%;
padding: 30rpx;
box-sizing: border-box;
position: absolute;
margin-top: 200rpx;
top: 0;
left: 0;
}
.indexCont-white {
height: 100%;
background: white;
border-radius: 20rpx;
padding: 30rpx;
box-sizing: border-box;
margin-bottom: 30rpx;
position: relative;
}
.resultDel {
position: absolute;
right: 30rpx;
top: 30rpx;
background-color: #ff7171;
color: #ffffff;
border-radius: 80rpx;
line-height: 52rpx;
padding: 0 24rpx;
display: inline-block;
font-size: 26rpx;
}
.resultTitle {
font-weight: 600;
font-size: 34rpx;
color: #0c58d2;
margin-bottom: 20rpx;
}
.item-label {
line-height: 48rpx;
padding: 15rpx 0;
display: flex;
margin-right: 20rpx;
font-weight: 400;
}
.item-label-name {
color: #999999;
}
.textShadow {
filter: blur(6px);
}
.tips {
font-weight: 400;
background-color: #f7faff;
border-radius: 10rpx;
padding: 20rpx 30rpx;
text-align: justify;
box-sizing: border-box;
font-size: 26rpx;
color: #999999;
line-height: 40rpx;
margin-top: 20rpx;
}
.see {
text-align: center;
margin-top: 30rpx;
}
.see-go {
display: inline-block;
border: 2rpx solid #0c58d2;
color: #0c58d2;
line-height: 74rpx;
padding: 0 25rpx;
border-radius: 10rpx;
}
.indexLock {
width: 34rpx;
vertical-align: -4rpx;
margin-right: 10rpx;
}
/* 计划表弹出 */
.tipsBack {
position: fixed;
width: 100vw;
height: 100vh;
left: 0;
top: 0;
z-index: 9;
background-color: rgba(0, 0, 0, .6);
}
.tipsCont {
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-box-pack: center;
position: fixed;
left: 0;
right: 0;
top: 0;
bottom: 0;
z-index: 10;
padding: 0 10%;
box-sizing: border-box;
text-align: center;
}
.tipsWhite {
background-color: #ffffff;
border-radius: 20rpx;
padding: 30rpx;
box-sizing: border-box;
position: relative;
}
.close {
position: absolute;
left: calc(50% - 35rpx);
width: 70rpx;
bottom: -120rpx;
z-index: 999;
}
.tipsTitle {
font-weight: 600;
font-size: 34rpx;
}
.tipsList {
margin: 20rpx 0;
font-size: 28rpx;
font-weight: 400;
}
.tipsList-tab {
display: flex;
background: #e5edf8;
line-height: 90rpx;
border-radius: 20rpx 20rpx 0 0;
}
.tips-tab-item, .tips-label-item {
flex: 4;
text-align: center;
}
.tipsList-data {
background: #fafafa;
border-radius: 0 0 20rpx 20rpx;
max-height: 30vh;
overflow: hidden;
overflow-y: scroll;
}
.tipsList-label {
display: flex;
line-height: 80rpx;
border-bottom: 2rpx solid #eeeeee;
}
.tipsList-label:last-child {
border: none;
}
.tipsWhite-btn {
text-align: center;
padding: 30rpx 0 20rpx;
}
.tipsWhite-btn-go {
display: inline-block;
width: 70%;
line-height: 88rpx;
border-radius: 80rpx;
background-color: #0c58d2;
color: #fff;
}
.postertBack {
width: 100vw;
height: 100vh;
position: fixed;
background-color: rgba(0,0,0,.6);
left: 0;
top: 0;
z-index: 999;
}
.postertCont {
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-box-pack: center;
position: fixed;
left: 0;
right: 0;
top: 0;
bottom: 0;
z-index: 1000;
padding: 0 10%;
box-sizing: border-box;
}
.postertContTop {
top: -200rpx;
}
.poster-back {
position: relative;
padding-top: 100%;
width: 100%;
}
.poster-img, .poster-Cont {
position: absolute;
width: 100%;
height: 100%;
left: 0;
top: 0;
}
.poster-Cont {
padding: 50rpx;
box-sizing: border-box;
color: #fff;
}
.poster-Cont-code {
background: #fff;
border-radius: 20rpx;
padding: 30rpx;
box-sizing: border-box;
}
.poster-Cont-code image {
width: 100%;
}
.poster-Cont-url {
display: flex;
padding: 30rpx 0 40rpx;
}
.poster-url-number {
flex: 1;
padding-right: 20rpx;
box-sizing: border-box;
}
.poster-url-copy {
font-weight: 600;
}
.poster-Cont-btn {
text-align: center;
}
.poster-Cont-down {
display: inline-block;
width: 80%;
background-color: #fff;
border-radius: 80rpx;
line-height: 90rpx;
color: #051437;
font-weight: 600;
}
.poster-Cont-down-img {
width: 40rpx;
margin-left: 15rpx;
vertical-align: -8rpx;
animation: bounce-down 2s linear infinite;
}
@keyframes bounce-down {
25% {
transform: translateX(-4px);
}
50%,
100% {
transform: translateX(0);
}
75% {
transform: translateX(4px);
}
}
.sign-img-btn {
position: absolute;
left: calc(50% - 35rpx);
width: 70rpx;
top: calc(100% + 240rpx);
z-index: 999;
}
.poster-img-btn {
width: 70rpx;
display: block;
margin: 30rpx auto 0;
}
/* 暂无数据 */
.reportTips-title {
color: #000;
font-size: 34rpx;
line-height: 80rpx;
}
.reportTips-text {
font-size: 26rpx;
}
.reportTips-btn {
background-color: #3b7cff;
display: inline-block;
color: #fff;
line-height: 78rpx;
padding: 0 60rpx;
border-radius: 10rpx;
margin-top: 50rpx;
}
.pack-center {
z-index: 99999;
}
.grey {
background-color: #f9f9f9;
z-index: 9999999;
}
</style>

251
pages/result/other.vue Normal file
View File

@@ -0,0 +1,251 @@
<template>
<view class="content">
<image class="indexTop" src="/static/index_top.png" mode="scaleToFill"></image>
<view class="indexTips">
<view class="indexTips-name">其他还款方式</view>
<view class="indexTips-text">根据您填写的内容生成以下结果</view>
</view>
<view class="indexCont">
<view class="indexCont-white">
<view class="item">
<view class="item-label">
<view class="item-label-name">
机构名称
</view>
<view class="item-label-text">
{{listsArr.institution}}
</view>
</view>
<view class="item-label">
<view class="item-label-name">
欠款金额
</view>
<view class="item-label-text">
{{listsArr.total}}
</view>
</view>
</view>
<view class="tipsTitle">其他还款表单位</view>
<view class="tipsList">
<view class="tipsList-tab">
<view class="tips-label-item">期数</view>
<view class="tips-tab-item">刷POS</view>
<view class="tips-tab-item">分期还款</view>
<view class="tips-tab-item">最低还款</view>
<view class="tips-tab-item">逾期不还</view>
</view>
<view class="tipsList-data">
<view class="tipsList-label" v-for="(items, index) in listsArr.other" :key="index">
<view class="tips-label-item">{{index+1}}</view>
<view class="tips-label-item">{{items.pos}}</view>
<view class="tips-label-item">{{items.stages}}</view>
<view class="tips-label-item">{{items.mincash}}</view>
<view class="tips-label-item">{{items.overdue}}</view>
</view>
</view>
</view>
<view class="list">
<view class="list-label">
<view class="list-name">POS合计</view>
<view class="list-text">{{listsArr.other_total.pos_add}}</view>
</view>
<view class="list-label">
<view class="list-name">分期合计</view>
<view class="list-text">{{listsArr.other_total.stages_add}}</view>
</view>
<view class="list-label">
<view class="list-name">最低合计</view>
<view class="list-text">{{listsArr.other_total.mincash_add}}</view>
</view>
<view class="list-label">
<view class="list-name">逾期合计</view>
<view class="list-text">{{listsArr.other_total.overdue_add}}</view>
</view>
<view class="list-label">
<view class="list-name">外加偿还本金</view>
<view class="list-text">{{listsArr.other_total.principal}}</view>
</view>
</view>
</view>
<navigator hover-class="none" open-type="navigateBack" class="return">返回</navigator>
</view>
</view>
</template>
<script>
export default {
data() {
return {
listsArr : '', // 结果列表
}
},
onLoad(options){
let dData = decodeURIComponent(options.data);
let newdData = JSON.parse(dData)
this.listsArr = newdData
console.log(newdData)
},
created() {
},
methods: {
}
}
</script>
<style>
.indexTop {
width: 100%;
height: 440rpx;
}
.indexTips {
position: absolute;
top: 0;
left: 0;
padding: 60rpx 40rpx 0;
box-sizing: border-box;
color: #fff;
}
.indexTips-name {
font-weight: 600;
font-size: 44rpx;
}
.indexTips-text {
margin-top: 20rpx;
font-size: 28rpx;
}
.indexCont {
width: 100%;
padding: 30rpx;
box-sizing: border-box;
position: absolute;
margin-top: 240rpx;
top: 0;
left: 0;
}
.indexCont-white {
height: 100%;
background: white;
border-radius: 20rpx;
padding: 30rpx;
box-sizing: border-box;
margin-bottom: 30rpx;
position: relative;
}
.indexCont-white::after,
.indexCont-white::before {
position: absolute;
content: '';
background-color: rgba(255, 255, 255, .4);
left: 20rpx;
border-radius: 20rpx 20rpx 0 0;
}
.indexCont-white::after {
z-index: 2;
width: calc(100% - 40rpx);
left: 20rpx;
top: -25rpx;
height: 25px;
}
.indexCont-white::before {
z-index: 1;
width: calc(100% - 80rpx);
left: 40rpx;
top: -50rpx;
height: 50rpx;
}
.item {
overflow: hidden;
}
.item-label {
line-height: 48rpx;
padding: 15rpx 0;
display: flex;
margin-right: 20rpx;
font-weight: 400;
}
.item-label-name {
color: #999999;
}
.list {
border-top: 2rpx dotted #eeeeee;
margin-top: 30rpx;
padding-top: 10rpx;
}
.list-label {
display: flex;
padding: 30rpx 0 10rpx;
}
.list-name {
flex: 1;
}
.list-text {
font-weight: 600;
}
.return {
margin-top: 50rpx;
margin-bottom: 30rpx;
width: 100%;
background-color: #fff;
border-radius: 80rpx;
line-height: 88rpx;
text-align: center;
color: #0c58d2;
border: 2rpx solid #0c58d2;
}
.tipsTitle {
font-size: 28rpx;
margin-top: 30rpx;
color: #0c58d2;
}
.tipsList {
margin: 20rpx 0;
font-size: 26rpx;
font-weight: 400;
border: 1px solid #eee;;
border-radius: 20rpx;
}
.tipsList-tab {
display: flex;
background: #e5edf8;
line-height: 90rpx;
border-radius: 20rpx 20rpx 0 0;
}
.tips-tab-item, .tips-label-item {
flex: 4;
text-align: center;
}
.tipsList-label {
display: flex;
line-height: 80rpx;
background: #fafafa;
border-bottom: 2rpx solid #eeeeee;
}
.tipsList-label:last-child {
border: none;
}
</style>

614
pages/result/result.vue Normal file
View File

@@ -0,0 +1,614 @@
<template>
<view class="content">
<image class="indexTop" src="/static/index_top.png" mode="scaleToFill"></image>
<view class="indexTips">
<view class="indexTips-name">计算结果...</view>
<view class="indexTips-text">根据您填写的内容生成以下结果</view>
</view>
<view class="indexCont">
<view class="indexCont-white" v-for="(item, index) in listsArr" :key="index">
<view class="resultTitle">
{{item.institution}}
</view>
<view class="resultList">
<view class="item">
<view class="item-label">
<view class="item-label-name">
欠款金额
</view>
<view class="item-label-text">
{{item.total}}
</view>
</view>
<view :class="{textShadow: item.status != '1'}">
<view class="item-label">
<view class="item-label-name">
首付金额
</view>
<view class="item-label-text">
{{item.base.first_amount}}
</view>
</view>
<view class="item-label">
<view class="item-label-name">
分期金额
</view>
<view class="item-label-text">
{{item.base.periods_amount}}
</view>
</view>
<view class="item-label">
<view class="item-label-name">
分期期数
</view>
<view class="item-label-text">
{{item.base.periods}}
</view>
</view>
<view class="item-label">
<view class="item-label-name">
手续费费率
</view>
<view class="item-label-text">
{{item.base.tax}}%
</view>
</view>
<view class="item-label">
<view class="item-label-name">
每期还款本金
</view>
<view class="item-label-text">
{{item.base.every_total}}
</view>
</view>
<view class="item-label">
<view class="item-label-name">
每期还款手续费
</view>
<view class="item-label-text">
{{item.base.every_tax}}
</view>
</view>
<view class="item-label">
<view class="item-label-name">
总还款金额
</view>
<view class="item-label-text">
{{item.base.total}}
</view>
</view>
<view class="item-label">
<view class="item-label-name">
总还款本金
</view>
<view class="item-label-text">
{{item.base.principal}}
</view>
</view>
<view class="item-label">
<view class="item-label-name">
总还款手续费
</view>
<view class="item-label-text">
{{item.base.tax_amount}}
</view>
</view>
</view>
</view>
<view class="tips">温馨提示{{item.description}}</view>
<view class="see">
<view class="see-go" @click="generalClick(item)" v-if="item.status == '1'">点击查看还款计划表</view>
<view class="see-go" @click="unlockClick(item.share)" v-else><image class="indexLock" src="/static/lock.png" mode="widthFix"></image>分享二维码解锁次数</view>
</view>
</view>
</view>
</view>
<!-- 还款计划表弹出 -->
<view class="tipsBack" v-if="generalShow" :catchtouchmove="true"></view>
<view class="tipsCont" v-if="generalShow" :catchtouchmove="true">
<view class="tipsWhite">
<view class="tipsTitle">还款计划表单位</view>
<view class="tipsList">
<view class="tipsList-tab">
<view class="tips-tab-item">期数</view>
<view class="tips-tab-item">还款金额</view>
<view class="tips-tab-item">本金</view>
<view class="tips-tab-item">手续费</view>
</view>
<view class="tipsList-data">
<view class="tipsList-label" v-for="(items, index) in timeArr" :key="index">
<view class="tips-label-item">{{index+1}}</view>
<view class="tips-label-item">{{items.total}}</view>
<view class="tips-label-item">{{items.principal}}</view>
<view class="tips-label-item">{{items.tax}}</view>
</view>
<view class="tipsList-label">
<view class="tips-label-item">合计</view>
<view class="tips-label-item">{{timeAll.total}}</view>
<view class="tips-label-item">{{timeAll.principal}}</view>
<view class="tips-label-item">{{timeAll.tax}}</view>
</view>
</view>
</view>
<view class="tipsWhite-btn">
<view @click="otherSee" class="tipsWhite-btn-go">
其他还款方式
</view>
</view>
<image class="close" @click="generalShow = false" src="/static/close.png" mode="widthFix"></image>
</view>
</view>
<!-- 邀请好友弹出 -->
<view class="postertBack" v-if="isImgLay"></view>
<view class="postertCont postertContTop" v-if="isImgLay">
<view class="poster-back">
<image class="poster-img" src="/static/share_back.png" mode="widthFix"></image>
<view class="poster-Cont">
<view class="poster-Cont-code">
<image :src="canShare.qrcode" mode="widthFix"></image>
</view>
<view class="poster-Cont-url">
<view class="nowrap poster-url-number" @click="copyUrl(canShare.url)">地址{{canShare.url}}/</view>
<view class="poster-url-copy">复制</view>
</view>
<view class="poster-Cont-btn">
<view class="poster-Cont-down" @click="shareClick">保存图片分享好友<image class="poster-Cont-down-img" src="/static/hand.png" mode="widthFix"></image></view>
</view>
</view>
<image class="sign-img-btn" src="/static/close.png" @click="isImgLay = false" mode="widthFix"></image>
</view>
</view>
<!-- 长按保存 -->
<view class="postertBack" v-if="isImgLong"></view>
<view class="postertCont" v-if="isImgLong">
<view class="poster-back">
<image v-if="isImgLong" class="poster-img" :src="posterImg" mode="widthFix"></image>
<view class="poster-Cont-btn" style="margin-top: 40rpx; text-align: center;">
<view class="poster-Cont-down">请长按图片保存本地</view>
<image class="poster-img-btn" src="/static/close.png" @click="isImgLong = false" mode="widthFix"></image>
</view>
</view>
</view>
<!-- 海报canvas -->
<vue-canvas-poster :widthPixels="1000" :painting="paintings" @success="saveSuccess" @fail="saveFail"></vue-canvas-poster>
</view>
</template>
<script>
import { Lists } from '@/apis/interfaces/index'
import { VueCanvasPoster } from 'vue-canvas-poster'
export default {
components: {
VueCanvasPoster
},
data() {
return {
listsArr : [], // 结果列表
timeArr : [], // 还款计划表列表
timeAll : '', // 还款计划表总计
otherArr : '', // 其他携带数据
generalShow: false,
// 海报
canShare : '', // 分享图片
isImgLay : false, // 是否显示图片弹出层
isImgLong : false,// 长按保存图片
paintings : {
width: "375px",
height: "375px",
borderRadius: "10px",
background: "#ffffff",
views: [
//海报背景
{
type: "image",
url: "/static/share_downback.png",
css: {
top: "0",
left: "0",
width: "375px",
height: "375px",
mode: 'aspectFill'
},
},
//二维码
{
type: "image",
url: "",
css: {
top: "60px",
left: "60px",
width: "255px",
height: "255px",
mode: 'aspectFill'
},
}
],
},
posterImg: "", //生成的海报图片路径
}
},
created() {
// 获取查看结果
this.listsInfo()
},
methods: {
// 查看结果
listsInfo() {
Lists().then(res => {
this.listsArr = res
}).catch(err => {
uni.showToast({
title: err.message,
icon: "none"
})
})
},
// 查看还款计划表
generalClick(arr){
this.otherArr = arr
this.timeArr = arr.project
this.timeAll = arr.project_total
this.generalShow = !this.generalShow
},
// 其他方式
otherSee() {
let newData = JSON.stringify(this.otherArr);
uni.navigateTo({
url: `/pages/result/other?data=${encodeURIComponent(newData)}`
})
this.generalShow = false
},
// 显示海报
unlockClick(share) {
this.paintings.views[1].url = share.qrcode
this.isImgLay = true
this.canShare = share
},
// 下载海报
shareClick (){
this.isImgLay = false
this.isImgLong = true
},
saveSuccess(src) {
this.posterImg = src;
},
saveFail(err) {},
}
}
</script>
<style>
.indexTop {
width: 100%;
height: 440rpx;
}
.indexTips {
position: absolute;
top: 0;
left: 0;
padding: 60rpx 40rpx 0;
box-sizing: border-box;
color: #fff;
}
.indexTips-name {
font-weight: 600;
font-size: 44rpx;
}
.indexTips-text {
margin-top: 20rpx;
font-size: 28rpx;
}
.indexCont {
width: 100%;
padding: 30rpx;
box-sizing: border-box;
position: absolute;
margin-top: 200rpx;
top: 0;
left: 0;
}
.indexCont-white {
height: 100%;
background: white;
border-radius: 20rpx;
padding: 30rpx;
box-sizing: border-box;
margin-bottom: 30rpx;
}
.resultTitle {
font-weight: 600;
font-size: 34rpx;
color: #0c58d2;
margin-bottom: 20rpx;
}
.item-label {
line-height: 48rpx;
padding: 15rpx 0;
display: flex;
margin-right: 20rpx;
font-weight: 400;
}
.item-label-name {
color: #999999;
}
.textShadow {
filter: blur(6px);
}
.tips {
font-weight: 400;
background-color: #f7faff;
border-radius: 10rpx;
padding: 20rpx 30rpx;
text-align: justify;
box-sizing: border-box;
font-size: 26rpx;
color: #999999;
line-height: 40rpx;
margin-top: 20rpx;
}
.see {
text-align: center;
margin-top: 30rpx;
}
.see-go {
display: inline-block;
border: 2rpx solid #0c58d2;
color: #0c58d2;
line-height: 74rpx;
padding: 0 25rpx;
border-radius: 10rpx;
}
.indexLock {
width: 34rpx;
vertical-align: -4rpx;
margin-right: 10rpx;
}
/* 计划表弹出 */
.tipsBack {
position: fixed;
width: 100vw;
height: 100vh;
left: 0;
top: 0;
z-index: 9;
background-color: rgba(0, 0, 0, .6);
}
.tipsCont {
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-box-pack: center;
position: fixed;
left: 0;
right: 0;
top: 0;
bottom: 0;
z-index: 10;
padding: 0 10%;
box-sizing: border-box;
text-align: center;
}
.tipsWhite {
background-color: #ffffff;
border-radius: 20rpx;
padding: 30rpx;
box-sizing: border-box;
position: relative;
}
.close {
position: absolute;
left: calc(50% - 35rpx);
width: 70rpx;
bottom: -120rpx;
z-index: 999;
}
.tipsTitle {
font-weight: 600;
font-size: 34rpx;
}
.tipsList {
margin: 20rpx 0;
font-size: 28rpx;
font-weight: 400;
}
.tipsList-tab {
display: flex;
background: #e5edf8;
line-height: 90rpx;
border-radius: 20rpx 20rpx 0 0;
}
.tips-tab-item, .tips-label-item {
flex: 4;
text-align: center;
}
.tipsList-data {
background: #fafafa;
border-radius: 0 0 20rpx 20rpx;
max-height: 30vh;
overflow: hidden;
overflow-y: scroll;
}
.tipsList-label {
display: flex;
line-height: 80rpx;
border-bottom: 2rpx solid #eeeeee;
}
.tipsList-label:last-child {
border: none;
}
.tipsWhite-btn {
text-align: center;
padding: 30rpx 0 20rpx;
}
.tipsWhite-btn-go {
display: inline-block;
width: 70%;
line-height: 88rpx;
border-radius: 80rpx;
background-color: #0c58d2;
color: #fff;
}
.postertBack {
width: 100vw;
height: 100vh;
position: fixed;
background-color: rgba(0,0,0,.6);
left: 0;
top: 0;
z-index: 999;
}
.postertCont {
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-box-pack: center;
position: fixed;
left: 0;
right: 0;
top: 0;
bottom: 0;
z-index: 1000;
padding: 0 10%;
box-sizing: border-box;
}
.postertContTop {
top: -200rpx;
}
.poster-back {
position: relative;
padding-top: 100%;
width: 100%;
}
.poster-img, .poster-Cont {
position: absolute;
width: 100%;
height: 100%;
left: 0;
top: 0;
}
.poster-Cont {
padding: 50rpx;
box-sizing: border-box;
color: #fff;
}
.poster-Cont-code {
background: #fff;
border-radius: 20rpx;
padding: 30rpx;
box-sizing: border-box;
}
.poster-Cont-code image {
width: 100%;
}
.poster-Cont-url {
display: flex;
padding: 30rpx 0 40rpx;
}
.poster-url-number {
flex: 1;
padding-right: 20rpx;
box-sizing: border-box;
}
.poster-url-copy {
font-weight: 600;
}
.poster-Cont-btn {
text-align: center;
}
.poster-Cont-down {
display: inline-block;
width: 80%;
background-color: #fff;
border-radius: 80rpx;
line-height: 90rpx;
color: #051437;
font-weight: 600;
}
.poster-Cont-down-img {
width: 40rpx;
margin-left: 15rpx;
vertical-align: -8rpx;
animation: bounce-down 2s linear infinite;
}
@keyframes bounce-down {
25% {
transform: translateX(-4px);
}
50%,
100% {
transform: translateX(0);
}
75% {
transform: translateX(4px);
}
}
.sign-img-btn {
position: absolute;
left: calc(50% - 35rpx);
width: 70rpx;
top: calc(100% + 240rpx);
z-index: 999;
}
.poster-img-btn {
width: 70rpx;
display: block;
margin: 30rpx auto 0;
}
</style>

48
pages/webview/webview.vue Normal file
View File

@@ -0,0 +1,48 @@
<template>
<view>
<web-view :src="url"></web-view>
</view>
</template>
<script>
import { wechatCode } from '@/apis/interfaces/authUrl'
export default {
data() {
return {}
},
onLoad(options) {
// 获取微信code
wechatCode({
code : options.code,
share_user : this.$store.getters.getShareUser,
invite : this.$store.getters.getInvite,
lock_id : this.$store.getters.getLockId
}).then(res => {
this.$store.commit('setToken', res.token_type + ' ' + res.token)
this.$store.commit('setPassInfo', res.pass_info)
this.$store.commit('setShareUser', '')
this.$store.commit('setInvite', '')
this.$store.commit('setLockId', '')
if(res.pass_info) {
uni.redirectTo({
url: '/pages/index/index'
})
return
}
uni.redirectTo({
url: '/pages/index/perfect'
})
}).catch(err => {
uni.showToast({
title: err.message,
icon: "none"
})
})
}
}
</script>
<style>
</style>

BIN
static/add.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

BIN
static/arrow.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

BIN
static/basic_down.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 247 B

BIN
static/close.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

BIN
static/hand.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

BIN
static/index_top.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

BIN
static/loadingGif.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 217 KiB

BIN
static/lock.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 704 B

BIN
static/record.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

BIN
static/removeIcon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 539 B

BIN
static/share.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

BIN
static/share_back.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 477 KiB

BIN
static/share_downback.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 146 KiB

BIN
static/tel.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

BIN
static/tips.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 66 KiB

BIN
static/user_default.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 KiB

BIN
static/warm.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

59
store/index.js Normal file
View File

@@ -0,0 +1,59 @@
/**
* 手太欠
* 愿这世界都如故事里一样 美好而动人~
*/
import Vue from 'vue'
import Vuex from 'vuex'
Vue.use(Vuex)
export default new Vuex.Store({
state: {
token : uni.getStorageSync('token') || '',
invite : uni.getStorageSync('invite') || '',
shareUser : uni.getStorageSync('shareUser') || '',
lockId : uni.getStorageSync('lockId') || '',
passinfo : uni.getStorageSync('passinfo') || ''
},
getters: {
getToken: state => {
return state.token
},
getInvite: state => {
return state.invite
},
getShareUser: state => {
return state.shareUser
},
getLockId: state => {
return state.lockId
},
getPassInfo: state => {
return state.passinfo
}
},
mutations: {
setToken(state, tokenString) {
state.token = tokenString
uni.setStorageSync('token', tokenString)
},
setInvite(state, inviteString) {
state.invite = inviteString
uni.setStorageSync('invite', inviteString)
},
setShareUser(state, shareString) {
state.shareUser = shareString
uni.setStorageSync('shareUser', shareString)
},
setLockId(state, lockIdString) {
state.lockId = lockIdString
uni.setStorageSync('lockId', lockIdString)
},
setPassInfo(state, passString) {
state.passinfo = passString
uni.setStorageSync('passinfo', JSON.stringify(passString))
}
}
})

76
uni.scss Normal file
View File

@@ -0,0 +1,76 @@
/**
* 这里是uni-app内置的常用样式变量
*
* uni-app 官方扩展插件及插件市场https://ext.dcloud.net.cn上很多三方插件均使用了这些样式变量
* 如果你是插件开发者建议你使用scss预处理并在插件代码中直接使用这些变量无需 import 这个文件方便用户通过搭积木的方式开发整体风格一致的App
*
*/
/**
* 如果你是App开发者插件使用者你可以通过修改这些变量来定制自己的插件主题实现自定义主题功能
*
* 如果你的项目同样使用了scss预处理你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
*/
/* 颜色变量 */
/* 行为相关颜色 */
$uni-color-primary: #007aff;
$uni-color-success: #4cd964;
$uni-color-warning: #f0ad4e;
$uni-color-error: #dd524d;
/* 文字基本颜色 */
$uni-text-color:#333;//基本色
$uni-text-color-inverse:#fff;//反色
$uni-text-color-grey:#999;//辅助灰色,如加载更多的提示信息
$uni-text-color-placeholder: #808080;
$uni-text-color-disable:#c0c0c0;
/* 背景颜色 */
$uni-bg-color:#ffffff;
$uni-bg-color-grey:#f8f8f8;
$uni-bg-color-hover:#f1f1f1;//点击状态颜色
$uni-bg-color-mask:rgba(0, 0, 0, 0.4);//遮罩颜色
/* 边框颜色 */
$uni-border-color:#c8c7cc;
/* 尺寸变量 */
/* 文字尺寸 */
$uni-font-size-sm:12px;
$uni-font-size-base:14px;
$uni-font-size-lg:16;
/* 图片尺寸 */
$uni-img-size-sm:20px;
$uni-img-size-base:26px;
$uni-img-size-lg:40px;
/* Border Radius */
$uni-border-radius-sm: 2px;
$uni-border-radius-base: 3px;
$uni-border-radius-lg: 6px;
$uni-border-radius-circle: 50%;
/* 水平间距 */
$uni-spacing-row-sm: 5px;
$uni-spacing-row-base: 10px;
$uni-spacing-row-lg: 15px;
/* 垂直间距 */
$uni-spacing-col-sm: 4px;
$uni-spacing-col-base: 8px;
$uni-spacing-col-lg: 12px;
/* 透明度 */
$uni-opacity-disabled: 0.3; // 组件禁用态的透明度
/* 文章场景相关 */
$uni-color-title: #2C405A; // 文章标题颜色
$uni-font-size-title:20px;
$uni-color-subtitle: #555555; // 二级标题颜色
$uni-font-size-subtitle:26px;
$uni-color-paragraph: #3F536E; // 文章段落颜色
$uni-font-size-paragraph:15px;