This commit is contained in:
唐明明
2021-09-25 15:55:29 +08:00
63 changed files with 4979 additions and 41 deletions

View File

@@ -10,6 +10,7 @@ import store from '@/store'
// 基础配置 // 基础配置
const config = { const config = {
apiUrl : 'http://api.ahxh.shangkelian.cn/api/', apiUrl : 'http://api.ahxh.shangkelian.cn/api/',
apiUrls : 'http://api.ahxh.shangkelian.cn',
timeout : 60000 timeout : 60000
} }
@@ -154,5 +155,6 @@ const loginHint = () => {
export { export {
request, request,
uploading uploading,
config
} }

53
apis/interfaces/news.js Normal file
View File

@@ -0,0 +1,53 @@
/**
* Web-zdx
* moduleName: 通知消息列表
*/
import {request} from '../index.js'
// 消息列表
const notificationsType = () => {
return request({
url: 'notifications',
method: 'GET'
})
}
// 根据type 获取具体消息列表
const notificationsList = (type,data) => {
return request({
url: 'notifications/'+type+'/list',
method: 'GET',
data:data
})
}
// 根据type 全部已读
const notificationsReaded = (type) => {
return request({
url: 'notifications/'+type,
method: 'PUT'
})
}
// 根据type 全部已读
const notificationsDelete= () => {
return request({
url: 'notifications',
method: 'DELETE'
})
}
// 根据消息id获取消息详情
const notificationsDetail= (id) => {
return request({
url: 'notifications/'+id,
method: 'get'
})
}
export {
notificationsType,
notificationsList,
notificationsDetail,
notificationsReaded,
notificationsDelete
}

View File

@@ -71,6 +71,13 @@ const aboutUs = () => {
url: 'articles/about' url: 'articles/about'
}) })
} }
// 获取企业认证状态 -1.未认证0.审核中1.审核通过2.驳回
const companyStatus = () => {
return request({
url: 'companies/applies/query'
})
}
export { export {
login, login,
@@ -80,5 +87,6 @@ export {
agreementLogin, agreementLogin,
resetUserInfo, resetUserInfo,
getUserSettingInfo, getUserSettingInfo,
aboutUs aboutUs,
companyStatus
} }

60
apis/interfaces/user.js Normal file
View File

@@ -0,0 +1,60 @@
/**
* Web唐明明
* 匆匆数载恍如梦,岁月迢迢华发增。
* 碌碌无为枉半生,一朝惊醒万事空。
* moduleName: 区块链
*/
import { request } from '../index'
// 节点中心-用户信息
const userIndex = () => {
return request({
url: 'user/web'
})
}
// 节点中心-公告
const userNotice = () => {
return request({
url: 'articles/notice'
})
}
// 专属客服
const userCustomer = () => {
return request({
url: 'user/services'
})
}
// 帮助中心
const userHelp = () => {
return request({
url: 'articles/helps'
})
}
// 服务条款
const userClause = () => {
return request({
url: 'articles/service'
})
}
// 邀请好友
const userInvite = () => {
return request({
url: 'articles/invite'
})
}
export {
userIndex,
userNotice,
userCustomer,
userHelp,
userClause,
userInvite
}

159
apis/interfaces/wallet.js Normal file
View File

@@ -0,0 +1,159 @@
/**
* Web唐明明
* 匆匆数载恍如梦,岁月迢迢华发增。
* 碌碌无为枉半生,一朝惊醒万事空。
* moduleName: 钱包
*/
import {request} from '../index.js'
// 导出助记词
const seed = () => {
return request({
url: 'chain/safe/seed'
})
}
const hash = (data) => {
return request({
url: 'chain/wallet/hash',
method: 'POST',
data: data
})
}
// 收款码
const code = () => {
return request({
url: 'chain/account/code'
})
}
// 原石余额
const sum = () => {
return request({
url: 'chain/account/balance'
})
}
// 原石价格
const price = () => {
return request({
url: 'nodes/price'
})
}
// 账户记录
const logs = (data) => {
return request({
url: 'chain/account/logs',
data: data
})
}
// 设置安全密码
const security = (data) => {
return request({
url: 'chain/safe/security',
method: 'POST',
data
})
}
// 转账
const transfer = (data) => {
return request({
url: 'chain/account/transfer',
method: 'POST',
data
})
}
// 钱包私钥
const privatekey = (code) => {
return request({
url : "chain/safe/private_key",
data: {
code
}
})
}
// 获取可提现信息
const withdraw = () => {
return request({
url : "withdraw"
})
}
// 提现记录
const withdrawLogs = (data) => {
return request({
url : "withdraw/logs",
data:data
})
}
// 提现
const withdrawDo = (data) => {
return request({
url : "withdraw",
method: 'POST',
data:data
})
}
// 验证支付密码是否正确
const securityCheck = (password) => {
return request({
url : "chain/safe/security/check",
method: 'POST',
data:{
code : password,
}
})
}
// 修改密码
const securityReset = (data) => {
return request({
url : "chain/safe/security",
method: 'PUT',
data:data
})
}
// 提现服务条款
const cmsWithdraw = () => {
return request({
url : "cms/withdraw"
})
}
// 私钥规则
const keyrules = () => {
return request({
url: 'cms/keyrules'
})
}
export {
seed,
hash,
code,
sum,
price,
logs,
security,
transfer,
privatekey,
withdraw,
withdrawLogs,
withdrawDo,
securityCheck,
securityReset,
cmsWithdraw,
keyrules
}

View File

@@ -0,0 +1,72 @@
<template>
<view class="NOList">
<view class="no-addr">
<image :src="`${webUrl}/storage/imageresource/no-image/${name}.png`" mode="widthFix" />
{{txt}}
</view>
</view>
</template>
<script>
import {config} from '@/apis/index.js'
export default {
name: "NOList",
/**
* name 携带过来的图片名称 (与本地问图片文件相对应)
*
* no-address没有地址
* no-counpon没有优惠券
* no-goods没有商品
* no-list没有订单列表
* no-news没有任何消息
* no-new1没有任何消息1
* no-chain (没有区块链信息)
* no-collection没有任何收藏信息
* no-foot (没有足迹信息)
* no-in没有收入信息
* no-out (没有任何支出信息)
* no-order (没有任何订单信息)
* no-order-list (没有任何订单信息)
* no-record (没有任何收益信息)
* no-records 没有任何收益信息2
* no-search (没有任何搜索信息)
* no-shop (没有任何店铺信息)
*
*
* txt 携带过来的提示语
*/
props: {
name: String,
txt: String
},
data() {
return {
webUrl:''
};
},
mounted() {
this.webUrl = config.apiUrls
}
}
</script>
<style lang="scss" scoped>
// 无地址
.no-addr {
padding-top: $padding*4;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
box-sizing: border-box;
color: #999;
font-size: $title-size*0.9;
image {
margin-bottom: $margin*2;
margin-top: $margin*1;
width: 400rpx;
opacity: .4;
}
}
</style>

View File

@@ -0,0 +1,238 @@
<template>
<view class="numberJpan" :style="wc" v-show="flag" >
<!-- <view class="myshuru" :style="obj" @tap.stop="flag=true">
<view class="srk" :style="'width:'+100/(length||6)+'%'" v-for=" i in length||6" :id="(i-1)==xz?'numberJpanActive':''" >
{{arr[i-1]}}
</view>
</view> -->
<view class="myshuru" :style="obj" @tap.stop="flag=true">
<view class="gb" @tap="close()" :style="gsbstyle">×</view>
<view class="shuruTitle">
请输入支付密码
</view>
<view class="center-x">
<view class="srk" :style="'width:'+100/(length||6)+'%'" v-for=" i in length||6" :id="(i-1)==xz?'numberJpanActive':''" :key="i" >
<!-- #ifdef MP-WEIXIN -->
{{showNum?arr[i]==null?'':arr[i]:arr[i]!=null?"●" : ""}}
<!-- #endif -->
<!-- #ifndef MP-WEIXIN -->
{{showNum?arr[i-1]==null?'':arr[i-1]:arr[i-1]!=null?"●" : ""}}
<!-- #endif -->
</view>
</view>
</view>
<view class="jpan" :style="tsfY">
<view class="nav" @tap="close()">
<uni-icons type="arrowdown"></uni-icons>
</view>
<view class="main">
<!-- #ifdef MP-WEIXIN -->
<view v-for="i in 9" :key="i" @tap="numshuzi(i+1)">{{i+1}}</view>
<!-- #endif -->
<!-- #ifndef MP-WEIXIN -->
<view v-for="i in 9" :key="i" @tap="numshuzi(i)">{{i}}</view>
<!-- #endif -->
<view> </view>
<view @tap="numshuzi(0)">0</view>
<view @tap="del()">
<uni-icons type="arrowthinleft"></uni-icons>
</view>
</view>
</view>
</view>
</template>
<script>
export default {
name:'number-jpan',
data() {
return {
wc:{
'background-color':"rgba(0, 0, 0, .0)"
},
obj:{
"opacity":0,
"top":'50%'
},
flag:false,
clear1:"",
clear2:"",
arr:[],
xz:0,
gsbstyle:{
"opacity":0
},
tsfY:{
'transform':'translateY(100%)'
}
};
},
props:['length','showNum'],
methods:{
del(){
if(this.xz>0){
//let arr1=this.arr
//arr1[this.xz]=""
//this.arr=arr1
this.arr.pop();
this.xz--;
}
uni.vibrateShort();
},
numshuzi(num){
let arr1=this.arr
arr1[this.xz]=num
this.arr=arr1
uni.vibrateShort();
this.xz++
if(this.xz==this.length){
let str=""
for(let item of this.arr){
str+=item
}
this.$emit('closeChange',str)
this.close()
}
},
open(){
this.flag=true;
this.arr=[];
this.xz=0;
this.clear1=setTimeout(()=>{
this.wc='background-color:rgba(0, 0, 0, .5)';
this.obj='opacity:1;top:40%';
this.gsbstyle="opacity:1";
this.tsfY='transform:translateY(0%)';
},100)
},
close(){
this.wc={
'background-color':"rgba(0, 0, 0, .0)"
}
this.obj={
"opacity":0,
"top":'50%'
}
this.gsbstyle={
"opacity":0
}
this.clear2=setTimeout(()=>{
this.flag=false
},1000)
this.tsfY={
'transform':'translateY(100%)'
}
},
xuanze(i){
this.xz=i
uni.vibrateShort();
}
}
}
</script>
<style lang="scss">
#numberJpanActive{
background-color: $mian-color;
color: #FFFFFF;
}
.jpan{
width: 100vw;
height: 30vh;
background-color: #FFFFFF;
position: absolute;
bottom: 0;
transform: translateY(100%);
transition: all .5s;
.nav{
text-align: center;
line-height: 50upx;
box-sizing: border-box;
border-bottom: 1px solid #EEEEEE;
}
.main{
width: 100%;
height: calc(30vh - 50upx);
view{
box-sizing: border-box;
float: left;
width: 33.33%;
height: 25%;
font-size: 40upx;
text-align: center;
line-height:7.5vh;
border: 1px solid #f4f4f4;
}
view:active{
background-color: #EEEEEE;
}
}
}
.numberJpan{
width: 100vw;
height: 100vh;
position: fixed;
top: 0;
left: 0;
background-color: rgba(0, 0, 0, 0);
transition: all .5s;
z-index: 999;
.myshuru{
transition: all .5s;
position: absolute;
width: 70vw;
height: 350upx;
top: 50%;
opacity: 0;
transform: translate(-50%,-50%);
background-color: #FFFFFF;
left: 50%;
color: #000000;
border-radius: 20upx;
overflow: hidden;
.shuruTitle{
margin: 100upx auto;
font-weight: 900;
text-align: center;
font-size: 30upx;
}
.center-x{
width: 90%;
height: 80upx;
border: 1px solid #EEEEEE;
border-radius: 20upx;
position: absolute;
overflow: hidden;
left: 50%;
transform: translateX(-50%);
bottom: 50upx;
.srk{
height: 100%;
line-height: 80upx;
text-align: center;
float: left;
box-sizing: border-box;
border-left: 1px solid #EEEEEE;
transition: all .4s;
}
.srk:nth-child(1){
border-left:0px;
border-radius: 20upx 0 0 20upx;
}
}
}
}
.gb{
position: absolute;
font-size: 50upx;
top: 0;
color: #AAAAAA;
left: 30upx;
transition: all .5s;
}
</style>

View File

@@ -0,0 +1,93 @@
<template>
<view>
<block v-if="list.length > 0">
<view class="record--item" v-for="(item, index) in list" :key="index">
<view class="title ellipsis">{{item.hash || '-'}}</view>
<view class="time ellipsis">{{item.block_time || '-'}}</view>
<view class="webkit-box variation">
<view class="ellipsis" :class="item.is_in ? 'add': 'remove'">{{item.is_in ? '+': '-'}}{{item.amount}}</view>
<view class="symbol">{{item.assets.symbol}}</view>
</view>
</view>
</block>
<block v-else>
<no-list v-if='logsType === 0' name='no-record' txt="没有任何记录~" />
<no-list v-if='logsType === 2' name='no-in' txt="没有任何收入记录~" />
<no-list v-if='logsType === 1' name='no-out' txt="没有任何支出记录~" />
</block>
</view>
</template>
<script>
export default {
name:"property",
props:{
list: {
type: Array,
default: () => {
return []
}
},
logsType:{
type:Number
}
},
data() {
return {
};
}
}
</script>
<style lang="scss" scoped>
.record--item{
padding: $padding 320rpx $padding 0;
border-bottom: solid 1rpx $border-color;
position: relative;
min-height: 50rpx;
.variation{
position: absolute;
right: 0;
top: $margin;
bottom: $margin;
width: 300rpx;
text-align: right;
font-weight: bold;
&>label{
font-size: 80%;
}
.symbol{
color: $mian-color;
font-weight: normal;
font-size: $title-size-m;
}
.add{
color: $mian-color;
}
.remove{
color: $mian-color;
}
}
.title{
line-height: 50rpx;
}
.time{
font-size: $title-size-m;
color: $mian-color;
}
}
// 数据空
.record--null{
padding-top: $padding * 3;
text-align: center;
color: $mian-color;
font-size: $title-size;
height: 50vh;
box-sizing: border-box;
line-height: 60rpx;
image{
width: 168rpx;
}
}
</style>

View File

@@ -5,6 +5,7 @@ import Vue from 'vue'
import { router, RouterMount } from './router' import { router, RouterMount } from './router'
import store from './store' import store from './store'
import uView from 'uview-ui' import uView from 'uview-ui'
import noList from './components/no-list-components/index.vue'
Vue.use(router) Vue.use(router)
Vue.use(uView); Vue.use(uView);
Vue.config.productionTip = false Vue.config.productionTip = false
@@ -13,6 +14,7 @@ App.mpType = 'app'
const app = new Vue({ const app = new Vue({
...App ...App
}) })
Vue.component('no-list',noList)
// #ifdef H5 // #ifdef H5
RouterMount(app,router,'#app') RouterMount(app,router,'#app')
// #endif // #endif

View File

@@ -20,6 +20,27 @@
"style": { "style": {
"navigationBarTitleText": "节点中心" "navigationBarTitleText": "节点中心"
} }
}, {
"path": "pages/user/code",
"name": "userCode",
"auth": true,
"style": {
"navigationBarTitleText": "邀请好友"
}
}, {
"path": "pages/user/help",
"name": "userHelp",
"auth": true,
"style": {
"navigationBarTitleText": "帮助中心"
}
}, {
"path": "pages/user/clause",
"name": "userClause",
"auth": true,
"style": {
"navigationBarTitleText": "服务条款"
}
}, { }, {
"path": "pages/instrument/basics", "path": "pages/instrument/basics",
"name": "instrumentBasics", "name": "instrumentBasics",
@@ -108,7 +129,62 @@
"style": { "style": {
"navigationBarTitleText": "企业认证" "navigationBarTitleText": "企业认证"
} }
}], }, {
"path": "pages/news/index",
"name": "news",
"auth": true,
"style": {
"navigationBarTitleText": "消息中心"
}
}, {
"path": "pages/news/detail",
"name": "newsDetail",
"auth": true,
"style": {
"navigationBarTitleText": "消息列表"
}
}, {
"path": "pages/wallet/property",
"name": "walletProperty",
"style": {
"navigationBarTitleText": "能量钱包",
"enablePullDownRefresh": false,
"navigationBarTextStyle": "white",
"app-plus": {
"titleNView": {
"backgroundColor": "#b11eff",
"type": "transparent",
"buttons": [{
"float": "right",
"fontSize": "14",
"text": "管理",
"background": "rgba(255,255,255,0)"
}],
"backButton": {
"background": "rgba(255,255,255,0)"
}
}
}
}
}, {
"path": "pages/wallet/extract",
"style": {
"navigationBarTitleText": "提现能量",
"enablePullDownRefresh": false,
"navigationBarBackgroundColor": "#774ffd",
"navigationBarTextStyle": "white"
},
"name": "Extract"
}, {
"path": "pages/wallet/resetPassword",
"style": {
"navigationBarTitleText": "重置密码",
"enablePullDownRefresh": false,
"navigationBarBackgroundColor": "#774ffd",
"navigationBarTextStyle": "white"
},
"name": "ResetPassword"
} ],
"globalStyle": { "globalStyle": {
"navigationStyle": "custom", "navigationStyle": "custom",
"backgroundColor": "#F5F5F5" "backgroundColor": "#F5F5F5"

View File

@@ -42,7 +42,7 @@
data() { data() {
return { return {
crystalArr : [], crystalArr : [],
categoryArr : [] categoryArr : [],
}; };
} }
} }

249
pages/news/detail.vue Normal file
View File

@@ -0,0 +1,249 @@
<template>
<view class="News-detail" v-if="loaded">
<view class="item" v-for="(item,index) in items" v-if="items.length>0"
@click="item.read_at === ''?read(index,item):noread(item)">
<view class="top">
<image src="/static/images/news_2_1.png" mode="widthFix"></image>
<!-- <image v-if="index===1" src="/static/img/news_1_1.png" mode="widthFix"></image>
<image v-if="index===2" src="/static/img/news_3_1.png" mode="widthFix"></image> -->
<view :style="item.read_at=== '' ?'flex:1;':'flex:1;color:#808080;'">{{item.title}}</view>
</view>
<view class="des">{{item.content}}</view>
<view class="time">{{item.created_at}}</view>
<view class="read_at" v-if="item.read_at === ''"></view>
</view>
<no-list v-if="items.length === 0" name='no-new1' txt="空空如也~" />
</view>
</template>
<script>
import {
notificationsList,
notificationsDetail,
notificationsReaded
} from '@/apis/interfaces/news.js'
export default {
data() {
return {
items: [],
page: 1,
has_more: true,
loaded: false
};
},
onLoad(e) {
this.type = e.type
this.notificationsList()
},
onReachBottom() {
this.notificationsList()
},
// 右侧全部已读
onNavigationBarButtonTap(e) {
// #ifdef APP-PLUS
var currentWebview = this.$mp.page.$getAppWebview()
var tn = currentWebview.getStyle().titleNView
var text = tn.buttons[0].text
if (text == '全部已读') {
notificationsReaded(this.type).then(res => {
this.items.find((item, index) => {
this.$set(item, 'read_at', 'zdx')
})
uni.showToast({
title: '全部已读',
icon: 'none'
})
uni.setStorageSync('refresh',true)
}).catch(err => {
uni.showToast({
title: err.message,
icon: 'nonde'
})
})
}
// #endif
},
methods: {
// 点击每个消息,假装查看详情,触发已读效果$set
read(index, item) {
let notification_id = item.notification_id
notificationsDetail(notification_id).then(res => {
this.$set(this.items[index], 'read_at', '已读已读')
uni.setStorageSync('refresh',true)
}).catch(err => {
uni.showToast({
title: err.message,
icon: 'nonde'
})
})
if (item.url) {
switch (item.url.openType) {
case 'web':
// #ifdef APP-PLUS
plus.runtime.openURL(item.url.url)
return
// #endif
window.location.href = item.url.url
break;
case 'navigateTo':
uni.navigateTo({
url: item.url.path
})
break;
case 'switchTab':
uni.switchTab({
url: item.url.path
})
break;
default:
uni.showToast({
title: '活动过期,请联系系统管理员',
icon: 'none'
})
break;
}
}
},
// 消息列表
notificationsList() {
if (this.has_more) {
notificationsList(this.type, {
page: this.page
}).then(res => {
this.items = this.items.concat(res.data)
if (res.page.has_more) {
this.page = this.page + 1
}
this.has_more = res.page.has_more
this.loaded = true
}).catch(err => {
uni.showToast({
title: err.message,
icon: 'nonde'
})
})
} else {
uni.showToast({
title: '没有更多啦~',
icon: 'none'
})
}
},
noread(item) {
if(item.url){
switch (item.url.openType) {
case 'web':
// #ifdef APP-PLUS
plus.runtime.openURL(item.url.url)
return
// #endif
window.location.href = item.url.url
break;
case 'navigateTo':
uni.navigateTo({
url: item.url.path
})
break;
case 'switchTab':
uni.switchTab({
url: item.url.path
})
break;
default:
uni.showToast({
title: '活动过期,请联系系统管理员',
icon: 'none'
})
break;
}
}else{
uni.showToast({
title: '哎呦,已经读过了~',
icon: 'none'
})
}
}
}
}
</script>
<style lang="scss">
.News-detail {
min-height: 100vh;
width: 100%;
padding: 0 $padding*1.5 $padding*1.5 $padding*1.5;
box-sizing: border-box;
.item {
background-color: #fff;
padding: $padding*1.5;
box-shadow: 0 0 40rpx 2rpx rgba(0, 0, 0, 0.1);
border-radius: $radius-m;
margin-top: $padding*1.5;
position: relative;
.top {
display: flex;
flex-direction: row;
justify-content: flex-start;
align-items: center;
box-sizing: border-box;
color: #353535;
font-weight: bold;
border-bottom: solid 1rpx #f8f8f8;
padding-bottom: $padding*1.3;
image {
width: 42rpx;
margin-right: $padding;
}
span {
font-size: $title-size;
}
}
.des {
font-size: $title-size-m;
padding-top: $padding;
color: #808080;
}
.time {
color: #999;
font-size: $title-size*0.9;
padding-top: $padding*0.9;
}
}
}
// 无消息
.no-news {
font-size: $title-size-m;
color: #666;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
box-sizing: border-box;
image {
width: 70%;
margin: $padding*7 0 $margin*3 0;
opacity: 0.6;
}
}
.read_at {
background-color: red;
width: 14rpx;
height: 14rpx;
position: absolute;
top: 20rpx;
right: 20rpx;
border-radius: 50%;
}
</style>

179
pages/news/index.vue Normal file
View File

@@ -0,0 +1,179 @@
<template>
<view class="News">
<view class="list" v-for="(item,index) in items" :key="index" v-if="items.length>0">
<navigator class="item" open-type="navigate" hover-class="none" :url="'/pages/news/detail?type='+item.type">
<view class="left">
<image class="img" v-if='item.type ==="SystemNotification"' :src="item.icon?item.icon:'/static/imgs/news_1.png'" mode="aspectFill"></image>
<image class="img" v-if='item.type ==="OrderNotification"' :src="item.icon?item.icon:'/static/imgs/news_2.png'" mode="aspectFill"></image>
<image class="img" v-if='item.type ==="CouponNotification"' :src="item.icon?item.icon:'/static/imgs/news_3.png'" mode="aspectFill"></image>
<view class="content">
<view class="title">{{item.name}}</view>
<view class="des">{{item.title || '暂无任何未读消息'}}</view>
</view>
</view>
<view class="num" v-if="item.count>0">{{item.count}}</view>
</navigator>
</view>
<view class="no-news" v-else>
<image src="/static/img/no-news.png" mode="widthFix"></image>
暂时没有收到任何消息~
</view>
</view>
</template>
<script>
import {
notificationsType,
notificationsDelete
} from '@/apis/interfaces/news.js'
export default {
data() {
return {
items: [],
editShow: false
};
},
onShow() {
this.notificationsType()
},
// 右侧编辑按钮触发事件
onNavigationBarButtonTap(e) {
let that = this
let index = e.index
// 按钮文字的改变所需
// #ifdef APP-PLUS
let currentWebview = that.$mp.page.$getAppWebview()
let tn = currentWebview.getStyle().titleNView
let text = tn.buttons[0].text
if (text == '全部清空') {
uni.showModal({
title: '是否确认清空全部消息',
content: '确认清空',
success(res) {
if (res.confirm) {
notificationsDelete().then(res => {
that.notificationsType()
uni.showToast({
title: '全部清除啦~',
icon: 'none'
})
}).catch(err => {
uni.showToast({
title: err.message,
icon: 'none'
})
})
}
}
})
}
// #endif
},
methods: {
notificationsType() {
notificationsType().then(res => {
this.items = res
}).catch(err => {
uni.showToast({
title: err.message,
icon: 'nonde'
})
})
}
}
}
</script>
<style lang="scss">
.News {
height: 100vh;
// #ifdef APP-PLUS
min-height: calc(100vh - 20rpx);
// #endif
width: 100%;
// background-color: pink;
// 无消息
.no-news {
font-size: $title-size-m;
color: #666;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
box-sizing: border-box;
image {
width: 70%;
margin-top: $padding*7;
}
}
// 消息列表
.list {
width: 94%;
margin-left: 3%;
.item {
margin-top: 20rpx;
width: 100%;
display: flex;
flex-direction: row;
justify-content: flex-start;
align-items: center;
box-sizing: border-box;
padding: $padding*1.5;
background-color: #fff;
border-radius: $radius*0.6;
box-sizing: 0 0 20rpx 40rpx rgba(0, 0, 0, 0.3);
.left {
display: flex;
flex-direction: row;
justify-content: flex-start;
align-items: center;
box-sizing: border-box;
flex: 1;
.content {
flex: 1;
padding: 0 $padding*0.5;
box-sizing: border-box;
}
.img {
width: 80rpx;
height: 80rpx;
margin-right: $padding*1.2;
border-radius: 50%;
}
.title {
font-size: $title-size-m*1.1;
margin-bottom: $padding*0.5;
font-weight: bold;
}
.des {
font-size: $title-size-m*0.9;
color: #999;
}
}
.num {
background-color: $mian-color;
color: #fff;
border-radius: 50%;
width: 40rpx;
height: 40rpx;
display: flex;
align-items: center;
justify-content: center;
font-size: $title-size*.8;
padding: $padding*0.3;
text-align: center;
}
}
}
}
</style>

View File

@@ -33,20 +33,28 @@
<u-icon name="arrow-right" color="#f1f1f1" size="28" /> <u-icon name="arrow-right" color="#f1f1f1" size="28" />
</button> </button>
<!-- 个人认证 --> <!-- 个人认证 -->
<view @click="certification(is_certification)" class="list-item"> <view @click="certificationClick(certification)" class="list-item">
<view class="list-item-left"> <view class="list-item-left">
<image src="/static/imgs/self-icon.png" mode="widthFix" /> <image src="/static/imgs/self-icon.png" mode="widthFix" />
<span>个人认证</span> <span>个人认证</span>
</view> </view>
<u-icon name="arrow-right" color="#f1f1f1" size="28" /> <view class="input">
<input type="text" :value="certification.is_true?'已认证':''"
:placeholder="certification.is_true?'':'未认证'" disabled="true" maxlength="12" />
<u-icon name="arrow-right" color="#f1f1f1" size="28" />
</view>
</view> </view>
<!-- 企业认证 --> <!-- 企业认证 -->
<view @click="company(is_company)" class="list-item"> <view @click="company(companyCode.code)" class="list-item">
<view class="list-item-left"> <view class="list-item-left">
<image src="/static/imgs/company-icon.png" mode="widthFix" /> <image src="/static/imgs/company-icon.png" mode="widthFix" />
<span>企业认证</span> <span>企业认证</span>
</view> </view>
<u-icon name="arrow-right" color="#f1f1f1" size="28" /> <view class="input">
<input type="text" :value="companyCode.code=== 1?'已认证':''"
:placeholder="companyCode.code !== 1?companyCode.message:''" disabled="true" maxlength="12" />
<u-icon name="arrow-right" color="#f1f1f1" size="28" />
</view>
</view> </view>
<!-- 关于我们 --> <!-- 关于我们 -->
<view @click="$router.push({name:'aboutUs'})" class="list-item"> <view @click="$router.push({name:'aboutUs'})" class="list-item">
@@ -80,7 +88,8 @@
import { import {
wechatbind, wechatbind,
resetUserInfo, resetUserInfo,
getUserSettingInfo getUserSettingInfo,
companyStatus
} from '@/apis/interfaces/setting' } from '@/apis/interfaces/setting'
import { import {
uploads uploads
@@ -96,8 +105,8 @@
showPath: '' showPath: ''
}, },
is_bind: true, // 微信绑定 is_bind: true, // 微信绑定
is_certification: true, // 个人认证 certification: {}, // 个人认证
is_company: true, // 企业认证 companyCode: {}, // 企业认证 -1.未认证0.审核中1.审核通过2.驳回
} }
}, },
onShow() { onShow() {
@@ -107,38 +116,59 @@
} }
}) })
this.getUserInfo() this.getUserInfo()
}, },
onPullDownRefresh() { onPullDownRefresh() {
this.getUserInfo() this.getUserInfo()
}, },
methods: { methods: {
// 是否个人认证 // 是否个人认证
certification(is_certfication) { certificationClick(certfication) {
console.log(is_certfication) console.log(certfication)
if (is_certfication) { if (certfication.is_true) {
// 跳转到个人认证信息完成展示页面 // 跳转到个人认证信息完成展示页面
this.$router.push({ // this.$refs.uToast.show({
name: '' // title: '认证通过!',
// type: 'primary',
// duration: 3000
// })
uni.showModal({
title: '认证信息',
content: '真实姓名:<' + certfication.message.name + '>,身份证号:' + certfication.message.idcard,
showCancel:false
}) })
} else { } else {
// 跳转到个人认证信息页面 // 跳转到个人认证信息页面
this.$router.push({ uni.navigateTo({
name: '' url: '/pages/certification/personal'
}) })
} }
}, },
// 是否展示企业信息 // 是否展示企业信息 企业认证 -1.未认证0.审核中1.审核通过2.驳回
company(is_company) { company(code) {
console.log(is_company) console.log(code, '是否企业认证')
if (is_company) { if (code === -1) {
// 跳转到企业认证完成信息展示页面
this.$router.push({
name: ''
})
} else {
// 跳转到企业认证页面 // 跳转到企业认证页面
this.$router.push({ uni.navigateTo({
name: '' url: '/pages/company/approve'
})
} else if (code === 2) {
// 跳转到企业认证页面
uni.navigateTo({
url: '/pages/company/approve?form_type=put'
})
} else if (code === 0) {
this.$refs.uToast.show({
title: '审核中',
type: 'primary',
duration: 3000
})
} else if (code === 1) {
// 跳转到企业认证页面
this.$refs.uToast.show({
title: '认证通过!',
type: 'primary',
duration: 3000
}) })
} }
}, },
@@ -148,8 +178,7 @@
this.avatar.showPath = res.avatar this.avatar.showPath = res.avatar
this.nickname = res.nickname this.nickname = res.nickname
this.is_bind = res.is_bind this.is_bind = res.is_bind
this.is_certification = res.is_certification this.certification = res.certification
this.is_company = res.is_company
uni.stopPullDownRefresh() uni.stopPullDownRefresh()
}).catch(err => { }).catch(err => {
this.$refs.uToast.show({ this.$refs.uToast.show({
@@ -158,6 +187,17 @@
duration: 3000 duration: 3000
}) })
}) })
// -1.未认证0.审核中1.审核通过2.驳回
companyStatus().then(res => {
console.log(res)
this.companyCode = res
}).catch(err => {
this.$refs.uToast.show({
title: err.message,
type: 'primary',
duration: 3000
})
})
}, },
// 点击绑定用户得授权信息,且绑定带修改 // 点击绑定用户得授权信息,且绑定带修改
getUser() { getUser() {
@@ -385,8 +425,9 @@
flex: 1; flex: 1;
input { input {
padding-right: 30rpx; padding-right: 20rpx;
width: 100%; width: 100%;
font-size: 30rpx;
} }
} }

46
pages/user/clause.vue Normal file
View File

@@ -0,0 +1,46 @@
<template>
<view>
<view class="clauseCont">
<rich-text :nodes="clauseData"></rich-text>
</view>
</view>
</template>
<script>
import { userClause } from '@/apis/interfaces/user'
export default {
data() {
return {
clauseData: [] //服务条款
};
},
onLoad() {
// 获取服务条款
this.clauseInfo()
},
methods: {
// 服务条款
clauseInfo(){
userClause().then(res => {
this.clauseData = res.content.replace(/\<img/gi, '<img style="max-width:100%; height:auto; vertical-align: top;"')
}).catch(err => {
uni.showToast({
icon: 'none',
title: err.message
})
})
},
}
}
</script>
<style lang="scss">
page {
background-color: $uni-bg-color;
}
.clauseCont {
padding: $padding + 10 $padding * 2;
width: 100%;
box-sizing: border-box;
}
</style>

281
pages/user/code.vue Normal file
View File

@@ -0,0 +1,281 @@
<template>
<view>
<view class="codeContent">
<!-- 邀请码图 -->
<view class="codeBack">
<image class="codeBack-img" src="/static/user/user-codeIcon.png" mode="widthFix"></image>
<view class="codeBack-avatar">
<image src="/static/user/call.png" mode="aspectFill"></image>
<view class="">
张慢慢
</view>
</view>
<view class="codeBack-top">
<view class="codeBack-title">
您的邀请码
</view>
<view class="codeBack-number">
8012568
</view>
<view class="codeBack-copy" @click="copyCenter(inviteData.invite)">
复制
</view>
</view>
<view class="codeBack-yard">
<image class="codeBack-yard-img" src="/static/user/wallet-code.png" mode="widthFix"></image>
<view class="codeBack-yard-name">
扫码识别链商星球
</view>
<view class="codeBack-yard-tips">
加入链商星球享受能量球权益
</view>
</view>
</view>
</view>
</view>
</template>
<script>
import { userInvite } from '@/apis/interfaces/user'
export default {
data() {
return {
inviteData: {} //二维码信息
};
},
onLoad() {
// 获取二维码
this.inviteInfo()
},
methods:{
// 二维码
inviteInfo(){
userInvite().then(res => {
this.inviteData = res
}).catch(err => {
uni.showToast({
icon: 'none',
title: err.message
})
})
},
// 复制邀请码
copyCenter(e) {
console.log('ddd')
let copyNo = e
uni.vibrateShort({
success: () => {
uni.setClipboardData({
data : copyNo,
success : res=> {
uni.showToast({
title : '复制成功',
icon :'none',
duration: 3000
});
}
})
}
})
},
// 分享微信好友
friend(scene) {
uni.share({
provider: 'weixin',
title: '我正在使用ocChain',
scene: scene,
href: 'https://live.funnyzhibo.com/blockdownload',
imageUrl: 'https://live.funnyzhibo.com/oc-chain.png',
summary: '邀请您一起加入,邀请码' + this.inviteData.invite,
complete: res=> {
console.log(res)
}
})
}
}
}
</script>
<style>
page {
background-image: linear-gradient(to top, #7c52fc, #976dff);
}
</style>
<style lang="scss">
// 背景
.codeImg {
width: 100%;
height: 100%;
}
// 内容
.codeContent {
position: absolute;
left: 0;
top: 0;
width: 100%;
padding: 120rpx 80rpx 40rpx;
box-sizing: border-box;
text-align: center;
.titleImg {
max-width: 100%;
}
.codeBack {
background-color: $uni-bg-color;
border-radius: $uni-border-radius-lg;
position: relative;
margin: $margin * 2 0 $margin * 2.5;
overflow: hidden;
&::after, &::before {
position: absolute;
background-color: #8c62fe;
content: '';
top: 266px;
width: 40rpx;
height: 40rpx;
border-radius: $uni-border-radius-circle;
}
&::after {
left: -20rpx;
}
&::before {
right: -20rpx;
}
.codeBack-img {
position: absolute;
width: 100%;
height: 100%;
left: 0;
top: 0;
}
.codeBack-top {
width: 100%;
padding: $padding;
height: 150px;
box-sizing: border-box;
position: relative;
.codeBack-title {
color: #7c52fc
}
.codeBack-number {
font-size: 60rpx;
color: #7c52fc;
text-transform:uppercase;
font-weight: 700;
margin: $margin - 10 0 $margin;
}
.codeBack-copy {
font-size: $title-size-lg;
display: inline-block;
background: linear-gradient(to right, #f9c869, #eca824);
color: #fff;
padding: 15rpx $padding * 2;
border-radius: $uni-border-radius-lg;
margin-bottom: $margin * 2;
}
.codeBack-tips {
.codeBack-tips-text {
color: #7c52fc;
font-weight: 700;
}
.codeBack-tips-label {
margin-top: $margin;
border-radius: $uni-border-radius-lg;
display: inline-block;
background-color: #fbeec9;
font-size: $title-size-sm;
padding: 0 $padding + 12;
height: 56rpx;
line-height: 56rpx;
color: #9f7d42;
}
}
}
.codeBack-avatar {
margin-top: $margin * 2;
image {
width: 140rpx;
height: 140rpx;
border-radius: 50%;
margin-bottom: $margin;
}
}
.codeBack-yard {
padding: $padding $padding * 4 $padding * 2;
text-align: center;
position: relative;
font-size: $title-size-lg;
&::after {
position: absolute;
content: '';
left: 50rpx;
top: 0;
width: calc(100% - 100rpx);
border-top: #cccbd0 2rpx dashed;
}
.codeBack-yard-img {
max-width: 80%;
}
.codeBack-yard-name {
color: #a0a1a3;
margin-bottom: $margin - 10;
}
.codeBack-yard-tips {
color: #7c52fc
}
}
}
.codeRule {
background-color: $uni-bg-color;
border-radius: $radius;
padding: $padding + 10;
.codeRule-title {
font-size: $uni-font-size-lg + 4;
color: #7c52fc;
font-weight: 700;
margin-bottom: $margin + 10;
}
.codeRule-list {
text-align: left;
font-size: $title-size-m;
line-height: 38rpx;
text {
display: block;
margin-bottom: $margin - 5;
color: #7c52fc;
}
}
}
}
// 分享途径
.codeShare {
position: fixed;
left: 0;
bottom: 0;
z-index: 9;
background-color: $uni-bg-color;
box-sizing: border-box;
height: 200rpx;
width: 100%;
display: flex;
justify-items: center;
align-items:center;
.codeShare-label {
width: 50%;
text-align: center;
font-size: $uni-font-size-sm;
color: $text-gray;
image {
width: $uni-img-size-lg - 10;
height: $uni-img-size-lg - 10;
display: flex;
margin: 0 auto $margin - 10;
}
}
}
</style>

118
pages/user/help.vue Normal file
View File

@@ -0,0 +1,118 @@
<template>
<view>
<view class="helpCont">
<view class="helpCont-list" :class="{active : item.spread}" v-for="(item, index) in helpList" :key="index" @click="showClick(item, index)">
<view class="helpCont-name">
<view class="helpCont-tips">{{ index + 1 }}</view>
{{ item.title }}
<image class="helpCont-img" src="/static/user/user-more.png" :class="{active : item.spread}" mode="aspectFill"></image>
</view>
<view class="helpCont-text">
{{ item.description }}
</view>
</view>
</view>
</view>
</template>
<script>
import { userHelp } from '@/apis/interfaces/user'
export default {
data() {
return {
helpList: [], //帮助中心列表
showList: false // 显示子内容
};
},
onLoad() {
// 获取帮助中心
this.helpInfo()
},
methods: {
// 帮助中心
helpInfo(){
userHelp().then(res => {
console.log(res)
res.forEach((value, index) => {
res[index].spread = false
res[0].spread = true
});
this.helpList = res
}).catch(err => {
uni.showToast({
icon: 'none',
title: err.message
})
})
},
// 展开帮助中心-内容
showClick(item, index) {
this.helpList.forEach(i => {
if (i.spread !== this.helpList[index].spread) {
i.spread = false;
}
})
item.spread = !item.spread
}
}
}
</script>
<style lang="scss">
.helpCont {
margin: $margin;
background-color: $uni-bg-color;
padding: $padding + 10 $padding + 10 5rpx $padding + 10;
box-sizing: border-box;
border-radius: $radius;
.helpCont-list {
margin-bottom: $margin;
border-bottom: 1rpx solid #f3f3f3;
font-size: $uni-font-size-base;
height: 60rpx;
overflow: hidden;
&.active {
height: auto;
}
&:last-child {
border-bottom: none;
margin-bottom: 0;
}
.helpCont-name {
font-weight: 700;
display: flex;
line-height: 40rpx;
margin-bottom: $margin;
position: relative;
.helpCont-tips {
width: 40rpx;
height: 40rpx;
line-height: 40rpx;
margin-right: 10rpx;
text-align: center;
background-image: linear-gradient(to left, #7c52fc, #976dff);
color: $uni-text-color-inverse;
transform: scale(0.83);
border-radius: $uni-border-radius-base;
}
.helpCont-img {
position: absolute;
right: 0;
top: 8rpx;
width: 26rpx;
height: 26rpx;
&.active {
transform:rotate(90deg);
}
}
}
.helpCont-text {
font-size: $title-size-sm;
line-height: 40rpx;
color: $text-gray;
padding-bottom: $padding;
}
}
}
</style>

File diff suppressed because it is too large Load Diff

65
pages/wallet/add.vue Normal file
View File

@@ -0,0 +1,65 @@
<template>
<view class="content webkit-box">
<!-- logo -->
<image class="logo" src="@/static/img/oc-logo.png" mode="widthFix"></image>
<!-- 副标题 -->
<view class="sub-title">激活您的OC Chain区块链钱包地址</br>地址可以理解为您的个人银行卡卡号与他人转账时是区块链上两个地址的交易行为</view>
<!-- 按钮 -->
<navigator class="wallet-btn" url="./mnemonic" open-type="redirect">激活钱包</navigator>
<!-- <navigator class="wallet-btn hollow" url="./guide">导入钱包</navigator> -->
</view>
</template>
<script>
export default {
data() {
return {
}
},
methods: {
}
}
</script>
<style>
page {
background-color: white;
}
</style>
<style lang="scss" scoped>
.content{
position: relative;
height: 100vh;
padding: 0 15vw;
text-align: center;
.logo{
width: 138rpx;
vertical-align: top;
margin-bottom: 30vh;
}
.sub-title{
font-size: $title-size-m;
color: $text-gray;
}
.wallet-btn{
width: 100%;
background-color: $mian-color;
height: 90rpx;
line-height: 90rpx;
margin-top: $margin * 2;
border-radius: $radius-lg;
color: white;
font-weight: bold;
font-size: $title-size;
&.hollow{
background-color: white;
color: $mian-color;
border:solid 2rpx $mian-color;
box-sizing: border-box;
}
}
}
</style>

View File

@@ -0,0 +1,50 @@
<template>
<view>
<view class="clauseCont">
<rich-text :nodes="clauseData"></rich-text>
</view>
</view>
</template>
<script>
import {
cmsWithdraw
} from '@/apis/interfaces/wallet.js'
export default {
data() {
return {
clauseData: [] //服务条款
};
},
onLoad() {
// 获取服务条款
this.clauseInfo()
},
methods: {
// 服务条款
clauseInfo() {
cmsWithdraw().then(res => {
this.clauseData = res.content.replace(/\<img/gi,
'<img style="max-width:100%; height:auto; vertical-align: top;"')
}).catch(err => {
uni.showToast({
icon: 'none',
title: err.message
})
})
},
}
}
</script>
<style lang="scss">
page {
background-color: $uni-bg-color;
}
.clauseCont {
padding: $padding + 10 $padding * 2;
width: 100%;
box-sizing: border-box;
}
</style>

136
pages/wallet/code.vue Normal file
View File

@@ -0,0 +1,136 @@
<template>
<view class="webkit-box code">
<view class="webkit-box code-content">
<view class="sub-title">扫码转入OC COIN</view>
<view class="code-img">
<image :src="code" mode="widthFix" />
</view>
<view class="hr"></view>
<view class="sub-title">钱包地址</view>
<view class="hash">{{address || '-'}}</view>
<view class="buttons">
<button class="item red" type="default" @click="showShare()">分享</button>
<button class="item greed" type="default" @click="copyAddress">复制</button>
</view>
</view>
<view class="footer">OC CHNIA</view>
</view>
</template>
<script>
import { code } from '@/apis/interfaces/wallet'
export default {
data() {
return {
address: '',
code: ''
};
},
mounted() {
code().then(res=>{
this.code = res.image
this.address = res.address
}).catch(err=>{
uni.showToast({
icon: 'none',
title: err.message
})
})
},
methods:{
copyAddress(){
uni.setClipboardData({
data: this.address
})
},
showShare(){
uni.share({
provider: 'weixin',
title: '我正在使用ocChain钱包收款',
scene: 'WXSceneSession',
href: 'https://live.funnyzhibo.com/blockdownload',
imageUrl: 'https://live.funnyzhibo.com/oc-chain.png',
summary: '我的收款地址' + this.address
})
}
}
}
</script>
<style lang="scss" scoped>
.code{
height: 100vh;
background:linear-gradient(to bottom, $mian-color, $mian-color-deep);
padding-bottom: env(safe-area-inset-bottom);
padding-bottom: constant(safe-area-inset-bottom);
box-sizing: border-box;
// 收款码
.code-content{
text-align: center;
background: white;
margin: 0 8vw;
border-radius: $radius;
padding: $padding * 2;
height: 70vh;
box-shadow: 0 0 6rpx 6rpx rgba($color: #000000, $alpha: .02);
box-sizing: border-box;
.sub-title{
font-size: $title-size + 8;
}
.code-img{
width: 20vh;
height: 20vh;
margin: $margin * 3 0 $margin * 2;
display: inline-block;
background-image: url(../../static/background/wallet-code-background.png);
padding: $padding;
box-sizing: border-box;
background-position: center;
background-size: cover;
image{
width: 100%;
}
}
.hr{
height: 1rpx;
background: $border-color;
margin: $margin * 2 0;
}
.hash{
word-wrap: break-word;
font-size: $title-size;
padding: $padding 0;
}
.buttons{
display: flex;
padding-top: $padding * 2;
.item{
width: 40%;
height: 80rpx;
line-height: 80rpx;
border-radius: 40rpx;
font-size: $title-size;
color: white;
&::after{
border: none;
}
&.red{
background: $red-color;
}
&.greed{
background: $mian-color;
}
}
}
}
// 底部
.footer{
height: 10vh;
line-height: 10vh;
text-align: center;
font-size: $title-size + 10;
font-weight: bold;
color: #58876e;
}
}
</style>

138
pages/wallet/create.vue Normal file
View File

@@ -0,0 +1,138 @@
<template>
<view>
<!-- 设置钱包密码 -->
<view class="password">
<view class="prompt">请设置6位数字密码建议不要使用连续的数字</view>
<view class="group">
<view class="inputs">
<label>密码</label>
<input type="digit" v-model="password" maxlength="6" placeholder="请设置密码" />
</view>
<view class="inputs">
<label>确认密码</label>
<input type="digit" v-model="verify" maxlength="6" placeholder="请确认密码" />
</view>
</view>
</view>
<!-- 按钮 -->
<view class="buttons">
<button type="default" form-type="submit" @click="createWallet">确认</button>
</view>
</view>
</template>
<script>
import {
security
} from '@/apis/interfaces/wallet'
export default {
data() {
return {
password: '',
verify: ''
}
},
methods: {
// 激活钱包
createWallet() {
if (this.password === '' || this.verify === '') {
uni.showToast({
icon: 'none',
title: '请设置密码'
})
return
}
if (this.password !== this.verify) {
uni.showToast({
icon: 'none',
title: '两次输入密码不一致'
})
return
}
security({
code: this.password
}).then(res => {
uni.navigateBack()
}).catch(err => {
uni.showToast({
icon: 'none',
title: err.message
})
})
}
}
}
</script>
<style lang="scss" scoped>
// 副标题
.sub-title {
color: $text-gray;
text-align: center;
margin: $margin * 2 $margin;
font-size: $title-size-m;
}
// 设置密码
.password {
padding: 0 $padding * 2;
.prompt {
margin-top: $margin * 2;
font-size: $title-size-m;
color: $mian-color;
}
.group {
margin-top: $margin;
border-radius: $radius-m;
box-shadow: 0 0 4rpx 4rpx rgba($color: $text-color, $alpha: .02);
background-color: white;
.inputs {
padding: $padding $padding + 10;
border-bottom: solid 1rpx $border-color;
&:last-child {
border-bottom: none;
}
label {
color: $text-gray;
font-size: $title-size-m;
}
input {
height: 70rpx;
line-height: 70rpx;
font-size: $title-size;
}
}
}
}
// 按钮
.buttons {
padding: $padding * 2;
.text {
text-align: center;
line-height: 90rpx;
height: 90rpx;
margin-bottom: $margin * 2;
font-size: $title-size-lg;
color: $mian-color;
font-weight: bold;
}
button {
height: 90rpx;
line-height: 90rpx;
background-color: $mian-color;
border-radius: $radius-lg;
color: white;
font-weight: bold;
font-size: $title-size;
}
}
</style>

389
pages/wallet/extract.vue Normal file
View File

@@ -0,0 +1,389 @@
<template>
<view class="WithdrawingCoin ">
<view class="withdrawing-content">
<view class="item-name">账户能量球将提现到银行卡</view>
<view class="item">
<view style="flex: 1;">
<input class="input_num" v-model="withdraw_input" @input='inputNum' type="number"
placeholder-style="color:#999;font-weight:normal; font-size:30rpx;" placeholder="请输入能量球数量" />
<view v-if="total"> {{total}}</view>
</view>
<view class="all" @click="all">全部提现</view>
</view>
<view class="item">
<input class="input_num" v-model="card" type="number"
placeholder-style="color:#999;font-weight:normal; font-size:30rpx;" placeholder="请输入您要收款得银行卡卡号" />
</view>
<view class="item">
<input class="input_num" v-model="name" maxlength="10"
placeholder-style="color:#999;font-weight:normal; font-size:30rpx;" placeholder="请输入收款人姓名" />
</view>
<number-jpan :length="6" @closeChange="closeChange($event)" ref="numberPad"></number-jpan>
<view class="item-total">
<view class="total"><span>能量球总数 : {{balance}}</span><span class="money">总估值(CNY){{(balance*price).toFixed(2)}}</span></view>
</view>
</view>
<view class="btn" @click="open">提现至银行卡</view>
<view class="ew_lists" v-if="withdrawLists.length>0">
<view class="" v-for="(item,index) in withdrawLists " :key="index">
<view class="receiptCode">
回执单号{{item.receipt_code}}
</view>
<view class="item">
<view class="left">
<span>能量球:{{item.total}}</span>
<span>金额{{item.arrival}}</span>
</view>
<view class="right">
<span> {{item.created_at}} 提现</span>
<span> {{item.paid_at?item.paid_at+'到账':'努力打款中'}}</span>
</view>
</view>
</view>
<view class="hasmore">
{{has_more?'努力加载中~':'我是有底线的~'}}
</view>
</view>
<no-list v-else name='no-records' txt="暂无任何提现记录哦~" />
</view>
</template>
<script>
import {
withdraw,
withdrawLogs,
withdrawDo
} from '@/apis/interfaces/wallet.js';
import numberJpan from "@/components/numberJpan/numberJpan.vue";
export default {
data() {
return {
balance: 0, // 钱包能量球数量
price: 0, // 当前能量球价格
card: '', // 银行卡号
name: '', // 姓名
password: '', //
withdraw_input: '', // 提现能量球数量
total: '', // 提现能量球转化成的钱数
page: 1,
has_more: true,
withdrawLists: [],
};
},
components: {
'number-jpan': numberJpan
},
onLoad() {
this.reset()
},
onReachBottom() {
if (this.withdrawLists.length > 0) {
if (this.has_more) {
this.withdrawLogs()
} else {
uni.showToast({
title: '没有更多~',
icon: 'none'
})
}
}
},
methods: {
// 提现基本信息
withdraw() {
withdraw().then(res => {
this.balance = Number(res.balance)
this.price = Number(res.price)
}).catch(err => {
uni.showToast({
title: err.message,
icon: 'none'
})
})
},
// 提现记录
withdrawLogs() {
withdrawLogs({
page: this.page
}).then(res => {
this.withdrawLists = this.withdrawLists.concat(res.data)
if (res.page.has_more) {
this.page = this.page + 1
this.has_more = true
} else {
this.has_more = false
}
}).catch(err => {
uni.showToast({
title: err.message,
icon: 'none'
})
})
},
// 输入提现能量球数量
inputNum(e) {
let number = Number(e.detail.value)
if (number <= this.balance) {
this.total = Number(e.detail.value) * this.price
} else {
uni.showToast({
title: '最大值能超过' + this.balance+'',
icon: 'none',
duration: 2000
});
this.withdraw_input = ''
this.total = 0
}
},
// 点击全部
all() {
if (this.balance > 0) {
this.withdraw_input = this.balance
this.total = this.balance * this.price
} else {
uni.showToast({
title: '啥也没有,我也做不到~',
icon: 'none',
duration: 2000
})
}
},
// 打开密码 出发提现功能
open() {
if (this.total > 0) {
let params = {
name: this.name,
card: this.card,
total: this.withdraw_input
}
if (params.name === '' || params.card === '' || params.total === 0) {
uni.showToast({
title: '重新确认提现信息',
icon: 'none',
duration: 2000
})
} else {
this.$refs.numberPad.open()
}
} else {
uni.showToast({
title: '啥也没有,我也做不到~',
icon: 'none',
duration: 2000
})
}
},
// 输入密码成功后,,,
closeChange(e) {
uni.showLoading({
title: '提现中~'
})
let params = {
name: this.name,
card: this.card,
total: this.withdraw_input,
code: e
}
withdrawDo(params).then(res => {
uni.showToast({
title: '申请提现成功,耐心等待打款',
icon: 'none',
duration: 2000
})
this.reset()
}).catch(err => {
uni.showToast({
title: err.message,
icon: 'none',
duration: 2000
})
})
},
reset() {
this.name = ''
this.card = ''
this.page = 1
this.has_more = true
this.withdraw_input = ''
this.total = 0
this.withdrawLists = []
this.withdrawLogs();
this.withdraw();
}
}
}
</script>
<style lang="scss">
.hasmore {
color: #808080;
font-size: $title-size-m;
text-align: center;
padding: $padding*2;
}
.nomore {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
box-sizing: border-box;
font-size: $title-size-m;
color: #808080;
margin-top: $margin*4;
image {
width: 320rpx;
margin-bottom: $margin*2;
}
}
.receiptCode {
color: #808080;
text-align: left;
// margin: $margin 0;
font-size: $title-size-m;
}
.WithdrawingCoin {
background-color: #fff;
width: 100%;
min-height: 100vh;
padding-bottom: 100rpx;
}
.all {
color: $mian-color;
width: 160rpx;
text-align: center;
}
.withdrawing-content {
min-height: 300rpx;
background-color: #fff;
box-shadow: 0 0 30rpx 1rpx rgba($color: #000000, $alpha: 0.2);
margin: $margin*1.4;
border-radius: $radius*1.5;
padding: $padding*1.4;
font-size: $title-size-m;
.item-name {
text-align: center;
padding: $padding * .6;
color: #303030;
font-weight: bold;
margin-bottom: $margin;
font-size: $title-size *1.4;
}
.item {
border-bottom: solid 1rpx #f8f8f8;
display: flex;
flex-direction: row;
align-items: center;
justify-content: flex-start;
box-sizing: border-box;
padding: $padding 0;
span:nth-child(1) {
color: #666;
margin-right: 20rpx;
}
.input_num {
font-size: $title-size*1.5;
color: #3a3a3a;
font-weight: bolder;
flex: 1;
}
}
.item-total {
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
padding: $padding*2 0 0 0;
color: #3a3a3a;
.total {
display: flex;
flex-direction: column;
align-items: flex-start;
justify-content: center;
box-sizing: border-box;
.money {
padding-top: $padding *0.5;
}
}
.lists {
color: $text-price;
}
}
}
.btn {
// background-color: $text-price;
background-image: linear-gradient(to right, $text-price, $mian-color);
color: #fff;
border-radius: 50rpx;
text-align: center;
padding: $padding ;
margin: $margin * 2;
font-size: $title-size;
font-weight: bold;
}
.ew_lists {
padding: $padding *2;
border-top: solid 4rpx #f8f8f8;
.item {
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
box-sizing: border-box;
border-bottom: solid 1rpx #f8f8f8;
background-color: #fff;
padding: 0 0 $padding*0.8 0;
.left,
.right {
display: flex;
flex-direction: column;
align-items: flex-start;
justify-content: center;
box-sizing: border-box;
}
.left {
font-size: $title-size-m;
font-weight: bold;
color: #808080;
span:nth-child(2) {
color: $text-price;
font-size: $title-size-m;
font-weight: normal;
padding-top: $padding *0.5;
}
}
.right {
font-size: $title-size-m;
align-items: flex-end;
color: #666;
span:nth-child(1) {
padding-bottom: $padding*0.5;
}
}
}
}
</style>

125
pages/wallet/guide.vue Normal file
View File

@@ -0,0 +1,125 @@
<template>
<view>
<form>
<!-- 副标题 -->
<view class="sub-title">输入您的钱包助记词导入</view>
<!-- 助记词 -->
<view class="word">
<textarea placeholder="输入助记词"></textarea>
</view>
<!-- 设置钱包密码 -->
<view class="password">
<view class="group">
<view class="inputs">
<label>钱包名称</label>
<input type="text" placeholder="输入钱包名称" />
</view>
</view>
<view class="title">不少于8个字符建议包含大小写符号特殊字符</view>
<view class="group">
<view class="inputs">
<label>密码</label>
<input type="password" placeholder="请设置密码" />
</view>
<view class="inputs">
<label>确认密码</label>
<input type="password" placeholder="请确认密码" />
</view>
</view>
</view>
<!-- 按钮 -->
<view class="buttons">
<view class="text">什么是助记词</view>
<button type="default" form-type="submit">开始导入</button>
</view>
</form>
</view>
</template>
<script>
export default {
data() {
return {
}
},
methods: {
}
}
</script>
<style lang="scss" scoped>
// 副标题
.sub-title{
line-height: 90rpx;
color: $text-gray;
text-align: center;
margin: $margin;
font-size: $title-size-m;
}
// 助记词
.word{
background-color: white;
margin: $margin * 2;
padding: $padding + 10;
border-radius: $radius-m;
box-shadow: 0 0 4rpx 4rpx rgba($color: $text-color, $alpha: .02);
& textarea{
height: 200rpx;
}
}
// 设置密码
.password{
padding: 0 $padding * 2;
.title{
margin-top: $margin * 2;
font-size: $title-size-m;
color: $mian-color;
}
.group{
margin-top: $margin;
border-radius: $radius-m;
box-shadow: 0 0 4rpx 4rpx rgba($color: $text-color, $alpha: .02);
background-color: white;
.inputs{
padding: $padding $padding + 10;
border-bottom: solid 1rpx $border-color;
&:last-child{
border-bottom: none;
}
label{
color: $text-gray;
font-size: $title-size-m;
}
input{
height: 70rpx;
line-height: 70rpx;
font-size: $title-size;
}
}
}
}
// 按钮
.buttons{
padding: $padding * 2;
.text{
text-align: center;
line-height: 90rpx;
height: 90rpx;
margin-bottom: $margin * 2;
font-size: $title-size-lg;
color: $mian-color;
font-weight: bold;
}
button{
height: 90rpx;
line-height: 90rpx;
background-color: $mian-color;
border-radius: $radius-lg;
color: white;
font-weight: bold;
font-size: $title-size;
}
}
</style>

144
pages/wallet/index.vue Normal file
View File

@@ -0,0 +1,144 @@
<template>
<view class="animate__animated animate__fadeInRight">
<!-- 数字资产 -->
<view class="property">
<view class="title">总资产()</view>
<view class="number">0.00</view>
</view>
<!-- 资产列表 -->
<view class="lists">
<view class="lists-header">
资产列表
<uni-icons type="plus" size="24" color="#aa55ff"></uni-icons>
</view>
<view class="item" v-for="(item, index) in 2" :key="index" @click="propertyInfo(item)">
<view class="cost">
<image class="logo" src="" mode="" />
<view class="title ellipsis">OC COIN</view>
<view class="text ellipsis">0.21</view>
</view>
<view class="balance">
<view class="title ellipsis">120,330.00</view>
<view class="text ellipsis">25269.3000</view>
</view>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
};
},
methods:{
propertyInfo(e){
console.log(e)
uni.navigateTo({
url: './property'
})
}
}
}
</script>
<style scoped>
</style>
<style lang="scss" scoped>
// 数字资产
.property{
overflow: hidden;
position: relative;
margin-top: $margin;
margin-left: $margin + ($margin / 2);
background-color: $mian-color;
border-radius: $radius 0 0 $radius;
padding: ($padding * 3) ($padding * 3) ($padding * 3) ($padding * 2);
color: white;
font-weight: bold;
&::before,&::after{
background-color: rgba($color: $red-color, $alpha: .03);
border-radius: 50%;
content: " ";
position: absolute;
}
&::before{
top: -300rpx;
left: 40%;
height: 400rpx;
width: 400rpx;
}
&::after{
bottom: -200rpx;
left: -100rpx;
height: 300rpx;
width: 300rpx;
}
.title{
font-size: $title-size;
}
.number{
font-size: $title-size + 18;
}
}
// 资产列表
.lists{
padding: $margin + ($margin / 2);
.lists-header{
display: flex;
font-size: $title-size + 2;
color: $text-color;
font-weight: bold;
padding: $padding 0 ($padding/2) 0;
justify-content: space-between;
justify-items: center;
align-items: center;
}
.item{
background-color: white;
border-radius: $radius;
box-shadow: 0 0 4rpx 4rpx rgba($color: #000000, $alpha: .02);
margin-top: $margin;
padding: $padding * 2;
display: flex;
&:first-child{
margin-top: 0;
}
.cost{
position: relative;
margin-right: $margin;
padding-left: 108rpx;
width: 50%;
box-sizing: border-box;
.logo{
position: absolute;
left: 0;
top: 0;
width: 88rpx;
height: 88rpx;
border-radius: 50%;
background-color: $border-color;
margin-right: $margin;
}
}
.balance{
padding-left: $padding;
width: 50%;
text-align: right;
box-sizing: border-box;
}
.title{
font-weight: bold;
font-size: $title-size;
}
.text{
font-size: $title-size-m;
color: $text-gray;
}
}
}
</style>

108
pages/wallet/mnemonic.vue Normal file
View File

@@ -0,0 +1,108 @@
<template>
<view>
<!-- 提示信息 -->
<view class="prompt">
请按照顺序记录并确保正确备份助记词
</view>
<!-- 助记词 -->
<ul class="mnemonic">
<li v-for="(item, index) in mnemonic" :key="index">{{item}}</li>
</ul>
<!-- 按钮 -->
<view class="buttons">
<view class="text">助记词是用户账户的唯一标识不能分享给他人掌握该助记词即可控制该账户与钱包</view>
<button type="default" @click="goto('/pages/wallet/validation')">验证助记词</button>
</view>
<!-- <view class="skip">暂时不验证<navigator url="/pages/index/index" open-type="switchTab">点此跳过</navigator></view> -->
</view>
</template>
<script>
import { seed } from "../../apis/interfaces/wallet"
export default {
data() {
return {
mnemonic: [], // 助记词
sign : '' // 校验签名
}
},
onLoad() {
seed().then(res => {
this.mnemonic = res.seed.split(' ')
this.sign = res.sign
}).catch(err => {
uni.showToast({
icon: 'none',
title: err.message
})
})
},
methods: {
goto(url){
uni.redirectTo({
url: url + '?seed=' + this.mnemonic + '&sign=' + this.sign
})
}
}
}
</script>
<style lang="scss" scoped>
// 提示信息
.prompt{
color: $text-gray;
text-align: center;
line-height: 90rpx;
font-size: $title-size-m;
}
// 跳过
.skip{
padding: $padding * 2;
text-align: center;
color: $text-gray;
navigator{
color: $mian-color;
margin-left: $margin/2;
display: inline-block;
}
}
// 助记词
.mnemonic{
margin: $margin $margin * 2;
border-radius: $radius-m;
box-shadow: 0 0 4rpx 4rpx rgba($color: $text-color, $alpha: .02);
background-color: white;
padding: $padding;
list-style: none;
display: flex;
flex-wrap: wrap;
li{
text-align: center;
height: 58rpx;
line-height: 58rpx;
width: 58rpx;
margin: $margin / 2;
color: $text-color;
background: rgba($color: $border-color, $alpha: .4);
}
}
// 按钮
.buttons{
padding: $padding $padding * 2;
.text{
text-align: center;
margin-bottom: $margin * 2;
font-size: $title-size-lg;
color: $red-color;
}
button{
height: 90rpx;
line-height: 90rpx;
background-color: $mian-color;
border-radius: $radius-lg;
color: white;
font-weight: bold;
font-size: $title-size;
}
}
</style>

108
pages/wallet/privatekey.vue Normal file
View File

@@ -0,0 +1,108 @@
<template>
<view>
<!-- 私钥 -->
<view class="keys">
<view class="title">您已接收OC Chain托管</view>
<view class="key">{{key || '-'}}</view>
<view class="copykey" @click="copykey">复制我的私钥</view>
</view>
<!-- 疑问 -->
<view class="doubt" v-if="rules.length > 0">
<view class="doubt-item" v-for="(item, index) in rules" :key="index">
<view class="title">{{item.title || '-'}}</view>
<view class="content">{{item.description || '-'}}</view>
</view>
</view>
<!-- 免责说明 -->
<view class="liability">
<navigator url="/pages/wallet/cmsWithDraw">免责条款</navigator>
</view>
</view>
</template>
<script>
import { privatekey, keyrules } from '@/apis/interfaces/wallet'
export default {
data() {
return {
key: "",
rules: []
};
},
mounted() {
Promise.all([privatekey(this.$Route.query.password), keyrules()]).then(res => {
let privatekey = res[0],
keyrules = res[1]
this.key = privatekey.private_key
this.rules = keyrules
})
},
methods:{
copykey(){
uni.setClipboardData({
data: this.key
})
}
}
}
</script>
<style lang="scss">
.keys{
margin: $margin * 2;
background: white;
padding: $padding * 2;
box-shadow: 0 0 4rpx 4rpx rgba($color: #000000, $alpha: .02);
border-radius: $radius;
.title{
text-align: center;
font-weight: bold;
font-size: $title-size + 4;
color: $text-color;
}
.key{
padding: $padding * 2 0;
text-align: center;
color: $mian-color;
word-wrap: break-word;
}
.copykey{
background-color: $mian-color;
color: white;
height: 95rpx;
line-height: 95rpx;
text-align: center;
font-size: $title-size;
border-radius: $radius-m;
font-weight: bold;
}
}
.doubt{
margin: $margin $margin * 2;
.doubt-item{
padding: $padding 0;
.title{
font-weight: bold;
color: $text-color;
line-height: 50rpx;
font-size: $title-size + 2;
}
.content{
color: $text-gray-lg;
font-size: $title-size-m;
line-height: 40rpx;
}
}
}
.liability{
text-align: center;
color: $text-gray;
@extend .ios-bottom;
navigator{
font-size: $title-size-sm;
display: inline-block;
line-height: 90rpx;
padding: 0 ($padding * 2);
}
}
</style>

343
pages/wallet/property.vue Normal file
View File

@@ -0,0 +1,343 @@
<template>
<view class="propertyIndex">
<view class="propery">
<view class="propery-content">
<view class="currency">能量球 ( {{ price || '0' }} CNY)</view>
<view class="balance">{{ balance.balance || '0' }}</view>
<view class="frozen">{{ balance.frozen || '0' }} 冻结中</view>
<view class="balance-flex">
<view class="balance-flex-item" @click="showAddress">区块链地址</view>
<view class="balance-flex-item" @click="showPrivatekey('privatekey')">我的私钥</view>
</view>
</view>
</view>
<!-- 账户记录 -->
<view class="record">
<view class="record-tabs">
<view class="tabs-item" :class="logsType === 0 ? 'show': ''" @click="onLogsType(0)">全部</view>
<view class="tabs-item" :class="logsType === 2 ? 'show': ''" @click="onLogsType(2)">收入</view>
<view class="tabs-item" :class="logsType === 1 ? 'show': ''" @click="onLogsType(1)">支出</view>
</view>
<record :list="logs" :logsType="logsType" />
<!-- ios安全距离 -->
<view class="ios-bottom"></view>
</view>
<!-- 支付密码 -->
<uni-popup ref="showPassword">
<view class="validationPassword">
<view class="from">
<view class="title">验证密码</view>
<input class="input" v-model="password" password placeholder="请验证安全密码"/>
</view>
<view class="buttons">
<view class="button cancel" @click="payPassword('cancel', passwordPages)">取消</view>
<view class="button confirm" @click="payPassword('confirm', passwordPages)">验证</view>
</view>
</view>
</uni-popup>
<!-- 原密码弹窗 -->
<!-- <number-jpan :length="6" @closeChange="closeChange($event)" ref="numberPad"></number-jpan> -->
</view>
</template>
<script>
import record from '@/components/property/record'
import {
sum,
price,
logs,
code,
securityCheck // 输入旧密码是否正确
} from '@/apis/interfaces/wallet'
import numberJpan from "@/components/numberJpan/numberJpan.vue";
export default {
components: {
record
},
data() {
return {
balance: {},
price: '0.00',
logs: [],
logsType: 0,
password: '',
passwordPages: ''
};
},
onShow() {
Promise.all([
sum(),
price(),
logs()
]).then(res => {
this.balance = res[0]
this.price = res[1]
this.logs = res[2]
}).catch(err => {
uni.showToast({
icon: 'none',
title: err.message
})
})
},
methods: {
// 弹出私钥
showPrivatekey(pages){
this.passwordPages = pages
this.$refs.showPassword.open('center')
},
// 验证私钥
payPassword(type){
if(type === 'confirm'){
if(this.password === '') {
uni.showToast({
title: '请输入安全密码',
icon : 'none'
})
return
}
securityCheck(this.password).then(res => {
this.$refs.showPassword.close()
switch (this.passwordPages){
case 'privatekey':
this.$Router.push({name:'Privatekey', params: {password: this.password}})
break;
case 'resetPassword':
this.$Router.push({name:'ResetPassword', params: {password: this.password}})
break;
}
this.password = ''
}).catch(err => {
uni.showToast({
title: err.message,
icon: 'none',
})
})
return
}
this.$refs.showPassword.close()
},
// 交易记录
onLogsType(index) {
if (this.logsType === index) return
this.logsType = index
this.logs = []
logs({
flag: this.logsType
}).then(res => {
this.logs = res
})
},
// 区块地址
showAddress() {
uni.showModal({
title: '我的区块链地址',
content: '\n地址可以理解为银行卡卡号与他人转账时是区块链上的两个地址间的交易行为\n\n' + this.balance.address,
cancelText: '复制',
cancelColor: '#b11eff',
success: (res) => {
if (res.cancel) {
uni.setClipboardData({
data: this.balance.address
})
}
}
})
}
},
onNavigationBarButtonTap(e) {
if (e.index === 0) {
uni.showActionSheet({
// itemList: ['转账', '收款', '提币', '修改密码'],
itemList: ['提现', '修改密码'],
success: (res) => {
switch (res.tapIndex) {
case 0:
console.log('提现了,')
this.$Router.push({
name: 'Extract'
})
break;
case 1:
this.showPrivatekey('resetPassword')
break;
}
uni.hideLoading()
}
})
}
}
}
</script>
<style lang="scss" scoped>
.propertyIndex{
width: 100%;
min-height: 100vh;
background-color: #FFFFFF;
}
// 验证密码弹出层
.validationPassword{
background-color: white;
border-radius: $radius-m;
width: 70vw;
.from{
padding: $padding*2;
.title{
text-align: center;
font-size: $title-size;
padding-bottom: $padding*2;
font-weight: bold;
color: $text-price;
}
.input{
text-align: center;
height: 90rpx;
font-size: $title-size;
border-radius: $radius-m;
background: $border-color-lg;
padding: 0 ($padding*2);
}
}
.buttons{
display: flex;
border-top: solid 1rpx $border-color;
.button{
width: 50%;
font-size: $title-size;
line-height: 90rpx;
height: 90rpx;
text-align: center;
box-sizing: border-box;
&.cancel{
border-right: solid 1rpx $border-color;
color: $text-gray;
}
&.confirm{
color: $text-price;
}
}
}
// .button{
// background-color: $text-price;
// color: white;
// border-radius: $radius-m;
// border: none;
// margin-top: $margin*2;
// font-size: $title-size;
// height: 90rpx;
// line-height: 90rpx;
// }
// .close{
// @extend .button;
// text-align: center;
// color: $text-gray;
// margin-top: $margin;
// background-color: transparent;
// }
}
// 账户
.propery {
position: relative;
padding-top: var(--status-bar-height);
background-image: linear-gradient(to right, #7c52fc, #976dff);
&::before {
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
content: " ";
background-image: url(@/static/background/wallet-back.png);
background-size: 100%;
background-repeat: no-repeat;
}
.propery-content {
position: relative;
z-index: 1;
padding: $padding *3 $padding *1.4;
text-align: center;
.currency {
font-size: $title-size-m;
color: rgba($color: white, $alpha: .8);
}
.balance {
font-size: $title-size * 2;
padding: ($padding / 2) 0;
color: white;
}
.frozen {
background: rgba($color: #000000, $alpha: .1);
color: rgba($color: white, $alpha: .7);
display: inline-block;
padding: 0 $padding;
font-size: $title-size-m;
height: 50rpx;
line-height: 50rpx;
border-radius: $radius-m;
border: solid 1rpx rgba($color: white, $alpha: .4)
}
.balance-flex {
display: flex;
justify-content: center;
margin-top: $margin * 3;
.balance-flex-item {
background-color: white;
width: 200rpx;
height: 75rpx;
line-height: 75rpx;
color: $text-price;
margin: 0 $margin;
border-radius: $radius-m;
font-size: $title-size;
}
}
}
}
// 记录
.record {
background-color: white;
border-radius: $radius $radius 0 0;
padding: $padding ($padding * 2);
margin-top: -$margin;
position: relative;
z-index: 2;
.record-tabs {
display: flex;
justify-content: space-around;
font-weight: bold;
font-size: $title-size;
color: $text-gray;
line-height: 70rpx;
margin-bottom: $margin;
.tabs-item {
position: relative;
padding: 0 $padding;
&.show {
color: $text-price;
&::before {
position: absolute;
bottom: 0;
left: $padding;
right: $padding;
height: 4rpx;
content: " ";
background-color: $text-price;
}
}
}
}
}
</style>

View File

@@ -0,0 +1,150 @@
<template>
<view>
<!-- 设置钱包密码 -->
<view class="password">
<view class="prompt">请设置6位数字密码建议不要使用连续的数字</view>
<view class="group">
<view class="inputs">
<label>密码</label>
<input type="digit" v-model="password" maxlength="6" password placeholder="请设置新密码" />
</view>
<view class="inputs">
<label>确认密码</label>
<input type="digit" v-model="verify" maxlength="6" password placeholder="请确认新密码" />
</view>
</view>
</view>
<!-- 按钮 -->
<view class="buttons">
<button type="default" form-type="submit" @click="createWallet">确认</button>
</view>
</view>
</template>
<script>
import {
securityReset
} from '@/apis/interfaces/wallet'
export default {
data() {
return {
password: '',
verify: '',
oldPassword: ''
}
},
onLoad() {
this.oldPassword = this.$Route.query.password
},
methods: {
// 激活钱包
createWallet() {
if (this.password === '' || this.verify === '') {
uni.showToast({
icon: 'none',
title: '请设置密码'
})
return
}
if (this.password !== this.verify) {
uni.showToast({
icon: 'none',
title: '两次输入密码不一致'
})
return
}
securityReset({
new_code: this.password,
old_code: this.oldPassword
}).then(res => {
uni.showModal({
title: '提示',
content: '密码已重置',
showCancel:false,
success: res=> {
uni.navigateBack()
}
})
}).catch(err => {
uni.showToast({
icon: 'none',
title: err.message
})
})
}
}
}
</script>
<style lang="scss" scoped>
// 副标题
.sub-title {
color: $text-gray;
text-align: center;
margin: $margin * 2 $margin;
font-size: $title-size-m;
}
// 设置密码
.password {
padding: 0 $padding * 2;
.prompt {
margin-top: $margin * 2;
font-size: $title-size-m;
color: $mian-color;
}
.group {
margin-top: $margin;
border-radius: $radius-m;
box-shadow: 0 0 4rpx 4rpx rgba($color: $text-color, $alpha: .02);
background-color: white;
.inputs {
padding: $padding $padding + 10;
border-bottom: solid 1rpx $border-color;
&:last-child {
border-bottom: none;
}
label {
color: $text-gray;
font-size: $title-size-m;
}
input {
height: 70rpx;
line-height: 70rpx;
font-size: $title-size;
}
}
}
}
// 按钮
.buttons {
padding: $padding * 2;
.text {
text-align: center;
line-height: 90rpx;
height: 90rpx;
margin-bottom: $margin * 2;
font-size: $title-size-lg;
color: $mian-color;
font-weight: bold;
}
button {
height: 90rpx;
line-height: 90rpx;
background-color: $mian-color;
border-radius: $radius-lg;
color: white;
font-weight: bold;
font-size: $title-size;
}
}
</style>

77
pages/wallet/results.vue Normal file
View File

@@ -0,0 +1,77 @@
<template>
<view>
<view class="webkit-box results">
<uni-icons type="checkbox-filled" size="88" color="#009b69"></uni-icons>
<view class="title">交易已提交</view>
<view class="sub-title">预计10秒内到账可在交易记录中查询以实际到账时间为准</view>
<view class="hash">
<view class="hash-title">交易哈希</view>
<view class="hash-text">{{hash}}</view>
</view>
<button class="results-button" type="default" @click="navBack">返回</button>
</view>
</view>
</template>
<script>
export default {
data() {
return {
hash: ''
};
},
onLoad(e){
this.hash = e.hash
},
methods:{
navBack(){
uni.navigateBack()
}
}
}
</script>
<style lang="scss" scoped>
.results{
height: 100vh;
box-sizing: border-box;
text-align: center;
padding-left: $padding * 3;
padding-right: $padding * 3;
padding-bottom: 20vh;
.title{
font-size: $title-size + 8;
color: $text-color;
font-weight: bold;
line-height: 80rpx;
padding: $padding 0;
}
.sub-title{
color: $text-gray;
line-height: 40rpx;
}
.hash{
background-color: white;
padding: $padding * 2;
border-radius: $radius-lg;
margin-top: $margin * 2;
font-size: $title-size;
color: $text-color;
.hash-title{
padding-bottom: $padding;
}
.hash-text{
word-break:break-all;
}
}
.results-button{
margin-top: $margin * 3;
height: 90rpx;
line-height: 90rpx;
background-color: $mian-color;
color: white;
font-size: $title-size;
font-weight: bold;
}
}
</style>

216
pages/wallet/transfer.vue Normal file
View File

@@ -0,0 +1,216 @@
<template>
<view>
<!-- 账户余额 -->
<view class="transfer-block">
<view class="unit">OCC</view>
<view class="transfer-flex">
<view class="item ellipsis">
<label>数量</label>{{balance.balance || '0.00'}}
</view>
<view class="item ellipsis">
<label>估值(CNY)</label>{{cny || '0.00'}}
</view>
</view>
</view>
<view class="sub-title">
<text>请认真确认地址及数量地址错误无法找回</text>
</view>
<!-- 转账信息 -->
<view class="password">
<view class="group">
<view class="inputs input-scan">
<label>接收地址</label>
<input type="text" placeholder="请输入接收地址" v-model="address" />
<view class="input-scan-icon" @click="scanCode">
<uni-icons type="scan" size="22" color="#009b69"></uni-icons>
</view>
</view>
<view class="inputs">
<label>转账数量</label>
<input type="number" placeholder="请输入转账数量" v-model="number" />
</view>
</view>
<view class="group">
<view class="inputs">
<label>交易密码</label>
<input type="password" placeholder="请输入安全密码" v-model="password" />
</view>
</view>
</view>
<!-- 按钮 -->
<view class="buttons">
<button type="default" @click="submitTransfer">转账</button>
</view>
</view>
</template>
<script>
import { sum, price, transfer } from '@/apis/interfaces/wallet'
export default {
data() {
return {
balance: {},
cny: '0.00',
address: '',
number: '',
password: ''
}
},
onLoad(e){
if(e.hashAddress) this.address = e.hashAddress
},
mounted() {
Promise.all([
sum(),
price()
]).then(res => {
this.balance = res[0]
if (res[0].balance > 0) this.cny = (res[1] * res[0].balance).toFixed(2)
}).catch(err => {
uni.showToast({
icon: 'none',
title: err.message
})
})
},
methods: {
// 转账
submitTransfer(){
if(this.address === '' || this.number === '' || this.password === ''){
let messageText
if(this.address === '') messageText = '请输入接收地址'
else if(this.number === '') messageText = '请输入转账数量'
else if(this.password === '') messageText = '请输入安全密码'
uni.showToast({
icon: 'none',
title: messageText
})
return
}
// 提交转账信息
transfer({
to: this.address,
amount: this.number,
security_code: this.password
}).then(res => {
uni.redirectTo({
url: './results?hash=' + res.txHash + '&number=' + this.number
})
}).catch(err => {
uni.showToast({
icon: 'none',
title: err.message
})
})
},
// 扫码
scanCode(){
uni.scanCode({
scanType: ['qrCode'],
success: res=> {
this.address = res.result
}
})
}
}
}
</script>
<style lang="scss" scoped>
// 账户余额
.transfer-block{
background-color: white;
margin: $margin * 2;
border-radius: $radius-m;
box-shadow: 0 0 4rpx 4rpx rgba($color: $text-color, $alpha: .02);
background-color: white;
padding: $padding $padding + 10;
.unit{
font-weight: bold;
font-size: $title-size + 10;
line-height: 90rpx;
color: $text-color;
}
.transfer-flex{
display: flex;
padding: $padding 0;
border-top: solid 1rpx $border-color;
.item{
width: 50%;
font-size: $title-size-m;
& > label{
color: $text-gray;
padding-right: $padding/2;
}
}
}
}
// 提示信息
.sub-title{
color: $text-gray;
text-align: center;
margin: $margin * 2 $margin;
font-size: $title-size-m;
}
// 转账信息
.password{
padding: 0 $padding * 2;
.group{
margin-top: $margin;
border-radius: $radius-m;
box-shadow: 0 0 4rpx 4rpx rgba($color: $text-color, $alpha: .02);
background-color: white;
.inputs{
padding: $padding $padding + 10;
border-bottom: solid 1rpx $border-color;
&:last-child{
border-bottom: none;
}
label{
color: $text-gray;
font-size: $title-size-m;
}
input{
height: 70rpx;
line-height: 70rpx;
font-size: $title-size;
}
}
.input-scan{
position: relative;
padding-right: ($padding*2) + 70;
.input-scan-icon{
position: absolute;
bottom: $padding;
right: $padding;
height: 70rpx;
width: 70rpx;
line-height: 70rpx;
text-align: center;
}
}
}
}
// 按钮
.buttons{
padding: $padding * 2;
.text{
text-align: center;
line-height: 90rpx;
height: 90rpx;
margin-bottom: $margin * 2;
font-size: $title-size-lg;
color: $mian-color;
font-weight: bold;
}
button{
height: 90rpx;
line-height: 90rpx;
background-color: $mian-color;
border-radius: $radius-lg;
color: white;
font-weight: bold;
font-size: $title-size;
}
}
</style>

169
pages/wallet/validation.vue Normal file
View File

@@ -0,0 +1,169 @@
<template>
<view>
<!-- 提示信息 -->
<view class="prompt">
验证您的钱包助记词
</view>
<!-- 助记词 -->
<view class="mnemonic">
<view
class="item"
v-for="(item, index) in validation"
:key="index"
:class="item === null ? 'hide': ''"
@click="onKeys('removeKey', index)"
>{{ item }}</view>
</view>
<!-- 选择助记词 -->
<block v-if="mnemonic.length > 0">
<view class="mnemonic-title">
按顺序填写助记词
</view>
<view class="mnemonic-select">
<view class="item" v-for="(item, index) in mnemonic" :key="index" @click="onKeys('addKey', index)">{{ item }}</view>
</view>
</block>
<!-- 按钮 -->
<view class="buttons">
<button type="default" @click="verifyMnemonic">验证</button>
</view>
</view>
</template>
<script>
import { hash } from "../../apis/interfaces/wallet"
export default {
data() {
return {
validation : new Array(15).fill(null), // 验证key
mnemonic : [], // 助记词key
sign : '', // 助记词校验签名
seedString : '', // 助记词原词
}
},
onLoad(e) {
let seed = e.seed.split(',')
seed.sort(() => {
return Math.random() - .5
});
this.mnemonic = seed
this.sign = e.sign
this.seedString = e.seed
},
methods: {
// 填写助记词
onKeys(type, index){
if(type === 'addKey') {
this.$set(this.validation, this.validation.findIndex(val => val === null), this.mnemonic[index])
this.$delete(this.mnemonic, index)
return
}
if(type === 'removeKey' && this.validation[index] !== null) {
this.mnemonic.push(this.validation[index])
this.$delete(this.validation, index)
this.validation.push(null)
}
},
// 验证助记词
verifyMnemonic(){
if(this.validation.findIndex(val => val === null) > -1){
uni.showToast({
title: '请完整填写助记词',
icon : 'none'
})
return
}
let seed = this.validation.toString().replace(/,/g, ',')
if (this.seedString !== seed) {
uni.showToast({
title: '验证失败,请确认您的助记词',
icon : 'none'
})
return
}
uni.redirectTo({
url: './create'
})
}
}
}
</script>
<style lang="scss" scoped>
// 提示信息
.prompt{
color: $text-gray;
text-align: center;
line-height: 90rpx;
font-size: $title-size-m;
}
// 选择助记词
.mnemonic-title{
padding-top: $padding * 2;
margin: 0 $margin * 2;
font-size: $title-size-m;
color: $mian-color;
}
.mnemonic-select{
display: flex;
flex-wrap: wrap;
padding: $padding $padding + $padding / 2;
.item{
background-color: white;
line-height: 68rpx;
height: 68rpx;
width: 68rpx;
text-align: center;
margin: $margin / 2;
border-radius: $radius-m;
box-shadow: 0 0 4rpx 4rpx rgba($color: $text-color, $alpha: .02);
}
}
// 助记词
.mnemonic{
margin: $margin ($margin * 2);
border-radius: $radius-m;
box-shadow: 0 0 4rpx 4rpx rgba($color: $text-color, $alpha: .02);
background-color: white;
padding: $padding;
display: flex;
flex-wrap: wrap;
align-items: flex-start;
.item{
background: rgba($color: $border-color, $alpha: .4);
width: 58rpx;
height: 58rpx;
line-height: 58rpx;
text-align: center;
color: $text-color;
margin: $margin / 2;
&.hide{
border:dashed 1px $border-color;
box-sizing: border-box;
background-color: white;
}
}
}
// 按钮
.buttons{
padding: $padding $padding * 2;
.text{
text-align: center;
margin-bottom: $margin * 2;
font-size: $title-size-lg;
color: $red-color;
}
button{
height: 90rpx;
line-height: 90rpx;
background-color: $mian-color;
border-radius: $radius-lg;
color: white;
font-weight: bold;
font-size: $title-size;
&[disabled]{
background: rgba($color: $mian-color, $alpha: .8);
}
}
}
</style>

View File

@@ -26,6 +26,8 @@ $title-size-sm: 26rpx;
// 模块圆角 // 模块圆角
$radius: 20rpx; $radius: 20rpx;
$radius-sm: 10rpx; $radius-sm: 10rpx;
$radius-lg: 12rpx;
$radius-m: 10rpx;
// 模块边距 // 模块边距
$margin: 30rpx; $margin: 30rpx;

BIN
static/icons/logs-null.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

BIN
static/imgs/cart_empty.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

BIN
static/imgs/news_1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

BIN
static/imgs/news_2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

BIN
static/imgs/news_2_1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 569 B

BIN
static/imgs/news_3.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

BIN
static/imgs/news_3_1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 338 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

BIN
static/user/user-top-00.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

BIN
static/user/user-top-01.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 626 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

BIN
static/user/userTool-00.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

BIN
static/user/userTool-01.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

BIN
static/user/userTool-02.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

BIN
static/user/userTool-03.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

BIN
static/user/userTool-04.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

BIN
static/user/userTool-05.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 226 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB