Compare commits
47 Commits
4b23dba0cc
...
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 | ||
|
|
a06c2c78e9 | ||
|
|
6dc47050b6 | ||
|
|
0d77682f00 | ||
|
|
ec3c9428b3 | ||
|
|
2d0beda790 | ||
|
|
6a90c8dc8d | ||
|
|
8c35ad5956 | ||
|
|
b06e4f8109 |
38
App.vue
38
App.vue
@@ -1,24 +1,36 @@
|
||||
<script>
|
||||
export default {
|
||||
onLaunch () {
|
||||
console.log('App Launch')
|
||||
export default {
|
||||
onLaunch() {
|
||||
// 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 () {
|
||||
console.log('App Show')
|
||||
uni.hideLoading()
|
||||
onShow() {
|
||||
console.log('App Show');
|
||||
},
|
||||
onHide () {
|
||||
console.log('App Hide')
|
||||
onHide() {
|
||||
console.log('App Hide');
|
||||
},
|
||||
globalData: {
|
||||
mainColor: "white"
|
||||
}
|
||||
mainColor: 'white'
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
@import "uview-ui/index.scss";
|
||||
page{
|
||||
@import 'uview-ui/index.scss';
|
||||
page {
|
||||
background: #f5f5f5;
|
||||
}
|
||||
-webkit-text-size-adjust: 100% !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# 易货App
|
||||
|
||||
因项目太大无法上传文件废弃,新指向:https://git.yuzhankeji.cn/UzTech/EB_Barter_App.git
|
||||
_开发临时存储资源存放在/static/dev目录下_
|
||||
|
||||
|
||||
|
||||
@@ -31,13 +31,13 @@ const request = (parameter) => {
|
||||
'Authorization': store.getters.getToken || ''
|
||||
}
|
||||
|
||||
console.log('parameterDbug', parameter)
|
||||
// console.log('parameterDbug', parameter)
|
||||
|
||||
// 加载提示
|
||||
uni.showLoading({
|
||||
title: '加载中',
|
||||
mask : true
|
||||
});
|
||||
// uni.showLoading({
|
||||
// title: '加载中',
|
||||
// mask : true
|
||||
// });
|
||||
// 请求实例
|
||||
return new Promise((resolve, reject) => {
|
||||
uni.request({
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* moduleName: 地址
|
||||
*/
|
||||
|
||||
import request from '../request.js'
|
||||
import { request } from '../index'
|
||||
|
||||
// 地址列表
|
||||
const addresses = () => {
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* moduleName: 优惠券相关
|
||||
*/
|
||||
|
||||
import request from '../request.js'
|
||||
import { request } from '../index'
|
||||
|
||||
// 我的优惠券
|
||||
const myCoupon = (data) => {
|
||||
|
||||
@@ -18,7 +18,8 @@ const mall = data => {
|
||||
// 商品列表
|
||||
const list = data => {
|
||||
return request({
|
||||
url: "mall/goods"
|
||||
url: "mall/goods",
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
@@ -171,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 {
|
||||
mall,
|
||||
list,
|
||||
@@ -192,5 +231,10 @@ export {
|
||||
managesTracedTo,
|
||||
managesCoupons,
|
||||
managesGoodsPut,
|
||||
managesGoodsExtends
|
||||
managesGoodsExtends,
|
||||
searchUrl,
|
||||
goodsCategory,
|
||||
companyCategory,
|
||||
randgoodsUrl,
|
||||
mallBuyGoods
|
||||
}
|
||||
|
||||
@@ -64,6 +64,30 @@ const marketsCreate = data => {
|
||||
})
|
||||
}
|
||||
|
||||
// 转让管理
|
||||
const marketsMag = data => {
|
||||
return request({
|
||||
url: 'markets/user/markets',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
// 取消转让
|
||||
const marketsCancel = id => {
|
||||
return request({
|
||||
url: 'markets/' + id + '/cancel',
|
||||
method: 'POST'
|
||||
})
|
||||
}
|
||||
|
||||
// 我的成交理事
|
||||
const marketsOrdersLogs = (data, name) => {
|
||||
return request({
|
||||
url: 'markets/orders/' + name,
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export {
|
||||
markets,
|
||||
marketsLogs,
|
||||
@@ -71,5 +95,8 @@ export {
|
||||
marketsBuy,
|
||||
marketsPay,
|
||||
marketsCreateInfo,
|
||||
marketsCreate
|
||||
marketsCreate,
|
||||
marketsMag,
|
||||
marketsCancel,
|
||||
marketsOrdersLogs
|
||||
}
|
||||
|
||||
@@ -3,7 +3,9 @@
|
||||
* moduleName:个人中心相关操作
|
||||
*/
|
||||
|
||||
import request from '../request.js'
|
||||
import {
|
||||
request
|
||||
} from '../index'
|
||||
|
||||
// 关注店铺
|
||||
const shopSubscribe = (id) => {
|
||||
@@ -17,9 +19,9 @@ const shopSubscribe = (id) => {
|
||||
const shopSubscribeList = (page) => {
|
||||
return request({
|
||||
url: 'mall/shops/subscribe',
|
||||
method:'get',
|
||||
data:{
|
||||
page:page
|
||||
method: 'get',
|
||||
data: {
|
||||
page: page
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -49,8 +51,8 @@ const getUserSettingInfo = () => {
|
||||
const chaineb = (data) => {
|
||||
return request({
|
||||
url: 'user/account/chaineb',
|
||||
method:'get',
|
||||
data:data
|
||||
method: 'get',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
@@ -60,19 +62,19 @@ const browsers = (page) => {
|
||||
url: 'mall/goods/browsers',
|
||||
method: 'get',
|
||||
data: {
|
||||
page:page,
|
||||
page_size:20
|
||||
page: page,
|
||||
page_size: 20
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 修改用户头像或昵称
|
||||
const resetUserInfo= (data) => {
|
||||
const resetUserInfo = (data) => {
|
||||
return request({
|
||||
url: 'user/'+data.key,
|
||||
url: 'user/' + data.key,
|
||||
method: 'PUT',
|
||||
data:{
|
||||
value:data.value
|
||||
data: {
|
||||
value: data.value
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* moduleName: 我的数权
|
||||
*/
|
||||
|
||||
import request from '../request.js'
|
||||
import { request } from '../index'
|
||||
|
||||
// 我的数权
|
||||
const mallWarrants = (data) => {
|
||||
|
||||
@@ -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 {
|
||||
buy,
|
||||
eb
|
||||
eb,
|
||||
wxPay,
|
||||
ebPay
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* moduleName:核销相关操作
|
||||
*/
|
||||
|
||||
import request from '../request.js'
|
||||
import { request } from '../index'
|
||||
|
||||
|
||||
// 扫码前置条件 get 核销前置 post 表示核销
|
||||
|
||||
@@ -54,4 +54,5 @@ export {
|
||||
editInfo,
|
||||
putShop,
|
||||
deleteShop
|
||||
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ const index = () => {
|
||||
})
|
||||
}
|
||||
|
||||
// 成交客户
|
||||
// 成交客户 *********已废弃
|
||||
const customer = data => {
|
||||
return request({
|
||||
url: 'mall/statistics',
|
||||
@@ -23,6 +23,14 @@ const customer = data => {
|
||||
})
|
||||
}
|
||||
|
||||
// 成交客户
|
||||
const orderUsers = data => {
|
||||
return request({
|
||||
url: 'manages/order_users',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
// 访客记录
|
||||
const visitors = data => {
|
||||
return request({
|
||||
@@ -54,11 +62,106 @@ const companiesCode = () => {
|
||||
})
|
||||
}
|
||||
|
||||
// 退货单列表
|
||||
const storeReturn = (data) => {
|
||||
return request({
|
||||
url: 'manages/refunds',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 退货单详情
|
||||
const orderDetails = (refund_id) => {
|
||||
return request({
|
||||
url: 'manages/refunds/' + refund_id
|
||||
})
|
||||
}
|
||||
|
||||
// 退货单-操作日志
|
||||
const orderJournal = (refund_id) => {
|
||||
return request({
|
||||
url: 'mall/refunds/' + refund_id + '/logs'
|
||||
})
|
||||
}
|
||||
|
||||
// 退货单签收
|
||||
const storeSign = (refund_id) => {
|
||||
return request({
|
||||
url: 'manages/refunds/' + refund_id + '/sign'
|
||||
})
|
||||
}
|
||||
|
||||
// 退货单-退货
|
||||
const storeToken = (refund_id) => {
|
||||
return request({
|
||||
url: 'manages/refunds/' + refund_id + '/retoken'
|
||||
})
|
||||
}
|
||||
|
||||
// 退货单-审核
|
||||
const storeAudit = (refund_id, data) => {
|
||||
return request({
|
||||
url: 'manages/refunds/' + refund_id + '/audit',
|
||||
method: 'POST',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 提货单列表
|
||||
const storeDeliver = (data) => {
|
||||
return request({
|
||||
url: 'manages/shipments',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 提货单详情
|
||||
const deliverDetails = (shipment__no) => {
|
||||
return request({
|
||||
url: 'manages/shipments/' + shipment__no
|
||||
})
|
||||
}
|
||||
|
||||
// 提货单发货前置
|
||||
const deliverFront = (shipment__no) => {
|
||||
return request({
|
||||
url: 'manages/shipments/' + shipment__no + '/deliver'
|
||||
})
|
||||
}
|
||||
|
||||
// 提货单发货
|
||||
const deliverForm = (shipment__no, data) => {
|
||||
return request({
|
||||
url: 'manages/shipments/' + shipment__no + '/deliver',
|
||||
method: 'POST',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 提货单物流
|
||||
const deliverLogistic = (shipment__no) => {
|
||||
return request({
|
||||
url: 'manages/shipments/' + shipment__no + '/logistic'
|
||||
})
|
||||
}
|
||||
|
||||
export {
|
||||
index,
|
||||
customer,
|
||||
orderUsers,
|
||||
visitors,
|
||||
basicsConfig,
|
||||
basicsInfo,
|
||||
companiesCode
|
||||
companiesCode,
|
||||
storeReturn,
|
||||
orderDetails,
|
||||
orderJournal,
|
||||
storeSign,
|
||||
storeToken,
|
||||
storeAudit,
|
||||
storeDeliver,
|
||||
deliverDetails,
|
||||
deliverFront,
|
||||
deliverForm,
|
||||
deliverLogistic
|
||||
}
|
||||
|
||||
167
apis/interfaces/wallet.js
Normal file
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
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
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-day">剩余{{item.time.expire}}天</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 class="check-all" v-if="item.coupon_count>2" @click="couponMoreListGo(item.coupon_id)">
|
||||
@@ -152,7 +152,7 @@
|
||||
box-sizing: border-box;
|
||||
|
||||
.money {
|
||||
font-size: 70rpx;
|
||||
font-size: 50rpx;
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
|
||||
228
components/coupon-template/coupon-template-2.vue
Normal file
228
components/coupon-template/coupon-template-2.vue
Normal file
File diff suppressed because one or more lines are too long
@@ -39,7 +39,7 @@
|
||||
// 跳转到商品详情页面
|
||||
goDetail(id) {
|
||||
uni.navigateTo({
|
||||
url: '/pages/goods/detail?id=' + id
|
||||
url: '/pages/goods/details?id=' + id
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
// 跳转到商品详情页面
|
||||
goDetail(id) {
|
||||
uni.navigateTo({
|
||||
url: '/pages/goods/detail?id='+id
|
||||
url: '/pages/goods/details?id='+id
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<view class="OrderTemplate" >
|
||||
<view class="top" >
|
||||
<view class="top" v-if="isTop">
|
||||
<view class="company">
|
||||
<view class="company-logo">
|
||||
<image :src="item.shop.cover" mode="aspectFill" />
|
||||
@@ -33,7 +33,11 @@
|
||||
};
|
||||
},
|
||||
props:{
|
||||
item:Object
|
||||
item : Object,
|
||||
isTop : {
|
||||
type: Boolean,
|
||||
default: true
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
console.log(this.item,'onshow,numtempa')
|
||||
@@ -42,7 +46,7 @@
|
||||
// 跳转到商品详情页面
|
||||
goDetail(id) {
|
||||
uni.navigateTo({
|
||||
url: '/pages/goods/detail?id='+id
|
||||
url: '/pages/goods/details?id='+id
|
||||
})
|
||||
},
|
||||
// 复制
|
||||
@@ -113,13 +117,11 @@
|
||||
justify-content: flex-start;
|
||||
box-sizing: border-box;
|
||||
margin-top: 36rpx;
|
||||
|
||||
.goods-img {
|
||||
width: 120rpx;
|
||||
height: 120rpx;
|
||||
border-radius: 10rpx;
|
||||
}
|
||||
|
||||
.goods {
|
||||
flex: 1;
|
||||
margin-left: 20rpx;
|
||||
|
||||
129
components/property/record.vue
Normal file
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>
|
||||
@@ -27,10 +27,16 @@
|
||||
</view>
|
||||
<view class="member-cont">
|
||||
<view class="member-tips">
|
||||
<view class="member-tips-title">会员升级/续费</view>
|
||||
<view class="member-tips-time">有效期:2022年10月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>企业会员</view>
|
||||
<view class="member-tips-time nowrap">有效期:{{wordData.identity}}</view>
|
||||
</view>
|
||||
<view class="member-btn" @click="$Router.push({name: 'Vip'})">
|
||||
<view class="member-btn" v-if="wordData.grade == 3">
|
||||
<image class="member-btn-icon" src="../../static/icons/store_icon_vip.png" mode="aspectFill"></image>
|
||||
<view class="member-btn-name">已满级</view>
|
||||
</view>
|
||||
<view class="member-btn" @click="$Router.push({name: 'Vip'})" v-else>
|
||||
<image class="member-btn-icon" src="../../static/icons/store_icon_vip.png" mode="aspectFill"></image>
|
||||
<view class="member-btn-name">去升级</view>
|
||||
</view>
|
||||
@@ -58,19 +64,19 @@
|
||||
<view class="text">转让权证</view>
|
||||
</view> -->
|
||||
<view class="general-item">
|
||||
<view class="number">{{wordData.top.barter_total || 0}}</view>
|
||||
<view class="text">总收益额</view>
|
||||
<view class="number">{{wordData.top.order_total.toFixed(2) || 0}}</view>
|
||||
<view class="text">总交易额</view>
|
||||
</view>
|
||||
<view class="general-item" @click="$Router.push({name: 'GoodsMag'})">
|
||||
<view class="number">{{wordData.middle.sale || 0}}</view>
|
||||
<view class="text">在售权证</view>
|
||||
</view>
|
||||
<view class="general-item">
|
||||
<view class="number">{{wordData.top.barter_total || 0}}</view>
|
||||
<view class="general-item" @click="$Router.push({name: 'Return'})">
|
||||
<view class="number">{{wordData.order.refund || 0}}</view>
|
||||
<view class="text">退货单处理</view>
|
||||
</view>
|
||||
<view class="general-item">
|
||||
<view class="number">{{wordData.top.barter_total || 0}}</view>
|
||||
<view class="general-item" @click="$Router.push({name: 'Deliver'})">
|
||||
<view class="number">{{wordData.order.deliver|| 0}}</view>
|
||||
<view class="text">发货单处理</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -117,7 +123,7 @@
|
||||
<image class="icon" src="@/static/icons/tool_icon_02.png" mode="aspectFill"></image>
|
||||
<view class="title">优惠券管理</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>
|
||||
<view class="title">收款管理</view>
|
||||
</view>
|
||||
@@ -132,7 +138,7 @@
|
||||
<image class="icon" src="@/static/icons/tool_icon_05.png" mode="aspectFill"></image>
|
||||
<view class="title">智能名片</view>
|
||||
</view> -->
|
||||
<view class="store-item">
|
||||
<view class="store-item" @click="$Router.push({name: 'Spread'})">
|
||||
<image class="icon" src="@/static/icons/tool_icon_06.png" mode="aspectFill"></image>
|
||||
<view class="title">营销推广码</view>
|
||||
</view>
|
||||
@@ -162,6 +168,15 @@
|
||||
order : {}
|
||||
}
|
||||
}
|
||||
},
|
||||
identityData:{
|
||||
type: Object,
|
||||
default: () => {
|
||||
return {
|
||||
time : {},
|
||||
grade : {}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
269
components/store-order-details/store-order-details.vue
Normal file
269
components/store-order-details/store-order-details.vue
Normal file
@@ -0,0 +1,269 @@
|
||||
<template>
|
||||
<view>
|
||||
<view class="OrderInfo">
|
||||
<!-- 订单状态 -->
|
||||
<view class="order-status">
|
||||
<block v-if="listType == 'deliver'">
|
||||
<view class="info">
|
||||
{{info.state_text}}
|
||||
</view>
|
||||
</block>
|
||||
<block v-else>
|
||||
<view class="info" v-if="info.state">
|
||||
{{info.state.text}}
|
||||
<span>{{info.state.remark}}</span>
|
||||
</view>
|
||||
</block>
|
||||
<image src="../../static/icons/fire.png" mode="widthFix"></image>
|
||||
</view>
|
||||
|
||||
<!-- 订单信息 -->
|
||||
<view class="goods-info1">
|
||||
<view class="top">
|
||||
<view class="company">
|
||||
<view class="company-logo" v-if="info.shop">
|
||||
<image :src="info.shop.cover" mode="aspectFill" />
|
||||
<view class="name nowrap">{{info.shop.name}}</view>
|
||||
</view>
|
||||
<view class="flexrow">
|
||||
<view class="no nowrap" v-if="listType == 'deliver'">发货单号: {{info.shipment_no}}</view>
|
||||
<view class="no nowrap" v-else>退货单号: {{info.refund_no}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="goods-info">
|
||||
<image class="goods-img" v-if="info.goods_sku" :src="info.goods_sku.cover" mode="aspectFill" />
|
||||
<view class="goods" v-if="info.goods_sku">
|
||||
<view class="nowrap name">{{info.goods_sku.goods_name}}</view>
|
||||
<view class="sku">数权个数 <span>x {{info.qty}}</span> </view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="goods-info1" >
|
||||
<view class="goods-type">创建{{listType == 'deliver'?'发货':'退货'}}时间 <span>{{info.created_at}}</span></view>
|
||||
<view class="goods-type">运费 <span>自行承担运费</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 class="actions">
|
||||
<view class="nowPay" @click="orderRun">返回列表</view>
|
||||
<view v-if="listType != 'deliver'" @click="$Router.push({name: 'storeJournal', params: {id: info.refund_id}})" class="nowPay">查看退货日志</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name:"storeOrderDet",
|
||||
props:{
|
||||
// 数据列表
|
||||
info : {},
|
||||
listType: ''
|
||||
},
|
||||
created() {
|
||||
},
|
||||
methods: {
|
||||
// 返回上一页
|
||||
orderRun() {
|
||||
uni.navigateBack({
|
||||
delta: 1
|
||||
})
|
||||
},
|
||||
call(number){
|
||||
uni.makePhoneCall({
|
||||
phoneNumber:number
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.OrderInfo {
|
||||
width: 100%;
|
||||
min-height: 100vh;
|
||||
box-sizing: border-box;
|
||||
background-color: #F7F7F7;
|
||||
padding-bottom: 80rpx;
|
||||
}
|
||||
.order-status {
|
||||
width: 100%;
|
||||
height: 300rpx;
|
||||
background-image: linear-gradient(to bottom, $main-color, $main-color-light);
|
||||
color: #Fff;
|
||||
font-size: 36rpx;
|
||||
padding: 30rpx 50rpx;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
box-sizing: border-box;
|
||||
.info {
|
||||
font-size: 36rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
justify-content: space-between;
|
||||
box-sizing: border-box;
|
||||
span {
|
||||
font-size: 28rpx;
|
||||
padding-top: 30rpx;
|
||||
}
|
||||
}
|
||||
image {
|
||||
width: 200rpx;
|
||||
}
|
||||
}
|
||||
|
||||
// 订单信息
|
||||
.goods-info1 {
|
||||
padding: 20rpx 40rpx;
|
||||
background-color: #fff;
|
||||
margin-bottom: $margin;
|
||||
.top {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
box-sizing: border-box;
|
||||
padding: 30rpx 0;
|
||||
border-bottom: solid 1rpx #EFF4F2;
|
||||
.company-logo {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
justify-content: flex-start;
|
||||
box-sizing: border-box;
|
||||
image {
|
||||
width: 40rpx;
|
||||
height: 40rpx;
|
||||
border-radius: 50%;
|
||||
margin-right: 20rpx;
|
||||
}
|
||||
.name {
|
||||
width: 600rpx;
|
||||
font-size: 30rpx;
|
||||
color: #484848;
|
||||
font-weight: bold;
|
||||
}
|
||||
.no {
|
||||
margin-top: 30rpx !important;
|
||||
font-size: $title-size*0.8;
|
||||
color: #999;
|
||||
}
|
||||
}
|
||||
}
|
||||
.goods-info {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: flex-start;
|
||||
justify-content: flex-start;
|
||||
box-sizing: border-box;
|
||||
margin-top: 40rpx;
|
||||
.goods-img {
|
||||
width: 120rpx;
|
||||
height: 120rpx;
|
||||
border-radius: 10rpx;
|
||||
}
|
||||
.goods {
|
||||
width: calc(100% - 120rpx);
|
||||
padding: 0 20rpx;
|
||||
box-sizing: border-box;
|
||||
.sku {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
box-sizing: border-box;
|
||||
margin-top: 20rpx;
|
||||
font-size: 28rpx;
|
||||
color: #999;
|
||||
}
|
||||
}
|
||||
}
|
||||
.goods-type {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
box-sizing: border-box;
|
||||
padding: 30rpx 0;
|
||||
border-bottom: solid 1rpx #f7f7f7;
|
||||
}
|
||||
}
|
||||
|
||||
// 操作按钮
|
||||
.actions {
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
border-top: solid 1rpx #f2f2f2;
|
||||
padding-top: 18rpx;
|
||||
padding-right: 30rpx;
|
||||
padding-left: 30rpx;
|
||||
height: 110rpx;
|
||||
background: white;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
flex-direction: row-reverse;
|
||||
.nowPay {
|
||||
margin-left: 20rpx;
|
||||
height: 54rpx;
|
||||
line-height: 50rpx;
|
||||
box-sizing: border-box;
|
||||
border: solid 1rpx #747788;
|
||||
padding: 0 20rpx;
|
||||
font-size: 26rpx;
|
||||
border-radius: 40rpx;
|
||||
margin-top: 10rpx;
|
||||
&.actions-color {
|
||||
color: #e1293f;
|
||||
border-color: #ec96a0;
|
||||
}
|
||||
}
|
||||
.cancelOrder {
|
||||
padding: 10rpx 30rpx;
|
||||
border-radius: 40rpx;
|
||||
margin-left: 20rpx;
|
||||
margin-top: 20rpx;
|
||||
background-color: #DD524D;
|
||||
}
|
||||
.logistics {
|
||||
background-color: $main-color;
|
||||
padding: 10rpx 30rpx;
|
||||
border-radius: 40rpx;
|
||||
margin-left: 20rpx;
|
||||
margin-top: 20rpx;
|
||||
}
|
||||
.sign {
|
||||
background-color: #DD524D;
|
||||
padding: 10rpx 30rpx;
|
||||
border-radius: 40rpx;
|
||||
margin-left: 20rpx;
|
||||
margin-top: 20rpx;
|
||||
}
|
||||
.evaluate {
|
||||
background-color: $main-color;
|
||||
padding: 10rpx 30rpx;
|
||||
border-radius: 40rpx;
|
||||
margin-left: 20rpx;
|
||||
margin-top: 20rpx;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
288
components/store-order/store-order.vue
Normal file
288
components/store-order/store-order.vue
Normal file
@@ -0,0 +1,288 @@
|
||||
<template>
|
||||
<view class="returnCont">
|
||||
<block v-if="list.length > 0">
|
||||
<view class="returnList" v-for="(item, index) in list" :key="index">
|
||||
<view class="MallRefundsTemplate">
|
||||
<view class="top">
|
||||
<view class="company">
|
||||
<view class="company-logo" v-if="item.shop">
|
||||
<image :src="item.shop.cover" mode="aspectFill" />
|
||||
<view class="company-name nowrap">{{item.shop.name}}</view>
|
||||
</view>
|
||||
<view class="no nowrap" v-if="listType == 'deliver'">退货单号: {{item.shipment_no}}</view>
|
||||
<view class="no nowrap" v-else>退货单号: {{item.refund_no}}</view>
|
||||
</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>
|
||||
<view class="goods-info" @click="goDetail(item.goods_sku.goods_id)" v-if="item.goods_sku">
|
||||
<image class="goods-img" :src="item.goods_sku.cover" mode="aspectFill" />
|
||||
<view class="goods">
|
||||
<view class="name nowrap">{{item.goods_sku.goods_name}}</view>
|
||||
<view class="sku">数权个数 <span>x {{item.qty}}</span> </view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="actions">
|
||||
<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.sign" @click="goSigns(item.refund_id, index)" class="nowPay actions-color">
|
||||
订单签收</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 v-if="listType == 'deliver'" class="nowPay"
|
||||
@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>
|
||||
</block>
|
||||
<view v-else class="pack-center">
|
||||
<image src="/static/icons/order-null.png"></image>
|
||||
<view>{{toast}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "goodsList",
|
||||
props: {
|
||||
// 数据列表
|
||||
list: {
|
||||
type: Array,
|
||||
default: () => {
|
||||
return new Array
|
||||
}
|
||||
},
|
||||
listType: '',
|
||||
// 列表空提示
|
||||
toast: {
|
||||
type: String,
|
||||
default: '暂无订单数据 -_-!'
|
||||
},
|
||||
},
|
||||
created() {},
|
||||
methods: {
|
||||
goSigns(id,index) {
|
||||
this.$emit('goSign',{id:id,index:index});
|
||||
},
|
||||
goReTokens(id,index){
|
||||
this.$emit('goReToken',{id:id,index:index});
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
// 列表
|
||||
.returnList {
|
||||
background-color: #FFFFFF;
|
||||
padding: $padding;
|
||||
box-sizing: border-box;
|
||||
margin-top: $margin;
|
||||
}
|
||||
|
||||
.MallRefundsTemplate {
|
||||
position: relative;
|
||||
z-index: 0;
|
||||
}
|
||||
|
||||
// 顶部信息
|
||||
.top {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
box-sizing: border-box;
|
||||
padding-bottom: 20rpx;
|
||||
border-bottom: solid 1rpx #f7f7f7;
|
||||
position: relative;
|
||||
z-index: 0;
|
||||
|
||||
.company-logo {
|
||||
display: flex;
|
||||
width: 90%;
|
||||
|
||||
image {
|
||||
width: 40rpx;
|
||||
height: 40rpx;
|
||||
border-radius: 50%;
|
||||
margin-right: 20rpx;
|
||||
}
|
||||
|
||||
.company-name {
|
||||
font-size: 30rpx;
|
||||
color: #484848;
|
||||
font-weight: bold;
|
||||
width: calc(100% - 40rpx);
|
||||
padding: 0 20rpx;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
}
|
||||
|
||||
.no {
|
||||
margin-top: 10rpx;
|
||||
font-size: $title-size*0.8;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.status {
|
||||
color: #999;
|
||||
font-size: $title-size*.9;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
}
|
||||
}
|
||||
|
||||
// 商品信息
|
||||
.goods-info {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: flex-start;
|
||||
justify-content: flex-start;
|
||||
box-sizing: border-box;
|
||||
margin-top: 36rpx;
|
||||
|
||||
.goods-img {
|
||||
width: 120rpx;
|
||||
height: 120rpx;
|
||||
border-radius: 10rpx;
|
||||
}
|
||||
|
||||
.goods {
|
||||
flex: 1;
|
||||
width: calc(100% - 120rpx);
|
||||
padding: 0 20rpx;
|
||||
box-sizing: border-box;
|
||||
margin-bottom: 10rpx;
|
||||
|
||||
.name {
|
||||
width: 100%;
|
||||
font-size: 30rpx;
|
||||
|
||||
span {
|
||||
font-size: 32rpx;
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.flexrow {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
box-sizing: border-box;
|
||||
width: 100%;
|
||||
|
||||
.copy {
|
||||
color: $main-color;
|
||||
font-size: $title-size*0.8;
|
||||
font-weight: 400;
|
||||
padding: 0 30rpx;
|
||||
}
|
||||
}
|
||||
|
||||
// 操作按钮
|
||||
.actions {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
justify-content: flex-end;
|
||||
box-sizing: border-box;
|
||||
flex-wrap: wrap;
|
||||
flex: 1;
|
||||
font-size: 28rpx;
|
||||
color: #fff;
|
||||
border-top: solid 1rpx #EFF4F2;
|
||||
margin-top: $margin;
|
||||
|
||||
.nowPay {
|
||||
padding: 4rpx 20rpx;
|
||||
border-radius: 40rpx;
|
||||
margin-left: 20rpx;
|
||||
margin-top: 20rpx;
|
||||
color: #999;
|
||||
border: solid 1rpx #cacaca;
|
||||
|
||||
&.actions-color {
|
||||
color: #e1293f;
|
||||
border-color: #ec96a0;
|
||||
}
|
||||
}
|
||||
|
||||
.cancelOrder {
|
||||
padding: 10rpx 30rpx;
|
||||
border-radius: 40rpx;
|
||||
margin-left: 20rpx;
|
||||
margin-top: 20rpx;
|
||||
background-color: #DD524D;
|
||||
}
|
||||
|
||||
.logistics {
|
||||
background-color: $main-color;
|
||||
padding: 10rpx 30rpx;
|
||||
border-radius: 40rpx;
|
||||
margin-left: 20rpx;
|
||||
margin-top: 20rpx;
|
||||
}
|
||||
|
||||
.sign {
|
||||
background-color: #DD524D;
|
||||
padding: 10rpx 30rpx;
|
||||
border-radius: 40rpx;
|
||||
margin-left: 20rpx;
|
||||
margin-top: 20rpx;
|
||||
}
|
||||
|
||||
.evaluate {
|
||||
background-color: $main-color;
|
||||
padding: 10rpx 30rpx;
|
||||
border-radius: 40rpx;
|
||||
margin-left: 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>
|
||||
@@ -23,17 +23,17 @@
|
||||
<image class="arrow" src="@/static/icons/equity_arrow_right.png" mode="aspectFill"></image>
|
||||
</view>
|
||||
|
||||
<!-- order-shipment -->
|
||||
<view class="store-item" @click="$Router.push({name: ''})" v-if="toolList.orderShipment">
|
||||
<image class="icon" src="@/static/icons/tool_icon_04.png" mode="aspectFill"></image>
|
||||
<view class="title">发货单管理</view>
|
||||
<!-- order-refund -->
|
||||
<view class="store-item" @click="$Router.push({name: 'Return'})" v-if="toolList.orderRefund">
|
||||
<image class="icon" src="@/static/icons/tool_icon_07.png" mode="aspectFill"></image>
|
||||
<view class="title">退换货管理</view>
|
||||
<image class="arrow" src="@/static/icons/equity_arrow_right.png" mode="aspectFill"></image>
|
||||
</view>
|
||||
|
||||
<!-- order-refund -->
|
||||
<view class="store-item" @click="$Router.push({name: ''})" v-if="toolList.orderRefund">
|
||||
<image class="icon" src="@/static/icons/tool_icon_07.png" mode="aspectFill"></image>
|
||||
<view class="title">退换货管理</view>
|
||||
<!-- order-shipment -->
|
||||
<view class="store-item" @click="$Router.push({name: 'Deliver'})" v-if="toolList.orderShipment">
|
||||
<image class="icon" src="@/static/icons/tool_icon_04.png" mode="aspectFill"></image>
|
||||
<view class="title">发货单管理</view>
|
||||
<image class="arrow" src="@/static/icons/equity_arrow_right.png" mode="aspectFill"></image>
|
||||
</view>
|
||||
|
||||
|
||||
182
components/v-tabs/readme.md
Normal file
182
components/v-tabs/readme.md
Normal file
@@ -0,0 +1,182 @@
|
||||
## 插件说明
|
||||
|
||||
> 这是 `v-tabs` 插件的升级版本,参数上有很大变动,支持 `H5` `小程序` `手机端`,如果是在之前的插件上升级的话,请注意参数的变更,触发的事件没有变更。
|
||||
|
||||
## 使用说明
|
||||
|
||||
### 1、最基本用法
|
||||
|
||||
- 视图文件
|
||||
|
||||
```html
|
||||
<v-tabs v-model="current" :tabs="tabs" @change="changeTab"></v-tabs>
|
||||
```
|
||||
|
||||
- 脚本文件
|
||||
|
||||
```js
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
current: 0,
|
||||
tabs: ['军事', '国内', '新闻新闻', '军事', '国内', '新闻', '军事', '国内', '新闻']
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
changeTab(index) {
|
||||
console.log('当前选中的项:' + index)
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### 2、平铺整个屏幕
|
||||
|
||||
- 视图文件
|
||||
|
||||
```html
|
||||
<v-tabs v-model="activeTab" :scroll="false" :tabs="['全部', '进行中', '已完成']"></v-tabs>
|
||||
```
|
||||
|
||||
- 脚本文件
|
||||
|
||||
```js
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
activeTab: 0
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### 3、胶囊用法
|
||||
|
||||
- 视图文件
|
||||
|
||||
```html
|
||||
<v-tabs v-model="current" :tabs="tabs" :pills="true" line-height="0" activeColor="#fff" @change="changeTab"></v-tabs>
|
||||
```
|
||||
|
||||
- 脚本文件
|
||||
|
||||
```js
|
||||
data() {
|
||||
return {
|
||||
current: 2,
|
||||
tabs: [
|
||||
'军事',
|
||||
'国内',
|
||||
'新闻新闻',
|
||||
'军事',
|
||||
'国内',
|
||||
'新闻',
|
||||
'军事',
|
||||
'国内',
|
||||
'新闻',
|
||||
],
|
||||
},
|
||||
methods: {
|
||||
changeTab(index) {
|
||||
console.log('当前选中索引:' + index)
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## 文档说明
|
||||
|
||||
### 1、属性说明
|
||||
|
||||
| 参数 | 类型 | 默认值 | 说明 |
|
||||
| :---------------: | :-----: | :-------: | :----------------------------------------: |
|
||||
| value | Number | 0 | 必传(双向绑定的值) |
|
||||
| color | String | '#333' | 默认文字颜色 |
|
||||
| activeColor | String | '#2979ff' | 选中文字的颜色 |
|
||||
| fontSize | String | '28rpx' | 默认文字大小(rpx 或 px) |
|
||||
| bold | Boolean | true | 是否加粗选中项 |
|
||||
| scroll | Boolean | true | 是否显示滚动条,平铺设置 false |
|
||||
| height | String | '70rpx' | tab 高度(rpx 或 px) |
|
||||
| lineHeight | String | '10rpx' | 滑块高度(rpx 或 px) |
|
||||
| lineColor | String | '#2979ff' | 滑块的颜色 |
|
||||
| lineScale | Number | 0.5 | 滑块宽度缩放值 |
|
||||
| lineRadius | String | '10rpx' | 滑块圆角宽度(rpx 或 px) |
|
||||
| pills | Boolean | false | 是否开启胶囊 |
|
||||
| pillsColor | String | '#2979ff' | 胶囊背景颜色(rpx 或 px) |
|
||||
| pillsBorderRadius | String | '10rpx' | 胶囊圆角宽度(rpx 或 px) |
|
||||
| field | String | '' | 如果 tabs 子项是对象,输入需要展示的键名 |
|
||||
| bgColor | String | '#fff' | 背景色,支持 linear-gradient 渐变 |
|
||||
| padding | String | '0' | 整个 tab padding 属性 |
|
||||
| fixed | Boolean | false | 是否固定在顶部 |
|
||||
| paddingItem | String | '0 22rpx' | 选项的边距(设置上下不生效,需要设置高度) |
|
||||
|
||||
### 2、事件说明
|
||||
|
||||
| 名称 | 参数 | 说明 |
|
||||
| :----: | :---: | :--------------------------------: |
|
||||
| change | index | 改变选中项触发, index 选中项的下标 |
|
||||
|
||||
## 更新日志
|
||||
|
||||
### 2020-09-24
|
||||
|
||||
1. 修复 `v-tabs` 第一次可能出现第一个标签显示不完整的情况
|
||||
2. 修改了 `pages/tabs/order` 示例文件
|
||||
|
||||
### 2020-09-21
|
||||
|
||||
1. 修复添加 `fixed` 属性后,滚动条无效
|
||||
2. 修复选项很少的情况下,下划线计算计算错误
|
||||
3. 新增 `paddingItem` 属性,设置选项左右边距(上下边距需要设置 `height` 属性,或者设置 `padding` 属性)
|
||||
|
||||
**写在最后:**
|
||||
欢迎各位老铁反馈 bug ,本人后端 PHP 一枚,只是应为感兴趣前端,自己琢磨,自己搞。如果你在使用的过程中有什么不合理,需要优化的,都可以在下面评论(或加我 QQ: 1207791534),本人看见后回复、修正,感谢。
|
||||
|
||||
### 2020-09-17
|
||||
|
||||
1. 紧急修复 bug,横向滑动不了的情况
|
||||
|
||||
### 2020-09-16
|
||||
|
||||
1. 新增 `fixed` 属性,是否固定在顶部,示例地址:`pages/tabs/tabs-static`
|
||||
2. 优化之前的页面结构
|
||||
|
||||
**注意:**
|
||||
|
||||
1. 使用 `padding` 属性的时候,尽量不要左右边距,会导致下划线位置不对
|
||||
2. 如果不绑定 `v-model` 会导致 `change` 事件改变的时候,下划线不跟随问题
|
||||
|
||||
### 2020-09-09
|
||||
|
||||
1. 修复 `width` 错误,dom 加载的时候没有及时获取到 `data` 属性导致的。
|
||||
|
||||
### 2020-08-29
|
||||
|
||||
1. 优化异步改变 `tabs` 后,下划线不初始化问题
|
||||
2. `github` 地址上有图 2 的源码,需要的自行下载,页面路径:`pages/tabs/order`
|
||||
|
||||
### 2020-08-20
|
||||
|
||||
1. 优化 `节点查询` 和 `选中渲染`
|
||||
2. 优化支付宝中 `createSelectorQuery()` 的影响
|
||||
|
||||
### 2020-08-19
|
||||
|
||||
1. 优化 `change` 事件触发机制
|
||||
|
||||
### 2020-08-16
|
||||
|
||||
1. 修改默认高度为 `70rpx`
|
||||
2. 新增属性 `bgColor`,可设置背景颜色,默认 `#fff`
|
||||
3. 新增整个 `tab` 的 `padding` 属性,默认 `0`
|
||||
|
||||
### 2020-08-13
|
||||
|
||||
1. 全新的 `v-tabs 2.0`
|
||||
2. 支持 `H5` `小程序` `APP`
|
||||
3. 属性高度可配置
|
||||
|
||||
## 预览
|
||||
|
||||

|
||||

|
||||
337
components/v-tabs/v-tabs.vue
Normal file
337
components/v-tabs/v-tabs.vue
Normal file
@@ -0,0 +1,337 @@
|
||||
<template>
|
||||
<view :id="elId" class="v-tabs">
|
||||
<scroll-view
|
||||
id="scrollContainer"
|
||||
:scroll-x="scroll"
|
||||
:scroll-left="scroll ? scrollLeft : 0"
|
||||
:scroll-with-animation="scroll"
|
||||
:style="{ position: fixed ? 'fixed' : 'relative', zIndex: 99 }"
|
||||
>
|
||||
<view
|
||||
class="v-tabs__container"
|
||||
:style="{
|
||||
display: scroll ? 'inline-flex' : 'flex',
|
||||
whiteSpace: scroll ? 'nowrap' : 'normal',
|
||||
background: bgColor,
|
||||
height,
|
||||
padding
|
||||
}"
|
||||
>
|
||||
<view
|
||||
class="v-tabs__container-item"
|
||||
v-for="(v, i) in tabs"
|
||||
:key="i"
|
||||
:style="{
|
||||
color: current == i ? activeColor : color,
|
||||
fontSize: current == i ? fontSize : fontSize,
|
||||
fontWeight: bold && current == i ? 'bold' : '',
|
||||
justifyContent: !scroll ? 'center' : '',
|
||||
flex: scroll ? '' : 1,
|
||||
padding: paddingItem
|
||||
}"
|
||||
@click="change(i)"
|
||||
>
|
||||
{{ field ? v[field] : v.title }}
|
||||
</view>
|
||||
<view
|
||||
v-if="!pills"
|
||||
class="v-tabs__container-line"
|
||||
:style="{
|
||||
background: lineColor,
|
||||
width: lineWidth + 'px',
|
||||
height: lineHeight,
|
||||
borderRadius: lineRadius,
|
||||
left: lineLeft + 'px',
|
||||
transform: `translateX(-${lineWidth / 2}px)`
|
||||
}"
|
||||
></view>
|
||||
<view
|
||||
v-else
|
||||
class="v-tabs__container-pills"
|
||||
:style="{
|
||||
background: pillsColor,
|
||||
borderRadius: pillsBorderRadius,
|
||||
left: pillsLeft + 'px',
|
||||
width: currentWidth + 'px',
|
||||
height
|
||||
}"
|
||||
></view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
<view
|
||||
class="v-tabs__placeholder"
|
||||
:style="{
|
||||
height: fixed ? height : '0',
|
||||
padding
|
||||
}"
|
||||
></view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
/**
|
||||
* v-tabs
|
||||
* @property {Number} value 选中的下标
|
||||
* @property {Array} tabs tabs 列表
|
||||
* @property {String} bgColor = '#fff' 背景颜色
|
||||
* @property {String} color = '#333' 默认颜色
|
||||
* @property {String} activeColor = '#2979ff' 选中文字颜色
|
||||
* @property {String} fontSize = '28rpx' 默认文字大小
|
||||
* @property {String} activeFontSize = '28rpx' 选中文字大小
|
||||
* @property {Boolean} bold = [true | false] 选中文字是否加粗
|
||||
* @property {Boolean} scroll = [true | false] 是否滚动
|
||||
* @property {String} height = '60rpx' tab 的高度
|
||||
* @property {String} lineHeight = '10rpx' 下划线的高度
|
||||
* @property {String} lineColor = '#2979ff' 下划线的颜色
|
||||
* @property {Number} lineScale = 0.5 下划线的宽度缩放比例
|
||||
* @property {String} lineRadius = '10rpx' 下划线圆角
|
||||
* @property {Boolean} pills = [true | false] 是否胶囊样式
|
||||
* @property {String} pillsColor = '#2979ff' 胶囊背景色
|
||||
* @property {String} pillsBorderRadius = '10rpx' 胶囊圆角大小
|
||||
* @property {String} field 如果是对象,显示的键名
|
||||
* @property {Boolean} fixed = [true | false] 是否固定
|
||||
* @property {String} paddingItem = '0 22rpx' 选项的边距
|
||||
*
|
||||
* @event {Function(current)} change 改变标签触发
|
||||
*/
|
||||
export default {
|
||||
props: {
|
||||
value: {
|
||||
type: Number,
|
||||
default: 0
|
||||
},
|
||||
tabs: {
|
||||
type: Array,
|
||||
default() {
|
||||
return []
|
||||
}
|
||||
},
|
||||
bgColor: {
|
||||
type: String,
|
||||
default: '#fff'
|
||||
},
|
||||
padding: {
|
||||
type: String,
|
||||
default: '0'
|
||||
},
|
||||
color: {
|
||||
type: String,
|
||||
default: '#333'
|
||||
},
|
||||
activeColor: {
|
||||
type: String,
|
||||
default: '#2979ff'
|
||||
},
|
||||
fontSize: {
|
||||
type: String,
|
||||
default: '28rpx'
|
||||
},
|
||||
activeFontSize: {
|
||||
type: String,
|
||||
default: '32rpx'
|
||||
},
|
||||
bold: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
scroll: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
height: {
|
||||
type: String,
|
||||
default: '70rpx'
|
||||
},
|
||||
lineColor: {
|
||||
type: String,
|
||||
default: '#2979ff'
|
||||
},
|
||||
lineHeight: {
|
||||
type: String,
|
||||
default: '10rpx'
|
||||
},
|
||||
lineScale: {
|
||||
type: Number,
|
||||
default: 0.5
|
||||
},
|
||||
lineRadius: {
|
||||
type: String,
|
||||
default: '10rpx'
|
||||
},
|
||||
pills: {
|
||||
type: Boolean,
|
||||
deafult: false
|
||||
},
|
||||
pillsColor: {
|
||||
type: String,
|
||||
default: '#2979ff'
|
||||
},
|
||||
pillsBorderRadius: {
|
||||
type: String,
|
||||
default: '10rpx'
|
||||
},
|
||||
field: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
fixed: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
paddingItem: {
|
||||
type: String,
|
||||
default: '0 22rpx'
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
elId: '',
|
||||
lineWidth: 30,
|
||||
currentWidth: 0, // 当前选项的宽度
|
||||
lineLeft: 0, // 滑块距离左侧的位置
|
||||
pillsLeft: 0, // 胶囊距离左侧的位置
|
||||
scrollLeft: 0, // 距离左边的位置
|
||||
containerWidth: 0, // 容器的宽度
|
||||
current: 0 // 当前选中项
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
value(newVal) {
|
||||
this.current = newVal
|
||||
this.$nextTick(() => {
|
||||
this.getTabItemWidth()
|
||||
})
|
||||
},
|
||||
current(newVal) {
|
||||
this.$emit('input', newVal)
|
||||
},
|
||||
tabs(newVal) {
|
||||
this.$nextTick(() => {
|
||||
this.getTabItemWidth()
|
||||
})
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 产生随机字符串
|
||||
randomString(len) {
|
||||
len = len || 32
|
||||
let $chars =
|
||||
'ABCDEFGHJKMNPQRSTWXYZabcdefhijkmnprstwxyz2345678' /****默认去掉了容易混淆的字符oOLl,9gq,Vv,Uu,I1****/
|
||||
let maxPos = $chars.length
|
||||
let pwd = ''
|
||||
for (let i = 0; i < len; i++) {
|
||||
pwd += $chars.charAt(Math.floor(Math.random() * maxPos))
|
||||
}
|
||||
return pwd
|
||||
},
|
||||
// 切换事件
|
||||
change(index) {
|
||||
if (this.current !== index) {
|
||||
this.current = index
|
||||
|
||||
this.$emit('change', index)
|
||||
}
|
||||
},
|
||||
// 获取左移动位置
|
||||
getTabItemWidth() {
|
||||
let query = uni
|
||||
.createSelectorQuery()
|
||||
// #ifndef MP-ALIPAY
|
||||
.in(this)
|
||||
// #endif
|
||||
// 获取容器的宽度
|
||||
query
|
||||
.select(`#scrollContainer`)
|
||||
.boundingClientRect((data) => {
|
||||
if (!this.containerWidth && data) {
|
||||
this.containerWidth = data.width
|
||||
}
|
||||
})
|
||||
.exec()
|
||||
// 获取所有的 tab-item 的宽度
|
||||
query
|
||||
.selectAll('.v-tabs__container-item')
|
||||
.boundingClientRect((data) => {
|
||||
if (!data) {
|
||||
return
|
||||
}
|
||||
let lineLeft = 0
|
||||
let currentWidth = 0
|
||||
if (data) {
|
||||
for (let i = 0; i < data.length; i++) {
|
||||
if (i < this.current) {
|
||||
lineLeft += data[i].width
|
||||
} else if (i == this.current) {
|
||||
currentWidth = data[i].width
|
||||
} else {
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
// 当前滑块的宽度
|
||||
this.currentWidth = currentWidth
|
||||
// 缩放后的滑块宽度
|
||||
this.lineWidth = currentWidth * this.lineScale * 1
|
||||
// 滑块作移动的位置
|
||||
this.lineLeft = lineLeft + currentWidth / 2
|
||||
// 胶囊距离左侧的位置
|
||||
this.pillsLeft = lineLeft
|
||||
// 计算滚动的距离左侧的位置
|
||||
if (this.scroll) {
|
||||
this.scrollLeft = this.lineLeft - this.containerWidth / 2
|
||||
}
|
||||
})
|
||||
.exec()
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.elId = 'xfjpeter_' + this.randomString()
|
||||
this.current = this.value
|
||||
this.$nextTick(() => {
|
||||
this.getTabItemWidth()
|
||||
})
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.v-tabs {
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
overflow: hidden;
|
||||
::-webkit-scrollbar {
|
||||
display: none;
|
||||
}
|
||||
&__container {
|
||||
min-width: 100%;
|
||||
position: relative;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
|
||||
&-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
height: 100%;
|
||||
position: relative;
|
||||
z-index: 10;
|
||||
// padding: 0 11px;
|
||||
transition: all 0.3s;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
&-line {
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
transition: all 0.3s linear;
|
||||
}
|
||||
|
||||
&-pills {
|
||||
position: absolute;
|
||||
transition: all 0.3s linear;
|
||||
z-index: 9;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
218
components/vue-canvas-poster/canvas-poster.vue
Normal file
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
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
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
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
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
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
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
2
main.js
@@ -14,6 +14,8 @@ Vue.use(uView);
|
||||
|
||||
const app = new Vue({
|
||||
...App
|
||||
|
||||
|
||||
})
|
||||
Vue.component('no-list',noList)
|
||||
//v1.3.5起 H5端 你应该去除原有的app.$mount();使用路由自带的渲染方式
|
||||
|
||||
@@ -137,5 +137,10 @@
|
||||
},
|
||||
"uniStatistics" : {
|
||||
"enable" : false
|
||||
},
|
||||
"h5" : {
|
||||
"router" : {
|
||||
"mode" : "hash"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
200
pages.json
200
pages.json
@@ -54,6 +54,23 @@
|
||||
"navigationBarTextStyle": "white",
|
||||
"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",
|
||||
"name": "NumberWeight",
|
||||
@@ -173,7 +190,7 @@
|
||||
"enablePullDownRefresh": true,
|
||||
"navigationBarTextStyle": "white",
|
||||
"navigationBarBackgroundColor": "#e93340",
|
||||
"navigationBarTitleText": "已使用订单"
|
||||
"navigationBarTitleText": "已使用服务类订单"
|
||||
}
|
||||
},{
|
||||
"path": "pages/property/order/servicesOrderInfo",
|
||||
@@ -264,7 +281,7 @@
|
||||
"name": "Vip",
|
||||
"style": {
|
||||
"navigationBarTitleText": "会员",
|
||||
"navigationBarBackgroundColor": "#1f1b1c",
|
||||
"navigationBarBackgroundColor": "#e93340",
|
||||
"navigationBarTextStyle": "white",
|
||||
"backgroundColor": "#fefaef"
|
||||
}
|
||||
@@ -273,7 +290,7 @@
|
||||
"name": "vipAgree",
|
||||
"style": {
|
||||
"navigationBarTitleText": "用户协议",
|
||||
"navigationBarBackgroundColor": "#1f1b1c",
|
||||
"navigationBarBackgroundColor": "#e93340",
|
||||
"navigationBarTextStyle": "white",
|
||||
"backgroundColor": "#fefaef"
|
||||
}
|
||||
@@ -342,6 +359,13 @@
|
||||
"navigationBarTitleText": "成交客户",
|
||||
"navigationBarBackgroundColor": "#FFFFFF"
|
||||
}
|
||||
}, {
|
||||
"path": "pages/store/examine",
|
||||
"name": "Examine",
|
||||
"style": {
|
||||
"navigationBarTitleText": "退货单审核",
|
||||
"navigationBarBackgroundColor": "#FFFFFF"
|
||||
}
|
||||
}, {
|
||||
"path": "pages/store/basics",
|
||||
"name": "Basics",
|
||||
@@ -366,6 +390,48 @@
|
||||
"navigationBarTitleText": "营销推广码",
|
||||
"navigationBarBackgroundColor": "#FFFFFF"
|
||||
}
|
||||
}, {
|
||||
"path": "pages/store/return",
|
||||
"name": "Return",
|
||||
"style": {
|
||||
"navigationBarTitleText": "退货单处理",
|
||||
"navigationBarBackgroundColor": "#FFFFFF"
|
||||
}
|
||||
}, {
|
||||
"path": "pages/store/orderDetails",
|
||||
"name": "storeOrderDetails",
|
||||
"style": {
|
||||
"navigationBarTitleText": "订单详情",
|
||||
"navigationBarBackgroundColor": "#FFFFFF"
|
||||
}
|
||||
}, {
|
||||
"path": "pages/store/deliver",
|
||||
"name": "Deliver",
|
||||
"style": {
|
||||
"navigationBarTitleText": "发货单处理",
|
||||
"navigationBarBackgroundColor": "#FFFFFF"
|
||||
}
|
||||
}, {
|
||||
"path": "pages/store/deliverForm",
|
||||
"name": "DeliverForm",
|
||||
"style": {
|
||||
"navigationBarTitleText": "我要发货",
|
||||
"navigationBarBackgroundColor": "#FFFFFF"
|
||||
}
|
||||
}, {
|
||||
"path": "pages/store/logistic",
|
||||
"name": "Logistic",
|
||||
"style": {
|
||||
"navigationBarTitleText": "提货单物流",
|
||||
"navigationBarBackgroundColor": "#FFFFFF"
|
||||
}
|
||||
}, {
|
||||
"path": "pages/store/journal",
|
||||
"name": "storeJournal",
|
||||
"style": {
|
||||
"navigationBarTitleText": "操作日志",
|
||||
"navigationBarBackgroundColor": "#FFFFFF"
|
||||
}
|
||||
}, {
|
||||
"path": "pages/employees/list",
|
||||
"name": "Employees",
|
||||
@@ -415,6 +481,13 @@
|
||||
"navigationBarTitleText": "选择权证分类",
|
||||
"navigationBarBackgroundColor": "#FFFFFF"
|
||||
}
|
||||
}, {
|
||||
"path": "pages/goods/goodsClassify",
|
||||
"name": "goodsClassify",
|
||||
"style": {
|
||||
"navigationBarTitleText": "商品分类",
|
||||
"navigationBarBackgroundColor": "#FFFFFF"
|
||||
}
|
||||
}, {
|
||||
"path": "pages/goods/add",
|
||||
"name": "GoodsMagAdd",
|
||||
@@ -422,6 +495,27 @@
|
||||
"navigationBarTitleText": "发布权证",
|
||||
"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",
|
||||
"name": "Coupons",
|
||||
@@ -430,12 +524,12 @@
|
||||
}
|
||||
}, {
|
||||
"path": "pages/coupons/couponList",
|
||||
"name": "Coupons",
|
||||
"name": "CouponsList",
|
||||
"style": {
|
||||
"enablePullDownRefresh": true,
|
||||
"navigationBarTextStyle": "white",
|
||||
"navigationStyle": "custom",
|
||||
"backgroundColor": "#e93340"
|
||||
"navigationBarTitleText": "优惠券列表",
|
||||
"navigationBarBackgroundColor": "#e93340"
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -548,6 +642,98 @@
|
||||
"navigationBarTitleText": "转让权证",
|
||||
"backgroundColor": "#FFFFFF"
|
||||
}
|
||||
},{
|
||||
"path" : "pages/market/management",
|
||||
"name" : "marketManag",
|
||||
"style": {
|
||||
"navigationBarTitleText": "权证转让管理",
|
||||
"titleNView": {
|
||||
"backgroundColor": "#FFFFFF",
|
||||
"buttons": [{
|
||||
"text": "转让记录",
|
||||
"fontSize": "14",
|
||||
"width": "80",
|
||||
"color": "#e93340"
|
||||
}]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"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": {
|
||||
@@ -579,7 +765,7 @@
|
||||
},
|
||||
"globalStyle": {
|
||||
"navigationBarTextStyle": "black",
|
||||
"navigationBarTitleText": "易货",
|
||||
"navigationBarTitleText": "易货-易你所想",
|
||||
"navigationBarBackgroundColor": "#f5f5f5",
|
||||
"backgroundColor": "#f5f5f5"
|
||||
},
|
||||
|
||||
@@ -32,6 +32,10 @@
|
||||
<uni-icons class="picker-icon" type="arrowdown"></uni-icons>
|
||||
</view>
|
||||
</view>
|
||||
<view class="inputs" v-if="is_range">
|
||||
<label>经营范围</label>
|
||||
<textarea :auto-height='true' v-model="range" placeholder="输入经营范围" />
|
||||
</view>
|
||||
<view class="inputs">
|
||||
<label>法人姓名</label>
|
||||
<input type="text" v-model="corporate" placeholder="输入法人姓名" />
|
||||
@@ -93,7 +97,9 @@
|
||||
industryIndex: 0,
|
||||
reason : '',
|
||||
category : [],
|
||||
categorys : []
|
||||
categorys : [],
|
||||
range : "",
|
||||
is_range :false,
|
||||
};
|
||||
},
|
||||
created(){
|
||||
@@ -103,6 +109,7 @@
|
||||
this.industry = res.industries
|
||||
this.formType = this.$Route.query.formType
|
||||
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
|
||||
if(this.formType === 'put'){
|
||||
appliesInfo().then(formValue => {
|
||||
@@ -159,7 +166,8 @@
|
||||
id_card : this.identity,
|
||||
code : this.org,
|
||||
industry_id : this.industry[this.industryIndex].industry_id,
|
||||
categories : this.categorys
|
||||
categories : this.categorys,
|
||||
range : this.range
|
||||
}, method).then(res => {
|
||||
uni.showModal({
|
||||
title : '提示',
|
||||
@@ -167,7 +175,7 @@
|
||||
showCancel : false,
|
||||
confirmText : '确认',
|
||||
success : resModal => {
|
||||
this.$Router.back()
|
||||
this.$Router.pushTab({name: "Store"})
|
||||
}
|
||||
})
|
||||
}).catch(err => {
|
||||
@@ -252,6 +260,8 @@
|
||||
padding-left: 200rpx;
|
||||
line-height: 90rpx;
|
||||
min-height: 90rpx;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
label{
|
||||
position: absolute;
|
||||
top: 0;
|
||||
@@ -259,12 +269,15 @@
|
||||
width: 200rpx;
|
||||
font-size: $title-size;
|
||||
}
|
||||
input{
|
||||
input,textarea,picker{
|
||||
flex: 1;
|
||||
height: 90rpx;
|
||||
line-height: 90rpx;
|
||||
font-size: $title-size;
|
||||
}
|
||||
.picker-text{
|
||||
flex: 1;
|
||||
font-size: $title-size;
|
||||
position: relative;
|
||||
padding-right: 90rpx;
|
||||
.picker-icon{
|
||||
|
||||
@@ -79,7 +79,21 @@
|
||||
<label class="input-label">{{timeIndex == 0 ? '券有效期': '延期天数'}}</label>
|
||||
<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>
|
||||
<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 v-if="timeIndex === 1">
|
||||
<view class="input-number">
|
||||
@@ -107,6 +121,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import date from '@/public/date'
|
||||
import TnDatePicker from "@/components/tn-datepicker/tn-datepicker";
|
||||
import { uploads } from '@/apis/interfaces/uploading'
|
||||
import { pushCoupons } from '@/apis/interfaces/coupons'
|
||||
@@ -124,8 +139,8 @@
|
||||
],
|
||||
timeIndex : 0,
|
||||
times : [
|
||||
{ type: 2, text: '固定时间(区间范围)' },
|
||||
{ type: 1, text: '延期券(用户领取后有效天数)' }
|
||||
{ type: 1, text: '固定时间(区间范围)' },
|
||||
{ type: 2, text: '延期券(用户领取后有效天数)' }
|
||||
],
|
||||
showDatePicker : false, // 活动弹出层时间
|
||||
datePickerValue : [], // 活动时间
|
||||
@@ -138,12 +153,19 @@
|
||||
price : '', // 减少金额
|
||||
description : '', // 使用规则
|
||||
coupongoods : [], // 关联商品
|
||||
timeNumber : 1 // 延期券时间
|
||||
timeNumber : 1 , // 延期券时间
|
||||
minDate : '' // 优惠券最小期限
|
||||
};
|
||||
},
|
||||
onShow(){
|
||||
new date().then(res => {
|
||||
this.minDate = res
|
||||
})
|
||||
this.coupongoods = this.$store.getters.getCoupongoods
|
||||
},
|
||||
onUnload() {
|
||||
this.$store.commit('setCoupongoods', [])
|
||||
},
|
||||
methods:{
|
||||
// 发券数量
|
||||
quantityChange(value){
|
||||
@@ -163,11 +185,15 @@
|
||||
},
|
||||
// 选择
|
||||
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
|
||||
},
|
||||
// 日期
|
||||
confirmDatePicker(e){
|
||||
this.datePickerValue = e.value
|
||||
this.datePickerValue = [e.startDate , e.endDate]
|
||||
this.showDatePicker = false
|
||||
},
|
||||
// 上传优惠券封面
|
||||
@@ -206,11 +232,17 @@
|
||||
start_at : this.datePickerValue[0],
|
||||
end_at : this.datePickerValue[1],
|
||||
description : this.description,
|
||||
time_type : this.times[this.typeIndex].type,
|
||||
time_type : this.times[this.timeIndex].type,
|
||||
days : this.timeNumber,
|
||||
goodsable_ids : this.coupongoods
|
||||
}
|
||||
|
||||
if(valuss.description === ''){
|
||||
uni.showToast({
|
||||
title:'请添加使用规则',
|
||||
icon:'none'
|
||||
})
|
||||
return;
|
||||
}
|
||||
pushCoupons(valuss).then(res => {
|
||||
uni.showModal({
|
||||
title : '提示',
|
||||
|
||||
@@ -4,9 +4,7 @@
|
||||
<view style="position: relative;z-index: 3;">
|
||||
<!-- 搜索... -->
|
||||
<view class="mine-top-contant">
|
||||
<u-navbar back-icon-color='#fff' :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-->
|
||||
<swiper class="swiper" :indicator-dots="true" :autoplay="false" indicator-active-color='#fff'
|
||||
indicator-color='rgba(0,0,0,.1)'>
|
||||
@@ -142,8 +140,7 @@
|
||||
</view>
|
||||
</u-circle-progress>
|
||||
<view class="now-get" v-if='item.can.get'
|
||||
@click="toReceiveCoupon('services',index,item.coupon_id)">
|
||||
立即领取</view>
|
||||
@click="toReceiveCoupon('services',index,item.coupon_id)">立即领取</view>
|
||||
<view class="now-get now-got" v-if="!item.can.get && item.can.is_get"
|
||||
@click="toUse(item.coupon_id)">去使用</view>
|
||||
</view>
|
||||
@@ -263,7 +260,6 @@
|
||||
// 获取首页列表
|
||||
getCoupons() {
|
||||
couponsByCompanyId({}).then(res => {
|
||||
console.log(res)
|
||||
this.activities = res.activities // 顶部活动
|
||||
this.notices = res.notices // 通知消息
|
||||
let notices = res.notices
|
||||
|
||||
@@ -188,7 +188,7 @@
|
||||
.cover{
|
||||
position: relative;
|
||||
border-right: dashed 3rpx $border-color;
|
||||
width: 148rpx;
|
||||
width: 208rpx;
|
||||
text-align: center;
|
||||
.cover-img{
|
||||
width: 148rpx;
|
||||
@@ -234,7 +234,7 @@
|
||||
}
|
||||
.mian{
|
||||
justify-content: center;
|
||||
width: calc(100% - 148rpx - #{$padding*2});
|
||||
width: calc(100% - 208rpx);
|
||||
box-sizing: border-box;
|
||||
@extend .vertical;
|
||||
.title{
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<view>
|
||||
<!-- 商品列表 -->
|
||||
<view class="lists">
|
||||
<view class="lists" v-if="goods.length>0">
|
||||
<view class="goods-item" v-for="(item, index) in goods" :key="index">
|
||||
<checkbox class="checkbox" :checked="item.isSelect" @click="onSelect(index)"/>
|
||||
<view class="mian">
|
||||
@@ -16,6 +16,7 @@
|
||||
</view>
|
||||
<view class="ios-bottom"></view>
|
||||
</view>
|
||||
<no-list v-if="goods.length === 0" name='no-goods' txt="没有可勾选商品列表~" />
|
||||
<!-- footer -->
|
||||
<view class="footer">
|
||||
<view class="footer-flex">
|
||||
|
||||
@@ -18,13 +18,13 @@
|
||||
<input type="text" v-model="name" placeholder="姓名"/>
|
||||
</view>
|
||||
<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 class="info-inputs">
|
||||
<input type="text" v-model="job" placeholder="职业"/>
|
||||
</view>
|
||||
<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">
|
||||
{{section[sectionIndex].name}}
|
||||
<uni-icons class="icon" type="arrowdown" color="#555"></uni-icons>
|
||||
@@ -50,7 +50,7 @@
|
||||
<label>
|
||||
<view class="item-title">{{item.title}}</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>
|
||||
</view>
|
||||
</checkbox-group>
|
||||
@@ -73,7 +73,7 @@
|
||||
section : [],
|
||||
permissions : [],
|
||||
permissionIds: [],
|
||||
sectionIndex : 0,
|
||||
sectionIndex : '0',
|
||||
cover : {
|
||||
showpath : '',
|
||||
path : ''
|
||||
|
||||
@@ -12,9 +12,9 @@
|
||||
<uni-swipe-action-item :rightOptions="options" @click="onEmployees($event, listIndex, index)">
|
||||
<view class="employees-item">
|
||||
<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>
|
||||
<image class="cover-img" :src="item.user.avatar" mode="aspectFill"></image>
|
||||
<image class="cover-img" :src="item.cover" mode="aspectFill"/>
|
||||
</block>
|
||||
</view>
|
||||
<view class="content">
|
||||
|
||||
@@ -87,12 +87,22 @@
|
||||
</view>
|
||||
</swiper-item>
|
||||
</swiper>
|
||||
<!-- 行业分类 -->
|
||||
<scroll-view class="industry-tabs" scroll-x>
|
||||
<view class="industry-item" :class="{'show':index === industryIndex}" v-for="(item, index) in industryBus" :key="index" @click="onBusIndustry(index)">{{item.title}}</view>
|
||||
</scroll-view>
|
||||
<v-tabs
|
||||
v-model="industryIndex"
|
||||
:tabs="industryBus"
|
||||
color="#555555"
|
||||
activeColor="#e93340"
|
||||
fontSize="30rpx"
|
||||
height="80rpx"
|
||||
lineHeight="6rpx"
|
||||
lineColor="#e93340"
|
||||
bgColor="#f5f5f5"
|
||||
@change="onBusIndustry"
|
||||
></v-tabs>
|
||||
<!-- 商家 -->
|
||||
<industry-list :list="busList" @on-industry="onOpenWechat"/>
|
||||
<!-- 分页 -->
|
||||
<uni-load-more v-if="busList.length > 0" :status="pageStatus" :iconSize="16"></uni-load-more>
|
||||
</block>
|
||||
<!-- 易货商城 -->
|
||||
<block v-if="tabIndex === 0">
|
||||
@@ -142,7 +152,7 @@
|
||||
<view class="title">
|
||||
限时抢购<text>海量商家优惠券</text>
|
||||
</view>
|
||||
<navigator class="more" url="/pages/coupons/couponList">查看更多</navigator>
|
||||
<view class="more" @click="onCoupons('more')">查看更多</view>
|
||||
</view>
|
||||
<view class="coupons" v-if="coupons.length > 0">
|
||||
<view class="coupons-item" v-for="(item, index) in coupons" :key="index">
|
||||
@@ -163,20 +173,23 @@
|
||||
<view class="logo">
|
||||
<image class="logo-img" :src="item.cover" mode="aspectFill"></image>
|
||||
</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>
|
||||
<!-- 优选商品 -->
|
||||
<goods-list :list="goods" priceType="CNY" @on-goods="onGoods" />
|
||||
<!-- 分页 -->
|
||||
<uni-load-more :status="pageStatus" :iconSize="16"></uni-load-more>
|
||||
</block>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
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 industryList from '@/components/industry-list/industry-list'
|
||||
import userAuth from '@/public/userAuth'
|
||||
export default{
|
||||
comments:{
|
||||
goodsList,
|
||||
@@ -205,14 +218,16 @@
|
||||
coupons : [],
|
||||
position : {},
|
||||
goods : [],
|
||||
pages : {},
|
||||
goodsPage : 1,
|
||||
// 广场部分
|
||||
industryIndex: 0,
|
||||
recommendBus : [],
|
||||
hotBus : [],
|
||||
industryBus : [],
|
||||
busList : [],
|
||||
busPages : {}
|
||||
busPage : 1,
|
||||
// 分页
|
||||
pageStatus : ''
|
||||
};
|
||||
},
|
||||
created() {
|
||||
@@ -233,10 +248,38 @@
|
||||
onRightBtn(e){
|
||||
switch(e.index){
|
||||
case 0:
|
||||
this.$Router.push({name: 'Search'})
|
||||
this.$Router.push({name: 'Search', params: {type: this.tabIndex}})
|
||||
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(){
|
||||
companies().then(res=>{
|
||||
@@ -254,21 +297,26 @@
|
||||
// 企业广场行业
|
||||
onBusIndustry(index){
|
||||
this.industryIndex = index
|
||||
this.busPage = 1
|
||||
this.getCompaniesList()
|
||||
},
|
||||
// 企业列表
|
||||
getCompaniesList(){
|
||||
companiesList({
|
||||
industry_id: this.industryBus[this.industryIndex].industry_id
|
||||
industry_id: this.industryBus[this.industryIndex].industry_id,
|
||||
page : this.busPage
|
||||
}).then(res => {
|
||||
this.busList = res.data
|
||||
this.busPages = res.pages
|
||||
if(res.page.current === 1){
|
||||
this.busList = []
|
||||
}
|
||||
this.busList = this.busList.concat(res.data)
|
||||
this.busPage = res.page.current
|
||||
this.pageStatus = res.page.has_more ? 'more': 'noMore'
|
||||
})
|
||||
},
|
||||
// 易货首页
|
||||
getMall(){
|
||||
mall().then(res => {
|
||||
console.log(res.coupons)
|
||||
this.classify = res.categories.slice(0, 9)
|
||||
this.banners = res.banners
|
||||
this.coupons = res.coupons
|
||||
@@ -283,9 +331,15 @@
|
||||
},
|
||||
// 商品列表
|
||||
getGoods(){
|
||||
list().then(res => {
|
||||
this.goods = res.data
|
||||
this.pages = res.page
|
||||
list({
|
||||
page: this.goodsPage
|
||||
}).then(res => {
|
||||
if(res.page.current === 1){
|
||||
this.goods = []
|
||||
}
|
||||
this.goods = this.goods.concat(res.data)
|
||||
this.goodsPage = res.page.current
|
||||
this.pageStatus = res.page.has_more ? 'more': 'noMore'
|
||||
})
|
||||
},
|
||||
// 商品详情
|
||||
@@ -298,7 +352,6 @@
|
||||
},
|
||||
// 打开微信小程序
|
||||
onOpenWechat(e){
|
||||
console.log(e)
|
||||
plus.share.getServices(res => {
|
||||
let sweixin = null;
|
||||
for(let val of res){
|
||||
@@ -324,6 +377,22 @@
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
// 下拉加载
|
||||
onReachBottom() {
|
||||
if(this.pageStatus == 'more'){
|
||||
this.pageStatus = 'loading'
|
||||
switch (this.tabIndex){
|
||||
case 0:
|
||||
this.goodsPage += 1
|
||||
this.getGoods()
|
||||
break;
|
||||
case 1:
|
||||
this.busPage += 1
|
||||
this.getCompaniesList()
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -528,26 +597,14 @@
|
||||
line-height: 64rpx;
|
||||
font-size: 28rpx;
|
||||
font-weight: 600;
|
||||
&[disabled]{
|
||||
background: rgba($color: #faf2dd, $alpha: .8);
|
||||
color: rgba($color: #fd5f3c, $alpha: .5);
|
||||
}
|
||||
&::after{
|
||||
border: none;
|
||||
}
|
||||
}
|
||||
// 行业分类
|
||||
.industry-tabs{
|
||||
white-space:nowrap;
|
||||
.industry-item{
|
||||
margin-left: $margin;
|
||||
display: inline-block;
|
||||
line-height: 50rpx;
|
||||
font-size: $title-size-lg;
|
||||
color: $text-gray;
|
||||
&:last-child{
|
||||
margin-right: $margin;
|
||||
}
|
||||
&.show{
|
||||
color: $text-price;
|
||||
font-size: $title-size;
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
}
|
||||
// 热易商家
|
||||
|
||||
@@ -1,22 +1,295 @@
|
||||
<template>
|
||||
<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>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { searchUrl, companyCategory, randgoodsUrl } from '@/apis/interfaces/goods'
|
||||
export default {
|
||||
data() {
|
||||
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: {
|
||||
// 商品详情
|
||||
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>
|
||||
|
||||
<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>
|
||||
|
||||
@@ -398,13 +398,13 @@
|
||||
content : this.$Route.query.type === 'edit' ? '商品权证已更新,是否立即补充产品附加信息认证?' : '商品权证已发布,是否立即补充产品附加信息认证?',
|
||||
cancelText : '稍后认证',
|
||||
confirmText : '立即认证',
|
||||
success : res => {
|
||||
if(res.cancel){
|
||||
success : modalRes => {
|
||||
if(modalRes.cancel){
|
||||
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
|
||||
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() {
|
||||
managesCategory().then(res => {
|
||||
console.log(res)
|
||||
this.loding = false
|
||||
this.category = res
|
||||
})
|
||||
|
||||
@@ -115,7 +115,6 @@
|
||||
},
|
||||
created() {
|
||||
managesAttestation(this.$Route.query.id).then(res=>{
|
||||
console.log(res)
|
||||
this.info = res
|
||||
})
|
||||
},
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<image src="https://e-chain.cnskl.com/storage/imageresource/chain-bg.png" class='chainBg' />
|
||||
<view class="chain-content">
|
||||
<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="no">区块链溯源证书:{{info.token}}</view>
|
||||
<view class="content">
|
||||
@@ -49,7 +49,6 @@
|
||||
.GoodsChain {
|
||||
background-color:fff;
|
||||
width: 100%;
|
||||
min-height: 100vh;
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
.chainBg{
|
||||
@@ -60,7 +59,7 @@
|
||||
}
|
||||
.chain-content{
|
||||
width: 100%;
|
||||
height: 100vh;
|
||||
min-height: 100%;
|
||||
z-index: 2;
|
||||
padding: 18vh 10vw 15vh 10vw ;
|
||||
box-sizing: border-box;
|
||||
@@ -68,7 +67,7 @@
|
||||
z-index: 3;
|
||||
.chain-center{
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
min-height: 100%;
|
||||
.logo{
|
||||
width: 160rpx;
|
||||
height: 160rpx;
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
:readonly="true"
|
||||
color="#ddd"
|
||||
active-color="#c82626"
|
||||
:value="2.5"
|
||||
:value="goodsObj.company.star"
|
||||
:size="14"
|
||||
/>
|
||||
</view>
|
||||
@@ -69,7 +69,7 @@
|
||||
<label class="title">说明</label>
|
||||
特价商品不可与优惠券叠加使用
|
||||
</view>
|
||||
<view class="size-item nowrap">
|
||||
<view class="size-item nowrap" v-if="goodsObj.services.length > 0">
|
||||
<label class="title">服务</label>
|
||||
<view class="goods-serve" @click="serveOpne">
|
||||
<image class="goods-serve-img" src="../../static/icons/goods_buy.png" mode="aspectFill"></image>
|
||||
@@ -116,6 +116,9 @@
|
||||
满{{item.full}}可用
|
||||
</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-number coupons-small">
|
||||
提货券
|
||||
@@ -202,12 +205,15 @@
|
||||
userLogin.Login()
|
||||
return
|
||||
}
|
||||
this.$Router.push({
|
||||
name: 'Buy',
|
||||
params: {
|
||||
skuId: this.goodsObj.skus[0].sku_id,
|
||||
qty : this.goodsObj.skus[0].number
|
||||
}
|
||||
// this.$Router.push({
|
||||
// name: 'Buy',
|
||||
// params: {
|
||||
// skuId: this.goodsObj.skus[0].sku_id,
|
||||
// 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-weight: bold;
|
||||
line-height: 50rpx;
|
||||
display: flex;
|
||||
.title-hot {
|
||||
display: inline-block;
|
||||
background-color: #fee195;
|
||||
font-size: 24rpx;
|
||||
border-radius: 50rpx;
|
||||
@@ -408,7 +414,7 @@
|
||||
.goods-serve-img {
|
||||
width: 36rpx;
|
||||
height: 36rpx;
|
||||
margin-top: 24rpx;
|
||||
margin-top: 26rpx;
|
||||
}
|
||||
.goods-serve-name {
|
||||
margin: 0 30rpx 0 20rpx;
|
||||
@@ -637,9 +643,11 @@
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
margin-top: $margin;
|
||||
// background-color: red;
|
||||
.coupons-tips {
|
||||
background-color: #211e17;
|
||||
color: #efe8d8;
|
||||
// background-color: #211e17;
|
||||
background-image: linear-gradient(to right, #f8e5c0, #d6a46a);
|
||||
color: #8d4928;
|
||||
position: absolute;
|
||||
border-radius: 0 0 20rpx 0;
|
||||
padding: 0 8rpx;
|
||||
@@ -647,6 +655,7 @@
|
||||
line-height: 34rpx;
|
||||
left: 0;
|
||||
top: 0;
|
||||
z-index: 10;
|
||||
.coupons-tips-text {
|
||||
font-size: 24rpx;
|
||||
transform:scale(.85);
|
||||
@@ -660,6 +669,11 @@
|
||||
text-align: center;
|
||||
padding: $padding - 10 0;
|
||||
border-right: 2rpx dashed #eccdd4;
|
||||
.coupon-left-img{
|
||||
width: 180rpx;
|
||||
height: 100rpx;
|
||||
border-radius: 20rpx;
|
||||
}
|
||||
.coupons-number {
|
||||
font-size: 40rpx;
|
||||
font-weight: 600;
|
||||
|
||||
@@ -140,6 +140,7 @@
|
||||
product_address : this.productAddress,
|
||||
extend_cover : this.extendCover[0].path
|
||||
}
|
||||
|
||||
let submitFund = managesGoodsAuth(this.$Route.query.id, submitData)
|
||||
submitFund.then(res => {
|
||||
uni.showModal({
|
||||
@@ -149,7 +150,7 @@
|
||||
success : res => {
|
||||
if(res.confirm){
|
||||
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{
|
||||
this.$Router.back()
|
||||
}
|
||||
|
||||
95
pages/goods/goodsClassify.vue
Normal file
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>
|
||||
@@ -6,7 +6,7 @@
|
||||
价格
|
||||
<image
|
||||
class="icon"
|
||||
mode="widthFix" :src="require(marketType == 'low' ? '@/static/icons/market_icon_low.png': '@/static/icons/market_icon_high.png')"
|
||||
mode="widthFix" :src="require(marketType == 'asc' ? '@/static/icons/market_icon_low.png': '@/static/icons/market_icon_high.png')"
|
||||
/>
|
||||
</view>
|
||||
</view>
|
||||
@@ -23,27 +23,34 @@
|
||||
data() {
|
||||
return {
|
||||
tabIndex : 0,
|
||||
marketType : 'low',
|
||||
marketType : 'asc',
|
||||
goods : []
|
||||
};
|
||||
},
|
||||
created() {
|
||||
list().then(res=>{
|
||||
console.log(res.data)
|
||||
this.goods = res.data
|
||||
this.pages = res.page
|
||||
})
|
||||
this.getList()
|
||||
},
|
||||
methods:{
|
||||
onTabs(e){
|
||||
let index = e.target.dataset.index
|
||||
if(index == 0 && index == this.tabIndex) return
|
||||
if(index == 1 && index == this.tabIndex) this.marketType = this.marketType == 'low' ? 'high': 'low'
|
||||
if(index == 1 && index == this.tabIndex) this.marketType = this.marketType == 'asc' ? 'desc': 'asc'
|
||||
this.tabIndex = index
|
||||
this.getList()
|
||||
},
|
||||
|
||||
onGoods(e){
|
||||
this.$Router.push({name: 'goodsDetails', params: {id: e.goods_id}})
|
||||
},
|
||||
|
||||
getList(){
|
||||
list({
|
||||
category_cid: this.$Route.query.id,
|
||||
order_by : this.tabIndex == 1 ? this.marketType: ''
|
||||
}).then(res=>{
|
||||
this.goods = res.data
|
||||
this.pages = res.page
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -56,9 +56,7 @@
|
||||
}
|
||||
},
|
||||
created() {
|
||||
console.log(this.$Route.query.id)
|
||||
managesTracedTo(this.$Route.query.id).then(res=>{
|
||||
console.log(res)
|
||||
this.list = res.list
|
||||
this.info = res
|
||||
})
|
||||
|
||||
@@ -1,6 +1,11 @@
|
||||
<template>
|
||||
<view>
|
||||
<view class="tabs" v-if="$Route.query.type === 'my'">
|
||||
<view class="item" :class="{ 'show' : tab == 'sell'}" @click="onTasb('sell')">我转让的</view>
|
||||
<view class="item" :class="{ 'show' : tab == 'buys' }" @click="onTasb('buys')">我买到的</view>
|
||||
</view>
|
||||
<block v-if="logs.length > 0">
|
||||
<view :class="{'paddingTop': $Route.query.type === 'my'}">
|
||||
<view class="logs" v-for="(item, index) in logs" :key="index">
|
||||
<view class="logs-item">
|
||||
<label>交易权证</label>
|
||||
@@ -27,22 +32,51 @@
|
||||
{{item.created_at}}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
<block v-else>
|
||||
<view class="list-null">
|
||||
<image class="icon" src="@/static/icons/listnull-icon.png" mode="widthFix" />
|
||||
<view class="sub-title">暂无数据</view>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { marketsLogs } from '@/apis/interfaces/market'
|
||||
import { marketsLogs, marketsOrdersLogs } from '@/apis/interfaces/market'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
logs: [],
|
||||
page: {}
|
||||
page: {},
|
||||
tab : 'sell'
|
||||
};
|
||||
},
|
||||
created(){
|
||||
this.getList()
|
||||
},
|
||||
methods:{
|
||||
onTasb(e){
|
||||
this.tab = e
|
||||
this.getList()
|
||||
},
|
||||
// 获取列表
|
||||
getList(){
|
||||
if(this.$Route.query.type === 'my'){
|
||||
marketsOrdersLogs({}, this.tab).then(res =>{
|
||||
console.log(res)
|
||||
this.logs = res.data
|
||||
this.page = res.page
|
||||
}).catch(err => {
|
||||
uni.showToast({
|
||||
title: err.message,
|
||||
icon : 'none'
|
||||
})
|
||||
})
|
||||
return
|
||||
}
|
||||
marketsLogs().then(res => {
|
||||
console.log(res.data)
|
||||
this.logs = res.data
|
||||
this.page = res.page
|
||||
}).catch(err => {
|
||||
@@ -53,9 +87,35 @@
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.tabs{
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
z-index: 99;
|
||||
background-color: white;
|
||||
height: 90rpx;
|
||||
line-height: 90rpx;
|
||||
display: flex;
|
||||
justify-content: space-around;
|
||||
.item{
|
||||
border-bottom: solid 2rpx white;
|
||||
box-sizing: border-box;
|
||||
&.show{
|
||||
border-color: $text-price;
|
||||
color: $text-price;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.paddingTop{
|
||||
padding-top: 90rpx;
|
||||
}
|
||||
|
||||
.logs{
|
||||
background: white;
|
||||
margin-top: $margin;
|
||||
@@ -78,4 +138,29 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 空提示
|
||||
.list-null{
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
box-sizing: border-box;
|
||||
text-align: center;
|
||||
background: white;
|
||||
padding-bottom: 20vh;
|
||||
@extend .vertical;
|
||||
.sub-title{
|
||||
color: $text-gray;
|
||||
font-size: $title-size-m;
|
||||
}
|
||||
.icon{
|
||||
width: 288rpx;
|
||||
}
|
||||
}
|
||||
.employees-null{
|
||||
text-align: center;
|
||||
line-height: 10vh;
|
||||
padding-bottom: $padding;
|
||||
font-size: $title-size-m;
|
||||
color: $text-gray;
|
||||
}
|
||||
</style>
|
||||
|
||||
169
pages/market/management.vue
Normal file
169
pages/market/management.vue
Normal file
@@ -0,0 +1,169 @@
|
||||
<template>
|
||||
<view class="NumberWeight">
|
||||
<!-- 有订单列表 -->
|
||||
<view v-if="lists.length > 0">
|
||||
<block v-for="(item, index) in lists" :key="index">
|
||||
<view class="order-item">
|
||||
<view class="order-info">
|
||||
<image class="order-cover" :src="item.goods.cover" mode="aspectFill"></image>
|
||||
<view class="title">数字权证<text>{{item.surplus}}/{{item.stock}}</text></view>
|
||||
<view class="text">锚定商品:{{item.goods.goods_name}}</view>
|
||||
<view class="text">交易哈希:{{item.hash}}</view>
|
||||
<view class="text">发布时间:{{item.created_at}}</view>
|
||||
</view>
|
||||
<view class="order-tool">
|
||||
<view class="price">{{item.price}}/个</view>
|
||||
<view class="order-btn" v-if="item.status.value === 1" @click="removeGoods(item.market_id, index)">取消转让</view>
|
||||
<view class="order-status" v-if="item.status.value === 2">{{item.status.text}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
<!-- 没有订单列表 -->
|
||||
<no-list v-if="lists.length === 0" name="no-order" txt="暂无数据~" />
|
||||
<u-toast ref="uToast" />
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { marketsMag, marketsCancel } from '@/apis/interfaces/market';
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
lists: [],
|
||||
page: 1,
|
||||
total: 0
|
||||
};
|
||||
},
|
||||
onLoad() {
|
||||
this.getList();
|
||||
},
|
||||
onReachBottom() {
|
||||
if (this.total > this.lists.length) {
|
||||
this.page = this.page + 1;
|
||||
this.getList();
|
||||
} else {
|
||||
this.$refs.uToast.show({
|
||||
title: '吼吼吼~我是有底的~',
|
||||
type: 'error',
|
||||
icon: false,
|
||||
duration: 3000
|
||||
});
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getList() {
|
||||
let data = {
|
||||
perPage: 10,
|
||||
page: this.page
|
||||
};
|
||||
marketsMag(data)
|
||||
.then(res => {
|
||||
console.log(res.markets.data);
|
||||
this.lists = this.lists.concat(res.markets.data);
|
||||
this.total = res.markets.page.total;
|
||||
})
|
||||
.catch(err => {
|
||||
this.$refs.uToast.show({
|
||||
title: err.message,
|
||||
type: 'error',
|
||||
icon: false,
|
||||
duration: 3000
|
||||
});
|
||||
});
|
||||
},
|
||||
// 取消转让
|
||||
removeGoods(id, index) {
|
||||
marketsCancel(id).then(res => {
|
||||
uni.showToast({
|
||||
icon : 'none',
|
||||
title: res
|
||||
})
|
||||
let statusObj = this.lists[index]
|
||||
statusObj.status = {
|
||||
value: 2,
|
||||
text : '已取消',
|
||||
}
|
||||
this.$set(this.lists, index, statusObj)
|
||||
}).catch(err => {
|
||||
uni.showToast({
|
||||
icon : 'none',
|
||||
title: err.message
|
||||
})
|
||||
})
|
||||
}
|
||||
},
|
||||
onNavigationBarButtonTap(){
|
||||
this.$Router.push({name: "marketLogs", params: {type: 'my'}})
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.NumberWeight {
|
||||
box-sizing: border-box;
|
||||
// 订单列表
|
||||
.order-item {
|
||||
background-color: white;
|
||||
margin: $margin;
|
||||
border-radius: $radius;
|
||||
padding: $padding;
|
||||
.order-info{
|
||||
position: relative;
|
||||
padding-left: 188rpx;
|
||||
min-height: 168rpx;
|
||||
.order-cover{
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
height: 168rpx;
|
||||
width: 168rpx;
|
||||
}
|
||||
.title{
|
||||
font-weight: bold;
|
||||
font-size: $title-size-lg;
|
||||
color: $text-color;
|
||||
line-height: 48rpx;
|
||||
height: 48rpx;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
text{
|
||||
font-size: 80%;
|
||||
font-weight: normal;
|
||||
}
|
||||
}
|
||||
.text{
|
||||
line-height: 40rpx;
|
||||
height: 40rpx;
|
||||
font-size: $title-size-sm;
|
||||
color: $text-gray;
|
||||
@extend .nowrap;
|
||||
}
|
||||
}
|
||||
.order-tool{
|
||||
margin-top: $margin - 10;
|
||||
padding-top: $padding - 10;
|
||||
border-top: solid 1rpx $border-color;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
.price{
|
||||
color: $text-price;
|
||||
font-weight: bold;
|
||||
font-size: $title-size-m;
|
||||
line-height: 50rpx;
|
||||
}
|
||||
.order-btn{
|
||||
background: $text-price;
|
||||
color: white;
|
||||
padding: 0 $padding;
|
||||
line-height: 50rpx;
|
||||
border-radius: 25rpx;
|
||||
font-size: $title-size-m;
|
||||
}
|
||||
.order-status{
|
||||
color: $text-gray-m;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -12,7 +12,7 @@
|
||||
<view class="info">
|
||||
<view class="info-item">
|
||||
<label>权证销售单价</label>
|
||||
1000.00
|
||||
¥{{info.goods.price}}
|
||||
</view>
|
||||
<view class="info-item">
|
||||
<label>拥有数量</label>
|
||||
@@ -33,6 +33,7 @@
|
||||
</view>
|
||||
</view>
|
||||
<button class="buy-btn" type="default" @click="onCreate">确认转让</button>
|
||||
<u-toast ref="uToast" />
|
||||
</view>
|
||||
</template>
|
||||
|
||||
@@ -75,6 +76,13 @@
|
||||
},
|
||||
// 提交转让市场
|
||||
onCreate(){
|
||||
if(this.pirce === ''){
|
||||
this.$refs.uToast.show({
|
||||
title: '请校验转让价格',
|
||||
type: 'error',icon:false,
|
||||
duration: 3000
|
||||
})
|
||||
}else{
|
||||
marketsCreate({
|
||||
symbol : this.$Route.query.symbol,
|
||||
qty : this.stock,
|
||||
@@ -98,6 +106,7 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
<label>订单金额</label>
|
||||
<view class="price nowrap">{{amount}}</view>
|
||||
</view>
|
||||
<block v-if="coupons.length > 1">
|
||||
<block v-if="coupons.length >= 1">
|
||||
<view class="item">
|
||||
<label>使用优惠券</label>
|
||||
<picker mode="selector" :range="coupons" range-key="title" :value="couponIndex" @change="couponsChange">
|
||||
@@ -133,9 +133,9 @@
|
||||
},
|
||||
// 选择支付类型
|
||||
payType(e){
|
||||
console.log(e.detail.value)
|
||||
this.payValue = e.detail.value
|
||||
},
|
||||
|
||||
//数量变化
|
||||
numberChange(e){
|
||||
this.qty = e
|
||||
@@ -148,7 +148,7 @@
|
||||
goods_sku_id : this.$Route.query.skuId,
|
||||
qty : this.qty,
|
||||
coupon_grant_id : this.couponId,
|
||||
type : 1,
|
||||
type : this.payValue === 'wx'?2:1,
|
||||
remark : 'app订单,易货产品',
|
||||
channel : 'app'
|
||||
}, 'POST').then(res=>{
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { orderJournal } from '@/apis/interfaces/store'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
||||
666
pages/property/coupon/confirmOrder.vue
Normal file
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: [{
|
||||
id: '',
|
||||
name: '全部'
|
||||
}, {
|
||||
id: '4',
|
||||
name: '新到'
|
||||
},
|
||||
@@ -146,6 +149,7 @@
|
||||
selectNav(id) {
|
||||
console.log(id)
|
||||
this.selectNavId = id
|
||||
this.selectCategoryId = ''
|
||||
this.getMyCoupon()
|
||||
},
|
||||
selectCategory(id) {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<view class="Coupon">
|
||||
<!-- 有优惠券列表 -->
|
||||
<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>
|
||||
|
||||
<!-- 没有优惠券列表 -->
|
||||
|
||||
@@ -83,7 +83,7 @@
|
||||
getList() {
|
||||
getCouponsInfoById(this.coupon_grant_id).then(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
|
||||
}).catch(err => {
|
||||
this.$refs.uToast.show({
|
||||
@@ -95,7 +95,8 @@
|
||||
// 点击立即购买去商品确认页面
|
||||
nowBuy(items) {
|
||||
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){
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<view style="position: relative;z-index: 3;">
|
||||
<!-- 搜索... -->
|
||||
<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'>
|
||||
</u-navbar>
|
||||
<!--banner-->
|
||||
|
||||
101
pages/property/coupon/payStatus.vue
Normal file
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 {
|
||||
width: 100%;
|
||||
height: 100vh;
|
||||
min-height: 100vh;
|
||||
padding-top: 30rpx;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
@@ -1,16 +1,17 @@
|
||||
<template>
|
||||
<view v-if='loaded'>
|
||||
<view v-if='loding'>
|
||||
<block v-if="this.$store.state.token != ''">
|
||||
<!-- 用户信息 -->
|
||||
<view class="user">
|
||||
<view class="user-tool" @click="$Router.push({name:'Setting'})">
|
||||
<image src="@/static/icons/user_icon_00.png" mode="widthFix" />
|
||||
</view>
|
||||
<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-signa">潮流就是我的态度</view>
|
||||
<view class="info-tags">
|
||||
<text class="info-tags-item identity">{{base.identity.name}}</text>
|
||||
<view class="info-tags" v-if="this.$store.state.token != ''">
|
||||
<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>
|
||||
</view>
|
||||
</view>
|
||||
@@ -20,7 +21,7 @@
|
||||
</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>
|
||||
<swiper class="user-ad-swiper" :interval="3000" autoplay vertical circular>
|
||||
<swiper-item v-for="(item,index) in message" :key='index'>
|
||||
@@ -35,19 +36,19 @@
|
||||
<view class="title-text">我的资产</view>
|
||||
</view>
|
||||
<view class="group-flex group-flex-4">
|
||||
<view class="item" @click="showToast">
|
||||
<view class="item-num">{{base.account.token}}</view>
|
||||
<view class="item" @click="$Router.push({name:'Extract'})">
|
||||
<view class="item-num">{{base.account.coins}}</view>
|
||||
<view class="item-title">原石</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-title">贡献值</view>
|
||||
<view class="item-title">当前贡献值</view>
|
||||
</view>
|
||||
<view class="item" @click="$Router.push({name:'Eb'})">
|
||||
<view class="item-num">{{base.account.eb}}</view>
|
||||
<view class="item-title">易币</view>
|
||||
<view class="item-title">当前易币</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-title">零钱</view>
|
||||
</view>
|
||||
@@ -63,7 +64,7 @@
|
||||
<view class="item-num">{{count.warrnats}}</view>
|
||||
<view class="item-title">权证持有</view>
|
||||
</view>
|
||||
<view class="item" @click="showToast">
|
||||
<view class="item" @click="$Router.push({name: 'marketManag'})">
|
||||
<view class="item-num">{{count.warrnat_transfer}}</view>
|
||||
<view class="item-title">权证转让</view>
|
||||
</view>
|
||||
@@ -137,96 +138,110 @@
|
||||
<image class="tips" src="../../static/icons/property_icon_01.png" mode="aspectFill" />
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
<!-- 推广海报 -->
|
||||
<view class="poster-text">推广海报</view>
|
||||
|
||||
<!-- <carousel :img-list="imgList" url-key="url" @selected="selectedBanner"/> -->
|
||||
<view class="code">
|
||||
<image class="code-img-bg" src="/static/images/share_bg_3.png" mode="aspectFill" />
|
||||
<image class='code-img' :src="shareCode" mode="widthFix" />
|
||||
</view>
|
||||
|
||||
</block>
|
||||
<!-- 弹窗 -->
|
||||
<u-toast ref="uToast" />
|
||||
<!-- 版权信息 -->
|
||||
<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>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
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 {
|
||||
components: {
|
||||
carousel
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
tabsIndex: 0,
|
||||
imgList: [{
|
||||
url: 'https://img9.51tietu.net/pic/2019-091200/vgkpidei2tjvgkpidei2tj.jpg',
|
||||
id: 1
|
||||
},{
|
||||
url: 'https://img9.51tietu.net/pic/2019-091200/euzekmi5m23euzekmi5m23.jpg',
|
||||
id: 2
|
||||
},{
|
||||
url: 'https://img9.51tietu.net/pic/2019-091200/143tt0ta4sr143tt0ta4sr.jpg',
|
||||
id: 3
|
||||
}],
|
||||
base:'',
|
||||
count:'',
|
||||
relations:'',
|
||||
message:'',
|
||||
loaded:false,
|
||||
shareCode:''
|
||||
tabsIndex : 0,
|
||||
base : {
|
||||
avatar : '',
|
||||
nickname: '',
|
||||
account : {
|
||||
token : 0,
|
||||
contribution: 0,
|
||||
eb : 0,
|
||||
money : 0
|
||||
}
|
||||
},
|
||||
count : {
|
||||
warrnats : 0,
|
||||
warrnat_transfer : 0,
|
||||
shipment_fuwu_count : 0,
|
||||
shipment_goods_count: 0
|
||||
},
|
||||
relations : '',
|
||||
message : [],
|
||||
shareCode : '',
|
||||
loding : false
|
||||
}
|
||||
},
|
||||
onShow(){
|
||||
this.getUserInfo()
|
||||
if(this.$store.state.token != '') this.userInfo()
|
||||
else this.loding = true
|
||||
},
|
||||
methods: {
|
||||
// 获取用户的基本信息
|
||||
getUserInfo(){
|
||||
getUserInfo().then(res => {
|
||||
this.base = res.base
|
||||
this.count = res.count
|
||||
this.message = res.message
|
||||
this.relations = res.relations
|
||||
this.loaded = true
|
||||
userInfo(){
|
||||
Promise.all([getUserInfo(), appcode()]).then(res => {
|
||||
let userInfoData = res[0],
|
||||
appcodeData = res[1]
|
||||
|
||||
this.base = userInfoData.base
|
||||
this.count = userInfoData.count
|
||||
this.message = userInfoData.message
|
||||
this.relations = userInfoData.relations
|
||||
this.shareCode = appcodeData.code
|
||||
this.loding = true
|
||||
}).catch(err => {
|
||||
this.$refs.uToast.show({
|
||||
console.log(err)
|
||||
uni.showToast({
|
||||
title: err.message,
|
||||
type: 'error',
|
||||
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
|
||||
icon : 'none'
|
||||
})
|
||||
})
|
||||
},
|
||||
outLogin(){
|
||||
this.$store.commit('setToken', '')
|
||||
},
|
||||
selectedBanner(item, index) {
|
||||
console.log('🥒', item, index)
|
||||
},
|
||||
|
||||
// 努力开发中,,,
|
||||
showToast(){
|
||||
this.$refs.uToast.show({
|
||||
uni.showToast({
|
||||
title: '努力开发中',
|
||||
type:'error',
|
||||
duration: 3000
|
||||
icon : 'none'
|
||||
})
|
||||
},
|
||||
|
||||
// 登录
|
||||
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>
|
||||
|
||||
<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{
|
||||
padding: 0 $padding;
|
||||
@@ -329,6 +376,7 @@
|
||||
&.vip{
|
||||
background-image: linear-gradient(to right, #f8e5c0, #d6a46a);
|
||||
color: #8d4928;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -523,4 +571,95 @@
|
||||
font-size: $title-size-sm;
|
||||
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>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<view class="LogisticsIndex">
|
||||
<view class="LogisticsIndex" v-if="loaded">
|
||||
<block v-if="list.length>0">
|
||||
<view class="logistics-top">
|
||||
<view>{{express.express_name}} <span class="copy" @click='copy(express.express_no)'>复制单号</span></view>
|
||||
@@ -34,12 +34,15 @@
|
||||
data() {
|
||||
return {
|
||||
list: [],
|
||||
loaded:false,
|
||||
no: '', // 快递单号
|
||||
express:{},// 地址信息
|
||||
}
|
||||
},
|
||||
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)
|
||||
},
|
||||
methods: {
|
||||
@@ -48,6 +51,7 @@
|
||||
console.log(res)
|
||||
this.list = res.logistics
|
||||
this.express = res.express
|
||||
this.loaded = true
|
||||
}).catch(err => {
|
||||
this.$refs.uToast.show({
|
||||
title: err.message,
|
||||
|
||||
@@ -1,23 +1,13 @@
|
||||
<template>
|
||||
<view class="OrderInfo">
|
||||
<view class="OrderInfo" v-if="loaded">
|
||||
<!-- 订单状态 -->
|
||||
<view class="order-status">
|
||||
<view class="info">
|
||||
{{info.state.text}}
|
||||
<span>{{info.state.remark}}</span>
|
||||
{{state.text}}
|
||||
<span>{{state.remark}}</span>
|
||||
</view>
|
||||
<image src="/static/imgs/fire.png" mode="widthFix"></image>
|
||||
</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="top">
|
||||
@@ -41,7 +31,7 @@
|
||||
<view class="sku">权证个数 <span>x {{info.qty}}</span> </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>
|
||||
</navigator>
|
||||
<view class="goods-type">创建退货时间 <span>{{info.created_at}}</span></view>
|
||||
@@ -73,7 +63,7 @@
|
||||
<view :class="['dian',index === 0 ?'dian-active':'']"></view>
|
||||
<view :class="['content',index === 0?'content-active':'']">
|
||||
<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">
|
||||
<image @click="priveImg(index,idx)" v-for="(it,idx) in item.pictures" :key='idx' :src="it" mode="aspectFill" />
|
||||
</view>
|
||||
@@ -101,16 +91,20 @@
|
||||
return {
|
||||
info: {},
|
||||
qty: 1,
|
||||
state:{},
|
||||
refund_id: '', // 退货单no
|
||||
company: '',
|
||||
number: '',
|
||||
logs: [],
|
||||
loaded:false,
|
||||
showLogs: false // 默认不显示记录信息
|
||||
};
|
||||
},
|
||||
onLoad(e) {
|
||||
this.refund_id = this.$route.params.no
|
||||
this.getInfo(this.refund_id)
|
||||
// this.refund_id = this.$route.params.no
|
||||
// this.getInfo(this.refund_id)
|
||||
this.refund_id = e.no
|
||||
this.getInfo(e.no)
|
||||
},
|
||||
onShow() {
|
||||
if (uni.getStorageSync('refresh')) {
|
||||
@@ -123,6 +117,8 @@
|
||||
mallRefundsInfo(refund_id).then(res => {
|
||||
this.info = res
|
||||
this.logs = res.log
|
||||
this.state = res.state
|
||||
this.loaded = true
|
||||
}).catch(err => {
|
||||
this.$refs.uToast.show({
|
||||
title: err.message,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<view class="NumberWeight">
|
||||
<view class="mallShipments">
|
||||
<!-- 订单分类 -->
|
||||
<view class="nav">
|
||||
<view :class="['nav-item' ,selectTypeId === item.id?'nav-item-selected':'']"
|
||||
@@ -314,39 +314,51 @@
|
||||
|
||||
// 申请退货
|
||||
nowRefund(no) {
|
||||
this.$router.push({
|
||||
name: 'MallShipmentsRefund',
|
||||
params: {
|
||||
no: no
|
||||
}
|
||||
// this.$Router.push({
|
||||
// name: 'MallShipmentsRefund',
|
||||
// params: {
|
||||
// no: no
|
||||
// }
|
||||
// })
|
||||
uni.navigateTo({
|
||||
url:'/pages/property/order/mallShipmentsRefund?no='+no
|
||||
})
|
||||
},
|
||||
// 查看物流
|
||||
nowLogistics(no) {
|
||||
this.$router.push({
|
||||
name: 'Orderlogistics',
|
||||
params: {
|
||||
no: no
|
||||
}
|
||||
// this.$Router.push({
|
||||
// name: 'Orderlogistics',
|
||||
// params: {
|
||||
// no: no
|
||||
// }
|
||||
// })
|
||||
uni.navigateTo({
|
||||
url:'/pages/property/order/logistics?no='+no
|
||||
})
|
||||
},
|
||||
// 查看详情
|
||||
goDetail(no) {
|
||||
this.$router.push({
|
||||
name: 'MallShipmentsInfo',
|
||||
params: {
|
||||
no: no
|
||||
}
|
||||
// this.$Router.push({
|
||||
// name: 'MallShipmentsInfo',
|
||||
// query:{
|
||||
// no:no
|
||||
// }
|
||||
// })
|
||||
uni.navigateTo({
|
||||
url:'/pages/property/order/mallShipmentsInfo?no='+no
|
||||
})
|
||||
},
|
||||
// 查看退货单详情
|
||||
// 查看详情
|
||||
goDetail1(no){
|
||||
this.$router.push({
|
||||
name: 'MallRefundsInfo',
|
||||
params:{
|
||||
no:no
|
||||
}
|
||||
// this.$Router.push({
|
||||
// name: 'MallRefundsInfo',
|
||||
// params:{
|
||||
// no:no
|
||||
// }
|
||||
// })
|
||||
uni.navigateTo({
|
||||
url:'/pages/property/order/mallRefundsInfo?no='+no
|
||||
})
|
||||
}
|
||||
|
||||
@@ -360,7 +372,7 @@
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.NumberWeight {
|
||||
.mallShipments {
|
||||
width: 100%;
|
||||
min-height: 100vh;
|
||||
box-sizing: border-box;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<view class="OrderInfo">
|
||||
<view class="OrderInfo" v-if="loaded">
|
||||
<!-- 订单状态 -->
|
||||
<view class="order-status">
|
||||
<view class="info">
|
||||
@@ -41,7 +41,7 @@
|
||||
<view class="sku">权证个数 <span>x {{info.qty}}</span> </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>
|
||||
</navigator>
|
||||
<view class="goods-type">创建提货单时间 <span>{{info.created_at}}</span></view>
|
||||
@@ -106,11 +106,12 @@
|
||||
store_Name:'',// 门店名称
|
||||
qty :1,
|
||||
shipment_no:'', // 提货单no
|
||||
loaded:false
|
||||
};
|
||||
},
|
||||
onLoad(e) {
|
||||
this.shipment_no = this.$route.params.no
|
||||
this.getInfo(this.$route.params.no)
|
||||
this.shipment_no = e.no
|
||||
this.getInfo(e.no)
|
||||
},
|
||||
onShow() {
|
||||
if(uni.getStorageSync('refresh')){
|
||||
@@ -123,6 +124,7 @@
|
||||
this.info = res
|
||||
this.address = res.express
|
||||
this.type = res.type+''
|
||||
this.loaded = true
|
||||
}).catch(err=>{
|
||||
this.$refs.uToast.show({
|
||||
title: err.message,
|
||||
|
||||
@@ -78,8 +78,11 @@
|
||||
};
|
||||
},
|
||||
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: {
|
||||
// 预览上传图片
|
||||
@@ -154,7 +157,7 @@
|
||||
title: this.title,
|
||||
shipment_no: this.shipment_no,
|
||||
remark: this.remark,
|
||||
pictures: JSON.stringify(this.pictures.path)
|
||||
pictures:this.pictures.path
|
||||
}
|
||||
if (data.title === '') {
|
||||
this.$refs.uToast.show({
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<view class="OrderInfo">
|
||||
<view class="OrderInfo" v-if="loaded">
|
||||
<!-- 订单状态 -->
|
||||
<view class="order-status">
|
||||
<view class="info">
|
||||
@@ -45,7 +45,7 @@
|
||||
<view class="sku">可提个数 <span>x {{account.balance}}</span> </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>
|
||||
</navigator>
|
||||
<view class="goods-type" v-if="type === '1'">运费 <span>免邮</span></view>
|
||||
@@ -147,7 +147,8 @@
|
||||
store_Name: '', // 门店名称
|
||||
qty: 1,
|
||||
showCode:false,
|
||||
showCodeImg:''
|
||||
showCodeImg:'',
|
||||
loaded:false
|
||||
};
|
||||
},
|
||||
onLoad(e) {
|
||||
@@ -176,6 +177,7 @@
|
||||
this.stores = res.stores
|
||||
this.qty = res.account.balance
|
||||
this.type = res.logistic_type + ''
|
||||
this.loaded = true
|
||||
}).catch(err => {
|
||||
this.$refs.uToast.show({
|
||||
title: err.message,
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
<span>修改头像</span>
|
||||
</view>
|
||||
<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>
|
||||
</view>
|
||||
</view>
|
||||
@@ -25,16 +25,12 @@
|
||||
<view @click="loginOut" class="list-item">
|
||||
<view class="list-item-left">
|
||||
<image src="/static/images/reset-info.png" mode="widthFix" />
|
||||
<span>切换账户</span>
|
||||
<span>退出登录</span>
|
||||
</view>
|
||||
<u-icon name="arrow-right" color="#f1f1f1" size="28"></u-icon>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 底部banner -->
|
||||
|
||||
<!-- <u-toast ref="uToast" /> -->
|
||||
<u-toast ref="uToast" />
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
@@ -81,14 +77,16 @@
|
||||
})
|
||||
},
|
||||
loginOut() {
|
||||
uni.removeStorageSync('token')
|
||||
uni.reLaunch({
|
||||
url: '/pages/login/login'
|
||||
})
|
||||
this.$store.commit('setToken', '')
|
||||
this.$Router.replaceAll({name: 'Equity'})
|
||||
},
|
||||
// 上传头像
|
||||
updImgs(type) {
|
||||
uni.chooseImage({
|
||||
crop: {
|
||||
width: 80,
|
||||
height: 80
|
||||
},
|
||||
success: res => {
|
||||
let path = res.tempFiles.map((val, index) => {
|
||||
return {
|
||||
@@ -166,7 +164,6 @@
|
||||
margin: 0 40rpx;
|
||||
padding: 30rpx 0;
|
||||
width: calc(100% - 80rpx);
|
||||
|
||||
button::after {
|
||||
border: none;
|
||||
background-color: none;
|
||||
|
||||
@@ -2,20 +2,27 @@
|
||||
<view class="content">
|
||||
<view class="codeContent">
|
||||
<image class="codeContent-back" src="../../static/icons/store_codeBack.png" mode="widthFix"></image>
|
||||
<image class="codeContent-cont" src="../../static/icons/store_contBack.png" mode="widthFix"></image>
|
||||
<view class="textContent">
|
||||
<view class="company">
|
||||
<image class="company-logo" src="../../static/dev/good_cover_00.jpg" mode="aspectFill"></image>
|
||||
<image class="company-logo" :src="companyInfo.cover" mode="aspectFill"></image>
|
||||
<view class="company-cont">
|
||||
<view class="company-name">如朗科技</view>
|
||||
<view class="company-name">邀请你加入易货平台</view>
|
||||
<view class="nowrap company-name">{{companyInfo.name}}</view>
|
||||
<view class="company-tips">易货平台</view>
|
||||
</view>
|
||||
</view>
|
||||
<image class="codeContent-code" src="../../static/dev/good_cover_03.jpg" mode="aspectFit"></image>
|
||||
<view class="code">
|
||||
<image class="code-img" :src="companyInfo.code" mode="aspectFit"></image>
|
||||
<!-- <view class="code-text">简单扫一扫,即可进入平台</view> -->
|
||||
</view>
|
||||
<!-- @click="shareCanvas" -->
|
||||
<view class="codeBnt">
|
||||
<image class="codeBnt-img" src="../../static/icons/store_down.png" mode="aspectFill"></image>
|
||||
保存图片
|
||||
扫码推广
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<canvas class="codeImg" canvas-id="qrcodeCard"></canvas>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
@@ -23,62 +30,220 @@
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
codeImg: ''
|
||||
companyInfo : ''
|
||||
}
|
||||
},
|
||||
created() {
|
||||
// companiesCode().then(res=>{
|
||||
// this.codeImg = res
|
||||
// })
|
||||
companiesCode().then(res=>{
|
||||
this.companyInfo = res
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
// 绘制图片
|
||||
shareCanvas(e){
|
||||
uni.showLoading({
|
||||
title: '加载中',
|
||||
})
|
||||
|
||||
// 下载头像
|
||||
let avatarImg = new Promise(success=>{
|
||||
uni.getImageInfo({
|
||||
src : this.companyInfo.cover,
|
||||
success : res => {
|
||||
success(res.path)
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
// 下载二维码
|
||||
let codeImg = new Promise(success => {
|
||||
uni.getImageInfo({
|
||||
src : this.companyInfo.code,
|
||||
success : res => {
|
||||
success(res.path)
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
Promise.all([avatarImg, codeImg]).then(res => {
|
||||
console.log(res[0],'0')
|
||||
console.log(res[1],'1')
|
||||
// 绘制海报
|
||||
const ctx = uni.createCanvasContext('qrcodeCard')
|
||||
ctx.save()
|
||||
|
||||
// 绘制背景图片
|
||||
ctx.drawImage('../../static/icons/store_downBack', 0, 0, 375, 603)
|
||||
|
||||
// 绘制头像
|
||||
ctx.drawImage(res[0], 0, 0, 60, 60)
|
||||
|
||||
// 绘制二维码
|
||||
ctx.drawImage(res[1], 140, 250, 110, 110)
|
||||
|
||||
// 文字
|
||||
ctx.setFontSize(16)
|
||||
ctx.fillText(this.companyInfo.name, 194, 180 , 270)
|
||||
|
||||
ctx.setFontSize(16)
|
||||
ctx.fillText('邀请你加入易货平台', 194, 180 , 270)
|
||||
|
||||
ctx.save();
|
||||
ctx.beginPath(); //开始绘制
|
||||
ctx.arc(50 / 2 + 170, 50 / 2 + 110, 50 / 2, 0, Math.PI * 2, false);
|
||||
ctx.clip();
|
||||
|
||||
// 保存图片
|
||||
ctx.draw(true, () => {
|
||||
uni.hideLoading()
|
||||
uni.canvasToTempFilePath({
|
||||
canvasId: 'qrcodeCard',
|
||||
x: 0,
|
||||
y: 0,
|
||||
success: res => {
|
||||
uni.saveImageToPhotosAlbum({
|
||||
filePath: res.tempFilePath,
|
||||
success : res=>{
|
||||
if (res.errMsg == "saveImageToPhotosAlbum:ok"){
|
||||
uni.showToast({
|
||||
title: '分享海报已保存至相册',
|
||||
icon : 'none'
|
||||
})
|
||||
}else{
|
||||
uni.hideLoading()
|
||||
}
|
||||
},
|
||||
fail : err=>{
|
||||
if (err.errMsg == "saveImageToPhotosAlbum:fail auth deny"){
|
||||
uni.showModal({
|
||||
title : '提示',
|
||||
content : '暂未授权小程序写入您的相册,无法存储二维码海报',
|
||||
confirmColor: '#d82526',
|
||||
confirmText : '去设置',
|
||||
success : res=>{
|
||||
if (res.confirm){
|
||||
uni.openSetting()
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
}).catch(err=>{
|
||||
uni.showToast({
|
||||
title: '海报下载,请检查网络',
|
||||
icon : 'none'
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.content {
|
||||
background-color: #e1293f;
|
||||
background-color: #e93340;
|
||||
height: 100vh;
|
||||
width: 100vw;
|
||||
padding: 80rpx;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.codeContent {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
height: 100vh;
|
||||
.codeContent-back {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
z-index: 1;
|
||||
position: absolute;
|
||||
box-shadow: 0 0 20rpx rgba(115,0,4,.3);
|
||||
}
|
||||
.codeContent-cont {
|
||||
left: 5%;
|
||||
width: 90%;
|
||||
top: 100px;
|
||||
z-index: 2;
|
||||
position: absolute;
|
||||
}
|
||||
.codeContent-tips {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 20rpx;
|
||||
width: 200rpx;
|
||||
z-index: 2;
|
||||
}
|
||||
.textContent {
|
||||
position: absolute;
|
||||
padding: 20rpx 20rpx 0 40rpx;
|
||||
box-sizing: border-box;
|
||||
width: 70%;
|
||||
z-index: 3;
|
||||
left: 15%;
|
||||
right: 15%;
|
||||
top: 140px;
|
||||
}
|
||||
.company {
|
||||
width: 100%;
|
||||
.company-logo {
|
||||
width: 120rpx;
|
||||
height: 120rpx;
|
||||
border-radius: 50%;
|
||||
}
|
||||
.company-cont {
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
height: 230rpx;
|
||||
left: 0;
|
||||
top: 0;
|
||||
padding: 20rpx 20rpx 30rpx 210rpx;
|
||||
font-size: $title-size;
|
||||
.company-name {
|
||||
font-weight: 600;
|
||||
margin: 10rpx 0;
|
||||
}
|
||||
.company-tips {
|
||||
font-size: 26rpx;
|
||||
color: #787878;
|
||||
}
|
||||
}
|
||||
}
|
||||
.code {
|
||||
text-align: center;
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
margin-bottom: $margin;
|
||||
.code-img {
|
||||
width: 90%;
|
||||
}
|
||||
.code-text {
|
||||
color: #787878;
|
||||
margin-top: $margin - 10;
|
||||
font-size: $title-size;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.codeBnt {
|
||||
background-color: #FFFFFF;
|
||||
background-color: #e1293f;
|
||||
text-align: center;
|
||||
border-radius: 10rpx;
|
||||
line-height: 90rpx;
|
||||
font-weight: 600;
|
||||
font-size: $title-size;
|
||||
color: #e1293f;
|
||||
margin-top: 160rpx;
|
||||
color: #FFFFFF;
|
||||
box-shadow: 4rpx 0 10rpx rgba(155,0,19,.5);
|
||||
position: relative;
|
||||
.codeBnt-img {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
width: 60rpx;
|
||||
height: 60rpx;
|
||||
left: 24%;
|
||||
}
|
||||
|
||||
/* canvas */
|
||||
.codeImg {
|
||||
position: absolute;
|
||||
left: -1000%;
|
||||
height: 603px;
|
||||
width: 375px;
|
||||
background: white;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -258,6 +258,7 @@
|
||||
},
|
||||
// 添加展示模块
|
||||
addModule(){
|
||||
console.log('添加模板,,,,')
|
||||
let modulesList = this.modulesType.map(val => {
|
||||
return val.value
|
||||
})
|
||||
@@ -407,6 +408,8 @@
|
||||
color: $text-price;
|
||||
background: white;
|
||||
margin-top: $margin;
|
||||
position: relative;
|
||||
z-index: 10;
|
||||
.icon{
|
||||
vertical-align: middle;
|
||||
margin-right: $margin/3;
|
||||
|
||||
@@ -8,14 +8,19 @@
|
||||
</view>
|
||||
<!-- 统计信息 -->
|
||||
<view class="statistics">
|
||||
<view class="statistics-flex">
|
||||
<picker mode="date" :fields="tabsIndex" :value="dateValue" :end="endDate" @change="pickerDate">
|
||||
<view class="statistics-date">
|
||||
{{dateValue}}<uni-icons class="arrowdown" type="arrowdown" color="#555"></uni-icons>
|
||||
</view>
|
||||
</picker>
|
||||
<view class="statistics-lay" :class="{ 'show' : sort != '' || payType != '' || channel != ''}" @click="onScreening">
|
||||
筛选 <uni-icons class="arrowdown" type="settings" color="gray"></uni-icons>
|
||||
</view>
|
||||
</view>
|
||||
<view class="statistics-text">
|
||||
<text>成交客户量 {{visitor.day}} 人</text>
|
||||
<text>累计访客量 {{visitor.all}} 人</text>
|
||||
<text>成交产品数量 {{visitor.goods_count}} 人</text>
|
||||
<text>成交产品金额 {{visitor.total}} 元</text>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 数据列表 -->
|
||||
@@ -24,12 +29,18 @@
|
||||
<view class="item" v-for="(item, index) in orders" :key="index">
|
||||
<image class="cover" :src="item.user.avatar" mode="aspectFill"></image>
|
||||
<view class="title nowrap">
|
||||
{{item.user.username}}
|
||||
<view class="type">{{item.state}}</view>
|
||||
{{item.user.nickname}}
|
||||
<view class="type">{{item.amount}}</view>
|
||||
</view>
|
||||
<view class="sub-title nowrap">订单号: {{item.order_no}}</view>
|
||||
<view class="sub-title nowrap">{{item.created_at}}</view>
|
||||
<view class="sub-title nowrap">订单号码: {{item.order_no}}</view>
|
||||
<view class="sub-title nowrap">订单时间: {{item.created_at}}</view>
|
||||
<view class="sub-tabs">
|
||||
<text>{{item.driver}}</text>
|
||||
<text>{{item.channel}}</text>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 分页 -->
|
||||
<uni-load-more :status="pageStatus" :iconSize="16"></uni-load-more>
|
||||
</block>
|
||||
<block v-else>
|
||||
<view class="list-null">
|
||||
@@ -38,24 +49,57 @@
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
<!-- 列表筛选 -->
|
||||
<uni-popup ref="settingsPopup" background-color="#FFFFFF" @maskClick="onReset">
|
||||
<view class="popup-content">
|
||||
<view class="title">排序方式</view>
|
||||
<view class="popup-choose-flex">
|
||||
<view class="item" :class="{'show' : sort == 'money_asc'}" @click="sort = 'money_asc'">金额从低到高</view>
|
||||
<view class="item" :class="{'show' : sort == 'money_desc'}" @click="sort = 'money_desc'">金额从高到低</view>
|
||||
<view class="item" :class="{'show' : sort == 'sold_asc'}" @click="sort = 'sold_asc'">销量从低到高</view>
|
||||
<view class="item" :class="{'show' : sort == 'sold_desc'}" @click="sort = 'sold_desc'">销量从高到低</view>
|
||||
</view>
|
||||
<view class="title">支付方式</view>
|
||||
<view class="popup-choose-flex">
|
||||
<view class="item" :class="{'show' : payType == 'eb'}" @click="payType = 'eb'">易币交易</view>
|
||||
<view class="item" :class="{'show' : payType == 'money'}" @click="payType = 'money'">现金交易</view>
|
||||
</view>
|
||||
<view class="title">成交渠道</view>
|
||||
<view class="popup-choose-flex">
|
||||
<view class="item" :class="{'show' : channel == 'app'}" @click="channel = 'app'">APP</view>
|
||||
<view class="item" :class="{'show' : channel == 'mini'}" @click="channel = 'mini'">自媒体</view>
|
||||
</view>
|
||||
<view class="popup-btns">
|
||||
<view class="item" @click="onReset">重置</view>
|
||||
<view class="item" @click="onSettings">确定</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="ios-bottom"></view>
|
||||
</uni-popup>
|
||||
<!-- :status="more" -->
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import getDate from '@/public/date'
|
||||
import { customer } from '@/apis/interfaces/store'
|
||||
import { orderUsers } from '@/apis/interfaces/store'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
tabsIndex: 'day',
|
||||
dateValue: '',
|
||||
tabsIndex : 'day',
|
||||
dateValue : '',
|
||||
endDate : '',
|
||||
visitor : {
|
||||
day: 0,
|
||||
all: 0
|
||||
},
|
||||
orders : [],
|
||||
pages : {}
|
||||
sort : '',
|
||||
payType : '',
|
||||
channel : '',
|
||||
// 分页
|
||||
pageStatus : '',
|
||||
page : 1
|
||||
};
|
||||
},
|
||||
created() {
|
||||
@@ -68,28 +112,49 @@
|
||||
methods:{
|
||||
// tabs筛选
|
||||
onTbas(type){
|
||||
console.log(type)
|
||||
getDate(type).then(res => {
|
||||
this.tabsIndex = type
|
||||
this.dateValue = res
|
||||
this.page = 1
|
||||
this.getLists()
|
||||
})
|
||||
},
|
||||
onReset(){
|
||||
this.sort = ''
|
||||
this.payType = ''
|
||||
this.channel = ''
|
||||
},
|
||||
onSettings(){
|
||||
this.getLists()
|
||||
this.$refs.settingsPopup.close()
|
||||
},
|
||||
// 日期筛选
|
||||
pickerDate(e){
|
||||
let dateValue = e.detail.value
|
||||
this.dateValue = dateValue
|
||||
this.getLists()
|
||||
},
|
||||
// 列表筛选
|
||||
onScreening(){
|
||||
this.$refs.settingsPopup.open('bottom')
|
||||
},
|
||||
// 获取列表
|
||||
getLists(){
|
||||
customer({
|
||||
type: this.tabsIndex,
|
||||
date: this.dateValue
|
||||
orderUsers({
|
||||
type : this.tabsIndex,
|
||||
date : this.dateValue,
|
||||
sort : this.sort,
|
||||
pay_type : this.payType,
|
||||
channel : this.channel,
|
||||
page : this.page
|
||||
}).then(res => {
|
||||
if(res.orders.page.current === 1){
|
||||
this.orders = []
|
||||
}
|
||||
this.visitor = res.visitor
|
||||
this.orders = res.orders.data
|
||||
this.pages = res.orders.page
|
||||
this.orders = this.orders.concat(res.orders.data)
|
||||
this.page = res.orders.page.current
|
||||
this.pageStatus = res.orders.page.has_more ? 'more': 'noMore'
|
||||
}).catch(err => {
|
||||
uni.showToast({
|
||||
title: err,
|
||||
@@ -97,11 +162,68 @@
|
||||
})
|
||||
})
|
||||
}
|
||||
},
|
||||
onReachBottom() {
|
||||
if(this.pageStatus == 'more'){
|
||||
this.pageStatus = 'loading'
|
||||
this.page += 1
|
||||
this.getLists()
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
// 筛选层
|
||||
.popup-content{
|
||||
padding: $padding * 2;
|
||||
.title{
|
||||
font-weight: bold;
|
||||
font-size: $title-size;
|
||||
color: $text-color;
|
||||
margin-top: $margin;
|
||||
}
|
||||
.popup-choose-flex{
|
||||
padding: $padding /2 0;
|
||||
margin: 0 -($margin - 20rpx);
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
.item{
|
||||
width: calc(33.33% - #{$margin - 10});
|
||||
font-size: $title-size-sm;
|
||||
text-align: center;
|
||||
background: $border-color-lg;
|
||||
line-height: 68rpx;
|
||||
margin: $margin - 20;
|
||||
color: $text-gray;
|
||||
border:solid 1rpx $border-color-lg;
|
||||
box-sizing: border-box;
|
||||
&.show{
|
||||
border:solid 1rpx $text-price;
|
||||
color: $text-price;
|
||||
}
|
||||
}
|
||||
}
|
||||
.popup-btns{
|
||||
padding-top: $padding*2;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
margin: 0 -$margin/2;
|
||||
.item{
|
||||
margin: $margin/2;
|
||||
color: $text-price;
|
||||
background: rgba($color: $text-price, $alpha: .1);
|
||||
width: calc(50% - #{$margin});
|
||||
height: 80rpx;
|
||||
line-height: 80rpx;
|
||||
text-align: center;
|
||||
&:last-child{
|
||||
background-color: $text-price;
|
||||
color: white;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// 空提示
|
||||
.list-null{
|
||||
width: 100vw;
|
||||
@@ -145,6 +267,9 @@
|
||||
background-color: white;
|
||||
border-bottom: solid 1rpx $border-color;
|
||||
padding: $padding;
|
||||
.statistics-flex{
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
.statistics-date{
|
||||
font-size: $title-size + 4;
|
||||
font-weight: bold;
|
||||
@@ -153,6 +278,19 @@
|
||||
margin-left: $margin/2;
|
||||
}
|
||||
}
|
||||
.statistics-lay{
|
||||
font-size: $title-size-sm;;
|
||||
color: gray;
|
||||
line-height: 50rpx;
|
||||
&.show{
|
||||
color: $text-price;
|
||||
}
|
||||
.arrowdown{
|
||||
margin-left: $margin/2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.statistics-text{
|
||||
font-size: $title-size-sm;
|
||||
color: gray;
|
||||
@@ -212,6 +350,16 @@
|
||||
font-size: $title-size-sm;
|
||||
color: $text-gray;
|
||||
}
|
||||
.sub-tabs{
|
||||
padding-top: $padding/2;
|
||||
font-size: $title-size-sm;
|
||||
text{
|
||||
margin-right: $margin - 10;
|
||||
background: $border-color-lg;
|
||||
color: $text-gray;
|
||||
padding: 0 ($padding/2);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
162
pages/store/deliver.vue
Normal file
162
pages/store/deliver.vue
Normal file
@@ -0,0 +1,162 @@
|
||||
<template>
|
||||
<view>
|
||||
<!-- 订单分类 -->
|
||||
<scroll-view class="nav" scroll-x="true" scroll-with-animation="true">
|
||||
<view :class="['nav-item', selectNavId === item.state ? 'nav-item-selected':'']" v-for="(item,index) in navList" :key="index" @click="selectNav(item.state)">
|
||||
{{item.name}}
|
||||
</view>
|
||||
</scroll-view>
|
||||
|
||||
<!-- 订单列表 -->
|
||||
<store-order :list="returnInfo" listType="deliver" />
|
||||
|
||||
<!-- 分页 -->
|
||||
<uni-load-more :status="pageStatus" :iconSize="16" v-if="returnInfo.length > 0"></uni-load-more>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { storeDeliver } from '@/apis/interfaces/store'
|
||||
import storeOrder from '@/components/store-order/store-order'
|
||||
export default {
|
||||
comments:{
|
||||
storeOrder
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
returnInfo : [] ,// 列表
|
||||
navList : [{
|
||||
name : '待发货',
|
||||
state : '1'
|
||||
},{
|
||||
name : '已发货',
|
||||
state : '2'
|
||||
},{
|
||||
name : '待提货',
|
||||
state : '3'
|
||||
},{
|
||||
name : '已提货',
|
||||
state : '4'
|
||||
}
|
||||
],
|
||||
selectNavId : '1',
|
||||
|
||||
// 分页
|
||||
pageStatus : '',
|
||||
page : 1
|
||||
}
|
||||
},
|
||||
created() {
|
||||
},
|
||||
onShow() {
|
||||
// 获取退货单列表
|
||||
this.returnData();
|
||||
},
|
||||
methods: {
|
||||
// 退货单列表
|
||||
returnData(){
|
||||
storeDeliver({
|
||||
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'
|
||||
})
|
||||
},
|
||||
|
||||
// 选择订单
|
||||
selectNav(id) {
|
||||
if (this.selectNavId !== id) {
|
||||
this.selectNavId = id
|
||||
this.returnData()
|
||||
}
|
||||
},
|
||||
|
||||
// 我要发货
|
||||
goSend(orderNo) {
|
||||
console.log(orderNo)
|
||||
return
|
||||
uni.showModal({
|
||||
title: '是否签收此订单?',
|
||||
success: res => {
|
||||
if(res.confirm) {
|
||||
storeSign(orderNo).then(() => {
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
title: '签收成功'
|
||||
})
|
||||
setTimeout(()=>{
|
||||
this.returnData()
|
||||
},3000)
|
||||
}).catch(err => {
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
title: err.message
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
// 下拉加载
|
||||
onReachBottom() {
|
||||
if(this.pageStatus == 'more'){
|
||||
this.pageStatus = 'loading'
|
||||
if(this.selectNavId === '1') {
|
||||
this.goodsPage += 1
|
||||
// 获取退货单列表
|
||||
this.returnData();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
// 订单nav
|
||||
.nav {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
justify-content: flex-start;
|
||||
box-sizing: border-box;
|
||||
white-space: nowrap;
|
||||
font-size: $title-size*0.95;
|
||||
padding: 0 30rpx;
|
||||
background-color: #fff;
|
||||
color: #666;
|
||||
position: sticky;
|
||||
top: 0rpx;
|
||||
z-index: 1;
|
||||
.nav-item {
|
||||
width: 25%;
|
||||
text-align: center;
|
||||
display: inline-block;
|
||||
border-bottom: solid 4rpx #fff;
|
||||
padding: 30rpx 0;
|
||||
}
|
||||
.nav-item-selected {
|
||||
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>
|
||||
166
pages/store/deliverForm.vue
Normal file
166
pages/store/deliverForm.vue
Normal file
@@ -0,0 +1,166 @@
|
||||
<template>
|
||||
<view>
|
||||
<form @submit="sendSubmit">
|
||||
<view class="nickname">
|
||||
<view class="examineTitle">
|
||||
选择发货方式
|
||||
</view>
|
||||
<view class="toExamine" v-if="send.sendWay[send.sendIndex]">
|
||||
<picker mode="selector" :value="send.sendIndex" range-key="name" :range="send.sendWay" @change="wayChange">
|
||||
<view>{{send.sendWay[send.sendIndex].name}}</view>
|
||||
</picker>
|
||||
<image class="toExamine-row" src="../../static/icons/goods_row.png" mode="aspectFill"></image>
|
||||
</view>
|
||||
</view>
|
||||
<view class="nickname" v-if="send.sendIndex == 0">
|
||||
<view class="examineTitle">
|
||||
选择物流公司
|
||||
</view>
|
||||
<view class="toExamine" v-if="state.array[state.index]">
|
||||
<picker mode="selector" :value="state.index" range-key="name" :range="state.array" @change="sexChange">
|
||||
<view>{{state.array[state.index].name}}</view>
|
||||
</picker>
|
||||
<image class="toExamine-row" src="../../static/icons/goods_row.png" mode="aspectFill"></image>
|
||||
</view>
|
||||
</view>
|
||||
<view class="nickname" v-if="send.sendIndex == 0">
|
||||
<view class="examineTitle">
|
||||
填写物流单号
|
||||
</view>
|
||||
<input class="remarks" @blur="bindExpressNo" auto-height placeholder="" />
|
||||
</view>
|
||||
|
||||
<!-- 选择其他方式显示 -->
|
||||
<view class="nickname" v-if="send.sendIndex == 1">
|
||||
<view class="examineTitle">
|
||||
送货人姓名
|
||||
</view>
|
||||
<input class="remarks" name="courier_name" auto-height placeholder="" />
|
||||
</view>
|
||||
<view class="nickname" v-if="send.sendIndex == 1">
|
||||
<view class="examineTitle">
|
||||
送货人联系方式
|
||||
</view>
|
||||
<input class="remarks" name="courier_mobile" auto-height placeholder="" />
|
||||
</view>
|
||||
<button class="submit" form-type="submit" type="default">提交</button>
|
||||
</form>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { deliverFront, deliverForm } from '@/apis/interfaces/store'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
send : {
|
||||
sendWay : [{
|
||||
id : 'post',
|
||||
name : '邮寄'
|
||||
},{
|
||||
id : 'other',
|
||||
name : '其他'
|
||||
}],
|
||||
sendIndex : 0,
|
||||
},
|
||||
state : {
|
||||
// 快递筛选
|
||||
array : [],
|
||||
// 快递筛选默认下标
|
||||
index : 0,
|
||||
},
|
||||
expressNo : '',
|
||||
courierName : '',
|
||||
courierMobile : ''
|
||||
}
|
||||
},
|
||||
created() {
|
||||
deliverFront(this.$Route.query.id).then(res=>{
|
||||
this.state.array = res
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
// 选择发货方式
|
||||
wayChange(e) {
|
||||
this.send.sendIndex = e.detail.value
|
||||
this.expressNo = ''
|
||||
this.courierName = ''
|
||||
this.courierMobile = ''
|
||||
},
|
||||
|
||||
// 筛选
|
||||
sexChange(e) {
|
||||
this.state.index = e.detail.value
|
||||
},
|
||||
|
||||
// 物流单号
|
||||
bindExpressNo(val) {
|
||||
this.expressNo = val.detail.value
|
||||
},
|
||||
|
||||
// 送货人姓名
|
||||
bindCourierName(val) {
|
||||
this.courierName = val.detail.value
|
||||
},
|
||||
|
||||
// 送货人联系方式
|
||||
bindCourierMobile(val) {
|
||||
this.courierMobile = val.detail.value
|
||||
},
|
||||
|
||||
// 提交表单
|
||||
sendSubmit() {
|
||||
deliverForm(this.$Route.query.id,{
|
||||
type : this.send.sendWay[this.send.sendIndex].id || '',
|
||||
express_id : this.state.array[this.state.index].id || '',
|
||||
express_no : this.expressNo || '',
|
||||
courier_name : this.courierName || '',
|
||||
courier_mobile : this.courierMobile || ''
|
||||
}).then(res=>{
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
title: '发送成功'
|
||||
})
|
||||
this.$Router.back()
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.nickname {
|
||||
background-color: #FFFFFF;
|
||||
padding: $padding;
|
||||
margin-bottom: $margin;
|
||||
display: flex;
|
||||
position: relative;
|
||||
font-size: $title-size-lg;
|
||||
.examineTitle {
|
||||
width: 210rpx;
|
||||
}
|
||||
.remarks {
|
||||
width: calc(100% - 210rpx);
|
||||
font-size: $title-size-lg;
|
||||
color: $text-color;
|
||||
}
|
||||
.toExamine {
|
||||
position: absolute;
|
||||
top: $padding;
|
||||
right: $padding;
|
||||
display: flex;
|
||||
.toExamine-row {
|
||||
width: 32rpx;
|
||||
height: 32rpx;
|
||||
margin-top: 6rpx;
|
||||
filter: grayscale(100%);
|
||||
}
|
||||
}
|
||||
}
|
||||
.submit {
|
||||
background: #e93340;
|
||||
color: white;
|
||||
border-color: #e93340;
|
||||
margin: $margin*4 $margin 0;
|
||||
}
|
||||
</style>
|
||||
114
pages/store/examine.vue
Normal file
114
pages/store/examine.vue
Normal file
@@ -0,0 +1,114 @@
|
||||
<template>
|
||||
<view>
|
||||
<form @submit="sendSubmit">
|
||||
<view class="nickname">
|
||||
<view class="examineTitle">
|
||||
退换单操作
|
||||
</view>
|
||||
<view class="toExamine">
|
||||
<picker mode="selector" :value="state.index" range-key="name" :range="state.array" @change="sexChange">
|
||||
<view>{{state.array[state.index].name}}</view>
|
||||
</picker>
|
||||
<image class="toExamine-row" src="../../static/icons/goods_row.png" mode="aspectFill"></image>
|
||||
</view>
|
||||
</view>
|
||||
<view class="nickname">
|
||||
<view class="examineTitle">
|
||||
退换单备注:
|
||||
</view>
|
||||
<textarea class="remarks" @blur="bindTextAreaBlur" auto-height placeholder="请填写备注" />
|
||||
</view>
|
||||
|
||||
<button class="submit" form-type="submit" type="default">提交</button>
|
||||
</form>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { storeAudit } from '@/apis/interfaces/store'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
state : {
|
||||
// 退货单-筛选
|
||||
array : [{
|
||||
id : 'agree',
|
||||
name: '审核通过'
|
||||
},{
|
||||
id : 'refuse',
|
||||
name: '审核驳回'
|
||||
}],
|
||||
|
||||
// 退货单筛选默认下标
|
||||
index : 0,
|
||||
},
|
||||
remarks : ''
|
||||
}
|
||||
},
|
||||
created() {
|
||||
|
||||
},
|
||||
methods: {
|
||||
bindTextAreaBlur(val) {
|
||||
this.remarks = val.detail.value
|
||||
},
|
||||
|
||||
// 筛选
|
||||
sexChange(e) {
|
||||
this.state.index = e.detail.value
|
||||
},
|
||||
|
||||
sendSubmit(){
|
||||
let newState = this.state.array[this.state.index].id,
|
||||
newRemark = this.remarks
|
||||
storeAudit(this.$Route.query.id, {
|
||||
state : newState,
|
||||
remark: newRemark
|
||||
}).then(res=>{
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
title: '审核成功'
|
||||
})
|
||||
this.$Router.back()
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.nickname {
|
||||
background-color: #FFFFFF;
|
||||
padding: $padding;
|
||||
margin-bottom: $margin;
|
||||
display: flex;
|
||||
position: relative;
|
||||
font-size: $title-size-lg;
|
||||
.examineTitle {
|
||||
width: 210rpx;
|
||||
}
|
||||
.remarks {
|
||||
width: calc(100% - 210rpx);
|
||||
font-size: $title-size-lg;
|
||||
color: $text-color;
|
||||
}
|
||||
.toExamine {
|
||||
position: absolute;
|
||||
top: $padding;
|
||||
right: $padding;
|
||||
display: flex;
|
||||
.toExamine-row {
|
||||
width: 32rpx;
|
||||
height: 32rpx;
|
||||
margin-top: 6rpx;
|
||||
filter: grayscale(100%);
|
||||
}
|
||||
}
|
||||
}
|
||||
.submit {
|
||||
background: #e93340;
|
||||
color: white;
|
||||
border-color: #e93340;
|
||||
margin: $margin*4 $margin 0;
|
||||
}
|
||||
</style>
|
||||
@@ -12,6 +12,11 @@
|
||||
<view class="sub-title">{{appliesState.message}}</view>
|
||||
<button type="default" @click="onRightBtn">认证并开通</button>
|
||||
</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">
|
||||
<image class="icon" src="@/static/icons/approve-icon.png" mode="widthFix"></image>
|
||||
<view class="title">认证失败</view>
|
||||
@@ -29,7 +34,7 @@
|
||||
<view class="statusBar-box">
|
||||
<image class="logo" :src="company.logo" mode="aspectFill"></image>
|
||||
<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="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>
|
||||
@@ -82,14 +87,6 @@
|
||||
},
|
||||
onShow(){
|
||||
this.getIndex()
|
||||
// 获取员工管理列表
|
||||
if(this.$store.state.token != ''){
|
||||
if(!this.employee) {
|
||||
employeesTool().then(res=>{
|
||||
this.toolList = res.permission
|
||||
})
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 首页数据
|
||||
@@ -111,14 +108,23 @@
|
||||
faith : res.integrity
|
||||
}
|
||||
this.workbench = {
|
||||
identity: res.identity_time,
|
||||
grade : res.identity_sign,
|
||||
top : res.top,
|
||||
middle : res.middle,
|
||||
order : res.order
|
||||
}
|
||||
this.employee = res.is_employee
|
||||
this.loding = false
|
||||
|
||||
// 若为员工身份-则调取员工管理信息
|
||||
if(res.is_employee) {
|
||||
employeesTool().then(res=>{
|
||||
this.toolList = res.permission
|
||||
})
|
||||
}
|
||||
|
||||
}).catch(err =>{
|
||||
console.log(err)
|
||||
uni.showToast({
|
||||
title: err.message,
|
||||
icon : 'none'
|
||||
@@ -128,7 +134,6 @@
|
||||
// 查询企业认证状态
|
||||
getAppliesQuery(){
|
||||
appliesQuery().then(res=>{
|
||||
console.log(res)
|
||||
this.appliesState = res
|
||||
this.loding = false
|
||||
}).catch(err => {
|
||||
@@ -166,6 +171,10 @@
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
// 跳转到创建企业选择企业类型的页面
|
||||
onRightBtn1(){
|
||||
this.$Router.push({name: 'Registered'})
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -215,7 +224,7 @@
|
||||
.statusBar-box{
|
||||
min-height: 90rpx;
|
||||
position: relative;
|
||||
padding: $padding ($padding + 200) $padding ($padding + 88);
|
||||
padding: $padding $padding $padding ($padding + 88);
|
||||
color: white;
|
||||
.logo{
|
||||
position: absolute;
|
||||
@@ -226,14 +235,16 @@
|
||||
border: 4rpx solid #ed8483;
|
||||
box-sizing: border-box;
|
||||
box-shadow: 0 4rpx 15rpx rgba(109,1,0,.8);
|
||||
background-color: #fff;
|
||||
}
|
||||
.company{
|
||||
margin-left: 30rpx;
|
||||
width: calc(100% - 94rpx);
|
||||
padding-left: 30rpx;
|
||||
box-sizing: border-box;
|
||||
.name{
|
||||
line-height: 40rpx;
|
||||
@extend .nowrap;
|
||||
font-size: $title-size;
|
||||
display: flex;
|
||||
.name-img {
|
||||
width: 30rpx;
|
||||
height: 30rpx;
|
||||
|
||||
83
pages/store/journal.vue
Normal file
83
pages/store/journal.vue
Normal file
@@ -0,0 +1,83 @@
|
||||
<template>
|
||||
<view>
|
||||
<view class="logsBack">
|
||||
<view class="logsList" v-for="(item ,index) in logArr" :key="index">
|
||||
<view class="logsLabel">
|
||||
<view class="logsLabel-name">操作来源:</view>
|
||||
<view class="logsTips" :class="[item.isMy ? 'active' : '']">{{ item.isMy ? '个人' : '商家' }}</view>
|
||||
</view>
|
||||
<view class="logsLabel" v-if="item.title">
|
||||
<view class="logsLabel-name">申请原因:</view>
|
||||
<view class="logsLabel-text">{{ item.title }}</view>
|
||||
</view>
|
||||
<view class="logsLabel" v-if="item.state_text">
|
||||
<view class="logsLabel-name">申请状态:</view>
|
||||
<view class="logsLabel-text">{{ item.state_text }}</view>
|
||||
</view>
|
||||
<view class="logsLabel" v-if="item.remark">
|
||||
<view class="logsLabel-name">补充描述:</view>
|
||||
<view class="logsLabel-text">{{ item.remark }}</view>
|
||||
</view>
|
||||
<view class="logsLabel">
|
||||
<view class="logsLabel-name">退款时间:</view>
|
||||
<view class="logsLabel-text">{{ item.created_at }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { orderJournal } from '@/apis/interfaces/store'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
logArr : '', //订单数组列表
|
||||
}
|
||||
},
|
||||
created() {
|
||||
orderJournal(this.$Route.query.id).then(res=>{
|
||||
this.logArr = res
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.logsBack {
|
||||
background: #f7f7f7;
|
||||
padding: $padding;
|
||||
box-sizing: border-box;
|
||||
font-size: $title-size-sm;
|
||||
.logsList {
|
||||
background: #fff;
|
||||
padding: $padding;
|
||||
box-sizing: border-box;
|
||||
border-radius: 10rpx;
|
||||
margin-bottom: $margin;
|
||||
position: relative;
|
||||
}
|
||||
.logsTips {
|
||||
color: #e1293f;
|
||||
&.active {
|
||||
color: #e1293f;
|
||||
}
|
||||
}
|
||||
.logsLabel {
|
||||
padding: $padding 0;
|
||||
overflow: hidden;
|
||||
display: flex;
|
||||
.logsLabel-name {
|
||||
margin-right: $margin;
|
||||
width: 140rpx;
|
||||
}
|
||||
.logsLabel-text {
|
||||
color: $text-gray;
|
||||
width: calc(100% - 140rpx - #{$margin});
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
161
pages/store/logistic.vue
Normal file
161
pages/store/logistic.vue
Normal file
@@ -0,0 +1,161 @@
|
||||
<template>
|
||||
<view>
|
||||
<!-- 物流状态 start -->
|
||||
<view class="state" v-if="logistic.length > 0">
|
||||
<view class="take">
|
||||
<view class="take-tips">
|
||||
收
|
||||
</view>
|
||||
<view class="take-text">
|
||||
收货地址:发接口返回绝对是放假客户端上看见发货数据库大黄蜂教科书的浩丰科技
|
||||
</view>
|
||||
</view>
|
||||
<view class="list">
|
||||
<!-- v-for="(item, index) in logistic" :key="index" -->
|
||||
<view class="list-label">
|
||||
<view class="list-name">
|
||||
<text>发货中</text> 2020-15-12
|
||||
</view>
|
||||
<view class="list-time">
|
||||
华东师范邯郸市科技发货圣诞节客服
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="pack-center" v-else>
|
||||
<image src="../../static/icons/store_logistic.png" mode="aspectFill"></image>
|
||||
<view>{{message}} </view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { deliverLogistic } from '@/apis/interfaces/store'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
message : '',
|
||||
logistic: ''
|
||||
}
|
||||
},
|
||||
created() {
|
||||
deliverLogistic(this.$Route.query.id).then(res=>{
|
||||
console.log(res)
|
||||
}).catch(err => {
|
||||
this.message = err.message
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
page {
|
||||
background-color: #f6f6f6;
|
||||
}
|
||||
|
||||
// 物流状态
|
||||
.state {
|
||||
background-color: $uni-bg-color;
|
||||
margin-top: $margin;
|
||||
padding: $padding;
|
||||
font-size: $title-size-m;
|
||||
color: $text-gray;
|
||||
.take {
|
||||
display: flex;
|
||||
padding-bottom: $padding;
|
||||
position: relative;
|
||||
&::before {
|
||||
position: absolute;
|
||||
content: '';
|
||||
left: $uni-img-size-sm / 3 + 2;
|
||||
top: $margin;
|
||||
background-color: $uni-text-color-grey;
|
||||
width: 2rpx;
|
||||
height: 100%;
|
||||
}
|
||||
.take-tips {
|
||||
background-color: #e53d4c;
|
||||
width: $uni-img-size-sm;
|
||||
height: $uni-img-size-sm;
|
||||
border-radius: $uni-border-radius-circle;
|
||||
font-size: $title-size-sm;
|
||||
transform: scale(.9);
|
||||
text-align: center;
|
||||
color: $uni-text-color-inverse;
|
||||
margin-top: 10rpx;
|
||||
margin-left: -4rpx;
|
||||
}
|
||||
.take-text {
|
||||
margin-left: $margin;
|
||||
line-height: 40rpx;
|
||||
margin-top: $margin - 10;
|
||||
width: calc(100% - #{$uni-img-size-sm} + #{$margin});
|
||||
}
|
||||
}
|
||||
.list {
|
||||
font-size: $title-size-sm;
|
||||
.list-label {
|
||||
padding-left: $padding * 3;
|
||||
padding-bottom: $padding;
|
||||
padding-top: $padding - 10;
|
||||
position: relative;
|
||||
&::after {
|
||||
position: absolute;
|
||||
content: '';
|
||||
left: $uni-img-size-sm / 3 - 4;
|
||||
top: $margin;
|
||||
background-color: $uni-text-color-grey;
|
||||
width: $uni-img-size-sm / 3;
|
||||
height: $uni-img-size-sm / 3;
|
||||
border-radius: $uni-border-radius-circle;
|
||||
z-index: 9;
|
||||
}
|
||||
&::before {
|
||||
position: absolute;
|
||||
content: '';
|
||||
left: $uni-img-size-sm / 3 + 2;
|
||||
top: $margin;
|
||||
background-color: $uni-text-color-grey;
|
||||
width: 2rpx;
|
||||
height: 100%;
|
||||
}
|
||||
&:first-child {
|
||||
color: #e53d4c;
|
||||
}
|
||||
&:last-child::before {
|
||||
background-color: $uni-bg-color;
|
||||
}
|
||||
&:first-child::after {
|
||||
background-color: #e53d4c;
|
||||
}
|
||||
.list-name {
|
||||
margin-bottom: $margin - 10;
|
||||
text {
|
||||
font-weight: 600;
|
||||
padding-right: $padding;
|
||||
}
|
||||
}
|
||||
.list-time {
|
||||
font-size: $uni-font-size-sm;
|
||||
line-height: 34rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 暂无订单
|
||||
.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;
|
||||
margin: 0 auto $margin;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
38
pages/store/orderDetails.vue
Normal file
38
pages/store/orderDetails.vue
Normal file
@@ -0,0 +1,38 @@
|
||||
<template>
|
||||
<view>
|
||||
<!-- 订单详情 -->
|
||||
<store-order-details :info="info" :listType="newType" />
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { deliverDetails, orderDetails } from '@/apis/interfaces/store'
|
||||
import storeOrderDet from '@/components/store-order-details/store-order-details'
|
||||
export default {
|
||||
comments:{
|
||||
storeOrderDet
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
info : '',
|
||||
newType : ''
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.newType = this.$Route.query.type
|
||||
if(this.$Route.query.type == 'deliver') {
|
||||
deliverDetails(this.$Route.query.id).then(res=>{
|
||||
this.info = res
|
||||
})
|
||||
return
|
||||
}
|
||||
orderDetails(this.$Route.query.id).then(res=>{
|
||||
this.info = res
|
||||
})
|
||||
|
||||
},
|
||||
methods: {}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped></style>
|
||||
196
pages/store/return.vue
Normal file
196
pages/store/return.vue
Normal file
@@ -0,0 +1,196 @@
|
||||
<template>
|
||||
<view>
|
||||
<!-- 订单分类 -->
|
||||
<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)">
|
||||
{{item.name}}
|
||||
</view>
|
||||
</scroll-view>
|
||||
|
||||
<!-- 订单列表 -->
|
||||
<store-order :list="returnInfo" @goSign="goSign" @goReToken="goReToken" />
|
||||
|
||||
<!-- 分页 -->
|
||||
<uni-load-more :status="pageStatus" :iconSize="16" v-if="returnInfo.length > 0"></uni-load-more>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
storeReturn,
|
||||
storeSign,
|
||||
storeToken
|
||||
} from '@/apis/interfaces/store'
|
||||
import storeOrder from '@/components/store-order/store-order'
|
||||
export default {
|
||||
comments: {
|
||||
storeOrder
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
returnInfo: [], // 列表
|
||||
navList: [{
|
||||
name: '待审核',
|
||||
id: 'apply'
|
||||
}, {
|
||||
name: '已驳回',
|
||||
id: 'refuse'
|
||||
}, {
|
||||
name: '待返货',
|
||||
id: 'deliver'
|
||||
}, {
|
||||
name: '待签收',
|
||||
id: 'delivered'
|
||||
},
|
||||
// {
|
||||
// name: '已签收',
|
||||
// id: 'signed'
|
||||
// },
|
||||
{
|
||||
name: '待确认退货',
|
||||
id: 'process'
|
||||
},
|
||||
{
|
||||
name: '完成退货',
|
||||
id: 'completed'
|
||||
}
|
||||
],
|
||||
selectNavId: 'apply',
|
||||
|
||||
// 分页
|
||||
pageStatus: '',
|
||||
page: 1
|
||||
}
|
||||
},
|
||||
created() {},
|
||||
onShow() {
|
||||
// 获取退货单列表
|
||||
this.returnData();
|
||||
},
|
||||
methods: {
|
||||
// 退货单列表
|
||||
returnData() {
|
||||
storeReturn({
|
||||
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'
|
||||
})
|
||||
},
|
||||
|
||||
// 选择订单
|
||||
selectNav(id) {
|
||||
if (this.selectNavId !== id) {
|
||||
this.selectNavId = id
|
||||
this.returnData()
|
||||
}
|
||||
},
|
||||
|
||||
// 签收订单
|
||||
goSign(info) {
|
||||
console.log('goSign',info)
|
||||
let id = info.id
|
||||
let index = info.index
|
||||
uni.showModal({
|
||||
title: '是否签收此订单?',
|
||||
success: res => {
|
||||
if (res.confirm) {
|
||||
storeSign(id).then(() => {
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
title: '签收成功'
|
||||
})
|
||||
setTimeout(() => {
|
||||
this.returnInfo.splice(index,1)
|
||||
// this.returnData()
|
||||
}, 500)
|
||||
}).catch(err => {
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
title: err.message
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
// 确认退货
|
||||
goReToken(info) {
|
||||
let id = info.id
|
||||
let index = info.index
|
||||
uni.showModal({
|
||||
title: '是否确认退货此订单?',
|
||||
success: res => {
|
||||
if (res.confirm) {
|
||||
storeToken(id).then(() => {
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
title: '退货成功'
|
||||
})
|
||||
setTimeout(() => {
|
||||
// this.returnData()
|
||||
this.returnInfo.splice(index,1)
|
||||
}, 500)
|
||||
}).catch(err => {
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
title: err.message
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
// 下拉加载
|
||||
onReachBottom() {
|
||||
if (this.pageStatus == 'more') {
|
||||
this.pageStatus = 'loading'
|
||||
if (this.tabIndex === 'apply') {
|
||||
this.goodsPage += 1
|
||||
// 获取退货单列表
|
||||
this.returnData();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
// 订单nav
|
||||
.nav {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
justify-content: flex-start;
|
||||
box-sizing: border-box;
|
||||
white-space: nowrap;
|
||||
font-size: $title-size*0.95;
|
||||
padding: 0 30rpx;
|
||||
background-color: #fff;
|
||||
color: #666;
|
||||
position: sticky;
|
||||
top: 0rpx;
|
||||
z-index: 1;
|
||||
|
||||
.nav-item {
|
||||
display: inline-block;
|
||||
border-bottom: solid 4rpx #fff;
|
||||
padding: 30rpx 10rpx;
|
||||
margin-right: 10rpx;
|
||||
}
|
||||
|
||||
.nav-item-selected {
|
||||
border-bottom: solid 4rpx $main-color;
|
||||
color: $main-color;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -2,9 +2,9 @@
|
||||
<view class="content">
|
||||
<!-- tabs -->
|
||||
<view class="tabs">
|
||||
<view class="item" :class="{'show': tabsIndex == 'day'}" @click="onTbas('day')">日成交</view>
|
||||
<view class="item" :class="{'show': tabsIndex == 'month'}" @click="onTbas('month')">月成交</view>
|
||||
<view class="item" :class="{'show': tabsIndex == 'year'}" @click="onTbas('year')">年成交</view>
|
||||
<view class="item" :class="{'show': tabsIndex == 'day'}" @click="onTbas('day')">日访客</view>
|
||||
<view class="item" :class="{'show': tabsIndex == 'month'}" @click="onTbas('month')">月访客</view>
|
||||
<view class="item" :class="{'show': tabsIndex == 'year'}" @click="onTbas('year')">年访客</view>
|
||||
</view>
|
||||
<!-- 统计信息 -->
|
||||
<view class="statistics">
|
||||
@@ -24,7 +24,9 @@
|
||||
<view class="item" v-for="(item, index) in orders" :key="index">
|
||||
<image class="cover" :src="item.avatar" mode="aspectFill"></image>
|
||||
<view class="title">{{item.nickname || '-'}}</view>
|
||||
<view class="sub-title">{{item.date || '-'}}</view>
|
||||
<view class="sub-title">访问记录: {{item.content || '-'}}</view>
|
||||
<view class="sub-title">手机号码: {{item.mobile || '-'}}</view>
|
||||
<view class="sub-title">访问时间: {{item.date || '-'}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
@@ -107,6 +109,7 @@
|
||||
.sub-title{
|
||||
color: $text-gray;
|
||||
font-size: $title-size-m;
|
||||
@extend .nowrap;
|
||||
}
|
||||
.icon{
|
||||
width: 288rpx;
|
||||
|
||||
@@ -434,7 +434,7 @@
|
||||
box-sizing: border-box;
|
||||
|
||||
.title {
|
||||
width: 520rpx;
|
||||
width: 500rpx;
|
||||
overflow: hidden;
|
||||
font-size: 30rpx;
|
||||
margin-left: 12rpx;
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
<template>
|
||||
<!-- v-if="!loding" -->
|
||||
<view class="content">
|
||||
<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">
|
||||
<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-top">
|
||||
<view class="vip-name">
|
||||
<image class="vip-name-icon" src="../../static/icons/vip_icon.png" mode="aspectFill"></image>
|
||||
<view :class="tabsIndex == index ? 'vip-name' : 'vip-name1'">
|
||||
<image class="vip-name-icon" src="../../static/icons/vip_icon.png" mode="aspectFill" />
|
||||
{{item.name}}
|
||||
</view>
|
||||
<view class="vip-price">
|
||||
@@ -96,45 +96,6 @@
|
||||
</view>
|
||||
</button>
|
||||
</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>
|
||||
</template>
|
||||
|
||||
@@ -160,6 +121,7 @@
|
||||
created() {
|
||||
// 获取当前用户信息
|
||||
identities().then(res => {
|
||||
console.log(res)
|
||||
this.loding = false
|
||||
this.user = res.user
|
||||
this.description= res.description
|
||||
@@ -177,19 +139,13 @@
|
||||
this.totalData(2);
|
||||
},
|
||||
methods: {
|
||||
// 切换开通身份
|
||||
// onTabs(index){
|
||||
// if(this.tabsIndex === index) return
|
||||
// this.tabsIndex = index
|
||||
// this.rights = this.identities[index].rights
|
||||
// },
|
||||
|
||||
// 切换开通身份
|
||||
swiperChange(e) {
|
||||
this.tabsIndex = e.detail.current
|
||||
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.sumNumber = 1
|
||||
},
|
||||
|
||||
// 开通会员
|
||||
@@ -334,15 +290,24 @@
|
||||
width: 630rpx;
|
||||
height: 280rpx;
|
||||
display: flex;
|
||||
position: relative;
|
||||
.swiper-item-bg{
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
position: absolute;
|
||||
z-index: 10;
|
||||
bottom: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.vip-item {
|
||||
width: 630rpx;
|
||||
height: 280rpx;
|
||||
border-radius: 20rpx;
|
||||
background-color: #c8c8c8;
|
||||
background-color: #c7c7c7;
|
||||
padding: 0 40rpx;
|
||||
box-sizing: border-box;
|
||||
color: #cacaca;
|
||||
.vip-top {
|
||||
display: flex;
|
||||
position: relative;
|
||||
@@ -354,7 +319,7 @@
|
||||
border-radius: 60rpx;
|
||||
padding: 0 $padding;
|
||||
box-sizing: border-box;
|
||||
background-image: linear-gradient(to right, #f11a22, #ff252f);
|
||||
background-image: linear-gradient(to bottom ,#e93340,#e8252f);
|
||||
display: flex;
|
||||
.vip-name-icon {
|
||||
width: 50rpx;
|
||||
@@ -362,6 +327,20 @@
|
||||
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 {
|
||||
font-size: $title-size + 10;
|
||||
font-weight: 600;
|
||||
@@ -377,9 +356,10 @@
|
||||
}
|
||||
|
||||
.color-item-img {
|
||||
background-color: #ff252f;
|
||||
background-color: #e93340;
|
||||
background-image: linear-gradient(to bottom ,#e93340,#e8252f);
|
||||
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 {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
color: #c8c8c8;
|
||||
color: #c2c2c2;
|
||||
.vip-years-icon {
|
||||
width: 60rpx;
|
||||
height: 60rpx;
|
||||
@@ -443,21 +423,23 @@
|
||||
text-align: center;
|
||||
.privilege-img {
|
||||
height: 40rpx;
|
||||
margin-top: 40rpx;
|
||||
}
|
||||
.privilege-list {
|
||||
padding: 0 $padding;
|
||||
box-sizing: border-box;
|
||||
text-align: left;
|
||||
margin-top: $margin;
|
||||
margin-top: $margin * 0.5;
|
||||
.privilege-label {
|
||||
border-bottom: 2rpx #e6eaef dashed;
|
||||
font-size: $title-size;
|
||||
padding: $padding + 10 0;
|
||||
font-size: 30rpx;
|
||||
padding: $padding 0;
|
||||
display: flex;
|
||||
.privilege-label-tips {
|
||||
width: 40rpx;
|
||||
height: 40rpx;
|
||||
margin-right: 20rpx;
|
||||
margin-top: 10rpx;
|
||||
}
|
||||
.privilege-label-text {
|
||||
width: calc(100% - 60rpx);
|
||||
@@ -468,7 +450,6 @@
|
||||
|
||||
// 支付方式
|
||||
.payWay {
|
||||
margin-top: $margin * 4;
|
||||
.payWay-way {
|
||||
padding: 0 $padding;
|
||||
box-sizing: border-box;
|
||||
@@ -512,7 +493,7 @@
|
||||
margin: $margin 0;
|
||||
text-align: center;
|
||||
.agree-tips {
|
||||
background-color: #999999;
|
||||
background-color: #d9d9d9;
|
||||
display: inline-block;
|
||||
padding: 14rpx $padding;
|
||||
color: #FFFFFF;
|
||||
@@ -553,11 +534,11 @@
|
||||
.footer-btn{
|
||||
padding: 0 $padding + 10;
|
||||
box-sizing: border-box;
|
||||
background-color: #ff2828;
|
||||
background-color: #e93340;
|
||||
height: 90rpx;
|
||||
line-height: 90rpx;
|
||||
border-radius: 60rpx;
|
||||
color: #FFFFFF;
|
||||
color: #ececec;
|
||||
font-size: $title-size;
|
||||
font-weight: bold;
|
||||
text-align: left;
|
||||
@@ -566,7 +547,7 @@
|
||||
flex: 1;
|
||||
}
|
||||
.footer-btn-pay {
|
||||
color: #f6ff00;
|
||||
color: rgba($color: #ff0, $alpha: .8);
|
||||
}
|
||||
&[disabled] {
|
||||
background-color: #b1b1b1;
|
||||
|
||||
335
pages/wallet/addBank.vue
Normal file
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
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
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
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
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
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
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
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
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) => {
|
||||
const date = new Date()
|
||||
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()
|
||||
|
||||
switch(type){
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user