合并代码

This commit is contained in:
sx 2025-01-04 20:33:45 +08:00
parent 7a72bb3349
commit 538d243657
26 changed files with 2600 additions and 816 deletions

View File

@ -1,18 +1,23 @@
<script> <script>
// //
import util from '@/common/js/util'; import util from '@/common/js/util';
//
import api from '@/api/index.js'
// vuex // vuex
import store from '@/store/index.js' import store from '@/store/index.js'
// import Mixins from '@/utils/Mixins.js' // import Mixins from '@/utils/Mixins.js'
uni.setStorageSync('token',`eyJhbGciOiJIUzUxMiJ9.eyJhcHBVc2VyIjp7ImNyZWF0ZVRpbWUiOiIyMDI0LTEyLTMwIDE0OjUxOjEyIiwiY3JlYXRlQnkiOiIwIiwidXBkYXRlVGltZSI6IjIwMjUtMDEtMDEgMDU6MTQ6NDgiLCJ1cGRhdGVCeSI6IjAiLCJkZWxGbGFnIjoiMCIsImlkIjoiMTMiLCJ1c2VyTmFtZSI6IkppdVlp55So5oi3NzZkbHA2cTAiLCJwaG9uZU51bWJlciI6IjE1NjY2MDA2NTkyIiwiaW52aXRhdGlvbkNvZGUiOiJTd3ZKdDkwbSIsInVzZXJOaWNrbmFtZSI6IuWFrOWQq-W6mSIsInNleCI6bnVsbCwiYXZhdGFyIjpudWxsLCJiaXJ0aGRheSI6bnVsbCwiYWNjb3VudCI6Ijc2ZGxwNnEwIiwidXNlclJlYWxOYW1lIjpudWxsLCJ1c2VySWRDYXJkIjpudWxsLCJob21lVG93biI6bnVsbCwicGVyc29uYWxTaWduYXR1cmUiOm51bGwsImhhc1NlY29uZENpcGhlciI6bnVsbCwidXNlckltZWkiOiIxNzM1NTczOTk1NjQ3NzE1OTc0MCIsInVzZXJBdHRlbnRpb24iOm51bGwsInVzZXJGYW5zIjpudWxsLCJwdWJsaWNQcmFpc2VkIjpudWxsLCJwcml2YWN5UHJhaXNlZCI6bnVsbCwic2NvcmUiOjBFLTEwLCJsYXNoaW5Bd2FyZCI6MCwiZnJ1aXQiOjkzMDAsInVzZXJMaW5lU3RhdGUiOjEsImlzU2hvcCI6MCwiYmFja2dyb3VuZCI6bnVsbCwiYWNjb3VudFVwZGF0ZVRpbWUiOm51bGwsImlzUmVhbE5hbWUiOm51bGwsInJlZmVycmVyVXNlcklkIjoxfX0.nhK1AawF-ynYZ-tZ1IRvgkc5jcmVkEAyuli3z025akFFljfuK8wlz2rBGELtPvg-746G4mg1Bvgku4_MXEuzhQ`)
export default { export default {
// mixins: [Mixins], // mixins: [Mixins],
onLaunch() { onLaunch() {
//
this.getUserinfo() this.getUserinfo()
//
this.getConfig()
}, },
methods: { methods: {
//
getUserinfo() { getUserinfo() {
// //
const token = uni.getStorageSync('token') const token = uni.getStorageSync('token')
@ -35,6 +40,13 @@
}) })
} }
}, },
//
getConfig() {
api.getConfig().then(rs => {
})
}
} }
} }
</script> </script>

View File

@ -37,5 +37,29 @@ export const durian = {
load: true, load: true,
}) })
}, },
/**
* 校验姓名
* @param {Object} param
*/
nameComparison(param) {
return util.request({
url: `/coreplay/app/durian/nameComparison`,
method: 'GET',
query: param.query,
load: true,
})
},
/**
* 交易榴莲果
* @param {Object} param
*/
consume(param) {
return util.request({
url: `/coreplay/app/durian/consume`,
method: 'POST',
data: param.data,
load: true,
})
},
} }
export default durian export default durian

View File

@ -51,6 +51,17 @@ const api = {
method: 'POST', method: 'POST',
}) })
}, },
/**
* 获取各种配置
* @param {Object} param
*/
getConfig() {
return util.request({
url: '/coreplay/configinfo/list',
method: 'GET',
})
},
} }
export default api export default api

View File

@ -96,7 +96,7 @@ const intergral = {
buyScroll(param) { buyScroll(param) {
return util.request({ return util.request({
url: `/coreplay/app/scrollinfo/buyScroll`, url: `/coreplay/app/scrollinfo/buyScroll`,
method: 'G', method: 'POST',
data: param.data, data: param.data,
}) })
}, },

View File

@ -49,30 +49,6 @@ const mine = {
}) })
}, },
/**
* 支付
* @param {Object} param
*/
pay(param) {
return util.request({
url: '/home/pay',
query: param.query,
method: 'POST',
})
},
/**
* 获取余额记录
* @param {Object} param
*/
getBalanceLog(param) {
return util.request({
url: '/home/getBalanceLog',
query: param.query,
method: 'POST',
})
},
/** /**
* 查询我的钱包接口 * 查询我的钱包接口
* @param {Object} param * @param {Object} param
@ -95,6 +71,54 @@ const mine = {
method: 'GET', method: 'GET',
}) })
}, },
/**
* 获取待释放列表
* @param {Object} param
*/
releasedList(param) {
return util.request({
url: '/user/released/list',
query: param.query,
method: 'GET',
})
},
/**
* 根据用户账号查询用户id
* @param {Object} param
*/
getUserDataByAccount(param) {
return util.request({
url: '/coreplay/app/durian/getUserDataByAccount',
query: param.query,
method: 'GET',
})
},
/**
* 设置二级密码
* @param {Object} param
*/
setSecondLevelCipher(param) {
return util.request({
url: '/user/user/setSecondLevelCipher',
data: param.data,
method: 'POST',
})
},
/**
* 验证二级密码
* @param {Object} param
*/
checkSecondLevelCipher(param) {
return util.request({
url: '/user/user/checkSecondLevelCipher',
data: param.data,
method: 'POST',
})
},
} }
export default mine export default mine

View File

@ -0,0 +1,84 @@
<script setup>
//
import {
computed,
defineExpose,
ref,
getCurrentInstance,
defineEmits
} from 'vue';
import {
useStore
} from 'vuex'
import util from '@/common/js/util.js'
//
import CryptoJS from 'crypto-js';
//
const {
proxy
} = getCurrentInstance()
//
const emit = defineEmits(['defineEmits'])
//
const store = useStore()
//
const pwd = ref('')
//
const userinfo = computed(() => {
return store.state.userinfo
})
//
function open() {
//
if (userinfo.value.hasSecondCipher) {
proxy.$refs.pwdRef.open()
} else {
uni.navigateTo({
url: '/pages/mine/setting/secondPwd'
})
}
}
//
function close() {
proxy.$refs.pwdRef.open()
}
//
function handleConfirm() {
if (!/^\d{6}$/.test(pwd.value)) {
util.alert('二级密码不正确')
return
}
// md5
emit('confirm', CryptoJS.MD5(pwd.value).toString())
}
//
defineExpose({
open,
close,
})
</script>
<template>
<uni-popup ref="pwdRef" type="center">
<view class="pwdAlt popMid plr30 bfff">
<view class="title mtb30 f30">验证二级密码</view>
<view class="inputBox mtb20 plr30">
<input v-model="pwd" :maxlength="6" type="number" placeholder="输入二级密码" />
</view>
<view class="btns mtb30 rows">
<view class="btn lg cancel plr40 f1" @click="$refs.pwd.close()">取消</view>
<view class="btn lg black plr40 f1" @click="handleConfirm">验证</view>
</view>
</view>
</uni-popup>
</template>
<style>
</style>

View File

@ -0,0 +1,145 @@
<template>
<view class="uni-flex uni-flex-center vcode-input-body">
<text class="vcode-input-item"
:class="isBorderLine?'vcode-input-line':'vcode-input-border'"
v-for="(v,index) in sum"
:key="index"
@tap="setFocus"
:style="getStyle(index)">
{{ text[index]?text[index]:'' }}
</text>
<input
ref="VcodeInput"
type="number"
class="hidden-input"
:focus="focus"
:maxlength="sum"
@input="inputVal"
@blur="setBlur"
:password="isPassword"
placeholder="验证码"/>
</view>
</template>
<script>
export default {
name:'VcodeInput',
props: {
sum:{
type: Number,
default: 6
},
isBorderLine:{
type:Boolean,
default:false
},
borderColor:{
type:String,
default:'#DADADA'
},
borderValueColor:{
type:String,
default:'#424456'
},
borderActiveColor:{
type:String,
default:'#FF6B00'
},
isAutoComplete:{
type: Boolean,
default: true
},
isPassword:{
type: Boolean,
default: false
}
},
data() {
return {
focus:false,
text:[]
};
},
created() {
setTimeout(()=>{
this.focus=true;
},300)
},
methods:{
getStyle(index){
let style={};
style.borderColor=this.borderColor;
if(this.text.length>index){
style.borderColor=this.borderValueColor;
style.color=this.borderValueColor;
}
if(this.text.length===index){
style.borderColor=this.borderActiveColor;
}
return style;
},
setBlur(){
this.focus=false;
},
setFocus(){
this.focus=true;
},
inputVal(e) {
let value=e.detail.value;
if(this.isAutoComplete){
if(value.length>=this.sum){
this.focus=false;
this.$emit('vcodeInput', value);
}
}else{
this.$emit('vcodeInput', value);
}
if(this.isPassword){
let val='';
for (let i = 0; i < value.length; i++) {
val+='●';
}
this.text=val;
}else{
this.text=value;
}
}
}
}
</script>
<style lang="scss" scoped>
.vcode-input-body{
margin-left: -36rpx;
margin-right: -36rpx;
position: relative;
overflow: hidden;
.vcode-input-item{
width: 76rpx;
height: 76rpx;
margin-left: 12rpx;
margin-right: 12rpx;
line-height: 76rpx;
text-align: center;
font-weight: 500;
}
.vcode-input-border{
border-style: solid;
border-width: 2rpx;
border-color: $uni-border-color;
border-radius: 4rpx;
}
.vcode-input-line{
border-bottom-style: solid;
border-bottom-width: 2rpx;
border-color: $uni-border-color;
}
.hidden-input{
width: 1px;
height: 1px;
position: absolute;
left: -1px;
top: -1px;
}
}
</style>

View File

@ -678,26 +678,38 @@
} }
}, },
{ {
"path" : "pages/mine/setting/feedback", "path": "pages/mine/setting/feedback",
"style" : "style": {
{ "navigationBarTitleText": "意见反馈",
"navigationBarTitleText" : "意见反馈",
"navigationBarBackgroundColor": "#fff" "navigationBarBackgroundColor": "#fff"
} }
}, },
{ {
"path" : "pages/shop/search", "path": "pages/shop/search",
"style" : "style": {
{ "navigationBarTitleText": "搜索",
"navigationBarTitleText" : "搜索",
"navigationStyle": "custom" "navigationStyle": "custom"
} }
}, },
{ {
"path" : "pages/index/hashOrder", "path": "pages/index/hashOrder",
"style": {
"navigationBarTitleText": "哈希订单",
"navigationBarBackgroundColor": "#fff"
}
},
{
"path": "pages/login/lock",
"style": {
"navigationBarTitleText": "输入密码以解锁",
"navigationBarBackgroundColor": "#fff"
}
},
{
"path" : "pages/mine/setting/secondPwd",
"style" : "style" :
{ {
"navigationBarTitleText" : "哈希订单", "navigationBarTitleText" : "二级密码",
"navigationBarBackgroundColor": "#fff" "navigationBarBackgroundColor": "#fff"
} }
} }

View File

@ -28,6 +28,8 @@
import task from '@/components/index/task' import task from '@/components/index/task'
// //
import api from '@/api/index.js' import api from '@/api/index.js'
//
import payPwd from '@/components/mine/payPwd.vue'
const { const {
proxy proxy
} = getCurrentInstance() } = getCurrentInstance()
@ -35,10 +37,18 @@
const store = useStore() const store = useStore()
// //
const form = reactive({ const form = reactive({
// ID
targetUserId: '',
// //
account: '', account: '',
// //
fruitAmount: '', fruitAmount: '',
//
first: '',
//
name: '',
//
secondPassword: '',
}) })
// //
const viewData = ref({ const viewData = ref({
@ -61,6 +71,7 @@
onReady(() => { onReady(() => {
// proxy.$refs.dealRef.open() // proxy.$refs.dealRef.open()
// proxy.$refs.payPwdRef.open()
}) })
onLoad(() => { onLoad(() => {
@ -68,21 +79,111 @@
util.getPurse() util.getPurse()
}) })
// id
function accToId() {
// api.durian.
}
// //
function transfer() { function handleSubmit() {
durianlApi.transfer({ //
if (!form.account) {
util.alert('请输入账号')
return
}
if (!form.fruitAmount) {
util.alert('请输入榴莲果转账数量')
return
}
// id
api.mine.getUserDataByAccount({
query: { query: {
account: form.account, account: form.account,
sellNum: form.sellNum },
}).then(rs => {
if (rs.code === 200) {
const result = rs.data
// id
form.targetUserId = result.userName
form.name = result.userRealName.slice(1, result.userRealName.length)
//
proxy.$refs.payee.open()
return
}
util.alert({
content: rs.msg,
showCancel: false,
})
})
}
//
function handlePayeeConfirm() {
//
if (!form.first) {
util.alert('请输入对方姓名首字母')
return
}
api.durian.nameComparison({
query: {
//
account: form.account,
//
name: `${form.first}${form.name}`,
}
}).then(rs => {
if (rs.code == 200) {
if (rs.data) proxy.$refs.payPwdRef.open()
return
}
util.alert({
content: rs.msg,
showCancel: false,
})
})
}
/**
* 交易
* @param {Object} ev 二级密码
*/
function handlePwdConfirm(ev) {
//
if (!form.first) {
util.alert('请输入对方姓名首字母')
return
}
if (!form.first) {
util.alert('请输入对方姓名首字母')
return
}
if (!form.account) {
util.alert('请输入账号')
return
}
if (!form.fruitAmount) {
util.alert('请输入榴莲果转账数量')
return
}
api.durian.consume({
data: {
//
properties: {
// id
targetUserId: form.targetUserId,
//
transactionType: 10,
//
fruitAmount: form.fruitAmount,
},
//
name: `${form.first}${form.name}`,
//
account: form.account,
//
secondPassword: ev,
} }
}).then(rs => { }).then(rs => {
if (rs.code === 200) { if (rs.code === 200) {
util.alert('操作成功') //
util.getPurse() util.getPurse()
return return
} }
@ -187,21 +288,45 @@
</view> </view>
<view class="inputBox mtb20 plr30"> <view class="inputBox mtb20 plr30">
<input v-model="form.account" type="text" placeholder="输入对方账号" /> <input v-model.trim="form.account" type="text" placeholder="输入对方账号" />
</view>
<view class="inputBox mtb20 plr30">
<input v-model="form.sellNum" type="number" placeholder="输入数量" />
</view> </view>
<view class="hint mtb30 tac f20"> <view class="inputBox mtb20 plr30">
<input v-model.trim="form.fruitAmount" type="number" placeholder="输入数量" />
</view>
<view class="hint mtb30 tac f22">
<view>销毁15%</view> <view>销毁15%</view>
<!-- <view>互转成功之后冻结24h</view> -->
<view>(最低x起转)</view> <view>(最低x起转)</view>
</view> </view>
<view class="button btn lg bar black" @click="transfer">转移</view> <view class="button btn lg bar black" @click="handleSubmit">转移</view>
</view> </view>
</uni-popup> </uni-popup>
<!-- 收款方 -->
<uni-popup ref="payee" type="center">
<view class="payee popMid ver ptb40 plr60 bfff br30">
<view class="title tac c333 f28">收款方确认</view>
<view class="mtb20 f28">请补全对方姓名首字以防转错</view>
<view class="inputBox rows mauto mtb20 plr30">
<input class="first" v-model.trim="form.first" type="text" placeholder="" />
<view class="">*</view>
<view class="f1 tar">{{form.name}}</view>
</view>
<view class="rows mt50">
<view class="btn sm cancel plr40" @click="$refs.payee.close()">取消</view>
<view class="btn sm black plr40" @click="handlePayeeConfirm">验证</view>
</view>
</view>
</uni-popup>
<!-- 二级支付 -->
<payPwd ref="payPwdRef" @confirm="handlePwdConfirm" />
</template> </template>
<style lang="scss"> <style lang="scss">
@ -253,4 +378,16 @@
opacity: .7; opacity: .7;
} }
} }
//
.payee {
.inputBox {
width: 120rpx;
box-shadow: 0 0 20rpx rgba(0, 0, 0, .2);
}
.first {
width: 50rpx;
}
}
</style> </style>

View File

@ -40,12 +40,16 @@
let result = store.state.userinfo let result = store.state.userinfo
return result return result
}) })
//
const purse = computed(() => {
return store.state.purse || {}
})
onLoad(() => { onLoad(() => {
// //
buyDurianList() buyDurianList()
// //
// getArticle() util.getPurse()
}) })
onReady(() => { onReady(() => {
@ -54,10 +58,15 @@
// //
function buyDurianList() { function buyDurianList() {
durianlApi.durianList({ durianlApi.durianList({}).then(rs => {
if (rs.code == 200) {
}).then(rs => { viewData.value = rs.data
viewData.value = rs.data return
}
util.alert({
content: rs.msg,
showCancel: false,
})
}) })
} }
@ -91,7 +100,8 @@
if (rs.code === 200) { if (rs.code === 200) {
util.alert('置换成功') util.alert('置换成功')
proxy.$refs.typeRef.close() proxy.$refs.typeRef.close()
util.getUserinfo() //
util.getPurse()
return return
} }
@ -145,12 +155,12 @@
<view class="has navs mtb40 plr50 c333 f28"> <view class="has navs mtb40 plr50 c333 f28">
<view class="item df"> <view class="item df">
<image class="wh150" src="/static/sapling.png" mode="aspectFit" /> <image class="wh150" src="/static/sapling.png" mode="aspectFit" />
<text>×{{userinfo.seed}}</text> <text>×{{purse.seed}}</text>
</view> </view>
<view class="item df"> <view class="item df">
<image class="wh150" src="/static/fruit.png" mode="aspectFit" /> <image class="wh150" src="/static/fruit.png" mode="aspectFit" />
<text>×{{userinfo.fruit}}</text> <text>×{{purse.fruit}}</text>
</view> </view>
</view> </view>

View File

@ -0,0 +1,191 @@
<script setup>
//
import {
ref,
reactive,
computed,
getCurrentInstance,
} from 'vue'
import {
useStore
} from 'vuex'
// api
import api from '@/api/index.js'
// util
import util from '@/common/js/util.js'
//
import CryptoJS from 'crypto-js';
const {
proxy
} = getCurrentInstance()
//
const store = useStore()
// set check
const mode = ref('set')
//
const form = reactive({
pwd: '',
rePwd: '',
})
//
const passwordArr = reactive([])
const AffirmStatus = ref(1)
//
const userinfo = computed(() => {
let result = store.state.userinfo
if (result.hasSecondCipher) mode.value = 'check'
return result
})
//
function handleSubmit() {
const data = {
...form
}
//
if (!data.pwd) {
util.alert('二级密码不能为空')
}
if (data.pwd !== data.rePwd) {
util.alert('两次输入密码不一致')
}
//
data.pwd = CryptoJS.MD5(data.pwd).toString()
//
api.mine.setSecondLevelCipher({
data: {
id: userinfo.value.id,
secondLevelCipher: data.pwd,
}
}).then(rs => {
if (rs.code == 200) {
util.alert('设置成功')
util.getUserinfo()
uni.navigateBack()
return
}
util.alert({
content: rs.msg,
showCanecl: false,
})
})
}
//
function handleCheck() {
const data = {
...form
}
//
if (!data.pwd) {
util.alert('二级密码不能为空')
}
//
data.pwd = CryptoJS.MD5(data.pwd).toString()
//
api.mine.checkSecondLevelCipher({
data: {
id: userinfo.value.id,
secondLevelCipher: data.pwd,
}
}).then(rs => {
if (rs.code == 200) {
form.pwd = ''
mode.value = 'set'
return
}
util.alert({
content: rs.msg,
showCanecl: false,
})
})
}
/**
* 唤起键盘
*/
function onPayUp() {
proxy.$refs.CodeKeyboard.show();
}
/**
* 支付键盘回调
* @param {Object} val
*/
function KeyInfo(val) {
console.log('val', val)
if (val.index >= 6) {
return
}
//
if (val.keyCode === 8) {
//
passwordArr.splice(val.index + 1, 1)
}
// .
else if (val.keyCode == 190) {
// .
} else {
passwordArr.push(val.key);
}
// 6
if (passwordArr.length === 6) {
passwordArr = [];
AffirmStatus.value = AffirmStatus.value + 1;
}
}
</script>
<template>
<view class="appbw">
<view class="container ver mt10p" v-if="mode === 'set'">
<view class="title c333 f54">设置二级密码</view>
<view class="content mt50 c666 f32">请设置六位数字的二级密码</view>
<view class="inputBox mt50 ptb10 plr30">
<input type="number" :maxlength="6" v-model="form.pwd" :focus="true" placeholder="六位数字密码" />
</view>
<view class="inputBox mt50 ptb10 plr30">
<input type="number" :maxlength="6" v-model="form.rePwd" placeholder="再次输入密码" />
</view>
<!-- <view class="pwd rows mt50 ptb10 plr30" @click="onPayUp">
<view class="item fmid" v-for="(item,index) in 6" :key="index">
<text v-if="passwordArr[index] != null"></text>
</view>
</view> -->
<view class="btn lg black mtb50 plr50" @click="handleSubmit">确认</view>
</view>
<view class="container ver mt10p" v-if="mode === 'check'">
<view class="title c333 f54">验证二级密码</view>
<view class="content mt50 c666 f32">请输入二级密码用于验证</view>
<view class="inputBox mt50 ptb10 plr30">
<input type="number" :maxlength="6" v-model="form.pwd" :focus="true" placeholder="六位数字密码" />
</view>
<view class="btn lg black mtb50 plr50" @click="handleCheck">验证</view>
</view>
</view>
<cc-defineKeyboard ref="CodeKeyboard" passwrdType="pay" @KeyInfo="KeyInfo" />
</template>
<style lang="scss">
.pwd {
.item {
margin: 0 10rpx;
width: 70rpx;
height: 80rpx;
background-color: #f4f4f4;
border-radius: 10rpx;
}
}
</style>

View File

@ -155,7 +155,7 @@
<uni-icons type="right" /> <uni-icons type="right" />
</view> </view>
<view class="line rows"> <view class="line rows" @click="link('/pages/mine/setting/secondPwd')">
<view class="">二级密码</view> <view class="">二级密码</view>
<uni-icons type="right" /> <uni-icons type="right" />
</view> </view>

View File

@ -251,7 +251,6 @@ call_type 通话类型 2为视频1是音频
我的团队 我的团队
点击上级上上级昵称 跳转个人视频主页(关注后可发私信) 点击上级上上级昵称 跳转个人视频主页(关注后可发私信)
充值 充值
支付宝 支付宝
微信 微信

View File

@ -0,0 +1,12 @@
## 2.32024-11-23
组件优化
## 2.22024-10-02
组件优化
## 2.02023-08-03
修复小程序bug
## 1.0.22023-06-21
组件优化 增加键盘高度
## 1.0.12023-06-21
组件优化
## 1.0.02023-06-21
组件初始化

View File

@ -0,0 +1,43 @@
.page-total{
position: fixed;
left: 0;
bottom: 0;
width: 100%;
background-color: #f6f6f6;
}
.key-list{
display: flex;
flex-wrap: wrap;
align-items: center;
padding: 1% 3%;
height: 90%;
margin-top: 20rpx;
.list{
display: flex;
align-items: center;
justify-content: center;
width: 32%;
height: 92rpx;
background-color: #FFFFFF;
border-radius: 10rpx;
box-shadow: 0 0 10rpx rgba(0,0,0,0.1);
margin-right: 1.7%;
margin-bottom: 16rpx;
text{
font-size: 38rpx;
font-weight: bold;
color: #222222;
}
}
.list:nth-child(3n){
margin-right: 0;
}
.special{
background-color: #f6f6f6;
box-shadow: none;
text{
color: #959595;
}
}
}

View File

@ -0,0 +1,115 @@
<template>
<view class="page-total" v-show="isShow">
<view class="key-list">
<view class="list" v-for="(item,index) in keyList"
:class="{'special':item.keyCode==190||item.keyCode==8}"
@click="onKeyList(item,index)"
:key="item.keyCode">
<text>{{item.key}}</text>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
isShow: false,
keyList: [
{
key: 1,
en: '',
keyCode: 49,
},{
key: 2,
en: 'ABC',
keyCode: 50,
},{
key: 3,
en: 'ABC',
keyCode: 51,
},{
key: 4,
en: 'ABC',
keyCode: 52,
},{
key: 5,
en: 'ABC',
keyCode: 53,
},{
key: 6,
en: 'ABC',
keyCode: 54,
},{
key: 7,
en: 'ABC',
keyCode: 55,
},{
key: 8,
en: 'ABC',
keyCode: 56,
},{
key: 9,
en: 'ABC',
keyCode: 57,
},{
key: '',
en: 'ABC',
keyCode: 190,
},{
key: 0,
en: 'ABC',
keyCode: 48,
},{
key: 'del',
en: 'DEL',
keyCode: 8,
},
],
keyIndex: -1,
};
},
props:{
passwrdType: {
type: String,
default: 'pay'
}
},
methods:{
show(){
this.isShow = true;
},
hide(){
this.isShow = false;
},
/**
* 密码键盘按下
* @param {Object} item
* @param {Number} index
*/
onKeyList(item,index){
let KeyInfo = item;
//
if(KeyInfo.keyCode === 8 && this.keyIndex > -1){
this.keyIndex--;
}
//
if(KeyInfo.keyCode != 8){
if(this.passwrdType == 'pay' && this.keyIndex >= 5){
console.log('支付键盘');
this.keyIndex = -1;
return;
}
this.keyIndex++;
}
KeyInfo.index = this.keyIndex;
this.$emit('KeyInfo',KeyInfo);
}
}
}
</script>
<style scoped lang="scss">
@import 'cc-defineKeyboard.scss';
</style>

View File

@ -0,0 +1,88 @@
{
"id": "cc-defineKeyboard",
"displayName": "自定义支付密码输入键盘Keyboard和支付设置输入框Input",
"version": "2.3",
"description": "自定义支付密码输入键盘Keyboard和支付设置输入框Input",
"keywords": [
"支付密码",
"键盘",
"",
"支付密码输入键盘",
"Keyboard",
"",
"自定义键盘"
],
"repository": "",
"engines": {
"HBuilderX": "^3.7.0"
},
"dcloudext": {
"type": "component-vue",
"sale": {
"regular": {
"price": "0.00"
},
"sourcecode": {
"price": "0.00"
}
},
"contact": {
"qq": ""
},
"declaration": {
"ads": "无",
"data": "无",
"permissions": "无"
},
"npmurl": ""
},
"uni_modules": {
"dependencies": [],
"encrypt": [],
"platforms": {
"cloud": {
"tcb": "y",
"aliyun": "y",
"alipay": "n"
},
"client": {
"Vue": {
"vue2": "y",
"vue3": "y"
},
"App": {
"app-vue": "y",
"app-nvue": "y"
},
"H5-mobile": {
"Safari": "y",
"Android Browser": "y",
"微信浏览器(Android)": "y",
"QQ浏览器(Android)": "y"
},
"H5-pc": {
"Chrome": "y",
"IE": "y",
"Edge": "y",
"Firefox": "y",
"Safari": "y"
},
"小程序": {
"微信": "y",
"阿里": "y",
"百度": "y",
"字节跳动": "y",
"QQ": "y",
"钉钉": "y",
"快手": "y",
"飞书": "y",
"京东": "y"
},
"快应用": {
"华为": "y",
"联盟": "y"
}
}
}
}
}

View File

@ -0,0 +1,261 @@
# cc-defineKeyboard
##uniapp专属精品组件页面模板由前端组件开发出品精品组件页面模板
###●组件模板规划:
由前端组件开发出品的精品组件页面模板,将陆续发布,预计高达约几百种供您使用,是快速快发项目、创业的必备精品。
合集地址: uni-app模板合集地址(https://ext.dcloud.net.cn/publisher?id=274945) 如查看全部页面模板请前往上述uniapp插件市场合集地址
###●组件模板效果图:
可下载项目后预览,效果图见右侧图片;
###●组件模板费用:
学习:免费下载,进行学习,无费用;
使用/商用本页面地址赞赏10元后可终身商用
###●组件模板使用版权/商用:
本组件模板免费下载可供学习如需使用及商用请在本组件页面模板进行赞赏10元
仅需10元获取精品页面模板代码-物有所值1个组件页面市场价100元
赞赏10元后当前项目产生赞赏订单可追溯即可终身商用当前本地址下载的页面模版代码不同下载地址需进行不同的赞赏。不赞赏就进行商用使用者面临侵权保留追究知识产权法律责任后果自负
### 我的技术公众号(私信可加前端技术交流群)
群内气氛挺不错的,应该或许可能大概,算是为数不多的,专搞技术的前端群,偶尔聊天摸鱼
![图片](https://i.postimg.cc/RZ0sjnYP/front-End-Component.jpg)
#### 使用方法
```使用方法
<!-- ref:唯一ref passwrdType密码样式pay keyInfo密码输入监测事件 -->
<cc-defineKeyboard ref="CodeKeyboard" passwrdType="pay" @KeyInfo="KeyInfo"></cc-defineKeyboard>
/** * 唤起键盘 */
onPayUp() {
this.$refs.CodeKeyboard.show();
},
/*** 支付键盘回调* @param {Object} val */
KeyInfo(val) {
if (val.index >= 6) {
return;
}
// 判断是否输入的是删除键
if (val.keyCode === 8) {
// 删除最后一位
this.passwordArr.splice(val.index + 1, 1)
}
// 判断是否输入的是.
else if (val.keyCode == 190) {
// 输入.无效
} else {
this.passwordArr.push(val.key);
}
uni.showModal({
title: '温馨提示',
content: '输入密码是 = ' + JSON.stringify(this.passwordArr)
})
}
```
#### HTML代码实现部分
```html
<template>
<view class="page">
<view>
<view class="pay-title">
<text v-show="AffirmStatus === 1">请输入6位支付密码</text>
<text v-show="AffirmStatus === 2">请设置6位支付密码</text>
<text v-show="AffirmStatus === 3">请确认6位支付密码</text>
</view>
<view class="pay-password" @click="onPayUp">
<view class="list">
<text v-show="passwordArr.length >= 1"></text>
</view>
<view class="list">
<text v-show="passwordArr.length >= 2"></text>
</view>
<view class="list">
<text v-show="passwordArr.length >= 3"></text>
</view>
<view class="list">
<text v-show="passwordArr.length >= 4"></text>
</view>
<view class="list">
<text v-show="passwordArr.length >= 5"></text>
</view>
<view class="list">
<text v-show="passwordArr.length >= 6"></text>
</view>
</view>
<view class="hint">
<text>忘记支付密码?</text>
</view>
</view>
<!-- ref:唯一ref passwrdType密码样式pay keyInfo密码输入返回事件 -->
<cc-defineKeyboard ref="CodeKeyboard" passwrdType="pay" @KeyInfo="KeyInfo"></cc-defineKeyboard>
</view>
</template>
<script>
export default {
components: {
},
data() {
return {
AffirmStatus: 1,
passwordArr: [],
oldPasswordArr: [],
newPasswordArr: [],
afPasswordArr: [],
};
},
onLoad() {
},
methods: {
/**
* 唤起键盘
*/
onPayUp() {
this.$refs.CodeKeyboard.show();
},
/**
* 支付键盘回调
* @param {Object} val
*/
KeyInfo(val) {
if (val.index >= 6) {
return;
}
// 判断是否输入的是删除键
if (val.keyCode === 8) {
// 删除最后一位
this.passwordArr.splice(val.index + 1, 1)
}
// 判断是否输入的是.
else if (val.keyCode == 190) {
// 输入.无效
} else {
this.passwordArr.push(val.key);
}
uni.showModal({
title: '温馨提示',
content: '输入密码是 = ' + JSON.stringify(this.passwordArr)
})
// 判断是否等于6
if (this.passwordArr.length === 6) {
this.passwordArr = [];
this.AffirmStatus = this.AffirmStatus + 1;
}
// 判断到哪一步了
if (this.AffirmStatus === 1) {
this.oldPasswordArr = this.passwordArr;
} else if (this.AffirmStatus === 2) {
this.newPasswordArr = this.passwordArr;
} else if (this.AffirmStatus === 3) {
this.afPasswordArr = this.passwordArr;
} else if (this.AffirmStatus === 4) {
console.log(this.oldPasswordArr.join(''));
console.log(this.newPasswordArr.join(''));
console.log(this.afPasswordArr.join(''));
uni.showToast({
title: '修改成功',
icon: 'none'
})
setTimeout(() => {
uni.navigateBack();
}, 2000)
}
this.$forceUpdate();
}
}
}
</script>
<style scoped lang="scss">
$base: orangered; // 基础颜色
.page {
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
background-color: #FFFFFF;
}
.pay-title {
display: flex;
align-items: center;
justify-content: center;
width: 100%;
height: 200rpx;
text {
font-size: 28rpx;
color: #555555;
}
}
.pay-password {
display: flex;
align-items: center;
width: 90%;
height: 80rpx;
margin: 20rpx auto;
border: 2rpx solid $base;
.list {
display: flex;
align-items: center;
justify-content: center;
width: 16.666%;
height: 100%;
border-right: 2rpx solid #EEEEEE;
text {
font-size: 32rpx;
}
}
.list:nth-child(6) {
border-right: none;
}
}
.hint {
display: flex;
align-items: center;
justify-content: center;
width: 100%;
height: 100rpx;
text {
font-size: 28rpx;
color: $base;
}
}
</style>
```

View File

@ -1706,28 +1706,6 @@ const mine = {
load: true load: true
}); });
}, },
/**
* 支付
* @param {Object} param
*/
pay(param) {
return util$1.request({
url: "/home/pay",
query: param.query,
method: "POST"
});
},
/**
* 获取余额记录
* @param {Object} param
*/
getBalanceLog(param) {
return util$1.request({
url: "/home/getBalanceLog",
query: param.query,
method: "POST"
});
},
/** /**
* 查询我的钱包接口 * 查询我的钱包接口
* @param {Object} param * @param {Object} param
@ -1748,6 +1726,39 @@ const mine = {
query: param.query, query: param.query,
method: "GET" method: "GET"
}); });
},
/**
* 获取待释放列表
* @param {Object} param
*/
releasedList(param) {
return util$1.request({
url: "/user/released/list",
query: param.query,
method: "GET"
});
},
/**
* 根据用户账号查询用户id
* @param {Object} param
*/
getUserDataByAccount(param) {
return util$1.request({
url: "/coreplay/app/durian/getUserDataByAccount",
query: param.query,
method: "GET"
});
},
/**
* 设置二级密码
* @param {Object} param
*/
setSecondLevelCipher(param) {
return util$1.request({
url: "/user/user/setSecondLevelCipher",
body: param.body,
method: "POST"
});
} }
}; };
const video = { const video = {
@ -2431,32 +2442,69 @@ const intergral = {
buyScroll(param) { buyScroll(param) {
return util$1.request({ return util$1.request({
url: `/coreplay/app/scrollinfo/buyScroll`, url: `/coreplay/app/scrollinfo/buyScroll`,
method: "G", method: "POST",
data: param.data data: param.data
}); });
}, }
};
const durian = {
/** /**
* 验证码生成 * 果树列表
* @param {Object} param * @param {Object} param
*/ */
myQrcode(param) { durianList(param) {
return util$1.request({ return util$1.request({
url: `/user/team/getH5Link`, url: `/coreplay/duriantreeinfo/tree-list`,
method: "GET", method: "GET",
query: param.query, query: param.query
responseType: "arraybuffer"
}); });
}, },
/** /**
* 隐藏/公开 个人昵称 * 我的榴莲果树
* @param {Object} param * @param {Object} param
*/ */
nickname(param) { buyDurianList(param) {
return util$1.request({ return util$1.request({
url: `/home/nickname`, url: `/coreplay/duriantreeinfo/boughtListByUser`,
method: "post", method: "GET",
query: param.query query: param.query
}); });
},
/**
* 榴莲果置换
* @param {Object} param
*/
exchange(param) {
return util$1.request({
url: `/coreplay/duriantreeinfo/exchange`,
method: "POST",
data: param.data,
load: true
});
},
/**
* 校验姓名
* @param {Object} param
*/
nameComparison(param) {
return util$1.request({
url: `/coreplay/app/durian/nameComparison`,
method: "GET",
query: param.query,
load: true
});
},
/**
* 交易榴莲果
* @param {Object} param
*/
consume(param) {
return util$1.request({
url: `/coreplay/app/durian/consume`,
method: "POST",
data: param.data,
load: true
});
} }
}; };
const shop = { const shop = {
@ -2507,6 +2555,8 @@ const api = {
team, team,
// 积分 // 积分
intergral, intergral,
// 榴莲果
durian,
// 商城模块 // 商城模块
shop, shop,
// 上传图片地址 // 上传图片地址
@ -2524,6 +2574,16 @@ const api = {
query: param.query, query: param.query,
method: "POST" method: "POST"
}); });
},
/**
* 获取各种配置
* @param {Object} param
*/
getConfig() {
return util$1.request({
url: "/coreplay/configinfo/list",
method: "GET"
});
} }
}; };
const util = { const util = {

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

View File

@ -158,4 +158,10 @@
.dealAlt .hint { .dealAlt .hint {
color: #3d3d3d; color: #3d3d3d;
opacity: 0.7; opacity: 0.7;
}
.payee .inputBox {
width: 6.25rem;
}
.payee .first {
width: 1.5625rem;
} }

View File

@ -1831,28 +1831,6 @@ if (typeof uni !== 'undefined' && uni && uni.requireGlobal) {
load: true load: true
}); });
}, },
/**
* 支付
* @param {Object} param
*/
pay(param) {
return util$1.request({
url: "/home/pay",
query: param.query,
method: "POST"
});
},
/**
* 获取余额记录
* @param {Object} param
*/
getBalanceLog(param) {
return util$1.request({
url: "/home/getBalanceLog",
query: param.query,
method: "POST"
});
},
/** /**
* 查询我的钱包接口 * 查询我的钱包接口
* @param {Object} param * @param {Object} param
@ -1873,6 +1851,39 @@ if (typeof uni !== 'undefined' && uni && uni.requireGlobal) {
query: param.query, query: param.query,
method: "GET" method: "GET"
}); });
},
/**
* 获取待释放列表
* @param {Object} param
*/
releasedList(param) {
return util$1.request({
url: "/user/released/list",
query: param.query,
method: "GET"
});
},
/**
* 根据用户账号查询用户id
* @param {Object} param
*/
getUserDataByAccount(param) {
return util$1.request({
url: "/coreplay/app/durian/getUserDataByAccount",
query: param.query,
method: "GET"
});
},
/**
* 设置二级密码
* @param {Object} param
*/
setSecondLevelCipher(param) {
return util$1.request({
url: "/user/user/setSecondLevelCipher",
body: param.body,
method: "POST"
});
} }
}; };
var video = { var video = {
@ -2556,32 +2567,69 @@ if (typeof uni !== 'undefined' && uni && uni.requireGlobal) {
buyScroll(param) { buyScroll(param) {
return util$1.request({ return util$1.request({
url: `/coreplay/app/scrollinfo/buyScroll`, url: `/coreplay/app/scrollinfo/buyScroll`,
method: "G", method: "POST",
data: param.data data: param.data
}); });
}, }
};
var durian = {
/** /**
* 验证码生成 * 果树列表
* @param {Object} param * @param {Object} param
*/ */
myQrcode(param) { durianList(param) {
return util$1.request({ return util$1.request({
url: `/user/team/getH5Link`, url: `/coreplay/duriantreeinfo/tree-list`,
method: "GET", method: "GET",
query: param.query, query: param.query
responseType: "arraybuffer"
}); });
}, },
/** /**
* 隐藏/公开 个人昵称 * 我的榴莲果树
* @param {Object} param * @param {Object} param
*/ */
nickname(param) { buyDurianList(param) {
return util$1.request({ return util$1.request({
url: `/home/nickname`, url: `/coreplay/duriantreeinfo/boughtListByUser`,
method: "post", method: "GET",
query: param.query query: param.query
}); });
},
/**
* 榴莲果置换
* @param {Object} param
*/
exchange(param) {
return util$1.request({
url: `/coreplay/duriantreeinfo/exchange`,
method: "POST",
data: param.data,
load: true
});
},
/**
* 校验姓名
* @param {Object} param
*/
nameComparison(param) {
return util$1.request({
url: `/coreplay/app/durian/nameComparison`,
method: "GET",
query: param.query,
load: true
});
},
/**
* 交易榴莲果
* @param {Object} param
*/
consume(param) {
return util$1.request({
url: `/coreplay/app/durian/consume`,
method: "POST",
data: param.data,
load: true
});
} }
}; };
var shop = { var shop = {
@ -2632,6 +2680,8 @@ if (typeof uni !== 'undefined' && uni && uni.requireGlobal) {
team, team,
// 积分 // 积分
intergral, intergral,
// 榴莲果
durian,
// 商城模块 // 商城模块
shop, shop,
// 上传图片地址 // 上传图片地址
@ -2649,6 +2699,16 @@ if (typeof uni !== 'undefined' && uni && uni.requireGlobal) {
query: param.query, query: param.query,
method: "POST" method: "POST"
}); });
},
/**
* 获取各种配置
* @param {Object} param
*/
getConfig() {
return util$1.request({
url: "/coreplay/configinfo/list",
method: "GET"
});
} }
}; };
var util = { var util = {

View File

@ -1827,28 +1827,6 @@ if (typeof uni !== 'undefined' && uni && uni.requireGlobal) {
load: true load: true
}); });
}, },
/**
* 支付
* @param {Object} param
*/
pay(param) {
return util$1.request({
url: "/home/pay",
query: param.query,
method: "POST"
});
},
/**
* 获取余额记录
* @param {Object} param
*/
getBalanceLog(param) {
return util$1.request({
url: "/home/getBalanceLog",
query: param.query,
method: "POST"
});
},
/** /**
* 查询我的钱包接口 * 查询我的钱包接口
* @param {Object} param * @param {Object} param
@ -1869,6 +1847,39 @@ if (typeof uni !== 'undefined' && uni && uni.requireGlobal) {
query: param.query, query: param.query,
method: "GET" method: "GET"
}); });
},
/**
* 获取待释放列表
* @param {Object} param
*/
releasedList(param) {
return util$1.request({
url: "/user/released/list",
query: param.query,
method: "GET"
});
},
/**
* 根据用户账号查询用户id
* @param {Object} param
*/
getUserDataByAccount(param) {
return util$1.request({
url: "/coreplay/app/durian/getUserDataByAccount",
query: param.query,
method: "GET"
});
},
/**
* 设置二级密码
* @param {Object} param
*/
setSecondLevelCipher(param) {
return util$1.request({
url: "/user/user/setSecondLevelCipher",
body: param.body,
method: "POST"
});
} }
}; };
var video = { var video = {
@ -2552,32 +2563,69 @@ if (typeof uni !== 'undefined' && uni && uni.requireGlobal) {
buyScroll(param) { buyScroll(param) {
return util$1.request({ return util$1.request({
url: `/coreplay/app/scrollinfo/buyScroll`, url: `/coreplay/app/scrollinfo/buyScroll`,
method: "G", method: "POST",
data: param.data data: param.data
}); });
}, }
};
var durian = {
/** /**
* 验证码生成 * 果树列表
* @param {Object} param * @param {Object} param
*/ */
myQrcode(param) { durianList(param) {
return util$1.request({ return util$1.request({
url: `/user/team/getH5Link`, url: `/coreplay/duriantreeinfo/tree-list`,
method: "GET", method: "GET",
query: param.query, query: param.query
responseType: "arraybuffer"
}); });
}, },
/** /**
* 隐藏/公开 个人昵称 * 我的榴莲果树
* @param {Object} param * @param {Object} param
*/ */
nickname(param) { buyDurianList(param) {
return util$1.request({ return util$1.request({
url: `/home/nickname`, url: `/coreplay/duriantreeinfo/boughtListByUser`,
method: "post", method: "GET",
query: param.query query: param.query
}); });
},
/**
* 榴莲果置换
* @param {Object} param
*/
exchange(param) {
return util$1.request({
url: `/coreplay/duriantreeinfo/exchange`,
method: "POST",
data: param.data,
load: true
});
},
/**
* 校验姓名
* @param {Object} param
*/
nameComparison(param) {
return util$1.request({
url: `/coreplay/app/durian/nameComparison`,
method: "GET",
query: param.query,
load: true
});
},
/**
* 交易榴莲果
* @param {Object} param
*/
consume(param) {
return util$1.request({
url: `/coreplay/app/durian/consume`,
method: "POST",
data: param.data,
load: true
});
} }
}; };
var shop = { var shop = {
@ -2628,6 +2676,8 @@ if (typeof uni !== 'undefined' && uni && uni.requireGlobal) {
team, team,
// 积分 // 积分
intergral, intergral,
// 榴莲果
durian,
// 商城模块 // 商城模块
shop, shop,
// 上传图片地址 // 上传图片地址
@ -2645,6 +2695,16 @@ if (typeof uni !== 'undefined' && uni && uni.requireGlobal) {
query: param.query, query: param.query,
method: "POST" method: "POST"
}); });
},
/**
* 获取各种配置
* @param {Object} param
*/
getConfig() {
return util$1.request({
url: "/coreplay/configinfo/list",
method: "GET"
});
} }
}; };
var util = { var util = {

View File

@ -0,0 +1,39 @@
/**
* 这里是uni-app内置的常用样式变量
*
* uni-app 官方扩展插件及插件市场https://ext.dcloud.net.cn上很多三方插件均使用了这些样式变量
* 如果你是插件开发者建议你使用scss预处理并在插件代码中直接使用这些变量无需 import 这个文件方便用户通过搭积木的方式开发整体风格一致的App
*
*/
/**
* 如果你是App开发者插件使用者你可以通过修改这些变量来定制自己的插件主题实现自定义主题功能
*
* 如果你的项目同样使用了scss预处理你也可以直接在你的 scss 代码中使用如下变量同时无需 import 这个文件
*/
/* 颜色变量 */
/* 行为相关颜色 */
/* 文字基本颜色 */
/* 背景颜色 */
/* 边框颜色 */
/* 尺寸变量 */
/* 文字尺寸 */
/* 图片尺寸 */
/* Border Radius */
/* 水平间距 */
/* 垂直间距 */
/* 透明度 */
/* 文章场景相关 */
.container[data-v-4d44acdb] {
width: 100vw;
height: 100vh;
}
.container .password[data-v-4d44acdb] {
width: 80%;
background-color: #eee;
}
.container .password .input[data-v-4d44acdb] {
padding: 0.625rem 0.625rem;
}
.container .button[data-v-4d44acdb] {
width: 80%;
}