mirror of
https://gitee.com/beijing_hongye_huicheng/lilishop-uniapp.git
synced 2025-12-19 17:05:55 +08:00
Compare commits
140 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3d1089b756 | ||
|
|
6c8102aecd | ||
|
|
56fdb2c2f0 | ||
|
|
7c85460fbb | ||
|
|
47b58c290a | ||
|
|
cdf57806d6 | ||
|
|
9671d60555 | ||
|
|
f8b388c968 | ||
|
|
91cc98e853 | ||
|
|
58484f1b61 | ||
|
|
d65ad6c5fd | ||
|
|
68bc1d6974 | ||
|
|
b1c518c3a8 | ||
|
|
48c7030c0e | ||
|
|
13c9d521f9 | ||
|
|
375653eb78 | ||
|
|
8c72cdcb0a | ||
|
|
cfb88d798b | ||
|
|
ebf32a18b0 | ||
|
|
5f6c1adf91 | ||
|
|
44648e9971 | ||
|
|
fd37087c43 | ||
|
|
4c47a1249f | ||
|
|
ea3563e4e9 | ||
|
|
c98c5b64e1 | ||
|
|
3b9b2e8ba2 | ||
|
|
cebde87682 | ||
|
|
0b2bf1faf1 | ||
|
|
73560e8366 | ||
|
|
afabfdd1d5 | ||
|
|
dadce33d74 | ||
|
|
fe0d888da0 | ||
|
|
58f33b05dd | ||
|
|
ba3034e5cb | ||
|
|
4c7663d671 | ||
|
|
a78dca1a0c | ||
|
|
c529688932 | ||
|
|
0cfb5d42c0 | ||
|
|
13f3971f2a | ||
|
|
075399d329 | ||
|
|
90d9fa9671 | ||
|
|
6ca01d2c71 | ||
|
|
275d76c0dd | ||
|
|
c53af2fcc3 | ||
|
|
c45a378665 | ||
|
|
cb982c2883 | ||
|
|
52e6c57f70 | ||
|
|
9a91e58f2c | ||
|
|
25fb26b7d0 | ||
|
|
8f5f44022b | ||
|
|
a2994454aa | ||
|
|
915aee9143 | ||
|
|
224eb05703 | ||
|
|
775bf3055d | ||
|
|
d76bab4b71 | ||
|
|
3d1e175194 | ||
|
|
885ccb5006 | ||
|
|
eb11f9dbae | ||
|
|
415dd15dd1 | ||
|
|
3f19fc8c15 | ||
|
|
464379178d | ||
|
|
1fbb43c848 | ||
|
|
b93395d0dc | ||
|
|
1141923407 | ||
|
|
209060fd76 | ||
|
|
e02fa75274 | ||
|
|
4ca71d0987 | ||
|
|
123127d977 | ||
|
|
d19b02a97d | ||
|
|
aad083970e | ||
|
|
436dd56e54 | ||
|
|
a9db24d1ad | ||
|
|
a6fec5cf70 | ||
|
|
0ea121e59e | ||
|
|
65a9110ada | ||
|
|
fc9b7bac16 | ||
|
|
3171fddd7b | ||
|
|
2df8be328f | ||
|
|
8f942bf01e | ||
|
|
346eb13d50 | ||
|
|
b8e0ddcb5a | ||
|
|
10d8f25ddf | ||
|
|
96d42cdab8 | ||
|
|
3294f12268 | ||
|
|
29630a8495 | ||
|
|
9f48cc7110 | ||
|
|
efb2a7963e | ||
|
|
8ecc85a21c | ||
|
|
765ad65b8f | ||
|
|
8500fb4087 | ||
|
|
ef51049ed4 | ||
|
|
ef5941de00 | ||
|
|
4599b02a41 | ||
|
|
73c307173b | ||
|
|
8239aad928 | ||
|
|
5612636b29 | ||
|
|
6f162b6d15 | ||
|
|
ca1cfb7575 | ||
|
|
8005cc6c1c | ||
|
|
20c751a7b5 | ||
|
|
60a8fe7361 | ||
|
|
1489deb618 | ||
|
|
2f180d5178 | ||
|
|
e9739cacf5 | ||
|
|
c8c531db17 | ||
|
|
5c67c608bc | ||
|
|
ebe6595f81 | ||
|
|
0408cb3ef6 | ||
|
|
fe26033a9f | ||
|
|
4499e0b816 | ||
|
|
c6dd5eac67 | ||
|
|
c65df5c741 | ||
|
|
073c80e781 | ||
|
|
6b0edf0752 | ||
|
|
cd909ede83 | ||
|
|
eb070953c0 | ||
|
|
2995383d63 | ||
|
|
983dbda3e6 | ||
|
|
240f2d227d | ||
|
|
2052b189f2 | ||
|
|
d37a6a865a | ||
|
|
a2a949be8f | ||
|
|
305f05bade | ||
|
|
ec2e110bd7 | ||
|
|
7cbb226416 | ||
|
|
1e53287927 | ||
|
|
3cc2f1e019 | ||
|
|
db63ace4b0 | ||
|
|
b80b7205e9 | ||
|
|
61273b78b9 | ||
|
|
de639c808c | ||
|
|
8fa58c7010 | ||
|
|
bd6db202ab | ||
|
|
b7fb67d975 | ||
|
|
9c5bf7f854 | ||
|
|
fcb5d20ef1 | ||
|
|
87d767d4ff | ||
|
|
23cc635971 | ||
|
|
b5722c27b6 | ||
|
|
f56acf5a76 |
@@ -2,10 +2,23 @@
|
|||||||
// launchtype项可配置值为local或remote, local代表前端连本地云函数,remote代表前端连云端云函数
|
// launchtype项可配置值为local或remote, local代表前端连本地云函数,remote代表前端连云端云函数
|
||||||
"version": "0.0",
|
"version": "0.0",
|
||||||
"configurations": [{
|
"configurations": [{
|
||||||
"type": "uniCloud",
|
"app-plus" :
|
||||||
"default": {
|
{
|
||||||
"launchtype": "remote"
|
"launchtype" : "remote"
|
||||||
}
|
},
|
||||||
}
|
"default" :
|
||||||
|
{
|
||||||
|
"launchtype" : "remote"
|
||||||
|
},
|
||||||
|
"h5" :
|
||||||
|
{
|
||||||
|
"launchtype" : "remote"
|
||||||
|
},
|
||||||
|
"mp-weixin" :
|
||||||
|
{
|
||||||
|
"launchtype" : "remote"
|
||||||
|
},
|
||||||
|
"type" : "uniCloud"
|
||||||
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
65
App.vue
65
App.vue
@@ -1,4 +1,5 @@
|
|||||||
|
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
/**
|
/**
|
||||||
* vuex管理登录状态,具体可以参考官方登录模板示例
|
* vuex管理登录状态,具体可以参考官方登录模板示例
|
||||||
@@ -15,6 +16,35 @@ export default {
|
|||||||
config,
|
config,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 监听返回
|
||||||
|
*/
|
||||||
|
onBackPress(e) {
|
||||||
|
if (e.from == "backbutton") {
|
||||||
|
let routes = getCurrentPages();
|
||||||
|
let curRoute = routes[routes.length - 1].options;
|
||||||
|
routes.forEach((item) => {
|
||||||
|
if (
|
||||||
|
item.route == "pages/tabbar/cart/cartList" ||
|
||||||
|
item.route.indexOf("pages/product/goods") != -1
|
||||||
|
) {
|
||||||
|
uni.redirectTo({
|
||||||
|
url: item.route,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
if (curRoute.addId) {
|
||||||
|
uni.reLaunch({
|
||||||
|
url: "/pages/tabbar/cart/cartList",
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
uni.navigateBack();
|
||||||
|
}
|
||||||
|
return true; //阻止默认返回行为
|
||||||
|
}
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
...mapMutations(["login"]),
|
...mapMutations(["login"]),
|
||||||
},
|
},
|
||||||
@@ -22,11 +52,16 @@ export default {
|
|||||||
// #ifdef APP-PLUS
|
// #ifdef APP-PLUS
|
||||||
this.checkArguments(); // 检测启动参数
|
this.checkArguments(); // 检测启动参数
|
||||||
APPUpdate();
|
APPUpdate();
|
||||||
|
|
||||||
// 重点是以下: 一定要监听后台恢复 !一定要
|
// 重点是以下: 一定要监听后台恢复 !一定要
|
||||||
plus.globalEvent.addEventListener("newintent", (e) => {
|
plus.globalEvent.addEventListener("newintent", (e) => {
|
||||||
this.checkArguments(); // 检测启动参数
|
this.checkArguments(); // 检测启动参数
|
||||||
});
|
});
|
||||||
// #endif
|
// #endif
|
||||||
|
|
||||||
|
// #ifdef MP-WEIXIN
|
||||||
|
this.applyUpdateWeChat();
|
||||||
|
// #endif
|
||||||
},
|
},
|
||||||
|
|
||||||
onShow() {
|
onShow() {
|
||||||
@@ -34,8 +69,34 @@ export default {
|
|||||||
this.getClipboard();
|
this.getClipboard();
|
||||||
// #endif
|
// #endif
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
|
/**
|
||||||
|
* 微信小程序版本提交更新版本 解决缓存问题
|
||||||
|
*/
|
||||||
|
applyUpdateWeChat() {
|
||||||
|
const updateManager = uni.getUpdateManager();
|
||||||
|
|
||||||
|
updateManager.onCheckForUpdate(function (res) {
|
||||||
|
// 请求完新版本信息的回调
|
||||||
|
});
|
||||||
|
|
||||||
|
updateManager.onUpdateReady(function (res) {
|
||||||
|
uni.showModal({
|
||||||
|
title: "更新提示",
|
||||||
|
content: "发现新版本,是否重启应用?",
|
||||||
|
success(res) {
|
||||||
|
if (res.confirm) {
|
||||||
|
// 新的版本已经下载好,调用 applyUpdate 应用新版本并重启
|
||||||
|
updateManager.applyUpdate();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
});
|
||||||
|
});
|
||||||
|
updateManager.onUpdateFailed(function (res) {
|
||||||
|
// 新的版本下载失败
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
// TODO 开屏广告 后续优化添加
|
// TODO 开屏广告 后续优化添加
|
||||||
launch() {
|
launch() {
|
||||||
try {
|
try {
|
||||||
@@ -134,7 +195,7 @@ export default {
|
|||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
@import "uview-ui/index.scss";
|
@import "uview-ui/index.scss";
|
||||||
@import "./static/font/iconfont/iconfont.css";
|
|
||||||
// -------适配底部安全区 苹果x系列刘海屏
|
// -------适配底部安全区 苹果x系列刘海屏
|
||||||
|
|
||||||
// #ifdef MP-WEIXIN
|
// #ifdef MP-WEIXIN
|
||||||
|
|||||||
253
README.md
253
README.md
@@ -1,110 +1,138 @@
|
|||||||
## Lilishop B2B2C商城系统
|
## 🔥 Lilishop B2B2C商城系统
|
||||||
|
|
||||||
|
##### 🌹 开源不易,如有帮助请点Star
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#### 欢迎交流需求,交流业务,交流技术(基础问题自行解决,进群先看文档后提问)
|
||||||
|
|
||||||
|
##### 交流 qq 1群 961316482(已满)
|
||||||
|
|
||||||
|
##### 交流 qq 2群 875294241
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
##### 商城 公众号/小程序体验,扫描二维码
|
||||||
|
|
||||||
##### 官方公众号 & 开源不易,如有帮助请点Star
|
|
||||||

|

|
||||||
|
|
||||||
[](https://gitee.com/beijing_hongye_huicheng/lilishop/stargazers)
|
[](https://gitee.com/beijing_hongye_huicheng/lilishop/stargazers)
|
||||||
|

|
||||||
|
|
||||||
|
|
||||||
### 介绍
|
### 🔥 商城介绍
|
||||||
**官网**:https://pickmall.cn
|
**官网**:https://pickmall.cn
|
||||||
|
|
||||||
Lilishop 是一款Java开发,基于SpringBoot研发的B2B2C多用户商城,前端使用 Vue、uniapp开发 **系统全端全部代码开源**
|
Lilishop 商城系统 基于SpringBoot 研发,B2B2C多用户商城系统,前端使用 Vue、uniapp开发 **系统全端全部代码开源**
|
||||||
|
|
||||||
产品前后端分离、支持分布式部署。
|
业务兼容O2O商城/B2B商城/B2B2C商城/F2B2C商城/S2B2C商城。支持小程序商城、H5商城、APP商城、 PC商城。
|
||||||
|
|
||||||
商城展示端包含 PC、H5、微信小程序、APP。
|
|
||||||
|
商城前后端分离、支持分布式部署。
|
||||||
|
|
||||||
商城包含 会员模块、**第三方登录模块**、**第三方支付模块**、**楼层装修模块**、订单模块、分销模块、文章模块、系统设置模块、流量分析模块
|
商城包含 会员模块、**第三方登录模块**、**第三方支付模块**、**楼层装修模块**、订单模块、分销模块、文章模块、系统设置模块、流量分析模块
|
||||||
|
|
||||||
系统包含各种中间件、搜索引擎、多级缓存、分布式事务、分布式任务调度等,支持Docker,支持k8s。是一款高性能,支持高并发等商城系统。
|
商城包含各种中间件、搜索引擎、多级缓存、分布式事务、分布式任务调度等,支持Docker,支持k8s。是一款高性能,支持高并发的商城系统。
|
||||||
|
|
||||||
开箱即用,简单配置即可部署一套属于您的系统。
|
##### 商城 API/消费者 聚合版
|
||||||
|
api不需要单独部署,只需启动一个jar包就可以正常运转 如有需要,可以点击跳转https://gitee.com/beijing_hongye_huicheng/lilishop-simplify
|
||||||
|
|
||||||
### 文档
|
### ☃️ 商城 开发/使用/常见问题 帮助文档
|
||||||
|
|
||||||
**产品文档**(需求、架构、使用、部署、开发):https://docs.pickmall.cn
|
https://docs.pickmall.cn
|
||||||
|
|
||||||
|
### 💧 开源商城项目地址(gitee)
|
||||||
|
|
||||||
|
**API(商城所有API)**:https://gitee.com/beijing_hongye_huicheng/lilishop.git
|
||||||
|
|
||||||
|
**UI(商城管理端/商家端/买家PC端)**: https://gitee.com/beijing_hongye_huicheng/lilishop-ui.git
|
||||||
|
|
||||||
|
**uniapp(商城移动端,支持小程序/APP/H5)**:https://gitee.com/beijing_hongye_huicheng/lilishop-uniapp.git
|
||||||
|
|
||||||
|
**docker一键部署(商城部署脚本)**:https://gitee.com/beijing_hongye_huicheng/docker.git
|
||||||
|
|
||||||
|
### 💧 开源商城项目地址(github)
|
||||||
|
|
||||||
|
**API(商城所有API)**:https://github.com/hongyehuicheng/lilishop.git
|
||||||
|
|
||||||
|
**UI(商城管理端/商家端/买家PC端)**: https://github.com/hongyehuicheng/lilishop-ui.git
|
||||||
|
|
||||||
|
**uniapp(商城移动端,支持小程序/APP/H5)**:https://github.com/hongyehuicheng/lilishop-uniapp.git
|
||||||
|
|
||||||
|
**docker一键部署(商城部署脚本)**:https://github.com/hongyehuicheng/docker.git
|
||||||
|
|
||||||
|
|
||||||
### 项目链接(gitee)
|
☃️ UI 项目下3个文件夹 buyer:买家PC端,seller:商家端,manager:后台管理端
|
||||||
|
|
||||||
**Java后台**:https://gitee.com/beijing_hongye_huicheng/lilishop.git
|
|
||||||
|
|
||||||
**Vue后台前端**: https://gitee.com/beijing_hongye_huicheng/lilishop-ui.git
|
### 💧 演示地址(手机验证码为 ‘111111’)
|
||||||
|
|
||||||
**Uni-app**:https://gitee.com/beijing_hongye_huicheng/lilishop-uniapp.git
|
**商城管理端**:https://admin-b2b2c.pickmall.cn 账号:admin/123456
|
||||||
|
|
||||||
**docker一键部署**:https://gitee.com/beijing_hongye_huicheng/docker.git
|
**商城店铺后台**:https://store-b2b2c.pickmall.cn 账号:13011111111/111111
|
||||||
|
|
||||||
### 项目链接(github)
|
**商城PC页面**:https://pc-b2b2c.pickmall.cn
|
||||||
|
|
||||||
**Java后台**:https://github.com/hongyehuicheng/lilishop.git
|
**商城移动端(请使浏览器手机模式,或者用手机浏览器打开)**:https://m-b2b2c.pickmall.cn
|
||||||
|
|
||||||
**Vue后台前端**: https://github.com/hongyehuicheng/lilishop-ui.git
|
**小程序/公众号**:扫描二维码
|
||||||
|
|
||||||
**Uni-app**:https://github.com/hongyehuicheng/lilishop-uniapp.git
|
|
||||||
|
|
||||||
**docker一键部署**:https://github.com/hongyehuicheng/docker.git
|
|
||||||
|
|
||||||
### 演示地址
|
|
||||||
|
|
||||||
**运营后台**:https://admin-b2b2c.pickmall.cn 账号:admin/123456
|
|
||||||
|
|
||||||
**店铺后台**:https://store-b2b2c.pickmall.cn 账号:13011111111/111111
|
|
||||||
|
|
||||||
**用户前台**:https://pc-b2b2c.pickmall.cn
|
|
||||||
|
|
||||||
**移动端**:https://m-b2b2c.pickmall.cn
|
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
### 3行命令搭建本地环境
|
### 🚙 3行命令搭建本地商城(注:只能本机访问,如需调整,请自行操作镜像)
|
||||||
|
|
||||||
温馨提示:由于服务较多,如果笔记本环境启动内存没有32g可能无法启动成功(macbookpro 2020 16g内存启动无法成功),台式机在16g内存、AMD 3700x 的ubuntu系统成功运行。
|
温馨提示:由于服务中间件较多,如果笔记本环境启动内存没有32g可能无法启动成功(macbookpro 2020 16g内存启动无法成功),台式机在16g内存、AMD 3700x 的ubuntu系统成功运行。
|
||||||
|
|
||||||
##### 下载docker脚本
|
|
||||||
|
|
||||||
|
##### docker环境安装 [点击跳转](https://docs.pickmall.cn/deploy/%E8%BF%90%E8%A1%8C%E7%8E%AF%E5%A2%83%E5%87%86%E5%A4%87.html)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
##### 下载docker-compose脚本
|
||||||
`git clone https://gitee.com/beijing_hongye_huicheng/docker.git `
|
`git clone https://gitee.com/beijing_hongye_huicheng/docker.git `
|
||||||
##### 部署基础环境
|
|
||||||
|
##### 部署商城所需中间件
|
||||||
`docker-compose up -d`
|
`docker-compose up -d`
|
||||||
|
|
||||||
##### 部署应用
|
##### 部署商城应用
|
||||||
`docker-compose -f docker-compose-application.yml up -d`
|
`docker-compose -f docker-compose-application.yml up -d`
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
PS:单独部署的话,数据库文件访问这里:https://gitee.com/beijing_hongye_huicheng/docker/tree/master/init/mysql
|
PS:商城数据库单独部署 https://gitee.com/beijing_hongye_huicheng/docker/tree/master/init/mysql 这里有与tag版本一致的sql,根据tag获取sql,如果使用master代码,则需要在lilishop项目根目录的DB目录中,获取对应的升级sql。
|
||||||
|
|
||||||
##### 各个地址
|
##### 商城 API/UI 地址
|
||||||
|
|
||||||
| API | 地址 |
|
| API | 地址 |
|
||||||
| -------------- | --------------- |
|
| -------------- | --------------- |
|
||||||
| 买家API | http://127.0.0.1:8888 |
|
| 商城买家API | http://127.0.0.1:8888 |
|
||||||
| 商家API | http://127.0.0.1:8889 |
|
| 商城商家API | http://127.0.0.1:8889 |
|
||||||
| 管理端API | http://127.0.0.1:8887 |
|
| 商城管理端API | http://127.0.0.1:8887 |
|
||||||
| 通用API | http://127.0.0.1:8890 |
|
| 商城基础API | http://127.0.0.1:8890 |
|
||||||
|
|
||||||
| 前端演示 | 地址 |
|
| 前端演示 | 地址 |
|
||||||
| -------------- | --------------- |
|
| -------------- | --------------- |
|
||||||
| PC | http://127.0.0.1:10000 |
|
| 商城PC端 | http://127.0.0.1:10000 |
|
||||||
| WAP | http://127.0.0.1:10001 |
|
| 商城WAP端 | http://127.0.0.1:10001 |
|
||||||
| 商家 | http://127.0.0.1:10002 |
|
| 商城卖家端 | http://127.0.0.1:10002 |
|
||||||
| 管理端 | http://127.0.0.1:10003 |
|
| 商城管理端 | http://127.0.0.1:10003 |
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
### 功能列表
|
### ⚾️ 功能列表
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#### 平台功能
|
#### 🥎 商城平台功能
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#### 商家端功能
|
#### 🥎 商城卖家功能
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
@@ -112,30 +140,28 @@ PS:单独部署的话,数据库文件访问这里:https://gitee.com/beijing_
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
### 功能展示
|
### 🧩 商城前端功能展示
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#### 移动端
|
#### ⚽️ 商城移动端
|
||||||
|
|
||||||
<img src="https://pickmall.cn/assets/imgs/other/app.gif" alt="管理端功能展示" style="zoom:50%;" />
|
|
||||||
|
|
||||||
<img src="https://pickmall.cn/assets/imgs/other/app.gif" alt="移动端功能展示" style="zoom:50%;" />
|
<img src="https://pickmall.cn/assets/imgs/other/app.gif" alt="移动端功能展示" style="zoom:50%;" />
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#### 管理端
|
#### ⚽️ 商城管理端
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
### 技术选型
|
### 商城技术选型
|
||||||
|
|
||||||
#### 架构图
|
#### 🥅 架构图
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
##### Java后台
|
##### 🕹 后台技术选型
|
||||||
|
|
||||||
| 说明 | 框架 | 说明 | |
|
| 说明 | 框架 | 说明 | |
|
||||||
| -------------- | --------------- | -------------- | ------------- |
|
| -------------- | --------------- | -------------- | ------------- |
|
||||||
@@ -149,7 +175,7 @@ PS:单独部署的话,数据库文件访问这里:https://gitee.com/beijing_
|
|||||||
| 短信 | 阿里云短信 | 认证 | JWT |
|
| 短信 | 阿里云短信 | 认证 | JWT |
|
||||||
| 日志处理 | Log4j | 接口规范 | RESTful |
|
| 日志处理 | Log4j | 接口规范 | RESTful |
|
||||||
|
|
||||||
##### 前端-运营后台、店铺后台
|
##### 🖥 前端-运营后台、店铺后台
|
||||||
|
|
||||||
| 说明 | 框架 | 说明 | 框架 |
|
| 说明 | 框架 | 说明 | 框架 |
|
||||||
| ---------- | ---------- | ---------- | ------- |
|
| ---------- | ---------- | ---------- | ------- |
|
||||||
@@ -159,119 +185,34 @@ PS:单独部署的话,数据库文件访问这里:https://gitee.com/beijing_
|
|||||||
| 基础UI库 | iView | UI界面基于 | iView |
|
| 基础UI库 | iView | UI界面基于 | iView |
|
||||||
| 网络请求 | axios | | |
|
| 网络请求 | axios | | |
|
||||||
|
|
||||||
##### 前端-移动端
|
##### 📱前端-移动端
|
||||||
|
|
||||||
| 说明 | 架构 | 说明 | 架构 |
|
| 说明 | 架构 | 说明 | 架构 |
|
||||||
| --------- | ------- | -------- | ------- |
|
| --------- | ------- | -------- | ------- |
|
||||||
| 基础UI库 | uViewui | 基础框架 | uni-app |
|
| 基础UI库 | uViewui | 基础框架 | uni-app |
|
||||||
| CSS预处理 | scss | 地图引擎 | amap |
|
| CSS预处理 | scss | 地图引擎 | amap |
|
||||||
|
|
||||||
### 升级计划
|
### 🌟 版本升级
|
||||||
|
|
||||||
#### 计划每个月发布一个版本,具体时间可能有出入
|
|
||||||
|
|
||||||
时间:2021年6月15日
|
|
||||||
|
|
||||||
```
|
```
|
||||||
新增功能:
|
商城后续会持续版本升级,修复bug,完善功能,覆盖更多业务场景 o2o/b2b/s2b2b2c/跨境电商
|
||||||
1.微信小程序直播
|
|
||||||
2.优惠券活动
|
|
||||||
3.新人赠券
|
|
||||||
4.准确发券
|
|
||||||
5.用户等级
|
|
||||||
6.数据导出
|
|
||||||
7.订单批量
|
|
||||||
8.APP版本升级检测
|
|
||||||
9.积分商城
|
|
||||||
|
|
||||||
功能优化:
|
|
||||||
1.优惠券有效期增加类型:设置领取后*内有效。
|
|
||||||
2.秒杀活动设置为每天开启,需设置秒杀活动开启时间。
|
|
||||||
3.店铺配送模板,配送地区如果选择省份则下方的市级地址不展示。
|
|
||||||
4.店铺配送模板支持,店铺包邮。
|
|
||||||
5.普通商品设置去除卖家承担运费。
|
|
||||||
|
|
||||||
|
后续会考虑推出微服务商城系统/商城中台等
|
||||||
```
|
```
|
||||||
|
|
||||||
时间:2021年7月15日
|
|
||||||
|
|
||||||
```
|
### ⚠️ 开源须知
|
||||||
新增功能:
|
|
||||||
1.会员权益
|
|
||||||
2.支持用户升级会员
|
|
||||||
3.供求单
|
|
||||||
4.IM:腾讯云智服
|
|
||||||
5.服务商品
|
|
||||||
6.店铺支持订单核销
|
|
||||||
7.店铺自提点
|
|
||||||
功能优化:
|
|
||||||
1.用户分享商城、关注店铺、邀请新用户可获取积分、经验值。
|
|
||||||
```
|
|
||||||
|
|
||||||
时间:2021年8月16日
|
|
||||||
|
|
||||||
```
|
|
||||||
新增功能:
|
|
||||||
1.微淘功能
|
|
||||||
2.店铺移动端
|
|
||||||
3.店铺发货单
|
|
||||||
```
|
|
||||||
|
|
||||||
时间:2021年9月15日
|
|
||||||
|
|
||||||
```
|
|
||||||
新增功能:
|
|
||||||
增加供应商功能
|
|
||||||
```
|
|
||||||
|
|
||||||
### 版本升级
|
|
||||||
|
|
||||||
```
|
|
||||||
后续会持续版本升级,修复bug,完善功能,覆盖更多业务场景 o2o/b2b/s2b2b2c/跨境电商
|
|
||||||
|
|
||||||
后续会考虑推出微服务/中台等 企业级版本
|
|
||||||
```
|
|
||||||
|
|
||||||
### 技术亮点
|
|
||||||
|
|
||||||
|
|
||||||
1.后端框架基于Springboot,构建基于maven,持久层使用MyBatisPlus。使用elasticsearch、redis、mongodb、rocketmq 等各种中间健。都是主流架构,轻松应对各种环境。
|
|
||||||
|
|
||||||
2.支持集群、分布式,支持docker 轻松部署,解决各种复杂场景!
|
|
||||||
|
|
||||||
3.代码模块清晰,主要分为三端api(买家、卖家、管理),各端API互相隔离,自己鉴权,自己操作业务。
|
|
||||||
|
|
||||||
4.使用阿里开源的RocketMQ,基于mq解决各种并发场景,解决事务一致性,解决搞并发延迟场景问题。
|
|
||||||
|
|
||||||
5.项目使用多级缓存,应用不同场景,redis缓存业务数据、mongodb缓存关系型多对多关系问题、nginx缓存高频访问低频修改的页面。
|
|
||||||
|
|
||||||
6.支持各种联合登陆,支持各种客户端的支付问题,灵活配置灵活开启。
|
|
||||||
|
|
||||||
7.内置完善的楼层装修机制,各种拖拉拽,维护跳转页面或外网,即便是一个什么都不懂的运营也可以轻松掌握。
|
|
||||||
|
|
||||||
8.内置阿里短信接口,可以在线申请短信模版。内置阿里oss系统,可以对文件执行各种操作。oss商家端资源相互隔离。
|
|
||||||
|
|
||||||
10.强大的统计报表,统计效果,可以实现各个场景,包含在线人数,历史在线人数,活跃人数等信息。
|
|
||||||
|
|
||||||
11.标准Api接口、提供swagger文档,快速二开。
|
|
||||||
|
|
||||||
12.分布式调度任务中心,解决分布式定时任务多次执行问题。
|
|
||||||
|
|
||||||
13.代码注释完善,快速上手。
|
|
||||||
|
|
||||||
14.非移动端采用IView框架,各种自定义插件、选择器实现。移动端采用uniapp,一次编写,全端使用
|
|
||||||
|
|
||||||
15.已经对接好各种第三方插件,支持各种复杂等联合登陆,联合支付等场景。
|
|
||||||
|
|
||||||
|
|
||||||
### 开源须知
|
|
||||||
1.仅允许用于个人学习研究使用.
|
1.仅允许用于个人学习研究使用.
|
||||||
|
|
||||||
2.禁止将本开源的代码和资源进行任何形式任何名义的出售.
|
2.禁止将本开源的代码和资源进行任何形式任何名义的出售.
|
||||||
|
|
||||||
3.限制商用,如果需要商业使用请联系我们。QQ3409056806.
|
3.软件受国家计算机软件著作权保护(登记号:2021SR0805085)。
|
||||||
|
|
||||||
### 交流群
|
4.限制商用,如果需要商业使用请联系我们。QQ3409056806.
|
||||||
|
|
||||||
**QQ群**:961316482
|
|
||||||
|
### 🐧 交流群
|
||||||
|
|
||||||
|
##### 官方qq 1群 961316482(已满)
|
||||||
|
##### 官方qq 2群 875294241
|
||||||
|
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ export function getAddressList(pageNumber, pageSize) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取物流公司
|
* 获取物流公司
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -1,25 +1,9 @@
|
|||||||
/**
|
/**
|
||||||
* 公共API
|
* 公共API
|
||||||
*/
|
*/
|
||||||
import storage from "@/utils/storage.js"
|
|
||||||
import {http, Method} from '@/utils/request.js';
|
import {http, Method} from '@/utils/request.js';
|
||||||
import api from '@/config/api.js';
|
import api from '@/config/api.js';
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取图片验证码URL
|
|
||||||
* @param type
|
|
||||||
* @param uuid
|
|
||||||
* @returns {string}
|
|
||||||
*/
|
|
||||||
export function getValidateCodeUrl(type, uuid) {
|
|
||||||
if (!type) {
|
|
||||||
return '';
|
|
||||||
}
|
|
||||||
if (!uuid) {
|
|
||||||
uuid = storage.getUuid()
|
|
||||||
}
|
|
||||||
return `${api.base}/captchas/${uuid}/${type}?r=${new Date().getTime()}`;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
23
api/goods.js
23
api/goods.js
@@ -118,17 +118,6 @@ export function getCategoryList(id) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取商品分类
|
|
||||||
* @param parent_id
|
|
||||||
*/
|
|
||||||
export function getCategory(parent_id = 0) {
|
|
||||||
return http.request({
|
|
||||||
url: `goods/categories/${parent_id}/children`,
|
|
||||||
method: Method.GET,
|
|
||||||
loading: false,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -167,20 +156,23 @@ export function cash(params) {
|
|||||||
/**
|
/**
|
||||||
* 分销商提现历史
|
* 分销商提现历史
|
||||||
*/
|
*/
|
||||||
export function cashLog() {
|
export function cashLog(params) {
|
||||||
return http.request({
|
return http.request({
|
||||||
url: `/distribution/cash`,
|
url: `/distribution/cash`,
|
||||||
method: Method.GET,
|
method: Method.GET,
|
||||||
|
params
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取分销商分页订单列表
|
* 获取分销商分页订单列表
|
||||||
*/
|
*/
|
||||||
export function distributionOrderList() {
|
export function distributionOrderList(params) {
|
||||||
return http.request({
|
return http.request({
|
||||||
url: `/distribution/distributionOrder`,
|
url: `/distribution/distributionOrder`,
|
||||||
method: Method.GET,
|
method: Method.GET,
|
||||||
|
params
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -197,10 +189,11 @@ export function distributionGoods(params) {
|
|||||||
/**
|
/**
|
||||||
* 选择分销商品 分销商品id
|
* 选择分销商品 分销商品id
|
||||||
*/
|
*/
|
||||||
export function checkedDistributionGoods(id) {
|
export function checkedDistributionGoods(params) {
|
||||||
return http.request({
|
return http.request({
|
||||||
url: `/distributionGoods/checked/${id}`,
|
url: `/distributionGoods/checked/${params.id}`,
|
||||||
method: Method.GET,
|
method: Method.GET,
|
||||||
|
params
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -30,12 +30,12 @@ export function getCategory(parent_id = 0) {
|
|||||||
* 获取热门关键词
|
* 获取热门关键词
|
||||||
* @param num
|
* @param num
|
||||||
*/
|
*/
|
||||||
export function getHotKeywords(start = 0, end = 10) {
|
export function getHotKeywords(count) {
|
||||||
return http.request({
|
return http.request({
|
||||||
url: "/goods/hot-words",
|
url: "/goods/hot-words",
|
||||||
method: Method.GET,
|
method: Method.GET,
|
||||||
loading: false,
|
loading: false,
|
||||||
params: { start, end },
|
params: { count },
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
80
api/login.js
80
api/login.js
@@ -1,34 +1,28 @@
|
|||||||
import {
|
import { http } from "@/utils/request.js";
|
||||||
http
|
|
||||||
} from "@/utils/request.js";
|
|
||||||
|
|
||||||
|
|
||||||
import api from '@/config/api.js'
|
|
||||||
|
|
||||||
|
|
||||||
|
import api from "@/config/api.js";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过短信重置密码
|
* 通过短信重置密码
|
||||||
* @param mobile
|
* @param mobile
|
||||||
*/
|
*/
|
||||||
export function resetByMobile(params) {
|
export function resetByMobile(params) {
|
||||||
return http.request({
|
return http.request({
|
||||||
url: `/members/resetByMobile`,
|
url: `/members/resetByMobile`,
|
||||||
method: "POST",
|
method: "POST",
|
||||||
params
|
params,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 发送验证码
|
* 发送验证码
|
||||||
* @param mobile
|
* @param mobile
|
||||||
*/
|
*/
|
||||||
export function sendMobile(mobile) {
|
export function sendMobile(mobile,type='LOGIN') {
|
||||||
return http.request({
|
return http.request({
|
||||||
url: `${api.common}/sms/LOGIN/${mobile}`,
|
url: `${api.common}/sms/${type}/${mobile}`,
|
||||||
method: "GET",
|
method: "GET",
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -37,40 +31,46 @@ export function sendMobile(mobile) {
|
|||||||
* @param smsCode
|
* @param smsCode
|
||||||
*/
|
*/
|
||||||
export function smsLogin(params, clientType) {
|
export function smsLogin(params, clientType) {
|
||||||
return http.request({
|
return http.request({
|
||||||
url: `/members/smsLogin`,
|
url: `/members/smsLogin`,
|
||||||
method: "POST",
|
method: "POST",
|
||||||
data: params,
|
data: params,
|
||||||
header: {
|
header: {
|
||||||
"content-type": "application/x-www-form-urlencoded",
|
"content-type": "application/x-www-form-urlencoded",
|
||||||
"clientType": clientType
|
clientType: clientType,
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改密码
|
* 修改密码
|
||||||
* @param newPassword
|
* @param newPassword
|
||||||
* @param password
|
* @param password
|
||||||
*/
|
*/
|
||||||
|
|
||||||
export function modifyPass(params) {
|
export function modifyPass(params) {
|
||||||
return http.request({
|
return http.request({
|
||||||
url: `/members/modifyPass`,
|
url: `/members/modifyPass`,
|
||||||
method: "PUT",
|
method: "PUT",
|
||||||
params,
|
params,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 刷新token
|
* 刷新token
|
||||||
*/
|
*/
|
||||||
export function refreshTokenFn(refresh_token) {
|
export function refreshTokenFn(refresh_token) {
|
||||||
|
return http.request({
|
||||||
return http.request({
|
url: `/members/refresh/${refresh_token}`,
|
||||||
url: `/members/refresh/${refresh_token}`,
|
method: "GET",
|
||||||
method: "GET",
|
});
|
||||||
});
|
}
|
||||||
|
|
||||||
|
// 获取密码状态
|
||||||
|
export function logout () {
|
||||||
|
return http.request({
|
||||||
|
url: '/members/logout',
|
||||||
|
method: "POST",
|
||||||
|
needToken: true,
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
167
api/members.js
167
api/members.js
@@ -1,28 +1,55 @@
|
|||||||
import storage from "@/utils/storage"
|
import storage from "@/utils/storage";
|
||||||
import {http, Method} from '@/utils/request.js';
|
import { http, Method } from "@/utils/request.js";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 意见反馈
|
* 意见反馈
|
||||||
*/
|
*/
|
||||||
export function feedBack(params) {
|
export function feedBack(params) {
|
||||||
return http.request({
|
return http.request({
|
||||||
url: '/feedback',
|
url: "/feedback",
|
||||||
method: Method.POST,
|
method: Method.POST,
|
||||||
needToken: true,
|
needToken: true,
|
||||||
params,
|
params,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 提现
|
||||||
|
export function withdrawalApply(params) {
|
||||||
|
return http.request({
|
||||||
|
url: "/members/wallet/withdrawal",
|
||||||
|
method: Method.POST,
|
||||||
|
needToken: true,
|
||||||
|
params,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 支付结果查询
|
||||||
|
* @param orderType 交易类型,可用值:TRADE,ORDER,RECHARGE
|
||||||
|
* @param sn 订单编号
|
||||||
|
*/
|
||||||
|
export function payCallback(params) {
|
||||||
|
return http.request({
|
||||||
|
url: `/cashier/result`,
|
||||||
|
method: Method.GET,
|
||||||
|
params,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 在线充值
|
||||||
|
export function recharge(params) {
|
||||||
|
return http.request({
|
||||||
|
url: "/trade/recharge",
|
||||||
|
method: Method.POST,
|
||||||
|
params,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 分页获取预存款充值记录
|
* 分页获取预存款充值记录
|
||||||
* @param params
|
* @param params
|
||||||
*/
|
*/
|
||||||
export function getUserRecharge(params) {
|
export function getUserRecharge(params) {
|
||||||
return http.request({
|
return http.request({
|
||||||
url: "/member/recharge",
|
url: "/member/recharge",
|
||||||
method: Method.GET,
|
method: Method.GET,
|
||||||
@@ -35,7 +62,7 @@ import {http, Method} from '@/utils/request.js';
|
|||||||
* 分页获取预存款充值记录
|
* 分页获取预存款充值记录
|
||||||
* @param params
|
* @param params
|
||||||
*/
|
*/
|
||||||
export function getWalletLog(params) {
|
export function getWalletLog(params) {
|
||||||
return http.request({
|
return http.request({
|
||||||
url: "/wallet/log",
|
url: "/wallet/log",
|
||||||
method: Method.GET,
|
method: Method.GET,
|
||||||
@@ -44,16 +71,13 @@ import {http, Method} from '@/utils/request.js';
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取优惠券列表
|
* 获取优惠券列表
|
||||||
* @param params
|
* @param params
|
||||||
*/
|
*/
|
||||||
export function getCoupons(params) {
|
export function getCoupons(params) {
|
||||||
return http.request({
|
return http.request({
|
||||||
url: '/promotion/coupon/getCoupons',
|
url: "/promotion/coupon/getCoupons",
|
||||||
method: Method.GET,
|
method: Method.GET,
|
||||||
needToken: true,
|
needToken: true,
|
||||||
params,
|
params,
|
||||||
@@ -79,14 +103,13 @@ export function receiveCoupons(couponId) {
|
|||||||
*/
|
*/
|
||||||
export function getPointsData(params) {
|
export function getPointsData(params) {
|
||||||
return http.request({
|
return http.request({
|
||||||
url: 'member/memberPointsHistory/getByPage',
|
url: "member/memberPointsHistory/getByPage",
|
||||||
method: Method.GET,
|
method: Method.GET,
|
||||||
needToken: true,
|
needToken: true,
|
||||||
params,
|
params,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取我的评论列表
|
* 获取我的评论列表
|
||||||
* @param params
|
* @param params
|
||||||
@@ -94,7 +117,7 @@ export function getPointsData(params) {
|
|||||||
*/
|
*/
|
||||||
export function getComments(params) {
|
export function getComments(params) {
|
||||||
return http.request({
|
return http.request({
|
||||||
url: '/memberEvaluation',
|
url: "/memberEvaluation",
|
||||||
method: Method.GET,
|
method: Method.GET,
|
||||||
needToken: true,
|
needToken: true,
|
||||||
params,
|
params,
|
||||||
@@ -108,26 +131,23 @@ export function getComments(params) {
|
|||||||
*/
|
*/
|
||||||
export function getFootprintNum(params) {
|
export function getFootprintNum(params) {
|
||||||
return http.request({
|
return http.request({
|
||||||
url: '/footprint/getFootprintNum',
|
url: "/footprint/getFootprintNum",
|
||||||
method: Method.GET,
|
method: Method.GET,
|
||||||
needToken: true,
|
needToken: true,
|
||||||
params,
|
params,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 订单评论
|
* 订单评论
|
||||||
* @param params
|
* @param params
|
||||||
*/
|
*/
|
||||||
export function commentsMemberOrder(params) {
|
export function commentsMemberOrder(params) {
|
||||||
return http.request({
|
return http.request({
|
||||||
url: '/memberEvaluation',
|
url: "/memberEvaluation",
|
||||||
method: Method.POST,
|
method: Method.POST,
|
||||||
needToken: true,
|
needToken: true,
|
||||||
header:{'content-type':"application/x-www-form-urlencoded"},
|
header: { "content-type": "application/x-www-form-urlencoded" },
|
||||||
data: params,
|
data: params,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -138,30 +158,30 @@ export function commentsMemberOrder(params) {
|
|||||||
*/
|
*/
|
||||||
export function AppendCommentsOrder(params) {
|
export function AppendCommentsOrder(params) {
|
||||||
return http.request({
|
return http.request({
|
||||||
url: 'members/comments/additional',
|
url: "members/comments/additional",
|
||||||
method: Method.POST,
|
method: Method.POST,
|
||||||
needToken: true,
|
needToken: true,
|
||||||
header:{'content-type':"application/x-www-form-urlencoded"},
|
header: { "content-type": "application/x-www-form-urlencoded" },
|
||||||
data: params,
|
data: params,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO 第一版本暂未实现此功能
|
// TODO 第一版本暂未实现此功能
|
||||||
/**
|
/**
|
||||||
* 商品咨询
|
* 商品咨询
|
||||||
* @param goods_id
|
* @param goods_id
|
||||||
* @param ask_content
|
* @param ask_content
|
||||||
*/
|
*/
|
||||||
export function consultating(goods_id, ask_content,anonymous) {
|
export function consultating(goods_id, ask_content, anonymous) {
|
||||||
return http.request({
|
return http.request({
|
||||||
url: 'members/asks',
|
url: "members/asks",
|
||||||
method: Method.POST,
|
method: Method.POST,
|
||||||
header:{'content-type':"application/x-www-form-urlencoded"},
|
header: { "content-type": "application/x-www-form-urlencoded" },
|
||||||
needToken: true,
|
needToken: true,
|
||||||
data: {
|
data: {
|
||||||
goods_id,
|
goods_id,
|
||||||
ask_content,
|
ask_content,
|
||||||
anonymous
|
anonymous,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -171,7 +191,7 @@ export function consultating(goods_id, ask_content,anonymous) {
|
|||||||
* @param params
|
* @param params
|
||||||
* @returns {AxiosPromise}
|
* @returns {AxiosPromise}
|
||||||
*/
|
*/
|
||||||
export function getGoodsCollection(params,type) {
|
export function getGoodsCollection(params, type) {
|
||||||
return http.request({
|
return http.request({
|
||||||
url: `/member/collection/${type}`,
|
url: `/member/collection/${type}`,
|
||||||
method: Method.GET,
|
method: Method.GET,
|
||||||
@@ -182,23 +202,18 @@ export function getGoodsCollection(params,type) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 收藏商品
|
* 收藏商品
|
||||||
* @returns {AxiosPromise}
|
* @returns {AxiosPromise}
|
||||||
*/
|
*/
|
||||||
export function collectionGoods(id,type) {
|
export function collectionGoods(type, id) {
|
||||||
return http.request({
|
return http.request({
|
||||||
url: `/member/collection/add/${type}/${id}`,
|
url: `/member/collection/add/${type}/${id}`,
|
||||||
method: Method.POST,
|
method: Method.POST,
|
||||||
needToken: true,
|
needToken: true,
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除商品收藏
|
* 删除商品收藏
|
||||||
* @param ids 收藏ID【集合或单个商品ID】
|
* @param ids 收藏ID【集合或单个商品ID】
|
||||||
@@ -206,7 +221,7 @@ export function collectionGoods(id,type) {
|
|||||||
*/
|
*/
|
||||||
export function deleteGoodsCollection(ids) {
|
export function deleteGoodsCollection(ids) {
|
||||||
if (Array.isArray(ids)) {
|
if (Array.isArray(ids)) {
|
||||||
ids = ids.join(',');
|
ids = ids.join(",");
|
||||||
}
|
}
|
||||||
return http.request({
|
return http.request({
|
||||||
url: `/member/collection/delete/GOODS/${ids}`,
|
url: `/member/collection/delete/GOODS/${ids}`,
|
||||||
@@ -215,11 +230,23 @@ export function deleteGoodsCollection(ids) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除店铺收藏
|
||||||
|
* @param store_id
|
||||||
|
*/
|
||||||
|
export function deleteStoreCollection(store_id) {
|
||||||
|
return http.request({
|
||||||
|
url: `/member/collection/delete/STORE/${store_id}`,
|
||||||
|
method: Method.DELETE,
|
||||||
|
needToken: true,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取商品是否被收藏
|
* 获取商品是否被收藏
|
||||||
* @param good_id
|
* @param good_id
|
||||||
*/
|
*/
|
||||||
export function getGoodsIsCollect(good_id,type) {
|
export function getGoodsIsCollect(type, good_id) {
|
||||||
return http.request({
|
return http.request({
|
||||||
url: `/member/collection/isCollection/${type}/${good_id}`,
|
url: `/member/collection/isCollection/${type}/${good_id}`,
|
||||||
method: Method.GET,
|
method: Method.GET,
|
||||||
@@ -228,7 +255,6 @@ export function getGoodsIsCollect(good_id,type) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 收藏店铺
|
* 收藏店铺
|
||||||
* @param store_id 店铺ID
|
* @param store_id 店铺ID
|
||||||
@@ -236,33 +262,20 @@ export function getGoodsIsCollect(good_id,type) {
|
|||||||
*/
|
*/
|
||||||
export function collectionStore(store_id) {
|
export function collectionStore(store_id) {
|
||||||
return http.request({
|
return http.request({
|
||||||
url: 'members/collection/store',
|
url: "members/collection/store",
|
||||||
header:{'content-type':"application/x-www-form-urlencoded"},
|
header: { "content-type": "application/x-www-form-urlencoded" },
|
||||||
method: Method.POST,
|
method: Method.POST,
|
||||||
data: {store_id},
|
data: { store_id },
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除店铺收藏
|
|
||||||
* @param store_id
|
|
||||||
*/
|
|
||||||
export function deleteStoreCollection(store_id) {
|
|
||||||
return http.request({
|
|
||||||
url: `members/collection/store/${store_id}`,
|
|
||||||
method: Method.DELETE,
|
|
||||||
needToken: true,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取当前登录的用户信息
|
* 获取当前登录的用户信息
|
||||||
* @returns {AxiosPromise}
|
* @returns {AxiosPromise}
|
||||||
*/
|
*/
|
||||||
export function getUserInfo() {
|
export function getUserInfo() {
|
||||||
return http.request({
|
return http.request({
|
||||||
url: '/members',
|
url: "/members",
|
||||||
method: Method.GET,
|
method: Method.GET,
|
||||||
needToken: true,
|
needToken: true,
|
||||||
});
|
});
|
||||||
@@ -274,7 +287,7 @@ export function deleteStoreCollection(store_id) {
|
|||||||
*/
|
*/
|
||||||
export function getUserWallet() {
|
export function getUserWallet() {
|
||||||
return http.request({
|
return http.request({
|
||||||
url: '/members/wallet',
|
url: "/members/wallet",
|
||||||
method: Method.GET,
|
method: Method.GET,
|
||||||
needToken: true,
|
needToken: true,
|
||||||
});
|
});
|
||||||
@@ -287,30 +300,27 @@ export function getUserWallet() {
|
|||||||
*/
|
*/
|
||||||
export function saveUserInfo(params) {
|
export function saveUserInfo(params) {
|
||||||
return http.request({
|
return http.request({
|
||||||
url: '/members/editOwn',
|
url: "/members/editOwn",
|
||||||
method: Method.PUT,
|
method: Method.PUT,
|
||||||
header:{'content-type':"application/x-www-form-urlencoded"},
|
header: { "content-type": "application/x-www-form-urlencoded" },
|
||||||
needToken: true,
|
needToken: true,
|
||||||
data: params,
|
data: params,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 添加发票
|
* 添加发票
|
||||||
* @param params
|
* @param params
|
||||||
*/
|
*/
|
||||||
export function addReceipt(params) {
|
export function addReceipt(params) {
|
||||||
return http.request({
|
return http.request({
|
||||||
url: '/trade/receipt',
|
url: "/trade/receipt",
|
||||||
method: Method.POST,
|
method: Method.POST,
|
||||||
needToken: true,
|
needToken: true,
|
||||||
params,
|
params,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取商品评论列表
|
* 获取商品评论列表
|
||||||
* @param goodsId
|
* @param goodsId
|
||||||
@@ -337,7 +347,6 @@ export function getGoodsCommentsCount(goodsId) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取未读消息数量信息
|
* 获取未读消息数量信息
|
||||||
*/
|
*/
|
||||||
@@ -345,21 +354,21 @@ export function getNoReadMessageNum() {
|
|||||||
return http.request({
|
return http.request({
|
||||||
url: `members/member-nocice-logs/number`,
|
url: `members/member-nocice-logs/number`,
|
||||||
method: Method.GET,
|
method: Method.GET,
|
||||||
needToken: true
|
needToken: true,
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 我的足迹列表
|
* 我的足迹列表
|
||||||
* @param pageNumber pageSize
|
* @param pageNumber pageSize
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
export function myTrackList(params) {
|
export function myTrackList(params) {
|
||||||
return http.request({
|
return http.request({
|
||||||
url: `/footprint`,
|
url: `/footprint`,
|
||||||
method: Method.GET,
|
method: Method.GET,
|
||||||
needToken: true,
|
needToken: true,
|
||||||
params
|
params,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -371,42 +380,42 @@ export function deleteHistoryListId(ids) {
|
|||||||
return http.request({
|
return http.request({
|
||||||
url: `/footprint/delByIds/${ids}`,
|
url: `/footprint/delByIds/${ids}`,
|
||||||
method: Method.DELETE,
|
method: Method.DELETE,
|
||||||
needToken: true
|
needToken: true,
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取当前会员优惠券列表
|
* 获取当前会员优惠券列表
|
||||||
* @param
|
* @param
|
||||||
*/
|
*/
|
||||||
export function getMemberCoupons(data) {
|
export function getMemberCoupons(data) {
|
||||||
return http.request({
|
return http.request({
|
||||||
url: `/promotion/coupon/getCoupons`,
|
url: `/promotion/coupon/getCoupons`,
|
||||||
method: Method.GET,
|
method: Method.GET,
|
||||||
needToken: true,
|
needToken: true,
|
||||||
params:data
|
params: data,
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取当前会员可使用的优惠券数量
|
* 获取当前会员可使用的优惠券数量
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
export function getCouponsNum() {
|
export function getCouponsNum() {
|
||||||
return http.request({
|
return http.request({
|
||||||
url: `/promotion/coupon/getCouponsNum`,
|
url: `/promotion/coupon/getCouponsNum`,
|
||||||
method: Method.GET,
|
method: Method.GET,
|
||||||
needToken: true
|
needToken: true,
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取会员积分VO
|
* 获取会员积分VO
|
||||||
* @param
|
* @param
|
||||||
*/
|
*/
|
||||||
export function getMemberPointSum() {
|
export function getMemberPointSum() {
|
||||||
return http.request({
|
return http.request({
|
||||||
url: `member/memberPointsHistory/getMemberPointsHistoryVO`,
|
url: `member/memberPointsHistory/getMemberPointsHistoryVO`,
|
||||||
method: Method.GET
|
method: Method.GET,
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -67,15 +67,28 @@ export function getLogisticsMessages(params) {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TODO 获取版本更新信息 暂无此功能。后续会优化更新
|
|
||||||
* @param appType
|
* @param appType
|
||||||
* @returns {AxiosPromise}
|
* @returns {AxiosPromise}
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
export function getAppVersionList(appType) {
|
export function getAppVersion(appType) {
|
||||||
return http.request({
|
return http.request({
|
||||||
url: `/appVersion/${appType}`,
|
url: `/appVersion/${appType}`,
|
||||||
method: Method.GET,
|
method: Method.GET,
|
||||||
type:"manager"
|
type:"manager"
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param appType
|
||||||
|
* @returns {AxiosPromise}
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
export function getAppVersionList(type,data) {
|
||||||
|
return http.request({
|
||||||
|
url: `/appVersion/appVersion/${type}`,
|
||||||
|
method: Method.GET,
|
||||||
|
type:"manager",
|
||||||
|
data
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,8 +1,21 @@
|
|||||||
/**
|
/**
|
||||||
* 促销相关API
|
* 促销相关API
|
||||||
*/
|
*/
|
||||||
import {http, Method} from '@/utils/request.js';
|
import { http, Method } from "@/utils/request.js";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取当前直播列表
|
||||||
|
*
|
||||||
|
* @param {*}
|
||||||
|
* @returns
|
||||||
|
*/
|
||||||
|
export function getLiveList(params) {
|
||||||
|
return http.request({
|
||||||
|
url: `broadcast/studio`,
|
||||||
|
method: Method.GET,
|
||||||
|
params,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取当前拼团活动的未成团的会员
|
* 获取当前拼团活动的未成团的会员
|
||||||
@@ -14,24 +27,22 @@ export function getPromotionGroupMember(pintuanId) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/** 获取拼团列表 */
|
/** 获取拼团列表 */
|
||||||
export function getAssembleList(params) {
|
export function getAssembleList(params) {
|
||||||
return http.request({
|
return http.request({
|
||||||
url: 'promotion/pintuan',
|
url: "promotion/pintuan",
|
||||||
method: Method.GET,
|
method: Method.GET,
|
||||||
loading: false,
|
loading: false,
|
||||||
params
|
params,
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取积分商城分类
|
* 获取积分商城分类
|
||||||
*/
|
*/
|
||||||
export function getPointsCategory() {
|
export function getPointsCategory() {
|
||||||
return http.request({
|
return http.request({
|
||||||
url: '/promotion/pointsGoods/category',
|
url: "/promotion/pointsGoods/category",
|
||||||
method: Method.GET,
|
method: Method.GET,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -40,20 +51,32 @@ export function getPointsCategory() {
|
|||||||
* 获取积分商城商品
|
* 获取积分商城商品
|
||||||
* @param params
|
* @param params
|
||||||
*/
|
*/
|
||||||
export function getPointsGoods(params) {
|
export function getPointsGoods(params) {
|
||||||
return http.request({
|
return http.request({
|
||||||
url: '/promotion/pointsGoods',
|
url: "/promotion/pointsGoods",
|
||||||
method: Method.GET,
|
method: Method.GET,
|
||||||
params,
|
params,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* 获取积分商城商品详情
|
||||||
|
* @param params
|
||||||
|
*/
|
||||||
|
export function getPointsGoodsDetail(id) {
|
||||||
|
return http.request({
|
||||||
|
url: "/promotion/pointsGoods/"+id,
|
||||||
|
method: Method.GET,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取限时抢购时间线 当天限时抢购信息
|
* 获取限时抢购时间线 当天限时抢购信息
|
||||||
*/
|
*/
|
||||||
export function getSeckillTimeLine() {
|
export function getSeckillTimeLine() {
|
||||||
return http.request({
|
return http.request({
|
||||||
url: 'promotion/seckill',
|
url: "promotion/seckill",
|
||||||
method: Method.GET,
|
method: Method.GET,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -75,8 +98,91 @@ export function getSeckillTimeGoods(timeline) {
|
|||||||
*/
|
*/
|
||||||
export function getAllCoupons(params) {
|
export function getAllCoupons(params) {
|
||||||
return http.request({
|
return http.request({
|
||||||
url: '/promotion/coupon',
|
url: "/promotion/coupon",
|
||||||
method: Method.GET,
|
method: Method.GET,
|
||||||
params,
|
params,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页获取砍价商品
|
||||||
|
* @param params
|
||||||
|
*/
|
||||||
|
export function getBargainList(params) {
|
||||||
|
return http.request({
|
||||||
|
url: "/promotion/kanjiaGoods",
|
||||||
|
method: Method.GET,
|
||||||
|
params,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页获取砍价商品
|
||||||
|
* @param params
|
||||||
|
*/
|
||||||
|
export function getBargainDetail(id) {
|
||||||
|
return http.request({
|
||||||
|
url: `/promotion/kanjiaGoods/${id}`,
|
||||||
|
method: Method.GET,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取砍价活动
|
||||||
|
* @param params
|
||||||
|
*/
|
||||||
|
export function getBargainActivity(params) {
|
||||||
|
return http.request({
|
||||||
|
url: `/promotion/kanjiaGoods/getKanjiaActivity`,
|
||||||
|
method: Method.POST,
|
||||||
|
params,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 发起砍价活动
|
||||||
|
* @param params
|
||||||
|
*/
|
||||||
|
export function openBargain(params) {
|
||||||
|
return http.request({
|
||||||
|
url: `/promotion/kanjiaGoods`,
|
||||||
|
method: Method.POST,
|
||||||
|
header: { "content-type": "application/x-www-form-urlencoded" },
|
||||||
|
data: params,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页获取砍价活动-帮砍记录
|
||||||
|
*/
|
||||||
|
export function getBargainLog(params) {
|
||||||
|
return http.request({
|
||||||
|
url: `/promotion/kanjiaGoods/getKanjiaActivity/logs`,
|
||||||
|
method: Method.GET,
|
||||||
|
data: params,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页获取砍价活动-帮砍记录
|
||||||
|
*/
|
||||||
|
export function helpBargain(kanJiaActivityId) {
|
||||||
|
return http.request({
|
||||||
|
url: `promotion/kanjiaGoods/help/${kanJiaActivityId}`,
|
||||||
|
method: Method.POST,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页获取已参与的砍价活动
|
||||||
|
*/
|
||||||
|
export function getMineBargainLog(params) {
|
||||||
|
return http.request({
|
||||||
|
url: `/promotion/kanjiaGoods/kanjiaActivity/mine/`,
|
||||||
|
method: Method.GET,
|
||||||
|
params
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
31
api/store.js
31
api/store.js
@@ -20,10 +20,37 @@ export function getstoreList(params) {
|
|||||||
* 获取店铺基本信息
|
* 获取店铺基本信息
|
||||||
* @param storeId
|
* @param storeId
|
||||||
*/
|
*/
|
||||||
export function getstoreBaseInfo(storeId) {
|
export function getStoreBaseInfo(storeId) {
|
||||||
return http.request({
|
return http.request({
|
||||||
url: `/store/get/detail/${storeId}`,
|
url: `/store/get/detail/${storeId}`,
|
||||||
method: Method.GET,
|
method: Method.GET,
|
||||||
loading: false,
|
loading: false,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取店铺分类
|
||||||
|
* @param id
|
||||||
|
*/
|
||||||
|
export function getStoreCategory(id) {
|
||||||
|
return http.request({
|
||||||
|
url: `/store/label/get/${id}`,
|
||||||
|
method: Method.GET,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 营业执照
|
||||||
|
* @param id
|
||||||
|
*/
|
||||||
|
export function getLicencePhoto(id) {
|
||||||
|
return http.request({
|
||||||
|
url: `/store/get/licencePhoto/${id}`,
|
||||||
|
method: Method.GET,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
3
components/m-buy/README.md
Normal file
3
components/m-buy/README.md
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
## 购买组件
|
||||||
|
1.本组件是砍价,积分购买,参团等复用组
|
||||||
|
2.后续会将此组件和商品购买组件合并,文档后续再出
|
||||||
@@ -1,24 +1,26 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="wrapper">
|
<div class="wrapper">
|
||||||
<u-popup class="popup" v-model="buyMask" :height="setup.height" closeable :mode="setup.mode" :mask-close-able="isClose" :mask="isMask" :border-radius="setup.radius" @close="closeMask()">
|
<u-popup class="popup" v-model="buyMask" :height="setup.height" closeable :mode="setup.mode"
|
||||||
|
:border-radius="setup.radius" @close="closeMask()">
|
||||||
<!-- 商品 -->
|
<!-- 商品 -->
|
||||||
<view class="goods-box bottom">
|
<view class="goods-box bottom">
|
||||||
<view class="goods-header">
|
<view class="goods-header">
|
||||||
<view class="goods-img">
|
<view class="goods-img">
|
||||||
<u-image width="200rpx" border-radius="20" class="uimage" height="200rpx" :src="selectedSpecImg ? selectedSpecImg : goodsDetail.thumbnail"></u-image>
|
<u-image width="200rpx" border-radius="20" class="uimage" height="200rpx"
|
||||||
|
:src="selectedSpecImg ? selectedSpecImg : goodsDetail.thumbnail"></u-image>
|
||||||
</view>
|
</view>
|
||||||
<view class="goods-skus">
|
<view class="goods-skus">
|
||||||
|
|
||||||
<!-- 有活动商品价格 -->
|
<!-- 有活动商品价格 -->
|
||||||
<view class="goods-price " v-if="goodsDetail.promotionPrice">
|
<view class="goods-price " v-if="goodsDetail.promotionPrice">
|
||||||
<span v-if="goodsDetail.promotionPrice && !pointDetail">
|
<span v-if="goodsDetail.promotionPrice && !pointDetail">
|
||||||
¥
|
¥
|
||||||
<span class="goods-price-promotionShow goods-price-bigshow" >{{ formatPrice(goodsDetail.promotionPrice)[0] }}</span>
|
<span
|
||||||
|
class="goods-price-promotionShow goods-price-bigshow">{{ formatPrice(goodsDetail.promotionPrice)[0] }}</span>
|
||||||
.{{ formatPrice(goodsDetail.promotionPrice)[1] }}
|
.{{ formatPrice(goodsDetail.promotionPrice)[1] }}
|
||||||
</span>
|
</span>
|
||||||
<span v-if="pointDetail.points">
|
<span v-if="pointDetail.points">
|
||||||
|
<span class="goods-price-promotionShow goods-price-bigshow">{{ pointDetail.points }}</span>
|
||||||
<span class="goods-price-promotionShow goods-price-bigshow" >{{ pointDetail.points }}</span>
|
|
||||||
积分
|
积分
|
||||||
</span>
|
</span>
|
||||||
<div class="promotion-box">
|
<div class="promotion-box">
|
||||||
@@ -27,18 +29,18 @@
|
|||||||
formatPrice(goodsDetail.price)[0]
|
formatPrice(goodsDetail.price)[0]
|
||||||
}}</span>
|
}}</span>
|
||||||
.{{ formatPrice(goodsDetail.price)[1] }}
|
.{{ formatPrice(goodsDetail.price)[1] }}
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</view>
|
</view>
|
||||||
<!-- 正常商品的价格 -->
|
<!-- 正常商品的价格 -->
|
||||||
<view class="goods-price" v-else>
|
<view class="goods-price" v-else>
|
||||||
<span>
|
<span>
|
||||||
¥
|
¥
|
||||||
<span class="goods-price-bigshow">{{
|
<span class="goods-price-bigshow">{{
|
||||||
formatPrice(goodsDetail.price)[0]
|
formatPrice(goodsDetail.price)[0]
|
||||||
}}</span>
|
}}</span>
|
||||||
.{{ formatPrice(goodsDetail.price)[1] }}
|
.{{ formatPrice(goodsDetail.price)[1] }}
|
||||||
|
|
||||||
</span>
|
</span>
|
||||||
</view>
|
</view>
|
||||||
<view class="goods-check-skus">
|
<view class="goods-check-skus">
|
||||||
@@ -51,25 +53,38 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<!-- 商品信息 -->
|
<!-- 商品信息 -->
|
||||||
<view class="goods-skus-box">
|
<scroll-view class="goods-skus-box" :scroll-y="true">
|
||||||
<!-- 规格 -->
|
<!-- 规格 -->
|
||||||
<view class="goods-skus-view" :key="specIndex" v-for="(spec, specIndex) in formatList">
|
<view class="goods-skus-view" :key="specIndex" v-for="(spec, specIndex) in formatList">
|
||||||
<view class="skus-view-list">
|
<view class="skus-view-list">
|
||||||
<view class="view-class-title">{{ spec.name }}</view>
|
<view class="view-class-title">{{ spec.name }}</view>
|
||||||
<view :class="{ active: spec_val.id == currentSelceted[specIndex] }" class="skus-view-item" v-for="(spec_val, spec_index) in spec.values" :key="spec_index"
|
|
||||||
@click="handleClickSpec(spec, specIndex, spec_val)">{{ spec_val.value }}</view>
|
|
||||||
|
<!-- 正常逻辑 循环出sku -->
|
||||||
|
<view v-if="!parentOrder" :class="{ active: spec_val.value == currentSelceted[specIndex] }" class="skus-view-item"
|
||||||
|
v-for="(spec_val, spec_index) in spec.values" :key="spec_index"
|
||||||
|
@click="handleClickSpec(spec, specIndex, spec_val)">{{ spec_val.value }} </view>
|
||||||
|
|
||||||
|
<!-- 拼团购买,仅筛选出当前拼团类型商品 -->
|
||||||
|
<view v-if="parentOrder && spec_val.skuId == goodsDetail.id" :class="{ active: spec_val.value == currentSelceted[specIndex] }" class="skus-view-item"
|
||||||
|
v-for="(spec_val, spec_index) in spec.values" :key="spec_index"
|
||||||
|
@click="handleClickSpec(spec, specIndex, spec_val)">{{ spec_val.value }} </view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<!-- 数量 -->
|
<!-- 数量 -->
|
||||||
<view class="goods-skus-number">
|
<view class="goods-skus-number">
|
||||||
<view class="view-class-title">数量</view>
|
<view class="view-class-title">数量</view>
|
||||||
<u-number-box :bg-color="numberBox.bgColor" :color="numberBox.color" :input-width="numberBox.width" :input-height="numberBox.height" :size="numberBox.size" :min="1" v-model="num">
|
<u-number-box :bg-color="numberBox.bgColor" :max="200" :color="numberBox.color"
|
||||||
|
:input-width="numberBox.width" :input-height="numberBox.height" :size="numberBox.size" :min="1"
|
||||||
|
v-model="num">
|
||||||
</u-number-box>
|
</u-number-box>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</scroll-view>
|
||||||
<!-- 按钮 -->
|
<!-- 按钮 -->
|
||||||
<view class="btns">
|
<view class="btns">
|
||||||
<view class="box-btn card" v-if="buyType !='PINTUAN'" @click="addToCartOrBuy('cart')">加入购物车</view>
|
|
||||||
|
<view class="box-btn card" v-if="buyType != 'PINTUAN' && goodsDetail.goodsType!='VIRTUAL_GOODS'"
|
||||||
|
@click="addToCartOrBuy('cart')">加入购物车</view>
|
||||||
<view class="box-btn buy" @click="addToCartOrBuy('buy')">立即购买</view>
|
<view class="box-btn buy" @click="addToCartOrBuy('buy')">立即购买</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -79,6 +94,7 @@
|
|||||||
<script>
|
<script>
|
||||||
import * as API_trade from "@/api/trade.js";
|
import * as API_trade from "@/api/trade.js";
|
||||||
import setup from "./popup";
|
import setup from "./popup";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@@ -100,18 +116,35 @@ export default {
|
|||||||
formatList: [],
|
formatList: [],
|
||||||
currentSelceted: [],
|
currentSelceted: [],
|
||||||
skuList: "",
|
skuList: "",
|
||||||
isMask:false, //是否显示遮罩层
|
isClose: false, //是否可以点击遮罩关闭
|
||||||
isClose:false, //是否可以点击遮罩关闭
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
props: [
|
props: {
|
||||||
"goodsDetail", //商品详情
|
buyMask: {
|
||||||
"buyMask",
|
type: Boolean,
|
||||||
"selectedSku",
|
default: false,
|
||||||
"goodsSpec",
|
},
|
||||||
"addr",
|
goodsDetail: {
|
||||||
"pointDetail" // 积分详情
|
default: "",
|
||||||
],
|
type: null,
|
||||||
|
},
|
||||||
|
selectedSku: {
|
||||||
|
default: "",
|
||||||
|
type: null,
|
||||||
|
},
|
||||||
|
goodsSpec: {
|
||||||
|
default: "",
|
||||||
|
type: null,
|
||||||
|
},
|
||||||
|
addr: {
|
||||||
|
default: "",
|
||||||
|
type: null,
|
||||||
|
},
|
||||||
|
pointDetail:{
|
||||||
|
default: "",
|
||||||
|
type: null,
|
||||||
|
}
|
||||||
|
},
|
||||||
watch: {
|
watch: {
|
||||||
buyType: {
|
buyType: {
|
||||||
handler(val) {
|
handler(val) {
|
||||||
@@ -128,6 +161,8 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
|
|
||||||
|
|
||||||
// 格式化金钱 1999 --> [1999,00]
|
// 格式化金钱 1999 --> [1999,00]
|
||||||
formatPrice(val) {
|
formatPrice(val) {
|
||||||
if (typeof val == "undefined") {
|
if (typeof val == "undefined") {
|
||||||
@@ -142,14 +177,12 @@ export default {
|
|||||||
|
|
||||||
/**点击规格 */
|
/**点击规格 */
|
||||||
handleClickSpec(val, index, specValue) {
|
handleClickSpec(val, index, specValue) {
|
||||||
this.$set(this.currentSelceted, index, specValue.id);
|
this.currentSelceted[index] = specValue.value;
|
||||||
|
|
||||||
let selectedSkuId = this.goodsSpec.find((i) => {
|
let selectedSkuId = this.goodsSpec.find((i) => {
|
||||||
let matched = true;
|
let matched = true;
|
||||||
let specValues = i.specValues.filter((j) => j.specName !== "images");
|
let specValues = i.specValues.filter((j) => j.specName !== "images");
|
||||||
|
|
||||||
for (let n = 0; n < specValues.length; n++) {
|
for (let n = 0; n < specValues.length; n++) {
|
||||||
if (specValues[n].specValueId !== this.currentSelceted[n]) {
|
if (specValues[n].specValue !== this.currentSelceted[n]) {
|
||||||
matched = false;
|
matched = false;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -158,19 +191,48 @@ export default {
|
|||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
if (selectedSkuId?.skuId) {
|
||||||
|
this.$set(this.currentSelceted, index, specValue.value);
|
||||||
|
this.selectSkuList = {
|
||||||
|
spec: {
|
||||||
|
specName: val.name,
|
||||||
|
specValue: specValue.value,
|
||||||
|
},
|
||||||
|
data: this.goodsDetail,
|
||||||
|
};
|
||||||
|
this.selectName = specValue.value;
|
||||||
|
|
||||||
this.selectSkuList = {
|
this.$emit("handleClickSku", {
|
||||||
spec: {
|
skuId: selectedSkuId.skuId,
|
||||||
specName: val.name,
|
goodsId: this.goodsDetail.goodsId,
|
||||||
specValue: specValue.value,
|
});
|
||||||
},
|
} else {
|
||||||
data: this.goodsDetail,
|
uni.showToast({
|
||||||
};
|
title: "暂无该商品!",
|
||||||
this.selectName = specValue.value;
|
duration: 2000,
|
||||||
|
icon: "none",
|
||||||
this.$emit("handleClickSku", selectedSkuId.skuId,this.goodsDetail.id);
|
});
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 直接购买
|
||||||
|
*/
|
||||||
|
buy(data) {
|
||||||
|
API_trade.addToCart(data).then((res) => {
|
||||||
|
if (res.data.success) {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: `/pages/order/fillorder?way=${
|
||||||
|
data.cartType
|
||||||
|
}&addr=${""}&parentOrder=${encodeURIComponent(
|
||||||
|
JSON.stringify(this.parentOrder)
|
||||||
|
)}`,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 添加到购物车或购买
|
* 添加到购物车或购买
|
||||||
*/
|
*/
|
||||||
@@ -197,57 +259,42 @@ export default {
|
|||||||
|
|
||||||
this.$emit("queryCart");
|
this.$emit("queryCart");
|
||||||
this.closeMask();
|
this.closeMask();
|
||||||
} else {
|
|
||||||
uni.showToast({
|
|
||||||
title: res.data.message,
|
|
||||||
duration: 2000,
|
|
||||||
icon: "none",
|
|
||||||
});
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
// 判断是否拼团商品
|
// 判断是否拼团商品
|
||||||
if (this.buyType) {
|
if (this.buyType) {
|
||||||
data.cartType = "PINTUAN";
|
data.cartType = "PINTUAN";
|
||||||
|
} else if (this.goodsDetail.goodsType == "VIRTUAL_GOODS") {
|
||||||
|
data.cartType = "VIRTUAL";
|
||||||
} else {
|
} else {
|
||||||
data.cartType = "BUY_NOW";
|
data.cartType = "BUY_NOW";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
API_trade.addToCart(data).then((res) => {
|
API_trade.addToCart(data).then((res) => {
|
||||||
if (res.data.code == 200) {
|
if (res.data.code == 200) {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: `/pages/order/fillorder?way=${data.cartType}&addr=${
|
url: `/pages/order/fillorder?way=${data.cartType}&addr=${
|
||||||
this.addr.id || ''
|
this.addr.id || ""
|
||||||
}&parentOrder=${encodeURIComponent(
|
}&parentOrder=${encodeURIComponent(
|
||||||
JSON.stringify(this.parentOrder)
|
JSON.stringify(this.parentOrder)
|
||||||
)}`,
|
)}`,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
else{
|
|
||||||
uni.showToast({
|
|
||||||
title: res.data.message,
|
|
||||||
duration: 2000,
|
|
||||||
icon: "none",
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
formatSku(list) {
|
formatSku(list) {
|
||||||
// 格式化数据
|
// 格式化数据
|
||||||
|
console.log(list);
|
||||||
let arr = [{}];
|
let arr = [{}];
|
||||||
list.forEach((item, index) => {
|
list.forEach((item, index) => {
|
||||||
item.specValues.forEach((spec, specIndex) => {
|
item.specValues.forEach((spec, specIndex) => {
|
||||||
let id = spec.specNameId;
|
|
||||||
let name = spec.specName;
|
let name = spec.specName;
|
||||||
let values = {
|
let values = {
|
||||||
id: spec.specValueId,
|
|
||||||
value: spec.specValue,
|
value: spec.specValue,
|
||||||
quantity: item.quantity,
|
quantity: item.quantity,
|
||||||
|
skuId: item.skuId,
|
||||||
};
|
};
|
||||||
if (name === "images") {
|
if (name === "images") {
|
||||||
return;
|
return;
|
||||||
@@ -257,7 +304,9 @@ export default {
|
|||||||
if (
|
if (
|
||||||
arrItem.name == name &&
|
arrItem.name == name &&
|
||||||
arrItem.values &&
|
arrItem.values &&
|
||||||
!arrItem.values.find((i) => i.id === values.id)
|
!arrItem.values.find((i) => {
|
||||||
|
return i.value === values.value;
|
||||||
|
})
|
||||||
) {
|
) {
|
||||||
arrItem.values.push(values);
|
arrItem.values.push(values);
|
||||||
}
|
}
|
||||||
@@ -266,8 +315,8 @@ export default {
|
|||||||
return key.name;
|
return key.name;
|
||||||
});
|
});
|
||||||
if (!keys.includes(name)) {
|
if (!keys.includes(name)) {
|
||||||
|
console.log(name, values);
|
||||||
arr.push({
|
arr.push({
|
||||||
id: id,
|
|
||||||
name: name,
|
name: name,
|
||||||
values: [values],
|
values: [values],
|
||||||
});
|
});
|
||||||
@@ -280,11 +329,12 @@ export default {
|
|||||||
this.formatList = arr;
|
this.formatList = arr;
|
||||||
|
|
||||||
list.forEach((item) => {
|
list.forEach((item) => {
|
||||||
|
// 默认选中
|
||||||
if (item.skuId === this.goodsDetail.id) {
|
if (item.skuId === this.goodsDetail.id) {
|
||||||
item.specValues
|
item.specValues
|
||||||
.filter((i) => i.specName !== "images")
|
.filter((i) => i.specName !== "images")
|
||||||
.forEach((value, _index) => {
|
.forEach((value, _index) => {
|
||||||
this.currentSelceted[_index] = value.specValueId;
|
this.currentSelceted[_index] = value.specValue;
|
||||||
|
|
||||||
this.selectName = value.specValue;
|
this.selectName = value.specValue;
|
||||||
|
|
||||||
@@ -297,11 +347,11 @@ export default {
|
|||||||
});
|
});
|
||||||
|
|
||||||
this.skuList = list;
|
this.skuList = list;
|
||||||
|
// console.log(" this.skuList", this.skuList)
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
mounted() {
|
mounted() {
|
||||||
|
|
||||||
this.formatSku(this.goodsSpec);
|
this.formatSku(this.goodsSpec);
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
@@ -336,10 +386,10 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.active {
|
.active {
|
||||||
background: $jd-light-color !important;
|
background: $price-light-color !important;
|
||||||
border: 2rpx solid $jd-color;
|
border: 2rpx solid $price-color;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
color: $jd-color !important;
|
color: $price-color !important;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -391,7 +441,7 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.goods-price {
|
.goods-price {
|
||||||
color: $jd-color;
|
color: $price-color;
|
||||||
line-height: 80rpx;
|
line-height: 80rpx;
|
||||||
display: flex;
|
display: flex;
|
||||||
}
|
}
|
||||||
@@ -14,7 +14,7 @@
|
|||||||
line-height: 80rpx;
|
line-height: 80rpx;
|
||||||
height: 80rpx;
|
height: 80rpx;
|
||||||
|
|
||||||
background: $jd-color;
|
background: $price-color;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
border-radius: 200px;
|
border-radius: 200px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
10
components/m-goods-recommend/README.md
Normal file
10
components/m-goods-recommend/README.md
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
## 商品推荐
|
||||||
|
|
||||||
|
|
||||||
|
### OBJECT 参数说明
|
||||||
|
属性|说明|类型|必填
|
||||||
|
---|---|---|---
|
||||||
|
`title`|标题,用于顶部显示的内容|String|否
|
||||||
|
`pageSize`|显示多少条数据,建议是2的倍数,默认为12条|*|否
|
||||||
|
`categoryId`|分类id|Function|否
|
||||||
|
`storeId`|卖家id,搜索店铺商品的时候使用|String|否
|
||||||
152
components/m-goods-recommend/index.vue
Normal file
152
components/m-goods-recommend/index.vue
Normal file
@@ -0,0 +1,152 @@
|
|||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<div class="goods-recommend">{{title ? `--${title}-- `:''}}</div>
|
||||||
|
<div class="goods-list">
|
||||||
|
<div @click="handleClick(item)" class="goods-item" v-for="(item, item_index) in goodsList" :key="item_index">
|
||||||
|
<div class="goods-img">
|
||||||
|
<u-image :src="item.content.thumbnail" mode="aspectFill" height="350rpx" width="100%">
|
||||||
|
<u-loading slot="loading"></u-loading>
|
||||||
|
</u-image>
|
||||||
|
</div>
|
||||||
|
<div class="goods-desc">
|
||||||
|
<div class="goods-title">
|
||||||
|
{{ item.content.goodsName }}
|
||||||
|
</div>
|
||||||
|
<div class="goods-bottom">
|
||||||
|
<div class="goods-price">¥{{ item.content.price | unitPrice }}</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { getGoodsList } from "@/api/goods.js";
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
goodsList: [],
|
||||||
|
params: {
|
||||||
|
pageNumber: 1,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
},
|
||||||
|
props: {
|
||||||
|
title: {
|
||||||
|
type: String,
|
||||||
|
default: "",
|
||||||
|
},
|
||||||
|
pageSize: {
|
||||||
|
type: null,
|
||||||
|
default: 12,
|
||||||
|
},
|
||||||
|
categoryId: {
|
||||||
|
type: null,
|
||||||
|
default: "",
|
||||||
|
},
|
||||||
|
storeId: {
|
||||||
|
type: null,
|
||||||
|
default: "",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.initGoods();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
/**
|
||||||
|
* 初始化商品
|
||||||
|
*/
|
||||||
|
async initGoods() {
|
||||||
|
let submit = JSON.parse(
|
||||||
|
JSON.stringify(
|
||||||
|
Object.assign(this.params, {
|
||||||
|
pageSize: this.pageSize,
|
||||||
|
categoryId: this.categoryId,
|
||||||
|
storeId: this.storeId,
|
||||||
|
})
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
Object.keys(submit).map((key) => {
|
||||||
|
if (!submit[key] || submit[key].length == 0) {
|
||||||
|
delete submit[key];
|
||||||
|
}
|
||||||
|
});
|
||||||
|
let goodsList = await getGoodsList(submit);
|
||||||
|
this.goodsList.push(...goodsList.data.result.content);
|
||||||
|
},
|
||||||
|
handleClick(item) {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: `/pages/product/goods?id=${item.content.id}&goodsId=${item.content.goodsId}`,
|
||||||
|
});
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
/**商品代码 */
|
||||||
|
$w_94: 94%;
|
||||||
|
.goods-recommend {
|
||||||
|
background: #f7f7f7;
|
||||||
|
height: 100rpx;
|
||||||
|
line-height: 100rpx;
|
||||||
|
text-align: center;
|
||||||
|
font-size: 30rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
.goods-list {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
background: #f7f7f7;
|
||||||
|
}
|
||||||
|
.goods-item {
|
||||||
|
width: 50%;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
border-radius: 0.4em;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
.goods-img {
|
||||||
|
position: relative;
|
||||||
|
margin: 0 auto;
|
||||||
|
width: $w_94;
|
||||||
|
height: 350rpx;
|
||||||
|
border-top-left-radius: 20rpx;
|
||||||
|
border-top-right-radius: 20rpx;
|
||||||
|
overflow: hidden;
|
||||||
|
> img {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.goods-desc {
|
||||||
|
border-bottom-left-radius: 20rpx;
|
||||||
|
border-bottom-right-radius: 20rpx;
|
||||||
|
width: $w_94;
|
||||||
|
background: #fff;
|
||||||
|
padding: 8rpx 0 8rpx 8rpx;
|
||||||
|
margin: 0 auto;
|
||||||
|
> .goods-title {
|
||||||
|
font-size: 12px;
|
||||||
|
height: 70rpx;
|
||||||
|
display: -webkit-box;
|
||||||
|
font-weight: 500;
|
||||||
|
-webkit-box-orient: vertical;
|
||||||
|
|
||||||
|
-webkit-line-clamp: 2;
|
||||||
|
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
> .goods-bottom {
|
||||||
|
display: flex;
|
||||||
|
font-weight: bold;
|
||||||
|
|
||||||
|
> .goods-price {
|
||||||
|
line-height: 2;
|
||||||
|
color: $main-color;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -1,20 +1,21 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="serach">
|
<view class="serach">
|
||||||
<view class="left-box" @tap="onClickLeft">
|
<view class="left-box" @tap="onClickLeft">
|
||||||
<uni-icons style="line-height:70rpx" type="back" size="24" />
|
<u-icon name="arrow-left" size="40" color="#666"></u-icon>
|
||||||
</view>
|
</view>
|
||||||
<view class="content" :style="{ 'border-radius': radius + 'px' }">
|
<view class="content" :style="{ 'border-radius': radius + 'px' }">
|
||||||
<!-- HM修改 增加进入输入状态的点击范围 -->
|
<!-- HM修改 增加进入输入状态的点击范围 -->
|
||||||
<view class="content-box" :class="{ center: mode === 2 }">
|
<view class="content-box" :class="{ center: mode === 2 }">
|
||||||
<u-icon name="search" size="32" style="padding:0 15rpx;"></u-icon>
|
<u-icon name="search" size="32" style="padding:0 15rpx;"></u-icon>
|
||||||
<!-- HM修改 增加placeholder input confirm-type confirm-->
|
<!-- HM修改 增加placeholder input confirm-type confirm-->
|
||||||
<input style="width:100%; " :placeholder="placeholder" placeholder-class="placeholder-color" @input="inputChange" confirm-type="search" @confirm="triggerConfirm" class="input"
|
<input style="width:100%; " :placeholder="placeholder" placeholder-class="placeholder-color"
|
||||||
|
@input="inputChange" confirm-type="search" @confirm="triggerConfirm" class="input"
|
||||||
:class="{ center: !active && mode === 2 }" :focus="isFocus" v-model="inputVal" @focus="focus" @blur="blur" />
|
:class="{ center: !active && mode === 2 }" :focus="isFocus" v-model="inputVal" @focus="focus" @blur="blur" />
|
||||||
<u-icon name="close" v-if="isDelShow" style="padding:0 30rpx;" @click="clear"></u-icon>
|
<u-icon name="close" v-if="isDelShow" style="padding:0 30rpx;" @click="clear"></u-icon>
|
||||||
</view>
|
</view>
|
||||||
<view v-show="(active && show && button === 'inside') || (isDelShow && button === 'inside')" class="serachBtn" @click="search">搜索</view>
|
|
||||||
</view>
|
</view>
|
||||||
<view v-if="button === 'outside'" class="button" :class="{ active: show || active }">
|
<view class="button active" >
|
||||||
<view v-if="isShowSeachGoods !=true" class="button-item">
|
<view v-if="isShowSeachGoods !=true" class="button-item">
|
||||||
<div @click="out()">取消</div>
|
<div @click="out()">取消</div>
|
||||||
</view>
|
</view>
|
||||||
@@ -28,14 +29,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import uniStatusBar from "../uni-status-bar/uni-status-bar.vue";
|
|
||||||
import uniIcons from "../uni-icons/uni-icons.vue";
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
|
||||||
uniStatusBar,
|
|
||||||
uniIcons,
|
|
||||||
},
|
|
||||||
props: {
|
props: {
|
||||||
mode: {
|
mode: {
|
||||||
value: Number,
|
value: Number,
|
||||||
@@ -50,15 +44,6 @@ export default {
|
|||||||
type: String,
|
type: String,
|
||||||
default: "",
|
default: "",
|
||||||
},
|
},
|
||||||
button: {
|
|
||||||
value: String,
|
|
||||||
default: "outside",
|
|
||||||
},
|
|
||||||
//
|
|
||||||
show: {
|
|
||||||
value: Boolean,
|
|
||||||
default: true,
|
|
||||||
},
|
|
||||||
// 默认半径为60
|
// 默认半径为60
|
||||||
radius: {
|
radius: {
|
||||||
value: String,
|
value: String,
|
||||||
@@ -131,7 +116,6 @@ export default {
|
|||||||
this.$emit("input", "");
|
this.$emit("input", "");
|
||||||
//this.$emit('search', '');//HM修改 清空内容时候不进行搜索
|
//this.$emit('search', '');//HM修改 清空内容时候不进行搜索
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 回退到上一级
|
* 回退到上一级
|
||||||
@@ -145,7 +129,7 @@ export default {
|
|||||||
*/
|
*/
|
||||||
search() {
|
search() {
|
||||||
if (!this.inputVal) {
|
if (!this.inputVal) {
|
||||||
if (!this.show && this.searchName == "取消") {
|
if (this.searchName == "取消") {
|
||||||
uni.hideKeyboard();
|
uni.hideKeyboard();
|
||||||
this.isFocus = false;
|
this.isFocus = false;
|
||||||
this.active = false;
|
this.active = false;
|
||||||
@@ -175,6 +159,9 @@ export default {
|
|||||||
font-size: $uni-font-size-base;
|
font-size: $uni-font-size-base;
|
||||||
|
|
||||||
.left-box {
|
.left-box {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
width: 15%;
|
width: 15%;
|
||||||
/* #ifndef APP-NVUE */
|
/* #ifndef APP-NVUE */
|
||||||
text-align: center;
|
text-align: center;
|
||||||
@@ -225,19 +212,6 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.serachBtn {
|
|
||||||
height: 100%;
|
|
||||||
flex-shrink: 0;
|
|
||||||
padding: 0 30rpx;
|
|
||||||
//HM修改 按钮背景色
|
|
||||||
background: linear-gradient(to right, grey, grey);
|
|
||||||
//background: $uni-color-success;
|
|
||||||
line-height: 60rpx;
|
|
||||||
color: #eee;
|
|
||||||
//border-left: 1px #ccc solid; //HM修改 去掉边框
|
|
||||||
transition: all 0.3s;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.button {
|
.button {
|
||||||
|
|||||||
@@ -58,13 +58,6 @@ export default {
|
|||||||
// 图片缩略图、 商品名称 、 type(goods,shop,pintuan) 拼团商品分享以及店铺分享
|
// 图片缩略图、 商品名称 、 type(goods,shop,pintuan) 拼团商品分享以及店铺分享
|
||||||
|
|
||||||
props: ["thumbnail", "goodsName", "type", "goodsId", "link"],
|
props: ["thumbnail", "goodsName", "type", "goodsId", "link"],
|
||||||
// #ifdef MP-WEIXIN
|
|
||||||
onShareAppMessage(res) {
|
|
||||||
return {
|
|
||||||
imageUrl: this.thumbnail || require("@/static/logo.png"),
|
|
||||||
};
|
|
||||||
},
|
|
||||||
// #endif
|
|
||||||
methods: {
|
methods: {
|
||||||
close() {
|
close() {
|
||||||
this.$emit("close");
|
this.$emit("close");
|
||||||
@@ -72,10 +65,14 @@ export default {
|
|||||||
// h5复制链接
|
// h5复制链接
|
||||||
// #ifdef H5
|
// #ifdef H5
|
||||||
copyLink() {
|
copyLink() {
|
||||||
let content =
|
let content;
|
||||||
this.configs.shareLink +
|
if (this.link) {
|
||||||
getCurrentPages()[getCurrentPages().length - 1].__page__.fullPath;
|
content = this.configs.shareLink + this.link;
|
||||||
|
} else {
|
||||||
|
content =
|
||||||
|
this.configs.shareLink +
|
||||||
|
getCurrentPages()[getCurrentPages().length - 1].__page__.fullPath;
|
||||||
|
}
|
||||||
if (content === null || content === undefined) {
|
if (content === null || content === undefined) {
|
||||||
content = "";
|
content = "";
|
||||||
} else content = content + "";
|
} else content = content + "";
|
||||||
@@ -93,19 +90,24 @@ export default {
|
|||||||
},
|
},
|
||||||
// #endif
|
// #endif
|
||||||
|
|
||||||
|
shareTitle() {
|
||||||
|
let shareTitle;
|
||||||
|
if (this.type == "goods") {
|
||||||
|
shareTitle = `我发现了一个${this.goodsName}商品快来跟我一起看看吧`;
|
||||||
|
} else if (this.type == "shops") {
|
||||||
|
shareTitle = `我发现了一个${this.goodsName}店铺快来跟我一起看看吧`;
|
||||||
|
} else if (this.type == "pintuan") {
|
||||||
|
shareTitle = `我拼了一个${this.goodsName}快来跟我一起抢购吧!`;
|
||||||
|
} else if (this.type == "kanjia") {
|
||||||
|
shareTitle = `请快来帮我砍一刀${this.goodsName}`;
|
||||||
|
}
|
||||||
|
return shareTitle;
|
||||||
|
},
|
||||||
|
|
||||||
// #ifdef APP-PLUS
|
// #ifdef APP-PLUS
|
||||||
handleShare(val) {
|
handleShare(val) {
|
||||||
|
console.log("12312312")
|
||||||
if (val.type <= 1) {
|
if (val.type <= 1) {
|
||||||
let shareTitle;
|
|
||||||
|
|
||||||
if (this.type == "goods") {
|
|
||||||
shareTitle = `我发现了一个${this.goodsName}商品快来跟我一起看看吧`;
|
|
||||||
} else if (this.type == "shops") {
|
|
||||||
shareTitle = `我发现了一个${this.goodsName}店铺快来跟我一起看看吧`;
|
|
||||||
} else if (this.type == "pintuan") {
|
|
||||||
shareTitle = `我拼了一个${this.goodsName}快来跟我一起抢购吧!`;
|
|
||||||
}
|
|
||||||
|
|
||||||
let scene; // "WXSenceTimeline 朋友圈 WXSceneSession 微信好友"
|
let scene; // "WXSenceTimeline 朋友圈 WXSceneSession 微信好友"
|
||||||
val.type == 1
|
val.type == 1
|
||||||
? (scene = "WXSenceTimeline")
|
? (scene = "WXSenceTimeline")
|
||||||
@@ -113,11 +115,11 @@ export default {
|
|||||||
uni.share({
|
uni.share({
|
||||||
provider: "weixin",
|
provider: "weixin",
|
||||||
scene: scene,
|
scene: scene,
|
||||||
href: configs.downloadLink + this.link,
|
href: configs.shareLink + this.link,
|
||||||
imageUrl: this.thumbnail,
|
imageUrl: this.thumbnail,
|
||||||
type: 0,
|
type: 0,
|
||||||
summary: this.goodsName,
|
summary: this.goodsName,
|
||||||
title: shareTitle,
|
title: this.shareTitle(),
|
||||||
success: function (res) {
|
success: function (res) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: "分享成功!",
|
title: "分享成功!",
|
||||||
|
|||||||
@@ -1,241 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div class="dropdown-item">
|
|
||||||
<!-- selected -->
|
|
||||||
<view class="dropdown-item__selected" @click="changePopup">
|
|
||||||
<slot name="title" v-if="$slots.title"></slot>
|
|
||||||
<block v-else>
|
|
||||||
<view class="selected__name">
|
|
||||||
{{title ? title : selectItem.text}}
|
|
||||||
</view>
|
|
||||||
<!-- <view class="selected__icon"
|
|
||||||
:class="showClass === 'show'? 'up' : 'down'"
|
|
||||||
>
|
|
||||||
<span class="iconfont"></span>
|
|
||||||
</view> -->
|
|
||||||
</block>
|
|
||||||
</view>
|
|
||||||
<view class="dropdown-item__content" :style="{top: contentTop + 'px'}" v-if="showList">
|
|
||||||
<!-- dropdown -->
|
|
||||||
<view :class="['list', showClass]">
|
|
||||||
<slot v-if="$slots.default"></slot>
|
|
||||||
<block v-else>
|
|
||||||
<view class="list__option" v-for="(item, index) in list" :key="index" @click="choose(item)">
|
|
||||||
<view>{{item.text}}</view>
|
|
||||||
<icon v-if="item.value === value" type="success_no_circle" size="26" />
|
|
||||||
</view>
|
|
||||||
</block>
|
|
||||||
</view>
|
|
||||||
<!-- dropdown-mask -->
|
|
||||||
|
|
||||||
<!-- @touchmove 禁止滑动 -->
|
|
||||||
<view @touchmove.stop.prevent="moveHandle" :class="['dropdown-mask', showClass]" v-if="showList" @click="closePopup"></view>
|
|
||||||
</view>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
export default {
|
|
||||||
components: {},
|
|
||||||
props: {
|
|
||||||
value: [Number, String, Object],
|
|
||||||
list: {
|
|
||||||
type: Array,
|
|
||||||
default: () => {
|
|
||||||
return []
|
|
||||||
}
|
|
||||||
},
|
|
||||||
title: [Number, String],
|
|
||||||
contentTopReduse: {
|
|
||||||
type: Number,
|
|
||||||
default: 0
|
|
||||||
}
|
|
||||||
},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
showList: "",
|
|
||||||
showClass: '',
|
|
||||||
selectItem: {},
|
|
||||||
contentTop: 0
|
|
||||||
}
|
|
||||||
},
|
|
||||||
watch: {},
|
|
||||||
mounted() {
|
|
||||||
this.showList = this.active;
|
|
||||||
this.selectItem = this.list[this.value];
|
|
||||||
// document.addEventListener('click', e => {
|
|
||||||
// //this.$el 可以获取当前组件的容器节点
|
|
||||||
// if (!this.$el.contains(e.target)) {
|
|
||||||
// console.log('change');
|
|
||||||
// this.close()
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
// 禁止滑动
|
|
||||||
moveHandle() {},
|
|
||||||
choose(item) {
|
|
||||||
this.selectItem = item
|
|
||||||
this.$emit('input', item.value)
|
|
||||||
this.closePopup()
|
|
||||||
},
|
|
||||||
changePopup() {
|
|
||||||
if (this.showList) {
|
|
||||||
this.closePopup()
|
|
||||||
} else {
|
|
||||||
this.openPopup()
|
|
||||||
}
|
|
||||||
},
|
|
||||||
openPopup() {
|
|
||||||
// this.$parent -> dropdown-menu
|
|
||||||
this.$parent.$emit('close')
|
|
||||||
this.showList = true
|
|
||||||
this.$nextTick(() => {
|
|
||||||
this.getElementData('.dropdown-item__selected', (data) => {
|
|
||||||
this.contentTop = data[0].bottom - this.contentTopReduse;
|
|
||||||
this.showClass = 'show'
|
|
||||||
})
|
|
||||||
})
|
|
||||||
},
|
|
||||||
closePopup() {
|
|
||||||
this.showClass = ''
|
|
||||||
setTimeout(() => {
|
|
||||||
this.showList = false
|
|
||||||
}, 300)
|
|
||||||
},
|
|
||||||
close() {
|
|
||||||
this.showClass = ''
|
|
||||||
this.showList = false
|
|
||||||
},
|
|
||||||
getElementData(el, callback) {
|
|
||||||
uni.createSelectorQuery().in(this).selectAll(el).boundingClientRect().exec((data) => {
|
|
||||||
callback(data[0]);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="scss">
|
|
||||||
@font-face {
|
|
||||||
font-family: 'iconfont';
|
|
||||||
/* project id 1564327 */
|
|
||||||
src: url('https://at.alicdn.com/t/font_1564327_fcszez4n5i.eot');
|
|
||||||
src: url('https://at.alicdn.com/t/font_1564327_fcszez4n5i.eot?#iefix') format('embedded-opentype'),
|
|
||||||
url('https://at.alicdn.com/t/font_1564327_fcszez4n5i.woff2') format('woff2'),
|
|
||||||
url('https://at.alicdn.com/t/font_1564327_fcszez4n5i.woff') format('woff'),
|
|
||||||
url('https://at.alicdn.com/t/font_1564327_fcszez4n5i.ttf') format('truetype'),
|
|
||||||
url('https://at.alicdn.com/t/font_1564327_fcszez4n5i.svg#iconfont') format('svg');
|
|
||||||
}
|
|
||||||
|
|
||||||
.iconfont {
|
|
||||||
font-family: "iconfont" !important;
|
|
||||||
font-size: 28rpx;
|
|
||||||
font-style: normal;
|
|
||||||
-webkit-font-smoothing: antialiased;
|
|
||||||
-webkit-text-stroke-width: 0.2px;
|
|
||||||
-moz-osx-font-smoothing: grayscale;
|
|
||||||
}
|
|
||||||
|
|
||||||
.line {
|
|
||||||
position: absolute;
|
|
||||||
height: 3px;
|
|
||||||
width: 100px;
|
|
||||||
background: #1abc9c;
|
|
||||||
}
|
|
||||||
|
|
||||||
.dropdown-item {
|
|
||||||
position: relative;
|
|
||||||
|
|
||||||
&__selected {
|
|
||||||
position: relative;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
background: transparent;
|
|
||||||
// padding: 10rpx;
|
|
||||||
box-sizing: border-box;
|
|
||||||
justify-content: center;
|
|
||||||
|
|
||||||
.selected__name {
|
|
||||||
font-size: 32rpx;
|
|
||||||
white-space: nowrap;
|
|
||||||
position: relative;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
.selected__icon {
|
|
||||||
margin-left: 8rpx;
|
|
||||||
|
|
||||||
&.down {
|
|
||||||
transition: transform .3s;
|
|
||||||
transform: rotateZ(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
&.up {
|
|
||||||
transition: transform .3s;
|
|
||||||
transform: rotateZ(-180deg);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
&__content {
|
|
||||||
position: fixed;
|
|
||||||
left: 0;
|
|
||||||
right: 0;
|
|
||||||
overflow: hidden;
|
|
||||||
top: 0;
|
|
||||||
bottom: 0;
|
|
||||||
z-index: 10;
|
|
||||||
|
|
||||||
.list {
|
|
||||||
max-height: 400px;
|
|
||||||
overflow-y: auto;
|
|
||||||
position: absolute;
|
|
||||||
left: 0;
|
|
||||||
right: 0;
|
|
||||||
z-index: 3;
|
|
||||||
background: #fff;
|
|
||||||
transform: translateY(-100%);
|
|
||||||
transition: all .3s;
|
|
||||||
|
|
||||||
&.show {
|
|
||||||
transform: translateY(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
&__option {
|
|
||||||
font-size: 32rpx;
|
|
||||||
padding: 26rpx 28rpx;
|
|
||||||
display: flex;
|
|
||||||
justify-content: space-between;
|
|
||||||
|
|
||||||
&:not(:last-child) {
|
|
||||||
border-bottom: 1rpx solid #DDDDDD;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.dropdown-mask {
|
|
||||||
position: absolute;
|
|
||||||
left: 0;
|
|
||||||
right: 0;
|
|
||||||
top: 0;
|
|
||||||
bottom: 0;
|
|
||||||
transition: all .3s;
|
|
||||||
z-index: 2;
|
|
||||||
|
|
||||||
&.show {
|
|
||||||
background: rgba(0, 0, 0, 0.5);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
&:not(:last-child):after {
|
|
||||||
content: ' ';
|
|
||||||
position: absolute;
|
|
||||||
width: 2rpx;
|
|
||||||
top: 36rpx;
|
|
||||||
bottom: 36rpx;
|
|
||||||
right: 0;
|
|
||||||
background: $uni-border-color;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -1,35 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div class="dropdown-menu">
|
|
||||||
<slot></slot>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
export default {
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
}
|
|
||||||
},
|
|
||||||
mounted() {
|
|
||||||
this.$on('close', this.closeDropdown)
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
closeDropdown() {
|
|
||||||
this.$children.forEach(item =>{
|
|
||||||
item.close();
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="scss">
|
|
||||||
.dropdown-menu {
|
|
||||||
display: flex;
|
|
||||||
overflow: auto;
|
|
||||||
white-space: nowrap;
|
|
||||||
}
|
|
||||||
dropdown-item {
|
|
||||||
flex: 1;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
343
components/popups/popups.vue
Normal file
343
components/popups/popups.vue
Normal file
@@ -0,0 +1,343 @@
|
|||||||
|
<template>
|
||||||
|
<view class="shadow" :class="!show?'':'shadow-show'" :style="{backgroundColor:show?maskBg:'rgba(0,0,0,0)'}" @tap="tapMask">
|
||||||
|
<view class="popups" :class="[theme]" :style="{top: popupsTop ,left: popupsLeft,flexDirection:direction}">
|
||||||
|
<text :class="dynPlace" :style="{width:'0px',height:'0px'}" v-if="triangle"></text>
|
||||||
|
<view v-for="(item,index) in popData" :key="index" @tap.stop="tapItem(item)" class="itemChild view" :class="[direction=='row'?'solid-right':'solid-bottom',item.disabled?'disabledColor':'']">
|
||||||
|
<u-icon size="35" :name="item.icon" v-if="item.icon"></u-icon><span class="title">{{item.title}}</span>
|
||||||
|
</view>
|
||||||
|
<slot></slot>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
props: {
|
||||||
|
maskBg: {
|
||||||
|
type: String,
|
||||||
|
default: "rgba(0,0,0,0)",
|
||||||
|
},
|
||||||
|
placement: {
|
||||||
|
type: String,
|
||||||
|
default: "default", //default top-start top-end bottom-start bottom-end
|
||||||
|
},
|
||||||
|
direction: {
|
||||||
|
type: String,
|
||||||
|
default: "column", //column row
|
||||||
|
},
|
||||||
|
x: {
|
||||||
|
type: Number,
|
||||||
|
default: 0,
|
||||||
|
},
|
||||||
|
y: {
|
||||||
|
type: Number,
|
||||||
|
default: 0,
|
||||||
|
},
|
||||||
|
value: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
|
popData: {
|
||||||
|
type: Array,
|
||||||
|
default: () => [],
|
||||||
|
},
|
||||||
|
theme: {
|
||||||
|
type: String,
|
||||||
|
default: "light", //light dark
|
||||||
|
},
|
||||||
|
dynamic: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
|
gap: {
|
||||||
|
type: Number,
|
||||||
|
default: 20,
|
||||||
|
},
|
||||||
|
triangle: {
|
||||||
|
type: Boolean,
|
||||||
|
default: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
popupsTop: "0rpx",
|
||||||
|
popupsLeft: "0rpx",
|
||||||
|
show: false,
|
||||||
|
dynPlace: "",
|
||||||
|
};
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.popupsPosition();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
tapMask() {
|
||||||
|
this.$emit("input", !this.value);
|
||||||
|
},
|
||||||
|
tapItem(item) {
|
||||||
|
if (item.disabled) return;
|
||||||
|
this.$emit("tapPopup", item);
|
||||||
|
this.$emit("input", !this.value);
|
||||||
|
},
|
||||||
|
getStatusBar() {
|
||||||
|
let promise = new Promise((resolve, reject) => {
|
||||||
|
uni.getSystemInfo({
|
||||||
|
success: function (e) {
|
||||||
|
let customBar;
|
||||||
|
// #ifdef H5
|
||||||
|
|
||||||
|
customBar = e.statusBarHeight + e.windowTop;
|
||||||
|
|
||||||
|
// #endif
|
||||||
|
resolve(customBar);
|
||||||
|
},
|
||||||
|
});
|
||||||
|
});
|
||||||
|
return promise;
|
||||||
|
},
|
||||||
|
async popupsPosition() {
|
||||||
|
let statusBar = await this.getStatusBar();
|
||||||
|
let promise = new Promise((resolve, reject) => {
|
||||||
|
let popupsDom = uni.createSelectorQuery().in(this).select(".popups");
|
||||||
|
popupsDom
|
||||||
|
.fields(
|
||||||
|
{
|
||||||
|
size: true,
|
||||||
|
},
|
||||||
|
(data) => {
|
||||||
|
let width = data.width;
|
||||||
|
let height = data.height;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
let y = this.dynamic
|
||||||
|
? this.dynamicGetY(this.y, this.gap)
|
||||||
|
: this.transformRpx(this.y);
|
||||||
|
|
||||||
|
let x = this.dynamic
|
||||||
|
? this.dynamicGetX(this.x, this.gap)
|
||||||
|
: this.transformRpx(this.x);
|
||||||
|
|
||||||
|
// #ifdef H5
|
||||||
|
y = this.dynamic
|
||||||
|
? this.y + statusBar
|
||||||
|
: this.transformRpx(this.y + statusBar);
|
||||||
|
// #endif
|
||||||
|
|
||||||
|
this.dynPlace =
|
||||||
|
this.placement == "default"
|
||||||
|
? this.getPlacement(x, y)
|
||||||
|
: this.placement;
|
||||||
|
|
||||||
|
switch (this.dynPlace) {
|
||||||
|
case "top-start":
|
||||||
|
this.popupsTop = `${y + 9}rpx`;
|
||||||
|
this.popupsLeft = `${x - 15}rpx`;
|
||||||
|
break;
|
||||||
|
case "top-end":
|
||||||
|
this.popupsTop = `${y + 9}rpx`;
|
||||||
|
this.popupsLeft = `${x + 15 - width}rpx`;
|
||||||
|
break;
|
||||||
|
case "bottom-start":
|
||||||
|
this.popupsTop = `${y - 18 - height}rpx`;
|
||||||
|
this.popupsLeft = `${x - 15}rpx`;
|
||||||
|
break;
|
||||||
|
case "bottom-end":
|
||||||
|
this.popupsTop = `${y - 9 - height}rpx`;
|
||||||
|
this.popupsLeft = `${x + 15 - width}rpx`;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
resolve();
|
||||||
|
}
|
||||||
|
)
|
||||||
|
.exec();
|
||||||
|
});
|
||||||
|
return promise;
|
||||||
|
},
|
||||||
|
getPlacement(x, y) {
|
||||||
|
let width = uni.getSystemInfoSync().windowWidth;
|
||||||
|
let height = uni.getSystemInfoSync().windowHeight;
|
||||||
|
if (x > width / 2 && y > height / 2) {
|
||||||
|
return "bottom-end";
|
||||||
|
} else if (x < width / 2 && y < height / 2) {
|
||||||
|
return "top-start";
|
||||||
|
} else if (x > width / 2 && y < height / 2) {
|
||||||
|
return "top-end";
|
||||||
|
} else if (x < width / 2 && y > height / 2) {
|
||||||
|
return "bottom-start";
|
||||||
|
} else if (x > width / 2) {
|
||||||
|
return "top-end";
|
||||||
|
} else {
|
||||||
|
return "top-start";
|
||||||
|
}
|
||||||
|
},
|
||||||
|
dynamicGetY(y, gap) {
|
||||||
|
let height = uni.getSystemInfoSync().windowHeight;
|
||||||
|
y = y < gap ? gap : y;
|
||||||
|
y = height - y < gap ? height - gap : y;
|
||||||
|
|
||||||
|
return y;
|
||||||
|
},
|
||||||
|
dynamicGetX(x, gap) {
|
||||||
|
let width = uni.getSystemInfoSync().windowWidth;
|
||||||
|
x = x < gap ? gap : x;
|
||||||
|
x = width - x < gap ? width - gap : x;
|
||||||
|
return x;
|
||||||
|
},
|
||||||
|
transformRpx(params) {
|
||||||
|
return (params * uni.getSystemInfoSync().screenWidth) / 375;
|
||||||
|
},
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
value: {
|
||||||
|
immediate: true,
|
||||||
|
handler: async function (newVal, oldVal) {
|
||||||
|
if (newVal) await this.popupsPosition();
|
||||||
|
this.show = newVal;
|
||||||
|
},
|
||||||
|
},
|
||||||
|
placement: {
|
||||||
|
immediate: true,
|
||||||
|
handler(newVal, oldVal) {
|
||||||
|
this.dynPlace = newVal;
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.title {
|
||||||
|
margin-left: 20rpx;
|
||||||
|
}
|
||||||
|
.shadow {
|
||||||
|
position: fixed;
|
||||||
|
top: 0;
|
||||||
|
right: 0;
|
||||||
|
bottom: 0;
|
||||||
|
left: 0;
|
||||||
|
height: 100%;
|
||||||
|
z-index: 9999;
|
||||||
|
transition: background 0.3s ease-in-out;
|
||||||
|
visibility: hidden;
|
||||||
|
|
||||||
|
&.shadow-show {
|
||||||
|
visibility: visible;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.popups {
|
||||||
|
position: absolute;
|
||||||
|
padding: 20rpx;
|
||||||
|
border-radius: 5px;
|
||||||
|
display: flex;
|
||||||
|
.view {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
padding: 15rpx 10rpx;
|
||||||
|
font-size: 25rpx;
|
||||||
|
}
|
||||||
|
.image {
|
||||||
|
display: inline-block;
|
||||||
|
vertical-align: middle;
|
||||||
|
width: 40rpx;
|
||||||
|
height: 40rpx;
|
||||||
|
margin-right: 20rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.dark {
|
||||||
|
background-color: #4c4c4c;
|
||||||
|
color: #fff;
|
||||||
|
.top-start:after {
|
||||||
|
content: "";
|
||||||
|
position: absolute;
|
||||||
|
top: -18rpx;
|
||||||
|
left: 10rpx;
|
||||||
|
border-width: 0 20rpx 20rpx;
|
||||||
|
border-style: solid;
|
||||||
|
border-color: transparent transparent #4c4c4c;
|
||||||
|
}
|
||||||
|
.top-end:after {
|
||||||
|
content: "";
|
||||||
|
position: absolute;
|
||||||
|
top: -18rpx;
|
||||||
|
right: 10rpx;
|
||||||
|
border-width: 0 20rpx 20rpx;
|
||||||
|
border-style: solid;
|
||||||
|
border-color: transparent transparent #4c4c4c;
|
||||||
|
}
|
||||||
|
.bottom-start:after {
|
||||||
|
content: "";
|
||||||
|
position: absolute;
|
||||||
|
bottom: -18rpx;
|
||||||
|
left: 10rpx;
|
||||||
|
border-width: 20rpx 20rpx 0;
|
||||||
|
border-style: solid;
|
||||||
|
border-color: #4c4c4c transparent transparent;
|
||||||
|
}
|
||||||
|
.bottom-end:after {
|
||||||
|
content: "";
|
||||||
|
position: absolute;
|
||||||
|
bottom: -18rpx;
|
||||||
|
right: 10rpx;
|
||||||
|
border-width: 20rpx 20rpx 0;
|
||||||
|
border-style: solid;
|
||||||
|
border-color: #4c4c4c transparent transparent;
|
||||||
|
}
|
||||||
|
.disabledColor {
|
||||||
|
color: #c5c8ce;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.light {
|
||||||
|
color: #515a6e;
|
||||||
|
box-shadow: 0upx 0upx 30upx rgba(0, 0, 0, 0.2);
|
||||||
|
background: #fff;
|
||||||
|
.top-start:after {
|
||||||
|
content: "";
|
||||||
|
position: absolute;
|
||||||
|
top: -18rpx;
|
||||||
|
left: 10rpx;
|
||||||
|
border-width: 0 20rpx 20rpx;
|
||||||
|
border-style: solid;
|
||||||
|
border-color: transparent transparent #fff;
|
||||||
|
}
|
||||||
|
.top-end:after {
|
||||||
|
content: "";
|
||||||
|
position: absolute;
|
||||||
|
top: -18rpx;
|
||||||
|
right: 10rpx;
|
||||||
|
border-width: 0 20rpx 20rpx;
|
||||||
|
border-style: solid;
|
||||||
|
border-color: transparent transparent #fff;
|
||||||
|
}
|
||||||
|
.bottom-start:after {
|
||||||
|
content: "";
|
||||||
|
position: absolute;
|
||||||
|
bottom: -18rpx;
|
||||||
|
left: 10rpx;
|
||||||
|
border-width: 20rpx 20rpx 0;
|
||||||
|
border-style: solid;
|
||||||
|
border-color: #fff transparent transparent;
|
||||||
|
}
|
||||||
|
.bottom-end:after {
|
||||||
|
content: "";
|
||||||
|
position: absolute;
|
||||||
|
bottom: -18rpx;
|
||||||
|
right: 10rpx;
|
||||||
|
border-width: 20rpx 20rpx 0;
|
||||||
|
border-style: solid;
|
||||||
|
border-color: #fff transparent transparent;
|
||||||
|
}
|
||||||
|
.disabledColor {
|
||||||
|
color: #c5c8ce;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.solid-bottom {
|
||||||
|
border-bottom: 1px solid #f3f5f7;
|
||||||
|
}
|
||||||
|
.solid-right {
|
||||||
|
border-right: 1px solid #ccc;
|
||||||
|
}
|
||||||
|
.popups .itemChild:last-child {
|
||||||
|
border: none;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -1,151 +0,0 @@
|
|||||||
<template>
|
|
||||||
<text v-if="text" :class="inverted ? 'uni-badge--' + type + ' uni-badge--' + size + ' uni-badge--' + type + '-inverted' : 'uni-badge--' + type + ' uni-badge--' + size"
|
|
||||||
:style="badgeStyle" class="uni-badge" @click="onClick()">{{ text }}</text>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
/**
|
|
||||||
* Badge 数字角标
|
|
||||||
* @description 数字角标一般和其它控件(列表、9宫格等)配合使用,用于进行数量提示,默认为实心灰色背景
|
|
||||||
* @tutorial https://ext.dcloud.net.cn/plugin?id=21
|
|
||||||
* @property {String} text 角标内容
|
|
||||||
* @property {String} type = [default|primary|success|warning|error] 颜色类型
|
|
||||||
* @value default 灰色
|
|
||||||
* @value primary 蓝色
|
|
||||||
* @value success 绿色
|
|
||||||
* @value warning 黄色
|
|
||||||
* @value error 红色
|
|
||||||
* @property {String} size = [normal|small] Badge 大小
|
|
||||||
* @value normal 一般尺寸
|
|
||||||
* @value small 小尺寸
|
|
||||||
* @property {String} inverted = [true|false] 是否无需背景颜色
|
|
||||||
* @event {Function} click 点击 Badge 触发事件
|
|
||||||
* @example <uni-badge text="1"></uni-badge>
|
|
||||||
*/
|
|
||||||
export default {
|
|
||||||
name: 'UniBadge',
|
|
||||||
props: {
|
|
||||||
type: {
|
|
||||||
type: String,
|
|
||||||
default: 'default'
|
|
||||||
},
|
|
||||||
inverted: {
|
|
||||||
type: Boolean,
|
|
||||||
default: false
|
|
||||||
},
|
|
||||||
text: {
|
|
||||||
type: [String, Number],
|
|
||||||
default: ''
|
|
||||||
},
|
|
||||||
size: {
|
|
||||||
type: String,
|
|
||||||
default: 'normal'
|
|
||||||
}
|
|
||||||
},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
badgeStyle: ''
|
|
||||||
};
|
|
||||||
},
|
|
||||||
watch: {
|
|
||||||
text() {
|
|
||||||
this.setStyle()
|
|
||||||
}
|
|
||||||
},
|
|
||||||
mounted() {
|
|
||||||
this.setStyle()
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
setStyle() {
|
|
||||||
this.badgeStyle = `width: ${String(this.text).length * 8 + 12}px`
|
|
||||||
},
|
|
||||||
onClick() {
|
|
||||||
this.$emit('click');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
$bage-size: 12px;
|
|
||||||
$bage-small: scale(0.8);
|
|
||||||
$bage-height: 20px;
|
|
||||||
|
|
||||||
.uni-badge {
|
|
||||||
/* #ifndef APP-PLUS */
|
|
||||||
display: flex;
|
|
||||||
/* #endif */
|
|
||||||
justify-content: center;
|
|
||||||
flex-direction: row;
|
|
||||||
height: $bage-height;
|
|
||||||
line-height: $bage-height;
|
|
||||||
color: $uni-text-color;
|
|
||||||
border-radius: 100px;
|
|
||||||
background-color: $uni-bg-color-hover;
|
|
||||||
background-color: transparent;
|
|
||||||
text-align: center;
|
|
||||||
font-family: 'Helvetica Neue', Helvetica, sans-serif;
|
|
||||||
font-size: $bage-size;
|
|
||||||
padding: 0px 6px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-badge--inverted {
|
|
||||||
padding: 0 5px 0 0;
|
|
||||||
color: $uni-bg-color-hover;
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-badge--default {
|
|
||||||
color: $uni-text-color;
|
|
||||||
background-color: $uni-bg-color-hover;
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-badge--default-inverted {
|
|
||||||
color: $uni-text-color-grey;
|
|
||||||
background-color: transparent;
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-badge--primary {
|
|
||||||
color: $uni-text-color-inverse;
|
|
||||||
background-color: $uni-color-primary;
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-badge--primary-inverted {
|
|
||||||
color: $uni-color-primary;
|
|
||||||
background-color: transparent;
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-badge--success {
|
|
||||||
color: $uni-text-color-inverse;
|
|
||||||
background-color: $uni-color-success;
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-badge--success-inverted {
|
|
||||||
color: $uni-color-success;
|
|
||||||
background-color: transparent;
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-badge--warning {
|
|
||||||
color: $uni-text-color-inverse;
|
|
||||||
background-color: $uni-color-warning;
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-badge--warning-inverted {
|
|
||||||
color: $uni-color-warning;
|
|
||||||
background-color: transparent;
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-badge--error {
|
|
||||||
color: $uni-text-color-inverse;
|
|
||||||
background-color: $uni-color-error;
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-badge--error-inverted {
|
|
||||||
color: $uni-color-error;
|
|
||||||
background-color: transparent;
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-badge--small {
|
|
||||||
transform: $bage-small;
|
|
||||||
transform-origin: center center;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -1,170 +0,0 @@
|
|||||||
<template>
|
|
||||||
<view v-if="visibleSync" :class="{ 'uni-drawer--visible': showDrawer }" class="uni-drawer" @touchmove.stop.prevent="clear">
|
|
||||||
<view class="uni-drawer__mask" :class="{ 'uni-drawer__mask--visible': showDrawer && mask }" @tap="close('mask')" />
|
|
||||||
<view class="uni-drawer__content" :class="{'uni-drawer--right': rightMode,'uni-drawer--left': !rightMode, 'uni-drawer__content--visible': showDrawer}" :style="{width:drawerWidth+'px'}">
|
|
||||||
<slot />
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
/**
|
|
||||||
* Drawer 抽屉
|
|
||||||
* @description 抽屉侧滑菜单
|
|
||||||
* @tutorial https://ext.dcloud.net.cn/plugin?id=26
|
|
||||||
* @property {Boolean} mask = [true | false] 是否显示遮罩
|
|
||||||
* @property {Boolean} maskClick = [true | false] 点击遮罩是否关闭
|
|
||||||
* @property {Boolean} mode = [left | right] Drawer 滑出位置
|
|
||||||
* @value left 从左侧滑出
|
|
||||||
* @value right 从右侧侧滑出
|
|
||||||
* @property {Number} width 抽屉的宽度 ,仅 vue 页面生效
|
|
||||||
* @event {Function} close 组件关闭时触发事件
|
|
||||||
*/
|
|
||||||
export default {
|
|
||||||
name: 'UniDrawer',
|
|
||||||
props: {
|
|
||||||
/**
|
|
||||||
* 显示模式(左、右),只在初始化生效
|
|
||||||
*/
|
|
||||||
mode: {
|
|
||||||
type: String,
|
|
||||||
default: ''
|
|
||||||
},
|
|
||||||
/**
|
|
||||||
* 蒙层显示状态
|
|
||||||
*/
|
|
||||||
mask: {
|
|
||||||
type: Boolean,
|
|
||||||
default: true
|
|
||||||
},
|
|
||||||
/**
|
|
||||||
* 遮罩是否可点击关闭
|
|
||||||
*/
|
|
||||||
maskClick:{
|
|
||||||
type: Boolean,
|
|
||||||
default: true
|
|
||||||
},
|
|
||||||
/**
|
|
||||||
* 抽屉宽度
|
|
||||||
*/
|
|
||||||
width: {
|
|
||||||
type: Number,
|
|
||||||
default: 220
|
|
||||||
}
|
|
||||||
},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
visibleSync: false,
|
|
||||||
showDrawer: false,
|
|
||||||
rightMode: false,
|
|
||||||
watchTimer: null,
|
|
||||||
drawerWidth: 220
|
|
||||||
}
|
|
||||||
},
|
|
||||||
created() {
|
|
||||||
// #ifndef APP-NVUE
|
|
||||||
this.drawerWidth = this.width
|
|
||||||
// #endif
|
|
||||||
this.rightMode = this.mode === 'right'
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
clear(){},
|
|
||||||
close(type) {
|
|
||||||
// fixed by mehaotian 抽屉尚未完全关闭或遮罩禁止点击时不触发以下逻辑
|
|
||||||
if((type === 'mask' && !this.maskClick) || !this.visibleSync) return
|
|
||||||
this._change('showDrawer', 'visibleSync', false)
|
|
||||||
},
|
|
||||||
open() {
|
|
||||||
// fixed by mehaotian 处理重复点击打开的事件
|
|
||||||
if(this.visibleSync) return
|
|
||||||
this._change('visibleSync', 'showDrawer', true)
|
|
||||||
},
|
|
||||||
_change(param1, param2, status) {
|
|
||||||
this[param1] = status
|
|
||||||
if (this.watchTimer) {
|
|
||||||
clearTimeout(this.watchTimer)
|
|
||||||
}
|
|
||||||
this.watchTimer = setTimeout(() => {
|
|
||||||
this[param2] = status
|
|
||||||
this.$emit('change',status)
|
|
||||||
}, status ? 50 : 300)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
// 抽屉宽度
|
|
||||||
$drawer-width: 220px;
|
|
||||||
|
|
||||||
.uni-drawer {
|
|
||||||
/* #ifndef APP-NVUE */
|
|
||||||
display: block;
|
|
||||||
/* #endif */
|
|
||||||
position: fixed;
|
|
||||||
top: 0;
|
|
||||||
left: 0;
|
|
||||||
right: 0;
|
|
||||||
bottom: 0;
|
|
||||||
overflow: hidden;
|
|
||||||
z-index: 999;
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-drawer__content {
|
|
||||||
/* #ifndef APP-NVUE */
|
|
||||||
display: block;
|
|
||||||
/* #endif */
|
|
||||||
position: absolute;
|
|
||||||
top: 0;
|
|
||||||
width: $drawer-width;
|
|
||||||
bottom: 0;
|
|
||||||
background-color: $uni-bg-color;
|
|
||||||
transition: transform 0.3s ease;
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-drawer--left {
|
|
||||||
left: 0;
|
|
||||||
/* #ifdef APP-NVUE */
|
|
||||||
transform: translateX(-$drawer-width);
|
|
||||||
/* #endif */
|
|
||||||
/* #ifndef APP-NVUE */
|
|
||||||
transform: translateX(-100%);
|
|
||||||
/* #endif */
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-drawer--right {
|
|
||||||
right: 0;
|
|
||||||
/* #ifdef APP-NVUE */
|
|
||||||
transform: translateX($drawer-width);
|
|
||||||
/* #endif */
|
|
||||||
/* #ifndef APP-NVUE */
|
|
||||||
transform: translateX(100%);
|
|
||||||
/* #endif */
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-drawer__content--visible {
|
|
||||||
transform: translateX(0px);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
.uni-drawer__mask {
|
|
||||||
/* #ifndef APP-NVUE */
|
|
||||||
display: block;
|
|
||||||
/* #endif */
|
|
||||||
opacity: 0;
|
|
||||||
position: absolute;
|
|
||||||
top: 0;
|
|
||||||
left: 0;
|
|
||||||
bottom: 0;
|
|
||||||
right: 0;
|
|
||||||
background-color: $uni-bg-color-mask;
|
|
||||||
transition: opacity 0.3s;
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-drawer__mask--visible {
|
|
||||||
/* #ifndef APP-NVUE */
|
|
||||||
display: block;
|
|
||||||
/* #endif */
|
|
||||||
opacity: 1;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -1,132 +0,0 @@
|
|||||||
export default {
|
|
||||||
"pulldown": "\ue588",
|
|
||||||
"refreshempty": "\ue461",
|
|
||||||
"back": "\ue471",
|
|
||||||
"forward": "\ue470",
|
|
||||||
"more": "\ue507",
|
|
||||||
"more-filled": "\ue537",
|
|
||||||
"scan": "\ue612",
|
|
||||||
"qq": "\ue264",
|
|
||||||
"weibo": "\ue260",
|
|
||||||
"weixin": "\ue261",
|
|
||||||
"pengyouquan": "\ue262",
|
|
||||||
"loop": "\ue565",
|
|
||||||
"refresh": "\ue407",
|
|
||||||
"refresh-filled": "\ue437",
|
|
||||||
"arrowthindown": "\ue585",
|
|
||||||
"arrowthinleft": "\ue586",
|
|
||||||
"arrowthinright": "\ue587",
|
|
||||||
"arrowthinup": "\ue584",
|
|
||||||
"undo-filled": "\ue7d6",
|
|
||||||
"undo": "\ue406",
|
|
||||||
"redo": "\ue405",
|
|
||||||
"redo-filled": "\ue7d9",
|
|
||||||
"bars": "\ue563",
|
|
||||||
"chatboxes": "\ue203",
|
|
||||||
"camera": "\ue301",
|
|
||||||
"chatboxes-filled": "\ue233",
|
|
||||||
"camera-filled": "\ue7ef",
|
|
||||||
"cart-filled": "\ue7f4",
|
|
||||||
"cart": "\ue7f5",
|
|
||||||
"checkbox-filled": "\ue442",
|
|
||||||
"checkbox": "\ue7fa",
|
|
||||||
"arrowleft": "\ue582",
|
|
||||||
"arrowdown": "\ue581",
|
|
||||||
"arrowright": "\ue583",
|
|
||||||
"smallcircle-filled": "\ue801",
|
|
||||||
"arrowup": "\ue580",
|
|
||||||
"circle": "\ue411",
|
|
||||||
"eye-filled": "\ue568",
|
|
||||||
"eye-slash-filled": "\ue822",
|
|
||||||
"eye-slash": "\ue823",
|
|
||||||
"eye": "\ue824",
|
|
||||||
"flag-filled": "\ue825",
|
|
||||||
"flag": "\ue508",
|
|
||||||
"gear-filled": "\ue532",
|
|
||||||
"reload": "\ue462",
|
|
||||||
"gear": "\ue502",
|
|
||||||
"hand-thumbsdown-filled": "\ue83b",
|
|
||||||
"hand-thumbsdown": "\ue83c",
|
|
||||||
"hand-thumbsup-filled": "\ue83d",
|
|
||||||
"heart-filled": "\ue83e",
|
|
||||||
"hand-thumbsup": "\ue83f",
|
|
||||||
"heart": "\ue840",
|
|
||||||
"home": "\ue500",
|
|
||||||
"info": "\ue504",
|
|
||||||
"home-filled": "\ue530",
|
|
||||||
"info-filled": "\ue534",
|
|
||||||
"circle-filled": "\ue441",
|
|
||||||
"chat-filled": "\ue847",
|
|
||||||
"chat": "\ue263",
|
|
||||||
"mail-open-filled": "\ue84d",
|
|
||||||
"email-filled": "\ue231",
|
|
||||||
"mail-open": "\ue84e",
|
|
||||||
"email": "\ue201",
|
|
||||||
"checkmarkempty": "\ue472",
|
|
||||||
"list": "\ue562",
|
|
||||||
"locked-filled": "\ue856",
|
|
||||||
"locked": "\ue506",
|
|
||||||
"map-filled": "\ue85c",
|
|
||||||
"map-pin": "\ue85e",
|
|
||||||
"map-pin-ellipse": "\ue864",
|
|
||||||
"map": "\ue364",
|
|
||||||
"minus-filled": "\ue440",
|
|
||||||
"mic-filled": "\ue332",
|
|
||||||
"minus": "\ue410",
|
|
||||||
"micoff": "\ue360",
|
|
||||||
"mic": "\ue302",
|
|
||||||
"clear": "\ue434",
|
|
||||||
"smallcircle": "\ue868",
|
|
||||||
"close": "\ue404",
|
|
||||||
"closeempty": "\ue460",
|
|
||||||
"paperclip": "\ue567",
|
|
||||||
"paperplane": "\ue503",
|
|
||||||
"paperplane-filled": "\ue86e",
|
|
||||||
"person-filled": "\ue131",
|
|
||||||
"contact-filled": "\ue130",
|
|
||||||
"person": "\ue101",
|
|
||||||
"contact": "\ue100",
|
|
||||||
"images-filled": "\ue87a",
|
|
||||||
"phone": "\ue200",
|
|
||||||
"images": "\ue87b",
|
|
||||||
"image": "\ue363",
|
|
||||||
"image-filled": "\ue877",
|
|
||||||
"location-filled": "\ue333",
|
|
||||||
"location": "\ue303",
|
|
||||||
"plus-filled": "\ue439",
|
|
||||||
"plus": "\ue409",
|
|
||||||
"plusempty": "\ue468",
|
|
||||||
"help-filled": "\ue535",
|
|
||||||
"help": "\ue505",
|
|
||||||
"navigate-filled": "\ue884",
|
|
||||||
"navigate": "\ue501",
|
|
||||||
"mic-slash-filled": "\ue892",
|
|
||||||
"search": "\ue466",
|
|
||||||
"settings": "\ue560",
|
|
||||||
"sound": "\ue590",
|
|
||||||
"sound-filled": "\ue8a1",
|
|
||||||
"spinner-cycle": "\ue465",
|
|
||||||
"download-filled": "\ue8a4",
|
|
||||||
"personadd-filled": "\ue132",
|
|
||||||
"videocam-filled": "\ue8af",
|
|
||||||
"personadd": "\ue102",
|
|
||||||
"upload": "\ue402",
|
|
||||||
"upload-filled": "\ue8b1",
|
|
||||||
"starhalf": "\ue463",
|
|
||||||
"star-filled": "\ue438",
|
|
||||||
"star": "\ue408",
|
|
||||||
"trash": "\ue401",
|
|
||||||
"phone-filled": "\ue230",
|
|
||||||
"compose": "\ue400",
|
|
||||||
"videocam": "\ue300",
|
|
||||||
"trash-filled": "\ue8dc",
|
|
||||||
"download": "\ue403",
|
|
||||||
"chatbubble-filled": "\ue232",
|
|
||||||
"chatbubble": "\ue202",
|
|
||||||
"cloud-download": "\ue8e4",
|
|
||||||
"cloud-upload-filled": "\ue8e5",
|
|
||||||
"cloud-upload": "\ue8e6",
|
|
||||||
"cloud-download-filled": "\ue8e9",
|
|
||||||
"headphones":"\ue8bf",
|
|
||||||
"store":"\ue609"
|
|
||||||
}
|
|
||||||
File diff suppressed because one or more lines are too long
@@ -1,269 +0,0 @@
|
|||||||
<template>
|
|
||||||
<!-- #ifdef APP-NVUE -->
|
|
||||||
<cell>
|
|
||||||
<!-- #endif -->
|
|
||||||
<view :class="disabled ? 'uni-list-item--disabled' : ''" :hover-class="disabled || showSwitch ? '' : 'uni-list-item--hover'" class="uni-list-item" @click="onClick">
|
|
||||||
<view class="uni-list-item__container" :class="{ 'uni-list-item--first': isFirstChild }">
|
|
||||||
<view v-if="thumb" class="uni-list-item__icon"><image :src="thumb" class="uni-list-item__icon-img" /></view>
|
|
||||||
<view v-else-if="showExtraIcon" class="uni-list-item__icon">
|
|
||||||
<uni-icons :color="extraIcon.color" :size="extraIcon.size" :type="extraIcon.type" class="uni-icon-wrapper" />
|
|
||||||
</view>
|
|
||||||
<view class="uni-list-item__content">
|
|
||||||
<slot name="left"></slot>
|
|
||||||
<text class="uni-list-item__content-title">{{ title }}</text>
|
|
||||||
<text v-if="note" class="uni-list-item__content-note">{{ note }}</text>
|
|
||||||
</view>
|
|
||||||
<view class="uni-list-item__extra">
|
|
||||||
<text v-if="rightText" class="uni-list-item__extra-text">{{ rightText }}</text>
|
|
||||||
<uni-badge v-if="showBadge" :type="badgeType" :text="badgeText" />
|
|
||||||
<switch v-if="showSwitch" :disabled="disabled" :checked="switchChecked" @change="onSwitchChange" />
|
|
||||||
<slot name="right"></slot>
|
|
||||||
<uni-icons v-if="showArrow" :size="20" class="uni-icon-wrapper" color="#bbb" type="arrowright" />
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<!-- #ifdef APP-NVUE -->
|
|
||||||
</cell>
|
|
||||||
<!-- #endif -->
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import uniIcons from '../uni-icons/uni-icons.vue';
|
|
||||||
import uniBadge from '../uni-badge/uni-badge.vue';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* ListItem 列表子组件
|
|
||||||
* @description 列表子组件
|
|
||||||
* @tutorial https://ext.dcloud.net.cn/plugin?id=24
|
|
||||||
* @property {String} title 标题
|
|
||||||
* @property {String} note 描述
|
|
||||||
* @property {String} thumb 左侧缩略图,若thumb有值,则不会显示扩展图标
|
|
||||||
* @property {String} badgeText 数字角标内容
|
|
||||||
* @property {String} badgeType 数字角标类型,参考[uni-icons](https://ext.dcloud.net.cn/plugin?id=21)
|
|
||||||
* @property {String} rightText 右侧文字内容
|
|
||||||
* @property {Boolean} disabled = [true|false]是否禁用
|
|
||||||
* @property {Boolean} showArrow = [true|false] 是否显示箭头图标
|
|
||||||
* @property {Boolean} showBadge = [true|false] 是否显示数字角标
|
|
||||||
* @property {Boolean} showSwitch = [true|false] 是否显示Switch
|
|
||||||
* @property {Boolean} switchChecked = [true|false] Switch是否被选中
|
|
||||||
* @property {Boolean} showExtraIcon = [true|false] 左侧是否显示扩展图标
|
|
||||||
* @property {Boolean} scrollY = [true|false] 允许纵向滚动,需要显式的设置其宽高
|
|
||||||
* @property {Object} extraIcon 扩展图标参数,格式为 {color: '#4cd964',size: '22',type: 'spinner'}
|
|
||||||
* @event {Function} click 点击 uniListItem 触发事件
|
|
||||||
* @event {Function} switchChange 点击切换 Switch 时触发
|
|
||||||
*/
|
|
||||||
export default {
|
|
||||||
name: 'UniListItem',
|
|
||||||
components: {
|
|
||||||
uniIcons,
|
|
||||||
uniBadge
|
|
||||||
},
|
|
||||||
props: {
|
|
||||||
title: {
|
|
||||||
type: String,
|
|
||||||
default: ''
|
|
||||||
}, // 列表标题
|
|
||||||
note: {
|
|
||||||
type: String,
|
|
||||||
default: ''
|
|
||||||
}, // 列表描述
|
|
||||||
disabled: {
|
|
||||||
// 是否禁用
|
|
||||||
type: [Boolean, String],
|
|
||||||
default: false
|
|
||||||
},
|
|
||||||
showArrow: {
|
|
||||||
// 是否显示箭头
|
|
||||||
type: [Boolean, String],
|
|
||||||
default: true
|
|
||||||
},
|
|
||||||
showBadge: {
|
|
||||||
// 是否显示数字角标
|
|
||||||
type: [Boolean, String],
|
|
||||||
default: false
|
|
||||||
},
|
|
||||||
showSwitch: {
|
|
||||||
// 是否显示Switch
|
|
||||||
type: [Boolean, String],
|
|
||||||
default: false
|
|
||||||
},
|
|
||||||
switchChecked: {
|
|
||||||
// Switch是否被选中
|
|
||||||
type: [Boolean, String],
|
|
||||||
default: false
|
|
||||||
},
|
|
||||||
badgeText: {
|
|
||||||
// badge内容
|
|
||||||
type: String,
|
|
||||||
default: ''
|
|
||||||
},
|
|
||||||
badgeType: {
|
|
||||||
// badge类型
|
|
||||||
type: String,
|
|
||||||
default: 'success'
|
|
||||||
},
|
|
||||||
rightText: {
|
|
||||||
// 右侧文字内容
|
|
||||||
type: String,
|
|
||||||
default: ''
|
|
||||||
},
|
|
||||||
thumb: {
|
|
||||||
// 缩略图
|
|
||||||
type: String,
|
|
||||||
default: ''
|
|
||||||
},
|
|
||||||
showExtraIcon: {
|
|
||||||
// 是否显示扩展图标
|
|
||||||
type: [Boolean, String],
|
|
||||||
default: false
|
|
||||||
},
|
|
||||||
extraIcon: {
|
|
||||||
type: Object,
|
|
||||||
default() {
|
|
||||||
return {
|
|
||||||
type: 'contact',
|
|
||||||
color: '#000000',
|
|
||||||
size: 20
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
inject: ['list'],
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
isFirstChild: false
|
|
||||||
};
|
|
||||||
},
|
|
||||||
mounted() {
|
|
||||||
if (!this.list.firstChildAppend) {
|
|
||||||
this.list.firstChildAppend = true;
|
|
||||||
this.isFirstChild = true;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
onClick() {
|
|
||||||
this.$emit('click');
|
|
||||||
},
|
|
||||||
onSwitchChange(e) {
|
|
||||||
this.$emit('switchChange', e.detail);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
$list-item-pd: $uni-spacing-col-lg $uni-spacing-row-lg;
|
|
||||||
|
|
||||||
.uni-list-item {
|
|
||||||
font-size: $uni-font-size-lg;
|
|
||||||
position: relative;
|
|
||||||
flex-direction: column;
|
|
||||||
justify-content: space-between;
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-list-item--disabled {
|
|
||||||
opacity: 0.3;
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-list-item--hover {
|
|
||||||
background-color: $uni-bg-color-hover;
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-list-item__container {
|
|
||||||
line-height: 48rpx;
|
|
||||||
position: relative;
|
|
||||||
/* #ifndef APP-NVUE */
|
|
||||||
display: flex;
|
|
||||||
/* #endif */
|
|
||||||
flex-direction: row;
|
|
||||||
padding: $list-item-pd;
|
|
||||||
padding-left: 0;
|
|
||||||
flex: 1;
|
|
||||||
position: relative;
|
|
||||||
justify-content: space-between;
|
|
||||||
align-items: center;
|
|
||||||
/* #ifdef APP-PLUS */
|
|
||||||
border-top-color: $uni-border-color;
|
|
||||||
border-top-style: solid;
|
|
||||||
border-top-width: 0.5px;
|
|
||||||
/* #endif */
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-list-item--first {
|
|
||||||
border-top-width: 0px;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* #ifndef APP-NVUE */
|
|
||||||
.uni-list-item__container:after {
|
|
||||||
position: absolute;
|
|
||||||
top: 0;
|
|
||||||
right: 0;
|
|
||||||
left: 0;
|
|
||||||
height: 1px;
|
|
||||||
content: '';
|
|
||||||
-webkit-transform: scaleY(0.5);
|
|
||||||
transform: scaleY(0.5);
|
|
||||||
background-color: $uni-border-color;
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-list-item--first:after {
|
|
||||||
height: 0px;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* #endif */
|
|
||||||
|
|
||||||
.uni-list-item__content {
|
|
||||||
/* #ifndef APP-NVUE */
|
|
||||||
display: flex;
|
|
||||||
/* #endif */
|
|
||||||
flex: 1;
|
|
||||||
overflow: hidden;
|
|
||||||
flex-direction: column;
|
|
||||||
color: #3b4144;
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-list-item__content-title {
|
|
||||||
font-size: $uni-font-size-base;
|
|
||||||
color: #3b4144;
|
|
||||||
overflow: hidden;
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-list-item__content-note {
|
|
||||||
margin-top: 6rpx;
|
|
||||||
color: $uni-text-color-grey;
|
|
||||||
font-size: $uni-font-size-sm;
|
|
||||||
overflow: hidden;
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-list-item__extra {
|
|
||||||
// width: 25%;
|
|
||||||
/* #ifndef APP-NVUE */
|
|
||||||
display: flex;
|
|
||||||
/* #endif */
|
|
||||||
flex-direction: row;
|
|
||||||
justify-content: flex-end;
|
|
||||||
align-items: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-list-item__icon {
|
|
||||||
display: flex;
|
|
||||||
margin-right: 18rpx;
|
|
||||||
flex-direction: row;
|
|
||||||
justify-content: center;
|
|
||||||
align-items: center;
|
|
||||||
|
|
||||||
margin-left: 20rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-list-item__icon-img {
|
|
||||||
// height: $uni-img-size-base;
|
|
||||||
// width: $uni-img-size-base;
|
|
||||||
height: 38rpx;
|
|
||||||
width: 38rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-list-item__extra-text {
|
|
||||||
color: $uni-text-color-grey;
|
|
||||||
font-size: $uni-font-size-sm;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -1,75 +0,0 @@
|
|||||||
<template>
|
|
||||||
<!-- #ifndef APP-NVUE -->
|
|
||||||
<view class="uni-list">
|
|
||||||
<slot />
|
|
||||||
</view>
|
|
||||||
<!-- #endif -->
|
|
||||||
<!-- #ifdef APP-NVUE -->
|
|
||||||
<list class="uni-list" :enableBackToTop="enableBackToTop" loadmoreoffset="15" :scroll-y="scrollY" @loadmore="loadMore">
|
|
||||||
<slot />
|
|
||||||
</list>
|
|
||||||
<!-- #endif -->
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
/**
|
|
||||||
* List 列表
|
|
||||||
* @description 列表组件
|
|
||||||
* @tutorial https://ext.dcloud.net.cn/plugin?id=24
|
|
||||||
*/
|
|
||||||
export default {
|
|
||||||
name: 'UniList',
|
|
||||||
'mp-weixin': {
|
|
||||||
options: {
|
|
||||||
multipleSlots: false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
props: {
|
|
||||||
enableBackToTop: {
|
|
||||||
type: [Boolean, String],
|
|
||||||
default: false
|
|
||||||
},
|
|
||||||
scrollY: {
|
|
||||||
type: [Boolean, String],
|
|
||||||
default: false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
provide() {
|
|
||||||
return {
|
|
||||||
list: this
|
|
||||||
}
|
|
||||||
},
|
|
||||||
created() {
|
|
||||||
this.firstChildAppend = false
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
loadMore(e) {
|
|
||||||
this.$emit("scrolltolower");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
.uni-list {
|
|
||||||
/* #ifndef APP-NVUE */
|
|
||||||
display: flex;
|
|
||||||
/* #endif */
|
|
||||||
background-color: $uni-bg-color;
|
|
||||||
position: relative;
|
|
||||||
flex-direction: column;
|
|
||||||
// border-bottom-color: $uni-border-color;
|
|
||||||
// border-bottom-style: solid;
|
|
||||||
// border-bottom-width: 1px;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* #ifndef APP-NVUE */
|
|
||||||
.uni-list:before {
|
|
||||||
height: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-list:after {
|
|
||||||
height: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* #endif */
|
|
||||||
</style>
|
|
||||||
@@ -1,65 +0,0 @@
|
|||||||
<template>
|
|
||||||
<!-- #ifdef APP-NVUE -->
|
|
||||||
<refresh :display="display" @refresh="onrefresh" @pullingdown="onpullingdown">
|
|
||||||
<slot />
|
|
||||||
</refresh>
|
|
||||||
<!-- #endif -->
|
|
||||||
<!-- #ifndef APP-NVUE -->
|
|
||||||
<view ref="uni-refresh" class="uni-refresh" v-show="isShow">
|
|
||||||
<slot />
|
|
||||||
</view>
|
|
||||||
<!-- #endif -->
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
export default {
|
|
||||||
name: 'UniRefresh',
|
|
||||||
props: {
|
|
||||||
display: {
|
|
||||||
type: [String],
|
|
||||||
default: "hide"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
pulling: false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
isShow() {
|
|
||||||
if (this.display === "show" || this.pulling === true) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
created() {},
|
|
||||||
methods: {
|
|
||||||
onchange(value) {
|
|
||||||
this.pulling = value;
|
|
||||||
},
|
|
||||||
onrefresh(e) {
|
|
||||||
this.$emit("refresh", e);
|
|
||||||
},
|
|
||||||
onpullingdown(e) {
|
|
||||||
// #ifdef APP-NVUE
|
|
||||||
this.$emit("pullingdown", e);
|
|
||||||
// #endif
|
|
||||||
// #ifndef APP-NVUE
|
|
||||||
var detail = {
|
|
||||||
viewHeight: 90,
|
|
||||||
pullingDistance: e.height
|
|
||||||
}
|
|
||||||
this.$emit("pullingdown", detail);
|
|
||||||
// #endif
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style>
|
|
||||||
.uni-refresh {
|
|
||||||
height: 0;
|
|
||||||
overflow: hidden;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -1,87 +0,0 @@
|
|||||||
var pullDown = {
|
|
||||||
threshold: 95,
|
|
||||||
maxHeight: 200,
|
|
||||||
callRefresh: 'onrefresh',
|
|
||||||
callPullingDown: 'onpullingdown',
|
|
||||||
refreshSelector: '.uni-refresh'
|
|
||||||
};
|
|
||||||
|
|
||||||
function ready(newValue, oldValue, ownerInstance, instance) {
|
|
||||||
var state = instance.getState()
|
|
||||||
state.canPullDown = newValue;
|
|
||||||
// console.log(newValue);
|
|
||||||
}
|
|
||||||
|
|
||||||
function touchStart(e, instance) {
|
|
||||||
var state = instance.getState();
|
|
||||||
state.refreshInstance = instance.selectComponent(pullDown.refreshSelector);
|
|
||||||
state.canPullDown = (state.refreshInstance != null && state.refreshInstance != undefined);
|
|
||||||
if (!state.canPullDown) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// console.log("touchStart");
|
|
||||||
|
|
||||||
state.height = 0;
|
|
||||||
state.touchStartY = e.touches[0].pageY || e.changedTouches[0].pageY;
|
|
||||||
state.refreshInstance.setStyle({
|
|
||||||
'height': 0
|
|
||||||
});
|
|
||||||
state.refreshInstance.callMethod("onchange", true);
|
|
||||||
}
|
|
||||||
|
|
||||||
function touchMove(e, ownerInstance) {
|
|
||||||
var instance = e.instance;
|
|
||||||
var state = instance.getState();
|
|
||||||
if (!state.canPullDown) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
var oldHeight = state.height;
|
|
||||||
var endY = e.touches[0].pageY || e.changedTouches[0].pageY;
|
|
||||||
var height = endY - state.touchStartY;
|
|
||||||
if (height > pullDown.maxHeight) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
var refreshInstance = state.refreshInstance;
|
|
||||||
refreshInstance.setStyle({
|
|
||||||
'height': height + 'px'
|
|
||||||
});
|
|
||||||
|
|
||||||
height = height < pullDown.maxHeight ? height : pullDown.maxHeight;
|
|
||||||
state.height = height;
|
|
||||||
refreshInstance.callMethod(pullDown.callPullingDown, {
|
|
||||||
height: height
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function touchEnd(e, ownerInstance) {
|
|
||||||
var state = e.instance.getState();
|
|
||||||
if (!state.canPullDown) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
state.refreshInstance.callMethod("onchange", false);
|
|
||||||
|
|
||||||
var refreshInstance = state.refreshInstance;
|
|
||||||
if (state.height > pullDown.threshold) {
|
|
||||||
refreshInstance.callMethod(pullDown.callRefresh);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
refreshInstance.setStyle({
|
|
||||||
'height': 0
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function propObserver(newValue, oldValue, instance) {
|
|
||||||
pullDown = newValue;
|
|
||||||
}
|
|
||||||
|
|
||||||
module.exports = {
|
|
||||||
touchmove: touchMove,
|
|
||||||
touchstart: touchStart,
|
|
||||||
touchend: touchEnd,
|
|
||||||
propObserver: propObserver
|
|
||||||
}
|
|
||||||
@@ -1,395 +0,0 @@
|
|||||||
<template>
|
|
||||||
<view v-if="show" class="uni-noticebar" :style="{ backgroundColor: backgroundColor }" @click="onClick">
|
|
||||||
<!-- #ifdef MP-ALIPAY -->
|
|
||||||
<view v-if="showClose === true || showClose === 'true'" class="uni-noticebar-close" @click="close">
|
|
||||||
<uni-icons type="closeempty" :color="color" size="12" />
|
|
||||||
</view>
|
|
||||||
<view v-if="showIcon === true || showIcon === 'true'" class="uni-noticebar-icon">
|
|
||||||
<uni-icons type="sound" :color="color" size="14" />
|
|
||||||
</view>
|
|
||||||
<!-- #endif -->
|
|
||||||
<!-- #ifndef MP-ALIPAY -->
|
|
||||||
<uni-icons v-if="showClose === true || showClose === 'true'" class="uni-noticebar-close" type="closeempty" :color="color"
|
|
||||||
size="12" @click="close" />
|
|
||||||
<uni-icons v-if="showIcon === true || showIcon === 'true'" class="uni-noticebar-icon" type="sound" :color="color"
|
|
||||||
size="14" />
|
|
||||||
<!-- #endif -->
|
|
||||||
<view ref="textBox" class="uni-noticebar__content-wrapper" :class="{'uni-noticebar__content-wrapper--scrollable':scrollable, 'uni-noticebar__content-wrapper--single':!scrollable && (single || moreText)}">
|
|
||||||
<view :id="elIdBox" class="uni-noticebar__content" :class="{'uni-noticebar__content--scrollable':scrollable, 'uni-noticebar__content--single':!scrollable && (single || moreText)}">
|
|
||||||
<text :id="elId" ref="animationEle" class="uni-noticebar__content-text" :class="{'uni-noticebar__content-text--scrollable':scrollable,'uni-noticebar__content-text--single':!scrollable && (single || moreText)}"
|
|
||||||
:style="{color:color, width:wrapWidth+'px', 'animationDuration': animationDuration, '-webkit-animationDuration': animationDuration ,animationPlayState: webviewHide?'paused':animationPlayState,'-webkit-animationPlayState':webviewHide?'paused':animationPlayState, animationDelay: animationDelay, '-webkit-animationDelay':animationDelay}">{{text}}</text>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view v-if="showGetMore === true || showGetMore === 'true'" class="uni-noticebar__more" @click="clickMore">
|
|
||||||
<text v-if="moreText" :style="{ color: moreColor }" class="uni-noticebar__more-text">{{ moreText }}</text>
|
|
||||||
<uni-icons type="arrowright" :color="moreColor" size="14" />
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import uniIcons from '../uni-icons/uni-icons.vue'
|
|
||||||
// #ifdef APP-NVUE
|
|
||||||
const dom = weex.requireModule('dom');
|
|
||||||
const animation = weex.requireModule('animation');
|
|
||||||
// #endif
|
|
||||||
|
|
||||||
/**
|
|
||||||
* NoticeBar 自定义导航栏
|
|
||||||
* @description 通告栏组件
|
|
||||||
* @tutorial https://ext.dcloud.net.cn/plugin?id=30
|
|
||||||
* @property {Number} speed 文字滚动的速度,默认100px/秒
|
|
||||||
* @property {String} text 显示文字
|
|
||||||
* @property {String} backgroundColor 背景颜色
|
|
||||||
* @property {String} color 文字颜色
|
|
||||||
* @property {String} moreColor 查看更多文字的颜色
|
|
||||||
* @property {String} moreText 设置“查看更多”的文本
|
|
||||||
* @property {Boolean} single = [true|false] 是否单行
|
|
||||||
* @property {Boolean} scrollable = [true|false] 是否滚动,为true时,NoticeBar为单行
|
|
||||||
* @property {Boolean} showIcon = [true|false] 是否显示左侧喇叭图标
|
|
||||||
* @property {Boolean} showClose = [true|false] 是否显示左侧关闭按钮
|
|
||||||
* @property {Boolean} showGetMore = [true|false] 是否显示右侧查看更多图标,为true时,NoticeBar为单行
|
|
||||||
* @event {Function} click 点击 NoticeBar 触发事件
|
|
||||||
* @event {Function} close 关闭 NoticeBar 触发事件
|
|
||||||
* @event {Function} getmore 点击”查看更多“时触发事件
|
|
||||||
*/
|
|
||||||
|
|
||||||
export default {
|
|
||||||
name: 'UniNoticeBar',
|
|
||||||
components: {
|
|
||||||
uniIcons
|
|
||||||
},
|
|
||||||
props: {
|
|
||||||
text: {
|
|
||||||
type: String,
|
|
||||||
default: ''
|
|
||||||
},
|
|
||||||
moreText: {
|
|
||||||
type: String,
|
|
||||||
default: ''
|
|
||||||
},
|
|
||||||
backgroundColor: {
|
|
||||||
type: String,
|
|
||||||
default: '#fffbe8'
|
|
||||||
},
|
|
||||||
speed: {
|
|
||||||
// 默认1s滚动100px
|
|
||||||
type: Number,
|
|
||||||
default: 100
|
|
||||||
},
|
|
||||||
color: {
|
|
||||||
type: String,
|
|
||||||
default: '#de8c17'
|
|
||||||
},
|
|
||||||
moreColor: {
|
|
||||||
type: String,
|
|
||||||
default: '#999999'
|
|
||||||
},
|
|
||||||
single: {
|
|
||||||
// 是否单行
|
|
||||||
type: [Boolean, String],
|
|
||||||
default: false
|
|
||||||
},
|
|
||||||
scrollable: {
|
|
||||||
// 是否滚动,添加后控制单行效果取消
|
|
||||||
type: [Boolean, String],
|
|
||||||
default: false
|
|
||||||
},
|
|
||||||
showIcon: {
|
|
||||||
// 是否显示左侧icon
|
|
||||||
type: [Boolean, String],
|
|
||||||
default: false
|
|
||||||
},
|
|
||||||
showGetMore: {
|
|
||||||
// 是否显示右侧查看更多
|
|
||||||
type: [Boolean, String],
|
|
||||||
default: false
|
|
||||||
},
|
|
||||||
showClose: {
|
|
||||||
// 是否显示左侧关闭按钮
|
|
||||||
type: [Boolean, String],
|
|
||||||
default: false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
data() {
|
|
||||||
const elId = `Uni_${Math.ceil(Math.random() * 10e5).toString(36)}`
|
|
||||||
const elIdBox = `Uni_${Math.ceil(Math.random() * 10e5).toString(36)}`
|
|
||||||
return {
|
|
||||||
textWidth: 0,
|
|
||||||
boxWidth: 0,
|
|
||||||
wrapWidth: '',
|
|
||||||
webviewHide: false,
|
|
||||||
// #ifdef APP-NVUE
|
|
||||||
stopAnimation: false,
|
|
||||||
// #endif
|
|
||||||
elId: elId,
|
|
||||||
elIdBox: elIdBox,
|
|
||||||
show: true,
|
|
||||||
animationDuration: 'none',
|
|
||||||
animationPlayState: 'paused',
|
|
||||||
animationDelay: '0s'
|
|
||||||
}
|
|
||||||
},
|
|
||||||
mounted() {
|
|
||||||
// #ifdef APP-PLUS
|
|
||||||
var pages = getCurrentPages();
|
|
||||||
var page = pages[pages.length - 1];
|
|
||||||
var currentWebview = page.$getAppWebview();
|
|
||||||
currentWebview.addEventListener('hide',()=>{
|
|
||||||
this.webviewHide = true
|
|
||||||
})
|
|
||||||
currentWebview.addEventListener('show',()=>{
|
|
||||||
this.webviewHide = false
|
|
||||||
})
|
|
||||||
// #endif
|
|
||||||
this.$nextTick(() => {
|
|
||||||
this.initSize()
|
|
||||||
})
|
|
||||||
},
|
|
||||||
// #ifdef APP-NVUE
|
|
||||||
beforeDestroy() {
|
|
||||||
this.stopAnimation = true
|
|
||||||
},
|
|
||||||
// #endif
|
|
||||||
methods: {
|
|
||||||
initSize() {
|
|
||||||
if (this.scrollable) {
|
|
||||||
// #ifndef APP-NVUE
|
|
||||||
let query = [],
|
|
||||||
boxWidth = 0,
|
|
||||||
textWidth = 0;
|
|
||||||
let textQuery = new Promise((resolve, reject) => {
|
|
||||||
uni.createSelectorQuery()
|
|
||||||
// #ifndef MP-ALIPAY
|
|
||||||
.in(this)
|
|
||||||
// #endif
|
|
||||||
.select(`#${this.elId}`)
|
|
||||||
.boundingClientRect()
|
|
||||||
.exec(ret => {
|
|
||||||
this.textWidth = ret[0].width
|
|
||||||
resolve()
|
|
||||||
})
|
|
||||||
})
|
|
||||||
let boxQuery = new Promise((resolve, reject) => {
|
|
||||||
uni.createSelectorQuery()
|
|
||||||
// #ifndef MP-ALIPAY
|
|
||||||
.in(this)
|
|
||||||
// #endif
|
|
||||||
.select(`#${this.elIdBox}`)
|
|
||||||
.boundingClientRect()
|
|
||||||
.exec(ret => {
|
|
||||||
this.boxWidth = ret[0].width
|
|
||||||
resolve()
|
|
||||||
})
|
|
||||||
})
|
|
||||||
query.push(textQuery)
|
|
||||||
query.push(boxQuery)
|
|
||||||
Promise.all(query).then(() => {
|
|
||||||
this.animationDuration = `${this.textWidth / this.speed}s`
|
|
||||||
this.animationDelay = `-${this.boxWidth / this.speed}s`
|
|
||||||
setTimeout(() => {
|
|
||||||
this.animationPlayState = 'running'
|
|
||||||
}, 1000)
|
|
||||||
})
|
|
||||||
// #endif
|
|
||||||
// #ifdef APP-NVUE
|
|
||||||
dom.getComponentRect(this.$refs['animationEle'], (res) => {
|
|
||||||
let winWidth = uni.getSystemInfoSync().windowWidth
|
|
||||||
this.textWidth = res.size.width
|
|
||||||
animation.transition(this.$refs['animationEle'], {
|
|
||||||
styles: {
|
|
||||||
transform: `translateY(-${winWidth}px)`
|
|
||||||
},
|
|
||||||
duration: 0,
|
|
||||||
timingFunction: 'linear',
|
|
||||||
delay: 0
|
|
||||||
}, () => {
|
|
||||||
if (!this.stopAnimation) {
|
|
||||||
animation.transition(this.$refs['animationEle'], {
|
|
||||||
styles: {
|
|
||||||
transform: `translateY(-${this.textWidth}px)`
|
|
||||||
},
|
|
||||||
timingFunction: 'linear',
|
|
||||||
duration: (this.textWidth - winWidth) / this.speed * 1000,
|
|
||||||
delay: 1000
|
|
||||||
}, () => {
|
|
||||||
if (!this.stopAnimation) {
|
|
||||||
this.loopAnimation()
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
})
|
|
||||||
// #endif
|
|
||||||
}
|
|
||||||
// #ifdef APP-NVUE
|
|
||||||
if (!this.scrollable && (this.single || this.moreText)) {
|
|
||||||
dom.getComponentRect(this.$refs['textBox'], (res) => {
|
|
||||||
this.wrapWidth = res.size.width
|
|
||||||
})
|
|
||||||
}
|
|
||||||
// #endif
|
|
||||||
},
|
|
||||||
loopAnimation() {
|
|
||||||
// #ifdef APP-NVUE
|
|
||||||
animation.transition(this.$refs['animationEle'], {
|
|
||||||
styles: {
|
|
||||||
transform: `translateY(0px)`
|
|
||||||
},
|
|
||||||
duration: 0
|
|
||||||
}, () => {
|
|
||||||
if (!this.stopAnimation) {
|
|
||||||
animation.transition(this.$refs['animationEle'], {
|
|
||||||
styles: {
|
|
||||||
transform: `translateY(-${this.textWidth}px)`
|
|
||||||
},
|
|
||||||
duration: this.textWidth / this.speed * 1000,
|
|
||||||
timingFunction: 'linear',
|
|
||||||
delay: 0
|
|
||||||
}, () => {
|
|
||||||
if (!this.stopAnimation) {
|
|
||||||
this.loopAnimation()
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
// #endif
|
|
||||||
},
|
|
||||||
clickMore() {
|
|
||||||
this.$emit('getmore')
|
|
||||||
},
|
|
||||||
close() {
|
|
||||||
this.show = false;
|
|
||||||
this.$emit('close')
|
|
||||||
},
|
|
||||||
onClick() {
|
|
||||||
this.$emit('click')
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
|
|
||||||
.uni-noticebar {
|
|
||||||
/* #ifndef APP-NVUE */
|
|
||||||
display: flex;
|
|
||||||
width: 100%;
|
|
||||||
box-sizing: border-box;
|
|
||||||
/* #endif */
|
|
||||||
flex-direction: row;
|
|
||||||
align-items: center;
|
|
||||||
padding: 6px 12px;
|
|
||||||
margin-bottom: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-noticebar-close {
|
|
||||||
margin-right: 5px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-noticebar-icon {
|
|
||||||
margin-right: 5px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-noticebar__content-wrapper {
|
|
||||||
flex: 1;
|
|
||||||
flex-direction: column;
|
|
||||||
overflow: hidden;
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-noticebar__content-wrapper--single {
|
|
||||||
/* #ifndef APP-NVUE */
|
|
||||||
line-height: 18px;
|
|
||||||
/* #endif */
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-noticebar__content-wrapper--single,
|
|
||||||
.uni-noticebar__content-wrapper--scrollable {
|
|
||||||
flex-direction: row;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* #ifndef APP-NVUE */
|
|
||||||
.uni-noticebar__content-wrapper--scrollable {
|
|
||||||
position: relative;
|
|
||||||
height: 18px;
|
|
||||||
}
|
|
||||||
/* #endif */
|
|
||||||
|
|
||||||
.uni-noticebar__content--scrollable {
|
|
||||||
/* #ifdef APP-NVUE */
|
|
||||||
flex: 0;
|
|
||||||
/* #endif */
|
|
||||||
/* #ifndef APP-NVUE */
|
|
||||||
flex: 1;
|
|
||||||
display: block;
|
|
||||||
overflow: hidden;
|
|
||||||
/* #endif */
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-noticebar__content--single {
|
|
||||||
/* #ifndef APP-NVUE */
|
|
||||||
display: flex;
|
|
||||||
flex: none;
|
|
||||||
width: 100%;
|
|
||||||
justify-content: center;
|
|
||||||
/* #endif */
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-noticebar__content-text {
|
|
||||||
font-size: 14px;
|
|
||||||
line-height: 18px;
|
|
||||||
/* #ifndef APP-NVUE */
|
|
||||||
word-break: break-all;
|
|
||||||
/* #endif */
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-noticebar__content-text--single {
|
|
||||||
/* #ifdef APP-NVUE */
|
|
||||||
lines: 1;
|
|
||||||
/* #endif */
|
|
||||||
/* #ifndef APP-NVUE */
|
|
||||||
display: block;
|
|
||||||
width: 100%;
|
|
||||||
white-space: nowrap;
|
|
||||||
/* #endif */
|
|
||||||
overflow: hidden;
|
|
||||||
text-overflow: ellipsis;
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-noticebar__content-text--scrollable {
|
|
||||||
/* #ifdef APP-NVUE */
|
|
||||||
lines: 1;
|
|
||||||
padding-left: 750rpx;
|
|
||||||
/* #endif */
|
|
||||||
/* #ifndef APP-NVUE */
|
|
||||||
position: absolute;
|
|
||||||
display: block;
|
|
||||||
height: 18px;
|
|
||||||
line-height: 18px;
|
|
||||||
white-space: nowrap;
|
|
||||||
padding-left: 100%;
|
|
||||||
animation: notice 10s 0s linear infinite both;
|
|
||||||
animation-play-state: paused;
|
|
||||||
/* #endif */
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-noticebar__more {
|
|
||||||
/* #ifndef APP-NVUE */
|
|
||||||
display: inline-flex;
|
|
||||||
/* #endif */
|
|
||||||
flex-direction: row;
|
|
||||||
flex-wrap: nowrap;
|
|
||||||
align-items: center;
|
|
||||||
padding-left: 5px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-noticebar__more-text {
|
|
||||||
font-size: 14px;
|
|
||||||
}
|
|
||||||
|
|
||||||
@keyframes notice {
|
|
||||||
100% {
|
|
||||||
transform: translate3d(-100%, 0, 0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -1,29 +0,0 @@
|
|||||||
export default {
|
|
||||||
created() {
|
|
||||||
if (this.type === 'message') {
|
|
||||||
// 获取自组件对象
|
|
||||||
this.maskShow = false
|
|
||||||
this.children = null
|
|
||||||
}
|
|
||||||
},
|
|
||||||
created() {
|
|
||||||
if (this.type === 'message') {
|
|
||||||
// 不显示遮罩
|
|
||||||
this.maskShow = false
|
|
||||||
// 获取子组件对象
|
|
||||||
this.childrenMsg = null
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
customOpen() {
|
|
||||||
if (this.childrenMsg) {
|
|
||||||
this.childrenMsg.open()
|
|
||||||
}
|
|
||||||
},
|
|
||||||
customClose() {
|
|
||||||
if (this.childrenMsg) {
|
|
||||||
this.childrenMsg.close()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,24 +0,0 @@
|
|||||||
import message from './message.js';
|
|
||||||
// 定义 type 类型:弹出类型:top/bottom/center
|
|
||||||
const config = {
|
|
||||||
// 顶部弹出
|
|
||||||
top:'top',
|
|
||||||
// 底部弹出
|
|
||||||
bottom:'bottom',
|
|
||||||
// 居中弹出
|
|
||||||
center:'center',
|
|
||||||
// 消息提示
|
|
||||||
message:'top',
|
|
||||||
// 对话框
|
|
||||||
dialog:'center',
|
|
||||||
// 分享
|
|
||||||
share:'bottom',
|
|
||||||
}
|
|
||||||
export default {
|
|
||||||
data(){
|
|
||||||
return {
|
|
||||||
config:config
|
|
||||||
}
|
|
||||||
},
|
|
||||||
mixins: [message],
|
|
||||||
}
|
|
||||||
@@ -1,243 +0,0 @@
|
|||||||
<template>
|
|
||||||
<view class="uni-popup-dialog">
|
|
||||||
<view class="uni-dialog-title">
|
|
||||||
<text class="uni-dialog-title-text" :class="['uni-popup__'+dialogType]">{{title}}</text>
|
|
||||||
</view>
|
|
||||||
<view class="uni-dialog-content">
|
|
||||||
<text class="uni-dialog-content-text" v-if="mode === 'base'">{{content}}</text>
|
|
||||||
<input v-else class="uni-dialog-input" v-model="val" type="text" :placeholder="placeholder" :focus="focus" >
|
|
||||||
</view>
|
|
||||||
<view class="uni-dialog-button-group">
|
|
||||||
<view class="uni-dialog-button" @click="close">
|
|
||||||
<text class="uni-dialog-button-text">取消</text>
|
|
||||||
</view>
|
|
||||||
<view class="uni-dialog-button uni-border-left" @click="onOk">
|
|
||||||
<text class="uni-dialog-button-text uni-button-color">确定</text>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
/**
|
|
||||||
* PopUp 弹出层-对话框样式
|
|
||||||
* @description 弹出层-对话框样式
|
|
||||||
* @tutorial https://ext.dcloud.net.cn/plugin?id=329
|
|
||||||
* @property {String} value input 模式下的默认值
|
|
||||||
* @property {String} placeholder input 模式下输入提示
|
|
||||||
* @property {String} type = [success|warning|info|error] 主题样式
|
|
||||||
* @value success 成功
|
|
||||||
* @value warning 提示
|
|
||||||
* @value info 消息
|
|
||||||
* @value error 错误
|
|
||||||
* @property {String} mode = [base|input] 模式、
|
|
||||||
* @value base 基础对话框
|
|
||||||
* @value input 可输入对话框
|
|
||||||
* @property {String} content 对话框内容
|
|
||||||
* @property {Boolean} beforeClose 是否拦截取消事件
|
|
||||||
* @event {Function} confirm 点击确认按钮触发
|
|
||||||
* @event {Function} close 点击取消按钮触发
|
|
||||||
*/
|
|
||||||
|
|
||||||
export default {
|
|
||||||
name: "uniPopupDialog",
|
|
||||||
props: {
|
|
||||||
value: {
|
|
||||||
type: [String, Number],
|
|
||||||
default: ''
|
|
||||||
},
|
|
||||||
placeholder: {
|
|
||||||
type: [String, Number],
|
|
||||||
default: '请输入内容'
|
|
||||||
},
|
|
||||||
/**
|
|
||||||
* 对话框主题 success/warning/info/error 默认 success
|
|
||||||
*/
|
|
||||||
type: {
|
|
||||||
type: String,
|
|
||||||
default: 'error'
|
|
||||||
},
|
|
||||||
/**
|
|
||||||
* 对话框模式 base/input
|
|
||||||
*/
|
|
||||||
mode: {
|
|
||||||
type: String,
|
|
||||||
default: 'base'
|
|
||||||
},
|
|
||||||
/**
|
|
||||||
* 对话框标题
|
|
||||||
*/
|
|
||||||
title: {
|
|
||||||
type: String,
|
|
||||||
default: '提示'
|
|
||||||
},
|
|
||||||
/**
|
|
||||||
* 对话框内容
|
|
||||||
*/
|
|
||||||
content: {
|
|
||||||
type: String,
|
|
||||||
default: ''
|
|
||||||
},
|
|
||||||
/**
|
|
||||||
* 拦截取消事件 ,如果拦截取消事件,必须监听close事件,执行 done()
|
|
||||||
*/
|
|
||||||
beforeClose: {
|
|
||||||
type: Boolean,
|
|
||||||
default: false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
dialogType: 'error',
|
|
||||||
focus: false,
|
|
||||||
val: ""
|
|
||||||
}
|
|
||||||
},
|
|
||||||
inject: ['popup'],
|
|
||||||
watch: {
|
|
||||||
type(val) {
|
|
||||||
this.dialogType = val
|
|
||||||
},
|
|
||||||
mode(val) {
|
|
||||||
if (val === 'input') {
|
|
||||||
this.dialogType = 'info'
|
|
||||||
}
|
|
||||||
},
|
|
||||||
value(val) {
|
|
||||||
this.val = val
|
|
||||||
}
|
|
||||||
},
|
|
||||||
created() {
|
|
||||||
// 对话框遮罩不可点击
|
|
||||||
this.popup.mkclick = false
|
|
||||||
if (this.mode === 'input') {
|
|
||||||
this.dialogType = 'info'
|
|
||||||
this.val = this.value
|
|
||||||
} else {
|
|
||||||
this.dialogType = this.type
|
|
||||||
}
|
|
||||||
},
|
|
||||||
mounted() {
|
|
||||||
this.focus = true
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
/**
|
|
||||||
* 点击确认按钮
|
|
||||||
*/
|
|
||||||
onOk() {
|
|
||||||
this.$emit('confirm', () => {
|
|
||||||
this.popup.close()
|
|
||||||
if (this.mode === 'input') this.val = this.value
|
|
||||||
}, this.mode === 'input' ? this.val : '')
|
|
||||||
},
|
|
||||||
/**
|
|
||||||
* 点击取消按钮
|
|
||||||
*/
|
|
||||||
close() {
|
|
||||||
if (this.beforeClose) {
|
|
||||||
this.$emit('close', () => {
|
|
||||||
this.popup.close()
|
|
||||||
})
|
|
||||||
return
|
|
||||||
}
|
|
||||||
this.popup.close()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
.uni-popup-dialog {
|
|
||||||
width: 300px;
|
|
||||||
border-radius: 15px;
|
|
||||||
background-color: #fff;
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-dialog-title {
|
|
||||||
/* #ifndef APP-NVUE */
|
|
||||||
display: flex;
|
|
||||||
/* #endif */
|
|
||||||
flex-direction: row;
|
|
||||||
justify-content: center;
|
|
||||||
padding-top: 15px;
|
|
||||||
padding-bottom: 5px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-dialog-title-text {
|
|
||||||
font-size: 16px;
|
|
||||||
font-weight: 500;
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-dialog-content {
|
|
||||||
/* #ifndef APP-NVUE */
|
|
||||||
display: flex;
|
|
||||||
/* #endif */
|
|
||||||
flex-direction: row;
|
|
||||||
justify-content: center;
|
|
||||||
align-items: center;
|
|
||||||
padding: 5px 15px 15px 15px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-dialog-content-text {
|
|
||||||
font-size: 14px;
|
|
||||||
color: #6e6e6e;
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-dialog-button-group {
|
|
||||||
/* #ifndef APP-NVUE */
|
|
||||||
display: flex;
|
|
||||||
/* #endif */
|
|
||||||
flex-direction: row;
|
|
||||||
border-top-color: #f5f5f5;
|
|
||||||
border-top-style: solid;
|
|
||||||
border-top-width: 1px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-dialog-button {
|
|
||||||
/* #ifndef APP-NVUE */
|
|
||||||
display: flex;
|
|
||||||
/* #endif */
|
|
||||||
|
|
||||||
flex: 1;
|
|
||||||
flex-direction: row;
|
|
||||||
justify-content: center;
|
|
||||||
align-items: center;
|
|
||||||
height: 45px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-border-left {
|
|
||||||
border-left-color: #f0f0f0;
|
|
||||||
border-left-style: solid;
|
|
||||||
border-left-width: 1px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-dialog-button-text {
|
|
||||||
font-size: 14px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-button-color {
|
|
||||||
color: $uni-color-primary;
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-dialog-input {
|
|
||||||
flex: 1;
|
|
||||||
font-size: 14px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-popup__success {
|
|
||||||
color: $uni-color-success;
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-popup__warn {
|
|
||||||
color: $uni-color-warning;
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-popup__error {
|
|
||||||
color: $uni-color-error;
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-popup__info {
|
|
||||||
color: #909399;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -1,116 +0,0 @@
|
|||||||
<template>
|
|
||||||
<view class="uni-popup-message" :class="'uni-popup__'+[type]">
|
|
||||||
<text class="uni-popup-message-text" :class="'uni-popup__'+[type]+'-text'">{{message}}</text>
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
|
|
||||||
/**
|
|
||||||
* PopUp 弹出层-消息提示
|
|
||||||
* @description 弹出层-消息提示
|
|
||||||
* @tutorial https://ext.dcloud.net.cn/plugin?id=329
|
|
||||||
* @property {String} type = [success|warning|info|error] 主题样式
|
|
||||||
* @value success 成功
|
|
||||||
* @value warning 提示
|
|
||||||
* @value info 消息
|
|
||||||
* @value error 错误
|
|
||||||
* @property {String} message 消息提示文字
|
|
||||||
* @property {String} duration 显示时间,设置为 0 则不会自动关闭
|
|
||||||
*/
|
|
||||||
|
|
||||||
export default {
|
|
||||||
name: 'UniPopupMessage',
|
|
||||||
props: {
|
|
||||||
/**
|
|
||||||
* 主题 success/warning/info/error 默认 success
|
|
||||||
*/
|
|
||||||
type: {
|
|
||||||
type: String,
|
|
||||||
default: 'success'
|
|
||||||
},
|
|
||||||
/**
|
|
||||||
* 消息文字
|
|
||||||
*/
|
|
||||||
message: {
|
|
||||||
type: String,
|
|
||||||
default: ''
|
|
||||||
},
|
|
||||||
/**
|
|
||||||
* 显示时间,设置为 0 则不会自动关闭
|
|
||||||
*/
|
|
||||||
duration: {
|
|
||||||
type: Number,
|
|
||||||
default: 3000
|
|
||||||
}
|
|
||||||
},
|
|
||||||
inject: ['popup'],
|
|
||||||
data() {
|
|
||||||
return {}
|
|
||||||
},
|
|
||||||
created() {
|
|
||||||
this.popup.childrenMsg = this
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
open() {
|
|
||||||
if (this.duration === 0) return
|
|
||||||
clearTimeout(this.popuptimer)
|
|
||||||
this.popuptimer = setTimeout(() => {
|
|
||||||
this.popup.close()
|
|
||||||
}, this.duration)
|
|
||||||
},
|
|
||||||
close() {
|
|
||||||
clearTimeout(this.popuptimer)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
.uni-popup-message {
|
|
||||||
/* #ifndef APP-NVUE */
|
|
||||||
display: flex;
|
|
||||||
/* #endif */
|
|
||||||
flex-direction: row;
|
|
||||||
background-color: #e1f3d8;
|
|
||||||
padding: 10px 15px;
|
|
||||||
border-color: #eee;
|
|
||||||
border-style: solid;
|
|
||||||
border-width: 1px;
|
|
||||||
}
|
|
||||||
.uni-popup-message-text {
|
|
||||||
font-size: 14px;
|
|
||||||
padding: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-popup__success {
|
|
||||||
background-color: #e1f3d8;
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-popup__success-text {
|
|
||||||
color: #67C23A;
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-popup__warn {
|
|
||||||
background-color: #faecd8;
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-popup__warn-text {
|
|
||||||
color: #E6A23C;
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-popup__error {
|
|
||||||
background-color: #fde2e2;
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-popup__error-text {
|
|
||||||
color: #F56C6C;
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-popup__info {
|
|
||||||
background-color: #F2F6FC;
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-popup__info-text {
|
|
||||||
color: #909399;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -1,165 +0,0 @@
|
|||||||
<template>
|
|
||||||
<view class="uni-popup-share">
|
|
||||||
<view class="uni-share-title"><text class="uni-share-title-text">{{title}}</text></view>
|
|
||||||
<view class="uni-share-content">
|
|
||||||
<view class="uni-share-content-box">
|
|
||||||
<view class="uni-share-content-item" v-for="(item,index) in bottomData" :key="index" @click.stop="select(item,index)">
|
|
||||||
<image class="uni-share-image" :src="item.icon" mode="aspectFill"></image>
|
|
||||||
<text class="uni-share-text">{{item.text}}</text>
|
|
||||||
</view>
|
|
||||||
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="uni-share-button-box">
|
|
||||||
<button class="uni-share-button" @click="close">取消</button>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
export default {
|
|
||||||
name: 'UniPopupShare',
|
|
||||||
props: {
|
|
||||||
title: {
|
|
||||||
type: String,
|
|
||||||
default: '分享到'
|
|
||||||
}
|
|
||||||
},
|
|
||||||
inject: ['popup'],
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
bottomData: [{
|
|
||||||
text: '微信',
|
|
||||||
icon: 'https://img-cdn-qiniu.dcloud.net.cn/uni-ui/grid-2.png',
|
|
||||||
name: 'wx'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
text: '支付宝',
|
|
||||||
icon: 'https://img-cdn-qiniu.dcloud.net.cn/uni-ui/grid-8.png',
|
|
||||||
name: 'wx'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
text: 'QQ',
|
|
||||||
icon: 'https://img-cdn-qiniu.dcloud.net.cn/uni-ui/gird-3.png',
|
|
||||||
name: 'qq'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
text: '新浪',
|
|
||||||
icon: 'https://img-cdn-qiniu.dcloud.net.cn/uni-ui/grid-1.png',
|
|
||||||
name: 'sina'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
text: '百度',
|
|
||||||
icon: 'https://img-cdn-qiniu.dcloud.net.cn/uni-ui/grid-7.png',
|
|
||||||
name: 'copy'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
text: '其他',
|
|
||||||
icon: 'https://img-cdn-qiniu.dcloud.net.cn/uni-ui/grid-5.png',
|
|
||||||
name: 'more'
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
},
|
|
||||||
created() {},
|
|
||||||
methods: {
|
|
||||||
/**
|
|
||||||
* 选择内容
|
|
||||||
*/
|
|
||||||
select(item, index) {
|
|
||||||
this.$emit('select', {
|
|
||||||
item,
|
|
||||||
index
|
|
||||||
}, () => {
|
|
||||||
this.popup.close()
|
|
||||||
})
|
|
||||||
},
|
|
||||||
/**
|
|
||||||
* 关闭窗口
|
|
||||||
*/
|
|
||||||
close() {
|
|
||||||
this.popup.close()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
.uni-popup-share {
|
|
||||||
background-color: #fff;
|
|
||||||
}
|
|
||||||
.uni-share-title {
|
|
||||||
/* #ifndef APP-NVUE */
|
|
||||||
display: flex;
|
|
||||||
/* #endif */
|
|
||||||
flex-direction: row;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
height: 40px;
|
|
||||||
}
|
|
||||||
.uni-share-title-text {
|
|
||||||
font-size: 14px;
|
|
||||||
color: #666;
|
|
||||||
}
|
|
||||||
.uni-share-content {
|
|
||||||
/* #ifndef APP-NVUE */
|
|
||||||
display: flex;
|
|
||||||
/* #endif */
|
|
||||||
flex-direction: row;
|
|
||||||
justify-content: center;
|
|
||||||
padding-top: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-share-content-box {
|
|
||||||
/* #ifndef APP-NVUE */
|
|
||||||
display: flex;
|
|
||||||
/* #endif */
|
|
||||||
flex-direction: row;
|
|
||||||
flex-wrap: wrap;
|
|
||||||
width: 360px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-share-content-item {
|
|
||||||
width: 90px;
|
|
||||||
/* #ifndef APP-NVUE */
|
|
||||||
display: flex;
|
|
||||||
/* #endif */
|
|
||||||
flex-direction: column;
|
|
||||||
justify-content: center;
|
|
||||||
padding: 10px 0;
|
|
||||||
align-items: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-share-content-item:active {
|
|
||||||
background-color: #f5f5f5;
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-share-image {
|
|
||||||
width: 30px;
|
|
||||||
height: 30px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-share-text {
|
|
||||||
margin-top: 10px;
|
|
||||||
font-size: 14px;
|
|
||||||
color: #3B4144;
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-share-button-box {
|
|
||||||
/* #ifndef APP-NVUE */
|
|
||||||
display: flex;
|
|
||||||
/* #endif */
|
|
||||||
flex-direction: row;
|
|
||||||
padding: 10px 15px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-share-button {
|
|
||||||
flex: 1;
|
|
||||||
border-radius: 50px;
|
|
||||||
color: #666;
|
|
||||||
font-size: 16px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-share-button::after {
|
|
||||||
border-radius: 50px;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -1,294 +0,0 @@
|
|||||||
<template>
|
|
||||||
<view v-if="showPopup" class="uni-popup" :class="[popupstyle]" @touchmove.stop.prevent="clear">
|
|
||||||
<uni-transition v-if="maskShow" :mode-class="['fade']" :styles="maskClass" :duration="duration" :show="showTrans"
|
|
||||||
@click="onTap" />
|
|
||||||
<uni-transition :mode-class="ani" :styles="transClass" :duration="duration" :show="showTrans" @click="onTap">
|
|
||||||
<view class="uni-popup__wrapper-box" @click.stop="clear">
|
|
||||||
<slot />
|
|
||||||
</view>
|
|
||||||
</uni-transition>
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import uniTransition from '../uni-transition/uni-transition.vue'
|
|
||||||
import popup from './popup.js'
|
|
||||||
/**
|
|
||||||
* PopUp 弹出层
|
|
||||||
* @description 弹出层组件,为了解决遮罩弹层的问题
|
|
||||||
* @tutorial https://ext.dcloud.net.cn/plugin?id=329
|
|
||||||
* @property {String} type = [top|center|bottom] 弹出方式
|
|
||||||
* @value top 顶部弹出
|
|
||||||
* @value center 中间弹出
|
|
||||||
* @value bottom 底部弹出
|
|
||||||
* @value message 消息提示
|
|
||||||
* @value dialog 对话框
|
|
||||||
* @value share 底部分享示例
|
|
||||||
* @property {Boolean} animation = [ture|false] 是否开启动画
|
|
||||||
* @property {Boolean} maskClick = [ture|false] 蒙版点击是否关闭弹窗
|
|
||||||
* @event {Function} change 打开关闭弹窗触发,e={show: false}
|
|
||||||
*/
|
|
||||||
|
|
||||||
export default {
|
|
||||||
name: 'UniPopup',
|
|
||||||
components: {
|
|
||||||
uniTransition
|
|
||||||
},
|
|
||||||
props: {
|
|
||||||
// 开启动画
|
|
||||||
animation: {
|
|
||||||
type: Boolean,
|
|
||||||
default: true
|
|
||||||
},
|
|
||||||
// 弹出层类型,可选值,top: 顶部弹出层;bottom:底部弹出层;center:全屏弹出层
|
|
||||||
// message: 消息提示 ; dialog : 对话框
|
|
||||||
type: {
|
|
||||||
type: String,
|
|
||||||
default: 'center'
|
|
||||||
},
|
|
||||||
// maskClick
|
|
||||||
maskClick: {
|
|
||||||
type: Boolean,
|
|
||||||
default: true
|
|
||||||
}
|
|
||||||
},
|
|
||||||
provide() {
|
|
||||||
return {
|
|
||||||
popup: this
|
|
||||||
}
|
|
||||||
},
|
|
||||||
mixins: [popup],
|
|
||||||
watch: {
|
|
||||||
/**
|
|
||||||
* 监听type类型
|
|
||||||
*/
|
|
||||||
type: {
|
|
||||||
handler: function(newVal) {
|
|
||||||
this[this.config[newVal]]()
|
|
||||||
},
|
|
||||||
immediate: true
|
|
||||||
},
|
|
||||||
/**
|
|
||||||
* 监听遮罩是否可点击
|
|
||||||
* @param {Object} val
|
|
||||||
*/
|
|
||||||
maskClick(val) {
|
|
||||||
this.mkclick = val
|
|
||||||
}
|
|
||||||
},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
duration: 300,
|
|
||||||
ani: [],
|
|
||||||
showPopup: false,
|
|
||||||
showTrans: false,
|
|
||||||
maskClass: {
|
|
||||||
'position': 'fixed',
|
|
||||||
'bottom': 0,
|
|
||||||
'top': 0,
|
|
||||||
'left': 0,
|
|
||||||
'right': 0,
|
|
||||||
'backgroundColor': 'rgba(0, 0, 0, 0.4)'
|
|
||||||
},
|
|
||||||
transClass: {
|
|
||||||
'position': 'fixed',
|
|
||||||
'left': 0,
|
|
||||||
'right': 0,
|
|
||||||
},
|
|
||||||
maskShow: true,
|
|
||||||
mkclick: true,
|
|
||||||
popupstyle: 'top'
|
|
||||||
}
|
|
||||||
},
|
|
||||||
created() {
|
|
||||||
this.mkclick = this.maskClick
|
|
||||||
if (this.animation) {
|
|
||||||
this.duration = 300
|
|
||||||
} else {
|
|
||||||
this.duration = 0
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
clear(e) {
|
|
||||||
// TODO nvue 取消冒泡
|
|
||||||
e.stopPropagation()
|
|
||||||
},
|
|
||||||
open() {
|
|
||||||
this.showPopup = true
|
|
||||||
this.$nextTick(() => {
|
|
||||||
new Promise(resolve => {
|
|
||||||
clearTimeout(this.timer)
|
|
||||||
this.timer = setTimeout(() => {
|
|
||||||
this.showTrans = true
|
|
||||||
// fixed by mehaotian 兼容 app 端
|
|
||||||
this.$nextTick(() => {
|
|
||||||
resolve();
|
|
||||||
})
|
|
||||||
}, 50);
|
|
||||||
}).then(res => {
|
|
||||||
// 自定义打开事件
|
|
||||||
clearTimeout(this.msgtimer)
|
|
||||||
this.msgtimer = setTimeout(() => {
|
|
||||||
this.customOpen && this.customOpen()
|
|
||||||
}, 100)
|
|
||||||
this.$emit('change', {
|
|
||||||
show: true,
|
|
||||||
type: this.type
|
|
||||||
})
|
|
||||||
})
|
|
||||||
})
|
|
||||||
},
|
|
||||||
close(type) {
|
|
||||||
this.showTrans = false
|
|
||||||
this.$nextTick(() => {
|
|
||||||
this.$emit('change', {
|
|
||||||
show: false,
|
|
||||||
type: this.type
|
|
||||||
})
|
|
||||||
clearTimeout(this.timer)
|
|
||||||
// 自定义关闭事件
|
|
||||||
this.customOpen && this.customClose()
|
|
||||||
this.timer = setTimeout(() => {
|
|
||||||
this.showPopup = false
|
|
||||||
}, 300)
|
|
||||||
})
|
|
||||||
},
|
|
||||||
onTap() {
|
|
||||||
if (!this.mkclick) return
|
|
||||||
this.close()
|
|
||||||
},
|
|
||||||
/**
|
|
||||||
* 顶部弹出样式处理
|
|
||||||
*/
|
|
||||||
top() {
|
|
||||||
this.popupstyle = 'top'
|
|
||||||
this.ani = ['slide-top']
|
|
||||||
this.transClass = {
|
|
||||||
'position': 'fixed',
|
|
||||||
'left': 0,
|
|
||||||
'right': 0,
|
|
||||||
}
|
|
||||||
},
|
|
||||||
/**
|
|
||||||
* 底部弹出样式处理
|
|
||||||
*/
|
|
||||||
bottom() {
|
|
||||||
this.popupstyle = 'bottom'
|
|
||||||
this.ani = ['slide-bottom']
|
|
||||||
this.transClass = {
|
|
||||||
'position': 'fixed',
|
|
||||||
'left': 0,
|
|
||||||
'right': 0,
|
|
||||||
'bottom': 0
|
|
||||||
}
|
|
||||||
},
|
|
||||||
/**
|
|
||||||
* 中间弹出样式处理
|
|
||||||
*/
|
|
||||||
center() {
|
|
||||||
this.popupstyle = 'center'
|
|
||||||
this.ani = ['zoom-out', 'fade']
|
|
||||||
this.transClass = {
|
|
||||||
'position': 'fixed',
|
|
||||||
/* #ifndef APP-NVUE */
|
|
||||||
'display': 'flex',
|
|
||||||
'flexDirection': 'column',
|
|
||||||
/* #endif */
|
|
||||||
'bottom': 0,
|
|
||||||
'left': 0,
|
|
||||||
'right': 0,
|
|
||||||
'top': 0,
|
|
||||||
'justifyContent': 'center',
|
|
||||||
'alignItems': 'center'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
.uni-popup {
|
|
||||||
position: fixed;
|
|
||||||
/* #ifndef APP-NVUE */
|
|
||||||
z-index: 99;
|
|
||||||
/* #endif */
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-popup__mask {
|
|
||||||
position: absolute;
|
|
||||||
top: 0;
|
|
||||||
bottom: 0;
|
|
||||||
left: 0;
|
|
||||||
right: 0;
|
|
||||||
background-color: $uni-bg-color-mask;
|
|
||||||
opacity: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.mask-ani {
|
|
||||||
transition-property: opacity;
|
|
||||||
transition-duration: 0.2s;
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-top-mask {
|
|
||||||
opacity: 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-bottom-mask {
|
|
||||||
opacity: 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-center-mask {
|
|
||||||
opacity: 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-popup__wrapper {
|
|
||||||
/* #ifndef APP-NVUE */
|
|
||||||
display: block;
|
|
||||||
/* #endif */
|
|
||||||
position: absolute;
|
|
||||||
}
|
|
||||||
|
|
||||||
.top {
|
|
||||||
/* #ifdef H5 */
|
|
||||||
top: var(--window-top);
|
|
||||||
/* #endif */
|
|
||||||
/* #ifndef H5 */
|
|
||||||
top: 0;
|
|
||||||
/* #endif */
|
|
||||||
}
|
|
||||||
|
|
||||||
.bottom {
|
|
||||||
bottom: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-popup__wrapper-box {
|
|
||||||
/* #ifndef APP-NVUE */
|
|
||||||
display: block;
|
|
||||||
/* #endif */
|
|
||||||
position: relative;
|
|
||||||
/* iphonex 等安全区设置,底部安全区适配 */
|
|
||||||
/* #ifndef APP-NVUE */
|
|
||||||
padding-bottom: constant(safe-area-inset-bottom);
|
|
||||||
padding-bottom: env(safe-area-inset-bottom);
|
|
||||||
/* #endif */
|
|
||||||
}
|
|
||||||
|
|
||||||
.content-ani {
|
|
||||||
// transition: transform 0.3s;
|
|
||||||
transition-property: transform, opacity;
|
|
||||||
transition-duration: 0.2s;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
.uni-top-content {
|
|
||||||
transform: translateY(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-bottom-content {
|
|
||||||
transform: translateY(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-center-content {
|
|
||||||
transform: scale(1);
|
|
||||||
opacity: 1;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -1,135 +0,0 @@
|
|||||||
<template>
|
|
||||||
<view class="uni-section" nvue>
|
|
||||||
<view v-if="type" class="uni-section__head">
|
|
||||||
<view :class="type" class="uni-section__head-tag" />
|
|
||||||
</view>
|
|
||||||
<view class="uni-section__content">
|
|
||||||
<text :class="{'distraction':!subTitle}" class="uni-section__content-title">{{ title }}</text>
|
|
||||||
<text v-if="subTitle" class="uni-section__content-sub">{{ subTitle }}</text>
|
|
||||||
</view>
|
|
||||||
<slot />
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Section 标题栏
|
|
||||||
* @description 标题栏
|
|
||||||
* @property {String} type = [line|circle] 标题装饰类型
|
|
||||||
* @value line 竖线
|
|
||||||
* @value circle 圆形
|
|
||||||
* @property {String} title 主标题
|
|
||||||
* @property {String} subTitle 副标题
|
|
||||||
*/
|
|
||||||
|
|
||||||
export default {
|
|
||||||
name: 'UniTitle',
|
|
||||||
props: {
|
|
||||||
type: {
|
|
||||||
type: String,
|
|
||||||
default: ''
|
|
||||||
},
|
|
||||||
title: {
|
|
||||||
type: String,
|
|
||||||
default: ''
|
|
||||||
},
|
|
||||||
subTitle: {
|
|
||||||
type: String,
|
|
||||||
default: ''
|
|
||||||
}
|
|
||||||
},
|
|
||||||
data() {
|
|
||||||
return {}
|
|
||||||
},
|
|
||||||
watch: {
|
|
||||||
title(newVal) {
|
|
||||||
if (uni.report && newVal !== '') {
|
|
||||||
uni.report('title', newVal)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
onClick() {
|
|
||||||
this.$emit('click')
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
.uni-section {
|
|
||||||
position: relative;
|
|
||||||
/* #ifndef APP-NVUE */
|
|
||||||
display: flex;
|
|
||||||
/* #endif */
|
|
||||||
margin-top: 10px;
|
|
||||||
flex-direction: row;
|
|
||||||
align-items: center;
|
|
||||||
padding: 0 10px;
|
|
||||||
height: 50px;
|
|
||||||
background-color: $uni-bg-color-grey;
|
|
||||||
/* #ifdef APP-NVUE */
|
|
||||||
border-bottom-color: $uni-border-color;
|
|
||||||
border-bottom-style: solid;
|
|
||||||
border-bottom-width: 0.5px;
|
|
||||||
/* #endif */
|
|
||||||
font-weight: normal;
|
|
||||||
}
|
|
||||||
/* #ifndef APP-NVUE */
|
|
||||||
.uni-section:after {
|
|
||||||
position: absolute;
|
|
||||||
bottom: 0;
|
|
||||||
right: 0;
|
|
||||||
left: 0;
|
|
||||||
height: 1px;
|
|
||||||
content: '';
|
|
||||||
-webkit-transform: scaleY(.5);
|
|
||||||
transform: scaleY(.5);
|
|
||||||
background-color: $uni-border-color;
|
|
||||||
}
|
|
||||||
/* #endif */
|
|
||||||
|
|
||||||
.uni-section__head {
|
|
||||||
flex-direction: row;
|
|
||||||
justify-content: center;
|
|
||||||
align-items: center;
|
|
||||||
margin-right: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.line {
|
|
||||||
height: 15px;
|
|
||||||
background-color: $uni-text-color-disable;
|
|
||||||
border-radius: 5px;
|
|
||||||
width: 3px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.circle {
|
|
||||||
width: 8px;
|
|
||||||
height: 8px;
|
|
||||||
border-top-right-radius: 50px;
|
|
||||||
border-top-left-radius: 50px;
|
|
||||||
border-bottom-left-radius: 50px;
|
|
||||||
border-bottom-right-radius: 50px;
|
|
||||||
background-color: $uni-text-color-disable;
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-section__content {
|
|
||||||
flex: 1;
|
|
||||||
color: $uni-text-color;
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-section__content-title {
|
|
||||||
font-size: $uni-font-size-base;
|
|
||||||
color: $uni-text-color;
|
|
||||||
}
|
|
||||||
|
|
||||||
.distraction {
|
|
||||||
flex-direction: row;
|
|
||||||
align-items: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-section__content-sub {
|
|
||||||
font-size: $uni-font-size-sm;
|
|
||||||
color: $uni-text-color-grey;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -1,25 +0,0 @@
|
|||||||
<template>
|
|
||||||
<view :style="{ height: statusBarHeight }" class="uni-status-bar">
|
|
||||||
<slot />
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
var statusBarHeight = uni.getSystemInfoSync().statusBarHeight + 'px'
|
|
||||||
export default {
|
|
||||||
name: 'UniStatusBar',
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
statusBarHeight: statusBarHeight
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
.uni-status-bar {
|
|
||||||
width: 750rpx;
|
|
||||||
height: 20px;
|
|
||||||
// height: var(--status-bar-height);
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -1,253 +0,0 @@
|
|||||||
<template>
|
|
||||||
<view class="uni-steps">
|
|
||||||
<view :class="[direction==='column'?'uni-steps__column':'uni-steps__row']">
|
|
||||||
<view :class="[direction==='column'?'uni-steps__column-text-container':'uni-steps__row-text-container']">
|
|
||||||
<view v-for="(item,index) in options" :key="index" :class="[direction==='column'?'uni-steps__column-text':'uni-steps__row-text']">
|
|
||||||
<text :style="{color:index<=active?activeColor:deactiveColor}" :class="[direction==='column'?'uni-steps__column-title':'uni-steps__row-title']">{{item.title}}</text>
|
|
||||||
<text v-if="direction=='column'" :style="{color:index<=active?activeColor:deactiveColor}" :class="[direction==='column'?'uni-steps__column-desc':'uni-steps__row-desc']">{{item.desc}}</text>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view :class="[direction==='column'?'uni-steps__column-container':'uni-steps__row-container']">
|
|
||||||
<view :class="[direction==='column'?'uni-steps__column-line-item':'uni-steps__row-line-item']" v-for="(item,index) in options"
|
|
||||||
:key="index">
|
|
||||||
<view :class="[direction==='column'?'uni-steps__column-line':'uni-steps__row-line',direction==='column'?'uni-steps__column-line--before':'uni-steps__row-line--before']"
|
|
||||||
:style="{backgroundColor:index<=active&&index!==0?activeColor:index===0?'transparent':deactiveColor}"></view>
|
|
||||||
<view :class="[direction==='column'?'uni-steps__column-check':'uni-steps__row-check']" v-if="index === active">
|
|
||||||
<uni-icons :color="activeColor" type="checkbox-filled" size="14"></uni-icons>
|
|
||||||
</view>
|
|
||||||
<view :class="[direction==='column'?'uni-steps__column-circle':'uni-steps__row-circle']" v-else :style="{backgroundColor:index<active?activeColor:deactiveColor}"></view>
|
|
||||||
<view :class="[direction==='column'?'uni-steps__column-line':'uni-steps__row-line',direction==='column'?'uni-steps__column-line--after':'uni-steps__row-line--after']"
|
|
||||||
:style="{backgroundColor:index<active&&index!==options.length-1?activeColor:index===options.length-1?'transparent':deactiveColor}"></view>
|
|
||||||
<!-- <view v-if="index==0 && direction!='column'" class="address">北京市</view>
|
|
||||||
<view v-if="options.length-1 == index && direction!='column'" class="address">太原市</view> -->
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import uniIcons from '../uni-icons/uni-icons.vue'
|
|
||||||
export default {
|
|
||||||
name: 'UniSteps',
|
|
||||||
components: {
|
|
||||||
uniIcons
|
|
||||||
},
|
|
||||||
props: {
|
|
||||||
direction: {
|
|
||||||
// 排列方向 row column
|
|
||||||
type: String,
|
|
||||||
default: 'row'
|
|
||||||
},
|
|
||||||
activeColor: {
|
|
||||||
// 激活状态颜色
|
|
||||||
type: String,
|
|
||||||
default: '#1aad19'
|
|
||||||
},
|
|
||||||
deactiveColor: {
|
|
||||||
// 未激活状态颜色
|
|
||||||
type: String,
|
|
||||||
default: '#999999'
|
|
||||||
},
|
|
||||||
active: {
|
|
||||||
// 当前步骤
|
|
||||||
type: Number,
|
|
||||||
default: 0
|
|
||||||
},
|
|
||||||
options: {
|
|
||||||
type: Array,
|
|
||||||
default () {
|
|
||||||
return []
|
|
||||||
}
|
|
||||||
} // 数据
|
|
||||||
},
|
|
||||||
data() {
|
|
||||||
return {}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
.uni-steps {
|
|
||||||
/* #ifndef APP-NVUE */
|
|
||||||
display: flex;
|
|
||||||
width: 100%;
|
|
||||||
/* #endif */
|
|
||||||
/* #ifdef APP-NVUE */
|
|
||||||
flex: 1;
|
|
||||||
/* #endif */
|
|
||||||
flex-direction: column;
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-steps__row {
|
|
||||||
/* #ifndef APP-NVUE */
|
|
||||||
display: flex;
|
|
||||||
/* #endif */
|
|
||||||
flex-direction: column;
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-steps__column {
|
|
||||||
/* #ifndef APP-NVUE */
|
|
||||||
display: flex;
|
|
||||||
/* #endif */
|
|
||||||
flex-direction: row-reverse;
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-steps__row-text-container {
|
|
||||||
/* #ifndef APP-NVUE */
|
|
||||||
display: flex;
|
|
||||||
/* #endif */
|
|
||||||
flex-direction: row;
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-steps__column-text-container {
|
|
||||||
/* #ifndef APP-NVUE */
|
|
||||||
display: flex;
|
|
||||||
/* #endif */
|
|
||||||
flex-direction: column;
|
|
||||||
flex: 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-steps__row-text {
|
|
||||||
/* #ifndef APP-NVUE */
|
|
||||||
display: inline-flex;
|
|
||||||
/* #endif */
|
|
||||||
flex: 1;
|
|
||||||
flex-direction: column;
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-steps__column-text {
|
|
||||||
padding: 6px 0px;
|
|
||||||
// border-bottom-style: solid;
|
|
||||||
// border-bottom-width: 1px;
|
|
||||||
// border-bottom-color: $uni-border-color;
|
|
||||||
/* #ifndef APP-NVUE */
|
|
||||||
display: flex;
|
|
||||||
/* #endif */
|
|
||||||
flex-direction: column;
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-steps__row-title {
|
|
||||||
font-size: 24rpx;
|
|
||||||
line-height: 16px;
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-steps__column-title {
|
|
||||||
font-size: 24rpx;
|
|
||||||
text-align: left;
|
|
||||||
line-height: 18px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-steps__row-desc {
|
|
||||||
font-size: 12px;
|
|
||||||
line-height: 14px;
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-steps__column-desc {
|
|
||||||
font-size: $uni-font-size-sm;
|
|
||||||
text-align: left;
|
|
||||||
line-height: 18px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-steps__row-container {
|
|
||||||
/* #ifndef APP-NVUE */
|
|
||||||
display: flex;
|
|
||||||
/* #endif */
|
|
||||||
flex-direction: row;
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-steps__column-container {
|
|
||||||
/* #ifndef APP-NVUE */
|
|
||||||
display: inline-flex;
|
|
||||||
/* #endif */
|
|
||||||
width: 30px;
|
|
||||||
flex-direction: column;
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-steps__row-line-item {
|
|
||||||
/* #ifndef APP-NVUE */
|
|
||||||
display: inline-flex;
|
|
||||||
/* #endif */
|
|
||||||
flex-direction: row;
|
|
||||||
flex: 1;
|
|
||||||
height: 14px;
|
|
||||||
line-height: 14px;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
position: relative;
|
|
||||||
.address{
|
|
||||||
position: absolute;
|
|
||||||
top: 40rpx;
|
|
||||||
left: 60rpx;
|
|
||||||
color: #999;
|
|
||||||
font-size: 24rpx;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-steps__column-line-item {
|
|
||||||
/* #ifndef APP-NVUE */
|
|
||||||
display: flex;
|
|
||||||
/* #endif */
|
|
||||||
flex-direction: column;
|
|
||||||
flex: 1;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-steps__row-line {
|
|
||||||
flex: 1;
|
|
||||||
height: 1px;
|
|
||||||
background-color: $uni-text-color-grey;
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-steps__column-line {
|
|
||||||
width: 1px;
|
|
||||||
background-color: $uni-text-color-grey;
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-steps__row-line--after {
|
|
||||||
transform: translateX(1px);
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-steps__column-line--after {
|
|
||||||
flex: 1;
|
|
||||||
transform: translate(0px, 1px);
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-steps__row-line--before {
|
|
||||||
transform: translateX(-1px);
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-steps__column-line--before {
|
|
||||||
height: 6px;
|
|
||||||
transform: translate(0px, -1px);
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-steps__row-circle {
|
|
||||||
width: 5px;
|
|
||||||
height: 5px;
|
|
||||||
border-radius: 100px;
|
|
||||||
background-color: $uni-text-color-grey;
|
|
||||||
margin: 0px 3px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-steps__column-circle {
|
|
||||||
width: 5px;
|
|
||||||
height: 5px;
|
|
||||||
border-radius: 100px;
|
|
||||||
background-color: $uni-text-color-grey;
|
|
||||||
margin: 4px 0px 5px 0px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-steps__row-check {
|
|
||||||
margin: 0px 6px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-steps__column-check {
|
|
||||||
height: 14px;
|
|
||||||
line-height: 14px;
|
|
||||||
margin: 2px 0px;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -1,184 +0,0 @@
|
|||||||
<template>
|
|
||||||
<view class="uni-swiper__warp">
|
|
||||||
<slot />
|
|
||||||
<view v-if="mode === 'default'" :style="{'bottom':dots.bottom + 'px'}" class="uni-swiper__dots-box" key='default'>
|
|
||||||
<view v-for="(item,index) in info" :style="{
|
|
||||||
'width': (index === current? dots.width*2:dots.width ) + 'px','height':dots.width/3 +'px' ,'background-color':index !== current?dots.backgroundColor:dots.selectedBackgroundColor,'border-radius':'0px'}"
|
|
||||||
:key="index" class="uni-swiper__dots-item uni-swiper__dots-bar" />
|
|
||||||
</view>
|
|
||||||
<view v-if="mode === 'dot'" :style="{'bottom':dots.bottom + 'px'}" class="uni-swiper__dots-box" key='dot'>
|
|
||||||
<view v-for="(item,index) in info" :style="{
|
|
||||||
'width': dots.width + 'px','height':dots.height +'px' ,'background-color':index !== current?dots.backgroundColor:dots.selectedBackgroundColor,'border':index !==current ? dots.border:dots.selectedBorder}"
|
|
||||||
:key="index" class="uni-swiper__dots-item" />
|
|
||||||
</view>
|
|
||||||
<view v-if="mode === 'round'" :style="{'bottom':dots.bottom + 'px'}" class="uni-swiper__dots-box" key='round'>
|
|
||||||
<view v-for="(item,index) in info" :class="[index === current&&'uni-swiper__dots-long']" :style="{
|
|
||||||
'width':(index === current? dots.width*3:dots.width ) + 'px','height':dots.height +'px' ,'background-color':index !== current?dots.backgroundColor:dots.selectedBackgroundColor,'border':index !==current ? dots.border:dots.selectedBorder}"
|
|
||||||
:key="index" class="uni-swiper__dots-item " />
|
|
||||||
</view>
|
|
||||||
<view v-if="mode === 'nav'" key='nav' :style="{'background-color':dotsStyles.backgroundColor,'bottom':'0'}" class="uni-swiper__dots-box uni-swiper__dots-nav">
|
|
||||||
<text :style="{'color':dotsStyles.color}" class="uni-swiper__dots-nav-item">{{ (current+1)+"/"+info.length +' ' +info[current][field] }}</text>
|
|
||||||
</view>
|
|
||||||
<view v-if="mode === 'indexes'" key='indexes' :style="{'bottom':dots.bottom + 'px'}" class="uni-swiper__dots-box">
|
|
||||||
<view v-for="(item,index) in info" :style="{
|
|
||||||
'width':dots.width + 'px','height':dots.height +'px' ,'color':index === current?dots.selectedColor:dots.color,'background-color':index !== current?dots.backgroundColor:dots.selectedBackgroundColor,'border':index !==current ? dots.border:dots.selectedBorder}"
|
|
||||||
:key="index" class="uni-swiper__dots-item uni-swiper__dots-indexes"><text class="uni-swiper__dots-indexes-text">{{ index+1 }}</text></view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
export default {
|
|
||||||
name: 'UniSwiperDot',
|
|
||||||
props: {
|
|
||||||
info: {
|
|
||||||
type: Array,
|
|
||||||
default () {
|
|
||||||
return []
|
|
||||||
}
|
|
||||||
},
|
|
||||||
current: {
|
|
||||||
type: Number,
|
|
||||||
default: 0
|
|
||||||
},
|
|
||||||
dotsStyles: {
|
|
||||||
type: Object,
|
|
||||||
default () {
|
|
||||||
return {}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
// 类型 :default(默认) indexes long nav
|
|
||||||
mode: {
|
|
||||||
type: String,
|
|
||||||
default: 'default'
|
|
||||||
},
|
|
||||||
// 只在 nav 模式下生效,变量名称
|
|
||||||
field: {
|
|
||||||
type: String,
|
|
||||||
default: ''
|
|
||||||
}
|
|
||||||
},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
dots: {
|
|
||||||
width: 8,
|
|
||||||
height: 8,
|
|
||||||
bottom: 10,
|
|
||||||
color: '#fff',
|
|
||||||
backgroundColor: 'rgba(0, 0, 0, .3)',
|
|
||||||
border: '1px rgba(0, 0, 0, .3) solid',
|
|
||||||
selectedBackgroundColor: '#333',
|
|
||||||
selectedBorder: '1px rgba(0, 0, 0, .9) solid'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
watch: {
|
|
||||||
dotsStyles(newVal) {
|
|
||||||
this.dots = Object.assign(this.dots, this.dotsStyles)
|
|
||||||
},
|
|
||||||
mode(newVal) {
|
|
||||||
if (newVal === 'indexes') {
|
|
||||||
this.dots.width = 20
|
|
||||||
this.dots.height = 20
|
|
||||||
} else {
|
|
||||||
this.dots.width = 8
|
|
||||||
this.dots.height = 8
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
},
|
|
||||||
created() {
|
|
||||||
if (this.mode === 'indexes') {
|
|
||||||
this.dots.width = 20
|
|
||||||
this.dots.height = 20
|
|
||||||
}
|
|
||||||
this.dots = Object.assign(this.dots, this.dotsStyles)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
.uni-swiper__warp {
|
|
||||||
/* #ifndef APP-NVUE */
|
|
||||||
display: flex;
|
|
||||||
/* #endif */
|
|
||||||
flex: 1;
|
|
||||||
flex-direction: column;
|
|
||||||
position: relative;
|
|
||||||
overflow: hidden;
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-swiper__dots-box {
|
|
||||||
position: absolute;
|
|
||||||
bottom: 10px;
|
|
||||||
left: 0;
|
|
||||||
right: 0;
|
|
||||||
/* #ifndef APP-NVUE */
|
|
||||||
display: flex;
|
|
||||||
/* #endif */
|
|
||||||
flex: 1;
|
|
||||||
flex-direction: row;
|
|
||||||
justify-content: center;
|
|
||||||
align-items: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-swiper__dots-item {
|
|
||||||
width: 8px;
|
|
||||||
border-radius: 100px;
|
|
||||||
margin-left: 6px;
|
|
||||||
background-color: $uni-bg-color-mask;
|
|
||||||
// transition: width 0.2s linear; 不要取消注释,不然会不能变色
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-swiper__dots-item:first-child {
|
|
||||||
margin: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-swiper__dots-default {
|
|
||||||
border-radius: 100px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-swiper__dots-long {
|
|
||||||
border-radius: 50px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-swiper__dots-bar {
|
|
||||||
border-radius: 50px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-swiper__dots-nav {
|
|
||||||
bottom: 0px;
|
|
||||||
height: 40px;
|
|
||||||
/* #ifndef APP-NVUE */
|
|
||||||
display: flex;
|
|
||||||
/* #endif */
|
|
||||||
flex: 1;
|
|
||||||
flex-direction: row;
|
|
||||||
justify-content: flex-start;
|
|
||||||
align-items: center;
|
|
||||||
background-color: rgba(0, 0, 0, 0.2);
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-swiper__dots-nav-item {
|
|
||||||
/* overflow: hidden;
|
|
||||||
text-overflow: ellipsis;
|
|
||||||
white-space: nowrap; */
|
|
||||||
font-size: $uni-font-size-base;
|
|
||||||
color: #fff;
|
|
||||||
margin: 0 15px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-swiper__dots-indexes {
|
|
||||||
/* #ifndef APP-NVUE */
|
|
||||||
display: flex;
|
|
||||||
/* #endif */
|
|
||||||
// flex: 1;
|
|
||||||
justify-content: center;
|
|
||||||
align-items: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-swiper__dots-indexes-text {
|
|
||||||
color: #fff;
|
|
||||||
font-size: $uni-font-size-sm;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -1,230 +0,0 @@
|
|||||||
<template>
|
|
||||||
<view :class="[
|
|
||||||
'uni-tag--' + type,
|
|
||||||
disabled === true || disabled === 'true' ? 'uni-tag--disabled' : '',
|
|
||||||
inverted === true || inverted === 'true' ? type + '-uni-tag--inverted' : '',
|
|
||||||
circle === true || circle === 'true' ? 'uni-tag--circle' : '',
|
|
||||||
mark === true || mark === 'true' ? 'uni-tag--mark' : '',
|
|
||||||
'uni-tag--' + size
|
|
||||||
]"
|
|
||||||
@click="onClick()" class="uni-tag" v-if="text">
|
|
||||||
<text :class="[type === 'default' ? 'uni-tag--default':'uni-tag-text',inverted === true || inverted === 'true' ? 'uni-tag-text--'+type : '',size === 'small' ? 'uni-tag-text--small':'' ]">{{ text }}</text>
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
/**
|
|
||||||
* Tag 标签
|
|
||||||
* @description 用于展示1个或多个文字标签,可点击切换选中、不选中的状态
|
|
||||||
* @tutorial https://ext.dcloud.net.cn/plugin?id=35
|
|
||||||
* @property {String} text 标签内容
|
|
||||||
* @property {String} size = [normal|small] 大小尺寸
|
|
||||||
* @value normal 正常
|
|
||||||
* @value small 小尺寸
|
|
||||||
* @property {String} type = [default|primary|success|warning|error|royal] 颜色类型
|
|
||||||
* @value default 灰色
|
|
||||||
* @value primary 蓝色
|
|
||||||
* @value success 绿色
|
|
||||||
* @value warning 黄色
|
|
||||||
* @value error 红色
|
|
||||||
* @value royal 紫色
|
|
||||||
* @property {Boolean} disabled = [true|false] 是否为禁用状态
|
|
||||||
* @property {Boolean} inverted = [true|false] 是否无需背景颜色(空心标签)
|
|
||||||
* @property {Boolean} circle = [true|false] 是否为圆角
|
|
||||||
* @event {Function} click 点击 Tag 触发事件
|
|
||||||
*/
|
|
||||||
|
|
||||||
export default {
|
|
||||||
name: "UniTag",
|
|
||||||
props: {
|
|
||||||
type: {
|
|
||||||
// 标签类型default、primary、success、warning、error、royal
|
|
||||||
type: String,
|
|
||||||
default: "default"
|
|
||||||
},
|
|
||||||
size: {
|
|
||||||
// 标签大小 normal, small
|
|
||||||
type: String,
|
|
||||||
default: "normal"
|
|
||||||
},
|
|
||||||
// 标签内容
|
|
||||||
text: {
|
|
||||||
type: String,
|
|
||||||
default: ""
|
|
||||||
},
|
|
||||||
disabled: {
|
|
||||||
// 是否为禁用状态
|
|
||||||
type: [Boolean, String],
|
|
||||||
default: false
|
|
||||||
},
|
|
||||||
inverted: {
|
|
||||||
// 是否为空心
|
|
||||||
type: [Boolean, String],
|
|
||||||
default: false
|
|
||||||
},
|
|
||||||
circle: {
|
|
||||||
// 是否为圆角样式
|
|
||||||
type: [Boolean, String],
|
|
||||||
default: false
|
|
||||||
},
|
|
||||||
mark: {
|
|
||||||
// 是否为标记样式
|
|
||||||
type: [Boolean, String],
|
|
||||||
default: false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
onClick() {
|
|
||||||
if (this.disabled === true || this.disabled === "true") {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
this.$emit("click");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
$tag-pd: 0px 16px;
|
|
||||||
$tag-small-pd: 0px 8px;
|
|
||||||
|
|
||||||
.uni-tag {
|
|
||||||
/* #ifndef APP-NVUE */
|
|
||||||
display: flex;
|
|
||||||
/* #endif */
|
|
||||||
padding: $tag-pd;
|
|
||||||
height: 30px;
|
|
||||||
line-height: 30px;
|
|
||||||
justify-content: center;
|
|
||||||
color: $uni-text-color;
|
|
||||||
border-radius: $uni-border-radius-base;
|
|
||||||
background-color: $uni-bg-color-grey;
|
|
||||||
border-width: 1rpx;
|
|
||||||
border-style: solid;
|
|
||||||
border-color: $uni-bg-color-grey;
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-tag--circle {
|
|
||||||
border-radius: 15px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-tag--mark {
|
|
||||||
border-top-left-radius: 0;
|
|
||||||
border-bottom-left-radius: 0;
|
|
||||||
border-top-right-radius: 15px;
|
|
||||||
border-bottom-right-radius: 15px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-tag--disabled {
|
|
||||||
opacity: 0.5;
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-tag--small {
|
|
||||||
height: 20px;
|
|
||||||
padding: $tag-small-pd;
|
|
||||||
line-height: 20px;
|
|
||||||
font-size: $uni-font-size-sm;
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-tag--default {
|
|
||||||
color: $uni-text-color;
|
|
||||||
font-size: $uni-font-size-base;
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-tag-text--small {
|
|
||||||
font-size: $uni-font-size-sm !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-tag-text {
|
|
||||||
color: $uni-text-color-inverse;
|
|
||||||
font-size: $uni-font-size-base;
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-tag-text--primary {
|
|
||||||
color: $uni-color-primary !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-tag-text--success {
|
|
||||||
color: $uni-color-success !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-tag-text--warning {
|
|
||||||
color: $uni-color-warning !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-tag-text--error {
|
|
||||||
color: $uni-color-error !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-tag--primary {
|
|
||||||
color: $uni-text-color-inverse;
|
|
||||||
background-color: $uni-color-primary;
|
|
||||||
border-width: 1rpx;
|
|
||||||
border-style: solid;
|
|
||||||
border-color: $uni-color-primary;
|
|
||||||
}
|
|
||||||
|
|
||||||
.primary-uni-tag--inverted {
|
|
||||||
color: $uni-color-primary;
|
|
||||||
background-color: $uni-bg-color;
|
|
||||||
border-width: 1rpx;
|
|
||||||
border-style: solid;
|
|
||||||
border-color: $uni-color-primary;
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-tag--success {
|
|
||||||
color: $uni-text-color-inverse;
|
|
||||||
background-color: $uni-color-success;
|
|
||||||
border-width: 1rpx;
|
|
||||||
border-style: solid;
|
|
||||||
border-color: $uni-color-success;
|
|
||||||
}
|
|
||||||
|
|
||||||
.success-uni-tag--inverted {
|
|
||||||
color: $uni-color-success;
|
|
||||||
background-color: $uni-bg-color;
|
|
||||||
border-width: 1rpx;
|
|
||||||
border-style: solid;
|
|
||||||
border-color: $uni-color-success;
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-tag--warning {
|
|
||||||
color: $uni-text-color-inverse;
|
|
||||||
background-color: $uni-color-warning;
|
|
||||||
border-width: 1rpx;
|
|
||||||
border-style: solid;
|
|
||||||
border-color: $uni-color-warning;
|
|
||||||
}
|
|
||||||
|
|
||||||
.warning-uni-tag--inverted {
|
|
||||||
color: $uni-color-warning;
|
|
||||||
background-color: $uni-bg-color;
|
|
||||||
border-width: 1rpx;
|
|
||||||
border-style: solid;
|
|
||||||
border-color: $uni-color-warning;
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-tag--error {
|
|
||||||
color: $uni-text-color-inverse;
|
|
||||||
background-color: $uni-color-error;
|
|
||||||
border-width: 1rpx;
|
|
||||||
border-style: solid;
|
|
||||||
border-color: $uni-color-error;
|
|
||||||
}
|
|
||||||
|
|
||||||
.error-uni-tag--inverted {
|
|
||||||
color: $uni-color-error;
|
|
||||||
background-color: $uni-bg-color;
|
|
||||||
border-width: 1rpx;
|
|
||||||
border-style: solid;
|
|
||||||
border-color: $uni-color-error;
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-tag--inverted {
|
|
||||||
color: $uni-text-color;
|
|
||||||
background-color: $uni-bg-color;
|
|
||||||
border-width: 1rpx;
|
|
||||||
border-style: solid;
|
|
||||||
border-color: $uni-bg-color-grey;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -1,279 +0,0 @@
|
|||||||
<template>
|
|
||||||
<view v-if="isShow" ref="ani" class="uni-transition" :class="[ani.in]" :style="'transform:' +transform+';'+stylesObject"
|
|
||||||
@click="change">
|
|
||||||
<slot></slot>
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
// #ifdef APP-NVUE
|
|
||||||
const animation = uni.requireNativePlugin('animation');
|
|
||||||
// #endif
|
|
||||||
/**
|
|
||||||
* Transition 过渡动画
|
|
||||||
* @description 简单过渡动画组件
|
|
||||||
* @tutorial https://ext.dcloud.net.cn/plugin?id=985
|
|
||||||
* @property {Boolean} show = [false|true] 控制组件显示或隐藏
|
|
||||||
* @property {Array} modeClass = [fade|slide-top|slide-right|slide-bottom|slide-left|zoom-in|zoom-out] 过渡动画类型
|
|
||||||
* @value fade 渐隐渐出过渡
|
|
||||||
* @value slide-top 由上至下过渡
|
|
||||||
* @value slide-right 由右至左过渡
|
|
||||||
* @value slide-bottom 由下至上过渡
|
|
||||||
* @value slide-left 由左至右过渡
|
|
||||||
* @value zoom-in 由小到大过渡
|
|
||||||
* @value zoom-out 由大到小过渡
|
|
||||||
* @property {Number} duration 过渡动画持续时间
|
|
||||||
* @property {Object} styles 组件样式,同 css 样式,注意带’-‘连接符的属性需要使用小驼峰写法如:`backgroundColor:red`
|
|
||||||
*/
|
|
||||||
export default {
|
|
||||||
name: 'uniTransition',
|
|
||||||
props: {
|
|
||||||
show: {
|
|
||||||
type: Boolean,
|
|
||||||
default: false
|
|
||||||
},
|
|
||||||
modeClass: {
|
|
||||||
type: Array,
|
|
||||||
default () {
|
|
||||||
return []
|
|
||||||
}
|
|
||||||
},
|
|
||||||
duration: {
|
|
||||||
type: Number,
|
|
||||||
default: 300
|
|
||||||
},
|
|
||||||
styles: {
|
|
||||||
type: Object,
|
|
||||||
default () {
|
|
||||||
return {}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
isShow: false,
|
|
||||||
transform: '',
|
|
||||||
ani: { in: '',
|
|
||||||
active: ''
|
|
||||||
}
|
|
||||||
};
|
|
||||||
},
|
|
||||||
watch: {
|
|
||||||
show: {
|
|
||||||
handler(newVal) {
|
|
||||||
if (newVal) {
|
|
||||||
this.open()
|
|
||||||
} else {
|
|
||||||
this.close()
|
|
||||||
}
|
|
||||||
},
|
|
||||||
immediate: true
|
|
||||||
}
|
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
stylesObject() {
|
|
||||||
let styles = {
|
|
||||||
...this.styles,
|
|
||||||
'transition-duration': this.duration / 1000 + 's'
|
|
||||||
}
|
|
||||||
let transfrom = ''
|
|
||||||
for (let i in styles) {
|
|
||||||
let line = this.toLine(i)
|
|
||||||
transfrom += line + ':' + styles[i] + ';'
|
|
||||||
}
|
|
||||||
return transfrom
|
|
||||||
}
|
|
||||||
},
|
|
||||||
created() {
|
|
||||||
// this.timer = null
|
|
||||||
// this.nextTick = (time = 50) => new Promise(resolve => {
|
|
||||||
// clearTimeout(this.timer)
|
|
||||||
// this.timer = setTimeout(resolve, time)
|
|
||||||
// return this.timer
|
|
||||||
// });
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
change() {
|
|
||||||
this.$emit('click', {
|
|
||||||
detail: this.isShow
|
|
||||||
})
|
|
||||||
},
|
|
||||||
open() {
|
|
||||||
clearTimeout(this.timer)
|
|
||||||
this.isShow = true
|
|
||||||
this.transform = ''
|
|
||||||
this.ani.in = ''
|
|
||||||
for (let i in this.getTranfrom(false)) {
|
|
||||||
if (i === 'opacity') {
|
|
||||||
this.ani.in = 'fade-in'
|
|
||||||
} else {
|
|
||||||
this.transform += `${this.getTranfrom(false)[i]} `
|
|
||||||
}
|
|
||||||
}
|
|
||||||
this.$nextTick(() => {
|
|
||||||
setTimeout(() => {
|
|
||||||
this._animation(true)
|
|
||||||
}, 50)
|
|
||||||
})
|
|
||||||
|
|
||||||
},
|
|
||||||
close(type) {
|
|
||||||
clearTimeout(this.timer)
|
|
||||||
this._animation(false)
|
|
||||||
},
|
|
||||||
_animation(type) {
|
|
||||||
let styles = this.getTranfrom(type)
|
|
||||||
// #ifdef APP-NVUE
|
|
||||||
if(!this.$refs['ani']) return
|
|
||||||
animation.transition(this.$refs['ani'].ref, {
|
|
||||||
styles,
|
|
||||||
duration: this.duration, //ms
|
|
||||||
timingFunction: 'ease',
|
|
||||||
needLayout: false,
|
|
||||||
delay: 0 //ms
|
|
||||||
}, () => {
|
|
||||||
if (!type) {
|
|
||||||
this.isShow = false
|
|
||||||
}
|
|
||||||
this.$emit('change', {
|
|
||||||
detail: this.isShow
|
|
||||||
})
|
|
||||||
})
|
|
||||||
// #endif
|
|
||||||
// #ifndef APP-NVUE
|
|
||||||
this.transform = ''
|
|
||||||
for (let i in styles) {
|
|
||||||
if (i === 'opacity') {
|
|
||||||
this.ani.in = `fade-${type?'out':'in'}`
|
|
||||||
} else {
|
|
||||||
this.transform += `${styles[i]} `
|
|
||||||
}
|
|
||||||
}
|
|
||||||
this.timer = setTimeout(() => {
|
|
||||||
if (!type) {
|
|
||||||
this.isShow = false
|
|
||||||
}
|
|
||||||
this.$emit('change', {
|
|
||||||
detail: this.isShow
|
|
||||||
})
|
|
||||||
|
|
||||||
}, this.duration)
|
|
||||||
// #endif
|
|
||||||
|
|
||||||
},
|
|
||||||
getTranfrom(type) {
|
|
||||||
let styles = {
|
|
||||||
transform: ''
|
|
||||||
}
|
|
||||||
this.modeClass.forEach((mode) => {
|
|
||||||
switch (mode) {
|
|
||||||
case 'fade':
|
|
||||||
styles.opacity = type ? 1 : 0
|
|
||||||
break;
|
|
||||||
case 'slide-top':
|
|
||||||
styles.transform += `translateY(${type?'0':'-100%'}) `
|
|
||||||
break;
|
|
||||||
case 'slide-right':
|
|
||||||
styles.transform += `translateX(${type?'0':'100%'}) `
|
|
||||||
break;
|
|
||||||
case 'slide-bottom':
|
|
||||||
styles.transform += `translateY(${type?'0':'100%'}) `
|
|
||||||
break;
|
|
||||||
case 'slide-left':
|
|
||||||
styles.transform += `translateX(${type?'0':'-100%'}) `
|
|
||||||
break;
|
|
||||||
case 'zoom-in':
|
|
||||||
styles.transform += `scale(${type?1:0.8}) `
|
|
||||||
break;
|
|
||||||
case 'zoom-out':
|
|
||||||
styles.transform += `scale(${type?1:1.2}) `
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
})
|
|
||||||
return styles
|
|
||||||
},
|
|
||||||
_modeClassArr(type) {
|
|
||||||
let mode = this.modeClass
|
|
||||||
if (typeof(mode) !== "string") {
|
|
||||||
let modestr = ''
|
|
||||||
mode.forEach((item) => {
|
|
||||||
modestr += (item + '-' + type + ',')
|
|
||||||
})
|
|
||||||
return modestr.substr(0, modestr.length - 1)
|
|
||||||
} else {
|
|
||||||
return mode + '-' + type
|
|
||||||
}
|
|
||||||
},
|
|
||||||
// getEl(el) {
|
|
||||||
// console.log(el || el.ref || null);
|
|
||||||
// return el || el.ref || null
|
|
||||||
// },
|
|
||||||
toLine(name) {
|
|
||||||
return name.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style>
|
|
||||||
.uni-transition {
|
|
||||||
transition-timing-function: ease;
|
|
||||||
transition-duration: 0.3s;
|
|
||||||
transition-property: transform, opacity;
|
|
||||||
}
|
|
||||||
|
|
||||||
.fade-in {
|
|
||||||
opacity: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.fade-active {
|
|
||||||
opacity: 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
.slide-top-in {
|
|
||||||
/* transition-property: transform, opacity; */
|
|
||||||
transform: translateY(-100%);
|
|
||||||
}
|
|
||||||
|
|
||||||
.slide-top-active {
|
|
||||||
transform: translateY(0);
|
|
||||||
/* opacity: 1; */
|
|
||||||
}
|
|
||||||
|
|
||||||
.slide-right-in {
|
|
||||||
transform: translateX(100%);
|
|
||||||
}
|
|
||||||
|
|
||||||
.slide-right-active {
|
|
||||||
transform: translateX(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
.slide-bottom-in {
|
|
||||||
transform: translateY(100%);
|
|
||||||
}
|
|
||||||
|
|
||||||
.slide-bottom-active {
|
|
||||||
transform: translateY(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
.slide-left-in {
|
|
||||||
transform: translateX(-100%);
|
|
||||||
}
|
|
||||||
|
|
||||||
.slide-left-active {
|
|
||||||
transform: translateX(0);
|
|
||||||
opacity: 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
.zoom-in-in {
|
|
||||||
transform: scale(0.8);
|
|
||||||
}
|
|
||||||
|
|
||||||
.zoom-out-active {
|
|
||||||
transform: scale(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
.zoom-out-in {
|
|
||||||
transform: scale(1.2);
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -49,38 +49,14 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<!-- <view
|
|
||||||
@click="hide"
|
|
||||||
v-show="flage"
|
|
||||||
class="flex-row-around"
|
|
||||||
style="border-radius: 10rpx; background-color: #ebebeb"
|
|
||||||
:style="{
|
|
||||||
width: width,
|
|
||||||
height: height,
|
|
||||||
'margin-left': left,
|
|
||||||
'margin-top': top,
|
|
||||||
}"
|
|
||||||
:class="vsr ? 'border-index' : ''"
|
|
||||||
>
|
|
||||||
<view class="flex-row-center" style="width: 45rpx; height: 45rpx">
|
|
||||||
<view v-show="!vsr" class="dh-wt"> </view>
|
|
||||||
<view
|
|
||||||
v-show="vsr"
|
|
||||||
class="cuIcon-roundcheck"
|
|
||||||
style="font-size: 45rpx; color: #07c160"
|
|
||||||
>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<text :class="vsr ? 'ttcl' : ''" style="color: #5a5a5a">{{ vsrtx }}</text>
|
|
||||||
<view class="cuIcon-safe text-gray"> </view>
|
|
||||||
</view> -->
|
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import api from "@/config/api.js";
|
import api from "@/config/api.js";
|
||||||
import storage from "@/utils/storage.js";
|
import storage from "@/utils/storage.js";
|
||||||
|
import uuid from "@/utils/uuid.modified.js";
|
||||||
const phone = uni.getSystemInfoSync();
|
const phone = uni.getSystemInfoSync();
|
||||||
const l = phone.screenWidth / 750;
|
const l = phone.screenWidth / 750;
|
||||||
export default {
|
export default {
|
||||||
@@ -89,12 +65,6 @@ export default {
|
|||||||
// 可自行调整
|
// 可自行调整
|
||||||
this.scHight = phone.screenHeight / 2 - 200 + "px";
|
this.scHight = phone.screenHeight / 2 - 200 + "px";
|
||||||
this.getCode();
|
this.getCode();
|
||||||
// 监听是否要重新验证
|
|
||||||
uni.$on("vert", (data) => {
|
|
||||||
this.vsr = data;
|
|
||||||
this.vsrtx = "点击进行验证";
|
|
||||||
this.getCode();
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
height: {
|
height: {
|
||||||
@@ -160,10 +130,19 @@ export default {
|
|||||||
this.hid = !this.hid;
|
this.hid = !this.hid;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
error() {
|
||||||
|
this.vsr = false;
|
||||||
|
this.hid = false;
|
||||||
|
this.moveX = 0;
|
||||||
|
this.moveCode = 0;
|
||||||
|
},
|
||||||
// 获取验证图片
|
// 获取验证图片
|
||||||
getCode() {
|
getCode() {
|
||||||
this.col = "#b3afae";
|
this.col = "#b3afae";
|
||||||
this.hasImg = "图片加载中...";
|
this.hasImg = "图片加载中...";
|
||||||
|
if (!storage.getUuid()) {
|
||||||
|
storage.setUuid(uuid.v1());
|
||||||
|
}
|
||||||
uni.request({
|
uni.request({
|
||||||
url: api.common + "/slider/" + this.business,
|
url: api.common + "/slider/" + this.business,
|
||||||
header: {
|
header: {
|
||||||
@@ -209,13 +188,12 @@ export default {
|
|||||||
},
|
},
|
||||||
success: (res) => {
|
success: (res) => {
|
||||||
this.endLoad = true;
|
this.endLoad = true;
|
||||||
|
|
||||||
res.data.result == false
|
res.data.result == false
|
||||||
? (res.data.result = false)
|
? (res.data.result = false)
|
||||||
: (res.data.result = true);
|
: (res.data.result = true);
|
||||||
|
|
||||||
if (res.data && res.data.result) {
|
if (res.data && res.data.result) {
|
||||||
// // 验证成功后把key发送出去,后端会把验证信息存在缓存里
|
//验证成功后把key发送出去,后端会把验证信息存在缓存里
|
||||||
this.$emit("send", this.key);
|
this.$emit("send", this.key);
|
||||||
this.hide();
|
this.hide();
|
||||||
this.vsr = true;
|
this.vsr = true;
|
||||||
@@ -336,30 +314,6 @@ export default {
|
|||||||
width: 750rpx;
|
width: 750rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.border-bom {
|
|
||||||
border-bottom: 0.5rpx solid #dddddd;
|
|
||||||
}
|
|
||||||
|
|
||||||
.border-red {
|
|
||||||
border-bottom: 1rpx solid #d33e18;
|
|
||||||
}
|
|
||||||
|
|
||||||
.border-bom-big {
|
|
||||||
border-bottom: 8rpx solid #dddddd;
|
|
||||||
}
|
|
||||||
|
|
||||||
.border-bom-white {
|
|
||||||
border-bottom: 2rpx solid #ffffff;
|
|
||||||
}
|
|
||||||
|
|
||||||
.border-bom-green {
|
|
||||||
border-bottom: 4rpx solid #f8f9bd;
|
|
||||||
}
|
|
||||||
|
|
||||||
.border-bom-index {
|
|
||||||
border-bottom: 4rpx solid #27d9b3;
|
|
||||||
}
|
|
||||||
|
|
||||||
.padding-left {
|
.padding-left {
|
||||||
padding-left: 20rpx;
|
padding-left: 20rpx;
|
||||||
}
|
}
|
||||||
@@ -389,33 +343,6 @@ export default {
|
|||||||
margin-top: -35rpx;
|
margin-top: -35rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.lk-tag {
|
|
||||||
height: 50rpx;
|
|
||||||
padding: 0 10rpx;
|
|
||||||
display: flex;
|
|
||||||
justify-content: center;
|
|
||||||
align-items: center;
|
|
||||||
border: 2rpx solid #24bd9f;
|
|
||||||
border-radius: 6rpx;
|
|
||||||
color: #1c947a;
|
|
||||||
font-weight: 500;
|
|
||||||
}
|
|
||||||
|
|
||||||
.tb-tag-my {
|
|
||||||
border-radius: 15rpx;
|
|
||||||
font-size: 16rpx;
|
|
||||||
margin-left: 5rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.my-green {
|
|
||||||
color: #29c7a5;
|
|
||||||
}
|
|
||||||
|
|
||||||
.my-hui {
|
|
||||||
color: #585858;
|
|
||||||
font-size: 22rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.flex-column-center {
|
.flex-column-center {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
@@ -524,76 +451,10 @@ export default {
|
|||||||
bottom: 70rpx;
|
bottom: 70rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.white-box {
|
|
||||||
padding: 0 20rpx;
|
|
||||||
margin-bottom: 15rpx;
|
|
||||||
margin-top: 5rpx;
|
|
||||||
width: 715rpx;
|
|
||||||
background-color: #ffffff;
|
|
||||||
border-radius: 30rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.green-box {
|
|
||||||
padding: 0 20rpx;
|
|
||||||
margin-bottom: 15rpx;
|
|
||||||
margin-top: 5rpx;
|
|
||||||
width: 715rpx;
|
|
||||||
background-color: #ffffff;
|
|
||||||
border-radius: 30rpx;
|
|
||||||
background-image: linear-gradient(#1faf97, #29c7a5);
|
|
||||||
}
|
|
||||||
|
|
||||||
.yuan-sm {
|
|
||||||
width: 13rpx;
|
|
||||||
height: 13rpx;
|
|
||||||
border-radius: 50%;
|
|
||||||
background-color: #1fc189;
|
|
||||||
margin-left: 10rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.yuan-normal {
|
|
||||||
width: 14rpx;
|
|
||||||
height: 14rpx;
|
|
||||||
border-radius: 50%;
|
|
||||||
background-color: #159f3c;
|
|
||||||
margin-left: 10rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.yuan-normal-red {
|
|
||||||
width: 14rpx;
|
|
||||||
height: 14rpx;
|
|
||||||
border-radius: 50%;
|
|
||||||
background-color: #bc3c11;
|
|
||||||
margin-left: 10rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.yuan-sm-red {
|
|
||||||
width: 13rpx;
|
|
||||||
height: 13rpx;
|
|
||||||
border-radius: 50%;
|
|
||||||
background-color: #de410d;
|
|
||||||
margin-left: 10rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.white-box-all {
|
|
||||||
margin-top: 5rpx;
|
|
||||||
width: 750rpx;
|
|
||||||
background-color: #ffffff;
|
|
||||||
border-radius: 13px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.moneycolor {
|
.moneycolor {
|
||||||
color: #ea5002;
|
color: #ea5002;
|
||||||
}
|
}
|
||||||
|
|
||||||
.text-bold-sm {
|
|
||||||
font-weight: 425;
|
|
||||||
}
|
|
||||||
|
|
||||||
.sm-moneycolor {
|
|
||||||
color: #e3793b;
|
|
||||||
}
|
|
||||||
|
|
||||||
.margin-top {
|
.margin-top {
|
||||||
margin-top: 20rpx;
|
margin-top: 20rpx;
|
||||||
}
|
}
|
||||||
@@ -610,72 +471,10 @@ export default {
|
|||||||
margin-left: 20rpx;
|
margin-left: 20rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.margin-left-top {
|
|
||||||
margin-left: 20rpx;
|
|
||||||
margin-top: 20rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.margin-right {
|
.margin-right {
|
||||||
margin-right: 20rpx;
|
margin-right: 20rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.my-absolute {
|
|
||||||
position: absolute;
|
|
||||||
}
|
|
||||||
|
|
||||||
.my-fixed {
|
|
||||||
position: fixed;
|
|
||||||
}
|
|
||||||
|
|
||||||
.my-seach {
|
|
||||||
width: 450rpx;
|
|
||||||
height: 55rpx;
|
|
||||||
background-color: #f8f8f8;
|
|
||||||
border-radius: 30rpx;
|
|
||||||
padding-left: 20rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.move-view {
|
|
||||||
width: 48rpx;
|
|
||||||
height: 10rpx;
|
|
||||||
background-color: #28ba91;
|
|
||||||
border-radius: 4rpx;
|
|
||||||
margin-left: 100rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.move-view-p {
|
|
||||||
width: 45rpx;
|
|
||||||
height: 10rpx;
|
|
||||||
background-color: #28ba91;
|
|
||||||
border-radius: 4rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.header-dh {
|
|
||||||
position: fixed;
|
|
||||||
padding-top: 20rpx;
|
|
||||||
padding-bottom: 15rpx;
|
|
||||||
height: 70rpx;
|
|
||||||
width: 750rpx;
|
|
||||||
background-color: #f1f1f1;
|
|
||||||
z-index: 20;
|
|
||||||
}
|
|
||||||
|
|
||||||
.tp-normal {
|
|
||||||
width: 60rpx;
|
|
||||||
height: 60rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.tp-sm {
|
|
||||||
width: 45rpx;
|
|
||||||
height: 45rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.tp-big {
|
|
||||||
width: 70rpx;
|
|
||||||
height: 70rpx;
|
|
||||||
border-radius: 50%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.main-color {
|
.main-color {
|
||||||
color: #07d188;
|
color: #07d188;
|
||||||
}
|
}
|
||||||
|
|||||||
278
components/verify-code/verify-code.vue
Normal file
278
components/verify-code/verify-code.vue
Normal file
@@ -0,0 +1,278 @@
|
|||||||
|
<template>
|
||||||
|
<view class="xt__verify-code">
|
||||||
|
<!-- 输入框 -->
|
||||||
|
<input
|
||||||
|
id="xt__input"
|
||||||
|
:value="code"
|
||||||
|
class="xt__input"
|
||||||
|
:focus="isFocus"
|
||||||
|
:password="isPassword"
|
||||||
|
:type="inputType"
|
||||||
|
:maxlength="size"
|
||||||
|
@input="input"
|
||||||
|
@focus="inputFocus"
|
||||||
|
@blur="inputBlur"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<!-- 光标 -->
|
||||||
|
<view
|
||||||
|
id="xt__cursor"
|
||||||
|
v-if="cursorVisible && type !== 'middle'"
|
||||||
|
class="xt__cursor"
|
||||||
|
:style="{ left: codeCursorLeft[code.length] + 'px', height: cursorHeight + 'px', backgroundColor: cursorColor }"
|
||||||
|
></view>
|
||||||
|
|
||||||
|
<!-- 输入框 - 组 -->
|
||||||
|
<view id="xt__input-ground" class="xt__input-ground">
|
||||||
|
<template v-for="(item, index) in size">
|
||||||
|
<view
|
||||||
|
:key="index"
|
||||||
|
:style="{ borderColor: code.length === index && cursorVisible ? boxActiveColor : boxNormalColor }"
|
||||||
|
:class="['xt__box', `xt__box-${type + ''}`, `xt__box::after`]"
|
||||||
|
>
|
||||||
|
<view :style="{ borderColor: boxActiveColor }" class="xt__middle-line" v-if="type === 'middle' && !code[index]"></view>
|
||||||
|
<text class="xt__code-text">{{ code[index] | codeFormat(isPassword) }}</text>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
/**
|
||||||
|
* @description 输入验证码组件
|
||||||
|
* @property {string} type = [box|middle|bottom] - 显示类型 默认:box -eg:bottom
|
||||||
|
* @property {string} inputType = [text|number] - 输入框类型 默认:number -eg:number
|
||||||
|
* @property {number} size = [4|6] - 支持的验证码数量 默认:6 -eg:6
|
||||||
|
* @property {boolean} isFocus - 是否立即聚焦 默认:true
|
||||||
|
* @property {boolean} isPassword - 是否以密码形式显示 默认false -eg:false
|
||||||
|
* @property {string} cursorColor - 光标颜色 默认:#cccccc
|
||||||
|
* @property {string} boxNormalColor - 光标未聚焦到的框的颜色 默认:#cccccc
|
||||||
|
* @property {string} boxActiveColor - 光标聚焦到的框的颜色 默认:#000000
|
||||||
|
* @event {Function(data)} confirm - 输入完成
|
||||||
|
*/
|
||||||
|
export default {
|
||||||
|
name: 'xt-verify-code',
|
||||||
|
props: {
|
||||||
|
value: {
|
||||||
|
type: String,
|
||||||
|
default: () => ''
|
||||||
|
},
|
||||||
|
type: {
|
||||||
|
type: String,
|
||||||
|
default: () => 'box'
|
||||||
|
},
|
||||||
|
inputType: {
|
||||||
|
type: String,
|
||||||
|
default: () => 'number'
|
||||||
|
},
|
||||||
|
size: {
|
||||||
|
type: Number,
|
||||||
|
default: () => 6
|
||||||
|
},
|
||||||
|
isFocus: {
|
||||||
|
type: Boolean,
|
||||||
|
default: () => true
|
||||||
|
},
|
||||||
|
isPassword: {
|
||||||
|
type: Boolean,
|
||||||
|
default: () => false
|
||||||
|
},
|
||||||
|
cursorColor: {
|
||||||
|
type: String,
|
||||||
|
default: () => '#cccccc'
|
||||||
|
},
|
||||||
|
boxNormalColor: {
|
||||||
|
type: String,
|
||||||
|
default: () => '#cccccc'
|
||||||
|
},
|
||||||
|
boxActiveColor: {
|
||||||
|
type: String,
|
||||||
|
default: () => '#000000'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
model: {
|
||||||
|
prop: 'value',
|
||||||
|
event: 'input'
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
cursorVisible: false,
|
||||||
|
cursorHeight: 35,
|
||||||
|
code: '', // 输入的验证码
|
||||||
|
codeCursorLeft: [] // 向左移动的距离数组
|
||||||
|
};
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.cursorVisible = this.isFocus;
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.init();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
/**
|
||||||
|
* @description 初始化
|
||||||
|
*/
|
||||||
|
init() {
|
||||||
|
this.getCodeCursorLeft();
|
||||||
|
this.setCursorHeight();
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* @description 获取元素节点
|
||||||
|
* @param {string} elm - 节点的id、class 相当于 document.querySelect的参数 -eg: #id
|
||||||
|
* @param {string} type = [single|array] - 单个元素获取多个元素 默认是单个元素
|
||||||
|
* @param {Function} callback - 回调函数
|
||||||
|
*/
|
||||||
|
getElement(elm, type = 'single', callback) {
|
||||||
|
uni
|
||||||
|
.createSelectorQuery()
|
||||||
|
.in(this)
|
||||||
|
[type === 'array' ? 'selectAll' : 'select'](elm)
|
||||||
|
.boundingClientRect()
|
||||||
|
.exec(data => {
|
||||||
|
callback(data[0]);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* @description 计算光标的高度
|
||||||
|
*/
|
||||||
|
setCursorHeight() {
|
||||||
|
this.getElement('.xt__box', 'single', boxElm => {
|
||||||
|
this.cursorHeight = boxElm.height * 0.6;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* @description 获取光标在每一个box的left位置
|
||||||
|
*/
|
||||||
|
getCodeCursorLeft() {
|
||||||
|
// 获取父级框的位置信息
|
||||||
|
this.getElement('#xt__input-ground', 'single', parentElm => {
|
||||||
|
const parentLeft = parentElm.left;
|
||||||
|
// 获取各个box信息
|
||||||
|
this.getElement('.xt__box', 'array', elms => {
|
||||||
|
this.codeCursorLeft = [];
|
||||||
|
elms.forEach(elm => {
|
||||||
|
this.codeCursorLeft.push(elm.left - parentLeft + elm.width / 2);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
// 输入框输入变化的回调
|
||||||
|
input(e) {
|
||||||
|
const value = e.detail.value;
|
||||||
|
this.cursorVisible = value.length !== this.size;
|
||||||
|
this.$emit('input', value);
|
||||||
|
this.inputSuccess(value);
|
||||||
|
},
|
||||||
|
|
||||||
|
// 输入完成回调
|
||||||
|
inputSuccess(value) {
|
||||||
|
if (value.length === this.size) {
|
||||||
|
this.$emit('confirm', value);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 输入聚焦
|
||||||
|
inputFocus() {
|
||||||
|
this.cursorVisible = this.code.length !== this.size;
|
||||||
|
},
|
||||||
|
// 输入失去焦点
|
||||||
|
inputBlur() {
|
||||||
|
this.cursorVisible = false;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
value(val) {
|
||||||
|
this.code = val;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
filters: {
|
||||||
|
codeFormat(val, isPassword) {
|
||||||
|
let value = '';
|
||||||
|
if (val) {
|
||||||
|
value = isPassword ? '*' : val;
|
||||||
|
}
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.xt__verify-code {
|
||||||
|
position: relative;
|
||||||
|
width: 100%;
|
||||||
|
box-sizing: border-box;
|
||||||
|
|
||||||
|
.xt__input {
|
||||||
|
height: 100%;
|
||||||
|
width: 200%;
|
||||||
|
position: absolute;
|
||||||
|
left: -100%;
|
||||||
|
z-index: 1;
|
||||||
|
}
|
||||||
|
.xt__cursor {
|
||||||
|
position: absolute;
|
||||||
|
top: 50%;
|
||||||
|
transform: translateY(-50%);
|
||||||
|
display: inline-block;
|
||||||
|
width: 2px;
|
||||||
|
animation-name: cursor;
|
||||||
|
animation-duration: 0.8s;
|
||||||
|
animation-iteration-count: infinite;
|
||||||
|
}
|
||||||
|
|
||||||
|
.xt__input-ground {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
width: 100%;
|
||||||
|
box-sizing: border-box;
|
||||||
|
.xt__box {
|
||||||
|
position: relative;
|
||||||
|
display: inline-block;
|
||||||
|
width: 76rpx;
|
||||||
|
height: 112rpx;
|
||||||
|
&-bottom {
|
||||||
|
border-bottom-width: 2px;
|
||||||
|
border-bottom-style: solid;
|
||||||
|
}
|
||||||
|
|
||||||
|
&-box {
|
||||||
|
border-width: 2px;
|
||||||
|
border-style: solid;
|
||||||
|
}
|
||||||
|
|
||||||
|
&-middle {
|
||||||
|
border: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.xt__middle-line {
|
||||||
|
position: absolute;
|
||||||
|
top: 50%;
|
||||||
|
left: 50%;
|
||||||
|
width: 50%;
|
||||||
|
transform: translate(-50%, -50%);
|
||||||
|
border-bottom-width: 2px;
|
||||||
|
border-bottom-style: solid;
|
||||||
|
}
|
||||||
|
|
||||||
|
.xt__code-text {
|
||||||
|
position: absolute;
|
||||||
|
top: 50%;
|
||||||
|
left: 50%;
|
||||||
|
font-size:52rpx;
|
||||||
|
transform: translate(-50%, -50%);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes cursor {
|
||||||
|
0% {
|
||||||
|
opacity: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
100% {
|
||||||
|
opacity: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -6,12 +6,12 @@
|
|||||||
const dev = {
|
const dev = {
|
||||||
common: "https://common-api.pickmall.cn",
|
common: "https://common-api.pickmall.cn",
|
||||||
buyer: "https://buyer-api.pickmall.cn",
|
buyer: "https://buyer-api.pickmall.cn",
|
||||||
|
|
||||||
};
|
};
|
||||||
// 生产环境
|
// 生产环境
|
||||||
const prod = {
|
const prod = {
|
||||||
common: "https://common-api.pickmall.cn",
|
common: "https://common-api.pickmall.cn",
|
||||||
buyer: "https://buyer-api.pickmall.cn",
|
buyer: "https://buyer-api.pickmall.cn",
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
//默认生产环境
|
//默认生产环境
|
||||||
@@ -22,7 +22,7 @@ if (process.env.NODE_ENV == "development") {
|
|||||||
} else {
|
} else {
|
||||||
api = prod;
|
api = prod;
|
||||||
}
|
}
|
||||||
//微信小程序,app的打包方式只能是生产环境,所以这块直接条件编译赋值
|
//微信小程序,app的打包方式建议为生产环境,所以这块直接条件编译赋值
|
||||||
// #ifdef MP-WEIXIN || APP-PLUS
|
// #ifdef MP-WEIXIN || APP-PLUS
|
||||||
api = prod;
|
api = prod;
|
||||||
// #endif
|
// #endif
|
||||||
|
|||||||
@@ -1,10 +1,16 @@
|
|||||||
const name = "lilishop";
|
const name = "lilishop"; //全局商城name
|
||||||
|
const schemeName = 'lilishop' //唤醒app需要的schemeName
|
||||||
export default {
|
export default {
|
||||||
name: name,
|
name: name,
|
||||||
schemeLink: `${name}://`, //唤起app地址
|
schemeLink: `${schemeName}://`, //唤起app地址
|
||||||
downloadLink: "https://pickmall.cn/download-page/index.html", //下载地址
|
downloadLink: "https://pickmall.cn/download-page/index.html", //下载地址,下载app的地址
|
||||||
shareLink: "https://m-b2b2c.pickmall.cn", //分享地址
|
shareLink: "https://m-b2b2c.pickmall.cn", //分享地址,也就是在h5中默认的复制地址
|
||||||
appid: "wx6f10f29075dc1b0b", //小程序唯一凭证,即 AppID,可在「微信公众平台 - 设置 - 开发设置」页中获得。(需要已经成为开发者,且帐号没有异常状态)
|
appid: "wx6f10f29075dc1b0b", //小程序唯一凭证,即 AppID,可在「微信公众平台 - 设置 - 开发设置」页中获得。(需要已经成为开发者,且帐号没有异常状态)
|
||||||
appSecret: "6dfbe0c72380dce5d49d65b3c91059b1", //可在 manifest.json 查看
|
appSecret: "6dfbe0c72380dce5d49d65b3c91059b1", //可在 manifest.json 查看
|
||||||
aMapKey: "d649892b3937a5ad20b76dacb2bcb5bd", //在高德中申请web端key
|
aMapKey: "d649892b3937a5ad20b76dacb2bcb5bd", //在高德中申请web端key
|
||||||
};
|
scanAuthNavigation:['https://m-b2b2c.pickmall.cn/'], //扫码认证跳转域名配置 会根据此处配置的路由进行跳转
|
||||||
|
iosAppId:"id1564638363", //AppStore的应用地址id 具体在分享->拷贝链接中查看
|
||||||
|
logo:"https://lilishop-oss.oss-cn-beijing.aliyuncs.com/4c864e133c2944efad1f7282ac8a3b9e.png", //logo地址
|
||||||
|
customerServiceMobile:"13161366885", //客服电话
|
||||||
|
customerServiceEmail:"lili@lili.com" //客服邮箱
|
||||||
|
};
|
||||||
|
|||||||
@@ -1,7 +1,18 @@
|
|||||||
|
/**
|
||||||
|
* 微信小程序支付
|
||||||
|
* 此处针对于微信小程序开发的支付插件
|
||||||
|
* 第一次支付成功后会跳出订阅的消息 如果用户拒绝或同意都会跳转到支付成功页面
|
||||||
|
* 如果点击订阅 会将状态写进缓存 之后不再提醒。
|
||||||
|
*
|
||||||
|
* @param {sn,price}
|
||||||
|
*/
|
||||||
|
|
||||||
import { initiatePay } from "@/api/trade";
|
import { initiatePay } from "@/api/trade";
|
||||||
|
import { getWeChatMpMessage } from "@/api/message.js";
|
||||||
class LiLiWXPay {
|
class LiLiWXPay {
|
||||||
constructor(...payList) {
|
constructor(...payList) {
|
||||||
this.data = payList[0];
|
this.data = payList[0];
|
||||||
|
console.log(payList);
|
||||||
// 调用支付
|
// 调用支付
|
||||||
this.pay = () => {
|
this.pay = () => {
|
||||||
uni.showLoading({
|
uni.showLoading({
|
||||||
@@ -32,13 +43,7 @@ class LiLiWXPay {
|
|||||||
icon: "none",
|
icon: "none",
|
||||||
title: "支付成功!",
|
title: "支付成功!",
|
||||||
});
|
});
|
||||||
// 之后成功后跳转到支付成功页面
|
sendMessage(payList[0].price);
|
||||||
uni.redirectTo({
|
|
||||||
url:
|
|
||||||
"/pages/cart/payment/success?paymentMethod=WECHAT" +
|
|
||||||
"&payPrice=" +
|
|
||||||
this.data.price,
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
fail: (e) => {
|
fail: (e) => {
|
||||||
this.exception = e;
|
this.exception = e;
|
||||||
@@ -59,4 +64,53 @@ class LiLiWXPay {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function sendMessage(price) {
|
||||||
|
//判断用户是否已经进行了订阅
|
||||||
|
if (!uni.getStorageSync("acceptSubscribeMessage")) {
|
||||||
|
//订阅消息
|
||||||
|
getWeChatMpMessage().then((res) => {
|
||||||
|
var message = res.data.result;
|
||||||
|
var templateid = message.map((item) => item.code);
|
||||||
|
uni.requestSubscribeMessage({
|
||||||
|
tmplIds: templateid,
|
||||||
|
success: (res) => {
|
||||||
|
for (let key in res) {
|
||||||
|
// 表示用户拒绝订阅该信息
|
||||||
|
if (res[key] == "reject") {
|
||||||
|
this.checked = false;
|
||||||
|
} else {
|
||||||
|
uni.setStorageSync("acceptSubscribeMessage", res);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
fail: (res) => {
|
||||||
|
uni.removeStorageSync("acceptSubscribeMessage");
|
||||||
|
this.checked = false;
|
||||||
|
},
|
||||||
|
complete: () => {
|
||||||
|
/**
|
||||||
|
* 已经支付成功
|
||||||
|
*/
|
||||||
|
uni.redirectTo({
|
||||||
|
url:
|
||||||
|
"/pages/cart/payment/success?paymentMethod=WECHAT" +
|
||||||
|
"&payPrice=" +
|
||||||
|
price,
|
||||||
|
});
|
||||||
|
},
|
||||||
|
});
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
/**
|
||||||
|
* 已经支付成功
|
||||||
|
*/
|
||||||
|
uni.redirectTo({
|
||||||
|
url:
|
||||||
|
"/pages/cart/payment/success?paymentMethod=WECHAT" +
|
||||||
|
"&payPrice=" +
|
||||||
|
price,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
export default LiLiWXPay;
|
export default LiLiWXPay;
|
||||||
|
|||||||
@@ -1,274 +0,0 @@
|
|||||||
/**
|
|
||||||
* 本模块封装了Android、iOS的应用权限判断、打开应用权限设置界面、以及位置系统服务是否开启
|
|
||||||
*/
|
|
||||||
|
|
||||||
var isIos;
|
|
||||||
// #ifdef APP-PLUS
|
|
||||||
isIos = plus.os.name == "iOS";
|
|
||||||
// #endif
|
|
||||||
|
|
||||||
// 判断推送权限是否开启
|
|
||||||
function judgeIosPermissionPush() {
|
|
||||||
var result = false;
|
|
||||||
var UIApplication = plus.ios.import("UIApplication");
|
|
||||||
var app = UIApplication.sharedApplication();
|
|
||||||
var enabledTypes = 0;
|
|
||||||
if (app.currentUserNotificationSettings) {
|
|
||||||
var settings = app.currentUserNotificationSettings();
|
|
||||||
enabledTypes = settings.plusGetAttribute("types");
|
|
||||||
console.log("enabledTypes1:" + enabledTypes);
|
|
||||||
if (enabledTypes == 0) {
|
|
||||||
console.log("推送权限没有开启");
|
|
||||||
} else {
|
|
||||||
result = true;
|
|
||||||
console.log("已经开启推送功能!");
|
|
||||||
}
|
|
||||||
plus.ios.deleteObject(settings);
|
|
||||||
} else {
|
|
||||||
enabledTypes = app.enabledRemoteNotificationTypes();
|
|
||||||
if (enabledTypes == 0) {
|
|
||||||
console.log("推送权限没有开启!");
|
|
||||||
} else {
|
|
||||||
result = true;
|
|
||||||
console.log("已经开启推送功能!");
|
|
||||||
}
|
|
||||||
console.log("enabledTypes2:" + enabledTypes);
|
|
||||||
}
|
|
||||||
plus.ios.deleteObject(app);
|
|
||||||
plus.ios.deleteObject(UIApplication);
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 判断定位权限是否开启
|
|
||||||
function judgeIosPermissionLocation() {
|
|
||||||
var result = false;
|
|
||||||
var cllocationManger = plus.ios.import("CLLocationManager");
|
|
||||||
var status = cllocationManger.authorizationStatus();
|
|
||||||
result = status != 2;
|
|
||||||
console.log("定位权限开启:" + result);
|
|
||||||
// 以下代码判断了手机设备的定位是否关闭,推荐另行使用方法 checkSystemEnableLocation
|
|
||||||
var enable = cllocationManger.locationServicesEnabled();
|
|
||||||
var status = cllocationManger.authorizationStatus();
|
|
||||||
console.log("enable:" + enable);
|
|
||||||
console.log("status:" + status);
|
|
||||||
if (enable && status != 2) {
|
|
||||||
result = true;
|
|
||||||
console.log("手机定位服务已开启且已授予定位权限");
|
|
||||||
} else {
|
|
||||||
console.log("手机系统的定位没有打开或未给予定位权限");
|
|
||||||
}
|
|
||||||
plus.ios.deleteObject(cllocationManger);
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 判断麦克风权限是否开启
|
|
||||||
function judgeIosPermissionRecord() {
|
|
||||||
var result = false;
|
|
||||||
var avaudiosession = plus.ios.import("AVAudioSession");
|
|
||||||
var avaudio = avaudiosession.sharedInstance();
|
|
||||||
var permissionStatus = avaudio.recordPermission();
|
|
||||||
console.log("permissionStatus:" + permissionStatus);
|
|
||||||
if (permissionStatus == 1684369017 || permissionStatus == 1970168948) {
|
|
||||||
console.log("麦克风权限没有开启");
|
|
||||||
} else {
|
|
||||||
result = true;
|
|
||||||
console.log("麦克风权限已经开启");
|
|
||||||
}
|
|
||||||
plus.ios.deleteObject(avaudiosession);
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 判断相机权限是否开启
|
|
||||||
function judgeIosPermissionCamera() {
|
|
||||||
var result = false;
|
|
||||||
var AVCaptureDevice = plus.ios.import("AVCaptureDevice");
|
|
||||||
var authStatus = AVCaptureDevice.authorizationStatusForMediaType("vide");
|
|
||||||
console.log("authStatus:" + authStatus);
|
|
||||||
if (authStatus == 3) {
|
|
||||||
result = true;
|
|
||||||
console.log("相机权限已经开启");
|
|
||||||
} else {
|
|
||||||
console.log("相机权限没有开启");
|
|
||||||
}
|
|
||||||
plus.ios.deleteObject(AVCaptureDevice);
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 判断相册权限是否开启
|
|
||||||
function judgeIosPermissionPhotoLibrary() {
|
|
||||||
var result = false;
|
|
||||||
var PHPhotoLibrary = plus.ios.import("PHPhotoLibrary");
|
|
||||||
var authStatus = PHPhotoLibrary.authorizationStatus();
|
|
||||||
console.log("authStatus:" + authStatus);
|
|
||||||
if (authStatus == 3) {
|
|
||||||
result = true;
|
|
||||||
console.log("相册权限已经开启");
|
|
||||||
} else {
|
|
||||||
console.log("相册权限没有开启");
|
|
||||||
}
|
|
||||||
plus.ios.deleteObject(PHPhotoLibrary);
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 判断通讯录权限是否开启
|
|
||||||
function judgeIosPermissionContact() {
|
|
||||||
var result = false;
|
|
||||||
var CNContactStore = plus.ios.import("CNContactStore");
|
|
||||||
var cnAuthStatus = CNContactStore.authorizationStatusForEntityType(0);
|
|
||||||
if (cnAuthStatus == 3) {
|
|
||||||
result = true;
|
|
||||||
console.log("通讯录权限已经开启");
|
|
||||||
} else {
|
|
||||||
console.log("通讯录权限没有开启");
|
|
||||||
}
|
|
||||||
plus.ios.deleteObject(CNContactStore);
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 判断日历权限是否开启
|
|
||||||
function judgeIosPermissionCalendar() {
|
|
||||||
var result = false;
|
|
||||||
var EKEventStore = plus.ios.import("EKEventStore");
|
|
||||||
var ekAuthStatus = EKEventStore.authorizationStatusForEntityType(0);
|
|
||||||
if (ekAuthStatus == 3) {
|
|
||||||
result = true;
|
|
||||||
console.log("日历权限已经开启");
|
|
||||||
} else {
|
|
||||||
console.log("日历权限没有开启");
|
|
||||||
}
|
|
||||||
plus.ios.deleteObject(EKEventStore);
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 判断备忘录权限是否开启
|
|
||||||
function judgeIosPermissionMemo() {
|
|
||||||
var result = false;
|
|
||||||
var EKEventStore = plus.ios.import("EKEventStore");
|
|
||||||
var ekAuthStatus = EKEventStore.authorizationStatusForEntityType(1);
|
|
||||||
if (ekAuthStatus == 3) {
|
|
||||||
result = true;
|
|
||||||
console.log("备忘录权限已经开启");
|
|
||||||
} else {
|
|
||||||
console.log("备忘录权限没有开启");
|
|
||||||
}
|
|
||||||
plus.ios.deleteObject(EKEventStore);
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Android权限查询
|
|
||||||
function requestAndroidPermission(permissionID) {
|
|
||||||
return new Promise((resolve, reject) => {
|
|
||||||
plus.android.requestPermissions(
|
|
||||||
[permissionID], // 理论上支持多个权限同时查询,但实际上本函数封装只处理了一个权限的情况。有需要的可自行扩展封装
|
|
||||||
function (resultObj) {
|
|
||||||
var result = 0;
|
|
||||||
for (var i = 0; i < resultObj.granted.length; i++) {
|
|
||||||
var grantedPermission = resultObj.granted[i];
|
|
||||||
console.log("已获取的权限:" + grantedPermission);
|
|
||||||
result = 1;
|
|
||||||
}
|
|
||||||
for (var i = 0; i < resultObj.deniedPresent.length; i++) {
|
|
||||||
var deniedPresentPermission = resultObj.deniedPresent[i];
|
|
||||||
console.log("拒绝本次申请的权限:" + deniedPresentPermission);
|
|
||||||
result = 0;
|
|
||||||
}
|
|
||||||
for (var i = 0; i < resultObj.deniedAlways.length; i++) {
|
|
||||||
var deniedAlwaysPermission = resultObj.deniedAlways[i];
|
|
||||||
console.log("永久拒绝申请的权限:" + deniedAlwaysPermission);
|
|
||||||
result = -1;
|
|
||||||
}
|
|
||||||
resolve(result);
|
|
||||||
// 若所需权限被拒绝,则打开APP设置界面,可以在APP设置界面打开相应权限
|
|
||||||
// if (result != 1) {
|
|
||||||
// gotoAppPermissionSetting()
|
|
||||||
// }
|
|
||||||
},
|
|
||||||
function (error) {
|
|
||||||
console.log("申请权限错误:" + error.code + " = " + error.message);
|
|
||||||
resolve({
|
|
||||||
code: error.code,
|
|
||||||
message: error.message,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
// 使用一个方法,根据参数判断权限
|
|
||||||
function judgeIosPermission(permissionID) {
|
|
||||||
if (permissionID == "location") {
|
|
||||||
return judgeIosPermissionLocation();
|
|
||||||
} else if (permissionID == "camera") {
|
|
||||||
return judgeIosPermissionCamera();
|
|
||||||
} else if (permissionID == "photoLibrary") {
|
|
||||||
return judgeIosPermissionPhotoLibrary();
|
|
||||||
} else if (permissionID == "record") {
|
|
||||||
return judgeIosPermissionRecord();
|
|
||||||
} else if (permissionID == "push") {
|
|
||||||
return judgeIosPermissionPush();
|
|
||||||
} else if (permissionID == "contact") {
|
|
||||||
return judgeIosPermissionContact();
|
|
||||||
} else if (permissionID == "calendar") {
|
|
||||||
return judgeIosPermissionCalendar();
|
|
||||||
} else if (permissionID == "memo") {
|
|
||||||
return judgeIosPermissionMemo();
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 跳转到**应用**的权限页面
|
|
||||||
function gotoAppPermissionSetting() {
|
|
||||||
if (isIos) {
|
|
||||||
var UIApplication = plus.ios.import("UIApplication");
|
|
||||||
var application2 = UIApplication.sharedApplication();
|
|
||||||
var NSURL2 = plus.ios.import("NSURL");
|
|
||||||
// var setting2 = NSURL2.URLWithString("prefs:root=LOCATION_SERVICES");
|
|
||||||
var setting2 = NSURL2.URLWithString("app-settings:");
|
|
||||||
application2.openURL(setting2);
|
|
||||||
|
|
||||||
plus.ios.deleteObject(setting2);
|
|
||||||
plus.ios.deleteObject(NSURL2);
|
|
||||||
plus.ios.deleteObject(application2);
|
|
||||||
} else {
|
|
||||||
// console.log(plus.device.vendor);
|
|
||||||
var Intent = plus.android.importClass("android.content.Intent");
|
|
||||||
var Settings = plus.android.importClass("android.provider.Settings");
|
|
||||||
var Uri = plus.android.importClass("android.net.Uri");
|
|
||||||
var mainActivity = plus.android.runtimeMainActivity();
|
|
||||||
var intent = new Intent();
|
|
||||||
intent.setAction(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
|
|
||||||
var uri = Uri.fromParts("package", mainActivity.getPackageName(), null);
|
|
||||||
intent.setData(uri);
|
|
||||||
mainActivity.startActivity(intent);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 检查系统的设备服务是否开启
|
|
||||||
// var checkSystemEnableLocation = async function () {
|
|
||||||
function checkSystemEnableLocation() {
|
|
||||||
if (isIos) {
|
|
||||||
var result = false;
|
|
||||||
var cllocationManger = plus.ios.import("CLLocationManager");
|
|
||||||
var result = cllocationManger.locationServicesEnabled();
|
|
||||||
console.log("系统定位开启:" + result);
|
|
||||||
plus.ios.deleteObject(cllocationManger);
|
|
||||||
return result;
|
|
||||||
} else {
|
|
||||||
var context = plus.android.importClass("android.content.Context");
|
|
||||||
var locationManager = plus.android.importClass(
|
|
||||||
"android.location.LocationManager"
|
|
||||||
);
|
|
||||||
var main = plus.android.runtimeMainActivity();
|
|
||||||
var mainSvr = main.getSystemService(context.LOCATION_SERVICE);
|
|
||||||
var result = mainSvr.isProviderEnabled(locationManager.GPS_PROVIDER);
|
|
||||||
console.log("系统定位开启:" + result);
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
module.exports = {
|
|
||||||
judgeIosPermission: judgeIosPermission,
|
|
||||||
requestAndroidPermission: requestAndroidPermission,
|
|
||||||
checkSystemEnableLocation: checkSystemEnableLocation,
|
|
||||||
gotoAppPermissionSetting: gotoAppPermissionSetting,
|
|
||||||
};
|
|
||||||
50
main.js
50
main.js
@@ -2,44 +2,48 @@ import Vue from "vue";
|
|||||||
import App from "./App";
|
import App from "./App";
|
||||||
import * as filters from "./utils/filters.js"; // global filter
|
import * as filters from "./utils/filters.js"; // global filter
|
||||||
import uView from "uview-ui";
|
import uView from "uview-ui";
|
||||||
import empty from "./components/empty";
|
|
||||||
import store from "./store";
|
import store from "./store";
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 仅在h5中显示唤醒app功能
|
||||||
|
* 在h5页面手动挂载
|
||||||
|
*
|
||||||
|
*/
|
||||||
// #ifdef H5
|
// #ifdef H5
|
||||||
// 在h5页面手动挂载 h5唤醒app插件
|
|
||||||
import airBtn from "@/components/m-airbtn/index.vue";
|
import airBtn from "@/components/m-airbtn/index.vue";
|
||||||
let btn = Vue.component("airBtn", airBtn); //全局注册
|
let btn = Vue.component("airBtn", airBtn); //全局注册
|
||||||
document.body.appendChild(new btn().$mount().$el);
|
document.body.appendChild(new btn().$mount().$el);
|
||||||
// #endif
|
// #endif
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 全局filters
|
||||||
|
*/
|
||||||
|
|
||||||
Object.keys(filters).forEach((key) => {
|
Object.keys(filters).forEach((key) => {
|
||||||
Vue.filter(key, filters[key]);
|
Vue.filter(key, filters[key]);
|
||||||
});
|
});
|
||||||
|
|
||||||
const msg = (title, duration = 1500, mask = false, icon = "none") => {
|
// 引入Vuex
|
||||||
//统一提示方便全局修改
|
Vue.prototype.$store = store;
|
||||||
if (Boolean(title) === false) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
uni.showToast({
|
|
||||||
title,
|
|
||||||
duration,
|
|
||||||
mask,
|
|
||||||
icon,
|
|
||||||
});
|
|
||||||
};
|
|
||||||
// 引入vuex
|
|
||||||
Vue.prototype.$store = store;
|
|
||||||
// 全局引入空组件
|
|
||||||
Vue.component("empty", empty);
|
|
||||||
Vue.use(uView);
|
Vue.use(uView);
|
||||||
Vue.config.productionTip = false;
|
Vue.config.productionTip = false;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 注意!
|
||||||
|
* 此处将常用的颜色嵌入到原型链上面
|
||||||
|
* 颜色使用驼峰命名对应 uni.scss中全局颜色变量名
|
||||||
|
* 如需更换主题请修改此处以及uni.scss中的全局颜色
|
||||||
|
*/
|
||||||
// 主题色
|
// 主题色
|
||||||
Vue.prototype.$mainColor = "#ff3c2a";
|
Vue.prototype.$mainColor = "#ff3c2a";
|
||||||
// 高亮主题色
|
// 高亮主题色
|
||||||
Vue.prototype.$lightColor = "#ff6b35";
|
Vue.prototype.$lightColor = "#ff6b35";
|
||||||
// 可直接 this.$api调用
|
// 辅助高亮颜色
|
||||||
Vue.prototype.$api = { msg };
|
Vue.prototype.$aiderLightColor = "#ff9f28";
|
||||||
|
|
||||||
|
|
||||||
App.mpType = "app";
|
App.mpType = "app";
|
||||||
|
|
||||||
|
|||||||
@@ -2,8 +2,8 @@
|
|||||||
"name" : "lili商城",
|
"name" : "lili商城",
|
||||||
"appid" : "__UNI__C100675",
|
"appid" : "__UNI__C100675",
|
||||||
"description" : "",
|
"description" : "",
|
||||||
"versionName" : "4.0.16",
|
"versionName" : "4.0.47",
|
||||||
"versionCode" : 4000016,
|
"versionCode" : 4000047,
|
||||||
"transformPx" : false,
|
"transformPx" : false,
|
||||||
"app-plus" : {
|
"app-plus" : {
|
||||||
"compatible" : {
|
"compatible" : {
|
||||||
@@ -72,7 +72,8 @@
|
|||||||
"NSPhotoLibraryAddUsageDescription" : "保存商品图片到本地",
|
"NSPhotoLibraryAddUsageDescription" : "保存商品图片到本地",
|
||||||
"NSFaceIDUsageDescription" : "使用面部识别进行登录",
|
"NSFaceIDUsageDescription" : "使用面部识别进行登录",
|
||||||
"NSCameraUsageDescription" : "需要用与扫描二维码和商品评论图片拍摄",
|
"NSCameraUsageDescription" : "需要用与扫描二维码和商品评论图片拍摄",
|
||||||
"NSLocationAlwaysAndWhenInUseUsageDescription" : "位置信息将用于高德地图的效果展示"
|
"NSLocationAlwaysAndWhenInUseUsageDescription" : "位置信息将用于高德地图的效果展示",
|
||||||
|
"NSMicrophoneUsageDescription" : "用户上传视频时需使用音频信息"
|
||||||
},
|
},
|
||||||
"urltypes" : "lilishop"
|
"urltypes" : "lilishop"
|
||||||
},
|
},
|
||||||
@@ -81,8 +82,8 @@
|
|||||||
"payment" : {
|
"payment" : {
|
||||||
"weixin" : {
|
"weixin" : {
|
||||||
"__platform__" : [ "ios", "android" ],
|
"__platform__" : [ "ios", "android" ],
|
||||||
"appid" : "wx6cfbe6e0ace12ce8",
|
"appid" : "wx32788b91bdb614c0",
|
||||||
"UniversalLinks" : "https://m-b2b2c.pickmall.cn/"
|
"UniversalLinks" : "https://m-b2b2c.pickmall.cn/app/"
|
||||||
},
|
},
|
||||||
"alipay" : {
|
"alipay" : {
|
||||||
"__platform__" : [ "ios", "android" ]
|
"__platform__" : [ "ios", "android" ]
|
||||||
@@ -91,15 +92,15 @@
|
|||||||
"ad" : {},
|
"ad" : {},
|
||||||
"share" : {
|
"share" : {
|
||||||
"weixin" : {
|
"weixin" : {
|
||||||
"appid" : "wx6cfbe6e0ace12ce8",
|
"appid" : "wx32788b91bdb614c0",
|
||||||
"UniversalLinks" : "https://m-b2b2c.pickmall.cn/"
|
"UniversalLinks" : "https://m-b2b2c.pickmall.cn/app/"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"oauth" : {
|
"oauth" : {
|
||||||
"weixin" : {
|
"weixin" : {
|
||||||
"appid" : "wx6cfbe6e0ace12ce8",
|
"appid" : "wx32788b91bdb614c0",
|
||||||
"appsecret" : "6dfbe0c72380dce5d49d65b3c91059b1",
|
"appsecret" : "230233cef7520ee935bbecad372a370e",
|
||||||
"UniversalLinks" : "https://m-b2b2c.pickmall.cn/"
|
"UniversalLinks" : "https://m-b2b2c.pickmall.cn/app/"
|
||||||
},
|
},
|
||||||
"apple" : {},
|
"apple" : {},
|
||||||
"qq" : {
|
"qq" : {
|
||||||
@@ -185,13 +186,23 @@
|
|||||||
"setting" : {
|
"setting" : {
|
||||||
"urlCheck" : false,
|
"urlCheck" : false,
|
||||||
"minified" : true,
|
"minified" : true,
|
||||||
"postcss" : true,
|
"postcss" : false,
|
||||||
"es6" : true
|
"es6" : true
|
||||||
},
|
},
|
||||||
"permission" : {
|
"permission" : {
|
||||||
"scope.userLocation" : {
|
"scope.userLocation" : {
|
||||||
"desc" : "位置信息将用于高德地图的效果展示"
|
"desc" : "位置信息将用于高德地图的效果展示"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"plugins" : {
|
||||||
|
"myPlugin" : {
|
||||||
|
"version" : "1.1.0",
|
||||||
|
"provider" : "wx738958e0f4c894f9"
|
||||||
|
},
|
||||||
|
"live-player-plugin" : {
|
||||||
|
"version" : "1.3.0",
|
||||||
|
"provider" : "wx2b03c6e691cd7370"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"h5" : {
|
"h5" : {
|
||||||
@@ -210,6 +221,7 @@
|
|||||||
"enable" : true
|
"enable" : true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"title" : "lilishop"
|
"title" : "lilishop",
|
||||||
|
"template" : ""
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
42
package-lock.json
generated
42
package-lock.json
generated
@@ -1,42 +0,0 @@
|
|||||||
{
|
|
||||||
"requires": true,
|
|
||||||
"lockfileVersion": 1,
|
|
||||||
"dependencies": {
|
|
||||||
"async-validator": {
|
|
||||||
"version": "1.12.2",
|
|
||||||
"resolved": "https://registry.npmjs.org/async-validator/-/async-validator-1.12.2.tgz",
|
|
||||||
"integrity": "sha512-57EETfCPFiB7M4QscvQzWSGNsmtkjjzZv318SK1CBlstk+hycV72ocjriMOOM48HjvmoAoJGpJNjC7Z76RlnZA=="
|
|
||||||
},
|
|
||||||
"core-js": {
|
|
||||||
"version": "2.6.11",
|
|
||||||
"resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.11.tgz",
|
|
||||||
"integrity": "sha512-5wjnpaT/3dV+XB4borEsnAYQchn00XSgTAWKDkEqv+K8KevjbzmofK6hfJ9TZIlpj2N0xQpazy7PiRQiWHqzWg=="
|
|
||||||
},
|
|
||||||
"deepmerge": {
|
|
||||||
"version": "1.5.2",
|
|
||||||
"resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-1.5.2.tgz",
|
|
||||||
"integrity": "sha512-95k0GDqvBjZavkuvzx/YqVLv/6YYa17fz6ILMSf7neqQITCPbnfEnQvEgMPNjH4kgobe7+WIL0yJEHku+H3qtQ=="
|
|
||||||
},
|
|
||||||
"popper.js": {
|
|
||||||
"version": "0.6.4",
|
|
||||||
"resolved": "https://registry.npmjs.org/popper.js/-/popper.js-0.6.4.tgz",
|
|
||||||
"integrity": "sha1-GDfEdgr1TSuyC2b5wJuSmT2Exik="
|
|
||||||
},
|
|
||||||
"uview": {
|
|
||||||
"version": "0.1.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/uview/-/uview-0.1.0.tgz",
|
|
||||||
"integrity": "sha1-tASc8q1kE1430huAdCtjeoLl7yo=",
|
|
||||||
"requires": {
|
|
||||||
"async-validator": "^1.7.1",
|
|
||||||
"core-js": "^2.4.1",
|
|
||||||
"deepmerge": "^1.5.0",
|
|
||||||
"popper.js": "^0.6.4"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"xmldom": {
|
|
||||||
"version": "0.3.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/xmldom/-/xmldom-0.3.0.tgz",
|
|
||||||
"integrity": "sha512-z9s6k3wxE+aZHgXYxSTpGDo7BYOUfJsIRyoZiX6HTjwpwfS2wpQBQKa2fD+ShLyPkqDYo5ud7KitmLZ2Cd6r0g=="
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
197
pages.json
197
pages.json
@@ -10,7 +10,8 @@
|
|||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "首页",
|
"navigationBarTitleText": "首页",
|
||||||
"navigationStyle": "custom", // 隐藏系统导航栏
|
"navigationStyle": "custom", // 隐藏系统导航栏
|
||||||
"navigationBarTextStyle": "black"
|
"navigationBarTextStyle": "black",
|
||||||
|
"enablePullDownRefresh":true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -18,8 +19,6 @@
|
|||||||
"path": "pages/tabbar/cart/cartList",
|
"path": "pages/tabbar/cart/cartList",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "购物车",
|
"navigationBarTitleText": "购物车",
|
||||||
"navigationStyle": "custom",
|
|
||||||
|
|
||||||
"navigationBarBackgroundColor": "#fff"
|
"navigationBarBackgroundColor": "#fff"
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -36,29 +35,22 @@
|
|||||||
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"path": "pages/navigation/point/point-mall",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "积分商城",
|
|
||||||
"enablePullDownRefresh": true
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "pages/navigation/selectShops",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "精选店铺"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
|
|
||||||
{
|
{
|
||||||
"path": "pages/navigation/search/searchPage",
|
"path": "pages/navigation/search/searchPage",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "搜索",
|
"navigationBarTitleText": "搜索",
|
||||||
"navigationStyle": "custom",
|
"navigationStyle": "custom",
|
||||||
|
|
||||||
"app-plus": {
|
"app-plus": {
|
||||||
//app页面不显示滚动条
|
//app页面不显示滚动条
|
||||||
"scrollIndicator": "none"
|
"scrollIndicator": "none",
|
||||||
|
"bottom": "0",
|
||||||
|
"contentAdjust": "false",
|
||||||
|
"bounce": "none",
|
||||||
|
"safearea": {
|
||||||
|
"bottom": "none"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
@@ -176,7 +168,28 @@
|
|||||||
{
|
{
|
||||||
"path": "deposit/index",
|
"path": "deposit/index",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "预存款列表"
|
"navigationStyle": "custom"
|
||||||
|
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "deposit/operation",
|
||||||
|
"style": {
|
||||||
|
"navigationStyle": "custom"
|
||||||
|
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "deposit/recharge",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "充值金额"
|
||||||
|
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "deposit/withdrawal",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "提现金额"
|
||||||
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -188,12 +201,7 @@
|
|||||||
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"path": "aboutUs",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "关于我们"
|
|
||||||
}
|
|
||||||
}, {
|
|
||||||
"path": "address/address",
|
"path": "address/address",
|
||||||
"style": {
|
"style": {
|
||||||
"enablePullDownRefresh": true,
|
"enablePullDownRefresh": true,
|
||||||
@@ -212,6 +220,13 @@
|
|||||||
"navigationBarTitleText": "地址管理"
|
"navigationBarTitleText": "地址管理"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"path": "set/versionFunctionList",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "功能介绍"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
"path": "set/securityCenter/fingerLogin",
|
"path": "set/securityCenter/fingerLogin",
|
||||||
"style": {
|
"style": {
|
||||||
@@ -251,7 +266,7 @@
|
|||||||
{
|
{
|
||||||
"path": "set/editionIntro",
|
"path": "set/editionIntro",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "版本说明"
|
"navigationBarTitleText": "关于我们"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -326,12 +341,23 @@
|
|||||||
{
|
{
|
||||||
"root": "pages/product",
|
"root": "pages/product",
|
||||||
"pages": [{
|
"pages": [{
|
||||||
"path": "shopPage",
|
"path": "shopPage",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "详情展示",
|
"navigationBarTitleText": "",
|
||||||
"navigationStyle": "custom"
|
"navigationStyle": "custom"
|
||||||
}
|
}
|
||||||
},
|
},{
|
||||||
|
"path": "licencePhoto",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "营业执照"
|
||||||
|
}
|
||||||
|
},{
|
||||||
|
"path": "shopPageGoods",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "",
|
||||||
|
"navigationStyle": "custom"
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"path": "goods",
|
"path": "goods",
|
||||||
"style": {
|
"style": {
|
||||||
@@ -364,6 +390,17 @@
|
|||||||
//app页面不显示滚动条
|
//app页面不显示滚动条
|
||||||
"scrollIndicator": "none"
|
"scrollIndicator": "none"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{ // 客服
|
||||||
|
"path": "customerservice/index",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "客服",
|
||||||
|
"usingComponents": {
|
||||||
|
// #ifdef MP-WEIXIN
|
||||||
|
"chat": "plugin://myPlugin/chat"
|
||||||
|
// #endif
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
||||||
@@ -403,7 +440,9 @@
|
|||||||
{
|
{
|
||||||
"path": "wechatMPLogin",
|
"path": "wechatMPLogin",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "小程序登录"
|
"navigationBarTitleText": "小程序登录",
|
||||||
|
"navigationStyle": "custom",
|
||||||
|
"navigationBarTextStyle": "black"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
@@ -412,19 +451,14 @@
|
|||||||
|
|
||||||
{
|
{
|
||||||
"root": "pages/promotion",
|
"root": "pages/promotion",
|
||||||
"pages": [{
|
"pages": [ {
|
||||||
"path": "sale",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "特惠推荐",
|
|
||||||
"navigationStyle": "custom"
|
|
||||||
|
|
||||||
}
|
|
||||||
}, {
|
|
||||||
"path": "seckill",
|
"path": "seckill",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "限时抢购",
|
"navigationBarTitleText": "限时抢购",
|
||||||
"app-plus": {
|
"app-plus": {
|
||||||
"titleNView": {}
|
"titleNView": {
|
||||||
|
"homeButton":true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -440,11 +474,44 @@
|
|||||||
"bounce": "none"
|
"bounce": "none"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}, {
|
},{
|
||||||
"path": "recommend",
|
"path": "lives",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "人气推荐",
|
"navigationStyle": "custom",
|
||||||
"navigationStyle": "custom"
|
"navigationBarTextStyle": "black"
|
||||||
|
|
||||||
|
}
|
||||||
|
},{
|
||||||
|
"path": "bargain/list",
|
||||||
|
"style": {
|
||||||
|
"navigationStyle": "custom",
|
||||||
|
"navigationBarTextStyle": "white"
|
||||||
|
|
||||||
|
}
|
||||||
|
},{
|
||||||
|
"path": "bargain/detail",
|
||||||
|
"style": {
|
||||||
|
"navigationStyle": "custom",
|
||||||
|
"navigationBarTextStyle": "white"
|
||||||
|
|
||||||
|
}
|
||||||
|
},{
|
||||||
|
"path": "bargain/log",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "砍价记录"
|
||||||
|
}
|
||||||
|
},{
|
||||||
|
"path": "point/detail",
|
||||||
|
"style": {
|
||||||
|
"navigationStyle": "custom",
|
||||||
|
"navigationBarTextStyle": "white"
|
||||||
|
|
||||||
|
}
|
||||||
|
},{
|
||||||
|
"path": "point/pointList",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "积分商城"
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -459,16 +526,8 @@
|
|||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "我的优惠券",
|
"navigationBarTitleText": "我的优惠券",
|
||||||
"app-plus": {
|
"app-plus": {
|
||||||
"bounce": "coupon/none",
|
"bounce": "coupon/none"
|
||||||
"titleNView": {
|
|
||||||
"padding-right": "12",
|
|
||||||
"buttons": [{
|
|
||||||
"fontSrc": "/static/font/iconfont/iconfont.ttf",
|
|
||||||
"text": "\ue608",
|
|
||||||
"fontSize": "20",
|
|
||||||
"color": "#FFFFFF"
|
|
||||||
}]
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -489,19 +548,8 @@
|
|||||||
"path": "coupon/couponCenter",
|
"path": "coupon/couponCenter",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "领券中心",
|
"navigationBarTitleText": "领券中心",
|
||||||
"enablePullDownRefresh": true,
|
"enablePullDownRefresh": true
|
||||||
"app-plus": {
|
|
||||||
"bounce": "none",
|
|
||||||
"titleNView": {
|
|
||||||
"padding-right": "12",
|
|
||||||
"buttons": [{
|
|
||||||
"fontSrc": "/static/font/iconfont/iconfont.ttf",
|
|
||||||
"text": "\ue608",
|
|
||||||
"fontSize": "20",
|
|
||||||
"color": "#FFFFFF"
|
|
||||||
}]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -566,6 +614,7 @@
|
|||||||
"enablePullDownRefresh": true,
|
"enablePullDownRefresh": true,
|
||||||
"app-plus": {
|
"app-plus": {
|
||||||
"bounce": "none"
|
"bounce": "none"
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -693,13 +742,7 @@
|
|||||||
"selectedIconPath": "static/tabbar/category-s.png",
|
"selectedIconPath": "static/tabbar/category-s.png",
|
||||||
"text": "分类"
|
"text": "分类"
|
||||||
},
|
},
|
||||||
|
|
||||||
// {
|
|
||||||
// "pagePath": "pages/navigation/point/point-mall",
|
|
||||||
// "iconPath": "static/tabbar/point-mall.png",
|
|
||||||
// "selectedIconPath": "static/tabbar/point-mall-s.png",
|
|
||||||
// "text": "积分商城"
|
|
||||||
// },
|
|
||||||
{
|
{
|
||||||
"pagePath": "pages/tabbar/cart/cartList",
|
"pagePath": "pages/tabbar/cart/cartList",
|
||||||
"iconPath": "static/tabbar/cart.png",
|
"iconPath": "static/tabbar/cart.png",
|
||||||
|
|||||||
@@ -1,9 +1,12 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="wrapper">
|
<div class="wrapper">
|
||||||
|
<u-tabs :list="list" :is-scroll="false" :active-color="lightColor" :current="current" @change="(i)=>{current = i}">
|
||||||
|
</u-tabs>
|
||||||
|
|
||||||
<div class="empty" v-if="couponsList.length <= 0">
|
<div class="empty" v-if="couponsList.length <= 0">
|
||||||
<u-empty text="暂无优惠券" mode="coupon"></u-empty>
|
<u-empty text="暂无优惠券" mode="coupon"></u-empty>
|
||||||
</div>
|
</div>
|
||||||
<view class="coupon-item" v-for="(item, index) in couponsList" :key="index" v-if="item.memberCouponStatus == 'NEW'">
|
<view class="coupon-item" v-for="(item, index) in couponsList" :key="index" >
|
||||||
<view class="left">
|
<view class="left">
|
||||||
<view class="wave-line">
|
<view class="wave-line">
|
||||||
<view class="wave" v-for="(item, index) in 12" :key="index"></view>
|
<view class="wave" v-for="(item, index) in 12" :key="index"></view>
|
||||||
@@ -19,29 +22,40 @@
|
|||||||
<view class="circle circle-bottom"></view>
|
<view class="circle circle-bottom"></view>
|
||||||
</view>
|
</view>
|
||||||
<view class="right">
|
<view class="right">
|
||||||
<view>
|
<view class="desc">
|
||||||
<view v-if="item.scopeType">
|
<view v-if="item.scopeType">
|
||||||
<span v-if="item.scopeType == 'ALL' && item.id == 'platform'">全平台</span>
|
<span v-if="item.scopeType == 'ALL' && item.id == 'platform'">全平台</span>
|
||||||
<span v-if="item.scopeType == 'PORTION_CATEGORY'">仅限品类</span>
|
<span v-if="item.scopeType == 'PORTION_CATEGORY'">仅限品类</span>
|
||||||
<view v-else>{{ item.storeName == 'platform' ? '全平台' :item.storeName+'店铺' }}使用</view>
|
<view v-else>{{ item.storeName == 'platform' ? '全平台' :item.storeName+'店铺' }}使用</view>
|
||||||
</view>
|
</view>
|
||||||
<view>有效期至:{{item.endTime}}</view>
|
<view class="reason" v-if="item.reason">{{item.reason}}</view>
|
||||||
|
<view class="end-time">有效期至:{{item.endTime}}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="receive" @click="clickWay(item)">
|
<view class="receive" v-if="current ==0" @click="clickWay(item)">
|
||||||
<text>立即</text><br />
|
<text>立即</text><br />
|
||||||
<text>使用</text>
|
<text>使用</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="bg-quan"> 券 </view>
|
<view class="bg-quan">券</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import { useCoupon, getMemberCanUse } from "@/api/trade.js";
|
import { useCoupon } from "@/api/trade.js";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
lightColor: this.$lightColor,
|
||||||
|
current: 0,
|
||||||
|
list: [
|
||||||
|
{
|
||||||
|
name: "可用优惠券",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "不可用优惠券",
|
||||||
|
},
|
||||||
|
],
|
||||||
couponsList: [], //优惠券集合
|
couponsList: [], //优惠券集合
|
||||||
params: {
|
params: {
|
||||||
//传参
|
//传参
|
||||||
@@ -55,36 +69,30 @@ export default {
|
|||||||
routerVal: "", //上级传参
|
routerVal: "", //上级传参
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
/**
|
onLoad(options){
|
||||||
* 赋值
|
this.routerVal = options
|
||||||
*/
|
|
||||||
onLoad(val) {
|
|
||||||
this.routerVal = val;
|
|
||||||
this.params.scopeId = val.skuId;
|
|
||||||
this.params.storeId = val.storeId;
|
|
||||||
},
|
},
|
||||||
|
watch: {
|
||||||
|
current(val) {
|
||||||
|
console.log(this.$store.state.cantUseCoupons);
|
||||||
|
val == 0
|
||||||
|
? (this.couponsList = this.$store.state.canUseCoupons)
|
||||||
|
: (this.couponsList = this.$store.state.cantUseCoupons);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
mounted() {
|
mounted() {
|
||||||
uni.getStorage({
|
this.init();
|
||||||
key: "totalPrice",
|
|
||||||
success: (res) => {
|
|
||||||
this.params.totalPrice = res.data;
|
|
||||||
this.getCoupons();
|
|
||||||
},
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
/**
|
/**
|
||||||
* 获取优惠券数量
|
* 从vuex中拿取优惠券信息
|
||||||
*/
|
*/
|
||||||
getCoupons() {
|
init() {
|
||||||
getMemberCanUse(this.params).then((res) => {
|
this.couponsList = this.$store.state.canUseCoupons;
|
||||||
if (res.data.success) {
|
|
||||||
this.couponsList = res.data.result.records;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 领取优惠券
|
* 领取优惠券
|
||||||
*/
|
*/
|
||||||
@@ -109,6 +117,20 @@ export default {
|
|||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
|
.desc {
|
||||||
|
height: 220rpx;
|
||||||
|
flex: 2;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: space-around;
|
||||||
|
}
|
||||||
|
.end-time,
|
||||||
|
.reason {
|
||||||
|
color: #999;
|
||||||
|
line-height: 1.5;
|
||||||
|
font-size: 24rpx;
|
||||||
|
}
|
||||||
|
|
||||||
.empty {
|
.empty {
|
||||||
margin-top: 20px;
|
margin-top: 20px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
@@ -187,14 +209,14 @@ export default {
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
width: 450rpx;
|
width: 450rpx;
|
||||||
font-size: $font-sm;
|
font-size: $font-sm;
|
||||||
height: 100%;
|
height: 220rpx;
|
||||||
background-color: #ffffff;
|
background-color: #ffffff;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
position: relative;
|
position: relative;
|
||||||
> view:nth-child(1) {
|
> view:nth-child(1) {
|
||||||
color: #666666;
|
color: #666666;
|
||||||
margin-left: 20rpx;
|
margin-left: 20rpx;
|
||||||
line-height: 3em;
|
|
||||||
> view:nth-child(1) {
|
> view:nth-child(1) {
|
||||||
color: #ff6262;
|
color: #ff6262;
|
||||||
font-size: 30rpx;
|
font-size: 30rpx;
|
||||||
|
|||||||
@@ -2,7 +2,8 @@
|
|||||||
<view class="b-content">
|
<view class="b-content">
|
||||||
<view class="navbar">
|
<view class="navbar">
|
||||||
<!-- 循环出头部tab栏 -->
|
<!-- 循环出头部tab栏 -->
|
||||||
<view v-for="(item, index) in navList" :key="index" class="nav-item" @click="handleTabClick(index)"><text :class="{ current: tabCurrentIndex === index }">{{
|
<view v-for="(item, index) in navList" :key="index" class="nav-item" @click="handleTabClick(index)"><text
|
||||||
|
:class="{ current: tabCurrentIndex === index }">{{
|
||||||
item.text
|
item.text
|
||||||
}}</text></view>
|
}}</text></view>
|
||||||
</view>
|
</view>
|
||||||
@@ -11,8 +12,10 @@
|
|||||||
<scroll-view class="list-scroll-content" scroll-y @scrolltolower="loadData">
|
<scroll-view class="list-scroll-content" scroll-y @scrolltolower="loadData">
|
||||||
<!-- 空白页 -->
|
<!-- 空白页 -->
|
||||||
<u-empty mode="coupon" text="暂无优惠券了" v-if="navItem.wheterEmpty"></u-empty>
|
<u-empty mode="coupon" text="暂无优惠券了" v-if="navItem.wheterEmpty"></u-empty>
|
||||||
|
|
||||||
<!-- 数据 -->
|
<!-- 数据 -->
|
||||||
<view v-if="navItem.dataList && coupon" class="coupon-item" :class="{ 'coupon-used': navIndex != 0 }" v-for="(coupon, index) in navItem.dataList" :key="index">
|
<view v-if="navItem.dataList && coupon" class="coupon-item" :class="{ 'coupon-used': navIndex != 0 }"
|
||||||
|
v-for="(coupon, index) in navItem.dataList" :key="index">
|
||||||
<view class="left">
|
<view class="left">
|
||||||
<view class="wave-line">
|
<view class="wave-line">
|
||||||
<view class="wave" v-for="(item, index) in 12" :key="index"></view>
|
<view class="wave" v-for="(item, index) in 12" :key="index"></view>
|
||||||
@@ -47,7 +50,7 @@
|
|||||||
<text class="text-2" v-if="coupon.used_status == 1">将过期</text>
|
<text class="text-2" v-if="coupon.used_status == 1">将过期</text>
|
||||||
</view>
|
</view>
|
||||||
<image class="no-icon" v-if="navIndex == 1" src="@/static/img/used.png"></image>
|
<image class="no-icon" v-if="navIndex == 1" src="@/static/img/used.png"></image>
|
||||||
<image class="no-icon" v-if="navIndex == 2" src="@/pages/floor/imgs/overdue.png"></image>
|
<image class="no-icon" v-if="navIndex == 2" src="@/static/img/overdue.png"></image>
|
||||||
<view class="receive" v-if="navIndex == 0" @click="useItNow(coupon)">
|
<view class="receive" v-if="navIndex == 0" @click="useItNow(coupon)">
|
||||||
<text>立即</text><br />
|
<text>立即</text><br />
|
||||||
<text>使用</text>
|
<text>使用</text>
|
||||||
@@ -112,7 +115,8 @@ export default {
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
onLoad() {
|
onShow() {
|
||||||
|
this.navList[this.tabCurrentIndex].dataList = [];
|
||||||
this.getData();
|
this.getData();
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -142,7 +146,7 @@ export default {
|
|||||||
let index = this.tabCurrentIndex;
|
let index = this.tabCurrentIndex;
|
||||||
getMemberCoupons(this.navList[index].params).then((res) => {
|
getMemberCoupons(this.navList[index].params).then((res) => {
|
||||||
uni.stopPullDownRefresh();
|
uni.stopPullDownRefresh();
|
||||||
if (res.statusCode == 200) {
|
if (res.data.success) {
|
||||||
let data = res.data.result.records;
|
let data = res.data.result.records;
|
||||||
if (data.length == 0) {
|
if (data.length == 0) {
|
||||||
if (res.data.pageNumber == 1) {
|
if (res.data.pageNumber == 1) {
|
||||||
@@ -220,7 +224,7 @@ $item-color: #fff;
|
|||||||
}
|
}
|
||||||
|
|
||||||
.swiper-box {
|
.swiper-box {
|
||||||
height: calc(100% - 40px);
|
height: calc(100vh - 40px);
|
||||||
}
|
}
|
||||||
|
|
||||||
.list-scroll-content {
|
.list-scroll-content {
|
||||||
|
|||||||
@@ -1,51 +1,50 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="wrapper">
|
<div class="wrapper">
|
||||||
<div class="box">
|
<div class="box">
|
||||||
<div class="block block-1">
|
<div class="block block-1">
|
||||||
<image class="img" src="@/pages/cart/static/pay.png" />
|
<image class="img" src="@/pages/cart/static/pay.png" />
|
||||||
<p class="ptips">收银台</p>
|
<p class="ptips">收银台</p>
|
||||||
|
|
||||||
<p class="ptips">剩余支付时间:
|
<p class="ptips">剩余支付时间:
|
||||||
<u-count-down :show-days="false" :show-border="true" font-size="28" color="#008ffa"
|
<u-count-down :show-days="false" :show-border="true" font-size="28" color="#008ffa" border-color="#008ffa" ref="uCountDown" :timestamp="autoCancel"></u-count-down>
|
||||||
border-color="#008ffa" ref="uCountDown" :timestamp="autoCancel"></u-count-down>
|
</p>
|
||||||
</p>
|
<p class="ptips">
|
||||||
<p class="ptips">
|
支付金额
|
||||||
支付金额
|
<span>¥{{ cashierParams.price | unitPrice }}</span>
|
||||||
<span>¥{{ cashierParams.price | unitPrice }}</span>
|
</p>
|
||||||
</p>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<div class="__pay_form__">
|
||||||
<div class="__pay_form__">
|
</div>
|
||||||
</div>
|
<div class="block-4" v-if="cashierParams.price > 0">
|
||||||
<div class="block-4" v-if="cashierParams.price > 0">
|
<div class="payItem">支付方式</div>
|
||||||
<div class="payItem">支付方式</div>
|
<div class="payItem" v-for="(item, index) in payList" :key="index">
|
||||||
<div class="payItem" v-for="(item, index) in payList" :key="index">
|
<u-row class="row">
|
||||||
<u-row class="row">
|
<div class="col1" @click="awaitPay(item, index)" size="100" style="text-align:left;">
|
||||||
<div class="col1" @click="awaitPay(item, index)" size="100" style="text-align:left;">
|
<div v-if="item == 'ALIPAY'">
|
||||||
<div v-if="item == 'ALIPAY'">
|
<u-icon class="method_icon" name="zhifubao-circle-fill" color="#008ffa" size="80"></u-icon>
|
||||||
<u-icon class="method_icon" name="zhifubao-circle-fill" color="#008ffa" size="80"></u-icon>
|
<span class="method_name">支付宝</span>
|
||||||
<span class="method_name">支付宝</span>
|
</div>
|
||||||
</div>
|
<div v-if="item == 'WECHAT'">
|
||||||
<div v-if="item == 'WECHAT'">
|
<u-icon class="method_icon" name="weixin-circle-fill" color="#00c98b" size="80"></u-icon>
|
||||||
<u-icon class="method_icon" name="weixin-circle-fill" color="#00c98b" size="80"></u-icon>
|
<span class="method_name">微信</span>
|
||||||
<span class="method_name">微信</span>
|
</div>
|
||||||
</div>
|
<div v-if="item == 'WALLET'">
|
||||||
<div v-if="item == 'WALLET'">
|
<u-icon class="method_icon" name="red-packet-fill" color="#dd6161" size="80"></u-icon>
|
||||||
<u-icon class="method_icon" name="red-packet-fill" color="#dd6161" size="80"></u-icon>
|
<span class="method_name">余额支付(当前余额:¥{{ walletValue | unitPrice }})</span>
|
||||||
<span class="method_name">余额支付(当前余额:¥{{ walletValue | unitPrice }})</span>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<div class="col3" @click="awaitPay(item)" textAlign="right">
|
||||||
<div class="col3" @click="awaitPay(item)" textAlign="right">
|
<u-icon size="26" color="#b1b1b1" name="arrow-right"></u-icon>
|
||||||
<u-icon size="26" color="#b1b1b1" name="arrow-right"></u-icon>
|
</div>
|
||||||
</div>
|
</u-row>
|
||||||
</u-row>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import * as API_Trade from "@/api/trade";
|
import * as API_Trade from "@/api/trade";
|
||||||
|
import {payCallback} from '@/api/members'
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@@ -71,6 +70,7 @@
|
|||||||
walletValue: 0.0,
|
walletValue: 0.0,
|
||||||
// 支付倒计时
|
// 支付倒计时
|
||||||
autoCancel: 0,
|
autoCancel: 0,
|
||||||
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
onLoad(val) {
|
onLoad(val) {
|
||||||
@@ -91,12 +91,23 @@
|
|||||||
// 区别是:h5是通过浏览器外部调用微信app进行支付,而JSAPI则是 在微信浏览器内部,或者小程序 调用微信支付
|
// 区别是:h5是通过浏览器外部调用微信app进行支付,而JSAPI则是 在微信浏览器内部,或者小程序 调用微信支付
|
||||||
this.paymentClient = this.isWeiXin() ? "JSAPI" : "H5";
|
this.paymentClient = this.isWeiXin() ? "JSAPI" : "H5";
|
||||||
//#endif
|
//#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//
|
||||||
},
|
},
|
||||||
onBackPress(e) {
|
onBackPress(e) {
|
||||||
if (e.from == "backbutton") {
|
if (e.from == "backbutton") {
|
||||||
|
if(this.routerVal.recharge_sn){
|
||||||
|
uni.switchTab({
|
||||||
|
url: '/pages/tabbar/user/my'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
else{
|
||||||
uni.redirectTo({
|
uni.redirectTo({
|
||||||
url: "/pages/order/myOrder?status=0",
|
url: "/pages/order/myOrder?status=0",
|
||||||
});
|
});
|
||||||
|
}
|
||||||
return true; //阻止默认返回行为
|
return true; //阻止默认返回行为
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -104,16 +115,28 @@
|
|||||||
this.cashierData();
|
this.cashierData();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
navigateTo(url) {
|
|
||||||
|
/**
|
||||||
|
* 支付成功后跳转
|
||||||
|
*/
|
||||||
|
callback(paymentMethod){
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url,
|
url: "/pages/cart/payment/success?paymentMethod=" +
|
||||||
|
paymentMethod +
|
||||||
|
"&payPrice=" +
|
||||||
|
this.cashierParams.price+
|
||||||
|
"&orderType="+this.orderType
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
// 获取收银详情
|
|
||||||
|
/**
|
||||||
|
* 获取收银详情
|
||||||
|
*/
|
||||||
cashierData() {
|
cashierData() {
|
||||||
let parms = {};
|
let parms = {};
|
||||||
|
|
||||||
if (this.routerVal.recharge_sn) {
|
if (this.routerVal.recharge_sn) {
|
||||||
|
// 判断当前是否是充值
|
||||||
this.sn = this.routerVal.recharge_sn;
|
this.sn = this.routerVal.recharge_sn;
|
||||||
this.orderType = "RECHARGE";
|
this.orderType = "RECHARGE";
|
||||||
} else if (this.routerVal.trade_sn) {
|
} else if (this.routerVal.trade_sn) {
|
||||||
@@ -128,6 +151,8 @@
|
|||||||
parms.clientType = this.paymentType;
|
parms.clientType = this.paymentType;
|
||||||
|
|
||||||
API_Trade.getCashierData(parms).then((res) => {
|
API_Trade.getCashierData(parms).then((res) => {
|
||||||
|
|
||||||
|
if(res.data.success){
|
||||||
this.cashierParams = res.data.result;
|
this.cashierParams = res.data.result;
|
||||||
|
|
||||||
// #ifdef MP-WEIXIN
|
// #ifdef MP-WEIXIN
|
||||||
@@ -137,23 +162,54 @@
|
|||||||
// #endif
|
// #endif
|
||||||
|
|
||||||
// #ifndef MP-WEIXIN
|
// #ifndef MP-WEIXIN
|
||||||
this.payList = res.data.result.support;
|
if(this.routerVal.recharge_sn){
|
||||||
|
this.payList = res.data.result.support.filter((item) => {
|
||||||
|
return item != "WALLET";
|
||||||
|
})
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
this.payList = res.data.result.support;
|
||||||
|
}
|
||||||
|
// #ifndef APP-PLUS
|
||||||
|
//判断是否微信浏览器
|
||||||
|
var ua = window.navigator.userAgent.toLowerCase();
|
||||||
|
if (ua.match(/MicroMessenger/i) == 'micromessenger') {
|
||||||
|
|
||||||
|
this.payList = res.data.result.support.filter((item) => {
|
||||||
|
return item != "ALIPAY";
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
// #endif
|
// #endif
|
||||||
|
|
||||||
|
// #endif
|
||||||
|
|
||||||
|
|
||||||
this.walletValue = res.data.result.walletValue;
|
this.walletValue = res.data.result.walletValue;
|
||||||
this.autoCancel =
|
this.autoCancel =
|
||||||
(res.data.result.autoCancel - new Date().getTime()) / 1000;
|
(res.data.result.autoCancel - new Date().getTime()) / 1000;
|
||||||
|
}
|
||||||
|
else if(res.data.code == 32000){
|
||||||
|
setTimeout(()=>{
|
||||||
|
uni.redirectTo({
|
||||||
|
url: `/pages/order/myOrder?status=0`
|
||||||
|
});
|
||||||
|
},500)
|
||||||
|
|
||||||
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
awaitPay(payment){
|
awaitPay(payment){
|
||||||
|
this.$u.throttle(()=>{
|
||||||
this.$u.debounce(this.pay(payment), 3000)
|
this.pay(payment)
|
||||||
|
}, 2000)
|
||||||
},
|
},
|
||||||
|
|
||||||
//订单支付
|
//订单支付
|
||||||
async pay(payment) {
|
async pay(payment) {
|
||||||
|
|
||||||
// 支付编号
|
// 支付编号
|
||||||
const sn = this.sn;
|
const sn = this.sn;
|
||||||
// 交易类型【交易号|订单号】
|
// 交易类型【交易号|订单号】
|
||||||
@@ -179,16 +235,15 @@
|
|||||||
|
|
||||||
//如果支付异常
|
//如果支付异常
|
||||||
if (!signXml.data.success) {
|
if (!signXml.data.success) {
|
||||||
uni.showModal({
|
uni.showToast({
|
||||||
content: signXml.data.message,
|
title: signXml.data.message,
|
||||||
showCancel: false,
|
duration: 2000
|
||||||
})
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
let payForm = signXml.data.result;
|
let payForm = signXml.data.result;
|
||||||
|
|
||||||
console.log(payForm)
|
|
||||||
let paymentType = paymentMethod === "WECHAT" ? "wxpay" : "alipay";
|
let paymentType = paymentMethod === "WECHAT" ? "wxpay" : "alipay";
|
||||||
uni.requestPayment({
|
uni.requestPayment({
|
||||||
provider: paymentType,
|
provider: paymentType,
|
||||||
@@ -199,15 +254,13 @@
|
|||||||
icon: "none",
|
icon: "none",
|
||||||
title: "支付成功!",
|
title: "支付成功!",
|
||||||
});
|
});
|
||||||
uni.navigateTo({
|
|
||||||
url: "/pages/payment/success?paymentType=" +
|
this.callback(paymentMethod)
|
||||||
paymentType +
|
|
||||||
"&payPrice=" +
|
|
||||||
this.cashierParams.price,
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
fail: (e) => {
|
fail: (e) => {
|
||||||
console.log(e);
|
console.log(this);
|
||||||
this.exception = e;
|
this.exception = e;
|
||||||
uni.showModal({
|
uni.showModal({
|
||||||
content: "支付失败,如果您已支付,请勿反复支付",
|
content: "支付失败,如果您已支付,请勿反复支付",
|
||||||
@@ -225,16 +278,18 @@
|
|||||||
await API_Trade.initiatePay(paymentMethod, paymentClient, params).then(
|
await API_Trade.initiatePay(paymentMethod, paymentClient, params).then(
|
||||||
(res) => {
|
(res) => {
|
||||||
let response = res.data;
|
let response = res.data;
|
||||||
//如果支付异常
|
//如果非支付宝支付才需要进行判定,因为支付宝h5支付是直接输出的,没有返回所谓的消息状态
|
||||||
if (!response.success) {
|
if(paymentMethod !== "ALIPAY"){
|
||||||
|
//如果支付异常
|
||||||
uni.showModal({
|
if (!response.success) {
|
||||||
content: response.message,
|
uni.showToast({
|
||||||
showCancel: false,
|
title: response.message,
|
||||||
})
|
duration: 2000,
|
||||||
return;
|
icon:"none"
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (paymentMethod === "ALIPAY") {
|
if (paymentMethod === "ALIPAY") {
|
||||||
document.write(response);
|
document.write(response);
|
||||||
} else if (paymentMethod === "WECHAT") {
|
} else if (paymentMethod === "WECHAT") {
|
||||||
@@ -243,7 +298,7 @@
|
|||||||
WeixinJSBridge.invoke(
|
WeixinJSBridge.invoke(
|
||||||
"getBrandWCPayRequest",
|
"getBrandWCPayRequest",
|
||||||
response.result,
|
response.result,
|
||||||
function(res) {
|
(res) => {
|
||||||
if (res.err_msg == "get_brand_wcpay_request:ok") {
|
if (res.err_msg == "get_brand_wcpay_request:ok") {
|
||||||
// 使用以上方式判断前端返回,微信团队郑重提示:
|
// 使用以上方式判断前端返回,微信团队郑重提示:
|
||||||
//res.err_msg将在用户支付成功后返回ok,但并不保证它绝对可靠。
|
//res.err_msg将在用户支付成功后返回ok,但并不保证它绝对可靠。
|
||||||
@@ -251,12 +306,8 @@
|
|||||||
icon: "none",
|
icon: "none",
|
||||||
title: "支付成功!",
|
title: "支付成功!",
|
||||||
});
|
});
|
||||||
uni.navigateTo({
|
this.callback(paymentMethod)
|
||||||
url: "/pages/cart/payment/success?paymentMethod=" +
|
|
||||||
paymentMethod +
|
|
||||||
"&payPrice=" +
|
|
||||||
this.cashierParams.price,
|
|
||||||
});
|
|
||||||
} else {
|
} else {
|
||||||
uni.showModal({
|
uni.showModal({
|
||||||
content: "支付失败,如果您已支付,请勿反复支付",
|
content: "支付失败,如果您已支付,请勿反复支付",
|
||||||
@@ -274,12 +325,7 @@
|
|||||||
icon: "none",
|
icon: "none",
|
||||||
});
|
});
|
||||||
if (response.success) {
|
if (response.success) {
|
||||||
uni.navigateTo({
|
this.callback(paymentMethod)
|
||||||
url: "/pages/cart/payment/success?paymentMethod=" +
|
|
||||||
paymentMethod +
|
|
||||||
"&payPrice=" +
|
|
||||||
this.cashierParams.price,
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -315,12 +361,8 @@
|
|||||||
icon: "none",
|
icon: "none",
|
||||||
title: "支付成功!",
|
title: "支付成功!",
|
||||||
});
|
});
|
||||||
uni.navigateTo({
|
this.callback(paymentMethod)
|
||||||
url: "/pages/cart/payment/success?paymentMethod=" +
|
|
||||||
paymentType +
|
|
||||||
"&payPrice=" +
|
|
||||||
this.cashierParams.price,
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
fail: (e) => {
|
fail: (e) => {
|
||||||
console.log(e);
|
console.log(e);
|
||||||
@@ -336,12 +378,8 @@
|
|||||||
icon: "none",
|
icon: "none",
|
||||||
title: "支付成功!",
|
title: "支付成功!",
|
||||||
});
|
});
|
||||||
uni.navigateTo({
|
this.callback(paymentMethod)
|
||||||
url: "/pages/cart/payment/success?paymentMethod=" +
|
|
||||||
paymentMethod +
|
|
||||||
"&payPrice=" +
|
|
||||||
this.cashierParams.price,
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
@@ -359,108 +397,108 @@
|
|||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
.method_icon {
|
.method_icon {
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
}
|
}
|
||||||
|
|
||||||
.method_name {
|
.method_name {
|
||||||
font-size: 28rpx;
|
font-size: 28rpx;
|
||||||
color: #999;
|
color: #999;
|
||||||
padding-left: 24rpx;
|
padding-left: 24rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.row {
|
.row {
|
||||||
display: flex;
|
display: flex;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
/deep/ .u-row {
|
/deep/ .u-row {
|
||||||
width: 100% !important;
|
width: 100% !important;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between !important;
|
justify-content: space-between !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.method_name,
|
.method_name,
|
||||||
.col1 {
|
.col1 {
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
}
|
}
|
||||||
|
|
||||||
.col1 {
|
.col1 {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
flex: 99;
|
flex: 99;
|
||||||
}
|
}
|
||||||
|
|
||||||
.col3 {
|
.col3 {
|
||||||
text-align: right;
|
text-align: right;
|
||||||
flex: 1;
|
flex: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
.payItem {
|
.payItem {
|
||||||
padding: 13px 25rpx;
|
padding: 13px 25rpx;
|
||||||
border-top: 1px solid #f9f9f9;
|
border-top: 1px solid #f9f9f9;
|
||||||
|
|
||||||
line-height: 100rpx;
|
line-height: 100rpx;
|
||||||
font-size: 36rpx;
|
font-size: 36rpx;
|
||||||
color: #333;
|
color: #333;
|
||||||
}
|
}
|
||||||
|
|
||||||
.ptips {
|
.ptips {
|
||||||
font-size: 32rpx;
|
font-size: 32rpx;
|
||||||
margin: 20rpx 0;
|
margin: 20rpx 0;
|
||||||
color: #333;
|
color: #333;
|
||||||
|
|
||||||
>span {
|
> span {
|
||||||
font-size: 40rpx;
|
font-size: 40rpx;
|
||||||
color: #df5a52;
|
color: #df5a52;
|
||||||
margin-left: 10rpx;
|
margin-left: 10rpx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.img {
|
.img {
|
||||||
width: 392rpx !important;
|
width: 392rpx !important;
|
||||||
height: 296rpx !important;
|
height: 296rpx !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.wrapper {
|
.wrapper {
|
||||||
min-height: 100vh;
|
min-height: 100vh;
|
||||||
height: auto;
|
height: auto;
|
||||||
background: #f9f9f9;
|
background: #f9f9f9;
|
||||||
}
|
}
|
||||||
|
|
||||||
.block-4 {
|
.block-4 {
|
||||||
background: #fff;
|
background: #fff;
|
||||||
color: $u-tips-color;
|
color: $u-tips-color;
|
||||||
|
|
||||||
>p {
|
> p {
|
||||||
padding: 8rpx;
|
padding: 8rpx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.box {
|
.box {
|
||||||
background: #fff;
|
background: #fff;
|
||||||
padding: 40rpx 0;
|
padding: 40rpx 0;
|
||||||
// justify-content: center; //这个是X轴居中
|
// justify-content: center; //这个是X轴居中
|
||||||
// align-items: center; //这个是 Y轴居中
|
// align-items: center; //这个是 Y轴居中
|
||||||
}
|
}
|
||||||
|
|
||||||
.block {
|
.block {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
display: block;
|
display: block;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
|
||||||
image {
|
image {
|
||||||
width: 200rpx;
|
width: 200rpx;
|
||||||
height: 200rpx;
|
height: 200rpx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.block-1 {
|
.block-1 {
|
||||||
margin-top: 80rpx;
|
margin-top: 80rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.btns {
|
.btns {
|
||||||
margin: 0 20rpx;
|
margin: 0 20rpx;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -1,411 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div class="wrapper">
|
|
||||||
<u-popup class="popup" v-model="buyMask" :height="setup.height" closeable :mode="setup.mode" :mask-close-able="isClose" :mask="isMask" :border-radius="setup.radius" @close="closeMask()">
|
|
||||||
<!-- 商品 -->
|
|
||||||
<view class="goods-box bottom">
|
|
||||||
<view class="goods-header">
|
|
||||||
<view class="goods-img">
|
|
||||||
<u-image width="200rpx" border-radius="20" class="uimage" height="200rpx" :src="selectedSpecImg ? selectedSpecImg : goodsDetail.thumbnail"></u-image>
|
|
||||||
</view>
|
|
||||||
<view class="goods-skus">
|
|
||||||
|
|
||||||
<!-- 有活动商品价格 -->
|
|
||||||
<view class="goods-price " v-if="goodsDetail.promotionPrice">
|
|
||||||
<span>
|
|
||||||
¥
|
|
||||||
<span class="goods-price-promotionShow goods-price-bigshow" v-if="goodsDetail.promotionPrice">{{ formatPrice(goodsDetail.promotionPrice)[0] }}</span>
|
|
||||||
.{{ formatPrice(goodsDetail.promotionPrice)[1] }}
|
|
||||||
<span></span>
|
|
||||||
</span>
|
|
||||||
<div class="promotion-box">
|
|
||||||
¥
|
|
||||||
<span class="goods-price-bigshow">{{
|
|
||||||
formatPrice(goodsDetail.price)[0]
|
|
||||||
}}</span>
|
|
||||||
.{{ formatPrice(goodsDetail.price)[1] }}
|
|
||||||
<span></span>
|
|
||||||
</div>
|
|
||||||
</view>
|
|
||||||
<!-- 正常商品的价格 -->
|
|
||||||
<view class="goods-price" v-else>
|
|
||||||
¥
|
|
||||||
<span class="goods-price-bigshow">{{
|
|
||||||
formatPrice(goodsDetail.price)[0]
|
|
||||||
}}</span>
|
|
||||||
.{{ formatPrice(goodsDetail.price)[1] }}
|
|
||||||
<span></span>
|
|
||||||
</view>
|
|
||||||
<view class="goods-check-skus">
|
|
||||||
已选
|
|
||||||
<span class="goods-check-skus-name">
|
|
||||||
{{ selectName }}
|
|
||||||
<span>,{{ num }}个</span>
|
|
||||||
</span>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<!-- 商品信息 -->
|
|
||||||
<view class="goods-skus-box">
|
|
||||||
<!-- 规格 -->
|
|
||||||
<view class="goods-skus-view" :key="specIndex" v-for="(spec, specIndex) in formatList">
|
|
||||||
<view class="skus-view-list">
|
|
||||||
<view class="view-class-title">{{ spec.name }}</view>
|
|
||||||
<view :class="{ active: spec_val.id == currentSelceted[specIndex] }" class="skus-view-item" v-for="(spec_val, spec_index) in spec.values" :key="spec_index"
|
|
||||||
@click="handleClickSpec(spec, specIndex, spec_val)">{{ spec_val.value }}</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<!-- 数量 -->
|
|
||||||
<view class="goods-skus-number">
|
|
||||||
<view class="view-class-title">数量</view>
|
|
||||||
<u-number-box :bg-color="numberBox.bgColor" :color="numberBox.color" :input-width="numberBox.width" :input-height="numberBox.height" :size="numberBox.size" :min="1" v-model="num">
|
|
||||||
</u-number-box>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<!-- 按钮 -->
|
|
||||||
<view class="btns">
|
|
||||||
<view class="box-btn card" v-if="buyType !='PINTUAN'" @click="addToCartOrBuy('cart')">加入购物车</view>
|
|
||||||
<view class="box-btn buy" @click="addToCartOrBuy('buy')">立即购买</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</u-popup>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
<script>
|
|
||||||
import * as API_trade from "@/api/trade.js";
|
|
||||||
import setup from "./popup";
|
|
||||||
export default {
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
setup,
|
|
||||||
num: 1,
|
|
||||||
// 步进器的大小尺寸单位是 rpx
|
|
||||||
numberBox: {
|
|
||||||
width: "50",
|
|
||||||
height: "50",
|
|
||||||
size: "22",
|
|
||||||
color: "#333",
|
|
||||||
bgColor: "#fff",
|
|
||||||
},
|
|
||||||
selectName: "", //选中商品的昵称
|
|
||||||
selectSkuList: "", //选中商铺sku,
|
|
||||||
selectedSpecImg: "", //选中的图片路径
|
|
||||||
buyType: "", //用于存储促销,拼团等活动类型
|
|
||||||
parentOrder: "", //父级拼团活动的数据 - 如果是团员则有数据
|
|
||||||
formatList: [],
|
|
||||||
currentSelceted: [],
|
|
||||||
skuList: "",
|
|
||||||
isMask:false, //是否显示遮罩层
|
|
||||||
isClose:false, //是否可以点击遮罩关闭
|
|
||||||
};
|
|
||||||
},
|
|
||||||
props: [
|
|
||||||
|
|
||||||
"goodsDetail",
|
|
||||||
"buyMask",
|
|
||||||
"selectedSku",
|
|
||||||
"goodsSpec",
|
|
||||||
"addr",
|
|
||||||
],
|
|
||||||
watch: {
|
|
||||||
buyType: {
|
|
||||||
handler(val) {
|
|
||||||
this.buyType = val;
|
|
||||||
},
|
|
||||||
immediate: true,
|
|
||||||
},
|
|
||||||
selectSkuList: {
|
|
||||||
handler(val, oldval) {
|
|
||||||
this.$emit("changed", val);
|
|
||||||
},
|
|
||||||
deep: true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
|
|
||||||
methods: {
|
|
||||||
// 格式化金钱 1999 --> [1999,00]
|
|
||||||
formatPrice(val) {
|
|
||||||
if (typeof val == "undefined") {
|
|
||||||
return val;
|
|
||||||
}
|
|
||||||
return val.toFixed(2).split(".");
|
|
||||||
},
|
|
||||||
|
|
||||||
closeMask() {
|
|
||||||
this.$emit("closeBuy", false);
|
|
||||||
},
|
|
||||||
|
|
||||||
/**点击规格 */
|
|
||||||
handleClickSpec(val, index, specValue) {
|
|
||||||
this.$set(this.currentSelceted, index, specValue.id);
|
|
||||||
|
|
||||||
let selectedSkuId = this.goodsSpec.find((i) => {
|
|
||||||
let matched = true;
|
|
||||||
let specValues = i.specValues.filter((j) => j.specName !== "images");
|
|
||||||
|
|
||||||
for (let n = 0; n < specValues.length; n++) {
|
|
||||||
if (specValues[n].specValueId !== this.currentSelceted[n]) {
|
|
||||||
matched = false;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (matched) {
|
|
||||||
return i;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
this.selectSkuList = {
|
|
||||||
spec: {
|
|
||||||
specName: val.name,
|
|
||||||
specValue: specValue.value,
|
|
||||||
},
|
|
||||||
data: this.goodsDetail,
|
|
||||||
};
|
|
||||||
this.selectName = specValue.value;
|
|
||||||
|
|
||||||
this.$emit("handleClickSku", selectedSkuId.skuId,this.goodsDetail.id);
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 添加到购物车或购买
|
|
||||||
*/
|
|
||||||
addToCartOrBuy(val) {
|
|
||||||
if (!this.selectSkuList) {
|
|
||||||
uni.showToast({
|
|
||||||
title: "请选择规格商品",
|
|
||||||
icon: "none",
|
|
||||||
});
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
let data = {
|
|
||||||
skuId: this.goodsDetail.id,
|
|
||||||
num: this.num,
|
|
||||||
};
|
|
||||||
|
|
||||||
if (val == "cart") {
|
|
||||||
API_trade.addToCart(data).then((res) => {
|
|
||||||
if (res.data.code == 200) {
|
|
||||||
uni.showToast({
|
|
||||||
title: "商品已添加到购物车",
|
|
||||||
icon: "none",
|
|
||||||
});
|
|
||||||
|
|
||||||
this.$emit("queryCart");
|
|
||||||
this.closeMask();
|
|
||||||
} else {
|
|
||||||
uni.showToast({
|
|
||||||
title: res.data.message,
|
|
||||||
duration: 2000,
|
|
||||||
icon: "none",
|
|
||||||
});
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
// 判断是否拼团商品
|
|
||||||
if (this.buyType) {
|
|
||||||
data.cartType = "PINTUAN";
|
|
||||||
} else {
|
|
||||||
data.cartType = "BUY_NOW";
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
API_trade.addToCart(data).then((res) => {
|
|
||||||
if (res.data.code == 200) {
|
|
||||||
uni.navigateTo({
|
|
||||||
url: `/pages/order/fillorder?way=${data.cartType}&addr=${
|
|
||||||
this.addr.id || ''
|
|
||||||
}&parentOrder=${encodeURIComponent(
|
|
||||||
JSON.stringify(this.parentOrder)
|
|
||||||
)}`,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
},
|
|
||||||
formatSku(list) {
|
|
||||||
// 格式化数据
|
|
||||||
|
|
||||||
let arr = [{}];
|
|
||||||
list.forEach((item, index) => {
|
|
||||||
item.specValues.forEach((spec, specIndex) => {
|
|
||||||
let id = spec.specNameId;
|
|
||||||
let name = spec.specName;
|
|
||||||
let values = {
|
|
||||||
id: spec.specValueId,
|
|
||||||
value: spec.specValue,
|
|
||||||
quantity: item.quantity,
|
|
||||||
};
|
|
||||||
if (name === "images") {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
arr.forEach((arrItem, arrIndex) => {
|
|
||||||
if (
|
|
||||||
arrItem.name == name &&
|
|
||||||
arrItem.values &&
|
|
||||||
!arrItem.values.find((i) => i.id === values.id)
|
|
||||||
) {
|
|
||||||
arrItem.values.push(values);
|
|
||||||
}
|
|
||||||
|
|
||||||
let keys = arr.map((key) => {
|
|
||||||
return key.name;
|
|
||||||
});
|
|
||||||
if (!keys.includes(name)) {
|
|
||||||
arr.push({
|
|
||||||
id: id,
|
|
||||||
name: name,
|
|
||||||
values: [values],
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
arr.shift();
|
|
||||||
this.formatList = arr;
|
|
||||||
|
|
||||||
list.forEach((item) => {
|
|
||||||
if (item.skuId === this.goodsDetail.id) {
|
|
||||||
item.specValues
|
|
||||||
.filter((i) => i.specName !== "images")
|
|
||||||
.forEach((value, _index) => {
|
|
||||||
this.currentSelceted[_index] = value.specValueId;
|
|
||||||
|
|
||||||
this.selectName = value.specValue;
|
|
||||||
|
|
||||||
this.selectSkuList = {
|
|
||||||
spec: value,
|
|
||||||
data: this.goodsDetail,
|
|
||||||
};
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
this.skuList = list;
|
|
||||||
},
|
|
||||||
},
|
|
||||||
|
|
||||||
mounted() {
|
|
||||||
this.formatSku(this.goodsSpec);
|
|
||||||
},
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
@import "./popup.scss";
|
|
||||||
|
|
||||||
.buy {
|
|
||||||
background-image: linear-gradient(135deg, #ffba0d, #ffc30d 69%, #ffcf0d);
|
|
||||||
box-shadow: 0 2px 6px 0 rgba(255, 65, 66, 0.2);
|
|
||||||
}
|
|
||||||
|
|
||||||
.card {
|
|
||||||
background-image: linear-gradient(135deg, #f2140c, #f2270c 70%, #f24d0c);
|
|
||||||
box-shadow: 0 2px 6px 0 rgba(255, 65, 66, 0.2);
|
|
||||||
}
|
|
||||||
|
|
||||||
/deep/.u-icon-plus,
|
|
||||||
.u-icon-minus,
|
|
||||||
.u-icon-disabled {
|
|
||||||
height: 30rpx !important;
|
|
||||||
background: #fff !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.goods-skus-number {
|
|
||||||
justify-content: space-between;
|
|
||||||
display: flex;
|
|
||||||
}
|
|
||||||
|
|
||||||
/deep/ .uni-scroll-view {
|
|
||||||
overflow: hidden !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.active {
|
|
||||||
background: $jd-light-color !important;
|
|
||||||
border: 2rpx solid $jd-color;
|
|
||||||
font-weight: bold;
|
|
||||||
color: $jd-color !important;
|
|
||||||
box-sizing: border-box;
|
|
||||||
}
|
|
||||||
|
|
||||||
.goods-skus-box {
|
|
||||||
overflow-y: auto;
|
|
||||||
height: 610rpx;
|
|
||||||
// #ifdef MP-WEIXIN
|
|
||||||
height: 570rpx;
|
|
||||||
// #endif
|
|
||||||
margin-bottom: 10rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.goods-skus-view {
|
|
||||||
overflow: hidden;
|
|
||||||
|
|
||||||
.skus-view-list {
|
|
||||||
> .skus-view-item {
|
|
||||||
flex: 1;
|
|
||||||
padding: 0 36rpx;
|
|
||||||
|
|
||||||
overflow: hidden;
|
|
||||||
height: 60rpx;
|
|
||||||
line-height: 60rpx;
|
|
||||||
float: left;
|
|
||||||
text-align: center;
|
|
||||||
margin-left: 24rpx;
|
|
||||||
margin-bottom: 20rpx;
|
|
||||||
font-size: 22rpx;
|
|
||||||
color: #262626;
|
|
||||||
background: #f2f2f2;
|
|
||||||
border-radius: 30rpx;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.goods-header {
|
|
||||||
height: 200rpx;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
margin-bottom: 36rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.goods-box {
|
|
||||||
padding: 50rpx 36rpx 0 36rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.goods-skus {
|
|
||||||
padding: 0 20rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.goods-price {
|
|
||||||
color: $jd-color;
|
|
||||||
line-height: 80rpx;
|
|
||||||
display: flex;
|
|
||||||
}
|
|
||||||
.promotion-box {
|
|
||||||
line-height: 1;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
text-decoration: line-through;
|
|
||||||
color: #999;
|
|
||||||
margin-left: 10rpx;
|
|
||||||
/deep/ span {
|
|
||||||
font-size: 30rpx;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.promotion {
|
|
||||||
font-size: 30rpx;
|
|
||||||
}
|
|
||||||
.goods-price-promotionShow {
|
|
||||||
font-size: 48rpx;
|
|
||||||
}
|
|
||||||
.goods-check-skus {
|
|
||||||
font-size: 24rpx;
|
|
||||||
color: #999;
|
|
||||||
> .goods-check-skus-name {
|
|
||||||
margin-left: 4rpx;
|
|
||||||
}
|
|
||||||
> span {
|
|
||||||
color: #333;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="wrapper">
|
<view class="wrapper" v-if="flage">
|
||||||
<div class='goods' v-if="selectedGoods">
|
<div class='goods' v-if="selectedGoods">
|
||||||
<image class="goods-image" :src="selectedGoods.thumbnail" alt="">
|
<image class="goods-image" :src="selectedGoods.thumbnail" alt="">
|
||||||
<p class="goodsName">{{selectedGoods.goodsName}}</p>
|
<p class="goodsName">{{selectedGoods.goodsName}}</p>
|
||||||
@@ -67,11 +67,12 @@ import { getGoods } from "@/api/goods.js";
|
|||||||
import { getPinTuanShare } from "@/api/order";
|
import { getPinTuanShare } from "@/api/order";
|
||||||
import shares from "@/components/m-share/index";
|
import shares from "@/components/m-share/index";
|
||||||
import storage from "@/utils/storage.js";
|
import storage from "@/utils/storage.js";
|
||||||
import popupGoods from "./popup/goods"; //购物车商品的模块
|
import popupGoods from "@/components/m-buy/goods"; //购物车商品的模块
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
flage: false, //判断接口是否正常请求
|
||||||
addr: {
|
addr: {
|
||||||
id: "",
|
id: "",
|
||||||
},
|
},
|
||||||
@@ -138,7 +139,8 @@ export default {
|
|||||||
// 实例化本页面
|
// 实例化本页面
|
||||||
async init(sn, sku) {
|
async init(sn, sku) {
|
||||||
let res = await getPinTuanShare(sn, sku);
|
let res = await getPinTuanShare(sn, sku);
|
||||||
if (res.data.success) {
|
if (res.data.success && res.data.result.promotionGoods) {
|
||||||
|
this.flage = true;
|
||||||
this.data = res.data.result;
|
this.data = res.data.result;
|
||||||
this.selectedGoods = res.data.result.promotionGoods;
|
this.selectedGoods = res.data.result.promotionGoods;
|
||||||
let endTime = Date.parse(
|
let endTime = Date.parse(
|
||||||
@@ -170,21 +172,30 @@ export default {
|
|||||||
} else {
|
} else {
|
||||||
this.isMaster = false;
|
this.isMaster = false;
|
||||||
// 获取商品详情
|
// 获取商品详情
|
||||||
this.getGoodsDetail(this.routers.sku, this.routers.goodsId);
|
this.getGoodsDetail({
|
||||||
|
id: this.routers.sku,
|
||||||
|
goodsId: this.routers.goodsId,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获取当前商品是否已经购买
|
// 获取当前商品是否已经购买
|
||||||
if (storage.getUserInfo().id) {
|
if (storage.getUserInfo().id) {
|
||||||
|
|
||||||
let isBuy = res.data.result.pintuanMemberVOS.filter((item) => {
|
let isBuy = res.data.result.pintuanMemberVOS.filter((item) => {
|
||||||
return item.memberId == storage.getUserInfo().id;
|
return item.memberId == storage.getUserInfo().id;
|
||||||
});
|
});
|
||||||
isBuy.length != 0 ? (this.isBuy = true) : (this.isBuy = false);
|
isBuy.length != 0 ? (this.isBuy = true) : (this.isBuy = false);
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
uni.showToast({
|
||||||
|
title: "当前拼团单有误!请联系管理员重试",
|
||||||
|
duration: 2000,
|
||||||
|
icon: "none",
|
||||||
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 获取商品详情
|
// 获取商品详情
|
||||||
getGoodsDetail(id, goodsId) {
|
getGoodsDetail(val) {
|
||||||
|
let { id, goodsId } = val;
|
||||||
uni.showLoading({
|
uni.showLoading({
|
||||||
title: "加载中",
|
title: "加载中",
|
||||||
mask: true,
|
mask: true,
|
||||||
|
|||||||
@@ -2,76 +2,45 @@
|
|||||||
<div class="wrapper">
|
<div class="wrapper">
|
||||||
<div class="pay-wrapper">
|
<div class="pay-wrapper">
|
||||||
<div class="pay-money">
|
<div class="pay-money">
|
||||||
¥{{ payPrice | unitPrice }}
|
¥{{ Number(payPrice) | unitPrice }}
|
||||||
</div>
|
</div>
|
||||||
<div class="pay-btns">
|
<div class="pay-btns">
|
||||||
<div v-show="!from" @click="navigateTo('/pages/order/myOrder?status=0')">查看订单</div>
|
<div v-show="!from" @click="checkOrder">查看{{this.orderType == "RECHARGE" ? '余额' : '订单'}}</div>
|
||||||
<div @click="navigateTo('/pages/tabbar/home/index', 'switch')">回到首页</div>
|
<div @click="navigateTo('/pages/tabbar/home/index', 'switch')">回到首页</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="pay-box">
|
<div class="pay-box">
|
||||||
<div class="pay-tag-box">
|
<div class="pay-tag-box">
|
||||||
<h2>订单支付成功!</h2>
|
<h2>订单支付成功!</h2>
|
||||||
|
|
||||||
<div class="pay-item">
|
<div class="pay-item">
|
||||||
<div>
|
<div>
|
||||||
支付方式:
|
支付方式:
|
||||||
</div>
|
</div>
|
||||||
<div>{{paymentMethod | paymentTypeFilter}}</div>
|
<div>{{paymentMethod | paymentTypeFilter}}</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
|
||||||
<!-- #ifdef MP-WEIXIN -->
|
|
||||||
<div class="subscribe flex">
|
|
||||||
<div>订阅订单状态</div>
|
|
||||||
<div>
|
|
||||||
<u-switch size="50" :disabled="checked" :active-color="activeColor" @change="changeStatus" v-model="checked"></u-switch>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<!-- #endif -->
|
|
||||||
</div>
|
|
||||||
<div class="goods-recommend">--商品推荐--</div>
|
|
||||||
<div class="goods-list">
|
|
||||||
<div @click="handleClick(item)" class="goods-item" v-for="(item, item_index) in goodsList" :key="item_index">
|
|
||||||
<div class="goods-img">
|
|
||||||
<u-image :src="item.thumbnail" mode="aspectFill" height="350rpx" width="100%">
|
|
||||||
<u-loading slot="loading"></u-loading>
|
|
||||||
</u-image>
|
|
||||||
</div>
|
|
||||||
<div class="goods-desc">
|
|
||||||
<div class="goods-title">
|
|
||||||
{{ item.goodsName }}
|
|
||||||
</div>
|
|
||||||
<div class="goods-bottom">
|
|
||||||
<div class="goods-price">¥{{ item.price | unitPrice }}</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<goodsRecommend />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import { getGoodsList } from "@/api/goods.js";
|
import goodsRecommend from "@/components/m-goods-recommend";
|
||||||
import { getWeChatMpMessage } from "@/api/message.js";
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
checked: false,
|
checked: false,
|
||||||
paymentMethod: "",
|
paymentMethod: "",
|
||||||
|
|
||||||
from: "",
|
from: "",
|
||||||
payPrice: 0,
|
payPrice: 0,
|
||||||
goodsList: [],
|
goodsList: [],
|
||||||
activeColor:this.$mainColor,
|
activeColor: this.$mainColor,
|
||||||
params: {
|
|
||||||
pageSize: 12,
|
|
||||||
pageNumber: 0,
|
|
||||||
},
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
components: {
|
||||||
|
goodsRecommend,
|
||||||
|
},
|
||||||
filters: {
|
filters: {
|
||||||
paymentTypeFilter(val) {
|
paymentTypeFilter(val) {
|
||||||
switch (val) {
|
switch (val) {
|
||||||
@@ -89,50 +58,30 @@ export default {
|
|||||||
onLoad(options) {
|
onLoad(options) {
|
||||||
this.paymentMethod = options.paymentMethod || "";
|
this.paymentMethod = options.paymentMethod || "";
|
||||||
this.from = options.from || "";
|
this.from = options.from || "";
|
||||||
this.payPrice = parseInt(options.payPrice) || 0;
|
this.payPrice = options.payPrice || 0;
|
||||||
//搜索商品
|
this.orderType = options.orderType;
|
||||||
this.initGoods();
|
// this.sendMessage()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
checkOrder() {
|
||||||
|
/**
|
||||||
|
* 查看订单
|
||||||
|
* 1.充值跳转到明细里面
|
||||||
|
* 2.支付跳转到订单详情
|
||||||
|
*/
|
||||||
|
if (this.orderType == "RECHARGE") {
|
||||||
|
uni.reLaunch({
|
||||||
|
url: `/pages/mine/deposit/operation`,
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
this.navigateTo("/pages/order/myOrder?status=0");
|
||||||
|
}
|
||||||
|
},
|
||||||
changeStatus(val) {
|
changeStatus(val) {
|
||||||
if (val) {
|
if (val) {
|
||||||
this.sendMessage();
|
this.sendMessage();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
async initGoods() {
|
|
||||||
let goodsList = await getGoodsList(this.params);
|
|
||||||
this.goodsList.push(...goodsList.data.result.content);
|
|
||||||
},
|
|
||||||
sendMessage() {
|
|
||||||
//订阅消息
|
|
||||||
//#ifdef MP-WEIXIN
|
|
||||||
getWeChatMpMessage().then((res) => {
|
|
||||||
var message = res.data.result;
|
|
||||||
var templateid = message.map((item) => item.code);
|
|
||||||
uni.requestSubscribeMessage({
|
|
||||||
tmplIds: templateid,
|
|
||||||
success: (res) => {
|
|
||||||
for(let key in res){
|
|
||||||
if(res[key] == "reject"){
|
|
||||||
this.checked = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
},
|
|
||||||
fail: (res) => {
|
|
||||||
uni.removeStorageSync("acceptSubscribeMessage");
|
|
||||||
this.checked = false;
|
|
||||||
},
|
|
||||||
});
|
|
||||||
});
|
|
||||||
//#endif
|
|
||||||
},
|
|
||||||
|
|
||||||
handleClick(item) {
|
|
||||||
uni.navigateTo({
|
|
||||||
url: `/pages/product/goods?id=${item.id}&goodsId=${item.goodsId}`,
|
|
||||||
});
|
|
||||||
},
|
|
||||||
|
|
||||||
navigateTo(url, type) {
|
navigateTo(url, type) {
|
||||||
if (type === "switch") {
|
if (type === "switch") {
|
||||||
@@ -155,7 +104,6 @@ export default {
|
|||||||
margin: 0 auto 40rpx auto;
|
margin: 0 auto 40rpx auto;
|
||||||
padding: 0 20rpx 20rpx;
|
padding: 0 20rpx 20rpx;
|
||||||
width: 80%;
|
width: 80%;
|
||||||
|
|
||||||
}
|
}
|
||||||
.pay-btns {
|
.pay-btns {
|
||||||
display: flex;
|
display: flex;
|
||||||
@@ -221,84 +169,4 @@ export default {
|
|||||||
background: #fff;
|
background: #fff;
|
||||||
border-top-right-radius: 100rpx;
|
border-top-right-radius: 100rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**商品代码 */
|
|
||||||
$w_94: 94%;
|
|
||||||
|
|
||||||
.goods-recommend {
|
|
||||||
background: #f7f7f7;
|
|
||||||
height: 100rpx;
|
|
||||||
line-height: 100rpx;
|
|
||||||
text-align: center;
|
|
||||||
font-size: 30rpx;
|
|
||||||
font-weight: bold;
|
|
||||||
}
|
|
||||||
|
|
||||||
.goods-list {
|
|
||||||
display: flex;
|
|
||||||
|
|
||||||
flex-wrap: wrap;
|
|
||||||
background: #f7f7f7;
|
|
||||||
}
|
|
||||||
|
|
||||||
.goods-item {
|
|
||||||
width: 50%;
|
|
||||||
margin-bottom: 10px;
|
|
||||||
border-radius: 0.4em;
|
|
||||||
overflow: hidden;
|
|
||||||
}
|
|
||||||
|
|
||||||
.goods-img {
|
|
||||||
position: relative;
|
|
||||||
margin: 0 auto;
|
|
||||||
// width: 158px;
|
|
||||||
width: $w_94;
|
|
||||||
height: 350rpx;
|
|
||||||
border-top-left-radius: 20rpx;
|
|
||||||
border-top-right-radius: 20rpx;
|
|
||||||
|
|
||||||
overflow: hidden;
|
|
||||||
|
|
||||||
> img {
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.goods-desc {
|
|
||||||
border-bottom-left-radius: 20rpx;
|
|
||||||
border-bottom-right-radius: 20rpx;
|
|
||||||
width: $w_94;
|
|
||||||
background: #fff;
|
|
||||||
padding: 8rpx 0 8rpx 8rpx;
|
|
||||||
margin: 0 auto;
|
|
||||||
|
|
||||||
> .goods-title {
|
|
||||||
font-size: 12px;
|
|
||||||
height: 70rpx;
|
|
||||||
display: -webkit-box;
|
|
||||||
font-weight: 500;
|
|
||||||
-webkit-box-orient: vertical;
|
|
||||||
|
|
||||||
-webkit-line-clamp: 2;
|
|
||||||
|
|
||||||
overflow: hidden;
|
|
||||||
}
|
|
||||||
|
|
||||||
> .goods-bottom {
|
|
||||||
display: flex;
|
|
||||||
font-weight: bold;
|
|
||||||
|
|
||||||
> .goods-price {
|
|
||||||
line-height: 2;
|
|
||||||
color: $main-color;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.goods-icon {
|
|
||||||
right: 10rpx;
|
|
||||||
top: 10rpx;
|
|
||||||
position: absolute;
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -1,139 +0,0 @@
|
|||||||
<template>
|
|
||||||
<view class="about-us">
|
|
||||||
<view class="box flex-center">
|
|
||||||
<image src="/static/logo.png" mode="scaleToFill"></image>
|
|
||||||
<view>{{config.name}}</view>
|
|
||||||
</view>
|
|
||||||
<u-cell-group :border="false">
|
|
||||||
<!-- #ifdef APP-PLUS -->
|
|
||||||
<u-cell-item title="检查更新" @click="checkUpdate"></u-cell-item>
|
|
||||||
<!-- #endif -->
|
|
||||||
<u-cell-item title="证照信息" @click="navigateTo('/pages/mine/help/tips?type=message')"></u-cell-item>
|
|
||||||
<u-cell-item title="服务协议" @click="navigateTo('/pages/mine/help/tips?type=user')"></u-cell-item>
|
|
||||||
<u-cell-item title="隐私协议" @click="navigateTo('/pages/mine/help/tips?type=privacy')"></u-cell-item>
|
|
||||||
<u-cell-item title="关于我们" :border-bottom="false" @click="navigateTo('/pages/mine/help/tips?type=about')"></u-cell-item>
|
|
||||||
</u-cell-group>
|
|
||||||
<view class="intro flex-center c-content">
|
|
||||||
<view>客服热线:13161366885</view>
|
|
||||||
<view>客服邮箱:lili@lili.com</view>
|
|
||||||
</view>
|
|
||||||
<view class="bottom flex-center">
|
|
||||||
<view @click="navigateTo('/pages/help/tips?type=user')">《lili商城用户协议》</view>
|
|
||||||
<view>CopyRight @ {{config.name}} </view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
// #ifdef APP-PLUS
|
|
||||||
import APPUpdate, { getCurrentNo, getServerNo } from "@/plugins/APPUpdate";
|
|
||||||
import { getAppVersionList } from "@/api/message.js";
|
|
||||||
// #endif
|
|
||||||
import config from "@/config/config";
|
|
||||||
export default {
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
config,
|
|
||||||
showUpdate: false,
|
|
||||||
version: "",
|
|
||||||
currentNo: 0,
|
|
||||||
params: {
|
|
||||||
pageNumber: 1,
|
|
||||||
pageSize: 5,
|
|
||||||
},
|
|
||||||
};
|
|
||||||
},
|
|
||||||
onLoad() {
|
|
||||||
/**
|
|
||||||
* 根据当前app系统判断
|
|
||||||
*/
|
|
||||||
// #ifdef APP-PLUS
|
|
||||||
let _this = this;
|
|
||||||
plus.runtime.getProperty(plus.runtime.appid, function (inf) {
|
|
||||||
var wgtVer = inf.version;
|
|
||||||
_this.currentVersion = wgtVer;
|
|
||||||
});
|
|
||||||
if (uni.getSystemInfoSync().platform === "android") {
|
|
||||||
this.params.type = 0;
|
|
||||||
} else {
|
|
||||||
this.params.type = 1;
|
|
||||||
}
|
|
||||||
// #endif
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
/**
|
|
||||||
* 点击查看更新
|
|
||||||
*/
|
|
||||||
async checkUpdate() {
|
|
||||||
// #ifdef APP-PLUS
|
|
||||||
let needUpdate = false;
|
|
||||||
getCurrentNo((res) => {
|
|
||||||
this.currentNo = res.versionCode;
|
|
||||||
});
|
|
||||||
let res = await getAppVersionList(this.params);
|
|
||||||
res.data.data.forEach((ele) => {
|
|
||||||
let versionDetail = ele.version.replace(/\./g, "");
|
|
||||||
if (versionDetail.length < this.currentNo.length) {
|
|
||||||
versionDetail = versionDetail.padEnd(this.currentNo.length, "0");
|
|
||||||
}
|
|
||||||
if (versionDetail > this.currentNo) {
|
|
||||||
needUpdate = true;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
if (needUpdate) {
|
|
||||||
APPUpdate(true);
|
|
||||||
} else {
|
|
||||||
uni.showToast({
|
|
||||||
title: "已是最新版本!",
|
|
||||||
});
|
|
||||||
}
|
|
||||||
// #endif
|
|
||||||
},
|
|
||||||
navigateTo(url) {
|
|
||||||
uni.navigateTo({
|
|
||||||
url,
|
|
||||||
});
|
|
||||||
},
|
|
||||||
},
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
.box {
|
|
||||||
width: 100%;
|
|
||||||
height: 242rpx;
|
|
||||||
image {
|
|
||||||
transform: scale(2.5);
|
|
||||||
width: 94rpx;
|
|
||||||
height: 94rpx;
|
|
||||||
}
|
|
||||||
view {
|
|
||||||
font-size: 30rpx;
|
|
||||||
margin-top: 25rpx;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.u-cell {
|
|
||||||
padding: 35rpx 20rpx;
|
|
||||||
height: 110rpx;
|
|
||||||
}
|
|
||||||
.intro {
|
|
||||||
color: #999999;
|
|
||||||
font-size: $font-sm;
|
|
||||||
margin-top: 20rpx;
|
|
||||||
border: none;
|
|
||||||
padding: 45rpx 0;
|
|
||||||
line-height: 2em;
|
|
||||||
}
|
|
||||||
.bottom {
|
|
||||||
:nth-child(1) {
|
|
||||||
color: $main-color;
|
|
||||||
font-size: 22rpx;
|
|
||||||
margin-bottom: 20rpx;
|
|
||||||
}
|
|
||||||
:last-child {
|
|
||||||
font-size: 20rpx;
|
|
||||||
color: $font-color-light;
|
|
||||||
}
|
|
||||||
margin-top: 110rpx;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -28,7 +28,8 @@
|
|||||||
<div class="saveBtn" @click="save">保存</div>
|
<div class="saveBtn" @click="save">保存</div>
|
||||||
</u-form>
|
</u-form>
|
||||||
|
|
||||||
<m-city :provinceData="list" headTitle="区域选择" ref="cityPicker" @funcValue="getpickerParentValue" pickerSize="4"></m-city>
|
<m-city :provinceData="list" headTitle="区域选择" ref="cityPicker" @funcValue="getpickerParentValue" pickerSize="4">
|
||||||
|
</m-city>
|
||||||
|
|
||||||
<uniMap v-if="mapFlage" @close="closeMap" @callback="callBackAddress" />
|
<uniMap v-if="mapFlage" @close="closeMap" @callback="callBackAddress" />
|
||||||
</div>
|
</div>
|
||||||
@@ -149,15 +150,7 @@ export default {
|
|||||||
delete this.form.___path;
|
delete this.form.___path;
|
||||||
addAddress(this.form).then((res) => {
|
addAddress(this.form).then((res) => {
|
||||||
if (res.data.success) {
|
if (res.data.success) {
|
||||||
if (this.routerVal.type == "order") {
|
uni.navigateBack();
|
||||||
uni.redirectTo({
|
|
||||||
url: `/pages/mine/address/address?way=${this.routerVal.way}`,
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
uni.redirectTo({
|
|
||||||
url: `/pages/mine/address/addressManage`,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
@@ -198,8 +191,8 @@ export default {
|
|||||||
return _child.id == item.id;
|
return _child.id == item.id;
|
||||||
});
|
});
|
||||||
|
|
||||||
this.form.lat = _town[0].center.split(",")[0];
|
this.form.lat = _town[0].center.split(",")[1];
|
||||||
this.form.lon = _town[0].center.split(",")[1];
|
this.form.lon = _town[0].center.split(",")[0];
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="address">
|
<view class="address">
|
||||||
|
|
||||||
<u-empty class="empty" v-if="empty" text="暂无收货地址" mode="address"></u-empty>
|
<u-empty class="empty" v-if="addressList.length == 0" text="暂无收货地址" mode="address"></u-empty>
|
||||||
<view class="list" v-else>
|
<view class="list" v-else>
|
||||||
<view class="item c-content" v-for="(item, index) in addressList" :key="index">
|
<view class="item c-content" v-for="(item, index) in addressList" :key="index">
|
||||||
<view class="basic" @click="selectAddressData(item)">
|
<view class="basic" @click="selectAddressData(item)">
|
||||||
@@ -50,7 +50,6 @@ export default {
|
|||||||
return {
|
return {
|
||||||
addressList: [], //地址列表
|
addressList: [], //地址列表
|
||||||
showAction: false, //是否显示下栏框
|
showAction: false, //是否显示下栏框
|
||||||
empty: false, //是否为空
|
|
||||||
removeList: [
|
removeList: [
|
||||||
{
|
{
|
||||||
text: "确定",
|
text: "确定",
|
||||||
@@ -67,7 +66,11 @@ export default {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
onPullDownRefresh() {
|
||||||
|
//下拉刷新
|
||||||
|
this.addressList = [];
|
||||||
|
this.getAddressList();
|
||||||
|
},
|
||||||
onLoad: function (val) {
|
onLoad: function (val) {
|
||||||
this.routerVal = val;
|
this.routerVal = val;
|
||||||
},
|
},
|
||||||
@@ -76,19 +79,12 @@ export default {
|
|||||||
this.getAddressList();
|
this.getAddressList();
|
||||||
},
|
},
|
||||||
onHide() {},
|
onHide() {},
|
||||||
onBackPress(e) {
|
|
||||||
uni.redirectTo({
|
|
||||||
url: "/pages/order/fillorder?way=" + this.routerVal.way,
|
|
||||||
});
|
|
||||||
return true;
|
|
||||||
},
|
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
async selectAddressData(val) {
|
async selectAddressData(val) {
|
||||||
await API_Trade.setAddressId(val.id, this.routerVal.way);
|
await API_Trade.setAddressId(val.id, this.routerVal.way);
|
||||||
|
|
||||||
uni.redirectTo({
|
uni.navigateBack({
|
||||||
url: `/pages/order/fillorder?way=${this.routerVal.way}`,
|
delta: 1,
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
//获取地址列表
|
//获取地址列表
|
||||||
@@ -99,18 +95,11 @@ export default {
|
|||||||
this.params.pageNumber,
|
this.params.pageNumber,
|
||||||
this.params.pageSize
|
this.params.pageSize
|
||||||
).then((res) => {
|
).then((res) => {
|
||||||
|
res.data.result.records.forEach((item) => {
|
||||||
if (res.data.result.records.length == 0) {
|
item.consigneeAddressPath = item.consigneeAddressPath.split(",");
|
||||||
this.empty = true;
|
});
|
||||||
} else {
|
this.addressList = res.data.result.records;
|
||||||
res.data.result.records.forEach((item) => {
|
console.log(this.addressList);
|
||||||
item.consigneeAddressPath = item.consigneeAddressPath.split(",");
|
|
||||||
});
|
|
||||||
|
|
||||||
this.$set(this, "addressList", res.data.result.records);
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
uni.hideLoading();
|
uni.hideLoading();
|
||||||
});
|
});
|
||||||
@@ -139,7 +128,6 @@ export default {
|
|||||||
},
|
},
|
||||||
//新建。编辑地址
|
//新建。编辑地址
|
||||||
addAddress(id) {
|
addAddress(id) {
|
||||||
|
|
||||||
if (id) {
|
if (id) {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url:
|
url:
|
||||||
@@ -177,5 +165,5 @@ export default {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
@import './address.scss';
|
@import "./address.scss";
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="address">
|
<view class="address">
|
||||||
<u-empty class="empty" v-if="empty" text="暂无收货地址" mode="address"></u-empty>
|
<u-empty class="empty" v-if="this.addressList == 0" text="暂无收货地址" mode="address"></u-empty>
|
||||||
<view class="list" v-else>
|
<view class="list" >
|
||||||
<view class="item c-content" v-for="(item, index) in addressList" :key="index">
|
<view class="item c-content" v-for="(item, index) in addressList" :key="index">
|
||||||
<view class="basic">
|
<view class="basic">
|
||||||
<text>{{ item.name }}</text>
|
<text>{{ item.name }}</text>
|
||||||
@@ -50,7 +50,7 @@ export default {
|
|||||||
return {
|
return {
|
||||||
addressList: [], //地址列表
|
addressList: [], //地址列表
|
||||||
showAction: false, //是否显示下栏框
|
showAction: false, //是否显示下栏框
|
||||||
empty: false, //是否为空
|
|
||||||
removeList: [
|
removeList: [
|
||||||
{
|
{
|
||||||
text: "确定",
|
text: "确定",
|
||||||
@@ -60,7 +60,7 @@ export default {
|
|||||||
text: "确定要删除该收货人信息吗?",
|
text: "确定要删除该收货人信息吗?",
|
||||||
},
|
},
|
||||||
removeId: "", //删除的地址id
|
removeId: "", //删除的地址id
|
||||||
routerVal: "",
|
routerVal: "",
|
||||||
params: {
|
params: {
|
||||||
pageNumber: 1,
|
pageNumber: 1,
|
||||||
pageSize: 1000,
|
pageSize: 1000,
|
||||||
@@ -77,10 +77,16 @@ export default {
|
|||||||
onLoad: function (val) {
|
onLoad: function (val) {
|
||||||
this.routerVal = val;
|
this.routerVal = val;
|
||||||
},
|
},
|
||||||
|
onPullDownRefresh() {
|
||||||
|
//下拉刷新
|
||||||
|
this.addressList = [];
|
||||||
|
this.getAddressList();
|
||||||
|
},
|
||||||
/**
|
/**
|
||||||
* 进入页面检测当前账户是否登录
|
* 进入页面检测当前账户是否登录
|
||||||
*/
|
*/
|
||||||
onShow() {
|
onShow() {
|
||||||
|
let that = this;
|
||||||
if (this.$options.filters.isLogin("auth")) {
|
if (this.$options.filters.isLogin("auth")) {
|
||||||
this.getAddressList();
|
this.getAddressList();
|
||||||
} else {
|
} else {
|
||||||
@@ -90,9 +96,7 @@ export default {
|
|||||||
confirmColor: this.$lightColor,
|
confirmColor: this.$lightColor,
|
||||||
success: function (res) {
|
success: function (res) {
|
||||||
if (res.confirm) {
|
if (res.confirm) {
|
||||||
uni.navigateTo({
|
that.$options.filters.navigateToLogin();
|
||||||
url: "/pages/passport/login",
|
|
||||||
});
|
|
||||||
} else if (res.cancel) {
|
} else if (res.cancel) {
|
||||||
uni.navigateBack();
|
uni.navigateBack();
|
||||||
}
|
}
|
||||||
@@ -108,14 +112,11 @@ export default {
|
|||||||
this.params.pageNumber,
|
this.params.pageNumber,
|
||||||
this.params.pageSize
|
this.params.pageSize
|
||||||
).then((res) => {
|
).then((res) => {
|
||||||
if (res.data.result.records.length == 0) {
|
res.data.result.records.forEach((item) => {
|
||||||
this.empty = true;
|
item.consigneeAddressPath = item.consigneeAddressPath.split(",");
|
||||||
} else {
|
});
|
||||||
res.data.result.records.forEach((item) => {
|
this.addressList = res.data.result.records;
|
||||||
item.consigneeAddressPath = item.consigneeAddressPath.split(",");
|
|
||||||
});
|
|
||||||
this.addressList = res.data.result.records;
|
|
||||||
}
|
|
||||||
uni.hideLoading();
|
uni.hideLoading();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@@ -169,5 +170,5 @@ export default {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
@import './address.scss';
|
@import "./address.scss";
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -1,14 +1,17 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="wap">
|
<view class="wap">
|
||||||
|
<u-navbar back-text="" title="预存款列表">
|
||||||
|
</u-navbar>
|
||||||
<view class="wrapper-show-money">
|
<view class="wrapper-show-money">
|
||||||
<view class="money-view">
|
<view class="money-view">
|
||||||
<h3>预存款金额 </h3>
|
<h3>预存款金额 </h3>
|
||||||
<view class="money">¥{{walletNum | unitPrice }}</view>
|
<view class="money">¥{{walletNum | unitPrice }}</view>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="wrapper-tabs">
|
<view class="wrapper-tabs">
|
||||||
|
|
||||||
<swiper class="swiper-box" @change="changeSwiper" :current="swiperCurrent" @transition="transition" @animationfinish="animationfinish">
|
<swiper class="swiper-box" :current="swiperCurrent">
|
||||||
<swiper-item class="swiper-item" v-for="index in list.length" :key="index">
|
<swiper-item class="swiper-item" v-for="index in list.length" :key="index">
|
||||||
<scroll-view class="scroll-v view-wrapper" enableBackToTop="true" scroll-with-animation scroll-y @scrolltolower="loadMore">
|
<scroll-view class="scroll-v view-wrapper" enableBackToTop="true" scroll-with-animation scroll-y @scrolltolower="loadMore">
|
||||||
<view v-if="datas.length!=0" class="view-item" v-for="(logItem, logIndex) in datas" :key="logIndex">
|
<view v-if="datas.length!=0" class="view-item" v-for="(logItem, logIndex) in datas" :key="logIndex">
|
||||||
@@ -37,12 +40,11 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { getUserRecharge, getWalletLog } from "@/api/members";
|
import { getUserRecharge, getWalletLog } from "@/api/members";
|
||||||
import storage from "@/utils/storage.js";
|
|
||||||
import { getUserWallet } from "@/api/members";
|
import { getUserWallet } from "@/api/members";
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
walletNum:0,
|
walletNum: 0,
|
||||||
status: "loadmore",
|
status: "loadmore",
|
||||||
current: 0,
|
current: 0,
|
||||||
swiperCurrent: 0,
|
swiperCurrent: 0,
|
||||||
@@ -77,6 +79,7 @@ export default {
|
|||||||
this.walletNum = result.data.result.memberWallet;
|
this.walletNum = result.data.result.memberWallet;
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|
||||||
/**分页获取预存款充值记录 */
|
/**分页获取预存款充值记录 */
|
||||||
getRecharge() {
|
getRecharge() {
|
||||||
this.status = "loading";
|
this.status = "loading";
|
||||||
@@ -105,10 +108,7 @@ export default {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
// 点击swiper的时候清空数据
|
|
||||||
changeSwiper() {
|
|
||||||
this.groupBuy = [];
|
|
||||||
},
|
|
||||||
changed(index) {
|
changed(index) {
|
||||||
this.datas = [];
|
this.datas = [];
|
||||||
this.swiperCurrent = index;
|
this.swiperCurrent = index;
|
||||||
@@ -121,19 +121,6 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
// swiper-item左右移动,通知tabs的滑块跟随移动
|
|
||||||
transition({ detail: { dx } }) {
|
|
||||||
this.$refs.tabs.setDx(dx);
|
|
||||||
},
|
|
||||||
// 由于swiper的内部机制问题,快速切换swiper不会触发dx的连续变化,需要在结束时重置状态
|
|
||||||
// swiper滑动结束,分别设置tabs和swiper的状态
|
|
||||||
animationfinish(e) {
|
|
||||||
// this.groupBuy = []
|
|
||||||
let current = e.detail.current;
|
|
||||||
this.$refs.tabs.setFinishCurrent(current);
|
|
||||||
this.swiperCurrent = current;
|
|
||||||
this.current = current;
|
|
||||||
},
|
|
||||||
loadMore() {
|
loadMore() {
|
||||||
this.params.pageNumber++;
|
this.params.pageNumber++;
|
||||||
this.getWallet();
|
this.getWallet();
|
||||||
@@ -144,93 +131,96 @@ export default {
|
|||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.green {
|
.green {
|
||||||
color: $aider-color-green !important;
|
color: $aider-color-green !important;
|
||||||
}
|
}
|
||||||
.view-item {
|
.view-item {
|
||||||
padding: 32rpx;
|
padding: 32rpx;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
}
|
}
|
||||||
.view-item-change {
|
.view-item-change {
|
||||||
text-align: right;
|
text-align: right;
|
||||||
> .-money {
|
> .-money {
|
||||||
font-size: 36rpx;
|
font-size: 36rpx;
|
||||||
color: $main-color;
|
color: $main-color;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
> .-time {
|
||||||
|
font-size: 22rpx;
|
||||||
|
color: #999;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.view-item-detail {
|
||||||
|
line-height: 1.75;
|
||||||
|
> .-title {
|
||||||
|
font-size: 28rpx;
|
||||||
|
}
|
||||||
|
> .-number {
|
||||||
|
font-size: 22rpx;
|
||||||
|
color: #999;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.submit-btn {
|
||||||
|
line-height: 90rpx;
|
||||||
|
text-align: center;
|
||||||
|
|
||||||
|
color: #fff;
|
||||||
|
background: $main-color;
|
||||||
|
|
||||||
|
margin: 0 auto;
|
||||||
|
height: 90rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.operation {
|
||||||
|
font-size: 32rpx;
|
||||||
|
margin-right: 24rpx;
|
||||||
|
color: rgb(96, 98, 102);
|
||||||
|
}
|
||||||
|
.money {
|
||||||
|
font-size: 40rpx;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
> .-time {
|
|
||||||
font-size: 22rpx;
|
.money-view {
|
||||||
color: #999;
|
height: 100%;
|
||||||
|
width: 100%;
|
||||||
|
padding: 0 32rpx;
|
||||||
|
display: flex;
|
||||||
|
align-items: flex-end;
|
||||||
|
justify-content: center;
|
||||||
|
flex-direction: column;
|
||||||
|
color: #fff;
|
||||||
|
background-image: linear-gradient(
|
||||||
|
25deg,
|
||||||
|
$main-color,
|
||||||
|
$light-color,
|
||||||
|
$aider-light-color
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
.view-item-detail {
|
.swiper-item,
|
||||||
line-height: 1.75;
|
.scroll-v {
|
||||||
> .-title {
|
height: 100%;
|
||||||
font-size: 28rpx;
|
|
||||||
}
|
}
|
||||||
> .-number {
|
|
||||||
font-size: 22rpx;
|
.swiper-box {
|
||||||
color: #999;
|
/* #ifndef H5 */
|
||||||
|
height: calc(100vh - 200rpx);
|
||||||
|
/* #endif */
|
||||||
|
|
||||||
|
/* #ifdef H5 */
|
||||||
|
height: calc(100vh - 288rpx);
|
||||||
|
/* #endif */
|
||||||
|
}
|
||||||
|
|
||||||
|
.wap {
|
||||||
|
width: 100%;
|
||||||
|
height: calc(100vh - 44px);
|
||||||
|
}
|
||||||
|
|
||||||
|
.wrapper-show-money {
|
||||||
|
height: 200rpx;
|
||||||
|
// background-image: url('/static/img/main-bg.jpg');
|
||||||
}
|
}
|
||||||
}
|
|
||||||
.submit-btn {
|
|
||||||
line-height: 90rpx;
|
|
||||||
text-align: center;
|
|
||||||
|
|
||||||
color: #fff;
|
|
||||||
background: $main-color;
|
|
||||||
|
|
||||||
margin: 0 auto;
|
|
||||||
height: 90rpx;
|
|
||||||
}
|
|
||||||
.wap {
|
|
||||||
}
|
|
||||||
|
|
||||||
.money {
|
|
||||||
font-size: 40rpx;
|
|
||||||
font-weight: bold;
|
|
||||||
}
|
|
||||||
|
|
||||||
.money-view {
|
|
||||||
height: 100%;
|
|
||||||
width: 100%;
|
|
||||||
padding: 0 32rpx;
|
|
||||||
display: flex;
|
|
||||||
align-items: flex-end;
|
|
||||||
justify-content: center;
|
|
||||||
flex-direction: column;
|
|
||||||
color: #fff;
|
|
||||||
background-image: linear-gradient(
|
|
||||||
25deg,
|
|
||||||
$main-color,
|
|
||||||
$light-color,
|
|
||||||
$aider-light-color
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
.swiper-item,
|
|
||||||
.scroll-v {
|
|
||||||
height: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.swiper-box {
|
|
||||||
/* #ifndef H5 */
|
|
||||||
height: calc(100vh - 200rpx);
|
|
||||||
/* #endif */
|
|
||||||
|
|
||||||
/* #ifdef H5 */
|
|
||||||
height: calc(100vh - 288rpx);
|
|
||||||
/* #endif */
|
|
||||||
}
|
|
||||||
|
|
||||||
.wap {
|
|
||||||
width: 100%;
|
|
||||||
height: calc(100vh - 44px);
|
|
||||||
}
|
|
||||||
|
|
||||||
.wrapper-show-money {
|
|
||||||
height: 200rpx;
|
|
||||||
// background-image: url('/static/img/main-bg.jpg');
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
120
pages/mine/deposit/operation.vue
Normal file
120
pages/mine/deposit/operation.vue
Normal file
@@ -0,0 +1,120 @@
|
|||||||
|
<template>
|
||||||
|
<div class="wrapper">
|
||||||
|
<u-navbar :custom-back="back" title="余额"></u-navbar>
|
||||||
|
<div class="box">
|
||||||
|
<div class="deposit">预存款金额</div>
|
||||||
|
<div class="money">¥{{walletNum | unitPrice }}</div>
|
||||||
|
<div class="operation-btns">
|
||||||
|
<div class="operation-btn light" @click="navgition('/pages/mine/deposit/withdrawal')">提现</div>
|
||||||
|
<div class="operation-btn" @click="navgition('/pages/mine/deposit/recharge')">充值</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="box list" @click="navgition('/pages/mine/deposit/index')">
|
||||||
|
<div class="list-left">预存款明细</div>
|
||||||
|
<div class="list-right">
|
||||||
|
<u-icon name="arrow-right"></u-icon>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { getUserWallet } from "@/api/members";
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
walletNum: 0,
|
||||||
|
};
|
||||||
|
},
|
||||||
|
async onShow() {
|
||||||
|
if (this.$options.filters.isLogin("auth")) {
|
||||||
|
let result = await getUserWallet(); //预存款
|
||||||
|
this.walletNum = result.data.result.memberWallet;
|
||||||
|
} else {
|
||||||
|
uni.showToast({
|
||||||
|
icon: "none",
|
||||||
|
duration: 3000,
|
||||||
|
title: "请先登录!",
|
||||||
|
});
|
||||||
|
|
||||||
|
this.$options.filters.navigateToLogin("redirectTo");
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
back() {
|
||||||
|
uni.switchTab({
|
||||||
|
url: "/pages/tabbar/user/my",
|
||||||
|
});
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 跳转
|
||||||
|
*/
|
||||||
|
navgition(url) {
|
||||||
|
uni.navigateTo({
|
||||||
|
url,
|
||||||
|
});
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.list {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
.list-left {
|
||||||
|
flex: 8;
|
||||||
|
}
|
||||||
|
.list-right {
|
||||||
|
flex: 2;
|
||||||
|
text-align: right;
|
||||||
|
}
|
||||||
|
.wrapper {
|
||||||
|
width: 94%;
|
||||||
|
margin: 0 3%;
|
||||||
|
}
|
||||||
|
.box {
|
||||||
|
margin: 20rpx 0;
|
||||||
|
background: #fff;
|
||||||
|
border-radius: 20rpx;
|
||||||
|
|
||||||
|
padding: 40rpx;
|
||||||
|
}
|
||||||
|
.operation-btns {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
.money {
|
||||||
|
text-align: center;
|
||||||
|
color: #333;
|
||||||
|
font-size: 50rpx;
|
||||||
|
margin: 20rpx 0 40rpx 0;
|
||||||
|
letter-spacing: 2rpx;
|
||||||
|
}
|
||||||
|
.deposit {
|
||||||
|
margin-top: 50rpx;
|
||||||
|
text-align: center;
|
||||||
|
color: #999;
|
||||||
|
font-size: 28rpx;
|
||||||
|
|
||||||
|
letter-spacing: 2rpx;
|
||||||
|
}
|
||||||
|
.operation-btn {
|
||||||
|
background: #ee6d41;
|
||||||
|
color: #fff;
|
||||||
|
height: 90rpx;
|
||||||
|
width: 240rpx;
|
||||||
|
margin: 0 20rpx;
|
||||||
|
border-radius: 10rpx;
|
||||||
|
text-align: center;
|
||||||
|
line-height: 90rpx;
|
||||||
|
font-size: 32rpx;
|
||||||
|
}
|
||||||
|
.light {
|
||||||
|
background: #fdf2ee;
|
||||||
|
color: #ee6d41;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
50
pages/mine/deposit/recharge.vue
Normal file
50
pages/mine/deposit/recharge.vue
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
<template>
|
||||||
|
<view>
|
||||||
|
<view class="-list">
|
||||||
|
<view class="title">充值金额</view>
|
||||||
|
<view class="content">
|
||||||
|
<view class="price">
|
||||||
|
<span> ¥</span>
|
||||||
|
<u-input v-model="price" placeholder="" type="number" />
|
||||||
|
</view>
|
||||||
|
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="submit" :class="{'light':flag}" @click="handlerRecharge">充值</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
import { recharge } from "@/api/members";
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
price: 0,
|
||||||
|
flag: true,
|
||||||
|
};
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
price(val) {
|
||||||
|
val <= 0 ? (this.flag = true) : (this.flag = false);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
mounted() {},
|
||||||
|
methods: {
|
||||||
|
// 充值
|
||||||
|
async handlerRecharge() {
|
||||||
|
if (this.price > 0) {
|
||||||
|
|
||||||
|
let res = await recharge({ price: this.price });
|
||||||
|
if (res.data.success) {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: `/pages/cart/payment/payOrder?orderType=RECHARGE&recharge_sn=${res.data.result.rechargeSn}`,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
@import './style.scss';
|
||||||
|
</style>
|
||||||
46
pages/mine/deposit/style.scss
Normal file
46
pages/mine/deposit/style.scss
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
/deep/ .u-input__input,
|
||||||
|
.u-input {
|
||||||
|
font-size: 80rpx !important;
|
||||||
|
height: 102rpx !important;
|
||||||
|
}
|
||||||
|
/deep/ .u-input__input {
|
||||||
|
height: 100%;
|
||||||
|
font-size: 80rpx;
|
||||||
|
}
|
||||||
|
.content {
|
||||||
|
display: flex;
|
||||||
|
> .price {
|
||||||
|
width: 60%;
|
||||||
|
margin: 20rpx 0;
|
||||||
|
font-size: 80rpx;
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
> .all {
|
||||||
|
justify-content: center;
|
||||||
|
width: 40%;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: flex-end;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.-list {
|
||||||
|
margin: 20rpx 0;
|
||||||
|
background: #fff;
|
||||||
|
padding: 16rpx 32rpx;
|
||||||
|
}
|
||||||
|
.title {
|
||||||
|
font-size: 35rpx;
|
||||||
|
}
|
||||||
|
.light {
|
||||||
|
opacity: 0.6;
|
||||||
|
}
|
||||||
|
.submit {
|
||||||
|
margin: 80rpx auto;
|
||||||
|
width: 94%;
|
||||||
|
background: $light-color;
|
||||||
|
height: 90rpx;
|
||||||
|
color: #fff;
|
||||||
|
border-radius: 10rpx;
|
||||||
|
text-align: center;
|
||||||
|
line-height: 90rpx;
|
||||||
|
}
|
||||||
78
pages/mine/deposit/withdrawal.vue
Normal file
78
pages/mine/deposit/withdrawal.vue
Normal file
@@ -0,0 +1,78 @@
|
|||||||
|
<template>
|
||||||
|
<view>
|
||||||
|
<view class="-list">
|
||||||
|
<view class="title">提现金额</view>
|
||||||
|
<view class="content">
|
||||||
|
<view class="price">
|
||||||
|
<span> ¥</span>
|
||||||
|
<u-input v-model="price" placeholder="" type="number" />
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="all">
|
||||||
|
<view @click="handleAll" :style="{ color: $mainColor }">全部</view>
|
||||||
|
<view style="font-size: 24rpx; color: #999">可提现金额<span>{{ walletNum | unitPrice }}</span>元</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
</view>
|
||||||
|
<view class="tips">
|
||||||
|
最低提现金额为1.00元
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="submit" @click="cashd">提现</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
import { getUserWallet, withdrawalApply } from "@/api/members";
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
price: 0,
|
||||||
|
walletNum: 0,
|
||||||
|
};
|
||||||
|
},
|
||||||
|
async mounted() {
|
||||||
|
let result = await getUserWallet(); //预存款
|
||||||
|
this.walletNum = result.data.result.memberWallet;
|
||||||
|
},
|
||||||
|
|
||||||
|
methods: {
|
||||||
|
cashd() {
|
||||||
|
this.price = this.price + "";
|
||||||
|
|
||||||
|
if (this.$u.test.amount(parseInt(this.price))) {
|
||||||
|
withdrawalApply({ price: this.price }).then((res) => {
|
||||||
|
if (res.data.success) {
|
||||||
|
uni.showToast({
|
||||||
|
title: "提现成功!",
|
||||||
|
duration: 2000,
|
||||||
|
icon: "none",
|
||||||
|
});
|
||||||
|
setTimeout(() => {
|
||||||
|
uni.navigateBack({
|
||||||
|
delta: 1,
|
||||||
|
});
|
||||||
|
}, 1000);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
uni.showToast({
|
||||||
|
title: "请输入正确金额",
|
||||||
|
duration: 2000,
|
||||||
|
icon: "none",
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
handleAll() {
|
||||||
|
this.price = this.walletNum;
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
@import "./style.scss";
|
||||||
|
.tips {
|
||||||
|
font-size: 24rpx;
|
||||||
|
color: #999;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -8,10 +8,16 @@
|
|||||||
<u-input v-model="ruleForm.name" placeholder="请输入您的真实姓名" />
|
<u-input v-model="ruleForm.name" placeholder="请输入您的真实姓名" />
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
<u-form-item label="身份证" prop="idNumber">
|
<u-form-item label="身份证" prop="idNumber">
|
||||||
<u-input
|
<u-input v-model="ruleForm.idNumber" placeholder="请输入身份证号码" />
|
||||||
v-model="ruleForm.idNumber"
|
</u-form-item>
|
||||||
placeholder="请输入身份证号码"
|
<u-form-item label="银行开户行" prop="settlementBankBranchName">
|
||||||
/>
|
<u-input v-model="ruleForm.settlementBankBranchName" type="text" placeholder="请输入银行开户行" />
|
||||||
|
</u-form-item>
|
||||||
|
<u-form-item label="银行开户名" prop="settlementBankAccountName">
|
||||||
|
<u-input v-model="ruleForm.settlementBankAccountName" type="text" placeholder="请输入银行开户名" />
|
||||||
|
</u-form-item>
|
||||||
|
<u-form-item label="银行账号" prop="settlementBankAccountNum">
|
||||||
|
<u-input v-model="ruleForm.settlementBankAccountNum" type="text" placeholder="请输入银行账号" />
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
<!-- <u-form-item label="身份证正面照" prop="name">
|
<!-- <u-form-item label="身份证正面照" prop="name">
|
||||||
<u-upload></u-upload>
|
<u-upload></u-upload>
|
||||||
@@ -23,7 +29,7 @@
|
|||||||
<u-upload></u-upload>
|
<u-upload></u-upload>
|
||||||
</u-form-item> -->
|
</u-form-item> -->
|
||||||
</u-form>
|
</u-form>
|
||||||
<u-button :customStyle="{'background':$lightColor,'color':'#fff' }" @click="submit">提交</u-button>
|
<u-button :customStyle="{'background':$lightColor,'color':'#fff' }" @click="submit">提交</u-button>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
@@ -35,12 +41,16 @@
|
|||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import { applyDistribution } from "@/api/goods";
|
import { applyDistribution } from "@/api/goods";
|
||||||
|
import { checkBankno } from "@/utils/Foundation";
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
ruleForm: {
|
ruleForm: {
|
||||||
name: "",
|
name: "",
|
||||||
idNumber: "",
|
idNumber: "",
|
||||||
|
settlementBankBranchName: "", // 银行开户行
|
||||||
|
settlementBankAccountName: "", //银行开户名
|
||||||
|
settlementBankAccountNum: "", //银行账号
|
||||||
},
|
},
|
||||||
rules: {
|
rules: {
|
||||||
name: [
|
name: [
|
||||||
@@ -62,6 +72,50 @@ export default {
|
|||||||
trigger: ["change", "blur"],
|
trigger: ["change", "blur"],
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
// 银行开户行
|
||||||
|
settlementBankBranchName: [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: "银行开户行",
|
||||||
|
// 可以单个或者同时写两个触发验证方式
|
||||||
|
trigger: "blur",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
validator: (rule, value, callback) => {
|
||||||
|
// 上面有说,返回true表示校验通过,返回false表示不通过
|
||||||
|
// this.$u.test.mobile()就是返回true或者false的
|
||||||
|
return this.$u.test.chinese(value);
|
||||||
|
},
|
||||||
|
message: "银行开户行不正确",
|
||||||
|
// 触发器可以同时用blur和change
|
||||||
|
trigger: ["change", "blur"],
|
||||||
|
},
|
||||||
|
], //银行开户名
|
||||||
|
settlementBankAccountName: [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: "银行开户名",
|
||||||
|
// 可以单个或者同时写两个触发验证方式
|
||||||
|
trigger: "blur",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
//银行账号
|
||||||
|
settlementBankAccountNum: [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: "银行账号不正确",
|
||||||
|
// 可以单个或者同时写两个触发验证方式
|
||||||
|
trigger: "blur",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
validator: (rule, value, callback) => {
|
||||||
|
// 上面有说,返回true表示校验通过,返回false表示不通过
|
||||||
|
// this.$u.test.mobile()就是返回true或者false的
|
||||||
|
return checkBankno(value);
|
||||||
|
},
|
||||||
|
message: "银行账号不正确",
|
||||||
|
},
|
||||||
|
],
|
||||||
idNumber: [
|
idNumber: [
|
||||||
{
|
{
|
||||||
required: true,
|
required: true,
|
||||||
@@ -96,16 +150,14 @@ export default {
|
|||||||
icon: "none",
|
icon: "none",
|
||||||
});
|
});
|
||||||
|
|
||||||
setTimeout(()=>{
|
setTimeout(() => {
|
||||||
uni.navigateBack();
|
uni.navigateBack();
|
||||||
},500)
|
}, 500);
|
||||||
|
} else {
|
||||||
}
|
|
||||||
else{
|
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: res.data.message,
|
title: res.data.message,
|
||||||
duration: 2000,
|
duration: 2000,
|
||||||
icon:"none"
|
icon: "none",
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="log-list">
|
<view class="log-list">
|
||||||
<view class="log-way" v-for="(item, index) in datas" :key="index">
|
<!-- 提现记录 -->
|
||||||
|
<view class="log-way" v-if="cashLogData.length != 0" v-for="(item, index) in cashLogData" :key="index">
|
||||||
<view class="log-item">
|
<view class="log-item">
|
||||||
<view class="log-item-view">
|
<view class="log-item-view">
|
||||||
<view class="title">{{
|
<view class="title">{{
|
||||||
@@ -18,10 +19,22 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
<!-- 分销业绩 -->
|
||||||
|
<view class="log-way" v-if="achievementData.length != 0" v-for="(item, index) in achievementData" :key="index">
|
||||||
|
<view class="log-item">
|
||||||
|
<view class="log-item-view">
|
||||||
|
<view class="title">{{item.goodsName}}</view>
|
||||||
|
<view class="price">+{{ item.rebate | unitPrice }}</view>
|
||||||
|
</view>
|
||||||
|
<view class="log-item-view">
|
||||||
|
<view>{{ item.createTime }}</view>
|
||||||
|
<view>{{item.storeName}}</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
<view class="empty" v-if="empty">
|
<view class="empty" v-if="empty">
|
||||||
<u-loadmore :status="status" :icon-type="iconType" bg-color="#f7f7f7" />
|
<u-loadmore :status="status" :icon-type="iconType" bg-color="#f7f7f7" />
|
||||||
|
|
||||||
<!-- <u-empty text="暂无更多提现历史" mode="order"></u-empty> -->
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
@@ -30,7 +43,8 @@ import { cashLog, distributionOrderList } from "@/api/goods";
|
|||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
datas: "", //数据集合
|
cashLogData: [], //提现记录数据集合
|
||||||
|
achievementData: [], //分销业绩数据合集,
|
||||||
status: "loadmore",
|
status: "loadmore",
|
||||||
iconType: "flower",
|
iconType: "flower",
|
||||||
empty: false,
|
empty: false,
|
||||||
@@ -42,9 +56,6 @@ export default {
|
|||||||
type: 0,
|
type: 0,
|
||||||
routers: "",
|
routers: "",
|
||||||
achParams: {
|
achParams: {
|
||||||
distributionId: (this.routers && this.routers.id) || "", //分销商id
|
|
||||||
distributionName: (this.routers && this.routers.name) || "", //分销商名称
|
|
||||||
distributionOrderStatus: "", //分销商订单状态
|
|
||||||
pageNumber: 1,
|
pageNumber: 1,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
},
|
},
|
||||||
@@ -58,20 +69,30 @@ export default {
|
|||||||
title: title, //这是修改后的导航栏文字
|
title: title, //这是修改后的导航栏文字
|
||||||
});
|
});
|
||||||
this.routers = option;
|
this.routers = option;
|
||||||
|
this.type = option.type;
|
||||||
option.type == 0 ? this.achievement() : this.history();
|
option.type == 0 ? this.achievement() : this.history();
|
||||||
},
|
},
|
||||||
mounted() {},
|
mounted() {},
|
||||||
onReachBottom() {
|
onReachBottom() {
|
||||||
this.status = "loading";
|
this.status = "loading";
|
||||||
this.params.pageNumber++;
|
this.type == 0 ? this.achParams.pageNumber++ : this.params.pageNumber++;
|
||||||
|
this.type == 0 ? this.achievement() : this.history();
|
||||||
this.type == 1 ? this.history() : this.achievement();
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
// 业绩
|
// 业绩
|
||||||
achievement() {
|
achievement() {
|
||||||
distributionOrderList(this.achParams).then((res) => {});
|
uni.showLoading({
|
||||||
|
title: "加载中",
|
||||||
|
});
|
||||||
|
distributionOrderList(this.achParams).then((res) => {
|
||||||
|
if (res.data.success && res.data.result.records.length >= 1) {
|
||||||
|
this.achievementData = res.data.result.records;
|
||||||
|
} else {
|
||||||
|
this.status = "nomore";
|
||||||
|
this.empty = true;
|
||||||
|
}
|
||||||
|
uni.hideLoading();
|
||||||
|
});
|
||||||
},
|
},
|
||||||
// 初始化提现历史
|
// 初始化提现历史
|
||||||
history() {
|
history() {
|
||||||
@@ -80,7 +101,7 @@ export default {
|
|||||||
});
|
});
|
||||||
cashLog(this.params).then((res) => {
|
cashLog(this.params).then((res) => {
|
||||||
if (res.data.success && res.data.result.records.length >= 1) {
|
if (res.data.success && res.data.result.records.length >= 1) {
|
||||||
this.datas = res.data.result.records;
|
this.cashLogData = res.data.result.records;
|
||||||
} else {
|
} else {
|
||||||
this.status = "nomore";
|
this.status = "nomore";
|
||||||
this.empty = true;
|
this.empty = true;
|
||||||
|
|||||||
@@ -40,10 +40,7 @@
|
|||||||
<view>提现</view>
|
<view>提现</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="nav-item" @click="handleClick('/pages/mine/distribution/list')">
|
|
||||||
<u-icon size="50" color="#1e9ff2" name="home-fill"></u-icon>
|
|
||||||
<view>选品库</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
@@ -85,7 +82,7 @@ export default {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
mounted() {
|
onShow() {
|
||||||
this.init();
|
this.init();
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
@@ -93,21 +90,15 @@ export default {
|
|||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.nav {
|
.nav {
|
||||||
// height: 176rpx;
|
|
||||||
background: #fff;
|
background: #fff;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
display: flex;
|
display: flex;
|
||||||
// border-radius: 20rpx;
|
|
||||||
// transform: translateY(-20rpx);
|
|
||||||
// box-shadow: 4rpx 10rpx 22rpx rgba(0, 0, 0, 0.1);
|
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
}
|
}
|
||||||
.nav-list {
|
.nav-list {
|
||||||
color: #fff;
|
color: #fff;
|
||||||
padding: 40rpx 0;
|
padding: 40rpx 0;
|
||||||
background: $aider-light-color;
|
background: $aider-light-color;
|
||||||
// border-bottom-left-radius: 100rpx;
|
|
||||||
// border-bottom-right-radius: 100rpx;
|
|
||||||
}
|
}
|
||||||
.total {
|
.total {
|
||||||
padding: 10rpx 0;
|
padding: 10rpx 0;
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="wrapper">
|
<view class="wrapper">
|
||||||
<!-- 筛选弹出层 -->
|
<!-- 筛选弹出层 TODO后续版本更新 -->
|
||||||
<u-popup width="90%" v-model="popup" mode="right">
|
<!-- <u-popup width="90%" v-model="popup" mode="right">
|
||||||
<view class="screen-title">商品筛选</view>
|
<view class="screen-title">商品筛选</view>
|
||||||
|
|
||||||
<view class="screen-view">
|
<view class="screen-view">
|
||||||
@@ -54,7 +54,7 @@
|
|||||||
<view class="screen-clear"> 重置 </view>
|
<view class="screen-clear"> 重置 </view>
|
||||||
<view class="screen-submit"> 确定 </view>
|
<view class="screen-submit"> 确定 </view>
|
||||||
</view>
|
</view>
|
||||||
</u-popup>
|
</u-popup> -->
|
||||||
|
|
||||||
<!-- 导航栏 -->
|
<!-- 导航栏 -->
|
||||||
<view class="nav">
|
<view class="nav">
|
||||||
@@ -66,44 +66,50 @@
|
|||||||
<!-- 商品列表 -->
|
<!-- 商品列表 -->
|
||||||
|
|
||||||
<view class="goods-list">
|
<view class="goods-list">
|
||||||
<view class="goods-item" v-for="(item, index) in goodsList" :key="index">
|
<u-swipe-action v-for="(item, index) in goodsList" :disabled="!params.checked" :show="item.___selected" @open="openAction(item)" :index="index" :options="options" bg-color="#fff"
|
||||||
<view class="goods-item-img" @click="handleNavgationGoods(item)">
|
ref="swiperAction" :key="item.id" @click="changeActionTab(item)">
|
||||||
<u-image width="176rpx" height="176rpx" :src="item.thumbnail"></u-image>
|
|
||||||
</view>
|
<div class="goods-item">
|
||||||
<view class="goods-item-desc">
|
<view class="goods-item-img" @click="handleNavgationGoods(item)">
|
||||||
<!-- 商品描述 -->
|
<u-image width="176rpx" height="176rpx" :src="item.thumbnail"></u-image>
|
||||||
<view class="-item-title" @click="handleNavgationGoods(item)">
|
|
||||||
{{ item.goodsName }}
|
|
||||||
</view>
|
</view>
|
||||||
<!-- 商品金额 -->
|
<view class="goods-item-desc">
|
||||||
<view class="-item-price" @click="handleNavgationGoods(item)">
|
<!-- 商品描述 -->
|
||||||
佣金:
|
<view class="-item-title" @click="handleNavgationGoods(item)">
|
||||||
<span> ¥{{ item.commission | unitPrice }}</span>
|
{{ item.goodsName }}
|
||||||
</view>
|
</view>
|
||||||
<!-- 比率佣金 -->
|
<!-- 商品金额 -->
|
||||||
<view class="-item-bottom">
|
<view class="-item-price" @click="handleNavgationGoods(item)">
|
||||||
<view class="-item-bootom-money" @click="handleNavgationGoods(item)">
|
佣金:
|
||||||
<!-- <view class="-item-bl">
|
<span> ¥{{ item.commission | unitPrice }}</span>
|
||||||
|
</view>
|
||||||
|
<!-- 比率佣金 -->
|
||||||
|
<view class="-item-bottom">
|
||||||
|
<view class="-item-bootom-money" @click="handleNavgationGoods(item)">
|
||||||
|
<!-- <view class="-item-bl">
|
||||||
比率:
|
比率:
|
||||||
<span>{{ "5.00%" }}</span>
|
<span>{{ "5.00%" }}</span>
|
||||||
</view> -->
|
</view> -->
|
||||||
<view class="-item-yj">
|
<view class="-item-yj">
|
||||||
<span>¥{{ item.price | unitPrice }}</span>
|
<span>¥{{ item.price | unitPrice }}</span>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view>
|
||||||
|
<view class="click" v-if="!params.checked" @click="handleClickGoods(item)">立即选取</view>
|
||||||
|
<view class="click" v-if="params.checked" @click="handleLink(item)">分销商品</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view>
|
|
||||||
<view class="click" v-if="!params.checked" @click="handleClickGoods(item)">立即选取</view>
|
|
||||||
<view class="click" v-if="params.checked" @click="handleLink(item)">分销商品</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</div>
|
||||||
</view>
|
</u-swipe-action>
|
||||||
|
|
||||||
<view class="empty">
|
<view class="empty">
|
||||||
<!-- <u-empty v-if="empty" text="没有分销商品了" mode="list"></u-empty> -->
|
<!-- <u-empty v-if="empty" text="没有分销商品了" mode="list"></u-empty> -->
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<canvas class="canvas-hide" canvas-id="qrcode" />
|
<canvas class="canvas-hide" canvas-id="qrcode" />
|
||||||
<drawCanvas ref="drawCanvas" v-if="showFlag" :res="res" />
|
<drawCanvas ref="drawCanvas" v-if="showFlag" :res="res" />
|
||||||
|
<u-modal v-model="deleteShow" :confirm-style="{'color':lightColor}" @confirm="delectConfirm" show-cancel-button :content="deleteContent" :async-close="true"></u-modal>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
@@ -118,6 +124,17 @@ import drawCanvas from "@/components/m-canvas";
|
|||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
lightColor: this.$lightColor,
|
||||||
|
deleteContent: "解绑该商品?", //删除显示的信息
|
||||||
|
// 商品栏右侧滑动按钮
|
||||||
|
options: [
|
||||||
|
{
|
||||||
|
text: "解绑",
|
||||||
|
style: {
|
||||||
|
backgroundColor: this.$lightColor, //高亮颜色
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
showFlag: false, //分销分享开关
|
showFlag: false, //分销分享开关
|
||||||
empty: false,
|
empty: false,
|
||||||
popup: false, //弹出层开关
|
popup: false, //弹出层开关
|
||||||
@@ -147,6 +164,8 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
routers: "",
|
routers: "",
|
||||||
|
deleteShow: false, //删除模态框
|
||||||
|
goodsVal: false, //分销商铺信息
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
@@ -155,44 +174,87 @@ export default {
|
|||||||
onLoad(options) {
|
onLoad(options) {
|
||||||
this.routers = options;
|
this.routers = options;
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {},
|
||||||
showFlag(val) {
|
|
||||||
|
|
||||||
},
|
|
||||||
},
|
|
||||||
onShow() {
|
onShow() {
|
||||||
this.goodsList = [];
|
this.goodsList = [];
|
||||||
this.init();
|
this.init();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
/**
|
||||||
|
* 滑动删除
|
||||||
|
*/
|
||||||
|
changeActionTab(val) {
|
||||||
|
this.deleteShow = true;
|
||||||
|
this.goodsVal = val;
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 点击解绑商品
|
||||||
|
*/
|
||||||
|
delectConfirm() {
|
||||||
|
checkedDistributionGoods({ id: this.goodsVal.id, checked: false }).then(
|
||||||
|
(res) => {
|
||||||
|
if (res.data.success) {
|
||||||
|
uni.showToast({
|
||||||
|
title: "此商品解绑成功",
|
||||||
|
duration: 2000,
|
||||||
|
});
|
||||||
|
this.deleteShow = false;
|
||||||
|
this.goodsList = [];
|
||||||
|
this.init();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 左滑打开删除
|
||||||
|
*/
|
||||||
|
openAction(val) {
|
||||||
|
this.goodsList.forEach((item) => {
|
||||||
|
this.$set(item, "___selected", false);
|
||||||
|
});
|
||||||
|
this.$set(val, "___selected", true);
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查看图片
|
||||||
|
*/
|
||||||
handleNavgationGoods(val) {
|
handleNavgationGoods(val) {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: `/pages/product/goods?id=${val.skuId}&goodsId=${val.id}`,
|
url: `/pages/product/goods?id=${val.skuId}&goodsId=${val.goodsId}`,
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
async handleLink(goods) {
|
async handleLink(goods) {
|
||||||
|
uni.showToast({
|
||||||
|
title: "请请按住保存图片",
|
||||||
|
duration: 2000,
|
||||||
|
icon: "none",
|
||||||
|
});
|
||||||
let page = `pages/product/goods`;
|
let page = `pages/product/goods`;
|
||||||
let scene = `${goods.skuId},${goods.id},${this.routers.id}`;
|
let scene = `${goods.skuId},${goods.goodsId},${this.routers.id}`;
|
||||||
let result = await getMpCode({ page, scene });
|
let result = await getMpCode({ page, scene });
|
||||||
if(result.data.success){
|
if (result.data.success) {
|
||||||
let callback = result.data.result;
|
let callback = result.data.result;
|
||||||
this.res.container.title = `${goods.goodsName}`;
|
this.res.container.title = `${goods.goodsName}`;
|
||||||
this.res.bottom.code = `data:image/png;base64,${callback}`;
|
this.res.bottom.code = `data:image/png;base64,${callback}`;
|
||||||
this.res.bottom.price = this.$options.filters.unitPrice(goods.price, "¥");
|
this.res.bottom.price = this.$options.filters.unitPrice(
|
||||||
this.res.bottom.desc = `${goods.goodsName}`;
|
goods.price,
|
||||||
this.res.bottom.img = `${goods.thumbnail}`;
|
"¥"
|
||||||
|
);
|
||||||
|
this.res.bottom.desc = `${goods.goodsName}`;
|
||||||
|
this.res.bottom.img = `${goods.thumbnail}`;
|
||||||
|
|
||||||
if (this.showFlag) {
|
if (this.showFlag) {
|
||||||
this.$refs.drawCanvas.init();
|
this.$refs.drawCanvas.init();
|
||||||
}
|
}
|
||||||
this.showFlag = true;
|
this.showFlag = true;
|
||||||
}
|
} else {
|
||||||
else{
|
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: `制作二维码失败!请稍后重试`,
|
title: `制作二维码失败!请稍后重试`,
|
||||||
duration: 2000,
|
duration: 2000,
|
||||||
icon:"none"
|
icon: "none",
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -209,12 +271,7 @@ export default {
|
|||||||
|
|
||||||
// 选择商品
|
// 选择商品
|
||||||
handleClickGoods(val) {
|
handleClickGoods(val) {
|
||||||
uni.showLoading({
|
checkedDistributionGoods({ id: val.id, checked: true }).then((res) => {
|
||||||
title: "加载中",
|
|
||||||
mask: true,
|
|
||||||
});
|
|
||||||
checkedDistributionGoods(val.id).then((res) => {
|
|
||||||
uni.hideLoading();
|
|
||||||
if (res.data.success) {
|
if (res.data.success) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: "已添加到我的选品库",
|
title: "已添加到我的选品库",
|
||||||
@@ -231,13 +288,11 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
init() {
|
init() {
|
||||||
uni.showLoading({
|
|
||||||
title: "加载中",
|
|
||||||
});
|
|
||||||
distributionGoods(this.params).then((res) => {
|
distributionGoods(this.params).then((res) => {
|
||||||
uni.hideLoading();
|
|
||||||
|
|
||||||
if (res.data.success && res.data.result.records.length >= 1) {
|
if (res.data.success && res.data.result.records.length >= 1) {
|
||||||
|
res.data.result.records.forEach((item) => {
|
||||||
|
this.$set(item, "___selected", false);
|
||||||
|
});
|
||||||
this.goodsList.push(...res.data.result.records);
|
this.goodsList.push(...res.data.result.records);
|
||||||
}
|
}
|
||||||
if (this.goodsList.length == 0) {
|
if (this.goodsList.length == 0) {
|
||||||
@@ -399,7 +454,7 @@ export default {
|
|||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
> .-item-price {
|
> .-item-price {
|
||||||
color: $jd-color;
|
color: $price-color;
|
||||||
> span {
|
> span {
|
||||||
font-size: 36rpx;
|
font-size: 36rpx;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="wrapper">
|
<div class="wrapper">
|
||||||
<div v-html="res.content"></div>
|
<u-parse v-html="res.content"></u-parse>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -30,11 +30,8 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import uniSteps from "@/components/uni-steps/uni-steps.vue";
|
|
||||||
import { getExpress } from "@/api/trade.js";
|
import { getExpress } from "@/api/trade.js";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: { uniSteps },
|
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
express: "",
|
express: "",
|
||||||
|
|||||||
@@ -11,10 +11,11 @@
|
|||||||
<view v-if="tabCurrentIndex == 0" class="tab-content">
|
<view v-if="tabCurrentIndex == 0" class="tab-content">
|
||||||
<scroll-view class="list-scroll-content" scroll-y @scrolltolower="loadMore">
|
<scroll-view class="list-scroll-content" scroll-y @scrolltolower="loadMore">
|
||||||
<!-- 空白页 -->
|
<!-- 空白页 -->
|
||||||
<u-empty text="暂无收藏商品数据" mode="favor" v-if="goodsEmpty"></u-empty>
|
<u-empty style="margin-top:40rpx;" text="暂无收藏商品数据" mode="favor" v-if="goodsEmpty"></u-empty>
|
||||||
<!-- 商品展示数据 -->
|
<!-- 商品展示数据 -->
|
||||||
<u-swipe-action @open="openLeftChange(item,index,'goods')" :show="item.selected" btn-width="180" :options="LeftOptions" v-else v-for="(item,index) in goodList"
|
<u-swipe-action @open="openLeftChange(item,index,'goods')" :show="item.selected" btn-width="180"
|
||||||
@click="clickGoodsSwiperAction(item,index)" :index="index" :key="index">
|
:options="LeftOptions" v-else v-for="(item,index) in goodList" @click="clickGoodsSwiperAction(item,index)"
|
||||||
|
:index="index" :key="index">
|
||||||
<view class="goods" @click="goGoodsDetail(item)">
|
<view class="goods" @click="goGoodsDetail(item)">
|
||||||
<u-image width="131rpx" height="131rpx" :src="item.image" mode="aspectFit">
|
<u-image width="131rpx" height="131rpx" :src="item.image" mode="aspectFit">
|
||||||
<u-loading slot="loading"></u-loading>
|
<u-loading slot="loading"></u-loading>
|
||||||
@@ -34,20 +35,22 @@
|
|||||||
<view v-else class="tab-content">
|
<view v-else class="tab-content">
|
||||||
<scroll-view class="list-scroll-content" scroll-y @scrolltolower="loadMore">
|
<scroll-view class="list-scroll-content" scroll-y @scrolltolower="loadMore">
|
||||||
<!-- 空白页 -->
|
<!-- 空白页 -->
|
||||||
<u-empty text="暂无收藏店铺数据" mode="favor" v-if="storeEmpty"></u-empty>
|
<u-empty style="margin-top:40rpx;" text="暂无收藏店铺数据" mode="favor" v-if="storeEmpty"></u-empty>
|
||||||
<!-- 店铺展示数据 -->
|
<!-- 店铺展示数据 -->
|
||||||
<u-swipe-action @open="openLeftChange(item,'store')" :show="item.selected" btn-width="180" :options="LeftOptions" v-else v-for="(item,index) in storeList" :key="index"
|
<u-swipe-action @open="openLeftChange(item,'store')" :show="item.selected" btn-width="180"
|
||||||
|
:options="LeftOptions" v-else v-for="(item,index) in storeList" :key="index"
|
||||||
@click="clickstoreSwiperAction(item)">
|
@click="clickstoreSwiperAction(item)">
|
||||||
<view class="store" @click="gostoreMainPage(item.storeId)">
|
<view class="store" @click="gostoreMainPage(item.id)">
|
||||||
<view class="intro">
|
<view class="intro">
|
||||||
<view class="store-logo">
|
<view class="store-logo">
|
||||||
<u-image width="102rpx" height="102rpx" :src="item.logo" :alt="item.storeName" mode="aspectFit">
|
<u-image width="102rpx" height="102rpx" :src="item.storeLogo" :alt="item.storeName" mode="aspectFit">
|
||||||
<u-loading slot="loading"></u-loading>
|
<u-loading slot="loading"></u-loading>
|
||||||
</u-image>
|
</u-image>
|
||||||
</view>
|
</view>
|
||||||
<view class="store-name">
|
<view class="store-name">
|
||||||
<view>{{item.storeName}}</view>
|
<view>{{item.storeName}}</view>
|
||||||
<u-tag size="mini" type="error" :color="$mainColor" v-if="item.selfOperated" text="自营" mode="plain" shape="circle" />
|
<u-tag size="mini" type="error" :color="$mainColor" v-if="item.selfOperated" text="自营" mode="plain"
|
||||||
|
shape="circle" />
|
||||||
</view>
|
</view>
|
||||||
<view class="store-collect">
|
<view class="store-collect">
|
||||||
<view>进店逛逛</view>
|
<view>进店逛逛</view>
|
||||||
@@ -133,7 +136,6 @@ export default {
|
|||||||
*/
|
*/
|
||||||
clickGoodsSwiperAction(val) {
|
clickGoodsSwiperAction(val) {
|
||||||
deleteGoodsCollection(val.skuId).then((res) => {
|
deleteGoodsCollection(val.skuId).then((res) => {
|
||||||
|
|
||||||
if (res.statusCode == 200) {
|
if (res.statusCode == 200) {
|
||||||
this.storeList = [];
|
this.storeList = [];
|
||||||
this.goodList = [];
|
this.goodList = [];
|
||||||
@@ -159,7 +161,6 @@ export default {
|
|||||||
*/
|
*/
|
||||||
tabClick(index) {
|
tabClick(index) {
|
||||||
this.tabCurrentIndex = index;
|
this.tabCurrentIndex = index;
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,36 +1,41 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="myTracks">
|
<view class="myTracks">
|
||||||
<empty v-if="whetherEmpty"></empty>
|
<u-empty text="暂无历史记录" style="margin-top:200rpx;" mode="history" v-if="whetherEmpty"></u-empty>
|
||||||
<view v-else v-for="(item, index) in trackList" :key="index">
|
<div v-else>
|
||||||
<view class="myTracks-title" @click="navgaiteToStore(item)">{{item.storeName}}</view>
|
<view v-for="(item, index) in trackList" :key="index">
|
||||||
<view class="myTracks-items">
|
<view class="myTracks-title" @click="navgaiteToStore(item)">{{item.storeName}}</view>
|
||||||
<view class="myTracks-item">
|
<view class="myTracks-items">
|
||||||
<u-checkbox-group>
|
<view class="myTracks-item">
|
||||||
<u-checkbox v-model="item.___isDel" v-if="editFlag" active-color="#ff6b35" style="margin-right: 10rpx" @change="changeChecked(item)"></u-checkbox>
|
<u-checkbox-group>
|
||||||
</u-checkbox-group>
|
<u-checkbox v-model="item.___isDel" v-if="editFlag" active-color="#ff6b35" style="margin-right: 10rpx"
|
||||||
<view class="myTracks-item-img" @click.stop="navgaiteToDetail(item)">
|
@change="changeChecked(item)"></u-checkbox>
|
||||||
<image :src="item.thumbnail"></image>
|
</u-checkbox-group>
|
||||||
</view>
|
<view class="myTracks-item-img" @click.stop="navgaiteToDetail(item)">
|
||||||
<view class="myTracks-item-content" @click.stop="navgaiteToDetail(item)">
|
<image :src="item.thumbnail"></image>
|
||||||
<view class="myTracks-item-title">
|
|
||||||
{{ item.goodsName }}
|
|
||||||
<view class="myTracks-item-title-desc"> </view>
|
|
||||||
</view>
|
</view>
|
||||||
<view class="myTracks-item-price">
|
<view class="myTracks-item-content" @click.stop="navgaiteToDetail(item)">
|
||||||
¥{{ item.price | unitPrice }}
|
<view class="myTracks-item-title">
|
||||||
|
{{ item.goodsName }}
|
||||||
|
<view class="myTracks-item-title-desc"> </view>
|
||||||
|
</view>
|
||||||
|
<view class="myTracks-item-price">
|
||||||
|
¥{{ item.price | unitPrice }}
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
<view class="myTracks-divider"></view>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
<view class="myTracks-divider"></view>
|
<uni-load-more :status="loadStatus"></uni-load-more>
|
||||||
</view>
|
</div>
|
||||||
<uni-load-more :status="loadStatus"></uni-load-more>
|
|
||||||
<view v-if="editFlag">
|
<view v-if="editFlag">
|
||||||
<view class="myTracks-action-placeholder"></view>
|
<view class="myTracks-action-placeholder"></view>
|
||||||
<view class="myTracks-action">
|
<view class="myTracks-action">
|
||||||
<view class="myTracks-action-check">
|
<view class="myTracks-action-check">
|
||||||
<u-checkbox-group>
|
<u-checkbox-group>
|
||||||
<u-checkbox v-model="allChecked" v-if="editFlag" active-color="#ff6b35" style="margin-right: 10rpx" @change="checkedAllitem"></u-checkbox>
|
<u-checkbox v-model="allChecked" v-if="editFlag" active-color="#ff6b35" style="margin-right: 10rpx"
|
||||||
|
@change="checkedAllitem"></u-checkbox>
|
||||||
全选
|
全选
|
||||||
</u-checkbox-group>
|
</u-checkbox-group>
|
||||||
</view>
|
</view>
|
||||||
@@ -76,6 +81,10 @@ export default {
|
|||||||
onLoad() {
|
onLoad() {
|
||||||
this.getList();
|
this.getList();
|
||||||
},
|
},
|
||||||
|
onPullDownRefresh() {
|
||||||
|
this.trackList = [];
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
/**
|
/**
|
||||||
* 导航到店铺
|
* 导航到店铺
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<image src="/static/pointTrade/point_bg_1.png" mode=""></image>
|
<image src="/static/pointTrade/point_bg_1.png" mode=""></image>
|
||||||
<image class="point-img" src="/static/pointTrade/tradehall.png" />
|
<image class="point-img" src="/static/pointTrade/tradehall.png" />
|
||||||
<view class="position-point">
|
<view class="position-point">
|
||||||
<view class="apply-point" @click="goIntro"><text>积分介绍</text></view>
|
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -25,7 +25,7 @@
|
|||||||
<view>{{ item.content }}</view>
|
<view>{{ item.content }}</view>
|
||||||
<view>{{ item.createTime}}</view>
|
<view>{{ item.createTime}}</view>
|
||||||
</view>
|
</view>
|
||||||
<view><span>{{item.pointType == "1" ? '+' : '-'}}</span>{{ item.variablePoint }}</view>
|
<view><span>{{item.pointType == "INCREASE" ? '+' : '-'}}</span>{{ item.variablePoint }}</view>
|
||||||
</view>
|
</view>
|
||||||
<uni-load-more :status="count.loadStatus"></uni-load-more>
|
<uni-load-more :status="count.loadStatus"></uni-load-more>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,122 +1,160 @@
|
|||||||
// TODO 第一版本暂无此功能 后续优化以及更新
|
|
||||||
<template>
|
<template>
|
||||||
<view class="edition-intro">
|
<view class="edition-intro">
|
||||||
<view class="logo c-content">
|
<image :src="config.logo" class="logo" />
|
||||||
<view>
|
<h1> {{config.name}}</h1>
|
||||||
<image src="/static/img/edition.png" mode=""></image>
|
<view class='version'>
|
||||||
</view>
|
<!-- #ifdef APP-PLUS -->
|
||||||
<view>版本不息 优化不止</view>
|
Version {{localVersion.version}}
|
||||||
|
<!-- #endif -->
|
||||||
</view>
|
</view>
|
||||||
<view class="edition c-content" v-for="(item,index) in editionHistory" :key="index">
|
|
||||||
<view class="level">
|
<!-- {{localVersion}} -->
|
||||||
<text style="color: #1ABC9C;">{{item.version}}</text>
|
<u-cell-group class="cell" :border="false">
|
||||||
<text>{{$u.timeFormat(item.update_time, 'yyyy-mm-dd')}}</text>
|
<!-- #ifdef APP-PLUS -->
|
||||||
|
<u-cell-item v-if="IosWhether" @click="checkStar" title="去评分"></u-cell-item>
|
||||||
|
<u-cell-item title="功能介绍" @click="navigateTo('/pages/mine/set/versionFunctionList')"></u-cell-item>
|
||||||
|
<u-cell-item title="检查更新" @click="checkUpdate"></u-cell-item>
|
||||||
|
<!-- #endif -->
|
||||||
|
<u-cell-item title="证照信息" @click="navigateTo('/pages/mine/help/tips?type=message')"></u-cell-item>
|
||||||
|
<u-cell-item title="服务协议" @click="navigateTo('/pages/mine/help/tips?type=user')"></u-cell-item>
|
||||||
|
<u-cell-item title="隐私协议" @click="navigateTo('/pages/mine/help/tips?type=privacy')"></u-cell-item>
|
||||||
|
<u-cell-item title="关于我们" :border-bottom="false" @click="navigateTo('/pages/mine/help/tips?type=about')"></u-cell-item>
|
||||||
|
|
||||||
|
</u-cell-group>
|
||||||
|
|
||||||
|
<view class="intro">
|
||||||
|
<view>{{config.customerServiceMobile ? `客服热线:${config.customerServiceMobile}` : ``}}</view>
|
||||||
|
<view style="margin:20rpx 0 0 0;">{{config.customerServiceEmail ? `客服邮箱:${config.customerServiceEmail}` : ``}}</view>
|
||||||
|
|
||||||
|
<view>
|
||||||
|
<view style="margin:20rpx 0; color:#003a8c;" @click="navigateTo('/pages/mine/help/tips?type=user')">《{{config.name}}用户协议》</view>
|
||||||
|
<view>CopyRight @{{config.name}} </view>
|
||||||
</view>
|
</view>
|
||||||
<view class="detail" v-html="item.content"></view>
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import * as API_Message from "@/api/message.js";
|
import APPUpdate from "@/plugins/APPUpdate";
|
||||||
|
import config from "@/config/config";
|
||||||
|
import { getAppVersion } from "@/api/message.js";
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
config,
|
||||||
|
IosWhether: false, //是否是ios
|
||||||
editionHistory: [], //版本历史
|
editionHistory: [], //版本历史
|
||||||
|
versionData: {}, //版本信息
|
||||||
|
localVersion: "", //当前版本信息
|
||||||
params: {
|
params: {
|
||||||
pageNumber: 1,
|
pageNumber: 1,
|
||||||
pageSize: 5,
|
pageSize: 5,
|
||||||
},
|
},
|
||||||
loadStatus: "more",
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
onLoad() {
|
onLoad() {
|
||||||
if (uni.getSystemInfoSync().platform === "android") {
|
// #ifdef APP-PLUS
|
||||||
|
const platform = uni.getSystemInfoSync().platform;
|
||||||
|
/**
|
||||||
|
* 获取是否是安卓
|
||||||
|
*/
|
||||||
|
if (platform === "android") {
|
||||||
this.params.type = 0;
|
this.params.type = 0;
|
||||||
} else {
|
} else {
|
||||||
|
this.IosWhether = true;
|
||||||
this.params.type = 1;
|
this.params.type = 1;
|
||||||
}
|
}
|
||||||
this.GET_AppVersionList(true);
|
this.getVersion(platform);
|
||||||
},
|
|
||||||
onReachBottom() {
|
plus.runtime.getProperty(plus.runtime.appid, (inf) => {
|
||||||
if (this.loadStatus != "noMore") {
|
this.localVersion = {
|
||||||
this.params.pageNumber++;
|
versionCode: inf.version.replace(/\./g, ""),
|
||||||
this.GET_AppVersionList(false);
|
version: inf.version,
|
||||||
}
|
};
|
||||||
|
});
|
||||||
|
// #endif
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
GET_AppVersionList(reset) {
|
async getVersion(platform) {
|
||||||
if (reset) {
|
let type;
|
||||||
this.params.pageNumber = 1;
|
platform == "android" ? (type = "ANDROID") : (type = "IOS");
|
||||||
|
|
||||||
|
let res = await getAppVersion(type);
|
||||||
|
if (res.data.success) {
|
||||||
|
this.versionData = res.data.result;
|
||||||
}
|
}
|
||||||
uni.showLoading({
|
},
|
||||||
title: "加载中",
|
|
||||||
|
navigateTo(url) {
|
||||||
|
uni.navigateTo({
|
||||||
|
url,
|
||||||
});
|
});
|
||||||
API_Message.getAppVersionList(this.params).then((response) => {
|
},
|
||||||
uni.hideLoading();
|
|
||||||
if (response.statusCode == 200) {
|
/**
|
||||||
const { data } = response;
|
* ios点击评分
|
||||||
if (data.data.length < 10) {
|
*/
|
||||||
this.loadStatus = "noMore";
|
checkStar() {
|
||||||
}
|
plus.runtime.launchApplication({
|
||||||
this.editionHistory.push(...data.data);
|
action: `itms-apps://itunes.apple.com/app/${config.iosAppId}?action=write-review`,
|
||||||
}
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 检查更新
|
||||||
|
*/
|
||||||
|
checkUpdate() {
|
||||||
|
if (
|
||||||
|
this.versionData.version.replace(/\./g, "") <
|
||||||
|
this.localVersion.versionCode
|
||||||
|
) {
|
||||||
|
APPUpdate();
|
||||||
|
} else {
|
||||||
|
uni.showToast({
|
||||||
|
title: "当前版本已是最新版",
|
||||||
|
duration: 2000,
|
||||||
|
icon: "none",
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
page {
|
||||||
|
background: #fff !important;
|
||||||
|
}
|
||||||
|
.cell {
|
||||||
|
width: 90%;
|
||||||
|
margin: 0 auto;
|
||||||
|
}
|
||||||
.edition-intro {
|
.edition-intro {
|
||||||
.logo {
|
min-height: 100vh;
|
||||||
display: flex;
|
background: #fff;
|
||||||
justify-content: center;
|
display: flex;
|
||||||
align-items: center;
|
flex-direction: column;
|
||||||
flex-direction: column;
|
justify-content: center;
|
||||||
font-size: $font-lg;
|
align-items: center;
|
||||||
color: $font-color-light;
|
|
||||||
height: 330rpx;
|
> h1 {
|
||||||
margin-bottom: 20rpx;
|
margin: 20rpx 0 20rpx 0;
|
||||||
> view:nth-child(1) {
|
letter-spacing: 2rpx;
|
||||||
width: 144rpx;
|
|
||||||
height: 144rpx;
|
|
||||||
border: 1px solid #ffc71c;
|
|
||||||
border-radius: 50%;
|
|
||||||
position: relative;
|
|
||||||
margin-bottom: 30rpx;
|
|
||||||
image {
|
|
||||||
width: 80rpx;
|
|
||||||
height: 113rpx;
|
|
||||||
position: absolute;
|
|
||||||
top: 0;
|
|
||||||
left: 0;
|
|
||||||
right: 0;
|
|
||||||
bottom: 0;
|
|
||||||
margin: auto;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
.edition {
|
> .version {
|
||||||
margin-bottom: 20rpx;
|
font-size: 30rpx;
|
||||||
color: $font-color-light;
|
margin-bottom: 100rpx;
|
||||||
font-size: $font-sm;
|
|
||||||
.level {
|
|
||||||
display: flex;
|
|
||||||
justify-content: space-between;
|
|
||||||
align-items: center;
|
|
||||||
padding: 20rpx 30rpx;
|
|
||||||
border-bottom: 2rpx solid $border-color-light;
|
|
||||||
text:nth-child(1) {
|
|
||||||
font-size: $font-base;
|
|
||||||
font-weight: 700;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.detail {
|
|
||||||
margin-left: 20rpx;
|
|
||||||
line-height: 2em;
|
|
||||||
padding: 20rpx 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.intro {
|
||||||
|
margin-top: 100rpx;
|
||||||
|
font-size: 24rpx;
|
||||||
|
letter-spacing: 2rpx;
|
||||||
|
}
|
||||||
|
.logo {
|
||||||
|
width: 200rpx;
|
||||||
|
height: 200rpx;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
<div class="feedBack">
|
<div class="feedBack">
|
||||||
<div class="feedBack-box">
|
<div class="feedBack-box">
|
||||||
<h4>猜你想问</h4>
|
<h4>猜你想问</h4>
|
||||||
<div class="feedBack-item" @click="handleClick(index)" v-for="(item,index) in list" :key="index">
|
<div class="feedBack-item" :class="{'active':feedBack.type == item.value }" @click="handleClick(index)" v-for="(item,index) in list" :key="index">
|
||||||
{{item.text}}
|
{{item.text}}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -130,6 +130,10 @@ export default {
|
|||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
border-radius: 100px;
|
border-radius: 100px;
|
||||||
}
|
}
|
||||||
|
.active{
|
||||||
|
color: $light-color !important;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
.feedBack {
|
.feedBack {
|
||||||
padding-bottom: 100rpx;
|
padding-bottom: 100rpx;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,39 +0,0 @@
|
|||||||
<template>
|
|
||||||
<view class="notify">
|
|
||||||
<u-cell-group>
|
|
||||||
<u-cell-item title="账户通知" :arrow="false">
|
|
||||||
<u-switch slot="right-icon" active-color="#1abc9c" size="40" v-model="setting.account"></u-switch>
|
|
||||||
</u-cell-item>
|
|
||||||
<u-cell-item title="物流通知" :arrow="false">
|
|
||||||
<u-switch slot="right-icon" active-color="#1abc9c" size="40" v-model="setting.logistics"></u-switch>
|
|
||||||
</u-cell-item>
|
|
||||||
<u-cell-item title="优惠促销" :arrow="false">
|
|
||||||
<u-switch slot="right-icon" active-color="#1abc9c" size="40" v-model="setting.cheap"></u-switch>
|
|
||||||
</u-cell-item>
|
|
||||||
<u-cell-item title="服务通知" :arrow="false">
|
|
||||||
<u-switch slot="right-icon" active-color="#1abc9c" size="40" v-model="setting.service"></u-switch>
|
|
||||||
</u-cell-item>
|
|
||||||
</u-cell-group>
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
export default {
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
setting:{
|
|
||||||
account:false,
|
|
||||||
logistics:false,
|
|
||||||
cheap:false,
|
|
||||||
service:false
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
uni-view{
|
|
||||||
font-size: 20rpx;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -45,7 +45,7 @@ export default {
|
|||||||
face: storage.getUserInfo().face || "/static/missing-face.png", //默认头像
|
face: storage.getUserInfo().face || "/static/missing-face.png", //默认头像
|
||||||
regionId: [], //地址Id
|
regionId: [], //地址Id
|
||||||
region: storage.getUserInfo().region || [], //地址
|
region: storage.getUserInfo().region || [], //地址
|
||||||
sex: storage.getUserInfo().sex || 1, //性别
|
sex: storage.getUserInfo().sex, //性别
|
||||||
___path: storage.getUserInfo().region,
|
___path: storage.getUserInfo().region,
|
||||||
},
|
},
|
||||||
birthday: storage.getUserInfo().birthday || "", //生日
|
birthday: storage.getUserInfo().birthday || "", //生日
|
||||||
@@ -98,23 +98,14 @@ export default {
|
|||||||
* 提交保存
|
* 提交保存
|
||||||
*/
|
*/
|
||||||
submit() {
|
submit() {
|
||||||
if (this.form.regionId.length != 0 && this.birthday) {
|
delete this.form.___path;
|
||||||
delete this.form.___path;
|
let params = JSON.parse(JSON.stringify(this.form));
|
||||||
let params = JSON.parse(JSON.stringify(this.form));
|
saveUserInfo(params).then((res) => {
|
||||||
saveUserInfo(params).then((res) => {
|
if (res.statusCode == 200) {
|
||||||
|
storage.setUserInfo(res.data.result);
|
||||||
if (res.statusCode == 200) {
|
uni.navigateBack();
|
||||||
storage.setUserInfo(res.data.result);
|
}
|
||||||
uni.navigateBack();
|
});
|
||||||
}
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
uni.showToast({
|
|
||||||
title: "请填写生日和城市!",
|
|
||||||
duration: 2000,
|
|
||||||
icon: "none",
|
|
||||||
});
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -9,17 +9,17 @@
|
|||||||
<u-form :model="codeForm" class="form" ref="validateCodeForm">
|
<u-form :model="codeForm" class="form" ref="validateCodeForm">
|
||||||
<view v-if="!validateFlage">
|
<view v-if="!validateFlage">
|
||||||
<u-form-item label-width="120" label="手机号" prop="mobile">
|
<u-form-item label-width="120" label="手机号" prop="mobile">
|
||||||
<u-input v-model="codeForm.mobile" placeholder="请输入您的手机号" />
|
<u-input maxlength="11" v-model="codeForm.mobile" placeholder="请输入您的手机号" />
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
|
|
||||||
<u-form-item class="sendCode" label-width="120" prop="code" label="验证码">
|
<u-form-item class="sendCode" label-width="120" prop="code" label="验证码">
|
||||||
<u-input v-model="codeForm.code" placeholder="请输入验证码" />
|
<u-input v-model="codeForm.code" placeholder="请输入验证码" />
|
||||||
<u-verification-code unique-key="page-edit" :seconds="seconds" @end="end" @start="start" ref="uCode" @change="codeChange"></u-verification-code>
|
<u-verification-code unique-key="page-edit" :seconds="seconds" @end="end" @start="start" ref="uCode" @change="codeChange"></u-verification-code>
|
||||||
<view @tap="getCode" class="text-tips">{{ tips }}</view>
|
<view @tap="getCode" class="text-tips">{{ tips }}</view>
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
|
|
||||||
<view class="submit" @click="validatePhone">验证</view>
|
<view class="submit" @click="validatePhone">验证</view>
|
||||||
<myVerification keep-running @send="verification" class="verification" ref="verification" business="LOGIN" />
|
<myVerification keep-running @send="verification" class="verification" ref="verification" business="FIND_USER" />
|
||||||
</view>
|
</view>
|
||||||
<view v-if="validateFlage">
|
<view v-if="validateFlage">
|
||||||
<u-form-item label-width="120" label="旧密码">
|
<u-form-item label-width="120" label="旧密码">
|
||||||
@@ -40,7 +40,7 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { sendMobile, resetByMobile, modifyPass } from "@/api/login";
|
import { sendMobile, resetByMobile, modifyPass } from "@/api/login";
|
||||||
import storage from "@/utils/storage.js";
|
|
||||||
import { md5 } from "@/utils/md5.js"; // md5
|
import { md5 } from "@/utils/md5.js"; // md5
|
||||||
import myVerification from "@/components/verification/verification.vue"; //验证
|
import myVerification from "@/components/verification/verification.vue"; //验证
|
||||||
import uuid from "@/utils/uuid.modified.js";
|
import uuid from "@/utils/uuid.modified.js";
|
||||||
@@ -108,7 +108,7 @@ export default {
|
|||||||
uni.showLoading({
|
uni.showLoading({
|
||||||
title: "正在获取验证码",
|
title: "正在获取验证码",
|
||||||
});
|
});
|
||||||
sendMobile(this.codeForm.mobile).then((res) => {
|
sendMobile(this.codeForm.mobile, "FIND_USER").then((res) => {
|
||||||
uni.hideLoading();
|
uni.hideLoading();
|
||||||
// 这里此提示会被this.start()方法中的提示覆盖
|
// 这里此提示会被this.start()方法中的提示覆盖
|
||||||
if (res.data.code == 200) {
|
if (res.data.code == 200) {
|
||||||
@@ -161,8 +161,7 @@ export default {
|
|||||||
if (valid) {
|
if (valid) {
|
||||||
resetByMobile(this.codeForm).then((res) => {
|
resetByMobile(this.codeForm).then((res) => {
|
||||||
if (res.data.success) {
|
if (res.data.success) {
|
||||||
storage.setAccessToken(res.data.result.accessToken);
|
this.validateFlage = !this.validateFlage;
|
||||||
storage.setRefreshToken(res.data.result.refreshToken);
|
|
||||||
// 登录成功
|
// 登录成功
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: "验证成功!",
|
title: "验证成功!",
|
||||||
@@ -238,6 +237,9 @@ page {
|
|||||||
padding: 80rpx 0;
|
padding: 80rpx 0;
|
||||||
border-radius: 20rpx;
|
border-radius: 20rpx;
|
||||||
}
|
}
|
||||||
|
.submit {
|
||||||
|
background: $light-color;
|
||||||
|
}
|
||||||
.box-tips {
|
.box-tips {
|
||||||
margin: 0 72rpx;
|
margin: 0 72rpx;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,13 +17,10 @@ export default {
|
|||||||
methods: {
|
methods: {
|
||||||
navigateTo(url) {
|
navigateTo(url) {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: url + `?mobile=${this.mobile}`,
|
url: url,
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
onLoad(option) {
|
|
||||||
this.mobile = option.mobile;
|
|
||||||
},
|
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,11 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="container">
|
<view class="container">
|
||||||
<view class="person" @click="checkUserInfo()">
|
<view class="person" @click="checkUserInfo()">
|
||||||
<u-image width=140 height="140" shape="circle" :src="userInfo.face || '/static/missing-face.png'" mode=""></u-image>
|
<u-image width=140 height="140" shape="circle" :src="userInfo.face || '/static/missing-face.png'" mode="">
|
||||||
|
</u-image>
|
||||||
<view class="user-name">
|
<view class="user-name">
|
||||||
<view>{{ userInfo.id ? userInfo.username || '' : '暂未登录' }}</view>
|
|
||||||
|
{{ userInfo.id ? userInfo.nickName || '' : '暂未登录' }}
|
||||||
</view>
|
</view>
|
||||||
<u-icon color="#ccc" name="arrow-right"></u-icon>
|
<u-icon color="#ccc" name="arrow-right"></u-icon>
|
||||||
</view>
|
</view>
|
||||||
@@ -17,21 +19,23 @@
|
|||||||
<u-cell-item title="安全中心" @click="navigateTo('/pages/mine/set/securityCenter/securityCenter')"></u-cell-item>
|
<u-cell-item title="安全中心" @click="navigateTo('/pages/mine/set/securityCenter/securityCenter')"></u-cell-item>
|
||||||
<u-cell-item title="意见反馈" @click="navigateTo('/pages/mine/set/feedBack')"></u-cell-item>
|
<u-cell-item title="意见反馈" @click="navigateTo('/pages/mine/set/feedBack')"></u-cell-item>
|
||||||
<!-- #ifndef H5 -->
|
<!-- #ifndef H5 -->
|
||||||
<u-cell-item title="版本说明" @click="navigateTo('/pages/mine/set/editionIntro')"></u-cell-item>
|
|
||||||
<!-- #endif -->
|
<!-- #endif -->
|
||||||
<!-- <u-cell-item title="好评鼓励"></u-cell-item> -->
|
<u-cell-item :title="`关于${config.name}`" @click="navigateTo('/pages/mine/set/editionIntro')"></u-cell-item>
|
||||||
<u-cell-item title="关于我们" @click="navigateTo('/pages/mine/aboutUs')"></u-cell-item>
|
|
||||||
</u-cell-group>
|
</u-cell-group>
|
||||||
<view class="submit" @click="showModalDialog">{{userInfo.id ?'退出登录':'返回登录'}}</view>
|
<view class="submit" @click="showModalDialog">{{userInfo.id ?'退出登录':'返回登录'}}</view>
|
||||||
<u-modal show-cancel-button v-model="quitShow" @confirm="confirm" :confirm-color="lightColor" :async-close="true" :content="userInfo.id ? '确定要退出登录么?' : '确定要返回登录么?'"></u-modal>
|
<u-modal show-cancel-button v-model="quitShow" @confirm="confirm" :confirm-color="lightColor" :async-close="true"
|
||||||
|
:content="userInfo.id ? '确定要退出登录么?' : '确定要返回登录么?'"></u-modal>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import { logout } from "@/api/login";
|
||||||
import storage from "@/utils/storage.js";
|
import storage from "@/utils/storage.js";
|
||||||
|
import config from "@/config/config";
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
config,
|
||||||
lightColor: this.$lightColor,
|
lightColor: this.$lightColor,
|
||||||
quitShow: false,
|
quitShow: false,
|
||||||
isCertificate: false,
|
isCertificate: false,
|
||||||
@@ -49,18 +53,20 @@ export default {
|
|||||||
url: url,
|
url: url,
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
clear() {
|
||||||
|
storage.setAccessToken("");
|
||||||
|
storage.setRefreshToken("");
|
||||||
|
storage.setUserInfo({});
|
||||||
|
this.$options.filters.navigateToLogin("redirectTo");
|
||||||
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 确认退出
|
* 确认退出
|
||||||
* 清除缓存重新登录
|
* 清除缓存重新登录
|
||||||
*/
|
*/
|
||||||
confirm() {
|
async confirm() {
|
||||||
storage.setAccessToken("");
|
await logout();
|
||||||
storage.setRefreshToken("");
|
this.clear();
|
||||||
storage.setUserInfo({});
|
|
||||||
uni.redirectTo({
|
|
||||||
url: "/pages/passport/login",
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -136,9 +142,7 @@ export default {
|
|||||||
});
|
});
|
||||||
that.getCacheSize(); // 重新计算缓存
|
that.getCacheSize(); // 重新计算缓存
|
||||||
},
|
},
|
||||||
function (e) {
|
function (e) {}
|
||||||
|
|
||||||
}
|
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
entry.remove();
|
entry.remove();
|
||||||
@@ -195,7 +199,12 @@ export default {
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
margin-bottom: 20rpx;
|
margin-bottom: 20rpx;
|
||||||
.user-name {
|
.user-name {
|
||||||
flex: 1;
|
width: 500rpx;
|
||||||
|
overflow: hidden;
|
||||||
|
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
|
||||||
|
white-space: nowrap;
|
||||||
margin-left: 30rpx;
|
margin-left: 30rpx;
|
||||||
line-height: 2em;
|
line-height: 2em;
|
||||||
font-size: 34rpx;
|
font-size: 34rpx;
|
||||||
|
|||||||
58
pages/mine/set/versionFunctionList.vue
Normal file
58
pages/mine/set/versionFunctionList.vue
Normal file
@@ -0,0 +1,58 @@
|
|||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<u-collapse v-if="versionData.length !=0">
|
||||||
|
<u-collapse-item class="version-item" :title="item.versionName" v-for="(item, index) in versionData" :key="index">
|
||||||
|
<!-- {{item.body}} -->
|
||||||
|
|
||||||
|
{{item.content}}
|
||||||
|
</u-collapse-item>
|
||||||
|
|
||||||
|
</u-collapse>
|
||||||
|
<u-empty class="empty" v-else text="暂无版本信息" mode="list"></u-empty>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { getAppVersionList } from "@/api/message";
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
versionData: [],
|
||||||
|
appType: "",
|
||||||
|
params: {
|
||||||
|
pageNumber: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
const platform = uni.getSystemInfoSync().platform;
|
||||||
|
/**
|
||||||
|
* 获取是否是安卓
|
||||||
|
*/
|
||||||
|
if (platform === "android") {
|
||||||
|
this.appType = "ANDROID";
|
||||||
|
} else {
|
||||||
|
this.IosWhether = true;
|
||||||
|
this.appType = "IOS";
|
||||||
|
}
|
||||||
|
this.getVersionList();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
async getVersionList() {
|
||||||
|
let res = await getAppVersionList(this.appType, this.params);
|
||||||
|
if (res.data.success) {
|
||||||
|
this.versionData = res.data.result.records;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.version-item{
|
||||||
|
padding: 10rpx;
|
||||||
|
background: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
</style>
|
||||||
@@ -1,26 +1,30 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="sign-in">
|
<view class="sign-in">
|
||||||
<view class="signin-btn-con">
|
<view class="date-card">
|
||||||
<div class="circle-box">
|
<div class="box">
|
||||||
<div class="cricle" @click="signIn()">
|
<div class="circle-box">
|
||||||
<span v-if="!ifSign" :class="{ active: signFlag || ifSign }">签到</span>
|
<div class="cricle" @click="signIn()">
|
||||||
<span v-else :class="{ active: signFlag || ifSign }" :style="ifSign ? 'transform: rotateY(0deg);' : ''">已签</span>
|
<span v-if="!ifSign" :class="{ active: signFlag || ifSign }">签到</span>
|
||||||
|
<span v-else :class="{ active: signFlag || ifSign }"
|
||||||
|
:style="ifSign ? 'transform: rotateY(0deg);' : ''">已签</span>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<text class="tips">坚持每天连续签到可以获多重奖励哦</text>
|
||||||
</div>
|
</div>
|
||||||
<text class="tips">坚持每天连续签到可以获多重奖励哦</text>
|
|
||||||
</view>
|
</view>
|
||||||
<div class="date-card">
|
<div class="date-card">
|
||||||
<view class="date-con">
|
<view class="date-con">
|
||||||
<view class="date-tit">
|
<view class="date-tit">
|
||||||
<u-row style="width: 100%; justify-content: center;">
|
<div class="current-month">
|
||||||
<div style="text-align: center; " class="text">{{ currentMonth }} {{ currentYear }}</div>
|
<div class="day">每日记录<span> ({{ currentMonth }})</span></div>
|
||||||
</u-row>
|
</div>
|
||||||
</view>
|
</view>
|
||||||
<view class="week">
|
<view class="week">
|
||||||
<text v-for="item in weekArr" :key="item.id">{{ item }}</text>
|
<text v-for="item in weekArr" :key="item.id">{{ item }}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="date" v-for="obj in dataObj" :key="obj.id">
|
<view class="date" v-for="obj in dataObj" :key="obj.id">
|
||||||
<view class="item" v-for="item in obj" :key="item.id" :class="item == '' ? 'hide' : ''" :animation="item == currentDay ? animationData : ''">
|
<view class="item" v-for="item in obj" :key="item.id" :class="item == '' ? 'hide' : ''"
|
||||||
|
:animation="item == currentDay ? animationData : ''">
|
||||||
<view class="just" :class="signArr.indexOf(item) != -1 ? 'active' : ''">
|
<view class="just" :class="signArr.indexOf(item) != -1 ? 'active' : ''">
|
||||||
<view class="top">{{ item }} </view>
|
<view class="top">{{ item }} </view>
|
||||||
<view class="bottom">
|
<view class="bottom">
|
||||||
@@ -36,7 +40,7 @@
|
|||||||
">
|
">
|
||||||
<view class="top">{{ item }}</view>
|
<view class="top">{{ item }}</view>
|
||||||
<view class="bottom">
|
<view class="bottom">
|
||||||
<u-icon name="checkmark" color="#ff9f28"></u-icon>
|
<u-icon name="checkmark" :color="aiderLightColor"></u-icon>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -50,16 +54,7 @@
|
|||||||
<text class="close" @click="close">×</text>
|
<text class="close" @click="close">×</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="mask-con">
|
<view class="mask-con">
|
||||||
<view class="keep-sign">
|
<u-icon size="120" style="margin: 50rpx 0" :color="aiderLightColor" name="checkmark"></u-icon>
|
||||||
本月已连续签到
|
|
||||||
<text>{{ continuity }}</text>
|
|
||||||
天
|
|
||||||
</view>
|
|
||||||
<u-icon size="120" style="margin: 50rpx 0" color="#ff9f28" name="checkmark"></u-icon>
|
|
||||||
<view class="mark">
|
|
||||||
<view>获得积分</view>
|
|
||||||
<text>{{ continuityPoint }}</text>
|
|
||||||
</view>
|
|
||||||
<text class="text">连续签到可获得额外奖励哦!</text>
|
<text class="text">连续签到可获得额外奖励哦!</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -71,8 +66,7 @@ import { sign, signTime } from "@/api/point.js";
|
|||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
continuity: 1, //本月连续签到天数
|
aiderLightColor:this.$aiderLightColor,
|
||||||
continuityPoint: 2, //获得的积分
|
|
||||||
signFlag: false,
|
signFlag: false,
|
||||||
animationData: {},
|
animationData: {},
|
||||||
maskFlag: false, //
|
maskFlag: false, //
|
||||||
@@ -115,7 +109,6 @@ export default {
|
|||||||
this.getDate();
|
this.getDate();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 补0
|
* 补0
|
||||||
*/
|
*/
|
||||||
@@ -126,7 +119,7 @@ export default {
|
|||||||
return "0" + val;
|
return "0" + val;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 点击签到
|
* 点击签到
|
||||||
*/
|
*/
|
||||||
@@ -215,7 +208,6 @@ export default {
|
|||||||
Number(itemVal[1]) === Number(this.currentMonthIndex)
|
Number(itemVal[1]) === Number(this.currentMonthIndex)
|
||||||
) {
|
) {
|
||||||
this.signArr.push(Number(itemVal[2]));
|
this.signArr.push(Number(itemVal[2]));
|
||||||
|
|
||||||
}
|
}
|
||||||
if (
|
if (
|
||||||
Number(itemVal[0]) === Number(date.getFullYear()) &&
|
Number(itemVal[0]) === Number(date.getFullYear()) &&
|
||||||
@@ -295,70 +287,79 @@ export default {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
<style scoped>
|
||||||
|
page {
|
||||||
|
background: #f7f7f7;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.date-card {
|
.date-card {
|
||||||
padding: 0 40rpx;
|
padding: 0 32rpx;
|
||||||
|
margin: 32rpx 0;
|
||||||
|
box-shadow: 0 4rpx 24rpx 0 rgba($color: #f6f6f6, $alpha: 1);
|
||||||
}
|
}
|
||||||
.tips {
|
.tips {
|
||||||
margin-top: 34rpx;
|
margin-top: 54rpx;
|
||||||
|
color: #999;
|
||||||
|
font-size: 24rpx;
|
||||||
|
letter-spacing: 1rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.circle-box {
|
.circle-box {
|
||||||
width: 200rpx;
|
width: 200rpx;
|
||||||
height: 200rpx;
|
height: 200rpx;
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
margin-top: 60rpx;
|
background: $aider-light-color;
|
||||||
background: #ff9f28;
|
box-shadow: 0 4rpx 24rpx 0 rgba($color: $aider-light-color, $alpha: 1);
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center; //这个是X轴居中
|
justify-content: center; //这个是X轴居中
|
||||||
align-items: center; //这个是 Y轴居中
|
align-items: center; //这个是 Y轴居中
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.cricle {
|
.cricle {
|
||||||
width: 160rpx;
|
width: 160rpx;
|
||||||
height: 160rpx;
|
height: 160rpx;
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
background: #ff9f28;
|
background: $aider-light-color;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
line-height: 160rpx;
|
line-height: 160rpx;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
font-size: 40rpx;
|
font-size: 40rpx;
|
||||||
}
|
}
|
||||||
|
.current-month {
|
||||||
page {
|
width: 100%;
|
||||||
background: #fff;
|
margin: 20rpx 0;
|
||||||
|
}
|
||||||
|
.box {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
padding:64rpx 32rpx;
|
||||||
|
background: #fff;
|
||||||
|
border-radius: 20rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.sign-in {
|
.sign-in {
|
||||||
color: #333;
|
color: #333;
|
||||||
.signin-btn-con {
|
|
||||||
width: 100%;
|
|
||||||
height: 670rpx;
|
|
||||||
background-image: linear-gradient(180deg, #ff6b35, #ff9f28, #ffcc03);
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
align-items: center;
|
|
||||||
text {
|
|
||||||
color: #fff;
|
|
||||||
font-size: 28rpx;
|
|
||||||
font-weight: 400;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.date-con {
|
.date-con {
|
||||||
background: #fff;
|
background: #fff;
|
||||||
min-height: 730rpx;
|
min-height: 730rpx;
|
||||||
border-radius: 0.8em;
|
border-radius: 20rpx;
|
||||||
border: 1px solid #ededed;
|
|
||||||
padding: 0 28rpx;
|
padding: 0 28rpx;
|
||||||
transform: translateY(-320rpx);
|
|
||||||
box-shadow: (1px 3px 5px rgba(0, 0, 0, 0.2));
|
|
||||||
}
|
}
|
||||||
|
.day {
|
||||||
|
font-size: 36rpx;
|
||||||
|
|
||||||
|
> span {
|
||||||
|
font-size: 30rpx;
|
||||||
|
color: #999;
|
||||||
|
margin-left: 20rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
.date-tit {
|
.date-tit {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
margin: 30rpx 0;
|
margin: 0 0 30rpx 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.week {
|
.week {
|
||||||
@@ -429,7 +430,7 @@ page {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.top {
|
.top {
|
||||||
color: #ff9f28;
|
color: $aider-light-color;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -471,7 +472,7 @@ page {
|
|||||||
width: 540rpx;
|
width: 540rpx;
|
||||||
height: 130rpx;
|
height: 130rpx;
|
||||||
line-height: 130rpx;
|
line-height: 130rpx;
|
||||||
background: #ff9f28;
|
background: $aider-light-color;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
font-size: 40rpx;
|
font-size: 40rpx;
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
@@ -488,7 +489,7 @@ page {
|
|||||||
|
|
||||||
.mask-con {
|
.mask-con {
|
||||||
width: 540rpx;
|
width: 540rpx;
|
||||||
height: 460rpx;
|
height: 380rpx;
|
||||||
background: #fff;
|
background: #fff;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
.sort-active {
|
.sort-active {
|
||||||
border: 1px solid $light-color;
|
border: 1px solid $light-color;
|
||||||
color: $light-color;
|
color: $light-color;
|
||||||
background: $jd-light-color !important;
|
background: $price-light-color !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.oldKeyList {
|
.oldKeyList {
|
||||||
@@ -35,13 +35,6 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/deep/ .u-row {
|
|
||||||
// #ifdef MP-WEIXIN
|
|
||||||
padding: 0 5%;
|
|
||||||
// #endif
|
|
||||||
}
|
|
||||||
|
|
||||||
.status_bar {
|
.status_bar {
|
||||||
height: var(--status-bar-height);
|
height: var(--status-bar-height);
|
||||||
background: #fff !important;
|
background: #fff !important;
|
||||||
@@ -62,6 +55,7 @@ page {
|
|||||||
padding: 30rpx;
|
padding: 30rpx;
|
||||||
> .sort-item {
|
> .sort-item {
|
||||||
> .sort-title {
|
> .sort-title {
|
||||||
|
margin: 20rpx 0;
|
||||||
font-size: 26rpx;
|
font-size: 26rpx;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
@@ -121,7 +115,7 @@ page {
|
|||||||
font-size: 24rpx;
|
font-size: 24rpx;
|
||||||
}
|
}
|
||||||
.flex {
|
.flex {
|
||||||
margin: 30rpx 0;
|
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
> .sort-brand-item {
|
> .sort-brand-item {
|
||||||
@@ -138,47 +132,36 @@ page {
|
|||||||
height: 100vh;
|
height: 100vh;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
.storeSellerBox {
|
|
||||||
// #ifndef MP-WEIXIN
|
|
||||||
padding: 16rpx !important;
|
|
||||||
|
|
||||||
// #endif
|
|
||||||
}
|
|
||||||
.goodsClass {
|
|
||||||
padding: 0 20rpx;
|
|
||||||
|
|
||||||
/deep/ .u-row {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.index-nav-arrow:last-child {
|
.index-nav-arrow:last-child {
|
||||||
margin-top: -22rpx;
|
margin-top: -22rpx;
|
||||||
}
|
}
|
||||||
|
.line1-store-name{
|
||||||
|
font-size: 24rpx;
|
||||||
|
color: #999;
|
||||||
|
}
|
||||||
|
.to-store{
|
||||||
|
font-size: 24rpx;
|
||||||
|
color: #333;
|
||||||
|
margin-left: 10rpx;
|
||||||
|
}
|
||||||
.img {
|
.img {
|
||||||
width: 26rpx;
|
width: 26rpx;
|
||||||
height: 26rpx;
|
height: 26rpx;
|
||||||
}
|
}
|
||||||
.goodsRow {
|
.goods-row {
|
||||||
/deep/ .u-row {
|
|
||||||
// #ifdef MP-WEIXIN
|
|
||||||
padding: 0%;
|
|
||||||
background: #fff;
|
|
||||||
// padding: 16rpx;
|
|
||||||
border-radius: 0.4em;
|
|
||||||
margin: 0 !important;
|
|
||||||
|
|
||||||
// #endif
|
|
||||||
}
|
|
||||||
|
|
||||||
background: #fff;
|
background: #fff;
|
||||||
border-radius: 0.4em;
|
padding: 16rpx;
|
||||||
margin: 20rpx 0;
|
|
||||||
// #ifdef MP-WEIXIN
|
>.goods-col{
|
||||||
margin: 10rpx 0;
|
display: flex;
|
||||||
// #endif
|
>.goods-img{
|
||||||
padding: 0 16rpx;
|
flex: 4;
|
||||||
width: 100%;
|
}
|
||||||
|
>.goods-detail{
|
||||||
|
flex: 7;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.add1 {
|
.add1 {
|
||||||
@@ -192,21 +175,14 @@ page {
|
|||||||
border-bottom: 1px solid #eeeeee;
|
border-bottom: 1px solid #eeeeee;
|
||||||
}
|
}
|
||||||
|
|
||||||
.logimg {
|
|
||||||
width: 40rpx;
|
|
||||||
height: 40rpx;
|
|
||||||
vertical-align: middle;
|
|
||||||
}
|
|
||||||
|
|
||||||
.clamp3 {
|
.clamp3 {
|
||||||
padding-top: 30rpx;
|
|
||||||
margin-bottom: 10rpx;
|
margin-bottom: 10rpx;
|
||||||
font-size: 28rpx;
|
font-size: 28rpx;
|
||||||
color: #333333;
|
color: #333333;
|
||||||
|
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
display: -webkit-box;
|
display: -webkit-box;
|
||||||
line-height: 40rpx;
|
height: 80rpx;
|
||||||
-webkit-box-orient: vertical;
|
-webkit-box-orient: vertical;
|
||||||
|
|
||||||
-webkit-line-clamp: 2 !important;
|
-webkit-line-clamp: 2 !important;
|
||||||
@@ -217,25 +193,12 @@ page {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.switchType1 {
|
|
||||||
width: 50%;
|
|
||||||
overflow: hidden;
|
|
||||||
text-align: center;
|
|
||||||
|
|
||||||
> .img {
|
|
||||||
width: 182rpx;
|
|
||||||
height: 200rpx;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.imgGoods {
|
|
||||||
width: 182rpx;
|
|
||||||
height: 200rpx;
|
|
||||||
}
|
|
||||||
view {
|
view {
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
|
|
||||||
.storeSellerName {
|
.store-seller-name {
|
||||||
color: #666;
|
color: #666;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
|
||||||
@@ -248,7 +211,7 @@ view {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.countConfig {
|
.count-config {
|
||||||
padding: 10rpx 0;
|
padding: 10rpx 0;
|
||||||
color: #666;
|
color: #666;
|
||||||
display: flex;
|
display: flex;
|
||||||
@@ -635,16 +598,15 @@ view {
|
|||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
.countConfig,
|
.count-config,
|
||||||
.storeSellerName {
|
.store-seller-name {
|
||||||
font-size: $font-sm;
|
font-size: $font-sm;
|
||||||
}
|
}
|
||||||
|
|
||||||
.textHidden {
|
.text-hidden {
|
||||||
|
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
|
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,10 +1,9 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="content">
|
<view class="content">
|
||||||
<u-navbar :background="navObj" :is-back="false">
|
<u-navbar :background="navObj" :is-back="false">
|
||||||
<!-- mSearch组件 如果使用原样式,删除组件元素-->
|
<mSearch ref="mSearch" class="mSearch-input-box" @clickLeft="back" :mode="2" :placeholder="defaultKeyword"
|
||||||
|
@search="doSearch(false)" @confirm="doSearch(false)" @SwitchType="doSearchSwitch()" v-model="keyword"
|
||||||
<mSearch ref="mSearch" class="mSearch-input-box" @clickLeft="back" :mode="2" :placeholder="defaultKeyword" @search="doSearch(false)" @input="inputChange" @confirm="doSearch(false)"
|
:isFocusVal="!isShowSeachGoods"></mSearch>
|
||||||
@SwitchType="doSearchSwitch()" v-model="keyword" :isFocusVal="!isShowSeachGoods"></mSearch>
|
|
||||||
</u-navbar>
|
</u-navbar>
|
||||||
|
|
||||||
<view class="search-keyword" v-if="!isShowSeachGoods">
|
<view class="search-keyword" v-if="!isShowSeachGoods">
|
||||||
@@ -23,22 +22,19 @@
|
|||||||
<view class="u-tips">热门搜索</view>
|
<view class="u-tips">热门搜索</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="keyword keywordBox">
|
<view class="keyword keywordBox">
|
||||||
<view class="wes" v-for="(keyword, index) in hotKeywordList" @tap="doSearch(keyword)" :key="index">{{ keyword }}</view>
|
<view class="wes" v-for="(keyword, index) in hotKeywordList" @tap="doSearch(keyword)" :key="index">
|
||||||
|
{{ keyword }}</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="keyword-block" v-if="oldKeywordList.length > 0">
|
<view class="keyword-block" v-if="oldKeywordList.length > 0">
|
||||||
<view class="keyword-list-header">
|
<view class="keyword-list-header">
|
||||||
<view class="u-tips">搜索历史</view>
|
<view class="u-tips">搜索历史</view>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
<div class="oldKeyList">
|
<div class="oldKeyList">
|
||||||
|
<div class="oldKeyItem" v-if="keyword" v-for="(keyword, index) in oldKeywordList" :key="index"
|
||||||
<div class="oldKeyItem" v-if="keyword" v-for="(keyword, index) in oldKeywordList" :key="index" @click="doSearch(keyword)">
|
@click="doSearch(keyword)">
|
||||||
<span>{{ keyword }} </span>
|
<span>{{ keyword }} </span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div @click="showMore" v-if=" oldKeywordIndex > loadIndex" class="oldKeyItem">展示更多</div>
|
<div @click="showMore" v-if=" oldKeywordIndex > loadIndex" class="oldKeyItem">展示更多</div>
|
||||||
</div>
|
</div>
|
||||||
</view>
|
</view>
|
||||||
@@ -54,11 +50,13 @@
|
|||||||
<text>销量</text>
|
<text>销量</text>
|
||||||
<view class="p-box">
|
<view class="p-box">
|
||||||
<view class="index-nav-arrow">
|
<view class="index-nav-arrow">
|
||||||
<image class="img" src="/static/index/arrow-up-1.png" v-if="params.sort === 'buyCount' && params.order === 'asc'" mode="aspectFit"></image>
|
<image class="img" src="/static/index/arrow-up-1.png"
|
||||||
|
v-if="params.sort === 'buyCount' && params.order === 'asc'" mode="aspectFit"></image>
|
||||||
<image class="img" src="/static/index/arrow-up.png" v-else mode="aspectFit"></image>
|
<image class="img" src="/static/index/arrow-up.png" v-else mode="aspectFit"></image>
|
||||||
</view>
|
</view>
|
||||||
<view class="index-nav-arrow">
|
<view class="index-nav-arrow">
|
||||||
<image class="img" src="/static/index/arrow-down.png" v-if="params.sort === 'buyCount' && params.order === 'desc'" mode="aspectFit"></image>
|
<image class="img" src="/static/index/arrow-down.png"
|
||||||
|
v-if="params.sort === 'buyCount' && params.order === 'desc'" mode="aspectFit"></image>
|
||||||
<image class="img" src="/static/index/arrow-down-1.png" v-else mode="aspectFit"></image>
|
<image class="img" src="/static/index/arrow-down-1.png" v-else mode="aspectFit"></image>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -67,11 +65,13 @@
|
|||||||
<text>价格</text>
|
<text>价格</text>
|
||||||
<view class="p-box">
|
<view class="p-box">
|
||||||
<view class="index-nav-arrow">
|
<view class="index-nav-arrow">
|
||||||
<image class="img" src="/static/index/arrow-up-1.png" v-if="params.sort === 'price' && params.order === 'asc'" mode="aspectFit"></image>
|
<image class="img" src="/static/index/arrow-up-1.png"
|
||||||
|
v-if="params.sort === 'price' && params.order === 'asc'" mode="aspectFit"></image>
|
||||||
<image class="img" src="/static/index/arrow-up.png" v-else mode="aspectFit"></image>
|
<image class="img" src="/static/index/arrow-up.png" v-else mode="aspectFit"></image>
|
||||||
</view>
|
</view>
|
||||||
<view class="index-nav-arrow">
|
<view class="index-nav-arrow">
|
||||||
<image class="img" src="/static/index/arrow-down.png" v-if="params.sort === 'price' && params.order === 'desc'" mode="aspectFit"></image>
|
<image class="img" src="/static/index/arrow-down.png"
|
||||||
|
v-if="params.sort === 'price' && params.order === 'desc'" mode="aspectFit"></image>
|
||||||
<image class="img" src="/static/index/arrow-down-1.png" v-else mode="aspectFit"></image>
|
<image class="img" src="/static/index/arrow-down-1.png" v-else mode="aspectFit"></image>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -80,53 +80,51 @@
|
|||||||
</view>
|
</view>
|
||||||
<!-- 一行一个商品展示 -->
|
<!-- 一行一个商品展示 -->
|
||||||
<div v-if="isSWitch">
|
<div v-if="isSWitch">
|
||||||
<scroll-view :style="{ height: goodsHeight }" enableBackToTop="true" lower-threshold="250" @scrolltolower="loadmore()" scroll-with-animation scroll-y class="scoll-page">
|
<scroll-view :style="{ height: goodsHeight }" enableBackToTop="true" lower-threshold="250"
|
||||||
<div class="goodsClass">
|
@scrolltolower="loadmore()" scroll-with-animation scroll-y class="scoll-page">
|
||||||
<u-row v-for="(item, index) in goodsList" :key="index" class="goodsRow">
|
<div class="goods-class">
|
||||||
<u-col :span="4" @click.native="navigateToDetailPage(item)" class="switchType1">
|
<div v-for="(item, index) in goodsList" :key="index" class="goods-row">
|
||||||
<u-image width="182rpx" height="200rpx" class="imgGoods" :src="item.thumbnail">
|
<div class="flex goods-col">
|
||||||
<u-loading slot="loading"></u-loading>
|
<div class="goods-img" @click="navigateToDetailPage(item)">
|
||||||
</u-image>
|
<u-image width="230rpx" height="230rpx" :src="item.content.thumbnail">
|
||||||
</u-col>
|
<u-loading slot="loading"></u-loading>
|
||||||
<u-col :span="8" @click.native="navigateToDetailPage(item)" class="switchType2">
|
</u-image>
|
||||||
<div class="title clamp3" style="">{{ item.goodsName }}</div>
|
</div>
|
||||||
<view class="price-box">
|
<div class="goods-detail">
|
||||||
<div class="price" v-if="item.price!=undefined">
|
<div class="title clamp3" @click="navigateToDetailPage(item)">{{ item.content.goodsName }}</div>
|
||||||
¥<span>{{ formatPrice(item.price )[0] }} </span>.{{
|
<view class="price-box" @click="navigateToDetailPage(item)">
|
||||||
formatPrice(item.price )[1]
|
<div class="price" v-if="item.content.price!=undefined">
|
||||||
|
¥<span>{{ formatPrice(item.content.price )[0] }} </span>.{{
|
||||||
|
formatPrice(item.content.price )[1]
|
||||||
}}
|
}}
|
||||||
|
</div>
|
||||||
|
</view>
|
||||||
|
<div class="promotion" @click="navigateToDetailPage(item)">
|
||||||
|
<div v-for="(promotionItem,promotionIndex) in getPromotion(item)" :key="promotionIndex">
|
||||||
|
<span v-if="promotionItem.indexOf('COUPON') != -1">劵</span>
|
||||||
|
<span v-if="promotionItem.indexOf('FULL_DISCOUNT') != -1">满减</span>
|
||||||
|
<span v-if="promotionItem.indexOf('SECKILL') != -1">秒杀</span>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</view>
|
<div style="overflow: hidden" @click="navigateToDetailPage(item)" class="count-config">
|
||||||
<div class="promotion">
|
<span style="float: left; font-size: 22rpx">已售 {{ item.content.buyCount || '0' }}</span>
|
||||||
<div v-for="(promotionItem,promotionIndex) in getPromotion(item)" :key="promotionIndex">
|
<span style="float: right; font-size: 22rpx">{{ item.content.commentNum || '0' }}条评论</span>
|
||||||
|
</div>
|
||||||
|
<div style="overflow: hidden" @click="navigateToStoreDetailPage(item)" class="count-config">
|
||||||
|
<div class="text-hidden">
|
||||||
|
<u-tag style="margin-right: 10rpx" size="mini" mode="dark" v-if="item.selfOperated" text="自营"
|
||||||
|
type="error" />
|
||||||
|
<span class="line1-store-name">{{ item.content.storeName }}</span>
|
||||||
|
<span class="to-store">进店<u-icon size="24" name="arrow-right" color="#666"></u-icon></span>
|
||||||
|
</div>
|
||||||
|
<span>
|
||||||
|
<u-icon name="arrow-right" color="#c5c5c5"></u-icon>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<span v-if="promotionItem.indexOf('COUPON') != -1">劵</span>
|
</div>
|
||||||
<span v-if="promotionItem.indexOf('FULL_DISCOUNT') != -1">满减</span>
|
|
||||||
<span v-if="promotionItem.indexOf('SECKILL') != -1">秒杀</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div style="overflow: hidden" class="countConfig">
|
|
||||||
<span style="float: left; font-size: 22rpx">已售 {{ item.buyCount || '0' }}</span>
|
|
||||||
<span style="float: right; font-size: 22rpx">{{ item.commentNum || '0' }}条评论</span>
|
|
||||||
</div>
|
|
||||||
</u-col>
|
|
||||||
<u-col :span="12" class="storeSellerBox">
|
|
||||||
<div class="storeSellerName" @click="clickTostore()">
|
|
||||||
<div class="textHidden">
|
|
||||||
<u-tag style="margin-right: 10rpx" size="mini" mode="dark" v-if="item.selfOperated" text="自营" type="error" />
|
|
||||||
|
|
||||||
<span style="
|
|
||||||
color: #333333;
|
|
||||||
font-size: 28rpx;
|
|
||||||
padding-left: 17rpx;
|
|
||||||
">{{ item.storeName }}</span>
|
|
||||||
</div>
|
|
||||||
<span>
|
|
||||||
<u-icon name="arrow-right" color="#c5c5c5"></u-icon>
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
</u-col>
|
|
||||||
</u-row>
|
|
||||||
</div>
|
</div>
|
||||||
<uni-load-more :status="loadingType" @loadmore="loadmore()"></uni-load-more>
|
<uni-load-more :status="loadingType" @loadmore="loadmore()"></uni-load-more>
|
||||||
</scroll-view>
|
</scroll-view>
|
||||||
@@ -148,39 +146,39 @@
|
|||||||
!isSWitch &&
|
!isSWitch &&
|
||||||
!(goodsList == [] || goodsList == '' || goodsList == null)
|
!(goodsList == [] || goodsList == '' || goodsList == null)
|
||||||
">
|
">
|
||||||
<scroll-view :style="{ height: goodsHeight }" scroll-anchoring enableBackToTop="true" @scrolltolower="loadmore()" scroll-with-animation scroll-y lower-threshold="250" class="scoll-page">
|
<scroll-view :style="{ height: goodsHeight }" scroll-anchoring enableBackToTop="true"
|
||||||
|
@scrolltolower="loadmore()" scroll-with-animation scroll-y lower-threshold="250" class="scoll-page">
|
||||||
<view class="goods-list">
|
<view class="goods-list">
|
||||||
<view v-for="(item, index) in goodsList" :key="index" class="goods-item" @click="navigateToDetailPage(item)">
|
<view v-for="(item, index) in goodsList" :key="index" class="goods-item">
|
||||||
<view class="image-wrapper">
|
<view class="image-wrapper" @click="navigateToDetailPage(item)">
|
||||||
<image :src="item.thumbnail" mode="aspectFill"></image>
|
<image :src="item.content.thumbnail" mode="aspectFill"></image>
|
||||||
</view>
|
</view>
|
||||||
<view class="goods-detail">
|
<view class="goods-detail">
|
||||||
<div class="title clamp">{{ item.goodsName }}</div>
|
<div class="title clamp" @click="navigateToDetailPage(item)">{{ item.content.goodsName }}</div>
|
||||||
<view class="price-box">
|
<view class="price-box" @click="navigateToDetailPage(item)">
|
||||||
<div class="price" v-if="item.price!=undefined">
|
<div class="price" v-if="item.content.price!=undefined">
|
||||||
|
¥<span>{{ formatPrice(item.content.price )[0] }} </span>.{{
|
||||||
¥<span>{{ formatPrice(item.price )[0] }} </span>.{{
|
formatPrice(item.content.price )[1]
|
||||||
formatPrice(item.price )[1]
|
|
||||||
}}
|
}}
|
||||||
</div>
|
</div>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<div class="promotion">
|
<div class="promotion" @click="navigateToDetailPage(item)">
|
||||||
<div v-for="(promotionItem,promotionIndex) in getPromotion(item)" :key="promotionIndex">
|
<div v-for="(promotionItem,promotionIndex) in getPromotion(item)" :key="promotionIndex">
|
||||||
|
|
||||||
<span v-if="promotionItem.indexOf('COUPON') != -1">劵</span>
|
<span v-if="promotionItem.indexOf('COUPON') != -1">劵</span>
|
||||||
<span v-if="promotionItem.indexOf('FULL_DISCOUNT') != -1">满减</span>
|
<span v-if="promotionItem.indexOf('FULL_DISCOUNT') != -1">满减</span>
|
||||||
<span v-if="promotionItem.indexOf('SECKILL') != -1">秒杀</span>
|
<span v-if="promotionItem.indexOf('SECKILL') != -1">秒杀</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="countConfig">
|
<div class="count-config" @click="navigateToDetailPage(item)">
|
||||||
<span>已售 {{ item.buyCount || "0" }}</span>
|
<span>已售 {{ item.content.buyCount || "0" }}</span>
|
||||||
<span>{{ item.commentNum || "0" }}条评论</span>
|
<span>{{ item.content.commentNum || "0" }}条评论</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="storeSellerName">
|
<div class="store-seller-name" @click="navigateToStoreDetailPage(item)">
|
||||||
<div class="textHidden">
|
<div class="text-hidden">
|
||||||
<u-tag style="margin-right: 10rpx" size="mini" mode="dark" v-if="item.selfOperated == 1" text="自营" type="error" />
|
<u-tag style="margin-right: 10rpx" size="mini" mode="dark" v-if="item.selfOperated" text="自营"
|
||||||
<span>{{ item.storeName || "暂无" }}</span>
|
type="error" />
|
||||||
|
<span>{{ item.content.storeName || "暂无" }}</span>
|
||||||
</div>
|
</div>
|
||||||
<span>
|
<span>
|
||||||
<u-icon name="arrow-right"></u-icon>
|
<u-icon name="arrow-right"></u-icon>
|
||||||
@@ -201,7 +199,8 @@
|
|||||||
<view class="sort-item">
|
<view class="sort-item">
|
||||||
<view class="sort-title"> 品牌 </view>
|
<view class="sort-title"> 品牌 </view>
|
||||||
<view class="flex" v-if="sortData.brands">
|
<view class="flex" v-if="sortData.brands">
|
||||||
<view class="sort-brand-item" :key="brandsIndex" v-for="(brand, brandsIndex) in sortData.brands" @click="handleSort(brand, brandsIndex, 'brand')">
|
<view class="sort-brand-item" :key="brandsIndex" v-for="(brand, brandsIndex) in sortData.brands"
|
||||||
|
@click="handleSort(brand, brandsIndex, 'brand')">
|
||||||
<view class="sort-radius" :class="{
|
<view class="sort-radius" :class="{
|
||||||
'sort-active': brand.__selected,
|
'sort-active': brand.__selected,
|
||||||
}">
|
}">
|
||||||
@@ -214,7 +213,9 @@
|
|||||||
<view class="sort-item">
|
<view class="sort-item">
|
||||||
<view class="sort-title"> 全部分类 </view>
|
<view class="sort-title"> 全部分类 </view>
|
||||||
<view class="flex" style="flex-wrap: wrap;" v-if="sortData.categories">
|
<view class="flex" style="flex-wrap: wrap;" v-if="sortData.categories">
|
||||||
<view class="sort-brand-item" :key="categoriesIndex" v-for="(categoryId, categoriesIndex) in sortData.categories" @click="handleSort(categoryId, categoriesIndex, 'categoryId')">
|
<view class="sort-brand-item" :key="categoriesIndex"
|
||||||
|
v-for="(categoryId, categoriesIndex) in sortData.categories"
|
||||||
|
@click="handleSort(categoryId, categoriesIndex, 'categoryId')">
|
||||||
<view class="sort-radius" :class="{
|
<view class="sort-radius" :class="{
|
||||||
'sort-active': categoryId.__selected,
|
'sort-active': categoryId.__selected,
|
||||||
}">
|
}">
|
||||||
@@ -248,7 +249,8 @@
|
|||||||
<view class="sort-item" :key="paramIndex" v-for="(param, paramIndex) in sortData.paramOptions">
|
<view class="sort-item" :key="paramIndex" v-for="(param, paramIndex) in sortData.paramOptions">
|
||||||
<view class="sort-title"> {{ param.key }} </view>
|
<view class="sort-title"> {{ param.key }} </view>
|
||||||
<view class="flex" style="flex-warp:warp" v-if="param.values">
|
<view class="flex" style="flex-warp:warp" v-if="param.values">
|
||||||
<view class="sort-brand-item" :key="i" v-for="(value, i) in param.values" @click="handleSort(value, i, 'prop', param)">
|
<view class="sort-brand-item" :key="i" v-for="(value, i) in param.values"
|
||||||
|
@click="handleSort(value, i, 'prop', param)">
|
||||||
<view class="sort-radius" :class="{
|
<view class="sort-radius" :class="{
|
||||||
'sort-active': value.__selected,
|
'sort-active': value.__selected,
|
||||||
}">
|
}">
|
||||||
@@ -266,6 +268,7 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</u-popup>
|
</u-popup>
|
||||||
|
<u-back-top :scroll-top="scrollTop"></u-back-top>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -274,10 +277,11 @@ import { getGoodsList, getGoodsRelated } from "@/api/goods.js";
|
|||||||
|
|
||||||
import { getHotKeywords } from "@/api/home.js";
|
import { getHotKeywords } from "@/api/home.js";
|
||||||
import mSearch from "@/components/m-search-revision/m-search-revision.vue";
|
import mSearch from "@/components/m-search-revision/m-search-revision.vue";
|
||||||
|
import storage from "@/utils/storage";
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
scrollTop: 0,
|
||||||
loadIndex: 10,
|
loadIndex: 10,
|
||||||
oldKeywordIndex: "",
|
oldKeywordIndex: "",
|
||||||
selectedWay: {
|
selectedWay: {
|
||||||
@@ -314,17 +318,16 @@ export default {
|
|||||||
isSWitch: false,
|
isSWitch: false,
|
||||||
|
|
||||||
params: {
|
params: {
|
||||||
pageNumber: 0,
|
pageNumber: 1,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
// sort: 'grade_asc',
|
// sort: 'grade_asc',
|
||||||
sort: "releaseTime",
|
|
||||||
order: "desc",
|
|
||||||
keyword: "",
|
keyword: "",
|
||||||
},
|
},
|
||||||
minPrice: "",
|
minPrice: "",
|
||||||
maxPrice: "",
|
maxPrice: "",
|
||||||
sortParams: {
|
sortParams: {
|
||||||
pageNumber: 0,
|
pageNumber: 1,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
|
|
||||||
// price: "", //价格,示例值(10_30)
|
// price: "", //价格,示例值(10_30)
|
||||||
@@ -336,10 +339,13 @@ export default {
|
|||||||
routerVal: "",
|
routerVal: "",
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
onPageScroll(e) {
|
||||||
|
console.log(e);
|
||||||
|
this.scrollTop = e.scrollTop;
|
||||||
|
},
|
||||||
onLoad(val) {
|
onLoad(val) {
|
||||||
// return false
|
|
||||||
this.init();
|
this.init();
|
||||||
this.initSortGoods();
|
// this.initSortGoods();
|
||||||
// 接收分类的数据
|
// 接收分类的数据
|
||||||
|
|
||||||
this.routerVal = val;
|
this.routerVal = val;
|
||||||
@@ -347,6 +353,7 @@ export default {
|
|||||||
// 有值
|
// 有值
|
||||||
if (this.routerVal.category) {
|
if (this.routerVal.category) {
|
||||||
this.params.categoryId = this.routerVal.category;
|
this.params.categoryId = this.routerVal.category;
|
||||||
|
this.sortParams.categoryId = this.routerVal.category;
|
||||||
this.isShowSeachGoods = true;
|
this.isShowSeachGoods = true;
|
||||||
}
|
}
|
||||||
if (this.routerVal.keyword) {
|
if (this.routerVal.keyword) {
|
||||||
@@ -360,9 +367,28 @@ export default {
|
|||||||
this.loadData();
|
this.loadData();
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
//引用mSearch组件,如不需要删除即可
|
|
||||||
mSearch,
|
mSearch,
|
||||||
},
|
},
|
||||||
|
watch: {
|
||||||
|
/**
|
||||||
|
* 将搜索的字和热词进行匹配,如果为热词则不改商品搜索关键字
|
||||||
|
*/
|
||||||
|
keyword(val) {
|
||||||
|
if (val) {
|
||||||
|
if (val) {
|
||||||
|
this.defaultKeyword = val;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.defaultKeyword = "请输入搜索商品";
|
||||||
|
}
|
||||||
|
},
|
||||||
|
sortPopup(val) {
|
||||||
|
if (val) {
|
||||||
|
this.selectedWay = { brand: [], categoryId: [], prop: [] };
|
||||||
|
console.log(this.selectedWay);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
onReachBottom() {
|
onReachBottom() {
|
||||||
this.params.pageNumber++;
|
this.params.pageNumber++;
|
||||||
@@ -437,19 +463,32 @@ export default {
|
|||||||
// 点击确定进行筛选
|
// 点击确定进行筛选
|
||||||
sortConfim() {
|
sortConfim() {
|
||||||
// 处理品牌(多选
|
// 处理品牌(多选
|
||||||
this.params.brandId = [];
|
if (!this.params.brandId) {
|
||||||
|
this.params.brandId = [];
|
||||||
|
} else {
|
||||||
|
this.params.brandId = [this.params.brandId];
|
||||||
|
}
|
||||||
|
|
||||||
|
// 如果选中品牌 赋值
|
||||||
this.selectedWay["brand"].forEach((item) => {
|
this.selectedWay["brand"].forEach((item) => {
|
||||||
if (item.__selected) {
|
if (item.__selected) {
|
||||||
this.params.brandId.push(item.value);
|
this.params.brandId.push(item.value);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
this.params.brandId = this.params.brandId.join("@");
|
|
||||||
|
this.params.brandId = this.params.brandId.join("@") || "";
|
||||||
|
|
||||||
|
console.log(this.params.brandId);
|
||||||
// 处理分类 (单选)
|
// 处理分类 (单选)
|
||||||
if (this.selectedWay["categoryId"][0]) {
|
if (this.selectedWay["categoryId"][0]) {
|
||||||
this.params.categoryId = this.selectedWay["categoryId"][0].value;
|
this.params.categoryId = this.selectedWay["categoryId"][0].value;
|
||||||
}
|
}
|
||||||
// 处理属性
|
if (!this.params.prop) {
|
||||||
this.params.prop = [];
|
this.params.prop = [];
|
||||||
|
} else {
|
||||||
|
this.params.prop = [this.params.prop];
|
||||||
|
}
|
||||||
|
|
||||||
this.selectedWay["prop"].forEach((item) => {
|
this.selectedWay["prop"].forEach((item) => {
|
||||||
if (item.__selected) {
|
if (item.__selected) {
|
||||||
this.params.prop.push(`${item.parent}_${item.title}`);
|
this.params.prop.push(`${item.parent}_${item.title}`);
|
||||||
@@ -464,19 +503,32 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
this.goodsList = [];
|
this.goodsList = [];
|
||||||
|
|
||||||
|
this.params.pageNumber = 1;
|
||||||
|
this.sortParams = this.params;
|
||||||
|
|
||||||
|
|
||||||
this.loadData();
|
this.loadData();
|
||||||
this.sortPopup = false;
|
this.sortPopup = false;
|
||||||
},
|
},
|
||||||
|
|
||||||
// 重置
|
// 重置
|
||||||
repick() {
|
repick() {
|
||||||
|
this.sortParams = {
|
||||||
|
pageNumber: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
categoryId: this.routerVal.category || "",
|
||||||
|
};
|
||||||
|
this.sortPopup = false;
|
||||||
this.initSortGoods();
|
this.initSortGoods();
|
||||||
this.minPrice = "";
|
this.minPrice = "";
|
||||||
this.maxPrice = "";
|
this.maxPrice = "";
|
||||||
this.params = {
|
this.params = {
|
||||||
pageNumber: 0,
|
pageNumber: 1,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
|
categoryId: this.routerVal.category || "",
|
||||||
};
|
};
|
||||||
|
this.goodsList = [];
|
||||||
this.loadData();
|
this.loadData();
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -497,8 +549,9 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
init() {
|
init() {
|
||||||
this.loadDefaultKeyword();
|
// 加载搜索记录
|
||||||
this.loadOldKeyword(this.loadIndex);
|
this.loadOldKeyword(this.loadIndex);
|
||||||
|
// 加载热词
|
||||||
this.loadHotKeyword();
|
this.loadHotKeyword();
|
||||||
},
|
},
|
||||||
blur() {
|
blur() {
|
||||||
@@ -509,9 +562,16 @@ export default {
|
|||||||
delta: 1,
|
delta: 1,
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
// 跳转到商品详情
|
||||||
navigateToDetailPage(item) {
|
navigateToDetailPage(item) {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: `/pages/product/goods?id=${item.id}&goodsId=${item.goodsId}`,
|
url: `/pages/product/goods?id=${item.content.id}&goodsId=${item.content.goodsId}`,
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 跳转地址
|
||||||
|
navigateToStoreDetailPage(item) {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: `/pages/product/shopPage?id=${item.content.storeId}`,
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
loadmore() {
|
loadmore() {
|
||||||
@@ -545,7 +605,7 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
tabClick(index, type) {
|
tabClick(index, type) {
|
||||||
this.params.pageNumber = 0;
|
this.params.pageNumber = 1;
|
||||||
this.params.pageSize = 10;
|
this.params.pageSize = 10;
|
||||||
// this.params.order = "desc";
|
// this.params.order = "desc";
|
||||||
if (this.params.sort == type) {
|
if (this.params.sort == type) {
|
||||||
@@ -577,8 +637,16 @@ export default {
|
|||||||
},
|
},
|
||||||
//加载默认搜索关键字
|
//加载默认搜索关键字
|
||||||
loadDefaultKeyword() {
|
loadDefaultKeyword() {
|
||||||
//定义默认搜索关键字,可以自己实现ajax请求数据再赋值,用户未输入时,以水印方式显示在输入框,直接不输入内容搜索会搜索默认关键字
|
/**
|
||||||
this.defaultKeyword = "请输入搜索商品";
|
* 定义默认搜索关键字会根据当前热门搜索来进行显示
|
||||||
|
* 如果当前热门搜索没有的话,则会显示默认关键字
|
||||||
|
*/
|
||||||
|
if (this.hotKeywordList.length != 0) {
|
||||||
|
//
|
||||||
|
this.defaultKeyword = this.hotKeywordList[0];
|
||||||
|
} else {
|
||||||
|
this.defaultKeyword = "请输入搜索商品";
|
||||||
|
}
|
||||||
},
|
},
|
||||||
//加载历史搜索,自动读取本地Storage
|
//加载历史搜索,自动读取本地Storage
|
||||||
loadOldKeyword(index) {
|
loadOldKeyword(index) {
|
||||||
@@ -594,15 +662,39 @@ export default {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
//加载热门搜索
|
|
||||||
|
/**
|
||||||
|
* 加载热门搜索
|
||||||
|
* 1.5分钟之后更新缓存
|
||||||
|
* 2.如果有缓存热门关键字则去请求缓存
|
||||||
|
*/
|
||||||
async loadHotKeyword() {
|
async loadHotKeyword() {
|
||||||
this.hotKeywordList = [];
|
this.hotKeywordList = [];
|
||||||
let res = await getHotKeywords();
|
if (
|
||||||
let keywords = res.data.result;
|
!storage.getHotWords().time ||
|
||||||
|
storage.getHotWords().time <= new Date().getTime() / 1000
|
||||||
|
) {
|
||||||
|
// 没有缓存或者第一次进入请求接口保存缓存
|
||||||
|
let res = await getHotKeywords(10);
|
||||||
|
let keywords = res.data.result;
|
||||||
|
|
||||||
keywords.forEach((item) => {
|
keywords.forEach((item) => {
|
||||||
this.hotKeywordList.push(item);
|
this.hotKeywordList.push(item);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
let hotData = {
|
||||||
|
time: new Date().getTime() / 1000 + 30 * 5,
|
||||||
|
keywords: keywords,
|
||||||
|
};
|
||||||
|
storage.setHotWords(hotData);
|
||||||
|
} else {
|
||||||
|
let keywords = storage.getHotWords().keywords;
|
||||||
|
|
||||||
|
keywords.forEach((item) => {
|
||||||
|
this.hotKeywordList.push(item);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
this.loadDefaultKeyword();
|
||||||
},
|
},
|
||||||
//加载商品 ,带下拉刷新和上滑加载
|
//加载商品 ,带下拉刷新和上滑加载
|
||||||
async loadData(type, loading) {
|
async loadData(type, loading) {
|
||||||
@@ -610,9 +702,9 @@ export default {
|
|||||||
if (type == "refresh") {
|
if (type == "refresh") {
|
||||||
this.goodsList = [];
|
this.goodsList = [];
|
||||||
}
|
}
|
||||||
//没有更多直接返回
|
//没有更多直接返回 #TODO
|
||||||
let goodsList = await getGoodsList(this.params);
|
let goodsList = await getGoodsList(this.params);
|
||||||
|
|
||||||
if (goodsList.data.result.content.length < 10) {
|
if (goodsList.data.result.content.length < 10) {
|
||||||
this.loadingType = "noMore";
|
this.loadingType = "noMore";
|
||||||
}
|
}
|
||||||
@@ -620,19 +712,7 @@ export default {
|
|||||||
this.initSortGoods();
|
this.initSortGoods();
|
||||||
uni.hideLoading();
|
uni.hideLoading();
|
||||||
},
|
},
|
||||||
//监听输入
|
|
||||||
inputChange(event) {
|
|
||||||
//兼容引入组件时传入参数情况
|
|
||||||
var keyword = event.detail ? event.detail.value : event;
|
|
||||||
if (!keyword) {
|
|
||||||
this.keywordList = [];
|
|
||||||
this.isShowKeywordList = false;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
this.isShowKeywordList = true;
|
|
||||||
|
|
||||||
this.getKeywordNumFun(keyword);
|
|
||||||
},
|
|
||||||
//高亮关键字
|
//高亮关键字
|
||||||
drawCorrelativeKeyword(keywords, keyword) {
|
drawCorrelativeKeyword(keywords, keyword) {
|
||||||
var len = keywords.length,
|
var len = keywords.length,
|
||||||
@@ -663,7 +743,6 @@ export default {
|
|||||||
content: "确定清除历史搜索记录?",
|
content: "确定清除历史搜索记录?",
|
||||||
success: (res) => {
|
success: (res) => {
|
||||||
if (res.confirm) {
|
if (res.confirm) {
|
||||||
|
|
||||||
this.oldKeywordList = [];
|
this.oldKeywordList = [];
|
||||||
uni.removeStorage({
|
uni.removeStorage({
|
||||||
key: "OldKeys",
|
key: "OldKeys",
|
||||||
@@ -674,27 +753,39 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
// 样式修改布局
|
// 样式修改布局
|
||||||
doSearchSwitch(val) {
|
doSearchSwitch() {
|
||||||
this.isSWitch = !this.isSWitch;
|
this.isSWitch = !this.isSWitch;
|
||||||
this.isShowSeachGoods = true;
|
this.isShowSeachGoods = true;
|
||||||
},
|
},
|
||||||
|
|
||||||
//执行搜索
|
/**
|
||||||
|
* 执行搜索
|
||||||
|
*/
|
||||||
doSearch(keyword) {
|
doSearch(keyword) {
|
||||||
|
// 用户自行搜索/热门搜索/搜索历史
|
||||||
keyword = keyword === false ? this.keyword : keyword;
|
keyword = keyword === false ? this.keyword : keyword;
|
||||||
this.keyword = keyword;
|
|
||||||
|
if (!keyword) {
|
||||||
|
/**
|
||||||
|
* 进行空搜索
|
||||||
|
* 第一次搜索如果没有关键词会将热门搜索中第一个热词进行判定
|
||||||
|
* 如果没有热词则会展示一个空词搜索
|
||||||
|
*/
|
||||||
|
keyword = (this.hotKeywordList.length && this.hotKeywordList[0]) || "";
|
||||||
|
}
|
||||||
|
this.defaultKeyword == "请输入搜索商品" ? (keyword = "") : "";
|
||||||
|
// this.keyword = keyword;
|
||||||
|
keyword ? (this.keyword = keyword) : "";
|
||||||
this.saveKeyword(keyword); //保存为历史
|
this.saveKeyword(keyword); //保存为历史
|
||||||
this.isShowSeachGoods = true;
|
this.isShowSeachGoods = true;
|
||||||
this.$refs.mSearch.isShowSeachGoods = true;
|
this.$refs.mSearch.isShowSeachGoods = true;
|
||||||
this.params.keyword = keyword;
|
this.params.keyword = this.keyword;
|
||||||
this.params.pageNumber = 0;
|
this.params.pageNumber = 1;
|
||||||
this.$set(this.sortParams, "keyword", keyword);
|
this.$set(this.sortParams, "keyword", keyword);
|
||||||
|
|
||||||
this.loadData("refresh", 1);
|
this.loadData("refresh", 1);
|
||||||
},
|
},
|
||||||
//保存关键字到历史记录
|
//保存关键字到历史记录
|
||||||
saveKeyword(keyword) {
|
saveKeyword(keyword) {
|
||||||
|
|
||||||
if (!keyword) return false;
|
if (!keyword) return false;
|
||||||
uni.getStorage({
|
uni.getStorage({
|
||||||
key: "OldKeys",
|
key: "OldKeys",
|
||||||
@@ -715,7 +806,6 @@ export default {
|
|||||||
data: JSON.stringify(OldKeys),
|
data: JSON.stringify(OldKeys),
|
||||||
});
|
});
|
||||||
this.oldKeywordList = OldKeys; //更新历史搜索
|
this.oldKeywordList = OldKeys; //更新历史搜索
|
||||||
|
|
||||||
},
|
},
|
||||||
fail: (e) => {
|
fail: (e) => {
|
||||||
var OldKeys = [keyword];
|
var OldKeys = [keyword];
|
||||||
@@ -727,12 +817,6 @@ export default {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
// 搜索关键字
|
|
||||||
getKeywordNumFun(keywords) {
|
|
||||||
this.params.keyword = keywords;
|
|
||||||
this.$set(this.sortParams, "keyword", keywords);
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -1,325 +0,0 @@
|
|||||||
<template>
|
|
||||||
<view class="selected-store">
|
|
||||||
<!-- 点击搜索出现搜索框 -->
|
|
||||||
<!-- <div v-show="searchHandle" class="searchBox">
|
|
||||||
<u-search placeholder="请输入关键字" :clearabled="true" :show-action="false" v-model="pageParams.name" @blur="searchStore()" @clear="clearSearch()" @confirm="searchStore()" ></u-search>
|
|
||||||
</div> -->
|
|
||||||
<div>
|
|
||||||
<empty v-if="nomsg"></empty>
|
|
||||||
<div class="swiper-item">
|
|
||||||
<scroll-view class="scroll-v" enableBackToTop="true" scroll-with-animation scroll-y>
|
|
||||||
<view class="index-item" v-for="(store,storeIndex) in stores" :key="storeIndex" @click.prevent="storeDetail(store.id)">
|
|
||||||
<div class="item-goods">
|
|
||||||
<u-image width="51px" height="51px" class="item-title-img" :src="store.storeLogo || noLogo">
|
|
||||||
<u-loading slot="loading"></u-loading>
|
|
||||||
</u-image>
|
|
||||||
<view class="item-content">
|
|
||||||
<view>
|
|
||||||
<span>{{ store.storeName }}</span><span class="self-store" v-if="store.selfOperated">自营</span>
|
|
||||||
</view>
|
|
||||||
<view>
|
|
||||||
<u-rate size="24" :count="5" :disabled="true" v-model="store.descriptionScore"></u-rate>
|
|
||||||
</view>
|
|
||||||
<view>{{ store.store_collect }} 关注</view>
|
|
||||||
<button v-if="store.is_connect==0" @click.stop="collectstore(store.id)" class="collect btn-mini">
|
|
||||||
<u-icon name="plus"></u-icon>关注
|
|
||||||
</button>
|
|
||||||
<button v-if="store.is_connect==1" @click.stop="collectstore(store.id)" class="collect btn-mini"></u-icon>已关注</button>
|
|
||||||
</view>
|
|
||||||
<view class="store-num">
|
|
||||||
<!-- <view> {{store.goods_num}}</view> -->
|
|
||||||
<view>进店逛逛</view>
|
|
||||||
</view>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</view>
|
|
||||||
<uni-load-more :status="loadStatus"></uni-load-more>
|
|
||||||
</scroll-view>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import { collectionStore } from "@/api/members.js";
|
|
||||||
import { getstoreList } from "@/api/store.js";
|
|
||||||
export default {
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
tabIndex: 0,
|
|
||||||
currentLeft: 0,
|
|
||||||
stores: [],
|
|
||||||
pageParams: {
|
|
||||||
pageNumber: 1, //页码
|
|
||||||
pageSize: 10, //分页大小
|
|
||||||
category_id: 0, //分类
|
|
||||||
key_words: "", //搜索关键字
|
|
||||||
name: "", //店铺名字
|
|
||||||
},
|
|
||||||
loadStatus: "more",
|
|
||||||
nomsg: false,
|
|
||||||
noLogo: require("@/static/logo.png"),
|
|
||||||
};
|
|
||||||
},
|
|
||||||
onLoad() {
|
|
||||||
this.searchStore();
|
|
||||||
},
|
|
||||||
watch: {
|
|
||||||
tabIndex(val) {
|
|
||||||
this.pageParams.pageNumber = 1;
|
|
||||||
this.stores = [];
|
|
||||||
this.loadStatus = "more";
|
|
||||||
this.searchStore();
|
|
||||||
},
|
|
||||||
},
|
|
||||||
onReachBottom() {
|
|
||||||
|
|
||||||
this.pageParams.pageNumber++;
|
|
||||||
this.searchStore();
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
// 清空店铺
|
|
||||||
clearSearch() {
|
|
||||||
(this.pageParams = {
|
|
||||||
pageNumber: 1, //页码
|
|
||||||
pageSize: 10, //分页大小
|
|
||||||
category_id: 0, //分类
|
|
||||||
key_words: "", //搜索关键字
|
|
||||||
name: "", //店铺名字
|
|
||||||
}),
|
|
||||||
this.searchStore();
|
|
||||||
},
|
|
||||||
|
|
||||||
async searchStore() {
|
|
||||||
uni.showLoading({
|
|
||||||
title: "加载中",
|
|
||||||
});
|
|
||||||
|
|
||||||
//获取商品数据
|
|
||||||
let response = await getstoreList(this.pageParams);
|
|
||||||
uni.hideLoading();
|
|
||||||
if (this.pageParams.name) {
|
|
||||||
this.stores = [];
|
|
||||||
}
|
|
||||||
|
|
||||||
this.stores = this.stores.concat(response.data.result.records);
|
|
||||||
uni.hideLoading();
|
|
||||||
if (
|
|
||||||
response.data.result.total <=
|
|
||||||
response.data.result.current * response.data.result.size
|
|
||||||
) {
|
|
||||||
this.loadStatus = "noMore";
|
|
||||||
} else {
|
|
||||||
this.loadStatus = "loadmore";
|
|
||||||
}
|
|
||||||
if (this.stores.length == 0) {
|
|
||||||
this.nomsg = true;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
collectstore(id) {
|
|
||||||
//收藏店铺
|
|
||||||
collectionStore(id).then((res) => {
|
|
||||||
if (res.statusCode == 200) {
|
|
||||||
this.$api.msg("收藏成功");
|
|
||||||
this.pageParams.pageNumber = 1;
|
|
||||||
this.stores = [];
|
|
||||||
this.searchStore();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
storeDetail(id) {
|
|
||||||
uni.navigateTo({
|
|
||||||
url: "/pages/product/shopPage?id=" + id,
|
|
||||||
});
|
|
||||||
},
|
|
||||||
},
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
<style>
|
|
||||||
page {
|
|
||||||
height: 100%;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
.searchBox {
|
|
||||||
margin: 20rpx 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.selected-store {
|
|
||||||
height: 100%;
|
|
||||||
|
|
||||||
.list-scroll-content {
|
|
||||||
position: relative;
|
|
||||||
width: 100%;
|
|
||||||
display: flex;
|
|
||||||
white-space: nowrap;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: space-between;
|
|
||||||
align-items: center;
|
|
||||||
background-color: #fff;
|
|
||||||
color: #333;
|
|
||||||
|
|
||||||
.tab-item {
|
|
||||||
width: 160rpx;
|
|
||||||
height: 80rpx;
|
|
||||||
line-height: 80rpx;
|
|
||||||
text-align: center;
|
|
||||||
display: inline-block;
|
|
||||||
}
|
|
||||||
|
|
||||||
.active {
|
|
||||||
border-bottom: 2px solid #ffffff;
|
|
||||||
broder-width: 60rpx;
|
|
||||||
font-size: 30rpx;
|
|
||||||
padding-bottom: 4rpx;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.swiper-box {
|
|
||||||
height: calc(100% - 80rpx);
|
|
||||||
|
|
||||||
.scroll-v {
|
|
||||||
height: 100%;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.index-item {
|
|
||||||
// height: 535rpx;
|
|
||||||
margin: 20rpx;
|
|
||||||
background-color: #ffffff;
|
|
||||||
border-radius: 14rpx;
|
|
||||||
|
|
||||||
.item-goods {
|
|
||||||
height: 170rpx;
|
|
||||||
margin: 0 20rpx;
|
|
||||||
padding: 30rpx 0;
|
|
||||||
// border-bottom: 1px solid #eeeeee;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
|
|
||||||
image {
|
|
||||||
width: 102rpx;
|
|
||||||
height: 102rpx;
|
|
||||||
border-radius: 50%;
|
|
||||||
}
|
|
||||||
.item-title-img {
|
|
||||||
width: 102rpx !important;
|
|
||||||
height: 102rpx !important;
|
|
||||||
border-radius: 50% !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.item-content {
|
|
||||||
flex: 1;
|
|
||||||
line-height: 2em;
|
|
||||||
font-size: $font-sm;
|
|
||||||
position: relative;
|
|
||||||
.collect {
|
|
||||||
position: absolute;
|
|
||||||
width: 100rpx;
|
|
||||||
height: 40rpx;
|
|
||||||
font-size: 26rpx;
|
|
||||||
bottom: 20rpx;
|
|
||||||
right: 30rpx;
|
|
||||||
padding: 0;
|
|
||||||
line-height: 40rpx;
|
|
||||||
text-align: right;
|
|
||||||
padding-right: 14rpx;
|
|
||||||
.u-icon {
|
|
||||||
font-size: 26rpx;
|
|
||||||
position: absolute;
|
|
||||||
top: 7rpx;
|
|
||||||
left: 10rpx;
|
|
||||||
margin-right: 5rpx;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
> view:first-child {
|
|
||||||
font-size: $font-base;
|
|
||||||
color: #333333;
|
|
||||||
font-weight: 700;
|
|
||||||
position: relative;
|
|
||||||
|
|
||||||
span:nth-child(2) {
|
|
||||||
position: absolute;
|
|
||||||
font-weight: 400;
|
|
||||||
top: 12rpx;
|
|
||||||
font-size: 18rpx;
|
|
||||||
margin-left: 20rpx;
|
|
||||||
height: 26rpx;
|
|
||||||
width: 50rpx;
|
|
||||||
line-height: 26rpx;
|
|
||||||
text-align: center;
|
|
||||||
color: #ffffff;
|
|
||||||
background-color: #ff6262;
|
|
||||||
border-radius: 4rpx;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
color: #999;
|
|
||||||
margin-left: 30rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.store-num {
|
|
||||||
width: 150rpx;
|
|
||||||
text-align: center;
|
|
||||||
border-left: 1px solid #eeeeee;
|
|
||||||
|
|
||||||
:nth-child(1) {
|
|
||||||
font-size: 26rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
:nth-child(2) {
|
|
||||||
font-size: 18rpx;
|
|
||||||
color: #999;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.goods-in-store {
|
|
||||||
height: 364rpx;
|
|
||||||
white-space: nowrap;
|
|
||||||
padding: 20rpx 0 20rpx 20rpx;
|
|
||||||
|
|
||||||
.goods-item {
|
|
||||||
width: 195rpx;
|
|
||||||
display: inline-block;
|
|
||||||
white-space: normal;
|
|
||||||
margin-right: 20rpx;
|
|
||||||
font-size: $font-sm;
|
|
||||||
overflow: hidden;
|
|
||||||
text-overflow: ellipsis;
|
|
||||||
white-space: nowrap;
|
|
||||||
|
|
||||||
image {
|
|
||||||
width: 195rpx;
|
|
||||||
height: 195rpx;
|
|
||||||
border-radius: 8rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
> view {
|
|
||||||
margin-top: 10rpx;
|
|
||||||
}
|
|
||||||
.goods-item-img {
|
|
||||||
width: 195rpx !important;
|
|
||||||
height: 195rpx !important;
|
|
||||||
border-radius: 8rpx !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
> view:nth-child(2) {
|
|
||||||
color: #ff5a10;
|
|
||||||
}
|
|
||||||
|
|
||||||
.goods-name {
|
|
||||||
overflow: hidden;
|
|
||||||
text-overflow: ellipsis;
|
|
||||||
white-space: nowrap;
|
|
||||||
display: -webkit-box;
|
|
||||||
-webkit-box-orient: vertical;
|
|
||||||
-webkit-line-clamp: 2;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -1,8 +1,13 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="content">
|
<view class="content">
|
||||||
<view class="u-tabs-box">
|
<view class="u-tabs-box">
|
||||||
<u-tabs bg-color="#fff" :list="list" :is-scroll="false" :current="current" @change="change" :active-color="$lightColor"></u-tabs>
|
<u-tabs bg-color="#fff" :list="list" :is-scroll="false" :current="current" @change="change"
|
||||||
|
:active-color="$lightColor"></u-tabs>
|
||||||
</view>
|
</view>
|
||||||
|
<div class="u-tabs-search">
|
||||||
|
<u-search placeholder="请输入订单编号" @search="handleGetOrderList(current)" @clear="handleGetOrderList(current)"
|
||||||
|
@custom="handleGetOrderList(current)" v-model="params.orderSn"></u-search>
|
||||||
|
</div>
|
||||||
<scroll-view class="body-view" scroll-y @scrolltolower="renderDate">
|
<scroll-view class="body-view" scroll-y @scrolltolower="renderDate">
|
||||||
<view class="seller-view" v-for="(order, orderIndex) in orderList" :key="orderIndex">
|
<view class="seller-view" v-for="(order, orderIndex) in orderList" :key="orderIndex">
|
||||||
<!-- 店铺名称 -->
|
<!-- 店铺名称 -->
|
||||||
@@ -18,7 +23,7 @@
|
|||||||
<view class="order-sn">{{ order.serviceType_text }}</view>
|
<view class="order-sn">{{ order.serviceType_text }}</view>
|
||||||
</view>
|
</view>
|
||||||
<view v-for="(sku, goodsIndex) in order.orderItems" :key="goodsIndex">
|
<view v-for="(sku, goodsIndex) in order.orderItems" :key="goodsIndex">
|
||||||
<view class="goods-item-view" @click="onDetail(sku)">
|
<view class="goods-item-view" @click="onDetail(order,sku)">
|
||||||
<view class="goods-img">
|
<view class="goods-img">
|
||||||
<u-image border-radius="6" width="100%" height="100%" :src="sku.image"></u-image>
|
<u-image border-radius="6" width="100%" height="100%" :src="sku.image"></u-image>
|
||||||
</view>
|
</view>
|
||||||
@@ -37,31 +42,38 @@
|
|||||||
<view class="description">
|
<view class="description">
|
||||||
<!-- 售后申请 -->
|
<!-- 售后申请 -->
|
||||||
<view v-if="
|
<view v-if="
|
||||||
current === 0 && order.groupAfterSaleStatus &&
|
current === 0 && order.groupAfterSaleStatus &&
|
||||||
order.groupAfterSaleStatus === 'ALREADY_APPLIED'
|
order.groupAfterSaleStatus.includes('ALREADY_APPLIED')
|
||||||
" class="cannot_apply">
|
" class="cannot_apply">
|
||||||
<u-icon class="icon" name="info-circle-fill"></u-icon>
|
<u-icon class="icon" name="info-circle-fill"></u-icon>
|
||||||
该商品已申请售后服务
|
该商品已申请售后服务
|
||||||
</view>
|
</view>
|
||||||
<view class="cannot_apply" v-if="current === 0 && order.groupAfterSaleStatus && order.groupAfterSaleStatus === 'EXPIRED'" @click="tipsShow = true">
|
<view class="cannot_apply"
|
||||||
|
v-if="current === 0 && order.groupAfterSaleStatus && order.groupAfterSaleStatus.includes('EXPIRED') "
|
||||||
|
@click="tipsShow = true">
|
||||||
<u-icon class="icon" name="info-circle-fill"></u-icon>
|
<u-icon class="icon" name="info-circle-fill"></u-icon>
|
||||||
该商品无法申请售后
|
该商品无法申请售后
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<div v-if="current === 1 || current === 2">
|
<div v-if="current === 1 || current === 2">
|
||||||
<!-- 申请中 -->
|
<!-- 申请中 -->
|
||||||
<view class="cannot_apply" v-if="order.serviceType == 'RETURN_GOODS'">退货处理-{{ order.serviceStatus | serviceStatusList }}</view>
|
<view class="cannot_apply" v-if="order.serviceType == 'RETURN_GOODS'">
|
||||||
<view class="cannot_apply" v-if="order.serviceType == 'SUPPLY_AGAIN_GOODS'">补发商品-{{ order.serviceStatus | serviceStatusList }}</view>
|
退货处理-{{ order.serviceStatus | serviceStatusList }}</view>
|
||||||
<view class="cannot_apply" v-if="order.serviceType == 'RETURN_MONEY'">退款-{{ order.serviceStatus | serviceStatusList }}</view>
|
<view class="cannot_apply" v-if="order.serviceType == 'SUPPLY_AGAIN_GOODS'">
|
||||||
<view class="cannot_apply" v-if="order.serviceType == 'EXCHANGE_GOODS'">换货-{{ order.serviceStatus | serviceStatusList }}</view>
|
补发商品-{{ order.serviceStatus | serviceStatusList }}</view>
|
||||||
<view class="cannot_apply" v-if="order.serviceType == 'CANCEL'">取消订单-{{ order.serviceStatus | serviceStatusList }}</view>
|
<view class="cannot_apply" v-if="order.serviceType == 'RETURN_MONEY'">
|
||||||
|
退款-{{ order.serviceStatus | serviceStatusList }}</view>
|
||||||
|
<view class="cannot_apply" v-if="order.serviceType == 'EXCHANGE_GOODS'">
|
||||||
|
换货-{{ order.serviceStatus | serviceStatusList }}</view>
|
||||||
|
<view class="cannot_apply" v-if="order.serviceType == 'CANCEL'">
|
||||||
|
取消订单-{{ order.serviceStatus | serviceStatusList }}</view>
|
||||||
</div>
|
</div>
|
||||||
<!-- 申请记录 -->
|
<!-- 申请记录 -->
|
||||||
</view>
|
</view>
|
||||||
<view class="after-line">
|
<view class="after-line">
|
||||||
<!-- 售后申请 -->
|
<!-- 售后申请 -->
|
||||||
<view v-if="
|
<view v-if="
|
||||||
current === 0 && order.groupAfterSaleStatus=='NOT_APPLIED'
|
current === 0 && order.groupAfterSaleStatus.includes('NOT_APPLIED')
|
||||||
" @click="applyService(sku.sn, order, sku)" class="rebuy-btn">
|
" @click="applyService(sku.sn, order, sku)" class="rebuy-btn">
|
||||||
申请售后
|
申请售后
|
||||||
</view>
|
</view>
|
||||||
@@ -126,6 +138,8 @@ export default {
|
|||||||
params: {
|
params: {
|
||||||
pageNumber: 1,
|
pageNumber: 1,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
|
sort: "createTime",
|
||||||
|
order: "desc",
|
||||||
},
|
},
|
||||||
|
|
||||||
logParams: {
|
logParams: {
|
||||||
@@ -135,15 +149,20 @@ export default {
|
|||||||
status: "loadmore",
|
status: "loadmore",
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
onLoad() {
|
onLoad(options) {
|
||||||
this.orderList = [];
|
this.orderList = [];
|
||||||
this.params.pageNumber = 1;
|
this.params.pageNumber = 1;
|
||||||
|
if (options.orderSn) this.params.orderSn = options.orderSn;
|
||||||
this.getOrderList(this.current);
|
this.getOrderList(this.current);
|
||||||
},
|
},
|
||||||
onPullDownRefresh() {
|
onPullDownRefresh() {
|
||||||
this.change(this.current);
|
this.change(this.current);
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
handleGetOrderList(current) {
|
||||||
|
this.orderList = [];
|
||||||
|
this.getOrderList(current);
|
||||||
|
},
|
||||||
/**
|
/**
|
||||||
* 切换tab页时,初始化数据
|
* 切换tab页时,初始化数据
|
||||||
*/
|
*/
|
||||||
@@ -161,6 +180,8 @@ export default {
|
|||||||
this.logParams = {
|
this.logParams = {
|
||||||
pageNumber: 1,
|
pageNumber: 1,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
|
sort: "createTime",
|
||||||
|
order: "desc",
|
||||||
};
|
};
|
||||||
if (index === 1) {
|
if (index === 1) {
|
||||||
this.logParams.serviceStatus = "APPLY";
|
this.logParams.serviceStatus = "APPLY";
|
||||||
@@ -220,7 +241,6 @@ export default {
|
|||||||
price: item.flowPrice,
|
price: item.flowPrice,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
this.orderList = this.orderList.concat(afterSaleLogList);
|
this.orderList = this.orderList.concat(afterSaleLogList);
|
||||||
@@ -265,10 +285,19 @@ export default {
|
|||||||
/**
|
/**
|
||||||
* 查看详情
|
* 查看详情
|
||||||
*/
|
*/
|
||||||
onDetail(sku) {
|
onDetail(goods, sku) {
|
||||||
if (!this.$u.test.isEmpty(sku.skuId)) {
|
// 售后申请
|
||||||
|
if (this.current == 0) {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: `/pages/product/goods?id=${sku.skuId}&goodsId=${sku.goodsId}`,
|
url: `/pages/product/goods?id=${sku.skuId}&goodsId=${
|
||||||
|
sku.goodsId || sku.goodsId
|
||||||
|
}`,
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: `/pages/product/goods?id=${goods.skuId}&goodsId=${
|
||||||
|
goods.goodsId || goods.goodsId
|
||||||
|
}`,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -296,9 +325,12 @@ page,
|
|||||||
height: 100%;
|
height: 100%;
|
||||||
}
|
}
|
||||||
.body-view {
|
.body-view {
|
||||||
// height: calc(100vh - 44px -40px);
|
overflow-y: auto;
|
||||||
// overflow-y: auto;
|
height: calc(100vh - 44px - 80rpx - 104rpx);
|
||||||
height: 100%;
|
}
|
||||||
|
.u-tabs-search {
|
||||||
|
padding: 20rpx;
|
||||||
|
background: #fff;
|
||||||
}
|
}
|
||||||
.countMoney {
|
.countMoney {
|
||||||
margin-left: 7rpx;
|
margin-left: 7rpx;
|
||||||
|
|||||||
@@ -10,7 +10,8 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view>
|
<view>
|
||||||
<view class="goods-item-view" v-for="(item,index) in sku.orderItems" v-if="item.sn == sn" @click="gotoGoodsDetail(sku.goods_id)">
|
<view class="goods-item-view" v-for="(item,index) in sku.orderItems" v-if="item.sn == sn"
|
||||||
|
@click="gotoGoodsDetail(sku.goods_id)">
|
||||||
<view class="goods-img">
|
<view class="goods-img">
|
||||||
<u-image border-radius="6" width="131rpx" height="131rpx" :src="item.image"></u-image>
|
<u-image border-radius="6" width="131rpx" height="131rpx" :src="item.image"></u-image>
|
||||||
</view>
|
</view>
|
||||||
@@ -27,7 +28,8 @@
|
|||||||
<view class="after-num">
|
<view class="after-num">
|
||||||
<view>申请数量</view>
|
<view>申请数量</view>
|
||||||
<view>
|
<view>
|
||||||
<u-number-box :value="parseInt(form.num)" disabled-input :min="1" :max="parseInt(sku.num)" bg-color="#fff" @change="valChange"></u-number-box>
|
<u-number-box :value="parseInt(form.num)" disabled-input :min="1" :max="parseInt(sku.num)" bg-color="#fff"
|
||||||
|
@change="valChange"></u-number-box>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -36,7 +38,8 @@
|
|||||||
<!-- 退款原因 -->
|
<!-- 退款原因 -->
|
||||||
<view class="opt-view">
|
<view class="opt-view">
|
||||||
<u-form-item label="申请原因" :label-width="150">
|
<u-form-item label="申请原因" :label-width="150">
|
||||||
<u-input v-model="form.reason" type="select" input-align="right" :select-open="reasonSelectShow" @click="reasonSelectShow = true" placeholder="请选择申请原因" />
|
<u-input v-model="form.reason" type="select" input-align="right" :select-open="reasonSelectShow"
|
||||||
|
@click="reasonSelectShow = true" placeholder="请选择申请原因" />
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
<u-form-item label="申请说明" :label-width="150">
|
<u-form-item label="申请说明" :label-width="150">
|
||||||
<u-input input-align="right" type="textarea" v-model="form.problemDesc" placeholder="请描述申请售后的说明" />
|
<u-input input-align="right" type="textarea" v-model="form.problemDesc" placeholder="请描述申请售后的说明" />
|
||||||
@@ -47,7 +50,8 @@
|
|||||||
<view class="opt-view">
|
<view class="opt-view">
|
||||||
<view class="img-title">上传凭证(最多5张)</view>
|
<view class="img-title">上传凭证(最多5张)</view>
|
||||||
<view class="images-view">
|
<view class="images-view">
|
||||||
<u-upload :header=" { accessToken: storage.getAccessToken() }" :action="action" width="150" @on-uploaded="onUploaded" :max-count="5" :show-progress="false"></u-upload>
|
<u-upload :header=" { accessToken: storage.getAccessToken() }" :action="action" width="150"
|
||||||
|
@on-uploaded="onUploaded" :max-count="5" :show-progress="false"></u-upload>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
@@ -59,8 +63,7 @@
|
|||||||
</u-form-item>
|
</u-form-item>
|
||||||
<view v-if="
|
<view v-if="
|
||||||
applyInfo.accountType === 'BANK_TRANSFER' &&
|
applyInfo.accountType === 'BANK_TRANSFER' &&
|
||||||
applyInfo.applyRefundPrice != 0
|
applyInfo.applyRefundPrice != 0">
|
||||||
">
|
|
||||||
<u-form-item label="银行开户行" :label-width="150">
|
<u-form-item label="银行开户行" :label-width="150">
|
||||||
<u-input v-model="form.bankDepositName" type="text" input-align="right" placeholder="请输入银行开户行" />
|
<u-input v-model="form.bankDepositName" type="text" input-align="right" placeholder="请输入银行开户行" />
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
@@ -82,11 +85,14 @@
|
|||||||
</u-form>
|
</u-form>
|
||||||
|
|
||||||
<view class="submit-view">
|
<view class="submit-view">
|
||||||
<u-button type="primary" ripple shape="circle" v-if="applyInfo.refundWay" :custom-style="customStyle" @click="onSubmit">提交申请</u-button>
|
<u-button type="primary" ripple shape="circle" v-if="applyInfo.refundWay" :custom-style="customStyle"
|
||||||
|
@click="onSubmit">提交申请</u-button>
|
||||||
</view>
|
</view>
|
||||||
<u-select mode="single-column" :list="reasonList" v-model="reasonSelectShow" @confirm="reasonSelectConfirm"></u-select>
|
<u-select mode="single-column" :list="reasonList" v-model="reasonSelectShow" @confirm="reasonSelectConfirm">
|
||||||
|
</u-select>
|
||||||
<u-select mode="single-column" :list="typeList" v-model="typeSelectShow" @confirm="typeSelectConfirm"></u-select>
|
<u-select mode="single-column" :list="typeList" v-model="typeSelectShow" @confirm="typeSelectConfirm"></u-select>
|
||||||
<u-select mode="single-column" :list="returnList" v-model="returnSelectShow" @confirm="returnSelectConfirm"></u-select>
|
<u-select mode="single-column" :list="returnList" v-model="returnSelectShow" @confirm="returnSelectConfirm">
|
||||||
|
</u-select>
|
||||||
<u-toast ref="uToast" />
|
<u-toast ref="uToast" />
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
@@ -100,7 +106,7 @@ import {
|
|||||||
|
|
||||||
import city from "@/components/m-city/m-city";
|
import city from "@/components/m-city/m-city";
|
||||||
import { upload } from "@/api/common.js";
|
import { upload } from "@/api/common.js";
|
||||||
|
import { checkBankno } from "@/utils/Foundation";
|
||||||
import storage from "@/utils/storage.js";
|
import storage from "@/utils/storage.js";
|
||||||
export default {
|
export default {
|
||||||
component: {
|
component: {
|
||||||
@@ -191,8 +197,8 @@ export default {
|
|||||||
this.sn = options.sn;
|
this.sn = options.sn;
|
||||||
let dsku = decodeURIComponent(options.sku);
|
let dsku = decodeURIComponent(options.sku);
|
||||||
let newSku = JSON.parse(dsku);
|
let newSku = JSON.parse(dsku);
|
||||||
this.sku = newSku
|
this.sku = newSku;
|
||||||
|
|
||||||
this.form.orderItemSn = options.sn;
|
this.form.orderItemSn = options.sn;
|
||||||
this.form.skuId = this.sku.skuId;
|
this.form.skuId = this.sku.skuId;
|
||||||
this.form.num = this.sku.num;
|
this.form.num = this.sku.num;
|
||||||
@@ -254,9 +260,7 @@ export default {
|
|||||||
this.form.accountType_label = e[0].label;
|
this.form.accountType_label = e[0].label;
|
||||||
},
|
},
|
||||||
//返回方式
|
//返回方式
|
||||||
returnSelectConfirm(e) {
|
returnSelectConfirm(e) {},
|
||||||
|
|
||||||
},
|
|
||||||
|
|
||||||
//修改申请数量
|
//修改申请数量
|
||||||
valChange(e) {
|
valChange(e) {
|
||||||
@@ -264,7 +268,6 @@ export default {
|
|||||||
},
|
},
|
||||||
//图片上传
|
//图片上传
|
||||||
onUploaded(lists) {
|
onUploaded(lists) {
|
||||||
|
|
||||||
let images = [];
|
let images = [];
|
||||||
|
|
||||||
lists.forEach((item) => {
|
lists.forEach((item) => {
|
||||||
@@ -278,6 +281,7 @@ export default {
|
|||||||
if (!this.handleCheckParams()) {
|
if (!this.handleCheckParams()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
uni.showLoading({
|
uni.showLoading({
|
||||||
title: "加载中",
|
title: "加载中",
|
||||||
});
|
});
|
||||||
@@ -297,74 +301,8 @@ export default {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
|
||||||
* 验证银行卡号
|
|
||||||
*/
|
|
||||||
checkBankno(bankno) {
|
|
||||||
var lastNum = bankno.substr(bankno.length - 1, 1); //取出最后一位(与luhm进行比较)
|
|
||||||
var first15Num = bankno.substr(0, bankno.length - 1); //前15或18位
|
|
||||||
var newArr = [];
|
|
||||||
|
|
||||||
for (var i = first15Num.length - 1; i > -1; i--) {
|
|
||||||
//前15或18位倒序存进数组
|
|
||||||
newArr.push(first15Num.substr(i, 1));
|
|
||||||
}
|
|
||||||
|
|
||||||
var arrJiShu = []; //奇数位*2的积 <9
|
|
||||||
var arrJiShu2 = []; //奇数位*2的积 >9
|
|
||||||
var arrOuShu = []; //偶数位数组
|
|
||||||
for (var j = 0; j < newArr.length; j++) {
|
|
||||||
if ((j + 1) % 2 == 1) {
|
|
||||||
//奇数位
|
|
||||||
if (parseInt(newArr[j]) * 2 < 9)
|
|
||||||
arrJiShu.push(parseInt(newArr[j]) * 2);
|
|
||||||
else arrJiShu2.push(parseInt(newArr[j]) * 2);
|
|
||||||
} //偶数位
|
|
||||||
else arrOuShu.push(newArr[j]);
|
|
||||||
}
|
|
||||||
|
|
||||||
var jishu_child1 = []; //奇数位*2 >9 的分割之后的数组个位数
|
|
||||||
var jishu_child2 = []; //奇数位*2 >9 的分割之后的数组十位数
|
|
||||||
for (var h = 0; h < arrJiShu2.length; h++) {
|
|
||||||
jishu_child1.push(parseInt(arrJiShu2[h]) % 10);
|
|
||||||
jishu_child2.push(parseInt(arrJiShu2[h]) / 10);
|
|
||||||
}
|
|
||||||
|
|
||||||
var sumJiShu = 0; //奇数位*2 < 9 的数组之和
|
|
||||||
var sumOuShu = 0; //偶数位数组之和
|
|
||||||
var sumJiShuChild1 = 0; //奇数位*2 >9 的分割之后的数组个位数之和
|
|
||||||
var sumJiShuChild2 = 0; //奇数位*2 >9 的分割之后的数组十位数之和
|
|
||||||
var sumTotal = 0;
|
|
||||||
for (var m = 0; m < arrJiShu.length; m++) {
|
|
||||||
sumJiShu = sumJiShu + parseInt(arrJiShu[m]);
|
|
||||||
}
|
|
||||||
for (var n = 0; n < arrOuShu.length; n++) {
|
|
||||||
sumOuShu = sumOuShu + parseInt(arrOuShu[n]);
|
|
||||||
}
|
|
||||||
for (var p = 0; p < jishu_child1.length; p++) {
|
|
||||||
sumJiShuChild1 = sumJiShuChild1 + parseInt(jishu_child1[p]);
|
|
||||||
sumJiShuChild2 = sumJiShuChild2 + parseInt(jishu_child2[p]);
|
|
||||||
}
|
|
||||||
//计算总和
|
|
||||||
sumTotal =
|
|
||||||
parseInt(sumJiShu) +
|
|
||||||
parseInt(sumOuShu) +
|
|
||||||
parseInt(sumJiShuChild1) +
|
|
||||||
parseInt(sumJiShuChild2);
|
|
||||||
//计算Luhm值
|
|
||||||
var k = parseInt(sumTotal) % 10 == 0 ? 10 : parseInt(sumTotal) % 10;
|
|
||||||
var luhm = 10 - k;
|
|
||||||
if (lastNum == luhm) {
|
|
||||||
return true;
|
|
||||||
} else {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
//检测提交参数
|
//检测提交参数
|
||||||
handleCheckParams() {
|
handleCheckParams() {
|
||||||
|
|
||||||
if (this.$u.test.isEmpty(this.form.reason)) {
|
if (this.$u.test.isEmpty(this.form.reason)) {
|
||||||
this.$refs.uToast.show({ title: "请选择 退款原因", type: "error" });
|
this.$refs.uToast.show({ title: "请选择 退款原因", type: "error" });
|
||||||
return false;
|
return false;
|
||||||
@@ -398,7 +336,7 @@ export default {
|
|||||||
type: "error",
|
type: "error",
|
||||||
});
|
});
|
||||||
return false;
|
return false;
|
||||||
} else if (this.checkBankno(this.form.bankAccountNumber) === false) {
|
} else if (checkBankno(this.form.bankAccountNumber) === false) {
|
||||||
this.$refs.uToast.show({
|
this.$refs.uToast.show({
|
||||||
title: "银行卡卡号不正确",
|
title: "银行卡卡号不正确",
|
||||||
type: "error",
|
type: "error",
|
||||||
@@ -531,7 +469,6 @@ page,
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
}
|
}
|
||||||
.images-view {
|
.images-view {
|
||||||
padding: 20rpx;
|
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
@@ -553,7 +490,11 @@ page,
|
|||||||
background-color: #ffffff;
|
background-color: #ffffff;
|
||||||
height: 100rpx;
|
height: 100rpx;
|
||||||
width: 750rpx;
|
width: 750rpx;
|
||||||
|
justify-content: flex-end;
|
||||||
|
|
||||||
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
padding: 0rpx 20rpx;
|
width: 100%;
|
||||||
|
padding-right: 32rpx;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -26,7 +26,7 @@
|
|||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="select-view">
|
<view class="select-view">
|
||||||
<view class="select-cell" @click="onSelect(1)">
|
<view class="select-cell" v-if="applyInfo.returnGoods" @click="onSelect(1)">
|
||||||
<view class="select-image">
|
<view class="select-image">
|
||||||
<image style="height: 51rpx; width: 51rpx" src="/static/order/t1.png"></image>
|
<image style="height: 51rpx; width: 51rpx" src="/static/order/t1.png"></image>
|
||||||
</view>
|
</view>
|
||||||
@@ -34,11 +34,11 @@
|
|||||||
<view class="select-title">退货</view>
|
<view class="select-title">退货</view>
|
||||||
<view class="select-sub-title">
|
<view class="select-sub-title">
|
||||||
退回收到的商品
|
退回收到的商品
|
||||||
<uni-icons color="#BABABA" type="arrowright"></uni-icons>
|
<u-icon name="arrow-right" color="#bababa"></u-icon>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="select-cell" @click="onSelect(3)">
|
<view class="select-cell" v-if="applyInfo.returnMoney" @click="onSelect(3)">
|
||||||
<view class="select-image">
|
<view class="select-image">
|
||||||
<image style="height: 51rpx; width: 51rpx" src="/static/order/t3.png"></image>
|
<image style="height: 51rpx; width: 51rpx" src="/static/order/t3.png"></image>
|
||||||
</view>
|
</view>
|
||||||
@@ -46,7 +46,7 @@
|
|||||||
<view class="select-title">退款</view>
|
<view class="select-title">退款</view>
|
||||||
<view class="select-sub-title">
|
<view class="select-sub-title">
|
||||||
退款商品返还金额
|
退款商品返还金额
|
||||||
<uni-icons color="#BABABA" type="arrowright"></uni-icons>
|
<u-icon name="arrow-right" color="#bababa"></u-icon>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -55,15 +55,13 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import UniIcons from "@/components/uni-icons/uni-icons.vue";
|
import { getAfterSaleInfo } from "@/api/after-sale";
|
||||||
export default {
|
export default {
|
||||||
components: {
|
|
||||||
UniIcons,
|
|
||||||
},
|
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
sn: "",
|
sn: "",
|
||||||
sku: {}, //sku
|
sku: {}, //sku
|
||||||
|
applyInfo:""
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
onLoad(options) {
|
onLoad(options) {
|
||||||
@@ -71,8 +69,20 @@ export default {
|
|||||||
let dData = decodeURIComponent(options.sku);
|
let dData = decodeURIComponent(options.sku);
|
||||||
let newData = JSON.parse(dData);
|
let newData = JSON.parse(dData);
|
||||||
this.sku = newData;
|
this.sku = newData;
|
||||||
|
|
||||||
|
// 查看当前商品是否支持退款退货
|
||||||
|
this.init()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
// 初始化数据
|
||||||
|
init() {
|
||||||
|
getAfterSaleInfo(this.sn).then((response) => {
|
||||||
|
if (response.data.success) {
|
||||||
|
this.applyInfo = response.data.result;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 选择退货流程
|
* 选择退货流程
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -28,7 +28,7 @@
|
|||||||
logs[0].message
|
logs[0].message
|
||||||
}}</view>
|
}}</view>
|
||||||
</view>
|
</view>
|
||||||
<uni-icons type="arrowright" style="margin-right: 5px"></uni-icons>
|
<u-icon name="arrow-right" style="margin-right: 5px" size="30" color="#999"></u-icon>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="goods-info">
|
<view class="goods-info">
|
||||||
@@ -75,7 +75,7 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="detail-item">
|
<view class="detail-item">
|
||||||
<view class="title">申请原因:</view>
|
<view class="title">申请原因:</view>
|
||||||
<view class="value">{{ serviceDetail.reason }}</view>
|
<view class="value">{{ reason }}</view>
|
||||||
</view>
|
</view>
|
||||||
<!-- <view class="detail-item" v-if="serviceDetail.apply_vouchers">
|
<!-- <view class="detail-item" v-if="serviceDetail.apply_vouchers">
|
||||||
<view class="title">申请凭证:</view>
|
<view class="title">申请凭证:</view>
|
||||||
@@ -90,11 +90,13 @@
|
|||||||
serviceDetail.afterSaleImage &&
|
serviceDetail.afterSaleImage &&
|
||||||
serviceDetail.afterSaleImage.split(',').length != 0
|
serviceDetail.afterSaleImage.split(',').length != 0
|
||||||
">
|
">
|
||||||
<image :src="img" @click="preview(serviceDetail.afterSaleImage.split(','), index)" v-for="(img, index) in serviceDetail.afterSaleImage.split(',')" :key="index"
|
<image :src="img" @click="preview(serviceDetail.afterSaleImage.split(','), index)"
|
||||||
|
v-for="(img, index) in serviceDetail.afterSaleImage.split(',')" :key="index"
|
||||||
style="width: 50px; height: 50px; margin: 0px 5px"></image>
|
style="width: 50px; height: 50px; margin: 0px 5px"></image>
|
||||||
</view>
|
</view>
|
||||||
<!-- 如果服务类型为退款则不显示 -->
|
<!-- 如果服务类型为退款则不显示 -->
|
||||||
<view class="detail-item" v-if="serviceDetail.serviceType != 'RETURN_MONEY' && serviceDetail.serviceStatus != 'APPLY'">
|
<view class="detail-item"
|
||||||
|
v-if="serviceDetail.serviceType != 'RETURN_MONEY' && serviceDetail.serviceStatus != 'APPLY'">
|
||||||
<view class="title">收货地址:</view>
|
<view class="title">收货地址:</view>
|
||||||
<view class="value">
|
<view class="value">
|
||||||
<span v-if="storeAfterSaleAddress.salesConsigneeAddressPath">{{
|
<span v-if="storeAfterSaleAddress.salesConsigneeAddressPath">{{
|
||||||
@@ -103,12 +105,14 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<!-- 如果服务类型为退款则不显示 -->
|
<!-- 如果服务类型为退款则不显示 -->
|
||||||
<view class="detail-item" v-if="serviceDetail.serviceType != 'RETURN_MONEY' && serviceDetail.serviceStatus != 'APPLY'">
|
<view class="detail-item"
|
||||||
|
v-if="serviceDetail.serviceType != 'RETURN_MONEY' && serviceDetail.serviceStatus != 'APPLY'">
|
||||||
<view class="title">联系人:</view>
|
<view class="title">联系人:</view>
|
||||||
<view class="value">{{ storeAfterSaleAddress.salesConsigneeName }}</view>
|
<view class="value">{{ storeAfterSaleAddress.salesConsigneeName }}</view>
|
||||||
</view>
|
</view>
|
||||||
<!-- 如果服务类型为退款则不显示 -->
|
<!-- 如果服务类型为退款则不显示 -->
|
||||||
<view class="detail-item" v-if="serviceDetail.serviceType != 'RETURN_MONEY' && serviceDetail.serviceStatus != 'APPLY'">
|
<view class="detail-item"
|
||||||
|
v-if="serviceDetail.serviceType != 'RETURN_MONEY' && serviceDetail.serviceStatus != 'APPLY'">
|
||||||
<view class="title">联系方式:</view>
|
<view class="title">联系方式:</view>
|
||||||
<view class="value">{{
|
<view class="value">{{
|
||||||
storeAfterSaleAddress.salesConsigneeMobile || "" | secrecyMobile
|
storeAfterSaleAddress.salesConsigneeMobile || "" | secrecyMobile
|
||||||
@@ -195,15 +199,12 @@ import {
|
|||||||
getServiceDetail,
|
getServiceDetail,
|
||||||
getstoreAfterSaleAddress,
|
getstoreAfterSaleAddress,
|
||||||
getAfterSaleLog,
|
getAfterSaleLog,
|
||||||
|
getAfterSaleReason,
|
||||||
} from "@/api/after-sale.js";
|
} from "@/api/after-sale.js";
|
||||||
import UniIcons from "@/components/uni-icons/uni-icons.vue";
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
|
||||||
UniIcons,
|
|
||||||
},
|
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
reason: "", //申请原因
|
||||||
serviceTypeList: {
|
serviceTypeList: {
|
||||||
// 售后类型
|
// 售后类型
|
||||||
CANCEL: "取消",
|
CANCEL: "取消",
|
||||||
@@ -330,6 +331,18 @@ export default {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取申请原因
|
||||||
|
*/
|
||||||
|
getReasonList(serviceType) {
|
||||||
|
getAfterSaleReason(serviceType).then((res) => {
|
||||||
|
if (res.data.success) {
|
||||||
|
// 1357583466371219456
|
||||||
|
this.reason = this.serviceDetail.reason;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 初始化详情
|
* 初始化详情
|
||||||
*/
|
*/
|
||||||
@@ -340,7 +353,10 @@ export default {
|
|||||||
getServiceDetail(this.sn).then((res) => {
|
getServiceDetail(this.sn).then((res) => {
|
||||||
uni.hideLoading();
|
uni.hideLoading();
|
||||||
this.serviceDetail = res.data.result;
|
this.serviceDetail = res.data.result;
|
||||||
if (this.serviceDetail.serviceType == "RETURN_GOODS") {
|
if (
|
||||||
|
this.serviceDetail.serviceType == "RETURN_GOODS" ||
|
||||||
|
this.serviceDetail.serviceType === "RETURN_MONEY"
|
||||||
|
) {
|
||||||
this.refundShow = true;
|
this.refundShow = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -348,11 +364,15 @@ export default {
|
|||||||
(this.serviceDetail.serviceType === "RETURN_GOODS" ||
|
(this.serviceDetail.serviceType === "RETURN_GOODS" ||
|
||||||
this.serviceDetail.serviceType === "ORDER_CANCEL") &&
|
this.serviceDetail.serviceType === "ORDER_CANCEL") &&
|
||||||
this.serviceDetail.refundWay === "OFFLINE";
|
this.serviceDetail.refundWay === "OFFLINE";
|
||||||
|
|
||||||
this.bankShow =
|
this.bankShow =
|
||||||
(this.serviceDetail.serviceType === "RETURN_GOODS" ||
|
this.serviceDetail.accountType === "BANK_TRANSFER" &&
|
||||||
this.serviceDetail.serviceType === "ORDER_CANCEL") &&
|
|
||||||
this.serviceDetail.refundWay === "OFFLINE" &&
|
this.serviceDetail.refundWay === "OFFLINE" &&
|
||||||
this.serviceDetail.accountType === "BANK_TRANSFER";
|
((this.serviceDetail.serviceType === "RETURN_GOODS") |
|
||||||
|
(this.serviceDetail.serviceType === "ORDER_CANCEL") ||
|
||||||
|
this.serviceDetail.serviceType === "RETURN_MONEY");
|
||||||
|
|
||||||
|
this.getReasonList(this.serviceDetail.serviceType);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@@ -103,7 +103,9 @@ export default {
|
|||||||
.row {
|
.row {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
|
padding: 26rpx 32rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.speak-msg {
|
.speak-msg {
|
||||||
padding: 26rpx 32rpx;
|
padding: 26rpx 32rpx;
|
||||||
> span {
|
> span {
|
||||||
@@ -120,6 +122,6 @@ export default {
|
|||||||
padding: 16rpx;
|
padding: 16rpx;
|
||||||
}
|
}
|
||||||
.tips {
|
.tips {
|
||||||
margin: 40rpx 0;
|
margin: 40rpx 32rpx;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -25,7 +25,16 @@
|
|||||||
{{ comment.goodsName }}
|
{{ comment.goodsName }}
|
||||||
</view>
|
</view>
|
||||||
<view class="goods-subtitle"></view>
|
<view class="goods-subtitle"></view>
|
||||||
|
<view class="commentStyle" v-if="comment.reply">
|
||||||
|
商家回复:
|
||||||
|
<span class="addCommentSpan">{{ comment.reply }}</span>
|
||||||
|
<view class="img">
|
||||||
|
<!-- 循环出商家回复评价的图片 -->
|
||||||
|
<u-image width="140rpx" height="140rpx" v-if="comment.replyImage" v-for="(replyImg, replyIndex) in splitImg(comment.replyImage)" :src="replyImg" :key="replyIndex"
|
||||||
|
@click="preview(splitImg( comment.replyImage), index)">
|
||||||
|
</u-image>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -49,6 +58,18 @@ export default {
|
|||||||
this.comment = JSON.parse(decodeURIComponent(options.comment));
|
this.comment = JSON.parse(decodeURIComponent(options.comment));
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
/**
|
||||||
|
* 切割图像
|
||||||
|
*/
|
||||||
|
splitImg(val) {
|
||||||
|
if (val && val.split(",")) {
|
||||||
|
return val.split(",");
|
||||||
|
} else if (val) {
|
||||||
|
return val;
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
},
|
||||||
/**
|
/**
|
||||||
* 点击图片放大或保存
|
* 点击图片放大或保存
|
||||||
*/
|
*/
|
||||||
@@ -68,6 +89,38 @@ export default {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
.commentStyle {
|
||||||
|
margin-top: 16rpx;
|
||||||
|
padding: 14rpx 26rpx;
|
||||||
|
background: #f5f5f5;
|
||||||
|
border-radius: 6px;
|
||||||
|
font-size: 22rpx;
|
||||||
|
font-weight: 700;
|
||||||
|
text-align: left;
|
||||||
|
line-height: 40rpx;
|
||||||
|
}
|
||||||
|
.img {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
/* height: 140rpx; */
|
||||||
|
overflow: hidden;
|
||||||
|
margin: 10rpx 0;
|
||||||
|
|
||||||
|
image {
|
||||||
|
width: 166rpx;
|
||||||
|
height: 166rpx;
|
||||||
|
margin: 0 15rpx 15rpx 0;
|
||||||
|
|
||||||
|
&:nth-of-type(3n + 0) {
|
||||||
|
margin: 0 0 15rpx 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.addCommentSpan {
|
||||||
|
color: $u-tips-color !important;
|
||||||
|
padding-left: 20rpx;
|
||||||
|
}
|
||||||
.memName {
|
.memName {
|
||||||
font-size: 28rpx;
|
font-size: 28rpx;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,8 @@
|
|||||||
<view>
|
<view>
|
||||||
<view class="wrap">
|
<view class="wrap">
|
||||||
<view class="u-tabs-box">
|
<view class="u-tabs-box">
|
||||||
<u-tabs :list="list" :is-scroll="false" inactive-color="#333" :current="current" class="utabs" :active-color="$lightColor" @change="changeTab"></u-tabs>
|
<u-tabs :list="list" :is-scroll="false" inactive-color="#333" :current="current" class="utabs"
|
||||||
|
:active-color="$lightColor" @change="changeTab"></u-tabs>
|
||||||
</view>
|
</view>
|
||||||
<swiper class="swiper-box" :current="current" @change="changeSwiper" duration="500">
|
<swiper class="swiper-box" :current="current" @change="changeSwiper" duration="500">
|
||||||
<swiper-item v-for="(item, listIndex) in list" :key="listIndex">
|
<swiper-item v-for="(item, listIndex) in list" :key="listIndex">
|
||||||
@@ -18,14 +19,15 @@
|
|||||||
<view v-for="(sku, _index) in order.orderItems" :key="_index">
|
<view v-for="(sku, _index) in order.orderItems" :key="_index">
|
||||||
<view class="goods-item-view">
|
<view class="goods-item-view">
|
||||||
<view>
|
<view>
|
||||||
<u-image border-radius="6rpx" width="132rpx" height="132rpx" class="goods_img" :src="sku.image" alt />
|
<u-image border-radius="6rpx" width="132rpx" height="132rpx" class="goods_img" :src="sku.image"
|
||||||
|
alt />
|
||||||
</view>
|
</view>
|
||||||
<view class="goods-info">
|
<view class="goods-info">
|
||||||
<view class="goods-title u-line-2">{{ sku.name }}</view>
|
<view class="goods-title u-line-2">{{ sku.name }}</view>
|
||||||
<view class="text title">{{ gradeList[order.grade] || '' }}</view>
|
<view class="text title">{{ gradeList[order.grade] || '' }}</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="btn-view u-row-between" v-if="current != 0">
|
<view class="btn-view u-row-between" v-if="current == 2">
|
||||||
<view class="description">
|
<view class="description">
|
||||||
<view class="text title">
|
<view class="text title">
|
||||||
<u-read-more ref="uReadMore" :color="$lightColor" text-indent="0">
|
<u-read-more ref="uReadMore" :color="$lightColor" text-indent="0">
|
||||||
@@ -34,7 +36,8 @@
|
|||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="goods-imgs-view" v-if="order.image">
|
<view class="goods-imgs-view" v-if="order.image">
|
||||||
<view class="img-view" v-if="order.image" v-for="(img, imgIndex) in order.image.split(',')" :key="imgIndex">
|
<view class="img-view" v-if="order.image" v-for="(img, imgIndex) in order.image.split(',')"
|
||||||
|
:key="imgIndex">
|
||||||
<u-image v-if="order.image" @click.native="
|
<u-image v-if="order.image" @click.native="
|
||||||
preview(order.image.split(','), imgIndex)
|
preview(order.image.split(','), imgIndex)
|
||||||
" width="160rpx" height="160rpx" :src="img"></u-image>
|
" width="160rpx" height="160rpx" :src="img"></u-image>
|
||||||
@@ -42,17 +45,21 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="again-btn" @click="onDetail(order)" v-if="current == 1">
|
<view class="again-btn" @click="onDetail(order)" v-if="current == 2">
|
||||||
<u-tag text="评价详情" shape="circle" mode="plain" type="error" />
|
<u-tag text="评价详情" shape="circle" mode="plain" type="error" />
|
||||||
</view>
|
</view>
|
||||||
<view v-if="current == 0 && sku.commentStatus == 'UNFINISHED'">
|
<view v-if="current == 1 && sku.commentStatus == 'UNFINISHED'">
|
||||||
<view class="evaluate">
|
<view class="evaluate">
|
||||||
<view @click="talkCommont(order)">
|
<view @click="talkCommont(sku)">
|
||||||
<u-tag text="发表评价" shape="circle" mode="plain" type="error" />
|
<u-tag text="发表评价" shape="circle" mode="plain" type="error" />
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
<view class="tips" v-if="sku.commentStatus">
|
||||||
|
{{groupCommentStatusWay[sku.commentStatus]}}
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
<uni-load-more :status="params.loadStatus"></uni-load-more>
|
<uni-load-more :status="params.loadStatus"></uni-load-more>
|
||||||
</scroll-view>
|
</scroll-view>
|
||||||
@@ -69,7 +76,12 @@ import { getComments } from "@/api/members.js";
|
|||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
list: [ //顶部tab
|
list: [
|
||||||
|
//顶部tab
|
||||||
|
|
||||||
|
{
|
||||||
|
name: "全部订单",
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name: "待评价",
|
name: "待评价",
|
||||||
},
|
},
|
||||||
@@ -77,12 +89,19 @@ export default {
|
|||||||
name: "已评价",
|
name: "已评价",
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
gradeList: { //评论表
|
gradeList: {
|
||||||
|
//评论表
|
||||||
GOOD: "好评",
|
GOOD: "好评",
|
||||||
MODERATE: "中评",
|
MODERATE: "中评",
|
||||||
WORSE: "差评",
|
WORSE: "差评",
|
||||||
haveImage: "有图",
|
haveImage: "有图",
|
||||||
},
|
},
|
||||||
|
groupCommentStatusWay: {
|
||||||
|
NEW: "新订单,不能进行评论",
|
||||||
|
UNFINISHED: "未完成评论",
|
||||||
|
WAIT_CHASE: "待追评的评论信息",
|
||||||
|
FINISHED: "已经完成评论",
|
||||||
|
},
|
||||||
current: 0, //当前tabIndex
|
current: 0, //当前tabIndex
|
||||||
orderList: [], //商品集合
|
orderList: [], //商品集合
|
||||||
params: {
|
params: {
|
||||||
@@ -108,12 +127,18 @@ export default {
|
|||||||
this.params.loadStatus = "more";
|
this.params.loadStatus = "more";
|
||||||
this.orderList = [];
|
this.orderList = [];
|
||||||
//重新读取数据
|
//重新读取数据
|
||||||
|
|
||||||
if (val == 0) {
|
if (val == 0) {
|
||||||
|
delete this.params.commentStatus
|
||||||
this.loadData();
|
this.loadData();
|
||||||
}
|
} else if (val == 1) {
|
||||||
if (val == 1) {
|
this.params.commentStatus = "UNFINISHED";
|
||||||
this.orderList = [];
|
this.orderList = [];
|
||||||
this.loadComments();
|
this.loadData();
|
||||||
|
} else {
|
||||||
|
this.params.commentStatus = "FINISHED";
|
||||||
|
this.orderList = [];
|
||||||
|
return this.loadComments();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -123,7 +148,7 @@ export default {
|
|||||||
* 判断当前店铺是否有可评价的商品
|
* 判断当前店铺是否有可评价的商品
|
||||||
*/
|
*/
|
||||||
commentStatus(val) {
|
commentStatus(val) {
|
||||||
if (this.current == 1) {
|
if (this.current == 2) {
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
let show;
|
let show;
|
||||||
@@ -192,10 +217,11 @@ export default {
|
|||||||
/**
|
/**
|
||||||
* 发表评价
|
* 发表评价
|
||||||
*/
|
*/
|
||||||
talkCommont(order) {
|
talkCommont(sku) {
|
||||||
|
console.log(sku);
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: `./releaseEvaluate?sn=${order.sn}&order=${encodeURIComponent(
|
url: `./releaseEvaluate?sn=${sku.sn}&sku=${encodeURIComponent(
|
||||||
JSON.stringify(order)
|
JSON.stringify(sku)
|
||||||
)}`,
|
)}`,
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@@ -235,11 +261,7 @@ export default {
|
|||||||
if (this.params.loadStatus == "noMore") return;
|
if (this.params.loadStatus == "noMore") return;
|
||||||
if (index == 0) {
|
if (index == 0) {
|
||||||
this.loadData();
|
this.loadData();
|
||||||
}
|
} else {
|
||||||
if (index == 1) {
|
|
||||||
this.params.audit_status = "PASS_AUDIT";
|
|
||||||
this.params.comments_type = "INITIAL";
|
|
||||||
this.params.comment_status = "WAIT_CHASE";
|
|
||||||
this.loadComments();
|
this.loadComments();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -261,6 +283,11 @@ export default {
|
|||||||
page {
|
page {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
}
|
}
|
||||||
|
.tips {
|
||||||
|
text-align: right;
|
||||||
|
font-size: 24rpx;
|
||||||
|
color: #999;
|
||||||
|
}
|
||||||
.wrap {
|
.wrap {
|
||||||
background: #f6f6f6;
|
background: #f6f6f6;
|
||||||
height: calc(100vh - var(--window-top));
|
height: calc(100vh - var(--window-top));
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<view>
|
<view>
|
||||||
<!-- 遍历出评价商品 -->
|
<!-- 遍历出评价商品 -->
|
||||||
<view v-for="(sku, index) in order.orderItems" :key="index">
|
<view>
|
||||||
<view class="after-sales-goods-detail-view">
|
<view class="after-sales-goods-detail-view">
|
||||||
<view>
|
<view>
|
||||||
<view class="goods-item-view">
|
<view class="goods-item-view">
|
||||||
@@ -23,23 +23,27 @@
|
|||||||
<view class="sub-title">满意请打好评哦</view>
|
<view class="sub-title">满意请打好评哦</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="rate-view">
|
<view class="rate-view">
|
||||||
<view class="rate-btn" @click="onGrade('GOOD', index)">
|
<view class="rate-btn" @click="onGrade('GOOD')">
|
||||||
<view style="font-size: 42rpx" :style="{ color: form.grade === 'GOOD' ? 'red' : '#CCCCCC' }" class="alifont icon-haoping1"></view>
|
<u-icon name="heart-fill" style="font-size: 42rpx"
|
||||||
|
:style="{ color: form.grade === 'GOOD' ? 'red' : '#CCCCCC' }"></u-icon>
|
||||||
<text>好评</text>
|
<text>好评</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="rate-btn" @click="onGrade('MODERATE', index)">
|
<view class="rate-btn" @click="onGrade('MODERATE')">
|
||||||
<view style="font-size: 42rpx" :style="{ color: form.grade === 'MODERATE' ? 'red' : '#CCCCCC' }" class="alifont icon-zhongping1"></view>
|
<u-icon name="heart-fill" style="font-size: 42rpx"
|
||||||
|
:style="{ color: form.grade === 'MODERATE' ? 'red' : '#CCCCCC' }"></u-icon>
|
||||||
<text>中评</text>
|
<text>中评</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="rate-btn" @click="onGrade('WORSE', index)">
|
<view class="rate-btn" @click="onGrade('WORSE')">
|
||||||
<view style="font-size: 42rpx" :style="{ color: form.grade === 'WORSE' ? 'red' : '#CCCCCC' }" class="alifont icon-chaping"></view>
|
<u-icon name="heart-fill" style="font-size: 42rpx"
|
||||||
|
:style="{ color: form.grade === 'WORSE' ? 'red' : '#CCCCCC' }"></u-icon>
|
||||||
<text>差评</text>
|
<text>差评</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="info-evaluate-view">
|
<view class="info-evaluate-view">
|
||||||
<view class="input-view">
|
<view class="input-view">
|
||||||
<u-input v-model="form.content" height="200" placeholder-style="font-size:12px;color:#CCCCCC" :type="type" :border="border" :maxlength="maxlength" :placeholder="placeholder" />
|
<u-input v-model="form.content" height="200" placeholder-style="font-size:12px;color:#CCCCCC" :type="type"
|
||||||
|
:border="border" :maxlength="maxlength" :placeholder="placeholder" />
|
||||||
</view>
|
</view>
|
||||||
<view class="input-num">
|
<view class="input-num">
|
||||||
<text>{{ form.content.length }}/{{ maxlength }}</text>
|
<text>{{ form.content.length }}/{{ maxlength }}</text>
|
||||||
@@ -47,7 +51,8 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="info-evaluate-view">
|
<view class="info-evaluate-view">
|
||||||
<view class="images-view">
|
<view class="images-view">
|
||||||
<u-upload :header=" { accessToken: storage.getAccessToken() }" :action="action" width="150" @on-uploaded="onUploaded" :max-count="5" :show-progress="false"></u-upload>
|
<u-upload :header=" { accessToken: storage.getAccessToken() }" :action="action" width="150"
|
||||||
|
@on-uploaded="onUploaded" :max-count="5" :show-progress="false"></u-upload>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -57,7 +62,8 @@
|
|||||||
<view class="seller-rate-view">
|
<view class="seller-rate-view">
|
||||||
<view class="rate-title">描述相符</view>
|
<view class="rate-title">描述相符</view>
|
||||||
<view>
|
<view>
|
||||||
<u-rate count="count" gutter="20" active-color="#FFC71C" v-model="form.descriptionScore" :size="40"></u-rate>
|
<u-rate count="count" gutter="20" active-color="#FFC71C" v-model="form.descriptionScore" :size="40">
|
||||||
|
</u-rate>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="seller-rate-view">
|
<view class="seller-rate-view">
|
||||||
@@ -94,7 +100,7 @@ export default {
|
|||||||
maxlength: 500, //评价最大字数为500字
|
maxlength: 500, //评价最大字数为500字
|
||||||
placeholder:
|
placeholder:
|
||||||
"宝贝满足您的期待吗?说说它的优点和美中不足的地方吧。您的评价会帮助更多的人",
|
"宝贝满足您的期待吗?说说它的优点和美中不足的地方吧。您的评价会帮助更多的人",
|
||||||
order: {}, //订单信息
|
sku: {}, //订单信息
|
||||||
form: {
|
form: {
|
||||||
content: "", //评价详情
|
content: "", //评价详情
|
||||||
goodsId: "", //商品id
|
goodsId: "", //商品id
|
||||||
@@ -111,10 +117,9 @@ export default {
|
|||||||
onLoad(options) {
|
onLoad(options) {
|
||||||
// 获取上一级传过来的数据进行解析
|
// 获取上一级传过来的数据进行解析
|
||||||
this.form.orderItemSn = options.sn;
|
this.form.orderItemSn = options.sn;
|
||||||
this.order = JSON.parse(decodeURIComponent(options.order));
|
this.sku = JSON.parse(decodeURIComponent(options.sku));
|
||||||
this.form.goodsId = this.order.orderItems[0].goodsId;
|
this.form.goodsId = this.sku.goodsId;
|
||||||
this.form.orderItemSn = this.order.orderItems[0].sn;
|
this.form.skuId = this.sku.skuId;
|
||||||
this.form.skuId = this.order.orderItems[0].skuId;
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
/**
|
/**
|
||||||
@@ -141,7 +146,7 @@ export default {
|
|||||||
success: () => {
|
success: () => {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
uni.navigateBack();
|
uni.navigateBack();
|
||||||
}, 2000);
|
}, 500);
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,48 +1,38 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="wrapper">
|
<div class="wrapper">
|
||||||
<!-- 选择地址 -->
|
<!-- 选择地址 -->
|
||||||
<div class="box1 box">
|
<div class="address-box" @click="clickToAddress()">
|
||||||
<u-row style="margin-top: 32rpx">
|
<div class="user-box flex">
|
||||||
<u-col style="padding: 0 !important" :offset="0" :span="11" @click.native="clickToAddress()">
|
<div class="flex-8">
|
||||||
<div v-if="!address.id">请选择地址</div>
|
<div v-if="!address.id">请选择地址</div>
|
||||||
<div v-else>
|
<div v-else>
|
||||||
<div class="userClass">
|
<div class="user-address">
|
||||||
{{ address.name }}
|
<!-- 省市区 -->
|
||||||
<span>
|
<div class="flex flex-a-c">
|
||||||
{{ address.mobile | secrecyMobile }}
|
<span class="default" v-if="address.isDefault">默认</span>
|
||||||
<u-tag v-if="address.isDefault" text="默认" style="margin-left: 24rpx" mode="plain" type="error" size="mini" />
|
<div class="address-list" v-if="address.consigneeAddressPath.length != 0">
|
||||||
</span>
|
<span class="address-item" v-for="(item,index) in address.consigneeAddressPath" :key="index">
|
||||||
</div>
|
{{item}}
|
||||||
<div class="userAdress">
|
</span>
|
||||||
<span v-if="address.consigneeAddressPath[0]">{{
|
</div>
|
||||||
address.consigneeAddressPath[0]
|
</div>
|
||||||
}}</span>
|
<!-- 详细地址 -->
|
||||||
|
<div class="user-address-detail wes-2">
|
||||||
<span v-if="address.consigneeAddressPath[1]">{{
|
|
||||||
address.consigneeAddressPath[1]
|
|
||||||
}}</span>
|
|
||||||
<span v-if="address.consigneeAddressPath[2]">{{
|
|
||||||
address.consigneeAddressPath[2]
|
|
||||||
}}</span>
|
|
||||||
|
|
||||||
<span v-if="address.consigneeAddressPath[3]">{{
|
|
||||||
address.consigneeAddressPath[3]
|
|
||||||
}}</span>
|
|
||||||
<span>
|
|
||||||
{{ address.detail }}
|
{{ address.detail }}
|
||||||
</span>
|
</div>
|
||||||
|
<!-- 姓名 手机号 -->
|
||||||
|
<div>
|
||||||
|
<span>{{ address.name }}</span>
|
||||||
|
<span class="mobile">{{ address.mobile | secrecyMobile }}</span>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</u-col>
|
</div>
|
||||||
<u-col :span="1" @click.native="
|
<u-icon name="arrow-right" style="color: #bababa"></u-icon>
|
||||||
navigateTo('/pages/mine/address/address?way=' + routerVal.way)
|
</div>
|
||||||
" style="text-align: right">
|
<!-- 背景 -->
|
||||||
<u-icon name="arrow-right" style="color: #bababa"></u-icon>
|
<div class="bar"></div>
|
||||||
</u-col>
|
|
||||||
</u-row>
|
|
||||||
</div>
|
</div>
|
||||||
<!-- 背景 -->
|
|
||||||
<div class="bar"></div>
|
|
||||||
|
|
||||||
<!-- 开团信息 -->
|
<!-- 开团信息 -->
|
||||||
<view class="group-box" v-if="isAssemble">
|
<view class="group-box" v-if="isAssemble">
|
||||||
@@ -52,17 +42,19 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="group">
|
<view class="group">
|
||||||
<view>
|
<view>
|
||||||
<u-image borderRadius="50%" shape="square" class="head-img" width="81rpx" height="81rpx" :src="masterWay.face || '/static/missing-face.png'"></u-image>
|
<u-image borderRadius="50%" shape="square" class="head-img" width="81rpx" height="81rpx"
|
||||||
|
:src="masterWay.face || '/static/missing-face.png'"></u-image>
|
||||||
<view class="btn-one">团长</view>
|
<view class="btn-one">团长</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="line"> </view>
|
<view class="line"> </view>
|
||||||
<view>
|
<view>
|
||||||
<!-- 如果有最后一名,显示最后一名,没有最后一名,显示等待参团 -->
|
<!-- 如果有最后一名,显示最后一名,没有最后一名,显示等待参团 -->
|
||||||
<u-image class="head-img" v-if="endWay.face" :src="endWay.face" borderRadius="50%" shape="square" width="81rpx" height="81rpx">
|
<u-image class="head-img" v-if="endWay.face" :src="endWay.face" borderRadius="50%" shape="square"
|
||||||
|
width="81rpx" height="81rpx">
|
||||||
<view slot="loading"></view>
|
<view slot="loading"></view>
|
||||||
</u-image>
|
</u-image>
|
||||||
|
<u-image class="head-img" borderRadius="50%" shape="square" v-else width="81rpx" height="81rpx"
|
||||||
<u-image class="head-img" borderRadius="50%" shape="square" v-else width="81rpx" height="81rpx" :src="endWay.face || '/static/missing-face.png'"></u-image>
|
:src="endWay.face || '/static/missing-face.png'"></u-image>
|
||||||
|
|
||||||
<view class="wait">{{ endWay.nickname || "等待参团" }}</view>
|
<view class="wait">{{ endWay.nickname || "等待参团" }}</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -71,38 +63,30 @@
|
|||||||
|
|
||||||
<!-- 店铺商品信息 -->
|
<!-- 店铺商品信息 -->
|
||||||
<div class="box box2" v-for="(item, index) in orderMessage.cartList" :key="index">
|
<div class="box box2" v-for="(item, index) in orderMessage.cartList" :key="index">
|
||||||
<u-row class="tab1" @click="navigateToStore(item)">
|
<div @click="navigateToStore(item)">
|
||||||
<u-col :offset="0">
|
<div class="store-name">
|
||||||
<span class="ybname">{{ item.storeName }}</span>
|
<span>{{ item.storeName }}</span>
|
||||||
</u-col>
|
</div>
|
||||||
</u-row>
|
</div>
|
||||||
<div class="promotionNotice">{{ item.promotionNotice }}</div>
|
<div class="promotionNotice">{{ item.promotionNotice || '' }}</div>
|
||||||
<u-row class="goodsBorder" v-for="(val, i) in item.skuList" :key="i">
|
<div class="flex goods-item" v-for="(val, i) in item.skuList" :key="i">
|
||||||
<u-col class="tabL" :offset="0" @click="navigateTo('/pages/product/goods?id=' + val.goodsSku.id+'&goodsId='+val.goodsSku.goodsId)" :span="3">
|
<div class="goods-image"
|
||||||
<u-image borderRadius="10rpx" :src="val.goodsSku.thumbnail" alt />
|
@click="navigateTo('/pages/product/goods?id=' + val.goodsSku.id+'&goodsId='+val.goodsSku.goodsId)" :span="3">
|
||||||
</u-col>
|
<u-image borderRadius="10rpx" width="200rpx" height="200rpx" :src="val.goodsSku.thumbnail" alt />
|
||||||
<u-col :span="9" @click="navigateTo('/pages/product/goods?id=' + val.goodsSku.id+'&goodsId='+val.goodsSku.goodsId)" class="tabC">
|
</div>
|
||||||
<div style="overflow: hidden">
|
<div @click="navigateTo('/pages/product/goods?id=' + val.goodsSku.id+'&goodsId='+val.goodsSku.goodsId)"
|
||||||
<p class="sp_name">{{ val.goodsSku.goodsName }}</p>
|
class="goods-detail">
|
||||||
<p class="sp_promotion" v-if="val.promotion_tags">
|
<div class="flex">
|
||||||
<view class="sp_tag sp_tag_plain" v-for="(promotion_item, promotion_index) in val.promotion_tags" :key="promotion_index">{{ promotion_item }}</view>
|
<p class="goods-name">{{ val.goodsSku.goodsName }}</p>
|
||||||
</p>
|
|
||||||
<span class="nums">x{{ val.num }}</span>
|
<span class="nums">x{{ val.num }}</span>
|
||||||
</div>
|
</div>
|
||||||
|
<p class="goods-prices">
|
||||||
<p class="sp_number">¥{{ val.goodsSku.price | unitPrice }}</p>
|
<span>¥</span>
|
||||||
</u-col>
|
<span class="goods-price">{{formatPrice(val.goodsSku.price)[0]}}</span>
|
||||||
</u-row>
|
<span>.{{formatPrice(val.goodsSku.price)[1] }}</span>
|
||||||
|
</p>
|
||||||
<u-row>
|
</div>
|
||||||
<u-col :offset="0" :span="4" class="tl" style="text-align: left">备注信息</u-col>
|
</div>
|
||||||
<u-col :span="8" textAlign="right">
|
|
||||||
<u-input style="text-align:right;" class="uinput" v-model="remarkVal[index].remark" />
|
|
||||||
</u-col>
|
|
||||||
</u-row>
|
|
||||||
</div>
|
|
||||||
<!-- 订单信息 -->
|
|
||||||
<div class="box box3">
|
|
||||||
<u-row>
|
<u-row>
|
||||||
<u-col :offset="0" :span="4">发票信息</u-col>
|
<u-col :offset="0" :span="4">发票信息</u-col>
|
||||||
<u-col :span="8" class="tipsColor" textAlign="right" @click.native="invoice()">
|
<u-col :span="8" class="tipsColor" textAlign="right" @click.native="invoice()">
|
||||||
@@ -110,34 +94,24 @@
|
|||||||
<span v-else>不开发票</span>
|
<span v-else>不开发票</span>
|
||||||
</u-col>
|
</u-col>
|
||||||
</u-row>
|
</u-row>
|
||||||
|
<u-row>
|
||||||
|
<u-col v-if="orderMessage.cartTypeEnum != 'VIRTUAL'" :offset="0" :span="9" @click="shippingFlag = true">配送
|
||||||
|
</u-col>
|
||||||
|
<u-col v-if="orderMessage.cartTypeEnum != 'VIRTUAL'" :span="3" textAlign="right" @click="shippingFlag = true">
|
||||||
|
{{shippingMethod.find(e=>{ return e.value == shippingText; }).label }}
|
||||||
|
</u-col>
|
||||||
|
</u-row>
|
||||||
|
<u-row>
|
||||||
|
<u-col :offset="0" :span="4" class="tl" style="text-align: left">备注信息</u-col>
|
||||||
|
<u-col :span="8" textAlign="right">
|
||||||
|
<u-input style="text-align:right;" class="uinput" v-model="remarkVal[index].remark" />
|
||||||
|
</u-col>
|
||||||
|
</u-row>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- 发票信息 -->
|
<!-- 发票信息 -->
|
||||||
<invoices :res="receiptList" @callbackInvoice="callbackInvoice" v-if="invoiceFlag" />
|
<invoices :res="receiptList" @callbackInvoice="callbackInvoice" v-if="invoiceFlag" />
|
||||||
<u-select v-model="shippingFlag" :list="shippingMethod" @confirm="checkedshipMethod"></u-select>
|
<u-select v-model="shippingFlag" :list="shippingMethod"></u-select>
|
||||||
|
|
||||||
<!-- 优惠券 -->
|
|
||||||
<div class="box box4">
|
|
||||||
<u-row>
|
|
||||||
<u-col :offset="0" :span="9" @click="shippingFlag = true">配送方式</u-col>
|
|
||||||
<u-col :span="3" textAlign="right" @click="shippingFlag = true">
|
|
||||||
{{ shippingMethod.find(e=>{ return e.value == shippingText; }).label }}
|
|
||||||
</u-col>
|
|
||||||
</u-row>
|
|
||||||
<u-row>
|
|
||||||
<u-col :offset="0" :span="9" @click="GET_Discount()">优惠券</u-col>
|
|
||||||
|
|
||||||
<u-col :span="3" v-if="orderMessage.priceDetailDTO && orderMessage.priceDetailDTO.couponPrice" textAlign="right" @click="GET_Discount()">
|
|
||||||
<span class="main-color">-{{orderMessage.priceDetailDTO.couponPrice | unitPrice}}</span>
|
|
||||||
</u-col>
|
|
||||||
<!-- orderMessage.priceDetailDTO.couponPrice | unitPrice -->
|
|
||||||
<u-col :span="3" v-else textAlign="right" @click="GET_Discount()">
|
|
||||||
{{ couponNums || "0" }}张可用
|
|
||||||
<u-icon name="arrow-right"></u-icon>
|
|
||||||
</u-col>
|
|
||||||
</u-row>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="box box5" v-if="orderMessage.priceDetailDTO">
|
<div class="box box5" v-if="orderMessage.priceDetailDTO">
|
||||||
<div>
|
<div>
|
||||||
@@ -150,51 +124,73 @@
|
|||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<u-row>
|
<u-row>
|
||||||
<u-col :span="7">运费</u-col>
|
<u-col v-if="orderMessage.cartTypeEnum != 'VIRTUAL'" :span="7">运费</u-col>
|
||||||
<u-col :span="5" class="tr tipsColor" textAlign="right">
|
<u-col v-if="orderMessage.cartTypeEnum != 'VIRTUAL'" :span="5" class="tr tipsColor" textAlign="right">
|
||||||
<u-tag v-if="orderMessage.priceDetailDTO.freightPrice == 0" style="margin-right: 20rpx" color="#FF6262" text="包邮" type="warning" size="mini" mode="plain" shape="circle" />
|
<span v-if="orderMessage.priceDetailDTO.freightPrice == 0">包邮</span>
|
||||||
<span>¥{{
|
<span v-else>¥{{
|
||||||
orderMessage.priceDetailDTO.freightPrice | unitPrice
|
orderMessage.priceDetailDTO.freightPrice | unitPrice
|
||||||
}}</span>
|
}}</span>
|
||||||
</u-col>
|
</u-col>
|
||||||
</u-row>
|
</u-row>
|
||||||
</div>
|
</div>
|
||||||
|
<u-row>
|
||||||
|
<u-col :offset="0" :span="9" @click="GET_Discount()">优惠券</u-col>
|
||||||
|
|
||||||
|
<u-col :span="3" v-if="orderMessage.priceDetailDTO && orderMessage.priceDetailDTO.couponPrice" textAlign="right"
|
||||||
|
@click="GET_Discount()">
|
||||||
|
<span class="main-color">-¥{{orderMessage.priceDetailDTO.couponPrice | unitPrice}}</span>
|
||||||
|
</u-col>
|
||||||
|
<!-- orderMessage.priceDetailDTO.couponPrice | unitPrice -->
|
||||||
|
<u-col :span="3" v-else textAlign="right" @click="GET_Discount()">
|
||||||
|
{{ orderMessage.canUseCoupons.length || "0" }} 张可用
|
||||||
|
<u-icon name="arrow-right"></u-icon>
|
||||||
|
</u-col>
|
||||||
|
</u-row>
|
||||||
<div>
|
<div>
|
||||||
<u-row>
|
<u-row>
|
||||||
<u-col :span="9">优惠金额</u-col>
|
<u-col :span="9">优惠金额</u-col>
|
||||||
<u-col :span="3" textAlign="right">-¥{{ orderMessage.priceDetailDTO.couponPrice | unitPrice }}</u-col>
|
<u-col :span="3" textAlign="right" v-if=" orderMessage.priceDetailDTO.couponPrice">
|
||||||
|
<span class="main-color"> -¥{{ orderMessage.priceDetailDTO.couponPrice | unitPrice }}</span></u-col>
|
||||||
|
<u-col :span="3" textAlign="right" v-else>0.00</u-col>
|
||||||
</u-row>
|
</u-row>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<u-row>
|
<u-row>
|
||||||
<u-col :span="6">活动优惠</u-col>
|
<u-col :span="6">活动优惠</u-col>
|
||||||
<u-col :span="6" class="tr tipsColor" textAlign="right">
|
<u-col :span="6" class="tr tipsColor" textAlign="right">
|
||||||
<u-tag style="margin-right: 20rpx" v-if="orderMessage.priceDetailDTO.discountPrice != 0" color="#FF6262" :text="`优惠 ${orderMessage.priceDetailDTO.discountPrice} 元`" type="warning"
|
<span
|
||||||
size="mini" mode="plain" shape="circle" />
|
v-if="orderMessage.priceDetailDTO.discountPrice">-¥{{orderMessage.priceDetailDTO.discountPrice | unitPrice}}</span>
|
||||||
<span>{{
|
<span v-else>0.00</span>
|
||||||
orderMessage.priceDetailDTO.discountPrice | unitPrice
|
|
||||||
}}</span>
|
|
||||||
</u-col>
|
</u-col>
|
||||||
</u-row>
|
</u-row>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 配送地区没有提示 -->
|
||||||
|
<div class="notSupportFreight" v-if="notSupportFreight.length !=0">
|
||||||
|
<u-notice-bar style="width:100%" :volume-icon="false" mode="horizontal" :list="notSupportFreightGoodsList">
|
||||||
|
</u-notice-bar>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- 结账 -->
|
<!-- 结账 -->
|
||||||
<div class="box box6 mp-iphonex-bottom" v-if="orderMessage.priceDetailDTO">
|
|
||||||
<div class="navL">
|
<div class="box6 mp-iphonex-bottom" v-if="orderMessage.priceDetailDTO">
|
||||||
合计:
|
<div class="tabbar-left">
|
||||||
<span class="number">
|
<div v-if="!orderMessage.priceDetailDTO.payPoint" class="number">
|
||||||
¥
|
<span>¥</span>
|
||||||
<span>{{ orderMessage.priceDetailDTO.billPrice | unitPrice }}</span>
|
<span class="price">{{ formatPrice(orderMessage.priceDetailDTO.flowPrice)[0] }}</span>
|
||||||
</span>
|
<span>.{{formatPrice(orderMessage.priceDetailDTO.flowPrice)[1] }} </span>
|
||||||
|
</div>
|
||||||
|
<span v-else class="number"><span
|
||||||
|
style="margin-right:10rpx;">{{orderMessage.priceDetailDTO.payPoint | unitPrice }}</span>积分</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="navRiv" @click="createTradeFun()">
|
<div class="navRiv" @click="createTradeFun()">
|
||||||
<!-- #ifndef MP-WEIXIN -->
|
<!-- #ifndef MP-WEIXIN -->
|
||||||
<div class="navR">提交订单</div>
|
<div class="tabbar-right">提交订单</div>
|
||||||
<!-- #endif -->
|
<!-- #endif -->
|
||||||
<!-- #ifdef MP-WEIXIN -->
|
<!-- #ifdef MP-WEIXIN -->
|
||||||
<div class="navR">微信支付</div>
|
<div class="tabbar-right">微信支付</div>
|
||||||
<!-- #endif -->
|
<!-- #endif -->
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
@@ -249,10 +245,11 @@ export default {
|
|||||||
endWay: "", //最后一个参团人
|
endWay: "", //最后一个参团人
|
||||||
masterWay: "", //团长信息
|
masterWay: "", //团长信息
|
||||||
pintuanFlage: true, //是开团还是拼团
|
pintuanFlage: true, //是开团还是拼团
|
||||||
|
notSupportFreight: [], //不支持运费
|
||||||
|
notSupportFreightGoodsList: ["以下商品超出配送范围:"],
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
filters: {
|
filters: {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 发票收据类型
|
* 发票收据类型
|
||||||
*/
|
*/
|
||||||
@@ -316,6 +313,13 @@ export default {
|
|||||||
mounted() {},
|
mounted() {},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
|
// 格式化金钱 1999 --> [1999,00]
|
||||||
|
formatPrice(val) {
|
||||||
|
if (typeof val == "undefined") {
|
||||||
|
return val;
|
||||||
|
}
|
||||||
|
return val.toFixed(2).split(".");
|
||||||
|
},
|
||||||
//发票回调 选择发票之后刷新购物车
|
//发票回调 选择发票之后刷新购物车
|
||||||
async callbackInvoice(val) {
|
async callbackInvoice(val) {
|
||||||
this.invoiceFlag = false;
|
this.invoiceFlag = false;
|
||||||
@@ -403,73 +407,78 @@ export default {
|
|||||||
/**
|
/**
|
||||||
* 提交订单准备支付
|
* 提交订单准备支付
|
||||||
*/
|
*/
|
||||||
submit() {
|
|
||||||
if (!this.address.id) {
|
|
||||||
uni.showToast({
|
|
||||||
title: "请选择地址",
|
|
||||||
duration: 2000,
|
|
||||||
icon: "none",
|
|
||||||
});
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
// 创建订单
|
|
||||||
let client;
|
|
||||||
// #ifdef H5
|
|
||||||
client = "H5";
|
|
||||||
// #endif
|
|
||||||
// #ifdef MP-WEIXIN
|
|
||||||
client = "WECHAT_MP";
|
|
||||||
// #endif
|
|
||||||
// #ifdef APP-PLUS
|
|
||||||
client = "APP";
|
|
||||||
// #endif
|
|
||||||
|
|
||||||
let submit = {
|
|
||||||
client,
|
|
||||||
way: this.routerVal.way,
|
|
||||||
remark: this.remarkVal,
|
|
||||||
parentOrderSn: "",
|
|
||||||
};
|
|
||||||
// 如果是拼团并且当前用户不是团长
|
|
||||||
this.routerVal.parentOrder && this.routerVal.parentOrder.orderSn
|
|
||||||
? (submit.parentOrderSn = this.routerVal.parentOrder.orderSn)
|
|
||||||
: delete submit.parentOrderSn;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 创建订单
|
|
||||||
*/
|
|
||||||
API_Trade.createTrade(submit).then((res) => {
|
|
||||||
if (res.data.success) {
|
|
||||||
uni.showToast({
|
|
||||||
title: "创建订单成功!",
|
|
||||||
duration: 2000,
|
|
||||||
icon: "none",
|
|
||||||
});
|
|
||||||
|
|
||||||
// #ifdef MP-WEIXIN
|
|
||||||
// 微信小程序中点击创建订单直接开始支付
|
|
||||||
this.pay(res.data.result.sn);
|
|
||||||
// #endif
|
|
||||||
|
|
||||||
// #ifndef MP-WEIXIN
|
|
||||||
this.navigateTo(
|
|
||||||
`/pages/cart/payment/payOrder?trade_sn=${res.data.result.sn}`
|
|
||||||
);
|
|
||||||
// #endif
|
|
||||||
} else {
|
|
||||||
uni.showToast({
|
|
||||||
title: "创建订单有误!请稍后重试",
|
|
||||||
duration: 2000,
|
|
||||||
icon: "none",
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
|
|
||||||
// 创建订单
|
// 创建订单
|
||||||
createTradeFun() {
|
createTradeFun() {
|
||||||
// 防抖
|
// 防抖
|
||||||
this.$u.debounce(this.submit(), 3000);
|
this.$u.throttle(() => {
|
||||||
|
if (!this.address.id) {
|
||||||
|
uni.showToast({
|
||||||
|
title: "请选择地址",
|
||||||
|
duration: 2000,
|
||||||
|
icon: "none",
|
||||||
|
});
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
// 创建订单
|
||||||
|
let client;
|
||||||
|
// #ifdef H5
|
||||||
|
client = "H5";
|
||||||
|
// #endif
|
||||||
|
// #ifdef MP-WEIXIN
|
||||||
|
client = "WECHAT_MP";
|
||||||
|
// #endif
|
||||||
|
// #ifdef APP-PLUS
|
||||||
|
client = "APP";
|
||||||
|
// #endif
|
||||||
|
|
||||||
|
let submit = {
|
||||||
|
client,
|
||||||
|
way: this.routerVal.way,
|
||||||
|
remark: this.remarkVal,
|
||||||
|
parentOrderSn: "",
|
||||||
|
};
|
||||||
|
// 如果是拼团并且当前用户不是团长
|
||||||
|
this.routerVal.parentOrder && this.routerVal.parentOrder.orderSn
|
||||||
|
? (submit.parentOrderSn = this.routerVal.parentOrder.orderSn)
|
||||||
|
: delete submit.parentOrderSn;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建订单
|
||||||
|
*/
|
||||||
|
API_Trade.createTrade(submit).then((res) => {
|
||||||
|
if (res.data.success) {
|
||||||
|
uni.showToast({
|
||||||
|
title: "创建订单成功!",
|
||||||
|
duration: 2000,
|
||||||
|
icon: "none",
|
||||||
|
});
|
||||||
|
// 如果当前价格为0跳转到订单列表
|
||||||
|
if (this.orderMessage.priceDetailDTO.billPrice == 0) {
|
||||||
|
uni.redirectTo({
|
||||||
|
url: "/pages/order/myOrder?status=0",
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
// #ifdef MP-WEIXIN
|
||||||
|
// 微信小程序中点击创建订单直接开始支付
|
||||||
|
this.pay(res.data.result.sn);
|
||||||
|
// #endif
|
||||||
|
|
||||||
|
// #ifndef MP-WEIXIN
|
||||||
|
this.navigateTo(
|
||||||
|
`/pages/cart/payment/payOrder?trade_sn=${res.data.result.sn}`
|
||||||
|
);
|
||||||
|
// #endif
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
uni.showToast({
|
||||||
|
title: res.data.message,
|
||||||
|
duration: 2000,
|
||||||
|
icon: "none",
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}, 3000);
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -489,9 +498,8 @@ export default {
|
|||||||
// 如果没有商品选择地址的话 则选择 默认地址
|
// 如果没有商品选择地址的话 则选择 默认地址
|
||||||
API_Address.getAddressDefault().then((res) => {
|
API_Address.getAddressDefault().then((res) => {
|
||||||
if (res.data.result) {
|
if (res.data.result) {
|
||||||
res.data.result.consigneeAddressPath = res.data.result.consigneeAddressPath.split(
|
res.data.result.consigneeAddressPath =
|
||||||
","
|
res.data.result.consigneeAddressPath.split(",");
|
||||||
);
|
|
||||||
this.address = res.data.result;
|
this.address = res.data.result;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -499,8 +507,7 @@ export default {
|
|||||||
|
|
||||||
// 获取结算参数
|
// 获取结算参数
|
||||||
getOrderList() {
|
getOrderList() {
|
||||||
// 获取购物车可用优惠券
|
this.notSupportFreight = []
|
||||||
this.getCartsCouponNums();
|
|
||||||
// 获取结算参数
|
// 获取结算参数
|
||||||
API_Trade.getCheckoutParams(this.routerVal.way).then((res) => {
|
API_Trade.getCheckoutParams(this.routerVal.way).then((res) => {
|
||||||
res.data.result.cartList.forEach((item, index) => {
|
res.data.result.cartList.forEach((item, index) => {
|
||||||
@@ -510,24 +517,31 @@ export default {
|
|||||||
};
|
};
|
||||||
});
|
});
|
||||||
this.orderMessage = res.data.result;
|
this.orderMessage = res.data.result;
|
||||||
|
/**
|
||||||
|
* 为了避免路径传值在h5中超出限制问题
|
||||||
|
* 这块将可用的优惠券以及不可用的优惠券放入到vuex里面进行存储
|
||||||
|
*/
|
||||||
|
this.$store.state.canUseCoupons = res.data.result.canUseCoupons;
|
||||||
|
this.$store.state.cantUseCoupons = res.data.result.cantUseCoupons;
|
||||||
|
|
||||||
if (!res.data.result.memberAddress.id) {
|
if (!res.data.result.memberAddress.id) {
|
||||||
// 获取会员默认地址
|
// 获取会员默认地址
|
||||||
this.getUserAddress();
|
this.getUserAddress();
|
||||||
} else {
|
} else {
|
||||||
this.address = res.data.result.memberAddress;
|
this.address = res.data.result.memberAddress;
|
||||||
res.data.result.memberAddress.consigneeAddressPath = res.data.result.memberAddress.consigneeAddressPath.split(
|
res.data.result.memberAddress.consigneeAddressPath =
|
||||||
","
|
res.data.result.memberAddress.consigneeAddressPath.split(",");
|
||||||
);
|
|
||||||
}
|
}
|
||||||
});
|
|
||||||
},
|
|
||||||
|
|
||||||
/**购物车可用优惠券 */
|
if (
|
||||||
getCartsCouponNums() {
|
res.data.result.notSupportFreight &&
|
||||||
API_Trade.getCartCouponNum(this.routerVal.way).then((res) => {
|
res.data.result.notSupportFreight.length != 0
|
||||||
if (res.data.success) {
|
) {
|
||||||
this.couponNums = res.data.result;
|
this.notSupportFreight = res.data.result.notSupportFreight;
|
||||||
|
|
||||||
|
res.data.result.notSupportFreight.forEach((item) => {
|
||||||
|
this.notSupportFreightGoodsList[0] += item.goodsSku.goodsName;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@@ -536,7 +550,16 @@ export default {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
<style scoped>
|
||||||
|
page {
|
||||||
|
background: #ededed !important;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
|
.flex-8 {
|
||||||
|
flex: 8;
|
||||||
|
}
|
||||||
|
|
||||||
.main-color {
|
.main-color {
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
@@ -547,12 +570,13 @@ export default {
|
|||||||
}
|
}
|
||||||
.promotionNotice {
|
.promotionNotice {
|
||||||
font-size: 24rpx;
|
font-size: 24rpx;
|
||||||
|
margin: 20rpx 0;
|
||||||
color: $aider-light-color;
|
color: $aider-light-color;
|
||||||
}
|
}
|
||||||
.nums {
|
.nums {
|
||||||
|
flex: 2;
|
||||||
color: $light-color;
|
color: $light-color;
|
||||||
float: right;
|
|
||||||
width: 15%;
|
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
.wait {
|
.wait {
|
||||||
@@ -570,6 +594,9 @@ export default {
|
|||||||
width: 143rpx;
|
width: 143rpx;
|
||||||
border-bottom: 2px dotted #999;
|
border-bottom: 2px dotted #999;
|
||||||
}
|
}
|
||||||
|
.tabbar-left {
|
||||||
|
margin-left: 32rpx;
|
||||||
|
}
|
||||||
|
|
||||||
.btn-one,
|
.btn-one,
|
||||||
.wait {
|
.wait {
|
||||||
@@ -598,11 +625,8 @@ export default {
|
|||||||
|
|
||||||
.group-title {
|
.group-title {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
|
||||||
font-size: 28rpx;
|
font-size: 28rpx;
|
||||||
font-family: PingFang SC, PingFang SC-Regular;
|
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
|
|
||||||
color: $light-color;
|
color: $light-color;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -618,7 +642,6 @@ export default {
|
|||||||
|
|
||||||
.group {
|
.group {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
@@ -639,62 +662,51 @@ export default {
|
|||||||
height: 4rpx;
|
height: 4rpx;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
background: url("/pages/floor/imgs/line.png") no-repeat;
|
background: url("@/pages/order/imgs/line.png") no-repeat;
|
||||||
}
|
|
||||||
|
|
||||||
.tabC {
|
|
||||||
> p {
|
|
||||||
overflow: hidden;
|
|
||||||
|
|
||||||
text-overflow: ellipsis;
|
|
||||||
|
|
||||||
white-space: nowrap;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.box2 {
|
.box2 {
|
||||||
margin-top: 20rpx;
|
margin-top: 20rpx;
|
||||||
}
|
}
|
||||||
|
.notSupportFreight {
|
||||||
|
position: fixed;
|
||||||
|
|
||||||
.userClass {
|
bottom: calc(100rpx + env(safe-area-inset-bottom));
|
||||||
font-weight: bold;
|
// #ifdef H5
|
||||||
font-size: 32rpx;
|
bottom: 100rpx;
|
||||||
color: $u-content-color;
|
// #endif
|
||||||
> span {
|
display: flex;
|
||||||
margin-left: 20rpx;
|
align-items: center;
|
||||||
|
left: 0;
|
||||||
|
background: #fdf6ec;
|
||||||
|
height: 100rpx;
|
||||||
|
width: 100%;
|
||||||
|
transition: 0.35s;
|
||||||
|
|
||||||
|
> .tips {
|
||||||
|
margin: 0 32rpx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
/deep/ .u-notice-bar-wrap {
|
||||||
.userAdress {
|
width: 100% !important;
|
||||||
margin: 20rpx 0;
|
|
||||||
color: $u-tips-color;
|
|
||||||
font-size: 26rpx;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.box6 {
|
.box6 {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
left: 0;
|
left: 0;
|
||||||
|
width: 100%;
|
||||||
margin: 0;
|
|
||||||
height: 100rpx;
|
height: 100rpx;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
line-height: 100rpx;
|
line-height: 100rpx;
|
||||||
margin-bottom: 0px !important;
|
margin-bottom: 0px !important;
|
||||||
background: #fff;
|
background: #fff;
|
||||||
color: #333;
|
color: #333;
|
||||||
width: 100%;
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
> .navL {
|
|
||||||
width: 65%;
|
|
||||||
}
|
|
||||||
|
|
||||||
> .navRiv {
|
|
||||||
float: left;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.navR {
|
.tabbar-right {
|
||||||
margin-top: 10rpx;
|
margin-top: 10rpx;
|
||||||
height: 80rpx;
|
height: 80rpx;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
@@ -703,6 +715,7 @@ export default {
|
|||||||
padding: 0 44rpx;
|
padding: 0 44rpx;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
border-radius: 400px;
|
border-radius: 400px;
|
||||||
|
margin-right: 32rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.sp_tag {
|
.sp_tag {
|
||||||
@@ -716,7 +729,7 @@ export default {
|
|||||||
border-radius: 0.4em;
|
border-radius: 0.4em;
|
||||||
}
|
}
|
||||||
|
|
||||||
.sp_promotion {
|
.goods-promotion {
|
||||||
float: left;
|
float: left;
|
||||||
width: 75%;
|
width: 75%;
|
||||||
margin: 4rpx 0;
|
margin: 4rpx 0;
|
||||||
@@ -736,15 +749,9 @@ export default {
|
|||||||
margin-left: 0;
|
margin-left: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.sp_name {
|
.goods-name {
|
||||||
float: left;
|
flex: 8;
|
||||||
width: 75%;
|
|
||||||
font-size: 28rpx;
|
font-size: 28rpx;
|
||||||
overflow: hidden;
|
|
||||||
|
|
||||||
text-overflow: ellipsis;
|
|
||||||
|
|
||||||
white-space: nowrap;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.sp_type {
|
.sp_type {
|
||||||
@@ -756,28 +763,21 @@ export default {
|
|||||||
.number {
|
.number {
|
||||||
color: $main-color;
|
color: $main-color;
|
||||||
font-size: 26rpx;
|
font-size: 26rpx;
|
||||||
margin-left: 10rpx;
|
font-weight: bold;
|
||||||
|
|
||||||
> span {
|
> span {
|
||||||
font-size: 36rpx;
|
font-size: 36rpx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.sp_number {
|
.goods-prices {
|
||||||
color: $light-color;
|
margin: 10rpx 0;
|
||||||
|
color: $main-color;
|
||||||
font-size: 28rpx;
|
font-size: 28rpx;
|
||||||
}
|
font-weight: bold;
|
||||||
|
> .goods-price {
|
||||||
.box1 {
|
font-size: 38rpx;
|
||||||
background: #f6f6f6 !important;
|
padding: 0 2rpx;
|
||||||
min-height: 166rpx;
|
|
||||||
// height: 200rpx;
|
|
||||||
|
|
||||||
/deep/ .u-row {
|
|
||||||
border: none;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
margin-bottom: 0 !important;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.box {
|
.box {
|
||||||
@@ -785,26 +785,19 @@ export default {
|
|||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
background: #fff;
|
background: #fff;
|
||||||
margin-bottom: 20rpx;
|
margin-bottom: 20rpx;
|
||||||
|
color: #666;
|
||||||
padding: 0 32rpx;
|
padding: 0 32rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.navL,
|
|
||||||
.navR {
|
|
||||||
float: left;
|
|
||||||
}
|
|
||||||
|
|
||||||
.wrapper {
|
.wrapper {
|
||||||
background: #f9f9f9;
|
|
||||||
height: auto;
|
height: auto;
|
||||||
|
background: #f7f7f7;
|
||||||
padding-bottom: 200rpx;
|
padding-bottom: 200rpx;
|
||||||
overflow: auto !important;
|
overflow: auto !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.tab1 {
|
.store-name {
|
||||||
}
|
margin-top: 32rpx;
|
||||||
|
|
||||||
.ybname {
|
|
||||||
margin-left: 20rpx;
|
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
color: #333333;
|
color: #333333;
|
||||||
}
|
}
|
||||||
@@ -815,18 +808,66 @@ export default {
|
|||||||
|
|
||||||
/deep/ .u-col-3,
|
/deep/ .u-col-3,
|
||||||
.tipsColor {
|
.tipsColor {
|
||||||
color: $u-tips-color;
|
color: #333;
|
||||||
}
|
}
|
||||||
|
|
||||||
.tabL {
|
.goods-image {
|
||||||
text-align: left;
|
text-align: left;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
.default {
|
||||||
|
background: $main-color;
|
||||||
|
font-size: 24rpx;
|
||||||
|
border-radius: 8rpx;
|
||||||
|
padding: 0rpx 12rpx;
|
||||||
|
color: #fff;
|
||||||
|
margin-right: 20rpx;
|
||||||
|
}
|
||||||
|
.address-box {
|
||||||
|
border-radius: 40rpx;
|
||||||
|
border-top-left-radius: 0 !important;
|
||||||
|
border-top-right-radius: 0 !important;
|
||||||
|
overflow: hidden;
|
||||||
|
background: #fff;
|
||||||
|
margin-bottom: 20rpx;
|
||||||
|
color: #666;
|
||||||
|
}
|
||||||
|
|
||||||
/deep/ .u-image,
|
.address-item {
|
||||||
.u-image__image {
|
font-weight: normal;
|
||||||
width: 132rpx !important;
|
letter-spacing: 1rpx;
|
||||||
height: 132rpx !important;
|
}
|
||||||
border-radius: 0.4em !important;
|
.user-box {
|
||||||
|
padding: 32rpx;
|
||||||
|
}
|
||||||
|
.user-address-detail {
|
||||||
|
color: #333;
|
||||||
|
font-size: 38rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
margin: 20rpx 0;
|
||||||
|
letter-spacing: 1rpx;
|
||||||
|
}
|
||||||
|
.mobile {
|
||||||
|
margin-left: 20rpx;
|
||||||
|
}
|
||||||
|
.price {
|
||||||
|
font-size: 50rpx !important;
|
||||||
|
margin: 0 2rpx;
|
||||||
|
}
|
||||||
|
.goods-detail {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
|
||||||
|
justify-content: center;
|
||||||
|
flex: 8;
|
||||||
|
margin-left: 20rpx !important;
|
||||||
|
> p {
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
white-space: nowrap;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.goods-item {
|
||||||
|
margin: 20rpx 0;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user