Compare commits

...

152 Commits

Author SHA1 Message Date
唐明明
eba5f59956 更新 '.gitignore' 2021-11-24 10:19:45 +08:00
08965725ff 修改钻石大小及组件图片调整 2021-11-23 14:20:36 +08:00
02a59e7720 ['红包提现,红包转化默认值处理优化'] 2021-11-23 10:59:20 +08:00
4611cb984e [商品详情交易数量/领取优惠券状态/隐藏交易次数,位置改为水晶贡献值/改商品认证] 2021-11-23 09:10:23 +08:00
11dd119d0c [合并代码] 2021-11-22 17:31:28 +08:00
d4c12b5499 []... 2021-11-22 17:28:41 +08:00
唐明明
6cda5421c9 商品权证管理多余注释 2021-11-22 17:24:28 +08:00
47eb0d9ec7 ['处理搜索全部类型及查看全部跳转页面逻辑处理'] 2021-11-22 17:23:46 +08:00
唐明明
754dc91d5c 调整购物列表组件 2021-11-22 17:22:40 +08:00
唐明明
53ba8eae67 merge 2021-11-22 16:36:25 +08:00
唐明明
a683d8effc 调整首页图表 2021-11-22 16:35:33 +08:00
feb7e1a42e ['同步线上数据'] 2021-11-22 15:35:50 +08:00
2e108d2540 ['同步最新数据'] 2021-11-22 15:34:44 +08:00
唐明明
a5688f6ff8 领取水晶增加队列处理,增加批量领取 2021-11-17 15:32:21 +08:00
唐明明
0f9b01274f ts队列组件,兼容安卓小米升级方案 2021-11-15 17:17:18 +08:00
唐明明
24b23ac13c 变更商品数量,调整字段错误,推荐关系页面调整 2021-11-12 16:23:35 +08:00
唐明明
1def6bcbfc 商品权证兑换bug 2021-11-11 18:43:32 +08:00
唐明明
8dec48f748 调整购物商品兑换,节点中心调整,权证转让管理增加筛选,调整交易市场 2021-11-11 16:40:19 +08:00
唐明明
d3ca6422a0 页面调整 2021-11-10 19:24:56 +08:00
唐明明
f543bed848 调整更新信息 2021-11-10 18:58:11 +08:00
唐明明
039fb6300c 调整发货单物流信息查询 2021-11-10 18:57:51 +08:00
唐明明
c11511e1fa 修复VIP折扣价销售价的字段错误问题 2021-11-10 17:45:08 +08:00
唐明明
c1c0d720f7 调整会员页面,重构会员页面,移出会员页面冗余代码 2021-11-10 17:02:13 +08:00
唐明明
ddd62f8995 调整路由 2021-11-10 14:23:46 +08:00
唐明明
ec43dcb71c 发货单退货单模块设置 2021-11-10 13:50:03 +08:00
唐明明
87369721b8 变更退货提示信息组件,调整提示信息显示异常bug 2021-11-10 13:43:56 +08:00
唐明明
ea94e54d2b 调整版本更新,修复鉴权显示bug,调整商品认证页面样式错误 2021-11-10 11:50:51 +08:00
唐明明
273386e99f 调整节点中心页面 2021-11-09 18:06:10 +08:00
唐明明
65f0d0d059 退化货管理 2021-11-09 17:03:14 +08:00
唐明明
9749aec218 调整提现提示信息 2021-11-09 09:35:45 +08:00
唐明明
92ea90697f merge 2021-11-05 18:07:48 +08:00
唐明明
33098708f2 商品权证管理新增数据统计 2021-11-05 18:07:10 +08:00
883b032d8d 修改物流弹窗及个人中心企业工具弹窗及员工模块的发货单管理,退换货管理新增 2021-11-05 17:30:48 +08:00
唐明明
786419212f merge 2021-11-05 17:25:16 +08:00
唐明明
f8500192b3 支付宝提现 2021-11-05 17:24:40 +08:00
e4d777887b 现金红包提示 2021-11-05 15:06:19 +08:00
50b0322d95 Merge branch 'main' of https://git.yuzhankeji.cn/TmOct5/BlockChainH5 2021-11-05 14:46:54 +08:00
4c77d25ceb 节点中心t-1错误提示处理 2021-11-05 14:46:45 +08:00
唐明明
0717891b31 merge 2021-11-05 10:32:47 +08:00
唐明明
5e390f2474 同步代码 2021-11-05 10:32:18 +08:00
30ff4209ab 同步最新 2021-11-04 18:18:57 +08:00
495d3ba586 ['解决打包文件冲突'] 2021-11-04 18:02:41 +08:00
b1c0e12afa ['门店列表可滚动'] 2021-11-04 18:01:56 +08:00
唐明明
24a3f809a6 调整部分页面颜色 2021-11-04 17:11:14 +08:00
唐明明
5f7c8c36ca 交易市场新增微信支付 2021-11-04 16:49:09 +08:00
唐明明
f8aed4d12c 店铺router 2021-11-04 16:20:18 +08:00
36c7d5019c [...] 2021-11-04 16:17:29 +08:00
唐明明
cc8833e353 创建商品转跳店铺状态维护 2021-11-04 16:15:24 +08:00
唐明明
217f7fa920 调整企业认证样式错误问题 2021-11-04 15:58:24 +08:00
1a7211d1e4 [处理冲突删除打包无意义文件] 2021-11-04 15:57:15 +08:00
a1c05786c7 ['发布商品必须企业店铺处理'] 2021-11-04 15:56:04 +08:00
唐明明
f0ac413d89 调整login颜色 2021-11-04 11:33:53 +08:00
唐明明
3de021f92f 交易市场支付 2021-11-04 11:31:50 +08:00
唐明明
d9b4d459ae 调整全局支付收银class 2021-11-04 11:30:15 +08:00
c011538220 兼容合作商品和价格贡献值并排搜索 2021-11-04 11:27:57 +08:00
9ee77c73fc 搜索列表及商品列表筛选条件优化,及商品详情页处理服务报错原因和顶部颜色; 2021-11-04 10:53:34 +08:00
f8aa690216 Merge branch 'main' of https://git.yuzhankeji.cn/TmOct5/BlockChainH5 2021-11-04 08:59:00 +08:00
5a478ed794 同步代码 2021-11-04 08:58:49 +08:00
唐明明
cbe6cc912b merge 2021-11-03 20:13:25 +08:00
唐明明
c7cacd2c9c 调整全局颜色,调整部分pagesJson,调整样式 2021-11-03 20:13:03 +08:00
3e22daa807 ['解决冲突'] 2021-11-03 19:00:38 +08:00
87b8fe22d0 解决冲突 2021-11-03 18:43:00 +08:00
1df114459c 商品列表筛选,贡献值筛选,贡献值图标,区块链证书信息完善,商品溯源信息新增接口,时间轴处理等细节完善 2021-11-03 18:36:04 +08:00
唐明明
72a3d53a17 merge 2021-11-03 16:56:55 +08:00
唐明明
2a6cd3a959 调整全局颜色,新增转让市场 2021-11-03 16:56:06 +08:00
唐明明
6cb32203bf 更新 2021-11-03 10:18:31 +08:00
416fc09bab 【商品规格调整】 2021-11-02 20:34:51 +08:00
0d44c66396 ['不上传打包文件,及不处理商品权证规格字段变更问题'] 2021-11-02 18:13:54 +08:00
4509f47165 [同步最新] 2021-11-02 18:11:05 +08:00
唐明明
d0596bd8a2 调整universallinks 2021-11-02 17:25:12 +08:00
唐明明
84c4b3a097 同步代码 2021-11-02 16:49:34 +08:00
唐明明
531b0ab03f 调整支付,调整版本热更 2021-11-02 14:54:41 +08:00
f156aed14d Merge branch 'main' of https://git.yuzhankeji.cn/TmOct5/BlockChainH5 2021-11-02 09:21:55 +08:00
2aa4c594c0 ['同步最新的'] 2021-11-02 09:21:37 +08:00
唐明明
a6e97583ee 调整版本更新url地址 2021-11-01 19:28:34 +08:00
唐明明
634f7c33e4 调整商品支付失败转跳方式 2021-11-01 18:51:37 +08:00
唐明明
4acbd258b2 新增引导图调整购买转跳 2021-11-01 18:48:47 +08:00
唐明明
ff8870b9bb merge 2021-11-01 17:25:15 +08:00
唐明明
61366da9d2 版本检测接口 2021-11-01 17:24:30 +08:00
f47eb531b7 ['用户提现、通证兑换红包等个人认证限制'] 2021-11-01 16:33:43 +08:00
267f9cf17f [节点中心的我的伙伴板块中,伙伴文字变更为粉丝。个人中心个人认证去掉,直接跳转到会员购买页面] 2021-11-01 16:03:57 +08:00
唐明明
cb0da38a87 merge 2021-10-29 16:54:35 +08:00
唐明明
5960d1cf8c 系统版本号 2021-10-29 16:54:00 +08:00
b3690d82a8 [统一分享格式] 2021-10-29 16:35:43 +08:00
0682a04664 [商品分享微信好友和朋友圈处理邀请码和商品id] 2021-10-29 16:17:05 +08:00
18fc1f2239 完善商品邀请 2021-10-29 15:21:09 +08:00
f2eafd91f1 调整商品邀请 2021-10-29 15:15:35 +08:00
d45410e6f2 [同步代码] 2021-10-29 14:28:53 +08:00
唐明明
6e6a772931 merge 2021-10-29 14:28:17 +08:00
唐明明
2a0d37dff6 邀请关系 2021-10-29 14:27:37 +08:00
e5ba70c517 [...] 2021-10-29 13:15:35 +08:00
67faa74463 Merge branch 'main' of https://git.yuzhankeji.cn/TmOct5/BlockChainH5 2021-10-29 11:54:24 +08:00
8b5ff33e31 [支付宝支付0元支付和有金额支付两种,] 2021-10-29 11:54:17 +08:00
唐明明
7ec26ffa3a merge 2021-10-29 11:46:08 +08:00
唐明明
ac75d21177 merge 2021-10-29 11:45:51 +08:00
efdd8e61cb [...] 2021-10-29 10:47:43 +08:00
e79bb6df78 [解决冲突] 2021-10-29 10:32:10 +08:00
a811147c6b [去掉所有console和替换所有积分换成贡献值] 2021-10-29 10:21:41 +08:00
46279dd3d8 [报单模块添加及筛选条件,及权证管理模块没有报单兼容插件] 2021-10-28 16:48:12 +08:00
唐明明
549f59199a 移出冗余代码 2021-10-28 14:19:52 +08:00
唐明明
3913695a26 merge 2021-10-28 14:17:59 +08:00
唐明明
bd50ffcf4d 支付宝支付 2021-10-28 14:15:47 +08:00
58ec38837a [下单微信支付处理及首页隐藏优惠券和更多] 2021-10-27 17:31:29 +08:00
e4b1f33c6c [企业认证格式修改及企业认证range默认值处理同步易货] 2021-10-27 15:45:22 +08:00
011eeedcc4 [商品列表刷选一级分类和二级分类要分别处理!] 2021-10-27 15:00:08 +08:00
2c1f11afd7 [商城整个模块,及个人中心相应的模块调整] 2021-10-27 14:18:46 +08:00
e6181694d2 [发布商品新增预计到账金额] 2021-10-27 10:47:24 +08:00
d441ce2430 [同步线上文件] 2021-10-27 10:15:57 +08:00
29f5a1e755 [去升级换字段判断用is_top判断] 2021-10-27 09:53:29 +08:00
61a417065a [...] 2021-10-26 17:46:03 +08:00
961ce2b0b0 [...] 2021-10-26 17:45:16 +08:00
唐明明
89cb4bea28 更新 2021-10-26 17:26:01 +08:00
bcff29b5a9 [ 2021-10-26 17:18:29 +08:00
43813f1f50 [商品权证分页及刷新处理] 2021-10-26 17:14:33 +08:00
唐明明
422427f549 merge 2021-10-26 14:18:41 +08:00
唐明明
84fe826e1b 同步代码 2021-10-26 14:13:55 +08:00
6860a9e43c [剩余碎片文字改积分] 2021-10-26 11:40:22 +08:00
6c3add5e5a [过期跳转处理,replace不好用] 2021-10-26 11:36:14 +08:00
f4f3bb8de1 [...] 2021-10-26 10:03:05 +08:00
e4b8a33d7c [权证核销模块样式调整] 2021-10-26 09:51:28 +08:00
唐明明
97dc6226da merge 2021-10-26 09:26:03 +08:00
唐明明
6e5d0bcce5 新增员工扫码核销 2021-10-26 09:24:06 +08:00
9b1cb130d8 [...长按删除视频。基础信息李] 2021-10-25 17:21:05 +08:00
ad67333bbf [...] 2021-10-25 16:23:23 +08:00
2bc9ea63c0 [个人认证vip会员开通,企业认证才能发布权证首页,] 2021-10-25 14:59:19 +08:00
cbfca1ad21 [权证认证跳转处理] 2021-10-25 13:08:55 +08:00
680ab05102 [修改商品权证商品规格和商品名称一致及权证认证的时候状态调整] 2021-10-25 13:08:04 +08:00
b93f540824 [二维码可分享] 2021-10-25 11:50:52 +08:00
b80e1d69e4 [权证驳回跳转及驳回修改详情报错处理及选择银行卡重新处理] 2021-10-25 10:44:41 +08:00
唐明明
4056f67853 同步代码 2021-10-22 14:40:21 +08:00
唐明明
6c2c7c6b94 修复首页转跳企业认证方式错误 2021-10-21 11:05:26 +08:00
唐明明
660ed885d3 一键登录调整优化 2021-10-20 11:03:30 +08:00
唐明明
9052c3001b 一键登录 2021-10-20 10:41:49 +08:00
唐明明
0fb9a41178 微信支付 2021-10-19 10:06:44 +08:00
唐明明
d363bb8cd7 调整一键登录 2021-10-15 16:05:25 +08:00
唐明明
440ce824d8 调整区块链电商App兼容优化 2021-10-15 15:58:04 +08:00
5c5e110a27 Merge branch 'main' of https://git.yuzhankeji.cn/TmOct5/BlockChainH5 2021-10-15 09:51:32 +08:00
9a89f3dded ['对接现金红包接口及样式处理'] 2021-10-15 09:49:18 +08:00
唐明明
c6bb2df889 merge 2021-10-15 09:42:37 +08:00
唐明明
045eb8b139 调整配置项支付 2021-10-15 09:38:47 +08:00
01a9d8eb40 ['现金红包部分页面添加及发现更多微调app端样式'] 2021-10-14 09:44:55 +08:00
50fb945707 [开通节点模块样式调整及底部按钮状态处理及申请状态处理及支未完付] 2021-10-13 16:31:58 +08:00
3bfa9a7e20 [...] 2021-10-13 13:13:35 +08:00
9e2c2bd30d [...] 2021-10-13 13:12:21 +08:00
1e57b9272a [会员中心修改样式及调节] 2021-10-13 13:11:12 +08:00
唐明明
7ee3ddee63 调整复制用户中心兼容 2021-10-13 12:04:45 +08:00
3c7ad35631 Merge branch 'main' of https://git.yuzhankeji.cn/TmOct5/BlockChainH5 2021-10-13 10:06:10 +08:00
唐明明
b6e58b2431 调整页面 2021-10-12 17:11:28 +08:00
d6253a8d8b [解决冲突] 2021-10-11 09:34:08 +08:00
c5605c568d [...] 2021-10-11 09:30:02 +08:00
唐明明
452a397a77 调整为app版本 2021-10-09 17:51:21 +08:00
唐明明
91a1ad3748 调整日期 2021-10-09 17:29:14 +08:00
555 changed files with 57168 additions and 40996 deletions

3
.gitignore vendored Normal file
View File

@@ -0,0 +1,3 @@
unpackage
unpackage/*
node_modules

View File

@@ -12,7 +12,7 @@
},
"h5" :
{
"launchtype" : "local"
"launchtype" : "remote"
},
"mp-weixin" :
{

118
App.vue
View File

@@ -1,36 +1,124 @@
<script>
import { getVersions } from './apis/interfaces/versions'
export default {
onLaunch: function() {
onLaunch() {
//#ifdef H5
if (typeof WeixinJSBridge == 'object' && typeof WeixinJSBridge.invoke == 'function') {
handleFontSize();
handleFontSize()
} else {
document.addEventListener('WeixinJSBridgeReady', handleFontSize, false);
}
function handleFontSize() {
// 设置网页字体为默认大小
WeixinJSBridge.invoke('setFontSizeCallback', { fontSize: 0 });
WeixinJSBridge.invoke('setFontSizeCallback', {
fontSize: 0
})
// 重写设置网页字体大小的事件
WeixinJSBridge.on('menu:setfont', function() {
WeixinJSBridge.invoke('setFontSizeCallback', { fontSize: 0 });
});
WeixinJSBridge.invoke('setFontSizeCallback', {
fontSize: 0
})
})
}
//#endif
//#ifdef APP-PLUS
// 获取系统版本号
getVersions({
platform: plus.os.name,
version : plus.runtime.versionCode
}).then(res => {
if(res.update){
uni.showModal({
title: "更新提示",
content: res.note || '版本更新信息',
confirmText: "更新",
success: modalRes => {
if (modalRes.confirm) {
if (plus.os.name == "Android") {
uni.showToast({
title: '新版本下载中,将在下载完成后自动为您安装更新包',
icon : 'none'
})
uni.downloadFile({
url : res.info.download,
success : apkPick=> {
plus.runtime.install(apkPick.tempFilePath, '', installRES => {
// 安装完成用于提示新版本引导,暂时无用
}, installERR => {
// 安装失败
})
},
onShow: function() {
console.log('App Show')
fail(err){
uni.showToast({
title: '安装包下载失败,请检查您的网络或稍后重试',
icon : 'none'
})
}
})
// plus.runtime.openURL(res.info.download, err => {
// console.log(err)
// }, 'com.android.browser');
} else{
uni.showToast({
title: 'IOS应用暂未上架请打开测试(TestFlight)工具点击更新',
icon : 'none'
})
}
}
}
})
}
}).catch(err => {
uni.showToast({
title: err.message,
icon : 'none'
})
})
//#endif
},
onHide: function() {
console.log('App Hide')
onShow() {
uni.getClipboardData({
success: res=> {
// 包含分享邀请码
if(res.data.indexOf('$InviTaTiOn$CoDe/$-?') === 2){
let parentId = res.data.replace('$InviTaTiOn$CoDe/$-?', '')
this.globalData.parentId = parentId.substr(0, 10)
if(res.data.indexOf('^GoodsId/$-?') === 30){
let goodsId = res.data.substr(42, res.data.length - 1)
setTimeout(() => {
if(this.$Route.name === 'goodsDetails' && this.$Route.query.id === goodsId) return
this.$Router.push({name: 'goodsDetails', params: {id: goodsId}})
}, 1000)
}
return
}
// 不包含用户信息
if(res.data.indexOf('^GoodsId/$-?') > -1){
let goodsId = res.data.substr(12, res.data.length - 1)
setTimeout(() => {
if(this.$Route.name === 'goodsDetails' && this.$Route.query.id === goodsId) return
this.$Router.push({name: 'goodsDetails', params: {id: goodsId}})
}, 1000)
}
}
})
},
onHide() {
console.log('App Hide');
},
globalData: {
mainColor: 'white',
parentId:''
}
};
</script>
<style>
<style lang="scss">
@import 'uview-ui/index.scss';
page {
background: #F5F5F5;
background: #f5f5f5;
-webkit-text-size-adjust: 100% !important;
}
</style>
<style lang="scss">
@import "uview-ui/index.scss";
</style>

View File

@@ -6,10 +6,12 @@
*/
import store from '@/store'
import router from '../router'
// 基础配置
const config = {
apiUrl : 'https://oapi.lianshang.vip/api/', // 正式环境
// apiUrl : 'http://api.ahxh.shangkelian.cn/api/', // 测试环境
apiUrls : 'https://storage.lianshang.vip/', // 图片路径(测试/正式)
timeout : 60000
}
@@ -17,7 +19,7 @@ const config = {
let loginHintState = false
// 网络请求
const request = (parameter) => {
const request = (parameter, hideLoding) => {
// 检查url配置
if(parameter.url === 'undefined' || parameter.url === ''){
uni.showToast({
@@ -32,10 +34,11 @@ const request = (parameter) => {
'Authorization': store.getters.getToken || ''
}
// 加载提示
uni.showLoading({
if(!hideLoding) uni.showLoading({
title: '加载中',
mask : true
});
// 请求实例
return new Promise((resolve, reject) => {
uni.request({
@@ -143,7 +146,11 @@ const loginHint = () => {
showCancel:false,
success: res=> {
loginHintState = false
if (res.confirm) this.$Router.replace({name: 'Index'})
if (res.confirm) {
uni.reLaunch({
url:'/pages/index/index'
})
}
}
})
}

View File

@@ -0,0 +1,62 @@
/**
* zdx
* moduleName: 地址
*/
import { request } from '../index'
// 地址列表
const addresses = () => {
return request({
url: 'mall/addresses',
method: 'GET'
})
}
// 新增地址
const addAddresses = (data) => {
return request({
url: 'mall/addresses',
method: 'post',
data: data
})
}
// 根据地址id获取地址的详细信息
const getAddresses = (id) => {
return request({
url: 'mall/addresses/'+id,
method: 'get'
})
}
// 编辑
const editAddresses = (id,data) => {
return request({
url: 'mall/addresses/'+id,
method: 'put',
data:data
})
}
// 删除
const delAddresses = (id) => {
return request({
url: 'mall/addresses/'+id,
method: 'DELETE'
})
}
// 默认
const defaultAddresses = (id) => {
return request({
url: 'mall/addresses/'+id+'/default',
method: 'post'
})
}
export {
addresses,
addAddresses,
getAddresses,
editAddresses,
delAddresses,
defaultAddresses
}

22
apis/interfaces/alipay.js Normal file
View File

@@ -0,0 +1,22 @@
/**
* Web唐明明
* 匆匆数载恍如梦,岁月迢迢华发增。
* 碌碌无为枉半生,一朝惊醒万事空。
* moduleName: 支付宝
*/
import { request } from '../index'
// 支付宝下单
const getAliPayConfig = (orderId, data) => {
return request({
url: 'user/identities/pay/' + orderId + '/alipay',
data
})
}
export {
getAliPayConfig
}

View File

@@ -26,7 +26,7 @@ const getSms = (data) =>{
})
}
// 用户隐私协议 articles/agreement/secret 用户服务协议 articles/agreement/service
// 用户隐私,用户服务协议
const secretService = (name) =>{
return request({
@@ -34,9 +34,19 @@ const secretService = (name) =>{
})
}
// 一键登录
const keyAuth = (data) => {
return request({
url: 'user/socialite/login/unicloud/app',
method: 'POST',
data: data
}, true)
}
export {
smsAuth,
getSms,
secretService
secretService,
keyAuth
}

View File

@@ -28,11 +28,29 @@ const thawlog = (data) => {
url: 'user/account/thawlog',
method: 'POST',
data
}, true)
}
// 获取新的一批水晶
const crystalsBefore = (data) => {
return request({
url: 'user/account/crystals/before',
})
}
// 批量领取水晶
const allThawall = (data) => {
return request({
url: 'user/account/thawall',
method: 'POST',
data
})
}
export {
chain,
crystals,
thawlog
thawlog,
crystalsBefore,
allThawall
}

View File

@@ -39,9 +39,27 @@ const appliesCategory = data => {
})
}
// 企业广场
const companies = data => {
return request({
url: 'companies',
data
})
}
// 企业列表
const companiesList = data => {
return request({
url: 'companies/lists',
data
})
}
export {
appliesCreate,
applies,
appliesInfo,
appliesCategory
appliesCategory,
companies,
companiesList
}

83
apis/interfaces/coupon.js Normal file
View File

@@ -0,0 +1,83 @@
/**
* Web-zdx
* moduleName: 优惠券相关
*/
import { request } from '../index'
// 我的优惠券
const myCoupon = (data) => {
return request({
url: 'coupons/user/coupons',
method: 'get',
data: data
})
}
// 优惠券分组列表
const getCouponsListById = (id,data) => {
return request({
url: 'coupons/user/coupons/'+id+'/list',
data:data
})
}
// 根据优惠券id获取优惠券的详情信息
const getCouponsInfoById = (id) => {
return request({
url: 'coupons/user/coupons/'+id,
})
}
// 根据企业id获取企业首页的轮播图列表
const couponsByCompanyId = (data) => {
return request({
url: 'coupons/all',
method: 'get',
data: data
})
}
// 领取优惠券
const couponsGrant = (id) => {
return request({
url: 'coupons/'+id+'/grant',
method: 'POST'
})
}
// 获取优惠券可使用商品
const getGoodsByGrantId = (data) => {
return request({
url: 'user/coupons/goods',
data: data
})
}
// 使用提货券兑换商品
const exchangeGoods = (data) => {
return request({
url: 'user/coupons/exchange',
method: 'POST',
data: data
})
}
// 获取核销二维码
const getQrcodeByGrantId = (data) => {
return request({
url: 'coupons/user/coupons/qrcode',
data: data
})
}
export {
myCoupon,
couponsByCompanyId,
couponsGrant,
getGoodsByGrantId,
exchangeGoods,
getCouponsListById,
getCouponsInfoById,
getQrcodeByGrantId
}

View File

@@ -1,4 +1,3 @@
/**
* Web唐明明
* 匆匆数载恍如梦,岁月迢迢华发增。
@@ -6,7 +5,9 @@
* moduleName: 商品
*/
import { request } from '../index'
import {
request
} from '../index'
// 商品管理-商品列表
@@ -106,6 +107,103 @@ const managesGoodsExtends = id => {
})
}
// 领取优惠券
const managesCoupons = (id) => {
return request({
url: 'coupons/' + id + '/grant',
method: 'POST'
})
}
// 商城首页
const mall = data => {
return request({
url: "mall"
})
}
// 商品列表
const list = data => {
return request({
url: "mall/goods",
data
})
}
// 通证权益 搜索页面
const searchUrl = (apiUrl, data) => {
return request({
url: apiUrl,
data: data
})
}
// 企业行业分类
const companyCategory = () => {
return request({
url: 'companies/industry'
})
}
// 商品分类搜索-默认关键字
const randgoodsUrl = (apiUrl, data) => {
return request({
url: apiUrl,
data: data
})
}
// 商品详情
const goods = id => {
return request({
url: 'mall/goods/' + id
})
}
// 商品分类
const goodsCategory = () => {
return request({
url: 'mall/categories'
})
}
// 商品确认商品信息页面get 下单页 post
const mallBuyGoods = (data, method) => {
return request({
url: 'mall/buy/goods',
method: method,
data: data
})
}
// 区块链证书
const managesChain = (id) => {
return request({
url: 'mall/goods/' + id + '/chain'
})
}
// 商品认证
const managesAttestation = (id) => {
return request({
url: 'mall/goods/' + id + '/message'
})
}
// 商品溯源
const managesTracedTo = (id) => {
return request({
url: 'mall/goods/' + id + '/trace'
})
}
// 商品第一条溯源
const checkmessage = (id) => {
return request({
url: 'mall/goods/' + id + '/checkmessage'
})
}
// 商品类型 0全1自营2合作
const shopself = () => {
return request({
url: 'mall/shopself'
})
}
export {
managesGoodsIndex,
managesGoodsMint,
@@ -118,5 +216,19 @@ export {
managesGoodsEdit,
managesCreate,
managesGoodsPut,
managesGoodsExtends
managesGoodsExtends,
managesCoupons,
mall,
list,
searchUrl,
companyCategory,
randgoodsUrl,
goods,
goodsCategory,
mallBuyGoods,
managesChain,
managesAttestation,
managesTracedTo,
checkmessage,
shopself
}

21
apis/interfaces/guide.js Normal file
View File

@@ -0,0 +1,21 @@
/**
* Web唐明明
* 匆匆数载恍如梦,岁月迢迢华发增。
* 碌碌无为枉半生,一朝惊醒万事空。
* moduleName: 启动页
*/
import { request } from '../index'
// 欢迎图
const guide = data => {
return request({
url: 'cms/banners',
data
})
}
export {
guide
}

102
apis/interfaces/market.js Normal file
View File

@@ -0,0 +1,102 @@
/**
* Web唐明明
* 匆匆数载恍如梦,岁月迢迢华发增。
* 碌碌无为枉半生,一朝惊醒万事空。
* moduleName: 转让市场
*/
import { request } from '../index'
// 转让市场
const markets = data => {
return request({
url: 'markets',
data
})
}
// 转让市场记录
const marketsLogs = data => {
return request({
url: 'markets/orders',
data
})
}
// 转让详情
const marketsInfo = id => {
return request({
url: 'markets/' + id
})
}
// 提交支付订单
const marketsBuy = (id, data) => {
return request({
url: 'markets/' + id + '/create',
method: 'POST',
data
})
}
// 转让市场支付
const marketsPay = (id, platform) => {
return request({
url: 'markets/pay/' + id + '/' + platform
})
}
// 转让权证信息
const marketsCreateInfo = symbol => {
return request({
url: 'markets/user/markets/create',
data: { symbol }
})
}
// 提交权证转让
const marketsCreate = data => {
return request({
url: 'markets/user/markets/create',
method: 'POST',
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,
marketsInfo,
marketsBuy,
marketsPay,
marketsCreateInfo,
marketsCreate,
marketsMag,
marketsCancel,
marketsOrdersLogs
}

View File

@@ -0,0 +1,146 @@
/**
* Web-zdx
* moduleName: 我的数权
*/
import { request } from '../index'
// 我的数权
const mallWarrants = (data) => {
return request({
url: 'mall/warrants',
method: 'GET',
data: data
})
}
// 我的数权Id获取数权详情
const mallWarrantsList = (symbol) => {
return request({
url: 'mall/warrants/exchange',
method: 'GET',
data: {
symbol:symbol
}
})
}
// 确认提货
const mallWarrantsSure = (data) => {
return request({
url: 'mall/warrants/exchange',
method: 'POST',
data: data
})
}
// 我的邮寄订单,我的提货单
const mallShipmentsPostShop = (apiUrl,data) => {
return request({
url: apiUrl,
method: 'GET',
data: data
})
}
// 根据提货单的no 获取提货单的详情
const mallShipmentsInfo = (no) => {
return request({
url: 'mall/shipments/'+no,
method: 'GET'
})
}
// 取消提货单
const mallShipmentsCancel = (shipmentNo) => {
return request({
url: 'mall/shipments/'+ shipmentNo+'/cancel',
method: 'POST'
})
}
// 签收提货单
const mallShipmentsSign = (shipmentNo) => {
return request({
url: 'mall/shipments/'+ shipmentNo+'/sign',
method: 'POST'
})
}
// 退货单申请退货
const mallShipmentsRefund = (data) => {
return request({
url: 'mall/shipments/'+ data.shipment_no+'/refund',
method: 'POST',
data:data
})
}
// 退货单申请退货前置条件
const mallShipmentsRefundInfo = (shipmentNo) => {
return request({
url: 'mall/shipments/'+ shipmentNo+'/refund',
method: 'GET'
})
}
// 查看物流接口
const mallShipmentsLogistic = (shipmentNo) => {
return request({
url: 'mall/shipments/'+ shipmentNo+'/logistic',
method: 'GET'
})
}
// 我的退货单 mall/refunds
const mallRefunds = (data) => {
return request({
url: 'mall/refunds',
method: 'GET',
data: data
})
}
//退货单详情页
const mallRefundsInfo = (no) => {
return request({
url: 'mall/refunds/'+no,
method: 'GET'
})
}
// 确认退货mall/refunds/{refund}/deliver
const mallRefundsDeliver = (data) => {
return request({
url: 'mall/refunds/'+data.refund+'/deliver',
method: 'POST',
data:data
})
}
// 提货单或者服务单生成提货二维码
const mallWarrantsQrcode = (data) => {
return request({
url: 'mall/warrants/qrcode',
method: 'GET',
data:data
})
}
export {
mallWarrants,
mallWarrantsList,
mallWarrantsSure,
mallShipmentsPostShop,
mallShipmentsInfo,
mallShipmentsCancel,
mallShipmentsSign,
mallShipmentsRefund,
mallShipmentsRefundInfo,
mallShipmentsLogistic,
mallRefunds,
mallRefundsInfo,
mallRefundsDeliver,
mallWarrantsQrcode
}

58
apis/interfaces/order.js Normal file
View File

@@ -0,0 +1,58 @@
/**
* Web唐明明
* 匆匆数载恍如梦,岁月迢迢华发增。
* 碌碌无为枉半生,一朝惊醒万事空。
* moduleName: 订单
*/
import {
request
} from '../index'
// 创建,确认订单
const buy = (data, method) => {
return request({
url: 'mall/buy/goods',
method,
data
})
}
// eb支付
const eb = (no) => {
return request({
url: 'mall/pay/' + no + '/eb',
})
}
// 微信支付
const wxPay = (data) => {
return request({
url: 'mall/pay/' + data.order_no + '/wechat',
data: data,
method: 'get'
})
}
//支付宝支付
const aliPay = (data) => {
return request({
url: 'mall/pay/' + data.order_no + '/alipay',
data: data,
method: 'get'
})
}
// EB支付
const ebPay = (data) => {
return request({
url: 'mall/pay/' + data.order_no + '/eb'
})
}
export {
buy,
eb,
wxPay,
aliPay,
ebPay
}

View File

@@ -3,9 +3,7 @@
* moduleName:核销相关操作
*/
import {
request
} from '../index'
import { request } from '../index'
// 扫码前置条件 get 核销前置 post 表示核销

View File

@@ -55,12 +55,10 @@ const companiesCode = () => {
}
// 退货单列表
const storeReturn = (state) => {
const storeReturn = data => {
return request({
url: 'manages/refunds',
data: {
state
}
data
})
}
@@ -102,12 +100,10 @@ const storeAudit = (refund_id, data) => {
}
// 提货单列表
const storeDeliver = (state) => {
const storeDeliver = (data) => {
return request({
url: 'manages/shipments',
data: {
state
}
data
})
}

View File

@@ -0,0 +1,23 @@
/**
* Web唐明明
* 匆匆数载恍如梦,岁月迢迢华发增。
* 碌碌无为枉半生,一朝惊醒万事空。
* moduleName: 版本信息
*/
import { request } from '../index'
// 版本检测
const getVersions = data => {
return request({
url: 'app/version',
method: 'POST',
data
})
}
export {
getVersions
}

View File

@@ -1,4 +1,3 @@
/**
* Web唐明明
* 匆匆数载恍如梦,岁月迢迢华发增。
@@ -6,7 +5,9 @@
* moduleName: 会员
*/
import { request } from '../index'
import {
request
} from '../index'
// 会员身份信息
const identities = () => {
@@ -15,7 +16,7 @@ const identities = () => {
})
}
// 开通会员
// 提交开通订单
const vipOrder = (id, data) => {
return request({
url: 'user/identities/create/' + id,
@@ -24,10 +25,10 @@ const vipOrder = (id, data) =>{
})
}
// 开通会员微信支付
const vipWechatPay = (id, data) => {
// 获取微信支付配置
const vipWechatPay = (order_id, data) => {
return request({
url: 'user/identities/pay/' + id + '/wechat',
url: 'user/identities/pay/' + order_id + '/wechat',
data
})
}
@@ -49,6 +50,15 @@ const vipVoucher = (data) =>{
})
}
// 编辑凭证
const vipVoucherUpdate = (id, data) => {
return request({
url: 'user/voucher/' + id + '/update',
method: 'POST',
data: data
})
}
// 用户协议
const userAgree = (apiUrl) => {
return request({
@@ -62,5 +72,6 @@ export {
vipWechatPay,
vipCont,
vipVoucher,
userAgree
userAgree,
vipVoucherUpdate
}

View File

@@ -138,6 +138,13 @@ const keyrules = () => {
})
}
// 通证转红包前置,获取通证的基本信息
const accountCashs = (data) => {
return request({
url: 'user/account/cashs',
data:data
})
}
export {
seed,
hash,
@@ -154,6 +161,7 @@ export {
securityCheck,
securityReset,
cmsWithdraw,
keyrules
keyrules,
accountCashs
}

View File

@@ -82,7 +82,7 @@ const withdrawsIndexLists = (data) => {
})
}
// 能量碎片记录
// 贡献值记录
const userAccoutScores = (data) => {
return request({
url: 'user/account/scores',
@@ -91,6 +91,22 @@ const withdrawsIndexLists = (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,
@@ -101,5 +117,7 @@ export {
withdrawsIndexCreate,
withdrawsIndex,
withdrawsIndexLists,
userAccoutScores
userAccoutScores,
accountCashs,
cashsCreate
}

View File

@@ -0,0 +1,11 @@
{
"applinks": {
"apps": [],
"details": [
{
"appID": "io.lianshang.app",
"paths": [ "https://www.lianshang.vip/ulink/*"]
}
]
}
}

BIN
components/.DS_Store vendored Normal file

Binary file not shown.

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -1,4 +1,3 @@
<template>
<view class="goods--list">
<block v-if="list.length > 0">
@@ -6,18 +5,30 @@
<view class="cover">
<image class="cover--src" :src="item.cover" mode="aspectFill" />
</view>
<template v-if='notag === ""'>
<span class='is_self' v-if='item.specal_tags.is_self'>{{item.specal_tags.is_self}}</span>
</template>
<template v-if='notag === ""'>
<span class='is_allow_values' v-if='item.specal_tags.is_allow_values'>
<image src="/static/imgs/baodan_hot.png" mode="widthFix" />
</span>
</template>
<view class="content">
<view class="title">{{item.name}}</view>
<view class="title">
{{item.name}}
</view>
<view class="content-flex">
<view class="price eb" v-if="priceType === 'EB'">
{{item.price}}<text>易币</text>
</view>
<view class="price cny" v-if="priceType === 'CNY'">
<text></text>{{item.original_price}}
<text></text>{{item.price.price_min}}
</view>
<view class="sales">
<slot name="statistics" :value="item">
{{item.sales}}
{{item.sales}}
<!-- 贡献值:{{item.price.pv}} <image style="width: 30rpx;" src="/static/icons/crystal-icon.png" mode="widthFix" /> -->
</slot>
</view>
</view>
@@ -37,6 +48,10 @@
export default {
name: 'goodsList',
props: {
notag: {
type: String,
default: ''
},
// 数据列表
list: {
type: Array,
@@ -68,6 +83,7 @@ export default {
padding: calc(#{$padding} - 10rpx);
display: flex;
flex-wrap: wrap;
.goods--item {
background: white;
box-sizing: border-box;
@@ -75,10 +91,36 @@ export default {
margin: 10rpx;
border-radius: $radius/2;
overflow: hidden;
position: relative;
.is_self {
position: absolute;
top: 0;
right: 20rpx;
background-image: linear-gradient(to bottom, #ee4c47, #f80000);
// background-color: #ee4c47;
box-shadow: 0 4rpx 10rpx 2rpx rgba($color: #000, $alpha: .3);
color: #fff;
font-size: 26;
padding: 2rpx 20rpx 10rpx 20rpx;
border-radius: 0 0 50rpx 50rpx;
}
.is_allow_values {
position: absolute;
top: 264rpx;
left: 0;
image {
width: 180rpx;
}
}
.cover {
position: relative;
width: 100%;
padding-top: 100%;
.cover--src {
position: absolute;
height: 100%;
@@ -87,26 +129,41 @@ export default {
left: 0;
}
}
.content {
padding: $padding/2;
.title {
font-size: $title-size-lg;
line-height: 40rpx;
height: 80rpx;
text-align: justify;
@extend .ellipsis;
// .is_allow_values {
// color: #fff;
// background-image: linear-gradient(to left, $mian-color, $mian-color-light);
// padding: 2rpx 14rpx;
// font-size: 20rpx;
// text-align: center;
// border-radius: 30rpx;
// margin-right: 20rpx;
// }
}
.content-flex {
width: 100%;
display: flex;
justify-content: space-between;
padding-top: $padding/2;
.price {
width: 50%;
color: $text-price;
font-weight: bold;
font-size: $title-size;
@extend .nowrap;
text {
font-size: $title-size-sm;
font-weight: normal;
@@ -114,18 +171,19 @@ export default {
line-height: 50rpx;
}
}
.sales {
width: 50%;
font-size: $title-size-sm;
color: $text-gray;
line-height: 50rpx;
text-align: right;
@extend .nowrap;
}
}
}
}
}
// 数据空
.goods--null {
width: 100%;

View File

@@ -0,0 +1,225 @@
<template>
<view class="industry--list">
<block v-if="list.length > 0">
<view class="industry--box" v-for="(item, index) in list" :key="index" @click="industry(item)">
<image class="industry--cover" :src="item.cover" mode="aspectFill"></image>
<view class="industry--vip">{{item.level.name}}</view>
<view class="industry--content">
<view class="industry--title nowrap">{{item.name}}</view>
<view class="industry--credit">信用值 {{item.integrity}}</view>
<view class="industry--trade nowrap" v-if="item.industry">行业{{item.industry.title}}</view>
<view class="industry--bar">
<view class="industry--color">
<view class="industry--strip" :style="{width: item.process + '%'}"></view>
</view>
<view class="industry--per">{{item.process}}%</view>
</view>
<!-- <view class="industry--credibility">
<uni-rate
:readonly="true"
color="#ddd"
active-color="#e93340"
:value="item.star"
:size="14"
/>
</view> -->
<!-- <uni-icons class="industry--arrow" type="arrowright" color="#ddd" size="14" /> -->
<view class="industry--tool">
<view class="industry--deal">
权证数<text class="industry--number">{{item.goodsCount}}</text>
</view>
</view>
</view>
</view>
</block>
<block v-else>
<view class="industry--null">
</view>
</block>
</view>
</template>
<script>
export default {
name: "industry-list",
props: {
// 数据列表
list: {
type: Array,
default: () => {
return new Array
}
},
// 列表空提示
toast: {
type: String,
default: '暂无商品数据 -_-!'
}
},
methods: {
industry(e) {
this.$emit('on-industry', e)
}
}
}
</script>
<style lang="scss" scoped>
// 列表信息
.industry--list {
padding-bottom: $padding;
}
.industry--box {
position: relative;
margin: $margin - 10 $margin;
background: white;
border-radius: $radius/2;
padding: $padding ($padding*3) $padding ($padding * 2 + 128);
min-height: 128rpx;
.industry--vip {
position: absolute;
top: $padding;
left: $padding;
background-color: #191919;
color: #f3c8a8;
font-size: 24rpx;
line-height: 32rpx;
padding: 0 8rpx;
border-radius: 6rpx 6rpx 6rpx 0;
}
.industry--cover {
position: absolute;
left: $padding;
top: $padding;
width: 128rpx;
height: 128rpx;
}
.industry--title {
font-weight: bold;
font-size: $title-size-lg;
width: 80%;
line-height: 40rpx;
}
.industry--credit {
font-size: 22rpx;
display: inline-block;
font-weight: normal;
color: #ec652f;
border: 2rpx solid #ec652f;
line-height: 36rpx;
border-radius: 6rpx;
padding: 0 6rpx;
margin: 10rpx 0;
}
.industry--trade {
font-size: 24rpx;
color: $text-gray;
line-height: 40rpx;
}
.industry--bar {
display: flex;
width: 70%;
margin-top: 4rpx;
.industry--color {
background: #ebebeb;
border-left: 2rpx solid transparent;
border-right: 2rpx solid transparent;
width: calc(100% - 50rpx);
border-radius: 60rpx;
margin: 6rpx 10rpx 0 0;
height: 18rpx;
.industry--strip {
background-color: #ff8562;
border: 1px solid #ff8562;
border-radius: 10px;
box-shadow: 1vw 3vh 10vh rgba(168, 7, 7, 0.8);
background-size: 3em 3em;
background-image: linear-gradient(-45deg, transparent 0em, transparent 0.8em, #ec3950 0.9em, #ec3950 2.1em, transparent 2.1em, transparent 2.9em, #ec3950 3.1em);
height: 14rpx;
border-radius: 60rpx;
position: relative;
&::after {
content: '';
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
z-index: 1;
height: 100%;
background-image: linear-gradient(to bottom, #db152e, rgba(168, 7, 7, 0.6) 15%, transparent 60%, #db152e);
border-radius: 20rpx;
}
}
}
.industry--per {
font-size: 20rpx;
color: rgba(0, 0, 0, 0.8);
transform: scale(.8);
}
}
.industry--tool {
position: absolute;
top: 60rpx;
right: $padding;
.industry--deal {
width: 120rpx;
height: 120rpx;
text-align: center;
background: linear-gradient(to bottom, #e1293f, #f85d31);
box-shadow: 0 0 14rpx rgba(260, 60, 80, .9);
color: #FFFFFF;
font-size: 26rpx;
border-radius: 50%;
padding-top: 25rpx;
box-sizing: border-box;
font-size: 24rpx;
.industry--number {
font-size: 28rpx;
font-weight: 600;
display: block;
margin-top: 4rpx;
}
}
}
.industry--credibility {
padding-top: 8rpx;
height: 48rpx;
box-sizing: border-box;
}
.industry--arrow {
position: absolute;
right: $margin;
top: 50%;
margin-top: -7px;
}
}
// 数据空
.industry--null {
width: 100%;
padding: 20vh 0;
text-align: center;
font-size: $title-size-m;
color: $text-gray;
}
</style>

View File

@@ -0,0 +1,175 @@
<template>
<view class="MallRefundsTemplate">
<view class="top">
<view class="company">
<view class="company-logo">
<image :src="item.shop.cover" mode="aspectFill" />
<view class="name ellipsis">{{item.shop.name}}</view>
</view>
<view class="no ellipsis">退货单号 {{item.refund_no}}</view>
</view>
<view class="status" style="color:#ff5500;">{{item.state.text}}</view>
</view>
<view class="goods-info" @click="goDetail(item.goods_sku.goods_id)">
<image class="goods-img" :src="item.goods_sku.cover" mode="aspectFill" />
<view class="goods">
<view class="name">
<view class="name1 ellipsis-2">{{item.goods_sku.goods_name}}</view>
<!-- <span>{{item.account.balance}}</span> -->
</view>
<view class="sku">权证个数 <span>x {{item.qty}}</span> </view>
<!-- <view class="sku">提货方式 <span> {{item.type_text}}</span> </view> -->
</view>
</view>
</view>
</template>
<script>
export default {
name: "MallRefundsTemplate",
data() {
return {
};
},
props: {
item: Object
},
methods: {
// 跳转到商品详情页面
goDetail(id) {
uni.navigateTo({
url: '/pages/goods/details?id=' + id
})
}
}
}
</script>
<style lang="scss" scoped>
.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;
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: 460rpx;
font-size: 30rpx;
color: #484848;
font-weight: bold;
}
}
.no {
margin-top: 10rpx;
font-size: $title-size*0.8;
color: #999;
width: 500rpx;
}
.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;
margin-left: 20rpx;
margin-bottom: 10rpx;
.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: 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: $mian-color;
font-size: $title-size*0.8;
font-weight: 400;
padding: 0 30rpx;
}
}
</style>

View File

@@ -0,0 +1,172 @@
<template>
<view class="MallShipmentTemplate" >
<view class="top" >
<view class="company">
<view class="company-logo">
<image :src="item.shop.cover" mode="aspectFill" />
<view class="name ellipsis">{{item.shop.name}}</view>
</view>
<view class="no ellipsis">发货单号 {{item.shipment_no}}</view>
<!-- <view class="no ellipsis">创建时间 {{item.created_at}}</view> -->
</view>
<view class="status" style="color:#DD524D;">{{item.state_text}}</view>
</view>
<view class="goods-info" @click="goDetail(item.goods_sku.goods_id)">
<image class="goods-img" :src="item.goods_sku.cover" mode="aspectFill" />
<view class="goods">
<view class="name">
<view class="name1 ellipsis-2">{{item.goods_sku.goods_name}}</view>
<!-- <span>{{item.account.balance}}</span> -->
</view>
<view class="sku">权证个数 <span>x {{item.qty}}</span> </view>
<view class="sku" v-if="item.goods_type === 2">使用方式 <span> 门店使用</span> </view>
<view class="sku" v-else>提货方式 <span> {{item.type_text}}</span> </view>
</view>
</view>
</view>
</template>
<script>
export default {
name: "MallShipmentTemplate",
data() {
return {
};
},
props:{
item:Object
},
methods: {
// 跳转到商品详情页面
goDetail(id) {
uni.navigateTo({
url: '/pages/goods/details?id='+id
})
}
}
}
</script>
<style lang="scss" scoped>
// 顶部信息
.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;
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: 460rpx;
font-size: 30rpx;
color: #484848;
font-weight: bold;
}
}
.no {
margin-top: 10rpx;
font-size: $title-size*0.8;
color: #999;
width: 530rpx;
}
.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;
margin-left: 20rpx;
margin-bottom: 10rpx;
.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: 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: $mian-color;
font-size: $title-size*0.8;
font-weight: 400;
padding: 0 30rpx;
}
}
</style>

View File

@@ -21,7 +21,6 @@
* no-goods没有商品
* no-list没有订单列表
* no-news没有任何消息
* no-new1没有任何消息1
* no-chain (没有区块链信息)
* no-collection没有任何收藏信息
* no-foot (没有足迹信息)

View File

@@ -0,0 +1,182 @@
<template>
<view class="OrderTemplate">
<view class="top" v-if="isTop">
<view class="company">
<view class="company-logo">
<image :src="item.shop.cover" mode="aspectFill" />
<view class="name ellipsis">{{ item.shop.name }}</view>
</view>
<view class="flexrow">
<view class="no ellipsis">区块链地址 {{ item.account.addr }}</view>
<span class="copy" @click="copy(item.account.addr)">复制</span>
</view>
</view>
</view>
<view class="goods-info" @click="goDetail(item.goods.goods_id)">
<image class="goods-img" :src="item.goods.cover" mode="aspectFill" />
<view class="goods">
<view class="name">
<view class="name1 ellipsis-2">{{ item.goods.goods_name }}</view>
<!-- <span>{{item.account.balance}}</span> -->
</view>
<view class="sku">
权证个数
<span>x {{ item.account.balance }}</span>
</view>
</view>
</view>
</view>
</template>
<script>
export default {
name: 'OrderTemplate',
data() {
return {};
},
props: {
item: Object,
isTop: {
type: Boolean,
default: true
}
},
onShow() {
console.log(this.item, 'onshow,numtempa');
},
methods: {
// 跳转到商品详情页面
goDetail(id) {
uni.navigateTo({
url: '/pages/goods/details?id=' + id
});
},
// 复制
copy(e) {
uni.setClipboardData({
data: e,
success: res => {
console.log('res', res);
}
});
}
}
};
</script>
<style lang="scss" scoped>
// 顶部信息
.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;
.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: 10rpx;
font-size: $title-size * 0.8;
color: #999;
width: 500rpx;
}
.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-top: 36rpx;
.goods-img {
width: 120rpx;
height: 120rpx;
border-radius: 10rpx;
}
.goods {
flex: 1;
margin-left: 20rpx;
margin-bottom: 10rpx;
.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: 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 {
position: relative;
padding-right: 200rpx;
line-height: 50rpx;
.no{
white-space:nowrap;
}
.copy {
line-height: 50rpx;
position: absolute;
right: 30rpx;
top: 0;
color: $mian-color;
font-size: $title-size * 0.8;
font-weight: 400;
padding: 0 30rpx;
}
}
</style>

View File

@@ -1,20 +1,31 @@
<template>
<view>
<block v-if="list.length > 0">
<view class="record--item" v-for="(item, index) in list" :key="index" v-if="item">
<view class="title ellipsis">{{item.hash || '-'}}</view>
<view class="time ellipsis">{{item.block_time || '-'}}</view>
<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.is_in ? 'add': 'remove'">{{item.is_in ? '+': '-'}}{{item.amount}}</view>
<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 === 0' name='no-record' txt="没有任何记录~" />
<no-list v-if='logsType === 2' name='no-in' txt="没有任何收入记录~" />
<no-list v-if='logsType === 1' name='no-out' txt="没有任何支出记录~" />
<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>
@@ -29,7 +40,10 @@
}
},
logsType: {
type:Number
type: String
},
hash: {
type: Boolean
}
},
data() {
@@ -41,11 +55,16 @@
</script>
<style lang="scss" scoped>
.record--item1 {
padding: $padding 330rpx $padding 0 !important;
}
.record--item {
padding: $padding 320rpx $padding 0;
border-bottom: solid 1rpx $border-color;
padding: $padding 220rpx $padding 0;
border-bottom: solid 1rpx #f7f7f7;
position: relative;
min-height: 50rpx;
.variation {
position: absolute;
right: 0;
@@ -54,29 +73,45 @@
width: 300rpx;
text-align: right;
font-weight: bold;
&>label {
font-size: 80%;
}
.symbol {
color: $mian-color;
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: $title-size-m;
color: $mian-color;
font-size: 26rpx;
color: #999;
padding-top: 6rpx;
}
}
// 数据空
.record--null {
padding-top: $padding * 3;
@@ -86,6 +121,7 @@
height: 50vh;
box-sizing: border-box;
line-height: 60rpx;
image {
width: 168rpx;
}

View 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, $mian-color,$mian-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: $mian-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: $mian-color;
padding: 10rpx 30rpx;
border-radius: 40rpx;
margin-left: 20rpx;
margin-top: 20rpx;
}
}
</style>

View File

@@ -0,0 +1,290 @@
<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:#ee4c47;" v-if="listType == 'deliver'">{{item.state_text}}
</view>
<view class="status" style="color:#ee4c47;" 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: 'storeExamine', 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});
},
goDetail(id){
this.$emit('navDetail', {id: id})
}
}
}
</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: $mian-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: $mian-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: $mian-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>

BIN
components/v-tabs/.DS_Store vendored Normal file

Binary file not shown.

182
components/v-tabs/readme.md Normal file
View 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. 属性高度可配置
## 预览
![v-tabs 2.0.1.gif](https://tva1.sinaimg.cn/large/007S8ZIlgy1ghsv40mj76g30ai0i2tsd.gif)
![v-tabs 2.0.2.gif](https://img-cdn-aliyun.dcloud.net.cn/stream/plugin_screens/42f3a920-a674-11ea-8a24-ffee00625e2e_1.png?v=1597912963)

View File

@@ -0,0 +1,339 @@
<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: 1993 }"
>
<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 }}
</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>

View File

@@ -0,0 +1,355 @@
<template>
<view class="wrapper" v-show="isShowMask">
<transition name="content">
<view class="content_view" v-show="isShow">
<view class="title_view">
<view class="title">请选择所在地区</view>
<view class="close_view" @click="hidden">
<icon class="close_icon" :type="'clear'" size="26" />
</view>
</view>
<view class="select_top">
<view class="select_top_item" ref="select_top_item" v-for="(item,index) in dataList" :key="index"
@click="select_top_item_click(index)">
<text class="address_value">{{item.name || '请选择'}}</text>
<view :class="index === currentIndex?'indicator':'no-indicator'" ref="indicator"></view>
</view>
</view>
<swiper class="swiper" :current="currentIndex" @change="swiperChange">
<swiper-item v-for="(swiper_item,swiper_index) in dataList" :key="swiper_index">
<view class="swiper-item">
<scroll-view class="scroll-view-item" scroll-y="true">
<view class="address_item" v-for="(item,index) in cityAreaArray[swiper_index]" :key="index"
@click="address_item_click(swiper_index,index)">
{{item.name}}
<uni-icons class="address_item_icon" v-if="selectIndexArr[swiper_index] === index"
type="checkmarkempty" color="#009b69"></uni-icons>
</view>
</scroll-view>
</view>
</swiper-item>
</swiper>
</view>
</transition>
<view class="mask" @click="hidden" v-show="isShowMask"></view>
</view>
</template>
<script>
import cityData from '../../static/yixuan-selectAddress/city.json'
export default {
data() {
return {
isShow: false,
isShowMask: false,
dataList: ['请选择'],
currentIndex: 0,
cityData: {}, // 省市区对象
cityAreaArray: [], // 省市区数组
selectIndexArr: [], // 省市区index
indicatorStyleLeft: 16
};
},
props: {
addressIdList: {
type: Array
}
},
methods: {
show() {
this.isShow = true
this.isShowMask = true
},
hidden() {
this.isShow = false
setTimeout(() => {
this.isShowMask = false
}, 500);
},
select_top_item_click(index) {
console.log('select_top_item_click')
this.currentIndex = index
this.$nextTick(() => {
this.changeIndicator(index)
})
},
swiperChange(event) {
let index = event.detail.current
this.currentIndex = index
this.changeIndicator(index)
},
changeIndicator(index) {
let indicatorWidth = 30
const query = uni.createSelectorQuery().in(this);
let arr = query.selectAll('.select_top_item .address_value')
arr.fields({
size: true,
scrollOffset: false
}, data => {
let itemWidth = data[index]["width"] > 80 ? 70 : data[index]["width"]
let itemCenterX = 10 + index * 80 + itemWidth / 2
let left = itemCenterX - indicatorWidth / 2
// console.log('changeIndicator',itemWidth,index)
this.indicatorStyleLeft = left
}).exec();
},
address_item_click(swiper_index, index) {
this.selectIndexArr.splice(swiper_index, 5, index)
//判断当前是否为最下一级
if (swiper_index === 0) { //第一级
let currentObj = this.cityData[index]
let city = {
name: currentObj.name,
id: currentObj.region_id
}
console.log(city)
this.dataList.splice(swiper_index, 5, city)
this.dataList.splice(swiper_index + 1, 0, '请选择')
this.cityAreaArray.splice(swiper_index + 1, 1, currentObj["city"])
console.log(this.cityAreaArray)
setTimeout(() => {
this.currentIndex = 1
this.changeIndicator(1)
}, 50);
} else {
let currentAreaArray = this.cityAreaArray[swiper_index]
let currentObj = currentAreaArray[index]
let area = currentObj["area"]
console.log(currentAreaArray)
if (area !== undefined) {
let city = {
name: currentObj.name,
id: currentObj.region_id
}
this.dataList.splice(swiper_index, 5, city)
this.dataList.splice(swiper_index + 1, 0, '请选择')
this.cityAreaArray.splice(swiper_index + 1, 1, currentObj["area"])
setTimeout(() => {
this.currentIndex = swiper_index + 1
this.changeIndicator(swiper_index + 1)
}, 50);
} else { //是最下一级
let city = {
name: currentObj.name,
id: currentObj.region_id
}
this.dataList.splice(swiper_index, 1, city)
//选择成功返回数据
this.$emit("selectAddress", this.dataList)
this.$nextTick(() => {
this.changeIndicator(swiper_index)
})
setTimeout(() => {
this.isShow = false
}, 100);
setTimeout(() => {
this.isShowMask = false
}, 500);
}
}
}
},
created() {
this.cityData = cityData
this.cityAreaArray.push(cityData)
if (this.addressIdList.length > 0) {
const privinceId = this.addressIdList[0] // 省份id请求接口返回
const cityId = this.addressIdList[1] // 城市id请求接口返回
const areaId = this.addressIdList[2] // 区域id请求接口返回
const privince = cityData // 省份数组
let city = [] // 城市数组
let area = [] // 区域数组
let cityAreaArray = []
let selectIndexArr = []
let dataList = []
let pIndex = privince.findIndex((item) => item.region_id === privinceId) // 省份的id
cityAreaArray.push(privince)
selectIndexArr.push(pIndex)
dataList.push(privince[pIndex])
city = privince[pIndex].city
let cIndex = city.findIndex((item) => item.region_id === cityId) // 城市的id
cityAreaArray.push(city)
selectIndexArr.push(cIndex)
dataList.push(city[cIndex])
area = city[cIndex].area
let aIndex = area.findIndex((item) => item.region_id === areaId) // 城市的id
cityAreaArray.push(area)
selectIndexArr.push(aIndex)
dataList.push(area[aIndex])
this.cityAreaArray = cityAreaArray
this.selectIndexArr = selectIndexArr
this.dataList = dataList
this.$emit("selectAddress", this.dataList)
}
}
}
</script>
<style lang="scss">
// 不换行
@mixin no-wrap() {
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
}
.wrapper {
z-index: 1999;
position: absolute;
top: -44px;
left: 0;
bottom: 0;
right: 0;
.content_view {
z-index: 999;
background: white;
position: absolute;
height: 60%;
left: 0;
bottom: 0;
right: 0;
border-top-left-radius: 20px;
border-top-right-radius: 20px;
.title_view {
height: 120rpx;
display: flex;
justify-content: center;
align-items: center;
padding: 0 $uni-spacing-row-sm;
position: relative;
border-bottom: solid 1rpx #f8f8f8;
.title {
font-size: uni-font-size-sm;
}
.close_view {
height: 60px;
width: 60px;
display: flex;
justify-content: center;
align-items: center;
position: absolute;
right: 0;
}
}
.select_top {
height: 8%;
display: flex;
justify-content: flex-start;
align-items: center;
padding: 0 20rpx 0 20rpx;
position: relative;
margin: 30rpx 0 50rpx 0;
box-sizing: border-box;
.select_top_item {
max-width: 33.33%;
float: left;
font-size: $title-size - 1;
color: $text-price;
text-align: left;
@include no-wrap();
margin-right: $margin*1;
// display: flex;
// flex-direction: column;
// justify-content: center;
// align-items: center;
// box-sizing: border-box;
}
.indicator {
width: 30px;
height: 2px;
margin-top: 20rpx;
background: $text-price;
transition: left 0.5s ease;
}
.no-indicator {
background: #fff;
width: 30px;
height: 2px;
margin-top: 20rpx;
transition: left 0.5s ease;
}
}
.swiper {
height: 70%;
position: relative;
left: 0;
top: 0;
bottom: 0;
right: 0;
.swiper-item {
height: 100%;
.scroll-view-item {
height: 100%;
padding: 0 10px;
.address_item {
padding: $padding*1.5 0;
border-bottom: solid 0.2rpx #f7f7f7;
font-size: $title-size - 1;
display: flex;
align-items: center;
.address_item_icon {
margin-left: 20rpx;
// width: 20px;
// height: 20px;
// margin-right: 10px;
}
}
}
}
}
}
.mask {
position: absolute;
top: 0;
left: 0;
bottom: 0;
right: 0;
background: $uni-text-color-grey;
opacity: 0.7;
}
}
.content-enter {
transform: translateY(100%);
}
.content-enter-to {
transform: translateY(0%);
}
.content-enter-active {
transition: transform 0.5s;
}
.content-leave {
transform: translateY(0%);
}
.content-leave-to {
transform: translateY(100%);
}
.content-leave-active {
transition: transform 0.5s;
}
</style>

View File

@@ -1,14 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0" />
<title></title>
<!--preload-links-->
<!--app-context-->
</head>
<body>
<div id="app"><!--app-html--></div>
<script type="module" src="/main.js"></script>
</body>
</html>

View File

@@ -1,23 +1,10 @@
{
"name" : "BlockChainH5",
"name" : "链商星球",
"appid" : "__UNI__1F65101",
"description" : "",
"versionName" : "1.0.0",
"versionCode" : "100",
"description" : "安徽星煌,链商星球商家工具",
"versionName" : "1.2.1",
"versionCode" : 121,
"transformPx" : false,
"h5" : {
"title" : "链商星球",
"router" : {
"mode" : "history"
},
"sdkConfigs" : {
"maps" : {
"qqmap" : {
"key" : "RY5BZ-7XNKS-IBMO6-637EZ-SMFQE-43FGN"
}
}
}
},
/* 5+App */
"app-plus" : {
"usingComponents" : true,
@@ -29,34 +16,140 @@
"autoclose" : true,
"delay" : 0
},
"safearea" : {
"bottom" : {
"offset" : "none"
}
},
/* */
"modules" : {},
"modules" : {
"OAuth" : {},
"LivePusher" : {},
"VideoPlayer" : {},
"Push" : {},
"Share" : {},
"Payment" : {},
"Geolocation" : {},
"Maps" : {}
},
/* */
"distribute" : {
/* android */
"android" : {
"permissions" : [
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
"<uses-permission android:name=\"android.permission.VIBRATE\"/>",
"<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
"<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.CAMERA\"/>",
"<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>",
"<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
"<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
"<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
"<uses-feature android:name=\"android.hardware.camera\"/>",
"<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_COARSE_LOCATION\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
"<uses-permission android:name=\"android.permission.CAMERA\"/>",
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
"<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
"<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>",
"<uses-permission android:name=\"android.permission.INTERNET\"/>",
"<uses-permission android:name=\"android.permission.MODIFY_AUDIO_SETTINGS\"/>",
"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
"<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
"<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
"<uses-permission android:name=\"android.permission.RECORD_AUDIO\"/>",
"<uses-permission android:name=\"android.permission.VIBRATE\"/>",
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
"<uses-permission android:name=\"android.permission.WRITE_EXTERNAL_STORAGE\"/>",
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
]
},
/* ios */
"ios" : {},
"ios" : {
"privacyDescription" : {
"NSPhotoLibraryUsageDescription" : "上传图片",
"NSPhotoLibraryAddUsageDescription" : "下载图片",
"NSCameraUsageDescription" : "扫描二维码",
"NSLocationAlwaysAndWhenInUseUsageDescription" : "定位您的店铺地址",
"NSRemindersUsageDescription" : "及时通知提醒内容",
"NSLocalNetworkUsageDescription" : "使用您的网络获取服务数据"
}
},
/* SDK */
"sdkConfigs" : {}
"sdkConfigs" : {
"ad" : {},
"payment" : {
"weixin" : {
"__platform__" : [ "ios", "android" ],
"appid" : "wxd8b146e0a37bab50",
"UniversalLinks" : "https://lianshang/app/"
},
"alipay" : {
"__platform__" : [ "ios", "android" ]
}
},
"oauth" : {
"univerify" : {},
"weixin" : {
"appid" : "wxd8b146e0a37bab50",
"appsecret" : "6896afa5d57be13aecaf179c3547a940",
"UniversalLinks" : "https://lianshang/app/"
}
},
"push" : {
"unipush" : {}
},
"share" : {
"weixin" : {
"appid" : "wxd8b146e0a37bab50",
"UniversalLinks" : "https://lianshang/app/"
}
},
"maps" : {
"amap" : {
"appkey_ios" : "450192db4bea0af2f226b8c1e1f7b769",
"appkey_android" : "6ff79685204ba5f14ae2e898e0d3b8a0"
}
},
"geolocation" : {
"amap" : {
"__platform__" : [ "ios", "android" ],
"appkey_ios" : "450192db4bea0af2f226b8c1e1f7b769",
"appkey_android" : "6ff79685204ba5f14ae2e898e0d3b8a0"
}
}
},
"icons" : {
"android" : {
"hdpi" : "unpackage/res/icons/72x72.png",
"xhdpi" : "unpackage/res/icons/96x96.png",
"xxhdpi" : "unpackage/res/icons/144x144.png",
"xxxhdpi" : "unpackage/res/icons/192x192.png"
},
"ios" : {
"appstore" : "unpackage/res/icons/1024x1024.png",
"ipad" : {
"app" : "unpackage/res/icons/76x76.png",
"app@2x" : "unpackage/res/icons/152x152.png",
"notification" : "unpackage/res/icons/20x20.png",
"notification@2x" : "unpackage/res/icons/40x40.png",
"proapp@2x" : "unpackage/res/icons/167x167.png",
"settings" : "unpackage/res/icons/29x29.png",
"settings@2x" : "unpackage/res/icons/58x58.png",
"spotlight" : "unpackage/res/icons/40x40.png",
"spotlight@2x" : "unpackage/res/icons/80x80.png"
},
"iphone" : {
"app@2x" : "unpackage/res/icons/120x120.png",
"app@3x" : "unpackage/res/icons/180x180.png",
"notification@2x" : "unpackage/res/icons/40x40.png",
"notification@3x" : "unpackage/res/icons/60x60.png",
"settings@2x" : "unpackage/res/icons/58x58.png",
"settings@3x" : "unpackage/res/icons/87x87.png",
"spotlight@2x" : "unpackage/res/icons/80x80.png",
"spotlight@3x" : "unpackage/res/icons/120x120.png"
}
}
},
"splashscreen" : {
"androidStyle" : "common",
"iosStyle" : "common"
}
}
},
/* */
@@ -83,3 +176,5 @@
},
"vueVersion" : "2"
}
/* SDK */

View File

@@ -1,30 +0,0 @@
# jweixin-module
微信JS-SDK
## 安装
### NPM
```shell
npm install jweixin-module --save
```
### UMD
```http
https://unpkg.com/jweixin-module/out/index.js
```
## 使用
```js
var jweixin = require('jweixin-module')
jweixin.ready(function(){
// TODO
});
```
## 完整API
>[微信JS-SDK说明文档](https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1421141115)

File diff suppressed because one or more lines are too long

View File

@@ -1,54 +0,0 @@
{
"_from": "jweixin-module",
"_id": "jweixin-module@1.6.0",
"_inBundle": false,
"_integrity": "sha512-dGk9cf+ipipHmtzYmKZs5B2toX+p4hLyllGLF6xuC8t+B05oYxd8fYoaRz0T30U2n3RUv8a4iwvjhA+OcYz52w==",
"_location": "/jweixin-module",
"_phantomChildren": {},
"_requested": {
"type": "tag",
"registry": true,
"raw": "jweixin-module",
"name": "jweixin-module",
"escapedName": "jweixin-module",
"rawSpec": "",
"saveSpec": null,
"fetchSpec": "latest"
},
"_requiredBy": [
"#USER",
"/"
],
"_resolved": "https://registry.npmjs.org/jweixin-module/-/jweixin-module-1.6.0.tgz",
"_shasum": "4a7ea614083e3c9c3f49e2fdc2bb882cfa58dfcd",
"_spec": "jweixin-module",
"_where": "/Users/WebTmm/Desktop/BlockChainH5",
"author": {
"name": "Shengqiang Guo"
},
"bugs": {
"url": "https://github.com/zhetengbiji/jweixin-module/issues"
},
"bundleDependencies": false,
"deprecated": false,
"description": "微信JS-SDK",
"devDependencies": {},
"homepage": "https://github.com/zhetengbiji/jweixin-module#readme",
"keywords": [
"wxjssdk",
"weixin",
"jweixin",
"wechat",
"jssdk",
"wx"
],
"license": "ISC",
"main": "lib/index.js",
"name": "jweixin-module",
"repository": {
"type": "git",
"url": "git+https://github.com/zhetengbiji/jweixin-module.git"
},
"scripts": {},
"version": "1.6.0"
}

View File

@@ -1,19 +1,19 @@
{
"_from": "uni-simple-router",
"_from": "uni-simple-router@^2.0.7",
"_id": "uni-simple-router@2.0.7",
"_inBundle": false,
"_integrity": "sha512-8FKv5dw7Eoonm0gkO8udprrxzin0fNUI0+AvIphFkFRH5ZmP5ZWJ2pvnWzb2NiiqQSECTSU5VSB7HhvOSwD5eA==",
"_location": "/uni-simple-router",
"_phantomChildren": {},
"_requested": {
"type": "tag",
"type": "range",
"registry": true,
"raw": "uni-simple-router",
"raw": "uni-simple-router@^2.0.7",
"name": "uni-simple-router",
"escapedName": "uni-simple-router",
"rawSpec": "",
"rawSpec": "^2.0.7",
"saveSpec": null,
"fetchSpec": "latest"
"fetchSpec": "^2.0.7"
},
"_requiredBy": [
"#USER",
@@ -21,7 +21,7 @@
],
"_resolved": "https://registry.npmjs.org/uni-simple-router/-/uni-simple-router-2.0.7.tgz",
"_shasum": "04e0b5be6cd733a1ecb9d35a3dbe82f27f48204e",
"_spec": "uni-simple-router",
"_spec": "uni-simple-router@^2.0.7",
"_where": "/Users/WebTmm/Desktop/BlockChainH5",
"author": {
"name": "hhyang"

140
package-lock.json generated
View File

@@ -4,10 +4,137 @@
"lockfileVersion": 1,
"requires": true,
"dependencies": {
"jweixin-module": {
"version": "1.6.0",
"resolved": "https://registry.npmjs.org/jweixin-module/-/jweixin-module-1.6.0.tgz",
"integrity": "sha512-dGk9cf+ipipHmtzYmKZs5B2toX+p4hLyllGLF6xuC8t+B05oYxd8fYoaRz0T30U2n3RUv8a4iwvjhA+OcYz52w=="
"ansi-styles": {
"version": "4.3.0",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
"integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
"requires": {
"color-convert": "^2.0.1"
}
},
"braces": {
"version": "3.0.2",
"resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz",
"integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==",
"requires": {
"fill-range": "^7.0.1"
}
},
"chalk": {
"version": "4.1.2",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz",
"integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
"requires": {
"ansi-styles": "^4.1.0",
"supports-color": "^7.1.0"
}
},
"color-convert": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
"integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
"requires": {
"color-name": "~1.1.4"
}
},
"color-name": {
"version": "1.1.4",
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
"integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA=="
},
"enhanced-resolve": {
"version": "5.8.3",
"resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.8.3.tgz",
"integrity": "sha512-EGAbGvH7j7Xt2nc0E7D99La1OiEs8LnyimkRgwExpUMScN6O+3x9tIWs7PLQZVNx4YD+00skHXPXi1yQHpAmZA==",
"requires": {
"graceful-fs": "^4.2.4",
"tapable": "^2.2.0"
}
},
"fill-range": {
"version": "7.0.1",
"resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz",
"integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==",
"requires": {
"to-regex-range": "^5.0.1"
}
},
"graceful-fs": {
"version": "4.2.8",
"resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.8.tgz",
"integrity": "sha512-qkIilPUYcNhJpd33n0GBXTB1MMPp14TxEsEs0pTrsSVucApsYzW5V+Q8Qxhik6KU3evy+qkAAowTByymK0avdg=="
},
"has-flag": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",
"integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ=="
},
"is-number": {
"version": "7.0.0",
"resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz",
"integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng=="
},
"lru-cache": {
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz",
"integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==",
"requires": {
"yallist": "^4.0.0"
}
},
"micromatch": {
"version": "4.0.4",
"resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.4.tgz",
"integrity": "sha512-pRmzw/XUcwXGpD9aI9q/0XOwLNygjETJ8y0ao0wdqprrzDa4YnxLcz7fQRZr8voh8V10kGhABbNcHVk5wHgWwg==",
"requires": {
"braces": "^3.0.1",
"picomatch": "^2.2.3"
}
},
"picomatch": {
"version": "2.3.0",
"resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.0.tgz",
"integrity": "sha512-lY1Q/PiJGC2zOv/z391WOTD+Z02bCgsFfvxoXXf6h7kv9o+WmsmzYqrAwY63sNgOxE4xEdq0WyUnXfKeBrSvYw=="
},
"semver": {
"version": "7.3.5",
"resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz",
"integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==",
"requires": {
"lru-cache": "^6.0.0"
}
},
"supports-color": {
"version": "7.2.0",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
"integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
"requires": {
"has-flag": "^4.0.0"
}
},
"tapable": {
"version": "2.2.1",
"resolved": "https://registry.npmjs.org/tapable/-/tapable-2.2.1.tgz",
"integrity": "sha512-GNzQvQTOIP6RyTfE2Qxb8ZVlNmw0n88vp1szwWRimP02mnTsx3Wtn5qRdqY9w2XduFNUgvOwhNnQsjwCp+kqaQ=="
},
"to-regex-range": {
"version": "5.0.1",
"resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz",
"integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==",
"requires": {
"is-number": "^7.0.0"
}
},
"ts-loader": {
"version": "9.2.6",
"resolved": "https://registry.npmjs.org/ts-loader/-/ts-loader-9.2.6.tgz",
"integrity": "sha512-QMTC4UFzHmu9wU2VHZEmWWE9cUajjfcdcws+Gh7FhiO+Dy0RnR1bNz0YCHqhI0yRowCE9arVnNxYHqELOy9Hjw==",
"requires": {
"chalk": "^4.1.0",
"enhanced-resolve": "^5.0.0",
"micromatch": "^4.0.0",
"semver": "^7.3.4"
}
},
"uni-read-pages": {
"version": "1.0.5",
@@ -28,6 +155,11 @@
"version": "3.6.2",
"resolved": "https://registry.npmjs.org/vuex/-/vuex-3.6.2.tgz",
"integrity": "sha512-ETW44IqCgBpVomy520DT5jf8n0zoCac+sxWnn+hMe/CzaSejb/eVw2YToiXYX+Ex/AuHHia28vWTq4goAexFbw=="
},
"yallist": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz",
"integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A=="
}
}
}

View File

@@ -13,6 +13,7 @@
"author": "web唐明明",
"license": "ISC",
"dependencies": {
"ts-loader": "^9.2.6",
"uni-read-pages": "^1.0.5",
"uni-simple-router": "^2.0.7",
"uview-ui": "^1.8.4",

View File

@@ -1,31 +1,285 @@
{
"pages": [{
"path": "pages/guide/guide",
"style": {
"navigationStyle": "custom",
"navigationBarTextStyle": "white",
"disableScroll": true
}
}, {
"path": "pages/index/index",
"name": "Index",
"aliasPath": "/",
"style": {
"navigationBarTitleText": "发现能量"
"navigationBarBackgroundColor": "#1f1922",
"backgroundColor": "#1f1922",
"navigationStyle": "custom",
"navigationBarTextStyle": "white"
}
}, {
"path": "pages/found/index",
"name": "Found",
"aliasPath": "/found",
"auth": true,
"style": {
"navigationBarTitleText": "发现更多"
"navigationBarTitleText": "发现更多",
"navigationStyle": "custom",
"navigationBarTextStyle": "white"
}
}, {
"path": "pages/equity/index",
"name": "equity",
"style": {
"navigationBarTitleText": "权证商城 购你所想",
"navigationBarTextStyle": "white",
"app-plus": {
"titleNView": {
"backgroundColor": "#8b64fd",
"buttons": [{
"text": "搜索",
"fontSize": "14",
"color": "#fff"
}]
}
}
}
}, {
"path": "pages/equity/search",
"name": "Search",
"auth": true,
"style": {
"navigationBarTitleText": "搜索列表"
}
}, {
"path": "pages/goods/goodsClassify",
"name": "goodsClassify",
"style": {
"navigationBarTitleText": "商品分类",
"navigationBarBackgroundColor": "#FFFFFF",
"app-plus": {
"titleNView": {
"buttons": [{
"text": "全部分类",
"fontSize": "14",
"color": "#8b64fd"
}]
}
}
}
},
{
"path": "pages/goods/lists",
"name": "goodsList",
"style": {
"navigationBarTitleText": "商品列表",
"navigationBarBackgroundColor": "#FFFFFF"
}
},
{
"path": "pages/goods/confirmOrder",
"name": "ConfirmOrder",
"style": {
"navigationBarTitleText": "订单确认页面",
"navigationBarTextStyle": "white",
"navigationBarBackgroundColor": "#8b64fd"
}
},
{
"path": "pages/goods/payStatus",
"name": "PayStatus",
"style": {
"navigationBarTitleText": "支付状态",
"navigationBarTextStyle": "white",
"navigationBarBackgroundColor": "#8b64fd"
}
},
{
"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/user/index",
"name": "User",
"aliasPath": "/user",
"auth": true,
"style": {
"navigationBarTitleText": "节点中心"
"navigationBarTitleText": "节点中心",
"navigationStyle": "custom",
"navigationBarTextStyle": "white",
"app-plus": {
"titleNView": {
"type": "transparent",
"backgroundImage": "linear-gradient(to right, #7c52fc, #976dff)",
"buttons": [{
"text": "\ue601",
"fontSrc": "/static/iconfont.ttf",
"background": "rgba(0,0,0,0)"
}, {
"text": "\ue602",
"fontSrc": "/static/iconfont.ttf",
"background": "rgba(0,0,0,0)"
}]
}
}
}
},
{
"path": "pages/user/order/numberWeight",
"name": "NumberWeight",
"style": {
"navigationBarTitleText": "我的权证",
"navigationBarTextStyle": "white",
"app-plus": {
"titleNView": {
"backgroundImage": "linear-gradient(to right, #7c52fc, #976dff)"
}
}
}
},
{
"path": "pages/user/order/numberWeightInfo",
"name": "NumberWeightInfo",
"style": {
"navigationBarTitleText": "权证详情",
"navigationBarTextStyle": "white",
"app-plus": {
"titleNView": {
"backgroundImage": "linear-gradient(to right, #7c52fc, #976dff)"
}
}
}
},
{
"path": "pages/user/order/servicesOrder",
"name": "ServicesOrder",
"style": {
"navigationBarTextStyle": "white",
"navigationBarTitleText": "已使用服务类订单",
"app-plus": {
"titleNView": {
"backgroundImage": "linear-gradient(to right, #7c52fc, #976dff)"
}
}
}
}, {
"path": "pages/user/order/servicesOrderInfo",
"name": "ServicesOrderInfo",
"style": {
"enablePullDownRefresh": true,
"navigationBarTextStyle": "white",
"navigationBarTitleText": "订单详情",
"app-plus": {
"titleNView": {
"backgroundImage": "linear-gradient(to right, #7c52fc, #976dff)"
}
}
}
},
{
"path": "pages/user/order/mallShipments",
"name": "MallShipments",
"style": {
"navigationBarTitleText": "已经提货",
"navigationBarTextStyle": "white",
"app-plus": {
"titleNView": {
"backgroundImage": "linear-gradient(to right, #7c52fc, #976dff)"
}
}
}
}, {
"path": "pages/user/order/mallShipmentsRefund",
"name": "mallShipmentsRefund",
"style": {
"navigationBarTitleText": "退货申请",
"navigationBarTextStyle": "white",
"app-plus": {
"titleNView": {
"backgroundImage": "linear-gradient(to right, #7c52fc, #976dff)"
}
}
}
}, {
"path": "pages/user/order/mallRefundsInfo",
"name": "MallRefundsInfo",
"style": {
"navigationBarTitleText": "退货申请",
"navigationBarTextStyle": "white",
"app-plus": {
"titleNView": {
"backgroundImage": "linear-gradient(to right, #7c52fc, #976dff)"
}
}
}
}, {
"path": "pages/user/order/logistics",
"name": "Orderlogistics",
"style": {
"navigationBarTitleText": "查看物流",
"navigationBarTextStyle": "white",
"app-plus": {
"titleNView": {
"backgroundImage": "linear-gradient(to right, #7c52fc, #976dff)"
}
}
}
}, {
"path": "pages/user/order/mallShipmentsInfo",
"name": "MallShipmentsInfo",
"style": {
"navigationBarTitleText": "提货单详情页面",
"navigationBarTextStyle": "white",
"app-plus": {
"titleNView": {
"backgroundImage": "linear-gradient(to right, #7c52fc, #976dff)"
}
}
}
},
{
"path": "pages/user/address/list",
"name": "AddressList",
"style": {
"navigationBarTitleText": "地址管理",
"navigationBarTextStyle": "white",
"app-plus": {
"titleNView": {
"backgroundImage": "linear-gradient(to right, #7c52fc, #976dff)"
}
}
}
}, {
"path": "pages/user/address/create",
"name": "AddressCreate",
"style": {
"navigationBarTitleText": "地址新增",
"navigationBarTextStyle": "white",
"app-plus": {
"titleNView": {
"backgroundImage": "linear-gradient(to right, #7c52fc, #976dff)"
}
}
}
},
{
"path": "pages/user/code",
"name": "userCode",
"aliasPath": "/user/code",
"auth": false,
"style": {
"navigationBarTitleText": "邀请好友"
@@ -33,7 +287,6 @@
}, {
"path": "pages/user/help",
"name": "userHelp",
"aliasPath": "/user/help",
"auth": true,
"style": {
"navigationBarTitleText": "帮助中心"
@@ -41,15 +294,13 @@
}, {
"path": "pages/user/partner",
"name": "userPartner",
"aliasPath": "/user/partner",
"auth": true,
"style": {
"navigationBarTitleText": "我的伙伴"
"navigationBarTitleText": "我的粉丝"
}
}, {
"path": "pages/user/clause",
"name": "userClause",
"aliasPath": "/user/clause",
"auth": true,
"style": {
"navigationBarTitleText": "服务条款"
@@ -57,7 +308,6 @@
}, {
"path": "pages/user/followOfficial",
"name": "Official",
"aliasPath": "/user/followOfficial",
"auth": true,
"style": {
"navigationBarTitleText": "关注公众号"
@@ -65,28 +315,32 @@
}, {
"path": "pages/vip/vip",
"name": "vipIndex",
"aliasPath": "/vip",
"style": {
"navigationBarTitleText": "开通节点"
"navigationBarTitleText": "开通节点",
"navigationBarBackgroundColor": "#774ffd",
"navigationBarTextStyle": "white"
}
}, {
"path": "pages/vip/agree",
"name": "vipAgree",
"aliasPath": "/vip/agree",
"style": {
"navigationBarTitleText": "用户协议"
"navigationBarTitleText": "用户协议",
"navigationBarTextStyle": "white",
"app-plus": {
"titleNView": {
"backgroundImage": "linear-gradient(to right, #7c52fc, #976dff)"
}
}
}
}, {
"path": "pages/vip/examine",
"name": "Examine",
"aliasPath": "/vip/examine",
"style": {
"navigationBarTitleText": "提交成功"
}
}, {
"path": "pages/setting/setting",
"name": "setting",
"aliasPath": "/setting",
"auth": true,
"style": {
"navigationBarTitleText": "设置中心"
@@ -94,84 +348,121 @@
}, {
"path": "pages/goods/management",
"name": "goodsManagement",
"aliasPath": "/goods/management",
"style": {
"navigationBarTitleText": "商品权证管理"
"navigationBarTitleText": "商品权证管理",
"app-plus": {
"titleNView": {
"buttons": [{
"text": "发布",
"width": "78px",
"fontSize": "15px",
"color": "#8b64fd"
}]
}
}
}
}, {
"path": "pages/goods/addClassify",
"name": "goodsaddClassify",
"aliasPath": "/goods/add-classify",
"style": {
"navigationBarTitleText": "发布商品类目"
"navigationBarTitleText": "发布权证类目"
}
}, {
"path": "pages/goods/details",
"name": "goodsDetails",
"style": {
"navigationBarTitleText": "权证详情",
"navigationBarTextStyle": "white",
"titleNView": {
"backgroundColor": "#7c52fc",
"type": "transparent",
"buttons": [{
"text": "分享",
"fontSize": "14",
"color": "#fff"
}]
}
}
}, {
"path": "pages/goods/add",
"name": "goodsAdd",
"aliasPath": "/goods/add",
"style": {
"navigationBarTitleText": "商品权证创建"
}
}, {
"path": "pages/goods/goodsAuth",
"name": "goodsAddAuth",
"aliasPath": "/goods/goods-auth",
"style": {
"navigationBarTitleText": "商品权证认证"
}
}, {
"path": "pages/coupons/management",
"name": "couponsManagement",
"aliasPath": "/coupons/management",
"style": {
"navigationBarTitleText": "创建优惠券"
"navigationBarTitleText": "优惠券管理",
"app-plus": {
"titleNView": {
"buttons": [{
"text": "创建",
"width": "78px",
"fontSize": "15px",
"color": "#8b64fd"
}]
}
}
}
}, {
"path": "pages/coupons/add",
"name": "couponsAdd",
"aliasPath": "/coupons/add",
"style": {
"navigationBarTitleText": "创建优惠券"
"navigationBarTitleText": "创建优惠券",
"app-plus": {
"titleNView": {
"buttons": [{
"text": "发布",
"width": "78px",
"fontSize": "15px",
"color": "#8b64fd"
}]
}
}, {
}
}
},
{
"path": "pages/coupons/magDetails",
"name": "couponsDetails",
"aliasPath": "/coupons/mag-details",
"style": {
"navigationBarTitleText": "优惠券详情"
}
}, {
"path": "pages/coupons/selectGoods",
"name": "couponsSelectGoods",
"aliasPath": "/coupons/select-goods",
"style": {
"navigationBarTitleText": "关联产品"
}
}, {
"path": "pages/login/login",
"name": "Login",
"aliasPath": "/login",
"style": {
"navigationBarTitleText": "登录"
"navigationBarTitleText": "登录",
"navigationBarBackgroundColor": "#FFFFFF",
"navigationBarTextStyle": "black"
}
}, {
"path": "pages/login/guide",
"name": "loginGuide",
"aliasPath": "/login/guide",
"style": {
"navigationBarTitleText": "引导页"
}
}, {
"path": "pages/login/agreement",
"name": "agreement",
"aliasPath": "/login/agreement",
"style": {
"navigationBarTitleText": "用户隐藏协议"
}
}, {
"path": "pages/certification/personal",
"name": "Personal",
"aliasPath": "/personal",
"auth": true,
"style": {
"navigationBarTitleText": "个人认证"
@@ -179,7 +470,6 @@
}, {
"path": "pages/setting/aboutUs",
"name": "aboutUs",
"aliasPath": "/setting/about-us",
"auth": true,
"style": {
"navigationBarTitleText": "关于我们"
@@ -187,7 +477,6 @@
}, {
"path": "pages/company/approve",
"name": "companyApprove",
"aliasPath": "/company/approve",
"auth": true,
"style": {
"navigationBarTitleText": "企业认证"
@@ -195,7 +484,6 @@
}, {
"path": "pages/news/index",
"name": "news",
"aliasPath": "/news/index",
"auth": true,
"style": {
"navigationBarTitleText": "消息中心"
@@ -203,7 +491,6 @@
}, {
"path": "pages/news/detail",
"name": "newsDetail",
"aliasPath": "/news/detail",
"auth": true,
"style": {
"navigationBarTitleText": "消息列表"
@@ -211,74 +498,128 @@
}, {
"path": "pages/wallet/property",
"name": "walletProperty",
"aliasPath": "/wallet/property",
"style": {
"navigationBarTitleText": "能量钱包",
"navigationBarTitleText": "通证钱包",
"enablePullDownRefresh": false,
"navigationBarTextStyle": "white"
"navigationBarTextStyle": "white",
"navigationBarBackgroundColor": "#976dff"
}
}, {
"path": "pages/wallet/redProperty",
"name": "walletRedProperty",
"style": {
"navigationBarTitleText": "现金红包",
"enablePullDownRefresh": false,
"navigationBarTextStyle": "white",
"navigationBarBackgroundColor": "#976dff"
}
},
{
"path": "pages/wallet/extract",
"name": "Extract",
"aliasPath": "/wallet/extract",
"style": {
"navigationBarTitleText": "提现能量",
"navigationBarTitleText": "提现通证",
"enablePullDownRefresh": false,
"navigationBarBackgroundColor": "#774ffd",
"navigationBarTextStyle": "white"
"navigationBarTextStyle": "white",
"navigationBarBackgroundColor": "#976dff"
}
},
{
"path": "pages/wallet/extractRed",
"name": "ExtractRed",
"style": {
"navigationBarTitleText": "提现红包",
"enablePullDownRefresh": false,
"navigationBarTextStyle": "white",
"navigationBarBackgroundColor": "#976dff"
}
}, {
"path": "pages/verification/index",
"name": "verificationIndex",
"aliasPath": "/verification/index",
"auth": true,
"style": {
"navigationBarTitleText": "扫码核销"
"navigationBarTitleText": "扫码核销",
"navigationBarTextStyle": "white",
"app-plus": {
"titleNView": {
"backgroundImage": "linear-gradient(to right, #7c52fc, #976dff)"
}
}
}
}, {
"path": "pages/verification/history",
"name": "verificationHistory",
"aliasPath": "/verification/history",
"auth": true,
"style": {
"navigationBarTitleText": "核销记录"
"navigationBarTitleText": "核销记录",
"navigationBarTextStyle": "white",
"app-plus": {
"titleNView": {
"backgroundImage": "linear-gradient(to right, #7c52fc, #976dff)"
}
}
}
}, {
"path": "pages/shop/lists",
"name": "shopLists",
"aliasPath": "/shop/lists",
"auth": true,
"style": {
"navigationBarTitleText": "部门/门店"
"navigationBarTitleText": "门店管理",
"app-plus": {
"titleNView": {
"buttons": [{
"text": "添加",
"width": "78px",
"fontSize": "15px",
"color": "#8b64fd"
}]
}
}
}
}, {
"path": "pages/shop/create",
"name": "shopCreate",
"aliasPath": "/shop/create",
"auth": true,
"style": {
"navigationBarTitleText": "创建部门/门店"
"navigationBarTitleText": "创建门店"
}
}, {
"path": "pages/employees/list",
"name": "employeesList",
"aliasPath": "/employees/list",
"auth": true,
"style": {
"navigationBarTitleText": "员工管理"
"navigationBarTitleText": "员工管理",
"app-plus": {
"titleNView": {
"buttons": [{
"text": "添加",
"width": "78px",
"fontSize": "15px",
"color": "#8b64fd"
}]
}
}
}
}, {
"path": "pages/employees/add",
"name": "employeesAdd",
"aliasPath": "/employees/add",
"auth": true,
"style": {
"navigationBarTitleText": "添加员工"
"navigationBarTitleText": "添加员工",
"app-plus": {
"titleNView": {
"buttons": [{
"text": "保存",
"width": "78px",
"fontSize": "15px",
"color": "#8b64fd"
}]
}
}
}
}, {
"path": "pages/instrument/Spread",
"name": "instrumentSpread",
"aliasPath": "/instrument/spread",
"auth": true,
"style": {
"navigationBarTitleText": "营销推广码"
@@ -286,20 +627,32 @@
}, {
"path": "pages/instrument/basics",
"name": "instrumentBasics",
"aliasPath": "/instrument/basics",
"auth": true,
"style": {
"navigationBarTitleText": "基础信息"
"navigationBarTitleText": "基础信息",
"app-plus": {
"titleNView": {
"buttons": [{
"text": "保存",
"width": "78px",
"fontSize": "15px",
"color": "#8b64fd"
}]
}
}
}
}, {
"path": "pages/wallet/fragment",
"name": "Fragment",
"aliasPath": "/wallet/fragment",
"style": {
"navigationBarTitleText": "能量碎片记录",
"navigationBarTitleText": "贡献值记录",
"enablePullDownRefresh": false,
"navigationBarBackgroundColor": "#774ffd",
"navigationBarTextStyle": "white"
"navigationBarTextStyle": "white",
"app-plus": {
"titleNView": {
"backgroundImage": "linear-gradient(to right, #7c52fc, #976dff)"
}
}
}
},
{
@@ -307,48 +660,172 @@
"style": {
"navigationBarTitleText": "添加银行卡",
"enablePullDownRefresh": false,
"navigationBarBackgroundColor": "#774ffd",
"navigationBarTextStyle": "white"
"navigationBarTextStyle": "white",
"app-plus": {
"titleNView": {
"backgroundImage": "linear-gradient(to right, #7c52fc, #976dff)"
}
}
},
"name": "addBank",
"aliasPath": "/wallet/add-bank"
"name": "addBank"
}, {
"path": "pages/wallet/bankList",
"style": {
"navigationBarTitleText": "银行卡列表",
"enablePullDownRefresh": false,
"navigationBarBackgroundColor": "#774ffd",
"navigationBarTextStyle": "white"
"navigationBarTextStyle": "white",
"app-plus": {
"titleNView": {
"backgroundImage": "linear-gradient(to right, #7c52fc, #976dff)"
}
}
},
"name": "bankList",
"aliasPath": "/wallet/bank/list"
"name": "bankList"
}, {
"path": "pages/wallet/withdrawList",
"style": {
"navigationBarTitleText": "提现记录",
"navigationBarTitleText": "红包提现记录",
"enablePullDownRefresh": false,
"navigationBarBackgroundColor": "#774ffd",
"navigationBarTextStyle": "white"
"navigationBarTextStyle": "white",
"app-plus": {
"titleNView": {
"backgroundImage": "linear-gradient(to right, #7c52fc, #976dff)"
}
}
},
"name": "withdrawList",
"aliasPath": "/wallet/withdraw/list"
"name": "withdrawList"
}, {
"path": "pages/wxAuth/wxAuth",
"name" : "wxAuth",
"aliasPath": "/wechat-auth"
"name": "wxAuth"
}, {
"path": "pages/clearOpen/clearOpen",
"style": {
"navigationBarTitleText": "提现记录",
"enablePullDownRefresh": false
},
"name": "clearOpen",
"aliasPath": "/inside/clear-open"
"name": "clearOpen"
}, {
"path": "pages/market/index",
"name": "Market",
"style": {
"navigationBarTitleText": "转让市场",
"titleNView": {
"backgroundColor": "#FFFFFF",
"buttons": [{
"text": "成交历史",
"fontSize": "14",
"width": "80",
"color": "#555555"
}]
}
}
}, {
"path": "pages/market/logs",
"name": "marketLogs",
"style": {
"navigationBarTitleText": "成交历史",
"navigationBarBackgroundColor": "#FFFFFF"
}
}, {
"path": "pages/market/details",
"name": "marketDetails",
"style": {
"navigationBarTitleText": "转让详情"
}
}, {
"path": "pages/market/goods",
"name": "marketGoods",
"style": {
"navigationBarTitleText": "锚定商品",
"titleNView": {
"backgroundColor": "#FFFFFF",
"type": "transparent"
}
}
}, {
"path": "pages/market/transfer",
"name": "marketTransfer",
"style": {
"navigationBarTitleText": "转让权证",
"backgroundColor": "#FFFFFF"
}
}, {
"path": "pages/market/management",
"name": "marketManag",
"style": {
"navigationBarTitleText": "权证转让管理",
"titleNView": {
"backgroundColor": "#FFFFFF",
"buttons": [{
"text": "转让记录",
"fontSize": "14",
"width": "80",
"color": "#774ffd"
}]
}
}
}, {
"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/store/examine",
"name": "storeExamine",
"style": {
"navigationBarTitleText": "订单审核",
"navigationBarBackgroundColor": "#FFFFFF"
}
}, {
"path": "pages/queue/queue",
"style": {
"navigationBarTitleText": "队列",
"enablePullDownRefresh": false
}
}
],
"globalStyle": {
"navigationStyle": "custom",
"backgroundColor": "#F5F5F5"
"backgroundColor": "#F5F5F5",
"navigationBarBackgroundColor": "#FFFFFF",
"navigationBarTextStyle": "black"
},
"tabBar": {
"borderStyle": "white",
@@ -358,7 +835,7 @@
"spacing": "0",
"height": "60px",
"list": [{
"text": "发现能量",
"text": "发现通证",
"iconPath": "static/tabBar/tabBar_icon_00.png",
"selectedIconPath": "static/tabBar/tabBar_show_00.png",
"pagePath": "pages/index/index"
@@ -367,6 +844,16 @@
"iconPath": "static/tabBar/tabBar_icon_01.png",
"selectedIconPath": "static/tabBar/tabBar_show_01.png",
"pagePath": "pages/found/index"
}, {
"text": "权证商城",
"iconPath": "static/tabBar/tabBar_icon_03.png",
"selectedIconPath": "static/tabBar/tabBar_show_03.png",
"pagePath": "pages/equity/index"
}, {
"text": "转让市场",
"iconPath": "static/tabBar/tabBar_icon_04.png",
"selectedIconPath": "static/tabBar/tabBar_show_04.png",
"pagePath": "pages/market/index"
}, {
"text": "节点中心",
"iconPath": "static/tabBar/tabBar_icon_02.png",
@@ -375,6 +862,7 @@
}]
},
"easycom": {
"nv": "@/uni_modules/pyh-nv/components/pyh-nv/pyh-nv.vue",
"^u-(.*)": "uview-ui/components/u-$1/u-$1.vue"
}
}

View File

@@ -75,7 +75,7 @@
}).then(res=>{
uni.showModal({
title: '提示',
content: '个人认证信息已提交,请耐心等待审核',
content: '个人认证已完成',
showCancel: false,
confirmColor: '#8b64fd',
success: modalRes => {

View File

@@ -7,7 +7,8 @@
<view class="white-box">
<view class="inputs logo">
<label>企业LOGO</label>
<image class="logo-cover" :src="logo.showpath || require('@/static/icons/add-icon.png')" @click="updImg('logo')" mode="aspectFill"></image>
<image class="logo-cover" :src="logo.showpath || require('@/static/icons/add-icon.png')"
@click="updImg('logo')" mode="aspectFill"></image>
</view>
<view class="inputs">
<label>企业名称</label>
@@ -15,7 +16,8 @@
</view>
<view class="inputs">
<label>企业行业</label>
<picker v-if="industry.length > 0" :range="industry" :value="industryIndex" range-key="title" @change="changePicker" data-type="industry">
<picker v-if="industry.length > 0" :range="industry" :value="industryIndex" range-key="title"
@change="changePicker" data-type="industry">
<view class="picker-text nowrap">
{{industry[industryIndex].title}}
<uni-icons class="picker-icon" type="arrowdown"></uni-icons>
@@ -26,12 +28,17 @@
<label>经营类目</label>
<view class="picker-text nowrap" @click="opnePopup">
<block v-if="categorys.length > 0">
<text class="text-item" v-for="(item, index) in category" :key="index" v-if="item.check">{{item.name}}</text>
<text class="text-item" v-for="(item, index) in category" :key="index"
v-if="item.check">{{item.name}}</text>
</block>
<block v-else>选择经营类目</block>
<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="输入法人姓名" />
@@ -46,7 +53,8 @@
</view>
<view class="inputs logo">
<label>营业执照</label>
<image class="license-cover" :src="license.showpath || require('@/static/icons/add-icon.png')" @click="updImg('license')" mode="aspectFill"></image>
<image class="license-cover" :src="license.showpath || require('@/static/icons/add-icon.png')"
@click="updImg('license')" mode="aspectFill"></image>
</view>
<view class="btns">
<button type="default" size="default" @click="submitApplies">提交认证</button>
@@ -60,7 +68,8 @@
<view class="subtitle">请选择经营类目</view>
</view>
<view class="category-flex">
<view class="category-flex-item" :class="{'show' : item.check}" v-for="(item, index) in category" :key="index" @click="item.check = !item.check">{{item.name}}</view>
<view class="category-flex-item" :class="{'show' : item.check}" v-for="(item, index) in category"
:key="index" @click="item.check = !item.check">{{item.name}}</view>
</view>
<view class="btns">
<button type="default" size="default" @click="affirmCategory">确定</button>
@@ -71,8 +80,15 @@
</template>
<script>
import { appliesCreate, applies, appliesInfo, appliesCategory } from '@/apis/interfaces/company'
import { uploads } from '@/apis/interfaces/uploading'
import {
appliesCreate,
applies,
appliesInfo,
appliesCategory
} from '@/apis/interfaces/company'
import {
uploads
} from '@/apis/interfaces/uploading'
export default {
data() {
return {
@@ -93,14 +109,17 @@
industryIndex: 0,
reason: '',
category: [],
categorys : []
categorys: [],
range: "",
is_range: false,
};
},
created() {
// 读取配置信息
appliesCreate().then(res => {
this.industry = res
this.industry = res.industries
this.formType = this.$Route.query.form_type
this.is_range = res.is_range
if (this.formType === 'put') {
appliesInfo().then(formValue => {
for (let val of formValue.categories) {
@@ -108,8 +127,10 @@
this.categorys.push(val.category_id)
}
}
this.range = formValue.range
this.name = formValue.name
this.industryIndex = this.industry.findIndex(val=> val.industry_id === formValue.industry.industry_id)
this.industryIndex = this.industry.findIndex(val => val.industry_id === formValue
.industry.industry_id)
this.category = formValue.categories
this.corporate = formValue.certification.name
this.identity = formValue.certification.idcard
@@ -123,7 +144,7 @@
})
})
} else {
this.getAppliesCategory(res[0].industry_id)
this.getAppliesCategory(res.industries[0].industry_id)
}
}).catch(err => {
uni.showToast({
@@ -158,7 +179,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: '提示',
@@ -225,6 +247,7 @@
<style lang="scss" scoped>
// 内容
.content {
overflow: hidden;
.header {
padding: $padding * 2 0;
box-sizing: border-box;
@@ -241,6 +264,7 @@
text-align: center;
}
}
.white-box {
background-color: white;
border-radius: $radius $radius 0 0;
@@ -263,29 +287,42 @@
font-size: $title-size;
}
input {
width: 100%;
height: 90rpx;
line-height: 90rpx;
font-size: $title-size;
}
textarea{
width: 100%;
padding: 20rpx 0;
line-height: 50rpx;
font-size: $title-size;
}
.picker-text {
position: relative;
padding-right: 90rpx;
line-height: 90rpx;
font-size: $title-size;
.picker-icon {
position: absolute;
right: 0;
top: 0;
}
.text-item {
margin-left: 10rpx;
&:first-child {
margin-left: 0;
}
}
}
}
.logo {
height: $padding + 98;
padding-bottom: $padding;
.logo-cover {
position: absolute;
right: 0;
@@ -295,14 +332,17 @@
background: $border-color-lg;
border-radius: 50%;
}
.license-cover {
@extend .logo-cover;
border-radius: 0;
width: 131rpx;
}
}
.btns {
padding-top: $padding * 2;
button {
background: $mian-color;
border-radius: 0;
@@ -310,23 +350,28 @@
line-height: 90rpx;
font-size: $title-size;
color: white;
&::after {
border: none;
}
}
}
}
// 经营类目
.category-popup {
background: #F5F5F5;
padding: 0 $padding * 2 $padding * 2 $padding * 2;
.header {
padding-bottom: $padding;
}
.category-flex {
margin: 0 -10rpx;
display: flex;
flex-wrap: wrap;
.category-flex-item {
margin: 10rpx;
background: white;
@@ -335,14 +380,17 @@
text-align: center;
font-size: $title-size-m;
@extend .nowrap;
&.show {
color: white;
background-color: $mian-color;
}
}
}
.btns {
padding-top: $padding * 2;
button {
background: $mian-color;
border-radius: 0;
@@ -350,6 +398,7 @@
line-height: 90rpx;
font-size: $title-size;
color: white;
&::after {
border: none;
}

View File

@@ -113,9 +113,6 @@
<label>使用规则</label>
<textarea :maxlength="-1" v-model="description" placeholder="输入使用规则说明" />
</view>
<view class="add-btn ios-bottom">
<button type="default" @click="updComponent">发布优惠券</button>
</view>
</view>
</template>
@@ -159,6 +156,9 @@
})
this.coupongoods = this.$store.getters.getCoupongoods
},
onNavigationBarButtonTap() {
this.updComponent()
},
methods:{
// 发券数量
quantityChange(value){
@@ -225,7 +225,6 @@
days : this.timeNumber,
goodsable_ids : this.coupongoods
}
console.log(valuss.time_type)
pushCoupons(valuss).then(res => {
uni.showModal({
title : '提示',
@@ -250,21 +249,6 @@
</script>
<style lang="scss" scoped>
.add-btn{
padding: $padding;
button{
height: 90rpx;
line-height: 90rpx;
background: $text-price;
color: white;
font-size: $title-size;
font-weight: bold;
border-radius: 0;
&::after{
border: none;
}
}
}
// 优惠券详情
.add-textarea{
background: white;
@@ -365,7 +349,7 @@
.cover{
position: relative;
border-right: dashed 3rpx $border-color;
width: 148rpx;
width: 218rpx;
text-align: center;
.cover-img{
width: 148rpx;
@@ -411,7 +395,7 @@
}
.mian{
justify-content: center;
width: calc(100% - 148rpx - #{$padding*2});
width: calc(100% - 218rpx);
box-sizing: border-box;
@extend .vertical;
.title{

View File

@@ -20,7 +20,7 @@
</view>
<view class="info-item" v-if="details.type.value === 2">
<view class="info-item-title">满减</view>
<view class="info-item-text">{{details.price}}{{details.full}}</view>
<view class="info-item-text">{{details.full}}{{details.price}}</view>
</view>
<view class="info-item">
<view class="info-item-title">券发放量</view>
@@ -156,7 +156,7 @@
line-height: 70rpx;
width: 50%;
text-align: center;
color: $text-price;
color: $mian-color;
font-size: $title-size-lg;
font-weight: bold;
border-right: solid 1rpx $border-color;

View File

@@ -25,7 +25,6 @@
</view>
<image v-else class="cover-img" :src="item.cover" mode="aspectFill" />
</view>
<view class="item mian">
<view class="title nowrap">{{item.title}}</view>
<view class="time nowrap">
@@ -48,9 +47,6 @@
<no-list name='no-counpon' txt="没有任何相关优惠券~" />
</view>
</block>
<view class="basisc-btn">
<button class="btn" type="default" @click="$Router.push({name: 'couponsAdd'})">添加优惠券</button>
</view>
</view>
</template>
@@ -68,6 +64,9 @@
onShow() {
this.getCoupons()
},
onNavigationBarButtonTap() {
this.$Router.push({name: 'couponsAdd'})
},
methods:{
// 选择类型
onTabs(value){
@@ -87,7 +86,6 @@
type : this.listType,
status : this.tabsType
}).then(res => {
console.log(res)
this.coupons = res.lists.data
this.pages = res.lists.page
}).catch(err => {
@@ -102,34 +100,6 @@
</script>
<style lang="scss" scoped>
.basics-content{
padding-bottom: ($padding*3) + 90;
}
// 按钮组
.basisc-btn{
position: fixed;
bottom: 0;
left: 0;
right: 0;
padding: $padding;
background: white;
box-shadow: 0 0 4rpx 4rpx rgba($color: #000000, $alpha: .02);
.btn {
background: $mian-color;
color: white;
border-radius: 0;
font-size: $title-size-lg;
line-height: 88rpx;
height: 88rpx;
&::after {
border: none;
}
&[disabled] {
background: rgba($color: $mian-color, $alpha: .6);
}
}
}
// tabs
.header{
position: fixed;
@@ -148,8 +118,8 @@
height: 60rpx;
line-height: 60rpx;
&.show{
color: $text-price;
border-bottom: solid 4rpx $text-price;
color: $mian-color;
border-bottom: solid 4rpx $mian-color;
}
}
}
@@ -168,8 +138,8 @@
margin-right: $margin/2;
color: $text-gray;
&.show{
background-color: rgba($color: $text-price, $alpha: .1);
color: $text-price;
background-color: rgba($color: $mian-color, $alpha: .1);
color: $mian-color;
}
}
}
@@ -207,7 +177,7 @@
.cover{
position: relative;
border-right: dashed 3rpx $border-color;
width: 148rpx;
width: 218rpx;
text-align: center;
.cover-img{
width: 148rpx;
@@ -253,7 +223,7 @@
}
.mian{
justify-content: center;
width: calc(100% - 148rpx - #{$padding*2});
width: calc(100% - 218rpx);
box-sizing: border-box;
@extend .vertical;
.title{

View File

@@ -55,10 +55,6 @@
</view>
</checkbox-group>
</view>
<!-- 按钮 -->
<view class="basisc-btn">
<button class="btn" size="default" @click="onAddEmployees">{{type === 'PUT' ? '修改': '添加'}}</button>
</view>
</view>
</template>
@@ -84,6 +80,12 @@
isPosition : false
};
},
onNavigationBarButtonTap() {
this.onAddEmployees()
// <view class="basisc-btn">
// <button class="btn" size="default" @click="onAddEmployees">{{type === 'PUT' ? '修改': '添加'}}</button>
// </view>
},
created() {
if(this.$Route.query.type === 'PUT'){
this.type = 'PUT'
@@ -93,16 +95,8 @@
}
employeesConfig().then(res => {
this.section = res.store
console.log(res)
if(this.$Route.query.type === 'PUT'){
console.log(111)
employeesInfo(this.$Route.query.id).then(res => {
console.log(11111)
console.log(res)
let permissionIds = []
for(let val of res.permission){
if(val.check){
@@ -225,8 +219,6 @@
}
.content{
// min-height: 100vh;
padding-bottom: ($padding*3) + 90;
@extend .ios-bottom;
.title{
padding: ($padding/2) $padding;

View File

@@ -1,9 +1,5 @@
<template>
<view class="ios-bottom" v-if="!loding">
<view class="header-flex">
员工数量 {{total}}
<view class="add-btn" @click="addEmployees">添加员工</view>
</view>
<!-- 员工列表 -->
<uni-collapse v-if="lists.length > 0">
<block v-for="(listItem, listIndex) in lists" :key="listIndex">
@@ -25,7 +21,8 @@
<view class="content">
<view class="nickname nowrap">{{item.name}}<text>{{item.job}}</text></view>
<view class="job nowrap">
<text v-for="(permissionItem, permissionIndex) in item.permission" :key="permissionIndex">{{permissionItem}}</text>
<text v-for="(permissionItem, permissionIndex) in item.permission" :key="permissionIndex" v-if="permissionIndex < 3">{{permissionItem}}</text>
<text v-if="item.permission.length > 3">{{item.permission.length}}项权限</text>
</view>
</view>
</view>
@@ -59,13 +56,14 @@
text : '编辑',
type : 'PUT',
style : {
backgroundColor: '#8b64fd'
color: '#8b64fd',
backgroundColor: '#eff4f2'
}
},{
text : '删除',
type : 'DELETE',
style : {
backgroundColor: '#e93340'
backgroundColor: '#ee4c47'
}
}]
};
@@ -77,6 +75,9 @@
this.loding = false
})
},
onNavigationBarButtonTap() {
this.$Router.push({name: 'employeesAdd'})
},
methods:{
// 编辑,删除
onEmployees(e, upIndex, index){
@@ -159,7 +160,7 @@
position: absolute;
top: $padding - 10;
left: $padding;
background: $text-price;
background: $mian-color;
color: white;
height: 88rpx;
width: 88rpx;

524
pages/equity/index.vue Normal file
View File

@@ -0,0 +1,524 @@
<template>
<view>
<view class="header-back">
<!-- 轮播图 -->
<view class="banner">
<swiper class="banner-swiper" indicator-color="#8b64fd" indicator-active-color="#f8f8f8"
indicator-dots autoplay>
<swiper-item v-for="(item, index) in banners" :key="index">
<image class="cover" :src="item.cover" mode="aspectFill" @click="swiperClick(item.url)" />
</swiper-item>
</swiper>
</view>
<!-- 分类 -->
<view class="classify">
<view class="classify-item" v-for="(item, index) in classify" :key="index"
@click="onClassify(item.category_id,item.name)">
<image class="cover" :src="item.cover" mode="aspectFill"></image>
<view class="title">{{item.name}}</view>
</view>
<view class="classify-item" @click="onClassify('','全部')">
<image class="cover" src="../../static/icons/equity_nav.png" mode="aspectFill"></image>
<view class="title">查看全部</view>
</view>
</view>
<!-- 每日推荐 -->
<view class="block-title">
<view class="title">
每日推荐<text>链商精选 推荐好物</text>
</view>
</view>
<view class="goods-push" v-if="JSON.stringify(position) != '{}'">
<view class="itme item-mian" @click="onGoods(position.one)">
<image class="cover" :src="position.one.cover" mode="aspectFill"></image>
<view class="title">
<span class='is_allow_values' v-if='position.one.specal_tags.is_allow_values'>{{position.one.specal_tags.is_allow_values}}</span>
{{position.one.name}}
</view>
<view class="price"><text>¥</text>{{position.one.original_price}}
<span style='font-size: 26rpx;color: #555;font-weight: normal;padding-left: 10rpx;' v-if='position.one.price.pv>0'>
+ <span>{{position.one.price.pv}}</span><image style="width: 20rpx;" src="/static/icons/crystal-icon.png" mode="widthFix" />
</span>
</view>
<span class='is_self' v-if='position.one.specal_tags.is_self'>{{position.one.specal_tags.is_self}}</span>
</view>
<view class="itme">
<view class="itme-list" v-for="(item, index) in position.two" :key="index" @click="onGoods(item)">
<image class="cover" :src="item.cover" mode="aspectFill"></image>
<view class="title">{{item.name}}</view>
<view style='font-size: 24rpx;color: #999;font-weight: normal;' v-if='item.price.pv>0'>
+ <span>{{item.price.pv}}</span><image style="width: 22rpx;" src="/static/icons/crystal-icon.png" mode="widthFix" />
</view>
<view class="price" style="font-size: 28rpx;"><text>¥</text>{{item.original_price}}</view>
</view>
</view>
</view>
</view>
<!-- 优惠券 -->
<!-- <view class="block-title">
<view class="title">
限时抢购<text>海量商家优惠券</text>
</view>
<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">
<view class="content">
<view class="coupons-title">
<view class="coupons-title-tips" v-if="item.type">
<!-- value == 1服务券 value == 2代金券 value == 3提货券 -->
<image v-if="item.type.value == '1'" class="coupons-title-icon"
src="../../static/icons/equity_coupons_01.png" mode="aspectFill"></image>
<image v-else-if="item.type.value == '2'" class="coupons-title-icon"
src="../../static/icons/equity_coupons_02.png" mode="aspectFill"></image>
<image v-else-if="item.type.value == '3'" class="coupons-title-icon"
src="../../static/icons/equity_coupons_03.png" mode="aspectFill"></image>
</view>
<view class="coupons-title-name">
{{item.title}}
</view>
</view>
<view class="sun-text">{{item.title}}</view>
</view>
<view class="logo">
<image class="logo-img" :src="item.cover" mode="aspectFill"></image>
</view>
<button class="btn" :disabled="!item.can.get"
@click="onCoupons('get', item.coupon_id, index)">{{item.can.get ? '立即领取' : '已领取'}}</button>
</view>
</view>
<view class="block-title">
<view class="title">
优选商品<text>海量商家商品优选</text>
</view>
</view>
<!-- 优选商品 -->
<goods-list :list="goods" priceType="CNY" @on-goods="onGoods">
<template #statistics="good">
<view class="goods-pv">
<block v-if="good.value.price.pv > 0">
+ {{good.value.price.pv}}
<image class="goods-pv-icon" src="/static/icons/crystal-icon.png" mode="widthFix" />
</block>
</view>
</template>
</goods-list>
<!-- 分页 -->
<uni-load-more :status="pageStatus" :iconSize="16"></uni-load-more>
</view>
</template>
<script>
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'
import { config } from '@/apis/index.js'
export default {
comments: {
goodsList,
industryList
},
data() {
return {
// 易货部分
banners: [],
classify: [],
coupons: [],
position: {},
goods: [],
goodsPage: 1,
// 分页
pageStatus: '',
imgUrl: config.apiUrls
};
},
created() {
this.getMall()
},
onNavigationBarButtonTap() {
this.$Router.push({
name: 'Search'
})
},
methods: {
// 点击轮播图
swiperClick(url) {
if (url === 'goBaoDanList') {
uni.navigateTo({
url: 'pages/goods/lists?type=baodan'
})
}
},
// 易货首页
getMall() {
mall().then(res => {
this.classify = res.categories.slice(0, 9)
this.banners = res.banners
this.banners = [...this.banners, {
cover: config.apiUrls + 'images/baodan-banner.png',
url: 'goBaoDanList'
}]
this.coupons = res.coupons
this.position = res.positions
}).catch(err => {
uni.showToast({
title: err.message,
icon: 'none'
})
})
this.getGoods()
},
// 商品列表
getGoods() {
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'
})
},
// 商品详情
onGoods(e) {
this.$Router.push({
name: 'goodsDetails',
params: {
id: e.goods_id
}
})
},
// 易货分类
onClassify(id,name) {
if(id){
uni.navigateTo({
url: `/pages/goods/lists?type=id&id=${id}&name=${name}`
})
}else{
uni.navigateTo({
url: `/pages/goods/goodsClassify`
})
}
},
},
// 下拉加载
onReachBottom() {
if (this.pageStatus == 'more') {
this.pageStatus = 'loading'
this.goodsPage += 1
this.getGoods()
}
}
}
</script>
<style lang="scss" scoped>
// 易货
.header-back {
background-image: linear-gradient(to bottom, white, #f8f8f8);
padding-top: $padding;
// 易货轮播
.banner {
position: relative;
background: white;
margin: 0 $margin;
border-radius: $radius/2;
padding-top: calc(50% - #{$margin * 2});
overflow: hidden;
.banner-swiper {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
.cover {
width: 100%;
height: 100%;
border-radius: $radius/2;
}
}
}
// 分类
.classify {
display: flex;
margin: $margin/2;
flex-wrap: wrap;
.classify-item {
margin: $margin/2;
width: calc(20% - #{$margin});
text-align: center;
position: relative;
.cover {
width: 98rpx;
height: 98rpx;
vertical-align: top;
margin-bottom: $margin/2;
}
.title {
line-height: 40rpx;
font-size: $title-size-sm;
color: $text-gray;
.is_allow_values {
color: #fff;
background-image: linear-gradient(to left,$mian-color,$mian-color-light);
padding: 2rpx 14rpx;
font-size: 20rpx;
text-align: center;
border-radius: 30rpx;
margin-right: 20rpx;
}
}
}
}
}
// 每日推荐
.goods-push {
margin: 0 $margin;
background: white;
border-radius: $radius/2;
display: flex;
.itme {
width: 50%;
}
.item-mian {
width: 50%;
padding: $padding/2;
height: 450rpx;
box-sizing: border-box;
text-align: center;
border-right: solid 1rpx $border-color;
@extend .vertical;
position: relative;
.is_self {
position: absolute;
top: 14rpx;
right: 20rpx;
background-image: linear-gradient(to bottom, #ee4c47, #9e312f);
// background-color: #ee4c47;
box-shadow: 0 4rpx 10rpx 2rpx rgba($color: #000, $alpha: .3);
color: #fff;
font-size: 26;
padding: 2rpx 20rpx 10rpx 20rpx;
border-radius: 0 0 50rpx 50rpx;
}
.title {
font-weight: bold;
font-size: $title-size;
@extend .nowrap;
line-height: 50rpx;
.is_allow_values {
color: #fff;
background-image: linear-gradient(to left,$mian-color,$mian-color-light);
padding: 2rpx 14rpx;
font-size: 20rpx;
text-align: center;
border-radius: 30rpx;
margin-right: 20rpx;
}
}
.price {
color: $text-price;
font-size: $title-size;
font-weight: bold;
line-height: 50rpx;
text {
font-size: 80%;
margin-right: 10rpx;
}
}
.cover {
margin-bottom: 20rpx;
width: 320rpx;
height: 300rpx;
vertical-align: top;
}
}
.itme-list {
position: relative;
padding: 25rpx $padding/2;
padding-left: 150rpx;
height: 150rpx;
box-sizing: border-box;
.title {
font-size: $title-size-lg;
@extend .nowrap;
line-height: 50rpx;
}
.price {
color: $text-price;
font-size: $title-size;
font-weight: bold;
line-height: 40rpx;
text {
font-size: 80%;
margin-right: 10rpx;
}
}
.cover {
position: absolute;
left: $padding/2;
top: $padding/2;
width: calc(150rpx - #{$padding});
height: calc(150rpx - #{$padding});
}
}
}
// 优惠券
.coupons {
display: flex;
flex-wrap: wrap;
margin: -10rpx ($margin - 10rpx);
.coupons-item {
background: white;
width: calc(50% - 20rpx);
margin: 10rpx;
border-radius: $radius/2;
padding: $padding - 10;
box-sizing: border-box;
// display: flex;
align-items: center;
justify-content: space-between;
.content {
width: 100%;
.coupons-title {
font-size: $title-size-lg;
font-weight: 600;
margin-bottom: 10rpx;
line-height: 54rpx;
display: flex;
@extend .nowrap;
.coupons-title-tips {
width: 50rpx;
height: 50rpx;
border-radius: 50%;
overflow: hidden;
background-color: #f5f5f5;
text-align: center;
margin-right: 10rpx;
.coupons-title-icon {
width: 28rpx;
height: 28rpx;
margin: 11rpx;
}
}
}
.sun-text {
font-size: $title-size-sm;
color: $text-gray;
line-height: 54rpx;
@extend .nowrap;
}
.btn {
color: $text-price;
border: solid 1rpx $text-price;
display: inline-block;
font-size: $title-size-sm;
padding: 0 ($padding/2);
height: 45rpx;
line-height: 45rpx;
border-radius: 22rpx;
}
}
.logo {
width: 100%;
padding-top: 70%;
border-radius: 10rpx;
overflow: hidden;
position: relative;
.logo-img {
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
}
}
.btn {
background-color: #faf2dd;
border-radius: 8rpx;
margin-top: 20rpx;
color: #fd5f3c;
text-align: center;
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;
}
}
}
}
// 模块标题
.block-title {
padding: $padding;
display: flex;
justify-content: space-between;
.title {
font-weight: bold;
text {
padding-left: $padding/2;
font-weight: normal;
font-size: $title-size-m;
color: $text-gray;
}
}
.more {
font-size: $title-size-m;
font-weight: normal;
color: $text-gray;
}
}
// 加水晶
.goods-pv{
.goods-pv-icon{
width: 20rpx;
vertical-align: middle;
margin-left: 5rpx;
margin-bottom: 5rpx;
}
}
</style>

321
pages/equity/search.vue Normal file
View File

@@ -0,0 +1,321 @@
<template>
<view v-if="loaded">
<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="onType">
{{goodsType[goodsTypeIndex].name || ''}}
<image class="tabs-item-arrow" src="@/static/icons/search_row.png" mode="" />
</view>
<view class="tabs-item" @click="onTabs">
<span :class="marketType === ''?'':'activess'">{{searchType == 0 ? '价格' : '价格'}}</span>
<image class="icon" mode="widthFix"
:src="require(marketType == 'asc' ? '@/static/icons/market_icon_low.png':marketType == '' ? '@/static/icons/market_icon_null.png': '@/static/icons/market_icon_high.png')" />
</view>
<view class="tabs-item" @click="onPv">
<span :class="pvType === ''?'':'activess'">贡献值</span>
<image class="icon" mode="widthFix"
:src="require(pvType == 'asc' ? '@/static/icons/market_icon_low.png': pvType == '' ? '@/static/icons/market_icon_null.png': '@/static/icons/market_icon_high.png')" />
</view>
<view class="tabs-item" @click="pageUrl">全部分类
<image class="tabs-item-arrow" src="@/static/icons/search_row.png" mode="" />
</view>
</view>
</view>
<view class="lists">
<!-- 优选商品 -->
<goods-list :list="searchArr" priceType="CNY" @on-goods="onGoods">
<template #statistics="good">
<view class="goods-pv">
<block v-if="good.value.price.pv > 0">
+ {{good.value.price.pv}}
<image class="goods-pv-icon" src="/static/icons/crystal-icon.png" mode="widthFix" />
</block>
</view>
</template>
</goods-list>
</view>
<!-- 分页 -->
<uni-load-more :status="pageStatus" :iconSize="16" v-if="searchArr.length > 0" />
</view>
</template>
<script>
import {
searchUrl,
companyCategory,
randgoodsUrl,
shopself
} from '@/apis/interfaces/goods'
export default {
data() {
return {
nameVal: '',
searchArr: [],
marketType: '', // 排序
pvType:'',
categoryArr: [], // 分类数组--企业
companyId: '', // 分类数组--企业id
companyName: '选择行业',
companyShow: false,
goodsType: [],
goodsTypeIndex: 0,
// 分页
pageStatus: '',
page: 1,
loaded:false
}
},
onLoad() {
this.searchType = this.$Route.query.type
this.getShopSelf()
// 商品分类默认关键字 type=0为商品列表; type=1为企业列表
let wechaUrl = '' // 定义接口来源名称
if (this.searchType == '0') wechaUrl = 'mall/randgoods' //商品关键字
if (this.searchType == '1') wechaUrl = 'companies/rand' //商品关键字
randgoodsUrl('mall/randgoods', {
type: 1
}).then(res => {
this.nameVal = res.name
})
// 企业分类数据
if (this.searchType == '1') {
companyCategory().then(res => {
this.categoryArr = res
})
}
},
methods: {
getShopSelf(){
shopself().then(res => {
this.goodsType = res
this.loaded = true
})
},
// 筛选自营和合作企业等条件
onType(e) {
uni.showActionSheet({
itemList: this.goodsType.map((item) => item.name),
success: e => {
if(this.goodsTypeIndex !== e.tapIndex){
this.goodsTypeIndex = e.tapIndex
this.getList()
}
}
});
},
// 商品详情
onGoods(e) {
this.$Router.push({
name: 'goodsDetails',
params: {
id: e.goods_id
}
})
},
// 列表数据
getList() {
searchUrl('mall/goods', {
order_by: this.marketType,
pv:this.pvType,
page: this.goodsPage,
industry_id: this.companyId,
name: this.nameVal,
is_self:this.goodsType[this.goodsTypeIndex].id,
}).then(res => {
if (this.goodsPage === 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.pvType = ''
this.getList()
},
onPv(){
this.pvType = this.pvType == 'asc' ? 'desc' : 'asc'
this.marketType = ''
this.getList()
},
// 商品分类跳转
pageUrl() {
this.$Router.push({
name: 'goodsClassify'
})
}
},
// 下拉加载
onReachBottom() {
if (this.pageStatus == 'more') {
this.pageStatus = 'loading'
this.goodsPage += 1
this.getList()
}
}
}
</script>
<style lang="scss" scoped>
.top {
position: fixed;
top: 0;
//#ifdef H5
top: 100rpx;
//#endif
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: $mian-color;
}
}
.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;
.activess{
color: $mian-color;
}
.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;
}
}
// 加水晶
.goods-pv{
.goods-pv-icon{
width: 28rpx;
vertical-align: middle;
margin-left: 5rpx;
margin-bottom: 5rpx;
}
}
</style>

View File

@@ -1,5 +1,5 @@
<template>
<view class="crystal">
<view>
<!-- 签到成功弹出 -->
<view class="signBack" v-if="sign.signShow"></view>
<view class="signPop" v-if="sign.signShow">
@@ -9,65 +9,80 @@
签到成功
</view>
<view class="signPop-cont-text">
能量碎片<view class="signPop-cont-number">+{{sign.signSuccess}}</view>
贡献值<view class="signPop-cont-number">+{{sign.signSuccess}}</view>
</view>
</view>
</view>
<!-- 签到 -->
<view class="signCont">
<view class="content-title">
每日签到能量碎片多多<image @click="showHelp" class="content-title-img" src="../../static/user/sign_privilege.png" mode="aspectFill"></image>
</view>
<view class="content-title">发现更多</view>
<view class="content-sumite">海量贡献值等你解锁</view>
<view class="sign">
<view class="sign-list" :class="{ active: item.sign }" v-for="(item, index) in sign.signArr" :key="index">
<view class="sign-list" :class="{ active: item.sign }" v-for="(item, index) in sign.signArr"
:key="index">
<view class="sign-tips" v-if="item.sign">
<view class="sign-tips-text">已签</view>
</view>
<block v-if="index == 7">
<image class="sign-list-img" :src="item.sign ? '../../static/user/sign_icon_last_active.png' : '../../static/user/sign_icon_last.png'" mode="aspectFill"></image>
<image class="sign-list-img"
:src="item.sign ? '../../static/user/sign_icon_last_active.png' : '../../static/user/sign_icon_last.png'"
mode="aspectFill"></image>
</block>
<block v-else>
<image class="sign-list-img" :src="item.sign ? '../../static/user/sign_icon_active.png' : '../../static/user/sign_icon.png'" mode="aspectFill"></image>
<image class="sign-list-img"
:src="item.sign ? '../../static/user/sign_icon_active.png' : '../../static/user/sign_icon.png'"
mode="aspectFill"></image>
</block>
<view class="sign-list-day">
{{ item.text }}
</view>
</view>
</view>
<view class="sign-record">再签到{{ sign.nextTask.day }}天额外赠送{{ sign.nextTask.diff }}能量碎片</view>
<view class="sign-record">再签到{{ sign.nextTask.day }}天额外赠送{{ sign.nextTask.diff }}贡献值</view>
</view>
<view class="signBtn">
<block v-if="sign.signCan">
<view class="signBtn-go" @click="signClick" style="cursor:pointer">
签到领取能量碎片
<u-icon name="calendar-fill" color="#333" size="40" />
签到领取贡献值
</view>
</block>
<block v-else>
<view class="signBtn-go" @click="$Router.push({name:'Fragment'})">
能量碎片记录<image class="signBtn-go-icon" src="/static/user/sign_arrow.png" mode="aspectFill"></image>
贡献值记录<image class="signBtn-go-icon" src="/static/user/sign_arrow.png" mode="aspectFill"></image>
</view>
</block>
</view>
<!-- 水晶任务 -->
<view class="task">
<view class="task-liest">
能量碎片任务
贡献值任务
</view>
<block v-for="(item, index) in task" :key="index">
<view class="task-item" v-if="item.rule.name != 'sign_crystal'" @click="JumpUrl(item.url, item.title, item.is_finish)">
<view class="task-item" v-if="item.rule.name != 'sign_crystal'"
@click="JumpUrl(item.url, item.title, item.is_finish)">
<image class="task-icon" :src="item.ico" mode="aspectFill"></image>
<view class="task-title">{{item.title}}</view>
<view class="task-subtitle">{{item.remark}}</view>
<view class="task-label" :class="{'active' : item.is_finish}">{{item.is_finish ? '已完成' : item.tips}}<image @click.stop="showHelp" class="task-label-icon" src="@/static/imgs/user-crystalMark-grey.png"></image></view>
<view class="task-label" :class="{'active' : item.is_finish}">{{item.is_finish ? '已完成' : item.tips}}
<image @click.stop="showHelp" class="task-label-icon"
src="@/static/imgs/user-crystalMark-grey.png"></image>
</view>
</view>
</block>
</view>
</view>
</template>
<script>
import { task, sign, operateSign } from '@/apis/interfaces/crystal'
import { userIndex } from '@/apis/interfaces/user'
import {
task,
sign,
operateSign
} from '@/apis/interfaces/crystal'
import {
userIndex
} from '@/apis/interfaces/user'
export default {
data() {
return {
@@ -84,7 +99,7 @@
tipsContent: '', // 弹出的动态内容
tipsState: false // 弹出的动态状态
},
energyShard : '' // 碎片说明
energyShard: '' // 贡献值说明
}
},
onShow() {
@@ -129,10 +144,10 @@
})
},
// 能量碎片提示信息
// 贡献值提示信息
showHelp() {
uni.showModal({
title: '能量碎片',
title: '贡献值',
confirmColor: '#8b64fd',
content: this.energyShard.description,
showCancel: false
@@ -166,13 +181,17 @@
var type = open.openType;
switch (type) {
case 'switchTab':
this.$Router.pushTab({name: open.path})
this.$Router.pushTab({
name: open.path
})
break;
case 'web':
window.location.href = open.path
break;
case 'navigateTo':
this.$Router.push({name: open.path})
this.$Router.push({
name: open.path
})
break;
}
}
@@ -197,6 +216,7 @@
top: 0;
animation: cssAnimation 0s ease-in 4s forwards;
}
.signPop {
width: 60%;
position: fixed;
@@ -205,6 +225,7 @@
top: 30%;
height: 160px;
animation: cssAnimation 0s ease-in 4s forwards;
.signPop-tips,
.signPop-cont {
position: absolute;
@@ -212,16 +233,20 @@
top: 0;
width: 100%;
}
.signPop-cont {
color: #FFFFFF;
text-align: center;
padding-top: 90px;
.signPop-cont-name {
font-size: 34rpx;
margin-bottom: 10rpx;
}
.signPop-cont-text {
text-align: center;
.signPop-cont-number {
display: inline-block;
color: #ffee4d;
@@ -244,24 +269,37 @@
// 签到
.signCont {
@extend .ios-top;
background: #7c52fc;
color: #FFFFFF;
padding-bottom: 80rpx;
.content-title {
margin-top: 30rpx;
font-size: 40rpx;
padding: 50rpx 45rpx;
padding: ($padding/2) 45rpx 0;
box-sizing: border-box;
display: flex;
font-weight: bold;
.content-title-img {
width: 32rpx;
height: 32rpx;
margin: 12rpx 20rpx;
}
}
.content-sumite {
padding: 0 45rpx 50rpx 45rpx;
font-size: $title-size-sm;
color: rgba($color: white, $alpha: .6);
}
.sign {
margin: 0 0 30rpx;
padding: 0 30rpx;
box-sizing: border-box;
.sign-list {
width: calc(14.28% - 20rpx);
position: relative;
@@ -272,6 +310,7 @@
border-radius: 10rpx;
padding: 20rpx 0;
box-sizing: border-box;
.sign-tips {
position: absolute;
top: -20rpx;
@@ -284,9 +323,11 @@
width: 60rpx;
text-align: center;
border-radius: 6rpx;
.sign-tips-text {
transform: scale(0.85);
}
&::after {
position: absolute;
content: '';
@@ -299,21 +340,26 @@
border-top: 8rpx solid #ef4034;
}
}
.sign-list-img {
width: 38rpx;
height: 38rpx;
margin-bottom: 5rpx;
}
.sign-list-day {
font-size: 24rpx;
}
&.active {
background-color: #ffdb00;
// background-color: #ffdb00;
background-image: linear-gradient(to right, #ffff7f, #ffdb00, #ffff7f);
color: #413e30;
box-shadow: 0 0 20rpx rgba(76,43,177,.3);
box-shadow: 0 0 20rpx 10rpx rgba(0, 0, 0, .2);
}
}
}
.sign-record {
opacity: .8;
padding: 0 40rpx;
@@ -324,20 +370,28 @@
// 签到按钮
.signBtn {
position: relative;
z-index: 1;
padding: 0 40rpx;
box-sizing: border-box;
width: 100%;
text-align: center;
margin-top: -50rpx;
.signBtn-go {
width: 100%;
height: 100rpx;
line-height: 100rpx;
border-radius: 80rpx;
background-color: #f9dc4a;
// background-color: #f9dc4a;
background-image: linear-gradient(to right, #ffff7f, #f9dc4a, #ffff7f);
box-shadow: 0 0 20rpx 10rpx rgba(0, 0, 0, .2);
color: #333333;
font-size: 32rpx;
font-weight: 600;
.u-icon{
margin-right: 20rpx;
}
.signBtn-go-icon {
width: 36rpx;
height: 36rpx;
@@ -348,8 +402,11 @@
// 水晶任务
.task {
padding: 60rpx 30rpx;
margin-top: -50rpx;
padding: 110rpx 30rpx 0;
box-sizing: border-box;
background: white;
.task-liest {
font-weight: bold;
font-size: 34rpx;
@@ -360,9 +417,11 @@
position: relative;
border-bottom: solid 2rpx #F5F5F5;
padding: 30rpx 200rpx 40rpx 90rpx;
&:last-child {
border: none;
}
.task-icon {
position: absolute;
top: 50rpx;
@@ -370,21 +429,25 @@
width: 58rpx;
height: 58rpx
}
.task-title {
font-size: 32rpx;
color: #333;
line-height: 50rpx;
margin-bottom: 10rpx;
}
.task-subtitle {
color: #999;
font-size: 26rpx;
line-height: 30rpx;
text {
font-size: $title-size-sm - 6;
margin-left: $margin/2;
}
}
.task-label {
position: absolute;
right: 0;
@@ -395,9 +458,11 @@
display: -webkit-box;
display: -webkit-flex;
display: flex;
&.active {
color: $text-gray-m;
}
.task-label-icon {
width: 34rpx;
height: 34rpx;

View File

@@ -21,7 +21,6 @@
taskInfo() {
// 领取水晶
thawlog().then(res => {
console.log(res)
}).catch(err => {
uni.showToast({
icon: 'none',

View File

@@ -64,9 +64,9 @@
<input type="digit" v-model="skus_price" placeholder="0.00"/>
<text class="units">{{skus_unit != '' ? '/' + skus_unit : ''}}</text>
</view>
<view class="form-box inputs-flex input-unit">
<label class="form-label">分销佣金</label>
<input type="digit" v-model="skus_charge" placeholder="0.00"/>
<view class="form-box inputs-flex input-unit " style="background-color: #eee9fd;" v-if="skus_price>0">
<label class="form-label">可结算货款 </label>
<input type="digit" :value="percentTotal" :disabled="true" /> <span class='des'>(扣除分佣后预计到账金额)</span>
<text class="units">{{skus_unit != '' ? '/' + skus_unit : ''}}</text>
</view>
</view>
@@ -149,18 +149,31 @@
<!-- 选择店铺 -->
<uni-popup ref="storePopup">
<view class="category-popup">
<block v-if="storesArr.length>0">
<view class="header">
<view class="title">选择店铺</view>
</view>
<view class="category-flex">
<scroll-view class="category-flex" scroll-y="true">
<view class="category-flex-item" :class="{'show' : item.check}" v-for="(item, index) in storesArr" :key="index" @click="item.check = !item.check">
<view class="category-name">{{item.name}}</view>
<view class="category-content">{{item.address}}</view>
</view>
</view>
</scroll-view>
<view class="btns">
<button type="default" size="default" @click="affirmCategory('stores', 'storePopup')">确定</button>
</view>
</block>
<block v-else>
<no-list name="no-shop" txt='您还没有创建店铺~' />
<view class="btns" v-if="storePer">
<button type="default" size="default" @click="$Router.push({name:'shopCreate'})">新建店铺</button>
</view>
<view v-else>
<view class="btns">
<button type="default" size="default">当前没有创建店铺的权限</button>
</view>
</view>
</block>
</view>
</uni-popup>
<!-- 安全区 -->
@@ -191,7 +204,6 @@
skus_price : '', // 销售价格
skus_number : 1, // 易货起购数量
skus_unit : '件', // 规格文字
skus_charge : '', // 分销佣金
skus_stock : '', // 库存
isChange : false, // 是否支持易货
stores : [], // 关联店铺
@@ -201,14 +213,75 @@
{text: '快递', type: 1},
{text: '自提', type: 2}
],
percent:0,// 预结算货款比例
// 配置信息
storesArr : [], // 可选店铺
tags : [], // 可选商品标签
tagsIndex : 0, // 选择标签的下标
servicesArr : [], // 可选服务
type : 1, // 1为商品2为服务
storePer : true,// 默认可以创建门店
shopRefresh: false
};
},
computed:{
percentTotal(){
return (this.percent * this.skus_price).toFixed(2)
}
},
beforeRouteLeave(to, from, next){
if(to.name === 'shopCreate'){
this.shopRefresh = true
}
next()
},
onShow(){
if(this.shopRefresh){
// 编辑状态信息
if(this.$Route.query.type && this.$Route.query.type === 'edit'){
managesGoodsEdit(this.$Route.query.id).then(res => {
let storesArr = res.stores.map(val => {
let check = (res.data.stores.findIndex(obj => obj.store_id === val.store_id)) >= 0
if(check){
stores.push(val.store_id)
}
return {
check,
...val
}
})
this.storesArr = storesArr
this.stores = stores
this.storePer = res.storePer
}).catch(err => {
uni.showToast({
title: err.message,
icon : 'none'
})
})
return
}
// 添加配置信息
managesCreate({
category_cid: this.$Route.query.cid
}).then(res => {
res.stores = res.stores.map(val => {
return {
check: false,
...val
}
})
this.storesArr = res.stores
this.storePer = res.storePer
}).catch(err => {
uni.showToast({
title: err.message,
icon : 'none'
})
})
}
},
created() {
// 编辑状态信息
if(this.$Route.query.type && this.$Route.query.type === 'edit'){
@@ -244,7 +317,6 @@
this.skus_price = res.data.skus[0].price
this.skus_number = res.data.skus[0].number
this.skus_unit = res.data.skus[0].unit
this.skus_charge = res.data.skus[0].charge
this.skus_stock = res.data.skus[0].stock
this.isPostSale = res.data.is_post_sale == 0
this.isChange = res.data.is_change == 0
@@ -253,6 +325,9 @@
this.storesArr = storesArr
this.services = services
this.stores = stores
this.percent = Number(res.percent)
this.storePer = res.storePer
}).catch(err => {
uni.showToast({
title: err.message,
@@ -283,6 +358,8 @@
this.type = res.type
this.categoryId = this.$Route.query.id
this.categoryCid= this.$Route.query.cid
this.percent = Number(res.percent)
this.storePer = res.storePer
}).catch(err => {
uni.showToast({
title: err.message,
@@ -377,7 +454,6 @@
skus_price : this.skus_price,
skus_number : this.skus_number,
skus_unit : this.skus_unit,
skus_charge : this.skus_charge,
skus_stock : this.skus_stock,
is_change : this.isChange ? 0 : 1,
logistic_type: this.logisticArr[this.logisticType].type,
@@ -387,6 +463,7 @@
let submitFund = this.$Route.query.type === 'edit' ? managesGoodsPut(this.$Route.query.id, submitData) : managesGoodsCreate(submitData)
submitFund.then(res => {
uni.setStorageSync('refresh',true)
if(this.type === 2){
uni.showModal({
title : '提示',
@@ -411,11 +488,11 @@
}
if(authRes.confirm){
let goodsId = this.$Route.query.type === 'edit' ? this.$Route.query.id : res
console.log(goodsId)
this.$Router.push({name: 'goodsAddAuth', params: { id: goodsId , type: 'goodsAdd', edit: this.$Route.query.type === 'edit'}})
}
}
})
}).catch(err => {
uni.showToast({
title: err.message,
@@ -469,6 +546,12 @@
}
.input-unit{
padding-right: 200rpx;
.des{
font-size: 26rpx;padding-bottom: 20rpx;display: inline-block;
color: #999;
position: relative;
right: -200rpx;
}
.units{
position: absolute;
right: 0;
@@ -557,7 +640,7 @@
.footer-btn{
border: none;
border-radius: 0;
background: $text-price;
background: $mian-color;
height: 90rpx;
line-height: 90rpx;
font-weight: bold;
@@ -619,7 +702,7 @@
.btns{
padding-top: $padding * 2;
button{
background: $text-price;
background: $mian-color;
border-radius: 0;
height: 90rpx;
line-height: 90rpx;

View File

@@ -62,13 +62,13 @@
&.show{
position: relative;
background: white;
color: $text-price;
color: $mian-color;
font-weight: bold;
&::before{
position: absolute;
height: 40rpx;
width: 5rpx;
background: $text-price;
background: $mian-color;
content: " ";
left: 0;
top: 20rpx;

211
pages/goods/attestation.vue Normal file
View File

@@ -0,0 +1,211 @@
<template>
<view class="GoodsAuthentication">
<view class="authenticationTop">区块链溯源码{{info.token}}</view>
<!-- 商品认证 商品和服务 -->
<view class="authenticationItem">
<view class="authenticationItemTitle">权证认证</view>
<view class="authenticationItemcontent" v-if="info.goods">
<view class="authenticationItemcontentItem" v-if="info.goods.name">
<view class="title">{{info.goods.type ===1 ? '权证名称':'项目名称'}}: </view>
<view class="content">{{info.goods.name || '暂无数据'}}</view>
</view>
<view class="authenticationItemcontentItem" v-if="info.goods.type ===1 && info.goods.batch">
<view class="title">生产批次</view>
<view class="content">{{info.goods.batch || '暂无数据'}}</view>
</view>
<view class="authenticationItemcontentItem" v-if="info.goods.type ===2 && info.goods.category">
<view class="title">项目分类</view>
<view class="content">{{info.goods.category || '暂无数据'}}</view>
</view>
<view class="authenticationItemcontentItem" v-if="info.goods.type ===1 && info.goods.skus[0].unit">
<view class="title">规格</view>
<view class="content">{{info.goods.skus[0].unit || '暂无数据'}}</view>
</view>
<view class="authenticationItemcontentItem" v-if="info.goods.skus[0].stock">
<view class="title">数量</view>
<view class="content">{{info.goods.skus[0].stock || '暂无数据'}}</view>
</view>
<view class="authenticationItemcontentItem" v-if="info.goods.skus[0].price">
<view class="title">售价</view>
<view class="content">{{info.goods.skus[0].price || '暂无数据'}}</view>
</view>
<view class="authenticationItemcontentItem" v-if="info.goods.type ===1 && info.goods.producted_at">
<view class="title">生产日期</view>
<view class="content">{{info.goods.producted_at || '暂无数据'}}</view>
</view>
<view class="authenticationItemcontentItem" v-if="info.goods.expiried_at">
<view class="title">{{info.goods.type ===1?'保质期':'有效期'}}</view>
<view class="content">{{info.goods.expiried_at || '暂无数据'}}</view>
</view>
<view class="authenticationItemcontentItem" v-if="info.goods.type ===1 && info.goods.product_name">
<view class="title">生产厂家</view>
<view class="content">{{info.goods.product_name || '暂无数据'}}</view>
</view>
<view class="authenticationItemcontentItem" v-if="info.goods.type ===1 && info.goods.product_address">
<view class="title">生产地</view>
<view class="content">{{info.goods.product_address || '暂无数据'}}</view>
</view>
<!-- <view class="authenticationItemcontentItem" v-if="info.goods.type ===2 && info.goods.product_name">
<view class="title">供应商</view>
<view class="content">{{info.goods.product_name || '暂无数据'}}</view>
</view> -->
<view class="authenticationItemcontentItem" v-if="info.goods.lisence">
<view class="title">经营许可证</view>
<view class="content">{{info.goods.lisence || '暂无数据'}}</view>
</view>
<view class="authenticationItemcontentItem" v-if="info.goods.cover">
<view class="title">实物照片</view>
<image class="img" v-if="info.goods.cover" :src="info.goods.cover"
@click="priveImg(info.goods.cover)" mode="aspectFill" />
<view class="content" v-else>暂无数据</view>
</view>
</view>
</view>
<!-- 企业认证 商品和服务通用 -->
<view class="authenticationItem">
<view class="authenticationItemTitle">企业认证</view>
<view class="authenticationItemcontent" v-if="info.certification">
<view class="authenticationItemcontentItem" v-if="info.certification.name ">
<view class="title">企业名称</view>
<view class="content">{{info.certification.name || '暂无数据'}}</view>
</view>
<view class="authenticationItemcontentItem" v-if="info.certification.address" >
<view class="title">企业地址</view>
<view class="content">{{info.certification.address || '暂无数据'}}</view>
</view>
<view class="authenticationItemcontentItem" v-if="info.certification.certification.code">
<view class="title">统一信用代码</view>
<view class="content">{{info.certification.certification.code || '暂无数据'}}</view>
</view>
<view class="authenticationItemcontentItem" v-if="info.certification.industry.title">
<view class="title">行业</view>
<view class="content">{{info.certification.industry.title || '暂无数据'}}</view>
</view>
<view class="authenticationItemcontentItem" v-if="info.certification.range">
<view class="title">经营范围</view>
<view class="content">{{info.certification.range || '暂无数据'}}</view>
</view>
<view class="authenticationItemcontentItem" v-if="info.certification.contack">
<view class="title">联系电话</view>
<u-icon name="phone-fill" v-if='info.certification.contack'
@click="call(info.certification.contact)" color="#2979ff" label-color="#2979ff" label-size="26"
:label='info.certification.contact' />
<view class="content" v-else> 暂无数据 </view>
</view>
<view class="authenticationItemcontentItem" v-if="info.certification.certification.license">
<view class="title">营业执照</view>
<image class="img" v-if='info.certification.certification.license'
:src="info.certification.certification.license"
@click="priveImg(info.certification.certification.license)" mode="aspectFill" />
<view class="content" v-else>暂无数据</view>
</view>
</view>
</view>
<!-- 弹窗提示喽 -->
<u-toast ref="uToast" />
</view>
</template>
<script>
import {
managesAttestation
} from '@/apis/interfaces/goods'
export default {
data() {
return {
info: ''
}
},
created() {
managesAttestation(this.$Route.query.id).then(res => {
this.info = res
})
},
methods: {
priveImg(img) {
uni.previewImage({
current: img, // 当前显示图片的http链接
urls: [img] // 需要预览的图片http链接列表
})
},
call(phone) {
uni.makePhoneCall({
phoneNumber: phone,
})
}
}
}
</script>
<style lang="scss" scoped>
page {
background-color: #F7F7F7;
}
.GoodsAuthentication {
padding: 30rpx;
.authenticationTop {
width: 100%;
padding: 20rpx 50rpx;
background-color: $mian-color;
font-size: 26rpx;
color: #fff;
border-radius: 60rpx;
word-break: break-all;
text-align: center;
}
// 商品认证
.authenticationItem {
width: 100%;
min-height: 300rpx;
margin-top: 20rpx;
.authenticationItemTitle {
font-size: 30rpx;
color: #333333;
font-weight: 600;
padding: 30rpx 20rpx;
}
.authenticationItemcontent {
width: 100%;
min-height: 500rpx;
background-color: #fff;
border-radius: 20rpx;
border: solid rgba(200, 38, 0, .05) 6rpx;
box-shadow: 2rpx 2rpx 20rpx 0rpx rgba(200, 38, 0, .051);
padding: 10rpx 20rpx;
.authenticationItemcontentItem {
display: flex;
flex-direction: row;
align-items: flex-start;
justify-content: flex-start;
box-sizing: border-box;
padding: 20rpx 0;
font-size: 24rpx;
.title {
width: 180rpx;
}
.content {
text-overflow: ellipsis;
width: calc(100% - 180rpx);
}
.img {
width: 340rpx;
height: 200rpx;
}
}
}
}
}
</style>

117
pages/goods/chain.vue Normal file
View File

@@ -0,0 +1,117 @@
<template>
<view class="GoodsChain">
<image src="https://e-chain.cnskl.com/storage/imageresource/chain-bg.png" class='chainBg' />
<view class="chain-content">
<view class="chain-center">
<image :src="imgUrl+'images/top_logo.png'" mode="aspectFill" class="logo" />
<view class="name">链商星球区块链溯源证书</view>
<view class="no">区块链溯源证书{{info.token}}</view>
<view class="content">
<view class="con-item">兹证明</view>
<view class="con-item" v-if="info.company">
{{info.company.name}}产品符合溯源规范认证内容如下特授权其产品在链商星球区块链溯源商城出售
</view>
<view class="con-item">交易哈希: {{info.hash}}</view>
<view class="con-item">区块链高度: {{info.height}}</view>
</view>
<view class="date" v-if="info.applied_at">授权时间: {{info.applied_at}}</view>
<view class="date">有效期至: {{info.ended_at}}</view>
<view class="companyInfo">安徽星煌数字科技有限公司</view>
</view>
</view>
<!-- 弹窗提示喽 -->
<u-toast ref="uToast" />
</view>
</template>
<script>
import { managesChain } from '@/apis/interfaces/goods'
import {config} from '@/apis/index.js'
export default {
data() {
return {
info: '',
imgUrl:config.apiUrls
}
},
created() {
managesChain(this.$Route.query.id).then(res=>{
this.info = res
})
},
methods: {}
}
</script>
<style lang="scss" scoped>
page {
background-color: #F7F7F7;
}
.GoodsChain {
background-color:fff;
width: 100%;
position: relative;
z-index: 1;
.chainBg{
position: absolute;
width: 100%;
height: 100%;
z-index: 2;
}
.chain-content{
width: 100%;
min-height: 100%;
z-index: 2;
padding: 18vh 10vw 15vh 10vw ;
box-sizing: border-box;
position: relative;
z-index: 3;
.chain-center{
width: 100%;
min-height: 100%;
.logo{
width: 160rpx;
height: 160rpx;
border-radius: 50%;
position: relative;
margin-left: -80rpx;
left: 50%;
margin-bottom: 20rpx;
border: solid rgba($color: #fff, $alpha: .3) 10rpx;
}
.name{
font-size: 40rpx;
font-weight: bold;
text-align: center;
}
.no{
font-size: 26rpx;
font-weight: bold;
text-align: center;
margin-top: 10rpx;
}
.content{
margin-top: 60rpx;
font-size: 28rpx;
padding: 0 20rpx;
.con-item{
margin-bottom: 30rpx;
word-break: break-all;
}
}
.date{
text-align: right;
margin-bottom: 10rpx;
padding-right: 20rpx;
}
.companyInfo{
text-align: right;
margin-bottom: 40rpx;
padding-right: 20rpx;
}
}
}
}
</style>

View File

@@ -0,0 +1,618 @@
<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='info.stock' @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="pay-icon 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="#8b64fd" size="50"></u-icon>
</view>
<view class="pay-select-item" @click="selectPay('3')">
<view class="pay-left">
<u-icon class="pay-icon al-icon" name="zhifubao" color="#fff" size="40"></u-icon>
<view class="pay-wx-title">
支付宝支付
<span>推荐支付宝用户使用</span>
</view>
</view>
<u-icon v-if="selectTypeId!== '3'" name="checkmark-circle" color="#f7f7f7" size="50"></u-icon>
<u-icon v-else name="checkmark-circle-fill" color="#8b64fd" size="50"></u-icon>
</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="#8b64fd" 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, aliPay, ebPay } from '@/apis/interfaces/order'
export default {
name: 'OrderInfo',
components: {
couponTemplate
},
data() {
return {
amount : 0,
account : {},
total : 0,
shop : {}, // 店铺信息
info : {}, // 商品详情
showCouponList : false, // 默认false不显示优惠券弹窗列表
coupon_grant_id : '', // 默认没有选择任何一个优惠券
list : [], // 优惠券列表
params : {}, // 上个页面携带过来的参数
remark : '', // 备注
order_no : '', // 下单成功的id
selectTypeId : '2', // 微信支付2 支付宝支付3
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.nowPay()
}
}).catch(err => {
uni.showToast({
title: err.message,
icon : 'none'
})
})
},
// 提交订单
order() {
let params = this.params
params.coupon_grant_id = this.coupon_grant_id
params.remark = this.remark
params.channel = 'app'
this.mallBuyGoods(params, 'post')
},
// 触发支付
nowPay() {
let apiUrl = ''
let data = {}
if (this.selectTypeId === '2') {
apiUrl = wxPay
data = {
order_no: this.order_no,
type: 'app'
}
} else if (this.selectTypeId === '3') {
apiUrl = aliPay
data = {
order_no: this.order_no,
type: 'app'
}
}
apiUrl(data).then(res => {
// 不需要支付
if(res.canPay === false){
uni.showModal({
title : '提示',
content : '商品权证兑换成功',
showCancel : false,
success () {
uni.reLaunch({
url: '/pages/goods/payStatus?success=true'
})
}
})
return
}
// 微信支付
if (this.selectTypeId === '2') {
let payInfo = JSON.parse(res)
uni.requestPayment({
provider: "wxpay",
orderInfo: payInfo,
success: res => {
uni.reLaunch({
url: '/pages/goods/payStatus?success=true'
})
},
fail: (err) => {
uni.showToast({
title: '支付被取消',
mask: true,
icon: 'none'
})
}
})
}
// 支付宝支付
else if (this.selectTypeId === '3') {
uni.requestPayment({
provider: "alipay",
orderInfo: res,
success: res => {
uni.reLaunch({
url: '/pages/goods/payStatus?success=true'
})
},
fail: (err) => {
uni.showToast({
title: '支付被取消',
duration: 3000,
mask: true,
icon: 'none'
})
}
})
}
}).catch(err => {
uni.showToast({
title: err.message,
mask: true,
icon: 'none'
})
})
},
// 选择可用优惠券
selectCoupon(item) {
if (this.coupon_grant_id === item.coupon_grant_id) {
this.coupon_grant_id = ''
} else {
this.coupon_grant_id = item.coupon_grant_id
}
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 {
uni.showToast({
title: '当前商品不支持EB支付',
icon : 'none'
})
}
} else if (id === '2') {
this.selectTypeId = id
} else if (id === '3') {
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;
}
}
}
.pay-icon{
border-radius: 10rpx;
padding: 10rpx;
&.wx-icon {
background: #04BE02;
}
&.al-icon {
background: #1678ff;
}
}
}
.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: $mian-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: $mian-color;
margin-right: 30rpx;
font-weight: 600;
font-size: 32rpx;
}
.nowPay {
padding: 20rpx 50rpx;
text-align: center;
box-sizing: border-box;
background-color: $mian-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: $mian-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>

864
pages/goods/details.vue Normal file
View File

@@ -0,0 +1,864 @@
<template>
<view class="content" v-if="!loding">
<!-- 轮播主图 -->
<view class="goods-covers">
<swiper class="swiper" indicator-dots indicator-active-color="#8b64fd">
<block v-if="goodsObj.pictures.length > 0">
<swiper-item v-for="(item, index) in goodsObj.pictures" :key="index">
<image class="swiper-item" :src="item" mode="aspectFill" />
</swiper-item>
</block>
</swiper>
</view>
<!-- 产品详情 -->
<view class="goods-content">
<view class="header">
<view class="flex-box">
<view class="price"><text></text>{{goodsObj.price.show}}</view>
<!-- <view class="sales">累计交易{{goodsObj.sales}}</view> -->
<span style='font-size: 26rpx;color: #999;font-weight: normal;padding-left: 20rpx;' v-if='goodsObj.price.pv>0'>
贡献值:<span>{{goodsObj.price.pv}}</span><image style="width: 20rpx;" src="/static/icons/crystal-icon.png" mode="widthFix" />
</span>
</view>
<view class="coupon" v-if="couponSee.length > 0" @click="couponsOpne">
<view class="coupon-list" v-for="(item, index) in couponSee" :key="index">
<view class="coupon-label">
{{item.title}}
</view>
</view>
<view class="coupon-btn">领券<uni-icons type="arrowright" size="12" color="#e1293f"></uni-icons></image>
</view>
</view>
<view class="title">
<view class="title-hot" v-if="goodsObj.specal_tags.is_allow_values">
{{goodsObj.specal_tags.is_allow_values}}
</view>
<view class="title-hot" v-if="goodsObj.specal_tags.is_self">{{goodsObj.specal_tags.is_self}}</view>
{{goodsObj.name}}
</view>
<!-- <view class="sub-title">{{goodsObj.description}}</view> -->
</view>
<!-- 商家信息 -->
<view class="store">
<image class="logo" :src="goodsObj.shop.cover" mode="aspectFill"></image>
<view class="store-cont">
<view class="store-title">{{goodsObj.shop.name}}</view>
<view class="rate">
<uni-rate :readonly="true" color="#ddd" active-color="#ee4c47" :value="goodsObj.company.star"
:size="14" />
</view>
<view class="openbtn" @click="onOpenWechat">进店<image class="openbtn-img"
src="../../static/icons/equity_arrow_right.png" mode="aspectFill"></image>
</view>
</view>
<view class="tooSee">
<view class="tooSee-label"
@click="$Router.push({name: 'GoodsChain', params: {id: goodsObj.goods_id}})">
区块链证书
<image class="tooSee-label-img" src="../../static/icons/equity_arrow_right.png"
mode="aspectFill"></image>
</view>
<view class="tooSee-label"
@click="$Router.push({name: 'GoodsAttestation', params: {id: goodsObj.goods_id}})">
商品认证
<image class="tooSee-label-img" src="../../static/icons/equity_arrow_right.png"
mode="aspectFill"></image>
</view>
<view class="tooSee-label"
@click="$Router.push({name: 'GoodstracedTo', params: {id: goodsObj.goods_id}})">
权证溯源
<image class="tooSee-label-img" src="../../static/icons/equity_arrow_right.png"
mode="aspectFill"></image>
</view>
</view>
</view>
<!-- 产品规格 -->
<view class="size">
<view class="size-item nowrap">
<label class="title">规格</label>
{{goodsObj.skus[0].goods_name}}
</view>
<view class="size-item nowrap">
<label class="title">说明</label>
特价商品不可与优惠券叠加使用
</view>
<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>
<view class="nowrap goods-serve-name"><text v-for="(item, index) in goodsObj.services" :key='item.service_id'>{{item.name}}</text></view>
<image class="goods-serve-img" src="../../static/icons/goods_spot.png" mode="aspectFill">
</image>
</view>
</view>
</view>
<!-- 产品详情 -->
<view class="product">
<block v-for="(item, index) in goodsObj.content" :key="index">
<image :src="item" mode="widthFix"></image>
</block>
</view>
</view>
<!-- footer -->
<view class="footer">
<button class="btn" size="default" @click="buyGoods">立即购买</button>
</view>
<!-- 优惠券弹出 -->
<uni-popup ref="couponsPopup">
<view class="coupons-popup">
<view class="coupons-header">
<view class="title">优惠券</view>
<image @click="couponsClose" class="close" src="../../static/icons/goods_close.png" mode=""></image>
</view>
<view class="coupons-cont">
<view class="coupons-name">
可领取的优惠券
</view>
<view class="coupons-list" v-for="(item , index) in coupons" :key="index">
<view class="coupons-tips" v-if="item.type">
<!-- value == 1服务券 value == 2代金券 value == 3提货券 -->
<text class="coupons-tips-text" v-if="item.type.value == '1'">服务券</text>
<text class="coupons-tips-text" v-else-if="item.type.value == '2'">代金券</text>
<text class="coupons-tips-text" v-else>提货券</text>
</view>
<view class="coupons-left" v-if="item.type.value == '2'">
<view class="coupons-number">
<text>¥</text>{{item.price}}
</view>
<view class="coupons-full">
满{{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">
提货券
</view>
</view>
<view class="coupons-center">
<view class="nowrap coupons-title">
{{item.title}}
</view>
<view class="coupons-time" v-if="item.time">
{{item.time.interval}}
</view>
</view>
<view v-if="item.can.get" class="coupons-right" @click="drawCoupons(item.coupon_id, index)">
领取
</view>
<view v-else class="coupons-right coupons-right-active">
已领取
</view>
</view>
</view>
<view class="coupons-true" @click="couponsClose">
确定
</view>
</view>
</uni-popup>
<!-- 服务保障弹出 -->
<uni-popup ref="servePopup">
<view class="coupons-popup">
<view class="coupons-header">
<view class="title">保障</view>
<image @click="serveClose" class="close" src="../../static/icons/goods_close.png" mode=""></image>
</view>
<view class="serve-cont">
<view class="serve-label" v-for="(item, index) in goodsObj.services" :key="index">
<view class="serve-label-name">
{{item.name}}
</view>
<view class="serve-label-text">
{{item.content}}
</view>
</view>
</view>
<view class="coupons-true" @click="serveClose">确定</view>
</view>
</uni-popup>
</view>
</template>
<script>
import {
goods,
managesCoupons
} from '@/apis/interfaces/goods'
import userAuth from '@/public/userAuth'
import UniShare from 'uni_modules/uni-share/js_sdk/uni-share.js'
const uniShare = new UniShare()
import {config} from '@/apis/index.js'
export default {
data() {
return {
loding: true,
goodsObj: {},
identity: '',
company: {},
coupons: {},
couponSee: ""
};
},
created() {
goods(this.$Route.query.id).then(res => {
this.loding = false
this.goodsObj = res
this.identity = res.identity.id || ''
this.company = res.company
this.couponSee = res.coupons.slice(0, 3)
this.coupons = res.coupons
})
},
methods: {
// 提交购买单
buyGoods() {
let token = this.$store.getters.getToken
if (token == '') {
this.$Router.push({name: 'Login'})
return
}
uni.navigateTo({
url: '/pages/goods/confirmOrder?qty=1&type=2&goods_sku_id=' + this.goodsObj.skus[0].sku_id
})
},
// 打开微信小程序
onOpenWechat() {
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: this.company.original_id,
path: 'pages/login/guide?scene=index_' + this.company.company_id
})
} else {
uni.showToast({
title: '当前环境不支持打开微信小程序',
icon: 'none'
})
}
})
},
// 领取优惠券
drawCoupons(id,index) {
let token = this.$store.getters.getToken
if (token == '') {
let userLogin = new userAuth()
userLogin.Login()
return
}
managesCoupons(id).then(res => {
uni.showToast({
title: '领取成功',
type: 'primary',
duration: 3000
})
this.coupons[index].can = res.can
}).catch(err => {
uni.showToast({
icon: 'none',
title: err.message
})
})
},
// 选择优惠券-显示
couponsOpne() {
this.$refs.couponsPopup.open('bottom')
},
// 选择优惠券-隐藏
couponsClose() {
this.$refs.couponsPopup.close()
},
// 查看保障服务-显示
serveOpne() {
this.$refs.servePopup.open('bottom')
},
// 查看保障服务-隐藏
serveClose() {
this.$refs.servePopup.close()
},
// 顶部菜单点击了分享功能
onNavigationBarButtonTap() {
let invite = this.goodsObj.user_invite || ''
let goods ='^GoodsId/$-?' + this.goodsObj.goods_id
let shareCode = invite === '' ?goods:invite.slice(0,2) + '$InviTaTiOn$CoDe/$-?' + invite.substring(2)+goods
uniShare.show({
content: {
type: 0,
href: 'https://www.lianshang.vip/app?invite=' + shareCode,
title: '链商星球 共创未来,一起搭建 链商经济的世界~',
summary: '链商星球APP你值得拥有~每日签到领贡献值~',
imageUrl: config.apiUrls+'images/top_logo.png'
},
menus: [{
"img": "/static/icons/payWay_icon_00.png",
"text": "微信好友",
"share": { //当前项的分享参数配置。可覆盖公共的配置如下分享到微信小程序配置了type=5
"provider": "weixin",
"scene": "WXSceneSession"
}
},
{
"img": "/static/icons/share-pyq.png",
"text": "微信朋友圈",
"share": {
"provider": "weixin",
"scene": "WXSenceTimeline"
}
}
],
cancelText: "取消分享",
}, e => {
if(uniShare.isShow){
console.log('shareCode',shareCode)
}
})
}
}
}
</script>
<style lang="scss" scoped>
.content {
position: relative;
padding-top: 100%;
}
// 轮播图
.goods-covers {
position: fixed;
top: 0;
left: 0;
z-index: 1;
width: 100%;
padding-top: 100%;
.swiper {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
.swiper-item {
width: 100%;
height: 100%;
}
}
}
// 商品详情
.goods-content {
position: relative;
z-index: 2;
background-color: white;
border-radius: $radius $radius 0 0;
padding-bottom: calc((#{$padding} * 2) + (env(safe-area-inset-bottom) / 2) + 90rpx);
padding-bottom: calc((#{$padding} * 2) + (constant(safe-area-inset-bottom) / 2) + 90rpx);
// 详情
.header {
padding: 0 $padding $padding;
.title {
font-size: $title-size;
font-weight: bold;
line-height: 50rpx;
.title-hot {
display: inline-block;
background-image: linear-gradient(to left, #fee195, #fee195);
font-size: 24rpx;
border-radius: 50rpx;
padding: 0 10rpx;
height: 34rpx;
line-height: 36rpx;
margin: 6rpx 10rpx 0 0;
}
}
.sub-title {
line-height: 40rpx;
font-size: $title-size-sm;
color: $text-gray;
padding-bottom: $padding/3;
}
.flex-box {
display: flex;
justify-content: space-between;
line-height: 90rpx;
.price {
font-weight: bold;
color: $text-price;
font-size: $title-size + 14;
text {
font-size: 70%;
}
width: calc(60% - #{$padding});
}
.sales {
font-size: $title-size-sm;
color: $text-gray;
width: 40%;
text-align: right;
}
}
// 新增优惠券
.coupon {
background-color: #fef2f2;
color: #e1293f;
border-radius: 8rpx;
border: 1rpx solid #ffe5e5;
padding: $padding - 15;
box-sizing: border-box;
display: flex;
position: relative;
margin-bottom: $margin - 10;
.coupon-list {
font-size: 22rpx;
.coupon-label {
display: inline-block;
border: 1rpx solid #e998a1;
border-radius: 50rpx;
padding: 0 15rpx;
height: 34rpx;
line-height: 34rpx;
margin-right: $margin - 10;
}
}
.coupon-btn {
position: absolute;
right: $padding - 20;
top: 0;
line-height: 60rpx;
font-size: 24rpx;
display: flex;
font-weight: 700;
.coupon-btn-img {
width: 22rpx;
height: 22rpx;
margin: 20rpx 0 0 4rpx;
}
}
}
}
// 新增服务
.goods-serve {
display: flex;
.goods-serve-img {
width: 36rpx;
height: 36rpx;
margin-top: 26rpx;
}
.goods-serve-name {
margin: 0 30rpx 0 20rpx;
width: calc(100% - 122rpx);
text {
padding-right: $padding;
position: relative;
&:last-child {
padding-right: 0;
}
}
}
}
// 店铺
.store {
position: relative;
margin: 0 $margin;
background: #F8F8F8;
border-radius: $radius/2;
padding: $padding;
min-height: 220rpx;
.logo {
position: absolute;
left: $margin;
top: $margin;
width: 98rpx;
height: 98rpx;
border-radius: $radius/2;
}
.store-cont {
position: absolute;
width: 100%;
left: 0;
top: 0;
padding-left: 150rpx;
padding-top: 20rpx;
box-sizing: border-box;
height: 140rpx;
}
.tooSee {
position: absolute;
top: 150rpx;
left: 0;
font-size: 24rpx;
padding-left: $padding;
box-sizing: border-box;
.tooSee-label {
background-color: #fd683e;
border-radius: 8rpx 4rpx 4rpx 6rpx;
color: #FFFFFF;
height: 48rpx;
line-height: 48rpx;
padding: 0 $padding - 15;
box-sizing: border-box;
display: inline-block;
margin-right: $margin * 2;
position: relative;
&::after,
&::before {
content: '';
position: absolute;
}
&::after {
right: -40rpx;
top: 0;
background-color: #f64c37;
width: 40rpx;
height: 100%;
border-radius: 4rpx 8rpx 8rpx 4rpx;
}
&::before {
right: -1rpx;
top: 5%;
border: 1rpx dashed #fb745a;
height: 90%;
z-index: 2;
box-sizing: border-box;
}
&:last-child {
margin: 0;
}
&:first-child {
background-color: #f2d7aa;
color: #362507;
}
&:first-child::after {
background-color: #f1d599;
}
&:first-child::before {
border-color: #fae2b9;
}
.tooSee-label-img {
position: absolute;
right: -34rpx;
top: 12rpx;
width: 28rpx;
height: 28rpx;
z-index: 9;
}
&:first-child .tooSee-label-img {
filter: brightness(.2)
}
}
}
.store-title {
font-size: $title-size-lg;
font-weight: bold;
line-height: 60rpx;
color: $text-color;
margin-bottom: 10rpx;
}
// rate
.openbtn {
position: absolute;
right: $margin - 10;
top: $margin * 3.5;
color: #848484;
height: 60rpx;
line-height: 60rpx;
text-align: center;
font-size: $title-size-m;
margin-top: -30rpx;
display: flex;
.openbtn-img {
width: 32rpx;
height: 32rpx;
filter: brightness(.5);
margin-top: 14rpx;
}
}
}
// 产品规格
.size {
margin-top: $margin;
border-top: solid 20rpx #F8F8F8;
border-bottom: solid 20rpx #F8F8F8;
.size-item {
position: relative;
padding: 0 $padding 0 ($padding + 100);
line-height: 90rpx;
font-size: $title-size-m;
&::after {
position: absolute;
left: $margin;
right: 0;
bottom: 0;
content: " ";
height: 1rpx;
background-color: $border-color;
}
&:last-child::after {
display: none;
}
.title {
position: absolute;
left: $margin;
top: 0;
font-weight: bold;
}
}
}
// 产品详情
.product {
image {
vertical-align: top;
width: 100%;
}
}
}
// 立即购买
.footer {
padding: $padding;
background: white;
position: fixed;
bottom: 0;
left: 0;
width: 100%;
z-index: 99;
box-sizing: border-box;
.btn[size='default'] {
width: 100%;
height: 90rpx;
line-height: 90rpx;
padding: 0;
border-radius: 0;
box-sizing: border-box;
background: $mian-color;
color: white;
font-weight: bold;
font-size: $title-size;
margin-bottom: calc(env(safe-area-inset-bottom) / 2);
margin-bottom: calc(constant(safe-area-inset-bottom) / 2);
}
}
// 优惠券弹出样式
.coupons-popup {
background-color: #FFFFFF;
border-radius: 40rpx 40rpx 0 0;
padding: $padding;
box-sizing: border-box;
.coupons-header {
text-align: center;
position: relative;
margin-bottom: $margin*1.5;
.title {
font-weight: 700;
}
.close {
position: absolute;
right: 0;
top: 0;
z-index: 2;
width: 38rpx;
height: 38rpx;
}
}
.coupons-cont {
.coupons-name {
color: #616065;
font-size: 30rpx;
}
.coupons-list {
border: 2rpx solid #d6b9be;
border-radius: 10rpx;
overflow: hidden;
position: relative;
margin-top: $margin;
// background-color: red;
.coupons-tips {
// background-color: #211e17;
background-image: linear-gradient(to right, #f8e5c0, #d6a46a);
color: #8d4928;
position: absolute;
border-radius: 0 0 20rpx 0;
padding: 0 8rpx;
height: 34rpx;
line-height: 34rpx;
left: 0;
top: 0;
z-index: 10;
.coupons-tips-text {
font-size: 24rpx;
transform: scale(.85);
display: block;
}
}
.coupons-left {
background-color: #fdedee;
color: #aa55ff;
width: 190rpx;
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;
text {
font-size: 24rpx;
}
&.coupons-small {
font-size: 32rpx;
padding: 20rpx 0;
}
}
.coupons-full {
font-size: 24rpx;
}
}
.coupons-center {
position: absolute;
width: 100%;
left: 0;
top: 0;
padding: $padding - 10 130rpx 0 220rpx;
box-sizing: border-box;
font-size: 28rpx;
.coupons-time {
font-size: 24rpx;
margin-top: 10rpx;
color: #514c51;
}
}
.coupons-right {
position: absolute;
right: 20rpx;
top: 36rpx;
width: 110rpx;
text-align: center;
background-color: #aa55ff;
color: #FFFFFF;
border-radius: 80rpx;
font-size: 24rpx;
line-height: 52rpx;
&.coupons-right-active {
background-color: #adadad;
color: #FFFFFF;
}
}
}
}
.coupons-true {
background-image: linear-gradient(to right, #aa55ff, #aa55ff);
color: #FFFFFF;
border-radius: 80rpx;
line-height: 84rpx;
text-align: center;
margin-top: $margin*5;
}
}
// 新增服务保障样式
.serve-label {
margin-top: $margin + 10;
font-size: 28rpx;
.serve-label-name {
font-weight: 700;
margin-bottom: $margin - 10;
}
.serve-label-text {
line-height: 44rpx;
}
}
.serve-cont {
height: 40vh;
overflow-y: scroll;
}
</style>

View File

@@ -77,8 +77,7 @@
};
},
created() {
console.log(this.$Route.query)
if(this.$Route.query.edit == 'true'){
if(this.$Route.query.edit === 'true' || this.$Route.query.edit ){
managesGoodsExtends(this.$Route.query.id).then(res => {
this.productedAt = res.producted_at
this.expiriedAt = res.expiried_at
@@ -143,6 +142,7 @@
}
let submitFund = managesGoodsAuth(this.$Route.query.id, submitData)
submitFund.then(res => {
uni.setStorageSync('refresh',true)
uni.showModal({
title : '提示',
content : '商品权证认证信息已提交,请耐心等待平台审核',

View File

@@ -0,0 +1,123 @@
<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>
<!-- @click="goList(item.category_id)" -->
<!-- @click="$Router.push({name:'goodsList',query:{id:item.category_id}})" -->
<view class="second-item" v-for="(item, index) in category[stairIndex].children" :key="index" @click="goList(item.category_id,item.name)">
{{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
})
},
// 点击全部分类跳转页面
onNavigationBarButtonTap() {
uni.navigateTo({
url: `/pages/goods/lists?id=&name=全部商品`
})
},
methods: {
// 跳转列表页面
goList(id,name) {
uni.navigateTo({
url: `/pages/goods/lists?id=${id}&name=${name}`
})
}
}
}
</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: $mian-color;
font-weight: bold;
&::before {
position: absolute;
height: 40rpx;
width: 5rpx;
background: $mian-color;
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>

230
pages/goods/lists.vue Normal file
View File

@@ -0,0 +1,230 @@
<template>
<view class="Goods-LISTS">
<!-- <image :src="`${config.apiUrls}images/baodan-banner.png`" mode="widthFix" /> -->
<view class="tabs">
<view class="tabs-item" @click="onType" v-if="goodsType.length>0">
{{goodsType[goodsTypeIndex].name}}
<image class="tabs-item-arrow" src="@/static/icons/search_row.png" mode="" />
</view>
<view class="tabs-item" :class="{'show': tabIndex == 1 && marketType !== ''}" @click="onTabs" data-index="1">
价格
<image class="icon" mode="widthFix"
:src="require(marketType == 'asc' ? '@/static/icons/market_icon_low.png': marketType === ''? '@/static/icons/market_icon_null.png':'@/static/icons/market_icon_high.png')" />
</view>
<view class="tabs-item" :class="{'show': tabIndex == 2 && pvType !== ''}" @click="onTabs" data-index="2">
贡献值
<image class="icon" mode="widthFix"
:src="require(pvType == 'asc' ? '@/static/icons/market_icon_low.png': pvType === ''? '@/static/icons/market_icon_null.png':'@/static/icons/market_icon_high.png')" />
</view>
<view v-if="$Route.query.type !== 'baodan'" class="tabs-item" @click="$Router.push({name:'goodsClassify'})">
{{$Route.query.name}}
<image class="tabs-item-arrow" src="@/static/icons/search_row.png" mode="" />
</view>
</view>
<view class="lists">
<goods-list :list="goods" priceType="CNY" @on-goods="onGoods">
<template #statistics="good">
<view class="goods-pv">
<block v-if="good.value.price.pv > 0">
+ {{good.value.price.pv}}
<image class="goods-pv-icon" src="/static/icons/crystal-icon.png" mode="widthFix" />
</block>
</view>
</template>
</goods-list>
</view>
</view>
</template>
<script>
import {
list,shopself
} from '@/apis/interfaces/goods'
import goodsList from '@/components/goods-list/goods-list'
import {
config
} from '@/apis/index.js'
export default {
name: 'Goods-LISTS',
data() {
return {
tabIndex: 0,
marketType: '',
goods: [],
page: 1,
has_more: true,
isBaoDan: false, // 是否是报单默认有id不是报单无id是报单
goodsType: [],
goodsTypeIndex: 0,
pvType:''
};
},
onReachBottom() {
if (this.has_more) {
this.page = this.page + 1
this.getList()
} else {
uni.showToast({
title: '我是有底线的~',
icon: 'none'
})
}
},
created() {
this.getShopSelf()
},
onShow() {
if (this.$Route.query.type === 'baodan') {
this.isBaoDan = true
uni.setNavigationBarTitle({
title: '报单通证'
})
}
// else{
// if(this.$Route.query.name){
// uni.setNavigationBarTitle({
// title: this.$Route.query.name+'商品列表' || '商品列表'
// })
// }
// }
},
methods: {
getShopSelf(){
shopself().then(res => {
this.goodsType = res
this.getList()
})
},
// 筛选自营和合作企业等条件
onType(e) {
uni.showActionSheet({
itemList: this.goodsType.map((item) => item.name),
success: e => {
if(this.goodsTypeIndex !== e.tapIndex){
this.goodsTypeIndex = e.tapIndex
this.has_more = true
this.page = 1
this.goods = []
// this.tabIndex = ''
// this.pvType = ''
// this.marketType = ''
this.getList()
}
}
});
},
onTabs(e) {
let index = e.target.dataset.index
if (index == 0 ) {
this.marketType = ''
this.pvType = ''
return
}
if (index == 1 ) {
this.marketType = this.marketType == 'asc' ? 'desc' : 'asc'
this.pvType = ''
}
if (index == 2 ) {
this.pvType = this.pvType === 'asc'? 'desc' : 'asc'
this.marketType = ''
}
this.tabIndex = index
this.has_more = true
this.page = 1
this.goods = []
this.getList()
},
onGoods(e) {
uni.navigateTo({
url: '/pages/goods/details?id=' + e.goods_id
})
// this.$Router.push({
// name: 'goodsDetails',
// params: {
// id: e.goods_id
// }
// })
},
getList() {
let data = {
order_by: this.tabIndex == 1 ? this.marketType : '',
pv: this.tabIndex == 2 ? this.pvType : '',
page: this.page,
is_self:this.goodsType[this.goodsTypeIndex].id
}
if (this.$Route.query.type === 'id') {
data.category_id = this.$Route.query.id
} else if (this.$Route.query.type === 'baodan') {
// 报单加个条件筛选
data.is_allow_values = 1
} else {
data.category_cid = this.$Route.query.id
}
list(data).then(res => {
this.goods = this.goods.concat(res.data)
this.has_more = res.page.has_more
})
}
}
}
</script>
<style lang="scss" scoped>
.tabs {
position: fixed;
top: 0;
//#ifdef H5
top: 90rpx;
//#endif
left: 0;
z-index: 9;
width: 100%;
display: flex;
justify-content: space-around;
background: white;
height: 70rpx;
line-height: 70rpx;
text-align: center;
.tabs-item {
font-size: $title-size-m;
color: $text-gray;
display: flex;
align-items: center;
.tabs-item-arrow{
width: 32rpx;
height: 32rpx;
}
image {
width: 30rpx;
height: 30rpx;
vertical-align: middle;
margin-left: $margin / 3;
margin-bottom: 4rpx;
}
&.show {
color: $mian-color;
}
}
}
// 列表
.lists {
padding-top: 70rpx;
}
// 加水晶
.goods-pv{
.goods-pv-icon{
width: 20rpx !important;
vertical-align: middle;
margin-left: 5rpx;
margin-bottom: 5rpx;
}
}
</style>

View File

@@ -2,13 +2,13 @@
<view class="content">
<!-- 分类 -->
<view class="tabs">
<view class="item" :class="{'show': status == '0'}" @click="onTabs('0')">已发布</view>
<view class="item" :class="{'show': status == '1'}" @click="onTabs('1')">待认证</view>
<view class="item" :class="{'show': status == '2'}" @click="onTabs('2')">审核中</view>
<view class="item" :class="{'show': status == '3'}" @click="onTabs('3')">已驳回</view>
<view class="item" :class="{'show': status == '0'}" @click="onTabs('0')">已发布({{count[0]}})</view>
<view class="item" :class="{'show': status == '1'}" @click="onTabs('1')">待认证({{count[1]}})</view>
<view class="item" :class="{'show': status == '2'}" @click="onTabs('2')">审核中({{count[2]}})</view>
<view class="item" :class="{'show': status == '3'}" @click="onTabs('3')">已驳回({{count[3]}})</view>
</view>
<!-- 优选商品 -->
<goodsList :list="goods" priceType="CNY" :status='status' toast="暂无产品权证">
<goodsList :list="goods" priceType="CNY" :status='status' toast="暂无产品权证" notag='has'>
<template v-slot:statistics="goods">
<view>库存{{goods.value.stock}}</view>
</template>
@@ -47,10 +47,6 @@
<view class="btn" @click="additionalOrBurning">确认</view>
</view>
</uni-popup>
<view class="basisc-btn">
<button class="btn" type="default" @click="$Router.push({name: 'goodsaddClassify'})">添加商品权证</button>
</view>
</view>
</template>
@@ -63,32 +59,72 @@
},
data() {
return {
count : [],
status : 0,
goods : [],
pages : {},
itemGoods : {},
stock : 1,
stockType : ''
stockType : '',
page :1,
has_more :true,
};
},
onShow() {
onLoad() {
this.getList()
},
onShow() {
if(uni.getStorageSync('refresh')){
this.goods = []
this.page = 1
this.has_more = true
this.getList()
}
},
onReachBottom() {
if(this.has_more){
this.page = this.page + 1
this.getList()
}else{
uni.showToast({
title:'我是有底线的~',
icon:'none'
})
}
},
methods: {
// tabs
onTabs(value){
if(value == this.status) return
this.goods = []
this.page =1,
this.has_more = true
this.status = value
this.getList()
},
// 权证列表
getList(){
managesGoodsIndex({
status: this.status
status: this.status,
page:this.page
}).then(res => {
this.goods = res.data
this.pages = res.page
console.log(res)
let countArr = new Array
for(let key in res.count){
countArr.push(key)
}
this.count = res.count
this.goods = this.goods.concat(res.list.data)
this.pages = res.list.page
this.has_more = res.list.page.has_more
uni.setStorageSync('refresh',false)
}).catch(err => {
uni.showToast({
title: err.message,
icon : 'none'
})
})
},
// 修改产品
@@ -100,14 +136,14 @@
cancelText : '确定',
success : res => {
if(res.confirm){
this.$Router.push({name: 'GoodsMagAdd', params: {type: 'edit', id}})
this.$Router.push({name: 'goodsAdd', params: {type: 'edit', id}})
}
}
})
},
// 商品认证
goodsAuth(id){
this.$Router.push({name: 'goodsAuth', params: {id, type: 'magList'}})
this.$Router.push({name: 'goodsAddAuth', params: {id, type: 'magList'}})
},
// 燃烧,增发
openLay(item, type){
@@ -174,7 +210,7 @@
}
},
onNavigationBarButtonTap() {
// this.$Router.push({name: 'addClassify'})
this.$Router.push({name: 'goodsaddClassify'})
}
}
</script>
@@ -211,12 +247,14 @@
.content{
padding-top: 90rpx;
padding-bottom: ($padding*3) + 90;
}
// tabs
.tabs{
position: fixed;
top: 0;
//#ifdef H5
top: 90rpx;
// #endif
left: 0;
right: 0;
z-index: 99;
@@ -230,8 +268,8 @@
height: 60rpx;
line-height: 60rpx;
&.show{
color: $text-price;
border-bottom: solid 4rpx $text-price;
color: $mian-color;
border-bottom: solid 4rpx $mian-color;
}
}
}
@@ -268,7 +306,7 @@
font-weight: bold;
}
.btn {
background-color: $text-price;
background-color: $mian-color;
height: 90rpx;
line-height: 90rpx;
text-align: center;

102
pages/goods/payStatus.vue Normal file
View File

@@ -0,0 +1,102 @@
<template>
<view class="PayStatus">
<image class="payStatusImg" :src="success?'/static/imgs/paySuccess.png':'/static/imgs/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: $mian-color solid 1rpx;
color: $mian-color;
padding: 14rpx 50rpx;
border-radius: 4rpx;
}
.back {
background-color: $mian-color;
color: #fff;
padding: 14rpx 50rpx;
border-radius: 4rpx;
}
}
}
</style>

237
pages/goods/tracedTo.vue Normal file
View File

@@ -0,0 +1,237 @@
<template>
<view class="GoodsAuthentication">
<view class="authenticationTop" v-if='list.length>0'>区块链溯源码:{{info.token}}</view>
<!-- 进度条 -->
<view v-if='list.length>0' class='timeAxis'>
<view class="box-top" v-for="(item,index) in list" :key="index">
<view class="left-box-top"><span>{{index === list.length - 1?item.note:'权证交易'}}</span>{{item.blockTime}}</view>
<!-- 左边 -->
<view class="line" :class="{active:true,none:index==(list.length-1)}">
<!-- 中线 -->
<view class="dot" :class="{active:true}"></view><!-- 圆点 -->
</view>
<!-- 右边 -->
<view class="right-box-top">
<view class="authenticationItem">
<view class="authenticationItemcontent">
<view class="authenticationItemcontentItem" v-if="item.goods">
<view class="title">名称:</view>
<view class="content">{{item.goods.name}}</view>
</view>
<view class="authenticationItemcontentItem" v-if="item.goods">
<view class="title">规格:</view>
<view class="content">{{item.goods.skus.unit}}</view>
</view>
<view class="authenticationItemcontentItem">
<view class="title">{{index === list.length - 1?'初始发行量':'交易数量'}}</view>
<view class="content">{{item.amount}}</view>
</view>
<view class="authenticationItemcontentItem">
<view class="title">区块链高度:</view>
<view class="content">{{item.height}}</view>
</view>
<view class="authenticationItemcontentItem">
<view class="title">交易哈希:</view>
<view class="content">{{item.hash}}</view>
</view>
<view class="zhushi">注释:{{item.note}}</view>
</view>
</view>
</view>
</view>
</view>
<no-list v-if="list.length === 0" name='no-chain' txt="没有任何数据哦~" />
<!-- 弹窗提示喽 -->
<u-toast ref="uToast" />
</view>
</template>
<script>
import {
managesTracedTo,
checkmessage
} from '@/apis/interfaces/goods'
export default {
data() {
return {
list: '',
info: ''
}
},
created() {
managesTracedTo(this.$Route.query.id).then(res1 => {
console.log(res1)
this.list= res1.list
this.info = res1
checkmessage(this.$Route.query.id).then(res => {
this.list.push(res)
})
})
},
methods: {
priveImg(img) {
uni.previewImage({
current: img, // 当前显示图片的http链接
urls: [img] // 需要预览的图片http链接列表
})
},
call(phone) {
uni.makePhoneCall({
phoneNumber: phone,
})
}
}
}
</script>
<style lang="scss" scoped>
page {
background-color: #F7F7F7;
}
.GoodsAuthentication {
padding: 30rpx;
.authenticationTop {
width: 100%;
padding: 20rpx 50rpx;
background-color: $mian-color;
font-size: 26rpx;
color: #fff;
border-radius: 60rpx;
word-break: break-all;
text-align: center;
margin-bottom: 40rpx;
}
// 通证认证
.authenticationItem {
width: 100%;
min-height: 300rpx;
.authenticationItemTitle {
font-size: 30rpx;
color: #333333;
font-weight: 600;
padding: 30rpx 20rpx;
}
}
.timeAxis {
margin-top: 60rpx;
}
}
.box-top {
width: 100%;
min-height: 120rpx;
box-sizing: border-box;
display: flex;
flex-direction: row;
.left-box-top {
width: 124rpx;
text-align: center;
color: #cacaca;
font-size: 22rpx;
padding-top: 0;
display: flex;
flex-direction: column;
align-items: flex-end;
justify-content: flex-start;
box-sizing: border-box;
span {
font-size: 28rpx;
// font-weight: bold;
color: #333;
padding-bottom: 10rpx;
padding-right: 4rpx;
}
}
.line {
width: 2rpx;
background-color: rgba(228, 231, 237, 1);
margin: 0 20rpx 0 20rpx;
padding-top: 0;
.dot {
width: 20rpx;
height: 20rpx;
background-color: rgba(228, 231, 237, 1);
border-radius: 50%;
position: relative;
left: -10rpx;
}
}
.right-box-top {
flex: 1;
width: calc(100% - 170rpx);
padding: 0 0 20rpx 0;
// 通证认证
.authenticationItem {
width: 100%;
.authenticationItemcontent {
width: 100%;
background-color: #fff;
border-radius: 20rpx;
border: solid rgba(200, 38, 0, .05) 6rpx;
box-shadow: 2rpx 2rpx 20rpx 0rpx rgba(200, 38, 0, .051);
padding: 10rpx 20rpx;
.zhushi {
font-size: 24rpx;
color: #999;
padding: 10rpx 0;
word-wrap: break-word;
}
.authenticationItemcontentItem {
display: flex;
flex-direction: row;
align-items: flex-start;
justify-content: flex-start;
box-sizing: border-box;
padding: 12rpx 0;
font-size: 26rpx;
.title {
width: 160rpx;
}
.content {
text-overflow: ellipsis;
width: calc(100% - 180rpx);
word-wrap: break-word;
}
.img {
width: 220rpx;
height: 160rpx;
}
}
}
}
}
}
//激活元素
.active {
background-color: #8b64fd !important;
}
// 隐藏元素
.none {
background-color: rgba(0, 0, 0, 0) !important;
}
</style>

62
pages/guide/guide.vue Normal file
View File

@@ -0,0 +1,62 @@
<template>
<view>
<swiper class="swiper-guide" :indicator-dots="true" indicator-color="rgba(255,255,255,.3)" indicator-active-color="#FFF" @change="swiperChange">
<swiper-item v-for="(item, index) in urls" :key="index">
<view class="swiper-item">
<image :src="item.cover" mode="aspectFill"></image>
</view>
</swiper-item>
</swiper>
<button class="guide-btn" v-if="current === (urls.length - 1)" type="default" @click="$Router.replaceAll({name: 'Index'})">立即开启</button>
</view>
</template>
<script>
import { guide } from '@/apis/interfaces/guide'
export default {
data() {
return {
urls : [],
current : 0
};
},
created() {
guide().then(res=> {
this.urls = res
})
},
methods:{
swiperChange(e){
this.current = e.detail.current
}
}
}
</script>
<style lang="scss" scoped>
.swiper-guide{
width: 100vw;
height: 100vh;
background: #1f1922;
.swiper-item{
image{
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
}
}
.guide-btn{
position: fixed;
bottom: 10vh;
left: 10vw;
right: 10vw;
height: 90rpx;
line-height: 90rpx;
background-color: #774ffd;
color: white;
border: none;
}
</style>

View File

@@ -1,9 +1,17 @@
<template>
<view class="content">
<!-- 账户余额 -->
<!-- ios安全区 -->
<view class="ios-top"></view>
<!-- header -->
<view class="header-total ios-top">
<view class="total">
<view class="item nowrap" @click="navAccount('walletProperty')"><image src="@/static/icons/gemstone-icon.png"/>{{isAuth ? '能量球' + account.coin : '查看能量球'}}</view>
<view class="item nowrap" @click="navAccount('Fragment')"><image src="@/static/icons/crystal-icon.png"/>{{isAuth ? '能量碎片' + account.crystal : '查看能量碎片'}}</view>
<view class="item nowrap" @click="navAccount('walletProperty')">
<image src="@/static/icons/gemstone-icon.png" />{{isAuth ? '通证' + account.coin : '查看通证'}}
</view>
<view class="item nowrap" @click="navAccount('Fragment')">
<image src="@/static/icons/crystal-icon.png" />{{isAuth ? '贡献值' + account.crystal : '查看贡献值'}}
</view>
</view>
</view>
<!-- 矿机 -->
<view class="ore">
@@ -25,7 +33,15 @@
<view class="oct-icon">
<image src="@/static/icons/gemstone-ore-icon.png" mode="widthFix" class="icon" />
</view>
<view class="text">发权证<uni-icons type="arrowright" color="#FFFFFF" size="12"></uni-icons></view>
<view class="text">发权证<uni-icons type="arrowright" color="#FFFFFF" size="12"></uni-icons>
</view>
</view>
<view class="oct-float ore-item-key" @click="getAllThawall" v-if="crystalArr.length > 1">
<view class="oct-icon">
<image src="@/static/icons/crystals-icon.png" mode="widthFix" class="icon" />
</view>
<view class="text">一键领取<uni-icons type="arrowright" color="#FFFFFF" size="12"></uni-icons>
</view>
</view>
</view>
</block>
@@ -48,40 +64,58 @@
<image :src="item.cover" />
</view>
<view class="title nowrap">{{item.title}}</view>
<view class="submit-title nowrap">能量碎片{{item.tips}}</view>
<view class="submit-title nowrap">贡献值{{item.tips}}</view>
</view>
</scroll-view>
<!-- 平台概况 -->
<view class="situation">
<view class="header">
<view class="header-item">
<view class="title">平台能量球余量<uni-icons class="help-icon" @click="showHelp('balance')" type="help-filled" size="15" color="rgba(255,255,255,.3)" /></view>
<view class="title">平台通证余量
<uni-icons class="help-icon" @click="showHelp('balance')" type="help-filled" size="15"
color="rgba(255,255,255,.3)" />
</view>
<view class="number nowrap">{{chains.balance}}</view>
</view>
<view class="header-item">
<view class="title">上期发放能量球<uni-icons class="help-icon" @click="showHelp('stone')" type="help-filled" size="15" color="rgba(255,255,255,.3)" /></view>
<view class="title">上期发放通证
<uni-icons class="help-icon" @click="showHelp('stone')" type="help-filled" size="15"
color="rgba(255,255,255,.3)" />
</view>
<view class="number nowrap">{{chains.stone}}</view>
</view>
<view class="header-item">
<view class="title">当前能量球价值<uni-icons class="help-icon" @click="showHelp('up')" type="help-filled" size="15" color="rgba(255,255,255,.3)" /></view>
<view class="title">当前通证价值
<uni-icons class="help-icon" @click="showHelp('up')" type="help-filled" size="15"
color="rgba(255,255,255,.3)" />
</view>
<view class="number nowrap">{{chains.up}}</view>
</view>
<view class="header-item">
<view class="title">昨日瓜分能量碎片<uni-icons class="help-icon" @click="showHelp('score')" type="help-filled" size="15" color="rgba(255,255,255,.3)" /></view>
<view class="title">昨日瓜分贡献值
<uni-icons class="help-icon" @click="showHelp('score')" type="help-filled" size="15"
color="rgba(255,255,255,.3)" />
</view>
<view class="number nowrap">{{chains.score}}</view>
</view>
<view class="header-item">
<view class="title">区块链高度<uni-icons class="help-icon" @click="showHelp('height')" type="help-filled" size="15" color="rgba(255,255,255,.3)" /></view>
<view class="title">区块链高度
<uni-icons class="help-icon" @click="showHelp('height')" type="help-filled" size="15"
color="rgba(255,255,255,.3)" />
</view>
<view class="number nowrap">{{chains.height}}</view>
</view>
<view class="header-item">
<view class="title">已开通节点数<uni-icons class="help-icon" @click="showHelp('number')" type="help-filled" size="15" color="rgba(255,255,255,.3)" /></view>
<view class="title">已开通节点数
<uni-icons class="help-icon" @click="showHelp('number')" type="help-filled" size="15"
color="rgba(255,255,255,.3)" />
</view>
<view class="number nowrap">{{chains.number}}</view>
</view>
</view>
<!-- 平台累计盈利能量球 -->
<!-- 平台累计盈利通证 -->
<view class="chart">
<view class="title">累计盈利和能量球价值走势图</view>
<view class="title">通证价值走势图</view>
<view class="chart-f2">
<l-f2 ref="chartChange"></l-f2>
</view>
@@ -93,13 +127,13 @@
</template>
<script>
import { chain, crystals, thawlog } from '@/apis/interfaces/chain'
import { chain, crystals, thawlog, crystalsBefore, allThawall } from '@/apis/interfaces/chain'
import F2 from '@/uni_modules/lime-f2/components/lime-f2/f2.min.js'
import lF2 from '@/uni_modules/lime-f2/components/lime-f2/'
import Queue from '@/public/queue'
let queue = new Queue()
export default {
components:{
lF2
},
components: { lF2 },
data() {
return {
isAuth: false,
@@ -116,14 +150,15 @@
crystal : 0
},
crystalArr : [], // 待领取
allIds : [], // 可领取ids
categoryArr : [], // 推荐列表
help : {}, // 帮助信息
userAuth : { // 用户认证状态
certification: false,
company : false,
vip : false
}
},
// 领取贡献值队列
queueState : false
};
},
onShow() {
@@ -143,31 +178,31 @@
// 查看钱包账户
navAccount(pathName) {
if (!this.isAuth) {
this.$Router.push({name: 'Login'})
this.$Router.push({
name: 'Login'
})
return
}
this.$Router.push({name: pathName})
this.$Router.push({
name: pathName
})
},
// 发权证
issueGoosd() {
let typeAuth = '',
pathName = ''
if(this.userAuth.certification && this.userAuth.company && this.userAuth.vip){
this.$Router.push({name: 'goodsManagement'})
if (this.userAuth.company && this.userAuth.vip) {
this.$Router.push({
name: 'goodsManagement'
})
return
}
if(!this.userAuth.certification) {
typeAuth = '暂未完成个人认证,无法发布商品权证'
pathName = 'Personal'
}
if(!this.userAuth.company) {
typeAuth = '暂未开通平台会员节点,无法发布商品权证'
} else if (!this.userAuth.vip) {
typeAuth = '暂未开通平台VIP会员节点无法发布商品权证'
pathName = 'vipIndex'
}
if(!this.userAuth.vip) {
} else if (!this.userAuth.company) {
typeAuth = '企业未认证或企业认证审核中,无法发布商品权证'
pathName = 'User'
pathName = 'setting'
}
uni.showModal({
title: '提示',
@@ -178,42 +213,117 @@
confirmColor: '#8b64fd',
success: res => {
if (res.confirm) {
this.$Router.push({name: pathName})
if (pathName === 'vipIndex') {
this.$Router.push({
name: 'vipIndex',
params: {
identity_id: this.userAuth.identity
}
})
return
}
this.$Router.push({
name: pathName
})
}
}
})
},
// 领取能量碎片
// 领取贡献值
ledCrystal(index) {
// 播放音频
const innerAudioContext = uni.createInnerAudioContext();
innerAudioContext.autoplay = true;
innerAudioContext.src = require('@/static/mp3/crystal.mp3');
// 请求接口
thawlog({
thaw_id: this.crystalArr[index].log_id,
all_ids: this.allIds
}).then(res => {
this.playAudio()
// 领取提示信息
uni.showToast({
image: require('@/static/icons/crystal-icon.png'),
title: '+' + this.crystalArr[index].amount,
duration: 2000
})
this.$set(this.account, 'crystal', res.crystal)
this.ids = res.all_ids
if (JSON.stringify(res.last) === '[]') {
this.$set(this.crystalArr, index, {
amount: null
})
// 处理领取队列
queue.enqueue(this.crystalArr[index].log_id)
if(!this.queueState){
let queueTime
this.queueState = true
this.startQueue(queueTime)
}
// 移出贡献值数据
this.crystalArr.splice(index, 1)
},
// 领取贡献值队列
startQueue(outTime){
outTime = setInterval(() => {
if(queue.isNull()){
clearInterval(outTime)
this.queueState = false
this.getCrystalsBefore()
return
}
this.$set(this.crystalArr, index, res.last)
queue.front().then(val => {
thawlog({
thaw_id: val,
}).then(res => {
this.$set(this.account, 'crystal', res.crystal)
}).catch(err => {
uni.showToast({
icon: 'none',
title: err
title: err.message
})
})
})
queue.dequeue()
}, 500)
},
// 批量领取贡献值
getAllThawall(){
let ids = []
let amounts = 0
ids = this.crystalArr.map(val => {
amounts += Number(val.amount)
return val.log_id
})
allThawall({
all_ids: ids
}).then(res => {
this.playAudio()
// 领取提示信息
uni.showToast({
image: require('@/static/icons/crystals-icon.png'),
title: '+' + amounts.toFixed(2),
duration: 2000
})
this.crystalArr = []
this.$set(this.account, 'crystal', res.crystal)
this.getCrystalsBefore()
}).catch(err => {
uni.showToast({
icon : 'none',
title: err.message
})
})
},
// 刷新贡献值
getCrystalsBefore(){
if(this.crystalArr.length <= 0){
crystalsBefore().then(res => {
this.crystalArr = res.crystal_array
}).catch(err => {
uni.showToast({
title: err.message,
icon : 'none'
})
})
}
},
// 播放领取提示信息
playAudio(){
const innerAudioContext = uni.createInnerAudioContext();
innerAudioContext.autoplay = true;
innerAudioContext.src = require('@/static/mp3/crystal.mp3');
},
// occ信息
getIndex() {
@@ -228,7 +338,8 @@
this.userAuth = {
certification: crystalsData.is_certification,
company: crystalsData.is_company,
vip : crystalsData.is_vip
vip: crystalsData.is_vip,
identity: crystalsData.identity
}
this.crystalArr = crystalsData.crystal_array
this.allIds = crystalsData.all_ids
@@ -245,43 +356,36 @@
})
},
// 绘制图表
showCartc(data){
console.log(data)
showCartc(dataInfo) {
// 图表信息
this.$refs.chartChange.init(config => {
config.appendPadding = [10, 30, 10, 15]
const chart = new F2.Chart(config);
chart.source(data, {
config.appendPadding = [8, 30, 10, 15]
const chart = new F2.Chart(config)
chart.source(dataInfo, {
date: {
range: [0, 1],
type: 'timeCat',
mask: 'MM-DD'
mask: 'MM/DD',
tickCount: 7,
range: [ 0, 1 ]
},
value: {
tickCount: 0
tickCount: 7,
alias: '通证价值'
}
});
chart.legend({
position: 'bottom',
offsetY: 0,
offsetX: 30
});
chart.area()
.position('date*value')
.color('name', [ '#5881d3', '#ca66e0' ])
.shape('smooth')
chart.line()
.position('date*value')
.color('name', [ '#5881d3', '#ca66e0' ])
.shape('smooth', name=> {
if (name === '预期收益率') {
return 'line';
}
if (name === '实际收益率') {
return 'line';
chart.tooltip({
showCrosshairs: true,
crosshairsStyle: {
stroke: 'rgba(255, 255, 255, 0.25)',
lineWidth: 1
},
tooltipMarkerStyle: {
fill: '#fff'
}
});
chart.line().position('date*value').shape('smooth').color('#ca66e0');
chart.point().position('date*value').shape('smooth').color('#ca66e0').style({stroke: '#fff', lineWidth: 1 });
chart.area().position('date*value').color('#ca66e0').shape('smooth')
chart.render();
return chart;
})
@@ -292,13 +396,17 @@
var type = open.openType;
switch (type) {
case 'switchTab':
this.$Router.pushTab({name: open.path})
this.$Router.pushTab({
name: open.path
})
break;
case 'web':
window.location.href = open.path
break;
case 'navigateTo':
this.$Router.push({name: open.path})
this.$Router.push({
name: open.path
})
break;
}
}
@@ -328,6 +436,7 @@
animation: move-map 60s infinite linear;
box-shadow: 0 0 50rpx 50rpx rgba(31, 25, 34, .2);
}
.shadow {
position: absolute;
top: 1%;
@@ -339,6 +448,7 @@
z-index: 3;
background: radial-gradient(circle at 50% 0, rgba(255, 255, 255, .6), rgba(255, 255, 255, .0) 58%);
}
.ball:before,
.ball::after {
position: absolute;
@@ -351,30 +461,50 @@
filter: blur(5px);
z-index: 2;
}
.ball:before {
background: radial-gradient(circle at 100% 50%, #5881d3, rgba(255, 255, 255, .0) 45%);
}
.ball::after {
background: radial-gradient(circle at 0 50%, #ca66e0, rgba(255, 255, 255, .0) 45%);
}
@-webkit-keyframes move-map {
0% {background-position: -1616rpx 0; }
100% {background-position: 0 0;}
0% {
background-position: -1616rpx 0;
}
100% {
background-position: 0 0;
}
}
@-ms-keyframes move-map {
0% {background-position: -1616rpx 0; }
100% {background-position: 0 0;}
0% {
background-position: -1616rpx 0;
}
100% {
background-position: 0 0;
}
}
@keyframes move-map {
0% {background-position: -1616rpx 0; }
100% {background-position: 0 0;}
0% {
background-position: -1616rpx 0;
}
100% {
background-position: 0 0;
}
}
/* 水晶漂浮动画 */
.oct-float {
animation: 4s octfloat infinite;
}
@keyframes octfloat {
0% {
margin-top: 0;
@@ -396,28 +526,33 @@
background: #1f1922;
overflow: hidden;
}
// 平台概况
.situation {
margin: 0 $margin;
background-image: linear-gradient(to bottom, $block-color, #1f1922);
border-radius: $radius;
padding: $padding $padding/2 $padding*2;
// 平台统计
.header {
display: flex;
flex-wrap: wrap;
padding-bottom: $padding;
.number {
color: white;
font-size: $title-size;
font-weight: bold;
line-height: 70rpx;
}
.title {
color: rgba($color: white, $alpha: .4);
font-size: $title-size-sm;
line-height: 40rpx;
}
.header-item {
width: 50%;
padding: $padding / 2;
@@ -431,30 +566,43 @@
// }
}
}
// 图表
.chart {
background: rgba($color: $block-color, $alpha: .8);
padding: $padding/2;
border-radius: $radius/2;
.title {
text-align: center;
line-height: 80rpx;
color: rgba($color: #FFFFFF, $alpha: .4);
font-size: $title-size-sm;
}
.chart-f2 {
height: 200px;
}
}
}
// 数据统计
.header-total {
position: fixed;
top: 0;
left: 0;
right: 0;
z-index: 99;
background: #1f1922;
.total {
position: relative;
margin: $margin;
margin: $margin/2 $margin;
background: #2b2449;
padding: 0;
display: flex;
border-radius: $radius;
.item {
width: 50%;
padding: 0 $padding;
@@ -462,6 +610,7 @@
color: white;
font-size: $title-size-sm;
line-height: 76rpx;
image {
width: 38rpx;
height: 38rpx;
@@ -481,21 +630,27 @@
background: linear-gradient(to bottom, transparent, rgba(255, 255, 255, .7), transparent);
}
}
}
// 求助icon
.help-icon {
margin-left: $margin/3;
opacity: .7;
}
// 矿石
.ore {
margin-top: 76rpx;
position: relative;
padding-top: 120%;
&>image {
width: 100%;
position: absolute;
top: 0;
left: 0;
}
.ore-lists {
position: absolute;
top: 0;
@@ -503,15 +658,18 @@
height: 100%;
width: 100%;
z-index: 1;
.oct-float-item {
position: absolute;
text-align: center;
.text {
color: white;
font-size: $title-size-sm - 4;
line-height: 40rpx;
text-shadow: 0 3rpx 3rpx rgba($color: #000000, $alpha: .2);
}
.oct-icon {
display: inline-block;
width: 58rpx;
@@ -520,6 +678,7 @@
background: radial-gradient(circle at 50% 50%, rgba(202, 102, 224, .0) 40%, #ca66e0);
border-radius: 50%;
box-shadow: 0 0 5rpx 5rpx rgba($color: #ca66e0, $alpha: .5);
.icon {
margin-top: 10rpx;
height: 38rpx;
@@ -527,14 +686,23 @@
}
}
}
.ore-item-nav {
@extend .oct-float-item;
right: $margin;
top: 12%;
}
.ore-item-key{
@extend .oct-float-item;
left: $margin;
top: 20%;
}
.ore-item {
@extend .oct-float-item;
}
.oct-login {
@extend .oct-float-item;
left: 42%;
@@ -542,10 +710,12 @@
}
}
}
// 任务
.task-block {
white-space: nowrap;
margin-bottom: $margin;
.item {
background: $block-color;
display: inline-block;
@@ -554,12 +724,15 @@
border-radius: $radius;
text-align: center;
padding: ($padding - 10) $padding/2;
&:first-child {
margin-left: $margin;
}
&:last-child {
margin-right: $margin;
}
.icon {
display: inline-block;
margin: ($margin/2) 0;
@@ -569,23 +742,27 @@
background: #1f183d;
border-radius: 50%;
text-align: center;
image {
width: 56rpx;
height: 56rpx;
vertical-align: middle;
}
}
.text {
font-size: $title-size-sm;
color: rgba($color: white, $alpha: .4);
line-height: 40rpx;
}
.title {
font-size: $title-size-lg;
color: white;
font-weight: bold;
line-height: 50rpx;
}
.submit-title {
font-size: $title-size-sm - 4;
color: rgba($color: white, $alpha: .4);

34
pages/index/new_file.js Normal file
View File

@@ -0,0 +1,34 @@
config.appendPadding = [10, 30, 10, 15]
const chart = new F2.Chart(config);
chart.source(data, {
date: {
range: [0, 1],
type: 'timeCat',
mask: 'MM-DD'
},
value: {
tickCount: 0
}
});
chart.legend({
position: 'bottom',
offsetY: 0,
offsetX: 30
});
chart.area()
.position('date*value')
.color('name', ['#5881d3', '#ca66e0'])
.shape('smooth')
chart.line()
.position('date*value')
.color('name', ['#5881d3', '#ca66e0'])
.shape('smooth', name => {
if (name === '预期收益率') {
return 'line';
}
if (name === '实际收益率') {
return 'line';
}
});
chart.render();

View File

@@ -1,150 +1,166 @@
<template>
<view class="content">
<view class="codeContent">
<view class="shareContent">
<view class="codeContent" v-if="!posterShow" @click="coverCode">
<view class="codeTop">
<image class="codeTop-cover" :src="companyInfo.cover" mode="aspectFill"></image>
<view class="codeTop-title">
<view class="codeTop-name">
{{companyInfo.name}}
</view>
<view class="codeTop-tips">
邀请你 加入链商星球
</view>
<view class="codeTop-name">{{companyInfo.name}}</view>
<view class="codeTop-tips">邀请你 加入链商星球</view>
</view>
</view>
<view class="codeCode">
<image class="codeImg-code" :src="companyInfo.code" mode="aspectFill"></image>
<!-- 先默认死数据 -->
<!-- <image class="codeImg-code" src="/static/user/wallet-code.png" mode="aspectFill"></image> -->
<view class="codeImg-text">
长按二维码进行保存
<view class="codeImg-text">点击二维码进行保存</view>
</view>
</view>
<!-- 分享二维码 -->
<canvas class="my-canvas" canvas-id="myCanvass" id="myCanvass" />
<view v-if="posterShow">
<view class="posterBack"></view>
<view class="poster">
<view class="poster-img">
<image class="img" :src="posterImg" mode="widthFix" />
</view>
<view class="poster-btn">
<view class="operate operate-cancel" @click="saveImage">保存图片至相册</view>
<view class="operate" @tap="posterShow = false">取消</view>
</view>
</view>
</view>
<!-- <canvas class="codeImg" canvas-id="qrcodeCard"></canvas> -->
</view>
</template>
<script>
import { companiesCode } from '@/apis/interfaces/store'
import {
companiesCode
} from '@/apis/interfaces/store'
import {
saveImageToPhotosAlbum,
showToast,
downloadFile
} from '@/uni_modules/sakura-canvas/js_sdk/util'
import Draw from '@/uni_modules/sakura-canvas/js_sdk/draw'
let draw = null
export default {
data() {
return {
companyInfo : ''
companyInfo: {},
posterShow: false, // 是否显示下载弹窗页面
}
},
created() {
onShow() {
companiesCode().then(res => {
console.log(res.code)
this.companyInfo = res
})
},
methods: {
// 绘制图片
shareCanvas(e){
uni.showLoading({
title: '加载中',
// 生成海报
async coverCode() {
let img = this.companyInfo.code
let name = this.companyInfo.name
let avatar = this.companyInfo.cover
draw = new Draw({
width: 375,
height: 460,
canvasId: 'myCanvass',
_this: this,
background: {
type: 'color',
color: 'white',
w: 375,
h: 460,
},
})
// 下载头像
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 => {
// 绘制海报
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()
let res = await draw.createdSharePoster(({
bgObj
}) => {
let {
width,
height
} = bgObj
this.Popinvite = bgObj
// 绘制内容
return [
// 用户昵称
{
type: 'text',
x: 120,
y: 80,
zIndex: 99,
w: width - (20 * 2),
text: name,
color: '#333',
font: {
size: 20
}
},
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'
})
// 描述
{
type: 'text',
x: 120,
y: 110,
zIndex: 99,
w: width - (20 * 2),
text:'邀请你 加入链商星球',
color: '#999',
font: {
size: 16
}
},
// 用户头像
{
type: 'image',
x: 24,
y: 60,
src: avatar,
w: 80,
h: 80,
drawType: 'arc',
zIndex: 99,
borderWidth: 5, // 图片边框大小 默认0
borderColor: '#cacaca' // 图片边框颜色 默认无颜色
},
// 二维码
{
type: 'image',
x: 80,
y: 190,
w: 200,
h: 200,
zIndex: 99,
src: img,
borderWidth: 5, // 图片边框大小 默认0
borderColor: '#cacaca' // 图片边框颜色 默认无颜色
}
]
})
if (!res.success) return
this.posterImg = res.data
this.posterShow = true
},
// 保存图片
async saveImage() {
let {
posterImg
} = this
let res = await saveImageToPhotosAlbum(posterImg)
if (!res.success) return
showToast('保存成功,去相册分享给朋友吧')
this.posterShow = false
}
}
}
</script>
<style lang="scss" scoped>
.content {
.shareContent {
background: #7c52fc;
height: 100vh;
width: 100vw;
@@ -155,6 +171,7 @@
left: 0;
right: 0;
top: 0;
.codeTop {
position: absolute;
left: 5%;
@@ -168,6 +185,7 @@
z-index: 2;
display: flex;
height: 200rpx;
.codeTop-cover {
width: 120rpx;
height: 120rpx;
@@ -176,18 +194,22 @@
border: 4rpx solid #FFFFFF;
box-shadow: 0 5rpx 10rpx rgba(94, 59, 201, .3);
}
.codeTop-title {
padding-top: 50rpx;
.codeTop-name {
font-weight: 600;
font-size: 36rpx;
margin-bottom: 10rpx;
}
.codeTop-tips {
color: $text-gray-m;
}
}
}
.codeCode {
background-color: #FFFFFF;
box-shadow: 0 0 40rpx rgba(27, 0, 111, .4);
@@ -199,6 +221,7 @@
border-radius: 30rpx;
z-index: 1;
text-align: center;
.codeImg-code {
width: 360rpx;
height: 360rpx;
@@ -207,9 +230,12 @@
padding: 30rpx;
box-sizing: border-box;
}
.codeImg-text {
font-size: 32rpx;
color: $text-color;
position: relative;
z-index: 1;
}
}
}
@@ -234,4 +260,66 @@
width: 375px;
background: white;
}
// canvas
.my-canvas {
width: 375px;
height: 667px;
position: fixed;
top: -99999999999rpx;
left: -99999999999rpx;
z-index: -99999999999;
opacity: 0;
}
.posterBack {
width: 100%;
height: 100%;
position: fixed;
background-color: rgba(0, 0, 0, .7);
left: 0;
top: 0;
}
.poster {
width: 100vw;
height: 100vh;
display: flex;
flex-flow: column nowrap;
justify-content: center;
overflow: hidden;
position: fixed;
top: 0;
left: 0;
z-index: 999999999999;
&-img {
width: 580rpx;
position: relative;
margin: 70rpx auto 20rpx;
.img {
width: 100%;
}
}
&-btn {
padding: 0 $padding * 2;
.operate {
width: 80%;
margin-bottom: 20rpx;
height: 80rpx;
line-height: 80rpx;
border-radius: 40rpx;
margin-left: 10%;
display: inline-block;
text-align: center;
color: #fff;
&-cancel {
background-color: $text-price;
}
}
}
}
</style>

View File

@@ -31,18 +31,10 @@
<view class="remove-btn" @click="removeModule(moduleIndex)">删除</view>
</view>
<view class="module-imgs">
<view
class="item"
v-for="(item, index) in module.content.image"
:key="index"
>
<image
class="cover"
:src="item.showpath"
mode="aspectFill"
<view class="item" v-for="(item, index) in module.content.image" :key="index">
<image class="cover" :src="item.showpath" mode="aspectFill"
@click="openImg(module.content.image, index, 'imgs')"
@longpress="removeImg('imgs', moduleIndex, index)"
/>
@longpress="removeImg('imgs', moduleIndex, index)" />
<view class="item-input">
<input type="text" v-model="item.title" placeholder="输入标题" />
</view>
@@ -64,13 +56,9 @@
<view class="module-videos">
<view class="item">
<block v-if="module.content.video_image.showpath != ''">
<image
class="cover"
:src="module.content.video_image.showpath"
mode="aspectFill"
<image class="cover" :src="module.content.video_image.showpath" mode="aspectFill"
@click="openImg([module.content.video_image.showpath], 0, 'videos')"
@longpress="removeImg('videoCover', moduleIndex, '')"
/>
@longpress="removeImg('videoCover', moduleIndex, '')" />
</block>
<block v-else>
<view class="item-upd" @click="updImg('videoCover', moduleIndex)">
@@ -80,31 +68,34 @@
</block>
</view>
<view class="item">
<video
class="cover"
v-if="module.content.video_url.showpath != ''"
:src="module.content.video_url.showpath"
@longpress="removeImg('video', moduleIndex, '')"
/>
<video class="cover" v-if="module.content.video_url.showpath != ''"
:src="module.content.video_url.showpath" @longpress="removeImg('video', moduleIndex, '')" />
<view class="item-upd" @click="updImg('video', moduleIndex)" v-else>
<uni-icons type="plus" size="20" color="#999" />
<view>上传视频</view>
</view>
</view>
</view>
<view class="module-hint">点击查看封面/视频长按删除封面/视频</view>
<view class="module-hint">点击查看封面/视频长按删除封面
<span class='delVideo' v-if="module.content.video_url.showpath != ''"
@longpress="removeImg('video', moduleIndex, '')">长按删除视频</span>
</view>
</view>
</block>
<view class="basisc-btn">
<view class="add-modules" @click="addModule">添加模块</view>
<button class="btn" type="default" @click="onBasicsInfo">保存</button>
<view @click="addModule" class="add-modules">
<uni-icons class="icon" color="#8b64fd" size="20" type="plus"></uni-icons>添加模块
</view>
</view>
</template>
<script>
import { basicsInfo, basicsConfig } from '@/apis/interfaces/store'
import { uploads } from '@/apis/interfaces/uploading'
import {
basicsInfo,
basicsConfig
} from '@/apis/interfaces/store'
import {
uploads
} from '@/apis/interfaces/uploading'
export default {
data() {
return {
@@ -130,6 +121,9 @@
})
})
},
onNavigationBarButtonTap() {
this.onBasicsInfo()
},
methods: {
// 图片预览
openImg(paths, index, type) {
@@ -165,7 +159,10 @@
switch (type) {
case 'logo':
uni.chooseImage({
crop: {width: 300, height: 300},
crop: {
width: 300,
height: 300
},
success: path => {
uploads([{
name: 'logo',
@@ -183,7 +180,10 @@
break
case 'videoCover':
uni.chooseImage({
crop: {width: 500, height: 350},
crop: {
width: 500,
height: 350
},
success: path => {
uploads([{
name: 'logo',
@@ -335,16 +335,17 @@
</script>
<style lang="scss" scoped>
.basics-content{
padding-bottom: ($padding*3) + 90;
}
.basics-content {}
// 基础信息
.info {
background: white;
padding: 0 $padding;
.item {
position: relative;
padding: $padding 0 $padding 200rpx;
&::after {
position: absolute;
left: 0;
@@ -354,19 +355,23 @@
height: 1rpx;
background: #eee;
}
&:last-child::after {
display: none;
}
}
.info-logo {
text-align: right;
padding-right: 40rpx;
label {
position: absolute;
left: 0;
height: 88rpx;
line-height: 88rpx;
}
image {
width: 88rpx;
height: 88rpx;
@@ -374,6 +379,7 @@
vertical-align: top;
background: $border-color-lg;
}
.icon {
position: absolute;
right: 0;
@@ -381,6 +387,7 @@
margin-top: -10px;
}
}
.info-text {
label {
position: absolute;
@@ -388,106 +395,90 @@
height: 40rpx;
line-height: 40rpx;
}
textarea {
line-height: 40rpx;
width: 100%;
height: 160rpx;
}
input {
height: 40rpx;
width: 100%;
}
}
}
// 按钮组
.basisc-btn{
position: fixed;
bottom: 0;
left: 0;
right: 0;
padding: $padding;
background: white;
margin-top: $margin - 10;
display: flex;
justify-content: space-between;
box-shadow: 0 0 4rpx 4rpx rgba($color: #000000, $alpha: .02);
// 添加模块
.add-modules {
line-height: 86rpx;
margin: $margin 0;
line-height: 88rpx;
height: 88rpx;
text-align: center;
color: $text-price;
color: $mian-color;
background: white;
width: calc(50% - 15rpx);
margin-right: 30rpx;
border:solid 1rpx $mian-color;
box-sizing: border-box;
font-size: $title-size-lg;
.icon {
vertical-align: middle;
margin-right: $margin/3;
}
}
.btn {
background: $mian-color;
color: white;
border-radius: 0;
font-size: $title-size-lg;
line-height: 88rpx;
height: 88rpx;
width: calc(50% - 15rpx);
&::after {
border: none;
}
&[disabled] {
background: rgba($color: $mian-color, $alpha: .6);
}
}
}
// 展示模块
.module-item {
background: white;
padding: $padding/2 $padding;
margin-top: $margin - 10;
.module-title {
display: flex;
justify-content: space-between;
padding-bottom: $padding/2;
border-bottom: solid 1rpx $border-color;
.title-input {
width: calc(100% - 150rpx);
height: 70rpx;
font-size: $title-size;
}
.remove-btn {
line-height: 70rpx;
color: $text-price;
color: $mian-color;
text-align: right;
font-size: $title-size-m;
}
}
.module-textarea {
padding: $padding 0 $padding/2;
width: 100%;
font-size: $title-size;
line-height: 50rpx;
box-sizing: border-box;
textarea {
width: 100%;
height: 200rpx;
}
}
.module-imgs {
display: flex;
flex-wrap: wrap;
padding-top: $padding/2;
margin-left: -10rpx;
margin-right: -10rpx;
.item {
position: relative;
background: #F8F8F8;
width: calc(25% - 20rpx);
padding-top: calc(25% - 20rpx);
margin: 10rpx;
.cover {
position: absolute;
width: 100%;
@@ -495,12 +486,14 @@
top: 0;
left: 0;
}
.item-input {
position: absolute;
bottom: 0;
left: 0;
right: 0;
background: rgba($color: #000000, $alpha: .7);
input {
height: 50rpx;
line-height: 50rpx;
@@ -510,6 +503,7 @@
color: white;
}
}
.item-upd {
@extend .vertical;
text-align: center;
@@ -518,23 +512,34 @@
}
}
}
.module-hint {
color: $text-gray;
font-size: $title-size-sm;
padding: $padding/2 0;
line-height: 50rpx;
.delVideo{
display: inline-block;
background-color: $mian-color;
color: #fff;
margin-left: 30rpx;
padding:2rpx 20rpx ;
}
}
.module-videos {
display: flex;
padding: $padding 0 ($padding/2);
margin-left: -10rpx;
margin-right: -10rpx;
.item {
position: relative;
width: calc(50% - #{$margin/2});
padding-top: calc(35% - #{$margin/2});
background: #f8f8f8;
margin: 0 10rpx;
.item-upd {
position: absolute;
top: 0;
@@ -547,6 +552,7 @@
line-height: 40rpx;
@extend .vertical;
}
.cover {
position: absolute;
top: 0;

View File

@@ -22,12 +22,12 @@
</view>
<button class="btn" type="default" :disabled="phone == '' || code == ''" @click="login">登录</button>
<!-- 快捷登录 -->
<!-- <view class="quick">
<view class="quick">
<view class="quick-title">快捷登录</view>
<view class="quick-box">
<image class="quick-icon" src="@/static/icons/wechat.png" mode="widthFix" @click="onShowToast"></image>
<image class="quick-icon" src="@/static/icons/keyphone.png" mode="widthFix" @click="onKeyAuth"></image>
</view>
</view>
</view> -->
<!-- 用户登录注册协议 -->
<view class="agreement">
未注册的手机号验证后将自动创建账号登录即表示同意接收
@@ -36,8 +36,6 @@
<view @click="$Router.push({name: 'agreement', params: {name : 'service'}})">用户服务协议</view>
</view>
<view class="beianNo">皖ICP备2021013714号-1</view>
<!-- https://beian.miit.gov.cn/ -->
</view>
</template>
@@ -46,10 +44,11 @@
getSms,
smsAuth
} from '@/apis/interfaces/auth'
import userAuth from '@/public/userAuth'
export default {
data() {
return {
phone : "18245180131",
phone : "",
code : "",
parentId: "",
smsTime : 60,
@@ -57,7 +56,9 @@
}
},
onShow(){
this.parentId = this.$Route.query.invite || ''
this.parentId = getApp().globalData.parentId
},
methods: {
// 用户登录
@@ -68,11 +69,10 @@
parent_id : this.parentId
}).then(res => {
this.$store.commit('setToken', res.token_type + ' ' + res.access_token)
if(this.$Route.toName){
this.$Router.back()
}else{
this.$Router.replace({name: 'Index'})
this.$Router.replaceAll({name: 'Index'})
}
}).catch(err => {
uni.showToast({
@@ -107,12 +107,38 @@
})
})
},
// 提示信息
onShowToast(){
// 一键登录
onKeyAuth(){
uni.showLoading({
title: "加载中..."
})
uni.preLogin({
provider: 'univerify',
success : res=> {
let userLogin = new userAuth()
userLogin.keyLogin().then(res => {
if(this.$Route.toName){
this.$Router.back()
}else{
this.$Router.replaceAll({name: 'Index'})
}
}).catch(err => {
uni.showToast({
title: '微信登录暂未开放,敬请期待',
title: err.message,
icon : 'none'
})
})
},
fail : err=> {
uni.showToast({
title: '当前设备环境暂不支持一键登录',
icon : 'none'
})
},
complete() {
uni.hideLoading()
}
})
}
}
}
@@ -127,7 +153,7 @@
background: white;
.login-top {
height: 26vh;
height: 25vh;
width: 100%;
display: flex;
flex-direction: row;
@@ -204,13 +230,13 @@
margin: 0;
border-radius: 0;
border-left: solid 1rpx $border-color;
color: $text-price;
color: $mian-color;
font-size: $title-size-lg;
&::after {
border: none;
}
&[disabled] {
color: rgba($color: $text-price, $alpha: .6);
color: rgba($color: $mian-color, $alpha: .6);
background: $border-color-lg;
}
}
@@ -245,16 +271,14 @@
}
.quick {
padding-top: $padding * 3;
padding-top: $padding * 2;
text-align: center;
.quick-title {
text-align: center;
color: $text-gray;
font-size: $title-size-sm;
padding-bottom: $padding;
}
.quick-box {
display: flex;
justify-content: center;
@@ -266,11 +290,11 @@
}
.agreement {
padding-top: 12vh;
padding-top: 5vh;
font-size: $title-size-sm;
color: $text-gray;
view {
color: $text-price;
color: $mian-color;
display: inline-block;
padding: 0 10rpx;
}

343
pages/market/details.vue Normal file
View File

@@ -0,0 +1,343 @@
<template>
<view v-if="!loding">
<!-- 产品信息 -->
<view class="goods">
<image class="cover" :src="info.goods.cover" mode="aspectFill"></image>
<view class="content">
<view class="title nowrap">数字权证</view>
<view class="text nowrap">锚定商品{{info.goods.goods_name}}</view>
<view class="text nowrap">供应商{{info.company.name}}</view>
<view class="text nav-goods nowrap" @click="onGoods">查看锚定商品信息<uni-icons type="arrowright" size="12" color="#8b64fd"></uni-icons></view>
</view>
<view class="info">
<view class="info-item">
<label>转让用户</label>
{{info.user.username}}
</view>
<view class="info-item">
<label>转让单价</label>
{{info.price}}
</view>
<view class="info-item">
<label>出售数量</label>
{{info.stock}}
</view>
<view class="info-item">
<label>剩余转让数量</label>
{{info.surplus}}
</view>
<view class="info-item">
<label>区块HASH</label>
{{info.hash}}
</view>
<view class="info-item">
<label>转让时间</label>
{{info.created_at}}
</view>
</view>
</view>
<button class="buy-btn" type="default" @click="openLay">我要购买</button>
<!-- 购买弹窗 -->
<uni-popup ref="buyLay" :safe-area="true" background-color="#ffffff">
<view class="popup">
<view class="title">我要购买</view>
<view class="des">
剩余转让数量
<text>{{info.surplus}}</text>
</view>
<view class="des">
数量
<uni-number-box v-model='stock' :min="1" :max="info.surplus" @change="countPrice"></uni-number-box>
</view>
<view class="des">
订单总价
<text class="price">{{price}}</text>
</view>
<view class="btn" @click="buy">提交订单</view>
</view>
</uni-popup>
<!-- 支付方式 -->
<uni-popup ref="payLay" :safe-area="true" background-color="#ffffff">
<view class="popup">
<view class="title">支付方式</view>
<radio-group class="pay-group" @change="payType">
<view class="item">
<label>
<radio class="pay-radio" value="wechat" checked color="#8b64fd" />
<view class="pay-title">微信支付</view>
</label>
</view>
<view class="item">
<label>
<radio class="pay-radio" value="alipay" color="#8b64fd" />
<view class="pay-title">支付宝支付</view>
</label>
</view>
</radio-group>
<view class="btn" @click="orderPay">立即支付</view>
</view>
</uni-popup>
</view>
</template>
<script>
import { marketsInfo, marketsBuy, marketsPay } from '@/apis/interfaces/market'
import userAuth from '@/public/userAuth'
import cashierPay from '@/public/cashierPay'
export default {
data() {
return {
payValue: 'wechat',
orderNo : '',
price : '0.00',
stock : 1,
loding : true,
info : {}
};
},
onShow() {
this.getInfo()
},
methods:{
// 获取数据信息
getInfo(){
marketsInfo(this.$Route.query.marketId).then(res =>{
this.info = res
this.price = res.price
this.loding = false
}).catch(err => {
uni.showToast({
title: err.message,
icon : 'none'
})
})
},
// 查看锚定产品
onGoods(){
this.$Router.push({name: 'marketGoods', params: { id: this.info.goods.goods_id }})
},
// 选择购买方式
payType(e){
this.payValue = e.detail.value
},
// 购买弹窗
openLay(){
let token = this.$store.getters.getToken
if(token == ''){
this.$Router.push({name: 'Login'})
return
}
this.$refs.buyLay.open('bottom')
},
// 计算价格
countPrice(e){
this.price = (e * this.info.price).toFixed(2)
},
// 提交购买单
buy(){
marketsBuy(this.info.market_id, {
qty: this.stock
}).then(res => {
this.account = res.account
this.orderNo = res.market_order_no
this.$refs.buyLay.close()
this.$refs.payLay.open('bottom')
}).catch(err => {
uni.showToast({
title: err.message,
icon : 'none'
})
})
},
// 支付
orderPay(){
marketsPay(this.orderNo, this.payValue).then(res => {
switch (this.payValue){
case 'wechat':
let payConfigObj = JSON.parse(res)
cashierPay.pay('wxpay', payConfigObj, 'market').then(() => {
this.paySuccess()
})
break
case 'alipay':
cashierPay.pay('alipay', res, 'market').then(() => {
this.paySuccess()
})
break
}
}).catch(err => {
uni.showToast({
title: err.message,
icon : 'none'
})
})
},
// 支付结果
paySuccess(){
this.$refs.payLay.close()
uni.showModal({
title : '支付成功',
content : '购买成功,可在节点中心我的权证中查看',
showCancel : false,
success : () => {
this.$Router.back()
}
})
}
}
}
</script>
<style lang="scss" scoped>
// 支付方式
.pay-group{
margin: 0 ($margin * 2);
.item{
position: relative;
border-bottom: solid 1rpx $border-color;
padding: $padding 0;
&:last-child{
border-bottom: none;
}
.pay-radio{
position: absolute;
right: 0;
top: 50%;
margin-top: -25rpx;
}
.pay-sub-title{
font-size: $title-size-sm;
color: $text-gray;
line-height: 40rpx;
}
.pay-title{
font-weight: bold;
line-height: 50rpx;
color: $text-color;
font-size: $title-size-lg;
text-align: left;
}
}
}
// 我要购买按钮
.buy-btn{
margin: 0 $margin;
background: $mian-color;
color: white;
height: 90rpx;
line-height: 90rpx;
padding: 0;
border-radius: $radius/2;
font-size: $title-size;
font-weight: bold;
&::after{
border: none;
}
}
// 产品信息
.goods{
min-height: 168rpx;
position: relative;
background: white;
border-radius: $radius/2;
margin: $margin;
padding: $padding;
.cover{
position: absolute;
left: $padding;
top: $padding;
width: 168rpx;
height: 168rpx;
}
.content{
padding-left: calc(168rpx + #{$padding});
.title{
position: relative;
font-size: $title-size-lg;
color: $text-color;
font-weight: bold;
line-height: 52rpx;
padding-right: 60rpx;
text{
position: absolute;
right: 0;
top: 0;
width: 60rpx;
text-align: right;
font-weight: normal;
}
}
.text{
font-size: $title-size-sm;
color: $text-gray;
height: 40rpx;
line-height: 40rpx;
&.nav-goods{
color: $mian-color;
}
}
}
.info{
margin-top: $margin;
border-top: solid 1rpx $border-color;
padding-top: $padding;
.info-item{
padding-left: 200rpx;
height: 60rpx;
line-height: 60rpx;
position: relative;
text-align: right;
font-size: $title-size-m;
@extend .nowrap;
label{
position: absolute;
left: 0;
top: 0;
width: 200rpx;
text-align: left;
color: $text-gray;
}
}
}
}
// 购买产品
.popup {
width: 100%;
background-color: #fff;
padding-bottom: $padding;
.title {
font-size: 36rpx;
text-align: center;
padding: 50rpx 30rpx 30rpx 30rpx;
font-weight: bold;
}
.btn {
background-color: $mian-color;
height: 90rpx;
line-height: 90rpx;
text-align: center;
color: #fff;
font-weight: bold;
font-size: $title-size;
margin: $padding * 2;
border-radius: $radius/2;
}
.des {
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
box-sizing: border-box;
padding: $padding $padding * 2;
color: $text-gray;
font-size: $title-size-lg;
text{
color: $text-color;
}
.price{
color: $text-price;
font-weight: bold;
}
}
}
</style>

112
pages/market/goods.vue Normal file
View File

@@ -0,0 +1,112 @@
<template>
<view>
<view class="goods-cover">
<swiper class="swiper" circular indicator-dots indicator-active-color="#8b64fd">
<swiper-item v-for="(item, index) in cover" :key="index">
<view class="swiper-item">
<image class="swiper-cover" :src="item" mode="aspectFill" />
</view>
</swiper-item>
</swiper>
</view>
<view class="info">
<view class="info-item">
<label>锚定商品</label>
{{info.name}}
</view>
<view class="info-item">
<label>商品规格</label>
{{info.skusUnit}}
</view>
<view class="info-item">
<label>供应商</label>
{{info.companyName}}
</view>
<view class="info-item">
<label>权证销量</label>
{{info.sales}}
</view>
<view class="info-item">
<label>发布时间</label>
{{info.createdAt}}
</view>
</view>
</view>
</template>
<script>
import { goods } from '@/apis/interfaces/goods'
export default {
data() {
return {
cover: [],
info : {}
};
},
created() {
goods(this.$Route.query.id).then(res => {
console.log(res)
this.cover = res.pictures
this.info = {
name : res.name,
companyName : res.company.name,
createdAt : res.created_at,
sales : res.sales,
integrity : res.company.integrity,
skusUnit : res.skus[0].unit
}
}).catch(err => {
uni.showToast({
title: err.message,
icon : 'none'
})
})
}
}
</script>
<style lang="scss">
// 数权
.goods-cover{
width: 100%;
padding-top: 100%;
position: relative;
background: #f5f5f5;
.swiper{
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
.swiper-item{
height: 100%;
width: 100%;
}
.swiper-cover{
@extend .swiper-item;
}
}
}
// 锚定商品详情
.info{
background: white;
padding: $padding;
.info-item{
padding-left: 200rpx;
height: 70rpx;
line-height: 70rpx;
position: relative;
text-align: right;
font-size: $title-size-m;
@extend .nowrap;
label{
position: absolute;
left: 0;
top: 0;
width: 200rpx;
text-align: left;
color: $text-gray;
}
}
}
</style>

153
pages/market/index.vue Normal file
View File

@@ -0,0 +1,153 @@
<template>
<view>
<view class="tabs">
<view class="tabs-item" :class="{'show': tabIndex == 0}" @click="onTabs" data-index="0">最新</view>
<view class="tabs-item" :class="{'show': tabIndex == 1}" @click="onTabs" data-index="1">
价格
<image
class="icon"
mode="widthFix" :src="require(marketType == 'asc' ? '@/static/icons/market_icon_low.png': '@/static/icons/market_icon_high.png')"
/>
</view>
</view>
<view class="lists">
<view class="item" v-for="(item, index) in marketArray" :key="index" @click="onDetails(item)">
<image class="cover" :src="item.goods.cover" mode="aspectFill"></image>
<view class="content">
<view class="title nowrap">数字权证<text>{{item.surplus}}/{{item.stock}}</text></view>
<view class="text nowrap">锚定商品{{item.goods.goods_name}}</view>
<view class="text nowrap">供应商{{item.company.name}}</view>
<view class="text nowrap">转让用户{{item.user.nickname}}</view>
</view>
<view class="price">{{item.price}}/</view>
</view>
</view>
</view>
</template>
<script>
import { markets } from '@/apis/interfaces/market'
export default {
data() {
return {
tabIndex : 0,
marketType : 'asc',
marketArray : [],
page : {}
};
},
onShow() {
this.getMarkets()
},
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 == 'asc' ? 'desc': 'asc'
this.tabIndex = index
this.getMarkets()
},
// 获取转让市场
getMarkets(){
markets({
sort: this.tabIndex == 1 ? this.marketType : ''
}).then(res => {
this.marketArray = res.data
this.page = res.page
})
},
// 转让商品详情
onDetails(e){
this.$Router.push({name: 'marketDetails', params: {marketId: e.market_id}})
console.log(e)
}
},
onNavigationBarButtonTap(){
this.$Router.push({name: "marketLogs"})
}
}
</script>
<style lang="scss" scoped>
.tabs{
position: fixed;
top: 0;
left: 0;
z-index: 9;
width: 100%;
display: flex;
justify-content: space-around;
background: white;
height: 70rpx;
line-height: 70rpx;
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: $mian-color;
}
}
}
// 列表
.lists{
padding: 70rpx $padding $padding;
.item{
min-height: 168rpx;
position: relative;
background: white;
border-radius: $radius/2;
margin-top: $margin;
padding: $padding;
.cover{
position: absolute;
left: $padding;
top: $padding;
width: 168rpx;
height: 168rpx;
}
.content{
padding-left: calc(168rpx + #{$padding});
.title{
position: relative;
font-size: $title-size-lg;
color: $text-color;
font-weight: bold;
line-height: 52rpx;
padding-right: 60rpx;
text{
position: absolute;
right: 0;
top: 0;
width: 60rpx;
text-align: right;
font-weight: normal;
}
}
.text{
font-size: $title-size-sm;
color: $text-gray;
height: 40rpx;
line-height: 40rpx;
}
}
.price{
margin-top: $margin - 10;
padding-top: $padding - 10;
font-size: $title-size-m;
text-align: right;
border-top: solid 1rpx $border-color;
font-weight: bold;
color: $text-price;
}
}
}
</style>

166
pages/market/logs.vue Normal file
View File

@@ -0,0 +1,166 @@
<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>
{{item.goods.goods_name}}
</view>
<view class="logs-item">
<label>交易单价</label>
{{item.price}}
</view>
<view class="logs-item">
<label>交易数量</label>
{{item.qty}}
</view>
<view class="logs-item">
<label>转让用户</label>
{{item.sellUser.nickname}}
</view>
<view class="logs-item">
<label>购买用户</label>
{{item.buyUser.nickname}}
</view>
<view class="logs-item">
<label>交易时间</label>
{{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, marketsOrdersLogs } from '@/apis/interfaces/market'
export default {
data() {
return {
logs: [],
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 => {
this.logs = res.data
this.page = res.page
}).catch(err => {
uni.showToast({
title: err.message,
icon : 'none'
})
})
}
}
}
</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: $mian-color;
color: $mian-color;
}
}
}
.paddingTop{
padding-top: 90rpx;
}
.logs{
background: white;
margin-top: $margin;
padding: ($padding - 10) $padding;
.logs-item{
padding-left: 200rpx;
height: 50rpx;
line-height: 50rpx;
position: relative;
text-align: right;
font-size: $title-size-m;
@extend .nowrap;
label{
position: absolute;
left: 0;
top: 0;
width: 200rpx;
text-align: left;
color: $text-gray;
}
}
}
// 空提示
.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>

203
pages/market/management.vue Normal file
View File

@@ -0,0 +1,203 @@
<template>
<view class="NumberWeight">
<view class="header-tabs">
<view class="tabs-item" :class="{'show' : status === ''}" @click="onTabs('')">全部</view>
<view class="tabs-item" :class="{'show' : status === 1}" @click="onTabs(1)">转让中</view>
<view class="tabs-item" :class="{'show' : status === 2}" @click="onTabs(2)">已取消</view>
</view>
<!-- 有订单列表 -->
<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>
<uni-load-more :status="pageMore"></uni-load-more>
</view>
<!-- 没有订单列表 -->
<no-list v-if="lists.length === 0" name="no-order" txt="暂无数据~" />
</view>
</template>
<script>
import { marketsMag, marketsCancel } from '@/apis/interfaces/market';
export default {
data() {
return {
lists : [],
page : 1,
status : '',
total : 0,
pageMore: 'more'
};
},
onLoad() {
this.getList();
},
onReachBottom() {
if (this.pageMore) {
this.page = this.page + 1;
this.getList();
}
},
methods: {
onTabs(status){
this.status = status
this.page = 1
this.getList()
},
getList() {
if(this.page === 1){
this.lists = []
}
marketsMag({
status : this.status,
page : this.page
}).then(res => {
this.lists = this.lists.concat(res.markets.data);
this.total = res.markets.page.current;
this.pageMore = res.markets.page.has_more ? 'more' : 'noMore';
}).catch(err => {
uni.showToast({
title: err.message,
icon : 'none'
})
});
},
// 取消转让
removeGoods(id, index) {
marketsCancel(id).then(res => {
uni.showToast({
icon : 'none',
title: res
})
if(this.status === ''){
let statusObj = this.lists[index]
statusObj.status = {
value: 2,
text : '已取消',
}
this.$set(this.lists, index, statusObj)
return
}
if(this.status === 1 || this.status === 2){
this.lists.splice(index, 1)
}
}).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;
padding-top: 90rpx;
.header-tabs{
position: fixed;
top: 0;
left: 0;
width: 100%;
line-height: 90rpx;
font-size: $title-size-lg;
height: 90rpx;
z-index: 99;
display: flex;
justify-content: space-around;
background: white;
.tabs-item{
color: $text-gray;
width: 33.33%;
text-align: center;
&.show{
color: $mian-color;
font-weight: bold;
}
}
}
// 订单列表
.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: $mian-color;
color: white;
padding: 0 $padding;
line-height: 50rpx;
border-radius: 25rpx;
font-size: $title-size-m;
}
.order-status{
color: $text-gray-m;
}
}
}
}
</style>

249
pages/market/transfer.vue Normal file
View File

@@ -0,0 +1,249 @@
<template>
<view v-if="!loding">
<!-- 产品信息 -->
<view class="goods">
<image class="cover" :src="info.goods.cover" mode="aspectFill"></image>
<view class="content">
<view class="title nowrap">数字权证</view>
<view class="text nowrap">锚定商品{{info.goods.goods_name}}</view>
<view class="text nowrap">提供企业{{info.goods.company.name}}</view>
<view class="text nav-goods nowrap" @click="onGoods">查看锚定商品信息<uni-icons type="arrowright" size="12" color="#8b64fd"></uni-icons></view>
</view>
<view class="info">
<view class="info-item">
<label>权证销售单价</label>
{{info.goods.price}}
</view>
<view class="info-item">
<label>拥有数量</label>
{{info.account.balance}}
</view>
<view class="info-item">
<label>转让价格</label>
<input class="info-input" type="digit" v-model="pirce" placeholder="输入转让价格" maxlength="5" @blur="calculatePirce" />
</view>
<view class="info-item info-flex">
<label>转让数量</label>
<uni-number-box class="info-number" v-model='stock' :min="1" :max="info.account.balance" @change="countPrice"></uni-number-box>
</view>
<view class="info-item">
<label>预估转让收益</label>
<view class="price">{{forecast}}</view>
</view>
</view>
</view>
<button class="buy-btn" type="default" @click="onCreate">确认转让</button>
<u-toast ref="uToast" />
</view>
</template>
<script>
import { marketsCreateInfo, marketsCreate } from '@/apis/interfaces/market'
export default {
data() {
return {
loding : true,
pirce : '',
stock : 1,
info : {},
forecast: '0.00'
};
},
onShow() {
marketsCreateInfo(this.$Route.query.symbol).then(res =>{
this.info = res
this.loding = false
}).catch(err => {
uni.showToast({
title: err.message,
icon : 'none'
})
})
},
methods:{
// 查看锚定产品
onGoods(){
this.$Router.push({name: 'marketGoods', params: { id: this.info.goods.goods_id }})
},
// 转让数量
countPrice(e){
this.stock = e
this.calculatePirce()
},
// 计算预估收益
calculatePirce(){
this.forecast = (this.pirce * this.stock).toFixed(2)
},
// 提交转让市场
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,
price : this.pirce || 0
}).then(res => {
uni.setStorageSync('refresh', true)
uni.showModal({
title : '提示',
content : res,
showCancel : false,
success : () => {
this.$Router.back()
}
})
}).catch(err => {
console.log(err)
uni.showToast({
title: err.message,
icon : 'none'
})
})
}
}
}
}
</script>
<style lang="scss" scoped>
// 转让权证
.buy-btn{
margin: 0 $margin;
background: $mian-color;
color: white;
height: 90rpx;
line-height: 90rpx;
padding: 0;
border-radius: $radius/2;
font-size: $title-size;
font-weight: bold;
&::after{
border: none;
}
}
// 产品信息
.goods{
min-height: 168rpx;
position: relative;
background: white;
border-radius: $radius/2;
margin: $margin;
padding: $padding;
.cover{
position: absolute;
left: $padding;
top: $padding;
width: 168rpx;
height: 168rpx;
}
.content{
padding-left: calc(168rpx + #{$padding});
.title{
position: relative;
font-size: $title-size-lg;
color: $text-color;
font-weight: bold;
line-height: 52rpx;
padding-right: 60rpx;
text{
position: absolute;
right: 0;
top: 0;
width: 60rpx;
text-align: right;
font-weight: normal;
}
}
.text{
font-size: $title-size-sm;
color: $text-gray;
height: 40rpx;
line-height: 40rpx;
&.nav-goods{
color: $mian-color;
}
}
}
.info{
margin-top: $margin;
border-top: solid 1rpx $border-color;
padding-top: $padding;
.info-item{
padding-left: 200rpx;
height: 90rpx;
line-height: 90rpx;
position: relative;
text-align: right;
font-size: $title-size-lg;
&.info-flex{
display: flex;
justify-content: flex-end;
align-items: center;
}
@extend .nowrap;
label{
position: absolute;
left: 0;
top: 0;
width: 200rpx;
text-align: left;
color: $text-gray;
}
.info-input{
height: 80rpx;
line-height: 80rpx;
font-size: $title-size-lg;
}
.price{
color: $text-price;
font-weight: bold;
}
}
}
}
// 购买产品
.popup {
width: 100%;
background-color: #fff;
padding-bottom: $padding;
.title {
font-size: 36rpx;
text-align: center;
padding: 50rpx 30rpx 30rpx 30rpx;
font-weight: bold;
}
.btn {
background-color: $text-price;
height: 90rpx;
line-height: 90rpx;
text-align: center;
color: #fff;
font-weight: bold;
font-size: $title-size;
margin: $padding * 2;
border-radius: $radius/2;
}
.des {
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
box-sizing: border-box;
padding: $padding $padding * 2;
color: $text-gray;
font-size: $title-size-lg;
text{
color: $text-color;
}
.price{
color: $mian-color;
font-weight: bold;
}
}
}
</style>

View File

@@ -12,7 +12,7 @@
<view class="time">{{item.created_at}}</view>
<view class="read_at" v-if="item.read_at === ''"></view>
</view>
<no-list v-if="items.length === 0" name='no-new1' txt="空空如也~" />
<no-list v-if="items.length === 0" name='no-news' txt="空空如也~" />
</view>
</template>

64
pages/queue/queue.vue Normal file
View File

@@ -0,0 +1,64 @@
<template>
<view>
<view class="item" v-for="(item, index) in items" :key="index" @click="onEnqueue(item)">{{item}}入列</view>
</view>
</template>
<script>
import Queue from '@/public/queue'
let queue = new Queue()
export default {
data() {
return {
items: [0,1,2,3,4,5,6,7,8,9],
start: false
};
},
created() {
},
methods:{
onEnqueue(e){
let startTime
queue.enqueue(e)
if(!this.start){
this.start = true
this.startQueue(queue, startTime)
}
},
startQueue(outTime){
outTime = setInterval(() => {
if(queue.isNull()){
clearInterval(outTime)
this.start = false
return
}
queue.front().then(val => {
console.log(val)
// 此处处理对接接口请求
})
queue.dequeue()
}, 1000)
}
}
}
</script>
<style lang="scss">
.item{
margin: $margin;
background: white;
text-align: center;
color: $mian-color;
line-height: 90rpx;
font-weight: bold;
}
.button{
background: white;
margin: $margin;
height: 90rpx;
line-height: 90rpx;
text-align: center;
}
</style>

View File

@@ -57,7 +57,7 @@
</view>
</view>
<!-- 关于我们 -->
<view @click="$router.push({name:'aboutUs'})" class="list-item">
<view @click="$Router.push({name:'aboutUs'})" class="list-item">
<view class="list-item-left">
<image src="/static/imgs/mine-about.png" mode="widthFix" />
<span>关于链商星球</span>
@@ -282,7 +282,7 @@
},
loginOut() {
this.$store.commit('setToken', '')
this.$Router.push({name: 'Index'})
this.$Router.replaceAll({name: 'Index'})
},
// 上传头像
updImgs(type) {

View File

@@ -211,27 +211,15 @@
</script>
<style lang="scss" scoped>
.basics-content{
padding-bottom: ($padding*3) + 90;
}
// 按钮组
.basisc-btn{
position: fixed;
bottom: 0;
left: 0;
right: 0;
padding: $padding;
background: white;
margin-top: $margin - 10;
display: flex;
justify-content: space-between;
box-shadow: 0 0 4rpx 4rpx rgba($color: #000000, $alpha: .02);
.add-modules{
line-height: 86rpx;
height: 88rpx;
text-align: center;
color: $text-price;
color: $mian-color;
background: white;
width: calc(50% - 15rpx);
margin-right: 30rpx;

View File

@@ -1,10 +1,10 @@
<template>
<view class="lists">
<block v-if="lists.length > 0">
<view class="header-flex">
<!-- <view class="header-flex">
门店数量{{total}}
<view class="add-btn" @click="$Router.push({name: 'shopCreate'})">添加门店</view>
</view>
</view> -->
<view class="lists-item" v-for="(item, index) in lists" :key="index" @click="$Router.push({name: 'shopCreate', params: { id: item.store_id }})">
<view class="header">
<image class="logo" :src="item.cover" mode="aspectFill"></image>
@@ -41,6 +41,9 @@
this.lists = res.data
this.total = res.page.total
})
},
onNavigationBarButtonTap() {
this.$Router.push({name: 'shopCreate'})
}
}
</script>

249
pages/store/Spread.vue Normal file
View File

@@ -0,0 +1,249 @@
<template>
<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="companyInfo.cover" mode="aspectFill"></image>
<view class="company-cont">
<view class="nowrap company-name">{{companyInfo.name}}</view>
<view class="company-tips">易货平台</view>
</view>
</view>
<view class="code">
<image class="code-img" :src="companyInfo.code" mode="aspectFit"></image>
<!-- <view class="code-text">简单扫一扫即可进入平台</view> -->
</view>
<!-- @click="shareCanvas" -->
<view class="codeBnt">
扫码推广
</view>
</view>
</view>
<canvas class="codeImg" canvas-id="qrcodeCard"></canvas>
</view>
</template>
<script>
import { companiesCode } from '@/apis/interfaces/store'
export default {
data() {
return {
companyInfo : ''
}
},
created() {
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: #e93340;
height: 100vh;
width: 100vw;
}
.codeContent {
position: relative;
width: 100%;
height: 100vh;
.codeContent-back {
width: 100%;
height: 100%;
z-index: 1;
position: absolute;
}
.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: #e1293f;
text-align: center;
border-radius: 10rpx;
line-height: 90rpx;
font-weight: 600;
font-size: $title-size;
color: #FFFFFF;
box-shadow: 4rpx 0 10rpx rgba(155,0,19,.5);
position: relative;
}
/* canvas */
.codeImg {
position: absolute;
left: -1000%;
height: 603px;
width: 375px;
background: white;
}
</style>

538
pages/store/basics.vue Normal file
View File

@@ -0,0 +1,538 @@
<template>
<view class="ios-bottom">
<view class="info">
<view class="item info-logo" @click="updImg('logo', '')">
<label>企业LOGO</label>
<image :src="logo" mode="aspectFill"></image>
<uni-icons class="icon" color="#999" size="18" type="arrowright"></uni-icons>
</view>
<view class="item info-text">
<label>企业简介</label>
<textarea v-model="description" placeholder="输入企业简介" />
</view>
<view class="item info-text">
<label>企业地址</label>
<input v-model="address" placeholder="输入企业地址" />
</view>
</view>
<block v-for="(module, moduleIndex) in modules" :key="moduleIndex">
<view class="module-item" v-if="module.type === 1">
<view class="module-title">
<input class="title-input" type="text" v-model="module.title" placeholder="输入标题" />
<view class="remove-btn" @click="removeModule(moduleIndex)">删除</view>
</view>
<view class="module-textarea">
<textarea placeholder="输入文字内容" v-model="module.content.content" />
</view>
</view>
<view class="module-item" v-if="module.type === 2">
<view class="module-title">
<input class="title-input" type="text" v-model="module.title" placeholder="输入标题" />
<view class="remove-btn" @click="removeModule(moduleIndex)">删除</view>
</view>
<view class="module-imgs">
<view
class="item"
v-for="(item, index) in module.content.image"
:key="index"
>
<image
class="cover"
:src="item.showpath"
mode="aspectFill"
@click="openImg(module.content.image, index, 'imgs')"
@longpress="removeImg('imgs', moduleIndex, index)"
/>
<view class="item-input">
<input type="text" v-model="item.title" placeholder="输入标题" />
</view>
</view>
<view class="item" @click="updImgs(moduleIndex)">
<view class="item-upd cover">
<uni-icons type="plus" size="20" color="#999"/>
<view>上传图片</view>
</view>
</view>
</view>
<view class="module-hint">点击查看图片长按删除图片</view>
</view>
<view class="module-item" v-if="module.type === 3">
<view class="module-title">
<input class="title-input" type="text" v-model="module.title" placeholder="输入标题" />
<view class="remove-btn" @click="removeModule(moduleIndex)">删除</view>
</view>
<view class="module-videos">
<view class="item">
<block v-if="module.content.video_image.showpath != ''">
<image
class="cover"
:src="module.content.video_image.showpath"
mode="aspectFill"
@click="openImg([module.content.video_image.showpath], 0, 'videos')"
@longpress="removeImg('videoCover', moduleIndex, '')"
/>
</block>
<block v-else>
<view class="item-upd" @click="updImg('videoCover', moduleIndex)">
<uni-icons type="plus" size="20" color="#999"/>
<view>上传视频封面</view>
</view>
</block>
</view>
<view class="item">
<video
class="cover"
v-if="module.content.video_url.showpath != ''"
:src="module.content.video_url.showpath"
@longpress="removeImg('video', moduleIndex, '')"
/>
<view class="item-upd" @click="updImg('video', moduleIndex)" v-else>
<uni-icons type="plus" size="20" color="#999"/>
<view>上传视频</view>
</view>
</view>
</view>
<view class="module-hint">点击查看封面/视频长按删除封面
<span class='delVideo' v-if="module.content.video_url.showpath != ''"
@longpress="removeImg('video', moduleIndex, '')">长按删除视频</span>
</view>
</view>
</block>
<view class="add-modules" @click="addModule">
<uni-icons class="icon" type="plus" size="18" color="#c82626"/> 添加展示模块
</view>
</view>
</template>
<script>
import { basicsInfo, basicsConfig } from '@/apis/interfaces/store'
import { uploads } from '@/apis/interfaces/uploading'
export default {
data() {
return {
logo : '',
description : '',
address : '',
modules : [],
modulesType : []
};
},
created() {
Promise.all([basicsInfo('GET', {}), basicsConfig()]).then(res => {
console.log(res)
let info = res[0]
this.logo = info.base.cover
this.description = info.base.description
this.modules = info.extends
this.address = info.info.address
this.modulesType = res[1]
}).catch(err => {
uni.showToast({
title: err.message,
icon : 'none'
})
})
},
methods:{
// 图片预览
openImg(paths, index, type){
if(type === 'imgs'){
paths = paths.map(val => {
return val.showpath
})
}
uni.previewImage({
urls : paths,
current : index,
indicator: 'number'
})
},
// 删除图片
removeImg(type, moduleIndex, index){
let modulesObj = this.modules[moduleIndex]
if(type === 'videoCover'){
modulesObj.content.video_image.showpath = ''
modulesObj.content.video_image.path = ''
}
if(type === 'imgs'){
modulesObj.content.image.splice(index, 1)
}
if(type === 'video'){
modulesObj.content.video_url.showpath = ''
modulesObj.content.video_url.path = ''
}
this.$set(this.modules, moduleIndex, modulesObj)
},
// 单图上传
updImg(type, index){
switch(type){
case 'logo':
uni.chooseImage({
crop: {width: 300, height: 300},
success: path=> {
uploads([{
name: 'logo',
uri : path.tempFilePaths[0]
}]).then(res => {
this.logo = res.url[0]
}).catch(err => {
uni.showToast({
title: err.message,
icon : 'none'
})
})
}
})
break
case 'videoCover':
uni.chooseImage({
crop: {width: 500, height: 350},
success: path=> {
uploads([{
name: 'logo',
uri : path.tempFilePaths[0]
}]).then(res => {
let modulesObj = this.modules[index]
modulesObj.content.video_image.showpath = res.url[0]
modulesObj.content.video_image.path = res.path[0]
this.$set(this.modules, index, modulesObj)
}).catch(err => {
uni.showToast({
title: err.message,
icon : 'none'
})
})
}
})
break
case 'video':
uni.chooseVideo({
success: path=> {
uploads([{
name: 'video',
uri : path.tempFilePath
}]).then(res => {
let modulesObj = this.modules[index]
modulesObj.content.video_url.showpath = res.url[0]
modulesObj.content.video_url.path = res.path[0]
this.$set(this.modules, index, modulesObj)
}).catch(err => {
uni.showToast({
title: err.message,
icon : 'none'
})
})
}
})
break
}
},
// 批量上传图片
updImgs(index){
uni.chooseImage({
success: res=>{
let path = res.tempFiles.map((val, index) => {
return {
name: 'uploads' + index,
uri : val.path
}
})
uploads(path).then(pathRes => {
let modulesObj = this.modules[index],
paths = []
for(let i in pathRes.path){
paths.push({
showpath: pathRes.url[i],
path : pathRes.path[i],
title : ''
})
}
modulesObj.content.image = [...modulesObj.content.image, ...paths]
this.$set(this.modules, index, modulesObj)
}).catch(err => {
uni.showToast({
title: err.message,
icon : 'none'
})
})
}
})
},
// 添加展示模块
addModule(){
console.log('添加模板,,,,')
let modulesList = this.modulesType.map(val => {
return val.value
})
uni.showActionSheet({
itemList: modulesList,
success : res => {
let content
switch(this.modulesType[res.tapIndex].id){
case 1:
content = {
content: ''
}
break
case 2:
content = {
image: [{
showpath: '',
path : '',
title : ''
}]
}
break
case 3:
content = {
video_image: {
showpath: '',
path : ''
},
video_url : {
showpath: '',
path : ''
}
}
break
}
this.modules.push({
type : this.modulesType[res.tapIndex].id,
title : '',
content : content
})
}
})
},
// 删除展示模块
removeModule(index){
this.modules.splice(index, 1)
},
// 保存基础信息
onNavigationBarButtonTap(e){
basicsInfo('PUT', {
cover : this.logo,
description : this.description,
address : this.address,
extends : this.modules
}).then(res => {
uni.showModal({
title : '提示',
content : '基本信息已保存',
showCancel : false,
success : modalRes=> {
if(modalRes.confirm){
this.$Router.back()
}
}
})
}).catch(err => {
uni.showToast({
title: err.message,
icon : 'none'
})
})
}
}
}
</script>
<style lang="scss" scoped>
// 基础信息
.info{
background: white;
padding: 0 $padding;
.item{
position: relative;
padding: $padding 0 $padding 200rpx;
&::after{
position: absolute;
left: 0;
bottom: 0;
right: -$padding;
content: " ";
height: 1rpx;
background: #eee;
}
&:last-child::after{
display: none;
}
}
.info-logo{
text-align: right;
padding-right: 40rpx;
label{
position: absolute;
left: 0;
height: 88rpx;
line-height: 88rpx;
}
image{
width: 88rpx;
height: 88rpx;
border-radius: 50%;
vertical-align: top;
background: $border-color-lg;
}
.icon{
position: absolute;
right: 0;
top: 50%;
margin-top: -10px;
}
}
.info-text{
label{
position: absolute;
left: 0;
height: 40rpx;
line-height: 40rpx;
}
textarea{
line-height: 40rpx;
width: 100%;
height: 160rpx;
}
input{
height: 40rpx;
width: 100%;
}
}
}
// 模块
.add-modules{
line-height: 90rpx;
text-align: center;
color: $text-price;
background: white;
margin-top: $margin;
position: relative;
z-index: 10;
.icon{
vertical-align: middle;
margin-right: $margin/3;
}
}
// 展示模块
.module-item{
background: white;
padding: $padding/2 $padding;
margin-top: $margin;
.module-title{
display: flex;
justify-content: space-between;
padding-bottom: $padding/2;
border-bottom: solid 1rpx $border-color;
.title-input{
width: calc(100% - 150rpx);
height: 70rpx;
font-size: $title-size;
}
.remove-btn{
line-height: 70rpx;
color: $text-price;
text-align: right;
font-size: $title-size-m;
}
}
.module-textarea{
padding: $padding 0 $padding/2;
width: 100%;
font-size: $title-size;
line-height: 50rpx;
height: 200rpx;
}
.module-imgs{
display: flex;
flex-wrap: wrap;
padding-top: $padding/2;
margin-left: -10rpx;
margin-right: -10rpx;
.item{
position: relative;
background: #F8F8F8;
width: calc(25% - 20rpx);
padding-top: calc(25% - 20rpx);
margin: 10rpx;
.cover{
position: absolute;
width: 100%;
height: 100%;
top: 0;
left: 0;
}
.item-input{
position: absolute;
bottom: 0;
left: 0;
right: 0;
background: rgba($color: #000000, $alpha: .7);
input{
height: 50rpx;
line-height: 50rpx;
font-size: 28rpx;
text-align: center;
z-index: 4;
color: white;
}
}
.item-upd{
@extend .vertical;
text-align: center;
font-size: $title-size-m;
color: $text-gray-m;
}
}
}
.module-hint{
color: $text-gray;
font-size: $title-size-sm;
padding: $padding/2 0;
line-height: 50rpx;
.delVideo{
display: inline-block;
background-color: $mian-color;
color: #fff;
margin-left: 30rpx;
padding:2rpx 20rpx ;
}
}
.module-videos{
display: flex;
padding: $padding 0 ($padding/2);
margin-left: -10rpx;
margin-right: -10rpx;
.item{
position: relative;
width: calc(50% - #{$margin/2});
padding-top: calc(35% - #{$margin/2});
background: #f8f8f8;
margin: 0 10rpx;
.item-upd{
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
text-align: center;
font-size: $title-size-m;
color: $text-gray-m;
line-height: 40rpx;
@extend .vertical;
}
.cover{
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
}
}
}
</style>

368
pages/store/customer.vue Normal file
View File

@@ -0,0 +1,368 @@
<template>
<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>
<!-- 统计信息 -->
<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.goods_count}} </text>
<text>成交产品金额 {{visitor.total}} </text>
</view>
</view>
<!-- 数据列表 -->
<view class="lists">
<block v-if="orders.length > 0">
<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.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-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">
<image class="icon" src="@/static/icons/listnull-icon.png" mode="widthFix"></image>
<view class="sub-title">暂无相关成交客户记录</view>
</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 { orderUsers } from '@/apis/interfaces/store'
export default {
data() {
return {
tabsIndex : 'day',
dateValue : '',
endDate : '',
visitor : {
day: 0,
all: 0
},
orders : [],
sort : '',
payType : '',
channel : '',
// 分页
pageStatus : '',
page : 1
};
},
created() {
getDate().then(res => {
this.dateValue = res
this.endDate = res
this.getLists()
})
},
methods:{
// tabs筛选
onTbas(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(){
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 = 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,
icon : 'none'
})
})
}
},
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;
height: 40vh;
background: white;
text-align: center;
@extend .vertical;
.sub-title{
color: $text-gray;
font-size: $title-size-m;
}
.icon{
width: 288rpx;
}
}
// content
.content{
padding-top: 80rpx;
}
// tabs
.tabs{
position: fixed;
z-index: 99;
top: 0;
//#ifdef H5
top: 100rpx;
//#endif
left: 0;
width: 100%;
display: flex;
background: white;
justify-content: space-around;
line-height: 80rpx;
font-size: $title-size-m;
color: $text-gray;
.item.show{
color: $text-price;
font-weight: bold;
}
}
// 统计信息
.statistics{
margin-top: $margin;
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;
line-height: 60rpx;
.arrowdown{
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;
line-height: 50rpx;
text{
margin-left: $margin;
&:first-child{
margin: 0;
}
}
}
}
// 客户列表
.lists{
padding: $padding/2 0;
background: white;
.item{
padding: ($padding - 10) $padding ($padding - 10) ($padding*2 + 68);
position: relative;
min-height: 68rpx;
&::after{
position: absolute;
left: $padding*2 + 68;
top: 0;
right: 0;
content: ' ';
border-bottom: solid 1rpx $border-color;
}
&:first-child::after{
display: none;
}
.cover{
position: absolute;
left: $padding;
top: $padding - 10;
width: 68rpx;
height: 68rpx;
border-radius: 50%;
background-color: #eee;
}
.title{
padding-right: 200rpx;
position: relative;
line-height: 58rpx;
font-size: $title-size-lg;
.type{
position: absolute;
right: 0;
top: 0;
width: 180rpx;
text-align: right;
color: $text-price;
}
}
.sub-title{
line-height: 40rpx;
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>

131
pages/store/deliver.vue Normal file
View File

@@ -0,0 +1,131 @@
<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" @navDetail="$Router.push({name: 'goodsDetails', params:{id: $event.id}})" />
<!-- 分页 -->
<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 : '',
pageCurrent : 1
}
},
onShow() {
// 获取退货单列表
this.returnData();
},
methods: {
// 退货单列表
returnData(){
storeDeliver({
state: this.selectNavId,
page : this.pageCurrent
}).then(res=>{
if(res.page.current === 1){
this.returnInfo = []
}
this.returnInfo = this.returnInfo.concat(res.data)
this.pageCurrent = res.page.current
this.pageStatus = res.page.has_more ? 'more': 'noMore'
})
},
// 选择订单
selectNav(id) {
if (this.selectNavId !== id) {
this.selectNavId = id
this.pageCurrent = 1
this.returnData()
}
},
// 下拉加载
onReachBottom() {
if(this.pageStatus == 'more'){
this.pageStatus = 'loading'
this.pageCurrent += 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: $mian-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
View 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: $mian-color;
color: white;
border-color: $mian-color;
margin: $margin;
}
</style>

117
pages/store/examine.vue Normal file
View File

@@ -0,0 +1,117 @@
<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.showModal({
title : '提示',
content : '订单已审核',
showCancel : false,
success : ()=> {
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: $mian-color;
color: white;
border-color: $mian-color;
margin: $margin;
}
</style>

306
pages/store/index.vue Normal file
View File

@@ -0,0 +1,306 @@
<template>
<view class="content" v-if="!loding">
<block v-if="this.$store.state.token != ''">
<block v-if="!certification">
<!-- 企业认证 -->
<view class="statusBar">
<view class="statusBar-title">企业工具</view>
</view>
<view class="store-login">
<block v-if="appliesState.code === -1">
<image class="icon" src="@/static/icons/approve-icon.png" mode="widthFix"></image>
<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>
<view class="sub-title">{{appliesState.message}}</view>
<button type="default" @click="$Router.push({name: 'Approve', params: {formType: 'put'}})">重新提交认证</button>
</block>
<block v-else-if="appliesState.code === 0">
<image class="icon" src="@/static/icons/audit-icon.png" mode="widthFix"></image>
<view class="sub-title">{{appliesState.message}}</view>
</block>
</view>
</block>
<block v-else>
<view class="statusBar">
<view class="statusBar-box">
<image class="logo" :src="company.logo" mode="aspectFill"></image>
<view class="company">
<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>
</view>
</view>
</view>
</view>
<!-- 老板 -->
<boss v-if="!employee" :word-data="workbench"/>
<!-- 员工 -->
<staff v-if="employee" :tool-list="toolList"/>
</block>
</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 { index } from '@/apis/interfaces/store'
import { isallow, appliesQuery } from '@/apis/interfaces/company'
import { employeesTool } from '@/apis/interfaces/employees'
import boss from '@/components/store-boss/store-boss'
import staff from '@/components/store-staff/store-staff'
import userAuth from '@/public/userAuth'
export default {
components:{
boss,
staff
},
data() {
return {
loding : true,
appliesState : {},
certification: false,
employee : false,
workbench : {},
company : {},
toolList : ''
}
},
onShow(){
this.getIndex()
},
methods: {
// 首页数据
getIndex(){
if(this.$store.state.token == ''){
this.loding = false
return
}
index().then(res => {
this.certification = res.is_certification
if(!res.is_certification){
this.getAppliesQuery()
return
}
this.company = {
logo : res.cover,
name : res.name,
identity: res.company_identity,
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 =>{
uni.showToast({
title: err.message,
icon : 'none'
})
})
},
// 查询企业认证状态
getAppliesQuery(){
appliesQuery().then(res=>{
this.appliesState = res
this.loding = false
}).catch(err => {
uni.showToast({
title: err.message,
icon : 'none'
})
})
},
// 登录
login(){
let auth = new userAuth()
auth.Login().then(res => {
if(res.auth) this.getIndex()
}).catch(err => {
uni.showToast({
title: err.message,
icon : 'none'
})
})
},
// 开通vip
onRightBtn(){
isallow().then(res =>{
this.$Router.push({name: 'Approve'})
}).catch(err =>{
uni.showModal({
title : '提示',
content : '暂未开通商家vip无法开通店铺工具',
confirmText : '立即开通',
success : res=> {
if(res.confirm){
this.$Router.push({name: 'Vip'})
}
}
})
})
},
// 跳转到创建企业选择企业类型的页面
onRightBtn1(){
this.$Router.push({name: 'Registered'})
}
}
}
</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;
}
}
// 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);
background-color: #fff;
}
.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>

83
pages/store/journal.vue Normal file
View 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>

133
pages/store/logistic.vue Normal file
View File

@@ -0,0 +1,133 @@
<template>
<view>
<!-- 物流状态 start -->
<view class="state" v-if="logistic.length > 0">
<view class="take">
<view class="take-name">收件人{{express.courier_name}}<text>{{express.mobile}}</text></view>
<view class="take-address">收货地址{{express.full_address}}</view>
</view>
<view class="list">
<view v-for="(item, index) in logistic" :key="index" class="list-label">
<view class="list-status">{{item.status}}</view>
<view class="list-text">{{item.context}}</view>
<view class="list-time">{{item.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 : '',
express : {},
logistic: []
}
},
created() {
deliverLogistic(this.$Route.query.id).then(res=>{
this.express = res.express
this.logistic = res.logistics
}).catch(err => {
this.message = err.message
})
},
methods: {
}
}
</script>
<style lang="scss" scoped>
page {
background-color: #f6f6f6;
}
// 物流状态
.state {
margin-top: $margin;
.take {
background: white;
padding: $padding;
.take-name{
font-weight: bold;
font-size: $title-size + 4;
text{
font-weight: normal;
padding-left: 10rpx;
}
}
}
.list{
padding: $padding;
margin-top: $margin;
background: white;
.list-label{
position: relative;
padding-left: 50rpx;
padding-bottom: $padding;
&::before{
position: absolute;
content: " ";
left: 0;
top: 16rpx;
background: $border-color;
height: 25rpx;
width: 25rpx;
border:solid 5rpx rgba($color: white, $alpha: 1);
box-sizing: border-box;
border-radius: 50%;
z-index: 1;
}
&::after{
width: 2rpx;
background: $border-color;
content: " ";
position: absolute;
height: 100%;
top: 30rpx;
left: 12rpx;
}
&:first-child::before{
background: $mian-color;
border:solid 5rpx rgba($color: white, $alpha: .5);
}
&:last-child::after{
display: none;
}
.list-status{
line-height: 50rpx;
font-weight: bold;
font-size: $title-size;
}
.list-text{
color: $text-gray;
}
.list-time{
color: $text-gray-m;
font-size: $title-size-sm;
}
}
}
}
// 暂无订单
.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>

View 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>

183
pages/store/return.vue Normal file
View File

@@ -0,0 +1,183 @@
<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: 'process'
}, {
name: '完成退货',
id: 'completed'
}
],
selectNavId: 'apply',
// 分页
pageStatus: '',
goodsPage : 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) {
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 $mian-color;
color: $mian-color;
}
}
</style>

209
pages/store/visitors.vue Normal file
View File

@@ -0,0 +1,209 @@
<template>
<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>
<!-- 统计信息 -->
<view class="statistics">
<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-text">
<text>访客量 {{visitor.factor}} </text>
<text>累计访客量 {{visitor.all}} </text>
</view>
</view>
<!-- 数据列表 -->
<block v-if="orders.length > 0">
<view class="lists">
<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.content || '-'}}</view>
<view class="sub-title">手机号码: {{item.mobile || '-'}}</view>
<view class="sub-title">访问时间: {{item.date || '-'}}</view>
</view>
</view>
</block>
<block v-else>
<view class="list-null">
<image class="icon" src="@/static/icons/listnull-icon.png" mode="widthFix"></image>
<view class="sub-title">暂无相关访客记录</view>
</view>
</block>
</view>
</template>
<script>
import { visitors } from '@/apis/interfaces/store'
import getDate from '@/public/date'
export default {
data() {
return {
tabsIndex: 'day',
dateValue: '',
endDate : '',
visitor : {
factor: 0,
all: 0
},
orders : []
};
},
created() {
getDate().then(res => {
this.dateValue = res
this.endDate = res
this.getLists()
})
},
methods:{
// tabs筛选
onTbas(type){
getDate(type).then(res => {
this.tabsIndex = type
this.dateValue = res
this.getLists()
})
},
// 日期筛选
pickerDate(e){
let dateValue = e.detail.value
this.dateValue = dateValue
this.getLists()
},
// 获取列表
getLists(){
visitors({
type: this.tabsIndex,
date: this.dateValue
}).then(res => {
console.log(res)
this.visitor = res.total
this.orders = res.lists.data
this.pages = res.lists.page
}).catch(err => {
uni.showToast({
title: err,
icon : 'none'
})
})
}
}
}
</script>
<style lang="scss">
// 空提示
.list-null{
width: 100vw;
height: 40vh;
background: white;
text-align: center;
@extend .vertical;
.sub-title{
color: $text-gray;
font-size: $title-size-m;
@extend .nowrap;
}
.icon{
width: 288rpx;
}
}
// content
.content{
padding-top: 80rpx;
}
// tabs
.tabs{
position: fixed;
z-index: 9;
top: 0;
//#ifdef H5
top: 100rpx;
//#endif
left: 0;
width: 100%;
display: flex;
background: white;
justify-content: space-around;
line-height: 80rpx;
font-size: $title-size-m;
color: $text-gray;
.item.show{
color: $text-price;
font-weight: bold;
}
}
// 统计信息
.statistics{
margin-top: $margin;
background-color: white;
border-bottom: solid 1rpx $border-color;
padding: $padding;
.statistics-date{
font-size: $title-size + 4;
font-weight: bold;
line-height: 60rpx;
.arrowdown{
margin-left: $margin/2;
}
}
.statistics-text{
font-size: $title-size-sm;
color: gray;
line-height: 50rpx;
text{
margin-left: $margin;
&:first-child{
margin: 0;
}
}
}
}
// 客户列表
.lists{
padding: $padding/2 0;
background: white;
.item{
padding: ($padding/2) $padding ($padding/2) ($padding*2 + 68);
position: relative;
min-height: 68rpx;
&::after{
position: absolute;
left: $padding*2 + 68;
top: 0;
right: 0;
content: ' ';
border-bottom: solid 1rpx $border-color;
}
&:first-child::after{
display: none;
}
.cover{
position: absolute;
left: $padding;
top: $padding/2;
width: 68rpx;
height: 68rpx;
border-radius: 50%;
background: #eee;
}
.title{
position: relative;
line-height: 58rpx;
font-size: $title-size-lg;
}
.sub-title{
line-height: 40rpx;
font-size: $title-size-sm;
color: $text-gray;
}
}
}
</style>

View File

@@ -0,0 +1,301 @@
<template>
<view class="address-create" v-if="isloaded">
<view class="list-item">
<view class="item">收货人 <input placeholder-class="placeholder-style" maxlength="10" v-model="name"
placeholder="请输入收货人姓名" />
</view>
</view>
<view class="list-item">
<view class="item">联系电话 <input placeholder-class="placeholder-style" v-model="mobile" type="number" maxlength="11"
placeholder="请输入收货人手机号码" /></view>
</view>
<view class="list-item">
<view class="item">所在区域
<span @click="btnClick()">{{addressTxt || '请选择省市区县,乡镇等'}}</span>
</view>
</view>
<view class="list-item">
<view class="item">详细地址 <textarea placeholder-class="placeholder-style" v-model="address" auto-height
placeholder="请完善详细街道,楼牌号等" />
</view>
</view>
<view class="list-item moren">
<view class="item">
<view class="uni-list-cell-db">设置默认地址</view>
<switch @change="switchChange" :checked="is_default" color='#8b64fd' style="transform:scale(0.9)" />
</view>
</view>
<view class="besure" @click="besure">保存</view>
<selectAddress ref='selectAddress' :addressIdList='addressIdList' @selectAddress="successSelectAddress" />
<!-- <u-toast ref="uToast" /> -->
<u-toast ref="uToast" />
</view>
</template>
<script>
import selectAddress from '@/components/yixuan-selectAddress/yixuan-selectAddress.vue'
import cityData from '@/static/yixuan-selectAddress/city.json'
import {
addAddresses,
getAddresses,
editAddresses
} from '@/apis/interfaces/address'
export default {
components: {
selectAddress
},
data() {
return {
name: '', //姓名
mobile: '', //电话
address: '', //详细地址
is_default: false, //默认 1=默认
addressTxt: '', // 已选择的地址显示 (页面显示)
addressIdList: [], // 向子组件传递参数数组[3,36,37] 即显示默认值【province_idprovince_iddistrict_id】
addressId: '',
isloaded: false
};
},
onLoad(e) {
if (!!e.id) {
uni.setNavigationBarTitle({
title: '编辑地址'
})
this.addressId = e.id
this.getInfo(e.id)
} else {
this.isloaded = true
}
},
methods: {
// 根据地址id获取地址的详细信息
getInfo(id) {
getAddresses(id).then(res => {
const array = [res.province.region_id, res.city.region_id, res.district.region_id]
this.addressIdList = array
this.name = res.name
this.mobile = res.mobile
this.address = res.address
this.addressTxt = res.province.name + ' ' + res.city.name + ' ' + res.district.name
this.is_default = res.default
this.isloaded = true
}).catch(err => {
this.$refs.uToast.show({
title: err.message,
type: 'primary',
duration: 3000
})
})
},
// 是否勾选默认
switchChange(e) {
this.is_default = e.target.value
},
// 点击省市区选择
btnClick() {
this.$refs.selectAddress.show()
},
besure() {
let params = {
name: this.name,
mobile: this.mobile,
address: this.address,
is_default: this.is_default ? 1 : 0,
province_id: this.addressIdList[0],
city_id: this.addressIdList[1],
district_id: this.addressIdList[2]
}
if (params.name.trim() === '') {
uni.showToast({
title: '请重新核对姓名',
icon: 'none'
})
} else if (params.mobile.trim() === '' || params.mobile.trim().length !== 11) {
uni.showToast({
title: '请重新核对手机号码',
icon: 'none'
})
} else if (this.addressIdList[0] === undefined || this.addressIdList[1] === undefined || this.addressIdList[
2] === undefined) {
uni.showToast({
title: '请完善省市区信息',
icon: 'none'
})
} else if (params.address.trim() === '') {
uni.showToast({
title: '请完善详细的收货地址',
icon: 'none'
})
} else {
if (this.addressId) {
editAddresses(this.addressId, params).then(res => {
this.$refs.uToast.show({
title: res,
type: 'primary',
duration: 3000
})
uni.setStorageSync('refresh',true)
uni.navigateBack({})
}).catch(err => {
this.$refs.uToast.show({
title: err.message,
type: 'primary',
duration: 3000
})
})
} else {
addAddresses(params).then(res => {
this.$refs.uToast.show({
title: res,
type: 'primary',
duration: 3000
})
uni.navigateBack({})
}).catch(err => {
this.$refs.uToast.show({
title: err.message,
type: 'primary',
duration: 3000
})
})
}
}
},
// 选择成功回调
successSelectAddress(address) {
if (address[0].id) {
this.addressIdList = [address[0].id, address[1].id, address[2].id]
this.addressTxt = address[0].name + ' ' + address[1].name + ' ' + address[2].name
}
},
}
}
</script>
<style lang="scss">
.Create-addr {
line-height: 100vh;
background-color: #fff;
}
.list-item {
padding: 0 $padding*1.5;
background-color: #fff;
.item {
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
box-sizing: border-box;
padding: $padding 0;
border-bottom: solid #f8f8f8 1rpx;
font-size: $title-size - 2;
color: #333;
input,
textarea,
span,
.picker {
color: #353535;
font-size: $title-size - 1;
width: 74%;
}
.picker {
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
box-sizing: border-box;
.picker-item {
width: 33.33%;
border: solid 1rpx #ccc;
text-align: center;
}
}
.placeholder-style {
color: #ccc;
}
}
}
.moren {
border-top: $padding solid #f7f7f7;
}
.besure {
background-color: $text-price;
color: #fff;
text-align: center;
margin: $margin*1.5;
border-radius: $radius;
padding: $padding*1.3;
}
.popup {
min-height: 500rpx;
.popup-top {
position: relative;
font-size: $title-size - 4;
.title {
text-align: center;
padding: $padding*1.5 $padding*2;
border-bottom: solid 1rpx #f7f7f7;
}
.select {
position: absolute;
top: $padding;
right: $padding;
color: $text-price;
}
}
.addr-show {
display: flex;
flex-direction: row;
align-items: center;
justify-content: flex-start;
box-sizing: border-box;
padding: 0 $padding *3;
font-size: $title-size;
.addr-show-item {
padding: $padding*1.5 0;
margin-right: $margin*2;
max-width: 33.33%;
overflow: hidden;
}
.picker-item-selected {
border-bottom: solid $text-price 4rpx;
}
}
.scroll-Y {
height: 60vh;
padding: $padding*2;
box-sizing: border-box;
.scroll-item {
padding: $padding*1.5 0;
border-bottom: solid .25rpx rgba($color: #000000, $alpha: 0.02);
color: #353535;
font-size: $title-size;
.pr20 {
padding-right: 20rpx;
}
}
}
}
</style>

Some files were not shown because too many files have changed in this diff Show More