diff --git a/apis/interfaces/order.js b/apis/interfaces/order.js index 57565b4..fa8969d 100644 --- a/apis/interfaces/order.js +++ b/apis/interfaces/order.js @@ -49,8 +49,7 @@ const sign = id => { // 物流查询 const logistic = id => { return request({ - url: 'mall/orders/' + id + '/logistic', - method: 'PUT' + url: 'mall/orders/' + id + '/logistic' }) } diff --git a/apis/interfaces/user.js b/apis/interfaces/user.js index da02903..b94d2ab 100644 --- a/apis/interfaces/user.js +++ b/apis/interfaces/user.js @@ -10,7 +10,7 @@ import { request } from '../index' // 用户 const info = () =>{ return request({ - url: 'user/info' + url: 'user' }) } diff --git a/apis/interfaces/wallet.js b/apis/interfaces/wallet.js index 67c6e49..b40a74f 100644 --- a/apis/interfaces/wallet.js +++ b/apis/interfaces/wallet.js @@ -50,10 +50,39 @@ const securityCheck = (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 + securityCheck, + privatekey, + keyrules, + securityReset } diff --git a/pages.json b/pages.json index faf4fcf..fbdc820 100644 --- a/pages.json +++ b/pages.json @@ -332,11 +332,33 @@ "navigationStyle": "custom", "enablePullDownRefresh": false } + },{ + "path": "pages/service/index", + "name": "serviceIndex", + "style": { + "navigationBarTitleText": "", + "navigationStyle": "custom", + "enablePullDownRefresh": false + } },{ "path": "pages/service/details", "name": "serviceDetails", "style": { - "navigationBarTitleText": "", + "navigationBarTitleText": "" + } + },{ + "path": "pages/wallet/privatekey", + "name": "WalletPrivatekey", + "style": { + "navigationBarTitleText": "钱包私钥", + "navigationBarBackgroundColor":"#FFFFFF", + "enablePullDownRefresh": false + } + },{ + "path": "pages/wallet/resetPassword", + "name": "ResetPassword", + "style": { + "navigationBarTitleText": "修改钱包密码", "navigationBarBackgroundColor":"#FFFFFF", "enablePullDownRefresh": false } diff --git a/pages/order/index.vue b/pages/order/index.vue index 41d9a24..62f2e33 100644 --- a/pages/order/index.vue +++ b/pages/order/index.vue @@ -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() { diff --git a/pages/order/logistics.vue b/pages/order/logistics.vue new file mode 100644 index 0000000..5600036 --- /dev/null +++ b/pages/order/logistics.vue @@ -0,0 +1,38 @@ + + + + + diff --git a/pages/pay/pay.vue b/pages/pay/pay.vue index 083c134..84cdc42 100644 --- a/pages/pay/pay.vue +++ b/pages/pay/pay.vue @@ -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() } } diff --git a/pages/user/index.vue b/pages/user/index.vue index 3aeeeee..e7e5edc 100644 --- a/pages/user/index.vue +++ b/pages/user/index.vue @@ -34,7 +34,7 @@ direction="column" > - 开通 + 开通 @@ -84,8 +84,8 @@ - - + + + + ZH钱包 + @@ -117,6 +122,10 @@ + + ZH生态俱乐部 + All Rights Reserved. ZH Eco Club + @@ -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; diff --git a/pages/wallet/create.vue b/pages/wallet/create.vue index 6750dbc..bafea4f 100644 --- a/pages/wallet/create.vue +++ b/pages/wallet/create.vue @@ -14,7 +14,7 @@ - + @@ -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({ diff --git a/pages/wallet/mnemonic.vue b/pages/wallet/mnemonic.vue index c40ec71..16d7dd0 100644 --- a/pages/wallet/mnemonic.vue +++ b/pages/wallet/mnemonic.vue @@ -9,7 +9,7 @@ 注:助记词是用户账户的唯一标识,不能分享给他人,掌握该助记词即可控制该账户与钱包 - + @@ -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', diff --git a/pages/wallet/privatekey.vue b/pages/wallet/privatekey.vue index 0cd040c..7c3def9 100644 --- a/pages/wallet/privatekey.vue +++ b/pages/wallet/privatekey.vue @@ -2,7 +2,7 @@ - 您已接收OC Chain托管 + 您的ZH托管钱包 {{key || '-'}} 复制我的私钥 @@ -14,9 +14,9 @@ - + @@ -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; } diff --git a/pages/wallet/property.vue b/pages/wallet/property.vue index c66b066..57da764 100644 --- a/pages/wallet/property.vue +++ b/pages/wallet/property.vue @@ -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; } } } diff --git a/pages/wallet/resetPassword.vue b/pages/wallet/resetPassword.vue index 2ba8f6f..9459488 100644 --- a/pages/wallet/resetPassword.vue +++ b/pages/wallet/resetPassword.vue @@ -1,30 +1,26 @@ - diff --git a/store/index.js b/store/index.js index eddf8ed..fadb080 100644 --- a/store/index.js +++ b/store/index.js @@ -13,7 +13,8 @@ Vue.use(Vuex) export default new Vuex.Store({ state: { token : uni.getStorageSync('token') || '', - address : {} + address : {}, + refresh : 0 }, getters: { getToken: state => { @@ -21,6 +22,9 @@ export default new Vuex.Store({ }, getAddress: state => { return state.address + }, + getRefresh: state => { + return state.refresh } }, mutations: { @@ -30,6 +34,9 @@ export default new Vuex.Store({ }, setAddress(state, value) { state.address = value + }, + setRefresh(state, value) { + state.refresh = value } } }) diff --git a/uni_modules/oct-logistics/changelog.md b/uni_modules/oct-logistics/changelog.md new file mode 100644 index 0000000..e69de29 diff --git a/uni_modules/oct-logistics/components/oct-logistics/oct-logistics.vue b/uni_modules/oct-logistics/components/oct-logistics/oct-logistics.vue new file mode 100644 index 0000000..55a87d7 --- /dev/null +++ b/uni_modules/oct-logistics/components/oct-logistics/oct-logistics.vue @@ -0,0 +1,132 @@ + + + diff --git a/uni_modules/oct-logistics/package.json b/uni_modules/oct-logistics/package.json new file mode 100644 index 0000000..ef626ad --- /dev/null +++ b/uni_modules/oct-logistics/package.json @@ -0,0 +1,80 @@ +{ + "id": "oct-logistics", + "displayName": "oct-logistics", + "version": "1.0.0", + "description": "oct-logistics", + "keywords": [ + "oct-logistics" +], + "repository": "", + "engines": { + "HBuilderX": "^3.1.0" + }, + "dcloudext": { + "category": [ + "前端组件", + "通用组件" + ], + "sale": { + "regular": { + "price": "0.00" + }, + "sourcecode": { + "price": "0.00" + } + }, + "contact": { + "qq": "" + }, + "declaration": { + "ads": "", + "data": "", + "permissions": "" + }, + "npmurl": "" + }, + "uni_modules": { + "dependencies": [], + "encrypt": [], + "platforms": { + "cloud": { + "tcb": "u", + "aliyun": "u" + }, + "client": { + "Vue": { + "vue2": "u", + "vue3": "u" + }, + "App": { + "app-vue": "u", + "app-nvue": "u" + }, + "H5-mobile": { + "Safari": "u", + "Android Browser": "u", + "微信浏览器(Android)": "u", + "QQ浏览器(Android)": "u" + }, + "H5-pc": { + "Chrome": "u", + "IE": "u", + "Edge": "u", + "Firefox": "u", + "Safari": "u" + }, + "小程序": { + "微信": "u", + "阿里": "u", + "百度": "u", + "字节跳动": "u", + "QQ": "u" + }, + "快应用": { + "华为": "u", + "联盟": "u" + } + } + } + } +} \ No newline at end of file diff --git a/uni_modules/oct-logistics/readme.md b/uni_modules/oct-logistics/readme.md new file mode 100644 index 0000000..cd5013e --- /dev/null +++ b/uni_modules/oct-logistics/readme.md @@ -0,0 +1 @@ +# oct-logistics \ No newline at end of file diff --git a/uni_modules/oct-order/components/oct-order/oct-order.vue b/uni_modules/oct-order/components/oct-order/oct-order.vue index 688cfce..86f1a88 100644 --- a/uni_modules/oct-order/components/oct-order/oct-order.vue +++ b/uni_modules/oct-order/components/oct-order/oct-order.vue @@ -49,7 +49,7 @@ 删除订单 查看物流 立即支付 - 签收 + 确认签收