mirror of
https://gitee.com/beijing_hongye_huicheng/lilishop-uniapp.git
synced 2025-12-19 17:05:55 +08:00
Compare commits
185 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9b5e2ec7f0 | ||
|
|
adf4e106d8 | ||
|
|
d01edbdfe2 | ||
|
|
f08d166c86 | ||
|
|
b8c61fdabd | ||
|
|
6b3b61acb5 | ||
|
|
1a6951b717 | ||
|
|
165df678b3 | ||
|
|
2abbee0a49 | ||
|
|
a6883fe607 | ||
|
|
6ee0abd150 | ||
|
|
68e927c6f4 | ||
|
|
1776f43425 | ||
|
|
fc8123c194 | ||
|
|
34448b8a23 | ||
|
|
7179ca41de | ||
|
|
3c7d940ba8 | ||
|
|
1225a41de4 | ||
|
|
d101cd1b6a | ||
|
|
4851487ecd | ||
|
|
eb0faad7ec | ||
|
|
524666f6e4 | ||
|
|
e9da67dcce | ||
|
|
aa8fc523df | ||
|
|
63570a923b | ||
|
|
638e82dd28 | ||
|
|
68dc960232 | ||
|
|
bbbe25e339 | ||
|
|
d8cca8b372 | ||
|
|
1e9df74034 | ||
|
|
8c8522c68e | ||
|
|
5afc5477a9 | ||
|
|
a6e48813cd | ||
|
|
a1a286dfb6 | ||
|
|
132c64f438 | ||
|
|
8e0bde3428 | ||
|
|
d9ac9eb2eb | ||
|
|
6ccdeba85e | ||
|
|
bbf0f39d69 | ||
|
|
109af44c6b | ||
|
|
bc9c012bb2 | ||
|
|
ba02c6ca7d | ||
|
|
b840a0adf1 | ||
|
|
5cb2f6ad91 | ||
|
|
36a7a80814 | ||
|
|
17299d00e1 | ||
|
|
a56ea2d456 | ||
|
|
3a705cce8e | ||
|
|
5550285531 | ||
|
|
0ba7644862 | ||
|
|
0e169bd116 | ||
|
|
4b9515b21a | ||
|
|
3f0e34b715 | ||
|
|
a393910c0a | ||
|
|
213f4b8408 | ||
|
|
8cb01d0ba8 | ||
|
|
d8c46b49d9 | ||
|
|
73e4ba9994 | ||
|
|
3aa5b21d49 | ||
|
|
f90807ebc6 | ||
|
|
a555009ac9 | ||
|
|
af21d1abba | ||
|
|
dcf77ba862 | ||
|
|
f281011a47 | ||
|
|
6bb8ca73d3 | ||
|
|
a070edc1c2 | ||
|
|
09485747a6 | ||
|
|
cbd73ae638 | ||
|
|
1aeec348eb | ||
|
|
ea8e783909 | ||
|
|
e06338dd2e | ||
|
|
d6fffc43e4 | ||
|
|
7633f84385 | ||
|
|
93fc20c825 | ||
|
|
ca32c11296 | ||
|
|
d2b8d2238a | ||
|
|
04ea9c39e1 | ||
|
|
905e965917 | ||
|
|
1ada23584d | ||
|
|
1456fd9076 | ||
|
|
941dd6015d | ||
|
|
b1f320f361 | ||
|
|
63e3718178 | ||
|
|
9bfa30f849 | ||
|
|
bb24b27963 | ||
|
|
403d93831f | ||
|
|
9a149eb673 | ||
|
|
470995c13d | ||
|
|
ddcd03f096 | ||
|
|
b8fe2aacf1 | ||
|
|
3c9f0d3c5c | ||
|
|
ded0ab5381 | ||
|
|
42d20f0fd9 | ||
|
|
0e8ace560b | ||
|
|
6e04a5d3da | ||
|
|
a3d8a8037f | ||
|
|
1dc42e1333 | ||
|
|
68cdcd8587 | ||
|
|
ebf0d585fc | ||
|
|
75365c428d | ||
|
|
3e30f5e18f | ||
|
|
e8d3b3decb | ||
|
|
5dcb364469 | ||
|
|
df9530e48f | ||
|
|
240a27a61a | ||
|
|
a6a8a5d583 | ||
|
|
a9046aded4 | ||
|
|
6f60cc6afb | ||
|
|
6e5470e20c | ||
|
|
dc04b4220f | ||
|
|
b1cfdef41c | ||
|
|
06e609613e | ||
|
|
8e66c24ff9 | ||
|
|
b4e2761b1f | ||
|
|
884d3e8c34 | ||
|
|
53739d24df | ||
|
|
f59a76d9a0 | ||
|
|
6cd36b19b2 | ||
|
|
b22ad88f37 | ||
|
|
f87ec18669 | ||
|
|
64686e165f | ||
|
|
055bad9ca9 | ||
|
|
c6e04bc4b9 | ||
|
|
b6782df565 | ||
|
|
2b4cb2cc88 | ||
|
|
14d12d90e3 | ||
|
|
4ed3832a5f | ||
|
|
b0714ab27e | ||
|
|
201ee840d5 | ||
|
|
79f737404e | ||
|
|
0b649e3f5b | ||
|
|
c756223363 | ||
|
|
ea60742d82 | ||
|
|
2ce90ba008 | ||
|
|
63211457e4 | ||
|
|
67f014d74a | ||
|
|
08fffade74 | ||
|
|
c8adb52660 | ||
|
|
4f74502951 | ||
|
|
4a5a4c19a5 | ||
|
|
e73d76eb57 | ||
|
|
b9a89d7c40 | ||
|
|
1a1bf814a0 | ||
|
|
f52e929d04 | ||
|
|
38d8d2e1ca | ||
|
|
ab4015d0e0 | ||
|
|
15027e51ee | ||
|
|
557d7ef1d9 | ||
|
|
4dea906e23 | ||
|
|
68e25cb0b3 | ||
|
|
4d033e59f1 | ||
|
|
a80c579d8a | ||
|
|
5cc48ed462 | ||
|
|
2abc8ff9d8 | ||
|
|
198bd6c322 | ||
|
|
7fb96f1eac | ||
|
|
2020f55826 | ||
|
|
c58f8d7831 | ||
|
|
32a6bbacd0 | ||
|
|
b08c77b6c0 | ||
|
|
a8836744f6 | ||
|
|
3a2202a2e8 | ||
|
|
896749d812 | ||
|
|
09ec1e8c06 | ||
|
|
07627c41e3 | ||
|
|
e4e278c2fa | ||
|
|
1b1b239ba0 | ||
|
|
c1d4d39265 | ||
|
|
dfd3885486 | ||
|
|
892f49c83a | ||
|
|
85d0671443 | ||
|
|
f22e7b9fcb | ||
|
|
d282ef1b24 | ||
|
|
9c2529ae3d | ||
|
|
108b7f5b0b | ||
|
|
b4c8be3e63 | ||
|
|
4064c56b21 | ||
|
|
1416762afe | ||
|
|
17f23fe920 | ||
|
|
c412c92b3e | ||
|
|
deed875c1b | ||
|
|
f600b628ce | ||
|
|
0c887a25e3 | ||
|
|
89dbd32351 | ||
|
|
98c5863973 |
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1,6 +1,7 @@
|
||||
# OSX
|
||||
#
|
||||
.DS_Store
|
||||
node_modules/
|
||||
|
||||
#Intellij idea
|
||||
.idea/
|
||||
|
||||
54
App.vue
54
App.vue
@@ -1,14 +1,35 @@
|
||||
|
||||
|
||||
<script>
|
||||
/**
|
||||
* vuex管理登录状态,具体可以参考官方登录模板示例
|
||||
*/
|
||||
import { mapMutations } from "vuex";
|
||||
import {
|
||||
mapMutations
|
||||
} from "vuex";
|
||||
import APPUpdate from "@/plugins/APPUpdate";
|
||||
import { getClipboardData } from "@/js_sdk/h5-copy/h5-copy.js";
|
||||
import {
|
||||
getClipboardData
|
||||
} from "@/js_sdk/h5-copy/h5-copy.js";
|
||||
import config from "@/config/config";
|
||||
// 悬浮球
|
||||
import storage from "@/utils/storage";
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 路由监听并删除路由
|
||||
* https://developers.weixin.qq.com/miniprogram/dev/api/route/wx.navigateTo.html
|
||||
* */
|
||||
// #ifdef MP-WEIXIN
|
||||
wx.onAppRoute((res) => {
|
||||
const pages = getCurrentPages();
|
||||
console.log("pages:" + pages.length,pages);
|
||||
if (pages.length > 3) {
|
||||
delete getCurrentPages()[2]
|
||||
}
|
||||
console.log('路由监听', {
|
||||
res
|
||||
})
|
||||
})
|
||||
// #endif
|
||||
|
||||
export default {
|
||||
data() {
|
||||
@@ -17,6 +38,7 @@ export default {
|
||||
};
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* 监听返回
|
||||
*/
|
||||
@@ -66,7 +88,18 @@ export default {
|
||||
|
||||
onShow() {
|
||||
// #ifndef H5
|
||||
if(this.config.enableGetClipboard){
|
||||
this.getClipboard();
|
||||
}
|
||||
// #endif
|
||||
// #ifdef APP-PLUS
|
||||
|
||||
if (storage.getShow()) {
|
||||
if (uni.getSystemInfoSync().platform == 'ios') {
|
||||
this.$u.route("/pages/tabbar/screen/fullScreen");
|
||||
|
||||
}
|
||||
}
|
||||
// #endif
|
||||
},
|
||||
methods: {
|
||||
@@ -108,8 +141,7 @@ export default {
|
||||
//app启动时打开启动广告页
|
||||
var w = plus.webview.open(
|
||||
"/hybrid/html/advertise/advertise.html",
|
||||
"本地地址",
|
||||
{
|
||||
"本地地址", {
|
||||
top: 0,
|
||||
bottom: 0,
|
||||
zindex: 999,
|
||||
@@ -140,10 +172,13 @@ export default {
|
||||
*/
|
||||
async getClipboard() {
|
||||
let res = await getClipboardData();
|
||||
|
||||
/**
|
||||
* 解析粘贴板数据
|
||||
*/
|
||||
if (res.indexOf(config.shareLink) != -1) {
|
||||
|
||||
if (res.indexOf(config.shareLink) != -1 && (res != this.$store.state.shareLink)) {
|
||||
this.$store.state.shareLink = res
|
||||
uni.showModal({
|
||||
title: "提示",
|
||||
content: "检测到一个分享链接是否跳转?",
|
||||
@@ -206,15 +241,18 @@ export default {
|
||||
height: auto !important;
|
||||
padding-top: 10rpx;
|
||||
}
|
||||
|
||||
// #endif
|
||||
|
||||
body {
|
||||
background-color: $bg-color;
|
||||
}
|
||||
|
||||
/************************ */
|
||||
.w200 {
|
||||
width: 200rpx !important;
|
||||
}
|
||||
|
||||
.flex1 {
|
||||
flex: 1; //必须父级设置flex
|
||||
}
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
qSyvBPhDsPdxvOhC
|
||||
179
README.md
179
README.md
@@ -1,18 +1,22 @@
|
||||
## 🔥 Lilishop B2B2C商城系统
|
||||
## Lilishop B2B2C商城系统
|
||||
|
||||
##### 🌹 开源不易,如有帮助请点Star
|
||||
#### 欢迎交流需求,交流业务,交流技术(基础问题自行解决,其他问题先看文档后提问)
|
||||
|
||||
|
||||
|
||||
#### 欢迎交流需求,交流业务,交流技术(基础问题自行解决,进群先看文档后提问)
|
||||
|
||||
##### 交流 qq 1群 961316482(已满)
|
||||
<a target="_blank" href="https://qm.qq.com/cgi-bin/qm/qr?k=BAhURE3DG2YWhQk6kRxVapbLykqMoPS8&jump_from=webapi"><img border="0" src="https://pub.idqqimg.com/wpa/images/group.png" alt="Lilishop交流群" title="Lilishop交流群">点击快捷加群</a>
|
||||
|
||||
##### 交流 qq 2群 875294241
|
||||
##### 交流 qq 2群 875294241(已满)
|
||||
|
||||
<a target="_blank" href="https://qm.qq.com/cgi-bin/qm/qr?k=_lrekOvr5k2p5uTn5GRidI-chKEmpCX3&jump_from=webapi"><img border="0" src="https://pub.idqqimg.com/wpa/images/group.png" alt="Lilishop交流群2群" title="Lilishop交流群2群">点击快捷加群</a>
|
||||
|
||||
|
||||
##### 交流 qq 3群 263785057
|
||||
|
||||
##### 商城 公众号/小程序体验,扫描二维码
|
||||
<a target="_blank" href="https://qm.qq.com/cgi-bin/qm/qr?k=VUogkDvaso4zLTFH8nxFPDRKq0EthUn1&jump_from=webapi"><img border="0" src="//pub.idqqimg.com/wpa/images/group.png" alt="Lilishop交流群3群" title="Lilishop交流群3群">点击快捷加群</a>
|
||||
|
||||
|
||||
##### 体验 公众号/小程序/APP 体验,扫描二维码
|
||||
|
||||

|
||||
|
||||
@@ -20,148 +24,88 @@
|
||||

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

|
||||
|
||||
### 🚙 3行命令搭建本地商城(注:只能本机访问,如需调整,请自行操作镜像)
|
||||
### 快速本地部署
|
||||
|
||||
温馨提示:由于服务中间件较多,如果笔记本环境启动内存没有32g可能无法启动成功(macbookpro 2020 16g内存启动无法成功),台式机在16g内存、AMD 3700x 的ubuntu系统成功运行。
|
||||
[点击跳转](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部署数据库,自动初始化数据库,不需要手动下载等操作
|
||||
|
||||
如果手动部署,才需要获取sql [点击跳转](https://gitee.com/beijing_hongye_huicheng/docker/tree/master/init/mysql) (PS:这里有与tag版本一致的sql,如果是历史版本,则docker项目也切换至历史版本获取sql即可,历史版本升级则根据java相聚的根目录DB目录下的升级sql,按需执行)。
|
||||
|
||||
|
||||
|
||||
##### 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 `
|
||||
#### 平台管理端功能
|
||||
|
||||
##### 部署商城所需中间件
|
||||
`docker-compose up -d`
|
||||
|
||||
##### 部署商城应用
|
||||
`docker-compose -f docker-compose-application.yml up -d`
|
||||

|
||||
|
||||
|
||||
|
||||
PS:商城数据库单独部署 https://gitee.com/beijing_hongye_huicheng/docker/tree/master/init/mysql 这里有与tag版本一致的sql,根据tag获取sql,如果使用master代码,则需要在lilishop项目根目录的DB目录中,获取对应的升级sql。
|
||||
|
||||
##### 商城 API/UI 地址
|
||||
|
||||
| API | 地址 |
|
||||
| -------------- | --------------- |
|
||||
| 商城买家API | http://127.0.0.1:8888 |
|
||||
| 商城商家API | http://127.0.0.1:8889 |
|
||||
| 商城管理端API | http://127.0.0.1:8887 |
|
||||
| 商城基础API | http://127.0.0.1:8890 |
|
||||
|
||||
| 前端演示 | 地址 |
|
||||
| -------------- | --------------- |
|
||||
| 商城PC端 | http://127.0.0.1:10000 |
|
||||
| 商城WAP端 | http://127.0.0.1:10001 |
|
||||
| 商城卖家端 | http://127.0.0.1:10002 |
|
||||
| 商城管理端 | http://127.0.0.1:10003 |
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
### ⚾️ 功能列表
|
||||
|
||||
|
||||
|
||||
#### 🥎 商城平台功能
|
||||
|
||||

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

|
||||
|
||||
|
||||
### 商城前端功能展示
|
||||
|
||||
|
||||
|
||||
### 🧩 商城前端功能展示
|
||||
|
||||
|
||||
|
||||
#### ⚽️ 商城移动端
|
||||
#### 商城移动端
|
||||
|
||||
<img src="https://pickmall.cn/assets/imgs/other/app.gif" alt="移动端功能展示" style="zoom:50%;" />
|
||||
|
||||
|
||||
|
||||
#### ⚽️ 商城管理端
|
||||
#### 平台管理端
|
||||
|
||||

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

|
||||

|
||||
|
||||
##### 🕹 后台技术选型
|
||||
##### 后台技术选型
|
||||
|
||||
| 说明 | 框架 | 说明 | |
|
||||
| -------------- | --------------- | -------------- | ------------- |
|
||||
@@ -175,7 +119,7 @@ PS:商城数据库单独部署 https://gitee.com/beijing_hongye_huicheng/docker/
|
||||
| 短信 | 阿里云短信 | 认证 | JWT |
|
||||
| 日志处理 | Log4j | 接口规范 | RESTful |
|
||||
|
||||
##### 🖥 前端-运营后台、店铺后台
|
||||
##### 前端-运营后台、店铺后台
|
||||
|
||||
| 说明 | 框架 | 说明 | 框架 |
|
||||
| ---------- | ---------- | ---------- | ------- |
|
||||
@@ -185,34 +129,43 @@ PS:商城数据库单独部署 https://gitee.com/beijing_hongye_huicheng/docker/
|
||||
| 基础UI库 | iView | UI界面基于 | iView |
|
||||
| 网络请求 | axios | | |
|
||||
|
||||
##### 📱前端-移动端
|
||||
##### 前端-移动端
|
||||
|
||||
| 说明 | 架构 | 说明 | 架构 |
|
||||
| --------- | ------- | -------- | ------- |
|
||||
| 基础UI库 | uViewui | 基础框架 | uni-app |
|
||||
| CSS预处理 | scss | 地图引擎 | amap |
|
||||
|
||||
### 🌟 版本升级
|
||||
### 版本升级
|
||||
|
||||
```
|
||||
商城后续会持续版本升级,修复bug,完善功能,覆盖更多业务场景 o2o/b2b/s2b2b2c/跨境电商
|
||||
|
||||
后续会考虑推出微服务商城系统/商城中台等
|
||||
系统后续会提供多场景解决方案。
|
||||
更多架构:微服务、Saas、中台等,都会支持。 支持差价升级商业授权
|
||||
```
|
||||
|
||||
### 商业授权
|
||||
商业版本与开源版本代码一致,没有区分
|
||||
|
||||
### ⚠️ 开源须知
|
||||
商业使用需要授权,授权方式可选择联系官网客服,或者qq群联系群主。
|
||||
|
||||
商业授权模式为永久授权,支持永久升级。
|
||||
|
||||
商业案例由于涉及部分多层二开关系,如需了解可以咨询销售。
|
||||
|
||||
|
||||
### 开源须知
|
||||
1.仅允许用于个人学习研究使用.
|
||||
|
||||
2.禁止将本开源的代码和资源进行任何形式任何名义的出售.
|
||||
|
||||
3.软件受国家计算机软件著作权保护(登记号:2021SR0805085)。
|
||||
|
||||
4.限制商用,如果需要商业使用请联系我们。QQ3409056806.
|
||||
4.限制商用,如果需要商业使用请联系我们。QQ3409056806.或者加入qq群联系群主。
|
||||
|
||||
|
||||
### 🐧 交流群
|
||||
|
||||
### 交流群
|
||||
|
||||
##### 官方qq 1群 961316482(已满)
|
||||
##### 官方qq 2群 875294241
|
||||
|
||||
##### 官方qq 2群 875294241(已满)
|
||||
##### 官网qq 3群 263785057
|
||||
|
||||
17
androidPrivacy.json
Normal file
17
androidPrivacy.json
Normal file
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"version" : "1",
|
||||
"prompt" : "template",
|
||||
"title" : "服务协议和隐私政策",
|
||||
"message" : " 请你务必审慎阅读、充分理解“服务协议”和“隐私政策”各条款,包括但不限于:为了更好的向你提供服务,我们需要收集你的设备标识、操作日志等信息用于分析、优化应用性能。<br/> 你可阅读<a href=\"https://pc-b2b2c.pickmall.cn/article/detail?id=1371992704333905920\">《服务协议》</a>和<a href=\"https://pc-b2b2c.pickmall.cn/article/detail?id=1371779927900160000\">《隐私政策》</a>了解详细信息。如果你同意,请点击下面按钮开始接受我们的服务。",
|
||||
"buttonAccept" : "同意并接受",
|
||||
"buttonRefuse" : "暂不同意",
|
||||
"second" : {
|
||||
"title" : "确认提示",
|
||||
"message" : " 进入应用前,你需先同意<a href=\"https://pc-b2b2c.pickmall.cn/article/detail?id=1371992704333905920\">《服务协议》</a>和<a href=\"https://pc-b2b2c.pickmall.cn/article/detail?id=1371779927900160000\">《隐私政策》</a>,否则将退出应用。",
|
||||
"buttonAccept" : "同意并继续",
|
||||
"buttonRefuse" : "退出应用"
|
||||
},
|
||||
"styles" : {
|
||||
"borderRadius" : "5px"
|
||||
}
|
||||
}
|
||||
@@ -12,7 +12,7 @@ import api from "@/config/api.js";
|
||||
*/
|
||||
export function getAddressList(pageNumber, pageSize) {
|
||||
return http.request({
|
||||
url: "/memberAddress",
|
||||
url: "/member/address",
|
||||
method: Method.GET,
|
||||
needToken: true,
|
||||
params: { pageNumber, pageSize },
|
||||
@@ -25,7 +25,7 @@ export function getAddressList(pageNumber, pageSize) {
|
||||
*/
|
||||
export function getLogistics() {
|
||||
return http.request({
|
||||
url: "/logistics",
|
||||
url: "/other/logistics",
|
||||
method: Method.GET,
|
||||
needToken: true,
|
||||
params: { pageNumber: 1, pageSize: 200, disabled: "OPEN" },
|
||||
@@ -37,7 +37,7 @@ export function getLogistics() {
|
||||
*/
|
||||
export function getAddressCode(cityCode, townName) {
|
||||
return http.request({
|
||||
url: api.common + "/region/region",
|
||||
url: api.common + "/common/region/region",
|
||||
method: Method.GET,
|
||||
needToken: true,
|
||||
params: { cityCode, townName },
|
||||
@@ -51,7 +51,7 @@ export function getAddressCode(cityCode, townName) {
|
||||
*/
|
||||
export function addAddress(data) {
|
||||
return http.request({
|
||||
url: "/memberAddress",
|
||||
url: "/member/address",
|
||||
method: Method.POST,
|
||||
needToken: true,
|
||||
header: { "content-type": "application/x-www-form-urlencoded" },
|
||||
@@ -67,7 +67,7 @@ export function addAddress(data) {
|
||||
*/
|
||||
export function editAddress(params) {
|
||||
return http.request({
|
||||
url: `/memberAddress`,
|
||||
url: `/member/address`,
|
||||
method: Method.PUT,
|
||||
needToken: true,
|
||||
header: { "content-type": "application/x-www-form-urlencoded" },
|
||||
@@ -81,7 +81,7 @@ export function editAddress(params) {
|
||||
*/
|
||||
export function deleteAddress(id) {
|
||||
return http.request({
|
||||
url: `/memberAddress/delById/${id}`,
|
||||
url: `/member/address/delById/${id}`,
|
||||
method: Method.DELETE,
|
||||
needToken: true,
|
||||
});
|
||||
@@ -95,7 +95,7 @@ export function deleteAddress(id) {
|
||||
*/
|
||||
export function getAddressDetail(id) {
|
||||
return http.request({
|
||||
url: `/memberAddress/get/${id}`,
|
||||
url: `/member/address/get/${id}`,
|
||||
method: Method.GET,
|
||||
loading: false,
|
||||
needToken: true,
|
||||
@@ -107,7 +107,7 @@ export function getAddressDetail(id) {
|
||||
*/
|
||||
export function getAddressDefault() {
|
||||
return http.request({
|
||||
url: `/memberAddress/get/default`,
|
||||
url: `/member/address/get/default`,
|
||||
method: Method.GET,
|
||||
loading: false,
|
||||
needToken: true,
|
||||
|
||||
@@ -34,16 +34,29 @@ export function applyCancelOrder(params) {
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* 获取商家售后收件地址
|
||||
*/
|
||||
export function getstoreAfterSaleAddress(sn) {
|
||||
export function getStoreAfterSaleAddress(sn) {
|
||||
return http.request({
|
||||
url: `/afterSale/getStoreAfterSaleAddress/${sn}`,
|
||||
url: `/order/afterSale/getStoreAfterSaleAddress/${sn}`,
|
||||
method: Method.GET,
|
||||
needToken: true,
|
||||
});
|
||||
}
|
||||
/**
|
||||
* 取消售后
|
||||
*/
|
||||
export function cancelAfterSale(afterSaleSn) {
|
||||
return http.request({
|
||||
url: `/order/afterSale/cancel/${afterSaleSn}`,
|
||||
method: Method.POST,
|
||||
needToken: true,
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 获取售后服务记录相关数据
|
||||
@@ -51,7 +64,7 @@ export function getstoreAfterSaleAddress(sn) {
|
||||
*/
|
||||
export function getAfterSaleList(params) {
|
||||
return http.request({
|
||||
url: `/afterSale/page`,
|
||||
url: `/order/afterSale/page`,
|
||||
method: Method.GET,
|
||||
needToken: true,
|
||||
params,
|
||||
@@ -64,7 +77,7 @@ export function getAfterSaleList(params) {
|
||||
*/
|
||||
export function getServiceDetail(sn) {
|
||||
return http.request({
|
||||
url: `/afterSale/get/${sn}`,
|
||||
url: `/order/afterSale/get/${sn}`,
|
||||
method: Method.GET,
|
||||
needToken: true,
|
||||
});
|
||||
@@ -76,7 +89,7 @@ export function getServiceDetail(sn) {
|
||||
*/
|
||||
export function addComplain(params) {
|
||||
return http.request({
|
||||
url: `/complain`,
|
||||
url: `/order/complain`,
|
||||
method: Method.POST,
|
||||
needToken: true,
|
||||
header: {
|
||||
@@ -91,7 +104,7 @@ export function addComplain(params) {
|
||||
*/
|
||||
export function clearComplain(id, params) {
|
||||
return http.request({
|
||||
url: `/complain/status/${id}`,
|
||||
url: `/order/complain/status/${id}`,
|
||||
method: Method.PUT,
|
||||
needToken: true,
|
||||
params,
|
||||
@@ -103,7 +116,7 @@ export function clearComplain(id, params) {
|
||||
*/
|
||||
export function getAfterSaleLog(sn) {
|
||||
return http.request({
|
||||
url: `/afterSale/get/getAfterSaleLog/${sn}`,
|
||||
url: `/order/afterSale/get/getAfterSaleLog/${sn}`,
|
||||
method: Method.GET,
|
||||
needToken: true,
|
||||
});
|
||||
@@ -114,7 +127,7 @@ export function getAfterSaleLog(sn) {
|
||||
*/
|
||||
export function getComplain(params) {
|
||||
return http.request({
|
||||
url: `/complain`,
|
||||
url: `/order/complain`,
|
||||
method: Method.GET,
|
||||
needToken: true,
|
||||
params,
|
||||
@@ -126,7 +139,7 @@ export function getComplain(params) {
|
||||
*/
|
||||
export function getAfterSaleReason(serviceType) {
|
||||
return http.request({
|
||||
url: `/afterSale/get/afterSaleReason/${serviceType}`,
|
||||
url: `/order/afterSale/get/afterSaleReason/${serviceType}`,
|
||||
method: Method.GET,
|
||||
needToken: true,
|
||||
});
|
||||
@@ -137,7 +150,7 @@ export function getAfterSaleReason(serviceType) {
|
||||
*/
|
||||
export function getClearReason() {
|
||||
return http.request({
|
||||
url: `/afterSale/get/afterSaleReason/CANCEL`,
|
||||
url: `/order/afterSale/get/afterSaleReason/CANCEL`,
|
||||
method: Method.GET,
|
||||
needToken: true,
|
||||
});
|
||||
@@ -148,7 +161,7 @@ export function getClearReason() {
|
||||
*/
|
||||
export function getComplainReason() {
|
||||
return http.request({
|
||||
url: `/afterSale/get/afterSaleReason/COMPLAIN`,
|
||||
url: `/order/afterSale/get/afterSaleReason/COMPLAIN`,
|
||||
method: Method.GET,
|
||||
needToken: true,
|
||||
});
|
||||
@@ -158,7 +171,7 @@ export function getComplainReason() {
|
||||
*/
|
||||
export function getComplainDetail(id) {
|
||||
return http.request({
|
||||
url: `/complain/${id}`,
|
||||
url: `/order/complain/${id}`,
|
||||
method: Method.GET,
|
||||
needToken: true,
|
||||
});
|
||||
@@ -169,7 +182,7 @@ export function getComplainDetail(id) {
|
||||
*/
|
||||
export function getAfterSaleInfo(sn) {
|
||||
return http.request({
|
||||
url: `/afterSale/applyAfterSaleInfo/${sn}`,
|
||||
url: `/order/afterSale/applyAfterSaleInfo/${sn}`,
|
||||
method: Method.GET,
|
||||
needToken: true,
|
||||
});
|
||||
@@ -181,7 +194,7 @@ export function getAfterSaleInfo(sn) {
|
||||
*/
|
||||
export function applyReturn(orderItemSn, params) {
|
||||
return http.request({
|
||||
url: `/afterSale/save/${orderItemSn}`,
|
||||
url: `/order/afterSale/save/${orderItemSn}`,
|
||||
method: Method.POST,
|
||||
header: {
|
||||
"Content-Type": "application/x-www-form-urlencoded",
|
||||
@@ -197,7 +210,7 @@ export function applyReturn(orderItemSn, params) {
|
||||
*/
|
||||
export function fillShipInfo(afterSaleSn, params) {
|
||||
return http.request({
|
||||
url: `/afterSale/delivery/${afterSaleSn}`,
|
||||
url: `/order/afterSale/delivery/${afterSaleSn}`,
|
||||
method: Method.POST,
|
||||
header: {
|
||||
"Content-Type": "application/x-www-form-urlencoded",
|
||||
|
||||
@@ -23,7 +23,7 @@ export function getArticleCategory(category_type) {
|
||||
*/
|
||||
export function getArticleDetail(type) {
|
||||
return http.request({
|
||||
url: `/article/type/${type}`,
|
||||
url: `/other/article/get/${type}`,
|
||||
method: Method.GET,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
/**
|
||||
* 公共API
|
||||
*/
|
||||
import {http, Method} from '@/utils/request.js';
|
||||
import api from '@/config/api.js';
|
||||
|
||||
|
||||
import { http, Method } from "@/utils/request.js";
|
||||
import api from "@/config/api.js";
|
||||
|
||||
/**
|
||||
* 获取地区数据
|
||||
@@ -12,7 +10,16 @@ import api from '@/config/api.js';
|
||||
*/
|
||||
export function getRegionsById(id = 0) {
|
||||
return http.request({
|
||||
url: `${api.common}/region/item/${id}`,
|
||||
url: `${api.common}/common/region/item/${id}`,
|
||||
method: Method.GET,
|
||||
message: false,
|
||||
});
|
||||
}
|
||||
|
||||
// 获取IM接口前缀
|
||||
export function getIMDetail() {
|
||||
return http.request({
|
||||
url: `${api.common}/IM`,
|
||||
method: Method.GET,
|
||||
message: false,
|
||||
});
|
||||
@@ -22,5 +29,4 @@ export function getRegionsById(id = 0) {
|
||||
* 文件上传地址
|
||||
* @type {string}
|
||||
*/
|
||||
export const upload =api.common+'/upload/file';
|
||||
|
||||
export const upload = api.common + "/common/upload/file";
|
||||
|
||||
@@ -15,7 +15,7 @@ const request = http.request;
|
||||
*/
|
||||
export function webConnect(code) {
|
||||
return http.request({
|
||||
url: `connect/login/web/${code}`,
|
||||
url: `passport/connect/connect/login/web/${code}`,
|
||||
method: Method.GET,
|
||||
needToken: true,
|
||||
header: {
|
||||
@@ -25,7 +25,7 @@ export function webConnect(code) {
|
||||
}
|
||||
export function openIdLogin(params, clientType) {
|
||||
return http.request({
|
||||
url: `connect/app/login`,
|
||||
url: `passport/connect/connect/app/login`,
|
||||
method: Method.GET,
|
||||
needToken: true,
|
||||
data: params,
|
||||
@@ -40,7 +40,7 @@ export function openIdLogin(params, clientType) {
|
||||
*/
|
||||
export function loginCallback(state) {
|
||||
return http.request({
|
||||
url: `connect/result?state=${state}`,
|
||||
url: `passport/connect/connect/result?state=${state}`,
|
||||
method: Method.GET,
|
||||
needToken: false
|
||||
});
|
||||
@@ -54,7 +54,7 @@ export function loginCallback(state) {
|
||||
*/
|
||||
export function mpAutoLogin(params) {
|
||||
return http.request({
|
||||
url: 'mini-program/auto-login',
|
||||
url: 'passport/connect/miniProgram/auto-login',
|
||||
method: Method.GET,
|
||||
params
|
||||
});
|
||||
|
||||
26
api/goods.js
26
api/goods.js
@@ -9,7 +9,7 @@ import { http, Method } from "@/utils/request.js";
|
||||
*/
|
||||
export function getGoodsMessage(goodsId) {
|
||||
return http.request({
|
||||
url: `/goods/get/${goodsId}`,
|
||||
url: `/goods/goods/get/${goodsId}`,
|
||||
method: Method.GET,
|
||||
});
|
||||
}
|
||||
@@ -19,7 +19,7 @@ import { http, Method } from "@/utils/request.js";
|
||||
*/
|
||||
export function getGoodsRelated(params) {
|
||||
return http.request({
|
||||
url: `/goods/es/related`,
|
||||
url: `/goods/goods/es/related`,
|
||||
method: Method.GET,
|
||||
params,
|
||||
});
|
||||
@@ -32,7 +32,7 @@ export function getGoodsRelated(params) {
|
||||
*/
|
||||
export function getGoods(skuId, goodsId) {
|
||||
return http.request({
|
||||
url: `/goods/sku/${goodsId}/${skuId}`,
|
||||
url: `/goods/goods/sku/${goodsId}/${skuId}`,
|
||||
method: Method.GET,
|
||||
});
|
||||
}
|
||||
@@ -43,7 +43,7 @@ export function getGoodsRelated(params) {
|
||||
*/
|
||||
export function getGoodsDistribution(distributionId) {
|
||||
return http.request({
|
||||
url: `/distribution/bindingDistribution/${distributionId}`,
|
||||
url: `/distribution/distribution/bindingDistribution/${distributionId}`,
|
||||
method: Method.GET,
|
||||
});
|
||||
}
|
||||
@@ -56,7 +56,7 @@ export function getGoodsRelated(params) {
|
||||
*/
|
||||
export function getGoodsList(params) {
|
||||
return http.request({
|
||||
url: "/goods/es",
|
||||
url: "/goods/goods/es",
|
||||
method: Method.GET,
|
||||
params,
|
||||
});
|
||||
@@ -112,7 +112,7 @@ export function getPlateformTagGoods(tag_id) {
|
||||
*/
|
||||
export function getCategoryList(id) {
|
||||
return http.request({
|
||||
url: `/category/get/${id}`,
|
||||
url: `/goods/category/get/${id}`,
|
||||
method: Method.GET,
|
||||
loading: false,
|
||||
});
|
||||
@@ -126,7 +126,7 @@ export function getCategoryList(id) {
|
||||
*/
|
||||
export function distribution() {
|
||||
return http.request({
|
||||
url: `/distribution`,
|
||||
url: `/distribution/distribution`,
|
||||
method: Method.GET,
|
||||
});
|
||||
}
|
||||
@@ -136,7 +136,7 @@ export function distribution() {
|
||||
*/
|
||||
export function applyDistribution(params) {
|
||||
return http.request({
|
||||
url: `/distribution`,
|
||||
url: `/distribution/distribution`,
|
||||
method: Method.POST,
|
||||
params,
|
||||
});
|
||||
@@ -170,7 +170,7 @@ export function cashLog(params) {
|
||||
*/
|
||||
export function distributionOrderList(params) {
|
||||
return http.request({
|
||||
url: `/distribution/distributionOrder`,
|
||||
url: `/distribution/distribution/distributionOrder`,
|
||||
method: Method.GET,
|
||||
params
|
||||
});
|
||||
@@ -181,7 +181,7 @@ export function distributionOrderList(params) {
|
||||
*/
|
||||
export function distributionGoods(params) {
|
||||
return http.request({
|
||||
url: `/distributionGoods`,
|
||||
url: `/distribution/goods`,
|
||||
method: Method.GET,
|
||||
params,
|
||||
});
|
||||
@@ -191,7 +191,7 @@ export function distributionGoods(params) {
|
||||
*/
|
||||
export function checkedDistributionGoods(params) {
|
||||
return http.request({
|
||||
url: `/distributionGoods/checked/${params.id}`,
|
||||
url: `/distribution/goods/checked/${params.id}`,
|
||||
method: Method.GET,
|
||||
params
|
||||
});
|
||||
@@ -202,7 +202,7 @@ export function checkedDistributionGoods(params) {
|
||||
*/
|
||||
export function getMpCode(params){
|
||||
return http.request({
|
||||
url:`/mini-program/mp/unlimited`,
|
||||
url:`/passport/connect/miniProgram/mp/unlimited`,
|
||||
method:Method.GET,
|
||||
params
|
||||
})
|
||||
@@ -213,7 +213,7 @@ export function checkedDistributionGoods(params) {
|
||||
*/
|
||||
export function getMpScene(id){
|
||||
return http.request({
|
||||
url:`/mini-program/mp/unlimited/scene?id=${id}`,
|
||||
url:`/passport/connect/miniProgram/mp/unlimited/scene?id=${id}`,
|
||||
method:Method.GET,
|
||||
|
||||
})
|
||||
|
||||
23
api/home.js
23
api/home.js
@@ -1,6 +1,21 @@
|
||||
import { http, Method } from "@/utils/request.js";
|
||||
|
||||
|
||||
export function toSpecial(data) {
|
||||
return http.request({
|
||||
url: `/other/pageData/getSpecial`,
|
||||
method: Method.GET,
|
||||
data
|
||||
});
|
||||
}
|
||||
/**
|
||||
* 专题内容
|
||||
*/
|
||||
export function getSpecial(id) {
|
||||
return http.request({
|
||||
url: `/other/pageData/get/${id}`,
|
||||
method: Method.GET,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取广告图
|
||||
@@ -32,7 +47,7 @@ export function getCategory(parent_id = 0) {
|
||||
*/
|
||||
export function getHotKeywords(count) {
|
||||
return http.request({
|
||||
url: "/goods/hot-words",
|
||||
url: "/goods/goods/hot-words",
|
||||
method: Method.GET,
|
||||
loading: false,
|
||||
params: { count },
|
||||
@@ -46,7 +61,7 @@ export function getHotKeywords(count) {
|
||||
*/
|
||||
export function getFloorData() {
|
||||
return http.request({
|
||||
url: `/pageData/getIndex?clientType=H5`,
|
||||
url: `/other/pageData/getIndex?clientType=H5`,
|
||||
method: "get",
|
||||
});
|
||||
}
|
||||
@@ -56,7 +71,7 @@ export function getFloorData() {
|
||||
*/
|
||||
export function getCategoryIndexData(parentId = 0) {
|
||||
return http.request({
|
||||
url: `/category/get/${parentId}`,
|
||||
url: `/goods/category/get/${parentId}`,
|
||||
method: "get",
|
||||
});
|
||||
}
|
||||
|
||||
46
api/login.js
46
api/login.js
@@ -8,19 +8,36 @@ import api from "@/config/api.js";
|
||||
*/
|
||||
export function resetByMobile(params) {
|
||||
return http.request({
|
||||
url: `/members/resetByMobile`,
|
||||
url: `/passport/member/resetByMobile`,
|
||||
method: "POST",
|
||||
params,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 账号密码登陆
|
||||
* @params password
|
||||
* @params username
|
||||
*/
|
||||
export function userLogin(params){
|
||||
return http.request({
|
||||
method: "POST",
|
||||
url:`/passport/member/userLogin`,
|
||||
data: params,
|
||||
header: {
|
||||
"content-type": "application/x-www-form-urlencoded",
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 发送验证码
|
||||
* @param mobile
|
||||
*/
|
||||
export function sendMobile(mobile,type='LOGIN') {
|
||||
return http.request({
|
||||
url: `${api.common}/sms/${type}/${mobile}`,
|
||||
url: `${api.common}/common/sms/${type}/${mobile}`,
|
||||
method: "GET",
|
||||
});
|
||||
}
|
||||
@@ -32,7 +49,7 @@ export function sendMobile(mobile,type='LOGIN') {
|
||||
*/
|
||||
export function smsLogin(params, clientType) {
|
||||
return http.request({
|
||||
url: `/members/smsLogin`,
|
||||
url: `/passport/member/smsLogin`,
|
||||
method: "POST",
|
||||
data: params,
|
||||
header: {
|
||||
@@ -50,7 +67,7 @@ export function smsLogin(params, clientType) {
|
||||
|
||||
export function modifyPass(params) {
|
||||
return http.request({
|
||||
url: `/members/modifyPass`,
|
||||
url: `/passport/member/modifyPass`,
|
||||
method: "PUT",
|
||||
params,
|
||||
});
|
||||
@@ -61,7 +78,7 @@ export function modifyPass(params) {
|
||||
*/
|
||||
export function refreshTokenFn(refresh_token) {
|
||||
return http.request({
|
||||
url: `/members/refresh/${refresh_token}`,
|
||||
url: `/passport/member/refresh/${refresh_token}`,
|
||||
method: "GET",
|
||||
});
|
||||
}
|
||||
@@ -69,8 +86,25 @@ export function refreshTokenFn(refresh_token) {
|
||||
// 获取密码状态
|
||||
export function logout () {
|
||||
return http.request({
|
||||
url: '/members/logout',
|
||||
url: '/passport/member/logout',
|
||||
method: "POST",
|
||||
needToken: true,
|
||||
})
|
||||
}
|
||||
|
||||
export function scannerCodeLogin(params){
|
||||
return http.request({
|
||||
url: '/passport/member/app_scanner',
|
||||
method: "POST",
|
||||
params,
|
||||
needToken: true,
|
||||
});
|
||||
}
|
||||
export function scannerCodeLoginConfirm(params){
|
||||
return http.request({
|
||||
url: '/passport/member/app_confirm',
|
||||
method: "POST",
|
||||
params,
|
||||
needToken: true,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ import { http, Method } from "@/utils/request.js";
|
||||
*/
|
||||
export function feedBack(params) {
|
||||
return http.request({
|
||||
url: "/feedback",
|
||||
url: "/other/feedback",
|
||||
method: Method.POST,
|
||||
needToken: true,
|
||||
params,
|
||||
@@ -16,7 +16,7 @@ export function feedBack(params) {
|
||||
// 提现
|
||||
export function withdrawalApply(params) {
|
||||
return http.request({
|
||||
url: "/members/wallet/withdrawal",
|
||||
url: "/wallet/wallet/withdrawal",
|
||||
method: Method.POST,
|
||||
needToken: true,
|
||||
params,
|
||||
@@ -30,7 +30,7 @@ export function withdrawalApply(params) {
|
||||
*/
|
||||
export function payCallback(params) {
|
||||
return http.request({
|
||||
url: `/cashier/result`,
|
||||
url: `/payment/cashier/result`,
|
||||
method: Method.GET,
|
||||
params,
|
||||
});
|
||||
@@ -117,7 +117,7 @@ export function getPointsData(params) {
|
||||
*/
|
||||
export function getComments(params) {
|
||||
return http.request({
|
||||
url: "/memberEvaluation",
|
||||
url: "/member/evaluation",
|
||||
method: Method.GET,
|
||||
needToken: true,
|
||||
params,
|
||||
@@ -131,7 +131,7 @@ export function getComments(params) {
|
||||
*/
|
||||
export function getFootprintNum(params) {
|
||||
return http.request({
|
||||
url: "/footprint/getFootprintNum",
|
||||
url: "/member/footprint/getFootprintNum",
|
||||
method: Method.GET,
|
||||
needToken: true,
|
||||
params,
|
||||
@@ -144,7 +144,7 @@ export function getFootprintNum(params) {
|
||||
*/
|
||||
export function commentsMemberOrder(params) {
|
||||
return http.request({
|
||||
url: "/memberEvaluation",
|
||||
url: "/member/evaluation",
|
||||
method: Method.POST,
|
||||
needToken: true,
|
||||
header: { "content-type": "application/x-www-form-urlencoded" },
|
||||
@@ -275,7 +275,7 @@ export function collectionStore(store_id) {
|
||||
*/
|
||||
export function getUserInfo() {
|
||||
return http.request({
|
||||
url: "/members",
|
||||
url: "/passport/member",
|
||||
method: Method.GET,
|
||||
needToken: true,
|
||||
});
|
||||
@@ -287,7 +287,7 @@ export function getUserInfo() {
|
||||
*/
|
||||
export function getUserWallet() {
|
||||
return http.request({
|
||||
url: "/members/wallet",
|
||||
url: "/wallet/wallet",
|
||||
method: Method.GET,
|
||||
needToken: true,
|
||||
});
|
||||
@@ -300,7 +300,7 @@ export function getUserWallet() {
|
||||
*/
|
||||
export function saveUserInfo(params) {
|
||||
return http.request({
|
||||
url: "/members/editOwn",
|
||||
url: "/passport/member/editOwn",
|
||||
method: Method.PUT,
|
||||
header: { "content-type": "application/x-www-form-urlencoded" },
|
||||
needToken: true,
|
||||
@@ -328,7 +328,7 @@ export function addReceipt(params) {
|
||||
*/
|
||||
export function getGoodsComments(goodsId, params) {
|
||||
return http.request({
|
||||
url: `/memberEvaluation/${goodsId}/goodsEvaluation`,
|
||||
url: `/member/evaluation/${goodsId}/goodsEvaluation`,
|
||||
method: Method.GET,
|
||||
loading: false,
|
||||
params,
|
||||
@@ -341,7 +341,7 @@ export function getGoodsComments(goodsId, params) {
|
||||
*/
|
||||
export function getGoodsCommentsCount(goodsId) {
|
||||
return http.request({
|
||||
url: `/memberEvaluation/${goodsId}/evaluationNumber`,
|
||||
url: `/member/evaluation/${goodsId}/evaluationNumber`,
|
||||
method: Method.GET,
|
||||
loading: false,
|
||||
});
|
||||
@@ -365,7 +365,7 @@ export function getNoReadMessageNum() {
|
||||
*/
|
||||
export function myTrackList(params) {
|
||||
return http.request({
|
||||
url: `/footprint`,
|
||||
url: `/member/footprint`,
|
||||
method: Method.GET,
|
||||
needToken: true,
|
||||
params,
|
||||
@@ -378,7 +378,7 @@ export function myTrackList(params) {
|
||||
*/
|
||||
export function deleteHistoryListId(ids) {
|
||||
return http.request({
|
||||
url: `/footprint/delByIds/${ids}`,
|
||||
url: `/member/footprint/delByIds/${ids}`,
|
||||
method: Method.DELETE,
|
||||
needToken: true,
|
||||
});
|
||||
|
||||
@@ -14,7 +14,7 @@ import api from '@/config/api.js';
|
||||
*/
|
||||
export function getWeChatMpMessage() {
|
||||
return http.request({
|
||||
url: 'mini-program/subscribeMessage',
|
||||
url: 'passport/connect/miniProgram/subscribeMessage',
|
||||
method: Method.GET
|
||||
});
|
||||
}
|
||||
@@ -48,6 +48,24 @@ export function messageMarkAsRead(ids) {
|
||||
});
|
||||
}
|
||||
|
||||
//读取站内消息
|
||||
export function editMessages(message_id,params){
|
||||
return http.request({
|
||||
url:`/message/member/${message_id}`,
|
||||
method:Method.PUT,
|
||||
needToken:true,
|
||||
params
|
||||
})
|
||||
}
|
||||
//获取站内消息
|
||||
export function messages(params) {
|
||||
return http.request({
|
||||
url: "/message/member",
|
||||
method: Method.GET,
|
||||
needToken: true,
|
||||
params,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取物流消息列表
|
||||
@@ -73,7 +91,7 @@ export function getLogisticsMessages(params) {
|
||||
*/
|
||||
export function getAppVersion(appType) {
|
||||
return http.request({
|
||||
url: `/appVersion/${appType}`,
|
||||
url: `/other/appVersion/${appType}`,
|
||||
method: Method.GET,
|
||||
type:"manager"
|
||||
});
|
||||
@@ -86,7 +104,7 @@ export function getLogisticsMessages(params) {
|
||||
*/
|
||||
export function getAppVersionList(type,data) {
|
||||
return http.request({
|
||||
url: `/appVersion/appVersion/${type}`,
|
||||
url: `/other/appVersion/appVersion/${type}`,
|
||||
method: Method.GET,
|
||||
type:"manager",
|
||||
data
|
||||
|
||||
@@ -51,7 +51,7 @@ export function selectedShipMethod(params) {
|
||||
*/
|
||||
export function getOrderList(params) {
|
||||
return http.request({
|
||||
url: "/orders",
|
||||
url: "/order/order",
|
||||
method: Method.GET,
|
||||
needToken: true,
|
||||
params,
|
||||
@@ -64,7 +64,7 @@ export function getOrderList(params) {
|
||||
*/
|
||||
export function getOrderDetail(orderSn) {
|
||||
return http.request({
|
||||
url: `/orders/${orderSn}`,
|
||||
url: `/order/order/${orderSn}`,
|
||||
method: Method.GET,
|
||||
needToken: true,
|
||||
});
|
||||
@@ -77,7 +77,7 @@ export function getOrderDetail(orderSn) {
|
||||
*/
|
||||
export function cancelOrder(orderSn, reason) {
|
||||
return http.request({
|
||||
url: `/orders/${orderSn}/cancel`,
|
||||
url: `/order/order/${orderSn}/cancel`,
|
||||
method: Method.POST,
|
||||
needToken: true,
|
||||
header: { "content-type": "application/x-www-form-urlencoded" },
|
||||
@@ -91,7 +91,7 @@ export function cancelOrder(orderSn, reason) {
|
||||
*/
|
||||
export function confirmReceipt(orderSn) {
|
||||
return http.request({
|
||||
url: `/orders/${orderSn}/receiving`,
|
||||
url: `/order/order/${orderSn}/receiving`,
|
||||
method: Method.POST,
|
||||
needToken: true,
|
||||
});
|
||||
|
||||
11
api/store.js
11
api/store.js
@@ -4,11 +4,14 @@
|
||||
|
||||
import {http, Method} from '@/utils/request.js';
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 获取店铺列表
|
||||
* @param params
|
||||
*/
|
||||
export function getstoreList(params) {
|
||||
export function getStoreList(params) {
|
||||
return http.request({
|
||||
url: '/store',
|
||||
method: Method.GET,
|
||||
@@ -22,7 +25,7 @@ export function getstoreList(params) {
|
||||
*/
|
||||
export function getStoreBaseInfo(storeId) {
|
||||
return http.request({
|
||||
url: `/store/get/detail/${storeId}`,
|
||||
url: `/store/store/get/detail/${storeId}`,
|
||||
method: Method.GET,
|
||||
loading: false,
|
||||
});
|
||||
@@ -34,7 +37,7 @@ export function getstoreList(params) {
|
||||
*/
|
||||
export function getStoreCategory(id) {
|
||||
return http.request({
|
||||
url: `/store/label/get/${id}`,
|
||||
url: `/store/store/label/get/${id}`,
|
||||
method: Method.GET,
|
||||
});
|
||||
}
|
||||
@@ -46,7 +49,7 @@ export function getstoreList(params) {
|
||||
*/
|
||||
export function getLicencePhoto(id) {
|
||||
return http.request({
|
||||
url: `/store/get/licencePhoto/${id}`,
|
||||
url: `/store/store/get/licencePhoto/${id}`,
|
||||
method: Method.GET,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -177,7 +177,7 @@ export function createTrade(params) {
|
||||
*/
|
||||
export function getCashierData(params) {
|
||||
return http.request({
|
||||
url: "cashier/tradeDetail",
|
||||
url: "payment/cashier/tradeDetail",
|
||||
method: Method.GET,
|
||||
needToken: true,
|
||||
params,
|
||||
@@ -194,7 +194,7 @@ export function getCashierData(params) {
|
||||
*/
|
||||
export function initiatePay(paymentMethod, paymentClient, params) {
|
||||
return http.request({
|
||||
url: `cashier/pay/${paymentMethod}/${paymentClient}`,
|
||||
url: `payment/cashier/pay/${paymentMethod}/${paymentClient}`,
|
||||
method: Method.GET,
|
||||
needToken: true,
|
||||
params,
|
||||
@@ -209,7 +209,7 @@ export function initiatePay(paymentMethod, paymentClient, params) {
|
||||
*/
|
||||
export function getExpress(orderSn) {
|
||||
return http.request({
|
||||
url: `/orders/getTraces/${orderSn}`,
|
||||
url: `/order/order/getTraces/${orderSn}`,
|
||||
method: Method.POST,
|
||||
needToken: true,
|
||||
|
||||
|
||||
@@ -10,38 +10,57 @@
|
||||
:src="selectedSpecImg ? selectedSpecImg : goodsDetail.thumbnail"></u-image>
|
||||
</view>
|
||||
<view class="goods-skus">
|
||||
|
||||
<!-- 有活动商品价格 -->
|
||||
<view class="goods-price " v-if="goodsDetail.promotionPrice">
|
||||
<view class="goods-price"
|
||||
v-if="goodsDetail.promotionPrice && ((isGroup && buyType === 'PINTUAN') || !isGroup)">
|
||||
<span v-if="goodsDetail.promotionPrice && !pointDetail">
|
||||
¥
|
||||
<span
|
||||
class="goods-price-promotionShow goods-price-bigshow">{{ formatPrice(goodsDetail.promotionPrice)[0] }}</span>
|
||||
.{{ formatPrice(goodsDetail.promotionPrice)[1] }}
|
||||
<span class="goods-price-promotionShow goods-price-bigshow">{{
|
||||
$options.filters.goodsFormatPrice(goodsDetail.promotionPrice)[0]
|
||||
}}</span>
|
||||
.{{ $options.filters.goodsFormatPrice(goodsDetail.promotionPrice)[1] }}
|
||||
</span>
|
||||
<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>
|
||||
<div class="promotion-box">
|
||||
¥
|
||||
<span class="goods-price-bigshow">{{
|
||||
formatPrice(goodsDetail.price)[0]
|
||||
$options.filters.goodsFormatPrice(goodsDetail.price)[0]
|
||||
}}</span>
|
||||
.{{ formatPrice(goodsDetail.price)[1] }}
|
||||
|
||||
.{{ $options.filters.goodsFormatPrice(goodsDetail.price)[1] }}
|
||||
</div>
|
||||
</view>
|
||||
<!-- 正常商品的价格 -->
|
||||
<view class="goods-price" v-else>
|
||||
<view v-else>
|
||||
|
||||
<!-- 批发价格 -->
|
||||
<div class='price-row flex' v-if="goodsDetail.salesModel === 'WHOLESALE'">
|
||||
<div class='goods-price' v-for="(item,index) in wholesaleList" :key="index">
|
||||
<span>
|
||||
¥
|
||||
<span class="goods-price-bigshow">{{
|
||||
formatPrice(goodsDetail.price)[0]
|
||||
$options.filters.goodsFormatPrice(item.price)[0]
|
||||
}}</span>
|
||||
.{{ formatPrice(goodsDetail.price)[1] }}
|
||||
|
||||
.{{ $options.filters.goodsFormatPrice(item.price)[1] }}
|
||||
</span>
|
||||
<span class='wholesale-item'>
|
||||
{{item.num}}{{goodsDetail.goodsUnit}}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="goods-price" v-else>
|
||||
<span>
|
||||
¥
|
||||
<span class="goods-price-bigshow">{{
|
||||
$options.filters.goodsFormatPrice(goodsDetail.price)[0]
|
||||
}}</span>
|
||||
.{{ $options.filters.goodsFormatPrice(goodsDetail.price)[1] }}
|
||||
</span>
|
||||
</div>
|
||||
</view>
|
||||
<view class="goods-check-skus">
|
||||
已选
|
||||
@@ -50,6 +69,12 @@
|
||||
<span>,{{ num }}个</span>
|
||||
</span>
|
||||
</view>
|
||||
<view class="goods-check-skus">
|
||||
库存
|
||||
<span class="goods-check-skus-name">
|
||||
<span>{{ goodsDetail.quantity }}</span>
|
||||
</span>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 商品信息 -->
|
||||
@@ -59,30 +84,29 @@
|
||||
<view class="skus-view-list">
|
||||
<view class="view-class-title">{{ spec.name }}</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" :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"
|
||||
<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>
|
||||
@click="handleClickSpec(spec, specIndex, spec_val)">{{ spec_val.value }}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 数量 -->
|
||||
<view class="goods-skus-number">
|
||||
<view class="goods-skus-number flex flex-a-c flex-j-sb">
|
||||
<view class="view-class-title">数量</view>
|
||||
<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-input class="view-class-input" v-model="num" type="number" />
|
||||
</view>
|
||||
</scroll-view>
|
||||
<!-- 按钮 -->
|
||||
<view class="btns">
|
||||
|
||||
<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>
|
||||
@@ -100,14 +124,7 @@ export default {
|
||||
return {
|
||||
setup,
|
||||
num: 1,
|
||||
// 步进器的大小尺寸单位是 rpx
|
||||
numberBox: {
|
||||
width: "50",
|
||||
height: "50",
|
||||
size: "22",
|
||||
color: "#333",
|
||||
bgColor: "#fff",
|
||||
},
|
||||
|
||||
selectName: "", //选中商品的昵称
|
||||
selectSkuList: "", //选中商铺sku,
|
||||
selectedSpecImg: "", //选中的图片路径
|
||||
@@ -117,13 +134,22 @@ export default {
|
||||
currentSelceted: [],
|
||||
skuList: "",
|
||||
isClose: false, //是否可以点击遮罩关闭
|
||||
|
||||
};
|
||||
},
|
||||
props: {
|
||||
wholesaleList:{
|
||||
type: null,
|
||||
default: false,
|
||||
},
|
||||
buyMask: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
isGroup: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
goodsDetail: {
|
||||
default: "",
|
||||
type: null,
|
||||
@@ -143,12 +169,29 @@ export default {
|
||||
pointDetail: {
|
||||
default: "",
|
||||
type: null,
|
||||
},
|
||||
},
|
||||
computed: {
|
||||
wholesalePrice(key){
|
||||
return this.wholesaleList.length ? this.wholesaleList.map(item=>{ return item.price }) :[]
|
||||
},
|
||||
wholesaleNum(key){
|
||||
return this.wholesaleList.length ? this.wholesaleList.map(item=>{ return item.num }) :[]
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
num(val){
|
||||
if(val){
|
||||
if(val > this.goodsDetail.quantity){
|
||||
this.val = this.goodsDetail.quantity
|
||||
}
|
||||
}
|
||||
},
|
||||
buyType: {
|
||||
handler(val) {
|
||||
if (val) {
|
||||
this.buyType = val;
|
||||
}
|
||||
},
|
||||
immediate: true,
|
||||
},
|
||||
@@ -161,16 +204,6 @@ export default {
|
||||
},
|
||||
|
||||
methods: {
|
||||
|
||||
|
||||
// 格式化金钱 1999 --> [1999,00]
|
||||
formatPrice(val) {
|
||||
if (typeof val == "undefined") {
|
||||
return val;
|
||||
}
|
||||
return val.toFixed(2).split(".");
|
||||
},
|
||||
|
||||
closeMask() {
|
||||
this.$emit("closeBuy", false);
|
||||
},
|
||||
@@ -232,7 +265,6 @@ export default {
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* 添加到购物车或购买
|
||||
*/
|
||||
@@ -276,9 +308,7 @@ export default {
|
||||
uni.navigateTo({
|
||||
url: `/pages/order/fillorder?way=${data.cartType}&addr=${
|
||||
this.addr.id || ""
|
||||
}&parentOrder=${encodeURIComponent(
|
||||
JSON.stringify(this.parentOrder)
|
||||
)}`,
|
||||
}&parentOrder=${encodeURIComponent(JSON.stringify(this.parentOrder))}`,
|
||||
});
|
||||
}
|
||||
});
|
||||
@@ -286,8 +316,11 @@ export default {
|
||||
},
|
||||
formatSku(list) {
|
||||
// 格式化数据
|
||||
console.log(list);
|
||||
let arr = [{}];
|
||||
|
||||
if (!Array.isArray(list)) {
|
||||
return false
|
||||
}
|
||||
list.forEach((item, index) => {
|
||||
item.specValues.forEach((spec, specIndex) => {
|
||||
let name = spec.specName;
|
||||
@@ -315,7 +348,6 @@ export default {
|
||||
return key.name;
|
||||
});
|
||||
if (!keys.includes(name)) {
|
||||
console.log(name, values);
|
||||
arr.push({
|
||||
name: name,
|
||||
values: [values],
|
||||
@@ -358,7 +390,10 @@ export default {
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
@import "./popup.scss";
|
||||
.price-row{
|
||||
text-align: center;
|
||||
|
||||
}
|
||||
.buy {
|
||||
background-image: linear-gradient(135deg, #ffba0d, #ffc30d 69%, #ffcf0d);
|
||||
box-shadow: 0 2px 6px 0 rgba(255, 65, 66, 0.2);
|
||||
@@ -379,6 +414,13 @@ export default {
|
||||
.goods-skus-number {
|
||||
justify-content: space-between;
|
||||
display: flex;
|
||||
|
||||
>.view-class-title{
|
||||
flex: 8;
|
||||
}
|
||||
>.view-class-input{
|
||||
flex:1
|
||||
}
|
||||
}
|
||||
|
||||
/deep/ .uni-scroll-view {
|
||||
@@ -424,6 +466,13 @@ export default {
|
||||
}
|
||||
}
|
||||
}
|
||||
.wholesale-item{
|
||||
color: #999 !important;
|
||||
font-size: 24rpx;
|
||||
margin:0 20rpx;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.goods-header {
|
||||
height: 200rpx;
|
||||
@@ -443,8 +492,14 @@ export default {
|
||||
.goods-price {
|
||||
color: $price-color;
|
||||
line-height: 80rpx;
|
||||
display: flex;
|
||||
margin-right: 20rpx;
|
||||
>* {
|
||||
color: $price-color;
|
||||
line-height: 80rpx;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
.promotion-box {
|
||||
line-height: 1;
|
||||
display: flex;
|
||||
@@ -452,22 +507,28 @@ export default {
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -200,7 +200,7 @@ export default {
|
||||
this.tabCurrentIndex++;
|
||||
|
||||
// 当前距离重新为最上面
|
||||
this.scrollTop = 0;
|
||||
this.$set(this,'scrollTop',0)
|
||||
}
|
||||
} else {
|
||||
this.$emit("funcValue", this.tabbars);
|
||||
|
||||
11
components/m-goods-list/README.md
Normal file
11
components/m-goods-list/README.md
Normal file
@@ -0,0 +1,11 @@
|
||||
## 商品列表展示
|
||||
|
||||
### OBJECT 参数说明
|
||||
|
||||
| 属性 | 说明 | 类型 | 必填 |
|
||||
| ----------- | ---------------------------------------------------------- | ------- | ---- |
|
||||
| `res` | 显示数据 | Array | 是 |
|
||||
| `type` | 商品展示类型 oneColumns twoColumns ,默认展示一行两列商品 | String | 否 |
|
||||
| `storeName` | 是否展示店铺名称,默认展示 | Boolean | 否 |
|
||||
| `keywords` | 高亮展示搜索内容 | String | 否 |
|
||||
|
||||
276
components/m-goods-list/base-list.vue
Normal file
276
components/m-goods-list/base-list.vue
Normal file
@@ -0,0 +1,276 @@
|
||||
<template>
|
||||
<div>
|
||||
<!-- 一行两列商品展示 -->
|
||||
<view class="goods-list" v-if="type == 'twoColumns'">
|
||||
<view v-for="(item, index) in res" :key="index" class="goods-item">
|
||||
<view class="image-wrapper" @click="navigateToDetailPage(item)">
|
||||
<u-image
|
||||
:src="item.thumbnail"
|
||||
width="100%"
|
||||
height="330rpx"
|
||||
mode="aspectFill"
|
||||
>
|
||||
<u-loading slot="loading"></u-loading>
|
||||
</u-image>
|
||||
</view>
|
||||
<view class="goods-detail">
|
||||
<div
|
||||
class="title clamp"
|
||||
v-html="lightSearchStr(keyword, item.goodsName)"
|
||||
@click="navigateToDetailPage(item)"
|
||||
></div>
|
||||
<view class="price-box" @click="navigateToDetailPage(item)">
|
||||
<div class="price" v-if="item.price != undefined">
|
||||
¥<span
|
||||
>{{
|
||||
$options.filters.goodsFormatPrice(item.price)[0]
|
||||
}} </span
|
||||
>.{{ $options.filters.goodsFormatPrice(item.price)[1] }}
|
||||
</div>
|
||||
</view>
|
||||
<div class="count-config" @click="navigateToDetailPage(item)">
|
||||
<span>已售 {{ item.buyCount || "0" }}</span>
|
||||
<span>{{ item.commentNum || "0" }}条评论</span>
|
||||
</div>
|
||||
<div
|
||||
class="store-seller-name"
|
||||
v-if="storeName"
|
||||
@click="navigateToStoreDetailPage(item)"
|
||||
>
|
||||
<div class="text-hidden">
|
||||
<u-tag
|
||||
style="margin-right: 10rpx"
|
||||
size="mini"
|
||||
mode="dark"
|
||||
v-if="item.selfOperated"
|
||||
text="自营"
|
||||
type="error"
|
||||
/>
|
||||
<span>{{ item.storeName || "暂无" }}</span>
|
||||
</div>
|
||||
<span>
|
||||
<u-icon name="arrow-right"></u-icon>
|
||||
</span>
|
||||
</div>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 一行一列商品展示 -->
|
||||
<div v-if="type == 'oneColumns'">
|
||||
<div v-for="(item, index) in res" :key="index" class="goods-row">
|
||||
<div class="flex goods-col">
|
||||
<div class="goods-img" @click="navigateToDetailPage(item)">
|
||||
<u-image
|
||||
width="230rpx"
|
||||
border-radius="16"
|
||||
height="230rpx"
|
||||
:src="item.goodsImage || item.thumbnail"
|
||||
>
|
||||
<u-loading slot="loading"></u-loading>
|
||||
</u-image>
|
||||
</div>
|
||||
<div class="goods-detail">
|
||||
<div class="title clamp3" @click="navigateToDetailPage(item)">
|
||||
{{ item.goodsName }}
|
||||
</div>
|
||||
<view class="price-box" @click="navigateToDetailPage(item)">
|
||||
<div class="price" v-if="item.price != undefined">
|
||||
¥<span
|
||||
>{{ $options.filters.goodsFormatPrice(item.price)[0] }} </span
|
||||
>.{{ $options.filters.goodsFormatPrice(item.price)[1] }}
|
||||
</div>
|
||||
</view>
|
||||
<div class="promotion" @click="navigateToDetailPage(item)">
|
||||
<div v-if="item.salesModel == 'WHOLESALE'">
|
||||
<span>批</span>
|
||||
</div>
|
||||
<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
|
||||
style="overflow: hidden"
|
||||
@click="navigateToDetailPage(item)"
|
||||
class="count-config"
|
||||
>
|
||||
<span style="float: left; font-size: 22rpx"
|
||||
>已售 {{ item.buyCount || "0" }}</span
|
||||
>
|
||||
<span style="float: right; font-size: 22rpx"
|
||||
>{{ item.commentNum || "0" }}条评论</span
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import commonTpl from "@/components/m-goods-list/common";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
lightColor: this.$mainColor,
|
||||
};
|
||||
},
|
||||
mixins: [commonTpl],
|
||||
props: {
|
||||
// 展示的类型
|
||||
type:{
|
||||
type:String,
|
||||
default:"oneColumns"
|
||||
},
|
||||
// 遍历的数据
|
||||
res: {
|
||||
type: Array,
|
||||
default: () => {
|
||||
return [];
|
||||
},
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
// 跳转到商品详情
|
||||
navigateToDetailPage(item) {
|
||||
uni.navigateTo({
|
||||
url: `/pages/product/goods?id=${item.id}&goodsId=${item.goodsId}`,
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.goods-list {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
margin: 10rpx 20rpx 284rpx;
|
||||
width: 100%;
|
||||
|
||||
> .goods-item {
|
||||
background-color: #ffffff;
|
||||
display: flex;
|
||||
border-radius: 16rpx;
|
||||
flex-direction: column;
|
||||
width: calc(50% - 30rpx);
|
||||
margin-bottom: 20rpx;
|
||||
padding-bottom: 20rpx;
|
||||
|
||||
&:nth-child(2n + 1) {
|
||||
margin-right: 20rpx;
|
||||
}
|
||||
|
||||
.image-wrapper {
|
||||
width: 100%;
|
||||
height: 330rpx;
|
||||
border-radius: 16rpx 16rpx 0 0;
|
||||
overflow: hidden;
|
||||
padding: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.count-config,
|
||||
.store-seller-name {
|
||||
font-size: $font-sm;
|
||||
}
|
||||
|
||||
.text-hidden {
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
}
|
||||
|
||||
.goods-row {
|
||||
background: #fff;
|
||||
padding: 16rpx;
|
||||
|
||||
> .goods-col {
|
||||
display: flex;
|
||||
|
||||
> .goods-img {
|
||||
overflow: hidden;
|
||||
flex: 4;
|
||||
}
|
||||
|
||||
> .goods-detail {
|
||||
flex: 7;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.goods-detail {
|
||||
margin: 0 20rpx;
|
||||
|
||||
> .title {
|
||||
font-size: $font-base;
|
||||
color: $font-color-dark;
|
||||
line-height: 1.5;
|
||||
height: 86rpx;
|
||||
padding: 10rpx 0 0;
|
||||
display: -webkit-box;
|
||||
-webkit-box-orient: vertical;
|
||||
-webkit-line-clamp: 2;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.promotion {
|
||||
margin-top: 4rpx;
|
||||
display: flex;
|
||||
|
||||
div {
|
||||
span {
|
||||
font-size: 24rpx;
|
||||
color: $light-color;
|
||||
margin-right: 10rpx;
|
||||
padding: 0 4rpx;
|
||||
border-radius: 2rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.store-seller-name {
|
||||
color: #666;
|
||||
overflow: hidden;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.count-config {
|
||||
padding: 5rpx 0;
|
||||
color: #666;
|
||||
display: flex;
|
||||
font-size: 24rpx;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
> .price-box {
|
||||
margin-top: 10rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding-right: 10rpx;
|
||||
font-size: 24rpx;
|
||||
color: $font-color-light;
|
||||
|
||||
> .price {
|
||||
font-size: 26rpx;
|
||||
line-height: 1;
|
||||
color: $main-color;
|
||||
font-weight: bold;
|
||||
|
||||
/deep/ span:nth-of-type(1) {
|
||||
font-size: 38rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
69
components/m-goods-list/common.vue
Normal file
69
components/m-goods-list/common.vue
Normal file
@@ -0,0 +1,69 @@
|
||||
<template>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
methods: {
|
||||
// 高亮显示搜索内容
|
||||
lightSearchStr(keyword, str) {
|
||||
if (!keyword) {
|
||||
return str
|
||||
} else {
|
||||
let unicodes = '';
|
||||
for (let i of Array.from(keyword)) {
|
||||
unicodes += this.unicode(i) + "|"
|
||||
}
|
||||
const rule = '(' + unicodes + ')'
|
||||
const reg = new RegExp(rule, 'gi');
|
||||
return str ? str.replace(reg, matchValue =>
|
||||
`<span style="color:${this.lightColor}">${matchValue}</span>`
|
||||
) : ''
|
||||
}
|
||||
},
|
||||
// 转换为unicode
|
||||
unicode(str) {
|
||||
var value = '';
|
||||
for (var i = 0; i < str.length; i++) {
|
||||
value += '\\u' + this.left_zero_4(parseInt(str.charCodeAt(i)).toString(16));
|
||||
}
|
||||
return value;
|
||||
},
|
||||
left_zero_4(str) {
|
||||
if (str != null && str != '' && str != 'undefined') {
|
||||
if (str.length == 2) {
|
||||
return '00' + str;
|
||||
}
|
||||
}
|
||||
return str;
|
||||
},
|
||||
// 数据去重一下 只显示一次 减免 劵 什么的
|
||||
getPromotion(item) {
|
||||
if (item.promotionMap) {
|
||||
let array = [];
|
||||
Object.keys(item.promotionMap).forEach((child) => {
|
||||
if (!array.includes(child.split("-")[0])) {
|
||||
array.push(child.split("-")[0]);
|
||||
}
|
||||
});
|
||||
return array;
|
||||
}
|
||||
},
|
||||
// 跳转到商品详情
|
||||
navigateToDetailPage(item) {
|
||||
uni.navigateTo({
|
||||
url: `/pages/product/goods?id=${item.content.id}&goodsId=${item.content.goodsId}`,
|
||||
});
|
||||
},
|
||||
// 跳转地址
|
||||
navigateToStoreDetailPage(item) {
|
||||
uni.navigateTo({
|
||||
url: `/pages/product/shopPage?id=${item.content.storeId}`,
|
||||
});
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang='scss' scoped>
|
||||
|
||||
</style>
|
||||
337
components/m-goods-list/list.vue
Normal file
337
components/m-goods-list/list.vue
Normal file
@@ -0,0 +1,337 @@
|
||||
<template>
|
||||
<view>
|
||||
<!-- 一行两列商品展示 -->
|
||||
<view class="goods-list" v-if="type == 'twoColumns'">
|
||||
<view v-for="(item, index) in res" :key="index" class="goods-item">
|
||||
<view class="image-wrapper" @click="navigateToDetailPage(item)">
|
||||
<u-image :src="item.content.thumbnail" width="100%" height='330rpx' mode="aspectFill">
|
||||
<u-loading slot="loading"></u-loading>
|
||||
</u-image>
|
||||
</view>
|
||||
<view class="goods-detail">
|
||||
<div class="title clamp" v-html="lightSearchStr(keyword,item.content.goodsName)"
|
||||
@click="navigateToDetailPage(item)">
|
||||
|
||||
</div>
|
||||
<view class="price-box" @click="navigateToDetailPage(item)">
|
||||
<div class="price" v-if="item.content.price!=undefined">
|
||||
¥<span>{{ $options.filters.goodsFormatPrice(item.content.price )[0] }} </span>.{{
|
||||
$options.filters.goodsFormatPrice(item.content.price )[1]
|
||||
}}
|
||||
</div>
|
||||
</view>
|
||||
<div class="promotion" @click="navigateToDetailPage(item)">
|
||||
<div v-if="item.content.salesModel == 'WHOLESALE'">
|
||||
<span>批</span>
|
||||
</div>
|
||||
<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 class="count-config" @click="navigateToDetailPage(item)">
|
||||
<span>已售 {{ item.content.buyCount || "0" }}</span>
|
||||
<span>{{ item.content.commentNum || "0" }}条评论</span>
|
||||
</div>
|
||||
<div class="store-seller-name" v-if="storeName" @click="navigateToStoreDetailPage(item)">
|
||||
<div class="text-hidden">
|
||||
<u-tag style="margin-right: 10rpx" size="mini" mode="dark" v-if="item.selfOperated"
|
||||
text="自营" type="error" />
|
||||
<span>{{ item.content.storeName || "暂无" }}</span>
|
||||
</div>
|
||||
<span>
|
||||
<u-icon name="arrow-right"></u-icon>
|
||||
</span>
|
||||
</div>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 一行一列商品展示 -->
|
||||
<div v-if="type == 'oneColumns'">
|
||||
<div v-for="(item, index) in res" :key="index" class="goods-row">
|
||||
<div class="flex goods-col">
|
||||
<div class="goods-img" @click="navigateToDetailPage(item)">
|
||||
<u-image width="230rpx" border-radius='16' height="230rpx" :src="item.content.thumbnail">
|
||||
<u-loading slot="loading"></u-loading>
|
||||
</u-image>
|
||||
</div>
|
||||
<div class="goods-detail">
|
||||
<div class="title clamp3" @click="navigateToDetailPage(item)">{{ item.content.goodsName }}</div>
|
||||
<view class="price-box" @click="navigateToDetailPage(item)">
|
||||
<div class="price" v-if="item.content.price!=undefined">
|
||||
¥<span>{{ $options.filters.goodsFormatPrice(item.content.price )[0] }} </span>.{{
|
||||
$options.filters.goodsFormatPrice(item.content.price )[1]
|
||||
}}
|
||||
</div>
|
||||
</view>
|
||||
<div class="promotion" @click="navigateToDetailPage(item)">
|
||||
<div v-if="item.content.salesModel == 'WHOLESALE'">
|
||||
<span>批</span>
|
||||
</div>
|
||||
<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 style="overflow: hidden" @click="navigateToDetailPage(item)" class="count-config">
|
||||
<span style="float: left; font-size: 22rpx">已售 {{ item.content.buyCount || '0' }}</span>
|
||||
<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" v-if="storeName">
|
||||
<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>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import commonTpl from '@/components/m-goods-list/common'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
lightColor: this.$mainColor
|
||||
}
|
||||
},
|
||||
mixins: [commonTpl],
|
||||
|
||||
props: {
|
||||
// 遍历的数据
|
||||
res: {
|
||||
type: Array,
|
||||
default: () => {
|
||||
return []
|
||||
}
|
||||
},
|
||||
// 一行两列还是一行一列显示
|
||||
type: {
|
||||
type: String,
|
||||
default: 'twoColumns',
|
||||
validator() {
|
||||
return ['twoColumns', 'oneColumns']
|
||||
}
|
||||
},
|
||||
storeName: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
keyword: {
|
||||
type: null,
|
||||
default: ''
|
||||
}
|
||||
|
||||
},
|
||||
watch: {
|
||||
keyword(val) {
|
||||
if (val) {
|
||||
this.lightSearchStr(val)
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
||||
// 高亮显示搜索内容
|
||||
lightSearchStr(keyword, str) {
|
||||
if (!keyword) {
|
||||
return str
|
||||
} else {
|
||||
let unicodes = '';
|
||||
for (let i of Array.from(keyword)) {
|
||||
unicodes += this.unicode(i) + "|"
|
||||
}
|
||||
const rule = '(' + unicodes + ')'
|
||||
const reg = new RegExp(rule, 'gi');
|
||||
return str ? str.replace(reg, matchValue =>
|
||||
`<span style="color:${this.lightColor}">${matchValue}</span>`
|
||||
) : ''
|
||||
}
|
||||
},
|
||||
// 转换为unicode
|
||||
unicode(str) {
|
||||
var value = '';
|
||||
for (var i = 0; i < str.length; i++) {
|
||||
value += '\\u' + this.left_zero_4(parseInt(str.charCodeAt(i)).toString(16));
|
||||
}
|
||||
return value;
|
||||
},
|
||||
left_zero_4(str) {
|
||||
if (str != null && str != '' && str != 'undefined') {
|
||||
if (str.length == 2) {
|
||||
return '00' + str;
|
||||
}
|
||||
}
|
||||
return str;
|
||||
},
|
||||
// 数据去重一下 只显示一次 减免 劵 什么的
|
||||
getPromotion(item) {
|
||||
if (item.promotionMap) {
|
||||
let array = [];
|
||||
Object.keys(item.promotionMap).forEach((child) => {
|
||||
if (!array.includes(child.split("-")[0])) {
|
||||
array.push(child.split("-")[0]);
|
||||
}
|
||||
});
|
||||
return array;
|
||||
}
|
||||
},
|
||||
// 跳转到商品详情
|
||||
navigateToDetailPage(item) {
|
||||
uni.navigateTo({
|
||||
url: `/pages/product/goods?id=${item.content.id}&goodsId=${item.content.goodsId}`,
|
||||
});
|
||||
},
|
||||
// 跳转地址
|
||||
navigateToStoreDetailPage(item) {
|
||||
uni.navigateTo({
|
||||
url: `/pages/product/shopPage?id=${item.content.storeId}`,
|
||||
});
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang='scss' scoped>
|
||||
/* 商品列表 */
|
||||
.goods-list {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
margin: 10rpx 20rpx 284rpx;
|
||||
width: 100%;
|
||||
|
||||
>.goods-item {
|
||||
background-color: #ffffff;
|
||||
display: flex;
|
||||
border-radius: 16rpx;
|
||||
flex-direction: column;
|
||||
width: calc(50% - 30rpx);
|
||||
margin-bottom: 20rpx;
|
||||
padding-bottom: 20rpx;
|
||||
|
||||
&:nth-child(2n + 1) {
|
||||
margin-right: 20rpx;
|
||||
}
|
||||
|
||||
|
||||
.image-wrapper {
|
||||
width: 100%;
|
||||
height: 330rpx;
|
||||
border-radius: 16rpx 16rpx 0 0;
|
||||
overflow: hidden;
|
||||
padding: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.count-config,
|
||||
.store-seller-name {
|
||||
font-size: $font-sm;
|
||||
}
|
||||
|
||||
.text-hidden {
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.goods-row {
|
||||
background: #fff;
|
||||
padding: 16rpx;
|
||||
|
||||
>.goods-col {
|
||||
display: flex;
|
||||
|
||||
>.goods-img {
|
||||
overflow: hidden;
|
||||
flex: 4;
|
||||
}
|
||||
|
||||
>.goods-detail {
|
||||
flex: 7;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.goods-detail {
|
||||
margin: 0 20rpx;
|
||||
|
||||
>.title {
|
||||
font-size: $font-base;
|
||||
color: $font-color-dark;
|
||||
line-height: 1.5;
|
||||
height: 86rpx;
|
||||
padding: 10rpx 0 0;
|
||||
display: -webkit-box;
|
||||
-webkit-box-orient: vertical;
|
||||
-webkit-line-clamp: 2;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.promotion {
|
||||
margin-top: 4rpx;
|
||||
display: flex;
|
||||
|
||||
div {
|
||||
span {
|
||||
font-size: 24rpx;
|
||||
color: $light-color;
|
||||
margin-right: 10rpx;
|
||||
padding: 0 4rpx;
|
||||
border-radius: 2rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.store-seller-name {
|
||||
color: #666;
|
||||
overflow: hidden;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.count-config {
|
||||
padding: 5rpx 0;
|
||||
color: #666;
|
||||
display: flex;
|
||||
font-size: 24rpx;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
>.price-box {
|
||||
margin-top: 10rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding-right: 10rpx;
|
||||
font-size: 24rpx;
|
||||
color: $font-color-light;
|
||||
|
||||
>.price {
|
||||
font-size: 26rpx;
|
||||
line-height: 1;
|
||||
color: $main-color;
|
||||
font-weight: bold;
|
||||
|
||||
/deep/ span:nth-of-type(1) {
|
||||
font-size: 38rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
</style>
|
||||
166
components/m-goods-list/promotion.vue
Normal file
166
components/m-goods-list/promotion.vue
Normal file
@@ -0,0 +1,166 @@
|
||||
<template>
|
||||
<div>
|
||||
<div v-for="(item, index) in res" :key="index" class="goods-row" @click="navigateToDetailPage(item)">
|
||||
<div class="flex goods-col">
|
||||
<div class="goods-img">
|
||||
<u-image width="230rpx" border-radius='16' height="230rpx" :src="item.goodsImage || item.thumbnail">
|
||||
<u-loading slot="loading"></u-loading>
|
||||
</u-image>
|
||||
</div>
|
||||
<div class="goods-detail">
|
||||
<div class="title clamp3">{{ item.goodsName }}</div>
|
||||
<div class='flex flex-a-c flex-j-sb'>
|
||||
<view class="price-box">
|
||||
<!-- 秒杀 / 拼团 -->
|
||||
<div class="price" v-if="!type && item.price!=undefined">
|
||||
¥<span>{{ $options.filters.goodsFormatPrice(item.price )[0] }} </span>.{{
|
||||
$options.filters.goodsFormatPrice(item.price )[1]
|
||||
}}
|
||||
</div>
|
||||
<!-- 砍价 -->
|
||||
<div class="price" v-if="type && item.purchasePrice!=undefined">
|
||||
最低:
|
||||
¥<span>{{ $options.filters.goodsFormatPrice(item.purchasePrice )[0] }} </span>.{{
|
||||
$options.filters.goodsFormatPrice(item.purchasePrice )[1]
|
||||
}}
|
||||
</div>
|
||||
</view>
|
||||
<div>
|
||||
<image class='buy' :src="buy"></image>
|
||||
</div>
|
||||
</div>
|
||||
<div class='count-config' v-if="!type">
|
||||
<span>即将恢复{{ item.originalPrice}}元</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import commonTpl from '@/components/m-goods-list/common'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
lightColor: this.$mainColor,
|
||||
buy: require('@/static/buy.png')
|
||||
}
|
||||
},
|
||||
mixins: [commonTpl],
|
||||
props: {
|
||||
// 遍历的数据
|
||||
res: {
|
||||
type: Array,
|
||||
default: () => {
|
||||
return []
|
||||
}
|
||||
},
|
||||
type:{
|
||||
type:null,
|
||||
default:""
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 跳转到商品详情
|
||||
navigateToDetailPage(item) {
|
||||
if(this.type == 'kanJia'){
|
||||
uni.navigateTo({
|
||||
url: `/pages/promotion/bargain/detail?id=${item.id}`,
|
||||
});
|
||||
return
|
||||
}
|
||||
uni.navigateTo({
|
||||
url: `/pages/product/goods?id=${item.skuId}&goodsId=${item.goodsId}`,
|
||||
});
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang='scss' scoped>
|
||||
.buy {
|
||||
width: 152rpx;
|
||||
height: 108rpx;
|
||||
}
|
||||
.flex-j-sb {
|
||||
width: 100%;
|
||||
}
|
||||
.goods-row {
|
||||
background: #fff;
|
||||
padding: 16rpx;
|
||||
>.goods-col {
|
||||
display: flex;
|
||||
>.goods-img {
|
||||
overflow: hidden;
|
||||
flex: 4;
|
||||
}
|
||||
>.goods-detail {
|
||||
flex: 7;
|
||||
}
|
||||
}
|
||||
}
|
||||
.goods-detail {
|
||||
margin: 0 20rpx;
|
||||
>.title {
|
||||
font-size: $font-base;
|
||||
color: $font-color-dark;
|
||||
line-height: 1.5;
|
||||
height: 86rpx;
|
||||
padding: 10rpx 0 0;
|
||||
display: -webkit-box;
|
||||
-webkit-box-orient: vertical;
|
||||
-webkit-line-clamp: 2;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.promotion {
|
||||
margin-top: 4rpx;
|
||||
display: flex;
|
||||
|
||||
div {
|
||||
span {
|
||||
font-size: 24rpx;
|
||||
color: $light-color;
|
||||
margin-right: 10rpx;
|
||||
padding: 0 4rpx;
|
||||
border-radius: 2rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.count-config {
|
||||
padding: 5rpx 0;
|
||||
color: #666;
|
||||
display: flex;
|
||||
font-size: 24rpx;
|
||||
letter-spacing:2rpx;
|
||||
padding-left: 10rpx;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
.price-box {
|
||||
margin-top: 10rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding-right: 10rpx;
|
||||
font-size: 24rpx;
|
||||
color: $font-color-light;
|
||||
|
||||
>.price {
|
||||
font-size: 26rpx;
|
||||
line-height: 1;
|
||||
color: $main-color;
|
||||
font-weight: bold;
|
||||
|
||||
/deep/ span:nth-of-type(1) {
|
||||
font-size: 48rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -1,27 +1,11 @@
|
||||
<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>
|
||||
<goodsTemplate :res='goodsList' />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import goodsTemplate from '@/components/m-goods-list/list'
|
||||
import { getGoodsList } from "@/api/goods.js";
|
||||
export default {
|
||||
data() {
|
||||
@@ -50,6 +34,7 @@ export default {
|
||||
default: "",
|
||||
},
|
||||
},
|
||||
components:{goodsTemplate},
|
||||
mounted() {
|
||||
this.initGoods();
|
||||
},
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
<view class="share-list">
|
||||
<!-- #ifdef MP-WEIXIN -->
|
||||
<view class="share-item">
|
||||
<button class="share-btn" open-type="share">
|
||||
<button class="share-btn" @click="weChatShare" open-type="share">
|
||||
<u-icon color="#04BE02" size="80" name="weixin-fill"></u-icon>微信好友
|
||||
</button>
|
||||
</view>
|
||||
@@ -62,6 +62,16 @@ export default {
|
||||
close() {
|
||||
this.$emit("close");
|
||||
},
|
||||
weChatShare(){
|
||||
this.$u.mpShare = {
|
||||
title: this.shareTitle(), // 默认为小程序名称,可自定义
|
||||
path: '', // 默认为当前页面路径,一般无需修改,QQ小程序不支持
|
||||
// 分享图标,路径可以是本地文件路径、代码包文件路径或者网络图片路径。
|
||||
// 支持PNG及JPG,默认为当前页面的截图
|
||||
imageUrl: this.thumbnail ||''
|
||||
}
|
||||
},
|
||||
|
||||
// h5复制链接
|
||||
// #ifdef H5
|
||||
copyLink() {
|
||||
@@ -93,13 +103,13 @@ export default {
|
||||
shareTitle() {
|
||||
let shareTitle;
|
||||
if (this.type == "goods") {
|
||||
shareTitle = `我发现了一个${this.goodsName}商品快来跟我一起看看吧`;
|
||||
shareTitle = `[好友推荐]${this.goodsName}快来跟我一起看看吧`;
|
||||
} else if (this.type == "shops") {
|
||||
shareTitle = `我发现了一个${this.goodsName}店铺快来跟我一起看看吧`;
|
||||
shareTitle = `[好友发现]${this.goodsName}快来跟我一起看看吧`;
|
||||
} else if (this.type == "pintuan") {
|
||||
shareTitle = `我拼了一个${this.goodsName}快来跟我一起抢购吧!`;
|
||||
shareTitle = `[好友邀请]${this.goodsName}快来跟我一起抢购吧!`;
|
||||
} else if (this.type == "kanjia") {
|
||||
shareTitle = `请快来帮我砍一刀${this.goodsName}`;
|
||||
shareTitle = `[好友邀请]请快来帮我砍一刀${this.goodsName}`;
|
||||
}
|
||||
return shareTitle;
|
||||
},
|
||||
|
||||
@@ -1,39 +1,87 @@
|
||||
<template>
|
||||
<view>
|
||||
<view v-if="!hid" class="flex-row-center" :style="{ top: scHight }" style="width: 750rpx; position: fixed; z-index: 100; left: 0">
|
||||
<view class="flex-column-center" style="background-color: #fcfcfc; padding: 30rpx; border-radius: 10rpx">
|
||||
<movable-area class="flex" style="width: 100%" animation="false" :style="{ height: originalHeight }">
|
||||
<movable-view scale-value="1" animation="false" damping="5000" :x="moveX" :style="{
|
||||
<view
|
||||
v-if="!hid"
|
||||
class="flex-row-center"
|
||||
:style="{ top: scHight }"
|
||||
style="width: 750rpx; position: fixed; z-index: 100; left: 0"
|
||||
>
|
||||
<view
|
||||
class="flex-column-center"
|
||||
style="background-color: #fcfcfc; padding: 30rpx; border-radius: 10rpx"
|
||||
>
|
||||
<movable-area
|
||||
class="flex"
|
||||
style="width: 100%"
|
||||
animation="false"
|
||||
:style="{ height: originalHeight }"
|
||||
>
|
||||
<movable-view
|
||||
scale-value="1"
|
||||
animation="false"
|
||||
damping="5000"
|
||||
:x="moveX"
|
||||
:style="{
|
||||
height: sliderHeight,
|
||||
width: sliderWidth,
|
||||
'z-index': 101,
|
||||
}" direction="horizontal">
|
||||
<image :src="imgbk" class="image" mode="aspectFit" :style="{
|
||||
}"
|
||||
direction="horizontal"
|
||||
>
|
||||
<image
|
||||
:src="imgbk"
|
||||
class="image"
|
||||
mode="aspectFit"
|
||||
:style="{
|
||||
height: sliderHeight,
|
||||
width: sliderWidth,
|
||||
'margin-top': imgbKH,
|
||||
}"></image>
|
||||
}"
|
||||
></image>
|
||||
</movable-view>
|
||||
<image :src="img" mode="aspectFit" :style="{ height: originalHeight, width: originalWidth }" style="border-radius: 10rpx"></image>
|
||||
<image
|
||||
:src="img"
|
||||
mode="aspectFit"
|
||||
:style="{ height: originalHeight, width: originalWidth }"
|
||||
style="border-radius: 10rpx"
|
||||
></image>
|
||||
</movable-area>
|
||||
|
||||
<movable-area class="flex-row-start" style="
|
||||
<movable-area
|
||||
class="flex-row-start"
|
||||
style="
|
||||
width: 100%;
|
||||
background-color: #efefef;
|
||||
height: 80rpx;
|
||||
border-radius: 40rpx;
|
||||
margin-top: 30rpx;
|
||||
">
|
||||
<movable-view scale-value="1" animation="false" damping="50" :x="movePv" class="flex-row-center" style="
|
||||
"
|
||||
>
|
||||
<movable-view
|
||||
scale-value="1"
|
||||
animation="false"
|
||||
damping="50"
|
||||
:x="movePv"
|
||||
class="flex-row-center"
|
||||
style="
|
||||
border-radius: 50%;
|
||||
height: 100rpx;
|
||||
width: 100rpx;
|
||||
background-color: #ffffff;
|
||||
border: 2rpx solid #e3e3e3;
|
||||
margin-top: -13rpx;
|
||||
" direction="horizontal" @change="moveChange" @touchend="end">
|
||||
<view :class="endLoad ? 'cuIcon-right' : 'cuIcon-loading turn-load'" class="loadIcon" style="">
|
||||
</view>
|
||||
"
|
||||
direction="horizontal"
|
||||
@change="moveChange"
|
||||
@touchend="end"
|
||||
>
|
||||
<u-icon
|
||||
:color="mainColor"
|
||||
size="40"
|
||||
v-if="endLoad"
|
||||
name="arrow-right"
|
||||
></u-icon>
|
||||
<u-icon :color="mainColor" size="40" v-else name="reload"></u-icon>
|
||||
</movable-view>
|
||||
|
||||
<text style="padding-left: 140rpx" :style="{ color: col }">{{
|
||||
@@ -41,15 +89,20 @@
|
||||
}}</text>
|
||||
</movable-area>
|
||||
<view class="flex-row-around padding-top" style="width: 100%">
|
||||
<view @click="hide" class="cuIcon-close" style="font-size: 50rpx; color: #e25915">
|
||||
</view>
|
||||
<u-icon
|
||||
@click="hide"
|
||||
:color="mainColor"
|
||||
size="40"
|
||||
name="close"
|
||||
></u-icon>
|
||||
|
||||
<text class="cu-tag bg-cyan round" @click="getCode">刷新拼图</text>
|
||||
<text class="my-neirong-sm cuIcon-safe" style="color: #c1c1c1">Lili-FRAMEWORK</text>
|
||||
<text class="my-neirong-sm cuIcon-safe" style="color: #c1c1c1"
|
||||
>Lili-FRAMEWORK</text
|
||||
>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
@@ -90,6 +143,7 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
mainColor: this.$mainColor,
|
||||
flage: false,
|
||||
key: "", //key
|
||||
vsrtx: "点击进行验证", //按钮提示语
|
||||
@@ -144,7 +198,7 @@ export default {
|
||||
storage.setUuid(uuid.v1());
|
||||
}
|
||||
uni.request({
|
||||
url: api.common + "/slider/" + this.business,
|
||||
url: api.common + "/common/slider/" + this.business,
|
||||
header: {
|
||||
uuid: storage.getUuid(),
|
||||
},
|
||||
@@ -179,7 +233,7 @@ export default {
|
||||
method: "POST",
|
||||
url:
|
||||
api.common +
|
||||
"/slider/" +
|
||||
"/common/slider/" +
|
||||
this.business +
|
||||
"?xPos=" +
|
||||
parseInt(this.moveCode * this.tl),
|
||||
@@ -252,10 +306,6 @@ export default {
|
||||
.border-index {
|
||||
border: 1rpx solid $main-color;
|
||||
}
|
||||
.loadIcon {
|
||||
color: $main-color;
|
||||
font-size: 40rpx;
|
||||
}
|
||||
|
||||
.status_bar {
|
||||
height: var(--status-bar-height);
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
const dev = {
|
||||
common: "https://common-api.pickmall.cn",
|
||||
buyer: "https://buyer-api.pickmall.cn",
|
||||
|
||||
};
|
||||
// 生产环境
|
||||
const prod = {
|
||||
|
||||
@@ -1,16 +1,24 @@
|
||||
const name = "lilishop"; //全局商城name
|
||||
const schemeName = 'lilishop' //唤醒app需要的schemeName
|
||||
const schemeName = "lilishop"; //唤醒app需要的schemeName
|
||||
export default {
|
||||
name: name,
|
||||
schemeLink: `${schemeName}://`, //唤起app地址
|
||||
downloadLink: "https://pickmall.cn/download-page/index.html", //下载地址,下载app的地址
|
||||
shareLink: "https://m-b2b2c.pickmall.cn", //分享地址,也就是在h5中默认的复制地址
|
||||
appid: "wx6f10f29075dc1b0b", //小程序唯一凭证,即 AppID,可在「微信公众平台 - 设置 - 开发设置」页中获得。(需要已经成为开发者,且帐号没有异常状态)
|
||||
appSecret: "6dfbe0c72380dce5d49d65b3c91059b1", //可在 manifest.json 查看
|
||||
aMapKey: "d649892b3937a5ad20b76dacb2bcb5bd", //在高德中申请web端key
|
||||
scanAuthNavigation:['https://m-b2b2c.pickmall.cn/'], //扫码认证跳转域名配置 会根据此处配置的路由进行跳转
|
||||
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" //客服邮箱
|
||||
customerServiceEmail: "lili@lili.com", //客服邮箱
|
||||
imWebSrc: "https://im.pickmall.cn", //IM地址
|
||||
enableGetClipboard: true, //是否启用粘贴板获取 scanAuthNavigation 中的链接,如果匹配则会跳转到对应页面
|
||||
enableMiniBarStartUpApp: true, //是否在h5中右侧浮空按钮点击启动app
|
||||
/**
|
||||
* 如需更换主题请修改此处以及uni.scss中的全局颜色
|
||||
*/
|
||||
mainColor: "#ff3c2a", // 主题色
|
||||
lightColor: "#ff6b35", // 高亮主题色
|
||||
aiderLightColor: "#ff9f28", // 辅助高亮颜色
|
||||
};
|
||||
|
||||
16
main.js
16
main.js
@@ -3,19 +3,23 @@ import App from "./App";
|
||||
import * as filters from "./utils/filters.js"; // global filter
|
||||
import uView from "uview-ui";
|
||||
import store from "./store";
|
||||
|
||||
|
||||
import config from '@/config/config';
|
||||
import airBtn from "@/components/m-airbtn/index.vue";
|
||||
/**
|
||||
* 仅在h5中显示唤醒app功能
|
||||
* 在h5页面手动挂载
|
||||
*
|
||||
*/
|
||||
// #ifdef H5
|
||||
import airBtn from "@/components/m-airbtn/index.vue";
|
||||
if(config.enableMiniBarStartUpApp){
|
||||
let btn = Vue.component("airBtn", airBtn); //全局注册
|
||||
document.body.appendChild(new btn().$mount().$el);
|
||||
}
|
||||
// #endif
|
||||
|
||||
// 引入uView对小程序分享的mixin封装
|
||||
let mpShare = require('uview-ui/libs/mixin/mpShare.js');
|
||||
Vue.mixin(mpShare)
|
||||
|
||||
/**
|
||||
* 全局filters
|
||||
@@ -38,11 +42,11 @@ Vue.config.productionTip = false;
|
||||
* 如需更换主题请修改此处以及uni.scss中的全局颜色
|
||||
*/
|
||||
// 主题色
|
||||
Vue.prototype.$mainColor = "#ff3c2a";
|
||||
Vue.prototype.$mainColor = config.mainColor;
|
||||
// 高亮主题色
|
||||
Vue.prototype.$lightColor = "#ff6b35";
|
||||
Vue.prototype.$lightColor = config.lightColor;
|
||||
// 辅助高亮颜色
|
||||
Vue.prototype.$aiderLightColor = "#ff9f28";
|
||||
Vue.prototype.$aiderLightColor = config.aiderLightColor;
|
||||
|
||||
|
||||
App.mpType = "app";
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
{
|
||||
"name" : "lili商城",
|
||||
"appid" : "__UNI__C100675",
|
||||
"appid" : "__UNI__EC9FD60",
|
||||
"description" : "",
|
||||
"versionName" : "4.0.47",
|
||||
"versionCode" : 4000047,
|
||||
"versionName" : "4.2.7",
|
||||
"versionCode" : 4000270,
|
||||
"transformPx" : false,
|
||||
"app-plus" : {
|
||||
"compatible" : {
|
||||
@@ -63,7 +63,16 @@
|
||||
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
|
||||
],
|
||||
"abiFilters" : [ "armeabi-v7a", "arm64-v8a", "x86" ],
|
||||
"schemes" : "lilishop"
|
||||
"schemes" : "lilishop",
|
||||
"permissionExternalStorage" : {
|
||||
"request" : "none",
|
||||
"prompt" : "应用保存运行状态等信息,需要获取读写手机存储(系统提示为访问设备上的照片、媒体内容和文件)权限,请允许。"
|
||||
},
|
||||
"permissionPhoneState" : {
|
||||
"request" : "none",
|
||||
"prompt" : "为保证您正常、安全地使用,需要获取设备识别码(部分手机提示为获取手机号码)使用权限,请允许"
|
||||
},
|
||||
"autoSdkPermissions" : false
|
||||
},
|
||||
"ios" : {
|
||||
"idfa" : false,
|
||||
@@ -75,7 +84,8 @@
|
||||
"NSLocationAlwaysAndWhenInUseUsageDescription" : "位置信息将用于高德地图的效果展示",
|
||||
"NSMicrophoneUsageDescription" : "用户上传视频时需使用音频信息"
|
||||
},
|
||||
"urltypes" : "lilishop"
|
||||
"urltypes" : "lilishop",
|
||||
"dSYMs" : false
|
||||
},
|
||||
/* ios打包配置 */
|
||||
"sdkConfigs" : {
|
||||
@@ -195,10 +205,6 @@
|
||||
}
|
||||
},
|
||||
"plugins" : {
|
||||
"myPlugin" : {
|
||||
"version" : "1.1.0",
|
||||
"provider" : "wx738958e0f4c894f9"
|
||||
},
|
||||
"live-player-plugin" : {
|
||||
"version" : "1.3.0",
|
||||
"provider" : "wx2b03c6e691cd7370"
|
||||
|
||||
59
pages.json
59
pages.json
@@ -14,12 +14,30 @@
|
||||
"enablePullDownRefresh":true
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
"path":"pages/tabbar/screen/fullScreen",
|
||||
"style": {
|
||||
"navigationStyle": "custom", // 隐藏系统导航栏
|
||||
"app-plus":{
|
||||
"animationType": "fade-in", // 设置fade-in淡入动画,为最合理的动画类型
|
||||
"background": "transparent", // 背景透明
|
||||
"backgroundColor": "rgba(0,0,0,0)", // 背景透明
|
||||
"popGesture": "none" // 关闭IOS屏幕左边滑动关闭当前页面的功能
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/tabbar/home/title",
|
||||
"style": {
|
||||
"navigationBarTitleText": "消息"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/tabbar/cart/cartList",
|
||||
"style": {
|
||||
"navigationBarTitleText": "购物车",
|
||||
"navigationBarBackgroundColor": "#fff"
|
||||
"navigationBarBackgroundColor": "#fff",
|
||||
"enablePullDownRefresh":true //实现下拉刷新样式
|
||||
|
||||
}
|
||||
}, {
|
||||
@@ -67,6 +85,12 @@
|
||||
"style": {
|
||||
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/tabbar/special/special",
|
||||
"style": {
|
||||
"navigationBarTitleText": "专题"
|
||||
}
|
||||
}
|
||||
|
||||
],
|
||||
@@ -86,21 +110,14 @@
|
||||
"style": {
|
||||
"navigationBarTitleText": "我的足迹",
|
||||
"enablePullDownRefresh": true,
|
||||
"app-plus": {
|
||||
"titleNView": {
|
||||
"buttons": [{
|
||||
"text": "编辑",
|
||||
"fontSize": "14"
|
||||
|
||||
}]
|
||||
}
|
||||
}
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
}, {
|
||||
"path": "myCollect",
|
||||
"style": {
|
||||
"navigationBarTitleText": "收藏",
|
||||
"enablePullDownRefresh": true, //下拉刷新
|
||||
"navigationStyle": "custom",
|
||||
"app-plus": {
|
||||
"scrollIndicator": "none"
|
||||
}
|
||||
@@ -239,6 +256,8 @@
|
||||
"navigationBarTitleText": "面容登录"
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
{
|
||||
"path": "set/securityCenter/editPassword",
|
||||
"style": {
|
||||
@@ -346,6 +365,12 @@
|
||||
"navigationBarTitleText": "",
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},{
|
||||
"path": "shopList",
|
||||
"style": {
|
||||
"navigationBarTitleText": "",
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},{
|
||||
"path": "licencePhoto",
|
||||
"style": {
|
||||
@@ -444,6 +469,14 @@
|
||||
"navigationStyle": "custom",
|
||||
"navigationBarTextStyle": "black"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "scannerCodeLoginConfirm",
|
||||
"style": {
|
||||
"navigationBarTitleText": "扫码登录",
|
||||
"navigationStyle": "custom",
|
||||
"navigationBarTextStyle": "black"
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
@@ -455,6 +488,8 @@
|
||||
"path": "seckill",
|
||||
"style": {
|
||||
"navigationBarTitleText": "限时抢购",
|
||||
"navigationStyle": "custom", // 隐藏系统导航栏
|
||||
"navigationBarTextStyle": "white" ,
|
||||
"app-plus": {
|
||||
"titleNView": {
|
||||
"homeButton":true
|
||||
@@ -468,7 +503,7 @@
|
||||
"style": {
|
||||
"navigationBarTitleText": "拼团活动",
|
||||
"navigationStyle": "custom", // 隐藏系统导航栏
|
||||
|
||||
"navigationBarTextStyle": "white" ,
|
||||
"app-plus": {
|
||||
// 将回弹属性关掉
|
||||
"bounce": "none"
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<template>
|
||||
<view class="coupon-center">
|
||||
<swiper class="swiper-box">
|
||||
<swiper-item class="swiper-item">
|
||||
<scroll-view class="scroll-v" enableBackToTop="true" scroll-y @scrolltolower="loadMore">
|
||||
<u-empty mode="coupon" text="没有优惠券了" v-if="whetherEmpty"></u-empty>
|
||||
<div class="swiper-box">
|
||||
<div class="swiper-item">
|
||||
<div class="scroll-v" enableBackToTop="true" scroll-y>
|
||||
<u-empty mode="coupon" style='margin-top: 20%;' text="没有优惠券了" v-if="whetherEmpty"></u-empty>
|
||||
<view v-else class="coupon-item" v-for="(item, index) in couponList" :key="index">
|
||||
<view class="left">
|
||||
<view class="wave-line">
|
||||
@@ -23,12 +23,13 @@
|
||||
<view class="right">
|
||||
<view>
|
||||
<!-- 根据scopeType 判断是否是 平台、品类或店铺 -->
|
||||
<view v-if="item.scopeType">
|
||||
<span v-if="item.scopeType == 'ALL' && item.id == 'platform'">全平台</span>
|
||||
<view class="coupon-title wes-3" v-if="item.scopeType">
|
||||
<span v-if="item.scopeType == 'ALL' && item.storeId == '0'">全平台</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>有效期至:{{ item.endTime.split(" ")[0] }}</view>
|
||||
</view>
|
||||
<view v-if="item.endTime">有效期至:{{ item.endTime.split(" ")[0] }}</view>
|
||||
</view>
|
||||
<view class="receive" @click="receive(item)">
|
||||
<text>点击</text><br />
|
||||
@@ -37,16 +38,20 @@
|
||||
<view class="bg-quan"> 券 </view>
|
||||
</view>
|
||||
</view>
|
||||
<uni-load-more :status="loadStatus"></uni-load-more>
|
||||
</scroll-view>
|
||||
</swiper-item>
|
||||
</swiper>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { receiveCoupons } from "@/api/members.js";
|
||||
import { getAllCoupons } from "@/api/promotions.js";
|
||||
import {
|
||||
receiveCoupons
|
||||
} from "@/api/members.js";
|
||||
import {
|
||||
getAllCoupons
|
||||
} from "@/api/promotions.js";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
@@ -57,13 +62,18 @@ export default {
|
||||
pageNumber: 1,
|
||||
pageSize: 10,
|
||||
},
|
||||
storeId: "", //店铺 id
|
||||
storeId: "", //店铺 id,
|
||||
couponData: ""
|
||||
};
|
||||
},
|
||||
onLoad(option) {
|
||||
this.storeId = option.storeId;
|
||||
this.getCoupon();
|
||||
},
|
||||
onReachBottom() {
|
||||
|
||||
this.loadMore()
|
||||
},
|
||||
onPullDownRefresh() {
|
||||
//下拉刷新
|
||||
this.params.pageNumber = 1;
|
||||
@@ -78,21 +88,26 @@ export default {
|
||||
uni.showLoading({
|
||||
title: "加载中",
|
||||
});
|
||||
let submitData = { ...this.params };
|
||||
let submitData = {
|
||||
...this.params
|
||||
};
|
||||
// 判断当前是否有店铺
|
||||
this.storeId ? (submitData = { ...this.params, storeId: this.storeId }): "",
|
||||
this.storeId ? (submitData = {
|
||||
...this.params,
|
||||
storeId: this.storeId
|
||||
}) : "",
|
||||
getAllCoupons(submitData)
|
||||
.then((res) => {
|
||||
uni.hideLoading();
|
||||
uni.stopPullDownRefresh();
|
||||
if (res.data.code == 200) {
|
||||
// 如果请求成功,展示数据并进行展示
|
||||
let data = res.data.result;
|
||||
if (data.total == 0) {
|
||||
this.couponData = res.data.result
|
||||
if (this.couponData.total == 0) {
|
||||
// 当本次请求数据为空展示空信息
|
||||
this.whetherEmpty = true;
|
||||
} else {
|
||||
this.couponList.push(...data.records);
|
||||
this.couponList.push(...this.couponData.records);
|
||||
this.loadStatus = "noMore";
|
||||
}
|
||||
}
|
||||
@@ -123,9 +138,9 @@ export default {
|
||||
* 加载更多
|
||||
*/
|
||||
loadMore() {
|
||||
if (this.loadStatus != "noMore") {
|
||||
if (this.couponData.total > this.params.pageNumber * this.params.pageSize) {
|
||||
this.params.pageNumber++;
|
||||
this.getAllCoupons();
|
||||
this.getCoupon();
|
||||
}
|
||||
},
|
||||
},
|
||||
@@ -145,41 +160,7 @@ page {
|
||||
.coupon-center {
|
||||
height: 100%;
|
||||
|
||||
.couponList-scroll-content {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
display: flex;
|
||||
white-space: nowrap;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
background-color: $main-color;
|
||||
color: #ffffff;
|
||||
|
||||
.tab-item {
|
||||
width: 160rpx;
|
||||
height: 80rpx;
|
||||
line-height: 60rpx;
|
||||
text-align: center;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.active {
|
||||
border-bottom: 2px solid #ffffff;
|
||||
broder-width: 60rpx;
|
||||
font-size: 30rpx;
|
||||
font-weight: 700;
|
||||
padding-bottom: 4rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.swiper-box {
|
||||
height: 100%;
|
||||
|
||||
.scroll-v {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.coupon-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
@@ -191,6 +172,7 @@ page {
|
||||
width: 260rpx;
|
||||
background-color: $light-color;
|
||||
position: relative;
|
||||
|
||||
.message {
|
||||
color: $font-color-white;
|
||||
display: flex;
|
||||
@@ -226,6 +208,7 @@ page {
|
||||
margin-top: 4rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.circle {
|
||||
width: 40rpx;
|
||||
height: 40rpx;
|
||||
@@ -234,10 +217,12 @@ page {
|
||||
border-radius: 50%;
|
||||
z-index: 111;
|
||||
}
|
||||
|
||||
.circle-top {
|
||||
top: -20rpx;
|
||||
right: -20rpx;
|
||||
}
|
||||
|
||||
.circle-bottom {
|
||||
bottom: -20rpx;
|
||||
right: -20rpx;
|
||||
@@ -254,10 +239,15 @@ page {
|
||||
background-color: #ffffff;
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
|
||||
>view:nth-child(1) {
|
||||
color: #666666;
|
||||
margin-left: 20rpx;
|
||||
line-height: 3em;
|
||||
display: flex;
|
||||
height: 100%;
|
||||
flex-direction: column;
|
||||
justify-content: space-around;
|
||||
|
||||
>view:nth-child(1) {
|
||||
color: #ff6262;
|
||||
font-size: 30rpx;
|
||||
@@ -296,4 +286,9 @@ page {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.coupon-title {
|
||||
width: 260rpx;
|
||||
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
</view>
|
||||
<view class="bottom-view">
|
||||
<view class="text">• 使用平台:{{
|
||||
coupon.scopeType == 'ALL' && coupon.id == 'platform'
|
||||
coupon.scopeType == 'ALL' && coupon.storeId == '0'
|
||||
? "全平台"
|
||||
: coupon.scopeType == "PORTION_CATEGORY"
|
||||
? "仅限品类"
|
||||
|
||||
@@ -1,6 +1,16 @@
|
||||
<template>
|
||||
<div class="wrapper">
|
||||
<u-tabs :list="list" :is-scroll="false" :active-color="lightColor" :current="current" @change="(i)=>{current = i}">
|
||||
<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">
|
||||
@@ -24,17 +34,29 @@
|
||||
<view class="right">
|
||||
<view class="desc">
|
||||
<view v-if="item.scopeType">
|
||||
<span v-if="item.scopeType == 'ALL' && item.id == 'platform'">全平台</span>
|
||||
<span v-if="item.scopeType == 'ALL' && item.storeId == '0'">全平台</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 class="reason" v-if="item.reason">{{ item.reason }}</view>
|
||||
<view class="end-time">有效期至:{{ item.endTime }}</view>
|
||||
</view>
|
||||
<view class="receive" v-if="current ==0" @click="clickWay(item)">
|
||||
<view
|
||||
class="receive"
|
||||
v-if="current == 0 && !routerVal.selectedCoupon.includes(item.id)"
|
||||
@click="clickWay(item)"
|
||||
>
|
||||
<text>立即</text><br />
|
||||
<text>使用</text>
|
||||
</view>
|
||||
<view class="used" v-else @click="clickWay(item)">
|
||||
<text>取消</text><br />
|
||||
<text>使用</text>
|
||||
</view>
|
||||
<view class="bg-quan">券</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -70,8 +92,7 @@ export default {
|
||||
};
|
||||
},
|
||||
onLoad(options) {
|
||||
this.routerVal = options
|
||||
|
||||
this.routerVal = options;
|
||||
},
|
||||
watch: {
|
||||
current(val) {
|
||||
@@ -84,6 +105,7 @@ export default {
|
||||
|
||||
mounted() {
|
||||
this.init();
|
||||
console.log(this.routerVal);
|
||||
},
|
||||
|
||||
methods: {
|
||||
@@ -99,7 +121,7 @@ export default {
|
||||
clickWay(coupon) {
|
||||
useCoupon({
|
||||
memberCouponId: coupon.id,
|
||||
used: true,
|
||||
used: !this.routerVal.selectedCoupon.includes(coupon.id),
|
||||
way: this.routerVal.way,
|
||||
}).then((res) => {
|
||||
if (res.data.success) {
|
||||
@@ -237,6 +259,20 @@ export default {
|
||||
z-index: 2;
|
||||
}
|
||||
|
||||
.used {
|
||||
color: #ffffff;
|
||||
background-color: black;
|
||||
border-radius: 50%;
|
||||
width: 86rpx;
|
||||
height: 86rpx;
|
||||
text-align: center;
|
||||
margin-right: 30rpx;
|
||||
vertical-align: middle;
|
||||
padding-top: 8rpx;
|
||||
position: relative;
|
||||
z-index: 2;
|
||||
}
|
||||
|
||||
.bg-quan {
|
||||
width: 244rpx;
|
||||
height: 244rpx;
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
<view class="content">
|
||||
<view class="title-1">{{ coupon.title }}</view>
|
||||
<view class="title-2">使用平台:{{
|
||||
coupon.scopeType == 'ALL' && coupon.id == 'platform'
|
||||
coupon.scopeType == 'ALL' && coupon.storeId == '0'
|
||||
? "全平台"
|
||||
: coupon.scopeType == "PORTION_CATEGORY"
|
||||
? "仅限品类"
|
||||
@@ -116,6 +116,7 @@ export default {
|
||||
},
|
||||
|
||||
onShow() {
|
||||
this.navList[this.tabCurrentIndex].params.pageNumber = 1
|
||||
this.navList[this.tabCurrentIndex].dataList = [];
|
||||
this.getData();
|
||||
},
|
||||
@@ -187,13 +188,13 @@ export default {
|
||||
* 立即使用优惠券
|
||||
*/
|
||||
useItNow(item) {
|
||||
if (item.storeId) {
|
||||
if (item.storeId && item.storeId!='0') {
|
||||
uni.navigateTo({
|
||||
url: `/pages/product/shopPage?id=${item.storeId}`,
|
||||
});
|
||||
} else {
|
||||
uni.switchTab({
|
||||
url: "/pages/tabbar/home/index",
|
||||
url: "/pages/navigation/search/searchPage",
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
@@ -104,7 +104,7 @@
|
||||
});
|
||||
}
|
||||
else{
|
||||
uni.redirectTo({
|
||||
uni.navigateTo({
|
||||
url: "/pages/order/myOrder?status=0",
|
||||
});
|
||||
}
|
||||
@@ -139,6 +139,7 @@
|
||||
// 判断当前是否是充值
|
||||
this.sn = this.routerVal.recharge_sn;
|
||||
this.orderType = "RECHARGE";
|
||||
|
||||
} else if (this.routerVal.trade_sn) {
|
||||
this.sn = this.routerVal.trade_sn;
|
||||
this.orderType = "TRADE";
|
||||
@@ -161,7 +162,7 @@
|
||||
});
|
||||
// #endif
|
||||
|
||||
// #ifndef MP-WEIXIN
|
||||
|
||||
if(this.routerVal.recharge_sn){
|
||||
this.payList = res.data.result.support.filter((item) => {
|
||||
return item != "WALLET";
|
||||
@@ -170,7 +171,7 @@
|
||||
else{
|
||||
this.payList = res.data.result.support;
|
||||
}
|
||||
// #ifndef APP-PLUS
|
||||
// #ifdef H5
|
||||
//判断是否微信浏览器
|
||||
var ua = window.navigator.userAgent.toLowerCase();
|
||||
if (ua.match(/MicroMessenger/i) == 'micromessenger') {
|
||||
@@ -178,11 +179,17 @@
|
||||
this.payList = res.data.result.support.filter((item) => {
|
||||
return item != "ALIPAY";
|
||||
});
|
||||
// 充值的话仅保留微信支付
|
||||
if(this.orderType == "RECHARGE"){
|
||||
this.payList = res.data.result.support.filter((item) => {
|
||||
return item == "WECHAT";
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
// #endif
|
||||
|
||||
// #endif
|
||||
|
||||
|
||||
|
||||
this.walletValue = res.data.result.walletValue;
|
||||
@@ -227,12 +234,17 @@
|
||||
// 客户端类型 APP/NATIVE/JSAPI/H5
|
||||
const paymentClient = this.paymentClient;
|
||||
|
||||
uni.showLoading({
|
||||
title: "正在唤起支付...",
|
||||
mask:true
|
||||
});
|
||||
|
||||
// #ifdef APP-PLUS
|
||||
//APP pay
|
||||
// 初始化支付签名
|
||||
await API_Trade.initiatePay(paymentMethod, paymentClient, params).then(
|
||||
(signXml) => {
|
||||
|
||||
uni.hideLoading();
|
||||
//如果支付异常
|
||||
if (!signXml.data.success) {
|
||||
uni.showToast({
|
||||
@@ -245,19 +257,24 @@
|
||||
let payForm = signXml.data.result;
|
||||
|
||||
let paymentType = paymentMethod === "WECHAT" ? "wxpay" : "alipay";
|
||||
uni.requestPayment({
|
||||
provider: paymentType,
|
||||
orderInfo: payForm,
|
||||
success: (e) => {
|
||||
console.log(e);
|
||||
|
||||
if(paymentMethod === "WALLET"){
|
||||
uni.showToast({
|
||||
icon: "none",
|
||||
title: "支付成功!",
|
||||
});
|
||||
this.callback(paymentMethod)
|
||||
}
|
||||
else{
|
||||
uni.requestPayment({
|
||||
provider: paymentType,
|
||||
orderInfo: payForm || '',
|
||||
success: (e) => {
|
||||
uni.showToast({
|
||||
icon: "none",
|
||||
title: "支付成功!",
|
||||
});
|
||||
|
||||
this.callback(paymentMethod)
|
||||
|
||||
|
||||
},
|
||||
fail: (e) => {
|
||||
console.log(this);
|
||||
@@ -269,6 +286,7 @@
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
);
|
||||
//APP pay
|
||||
// #endif
|
||||
|
||||
@@ -2,9 +2,11 @@
|
||||
<view class="add-address">
|
||||
<div class="uForm">
|
||||
<u-form :border-bottom="false" :model="form" ref="uForm" :error-type="['toast']" :rule="rules">
|
||||
<!-- #ifndef H5 -->
|
||||
<view class="selectAddress" @click="clickUniMap">
|
||||
选择收货地址
|
||||
</view>
|
||||
<!-- #endif -->
|
||||
<u-form-item class="border" label="收货人" label-width="130" prop="name">
|
||||
<u-input v-model="form.name" clearable placeholder="请输入收货人姓名" />
|
||||
</u-form-item>
|
||||
@@ -160,9 +162,7 @@ export default {
|
||||
delete this.form.updateTime;
|
||||
editAddress(this.form).then((res) => {
|
||||
if (res.data.success) {
|
||||
uni.navigateTo({
|
||||
url: `/${beforePage.route}`,
|
||||
});
|
||||
uni.navigateBack();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -86,22 +86,8 @@ export default {
|
||||
* 进入页面检测当前账户是否登录
|
||||
*/
|
||||
onShow() {
|
||||
let that = this;
|
||||
if (this.$options.filters.isLogin("auth")) {
|
||||
if (this.$options.filters.tipsToLogin()) {
|
||||
this.getAddressList();
|
||||
} else {
|
||||
uni.showModal({
|
||||
title: "提示",
|
||||
content: "检测到您的账号还未登录,是否去登录?",
|
||||
confirmColor: this.$lightColor,
|
||||
success: function (res) {
|
||||
if (res.confirm) {
|
||||
that.$options.filters.navigateToLogin();
|
||||
} else if (res.cancel) {
|
||||
uni.navigateBack();
|
||||
}
|
||||
},
|
||||
});
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<view class="wap">
|
||||
<u-navbar back-text="" title="预存款列表">
|
||||
<u-navbar title="预存款列表">
|
||||
</u-navbar>
|
||||
<view class="wrapper-show-money">
|
||||
<view class="money-view">
|
||||
@@ -28,7 +28,7 @@
|
||||
</view>
|
||||
|
||||
<u-empty v-if="datas.length==0" mode="history" text="暂无记录" />
|
||||
<u-loadmore v-else bg-color='#f8f8f8' :status="status" />
|
||||
|
||||
</scroll-view>
|
||||
|
||||
</swiper-item>
|
||||
@@ -45,7 +45,7 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
walletNum: 0,
|
||||
status: "loadmore",
|
||||
|
||||
current: 0,
|
||||
swiperCurrent: 0,
|
||||
userInfo: "", //用户详情信息
|
||||
@@ -82,27 +82,23 @@ export default {
|
||||
|
||||
/**分页获取预存款充值记录 */
|
||||
getRecharge() {
|
||||
this.status = "loading";
|
||||
|
||||
getUserRecharge(this.params).then((res) => {
|
||||
if (res.data.success) {
|
||||
if (res.data.result.records.length != 0) {
|
||||
this.status = "loadmore";
|
||||
|
||||
this.datas.push(...res.data.result.records);
|
||||
} else {
|
||||
this.status = "nomore";
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
getWallet() {
|
||||
this.status = "loading";
|
||||
|
||||
getWalletLog(this.params).then((res) => {
|
||||
if (res.data.success) {
|
||||
if (res.data.result.records.length != 0) {
|
||||
this.datas.push(...res.data.result.records);
|
||||
} else {
|
||||
this.status = "nomore";
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
|
||||
<template>
|
||||
<view>
|
||||
<view class="-list">
|
||||
@@ -5,7 +6,8 @@
|
||||
<view class="content">
|
||||
<view class="price">
|
||||
<span> ¥</span>
|
||||
<u-input v-model="price" placeholder="" type="number" />
|
||||
<u-input v-model="price" placeholder='金额' type="number" />
|
||||
|
||||
</view>
|
||||
|
||||
</view>
|
||||
|
||||
@@ -1,7 +1,12 @@
|
||||
<template>
|
||||
<view class="log-list">
|
||||
<!-- 提现记录 -->
|
||||
<view class="log-way" v-if="cashLogData.length != 0" v-for="(item, index) in cashLogData" :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">
|
||||
<view class="title">{{
|
||||
@@ -20,21 +25,31 @@
|
||||
</view>
|
||||
</view>
|
||||
<!-- 分销业绩 -->
|
||||
<view class="log-way" v-if="achievementData.length != 0" v-for="(item, index) in achievementData" :key="index">
|
||||
<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 class="price">提成金额:+{{ item.rebate | unitPrice }}</view>
|
||||
</view>
|
||||
<view class="log-item-view">
|
||||
<view>{{ item.createTime }}</view>
|
||||
<view>{{item.storeName}}</view>
|
||||
<view>创建时间:{{ item.createTime }}</view>
|
||||
<view>店铺:{{ item.storeName }}</view>
|
||||
</view>
|
||||
<view class="log-item-footer">
|
||||
<view>会员名称:{{ item.memberName }}</view>
|
||||
</view>
|
||||
<view class="log-item-footers">
|
||||
<view>订单号:{{ item.orderSn }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="empty" v-if="empty">
|
||||
<u-loadmore :status="status" :icon-type="iconType" bg-color="#f7f7f7" />
|
||||
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
@@ -86,7 +101,7 @@ export default {
|
||||
});
|
||||
distributionOrderList(this.achParams).then((res) => {
|
||||
if (res.data.success && res.data.result.records.length >= 1) {
|
||||
this.achievementData = res.data.result.records;
|
||||
this.achievementData.push(...res.data.result.records);
|
||||
} else {
|
||||
this.status = "nomore";
|
||||
this.empty = true;
|
||||
@@ -101,7 +116,7 @@ export default {
|
||||
});
|
||||
cashLog(this.params).then((res) => {
|
||||
if (res.data.success && res.data.result.records.length >= 1) {
|
||||
this.cashLogData = res.data.result.records;
|
||||
this.cashLogData.push(...res.data.result.records);
|
||||
} else {
|
||||
this.status = "nomore";
|
||||
this.empty = true;
|
||||
@@ -139,6 +154,19 @@ export default {
|
||||
.log-item-view {
|
||||
padding: 8rpx 32rpx;
|
||||
display: flex;
|
||||
font-size: 13px;
|
||||
justify-content: space-between;
|
||||
}
|
||||
.log-item-footer {
|
||||
padding: 8rpx 32rpx;
|
||||
display: flex;
|
||||
font-size: 13px;
|
||||
justify-content: space-between;
|
||||
}
|
||||
.log-item-footers {
|
||||
padding: 8rpx 32rpx;
|
||||
display: flex;
|
||||
font-size: 13px;
|
||||
justify-content: space-between;
|
||||
}
|
||||
</style>
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div class="wrapper">
|
||||
<u-parse v-html="res.content"></u-parse>
|
||||
<u-parse :show-with-animation="true" :lazy-load="true" :selectable="true" :html="res.content"></u-parse>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -1,21 +1,18 @@
|
||||
<template>
|
||||
<view class="content">
|
||||
<view class="navbar">
|
||||
<!-- 循环出顶部nav栏 -->
|
||||
<view v-for="(item, index) in navList" :key="index" class="nav-item" @click="tabClick(index)">
|
||||
<text :class="{current: tabCurrentIndex === index}">{{item.text}}</text>
|
||||
</view>
|
||||
</view>
|
||||
<u-navbar>
|
||||
<u-tabs :active-color="lightColor" class="slot-wrap" :list="navList" count="count" :is-scroll="true" :current="tabCurrentIndex" @change="tabClick"></u-tabs>
|
||||
</u-navbar>
|
||||
<view class="swiper-box">
|
||||
<!-- 显示商品栏 -->
|
||||
<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>
|
||||
<!-- 空白页 -->
|
||||
<u-empty style="margin-top:40rpx;" 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" @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)">
|
||||
<u-image width="131rpx" height="131rpx" :src="item.image" mode="aspectFit">
|
||||
<u-loading slot="loading"></u-loading>
|
||||
@@ -28,29 +25,29 @@
|
||||
</view>
|
||||
</u-swipe-action>
|
||||
|
||||
<uni-load-more :status="goodsLoad"></uni-load-more>
|
||||
</scroll-view>
|
||||
</view>
|
||||
<!-- 显示收藏的店铺栏 -->
|
||||
<view v-else class="tab-content">
|
||||
<scroll-view class="list-scroll-content" scroll-y @scrolltolower="loadMore">
|
||||
<scroll-view class="list-scroll-content" scroll-y>
|
||||
<!-- 空白页 -->
|
||||
<u-empty style="margin-top:40rpx;" 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"
|
||||
@click="clickstoreSwiperAction(item)">
|
||||
<view class="store" @click="gostoreMainPage(item.id)">
|
||||
@click="clickStoreSwiperAction(item)">
|
||||
<view class="store" @click="goStoreMainPage(item.id)">
|
||||
<view class="intro">
|
||||
<view class="store-logo">
|
||||
<u-image width="102rpx" height="102rpx" :src="item.storeLogo" :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-image>
|
||||
</view>
|
||||
<view class="store-name">
|
||||
<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 class="store-collect">
|
||||
<view>进店逛逛</view>
|
||||
@@ -58,7 +55,6 @@
|
||||
</view>
|
||||
</view>
|
||||
</u-swipe-action>
|
||||
<uni-load-more :status="storeLoad"></uni-load-more>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -74,37 +70,35 @@ import {
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
lightColor:this.$lightColor,
|
||||
// 商品左滑侧边栏
|
||||
LeftOptions: [
|
||||
{
|
||||
LeftOptions: [{
|
||||
text: "取消",
|
||||
style: {
|
||||
backgroundColor: this.$lightColor,
|
||||
},
|
||||
},
|
||||
],
|
||||
}, ],
|
||||
tabCurrentIndex: 0, //tab的下标默认为0,也就是说会默认请求商品
|
||||
navList: [
|
||||
//tab显示数据
|
||||
{
|
||||
text: "商品(0)",
|
||||
loadingType: "more",
|
||||
name: "商品(0)",
|
||||
|
||||
params: {
|
||||
pageNumber: 1,
|
||||
pageSize: 10,
|
||||
},
|
||||
},
|
||||
{
|
||||
text: "店铺(0)",
|
||||
loadingType: "more",
|
||||
name: "店铺(0)",
|
||||
|
||||
params: {
|
||||
pageNumber: 1,
|
||||
pageSize: 10,
|
||||
},
|
||||
},
|
||||
],
|
||||
goodsLoad: "more", //商品加载
|
||||
storeLoad: "more", //店铺加载
|
||||
|
||||
goodsEmpty: false, //商品数据是否为空
|
||||
storeEmpty: false, //店铺数据是否为空
|
||||
goodList: [], //商品集合
|
||||
@@ -113,7 +107,16 @@ export default {
|
||||
},
|
||||
onLoad() {
|
||||
this.getGoodList();
|
||||
this.getstoreList();
|
||||
this.getStoreList();
|
||||
},
|
||||
onReachBottom() {
|
||||
if (this.tabCurrentIndex == 0) {
|
||||
this.navList[0].params.pageNumber++;
|
||||
this.getGoodList();
|
||||
} else {
|
||||
this.navList[1].params.pageNumber++;
|
||||
this.getStoreList();
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
@@ -121,7 +124,10 @@ export default {
|
||||
* 打开商品左侧取消收藏
|
||||
*/
|
||||
openLeftChange(val, type) {
|
||||
const { goodList, storeList } = this;
|
||||
const {
|
||||
goodList,
|
||||
storeList
|
||||
} = this;
|
||||
let way;
|
||||
type == "goods" ? (way = goodList) : (way = storeList);
|
||||
way.forEach((item) => {
|
||||
@@ -147,11 +153,11 @@ export default {
|
||||
/**
|
||||
* 点击店铺左侧取消收藏
|
||||
*/
|
||||
clickstoreSwiperAction(val) {
|
||||
clickStoreSwiperAction(val) {
|
||||
deleteStoreCollection(val.storeId).then((res) => {
|
||||
if (res.statusCode == 200) {
|
||||
this.storeList = [];
|
||||
this.getstoreList();
|
||||
this.getStoreList();
|
||||
}
|
||||
});
|
||||
},
|
||||
@@ -176,7 +182,7 @@ export default {
|
||||
/**
|
||||
* 查看店铺详情
|
||||
*/
|
||||
gostoreMainPage(id) {
|
||||
goStoreMainPage(id) {
|
||||
//店铺主页
|
||||
uni.navigateTo({
|
||||
url: "/pages/product/shopPage?id=" + id,
|
||||
@@ -196,7 +202,8 @@ export default {
|
||||
if (res.data.success) {
|
||||
let data = res.data.result;
|
||||
data.selected = false;
|
||||
this.navList[0].text = `商品(${data.total})`;
|
||||
this.navList[0].name = `商品(${data.total})`;
|
||||
|
||||
if (data.total == 0) {
|
||||
this.goodsEmpty = true;
|
||||
} else if (data.total < 10) {
|
||||
@@ -213,7 +220,7 @@ export default {
|
||||
/**
|
||||
* 获取店铺集合
|
||||
*/
|
||||
getstoreList() {
|
||||
getStoreList() {
|
||||
uni.showLoading({
|
||||
title: "加载中",
|
||||
});
|
||||
@@ -223,32 +230,16 @@ export default {
|
||||
if (res.data.success) {
|
||||
let data = res.data.result;
|
||||
data.selected = false;
|
||||
this.navList[1].text = `店铺(${data.total})`;
|
||||
this.navList[1].name = `店铺(${data.total})`;
|
||||
if (data.total == 0) {
|
||||
this.storeEmpty = true;
|
||||
} else if (data.total < 10) {
|
||||
this.storeLoad = "noMore";
|
||||
|
||||
this.storeList.push(...data.records);
|
||||
} else {
|
||||
this.storeList.push(...data.records);
|
||||
if (data.total.length < 10) this.storeLoad = "noMore";
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 底部加载更多
|
||||
*/
|
||||
loadMore() {
|
||||
if (this.tabCurrentIndex == 0) {
|
||||
this.navList[0].params.pageNumber++;
|
||||
this.getGoodList();
|
||||
} else {
|
||||
this.navList[1].params.pageNumber++;
|
||||
this.getstoreList();
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -262,7 +253,7 @@ export default {
|
||||
} else {
|
||||
this.navList[1].params.pageNumber = 1;
|
||||
this.storeList = [];
|
||||
this.getstoreList();
|
||||
this.getStoreList();
|
||||
}
|
||||
},
|
||||
};
|
||||
@@ -274,10 +265,18 @@ page,
|
||||
background: $page-color-base;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.slot-wrap{
|
||||
flex: 1;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
padding-right: 72rpx;
|
||||
}
|
||||
|
||||
.content {
|
||||
width: 100%;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.swiper-box {
|
||||
overflow-y: auto;
|
||||
}
|
||||
@@ -290,6 +289,7 @@ page,
|
||||
/deep/ .u-swipe-content {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.goods {
|
||||
background-color: #fff;
|
||||
border-bottom: 1px solid $border-color-light;
|
||||
@@ -298,11 +298,13 @@ page,
|
||||
align-items: center;
|
||||
padding: 30rpx 20rpx;
|
||||
margin-top: 20rpx;
|
||||
|
||||
image {
|
||||
width: 131rpx;
|
||||
height: 131rpx;
|
||||
border-radius: 10rpx;
|
||||
}
|
||||
|
||||
.goods-intro {
|
||||
flex: 1;
|
||||
font-size: $font-base;
|
||||
@@ -316,14 +318,17 @@ page,
|
||||
overflow: hidden;
|
||||
color: #666;
|
||||
}
|
||||
|
||||
view:nth-child(2) {
|
||||
color: #cccccc;
|
||||
font-size: 24rpx;
|
||||
}
|
||||
|
||||
view:nth-child(3) {
|
||||
color: $light-color;
|
||||
}
|
||||
}
|
||||
|
||||
button {
|
||||
color: $main-color;
|
||||
height: 50rpx;
|
||||
@@ -333,16 +338,19 @@ page,
|
||||
line-height: 50rpx;
|
||||
background-color: #ffffff;
|
||||
margin-top: 80rpx;
|
||||
|
||||
&::after {
|
||||
border-color: $main-color;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.store {
|
||||
background-color: #fff;
|
||||
border: 1px solid $border-color-light;
|
||||
border-radius: 16rpx;
|
||||
margin: 20rpx 10rpx;
|
||||
|
||||
.intro {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
@@ -355,28 +363,34 @@ page,
|
||||
height: 102rpx;
|
||||
border-radius: 50%;
|
||||
overflow: hidden;
|
||||
|
||||
image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border-radius: 50%;
|
||||
}
|
||||
}
|
||||
|
||||
.store-name {
|
||||
flex: 1;
|
||||
margin-left: 30rpx;
|
||||
line-height: 2em;
|
||||
|
||||
:first-child {
|
||||
font-size: $font-base;
|
||||
}
|
||||
|
||||
:last-child {
|
||||
font-size: $font-sm;
|
||||
color: #999;
|
||||
}
|
||||
}
|
||||
|
||||
.store-collect {
|
||||
border-left: 1px solid $border-color-light;
|
||||
padding-left: 20rpx;
|
||||
text-align: center;
|
||||
|
||||
:last-child {
|
||||
color: #999;
|
||||
font-size: $font-sm;
|
||||
@@ -384,6 +398,7 @@ page,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.navbar {
|
||||
display: flex;
|
||||
height: 40px;
|
||||
@@ -392,6 +407,7 @@ page,
|
||||
box-shadow: 0 1px 5px rgba(0, 0, 0, 0.06);
|
||||
position: relative;
|
||||
z-index: 10;
|
||||
|
||||
.nav-item {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
@@ -403,10 +419,12 @@ page,
|
||||
text {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
text.current {
|
||||
color: $light-color;
|
||||
font-weight: bold;
|
||||
font-size: 28rpx;
|
||||
|
||||
&::after {
|
||||
content: "";
|
||||
position: absolute;
|
||||
|
||||
@@ -1,15 +1,17 @@
|
||||
<template>
|
||||
<view class="myTracks">
|
||||
<u-navbar title="我的足迹">
|
||||
|
||||
</u-navbar>
|
||||
<u-empty text="暂无历史记录" style="margin-top:200rpx;" mode="history" v-if="whetherEmpty"></u-empty>
|
||||
<div v-else>
|
||||
<view v-for="(item, index) in trackList" :key="index">
|
||||
<view class="myTracks-title" @click="navgaiteToStore(item)">{{item.storeName}}</view>
|
||||
<view class="myTracks-items">
|
||||
|
||||
<u-swipe-action style="width: 100%;" :show="item.show" :index="index" :key="item.id"
|
||||
@click="delTracks" @open="open" :options="options">
|
||||
<view class="myTracks-item">
|
||||
<u-checkbox-group>
|
||||
<u-checkbox v-model="item.___isDel" v-if="editFlag" active-color="#ff6b35" style="margin-right: 10rpx"
|
||||
@change="changeChecked(item)"></u-checkbox>
|
||||
</u-checkbox-group>
|
||||
<view class="myTracks-item-img" @click.stop="navgaiteToDetail(item)">
|
||||
<image :src="item.thumbnail"></image>
|
||||
</view>
|
||||
@@ -23,48 +25,41 @@
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</u-swipe-action>
|
||||
|
||||
</view>
|
||||
<view class="myTracks-divider"></view>
|
||||
|
||||
</view>
|
||||
<uni-load-more :status="loadStatus"></uni-load-more>
|
||||
</div>
|
||||
<view v-if="editFlag">
|
||||
<view class="myTracks-action-placeholder"></view>
|
||||
<view class="myTracks-action">
|
||||
<view class="myTracks-action-check">
|
||||
<u-checkbox-group>
|
||||
<u-checkbox v-model="allChecked" v-if="editFlag" active-color="#ff6b35" style="margin-right: 10rpx"
|
||||
@change="checkedAllitem"></u-checkbox>
|
||||
全选
|
||||
</u-checkbox-group>
|
||||
</view>
|
||||
|
||||
<view>
|
||||
<u-button type="warning" plain="true" @click="delAllTracks" class="myTracks-action-btn">
|
||||
删除
|
||||
</u-button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</div>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { myTrackList, deleteHistoryListId } from "@/api/members.js";
|
||||
import {
|
||||
myTrackList,
|
||||
deleteHistoryListId
|
||||
} from "@/api/members.js";
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
editFlag: false, //是否编辑
|
||||
allChecked: false, //是否全选
|
||||
loadStatus: "more", //底部下拉加载状态
|
||||
|
||||
whetherEmpty: false, //是否数据为空
|
||||
params: {
|
||||
pageNumber: 1,
|
||||
pageSize: 10,
|
||||
order: "desc",
|
||||
sort: "updateTime",
|
||||
},
|
||||
|
||||
options: [{
|
||||
text: '删除',
|
||||
style: {
|
||||
backgroundColor: '#dd524d'
|
||||
}
|
||||
}],
|
||||
trackList: [], //足迹列表
|
||||
};
|
||||
},
|
||||
@@ -73,12 +68,11 @@ export default {
|
||||
* 滑到底部加载下一页数据
|
||||
*/
|
||||
onReachBottom() {
|
||||
if (this.loadStatus != "noMore") {
|
||||
this.params.pageNumber++;
|
||||
this.getList();
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
onShow() {
|
||||
this.trackList = [];
|
||||
this.getList();
|
||||
},
|
||||
onPullDownRefresh() {
|
||||
@@ -94,35 +88,14 @@ export default {
|
||||
url: "/pages/product/shopPage?id=" + val.storeId,
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 设置右侧导航栏文本
|
||||
*/
|
||||
setStyle(text) {
|
||||
//导航按钮文本设置
|
||||
let pages = getCurrentPages();
|
||||
let page = pages[pages.length - 1];
|
||||
// #ifdef APP-PLUS
|
||||
let currentWebview = page.$getAppWebview();
|
||||
let titleNView = currentWebview.getStyle().titleNView;
|
||||
titleNView.buttons[0].text = text;
|
||||
if (text == "完成") {
|
||||
this.trackList.forEach((key) => {
|
||||
key.history.forEach((item) => {
|
||||
this.$set(item, "___isDel", false);
|
||||
});
|
||||
});
|
||||
}
|
||||
currentWebview.setStyle({
|
||||
titleNView: titleNView,
|
||||
});
|
||||
// #endif
|
||||
// #ifdef H5
|
||||
// h5 临时方案
|
||||
document.getElementsByClassName("uni-btn-icon")[1].innerText = text;
|
||||
// #endif
|
||||
open(index) {
|
||||
// 先将正在被操作的swipeAction标记为打开状态,否则由于props的特性限制,
|
||||
// 原本为'false',再次设置为'false'会无效
|
||||
this.trackList[index].show = true;
|
||||
this.trackList.map((val, idx) => {
|
||||
if (index != idx) this.trackList[idx].show = false;
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* 跳转详情
|
||||
*/
|
||||
@@ -143,60 +116,29 @@ export default {
|
||||
uni.stopPullDownRefresh();
|
||||
uni.hideLoading();
|
||||
if (res.statusCode == 200) {
|
||||
res.data.result &&
|
||||
res.data.result.forEach((item) => {
|
||||
item.___isDel = false;
|
||||
res.data.result.records.length &&
|
||||
res.data.result.records.forEach((item) => {
|
||||
item.show = false;
|
||||
});
|
||||
|
||||
let data = res.data.result;
|
||||
let data = res.data.result.records;
|
||||
if (data.total == 0) {
|
||||
this.whetherEmpty = true;
|
||||
} else if (data.total < 10) {
|
||||
this.loadStatus = "noMore";
|
||||
this.trackList.push(...data);
|
||||
} else {
|
||||
this.trackList.push(...data);
|
||||
if (data.length < 10) this.loadStatus = "noMore";
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 点击后判断是不是全选
|
||||
*/
|
||||
changeChecked(val) {
|
||||
const isCheckedAll = this.trackList.every((key) => {
|
||||
return key.___isDel == val.___isDel;
|
||||
});
|
||||
this.allChecked = isCheckedAll;
|
||||
},
|
||||
|
||||
/**
|
||||
* 点击全选按钮
|
||||
*/
|
||||
checkedAllitem() {
|
||||
//全选按钮
|
||||
this.trackList.forEach((key) => {
|
||||
this.$set(key, "___isDel", this.allChecked);
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 删除足迹
|
||||
*/
|
||||
delAllTracks() {
|
||||
let way = [];
|
||||
this.trackList.forEach((key) => {
|
||||
if (key.___isDel) {
|
||||
way.push(key.goodsId);
|
||||
}
|
||||
});
|
||||
if (way.length == 0) return false;
|
||||
deleteHistoryListId(way).then((res) => {
|
||||
delTracks(index) {
|
||||
deleteHistoryListId(this.trackList[index].goodsId).then((res) => {
|
||||
if (res.data.code == 200) {
|
||||
this.trackList = [];
|
||||
this.allChecked = false;
|
||||
this.getList();
|
||||
} else {
|
||||
uni.showToast({
|
||||
@@ -208,18 +150,6 @@ export default {
|
||||
});
|
||||
},
|
||||
},
|
||||
|
||||
/**
|
||||
* 右侧标签栏切换
|
||||
*/
|
||||
onNavigationBarButtonTap(e) {
|
||||
if (!this.editFlag) {
|
||||
this.setStyle("完成");
|
||||
} else {
|
||||
this.setStyle("编辑");
|
||||
}
|
||||
this.editFlag = !this.editFlag;
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
@@ -270,6 +200,7 @@ export default {
|
||||
.myTracks-item-img {
|
||||
margin-right: 20rpx;
|
||||
border-radius: 8rpx;
|
||||
|
||||
image {
|
||||
width: 130rpx;
|
||||
height: 130rpx;
|
||||
@@ -293,6 +224,19 @@ export default {
|
||||
padding: 10rpx 0 0 0;
|
||||
}
|
||||
|
||||
.myTracks-action {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
background: #fff;
|
||||
height: 75rpx;
|
||||
align-items: center;
|
||||
padding: 0 32rpx;
|
||||
}
|
||||
|
||||
.myTracks-action-btn {
|
||||
width: 130rpx;
|
||||
height: 60rpx;
|
||||
@@ -304,9 +248,7 @@ export default {
|
||||
height: 20rpx;
|
||||
}
|
||||
|
||||
.myTracks-action-placeholder {
|
||||
height: 110rpx;
|
||||
}
|
||||
|
||||
|
||||
.myTracks-action-check {
|
||||
align-items: center;
|
||||
|
||||
@@ -11,11 +11,11 @@
|
||||
<u-row class="portrait-box2">
|
||||
<u-col span="6" class="portrait-box2-col" :gutter="16">
|
||||
<text>累计获得:</text>
|
||||
<text class="pcolor">{{ pointData.point || 0 }}</text>
|
||||
<text class="pcolor">{{ pointData.totalPoint || 0 }}</text>
|
||||
</u-col>
|
||||
<u-col span="6" class="portrait-box2-col">
|
||||
<text>未使用:</text>
|
||||
<text class="pcolor">{{ pointData.variablePoint || 0 }}</text>
|
||||
<text>剩余积分:</text>
|
||||
<text class="pcolor">{{ pointData.point || 0 }}</text>
|
||||
</u-col>
|
||||
</u-row>
|
||||
|
||||
|
||||
@@ -7,6 +7,9 @@
|
||||
<!-- #ifdef APP-PLUS -->
|
||||
Version {{localVersion.version}}
|
||||
<!-- #endif -->
|
||||
<!-- #ifdef MP-WEIXIN -->
|
||||
小程序版本: {{localVersion.version}} {{ localVersion.envVersion}}
|
||||
<!-- #endif -->
|
||||
</view>
|
||||
|
||||
<!-- {{localVersion}} -->
|
||||
@@ -16,6 +19,7 @@
|
||||
<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>
|
||||
@@ -29,7 +33,7 @@
|
||||
|
||||
<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>CopyRight ©{{config.name}} </view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -74,6 +78,19 @@ export default {
|
||||
};
|
||||
});
|
||||
// #endif
|
||||
|
||||
|
||||
// #ifdef MP-WEIXIN
|
||||
const accountInfo = wx.getAccountInfoSync();
|
||||
console.log("===========accountInfo==============");
|
||||
console.log(accountInfo);
|
||||
this.version_number = accountInfo.miniProgram.version // 小程序 版本号
|
||||
this.localVersion = {
|
||||
versionCode: accountInfo.miniProgram.version.replace(/\./g, ""),
|
||||
version: accountInfo.miniProgram.version ,// 小程序 版本号,
|
||||
envVersion:accountInfo.miniProgram.envVersion, //判断小程序是开发版本还是release版本
|
||||
};
|
||||
// #endif
|
||||
},
|
||||
|
||||
methods: {
|
||||
|
||||
@@ -16,9 +16,9 @@
|
||||
<!-- 上传凭证 -->
|
||||
<div class="feedBack-box">
|
||||
<view class="opt-view">
|
||||
<view class="img-title">上传凭证(最多5张)</view>
|
||||
<view class="img-title">上传凭证(最多2张)</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="2" :show-progress="false"></u-upload>
|
||||
</view>
|
||||
</view>
|
||||
</div>
|
||||
|
||||
@@ -23,12 +23,16 @@
|
||||
<u-input v-model="form.___path" disabled @click="clickRegion" />
|
||||
</u-form-item>
|
||||
<view class="submit" @click="submit">保存</view>
|
||||
<view class="submit" @click="showModalDialog">退出登录</view>
|
||||
<u-modal show-cancel-button v-model="quitShow" @confirm="confirm" :confirm-color="lightColor" :async-close="true"
|
||||
:content="'确定要退出登录么?'"></u-modal>
|
||||
</u-form>
|
||||
|
||||
<m-city :provinceData="region" headTitle="区域选择" ref="cityPicker" @funcValue="getpickerParentValue" pickerSize="4"></m-city>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
import { logout } from "@/api/login";
|
||||
import { saveUserInfo } from "@/api/members.js";
|
||||
import { upload } from "@/api/common.js";
|
||||
import storage from "@/utils/storage.js";
|
||||
@@ -38,6 +42,7 @@ export default {
|
||||
components: { uFormItem, "m-city": gkcity },
|
||||
data() {
|
||||
return {
|
||||
quitShow: false,
|
||||
lightColor: this.$lightColor, //高亮颜色
|
||||
form: {
|
||||
nickName: storage.getUserInfo().nickName || "",
|
||||
@@ -65,6 +70,35 @@ export default {
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
/**
|
||||
* 显示退出登录对话框
|
||||
*/
|
||||
showModalDialog() {
|
||||
this.quitShow = true;
|
||||
},
|
||||
|
||||
clear() {
|
||||
storage.setAccessToken("");
|
||||
storage.setRefreshToken("");
|
||||
storage.setUserInfo({});
|
||||
this.$options.filters.navigateToLogin("redirectTo");
|
||||
},
|
||||
|
||||
/**
|
||||
* 确认退出
|
||||
* 清除缓存重新登录
|
||||
*/
|
||||
async confirm() {
|
||||
try{
|
||||
await logout();
|
||||
this.clear();
|
||||
}catch(e){
|
||||
//TODO handle the exception
|
||||
this.clear();
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 选择地址回调
|
||||
*/
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
<template>
|
||||
<view class="box">
|
||||
<view class="box-tips">
|
||||
<h2>
|
||||
<h2 class='h2'>
|
||||
{{verificationTitle[validateFlage==false ? 0 : 1].title}}
|
||||
</h2>
|
||||
<view class="verification">{{verificationTitle[step].desc}}</view>
|
||||
</view>
|
||||
<u-form :model="codeForm" class="form" ref="validateCodeForm">
|
||||
<view class="form">
|
||||
<u-form :model="codeForm" ref="validateCodeForm">
|
||||
<view v-if="!validateFlage">
|
||||
<u-form-item label-width="120" label="手机号" prop="mobile">
|
||||
<u-input maxlength="11" v-model="codeForm.mobile" placeholder="请输入您的手机号" />
|
||||
@@ -14,12 +15,14 @@
|
||||
|
||||
<u-form-item class="sendCode" label-width="120" prop="code" label="验证码">
|
||||
<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>
|
||||
</u-form-item>
|
||||
|
||||
<view class="submit" @click="validatePhone">验证</view>
|
||||
<myVerification keep-running @send="verification" class="verification" ref="verification" business="FIND_USER" />
|
||||
<myVerification keep-running @send="verification" class="verification" ref="verification"
|
||||
business="FIND_USER" />
|
||||
</view>
|
||||
<view v-if="validateFlage">
|
||||
<u-form-item label-width="120" label="旧密码">
|
||||
@@ -36,12 +39,19 @@
|
||||
</view>
|
||||
</u-form>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { sendMobile, resetByMobile, modifyPass } from "@/api/login";
|
||||
import {
|
||||
sendMobile,
|
||||
resetByMobile,
|
||||
modifyPass
|
||||
} from "@/api/login";
|
||||
|
||||
import { md5 } from "@/utils/md5.js"; // md5
|
||||
import {
|
||||
md5
|
||||
} from "@/utils/md5.js"; // md5
|
||||
import myVerification from "@/components/verification/verification.vue"; //验证
|
||||
import uuid from "@/utils/uuid.modified.js";
|
||||
export default {
|
||||
@@ -52,8 +62,7 @@ export default {
|
||||
return {
|
||||
uuid,
|
||||
validateFlage: false, //是否进行了手机号验证
|
||||
verificationTitle: [
|
||||
{
|
||||
verificationTitle: [{
|
||||
title: "安全验证",
|
||||
desc: "请输入当前手机号进行安全验证",
|
||||
},
|
||||
@@ -72,28 +81,24 @@ export default {
|
||||
newPassword: "", //新密码
|
||||
password: "", //密码
|
||||
tips: "", //提示
|
||||
seconds: 60, // 60s等待时间
|
||||
seconds: 69, // 60s等待时间
|
||||
|
||||
// 验证码登录校验
|
||||
codeRules: {
|
||||
mobile: [
|
||||
{
|
||||
mobile: [{
|
||||
validator: (rule, value, callback) => {
|
||||
return this.$u.test.mobile(value);
|
||||
},
|
||||
message: "手机号码不正确",
|
||||
trigger: ["blur"],
|
||||
},
|
||||
],
|
||||
code: [
|
||||
{
|
||||
}, ],
|
||||
code: [{
|
||||
min: 4,
|
||||
max: 6,
|
||||
required: true,
|
||||
message: "请输入验证码",
|
||||
trigger: ["blur"],
|
||||
},
|
||||
],
|
||||
}, ],
|
||||
},
|
||||
};
|
||||
},
|
||||
@@ -104,6 +109,7 @@ export default {
|
||||
watch: {
|
||||
flage(val) {
|
||||
if (val) {
|
||||
|
||||
if (this.$refs.uCode.canGetCode) {
|
||||
uni.showLoading({
|
||||
title: "正在获取验证码",
|
||||
@@ -111,7 +117,7 @@ export default {
|
||||
sendMobile(this.codeForm.mobile, "FIND_USER").then((res) => {
|
||||
uni.hideLoading();
|
||||
// 这里此提示会被this.start()方法中的提示覆盖
|
||||
if (res.data.code == 200) {
|
||||
if (res.data.success) {
|
||||
this.$refs.uCode.start();
|
||||
} else {
|
||||
uni.showToast({
|
||||
@@ -119,8 +125,10 @@ export default {
|
||||
duration: 2000,
|
||||
icon: "none",
|
||||
});
|
||||
this.flage = false;
|
||||
this.$refs.verification.getCode();
|
||||
}
|
||||
});
|
||||
})
|
||||
} else {
|
||||
this.$u.toast("请倒计时结束后再发送");
|
||||
}
|
||||
@@ -176,7 +184,11 @@ export default {
|
||||
codeChange(text) {
|
||||
this.tips = text;
|
||||
},
|
||||
end() {},
|
||||
end() {
|
||||
|
||||
this.flage = false;
|
||||
this.$refs.verification.getCode()
|
||||
},
|
||||
|
||||
/**判断是否是当前用户的手机号 */
|
||||
isUserPhone() {
|
||||
@@ -198,7 +210,7 @@ export default {
|
||||
getCode() {
|
||||
if (this.isUserPhone()) {
|
||||
if (this.tips == "重新获取") {
|
||||
this.flage = true;
|
||||
this.$refs.verification.error(); //发送
|
||||
}
|
||||
if (!this.$u.test.mobile(this.codeForm.mobile)) {
|
||||
uni.showToast({
|
||||
@@ -208,41 +220,55 @@ export default {
|
||||
return false;
|
||||
}
|
||||
if (!this.flage) {
|
||||
this.$refs.verification.hide();
|
||||
this.$refs.verification.error(); //发送
|
||||
return false;
|
||||
}
|
||||
}
|
||||
},
|
||||
start() {
|
||||
this.$u.toast("验证码已发送");
|
||||
this.flage = false;
|
||||
this.flage = true;
|
||||
|
||||
this.$refs.verification.hide();
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
@import url("../../../passport/login.scss");
|
||||
.u-form-item {
|
||||
@import url("@/pages/passport/login.scss");
|
||||
|
||||
/deep/ .u-form-item {
|
||||
margin: 40rpx 0;
|
||||
}
|
||||
|
||||
.sendCode {
|
||||
/deep/ .u-form-item--right__content__slot {
|
||||
display: flex;
|
||||
}
|
||||
}
|
||||
|
||||
.h2 {
|
||||
font-size: 40rpx;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
page {
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
.box {
|
||||
padding: 80rpx 0;
|
||||
border-radius: 20rpx;
|
||||
}
|
||||
|
||||
.submit {
|
||||
background: $light-color;
|
||||
}
|
||||
|
||||
.box-tips {
|
||||
margin: 0 72rpx;
|
||||
}
|
||||
|
||||
.verification {
|
||||
font-size: 24rpx;
|
||||
color: #999;
|
||||
|
||||
@@ -22,9 +22,9 @@
|
||||
<!-- #endif -->
|
||||
<u-cell-item :title="`关于${config.name}`" @click="navigateTo('/pages/mine/set/editionIntro')"></u-cell-item>
|
||||
</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>
|
||||
:content="userInfo.id ? '确定要退出登录么?' : '确定要登录么?'"></u-modal>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
@@ -65,8 +65,14 @@ export default {
|
||||
* 清除缓存重新登录
|
||||
*/
|
||||
async confirm() {
|
||||
try{
|
||||
await logout();
|
||||
this.clear();
|
||||
}catch(e){
|
||||
//TODO handle the exception
|
||||
this.clear();
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
|
||||
@@ -22,19 +22,6 @@
|
||||
}
|
||||
}
|
||||
|
||||
.promotion {
|
||||
margin-top: 4rpx;
|
||||
display: flex;
|
||||
div {
|
||||
span {
|
||||
font-size: 24rpx;
|
||||
color: $light-color;
|
||||
margin-right: 10rpx;
|
||||
padding: 0 4rpx;
|
||||
border-radius: 2rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
.status_bar {
|
||||
height: var(--status-bar-height);
|
||||
background: #fff !important;
|
||||
@@ -437,180 +424,13 @@ view {
|
||||
margin-left: 4rpx;
|
||||
font-size: 26rpx;
|
||||
color: #888;
|
||||
|
||||
|
||||
}
|
||||
|
||||
.xia {
|
||||
transform: scaleY(-1);
|
||||
}
|
||||
}
|
||||
|
||||
.cate-item {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
height: 100%;
|
||||
width: 80rpx;
|
||||
position: relative;
|
||||
font-size: 44rpx;
|
||||
|
||||
&:after {
|
||||
content: "";
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
border-left: 1px solid #ddd;
|
||||
width: 0;
|
||||
height: 36rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* 分类 */
|
||||
.cate-mask {
|
||||
position: fixed;
|
||||
left: 0;
|
||||
top: var(--window-top);
|
||||
bottom: 0;
|
||||
width: 100%;
|
||||
background: rgba(0, 0, 0, 0);
|
||||
z-index: 95;
|
||||
transition: 0.3s;
|
||||
|
||||
.cate-content {
|
||||
width: 630rpx;
|
||||
height: 100%;
|
||||
background: #fff;
|
||||
float: right;
|
||||
transform: translateX(100%);
|
||||
transition: 0.3s;
|
||||
}
|
||||
|
||||
&.none {
|
||||
display: none;
|
||||
}
|
||||
|
||||
&.show {
|
||||
background: rgba(0, 0, 0, 0.4);
|
||||
|
||||
.cate-content {
|
||||
transform: translateX(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.cate-list {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: 100%;
|
||||
|
||||
.cate-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
height: 90rpx;
|
||||
padding-left: 30rpx;
|
||||
font-size: 28rpx;
|
||||
color: #555;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.two {
|
||||
height: 64rpx;
|
||||
color: #303133;
|
||||
font-size: 30rpx;
|
||||
background: #f8f8f8;
|
||||
}
|
||||
}
|
||||
.price-box {
|
||||
margin-top: 10rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding-right: 10rpx;
|
||||
font-size: 24rpx;
|
||||
color: $font-color-light;
|
||||
}
|
||||
|
||||
.price {
|
||||
font-size: 26rpx;
|
||||
line-height: 1;
|
||||
color: $main-color;
|
||||
font-weight: bold;
|
||||
/deep/ span:nth-of-type(1) {
|
||||
font-size: 38rpx;
|
||||
}
|
||||
}
|
||||
/* 商品列表 */
|
||||
.goods-list {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
margin: 10rpx 20rpx 284rpx;
|
||||
|
||||
|
||||
// background: #fff;
|
||||
width: 100%;
|
||||
.goods-item {
|
||||
background-color: #ffffff;
|
||||
display: flex;
|
||||
border-radius: 16rpx;
|
||||
flex-direction: column;
|
||||
width: calc(50% - 30rpx);
|
||||
margin-bottom: 20rpx;
|
||||
padding-bottom: 20rpx;
|
||||
|
||||
&:nth-child(2n + 1) {
|
||||
margin-right: 20rpx;
|
||||
}
|
||||
|
||||
.goods-detail {
|
||||
margin: 0 20rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.image-wrapper {
|
||||
width: 100%;
|
||||
height: 330rpx;
|
||||
border-radius: 16rpx 16rpx 0 0;
|
||||
overflow: hidden;
|
||||
padding: 0;
|
||||
image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
opacity: 1;
|
||||
border-radius: 16rpx 16rpx 0 0;
|
||||
}
|
||||
}
|
||||
|
||||
.title {
|
||||
font-size: $font-base;
|
||||
color: $font-color-dark;
|
||||
line-height: 1.5;
|
||||
height: 84rpx;
|
||||
padding: 10rpx 0 0;
|
||||
display: -webkit-box;
|
||||
|
||||
-webkit-box-orient: vertical;
|
||||
|
||||
-webkit-line-clamp: 2;
|
||||
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.count-config,
|
||||
.store-seller-name {
|
||||
font-size: $font-sm;
|
||||
}
|
||||
|
||||
.text-hidden {
|
||||
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
}
|
||||
|
||||
.status_bar {
|
||||
height: var(--status-bar-height);
|
||||
width: 100%;
|
||||
|
||||
@@ -35,6 +35,7 @@
|
||||
@click="doSearch(keyword)">
|
||||
<span>{{ keyword }} </span>
|
||||
</div>
|
||||
|
||||
<div @click="showMore" v-if="oldKeywordIndex > loadIndex" class="oldKeyItem">展示更多</div>
|
||||
</div>
|
||||
</view>
|
||||
@@ -82,65 +83,10 @@
|
||||
<div v-if="isSWitch">
|
||||
<scroll-view :style="{ height: goodsHeight }" enableBackToTop="true" lower-threshold="250"
|
||||
@scrolltolower="loadmore()" scroll-with-animation scroll-y class="scoll-page">
|
||||
<div class="goods-class">
|
||||
<div v-for="(item, index) in goodsList" :key="index" class="goods-row">
|
||||
<div class="flex goods-col">
|
||||
<div class="goods-img" @click="navigateToDetailPage(item)">
|
||||
<u-image width="230rpx" height="230rpx" :src="item.content.thumbnail">
|
||||
<u-loading slot="loading"></u-loading>
|
||||
</u-image>
|
||||
</div>
|
||||
<div class="goods-detail">
|
||||
<div class="title clamp3" @click="navigateToDetailPage(item)">{{ item.content.goodsName }}</div>
|
||||
<view class="price-box" @click="navigateToDetailPage(item)">
|
||||
<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 style="overflow: hidden" @click="navigateToDetailPage(item)" class="count-config">
|
||||
<span style="float: left; font-size: 22rpx">已售 {{ item.content.buyCount || '0' }}</span>
|
||||
<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>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<goodsList :res='goodsList' type='oneColumns' :keyword='keyword' />
|
||||
<uni-load-more :status="loadingType" @loadmore="loadmore()"></uni-load-more>
|
||||
</scroll-view>
|
||||
</div>
|
||||
<div class="empty" v-if="goodsList == [] || goodsList == '' || goodsList == null">
|
||||
<view>
|
||||
<image style="width: 320rpx; height: 240rpx" src="/static/nodata.png">
|
||||
|
||||
</image>
|
||||
</view>
|
||||
<view>
|
||||
<p>没有找到相关的商品信息</p>
|
||||
<p>请换一个关键词试试吧</p>
|
||||
</view>
|
||||
</div>
|
||||
|
||||
<!-- 一行两个商品展示 -->
|
||||
<div v-if="
|
||||
!isSWitch &&
|
||||
@@ -148,45 +94,7 @@
|
||||
">
|
||||
<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 v-for="(item, index) in goodsList" :key="index" class="goods-item">
|
||||
<view class="image-wrapper" @click="navigateToDetailPage(item)">
|
||||
<image :src="item.content.thumbnail" mode="aspectFill"></image>
|
||||
</view>
|
||||
<view class="goods-detail">
|
||||
<div class="title clamp" @click="navigateToDetailPage(item)">{{ item.content.goodsName }}</div>
|
||||
<view class="price-box" @click="navigateToDetailPage(item)">
|
||||
<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 class="count-config" @click="navigateToDetailPage(item)">
|
||||
<span>已售 {{ item.content.buyCount || "0" }}</span>
|
||||
<span>{{ item.content.commentNum || "0" }}条评论</span>
|
||||
</div>
|
||||
<div class="store-seller-name" @click="navigateToStoreDetailPage(item)">
|
||||
<div class="text-hidden">
|
||||
<u-tag style="margin-right: 10rpx" size="mini" mode="dark" v-if="item.selfOperated" text="自营"
|
||||
type="error" />
|
||||
<span>{{ item.content.storeName || "暂无" }}</span>
|
||||
</div>
|
||||
<span>
|
||||
<u-icon name="arrow-right"></u-icon>
|
||||
</span>
|
||||
</div>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<goodsList :res='goodsList' :keyword='keyword' />
|
||||
<uni-load-more :status="loadingType"></uni-load-more>
|
||||
</scroll-view>
|
||||
</div>
|
||||
@@ -268,22 +176,34 @@
|
||||
</view>
|
||||
</view>
|
||||
</u-popup>
|
||||
<div class="empty" v-if="empty">
|
||||
<view>
|
||||
<image style="width: 320rpx; height: 240rpx" src="/static/nodata.png">
|
||||
|
||||
</image>
|
||||
</view>
|
||||
<view>
|
||||
<p>没有找到相关的商品信息</p>
|
||||
<p>请换一个关键词试试吧</p>
|
||||
</view>
|
||||
</div>
|
||||
<u-back-top :scroll-top="scrollTop"></u-back-top>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getGoodsList, getGoodsRelated } from "@/api/goods.js";
|
||||
|
||||
import goodsList from '@/components/m-goods-list/list.vue'
|
||||
import { getHotKeywords } from "@/api/home.js";
|
||||
import mSearch from "@/components/m-search-revision/m-search-revision.vue";
|
||||
import storage from "@/utils/storage";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
empty:false,
|
||||
scrollTop: 0,
|
||||
loadIndex: 10,
|
||||
oldKeywordIndex: "",
|
||||
oldKeywordIndex: 0,
|
||||
selectedWay: {
|
||||
brand: [],
|
||||
categoryId: [],
|
||||
@@ -339,6 +259,7 @@ export default {
|
||||
routerVal: "",
|
||||
};
|
||||
},
|
||||
|
||||
onPageScroll(e) {
|
||||
console.log(e);
|
||||
this.scrollTop = e.scrollTop;
|
||||
@@ -355,6 +276,9 @@ export default {
|
||||
this.params.categoryId = this.routerVal.category;
|
||||
this.sortParams.categoryId = this.routerVal.category;
|
||||
this.isShowSeachGoods = true;
|
||||
this.$nextTick(()=>{
|
||||
this.$refs.mSearch.isShowSeachGoods = true;
|
||||
})
|
||||
}
|
||||
if (this.routerVal.keyword) {
|
||||
this.params.keyword = this.routerVal.keyword;
|
||||
@@ -368,6 +292,7 @@ export default {
|
||||
},
|
||||
components: {
|
||||
mSearch,
|
||||
goodsList
|
||||
},
|
||||
watch: {
|
||||
/**
|
||||
@@ -446,15 +371,6 @@ export default {
|
||||
return array;
|
||||
}
|
||||
},
|
||||
|
||||
// 格式化金钱 1999 --> [1999,00]
|
||||
formatPrice(val) {
|
||||
if (typeof val == "undefined") {
|
||||
return val;
|
||||
}
|
||||
return val.toFixed(2).split(".");
|
||||
},
|
||||
|
||||
// 展示更多数据
|
||||
showMore() {
|
||||
this.loadOldKeyword(this.oldKeywordIndex);
|
||||
@@ -655,7 +571,7 @@ export default {
|
||||
key: "OldKeys",
|
||||
success: (res) => {
|
||||
var OldKeys = JSON.parse(res.data);
|
||||
this.oldKeywordIndex = res.data.length;
|
||||
this.oldKeywordIndex = OldKeys.length;
|
||||
for (let i = 0; i < index; i++) {
|
||||
this.oldKeywordList.push(OldKeys[i]);
|
||||
}
|
||||
@@ -707,6 +623,9 @@ export default {
|
||||
|
||||
if (goodsList.data.result.content.length < 10) {
|
||||
this.loadingType = "noMore";
|
||||
this.empty = true
|
||||
} else {
|
||||
this.empty = false
|
||||
}
|
||||
this.goodsList.push(...goodsList.data.result.content);
|
||||
this.initSortGoods();
|
||||
@@ -756,6 +675,9 @@ export default {
|
||||
doSearchSwitch() {
|
||||
this.isSWitch = !this.isSWitch;
|
||||
this.isShowSeachGoods = true;
|
||||
this.params.pageNumber = 1
|
||||
this.params.pageSize = 10
|
||||
this.loadData("refresh", 1);
|
||||
},
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,15 +1,31 @@
|
||||
<template>
|
||||
<view class="content">
|
||||
<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>
|
||||
<div class="u-tabs-search">
|
||||
<u-search placeholder="请输入订单编号" @search="handleGetOrderList(current)" @clear="handleGetOrderList(current)"
|
||||
@custom="handleGetOrderList(current)" v-model="params.orderSn"></u-search>
|
||||
<u-search
|
||||
placeholder="请输入订单编号"
|
||||
@search="submitSearchOrderList(current)"
|
||||
@clear="submitSearchOrderList(current)"
|
||||
@custom="submitSearchOrderList(current)"
|
||||
v-model="orderSn"
|
||||
>
|
||||
</u-search>
|
||||
</div>
|
||||
<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"
|
||||
>
|
||||
<!-- 店铺名称 -->
|
||||
<view class="seller-info u-flex u-row-between" v-if="current == 0">
|
||||
<view class="seller-name">
|
||||
@@ -19,13 +35,20 @@
|
||||
</view>
|
||||
<!-- 申请记录 选项卡 -->
|
||||
<view class="seller-info u-flex u-row-between" v-if="current != 0">
|
||||
<view class="order-sn">售后单号:{{ order.service_sn || order.sn }}</view>
|
||||
<view class="order-sn"
|
||||
>售后单号:{{ order.service_sn || order.sn }}</view
|
||||
>
|
||||
<view class="order-sn">{{ order.serviceType_text }}</view>
|
||||
</view>
|
||||
<view v-for="(sku, goodsIndex) in order.orderItems" :key="goodsIndex">
|
||||
<view class="goods-item-view" @click="onDetail(order, sku)">
|
||||
<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 class="goods-info">
|
||||
<view class="goods-title u-line-2">{{ sku.name }}</view>
|
||||
@@ -38,81 +61,147 @@
|
||||
<view>x{{ sku.num }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="btn-view u-flex u-row-between">
|
||||
<view class="description">
|
||||
<!-- 售后申请 -->
|
||||
<view v-if="
|
||||
current === 0 && order.groupAfterSaleStatus &&
|
||||
order.groupAfterSaleStatus.includes('ALREADY_APPLIED')
|
||||
" class="cannot_apply">
|
||||
<view v-if="current === 0 && order.groupAfterSaleStatus">
|
||||
<view
|
||||
v-if="order.groupAfterSaleStatus.includes('ALREADY_APPLIED')"
|
||||
class="cannot_apply not_center"
|
||||
>
|
||||
<u-icon class="icon" name="info-circle-fill"></u-icon>
|
||||
该商品已申请售后服务
|
||||
</view>
|
||||
<view class="cannot_apply"
|
||||
v-if="current === 0 && order.groupAfterSaleStatus && order.groupAfterSaleStatus.includes('EXPIRED') "
|
||||
@click="tipsShow = true">
|
||||
</view>
|
||||
<view v-if="current === 0 && order.groupAfterSaleStatus">
|
||||
<view
|
||||
v-if="order.groupAfterSaleStatus.includes('EXPIRED')"
|
||||
class="cannot_apply not_center"
|
||||
@click="tipsShow = true"
|
||||
>
|
||||
<u-icon class="icon" name="info-circle-fill"></u-icon>
|
||||
该商品无法申请售后
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<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 == 'SUPPLY_AGAIN_GOODS'">
|
||||
补发商品-{{ 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>
|
||||
<view
|
||||
class="cannot_apply not_center"
|
||||
v-if="order.serviceType == 'RETURN_GOODS'"
|
||||
>
|
||||
退货处理-{{ order.serviceStatus | serviceStatusList }}</view
|
||||
>
|
||||
<view
|
||||
class="cannot_apply not_center"
|
||||
v-if="order.serviceType == 'SUPPLY_AGAIN_GOODS'"
|
||||
>
|
||||
补发商品-{{ order.serviceStatus | serviceStatusList }}</view
|
||||
>
|
||||
<view
|
||||
class="cannot_apply not_center"
|
||||
v-if="order.serviceType == 'RETURN_MONEY'"
|
||||
>
|
||||
退款-{{ order.serviceStatus | serviceStatusList }}</view
|
||||
>
|
||||
<view
|
||||
class="cannot_apply not_center"
|
||||
v-if="order.serviceType == 'EXCHANGE_GOODS'"
|
||||
>
|
||||
换货-{{ order.serviceStatus | serviceStatusList }}</view
|
||||
>
|
||||
<view
|
||||
class="cannot_apply not_center"
|
||||
v-if="order.serviceType == 'CANCEL'"
|
||||
>
|
||||
取消订单-{{ order.serviceStatus | serviceStatusList }}</view
|
||||
>
|
||||
</div>
|
||||
|
||||
<!-- 申请记录 -->
|
||||
</view>
|
||||
<view class="after-line">
|
||||
<view class="btn-view u-flex u-row-right">
|
||||
<!-- 售后申请 -->
|
||||
<view v-if="
|
||||
current === 0 && order.groupAfterSaleStatus.includes('NOT_APPLIED')
|
||||
" @click="applyService(sku.sn, order, sku)" class="rebuy-btn">
|
||||
申请售后
|
||||
</view>
|
||||
|
||||
<div class="sale" v-if="current === 0 && sku.afterSaleStatus">
|
||||
<div
|
||||
v-if="
|
||||
order.flowPrice != 0 &&
|
||||
sku.afterSaleStatus.includes('NOT_APPLIED') ||
|
||||
sku.afterSaleStatus.includes('PART_AFTER_SALE')
|
||||
"
|
||||
@click="applyService(sku.sn, order, sku)"
|
||||
>
|
||||
<view class="default-btn border"> 申请售后 </view>
|
||||
</div>
|
||||
</div>
|
||||
<view class="after-line">
|
||||
<!-- 申请中 -->
|
||||
<view class="rebuy-btn" v-if="
|
||||
<view
|
||||
class="default-btn border"
|
||||
v-if="
|
||||
current === 2 &&
|
||||
order.serviceStatus &&
|
||||
order.serviceStatus == 'PASS' &&
|
||||
order.serviceType != 'RETURN_MONEY'
|
||||
" @click="onExpress(order, sku)">
|
||||
"
|
||||
@click="onExpress(order, sku)"
|
||||
>
|
||||
提交物流
|
||||
</view>
|
||||
<view @click="afterDetails(order, sku)" v-if="current === 1 || current === 2" class="rebuy-btn">
|
||||
<view
|
||||
@click="close(order, sku)"
|
||||
v-if="current === 1"
|
||||
class="default-btn close"
|
||||
>
|
||||
取消售后
|
||||
</view>
|
||||
<view
|
||||
@click="afterDetails(order, sku)"
|
||||
v-if="current === 1 || current === 2"
|
||||
class="default-btn border"
|
||||
>
|
||||
售后详情
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="
|
||||
current === 0 && order.groupAfterSaleStatus &&
|
||||
<view
|
||||
v-if="
|
||||
current === 0 &&
|
||||
order.groupAfterSaleStatus &&
|
||||
order.groupAfterSaleStatus != 'ALREADY_APPLIED' &&
|
||||
order.orderItems.length >= 1
|
||||
" class="btn-view u-flex u-row-between">
|
||||
"
|
||||
class="btn-view u-flex u-row-between"
|
||||
>
|
||||
<!-- 多个商品显示订单总价格 -->
|
||||
<view class="cannot_apply">
|
||||
订单总金额:<span class="countMoney">¥{{ order.flowPrice | unitPrice }}</span>
|
||||
订单总金额:<span class="countMoney"
|
||||
>¥{{ order.flowPrice | unitPrice }}</span
|
||||
>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<u-loadmore bg-color="#f8f8f8" :status="status" />
|
||||
</scroll-view>
|
||||
<u-modal v-model="tipsShow" content="当订单未确认收货|已过售后服务有效期|已申请售后服务时,不能申请售后"></u-modal>
|
||||
<u-modal
|
||||
show-cancel-button
|
||||
@confirm="closeService"
|
||||
v-model="cancelShow"
|
||||
content="确认取消售后"
|
||||
></u-modal>
|
||||
<u-modal
|
||||
v-model="tipsShow"
|
||||
content="当订单未确认收货|已过售后服务有效期|已申请售后服务时,不能申请售后"
|
||||
></u-modal>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import uniLoadMore from "@/components/uni-load-more/uni-load-more.vue";
|
||||
import { getAfterSaleList } from "@/api/after-sale.js";
|
||||
import { getAfterSaleList, cancelAfterSale } from "@/api/after-sale.js";
|
||||
import { getOrderList } from "@/api/order.js";
|
||||
import storage from "@/utils/storage";
|
||||
|
||||
export default {
|
||||
components: {
|
||||
@@ -134,11 +223,14 @@ export default {
|
||||
],
|
||||
current: 0, //当前表头索引
|
||||
tipsShow: false, //提示开关
|
||||
cancelShow: false, //取消显示开关
|
||||
selectedOrder: "", //选中的order
|
||||
orderList: [], //订单集合
|
||||
params: {
|
||||
pageNumber: 1,
|
||||
pageSize: 10,
|
||||
sort: "createTime",
|
||||
flowPrice: 0,
|
||||
order: "desc",
|
||||
},
|
||||
|
||||
@@ -147,21 +239,27 @@ export default {
|
||||
pageSize: 10,
|
||||
},
|
||||
status: "loadmore",
|
||||
orderSn: "", // 搜索订单sn
|
||||
};
|
||||
},
|
||||
onLoad(options) {
|
||||
this.orderList = [];
|
||||
this.params.pageNumber = 1;
|
||||
if (options.orderSn) this.params.orderSn = options.orderSn;
|
||||
this.getOrderList(this.current);
|
||||
this.searchOrderList(this.current);
|
||||
},
|
||||
onPullDownRefresh() {
|
||||
this.change(this.current);
|
||||
},
|
||||
methods: {
|
||||
handleGetOrderList(current) {
|
||||
/**
|
||||
* 点击搜索执行搜索
|
||||
*/
|
||||
submitSearchOrderList(current) {
|
||||
this.params.pageNumber = 1;
|
||||
this.logParams.pageNumber = 1;
|
||||
this.orderList = [];
|
||||
this.getOrderList(current);
|
||||
this.searchOrderList(current);
|
||||
},
|
||||
/**
|
||||
* 切换tab页时,初始化数据
|
||||
@@ -174,8 +272,18 @@ export default {
|
||||
};
|
||||
this.orderList = [];
|
||||
//如果是2 则读取售后申请记录列表
|
||||
this.searchOrderList(index);
|
||||
uni.stopPullDownRefresh();
|
||||
},
|
||||
|
||||
/**
|
||||
* 搜索初始化
|
||||
* 根据当前tab传值的索引进行更改
|
||||
*/
|
||||
searchOrderList(index) {
|
||||
if (index == 0) {
|
||||
this.getOrderList(index);
|
||||
this.orderSn ? (this.params.orderSn = this.orderSn) : "";
|
||||
this.getOrderList();
|
||||
} else {
|
||||
this.logParams = {
|
||||
pageNumber: 1,
|
||||
@@ -186,28 +294,28 @@ export default {
|
||||
if (index === 1) {
|
||||
this.logParams.serviceStatus = "APPLY";
|
||||
}
|
||||
this.orderSn ? (this.logParams.orderSn = this.orderSn) : "";
|
||||
this.orderList = [];
|
||||
this.getAfterSaleLogList();
|
||||
}
|
||||
uni.stopPullDownRefresh();
|
||||
},
|
||||
|
||||
/**
|
||||
* 获取订单列表
|
||||
*/
|
||||
getOrderList(index) {
|
||||
getOrderList() {
|
||||
uni.showLoading({
|
||||
title: "加载中",
|
||||
mask: true,
|
||||
});
|
||||
getOrderList(this.params).then((res) => {
|
||||
uni.hideLoading();
|
||||
const orderlist = res.data.result.records;
|
||||
if (orderlist.length > 0) {
|
||||
this.orderList = this.orderList.concat(orderlist);
|
||||
const orderList = res.data.result.records;
|
||||
if (orderList.length > 0) {
|
||||
this.orderList = this.orderList.concat(orderList);
|
||||
this.params.pageNumber += 1;
|
||||
}
|
||||
if (orderlist.length < 10) {
|
||||
if (orderList.length < 10) {
|
||||
this.status = "nomore";
|
||||
} else {
|
||||
this.status = "loading";
|
||||
@@ -215,6 +323,31 @@ export default {
|
||||
});
|
||||
},
|
||||
|
||||
close(order, sku) {
|
||||
console.log(order, sku);
|
||||
this.selectedOrder = order;
|
||||
this.cancelShow = true;
|
||||
},
|
||||
|
||||
async closeService() {
|
||||
uni.showLoading({
|
||||
title: "加载中",
|
||||
});
|
||||
console.log(this.selectedOrder);
|
||||
let res = await cancelAfterSale(this.selectedOrder.sn);
|
||||
if (res.data.success) {
|
||||
uni.showToast({
|
||||
title: "取消成功!",
|
||||
duration: 2000,
|
||||
icon: "none",
|
||||
});
|
||||
}
|
||||
this.orderList = [];
|
||||
this.searchOrderList(this.current);
|
||||
|
||||
uni.hideLoading();
|
||||
},
|
||||
|
||||
/**
|
||||
* 售后详情
|
||||
*/
|
||||
@@ -261,11 +394,9 @@ export default {
|
||||
...order,
|
||||
...sku,
|
||||
};
|
||||
|
||||
storage.setAfterSaleData(data);
|
||||
uni.navigateTo({
|
||||
url: `/pages/order/afterSales/afterSalesSelect?sn=${sn}&sku=${encodeURIComponent(
|
||||
JSON.stringify(data)
|
||||
)}`,
|
||||
url: `/pages/order/afterSales/afterSalesSelect?sn=${sn}`,
|
||||
});
|
||||
},
|
||||
|
||||
@@ -274,11 +405,14 @@ export default {
|
||||
*/
|
||||
onExpress(order, sku) {
|
||||
sku.storeName = order.storeName;
|
||||
let data = {
|
||||
...order,
|
||||
...sku,
|
||||
};
|
||||
|
||||
storage.setAfterSaleData(data);
|
||||
uni.navigateTo({
|
||||
url: `./afterSalesDetailExpress?serviceSn=${
|
||||
order.sn
|
||||
}&sku=${encodeURIComponent(JSON.stringify(sku))}`,
|
||||
url: `./afterSalesDetailExpress?serviceSn=${order.sn}`,
|
||||
});
|
||||
},
|
||||
|
||||
@@ -324,35 +458,43 @@ page,
|
||||
background: $page-color-base;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.body-view {
|
||||
overflow-y: auto;
|
||||
height: calc(100vh - 44px - 80rpx - 104rpx);
|
||||
}
|
||||
|
||||
.u-tabs-search {
|
||||
padding: 20rpx;
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
.countMoney {
|
||||
margin-left: 7rpx;
|
||||
color: $main-color;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
|
||||
.seller-view {
|
||||
background-color: #fff;
|
||||
margin: 20rpx 0rpx;
|
||||
padding: 0rpx 20rpx;
|
||||
border-radius: 20rpx;
|
||||
|
||||
.seller-info {
|
||||
height: 70rpx;
|
||||
|
||||
.seller-name {
|
||||
font-size: 28rpx;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
|
||||
.name {
|
||||
margin-left: 15rpx;
|
||||
margin-top: -2rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.order-sn {
|
||||
font-size: 22rpx;
|
||||
color: #909399;
|
||||
@@ -396,6 +538,7 @@ page,
|
||||
color: $main-color;
|
||||
}
|
||||
}
|
||||
|
||||
.btn-view {
|
||||
padding: 16rpx 0;
|
||||
|
||||
@@ -405,10 +548,12 @@ page,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.description {
|
||||
color: #909399;
|
||||
size: 25rpx;
|
||||
}
|
||||
|
||||
.cannot_apply {
|
||||
text-align: center;
|
||||
font-size: 22rpx;
|
||||
@@ -417,31 +562,37 @@ page,
|
||||
height: 70rpx;
|
||||
line-height: 70rpx;
|
||||
}
|
||||
.not_center {
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.icon {
|
||||
margin-right: 10rpx;
|
||||
}
|
||||
.cancel-btn {
|
||||
color: #999999;
|
||||
border-color: #999999;
|
||||
margin-left: 15rpx;
|
||||
height: 60rpx;
|
||||
|
||||
.sale {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
}
|
||||
.pay-btn {
|
||||
background-color: #1abc9c;
|
||||
color: #ffffff;
|
||||
margin-left: 15rpx;
|
||||
height: 60rpx;
|
||||
}
|
||||
.rebuy-btn {
|
||||
|
||||
.default-btn {
|
||||
background-color: #ffffff;
|
||||
margin-left: 15rpx;
|
||||
height: 60rpx;
|
||||
line-height: 60rpx;
|
||||
text-align: center;
|
||||
font-size: 24rpx;
|
||||
border: 2rpx solid $light-color;
|
||||
color: $light-color;
|
||||
padding: 0 24rpx;
|
||||
border-radius: 200px;
|
||||
}
|
||||
|
||||
.close {
|
||||
color: $light-color;
|
||||
}
|
||||
|
||||
.border {
|
||||
border: 2rpx solid $light-color;
|
||||
color: $light-color;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -195,9 +195,7 @@ export default {
|
||||
title: navTitle, //此处写页面的title
|
||||
});
|
||||
this.sn = options.sn;
|
||||
let dsku = decodeURIComponent(options.sku);
|
||||
let newSku = JSON.parse(dsku);
|
||||
this.sku = newSku;
|
||||
this.sku = storage.getAfterSaleData();;
|
||||
|
||||
this.form.orderItemSn = options.sn;
|
||||
this.form.skuId = this.sku.skuId;
|
||||
@@ -312,6 +310,7 @@ export default {
|
||||
return false;
|
||||
}
|
||||
|
||||
console.log(this.form.accountType)
|
||||
if (this.form.accountType == "BANK_TRANSFER") {
|
||||
// 银行开户行校验
|
||||
if (this.$u.test.isEmpty(this.form.bankDepositName)) {
|
||||
@@ -336,12 +335,6 @@ export default {
|
||||
type: "error",
|
||||
});
|
||||
return false;
|
||||
} else if (checkBankno(this.form.bankAccountNumber) === false) {
|
||||
this.$refs.uToast.show({
|
||||
title: "银行卡卡号不正确",
|
||||
type: "error",
|
||||
});
|
||||
return false;
|
||||
} else if (this.$u.test.chinese(this.form.bankAccountName) === false) {
|
||||
this.$refs.uToast.show({
|
||||
title: "银行开户名输入错误",
|
||||
|
||||
@@ -57,6 +57,7 @@
|
||||
<script>
|
||||
import { getLogistics } from "@/api/address.js";
|
||||
import { fillShipInfo } from "@/api/after-sale.js";
|
||||
import storage from "@/utils/storage";
|
||||
|
||||
export default {
|
||||
data() {
|
||||
@@ -76,7 +77,8 @@ export default {
|
||||
};
|
||||
},
|
||||
onLoad(options) {
|
||||
this.sku = JSON.parse(decodeURIComponent(options.sku));
|
||||
|
||||
this.sku = storage.getAfterSaleData();
|
||||
let navTitle = "服务单详情";
|
||||
uni.setNavigationBarTitle({
|
||||
title: navTitle, //此处写页面的title
|
||||
|
||||
@@ -56,6 +56,7 @@
|
||||
|
||||
<script>
|
||||
import { getAfterSaleInfo } from "@/api/after-sale";
|
||||
import storage from "@/utils/storage";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
@@ -66,10 +67,7 @@ export default {
|
||||
},
|
||||
onLoad(options) {
|
||||
this.sn = options.sn;
|
||||
let dData = decodeURIComponent(options.sku);
|
||||
let newData = JSON.parse(dData);
|
||||
this.sku = newData;
|
||||
|
||||
this.sku = storage.getAfterSaleData();
|
||||
// 查看当前商品是否支持退款退货
|
||||
this.init()
|
||||
},
|
||||
@@ -88,9 +86,7 @@ export default {
|
||||
*/
|
||||
onSelect(value) {
|
||||
uni.redirectTo({
|
||||
url: `./afterSalesDetail?sn=${this.sn}&sku=${encodeURIComponent(
|
||||
JSON.stringify(this.sku)
|
||||
)}&value=${value}`,
|
||||
url: `./afterSalesDetail?sn=${this.sn}&value=${value}`,
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
@@ -90,9 +90,10 @@
|
||||
serviceDetail.afterSaleImage &&
|
||||
serviceDetail.afterSaleImage.split(',').length != 0
|
||||
">
|
||||
<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>
|
||||
<view v-for="(img, index) in serviceDetail.afterSaleImage.split(',')" :key="index">
|
||||
<u-image width="100" height="100" :src="img" @click="preview(serviceDetail.afterSaleImage.split(','), index)"
|
||||
></u-image>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 如果服务类型为退款则不显示 -->
|
||||
<view class="detail-item"
|
||||
@@ -197,7 +198,7 @@
|
||||
<script>
|
||||
import {
|
||||
getServiceDetail,
|
||||
getstoreAfterSaleAddress,
|
||||
getStoreAfterSaleAddress,
|
||||
getAfterSaleLog,
|
||||
getAfterSaleReason,
|
||||
} from "@/api/after-sale.js";
|
||||
@@ -315,7 +316,7 @@ export default {
|
||||
* 获取地址信息
|
||||
*/
|
||||
getAddress() {
|
||||
getstoreAfterSaleAddress(this.sn).then((res) => {
|
||||
getStoreAfterSaleAddress(this.sn).then((res) => {
|
||||
if (res.data.success) {
|
||||
this.storeAfterSaleAddress = res.data.result;
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
<view class="cell-item">
|
||||
<view class="cell-title"> 投诉凭证 </view>
|
||||
<view class="cell-view">
|
||||
<u-upload ref="uUpload" :header=" { accessToken: storage.getAccessToken() }" upload-text="" :show-progress="false" :action="action" width="100" @on-uploaded="onUploaded" :max-count="5">
|
||||
<u-upload ref="uUpload" :header=" { accessToken: storage.getAccessToken() }" upload-text="" :action="action" width="100" @on-uploaded="onUploaded" :max-count="5">
|
||||
</u-upload>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@@ -10,8 +10,15 @@
|
||||
<!-- 省市区 -->
|
||||
<div class="flex flex-a-c">
|
||||
<span class="default" v-if="address.isDefault">默认</span>
|
||||
<div class="address-list" v-if="address.consigneeAddressPath.length != 0">
|
||||
<span class="address-item" v-for="(item,index) in address.consigneeAddressPath" :key="index">
|
||||
<div
|
||||
class="address-list"
|
||||
v-if="address.consigneeAddressPath.length != 0"
|
||||
>
|
||||
<span
|
||||
class="address-item"
|
||||
v-for="(item, index) in address.consigneeAddressPath"
|
||||
:key="index"
|
||||
>
|
||||
{{ item }}
|
||||
</span>
|
||||
</div>
|
||||
@@ -38,23 +45,46 @@
|
||||
<view class="group-box" v-if="isAssemble">
|
||||
<view class="group-title">
|
||||
<span v-if="pintuanFlage">你正在开团购买</span>
|
||||
<span v-else>为你加入仅差<span>{{routerVal.parentOrder.toBeGroupedNum }}</span>人的团购买</span>
|
||||
<span v-else
|
||||
>为你加入仅差<span>{{ routerVal.parentOrder.toBeGroupedNum }}</span
|
||||
>人的团购买</span
|
||||
>
|
||||
</view>
|
||||
<view class="group">
|
||||
<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>
|
||||
<view class="line"> </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>
|
||||
</u-image>
|
||||
<u-image class="head-img" borderRadius="50%" shape="square" v-else width="81rpx" height="81rpx"
|
||||
:src="endWay.face || '/static/missing-face.png'"></u-image>
|
||||
<u-image
|
||||
class="head-img"
|
||||
borderRadius="50%"
|
||||
shape="square"
|
||||
v-else
|
||||
width="81rpx"
|
||||
height="81rpx"
|
||||
:src="endWay.face || '/static/missing-face.png'"
|
||||
></u-image>
|
||||
|
||||
<view class="wait">{{ endWay.nickname || "等待参团" }}</view>
|
||||
</view>
|
||||
@@ -62,55 +92,124 @@
|
||||
</view>
|
||||
|
||||
<!-- 店铺商品信息 -->
|
||||
<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"
|
||||
>
|
||||
<div v-if="item.checked">
|
||||
<div @click="navigateToStore(item)">
|
||||
<div class="store-name">
|
||||
<span>{{ item.storeName }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="promotionNotice">{{ item.promotionNotice || '' }}</div>
|
||||
<div class="flex goods-item" v-for="(val, i) in item.skuList" :key="i">
|
||||
<div class="goods-image"
|
||||
@click="navigateTo('/pages/product/goods?id=' + val.goodsSku.id+'&goodsId='+val.goodsSku.goodsId)" :span="3">
|
||||
<u-image borderRadius="10rpx" width="200rpx" height="200rpx" :src="val.goodsSku.thumbnail" alt />
|
||||
<div class="promotionNotice">{{ item.promotionNotice || "" }}</div>
|
||||
<div
|
||||
class="flex goods-item"
|
||||
v-for="(val, i) in item.checkedSkuList"
|
||||
:key="i"
|
||||
>
|
||||
<div
|
||||
class="goods-image"
|
||||
@click="
|
||||
navigateTo(
|
||||
'/pages/product/goods?id=' +
|
||||
val.goodsSku.id +
|
||||
'&goodsId=' +
|
||||
val.goodsSku.goodsId
|
||||
)
|
||||
"
|
||||
:span="3"
|
||||
>
|
||||
<u-image
|
||||
borderRadius="10rpx"
|
||||
width="200rpx"
|
||||
height="200rpx"
|
||||
:src="val.goodsSku.thumbnail"
|
||||
alt
|
||||
/>
|
||||
</div>
|
||||
<div @click="navigateTo('/pages/product/goods?id=' + val.goodsSku.id+'&goodsId='+val.goodsSku.goodsId)"
|
||||
class="goods-detail">
|
||||
<div
|
||||
@click="
|
||||
navigateTo(
|
||||
'/pages/product/goods?id=' +
|
||||
val.goodsSku.id +
|
||||
'&goodsId=' +
|
||||
val.goodsSku.goodsId
|
||||
)
|
||||
"
|
||||
class="goods-detail"
|
||||
>
|
||||
<div class="flex">
|
||||
<p class="goods-name">{{ val.goodsSku.goodsName }}</p>
|
||||
<span class="nums">x{{ val.num }}</span>
|
||||
</div>
|
||||
<p class="goods-prices">
|
||||
<span>¥</span>
|
||||
<span class="goods-price">{{formatPrice(val.goodsSku.price)[0]}}</span>
|
||||
<span>.{{formatPrice(val.goodsSku.price)[1] }}</span>
|
||||
<span class="goods-price">{{
|
||||
$options.filters.goodsFormatPrice(val.purchasePrice)[0]
|
||||
}}</span>
|
||||
<span>.{{ $options.filters.goodsFormatPrice(val.purchasePrice)[1] }}</span>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<u-row>
|
||||
<u-col :offset="0" :span="4">发票信息</u-col>
|
||||
<u-col :span="8" class="tipsColor" textAlign="right" @click.native="invoice()">
|
||||
<span v-if="receiptList">{{receiptList.receiptTitle}} - {{receiptList.receiptContent}}</span>
|
||||
<u-col
|
||||
:span="8"
|
||||
class="tipsColor"
|
||||
textAlign="right"
|
||||
@click.native="invoice()"
|
||||
>
|
||||
<span v-if="receiptList"
|
||||
>{{ receiptList.receiptTitle }} -
|
||||
{{ receiptList.receiptContent }}</span
|
||||
>
|
||||
<span v-else>不开发票</span>
|
||||
</u-col>
|
||||
</u-row>
|
||||
<u-row>
|
||||
<u-col v-if="orderMessage.cartTypeEnum != 'VIRTUAL'" :offset="0" :span="9" @click="shippingFlag = true">配送
|
||||
<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
|
||||
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 :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-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"></u-select>
|
||||
|
||||
<div class="box box5" v-if="orderMessage.priceDetailDTO">
|
||||
@@ -118,27 +217,49 @@
|
||||
<u-row>
|
||||
<u-col :span="9">商品合计</u-col>
|
||||
<u-col :span="3" textAlign="right">
|
||||
<span>¥{{ orderMessage.priceDetailDTO.goodsPrice | unitPrice }}</span>
|
||||
<span
|
||||
>¥{{ orderMessage.priceDetailDTO.goodsPrice | unitPrice }}</span
|
||||
>
|
||||
</u-col>
|
||||
</u-row>
|
||||
</div>
|
||||
<div>
|
||||
<u-row>
|
||||
<u-col v-if="orderMessage.cartTypeEnum != 'VIRTUAL'" :span="7">运费</u-col>
|
||||
<u-col v-if="orderMessage.cartTypeEnum != 'VIRTUAL'" :span="5" class="tr tipsColor" textAlign="right">
|
||||
<span v-if="orderMessage.priceDetailDTO.freightPrice == 0">包邮</span>
|
||||
<span v-else>¥{{
|
||||
<u-col v-if="orderMessage.cartTypeEnum != 'VIRTUAL'" :span="7"
|
||||
>运费</u-col
|
||||
>
|
||||
<u-col
|
||||
v-if="orderMessage.cartTypeEnum != 'VIRTUAL'"
|
||||
:span="5"
|
||||
class="tr tipsColor"
|
||||
textAlign="right"
|
||||
>
|
||||
<span v-if="orderMessage.priceDetailDTO.freightPrice == 0"
|
||||
>包邮</span
|
||||
>
|
||||
<span v-else
|
||||
>¥{{
|
||||
orderMessage.priceDetailDTO.freightPrice | unitPrice
|
||||
}}</span>
|
||||
}}</span
|
||||
>
|
||||
</u-col>
|
||||
</u-row>
|
||||
</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
|
||||
: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()">
|
||||
@@ -149,8 +270,15 @@
|
||||
<div>
|
||||
<u-row>
|
||||
<u-col :span="9">优惠金额</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-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>
|
||||
</div>
|
||||
@@ -158,18 +286,25 @@
|
||||
<u-row>
|
||||
<u-col :span="6">活动优惠</u-col>
|
||||
<u-col :span="6" class="tr tipsColor" textAlign="right">
|
||||
<span
|
||||
v-if="orderMessage.priceDetailDTO.discountPrice">-¥{{orderMessage.priceDetailDTO.discountPrice | unitPrice}}</span>
|
||||
<span v-if="orderMessage.priceDetailDTO.discountPrice"
|
||||
>-¥{{
|
||||
orderMessage.priceDetailDTO.discountPrice | unitPrice
|
||||
}}</span
|
||||
>
|
||||
<span v-else>0.00</span>
|
||||
</u-col>
|
||||
</u-row>
|
||||
</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
|
||||
style="width: 100%"
|
||||
:volume-icon="false"
|
||||
mode="horizontal"
|
||||
:list="notSupportFreightGoodsList"
|
||||
>
|
||||
</u-notice-bar>
|
||||
</div>
|
||||
|
||||
@@ -179,11 +314,19 @@
|
||||
<div class="tabbar-left">
|
||||
<div v-if="!orderMessage.priceDetailDTO.payPoint" class="number">
|
||||
<span>¥</span>
|
||||
<span class="price">{{ formatPrice(orderMessage.priceDetailDTO.flowPrice)[0] }}</span>
|
||||
<span>.{{formatPrice(orderMessage.priceDetailDTO.flowPrice)[1] }} </span>
|
||||
<span class="price">{{
|
||||
$options.filters.goodsFormatPrice(orderMessage.priceDetailDTO.flowPrice)[0]
|
||||
}}</span>
|
||||
<span
|
||||
>.{{ $options.filters.goodsFormatPrice(orderMessage.priceDetailDTO.flowPrice)[1] }}
|
||||
</span>
|
||||
</div>
|
||||
<span v-else class="number"><span
|
||||
style="margin-right:10rpx;">{{orderMessage.priceDetailDTO.payPoint | unitPrice }}</span>积分</span>
|
||||
<span v-else class="number"
|
||||
><span style="margin-right: 10rpx">{{
|
||||
orderMessage.priceDetailDTO.payPoint | unitPrice
|
||||
}}</span
|
||||
>积分</span
|
||||
>
|
||||
</div>
|
||||
<div class="navRiv" @click="createTradeFun()">
|
||||
<!-- #ifndef MP-WEIXIN -->
|
||||
@@ -192,7 +335,6 @@
|
||||
<!-- #ifdef MP-WEIXIN -->
|
||||
<div class="tabbar-right">微信支付</div>
|
||||
<!-- #endif -->
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -279,7 +421,7 @@ export default {
|
||||
item.route == "pages/tabbar/cart/cartList" ||
|
||||
item.route.indexOf("pages/product/goods") != -1
|
||||
) {
|
||||
uni.redirectTo({
|
||||
uni.navigateTo({
|
||||
url: item.route,
|
||||
});
|
||||
}
|
||||
@@ -313,13 +455,6 @@ export default {
|
||||
mounted() {},
|
||||
|
||||
methods: {
|
||||
// 格式化金钱 1999 --> [1999,00]
|
||||
formatPrice(val) {
|
||||
if (typeof val == "undefined") {
|
||||
return val;
|
||||
}
|
||||
return val.toFixed(2).split(".");
|
||||
},
|
||||
//发票回调 选择发票之后刷新购物车
|
||||
async callbackInvoice(val) {
|
||||
this.invoiceFlag = false;
|
||||
@@ -378,6 +513,20 @@ export default {
|
||||
// 循环店铺id,商品id获取优惠券
|
||||
let store = [];
|
||||
let skus = [];
|
||||
let selectedCoupon = [];
|
||||
if (this.orderMessage.platformCoupon)
|
||||
selectedCoupon.push(this.orderMessage.platformCoupon.memberCoupon.id);
|
||||
if (
|
||||
this.orderMessage.storeCoupons &&
|
||||
Object.keys(this.orderMessage.storeCoupons)[0]
|
||||
) {
|
||||
let storeMemberCouponsId = Object.keys(
|
||||
this.orderMessage.storeCoupons
|
||||
)[0];
|
||||
let storeCouponId =
|
||||
this.orderMessage.storeCoupons[storeMemberCouponsId].memberCoupon.id;
|
||||
selectedCoupon.push(storeCouponId);
|
||||
}
|
||||
this.orderMessage.cartList.forEach((item) => {
|
||||
item.skuList.forEach((sku) => {
|
||||
store.push(sku.storeId);
|
||||
@@ -391,7 +540,7 @@ export default {
|
||||
data: this.orderMessage.priceDetailDTO.goodsPrice,
|
||||
});
|
||||
this.navigateTo(
|
||||
`/pages/cart/coupon/index?way=${this.routerVal.way}&storeId=${store}&skuId=${skus}`
|
||||
`/pages/cart/coupon/index?way=${this.routerVal.way}&storeId=${store}&skuId=${skus}&selectedCoupon=${selectedCoupon}`
|
||||
);
|
||||
},
|
||||
|
||||
@@ -455,7 +604,7 @@ export default {
|
||||
});
|
||||
// 如果当前价格为0跳转到订单列表
|
||||
if (this.orderMessage.priceDetailDTO.billPrice == 0) {
|
||||
uni.redirectTo({
|
||||
uni.navigateTo({
|
||||
url: "/pages/order/myOrder?status=0",
|
||||
});
|
||||
} else {
|
||||
@@ -507,9 +656,22 @@ export default {
|
||||
|
||||
// 获取结算参数
|
||||
getOrderList() {
|
||||
this.notSupportFreight = []
|
||||
this.notSupportFreight = [];
|
||||
// 获取结算参数
|
||||
API_Trade.getCheckoutParams(this.routerVal.way).then((res) => {
|
||||
if (
|
||||
!res.data.result.checkedSkuList ||
|
||||
res.data.result.checkedSkuList.length === 0
|
||||
) {
|
||||
uni.switchTab({
|
||||
url: "/pages/tabbar/cart/cartList",
|
||||
});
|
||||
}
|
||||
if (res.data.result.skuList.length <= 0) {
|
||||
uni.navigateTo({
|
||||
url: "/pages/order/myOrder?status=0",
|
||||
});
|
||||
}
|
||||
res.data.result.cartList.forEach((item, index) => {
|
||||
this.remarkVal[index] = {
|
||||
remark: item.remark,
|
||||
|
||||
@@ -1,15 +1,43 @@
|
||||
<template>
|
||||
<view class="content">
|
||||
<view class="navbar">
|
||||
<view v-for="(item, index) in navList" :key="index" class="nav-item" :class="{ current: tabCurrentIndex === index }" @click="tabClick(index)">{{ item.text }}</view>
|
||||
<view
|
||||
v-for="(item, index) in navList"
|
||||
:key="index"
|
||||
class="nav-item"
|
||||
:class="{ current: tabCurrentIndex === index }"
|
||||
@click="tabClick(index)"
|
||||
>{{ item.text }}</view
|
||||
>
|
||||
</view>
|
||||
<swiper :current="tabCurrentIndex" class="swiper-box" duration="300" @change="changeTab">
|
||||
<swiper-item class="tab-content" v-for="(tabItem, tabIndex) in navList" :key="tabIndex">
|
||||
<scroll-view class="list-scroll-content" scroll-y @scrolltolower="loadData(tabIndex)">
|
||||
<swiper
|
||||
:current="tabCurrentIndex"
|
||||
class="swiper-box"
|
||||
duration="300"
|
||||
@change="changeTab"
|
||||
>
|
||||
<swiper-item
|
||||
class="tab-content"
|
||||
v-for="(tabItem, tabIndex) in navList"
|
||||
:key="tabIndex"
|
||||
>
|
||||
<scroll-view
|
||||
class="list-scroll-content"
|
||||
scroll-y
|
||||
@scrolltolower="loadData(tabIndex)"
|
||||
>
|
||||
<!-- 空白页 -->
|
||||
<u-empty text="暂无订单" mode="list" v-if="tabItem.loaded === true && tabItem.orderList.length === 0"></u-empty>
|
||||
<u-empty
|
||||
text="暂无订单"
|
||||
mode="list"
|
||||
v-if="tabItem.loaded === true && tabItem.orderList.length === 0"
|
||||
></u-empty>
|
||||
<!-- 订单列表 -->
|
||||
<view class="seller-view" :key="oderIndex" v-for="(order, oderIndex) in tabItem.orderList">
|
||||
<view
|
||||
class="seller-view"
|
||||
:key="oderIndex"
|
||||
v-for="(order, oderIndex) in tabItem.orderList"
|
||||
>
|
||||
<!-- 店铺名称 -->
|
||||
<view class="seller-info u-flex u-row-between">
|
||||
<view class="seller-name" @click="navigateToStore(order)">
|
||||
@@ -21,13 +49,32 @@
|
||||
</view>
|
||||
<view>
|
||||
<view>
|
||||
<view class="goods-item-view" @click="navigateToOrderDetail(order.sn)">
|
||||
<view class="goods-img" v-for="(goods, goodsIndex) in order.orderItems" :key="goodsIndex">
|
||||
<u-image border-radius="6" width="100%" height="100%" :src="goods.image"></u-image>
|
||||
<view
|
||||
class="goods-item-view"
|
||||
@click="navigateToOrderDetail(order.sn)"
|
||||
>
|
||||
<view
|
||||
class="goods-img"
|
||||
v-for="(goods, goodsIndex) in order.orderItems"
|
||||
:key="goodsIndex"
|
||||
>
|
||||
<u-image
|
||||
border-radius="6"
|
||||
width="100%"
|
||||
height="100%"
|
||||
:src="goods.image"
|
||||
></u-image>
|
||||
</view>
|
||||
<view class="goods-info">
|
||||
<view v-if="order.orderItems.length <= 1" class="goods-title u-line-2">{{ order.groupName }}</view>
|
||||
<view v-if="order.orderItems.length <= 1" class="goods-price">
|
||||
<view
|
||||
v-if="order.orderItems.length <= 1"
|
||||
class="goods-title u-line-2"
|
||||
>{{ order.groupName }}</view
|
||||
>
|
||||
<view
|
||||
v-if="order.orderItems.length <= 1"
|
||||
class="goods-price"
|
||||
>
|
||||
¥{{ order.flowPrice | unitPrice }}
|
||||
</view>
|
||||
</view>
|
||||
@@ -45,19 +92,56 @@
|
||||
</view>
|
||||
<view>
|
||||
<!-- 全部 -->
|
||||
<u-button ripple class="pay-btn" shape="circle" size="mini" v-if="order.allowOperationVO.pay" @click="waitPay(order)">立即付款</u-button>
|
||||
<u-button
|
||||
ripple
|
||||
class="pay-btn"
|
||||
shape="circle"
|
||||
size="mini"
|
||||
v-if="order.allowOperationVO.pay"
|
||||
@click="waitPay(order)"
|
||||
>立即付款</u-button
|
||||
>
|
||||
<!-- 取消订单 -->
|
||||
<u-button ripple class="cancel-btn" shape="circle" size="mini" v-if="order.allowOperationVO.cancel" @click="onCancel(order.sn)">
|
||||
<u-button
|
||||
ripple
|
||||
class="cancel-btn"
|
||||
shape="circle"
|
||||
size="mini"
|
||||
v-if="order.allowOperationVO.cancel"
|
||||
@click="onCancel(order.sn)"
|
||||
>
|
||||
取消订单
|
||||
</u-button>
|
||||
<!-- 等待收货 -->
|
||||
<u-button ripple shape="circle" class="rebuy-btn" size="mini" v-if="order.allowOperationVO.showLogistics" @click="navigateToLogistics(order)">
|
||||
<u-button
|
||||
ripple
|
||||
shape="circle"
|
||||
class="rebuy-btn"
|
||||
size="mini"
|
||||
v-if="order.allowOperationVO.showLogistics"
|
||||
@click="navigateToLogistics(order)"
|
||||
>
|
||||
查看物流
|
||||
</u-button>
|
||||
<u-button ripple :customStyle="{'background':lightColor,'color':'#fff' }" shape="circle" class="pay-btn" size="mini" v-if="order.allowOperationVO.rog" @click="onRog(order.sn)">
|
||||
<u-button
|
||||
ripple
|
||||
:customStyle="{ background: lightColor, color: '#fff' }"
|
||||
shape="circle"
|
||||
class="pay-btn"
|
||||
size="mini"
|
||||
v-if="order.allowOperationVO.rog"
|
||||
@click="onRog(order.sn)"
|
||||
>
|
||||
确认收货
|
||||
</u-button>
|
||||
<u-button ripple shape="circle" class="cancel-btn" size="mini" v-if="order.groupAfterSaleStatus.includes('NOT_APPLIED')" @click="applyService(order)">
|
||||
<u-button
|
||||
ripple
|
||||
shape="circle"
|
||||
class="cancel-btn"
|
||||
size="mini"
|
||||
v-if="order.groupAfterSaleStatus && order.groupAfterSaleStatus.includes('NOT_APPLIED')"
|
||||
@click="applyService(order)"
|
||||
>
|
||||
退款/售后
|
||||
</u-button>
|
||||
<!-- TODO 后续完善 -->
|
||||
@@ -75,26 +159,57 @@
|
||||
</scroll-view>
|
||||
</swiper-item>
|
||||
</swiper>
|
||||
<u-popup class="cancel-popup" v-model="cancelShow" mode="bottom" length="60%">
|
||||
<u-popup
|
||||
class="cancel-popup"
|
||||
v-model="cancelShow"
|
||||
mode="bottom"
|
||||
length="60%"
|
||||
>
|
||||
<view class="header">取消订单</view>
|
||||
<view class="body">
|
||||
<view class="title">取消订单后,本单享有的优惠可能会一并取消,是否继续?</view>
|
||||
<view class="title"
|
||||
>取消订单后,本单享有的优惠可能会一并取消,是否继续?</view
|
||||
>
|
||||
<view>
|
||||
<u-radio-group v-model="reason">
|
||||
<view class="value">
|
||||
<view class="radio-view" :key="index" v-for="(item, index) in cancelList">
|
||||
<u-radio :active-color="lightColor" label-size="25" shape="circle" :name="item.reason" @change="reasonChange">{{ item.reason }}</u-radio>
|
||||
<view
|
||||
class="radio-view"
|
||||
:key="index"
|
||||
v-for="(item, index) in cancelList"
|
||||
>
|
||||
<u-radio
|
||||
:active-color="lightColor"
|
||||
label-size="25"
|
||||
shape="circle"
|
||||
:name="item.reason"
|
||||
@change="reasonChange"
|
||||
>{{ item.reason }}</u-radio
|
||||
>
|
||||
</view>
|
||||
</view>
|
||||
</u-radio-group>
|
||||
</view>
|
||||
</view>
|
||||
<view class="footer">
|
||||
<u-button size="medium" ripple v-if="reason" shape="circle" @click="submitCancel">提交</u-button>
|
||||
<u-button
|
||||
size="medium"
|
||||
ripple
|
||||
v-if="reason"
|
||||
shape="circle"
|
||||
@click="submitCancel"
|
||||
>提交</u-button
|
||||
>
|
||||
</view>
|
||||
</u-popup>
|
||||
<u-toast ref="uToast" />
|
||||
<u-modal :confirm-color="lightColor" v-model="rogShow" :show-cancel-button="true" :content="'是否确认收货?'" @confirm="confirmRog"></u-modal>
|
||||
<u-modal
|
||||
:confirm-color="lightColor"
|
||||
v-model="rogShow"
|
||||
:show-cancel-button="true"
|
||||
:content="'是否确认收货?'"
|
||||
@confirm="confirmRog"
|
||||
></u-modal>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
@@ -196,17 +311,28 @@ export default {
|
||||
*/
|
||||
onBackPress(e) {
|
||||
if (e.from == "backbutton") {
|
||||
uni.reLaunch({
|
||||
uni.switchTab({
|
||||
url: "/pages/tabbar/user/my",
|
||||
});
|
||||
return true; //阻止默认返回行为
|
||||
}
|
||||
},
|
||||
onPullDownRefresh() {
|
||||
this.loadData(this.status);
|
||||
if (this.tabCurrentIndex) {
|
||||
this.initData(this.tabCurrentIndex);
|
||||
} else {
|
||||
this.initData(0);
|
||||
}
|
||||
// this.loadData(this.status);
|
||||
},
|
||||
onShow() {
|
||||
if(this.$options.filters.tipsToLogin()){
|
||||
if (!this.tabCurrentIndex) {
|
||||
this.initData(0);
|
||||
}
|
||||
}
|
||||
// this.loadData(this.status);
|
||||
},
|
||||
|
||||
|
||||
|
||||
onLoad(options) {
|
||||
/**
|
||||
@@ -215,11 +341,11 @@ export default {
|
||||
*/
|
||||
let status = Number(options.status);
|
||||
this.status = status;
|
||||
this.tabCurrentIndex = status;
|
||||
if (status == 0) {
|
||||
this.loadData(status);
|
||||
}
|
||||
|
||||
this.tabCurrentIndex = status;
|
||||
// if (status == 0) {
|
||||
// this.loadData(status);
|
||||
// }
|
||||
},
|
||||
|
||||
watch: {
|
||||
@@ -236,16 +362,11 @@ export default {
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
|
||||
|
||||
// 售后
|
||||
applyService(order) {
|
||||
|
||||
|
||||
uni.navigateTo({
|
||||
url: `/pages/order/afterSales/afterSales?orderSn=${order.sn}`
|
||||
url: `/pages/order/afterSales/afterSales?orderSn=${order.sn}`,
|
||||
});
|
||||
|
||||
},
|
||||
|
||||
// 店铺详情
|
||||
@@ -314,6 +435,7 @@ export default {
|
||||
*/
|
||||
loadData(index) {
|
||||
this.params.pageNumber = this.navList[index].pageNumber;
|
||||
// this.params.tag = this.orderStatus[index].orderStatus;
|
||||
getOrderList(this.params).then((res) => {
|
||||
uni.stopPullDownRefresh();
|
||||
if (!res.data.success) {
|
||||
|
||||
@@ -324,7 +324,7 @@ export default {
|
||||
},
|
||||
gotoGoodsDetail(sku) {
|
||||
uni.navigateTo({
|
||||
url: `/pages/product/goods?id=${sku.id}&goodsId=${sku.goodsId}`,
|
||||
url: `/pages/product/goods?id=${sku.skuId}&goodsId=${sku.goodsId}`,
|
||||
});
|
||||
},
|
||||
onCopy(sn) {
|
||||
|
||||
@@ -4,23 +4,20 @@
|
||||
<u-navbar :is-back="showBack" :border-bottom="false"></u-navbar>
|
||||
<div>
|
||||
<div class="title">{{ loginTitleWay[current].title }}</div>
|
||||
<div :class="current == 1 ? 'desc-light':'desc'">{{loginTitleWay[current].desc}}<span
|
||||
v-if="current == 1">{{mobile | secrecyMobile}}</span></div>
|
||||
<div :class="current == 1 ? 'desc-light' : 'desc'">
|
||||
{{ loginTitleWay[current].desc
|
||||
}}<span v-if="current == 1">{{ mobile | secrecyMobile }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 手机号 -->
|
||||
<div v-show="!enableUserPwdBox">
|
||||
<div v-show="current == 0">
|
||||
<u-input :custom-style="inputStyle" :placeholder-style="placeholderStyle" placeholder="请输入手机号 (11位)"
|
||||
class='mobile' focus v-model="mobile" type="number" maxlength="11" />
|
||||
<div :class="!enabuleFetchCode ?'disable':'fetch'" @click="fetchCode" class=" btn">获取验证码</div>
|
||||
<div class="flex">
|
||||
<u-checkbox-group :icon-size="24" width="45rpx">
|
||||
<u-checkbox shape="circle" v-model="enabulePrivacy" active-color="#FF5E00"></u-checkbox>
|
||||
</u-checkbox-group>
|
||||
<div class="tips">未注册的手机号验证后将自动创建用户账号,登录即代表您已同意<span @click="navigateToPrivacy('privacy')">《使用条款及隐私协议》</span>
|
||||
class="mobile" focus v-model="mobile" type="number" maxlength="11" />
|
||||
<div :class="!enableFetchCode ? 'disable' : 'fetch'" @click="fetchCode" class="btn">
|
||||
获取验证码
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!-- 输入验证码 -->
|
||||
<div v-show="current == 1" class="box-code">
|
||||
<verifyCode type="bottom" @confirm="submit" boxActiveColor="#D8D8D8" v-model="code" isFocus
|
||||
@@ -28,21 +25,55 @@
|
||||
|
||||
<div class="fetch-btn">
|
||||
<u-verification-code change-text="验证码已发送(x)" end-text="重新获取验证码" unique-key="page-login"
|
||||
:seconds="seconds" @end="end" @start="start" ref="uCode" @change="codeChange"></u-verification-code>
|
||||
<span @tap="fetchCode" :style="{color:codeColor}"> {{tips}}</span>
|
||||
:seconds="seconds" @end="end" @start="start" ref="uCode" @change="codeChange">
|
||||
</u-verification-code>
|
||||
<span @tap="fetchCode" :style="{ color: codeColor }">
|
||||
{{ tips }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 帐号密码登录 -->
|
||||
<div v-show="enableUserPwdBox">
|
||||
<u-input :custom-style="inputStyle" :placeholder-style="placeholderStyle" placeholder="请输入用户名"
|
||||
class="mobile" focus v-model="userData.username" />
|
||||
<u-input :custom-style="inputStyle" :placeholder-style="placeholderStyle" placeholder="请输入密码"
|
||||
class="mobile" focus v-model="userData.password" type="password" />
|
||||
|
||||
<div :class="!enableUserBtnColor ? 'disable' : 'fetch'" @click="passwordLogin" class="btn">
|
||||
帐号密码登录
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex" v-show="current != 1">
|
||||
<u-checkbox-group :icon-size="24" width="45rpx">
|
||||
<u-checkbox shape="circle" v-model="enablePrivacy" active-color="#FF5E00"></u-checkbox>
|
||||
</u-checkbox-group>
|
||||
<div class="tips">
|
||||
未注册的手机号验证后将自动创建用户账号,登录即代表您已同意<span @click="navigateToPrivacy('privacy')">《隐私协议》</span>
|
||||
<span @click="navigateToPrivacys('user')">
|
||||
《用户协议》
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div v-if="current != 1" class="user-password-tips" @click="enableUserPwdBox = !enableUserPwdBox">
|
||||
{{ !enableUserPwdBox ? "帐号密码" : "手机号" }}登录
|
||||
</div>
|
||||
|
||||
<!-- 循环出当前可使用的第三方登录模式 -->
|
||||
<div class="flex login-list">
|
||||
<div :style="{background:item.color}" class="login-item" v-for="(item,index) in loginList" :key="index">
|
||||
<u-icon v-if="item.title!='APPLE'" color="#fff" size="42" :name="item.icon" @click="navigateLogin(item)">
|
||||
<div v-if="item.code" :style="{ background: item.color }" class="login-item"
|
||||
v-for="(item, index) in loginList" :key="index">
|
||||
<u-icon v-if="item.title != 'APPLE'" color="#fff" size="42" :name="item.icon"
|
||||
@click="navigateLogin(item)">
|
||||
</u-icon>
|
||||
<u-image v-else src="/static/appleidButton@2x.png" :lazy-load="false" @click="navigateLogin(item)" width="80"
|
||||
height="80" />
|
||||
<u-image v-else src="/static/appleidButton@2x.png" :lazy-load="false" @click="navigateLogin(item)"
|
||||
width="80" height="80" />
|
||||
</div>
|
||||
</div>
|
||||
<myVerification v-if="codeFlag" @send="verification" class="verification" ref="verification" business="LOGIN" />
|
||||
<myVerification v-if="codeFlag" @send="verification" class="verification" ref="verification"
|
||||
business="LOGIN" />
|
||||
</div>
|
||||
<view v-else>
|
||||
<wechatH5Login />
|
||||
@@ -51,19 +82,40 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { openIdLogin, loginCallback } from "@/api/connect.js";
|
||||
import {
|
||||
openIdLogin,
|
||||
loginCallback
|
||||
} from "@/api/connect.js";
|
||||
import api from "@/config/api.js";
|
||||
import { sendMobile, smsLogin } from "@/api/login";
|
||||
import {
|
||||
sendMobile,
|
||||
smsLogin,
|
||||
userLogin
|
||||
} from "@/api/login";
|
||||
import myVerification from "@/components/verification/verification.vue"; //验证码模块
|
||||
import uuid from "@/utils/uuid.modified.js"; // uuid
|
||||
import verifyCode from "@/components/verify-code/verify-code";
|
||||
import { getUserInfo } from "@/api/members";
|
||||
import { whetherNavigate } from "@/utils/Foundation"; //登录跳转
|
||||
import {
|
||||
getUserInfo
|
||||
} from "@/api/members";
|
||||
import {
|
||||
whetherNavigate
|
||||
} from "@/utils/Foundation"; //登录跳转
|
||||
import storage from "@/utils/storage.js"; //缓存
|
||||
import wechatH5Login from "./wechatH5Login.vue";
|
||||
import { webConnect } from "@/api/connect.js";
|
||||
import {
|
||||
webConnect
|
||||
} from "@/api/connect.js";
|
||||
import {
|
||||
md5
|
||||
} from "@/utils/md5.js";
|
||||
|
||||
export default {
|
||||
components: { myVerification, verifyCode, wechatH5Login },
|
||||
components: {
|
||||
myVerification,
|
||||
verifyCode,
|
||||
wechatH5Login
|
||||
},
|
||||
|
||||
data() {
|
||||
return {
|
||||
@@ -72,12 +124,12 @@ export default {
|
||||
flage: false, //是否验证码验证
|
||||
codeFlag: true, //验证开关,用于是否展示验证码
|
||||
tips: "",
|
||||
enableUserPwdBox: false, //帐号密码登录
|
||||
current: 0,
|
||||
codeColor: "#999", //按钮验证码颜色
|
||||
lightColor: this.$lightColor,
|
||||
seconds: 60, //默认验证码等待时间
|
||||
loginTitleWay: [
|
||||
{
|
||||
loginTitleWay: [{
|
||||
title: "欢迎登录",
|
||||
desc: "登录后更精彩,美好生活即将开始",
|
||||
},
|
||||
@@ -86,9 +138,14 @@ export default {
|
||||
desc: "已经发送验证码至",
|
||||
},
|
||||
],
|
||||
userData: {
|
||||
username: "",
|
||||
password: "",
|
||||
},
|
||||
showBack: false,
|
||||
enabuleFetchCode: false,
|
||||
enabulePrivacy: false, //隐私政策
|
||||
enableFetchCode: false,
|
||||
enableUserBtnColor: false,
|
||||
enablePrivacy: false, //隐私政策
|
||||
mobile: "", //手机号
|
||||
code: "", //验证码
|
||||
inputStyle: {
|
||||
@@ -124,6 +181,15 @@ export default {
|
||||
};
|
||||
},
|
||||
onShow() {
|
||||
|
||||
// 只要是app登录的全部清除内容
|
||||
// #ifdef APP-PLUS
|
||||
storage.setAccessToken("");
|
||||
storage.setRefreshToken("");
|
||||
storage.setUserInfo({});
|
||||
// #endif
|
||||
|
||||
|
||||
//#ifdef H5
|
||||
let isWXBrowser = /micromessenger/i.test(navigator.userAgent);
|
||||
if (isWXBrowser) {
|
||||
@@ -137,7 +203,6 @@ export default {
|
||||
//#endif
|
||||
},
|
||||
|
||||
|
||||
mounted() {
|
||||
// #ifndef APP-PLUS
|
||||
//判断是否微信浏览器
|
||||
@@ -225,10 +290,21 @@ export default {
|
||||
current(val) {
|
||||
val ? (this.showBack = true) : (this.showBack = false);
|
||||
},
|
||||
userData: {
|
||||
handler(val) {
|
||||
if (this.userData.username && this.userData.password) {
|
||||
this.enableUserBtnColor = true;
|
||||
} else {
|
||||
this.enableUserBtnColor = false;
|
||||
}
|
||||
},
|
||||
deep: true,
|
||||
|
||||
},
|
||||
mobile: {
|
||||
handler(val) {
|
||||
if (val.length == 11) {
|
||||
this.enabuleFetchCode = true;
|
||||
this.enableFetchCode = true;
|
||||
}
|
||||
},
|
||||
},
|
||||
@@ -236,6 +312,11 @@ export default {
|
||||
async flage(val) {
|
||||
if (val) {
|
||||
if (this.$refs.uCode.canGetCode) {
|
||||
if (this.enableUserPwdBox) {
|
||||
this.submitUserLogin();
|
||||
return;
|
||||
// 执行登录
|
||||
} else {
|
||||
// 向后端请求验证码
|
||||
uni.showLoading({});
|
||||
let res = await sendMobile(this.mobile);
|
||||
@@ -251,9 +332,11 @@ export default {
|
||||
icon: "none",
|
||||
});
|
||||
this.flage = false;
|
||||
this.$refs.verification.getCode();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
this.$u.toast("请倒计时结束后再发送");
|
||||
!this.enableUserPwdBox ? this.$u.toast("请倒计时结束后再发送") : "";
|
||||
}
|
||||
} else {
|
||||
this.$refs.verification.hide();
|
||||
@@ -282,11 +365,11 @@ export default {
|
||||
storage.setUserInfo(user.data.result);
|
||||
storage.setHasLogin(true);
|
||||
});
|
||||
getCurrentPages().length > 1
|
||||
? uni.navigateBack({
|
||||
getCurrentPages().length > 1 ?
|
||||
uni.navigateBack({
|
||||
delta: getCurrentPages().length - 2,
|
||||
})
|
||||
: uni.switchTab({
|
||||
}) :
|
||||
uni.switchTab({
|
||||
url: "/pages/tabbar/home/index",
|
||||
});
|
||||
}
|
||||
@@ -396,13 +479,21 @@ export default {
|
||||
*/
|
||||
storage.setUserInfo(user.data.result);
|
||||
storage.setHasLogin(true);
|
||||
|
||||
uni.switchTab({
|
||||
url: "/pages/tabbar/home/index",
|
||||
});
|
||||
/**
|
||||
* 计算出当前router路径
|
||||
* 1.如果跳转的链接为登录页面或跳转的链接为空页面。则会重新跳转到首页
|
||||
* 2.都不满足返回跳转页面
|
||||
*/
|
||||
if (user.data.result.mobile) {
|
||||
whetherNavigate();
|
||||
} else {
|
||||
uni.navigateTo({
|
||||
url: "/pages/passport/bindUserPhone",
|
||||
});
|
||||
}
|
||||
} else {
|
||||
uni.switchTab({
|
||||
url: "/pages/tabbar/home/index",
|
||||
@@ -423,7 +514,10 @@ export default {
|
||||
// #ifdef H5
|
||||
let code = connectLogin.code;
|
||||
let buyer = api.buyer;
|
||||
window.open(buyer + `/connect/login/web/` + code, "_self");
|
||||
window.open(
|
||||
buyer + `/passport/connect/connect/login/web/` + code,
|
||||
"_self"
|
||||
);
|
||||
// #endif
|
||||
// #ifdef APP-PLUS
|
||||
this.nonH5OpenId(connectLogin);
|
||||
@@ -438,13 +532,23 @@ export default {
|
||||
storage.setHasLogin(false);
|
||||
storage.setAccessToken("");
|
||||
storage.setRefreshToken("");
|
||||
storage.setUuid(this.uuid.v1());
|
||||
storage.setUserInfo({});
|
||||
/**
|
||||
* 执行登录
|
||||
*/
|
||||
smsLogin({ mobile: this.mobile, code: this.code }, this.clientType).then(
|
||||
smsLogin({
|
||||
mobile: this.mobile,
|
||||
code: this.code
|
||||
}, this.clientType).then(
|
||||
(res) => {
|
||||
this.getUserInfoMethods(res);
|
||||
}
|
||||
);
|
||||
},
|
||||
|
||||
// 登录成功之后获取用户信息
|
||||
getUserInfoMethods(res) {
|
||||
console.log(res);
|
||||
if (res.data.success) {
|
||||
storage.setAccessToken(res.data.result.accessToken);
|
||||
storage.setRefreshToken(res.data.result.refreshToken);
|
||||
@@ -465,12 +569,9 @@ export default {
|
||||
icon: "none",
|
||||
});
|
||||
|
||||
/**
|
||||
* 计算出当前router路径
|
||||
* 1.如果跳转的链接为登录页面或跳转的链接为空页面。则会重新跳转到首页
|
||||
* 2.都不满足返回跳转页面
|
||||
*/
|
||||
|
||||
whetherNavigate();
|
||||
|
||||
} else {
|
||||
uni.switchTab({
|
||||
url: "/pages/tabbar/home/index",
|
||||
@@ -478,9 +579,8 @@ export default {
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
);
|
||||
},
|
||||
|
||||
// 验证码验证
|
||||
verification(val) {
|
||||
this.flage = val == this.$store.state.verificationKey ? true : false;
|
||||
@@ -490,6 +590,12 @@ export default {
|
||||
uni.navigateTo({
|
||||
url: "/pages/mine/help/tips?type=" + val,
|
||||
});
|
||||
console.log(val)
|
||||
},
|
||||
navigateToPrivacys(val) {
|
||||
uni.navigateTo({
|
||||
url: "/pages/mine/help/tips?type=" + val,
|
||||
})
|
||||
},
|
||||
// 点击获取验证码
|
||||
start() {
|
||||
@@ -510,9 +616,63 @@ export default {
|
||||
this.codeFlag = true;
|
||||
console.log(this.codeColor);
|
||||
},
|
||||
|
||||
passwordLogin() {
|
||||
if (!this.enablePrivacy) {
|
||||
uni.showToast({
|
||||
title: "请同意用户隐私",
|
||||
duration: 2000,
|
||||
icon: "none",
|
||||
});
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!this.userData.username) {
|
||||
uni.showToast({
|
||||
title: "请填写用户名",
|
||||
duration: 2000,
|
||||
icon: "none",
|
||||
});
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!this.userData.password) {
|
||||
uni.showToast({
|
||||
title: "请填写密码",
|
||||
duration: 2000,
|
||||
icon: "none",
|
||||
});
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!this.flage) {
|
||||
this.$refs.verification.error(); //发送
|
||||
|
||||
return false;
|
||||
}
|
||||
},
|
||||
|
||||
// 提交用户登录
|
||||
async submitUserLogin() {
|
||||
const params = JSON.parse(JSON.stringify(this.userData));
|
||||
params.password = md5(params.password);
|
||||
try {
|
||||
let res = await userLogin(params);
|
||||
if (res.data.success) {
|
||||
console.log("zhixing ")
|
||||
this.getUserInfoMethods(res);
|
||||
} else {
|
||||
this.$refs.verification.getCode();
|
||||
this.flage = false;
|
||||
}
|
||||
} catch (error) {
|
||||
this.$refs.verification.getCode();
|
||||
}
|
||||
},
|
||||
|
||||
// 发送验证码
|
||||
fetchCode() {
|
||||
if (!this.enabulePrivacy) {
|
||||
if (!this.enablePrivacy) {
|
||||
uni.showToast({
|
||||
title: "请同意用户隐私",
|
||||
duration: 2000,
|
||||
@@ -561,6 +721,7 @@ page {
|
||||
.wrapper {
|
||||
padding: 0 80rpx;
|
||||
}
|
||||
|
||||
.title {
|
||||
padding-top: calc(104rpx);
|
||||
font-style: normal;
|
||||
@@ -569,9 +730,11 @@ page {
|
||||
font-size: 56rpx;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.box-code {
|
||||
margin-top: 78rpx;
|
||||
}
|
||||
|
||||
.desc,
|
||||
.desc-light {
|
||||
font-size: 32rpx;
|
||||
@@ -579,25 +742,32 @@ page {
|
||||
color: #333333;
|
||||
margin-top: 40rpx;
|
||||
}
|
||||
|
||||
.desc {
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.desc-light {
|
||||
color: #999999;
|
||||
|
||||
>span {
|
||||
color: #333;
|
||||
margin-left: 8rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.mobile {
|
||||
margin-top: 80rpx;
|
||||
}
|
||||
|
||||
.disable {
|
||||
background: linear-gradient(90deg, #ffdcba 2.21%, #ffcfb2 99.86%);
|
||||
}
|
||||
|
||||
.fetch {
|
||||
background: linear-gradient(57.72deg, #ff8a19 18.14%, #ff5e00 98.44%);
|
||||
}
|
||||
|
||||
.btn {
|
||||
border-radius: 100px;
|
||||
width: 590rpx;
|
||||
@@ -608,15 +778,18 @@ page {
|
||||
text-align: center;
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
.tips {
|
||||
font-size: 12px;
|
||||
line-height: 20px;
|
||||
margin-top: 32rpx;
|
||||
width: 546rpx;
|
||||
|
||||
>span {
|
||||
color: $light-color;
|
||||
}
|
||||
}
|
||||
|
||||
.fetch-btn {
|
||||
width: 370rpx;
|
||||
height: 80rpx;
|
||||
@@ -634,18 +807,25 @@ page {
|
||||
display: flex;
|
||||
width: 590rpx;
|
||||
position: absolute;
|
||||
bottom: 20px;
|
||||
top: 1200rpx;
|
||||
align-items: center;
|
||||
justify-content: space-around;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.login-item {
|
||||
width: 80rpx;
|
||||
|
||||
border-radius: 10rpx;
|
||||
height: 80rpx;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
|
||||
margin: 0 20rpx;
|
||||
}
|
||||
|
||||
.user-password-tips {
|
||||
text-align: center;
|
||||
color: $main-color;
|
||||
margin: 20px 0;
|
||||
}
|
||||
</style>
|
||||
164
pages/passport/scannerCodeLoginConfirm.vue
Normal file
164
pages/passport/scannerCodeLoginConfirm.vue
Normal file
@@ -0,0 +1,164 @@
|
||||
<template>
|
||||
<view class="container">
|
||||
<u-navbar title="扫码登录授权"></u-navbar>
|
||||
<view class="wx-auth-container">
|
||||
<div class="box">
|
||||
<!-- <div v-if="!errorMsg"> -->
|
||||
<div>
|
||||
<view class="small-tips flex flex-center">
|
||||
<u-image
|
||||
width="400rpx"
|
||||
height="300rpx"
|
||||
src="https://lili-system.oss-cn-beijing.aliyuncs.com/confirm.png"
|
||||
></u-image>
|
||||
<div>电脑端登录确认</div>
|
||||
<div>为确保帐号安全,请确认是您本人操作</div>
|
||||
</view>
|
||||
|
||||
<view class="btns">
|
||||
<button @click="confirmLogin()" class="btn-auth">确认登录</button>
|
||||
<div @click="cancelLogin()" class="btn-callback">取消登录</div>
|
||||
</view>
|
||||
</div>
|
||||
</div>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { scannerCodeLogin, scannerCodeLoginConfirm } from "@/api/login";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
errorMsg: "",
|
||||
token: "",
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
errorMsg(val) {
|
||||
if (val) {
|
||||
uni.showToast({
|
||||
title: val,
|
||||
icon: "none",
|
||||
});
|
||||
// uni.navigateBack()
|
||||
}
|
||||
},
|
||||
},
|
||||
onShow() {
|
||||
this.$options.filters.forceLogin();
|
||||
scannerCodeLogin({ token: this.token }).then((res) => {
|
||||
if (res.data.code == 200) {
|
||||
let code = res.data.result;
|
||||
switch (code) {
|
||||
case 0:
|
||||
case 1:
|
||||
this.errorMsg = "";
|
||||
break;
|
||||
case 2:
|
||||
case 3:
|
||||
this.errorMsg = "请勿重复扫码";
|
||||
break;
|
||||
case 4:
|
||||
this.errorMsg = "二维码已过期,重新扫码";
|
||||
break;
|
||||
default:
|
||||
this.errorMsg = "状态异常";
|
||||
}
|
||||
} else {
|
||||
this.errorMsg = res.data.message;
|
||||
}
|
||||
});
|
||||
},
|
||||
onLoad(params) {
|
||||
this.token = params.token;
|
||||
if (this.token == undefined || this.token == "") {
|
||||
this.errorMsg = "信息异常";
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
confirmLogin() {
|
||||
this.config(1);
|
||||
},
|
||||
cancelLogin() {
|
||||
this.config(0);
|
||||
},
|
||||
config(code) {
|
||||
scannerCodeLoginConfirm({ token: this.token, code: code }).then((res) => {
|
||||
let title = res.data.success ? "操作成功" : "操作失败";
|
||||
uni.showToast({
|
||||
title: title,
|
||||
duration: 1500,
|
||||
icon: "none",
|
||||
});
|
||||
setTimeout(function () {
|
||||
uni.navigateBack();
|
||||
}, 1000);
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
page {
|
||||
background: #fff;
|
||||
}
|
||||
</style>
|
||||
<style lang="scss" scoped>
|
||||
.container {
|
||||
background-color: #fff;
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
}
|
||||
.wx-auth-container {
|
||||
width: 100%;
|
||||
background: #fff;
|
||||
margin-top: 20%;
|
||||
}
|
||||
text.title,
|
||||
text.shop {
|
||||
display: inline-block;
|
||||
font-size: 60rpx;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.box {
|
||||
margin: 0 32rpx;
|
||||
}
|
||||
|
||||
/* 文字提示*/
|
||||
.small-tips {
|
||||
width: 100%;
|
||||
|
||||
padding: 20rpx;
|
||||
font-size: 29rpx;
|
||||
margin: 0 0 20rpx;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.btn-auth {
|
||||
width: 92%;
|
||||
background: $main-color;
|
||||
color: #fff;
|
||||
margin: 0 auto 40rpx;
|
||||
border-radius: 100px;
|
||||
}
|
||||
.btn-callback {
|
||||
text-align: center;
|
||||
font-size: 30rpx;
|
||||
background: #ededed;
|
||||
height: 90rpx;
|
||||
line-height: 90rpx;
|
||||
border-radius: 100px;
|
||||
width: 92%;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.btns {
|
||||
margin-top: 100rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
width: 100%;
|
||||
justify-content: center;
|
||||
}
|
||||
</style>
|
||||
@@ -43,7 +43,7 @@ export default {
|
||||
getUserProfile() {
|
||||
let code = "WECHAT";
|
||||
let buyer = api.buyer;
|
||||
window.open(buyer + `/connect/login/web/` + code, "_self");
|
||||
window.open(buyer + `/passport/connect/connect/login/web/` + code, "_self");
|
||||
},
|
||||
backToHome() {
|
||||
uni.switchTab({
|
||||
@@ -55,8 +55,6 @@ export default {
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
|
||||
.wx-auth-container {
|
||||
width: 100%;
|
||||
|
||||
|
||||
@@ -1,31 +1,60 @@
|
||||
<template>
|
||||
<div class="main-page">
|
||||
|
||||
<!-- #ifdef APP-PLUS -->
|
||||
<view class="status_bar"></view>
|
||||
<!-- #endif -->
|
||||
<!-- 仅h5有效 打开App -->
|
||||
|
||||
<!-- 分享 -->
|
||||
<shares v-if="shareFlage && goodsDetail.id" :skuId="this.routerVal.id" :goodsId="this.routerVal.goodsId"
|
||||
:link="'/pages/product/goods?id='+this.routerVal.id+'&goodsId='+this.routerVal.goodsId"
|
||||
:thumbnail="goodsDetail.thumbnail" :goodsName="goodsDetail.goodsName" type="goods" @close="shareFlage = false" />
|
||||
<popups v-model="popupsSwitch" @tapPopup="handleNavbarList" :popData="navbarListData" :x="navbarListX"
|
||||
:y="navbarListY" placement="top-start" />
|
||||
<shares
|
||||
v-if="enableShare && goodsDetail.id"
|
||||
:skuId="this.routerVal.id"
|
||||
:goodsId="this.routerVal.goodsId"
|
||||
:link="
|
||||
'/pages/product/goods?id=' +
|
||||
this.routerVal.id +
|
||||
'&goodsId=' +
|
||||
this.routerVal.goodsId
|
||||
"
|
||||
:thumbnail="goodsDetail.thumbnail"
|
||||
:goodsName="goodsDetail.goodsName"
|
||||
type="goods"
|
||||
@close="enableShare = false"
|
||||
/>
|
||||
<popups
|
||||
v-model="popupsSwitch"
|
||||
@tapPopup="handleNavbarList"
|
||||
:popData="navbarListData"
|
||||
:x="navbarListX"
|
||||
:y="navbarListY"
|
||||
placement="top-start"
|
||||
/>
|
||||
<view class="index">
|
||||
|
||||
<!-- topBar -->
|
||||
<u-navbar :background="navbar" :is-back="false" :class="headerFlag ? 'header' : 'header bg-none scroll-hide'">
|
||||
<u-navbar
|
||||
:background="navbar"
|
||||
:is-back="false"
|
||||
:class="headerFlag ? 'header' : 'header bg-none scroll-hide'"
|
||||
>
|
||||
<div class="headerRow">
|
||||
<div class="backs">
|
||||
<u-icon @click="back()" name="arrow-left" class="icon-back"></u-icon>
|
||||
|
||||
<u-icon name="list" @click="popupsSwitch = !popupsSwitch" class="icon-list"></u-icon>
|
||||
<u-icon
|
||||
name="list"
|
||||
@click="popupsSwitch = !popupsSwitch"
|
||||
class="icon-list"
|
||||
></u-icon>
|
||||
</div>
|
||||
<div class="headerList" :class="headerFlag ? 'tab-bar' : 'tab-bar scroll-hide'">
|
||||
<div class="headerRow">
|
||||
<div class="nav-item" v-for="header in headerList" :key="header.id"
|
||||
:class="{ cur: scrollId === header.id }" @click="headerTab(header.id)">
|
||||
<div
|
||||
class="nav-item"
|
||||
v-for="header in headerList"
|
||||
:key="header.id"
|
||||
:class="{ cur: scrollId === header.id }"
|
||||
@click="headerTab(header.id)"
|
||||
>
|
||||
{{ header.text }}
|
||||
</div>
|
||||
</div>
|
||||
@@ -33,44 +62,80 @@
|
||||
</div>
|
||||
</u-navbar>
|
||||
|
||||
<u-navbar :border-bottom="false" v-show="!headerFlag" class="header-only-back" :background="navbarOnlyBack"
|
||||
:is-back="false">
|
||||
<u-navbar
|
||||
:border-bottom="false"
|
||||
v-show="!headerFlag"
|
||||
class="header-only-back"
|
||||
:background="navbarOnlyBack"
|
||||
:is-back="false"
|
||||
>
|
||||
<div>
|
||||
<div class="bg-back">
|
||||
<u-icon size="40" @click="back()" name="arrow-left" class="icon-back"></u-icon>
|
||||
<u-icon size="40" @click="popupsSwitch = !popupsSwitch" name="list" class="icon-list"></u-icon>
|
||||
|
||||
<u-icon
|
||||
size="40"
|
||||
@click="back()"
|
||||
name="arrow-left"
|
||||
class="icon-back"
|
||||
></u-icon>
|
||||
<u-icon
|
||||
size="40"
|
||||
@click="popupsSwitch = !popupsSwitch"
|
||||
name="list"
|
||||
class="icon-list"
|
||||
></u-icon>
|
||||
</div>
|
||||
</div>
|
||||
</u-navbar>
|
||||
</view>
|
||||
|
||||
<view class="product-container" :style="{ height: productRefHeight }" ref="productRef" id="productRef">
|
||||
<scroll-view scroll-anchoring enableBackToTop="true" scroll-with-animation scroll-y class="scroll-page"
|
||||
:scroll-top="tabScrollTop" @scroll="pageScroll">
|
||||
<view
|
||||
class="product-container"
|
||||
:style="{ height: productRefHeight }"
|
||||
ref="productRef"
|
||||
id="productRef"
|
||||
>
|
||||
<scroll-view
|
||||
scroll-anchoring
|
||||
enableBackToTop="true"
|
||||
scroll-with-animation
|
||||
scroll-y
|
||||
class="scroll-page"
|
||||
:scroll-top="tabScrollTop"
|
||||
@scroll="pageScroll"
|
||||
>
|
||||
<view>
|
||||
<!-- 轮播图 -->
|
||||
<GoodsSwiper id="main1" :res="imgList" />
|
||||
|
||||
<!-- 促销活动条 -->
|
||||
<PromotionAssembleLayout v-if="PromotionList" :detail="goodsDetail" :res="PromotionList" />
|
||||
<PromotionAssembleLayout
|
||||
v-if="PromotionList"
|
||||
:detail="goodsDetail"
|
||||
:res="PromotionList"
|
||||
/>
|
||||
|
||||
<view class="card-box top-radius-0" id="main2">
|
||||
<!-- 活动不显示价钱 -->
|
||||
<view v-if="!isPromotion" class="desc-bold -goods-msg">
|
||||
<view v-if="isSeckill || isGroup" class="desc-bold -goods-msg">
|
||||
<view class="-goods-flex">
|
||||
<view class="desc-bold">
|
||||
{{ goodsDetail.goodsName || "" }}
|
||||
</view>
|
||||
<view class="favorite" @click="clickFavorite(goodsDetail.id)">
|
||||
<u-icon size="30" :color="favorite ? '#f2270c' : '#262626'" :name="favorite ? 'heart-fill' : 'heart'">
|
||||
<u-icon
|
||||
size="30"
|
||||
:color="favorite ? '#f2270c' : '#262626'"
|
||||
:name="favorite ? 'heart-fill' : 'heart'"
|
||||
>
|
||||
</u-icon>
|
||||
<view :style="{ color: favorite ? '#f2270c' : '#262626' }">{{ favorite ? "已收藏" : "收藏" }}</view>
|
||||
<view :style="{ color: favorite ? '#f2270c' : '#262626' }">{{
|
||||
favorite ? "已收藏" : "收藏"
|
||||
}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 商品描述 -->
|
||||
<view class="-goods-desc">
|
||||
{{ goodsDetail.sellingPoint || '' }}
|
||||
{{ goodsDetail.sellingPoint || "" }}
|
||||
</view>
|
||||
</view>
|
||||
<view v-else class="-goods-msg">
|
||||
@@ -79,31 +144,46 @@
|
||||
<view class="-goods-flex">
|
||||
<!-- 如果有积分显示积分 -->
|
||||
<view class="-goods-price" v-if="goodsDetail.price != undefined">
|
||||
<span v-if="pointDetail.points"> <span class="price">{{pointDetail.points}}</span>
|
||||
<span v-if="pointDetail.points">
|
||||
<span class="price">{{ pointDetail.points }}</span>
|
||||
<span>积分</span>
|
||||
</span>
|
||||
|
||||
<span v-else> <span>¥</span><span class="price">{{ formatPrice(goodsDetail.price)[0] }}</span>.{{
|
||||
formatPrice(goodsDetail.price)[1]
|
||||
}} </span>
|
||||
<span v-else>
|
||||
<span v-if="wholesaleList.length">
|
||||
<span>¥</span><span class="price">{{ $options.filters.goodsFormatPrice(wholesaleList[wholesaleList.length-1].price)[0] }}</span>.{{ $options.filters.goodsFormatPrice(wholesaleList[wholesaleList.length-1].price)[1] }}
|
||||
~
|
||||
<span>¥</span><span class="price">{{ $options.filters.goodsFormatPrice(wholesaleList[0].price)[0] }}</span>.{{ $options.filters.goodsFormatPrice(wholesaleList[0].price)[1] }}
|
||||
</span>
|
||||
<span v-else>
|
||||
<span>¥</span><span class="price">{{ $options.filters.goodsFormatPrice(goodsDetail.price)[0] }}</span>.{{ $options.filters.goodsFormatPrice(goodsDetail.price)[1] }}
|
||||
</span>
|
||||
</span>
|
||||
</view>
|
||||
<view class="-goods-price" v-else>
|
||||
¥<span class="price">0 </span>.00
|
||||
</view>
|
||||
<view class="-goods-price" v-else> ¥<span class="price">0 </span>.00 </view>
|
||||
|
||||
<view class="icons share" @click="shareChange()">
|
||||
<u-icon size="30" name="share-fill"></u-icon>
|
||||
<view>分享</view>
|
||||
</view>
|
||||
<view class="icons" @click="clickFavorite(goodsDetail.id)">
|
||||
<u-icon size="30" :color="favorite ? '#f2270c' : '#262626'"
|
||||
:name="favorite ? 'heart-fill' : 'heart'"></u-icon>
|
||||
<view :style="{ color: favorite ? '#f2270c' : '#262626' }">{{ favorite ? "已收藏" : "收藏" }}</view>
|
||||
<u-icon
|
||||
size="30"
|
||||
:color="favorite ? '#f2270c' : '#262626'"
|
||||
:name="favorite ? 'heart-fill' : 'heart'"
|
||||
></u-icon>
|
||||
<view :style="{ color: favorite ? '#f2270c' : '#262626' }">{{
|
||||
favorite ? "已收藏" : "收藏"
|
||||
}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="-goods-name desc-bold">
|
||||
{{ goodsDetail.goodsName || "" }}
|
||||
</view>
|
||||
<view class="-goods-desc">
|
||||
{{ goodsDetail.sellingPoint || '' }}
|
||||
{{ goodsDetail.sellingPoint || "" }}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -123,16 +203,22 @@
|
||||
</view>
|
||||
|
||||
<!-- 拼团用户列表 -->
|
||||
<PromotionAssembleListLayout v-if="isGroup" @to-assemble-buy-now="toAssembleBuyNow" :res="PromotionList" />
|
||||
<PromotionAssembleListLayout
|
||||
v-if="isGroup"
|
||||
@to-assemble-buy-now="toAssembleBuyNow"
|
||||
:res="PromotionList"
|
||||
/>
|
||||
|
||||
<!-- 配置地址 如果是虚拟产品的时候不展示 -->
|
||||
<view class="card-box" v-if="goodsDetail.goodsType != 'VIRTUAL_GOODS'">
|
||||
<view class="card-flex" @click="shutMask(4)">
|
||||
<view class="card-title"> 已选 </view>
|
||||
<view class="card-content">
|
||||
<span v-if="selectedGoods.spec">{{ selectedGoods.spec.specName }}-{{
|
||||
<span v-if="selectedGoods.spec"
|
||||
>{{ selectedGoods.spec.specName }}-{{
|
||||
selectedGoods.spec.specValue
|
||||
}}</span>
|
||||
}}</span
|
||||
>
|
||||
<span v-else>默认</span>
|
||||
</view>
|
||||
<view class="card-bottom">
|
||||
@@ -157,11 +243,21 @@
|
||||
<Evaluation id="main5" :goodsDetail="goodsDetail" />
|
||||
|
||||
<!-- 店铺推荐 -->
|
||||
<storeLayout id="main7" :storeDetail="storeDetail" :goodsDetail="goodsDetail" :res="recommendList" />
|
||||
<storeLayout
|
||||
id="main7"
|
||||
:storeDetail="storeDetail"
|
||||
:goodsDetail="goodsDetail"
|
||||
:res="recommendList"
|
||||
/>
|
||||
|
||||
<!-- 宝贝详情 -->
|
||||
<GoodsIntro id="main9" :res="goodsDetail" :goodsParams="goodsParams" :goodsId="goodsDetail.goodsId"
|
||||
v-if="goodsDetail.id" />
|
||||
<GoodsIntro
|
||||
id="main9"
|
||||
:res="goodsDetail"
|
||||
:goodsParams="goodsParams"
|
||||
:goodsId="goodsDetail.goodsId"
|
||||
v-if="goodsDetail.id"
|
||||
/>
|
||||
|
||||
<!-- 宝贝推荐 -->
|
||||
<GoodsRecommend id="main11" :res="likeGoodsList" />
|
||||
@@ -186,8 +282,13 @@
|
||||
</view>
|
||||
<!-- 正常结算页面 -->
|
||||
<view class="detail-btn" v-if="!isGroup">
|
||||
<view class="to-store-car to-store-btn" v-if="goodsDetail.goodsType!='VIRTUAL_GOODS'" @click="shutMask(4)">
|
||||
加入购物车</view>
|
||||
<view
|
||||
class="to-store-car to-store-btn"
|
||||
v-if="goodsDetail.goodsType != 'VIRTUAL_GOODS'"
|
||||
@click="shutMask(4)"
|
||||
>
|
||||
加入购物车</view
|
||||
>
|
||||
<view class="to-buy to-store-btn" @click="shutMask(4, 'buy')">立即购买</view>
|
||||
<view class="to-store-car to-store-btn" v-if="startTimer">暂未开始</view>
|
||||
</view>
|
||||
@@ -206,8 +307,15 @@
|
||||
<!-- 规格-模态层弹窗 -->
|
||||
<view class="spec">
|
||||
<!-- 促销弹窗 -->
|
||||
<u-popup v-model="promotionFlag" :height="setup.height" :mode="setup.mode" :border-radius="setup.radius"
|
||||
@close="promotionFlag=false" :mask-close-able="setup.close" closeable>
|
||||
<u-popup
|
||||
v-model="promotionShow"
|
||||
:height="setup.height"
|
||||
:mode="setup.mode"
|
||||
:border-radius="setup.radius"
|
||||
@close="promotionShow = false"
|
||||
:mask-close-able="setup.close"
|
||||
closeable
|
||||
>
|
||||
<view class="header-title">优惠</view>
|
||||
<view class="cuxiao">
|
||||
<scroll-view class="scroll_mask" :scroll-y="true">
|
||||
@@ -216,7 +324,6 @@
|
||||
<PromotionDetailsLayout :res="PromotionList" />
|
||||
</view>
|
||||
<view class="con-cuxiao coupons">
|
||||
|
||||
<view class="cuxiao-title">可领优惠券</view>
|
||||
<PromotionCoupon @getCoupon="getCoupon" :res="PromotionList" />
|
||||
</view>
|
||||
@@ -225,13 +332,31 @@
|
||||
</u-popup>
|
||||
|
||||
<!-- 配送地址弹窗 -->
|
||||
<popupAddress @closeAddress="closePopupAddress" @deliveryData="deliveryFun" v-if="goodsDetail.id"
|
||||
:goodsId="goodsDetail.id" :addressFlag="addressFlag" />
|
||||
<popupAddress
|
||||
@closeAddress="closePopupAddress"
|
||||
@deliveryData="deliveryFun"
|
||||
v-if="goodsDetail.id"
|
||||
:goodsId="goodsDetail.id"
|
||||
:addressFlag="addressFlag"
|
||||
/>
|
||||
|
||||
<!-- 商品规格 商品详情,以及默认参与活动的id-->
|
||||
<popupGoods :addr="delivery" ref="popupGoods" @changed="changedGoods" @closeBuy="closePopupBuy"
|
||||
@queryCart="cartCount()" :goodsDetail="goodsDetail" :goodsSpec="goodsSpec" :id="productId"
|
||||
v-if="goodsDetail.id " :pointDetail="pointDetail" @handleClickSku="selectSku" :buyMask="buyMask" />
|
||||
<popupGoods
|
||||
:addr="delivery"
|
||||
ref="popupGoods"
|
||||
@changed="changedGoods"
|
||||
@closeBuy="closePopupBuy"
|
||||
@queryCart="cartCount()"
|
||||
:goodsDetail="goodsDetail"
|
||||
:goodsSpec="goodsSpec"
|
||||
:isGroup="isGroup"
|
||||
:id="productId"
|
||||
v-if="goodsDetail.id"
|
||||
:pointDetail="pointDetail"
|
||||
:wholesaleList="wholesaleList"
|
||||
@handleClickSku="selectSku"
|
||||
:buyMask="buyMask"
|
||||
/>
|
||||
</view>
|
||||
</view>
|
||||
</div>
|
||||
@@ -239,15 +364,11 @@
|
||||
|
||||
<script>
|
||||
/************接口API***************/
|
||||
import {
|
||||
getGoods,
|
||||
getGoodsList,
|
||||
getMpScene,
|
||||
getGoodsDistribution,
|
||||
} from "@/api/goods.js";
|
||||
import { getGoods, getGoodsList, getMpScene, getGoodsDistribution } from "@/api/goods.js";
|
||||
import * as API_trade from "@/api/trade.js";
|
||||
import * as API_Members from "@/api/members.js";
|
||||
import * as API_store from "@/api/store.js";
|
||||
import { getIMDetail } from "@/api/common";
|
||||
import { modelNavigateTo } from "@/pages/tabbar/home/template/tpl.js";
|
||||
/************请求存储***************/
|
||||
import storage from "@/utils/storage.js";
|
||||
@@ -267,7 +388,6 @@ import popupGoods from "@/components/m-buy/goods"; //购物车商品的模块
|
||||
import popupAddress from "./product/popup/address"; //地址选择模块
|
||||
import shares from "@/components/m-share/index"; //分享
|
||||
import popups from "@/components/popups/popups"; //气泡框
|
||||
|
||||
import setup from "./product/popup/popup";
|
||||
export default {
|
||||
components: {
|
||||
@@ -289,7 +409,7 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
setup,
|
||||
promotionFlag: false,
|
||||
promotionShow: false, //弹窗开关
|
||||
// #ifdef H5
|
||||
navbarListX: 110, //导航栏列表栏x轴
|
||||
navbarListY: 80, //导航栏列表栏y轴
|
||||
@@ -326,10 +446,10 @@ export default {
|
||||
},
|
||||
],
|
||||
popupsSwitch: false, //导航栏列表栏开关
|
||||
shareFlage: false,
|
||||
enableShare: false,
|
||||
selectedGoods: "", //选择的商品规格昵称
|
||||
isPromotion: true, //判断显示拼团活动文字
|
||||
isGroup: false, // 是否是拼团活动
|
||||
isSeckill:false, // 是否秒杀活动
|
||||
pointDetail: "", // 是否是积分商品
|
||||
assemble: "", //拼团的sku
|
||||
navbarOnlyBack: {
|
||||
@@ -365,7 +485,6 @@ export default {
|
||||
id: "4",
|
||||
},
|
||||
],
|
||||
oldtabScrollTop: 0,
|
||||
tabScrollTop: null,
|
||||
scrollArr: [],
|
||||
scrollId: "1",
|
||||
@@ -408,9 +527,18 @@ export default {
|
||||
startTimer: false, //未开启 是false
|
||||
|
||||
routerVal: "",
|
||||
IMLink: "", // IM地址
|
||||
wholesaleList:[]
|
||||
};
|
||||
},
|
||||
|
||||
computed: {
|
||||
// udesk IM
|
||||
IM() {
|
||||
return this.IMLink + this.storeDetail.merchantEuid;
|
||||
},
|
||||
},
|
||||
|
||||
watch: {
|
||||
isGroup(val) {
|
||||
if (val) {
|
||||
@@ -418,10 +546,7 @@ export default {
|
||||
this.$refs.popupGoods.buyType = "PINTUAN";
|
||||
clearInterval(timer);
|
||||
}, 100);
|
||||
|
||||
this.isPromotion = false;
|
||||
} else {
|
||||
this.isPromotion = true;
|
||||
this.$refs.popupGoods.buyType = "";
|
||||
}
|
||||
},
|
||||
@@ -473,27 +598,14 @@ export default {
|
||||
getMpScene(this.routerVal.scene).then((res) => {
|
||||
if (res.data.success) {
|
||||
let data = res.data.result.split(","); // skuId,goodsId,distributionId
|
||||
console.warn(data);
|
||||
this.init(data[0], data[1], data[2]);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
this.init(
|
||||
this.routerVal.id,
|
||||
this.routerVal.goodsId,
|
||||
this.routerVal.distributionId
|
||||
);
|
||||
this.init(this.routerVal.id, this.routerVal.goodsId, this.routerVal.distributionId);
|
||||
}
|
||||
},
|
||||
// #ifdef MP-WEIXIN
|
||||
onShareAppMessage(res) {
|
||||
return {
|
||||
path: this.share(),
|
||||
title: `[好友推荐]${this.goodsDetail.goodsName}`,
|
||||
imageUrl: this.goodsDetail.goodsGalleryList[0],
|
||||
};
|
||||
},
|
||||
// #endif
|
||||
|
||||
methods: {
|
||||
share() {
|
||||
return `/pages/product/goods?id=${this.routerVal.id}&goodsId=${this.routerVal.goodsId}`;
|
||||
@@ -530,7 +642,6 @@ export default {
|
||||
|
||||
let response = await getGoods(id, goodsId);
|
||||
|
||||
console.log(response);
|
||||
if (!response.data.success) {
|
||||
setTimeout(() => {
|
||||
uni.navigateBack();
|
||||
@@ -540,12 +651,12 @@ export default {
|
||||
if (distributionId || this.$store.state.distributionId) {
|
||||
let disResult = await getGoodsDistribution(distributionId);
|
||||
if (!disResult.data.success || disResult.statusCode == 403) {
|
||||
console.log("绑定成功!");
|
||||
this.$store.state.distributionId = distributionId;
|
||||
}
|
||||
}
|
||||
/**商品信息以及规格信息存储 */
|
||||
this.goodsDetail = response.data.result.data;
|
||||
this.wholesaleList = response.data.result.wholesaleList;
|
||||
this.goodsSpec = response.data.result.specs;
|
||||
this.PromotionList = response.data.result.promotionMap;
|
||||
this.goodsParams = response.data.result.goodsParamsDTOList || [];
|
||||
@@ -561,6 +672,10 @@ export default {
|
||||
if (item.indexOf("POINTS_GOODS") == 0) {
|
||||
this.pointDetail = this.PromotionList[item];
|
||||
}
|
||||
// 秒杀
|
||||
if (item.indexOf("SECKILL") == 0) {
|
||||
this.isSeckill = true
|
||||
}
|
||||
});
|
||||
// 轮播图
|
||||
this.imgList = this.goodsDetail.goodsGalleryList;
|
||||
@@ -572,7 +687,7 @@ export default {
|
||||
this.cartCount();
|
||||
|
||||
// 获取店铺推荐商品
|
||||
this.getstoreRecommend();
|
||||
this.getStoreRecommend();
|
||||
|
||||
// 获取商品列表
|
||||
this.getOtherLikeGoods();
|
||||
@@ -581,46 +696,62 @@ export default {
|
||||
if (this.$options.filters.isLogin("auth")) {
|
||||
this.getGoodsCollectionFun(this.goodsDetail.id);
|
||||
}
|
||||
// 获取IM 需要的话使用
|
||||
// this.getIMDetailMethods();
|
||||
},
|
||||
linkMsgDetail() {
|
||||
// 客服
|
||||
// #ifdef MP-WEIXIN
|
||||
|
||||
const params = {
|
||||
storeName: this.storeDetail.storeName,
|
||||
goodsName: this.goodsDetail.goodsName,
|
||||
goodsId: this.goodsDetail.goodsId,
|
||||
goodsImg: this.goodsDetail.thumbnail,
|
||||
price: this.goodsDetail.promotionPrice || this.goodsDetail.price,
|
||||
// originalPrice: this.goodsDetail.original || this.goodsDetail.price,
|
||||
uuid: storage.getUuid(),
|
||||
token: storage.getAccessToken(),
|
||||
sign: this.storeDetail.yzfSign,
|
||||
mpSign: this.storeDetail.yzfMpSign,
|
||||
};
|
||||
uni.navigateTo({
|
||||
url:
|
||||
"/pages/product/customerservice/index?params=" +
|
||||
encodeURIComponent(JSON.stringify(params)),
|
||||
});
|
||||
// #endif
|
||||
// #ifndef MP-WEIXIN
|
||||
const sign = this.storeDetail.yzfSign;
|
||||
uni.navigateTo({
|
||||
url:
|
||||
"/pages/tabbar/home/web-view?src=https://yzf.qq.com/xv/web/static/chat/index.html?sign=" +
|
||||
sign,
|
||||
});
|
||||
// #endif
|
||||
},
|
||||
// 格式化金钱 1999 --> [1999,00]
|
||||
formatPrice(val) {
|
||||
if (typeof val == "undefined") {
|
||||
return val;
|
||||
async getIMDetailMethods() {
|
||||
let res = await getIMDetail();
|
||||
if (res.data.success) {
|
||||
this.IMLink = res.data.result;
|
||||
}
|
||||
return val.toFixed(2).split(".");
|
||||
},
|
||||
|
||||
linkMsgDetail() {
|
||||
// lili 基础客服
|
||||
|
||||
uni.navigateTo({
|
||||
url: `/pages/tabbar/home/web-view?IM=${this.storeDetail.storeId}`,
|
||||
});
|
||||
|
||||
// udesk 代码
|
||||
// if (this.storeDetail.merchantEuid) {
|
||||
// uni.navigateTo({
|
||||
// url: `/pages/tabbar/home/web-view?src=${this.IM}`,
|
||||
// });
|
||||
// }
|
||||
|
||||
|
||||
// 客服 云智服代码
|
||||
// // #ifdef MP-WEIXIN
|
||||
// const params = {
|
||||
// storeName: this.storeDetail.storeName,
|
||||
// goodsName: this.goodsDetail.goodsName,
|
||||
// goodsId: this.goodsDetail.goodsId,
|
||||
// goodsImg: this.goodsDetail.thumbnail,
|
||||
// price: this.goodsDetail.promotionPrice || this.goodsDetail.price,
|
||||
// // originalPrice: this.goodsDetail.original || this.goodsDetail.price,
|
||||
// uuid: storage.getUuid(),
|
||||
// token: storage.getAccessToken(),
|
||||
// sign: this.storeDetail.yzfSign,
|
||||
// mpSign: this.storeDetail.yzfMpSign,
|
||||
// };
|
||||
// uni.navigateTo({
|
||||
// url:
|
||||
// "/pages/product/customerservice/index?params=" +
|
||||
// encodeURIComponent(JSON.stringify(params)),
|
||||
// });
|
||||
// // #endif
|
||||
// // #ifndef MP-WEIXIN
|
||||
// const sign = this.storeDetail.yzfSign;
|
||||
// uni.navigateTo({
|
||||
// url:
|
||||
// "/pages/tabbar/home/web-view?src=https://yzf.qq.com/xv/web/static/chat/index.html?sign=" +
|
||||
// sign,
|
||||
// });
|
||||
// // #endif
|
||||
|
||||
},
|
||||
/**选择商品 */
|
||||
changedGoods(val) {
|
||||
this.selectedGoods = val;
|
||||
@@ -727,7 +858,7 @@ export default {
|
||||
/**
|
||||
* 获取店铺推荐商品列表
|
||||
*/
|
||||
getstoreRecommend() {
|
||||
getStoreRecommend() {
|
||||
getGoodsList({
|
||||
pageNumber: 1,
|
||||
pageSize: 6,
|
||||
@@ -749,7 +880,6 @@ export default {
|
||||
category: this.goodsDetail.categoryId,
|
||||
keyword: this.goodsDetail.name,
|
||||
}).then((res) => {
|
||||
console.warn(this.likeGoodsList )
|
||||
this.likeGoodsList = res.data.result.content;
|
||||
});
|
||||
},
|
||||
@@ -786,13 +916,13 @@ export default {
|
||||
* 规格弹窗开关
|
||||
*/
|
||||
shutMask(flag, buyFlag, type) {
|
||||
this.promotionFlag = false;
|
||||
this.promotionShow = false;
|
||||
this.buyMask = false;
|
||||
this.addressFlag = false;
|
||||
if (flag) {
|
||||
switch (flag) {
|
||||
case 1: //优惠券弹窗
|
||||
this.promotionFlag = true;
|
||||
this.promotionShow = true;
|
||||
|
||||
break;
|
||||
case 3:
|
||||
@@ -928,7 +1058,7 @@ export default {
|
||||
* 点击分享
|
||||
*/
|
||||
async shareChange() {
|
||||
this.shareFlage = true;
|
||||
this.enableShare = true;
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
@@ -4,11 +4,21 @@
|
||||
<view class="goods-detail">
|
||||
<view class="detail_padding">
|
||||
<div class="goods-detail-box">
|
||||
<div class="goods-detail-item goods-active">商品介绍
|
||||
<div class="goods-detail-item goods-active">商品介绍</div>
|
||||
</div>
|
||||
</div>
|
||||
<u-empty class="empty" text="暂无商品介绍" mode="data" v-if="!res.mobileIntro"></u-empty>
|
||||
<u-parse class="vhtml" :lazy-load="true" :use-cache="true" :show-with-animation="true" :html="res.mobileIntro"></u-parse>
|
||||
<u-empty
|
||||
class="empty"
|
||||
text="暂无商品介绍"
|
||||
mode="data"
|
||||
v-if="!res.mobileIntro"
|
||||
></u-empty>
|
||||
<u-parse
|
||||
class="vhtml"
|
||||
:lazy-load="true"
|
||||
:use-cache="true"
|
||||
:show-with-animation="true"
|
||||
:html="res.mobileIntro"
|
||||
></u-parse>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -23,10 +33,20 @@
|
||||
<div class="param-list" v-if="goodsParams.length == 0">
|
||||
<u-empty text="暂无商品参数" mode="list"></u-empty>
|
||||
</div>
|
||||
<div class="params-group" v-for="(group,groupIndex) in goodsParams" :key="groupIndex">
|
||||
<view style="font-weight: bold;margin-left: 10px;">{{group.groupName}}</view>
|
||||
<div
|
||||
class="params-group"
|
||||
v-for="(group, groupIndex) in goodsParams"
|
||||
:key="groupIndex"
|
||||
>
|
||||
<view style="font-weight: bold; margin-left: 10px">{{
|
||||
group.groupName
|
||||
}}</view>
|
||||
<div class="param-list">
|
||||
<div class="param-item" v-for="(param,index) in group.goodsParamsItemDTOList" :key="index">
|
||||
<div
|
||||
class="param-item"
|
||||
v-for="(param, index) in group.goodsParamsItemDTOList"
|
||||
:key="index"
|
||||
>
|
||||
<div class="param-left">{{ param.paramName }}</div>
|
||||
<div class="param-right">{{ param.paramValue }}</div>
|
||||
</div>
|
||||
@@ -43,16 +63,14 @@ import { getGoodsMessage } from "@/api/goods";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
goodsDetail: ""
|
||||
goodsDetail: "",
|
||||
};
|
||||
},
|
||||
props: ["res", "goodsId", "goodsParams"],
|
||||
async mounted() {
|
||||
console.log(this.res)
|
||||
let res = await getGoodsMessage(this.goodsId);
|
||||
if (res.data.success) {
|
||||
this.goodsDetail = res.data.result;
|
||||
|
||||
}
|
||||
},
|
||||
};
|
||||
@@ -103,6 +121,11 @@ export default {
|
||||
|
||||
width: 100%;
|
||||
}
|
||||
.vhtml {
|
||||
/deep/ img {
|
||||
display: block !important;
|
||||
}
|
||||
}
|
||||
|
||||
/deep/ img {
|
||||
width: 100%;
|
||||
|
||||
@@ -1,169 +1,20 @@
|
||||
<template>
|
||||
<view class="recommend-box" >
|
||||
<h4 class="goods-recommend-title">宝贝推荐</h4>
|
||||
<view class="like-goods-list">
|
||||
<view class="like-goods-list">
|
||||
<view
|
||||
class="like-goods-item"
|
||||
@click="clickGoods(item)"
|
||||
v-for="(item, index) in res"
|
||||
:key="index"
|
||||
>
|
||||
<u-image
|
||||
:fade="true"
|
||||
duration="450"
|
||||
:lazy-load="true"
|
||||
:src="item.content.thumbnail"
|
||||
width="330rpx"
|
||||
height="330rpx"
|
||||
class="like-goods-uimage"
|
||||
>
|
||||
<u-loading slot="loading"></u-loading>
|
||||
</u-image>
|
||||
<view style="background-color: #ffffff; width: 100%">
|
||||
<view class="name">{{ item.content.goodsName }}</view>
|
||||
<view class="price-sales">
|
||||
<div class="item-price" v-if="item.content.price != undefined">
|
||||
¥
|
||||
<span>{{ formatPrice(item.content.price)[0] }}</span>
|
||||
.{{formatPrice(item.content.price)[1]}}
|
||||
<!-- <text v-if="item.point != undefined">+{{ item.point }}积分</text> -->
|
||||
</div>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<goodsList :res='res' v-if="res" :storeName="false" />
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import goodsList from '@/components/m-goods-list/list.vue'
|
||||
export default {
|
||||
props: ["res"],
|
||||
components:{goodsList},
|
||||
methods: {
|
||||
// 点击店铺推荐
|
||||
clickGoods(val) {
|
||||
uni.navigateTo({
|
||||
url: `/pages/product/goods?id=${val.content.id}&goodsId=${val.content.goodsId}`
|
||||
});
|
||||
},
|
||||
// 格式化金钱 1999 --> [1999,00]
|
||||
formatPrice(val) {
|
||||
if (typeof val == "undefined") {
|
||||
return val;
|
||||
}
|
||||
|
||||
return val.toFixed(2).split(".");
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@import "../mp-goods.scss";
|
||||
@import "../product.scss";
|
||||
|
||||
.goods_recomm {
|
||||
padding: 12px 0 20rpx 20rpx;
|
||||
color: #000;
|
||||
font-size: 30rpx;
|
||||
font-weight: 400;
|
||||
margin-bottom: 28rpx;
|
||||
}
|
||||
|
||||
.like-goods-uimage {
|
||||
/deep/ .u-image {
|
||||
height: 350rpx !important;
|
||||
}
|
||||
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.recommend-box {
|
||||
background-color: #ffffff;
|
||||
|
||||
width: 100%;
|
||||
|
||||
padding-bottom: 120rpx;
|
||||
|
||||
.title {
|
||||
width: 120rpx;
|
||||
height: 42rpx;
|
||||
font-size: 30rpx;
|
||||
font-weight: 700;
|
||||
text-align: left;
|
||||
color: #333333;
|
||||
margin-left: 20rpx;
|
||||
}
|
||||
}
|
||||
.like-goods-list {
|
||||
display: flex;
|
||||
width: 100%;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
.like-goods-item {
|
||||
padding: 0 !important;
|
||||
width: 48%;
|
||||
margin: 0 1% 10rpx 1%;
|
||||
background: #f7f7f7;
|
||||
border-radius: 12rpx;
|
||||
|
||||
overflow: hidden;
|
||||
|
||||
/deep/ .u-image {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.like-goods-list {
|
||||
// background-color: #f8f8f8;
|
||||
width: 100%;
|
||||
margin-bottom: 100rpx;
|
||||
|
||||
.name {
|
||||
padding: 14rpx 8rpx 0 8rpx;
|
||||
|
||||
color: #333;
|
||||
font-size: 24rpx;
|
||||
display: -webkit-box;
|
||||
overflow: hidden;
|
||||
-webkit-box-orient: vertical;
|
||||
|
||||
-webkit-line-clamp: 2;
|
||||
|
||||
background: #f7f7f7;
|
||||
height: 80rpx;
|
||||
}
|
||||
|
||||
.price-sales {
|
||||
padding: 8rpx;
|
||||
background: #f7f7f7;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
|
||||
.item-price {
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
font-size: 26rpx;
|
||||
text-align: left;
|
||||
color: $price-color;
|
||||
line-height: 23px;
|
||||
font-weight: bold;
|
||||
> span {
|
||||
font-size: 32rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.sales {
|
||||
line-height: 23px;
|
||||
font-size: 22rpx;
|
||||
text-align: left;
|
||||
letter-spacing: 0;
|
||||
color: #cccccc;
|
||||
// padding-right: 10rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<u-popup class="popup" v-model="addressFlag" :height="setup.height" :mode="setup.mode" :border-radius="setup.radius" @close="closeAddress()" :mask-close-able="setup.close" closeable>
|
||||
<u-popup class="popup" v-model="addressFlag" :height="setup.height" :mode="setup.mode" :border-radius="setup.radius" @close="closeAddress()" closeable>
|
||||
<view class="header-title">选择地址</view>
|
||||
<view class="view-box" v-if="addressDetail">
|
||||
<view class="view-item" v-for="(item, index) in addressDetail" :key="index" @click="clickAddress(item)">
|
||||
|
||||
@@ -11,13 +11,13 @@
|
||||
<span class="group-item-name">还差{{ order.toBeGroupedNum }}人成团</span>
|
||||
</view>
|
||||
<view>
|
||||
<u-button size="mini" :custom-style="customStyle" @click="buy(order)">去参团</u-button>
|
||||
<u-button size="mini" :custom-style="customStyle" @click="buy(order)"
|
||||
>去参团</u-button
|
||||
>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
<view v-else class="nomore">
|
||||
|
||||
<u-empty text="暂无拼团信息" mode="list"></u-empty>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@@ -1,22 +1,37 @@
|
||||
<template>
|
||||
<view>
|
||||
|
||||
<div v-for="(promotion, promotion_index) in res" :key="promotion_index">
|
||||
<div class="showBox" v-if="promotion.__key == 'SECKILL' || promotion.__key =='GROUPBUY' || promotion.__key == 'PINTUAN'">
|
||||
<div
|
||||
class="showBox"
|
||||
v-if="
|
||||
promotion.__key == 'SECKILL' ||
|
||||
promotion.__key == 'GROUPBUY' ||
|
||||
promotion.__key == 'PINTUAN'
|
||||
"
|
||||
>
|
||||
<view class="group-wrapper">
|
||||
<div class="u-group-row">
|
||||
<view :span="8" class="showBox_L">
|
||||
<view class="u-group-flex">
|
||||
|
||||
<!-- 限时抢购 -->
|
||||
<view class="u-group-flex-left" v-if="promotion.__key == 'SECKILL'">
|
||||
|
||||
<span class="u-group-flex-left-span" v-if="detail.promotionPrice!=undefined">
|
||||
¥ <span class="flex-price"> {{ formatPrice(detail.promotionPrice)[0]}}.{{ formatPrice(detail.promotionPrice)[1]}}</span>
|
||||
|
||||
<span
|
||||
class="u-group-flex-left-span"
|
||||
v-if="detail.promotionPrice != undefined"
|
||||
>
|
||||
¥
|
||||
<span class="flex-price">
|
||||
{{ $options.filters.goodsFormatPrice(detail.promotionPrice)[0] }}.{{
|
||||
$options.filters.goodsFormatPrice(detail.promotionPrice)[1]
|
||||
}}</span
|
||||
>
|
||||
</span>
|
||||
<view class="u-group-flex" v-if="detail.price != undefined">
|
||||
<span class="old-price">¥{{ formatPrice(detail.price)[0]}}.{{ formatPrice(detail.price)[1]}}</span>
|
||||
<span class="old-price"
|
||||
>¥{{ $options.filters.goodsFormatPrice(detail.price)[0] }}.{{
|
||||
$options.filters.goodsFormatPrice(detail.price)[1]
|
||||
}}</span
|
||||
>
|
||||
<view class="promotion">限时抢购</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -24,24 +39,44 @@
|
||||
<!-- 团购 -->
|
||||
<view class="u-group-flex-left" v-if="promotion.__key == 'GROUPBUY'">
|
||||
<span class="u-group-flex-left-span">
|
||||
<span class="flex-price"
|
||||
v-if="promotion.groupbuy_goods_vo.price !=undefined">¥{{ formatPrice(promotion.groupbuy_goods_vo.price )[0]}}.{{ formatPrice(promotion.groupbuy_goods_vo.price )[1]}}</span>
|
||||
<span
|
||||
class="flex-price"
|
||||
v-if="promotion.groupbuy_goods_vo.price != undefined"
|
||||
>¥{{ $options.filters.goodsFormatPrice(promotion.groupbuy_goods_vo.price)[0] }}.{{
|
||||
$options.filters.goodsFormatPrice(promotion.groupbuy_goods_vo.price)[1]
|
||||
}}</span
|
||||
>
|
||||
<!-- <span v-if="promotion.point">+{{promotion.point}}积分</span> -->
|
||||
</span>
|
||||
<view class="u-group-flex">
|
||||
<span class="old-price"
|
||||
v-if="promotion.groupbuy_goods_vo.original_price!=undefined">¥{{ formatPrice(promotion.groupbuy_goods_vo.original_price)[0]}}.{{ formatPrice(promotion.groupbuy_goods_vo.original_price)[1]}}</span>
|
||||
<span
|
||||
class="old-price"
|
||||
v-if="promotion.groupbuy_goods_vo.original_price != undefined"
|
||||
>¥{{
|
||||
$options.filters.goodsFormatPrice(promotion.groupbuy_goods_vo.original_price)[0]
|
||||
}}.{{
|
||||
$options.filters.goodsFormatPrice(promotion.groupbuy_goods_vo.original_price)[1]
|
||||
}}</span
|
||||
>
|
||||
<view class="promotion">团购活动</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="u-group-flex-left" v-if="promotion.__key == 'PINTUAN'">
|
||||
|
||||
<span class="u-group-flex-left-span" v-if="detail.promotionPrice != undefined">
|
||||
¥<span class="flex-price"> {{ formatPrice(detail.promotionPrice)[0]}}.</span>{{ formatPrice(detail.promotionPrice)[1]}}
|
||||
<span
|
||||
class="u-group-flex-left-span"
|
||||
v-if="detail.promotionPrice != undefined"
|
||||
>
|
||||
¥<span class="flex-price">
|
||||
{{ $options.filters.goodsFormatPrice(detail.promotionPrice)[0] }}.</span
|
||||
>{{ $options.filters.goodsFormatPrice(detail.promotionPrice)[1] }}
|
||||
</span>
|
||||
<view class="u-group-flex" v-if="detail.price != undefined">
|
||||
<span class="old-price">¥{{ formatPrice(detail.price)[0]}}.{{ formatPrice(detail.price)[1]}}</span>
|
||||
<span class="old-price"
|
||||
>¥{{ $options.filters.goodsFormatPrice(detail.price)[0] }}.{{
|
||||
$options.filters.goodsFormatPrice(detail.price)[1]
|
||||
}}</span
|
||||
>
|
||||
<view class="promotion">拼团活动</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -54,8 +89,17 @@
|
||||
</view>
|
||||
<view class="showBox_R" v-if="promotion && promotion.endTime">
|
||||
<u-tag :text="getIsTimer(promotion)" size="mini" type="error" />
|
||||
<u-count-down :hide-zero-day="true" font-size="25" color="#fff" bg-color="#f71471" separator-size="25" separator-color="#f71471" :show-hours="true" :show-minutes="true"
|
||||
:timestamp="getCountDownTime(promotion.endTime)"></u-count-down>
|
||||
<u-count-down
|
||||
:hide-zero-day="true"
|
||||
font-size="25"
|
||||
color="#fff"
|
||||
bg-color="#f71471"
|
||||
separator-size="25"
|
||||
separator-color="#f71471"
|
||||
:show-hours="true"
|
||||
:show-minutes="true"
|
||||
:timestamp="getCountDownTime(promotion.endTime)"
|
||||
></u-count-down>
|
||||
</view>
|
||||
</div>
|
||||
</view>
|
||||
@@ -97,22 +141,14 @@ export default {
|
||||
},
|
||||
mounted() {},
|
||||
methods: {
|
||||
// 格式化金钱 1999 --> [1999,00]
|
||||
formatPrice(val) {
|
||||
if (typeof val == "undefined") {
|
||||
return val;
|
||||
}
|
||||
return val.toFixed(2).split(".");
|
||||
},
|
||||
getCountDownTime(val) {
|
||||
let date = new Date(val.replace(/-/g, "/"))
|
||||
let date = new Date(val);
|
||||
let timeSimple = new Date(date).getTime() / 1000;
|
||||
return timeSimple - new Date().getTime() / 1000;
|
||||
},
|
||||
getIsTimer(val) {
|
||||
var timestamp = new Date().getTime();
|
||||
|
||||
|
||||
if (timestamp < val.start_time) {
|
||||
this.startTimer = true;
|
||||
return "距离活动开始";
|
||||
|
||||
@@ -1,33 +1,33 @@
|
||||
<template>
|
||||
<view class="wrapper">
|
||||
|
||||
<div class="coupon-empty" v-if="!res">暂无优惠券</div>
|
||||
<view class="coupon-List" v-if="res && item.__key=='COUPON'" v-for="(item, index) in res" :key="index">
|
||||
|
||||
<view class="coupon-List" v-for="(item, index) in couponRes" :key="index">
|
||||
<view class="coupon-item">
|
||||
<view class="top">
|
||||
<div class="price">
|
||||
|
||||
<span v-if="item.couponType == 'DISCOUNT'">{{ item.couponDiscount }}折</span>
|
||||
<span v-if="item.couponType == 'PRICE'">¥{{ item.price | unitPrice }}</span>
|
||||
</div>
|
||||
<view class="text">
|
||||
|
||||
<div class="coupon-List-title">
|
||||
<view v-if="item.scopeType">
|
||||
<span v-if="item.scopeType == 'ALL' && item.id == 'platform'">全平台</span>
|
||||
<span v-if="item.scopeType == 'ALL' && item.storeId == '0'">全平台</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>
|
||||
</div>
|
||||
<div>满{{ item.consumeThreshold | unitPrice }}可用</div>
|
||||
</view>
|
||||
<view class="lingqu-btn" @click="getCoupon(item)">
|
||||
<div :class="yhqFlag ? 'cur' : ''">{{ yhqFlag ? '已领取或领完' : '立即领取' }}</div>
|
||||
<view class="lingqu-btn" @click="getCoupon(item, index)">
|
||||
<div :class="yhqFlag[index] ? 'cur' : ''">
|
||||
{{ yhqFlag[index] ? "已领取或领完" : "立即领取" }}
|
||||
</div>
|
||||
</view>
|
||||
</view>
|
||||
<view class="line"></view>
|
||||
<view class="time">{{ item.startTime }} - {{item.endTime }}</view>
|
||||
<view class="time">{{ item.startTime / 1000 | unixToDate }} - {{ item.endTime / 1000 | unixToDate }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -37,7 +37,8 @@
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
yhqFlag: false, //获取优惠券判断是否点击
|
||||
yhqFlag: [], //获取优惠券判断是否点击
|
||||
couponRes: [],
|
||||
};
|
||||
},
|
||||
props: {
|
||||
@@ -52,7 +53,10 @@ export default {
|
||||
if (this.res && this.res.length != 0) {
|
||||
Object.keys(this.res).forEach((item) => {
|
||||
let key = item.split("-")[0];
|
||||
this.res[item].__key = key;
|
||||
if (key === "COUPON") {
|
||||
this.couponRes.push(this?.res[item]);
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
@@ -61,9 +65,8 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
// 提交优惠券
|
||||
getCoupon(item) {
|
||||
this.yhqFlag = true;
|
||||
|
||||
getCoupon(item, index) {
|
||||
this.yhqFlag[index] = true;
|
||||
this.$emit("getCoupon", item);
|
||||
},
|
||||
},
|
||||
@@ -78,6 +81,7 @@ export default {
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.coupon-List {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
@@ -134,6 +138,7 @@ export default {
|
||||
|
||||
height: 100%;
|
||||
align-items: center;
|
||||
|
||||
span {
|
||||
font-size: 50rpx;
|
||||
}
|
||||
@@ -158,6 +163,7 @@ export default {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-left: 40rpx;
|
||||
|
||||
text {
|
||||
width: 140rpx;
|
||||
height: 40rpx;
|
||||
|
||||
@@ -1,34 +1,38 @@
|
||||
<template>
|
||||
<view class="wrapper" v-if="res">
|
||||
|
||||
<view v-for="(prom, index) in Object.keys(res)" :key="index">
|
||||
<view>
|
||||
|
||||
<view v-if="prom.split('-')[0] == 'FULL_DISCOUNT'">
|
||||
<div class="res_prom_item" v-if="res[prom].fullMinus">
|
||||
<u-tag text="满减" type="error"></u-tag>
|
||||
<!-- TODO 后续将优化为可点击的商品以及优惠券显示明细 -->
|
||||
<span class="pro-text">满{{ res[prom].fullMoney }}元 立减现金 <span class="price">{{ res[prom].fullMinus}}元</span>
|
||||
<span v-if="res[prom].isCoupon"> 赠送<span>优惠券</span></span>
|
||||
<span v-if="res[prom].isPoint"> 赠送{{res[prom].point}}积分</span>
|
||||
<span v-if="res[prom].isGift"> 赠送商品</span>
|
||||
<span v-if="res[prom].isFreeFreight">赠送包邮服务</span>
|
||||
|
||||
<span class="pro-text"
|
||||
>满{{ res[prom].fullMoney }}元 立减现金
|
||||
<span class="price">{{ res[prom].fullMinus }}元</span>
|
||||
<span v-if="res[prom].couponFlag"> 赠送<span>优惠券</span></span>
|
||||
<span v-if="res[prom].pointFlag"> 赠送{{ res[prom].point }}积分</span>
|
||||
<span v-if="res[prom].giftFlag"> 赠送商品</span>
|
||||
<span v-if="res[prom].freeFreightFlag">赠送包邮服务</span>
|
||||
</span>
|
||||
</div>
|
||||
<div class="res_prom_item" v-if="res[prom].fullRate">
|
||||
<div class="res_prom_item" v-if="res[prom].fullRate && res[prom].fullRateFlag">
|
||||
<u-tag text="打折" type="error"></u-tag>
|
||||
<span class="pro-text">满{{ res[prom].fullMoney }}元,立享<span
|
||||
class="price">{{ res[prom].fullRate }}折</span>优惠</span>
|
||||
<span class="pro-text"
|
||||
>满{{ res[prom].fullMoney }}元,立享<span class="price"
|
||||
>{{ res[prom].fullRate }}折</span
|
||||
>优惠</span
|
||||
>
|
||||
</div>
|
||||
</view>
|
||||
|
||||
<view v-if="prom.split('-')[0] == 'PINTUAN'">
|
||||
|
||||
<div class="res_prom_item" v-if="res[prom].requiredNum">
|
||||
<u-tag text="拼团" type="error"></u-tag>
|
||||
<span class="pro-text">{{ res[prom].requiredNum }}人拼团 限购<span
|
||||
class="price">{{ res[prom].limitNum}}件</span></span>
|
||||
<span class="pro-text"
|
||||
>{{ res[prom].requiredNum }}人拼团 限购<span class="price"
|
||||
>{{ res[prom].limitNum }}件</span
|
||||
></span
|
||||
>
|
||||
</div>
|
||||
</view>
|
||||
|
||||
|
||||
@@ -1,33 +1,52 @@
|
||||
<template>
|
||||
<view>
|
||||
|
||||
<view v-for="(promotionItem,promotionIndex) in promotion" :key="promotionIndex" class="promotion_row" @click="shutMask(1)">
|
||||
<view
|
||||
v-for="(promotionItem, promotionIndex) in promotion"
|
||||
:key="promotionIndex"
|
||||
class="promotion_row"
|
||||
@click="shutMask(1)"
|
||||
>
|
||||
<view v-if="res != null" v-for="(item, index) in Object.keys(res)" :key="index">
|
||||
<div class="promotion_col" v-if="item.split('-')[0] == promotionItem.value && item.split('-')[0] == 'FULL_DISCOUNT'">
|
||||
<div
|
||||
class="promotion_col"
|
||||
v-if="
|
||||
item.split('-')[0] == promotionItem.value &&
|
||||
item.split('-')[0] == 'FULL_DISCOUNT'
|
||||
"
|
||||
>
|
||||
<!-- 满减,折扣 -->
|
||||
<div class="flex">
|
||||
<view class="deg_tag">{{ promotionItem.title }}</view>
|
||||
<div class="text proText">满{{ res[item].fullMoney }}元,立享优惠</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="promotion_col" v-if="item.split('-')[0] == promotionItem.value && item.split('-')[0] == 'PINTUAN'">
|
||||
<div
|
||||
class="promotion_col"
|
||||
v-if="
|
||||
item.split('-')[0] == promotionItem.value && item.split('-')[0] == 'PINTUAN'
|
||||
"
|
||||
>
|
||||
<!-- 拼团 -->
|
||||
<div class="flex">
|
||||
<view class="deg_tag">{{ promotionItem.title }}</view>
|
||||
<div class="text proText">{{ res[item].promotionName }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="promotion_col" v-if="item.split('-')[0] == promotionItem.value && item.split('-')[0] == 'SECKILL'">
|
||||
<div
|
||||
class="promotion_col"
|
||||
v-if="
|
||||
item.split('-')[0] == promotionItem.value && item.split('-')[0] == 'SECKILL'
|
||||
"
|
||||
>
|
||||
<!-- 限时抢购 -->
|
||||
<div class="flex">
|
||||
<view class="deg_tag">{{ promotionItem.title }}</view>
|
||||
<div class="text proText">{{ res[item].promotionName }}</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</view>
|
||||
|
||||
<view class="promotion_row" style="display:inline;">
|
||||
<view class="promotion_row" style="display: inline">
|
||||
<view>
|
||||
<div class="promotion_col coupon" v-if="couponList && promotionIndex == 1">
|
||||
<!-- 优惠券 -->
|
||||
@@ -35,16 +54,12 @@
|
||||
<div>
|
||||
<view class="deg_tag">优惠券</view>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view v-if=" this.res != null && Object.keys(res).length == 0">
|
||||
暂无促销信息
|
||||
</view>
|
||||
|
||||
<view v-if="this.res != null && Object.keys(res).length == 0"> 暂无促销信息 </view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
@@ -69,7 +84,6 @@ export default {
|
||||
handler() {
|
||||
if (this.res && this.res.length != 0 && this.res != null) {
|
||||
Object.keys(this.res).forEach((item) => {
|
||||
|
||||
let key = item.split("-")[0];
|
||||
this.res[item].__key = key;
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
{{ item.content.goodsName }}
|
||||
</view>
|
||||
<view class="item-price" v-if="item.price != undefined">
|
||||
¥<span class="item-price-blod">{{ formatPrice(item.content.price)[0] }}</span>.{{ formatPrice(item.content.price)[1] }}
|
||||
¥<span class="item-price-blod">{{ $options.filters.goodsFormatPrice(item.content.price)[0] }}</span>.{{ $options.filters.goodsFormatPrice(item.content.price)[1] }}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -48,13 +48,6 @@ export default {
|
||||
props: ["res", "goodsDetail", "storeDetail"],
|
||||
mounted() {},
|
||||
methods: {
|
||||
// 格式化金钱 1999 --> [1999,00]
|
||||
formatPrice(val) {
|
||||
if (typeof val == "undefined") {
|
||||
return val;
|
||||
}
|
||||
return val.toFixed(2).split(".");
|
||||
},
|
||||
// 点击商品
|
||||
clickGoods(val) {
|
||||
uni.navigateTo({
|
||||
|
||||
157
pages/product/shopList.vue
Normal file
157
pages/product/shopList.vue
Normal file
@@ -0,0 +1,157 @@
|
||||
<template>
|
||||
<div>
|
||||
<u-navbar>
|
||||
<u-search placeholder="请输入店铺名称" @search="search" @clear="search" @custom="search" v-model="params.storeName">
|
||||
</u-search>
|
||||
</u-navbar>
|
||||
<div class="wrapper" v-if="storeList.length!=0">
|
||||
<div class="store-item" @click="handleClickStore(item)" v-for="(item,index) in storeList" :key="index">
|
||||
<div>
|
||||
<u-image shape="circle" width="100" height="100" :src="item.storeLogo">
|
||||
</u-image>
|
||||
</div>
|
||||
<div class="store-msg">
|
||||
<div class="store-name">
|
||||
{{item.storeName}}
|
||||
</div>
|
||||
<div class="goods-num">
|
||||
商品 {{item.goodsNum}}
|
||||
</div>
|
||||
<div class="flex store-distance">
|
||||
<div>
|
||||
<span class="store-score">{{item.serviceScore | unitPrice}}</span>
|
||||
<span class="line">|</span>
|
||||
<span class="store-collection">收藏 {{item.collectionNum}}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!--
|
||||
#TODO 后续将和后端补充从此处
|
||||
<div class="flex store-goods">
|
||||
<div class="store-goods-item" v-for="i in 3" :key="i">
|
||||
<div>
|
||||
<u-image src="https://picsum.photos/id/341/200/200" border-radius="20" width="215rpx" height="215rpx">
|
||||
</u-image>
|
||||
</div>
|
||||
<div class="price">
|
||||
<span>
|
||||
¥
|
||||
<span class=" goods-price-bigshow">{{ formatPrice(16)[0] }}</span>
|
||||
.{{ formatPrice(16)[1] }}
|
||||
</span>
|
||||
|
||||
</div>
|
||||
<div class="wes">test</div>
|
||||
</div>
|
||||
</div>
|
||||
-->
|
||||
</div>
|
||||
</div>
|
||||
<u-empty style="margin-top:20%;" text="暂无店铺信息" v-else></u-empty>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getStoreList } from "@/api/store";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
keyword: "",
|
||||
params: {
|
||||
pageNumber: 1,
|
||||
pageSize: 10,
|
||||
storeName: "",
|
||||
},
|
||||
storeList: [], // 店铺列表
|
||||
};
|
||||
},
|
||||
onReachBottom() {
|
||||
this.params.pageNumber++;
|
||||
this.init();
|
||||
},
|
||||
mounted() {
|
||||
this.init();
|
||||
},
|
||||
methods: {
|
||||
handleClickStore(val){
|
||||
uni.navigateTo({
|
||||
url: `/pages/product/shopPage?id=${val.id}`
|
||||
});
|
||||
},
|
||||
search() {
|
||||
this.storeList = [];
|
||||
this.init();
|
||||
},
|
||||
|
||||
async init() {
|
||||
let res = await getStoreList(this.params);
|
||||
if (res.data.success) {
|
||||
let data = res.data.result;
|
||||
|
||||
this.storeList.push(...data.records);
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.wrapper {
|
||||
padding: 0 16rpx;
|
||||
}
|
||||
.store-item {
|
||||
display: flex;
|
||||
background: #fff;
|
||||
border-radius: 20rpx;
|
||||
margin: 20rpx 0;
|
||||
padding: 24rpx;
|
||||
}
|
||||
.store-msg {
|
||||
margin-left: 20rpx;
|
||||
}
|
||||
.store-name {
|
||||
font-weight: bold;
|
||||
font-size: 30rpx;
|
||||
}
|
||||
.goods-num,
|
||||
.store-collection {
|
||||
color: #999;
|
||||
font-size: 24rpx;
|
||||
line-height: 1.5;
|
||||
}
|
||||
.store-goods {
|
||||
margin: 20rpx 0;
|
||||
}
|
||||
.store-goods-item {
|
||||
flex: 1;
|
||||
overflow: hidden;
|
||||
display: flex;
|
||||
justify-content: flex-start;
|
||||
flex-direction: column;
|
||||
margin: 0 5rpx;
|
||||
}
|
||||
.wes {
|
||||
margin: 10rpx 0;
|
||||
width: 100%;
|
||||
}
|
||||
.store-score {
|
||||
color: $light-color;
|
||||
font-size: 24rpx;
|
||||
font-weight: bold;
|
||||
}
|
||||
.line {
|
||||
margin: 0 6rpx;
|
||||
color: #999;
|
||||
}
|
||||
.store-distance {
|
||||
justify-content: space-between;
|
||||
}
|
||||
.price {
|
||||
margin-top: 10rpx;
|
||||
color: $main-color;
|
||||
}
|
||||
.goods-price-bigshow {
|
||||
font-size: 34rpx;
|
||||
font-weight: bold;
|
||||
}
|
||||
</style>
|
||||
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<div>
|
||||
<u-navbar :border-bottom="false">
|
||||
<u-search v-model="keyword" @search="search" @click="search" placeholder="请输入搜索"></u-search>
|
||||
<u-search v-model="keyword" @custom='search' :show-action="true" action-text="搜索" :animation="true" @search="search" @click="search" placeholder="请输入搜索"></u-search>
|
||||
</u-navbar>
|
||||
<div class="wrapper">
|
||||
<!-- 店铺信息模块 -->
|
||||
@@ -58,20 +58,10 @@
|
||||
<!-- menu -->
|
||||
|
||||
<!-- 商品 -->
|
||||
<div class="contant" v-if="current == 0">
|
||||
<view v-if="!goodsList.length" class="empty">暂无商品信息</view>
|
||||
<view v-else class="item" v-for="(item,index) in goodsList" :key="index" @click="navigateToGoodsDetail(item)">
|
||||
<u-image width="100%" height="330rpx" mode="aspectFit" :src="item.content.thumbnail">
|
||||
<u-loading slot="loading"></u-loading>
|
||||
</u-image>
|
||||
<div class="name">{{ item.content.goodsName }}</div>
|
||||
<div class="price">
|
||||
<div>¥{{ item.content.price | unitPrice }}</div>
|
||||
</div>
|
||||
<view class="buyCount">
|
||||
<div>已售 {{ item.content.buyCount || "0" }}</div>
|
||||
</view>
|
||||
</view>
|
||||
<div class="content" v-if="current == 0">
|
||||
|
||||
<u-empty style='margin-top:100rpx' v-if="goodsList.length == 0" class="empty" text='暂无商品信息'></u-empty>
|
||||
<goodsTemplate v-else :res="goodsList" :storeName="false" />
|
||||
</div>
|
||||
<!-- 全部分类 -->
|
||||
<div class="category" v-if="current == 1">
|
||||
@@ -84,7 +74,7 @@
|
||||
</div>
|
||||
<!-- 分类子级 -->
|
||||
<div class="child-list" v-if="item.children && item.children.length!=0">
|
||||
<div class="child" @click="getCategoryGoodsList(child)" v-for="(child,i) in item.children">{{child.labelName}}
|
||||
<div class="child" @click="getCategoryGoodsList(child)" :key='i' v-for="(child,i) in item.children">{{child.labelName}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -95,6 +85,7 @@
|
||||
|
||||
<script>
|
||||
import { getStoreBaseInfo, getStoreCategory } from "@/api/store.js";
|
||||
import goodsTemplate from '@/components/m-goods-list/list'
|
||||
import {
|
||||
receiveCoupons,
|
||||
deleteStoreCollection,
|
||||
@@ -121,14 +112,15 @@ export default {
|
||||
couponList: [], //优惠券列表
|
||||
categoryList: [],
|
||||
couponParams: { pageNumber: 1, pageSize: 50, storeId: "" },
|
||||
goodsParams: { pageNumber: 1, pageSize: 50, storeId: "" },
|
||||
goodsParams: { pageNumber: 1, pageSize: 10, storeId: "" },
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
current(val) {
|
||||
val == 0 ? this.getGoodsData() : this.getCategoryData();
|
||||
val == 0 ? ()=>{ this.goodsList = []; this.getGoodsData()} : this.getCategoryData();
|
||||
},
|
||||
},
|
||||
components:{goodsTemplate},
|
||||
|
||||
/**
|
||||
* 加载
|
||||
@@ -188,30 +180,34 @@ export default {
|
||||
* 联系客服
|
||||
*/
|
||||
linkKefuDetail() {
|
||||
// 客服
|
||||
// #ifdef MP-WEIXIN
|
||||
// // 客服
|
||||
// // #ifdef MP-WEIXIN
|
||||
|
||||
// const params = {
|
||||
// // originalPrice: this.goodsDetail.original || this.goodsDetail.price,
|
||||
// uuid: storage.getUuid(),
|
||||
// token: storage.getAccessToken(),
|
||||
// sign: this.storeInfo.yzfSign,
|
||||
// mpSign: this.storeInfo.yzfMpSign,
|
||||
// };
|
||||
// uni.navigateTo({
|
||||
// url:
|
||||
// "/pages/product/customerservice/index?params=" +
|
||||
// encodeURIComponent(JSON.stringify(params)),
|
||||
// });
|
||||
// // #endif
|
||||
// // #ifndef MP-WEIXIN
|
||||
// const sign = this.storeInfo.yzfSign;
|
||||
// uni.navigateTo({
|
||||
// url:
|
||||
// "/pages/tabbar/home/web-view?src=https://yzf.qq.com/xv/web/static/chat/index.html?sign=" +
|
||||
// sign,
|
||||
// });
|
||||
// // #endif
|
||||
|
||||
const params = {
|
||||
// originalPrice: this.goodsDetail.original || this.goodsDetail.price,
|
||||
uuid: storage.getUuid(),
|
||||
token: storage.getAccessToken(),
|
||||
sign: this.storeInfo.yzfSign,
|
||||
mpSign: this.storeInfo.yzfMpSign,
|
||||
};
|
||||
uni.navigateTo({
|
||||
url:
|
||||
"/pages/product/customerservice/index?params=" +
|
||||
encodeURIComponent(JSON.stringify(params)),
|
||||
url: `/pages/tabbar/home/web-view?IM=${this.storeId}`,
|
||||
});
|
||||
// #endif
|
||||
// #ifndef MP-WEIXIN
|
||||
const sign = this.storeInfo.yzfSign;
|
||||
uni.navigateTo({
|
||||
url:
|
||||
"/pages/tabbar/home/web-view?src=https://yzf.qq.com/xv/web/static/chat/index.html?sign=" +
|
||||
sign,
|
||||
});
|
||||
// #endif
|
||||
},
|
||||
|
||||
/** 获取店铺分类 */
|
||||
@@ -240,6 +236,7 @@ export default {
|
||||
* 搜索
|
||||
*/
|
||||
search() {
|
||||
console.log("点击")
|
||||
uni.navigateTo({
|
||||
url: `/pages/navigation/search/searchPage?storeId=${this.storeId}&keyword=${this.keyword}`,
|
||||
});
|
||||
@@ -265,6 +262,7 @@ export default {
|
||||
let res = await getGoodsList(this.goodsParams);
|
||||
if (res.data.success) {
|
||||
this.goodsList.push(...res.data.result.content);
|
||||
console.log(this.goodsList)
|
||||
}
|
||||
},
|
||||
|
||||
@@ -277,15 +275,6 @@ export default {
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 跳转到商品详情
|
||||
*/
|
||||
navigateToGoodsDetail(val) {
|
||||
uni.navigateTo({
|
||||
url: `/pages/product/goods?id=${val.content.id}&goodsId=${val.content.goodsId}`,
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 是否收藏
|
||||
*/
|
||||
@@ -393,54 +382,17 @@ export default {
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.contant {
|
||||
.content {
|
||||
margin-top: 20rpx;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
justify-content: space-between;
|
||||
// display: flex;
|
||||
// flex-wrap: wrap;
|
||||
// justify-content: space-between;
|
||||
> .empty {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
margin-top: 40rpx;
|
||||
}
|
||||
.item {
|
||||
overflow: hidden;
|
||||
|
||||
background: #fff;
|
||||
width: 49%;
|
||||
height: 484rpx;
|
||||
font-size: 26rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
border: 1px solid #f8f8f8;
|
||||
margin-bottom: 20rpx;
|
||||
|
||||
.name {
|
||||
text-align: left !important;
|
||||
color: #333;
|
||||
padding: 0 20rpx;
|
||||
margin-top: 20rpx;
|
||||
line-height: 1.4em;
|
||||
max-height: 2.8em; //height是line-height的整数倍,防止文字显示不全
|
||||
overflow: hidden;
|
||||
}
|
||||
.price {
|
||||
font-weight: 500;
|
||||
color: $main-color;
|
||||
font-size: 30rpx;
|
||||
padding: 0 20rpx;
|
||||
margin-top: 20rpx;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.buyCount {
|
||||
display: flex;
|
||||
padding: 0 20rpx;
|
||||
font-size: 24upx;
|
||||
justify-content: space-between;
|
||||
color: #999;
|
||||
}
|
||||
}
|
||||
}
|
||||
.discount {
|
||||
height: 154rpx;
|
||||
|
||||
@@ -4,25 +4,17 @@
|
||||
<!-- 商品 -->
|
||||
<div class="contant">
|
||||
<view v-if="!goodsList.length" class="empty">暂无商品信息</view>
|
||||
<view v-else class="item" v-for="(item,index) in goodsList" :key="index" @click="navigateToGoodsDetail(item)">
|
||||
<u-image width="100%" mode="aspectFit" height="324rpx" :src="item.content.thumbnail">
|
||||
<u-loading slot="loading"></u-loading>
|
||||
</u-image>
|
||||
<div class="name">{{ item.content.goodsName }}</div>
|
||||
<div class="price">
|
||||
<div>¥{{ item.content.price | unitPrice }}</div>
|
||||
</div>
|
||||
<view class="buyCount">
|
||||
<div>已售 {{ item.content.buyCount || "0" }}</div>
|
||||
</view>
|
||||
</view>
|
||||
<goodsTemplate :res='goodsList' :storeName='false' />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getGoodsList } from "@/api/goods.js";
|
||||
import {
|
||||
getGoodsList
|
||||
} from "@/api/goods.js";
|
||||
import goodsTemplate from '@/components/m-goods-list/list'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
@@ -38,6 +30,9 @@ export default {
|
||||
},
|
||||
};
|
||||
},
|
||||
components: {
|
||||
goodsTemplate
|
||||
},
|
||||
onLoad(options) {
|
||||
this.routerVal = options;
|
||||
this.params.storeId = options.storeId;
|
||||
@@ -54,15 +49,6 @@ export default {
|
||||
this.getGoodsData();
|
||||
},
|
||||
methods: {
|
||||
/**
|
||||
* 跳转到商品详情
|
||||
*/
|
||||
navigateToGoodsDetail(val) {
|
||||
uni.navigateTo({
|
||||
url: `/pages/product/goods?id=${val.content.id}&goodsId=${val.content.goodsId}`,
|
||||
});
|
||||
},
|
||||
|
||||
async getGoodsData() {
|
||||
// #TODO
|
||||
let goodsList = await getGoodsList(this.params);
|
||||
@@ -80,48 +66,12 @@ export default {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
justify-content: space-between;
|
||||
|
||||
>.empty {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
margin-top: 40rpx;
|
||||
}
|
||||
.item {
|
||||
overflow: hidden;
|
||||
|
||||
background: #fff;
|
||||
width: 49%;
|
||||
height: 484rpx;
|
||||
font-size: 26rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
border: 1px solid #f8f8f8;
|
||||
margin-bottom: 20rpx;
|
||||
|
||||
.name {
|
||||
text-align: left !important;
|
||||
color: #333;
|
||||
padding: 0 20rpx;
|
||||
margin-top: 20rpx;
|
||||
line-height: 1.4em;
|
||||
max-height: 2.8em; //height是line-height的整数倍,防止文字显示不全
|
||||
overflow: hidden;
|
||||
}
|
||||
.price {
|
||||
font-weight: 500;
|
||||
color: $main-color;
|
||||
font-size: 30rpx;
|
||||
padding: 0 20rpx;
|
||||
margin-top: 20rpx;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.buyCount {
|
||||
display: flex;
|
||||
padding: 0 20rpx;
|
||||
font-size: 24upx;
|
||||
justify-content: space-between;
|
||||
color: #999;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -3,7 +3,7 @@
|
||||
<u-navbar :custom-back="back" back-icon-color="#fff" :background="background" :border-bottom="false">
|
||||
</u-navbar>
|
||||
|
||||
<div class="wrapper">
|
||||
<div class="wrapper-box">
|
||||
<!-- 砍价列表 -->
|
||||
<div class="box box1">
|
||||
<div class="bargain">
|
||||
@@ -106,10 +106,6 @@
|
||||
<popupGoods ref="popupGoods" :buyMask="maskFlag" @closeBuy="closePopupBuy" :goodsDetail="bargainDetail"
|
||||
:goodsSpec="goodsSpec" v-if="bargainDetail.id " @handleClickSku="getGoodsDetail" />
|
||||
|
||||
<!-- 产品详情 -->
|
||||
<div class=" box4">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@@ -179,7 +175,7 @@ export default {
|
||||
return {
|
||||
path: this.share(),
|
||||
title: `请快来帮我砍一刀${this.bargainDetail.goodsName}`,
|
||||
imageUrl: this.thumbnail || config.logo,
|
||||
imageUrl: this.bargainDetail.thumbnail || config.logo,
|
||||
};
|
||||
},
|
||||
// #endif
|
||||
@@ -352,11 +348,11 @@ page {
|
||||
align-items: center;
|
||||
padding: 10rpx 0;
|
||||
}
|
||||
.wrapper {
|
||||
background: url("https://lilishop-oss.oss-cn-beijing.aliyuncs.com/aac88f4e8eff452a8010af42c4560b04.png");
|
||||
.wrapper-box {
|
||||
background: url("https://lili-system.oss-cn-beijing.aliyuncs.com/kanjia.png");
|
||||
background-repeat: no-repeat;
|
||||
background-size: 100% 100%;
|
||||
height: 700rpx;
|
||||
height: 506rpx;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
@@ -371,16 +367,16 @@ page {
|
||||
}
|
||||
}
|
||||
.box1 {
|
||||
top: 750rpx;
|
||||
top: 560rpx;
|
||||
}
|
||||
.box2 {
|
||||
top: 770rpx;
|
||||
top: 580rpx;
|
||||
}
|
||||
.box3 {
|
||||
top: 790rpx;
|
||||
top: 600rpx;
|
||||
}
|
||||
.box4 {
|
||||
top: 810rpx;
|
||||
top: 620 rpx;
|
||||
height: 200rpx;
|
||||
}
|
||||
.bargain-item {
|
||||
|
||||
@@ -6,22 +6,7 @@
|
||||
<!-- 砍价列表 -->
|
||||
<div class="box">
|
||||
<!-- 已砍的商品 -->
|
||||
<div class="bargain" v-if="bargainList.length!=0">
|
||||
<div class="flex bargain-item" v-for="(item,index) in bargainList" :key="index">
|
||||
<div class="goods-img">
|
||||
<u-image width="150" height="150" :src="item.thumbnail"></u-image>
|
||||
</div>
|
||||
<div class="goods-config">
|
||||
<div class="goods-title wes-2">
|
||||
{{item.goodsName}}
|
||||
</div>
|
||||
<div class="flex goods-buy">
|
||||
<div class="max-price">最低:<span>¥{{item.purchasePrice | unitPrice}}</span></div>
|
||||
<div class="bargaining" @click="navigateToBargainDetail(item)">参与砍价</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<goodsTemplate type="kanJia" v-if="bargainList.length!=0" :res="bargainList" />
|
||||
<div class="bargain empty" v-else>
|
||||
<u-empty text="暂无活动" mode="list"></u-empty>
|
||||
</div>
|
||||
@@ -32,7 +17,9 @@
|
||||
|
||||
<script>
|
||||
import { getBargainList } from "@/api/promotions";
|
||||
import goodsTemplate from '@/components/m-goods-list/promotion'
|
||||
export default {
|
||||
components:{goodsTemplate},
|
||||
data() {
|
||||
return {
|
||||
background: {
|
||||
@@ -88,10 +75,10 @@ page {
|
||||
</style>
|
||||
<style lang="scss" scoped>
|
||||
.wrapper {
|
||||
background: url("https://lilishop-oss.oss-cn-beijing.aliyuncs.com/aac88f4e8eff452a8010af42c4560b04.png");
|
||||
background: url("https://lili-system.oss-cn-beijing.aliyuncs.com/kanjia.png");
|
||||
background-repeat: no-repeat;
|
||||
background-size: 100% 100%;
|
||||
height: 700rpx;
|
||||
height: 506rpx;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
@@ -99,7 +86,7 @@ page {
|
||||
background: #fff;
|
||||
border-radius: 20rpx;
|
||||
position: relative;
|
||||
top: 750rpx;
|
||||
top: 560rpx;
|
||||
width: 94%;
|
||||
margin: 0 auto;
|
||||
> .bargain {
|
||||
|
||||
@@ -1,14 +1,11 @@
|
||||
<template>
|
||||
<view class="wrapper">
|
||||
|
||||
<u-navbar :border-bottom="false" :background="background" class="unavbar" :title="title">
|
||||
<u-navbar :border-bottom="false" :title="title">
|
||||
<!-- 中间 -->
|
||||
<view class="slot-wrap container-wrap">
|
||||
|
||||
<view v-if="search">
|
||||
<u-search @search="searchFun()" @custom="searchFun()" v-model="params.goodsName"></u-search>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
<!-- 右侧 -->
|
||||
<view slot="right">
|
||||
@@ -19,44 +16,14 @@
|
||||
</view>
|
||||
</u-navbar>
|
||||
<!-- 顶部栏 -->
|
||||
|
||||
<div class='header-wraper'>
|
||||
<image src="/static/join-buy.png"></image>
|
||||
</div>
|
||||
<!-- 商品栏 -->
|
||||
<div class="swiper">
|
||||
<goodsTemplate v-if="goodsList.length" :res="goodsList" />
|
||||
|
||||
<div v-if="groupBuy.length !=0">
|
||||
<view class="view-item" v-for="(groupItem, groupIndex) in groupBuy" :key="groupIndex">
|
||||
<view class="view-left">
|
||||
<u-image border-radius="10" shape="square" :src="groupItem.goodsImage" width="186rpx" height="186rpx">
|
||||
|
||||
<view slot="error" style="font-size: 24rpx;">加载失败</view>
|
||||
</u-image>
|
||||
</view>
|
||||
<view class="view-content">
|
||||
<view class="view-content-name">
|
||||
{{ groupItem.goodsName }}
|
||||
</view>
|
||||
<view class="view-content-bottom">
|
||||
<view>
|
||||
<view class="view-content-price">
|
||||
<!-- ¥{{groupItem.sales_price | unitPrice }} <span v-if="groupItem.point">+{{groupItem.point}}积分</span> -->
|
||||
¥{{groupItem.price | unitPrice }}
|
||||
</view>
|
||||
<view class="view-content-original_price">
|
||||
¥{{ groupItem.originPrice | unitPrice }}
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view>
|
||||
<view class="btn-group" @click="toHref(groupItem)"> 去拼团 </view>
|
||||
<view class="buy-content">已售{{groupItem.num || 0}}件</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<u-loadmore bg-color='#f8f8f8' :status="status" />
|
||||
</div>
|
||||
<u-empty v-else style="margin-top:20%" text="暂无拼团活动" mode="data"></u-empty>
|
||||
|
||||
</div>
|
||||
|
||||
</view>
|
||||
@@ -65,17 +32,17 @@
|
||||
<script>
|
||||
import * as API_Promotions from "@/api/promotions";
|
||||
import * as API_Goods from "@/api/goods";
|
||||
import goodsTemplate from '@/components/m-goods-list/promotion.vue'
|
||||
export default {
|
||||
components: {},
|
||||
components: {
|
||||
goodsTemplate
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
status: "loadmore",
|
||||
is_empty: false,
|
||||
search: false,
|
||||
title: "拼团活动",
|
||||
background: {
|
||||
backgroundColor: "#fff",
|
||||
},
|
||||
|
||||
empty: false,
|
||||
params: {
|
||||
pageNumber: 1,
|
||||
@@ -83,7 +50,7 @@ export default {
|
||||
categoryPath: "",
|
||||
goodsName: "",
|
||||
},
|
||||
groupBuy: [],
|
||||
goodsList: [],
|
||||
};
|
||||
},
|
||||
mounted() {},
|
||||
@@ -118,12 +85,12 @@ export default {
|
||||
});
|
||||
},
|
||||
searchFun() {
|
||||
this.groupBuy = [];
|
||||
this.goodsList = [];
|
||||
this.GET_AssembleGoods();
|
||||
},
|
||||
// 请求拼团数据
|
||||
GET_AssembleGoods() {
|
||||
this.status = "loading";
|
||||
|
||||
const params = JSON.parse(JSON.stringify(this.params));
|
||||
if (params.category_id === 0) delete params.category_id;
|
||||
|
||||
@@ -133,15 +100,15 @@ export default {
|
||||
|
||||
if (!data || !data.length) {
|
||||
this.is_empty = true;
|
||||
this.status = "nomore";
|
||||
|
||||
} else {
|
||||
if (data.length <= this.params.pageSize) {
|
||||
this.status = "nomore";
|
||||
|
||||
} else {
|
||||
this.status = "loadmore";
|
||||
|
||||
}
|
||||
this.is_empty = false;
|
||||
this.groupBuy.push(...(data || []));
|
||||
this.goodsList.push(...(data || []));
|
||||
}
|
||||
})
|
||||
.catch(() => {});
|
||||
@@ -151,5 +118,16 @@ export default {
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@import "./style.scss";
|
||||
.header-wraper {
|
||||
background: url('/static/bg.png');
|
||||
height: 200rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
>image{
|
||||
width: 188rpx;
|
||||
height: 60rpx;
|
||||
}
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
@@ -159,7 +159,7 @@ export default {
|
||||
let recommendLives = await getLiveList(this.recommendParams);
|
||||
if (recommendLives.data.success) {
|
||||
// 推荐直播间
|
||||
if (recommendLives.data.result.records.length != 0) {
|
||||
if (recommendLives.data.result.records.length ) {
|
||||
this.status = "loadmore";
|
||||
this.recommendLives = recommendLives.data.result.records;
|
||||
} else {
|
||||
@@ -172,7 +172,7 @@ export default {
|
||||
* 2.如果没有直播间设置一个默认图片
|
||||
*/
|
||||
|
||||
if (this.recommendLives.length == 0) {
|
||||
if (!this.recommendLives.length) {
|
||||
if (this.liveList[0].shareImg) {
|
||||
this.$set(this, "swiperImg", [
|
||||
{
|
||||
@@ -199,7 +199,7 @@ export default {
|
||||
let res = await getLiveList(this.params[this.current]);
|
||||
// 直播间
|
||||
if (res.data.success) {
|
||||
if (res.data.result.records.length != 0) {
|
||||
if (res.data.result.records.length ) {
|
||||
this.status = "loadmore";
|
||||
this.liveList.push(...res.data.result.records);
|
||||
} else {
|
||||
@@ -211,7 +211,7 @@ export default {
|
||||
? (this.status = "loadmore")
|
||||
: (this.status = "noMore");
|
||||
|
||||
console.log(this.status);
|
||||
|
||||
this.liveList.forEach((item) => {
|
||||
if (item.roomGoodsList) {
|
||||
item.roomGoodsList = JSON.parse(item.roomGoodsList);
|
||||
|
||||
@@ -19,13 +19,13 @@
|
||||
<view class="index-items">
|
||||
<view class="index-item" v-for="(item, key) in nav.goods" :key="key" @click="toGoods(item)">
|
||||
<view class="index-item-img">
|
||||
<u-image :src="item.goodsSku.thumbnail" mode="aspectFill">
|
||||
<u-image :src="item.thumbnail" mode="aspectFill">
|
||||
<u-loading slot="loading"></u-loading>
|
||||
</u-image>
|
||||
<view class="index-item-title">{{ item.goodsSku.goodsName }}</view>
|
||||
<view class="index-item-price">
|
||||
{{ item.points }}积分
|
||||
<span class="tipsMkt">¥{{ item.goodsSku.price | unitPrice }}</span>
|
||||
<view class="index-item-title">{{ item.goodsName }}</view>
|
||||
<view class="index-item-price flex flex-a-c flex-j-sb">
|
||||
<div class="point"><span>{{ item.points }}</span>积分</div>
|
||||
<span class="tipsMkt">¥{{ item.originalPrice | unitPrice }}</span>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -194,46 +194,12 @@ page {
|
||||
height: 100%;
|
||||
}
|
||||
.tipsMkt {
|
||||
float: right;
|
||||
color: #c0c4cc;
|
||||
font-size: 24rpx;
|
||||
font-size: 24rpx !important;
|
||||
text-decoration: line-through;
|
||||
margin-right: 20rpx;
|
||||
margin-right: 20rpx !important;
|
||||
}
|
||||
|
||||
.header {
|
||||
background: $light-color;
|
||||
position: relative;
|
||||
color: #fff;
|
||||
display: flex;
|
||||
height: 80rpx;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: 26rpx;
|
||||
font-size: 34rpx;
|
||||
|
||||
.left,
|
||||
.right {
|
||||
position: absolute;
|
||||
width: max-content;
|
||||
height: max-content;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
margin: auto;
|
||||
}
|
||||
|
||||
.left {
|
||||
float: left;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
left: 20rpx;
|
||||
}
|
||||
|
||||
.right {
|
||||
float: right;
|
||||
right: 20rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.index {
|
||||
height: 100vh;
|
||||
@@ -341,15 +307,19 @@ page {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.index-item-title-desc {
|
||||
font-size: 25rpx;
|
||||
color: #999999;
|
||||
margin-top: 10rpx;
|
||||
}
|
||||
|
||||
|
||||
.index-item-price {
|
||||
font-size: 28rpx;
|
||||
color: #ff5a10;
|
||||
overflow: hidden;
|
||||
color: $main-color;
|
||||
padding: 20rpx 0 0 20rpx;
|
||||
>.point{
|
||||
>span{
|
||||
font-size: 42rpx;
|
||||
font-weight: bold;
|
||||
margin-right:10rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1,49 +1,25 @@
|
||||
<template>
|
||||
<view class="sale">
|
||||
<view class="sale-head">
|
||||
<image src="@/pages/promotion/static/head-sample.png"></image>
|
||||
<u-navbar title='限时抢购'></u-navbar>
|
||||
<view class="header-wraper">
|
||||
<image mode="widthFix" src="/static/seckill.png"></image>
|
||||
</view>
|
||||
<scroll-view scroll-x>
|
||||
<view class="index-navs">
|
||||
<view class="index-nav-v">
|
||||
<view class="index-nav" :class="{ 'index-nav-active': nav == index }" @click="clickNavigateTime(index)"
|
||||
v-for="(item, index) in timeLine" :key="index">
|
||||
<view class="index-nav" :class="{ 'index-nav-active': nav == index }"
|
||||
@click="clickNavigateTime(index)" v-for="(item, index) in timeLine" :key="index">
|
||||
{{ item.timeLine }}:00
|
||||
<view class="index-nav-desc">{{ index === 0 && item.distanceStartTime === 0 ? '抢购中' : '即将开始' }}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="trailer" v-if="timeLine[nav] && times">
|
||||
{{ timeLine[nav].distanceStartTime === 0 ? (onlyOne ? '距结束' : '距下一轮') : '距开始' }}
|
||||
{{ times.hours == '00' ? '0' : times.hours }}小时{{ times.minutes }}分{{ times.seconds }}秒
|
||||
</view>
|
||||
|
||||
</scroll-view>
|
||||
<view class="sale-items" v-if="goodsList.length > 0">
|
||||
<view class="sale-item" v-for="(item,index) in goodsList" :key="index">
|
||||
<view class="sale-item-img">
|
||||
<image :src="item.goodsImage" mode="aspectFill"></image>
|
||||
</view>
|
||||
<view class="sale-item-content">
|
||||
<view class="sale-item-title">
|
||||
{{ item.goodsName }}
|
||||
<view class="sale-item-title-desc"></view>
|
||||
</view>
|
||||
<view class="sale-item-price">
|
||||
<text class="sale-item-price-now">¥{{ item.price | unitPrice}}</text>
|
||||
<text class="sale-item-price-origin"> ¥{{ item.originalPrice | unitPrice }}</text>
|
||||
</view>
|
||||
<view class="sale-item-surplus">
|
||||
仅剩{{ item.quantity - item.salesNum }}件
|
||||
<view class="sale-item-surplus-text"
|
||||
:style="{ width: (item.quantity / (item.quantity - item.salesNum)) * 100 + '%' }">
|
||||
</view>
|
||||
</view>
|
||||
<view class="sale-item-btn" @click="navigateToGoodsDetail(item)">
|
||||
{{ timeLine[nav].distanceStartTime === 0 ? (item.salesNum === item.quantity ? '已售空' : '购买') : '即将开始' }}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<goodsTemplate :res="goodsList" />
|
||||
|
||||
</view>
|
||||
<view v-else>
|
||||
<view class="nodata">
|
||||
@@ -56,9 +32,16 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getSeckillTimeLine, getSeckillTimeGoods } from "@/api/promotions.js";
|
||||
import {
|
||||
getSeckillTimeLine,
|
||||
getSeckillTimeGoods
|
||||
} from "@/api/promotions.js";
|
||||
import Foundation from "@/utils/Foundation.js";
|
||||
import goodsTemplate from '@/components/m-goods-list/promotion.vue'
|
||||
export default {
|
||||
components: {
|
||||
goodsTemplate
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
nav: 0, //默认选择第一个时间
|
||||
@@ -199,141 +182,24 @@ export default {
|
||||
}
|
||||
}
|
||||
|
||||
.sale-head {
|
||||
image {
|
||||
width: 100%;
|
||||
height: 280rpx;
|
||||
.header-wraper {
|
||||
background: url('/static/bg.png');
|
||||
height: 200rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
>image{
|
||||
width: 300rpx;
|
||||
height: 100rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.sale-items {
|
||||
padding-top: 20rpx;
|
||||
display: -webkit-box;
|
||||
display: -webkit-flex;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.sale-item {
|
||||
width: 710rpx;
|
||||
height: 226rpx;
|
||||
padding-left: 20rpx;
|
||||
margin-bottom: 10rpx;
|
||||
border-radius: 12rpx;
|
||||
background-color: #fff;
|
||||
position: relative;
|
||||
display: -webkit-box;
|
||||
display: -webkit-flex;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.sale-item-img {
|
||||
margin-right: 20rpx;
|
||||
image {
|
||||
width: 186rpx;
|
||||
height: 186rpx;
|
||||
border-radius: 8rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.sale-item-content {
|
||||
line-height: 2em;
|
||||
}
|
||||
|
||||
.sale-item-title {
|
||||
display: -webkit-box;
|
||||
-webkit-box-orient: vertical;
|
||||
-webkit-line-clamp: 2;
|
||||
overflow: hidden;
|
||||
line-height: 1.5;
|
||||
font-size: 28rpx;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.sale-item-title-desc {
|
||||
font-size: 22rpx;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.sale-item-price {
|
||||
font-size: 22rpx;
|
||||
color: 999;
|
||||
}
|
||||
|
||||
.sale-item-price-now {
|
||||
font-size: 40rpx;
|
||||
color: #ff5a10;
|
||||
margin: 0 10rpx;
|
||||
}
|
||||
|
||||
.sale-item-price-origin {
|
||||
font-size: 20rpx;
|
||||
color: #999;
|
||||
|
||||
-webkit-text-decoration-line: line-through;
|
||||
text-decoration-line: line-through;
|
||||
text-decoration: line-through;
|
||||
}
|
||||
|
||||
.sale-item-surplus {
|
||||
border: 2rpx solid rgb(34, 178, 140);
|
||||
border-radius: 12px;
|
||||
width: 166rpx;
|
||||
color: rgb(31, 177, 138);
|
||||
font-size: 20rpx;
|
||||
position: relative;
|
||||
text-align: center;
|
||||
z-index: 2;
|
||||
height: 32rpx;
|
||||
line-height: 28rpx;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.sale-item-surplus-text {
|
||||
width: 166rpx;
|
||||
background: rgb(234, 247, 245);
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
z-index: -1;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.sale-item-btn {
|
||||
position: absolute;
|
||||
right: 20rpx;
|
||||
bottom: 20rpx;
|
||||
padding: 0 20rpx;
|
||||
height: 60rpx;
|
||||
background-color: #1abc9c;
|
||||
border-radius: 10rpx;
|
||||
font-size: 25rpx;
|
||||
color: #fff;
|
||||
display: -webkit-box;
|
||||
display: -webkit-flex;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.trailer {
|
||||
height: 100rpx;
|
||||
background: #ffffff;
|
||||
display: -webkit-box;
|
||||
display: -webkit-flex;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
font-size: 22rpx;
|
||||
color: #666666;
|
||||
box-sizing: border-box;
|
||||
position: relative;
|
||||
z-index: 0;
|
||||
}
|
||||
|
||||
.index-navs {
|
||||
background: #fff;
|
||||
background-color: #f7f7f7;
|
||||
display: -webkit-box;
|
||||
display: -webkit-flex;
|
||||
@@ -364,17 +230,19 @@ export default {
|
||||
height: 115rpx;
|
||||
line-height: 1em;
|
||||
position: relative;
|
||||
font-size: 32rpx;
|
||||
font-weight: bold;
|
||||
|
||||
&-active {
|
||||
background-image: url(/static/seckill/active.png);
|
||||
background-size: 100% 115rpx;
|
||||
background-repeat: no-repeat;
|
||||
color: #ffffff;
|
||||
color: $main-color;
|
||||
position: relative;
|
||||
z-index: 30;
|
||||
|
||||
.index-nav-desc {
|
||||
color: #ffffff;
|
||||
color: #fff;
|
||||
font-weight: bold;
|
||||
background: $main-color;
|
||||
padding: 6rpx 16rpx;
|
||||
border-radius: 50px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,8 +29,9 @@
|
||||
<span class="store-name store-line-desc" @click.stop="navigateToStore(item)">{{
|
||||
item.storeName
|
||||
}}</span>
|
||||
<u-icon @click="navigateToStore(item)" size="24" style="margin-left:10rpx;" name="arrow-right"></u-icon>
|
||||
</view>
|
||||
<view class="right-col" @click="navigateToConpon(item)">
|
||||
<view class="right-col" v-if="item.canReceiveCoupon" @click="navigateToConpon(item)">
|
||||
<div class="right-line"></div>
|
||||
<span>领劵</span>
|
||||
</view>
|
||||
@@ -39,9 +40,8 @@
|
||||
ref="swiperAction" class="cart-item" v-for="(skuItem, i) in item.skuList" :index="i" :key="skuItem.goodsSku.id"
|
||||
@click="changeActionTab(skuItem)" @longpress="changeActionTab(skuItem)">
|
||||
<!-- 满减活动 -->
|
||||
<div v-if="skuItem.promotions" v-for="(fullDiscount,fullDiscountIndex) in skuItem.promotions"
|
||||
:key="fullDiscountIndex">
|
||||
<div v-if="fullDiscount.promotionType == 'FULL_DISCOUNT'">
|
||||
<div v-if="Object.keys(skuItem.promotionMap).length != 0">
|
||||
<div v-if="getPromotion(skuItem).includes('FULL_DISCOUNT')">
|
||||
<div class="promotion-notice" v-if="item.promotionNotice">
|
||||
<span class="tips">满减</span>
|
||||
<span style="flex:10;">{{item.promotionNotice}}</span>
|
||||
@@ -51,7 +51,7 @@
|
||||
<view class="goods-row" :class="{ invalid: isInvalid(skuItem) }">
|
||||
<view class="goods-config">
|
||||
<view>
|
||||
<u-checkbox-group v-if="skuItem.invalid == 0">
|
||||
<u-checkbox-group v-if="skuItem.invalid == 0 && !skuItem.errorMessage">
|
||||
<!-- #ifndef MP-WEIXIN -->
|
||||
<u-checkbox shape="circle" :active-color="lightColor" class="c-left" v-model="skuItem.checked"
|
||||
@change="checkboxChange(skuItem)"></u-checkbox>
|
||||
@@ -74,12 +74,13 @@
|
||||
</p>
|
||||
<!-- 规格 -->
|
||||
<p class="sp-type">{{skuItem.goodsSku.simpleSpecs}}</p>
|
||||
<p class="sp-type" v-if="skuItem.goodsSku.salesModel == 'WHOLESALE'">批发商品</p>
|
||||
<p class="sp-number">
|
||||
<view class="sp-price">
|
||||
<div class="default-color" :class="{'main-color':skuItem.promotions.length ==0 }">
|
||||
<div class="default-color" :class="{'main-color':Object.keys(skuItem.promotionMap).length ==0 }">
|
||||
|
||||
¥<span>{{ formatPrice(skuItem.goodsSku.price)[0] }}</span>
|
||||
<span>.{{ formatPrice(skuItem.goodsSku.price)[1] }}</span>
|
||||
¥<span>{{ $options.filters.goodsFormatPrice(skuItem.goodsSku.price)[0] }}</span>
|
||||
<span>.{{ $options.filters.goodsFormatPrice(skuItem.goodsSku.price)[1] }}</span>
|
||||
</div>
|
||||
</view>
|
||||
<view>
|
||||
@@ -95,22 +96,24 @@
|
||||
</view>
|
||||
<!-- 如果当有促销并且促销是 限时抢购 -->
|
||||
<!-- promotions -->
|
||||
<div class="promotions-list" v-if="skuItem.promotions"
|
||||
v-for="(seckill,seckillIndex) in skuItem.promotions" :key="seckillIndex">
|
||||
<div class="promotions-item-seckill" v-if="seckill.promotionType == 'SECKILL'">
|
||||
<div class="promotions-list" v-if="Object.keys(skuItem.promotionMap).length != 0"
|
||||
>
|
||||
<div class="promotions-item-seckill" v-if="getPromotion(skuItem).includes('SECKILL')">
|
||||
距秒杀结束: <u-count-down show-border :hide-zero-day="true" :color="$mainColor" border-color="#ededed"
|
||||
font-size="24" :timestamp="getCountDownTime(seckill.endTime)">
|
||||
font-size="24" :timestamp="getCountDownTime(skuItem)">
|
||||
</u-count-down>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 如果有活动 并且是选中的状态,显示预估到手价格 -->
|
||||
<div class="priceDetail-flowPrice" :class="{'main-color':skuItem.priceDetailDTO}"
|
||||
v-if="skuItem.priceDetailDTO && skuItem.invalid == 0 && skuItem.promotions.length!=0 && skuItem.checked && skuItem.checked">
|
||||
预估到手价 ¥<span>{{ formatPrice(skuItem.priceDetailDTO.flowPrice)[0]}}</span>
|
||||
<span>.{{ formatPrice(skuItem.priceDetailDTO.flowPrice)[1] }} </span>
|
||||
v-if="skuItem.priceDetailDTO && skuItem.invalid == 0 && Object.keys(skuItem.promotionMap).length != 0 && skuItem.checked && skuItem.checked">
|
||||
预估到手价 ¥<span>{{ $options.filters.goodsFormatPrice(skuItem.priceDetailDTO.flowPrice)[0]}}</span>
|
||||
<span>.{{ $options.filters.goodsFormatPrice(skuItem.priceDetailDTO.flowPrice)[1] }} </span>
|
||||
</div>
|
||||
<div style='margin-left: 20rpx;' v-if="!skuItem.checked && skuItem.errorMessage">
|
||||
{{skuItem.errorMessage}}
|
||||
</div>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
</u-swipe-action>
|
||||
@@ -128,7 +131,7 @@
|
||||
<div class="fullPrice">
|
||||
<span class="number" v-if="cartDetail && cartDetail.priceDetailDTO">
|
||||
总计:
|
||||
<span>¥{{ formatPrice(cartDetail.priceDetailDTO.flowPrice)[0] }}</span>.<span>{{ formatPrice(cartDetail.priceDetailDTO.flowPrice)[1] }}</span>
|
||||
<span>¥{{ $options.filters.goodsFormatPrice(cartDetail.priceDetailDTO.flowPrice)[0] }}</span>.<span>{{ $options.filters.goodsFormatPrice(cartDetail.priceDetailDTO.flowPrice)[1] }}</span>
|
||||
</span>
|
||||
<span class="number" v-else>总计:0.00</span>
|
||||
</div>
|
||||
@@ -192,8 +195,8 @@ export default {
|
||||
},
|
||||
],
|
||||
isInvalid(val) {
|
||||
//是否无效商品
|
||||
if (val.invalid == 1) {
|
||||
//是否无效商品/没库存商品
|
||||
if (val.invalid == 1 || (!val.checked && val.errorMessage)) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
@@ -204,7 +207,7 @@ export default {
|
||||
cartDetail: "", //购物车详情
|
||||
goodsVal: "", //单个商品详情
|
||||
isEdit: false, // 是否是编辑
|
||||
checkout: true, //全选按钮
|
||||
checkout: false, //全选按钮
|
||||
WEIXIN_num: "", //购物车兼容微信步进器
|
||||
};
|
||||
},
|
||||
@@ -215,6 +218,10 @@ export default {
|
||||
uni.showShareMenu({ withShareTicket: true });
|
||||
// #endif
|
||||
},
|
||||
onPullDownRefresh(){
|
||||
console.log("132")
|
||||
this.getCardData();
|
||||
},
|
||||
/**
|
||||
* 初始化信息
|
||||
*/
|
||||
@@ -235,9 +242,12 @@ export default {
|
||||
* 倒数计时
|
||||
*/
|
||||
getCountDownTime(val) {
|
||||
let date = new Date(val.replace(/-/g, "/"));
|
||||
let timeSimple = new Date(date).getTime() / 1000;
|
||||
return timeSimple - new Date().getTime() / 1000;
|
||||
if (val.promotionMap) {
|
||||
let key = Object.keys(val.promotionMap).find((child, index) => {
|
||||
return child.split("-")[0] == 'SECKILL'
|
||||
});
|
||||
return val.promotionMap[key].endTime / 1000 - (new Date().getTime() / 1000)
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -246,17 +256,6 @@ export default {
|
||||
discountDetails() {
|
||||
this.discountDetailsFlag = true;
|
||||
},
|
||||
|
||||
/**
|
||||
* 格式化金钱 1999 --> [1999,00]
|
||||
*/
|
||||
formatPrice(val) {
|
||||
if (typeof val == "undefined") {
|
||||
return val;
|
||||
}
|
||||
return val.toFixed(2).split(".");
|
||||
},
|
||||
|
||||
/**
|
||||
* 左滑打开删除
|
||||
*/
|
||||
@@ -334,7 +333,7 @@ export default {
|
||||
*/
|
||||
navigateToStore(val) {
|
||||
uni.navigateTo({
|
||||
url: "../product/shopPage?id=" + val.storeId,
|
||||
url: "/pages/product/shopPage?id=" + val.storeId,
|
||||
});
|
||||
},
|
||||
|
||||
@@ -397,6 +396,8 @@ export default {
|
||||
* 验证是否选中商品
|
||||
*/
|
||||
whetherChecked() {
|
||||
this.$options.filters.forceLogin()
|
||||
|
||||
let canBuy = false;
|
||||
this.cartDetail.cartList.forEach((item) => {
|
||||
if (item.checked) {
|
||||
@@ -490,6 +491,13 @@ export default {
|
||||
});
|
||||
},
|
||||
|
||||
// 数据去重一下
|
||||
getPromotion(item) {
|
||||
return Object.keys(item.promotionMap).map((child) => {
|
||||
return child.split("-")[0]
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 获取购物车数据
|
||||
*/
|
||||
@@ -500,26 +508,36 @@ export default {
|
||||
});
|
||||
API_Trade.getCarts()
|
||||
.then((result) => {
|
||||
uni.stopPullDownRefresh();
|
||||
if (result.data.success) {
|
||||
this.cartDetail = result.data.result;
|
||||
this.checkout = true;
|
||||
let checkouted = true;
|
||||
for (let i = 0; i < this.cartDetail.cartList.length; i++) {
|
||||
let item = this.cartDetail.cartList[i];
|
||||
console.log(item);
|
||||
// 循环出当前商品是否全选
|
||||
if (item.checked == 0) {
|
||||
this.checkout = false;
|
||||
checkouted = false;
|
||||
}
|
||||
// 如果有拼团活动顺便删除
|
||||
item.skuList &&
|
||||
item.skuList.forEach((sku) => {
|
||||
sku.promotions &&
|
||||
sku.promotions.forEach((pro, proIndex) => {
|
||||
if (pro.promotionType == "PINTUAN") {
|
||||
sku.promotions.splice(proIndex, 1);
|
||||
if (sku.checked == 0) {
|
||||
checkouted = false;
|
||||
}
|
||||
if(Object.keys(sku.promotionMap).length != 0)
|
||||
{
|
||||
Object.keys(sku.promotionMap).forEach((pro, proIndex) => {
|
||||
pro = pro.split('-')[0]
|
||||
if (pro == "PINTUAN" ) {
|
||||
Object.keys(sku.promotionMap).splice(proIndex, 1);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
this.checkout = checkouted;
|
||||
uni.stopPullDownRefresh();
|
||||
}
|
||||
})
|
||||
@@ -556,6 +574,7 @@ page {
|
||||
box-shadow: 0 4rpx 12rpx 0 rgba(0, 0, 0, 0.05);
|
||||
}
|
||||
.promotion-notice {
|
||||
margin-top: 10px;
|
||||
margin-left: 68rpx;
|
||||
font-size: 24rpx;
|
||||
color: #333;
|
||||
@@ -584,6 +603,7 @@ page {
|
||||
|
||||
.store-name {
|
||||
font-weight: bold;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
.invalid {
|
||||
filter: grayscale(1);
|
||||
|
||||
@@ -15,6 +15,11 @@ export default {
|
||||
},
|
||||
};
|
||||
},
|
||||
onReachBottom(){
|
||||
// 给子级监听触底加载
|
||||
uni.$emit('onReachBottom',true)
|
||||
},
|
||||
|
||||
onPullDownRefresh() {
|
||||
this.$refs.tpl.init();
|
||||
|
||||
|
||||
@@ -1,9 +1,14 @@
|
||||
/** 配置楼层模块的跳转 */
|
||||
export function modelNavigateTo(item) {
|
||||
let val = item.url;
|
||||
|
||||
switch (val.___type) {
|
||||
let val = item.url || item;
|
||||
//链接跳转到专题
|
||||
|
||||
if (val && val.id && val.pageType == "special") {
|
||||
uni.navigateTo({
|
||||
url: `/pages/tabbar/special/special?id=${val.id}`,
|
||||
});
|
||||
}
|
||||
switch (val.___type || val.type) {
|
||||
case "goods":
|
||||
uni.navigateTo({
|
||||
url: "/pages/product/goods?id=" + val.id + "&goodsId=" + val.goodsId,
|
||||
@@ -28,7 +33,7 @@ export function modelNavigateTo(item) {
|
||||
// 活动
|
||||
case "marketing":
|
||||
uni.navigateTo({
|
||||
url: "/pages/product/goods?id=" + val.skuId + "goodsId=" + val.goodsId,
|
||||
url: "/pages/product/goods?id=" + val.id + "goodsId=" + val.goodsId,
|
||||
});
|
||||
break;
|
||||
case "pages":
|
||||
@@ -37,8 +42,7 @@ export function modelNavigateTo(item) {
|
||||
});
|
||||
break;
|
||||
case "other":
|
||||
switch (val.title) {
|
||||
|
||||
switch (val.title || item.title) {
|
||||
case "首页":
|
||||
uni.switchTab({
|
||||
url: `/pages/tabbar/home/index`,
|
||||
@@ -99,8 +103,106 @@ export function modelNavigateTo(item) {
|
||||
url: `/pages/promotion/point/pointList`,
|
||||
});
|
||||
break;
|
||||
case "店铺列表":
|
||||
uni.navigateTo({
|
||||
url: `/pages/product/shopList`,
|
||||
});
|
||||
break;
|
||||
default:
|
||||
// #ifdef H5
|
||||
window.location.href = val.url || item.link;
|
||||
// #endif
|
||||
// #ifdef APP-PLUS
|
||||
plus.runtime.openURL(val.url || item.link) //不需要拼接\
|
||||
// #endif
|
||||
break;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
import config from "@/config/config";
|
||||
|
||||
async function scan() {
|
||||
// #ifdef APP-PLUS
|
||||
let isIos = plus.os.name == "iOS";
|
||||
// 判断是否是Ios
|
||||
if (isIos) {
|
||||
const iosFirstCamera = uni.getStorageSync("iosFirstCamera"); //是不是第一次开启相机
|
||||
if (iosFirstCamera !== "false") {
|
||||
uni.setStorageSync("iosFirstCamera", "false"); //设为false就代表不是第一次开启相机
|
||||
seacnCode();
|
||||
} else {
|
||||
if (permision.judgeIosPermission("camera")) {
|
||||
seacnCode();
|
||||
} else {
|
||||
// 没有权限提醒是否去申请权限
|
||||
tipsGetSettings();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
/**
|
||||
* TODO 安卓 权限已经授权了,调用api总是显示用户已永久拒绝申请。人傻了
|
||||
* TODO 如果xdm有更好的办法请在 https://gitee.com/beijing_hongye_huicheng/lilishop/issues 提下谢谢
|
||||
*/
|
||||
seacnCode();
|
||||
}
|
||||
|
||||
// #endif
|
||||
|
||||
// #ifdef MP-WEIXIN
|
||||
seacnCode();
|
||||
// #endif
|
||||
}
|
||||
/**
|
||||
* 提示获取权限
|
||||
*/
|
||||
function tipsGetSettings() {
|
||||
uni.showModal({
|
||||
title: "提示",
|
||||
content: "您已经关闭相机权限,去设置",
|
||||
success: function (res) {
|
||||
if (res.confirm) {
|
||||
if (isIos) {
|
||||
plus.runtime.openURL("app-settings:");
|
||||
} else {
|
||||
permision.gotoAppPermissionSetting();
|
||||
}
|
||||
}
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
function seacnCode() {
|
||||
uni.scanCode({
|
||||
success: function (res) {
|
||||
let path = encodeURIComponent(res.result);
|
||||
|
||||
// WX_CODE 为小程序码
|
||||
if (res.scanType == "WX_CODE") {
|
||||
console.log(res);
|
||||
uni.navigateTo({
|
||||
url: `/${res.path}`,
|
||||
});
|
||||
} else {
|
||||
config.scanAuthNavigation.forEach((src) => {
|
||||
if (res.result.indexOf(src) != -1) {
|
||||
uni.navigateTo({
|
||||
url: `/${res.result.substring(src.length)}`,
|
||||
});
|
||||
} else {
|
||||
setTimeout(() => {
|
||||
uni.navigateTo({
|
||||
url: "/pages/tabbar/home/web-view?src=" + path,
|
||||
});
|
||||
}, 100);
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
});
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<div class="layout">
|
||||
<div class="box">
|
||||
<u-swiper @click="clickSwiper" interval="5000" duration="500" height="300" v-if="res" name="img" :list="res.list">
|
||||
<u-swiper @click="clickSwiper" interval="5000" duration="500" height="350" v-if="res" name="img" :list="res.list">
|
||||
<u-loading slot="loading"></u-loading>
|
||||
</u-swiper>
|
||||
</div>
|
||||
|
||||
@@ -1,15 +1,20 @@
|
||||
<template>
|
||||
<div class="layout">
|
||||
<div class="flex-one" @click="modelNavigateTo(res.list[0])">
|
||||
<u-image width="100%" mode="aspectFit" height="280rpx" :src="res.list[0].img" alt=""></u-image>
|
||||
<div class="flex-one">
|
||||
<!-- <u-image width="100%" mode="aspectFit" height="280rpx" :src="res.list[0].img" alt=""></u-image> -->
|
||||
<hotzone :res="res"></hotzone>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { modelNavigateTo } from "./tpl";
|
||||
import hotzone from "@/pages/tabbar/home/template/tpl_hot_zone.vue";
|
||||
|
||||
export default {
|
||||
title: "单行图片模块",
|
||||
components: {
|
||||
hotzone,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
modelNavigateTo,
|
||||
|
||||
@@ -1,20 +1,38 @@
|
||||
|
||||
<template>
|
||||
<div class="layout">
|
||||
<u-sticky>
|
||||
<div class="goods-cell-title">
|
||||
<div class="goods-item-title" :class="{ 'selected-title': selected.index == index }"
|
||||
@click="handleClickTitle(title, index)" v-for="(title, index) in res.list[0].titleWay" :key="index">
|
||||
<div
|
||||
class="goods-item-title"
|
||||
:class="{ 'selected-title': selected.index == index }"
|
||||
@click="handleClickTitle(title, index)"
|
||||
v-for="(title, index) in res.list[0].titleWay"
|
||||
:key="index"
|
||||
>
|
||||
<h4 class="h4">{{ title.title }}</h4>
|
||||
<div>{{ title.desc }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</u-sticky>
|
||||
<div class="goods-list">
|
||||
<div v-if="selected.val == item.type" @click="handleClick(item)" class="goods-item"
|
||||
v-for="(item, item_index) in res.list[0].listWay" :key="item_index">
|
||||
<div
|
||||
v-if="
|
||||
item.___index != undefined
|
||||
? selected.index == item.___index
|
||||
: selected.val == item.type
|
||||
"
|
||||
@click="handleClick(item)"
|
||||
class="goods-item"
|
||||
v-for="(item, item_index) in res.list[0].listWay"
|
||||
:key="item_index"
|
||||
>
|
||||
<div class="goods-img">
|
||||
<u-image :src="item.img" height="350rpx" mode="aspectFit" width="100%">
|
||||
<u-image
|
||||
:src="item.img"
|
||||
height="350rpx"
|
||||
mode="aspectFit"
|
||||
width="100%"
|
||||
>
|
||||
<u-loading slot="loading"></u-loading>
|
||||
</u-image>
|
||||
</div>
|
||||
@@ -23,7 +41,42 @@
|
||||
{{ item.title }}
|
||||
</div>
|
||||
<div class="goods-bottom">
|
||||
<div class="goods-price">¥{{ item.price | unitPrice }}</div>
|
||||
<div class="goods-price">
|
||||
¥<span
|
||||
>{{ $options.filters.goodsFormatPrice(item.price)[0] }} </span
|
||||
>.{{ $options.filters.goodsFormatPrice(item.price)[1] }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div
|
||||
v-if="res.list[0].titleWay[selected.index].bindCategory && goodsData.length"
|
||||
v-for="(item, index) in goodsData"
|
||||
:key="index"
|
||||
class="goods-item"
|
||||
@click="handleClick(item)"
|
||||
>
|
||||
<div class="goods-img">
|
||||
<u-image
|
||||
:src="item.thumbnail"
|
||||
height="350rpx"
|
||||
mode="aspectFit"
|
||||
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">
|
||||
¥<span
|
||||
>{{ $options.filters.goodsFormatPrice(item.price)[0] }} </span
|
||||
>.{{ $options.filters.goodsFormatPrice(item.price)[1] }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -31,6 +84,7 @@
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { getGoodsList } from "@/api/goods.js";
|
||||
export default {
|
||||
title: "商品分类以及商品",
|
||||
data() {
|
||||
@@ -39,25 +93,43 @@ export default {
|
||||
index: 0,
|
||||
val: "",
|
||||
},
|
||||
params: {
|
||||
pageNumber: 1,
|
||||
pageSize: 100,
|
||||
categoryId: "",
|
||||
},
|
||||
goodsData: [], //商品循环内容
|
||||
goodsResult:"", //es总返回内容
|
||||
};
|
||||
},
|
||||
props: ["res"],
|
||||
props: ["res","enableBottomLoad"],
|
||||
watch: {
|
||||
res: {
|
||||
handler(val) {
|
||||
// 监听父级的值 如果有值将值赋给selected
|
||||
if (val) {
|
||||
this.selected.val = this.res.list[0].listWay[0].type;
|
||||
console.log(val)
|
||||
// 如果第一个标签页绑定为商品
|
||||
this.selected.val = this.res.list[0].listWay[0] ? this.res.list[0].listWay[0].type: '';
|
||||
// 如果第一个标签为绑定为分类
|
||||
this.res.list[0].titleWay[0].bindCategory ? this.initGoods(this.res.list[0].titleWay[0]) : ''
|
||||
}
|
||||
},
|
||||
immediate: true,
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.$u.getRect('.goods-cell-title').then(res=>{
|
||||
console.log(res)
|
||||
uni.$on('onReachBottom',()=>{
|
||||
if(this.enableBottomLoad && this.goodsResult.totalElements >= this.params.pageNumber * this.params.pageSize){
|
||||
this.params.pageNumber++
|
||||
this.initGoods(this.res.list[0].titleWay[this.selected.index])
|
||||
}
|
||||
|
||||
})
|
||||
},
|
||||
destroyed(){
|
||||
uni.$off('onReachBottom')
|
||||
},
|
||||
methods: {
|
||||
handleClick(item) {
|
||||
uni.navigateTo({
|
||||
@@ -67,9 +139,25 @@ export default {
|
||||
closeGoods(val, index) {
|
||||
this.res.list[0].listWay.splice(index, 1);
|
||||
},
|
||||
async initGoods(val) {
|
||||
if(this.enableBottomLoad) this.params.pageSize = 20
|
||||
val ? this.params.categoryId = val.bindCategory.id : '';
|
||||
const res = await getGoodsList(this.params);
|
||||
if (res.data.success) {
|
||||
this.goodsResult = res.data.result
|
||||
const result = res.data.result.content.map(item=>item.content)
|
||||
this.goodsData.push(...result);
|
||||
console.log(this.goodsData)
|
||||
}
|
||||
},
|
||||
handleClickTitle(val, index) {
|
||||
this.selected.index = index;
|
||||
this.selected.val = val.title;
|
||||
if (val.bindCategory) {
|
||||
this.params.pageNumber = 1
|
||||
this.goodsData = []
|
||||
this.initGoods(val);
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
@@ -152,7 +240,7 @@ $w_94: 94%;
|
||||
margin: 0 auto;
|
||||
> .goods-title {
|
||||
font-size: 24rpx;
|
||||
height: 70rpx;
|
||||
height: 67rpx;
|
||||
display: -webkit-box;
|
||||
font-weight: 500;
|
||||
-webkit-box-orient: vertical;
|
||||
@@ -166,13 +254,10 @@ $w_94: 94%;
|
||||
> .goods-price {
|
||||
line-height: 2;
|
||||
color: $main-color;
|
||||
> span {
|
||||
font-size: 42rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.goods-icon {
|
||||
right: 10rpx;
|
||||
top: 10rpx;
|
||||
position: absolute;
|
||||
}
|
||||
</style>
|
||||
|
||||
57
pages/tabbar/home/template/tpl_hot_zone.vue
Normal file
57
pages/tabbar/home/template/tpl_hot_zone.vue
Normal file
@@ -0,0 +1,57 @@
|
||||
<template>
|
||||
<div class="layout">
|
||||
<div class="flex-one hot-image">
|
||||
<image mode="widthFix" :src="res.list[0].img" alt=""></image>
|
||||
|
||||
<image
|
||||
v-for="(area, index) in res.list[0].zoneInfo"
|
||||
:key="index"
|
||||
@click="modelNavigateTo(area)"
|
||||
mode="widthFix"
|
||||
class="hot-area"
|
||||
:style="{
|
||||
left: area.leftPer * 100 + '%',
|
||||
top: area.topPer * 100 + '%',
|
||||
width: area.widthPer * 100 + '%',
|
||||
height: area.heightPer * 100 + '%',
|
||||
}"
|
||||
:src="area.img"
|
||||
alt=""
|
||||
></image>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { modelNavigateTo } from "./tpl";
|
||||
|
||||
export default {
|
||||
title: "热区模块",
|
||||
data() {
|
||||
return {
|
||||
modelNavigateTo,
|
||||
};
|
||||
},
|
||||
props: ["res"],
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
@import "./tpl.scss";
|
||||
.hot-image {
|
||||
position: relative;
|
||||
}
|
||||
.hot-area {
|
||||
position: absolute;
|
||||
z-index: 99;
|
||||
}
|
||||
.flex-one {
|
||||
width: 100%;
|
||||
display: block;
|
||||
overflow: hidden;
|
||||
image {
|
||||
width: 100%;
|
||||
|
||||
min-height: 200rpx;
|
||||
// height: 100%;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -1,7 +1,12 @@
|
||||
<template>
|
||||
<div class="layout">
|
||||
<div class="menu-list">
|
||||
<div class="menu-item" @click="modelNavigateTo(item)" v-for="(item, index) in res.list" :key="index">
|
||||
<div
|
||||
class="menu-item"
|
||||
@click="modelNavigateTo(item)"
|
||||
v-for="(item, index) in res.list"
|
||||
:key="index"
|
||||
>
|
||||
<div>
|
||||
<u-image
|
||||
width="88rpx"
|
||||
@@ -18,15 +23,15 @@
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import {modelNavigateTo} from './tpl'
|
||||
import { modelNavigateTo } from "./tpl";
|
||||
export default {
|
||||
title: "五列菜单",
|
||||
props: ["res"],
|
||||
data() {
|
||||
return {
|
||||
modelNavigateTo,
|
||||
}
|
||||
}
|
||||
};
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
@@ -34,6 +39,7 @@ export default {
|
||||
.menu-list {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
flex-wrap: wrap;
|
||||
|
||||
> .menu-item {
|
||||
|
||||
49
pages/tabbar/home/template/tpl_notice.vue
Normal file
49
pages/tabbar/home/template/tpl_notice.vue
Normal file
@@ -0,0 +1,49 @@
|
||||
<template>
|
||||
<div class="layout">
|
||||
<div class="background">
|
||||
<u-notice-bar mode="vertical" :bg-color="res.list[0].bk_color" :color="res.list[0].color" :list="list"></u-notice-bar>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
title: "公告",
|
||||
props: ["res"],
|
||||
data() {
|
||||
return {
|
||||
list: []
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.list = this.res.list[0].title.map(i => i.context);
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
@import "./tpl.scss";
|
||||
.background {
|
||||
position: absolute;
|
||||
z-index: 2;
|
||||
width: 100%;
|
||||
height: 84rpx;
|
||||
text-align: left;
|
||||
font-size: 20rpx;
|
||||
background-size: cover;
|
||||
}
|
||||
.layout {
|
||||
text-align: center;
|
||||
position: relative;
|
||||
height: 84rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
||||
background: #ffffff;
|
||||
}
|
||||
.title {
|
||||
line-height: 84rpx;
|
||||
font-size: 20px;
|
||||
font-weight: bold;
|
||||
}
|
||||
</style>
|
||||
273
pages/tabbar/home/template/tpl_promotions_detail.vue
Normal file
273
pages/tabbar/home/template/tpl_promotions_detail.vue
Normal file
@@ -0,0 +1,273 @@
|
||||
<template>
|
||||
<div class="layout">
|
||||
<div class="join-list">
|
||||
<div
|
||||
v-for="(item, index) in res.list"
|
||||
:key="index"
|
||||
class="join-list-item"
|
||||
@click="goToDetail(item.type)"
|
||||
>
|
||||
<div>
|
||||
<div class="join-title">
|
||||
<div>{{ item.title }}</div>
|
||||
<div
|
||||
class="sub"
|
||||
v-if="item.type !== 'SECKILL'"
|
||||
:style="{
|
||||
backgroundColor: item.bk_color,
|
||||
color: item.color1,
|
||||
borderColor: item.bk_color,
|
||||
}"
|
||||
>
|
||||
{{ item.title1 }}
|
||||
</div>
|
||||
<div class="sub-seckill" v-else>
|
||||
<div class="sub-seckill-block flex">
|
||||
<div class="sub-seckill-block-text">
|
||||
{{ timeLine[0] ? timeLine[0].timeLine : "x" }}点场
|
||||
</div>
|
||||
{{ times.hours == "00" ? "0" : times.hours }}:{{
|
||||
times.minutes
|
||||
}}:{{ times.seconds }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="join-box">
|
||||
<div
|
||||
class="join-item"
|
||||
v-for="(i, _index) in item.data"
|
||||
:key="_index"
|
||||
>
|
||||
<div class="item-img-box">
|
||||
<u-image
|
||||
class="item-img"
|
||||
width="156rpx"
|
||||
height="156rpx"
|
||||
:src="i.thumbnail ? i.thumbnail : i.goodsImage"
|
||||
alt
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
class="ellipsis"
|
||||
:class="{ 'max-width': res.list.length <= 1 }"
|
||||
>
|
||||
{{ i.goodsName ? i.goodsName : i.name }}
|
||||
</div>
|
||||
<div class="item-price">
|
||||
<span>¥{{ i.price ? i.price : i.originalPrice }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import * as API_Promotions from "@/api/promotions";
|
||||
import Foundation from "@/utils/Foundation.js";
|
||||
export default {
|
||||
props: ["res"],
|
||||
data() {
|
||||
return {
|
||||
timeLine: "", //获取几个点活动
|
||||
resTime: 0, //当前时间
|
||||
time: 0, //距离下一个活动的时间值
|
||||
times: {}, //时间集合
|
||||
onlyOne: "", //是否最后一个商品
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
let params = {
|
||||
pageNumber: 1,
|
||||
pageSize: 2,
|
||||
status: "START",
|
||||
promotionStatus: "START",
|
||||
};
|
||||
this._setTimeInterval = setInterval(() => {
|
||||
if (this.time <= 0) {
|
||||
clearInterval(this._setTimeInterval);
|
||||
} else {
|
||||
this.times = Foundation.countTimeDown(this.time);
|
||||
this.time--;
|
||||
}
|
||||
}, 1000);
|
||||
this.res.list.forEach((ele) => {
|
||||
switch (ele.type) {
|
||||
case "PINTUAN":
|
||||
API_Promotions.getAssembleList(params).then((response) => {
|
||||
const data = response.data.result.records;
|
||||
if (data) {
|
||||
ele.data = data;
|
||||
}
|
||||
});
|
||||
break;
|
||||
case "SECKILL":
|
||||
API_Promotions.getSeckillTimeLine().then((response) => {
|
||||
if (response.data.success && response.data.result) {
|
||||
ele.data = response.data.result[0].seckillGoodsList.slice(0, 2);
|
||||
let timeLine = response.data.result.sort(
|
||||
(x, y) => Number(x.timeLine) - Number(y.timeLine)
|
||||
);
|
||||
this.timeLine = timeLine.slice(0, 5);
|
||||
this.resTime = parseInt(new Date().getTime() / 1000);
|
||||
this.onlyOne = response.data.result.length === 1;
|
||||
this.diffTime = parseInt(new Date().getTime() / 1000) - this.resTime;
|
||||
|
||||
this.time =
|
||||
this.timeLine[0].distanceStartTime ||
|
||||
(this.timeLine[1] && this.timeLine[1].distanceStartTime) ||
|
||||
Foundation.theNextDayTime() - this.diffTime;
|
||||
this.times = Foundation.countTimeDown(this.time);
|
||||
console.log(this.timeLine);
|
||||
}
|
||||
});
|
||||
break;
|
||||
case "LIVE":
|
||||
API_Promotions.getLiveList(params).then((response) => {
|
||||
if (response.success && response.result.records) {
|
||||
ele.data = response.result.records[0].commodityList.slice(0, 2);
|
||||
}
|
||||
});
|
||||
break;
|
||||
case "KANJIA":
|
||||
API_Promotions.getBargainList(params).then((response) => {
|
||||
if (response.success && response.result) {
|
||||
ele.data = response.result.records(0, 2);
|
||||
}
|
||||
});
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
//跳转详情
|
||||
goToDetail(type) {
|
||||
switch(type) {
|
||||
case "SECKILL":
|
||||
uni.navigateTo({
|
||||
url: `/pages/promotion/seckill`,
|
||||
});
|
||||
break;
|
||||
case "PINTUAN":
|
||||
uni.navigateTo({
|
||||
url: `/pages/promotion/joinGroup`,
|
||||
});
|
||||
break;
|
||||
case "LIVE":
|
||||
uni.navigateTo({
|
||||
url: `/pages/promotion/lives`,
|
||||
});
|
||||
break;
|
||||
case "KANJIA":
|
||||
uni.navigateTo({
|
||||
url: `/pages/promotion/bargain/list`,
|
||||
});
|
||||
break;
|
||||
};
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
@import "./tpl.scss";
|
||||
.join-box {
|
||||
display: flex;
|
||||
}
|
||||
.join-list {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
overflow: hidden;
|
||||
}
|
||||
.join-list-item {
|
||||
flex: 1;
|
||||
}
|
||||
.ellipsis {
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
width: 108rpx; // 大于1个活动
|
||||
font-size: 22rpx;
|
||||
}
|
||||
.max-width {
|
||||
width: 316rpx !important;
|
||||
}
|
||||
.item-price {
|
||||
> span {
|
||||
font-size: 28rpx;
|
||||
font-weight: 500;
|
||||
color: #e1212b;
|
||||
}
|
||||
}
|
||||
.join-item {
|
||||
flex: 1;
|
||||
}
|
||||
.item-img {
|
||||
width: 150rpx;
|
||||
height: 150rpx;
|
||||
margin: 0 auto;
|
||||
display: block;
|
||||
}
|
||||
.item-img-box {
|
||||
position: relative;
|
||||
}
|
||||
.item-line-through {
|
||||
> span {
|
||||
font-size: 20rpx;
|
||||
font-weight: 400;
|
||||
text-decoration: line-through;
|
||||
color: #999;
|
||||
}
|
||||
}
|
||||
.item-position-tips {
|
||||
position: absolute;
|
||||
right: 0;
|
||||
color: #fff;
|
||||
font-size: 24rpx;
|
||||
bottom: 0;
|
||||
}
|
||||
.join-title {
|
||||
display: flex;
|
||||
|
||||
align-items: center;
|
||||
background: #fff;
|
||||
height: 100rpx;
|
||||
> div:nth-of-type(1) {
|
||||
font-size: 30rpx;
|
||||
font-weight: bold;
|
||||
}
|
||||
> div:nth-of-type(2) {
|
||||
font-size: 20rpx;
|
||||
line-height: 1.75;
|
||||
border-radius: 16rpx;
|
||||
text-align: center;
|
||||
padding: 0 16rpx;
|
||||
margin-left: 20rpx;
|
||||
}
|
||||
.sub {
|
||||
background-color: #e1212b;
|
||||
margin-right: 80rpx;
|
||||
}
|
||||
.sub-seckill {
|
||||
white-space: nowrap;
|
||||
padding: 0 !important;
|
||||
}
|
||||
.sub-seckill-block {
|
||||
background: rgba($main-color, 0.3);
|
||||
border-radius: 100px !important;
|
||||
color: rgba($main-color, 0.7);
|
||||
overflow: hidden;
|
||||
padding-right: 8rpx;
|
||||
}
|
||||
.sub-seckill-block-text {
|
||||
background-color: $main-color;
|
||||
color: #fff;
|
||||
border-top-right-radius: 100px;
|
||||
border-bottom-right-radius: 100px;
|
||||
padding: 0 12rpx !important;
|
||||
margin-right: 12rpx;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -4,6 +4,9 @@
|
||||
<u-icon name="search"></u-icon>
|
||||
{{ res.list[0].title }}
|
||||
</div>
|
||||
<div slot="right" open-type="contact" class="navbar-right message" @click="linkMsgDetail" style="border-style:none;background:rgb(234,234,234);" >
|
||||
<image style="width:53rpx;height:53rpx;margin-top:6rpx;" src="@/static/img/title.png"></image>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
@@ -11,6 +14,11 @@ export default {
|
||||
title:"搜索栏",
|
||||
props: ["res"],
|
||||
methods: {
|
||||
linkMsgDetail(){
|
||||
uni.navigateTo({
|
||||
url:`/pages/tabbar/home/title`
|
||||
})
|
||||
},
|
||||
handleSearch() {
|
||||
uni.navigateTo({
|
||||
url: "/pages/navigation/search/searchPage",
|
||||
@@ -34,5 +42,14 @@ export default {
|
||||
.layout {
|
||||
background: #fff;
|
||||
padding: 0 16rpx;
|
||||
position: relative;
|
||||
}
|
||||
.navbar-right{
|
||||
position: absolute;
|
||||
top: 0;
|
||||
// right: 0;
|
||||
}
|
||||
.message{
|
||||
right:40rpx;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1,24 +1,34 @@
|
||||
<template>
|
||||
<div class="layout">
|
||||
<div class="background">
|
||||
<div class="layout" :style="{textAlign: res.list[0].textAlign}" @click="modelNavigateTo(res.list[0])" >
|
||||
<div class="background" :style="{ backgroundColor: res.list[0].bk_color}">
|
||||
<div class="title" :style="{ color: res.list[0].color }">
|
||||
{{ res.list[0].title }}
|
||||
</div>
|
||||
<div style="position: absolute;right: 10px;top:2px;color: #fff;line-height: 42px;font-size: 10px">
|
||||
<a :style="{ color: res.list[0].color1 }" style="text-decoration: none">{{ res.list[0].title1 }}</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
||||
<script>
|
||||
import { modelNavigateTo } from "./tpl";
|
||||
export default {
|
||||
title: "标题栏",
|
||||
props: ["res"],
|
||||
data() {
|
||||
return {
|
||||
modelNavigateTo,
|
||||
};
|
||||
},
|
||||
mounted() {},
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
@import "./tpl.scss";
|
||||
.background {
|
||||
background: url("/static/title.png") no-repeat;
|
||||
// background: url("/static/title.png") no-repeat;
|
||||
position: absolute;
|
||||
z-index: 2;
|
||||
width: 100%;
|
||||
@@ -43,5 +53,6 @@ export default {
|
||||
line-height: 84rpx;
|
||||
font-size: 30rpx;
|
||||
font-weight: bold;
|
||||
margin-left: 8rpx;
|
||||
}
|
||||
</style>
|
||||
|
||||
182
pages/tabbar/home/title.vue
Normal file
182
pages/tabbar/home/title.vue
Normal file
@@ -0,0 +1,182 @@
|
||||
<template>
|
||||
<view>
|
||||
<view>
|
||||
<u-tabs :list="list" :is-scroll="false" :current="current" @change="change"></u-tabs>
|
||||
<u-cell-group v-if="current == 0">
|
||||
<view v-for="(item,index) in lists" :key="index">
|
||||
<u-cell-item :arrow="false" v-if="item.status =='UN_READY'" style="position: relative;"
|
||||
@click="linkMsgDetail(item)">
|
||||
<template slot="label">
|
||||
<view style="display: inline-block;
|
||||
width: 100%;
|
||||
height: auto;
|
||||
font-family: Gibson;
|
||||
font-size: 25rpx;
|
||||
word-break: break-all;
|
||||
text-overflow: ellipsis;
|
||||
word-wrap: break-word;
|
||||
|
||||
white-space: pre-wrap;">{{item.title}}
|
||||
<view style="width:400rpx;padding: 10rpx 0;">{{item.createTime}}</view>
|
||||
</view>
|
||||
</template>
|
||||
<!-- <button style="width:100rpx;height:60rpx;float:right;font-size:20rpx;line-height:60rpx;background:#000000;color:white;">未读</button> -->
|
||||
</u-cell-item>
|
||||
</view>
|
||||
|
||||
</u-cell-group>
|
||||
<u-cell-group v-if="current == 1">
|
||||
<view v-for="(item,index) in lists" :key="index">
|
||||
<u-cell-item :arrow="false" v-if="item.status == 'ALREADY_READY'" style="position: relative;"
|
||||
@click="linkMsgDetail(item)">
|
||||
<template slot="label">
|
||||
<view style="display: inline-block;
|
||||
width: 100%;
|
||||
height: auto;
|
||||
font-family: Gibson;
|
||||
font-size: 25rpx;
|
||||
word-break: break-all;
|
||||
text-overflow: ellipsis;
|
||||
word-wrap: break-word;
|
||||
|
||||
white-space: pre-wrap;">{{item.title}}
|
||||
<view style="width:400rpx;padding: 10rpx 0;">{{item.createTime}}</view>
|
||||
</view>
|
||||
</template>
|
||||
<!-- <button style="width:100rpx;height:60rpx;float:right;font-size:20rpx;line-height:60rpx;background:#F3F3FA;color:black;">已读</button> -->
|
||||
</u-cell-item>
|
||||
</view>
|
||||
</u-cell-group>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
messages,
|
||||
editMessages
|
||||
} from "@/api/message.js"
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
params: {
|
||||
pageSize: 20,
|
||||
pageNumber: 1,
|
||||
memberId: "",
|
||||
messageId: "",
|
||||
status:"UN_READY"
|
||||
},
|
||||
loadText: {
|
||||
loadmore: '轻轻上拉',
|
||||
loading: '努力加载中',
|
||||
nomore: '实在没有了'
|
||||
},
|
||||
list: [{
|
||||
name: "未读"
|
||||
}, {
|
||||
name: "已读"
|
||||
}],
|
||||
current: 0,
|
||||
lists: [],
|
||||
status: "loadmore"
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
this.getMessage()
|
||||
},
|
||||
onReachBottom() {
|
||||
this.params.pageNumber++;
|
||||
this.statuss = "loading";
|
||||
this.getMessage()
|
||||
},
|
||||
methods: {
|
||||
linkMsgDetail(v) {
|
||||
|
||||
if (v.status == 'UN_READY') {
|
||||
let params = {}
|
||||
params.messageId = v.memberId
|
||||
editMessages(v.id, params).then(res => {
|
||||
if (res.data.success) {
|
||||
console.log( this.lists)
|
||||
this.lists.forEach((item,index)=>{
|
||||
console.log(item)
|
||||
if(item.id == v.id){
|
||||
this.lists.splice(index, 1)
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// uni.navigateTo({
|
||||
// url:`/pages/tabbar/home/messageDetail?data=${encodeURIComponent(JSON.stringify(v))}`
|
||||
// })
|
||||
|
||||
|
||||
},
|
||||
/**
|
||||
* 返回
|
||||
*/
|
||||
back() {
|
||||
if (getCurrentPages().length == 1) {
|
||||
uni.switchTab({
|
||||
url: "/pages/tabbar/home/index",
|
||||
});
|
||||
} else {
|
||||
uni.navigateBack();
|
||||
}
|
||||
},
|
||||
change(e) {
|
||||
console.log(e)
|
||||
this.current = e;
|
||||
if (e == 0) {
|
||||
this.params.status = "UN_READY"
|
||||
this.params.pageNumber = 1;
|
||||
} else if (e == 1) {
|
||||
this.params.status = "ALREADY_READY"
|
||||
this.params.pageNumber = 1;
|
||||
}
|
||||
this.lists = []
|
||||
this.getMessage()
|
||||
},
|
||||
getMessage() {
|
||||
this.params.memberId = this.$options.filters.isLogin().id;
|
||||
|
||||
messages(this.params).then(res => {
|
||||
console.log(res)
|
||||
if (res.data.success) {
|
||||
if (res.data.result.records == '') {
|
||||
console.log(11111)
|
||||
this.status = "nomore"
|
||||
}
|
||||
res.data.result.records.forEach(item => {
|
||||
this.lists.push(item)
|
||||
let obj = {};
|
||||
this.lists = this.lists.reduce(
|
||||
(cur, next) => {
|
||||
//对象去重
|
||||
if (next.id != undefined) {
|
||||
obj[next.id] ?
|
||||
"" :
|
||||
(obj[next.id] = true && cur.push(next));
|
||||
}
|
||||
console.log(cur);
|
||||
return cur;
|
||||
},
|
||||
[]
|
||||
)
|
||||
})
|
||||
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
}
|
||||
</script>
|
||||
<style>
|
||||
.foot {
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
}
|
||||
</style>
|
||||
@@ -3,7 +3,12 @@
|
||||
<!-- uni 中不能使用 vue component 所以用if判断每个组件 -->
|
||||
<div v-for="(item, index) in pageData.list" :key="index">
|
||||
<!-- 搜索栏,如果在楼层装修顶部则会自动浮动,否则不浮动 -->
|
||||
<u-navbar class="navbar" v-if="item.type == 'search'" :is-back="false" :is-fixed="index ===1 ? false : true">
|
||||
<u-navbar
|
||||
class="navbar"
|
||||
v-if="item.type == 'search'"
|
||||
:is-back="false"
|
||||
:is-fixed="index === 1 ? false : true"
|
||||
>
|
||||
<search style="width: 100%" :res="item.options" />
|
||||
<!-- #ifndef H5 -->
|
||||
<!-- 扫码功能 不兼容h5 详情文档: https://uniapp.dcloud.io/api/system/barcode?id=scancode -->
|
||||
@@ -14,10 +19,22 @@
|
||||
</u-navbar>
|
||||
<carousel v-if="item.type == 'carousel'" :res="item.options" />
|
||||
<titleLayout v-if="item.type == 'title'" :res="item.options" />
|
||||
<leftOneRightTwo v-if="item.type == 'leftOneRightTwo'" :res="item.options" />
|
||||
<leftTwoRightOne v-if="item.type == 'leftTwoRightOne'" :res="item.options" />
|
||||
<topOneBottomTwo v-if="item.type == 'topOneBottomTwo'" :res="item.options" />
|
||||
<topTwoBottomOne v-if="item.type == 'topTwoBottomOne'" :res="item.options" />
|
||||
<leftOneRightTwo
|
||||
v-if="item.type == 'leftOneRightTwo'"
|
||||
:res="item.options"
|
||||
/>
|
||||
<leftTwoRightOne
|
||||
v-if="item.type == 'leftTwoRightOne'"
|
||||
:res="item.options"
|
||||
/>
|
||||
<topOneBottomTwo
|
||||
v-if="item.type == 'topOneBottomTwo'"
|
||||
:res="item.options"
|
||||
/>
|
||||
<topTwoBottomOne
|
||||
v-if="item.type == 'topTwoBottomOne'"
|
||||
:res="item.options"
|
||||
/>
|
||||
<flexThree v-if="item.type == 'flexThree'" :res="item.options" />
|
||||
<flexFive v-if="item.type == 'flexFive'" :res="item.options" />
|
||||
<flexFour v-if="item.type == 'flexFour'" :res="item.options" />
|
||||
@@ -25,16 +42,15 @@
|
||||
<textPicture v-if="item.type == 'textPicture'" :res="item.options" />
|
||||
<menuLayout v-if="item.type == 'menu'" :res="item.options" />
|
||||
<flexOne v-if="item.type == 'flexOne'" :res="item.options" />
|
||||
|
||||
<goods v-if="item.type == 'goods'" :res="item.options" />
|
||||
|
||||
<goods :enableBottomLoad="enableLoad" v-if="item.type == 'goods'" :res="item.options" />
|
||||
<group v-if="item.type == 'group'" :res="item.options" />
|
||||
<notice v-if="item.type == 'notice'" :res="item.options" />
|
||||
<promotions v-if="item.type == 'promotionDetail'" :res="item.options" />
|
||||
<!-- <joinGroup v-if="item.type == 'joinGroup'" :res="item.options" /> -->
|
||||
<!-- <integral v-if="item.type == 'integral'" :res="item.options" /> -->
|
||||
<!-- <spike v-if="item.type == 'spike'" :res="item.options" /> -->
|
||||
|
||||
</div>
|
||||
<u-no-network></u-no-network>
|
||||
<u-no-network @retry="init" @isConnected="isConnected"></u-no-network>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -60,10 +76,8 @@ import tpl_goods from "@/pages/tabbar/home/template/tpl_goods"; //商品分类
|
||||
import { getFloorData } from "@/api/home"; //获取楼层装修接口
|
||||
import permision from "@/js_sdk/wa-permission/permission.js"; //权限工具类
|
||||
import config from "@/config/config";
|
||||
// TODO 后续开发
|
||||
// import tpl_join_group from "@/pages/tabbar/home/template/tpl_join_group";
|
||||
// import tpl_integral from "@/pages/tabbar/home/template/tpl_integral";
|
||||
// import tpl_spike from "@/pages/tabbar/home/template/tpl_spike";
|
||||
import tpl_notice from "@/pages/tabbar/home/template/tpl_notice"; //标题栏模块
|
||||
import tpl_promotions from "@/pages/tabbar/home/template/tpl_promotions_detail"; //标题栏模块
|
||||
|
||||
export default {
|
||||
data() {
|
||||
@@ -71,6 +85,7 @@ export default {
|
||||
config,
|
||||
pageData: "", //楼层页面数据
|
||||
isIos: "",
|
||||
enableLoad:false, //触底加载 针对于商品模块
|
||||
};
|
||||
},
|
||||
components: {
|
||||
@@ -90,9 +105,8 @@ export default {
|
||||
flexOne: tpl_flex_one,
|
||||
goods: tpl_goods,
|
||||
group: tpl_group,
|
||||
// spike: tpl_spike,
|
||||
// joinGroup: tpl_join_group,
|
||||
// integral: tpl_integral,
|
||||
notice: tpl_notice,
|
||||
promotions: tpl_promotions,
|
||||
},
|
||||
|
||||
mounted() {
|
||||
@@ -111,10 +125,19 @@ export default {
|
||||
this.pageData = "";
|
||||
getFloorData().then((res) => {
|
||||
if (res.data.success) {
|
||||
this.pageData = JSON.parse(res.data.result.pageData);
|
||||
const result = JSON.parse(res.data.result.pageData)
|
||||
this.pageData = result;
|
||||
if(result.list.length){
|
||||
// 如果最后一个装修模块是商品模块的话 默认启用自动加载
|
||||
result.list[result.list.length-1] ? result.list[result.list.length-1].model == 'goods' ? this.enableLoad = true : '' : ''
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
// 是否有网络链接
|
||||
isConnected(val){
|
||||
val ? this.init() : ''
|
||||
},
|
||||
|
||||
/**
|
||||
* TODO 扫码功能后续还会后续增加
|
||||
@@ -129,9 +152,21 @@ export default {
|
||||
success: function (res) {
|
||||
let path = encodeURIComponent(res.result);
|
||||
|
||||
|
||||
|
||||
if(path!=undefined && path.indexOf("QR_CODE_LOGIN_SESSION")==0){
|
||||
console.log(path)
|
||||
//app扫码登录
|
||||
uni.navigateTo({
|
||||
url:"/pages/passport/scannerCodeLoginConfirm?token="+path
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// WX_CODE 为小程序码
|
||||
if (res.scanType == "WX_CODE") {
|
||||
console.log(res)
|
||||
console.log(res);
|
||||
uni.navigateTo({
|
||||
url: `/${res.path}`,
|
||||
});
|
||||
|
||||
@@ -5,9 +5,13 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import configs from "@/config/config";
|
||||
import storage from "@/utils/storage";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
configs,
|
||||
storage,
|
||||
webviewStyles: {
|
||||
progress: {
|
||||
color: this.$lightColor,
|
||||
@@ -17,7 +21,24 @@ export default {
|
||||
};
|
||||
},
|
||||
onLoad(params) {
|
||||
// params.IM ? (this.src = `${configs.imWebSrc}?token=${storage.getAccessToken()}&id=${params.IM}`): (this.src = decodeURIComponent(params.src));
|
||||
if(params.IM)
|
||||
{
|
||||
if(params.IM==0)
|
||||
{
|
||||
this.src = `${configs.imWebSrc}?token=${storage.getAccessToken()}`;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.src = `${configs.imWebSrc}?token=${storage.getAccessToken()}&id=${params.IM}`;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
this.src = decodeURIComponent(params.src);
|
||||
console.log(this.src);
|
||||
}
|
||||
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user