Merge branch 'master' of https://git.yuzhankeji.cn/TmOct5/ZhHealth into master
This commit is contained in:
65
apis/interfaces/address.js
Normal file
65
apis/interfaces/address.js
Normal file
@@ -0,0 +1,65 @@
|
||||
/**
|
||||
* Web唐明明
|
||||
* 匆匆数载恍如梦,岁月迢迢华发增。
|
||||
* 碌碌无为枉半生,一朝惊醒万事空。
|
||||
* moduleName: 地址管理
|
||||
*/
|
||||
|
||||
import { request } from '../index'
|
||||
|
||||
// 地址列表
|
||||
const list = () =>{
|
||||
return request({
|
||||
url: 'mall/addresses'
|
||||
})
|
||||
}
|
||||
|
||||
// 添加地址
|
||||
const add = data => {
|
||||
return request({
|
||||
url: 'mall/addresses',
|
||||
method: 'POST',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
// 收货地址详情
|
||||
const info = id => {
|
||||
return request({
|
||||
url: 'mall/addresses/' + id
|
||||
})
|
||||
}
|
||||
|
||||
// 修改收货地址
|
||||
const edit = (id, data) => {
|
||||
return request({
|
||||
url: 'mall/addresses/' + id,
|
||||
method: 'PUT',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除收货地址
|
||||
const del = id => {
|
||||
return request({
|
||||
url: 'mall/addresses/' + id,
|
||||
method: 'DELETE'
|
||||
})
|
||||
}
|
||||
|
||||
// 获取省市区
|
||||
const addresses = data => {
|
||||
return request({
|
||||
url: 'mall/addresses/create',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export {
|
||||
list,
|
||||
add,
|
||||
info,
|
||||
edit,
|
||||
del,
|
||||
addresses
|
||||
}
|
||||
@@ -15,21 +15,58 @@ const mall = () =>{
|
||||
}
|
||||
|
||||
// 商品详情
|
||||
const goods = (id) => {
|
||||
const goods = id => {
|
||||
return request({
|
||||
url: 'mall/goods/' + id
|
||||
})
|
||||
}
|
||||
|
||||
// 套餐列表
|
||||
const meals = (id) => {
|
||||
const meals = id => {
|
||||
return request({
|
||||
url: 'mall/meals/' + id
|
||||
})
|
||||
}
|
||||
|
||||
// 商品列表
|
||||
const lists = data => {
|
||||
console.log(data)
|
||||
return request({
|
||||
url: 'mall/goods',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
// 确认订单
|
||||
const buy = data => {
|
||||
return request({
|
||||
url: 'mall/buy/goods',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
// 商品下单
|
||||
const verify = data => {
|
||||
return request({
|
||||
url: 'mall/buy/goods',
|
||||
method: 'POST',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
// 商城二级分类
|
||||
const classify = id => {
|
||||
return request({
|
||||
url: 'mall/categories/' + id + '/children'
|
||||
})
|
||||
}
|
||||
|
||||
export {
|
||||
mall,
|
||||
goods,
|
||||
meals
|
||||
meals,
|
||||
lists,
|
||||
buy,
|
||||
verify,
|
||||
classify
|
||||
}
|
||||
|
||||
181
package-lock.json
generated
181
package-lock.json
generated
@@ -2,6 +2,182 @@
|
||||
"requires": true,
|
||||
"lockfileVersion": 1,
|
||||
"dependencies": {
|
||||
"base-x": {
|
||||
"version": "3.0.9",
|
||||
"resolved": "https://registry.npmjs.org/base-x/-/base-x-3.0.9.tgz",
|
||||
"integrity": "sha512-H7JU6iBHTal1gp56aKoaa//YUxEaAOUiydvrV/pILqIHXTtqxSkATOnDA2u+jZ/61sD+L/412+7kzXRtWukhpQ==",
|
||||
"requires": {
|
||||
"safe-buffer": "^5.0.1"
|
||||
}
|
||||
},
|
||||
"bech32": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/bech32/-/bech32-2.0.0.tgz",
|
||||
"integrity": "sha512-LcknSilhIGatDAsY1ak2I8VtGaHNhgMSYVxFrGLXv+xLHytaKZKcaUJJUE7qmBr7h33o5YQwP55pMI0xmkpJwg=="
|
||||
},
|
||||
"bigi": {
|
||||
"version": "1.4.2",
|
||||
"resolved": "https://registry.npmjs.org/bigi/-/bigi-1.4.2.tgz",
|
||||
"integrity": "sha1-nGZalfiLiwj8Bc/XMfVhhZ1yWCU="
|
||||
},
|
||||
"bip-schnorr": {
|
||||
"version": "0.6.4",
|
||||
"resolved": "https://registry.npmjs.org/bip-schnorr/-/bip-schnorr-0.6.4.tgz",
|
||||
"integrity": "sha512-dNKw7Lea8B0wMIN4OjEmOk/Z5qUGqoPDY0P2QttLqGk1hmDPytLWW8PR5Pb6Vxy6CprcdEgfJpOjUu+ONQveyg==",
|
||||
"requires": {
|
||||
"bigi": "^1.4.2",
|
||||
"ecurve": "^1.0.6",
|
||||
"js-sha256": "^0.9.0",
|
||||
"randombytes": "^2.1.0",
|
||||
"safe-buffer": "^5.2.1"
|
||||
}
|
||||
},
|
||||
"bitcore-lib": {
|
||||
"version": "8.25.25",
|
||||
"resolved": "https://registry.npmjs.org/bitcore-lib/-/bitcore-lib-8.25.25.tgz",
|
||||
"integrity": "sha512-H6qNCVl4M8/MglXhvc04mmeus1d6nrmqTJGQ+xezJLvL7hs7R3dyBPtOqSP3YSw0iq/GWspMd8f5OOlyXVipJQ==",
|
||||
"requires": {
|
||||
"bech32": "=2.0.0",
|
||||
"bip-schnorr": "=0.6.4",
|
||||
"bn.js": "=4.11.8",
|
||||
"bs58": "^4.0.1",
|
||||
"buffer-compare": "=1.1.1",
|
||||
"elliptic": "^6.5.3",
|
||||
"inherits": "=2.0.1",
|
||||
"lodash": "^4.17.20"
|
||||
}
|
||||
},
|
||||
"bitcore-mnemonic": {
|
||||
"version": "8.25.25",
|
||||
"resolved": "https://registry.npmjs.org/bitcore-mnemonic/-/bitcore-mnemonic-8.25.25.tgz",
|
||||
"integrity": "sha512-7HvRxHrmd+Rh0Ohl0SEDMKQBAM+FoevXbCFnxGju6H+uZjtWMOToHA8vUg0+B91pfEMjdt9mQVB/wSA8GMqnCA==",
|
||||
"requires": {
|
||||
"bitcore-lib": "^8.25.25",
|
||||
"unorm": "^1.4.1"
|
||||
}
|
||||
},
|
||||
"bn.js": {
|
||||
"version": "4.11.8",
|
||||
"resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.8.tgz",
|
||||
"integrity": "sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA=="
|
||||
},
|
||||
"brorand": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz",
|
||||
"integrity": "sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8="
|
||||
},
|
||||
"bs58": {
|
||||
"version": "4.0.1",
|
||||
"resolved": "https://registry.npmjs.org/bs58/-/bs58-4.0.1.tgz",
|
||||
"integrity": "sha1-vhYedsNU9veIrkBx9j806MTwpCo=",
|
||||
"requires": {
|
||||
"base-x": "^3.0.2"
|
||||
}
|
||||
},
|
||||
"buffer-compare": {
|
||||
"version": "1.1.1",
|
||||
"resolved": "https://registry.npmjs.org/buffer-compare/-/buffer-compare-1.1.1.tgz",
|
||||
"integrity": "sha1-W+e+hTr4kZjR9N3AkNHWakiu9ZY="
|
||||
},
|
||||
"ecurve": {
|
||||
"version": "1.0.6",
|
||||
"resolved": "https://registry.npmjs.org/ecurve/-/ecurve-1.0.6.tgz",
|
||||
"integrity": "sha512-/BzEjNfiSuB7jIWKcS/z8FK9jNjmEWvUV2YZ4RLSmcDtP7Lq0m6FvDuSnJpBlDpGRpfRQeTLGLBI8H+kEv0r+w==",
|
||||
"requires": {
|
||||
"bigi": "^1.1.0",
|
||||
"safe-buffer": "^5.0.1"
|
||||
}
|
||||
},
|
||||
"elliptic": {
|
||||
"version": "6.5.4",
|
||||
"resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.4.tgz",
|
||||
"integrity": "sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ==",
|
||||
"requires": {
|
||||
"bn.js": "^4.11.9",
|
||||
"brorand": "^1.1.0",
|
||||
"hash.js": "^1.0.0",
|
||||
"hmac-drbg": "^1.0.1",
|
||||
"inherits": "^2.0.4",
|
||||
"minimalistic-assert": "^1.0.1",
|
||||
"minimalistic-crypto-utils": "^1.0.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"bn.js": {
|
||||
"version": "4.12.0",
|
||||
"resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz",
|
||||
"integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA=="
|
||||
},
|
||||
"inherits": {
|
||||
"version": "2.0.4",
|
||||
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
|
||||
"integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ=="
|
||||
}
|
||||
}
|
||||
},
|
||||
"hash.js": {
|
||||
"version": "1.1.7",
|
||||
"resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz",
|
||||
"integrity": "sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==",
|
||||
"requires": {
|
||||
"inherits": "^2.0.3",
|
||||
"minimalistic-assert": "^1.0.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"inherits": {
|
||||
"version": "2.0.4",
|
||||
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
|
||||
"integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ=="
|
||||
}
|
||||
}
|
||||
},
|
||||
"hmac-drbg": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz",
|
||||
"integrity": "sha1-0nRXAQJabHdabFRXk+1QL8DGSaE=",
|
||||
"requires": {
|
||||
"hash.js": "^1.0.3",
|
||||
"minimalistic-assert": "^1.0.0",
|
||||
"minimalistic-crypto-utils": "^1.0.1"
|
||||
}
|
||||
},
|
||||
"inherits": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz",
|
||||
"integrity": "sha1-sX0I0ya0Qj5Wjv9xn5GwscvfafE="
|
||||
},
|
||||
"js-sha256": {
|
||||
"version": "0.9.0",
|
||||
"resolved": "https://registry.npmjs.org/js-sha256/-/js-sha256-0.9.0.tgz",
|
||||
"integrity": "sha512-sga3MHh9sgQN2+pJ9VYZ+1LPwXOxuBJBA5nrR5/ofPfuiJBE2hnjsaN8se8JznOmGLN2p49Pe5U/ttafcs/apA=="
|
||||
},
|
||||
"lodash": {
|
||||
"version": "4.17.21",
|
||||
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz",
|
||||
"integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg=="
|
||||
},
|
||||
"minimalistic-assert": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz",
|
||||
"integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A=="
|
||||
},
|
||||
"minimalistic-crypto-utils": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz",
|
||||
"integrity": "sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo="
|
||||
},
|
||||
"randombytes": {
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz",
|
||||
"integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==",
|
||||
"requires": {
|
||||
"safe-buffer": "^5.1.0"
|
||||
}
|
||||
},
|
||||
"safe-buffer": {
|
||||
"version": "5.2.1",
|
||||
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz",
|
||||
"integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ=="
|
||||
},
|
||||
"uni-read-pages": {
|
||||
"version": "1.0.5",
|
||||
"resolved": "https://registry.npmjs.org/uni-read-pages/-/uni-read-pages-1.0.5.tgz",
|
||||
@@ -12,6 +188,11 @@
|
||||
"resolved": "https://registry.npmjs.org/uni-simple-router/-/uni-simple-router-2.0.8-beta.3.tgz",
|
||||
"integrity": "sha512-Aiw9O7TzATZ0BH9e6p0hJsVy8K1lYjf3P9QMmskNqJaOh9jltCaurrw/dJZ7xUMGVu/K3XP1MxOotBAUjsiUZg=="
|
||||
},
|
||||
"unorm": {
|
||||
"version": "1.6.0",
|
||||
"resolved": "https://registry.npmjs.org/unorm/-/unorm-1.6.0.tgz",
|
||||
"integrity": "sha512-b2/KCUlYZUeA7JFUuRJZPUtr4gZvBh7tavtv4fvk4+KV9pfGiR6CQAQAWl49ZpR3ts2dk4FYkP7EIgDJoiOLDA=="
|
||||
},
|
||||
"uview-ui": {
|
||||
"version": "2.0.19",
|
||||
"resolved": "https://registry.npmjs.org/uview-ui/-/uview-ui-2.0.19.tgz",
|
||||
|
||||
12
pages.json
12
pages.json
@@ -95,7 +95,7 @@
|
||||
"path": "pages/address/index",
|
||||
"name": "Address",
|
||||
"style": {
|
||||
"navigationBarTitleText": "地址"
|
||||
"navigationBarTitleText": "收货地址"
|
||||
}
|
||||
}, {
|
||||
"path": "pages/address/edit",
|
||||
@@ -115,7 +115,15 @@
|
||||
"path": "pages/store/list",
|
||||
"name": "StoreList",
|
||||
"style": {
|
||||
"navigationBarTitleText": "列表",
|
||||
"navigationBarTitleText": "商品",
|
||||
"navigationBarBackgroundColor": "#FFFFFF",
|
||||
"enablePullDownRefresh": true
|
||||
}
|
||||
}, {
|
||||
"path": "pages/store/meals",
|
||||
"name": "StoreMeals",
|
||||
"style": {
|
||||
"navigationBarTitleText": "套餐",
|
||||
"navigationBarBackgroundColor": "#FFFFFF",
|
||||
"enablePullDownRefresh": true
|
||||
}
|
||||
|
||||
@@ -1,19 +1,303 @@
|
||||
<template>
|
||||
<view>
|
||||
编辑地址
|
||||
<view class="content">
|
||||
<!-- 表单 -->
|
||||
<view class="form-block">
|
||||
<view class="item">
|
||||
<label>收货人</label>
|
||||
<input class="form-input" type="text" v-model="name" placeholder="输入收货人姓名" />
|
||||
</view>
|
||||
<view class="item">
|
||||
<label>手机号码</label>
|
||||
<input class="form-input" type="number" v-model="phone" placeholder="输入手机号码"/>
|
||||
</view>
|
||||
<view class="item">
|
||||
<label>所在地区</label>
|
||||
<view class="picker-value" @click="show = true">
|
||||
<block v-if="value.length > 0">
|
||||
<text v-for="(item, index) in value" :key="index">{{item.name}}</text>
|
||||
</block>
|
||||
<block v-else>
|
||||
<view class="picker-value-placeholder">请选择省市区</view>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
<view class="item">
|
||||
<label>详细地址</label>
|
||||
<input class="form-input" type="text" v-model="street" placeholder="输入详细地址"/>
|
||||
</view>
|
||||
</view>
|
||||
<view class="form-block">
|
||||
<view class="item">
|
||||
<label>设为默认</label>
|
||||
<view class="form-switch">
|
||||
<u-switch v-model="def" size="22" activeColor="#34CE98" />
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="form-block" v-if="this.$Route.query.id">
|
||||
<view class="item remove" @click="deleteThis">
|
||||
<label>删除地址</label>
|
||||
<view class="form-switch">
|
||||
<uni-icons type="forward" color="#999"></uni-icons>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 编辑信息 -->
|
||||
<view class="footer">
|
||||
<button type="default" @click="submit">{{this.$Route.query.id ? '保存' : '创建'}}</button>
|
||||
</view>
|
||||
<!-- 地址选择器 -->
|
||||
<u-picker
|
||||
:show="show"
|
||||
ref="uPicker"
|
||||
keyName="name"
|
||||
:columns="columns"
|
||||
confirmColor="#34CE98"
|
||||
cancelColor="#666"
|
||||
:defaultIndex="defaultIndex"
|
||||
@cancel="show = false"
|
||||
@confirm="confirm"
|
||||
@change="changePicker"
|
||||
></u-picker>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { addresses, add, info, edit, del } from '@/apis/interfaces/address'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
||||
show : false,
|
||||
value : [],
|
||||
columns : [
|
||||
[{name: '省'}],
|
||||
[{name: '市'}],
|
||||
[{name: '区/县'}]
|
||||
],
|
||||
defaultIndex: [],
|
||||
name : "",
|
||||
phone : "",
|
||||
street : "",
|
||||
def : false,
|
||||
};
|
||||
},
|
||||
created() {
|
||||
uni.setNavigationBarTitle({
|
||||
title: this.$Route.query.id ? '编辑地址': '创建地址'
|
||||
})
|
||||
if(this.$Route.query.id){
|
||||
info(this.$Route.query.id).then(res =>{
|
||||
let addressId = [
|
||||
res.province.region_id,
|
||||
res.city.region_id,
|
||||
res.district.region_id,
|
||||
]
|
||||
this.name = res.name
|
||||
this.phone = res.mobile
|
||||
this.street = res.address
|
||||
this.def = res.default
|
||||
this.value = [
|
||||
{ name:res.province.name, id: res.province.region_id},
|
||||
{ name:res.city.name, id: res.city.region_id},
|
||||
{ name:res.district.name, id: res.district.region_id}
|
||||
]
|
||||
this.getAddresses(addressId)
|
||||
})
|
||||
}else{
|
||||
this.getAddresses()
|
||||
}
|
||||
},
|
||||
methods:{
|
||||
confirm(e){
|
||||
this.show = false
|
||||
|
||||
console.log(e.value)
|
||||
|
||||
this.value = e.value
|
||||
},
|
||||
changePicker(e){
|
||||
const { columnIndex, index, values } = e
|
||||
const parentId = values[columnIndex][index].id
|
||||
switch(columnIndex){
|
||||
case 0:
|
||||
this.getCity(parentId)
|
||||
break;
|
||||
case 1:
|
||||
this.getCounty(parentId)
|
||||
break;
|
||||
}
|
||||
},
|
||||
async getAddresses(values){
|
||||
let parentId = "",
|
||||
columnsArr = []
|
||||
|
||||
for(let i in this.columns){
|
||||
await addresses({parent_id:parentId}).then(res => {
|
||||
if(values){
|
||||
parentId = values[i]
|
||||
}else{
|
||||
parentId = res[0].id
|
||||
}
|
||||
columnsArr.push(res)
|
||||
this.$refs.uPicker.setColumnValues(i, res)
|
||||
if(i == 2 && values){
|
||||
let defIndex = columnsArr.map((val,index) => {
|
||||
return val.findIndex(v => v.id === values[index])
|
||||
})
|
||||
this.defaultIndex = defIndex
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
getCity(id) {
|
||||
addresses({parent_id:id}).then(res => {
|
||||
this.$refs.uPicker.setColumnValues(1, res)
|
||||
this.getCounty(res[0].id)
|
||||
})
|
||||
},
|
||||
getCounty(id){
|
||||
addresses({parent_id:id}).then(res => {
|
||||
this.$refs.uPicker.setColumnValues(2, res)
|
||||
})
|
||||
},
|
||||
submit(){
|
||||
let data = {
|
||||
name : this.name,
|
||||
mobile : this.phone,
|
||||
province_id : this.value[0].id,
|
||||
city_id : this.value[1].id,
|
||||
district_id : this.value[2].id,
|
||||
address : this.street,
|
||||
is_default : this.def ? 1 : 0
|
||||
}
|
||||
|
||||
let submitFun
|
||||
|
||||
if(this.$Route.query.id){
|
||||
submitFun = edit(this.$Route.query.id, data)
|
||||
}else{
|
||||
submitFun = add(data)
|
||||
}
|
||||
|
||||
submitFun.then(res => {
|
||||
uni.showToast({
|
||||
title: res,
|
||||
icon : 'success',
|
||||
mask : true
|
||||
})
|
||||
setTimeout(() => {
|
||||
this.$Router.back()
|
||||
},2000)
|
||||
}).catch(err => {
|
||||
uni.showToast({
|
||||
title: err.message,
|
||||
icon : 'none'
|
||||
})
|
||||
})
|
||||
},
|
||||
deleteThis(){
|
||||
uni.showModal({
|
||||
title : '提示',
|
||||
content : '确定删除地址?',
|
||||
cancelText : '取消',
|
||||
confirmText : '确认',
|
||||
showCancel : true,
|
||||
confirmColor: '#34CE98',
|
||||
success : res => {
|
||||
if(res.confirm){
|
||||
del(this.$Route.query.id).then(res => {
|
||||
uni.showToast({
|
||||
title: res,
|
||||
icon : 'success',
|
||||
mask : true
|
||||
})
|
||||
setTimeout(() => {
|
||||
this.$Router.back()
|
||||
},2000)
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.content{
|
||||
background: $window-color;
|
||||
min-height: 100vh;
|
||||
padding: $padding;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
// 提交按钮
|
||||
.footer{
|
||||
position: fixed;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
z-index: 999;
|
||||
padding: $padding;
|
||||
background: white;
|
||||
button{
|
||||
border-radius: $radius/2;
|
||||
height: 90rpx;
|
||||
line-height: 90rpx;
|
||||
font-size: $title-size;
|
||||
background: $main-color;
|
||||
padding: 0;
|
||||
color: white;
|
||||
&::after{
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
// 表单
|
||||
.form-block{
|
||||
background-color: white;
|
||||
border-radius: $radius;
|
||||
margin-bottom: $margin;
|
||||
.item{
|
||||
position: relative;
|
||||
padding: 0 $padding 0 200rpx;
|
||||
border-bottom: solid 1rpx $border-color;
|
||||
min-height: 90rpx;
|
||||
&.remove{
|
||||
color: $text-price;
|
||||
}
|
||||
&:last-child{
|
||||
border-bottom: none;
|
||||
}
|
||||
label{
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
padding-left: $padding;
|
||||
line-height: 90rpx;
|
||||
font-size: $title-size-lg;
|
||||
}
|
||||
.form-switch{
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
align-items: center;
|
||||
height: 90rpx;
|
||||
}
|
||||
.form-input,
|
||||
.picker-value{
|
||||
min-height: 90rpx;
|
||||
line-height: 90rpx;
|
||||
font-size: $title-size-lg;
|
||||
&-placeholder{
|
||||
color: $text-gray-m;
|
||||
}
|
||||
@extend .nowrap;
|
||||
text{
|
||||
margin-right: 10rpx;
|
||||
&:last-child{
|
||||
margin-right: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -2,81 +2,47 @@
|
||||
<view class="content">
|
||||
<oct-address
|
||||
:lists="addressList"
|
||||
:isEdit="false"
|
||||
:pattern="true"
|
||||
:isEdit="edit"
|
||||
editColor="#34CE98"
|
||||
:btnStyle="{'backgroundColor': '#34CE98'}"
|
||||
@onAddress="onInfo"
|
||||
@onAdd="add"
|
||||
>
|
||||
</oct-address>
|
||||
@onAdd="$Router.push({name: 'AddressEdit'})"
|
||||
/>
|
||||
<!-- -->
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { list } from '@/apis/interfaces/address'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
addressList: [
|
||||
{
|
||||
name: '唐明明',
|
||||
phone: '18245180131',
|
||||
city: '黑龙江省哈尔滨市香坊区',
|
||||
address: '旭升南街108号',
|
||||
default: false,
|
||||
tag: '公司'
|
||||
},{
|
||||
name: '张静',
|
||||
phone: '18245180131',
|
||||
city: '黑龙江省哈尔滨市香坊区',
|
||||
address: '旭升南街108号',
|
||||
default: true,
|
||||
tag: '家'
|
||||
},{
|
||||
name: '法外狂徒张三',
|
||||
phone: '18245180131',
|
||||
city: '黑龙江省哈尔滨市香坊区',
|
||||
address: '旭升南街108号',
|
||||
default: false,
|
||||
tag: ''
|
||||
},{
|
||||
name: '王尼玛',
|
||||
phone: '18245180131',
|
||||
city: '黑龙江省哈尔滨市香坊区',
|
||||
address: '旭升南街108号',
|
||||
default: false,
|
||||
tag: ''
|
||||
},{
|
||||
name: '纸巾劳斯',
|
||||
phone: '18245180131',
|
||||
city: '黑龙江省哈尔滨市香坊区',
|
||||
address: '旭升南街108号',
|
||||
default: false,
|
||||
tag: ''
|
||||
},{
|
||||
name: '张同学',
|
||||
phone: '18245180131',
|
||||
city: '黑龙江省哈尔滨市香坊区',
|
||||
address: '旭升南街108号',
|
||||
default: false,
|
||||
tag: ''
|
||||
},{
|
||||
name: '大叔',
|
||||
phone: '18245180131',
|
||||
city: '黑龙江省哈尔滨市香坊区',
|
||||
address: '旭升南街108号',
|
||||
default: false,
|
||||
tag: ''
|
||||
}
|
||||
]
|
||||
edit : true,
|
||||
addressList: []
|
||||
};
|
||||
},
|
||||
onShow(){
|
||||
this.edit = this.$Route.query.type === 'edit'
|
||||
|
||||
list().then(res => {
|
||||
this.addressList = res
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
onInfo(val){
|
||||
console.log(val)
|
||||
},
|
||||
add(){
|
||||
console.log("新增地址")
|
||||
if(this.edit){
|
||||
this.$Router.push({
|
||||
name : 'AddressEdit',
|
||||
params : {
|
||||
id : val.address_id
|
||||
}
|
||||
})
|
||||
}else{
|
||||
this.$store.commit('setAddress', val)
|
||||
this.$Router.back()
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1,52 +1,119 @@
|
||||
<template>
|
||||
<view class="content">
|
||||
<!-- address -->
|
||||
<view class="block address">
|
||||
<block v-if="address != ''">
|
||||
<view class="block address" @click="$Router.push({name: 'Address'})">
|
||||
<uni-icons class="address-icon location" type="location-filled" size="24" color="#34CE98"></uni-icons>
|
||||
<uni-icons class="address-icon arrows" type="right" size="20" color="#999"></uni-icons>
|
||||
<view class="user"><text>唐明阳</text>18245180131</view>
|
||||
<view class="city">黑龙江省哈尔滨市南岗区汉水路265号</view>
|
||||
<view class="user"><text>{{address.name}}</text>{{address.mobile}}</view>
|
||||
<view class="city">{{address.full_address}}</view>
|
||||
</view>
|
||||
</block>
|
||||
<block v-else>
|
||||
<view class="block address-new" @click="$Router.push({name: 'Address'})">
|
||||
<uni-icons class="icon" type="plus" size="26" color="#34CE98"></uni-icons>添加收货地址
|
||||
</view>
|
||||
</block>
|
||||
<!-- 订单产品 -->
|
||||
<view class="block goods-box">
|
||||
<block v-for="(item, index) in goodsInfo" :key="index">
|
||||
<view class="goods-item">
|
||||
<image class="order-cover" src="https://yanxuan-item.nosdn.127.net/6d48e6ea51a06b1356ccda21497fdb14.png" mode="aspectFill"></image>
|
||||
<view class="order-title">茅台王子酒 金王子 53度 500毫升</view>
|
||||
<image class="order-cover" :src="item.items[0].cover" mode="aspectFill"></image>
|
||||
<view class="order-title">{{item.items[0].title}}</view>
|
||||
<view class="order-count">
|
||||
<view class="order-price"><text>¥</text>275.00</view>
|
||||
<view class="order-sum">共1件</view>
|
||||
<view class="order-price"><text>¥</text>{{item.items[0].price}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
<!-- 订单信息 -->
|
||||
<view class="block info-box">
|
||||
<view class="info-item">
|
||||
<view class="label">购买数量</view>
|
||||
<uni-number-box class="info-number" :value="qty" :min="1" :max="999" @change="numberChange" />
|
||||
</view>
|
||||
<view class="info-item">
|
||||
<view class="label">配送方式</view>
|
||||
<view class="nowrap">快递</view>
|
||||
</view>
|
||||
<view class="info-item">
|
||||
<view class="label">优惠金额</view>
|
||||
<view class="nowrap">无优惠</view>
|
||||
<view class="label">配送费用</view>
|
||||
<view class="nowrap">{{freight == 0 ? '免费': freight}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="block info-box">
|
||||
<view class="info-item">
|
||||
<view class="label">订单备注</view>
|
||||
<textarea class="info-textarea" v-model="remark" placeholder="订单备注"></textarea>
|
||||
</view>
|
||||
</view>
|
||||
<!-- footer -->
|
||||
<view class="order-footer">
|
||||
<view class="total">总计:<text>¥1399.00</text></view>
|
||||
<button class="btn">确认订单</button>
|
||||
<view class="total">总计:<text>¥{{total}}</text></view>
|
||||
<button class="btn" @click="subOrder">确认订单</button>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { buy, verify } from '@/apis/interfaces/store'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
goodsInfo : {},
|
||||
expressPickerValue : 0,
|
||||
addressId : '',
|
||||
paramsId : '',
|
||||
goodsNumber : ''
|
||||
qty : 1,
|
||||
goodsInfo : [],
|
||||
total : 0,
|
||||
freight : 0,
|
||||
address : "",
|
||||
remark : ""
|
||||
};
|
||||
},
|
||||
computed:{
|
||||
|
||||
},
|
||||
onShow(){
|
||||
if(JSON.stringify(this.$store.getters.getAddress) !== '{}') this.address = this.$store.getters.getAddress
|
||||
},
|
||||
mounted() {
|
||||
console.log(this.$Route.query)
|
||||
this.getBuy()
|
||||
},
|
||||
methods:{
|
||||
getBuy(){
|
||||
buy({
|
||||
goods_sku_id: this.$Route.query.skuId,
|
||||
qty: this.qty
|
||||
}).then(res => {
|
||||
this.address = res.address
|
||||
this.freight = res.freight
|
||||
this.total = res.total
|
||||
this.goodsInfo = res.detail
|
||||
}).catch(err => {
|
||||
uni.showToast({
|
||||
title: err.message,
|
||||
icon : 'none'
|
||||
})
|
||||
})
|
||||
},
|
||||
numberChange(e){
|
||||
this.qty = e
|
||||
this.getBuy()
|
||||
},
|
||||
// 确认订单
|
||||
subOrder(){
|
||||
verify({
|
||||
goods_sku_id: this.$Route.query.skuId,
|
||||
qty : this.qty,
|
||||
address_id : this.address.address_id,
|
||||
remark : this.remark || ''
|
||||
}).then(res => {
|
||||
console.log(res)
|
||||
this.$store.commit('setAddress', {})
|
||||
this.$Router.replace({
|
||||
name: 'Pay'
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -99,6 +166,18 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
.address-new{
|
||||
padding: $padding;
|
||||
text-align: center;
|
||||
height: 90rpx;
|
||||
line-height: 90rpx;
|
||||
color: $main-color;
|
||||
.icon{
|
||||
vertical-align: middle;
|
||||
margin-bottom: 8rpx;
|
||||
margin-right: 10rpx;
|
||||
}
|
||||
}
|
||||
// 订单列表
|
||||
.goods-item{
|
||||
display: flex;
|
||||
@@ -130,8 +209,8 @@
|
||||
}
|
||||
}
|
||||
.order-sum{
|
||||
font-size: 26rpx;
|
||||
color: #777;
|
||||
font-size: $title-size-sm;
|
||||
color: $text-gray;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -149,6 +228,12 @@
|
||||
top: $margin;
|
||||
color: $text-gray;
|
||||
}
|
||||
.info-textarea{
|
||||
height: 120rpx;
|
||||
width: 100%;
|
||||
text-align: left;
|
||||
font-size: $title-size-m;
|
||||
}
|
||||
&::after{
|
||||
position: absolute;
|
||||
left: $margin;
|
||||
|
||||
@@ -23,11 +23,13 @@
|
||||
</view>
|
||||
<view class="sales">销量{{goods.sales}}</view>
|
||||
</view>
|
||||
<view class="hr">
|
||||
<!-- <view class="hr">
|
||||
<text>详情</text>
|
||||
</view>
|
||||
</view> -->
|
||||
<view class="imgs">
|
||||
<rich-text :nodes="goods.content"></rich-text>
|
||||
<block v-for="(item, index) in goods.content" :key="index">
|
||||
<image :src="item" mode="widthFix"></image>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 立即购买 -->
|
||||
@@ -65,7 +67,12 @@
|
||||
})
|
||||
},
|
||||
buy(){
|
||||
console.log(buy)
|
||||
this.$Router.push({
|
||||
name: 'StoreBuy',
|
||||
params: {
|
||||
skuId: this.goods.skus[0].sku_id
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
</view>
|
||||
<!-- 健康产品分类 -->
|
||||
<u-scroll-list class="classify-box" indicatorColor="#ddd" indicatorActiveColor="#34CE98">
|
||||
<view v-for="(item, index) in goodTabs" :key="index" class="classify-item">
|
||||
<view v-for="(item, index) in goodTabs" :key="index" class="classify-item" @click="$Router.push({name: 'StoreList', params: {id: item.category_id, title: item.name}})">
|
||||
<view class="classify-item-nav">
|
||||
<image class="classify-item-cover" :src="item.cover"></image>
|
||||
<view class="classify-item-title">{{item.name}}</view>
|
||||
@@ -28,7 +28,7 @@
|
||||
<view class="new-box">
|
||||
<view class="title">上新精选</view>
|
||||
<view class="news">
|
||||
<view class="news-item" v-for="(item, index) in newGood" :key="index">
|
||||
<view class="news-item" v-for="(item, index) in newGood" :key="index" @click="$Router.push({ name: 'StoreGoods', params: {id: item.goods_id}})">
|
||||
<view class="news-cover">
|
||||
<image :src="item.cover" mode="aspectFill"></image>
|
||||
</view>
|
||||
@@ -40,7 +40,7 @@
|
||||
<!-- 推荐品类 -->
|
||||
<view class="card-box">
|
||||
<block v-for="(item, index) in meals" :key="index">
|
||||
<view class="card-box-item" :style="{'backgrond': item.color}" @click="$Router.push({name: 'StoreList', params: {id: item.meal_id}})">
|
||||
<view class="card-box-item" :style="{'backgrond': item.color}" @click="$Router.push({name: 'StoreMeals', params: {id: item.meal_id}})">
|
||||
<view class="card-title">{{item.title}}</view>
|
||||
<view class="card-subtitle">{{item.subtitle}}</view>
|
||||
<image class="card-cover" :src="item.cover" mode="aspectFill"></image>
|
||||
@@ -78,15 +78,12 @@
|
||||
methods:{
|
||||
getMall(){
|
||||
mall().then(res => {
|
||||
console.log(res)
|
||||
this.banners = res.banners
|
||||
this.goodsArr = res.goods
|
||||
this.newGood = res.news
|
||||
this.goodTabs = res.categories
|
||||
this.meals = res.meals
|
||||
uni.stopPullDownRefresh()
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
@@ -1,32 +1,86 @@
|
||||
<template>
|
||||
<view>
|
||||
<view class="content">
|
||||
<!-- 分类 -->
|
||||
<u-sticky bgColor="#fff" zIndex="99">
|
||||
<u-tabs :list="classify" lineColor="#34CE98" @click="onTabs"></u-tabs>
|
||||
</u-sticky>
|
||||
<!-- 分类商品 -->
|
||||
<block v-if="goodsArr.length >= 1">
|
||||
<oct-goods
|
||||
:lists="goodsArr"
|
||||
color="#e6576b"
|
||||
@onGoods="$Router.push({ name: 'StoreGoods', params: {id: $event.goods_id}})"
|
||||
/>
|
||||
</block>
|
||||
<block v-else>
|
||||
<view class="vertical pages-empty">
|
||||
<u-empty
|
||||
icon="http://cdn.uviewui.com/uview/empty/data.png"
|
||||
textColor="#999"
|
||||
text="暂无数据"
|
||||
>
|
||||
</u-empty>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { meals } from "@/apis/interfaces/store"
|
||||
import { lists, classify } from "@/apis/interfaces/store"
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
goodsArr: []
|
||||
goodsArr: [],
|
||||
classify: [
|
||||
{ name: "全部", category_id: "" }
|
||||
],
|
||||
cid : ""
|
||||
};
|
||||
},
|
||||
mounted(){
|
||||
meals(this.$Route.query.id).then(res => {
|
||||
uni.setNavigationBarTitle({
|
||||
title: res.title
|
||||
title: this.$Route.query.title
|
||||
})
|
||||
this.goodsArr = res.items
|
||||
this.getLists()
|
||||
this.getClassify()
|
||||
},
|
||||
methods:{
|
||||
// 商品列表
|
||||
getLists(cid) {
|
||||
lists({
|
||||
category_id : this.$Route.query.id,
|
||||
category_cid: this.cid
|
||||
}).then(res => {
|
||||
this.goodsArr = res.data
|
||||
uni.stopPullDownRefresh()
|
||||
})
|
||||
},
|
||||
// 获取二级分类
|
||||
getClassify(){
|
||||
classify(this.$Route.query.id).then(res => {
|
||||
this.classify = this.classify.concat(res)
|
||||
})
|
||||
},
|
||||
// 二级分类筛选
|
||||
onTabs(e){
|
||||
this.goodsArr = []
|
||||
this.cid = e.category_id
|
||||
this.getLists()
|
||||
}
|
||||
},
|
||||
onPullDownRefresh() {
|
||||
this.getLists()
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
<style lang="scss" scoped>
|
||||
.content{
|
||||
background: $window-color;
|
||||
min-height: 100vh;
|
||||
}
|
||||
|
||||
.pages-empty{
|
||||
height: 70vh;
|
||||
}
|
||||
</style>
|
||||
|
||||
74
pages/store/meals.vue
Normal file
74
pages/store/meals.vue
Normal file
@@ -0,0 +1,74 @@
|
||||
<template>
|
||||
<view class="content">
|
||||
<!-- banner -->
|
||||
<view class="banner">
|
||||
<image v-if="banner.length > 0" class="banner-cover" :src="banner[0].cover || ''" mode="aspectFill"></image>
|
||||
</view>
|
||||
<!-- 套餐列表 -->
|
||||
<oct-goods
|
||||
:lists="goodsArr"
|
||||
color="#e6576b"
|
||||
@onGoods="$Router.push({ name: 'StoreGoods', params: {id: $event.goods_id}})"
|
||||
/>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { meals } from "@/apis/interfaces/store"
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
banner : [],
|
||||
goodsArr: []
|
||||
};
|
||||
},
|
||||
mounted(){
|
||||
this.getMeals()
|
||||
},
|
||||
methods:{
|
||||
getMeals(){
|
||||
meals(this.$Route.query.id).then(res => {
|
||||
uni.setNavigationBarTitle({
|
||||
title: res.meal.subtitle
|
||||
})
|
||||
console.log(res)
|
||||
this.banner = res.banners
|
||||
this.goodsArr = res.meal.goods
|
||||
uni.stopPullDownRefresh()
|
||||
})
|
||||
},
|
||||
click(){
|
||||
console.log('筛选')
|
||||
}
|
||||
},
|
||||
onPullDownRefresh() {
|
||||
this.getMeals()
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.content{
|
||||
background: $window-color;
|
||||
min-height: 100vh;
|
||||
}
|
||||
// banner
|
||||
.banner{
|
||||
position: relative;
|
||||
width: 100%;
|
||||
background-color: white;
|
||||
padding-top: 40%;
|
||||
&-text,
|
||||
&-cover{
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
// 筛选
|
||||
.classify-tabs{
|
||||
background: white;
|
||||
}
|
||||
</style>
|
||||
@@ -89,7 +89,7 @@
|
||||
健康档案
|
||||
<uni-icons class="forward" type="forward" color="#999"></uni-icons>
|
||||
</view>
|
||||
<view class="btns-box-item" @click="$Router.push({name: 'Address'})">
|
||||
<view class="btns-box-item" @click="$Router.push({name: 'Address', params: {type: 'edit'}})">
|
||||
<image class="icon" src="@/static/user/icon_02.png" mode="widthFix"></image>
|
||||
地址管理
|
||||
<uni-icons class="forward" type="forward" color="#999"></uni-icons>
|
||||
|
||||
@@ -13,7 +13,7 @@ router.beforeEach((to, from, next) => {
|
||||
|
||||
// 全局路由后置守卫
|
||||
router.afterEach((to, from) => {
|
||||
console.log('跳转结束')
|
||||
// console.log('跳转结束')
|
||||
})
|
||||
|
||||
export {
|
||||
|
||||
BIN
static/icon/null-icon.png
Normal file
BIN
static/icon/null-icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 6.9 KiB |
@@ -13,18 +13,14 @@ Vue.use(Vuex)
|
||||
export default new Vuex.Store({
|
||||
state: {
|
||||
token : uni.getStorageSync('token') || '',
|
||||
code : uni.getStorageSync('wxCode') || '',
|
||||
coupongoods : []
|
||||
address : {}
|
||||
},
|
||||
getters: {
|
||||
getToken: state => {
|
||||
return state.token
|
||||
},
|
||||
getCoupongoods: state => {
|
||||
return state.coupongoods
|
||||
},
|
||||
getCode: state => {
|
||||
return state.code
|
||||
getAddress: state => {
|
||||
return state.address
|
||||
}
|
||||
},
|
||||
mutations: {
|
||||
@@ -32,12 +28,8 @@ export default new Vuex.Store({
|
||||
state.token = tokenString
|
||||
uni.setStorageSync('token', tokenString)
|
||||
},
|
||||
setCoupongoods(state, value) {
|
||||
state.coupongoods = value
|
||||
},
|
||||
setCode(state, value) {
|
||||
state.code = value
|
||||
uni.setStorageSync('wxCode', value)
|
||||
setAddress(state, value) {
|
||||
state.address = value
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
@@ -9,12 +9,14 @@
|
||||
<view class="address--lists">
|
||||
<view class="address--item" :class="[pattern ? 'chunk': 'broad', {'edit': isEdit}]" v-for="(item, index) in lists" :key="index">
|
||||
<view class="city">
|
||||
<block v-if="isTag">
|
||||
<text v-if="item.default" class="city--tag city--default">默认</text>
|
||||
<text v-if="item.tag && item.tag != ''" class="city--tag city--type">{{item.tag}}</text>
|
||||
{{item.city}}
|
||||
<!-- <text v-if="item.tag && item.tag != ''" class="city--tag city--type">{{item.tag}}</text> -->
|
||||
</block>
|
||||
{{item.province.name}}{{item.city.name}}{{item.district.name}}
|
||||
</view>
|
||||
<view class="address">{{item.address}}</view>
|
||||
<view class="name">{{item.name}}<text>{{item.phone}}</text></view>
|
||||
<view class="name">{{item.name}}<text>{{item.mobile}}</text></view>
|
||||
<view class="edit" :style="{'color': editColor}" @click="$emit('onAddress', item)">{{isEdit ? '编辑' : '选择'}}</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -79,6 +81,11 @@
|
||||
default : () => {
|
||||
return require('../../static/null-icon.png')
|
||||
}
|
||||
},
|
||||
// 是否显示地址标签
|
||||
isTag: {
|
||||
type : Boolean,
|
||||
default : true
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -146,7 +153,7 @@
|
||||
margin-right: $margin/2;
|
||||
}
|
||||
.city--default{
|
||||
background: #FF6160;
|
||||
background: #e6576b;
|
||||
color: white;
|
||||
padding: 0 $margin/3;
|
||||
border-radius: $radius;
|
||||
|
||||
25
uni_modules/uni-number-box/changelog.md
Normal file
25
uni_modules/uni-number-box/changelog.md
Normal file
@@ -0,0 +1,25 @@
|
||||
## 1.2.1(2021-11-22)
|
||||
- 修复 vue3中某些scss变量无法找到的问题
|
||||
## 1.2.0(2021-11-19)
|
||||
- 优化 组件UI,并提供设计资源,详见:[https://uniapp.dcloud.io/component/uniui/resource](https://uniapp.dcloud.io/component/uniui/resource)
|
||||
- 文档迁移,详见:[https://uniapp.dcloud.io/component/uniui/uni-number-box](https://uniapp.dcloud.io/component/uniui/uni-number-box)
|
||||
## 1.1.2(2021-11-09)
|
||||
- 新增 提供组件设计资源,组件样式调整
|
||||
## 1.1.1(2021-07-30)
|
||||
- 优化 vue3下事件警告的问题
|
||||
## 1.1.0(2021-07-13)
|
||||
- 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834)
|
||||
## 1.0.7(2021-05-12)
|
||||
- 新增 组件示例地址
|
||||
## 1.0.6(2021-04-20)
|
||||
- 修复 uni-number-box 浮点数运算不精确的 bug
|
||||
- 修复 uni-number-box change 事件触发不正确的 bug
|
||||
- 新增 uni-number-box v-model 双向绑定
|
||||
## 1.0.5(2021-02-05)
|
||||
- 调整为uni_modules目录规范
|
||||
|
||||
## 1.0.7(2021-02-05)
|
||||
- 调整为uni_modules目录规范
|
||||
- 新增 支持 v-model
|
||||
- 新增 支持 focus、blur 事件
|
||||
- 新增 支持 PC 端
|
||||
@@ -0,0 +1,211 @@
|
||||
<template>
|
||||
<view class="uni-numbox">
|
||||
<view @click="_calcValue('minus')" class="uni-numbox__minus uni-numbox-btns" :style="{background}">
|
||||
<text class="uni-numbox--text" :class="{ 'uni-numbox--disabled': inputValue <= min || disabled }" :style="{color}">-</text>
|
||||
</view>
|
||||
<input :disabled="disabled" @focus="_onFocus" @blur="_onBlur" class="uni-numbox__value" type="number"
|
||||
v-model="inputValue" :style="{color}" />
|
||||
<view @click="_calcValue('plus')" class="uni-numbox__plus uni-numbox-btns" :style="{background}">
|
||||
<text class="uni-numbox--text" :class="{ 'uni-numbox--disabled': inputValue >= max || disabled }" :style="{color}">+</text>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
/**
|
||||
* NumberBox 数字输入框
|
||||
* @description 带加减按钮的数字输入框
|
||||
* @tutorial https://ext.dcloud.net.cn/plugin?id=31
|
||||
* @property {Number} value 输入框当前值
|
||||
* @property {Number} min 最小值
|
||||
* @property {Number} max 最大值
|
||||
* @property {Number} step 每次点击改变的间隔大小
|
||||
* @property {String} background 背景色
|
||||
* @property {String} color 字体颜色(前景色)
|
||||
* @property {Boolean} disabled = [true|false] 是否为禁用状态
|
||||
* @event {Function} change 输入框值改变时触发的事件,参数为输入框当前的 value
|
||||
* @event {Function} focus 输入框聚焦时触发的事件,参数为 event 对象
|
||||
* @event {Function} blur 输入框失焦时触发的事件,参数为 event 对象
|
||||
*/
|
||||
|
||||
export default {
|
||||
name: "UniNumberBox",
|
||||
emits: ['change', 'input', 'update:modelValue', 'blur', 'focus'],
|
||||
props: {
|
||||
value: {
|
||||
type: [Number, String],
|
||||
default: 1
|
||||
},
|
||||
modelValue: {
|
||||
type: [Number, String],
|
||||
default: 1
|
||||
},
|
||||
min: {
|
||||
type: Number,
|
||||
default: 0
|
||||
},
|
||||
max: {
|
||||
type: Number,
|
||||
default: 100
|
||||
},
|
||||
step: {
|
||||
type: Number,
|
||||
default: 1
|
||||
},
|
||||
background: {
|
||||
type: String,
|
||||
default: '#f5f5f5'
|
||||
},
|
||||
color: {
|
||||
type: String,
|
||||
default: '#333'
|
||||
},
|
||||
disabled: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
inputValue: 0
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
value(val) {
|
||||
this.inputValue = +val;
|
||||
},
|
||||
modelValue(val) {
|
||||
this.inputValue = +val;
|
||||
}
|
||||
},
|
||||
created() {
|
||||
if (this.value === 1) {
|
||||
this.inputValue = +this.modelValue;
|
||||
}
|
||||
if (this.modelValue === 1) {
|
||||
this.inputValue = +this.value;
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
_calcValue(type) {
|
||||
if (this.disabled) {
|
||||
return;
|
||||
}
|
||||
const scale = this._getDecimalScale();
|
||||
let value = this.inputValue * scale;
|
||||
let step = this.step * scale;
|
||||
if (type === "minus") {
|
||||
value -= step;
|
||||
if (value < (this.min * scale)) {
|
||||
return;
|
||||
}
|
||||
if (value > (this.max * scale)) {
|
||||
value = this.max * scale
|
||||
}
|
||||
}
|
||||
|
||||
if (type === "plus") {
|
||||
value += step;
|
||||
if (value > (this.max * scale)) {
|
||||
return;
|
||||
}
|
||||
if (value < (this.min * scale)) {
|
||||
value = this.min * scale
|
||||
}
|
||||
}
|
||||
|
||||
this.inputValue = (value / scale).toFixed(String(scale).length - 1);
|
||||
this.$emit("change", +this.inputValue);
|
||||
// TODO vue2 兼容
|
||||
this.$emit("input", +this.inputValue);
|
||||
// TODO vue3 兼容
|
||||
this.$emit("update:modelValue", +this.inputValue);
|
||||
},
|
||||
_getDecimalScale() {
|
||||
|
||||
let scale = 1;
|
||||
// 浮点型
|
||||
if (~~this.step !== this.step) {
|
||||
scale = Math.pow(10, String(this.step).split(".")[1].length);
|
||||
}
|
||||
return scale;
|
||||
},
|
||||
_onBlur(event) {
|
||||
this.$emit('blur', event)
|
||||
let value = event.detail.value;
|
||||
if (!value) {
|
||||
// this.inputValue = 0;
|
||||
return;
|
||||
}
|
||||
value = +value;
|
||||
if (value > this.max) {
|
||||
value = this.max;
|
||||
} else if (value < this.min) {
|
||||
value = this.min;
|
||||
}
|
||||
const scale = this._getDecimalScale();
|
||||
this.inputValue = value.toFixed(String(scale).length - 1);
|
||||
this.$emit("change", +this.inputValue);
|
||||
this.$emit("input", +this.inputValue);
|
||||
},
|
||||
_onFocus(event) {
|
||||
this.$emit('focus', event)
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
$box-height: 40rpx;
|
||||
$bg: #f5f5f5;
|
||||
$br: 2px;
|
||||
$color: #333;
|
||||
|
||||
.uni-numbox {
|
||||
/* #ifndef APP-NVUE */
|
||||
display: inline-flex;
|
||||
/* #endif */
|
||||
flex-direction: row;
|
||||
}
|
||||
|
||||
.uni-numbox-btns {
|
||||
/* #ifndef APP-NVUE */
|
||||
display: flex;
|
||||
/* #endif */
|
||||
width: $box-height;
|
||||
height: $box-height;
|
||||
border-radius: 50%;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background-color: $bg;
|
||||
/* #ifdef H5 */
|
||||
cursor: pointer;
|
||||
/* #endif */
|
||||
}
|
||||
|
||||
.uni-numbox__value {
|
||||
margin: 0 2px;
|
||||
width: 40px;
|
||||
height: $box-height;
|
||||
text-align: center;
|
||||
font-size: 14px;
|
||||
border-left-width: 0;
|
||||
border-right-width: 0;
|
||||
color: $color;
|
||||
}
|
||||
|
||||
.uni-numbox--text {
|
||||
// fix nvue
|
||||
line-height: 20px;
|
||||
font-size: 18px;
|
||||
font-weight: 300;
|
||||
margin-bottom: 6rpx;
|
||||
color: $color;
|
||||
}
|
||||
|
||||
.uni-numbox .uni-numbox--disabled {
|
||||
color: #c0c0c0 !important;
|
||||
/* #ifdef H5 */
|
||||
cursor: not-allowed;
|
||||
/* #endif */
|
||||
}
|
||||
</style>
|
||||
85
uni_modules/uni-number-box/package.json
Normal file
85
uni_modules/uni-number-box/package.json
Normal file
@@ -0,0 +1,85 @@
|
||||
{
|
||||
"id": "uni-number-box",
|
||||
"displayName": "uni-number-box 数字输入框",
|
||||
"version": "1.2.1",
|
||||
"description": "NumberBox 带加减按钮的数字输入框组件,用户可以控制每次点击增加的数值,支持小数。",
|
||||
"keywords": [
|
||||
"uni-ui",
|
||||
"uniui",
|
||||
"数字输入框"
|
||||
],
|
||||
"repository": "https://github.com/dcloudio/uni-ui",
|
||||
"engines": {
|
||||
"HBuilderX": ""
|
||||
},
|
||||
"directories": {
|
||||
"example": "../../temps/example_temps"
|
||||
},
|
||||
"dcloudext": {
|
||||
"category": [
|
||||
"前端组件",
|
||||
"通用组件"
|
||||
],
|
||||
"sale": {
|
||||
"regular": {
|
||||
"price": "0.00"
|
||||
},
|
||||
"sourcecode": {
|
||||
"price": "0.00"
|
||||
}
|
||||
},
|
||||
"contact": {
|
||||
"qq": ""
|
||||
},
|
||||
"declaration": {
|
||||
"ads": "无",
|
||||
"data": "无",
|
||||
"permissions": "无"
|
||||
},
|
||||
"npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui"
|
||||
},
|
||||
"uni_modules": {
|
||||
"dependencies": ["uni-scss"],
|
||||
"encrypt": [],
|
||||
"platforms": {
|
||||
"cloud": {
|
||||
"tcb": "y",
|
||||
"aliyun": "y"
|
||||
},
|
||||
"client": {
|
||||
"App": {
|
||||
"app-vue": "y",
|
||||
"app-nvue": "y"
|
||||
},
|
||||
"H5-mobile": {
|
||||
"Safari": "y",
|
||||
"Android Browser": "y",
|
||||
"微信浏览器(Android)": "y",
|
||||
"QQ浏览器(Android)": "y"
|
||||
},
|
||||
"H5-pc": {
|
||||
"Chrome": "y",
|
||||
"IE": "y",
|
||||
"Edge": "y",
|
||||
"Firefox": "y",
|
||||
"Safari": "y"
|
||||
},
|
||||
"小程序": {
|
||||
"微信": "y",
|
||||
"阿里": "y",
|
||||
"百度": "y",
|
||||
"字节跳动": "y",
|
||||
"QQ": "y"
|
||||
},
|
||||
"快应用": {
|
||||
"华为": "u",
|
||||
"联盟": "u"
|
||||
},
|
||||
"Vue": {
|
||||
"vue2": "y",
|
||||
"vue3": "y"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
13
uni_modules/uni-number-box/readme.md
Normal file
13
uni_modules/uni-number-box/readme.md
Normal file
@@ -0,0 +1,13 @@
|
||||
|
||||
|
||||
## NumberBox 数字输入框
|
||||
> **组件名:uni-number-box**
|
||||
> 代码块: `uNumberBox`
|
||||
|
||||
|
||||
带加减按钮的数字输入框。
|
||||
|
||||
### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-number-box)
|
||||
#### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839
|
||||
|
||||
|
||||
126
wallet/Wallet.js
Normal file
126
wallet/Wallet.js
Normal file
@@ -0,0 +1,126 @@
|
||||
import Bitcore from "bitcore-lib"
|
||||
import Mnemonic from "bitcore-mnemonic"
|
||||
import secp256k1 from 'secp256k1'
|
||||
import {
|
||||
Address,
|
||||
pubToAddress,
|
||||
toBuffer,
|
||||
toChecksumAddress,
|
||||
intToBuffer
|
||||
} from 'ethereumjs-util'
|
||||
import coinType from './networks.js'
|
||||
import basex from 'base-x'
|
||||
|
||||
export default class Wallet {
|
||||
|
||||
static coinType = coinType
|
||||
|
||||
/**
|
||||
* 生成助记词
|
||||
* @param {Object} lang
|
||||
*/
|
||||
static generateMnemonic(lang) {
|
||||
if (lang) {
|
||||
return (new Mnemonic(this.getLanguage(lang))).toString();
|
||||
} else {
|
||||
return (new Mnemonic()).toString();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 验证助记词
|
||||
* @param {Object} code
|
||||
* @param {Object} lang
|
||||
*/
|
||||
static validMnemonic(code, lang) {
|
||||
if (lang) {
|
||||
return Mnemonic.isValid(code, this.getLanguage(lang));
|
||||
} else {
|
||||
return Mnemonic.isValid(code);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取助记词字典
|
||||
* @param {Object} lang
|
||||
*/
|
||||
static getLanguage(lang) {
|
||||
return Mnemonic.Words[lang]
|
||||
}
|
||||
|
||||
/**
|
||||
* 转成硬钱包私钥
|
||||
* @param {Object} code
|
||||
*/
|
||||
static toHDPrivateKey(code) {
|
||||
return (new Mnemonic(code)).toHDPrivateKey()
|
||||
}
|
||||
|
||||
/**
|
||||
* 验证地址是否合法
|
||||
* @param {Object} addr
|
||||
*/
|
||||
static isValidAddress(addr) {
|
||||
return Bitcore.Address.isValid(addr)
|
||||
}
|
||||
|
||||
/**
|
||||
* 硬钱包私钥转成对应网络的 地址 和 私钥
|
||||
* @param {Object} hdPrivateKey
|
||||
* @param {Object} type
|
||||
*/
|
||||
static HDPrivateKeyToAddress(hdPrivateKey, type) {
|
||||
const derived = hdPrivateKey.derive("m/44'/" + type.type + "'/0'/0/0");
|
||||
if (type.type === 195) {
|
||||
const ethAddr = this.getEthereumAddress(derived)
|
||||
const addressBuffer = Buffer.concat([intToBuffer(0x41), ethAddr.buf], 21)
|
||||
return {
|
||||
address: Bitcore.encoding.Base58Check.encode(addressBuffer),
|
||||
public_key: derived.privateKey.publicKey.toString(),
|
||||
private_key: derived.privateKey.toString()
|
||||
}
|
||||
}
|
||||
if (type.type === 144) {
|
||||
let addr = derived.privateKey.toAddress(type.network).toString()
|
||||
let deco = Bitcore.encoding.Base58.decode(addr)
|
||||
|
||||
return {
|
||||
address: basex('rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz').encode(deco),
|
||||
public_key: derived.privateKey.publicKey.toString(),
|
||||
private_key: derived.privateKey.toString()
|
||||
}
|
||||
}
|
||||
if (this.networkIsEthereum(type)) {
|
||||
return {
|
||||
address: toChecksumAddress(this.getEthereumAddress(derived).toString()),
|
||||
public_key: derived.privateKey.publicKey.toString(),
|
||||
private_key: derived.privateKey.toString()
|
||||
}
|
||||
}
|
||||
return {
|
||||
address: derived.privateKey.toAddress(type.network).toString(),
|
||||
public_key: derived.privateKey.publicKey.toString(),
|
||||
private_key: derived.privateKey.toString()
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 以太坊地址格式转换
|
||||
* @param {Object} derived
|
||||
*/
|
||||
static getEthereumAddress(derived) {
|
||||
const publicKey = derived.hdPublicKey.publicKey.toBuffer()
|
||||
const ethPublicKey = secp256k1.publicKeyConvert(publicKey, false)
|
||||
.slice(1)
|
||||
return Address.fromPublicKey(toBuffer(ethPublicKey))
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否是以太坊网络
|
||||
* @param {Object} type
|
||||
*/
|
||||
static networkIsEthereum(type) {
|
||||
return type.isEthereum
|
||||
}
|
||||
|
||||
}
|
||||
29
wallet/_test.js
Normal file
29
wallet/_test.js
Normal file
@@ -0,0 +1,29 @@
|
||||
import {
|
||||
Wallet
|
||||
} from "./Wallet.js"
|
||||
|
||||
const code = Wallet.generateMnemonic(this.defaultLanguage)
|
||||
this.mnemonicCode = code
|
||||
const hdPrivateKey = Wallet.toHDPrivateKey(this.mnemonicCode)
|
||||
// const derived = hdPrivateKey.derive("m/44'/61'/0'/0/0");
|
||||
// const publicKey = derived.hdPublicKey.publicKey.toBuffer()
|
||||
// const ethPublicKey = secp256k1.publicKeyConvert(publicKey, false)
|
||||
// .slice(1)
|
||||
|
||||
// const ethAddr = Address.fromPublicKey(toBuffer(ethPublicKey)).toString();
|
||||
|
||||
// console.log(toChecksumAddress(ethAddr));
|
||||
|
||||
// console.log(Address.fromPrivateKey(hdPrivateKey.hdPublicKey.publicKey.toBuffer()));
|
||||
|
||||
var addr = []
|
||||
for (var i in this.coinType) {
|
||||
let whk = Wallet.HDPrivateKeyToAddress(hdPrivateKey, i)
|
||||
let parmas = {
|
||||
name: this.coinType[i],
|
||||
address: whk.address,
|
||||
private_key: whk.private_key,
|
||||
}
|
||||
addr.push(parmas)
|
||||
}
|
||||
this.address = addr
|
||||
24
wallet/index.js
Normal file
24
wallet/index.js
Normal file
@@ -0,0 +1,24 @@
|
||||
import store from "@/store/index.js"
|
||||
|
||||
const USE_SOTER_AUTH_KEY = 'USE_SOTER_AUTH_KEY'
|
||||
|
||||
/**
|
||||
* 初始化配置
|
||||
*/
|
||||
const initWalletConfigs = () => {
|
||||
// 生物识别
|
||||
const USE_SOTER = Boolean(uni.getStorageSync(USE_SOTER_AUTH_KEY))
|
||||
store.dispatch('wallet/setSoterAuth', USE_SOTER)
|
||||
// 获取默认钱包
|
||||
}
|
||||
|
||||
const setSoterAuthStatus = (opt) => {
|
||||
uni.setStorageSync(USE_SOTER_AUTH_KEY, opt)
|
||||
store.dispatch('wallet/setSoterAuth', opt)
|
||||
}
|
||||
|
||||
export default {
|
||||
USE_SOTER_AUTH_KEY,
|
||||
setSoterAuthStatus,
|
||||
initWalletConfigs
|
||||
}
|
||||
209
wallet/networks.js
Normal file
209
wallet/networks.js
Normal file
@@ -0,0 +1,209 @@
|
||||
import Bitcore from "bitcore-lib"
|
||||
|
||||
export default [{
|
||||
type: 0,
|
||||
name: '比特币',
|
||||
symbol: 'BTC',
|
||||
code: 'btc',
|
||||
isEthereum: false,
|
||||
network: Bitcore.Networks.mainnet
|
||||
},
|
||||
{
|
||||
type: 60,
|
||||
name: '以太坊',
|
||||
symbol: 'ETH',
|
||||
code: 'eth',
|
||||
isEthereum: true
|
||||
},
|
||||
{
|
||||
type: 61,
|
||||
name: '以太经典',
|
||||
symbol: 'ETC',
|
||||
code: 'etc',
|
||||
isEthereum: true
|
||||
},
|
||||
{
|
||||
type: 60,
|
||||
name: '赤子心',
|
||||
symbol: 'CZX',
|
||||
code: 'eth_0x3a2a239b1bdaae768ffa06314d523e88e98d4d1f',
|
||||
isEthereum: true
|
||||
},
|
||||
// {
|
||||
// type: 2,
|
||||
// name: '莱特币',
|
||||
// symbol: 'LTC',
|
||||
// isEthereum: false,
|
||||
// network: Bitcore.Networks.add({
|
||||
// name: 'LTC',
|
||||
// alias: 'LTC',
|
||||
// pubkeyhash: 0x30,
|
||||
// privatekey: 0x32,
|
||||
// scripthash: 0xb0,
|
||||
// bech32prefix: 'ltc',
|
||||
// xpubkey: 0x019da462,
|
||||
// xprivkey: 0x019d9cfe,
|
||||
// networkMagic: 0xdbb6c0fb
|
||||
// })
|
||||
// },
|
||||
{
|
||||
type: 3,
|
||||
name: '狗狗币',
|
||||
symbol: 'DOGE',
|
||||
code: 'doge',
|
||||
isEthereum: false,
|
||||
network: Bitcore.Networks.add({
|
||||
name: 'DOGE',
|
||||
alias: 'DOGE',
|
||||
pubkeyhash: 0x1e,
|
||||
privatekey: 0x16,
|
||||
scripthash: 0x9e,
|
||||
bech32prefix: 'doge',
|
||||
xpubkey: 0x02facafd,
|
||||
xprivkey: 0x02fac398,
|
||||
networkMagic: 0xc0c0c0c0
|
||||
})
|
||||
},
|
||||
|
||||
// {
|
||||
// type: 133,
|
||||
// name: '零币',
|
||||
// symbol: 'ZEC',
|
||||
// isEthereum: false,
|
||||
// network: Bitcore.Networks.add({
|
||||
// name: 'ZEC',
|
||||
// alias: 'ZEC',
|
||||
// pubkeyhash: 0x1e,
|
||||
// privatekey: 0x16,
|
||||
// scripthash: 0x9e,
|
||||
// bech32prefix: 'doge',
|
||||
// xpubkey: 0x02facafd,
|
||||
// xprivkey: 0x02fac398,
|
||||
// networkMagic: 0xc0c0c0c0
|
||||
// })
|
||||
// },
|
||||
// {
|
||||
// type: 144,
|
||||
// name: 'XPR - 瑞波币',
|
||||
// symbol: 'XPR',
|
||||
// isEthereum: false,
|
||||
// network: Bitcore.Networks.add({
|
||||
// name: 'XPR',
|
||||
// alias: 'XPR',
|
||||
// pubkeyhash: 0x1e,
|
||||
// privatekey: 0x16,
|
||||
// scripthash: 0x9e,
|
||||
// bech32prefix: 'doge',
|
||||
// xpubkey: 0x02facafd,
|
||||
// xprivkey: 0x02fac398,
|
||||
// networkMagic: 0xc0c0c0c0
|
||||
// })
|
||||
// },
|
||||
// {
|
||||
// type: 145,
|
||||
// name: '比特现金',
|
||||
// symbol: 'BCH',
|
||||
// isEthereum: false,
|
||||
// network: Bitcore.Networks.add({
|
||||
// name: 'BCH',
|
||||
// alias: 'BCH',
|
||||
// pubkeyhash: 0x00,
|
||||
// privatekey: 0x05,
|
||||
// scripthash: 0x80,
|
||||
// bech32prefix: 'bitcoincash',
|
||||
// xpubkey: 0x0488b21e,
|
||||
// xprivkey: 0x0488ade4,
|
||||
// networkMagic: 0xd9b4bef9
|
||||
// })
|
||||
// },
|
||||
// {
|
||||
// type: 195,
|
||||
// name: '波场',
|
||||
// symbol: 'TRX',
|
||||
// isEthereum: false,
|
||||
// network: Bitcore.Networks.add({
|
||||
// name: 'TRX',
|
||||
// alias: 'TRX',
|
||||
// pubkeyhash: 0x41,
|
||||
// privatekey: 0x05,
|
||||
// scripthash: 0x80,
|
||||
// bech32prefix: '',
|
||||
// xpubkey: 0x0488b21e,
|
||||
// xprivkey: 0x0488ade4
|
||||
// })
|
||||
// },
|
||||
{
|
||||
type: 195,
|
||||
name: 'USDT(TRC20)',
|
||||
symbol: 'USDT',
|
||||
code: 'trx_TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t',
|
||||
isEthereum: false,
|
||||
network: Bitcore.Networks.add({
|
||||
name: 'USDT',
|
||||
alias: 'USDT',
|
||||
pubkeyhash: 0x41,
|
||||
privatekey: 0x05,
|
||||
scripthash: 0x80,
|
||||
bech32prefix: '',
|
||||
xpubkey: 0x0488b21e,
|
||||
xprivkey: 0x0488ade4
|
||||
})
|
||||
},
|
||||
{
|
||||
type: 195,
|
||||
name: 'USDT(ERC20)',
|
||||
symbol: 'USDT',
|
||||
code: 'eth_0xdac17f958d2ee523a2206206994597c13d831ec7',
|
||||
isEthereum: true
|
||||
},
|
||||
{
|
||||
type: 0,
|
||||
name: 'USDT(OMNI)',
|
||||
symbol: 'USDT',
|
||||
code: 'usdt',
|
||||
isEthereum: false,
|
||||
network: Bitcore.Networks.mainnet
|
||||
},
|
||||
{
|
||||
type: 13107,
|
||||
name: '比特元',
|
||||
symbol: 'BTY',
|
||||
code: 'bty',
|
||||
isEthereum: false,
|
||||
network: Bitcore.Networks.add({
|
||||
name: 'BTY',
|
||||
alias: 'BTY',
|
||||
pubkeyhash: 0x00,
|
||||
privatekey: 0x05,
|
||||
scripthash: 0x80,
|
||||
bech32prefix: 'bityuan',
|
||||
xpubkey: 0x0488b21e,
|
||||
xprivkey: 0x0488ade4,
|
||||
networkMagic: 0xd9b4bef9
|
||||
})
|
||||
},
|
||||
// {
|
||||
// type: 60,
|
||||
// name: '元链',
|
||||
// symbol: 'YCC',
|
||||
// isEthereum: true
|
||||
// },
|
||||
{
|
||||
type: 13107,
|
||||
name: 'JZC',
|
||||
symbol: 'JZC',
|
||||
code: 'bty',
|
||||
isEthereum: false,
|
||||
network: Bitcore.Networks.add({
|
||||
name: 'JZC',
|
||||
alias: 'JZC',
|
||||
pubkeyhash: 0x00,
|
||||
privatekey: 0x05,
|
||||
scripthash: 0x80,
|
||||
bech32prefix: 'bityuan',
|
||||
xpubkey: 0x0488b21e,
|
||||
xprivkey: 0x0488ade4,
|
||||
networkMagic: 0xd9b4bef9
|
||||
})
|
||||
}
|
||||
]
|
||||
Reference in New Issue
Block a user