Compare commits
39 Commits
a06c2c78e9
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
72bb6294e3 | ||
| c1b2823298 | |||
| 9f4f923b8e | |||
| 83e96cd64d | |||
| 9c257e5303 | |||
| d69486541b | |||
| 6b2293f8eb | |||
| 61c306bcc0 | |||
| a450e594b4 | |||
| 163df819ac | |||
| 8ea7a49dcb | |||
| e32aeb507c | |||
| 47f969767f | |||
| 3aa6fb1882 | |||
| 2d7da5d5c6 | |||
| 1b41b40de9 | |||
| 9156029027 | |||
| f46c33d827 | |||
| f53fcec0a9 | |||
| a9e877c850 | |||
| 8bd3f5e1aa | |||
| 335a2a6515 | |||
| a5186e5d0b | |||
| c2f108a77b | |||
| 4854c04fb7 | |||
| 199c61af55 | |||
| 2855bb58e6 | |||
| 6155d93548 | |||
|
|
45c79ef478 | ||
|
|
e18e3b8829 | ||
|
|
992be56ee9 | ||
|
|
0c19bec510 | ||
|
|
ce1f3ff02f | ||
|
|
09c68e4289 | ||
|
|
c699dd2f15 | ||
|
|
81ff53730b | ||
|
|
3b765af414 | ||
|
|
0cdc28c1ec | ||
|
|
db42cc974c |
38
App.vue
@@ -1,24 +1,36 @@
|
|||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
onLaunch () {
|
onLaunch() {
|
||||||
console.log('App Launch')
|
// if (typeof WeixinJSBridge == 'object' && typeof WeixinJSBridge.invoke == 'function') {
|
||||||
|
// handleFontSize()
|
||||||
|
// } else {
|
||||||
|
// document.addEventListener('WeixinJSBridgeReady', handleFontSize, false);
|
||||||
|
// }
|
||||||
|
// function handleFontSize() {
|
||||||
|
// // 设置网页字体为默认大小
|
||||||
|
// WeixinJSBridge.invoke('setFontSizeCallback', { fontSize: 0 })
|
||||||
|
// // 重写设置网页字体大小的事件
|
||||||
|
// WeixinJSBridge.on('menu:setfont', function() {
|
||||||
|
// WeixinJSBridge.invoke('setFontSizeCallback', { fontSize: 0 })
|
||||||
|
// })
|
||||||
|
// }
|
||||||
},
|
},
|
||||||
onShow () {
|
onShow() {
|
||||||
console.log('App Show')
|
console.log('App Show');
|
||||||
uni.hideLoading()
|
|
||||||
},
|
},
|
||||||
onHide () {
|
onHide() {
|
||||||
console.log('App Hide')
|
console.log('App Hide');
|
||||||
},
|
},
|
||||||
globalData: {
|
globalData: {
|
||||||
mainColor: "white"
|
mainColor: 'white'
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
@import "uview-ui/index.scss";
|
@import 'uview-ui/index.scss';
|
||||||
page{
|
page {
|
||||||
background: #f5f5f5;
|
background: #f5f5f5;
|
||||||
}
|
-webkit-text-size-adjust: 100% !important;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
# 易货App
|
# 易货App
|
||||||
|
因项目太大无法上传文件废弃,新指向:https://git.yuzhankeji.cn/UzTech/EB_Barter_App.git
|
||||||
_开发临时存储资源存放在/static/dev目录下_
|
_开发临时存储资源存放在/static/dev目录下_
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -31,13 +31,13 @@ const request = (parameter) => {
|
|||||||
'Authorization': store.getters.getToken || ''
|
'Authorization': store.getters.getToken || ''
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log('parameterDbug', parameter)
|
// console.log('parameterDbug', parameter)
|
||||||
|
|
||||||
// 加载提示
|
// 加载提示
|
||||||
uni.showLoading({
|
// uni.showLoading({
|
||||||
title: '加载中',
|
// title: '加载中',
|
||||||
mask : true
|
// mask : true
|
||||||
});
|
// });
|
||||||
// 请求实例
|
// 请求实例
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
uni.request({
|
uni.request({
|
||||||
|
|||||||
@@ -172,6 +172,44 @@ const managesGoodsExtends = id => {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 通证权益 搜索页面
|
||||||
|
const searchUrl = (apiUrl,data) => {
|
||||||
|
return request({
|
||||||
|
url : apiUrl,
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 商品分类
|
||||||
|
const goodsCategory = () => {
|
||||||
|
return request({
|
||||||
|
url : 'mall/categories'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 企业行业分类
|
||||||
|
const companyCategory = () => {
|
||||||
|
return request({
|
||||||
|
url : 'companies/industry'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 商品分类搜索-默认关键字
|
||||||
|
const randgoodsUrl = (apiUrl, data) => {
|
||||||
|
return request({
|
||||||
|
url: apiUrl,
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 商品确认商品信息页面get 下单页 post
|
||||||
|
const mallBuyGoods = (data, method) => {
|
||||||
|
return request({
|
||||||
|
url: 'mall/buy/goods',
|
||||||
|
method: method,
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
export {
|
export {
|
||||||
mall,
|
mall,
|
||||||
list,
|
list,
|
||||||
@@ -193,5 +231,10 @@ export {
|
|||||||
managesTracedTo,
|
managesTracedTo,
|
||||||
managesCoupons,
|
managesCoupons,
|
||||||
managesGoodsPut,
|
managesGoodsPut,
|
||||||
managesGoodsExtends
|
managesGoodsExtends,
|
||||||
|
searchUrl,
|
||||||
|
goodsCategory,
|
||||||
|
companyCategory,
|
||||||
|
randgoodsUrl,
|
||||||
|
mallBuyGoods
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,9 @@
|
|||||||
* moduleName:个人中心相关操作
|
* moduleName:个人中心相关操作
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { request } from '../index'
|
import {
|
||||||
|
request
|
||||||
|
} from '../index'
|
||||||
|
|
||||||
// 关注店铺
|
// 关注店铺
|
||||||
const shopSubscribe = (id) => {
|
const shopSubscribe = (id) => {
|
||||||
@@ -17,9 +19,9 @@ const shopSubscribe = (id) => {
|
|||||||
const shopSubscribeList = (page) => {
|
const shopSubscribeList = (page) => {
|
||||||
return request({
|
return request({
|
||||||
url: 'mall/shops/subscribe',
|
url: 'mall/shops/subscribe',
|
||||||
method:'get',
|
method: 'get',
|
||||||
data:{
|
data: {
|
||||||
page:page
|
page: page
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -49,8 +51,8 @@ const getUserSettingInfo = () => {
|
|||||||
const chaineb = (data) => {
|
const chaineb = (data) => {
|
||||||
return request({
|
return request({
|
||||||
url: 'user/account/chaineb',
|
url: 'user/account/chaineb',
|
||||||
method:'get',
|
method: 'get',
|
||||||
data:data
|
data: data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -60,19 +62,19 @@ const browsers = (page) => {
|
|||||||
url: 'mall/goods/browsers',
|
url: 'mall/goods/browsers',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
data: {
|
data: {
|
||||||
page:page,
|
page: page,
|
||||||
page_size:20
|
page_size: 20
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// 修改用户头像或昵称
|
// 修改用户头像或昵称
|
||||||
const resetUserInfo= (data) => {
|
const resetUserInfo = (data) => {
|
||||||
return request({
|
return request({
|
||||||
url: 'user/'+data.key,
|
url: 'user/' + data.key,
|
||||||
method: 'PUT',
|
method: 'PUT',
|
||||||
data:{
|
data: {
|
||||||
value:data.value
|
value: data.value
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,7 +24,24 @@ const eb = (no) => {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 微信支付
|
||||||
|
const wxPay = (data) => {
|
||||||
|
return request({
|
||||||
|
url: 'mall/pay/' + data.order_no + '/wechat',
|
||||||
|
data: data,
|
||||||
|
method:'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// EB支付
|
||||||
|
const ebPay = (data) => {
|
||||||
|
return request({
|
||||||
|
url: 'mall/pay/' + data.order_no + '/eb'
|
||||||
|
})
|
||||||
|
}
|
||||||
export {
|
export {
|
||||||
buy,
|
buy,
|
||||||
eb
|
eb,
|
||||||
|
wxPay,
|
||||||
|
ebPay
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -54,4 +54,5 @@ export {
|
|||||||
editInfo,
|
editInfo,
|
||||||
putShop,
|
putShop,
|
||||||
deleteShop
|
deleteShop
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -63,12 +63,10 @@ const companiesCode = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 退货单列表
|
// 退货单列表
|
||||||
const storeReturn = (state) => {
|
const storeReturn = (data) => {
|
||||||
return request({
|
return request({
|
||||||
url: 'manages/refunds',
|
url: 'manages/refunds',
|
||||||
data: {
|
data: data
|
||||||
state
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -110,12 +108,10 @@ const storeAudit = (refund_id, data) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 提货单列表
|
// 提货单列表
|
||||||
const storeDeliver = (state) => {
|
const storeDeliver = (data) => {
|
||||||
return request({
|
return request({
|
||||||
url: 'manages/shipments',
|
url: 'manages/shipments',
|
||||||
data: {
|
data: data
|
||||||
state
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
167
apis/interfaces/wallet.js
Normal file
@@ -0,0 +1,167 @@
|
|||||||
|
|
||||||
|
/**
|
||||||
|
* Web唐明明
|
||||||
|
* 匆匆数载恍如梦,岁月迢迢华发增。
|
||||||
|
* 碌碌无为枉半生,一朝惊醒万事空。
|
||||||
|
* moduleName: 钱包
|
||||||
|
*/
|
||||||
|
|
||||||
|
import {request} from '../index.js'
|
||||||
|
|
||||||
|
// 导出助记词
|
||||||
|
const seed = () => {
|
||||||
|
return request({
|
||||||
|
url: 'chain/safe/seed'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
const hash = (data) => {
|
||||||
|
return request({
|
||||||
|
url: 'chain/wallet/hash',
|
||||||
|
method: 'POST',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 收款码
|
||||||
|
const code = () => {
|
||||||
|
return request({
|
||||||
|
url: 'chain/account/code'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 原石余额
|
||||||
|
const sum = () => {
|
||||||
|
return request({
|
||||||
|
url: 'chain/account/balance'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 原石价格
|
||||||
|
const price = () => {
|
||||||
|
return request({
|
||||||
|
url: 'nodes/price'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 账户记录
|
||||||
|
const logs = (data) => {
|
||||||
|
return request({
|
||||||
|
url: 'chain/account/logs',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 设置安全密码
|
||||||
|
const security = (data) => {
|
||||||
|
return request({
|
||||||
|
url: 'chain/safe/security',
|
||||||
|
method: 'POST',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 转账
|
||||||
|
const transfer = (data) => {
|
||||||
|
return request({
|
||||||
|
url: 'chain/account/transfer',
|
||||||
|
method: 'POST',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 钱包私钥
|
||||||
|
const privatekey = (code) => {
|
||||||
|
return request({
|
||||||
|
url : "chain/safe/private_key",
|
||||||
|
data: {
|
||||||
|
code
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取可提现信息
|
||||||
|
const withdraw = () => {
|
||||||
|
return request({
|
||||||
|
url : "withdraw"
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 提现记录
|
||||||
|
const withdrawLogs = (data) => {
|
||||||
|
return request({
|
||||||
|
url : "withdraw/logs",
|
||||||
|
data:data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 提现
|
||||||
|
const withdrawDo = (data) => {
|
||||||
|
return request({
|
||||||
|
url : "withdraw",
|
||||||
|
method: 'POST',
|
||||||
|
data:data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 验证支付密码是否正确
|
||||||
|
const securityCheck = (password) => {
|
||||||
|
return request({
|
||||||
|
url : "chain/safe/security/check",
|
||||||
|
method: 'POST',
|
||||||
|
data:{
|
||||||
|
code : password,
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 修改密码
|
||||||
|
const securityReset = (data) => {
|
||||||
|
return request({
|
||||||
|
url : "chain/safe/security",
|
||||||
|
method: 'PUT',
|
||||||
|
data:data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 提现服务条款
|
||||||
|
const cmsWithdraw = () => {
|
||||||
|
return request({
|
||||||
|
url : "cms/withdraw"
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 私钥规则
|
||||||
|
const keyrules = () => {
|
||||||
|
return request({
|
||||||
|
url: 'cms/keyrules'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 能量球转红包前置,获取能量球的基本信息
|
||||||
|
const accountCashs = (data) => {
|
||||||
|
return request({
|
||||||
|
url: 'user/account/cashs',
|
||||||
|
data:data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
export {
|
||||||
|
seed,
|
||||||
|
hash,
|
||||||
|
code,
|
||||||
|
sum,
|
||||||
|
price,
|
||||||
|
logs,
|
||||||
|
security,
|
||||||
|
transfer,
|
||||||
|
privatekey,
|
||||||
|
withdraw,
|
||||||
|
withdrawLogs,
|
||||||
|
withdrawDo,
|
||||||
|
securityCheck,
|
||||||
|
securityReset,
|
||||||
|
cmsWithdraw,
|
||||||
|
keyrules,
|
||||||
|
accountCashs
|
||||||
|
}
|
||||||
|
|
||||||
123
apis/interfaces/withdraws.js
Normal file
@@ -0,0 +1,123 @@
|
|||||||
|
/**
|
||||||
|
* zdx
|
||||||
|
* moduleName: 提现模块
|
||||||
|
*/
|
||||||
|
|
||||||
|
import {
|
||||||
|
request
|
||||||
|
} from '../index.js'
|
||||||
|
|
||||||
|
|
||||||
|
// 添加前置条件
|
||||||
|
const accountsCreate = () => {
|
||||||
|
return request({
|
||||||
|
url: 'withdraws/accounts/create'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 添加银行卡
|
||||||
|
const withdrawsAccounts = (data) => {
|
||||||
|
return request({
|
||||||
|
url: 'withdraws/accounts',
|
||||||
|
method: 'POST',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 银行卡列表
|
||||||
|
const withdrawsAccountsList = (data) => {
|
||||||
|
return request({
|
||||||
|
url: 'withdraws/accounts',
|
||||||
|
method: 'get',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 编辑银行卡前置
|
||||||
|
const accountsCreateEdit = (id) => {
|
||||||
|
return request({
|
||||||
|
url: 'withdraws/accounts/'+id+'/edit'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 编辑银行卡
|
||||||
|
const withdrawsAccountsEdits = (data) => {
|
||||||
|
return request({
|
||||||
|
url: 'withdraws/accounts/'+data.bank_account_id,
|
||||||
|
method: 'PUT',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除银行卡
|
||||||
|
const withdrawsAccountsDelete = (id) => {
|
||||||
|
return request({
|
||||||
|
url: 'withdraws/accounts/'+id,
|
||||||
|
method: 'DELETE'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 提现前置记录
|
||||||
|
const withdrawsIndexCreate = () => {
|
||||||
|
return request({
|
||||||
|
url: 'withdraws/index/create'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 提现接口
|
||||||
|
const withdrawsIndex = (data) => {
|
||||||
|
return request({
|
||||||
|
url: 'withdraws/index',
|
||||||
|
method: 'POST',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 提现记录
|
||||||
|
const withdrawsIndexLists = (data) => {
|
||||||
|
return request({
|
||||||
|
url: 'withdraws/index',
|
||||||
|
method: 'get',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 能量碎片记录
|
||||||
|
const userAccoutScores = (data) => {
|
||||||
|
return request({
|
||||||
|
url: 'user/account/scores',
|
||||||
|
method: 'get',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 能量球转红包前置
|
||||||
|
const cashsCreate = () => {
|
||||||
|
return request({
|
||||||
|
url: 'user/account/cashs/create',
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 能量球转红包
|
||||||
|
const accountCashs = (data) => {
|
||||||
|
return request({
|
||||||
|
url: 'user/account/cashs',
|
||||||
|
method: 'POST',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
export {
|
||||||
|
accountsCreate,
|
||||||
|
withdrawsAccounts,
|
||||||
|
withdrawsAccountsList,
|
||||||
|
accountsCreateEdit,
|
||||||
|
withdrawsAccountsEdits,
|
||||||
|
withdrawsAccountsDelete,
|
||||||
|
withdrawsIndexCreate,
|
||||||
|
withdrawsIndex,
|
||||||
|
withdrawsIndexLists,
|
||||||
|
userAccoutScores,
|
||||||
|
accountCashs,
|
||||||
|
cashsCreate
|
||||||
|
}
|
||||||
113
apis/request.js
@@ -1,113 +0,0 @@
|
|||||||
/**
|
|
||||||
|
|
||||||
*/
|
|
||||||
|
|
||||||
import store from '@/store'
|
|
||||||
|
|
||||||
// 基础配置
|
|
||||||
const config = {
|
|
||||||
apiUrl: 'https://e-chain.cnskl.com/api/',
|
|
||||||
timeout: 60000
|
|
||||||
}
|
|
||||||
|
|
||||||
let loginHintState = false
|
|
||||||
|
|
||||||
// 网络请求
|
|
||||||
const request = (parameter) => {
|
|
||||||
|
|
||||||
// 检查url配置
|
|
||||||
if (parameter.url === 'undefined' || parameter.url === '') {
|
|
||||||
uni.showToast({
|
|
||||||
title: '请求地址不能为空',
|
|
||||||
icon: 'none'
|
|
||||||
})
|
|
||||||
return
|
|
||||||
}
|
|
||||||
// 注入header
|
|
||||||
config.header = {
|
|
||||||
'Accept': 'application/json',
|
|
||||||
'Authorization': store.getters.getToken || ''
|
|
||||||
}
|
|
||||||
// 请求实例
|
|
||||||
return new Promise((resolve, reject) => {
|
|
||||||
uni.request({
|
|
||||||
url: config.apiUrl + parameter.url,
|
|
||||||
timeout: config.timeout,
|
|
||||||
header: config.header || {},
|
|
||||||
data: parameter.data || {},
|
|
||||||
method: parameter.method || 'GET',
|
|
||||||
success: res => {
|
|
||||||
if (res.header.Authorization) {
|
|
||||||
updateToken('token', res.header.Authorization)
|
|
||||||
}
|
|
||||||
if (res.statusCode === 200) {
|
|
||||||
const resolveData = res.data
|
|
||||||
if (resolveData.status_code === 200) {
|
|
||||||
resolve(resolveData.data)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if (resolveData.status_code === 401) {
|
|
||||||
loginHint()
|
|
||||||
return
|
|
||||||
}
|
|
||||||
reject(resolveData)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
errToast(res.statusCode)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// 处理一些http请求错误提示
|
|
||||||
const errToast = (code) => {
|
|
||||||
switch (code) {
|
|
||||||
case 404:
|
|
||||||
uni.showToast({
|
|
||||||
title: code + '接口不存在,请联系系统管理员',
|
|
||||||
icon: 'none'
|
|
||||||
})
|
|
||||||
break;
|
|
||||||
case 405:
|
|
||||||
uni.showToast({
|
|
||||||
title: code + '请检查接口请求方式错误',
|
|
||||||
icon: 'none'
|
|
||||||
})
|
|
||||||
break;
|
|
||||||
case 500:
|
|
||||||
uni.showToast({
|
|
||||||
title: code + '服务端错误,请检查服务器信息',
|
|
||||||
icon: 'none'
|
|
||||||
})
|
|
||||||
break;
|
|
||||||
case 401:
|
|
||||||
console.log('没有权限')
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 更新token
|
|
||||||
const updateToken = (token) => {
|
|
||||||
store.commit('setToken', token)
|
|
||||||
}
|
|
||||||
|
|
||||||
// 处理登录提示
|
|
||||||
const loginHint = () => {
|
|
||||||
if (loginHintState) return
|
|
||||||
if (!loginHintState) loginHintState = true
|
|
||||||
updateToken('')
|
|
||||||
uni.showModal({
|
|
||||||
title: '登录提示',
|
|
||||||
content: '您的登录信息已过期,请重新登录',
|
|
||||||
confirmColor: '#0055ff',
|
|
||||||
showCancel: false,
|
|
||||||
success: res => {
|
|
||||||
loginHintState = false
|
|
||||||
if (res.confirm) uni.reLaunch({
|
|
||||||
url: '/pages/login/login'
|
|
||||||
})
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
export default request
|
|
||||||
@@ -21,7 +21,7 @@
|
|||||||
<view class="coupon-right-des" v-if='item.type.value === 2'>{{item.price_text}}</view>
|
<view class="coupon-right-des" v-if='item.type.value === 2'>{{item.price_text}}</view>
|
||||||
<view class="coupon-right-day">剩余{{item.time.expire}}天</view>
|
<view class="coupon-right-day">剩余{{item.time.expire}}天</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="coupon-to-used" @click="couponDetailGo(item.coupon_grant_id)"> 去使用 </view>
|
<view class="coupon-to-used" v-if="item.status.status !== 3" @click="couponDetailGo(item.coupon_grant_id)"> 去使用 </view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="check-all" v-if="item.coupon_count>2" @click="couponMoreListGo(item.coupon_id)">
|
<view class="check-all" v-if="item.coupon_count>2" @click="couponMoreListGo(item.coupon_id)">
|
||||||
@@ -152,7 +152,7 @@
|
|||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
|
|
||||||
.money {
|
.money {
|
||||||
font-size: 70rpx;
|
font-size: 50rpx;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
228
components/coupon-template/coupon-template-2.vue
Normal file
@@ -39,7 +39,7 @@
|
|||||||
// 跳转到商品详情页面
|
// 跳转到商品详情页面
|
||||||
goDetail(id) {
|
goDetail(id) {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/pages/goods/detail?id=' + id
|
url: '/pages/goods/details?id=' + id
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -41,7 +41,7 @@
|
|||||||
// 跳转到商品详情页面
|
// 跳转到商品详情页面
|
||||||
goDetail(id) {
|
goDetail(id) {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/pages/goods/detail?id='+id
|
url: '/pages/goods/details?id='+id
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -46,7 +46,7 @@
|
|||||||
// 跳转到商品详情页面
|
// 跳转到商品详情页面
|
||||||
goDetail(id) {
|
goDetail(id) {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/pages/goods/detail?id='+id
|
url: '/pages/goods/details?id='+id
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
// 复制
|
// 复制
|
||||||
|
|||||||
129
components/property/record.vue
Normal file
@@ -0,0 +1,129 @@
|
|||||||
|
<template>
|
||||||
|
<view>
|
||||||
|
<block v-if="list.length > 0">
|
||||||
|
<view class="record--item" v-for="(item, index) in list" :key="index" v-if="item && !hash">
|
||||||
|
<view class="title ellipsis-1">{{item.rule.title}} <span> {{item.coin?' ('+item.coin+'个能量球) ':''}} </span></view>
|
||||||
|
<view class="time ellipsis-1">{{item.created_at || '-'}}</view>
|
||||||
|
<view class="webkit-box variation">
|
||||||
|
<view class="ellipsis" :class="item.amount<0 ? 'add': 'remove'">{{item.amount}}</view>
|
||||||
|
<view class="symbol">{{item.amount>0?'现金红包收入':'现金红包支出'}}</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="record--item record--item1" v-for="(item, index) in list" :key="index" v-if="item && hash">
|
||||||
|
<view class="title ellipsis-1">{{item.hash}}</view>
|
||||||
|
<view class="time ellipsis-1">{{item.block_time || '-'}}</view>
|
||||||
|
<view class="webkit-box variation">
|
||||||
|
<view class="ellipsis" :class="item.is_in ? 'add': 'remove'">
|
||||||
|
{{item.is_in ? '+': '-'}}{{item.amount}}</view>
|
||||||
|
<view class="symbol">{{item.assets.symbol}}</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</block>
|
||||||
|
<block v-else>
|
||||||
|
<no-list v-if='logsType === ""' name='no-record' txt="没有任何记录~" />
|
||||||
|
<no-list v-if='logsType === "in"' name='no-in' txt="没有任何收入记录~" />
|
||||||
|
<no-list v-if='logsType === "out"' name='no-out' txt="没有任何支出记录~" />
|
||||||
|
</block>
|
||||||
|
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
name: "property",
|
||||||
|
props: {
|
||||||
|
list: {
|
||||||
|
type: Array,
|
||||||
|
default: () => {
|
||||||
|
return []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
logsType: {
|
||||||
|
type: String
|
||||||
|
},
|
||||||
|
hash: {
|
||||||
|
type: Boolean
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.record--item1 {
|
||||||
|
padding: $padding 330rpx $padding 0 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.record--item {
|
||||||
|
padding: $padding 220rpx $padding 0;
|
||||||
|
border-bottom: solid 1rpx #f7f7f7;
|
||||||
|
position: relative;
|
||||||
|
min-height: 50rpx;
|
||||||
|
|
||||||
|
.variation {
|
||||||
|
position: absolute;
|
||||||
|
right: 0;
|
||||||
|
top: $margin;
|
||||||
|
bottom: $margin;
|
||||||
|
width: 300rpx;
|
||||||
|
text-align: right;
|
||||||
|
font-weight: bold;
|
||||||
|
|
||||||
|
&>label {
|
||||||
|
font-size: 80%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.symbol {
|
||||||
|
color: #666;
|
||||||
|
font-weight: normal;
|
||||||
|
font-size: $title-size-m;
|
||||||
|
}
|
||||||
|
|
||||||
|
.add {
|
||||||
|
color: $mian-color;
|
||||||
|
font-size: 36rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.remove {
|
||||||
|
font-size: 36rpx;
|
||||||
|
color: $mian-color;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.title {
|
||||||
|
line-height: 50rpx;
|
||||||
|
font-size: 30rpx;
|
||||||
|
word-break: break-word;
|
||||||
|
span{
|
||||||
|
font-size: 24rpx;
|
||||||
|
color: #999;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.time {
|
||||||
|
font-size: 26rpx;
|
||||||
|
color: #999;
|
||||||
|
padding-top: 6rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 数据空
|
||||||
|
.record--null {
|
||||||
|
padding-top: $padding * 3;
|
||||||
|
text-align: center;
|
||||||
|
color: $mian-color;
|
||||||
|
font-size: $title-size;
|
||||||
|
height: 50vh;
|
||||||
|
box-sizing: border-box;
|
||||||
|
line-height: 60rpx;
|
||||||
|
|
||||||
|
image {
|
||||||
|
width: 168rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -30,7 +30,7 @@
|
|||||||
<view class="member-tips-title" v-if="wordData.grade == 1">会员升级/续费</view>
|
<view class="member-tips-title" v-if="wordData.grade == 1">会员升级/续费</view>
|
||||||
<view class="member-tips-title" v-else-if="wordData.grade == 2">续费</view>
|
<view class="member-tips-title" v-else-if="wordData.grade == 2">续费</view>
|
||||||
<view class="member-tips-title" v-else>企业会员</view>
|
<view class="member-tips-title" v-else>企业会员</view>
|
||||||
<view class="member-tips-time">有效期:{{wordData.identity}}</view>
|
<view class="member-tips-time nowrap">有效期:{{wordData.identity}}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="member-btn" v-if="wordData.grade == 3">
|
<view class="member-btn" v-if="wordData.grade == 3">
|
||||||
<image class="member-btn-icon" src="../../static/icons/store_icon_vip.png" mode="aspectFill"></image>
|
<image class="member-btn-icon" src="../../static/icons/store_icon_vip.png" mode="aspectFill"></image>
|
||||||
@@ -64,19 +64,19 @@
|
|||||||
<view class="text">转让权证</view>
|
<view class="text">转让权证</view>
|
||||||
</view> -->
|
</view> -->
|
||||||
<view class="general-item">
|
<view class="general-item">
|
||||||
<view class="number">{{wordData.top.barter_total || 0}}</view>
|
<view class="number">{{wordData.top.order_total.toFixed(2) || 0}}</view>
|
||||||
<view class="text">总收益额</view>
|
<view class="text">总交易额</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="general-item" @click="$Router.push({name: 'GoodsMag'})">
|
<view class="general-item" @click="$Router.push({name: 'GoodsMag'})">
|
||||||
<view class="number">{{wordData.middle.sale || 0}}</view>
|
<view class="number">{{wordData.middle.sale || 0}}</view>
|
||||||
<view class="text">在售权证</view>
|
<view class="text">在售权证</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="general-item" @click="$Router.push({name: 'Return'})">
|
<view class="general-item" @click="$Router.push({name: 'Return'})">
|
||||||
<view class="number">{{wordData.order.deliver || 0}}</view>
|
<view class="number">{{wordData.order.refund || 0}}</view>
|
||||||
<view class="text">退货单处理</view>
|
<view class="text">退货单处理</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="general-item" @click="$Router.push({name: 'Deliver'})">
|
<view class="general-item" @click="$Router.push({name: 'Deliver'})">
|
||||||
<view class="number">{{wordData.order.refund || 0}}</view>
|
<view class="number">{{wordData.order.deliver|| 0}}</view>
|
||||||
<view class="text">发货单处理</view>
|
<view class="text">发货单处理</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -123,7 +123,7 @@
|
|||||||
<image class="icon" src="@/static/icons/tool_icon_02.png" mode="aspectFill"></image>
|
<image class="icon" src="@/static/icons/tool_icon_02.png" mode="aspectFill"></image>
|
||||||
<view class="title">优惠券管理</view>
|
<view class="title">优惠券管理</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="store-item" @click="$Router.push({name: 'Collection'})">
|
<view class="store-item">
|
||||||
<image class="icon" src="@/static/icons/tool_icon_03.png" mode="aspectFill"></image>
|
<image class="icon" src="@/static/icons/tool_icon_03.png" mode="aspectFill"></image>
|
||||||
<view class="title">收款管理</view>
|
<view class="title">收款管理</view>
|
||||||
</view>
|
</view>
|
||||||
|
|||||||
@@ -26,7 +26,7 @@
|
|||||||
<view class="name nowrap">{{info.shop.name}}</view>
|
<view class="name nowrap">{{info.shop.name}}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="flexrow">
|
<view class="flexrow">
|
||||||
<view class="no nowrap" v-if="listType == 'deliver'">退货单号: {{info.shipment_no}}</view>
|
<view class="no nowrap" v-if="listType == 'deliver'">发货单号: {{info.shipment_no}}</view>
|
||||||
<view class="no nowrap" v-else>退货单号: {{info.refund_no}}</view>
|
<view class="no nowrap" v-else>退货单号: {{info.refund_no}}</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -39,10 +39,22 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="goods-info1">
|
<view class="goods-info1" >
|
||||||
<view class="goods-type">创建退货时间 <span>{{info.created_at}}</span></view>
|
<view class="goods-type">创建{{listType == 'deliver'?'发货':'退货'}}时间 <span>{{info.created_at}}</span></view>
|
||||||
<view class="goods-type">运费 <span>自行承担运费</span></view>
|
<view class="goods-type">运费 <span>自行承担运费</span></view>
|
||||||
<view class="goods-type">退货数量 <span>{{info.qty}}个</span></view>
|
<view class="goods-type">{{listType === 'deliver'?'发货':'退货'}}数量 <span>{{info.qty}}个</span></view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="goods-info1" v-if="listType === 'deliver' && info.express">
|
||||||
|
<view class="goods-type" v-if="info.express">收件人姓名 <span>{{info.express.name || '--'}}</span></view>
|
||||||
|
<view class="goods-type" v-if="info.express" @click="call(info.express.mobile)">收件人电话 <span>{{info.express.mobile || '--'}}</span></view>
|
||||||
|
<view class="goods-type" v-if="info.express">收货地址 <span>{{info.express.full_address || '--'}}</span></view>
|
||||||
|
<view class="goods-type" v-if="info.express">发货快递 <span>{{info.express.express_name || '--'}}</span></view>
|
||||||
|
<view class="goods-type" v-if="info.express">快递单号 <span>{{info.express.express_no || '--'}}</span></view>
|
||||||
|
</view>
|
||||||
|
<view class="goods-info1" v-else>
|
||||||
|
<view class="goods-type" v-if="info.express">退货单快递<span>{{info.express.company || '--'}}</span></view>
|
||||||
|
<view class="goods-type" v-if="info.express">退货快递单号 <span>{{info.express.number || '--'}}</span></view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 操作相关 -->
|
<!-- 操作相关 -->
|
||||||
@@ -70,6 +82,11 @@
|
|||||||
uni.navigateBack({
|
uni.navigateBack({
|
||||||
delta: 1
|
delta: 1
|
||||||
})
|
})
|
||||||
|
},
|
||||||
|
call(number){
|
||||||
|
uni.makePhoneCall({
|
||||||
|
phoneNumber:number
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -144,7 +161,7 @@
|
|||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
.no {
|
.no {
|
||||||
margin-top: 16rpx;
|
margin-top: 30rpx !important;
|
||||||
font-size: $title-size*0.8;
|
font-size: $title-size*0.8;
|
||||||
color: #999;
|
color: #999;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<view>
|
|
||||||
<view class="returnCont">
|
<view class="returnCont">
|
||||||
|
<block v-if="list.length > 0">
|
||||||
<view class="returnList" v-for="(item, index) in list" :key="index">
|
<view class="returnList" v-for="(item, index) in list" :key="index">
|
||||||
<view class="MallRefundsTemplate">
|
<view class="MallRefundsTemplate">
|
||||||
<view class="top">
|
<view class="top">
|
||||||
@@ -12,7 +12,8 @@
|
|||||||
<view class="no nowrap" v-if="listType == 'deliver'">退货单号: {{item.shipment_no}}</view>
|
<view class="no nowrap" v-if="listType == 'deliver'">退货单号: {{item.shipment_no}}</view>
|
||||||
<view class="no nowrap" v-else>退货单号: {{item.refund_no}}</view>
|
<view class="no nowrap" v-else>退货单号: {{item.refund_no}}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="status" style="color:#ff5500;" v-if="listType == 'deliver'">{{item.state_text}}</view>
|
<view class="status" style="color:#ff5500;" v-if="listType == 'deliver'">{{item.state_text}}
|
||||||
|
</view>
|
||||||
<view class="status" style="color:#ff5500;" v-else>{{item.state.text}}</view>
|
<view class="status" style="color:#ff5500;" v-else>{{item.state.text}}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="goods-info" @click="goDetail(item.goods_sku.goods_id)" v-if="item.goods_sku">
|
<view class="goods-info" @click="goDetail(item.goods_sku.goods_id)" v-if="item.goods_sku">
|
||||||
@@ -25,34 +26,63 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="actions">
|
<view class="actions">
|
||||||
<view v-if="item.can">
|
<view v-if="item.can">
|
||||||
<view v-if="item.can.audit" @click="$Router.push({name: 'Examine', params: {id: item.refund_id}})" class="nowPay actions-color">订单审核</view>
|
<view v-if="item.can.audit"
|
||||||
<view v-if="item.can.sign" @click="goSign(item.refund_id, index)" class="nowPay actions-color">订单签收</view>
|
@click="$Router.push({name: 'Examine', params: {id: item.refund_id}})"
|
||||||
<view v-if="item.can.reToken" @click="goReToken(item.refund_id, index)" class="nowPay actions-color">确认退货</view>
|
class="nowPay actions-color">订单审核</view>
|
||||||
<view v-if="item.can.logistic" @click="$Router.push({name: 'Logistic', params: {id: item.shipment_no}})" class="nowPay actions-color">查看物流</view>
|
<view v-if="item.can.sign" @click="goSigns(item.refund_id, index)" class="nowPay actions-color">
|
||||||
<view v-if="item.can.deliver" @click="$Router.push({name: 'DeliverForm', params: {id: item.shipment_no}})" class="nowPay actions-color">我要发货</view>
|
订单签收</view>
|
||||||
|
<view v-if="item.can.reToken" @click="goReTokens(item.refund_id, index)"
|
||||||
|
class="nowPay actions-color">确认退货</view>
|
||||||
|
<view v-if="item.can.logistic"
|
||||||
|
@click="$Router.push({name: 'Logistic', params: {id: item.shipment_no}})"
|
||||||
|
class="nowPay actions-color">查看物流</view>
|
||||||
|
<view v-if="item.can.deliver"
|
||||||
|
@click="$Router.push({name: 'DeliverForm', params: {id: item.shipment_no}})"
|
||||||
|
class="nowPay actions-color">我要发货</view>
|
||||||
</view>
|
</view>
|
||||||
<view v-if="listType == 'deliver'" class="nowPay" @click="$Router.push({name: 'storeOrderDetails', params: {id: item.shipment_no, type: listType}})">查看详情</view>
|
<view v-if="listType == 'deliver'" class="nowPay"
|
||||||
<view v-else class="nowPay" @click="$Router.push({name: 'storeOrderDetails', params: {id: item.refund_id, type: 'return'}})">查看详情</view>
|
@click="$Router.push({name: 'storeOrderDetails', params: {id: item.shipment_no, type: listType}})">
|
||||||
|
查看详情</view>
|
||||||
|
<view v-else class="nowPay"
|
||||||
|
@click="$Router.push({name: 'storeOrderDetails', params: {id: item.refund_id, type: 'return'}})">
|
||||||
|
查看详情</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
</block>
|
||||||
|
<view v-else class="pack-center">
|
||||||
|
<image src="/static/icons/order-null.png"></image>
|
||||||
|
<view>{{toast}}</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
name:"goodsList",
|
name: "goodsList",
|
||||||
props:{
|
props: {
|
||||||
// 数据列表
|
// 数据列表
|
||||||
list: {
|
list: {
|
||||||
type : Array,
|
type: Array,
|
||||||
default : () => {
|
default: () => {
|
||||||
return new Array
|
return new Array
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
listType: ''
|
listType: '',
|
||||||
|
// 列表空提示
|
||||||
|
toast: {
|
||||||
|
type: String,
|
||||||
|
default: '暂无订单数据 -_-!'
|
||||||
},
|
},
|
||||||
created() {}
|
},
|
||||||
|
created() {},
|
||||||
|
methods: {
|
||||||
|
goSigns(id,index) {
|
||||||
|
this.$emit('goSign',{id:id,index:index});
|
||||||
|
},
|
||||||
|
goReTokens(id,index){
|
||||||
|
this.$emit('goReToken',{id:id,index:index});
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@@ -65,10 +95,11 @@
|
|||||||
margin-top: $margin;
|
margin-top: $margin;
|
||||||
}
|
}
|
||||||
|
|
||||||
.MallRefundsTemplate{
|
.MallRefundsTemplate {
|
||||||
position: relative;
|
position: relative;
|
||||||
z-index: 0;
|
z-index: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 顶部信息
|
// 顶部信息
|
||||||
.top {
|
.top {
|
||||||
display: flex;
|
display: flex;
|
||||||
@@ -80,15 +111,18 @@
|
|||||||
border-bottom: solid 1rpx #f7f7f7;
|
border-bottom: solid 1rpx #f7f7f7;
|
||||||
position: relative;
|
position: relative;
|
||||||
z-index: 0;
|
z-index: 0;
|
||||||
|
|
||||||
.company-logo {
|
.company-logo {
|
||||||
display: flex;
|
display: flex;
|
||||||
width: 90%;
|
width: 90%;
|
||||||
|
|
||||||
image {
|
image {
|
||||||
width: 40rpx;
|
width: 40rpx;
|
||||||
height: 40rpx;
|
height: 40rpx;
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
margin-right: 20rpx;
|
margin-right: 20rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.company-name {
|
.company-name {
|
||||||
font-size: 30rpx;
|
font-size: 30rpx;
|
||||||
color: #484848;
|
color: #484848;
|
||||||
@@ -98,11 +132,13 @@
|
|||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.no {
|
.no {
|
||||||
margin-top: 10rpx;
|
margin-top: 10rpx;
|
||||||
font-size: $title-size*0.8;
|
font-size: $title-size*0.8;
|
||||||
color: #999;
|
color: #999;
|
||||||
}
|
}
|
||||||
|
|
||||||
.status {
|
.status {
|
||||||
color: #999;
|
color: #999;
|
||||||
font-size: $title-size*.9;
|
font-size: $title-size*.9;
|
||||||
@@ -126,15 +162,18 @@
|
|||||||
height: 120rpx;
|
height: 120rpx;
|
||||||
border-radius: 10rpx;
|
border-radius: 10rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.goods {
|
.goods {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
width: calc(100% - 120rpx);
|
width: calc(100% - 120rpx);
|
||||||
padding: 0 20rpx;
|
padding: 0 20rpx;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
margin-bottom: 10rpx;
|
margin-bottom: 10rpx;
|
||||||
|
|
||||||
.name {
|
.name {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
font-size: 30rpx;
|
font-size: 30rpx;
|
||||||
|
|
||||||
span {
|
span {
|
||||||
font-size: 32rpx;
|
font-size: 32rpx;
|
||||||
font-weight: normal;
|
font-weight: normal;
|
||||||
@@ -184,18 +223,21 @@
|
|||||||
color: #fff;
|
color: #fff;
|
||||||
border-top: solid 1rpx #EFF4F2;
|
border-top: solid 1rpx #EFF4F2;
|
||||||
margin-top: $margin;
|
margin-top: $margin;
|
||||||
|
|
||||||
.nowPay {
|
.nowPay {
|
||||||
padding: 4rpx 20rpx;
|
padding: 4rpx 20rpx;
|
||||||
border-radius: 40rpx;
|
border-radius: 40rpx;
|
||||||
margin-left: 20rpx;
|
margin-left: 20rpx;
|
||||||
margin-top: 20rpx;
|
margin-top: 20rpx;
|
||||||
color: #999;
|
color: #999;
|
||||||
border:solid 1rpx #cacaca;
|
border: solid 1rpx #cacaca;
|
||||||
|
|
||||||
&.actions-color {
|
&.actions-color {
|
||||||
color: #e1293f;
|
color: #e1293f;
|
||||||
border-color: #ec96a0;
|
border-color: #ec96a0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.cancelOrder {
|
.cancelOrder {
|
||||||
padding: 10rpx 30rpx;
|
padding: 10rpx 30rpx;
|
||||||
border-radius: 40rpx;
|
border-radius: 40rpx;
|
||||||
@@ -203,6 +245,7 @@
|
|||||||
margin-top: 20rpx;
|
margin-top: 20rpx;
|
||||||
background-color: #DD524D;
|
background-color: #DD524D;
|
||||||
}
|
}
|
||||||
|
|
||||||
.logistics {
|
.logistics {
|
||||||
background-color: $main-color;
|
background-color: $main-color;
|
||||||
padding: 10rpx 30rpx;
|
padding: 10rpx 30rpx;
|
||||||
@@ -210,6 +253,7 @@
|
|||||||
margin-left: 20rpx;
|
margin-left: 20rpx;
|
||||||
margin-top: 20rpx;
|
margin-top: 20rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.sign {
|
.sign {
|
||||||
background-color: #DD524D;
|
background-color: #DD524D;
|
||||||
padding: 10rpx 30rpx;
|
padding: 10rpx 30rpx;
|
||||||
@@ -217,6 +261,7 @@
|
|||||||
margin-left: 20rpx;
|
margin-left: 20rpx;
|
||||||
margin-top: 20rpx;
|
margin-top: 20rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.evaluate {
|
.evaluate {
|
||||||
background-color: $main-color;
|
background-color: $main-color;
|
||||||
padding: 10rpx 30rpx;
|
padding: 10rpx 30rpx;
|
||||||
@@ -225,4 +270,19 @@
|
|||||||
margin-top: 20rpx;
|
margin-top: 20rpx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 暂无订单
|
||||||
|
.pack-center {
|
||||||
|
text-align: center;
|
||||||
|
font-size: $title-size-sm;
|
||||||
|
color: $text-gray;
|
||||||
|
padding-top: 50%;
|
||||||
|
|
||||||
|
image {
|
||||||
|
width: $uni-img-size-lg * 2;
|
||||||
|
height: $uni-img-size-lg * 2;
|
||||||
|
border-radius: $uni-border-radius-circle;
|
||||||
|
margin-bottom: $margin;
|
||||||
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
218
components/vue-canvas-poster/canvas-poster.vue
Normal file
@@ -0,0 +1,218 @@
|
|||||||
|
<script>
|
||||||
|
import Painter from './painter'
|
||||||
|
import { equal } from './util'
|
||||||
|
export default {
|
||||||
|
name: 'VueCanvasPoster',
|
||||||
|
props: {
|
||||||
|
painting: {
|
||||||
|
type: Object,
|
||||||
|
default: function() {
|
||||||
|
return {}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
dirty: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
|
},
|
||||||
|
widthPixels: {
|
||||||
|
type: Number,
|
||||||
|
default: 750
|
||||||
|
}
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
painting: {
|
||||||
|
handler(newVal, oldVal) {
|
||||||
|
if (this.isNeedRefresh(newVal, oldVal)) {
|
||||||
|
this.paintCount = 0
|
||||||
|
this.startPaint()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
deep: true,
|
||||||
|
immediate: true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
paintCount: 0,
|
||||||
|
painterStyle: '',
|
||||||
|
canvasWidthInPx: 375,
|
||||||
|
canvasHeightInPx: 375,
|
||||||
|
width: 100,
|
||||||
|
height: 100,
|
||||||
|
canvas: null,
|
||||||
|
ctx: null
|
||||||
|
}
|
||||||
|
},
|
||||||
|
render(h) {
|
||||||
|
return h('div', [
|
||||||
|
h('canvas', {
|
||||||
|
ref: 'canvas',
|
||||||
|
class: 'canvas',
|
||||||
|
style: this.painterStyle
|
||||||
|
})
|
||||||
|
])
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.canvas = this.$refs.canvas // 指定canvas
|
||||||
|
this.ctx = this.canvas.getContext('2d') //设置2D渲染区域
|
||||||
|
})
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
/**
|
||||||
|
* 判断一个 object 是否为 空
|
||||||
|
* @param {object} object
|
||||||
|
*/
|
||||||
|
isEmpty(object) {
|
||||||
|
for (const i in object) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
return true
|
||||||
|
},
|
||||||
|
isNeedRefresh(newVal, oldVal) {
|
||||||
|
if (!newVal || this.isEmpty(newVal) || (this.dirty && equal(newVal, oldVal))) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
return true
|
||||||
|
},
|
||||||
|
// 开始绘画
|
||||||
|
startPaint() {
|
||||||
|
if (this.isEmpty(this.painting)) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
setStringPrototype(1)
|
||||||
|
// 下载图片
|
||||||
|
this.downloadImages()
|
||||||
|
.then(res => {
|
||||||
|
const { width, height } = res
|
||||||
|
if (!width || !height) {
|
||||||
|
console.error(`You should set width and height correctly for painter, width: ${width}, height: ${height}`)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.canvasWidthInPx = width.toPx()
|
||||||
|
if (this.widthPixels) {
|
||||||
|
// 重设宽度,高度
|
||||||
|
setStringPrototype(this.widthPixels / this.canvasWidthInPx)
|
||||||
|
this.canvasWidthInPx = this.widthPixels
|
||||||
|
}
|
||||||
|
this.canvasHeightInPx = height.toPx()
|
||||||
|
this.painterStyle = `width:${this.canvasWidthInPx}px;height:${this.canvasHeightInPx}px;`
|
||||||
|
this.canvas = this.$refs.canvas // 指定canvas
|
||||||
|
this.canvas.width = this.canvasWidthInPx
|
||||||
|
this.canvas.height = this.canvasHeightInPx
|
||||||
|
const ctx = this.canvas.getContext('2d') //设置2D渲染区域
|
||||||
|
const pen = new Painter(ctx, res)
|
||||||
|
pen.paint(() => {
|
||||||
|
var imageBase64 = this.canvas.toDataURL('image/png')
|
||||||
|
this.$emit('success', imageBase64)
|
||||||
|
})
|
||||||
|
})
|
||||||
|
.catch(err => {
|
||||||
|
this.$emit('fail', err)
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 下载所有图片
|
||||||
|
downloadImages() {
|
||||||
|
return new Promise((resolve) => {
|
||||||
|
let preCount = 0
|
||||||
|
let completeCount = 0
|
||||||
|
const paintCopy = JSON.parse(JSON.stringify(this.painting))
|
||||||
|
if (paintCopy.background) {
|
||||||
|
preCount++
|
||||||
|
this.loadImage(paintCopy.background).then(
|
||||||
|
image => {
|
||||||
|
paintCopy.background = image
|
||||||
|
completeCount++
|
||||||
|
preCount === completeCount && resolve(paintCopy)
|
||||||
|
},
|
||||||
|
err => {
|
||||||
|
completeCount++
|
||||||
|
preCount === completeCount && resolve(paintCopy)
|
||||||
|
console.log(err)
|
||||||
|
}
|
||||||
|
)
|
||||||
|
}
|
||||||
|
if (paintCopy.views) {
|
||||||
|
for (const view of paintCopy.views) {
|
||||||
|
if (view && view.type === 'image' && view.url) {
|
||||||
|
preCount++
|
||||||
|
/* eslint-disable no-loop-func */
|
||||||
|
this.loadImage(view.url).then(
|
||||||
|
image => {
|
||||||
|
completeCount++
|
||||||
|
view.url = image
|
||||||
|
// 获得一下图片信息,供后续裁减使用
|
||||||
|
view.sWidth = image.width
|
||||||
|
view.sHeight = image.height
|
||||||
|
preCount === completeCount && resolve(paintCopy)
|
||||||
|
},
|
||||||
|
err => {
|
||||||
|
completeCount++
|
||||||
|
preCount === completeCount && resolve(paintCopy)
|
||||||
|
console.log(err)
|
||||||
|
}
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
preCount === 0 && resolve(paintCopy)
|
||||||
|
// if (preCount !== completeCount) {
|
||||||
|
// reject('paintCopy');
|
||||||
|
// }
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 下载图片
|
||||||
|
loadImage(src) {
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
if (src.startsWith('#')) {
|
||||||
|
resolve(src)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
const img = new Image()
|
||||||
|
img.onload = () => resolve(img)
|
||||||
|
img.onerror = () => reject(`下载图片失败 ${src}`)
|
||||||
|
img.crossOrigin = 'anonymous'
|
||||||
|
img.src = src
|
||||||
|
if (img.complete === true) {
|
||||||
|
// Inline XML images may fail to parse, throwing an Error later on
|
||||||
|
setTimeout(() => resolve(img), 500)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function setStringPrototype(scale) {
|
||||||
|
/* eslint-disable no-extend-native */
|
||||||
|
/**
|
||||||
|
* 是否支持负数
|
||||||
|
* @param {Boolean} minus 是否支持负数
|
||||||
|
*/
|
||||||
|
String.prototype.toPx = function toPx(minus, baseSize) {
|
||||||
|
if (this === '0') {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
let reg
|
||||||
|
if (minus) {
|
||||||
|
reg = /^-?[0-9]+([.]{1}[0-9]+){0,1}(px|%)$/g
|
||||||
|
} else {
|
||||||
|
reg = /^[0-9]+([.]{1}[0-9]+){0,1}(px|%)$/g
|
||||||
|
}
|
||||||
|
const results = reg.exec(this)
|
||||||
|
const unit = results[2]
|
||||||
|
const value = parseFloat(this)
|
||||||
|
let res = 0
|
||||||
|
if (unit === 'px') {
|
||||||
|
res = Math.round(value * (scale || 1))
|
||||||
|
} else if (unit === '%') {
|
||||||
|
res = Math.round((value * baseSize) / 100)
|
||||||
|
}
|
||||||
|
return res
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<style scoped>
|
||||||
|
.canvas {
|
||||||
|
position: fixed;
|
||||||
|
top: 2000px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
102
components/vue-canvas-poster/gradient.js
Normal file
@@ -0,0 +1,102 @@
|
|||||||
|
/* eslint-disable */
|
||||||
|
export const api = {
|
||||||
|
isGradient: function(bg) {
|
||||||
|
if (bg && (bg.startsWith('linear') || bg.startsWith('radial'))) {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
},
|
||||||
|
|
||||||
|
doGradient: function(bg, width, height, ctx) {
|
||||||
|
if (bg.startsWith('linear')) {
|
||||||
|
linearEffect(width, height, bg, ctx)
|
||||||
|
} else if (bg.startsWith('radial')) {
|
||||||
|
radialEffect(width, height, bg, ctx)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function analizeGrad(string) {
|
||||||
|
const colorPercents = string.substring(0, string.length - 1).split('%,')
|
||||||
|
const colors = []
|
||||||
|
const percents = []
|
||||||
|
for (let colorPercent of colorPercents) {
|
||||||
|
colors.push(colorPercent.substring(0, colorPercent.lastIndexOf(' ')).trim())
|
||||||
|
percents.push(colorPercent.substring(colorPercent.lastIndexOf(' '), colorPercent.length) / 100)
|
||||||
|
}
|
||||||
|
return { colors: colors, percents: percents }
|
||||||
|
}
|
||||||
|
|
||||||
|
function radialEffect(width, height, bg, ctx) {
|
||||||
|
const colorPer = analizeGrad(bg.match(/radial-gradient\((.+)\)/)[1])
|
||||||
|
const grd = ctx.createRadialGradient(0, 0, 0, 0, 0, width < height ? height / 2 : width / 2)
|
||||||
|
for (let i = 0; i < colorPer.colors.length; i++) {
|
||||||
|
grd.addColorStop(colorPer.percents[i], colorPer.colors[i])
|
||||||
|
}
|
||||||
|
ctx.fillStyle = grd
|
||||||
|
//ctx.fillRect(-(width / 2), -(height / 2), width, height);
|
||||||
|
}
|
||||||
|
|
||||||
|
function analizeLinear(bg, width, height) {
|
||||||
|
const direction = bg.match(/([-]?\d{1,3})deg/)
|
||||||
|
const dir = direction && direction[1] ? parseFloat(direction[1]) : 0
|
||||||
|
let coordinate
|
||||||
|
switch (dir) {
|
||||||
|
case 0:
|
||||||
|
coordinate = [0, -height / 2, 0, height / 2]
|
||||||
|
break
|
||||||
|
case 90:
|
||||||
|
coordinate = [width / 2, 0, -width / 2, 0]
|
||||||
|
break
|
||||||
|
case -90:
|
||||||
|
coordinate = [-width / 2, 0, width / 2, 0]
|
||||||
|
break
|
||||||
|
case 180:
|
||||||
|
coordinate = [0, height / 2, 0, -height / 2]
|
||||||
|
break
|
||||||
|
case -180:
|
||||||
|
coordinate = [0, -height / 2, 0, height / 2]
|
||||||
|
break
|
||||||
|
default:
|
||||||
|
let x1 = 0
|
||||||
|
let y1 = 0
|
||||||
|
let x2 = 0
|
||||||
|
let y2 = 0
|
||||||
|
if (direction[1] > 0 && direction[1] < 90) {
|
||||||
|
x1 = width / 2 - (((width / 2) * Math.tan(((90 - direction[1]) * Math.PI * 2) / 360) - height / 2) * Math.sin((2 * (90 - direction[1]) * Math.PI * 2) / 360)) / 2
|
||||||
|
y2 = Math.tan(((90 - direction[1]) * Math.PI * 2) / 360) * x1
|
||||||
|
x2 = -x1
|
||||||
|
y1 = -y2
|
||||||
|
} else if (direction[1] > -180 && direction[1] < -90) {
|
||||||
|
x1 = -(width / 2) + (((width / 2) * Math.tan(((90 - direction[1]) * Math.PI * 2) / 360) - height / 2) * Math.sin((2 * (90 - direction[1]) * Math.PI * 2) / 360)) / 2
|
||||||
|
y2 = Math.tan(((90 - direction[1]) * Math.PI * 2) / 360) * x1
|
||||||
|
x2 = -x1
|
||||||
|
y1 = -y2
|
||||||
|
} else if (direction[1] > 90 && direction[1] < 180) {
|
||||||
|
x1 = width / 2 + ((-(width / 2) * Math.tan(((90 - direction[1]) * Math.PI * 2) / 360) - height / 2) * Math.sin((2 * (90 - direction[1]) * Math.PI * 2) / 360)) / 2
|
||||||
|
y2 = Math.tan(((90 - direction[1]) * Math.PI * 2) / 360) * x1
|
||||||
|
x2 = -x1
|
||||||
|
y1 = -y2
|
||||||
|
} else {
|
||||||
|
x1 = -(width / 2) - ((-(width / 2) * Math.tan(((90 - direction[1]) * Math.PI * 2) / 360) - height / 2) * Math.sin((2 * (90 - direction[1]) * Math.PI * 2) / 360)) / 2
|
||||||
|
y2 = Math.tan(((90 - direction[1]) * Math.PI * 2) / 360) * x1
|
||||||
|
x2 = -x1
|
||||||
|
y1 = -y2
|
||||||
|
}
|
||||||
|
coordinate = [x1, y1, x2, y2]
|
||||||
|
break
|
||||||
|
}
|
||||||
|
return coordinate
|
||||||
|
}
|
||||||
|
|
||||||
|
function linearEffect(width, height, bg, ctx) {
|
||||||
|
const param = analizeLinear(bg, width, height)
|
||||||
|
const grd = ctx.createLinearGradient(param[0], param[1], param[2], param[3])
|
||||||
|
const content = bg.match(/linear-gradient\((.+)\)/)[1]
|
||||||
|
const colorPer = analizeGrad(content.substring(content.indexOf(',') + 1))
|
||||||
|
for (let i = 0; i < colorPer.colors.length; i++) {
|
||||||
|
grd.addColorStop(colorPer.percents[i], colorPer.colors[i])
|
||||||
|
}
|
||||||
|
ctx.fillStyle = grd
|
||||||
|
//ctx.fillRect(-(width / 2), -(height / 2), width, height);
|
||||||
|
}
|
||||||
20
components/vue-canvas-poster/index.js
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
import VueCanvasPoster from './canvas-poster'
|
||||||
|
|
||||||
|
export function install(Vue) {
|
||||||
|
Vue.component('vue-canvas-poster', VueCanvasPoster)
|
||||||
|
}
|
||||||
|
export { VueCanvasPoster }
|
||||||
|
const myPlugin = {
|
||||||
|
install
|
||||||
|
}
|
||||||
|
export default myPlugin
|
||||||
|
// Auto-install
|
||||||
|
let GlobalVue = null
|
||||||
|
if (typeof window !== 'undefined') {
|
||||||
|
GlobalVue = window.Vue
|
||||||
|
} else if (typeof global !== 'undefined') {
|
||||||
|
GlobalVue = global.Vue
|
||||||
|
}
|
||||||
|
if (GlobalVue) {
|
||||||
|
GlobalVue.use(myPlugin)
|
||||||
|
}
|
||||||
647
components/vue-canvas-poster/painter.js
Normal file
@@ -0,0 +1,647 @@
|
|||||||
|
const QR = require('./qrcode.js')
|
||||||
|
const GD = require('./gradient.js')
|
||||||
|
|
||||||
|
export default class Painter {
|
||||||
|
constructor(ctx, data) {
|
||||||
|
this.ctx = ctx
|
||||||
|
this.data = data
|
||||||
|
this.globalWidth = {}
|
||||||
|
this.globalHeight = {}
|
||||||
|
}
|
||||||
|
paint(callback) {
|
||||||
|
this.style = {
|
||||||
|
width: this.data.width.toPx(),
|
||||||
|
height: this.data.height.toPx()
|
||||||
|
}
|
||||||
|
this._background()
|
||||||
|
if (this.data.views && this.data.views.length > 0) {
|
||||||
|
for (const view of this.data.views) {
|
||||||
|
this._drawAbsolute(view)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
callback && callback()
|
||||||
|
}
|
||||||
|
|
||||||
|
_background() {
|
||||||
|
this.ctx.save()
|
||||||
|
const { width, height } = this.style
|
||||||
|
const bg = this.data.background
|
||||||
|
this.ctx.translate(width / 2, height / 2)
|
||||||
|
this._doClip(this.data.borderRadius, width, height)
|
||||||
|
if (!bg) {
|
||||||
|
// 如果未设置背景,则默认使用透明色
|
||||||
|
this.ctx.fillStyle = 'transparent'
|
||||||
|
this.ctx.fillRect(-(width / 2), -(height / 2), width, height)
|
||||||
|
} else if (bg.src) {
|
||||||
|
// 背景填充图片
|
||||||
|
this.ctx.drawImage(bg, -(width / 2), -(height / 2), width, height)
|
||||||
|
}else if (bg.startsWith('#') || bg.startsWith('rgba') || bg.toLowerCase() === 'transparent') {
|
||||||
|
// 背景填充颜色
|
||||||
|
this.ctx.fillStyle = bg
|
||||||
|
this.ctx.fillRect(-(width / 2), -(height / 2), width, height)
|
||||||
|
} else if (GD.api.isGradient(bg)) {
|
||||||
|
GD.api.doGradient(bg, width, height, this.ctx)
|
||||||
|
this.ctx.fillRect(-(width / 2), -(height / 2), width, height)
|
||||||
|
}
|
||||||
|
this.ctx.restore()
|
||||||
|
}
|
||||||
|
|
||||||
|
_drawAbsolute(view) {
|
||||||
|
if (!(view && view.type)) {
|
||||||
|
// 过滤无效 view
|
||||||
|
return
|
||||||
|
}
|
||||||
|
// 证明 css 为数组形式,需要合并
|
||||||
|
if (view.css && view.css.length) {
|
||||||
|
/* eslint-disable no-param-reassign */
|
||||||
|
view.css = Object.assign(...view.css)
|
||||||
|
}
|
||||||
|
switch (view.type) {
|
||||||
|
case 'image':
|
||||||
|
this._drawAbsImage(view)
|
||||||
|
break
|
||||||
|
case 'text':
|
||||||
|
this._fillAbsText(view)
|
||||||
|
break
|
||||||
|
case 'rect':
|
||||||
|
this._drawAbsRect(view)
|
||||||
|
break
|
||||||
|
case 'qrcode':
|
||||||
|
this._drawQRCode(view)
|
||||||
|
break
|
||||||
|
default:
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
_border({ borderRadius = 0, width, height, borderWidth = 0, borderStyle = 'solid' }) {
|
||||||
|
let r1 = 0,
|
||||||
|
r2 = 0,
|
||||||
|
r3 = 0,
|
||||||
|
r4 = 0
|
||||||
|
const minSize = Math.min(width, height)
|
||||||
|
if (borderRadius) {
|
||||||
|
const border = borderRadius.split(/\s+/)
|
||||||
|
if (border.length === 4) {
|
||||||
|
r1 = Math.min(border[0].toPx(false, minSize), width / 2, height / 2)
|
||||||
|
r2 = Math.min(border[1].toPx(false, minSize), width / 2, height / 2)
|
||||||
|
r3 = Math.min(border[2].toPx(false, minSize), width / 2, height / 2)
|
||||||
|
r4 = Math.min(border[3].toPx(false, minSize), width / 2, height / 2)
|
||||||
|
} else {
|
||||||
|
r1 = r2 = r3 = r4 = Math.min(borderRadius && borderRadius.toPx(false, minSize), width / 2, height / 2)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const lineWidth = borderWidth && borderWidth.toPx(false, minSize)
|
||||||
|
this.ctx.lineWidth = lineWidth
|
||||||
|
if (borderStyle === 'dashed') {
|
||||||
|
this.ctx.setLineDash([(lineWidth * 4) / 3, (lineWidth * 4) / 3])
|
||||||
|
// this.ctx.lineDashOffset = 2 * lineWidth
|
||||||
|
} else if (borderStyle === 'dotted') {
|
||||||
|
this.ctx.setLineDash([lineWidth, lineWidth])
|
||||||
|
}
|
||||||
|
const notSolid = borderStyle !== 'solid'
|
||||||
|
this.ctx.beginPath()
|
||||||
|
|
||||||
|
notSolid && r1 === 0 && this.ctx.moveTo(-width / 2 - lineWidth, -height / 2 - lineWidth / 2) // 顶边虚线规避重叠规则
|
||||||
|
r1 !== 0 && this.ctx.arc(-width / 2 + r1, -height / 2 + r1, r1 + lineWidth / 2, 1 * Math.PI, 1.5 * Math.PI) //左上角圆弧
|
||||||
|
this.ctx.lineTo(r2 === 0 ? (notSolid ? width / 2 : width / 2 + lineWidth / 2) : width / 2 - r2, -height / 2 - lineWidth / 2) // 顶边线
|
||||||
|
|
||||||
|
notSolid && r2 === 0 && this.ctx.moveTo(width / 2 + lineWidth / 2, -height / 2 - lineWidth) // 右边虚线规避重叠规则
|
||||||
|
r2 !== 0 && this.ctx.arc(width / 2 - r2, -height / 2 + r2, r2 + lineWidth / 2, 1.5 * Math.PI, 2 * Math.PI) // 右上角圆弧
|
||||||
|
this.ctx.lineTo(width / 2 + lineWidth / 2, r3 === 0 ? (notSolid ? height / 2 : height / 2 + lineWidth / 2) : height / 2 - r3) // 右边线
|
||||||
|
|
||||||
|
notSolid && r3 === 0 && this.ctx.moveTo(width / 2 + lineWidth, height / 2 + lineWidth / 2) // 底边虚线规避重叠规则
|
||||||
|
r3 !== 0 && this.ctx.arc(width / 2 - r3, height / 2 - r3, r3 + lineWidth / 2, 0, 0.5 * Math.PI) // 右下角圆弧
|
||||||
|
this.ctx.lineTo(r4 === 0 ? (notSolid ? -width / 2 : -width / 2 - lineWidth / 2) : -width / 2 + r4, height / 2 + lineWidth / 2) // 底边线
|
||||||
|
|
||||||
|
notSolid && r4 === 0 && this.ctx.moveTo(-width / 2 - lineWidth / 2, height / 2 + lineWidth) // 左边虚线规避重叠规则
|
||||||
|
r4 !== 0 && this.ctx.arc(-width / 2 + r4, height / 2 - r4, r4 + lineWidth / 2, 0.5 * Math.PI, 1 * Math.PI) // 左下角圆弧
|
||||||
|
this.ctx.lineTo(-width / 2 - lineWidth / 2, r1 === 0 ? (notSolid ? -height / 2 : -height / 2 - lineWidth / 2) : -height / 2 + r1) // 左边线
|
||||||
|
notSolid && r1 === 0 && this.ctx.moveTo(-width / 2 - lineWidth, -height / 2 - lineWidth / 2) // 顶边虚线规避重叠规则
|
||||||
|
|
||||||
|
if (!notSolid) {
|
||||||
|
this.ctx.closePath()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据 borderRadius 进行裁减
|
||||||
|
*/
|
||||||
|
_doClip(borderRadius, width, height, borderStyle) {
|
||||||
|
if (borderRadius && width && height) {
|
||||||
|
// 防止在某些机型上周边有黑框现象,此处如果直接设置 fillStyle 为透明,在 Android 机型上会导致被裁减的图片也变为透明, iOS 和 IDE 上不会
|
||||||
|
// globalAlpha 在 1.9.90 起支持,低版本下无效,但把 fillStyle 设为了 white,相对默认的 black 要好点
|
||||||
|
this.ctx.globalAlpha = 0
|
||||||
|
this.ctx.fillStyle = 'white'
|
||||||
|
this._border({
|
||||||
|
borderRadius,
|
||||||
|
width,
|
||||||
|
height,
|
||||||
|
borderStyle
|
||||||
|
})
|
||||||
|
this.ctx.fill()
|
||||||
|
// 在 ios 的 6.6.6 版本上 clip 有 bug,禁掉此类型上的 clip,也就意味着,在此版本微信的 ios 设备下无法使用 border 属性
|
||||||
|
this.ctx.clip()
|
||||||
|
this.ctx.globalAlpha = 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 画边框
|
||||||
|
*/
|
||||||
|
_doBorder(view, width, height) {
|
||||||
|
if (!view.css) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
const { borderRadius, borderWidth, borderColor, borderStyle } = view.css
|
||||||
|
if (!borderWidth) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.ctx.save()
|
||||||
|
this._preProcess(view, true)
|
||||||
|
this.ctx.strokeStyle = borderColor || 'black'
|
||||||
|
this._border({
|
||||||
|
borderRadius,
|
||||||
|
width,
|
||||||
|
height,
|
||||||
|
borderWidth,
|
||||||
|
borderStyle
|
||||||
|
})
|
||||||
|
this.ctx.stroke()
|
||||||
|
this.ctx.restore()
|
||||||
|
}
|
||||||
|
|
||||||
|
_preProcess(view, notClip) {
|
||||||
|
let width = 0
|
||||||
|
let height
|
||||||
|
let extra
|
||||||
|
const paddings = this._doPaddings(view)
|
||||||
|
switch (view.type) {
|
||||||
|
case 'text': {
|
||||||
|
const textArray = view.text.split('\n')
|
||||||
|
// 处理多个连续的'\n'
|
||||||
|
for (let i = 0; i < textArray.length; ++i) {
|
||||||
|
if (textArray[i] === '') {
|
||||||
|
textArray[i] = ' '
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// const fontWeight = view.css.fontWeight === 'bold' ? 'bold' : 'normal'
|
||||||
|
const fontWeightArr = ['normal', 'bold', 'bolder', 'lighter', '100', '200', '300', '400', '500', '600', '700', '800', '900']
|
||||||
|
const fontWeight = fontWeightArr.includes(view.css.fontWeight) ? view.css.fontWeight : 'normal'
|
||||||
|
const textStyle = view.css.textStyle === 'italic' ? 'italic' : 'normal'
|
||||||
|
let textIndent = view.css.textIndent ? view.css.textIndent.toPx() : 0
|
||||||
|
|
||||||
|
if (!view.css.fontSize) {
|
||||||
|
view.css.fontSize = '20rpx'
|
||||||
|
}
|
||||||
|
this.ctx.font = `${textStyle} ${fontWeight} ${view.css.fontSize.toPx()}px "${view.css.fontFamily || 'sans-serif'}"`
|
||||||
|
// 计算行数
|
||||||
|
let lines = 0
|
||||||
|
const linesArray = []
|
||||||
|
for (let i = 0; i < textArray.length; ++i) {
|
||||||
|
const textLength = this.ctx.measureText(textArray[i]).width
|
||||||
|
// 最小长度
|
||||||
|
const minWidth = view.css.fontSize.toPx() + paddings[1] + paddings[3]
|
||||||
|
let partWidth = view.css.width ? view.css.width.toPx(false, this.style.width) - paddings[1] - paddings[3] : textLength
|
||||||
|
|
||||||
|
if (partWidth < minWidth) {
|
||||||
|
partWidth = minWidth
|
||||||
|
}
|
||||||
|
// textIndent 最大为一行
|
||||||
|
textIndent = textIndent > partWidth ? partWidth : textIndent
|
||||||
|
const calLines = Math.ceil((textLength + textIndent) / partWidth)
|
||||||
|
// 取最长的作为 width
|
||||||
|
width = partWidth > width ? partWidth : width
|
||||||
|
lines += calLines
|
||||||
|
linesArray[i] = calLines
|
||||||
|
}
|
||||||
|
lines = view.css.maxLines < lines ? view.css.maxLines : lines
|
||||||
|
const lineHeight = view.css.lineHeight ? view.css.lineHeight.toPx() : view.css.fontSize.toPx()
|
||||||
|
height = lineHeight * lines
|
||||||
|
extra = {
|
||||||
|
textIndent,
|
||||||
|
lines: lines,
|
||||||
|
lineHeight: lineHeight,
|
||||||
|
textArray: textArray,
|
||||||
|
linesArray: linesArray
|
||||||
|
}
|
||||||
|
break
|
||||||
|
}
|
||||||
|
case 'image': {
|
||||||
|
// 有css却未设置width或height,则默认为auto
|
||||||
|
if (view.css) {
|
||||||
|
if (!view.css.width) {
|
||||||
|
view.css.width = 'auto'
|
||||||
|
}
|
||||||
|
if (!view.css.height) {
|
||||||
|
view.css.height = 'auto'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!view.css || (view.css.width === 'auto' && view.css.height === 'auto')) {
|
||||||
|
width = Math.round(view.sWidth)
|
||||||
|
height = Math.round(view.sHeight)
|
||||||
|
} else if (view.css.width === 'auto') {
|
||||||
|
height = view.css.height.toPx(false, this.style.height)
|
||||||
|
width = (view.sWidth / view.sHeight) * height
|
||||||
|
} else if (view.css.height === 'auto') {
|
||||||
|
width = view.css.width.toPx(false, this.style.width)
|
||||||
|
height = (view.sHeight / view.sWidth) * width
|
||||||
|
} else {
|
||||||
|
width = view.css.width.toPx(false, this.style.width)
|
||||||
|
height = view.css.height.toPx(false, this.style.height)
|
||||||
|
}
|
||||||
|
break
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
if (!(view.css.width && view.css.height)) {
|
||||||
|
console.error('You should set width and height')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
width = view.css.width.toPx(false, this.style.width)
|
||||||
|
height = view.css.height.toPx(false, this.style.height)
|
||||||
|
break
|
||||||
|
}
|
||||||
|
let x
|
||||||
|
if (view.css && view.css.right) {
|
||||||
|
if (typeof view.css.right === 'string') {
|
||||||
|
x = this.style.width - view.css.right.toPx(true, this.style.width)
|
||||||
|
} else {
|
||||||
|
// 可以用数组方式,把文字长度计算进去
|
||||||
|
// [right, 文字id, 乘数(默认 1)]
|
||||||
|
const rights = view.css.right
|
||||||
|
x = this.style.width - rights[0].toPx(true, this.style.width) - this.globalWidth[rights[1]] * (rights[2] || 1)
|
||||||
|
}
|
||||||
|
} else if (view.css && view.css.left) {
|
||||||
|
if (typeof view.css.left === 'string') {
|
||||||
|
x = view.css.left.toPx(true, this.style.width)
|
||||||
|
} else {
|
||||||
|
const lefts = view.css.left
|
||||||
|
x = lefts[0].toPx(true, this.style.width) + this.globalWidth[lefts[1]] * (lefts[2] || 1)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
x = 0
|
||||||
|
}
|
||||||
|
//const y = view.css && view.css.bottom ? this.style.height - height - view.css.bottom.toPx(true) : (view.css && view.css.top ? view.css.top.toPx(true) : 0);
|
||||||
|
let y
|
||||||
|
if (view.css && view.css.bottom) {
|
||||||
|
y = this.style.height - height - view.css.bottom.toPx(true, this.style.height)
|
||||||
|
} else {
|
||||||
|
if (view.css && view.css.top) {
|
||||||
|
if (typeof view.css.top === 'string') {
|
||||||
|
y = view.css.top.toPx(true, this.style.height)
|
||||||
|
} else {
|
||||||
|
const tops = view.css.top
|
||||||
|
y = tops[0].toPx(true, this.style.height) + this.globalHeight[tops[1]] * (tops[2] || 1)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
y = 0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const angle = view.css && view.css.rotate ? this._getAngle(view.css.rotate) : 0
|
||||||
|
// 当设置了 right 时,默认 align 用 right,反之用 left
|
||||||
|
const align = view.css && view.css.align ? view.css.align : view.css && view.css.right ? 'right' : 'left'
|
||||||
|
const verticalAlign = view.css && view.css.verticalAlign ? view.css.verticalAlign : 'top'
|
||||||
|
// 记录绘制时的画布
|
||||||
|
let xa = 0
|
||||||
|
switch (align) {
|
||||||
|
case 'center':
|
||||||
|
xa = x
|
||||||
|
break
|
||||||
|
case 'right':
|
||||||
|
xa = x - width / 2
|
||||||
|
break
|
||||||
|
default:
|
||||||
|
xa = x + width / 2
|
||||||
|
break
|
||||||
|
}
|
||||||
|
let ya = 0
|
||||||
|
switch (verticalAlign) {
|
||||||
|
case 'center':
|
||||||
|
ya = y
|
||||||
|
break
|
||||||
|
case 'bottom':
|
||||||
|
ya = y - height / 2
|
||||||
|
break
|
||||||
|
default:
|
||||||
|
ya = y + height / 2
|
||||||
|
break
|
||||||
|
}
|
||||||
|
this.ctx.translate(xa, ya)
|
||||||
|
// 记录该 view 的有效点击区域
|
||||||
|
// TODO ,旋转和裁剪的判断
|
||||||
|
// 记录在真实画布上的左侧
|
||||||
|
let left = x
|
||||||
|
if (align === 'center') {
|
||||||
|
left = x - width / 2
|
||||||
|
} else if (align === 'right') {
|
||||||
|
left = x - width
|
||||||
|
}
|
||||||
|
var top = y
|
||||||
|
if (verticalAlign === 'center') {
|
||||||
|
top = y - height / 2
|
||||||
|
} else if (verticalAlign === 'bottom') {
|
||||||
|
top = y - height
|
||||||
|
}
|
||||||
|
if (view.rect) {
|
||||||
|
view.rect.left = left
|
||||||
|
view.rect.top = top
|
||||||
|
view.rect.right = left + width
|
||||||
|
view.rect.bottom = top + height
|
||||||
|
view.rect.x = view.css && view.css.right ? x - width : x
|
||||||
|
view.rect.y = y
|
||||||
|
} else {
|
||||||
|
view.rect = {
|
||||||
|
left: left,
|
||||||
|
top: top,
|
||||||
|
right: left + width,
|
||||||
|
bottom: top + height,
|
||||||
|
x: view.css && view.css.right ? x - width : x,
|
||||||
|
y: y
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
view.rect.left = view.rect.left - paddings[3]
|
||||||
|
view.rect.top = view.rect.top - paddings[0]
|
||||||
|
view.rect.right = view.rect.right + paddings[1]
|
||||||
|
view.rect.bottom = view.rect.bottom + paddings[2]
|
||||||
|
if (view.type === 'text') {
|
||||||
|
view.rect.minWidth = view.css.fontSize.toPx() + paddings[1] + paddings[3]
|
||||||
|
}
|
||||||
|
|
||||||
|
this.ctx.rotate(angle)
|
||||||
|
if (!notClip && view.css && view.css.borderRadius && view.type !== 'rect') {
|
||||||
|
this._doClip(view.css.borderRadius, width, height, view.css.borderStyle)
|
||||||
|
}
|
||||||
|
this._doShadow(view)
|
||||||
|
if (view.id) {
|
||||||
|
this.globalWidth[view.id] = width
|
||||||
|
this.globalHeight[view.id] = height
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
width: width,
|
||||||
|
height: height,
|
||||||
|
x: x,
|
||||||
|
y: y,
|
||||||
|
extra: extra
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
_doPaddings(view) {
|
||||||
|
const { padding } = view.css ? view.css : {}
|
||||||
|
let pd = [0, 0, 0, 0]
|
||||||
|
if (padding) {
|
||||||
|
const pdg = padding.split(/\s+/)
|
||||||
|
if (pdg.length === 1) {
|
||||||
|
const x = pdg[0].toPx()
|
||||||
|
pd = [x, x, x, x]
|
||||||
|
}
|
||||||
|
if (pdg.length === 2) {
|
||||||
|
const x = pdg[0].toPx()
|
||||||
|
const y = pdg[1].toPx()
|
||||||
|
pd = [x, y, x, y]
|
||||||
|
}
|
||||||
|
if (pdg.length === 3) {
|
||||||
|
const x = pdg[0].toPx()
|
||||||
|
const y = pdg[1].toPx()
|
||||||
|
const z = pdg[2].toPx()
|
||||||
|
pd = [x, y, z, y]
|
||||||
|
}
|
||||||
|
if (pdg.length === 4) {
|
||||||
|
const x = pdg[0].toPx()
|
||||||
|
const y = pdg[1].toPx()
|
||||||
|
const z = pdg[2].toPx()
|
||||||
|
const a = pdg[3].toPx()
|
||||||
|
pd = [x, y, z, a]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return pd
|
||||||
|
}
|
||||||
|
|
||||||
|
// 画文字的背景图片
|
||||||
|
_doBackground(view) {
|
||||||
|
this.ctx.save()
|
||||||
|
const { width: rawWidth, height: rawHeight } = this._preProcess(view, true)
|
||||||
|
const { background } = view.css
|
||||||
|
let pd = this._doPaddings(view)
|
||||||
|
const width = rawWidth + pd[1] + pd[3]
|
||||||
|
const height = rawHeight + pd[0] + pd[2]
|
||||||
|
this._doClip(view.css.borderRadius, width, height, view.css.borderStyle)
|
||||||
|
if (GD.api.isGradient(background)) {
|
||||||
|
GD.api.doGradient(background, width, height, this.ctx)
|
||||||
|
} else {
|
||||||
|
this.ctx.fillStyle = background
|
||||||
|
}
|
||||||
|
this.ctx.fillRect(-(width / 2), -(height / 2), width, height)
|
||||||
|
|
||||||
|
this.ctx.restore()
|
||||||
|
}
|
||||||
|
|
||||||
|
_drawQRCode(view) {
|
||||||
|
this.ctx.save()
|
||||||
|
const { width, height } = this._preProcess(view)
|
||||||
|
QR.api.draw(view.content, this.ctx, -width / 2, -height / 2, width, height, view.css.background, view.css.color)
|
||||||
|
this.ctx.restore()
|
||||||
|
this._doBorder(view, width, height)
|
||||||
|
}
|
||||||
|
|
||||||
|
_drawAbsImage(view) {
|
||||||
|
if (!view.url) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.ctx.save()
|
||||||
|
const { width, height } = this._preProcess(view)
|
||||||
|
// 图片失败
|
||||||
|
if (typeof view.url === 'string') {
|
||||||
|
this.ctx.fillStyle = '#ddd'
|
||||||
|
this.ctx.fillRect(-(width / 2), -(height / 2), width, height)
|
||||||
|
this.ctx.restore()
|
||||||
|
return
|
||||||
|
}
|
||||||
|
// 获得缩放到图片大小级别的裁减框
|
||||||
|
let rWidth = view.sWidth
|
||||||
|
let rHeight = view.sHeight
|
||||||
|
let startX = 0
|
||||||
|
let startY = 0
|
||||||
|
// 绘画区域比例
|
||||||
|
const cp = width / height
|
||||||
|
// 原图比例
|
||||||
|
const op = view.sWidth / view.sHeight
|
||||||
|
if (cp >= op) {
|
||||||
|
rHeight = rWidth / cp
|
||||||
|
startY = Math.round((view.sHeight - rHeight) / 2)
|
||||||
|
} else {
|
||||||
|
rWidth = rHeight * cp
|
||||||
|
startX = Math.round((view.sWidth - rWidth) / 2)
|
||||||
|
}
|
||||||
|
if (view.css && view.css.mode === 'scaleToFill') {
|
||||||
|
this.ctx.drawImage(view.url, -(width / 2), -(height / 2), width, height)
|
||||||
|
} else {
|
||||||
|
this.ctx.drawImage(view.url, startX, startY, rWidth, rHeight, -(width / 2), -(height / 2), width, height)
|
||||||
|
view.rect.startX = startX / view.sWidth
|
||||||
|
view.rect.startY = startY / view.sHeight
|
||||||
|
view.rect.endX = (startX + rWidth) / view.sWidth
|
||||||
|
view.rect.endY = (startY + rHeight) / view.sHeight
|
||||||
|
}
|
||||||
|
this.ctx.restore()
|
||||||
|
this._doBorder(view, width, height)
|
||||||
|
}
|
||||||
|
|
||||||
|
_fillAbsText(view) {
|
||||||
|
if (!view.text) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (view.css.background) {
|
||||||
|
// 生成背景
|
||||||
|
this._doBackground(view)
|
||||||
|
}
|
||||||
|
this.ctx.save()
|
||||||
|
const { width, height, extra } = this._preProcess(view, view.css.background && view.css.borderRadius)
|
||||||
|
this.ctx.fillStyle = view.css.color || 'black'
|
||||||
|
const { lines, lineHeight, textArray, linesArray, textIndent } = extra
|
||||||
|
// 如果设置了id,则保留 text 的长度
|
||||||
|
if (view.id) {
|
||||||
|
let textWidth = 0
|
||||||
|
for (let i = 0; i < textArray.length; ++i) {
|
||||||
|
const _w = this.ctx.measureText(textArray[i]).width
|
||||||
|
textWidth = _w > textWidth ? _w : textWidth
|
||||||
|
}
|
||||||
|
this.globalWidth[view.id] = width ? (textWidth < width ? textWidth : width) : textWidth
|
||||||
|
}
|
||||||
|
let lineIndex = 0
|
||||||
|
let tabWidth = 0
|
||||||
|
for (let j = 0; j < textArray.length; ++j) {
|
||||||
|
const preLineLength = Math.ceil(textArray[j].length / linesArray[j])
|
||||||
|
const firstLineLength = Math.ceil(((width - textIndent) / width) * (textArray[j].length / linesArray[j]))
|
||||||
|
let start = 0
|
||||||
|
let alreadyCount = 0
|
||||||
|
|
||||||
|
for (let i = 0; i < linesArray[j]; ++i) {
|
||||||
|
// 绘制行数大于最大行数,则直接跳出循环
|
||||||
|
if (lineIndex >= lines) {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
tabWidth = i == 0 ? textIndent : 0
|
||||||
|
alreadyCount = i == 0 ? firstLineLength : preLineLength
|
||||||
|
let text = textArray[j].substr(start, alreadyCount)
|
||||||
|
let measuredWith = this.ctx.measureText(text).width
|
||||||
|
// 如果测量大小小于width一个字符的大小,则进行补齐,如果测量大小超出 width,则进行减除
|
||||||
|
// 如果已经到文本末尾,也不要进行该循环
|
||||||
|
while (start + alreadyCount <= textArray[j].length && (width - measuredWith - tabWidth > view.css.fontSize.toPx() || measuredWith - width > view.css.fontSize.toPx())) {
|
||||||
|
if (measuredWith < width) {
|
||||||
|
text = textArray[j].substr(start, ++alreadyCount)
|
||||||
|
} else {
|
||||||
|
if (text.length <= 1) {
|
||||||
|
// 如果只有一个字符时,直接跳出循环
|
||||||
|
break
|
||||||
|
}
|
||||||
|
text = textArray[j].substr(start, --alreadyCount)
|
||||||
|
// break
|
||||||
|
}
|
||||||
|
measuredWith = this.ctx.measureText(text).width
|
||||||
|
}
|
||||||
|
start += text.length
|
||||||
|
// 如果是最后一行了,发现还有未绘制完的内容,则加...
|
||||||
|
if (lineIndex === lines - 1 && (j < textArray.length - 1 || start < textArray[j].length)) {
|
||||||
|
while (this.ctx.measureText(`${text}...`).width > width) {
|
||||||
|
if (text.length <= 1) {
|
||||||
|
// 如果只有一个字符时,直接跳出循环
|
||||||
|
break
|
||||||
|
}
|
||||||
|
text = text.substring(0, text.length - 1)
|
||||||
|
}
|
||||||
|
text += '...'
|
||||||
|
measuredWith = this.ctx.measureText(text).width
|
||||||
|
}
|
||||||
|
this.ctx.textAlign = view.css.textAlign ? view.css.textAlign : 'left'
|
||||||
|
let x
|
||||||
|
let lineX
|
||||||
|
switch (view.css.textAlign) {
|
||||||
|
case 'center':
|
||||||
|
x = 0
|
||||||
|
lineX = x - measuredWith / 2 + tabWidth
|
||||||
|
break
|
||||||
|
case 'right':
|
||||||
|
x = width / 2
|
||||||
|
lineX = x - measuredWith + tabWidth
|
||||||
|
break
|
||||||
|
default:
|
||||||
|
x = -(width / 2) + tabWidth
|
||||||
|
lineX = x
|
||||||
|
break
|
||||||
|
}
|
||||||
|
const y = -(height / 2) + (lineIndex === 0 ? view.css.fontSize.toPx() : view.css.fontSize.toPx() + lineIndex * lineHeight)
|
||||||
|
lineIndex++
|
||||||
|
if (view.css.textStyle === 'stroke') {
|
||||||
|
this.ctx.strokeText(text, x, y, measuredWith)
|
||||||
|
} else {
|
||||||
|
this.ctx.fillText(text, x, y, measuredWith)
|
||||||
|
}
|
||||||
|
const fontSize = view.css.fontSize.toPx()
|
||||||
|
if (view.css.textDecoration) {
|
||||||
|
this.ctx.lineWidth = fontSize / 13
|
||||||
|
this.ctx.beginPath()
|
||||||
|
if (/\bunderline\b/.test(view.css.textDecoration)) {
|
||||||
|
this.ctx.moveTo(lineX, y)
|
||||||
|
this.ctx.lineTo(lineX + measuredWith, y)
|
||||||
|
}
|
||||||
|
if (/\boverline\b/.test(view.css.textDecoration)) {
|
||||||
|
this.ctx.moveTo(lineX, y - fontSize)
|
||||||
|
this.ctx.lineTo(lineX + measuredWith, y - fontSize)
|
||||||
|
}
|
||||||
|
if (/\bline-through\b/.test(view.css.textDecoration)) {
|
||||||
|
this.ctx.moveTo(lineX, y - fontSize / 3)
|
||||||
|
this.ctx.lineTo(lineX + measuredWith, y - fontSize / 3)
|
||||||
|
}
|
||||||
|
this.ctx.closePath()
|
||||||
|
this.ctx.strokeStyle = view.css.color
|
||||||
|
this.ctx.stroke()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.ctx.restore()
|
||||||
|
this._doBorder(view, width, height)
|
||||||
|
}
|
||||||
|
|
||||||
|
_drawAbsRect(view) {
|
||||||
|
this.ctx.save()
|
||||||
|
const { width, height } = this._preProcess(view)
|
||||||
|
if (GD.api.isGradient(view.css.color)) {
|
||||||
|
GD.api.doGradient(view.css.color, width, height, this.ctx)
|
||||||
|
} else {
|
||||||
|
this.ctx.fillStyle = view.css.color
|
||||||
|
}
|
||||||
|
const { borderRadius, borderStyle, borderWidth } = view.css
|
||||||
|
this._border({
|
||||||
|
borderRadius,
|
||||||
|
width,
|
||||||
|
height,
|
||||||
|
borderWidth,
|
||||||
|
borderStyle
|
||||||
|
})
|
||||||
|
this.ctx.fill()
|
||||||
|
this.ctx.restore()
|
||||||
|
this._doBorder(view, width, height)
|
||||||
|
}
|
||||||
|
|
||||||
|
// shadow 支持 (x, y, blur, color), 不支持 spread
|
||||||
|
// shadow:0px 0px 10px rgba(0,0,0,0.1);
|
||||||
|
_doShadow(view) {
|
||||||
|
if (!view.css || !view.css.shadow) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
const box = view.css.shadow.replace(/,\s+/g, ',').split(/\s+/)
|
||||||
|
if (box.length > 4) {
|
||||||
|
console.error("shadow don't spread option")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.ctx.shadowOffsetX = parseInt(box[0], 10)
|
||||||
|
this.ctx.shadowOffsetY = parseInt(box[1], 10)
|
||||||
|
this.ctx.shadowBlur = parseInt(box[2], 10)
|
||||||
|
this.ctx.shadowColor = box[3]
|
||||||
|
}
|
||||||
|
|
||||||
|
_getAngle(angle) {
|
||||||
|
return (Number(angle) * Math.PI) / 180
|
||||||
|
}
|
||||||
|
}
|
||||||
781
components/vue-canvas-poster/qrcode.js
Normal file
@@ -0,0 +1,781 @@
|
|||||||
|
/* eslint-disable */
|
||||||
|
|
||||||
|
// alignment pattern
|
||||||
|
var adelta = [
|
||||||
|
0, 11, 15, 19, 23, 27, 31,
|
||||||
|
16, 18, 20, 22, 24, 26, 28, 20, 22, 24, 24, 26, 28, 28, 22, 24, 24,
|
||||||
|
26, 26, 28, 28, 24, 24, 26, 26, 26, 28, 28, 24, 26, 26, 26, 28, 28
|
||||||
|
];
|
||||||
|
|
||||||
|
// version block
|
||||||
|
var vpat = [
|
||||||
|
0xc94, 0x5bc, 0xa99, 0x4d3, 0xbf6, 0x762, 0x847, 0x60d,
|
||||||
|
0x928, 0xb78, 0x45d, 0xa17, 0x532, 0x9a6, 0x683, 0x8c9,
|
||||||
|
0x7ec, 0xec4, 0x1e1, 0xfab, 0x08e, 0xc1a, 0x33f, 0xd75,
|
||||||
|
0x250, 0x9d5, 0x6f0, 0x8ba, 0x79f, 0xb0b, 0x42e, 0xa64,
|
||||||
|
0x541, 0xc69
|
||||||
|
];
|
||||||
|
|
||||||
|
// final format bits with mask: level << 3 | mask
|
||||||
|
var fmtword = [
|
||||||
|
0x77c4, 0x72f3, 0x7daa, 0x789d, 0x662f, 0x6318, 0x6c41, 0x6976, //L
|
||||||
|
0x5412, 0x5125, 0x5e7c, 0x5b4b, 0x45f9, 0x40ce, 0x4f97, 0x4aa0, //M
|
||||||
|
0x355f, 0x3068, 0x3f31, 0x3a06, 0x24b4, 0x2183, 0x2eda, 0x2bed, //Q
|
||||||
|
0x1689, 0x13be, 0x1ce7, 0x19d0, 0x0762, 0x0255, 0x0d0c, 0x083b //H
|
||||||
|
];
|
||||||
|
|
||||||
|
// 4 per version: number of blocks 1,2; data width; ecc width
|
||||||
|
var eccblocks = [
|
||||||
|
1, 0, 19, 7, 1, 0, 16, 10, 1, 0, 13, 13, 1, 0, 9, 17,
|
||||||
|
1, 0, 34, 10, 1, 0, 28, 16, 1, 0, 22, 22, 1, 0, 16, 28,
|
||||||
|
1, 0, 55, 15, 1, 0, 44, 26, 2, 0, 17, 18, 2, 0, 13, 22,
|
||||||
|
1, 0, 80, 20, 2, 0, 32, 18, 2, 0, 24, 26, 4, 0, 9, 16,
|
||||||
|
1, 0, 108, 26, 2, 0, 43, 24, 2, 2, 15, 18, 2, 2, 11, 22,
|
||||||
|
2, 0, 68, 18, 4, 0, 27, 16, 4, 0, 19, 24, 4, 0, 15, 28,
|
||||||
|
2, 0, 78, 20, 4, 0, 31, 18, 2, 4, 14, 18, 4, 1, 13, 26,
|
||||||
|
2, 0, 97, 24, 2, 2, 38, 22, 4, 2, 18, 22, 4, 2, 14, 26,
|
||||||
|
2, 0, 116, 30, 3, 2, 36, 22, 4, 4, 16, 20, 4, 4, 12, 24,
|
||||||
|
2, 2, 68, 18, 4, 1, 43, 26, 6, 2, 19, 24, 6, 2, 15, 28,
|
||||||
|
4, 0, 81, 20, 1, 4, 50, 30, 4, 4, 22, 28, 3, 8, 12, 24,
|
||||||
|
2, 2, 92, 24, 6, 2, 36, 22, 4, 6, 20, 26, 7, 4, 14, 28,
|
||||||
|
4, 0, 107, 26, 8, 1, 37, 22, 8, 4, 20, 24, 12, 4, 11, 22,
|
||||||
|
3, 1, 115, 30, 4, 5, 40, 24, 11, 5, 16, 20, 11, 5, 12, 24,
|
||||||
|
5, 1, 87, 22, 5, 5, 41, 24, 5, 7, 24, 30, 11, 7, 12, 24,
|
||||||
|
5, 1, 98, 24, 7, 3, 45, 28, 15, 2, 19, 24, 3, 13, 15, 30,
|
||||||
|
1, 5, 107, 28, 10, 1, 46, 28, 1, 15, 22, 28, 2, 17, 14, 28,
|
||||||
|
5, 1, 120, 30, 9, 4, 43, 26, 17, 1, 22, 28, 2, 19, 14, 28,
|
||||||
|
3, 4, 113, 28, 3, 11, 44, 26, 17, 4, 21, 26, 9, 16, 13, 26,
|
||||||
|
3, 5, 107, 28, 3, 13, 41, 26, 15, 5, 24, 30, 15, 10, 15, 28,
|
||||||
|
4, 4, 116, 28, 17, 0, 42, 26, 17, 6, 22, 28, 19, 6, 16, 30,
|
||||||
|
2, 7, 111, 28, 17, 0, 46, 28, 7, 16, 24, 30, 34, 0, 13, 24,
|
||||||
|
4, 5, 121, 30, 4, 14, 47, 28, 11, 14, 24, 30, 16, 14, 15, 30,
|
||||||
|
6, 4, 117, 30, 6, 14, 45, 28, 11, 16, 24, 30, 30, 2, 16, 30,
|
||||||
|
8, 4, 106, 26, 8, 13, 47, 28, 7, 22, 24, 30, 22, 13, 15, 30,
|
||||||
|
10, 2, 114, 28, 19, 4, 46, 28, 28, 6, 22, 28, 33, 4, 16, 30,
|
||||||
|
8, 4, 122, 30, 22, 3, 45, 28, 8, 26, 23, 30, 12, 28, 15, 30,
|
||||||
|
3, 10, 117, 30, 3, 23, 45, 28, 4, 31, 24, 30, 11, 31, 15, 30,
|
||||||
|
7, 7, 116, 30, 21, 7, 45, 28, 1, 37, 23, 30, 19, 26, 15, 30,
|
||||||
|
5, 10, 115, 30, 19, 10, 47, 28, 15, 25, 24, 30, 23, 25, 15, 30,
|
||||||
|
13, 3, 115, 30, 2, 29, 46, 28, 42, 1, 24, 30, 23, 28, 15, 30,
|
||||||
|
17, 0, 115, 30, 10, 23, 46, 28, 10, 35, 24, 30, 19, 35, 15, 30,
|
||||||
|
17, 1, 115, 30, 14, 21, 46, 28, 29, 19, 24, 30, 11, 46, 15, 30,
|
||||||
|
13, 6, 115, 30, 14, 23, 46, 28, 44, 7, 24, 30, 59, 1, 16, 30,
|
||||||
|
12, 7, 121, 30, 12, 26, 47, 28, 39, 14, 24, 30, 22, 41, 15, 30,
|
||||||
|
6, 14, 121, 30, 6, 34, 47, 28, 46, 10, 24, 30, 2, 64, 15, 30,
|
||||||
|
17, 4, 122, 30, 29, 14, 46, 28, 49, 10, 24, 30, 24, 46, 15, 30,
|
||||||
|
4, 18, 122, 30, 13, 32, 46, 28, 48, 14, 24, 30, 42, 32, 15, 30,
|
||||||
|
20, 4, 117, 30, 40, 7, 47, 28, 43, 22, 24, 30, 10, 67, 15, 30,
|
||||||
|
19, 6, 118, 30, 18, 31, 47, 28, 34, 34, 24, 30, 20, 61, 15, 30
|
||||||
|
];
|
||||||
|
|
||||||
|
// Galois field log table
|
||||||
|
var glog = [
|
||||||
|
0xff, 0x00, 0x01, 0x19, 0x02, 0x32, 0x1a, 0xc6, 0x03, 0xdf, 0x33, 0xee, 0x1b, 0x68, 0xc7, 0x4b,
|
||||||
|
0x04, 0x64, 0xe0, 0x0e, 0x34, 0x8d, 0xef, 0x81, 0x1c, 0xc1, 0x69, 0xf8, 0xc8, 0x08, 0x4c, 0x71,
|
||||||
|
0x05, 0x8a, 0x65, 0x2f, 0xe1, 0x24, 0x0f, 0x21, 0x35, 0x93, 0x8e, 0xda, 0xf0, 0x12, 0x82, 0x45,
|
||||||
|
0x1d, 0xb5, 0xc2, 0x7d, 0x6a, 0x27, 0xf9, 0xb9, 0xc9, 0x9a, 0x09, 0x78, 0x4d, 0xe4, 0x72, 0xa6,
|
||||||
|
0x06, 0xbf, 0x8b, 0x62, 0x66, 0xdd, 0x30, 0xfd, 0xe2, 0x98, 0x25, 0xb3, 0x10, 0x91, 0x22, 0x88,
|
||||||
|
0x36, 0xd0, 0x94, 0xce, 0x8f, 0x96, 0xdb, 0xbd, 0xf1, 0xd2, 0x13, 0x5c, 0x83, 0x38, 0x46, 0x40,
|
||||||
|
0x1e, 0x42, 0xb6, 0xa3, 0xc3, 0x48, 0x7e, 0x6e, 0x6b, 0x3a, 0x28, 0x54, 0xfa, 0x85, 0xba, 0x3d,
|
||||||
|
0xca, 0x5e, 0x9b, 0x9f, 0x0a, 0x15, 0x79, 0x2b, 0x4e, 0xd4, 0xe5, 0xac, 0x73, 0xf3, 0xa7, 0x57,
|
||||||
|
0x07, 0x70, 0xc0, 0xf7, 0x8c, 0x80, 0x63, 0x0d, 0x67, 0x4a, 0xde, 0xed, 0x31, 0xc5, 0xfe, 0x18,
|
||||||
|
0xe3, 0xa5, 0x99, 0x77, 0x26, 0xb8, 0xb4, 0x7c, 0x11, 0x44, 0x92, 0xd9, 0x23, 0x20, 0x89, 0x2e,
|
||||||
|
0x37, 0x3f, 0xd1, 0x5b, 0x95, 0xbc, 0xcf, 0xcd, 0x90, 0x87, 0x97, 0xb2, 0xdc, 0xfc, 0xbe, 0x61,
|
||||||
|
0xf2, 0x56, 0xd3, 0xab, 0x14, 0x2a, 0x5d, 0x9e, 0x84, 0x3c, 0x39, 0x53, 0x47, 0x6d, 0x41, 0xa2,
|
||||||
|
0x1f, 0x2d, 0x43, 0xd8, 0xb7, 0x7b, 0xa4, 0x76, 0xc4, 0x17, 0x49, 0xec, 0x7f, 0x0c, 0x6f, 0xf6,
|
||||||
|
0x6c, 0xa1, 0x3b, 0x52, 0x29, 0x9d, 0x55, 0xaa, 0xfb, 0x60, 0x86, 0xb1, 0xbb, 0xcc, 0x3e, 0x5a,
|
||||||
|
0xcb, 0x59, 0x5f, 0xb0, 0x9c, 0xa9, 0xa0, 0x51, 0x0b, 0xf5, 0x16, 0xeb, 0x7a, 0x75, 0x2c, 0xd7,
|
||||||
|
0x4f, 0xae, 0xd5, 0xe9, 0xe6, 0xe7, 0xad, 0xe8, 0x74, 0xd6, 0xf4, 0xea, 0xa8, 0x50, 0x58, 0xaf
|
||||||
|
];
|
||||||
|
|
||||||
|
// Galios field exponent table
|
||||||
|
var gexp = [
|
||||||
|
0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1d, 0x3a, 0x74, 0xe8, 0xcd, 0x87, 0x13, 0x26,
|
||||||
|
0x4c, 0x98, 0x2d, 0x5a, 0xb4, 0x75, 0xea, 0xc9, 0x8f, 0x03, 0x06, 0x0c, 0x18, 0x30, 0x60, 0xc0,
|
||||||
|
0x9d, 0x27, 0x4e, 0x9c, 0x25, 0x4a, 0x94, 0x35, 0x6a, 0xd4, 0xb5, 0x77, 0xee, 0xc1, 0x9f, 0x23,
|
||||||
|
0x46, 0x8c, 0x05, 0x0a, 0x14, 0x28, 0x50, 0xa0, 0x5d, 0xba, 0x69, 0xd2, 0xb9, 0x6f, 0xde, 0xa1,
|
||||||
|
0x5f, 0xbe, 0x61, 0xc2, 0x99, 0x2f, 0x5e, 0xbc, 0x65, 0xca, 0x89, 0x0f, 0x1e, 0x3c, 0x78, 0xf0,
|
||||||
|
0xfd, 0xe7, 0xd3, 0xbb, 0x6b, 0xd6, 0xb1, 0x7f, 0xfe, 0xe1, 0xdf, 0xa3, 0x5b, 0xb6, 0x71, 0xe2,
|
||||||
|
0xd9, 0xaf, 0x43, 0x86, 0x11, 0x22, 0x44, 0x88, 0x0d, 0x1a, 0x34, 0x68, 0xd0, 0xbd, 0x67, 0xce,
|
||||||
|
0x81, 0x1f, 0x3e, 0x7c, 0xf8, 0xed, 0xc7, 0x93, 0x3b, 0x76, 0xec, 0xc5, 0x97, 0x33, 0x66, 0xcc,
|
||||||
|
0x85, 0x17, 0x2e, 0x5c, 0xb8, 0x6d, 0xda, 0xa9, 0x4f, 0x9e, 0x21, 0x42, 0x84, 0x15, 0x2a, 0x54,
|
||||||
|
0xa8, 0x4d, 0x9a, 0x29, 0x52, 0xa4, 0x55, 0xaa, 0x49, 0x92, 0x39, 0x72, 0xe4, 0xd5, 0xb7, 0x73,
|
||||||
|
0xe6, 0xd1, 0xbf, 0x63, 0xc6, 0x91, 0x3f, 0x7e, 0xfc, 0xe5, 0xd7, 0xb3, 0x7b, 0xf6, 0xf1, 0xff,
|
||||||
|
0xe3, 0xdb, 0xab, 0x4b, 0x96, 0x31, 0x62, 0xc4, 0x95, 0x37, 0x6e, 0xdc, 0xa5, 0x57, 0xae, 0x41,
|
||||||
|
0x82, 0x19, 0x32, 0x64, 0xc8, 0x8d, 0x07, 0x0e, 0x1c, 0x38, 0x70, 0xe0, 0xdd, 0xa7, 0x53, 0xa6,
|
||||||
|
0x51, 0xa2, 0x59, 0xb2, 0x79, 0xf2, 0xf9, 0xef, 0xc3, 0x9b, 0x2b, 0x56, 0xac, 0x45, 0x8a, 0x09,
|
||||||
|
0x12, 0x24, 0x48, 0x90, 0x3d, 0x7a, 0xf4, 0xf5, 0xf7, 0xf3, 0xfb, 0xeb, 0xcb, 0x8b, 0x0b, 0x16,
|
||||||
|
0x2c, 0x58, 0xb0, 0x7d, 0xfa, 0xe9, 0xcf, 0x83, 0x1b, 0x36, 0x6c, 0xd8, 0xad, 0x47, 0x8e, 0x00
|
||||||
|
];
|
||||||
|
|
||||||
|
// Working buffers:
|
||||||
|
// data input and ecc append, image working buffer, fixed part of image, run lengths for badness
|
||||||
|
var strinbuf = [], eccbuf = [], qrframe = [], framask = [], rlens = [];
|
||||||
|
// Control values - width is based on version, last 4 are from table.
|
||||||
|
var version, width, neccblk1, neccblk2, datablkw, eccblkwid;
|
||||||
|
var ecclevel = 2;
|
||||||
|
// set bit to indicate cell in qrframe is immutable. symmetric around diagonal
|
||||||
|
function setmask(x, y) {
|
||||||
|
var bt;
|
||||||
|
if (x > y) {
|
||||||
|
bt = x;
|
||||||
|
x = y;
|
||||||
|
y = bt;
|
||||||
|
}
|
||||||
|
// y*y = 1+3+5...
|
||||||
|
bt = y;
|
||||||
|
bt *= y;
|
||||||
|
bt += y;
|
||||||
|
bt >>= 1;
|
||||||
|
bt += x;
|
||||||
|
framask[bt] = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
// enter alignment pattern - black to qrframe, white to mask (later black frame merged to mask)
|
||||||
|
function putalign(x, y) {
|
||||||
|
var j;
|
||||||
|
|
||||||
|
qrframe[x + width * y] = 1;
|
||||||
|
for (j = -2; j < 2; j++) {
|
||||||
|
qrframe[(x + j) + width * (y - 2)] = 1;
|
||||||
|
qrframe[(x - 2) + width * (y + j + 1)] = 1;
|
||||||
|
qrframe[(x + 2) + width * (y + j)] = 1;
|
||||||
|
qrframe[(x + j + 1) + width * (y + 2)] = 1;
|
||||||
|
}
|
||||||
|
for (j = 0; j < 2; j++) {
|
||||||
|
setmask(x - 1, y + j);
|
||||||
|
setmask(x + 1, y - j);
|
||||||
|
setmask(x - j, y - 1);
|
||||||
|
setmask(x + j, y + 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//========================================================================
|
||||||
|
// Reed Solomon error correction
|
||||||
|
// exponentiation mod N
|
||||||
|
function modnn(x) {
|
||||||
|
while (x >= 255) {
|
||||||
|
x -= 255;
|
||||||
|
x = (x >> 8) + (x & 255);
|
||||||
|
}
|
||||||
|
return x;
|
||||||
|
}
|
||||||
|
|
||||||
|
var genpoly = [];
|
||||||
|
|
||||||
|
// Calculate and append ECC data to data block. Block is in strinbuf, indexes to buffers given.
|
||||||
|
function appendrs(data, dlen, ecbuf, eclen) {
|
||||||
|
var i, j, fb;
|
||||||
|
|
||||||
|
for (i = 0; i < eclen; i++)
|
||||||
|
strinbuf[ecbuf + i] = 0;
|
||||||
|
for (i = 0; i < dlen; i++) {
|
||||||
|
fb = glog[strinbuf[data + i] ^ strinbuf[ecbuf]];
|
||||||
|
if (fb != 255) /* fb term is non-zero */
|
||||||
|
for (j = 1; j < eclen; j++)
|
||||||
|
strinbuf[ecbuf + j - 1] = strinbuf[ecbuf + j] ^ gexp[modnn(fb + genpoly[eclen - j])];
|
||||||
|
else
|
||||||
|
for (j = ecbuf; j < ecbuf + eclen; j++)
|
||||||
|
strinbuf[j] = strinbuf[j + 1];
|
||||||
|
strinbuf[ecbuf + eclen - 1] = fb == 255 ? 0 : gexp[modnn(fb + genpoly[0])];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//========================================================================
|
||||||
|
// Frame data insert following the path rules
|
||||||
|
|
||||||
|
// check mask - since symmetrical use half.
|
||||||
|
function ismasked(x, y) {
|
||||||
|
var bt;
|
||||||
|
if (x > y) {
|
||||||
|
bt = x;
|
||||||
|
x = y;
|
||||||
|
y = bt;
|
||||||
|
}
|
||||||
|
bt = y;
|
||||||
|
bt += y * y;
|
||||||
|
bt >>= 1;
|
||||||
|
bt += x;
|
||||||
|
return framask[bt];
|
||||||
|
}
|
||||||
|
|
||||||
|
//========================================================================
|
||||||
|
// Apply the selected mask out of the 8.
|
||||||
|
function applymask(m) {
|
||||||
|
var x, y, r3x, r3y;
|
||||||
|
|
||||||
|
switch (m) {
|
||||||
|
case 0:
|
||||||
|
for (y = 0; y < width; y++)
|
||||||
|
for (x = 0; x < width; x++)
|
||||||
|
if (!((x + y) & 1) && !ismasked(x, y))
|
||||||
|
qrframe[x + y * width] ^= 1;
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
for (y = 0; y < width; y++)
|
||||||
|
for (x = 0; x < width; x++)
|
||||||
|
if (!(y & 1) && !ismasked(x, y))
|
||||||
|
qrframe[x + y * width] ^= 1;
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
for (y = 0; y < width; y++)
|
||||||
|
for (r3x = 0, x = 0; x < width; x++ , r3x++) {
|
||||||
|
if (r3x == 3)
|
||||||
|
r3x = 0;
|
||||||
|
if (!r3x && !ismasked(x, y))
|
||||||
|
qrframe[x + y * width] ^= 1;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
for (r3y = 0, y = 0; y < width; y++ , r3y++) {
|
||||||
|
if (r3y == 3)
|
||||||
|
r3y = 0;
|
||||||
|
for (r3x = r3y, x = 0; x < width; x++ , r3x++) {
|
||||||
|
if (r3x == 3)
|
||||||
|
r3x = 0;
|
||||||
|
if (!r3x && !ismasked(x, y))
|
||||||
|
qrframe[x + y * width] ^= 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 4:
|
||||||
|
for (y = 0; y < width; y++)
|
||||||
|
for (r3x = 0, r3y = ((y >> 1) & 1), x = 0; x < width; x++ , r3x++) {
|
||||||
|
if (r3x == 3) {
|
||||||
|
r3x = 0;
|
||||||
|
r3y = !r3y;
|
||||||
|
}
|
||||||
|
if (!r3y && !ismasked(x, y))
|
||||||
|
qrframe[x + y * width] ^= 1;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 5:
|
||||||
|
for (r3y = 0, y = 0; y < width; y++ , r3y++) {
|
||||||
|
if (r3y == 3)
|
||||||
|
r3y = 0;
|
||||||
|
for (r3x = 0, x = 0; x < width; x++ , r3x++) {
|
||||||
|
if (r3x == 3)
|
||||||
|
r3x = 0;
|
||||||
|
if (!((x & y & 1) + !(!r3x | !r3y)) && !ismasked(x, y))
|
||||||
|
qrframe[x + y * width] ^= 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 6:
|
||||||
|
for (r3y = 0, y = 0; y < width; y++ , r3y++) {
|
||||||
|
if (r3y == 3)
|
||||||
|
r3y = 0;
|
||||||
|
for (r3x = 0, x = 0; x < width; x++ , r3x++) {
|
||||||
|
if (r3x == 3)
|
||||||
|
r3x = 0;
|
||||||
|
if (!(((x & y & 1) + (r3x && (r3x == r3y))) & 1) && !ismasked(x, y))
|
||||||
|
qrframe[x + y * width] ^= 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 7:
|
||||||
|
for (r3y = 0, y = 0; y < width; y++ , r3y++) {
|
||||||
|
if (r3y == 3)
|
||||||
|
r3y = 0;
|
||||||
|
for (r3x = 0, x = 0; x < width; x++ , r3x++) {
|
||||||
|
if (r3x == 3)
|
||||||
|
r3x = 0;
|
||||||
|
if (!(((r3x && (r3x == r3y)) + ((x + y) & 1)) & 1) && !ismasked(x, y))
|
||||||
|
qrframe[x + y * width] ^= 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Badness coefficients.
|
||||||
|
var N1 = 3, N2 = 3, N3 = 40, N4 = 10;
|
||||||
|
|
||||||
|
// Using the table of the length of each run, calculate the amount of bad image
|
||||||
|
// - long runs or those that look like finders; called twice, once each for X and Y
|
||||||
|
function badruns(length) {
|
||||||
|
var i;
|
||||||
|
var runsbad = 0;
|
||||||
|
for (i = 0; i <= length; i++)
|
||||||
|
if (rlens[i] >= 5)
|
||||||
|
runsbad += N1 + rlens[i] - 5;
|
||||||
|
// BwBBBwB as in finder
|
||||||
|
for (i = 3; i < length - 1; i += 2)
|
||||||
|
if (rlens[i - 2] == rlens[i + 2]
|
||||||
|
&& rlens[i + 2] == rlens[i - 1]
|
||||||
|
&& rlens[i - 1] == rlens[i + 1]
|
||||||
|
&& rlens[i - 1] * 3 == rlens[i]
|
||||||
|
// white around the black pattern? Not part of spec
|
||||||
|
&& (rlens[i - 3] == 0 // beginning
|
||||||
|
|| i + 3 > length // end
|
||||||
|
|| rlens[i - 3] * 3 >= rlens[i] * 4 || rlens[i + 3] * 3 >= rlens[i] * 4)
|
||||||
|
)
|
||||||
|
runsbad += N3;
|
||||||
|
return runsbad;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Calculate how bad the masked image is - blocks, imbalance, runs, or finders.
|
||||||
|
function badcheck() {
|
||||||
|
var x, y, h, b, b1;
|
||||||
|
var thisbad = 0;
|
||||||
|
var bw = 0;
|
||||||
|
|
||||||
|
// blocks of same color.
|
||||||
|
for (y = 0; y < width - 1; y++)
|
||||||
|
for (x = 0; x < width - 1; x++)
|
||||||
|
if ((qrframe[x + width * y] && qrframe[(x + 1) + width * y]
|
||||||
|
&& qrframe[x + width * (y + 1)] && qrframe[(x + 1) + width * (y + 1)]) // all black
|
||||||
|
|| !(qrframe[x + width * y] || qrframe[(x + 1) + width * y]
|
||||||
|
|| qrframe[x + width * (y + 1)] || qrframe[(x + 1) + width * (y + 1)])) // all white
|
||||||
|
thisbad += N2;
|
||||||
|
|
||||||
|
// X runs
|
||||||
|
for (y = 0; y < width; y++) {
|
||||||
|
rlens[0] = 0;
|
||||||
|
for (h = b = x = 0; x < width; x++) {
|
||||||
|
if ((b1 = qrframe[x + width * y]) == b)
|
||||||
|
rlens[h]++;
|
||||||
|
else
|
||||||
|
rlens[++h] = 1;
|
||||||
|
b = b1;
|
||||||
|
bw += b ? 1 : -1;
|
||||||
|
}
|
||||||
|
thisbad += badruns(h);
|
||||||
|
}
|
||||||
|
|
||||||
|
// black/white imbalance
|
||||||
|
if (bw < 0)
|
||||||
|
bw = -bw;
|
||||||
|
|
||||||
|
var big = bw;
|
||||||
|
var count = 0;
|
||||||
|
big += big << 2;
|
||||||
|
big <<= 1;
|
||||||
|
while (big > width * width)
|
||||||
|
big -= width * width, count++;
|
||||||
|
thisbad += count * N4;
|
||||||
|
|
||||||
|
// Y runs
|
||||||
|
for (x = 0; x < width; x++) {
|
||||||
|
rlens[0] = 0;
|
||||||
|
for (h = b = y = 0; y < width; y++) {
|
||||||
|
if ((b1 = qrframe[x + width * y]) == b)
|
||||||
|
rlens[h]++;
|
||||||
|
else
|
||||||
|
rlens[++h] = 1;
|
||||||
|
b = b1;
|
||||||
|
}
|
||||||
|
thisbad += badruns(h);
|
||||||
|
}
|
||||||
|
return thisbad;
|
||||||
|
}
|
||||||
|
|
||||||
|
function genframe(instring) {
|
||||||
|
var x, y, k, t, v, i, j, m;
|
||||||
|
|
||||||
|
// find the smallest version that fits the string
|
||||||
|
t = instring.length;
|
||||||
|
version = 0;
|
||||||
|
do {
|
||||||
|
version++;
|
||||||
|
k = (ecclevel - 1) * 4 + (version - 1) * 16;
|
||||||
|
neccblk1 = eccblocks[k++];
|
||||||
|
neccblk2 = eccblocks[k++];
|
||||||
|
datablkw = eccblocks[k++];
|
||||||
|
eccblkwid = eccblocks[k];
|
||||||
|
k = datablkw * (neccblk1 + neccblk2) + neccblk2 - 3 + (version <= 9);
|
||||||
|
if (t <= k)
|
||||||
|
break;
|
||||||
|
} while (version < 40);
|
||||||
|
|
||||||
|
// FIXME - insure that it fits insted of being truncated
|
||||||
|
width = 17 + 4 * version;
|
||||||
|
|
||||||
|
// allocate, clear and setup data structures
|
||||||
|
v = datablkw + (datablkw + eccblkwid) * (neccblk1 + neccblk2) + neccblk2;
|
||||||
|
for (t = 0; t < v; t++)
|
||||||
|
eccbuf[t] = 0;
|
||||||
|
strinbuf = instring.slice(0);
|
||||||
|
|
||||||
|
for (t = 0; t < width * width; t++)
|
||||||
|
qrframe[t] = 0;
|
||||||
|
|
||||||
|
for (t = 0; t < (width * (width + 1) + 1) / 2; t++)
|
||||||
|
framask[t] = 0;
|
||||||
|
|
||||||
|
// insert finders - black to frame, white to mask
|
||||||
|
for (t = 0; t < 3; t++) {
|
||||||
|
k = 0;
|
||||||
|
y = 0;
|
||||||
|
if (t == 1)
|
||||||
|
k = (width - 7);
|
||||||
|
if (t == 2)
|
||||||
|
y = (width - 7);
|
||||||
|
qrframe[(y + 3) + width * (k + 3)] = 1;
|
||||||
|
for (x = 0; x < 6; x++) {
|
||||||
|
qrframe[(y + x) + width * k] = 1;
|
||||||
|
qrframe[y + width * (k + x + 1)] = 1;
|
||||||
|
qrframe[(y + 6) + width * (k + x)] = 1;
|
||||||
|
qrframe[(y + x + 1) + width * (k + 6)] = 1;
|
||||||
|
}
|
||||||
|
for (x = 1; x < 5; x++) {
|
||||||
|
setmask(y + x, k + 1);
|
||||||
|
setmask(y + 1, k + x + 1);
|
||||||
|
setmask(y + 5, k + x);
|
||||||
|
setmask(y + x + 1, k + 5);
|
||||||
|
}
|
||||||
|
for (x = 2; x < 4; x++) {
|
||||||
|
qrframe[(y + x) + width * (k + 2)] = 1;
|
||||||
|
qrframe[(y + 2) + width * (k + x + 1)] = 1;
|
||||||
|
qrframe[(y + 4) + width * (k + x)] = 1;
|
||||||
|
qrframe[(y + x + 1) + width * (k + 4)] = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// alignment blocks
|
||||||
|
if (version > 1) {
|
||||||
|
t = adelta[version];
|
||||||
|
y = width - 7;
|
||||||
|
for (; ;) {
|
||||||
|
x = width - 7;
|
||||||
|
while (x > t - 3) {
|
||||||
|
putalign(x, y);
|
||||||
|
if (x < t)
|
||||||
|
break;
|
||||||
|
x -= t;
|
||||||
|
}
|
||||||
|
if (y <= t + 9)
|
||||||
|
break;
|
||||||
|
y -= t;
|
||||||
|
putalign(6, y);
|
||||||
|
putalign(y, 6);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// single black
|
||||||
|
qrframe[8 + width * (width - 8)] = 1;
|
||||||
|
|
||||||
|
// timing gap - mask only
|
||||||
|
for (y = 0; y < 7; y++) {
|
||||||
|
setmask(7, y);
|
||||||
|
setmask(width - 8, y);
|
||||||
|
setmask(7, y + width - 7);
|
||||||
|
}
|
||||||
|
for (x = 0; x < 8; x++) {
|
||||||
|
setmask(x, 7);
|
||||||
|
setmask(x + width - 8, 7);
|
||||||
|
setmask(x, width - 8);
|
||||||
|
}
|
||||||
|
|
||||||
|
// reserve mask-format area
|
||||||
|
for (x = 0; x < 9; x++)
|
||||||
|
setmask(x, 8);
|
||||||
|
for (x = 0; x < 8; x++) {
|
||||||
|
setmask(x + width - 8, 8);
|
||||||
|
setmask(8, x);
|
||||||
|
}
|
||||||
|
for (y = 0; y < 7; y++)
|
||||||
|
setmask(8, y + width - 7);
|
||||||
|
|
||||||
|
// timing row/col
|
||||||
|
for (x = 0; x < width - 14; x++)
|
||||||
|
if (x & 1) {
|
||||||
|
setmask(8 + x, 6);
|
||||||
|
setmask(6, 8 + x);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
qrframe[(8 + x) + width * 6] = 1;
|
||||||
|
qrframe[6 + width * (8 + x)] = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
// version block
|
||||||
|
if (version > 6) {
|
||||||
|
t = vpat[version - 7];
|
||||||
|
k = 17;
|
||||||
|
for (x = 0; x < 6; x++)
|
||||||
|
for (y = 0; y < 3; y++ , k--)
|
||||||
|
if (1 & (k > 11 ? version >> (k - 12) : t >> k)) {
|
||||||
|
qrframe[(5 - x) + width * (2 - y + width - 11)] = 1;
|
||||||
|
qrframe[(2 - y + width - 11) + width * (5 - x)] = 1;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
setmask(5 - x, 2 - y + width - 11);
|
||||||
|
setmask(2 - y + width - 11, 5 - x);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// sync mask bits - only set above for white spaces, so add in black bits
|
||||||
|
for (y = 0; y < width; y++)
|
||||||
|
for (x = 0; x <= y; x++)
|
||||||
|
if (qrframe[x + width * y])
|
||||||
|
setmask(x, y);
|
||||||
|
|
||||||
|
// convert string to bitstream
|
||||||
|
// 8 bit data to QR-coded 8 bit data (numeric or alphanum, or kanji not supported)
|
||||||
|
v = strinbuf.length;
|
||||||
|
|
||||||
|
// string to array
|
||||||
|
for (i = 0; i < v; i++)
|
||||||
|
eccbuf[i] = strinbuf.charCodeAt(i);
|
||||||
|
strinbuf = eccbuf.slice(0);
|
||||||
|
|
||||||
|
// calculate max string length
|
||||||
|
x = datablkw * (neccblk1 + neccblk2) + neccblk2;
|
||||||
|
if (v >= x - 2) {
|
||||||
|
v = x - 2;
|
||||||
|
if (version > 9)
|
||||||
|
v--;
|
||||||
|
}
|
||||||
|
|
||||||
|
// shift and repack to insert length prefix
|
||||||
|
i = v;
|
||||||
|
if (version > 9) {
|
||||||
|
strinbuf[i + 2] = 0;
|
||||||
|
strinbuf[i + 3] = 0;
|
||||||
|
while (i--) {
|
||||||
|
t = strinbuf[i];
|
||||||
|
strinbuf[i + 3] |= 255 & (t << 4);
|
||||||
|
strinbuf[i + 2] = t >> 4;
|
||||||
|
}
|
||||||
|
strinbuf[2] |= 255 & (v << 4);
|
||||||
|
strinbuf[1] = v >> 4;
|
||||||
|
strinbuf[0] = 0x40 | (v >> 12);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
strinbuf[i + 1] = 0;
|
||||||
|
strinbuf[i + 2] = 0;
|
||||||
|
while (i--) {
|
||||||
|
t = strinbuf[i];
|
||||||
|
strinbuf[i + 2] |= 255 & (t << 4);
|
||||||
|
strinbuf[i + 1] = t >> 4;
|
||||||
|
}
|
||||||
|
strinbuf[1] |= 255 & (v << 4);
|
||||||
|
strinbuf[0] = 0x40 | (v >> 4);
|
||||||
|
}
|
||||||
|
// fill to end with pad pattern
|
||||||
|
i = v + 3 - (version < 10);
|
||||||
|
while (i < x) {
|
||||||
|
strinbuf[i++] = 0xec;
|
||||||
|
// buffer has room if (i == x) break;
|
||||||
|
strinbuf[i++] = 0x11;
|
||||||
|
}
|
||||||
|
|
||||||
|
// calculate and append ECC
|
||||||
|
|
||||||
|
// calculate generator polynomial
|
||||||
|
genpoly[0] = 1;
|
||||||
|
for (i = 0; i < eccblkwid; i++) {
|
||||||
|
genpoly[i + 1] = 1;
|
||||||
|
for (j = i; j > 0; j--)
|
||||||
|
genpoly[j] = genpoly[j]
|
||||||
|
? genpoly[j - 1] ^ gexp[modnn(glog[genpoly[j]] + i)] : genpoly[j - 1];
|
||||||
|
genpoly[0] = gexp[modnn(glog[genpoly[0]] + i)];
|
||||||
|
}
|
||||||
|
for (i = 0; i <= eccblkwid; i++)
|
||||||
|
genpoly[i] = glog[genpoly[i]]; // use logs for genpoly[] to save calc step
|
||||||
|
|
||||||
|
// append ecc to data buffer
|
||||||
|
k = x;
|
||||||
|
y = 0;
|
||||||
|
for (i = 0; i < neccblk1; i++) {
|
||||||
|
appendrs(y, datablkw, k, eccblkwid);
|
||||||
|
y += datablkw;
|
||||||
|
k += eccblkwid;
|
||||||
|
}
|
||||||
|
for (i = 0; i < neccblk2; i++) {
|
||||||
|
appendrs(y, datablkw + 1, k, eccblkwid);
|
||||||
|
y += datablkw + 1;
|
||||||
|
k += eccblkwid;
|
||||||
|
}
|
||||||
|
// interleave blocks
|
||||||
|
y = 0;
|
||||||
|
for (i = 0; i < datablkw; i++) {
|
||||||
|
for (j = 0; j < neccblk1; j++)
|
||||||
|
eccbuf[y++] = strinbuf[i + j * datablkw];
|
||||||
|
for (j = 0; j < neccblk2; j++)
|
||||||
|
eccbuf[y++] = strinbuf[(neccblk1 * datablkw) + i + (j * (datablkw + 1))];
|
||||||
|
}
|
||||||
|
for (j = 0; j < neccblk2; j++)
|
||||||
|
eccbuf[y++] = strinbuf[(neccblk1 * datablkw) + i + (j * (datablkw + 1))];
|
||||||
|
for (i = 0; i < eccblkwid; i++)
|
||||||
|
for (j = 0; j < neccblk1 + neccblk2; j++)
|
||||||
|
eccbuf[y++] = strinbuf[x + i + j * eccblkwid];
|
||||||
|
strinbuf = eccbuf;
|
||||||
|
|
||||||
|
// pack bits into frame avoiding masked area.
|
||||||
|
x = y = width - 1;
|
||||||
|
k = v = 1; // up, minus
|
||||||
|
/* inteleaved data and ecc codes */
|
||||||
|
m = (datablkw + eccblkwid) * (neccblk1 + neccblk2) + neccblk2;
|
||||||
|
for (i = 0; i < m; i++) {
|
||||||
|
t = strinbuf[i];
|
||||||
|
for (j = 0; j < 8; j++ , t <<= 1) {
|
||||||
|
if (0x80 & t)
|
||||||
|
qrframe[x + width * y] = 1;
|
||||||
|
do { // find next fill position
|
||||||
|
if (v)
|
||||||
|
x--;
|
||||||
|
else {
|
||||||
|
x++;
|
||||||
|
if (k) {
|
||||||
|
if (y != 0)
|
||||||
|
y--;
|
||||||
|
else {
|
||||||
|
x -= 2;
|
||||||
|
k = !k;
|
||||||
|
if (x == 6) {
|
||||||
|
x--;
|
||||||
|
y = 9;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
if (y != width - 1)
|
||||||
|
y++;
|
||||||
|
else {
|
||||||
|
x -= 2;
|
||||||
|
k = !k;
|
||||||
|
if (x == 6) {
|
||||||
|
x--;
|
||||||
|
y -= 8;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
v = !v;
|
||||||
|
} while (ismasked(x, y));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// save pre-mask copy of frame
|
||||||
|
strinbuf = qrframe.slice(0);
|
||||||
|
t = 0; // best
|
||||||
|
y = 30000; // demerit
|
||||||
|
// for instead of while since in original arduino code
|
||||||
|
// if an early mask was "good enough" it wouldn't try for a better one
|
||||||
|
// since they get more complex and take longer.
|
||||||
|
for (k = 0; k < 8; k++) {
|
||||||
|
applymask(k); // returns black-white imbalance
|
||||||
|
x = badcheck();
|
||||||
|
if (x < y) { // current mask better than previous best?
|
||||||
|
y = x;
|
||||||
|
t = k;
|
||||||
|
}
|
||||||
|
if (t == 7)
|
||||||
|
break; // don't increment i to a void redoing mask
|
||||||
|
qrframe = strinbuf.slice(0); // reset for next pass
|
||||||
|
}
|
||||||
|
if (t != k) // redo best mask - none good enough, last wasn't t
|
||||||
|
applymask(t);
|
||||||
|
|
||||||
|
// add in final mask/ecclevel bytes
|
||||||
|
y = fmtword[t + ((ecclevel - 1) << 3)];
|
||||||
|
// low byte
|
||||||
|
for (k = 0; k < 8; k++ , y >>= 1)
|
||||||
|
if (y & 1) {
|
||||||
|
qrframe[(width - 1 - k) + width * 8] = 1;
|
||||||
|
if (k < 6)
|
||||||
|
qrframe[8 + width * k] = 1;
|
||||||
|
else
|
||||||
|
qrframe[8 + width * (k + 1)] = 1;
|
||||||
|
}
|
||||||
|
// high byte
|
||||||
|
for (k = 0; k < 7; k++ , y >>= 1)
|
||||||
|
if (y & 1) {
|
||||||
|
qrframe[8 + width * (width - 7 + k)] = 1;
|
||||||
|
if (k)
|
||||||
|
qrframe[(6 - k) + width * 8] = 1;
|
||||||
|
else
|
||||||
|
qrframe[7 + width * 8] = 1;
|
||||||
|
}
|
||||||
|
return qrframe;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
var _canvas = null;
|
||||||
|
|
||||||
|
export const api = {
|
||||||
|
|
||||||
|
get ecclevel() {
|
||||||
|
return ecclevel;
|
||||||
|
},
|
||||||
|
|
||||||
|
set ecclevel(val) {
|
||||||
|
ecclevel = val;
|
||||||
|
},
|
||||||
|
|
||||||
|
get size() {
|
||||||
|
return _size;
|
||||||
|
},
|
||||||
|
|
||||||
|
set size(val) {
|
||||||
|
_size = val
|
||||||
|
},
|
||||||
|
|
||||||
|
get canvas() {
|
||||||
|
return _canvas;
|
||||||
|
},
|
||||||
|
|
||||||
|
set canvas(el) {
|
||||||
|
_canvas = el;
|
||||||
|
},
|
||||||
|
|
||||||
|
getFrame: function (string) {
|
||||||
|
return genframe(string);
|
||||||
|
},
|
||||||
|
//这里的utf16to8(str)是对Text中的字符串进行转码,让其支持中文
|
||||||
|
utf16to8: function (str) {
|
||||||
|
var out, i, len, c;
|
||||||
|
|
||||||
|
out = "";
|
||||||
|
len = str.length;
|
||||||
|
for (i = 0; i < len; i++) {
|
||||||
|
c = str.charCodeAt(i);
|
||||||
|
if ((c >= 0x0001) && (c <= 0x007F)) {
|
||||||
|
out += str.charAt(i);
|
||||||
|
} else if (c > 0x07FF) {
|
||||||
|
out += String.fromCharCode(0xE0 | ((c >> 12) & 0x0F));
|
||||||
|
out += String.fromCharCode(0x80 | ((c >> 6) & 0x3F));
|
||||||
|
out += String.fromCharCode(0x80 | ((c >> 0) & 0x3F));
|
||||||
|
} else {
|
||||||
|
out += String.fromCharCode(0xC0 | ((c >> 6) & 0x1F));
|
||||||
|
out += String.fromCharCode(0x80 | ((c >> 0) & 0x3F));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return out;
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 新增$this参数,传入组件的this,兼容在组件中生成
|
||||||
|
* @param bg 目前只能设置颜色值
|
||||||
|
*/
|
||||||
|
draw: function (str, ctx, startX, startY, cavW, cavH, bg, color, $this, ecc) {
|
||||||
|
var that = this;
|
||||||
|
ecclevel = ecc || ecclevel;
|
||||||
|
if (!ctx) {
|
||||||
|
console.warn('No canvas provided to draw QR code in!')
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
var size = Math.min(cavW, cavH);
|
||||||
|
str = that.utf16to8(str);//增加中文显示
|
||||||
|
|
||||||
|
var frame = that.getFrame(str);
|
||||||
|
var px = size / width;
|
||||||
|
if (bg) {
|
||||||
|
ctx.fillStyle = bg
|
||||||
|
ctx.fillRect(startX, startY, cavW, cavW);
|
||||||
|
}
|
||||||
|
ctx.fillStyle = color || 'black'
|
||||||
|
for (var i = 0; i < width; i++) {
|
||||||
|
for (var j = 0; j < width; j++) {
|
||||||
|
if (frame[j * width + i]) {
|
||||||
|
ctx.fillRect(startX + px * i, startY + px * j, px, px);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
60
components/vue-canvas-poster/util.js
Normal file
@@ -0,0 +1,60 @@
|
|||||||
|
const isValidUrl = url => {
|
||||||
|
return /(ht|f)tp(s?):\/\/([^ \\/]*\.)+[^ \\/]*(:[0-9]+)?\/?/.test(url)
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 深度对比两个对象是否一致
|
||||||
|
* from: https://github.com/epoberezkin/fast-deep-equal
|
||||||
|
* @param {Object} a 对象a
|
||||||
|
* @param {Object} b 对象b
|
||||||
|
* @return {Boolean} 是否相同
|
||||||
|
*/
|
||||||
|
/* eslint-disable */
|
||||||
|
const equal = (a, b) => {
|
||||||
|
if (a === b) return true
|
||||||
|
|
||||||
|
if (a && b && typeof a == 'object' && typeof b == 'object') {
|
||||||
|
var arrA = Array.isArray(a),
|
||||||
|
arrB = Array.isArray(b),
|
||||||
|
i,
|
||||||
|
length,
|
||||||
|
key
|
||||||
|
|
||||||
|
if (arrA && arrB) {
|
||||||
|
length = a.length
|
||||||
|
if (length != b.length) return false
|
||||||
|
for (i = length; i-- !== 0; ) if (!equal(a[i], b[i])) return false
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
if (arrA != arrB) return false
|
||||||
|
|
||||||
|
var dateA = a instanceof Date,
|
||||||
|
dateB = b instanceof Date
|
||||||
|
if (dateA != dateB) return false
|
||||||
|
if (dateA && dateB) return a.getTime() == b.getTime()
|
||||||
|
|
||||||
|
var regexpA = a instanceof RegExp,
|
||||||
|
regexpB = b instanceof RegExp
|
||||||
|
if (regexpA != regexpB) return false
|
||||||
|
if (regexpA && regexpB) return a.toString() == b.toString()
|
||||||
|
|
||||||
|
var keys = Object.keys(a)
|
||||||
|
length = keys.length
|
||||||
|
|
||||||
|
if (length !== Object.keys(b).length) return false
|
||||||
|
|
||||||
|
for (i = length; i-- !== 0; ) if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false
|
||||||
|
|
||||||
|
for (i = length; i-- !== 0; ) {
|
||||||
|
key = keys[i]
|
||||||
|
if (!equal(a[key], b[key])) return false
|
||||||
|
}
|
||||||
|
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
return a !== a && b !== b
|
||||||
|
}
|
||||||
|
|
||||||
|
export { isValidUrl, equal }
|
||||||
18
js_sdk/junyi-h5-copy/junyi-h5-copy/junyi-h5-copy.js
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
export default function h5Copy(content) {
|
||||||
|
|
||||||
|
if (!document.queryCommandSupported('copy')) {
|
||||||
|
// 不支持
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
let textarea = document.createElement("textarea")
|
||||||
|
textarea.value = content
|
||||||
|
textarea.readOnly = "readOnly"
|
||||||
|
document.body.appendChild(textarea)
|
||||||
|
textarea.select() // 选择对象
|
||||||
|
textarea.setSelectionRange(0, content.length) //核心
|
||||||
|
let result = document.execCommand("copy") // 执行浏览器复制命令
|
||||||
|
textarea.remove()
|
||||||
|
return result
|
||||||
|
|
||||||
|
}
|
||||||
2
main.js
@@ -14,6 +14,8 @@ Vue.use(uView);
|
|||||||
|
|
||||||
const app = new Vue({
|
const app = new Vue({
|
||||||
...App
|
...App
|
||||||
|
|
||||||
|
|
||||||
})
|
})
|
||||||
Vue.component('no-list',noList)
|
Vue.component('no-list',noList)
|
||||||
//v1.3.5起 H5端 你应该去除原有的app.$mount();使用路由自带的渲染方式
|
//v1.3.5起 H5端 你应该去除原有的app.$mount();使用路由自带的渲染方式
|
||||||
|
|||||||
@@ -137,5 +137,10 @@
|
|||||||
},
|
},
|
||||||
"uniStatistics" : {
|
"uniStatistics" : {
|
||||||
"enable" : false
|
"enable" : false
|
||||||
|
},
|
||||||
|
"h5" : {
|
||||||
|
"router" : {
|
||||||
|
"mode" : "hash"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
138
pages.json
@@ -54,6 +54,23 @@
|
|||||||
"navigationBarTextStyle": "white",
|
"navigationBarTextStyle": "white",
|
||||||
"navigationBarBackgroundColor": "#e93340"
|
"navigationBarBackgroundColor": "#e93340"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "pages/property/coupon/confirmOrder",
|
||||||
|
"name": "ConfirmOrder",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "订单确认页面",
|
||||||
|
"navigationBarTextStyle": "white",
|
||||||
|
"navigationBarBackgroundColor": "#e93340"
|
||||||
|
}
|
||||||
|
},{
|
||||||
|
"path": "pages/property/coupon/payStatus",
|
||||||
|
"name": "PayStatus",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "支付状态",
|
||||||
|
"navigationBarTextStyle": "white",
|
||||||
|
"navigationBarBackgroundColor": "#e93340"
|
||||||
|
}
|
||||||
}, {
|
}, {
|
||||||
"path": "pages/property/order/numberWeight",
|
"path": "pages/property/order/numberWeight",
|
||||||
"name": "NumberWeight",
|
"name": "NumberWeight",
|
||||||
@@ -173,7 +190,7 @@
|
|||||||
"enablePullDownRefresh": true,
|
"enablePullDownRefresh": true,
|
||||||
"navigationBarTextStyle": "white",
|
"navigationBarTextStyle": "white",
|
||||||
"navigationBarBackgroundColor": "#e93340",
|
"navigationBarBackgroundColor": "#e93340",
|
||||||
"navigationBarTitleText": "已使用订单"
|
"navigationBarTitleText": "已使用服务类订单"
|
||||||
}
|
}
|
||||||
},{
|
},{
|
||||||
"path": "pages/property/order/servicesOrderInfo",
|
"path": "pages/property/order/servicesOrderInfo",
|
||||||
@@ -264,7 +281,7 @@
|
|||||||
"name": "Vip",
|
"name": "Vip",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "会员",
|
"navigationBarTitleText": "会员",
|
||||||
"navigationBarBackgroundColor": "#1f1b1c",
|
"navigationBarBackgroundColor": "#e93340",
|
||||||
"navigationBarTextStyle": "white",
|
"navigationBarTextStyle": "white",
|
||||||
"backgroundColor": "#fefaef"
|
"backgroundColor": "#fefaef"
|
||||||
}
|
}
|
||||||
@@ -273,7 +290,7 @@
|
|||||||
"name": "vipAgree",
|
"name": "vipAgree",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "用户协议",
|
"navigationBarTitleText": "用户协议",
|
||||||
"navigationBarBackgroundColor": "#1f1b1c",
|
"navigationBarBackgroundColor": "#e93340",
|
||||||
"navigationBarTextStyle": "white",
|
"navigationBarTextStyle": "white",
|
||||||
"backgroundColor": "#fefaef"
|
"backgroundColor": "#fefaef"
|
||||||
}
|
}
|
||||||
@@ -391,7 +408,7 @@
|
|||||||
"path": "pages/store/deliver",
|
"path": "pages/store/deliver",
|
||||||
"name": "Deliver",
|
"name": "Deliver",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "提货单处理",
|
"navigationBarTitleText": "发货单处理",
|
||||||
"navigationBarBackgroundColor": "#FFFFFF"
|
"navigationBarBackgroundColor": "#FFFFFF"
|
||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
@@ -464,6 +481,13 @@
|
|||||||
"navigationBarTitleText": "选择权证分类",
|
"navigationBarTitleText": "选择权证分类",
|
||||||
"navigationBarBackgroundColor": "#FFFFFF"
|
"navigationBarBackgroundColor": "#FFFFFF"
|
||||||
}
|
}
|
||||||
|
}, {
|
||||||
|
"path": "pages/goods/goodsClassify",
|
||||||
|
"name": "goodsClassify",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "商品分类",
|
||||||
|
"navigationBarBackgroundColor": "#FFFFFF"
|
||||||
|
}
|
||||||
}, {
|
}, {
|
||||||
"path": "pages/goods/add",
|
"path": "pages/goods/add",
|
||||||
"name": "GoodsMagAdd",
|
"name": "GoodsMagAdd",
|
||||||
@@ -471,6 +495,27 @@
|
|||||||
"navigationBarTitleText": "发布权证",
|
"navigationBarTitleText": "发布权证",
|
||||||
"navigationBarBackgroundColor": "#FFFFFF"
|
"navigationBarBackgroundColor": "#FFFFFF"
|
||||||
}
|
}
|
||||||
|
}, {
|
||||||
|
"path": "pages/goods/chain",
|
||||||
|
"name": "GoodsChain",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "区块链证书",
|
||||||
|
"navigationBarBackgroundColor": "#FFFFFF"
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
"path": "pages/goods/attestation",
|
||||||
|
"name": "GoodsAttestation",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "商品认证",
|
||||||
|
"navigationBarBackgroundColor": "#FFFFFF"
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
"path": "pages/goods/tracedTo",
|
||||||
|
"name": "GoodstracedTo",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "商品溯源",
|
||||||
|
"navigationBarBackgroundColor": "#FFFFFF"
|
||||||
|
}
|
||||||
}, {
|
}, {
|
||||||
"path": "pages/coupons/index",
|
"path": "pages/coupons/index",
|
||||||
"name": "Coupons",
|
"name": "Coupons",
|
||||||
@@ -479,12 +524,12 @@
|
|||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
"path": "pages/coupons/couponList",
|
"path": "pages/coupons/couponList",
|
||||||
"name": "Coupons",
|
"name": "CouponsList",
|
||||||
"style": {
|
"style": {
|
||||||
"enablePullDownRefresh": true,
|
"enablePullDownRefresh": true,
|
||||||
"navigationBarTextStyle": "white",
|
"navigationBarTextStyle": "white",
|
||||||
"navigationStyle": "custom",
|
"navigationBarTitleText": "优惠券列表",
|
||||||
"backgroundColor": "#e93340"
|
"navigationBarBackgroundColor": "#e93340"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -612,6 +657,83 @@
|
|||||||
}]
|
}]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "pages/wallet/property",
|
||||||
|
"name": "walletProperty",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "能量钱包",
|
||||||
|
"enablePullDownRefresh": false,
|
||||||
|
"navigationBarTextStyle": "white",
|
||||||
|
"navigationBarBackgroundColor":"#e93340"
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
"path": "pages/wallet/redProperty",
|
||||||
|
"name": "walletRedProperty",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "现金红包",
|
||||||
|
"enablePullDownRefresh": false,
|
||||||
|
"navigationBarTextStyle": "white",
|
||||||
|
"navigationBarBackgroundColor":"#e93340"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "pages/wallet/extract",
|
||||||
|
"name": "Extract",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "原石转零钱",
|
||||||
|
"enablePullDownRefresh": false,
|
||||||
|
"navigationBarBackgroundColor": "#e93340",
|
||||||
|
"navigationBarTextStyle": "white"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "pages/wallet/extractRed",
|
||||||
|
"name": "ExtractRed",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "我的零钱",
|
||||||
|
"enablePullDownRefresh": false,
|
||||||
|
"navigationBarBackgroundColor": "#e93340",
|
||||||
|
"navigationBarTextStyle": "white"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "pages/wallet/fragment",
|
||||||
|
"name": "Fragment",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "贡献值记录",
|
||||||
|
"enablePullDownRefresh": false,
|
||||||
|
"navigationBarBackgroundColor": "#e93340",
|
||||||
|
"navigationBarTextStyle": "white"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "pages/wallet/addBank",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "添加银行卡",
|
||||||
|
"enablePullDownRefresh": false,
|
||||||
|
"navigationBarBackgroundColor": "#e93340",
|
||||||
|
"navigationBarTextStyle": "white"
|
||||||
|
},
|
||||||
|
"name": "addBank"
|
||||||
|
}, {
|
||||||
|
"path": "pages/wallet/bankList",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "银行卡列表",
|
||||||
|
"enablePullDownRefresh": false,
|
||||||
|
"navigationBarBackgroundColor": "#e93340",
|
||||||
|
"navigationBarTextStyle": "white"
|
||||||
|
},
|
||||||
|
"name": "bankList"
|
||||||
|
}, {
|
||||||
|
"path": "pages/wallet/withdrawList",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "零钱提现记录",
|
||||||
|
"enablePullDownRefresh": false,
|
||||||
|
"navigationBarBackgroundColor": "#e93340",
|
||||||
|
"navigationBarTextStyle": "white"
|
||||||
|
},
|
||||||
|
"name": "withdrawList"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"tabBar": {
|
"tabBar": {
|
||||||
@@ -643,7 +765,7 @@
|
|||||||
},
|
},
|
||||||
"globalStyle": {
|
"globalStyle": {
|
||||||
"navigationBarTextStyle": "black",
|
"navigationBarTextStyle": "black",
|
||||||
"navigationBarTitleText": "易货",
|
"navigationBarTitleText": "易货-易你所想",
|
||||||
"navigationBarBackgroundColor": "#f5f5f5",
|
"navigationBarBackgroundColor": "#f5f5f5",
|
||||||
"backgroundColor": "#f5f5f5"
|
"backgroundColor": "#f5f5f5"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -32,6 +32,10 @@
|
|||||||
<uni-icons class="picker-icon" type="arrowdown"></uni-icons>
|
<uni-icons class="picker-icon" type="arrowdown"></uni-icons>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
<view class="inputs" v-if="is_range">
|
||||||
|
<label>经营范围</label>
|
||||||
|
<textarea :auto-height='true' v-model="range" placeholder="输入经营范围" />
|
||||||
|
</view>
|
||||||
<view class="inputs">
|
<view class="inputs">
|
||||||
<label>法人姓名</label>
|
<label>法人姓名</label>
|
||||||
<input type="text" v-model="corporate" placeholder="输入法人姓名" />
|
<input type="text" v-model="corporate" placeholder="输入法人姓名" />
|
||||||
@@ -93,7 +97,9 @@
|
|||||||
industryIndex: 0,
|
industryIndex: 0,
|
||||||
reason : '',
|
reason : '',
|
||||||
category : [],
|
category : [],
|
||||||
categorys : []
|
categorys : [],
|
||||||
|
range : "",
|
||||||
|
is_range :false,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
created(){
|
created(){
|
||||||
@@ -103,6 +109,7 @@
|
|||||||
this.industry = res.industries
|
this.industry = res.industries
|
||||||
this.formType = this.$Route.query.formType
|
this.formType = this.$Route.query.formType
|
||||||
this.name = res.info.name
|
this.name = res.info.name
|
||||||
|
this.is_range = res.is_range
|
||||||
this.industryIndex = res.industries.findIndex(val => val.industry_id === res.info.industry.industry_id) || 0
|
this.industryIndex = res.industries.findIndex(val => val.industry_id === res.info.industry.industry_id) || 0
|
||||||
if(this.formType === 'put'){
|
if(this.formType === 'put'){
|
||||||
appliesInfo().then(formValue => {
|
appliesInfo().then(formValue => {
|
||||||
@@ -159,7 +166,8 @@
|
|||||||
id_card : this.identity,
|
id_card : this.identity,
|
||||||
code : this.org,
|
code : this.org,
|
||||||
industry_id : this.industry[this.industryIndex].industry_id,
|
industry_id : this.industry[this.industryIndex].industry_id,
|
||||||
categories : this.categorys
|
categories : this.categorys,
|
||||||
|
range : this.range
|
||||||
}, method).then(res => {
|
}, method).then(res => {
|
||||||
uni.showModal({
|
uni.showModal({
|
||||||
title : '提示',
|
title : '提示',
|
||||||
@@ -167,7 +175,7 @@
|
|||||||
showCancel : false,
|
showCancel : false,
|
||||||
confirmText : '确认',
|
confirmText : '确认',
|
||||||
success : resModal => {
|
success : resModal => {
|
||||||
this.$Router.back()
|
this.$Router.pushTab({name: "Store"})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
@@ -252,6 +260,8 @@
|
|||||||
padding-left: 200rpx;
|
padding-left: 200rpx;
|
||||||
line-height: 90rpx;
|
line-height: 90rpx;
|
||||||
min-height: 90rpx;
|
min-height: 90rpx;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
label{
|
label{
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 0;
|
top: 0;
|
||||||
@@ -259,12 +269,15 @@
|
|||||||
width: 200rpx;
|
width: 200rpx;
|
||||||
font-size: $title-size;
|
font-size: $title-size;
|
||||||
}
|
}
|
||||||
input{
|
input,textarea,picker{
|
||||||
|
flex: 1;
|
||||||
height: 90rpx;
|
height: 90rpx;
|
||||||
line-height: 90rpx;
|
line-height: 90rpx;
|
||||||
font-size: $title-size;
|
font-size: $title-size;
|
||||||
}
|
}
|
||||||
.picker-text{
|
.picker-text{
|
||||||
|
flex: 1;
|
||||||
|
font-size: $title-size;
|
||||||
position: relative;
|
position: relative;
|
||||||
padding-right: 90rpx;
|
padding-right: 90rpx;
|
||||||
.picker-icon{
|
.picker-icon{
|
||||||
|
|||||||
@@ -79,7 +79,21 @@
|
|||||||
<label class="input-label">{{timeIndex == 0 ? '券有效期': '延期天数'}}</label>
|
<label class="input-label">{{timeIndex == 0 ? '券有效期': '延期天数'}}</label>
|
||||||
<block v-if="timeIndex === 0">
|
<block v-if="timeIndex === 0">
|
||||||
<view class="input-text" @click="showDatePicker = true">{{datePickerValue.length == 0 ? '选择优惠券有效期区间': datePickerValue[0] + ' 至 ' + datePickerValue[1]}}<uni-icons class="picker-icon" type="arrowdown" size="14" /></view>
|
<view class="input-text" @click="showDatePicker = true">{{datePickerValue.length == 0 ? '选择优惠券有效期区间': datePickerValue[0] + ' 至 ' + datePickerValue[1]}}<uni-icons class="picker-icon" type="arrowdown" size="14" /></view>
|
||||||
<tn-date-picker :show="showDatePicker" :monthNum="12" color="#e93340" :showTips="true" beginText="开始日期" endText="结束日期" @confirm="confirmDatePicker" @cancel="showDatePicker = false"/>
|
<u-calendar
|
||||||
|
:safe-area-inset-bottom="true"
|
||||||
|
v-model="showDatePicker"
|
||||||
|
mode="range"
|
||||||
|
active-bg-color="#e93340"
|
||||||
|
range-bg-color="rgba(0, 0, 0, .05)"
|
||||||
|
range-color="#e93340"
|
||||||
|
btn-type="default"
|
||||||
|
max-date="2099-12-12"
|
||||||
|
:min-date="minDate"
|
||||||
|
@change="confirmDatePicker"
|
||||||
|
>
|
||||||
|
</u-calendar>
|
||||||
|
</u-calendar>
|
||||||
|
<!-- <tn-date-picker :show="showDatePicker" :monthNum="12" color="#e93340" :showTips="true" beginText="开始日期" endText="结束日期" @confirm="confirmDatePicker" @cancel="showDatePicker = false"/> -->
|
||||||
</block>
|
</block>
|
||||||
<block v-if="timeIndex === 1">
|
<block v-if="timeIndex === 1">
|
||||||
<view class="input-number">
|
<view class="input-number">
|
||||||
@@ -107,6 +121,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import date from '@/public/date'
|
||||||
import TnDatePicker from "@/components/tn-datepicker/tn-datepicker";
|
import TnDatePicker from "@/components/tn-datepicker/tn-datepicker";
|
||||||
import { uploads } from '@/apis/interfaces/uploading'
|
import { uploads } from '@/apis/interfaces/uploading'
|
||||||
import { pushCoupons } from '@/apis/interfaces/coupons'
|
import { pushCoupons } from '@/apis/interfaces/coupons'
|
||||||
@@ -124,8 +139,8 @@
|
|||||||
],
|
],
|
||||||
timeIndex : 0,
|
timeIndex : 0,
|
||||||
times : [
|
times : [
|
||||||
{ type: 2, text: '固定时间(区间范围)' },
|
{ type: 1, text: '固定时间(区间范围)' },
|
||||||
{ type: 1, text: '延期券(用户领取后有效天数)' }
|
{ type: 2, text: '延期券(用户领取后有效天数)' }
|
||||||
],
|
],
|
||||||
showDatePicker : false, // 活动弹出层时间
|
showDatePicker : false, // 活动弹出层时间
|
||||||
datePickerValue : [], // 活动时间
|
datePickerValue : [], // 活动时间
|
||||||
@@ -138,12 +153,19 @@
|
|||||||
price : '', // 减少金额
|
price : '', // 减少金额
|
||||||
description : '', // 使用规则
|
description : '', // 使用规则
|
||||||
coupongoods : [], // 关联商品
|
coupongoods : [], // 关联商品
|
||||||
timeNumber : 1 // 延期券时间
|
timeNumber : 1 , // 延期券时间
|
||||||
|
minDate : '' // 优惠券最小期限
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
onShow(){
|
onShow(){
|
||||||
|
new date().then(res => {
|
||||||
|
this.minDate = res
|
||||||
|
})
|
||||||
this.coupongoods = this.$store.getters.getCoupongoods
|
this.coupongoods = this.$store.getters.getCoupongoods
|
||||||
},
|
},
|
||||||
|
onUnload() {
|
||||||
|
this.$store.commit('setCoupongoods', [])
|
||||||
|
},
|
||||||
methods:{
|
methods:{
|
||||||
// 发券数量
|
// 发券数量
|
||||||
quantityChange(value){
|
quantityChange(value){
|
||||||
@@ -163,11 +185,15 @@
|
|||||||
},
|
},
|
||||||
// 选择
|
// 选择
|
||||||
changePicker(e){
|
changePicker(e){
|
||||||
|
if(e.target.dataset.type === 'typeIndex'){
|
||||||
|
this.$store.commit('setCoupongoods', [])
|
||||||
|
this.coupongoods = this.$store.getters.getCoupongoods
|
||||||
|
}
|
||||||
this[e.target.dataset.type] = e.detail.value
|
this[e.target.dataset.type] = e.detail.value
|
||||||
},
|
},
|
||||||
// 日期
|
// 日期
|
||||||
confirmDatePicker(e){
|
confirmDatePicker(e){
|
||||||
this.datePickerValue = e.value
|
this.datePickerValue = [e.startDate , e.endDate]
|
||||||
this.showDatePicker = false
|
this.showDatePicker = false
|
||||||
},
|
},
|
||||||
// 上传优惠券封面
|
// 上传优惠券封面
|
||||||
@@ -206,11 +232,17 @@
|
|||||||
start_at : this.datePickerValue[0],
|
start_at : this.datePickerValue[0],
|
||||||
end_at : this.datePickerValue[1],
|
end_at : this.datePickerValue[1],
|
||||||
description : this.description,
|
description : this.description,
|
||||||
time_type : this.times[this.typeIndex].type,
|
time_type : this.times[this.timeIndex].type,
|
||||||
days : this.timeNumber,
|
days : this.timeNumber,
|
||||||
goodsable_ids : this.coupongoods
|
goodsable_ids : this.coupongoods
|
||||||
}
|
}
|
||||||
|
if(valuss.description === ''){
|
||||||
|
uni.showToast({
|
||||||
|
title:'请添加使用规则',
|
||||||
|
icon:'none'
|
||||||
|
})
|
||||||
|
return;
|
||||||
|
}
|
||||||
pushCoupons(valuss).then(res => {
|
pushCoupons(valuss).then(res => {
|
||||||
uni.showModal({
|
uni.showModal({
|
||||||
title : '提示',
|
title : '提示',
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<view style="position: relative;z-index: 3;">
|
<view style="position: relative;z-index: 3;">
|
||||||
<!-- 搜索... -->
|
<!-- 搜索... -->
|
||||||
<view class="mine-top-contant">
|
<view class="mine-top-contant">
|
||||||
<u-navbar :is-back="true" :background="background" title="企业优惠券中心" title-color="#fff" :border-bottom='false'></u-navbar>
|
<!-- <u-navbar :is-back="true" :background="background" title="企业优惠券中心" title-color="#fff" :border-bottom='false'></u-navbar> -->
|
||||||
<!--banner-->
|
<!--banner-->
|
||||||
<swiper class="swiper" :indicator-dots="true" :autoplay="false" indicator-active-color='#fff'
|
<swiper class="swiper" :indicator-dots="true" :autoplay="false" indicator-active-color='#fff'
|
||||||
indicator-color='rgba(0,0,0,.1)'>
|
indicator-color='rgba(0,0,0,.1)'>
|
||||||
@@ -140,8 +140,7 @@
|
|||||||
</view>
|
</view>
|
||||||
</u-circle-progress>
|
</u-circle-progress>
|
||||||
<view class="now-get" v-if='item.can.get'
|
<view class="now-get" v-if='item.can.get'
|
||||||
@click="toReceiveCoupon('services',index,item.coupon_id)">
|
@click="toReceiveCoupon('services',index,item.coupon_id)">立即领取</view>
|
||||||
立即领取</view>
|
|
||||||
<view class="now-get now-got" v-if="!item.can.get && item.can.is_get"
|
<view class="now-get now-got" v-if="!item.can.get && item.can.is_get"
|
||||||
@click="toUse(item.coupon_id)">去使用</view>
|
@click="toUse(item.coupon_id)">去使用</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -261,7 +260,6 @@
|
|||||||
// 获取首页列表
|
// 获取首页列表
|
||||||
getCoupons() {
|
getCoupons() {
|
||||||
couponsByCompanyId({}).then(res => {
|
couponsByCompanyId({}).then(res => {
|
||||||
console.log(res)
|
|
||||||
this.activities = res.activities // 顶部活动
|
this.activities = res.activities // 顶部活动
|
||||||
this.notices = res.notices // 通知消息
|
this.notices = res.notices // 通知消息
|
||||||
let notices = res.notices
|
let notices = res.notices
|
||||||
|
|||||||
@@ -188,7 +188,7 @@
|
|||||||
.cover{
|
.cover{
|
||||||
position: relative;
|
position: relative;
|
||||||
border-right: dashed 3rpx $border-color;
|
border-right: dashed 3rpx $border-color;
|
||||||
width: 148rpx;
|
width: 208rpx;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
.cover-img{
|
.cover-img{
|
||||||
width: 148rpx;
|
width: 148rpx;
|
||||||
@@ -234,7 +234,7 @@
|
|||||||
}
|
}
|
||||||
.mian{
|
.mian{
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
width: calc(100% - 148rpx - #{$padding*2});
|
width: calc(100% - 208rpx);
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
@extend .vertical;
|
@extend .vertical;
|
||||||
.title{
|
.title{
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<view>
|
<view>
|
||||||
<!-- 商品列表 -->
|
<!-- 商品列表 -->
|
||||||
<view class="lists">
|
<view class="lists" v-if="goods.length>0">
|
||||||
<view class="goods-item" v-for="(item, index) in goods" :key="index">
|
<view class="goods-item" v-for="(item, index) in goods" :key="index">
|
||||||
<checkbox class="checkbox" :checked="item.isSelect" @click="onSelect(index)"/>
|
<checkbox class="checkbox" :checked="item.isSelect" @click="onSelect(index)"/>
|
||||||
<view class="mian">
|
<view class="mian">
|
||||||
@@ -16,6 +16,7 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="ios-bottom"></view>
|
<view class="ios-bottom"></view>
|
||||||
</view>
|
</view>
|
||||||
|
<no-list v-if="goods.length === 0" name='no-goods' txt="没有可勾选商品列表~" />
|
||||||
<!-- footer -->
|
<!-- footer -->
|
||||||
<view class="footer">
|
<view class="footer">
|
||||||
<view class="footer-flex">
|
<view class="footer-flex">
|
||||||
|
|||||||
@@ -18,13 +18,13 @@
|
|||||||
<input type="text" v-model="name" placeholder="姓名"/>
|
<input type="text" v-model="name" placeholder="姓名"/>
|
||||||
</view>
|
</view>
|
||||||
<view class="info-inputs">
|
<view class="info-inputs">
|
||||||
<input type="number" v-model="phone" placeholder="手机号码"/>
|
<input type="number" :disabled="$Route.query.type === 'PUT'?true:false" v-model="phone" placeholder="手机号码为员工唯一登录凭证"/>
|
||||||
</view>
|
</view>
|
||||||
<view class="info-inputs">
|
<view class="info-inputs">
|
||||||
<input type="text" v-model="job" placeholder="职业"/>
|
<input type="text" v-model="job" placeholder="职业"/>
|
||||||
</view>
|
</view>
|
||||||
<view class="info-inputs">
|
<view class="info-inputs">
|
||||||
<picker :range="section" range-key="name" :value="sectionIndex" @change="pickerChange">
|
<picker :range="section" range-key="name" :value="sectionIndex + ''" @change="pickerChange">
|
||||||
<view class="picker-text">
|
<view class="picker-text">
|
||||||
{{section[sectionIndex].name}}
|
{{section[sectionIndex].name}}
|
||||||
<uni-icons class="icon" type="arrowdown" color="#555"></uni-icons>
|
<uni-icons class="icon" type="arrowdown" color="#555"></uni-icons>
|
||||||
@@ -50,7 +50,7 @@
|
|||||||
<label>
|
<label>
|
||||||
<view class="item-title">{{item.title}}</view>
|
<view class="item-title">{{item.title}}</view>
|
||||||
<view class="item-info">{{item.description}}</view>
|
<view class="item-info">{{item.description}}</view>
|
||||||
<checkbox class="item-checkbox" :checked="item.check" color="#e93340" :value="item.permission_id" />
|
<checkbox class="item-checkbox" :checked="item.check" color="#e93340" :value="item.permission_id+''" />
|
||||||
</label>
|
</label>
|
||||||
</view>
|
</view>
|
||||||
</checkbox-group>
|
</checkbox-group>
|
||||||
@@ -73,7 +73,7 @@
|
|||||||
section : [],
|
section : [],
|
||||||
permissions : [],
|
permissions : [],
|
||||||
permissionIds: [],
|
permissionIds: [],
|
||||||
sectionIndex : 0,
|
sectionIndex : '0',
|
||||||
cover : {
|
cover : {
|
||||||
showpath : '',
|
showpath : '',
|
||||||
path : ''
|
path : ''
|
||||||
|
|||||||
@@ -12,9 +12,9 @@
|
|||||||
<uni-swipe-action-item :rightOptions="options" @click="onEmployees($event, listIndex, index)">
|
<uni-swipe-action-item :rightOptions="options" @click="onEmployees($event, listIndex, index)">
|
||||||
<view class="employees-item">
|
<view class="employees-item">
|
||||||
<view class="cover">
|
<view class="cover">
|
||||||
<block v-if="item.user.avatar === ''">{{item.name.slice(0,1)}}</block>
|
<block v-if="item.cover === ''">{{item.name.slice(0,1)}}</block>
|
||||||
<block v-else>
|
<block v-else>
|
||||||
<image class="cover-img" :src="item.user.avatar" mode="aspectFill"></image>
|
<image class="cover-img" :src="item.cover" mode="aspectFill"/>
|
||||||
</block>
|
</block>
|
||||||
</view>
|
</view>
|
||||||
<view class="content">
|
<view class="content">
|
||||||
|
|||||||
@@ -152,7 +152,7 @@
|
|||||||
<view class="title">
|
<view class="title">
|
||||||
限时抢购<text>海量商家优惠券</text>
|
限时抢购<text>海量商家优惠券</text>
|
||||||
</view>
|
</view>
|
||||||
<navigator class="more" open-type="navigate" url="/pages/coupons/couponList">查看更多</navigator>
|
<view class="more" @click="onCoupons('more')">查看更多</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="coupons" v-if="coupons.length > 0">
|
<view class="coupons" v-if="coupons.length > 0">
|
||||||
<view class="coupons-item" v-for="(item, index) in coupons" :key="index">
|
<view class="coupons-item" v-for="(item, index) in coupons" :key="index">
|
||||||
@@ -173,7 +173,7 @@
|
|||||||
<view class="logo">
|
<view class="logo">
|
||||||
<image class="logo-img" :src="item.cover" mode="aspectFill"></image>
|
<image class="logo-img" :src="item.cover" mode="aspectFill"></image>
|
||||||
</view>
|
</view>
|
||||||
<view class="btn">立即领取</view>
|
<button class="btn" :disabled="!item.can.get" @click="onCoupons('get', item.coupon_id, index)">{{item.can.get ? '立即领取' : '已领取'}}</button>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<!-- 优选商品 -->
|
<!-- 优选商品 -->
|
||||||
@@ -186,9 +186,10 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { companies, companiesList } from '@/apis/interfaces/company'
|
import { companies, companiesList } from '@/apis/interfaces/company'
|
||||||
import { mall, list } from '@/apis/interfaces/goods'
|
import { mall, list, managesCoupons } from '@/apis/interfaces/goods'
|
||||||
import goodsList from '@/components/goods-list/goods-list'
|
import goodsList from '@/components/goods-list/goods-list'
|
||||||
import industryList from '@/components/industry-list/industry-list'
|
import industryList from '@/components/industry-list/industry-list'
|
||||||
|
import userAuth from '@/public/userAuth'
|
||||||
export default{
|
export default{
|
||||||
comments:{
|
comments:{
|
||||||
goodsList,
|
goodsList,
|
||||||
@@ -247,10 +248,38 @@
|
|||||||
onRightBtn(e){
|
onRightBtn(e){
|
||||||
switch(e.index){
|
switch(e.index){
|
||||||
case 0:
|
case 0:
|
||||||
this.$Router.push({name: 'Search'})
|
this.$Router.push({name: 'Search', params: {type: this.tabIndex}})
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
// 领取,更多优惠券
|
||||||
|
onCoupons(type, id, index){
|
||||||
|
let token = this.$store.getters.getToken
|
||||||
|
if(token == ''){
|
||||||
|
let userLogin = new userAuth()
|
||||||
|
userLogin.Login()
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if(type === 'more'){
|
||||||
|
this.$Router.push({name: 'CouponsList'})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if(type === 'get'){
|
||||||
|
managesCoupons(id).then(res=>{
|
||||||
|
this.$set(this.coupons, index, res)
|
||||||
|
uni.showToast({
|
||||||
|
title: '领取成功',
|
||||||
|
type: 'primary',
|
||||||
|
duration: 3000
|
||||||
|
})
|
||||||
|
}).catch(err => {
|
||||||
|
uni.showToast({
|
||||||
|
icon : 'none',
|
||||||
|
title: err.message
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
// 企业广场
|
// 企业广场
|
||||||
getCompanies(){
|
getCompanies(){
|
||||||
companies().then(res=>{
|
companies().then(res=>{
|
||||||
@@ -323,7 +352,6 @@
|
|||||||
},
|
},
|
||||||
// 打开微信小程序
|
// 打开微信小程序
|
||||||
onOpenWechat(e){
|
onOpenWechat(e){
|
||||||
console.log(e)
|
|
||||||
plus.share.getServices(res => {
|
plus.share.getServices(res => {
|
||||||
let sweixin = null;
|
let sweixin = null;
|
||||||
for(let val of res){
|
for(let val of res){
|
||||||
@@ -569,6 +597,13 @@
|
|||||||
line-height: 64rpx;
|
line-height: 64rpx;
|
||||||
font-size: 28rpx;
|
font-size: 28rpx;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
|
&[disabled]{
|
||||||
|
background: rgba($color: #faf2dd, $alpha: .8);
|
||||||
|
color: rgba($color: #fd5f3c, $alpha: .5);
|
||||||
|
}
|
||||||
|
&::after{
|
||||||
|
border: none;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,22 +1,295 @@
|
|||||||
<template>
|
<template>
|
||||||
<view>
|
<view>
|
||||||
搜索
|
<view class="top">
|
||||||
|
<view class="search">
|
||||||
|
<input class="search-input" type="text" focus @input="onInput" :placeholder="nameVal" />
|
||||||
|
<view class="search-btn" @click="searchClick">搜索</view>
|
||||||
|
</view>
|
||||||
|
<view class="tabs">
|
||||||
|
<view class="tabs-item" @click="onTabs">
|
||||||
|
{{searchType == 0 ? '价格' : '信用值'}}
|
||||||
|
<image
|
||||||
|
class="icon"
|
||||||
|
mode="widthFix" :src="require(marketType == 'asc' ? '@/static/icons/market_icon_low.png': '@/static/icons/market_icon_high.png')"
|
||||||
|
/>
|
||||||
|
</view>
|
||||||
|
<view class="tabs-item" v-if="searchType == 0" @click="pageUrl">全部分类 <image class="tabs-item-arrow" src="@/static/icons/search_row.png" mode=""></image></view>
|
||||||
|
<view class="tabs-item" v-if="searchType == 1" @click="companyOpne">{{companyName}} <image class="tabs-item-arrow" src="@/static/icons/search_row.png" mode=""></image></view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="lists">
|
||||||
|
<!-- 优选商品 -->
|
||||||
|
<goods-list :list="searchArr" priceType="CNY" v-if="searchType == 0" @on-goods="onGoods" />
|
||||||
|
|
||||||
|
<!-- 商家 -->
|
||||||
|
<industry-list :list="searchArr" v-if="searchType == 1" @on-industry="onOpenWechat"/>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<!-- 分页 -->
|
||||||
|
<uni-load-more :status="pageStatus" :iconSize="16" v-if="searchArr.length > 0"></uni-load-more>
|
||||||
|
|
||||||
|
<!-- 企业分类弹出 -->
|
||||||
|
<view class="companyBack" :class="companyShow ? 'active' : ''"></view>
|
||||||
|
<view class="companyPopup" :class="companyShow ? 'active' : ''">
|
||||||
|
<view class="nowrap companyPopup-label" :class="{'show': item.industry_id == companyId}" v-for="(item, index) in categoryArr" :key="index" @click="companyList(item.industry_id, index)">
|
||||||
|
{{item.title}}
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import { searchUrl, companyCategory, randgoodsUrl } from '@/apis/interfaces/goods'
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
nameVal : '',
|
||||||
|
searchArr : [],
|
||||||
|
searchType : '0', // 分类 0位商品 1为企业
|
||||||
|
marketType : 'asc', // 排序
|
||||||
|
categoryArr : [], // 分类数组--企业
|
||||||
|
companyId : '', // 分类数组--企业id
|
||||||
|
companyName : '选择行业',
|
||||||
|
companyShow : false,
|
||||||
|
|
||||||
|
// 分页
|
||||||
|
pageStatus : '',
|
||||||
|
page : 1
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.searchType = this.$Route.query.type
|
||||||
|
// 商品分类默认关键字 type=0为商品列表; type=1为企业列表
|
||||||
|
let wechaUrl = '' // 定义接口来源名称
|
||||||
|
if (this.searchType == '0') wechaUrl = 'mall/randgoods' //商品关键字
|
||||||
|
if (this.searchType == '1') wechaUrl = 'companies/rand' //商品关键字
|
||||||
|
randgoodsUrl(wechaUrl, {
|
||||||
|
type: 1
|
||||||
|
}).then(res => {
|
||||||
|
this.nameVal = res.name
|
||||||
|
})
|
||||||
|
|
||||||
|
// 企业分类数据
|
||||||
|
if(this.searchType == '1'){
|
||||||
|
companyCategory().then(res => {
|
||||||
|
this.categoryArr = res
|
||||||
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
// 商品详情
|
||||||
|
onGoods(e){
|
||||||
|
this.$Router.push({name: 'goodsDetails', params: {id: e.goods_id}})
|
||||||
|
},
|
||||||
|
// 打开微信小程序
|
||||||
|
onOpenWechat(e){
|
||||||
|
plus.share.getServices(res => {
|
||||||
|
let sweixin = null;
|
||||||
|
for(let val of res){
|
||||||
|
if(val.id === 'weixin'){
|
||||||
|
sweixin = val
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/** 以此为例子 显示跳转引导页
|
||||||
|
* 'index_4'
|
||||||
|
* index 跳小程序企业首页
|
||||||
|
* 4 企业id
|
||||||
|
**/
|
||||||
|
if(sweixin != null){
|
||||||
|
sweixin.launchMiniProgram({
|
||||||
|
id : e.original_id,
|
||||||
|
path: 'pages/login/guide?scene=index_' + e.company_id,
|
||||||
|
})
|
||||||
|
}else{
|
||||||
|
uni.showToast({
|
||||||
|
title: '当前环境不支持打开微信小程序',
|
||||||
|
icon : 'none'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 列表数据
|
||||||
|
getList() {
|
||||||
|
// type=0为商品列表; type=1为企业列表
|
||||||
|
let wechaUrl = '' // 定义接口来源名称
|
||||||
|
if (this.searchType == '0') wechaUrl = 'mall/goods'// 商品列表
|
||||||
|
if (this.searchType == '1') wechaUrl = 'companies/lists' //企业列表
|
||||||
|
|
||||||
|
searchUrl(wechaUrl, {
|
||||||
|
page : this.goodsPage,
|
||||||
|
order_by : this.marketType,
|
||||||
|
industry_id : this.companyId,
|
||||||
|
name : this.nameVal
|
||||||
|
}).then(res => {
|
||||||
|
if(res.page.current === 1){
|
||||||
|
this.searchArr = []
|
||||||
|
}
|
||||||
|
this.searchArr = this.searchArr.concat(res.data)
|
||||||
|
this.goodsPage = res.page.current
|
||||||
|
this.pageStatus = res.page.has_more ? 'more': 'noMore'
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
// 输入关键词
|
||||||
|
onInput(val) {
|
||||||
|
this.nameVal = val.detail.value
|
||||||
|
},
|
||||||
|
|
||||||
|
// 搜索
|
||||||
|
searchClick() {
|
||||||
|
// 获取列表
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
|
||||||
|
// 筛选产品
|
||||||
|
onTabs(e){
|
||||||
|
this.marketType = this.marketType == 'asc' ? 'desc': 'asc'
|
||||||
|
this.getList()
|
||||||
|
},
|
||||||
|
|
||||||
|
// 商品分类跳转
|
||||||
|
pageUrl() {
|
||||||
|
this.$Router.push({name: 'goodsClassify'})
|
||||||
|
},
|
||||||
|
|
||||||
|
// 查看企业行业
|
||||||
|
companyOpne(){
|
||||||
|
this.companyShow = !this.companyShow
|
||||||
|
},
|
||||||
|
|
||||||
|
// 筛选企业列表
|
||||||
|
companyList(id, index) {
|
||||||
|
this.companyId = id
|
||||||
|
this.companyName = this.categoryArr[index].title
|
||||||
|
this.companyShow = false
|
||||||
|
// 获取全局列表
|
||||||
|
this.getList();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
// 下拉加载
|
||||||
|
onReachBottom() {
|
||||||
|
if(this.pageStatus == 'more'){
|
||||||
|
this.pageStatus = 'loading'
|
||||||
|
this.goodsPage += 1
|
||||||
|
this.getList()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style>
|
<style lang="scss" scoped>
|
||||||
|
.top{
|
||||||
|
position: fixed;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
z-index: 9;
|
||||||
|
width: 100%;
|
||||||
|
height: 180rpx;
|
||||||
|
.search {
|
||||||
|
background: white;
|
||||||
|
height: 100rpx;
|
||||||
|
width: 100%;
|
||||||
|
padding: 20rpx $padding 0;
|
||||||
|
box-sizing: border-box;
|
||||||
|
display: flex;
|
||||||
|
.search-input {
|
||||||
|
padding: 0 $padding;
|
||||||
|
box-sizing: border-box;
|
||||||
|
height: 60rpx;
|
||||||
|
background-color: #f7f7f7;
|
||||||
|
font-size: $title-size-m;
|
||||||
|
border-radius: 80rpx;
|
||||||
|
flex: 1;
|
||||||
|
margin-right: $margin;
|
||||||
|
}
|
||||||
|
.search-btn {
|
||||||
|
line-height: 60rpx;
|
||||||
|
color: #e93340;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.tabs{
|
||||||
|
background: white;
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-around;
|
||||||
|
height: 80rpx;
|
||||||
|
margin-bottom: 20rpx;
|
||||||
|
box-sizing: border-box;
|
||||||
|
line-height: 80rpx;
|
||||||
|
text-align: center;
|
||||||
|
.tabs-item{
|
||||||
|
font-size: $title-size-m;
|
||||||
|
color: $text-gray;
|
||||||
|
.icon{
|
||||||
|
width: 32rpx;
|
||||||
|
height: 32rpx;
|
||||||
|
vertical-align: middle;
|
||||||
|
margin-left: $margin / 3;
|
||||||
|
margin-bottom: 4rpx;
|
||||||
|
}
|
||||||
|
&.show{
|
||||||
|
color: $text-price;
|
||||||
|
}
|
||||||
|
.tabs-item-arrow {
|
||||||
|
width: 24rpx;
|
||||||
|
height: 24rpx;
|
||||||
|
margin-left: 10rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 列表
|
||||||
|
.lists{
|
||||||
|
padding: 180rpx 0 $padding;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 企业弹出
|
||||||
|
.companyBack,
|
||||||
|
.companyPopup {
|
||||||
|
position: fixed;
|
||||||
|
top: 200rpx;
|
||||||
|
left: 0;
|
||||||
|
width: 100%;
|
||||||
|
z-index: 99;
|
||||||
|
}
|
||||||
|
|
||||||
|
.companyBack {
|
||||||
|
height: calc(100% - 200rpx);
|
||||||
|
background-color: rgba(0,0,0,.2);
|
||||||
|
display: none;
|
||||||
|
&.active {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.companyPopup {
|
||||||
|
height: 45%;
|
||||||
|
overflow: hidden;
|
||||||
|
overflow-y: scroll;
|
||||||
|
border-top: 1rpx solid #f1f1f1;
|
||||||
|
background-color: #FFFFFF;
|
||||||
|
padding: $padding - 10 $padding;
|
||||||
|
display: none;
|
||||||
|
box-sizing: border-box;
|
||||||
|
.companyPopup-label {
|
||||||
|
width: calc(25% - 20rpx);
|
||||||
|
font-size: $title-size-sm - 2;
|
||||||
|
display: inline-block;
|
||||||
|
height: 60rpx;
|
||||||
|
line-height: 58rpx;
|
||||||
|
border: 1rpx solid #F8F8F8;
|
||||||
|
background-color: #FFFFFF;
|
||||||
|
margin: 10rpx;
|
||||||
|
text-align: center;
|
||||||
|
&.show {
|
||||||
|
color: #e93340;
|
||||||
|
border-color: #efd3d3;
|
||||||
|
background-color: #fef9f9;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
&.active {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -398,13 +398,13 @@
|
|||||||
content : this.$Route.query.type === 'edit' ? '商品权证已更新,是否立即补充产品附加信息认证?' : '商品权证已发布,是否立即补充产品附加信息认证?',
|
content : this.$Route.query.type === 'edit' ? '商品权证已更新,是否立即补充产品附加信息认证?' : '商品权证已发布,是否立即补充产品附加信息认证?',
|
||||||
cancelText : '稍后认证',
|
cancelText : '稍后认证',
|
||||||
confirmText : '立即认证',
|
confirmText : '立即认证',
|
||||||
success : res => {
|
success : modalRes => {
|
||||||
if(res.cancel){
|
if(modalRes.cancel){
|
||||||
this.$Router.back(this.$Route.query.type === 'edit' ? 1 : 2)
|
this.$Router.back(this.$Route.query.type === 'edit' ? 1 : 2)
|
||||||
}
|
}
|
||||||
if(res.confirm){
|
if(modalRes.confirm){
|
||||||
let goodsId = this.$Route.query.type === 'edit' ? this.$Route.query.id : res
|
let goodsId = this.$Route.query.type === 'edit' ? this.$Route.query.id : res
|
||||||
this.$Router.push({name: 'goodsAuth', params: { id: goodsId , type: 'goodsAdd', edit: this.$Route.query.type === 'edit'}})
|
this.$Router.replace({name: 'goodsAuth', params: { id: goodsId , type: 'goodsAdd', edit: this.$Route.query.type === 'edit'}})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -26,7 +26,6 @@
|
|||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
managesCategory().then(res => {
|
managesCategory().then(res => {
|
||||||
console.log(res)
|
|
||||||
this.loding = false
|
this.loding = false
|
||||||
this.category = res
|
this.category = res
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
<image src="https://e-chain.cnskl.com/storage/imageresource/chain-bg.png" class='chainBg' />
|
<image src="https://e-chain.cnskl.com/storage/imageresource/chain-bg.png" class='chainBg' />
|
||||||
<view class="chain-content">
|
<view class="chain-content">
|
||||||
<view class="chain-center">
|
<view class="chain-center">
|
||||||
<image src="/static/images/service-logi.png" mode="aspectFill" class="logo" />
|
<image src="/static/icons/e-logo.png" mode="aspectFill" class="logo" />
|
||||||
<view class="name">易品新境区块链溯源证书</view>
|
<view class="name">易品新境区块链溯源证书</view>
|
||||||
<view class="no">区块链溯源证书:{{info.token}}</view>
|
<view class="no">区块链溯源证书:{{info.token}}</view>
|
||||||
<view class="content">
|
<view class="content">
|
||||||
@@ -49,7 +49,6 @@
|
|||||||
.GoodsChain {
|
.GoodsChain {
|
||||||
background-color:fff;
|
background-color:fff;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
min-height: 100vh;
|
|
||||||
position: relative;
|
position: relative;
|
||||||
z-index: 1;
|
z-index: 1;
|
||||||
.chainBg{
|
.chainBg{
|
||||||
@@ -60,7 +59,7 @@
|
|||||||
}
|
}
|
||||||
.chain-content{
|
.chain-content{
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100vh;
|
min-height: 100%;
|
||||||
z-index: 2;
|
z-index: 2;
|
||||||
padding: 18vh 10vw 15vh 10vw ;
|
padding: 18vh 10vw 15vh 10vw ;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
@@ -68,7 +67,7 @@
|
|||||||
z-index: 3;
|
z-index: 3;
|
||||||
.chain-center{
|
.chain-center{
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
min-height: 100%;
|
||||||
.logo{
|
.logo{
|
||||||
width: 160rpx;
|
width: 160rpx;
|
||||||
height: 160rpx;
|
height: 160rpx;
|
||||||
|
|||||||
@@ -38,7 +38,7 @@
|
|||||||
:readonly="true"
|
:readonly="true"
|
||||||
color="#ddd"
|
color="#ddd"
|
||||||
active-color="#c82626"
|
active-color="#c82626"
|
||||||
:value="2.5"
|
:value="goodsObj.company.star"
|
||||||
:size="14"
|
:size="14"
|
||||||
/>
|
/>
|
||||||
</view>
|
</view>
|
||||||
@@ -69,7 +69,7 @@
|
|||||||
<label class="title">说明</label>
|
<label class="title">说明</label>
|
||||||
特价商品不可与优惠券叠加使用
|
特价商品不可与优惠券叠加使用
|
||||||
</view>
|
</view>
|
||||||
<view class="size-item nowrap">
|
<view class="size-item nowrap" v-if="goodsObj.services.length > 0">
|
||||||
<label class="title">服务</label>
|
<label class="title">服务</label>
|
||||||
<view class="goods-serve" @click="serveOpne">
|
<view class="goods-serve" @click="serveOpne">
|
||||||
<image class="goods-serve-img" src="../../static/icons/goods_buy.png" mode="aspectFill"></image>
|
<image class="goods-serve-img" src="../../static/icons/goods_buy.png" mode="aspectFill"></image>
|
||||||
@@ -116,6 +116,9 @@
|
|||||||
满{{item.full}}可用
|
满{{item.full}}可用
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
<view class="coupons-left" v-if="item.type.value == '1' || item.type.value =='3'">
|
||||||
|
<image :src="item.cover" mode="aspectFill" class="coupon-left-img" />
|
||||||
|
</view>
|
||||||
<view class="coupons-left" v-else-if="item.type.value == '3'">
|
<view class="coupons-left" v-else-if="item.type.value == '3'">
|
||||||
<view class="coupons-number coupons-small">
|
<view class="coupons-number coupons-small">
|
||||||
提货券
|
提货券
|
||||||
@@ -202,12 +205,15 @@
|
|||||||
userLogin.Login()
|
userLogin.Login()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
this.$Router.push({
|
// this.$Router.push({
|
||||||
name: 'Buy',
|
// name: 'Buy',
|
||||||
params: {
|
// params: {
|
||||||
skuId: this.goodsObj.skus[0].sku_id,
|
// skuId: this.goodsObj.skus[0].sku_id,
|
||||||
qty : this.goodsObj.skus[0].number
|
// qty : this.goodsObj.skus[0].number
|
||||||
}
|
// }
|
||||||
|
// })
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '/pages/property/coupon/confirmOrder?qty=1&type=2&goods_sku_id=' + this.goodsObj.skus[0].sku_id
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
// 打开微信小程序
|
// 打开微信小程序
|
||||||
@@ -324,8 +330,8 @@
|
|||||||
font-size: $title-size;
|
font-size: $title-size;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
line-height: 50rpx;
|
line-height: 50rpx;
|
||||||
display: flex;
|
|
||||||
.title-hot {
|
.title-hot {
|
||||||
|
display: inline-block;
|
||||||
background-color: #fee195;
|
background-color: #fee195;
|
||||||
font-size: 24rpx;
|
font-size: 24rpx;
|
||||||
border-radius: 50rpx;
|
border-radius: 50rpx;
|
||||||
@@ -408,7 +414,7 @@
|
|||||||
.goods-serve-img {
|
.goods-serve-img {
|
||||||
width: 36rpx;
|
width: 36rpx;
|
||||||
height: 36rpx;
|
height: 36rpx;
|
||||||
margin-top: 24rpx;
|
margin-top: 26rpx;
|
||||||
}
|
}
|
||||||
.goods-serve-name {
|
.goods-serve-name {
|
||||||
margin: 0 30rpx 0 20rpx;
|
margin: 0 30rpx 0 20rpx;
|
||||||
@@ -637,9 +643,11 @@
|
|||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
position: relative;
|
position: relative;
|
||||||
margin-top: $margin;
|
margin-top: $margin;
|
||||||
|
// background-color: red;
|
||||||
.coupons-tips {
|
.coupons-tips {
|
||||||
background-color: #211e17;
|
// background-color: #211e17;
|
||||||
color: #efe8d8;
|
background-image: linear-gradient(to right, #f8e5c0, #d6a46a);
|
||||||
|
color: #8d4928;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
border-radius: 0 0 20rpx 0;
|
border-radius: 0 0 20rpx 0;
|
||||||
padding: 0 8rpx;
|
padding: 0 8rpx;
|
||||||
@@ -647,6 +655,7 @@
|
|||||||
line-height: 34rpx;
|
line-height: 34rpx;
|
||||||
left: 0;
|
left: 0;
|
||||||
top: 0;
|
top: 0;
|
||||||
|
z-index: 10;
|
||||||
.coupons-tips-text {
|
.coupons-tips-text {
|
||||||
font-size: 24rpx;
|
font-size: 24rpx;
|
||||||
transform:scale(.85);
|
transform:scale(.85);
|
||||||
@@ -660,6 +669,11 @@
|
|||||||
text-align: center;
|
text-align: center;
|
||||||
padding: $padding - 10 0;
|
padding: $padding - 10 0;
|
||||||
border-right: 2rpx dashed #eccdd4;
|
border-right: 2rpx dashed #eccdd4;
|
||||||
|
.coupon-left-img{
|
||||||
|
width: 180rpx;
|
||||||
|
height: 100rpx;
|
||||||
|
border-radius: 20rpx;
|
||||||
|
}
|
||||||
.coupons-number {
|
.coupons-number {
|
||||||
font-size: 40rpx;
|
font-size: 40rpx;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
|
|||||||
@@ -140,6 +140,7 @@
|
|||||||
product_address : this.productAddress,
|
product_address : this.productAddress,
|
||||||
extend_cover : this.extendCover[0].path
|
extend_cover : this.extendCover[0].path
|
||||||
}
|
}
|
||||||
|
|
||||||
let submitFund = managesGoodsAuth(this.$Route.query.id, submitData)
|
let submitFund = managesGoodsAuth(this.$Route.query.id, submitData)
|
||||||
submitFund.then(res => {
|
submitFund.then(res => {
|
||||||
uni.showModal({
|
uni.showModal({
|
||||||
@@ -149,7 +150,7 @@
|
|||||||
success : res => {
|
success : res => {
|
||||||
if(res.confirm){
|
if(res.confirm){
|
||||||
if(this.$Route.query.type == 'goodsAdd'){
|
if(this.$Route.query.type == 'goodsAdd'){
|
||||||
this.$Router.back(this.$Route.query.edit == 'true' ? 2 : 3)
|
this.$Router.back(this.$Route.query.edit == 'true' ? 2 : 2)
|
||||||
}else{
|
}else{
|
||||||
this.$Router.back()
|
this.$Router.back()
|
||||||
}
|
}
|
||||||
|
|||||||
95
pages/goods/goodsClassify.vue
Normal file
@@ -0,0 +1,95 @@
|
|||||||
|
<template>
|
||||||
|
<view class="content-flex" v-if="!loding">
|
||||||
|
<scroll-view class="stair" scroll-y>
|
||||||
|
<view class="stair-item" :class="{'show': stairIndex == index}" v-for="(item, index) in category" :key="index" @click="stairIndex = index">{{item.name}}</view>
|
||||||
|
<view class="ios-bottom"></view>
|
||||||
|
</scroll-view>
|
||||||
|
<scroll-view class="second" scroll-y>
|
||||||
|
<view class="second-item" v-for="(item, index) in category[stairIndex].children" :key="index" @click="$Router.push({name: 'goodsList', params: {id: item.category_id}})">
|
||||||
|
{{item.name}}<uni-icons class="arrow-icon" type="arrowright" color="#999" size="14"></uni-icons>
|
||||||
|
</view>
|
||||||
|
<view class="ios-bottom"></view>
|
||||||
|
</scroll-view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { goodsCategory } from '@/apis/interfaces/goods'
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
loding : true,
|
||||||
|
category : [],
|
||||||
|
stairIndex : 0,
|
||||||
|
secondIndex : 0
|
||||||
|
};
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
goodsCategory().then(res => {
|
||||||
|
this.loding = false
|
||||||
|
this.category = res
|
||||||
|
})
|
||||||
|
},
|
||||||
|
methods:{}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.content-flex{
|
||||||
|
background-color: white;
|
||||||
|
height: 100vh;
|
||||||
|
display: flex;
|
||||||
|
font-size: $title-size-m;
|
||||||
|
.stair{
|
||||||
|
background: #F5F5F5;
|
||||||
|
width: 240rpx;
|
||||||
|
.stair-item{
|
||||||
|
text-align: center;
|
||||||
|
padding: 0 $padding;
|
||||||
|
line-height: 90rpx;
|
||||||
|
color: $text-gray;
|
||||||
|
@extend .nowrap;
|
||||||
|
&.show{
|
||||||
|
position: relative;
|
||||||
|
background: white;
|
||||||
|
color: $text-price;
|
||||||
|
font-weight: bold;
|
||||||
|
&::before{
|
||||||
|
position: absolute;
|
||||||
|
height: 40rpx;
|
||||||
|
width: 5rpx;
|
||||||
|
background: $text-price;
|
||||||
|
content: " ";
|
||||||
|
left: 0;
|
||||||
|
top: 20rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.second{
|
||||||
|
width: calc(100% - 240rpx);
|
||||||
|
.second-item{
|
||||||
|
position: relative;
|
||||||
|
padding: 0 ($padding + 80) 0 $padding;
|
||||||
|
line-height: 90rpx;
|
||||||
|
color: $text-gray;
|
||||||
|
.arrow-icon{
|
||||||
|
position: absolute;
|
||||||
|
right: $padding;
|
||||||
|
}
|
||||||
|
&::after{
|
||||||
|
position: absolute;
|
||||||
|
height: 1rpx;
|
||||||
|
content: ' ';
|
||||||
|
background: $border-color;
|
||||||
|
left: $padding;
|
||||||
|
right: 0;
|
||||||
|
top: 0;
|
||||||
|
}
|
||||||
|
&:first-child::after{
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -45,7 +45,8 @@
|
|||||||
|
|
||||||
getList(){
|
getList(){
|
||||||
list({
|
list({
|
||||||
order_by: this.tabIndex == 1 ? this.marketType: ''
|
category_cid: this.$Route.query.id,
|
||||||
|
order_by : this.tabIndex == 1 ? this.marketType: ''
|
||||||
}).then(res=>{
|
}).then(res=>{
|
||||||
this.goods = res.data
|
this.goods = res.data
|
||||||
this.pages = res.page
|
this.pages = res.page
|
||||||
|
|||||||
@@ -56,9 +56,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
console.log(this.$Route.query.id)
|
|
||||||
managesTracedTo(this.$Route.query.id).then(res=>{
|
managesTracedTo(this.$Route.query.id).then(res=>{
|
||||||
console.log(res)
|
|
||||||
this.list = res.list
|
this.list = res.list
|
||||||
this.info = res
|
this.info = res
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
<view class="info">
|
<view class="info">
|
||||||
<view class="info-item">
|
<view class="info-item">
|
||||||
<label>权证销售单价</label>
|
<label>权证销售单价</label>
|
||||||
1000.00
|
¥{{info.goods.price}}
|
||||||
</view>
|
</view>
|
||||||
<view class="info-item">
|
<view class="info-item">
|
||||||
<label>拥有数量</label>
|
<label>拥有数量</label>
|
||||||
@@ -33,6 +33,7 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<button class="buy-btn" type="default" @click="onCreate">确认转让</button>
|
<button class="buy-btn" type="default" @click="onCreate">确认转让</button>
|
||||||
|
<u-toast ref="uToast" />
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -75,6 +76,13 @@
|
|||||||
},
|
},
|
||||||
// 提交转让市场
|
// 提交转让市场
|
||||||
onCreate(){
|
onCreate(){
|
||||||
|
if(this.pirce === ''){
|
||||||
|
this.$refs.uToast.show({
|
||||||
|
title: '请校验转让价格',
|
||||||
|
type: 'error',icon:false,
|
||||||
|
duration: 3000
|
||||||
|
})
|
||||||
|
}else{
|
||||||
marketsCreate({
|
marketsCreate({
|
||||||
symbol : this.$Route.query.symbol,
|
symbol : this.$Route.query.symbol,
|
||||||
qty : this.stock,
|
qty : this.stock,
|
||||||
@@ -98,6 +106,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
|||||||
@@ -20,7 +20,7 @@
|
|||||||
<label>订单金额</label>
|
<label>订单金额</label>
|
||||||
<view class="price nowrap">{{amount}}</view>
|
<view class="price nowrap">{{amount}}</view>
|
||||||
</view>
|
</view>
|
||||||
<block v-if="coupons.length > 1">
|
<block v-if="coupons.length >= 1">
|
||||||
<view class="item">
|
<view class="item">
|
||||||
<label>使用优惠券</label>
|
<label>使用优惠券</label>
|
||||||
<picker mode="selector" :range="coupons" range-key="title" :value="couponIndex" @change="couponsChange">
|
<picker mode="selector" :range="coupons" range-key="title" :value="couponIndex" @change="couponsChange">
|
||||||
@@ -133,9 +133,9 @@
|
|||||||
},
|
},
|
||||||
// 选择支付类型
|
// 选择支付类型
|
||||||
payType(e){
|
payType(e){
|
||||||
|
console.log(e.detail.value)
|
||||||
this.payValue = e.detail.value
|
this.payValue = e.detail.value
|
||||||
},
|
},
|
||||||
|
|
||||||
//数量变化
|
//数量变化
|
||||||
numberChange(e){
|
numberChange(e){
|
||||||
this.qty = e
|
this.qty = e
|
||||||
@@ -148,7 +148,7 @@
|
|||||||
goods_sku_id : this.$Route.query.skuId,
|
goods_sku_id : this.$Route.query.skuId,
|
||||||
qty : this.qty,
|
qty : this.qty,
|
||||||
coupon_grant_id : this.couponId,
|
coupon_grant_id : this.couponId,
|
||||||
type : 1,
|
type : this.payValue === 'wx'?2:1,
|
||||||
remark : 'app订单,易货产品',
|
remark : 'app订单,易货产品',
|
||||||
channel : 'app'
|
channel : 'app'
|
||||||
}, 'POST').then(res=>{
|
}, 'POST').then(res=>{
|
||||||
|
|||||||
666
pages/property/coupon/confirmOrder.vue
Normal file
@@ -0,0 +1,666 @@
|
|||||||
|
<template>
|
||||||
|
<view class="ConfirmOrder">
|
||||||
|
<view class="goods-info1">
|
||||||
|
<view class="top">
|
||||||
|
<view class="company">
|
||||||
|
<image :src="shop.cover" mode="aspectFill" />
|
||||||
|
<view class="name">{{shop.name}}</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="goods-info">
|
||||||
|
<image class="goods-img" :src="info.cover" mode="aspectFill" />
|
||||||
|
<view class="goods">
|
||||||
|
<view class="name">
|
||||||
|
<view class="name1 ellipsis-2">{{info.title}}</view> <span>¥{{info.price}}</span>
|
||||||
|
</view>
|
||||||
|
<!-- <view class="sku">均码规格/件<span>x {{info.qty}}</span> </view> -->
|
||||||
|
<view class="sku">
|
||||||
|
<span>数量</span>
|
||||||
|
<span>
|
||||||
|
<u-number-box v-model="params.qty" :min='1' :max='1000' @change='numberBoxChange' />
|
||||||
|
</span>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<!-- <view class="goods-type">支付方式<span>在线支付</span></view> -->
|
||||||
|
<view class="goods-type" @click="showCouponList = true">优惠券
|
||||||
|
<span>{{coupon_grant_id!==''?'已优惠 - ¥'+coupon_price:'选择优惠券'}}
|
||||||
|
<u-icon name="arrow-right" color="#666" size="24" />
|
||||||
|
</span>
|
||||||
|
</view>
|
||||||
|
<!-- <view class="goods-type" style="border-top: solid 20rpx #f7f7f7;">创建时间<span>2021-11-20 13:00:15</span></view> -->
|
||||||
|
<view class="goods-type">商品总价 <span>¥{{amount}}</span></view>
|
||||||
|
<view class="goods-type" v-if="coupon_price>0">优惠<span> - ¥{{coupon_price}}</span></view>
|
||||||
|
<!-- <view class="goods-type">运费 <span>免邮</span></view> -->
|
||||||
|
<view class="goods-type">
|
||||||
|
<u-input class="order-content" type="textarea" v-model="remark" :clearable='false' :border="true"
|
||||||
|
:auto-height="true" placeholder="请填写订单备注" />
|
||||||
|
</view>
|
||||||
|
<view class="pay-select">请选择支付方式</view>
|
||||||
|
<view class="pay-select-item" @click="selectPay('2')">
|
||||||
|
<view class="pay-left">
|
||||||
|
<u-icon class="wx-icon" name="weixin-fill" color="#fff" size="40"></u-icon>
|
||||||
|
<view class="pay-wx-title">
|
||||||
|
微信支付
|
||||||
|
<span>推荐微信用户使用</span>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<u-icon v-if="selectTypeId!== '2'" name="checkmark-circle" color="#f7f7f7" size="50"></u-icon>
|
||||||
|
<u-icon v-else name="checkmark-circle-fill" color="#e93340" size="50"></u-icon>
|
||||||
|
</view>
|
||||||
|
<view class="pay-select-item" @click="selectPay('1')">
|
||||||
|
<view class="pay-left">
|
||||||
|
<u-icon class="wx-icon" name="integral-fill" color="#fff" size="40"></u-icon>
|
||||||
|
<view class="pay-wx-title">
|
||||||
|
E币交易
|
||||||
|
<span>可用Eb总额:{{account.getEBBalance}}</span>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<u-icon v-if="selectTypeId!== '1'" name="checkmark-circle" color="#f7f7f7" size="50" />
|
||||||
|
<u-icon v-else name="checkmark-circle-fill" color="#e93340" size="50" />
|
||||||
|
</view>
|
||||||
|
|
||||||
|
</view>
|
||||||
|
<!-- 订单 -->
|
||||||
|
<view class="actions">
|
||||||
|
<view class="title">
|
||||||
|
实付金额:<span class="money">¥{{total}}</span>
|
||||||
|
</view>
|
||||||
|
<view @click="order" class="nowPay">提交订单</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<!-- 优惠券弹窗 -->
|
||||||
|
<u-popup v-model="showCouponList" mode="bottom" border-radius="14">
|
||||||
|
<scroll-view scroll-y="true" style="height: 1000rpx;" class="scrollView">
|
||||||
|
<view class="coupon-title">可用优惠券列表</view>
|
||||||
|
<view class="coupon-list-item" v-for="(item,index) in list" :key="index" v-if="list.length>0">
|
||||||
|
<u-icon v-if="coupon_grant_id!== item.coupon_grant_id" name="checkmark-circle" color="#cacaca"
|
||||||
|
size="50">
|
||||||
|
</u-icon>
|
||||||
|
<u-icon v-else name="checkmark-circle-fill" color="#e93340" size="50"></u-icon>
|
||||||
|
<couponTemplate style="flex: 1;" :item="{...item}" :showUse='false' />
|
||||||
|
<!-- 遮挡层用户控制点击事件 -->
|
||||||
|
<view class="coupon-list-item" @click="selectCoupon(item)"></view>
|
||||||
|
</view>
|
||||||
|
<!-- 没有优惠券列表 -->
|
||||||
|
<no-list v-if="list.length === 0" name='no-counpon' txt="没有任何可用券哦" />
|
||||||
|
</scroll-view>
|
||||||
|
</u-popup>
|
||||||
|
<!-- <u-toast ref="uToast" /> -->
|
||||||
|
<u-toast ref="uToast" />
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import couponTemplate from "@/components/coupon-template/coupon-template-2"
|
||||||
|
import {
|
||||||
|
mallBuyGoods
|
||||||
|
} from '@/apis/interfaces/goods'
|
||||||
|
import {
|
||||||
|
wxPay,
|
||||||
|
ebPay
|
||||||
|
} from '@/apis/interfaces/order'
|
||||||
|
export default {
|
||||||
|
name: 'OrderInfo',
|
||||||
|
components: {
|
||||||
|
couponTemplate
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
// box: {
|
||||||
|
// min: 1,
|
||||||
|
// max: 100
|
||||||
|
// },
|
||||||
|
amount: 0,
|
||||||
|
account: {},
|
||||||
|
total: 0,
|
||||||
|
shop: {}, // 店铺信息
|
||||||
|
info: {}, // 商品详情
|
||||||
|
showCouponList: false, // 默认false不显示优惠券弹窗列表
|
||||||
|
coupon_grant_id: '', // 默认没有选择任何一个优惠券
|
||||||
|
list: [], // 优惠券列表
|
||||||
|
params: {}, // 上个页面携带过来的参数
|
||||||
|
remark: '', // 备注
|
||||||
|
order_no: '', // 下单成功的id
|
||||||
|
selectTypeId: '2', // 微信支付2 E币支付1
|
||||||
|
coupon_price: '' // 代驾券显示金额,提货券显示什么呢
|
||||||
|
};
|
||||||
|
},
|
||||||
|
|
||||||
|
onLoad(e) {
|
||||||
|
// 获取确认订单页面参数
|
||||||
|
this.params = e
|
||||||
|
this.params.qty = Number(e.qty)
|
||||||
|
this.mallBuyGoods(e, 'get') // 确认订单商品信息get
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
// 确认商品详情页get,下单页面post
|
||||||
|
mallBuyGoods(params, method) {
|
||||||
|
params.coupon_grant_id = this.coupon_grant_id
|
||||||
|
mallBuyGoods(params, method).then(res => {
|
||||||
|
if (method === 'get') {
|
||||||
|
this.amount = res.amount
|
||||||
|
this.account = res.account
|
||||||
|
this.total = res.total
|
||||||
|
this.list = res.coupons
|
||||||
|
this.shop = res.detail[0].shop
|
||||||
|
this.info = res.detail[0].items[0]
|
||||||
|
this.coupon_price = res.coupon_price
|
||||||
|
} else {
|
||||||
|
this.order_no = res.order_no
|
||||||
|
// this.$refs.uToast.show({
|
||||||
|
// title: '下单成功',
|
||||||
|
// duration: 1888,
|
||||||
|
// type: 'primary',
|
||||||
|
// })
|
||||||
|
|
||||||
|
this.nowPay()
|
||||||
|
}
|
||||||
|
}).catch(err => {
|
||||||
|
this.$refs.uToast.show({
|
||||||
|
title: err.message,
|
||||||
|
type: 'primary',
|
||||||
|
duration: 3000
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 提交订单
|
||||||
|
order() {
|
||||||
|
let params = this.params
|
||||||
|
params.coupon_grant_id = this.coupon_grant_id
|
||||||
|
params.remark = this.remark
|
||||||
|
params.channel = 'mini'
|
||||||
|
this.mallBuyGoods(params, 'post')
|
||||||
|
},
|
||||||
|
// 触发支付
|
||||||
|
nowPay() {
|
||||||
|
this.canPay = false
|
||||||
|
let apiUrl = ''
|
||||||
|
let data = {}
|
||||||
|
if (this.selectTypeId === '2') {
|
||||||
|
apiUrl = wxPay
|
||||||
|
data = {
|
||||||
|
order_no: this.order_no,
|
||||||
|
type: 'app'
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
apiUrl = ebPay
|
||||||
|
data = {
|
||||||
|
order_no: this.order_no
|
||||||
|
}
|
||||||
|
}
|
||||||
|
apiUrl(data).then(res => {
|
||||||
|
if (this.selectTypeId === '2') {
|
||||||
|
console.log(typeof res)
|
||||||
|
if (typeof res === 'string') {
|
||||||
|
let payInfo = JSON.parse(res)
|
||||||
|
|
||||||
|
|
||||||
|
// app 支付未完。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。
|
||||||
|
// uni.requestPayment({
|
||||||
|
// provider: "wxpay",
|
||||||
|
// orderInfo: JSON.stringify(payInfo),
|
||||||
|
// success: res => {
|
||||||
|
// this.$refs.uToast.show({
|
||||||
|
// title: '支付成功',
|
||||||
|
// type: 'primary',
|
||||||
|
// duration: 3000
|
||||||
|
// })
|
||||||
|
// setTimeout(() => {
|
||||||
|
// this.canPay = true
|
||||||
|
// uni.reLaunch({
|
||||||
|
// url: '/pages/property/coupon/payStatus?success=true'
|
||||||
|
// })
|
||||||
|
// }, 3000);
|
||||||
|
// },
|
||||||
|
// fail: (err) => {
|
||||||
|
// this.canPay = true
|
||||||
|
// this.$refs.uToast.show({
|
||||||
|
// title: '支付失败',
|
||||||
|
// type: 'primary',
|
||||||
|
// duration: 3000
|
||||||
|
// })
|
||||||
|
// setTimeout(() => {
|
||||||
|
// this.canPay = true
|
||||||
|
// uni.reLaunch({
|
||||||
|
// url: '/pages/property/coupon/payStatus?success=false'
|
||||||
|
// })
|
||||||
|
// }, 3000);
|
||||||
|
// }
|
||||||
|
// })
|
||||||
|
this.$refs.uToast.show({
|
||||||
|
title: '支付失败',
|
||||||
|
type: 'primary',
|
||||||
|
duration: 3000
|
||||||
|
})
|
||||||
|
uni.showModal({
|
||||||
|
title: '温馨提醒',
|
||||||
|
content: '微信支付当前暂未开通,无法支付。',
|
||||||
|
success(res) {
|
||||||
|
this.canPay = true
|
||||||
|
setTimeout(() => {
|
||||||
|
this.canPay = true
|
||||||
|
uni.reLaunch({
|
||||||
|
url: '/pages/property/coupon/payStatus?success=false'
|
||||||
|
})
|
||||||
|
}, 3000);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
// app 支付未完。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
} else {
|
||||||
|
this.$refs.uToast.show({
|
||||||
|
title: '创建订单成功',
|
||||||
|
type: 'primary',
|
||||||
|
duration: 3000
|
||||||
|
})
|
||||||
|
setTimeout(() => {
|
||||||
|
this.canPay = true
|
||||||
|
uni.reLaunch({
|
||||||
|
url: '/pages/property/coupon/payStatus?success=true'
|
||||||
|
})
|
||||||
|
}, 3000);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
console.log(res)
|
||||||
|
this.$refs.uToast.show({
|
||||||
|
title: res,
|
||||||
|
type: 'primary',
|
||||||
|
duration: 3000
|
||||||
|
})
|
||||||
|
setTimeout(() => {
|
||||||
|
this.canPay = true
|
||||||
|
uni.reLaunch({
|
||||||
|
url: '/pages/property/coupon/payStatus?success=true'
|
||||||
|
})
|
||||||
|
}, 3000);
|
||||||
|
}
|
||||||
|
}).catch(err => {
|
||||||
|
this.$refs.uToast.show({
|
||||||
|
title: err.message,
|
||||||
|
type: 'primary',
|
||||||
|
duration: 3000
|
||||||
|
})
|
||||||
|
setTimeout(res => {
|
||||||
|
this.canPay = true
|
||||||
|
}, 2000)
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
// 选择可用优惠券
|
||||||
|
selectCoupon(item) {
|
||||||
|
if (this.coupon_grant_id === item.coupon_grant_id) {
|
||||||
|
this.coupon_grant_id = ''
|
||||||
|
// this.coupon_price = ''
|
||||||
|
} else {
|
||||||
|
this.coupon_grant_id = item.coupon_grant_id
|
||||||
|
// this.coupon_price = item.price
|
||||||
|
}
|
||||||
|
this.mallBuyGoods(this.params, 'get')
|
||||||
|
this.showCouponList = false
|
||||||
|
},
|
||||||
|
// 增加库存时候触发事件
|
||||||
|
numberBoxChange(e) {
|
||||||
|
this.params.qty = e.value
|
||||||
|
this.mallBuyGoods(this.params, 'get')
|
||||||
|
},
|
||||||
|
// 选择支付方式
|
||||||
|
selectPay(id) {
|
||||||
|
if (id === '1') {
|
||||||
|
if (this.info.is_change) {
|
||||||
|
this.selectTypeId = id
|
||||||
|
} else {
|
||||||
|
this.$refs.uToast.show({
|
||||||
|
title: '当前商品不支持EB支付'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
} else if (id === '2') {
|
||||||
|
this.selectTypeId = id
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
page {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pay-select {
|
||||||
|
padding: 20rpx 30rpx;
|
||||||
|
border-top: 20rpx #f7f7f7 solid;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pay-select-item {
|
||||||
|
background-color: #fff;
|
||||||
|
padding: 30rpx;
|
||||||
|
border-bottom: solid 1rpx #f7f7f7;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
box-sizing: border-box;
|
||||||
|
|
||||||
|
.pay-left {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: flex-start;
|
||||||
|
box-sizing: border-box;
|
||||||
|
|
||||||
|
.pay-wx-title {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: flex-start;
|
||||||
|
align-items: flex-start;
|
||||||
|
box-sizing: border-box;
|
||||||
|
margin-left: 30rpx;
|
||||||
|
font-size: 28rpx;
|
||||||
|
|
||||||
|
span {
|
||||||
|
font-size: 24rpx;
|
||||||
|
color: #cacaca;
|
||||||
|
margin-top: 10rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.wx-icon {
|
||||||
|
background-color: #e93340;
|
||||||
|
border-radius: 10rpx;
|
||||||
|
padding: 10rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.ConfirmOrder {
|
||||||
|
width: 100%;
|
||||||
|
min-height: 100vh;
|
||||||
|
box-sizing: border-box;
|
||||||
|
background-color: #F7F7F7;
|
||||||
|
padding-bottom: 80rpx;
|
||||||
|
|
||||||
|
|
||||||
|
.acceptInfo {
|
||||||
|
margin: 0 30rpx;
|
||||||
|
// background-color: #fff;
|
||||||
|
box-shadow: 0 0 14rpx 4rpx rgba($color: $main-color, $alpha: 0.2);
|
||||||
|
border-radius: 20rpx;
|
||||||
|
padding: 30rpx;
|
||||||
|
position: relative;
|
||||||
|
top: -30rpx;
|
||||||
|
|
||||||
|
.name {
|
||||||
|
font-size: 36rpx;
|
||||||
|
font-weight: 600;
|
||||||
|
|
||||||
|
span {
|
||||||
|
padding-left: 20rpx;
|
||||||
|
font-size: 30rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.address {
|
||||||
|
padding: 20rpx 40rpx;
|
||||||
|
font-size: 28rpx;
|
||||||
|
|
||||||
|
span {
|
||||||
|
margin-left: 10rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.goods-info1 {
|
||||||
|
background-color: #fff;
|
||||||
|
border-top: solid 20rpx #f7f7f7;
|
||||||
|
|
||||||
|
.goods-type {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
box-sizing: border-box;
|
||||||
|
padding: 30rpx 40rpx;
|
||||||
|
color: #666;
|
||||||
|
border-bottom: solid 1rpx #f7f7f7;
|
||||||
|
}
|
||||||
|
|
||||||
|
.goods-type span {
|
||||||
|
color: #000;
|
||||||
|
}
|
||||||
|
|
||||||
|
.order-content {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 顶部信息
|
||||||
|
.top {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
padding: 20rpx 40rpx;
|
||||||
|
border-bottom: solid 1rpx #f7f7f7;
|
||||||
|
|
||||||
|
.company {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: flex-start;
|
||||||
|
box-sizing: border-box;
|
||||||
|
|
||||||
|
image {
|
||||||
|
width: 60rpx;
|
||||||
|
height: 60rpx;
|
||||||
|
border-radius: 50%;
|
||||||
|
margin-right: 20rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.name {
|
||||||
|
font-size: 30rpx;
|
||||||
|
color: #484848;
|
||||||
|
}
|
||||||
|
|
||||||
|
.no {
|
||||||
|
margin-top: 20rpx;
|
||||||
|
font-size: $title-size*0.9;
|
||||||
|
color: #999;
|
||||||
|
}
|
||||||
|
|
||||||
|
.status {
|
||||||
|
color: #999;
|
||||||
|
font-size: $title-size;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 商品信息
|
||||||
|
.goods-info {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
align-items: flex-start;
|
||||||
|
justify-content: flex-start;
|
||||||
|
box-sizing: border-box;
|
||||||
|
margin-bottom: 20rpx;
|
||||||
|
padding: 30rpx 40rpx;
|
||||||
|
|
||||||
|
.goods-img {
|
||||||
|
width: 120rpx;
|
||||||
|
height: 120rpx;
|
||||||
|
border-radius: 10rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.goods {
|
||||||
|
flex: 1;
|
||||||
|
margin-left: 20rpx;
|
||||||
|
|
||||||
|
.name {
|
||||||
|
width: 100%;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
align-items: flex-start;
|
||||||
|
justify-content: space-between;
|
||||||
|
box-sizing: border-box;
|
||||||
|
font-size: 30rpx;
|
||||||
|
// font-weight: bold;
|
||||||
|
|
||||||
|
.name1 {
|
||||||
|
width: 340rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
span {
|
||||||
|
font-size: 34rpx;
|
||||||
|
font-weight: normal;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.sku {
|
||||||
|
flex: 1;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
box-sizing: border-box;
|
||||||
|
margin-top: 10rpx;
|
||||||
|
font-size: 28rpx;
|
||||||
|
color: #999;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 合计信息
|
||||||
|
.total {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: flex-end;
|
||||||
|
box-sizing: border-box;
|
||||||
|
font-size: 28rpx;
|
||||||
|
color: #353535;
|
||||||
|
flex: 1;
|
||||||
|
text-align: right;
|
||||||
|
margin-top: 20rpx;
|
||||||
|
padding-bottom: 30rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.total-btn {
|
||||||
|
// border: solid 1rpx #f7f7f7;
|
||||||
|
padding: 10rpx 30rpx;
|
||||||
|
border-radius: 10rpx;
|
||||||
|
color: red;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 操作信息
|
||||||
|
.actions {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: flex-end;
|
||||||
|
box-sizing: border-box;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
flex: 1;
|
||||||
|
font-size: 30rpx;
|
||||||
|
color: #666;
|
||||||
|
width: 100%;
|
||||||
|
background-color: #Fff;
|
||||||
|
position: fixed;
|
||||||
|
bottom: 0;
|
||||||
|
padding: 20rpx 0;
|
||||||
|
|
||||||
|
span {
|
||||||
|
color: $main-color;
|
||||||
|
margin-right: 30rpx;
|
||||||
|
font-weight: 600;
|
||||||
|
font-size: 32rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nowPay {
|
||||||
|
padding: 20rpx 50rpx;
|
||||||
|
text-align: center;
|
||||||
|
box-sizing: border-box;
|
||||||
|
background-color: $main-color;
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 优惠券弹窗
|
||||||
|
.scrollView {
|
||||||
|
// padding: 40rpx;
|
||||||
|
box-sizing: border-box;
|
||||||
|
position: relative;
|
||||||
|
|
||||||
|
// 标题
|
||||||
|
.coupon-title {
|
||||||
|
padding: 40rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
font-size: 40rpx;
|
||||||
|
border-bottom: solid 1rpx #f7f7f7;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 优惠券样式
|
||||||
|
.coupon-list-item {
|
||||||
|
border-bottom: solid 1rpx #f7f7f7;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
box-sizing: border-box;
|
||||||
|
position: relative;
|
||||||
|
width: 100%;
|
||||||
|
|
||||||
|
.coupon-list-item {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
background-color: rgba($color: #000, $alpha: 0);
|
||||||
|
z-index: 10001;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 选择收货地址
|
||||||
|
.add-addr {
|
||||||
|
width: 100%;
|
||||||
|
background-color: #fff;
|
||||||
|
border-bottom: solid rgba($color: $main-color, $alpha:0.2) 10rpx;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
box-sizing: border-box;
|
||||||
|
padding: 0 40rpx;
|
||||||
|
|
||||||
|
.selectNew {
|
||||||
|
flex: 1;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.selectNew2 {
|
||||||
|
padding: 20rpx 0;
|
||||||
|
flex: 1;
|
||||||
|
font-size: 34rpx;
|
||||||
|
color: #353535;
|
||||||
|
|
||||||
|
span {
|
||||||
|
color: #666;
|
||||||
|
font-size: 28rpx;
|
||||||
|
margin-left: 20rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.addrs {
|
||||||
|
font-size: 26rpx;
|
||||||
|
margin-top: 10rpx;
|
||||||
|
color: #666;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -73,6 +73,9 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
categroyList: [{
|
categroyList: [{
|
||||||
|
id: '',
|
||||||
|
name: '全部'
|
||||||
|
}, {
|
||||||
id: '4',
|
id: '4',
|
||||||
name: '新到'
|
name: '新到'
|
||||||
},
|
},
|
||||||
@@ -146,6 +149,7 @@
|
|||||||
selectNav(id) {
|
selectNav(id) {
|
||||||
console.log(id)
|
console.log(id)
|
||||||
this.selectNavId = id
|
this.selectNavId = id
|
||||||
|
this.selectCategoryId = ''
|
||||||
this.getMyCoupon()
|
this.getMyCoupon()
|
||||||
},
|
},
|
||||||
selectCategory(id) {
|
selectCategory(id) {
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
<view class="Coupon">
|
<view class="Coupon">
|
||||||
<!-- 有优惠券列表 -->
|
<!-- 有优惠券列表 -->
|
||||||
<view class="coupon-content">
|
<view class="coupon-content">
|
||||||
<couponTemplate v-for="(item,index) in lists" :key='index' :item="{...item}" :action="actions" />
|
<couponTemplate v-for="(item,index) in lists" :key='index' :item="{...item}" />
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 没有优惠券列表 -->
|
<!-- 没有优惠券列表 -->
|
||||||
|
|||||||
@@ -83,7 +83,7 @@
|
|||||||
getList() {
|
getList() {
|
||||||
getCouponsInfoById(this.coupon_grant_id).then(res => {
|
getCouponsInfoById(this.coupon_grant_id).then(res => {
|
||||||
this.info = res
|
this.info = res
|
||||||
this.contentArr = res.description.replace(/\r\n/g, '<br/>').replace(/\n/g, '<br/>').split('<br/>')
|
this.contentArr =res.description? res.description.replace(/\r\n/g, '<br/>').replace(/\n/g, '<br/>').split('<br/>'):''
|
||||||
this.loaded = true
|
this.loaded = true
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
this.$refs.uToast.show({
|
this.$refs.uToast.show({
|
||||||
@@ -95,7 +95,8 @@
|
|||||||
// 点击立即购买去商品确认页面
|
// 点击立即购买去商品确认页面
|
||||||
nowBuy(items) {
|
nowBuy(items) {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url:'/pages/order/buy?qty=1&skuId='+items.goods_sku_id,
|
url: '/pages/property/coupon/confirmOrder?qty=1&type=2&goods_sku_id=' + items.goods_sku_id,
|
||||||
|
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
goDetail(id){
|
goDetail(id){
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<view style="position: relative;z-index: 3;">
|
<view style="position: relative;z-index: 3;">
|
||||||
<!-- 搜索... -->
|
<!-- 搜索... -->
|
||||||
<view class="mine-top-contant">
|
<view class="mine-top-contant">
|
||||||
<u-navbar :background="background" title="企业优惠券中心" title-color="#fff"
|
<u-navbar :background="background" back-icon-color = '#fff' title="企业优惠券中心" title-color="#fff"
|
||||||
:border-bottom='false'>
|
:border-bottom='false'>
|
||||||
</u-navbar>
|
</u-navbar>
|
||||||
<!--banner-->
|
<!--banner-->
|
||||||
|
|||||||
101
pages/property/coupon/payStatus.vue
Normal file
@@ -0,0 +1,101 @@
|
|||||||
|
<template>
|
||||||
|
<view class="PayStatus">
|
||||||
|
<image class="payStatusImg" :src="success?'/static/images/paySuccess.png':'/static/images/payFail.png'" mode="widthFix" />
|
||||||
|
<view class="payTitle">{{success?'支付成功':'支付失败'}}</view>
|
||||||
|
<view class="payDes">{{success?'您已支付完成,订单稍后配送':'吼吼,您的支付未完成'}}</view>
|
||||||
|
<view class="payBackCheck">
|
||||||
|
<!-- <view class="check" v-if='success' @click="check">查看权证</view> -->
|
||||||
|
<view class="back" @click="back">返回首页</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
success:false,// 支付失败false 支付成功true
|
||||||
|
};
|
||||||
|
},
|
||||||
|
onLoad(e) {
|
||||||
|
if(e.success === 'true'){
|
||||||
|
uni.setNavigationBarTitle({
|
||||||
|
title:'支付成功'
|
||||||
|
})
|
||||||
|
this.success=true
|
||||||
|
}else{
|
||||||
|
uni.setNavigationBarTitle({
|
||||||
|
title:'支付失败'
|
||||||
|
})
|
||||||
|
this.success=false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
check() {
|
||||||
|
uni.reLaunch({
|
||||||
|
url:'/pages/property/order/numberWeight'
|
||||||
|
})
|
||||||
|
},
|
||||||
|
back() {
|
||||||
|
uni.reLaunch({
|
||||||
|
url:'/pages/equity/index'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.PayStatus {
|
||||||
|
width: 100%;
|
||||||
|
min-height: 100vh;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: flex-start;
|
||||||
|
box-sizing: border-box;
|
||||||
|
|
||||||
|
.payStatusImg {
|
||||||
|
width: 300rpx;
|
||||||
|
padding: 50rpx 0;
|
||||||
|
margin-top: 100rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.payTitle {
|
||||||
|
font-size: 34rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
color: #353535;
|
||||||
|
}
|
||||||
|
|
||||||
|
.payDes {
|
||||||
|
font-size: 26rpx;
|
||||||
|
color: #666;
|
||||||
|
padding: 20rpx;
|
||||||
|
margin-bottom: 30rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.payBackCheck {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-around;
|
||||||
|
box-sizing: border-box;
|
||||||
|
font-size: 28rpx;
|
||||||
|
width: 100%;
|
||||||
|
|
||||||
|
.check {
|
||||||
|
border: $main-color solid 1rpx;
|
||||||
|
color: $main-color;
|
||||||
|
padding: 14rpx 50rpx;
|
||||||
|
border-radius: 4rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.back {
|
||||||
|
background-color: $main-color;
|
||||||
|
color: #fff;
|
||||||
|
padding: 14rpx 50rpx;
|
||||||
|
border-radius: 4rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -187,7 +187,7 @@
|
|||||||
|
|
||||||
.Record {
|
.Record {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100vh;
|
min-height: 100vh;
|
||||||
padding-top: 30rpx;
|
padding-top: 30rpx;
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,16 +1,17 @@
|
|||||||
<template>
|
<template>
|
||||||
<view v-if='loaded'>
|
<view v-if='loding'>
|
||||||
|
<block v-if="this.$store.state.token != ''">
|
||||||
<!-- 用户信息 -->
|
<!-- 用户信息 -->
|
||||||
<view class="user">
|
<view class="user">
|
||||||
<view class="user-tool" @click="$Router.push({name:'Setting'})">
|
<view class="user-tool" @click="$Router.push({name:'Setting'})">
|
||||||
<image src="@/static/icons/user_icon_00.png" mode="widthFix" />
|
<image src="@/static/icons/user_icon_00.png" mode="widthFix" />
|
||||||
</view>
|
</view>
|
||||||
<view class="user-content">
|
<view class="user-content">
|
||||||
<image class="info-cover" :src="base.avatar" mode="aspectFill" />
|
<image class="info-cover" :src="base.avatar || require('@/static/images/boss.png')" mode="aspectFill" />
|
||||||
<view class="info-nickname">{{base.nickname}}</view>
|
<view class="info-nickname">{{base.nickname}}</view>
|
||||||
<view class="info-signa">潮流就是我的态度</view>
|
<view class="info-signa">潮流就是我的态度</view>
|
||||||
<view class="info-tags">
|
<view class="info-tags" v-if="this.$store.state.token != ''">
|
||||||
<text class="info-tags-item identity">{{base.identity.name}}</text>
|
<text class="info-tags-item identity" v-if="base.identity">{{base.identity.name}}</text>
|
||||||
<text class="info-tags-item vip" v-if="base.company_level.name">{{base.company_level.name }}</text>
|
<text class="info-tags-item vip" v-if="base.company_level.name">{{base.company_level.name }}</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -20,7 +21,7 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<!-- 消息 -->
|
<!-- 消息 -->
|
||||||
<view class="user-ad">
|
<view class="user-ad" v-if="message.length > 0">
|
||||||
<uni-icons class="user-ad-icon" type="sound-filled" color="#e93340"></uni-icons>
|
<uni-icons class="user-ad-icon" type="sound-filled" color="#e93340"></uni-icons>
|
||||||
<swiper class="user-ad-swiper" :interval="3000" autoplay vertical circular>
|
<swiper class="user-ad-swiper" :interval="3000" autoplay vertical circular>
|
||||||
<swiper-item v-for="(item,index) in message" :key='index'>
|
<swiper-item v-for="(item,index) in message" :key='index'>
|
||||||
@@ -35,19 +36,19 @@
|
|||||||
<view class="title-text">我的资产</view>
|
<view class="title-text">我的资产</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="group-flex group-flex-4">
|
<view class="group-flex group-flex-4">
|
||||||
<view class="item" @click="showToast">
|
<view class="item" @click="$Router.push({name:'Extract'})">
|
||||||
<view class="item-num">{{base.account.token}}</view>
|
<view class="item-num">{{base.account.coins}}</view>
|
||||||
<view class="item-title">原石</view>
|
<view class="item-title">原石</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="item" @click="showToast">
|
<view class="item" @click="$Router.push({name:'Fragment'})">
|
||||||
<view class="item-num">{{base.account.contribution}}</view>
|
<view class="item-num">{{base.account.contribution}}</view>
|
||||||
<view class="item-title">贡献值</view>
|
<view class="item-title">当前贡献值</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="item" @click="$Router.push({name:'Eb'})">
|
<view class="item" @click="$Router.push({name:'Eb'})">
|
||||||
<view class="item-num">{{base.account.eb}}</view>
|
<view class="item-num">{{base.account.eb}}</view>
|
||||||
<view class="item-title">易币</view>
|
<view class="item-title">当前易币</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="item" @click="showToast">
|
<view class="item" @click="$Router.push({name:'ExtractRed'})">
|
||||||
<view class="item-num">{{base.account.money}}</view>
|
<view class="item-num">{{base.account.money}}</view>
|
||||||
<view class="item-title">零钱</view>
|
<view class="item-title">零钱</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -137,96 +138,110 @@
|
|||||||
<image class="tips" src="../../static/icons/property_icon_01.png" mode="aspectFill" />
|
<image class="tips" src="../../static/icons/property_icon_01.png" mode="aspectFill" />
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
|
||||||
<!-- 推广海报 -->
|
<!-- 推广海报 -->
|
||||||
<view class="poster-text">推广海报</view>
|
<view class="poster-text">推广海报</view>
|
||||||
|
|
||||||
<!-- <carousel :img-list="imgList" url-key="url" @selected="selectedBanner"/> -->
|
|
||||||
<view class="code">
|
<view class="code">
|
||||||
<image class="code-img-bg" src="/static/images/share_bg_3.png" mode="aspectFill" />
|
<image class="code-img-bg" src="/static/images/share_bg_3.png" mode="aspectFill" />
|
||||||
<image class='code-img' :src="shareCode" mode="widthFix" />
|
<image class='code-img' :src="shareCode" mode="widthFix" />
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
</block>
|
</block>
|
||||||
<!-- 弹窗 -->
|
|
||||||
<u-toast ref="uToast" />
|
|
||||||
<!-- 版权信息 -->
|
<!-- 版权信息 -->
|
||||||
<view class="copyright">易品新境 beta 1.0.0</view>
|
<view class="copyright">易品新境 beta 1.0.0</view>
|
||||||
|
</block>
|
||||||
|
<block v-else>
|
||||||
|
<view class="statusBar">
|
||||||
|
<view class="statusBar-title">我的资产</view>
|
||||||
|
</view>
|
||||||
|
<view class="store-login">
|
||||||
|
<image class="icon" src="@/static/icons/login-icon.png" mode="widthFix"></image>
|
||||||
|
<view class="sub-title">一键开启您的易货之旅</view>
|
||||||
|
<button type="default" @click="login">登录</button>
|
||||||
|
</view>
|
||||||
|
</block>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import carousel from '@/components/vear-carousel/vear-carousel'
|
import carousel from '@/components/vear-carousel/vear-carousel'
|
||||||
import {getUserInfo , appcode} from '@/apis/interfaces/mine'
|
import { getUserInfo , appcode } from '@/apis/interfaces/mine'
|
||||||
|
import userAuth from '@/public/userAuth'
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
carousel
|
carousel
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
tabsIndex: 0,
|
tabsIndex : 0,
|
||||||
imgList: [{
|
base : {
|
||||||
url: 'https://img9.51tietu.net/pic/2019-091200/vgkpidei2tjvgkpidei2tj.jpg',
|
avatar : '',
|
||||||
id: 1
|
nickname: '',
|
||||||
},{
|
account : {
|
||||||
url: 'https://img9.51tietu.net/pic/2019-091200/euzekmi5m23euzekmi5m23.jpg',
|
token : 0,
|
||||||
id: 2
|
contribution: 0,
|
||||||
},{
|
eb : 0,
|
||||||
url: 'https://img9.51tietu.net/pic/2019-091200/143tt0ta4sr143tt0ta4sr.jpg',
|
money : 0
|
||||||
id: 3
|
}
|
||||||
}],
|
},
|
||||||
base:'',
|
count : {
|
||||||
count:'',
|
warrnats : 0,
|
||||||
relations:'',
|
warrnat_transfer : 0,
|
||||||
message:'',
|
shipment_fuwu_count : 0,
|
||||||
loaded:false,
|
shipment_goods_count: 0
|
||||||
shareCode:''
|
},
|
||||||
|
relations : '',
|
||||||
|
message : [],
|
||||||
|
shareCode : '',
|
||||||
|
loding : false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onShow(){
|
onShow(){
|
||||||
this.getUserInfo()
|
if(this.$store.state.token != '') this.userInfo()
|
||||||
|
else this.loding = true
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
// 获取用户的基本信息
|
// 获取用户的基本信息
|
||||||
getUserInfo(){
|
userInfo(){
|
||||||
getUserInfo().then(res => {
|
Promise.all([getUserInfo(), appcode()]).then(res => {
|
||||||
this.base = res.base
|
let userInfoData = res[0],
|
||||||
this.count = res.count
|
appcodeData = res[1]
|
||||||
this.message = res.message
|
|
||||||
this.relations = res.relations
|
this.base = userInfoData.base
|
||||||
this.loaded = true
|
this.count = userInfoData.count
|
||||||
|
this.message = userInfoData.message
|
||||||
|
this.relations = userInfoData.relations
|
||||||
|
this.shareCode = appcodeData.code
|
||||||
|
this.loding = true
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
this.$refs.uToast.show({
|
console.log(err)
|
||||||
|
uni.showToast({
|
||||||
title: err.message,
|
title: err.message,
|
||||||
type: 'error',
|
icon : 'none'
|
||||||
icon:false,
|
|
||||||
duration: 3000
|
|
||||||
})
|
|
||||||
})
|
|
||||||
appcode().then(res => {
|
|
||||||
this.shareCode = res.code
|
|
||||||
}).catch(err => {
|
|
||||||
this.$refs.uToast.show({
|
|
||||||
title: err.message,
|
|
||||||
type: 'error',
|
|
||||||
icon:false,
|
|
||||||
duration: 3000
|
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
outLogin(){
|
|
||||||
this.$store.commit('setToken', '')
|
|
||||||
},
|
|
||||||
selectedBanner(item, index) {
|
|
||||||
console.log('🥒', item, index)
|
|
||||||
},
|
|
||||||
// 努力开发中,,,
|
// 努力开发中,,,
|
||||||
showToast(){
|
showToast(){
|
||||||
this.$refs.uToast.show({
|
uni.showToast({
|
||||||
title: '努力开发中',
|
title: '努力开发中',
|
||||||
type:'error',
|
icon : 'none'
|
||||||
duration: 3000
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
// 登录
|
||||||
|
login(){
|
||||||
|
let auth = new userAuth()
|
||||||
|
auth.Login().then(res => {
|
||||||
|
if(res.auth){
|
||||||
|
this.loding = false
|
||||||
|
this.userInfo()
|
||||||
|
}
|
||||||
|
}).catch(err => {
|
||||||
|
uni.showToast({
|
||||||
|
title: err.message,
|
||||||
|
icon : 'none'
|
||||||
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -234,6 +249,38 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
// 登录提示
|
||||||
|
.store-login{
|
||||||
|
position: fixed;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
width: 100vw;
|
||||||
|
height: 100vh;
|
||||||
|
z-index: 9;
|
||||||
|
background: white;
|
||||||
|
text-align: center;
|
||||||
|
@extend .vertical;
|
||||||
|
button{
|
||||||
|
margin-top: $margin*3;
|
||||||
|
display: inline-block;
|
||||||
|
width: 50%;
|
||||||
|
height: 90rpx;
|
||||||
|
line-height: 90rpx;
|
||||||
|
border-radius: $radius/2;
|
||||||
|
background: $text-price;
|
||||||
|
color: white;
|
||||||
|
font-weight: bold;
|
||||||
|
font-size: $title-size;
|
||||||
|
}
|
||||||
|
.sub-title{
|
||||||
|
color: $text-gray;
|
||||||
|
font-size: $title-size-m;
|
||||||
|
}
|
||||||
|
.icon{
|
||||||
|
width: 288rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// 退出按钮
|
// 退出按钮
|
||||||
.out-login{
|
.out-login{
|
||||||
padding: 0 $padding;
|
padding: 0 $padding;
|
||||||
@@ -524,4 +571,95 @@
|
|||||||
font-size: $title-size-sm;
|
font-size: $title-size-sm;
|
||||||
color: $text-gray-m;
|
color: $text-gray-m;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Bar
|
||||||
|
.statusBar{
|
||||||
|
position: fixed;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
width: 100%;
|
||||||
|
z-index: 99;
|
||||||
|
background: $text-price;
|
||||||
|
@extend .ios-top;
|
||||||
|
.statusBar-box{
|
||||||
|
min-height: 90rpx;
|
||||||
|
position: relative;
|
||||||
|
padding: $padding $padding $padding ($padding + 88);
|
||||||
|
color: white;
|
||||||
|
.logo{
|
||||||
|
position: absolute;
|
||||||
|
left: $padding;
|
||||||
|
width: 94rpx;
|
||||||
|
height: 94rpx;
|
||||||
|
border-radius: 50%;
|
||||||
|
border: 4rpx solid #ed8483;
|
||||||
|
box-sizing: border-box;
|
||||||
|
box-shadow: 0 4rpx 15rpx rgba(109,1,0,.8);
|
||||||
|
}
|
||||||
|
.company{
|
||||||
|
width: calc(100% - 94rpx);
|
||||||
|
padding-left: 30rpx;
|
||||||
|
box-sizing: border-box;
|
||||||
|
.name{
|
||||||
|
line-height: 40rpx;
|
||||||
|
@extend .nowrap;
|
||||||
|
font-size: $title-size;
|
||||||
|
.name-img {
|
||||||
|
width: 30rpx;
|
||||||
|
height: 30rpx;
|
||||||
|
margin: 7rpx 0 0 15rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.tool {
|
||||||
|
display: flex;
|
||||||
|
margin-top: 13rpx;
|
||||||
|
.faith{
|
||||||
|
line-height: 40rpx;
|
||||||
|
height: 38rpx;
|
||||||
|
@extend .nowrap;
|
||||||
|
font-size: 24rpx;
|
||||||
|
background-color: rgba(0,0,0,.15);
|
||||||
|
padding: 0 15rpx;
|
||||||
|
border-radius: 60rpx;
|
||||||
|
margin-right: 30rpx;
|
||||||
|
display: flex;
|
||||||
|
.faith-img {
|
||||||
|
width: 28rpx;
|
||||||
|
height: 28rpx;
|
||||||
|
margin: 5rpx 4rpx 0 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.btn{
|
||||||
|
line-height: 40rpx;
|
||||||
|
height: 38rpx;
|
||||||
|
font-size: 24rpx;
|
||||||
|
padding: 0 15rpx 0 30rpx;
|
||||||
|
background-color: #913335;
|
||||||
|
display: inline-block;
|
||||||
|
border-radius: 0 60rpx 60rpx 0;
|
||||||
|
position: relative;
|
||||||
|
text-transform: uppercase;
|
||||||
|
.btn-img {
|
||||||
|
position: absolute;
|
||||||
|
width: 38rpx;
|
||||||
|
height: 38rpx;
|
||||||
|
left: -20rpx;
|
||||||
|
top: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.statusBar-title{
|
||||||
|
line-height: 88rpx;
|
||||||
|
min-height: 88rpx;
|
||||||
|
color: white;
|
||||||
|
text-align: center;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.content{
|
||||||
|
padding-top: calc(var(--status-bar-height) + #{$padding * 2} + 65rpx);
|
||||||
|
padding-bottom: $padding;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="LogisticsIndex">
|
<view class="LogisticsIndex" v-if="loaded">
|
||||||
<block v-if="list.length>0">
|
<block v-if="list.length>0">
|
||||||
<view class="logistics-top">
|
<view class="logistics-top">
|
||||||
<view>{{express.express_name}} <span class="copy" @click='copy(express.express_no)'>复制单号</span></view>
|
<view>{{express.express_name}} <span class="copy" @click='copy(express.express_no)'>复制单号</span></view>
|
||||||
@@ -34,12 +34,15 @@
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
list: [],
|
list: [],
|
||||||
|
loaded:false,
|
||||||
no: '', // 快递单号
|
no: '', // 快递单号
|
||||||
express:{},// 地址信息
|
express:{},// 地址信息
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad(e) {
|
onLoad(e) {
|
||||||
this.no = this.$route.params.no
|
// this.no = this.$route.params.no
|
||||||
|
// this.getLogistic(this.no)
|
||||||
|
this.no = e.no
|
||||||
this.getLogistic(this.no)
|
this.getLogistic(this.no)
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
@@ -48,6 +51,7 @@
|
|||||||
console.log(res)
|
console.log(res)
|
||||||
this.list = res.logistics
|
this.list = res.logistics
|
||||||
this.express = res.express
|
this.express = res.express
|
||||||
|
this.loaded = true
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
this.$refs.uToast.show({
|
this.$refs.uToast.show({
|
||||||
title: err.message,
|
title: err.message,
|
||||||
|
|||||||
@@ -1,23 +1,13 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="OrderInfo">
|
<view class="OrderInfo" v-if="loaded">
|
||||||
<!-- 订单状态 -->
|
<!-- 订单状态 -->
|
||||||
<view class="order-status">
|
<view class="order-status">
|
||||||
<view class="info">
|
<view class="info">
|
||||||
{{info.state.text}}
|
{{state.text}}
|
||||||
<span>{{info.state.remark}}</span>
|
<span>{{state.remark}}</span>
|
||||||
</view>
|
</view>
|
||||||
<image src="/static/imgs/fire.png" mode="widthFix"></image>
|
<image src="/static/imgs/fire.png" mode="widthFix"></image>
|
||||||
</view>
|
</view>
|
||||||
<!-- 收货人 -->
|
|
||||||
<view class="acceptInfo" v-if="type === '2'">
|
|
||||||
<block>
|
|
||||||
<view class="name">{{address.name}} <span>{{address.mobile}}</span> </view>
|
|
||||||
<view class="address">
|
|
||||||
<u-icon name="map" color="red"></u-icon>
|
|
||||||
<span>{{address.full_address}}</span>
|
|
||||||
</view>
|
|
||||||
</block>
|
|
||||||
</view>
|
|
||||||
|
|
||||||
<view class="goods-info1">
|
<view class="goods-info1">
|
||||||
<view class="top">
|
<view class="top">
|
||||||
@@ -41,7 +31,7 @@
|
|||||||
<view class="sku">权证个数 <span>x {{info.qty}}</span> </view>
|
<view class="sku">权证个数 <span>x {{info.qty}}</span> </view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<navigator class="total" hover-class="none" :url='"/pages/goods/detail?id="+info.goods_sku.goods_id'>
|
<navigator class="total" hover-class="none" :url='"/pages/goods/details?id="+info.goods_sku.goods_id'>
|
||||||
<view class="total-btn">再次购买</view>
|
<view class="total-btn">再次购买</view>
|
||||||
</navigator>
|
</navigator>
|
||||||
<view class="goods-type">创建退货时间 <span>{{info.created_at}}</span></view>
|
<view class="goods-type">创建退货时间 <span>{{info.created_at}}</span></view>
|
||||||
@@ -73,7 +63,7 @@
|
|||||||
<view :class="['dian',index === 0 ?'dian-active':'']"></view>
|
<view :class="['dian',index === 0 ?'dian-active':'']"></view>
|
||||||
<view :class="['content',index === 0?'content-active':'']">
|
<view :class="['content',index === 0?'content-active':'']">
|
||||||
<view class="title">{{item.state_text?item.state_text:'当前状态不明确,需后台返回'}}</view>
|
<view class="title">{{item.state_text?item.state_text:'当前状态不明确,需后台返回'}}</view>
|
||||||
<view class="des">退货原因:{{item.title || '无理由'}} ; 退货备注:{{item.remark || '无备注'}}</view>
|
<view class="des">原因:{{item.title || '无理由'}} ; 备注:{{item.remark || '无备注'}}</view>
|
||||||
<view class="pictures">
|
<view class="pictures">
|
||||||
<image @click="priveImg(index,idx)" v-for="(it,idx) in item.pictures" :key='idx' :src="it" mode="aspectFill" />
|
<image @click="priveImg(index,idx)" v-for="(it,idx) in item.pictures" :key='idx' :src="it" mode="aspectFill" />
|
||||||
</view>
|
</view>
|
||||||
@@ -101,16 +91,20 @@
|
|||||||
return {
|
return {
|
||||||
info: {},
|
info: {},
|
||||||
qty: 1,
|
qty: 1,
|
||||||
|
state:{},
|
||||||
refund_id: '', // 退货单no
|
refund_id: '', // 退货单no
|
||||||
company: '',
|
company: '',
|
||||||
number: '',
|
number: '',
|
||||||
logs: [],
|
logs: [],
|
||||||
|
loaded:false,
|
||||||
showLogs: false // 默认不显示记录信息
|
showLogs: false // 默认不显示记录信息
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
onLoad(e) {
|
onLoad(e) {
|
||||||
this.refund_id = this.$route.params.no
|
// this.refund_id = this.$route.params.no
|
||||||
this.getInfo(this.refund_id)
|
// this.getInfo(this.refund_id)
|
||||||
|
this.refund_id = e.no
|
||||||
|
this.getInfo(e.no)
|
||||||
},
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
if (uni.getStorageSync('refresh')) {
|
if (uni.getStorageSync('refresh')) {
|
||||||
@@ -123,6 +117,8 @@
|
|||||||
mallRefundsInfo(refund_id).then(res => {
|
mallRefundsInfo(refund_id).then(res => {
|
||||||
this.info = res
|
this.info = res
|
||||||
this.logs = res.log
|
this.logs = res.log
|
||||||
|
this.state = res.state
|
||||||
|
this.loaded = true
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
this.$refs.uToast.show({
|
this.$refs.uToast.show({
|
||||||
title: err.message,
|
title: err.message,
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="NumberWeight">
|
<view class="mallShipments">
|
||||||
<!-- 订单分类 -->
|
<!-- 订单分类 -->
|
||||||
<view class="nav">
|
<view class="nav">
|
||||||
<view :class="['nav-item' ,selectTypeId === item.id?'nav-item-selected':'']"
|
<view :class="['nav-item' ,selectTypeId === item.id?'nav-item-selected':'']"
|
||||||
@@ -314,39 +314,51 @@
|
|||||||
|
|
||||||
// 申请退货
|
// 申请退货
|
||||||
nowRefund(no) {
|
nowRefund(no) {
|
||||||
this.$router.push({
|
// this.$Router.push({
|
||||||
name: 'MallShipmentsRefund',
|
// name: 'MallShipmentsRefund',
|
||||||
params: {
|
// params: {
|
||||||
no: no
|
// no: no
|
||||||
}
|
// }
|
||||||
|
// })
|
||||||
|
uni.navigateTo({
|
||||||
|
url:'/pages/property/order/mallShipmentsRefund?no='+no
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
// 查看物流
|
// 查看物流
|
||||||
nowLogistics(no) {
|
nowLogistics(no) {
|
||||||
this.$router.push({
|
// this.$Router.push({
|
||||||
name: 'Orderlogistics',
|
// name: 'Orderlogistics',
|
||||||
params: {
|
// params: {
|
||||||
no: no
|
// no: no
|
||||||
}
|
// }
|
||||||
|
// })
|
||||||
|
uni.navigateTo({
|
||||||
|
url:'/pages/property/order/logistics?no='+no
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
// 查看详情
|
// 查看详情
|
||||||
goDetail(no) {
|
goDetail(no) {
|
||||||
this.$router.push({
|
// this.$Router.push({
|
||||||
name: 'MallShipmentsInfo',
|
// name: 'MallShipmentsInfo',
|
||||||
params: {
|
// query:{
|
||||||
no: no
|
// no:no
|
||||||
}
|
// }
|
||||||
|
// })
|
||||||
|
uni.navigateTo({
|
||||||
|
url:'/pages/property/order/mallShipmentsInfo?no='+no
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
// 查看退货单详情
|
// 查看退货单详情
|
||||||
// 查看详情
|
// 查看详情
|
||||||
goDetail1(no){
|
goDetail1(no){
|
||||||
this.$router.push({
|
// this.$Router.push({
|
||||||
name: 'MallRefundsInfo',
|
// name: 'MallRefundsInfo',
|
||||||
params:{
|
// params:{
|
||||||
no:no
|
// no:no
|
||||||
}
|
// }
|
||||||
|
// })
|
||||||
|
uni.navigateTo({
|
||||||
|
url:'/pages/property/order/mallRefundsInfo?no='+no
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -360,7 +372,7 @@
|
|||||||
height: 100%;
|
height: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.NumberWeight {
|
.mallShipments {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
min-height: 100vh;
|
min-height: 100vh;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="OrderInfo">
|
<view class="OrderInfo" v-if="loaded">
|
||||||
<!-- 订单状态 -->
|
<!-- 订单状态 -->
|
||||||
<view class="order-status">
|
<view class="order-status">
|
||||||
<view class="info">
|
<view class="info">
|
||||||
@@ -41,7 +41,7 @@
|
|||||||
<view class="sku">权证个数 <span>x {{info.qty}}</span> </view>
|
<view class="sku">权证个数 <span>x {{info.qty}}</span> </view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<navigator class="total" hover-class="none" :url='"/pages/goods/detail?id="+info.goods_sku.goods_id'>
|
<navigator class="total" hover-class="none" :url='"/pages/goods/details?id="+info.goods_sku.goods_id'>
|
||||||
<view class="total-btn">再次购买</view>
|
<view class="total-btn">再次购买</view>
|
||||||
</navigator>
|
</navigator>
|
||||||
<view class="goods-type">创建提货单时间 <span>{{info.created_at}}</span></view>
|
<view class="goods-type">创建提货单时间 <span>{{info.created_at}}</span></view>
|
||||||
@@ -106,11 +106,12 @@
|
|||||||
store_Name:'',// 门店名称
|
store_Name:'',// 门店名称
|
||||||
qty :1,
|
qty :1,
|
||||||
shipment_no:'', // 提货单no
|
shipment_no:'', // 提货单no
|
||||||
|
loaded:false
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
onLoad(e) {
|
onLoad(e) {
|
||||||
this.shipment_no = this.$route.params.no
|
this.shipment_no = e.no
|
||||||
this.getInfo(this.$route.params.no)
|
this.getInfo(e.no)
|
||||||
},
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
if(uni.getStorageSync('refresh')){
|
if(uni.getStorageSync('refresh')){
|
||||||
@@ -123,6 +124,7 @@
|
|||||||
this.info = res
|
this.info = res
|
||||||
this.address = res.express
|
this.address = res.express
|
||||||
this.type = res.type+''
|
this.type = res.type+''
|
||||||
|
this.loaded = true
|
||||||
}).catch(err=>{
|
}).catch(err=>{
|
||||||
this.$refs.uToast.show({
|
this.$refs.uToast.show({
|
||||||
title: err.message,
|
title: err.message,
|
||||||
|
|||||||
@@ -78,8 +78,11 @@
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
onLoad(e) {
|
onLoad(e) {
|
||||||
this.shipment_no = this.$route.params.no
|
|
||||||
this.getInfo(this.shipment_no)
|
// this.shipment_no = this.$route.params.no
|
||||||
|
// this.getInfo(this.shipment_no)
|
||||||
|
this.shipment_no = e.no
|
||||||
|
this.getInfo(e.no)
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
// 预览上传图片
|
// 预览上传图片
|
||||||
@@ -154,7 +157,7 @@
|
|||||||
title: this.title,
|
title: this.title,
|
||||||
shipment_no: this.shipment_no,
|
shipment_no: this.shipment_no,
|
||||||
remark: this.remark,
|
remark: this.remark,
|
||||||
pictures: JSON.stringify(this.pictures.path)
|
pictures:this.pictures.path
|
||||||
}
|
}
|
||||||
if (data.title === '') {
|
if (data.title === '') {
|
||||||
this.$refs.uToast.show({
|
this.$refs.uToast.show({
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="OrderInfo">
|
<view class="OrderInfo" v-if="loaded">
|
||||||
<!-- 订单状态 -->
|
<!-- 订单状态 -->
|
||||||
<view class="order-status">
|
<view class="order-status">
|
||||||
<view class="info">
|
<view class="info">
|
||||||
@@ -45,7 +45,7 @@
|
|||||||
<view class="sku">可提个数 <span>x {{account.balance}}</span> </view>
|
<view class="sku">可提个数 <span>x {{account.balance}}</span> </view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<navigator class="total" hover-class="none" :url='"/pages/goods/detail?id="+goods.goods_id'>
|
<navigator class="total" hover-class="none" :url='"/pages/goods/details?id="+goods.goods_id'>
|
||||||
<view class="total-btn">再次购买</view>
|
<view class="total-btn">再次购买</view>
|
||||||
</navigator>
|
</navigator>
|
||||||
<view class="goods-type" v-if="type === '1'">运费 <span>免邮</span></view>
|
<view class="goods-type" v-if="type === '1'">运费 <span>免邮</span></view>
|
||||||
@@ -147,7 +147,8 @@
|
|||||||
store_Name: '', // 门店名称
|
store_Name: '', // 门店名称
|
||||||
qty: 1,
|
qty: 1,
|
||||||
showCode:false,
|
showCode:false,
|
||||||
showCodeImg:''
|
showCodeImg:'',
|
||||||
|
loaded:false
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
onLoad(e) {
|
onLoad(e) {
|
||||||
@@ -176,6 +177,7 @@
|
|||||||
this.stores = res.stores
|
this.stores = res.stores
|
||||||
this.qty = res.account.balance
|
this.qty = res.account.balance
|
||||||
this.type = res.logistic_type + ''
|
this.type = res.logistic_type + ''
|
||||||
|
this.loaded = true
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
this.$refs.uToast.show({
|
this.$refs.uToast.show({
|
||||||
title: err.message,
|
title: err.message,
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
<span>修改头像</span>
|
<span>修改头像</span>
|
||||||
</view>
|
</view>
|
||||||
<view class="avatar" >
|
<view class="avatar" >
|
||||||
<image :src="avatar.showPath" mode="aspectFill" />
|
<image :src="avatar.showPath || require('@/static/images/boss.png')" mode="aspectFill" />
|
||||||
<u-icon name="arrow-right" color="#f1f1f1" size="28"></u-icon>
|
<u-icon name="arrow-right" color="#f1f1f1" size="28"></u-icon>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -25,16 +25,12 @@
|
|||||||
<view @click="loginOut" class="list-item">
|
<view @click="loginOut" class="list-item">
|
||||||
<view class="list-item-left">
|
<view class="list-item-left">
|
||||||
<image src="/static/images/reset-info.png" mode="widthFix" />
|
<image src="/static/images/reset-info.png" mode="widthFix" />
|
||||||
<span>切换账户</span>
|
<span>退出登录</span>
|
||||||
</view>
|
</view>
|
||||||
<u-icon name="arrow-right" color="#f1f1f1" size="28"></u-icon>
|
<u-icon name="arrow-right" color="#f1f1f1" size="28"></u-icon>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<!-- 底部banner -->
|
|
||||||
|
|
||||||
<!-- <u-toast ref="uToast" /> -->
|
|
||||||
<u-toast ref="uToast" />
|
<u-toast ref="uToast" />
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -81,14 +77,16 @@
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
loginOut() {
|
loginOut() {
|
||||||
uni.removeStorageSync('token')
|
this.$store.commit('setToken', '')
|
||||||
uni.reLaunch({
|
this.$Router.replaceAll({name: 'Equity'})
|
||||||
url: '/pages/login/login'
|
|
||||||
})
|
|
||||||
},
|
},
|
||||||
// 上传头像
|
// 上传头像
|
||||||
updImgs(type) {
|
updImgs(type) {
|
||||||
uni.chooseImage({
|
uni.chooseImage({
|
||||||
|
crop: {
|
||||||
|
width: 80,
|
||||||
|
height: 80
|
||||||
|
},
|
||||||
success: res => {
|
success: res => {
|
||||||
let path = res.tempFiles.map((val, index) => {
|
let path = res.tempFiles.map((val, index) => {
|
||||||
return {
|
return {
|
||||||
@@ -166,7 +164,6 @@
|
|||||||
margin: 0 40rpx;
|
margin: 0 40rpx;
|
||||||
padding: 30rpx 0;
|
padding: 30rpx 0;
|
||||||
width: calc(100% - 80rpx);
|
width: calc(100% - 80rpx);
|
||||||
|
|
||||||
button::after {
|
button::after {
|
||||||
border: none;
|
border: none;
|
||||||
background-color: none;
|
background-color: none;
|
||||||
|
|||||||
@@ -21,8 +21,6 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
|
||||||
<canvas class="codeImg" canvas-id="qrcodeCard"></canvas>
|
<canvas class="codeImg" canvas-id="qrcodeCard"></canvas>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
@@ -68,6 +66,8 @@
|
|||||||
})
|
})
|
||||||
|
|
||||||
Promise.all([avatarImg, codeImg]).then(res => {
|
Promise.all([avatarImg, codeImg]).then(res => {
|
||||||
|
console.log(res[0],'0')
|
||||||
|
console.log(res[1],'1')
|
||||||
// 绘制海报
|
// 绘制海报
|
||||||
const ctx = uni.createCanvasContext('qrcodeCard')
|
const ctx = uni.createCanvasContext('qrcodeCard')
|
||||||
ctx.save()
|
ctx.save()
|
||||||
|
|||||||
@@ -258,6 +258,7 @@
|
|||||||
},
|
},
|
||||||
// 添加展示模块
|
// 添加展示模块
|
||||||
addModule(){
|
addModule(){
|
||||||
|
console.log('添加模板,,,,')
|
||||||
let modulesList = this.modulesType.map(val => {
|
let modulesList = this.modulesType.map(val => {
|
||||||
return val.value
|
return val.value
|
||||||
})
|
})
|
||||||
@@ -407,6 +408,8 @@
|
|||||||
color: $text-price;
|
color: $text-price;
|
||||||
background: white;
|
background: white;
|
||||||
margin-top: $margin;
|
margin-top: $margin;
|
||||||
|
position: relative;
|
||||||
|
z-index: 10;
|
||||||
.icon{
|
.icon{
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
margin-right: $margin/3;
|
margin-right: $margin/3;
|
||||||
|
|||||||
@@ -8,12 +8,10 @@
|
|||||||
</scroll-view>
|
</scroll-view>
|
||||||
|
|
||||||
<!-- 订单列表 -->
|
<!-- 订单列表 -->
|
||||||
<store-order v-if="returnInfo.length > 0" :list="returnInfo" listType="deliver" />
|
<store-order :list="returnInfo" listType="deliver" />
|
||||||
|
|
||||||
<view v-else class="pack-center">
|
<!-- 分页 -->
|
||||||
<image src="../../static/icons/order-null.png"></image>
|
<uni-load-more :status="pageStatus" :iconSize="16" v-if="returnInfo.length > 0"></uni-load-more>
|
||||||
<view>您还没有相关订单</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -26,7 +24,7 @@
|
|||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
returnInfo : '' ,// 列表
|
returnInfo : [] ,// 列表
|
||||||
navList : [{
|
navList : [{
|
||||||
name : '待发货',
|
name : '待发货',
|
||||||
state : '1'
|
state : '1'
|
||||||
@@ -41,7 +39,11 @@
|
|||||||
state : '4'
|
state : '4'
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
selectNavId : '1'
|
selectNavId : '1',
|
||||||
|
|
||||||
|
// 分页
|
||||||
|
pageStatus : '',
|
||||||
|
page : 1
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
@@ -53,9 +55,16 @@
|
|||||||
methods: {
|
methods: {
|
||||||
// 退货单列表
|
// 退货单列表
|
||||||
returnData(){
|
returnData(){
|
||||||
storeDeliver(this.selectNavId).then(res=>{
|
storeDeliver({
|
||||||
console.log(res)
|
state: this.selectNavId,
|
||||||
this.returnInfo = res.data
|
page : this.goodsPage
|
||||||
|
}).then(res=>{
|
||||||
|
if(res.page.current === 1){
|
||||||
|
this.returnInfo = []
|
||||||
|
}
|
||||||
|
this.returnInfo = this.returnInfo.concat(res.data)
|
||||||
|
this.goodsPage = res.page.current
|
||||||
|
this.pageStatus = res.page.has_more ? 'more': 'noMore'
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -92,6 +101,18 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
// 下拉加载
|
||||||
|
onReachBottom() {
|
||||||
|
if(this.pageStatus == 'more'){
|
||||||
|
this.pageStatus = 'loading'
|
||||||
|
if(this.selectNavId === '1') {
|
||||||
|
this.goodsPage += 1
|
||||||
|
// 获取退货单列表
|
||||||
|
this.returnData();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,6 +12,11 @@
|
|||||||
<view class="sub-title">{{appliesState.message}}</view>
|
<view class="sub-title">{{appliesState.message}}</view>
|
||||||
<button type="default" @click="onRightBtn">认证并开通</button>
|
<button type="default" @click="onRightBtn">认证并开通</button>
|
||||||
</block>
|
</block>
|
||||||
|
<block v-if="appliesState.code === -2">
|
||||||
|
<image class="icon" src="@/static/icons/approve-icon.png" mode="widthFix"></image>
|
||||||
|
<view class="sub-title">{{appliesState.message}}</view>
|
||||||
|
<button type="default" @click="onRightBtn1">企业未注册</button>
|
||||||
|
</block>
|
||||||
<block v-else-if="appliesState.code === 2">
|
<block v-else-if="appliesState.code === 2">
|
||||||
<image class="icon" src="@/static/icons/approve-icon.png" mode="widthFix"></image>
|
<image class="icon" src="@/static/icons/approve-icon.png" mode="widthFix"></image>
|
||||||
<view class="title">认证失败</view>
|
<view class="title">认证失败</view>
|
||||||
@@ -29,7 +34,7 @@
|
|||||||
<view class="statusBar-box">
|
<view class="statusBar-box">
|
||||||
<image class="logo" :src="company.logo" mode="aspectFill"></image>
|
<image class="logo" :src="company.logo" mode="aspectFill"></image>
|
||||||
<view class="company">
|
<view class="company">
|
||||||
<view class="name">{{company.name}}<image @click="$Router.push({name: 'Basics'})" class="name-img" src="../../static/icons/store_icon_pen.png" mode="aspectFill"></image></view>
|
<view class="name">{{company.name}}<image v-if="!employee" @click="$Router.push({name: 'Basics'})" class="name-img" src="../../static/icons/store_icon_pen.png" mode="aspectFill"></image></view>
|
||||||
<view class="tool">
|
<view class="tool">
|
||||||
<view class="faith"><image class="faith-img" src="../../static/icons/store_icon_row.png" mode="aspectFill"></image>诚信{{company.faith}}</view>
|
<view class="faith"><image class="faith-img" src="../../static/icons/store_icon_row.png" mode="aspectFill"></image>诚信{{company.faith}}</view>
|
||||||
<view class="btn"><image class="btn-img" src="../../static/icons/store_icon_icon.png" mode="aspectFill"></image>{{company.identity}}</view>
|
<view class="btn"><image class="btn-img" src="../../static/icons/store_icon_icon.png" mode="aspectFill"></image>{{company.identity}}</view>
|
||||||
@@ -166,6 +171,10 @@
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
},
|
||||||
|
// 跳转到创建企业选择企业类型的页面
|
||||||
|
onRightBtn1(){
|
||||||
|
this.$Router.push({name: 'Registered'})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -226,6 +235,7 @@
|
|||||||
border: 4rpx solid #ed8483;
|
border: 4rpx solid #ed8483;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
box-shadow: 0 4rpx 15rpx rgba(109,1,0,.8);
|
box-shadow: 0 4rpx 15rpx rgba(109,1,0,.8);
|
||||||
|
background-color: #fff;
|
||||||
}
|
}
|
||||||
.company{
|
.company{
|
||||||
width: calc(100% - 94rpx);
|
width: calc(100% - 94rpx);
|
||||||
|
|||||||
@@ -2,67 +2,85 @@
|
|||||||
<view>
|
<view>
|
||||||
<!-- 订单分类 -->
|
<!-- 订单分类 -->
|
||||||
<scroll-view class="nav" scroll-x="true" scroll-with-animation="true">
|
<scroll-view class="nav" scroll-x="true" scroll-with-animation="true">
|
||||||
<view :class="['nav-item', selectNavId === item.id ? 'nav-item-selected':'']" v-for="(item,index) in navList" :key="index" @click="selectNav(item.id)">
|
<view :class="['nav-item', selectNavId === item.id ? 'nav-item-selected':'']"
|
||||||
|
v-for="(item,index) in navList" :key="index" @click="selectNav(item.id)">
|
||||||
{{item.name}}
|
{{item.name}}
|
||||||
</view>
|
</view>
|
||||||
</scroll-view>
|
</scroll-view>
|
||||||
|
|
||||||
<!-- 订单列表 -->
|
<!-- 订单列表 -->
|
||||||
<store-order v-if="returnInfo.length > 0" :list="returnInfo" />
|
<store-order :list="returnInfo" @goSign="goSign" @goReToken="goReToken" />
|
||||||
|
|
||||||
<view v-else class="pack-center">
|
<!-- 分页 -->
|
||||||
<image src="../../static/icons/order-null.png"></image>
|
<uni-load-more :status="pageStatus" :iconSize="16" v-if="returnInfo.length > 0"></uni-load-more>
|
||||||
<view>您还没有相关订单</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { storeReturn, storeSign, storeToken } from '@/apis/interfaces/store'
|
import {
|
||||||
|
storeReturn,
|
||||||
|
storeSign,
|
||||||
|
storeToken
|
||||||
|
} from '@/apis/interfaces/store'
|
||||||
import storeOrder from '@/components/store-order/store-order'
|
import storeOrder from '@/components/store-order/store-order'
|
||||||
export default {
|
export default {
|
||||||
comments:{
|
comments: {
|
||||||
storeOrder
|
storeOrder
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
returnInfo : '' ,// 列表
|
returnInfo: [], // 列表
|
||||||
navList : [{
|
navList: [{
|
||||||
name : '待审核',
|
name: '待审核',
|
||||||
id : 'apply'
|
id: 'apply'
|
||||||
},{
|
}, {
|
||||||
name : '待返货',
|
name: '已驳回',
|
||||||
id : 'deliver'
|
id: 'refuse'
|
||||||
},{
|
}, {
|
||||||
name : '待签收',
|
name: '待返货',
|
||||||
id : 'delivered'
|
id: 'deliver'
|
||||||
},{
|
}, {
|
||||||
name : '已签收',
|
name: '待签收',
|
||||||
id : 'signed'
|
id: 'delivered'
|
||||||
|
},
|
||||||
|
// {
|
||||||
|
// name: '已签收',
|
||||||
|
// id: 'signed'
|
||||||
|
// },
|
||||||
|
{
|
||||||
|
name: '待确认退货',
|
||||||
|
id: 'process'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name : '待确认退货',
|
name: '完成退货',
|
||||||
id : 'process'
|
id: 'completed'
|
||||||
},
|
|
||||||
{
|
|
||||||
name : '完成退货',
|
|
||||||
id : 'completed'
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
selectNavId : 'apply'
|
selectNavId: 'apply',
|
||||||
|
|
||||||
|
// 分页
|
||||||
|
pageStatus: '',
|
||||||
|
page: 1
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {},
|
||||||
},
|
|
||||||
onShow() {
|
onShow() {
|
||||||
// 获取退货单列表
|
// 获取退货单列表
|
||||||
this.returnData();
|
this.returnData();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
// 退货单列表
|
// 退货单列表
|
||||||
returnData(){
|
returnData() {
|
||||||
storeReturn(this.selectNavId).then(res=>{
|
storeReturn({
|
||||||
this.returnInfo = res.data
|
state: this.selectNavId,
|
||||||
|
page: this.goodsPage
|
||||||
|
}).then(res => {
|
||||||
|
if (res.page.current === 1) {
|
||||||
|
this.returnInfo = []
|
||||||
|
}
|
||||||
|
this.returnInfo = this.returnInfo.concat(res.data)
|
||||||
|
this.goodsPage = res.page.current
|
||||||
|
this.pageStatus = res.page.has_more ? 'more' : 'noMore'
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -75,19 +93,23 @@
|
|||||||
},
|
},
|
||||||
|
|
||||||
// 签收订单
|
// 签收订单
|
||||||
goSign(orderNo,index) {
|
goSign(info) {
|
||||||
|
console.log('goSign',info)
|
||||||
|
let id = info.id
|
||||||
|
let index = info.index
|
||||||
uni.showModal({
|
uni.showModal({
|
||||||
title: '是否签收此订单?',
|
title: '是否签收此订单?',
|
||||||
success: res => {
|
success: res => {
|
||||||
if(res.confirm) {
|
if (res.confirm) {
|
||||||
storeSign(orderNo).then(() => {
|
storeSign(id).then(() => {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
icon: 'none',
|
icon: 'none',
|
||||||
title: '签收成功'
|
title: '签收成功'
|
||||||
})
|
})
|
||||||
setTimeout(()=>{
|
setTimeout(() => {
|
||||||
this.returnData()
|
this.returnInfo.splice(index,1)
|
||||||
},3000)
|
// this.returnData()
|
||||||
|
}, 500)
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
icon: 'none',
|
icon: 'none',
|
||||||
@@ -100,19 +122,22 @@
|
|||||||
},
|
},
|
||||||
|
|
||||||
// 确认退货
|
// 确认退货
|
||||||
goReToken(orderNo,index) {
|
goReToken(info) {
|
||||||
|
let id = info.id
|
||||||
|
let index = info.index
|
||||||
uni.showModal({
|
uni.showModal({
|
||||||
title: '是否确认退货此订单?',
|
title: '是否确认退货此订单?',
|
||||||
success: res => {
|
success: res => {
|
||||||
if(res.confirm) {
|
if (res.confirm) {
|
||||||
storeToken(orderNo).then(() => {
|
storeToken(id).then(() => {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
icon: 'none',
|
icon: 'none',
|
||||||
title: '退货成功'
|
title: '退货成功'
|
||||||
})
|
})
|
||||||
setTimeout(()=>{
|
setTimeout(() => {
|
||||||
this.returnData()
|
// this.returnData()
|
||||||
},3000)
|
this.returnInfo.splice(index,1)
|
||||||
|
}, 500)
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
icon: 'none',
|
icon: 'none',
|
||||||
@@ -122,6 +147,18 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
// 下拉加载
|
||||||
|
onReachBottom() {
|
||||||
|
if (this.pageStatus == 'more') {
|
||||||
|
this.pageStatus = 'loading'
|
||||||
|
if (this.tabIndex === 'apply') {
|
||||||
|
this.goodsPage += 1
|
||||||
|
// 获取退货单列表
|
||||||
|
this.returnData();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -143,29 +180,17 @@
|
|||||||
position: sticky;
|
position: sticky;
|
||||||
top: 0rpx;
|
top: 0rpx;
|
||||||
z-index: 1;
|
z-index: 1;
|
||||||
|
|
||||||
.nav-item {
|
.nav-item {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
border-bottom: solid 4rpx #fff;
|
border-bottom: solid 4rpx #fff;
|
||||||
padding: 30rpx 10rpx;
|
padding: 30rpx 10rpx;
|
||||||
margin-right: 10rpx;
|
margin-right: 10rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.nav-item-selected {
|
.nav-item-selected {
|
||||||
border-bottom: solid 4rpx $main-color;
|
border-bottom: solid 4rpx $main-color;
|
||||||
color: $main-color;
|
color: $main-color;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 暂无订单
|
|
||||||
.pack-center {
|
|
||||||
text-align: center;
|
|
||||||
font-size: $title-size-sm;
|
|
||||||
color: $text-gray;
|
|
||||||
padding-top: 50%;
|
|
||||||
image {
|
|
||||||
width: $uni-img-size-lg * 2;
|
|
||||||
height:$uni-img-size-lg * 2;
|
|
||||||
border-radius: $uni-border-radius-circle;
|
|
||||||
margin-bottom: $margin;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -434,7 +434,7 @@
|
|||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
|
|
||||||
.title {
|
.title {
|
||||||
width: 520rpx;
|
width: 500rpx;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
font-size: 30rpx;
|
font-size: 30rpx;
|
||||||
margin-left: 12rpx;
|
margin-left: 12rpx;
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
<template>
|
<template>
|
||||||
<!-- v-if="!loding" -->
|
|
||||||
<view class="content">
|
<view class="content">
|
||||||
<swiper class="vip-container" previous-margin="45rpx" next-margin="45rpx" circular @change="swiperChange">
|
<swiper class="vip-container" previous-margin="45rpx" next-margin="45rpx" circular @change="swiperChange">
|
||||||
<swiper-item class="swiper-item" v-for="(item, index) in identities" :key="index">
|
<swiper-item class="swiper-item" v-for="(item, index) in identities" :key="index">
|
||||||
|
<image class="swiper-item-bg" src="/static/imgs/account-bg.png" mode="widthFix" />
|
||||||
<view class="vip-item" :class="tabsIndex == index ? 'color-item-img' : ''">
|
<view class="vip-item" :class="tabsIndex == index ? 'color-item-img' : ''">
|
||||||
<view class="vip-top">
|
<view class="vip-top">
|
||||||
<view class="vip-name">
|
<view :class="tabsIndex == index ? 'vip-name' : 'vip-name1'">
|
||||||
<image class="vip-name-icon" src="../../static/icons/vip_icon.png" mode="aspectFill"></image>
|
<image class="vip-name-icon" src="../../static/icons/vip_icon.png" mode="aspectFill" />
|
||||||
{{item.name}}
|
{{item.name}}
|
||||||
</view>
|
</view>
|
||||||
<view class="vip-price">
|
<view class="vip-price">
|
||||||
@@ -96,45 +96,6 @@
|
|||||||
</view>
|
</view>
|
||||||
</button>
|
</button>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 会员类型 -->
|
|
||||||
<!-- <view class="tabs">
|
|
||||||
<view class="item" :class="{'show': index === tabsIndex}" v-for="(item, index) in identities" :key="index" @click="onTabs(index)">{{item.name}}</view>
|
|
||||||
</view> -->
|
|
||||||
<!-- 会员信息 -->
|
|
||||||
<!-- <view class="cards">
|
|
||||||
<view class="card">
|
|
||||||
<view class="card-content">
|
|
||||||
<image class="cover" src="@/static/dev/good_cover_01.png" mode="aspectFill"></image>
|
|
||||||
<view class="user nowrap">{{user.username}}</view>
|
|
||||||
<view class="sub-time nowrap">{{user.identity.name}}至{{user.identity.ended_at}}</view>
|
|
||||||
<view class="btn" @click="openOrder">开通/续费</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="cards-back"></view>
|
|
||||||
<image class="cards-angle" src="@/static/imgs/vip-angle-back.png" mode="widthFix"></image>
|
|
||||||
</view> -->
|
|
||||||
<!-- 会员权限 -->
|
|
||||||
<!-- <view class="privilege">
|
|
||||||
<view class="title">开通会员享特权</view>
|
|
||||||
<view class="privilege-box">
|
|
||||||
<view class="item" v-for="(item, index) in rights" :key="index" @click="showRemark(item.name, item.remark)">
|
|
||||||
<image class="icon" :src="item.cover" mode="aspectFill"></image>
|
|
||||||
<view class="text">{{item.name}}</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view> -->
|
|
||||||
<!-- 会员 -->
|
|
||||||
<!-- <view class="footer">
|
|
||||||
<button class="footer-btn" type="default" @click="openOrder">¥{{identities[tabsIndex].price}}/年 开通</button>
|
|
||||||
</view> -->
|
|
||||||
<!-- 会员服务信息 -->
|
|
||||||
<!-- <view class="notice">
|
|
||||||
<view class="title">开通须知</view>
|
|
||||||
<view class="item">
|
|
||||||
<text>{{description}}</text>
|
|
||||||
</view>
|
|
||||||
</view> -->
|
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -160,6 +121,7 @@
|
|||||||
created() {
|
created() {
|
||||||
// 获取当前用户信息
|
// 获取当前用户信息
|
||||||
identities().then(res => {
|
identities().then(res => {
|
||||||
|
console.log(res)
|
||||||
this.loding = false
|
this.loding = false
|
||||||
this.user = res.user
|
this.user = res.user
|
||||||
this.description= res.description
|
this.description= res.description
|
||||||
@@ -177,19 +139,13 @@
|
|||||||
this.totalData(2);
|
this.totalData(2);
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
// 切换开通身份
|
|
||||||
// onTabs(index){
|
|
||||||
// if(this.tabsIndex === index) return
|
|
||||||
// this.tabsIndex = index
|
|
||||||
// this.rights = this.identities[index].rights
|
|
||||||
// },
|
|
||||||
|
|
||||||
// 切换开通身份
|
// 切换开通身份
|
||||||
swiperChange(e) {
|
swiperChange(e) {
|
||||||
this.tabsIndex = e.detail.current
|
this.tabsIndex = e.detail.current
|
||||||
this.total = this.identities[e.detail.current].price
|
this.total = this.identities[e.detail.current].price
|
||||||
this.sumNumber = 1
|
this.rights = this.identities[e.detail.current].rights
|
||||||
this.totalData(this.identities[e.detail.current].identity_id);
|
this.totalData(this.identities[e.detail.current].identity_id);
|
||||||
|
this.sumNumber = 1
|
||||||
},
|
},
|
||||||
|
|
||||||
// 开通会员
|
// 开通会员
|
||||||
@@ -334,15 +290,24 @@
|
|||||||
width: 630rpx;
|
width: 630rpx;
|
||||||
height: 280rpx;
|
height: 280rpx;
|
||||||
display: flex;
|
display: flex;
|
||||||
|
position: relative;
|
||||||
|
.swiper-item-bg{
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
position: absolute;
|
||||||
|
z-index: 10;
|
||||||
|
bottom: 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.vip-item {
|
.vip-item {
|
||||||
width: 630rpx;
|
width: 630rpx;
|
||||||
height: 280rpx;
|
height: 280rpx;
|
||||||
border-radius: 20rpx;
|
border-radius: 20rpx;
|
||||||
background-color: #c8c8c8;
|
background-color: #c7c7c7;
|
||||||
padding: 0 40rpx;
|
padding: 0 40rpx;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
|
color: #cacaca;
|
||||||
.vip-top {
|
.vip-top {
|
||||||
display: flex;
|
display: flex;
|
||||||
position: relative;
|
position: relative;
|
||||||
@@ -354,7 +319,7 @@
|
|||||||
border-radius: 60rpx;
|
border-radius: 60rpx;
|
||||||
padding: 0 $padding;
|
padding: 0 $padding;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
background-image: linear-gradient(to right, #f11a22, #ff252f);
|
background-image: linear-gradient(to bottom ,#e93340,#e8252f);
|
||||||
display: flex;
|
display: flex;
|
||||||
.vip-name-icon {
|
.vip-name-icon {
|
||||||
width: 50rpx;
|
width: 50rpx;
|
||||||
@@ -362,6 +327,20 @@
|
|||||||
margin: $margin - 15 $margin - 10 0 0;
|
margin: $margin - 15 $margin - 10 0 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.vip-name1{
|
||||||
|
font-size: $title-size + 6;
|
||||||
|
border-radius: 60rpx;
|
||||||
|
padding: 0 $padding;
|
||||||
|
box-sizing: border-box;
|
||||||
|
background-image: linear-gradient(to bottom ,#cacaca,#cacaca);
|
||||||
|
display: flex;
|
||||||
|
color: #fff;
|
||||||
|
.vip-name-icon {
|
||||||
|
width: 50rpx;
|
||||||
|
height: 50rpx;
|
||||||
|
margin: $margin - 15 $margin - 10 0 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
.vip-price {
|
.vip-price {
|
||||||
font-size: $title-size + 10;
|
font-size: $title-size + 10;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
@@ -377,9 +356,10 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.color-item-img {
|
.color-item-img {
|
||||||
background-color: #ff252f;
|
background-color: #e93340;
|
||||||
|
background-image: linear-gradient(to bottom ,#e93340,#e8252f);
|
||||||
color: #FFFFFF;
|
color: #FFFFFF;
|
||||||
box-shadow: 0 0 20rpx rgba(145,196,255,.5);
|
box-shadow: 0 0 20rpx 4rpx rgba($color: #e93340, $alpha: 1.0);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 轮播点
|
// 轮播点
|
||||||
@@ -409,7 +389,7 @@
|
|||||||
.vip-years-name {
|
.vip-years-name {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
display: flex;
|
display: flex;
|
||||||
color: #c8c8c8;
|
color: #c2c2c2;
|
||||||
.vip-years-icon {
|
.vip-years-icon {
|
||||||
width: 60rpx;
|
width: 60rpx;
|
||||||
height: 60rpx;
|
height: 60rpx;
|
||||||
@@ -443,21 +423,23 @@
|
|||||||
text-align: center;
|
text-align: center;
|
||||||
.privilege-img {
|
.privilege-img {
|
||||||
height: 40rpx;
|
height: 40rpx;
|
||||||
|
margin-top: 40rpx;
|
||||||
}
|
}
|
||||||
.privilege-list {
|
.privilege-list {
|
||||||
padding: 0 $padding;
|
padding: 0 $padding;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
text-align: left;
|
text-align: left;
|
||||||
margin-top: $margin;
|
margin-top: $margin * 0.5;
|
||||||
.privilege-label {
|
.privilege-label {
|
||||||
border-bottom: 2rpx #e6eaef dashed;
|
border-bottom: 2rpx #e6eaef dashed;
|
||||||
font-size: $title-size;
|
font-size: 30rpx;
|
||||||
padding: $padding + 10 0;
|
padding: $padding 0;
|
||||||
display: flex;
|
display: flex;
|
||||||
.privilege-label-tips {
|
.privilege-label-tips {
|
||||||
width: 40rpx;
|
width: 40rpx;
|
||||||
height: 40rpx;
|
height: 40rpx;
|
||||||
margin-right: 20rpx;
|
margin-right: 20rpx;
|
||||||
|
margin-top: 10rpx;
|
||||||
}
|
}
|
||||||
.privilege-label-text {
|
.privilege-label-text {
|
||||||
width: calc(100% - 60rpx);
|
width: calc(100% - 60rpx);
|
||||||
@@ -468,7 +450,6 @@
|
|||||||
|
|
||||||
// 支付方式
|
// 支付方式
|
||||||
.payWay {
|
.payWay {
|
||||||
margin-top: $margin * 4;
|
|
||||||
.payWay-way {
|
.payWay-way {
|
||||||
padding: 0 $padding;
|
padding: 0 $padding;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
@@ -512,7 +493,7 @@
|
|||||||
margin: $margin 0;
|
margin: $margin 0;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
.agree-tips {
|
.agree-tips {
|
||||||
background-color: #999999;
|
background-color: #d9d9d9;
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
padding: 14rpx $padding;
|
padding: 14rpx $padding;
|
||||||
color: #FFFFFF;
|
color: #FFFFFF;
|
||||||
@@ -553,11 +534,11 @@
|
|||||||
.footer-btn{
|
.footer-btn{
|
||||||
padding: 0 $padding + 10;
|
padding: 0 $padding + 10;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
background-color: #ff2828;
|
background-color: #e93340;
|
||||||
height: 90rpx;
|
height: 90rpx;
|
||||||
line-height: 90rpx;
|
line-height: 90rpx;
|
||||||
border-radius: 60rpx;
|
border-radius: 60rpx;
|
||||||
color: #FFFFFF;
|
color: #ececec;
|
||||||
font-size: $title-size;
|
font-size: $title-size;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
text-align: left;
|
text-align: left;
|
||||||
@@ -566,7 +547,7 @@
|
|||||||
flex: 1;
|
flex: 1;
|
||||||
}
|
}
|
||||||
.footer-btn-pay {
|
.footer-btn-pay {
|
||||||
color: #f6ff00;
|
color: rgba($color: #ff0, $alpha: .8);
|
||||||
}
|
}
|
||||||
&[disabled] {
|
&[disabled] {
|
||||||
background-color: #b1b1b1;
|
background-color: #b1b1b1;
|
||||||
|
|||||||
335
pages/wallet/addBank.vue
Normal file
@@ -0,0 +1,335 @@
|
|||||||
|
<template>
|
||||||
|
<view class="WithdrawingCoin">
|
||||||
|
<view class="withdrawing-content">
|
||||||
|
<view class="item-name">{{bank_account_id===''?'添加':'编辑'}}提现银行</view>
|
||||||
|
<view class="item">
|
||||||
|
<view class="title">收款人姓名</view>
|
||||||
|
<input class="input_num" v-model="name" maxlength="13" placeholder="请输入收款人姓名"
|
||||||
|
placeholder-style="color:#999;font-weight:normal; font-size:30rpx;" />
|
||||||
|
</view>
|
||||||
|
<view class="item">
|
||||||
|
<view class="title">收款人手机号</view>
|
||||||
|
<input class="input_num" v-model="mobile" maxlength="11" placeholder="请输入手机号"
|
||||||
|
placeholder-style="color:#999;font-weight:normal; font-size:30rpx;" />
|
||||||
|
</view>
|
||||||
|
<view class="item">
|
||||||
|
<view class="title">开户行</view>
|
||||||
|
<u-select v-model="bankShow" value-name='id' :default-value='[0]' label-name='name'
|
||||||
|
@confirm='selectBank' :list="banks" />
|
||||||
|
<view class="input_num" @click="bankShow = true">
|
||||||
|
{{selectBankObj.label?selectBankObj.label:'请选择开户行'}}
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="item">
|
||||||
|
<view class="title">收款人账号</view>
|
||||||
|
<input class="input_num" v-model="no" maxlength="20" type="number" placeholder="请输入收款人账号"
|
||||||
|
placeholder-style="color:#999;font-weight:normal; font-size:30rpx;" />
|
||||||
|
</view>
|
||||||
|
<view class="item">
|
||||||
|
<view class="title">支行名称</view>
|
||||||
|
<input class="input_num" v-model="branch_name" maxlength="20" placeholder="省-市-区-支行名称"
|
||||||
|
placeholder-style="color:#999;font-weight:normal; font-size:30rpx;" />
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="btn" @click="sureAdd">确认{{bank_account_id===''?'添加':'编辑'}}银行</view>
|
||||||
|
<view class="history" @click="$Router.push({name:'withdrawList'})">提现记录
|
||||||
|
<u-icon name="question-circle-fill" />
|
||||||
|
</view>
|
||||||
|
<u-toast ref="uToast" />
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import {
|
||||||
|
accountsCreate,
|
||||||
|
withdrawsAccounts,
|
||||||
|
accountsCreateEdit,
|
||||||
|
withdrawsAccountsEdits
|
||||||
|
} from '@/apis/interfaces/withdraws'
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
no: '', // 银行卡号
|
||||||
|
name: '', // 用户姓名
|
||||||
|
branch_name: '', // 支行名称
|
||||||
|
mobile: '', // 手机号
|
||||||
|
bank_id: '', // 银行卡id
|
||||||
|
banks: [], // 开户行列表
|
||||||
|
bankShow: false, // 显示开户行列表
|
||||||
|
selectBankObj: {}, // 选择银行
|
||||||
|
bank_account_id:''
|
||||||
|
};
|
||||||
|
},
|
||||||
|
onLoad(e) {
|
||||||
|
// 有id 是编辑
|
||||||
|
if (e.id) {
|
||||||
|
this.bank_account_id = e.id
|
||||||
|
this.getAccountsCreateEdit()
|
||||||
|
} else {
|
||||||
|
this.getAccountsCreate()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
// 获取添加银行前置条件
|
||||||
|
getAccountsCreate() {
|
||||||
|
accountsCreate().then(res => {
|
||||||
|
console.log(res)
|
||||||
|
this.banks = res.banks
|
||||||
|
}).catch(err => {
|
||||||
|
this.$refs.uToast.show({
|
||||||
|
title: err.message,
|
||||||
|
type: 'primary',
|
||||||
|
duration: 3000
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 编辑前置
|
||||||
|
getAccountsCreateEdit() {
|
||||||
|
accountsCreateEdit(this.bank_account_id).then(res => {
|
||||||
|
console.log(res)
|
||||||
|
this.banks = res.banks
|
||||||
|
this.no = res.info.no
|
||||||
|
this.name = res.info.name
|
||||||
|
this.mobile = res.info.mobile
|
||||||
|
this.branch_name = res.info.branch_name
|
||||||
|
this.selectBankObj.label = res.info.bank.name
|
||||||
|
this.bank_id = res.info.bank.id
|
||||||
|
}).catch(err => {
|
||||||
|
this.$refs.uToast.show({
|
||||||
|
title: err.message,
|
||||||
|
type: 'primary',
|
||||||
|
duration: 3000
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 选择银行
|
||||||
|
selectBank(e) {
|
||||||
|
console.log(e[0])
|
||||||
|
this.selectBankObj = e[0]
|
||||||
|
this.bank_id = e[0].value
|
||||||
|
},
|
||||||
|
sureAdd() {
|
||||||
|
let data = {
|
||||||
|
no: this.no, // 银行卡号
|
||||||
|
name: this.name, // 用户姓名
|
||||||
|
branch_name: this.branch_name, // 支行名称
|
||||||
|
mobile: this.mobile, // 手机号
|
||||||
|
bank_id: this.bank_id, // 银行卡id
|
||||||
|
}
|
||||||
|
if (data.name === '') {
|
||||||
|
this.$refs.uToast.show({
|
||||||
|
title: '请核对收款人姓名',
|
||||||
|
type: 'primary',
|
||||||
|
duration: 3000
|
||||||
|
})
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (data.mobile.length !== 11) {
|
||||||
|
this.$refs.uToast.show({
|
||||||
|
title: '请核对收款人手机号',
|
||||||
|
type: 'primary',
|
||||||
|
duration: 3000
|
||||||
|
})
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (data.bank_id === '') {
|
||||||
|
this.$refs.uToast.show({
|
||||||
|
title: '请勾选开户行',
|
||||||
|
type: 'primary',
|
||||||
|
duration: 3000
|
||||||
|
})
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (data.no === '') {
|
||||||
|
this.$refs.uToast.show({
|
||||||
|
title: '请核对收款账号',
|
||||||
|
type: 'primary',
|
||||||
|
duration: 3000
|
||||||
|
})
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (data.branch_name === '') {
|
||||||
|
this.$refs.uToast.show({
|
||||||
|
title: '请核对省-市-区-支行名称',
|
||||||
|
type: 'primary',
|
||||||
|
duration: 3000
|
||||||
|
})
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (this.bank_account_id) {
|
||||||
|
data.bank_account_id = this.bank_account_id
|
||||||
|
console.log(data)
|
||||||
|
this.withdrawsAccountsEdits(data)
|
||||||
|
} else {
|
||||||
|
this.withdrawsAccounts(data)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 添加银行
|
||||||
|
withdrawsAccounts(data) {
|
||||||
|
withdrawsAccounts(data).then(res => {
|
||||||
|
this.$refs.uToast.show({
|
||||||
|
title: res,
|
||||||
|
type: 'primary',
|
||||||
|
duration: 3000
|
||||||
|
})
|
||||||
|
setTimeout(res => {
|
||||||
|
uni.setStorageSync('refresh',true)
|
||||||
|
uni.navigateBack({})
|
||||||
|
}, 3000)
|
||||||
|
}).catch(err => {
|
||||||
|
this.$refs.uToast.show({
|
||||||
|
title: err.message,
|
||||||
|
type: 'primary',
|
||||||
|
duration: 3000
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 编辑银行卡银行
|
||||||
|
withdrawsAccountsEdits(data) {
|
||||||
|
withdrawsAccountsEdits(data).then(res => {
|
||||||
|
this.$refs.uToast.show({
|
||||||
|
title: res,
|
||||||
|
type: 'primary',
|
||||||
|
duration: 3000
|
||||||
|
})
|
||||||
|
uni.setStorageSync('refresh',true)
|
||||||
|
setTimeout(res => {
|
||||||
|
uni.navigateBack({})
|
||||||
|
}, 3000)
|
||||||
|
}).catch(err => {
|
||||||
|
this.$refs.uToast.show({
|
||||||
|
title: err.message,
|
||||||
|
type: 'primary',
|
||||||
|
duration: 3000
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss">
|
||||||
|
page {
|
||||||
|
width: 100%;
|
||||||
|
min-height: 100vh;
|
||||||
|
background-color: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.history {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
box-sizing: border-box;
|
||||||
|
color: #cacaca;
|
||||||
|
|
||||||
|
.u-icon {
|
||||||
|
margin-left: 10rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.withdrawing-content {
|
||||||
|
min-height: 300rpx;
|
||||||
|
background-color: #fff;
|
||||||
|
box-shadow: 0 0 30rpx 1rpx rgba($color: #000000, $alpha: 0.2);
|
||||||
|
margin: $margin;
|
||||||
|
border-radius: 20rpx;
|
||||||
|
padding: $padding;
|
||||||
|
font-size: $title-size-m;
|
||||||
|
|
||||||
|
.item-name {
|
||||||
|
text-align: center;
|
||||||
|
padding: $padding * .6;
|
||||||
|
color: #303030;
|
||||||
|
font-weight: bold;
|
||||||
|
margin-bottom: $margin;
|
||||||
|
font-size: $title-size *1.2;
|
||||||
|
position: relative;
|
||||||
|
|
||||||
|
&::after {
|
||||||
|
content: '';
|
||||||
|
position: absolute;
|
||||||
|
background-color: rgba($color: $text-price, $alpha: .4);
|
||||||
|
width: 200rpx;
|
||||||
|
height: 10rpx;
|
||||||
|
left: 50%;
|
||||||
|
margin-left: -100rpx;
|
||||||
|
bottom: 16rpx;
|
||||||
|
z-index: 1;
|
||||||
|
box-shadow: 0 10rpx 20rpx 0rpx rgba($color: #e93340, $alpha: 0.6);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.item {
|
||||||
|
border-bottom: solid 1rpx #f8f8f8;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: flex-start;
|
||||||
|
box-sizing: border-box;
|
||||||
|
padding: $padding 0;
|
||||||
|
|
||||||
|
span:nth-child(1) {
|
||||||
|
color: #666;
|
||||||
|
margin-right: 20rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.title {
|
||||||
|
width: 200rpx;
|
||||||
|
font-size: 28rpx;
|
||||||
|
|
||||||
|
&::before {
|
||||||
|
content: '*';
|
||||||
|
color: red;
|
||||||
|
padding-right: 4rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.input_num {
|
||||||
|
font-size: 30rpx;
|
||||||
|
color: #3a3a3a;
|
||||||
|
// font-weight: bolder;
|
||||||
|
flex: 1;
|
||||||
|
margin-left: 20rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.item-total {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
padding: $padding*1 0 0 0;
|
||||||
|
color: #3a3a3a;
|
||||||
|
|
||||||
|
.total {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: flex-start;
|
||||||
|
justify-content: center;
|
||||||
|
box-sizing: border-box;
|
||||||
|
|
||||||
|
.money {
|
||||||
|
padding-top: $padding *0.5;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.lists {
|
||||||
|
color: $text-price;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn {
|
||||||
|
background-image: linear-gradient(to right, #e93340, #e93340);
|
||||||
|
color: #fff;
|
||||||
|
border-radius: 10rpx;
|
||||||
|
text-align: center;
|
||||||
|
padding: $padding * .9;
|
||||||
|
margin: $margin*3 $margin * 2 $margin $margin*2;
|
||||||
|
font-size: $title-size;
|
||||||
|
font-weight: bold;
|
||||||
|
letter-spacing: 2rpx;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
269
pages/wallet/bankList.vue
Normal file
@@ -0,0 +1,269 @@
|
|||||||
|
<template>
|
||||||
|
<view class="selectCard">
|
||||||
|
<block v-if="lists.length>0" >
|
||||||
|
<view class="demo11">
|
||||||
|
<icon type="warn" size="16"/>
|
||||||
|
长按删除添加银行卡
|
||||||
|
</view>
|
||||||
|
<view class="bankInfo" v-for="(item,index) in lists" :key='index' @longpress='delBank(item.bank_account_id,index)'>
|
||||||
|
<image class="bankLogin" @click="selectBank(item)" :src="item.bank.cover" mode="widthFix" />
|
||||||
|
<view class="right" @click="selectBank(item)">
|
||||||
|
<view class="left">
|
||||||
|
<view class="title">{{item.bank.name}}
|
||||||
|
<view class="tags">快捷支付</view>
|
||||||
|
</view>
|
||||||
|
<view class="des">储值卡</view>
|
||||||
|
<view class="no">{{item.no}}</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<u-icon name="edit-pen-fill" @click='editBank(item.bank_account_id)' color="rgba(255,255,255,0.6)"
|
||||||
|
size='50' />
|
||||||
|
</view>
|
||||||
|
</block>
|
||||||
|
<!-- 底部新增按钮 -->
|
||||||
|
<view class="addBtn" @click="$Router.push({ name: 'addBank'})">
|
||||||
|
<u-icon name="plus" label-pos='bottom' color='#fff' label-color='#fff' label='新增' />
|
||||||
|
</view>
|
||||||
|
<!-- 无列表 -->
|
||||||
|
<no-list v-if="lists.length === 0" name='no-shop' txt="没有任何提现银行 ~ " />
|
||||||
|
<!-- <u-toast ref="uToast" /> -->
|
||||||
|
<u-toast ref="uToast" />
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import {
|
||||||
|
withdrawsAccountsList,
|
||||||
|
withdrawsAccountsDelete
|
||||||
|
} from '@/apis/interfaces/withdraws'
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
lists: [],
|
||||||
|
page: 1,
|
||||||
|
has_more: true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onLoad() {
|
||||||
|
this.withdrawsAccountsList()
|
||||||
|
},
|
||||||
|
onShow() {
|
||||||
|
if (uni.getStorageSync('refresh')) {
|
||||||
|
this.lists = []
|
||||||
|
this.page = 1
|
||||||
|
this.has_more = true
|
||||||
|
this.withdrawsAccountsList()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onReachBottom() {
|
||||||
|
if (this.has_more) {
|
||||||
|
this.page = this.page + 1
|
||||||
|
this.withdrawsAccountsList()
|
||||||
|
} else {
|
||||||
|
this.$refs.uToast.show({
|
||||||
|
title: '哎呦,没有更多了~',
|
||||||
|
type: 'primary',
|
||||||
|
duration: 3000
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
// 添加银行
|
||||||
|
withdrawsAccountsList() {
|
||||||
|
let data = {
|
||||||
|
page: this.page
|
||||||
|
}
|
||||||
|
withdrawsAccountsList(data).then(res => {
|
||||||
|
console.log(res)
|
||||||
|
this.lists = this.lists.concat(res.data)
|
||||||
|
this.has_more = res.page.has_more
|
||||||
|
uni.setStorageSync('refresh', false)
|
||||||
|
}).catch(err => {
|
||||||
|
this.$refs.uToast.show({
|
||||||
|
title: err.message,
|
||||||
|
type: 'primary',
|
||||||
|
duration: 3000
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 跳转到编辑银行卡的页面
|
||||||
|
editBank(id) {
|
||||||
|
this.$Router.push({
|
||||||
|
name: 'addBank',
|
||||||
|
params: {
|
||||||
|
id: id
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 删除银行
|
||||||
|
delBank(id, index) {
|
||||||
|
let that = this
|
||||||
|
uni.showModal({
|
||||||
|
title: '温馨提示',
|
||||||
|
content: '是否确认删除该银行',
|
||||||
|
cancelColor: '#cacaca',
|
||||||
|
cancelText: '我再想想',
|
||||||
|
confirmColor: '#e93340',
|
||||||
|
confirmText: '确认删除',
|
||||||
|
success(res) {
|
||||||
|
if (res.confirm) {
|
||||||
|
withdrawsAccountsDelete(id).then(res => {
|
||||||
|
console.log(res)
|
||||||
|
that.lists.splice(index, 1)
|
||||||
|
if (that.lists.length === 0) {
|
||||||
|
uni.navigateBack({})
|
||||||
|
uni.setStorageSync('refresh', true)
|
||||||
|
}
|
||||||
|
}).catch(err => {
|
||||||
|
that.$refs.uToast.show({
|
||||||
|
title: err.message,
|
||||||
|
type: 'primary',
|
||||||
|
duration: 3000
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 选择银行返回上一页携带参数
|
||||||
|
selectBank(item) {
|
||||||
|
let bankInfo = {
|
||||||
|
name: item.bank.name + '-' + item.no.substring(item.no.length - 4),
|
||||||
|
bank_account_id: item.bank_account_id
|
||||||
|
}
|
||||||
|
let pages = getCurrentPages()
|
||||||
|
let prevPage = pages[pages.length - 2]
|
||||||
|
// prevPage._data.bankInfo = bankInfo
|
||||||
|
prevPage.$vm.bankInfo = bankInfo;
|
||||||
|
uni.navigateBack() //返回上一页面
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.addBtn{
|
||||||
|
position: fixed;
|
||||||
|
bottom: 0;
|
||||||
|
margin: 40rpx;
|
||||||
|
text-align: center;
|
||||||
|
width: 130rpx;
|
||||||
|
height: 130rpx;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
box-sizing: border-box;
|
||||||
|
border-radius: 50%;
|
||||||
|
z-index: 100;
|
||||||
|
right: 0;
|
||||||
|
box-shadow: 0 0 20rpx 20rpx rgba($color: #fff, $alpha: .5);
|
||||||
|
background-image: linear-gradient(to right, #e93340, #e93340);
|
||||||
|
}
|
||||||
|
.selectCard {
|
||||||
|
width: 100%;
|
||||||
|
min-height: 100vh;
|
||||||
|
padding-top: 30rpx;
|
||||||
|
background-color: #fff;
|
||||||
|
padding-bottom: 80rpx;
|
||||||
|
|
||||||
|
.demo11{
|
||||||
|
color: #e93340;
|
||||||
|
font-size: 26rpx;
|
||||||
|
text-align: center;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
// background-color: #e93340;
|
||||||
|
icon{
|
||||||
|
margin-right: 10rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.bankInfo {
|
||||||
|
width: calc(100% - 60rpx);
|
||||||
|
background-image: linear-gradient(to right, #e93340, #e93340);
|
||||||
|
box-shadow: 0 10rpx 20rpx 0rpx rgba($color: #e93340, $alpha: 0.6);
|
||||||
|
margin: 20rpx 30rpx 0 30rpx;
|
||||||
|
border-radius: 20rpx;
|
||||||
|
box-sizing: border-box;
|
||||||
|
position: relative;
|
||||||
|
padding: 40rpx 30rpx;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
align-items: flex-start;
|
||||||
|
justify-content: space-between;
|
||||||
|
z-index: 1;
|
||||||
|
|
||||||
|
.bankLogin {
|
||||||
|
width: 70rpx;
|
||||||
|
height: 70rpx;
|
||||||
|
opacity: .9;
|
||||||
|
}
|
||||||
|
|
||||||
|
.right {
|
||||||
|
flex: 1;
|
||||||
|
margin-left: 20rpx;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
align-items: flex-start;
|
||||||
|
justify-content: space-between;
|
||||||
|
box-sizing: border-box;
|
||||||
|
color: rgba($color: #fff, $alpha: .9);
|
||||||
|
position: relative;
|
||||||
|
z-index: 1;
|
||||||
|
|
||||||
|
.u-icon {
|
||||||
|
position: absolute;
|
||||||
|
background-color: pink;
|
||||||
|
z-index: 100;
|
||||||
|
right: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.left {
|
||||||
|
flex: 1;
|
||||||
|
|
||||||
|
.title {
|
||||||
|
font-size: 38rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: flex-start;
|
||||||
|
|
||||||
|
.tags {
|
||||||
|
color: $text-price;
|
||||||
|
font-size: 24rpx;
|
||||||
|
margin-left: 20rpx;
|
||||||
|
padding: 4rpx 14rpx;
|
||||||
|
position: relative;
|
||||||
|
display: inline-block;
|
||||||
|
color: #e93340;
|
||||||
|
|
||||||
|
&::before {
|
||||||
|
background: rgba($color: #fff, $alpha: .8);
|
||||||
|
z-index: -1;
|
||||||
|
position: absolute;
|
||||||
|
content: '';
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
bottom: 0;
|
||||||
|
transform: skewX(-10deg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.des {
|
||||||
|
font-size: 28rpx;
|
||||||
|
margin-top: 14rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.no {
|
||||||
|
font-size: 36rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
margin-top: 20rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
50
pages/wallet/cmsWithDraw.vue
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
<template>
|
||||||
|
<view>
|
||||||
|
<view class="clauseCont">
|
||||||
|
<rich-text :nodes="clauseData"></rich-text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import {
|
||||||
|
cmsWithdraw
|
||||||
|
} from '@/apis/interfaces/wallet.js'
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
clauseData: [] //服务条款
|
||||||
|
};
|
||||||
|
},
|
||||||
|
onLoad() {
|
||||||
|
// 获取服务条款
|
||||||
|
this.clauseInfo()
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
// 服务条款
|
||||||
|
clauseInfo() {
|
||||||
|
cmsWithdraw().then(res => {
|
||||||
|
this.clauseData = res.content.replace(/\<img/gi,
|
||||||
|
'<img style="max-width:100%; height:auto; vertical-align: top;"')
|
||||||
|
}).catch(err => {
|
||||||
|
uni.showToast({
|
||||||
|
icon: 'none',
|
||||||
|
title: err.message
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss">
|
||||||
|
page {
|
||||||
|
background-color: $uni-bg-color;
|
||||||
|
}
|
||||||
|
|
||||||
|
.clauseCont {
|
||||||
|
padding: $padding + 10 $padding * 2;
|
||||||
|
width: 100%;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
371
pages/wallet/extract.vue
Normal file
@@ -0,0 +1,371 @@
|
|||||||
|
<template>
|
||||||
|
<view class="WithdrawingCoin ">
|
||||||
|
<view class="propery">
|
||||||
|
<image src="/static/imgs/account-bg.png" mode="aspectFill" class="record-bg" />
|
||||||
|
<view class="propery-content">
|
||||||
|
<view class="currency">原石钱包
|
||||||
|
<span>(≈ {{ cost || '0.00' }} CNY)</span>
|
||||||
|
</view>
|
||||||
|
<view class="balance">{{ balance || '0.00' }}</view>
|
||||||
|
<!-- <view class="frozen" @click="withdrawDetail">提现记录</view> -->
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="withdrawing-content">
|
||||||
|
<view class="item">
|
||||||
|
<view style="flex: 1;">
|
||||||
|
<view class="inputTxt">提现数量</view>
|
||||||
|
<input class="input_num" v-model="withdraw_input" @input='inputNum' type="number"
|
||||||
|
placeholder-style="color:#999;font-weight:normal; font-size:34rpx;"
|
||||||
|
placeholder="请输入提现数量" :disabled="balance===0" />
|
||||||
|
</view>
|
||||||
|
<view class="all" @click="all">全部提现</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="total" v-if="total">≈ ¥{{total.toFixed(2)}} </view>
|
||||||
|
<view class="btn" @click="actions">提现至现金零钱</view>
|
||||||
|
<view class="des">提现至零钱,可在零钱中提现到银行卡 手续费: 无</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import {
|
||||||
|
cashsCreate,
|
||||||
|
accountCashs,
|
||||||
|
withdrawsIndexCreate,
|
||||||
|
withdrawsIndex
|
||||||
|
} from '@/apis/interfaces/withdraws';
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
balance: 0, // 钱包原石数量
|
||||||
|
tax: 0, // 当前手续费
|
||||||
|
cost: 1, // 每个原石的价格
|
||||||
|
total: 0, // 约合人民币
|
||||||
|
card: '', // 银行卡号
|
||||||
|
withdraw_input: '', // 提现原石数量
|
||||||
|
bank_accounts: 0,
|
||||||
|
bankInfo: {}
|
||||||
|
};
|
||||||
|
},
|
||||||
|
onLoad() {
|
||||||
|
this.getInfo()
|
||||||
|
},
|
||||||
|
onShow() {
|
||||||
|
if (uni.getStorageSync('refresh')) {
|
||||||
|
this.bankInfo = {}
|
||||||
|
this.getInfo()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
// 提现基本信息
|
||||||
|
getInfo() {
|
||||||
|
cashsCreate().then(res => {
|
||||||
|
this.withdraw_input = Number(res.balance)
|
||||||
|
this.balance = res.balance
|
||||||
|
this.cost = res.cost
|
||||||
|
this.total = Number(res.balance) * Number(res.cost)
|
||||||
|
uni.setStorageSync('refresh', false)
|
||||||
|
}).catch(err => {
|
||||||
|
uni.showToast({
|
||||||
|
title: err.message,
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 输入提现原石数量
|
||||||
|
inputNum(e) {
|
||||||
|
let number = Number(e.detail.value)
|
||||||
|
if (number <= Number(this.balance)) {
|
||||||
|
this.total = Number(e.detail.value) * this.cost
|
||||||
|
} else {
|
||||||
|
this.total = 0
|
||||||
|
if (Number(this.balance) === 0) {
|
||||||
|
uni.showToast({
|
||||||
|
title: '当前不能提现',
|
||||||
|
icon: 'none',
|
||||||
|
duration: 2000
|
||||||
|
});
|
||||||
|
this.withdraw_input = 0
|
||||||
|
this.total = 0
|
||||||
|
} else {
|
||||||
|
uni.showToast({
|
||||||
|
title: '最大值能超过' + this.balance + '',
|
||||||
|
icon: 'none',
|
||||||
|
duration: 2000
|
||||||
|
});
|
||||||
|
this.withdraw_input = this.balance
|
||||||
|
this.total = this.balance * this.cost
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 点击全部
|
||||||
|
all() {
|
||||||
|
if (this.balance > 0) {
|
||||||
|
this.withdraw_input = this.balance
|
||||||
|
this.total = this.balance * this.cost
|
||||||
|
} else {
|
||||||
|
uni.showToast({
|
||||||
|
title: '啥也没有,我也做不到~',
|
||||||
|
icon: 'none',
|
||||||
|
duration: 2000
|
||||||
|
})
|
||||||
|
this.withdraw_input = 0
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 提现
|
||||||
|
actions() {
|
||||||
|
let data = {
|
||||||
|
amount: Number(this.withdraw_input)
|
||||||
|
}
|
||||||
|
if (data.amount === 0) {
|
||||||
|
uni.showToast({
|
||||||
|
title: '请输入原石数量',
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
uni.showModal({
|
||||||
|
title: '温馨提示',
|
||||||
|
content:'您是否确认提现到现金零钱账户,交易将免手续费',
|
||||||
|
confirmColor: '#7c52fc',
|
||||||
|
cancelColor: '#cacaca',
|
||||||
|
cancelText: '我再想想',
|
||||||
|
confirmText: '确认提现',
|
||||||
|
success: (res) => {
|
||||||
|
if (res.confirm) {
|
||||||
|
uni.showLoading({
|
||||||
|
title: '提交中'
|
||||||
|
})
|
||||||
|
accountCashs(data).then(res => {
|
||||||
|
uni.showToast({
|
||||||
|
title: res,
|
||||||
|
icon: 'none',
|
||||||
|
duration: 3000
|
||||||
|
})
|
||||||
|
this.withdraw_input = ''
|
||||||
|
this.total = ''
|
||||||
|
setTimeout(res => {
|
||||||
|
this.getInfo()
|
||||||
|
uni.hideLoading()
|
||||||
|
}, 3000)
|
||||||
|
}).catch(err => {
|
||||||
|
uni.showToast({
|
||||||
|
title: err.message,
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
},
|
||||||
|
// 提现记录
|
||||||
|
withdrawDetail() {
|
||||||
|
this.$Router.push({
|
||||||
|
name: 'withdrawList'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss">
|
||||||
|
page {
|
||||||
|
width: 100%;
|
||||||
|
min-height: 100vh;
|
||||||
|
background-color: #f7f7f7;
|
||||||
|
}
|
||||||
|
|
||||||
|
.receiptCode {
|
||||||
|
color: #808080;
|
||||||
|
text-align: left;
|
||||||
|
// margin: $margin 0;
|
||||||
|
font-size: $title-size-m;
|
||||||
|
}
|
||||||
|
|
||||||
|
.WithdrawingCoin {
|
||||||
|
background-color: #f7f7f7;
|
||||||
|
width: 100%;
|
||||||
|
min-height: 100vh;
|
||||||
|
padding-bottom: 100rpx;
|
||||||
|
|
||||||
|
// 账户
|
||||||
|
.propery {
|
||||||
|
position: relative;
|
||||||
|
padding-top: var(--status-bar-height);
|
||||||
|
background-image: linear-gradient(to bottom, #e93340, #e93340);
|
||||||
|
position: relative;
|
||||||
|
overflow: hidden;
|
||||||
|
|
||||||
|
.record-bg {
|
||||||
|
position: absolute;
|
||||||
|
width: 120%;
|
||||||
|
height: 300rpx;
|
||||||
|
bottom: -50rpx;
|
||||||
|
right: -20rpx;
|
||||||
|
z-index: 1;
|
||||||
|
opacity: .5;
|
||||||
|
transform: rotate(-7deg);
|
||||||
|
}
|
||||||
|
|
||||||
|
.propery-content {
|
||||||
|
position: relative;
|
||||||
|
z-index: 1;
|
||||||
|
padding: $padding/2 $padding $padding*3;
|
||||||
|
text-align: center;
|
||||||
|
|
||||||
|
.currency {
|
||||||
|
font-size: $title-size-m;
|
||||||
|
color: rgba($color: white, $alpha: .8);
|
||||||
|
}
|
||||||
|
|
||||||
|
.balance {
|
||||||
|
font-size: $title-size * 2.5;
|
||||||
|
padding: $padding 0;
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
|
|
||||||
|
.frozen {
|
||||||
|
background: rgba($color: #000000, $alpha: .1);
|
||||||
|
color: rgba($color: white, $alpha: .7);
|
||||||
|
display: inline-block;
|
||||||
|
font-size: 24rpx;
|
||||||
|
padding: 6rpx $padding;
|
||||||
|
border-radius: 20rpx;
|
||||||
|
border: solid 1rpx rgba($color: white, $alpha: .4)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.all {
|
||||||
|
color: $text-price;
|
||||||
|
width: 160rpx;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.item-name {
|
||||||
|
text-align: center;
|
||||||
|
color: #303030;
|
||||||
|
font-weight: bold;
|
||||||
|
margin-bottom: $margin;
|
||||||
|
font-size: 30rpx;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
box-sizing: border-box;
|
||||||
|
background-image: linear-gradient(to right, #aaaaff, #aaaaff);
|
||||||
|
color: #fff;
|
||||||
|
margin: 30rpx;
|
||||||
|
padding: 30rpx;
|
||||||
|
|
||||||
|
.right {
|
||||||
|
flex: 1;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
font-size: 34rpx;
|
||||||
|
|
||||||
|
.cardName {
|
||||||
|
flex: 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.withdrawing-content {
|
||||||
|
background-color: #fff;
|
||||||
|
padding: $padding $padding $padding $padding * 2;
|
||||||
|
font-size: $title-size-m;
|
||||||
|
|
||||||
|
/* 绑定银行卡 */
|
||||||
|
.bank-card {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
box-sizing: border-box;
|
||||||
|
padding: 0 45rpx 0 35rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.item {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: flex-start;
|
||||||
|
box-sizing: border-box;
|
||||||
|
padding: 20rpx 0;
|
||||||
|
|
||||||
|
span:nth-child(1) {
|
||||||
|
color: #666;
|
||||||
|
margin-right: 20rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.inputTxt {
|
||||||
|
color: #999;
|
||||||
|
padding-bottom: 20rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.input_num {
|
||||||
|
font-size: 60rpx;
|
||||||
|
color: #3a3a3a;
|
||||||
|
font-weight: bolder;
|
||||||
|
flex: 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.item-total {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
padding: $padding*1 0 0 0;
|
||||||
|
color: #3a3a3a;
|
||||||
|
|
||||||
|
.total {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: flex-start;
|
||||||
|
justify-content: center;
|
||||||
|
box-sizing: border-box;
|
||||||
|
|
||||||
|
.money {
|
||||||
|
padding-top: $padding *0.5;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.lists {
|
||||||
|
color: $text-price;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn {
|
||||||
|
background-image: linear-gradient(to bottom, #e93340, #e93340);
|
||||||
|
color: #fff;
|
||||||
|
border-radius: 10rpx;
|
||||||
|
text-align: center;
|
||||||
|
padding: $padding * .9;
|
||||||
|
margin: $margin * 3 $margin *2 $margin $margin*2;
|
||||||
|
font-size: $title-size;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
.des {
|
||||||
|
text-align: center;
|
||||||
|
color: #cacaca;
|
||||||
|
font-size: 26rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.total {
|
||||||
|
color: $mian-color;
|
||||||
|
margin-top: 20rpx;
|
||||||
|
margin-left: 50rpx;
|
||||||
|
font-size: 36rpx;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
404
pages/wallet/extractRed.vue
Normal file
@@ -0,0 +1,404 @@
|
|||||||
|
<template>
|
||||||
|
<view class="WithdrawingCoin ">
|
||||||
|
<view class="propery">
|
||||||
|
<image src="/static/imgs/account-bg.png" mode="aspectFill" class="record-bg" />
|
||||||
|
<view class="propery-content">
|
||||||
|
<view class="currency">可提现额度</view>
|
||||||
|
<view class="balance">{{ balance || '0.00' }}</view>
|
||||||
|
<view class="frozen" @click="withdrawDetail">提现记录</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="item-name">
|
||||||
|
提现至银行卡
|
||||||
|
<view class="right">
|
||||||
|
<view class="cardName" v-if="bank_accounts === 0" @click="addBanks">添加银行卡</view>
|
||||||
|
<view class="cardName" v-if='bank_accounts>0' @click="bankLists">{{bankInfo.name?bankInfo.name:'选择银行卡'}}
|
||||||
|
</view>
|
||||||
|
<uni-icons type="arrowright" size="12" color="#fff" />
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="withdrawing-content">
|
||||||
|
<view class="item">
|
||||||
|
<view style="flex: 1;">
|
||||||
|
<view class="inputTxt">提现金额</view>
|
||||||
|
<input class="input_num" v-model="withdraw_input" @input='inputNum' type="number"
|
||||||
|
placeholder-style="color:#999;font-weight:normal; font-size:34rpx;"
|
||||||
|
placeholder="请输入提现金额" :disabled="balance===0" />
|
||||||
|
</view>
|
||||||
|
<view class="all" @click="all">全部提现</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="total" v-if="total">≈ ¥{{total.toFixed(2)}} </view>
|
||||||
|
<view class="btn" @click="actions">提现至银行卡</view>
|
||||||
|
<view class="des">预计5- 10个工作日到账 手续费: {{tax === '0'?'免手续费':tax+'%'}}</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import {
|
||||||
|
withdrawsIndexCreate,
|
||||||
|
withdrawsIndex
|
||||||
|
} from '@/apis/interfaces/withdraws';
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
balance: 0, // 钱包能量球金额
|
||||||
|
tax: 0, // 当前手续费
|
||||||
|
cost: 1, // 每个能量球的价格
|
||||||
|
total: 0, // 约合人民币
|
||||||
|
card: '', // 银行卡号
|
||||||
|
withdraw_input: '', // 提现能量球金额
|
||||||
|
bank_accounts: 0,
|
||||||
|
bankInfo: {}
|
||||||
|
};
|
||||||
|
},
|
||||||
|
onLoad() {
|
||||||
|
this.getInfo()
|
||||||
|
},
|
||||||
|
onShow() {
|
||||||
|
if (uni.getStorageSync('refresh')) {
|
||||||
|
this.bankInfo = {}
|
||||||
|
this.getInfo()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
// 提现基本信息
|
||||||
|
getInfo() {
|
||||||
|
withdrawsIndexCreate().then(res => {
|
||||||
|
this.balance = res.balance
|
||||||
|
this.tax = res.tax
|
||||||
|
this.cost = res.cost
|
||||||
|
this.bank_accounts = res.bank_accounts.length
|
||||||
|
this.withdraw_input = Number(res.balance)
|
||||||
|
this.total = Number(res.balance) * Number(res.cost)
|
||||||
|
uni.setStorageSync('refresh', false)
|
||||||
|
}).catch(err => {
|
||||||
|
uni.showToast({
|
||||||
|
title: err.message,
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 输入提现能量球金额
|
||||||
|
inputNum(e) {
|
||||||
|
let number = Number(e.detail.value)
|
||||||
|
console.log(number, this.balance)
|
||||||
|
if (number <= Number(this.balance)) {
|
||||||
|
this.total = Number(e.detail.value) * this.cost
|
||||||
|
} else {
|
||||||
|
this.total = 0
|
||||||
|
if (Number(this.balance) === 0) {
|
||||||
|
uni.showToast({
|
||||||
|
title: '当前不能提现',
|
||||||
|
icon: 'none',
|
||||||
|
duration: 2000
|
||||||
|
});
|
||||||
|
this.withdraw_input = 0
|
||||||
|
this.total = 0
|
||||||
|
} else {
|
||||||
|
uni.showToast({
|
||||||
|
title: '最大值能超过' + this.balance + '',
|
||||||
|
icon: 'none',
|
||||||
|
duration: 2000
|
||||||
|
});
|
||||||
|
this.withdraw_input = this.balance
|
||||||
|
this.total = this.balance * this.cost
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
|
// 点击全部
|
||||||
|
all() {
|
||||||
|
if (this.balance > 0) {
|
||||||
|
this.withdraw_input = this.balance
|
||||||
|
this.total = this.balance * this.cost
|
||||||
|
} else {
|
||||||
|
uni.showToast({
|
||||||
|
title: '啥也没有,我也做不到~',
|
||||||
|
icon: 'none',
|
||||||
|
duration: 2000
|
||||||
|
})
|
||||||
|
this.withdraw_input = 0
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 提现
|
||||||
|
actions() {
|
||||||
|
let data = {
|
||||||
|
bank_account_id: this.bankInfo.bank_account_id,
|
||||||
|
amount: Number(this.withdraw_input)
|
||||||
|
}
|
||||||
|
if (data.bank_account_id === undefined || data.bank_account_id === null || data.bank_account_id === '') {
|
||||||
|
uni.showToast({
|
||||||
|
title: this.bank_accounts > 0 ? '请选择银行卡' : '请添加银行卡',
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (data.amount === 0) {
|
||||||
|
uni.showToast({
|
||||||
|
title: '请输入能量球金额',
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
uni.showModal({
|
||||||
|
title: '温馨提示',
|
||||||
|
content:this.tax === '0'?'您是否确认提现,交易将免手续费':'您是否确认提现,将会扣除' + this.tax + '%手续费',
|
||||||
|
confirmColor: '#e93340',
|
||||||
|
cancelColor: '#cacaca',
|
||||||
|
cancelText: '我再想想',
|
||||||
|
confirmText: '确认提现',
|
||||||
|
success: (res) => {
|
||||||
|
if (res.confirm) {
|
||||||
|
uni.showLoading({
|
||||||
|
title: '提交中'
|
||||||
|
})
|
||||||
|
withdrawsIndex(data).then(res => {
|
||||||
|
uni.showToast({
|
||||||
|
title: res,
|
||||||
|
icon: 'none',
|
||||||
|
duration: 3000
|
||||||
|
})
|
||||||
|
this.withdraw_input = ''
|
||||||
|
this.total = ''
|
||||||
|
setTimeout(res => {
|
||||||
|
this.getInfo()
|
||||||
|
uni.hideLoading()
|
||||||
|
uni.setStorageSync('refresh',true)
|
||||||
|
}, 3000)
|
||||||
|
}).catch(err => {
|
||||||
|
uni.showToast({
|
||||||
|
title: err.message,
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
},
|
||||||
|
// 添加银行卡
|
||||||
|
addBanks() {
|
||||||
|
this.$Router.push({
|
||||||
|
name: 'addBank'
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 选择银行卡
|
||||||
|
bankLists() {
|
||||||
|
this.$Router.push({
|
||||||
|
name: 'bankList'
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 提现记录
|
||||||
|
withdrawDetail() {
|
||||||
|
this.$Router.push({
|
||||||
|
name: 'withdrawList'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss">
|
||||||
|
page {
|
||||||
|
width: 100%;
|
||||||
|
// min-height: 100vh;
|
||||||
|
background-color: #f7f7f7;
|
||||||
|
}
|
||||||
|
|
||||||
|
.receiptCode {
|
||||||
|
color: #808080;
|
||||||
|
text-align: left;
|
||||||
|
// margin: $margin 0;
|
||||||
|
font-size: $title-size-m;
|
||||||
|
}
|
||||||
|
|
||||||
|
.WithdrawingCoin {
|
||||||
|
background-color: #f7f7f7;
|
||||||
|
width: 100%;
|
||||||
|
// min-height: 100vh;
|
||||||
|
padding-bottom: 100rpx;
|
||||||
|
|
||||||
|
// 账户
|
||||||
|
.propery {
|
||||||
|
position: relative;
|
||||||
|
padding-top: var(--status-bar-height);
|
||||||
|
background-image: linear-gradient(to bottom, #e93340, #e93340);
|
||||||
|
position: relative;
|
||||||
|
overflow: hidden;
|
||||||
|
|
||||||
|
.record-bg {
|
||||||
|
position: absolute;
|
||||||
|
width: 120%;
|
||||||
|
height: 300rpx;
|
||||||
|
bottom: -50rpx;
|
||||||
|
right: -20rpx;
|
||||||
|
z-index: 1;
|
||||||
|
opacity: .5;
|
||||||
|
transform: rotate(-7deg);
|
||||||
|
}
|
||||||
|
|
||||||
|
.propery-content {
|
||||||
|
position: relative;
|
||||||
|
z-index: 1;
|
||||||
|
padding: $padding/2 $padding $padding*3;
|
||||||
|
text-align: center;
|
||||||
|
|
||||||
|
.currency {
|
||||||
|
font-size: $title-size-m;
|
||||||
|
color: rgba($color: white, $alpha: .8);
|
||||||
|
}
|
||||||
|
|
||||||
|
.balance {
|
||||||
|
font-size: $title-size * 2.5;
|
||||||
|
padding: $padding 0;
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
|
|
||||||
|
.frozen {
|
||||||
|
background: rgba($color: #000000, $alpha: .1);
|
||||||
|
color: rgba($color: white, $alpha: .7);
|
||||||
|
display: inline-block;
|
||||||
|
font-size: 24rpx;
|
||||||
|
padding: 6rpx $padding;
|
||||||
|
border-radius: 20rpx;
|
||||||
|
border: solid 1rpx rgba($color: white, $alpha: .4)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.all {
|
||||||
|
color: $text-price;
|
||||||
|
width: 160rpx;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.item-name {
|
||||||
|
text-align: center;
|
||||||
|
color: #303030;
|
||||||
|
font-weight: bold;
|
||||||
|
margin-bottom: $margin;
|
||||||
|
font-size: 30rpx;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
box-sizing: border-box;
|
||||||
|
background-image: linear-gradient(to right, #e97a76, #e97a76);
|
||||||
|
color: #fff;
|
||||||
|
margin: 30rpx;
|
||||||
|
padding: 30rpx;
|
||||||
|
|
||||||
|
.right {
|
||||||
|
flex: 1;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
font-size: 34rpx;
|
||||||
|
|
||||||
|
.cardName {
|
||||||
|
flex: 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.withdrawing-content {
|
||||||
|
background-color: #fff;
|
||||||
|
padding: $padding $padding $padding $padding * 2;
|
||||||
|
font-size: $title-size-m;
|
||||||
|
|
||||||
|
/* 绑定银行卡 */
|
||||||
|
.bank-card {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
box-sizing: border-box;
|
||||||
|
padding: 0 45rpx 0 35rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.item {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: flex-start;
|
||||||
|
box-sizing: border-box;
|
||||||
|
padding: 20rpx 0;
|
||||||
|
|
||||||
|
span:nth-child(1) {
|
||||||
|
color: #666;
|
||||||
|
margin-right: 20rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.inputTxt {
|
||||||
|
color: #999;
|
||||||
|
padding-bottom: 20rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.input_num {
|
||||||
|
font-size: 60rpx;
|
||||||
|
color: #3a3a3a;
|
||||||
|
font-weight: bolder;
|
||||||
|
flex: 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.item-total {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
padding: $padding*1 0 0 0;
|
||||||
|
color: #3a3a3a;
|
||||||
|
|
||||||
|
.total {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: flex-start;
|
||||||
|
justify-content: center;
|
||||||
|
box-sizing: border-box;
|
||||||
|
|
||||||
|
.money {
|
||||||
|
padding-top: $padding *0.5;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.lists {
|
||||||
|
color: $text-price;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn {
|
||||||
|
background-image: linear-gradient(to bottom, #e93340, #d73c36);
|
||||||
|
color: #fff;
|
||||||
|
border-radius: 10rpx;
|
||||||
|
text-align: center;
|
||||||
|
padding: $padding * .9;
|
||||||
|
margin: $margin * 3 $margin *2 $margin $margin*2;
|
||||||
|
font-size: $title-size;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
.des {
|
||||||
|
text-align: center;
|
||||||
|
color: #cacaca;
|
||||||
|
font-size: 26rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.total {
|
||||||
|
color: $mian-color;
|
||||||
|
margin-top: 20rpx;
|
||||||
|
margin-left: 50rpx;
|
||||||
|
font-size: 36rpx;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
364
pages/wallet/fragment.vue
Normal file
@@ -0,0 +1,364 @@
|
|||||||
|
<template>
|
||||||
|
<view class="Record">
|
||||||
|
<view class="record-top">
|
||||||
|
<image src="/static/imgs/account-bg.png" mode="widthFix" class="record-bg" />
|
||||||
|
<view class="record-top-nav">
|
||||||
|
<view :class="['record-top-item',type==='year'?'selectTopItem':'']"
|
||||||
|
@click="selectType('year')">年账单</view>
|
||||||
|
<view :class="['record-top-item',type==='month'?'selectTopItem':'']"
|
||||||
|
@click="selectType('month')">月账单</view>
|
||||||
|
<view :class="['record-top-item',type==='day'?'selectTopItem':'']"
|
||||||
|
@click="selectType('day')">日账单</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<!-- <view class="record-mouth-year">
|
||||||
|
<view class="record-type-left">
|
||||||
|
<u-picker mode="time" v-model="show" :params="params"
|
||||||
|
@confirm ='confirm' title ='筛选日期' start-year='2021' :end-year='currentYear'/>
|
||||||
|
<view @click="show = true">
|
||||||
|
{{date?date:'选择日期'}}
|
||||||
|
<uni-icons type="arrowdown" color="#fff" size="12" />
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view> -->
|
||||||
|
<view class="record-mouth-year">
|
||||||
|
<view class="record-type-left">
|
||||||
|
<u-picker mode="time" v-model="show" :params="params" @confirm ='confirm' title ='筛选日期' start-year='2021' :end-year='currentYear'/>
|
||||||
|
<view @click="show = true">
|
||||||
|
{{date?date:'选择日期'}}
|
||||||
|
<uni-icons type="arrowdown" color="#fff" size="12" />
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<!-- <view class="record-type-right">
|
||||||
|
<view :class="['pay_type_item',cointype==='all'?'pay_type_item_select':'']" @click="selectCoinType('all')">全部</view>
|
||||||
|
<view :class="['pay_type_item',cointype==='1'?'pay_type_item_select':'']" @click="selectCoinType('1')">待发放</view>
|
||||||
|
<view :class="['pay_type_item',cointype==='0'?'pay_type_item_select':'']" @click="selectCoinType('0')">已发放</view>
|
||||||
|
</view> -->
|
||||||
|
</view>
|
||||||
|
<view class="record-title">当前贡献值个数</view>
|
||||||
|
<view class="record-money">{{score || 0}} <span>个</span></view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<!-- 列表。。。 -->
|
||||||
|
<view class="record-list" v-if="lists.length>0">
|
||||||
|
<view class="record-list-item" v-for="(item,index) in lists" :key='index'>
|
||||||
|
<image src="/static/imgs/record-icon.png" mode="widthFix" class="record-icon" />
|
||||||
|
<view class="">
|
||||||
|
<view class="record-list-item-top">
|
||||||
|
<view class="title ellipsis-1">{{item.remark}}<span class='tags'>{{item.frozen.text}}</span></view>
|
||||||
|
<view class="money" >{{item.amount}}</view>
|
||||||
|
</view>
|
||||||
|
<view class="record-list-item-date">{{item.created_at}}</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<!-- 无列表 -->
|
||||||
|
<no-list v-if="lists.length === 0" name='no-record' txt="没有任何贡献值记录 ~ " />
|
||||||
|
|
||||||
|
<!-- <u-toast ref="uToast" /> -->
|
||||||
|
<u-toast ref="uToast" />
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import {userAccoutScores} from '@/apis/interfaces/withdraws';
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
lists:[],
|
||||||
|
has_next_page:true,
|
||||||
|
page:1,
|
||||||
|
type:'year', // 统计类型day日,month月,year年
|
||||||
|
date:new Date().toISOString().slice(0,4), // 日:Y-m-d,月Y-m,年Y
|
||||||
|
params: {
|
||||||
|
year: true,
|
||||||
|
month: false,
|
||||||
|
day: false
|
||||||
|
},
|
||||||
|
show: false, // 显示
|
||||||
|
currentDay:new Date().toISOString().slice(0,10),
|
||||||
|
currentMonth:new Date().toISOString().slice(0,7),
|
||||||
|
currentYear:new Date().toISOString().slice(0,4),
|
||||||
|
score:'',
|
||||||
|
cointype:'all'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onShow(){
|
||||||
|
this.getList()
|
||||||
|
},
|
||||||
|
onReachBottom(){
|
||||||
|
if (this.has_next_page) {
|
||||||
|
this.page = this.page + 1
|
||||||
|
this.getList()
|
||||||
|
} else {
|
||||||
|
this.$refs.uToast.show({
|
||||||
|
title: '吼吼吼~我是有底的~',
|
||||||
|
type: 'primary',
|
||||||
|
duration: 3000
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
// 获取列表
|
||||||
|
getList(){
|
||||||
|
let data = {
|
||||||
|
page:this.page,
|
||||||
|
type:this.type,
|
||||||
|
date:this.date,
|
||||||
|
frozen:this.cointype
|
||||||
|
}
|
||||||
|
userAccoutScores(data).then(res => {
|
||||||
|
this.score = parseInt(res.score)
|
||||||
|
this.lists = this.lists.concat(res.lists.data)
|
||||||
|
this.has_next_page = res.lists.page.has_more
|
||||||
|
}).catch(err => {
|
||||||
|
this.$refs.uToast.show({
|
||||||
|
title: err.message,
|
||||||
|
type: 'primary',
|
||||||
|
duration: 3000
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
selectCoinType(type){
|
||||||
|
if(this.cointype !== type){
|
||||||
|
this.cointype = type
|
||||||
|
this.reset()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 重置
|
||||||
|
reset(){
|
||||||
|
this.page = 1
|
||||||
|
this.lists = []
|
||||||
|
this.has_next_page = true
|
||||||
|
this.getList()
|
||||||
|
},
|
||||||
|
// 选择 年 月 日 切换要重置数据
|
||||||
|
selectType(type){
|
||||||
|
if(this.type !== type){
|
||||||
|
switch(type){
|
||||||
|
case 'year':
|
||||||
|
this.type = type
|
||||||
|
this.params= {
|
||||||
|
year: true,
|
||||||
|
month: false,
|
||||||
|
day: false
|
||||||
|
}
|
||||||
|
this.date = this.currentYear
|
||||||
|
this.reset()
|
||||||
|
break;
|
||||||
|
case 'month':
|
||||||
|
this.type = type
|
||||||
|
this.params= {
|
||||||
|
year: true,
|
||||||
|
month: true,
|
||||||
|
day: false
|
||||||
|
}
|
||||||
|
this.date = this.currentMonth
|
||||||
|
this.reset()
|
||||||
|
break;
|
||||||
|
case 'day':
|
||||||
|
this.type = type
|
||||||
|
this.params= {
|
||||||
|
year: true,
|
||||||
|
month: true,
|
||||||
|
day: true
|
||||||
|
}
|
||||||
|
this.date = this.currentDay
|
||||||
|
this.reset()
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 点击确认按钮
|
||||||
|
confirm(e){
|
||||||
|
let type = this.type
|
||||||
|
switch(type){
|
||||||
|
case 'year':
|
||||||
|
this.date = e.year
|
||||||
|
this.reset()
|
||||||
|
break;
|
||||||
|
case 'month':
|
||||||
|
this.date = e.year + '-' + e.month
|
||||||
|
this.reset()
|
||||||
|
break;
|
||||||
|
case 'day':
|
||||||
|
this.date = e.year + '-' + e.month + '-' + e.day
|
||||||
|
this.reset()
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.Record {
|
||||||
|
width: 100%;
|
||||||
|
min-height: 100vh;
|
||||||
|
padding-top: 30rpx;
|
||||||
|
background-color: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.record-list {
|
||||||
|
padding: 20rpx 30rpx;
|
||||||
|
|
||||||
|
.record-list-item {
|
||||||
|
padding: 30rpx 0;
|
||||||
|
border-bottom: solid 1rpx #f7f7f7;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: flex-start;
|
||||||
|
box-sizing: border-box;
|
||||||
|
.record-icon{
|
||||||
|
width: 60rpx;
|
||||||
|
margin-right: 20rpx;
|
||||||
|
}
|
||||||
|
.record-list-item-top {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
box-sizing: border-box;
|
||||||
|
width: 600rpx;
|
||||||
|
.tags{
|
||||||
|
padding-left: 20rpx;
|
||||||
|
color: #ff5500;
|
||||||
|
font-size: 24rpx;
|
||||||
|
}
|
||||||
|
.title {
|
||||||
|
font-size: 28rpx;
|
||||||
|
width: 600rpx;
|
||||||
|
color: #444;
|
||||||
|
word-break: break-all;
|
||||||
|
}
|
||||||
|
|
||||||
|
.money {
|
||||||
|
color: #ee4c47;
|
||||||
|
font-size: 40rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
// padding-top: 20rpx;
|
||||||
|
position: relative;
|
||||||
|
top: 20rpx;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: flex-end;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.record-list-item-date {
|
||||||
|
font-size: 26rpx;
|
||||||
|
color: #a6a6a6;
|
||||||
|
margin-top: 10rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.record-top {
|
||||||
|
width: calc(100% - 60rpx);
|
||||||
|
// height: 360rpx;
|
||||||
|
background-image: linear-gradient(to bottom, #e93340, #e93340);
|
||||||
|
box-shadow: 0 10rpx 20rpx 0rpx rgba($color: #e93340, $alpha: 0.4);
|
||||||
|
margin: 0 30rpx;
|
||||||
|
border-radius: 20rpx;
|
||||||
|
box-sizing: border-box;
|
||||||
|
position: relative;
|
||||||
|
padding: 10rpx 30rpx 50rpx 50rpx;
|
||||||
|
z-index: 1;
|
||||||
|
|
||||||
|
.record-bg {
|
||||||
|
position: absolute;
|
||||||
|
width: 100%;
|
||||||
|
bottom: 0;
|
||||||
|
right: 0;
|
||||||
|
z-index: 1;
|
||||||
|
opacity: .5;
|
||||||
|
}
|
||||||
|
|
||||||
|
.record-top-nav {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
box-sizing: border-box;
|
||||||
|
|
||||||
|
.record-top-item {
|
||||||
|
margin: 40rpx 20rpx;
|
||||||
|
font-size: 30rpx;
|
||||||
|
font-weight: 500;
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
.selectTopItem{
|
||||||
|
border-bottom: solid 4rpx #fff;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.record-mouth-year {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
align-items: flex-start;
|
||||||
|
justify-content: space-between;
|
||||||
|
box-sizing: border-box;
|
||||||
|
position: relative;
|
||||||
|
z-index: 2;
|
||||||
|
color: #fff;
|
||||||
|
font-size: 30rpx;
|
||||||
|
// margin-top: 20rpx;
|
||||||
|
|
||||||
|
.record-type-left {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: flex-start;
|
||||||
|
box-sizing: border-box;
|
||||||
|
|
||||||
|
uni-icons {
|
||||||
|
margin-left: 4rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.record-type-right {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: flex-start;
|
||||||
|
box-sizing: border-box;
|
||||||
|
font-size: 24rpx;
|
||||||
|
|
||||||
|
.pay_type_item {
|
||||||
|
// margin: 0 10rpx;
|
||||||
|
padding: 2rpx 20rpx;
|
||||||
|
border-radius: 30rpx;
|
||||||
|
border: solid 1rpx rgba($color: #000000, $alpha: 0);
|
||||||
|
}
|
||||||
|
.pay_type_item_select{
|
||||||
|
border: solid 1rpx #f7f7f7;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.record-title {
|
||||||
|
font-size: 28rpx;
|
||||||
|
color: #fff;
|
||||||
|
padding:0 0 20rpx 0;
|
||||||
|
margin-top: 30rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.record-money {
|
||||||
|
color: #fff;
|
||||||
|
font-size: 60rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
|
||||||
|
span {
|
||||||
|
font-size: 24rpx;
|
||||||
|
font-weight: 400;
|
||||||
|
padding-left: 20rpx;
|
||||||
|
margin-right: 4rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</style>
|
||||||
347
pages/wallet/property.vue
Normal file
@@ -0,0 +1,347 @@
|
|||||||
|
<template>
|
||||||
|
<view class="propertyIndex">
|
||||||
|
<view class="propery">
|
||||||
|
<image src="/static/imgs/account-bg.png" mode="aspectFill" class="record-bg" />
|
||||||
|
<view class="propery-content">
|
||||||
|
<view class="currency">能量球钱包
|
||||||
|
<span>(≈ {{ price || '0.00' }} CNY)</span>
|
||||||
|
</view>
|
||||||
|
<view class="balance">{{ balance.balance || '0.00' }}</view>
|
||||||
|
<!-- <view class="frozen">{{ balance.frozen || '0.00' }} 冻结中</view> -->
|
||||||
|
<view class="balance-flex">
|
||||||
|
<view class="balance-flex-item" @click="showAddress">区块链地址</view>
|
||||||
|
<!-- <view class="balance-flex-item" @click="showPrivatekey('privatekey')">我的私钥</view> -->
|
||||||
|
<view class="balance-flex-item" @click="$Router.push({name: 'Extract'})">能量球转红包</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<!-- 账户记录 -->
|
||||||
|
<view class="record">
|
||||||
|
<view class="record-tabs">
|
||||||
|
<view class="tabs-item" :class="logsType === '' ? 'show': ''" @click="onLogsType('')">全部</view>
|
||||||
|
<view class="tabs-item" :class="logsType === 'in' ? 'show': ''" @click="onLogsType('in')">收入</view>
|
||||||
|
<view class="tabs-item" :class="logsType === 'out' ? 'show': ''" @click="onLogsType('out')">支出</view>
|
||||||
|
</view>
|
||||||
|
<record :list="logs" :logsType="logsType" :hash='true' />
|
||||||
|
<!-- ios安全距离 -->
|
||||||
|
<view class="ios-bottom"></view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import record from '@/components/property/record'
|
||||||
|
import h5Copy from '@/js_sdk/junyi-h5-copy/junyi-h5-copy/junyi-h5-copy'
|
||||||
|
import {
|
||||||
|
sum,
|
||||||
|
price,
|
||||||
|
logs,
|
||||||
|
code
|
||||||
|
} from '@/apis/interfaces/wallet'
|
||||||
|
export default {
|
||||||
|
components: {
|
||||||
|
record
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
balance: {},
|
||||||
|
price: '0.00',
|
||||||
|
logs: [],
|
||||||
|
logsType: '', // ''全部in入out出
|
||||||
|
password: '',
|
||||||
|
passwordPages: ''
|
||||||
|
};
|
||||||
|
},
|
||||||
|
onShow() {
|
||||||
|
this.getsum()
|
||||||
|
this.getlog()
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
getsum() {
|
||||||
|
sum().then(res => {
|
||||||
|
this.balance = res
|
||||||
|
this.price = res.price
|
||||||
|
}).catch(err => {
|
||||||
|
uni.showToast({
|
||||||
|
icon: 'none',
|
||||||
|
title: err.message
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
getlog() {
|
||||||
|
logs().then(res => {
|
||||||
|
this.logs = res
|
||||||
|
}).catch(err => {
|
||||||
|
uni.showToast({
|
||||||
|
icon: 'none',
|
||||||
|
title: err.message
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 弹出私钥
|
||||||
|
showPrivatekey(pages) {
|
||||||
|
this.passwordPages = pages
|
||||||
|
this.$refs.showPassword.open('center')
|
||||||
|
},
|
||||||
|
// 交易记录
|
||||||
|
onLogsType(index) {
|
||||||
|
if (this.logsType === index) return
|
||||||
|
this.logsType = index
|
||||||
|
let flag
|
||||||
|
switch(index){
|
||||||
|
case '':
|
||||||
|
flag = 0
|
||||||
|
break;
|
||||||
|
case 'in':
|
||||||
|
flag = 2
|
||||||
|
break;
|
||||||
|
case 'out':
|
||||||
|
flag = 1
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
this.logs = []
|
||||||
|
logs({
|
||||||
|
flag: flag
|
||||||
|
}).then(res => {
|
||||||
|
this.logs = res
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 区块地址
|
||||||
|
showAddress() {
|
||||||
|
uni.showModal({
|
||||||
|
title: '我的区块链地址',
|
||||||
|
content: '\n地址可以理解为银行卡卡号,与他人转账时是区块链上的两个地址间的交易行为\n\n' + this.balance.address,
|
||||||
|
confirmText: '复制',
|
||||||
|
confirmColor: '#b11eff',
|
||||||
|
showCancel: false,
|
||||||
|
success: (res) => {
|
||||||
|
if (res.confirm) {
|
||||||
|
uni.setClipboardData({
|
||||||
|
data: this.balance.address,
|
||||||
|
success() {
|
||||||
|
uni.showToast({
|
||||||
|
title: '区块链地址已复制',
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onNavigationBarButtonTap(e) {
|
||||||
|
if (e.index === 0) {
|
||||||
|
uni.showActionSheet({
|
||||||
|
// itemList: ['转账', '收款', '提币', '修改密码'],
|
||||||
|
itemList: ['提现', '修改密码'],
|
||||||
|
success: (res) => {
|
||||||
|
switch (res.tapIndex) {
|
||||||
|
case 0:
|
||||||
|
console.log('提现了,')
|
||||||
|
this.$Router.push({
|
||||||
|
name: 'Extract'
|
||||||
|
})
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
this.showPrivatekey('resetPassword')
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
uni.hideLoading()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.propertyIndex {
|
||||||
|
width: 100%;
|
||||||
|
min-height: 100vh;
|
||||||
|
background-color: #FFFFFF;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 验证密码弹出层
|
||||||
|
.validationPassword {
|
||||||
|
background-color: white;
|
||||||
|
border-radius: 20rpx;width: 70vw;
|
||||||
|
|
||||||
|
.from {
|
||||||
|
padding: $padding*2;
|
||||||
|
|
||||||
|
.title {
|
||||||
|
text-align: center;
|
||||||
|
font-size: $title-size;
|
||||||
|
padding-bottom: $padding*2;
|
||||||
|
font-weight: bold;
|
||||||
|
color: $text-price;
|
||||||
|
}
|
||||||
|
|
||||||
|
.input {
|
||||||
|
text-align: center;
|
||||||
|
height: 90rpx;
|
||||||
|
font-size: $title-size;
|
||||||
|
border-radius: 20rpx; background: $border-color-lg;
|
||||||
|
padding: 0 ($padding*2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.buttons {
|
||||||
|
display: flex;
|
||||||
|
border-top: solid 1rpx $border-color;
|
||||||
|
|
||||||
|
.button {
|
||||||
|
width: 50%;
|
||||||
|
font-size: $title-size;
|
||||||
|
line-height: 90rpx;
|
||||||
|
height: 90rpx;
|
||||||
|
text-align: center;
|
||||||
|
box-sizing: border-box;
|
||||||
|
|
||||||
|
&.cancel {
|
||||||
|
border-right: solid 1rpx $border-color;
|
||||||
|
color: $text-gray;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.confirm {
|
||||||
|
color: $text-price;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// .button{
|
||||||
|
// background-color: $text-price;
|
||||||
|
// color: white;
|
||||||
|
// border-radius: 20rpx// border: none;
|
||||||
|
// margin-top: $margin*2;
|
||||||
|
// font-size: $title-size;
|
||||||
|
// height: 90rpx;
|
||||||
|
// line-height: 90rpx;
|
||||||
|
// }
|
||||||
|
// .close{
|
||||||
|
// @extend .button;
|
||||||
|
// text-align: center;
|
||||||
|
// color: $text-gray;
|
||||||
|
// margin-top: $margin;
|
||||||
|
// background-color: transparent;
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
|
||||||
|
// 账户
|
||||||
|
.propery {
|
||||||
|
position: relative;
|
||||||
|
padding-top: var(--status-bar-height);
|
||||||
|
background-image: linear-gradient(to top, #7c52fc, #976dff);
|
||||||
|
position: relative;
|
||||||
|
overflow: hidden;
|
||||||
|
|
||||||
|
.record-bg {
|
||||||
|
position: absolute;
|
||||||
|
width: 100%;
|
||||||
|
height: 300rpx;
|
||||||
|
bottom: 0;
|
||||||
|
right: 0;
|
||||||
|
z-index: 1;
|
||||||
|
opacity: .5;
|
||||||
|
transform: rotate(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
// &::before {
|
||||||
|
// position: absolute;
|
||||||
|
// left: 0;
|
||||||
|
// top: 0;
|
||||||
|
// width: 100%;
|
||||||
|
// height: 100%;
|
||||||
|
// content: " ";
|
||||||
|
// background-image: url(@/static/imgs/account-bg.png);
|
||||||
|
// background-size: 100%;
|
||||||
|
// background-repeat: no-repeat;
|
||||||
|
// opacity: .5;
|
||||||
|
// transform:rotate(0deg);
|
||||||
|
// }
|
||||||
|
|
||||||
|
.propery-content {
|
||||||
|
position: relative;
|
||||||
|
z-index: 1;
|
||||||
|
padding: $padding/2 $padding $padding*3;
|
||||||
|
text-align: center;
|
||||||
|
|
||||||
|
.currency {
|
||||||
|
font-size: $title-size-m;
|
||||||
|
color: rgba($color: white, $alpha: .8);
|
||||||
|
}
|
||||||
|
|
||||||
|
.balance {
|
||||||
|
font-size: $title-size * 2.5;
|
||||||
|
padding: $padding 0;
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
|
|
||||||
|
.frozen {
|
||||||
|
background: rgba($color: #000000, $alpha: .1);
|
||||||
|
color: rgba($color: white, $alpha: .7);
|
||||||
|
display: inline-block;
|
||||||
|
font-size: 24rpx;
|
||||||
|
padding: 6rpx $padding;
|
||||||
|
border-radius: 20rpx; border: solid 1rpx rgba($color: white, $alpha: .4)
|
||||||
|
}
|
||||||
|
|
||||||
|
.balance-flex {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
margin-top: $margin * 2;
|
||||||
|
|
||||||
|
.balance-flex-item {
|
||||||
|
background-color: white;
|
||||||
|
width: 200rpx;
|
||||||
|
height: 75rpx;
|
||||||
|
line-height: 75rpx;
|
||||||
|
color: $text-price;
|
||||||
|
margin: 0 $margin;
|
||||||
|
border-radius: 20rpx; font-size: 28rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 记录
|
||||||
|
.record {
|
||||||
|
background-color: white;
|
||||||
|
border-radius: $radius $radius 0 0;
|
||||||
|
padding: $padding ($padding * 2);
|
||||||
|
margin-top: -$margin;
|
||||||
|
position: relative;
|
||||||
|
z-index: 2;
|
||||||
|
|
||||||
|
.record-tabs {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-around;
|
||||||
|
font-weight: bold;
|
||||||
|
font-size: $title-size;
|
||||||
|
color: $text-gray;
|
||||||
|
line-height: 70rpx;
|
||||||
|
margin-bottom: $margin;
|
||||||
|
|
||||||
|
.tabs-item {
|
||||||
|
position: relative;
|
||||||
|
padding: 0 $padding;
|
||||||
|
|
||||||
|
&.show {
|
||||||
|
color: $text-price;
|
||||||
|
|
||||||
|
&::before {
|
||||||
|
position: absolute;
|
||||||
|
bottom: 0;
|
||||||
|
left: $padding;
|
||||||
|
right: $padding;
|
||||||
|
height: 4rpx;
|
||||||
|
content: " ";
|
||||||
|
background-color: $text-price;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
325
pages/wallet/redProperty.vue
Normal file
@@ -0,0 +1,325 @@
|
|||||||
|
<template>
|
||||||
|
<view class="propertyIndex">
|
||||||
|
<view class="propery">
|
||||||
|
<image src="/static/imgs/account-bg.png" mode="aspectFill" class="record-bg" />
|
||||||
|
<view class="propery-content">
|
||||||
|
<view class="currency">可提现额度
|
||||||
|
<!-- <span>(≈ {{ price || '0.00' }} CNY)</span> -->
|
||||||
|
</view>
|
||||||
|
<view class="balance">{{ cash || '0.00' }}</view>
|
||||||
|
<!-- <view class="frozen">{{ balance.frozen || '0.00' }} 冻结中</view> -->
|
||||||
|
<view class="balance-flex">
|
||||||
|
<!-- <view class="balance-flex-item" @click="showAddress">区块链地址</view> -->
|
||||||
|
<!-- <view class="balance-flex-item" @click="showPrivatekey('privatekey')">我的私钥</view> -->
|
||||||
|
<view class="balance-flex-item" @click="$Router.push({name: 'ExtractRed'})">提现至银行卡</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<!-- 账户记录 -->
|
||||||
|
<view class="record">
|
||||||
|
<view class="record-tabs">
|
||||||
|
<view class="tabs-item" :class="logsType === '' ? 'show': ''" @click="onLogsType('')">全部</view>
|
||||||
|
<view class="tabs-item" :class="logsType === 'in' ? 'show': ''" @click="onLogsType('in')">收入</view>
|
||||||
|
<view class="tabs-item" :class="logsType === 'out' ? 'show': ''" @click="onLogsType('out')">支出</view>
|
||||||
|
</view>
|
||||||
|
<record :list="logs" :logsType="logsType" />
|
||||||
|
<!-- ios安全距离 -->
|
||||||
|
<view class="ios-bottom"></view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import record from '@/components/property/record'
|
||||||
|
import h5Copy from '@/js_sdk/junyi-h5-copy/junyi-h5-copy/junyi-h5-copy'
|
||||||
|
import {
|
||||||
|
logs,
|
||||||
|
accountCashs,// 现金红包新增
|
||||||
|
} from '@/apis/interfaces/wallet'
|
||||||
|
export default {
|
||||||
|
components: {
|
||||||
|
record
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
logs: [],
|
||||||
|
logsType: '', // ''全部in入out出
|
||||||
|
cash:'0.00',
|
||||||
|
has_more:true,
|
||||||
|
page:1
|
||||||
|
};
|
||||||
|
},
|
||||||
|
onLoad() {
|
||||||
|
this.getlog()
|
||||||
|
},
|
||||||
|
onShow() {
|
||||||
|
if(uni.getStorageSync('refresh')){
|
||||||
|
this.logsType = ''
|
||||||
|
this.reset()
|
||||||
|
uni.setStorageSync('refresh',false)
|
||||||
|
}else{
|
||||||
|
console.log('没有更多更新')
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onReachBottom() {
|
||||||
|
console.log('chudi.....')
|
||||||
|
if(this.has_more){
|
||||||
|
this.page = this.page+1
|
||||||
|
this.getlog()
|
||||||
|
}else{
|
||||||
|
uni.showToast({
|
||||||
|
title:'我是有底线的~',
|
||||||
|
icon:'none'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
getlog() {
|
||||||
|
let data = {
|
||||||
|
type:this.logsType,//''全部in入out出
|
||||||
|
page:this.page
|
||||||
|
}
|
||||||
|
accountCashs(data).then(res => {
|
||||||
|
console.log(res)
|
||||||
|
this.logs = this.logs.concat(res.lists.data)
|
||||||
|
this.cash = res.cash
|
||||||
|
this.has_more = res.lists.page.has_more
|
||||||
|
}).catch(err => {
|
||||||
|
uni.showToast({
|
||||||
|
icon: 'none',
|
||||||
|
title: err.message
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 交易记录
|
||||||
|
onLogsType(index) {
|
||||||
|
if (this.logsType === index) return
|
||||||
|
this.logsType = index
|
||||||
|
this.reset()
|
||||||
|
},
|
||||||
|
reset(){
|
||||||
|
this.logs = []
|
||||||
|
this.has_more = true
|
||||||
|
this.page =1
|
||||||
|
this.getlog()
|
||||||
|
},
|
||||||
|
// 区块地址
|
||||||
|
showAddress() {
|
||||||
|
uni.showModal({
|
||||||
|
title: '我的区块链地址',
|
||||||
|
content: '\n地址可以理解为银行卡卡号,与他人转账时是区块链上的两个地址间的交易行为\n\n' + this.balance.address,
|
||||||
|
confirmText: '复制',
|
||||||
|
confirmColor: '#b11eff',
|
||||||
|
showCancel:false,
|
||||||
|
success: (res) => {
|
||||||
|
if (res.confirm) {
|
||||||
|
uni.setClipboardData({
|
||||||
|
data: this.balance.address,
|
||||||
|
success() {
|
||||||
|
uni.showToast({
|
||||||
|
title: '区块链地址已复制',
|
||||||
|
icon : 'none'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.propertyIndex {
|
||||||
|
width: 100%;
|
||||||
|
min-height: 100vh;
|
||||||
|
background-color: #FFFFFF;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 验证密码弹出层
|
||||||
|
.validationPassword {
|
||||||
|
background-color: white;
|
||||||
|
border-radius: 20rpx;
|
||||||
|
width: 70vw;
|
||||||
|
|
||||||
|
.from {
|
||||||
|
padding: $padding*2;
|
||||||
|
|
||||||
|
.title {
|
||||||
|
text-align: center;
|
||||||
|
font-size: $title-size;
|
||||||
|
padding-bottom: $padding*2;
|
||||||
|
font-weight: bold;
|
||||||
|
color: $text-price;
|
||||||
|
}
|
||||||
|
|
||||||
|
.input {
|
||||||
|
text-align: center;
|
||||||
|
height: 90rpx;
|
||||||
|
font-size: $title-size;
|
||||||
|
border-radius: 20rpx;
|
||||||
|
background: $border-color-lg;
|
||||||
|
padding: 0 ($padding*2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.buttons {
|
||||||
|
display: flex;
|
||||||
|
border-top: solid 1rpx $border-color;
|
||||||
|
|
||||||
|
.button {
|
||||||
|
width: 50%;
|
||||||
|
font-size: $title-size;
|
||||||
|
line-height: 90rpx;
|
||||||
|
height: 90rpx;
|
||||||
|
text-align: center;
|
||||||
|
box-sizing: border-box;
|
||||||
|
|
||||||
|
&.cancel {
|
||||||
|
border-right: solid 1rpx $border-color;
|
||||||
|
color: $text-gray;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.confirm {
|
||||||
|
color: $text-price;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// .button{
|
||||||
|
// background-color: $text-price;
|
||||||
|
// color: white;
|
||||||
|
// border-radius: 20rpx;
|
||||||
|
// border: none;
|
||||||
|
// margin-top: $margin*2;
|
||||||
|
// font-size: $title-size;
|
||||||
|
// height: 90rpx;
|
||||||
|
// line-height: 90rpx;
|
||||||
|
// }
|
||||||
|
// .close{
|
||||||
|
// @extend .button;
|
||||||
|
// text-align: center;
|
||||||
|
// color: $text-gray;
|
||||||
|
// margin-top: $margin;
|
||||||
|
// background-color: transparent;
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
|
||||||
|
// 账户
|
||||||
|
.propery {
|
||||||
|
position: relative;
|
||||||
|
padding-top: var(--status-bar-height);
|
||||||
|
background-image: linear-gradient(to top, #7c52fc, #976dff);
|
||||||
|
position: relative;
|
||||||
|
overflow: hidden;
|
||||||
|
.record-bg {
|
||||||
|
position: absolute;
|
||||||
|
width: 100%;
|
||||||
|
height: 300rpx;
|
||||||
|
bottom: 0;
|
||||||
|
right: 0;
|
||||||
|
z-index: 1;
|
||||||
|
opacity: .5;
|
||||||
|
transform: rotate(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
// &::before {
|
||||||
|
// position: absolute;
|
||||||
|
// left: 0;
|
||||||
|
// top: 0;
|
||||||
|
// width: 100%;
|
||||||
|
// height: 100%;
|
||||||
|
// content: " ";
|
||||||
|
// background-image: url(@/static/imgs/account-bg.png);
|
||||||
|
// background-size: 100%;
|
||||||
|
// background-repeat: no-repeat;
|
||||||
|
// opacity: .5;
|
||||||
|
// transform:rotate(0deg);
|
||||||
|
// }
|
||||||
|
|
||||||
|
.propery-content {
|
||||||
|
position: relative;
|
||||||
|
z-index: 1;
|
||||||
|
padding: $padding/2 $padding $padding*3;
|
||||||
|
text-align: center;
|
||||||
|
|
||||||
|
.currency {
|
||||||
|
font-size: $title-size-m;
|
||||||
|
color: rgba($color: white, $alpha: .8);
|
||||||
|
}
|
||||||
|
|
||||||
|
.balance {
|
||||||
|
font-size: $title-size * 2.5;
|
||||||
|
padding: $padding 0;
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
|
|
||||||
|
.frozen {
|
||||||
|
background: rgba($color: #000000, $alpha: .1);
|
||||||
|
color: rgba($color: white, $alpha: .7);
|
||||||
|
display: inline-block;
|
||||||
|
font-size: 24rpx;
|
||||||
|
padding: 6rpx $padding;
|
||||||
|
border-radius: 20rpx;
|
||||||
|
border: solid 1rpx rgba($color: white, $alpha: .4)
|
||||||
|
}
|
||||||
|
|
||||||
|
.balance-flex {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
margin-top: $margin * 2;
|
||||||
|
|
||||||
|
.balance-flex-item {
|
||||||
|
background-color: white;
|
||||||
|
width: 300rpx;
|
||||||
|
height: 75rpx;
|
||||||
|
line-height: 75rpx;
|
||||||
|
color: $text-price;
|
||||||
|
margin: 0 $margin;
|
||||||
|
border-radius: 20rpx;
|
||||||
|
font-size: 28rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 记录
|
||||||
|
.record {
|
||||||
|
background-color: white;
|
||||||
|
border-radius: $radius $radius 0 0;
|
||||||
|
padding: $padding ($padding * 2);
|
||||||
|
margin-top: -$margin;
|
||||||
|
position: relative;
|
||||||
|
z-index: 2;
|
||||||
|
|
||||||
|
.record-tabs {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-around;
|
||||||
|
font-weight: bold;
|
||||||
|
font-size: $title-size;
|
||||||
|
color: $text-gray;
|
||||||
|
line-height: 70rpx;
|
||||||
|
margin-bottom: $margin;
|
||||||
|
|
||||||
|
.tabs-item {
|
||||||
|
position: relative;
|
||||||
|
padding: 0 $padding;
|
||||||
|
|
||||||
|
&.show {
|
||||||
|
color: $text-price;
|
||||||
|
|
||||||
|
&::before {
|
||||||
|
position: absolute;
|
||||||
|
bottom: 0;
|
||||||
|
left: $padding;
|
||||||
|
right: $padding;
|
||||||
|
height: 4rpx;
|
||||||
|
content: " ";
|
||||||
|
background-color: $text-price;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
441
pages/wallet/withdrawList.vue
Normal file
@@ -0,0 +1,441 @@
|
|||||||
|
<template>
|
||||||
|
<view class="Record">
|
||||||
|
<view class="record-top">
|
||||||
|
<image src="/static/imgs/account-bg.png" mode="widthFix" class="record-bg" />
|
||||||
|
<view class="record-top-nav">
|
||||||
|
<view :class="['record-top-item',type==='year'?'selectTopItem':'']" @click="selectType('year')">年账单
|
||||||
|
</view>
|
||||||
|
<view :class="['record-top-item',type==='month'?'selectTopItem':'']" @click="selectType('month')">月账单
|
||||||
|
</view>
|
||||||
|
<view :class="['record-top-item',type==='day'?'selectTopItem':'']" @click="selectType('day')">日账单</view>
|
||||||
|
</view>
|
||||||
|
<view class="record-mouth-year">
|
||||||
|
<view class="record-type-right">
|
||||||
|
<view class="record-title">可提现额度
|
||||||
|
<view class="record-type-left">
|
||||||
|
<u-picker mode="time" v-model="show" :params="params" @confirm='confirm' title='筛选日期'
|
||||||
|
start-year='2021' :end-year='currentYear' />
|
||||||
|
<view @click="show = true">
|
||||||
|
{{date?date:'选择日期'}}
|
||||||
|
<uni-icons type="arrowdown" color="#fff" size="12" />
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="record-money">{{account || '0.00'}} </view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
</view>
|
||||||
|
<!-- <view class="record-title">碎片个数</view>
|
||||||
|
<view class="record-money"><span>¥</span>{{account || '0.00'}}</view> -->
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<!-- 列表。。。 -->
|
||||||
|
<view class="ew_lists" v-if="lists.length>0">
|
||||||
|
<view style="padding-top: 30rpx;" v-for="(item,index) in lists " :key="index">
|
||||||
|
<view class="receiptCode">
|
||||||
|
<image class="logo" src="/static/imgs/record-icon.png" mode="widthFix" />
|
||||||
|
<view class="title">{{item.way}}</view>
|
||||||
|
<span class='status'> {{item.status.status_text}}</span>
|
||||||
|
</view>
|
||||||
|
<view class="item">
|
||||||
|
<view class="left">
|
||||||
|
<span>
|
||||||
|
提现:¥{{item.quantity}}
|
||||||
|
<span class='left-des'>实际到账:¥{{item.take}} 手续费:{{item.tax}}</span>
|
||||||
|
</span>
|
||||||
|
<span>{{item.create_at}}</span>
|
||||||
|
</view>
|
||||||
|
<!-- <view class="right">
|
||||||
|
<span> {{item.create_at}}</span>
|
||||||
|
<span> -</span>
|
||||||
|
</view> -->
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<!-- 无列表 -->
|
||||||
|
<no-list v-if="lists.length === 0" name='no-record' txt="没有任何提现记录 ~ " />
|
||||||
|
|
||||||
|
<!-- <u-toast ref="uToast" /> -->
|
||||||
|
<u-toast ref="uToast" />
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import {
|
||||||
|
withdrawsIndexLists
|
||||||
|
} from '@/apis/interfaces/withdraws';
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
lists: [],
|
||||||
|
has_next_page: true,
|
||||||
|
page: 1,
|
||||||
|
type: 'year', // 统计类型day日,month月,year年
|
||||||
|
date: new Date().toISOString().slice(0, 4), // 日:Y-m-d,月Y-m,年Y
|
||||||
|
params: {
|
||||||
|
year: true,
|
||||||
|
month: false,
|
||||||
|
day: false
|
||||||
|
},
|
||||||
|
show: false, // 显示
|
||||||
|
currentDay: new Date().toISOString().slice(0, 10),
|
||||||
|
currentMonth: new Date().toISOString().slice(0, 7),
|
||||||
|
currentYear: new Date().toISOString().slice(0, 4),
|
||||||
|
account: ''
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onLoad() {
|
||||||
|
this.getList()
|
||||||
|
},
|
||||||
|
onReachBottom() {
|
||||||
|
if (this.has_next_page) {
|
||||||
|
this.page = this.page + 1
|
||||||
|
this.getList()
|
||||||
|
} else {
|
||||||
|
this.$refs.uToast.show({
|
||||||
|
title: '吼吼吼~我是有底的~',
|
||||||
|
type: 'primary',
|
||||||
|
duration: 3000
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
// 获取列表
|
||||||
|
getList() {
|
||||||
|
let data = {
|
||||||
|
page: this.page,
|
||||||
|
type: this.type,
|
||||||
|
date: this.date,
|
||||||
|
}
|
||||||
|
withdrawsIndexLists(data).then(res => {
|
||||||
|
console.log(res)
|
||||||
|
this.account = res.all
|
||||||
|
this.lists = this.lists.concat(res.lists.data)
|
||||||
|
this.has_next_page = res.lists.page.has_more
|
||||||
|
}).catch(err => {
|
||||||
|
this.$refs.uToast.show({
|
||||||
|
title: err.message,
|
||||||
|
type: 'primary',
|
||||||
|
duration: 3000
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
selectCoinType(type) {
|
||||||
|
if (this.cointype !== type) {
|
||||||
|
this.cointype = type
|
||||||
|
this.reset()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 重置
|
||||||
|
reset() {
|
||||||
|
this.page = 1
|
||||||
|
this.lists = []
|
||||||
|
this.has_next_page = true
|
||||||
|
this.getList()
|
||||||
|
},
|
||||||
|
// 选择 年 月 日 切换要重置数据
|
||||||
|
selectType(type) {
|
||||||
|
if (this.type !== type) {
|
||||||
|
switch (type) {
|
||||||
|
case 'year':
|
||||||
|
this.type = type
|
||||||
|
this.params = {
|
||||||
|
year: true,
|
||||||
|
month: false,
|
||||||
|
day: false
|
||||||
|
}
|
||||||
|
this.date = this.currentYear
|
||||||
|
this.reset()
|
||||||
|
break;
|
||||||
|
case 'month':
|
||||||
|
this.type = type
|
||||||
|
this.params = {
|
||||||
|
year: true,
|
||||||
|
month: true,
|
||||||
|
day: false
|
||||||
|
}
|
||||||
|
this.date = this.currentMonth
|
||||||
|
this.reset()
|
||||||
|
break;
|
||||||
|
case 'day':
|
||||||
|
this.type = type
|
||||||
|
this.params = {
|
||||||
|
year: true,
|
||||||
|
month: true,
|
||||||
|
day: true
|
||||||
|
}
|
||||||
|
this.date = this.currentDay
|
||||||
|
this.reset()
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 点击确认按钮
|
||||||
|
confirm(e) {
|
||||||
|
let type = this.type
|
||||||
|
switch (type) {
|
||||||
|
case 'year':
|
||||||
|
this.date = e.year
|
||||||
|
this.reset()
|
||||||
|
break;
|
||||||
|
case 'month':
|
||||||
|
this.date = e.year + '-' + e.month
|
||||||
|
this.reset()
|
||||||
|
break;
|
||||||
|
case 'day':
|
||||||
|
this.date = e.year + '-' + e.month + '-' + e.day
|
||||||
|
this.reset()
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.Record {
|
||||||
|
width: 100%;
|
||||||
|
min-height: 100vh;
|
||||||
|
padding-top: 30rpx;
|
||||||
|
background-color: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.record-list {
|
||||||
|
padding: 20rpx 30rpx;
|
||||||
|
|
||||||
|
.record-list-item {
|
||||||
|
padding: 30rpx 0;
|
||||||
|
border-bottom: solid 1rpx #f7f7f7;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: flex-start;
|
||||||
|
box-sizing: border-box;
|
||||||
|
|
||||||
|
.record-icon {
|
||||||
|
width: 60rpx;
|
||||||
|
margin-right: 20rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.record-list-item-top {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
box-sizing: border-box;
|
||||||
|
width: 600rpx;
|
||||||
|
|
||||||
|
.title {
|
||||||
|
font-size: 28rpx;
|
||||||
|
width: 600rpx;
|
||||||
|
color: #444;
|
||||||
|
word-break: break-all;
|
||||||
|
}
|
||||||
|
|
||||||
|
.money {
|
||||||
|
color: #ee4c47;
|
||||||
|
font-size: 40rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
// padding-top: 20rpx;
|
||||||
|
position: relative;
|
||||||
|
top: 20rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.record-list-item-date {
|
||||||
|
font-size: 26rpx;
|
||||||
|
color: #a6a6a6;
|
||||||
|
margin-top: 10rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.record-top {
|
||||||
|
width: calc(100% - 60rpx);
|
||||||
|
height: 360rpx;
|
||||||
|
background-image: linear-gradient(to right, #e93340, #e93340);
|
||||||
|
box-shadow: 0 10rpx 20rpx 0rpx rgba($color: #e93340, $alpha: 0.4);
|
||||||
|
margin: 0 30rpx;
|
||||||
|
border-radius: 20rpx;
|
||||||
|
box-sizing: border-box;
|
||||||
|
position: relative;
|
||||||
|
padding: 10rpx 50rpx 20rpx 50rpx;
|
||||||
|
z-index: 1;
|
||||||
|
|
||||||
|
.record-bg {
|
||||||
|
position: absolute;
|
||||||
|
width: 100%;
|
||||||
|
bottom: 0;
|
||||||
|
right: 0;
|
||||||
|
z-index: 1;
|
||||||
|
opacity: .5;
|
||||||
|
}
|
||||||
|
|
||||||
|
.record-top-nav {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
box-sizing: border-box;
|
||||||
|
|
||||||
|
.record-top-item {
|
||||||
|
margin: 40rpx 20rpx;
|
||||||
|
font-size: 30rpx;
|
||||||
|
font-weight: 500;
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.selectTopItem {
|
||||||
|
border-bottom: solid 4rpx #fff;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.record-mouth-year {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
align-items: flex-start;
|
||||||
|
justify-content: space-between;
|
||||||
|
box-sizing: border-box;
|
||||||
|
position: relative;
|
||||||
|
z-index: 2;
|
||||||
|
color: #fff;
|
||||||
|
font-size: 30rpx;
|
||||||
|
margin-top: 20rpx;
|
||||||
|
|
||||||
|
.record-type-left {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: flex-start;
|
||||||
|
box-sizing: border-box;
|
||||||
|
|
||||||
|
uni-icons {
|
||||||
|
margin-left: 4rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.record-type-right {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: flex-start;
|
||||||
|
justify-content: flex-start;
|
||||||
|
box-sizing: border-box;
|
||||||
|
font-size: 24rpx;
|
||||||
|
flex: 1;
|
||||||
|
|
||||||
|
.pay_type_item {
|
||||||
|
margin: 0 10rpx;
|
||||||
|
padding: 2rpx 20rpx;
|
||||||
|
border-radius: 30rpx;
|
||||||
|
border: solid 1rpx rgba($color: #000000, $alpha: 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
.pay_type_item_select {
|
||||||
|
border: solid 1rpx #f7f7f7;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.record-title {
|
||||||
|
font-size: 28rpx;
|
||||||
|
color: #fff;
|
||||||
|
padding: 0 0 20rpx 0;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
align-items: center;
|
||||||
|
width: 100%;
|
||||||
|
justify-content: space-between;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
.record-money {
|
||||||
|
color: #fff;
|
||||||
|
font-size: 70rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
|
||||||
|
span {
|
||||||
|
font-size: 24rpx;
|
||||||
|
font-weight: 400;
|
||||||
|
padding-left: 20rpx;
|
||||||
|
margin-right: 4rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.ew_lists {
|
||||||
|
padding: $padding;
|
||||||
|
border-top: solid 4rpx #f8f8f8;
|
||||||
|
|
||||||
|
.item {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
box-sizing: border-box;
|
||||||
|
border-bottom: solid 1rpx #f8f8f8;
|
||||||
|
background-color: #fff;
|
||||||
|
padding: 0 0 $padding*0.8 50rpx;
|
||||||
|
|
||||||
|
.left,
|
||||||
|
.right {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: flex-start;
|
||||||
|
justify-content: center;
|
||||||
|
box-sizing: border-box;
|
||||||
|
margin-top: 10rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.left {
|
||||||
|
font-size: 30rpx;
|
||||||
|
padding-top: 10rpx;
|
||||||
|
color: $text-price;
|
||||||
|
|
||||||
|
.left-des {
|
||||||
|
color: #999;
|
||||||
|
font-size: 26rpx;
|
||||||
|
margin-left: 20rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
span:nth-child(2) {
|
||||||
|
color: #C0C0C0;
|
||||||
|
font-weight: normal;
|
||||||
|
font-size: 26rpx;
|
||||||
|
padding-top: $padding *0.5;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.right {
|
||||||
|
font-size: $title-size-m;
|
||||||
|
align-items: flex-end;
|
||||||
|
color: #999;
|
||||||
|
|
||||||
|
span:nth-child(1) {
|
||||||
|
padding-bottom: $padding*0.5;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.receiptCode {
|
||||||
|
font-size: 32rpx;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: flex-start;
|
||||||
|
|
||||||
|
.title {
|
||||||
|
flex: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.logo {
|
||||||
|
width: 40rpx;
|
||||||
|
margin-right: 10rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.status {
|
||||||
|
color: #999;
|
||||||
|
font-size: 26rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -10,7 +10,8 @@ export default getDate = (type) =>{
|
|||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
const date = new Date()
|
const date = new Date()
|
||||||
const year = date.getFullYear()
|
const year = date.getFullYear()
|
||||||
const month = (date.getMonth() + 1) <= 9 ? '0' + (date.getMonth() + 1) : date.getMonth()
|
|
||||||
|
const month = (date.getMonth() + 1) <= 9 ? '0' + (date.getMonth() + 1) : (date.getMonth() + 1)
|
||||||
const day = date.getDate()
|
const day = date.getDate()
|
||||||
|
|
||||||
switch(type){
|
switch(type){
|
||||||
|
|||||||
@@ -7,6 +7,7 @@
|
|||||||
|
|
||||||
import { RouterMount, createRouter } from 'uni-simple-router';
|
import { RouterMount, createRouter } from 'uni-simple-router';
|
||||||
import store from '../store/index'
|
import store from '../store/index'
|
||||||
|
import userAuth from '../public/userAuth'
|
||||||
|
|
||||||
const router = createRouter({
|
const router = createRouter({
|
||||||
platform: process.env.VUE_APP_PLATFORM,
|
platform: process.env.VUE_APP_PLATFORM,
|
||||||
@@ -15,11 +16,6 @@ const router = createRouter({
|
|||||||
|
|
||||||
// 全局路由前置守卫
|
// 全局路由前置守卫
|
||||||
router.beforeEach((to, from, next) => {
|
router.beforeEach((to, from, next) => {
|
||||||
const token = store.getters.getToken || uni.getStorageSync('token')
|
|
||||||
// 检查是否需要登录
|
|
||||||
if(to.meta.auth && token === ''){
|
|
||||||
return
|
|
||||||
}
|
|
||||||
next();
|
next();
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ $text-gray: #555;
|
|||||||
$text-gray-m: #999;
|
$text-gray-m: #999;
|
||||||
$text-price: #e93340;
|
$text-price: #e93340;
|
||||||
$main-color: #e93340;
|
$main-color: #e93340;
|
||||||
|
$mian-color: #e93340;
|
||||||
$main-color-light: #e93340;
|
$main-color-light: #e93340;
|
||||||
|
|
||||||
// 边框颜色
|
// 边框颜色
|
||||||
|
|||||||
BIN
static/icons/search_row.png
Normal file
|
After Width: | Height: | Size: 1.3 KiB |
BIN
static/images/payFail.png
Normal file
|
After Width: | Height: | Size: 5.1 KiB |
BIN
static/images/paySuccess.png
Normal file
|
After Width: | Height: | Size: 4.5 KiB |
BIN
static/imgs/account-bg.png
Normal file
|
After Width: | Height: | Size: 2.9 KiB |
BIN
static/imgs/record-icon.png
Normal file
|
After Width: | Height: | Size: 4.2 KiB |
BIN
unpackage/cache/apk/__UNI__CD19AAD_cm.apk
vendored
2
unpackage/cache/apk/apkurl
vendored
@@ -1 +1 @@
|
|||||||
https://service.dcloud.net.cn/build/download/0d7b3af0-ffd9-11eb-a971-ed46b2192340
|
https://ide.dcloud.net.cn/build/download/cb41b860-2a68-11ec-9c28-45cabb8aa690
|
||||||
2
unpackage/cache/apk/cmManifestCache.json
vendored
2
unpackage/cache/certdata
vendored
@@ -1,3 +1,3 @@
|
|||||||
andrCertfile=/Users/WebTmm/Desktop/5aa9ab18b4612a21d9e4849ca1200d74.keystore
|
andrCertfile=/Users/WebTmm/Desktop/安卓证书/barter-app.keystore
|
||||||
andrCertAlias=__uni__cd19aad
|
andrCertAlias=__uni__cd19aad
|
||||||
andrCertPass=Nzz4TZfsMfJreNdZgt6XDw==
|
andrCertPass=Nzz4TZfsMfJreNdZgt6XDw==
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
{"@platforms":["android","iPhone","iPad"],"id":"__UNI__CD19AAD","name":"易品新境","version":{"name":"1.0.0","code":"100"},"description":"易品新境为商家提供营销引流工具","launch_path":"__uniappview.html","developer":{"name":"","email":"","url":""},"permissions":{"OAuth":{},"UniNView":{"description":"UniNView原生渲染"}},"plus":{"useragent":{"value":"uni-app","concatenate":true},"splashscreen":{"autoclose":false,"waiting":true,"delay":0},"popGesture":"close","launchwebview":{"id":"1","kernel":"WKWebview"},"statusbar":{"immersed":"supportedDevice","style":"dark","background":"#F8F8F8"},"usingComponents":true,"nvueStyleCompiler":"uni-app","compilerVersion":3,"safearea":{"bottom":{"offset":"none"}},"distribute":{"icons":{"android":{"hdpi":"icon-android-hdpi.png","xhdpi":"icon-android-xhdpi.png","xxhdpi":"icon-android-xxhdpi.png","xxxhdpi":"icon-android-xxxhdpi.png"},"ios":{"appstore":"unpackage/res/icons/1024x1024.png","ipad":{"app":"unpackage/res/icons/76x76.png","app@2x":"unpackage/res/icons/152x152.png","proapp@2x":"unpackage/res/icons/167x167.png","spotlight":"unpackage/res/icons/40x40.png","spotlight@2x":"unpackage/res/icons/80x80.png","settings":"unpackage/res/icons/29x29.png","settings@2x":"unpackage/res/icons/58x58.png","notification":"unpackage/res/icons/20x20.png","notification@2x":"unpackage/res/icons/40x40.png"},"iphone":{"app@2x":"unpackage/res/icons/120x120.png","app@3x":"unpackage/res/icons/180x180.png","spotlight@2x":"unpackage/res/icons/80x80.png","spotlight@3x":"unpackage/res/icons/120x120.png","settings@2x":"unpackage/res/icons/58x58.png","settings@3x":"unpackage/res/icons/87x87.png","notification@2x":"unpackage/res/icons/40x40.png","notification@3x":"unpackage/res/icons/60x60.png"},"prerendered":"false"}},"splashscreen":{"androidStyle":"common"},"google":{"permissions":["<uses-feature android:name=\"android.hardware.camera\"/>","<uses-feature android:name=\"android.hardware.camera.autofocus\"/>","<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>","<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>","<uses-permission android:name=\"android.permission.CAMERA\"/>","<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>","<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>","<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>","<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>","<uses-permission android:name=\"android.permission.MODIFY_AUDIO_SETTINGS\"/>","<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>","<uses-permission android:name=\"android.permission.READ_LOGS\"/>","<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>","<uses-permission android:name=\"android.permission.VIBRATE\"/>","<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>","<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"],"packagename":"yh.shangkelian.app","password":"Nzz4TZfsMfJreNdZgt6XDw==","aliasname":"__uni__cd19aad","keystore":"google-keystore.keystore","custompermissions":true},"apple":{"devices":"universal"},"plugins":{"oauth":{"univerify":{}},"ad":{},"audio":{"mp3":{"description":"Android平台录音支持MP3格式文件"}}},"orientation":["portrait-primary"]},"allowsInlineMediaPlayback":true,"uni-app":{"compilerVersion":"3.1.22","control":"uni-v3","nvueCompiler":"uni-app","renderer":"auto","nvue":{"flex-direction":"column"},"nvueLaunchMode":"normal"},"tabBar":{"color":"#bababa","selectedColor":"#c82626","backgroundColor":"#FFFFFF","borderStyle":"rgba(255,255,255,0.4)","list":[{"pagePath":"pages/equity/index","text":"通证权易","iconPath":"static/tabBar/tabBar_icon_00.png","selectedIconPath":"static/tabBar/tabBar_show_00.png"},{"pagePath":"pages/market/index","text":"转让市场","iconPath":"static/tabBar/tabBar_icon_01.png","selectedIconPath":"static/tabBar/tabBar_show_01.png"},{"pagePath":"pages/store/index","text":"企业工具","iconPath":"static/tabBar/tabBar_icon_02.png","selectedIconPath":"static/tabBar/tabBar_show_02.png"},{"pagePath":"pages/property/index","text":"我的资产","iconPath":"static/tabBar/tabBar_icon_03.png","selectedIconPath":"static/tabBar/tabBar_show_03.png"}],"height":"50px","child":["lauchwebview"],"selected":0},"launch_path":"__uniappview.html","adid":"125178130709"}}
|
{"@platforms":["android","iPhone","iPad"],"id":"__UNI__CD19AAD","name":"易品新境","version":{"name":"1.0.0","code":"100"},"description":"易品新境为商家提供营销引流工具","launch_path":"__uniappview.html","developer":{"name":"","email":"","url":""},"permissions":{"OAuth":{},"Payment":{},"Share":{},"Geolocation":{},"UniNView":{"description":"UniNView原生渲染"}},"plus":{"useragent":{"value":"uni-app","concatenate":true},"splashscreen":{"autoclose":false,"waiting":true,"delay":0},"popGesture":"close","launchwebview":{"id":"1","kernel":"WKWebview"},"statusbar":{"immersed":"supportedDevice","style":"dark","background":"#f5f5f5"},"usingComponents":true,"nvueStyleCompiler":"uni-app","compilerVersion":3,"safearea":{"bottom":{"offset":"none"}},"distribute":{"icons":{"android":{"hdpi":"icon-android-hdpi.png","xhdpi":"icon-android-xhdpi.png","xxhdpi":"icon-android-xxhdpi.png","xxxhdpi":"icon-android-xxxhdpi.png"},"ios":{"appstore":"unpackage/res/icons/1024x1024.png","ipad":{"app":"unpackage/res/icons/76x76.png","app@2x":"unpackage/res/icons/152x152.png","proapp@2x":"unpackage/res/icons/167x167.png","spotlight":"unpackage/res/icons/40x40.png","spotlight@2x":"unpackage/res/icons/80x80.png","settings":"unpackage/res/icons/29x29.png","settings@2x":"unpackage/res/icons/58x58.png","notification":"unpackage/res/icons/20x20.png","notification@2x":"unpackage/res/icons/40x40.png"},"iphone":{"app@2x":"unpackage/res/icons/120x120.png","app@3x":"unpackage/res/icons/180x180.png","spotlight@2x":"unpackage/res/icons/80x80.png","spotlight@3x":"unpackage/res/icons/120x120.png","settings@2x":"unpackage/res/icons/58x58.png","settings@3x":"unpackage/res/icons/87x87.png","notification@2x":"unpackage/res/icons/40x40.png","notification@3x":"unpackage/res/icons/60x60.png"},"prerendered":"false"}},"splashscreen":{"androidStyle":"common"},"google":{"permissions":["<uses-feature android:name=\"android.hardware.camera\"/>","<uses-feature android:name=\"android.hardware.camera.autofocus\"/>","<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>","<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>","<uses-permission android:name=\"android.permission.CAMERA\"/>","<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>","<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>","<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>","<uses-permission android:name=\"android.permission.MODIFY_AUDIO_SETTINGS\"/>","<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>","<uses-permission android:name=\"android.permission.READ_LOGS\"/>","<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>","<uses-permission android:name=\"android.permission.VIBRATE\"/>","<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>","<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"],"packagename":"yh.shangkelian.app","password":"Nzz4TZfsMfJreNdZgt6XDw==","aliasname":"__uni__cd19aad","keystore":"google-keystore.keystore","custompermissions":true},"apple":{"devices":"universal"},"plugins":{"oauth":{"univerify":{},"weixin":{"appid":"wx222fbe58feee7819","appsecret":"3d24525a636d7573a8fae885097d5cf7","UniversalLinks":""}},"payment":{"weixin":{"__platform__":["android"],"appid":"wx222fbe58feee7819","UniversalLinks":""}},"share":{"weixin":{"appid":"wx222fbe58feee7819","UniversalLinks":""}},"ad":{},"geolocation":{},"audio":{"mp3":{"description":"Android平台录音支持MP3格式文件"}}},"orientation":["portrait-primary"]},"allowsInlineMediaPlayback":true,"uni-app":{"compilerVersion":"3.2.9","control":"uni-v3","nvueCompiler":"uni-app","renderer":"auto","nvue":{"flex-direction":"column"},"nvueLaunchMode":"normal"},"tabBar":{"color":"#bababa","selectedColor":"#e93340","backgroundColor":"#FFFFFF","borderStyle":"rgba(255,255,255,0.4)","list":[{"pagePath":"pages/equity/index","text":"通证权易","iconPath":"static/tabBar/tabBar_icon_00.png","selectedIconPath":"static/tabBar/tabBar_show_00.png"},{"pagePath":"pages/market/index","text":"转让市场","iconPath":"static/tabBar/tabBar_icon_01.png","selectedIconPath":"static/tabBar/tabBar_show_01.png"},{"pagePath":"pages/store/index","text":"企业工具","iconPath":"static/tabBar/tabBar_icon_02.png","selectedIconPath":"static/tabBar/tabBar_show_02.png"},{"pagePath":"pages/property/index","text":"我的资产","iconPath":"static/tabBar/tabBar_icon_03.png","selectedIconPath":"static/tabBar/tabBar_show_03.png"}],"height":"50px","child":["lauchwebview"],"selected":0},"launch_path":"__uniappview.html","adid":"125178130709"}}
|
||||||
|
Before Width: | Height: | Size: 733 B After Width: | Height: | Size: 1.9 KiB |
|
Before Width: | Height: | Size: 489 B After Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 487 B After Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 2.7 KiB |