[更新发现]

This commit is contained in:
zhangmanman
2022-01-13 17:32:46 +08:00
19 changed files with 560 additions and 155 deletions

View File

@@ -54,6 +54,14 @@
page : 1
};
},
onShow() {
if(this.$store.getters.getRefresh == 1) {
this.$store.commit('setRefresh', 0)
this.array = []
this.page = 1
this.getOrder()
}
},
mounted() {
this.getOrder()
},
@@ -87,8 +95,65 @@
this.getOrder()
},
onType(e){
console.log(e)
console.log(e.type)
let orderNo = e.order.no
let onFount
switch (e.type){
case 'delete':
onFount = del(orderNo)
break;
case 'cancel':
onFount = cancel(orderNo)
break;
case 'logistic':
this.$Router.push({
name: 'OrderLogistics',
params: {
orderNo
},
})
break;
case 'pay':
this.$Router.push({
name: 'Pay',
params: {
orderNo : orderNo,
price : e.order.price,
oepnType: 'order'
}
})
break;
case 'sign':
onFount = sign(orderNo)
break;
}
if(!onFount) return
onFount.then(res =>{
let orderIndex = this.array.findIndex(val => val.no === e.order.no)
if(e.type === 'delete' || e.type === 'sign'){
this.array.splice(orderIndex, 1)
return
}
if(e.type === 'cancel'){
this.array.splice(orderIndex, 1, {
no : res.order_no,
cover : res.items[0].sku.cover,
name : res.items[0].sku.goods_name,
price : res.items[0].price,
sum : res.items[0].qty,
stateText : res.state,
cans : res.can
})
return
}
}).catch(err => {
uni.showToast({
title: err.message,
icon : 'none'
})
})
}
},
onReachBottom() {

38
pages/order/logistics.vue Normal file
View File

@@ -0,0 +1,38 @@
<template>
<view>
<oct-logistics
:info="info"
:logs="logs"
/>
</view>
</template>
<script>
import { logistic } from '@/apis/interfaces/order'
export default {
data() {
return {
info: {},
logs: []
};
},
mounted() {
logistic(this.$Route.query.orderNo).then(res =>{
console.log(res)
this.info = {
logo : res.orderExpress.logistic_cover,
no : res.orderExpress.express_no,
company : res.orderExpress.logistic_name
}
this.logs = res.logistics
}).catch(err =>{
uni.showToast({
title: err.message,
icon : 'none'
})
})
}
};
</script>
<style></style>

View File

@@ -69,12 +69,16 @@
orderInfo,
success: payRes => {
console.log(payRes)
uni.showModal({
title: '支付成功',
content: '订单已支付,我们将尽快为您安排发货,可在订单管理查询订单动态',
showCancel:false,
success:onRes => {
if(onRes.confirm){
if(this.$Route.query.oepnType === 'order'){
this.$store.commit('setRefresh', 1)
}
this.$Router.back()
}
}

View File

@@ -34,7 +34,7 @@
direction="column"
></u-notice-bar>
</view>
<view class="btn">开通</view>
<view class="btn" @click="openVip">开通</view>
</view>
<!-- 健康数据 -->
<view class="health-flex">
@@ -84,8 +84,8 @@
</view>
<!-- 功能块 -->
<view class="btns-box">
<view class="btns-box-item" @click="$Router.push({name: 'WalletAdd'})">
<image class="icon" src="@/static/user/userIcon_00.png" mode="widthFix"></image>
<!-- <view class="btns-box-item" @click="$Router.push({name: 'WalletAdd'})">
<image class="icon" src="@/static/user/icon_00.png" mode="widthFix"></image>
ZH钱包(首次)
<uni-icons class="forward" type="forward" color="#999"></uni-icons>
</view>
@@ -93,6 +93,11 @@
<image class="icon" src="@/static/user/userIcon_01.png" mode="widthFix"></image>
ZH钱包钱包
<uni-icons class="forward" type="forward" color="#999"></uni-icons>
</view> -->
<view class="btns-box-item" @click="onWallet">
<image class="icon" src="@/static/user/userIcon_00.png" mode="widthFix"></image>
ZH钱包
<uni-icons class="forward" type="forward" color="#999"></uni-icons>
</view>
<view class="btns-box-item">
<image class="icon" src="@/static/user/userIcon_02.png" mode="widthFix"></image>
@@ -117,6 +122,10 @@
<uni-icons class="forward" type="forward" color="#999"></uni-icons>
</view>
</view>
<view class="footer-text">
<view>ZH生态俱乐部</view>
<view>All Rights Reserved. ZH Eco Club</view>
</view>
</view>
</template>
@@ -141,12 +150,36 @@
getInfo(){
if(this.$store.state.token === '') return
info().then(res => {
console.log(res)
uni.setNavigationBarTitle({
title: res.nickname
})
this.userInfo = res
}).catch(err => {
uni.showToast({
title: err.message,
icon : 'none'
})
})
},
// 开通会员
openVip(){
if(this.$store.state.token === ''){
this.Login()
return
}
console.log("开通会员")
},
// 开通钱包
onWallet(){
if(this.$store.state.token === ''){
this.Login()
return
}
if(this.userInfo.is_wallet) this.$Router.push({name: 'WalletProperty'})
else this.$Router.push({name: 'WalletAdd'})
},
// 登录
Login(){
const Auth = new userAuth()
@@ -165,6 +198,13 @@
background: $window-color;
min-height: 100vh;
}
// 版权信息
.footer-text{
text-align: center;
font-size: $title-size-sm;
padding: $padding $padding $padding*2;
color: $text-gray-m;
}
// 用户信息
.info-box{
position: relative;

View File

@@ -14,7 +14,7 @@
</view>
<!-- 按钮 -->
<view class="buttons">
<button type="default" form-type="submit" @click="createWallet">确认</button>
<button type="default" form-type="submit" @click="createWallet">确认激活</button>
</view>
</view>
</template>
@@ -50,10 +50,7 @@ export default {
code: Number(this.password)
}).then(res => {
this.$Router.replace({
name: 'WalletMnemonic',
params: {
code: this.password
}
name: 'WalletProperty'
})
}).catch(err => {
uni.showToast({

View File

@@ -9,7 +9,7 @@
<!-- 按钮 -->
<view class="buttons">
<view class="text">助记词是用户账户的唯一标识不能分享给他人掌握该助记词即可控制该账户与钱包</view>
<button type="default" @click="goto">验证助记词</button>
<!-- <button type="default" @click="goto">验证助记词</button> -->
</view>
</view>
</template>
@@ -19,18 +19,14 @@
export default {
data() {
return {
mnemonic: [], // 助记词
sign : '' // 校验签名
mnemonic: []
}
},
mounted() {
// this.$Route.query.code
seed({
code: 123456
code: this.$Route.query.password
}).then(res => {
console.log(res)
this.mnemonic = res.seed.split(' ')
this.sign = res.sign
}).catch(err => {
uni.showToast({
icon: 'none',

View File

@@ -2,7 +2,7 @@
<view>
<!-- 私钥 -->
<view class="keys">
<view class="title">已接收OC Chain托管</view>
<view class="title">的ZH托管钱包</view>
<view class="key">{{key || '-'}}</view>
<view class="copykey" @click="copykey">复制我的私钥</view>
</view>
@@ -14,9 +14,9 @@
</view>
</view>
<!-- 免责说明 -->
<view class="liability">
<!-- <view class="liability">
<navigator url="/pages/wallet/cmsWithDraw">免责条款</navigator>
</view>
</view> -->
</view>
</template>
@@ -26,15 +26,26 @@
data() {
return {
key: "",
rules: []
rules: [
{
title: "什么是托管钱包?",
description: "托管钱包顾名思义就是用户把私钥和数字资产委托给其他机构管理,也就是就是通过中心化的方式安全管理并保存资产,本质上是与区块链所追求的去中心化相背离的。"
},
{
title: "什么是钱包私钥?",
description: "作为管理和使用加密货币最关键的东西,私钥对所有数字货币用户而言具有所有权,拥有私钥才能支配相应的加密资产。"
}
]
};
},
mounted() {
Promise.all([privatekey(this.$Route.query.password), keyrules()]).then(res => {
let privatekey = res[0],
keyrules = res[1]
this.key = privatekey.private_key
this.rules = keyrules
privatekey(this.$Route.query.password).then(res => {
this.key = res.private_key
}).catch(err => {
uni.showToast({
title: err.message,
icon : 'none'
})
})
},
methods:{
@@ -63,11 +74,11 @@
.key{
padding: $padding * 2 0;
text-align: center;
color: $mian-color;
color: $main-color;
word-wrap: break-word;
}
.copykey{
background-color: $mian-color;
background-color: $main-color;
color: white;
height: 95rpx;
line-height: 95rpx;
@@ -88,7 +99,7 @@
font-size: $title-size + 2;
}
.content{
color: $text-gray-lg;
color: $text-gray;
font-size: $title-size-m;
line-height: 40rpx;
}

View File

@@ -50,7 +50,7 @@
logs : [],
logsType : 0,
password : '',
passwordShow : true,
passwordShow : false,
passwordPages: ''
};
},
@@ -90,17 +90,18 @@
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()
console.log("密码验证通过")
// switch (this.passwordPages){
// case 'privatekey':
// this.$Router.push({name:'Privatekey', params: {password: this.password}})
// break;
// case 'resetPassword':
// this.$Router.push({name:'ResetPassword', params: {password: this.password}})
// break;
// }
}).catch(err => {
uni.showToast({
title: err.message,
@@ -145,18 +146,11 @@
itemList: ['导出助记词', '修改密码'],
success: (res) => {
switch (res.tapIndex) {
case 0:
this.$Router.push({
name: 'Transfer'
})
case 0:
this.showPrivatekey('WalletMnemonic')
break;
case 1:
this.$Router.push({
name: 'WalletCode'
})
break;
case 3:
this.showPrivatekey('resetPassword')
case 1:
this.showPrivatekey('ResetPassword')
break;
}
uni.hideLoading()
@@ -270,7 +264,7 @@
color: $main-color;
margin: 0 $margin;
border-radius: $radius-m;
font-size: $title-size;
font-size: $title-size-lg;
}
}
}

View File

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