新增账户

This commit is contained in:
唐明明
2022-06-07 20:30:29 +08:00
parent e48ff8b7ad
commit 2c0175633c
32 changed files with 1292 additions and 10959 deletions

View File

@@ -1,71 +0,0 @@
/*
* @Description:饮水记录模块
* @Author: Aimee·Zhang
* @Date: 2022-01-12 11:07:06
* @LastEditors: Aimee·Zhang
* @LastEditTime: 2022-01-12 15:57:48
*/
import { request } from '../index'
/**
* @description:饮水记录首页
*/
const waters = (data) => {
return request({
url: 'health/waters',
data:data
})
}
/**
* @description:设定喝水目标
* @Date: 2022-01-12 15:33:39
*/
const setWaters = (data) => {
return request({
url: 'health/waters',
method: 'POST',
data: data
})
}
/**
* @description:喝水
* @Date: 2022-01-12 125600
*/
const drinkWater = (data) => {
return request({
url: 'health/waters/drink',
method: 'POST',
data:data
})
}
/**
* @description:删除喝水记录
* @Date: 2022-01-20 15点08分
*/
const delDrinkWater = (id) => {
return request({
url: `health/waters/${id}`,
method: 'DELETE',
})
}
/**
* @description:饮食运动日历
* @params {日期}
* @method {get}
* @Date: 2022-02-08 11点18分
*/
const dateList = (data) => {
return request({
url: 'health/calendar/water',
data:data
})
}
export {
waters,
setWaters,
drinkWater,
delDrinkWater,
dateList
}

View File

@@ -1,57 +0,0 @@
/*
* @Description:创建档案模块
* @Author: Aimee·Zhang
* @Date: 2022-01-12 13:27:31
* @LastEditors: Aimee·Zhang
* @LastEditTime: 2022-01-12 14:32:11
*/
import { request } from '../index'
/**
* @description:新建健康档案
* @params {age,sex,height,weight,exercise,goal_weight,days}
* @return {*}
* @method {post}
* @Date: 2022-01-12 11:08:11
*/
const recordsHealth = (data) => {
return request({
url: 'health/records',
method: "POST",
data: data
})
}
/**
* @description:编辑健康档案前置
* @params {id}档案id
* @return {}
* @method {get}
* @Date: 2022-01-12 13:39:56
*/
const editHealthBefore = (id) => {
return request({
url: `health/records/${id}/edit`
})
}
/**
* @description:修改健康档案
* @params {record_id档案iddata参数}
* @return {*}
* @Date: 2022-01-12 13:49:29
*/
const editHealth = (record_id, data) => {
console.log(data,'data............')
return request({
url: `health/records/${record_id}`,
method: "PUT",
data: data
})
}
export {
recordsHealth,
editHealthBefore,
editHealth
}

View File

@@ -1,73 +0,0 @@
/*
* @Description:
* @Author: Aimee·Zhang
* @Date: 2022-01-13 13:17:14
* @LastEditors: Aimee·Zhang
* @LastEditTime: 2022-01-14 08:38:02
*/
/**
* @description:健康测评模块接口
* @params {*}
* @return {*}
* @Date: 2022-01-13 13:17:33
*/
import { request } from '../index'
/**
* @description:健康测评接口
*/
const evaluations = () => {
return request({
url: 'evaluations'
})
}
/**
* @description:测试介绍页面
* @Date: 2022-01-13 15:04:47
*/
const evaluationsInfo = (evaluation_id) => {
return request({
url: `evaluations/${evaluation_id}`
})
}
/**
* @description:试题列表
* @Date: 2022-01-13 15:12:31
*/
const evaluationsQuestion = (evaluation_id, page) => {
return request({
url: `evaluations/${evaluation_id}/questions`,
data: {
page: page
}
})
}
/**
* @description:提交答案
* @Date: 2022-01-13 16:06:26
*/
const evaluationsAnswers = (data) => {
return request({
url: `evaluations/${data.id}/answers`,
data: data,
method: 'POST'
})
}
/**
* @description:获取测评结果
* @Date: 2022-01-13 16:28:02
*/
const evaluationsAnswersInfo = (id) => {
return request({
url: `evaluations/${id}/result`,
})
}
export {
evaluations,
evaluationsInfo,
evaluationsQuestion,
evaluationsAnswers,
evaluationsAnswersInfo
}

View File

@@ -1,101 +0,0 @@
/*
* @Description:vip健康食谱
* @Author: Aimee·Zhang
* @Date: 2022-01-12 17:48:28
* @LastEditors: Aimee·Zhang
* @LastEditTime: 2022-01-14 09:16:28
*/
import { request } from '../index'
/**
* @description:称量体重模块首页
*/
const positions = (page) => {
return request({
url: 'health/recipe/positions',
data: { page: page }
})
}
/**
* @description:饮食和运动首页信息
* @params {日期}
* @method {get}
* @Date: 2022-01-13 08:55:04
*/
const plans = (date) => {
return request({
url: 'health/plans',
data: {
date: date
}
})
}
/**
* @description:食品列表可翻页
* @params {食品名称}
* @return {}
* @Date: 2022-01-13 09:37:26
*/
const healthFoods = (data) => {
return request({
url: 'health/foods',
data: data
})
}
/**
* @description:添加食物
* @Date: 2022-01-13 10:57:52
*/
const addHealthFoods = (data) => {
return request({
url: 'health/intakes',
method: 'POST',
data: data
})
}
/**
* @description:编辑食品
* @Date: 2022-01-13 11:37:37
*/
const editHealthFoods = (data) => {
return request({
url: `health/intakes/${data.intake_id}`,
method: 'PUT',
data: data
})
}
/**
* @description:删除添加食品
* @Date: 2022-01-14 09:15:38
*/
const delHealthFoods = (intake_id) => {
return request({
url: `health/intakes/${intake_id}`,
method: 'DELETE'
})
}
/**
* @description:饮食运动日历
* @params {日期}
* @method {get}
* @Date: 2022-02-07 15点18分
*/
const dateList = (data) => {
return request({
url: 'health/calendar/intake',
data:data
})
}
export {
positions,
plans,
healthFoods,
addHealthFoods,
editHealthFoods,
delHealthFoods,
dateList
}

View File

@@ -1,25 +0,0 @@
/*
* @Description:健康记录模块
* @Author: Aimee·Zhang
* @Date: 2022-01-12 10:11:43
* @LastEditors: Aimee·Zhang
* @LastEditTime: 2022-01-13 08:56:03
*/
import { request } from '../index'
/**
* @description:记录首页
* @params {null}
* @return {}
* @Date: 2022-01-12 10:17:21
*/
const logs = () => {
return request({
url: 'health/logs',
})
}
export {
logs
}

View File

@@ -1,36 +0,0 @@
/**
* Web唐明明
* 匆匆数载恍如梦,岁月迢迢华发增。
* 碌碌无为枉半生,一朝惊醒万事空。
* moduleName: 话题
*/
import { request } from '../index'
// 分类
const categories = () =>{
return request({
url: 'notifications'
})
}
// 列表
const lists = (type, data) =>{
return request({
url: 'notifications/' + type + '/list',
data:data
})
}
// 详情
const noticeDet = (notification_id) =>{
return request({
url: 'notifications/' + notification_id
})
}
export {
categories,
lists,
noticeDet
}

View File

@@ -1,37 +0,0 @@
/**
* Web唐明明
* 匆匆数载恍如梦,岁月迢迢华发增。
* 碌碌无为枉半生,一朝惊醒万事空。
* moduleName: 食物排行
*/
import { request } from '../index'
// 食物分类
const categories = (data) =>{
return request({
url: 'health/foods/categories',
data: data
})
}
// 食物排行
const foods = (data) =>{
return request({
url: 'health/foods',
data: data
})
}
// 食物详情
const foodDet = (food) =>{
return request({
url: 'health/foods/' + food
})
}
export {
categories,
foods,
foodDet
}

View File

@@ -1,28 +0,0 @@
/**
* Web唐明明
* 匆匆数载恍如梦,岁月迢迢华发增。
* 碌碌无为枉半生,一朝惊醒万事空。
* moduleName: 服务
*/
import { request } from '../index'
// 首页
const index = (data) =>{
return request({
url: 'health/halls',
data:data
})
}
// 详情
const hallsDet = (hall) =>{
return request({
url: 'health/halls/' + hall
})
}
export {
index,
hallsDet
}

View File

@@ -1,28 +0,0 @@
/**
* Web唐明明
* 匆匆数载恍如梦,岁月迢迢华发增。
* 碌碌无为枉半生,一朝惊醒万事空。
* moduleName: 签到
*/
import { request } from '../index'
// 日历
const date = () =>{
return request({
url: 'user/sign'
})
}
// 签到
const sign = () =>{
return request({
url: 'user/sign',
method: 'POST'
})
}
export {
date,
sign
}

View File

@@ -1,60 +0,0 @@
/*
* @Description:运动模块
* @Author: Aimee·Zhang
* @Date: 2022-01-19 13:20:39
* @LastEditors: Aimee·Zhang
* @LastEditTime: 2022-01-20 09:12:34
*/
import { request } from '../index'
/**
* @description:动列表
* @params {*} 可翻页 按名称筛选
* @Date: 2022-01-19 13:21:35
*/
const healthSports = (data) => {
return request({
url: 'health/sports',
data: data
})
}
/**
* @description:添加运动
* @Date: 2022-01-19 13点27分
*/
const addHealthSports = (data) => {
return request({
url: 'health/exercises',
method: 'POST',
data: data
})
}
/**
* @description:编辑运动
* @Date: 2022-01-19 17:15:31
*/
const editHealthSports = (data) => {
return request({
url: `health/exercises/${data.exercise_id}`,
method: 'PUT',
data: data
})
}
/**
* @description: 删除运动
* @Date: 2022-01-20 09:12:35
*/
const delHealthSports = (data) => {
return request({
url: `health/exercises/${data.exercise_id}`,
method: 'DELETE'
})
}
export {
healthSports,
addHealthSports,
editHealthSports,
delHealthSports
}

View File

@@ -1,53 +0,0 @@
/**
* Web唐明明
* 匆匆数载恍如梦,岁月迢迢华发增。
* 碌碌无为枉半生,一朝惊醒万事空。
* moduleName: 话题
*/
import { request } from '../index'
// 首页
const index = () =>{
return request({
url: 'health/discover'
})
}
// 列表
const lists = (data) =>{
return request({
url: 'health/topics',
data: data
})
}
// 分类
const categories = () =>{
return request({
url: 'health/topics/categories'
})
}
// 详情
const topicDet = (topic) =>{
return request({
url: 'health/topics/' + topic
})
}
// 点赞
const topicThumb = (topic) =>{
return request({
url: 'health/topics/' + topic + '/favorite',
method: 'POST'
})
}
export {
index,
lists,
categories,
topicDet,
topicThumb
}

View File

@@ -14,14 +14,7 @@ const info = () =>{
}) })
} }
// 我的档案
const records = () =>{
return request({
url: 'health/records'
})
}
export { export {
info, info
records
} }

View File

@@ -1,88 +0,0 @@
/**
* Web唐明明
* 匆匆数载恍如梦,岁月迢迢华发增。
* 碌碌无为枉半生,一朝惊醒万事空。
* moduleName: 钱包
*/
import { request } from '../index'
// 设置密码
const security = data => {
return request({
url: 'chain/safe/security',
method: 'POST',
data
})
}
// 获取助记词
const seed = data => {
return request({
url: 'chain/safe/seed',
data
})
}
// 余额
const sum = () => {
return request({
url: 'chain/account/balance'
})
}
// 账户记录
const logs = data => {
return request({
url: 'chain/account/logs',
data
})
}
// 验证密码
const securityCheck = (password) => {
return request({
url : "chain/safe/security/check",
method: 'POST',
data:{
code : password,
}
})
}
// 钱包私钥
const privatekey = (code) => {
return request({
url : "chain/safe/private_key",
data: {
code
}
})
}
// 私钥规则
const keyrules = () => {
return request({
url: 'cms/keyrules'
})
}
// 修改密码
const securityReset = (data) => {
return request({
url : "chain/safe/security",
method: 'PUT',
data:data
})
}
export {
security,
seed,
sum,
logs,
securityCheck,
privatekey,
keyrules,
securityReset
}

View File

@@ -1,45 +0,0 @@
/*
* @Description:称体重模块
* @Author: Aimee·Zhang
* @Date: 2022-01-12 16:24:28
* @LastEditors: Aimee·Zhang
* @LastEditTime: 2022-01-12 17:13:45
*/
import { request } from '../index'
/**
* @description:称量体重模块首页
*/
const weights = (page) => {
return request({
url: 'health/weights',
data: { page: page }
})
}
/**
* @description:获取曲线进度
*/
const curves = () => {
return request({
url: 'health/weights/bight'
})
}
/**
* @description:记录体重
* @Date: 2022-01-12 16:46:19
*/
const addWeight = (data) => {
return request({
url: 'health/weights',
method: 'POST',
data: data
})
}
export {
weights,
addWeight,
curves
}

View File

@@ -158,109 +158,6 @@
"navigationBarBackgroundColor": "#FFFFFF" "navigationBarBackgroundColor": "#FFFFFF"
} }
}, },
{
"path": "pages/notice/index",
"name": "noticeIndex",
"style": {
"navigationBarTitleText": "消息",
"navigationBarBackgroundColor": "#FFFFFF"
}
},
{
"path": "pages/notice/list",
"name": "noticeList",
"style": {
"navigationBarTitleText": "消息",
"navigationBarBackgroundColor": "#FFFFFF"
}
},
{
"path": "pages/notice/details",
"name": "noticeDetails",
"style": {
"navigationBarTitleText": "消息",
"navigationBarBackgroundColor": "#FFFFFF"
}
},
{
"path": "pages/wallet/add",
"name": "WalletAdd",
"style": {
"navigationBarTitleText": "创建钱包",
"navigationBarBackgroundColor": "#FFFFFF",
"enablePullDownRefresh": false
}
},
{
"path": "pages/wallet/create",
"name": "WalletCreate",
"style": {
"navigationBarTitleText": "设置密码",
"navigationBarBackgroundColor": "#FFFFFF",
"enablePullDownRefresh": false
}
},
{
"path": "pages/wallet/mnemonic",
"name": "WalletMnemonic",
"style": {
"navigationBarTitleText": "导出助记词",
"navigationBarBackgroundColor": "#FFFFFF",
"enablePullDownRefresh": false
}
},
{
"path": "pages/wallet/validation",
"name": "WalletValidation",
"style": {
"navigationBarTitleText": "验证助记词",
"navigationBarBackgroundColor": "#FFFFFF",
"enablePullDownRefresh": false
}
},
{
"path": "pages/wallet/property",
"name": "WalletProperty",
"style": {
"navigationBarTitleText": "ZH钱包",
"navigationBarTextStyle": "white",
"app-plus": {
"titleNView": {
"backgroundImage": "linear-gradient(to right, #34ce98, #22aa98)",
"type": "transparent",
"buttons": [{
"float": "right",
"text": "\ue607",
"fontSrc": "/static/iconfont.ttf",
"color": "#FFF",
"fontSize": "20px",
"background": "rgba(0,0,0,0)"
}],
"backButton": {
"background": "rgba(0,0,0,0)"
}
}
}
}
},
{
"path": "pages/wallet/privatekey",
"name": "WalletPrivatekey",
"style": {
"navigationBarTitleText": "钱包私钥",
"navigationBarBackgroundColor": "#FFFFFF",
"enablePullDownRefresh": false
}
},
{
"path": "pages/wallet/resetPassword",
"name": "ResetPassword",
"style": {
"navigationBarTitleText": "修改钱包密码",
"navigationBarBackgroundColor": "#FFFFFF",
"enablePullDownRefresh": false
}
},
{ {
"path": "pages/store/search", "path": "pages/store/search",
"name": "StoreSearch", "name": "StoreSearch",
@@ -281,14 +178,27 @@
"name": "AccountIntegral", "name": "AccountIntegral",
"style": { "style": {
"navigationBarTitleText": "共力值", "navigationBarTitleText": "共力值",
"navigationBarBackgroundColor": "#FFFFFF" "navigationBarBackgroundColor": "#34CE98",
"navigationBarTextStyle": "white"
} }
}, { }, {
"path": "pages/account/dt", "path": "pages/account/dt",
"name": "AccountDt", "name": "AccountDt",
"style": { "style": {
"navigationBarTitleText": "DT积分", "navigationBarTitleText": "DT积分",
"navigationBarBackgroundColor": "#FFFFFF" "navigationBarBackgroundColor": "#34CE98",
"backgroundColorTop": "#34CE98",
"navigationBarTextStyle": "white",
"app-plus": {
"titleNView": {
"buttons": [{
"text": "充值",
"width": "60",
"fontSize": "14",
"fontWeight": "bold"
}]
}
}
} }
}, { }, {
"path": "pages/account/recharge", "path": "pages/account/recharge",
@@ -298,25 +208,23 @@
"navigationBarBackgroundColor": "#FFFFFF" "navigationBarBackgroundColor": "#FFFFFF"
} }
}, { }, {
"path": "pages/vip/vip", "path": "pages/vip/vip",
"name": "Vip", "name": "Vip",
"style": { "style": {
"navigationBarTitleText": "共力会员", "navigationBarTitleText": "共力会员",
"navigationBarBackgroundColor": "#242430", "navigationBarBackgroundColor": "#242430",
"navigationBarTextStyle": "white", "navigationBarTextStyle": "white",
"backgroundColorTop": "#242430" "backgroundColorTop": "#242430"
} }
}, {
"path": "pages/vip/agreement",
"style": {
"navigationBarTitleText": "",
"enablePullDownRefresh": false
}
} }
,{ ],
"path" : "pages/vip/agreement",
"style" :
{
"navigationBarTitleText": "",
"enablePullDownRefresh": false
}
}
],
"tabBar": { "tabBar": {
"borderStyle": "white", "borderStyle": "white",
"selectedColor": "#34CE98", "selectedColor": "#34CE98",

View File

@@ -1,7 +1,35 @@
<template> <template>
<view> <view class="content">
账户 <view class="dt-header">
<button @click="onNav">充值</button> <view class="title">DT积分余额</view>
<view class="num">0.00</view>
</view>
<view class="logs-title">账户记录</view>
<view class="logs-item">
<view class="logs-item-title">账户充值</view>
<view class="logs-item-time">2022-06-07 10:10:51</view>
<view class="logs-item-price add">+1000.0</view>
</view>
<view class="logs-item">
<view class="logs-item-title">账户充值</view>
<view class="logs-item-time">2022-06-07 10:10:51</view>
<view class="logs-item-price remove">-1000.0</view>
</view>
<view class="logs-item">
<view class="logs-item-title">账户充值</view>
<view class="logs-item-time">2022-06-07 10:10:51</view>
<view class="logs-item-price remove">-1000.0</view>
</view>
<view class="logs-item">
<view class="logs-item-title">账户充值</view>
<view class="logs-item-time">2022-06-07 10:10:51</view>
<view class="logs-item-price remove">-1000.0</view>
</view>
<view class="logs-item">
<view class="logs-item-title">账户充值</view>
<view class="logs-item-time">2022-06-07 10:10:51</view>
<view class="logs-item-price remove">-1000.0</view>
</view>
</view> </view>
</template> </template>
@@ -13,13 +41,74 @@
}; };
}, },
methods: { methods: {
onNav(){
this.$Router.push({name: 'AccountRecharge'}) },
} onNavigationBarButtonTap() {
this.$Router.push({name: 'AccountRecharge'})
} }
} }
</script> </script>
<style lang="scss"> <style lang="scss">
.content{
background: $window-color;
min-height: 100vh;
.dt-header{
background: $main-color;
padding: $padding*3 $padding $padding*2;
.title{
color: rgba(255, 255, 255, .9);
font-size: 28rpx;
}
.num{
font-weight: bold;
font-size: 60rpx;
padding-top: 10rpx;
color: white;
}
}
// 账户记录
.logs-title{
padding: 0 $padding;
font-weight: bold;
line-height: 90rpx;
color: #333;
font-size: 30rpx;
}
.logs-item{
position: relative;
background: white;
border-radius: $radius;
padding: $padding - 10 $padding;
padding-right: 240rpx;
box-sizing: border-box;
margin: 0 $margin ($margin - 10);
.logs-item-title{
font-weight: bold;
font-size: 30rpx;
line-height: 50rpx;
}
.logs-item-time{
font-size: 28rpx;
line-height: 40rpx;
color: gray;
}
.logs-item-price{
position: absolute;
right: $padding;
top: $padding - 10;
line-height: 90rpx;
width: 180rpx;
text-align: right;
font-weight: bold;
@extend .nowrap;
&.add{
color: $main-color;
}
&.remove{
color: $text-price;
}
}
}
}
</style> </style>

View File

@@ -1,6 +1,35 @@
<template> <template>
<view> <view class="content">
共力值 <view class="dt-header">
<view class="title">共力值余额</view>
<view class="num">0.00</view>
</view>
<view class="logs-title">账户记录</view>
<view class="logs-item">
<view class="logs-item-title">账户充值</view>
<view class="logs-item-time">2022-06-07 10:10:51</view>
<view class="logs-item-price add">+1000.0</view>
</view>
<view class="logs-item">
<view class="logs-item-title">账户充值</view>
<view class="logs-item-time">2022-06-07 10:10:51</view>
<view class="logs-item-price remove">-1000.0</view>
</view>
<view class="logs-item">
<view class="logs-item-title">账户充值</view>
<view class="logs-item-time">2022-06-07 10:10:51</view>
<view class="logs-item-price remove">-1000.0</view>
</view>
<view class="logs-item">
<view class="logs-item-title">账户充值</view>
<view class="logs-item-time">2022-06-07 10:10:51</view>
<view class="logs-item-price remove">-1000.0</view>
</view>
<view class="logs-item">
<view class="logs-item-title">账户充值</view>
<view class="logs-item-time">2022-06-07 10:10:51</view>
<view class="logs-item-price remove">-1000.0</view>
</view>
</view> </view>
</template> </template>
@@ -10,10 +39,76 @@
return { return {
}; };
},
methods: {
},
onNavigationBarButtonTap() {
this.$Router.push({name: 'AccountRecharge'})
} }
} }
</script> </script>
<style lang="scss"> <style lang="scss">
.content{
background: $window-color;
min-height: 100vh;
.dt-header{
background: $main-color;
padding: $padding*3 $padding $padding*2;
.title{
color: rgba(255, 255, 255, .9);
font-size: 28rpx;
}
.num{
font-weight: bold;
font-size: 60rpx;
padding-top: 10rpx;
color: white;
}
}
// 账户记录
.logs-title{
padding: 0 $padding;
font-weight: bold;
line-height: 90rpx;
color: #333;
font-size: 30rpx;
}
.logs-item{
position: relative;
background: white;
border-radius: $radius;
padding: $padding - 10 $padding;
padding-right: 240rpx;
box-sizing: border-box;
margin: 0 $margin ($margin - 10);
.logs-item-title{
font-weight: bold;
font-size: 30rpx;
line-height: 50rpx;
}
.logs-item-time{
font-size: 28rpx;
line-height: 40rpx;
color: gray;
}
.logs-item-price{
position: absolute;
right: $padding;
top: $padding - 10;
line-height: 90rpx;
width: 180rpx;
text-align: right;
font-weight: bold;
@extend .nowrap;
&.add{
color: $main-color;
}
&.remove{
color: $text-price;
}
}
}
}
</style> </style>

View File

@@ -1,101 +0,0 @@
<template>
<view class="content">
<view class="tips">
<view class="noticeImg" :class="{active : noticeData.type == 'SystemNotification'}">
<block v-if="noticeData.type == 'SystemNotification'">
<u-icon name="bell-fill" color="#77e79f" size="20" bold style="padding: 14rpx"></u-icon>
</block>
<block v-else>
<u-icon name="calendar-fill" color="#f1a166" size="20" bold style="padding: 14rpx"></u-icon>
</block>
</view>
<view class="noticeBox">
<view class="noticeTitle">
{{ noticeData.type == 'SystemNotification' ? '系统通知' : '订单通知'}}
</view>
<view class="contant">
<view class="title">
{{ noticeData.title }}
</view>
<view class="text">
时间:{{ noticeData.created_at }}
</view>
<view class="text">
{{ noticeData.content }}
</view>
</view>
</view>
</view>
</view>
</template>
<script>
import { noticeDet } from '@/apis/interfaces/notice'
export default {
data() {
return {
noticeData : ''
};
},
mounted() {
// 获取列表
this.getDet()
},
methods: {
// 列表
getDet(){
noticeDet(this.$Route.query.id).then(res => {
this.noticeData = res
})
}
}
};
</script>
<style lang="scss" scoped>
.content {
background-color: $window-color;
min-height: 100vh;
}
.tips {
padding: $padding;
box-sizing: border-box;
position: relative;
.noticeImg {
width: 64rpx;
height: 64rpx;
text-align: center;
border-radius: 50%;
background-color: #ffefe2;
&.active {
background-color: #e7f8f0;
}
}
.noticeBox {
position: absolute;
left: 0;
top: 0;
width: 100%;
padding: $padding + 10 $padding $padding $padding + 90rpx;
box-sizing: border-box;
.noticeTitle {
margin-bottom: $margin;
}
.contant {
background-color: white;
padding: $padding $padding - 10;
box-sizing: border-box;
border-radius: $radius;
.title {
font-weight: bold;
margin-bottom: $margin;
}
.text {
line-height: 48rpx;
font-size: $title-size-m;
color: $text-gray;
}
}
}
}
</style>

View File

@@ -1,103 +0,0 @@
<template>
<view class="content">
<view class="noticeList" v-for="(item, index) in tabArr" :key="index" @click="$Router.push({ name: 'noticeList', params: {type: item.type }})" >
<view class="noticeImg" :class="{active : item.count != 0}">
<block v-if="item.type == 'SystemNotification'">
<u-icon name="bell-fill" color="#77e79f" size="22" bold style="padding: 14rpx"></u-icon>
</block>
<block v-else>
<u-icon name="calendar-fill" color="#f1a166" size="22" bold style="padding: 14rpx"></u-icon>
</block>
</view>
<view class="noticeCont">
<view class="name">
{{ item.name }}
</view>
<view class="nowrap text">
{{ item.type == 'SystemNotification' ? 'APP特色功能介绍、官方推进、活动通知' : '商品订单购买成功、发货成功、退货' }}
</view>
</view>
</view>
</view>
</template>
<script>
import { categories } from '@/apis/interfaces/notice'
export default {
data() {
return {
tabArr : []
};
},
mounted() {
// 获取分类
this.getNotice()
},
methods: {
// 分类
getNotice(){
categories().then(res => {
this.tabArr = res
})
}
}
};
</script>
<style lang="scss" scoped>
.content {
padding: $padding;
box-sizing: border-box;
background-color: $window-color;
min-height: 100vh;
}
.noticeList {
padding: $padding;
box-sizing: border-box;
position: relative;
background-color: white;
margin-bottom: $margin;
border-radius: $radius;
height: 146rpx;
&:first-child {
.noticeImg {
background-color: #e7f8f0;
}
}
.noticeImg {
width: 68rpx;
height: 68rpx;
text-align: center;
border-radius: 50%;
margin-top: $margin - 20;
background-color: #ffefe2;
position: relative;
&.active::after {
position: absolute;
content: '';
top: $margin - 25;
right: 0;
width: 12rpx;
height: 12rpx;
border-radius: 50%;
background-color: $text-price;
}
}
.noticeCont {
position: absolute;
left: 0;
top: 0;
width: 100%;
padding: $padding $padding 0 $padding + 100rpx;
.name {
font-weight: bold;
font-size: $title-size-lg;
}
.text {
margin-top: $margin - 20;
font-size: $title-size-sm;
}
}
}
</style>

View File

@@ -1,109 +0,0 @@
<template>
<view class="content">
<view class="box" v-if="listArr.length > 0">
<view class="list" v-for="(item, index) in listArr" @click="$Router.push({ name: 'noticeDetails', params: {id: item.notification_id }})">
<view class="title">
{{ item.title }}
</view>
<view class="text">
{{ item.content }}<view class="more">点我查看<u-icon name="arrow-right-double" color="#34CE98" bold size="14" style="display: inline-block;"></u-icon></view>
</view>
</view>
<block v-if="page.total_page > 1">
<u-loadmore :status="status" />
</block>
</view>
<view class="noMessage" v-else>
<u-empty
mode="message"
/>
</view>
</view>
</template>
<script>
import { lists } from '@/apis/interfaces/notice'
export default {
data() {
return {
listArr : [],
status : 'loadmore',
page : ''
};
},
mounted() {
// 获取列表
this.getList()
},
methods: {
// 列表
getList(pages){
lists(this.$Route.query.type, {
page: pages
}).then(res => {
if(res.page.current == 1){
this.listArr = []
}
this.listArr = this.listArr.concat(res.data)
this.status = this.page.has_more ? 'loadmore': 'nomore'
this.page = res.page
})
}
},
// 下拉加载
onReachBottom() {
if(this.page.has_more){
this.status = 'loading'
let pages = this.page.current + 1
// 获取列表
this.getList(pages)
return
}
this.status = 'nomore'
}
};
</script>
<style lang="scss" scoped>
.content {
background-color: $window-color;
min-height: 100vh;
}
.box {
padding: $padding;
box-sizing: border-box;
.list {
padding: $padding;
box-sizing: border-box;
border-radius: $radius;
background-color: white;
margin-bottom: $margin;
.title {
font-size: $title-size-lg;
margin-bottom: $margin - 10;
font-weight: bold;
}
.text {
font-size: $title-size-m;
color: $text-gray-m;
.more {
color: $main-color;
padding-left: $padding - 10;
}
}
}
}
.noMessage {
background-color: white;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-box-pack: center;
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
}
</style>

View File

@@ -1,257 +0,0 @@
<template>
<view class="content">
<image class="setting" src="/static/find/sign_img.png" mode="widthFix"></image>
<view class="sign">
<view class="signAdd">
<view class="label">
<image class="picture" src="/static/find/sign.png" mode="aspectFill"></image>
<view class="label-day">
<view class="number">
<text>{{ dateData.total }}</text>
</view>
本月打卡
</view>
</view>
<view class="label">
<image class="picture" src="/static/find/sign_active.png" mode="aspectFill"></image>
<view class="label-day">
<view class="number">
<text>{{ dateData.continue }}</text>
</view>
累计打卡
</view>
</view>
</view>
<view class="signDate">
<view class="date">
{{ dateData.month }}
</view>
<view class="list">
<view class="week">
<view class="week-label">
</view>
<view class="week-label">
</view>
<view class="week-label">
</view>
<view class="week-label">
</view>
<view class="week-label">
</view>
<view class="week-label">
</view>
<view class="week-label">
</view>
</view>
<view class="day" v-for="(item, index) in dateArr" :key="index">
<view class="day-label" v-for="(items, index) in item" :key="index">
<view class="label-block" :class="{active : items.isSign}" v-if="!items.isHidden">
<uni-icons v-if="items.isSign" class="search-icon" custom-prefix="iconfont" type="icon-dui" color="#ffffff" size="18"></uni-icons>
<block v-else>{{ items.date }}</block>
</view>
</view>
</view>
</view>
<view class="signBtn">
<view class="btn" @click="signClick" :class="{active : dateData.isSign}">
{{ dateData.isSign ? '今日已打卡' : '今日打卡'}}
</view>
</view>
</view>
<view class="tipsText">
ZH大健康用户打卡
</view>
</view>
</view>
</template>
<script>
import { date, sign } from '@/apis/interfaces/sign'
export default {
data() {
return {
dateData: '',
dateArr : ''
}
},
mounted() {
this.dateList();
},
methods: {
// 用户登录
dateList() {
date().then(res => {
this.dateData = res.base
this.dateArr = res.calendar
}).catch(err => {
uni.showToast({
title: err.message,
icon: "none"
})
})
},
// 签到
signClick() {
sign().then(res => {
console.log(res)
uni.showToast({
title: '签到成功',
icon: "none"
})
this.dateList();
}).catch(err => {
console.log(err)
uni.showToast({
title: err.message,
icon: "none"
})
})
}
}
}
</script>
<style lang="scss" scoped>
page {
background: $window-color;
height: 100vh;
}
.setting {
width: 100%;
}
.sign {
z-index: 9;
left: 0;
top: 0;
width: 100%;
padding: 0 $padding + 20;
margin-top: -$margin * 2.5;
position: relative;
box-sizing: border-box;
.signTitle {
padding: $padding * 3;
font-size: $title-size + 20;
color: #48988d;
font-weight: 600;
text-align: center;
}
.signAdd {
padding: $padding $padding * 2.5;
box-sizing: border-box;
border-radius: $radius-m;
background-color: white;
margin-bottom: $margin;
display: flex;
.label {
display: flex;
font-size: $title-size-sm;
.picture {
width: 74rpx;
height: 74rpx;
margin-right: $margin - 10;
}
.label-day {
color: $text-gray;
text {
font-size: $title-size-lg;
color: $text-color;
font-weight: 600;
padding-right: $padding - 20;
}
}
&:first-child {
flex: 1;
.label-day {
text {
color: $main-color;
}
}
}
}
}
.signDate {
padding: $padding;
border-radius: $radius-m;
background-color: white;
.date {
text-align: center;
font-size: $title-size + 6;
margin-bottom: $margin;
font-weight: 600;
}
.list {
.week {
display: flex;
.week-label {
text-align: center;
font-size: $title-size-m;
width: 14.28%;
margin: $margin - 10 0;
}
}
.day {
flex-wrap: wrap;
display: flex;
.day-label {
width: 14.28%;
text-align: center;
line-height: 80rpx;
color: $text-color;
font-size: $title-size-m;
.label-block {
display: inline-block;
background-color: transparent;
color: $text-gray-m;
border-radius: 50%;
width: 56rpx;
height: 56rpx;
line-height: 56rpx;
text-align: center;
position: relative;
.label-icon {
position: absolute;
left: 10rpx;
top: 0;
}
&.active {
background-color: $main-color;
color: white;
border-radius: 50%;
}
}
}
}
}
.signBtn {
padding: $padding * 2 $padding * 2 0;
.btn {
color: white;
background-color: $text-price;
text-align: center;
border-radius: $radius-m;
line-height: 90rpx;
&.active {
background-color: #ededed;
color: $text-gray;
}
}
}
}
.tipsText {
text-align: center;
line-height: 120rpx;
font-size: $title-size-sm;
color: $text-gray-m;
}
}
</style>

View File

@@ -1,68 +0,0 @@
<template>
<view class="content vertical">
<!-- logo -->
<image class="logo" src="@/static/wallet/logo.png" mode="widthFix"></image>
<!-- 副标题 -->
<view class="sub-title">激活您的ZH健康钱包获取钱包地址地址可以理解为您的个人银行卡卡号</view>
<!-- 按钮 -->
<view class="wallet-btn" @click="$Router.replace({name: 'WalletCreate'})">激活钱包</view>
</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: 20vh;
}
.sub-title {
font-size: $title-size-m;
color: $text-gray;
}
.wallet-btn {
width: 100%;
background-color: $main-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: $main-color;
border: solid 2rpx $main-color;
box-sizing: border-box;
}
}
}
</style>

View File

@@ -1,193 +0,0 @@
<template>
<view>
<!-- 设置钱包密码 -->
<view class="password">
<view class="prompt">请设置6位数字密码建议不要使用连续的数字</view>
<view class="group">
<view class="inputs" @click="onShowKet('password')">
<block v-if="password.length > 0">
<text v-for="item in password.length" :key="item"></text>
</block>
<block v-if="keyShow && valKye === 'password'">
<text class="flicker-animation">|</text>
</block>
<block v-else>
<text v-if="password.length === 0" class="placeholder">请设置密码</text>
</block>
</view>
<view class="inputs" :class="{'hide': verify === ''}" @click="onShowKet('verify')">
<block v-if="verify.length > 0">
<text v-for="item in verify.length" :key="item"></text>
</block>
<block v-if="keyShow && valKye === 'verify'">
<text class="flicker-animation">|</text>
</block>
<block v-else>
<text v-if="verify.length === 0" class="placeholder">请确认密码</text>
</block>
</view>
</view>
</view>
<!-- key键盘 -->
<u-keyboard mode="number" random dotDisabled :overlay="false" :show="keyShow" :showCancel="false"
@change="keyValChange" @backspace="keyValBackspace" @confirm="keyShow = false"></u-keyboard>
<!-- 按钮 -->
<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: '',
valKye: '',
keyShow: false
};
},
methods: {
// 唤起key
onShowKet(key) {
this.valKye = key
this.keyShow = true
},
// 键盘输入
keyValChange(e) {
if (this[this.valKye].length >= 6) return
this[this.valKye] += e
},
// 键盘删除
keyValBackspace(e) {
if (this[this.valKye].length) this[this.valKye] = this[this.valKye].substr(0, this[this.valKye].length -
1)
},
// 激活钱包
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: Number(this.password)
}).then(res => {
this.$Router.replace({
name: 'WalletProperty'
})
}).catch(err => {
uni.showToast({
icon: 'none',
title: err.message
});
});
}
}
};
</script>
<style>
.flicker-animation {
animation: flicker .8s infinite;
}
@keyframes flicker {
0% {
opacity: 0;
}
100 {
opacity: 1;
}
}
</style>
<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: $main-color;
text-align: center;
}
.group {
padding-top: $padding;
.inputs {
padding: 10rpx $padding + 10;
margin-top: $margin;
border-radius: $radius-m;
background-color: $window-color;
height: 70rpx;
line-height: 70rpx;
font-size: $title-size-lg;
text-align: center;
text {
padding: 0 10rpx;
text-align: center;
}
.placeholder {
color: $text-gray;
}
}
}
}
// 按钮
.buttons {
padding: $padding * 2;
.text {
text-align: center;
line-height: 90rpx;
height: 90rpx;
margin-bottom: $margin * 2;
font-size: $title-size-lg;
color: $main-color;
font-weight: bold;
}
button {
height: 90rpx;
line-height: 90rpx;
background-color: $main-color;
border-radius: $radius-m;
color: white;
font-weight: bold;
font-size: $title-size;
&::after {
display: none;
}
}
}
</style>

View File

@@ -1,122 +0,0 @@
<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">验证助记词</button> -->
</view>
</view>
</template>
<script>
import {
seed
} from "@/apis/interfaces/wallet"
export default {
data() {
return {
mnemonic: []
}
},
mounted() {
seed({
code: this.$Route.query.password
}).then(res => {
this.mnemonic = res.seed.split(' ')
}).catch(err => {
uni.showToast({
icon: 'none',
title: err.message
})
})
},
methods: {
goto() {
this.$Router.replace({
name: 'WalletValidation',
params: {
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: $main-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;
padding: 0 $padding/2;
line-height: 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-m;
color: $text-price;
}
button {
height: 90rpx;
line-height: 90rpx;
background-color: $main-color;
border-radius: $radius-lg;
color: white;
font-weight: bold;
font-size: $title-size;
&::after {
display: none;
}
}
}
</style>

View File

@@ -1,130 +0,0 @@
<template>
<view>
<!-- 私钥 -->
<view class="keys">
<view class="title">您的ZH托管钱包</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: [{
title: "什么是托管钱包?",
description: "托管钱包顾名思义就是用户把私钥和数字资产委托给其他机构管理,也就是就是通过中心化的方式安全管理并保存资产,本质上是与区块链所追求的去中心化相背离的。"
},
{
title: "什么是钱包私钥?",
description: "作为管理和使用加密货币最关键的东西,私钥对所有数字货币用户而言具有所有权,拥有私钥才能支配相应的加密资产。"
}
]
};
},
mounted() {
privatekey(this.$Route.query.password).then(res => {
this.key = res.private_key
}).catch(err => {
uni.showToast({
title: err.message,
icon: 'none'
})
})
},
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: $main-color;
word-wrap: break-word;
}
.copykey {
background-color: $main-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;
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>

View File

@@ -1,386 +0,0 @@
<template>
<view>
<view class="propery">
<view class="propery-content">
<view class="currency">钱包余额</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" />
<!-- ios安全距离 -->
<view class="ios-bottom"></view>
</view>
<!-- 钱包密码 -->
<u-popup :show="passwordShow" @close="resetPassword" mode="center" round="10" borderRadius="10">
<view class="validationPassword">
<view class="from">
<view class="title">验证钱包密码</view>
<view class="inputs">
<text v-for="item in password.length" :key="item"></text>
<text class="flicker-animation">|</text>
</view>
</view>
</view>
</u-popup>
<!-- key -->
<u-keyboard mode="number" random dotDisabled :overlay="false" :show="passwordShow" confirmText="验证"
@change="keyValChange" @backspace="keyValBackspace" @confirm="payPassword('confirm', passwordPages)"
@cancel="passwordShow = false"></u-keyboard>
</view>
</template>
<script>
import record from '@/components/property/record'
import {
sum,
logs,
securityCheck
} from '@/apis/interfaces/wallet'
export default {
components: {
record
},
data() {
return {
balance: {},
logs: [],
logsType: 0,
password: '',
passwordShow: false,
passwordPages: ''
};
},
onShow() {
Promise.all([
sum(),
logs()
]).then(res => {
this.balance = res[0]
this.logs = res[1]
}).catch(err => {
uni.showToast({
icon: 'none',
title: err.message
})
})
},
methods: {
// 键盘输入
keyValChange(e) {
if (this.password.length >= 6) return
this.password += e
},
// 键盘删除
keyValBackspace(e) {
if (this.password.length) this.password = this.password.substr(0, this.password.length - 1)
},
// 弹出私钥
showPrivatekey(pages) {
this.passwordShow = true
this.passwordPages = pages
},
// 重置密码
resetPassword() {
this.passwordShow = false
this.password = ''
},
// 验证私钥
payPassword(type) {
if (type === 'confirm') {
if (this.password === '') {
uni.showToast({
title: '请输入安全密码',
icon: 'none'
})
return
}
securityCheck(this.password).then(res => {
switch (this.passwordPages) {
case 'privatekey':
this.$Router.push({
name: 'WalletPrivatekey',
params: {
password: this.password
}
})
break;
case 'ResetPassword':
this.$Router.push({
name: 'ResetPassword',
params: {
password: this.password
}
})
break;
case 'WalletMnemonic':
this.$Router.push({
name: 'WalletMnemonic',
params: {
password: this.password
}
})
break;
}
this.resetPassword()
}).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: this.balance.address,
cancelText: '复制',
cancelColor: '#009B69',
success: (res) => {
if (res.cancel) {
uni.setClipboardData({
data: this.balance.address
})
}
}
})
}
},
onNavigationBarButtonTap(e) {
if (e.index === 0) {
uni.showActionSheet({
itemList: ['导出助记词', '修改密码'],
success: (res) => {
switch (res.tapIndex) {
case 0:
this.showPrivatekey('WalletMnemonic')
break;
case 1:
this.showPrivatekey('ResetPassword')
break;
}
uni.hideLoading()
}
})
}
}
}
</script>
<style>
.flicker-animation {
animation: flicker .8s infinite;
}
@keyframes flicker {
0% {
opacity: 0;
}
100 {
opacity: 1;
}
}
</style>
<style lang="scss" scoped>
// 验证密码弹出层
.validationPassword {
width: 80vw;
.from {
padding: $padding*2;
text-align: center;
.title {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
font-weight: bold;
font-size: $title-size;
padding-bottom: $padding;
}
// input{
// background: $window-color;
// height: 90rpx;
// left: 90rpx;
// font-size: $title-size-lg;
// border-radius: 45rpx;
// }
.inputs {
background-color: $window-color;
height: 90rpx;
line-height: 90rpx;
border-radius: 45rpx;
font-size: $title-size-lg;
text-align: center;
text {
padding: 0 10rpx;
text-align: center;
}
.placeholder {
color: $text-gray;
}
}
}
.buttons {
text-align: center;
padding: 0 $padding*2;
.button {
height: 90rpx;
line-height: 90rpx;
margin-bottom: $margin;
&.cancel {
color: $text-gray;
}
&.confirm {
color: white;
background: $main-color;
border-radius: 45rpx;
}
}
}
//
//
}
// 账户
.propery {
position: relative;
padding-top: var(--status-bar-height);
background-image: linear-gradient(to right, $main-color, #22aa98);
&::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 * 5 $padding * 2;
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: $main-color;
margin: 0 $margin;
border-radius: $radius-m;
font-size: $title-size-lg;
}
}
}
}
// 记录
.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: $main-color;
&::before {
position: absolute;
bottom: 0;
left: $padding;
right: $padding;
height: 4rpx;
content: " ";
background-color: $main-color;
}
}
}
}
}
</style>

View File

@@ -1,203 +0,0 @@
<template>
<view>
<!-- 设置钱包密码 -->
<view class="password">
<view class="prompt">请设置6位数字密码建议不要使用连续的数字</view>
<view class="group">
<view class="inputs" @click="onShowKet('password')">
<block v-if="password.length > 0">
<text v-for="item in password.length" :key="item"></text>
</block>
<block v-if="keyShow && valKye === 'password'">
<text class="flicker-animation">|</text>
</block>
<block v-else>
<text v-if="password.length === 0" class="placeholder">请设置密码</text>
</block>
</view>
<view class="inputs" :class="{'hide': verify === ''}" @click="onShowKet('verify')">
<block v-if="verify.length > 0">
<text v-for="item in verify.length" :key="item"></text>
</block>
<block v-if="keyShow && valKye === 'verify'">
<text class="flicker-animation">|</text>
</block>
<block v-else>
<text v-if="verify.length === 0" class="placeholder">请确认密码</text>
</block>
</view>
</view>
</view>
<!-- key键盘 -->
<u-keyboard mode="number" random dotDisabled :overlay="false" :show="keyShow" :showCancel="false"
@change="keyValChange" @backspace="keyValBackspace" @confirm="keyShow = false"></u-keyboard>
<!-- 按钮 -->
<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: '',
valKye: '',
keyShow: false
}
},
onLoad() {
this.oldPassword = this.$Route.query.password
},
methods: {
// 唤起key
onShowKet(key) {
this.valKye = key
this.keyShow = true
},
// 键盘输入
keyValChange(e) {
if (this[this.valKye].length >= 6) return
this[this.valKye] += e
},
// 键盘删除
keyValBackspace(e) {
if (this[this.valKye].length) this[this.valKye] = this[this.valKye].substr(0, this[this.valKye].length -
1)
},
// 修改密码
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,
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>
.flicker-animation {
animation: flicker .8s infinite;
}
@keyframes flicker {
0% {
opacity: 0;
}
100 {
opacity: 1;
}
}
</style>
<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: $main-color;
text-align: center;
}
.group {
padding-top: $padding;
.inputs {
padding: 10rpx $padding + 10;
margin-top: $margin;
border-radius: $radius-m;
background-color: $window-color;
height: 70rpx;
line-height: 70rpx;
font-size: $title-size-lg;
text-align: center;
text {
padding: 0 10rpx;
text-align: center;
}
.placeholder {
color: $text-gray;
}
}
}
}
// 按钮
.buttons {
padding: $padding * 2;
.text {
text-align: center;
line-height: 90rpx;
height: 90rpx;
margin-bottom: $margin * 2;
font-size: $title-size-lg;
color: $main-color;
font-weight: bold;
}
button {
height: 90rpx;
line-height: 90rpx;
background-color: $main-color;
border-radius: $radius-m;
color: white;
font-weight: bold;
font-size: $title-size;
&::after {
display: none;
}
}
}
</style>

View File

@@ -1,178 +0,0 @@
<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(12).fill(null), // 验证key
mnemonic: [], // 助记词key
sign: '', // 助记词校验签名
seedString: '', // 助记词原词
}
},
mounted() {
let seed = this.$Route.query.seed.split(',')
seed.sort(() => {
return Math.random() - .5
});
console.log(seed)
// this.mnemonic = seed
// this.sign = this.$Route.query.sign
// this.seedString = this.$Route.query.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: $main-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);
min-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: $text-price;
}
button {
height: 90rpx;
line-height: 90rpx;
background-color: $main-color;
border-radius: $radius-lg;
color: white;
font-weight: bold;
font-size: $title-size;
&[disabled] {
background: rgba($color: $main-color, $alpha: .8);
}
}
}
</style>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long