This commit is contained in:
zhangmanman
2021-09-27 14:59:58 +08:00
21 changed files with 181 additions and 1445 deletions

View File

@@ -1,62 +0,0 @@
/**
* zdx
* moduleName: 地址
*/
import { request } from '../index'
// 地址列表
const addresses = () => {
return request({
url: 'mall/addresses',
method: 'GET'
})
}
// 新增地址
const addAddresses = (data) => {
return request({
url: 'mall/addresses',
method: 'post',
data: data
})
}
// 根据地址id获取地址的详细信息
const getAddresses = (id) => {
return request({
url: 'mall/addresses/'+id,
method: 'get'
})
}
// 编辑
const editAddresses = (id,data) => {
return request({
url: 'mall/addresses/'+id,
method: 'put',
data:data
})
}
// 删除
const delAddresses = (id) => {
return request({
url: 'mall/addresses/'+id,
method: 'DELETE'
})
}
// 默认
const defaultAddresses = (id) => {
return request({
url: 'mall/addresses/'+id+'/default',
method: 'post'
})
}
export {
addresses,
addAddresses,
getAddresses,
editAddresses,
delAddresses,
defaultAddresses
}

View File

@@ -8,15 +8,6 @@
import { request } from '../index' import { request } from '../index'
// 一键登录
const keyAuth = (data) => {
return request({
url: 'user/socialite/login/unicloud/app',
method: 'POST',
data: data
})
}
// 验证码登录 // 验证码登录
const smsAuth = (data) =>{ const smsAuth = (data) =>{
return request({ return request({
@@ -36,7 +27,6 @@ const getSms = (data) =>{
} }
export { export {
keyAuth,
smsAuth, smsAuth,
getSms getSms
} }

View File

@@ -8,22 +8,6 @@
import { request } from '../index' import { request } from '../index'
// 企业注册配置信息
const createConfig = () => {
return request({
url: 'companies/inits/create'
})
}
// 企业行业信息
const inits = data => {
return request({
url: 'companies/inits',
method: 'POST',
data
})
}
// 企业认证配置信息 // 企业认证配置信息
const appliesCreate = () => { const appliesCreate = () => {
return request({ return request({
@@ -40,21 +24,6 @@ const applies = (data,method) => {
}) })
} }
// 企业认证前置条件
const isallow = () => {
return request({
url: 'companies/applies/isallow',
method: 'POST'
})
}
// 企业申请状态
const appliesQuery = () => {
return request({
url: 'companies/applies/query'
})
}
// 企业信息展示 // 企业信息展示
const appliesInfo = () => { const appliesInfo = () => {
return request({ return request({
@@ -71,12 +40,8 @@ const appliesCategory = data => {
} }
export { export {
createConfig,
inits,
appliesCreate, appliesCreate,
applies, applies,
isallow,
appliesQuery,
appliesInfo, appliesInfo,
appliesCategory appliesCategory
} }

View File

@@ -1,83 +0,0 @@
/**
* Web-zdx
* moduleName: 优惠券相关
*/
import { request } from '../index'
// 我的优惠券
const myCoupon = (data) => {
return request({
url: 'coupons/user/coupons',
method: 'get',
data: data
})
}
// 优惠券分组列表
const getCouponsListById = (id,data) => {
return request({
url: 'coupons/user/coupons/'+id+'/list',
data:data
})
}
// 根据优惠券id获取优惠券的详情信息
const getCouponsInfoById = (id) => {
return request({
url: 'coupons/user/coupons/'+id,
})
}
// 根据企业id获取企业首页的轮播图列表
const couponsByCompanyId = (data) => {
return request({
url: 'coupons/all',
method: 'get',
data: data
})
}
// 领取优惠券
const couponsGrant = (id) => {
return request({
url: 'coupons/'+id+'/grant',
method: 'POST'
})
}
// 获取优惠券可使用商品
const getGoodsByGrantId = (data) => {
return request({
url: 'user/coupons/goods',
data: data
})
}
// 使用提货券兑换商品
const exchangeGoods = (data) => {
return request({
url: 'user/coupons/exchange',
method: 'POST',
data: data
})
}
// 获取核销二维码
const getQrcodeByGrantId = (data) => {
return request({
url: 'coupons/user/coupons/qrcode',
data: data
})
}
export {
myCoupon,
couponsByCompanyId,
couponsGrant,
getGoodsByGrantId,
exchangeGoods,
getCouponsListById,
getCouponsInfoById,
getQrcodeByGrantId
}

View File

@@ -1,123 +0,0 @@
/**
* Web-zdx
* moduleName: 商城首页
*/
import { request } from '../index'
// 首页信息
const index = () => {
return request({
url: 'mall',
method: 'GET'
})
}
// 今日特惠页面 大于三显示3个 两个显示两个 1个就显示一张图
const indexT = (data) => {
return request({
url: 'mall/goods',
method: 'GET',
data:data
})
}
// 获取首页弹窗
const popups = () => {
return request({
url: 'popups/mall',
method: 'GET'
})
}
const banner = () => {
return request({
url: 'mall/banners',
method: 'GET'
})
}
// 全养头条
const cmsArticles = () => {
return request({
url: 'cms/articles',
method: 'GET'
})
}
// 全养头条详情
const cmsArticlesDetail = (id) => {
return request({
url: 'cms/articles/'+id,
method: 'GET'
})
}
// 获取是否有未读消息
const notifyCounts = () => {
return request({
url: 'notifications/counts',
method: 'GET'
})
}
// 判断是否能跳转到钱包页面
const canGoWallet = () => {
return request({
url: 'user/datas',
method: 'GET'
})
}
// 是否设置了激活激活钱包
const security = () => {
return request({
url: 'chain/safe/security',
method: 'GET'
})
}
// 是否个人认证成功
const certified = () => {
return request({
url: 'user/certified',
method: 'GET'
})
}
// 获取首页商品列表 taos ='淘宝客' goods/mall (自己商品)
const getIndexGoodsList = (name,data) => {
return request({
url: name,
method: 'GET',
data:data
})
}
// 获取淘宝客的标签
const getTaoCategories = () =>{
return request({
url: 'tao/categories',
method: 'GET'
})
}
// 获取自营的标签
const getTags = () =>{
return request({
url: 'mall/tags',
method: 'GET'
})
}
export {
index,
cmsArticles,
notifyCounts,
cmsArticlesDetail,
canGoWallet,
security,
certified,
getIndexGoodsList,
getTaoCategories,
getTags,
banner,
popups,
indexT
}

View File

@@ -97,9 +97,6 @@
}; };
}, },
created(){ created(){
console.log(this.$Route)
// 读取配置信息 // 读取配置信息
appliesCreate().then(res=>{ appliesCreate().then(res=>{
this.industry = res this.industry = res

View File

@@ -1,62 +0,0 @@
<template>
<view class="content">
<image class="cover" src="@/static/dev/guide_cover_00.png" mode="widthFix"></image>
<view class="title">恭喜您已注册成功</view>
<view class="sub-title">开通会员认证企业信息立即获得授信易货额即可开始易货之旅</view>
<button class="vip-button" type="default" @click="$Router.push({name: 'Vip'})">开通会员</button>
</view>
</template>
<script>
export default {
data() {
return {
};
},
onNavigationBarButtonTap(e){
this.$Router.pushTab({name: "Equity"})
},
}
</script>
<style lang="scss" scoped>
.content{
padding: $padding * 2;
background: white;
height: 100vh;
width: 100vw;
box-sizing: border-box;
@extend .vertical;
text-align: center;
.cover{
width: 46vw;
margin-bottom: 10vh;
}
.title{
font-size: $title-size + 14;
font-weight: bold;
line-height: 90rpx;
}
.sub-title{
font-size: $title-size-m;
color: $text-gray;
text-align: center;
}
.vip-button{
margin-top: 10vh;
background: $text-price;
border-radius: 0;
height: 90rpx;
line-height: 90rpx;
font-size: $title-size;
color: white;
font-weight: bold;
&::after{
border: none;
}
}
}
</style>

View File

@@ -1,147 +0,0 @@
<template>
<view class="content">
<view class="header">
<view class="title">企业注册</view>
<view class="subtitle">填写企业基础行业获取企业/商家权益</view>
</view>
<view class="white-box">
<view class="inputs">
<label>企业名称</label>
<input type="text" v-model="name" placeholder="输入企业名称" />
</view>
<view class="inputs">
<label>企业行业</label>
<picker v-if="industry.length > 0" :range="industry" :value="industryIndex" range-key="title" @change="changePicker" data-type="industry">
<view class="picker-text nowrap">
{{industry[industryIndex].title}}
<uni-icons class="picker-icon" type="arrowdown"></uni-icons>
</view>
</picker>
</view>
<view class="btns">
<button type="default" size="default" @click="next">下一步</button>
</view>
</view>
</view>
</template>
<script>
import { createConfig, inits } from '@/apis/interfaces/company'
export default {
data() {
return {
name : "",
industry : [],
industryIndex: 0
};
},
created(){
createConfig().then(res=>{
this.industry = res
})
},
methods:{
// 提交信息
next(){
inits({
name : this.name,
industry_id : this.industry[this.industryIndex].industry_id
}).then(res => {
this.$Router.push({name: 'Prompt'})
}).catch(err => {
uni.showToast({
title: err.message,
icon : 'none'
})
})
},
//选择器
changePicker(e){
let changeType = e.target.dataset.type,
changeVlae = e.detail.value
switch(changeType){
case 'type':
this.typeIndex = changeVlae
break
case 'industry':
this.industryIndex = changeVlae
break
}
}
}
}
</script>
<style lang="scss" scoped>
.content{
.header{
height: 20vh;
@extend .vertical;
.title{
text-align: center;
font-size: $title-size + 14;
font-weight: bold;
line-height: 90rpx;
}
.subtitle{
font-size: $title-size-m;
color: $text-gray;
text-align: center;
}
}
.white-box{
background-color: white;
border-radius: $radius $radius 0 0;
min-height: 80vh;
padding: $padding * 2;
box-sizing: border-box;
.inputs{
position: relative;
margin-top: $margin;
background: white;
border-bottom: solid 1rpx $border-color;
padding-left: 200rpx;
line-height: 90rpx;
min-height: 90rpx;
label{
position: absolute;
top: 0;
left: 0;
width: 200rpx;
font-size: $title-size;
}
input{
height: 90rpx;
line-height: 90rpx;
font-size: $title-size;
}
.picker-text{
position: relative;
padding-right: 90rpx;
.picker-icon{
position: absolute;
right: 0;
top: 0;
}
}
}
.btns{
padding-top: $padding * 2;
button{
background: $text-price;
border-radius: 0;
height: 90rpx;
line-height: 90rpx;
font-size: $title-size;
color: white;
font-weight: bold;
&::after{
border: none;
}
}
}
}
}
</style>

View File

@@ -48,6 +48,9 @@
<view class="sub-title">暂无相关优惠券</view> <view class="sub-title">暂无相关优惠券</view>
</view> </view>
</block> </block>
<view class="basisc-btn">
<button class="btn" type="default" @click="$Router.push({name: 'couponsAdd'})">添加优惠券</button>
</view>
</view> </view>
</template> </template>
@@ -94,14 +97,35 @@
}) })
}) })
} }
},
onNavigationBarButtonTap() {
this.$Router.push({name: 'couponsAdd'})
} }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
// 按钮组
.basisc-btn{
position: fixed;
bottom: 0;
left: 0;
right: 0;
padding: $padding;
background: white;
box-shadow: 0 0 4rpx 4rpx rgba($color: #000000, $alpha: .02);
.btn {
background: $mian-color;
color: white;
border-radius: 0;
font-size: $title-size-lg;
line-height: 88rpx;
height: 88rpx;
&::after {
border: none;
}
&[disabled] {
background: rgba($color: $mian-color, $alpha: .6);
}
}
}
// tabs // tabs
.header{ .header{
position: fixed; position: fixed;

View File

@@ -1,173 +0,0 @@
<template>
<view>
<view class="deal-back"></view>
<!-- 区块信息 -->
<view class="block-shadow chian-hash">
<view class="title">区块HASH</view>
<view class="hash">{{info.hash || '-'}}</view>
<view class="button" @click="copyHash">复制</view>
<view class="chian-info">
<view class="item-flex">
<view class="label webkit-box">交易数据</view>
<view class="ellipsis">
{{ info.tx_count || '-' }}
</view>
</view>
<view class="item-flex">
<view class="label webkit-box">区块高度</view>
<view class="ellipsis">
{{ info.height || '-' }}
</view>
</view>
<view class="item-flex">
<view class="label webkit-box">时间</view>
<view class="ellipsis">
{{ info.block_time || '-' }}
</view>
</view>
<view class="item-flex webkit-box">
<view class="label">上一块</view>
<view class="ellipsis">
{{ info.parent_hash || '-' }}
</view>
</view>
<view class="item-flex webkit-box">
<view class="label">区块难度</view>
<view class="ellipsis">
{{ info.difficulty || '-' }}
</view>
</view>
<view class="item-flex webkit-box">
<view class="label">默克尔跟</view>
<view class="ellipsis">
{{ info.tx_hash || '-' }}
</view>
</view>
<view class="item-flex">
<view class="label">状态哈希</view>
<view class="ellipsis">
{{ info.state_hash || '-' }}
</view>
</view>
</view>
</view>
<!-- 交易记录 -->
<view class="deals">
<view class="title">交易记录</view>
<deal-list :list="deal" />
</view>
</view>
</template>
<script>
import { hash } from '@/apis/interfaces/chain'
import dealList from '@/components/chain/deal'
export default {
components:{
dealList
},
data() {
return {
info: {},
deal: [],
}
},
onLoad(e){
// 交易详情
if(e.hash && e.hash != '') hash(e.hash).then(res=>{
this.info = res.head
this.deal = res.trades
}).catch(err => {
uni.showToast({
icon: 'none',
title: '错误 22 line in chain/deal'
})
})
else uni.showToast({
icon: 'none',
title: 'hash值不存在系统错误'
})
},
methods:{
copyHash(){
if(this.info.hash) uni.setClipboardData({
data: this.info.hash
})
}
}
}
</script>
<style lang="scss">
.block-shadow{
box-shadow: 0 0 2rpx 2rpx rgba($color: #000000, $alpha: .02);
}
// 背景
.deal-back {
position: fixed;
top: 0;
left: 0;
z-index: -1;
width: 100vw;
height: 100vh;
background: linear-gradient(to bottom, #009B69, #00562d);
}
// 区块详情
.chian-hash{
margin: $margin + ($margin/2);
background-color: white;
padding: ($padding * 3) ($padding * 2);
border-radius: $radius;
text-align: center;
.title{
font-size: $title-size + 8;
font-weight: bold;
color: $text-color;
}
.hash{
padding: $padding 0 ($padding*2) 0;
word-wrap: break-word;
color: $text-gray;
}
.button{
background-color: $red-color;
width: 50%;
display: inline-block;
height: 90rpx;
line-height: 90rpx;
color: white;
font-size: $title-size;
border-radius: 45rpx;
font-weight: bold;
}
.chian-info{
margin-top: $margin * 2;
background-color: $border-color-lg;
padding: $padding;
.item-flex{
padding-left: 220rpx;
text-align: right;
position: relative;
line-height: 70rpx;
min-height: 70rpx;
.label{
position: absolute;
left: 0;
width: 200rpx;
text-align: left;
color: $text-gray;
}
}
}
}
// 区块交易信息
.deals{
padding: $padding;
.title{
text-align: center;
font-weight: bold;
color: white;
font-size: $title-size;
}
}
</style>

View File

@@ -2,8 +2,8 @@
<view class="content"> <view class="content">
<!-- 账户余额 --> <!-- 账户余额 -->
<view class="total"> <view class="total">
<view class="item nowrap"><image src="@/static/icons/gemstone-icon.png"/>{{isAuth ? '能量球' + account.coin : '查看能量球'}}</view> <view class="item nowrap" @click="navAccount('walletProperty')"><image src="@/static/icons/gemstone-icon.png"/>{{isAuth ? '能量球' + account.coin : '查看能量球'}}</view>
<view class="item nowrap"><image src="@/static/icons/crystal-icon.png"/>{{isAuth ? '能量碎片' + account.crystal : '查看能量碎片'}}</view> <view class="item nowrap" @click="navAccount('Fragment')"><image src="@/static/icons/crystal-icon.png"/>{{isAuth ? '能量碎片' + account.crystal : '查看能量碎片'}}</view>
</view> </view>
<!-- 矿机 --> <!-- 矿机 -->
<view class="ore"> <view class="ore">
@@ -55,23 +55,23 @@
<view class="situation"> <view class="situation">
<view class="header"> <view class="header">
<view class="header-item"> <view class="header-item">
<view class="title">平台能量球余量<uni-icons class="help-icon" @click="showHelp('occBalance')" type="help-filled" size="15" color="rgba(255,255,255,.3)" /></view> <view class="title">平台能量球余量<uni-icons class="help-icon" @click="showHelp('balance')" type="help-filled" size="15" color="rgba(255,255,255,.3)" /></view>
<view class="number nowrap">{{chains.balance}}</view> <view class="number nowrap">{{chains.balance}}</view>
</view> </view>
<view class="header-item"> <view class="header-item">
<view class="title">上期能量球价值<uni-icons class="help-icon" @click="showHelp('yesterdayCrystal')" type="help-filled" size="15" color="rgba(255,255,255,.3)" /></view> <view class="title">上期能量球价值<uni-icons class="help-icon" @click="showHelp('up')" type="help-filled" size="15" color="rgba(255,255,255,.3)" /></view>
<view class="number nowrap">{{chains.up}}</view> <view class="number nowrap">{{chains.up}}</view>
</view> </view>
<view class="header-item"> <view class="header-item">
<view class="title">昨日瓜分能量碎片<uni-icons class="help-icon" @click="showHelp('yesterdayCrystal')" type="help-filled" size="15" color="rgba(255,255,255,.3)" /></view> <view class="title">昨日瓜分能量碎片<uni-icons class="help-icon" @click="showHelp('score')" type="help-filled" size="15" color="rgba(255,255,255,.3)" /></view>
<view class="number nowrap">{{chains.score}}</view> <view class="number nowrap">{{chains.score}}</view>
</view> </view>
<view class="header-item"> <view class="header-item">
<view class="title">区块链高度<uni-icons class="help-icon" @click="showHelp('blockHeight')" type="help-filled" size="15" color="rgba(255,255,255,.3)" /></view> <view class="title">区块链高度<uni-icons class="help-icon" @click="showHelp('height')" type="help-filled" size="15" color="rgba(255,255,255,.3)" /></view>
<view class="number nowrap">{{chains.height}}</view> <view class="number nowrap">{{chains.height}}</view>
</view> </view>
<view class="header-item"> <view class="header-item">
<view class="title">已开通节点数<uni-icons class="help-icon" @click="showHelp('nodeNumber')" type="help-filled" size="15" color="rgba(255,255,255,.3)" /></view> <view class="title">已开通节点数<uni-icons class="help-icon" @click="showHelp('number')" type="help-filled" size="15" color="rgba(255,255,255,.3)" /></view>
<view class="number nowrap">{{chains.number}}</view> <view class="number nowrap">{{chains.number}}</view>
</view> </view>
</view> </view>
@@ -90,7 +90,6 @@
<script> <script>
import { chain, crystals, thawlog } from '@/apis/interfaces/chain' import { chain, crystals, thawlog } from '@/apis/interfaces/chain'
import { certified, security } from '@/apis/interfaces/index'
import F2 from '@/uni_modules/lime-f2/components/lime-f2/f2.min.js' import F2 from '@/uni_modules/lime-f2/components/lime-f2/f2.min.js'
import lF2 from '@/uni_modules/lime-f2/components/lime-f2/' import lF2 from '@/uni_modules/lime-f2/components/lime-f2/'
export default { export default {
@@ -114,6 +113,12 @@
crystalArr : [], // 待领取 crystalArr : [], // 待领取
allIds : [], // 可领取ids allIds : [], // 可领取ids
categoryArr : [], // 推荐列表 categoryArr : [], // 推荐列表
help : {}, // 帮助信息
userAuth : { // 用户认证状态
certification : false,
company : false,
vip : false
}
}; };
}, },
onShow() { onShow() {
@@ -122,16 +127,56 @@
}, },
methods:{ methods:{
// 求助信息 // 求助信息
showHelp(type) { showHelp(key) {
uni.showModal({ uni.showModal({
title: '提示', title: '提示',
content: this.helpToast[type], content: this.help[key],
showCancel: false showCancel: false,
confirmColor: '#8b64fd'
}) })
}, },
// 查看钱包账户
navAccount(pathName){
if(!this.isAuth){
this.$Router.push({name: 'Login'})
return
}
this.$Router.push({name: pathName})
},
// 发权证 // 发权证
issueGoosd(){ issueGoosd(){
console.log('发权证') let typeAuth = '',
pathName = ''
if(this.userAuth.certification && this.userAuth.company && this.userAuth.vip){
this.$Router.push({name: 'goodsManagement'})
return
}
if(!this.userAuth.certification) {
typeAuth = '暂未完成个人认证,无法发布商品权证'
pathName = 'Personal'
}
if(!this.userAuth.company) {
typeAuth = '暂未开通平台会员节点,无法发布商品权证'
pathName = 'vipIndex'
}
if(!this.userAuth.vip) {
typeAuth = '企业未认证或企业认证审核中,无法发布商品权证'
pathName = 'User'
}
uni.showModal({
title: '提示',
content: typeAuth,
cancelColor: '#555',
cancelText: '稍后',
confirmText: pathName === 'vipIndex' ? '去开通': '去认证',
confirmColor: '#8b64fd',
success: res => {
if(res.confirm) {
this.$Router.push({name: pathName})
}
}
})
}, },
// 领取能量碎片 // 领取能量碎片
ledCrystal(index) { ledCrystal(index) {
@@ -175,38 +220,30 @@
coin : crystalsData.coin, coin : crystalsData.coin,
crystal : crystalsData.crystal crystal : crystalsData.crystal
} }
this.userAuth = {
certification : crystalsData.is_certification,
company : crystalsData.is_company,
vip : crystalsData.is_vip
}
this.crystalArr = crystalsData.crystal_array this.crystalArr = crystalsData.crystal_array
this.allIds = crystalsData.all_ids this.allIds = crystalsData.all_ids
} }
this.chains = occData.data this.chains = occData.data
this.categoryArr = occData.tasks this.categoryArr = occData.tasks
this.help = occData.help
this.showCartc(occData.movement)
}).catch(err => { }).catch(err => {
uni.showToast({ uni.showToast({
title: err.message, title: err.message,
icon : 'none' icon : 'none'
}) })
}) })
// occ().then(res => {
// console.log(res)
// // this.occs = res.occs
// // this.yesterdayCrystal = res.yesterday_crystal
// // this.occ = res.occ
// // this.occBalance = res.occ_balance
// // this.blockHeight = res.block_height
// // this.gain = res.gain
// // this.nodeNumber = res.node_number
// // this.notice = res.notice
// // if(res.help_toast) this.helpToast = res.help_toast
// // this.showCartc(res.movements)
// })
}, },
// 绘制图表 // 绘制图表
showCartc(data){ showCartc(data){
// 图表信息 // 图表信息
this.$refs.chartChange.init(config => { this.$refs.chartChange.init(config => {
config.appendPadding = [10, 15, 10, 15] config.appendPadding = [10, 30, 10, 15]
const chart = new F2.Chart(config); const chart = new F2.Chart(config);
chart.source(data, { chart.source(data, {
date: { date: {
@@ -218,31 +255,6 @@
tickCount: 5 tickCount: 5
} }
}); });
chart.axis('time', {
line: null,
label: function label(text, index, total) {
const textCfg = {};
if (index === 0) {
textCfg.textAlign = 'left';
} else if (index === total - 1) {
textCfg.textAlign = 'right';
}
return textCfg;
}
});
chart.axis('tem', {
grid: function grid(text) {
if (text === '0%') {
return {
lineDash: null,
lineWidth: 1
};
}
}
});
chart.tooltip({
showCrosshairs: true
});
chart.legend({ chart.legend({
position: 'bottom', position: 'bottom',
offsetY: 0, offsetY: 0,
@@ -250,11 +262,11 @@
}); });
chart.area() chart.area()
.position('date*value') .position('date*value')
.color('name', [ '#009b69', '#9f8052' ]) .color('name', [ '#5881d3', '#ca66e0' ])
.shape('smooth') .shape('smooth')
chart.line() chart.line()
.position('date*value') .position('date*value')
.color('name', [ '#009b69', '#9f8052' ]) .color('name', [ '#5881d3', '#ca66e0' ])
.shape('smooth', name=> { .shape('smooth', name=> {
if (name === '预期收益率') { if (name === '预期收益率') {
return 'line'; return 'line';
@@ -268,7 +280,7 @@
}) })
}, },
// 能量跳转 // 能量任务跳转
JumpUrl(open, title) { JumpUrl(open, title) {
var type = open.openType; var type = open.openType;
switch(type){ switch(type){
@@ -306,12 +318,13 @@
border-radius: 50%; border-radius: 50%;
-webkit-transform-style: preserve-3d; -webkit-transform-style: preserve-3d;
background: url(/static/background/chain-back-02.png) repeat-x; background: url(/static/background/chain-back-02.png) repeat-x;
background-size: auto 100%; /* background-size: auto 100%; */
-webkit-animation: move-map 30s infinite linear; background-size: 1616rpx;
-moz-animation: move-map 30s infinite linear; -webkit-animation: move-map 60s infinite linear;
-o-animation: move-map 30s infinite linear; -moz-animation: move-map 60s infinite linear;
-ms-animation: move-map 30s infinite linear; -o-animation: move-map 60s infinite linear;
animation: move-map 30s infinite linear; -ms-animation: move-map 60s infinite linear;
animation: move-map 60s infinite linear;
box-shadow: 0 0 50rpx 50rpx rgba(31,25,34, .2); box-shadow: 0 0 50rpx 50rpx rgba(31,25,34, .2);
} }
.shadow{ .shadow{
@@ -344,16 +357,16 @@
background: radial-gradient(circle at 0 50%, #ca66e0 , rgba(255, 255, 255, .0) 45%); background: radial-gradient(circle at 0 50%, #ca66e0 , rgba(255, 255, 255, .0) 45%);
} }
@-webkit-keyframes move-map { @-webkit-keyframes move-map {
0% {background-position: -1250rpx 0; } 0% {background-position: -1616rpx 0; }
100% {background-position: 0 0;} 100% {background-position: 0 0;}
} }
@-ms-keyframes move-map { @-ms-keyframes move-map {
0% {background-position: -1250rpx 0; } 0% {background-position: -1616rpx 0; }
100% {background-position: 0 0;} 100% {background-position: 0 0;}
} }
@keyframes move-map { @keyframes move-map {
0% {background-position: -1250rpx 0; } 0% {background-position: -1616rpx 0; }
100% {background-position: 0 0;} 100% {background-position: 0 0;}
} }

View File

@@ -1,209 +0,0 @@
<template>
<view>
<!-- 区块信息 -->
<view class="info-back"></view>
<view class="info-list">
<view class="flex" v-for="(item, index) in assetsList" :key="index">
<view class="item-name ellipsis">
<image class="icon" :src="item.icon" mode="widthFix" />
{{ item.name || '-' }}
</view>
<view class="item-label">
<view class="number ellipsis">{{ item.balance || '0.00' }}</view>
<view class="unit ellipsis">{{ item.symbol || '-' }}</view>
</view>
</view>
</view>
<!-- 区块链变化 -->
<view class="movements">
<view class="title">区块链变化</view>
<view class="chart">
<l-f2 ref="chartChange"></l-f2>
</view>
</view>
<!-- 区块记录 -->
<view class="chain-record">
<view class="title">区块记录</view>
<chain-list :list="chainList" @onChain="chainInfo"/>
</view>
<!-- 底部安全区 -->
<view class="ios-bottom"></view>
</view>
</template>
<script>
import { chain, situation } from '@/apis/interfaces/chain'
import chainList from '@/components/chain/chain'
import F2 from '@/uni_modules/lime-f2/components/lime-f2/f2.min.js'
import lF2 from '@/uni_modules/lime-f2/components/lime-f2/'
export default {
components: {
chainList,
lF2
},
data() {
return {
data: [{
time: '2021-08-08 00:00:00',
value: 30
}, {
time: '2021-08-09 00:10:00',
value: 36
}, {
time: '2021-08-10 00:12:00',
value: 38
}, {
time: '2021-08-11 10:32:00',
value: 40
}, {
time: '2021-08-13 12:30:00',
value: 40
}, {
time: '2021-08-14 11:02:00',
value: 41
}, {
time: '2021-08-15 10:02:00',
value: 41
}],
assetsList: [],
chainList: []
};
},
mounted() {
Promise.all([chain(), situation()]).then(res => {
this.chainList = res[0]
this.assetsList = res[1].assets
}).catch(err => {
uni.showToast({
icon: 'none',
title: 'err in chain/info.vue ' + err
})
})
this.$refs.chartChange.init(config => {
const chart = new F2.Chart(config);
chart.source(this.data, {
time: {
type: 'timeCat',
tickCount: 3,
range: [ 0, 1 ]
},
value: {
tickCount: 5,
min: 0
}
});
chart.axis('time', {
label: function label(text, index, total) {
const textCfg = {};
if (index === 0) {
textCfg.textAlign = 'left';
} else if (index === total - 1) {
textCfg.textAlign = 'right';
}
return textCfg;
}
});
chart.tooltip({
showCrosshairs: true
});
chart.area()
.position('time*value')
.color('l(90) 0:#009b69 1:#f7f7f7')
.shape('smooth');
chart.line()
.position('time*value')
.color('l(90) 0:#009b69 1:#f7f7f7')
.shape('smooth');
chart.render();
return chart;
})
},
methods: {
// 区块详情
chainInfo(e){
uni.navigateTo({
url: './deal?hash=' + e.hash
})
}
}
}
</script>
<style lang="scss">
// 背景
.info-back {
position: fixed;
top: 0;
left: 0;
z-index: -1;
width: 100vw;
height: 100vh;
background: linear-gradient(to bottom, #009B69, #00562d);
}
// 区块信息
.info-list {
padding: 0 $padding;
.flex {
margin: $margin * 2 $margin/2;
background-color: white;
border-radius: $radius;
padding: $padding * 2;
box-shadow: 0 0 2rpx 2rpx rgba($color: #000000, $alpha: .02);
display: flex;
justify-content: space-between;
.item-name {
width: 50%;
font-size: $title-size;
.icon {
width: 38rpx;
height: 38rpx;
vertical-align: middle;
margin-bottom: 5rpx;
margin-right: $margin;
}
}
.item-label {
width: 50%;
padding-left: $padding;
text-align: right;
.number {
font-weight: bold;
font-size: $title-size;
}
.unit {
font-size: $title-size-m;
}
}
}
}
// 区块链信息
.chain-record,
.movements {
padding: $padding;
.title {
font-weight: bold;
text-align: center;
color: white;
font-size: $title-size;
padding-bottom: $padding;
}
}
.movements {
.chart {
background-color: white;
margin: $margin/2;
height: 350rpx;
border-radius: $radius;
}
}
</style>

View File

@@ -1,163 +0,0 @@
<template>
<view class="kline">
<l-f2 ref="chart"></l-f2>
</view>
</template>
<script>
import F2 from '@/uni_modules/lime-f2/components/lime-f2/f2.min.js'
import lF2 from '@/uni_modules/lime-f2/components/lime-f2/'
export default {
components: {
lF2,
},
data() {
return {
}
},
async mounted() {
let data = await this.getData()
// 绘制K线
this.$refs.chart.init(config => {
data = data.slice(0, 150);
const BASIC_PRICE = 6.95;
data.sort(function(obj1, obj2) {
return obj1.time > obj2.time ? 1 : -1;
});
data.forEach(function(obj) {
obj.range = [obj.start, obj.end, obj.max, obj.min];
obj.trend = obj.start <= obj.end ? 0 : 1;
});
const chart = new F2.Chart(Object.assign(config));
chart.source(data, {
range: {
tickCount: 5,
formatter: function formatter(val) {
return val.toFixed(2);
}
},
time: {
tickCount: 3
}
});
chart.tooltip({
showCrosshairs: true,
showXTip: true,
showYTip: true,
crosshairsType: 'xy',
custom: true,
yTip: function yTip(val) {
return {
text: val.toFixed(2),
fill: '#333',
fontSize: 10
};
},
xTip: {
fill: '#333',
fontSize: 10
},
xTipBackground: {
fill: '#EDF2FE'
},
yTipBackground: {
fill: '#EDF2FE'
},
crosshairsStyle: {
stroke: '#0F8DE8'
}
});
chart.axis('range', {
grid: {
stroke: '#ddd',
lineWidth: 1,
lineDash: null
},
label: {
fill: '#999'
}
});
chart.axis('time', {
label: function label(text, index, total) {
const textCfg = {
fill: '#999'
};
if (index === 0) {
textCfg.textAlign = 'left';
}
if (index === total - 1) {
textCfg.textAlign = 'right';
}
return textCfg;
},
grid: {
lineWidth: 1,
stroke: '#ddd'
}
});
chart.guide().line({
start: ['min', BASIC_PRICE],
end: ['max', BASIC_PRICE],
style: {
lineDash: [8],
stroke: '#F68300'
}
});
chart.guide().text({
position: ['min', BASIC_PRICE],
content: BASIC_PRICE,
style: {
fill: '#808080',
textAlign: 'start',
textBaseline: 'bottom',
fontSize: 10,
fontWeight: 'bold'
},
offsetX: 2
});
chart.guide().rect({
start: ['0%', '0%'],
end: ['100%', '100%'],
style: {
stroke: '#ddd',
lineWidth: 1,
fill: '#fff',
opacity: 1,
fillOpacity: 0
}
});
chart.schema()
.position('time*range')
.color('trend', function(trend) {
return ['#F4333C', '#1CA93D'][trend];
})
.shape('candle');
chart.render();
return chart;
});
},
methods: {
getData() {
// plus.screen.lockOrientation('landscape-primary')
return new Promise((resolve) => {
uni.request({
url: 'https://gw.alipayobjects.com/os/antfincdn/c4ROEPcthk/candle-sticks.json',
success: (res) => {
resolve(res.data)
}
})
})
}
},
onUnload() {
console.log('222')
}
}
</script>
<style lang="scss">
.kline{
}
</style>

View File

@@ -1,5 +1,5 @@
<template> <template>
<view class="ios-bottom"> <view class="basics-content">
<view class="info"> <view class="info">
<view class="item info-logo" @click="updImg('logo', '')"> <view class="item info-logo" @click="updImg('logo', '')">
<label>企业LOGO</label> <label>企业LOGO</label>
@@ -8,7 +8,7 @@
</view> </view>
<view class="item info-text"> <view class="item info-text">
<label>企业简介</label> <label>企业简介</label>
<textarea v-model="description" placeholder="输入企业简介" /> <textarea v-model="description" maxlength="-1" placeholder="输入企业简介" />
</view> </view>
<view class="item info-text"> <view class="item info-text">
<label>企业地址</label> <label>企业地址</label>
@@ -22,7 +22,7 @@
<view class="remove-btn" @click="removeModule(moduleIndex)">删除</view> <view class="remove-btn" @click="removeModule(moduleIndex)">删除</view>
</view> </view>
<view class="module-textarea"> <view class="module-textarea">
<textarea placeholder="输入文字内容" v-model="module.content.content" /> <textarea placeholder="输入文字内容" maxlength="-1" v-model="module.content.content" />
</view> </view>
</view> </view>
<view class="module-item" v-if="module.type === 2"> <view class="module-item" v-if="module.type === 2">
@@ -95,8 +95,9 @@
<view class="module-hint">点击查看封面/视频长按删除封面/视频</view> <view class="module-hint">点击查看封面/视频长按删除封面/视频</view>
</view> </view>
</block> </block>
<view class="add-modules" @click="addModule"> <view class="basisc-btn">
<uni-icons class="icon" type="plus" size="18" color="#c82626"/> 添加展示模块 <view class="add-modules" @click="addModule">添加模块</view>
<button class="btn" type="default" @click="onBasicsInfo">保存</button>
</view> </view>
</view> </view>
</template> </template>
@@ -116,8 +117,6 @@
}, },
created() { created() {
Promise.all([basicsInfo('GET', {}), basicsConfig()]).then(res => { Promise.all([basicsInfo('GET', {}), basicsConfig()]).then(res => {
console.log(res)
let info = res[0] let info = res[0]
this.logo = info.base.cover this.logo = info.base.cover
this.description = info.base.description this.description = info.base.description
@@ -306,7 +305,7 @@
}, },
// 保存基础信息 // 保存基础信息
onNavigationBarButtonTap(e){ onBasicsInfo(){
basicsInfo('PUT', { basicsInfo('PUT', {
cover : this.logo, cover : this.logo,
description : this.description, description : this.description,
@@ -317,6 +316,7 @@
title : '提示', title : '提示',
content : '基本信息已保存', content : '基本信息已保存',
showCancel : false, showCancel : false,
confirmColor: '#8b64fd',
success : modalRes=> { success : modalRes=> {
if(modalRes.confirm){ if(modalRes.confirm){
this.$Router.back() this.$Router.back()
@@ -335,6 +335,9 @@
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.basics-content{
padding-bottom: ($padding*3) + 90;
}
// 基础信息 // 基础信息
.info{ .info{
background: white; background: white;
@@ -396,23 +399,55 @@
} }
} }
} }
// 模块 // 按钮组
.basisc-btn{
position: fixed;
bottom: 0;
left: 0;
right: 0;
padding: $padding;
background: white;
margin-top: $margin - 10;
display: flex;
justify-content: space-between;
box-shadow: 0 0 4rpx 4rpx rgba($color: #000000, $alpha: .02);
.add-modules{ .add-modules{
line-height: 90rpx; line-height: 86rpx;
height: 88rpx;
text-align: center; text-align: center;
color: $text-price; color: $text-price;
background: white; background: white;
margin-top: $margin; width: calc(50% - 15rpx);
margin-right: 30rpx;
border:solid 1rpx $mian-color;
box-sizing: border-box;
font-size: $title-size-lg;
.icon{ .icon{
vertical-align: middle;
margin-right: $margin/3; margin-right: $margin/3;
} }
} }
.btn {
background: $mian-color;
color: white;
border-radius: 0;
font-size: $title-size-lg;
line-height: 88rpx;
height: 88rpx;
width: calc(50% - 15rpx);
&::after {
border: none;
}
&[disabled] {
background: rgba($color: $mian-color, $alpha: .6);
}
}
}
// 展示模块 // 展示模块
.module-item{ .module-item{
background: white; background: white;
padding: $padding/2 $padding; padding: $padding/2 $padding;
margin-top: $margin; margin-top: $margin - 10;
.module-title{ .module-title{
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
@@ -435,8 +470,11 @@
width: 100%; width: 100%;
font-size: $title-size; font-size: $title-size;
line-height: 50rpx; line-height: 50rpx;
box-sizing: border-box;
textarea{
width: 100%;
height: 200rpx; height: 200rpx;
}
} }
.module-imgs{ .module-imgs{
display: flex; display: flex;

View File

@@ -1,263 +0,0 @@
<template>
<view class="content">
<!-- <view class="title">易品新境</view> -->
<view class="login-top">
<view class="top-logo-content">
<image class="top-logo" fit="contain" src="/static/imgs/top_logo.png" />
链商星球(中国)
</view>
<image class="top-bg" fit="contain" src="/static/imgs/top_bg.png" />
</view>
<!-- 输入手机号相关 -->
<view class="inputs phone">
<label class="label">+86</label>
<input type="number" placeholder="输入您的手机号码" v-model="phone" />
</view>
<view class="inputs sms">
<input type="number" placeholder="输入短信验证码" v-model="code" />
<button class="sms-btn" type="default" size="mini" :disabled="phone == '' || getSms"
@click="getPhoneCode">{{getSms ? '重新发送' + smsTime + 's': '发送验证码'}}</button>
</view>
<button class="btn" type="default" :disabled="phone == '' || code == ''" @click="login">登录</button>
<!-- 快捷登录 -->
<view class="quick">
<view class="quick-title">快捷登录</view>
<view class="quick-box">
<image class="quick-icon" src="@/static/icons/wechat.png" mode="widthFix"></image>
</view>
</view>
<!-- 用户登录注册协议 -->
<view class="agreement">未注册的手机号验证后将自动创建账号登录即表示同意接收<navigator url="">用户隐私规格</navigator><navigator url="">用户服务协议
</navigator>
</view>
</view>
</template>
<script>
import {
getSms,
smsAuth
} from '@/apis/interfaces/auth'
export default {
data() {
return {
phone: "18245180131",
code: "",
smsTime: 60,
getSms: false
}
},
methods: {
// 用户登录
login() {
smsAuth({
mobileNo: this.phone,
code: this.code
}).then(res => {
this.$store.commit('setToken', res.token_type + ' ' + res.access_token)
this.$Router.back()
}).catch(err => {
uni.showToast({
title: err.message,
icon: "none"
})
})
},
// 获取验证码
getPhoneCode() {
let outTime
getSms({
mobileNo: this.phone
}).then(res => {
uni.showToast({
title: res,
icon: "none"
})
this.getSms = true
outTime = setInterval(() => {
if (this.smsTime <= 1) {
this.getSms = false
this.smsTime = 60
clearInterval('outTime')
}
this.smsTime -= 1
}, 1000)
}).catch(err => {
uni.showToast({
title: err.message,
icon: "none"
})
})
}
}
}
</script>
<style lang="scss" scoped>
.content {
height: 100vh;
width: 100vw;
padding: $padding * 3;
box-sizing: border-box;
background: white;
.login-top {
height: 36vh;
width: 100%;
display: flex;
flex-direction: row;
align-items: flex-end;
justify-content: center;
box-sizing: border-box;
position: relative;
padding-bottom: 160rpx;
.top-bg {
position: absolute;
bottom: 30rpx;
// left: 2rpx;
z-index: 2;
width: 740rpx;
margin-left: 40rpx;
}
.top-logo-content {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
box-sizing: border-box;
color: #7f56a4;
font-size: 18px;
.top-logo {
margin-bottom: 20rpx;
width: 240rpx;
height: 240rpx;
}
}
}
.inputs {
background:rgba($color: $mian-color, $alpha: 0.05);
border: solid 1rpx $border-color;
position: relative;
margin-top: $margin;
height: 80rpx;
line-height: 80rpx;
input {
width: 100%;
height: 80rpx;
line-height: 80rpx;
padding: 0 $padding;
border: none;
box-sizing: border-box;
font-size: $title-size-lg;
}
&.phone {
padding-left: 120rpx;
.label {
position: absolute;
left: 0;
top: 0;
width: 120rpx;
text-align: center;
border-right: solid 1rpx $border-color;
font-size: $title-size-lg;
}
}
&.sms {
padding-right: 200rpx;
.sms-btn[size='mini'] {
width: 200rpx;
height: 80rpx;
line-height: 80rpx;
position: absolute;
top: 0;
right: 0;
padding: 0;
margin: 0;
border-radius: 0;
border-left: solid 1rpx $border-color;
color: $text-price;
font-size: $title-size-lg;
&::after {
border: none;
}
&[disabled] {
color: rgba($color: $text-price, $alpha: .6);
background: $border-color-lg;
}
}
}
}
.title {
text-align: center;
font-size: $title-size + 6;
font-weight: bold;
color: $text-color;
margin-bottom: 100rpx;
}
.btn {
background: $mian-color;
color: white;
border-radius: 0;
margin-top: $margin;
font-size: $title-size;
line-height: 90rpx;
height: 90rpx;
font-weight: bold;
&::after {
border: none;
}
&[disabled] {
background: rgba($color: $mian-color, $alpha: .6);
}
}
.quick {
padding-top: $padding * 3;
text-align: center;
.quick-title {
text-align: center;
color: $text-gray;
font-size: $title-size-sm;
padding-bottom: $padding;
}
.quick-box {
display: flex;
justify-content: center;
.quick-icon {
width: 78rpx;
}
}
}
.agreement {
padding-top: $padding * 2;
font-size: $title-size-sm;
color: $text-gray;
navigator {
color: $text-price;
display: inline-block;
padding: 0 10rpx;
}
}
}
</style>

View File

@@ -1,20 +1,19 @@
<template> <template>
<view class="content"> <view class="content">
<!-- <view class="title">易品新境</view> -->
<view class="login-top"> <view class="login-top">
<view class="top-logo-content"> <view class="top-logo-content">
<image class="top-logo" fit="contain" src="/static/imgs/top_logo.png" /> <image class="top-logo" fit="contain" src="/static/imgs/top_logo.png" />
链商星球(中国) 链商星球(中国)
</view> </view>
<image class="top-bg" fit="contain" src="/static/imgs/top_bg.png" /> <image class="top-bg" fit="contain" mode="widthFix" src="/static/imgs/top_bg.png" />
</view> </view>
<!-- 输入手机号相关 --> <!-- 输入手机号相关 -->
<view class="inputs phone"> <view class="inputs phone">
<label class="label">+86</label> <label class="label">+86</label>
<input type="number" placeholder="输入您的手机号码" v-model="phone" /> <input type="number" placeholder="输入您的手机号码" maxlength="11" v-model="phone" />
</view> </view>
<view class="inputs sms"> <view class="inputs sms">
<input type="number" placeholder="输入短信验证码" v-model="code" /> <input type="number" placeholder="输入短信验证码" maxlength="6" v-model="code" />
<button class="sms-btn" type="default" size="mini" :disabled="phone == '' || getSms" <button class="sms-btn" type="default" size="mini" :disabled="phone == '' || getSms"
@click="getPhoneCode">{{getSms ? '重新发送' + smsTime + 's': '发送验证码'}}</button> @click="getPhoneCode">{{getSms ? '重新发送' + smsTime + 's': '发送验证码'}}</button>
</view> </view>
@@ -23,7 +22,7 @@
<view class="quick"> <view class="quick">
<view class="quick-title">快捷登录</view> <view class="quick-title">快捷登录</view>
<view class="quick-box"> <view class="quick-box">
<image class="quick-icon" src="@/static/icons/wechat.png" mode="widthFix"></image> <image class="quick-icon" src="@/static/icons/wechat.png" mode="widthFix" @click="onShowToast"></image>
</view> </view>
</view> </view>
<!-- 用户登录注册协议 --> <!-- 用户登录注册协议 -->
@@ -88,6 +87,13 @@
icon: "none" icon: "none"
}) })
}) })
},
// 提示信息
onShowToast(){
uni.showToast({
title: '微信登录暂未开放,敬请期待',
icon : 'none'
})
} }
} }
} }
@@ -115,7 +121,6 @@
.top-bg { .top-bg {
position: absolute; position: absolute;
bottom: 30rpx; bottom: 30rpx;
// left: 2rpx;
z-index: 2; z-index: 2;
width: 740rpx; width: 740rpx;
margin-left: 40rpx; margin-left: 40rpx;
@@ -128,12 +133,11 @@
justify-content: center; justify-content: center;
box-sizing: border-box; box-sizing: border-box;
color: #7f56a4; color: #7f56a4;
font-size: 18px; font-size: $title-size;
.top-logo { .top-logo {
margin-bottom: 20rpx; margin-bottom: 20rpx;
width: 240rpx; width: 146rpx;
height: 240rpx; height: 146rpx;
} }
} }
} }
@@ -173,11 +177,10 @@
&.sms { &.sms {
padding-right: 200rpx; padding-right: 200rpx;
.sms-btn[size='mini'] { .sms-btn[size='mini'] {
width: 200rpx; width: 200rpx;
height: 80rpx; height: 77rpx;
line-height: 80rpx; line-height: 77rpx;
position: absolute; position: absolute;
top: 0; top: 0;
right: 0; right: 0;
@@ -187,11 +190,9 @@
border-left: solid 1rpx $border-color; border-left: solid 1rpx $border-color;
color: $text-price; color: $text-price;
font-size: $title-size-lg; font-size: $title-size-lg;
&::after { &::after {
border: none; border: none;
} }
&[disabled] { &[disabled] {
color: rgba($color: $text-price, $alpha: .6); color: rgba($color: $text-price, $alpha: .6);
background: $border-color-lg; background: $border-color-lg;

View File

@@ -277,7 +277,7 @@
}, },
loginOut() { loginOut() {
uni.removeStorageSync('token') this.$store.commit('setToken', '')
uni.reLaunch({ uni.reLaunch({
url: '/pages/login/login' url: '/pages/login/login'
}) })

View File

@@ -123,13 +123,6 @@ class userAuth {
icon : 'none' icon : 'none'
}) })
} }
/**
* 处理登录状态维护
*/
updAuthToken(){
}
} }
export default userAuth export default userAuth

Binary file not shown.

Before

Width:  |  Height:  |  Size: 469 KiB

After

Width:  |  Height:  |  Size: 465 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB