mirror of
https://gitee.com/beijing_hongye_huicheng/lilishop-uniapp.git
synced 2025-12-20 01:15:53 +08:00
Compare commits
162 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
63fee6f272 | ||
|
|
9ab1cec1bb | ||
|
|
7c2a50eec0 | ||
|
|
82810eb179 | ||
|
|
53917d32c0 | ||
|
|
f324fbe71d | ||
|
|
c6afd889ef | ||
|
|
116ba65bda | ||
|
|
02812a9128 | ||
|
|
fcc99b61e8 | ||
|
|
c9a3c72c10 | ||
|
|
abc9c59e29 | ||
|
|
9ed897aa85 | ||
|
|
5a84f2192f | ||
|
|
9ac9cd480b | ||
|
|
b635f91e9f | ||
|
|
99079f0b3d | ||
|
|
317c2171e4 | ||
|
|
cba7ae98fa | ||
|
|
e6dcb5cd3a | ||
|
|
94f1da349a | ||
|
|
06b5a9d7f1 | ||
|
|
48bebc0503 | ||
|
|
af1897f4ea | ||
|
|
8238211f33 | ||
|
|
907f51b13a | ||
|
|
3b036a7cb7 | ||
|
|
9a0cb35637 | ||
|
|
1c938e0007 | ||
|
|
f31ff79a39 | ||
|
|
d5ea5a4fa9 | ||
|
|
c7237e561c | ||
|
|
6717721725 | ||
|
|
5e5d5b904b | ||
|
|
a353022d36 | ||
|
|
ca4e458db1 | ||
|
|
7b8e954555 | ||
|
|
b4f46ded2b | ||
|
|
274a03fe73 | ||
|
|
0a07ebfe8b | ||
|
|
39c82361b6 | ||
|
|
89f4e051ca | ||
|
|
c04ae5eb39 | ||
|
|
ec692e1134 | ||
|
|
02a1f7ee83 | ||
|
|
97aa989e0b | ||
|
|
ac67c16378 | ||
|
|
2bdb8682e1 | ||
|
|
c070ed01f7 | ||
|
|
af4cfe7fba | ||
|
|
6a8e666fb8 | ||
|
|
c097a423f9 | ||
|
|
f0dcf473e8 | ||
|
|
bdff6a3c93 | ||
|
|
74829c966d | ||
|
|
77db8df123 | ||
|
|
a403a7d432 | ||
|
|
951d2d7f30 | ||
|
|
e8ddc53188 | ||
|
|
0708226890 | ||
|
|
b0447eec3a | ||
|
|
e37a8ec41d | ||
|
|
467b7a0cba | ||
|
|
9a583e75f3 | ||
|
|
f9ae51606f | ||
|
|
e768a4c1db | ||
|
|
a77390bf5c | ||
|
|
1e41801612 | ||
|
|
d870ee409a | ||
|
|
b2a448447c | ||
|
|
38a00e6177 | ||
|
|
767ad94565 | ||
|
|
7499682883 | ||
|
|
9192f32bbb | ||
|
|
d256fd3559 | ||
|
|
5844e74d32 | ||
|
|
989a567ecb | ||
|
|
d5d47ffae5 | ||
|
|
8001622be2 | ||
|
|
fc5a6a6f7f | ||
|
|
dc15439861 | ||
|
|
c9c0d2d171 | ||
|
|
44cf46fed3 | ||
|
|
63ebf1a7c5 | ||
|
|
bc10d774a7 | ||
|
|
90f656beab | ||
|
|
66c729b539 | ||
|
|
db4dfd3edc | ||
|
|
e7879aac65 | ||
|
|
723570b392 | ||
|
|
5dc562396c | ||
|
|
b266aad634 | ||
|
|
a25c75bf7a | ||
|
|
43fc159e27 | ||
|
|
2e37cb8158 | ||
|
|
529175c0ab | ||
|
|
071599074c | ||
|
|
d420c128eb | ||
|
|
b33fd7e2b3 | ||
|
|
815118d496 | ||
|
|
83031507b9 | ||
|
|
7565086291 | ||
|
|
7c71375b6c | ||
|
|
c919b1463c | ||
|
|
b72d831df9 | ||
|
|
2c494ac0d1 | ||
|
|
83b2295818 | ||
|
|
11a831299a | ||
|
|
bbe315fb45 | ||
|
|
9c03205c9f | ||
|
|
12a4e15c13 | ||
|
|
0843e457b0 | ||
|
|
b1bde2f105 | ||
|
|
d2ff0b1ea1 | ||
|
|
7ff13babaa | ||
|
|
0da7dc6796 | ||
|
|
f84f9ab696 | ||
|
|
8b5f7def93 | ||
|
|
8c33b899bf | ||
|
|
8767ad6d3f | ||
|
|
f797538935 | ||
|
|
cfb4310d6f | ||
|
|
d59cd74bf0 | ||
|
|
c378ce7d71 | ||
|
|
9cc6f519a9 | ||
|
|
18251dde89 | ||
|
|
04bf707836 | ||
|
|
5e38247ce8 | ||
|
|
979a1e6b14 | ||
|
|
9127d61a59 | ||
|
|
fed76499a0 | ||
|
|
6843feebfa | ||
|
|
e650ee66ff | ||
|
|
fa6f571f61 | ||
|
|
09b7ece510 | ||
|
|
b30caf051c | ||
|
|
861bf1eb07 | ||
|
|
a0f1417f42 | ||
|
|
2b5f57dfab | ||
|
|
22a5f15201 | ||
|
|
6baf1534c1 | ||
|
|
df3ce9eda7 | ||
|
|
7f71614781 | ||
|
|
8c5b703c47 | ||
|
|
394cda3efd | ||
|
|
7b9b5c2819 | ||
|
|
4625c087d5 | ||
|
|
f7c3c56b53 | ||
|
|
0aa9831a62 | ||
|
|
ea32948b84 | ||
|
|
0feaf55381 | ||
|
|
eaa04e395b | ||
|
|
0f8d53b09a | ||
|
|
031aa0f173 | ||
|
|
5f5b571899 | ||
|
|
b6f041f68c | ||
|
|
558a3228be | ||
|
|
2e4bedae31 | ||
|
|
e2905e8fdd | ||
|
|
ddee1fca8e | ||
|
|
d2b13e146e | ||
|
|
9b3704a141 |
2
.gitignore
vendored
2
.gitignore
vendored
@@ -9,3 +9,5 @@ node_modules/
|
|||||||
.vscode/
|
.vscode/
|
||||||
/unpackage/
|
/unpackage/
|
||||||
.hbuilderx/launch.json
|
.hbuilderx/launch.json
|
||||||
|
.project.config.json
|
||||||
|
.project.private.config.json
|
||||||
|
|||||||
314
README.md
314
README.md
@@ -1,171 +1,211 @@
|
|||||||
## Lilishop B2B2C商城系统
|
## Lilishop B2B2C 商城系统
|
||||||
|
|
||||||
#### 欢迎交流需求,交流业务,交流技术(基础问题自行解决,其他问题先看文档后提问)
|
|
||||||
|
|
||||||
|
|
||||||
##### 交流 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(已满)
|
|
||||||
|
|
||||||
<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 体验,扫描二维码
|
|
||||||
|
|
||||||

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

|
|
||||||
|
|
||||||
|
|
||||||
### 商城介绍
|
### 商城介绍
|
||||||
|
|
||||||
**官网**:https://pickmall.cn
|
**官网**:https://pickmall.cn
|
||||||
|
|
||||||
Lilishop商城系统支持商家入驻,后端基于SpringBoot 研发,前端使用 Vue、uniapp开发, **系统全端全部代码开源**
|
**更多 README**:https://gitee.com/beijing_hongye_huicheng/lilishop/blob/master/README.md
|
||||||
|
|
||||||
前后端分离,支持分布式部署,支持Docker,各个API独立,并且有独立的消费者。
|
**演示站点**:https://m-b2b2c.pickmall.cn/ 账号:13011111111 验证码:111111
|
||||||
|
|
||||||
### 商城 API/消费者 聚合版
|
|
||||||
api不需要单独部署,只需启动一个jar包就可以正常运转 如有需要,可以点击跳转
|
|
||||||
https://gitee.com/beijing_hongye_huicheng/lilishop-simplify
|
|
||||||
|
|
||||||
### 开发/使用/常见问题 帮助文档
|
|
||||||
|
|
||||||
https://docs.pickmall.cn
|
|
||||||
|
|
||||||
### 项目地址
|
|
||||||
|
|
||||||
gitee : https://gitee.com/beijing_hongye_huicheng
|
|
||||||
|
|
||||||
github 镜像: https://github.com/lilishop?tab=repositories
|
|
||||||
|
|
||||||
商城UI 项目下3个文件夹
|
|
||||||
buyer:买家PC端,seller:商家端,manager:后台管理端
|
|
||||||
|
|
||||||
|
|
||||||
### 演示地址
|
|
||||||
PS:手机验证码为 ‘111111’
|
|
||||||
|
|
||||||
**平台管理端**:https://admin-b2b2c.pickmall.cn 账号:admin/123456
|
|
||||||
|
|
||||||
**店铺管理端**:https://store-b2b2c.pickmall.cn 账号:13011111111/111111
|
|
||||||
|
|
||||||
**商城PC页面**:https://pc-b2b2c.pickmall.cn
|
|
||||||
|
|
||||||
**商城 小程序/公众号/APP**:扫描二维码
|
**商城 小程序/公众号/APP**:扫描二维码
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
### 快速本地部署
|
### 快速开始
|
||||||
|
|
||||||
[点击跳转](https://docs.pickmall.cn/deploy/%E8%BF%90%E8%A1%8C%E7%8E%AF%E5%A2%83%E5%87%86%E5%A4%87.html)
|
#### 阅读文档
|
||||||
|
|
||||||
**商城数据库**
|
`uni-app` https://uniapp.dcloud.net.cn/api/
|
||||||
使用docker-compose部署数据库,自动初始化数据库,不需要手动下载等操作
|
|
||||||
|
|
||||||
如果手动部署,才需要获取sql [点击跳转](https://gitee.com/beijing_hongye_huicheng/docker/tree/master/init/mysql) (PS:这里有与tag版本一致的sql,如果是历史版本,则docker项目也切换至历史版本获取sql即可,历史版本升级则根据java相聚的根目录DB目录下的升级sql,按需执行)。
|
`vue2` https://v2.cn.vuejs.org/
|
||||||
|
|
||||||
|
`uView v1` https://v1.uviewui.com/
|
||||||
|
|
||||||
|
#### 环境
|
||||||
|
|
||||||
### 功能列表
|
在开发之前保证本地安装了以下软件
|
||||||
|
`hbulider` https://www.dcloud.io/hbuilderx.html
|
||||||
|
|
||||||
|
### 技术栈
|
||||||
|
|
||||||
|
本项目技术栈为 `uni-app` + `scss` + `ES2015` + `uView` 提前学习和了解这些知识将帮助你更好地上手我们的项目。
|
||||||
|
|
||||||
#### 平台管理端功能
|
### 安装
|
||||||
|
|
||||||

|
1. 克隆项目到本地
|
||||||
|
|
||||||
|
```shell
|
||||||
|
git clone https://gitee.com/beijing_hongye_huicheng/lilishop-uniapp.git
|
||||||
#### 卖家功能
|
|
||||||
|
|
||||||

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

|
|
||||||
|
|
||||||
|
|
||||||
### 技术选型
|
|
||||||
|
|
||||||
#### 架构图
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
##### 后台技术选型
|
|
||||||
|
|
||||||
| 说明 | 框架 | 说明 | |
|
|
||||||
| -------------- | --------------- | -------------- | ------------- |
|
|
||||||
| 基础框架 | Spring Boot | MVC框架 | Spring MVC |
|
|
||||||
| 持久框架 | Mybatis-Plus | 程序构建 | Maven |
|
|
||||||
| 关系型数据库 | MySQL | 消息中间件AMQP | RocketMQ |
|
|
||||||
| 缓存 | Redis +MongoDB | 搜索引擎 | Elasticsearch |
|
|
||||||
| 安全框架 | Spring Security | 数据库连接池 | Druid |
|
|
||||||
| 数据库分库分表 | sharding | 定时任务 | xxl-job |
|
|
||||||
| 负载均衡 | Nginx | 静态资源 | 阿里云OSS |
|
|
||||||
| 短信 | 阿里云短信 | 认证 | JWT |
|
|
||||||
| 日志处理 | Log4j | 接口规范 | RESTful |
|
|
||||||
|
|
||||||
##### 前端-运营后台、店铺后台
|
|
||||||
|
|
||||||
| 说明 | 框架 | 说明 | 框架 |
|
|
||||||
| ---------- | ---------- | ---------- | ------- |
|
|
||||||
| 构建工具 | webpack | JS版本 | ES6 |
|
|
||||||
| 基础JS框架 | Vue.js | 视频播放器 | Dplayer |
|
|
||||||
| 路由管理 | Vue Router | 状态管理 | Vuex |
|
|
||||||
| 基础UI库 | iView | UI界面基于 | iView |
|
|
||||||
| 网络请求 | axios | | |
|
|
||||||
|
|
||||||
##### 前端-移动端
|
|
||||||
|
|
||||||
| 说明 | 架构 | 说明 | 架构 |
|
|
||||||
| --------- | ------- | -------- | ------- |
|
|
||||||
| 基础UI库 | uViewui | 基础框架 | uni-app |
|
|
||||||
| CSS预处理 | scss | 地图引擎 | amap |
|
|
||||||
|
|
||||||
### 版本升级
|
|
||||||
|
|
||||||
```
|
|
||||||
系统后续会提供多场景解决方案。
|
|
||||||
更多架构:微服务、Saas、中台等,都会支持。 支持差价升级商业授权
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### 商业授权
|
2. 从`hbulider`中打开项目
|
||||||
商业版本与开源版本代码一致,没有区分
|
|
||||||
|
|
||||||
商业使用需要授权,授权方式可选择联系官网客服,或者qq群联系群主。
|
```shell
|
||||||
|
直接将项目拖进hbulider中点击运行即可
|
||||||
|
```
|
||||||
|
|
||||||
商业授权模式为永久授权,支持永久升级。
|
### 目录结构
|
||||||
|
|
||||||
商业案例由于涉及部分多层二开关系,如需了解可以咨询销售。
|
```
|
||||||
|
├── api // 接口
|
||||||
|
├── components // 组件
|
||||||
|
├── config // 配置文件
|
||||||
|
├── CustomStartPage // 打包配置的开屏页
|
||||||
|
├── CustomStoryboard // ios自定义storyboard启动页
|
||||||
|
├── hybrid // 广告配置页
|
||||||
|
├── js_sdk // 封装的js_sdk
|
||||||
|
├── lib // 封装的部分方法
|
||||||
|
├── pages // 页面
|
||||||
|
├── plugins // 插件
|
||||||
|
├── static // 静态资源
|
||||||
|
├── store // vuex
|
||||||
|
├── utils // 工具类
|
||||||
|
├── uview-ui // uview
|
||||||
|
├── App.vue // 入口页面
|
||||||
|
├── main.js // 入口文件
|
||||||
|
├── manifest.json // hbulider配置文件
|
||||||
|
├── pages.json // 路由配置文件
|
||||||
|
├── uni.scss // 全局样式
|
||||||
|
└── vue.config.js // vue配置文件
|
||||||
|
```
|
||||||
|
|
||||||
|
### 运行
|
||||||
|
|
||||||
### 开源须知
|
#### 运行在 h5
|
||||||
1.仅允许用于个人学习研究使用.
|
|
||||||
|
|
||||||
2.禁止将本开源的代码和资源进行任何形式任何名义的出售.
|
在`hbulider`中点击`运行`->`运行到浏览器`->`选择自己的浏览器九号`
|
||||||
|
|
||||||
3.软件受国家计算机软件著作权保护(登记号:2021SR0805085)。
|
#### 运行在微信小程序
|
||||||
|
|
||||||
4.限制商用,如果需要商业使用请联系我们。QQ3409056806.或者加入qq群联系群主。
|
1.需要保证本地要有`微信开发者工具` https://developers.weixin.qq.com/miniprogram/dev/devtools/download.html
|
||||||
|
|
||||||
|
2.在`hbulider`中点击`运行`->`运行到小程序模拟器`->`微信开发者工具` 运行的时候需要配置小程序的`appid`,配置完成后即可运行
|
||||||
|
|
||||||
|
#### 运行 APP
|
||||||
|
|
||||||
|
##### 运行在安卓
|
||||||
|
|
||||||
|
在`hbulider`中点击`运行`->`运行到手机或模拟器`->`选择运行到安卓APP基座`
|
||||||
|
|
||||||
|
##### 运行在 IOS
|
||||||
|
|
||||||
|
在`hbulider`中点击`运行`->`运行到手机或模拟器`->`选择运行到IOS基座`
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
### 交流群
|
|
||||||
|
|
||||||
##### 官方qq 1群 961316482(已满)
|
### 项目配置/开发
|
||||||
##### 官方qq 2群 875294241(已满)
|
|
||||||
##### 官网qq 3群 263785057
|
#### config配置
|
||||||
|
在根目录`config`下的`config`设置中配置了一些默认的配置,可以根据自己的需求进行修改
|
||||||
|
|
||||||
|
```
|
||||||
|
const name = "lilishop"; //全局商城name
|
||||||
|
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: "", //小程序唯一凭证,即 AppID,可在「微信公众平台 - 设置 - 开发设置」页中获得。(需要已经成为开发者,且帐号没有异常状态)
|
||||||
|
aMapKey: "", //在高德中申请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", //客服邮箱
|
||||||
|
imWebSrc: "https://im.pickmall.cn", //IM地址
|
||||||
|
baseWsUrl: "wss://im-api.pickmall.cn/lili/webSocket", // IM WS 地址
|
||||||
|
enableGetClipboard: false, //是否启用粘贴板获取 scanAuthNavigation 中的链接,如果匹配则会跳转到对应页面
|
||||||
|
enableMiniBarStartUpApp: true, //是否在h5中右侧浮空按钮点击启动app
|
||||||
|
/**
|
||||||
|
* 如需更换主题请修改此处以及uni.scss中的全局颜色
|
||||||
|
*/
|
||||||
|
mainColor: "#ff3c2a", // 主题色
|
||||||
|
lightColor: "#ff6b35", // 高亮主题色
|
||||||
|
aiderLightColor: "#ff9f28", // 辅助高亮颜色
|
||||||
|
defaultUserPhoto: "/static/missing-face.png", // 默认用户头像
|
||||||
|
enableFetchMobileLogin: false // 是否启用获取手机号登录 如果微信小程序提示封禁手机号获取权限 可将此选项设置成false作为备用登录方案
|
||||||
|
};
|
||||||
|
|
||||||
|
```
|
||||||
|
#### 组件
|
||||||
|
在根目录`components`下的`components`设置中配置了一些默认的组件,可以根据自己的需求进行修改或阅读组件详情代码以及README.md文档
|
||||||
|
|
||||||
|
#### 页面
|
||||||
|
在`pages`文件夹写入或修改页面代码,在`pages.json`中去配置页面路由,具体配置可以参考`pages.json` 或参考uni-app的文档
|
||||||
|
|
||||||
|
在微信小程序中默认启用分包操作,如果需要在微信小程序中使用分包,需要在`pages.json`中配置分包路径,具体配置可以参考`pages.json` 或参考uni-app的文档
|
||||||
|
|
||||||
|
#### 主题
|
||||||
|
1.现在`config`中设置主题色
|
||||||
|
|
||||||
|
2.在`uni.scss`中设置全局颜色
|
||||||
|
|
||||||
|
3.替换项目中一些icon以及图片的颜色
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### 常见问题
|
||||||
|
|
||||||
|
#### 微信小程序移动端启动报错
|
||||||
|
|
||||||
|
小程序直播插件报错,在`manifest`中删除代码。
|
||||||
|

|
||||||
|
|
||||||
|
#### 微信小程序上传文件过大超出 2MB
|
||||||
|
|
||||||
|
1.关闭微信小程序,停止微信小程序运行
|
||||||
|
|
||||||
|
2.重新点击运行小程序模拟器,在最下方有一个 `运行时是否压缩代码` 勾选并重新运行
|
||||||
|
|
||||||
|
3.如果还是提示超出2MB,重新执行1步骤,然后点击`发行`->`小程序`即可
|
||||||
|
|
||||||
|
4.以上1-3步骤都不行,可以尝试删除一些自己开发的代码或本地的静态资源图片
|
||||||
|
|
||||||
|
#### 微信小程序在开发者工具中可以使用接口在测试版却不行
|
||||||
|
1.首先保证是否填写`request`合法域名 在微信小程序后台配置
|
||||||
|
|
||||||
|
2.需保证接口为https请求
|
||||||
|
|
||||||
|
request合法域名基础配置如下
|
||||||
|
```
|
||||||
|
https://buyer-api.pickmall.cn
|
||||||
|
https://common-api.pickmall.cn
|
||||||
|
https://im-api.pickmall.cn
|
||||||
|
https://restapi.amap.com
|
||||||
|
```
|
||||||
|
|
||||||
|
socket合法域名
|
||||||
|
```
|
||||||
|
wss://im-api.pickmall.cn
|
||||||
|
```
|
||||||
|
uploadFile合法域名
|
||||||
|
```
|
||||||
|
https://common-api.pickmall.cn
|
||||||
|
```
|
||||||
|
downloadFile合法域名
|
||||||
|
```
|
||||||
|
https://buyer-api.pickmall.cn
|
||||||
|
https://common-api.pickmall.cn
|
||||||
|
https://im-api.pickmall.cn
|
||||||
|
https://lilishop-oss.oss-cn-beijing.aliyuncs.com
|
||||||
|
```
|
||||||
|
|
||||||
|
#### 如何配置API
|
||||||
|
在根目录 `config` -> `api` 中配置开发环境以及生产环境 api 接口地址
|
||||||
|
|
||||||
|
#### 运行报错
|
||||||
|
初次运行时候可能因为本地环境缺少编译插件,这个时候一定要注意看报错信息,根据报错信息安装相应的插件即可
|
||||||
|
|
||||||
|
#### 如何配置微信小程序appid
|
||||||
|
在根目录 `manifest.json` 中配置微信小程序appid
|
||||||
|
|
||||||
|
|
||||||
|
#### 微信登录报错
|
||||||
|
需检查appId是否配置正确,在后台管理中信任登录的`appId`以及`appSecret`是否配置正确
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -28,3 +28,16 @@ export function getArticleDetail(type) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取文章详情
|
||||||
|
* @param type
|
||||||
|
*/
|
||||||
|
export function getArticleDetailByType(type) {
|
||||||
|
return http.request({
|
||||||
|
url: `/other/article/type/${type}`,
|
||||||
|
method: Method.GET,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ export function webConnect(code) {
|
|||||||
export function openIdLogin(params, clientType) {
|
export function openIdLogin(params, clientType) {
|
||||||
return http.request({
|
return http.request({
|
||||||
url: `passport/connect/connect/app/login`,
|
url: `passport/connect/connect/app/login`,
|
||||||
method: Method.GET,
|
method: Method.POST,
|
||||||
needToken: true,
|
needToken: true,
|
||||||
data: params,
|
data: params,
|
||||||
header: {
|
header: {
|
||||||
|
|||||||
41
api/entry.js
Normal file
41
api/entry.js
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
/**
|
||||||
|
* 入驻类相关api
|
||||||
|
*/
|
||||||
|
|
||||||
|
import { http, Method } from "@/utils/request.js";
|
||||||
|
|
||||||
|
// 获取当前用户的代理入驻详情
|
||||||
|
export function getCompanyDetail(params) {
|
||||||
|
return http.request({
|
||||||
|
url: "/store/store/apply",
|
||||||
|
method: Method.GET,
|
||||||
|
params,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 申请店铺第一步-填写企业信息
|
||||||
|
export function applyFirst(params) {
|
||||||
|
return http.request({
|
||||||
|
url: "/store/store/apply/first",
|
||||||
|
method: Method.PUT,
|
||||||
|
params,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 申请店铺第二步-填写银行
|
||||||
|
export function applySecond(params) {
|
||||||
|
return http.request({
|
||||||
|
url: "/store/store/apply/second",
|
||||||
|
method: Method.PUT,
|
||||||
|
params,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 申请店铺第三步-填写银行
|
||||||
|
export function applyThird(params) {
|
||||||
|
return http.request({
|
||||||
|
url: "/store/store/apply/third",
|
||||||
|
method: Method.PUT,
|
||||||
|
params,
|
||||||
|
});
|
||||||
|
}
|
||||||
14
api/home.js
14
api/home.js
@@ -59,10 +59,22 @@ export function getHotKeywords(count) {
|
|||||||
* @param client_type
|
* @param client_type
|
||||||
* @param page_type
|
* @param page_type
|
||||||
*/
|
*/
|
||||||
export function getFloorData() {
|
export function getFloorData(params) {
|
||||||
return http.request({
|
return http.request({
|
||||||
url: `/other/pageData/getIndex?clientType=H5`,
|
url: `/other/pageData/getIndex?clientType=H5`,
|
||||||
method: "get",
|
method: "get",
|
||||||
|
params
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取店铺楼层数据
|
||||||
|
*/
|
||||||
|
export function getFloorStoreData(params) {
|
||||||
|
return http.request({
|
||||||
|
url: `/other/pageData?pageClientType=H5`,
|
||||||
|
method: "get",
|
||||||
|
params
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
82
api/im.js
Normal file
82
api/im.js
Normal file
@@ -0,0 +1,82 @@
|
|||||||
|
import { http,Method } from "@/utils/request.js";
|
||||||
|
|
||||||
|
import api from "@/config/api.js";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取聊天详情接口
|
||||||
|
* @param {*} talkId
|
||||||
|
* @returns
|
||||||
|
*/
|
||||||
|
export function getTalk(talkId) {
|
||||||
|
return http.request({
|
||||||
|
url: `${api.im}/talk/${talkId}`,
|
||||||
|
method: Method.GET,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取与用户的聊天详情
|
||||||
|
* @param {*} talkId
|
||||||
|
* @returns
|
||||||
|
*/
|
||||||
|
export function getTalkByUser(userId) {
|
||||||
|
return http.request({
|
||||||
|
url: `${api.im}/talk/by/user/${userId}`,
|
||||||
|
method: Method.GET,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取聊天列表
|
||||||
|
* @param {*} talkId
|
||||||
|
* @returns
|
||||||
|
*/
|
||||||
|
export function getTalkList(params) {
|
||||||
|
return http.request({
|
||||||
|
url: `${api.im}/talk/list`,
|
||||||
|
method: Method.GET,
|
||||||
|
params
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取聊天信息接口
|
||||||
|
* @param {*} params
|
||||||
|
* @returns
|
||||||
|
*/
|
||||||
|
export function getTalkMessage(params) {
|
||||||
|
return http.request({
|
||||||
|
url: `${api.im}/message`,
|
||||||
|
method: Method.GET,
|
||||||
|
params
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取聊天信息接口
|
||||||
|
* @param {*} params
|
||||||
|
* @returns
|
||||||
|
*/
|
||||||
|
export function cleanUnreadMessage(params) {
|
||||||
|
return http.request({
|
||||||
|
url: `${api.im}/message/clean/unred`,
|
||||||
|
method: Method.PUT,
|
||||||
|
params
|
||||||
|
});
|
||||||
|
}
|
||||||
|
// 从商品页点击 客服 跳转 获取商品详情
|
||||||
|
export function jumpObtain(skuId, goodsId) {
|
||||||
|
return http.request({
|
||||||
|
url: `/goods/goods/sku/${goodsId}/${skuId}`,
|
||||||
|
method: Method.GET,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
// 清除未读
|
||||||
|
// /im/message/clean/unred
|
||||||
|
export function clearmeaager() {
|
||||||
|
return http.request({
|
||||||
|
url: `${api.im}/message/clean/unred`,
|
||||||
|
method: Method.PUT,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
13
api/login.js
13
api/login.js
@@ -14,18 +14,29 @@ export function resetByMobile(params) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//获取自动发券
|
||||||
|
export function getAutoCoup(){
|
||||||
|
return http.request({
|
||||||
|
url:`/promotion/coupon/activity`,
|
||||||
|
method:"GET",
|
||||||
|
needToken: true,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 账号密码登陆
|
* 账号密码登陆
|
||||||
* @params password
|
* @params password
|
||||||
* @params username
|
* @params username
|
||||||
*/
|
*/
|
||||||
export function userLogin(params){
|
export function userLogin(params, clientType){
|
||||||
return http.request({
|
return http.request({
|
||||||
method: "POST",
|
method: "POST",
|
||||||
url:`/passport/member/userLogin`,
|
url:`/passport/member/userLogin`,
|
||||||
data: params,
|
data: params,
|
||||||
header: {
|
header: {
|
||||||
"content-type": "application/x-www-form-urlencoded",
|
"content-type": "application/x-www-form-urlencoded",
|
||||||
|
clientType: clientType,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -202,6 +202,22 @@ export function getGoodsCollection(params, type) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取商品收藏
|
||||||
|
* @param params
|
||||||
|
* @returns {AxiosPromise}
|
||||||
|
*/
|
||||||
|
export function getStoreCollection(params, type) {
|
||||||
|
return http.request({
|
||||||
|
url: `/member/storeCollection/${type}`,
|
||||||
|
method: Method.GET,
|
||||||
|
needToken: true,
|
||||||
|
loading: false,
|
||||||
|
message: false,
|
||||||
|
params,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 收藏商品
|
* 收藏商品
|
||||||
* @returns {AxiosPromise}
|
* @returns {AxiosPromise}
|
||||||
@@ -236,7 +252,7 @@ export function deleteGoodsCollection(ids) {
|
|||||||
*/
|
*/
|
||||||
export function deleteStoreCollection(store_id) {
|
export function deleteStoreCollection(store_id) {
|
||||||
return http.request({
|
return http.request({
|
||||||
url: `/member/collection/delete/STORE/${store_id}`,
|
url: `/member/storeCollection/delete/STORE/${store_id}`,
|
||||||
method: Method.DELETE,
|
method: Method.DELETE,
|
||||||
needToken: true,
|
needToken: true,
|
||||||
});
|
});
|
||||||
@@ -255,6 +271,19 @@ export function getGoodsIsCollect(type, good_id) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取商品是否被收藏
|
||||||
|
* @param good_id
|
||||||
|
*/
|
||||||
|
export function getStoreIsCollect(type, store_id) {
|
||||||
|
return http.request({
|
||||||
|
url: `/member/storeCollection/isCollection/${type}/${store_id}`,
|
||||||
|
method: Method.GET,
|
||||||
|
needToken: true,
|
||||||
|
loading: false,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 收藏店铺
|
* 收藏店铺
|
||||||
* @param store_id 店铺ID
|
* @param store_id 店铺ID
|
||||||
@@ -262,10 +291,9 @@ export function getGoodsIsCollect(type, good_id) {
|
|||||||
*/
|
*/
|
||||||
export function collectionStore(store_id) {
|
export function collectionStore(store_id) {
|
||||||
return http.request({
|
return http.request({
|
||||||
url: "members/collection/store",
|
url: `/member/storeCollection/add/STORE/${store_id}`,
|
||||||
header: { "content-type": "application/x-www-form-urlencoded" },
|
|
||||||
method: Method.POST,
|
method: Method.POST,
|
||||||
data: { store_id },
|
needToken: true,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -419,3 +447,16 @@ export function getMemberPointSum() {
|
|||||||
method: Method.GET,
|
method: Method.GET,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取会员积分VO
|
||||||
|
* @param
|
||||||
|
*/
|
||||||
|
export function withdrawalSettingVO() {
|
||||||
|
return http.request({
|
||||||
|
url: `/wallet/wallet/withdrawalSettingVO`,
|
||||||
|
method: Method.GET,
|
||||||
|
needToken: true,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
14
api/store.js
14
api/store.js
@@ -13,7 +13,7 @@ import {http, Method} from '@/utils/request.js';
|
|||||||
*/
|
*/
|
||||||
export function getStoreList(params) {
|
export function getStoreList(params) {
|
||||||
return http.request({
|
return http.request({
|
||||||
url: '/store',
|
url: '/store/store',
|
||||||
method: Method.GET,
|
method: Method.GET,
|
||||||
params,
|
params,
|
||||||
});
|
});
|
||||||
@@ -55,5 +55,17 @@ export function getStoreList(params) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取自提点信息
|
||||||
|
* @param id
|
||||||
|
*/
|
||||||
|
export function getStoreAddress(storeId,params) {
|
||||||
|
return http.request({
|
||||||
|
url: `/store/address/page/${storeId}`,
|
||||||
|
method: Method.GET,
|
||||||
|
params
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
38
api/trade.js
38
api/trade.js
@@ -155,6 +155,18 @@ export function setAddressId(addressId,way) {
|
|||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* 设置收货地址ID
|
||||||
|
* @param addressId
|
||||||
|
*/
|
||||||
|
export function setStoreAddressId(storeAddressId,way) {
|
||||||
|
return http.request({
|
||||||
|
url: `/trade/carts/storeAddress?storeAddressId=${storeAddressId}&way=${way}`,
|
||||||
|
method: Method.GET,
|
||||||
|
needToken: true,
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -281,3 +293,29 @@ export function reBuy(sn) {
|
|||||||
needToken: true,
|
needToken: true,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取全部配送方式
|
||||||
|
*/
|
||||||
|
export function shippingMethodList(params) {
|
||||||
|
return http.request({
|
||||||
|
url: `/trade/carts/shippingMethodList`,
|
||||||
|
method: Method.GET,
|
||||||
|
needToken: true,
|
||||||
|
params: params,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 提交配送方式
|
||||||
|
* @param params
|
||||||
|
*/
|
||||||
|
export function setShipMethod(params) {
|
||||||
|
return http.request({
|
||||||
|
url: "/trade/carts/shippingMethod",
|
||||||
|
method: Method.PUT,
|
||||||
|
needToken: true,
|
||||||
|
params,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,63 +1,47 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="wrapper">
|
<div class="wrapper">
|
||||||
<u-popup class="popup" v-model="buyMask" :height="setup.height" closeable :mode="setup.mode"
|
<u-popup class="popup" v-model="buyMask" :height="setup.height" closeable :mode="setup.mode" :border-radius="setup.radius" @close="closeMask()">
|
||||||
:border-radius="setup.radius" @close="closeMask()">
|
|
||||||
<!-- 商品 -->
|
<!-- 商品 -->
|
||||||
<view class="goods-box bottom">
|
<view class="goods-box bottom">
|
||||||
<view class="goods-header">
|
<view class="goods-header">
|
||||||
<view class="goods-img">
|
<view class="goods-img">
|
||||||
<u-image width="200rpx" border-radius="20" class="uimage" height="200rpx"
|
<u-image width="200rpx" border-radius="20" class="uimage" height="200rpx" :src="selectedSpecImg ? selectedSpecImg : goodsDetail.thumbnail"></u-image>
|
||||||
:src="selectedSpecImg ? selectedSpecImg : goodsDetail.thumbnail"></u-image>
|
|
||||||
</view>
|
</view>
|
||||||
<view class="goods-skus">
|
<view class="goods-skus">
|
||||||
<!-- 有活动商品价格 -->
|
<!-- 有活动商品价格 -->
|
||||||
<view class="goods-price"
|
<view class="goods-price" v-if="goodsDetail.promotionPrice && ((isGroup && buyType === 'PINTUAN') || !isGroup)">
|
||||||
v-if="goodsDetail.promotionPrice && ((isGroup && buyType === 'PINTUAN') || !isGroup)">
|
|
||||||
<span v-if="goodsDetail.promotionPrice && !pointDetail">
|
<span v-if="goodsDetail.promotionPrice && !pointDetail">
|
||||||
¥
|
¥
|
||||||
<span class="goods-price-promotionShow goods-price-bigshow">{{
|
<span class="goods-price-promotionShow goods-price-bigshow">{{ $options.filters.goodsFormatPrice(goodsDetail.promotionPrice)[0] }}</span>
|
||||||
$options.filters.goodsFormatPrice(goodsDetail.promotionPrice)[0]
|
|
||||||
}}</span>
|
|
||||||
.{{ $options.filters.goodsFormatPrice(goodsDetail.promotionPrice)[1] }}
|
.{{ $options.filters.goodsFormatPrice(goodsDetail.promotionPrice)[1] }}
|
||||||
</span>
|
</span>
|
||||||
<span v-if="pointDetail.points">
|
<span v-if="pointDetail.points">
|
||||||
<span class="goods-price-promotionShow goods-price-bigshow">{{
|
<span class="goods-price-promotionShow goods-price-bigshow">{{ pointDetail.points }}</span>
|
||||||
pointDetail.points
|
|
||||||
}}</span>
|
|
||||||
积分
|
积分
|
||||||
</span>
|
</span>
|
||||||
<div class="promotion-box">
|
<div class="promotion-box">
|
||||||
¥
|
¥
|
||||||
<span class="goods-price-bigshow">{{
|
<span class="goods-price-bigshow">{{ $options.filters.goodsFormatPrice(goodsDetail.price)[0] }}</span>
|
||||||
$options.filters.goodsFormatPrice(goodsDetail.price)[0]
|
|
||||||
}}</span>
|
|
||||||
.{{ $options.filters.goodsFormatPrice(goodsDetail.price)[1] }}
|
.{{ $options.filters.goodsFormatPrice(goodsDetail.price)[1] }}
|
||||||
</div>
|
</div>
|
||||||
</view>
|
</view>
|
||||||
<!-- 正常商品的价格 -->
|
<!-- 正常商品的价格 -->
|
||||||
<view v-else>
|
<view v-else>
|
||||||
|
|
||||||
<!-- 批发价格 -->
|
<!-- 批发价格 -->
|
||||||
<div class='price-row flex' v-if="goodsDetail.salesModel === 'WHOLESALE'">
|
<div class="price-row flex" v-if="goodsDetail.salesModel === 'WHOLESALE'">
|
||||||
<div class='goods-price' v-for="(item,index) in wholesaleList" :key="index">
|
<div class="goods-price" v-for="(item, index) in wholesaleList" :key="index">
|
||||||
<span>
|
<span>
|
||||||
¥
|
¥
|
||||||
<span class="goods-price-bigshow">{{
|
<span class="goods-price-bigshow">{{ $options.filters.goodsFormatPrice(item.price)[0] }}</span>
|
||||||
$options.filters.goodsFormatPrice(item.price)[0]
|
|
||||||
}}</span>
|
|
||||||
.{{ $options.filters.goodsFormatPrice(item.price)[1] }}
|
.{{ $options.filters.goodsFormatPrice(item.price)[1] }}
|
||||||
</span>
|
</span>
|
||||||
<span class='wholesale-item'>
|
<span class="wholesale-item">{{ item.num }}{{ goodsDetail.goodsUnit }}</span>
|
||||||
{{item.num}}{{goodsDetail.goodsUnit}}
|
|
||||||
</span>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="goods-price" v-else>
|
<div class="goods-price" v-else>
|
||||||
<span>
|
<span>
|
||||||
¥
|
¥
|
||||||
<span class="goods-price-bigshow">{{
|
<span class="goods-price-bigshow">{{ $options.filters.goodsFormatPrice(goodsDetail.price)[0] }}</span>
|
||||||
$options.filters.goodsFormatPrice(goodsDetail.price)[0]
|
|
||||||
}}</span>
|
|
||||||
.{{ $options.filters.goodsFormatPrice(goodsDetail.price)[1] }}
|
.{{ $options.filters.goodsFormatPrice(goodsDetail.price)[1] }}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
@@ -85,30 +69,39 @@
|
|||||||
<view class="view-class-title">{{ spec.name }}</view>
|
<view class="view-class-title">{{ spec.name }}</view>
|
||||||
|
|
||||||
<!-- 正常逻辑 循环出sku -->
|
<!-- 正常逻辑 循环出sku -->
|
||||||
<view v-if="!parentOrder" :class="{ active: spec_val.value == currentSelceted[specIndex] }"
|
<view
|
||||||
class="skus-view-item" v-for="(spec_val, spec_index) in spec.values" :key="spec_index"
|
v-if="!parentOrder"
|
||||||
@click="handleClickSpec(spec, specIndex, spec_val)">{{ spec_val.value }}
|
:class="{ active: spec_val.value == currentSelected[specIndex] }"
|
||||||
|
class="skus-view-item"
|
||||||
|
v-for="(spec_val, spec_index) in spec.values"
|
||||||
|
:key="spec_index"
|
||||||
|
@click="handleClickSpec(spec, specIndex, spec_val)"
|
||||||
|
>
|
||||||
|
{{ spec_val.value }}
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 拼团购买,仅筛选出当前拼团类型商品 -->
|
<!-- 拼团购买,仅筛选出当前拼团类型商品 -->
|
||||||
<view v-if="parentOrder && spec_val.skuId == goodsDetail.id"
|
<view
|
||||||
:class="{ active: spec_val.value == currentSelceted[specIndex] }" class="skus-view-item"
|
v-if="parentOrder && spec_val.skuId == goodsDetail.id"
|
||||||
v-for="(spec_val, spec_index) in spec.values" :key="spec_index"
|
:class="{ active: spec_val.value == currentSelected[specIndex] }"
|
||||||
@click="handleClickSpec(spec, specIndex, spec_val)">{{ spec_val.value }}
|
class="skus-view-item"
|
||||||
|
v-for="(spec_val, spec_index) in spec.values"
|
||||||
|
:key="spec_index"
|
||||||
|
@click="handleClickSpec(spec, specIndex, spec_val)"
|
||||||
|
>
|
||||||
|
{{ spec_val.value }}
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<!-- 数量 -->
|
<!-- 数量 -->
|
||||||
<view class="goods-skus-number flex flex-a-c flex-j-sb">
|
<view class="goods-skus-number flex flex-a-c flex-j-sb">
|
||||||
<view class="view-class-title">数量</view>
|
<view class="view-class-title">数量</view>
|
||||||
|
<uni-number-box class="uNumber" :min="1" :max="999" v-model="num"></uni-number-box>
|
||||||
<u-input class="view-class-input" v-model="num" type="number" />
|
|
||||||
</view>
|
</view>
|
||||||
</scroll-view>
|
</scroll-view>
|
||||||
<!-- 按钮 -->
|
<!-- 按钮 -->
|
||||||
<view class="btns">
|
<view class="btns">
|
||||||
<view class="box-btn card" v-if="buyType != 'PINTUAN' && goodsDetail.goodsType != 'VIRTUAL_GOODS'"
|
<view class="box-btn card" v-if="buyType != 'PINTUAN' && goodsDetail.goodsType != 'VIRTUAL_GOODS'" @click="addToCartOrBuy('cart')">加入购物车</view>
|
||||||
@click="addToCartOrBuy('cart')">加入购物车</view>
|
|
||||||
<view class="box-btn buy" @click="addToCartOrBuy('buy')">立即购买</view>
|
<view class="box-btn buy" @click="addToCartOrBuy('buy')">立即购买</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -116,421 +109,446 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import * as API_trade from "@/api/trade.js";
|
import * as API_trade from '@/api/trade.js';
|
||||||
import setup from "./popup";
|
import setup from './popup';
|
||||||
|
import uniNumberBox from '@/components/uni-number-box'
|
||||||
|
export default {
|
||||||
|
components: {
|
||||||
|
uniNumberBox
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
setup,
|
||||||
|
num: this.wholesaleList && this.wholesaleList.length > 0 ? this.wholesaleList[0].num : 1,
|
||||||
|
|
||||||
export default {
|
selectName: '', //选中商品的昵称
|
||||||
data() {
|
selectSkuList: '', //选中商铺sku,
|
||||||
return {
|
selectedSpecImg: '', //选中的图片路径
|
||||||
setup,
|
buyType: '', //用于存储促销,拼团等活动类型
|
||||||
num: 1,
|
parentOrder: '', //父级拼团活动的数据 - 如果是团员则有数据
|
||||||
|
formatList: [],
|
||||||
selectName: "", //选中商品的昵称
|
currentSelected: [],
|
||||||
selectSkuList: "", //选中商铺sku,
|
skuList: '',
|
||||||
selectedSpecImg: "", //选中的图片路径
|
isClose: false //是否可以点击遮罩关闭
|
||||||
buyType: "", //用于存储促销,拼团等活动类型
|
};
|
||||||
parentOrder: "", //父级拼团活动的数据 - 如果是团员则有数据
|
},
|
||||||
formatList: [],
|
props: {
|
||||||
currentSelceted: [],
|
wholesaleList: {
|
||||||
skuList: "",
|
type: null,
|
||||||
isClose: false, //是否可以点击遮罩关闭
|
default: false
|
||||||
|
|
||||||
};
|
|
||||||
},
|
},
|
||||||
props: {
|
buyMask: {
|
||||||
wholesaleList:{
|
type: Boolean,
|
||||||
type: null,
|
default: false
|
||||||
default: false,
|
|
||||||
},
|
|
||||||
buyMask: {
|
|
||||||
type: Boolean,
|
|
||||||
default: false,
|
|
||||||
},
|
|
||||||
isGroup: {
|
|
||||||
type: Boolean,
|
|
||||||
default: false,
|
|
||||||
},
|
|
||||||
goodsDetail: {
|
|
||||||
default: "",
|
|
||||||
type: null,
|
|
||||||
},
|
|
||||||
selectedSku: {
|
|
||||||
default: "",
|
|
||||||
type: null,
|
|
||||||
},
|
|
||||||
goodsSpec: {
|
|
||||||
default: "",
|
|
||||||
type: null,
|
|
||||||
},
|
|
||||||
addr: {
|
|
||||||
default: "",
|
|
||||||
type: null,
|
|
||||||
},
|
|
||||||
pointDetail: {
|
|
||||||
default: "",
|
|
||||||
type: null,
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
computed: {
|
isGroup: {
|
||||||
wholesalePrice(key){
|
type: Boolean,
|
||||||
return this.wholesaleList.length ? this.wholesaleList.map(item=>{ return item.price }) :[]
|
default: false
|
||||||
},
|
},
|
||||||
wholesaleNum(key){
|
goodsDetail: {
|
||||||
return this.wholesaleList.length ? this.wholesaleList.map(item=>{ return item.num }) :[]
|
default: '',
|
||||||
|
type: null
|
||||||
|
},
|
||||||
|
selectedSku: {
|
||||||
|
default: '',
|
||||||
|
type: null
|
||||||
|
},
|
||||||
|
goodsSpec: {
|
||||||
|
default: '',
|
||||||
|
type: null
|
||||||
|
},
|
||||||
|
addr: {
|
||||||
|
default: '',
|
||||||
|
type: null
|
||||||
|
},
|
||||||
|
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) {
|
||||||
|
|
||||||
|
val == 0 ? this.num = 1 : ''
|
||||||
|
if (val) {
|
||||||
|
|
||||||
|
//超过库存后修改回库存
|
||||||
|
if (val > this.goodsDetail.quantity) {
|
||||||
|
this.$nextTick(function() {
|
||||||
|
this.num = this.goodsDetail.quantity;
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
watch: {
|
buyType: {
|
||||||
num(val){
|
handler(val) {
|
||||||
if(val){
|
if (val) {
|
||||||
if(val > this.goodsDetail.quantity){
|
this.buyType = val;
|
||||||
this.val = this.goodsDetail.quantity
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
buyType: {
|
immediate: true
|
||||||
handler(val) {
|
|
||||||
if (val) {
|
|
||||||
this.buyType = val;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
immediate: true,
|
|
||||||
},
|
|
||||||
selectSkuList: {
|
|
||||||
handler(val, oldval) {
|
|
||||||
this.$emit("changed", val);
|
|
||||||
},
|
|
||||||
deep: true,
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
|
selectSkuList: {
|
||||||
methods: {
|
handler(val, oldval) {
|
||||||
closeMask() {
|
this.$emit('changed', val);
|
||||||
this.$emit("closeBuy", false);
|
|
||||||
},
|
},
|
||||||
|
deep: true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
/**点击规格 */
|
methods: {
|
||||||
handleClickSpec(val, index, specValue) {
|
numCheck(val) {
|
||||||
this.currentSelceted[index] = specValue.value;
|
if (this.wholesaleList && this.wholesaleList.length > 0) {
|
||||||
let selectedSkuId = this.goodsSpec.find((i) => {
|
if (this.num <= this.wholesaleList[0].num) {
|
||||||
let matched = true;
|
|
||||||
let specValues = i.specValues.filter((j) => j.specName !== "images");
|
|
||||||
for (let n = 0; n < specValues.length; n++) {
|
|
||||||
if (specValues[n].specValue !== this.currentSelceted[n]) {
|
|
||||||
matched = false;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (matched) {
|
|
||||||
return i;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
if (selectedSkuId?.skuId) {
|
|
||||||
this.$set(this.currentSelceted, index, specValue.value);
|
|
||||||
this.selectSkuList = {
|
|
||||||
spec: {
|
|
||||||
specName: val.name,
|
|
||||||
specValue: specValue.value,
|
|
||||||
},
|
|
||||||
data: this.goodsDetail,
|
|
||||||
};
|
|
||||||
this.selectName = specValue.value;
|
|
||||||
|
|
||||||
this.$emit("handleClickSku", {
|
|
||||||
skuId: selectedSkuId.skuId,
|
|
||||||
goodsId: this.goodsDetail.goodsId,
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: "暂无该商品!",
|
title: '批发商品购买数量不能小于起批数量!',
|
||||||
duration: 2000,
|
duration: 2000,
|
||||||
icon: "none",
|
icon: 'none'
|
||||||
});
|
});
|
||||||
|
this.num = this.wholesaleList[0].num;
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
|
},
|
||||||
|
closeMask() {
|
||||||
|
this.$emit('closeBuy', false);
|
||||||
|
},
|
||||||
|
|
||||||
/**
|
/**点击规格 */
|
||||||
* 直接购买
|
handleClickSpec(val, index, specValue) {
|
||||||
*/
|
this.currentSelected[index] = specValue.value;
|
||||||
buy(data) {
|
let selectedSkuId = this.goodsSpec.find(i => {
|
||||||
API_trade.addToCart(data).then((res) => {
|
let matched = true;
|
||||||
if (res.data.success) {
|
let specValues = i.specValues.filter(j => j.specName !== 'images');
|
||||||
uni.navigateTo({
|
for (let n = 0; n < specValues.length; n++) {
|
||||||
url: `/pages/order/fillorder?way=${
|
if (specValues[n].specValue !== this.currentSelected[n]) {
|
||||||
data.cartType
|
matched = false;
|
||||||
}&addr=${""}&parentOrder=${encodeURIComponent(
|
return;
|
||||||
JSON.stringify(this.parentOrder)
|
|
||||||
)}`,
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
});
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 添加到购物车或购买
|
|
||||||
*/
|
|
||||||
addToCartOrBuy(val) {
|
|
||||||
if (!this.selectSkuList) {
|
|
||||||
uni.showToast({
|
|
||||||
title: "请选择规格商品",
|
|
||||||
icon: "none",
|
|
||||||
});
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
let data = {
|
if (matched) {
|
||||||
skuId: this.goodsDetail.id,
|
return i;
|
||||||
num: this.num,
|
}
|
||||||
|
});
|
||||||
|
if (selectedSkuId?.skuId) {
|
||||||
|
this.$set(this.currentSelected, index, specValue.value);
|
||||||
|
this.selectSkuList = {
|
||||||
|
spec: {
|
||||||
|
specName: val.name,
|
||||||
|
specValue: specValue.value
|
||||||
|
},
|
||||||
|
data: this.goodsDetail
|
||||||
};
|
};
|
||||||
|
this.selectName = specValue.value;
|
||||||
|
|
||||||
if (val == "cart") {
|
this.$emit('handleClickSku', {
|
||||||
API_trade.addToCart(data).then((res) => {
|
skuId: selectedSkuId.skuId,
|
||||||
if (res.data.code == 200) {
|
goodsId: this.goodsDetail.goodsId
|
||||||
uni.showToast({
|
});
|
||||||
title: "商品已添加到购物车",
|
} else {
|
||||||
icon: "none",
|
uni.showToast({
|
||||||
});
|
title: '暂无该商品!',
|
||||||
|
duration: 2000,
|
||||||
|
icon: 'none'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
this.$emit("queryCart");
|
/**
|
||||||
this.closeMask();
|
* 直接购买
|
||||||
}
|
*/
|
||||||
});
|
buy(data) {
|
||||||
} else {
|
API_trade.addToCart(data).then(res => {
|
||||||
// 判断是否拼团商品
|
if (res.data.success) {
|
||||||
if (this.buyType) {
|
uni.navigateTo({
|
||||||
data.cartType = "PINTUAN";
|
url: `/pages/order/fillorder?way=${data.cartType}&addr=${''}&parentOrder=${encodeURIComponent(JSON.stringify(this.parentOrder))}`
|
||||||
} else if (this.goodsDetail.goodsType == "VIRTUAL_GOODS") {
|
|
||||||
data.cartType = "VIRTUAL";
|
|
||||||
} else {
|
|
||||||
data.cartType = "BUY_NOW";
|
|
||||||
}
|
|
||||||
|
|
||||||
API_trade.addToCart(data).then((res) => {
|
|
||||||
if (res.data.code == 200) {
|
|
||||||
uni.navigateTo({
|
|
||||||
url: `/pages/order/fillorder?way=${data.cartType}&addr=${
|
|
||||||
this.addr.id || ""
|
|
||||||
}&parentOrder=${encodeURIComponent(JSON.stringify(this.parentOrder))}`,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
});
|
||||||
formatSku(list) {
|
},
|
||||||
// 格式化数据
|
|
||||||
let arr = [{}];
|
|
||||||
|
|
||||||
if (!Array.isArray(list)) {
|
/**
|
||||||
return false
|
* 添加到购物车或购买
|
||||||
}
|
*/
|
||||||
list.forEach((item, index) => {
|
addToCartOrBuy(val) {
|
||||||
item.specValues.forEach((spec, specIndex) => {
|
if (!this.selectSkuList) {
|
||||||
let name = spec.specName;
|
uni.showToast({
|
||||||
let values = {
|
title: '请选择规格商品',
|
||||||
value: spec.specValue,
|
icon: 'none'
|
||||||
quantity: item.quantity,
|
});
|
||||||
skuId: item.skuId,
|
return;
|
||||||
};
|
}
|
||||||
if (name === "images") {
|
let data = {
|
||||||
return;
|
skuId: this.goodsDetail.id,
|
||||||
}
|
num: this.num
|
||||||
|
};
|
||||||
|
|
||||||
arr.forEach((arrItem, arrIndex) => {
|
if (val == 'cart') {
|
||||||
if (
|
API_trade.addToCart(data).then(res => {
|
||||||
arrItem.name == name &&
|
if (res.data.code == 200) {
|
||||||
arrItem.values &&
|
uni.showToast({
|
||||||
!arrItem.values.find((i) => {
|
title: '商品已添加到购物车',
|
||||||
return i.value === values.value;
|
icon: 'none'
|
||||||
})
|
|
||||||
) {
|
|
||||||
arrItem.values.push(values);
|
|
||||||
}
|
|
||||||
|
|
||||||
let keys = arr.map((key) => {
|
|
||||||
return key.name;
|
|
||||||
});
|
|
||||||
if (!keys.includes(name)) {
|
|
||||||
arr.push({
|
|
||||||
name: name,
|
|
||||||
values: [values],
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
arr.shift();
|
this.$emit('queryCart');
|
||||||
this.formatList = arr;
|
this.closeMask();
|
||||||
|
|
||||||
list.forEach((item) => {
|
|
||||||
// 默认选中
|
|
||||||
if (item.skuId === this.goodsDetail.id) {
|
|
||||||
item.specValues
|
|
||||||
.filter((i) => i.specName !== "images")
|
|
||||||
.forEach((value, _index) => {
|
|
||||||
this.currentSelceted[_index] = value.specValue;
|
|
||||||
|
|
||||||
this.selectName = value.specValue;
|
|
||||||
|
|
||||||
this.selectSkuList = {
|
|
||||||
spec: value,
|
|
||||||
data: this.goodsDetail,
|
|
||||||
};
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
} else {
|
||||||
|
// 判断是否拼团商品
|
||||||
|
if (this.buyType) {
|
||||||
|
data.cartType = 'PINTUAN';
|
||||||
|
} else if (this.goodsDetail.goodsType == 'VIRTUAL_GOODS') {
|
||||||
|
data.cartType = 'VIRTUAL';
|
||||||
|
} else {
|
||||||
|
data.cartType = 'BUY_NOW';
|
||||||
|
}
|
||||||
|
|
||||||
this.skuList = list;
|
API_trade.addToCart(data).then(res => {
|
||||||
// console.log(" this.skuList", this.skuList)
|
if (res.data.code == 200) {
|
||||||
},
|
uni.navigateTo({
|
||||||
|
url: `/pages/order/fillorder?way=${data.cartType}&addr=${this.addr.id || ''}&parentOrder=${encodeURIComponent(JSON.stringify(this.parentOrder))}`
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
formatSku(list) {
|
||||||
|
// 格式化数据
|
||||||
|
let arr = [{}];
|
||||||
|
|
||||||
mounted() {
|
if (!Array.isArray(list)) {
|
||||||
this.formatSku(this.goodsSpec);
|
return false;
|
||||||
},
|
}
|
||||||
};
|
list.forEach((item, index) => {
|
||||||
|
item.specValues.forEach((spec, specIndex) => {
|
||||||
|
let name = spec.specName;
|
||||||
|
let values = {
|
||||||
|
value: spec.specValue,
|
||||||
|
quantity: item.quantity,
|
||||||
|
skuId: item.skuId
|
||||||
|
};
|
||||||
|
if (name === 'images') {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
arr.forEach((arrItem, arrIndex) => {
|
||||||
|
if (
|
||||||
|
arrItem.name == name &&
|
||||||
|
arrItem.values &&
|
||||||
|
!arrItem.values.find(i => {
|
||||||
|
return i.value === values.value;
|
||||||
|
})
|
||||||
|
) {
|
||||||
|
arrItem.values.push(values);
|
||||||
|
}
|
||||||
|
|
||||||
|
let keys = arr.map(key => {
|
||||||
|
return key.name;
|
||||||
|
});
|
||||||
|
if (!keys.includes(name)) {
|
||||||
|
arr.push({
|
||||||
|
name: name,
|
||||||
|
values: [values]
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
arr.shift();
|
||||||
|
this.formatList = arr;
|
||||||
|
|
||||||
|
list.forEach(item => {
|
||||||
|
// 默认选中
|
||||||
|
if (item.skuId === this.goodsDetail.id) {
|
||||||
|
item.specValues
|
||||||
|
.filter(i => i.specName !== 'images')
|
||||||
|
.forEach((value, _index) => {
|
||||||
|
this.currentSelected[_index] = value.specValue;
|
||||||
|
|
||||||
|
this.selectName = value.specValue;
|
||||||
|
|
||||||
|
this.selectSkuList = {
|
||||||
|
spec: value,
|
||||||
|
data: this.goodsDetail
|
||||||
|
};
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
this.skuList = list;
|
||||||
|
// console.log(" this.skuList", this.skuList)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
mounted() {
|
||||||
|
this.formatSku(this.goodsSpec);
|
||||||
|
}
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
@import "./popup.scss";
|
@import './popup.scss';
|
||||||
.price-row{
|
|
||||||
text-align: center;
|
|
||||||
|
|
||||||
}
|
.price-row {
|
||||||
.buy {
|
text-align: center;
|
||||||
background-image: linear-gradient(135deg, #ffba0d, #ffc30d 69%, #ffcf0d);
|
}
|
||||||
box-shadow: 0 2px 6px 0 rgba(255, 65, 66, 0.2);
|
|
||||||
|
.buy {
|
||||||
|
background-image: linear-gradient(135deg, #ffba0d, #ffc30d 69%, #ffcf0d);
|
||||||
|
box-shadow: 0 2px 6px 0 rgba(255, 65, 66, 0.2);
|
||||||
|
}
|
||||||
|
|
||||||
|
.card {
|
||||||
|
background-image: linear-gradient(135deg, #f2140c, #f2270c 70%, #f24d0c);
|
||||||
|
box-shadow: 0 2px 6px 0 rgba(255, 65, 66, 0.2);
|
||||||
|
}
|
||||||
|
|
||||||
|
/deep/.u-icon-plus,
|
||||||
|
.u-icon-minus,
|
||||||
|
.u-icon-disabled {
|
||||||
|
height: 30rpx !important;
|
||||||
|
background: #fff !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.goods-skus-number {
|
||||||
|
justify-content: space-between;
|
||||||
|
display: flex;
|
||||||
|
|
||||||
|
> .view-class-title {
|
||||||
|
flex: 8;
|
||||||
}
|
}
|
||||||
|
|
||||||
.card {
|
> .view-class-input {
|
||||||
background-image: linear-gradient(135deg, #f2140c, #f2270c 70%, #f24d0c);
|
flex: 1;
|
||||||
box-shadow: 0 2px 6px 0 rgba(255, 65, 66, 0.2);
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/deep/.u-icon-plus,
|
/deep/ .uni-scroll-view {
|
||||||
.u-icon-minus,
|
overflow: hidden !important;
|
||||||
.u-icon-disabled {
|
}
|
||||||
height: 30rpx !important;
|
|
||||||
background: #fff !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.goods-skus-number {
|
.active {
|
||||||
justify-content: space-between;
|
background: $price-light-color !important;
|
||||||
display: flex;
|
border: 2rpx solid $price-color;
|
||||||
|
font-weight: bold;
|
||||||
|
color: $price-color !important;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
>.view-class-title{
|
.goods-skus-box {
|
||||||
flex: 8;
|
overflow-y: auto;
|
||||||
}
|
height: 610rpx;
|
||||||
>.view-class-input{
|
// #ifdef MP-WEIXIN
|
||||||
flex:1
|
height: 570rpx;
|
||||||
|
// #endif
|
||||||
|
margin-bottom: 10rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.goods-skus-view {
|
||||||
|
overflow: hidden;
|
||||||
|
|
||||||
|
.skus-view-list {
|
||||||
|
> .skus-view-item {
|
||||||
|
flex: 1;
|
||||||
|
padding: 0 36rpx;
|
||||||
|
|
||||||
|
overflow: hidden;
|
||||||
|
height: 60rpx;
|
||||||
|
line-height: 60rpx;
|
||||||
|
float: left;
|
||||||
|
text-align: center;
|
||||||
|
margin-left: 24rpx;
|
||||||
|
margin-bottom: 20rpx;
|
||||||
|
font-size: 22rpx;
|
||||||
|
color: #262626;
|
||||||
|
background: #f2f2f2;
|
||||||
|
border-radius: 30rpx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/deep/ .uni-scroll-view {
|
.wholesale-item {
|
||||||
overflow: hidden !important;
|
color: #999 !important;
|
||||||
}
|
font-size: 24rpx;
|
||||||
|
margin: 0 20rpx;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
.active {
|
.goods-header {
|
||||||
background: $price-light-color !important;
|
height: 200rpx;
|
||||||
border: 2rpx solid $price-color;
|
display: flex;
|
||||||
font-weight: bold;
|
align-items: center;
|
||||||
color: $price-color !important;
|
margin-bottom: 36rpx;
|
||||||
box-sizing: border-box;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
.goods-skus-box {
|
.goods-box {
|
||||||
overflow-y: auto;
|
padding: 50rpx 36rpx 0 36rpx;
|
||||||
height: 610rpx;
|
}
|
||||||
// #ifdef MP-WEIXIN
|
|
||||||
height: 570rpx;
|
|
||||||
// #endif
|
|
||||||
margin-bottom: 10rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.goods-skus-view {
|
.goods-skus {
|
||||||
overflow: hidden;
|
padding: 0 20rpx;
|
||||||
|
}
|
||||||
|
|
||||||
.skus-view-list {
|
.goods-price {
|
||||||
>.skus-view-item {
|
color: $price-color;
|
||||||
flex: 1;
|
line-height: 80rpx;
|
||||||
padding: 0 36rpx;
|
margin-right: 20rpx;
|
||||||
|
|
||||||
overflow: hidden;
|
> * {
|
||||||
height: 60rpx;
|
|
||||||
line-height: 60rpx;
|
|
||||||
float: left;
|
|
||||||
text-align: center;
|
|
||||||
margin-left: 24rpx;
|
|
||||||
margin-bottom: 20rpx;
|
|
||||||
font-size: 22rpx;
|
|
||||||
color: #262626;
|
|
||||||
background: #f2f2f2;
|
|
||||||
border-radius: 30rpx;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.wholesale-item{
|
|
||||||
color: #999 !important;
|
|
||||||
font-size: 24rpx;
|
|
||||||
margin:0 20rpx;
|
|
||||||
display: flex;
|
|
||||||
justify-content: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.goods-header {
|
|
||||||
height: 200rpx;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
margin-bottom: 36rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.goods-box {
|
|
||||||
padding: 50rpx 36rpx 0 36rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.goods-skus {
|
|
||||||
padding: 0 20rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.goods-price {
|
|
||||||
color: $price-color;
|
color: $price-color;
|
||||||
line-height: 80rpx;
|
line-height: 80rpx;
|
||||||
margin-right: 20rpx;
|
|
||||||
>* {
|
|
||||||
color: $price-color;
|
|
||||||
line-height: 80rpx;
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.promotion-box {
|
.promotion-box {
|
||||||
line-height: 1;
|
line-height: 1;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
text-decoration: line-through;
|
text-decoration: line-through;
|
||||||
color: #999;
|
color: #999;
|
||||||
margin-left: 10rpx;
|
margin-left: 10rpx;
|
||||||
|
|
||||||
/deep/ span {
|
/deep/ span {
|
||||||
font-size: 30rpx;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.promotion {
|
|
||||||
font-size: 30rpx;
|
font-size: 30rpx;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.goods-price-promotionShow {
|
.promotion {
|
||||||
font-size: 48rpx;
|
font-size: 30rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.goods-price-promotionShow {
|
||||||
|
font-size: 48rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.goods-check-skus {
|
||||||
|
font-size: 24rpx;
|
||||||
|
color: #999;
|
||||||
|
|
||||||
|
> .goods-check-skus-name {
|
||||||
|
margin-left: 4rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.goods-check-skus {
|
> span {
|
||||||
font-size: 24rpx;
|
color: #333;
|
||||||
color: #999;
|
|
||||||
|
|
||||||
>.goods-check-skus-name {
|
|
||||||
margin-left: 4rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
>span {
|
|
||||||
color: #333;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
:src="item.thumbnail"
|
:src="item.thumbnail"
|
||||||
width="100%"
|
width="100%"
|
||||||
height="330rpx"
|
height="330rpx"
|
||||||
mode="aspectFill"
|
mode="aspectFit"
|
||||||
>
|
>
|
||||||
<u-loading slot="loading"></u-loading>
|
<u-loading slot="loading"></u-loading>
|
||||||
</u-image>
|
</u-image>
|
||||||
@@ -64,6 +64,7 @@
|
|||||||
width="230rpx"
|
width="230rpx"
|
||||||
border-radius="16"
|
border-radius="16"
|
||||||
height="230rpx"
|
height="230rpx"
|
||||||
|
mode="aspectFit"
|
||||||
:src="item.goodsImage || item.thumbnail"
|
:src="item.goodsImage || item.thumbnail"
|
||||||
>
|
>
|
||||||
<u-loading slot="loading"></u-loading>
|
<u-loading slot="loading"></u-loading>
|
||||||
|
|||||||
@@ -51,13 +51,13 @@
|
|||||||
// 跳转到商品详情
|
// 跳转到商品详情
|
||||||
navigateToDetailPage(item) {
|
navigateToDetailPage(item) {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: `/pages/product/goods?id=${item.content.id}&goodsId=${item.content.goodsId}`,
|
url: `/pages/product/goods?id=${item.id}&goodsId=${item.goodsId}`,
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
// 跳转地址
|
// 跳转地址
|
||||||
navigateToStoreDetailPage(item) {
|
navigateToStoreDetailPage(item) {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: `/pages/product/shopPage?id=${item.content.storeId}`,
|
url: `/pages/product/shopPage?id=${item.storeId}`,
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -4,24 +4,24 @@
|
|||||||
<view class="goods-list" v-if="type == 'twoColumns'">
|
<view class="goods-list" v-if="type == 'twoColumns'">
|
||||||
<view v-for="(item, index) in res" :key="index" class="goods-item">
|
<view v-for="(item, index) in res" :key="index" class="goods-item">
|
||||||
<view class="image-wrapper" @click="navigateToDetailPage(item)">
|
<view class="image-wrapper" @click="navigateToDetailPage(item)">
|
||||||
<u-image :src="item.content.thumbnail" width="100%" height='330rpx' mode="aspectFill">
|
<u-image :src="item.thumbnail" width="100%" height='330rpx' mode="aspectFit">
|
||||||
<u-loading slot="loading"></u-loading>
|
<u-loading slot="loading"></u-loading>
|
||||||
</u-image>
|
</u-image>
|
||||||
</view>
|
</view>
|
||||||
<view class="goods-detail">
|
<view class="goods-detail">
|
||||||
<div class="title clamp" v-html="lightSearchStr(keyword,item.content.goodsName)"
|
<div class="title clamp" v-html="lightSearchStr(keyword,item.goodsName)"
|
||||||
@click="navigateToDetailPage(item)">
|
@click="navigateToDetailPage(item)">
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<view class="price-box" @click="navigateToDetailPage(item)">
|
<view class="price-box" @click="navigateToDetailPage(item)">
|
||||||
<div class="price" v-if="item.content.price!=undefined">
|
<div class="price" v-if="item.price!=undefined">
|
||||||
¥<span>{{ $options.filters.goodsFormatPrice(item.content.price )[0] }} </span>.{{
|
¥<span>{{ $options.filters.goodsFormatPrice(item.price )[0] }} </span>.{{
|
||||||
$options.filters.goodsFormatPrice(item.content.price )[1]
|
$options.filters.goodsFormatPrice(item.price )[1]
|
||||||
}}
|
}}
|
||||||
</div>
|
</div>
|
||||||
</view>
|
</view>
|
||||||
<div class="promotion" @click="navigateToDetailPage(item)">
|
<div class="promotion" @click="navigateToDetailPage(item)">
|
||||||
<div v-if="item.content.salesModel == 'WHOLESALE'">
|
<div v-if="item.salesModel == 'WHOLESALE'">
|
||||||
<span>批</span>
|
<span>批</span>
|
||||||
</div>
|
</div>
|
||||||
<div v-for="(promotionItem,promotionIndex) in getPromotion(item)" :key="promotionIndex">
|
<div v-for="(promotionItem,promotionIndex) in getPromotion(item)" :key="promotionIndex">
|
||||||
@@ -31,14 +31,14 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="count-config" @click="navigateToDetailPage(item)">
|
<div class="count-config" @click="navigateToDetailPage(item)">
|
||||||
<span>已售 {{ item.content.buyCount || "0" }}</span>
|
<span>已售 {{ item.buyCount || "0" }}</span>
|
||||||
<span>{{ item.content.commentNum || "0" }}条评论</span>
|
<span>{{ item.commentNum || "0" }}条评论</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="store-seller-name" v-if="storeName" @click="navigateToStoreDetailPage(item)">
|
<div class="store-seller-name" v-if="storeName" @click="navigateToStoreDetailPage(item)">
|
||||||
<div class="text-hidden">
|
<div class="text-hidden">
|
||||||
<u-tag style="margin-right: 10rpx" size="mini" mode="dark" v-if="item.selfOperated"
|
<u-tag style="margin-right: 10rpx" size="mini" mode="dark" v-if="item.selfOperated"
|
||||||
text="自营" type="error" />
|
text="自营" type="error" />
|
||||||
<span>{{ item.content.storeName || "暂无" }}</span>
|
<span>{{ item.storeName || "暂无" }}</span>
|
||||||
</div>
|
</div>
|
||||||
<span>
|
<span>
|
||||||
<u-icon name="arrow-right"></u-icon>
|
<u-icon name="arrow-right"></u-icon>
|
||||||
@@ -48,25 +48,25 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<!-- 一行一列商品展示 -->
|
<!-- 一行一列商品展示 -->
|
||||||
<div v-if="type == 'oneColumns'">
|
<div v-if="type == 'oneColumns'" class="goods-one-row">
|
||||||
<div v-for="(item, index) in res" :key="index" class="goods-row">
|
<div v-for="(item, index) in res" :key="index" class="goods-row">
|
||||||
<div class="flex goods-col">
|
<div class="flex goods-col">
|
||||||
<div class="goods-img" @click="navigateToDetailPage(item)">
|
<div class="goods-img" @click="navigateToDetailPage(item)">
|
||||||
<u-image width="230rpx" border-radius='16' height="230rpx" :src="item.content.thumbnail">
|
<u-image width="230rpx" mode="aspectFit" border-radius='16' height="230rpx" :src="item.thumbnail">
|
||||||
<u-loading slot="loading"></u-loading>
|
<u-loading slot="loading"></u-loading>
|
||||||
</u-image>
|
</u-image>
|
||||||
</div>
|
</div>
|
||||||
<div class="goods-detail">
|
<div class="goods-detail">
|
||||||
<div class="title clamp3" @click="navigateToDetailPage(item)">{{ item.content.goodsName }}</div>
|
<div class="title clamp3" @click="navigateToDetailPage(item)">{{ item.goodsName }}</div>
|
||||||
<view class="price-box" @click="navigateToDetailPage(item)">
|
<view class="price-box" @click="navigateToDetailPage(item)">
|
||||||
<div class="price" v-if="item.content.price!=undefined">
|
<div class="price" v-if="item.price!=undefined">
|
||||||
¥<span>{{ $options.filters.goodsFormatPrice(item.content.price )[0] }} </span>.{{
|
¥<span>{{ $options.filters.goodsFormatPrice(item.price )[0] }} </span>.{{
|
||||||
$options.filters.goodsFormatPrice(item.content.price )[1]
|
$options.filters.goodsFormatPrice(item.price )[1]
|
||||||
}}
|
}}
|
||||||
</div>
|
</div>
|
||||||
</view>
|
</view>
|
||||||
<div class="promotion" @click="navigateToDetailPage(item)">
|
<div class="promotion" @click="navigateToDetailPage(item)">
|
||||||
<div v-if="item.content.salesModel == 'WHOLESALE'">
|
<div v-if="item.salesModel == 'WHOLESALE'">
|
||||||
<span>批</span>
|
<span>批</span>
|
||||||
</div>
|
</div>
|
||||||
<div v-for="(promotionItem,promotionIndex) in getPromotion(item)" :key="promotionIndex">
|
<div v-for="(promotionItem,promotionIndex) in getPromotion(item)" :key="promotionIndex">
|
||||||
@@ -76,14 +76,14 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div style="overflow: hidden" @click="navigateToDetailPage(item)" class="count-config">
|
<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: left; font-size: 22rpx">已售 {{ item.buyCount || '0' }}</span>
|
||||||
<span style="float: right; font-size: 22rpx">{{ item.content.commentNum || '0' }}条评论</span>
|
<span style="float: right; font-size: 22rpx">{{ item.commentNum || '0' }}条评论</span>
|
||||||
</div>
|
</div>
|
||||||
<div style="overflow: hidden" @click="navigateToStoreDetailPage(item)" class="count-config">
|
<div style="overflow: hidden" @click="navigateToStoreDetailPage(item)" class="count-config">
|
||||||
<div class="text-hidden" v-if="storeName">
|
<div class="text-hidden" v-if="storeName">
|
||||||
<u-tag style="margin-right: 10rpx" size="mini" mode="dark" v-if="item.selfOperated"
|
<u-tag style="margin-right: 10rpx" size="mini" mode="dark" v-if="item.selfOperated"
|
||||||
text="自营" type="error" />
|
text="自营" type="error" />
|
||||||
<span class="line1-store-name">{{ item.content.storeName }}</span>
|
<span class="line1-store-name">{{ item.storeName }}</span>
|
||||||
<span class="to-store">进店<u-icon size="24" name="arrow-right" color="#666"></u-icon>
|
<span class="to-store">进店<u-icon size="24" name="arrow-right" color="#666"></u-icon>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
@@ -179,9 +179,10 @@
|
|||||||
},
|
},
|
||||||
// 数据去重一下 只显示一次 减免 劵 什么的
|
// 数据去重一下 只显示一次 减免 劵 什么的
|
||||||
getPromotion(item) {
|
getPromotion(item) {
|
||||||
if (item.promotionMap) {
|
if (item ? item.promotionMap : item.promotionMap) {
|
||||||
|
const fieldList = item ? item.promotionMap : item.promotionMap
|
||||||
let array = [];
|
let array = [];
|
||||||
Object.keys(item.promotionMap).forEach((child) => {
|
Object.keys(fieldList).forEach((child) => {
|
||||||
if (!array.includes(child.split("-")[0])) {
|
if (!array.includes(child.split("-")[0])) {
|
||||||
array.push(child.split("-")[0]);
|
array.push(child.split("-")[0]);
|
||||||
}
|
}
|
||||||
@@ -192,13 +193,13 @@
|
|||||||
// 跳转到商品详情
|
// 跳转到商品详情
|
||||||
navigateToDetailPage(item) {
|
navigateToDetailPage(item) {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: `/pages/product/goods?id=${item.content.id}&goodsId=${item.content.goodsId}`,
|
url: `/pages/product/goods?id=${item.id}&goodsId=${item.goodsId}`,
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
// 跳转地址
|
// 跳转地址
|
||||||
navigateToStoreDetailPage(item) {
|
navigateToStoreDetailPage(item) {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: `/pages/product/shopPage?id=${item.content.storeId}`,
|
url: `/pages/product/shopPage?id=${item.storeId}`,
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
@@ -206,7 +207,10 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang='scss' scoped>
|
<style lang='scss' scoped>
|
||||||
/* 商品列表 */
|
.goods-one-row{
|
||||||
|
padding-bottom: 250rpx;
|
||||||
|
}
|
||||||
|
/* 商品列表 */
|
||||||
.goods-list {
|
.goods-list {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
<div v-for="(item, index) in res" :key="index" class="goods-row" @click="navigateToDetailPage(item)">
|
<div v-for="(item, index) in res" :key="index" class="goods-row" @click="navigateToDetailPage(item)">
|
||||||
<div class="flex goods-col">
|
<div class="flex goods-col">
|
||||||
<div class="goods-img">
|
<div class="goods-img">
|
||||||
<u-image width="230rpx" border-radius='16' height="230rpx" :src="item.goodsImage || item.thumbnail">
|
<u-image width="230rpx" mode="aspectFit" border-radius='16' height="230rpx" :src="item.goodsImage || item.thumbnail">
|
||||||
<u-loading slot="loading"></u-loading>
|
<u-loading slot="loading"></u-loading>
|
||||||
</u-image>
|
</u-image>
|
||||||
</div>
|
</div>
|
||||||
@@ -24,6 +24,10 @@
|
|||||||
$options.filters.goodsFormatPrice(item.purchasePrice )[1]
|
$options.filters.goodsFormatPrice(item.purchasePrice )[1]
|
||||||
}}
|
}}
|
||||||
</div>
|
</div>
|
||||||
|
<!-- 兜底策略如果金额是0 -->
|
||||||
|
<div class="price" v-if="!item.price">
|
||||||
|
¥<span>0 </span>.00
|
||||||
|
</div>
|
||||||
</view>
|
</view>
|
||||||
<div>
|
<div>
|
||||||
<image class='buy' :src="buy"></image>
|
<image class='buy' :src="buy"></image>
|
||||||
|
|||||||
@@ -59,11 +59,11 @@ export default {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
let goodsList = await getGoodsList(submit);
|
let goodsList = await getGoodsList(submit);
|
||||||
this.goodsList.push(...goodsList.data.result.content);
|
this.goodsList.push(...goodsList.data.result.records);
|
||||||
},
|
},
|
||||||
handleClick(item) {
|
handleClick(item) {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: `/pages/product/goods?id=${item.content.id}&goodsId=${item.content.goodsId}`,
|
url: `/pages/product/goods?id=${item.id}&goodsId=${item.goodsId}`,
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -83,20 +83,7 @@ export default {
|
|||||||
this.configs.shareLink +
|
this.configs.shareLink +
|
||||||
getCurrentPages()[getCurrentPages().length - 1].__page__.fullPath;
|
getCurrentPages()[getCurrentPages().length - 1].__page__.fullPath;
|
||||||
}
|
}
|
||||||
if (content === null || content === undefined) {
|
this.$options.filters.setClipboard(content)
|
||||||
content = "";
|
|
||||||
} else content = content + "";
|
|
||||||
const result = h5Copy(content);
|
|
||||||
if (result === false) {
|
|
||||||
uni.showToast({
|
|
||||||
title: "不支持",
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
uni.showToast({
|
|
||||||
title: "复制成功",
|
|
||||||
icon: "none",
|
|
||||||
});
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
// #endif
|
// #endif
|
||||||
|
|
||||||
|
|||||||
34
components/m-take-down-sale-goods/index.vue
Normal file
34
components/m-take-down-sale-goods/index.vue
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<u-popup v-model="show" mode="bottom" height="800rpx" border-radius="14">
|
||||||
|
<div class="wrapper">
|
||||||
|
<view class="down-goods-tips">该商品已下架</view>
|
||||||
|
<scroll-view scroll-y="true" style="height: 670rpx">
|
||||||
|
<goodsRecommend title="其他商品" />
|
||||||
|
</scroll-view>
|
||||||
|
</div>
|
||||||
|
</u-popup>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import goodsRecommend from "@/components/m-goods-recommend/index.vue";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
show: true, // 是否显示
|
||||||
|
};
|
||||||
|
},
|
||||||
|
components: { goodsRecommend },
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.down-goods-tips {
|
||||||
|
font-size: 36rpx;
|
||||||
|
text-align: center;
|
||||||
|
font-weight: bold;
|
||||||
|
padding: 40rpx 0;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
220
components/uni-number-box.vue
Normal file
220
components/uni-number-box.vue
Normal file
@@ -0,0 +1,220 @@
|
|||||||
|
<template>
|
||||||
|
<view class="uni-numbox">
|
||||||
|
<view @click="_calcValue('minus')" class="uni-numbox__minus uni-numbox-btns" :style="{background}">
|
||||||
|
<text class="uni-numbox--text" :class="{ 'uni-numbox--disabled': inputValue <= min || disabled }" :style="{color}">-</text>
|
||||||
|
</view>
|
||||||
|
<input :disabled="disabled" @focus="_onFocus" @blur="_onBlur" class="uni-numbox__value" type="number"
|
||||||
|
v-model="inputValue" :style="{background, color}" />
|
||||||
|
<view @click="_calcValue('plus')" class="uni-numbox__plus uni-numbox-btns" :style="{background}">
|
||||||
|
<text class="uni-numbox--text" :class="{ 'uni-numbox--disabled': inputValue >= max || disabled }" :style="{color}">+</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
/**
|
||||||
|
* NumberBox 数字输入框
|
||||||
|
* @description 带加减按钮的数字输入框
|
||||||
|
* @tutorial https://ext.dcloud.net.cn/plugin?id=31
|
||||||
|
* @property {Number} value 输入框当前值
|
||||||
|
* @property {Number} min 最小值
|
||||||
|
* @property {Number} max 最大值
|
||||||
|
* @property {Number} step 每次点击改变的间隔大小
|
||||||
|
* @property {String} background 背景色
|
||||||
|
* @property {String} color 字体颜色(前景色)
|
||||||
|
* @property {Boolean} disabled = [true|false] 是否为禁用状态
|
||||||
|
* @event {Function} change 输入框值改变时触发的事件,参数为输入框当前的 value
|
||||||
|
* @event {Function} focus 输入框聚焦时触发的事件,参数为 event 对象
|
||||||
|
* @event {Function} blur 输入框失焦时触发的事件,参数为 event 对象
|
||||||
|
*/
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: "UniNumberBox",
|
||||||
|
emits: ['change', 'input', 'update:modelValue', 'blur', 'focus'],
|
||||||
|
props: {
|
||||||
|
value: {
|
||||||
|
type: [Number, String],
|
||||||
|
default: 1
|
||||||
|
},
|
||||||
|
modelValue: {
|
||||||
|
type: [Number, String],
|
||||||
|
default: 1
|
||||||
|
},
|
||||||
|
min: {
|
||||||
|
type: Number,
|
||||||
|
default: 0
|
||||||
|
},
|
||||||
|
max: {
|
||||||
|
type: Number,
|
||||||
|
default: 100
|
||||||
|
},
|
||||||
|
step: {
|
||||||
|
type: Number,
|
||||||
|
default: 1
|
||||||
|
},
|
||||||
|
background: {
|
||||||
|
type: String,
|
||||||
|
default: '#f5f5f5'
|
||||||
|
},
|
||||||
|
color: {
|
||||||
|
type: String,
|
||||||
|
default: '#333'
|
||||||
|
},
|
||||||
|
disabled: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
inputValue: 0
|
||||||
|
};
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
value(val) {
|
||||||
|
this.inputValue = +val;
|
||||||
|
},
|
||||||
|
modelValue(val) {
|
||||||
|
this.inputValue = +val;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
if (this.value === 1) {
|
||||||
|
this.inputValue = +this.modelValue;
|
||||||
|
}
|
||||||
|
if (this.modelValue === 1) {
|
||||||
|
this.inputValue = +this.value;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
_calcValue(type) {
|
||||||
|
if (this.disabled) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const scale = this._getDecimalScale();
|
||||||
|
let value = this.inputValue * scale;
|
||||||
|
let step = this.step * scale;
|
||||||
|
if (type === "minus") {
|
||||||
|
value -= step;
|
||||||
|
if (value < (this.min * scale)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (value > (this.max * scale)) {
|
||||||
|
value = this.max * scale
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (type === "plus") {
|
||||||
|
value += step;
|
||||||
|
if (value > (this.max * scale)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (value < (this.min * scale)) {
|
||||||
|
value = this.min * scale
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
this.inputValue = (value / scale).toFixed(String(scale).length - 1);
|
||||||
|
this.$emit("change", +this.inputValue);
|
||||||
|
// TODO vue2 兼容
|
||||||
|
this.$emit("input", +this.inputValue);
|
||||||
|
// TODO vue3 兼容
|
||||||
|
this.$emit("update:modelValue", +this.inputValue);
|
||||||
|
},
|
||||||
|
_getDecimalScale() {
|
||||||
|
|
||||||
|
let scale = 1;
|
||||||
|
// 浮点型
|
||||||
|
if (~~this.step !== this.step) {
|
||||||
|
scale = Math.pow(10, String(this.step).split(".")[1].length);
|
||||||
|
}
|
||||||
|
return scale;
|
||||||
|
},
|
||||||
|
_onBlur(event) {
|
||||||
|
this.$emit('blur', event)
|
||||||
|
let value = event.detail.value;
|
||||||
|
if (!value) {
|
||||||
|
// this.inputValue = 0;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
value = +value;
|
||||||
|
if (value > this.max) {
|
||||||
|
value = this.max;
|
||||||
|
} else if (value < this.min) {
|
||||||
|
value = this.min;
|
||||||
|
}
|
||||||
|
const scale = this._getDecimalScale();
|
||||||
|
this.inputValue = value.toFixed(String(scale).length - 1);
|
||||||
|
this.$emit("change", +this.inputValue);
|
||||||
|
this.$emit("input", +this.inputValue);
|
||||||
|
},
|
||||||
|
_onFocus(event) {
|
||||||
|
this.$emit('focus', event)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
$box-height: 48rpx;
|
||||||
|
$bg: #f5f5f5;
|
||||||
|
$br: 4rpx;
|
||||||
|
$color: #333;
|
||||||
|
|
||||||
|
.uni-numbox {
|
||||||
|
/* #ifndef APP-NVUE */
|
||||||
|
display: flex;
|
||||||
|
/* #endif */
|
||||||
|
flex-direction: row;
|
||||||
|
}
|
||||||
|
|
||||||
|
.uni-numbox-btns {
|
||||||
|
/* #ifndef APP-NVUE */
|
||||||
|
display: flex;
|
||||||
|
/* #endif */
|
||||||
|
flex-direction: row;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
padding: 0 8px;
|
||||||
|
background-color: $bg;
|
||||||
|
/* #ifdef H5 */
|
||||||
|
cursor: pointer;
|
||||||
|
/* #endif */
|
||||||
|
}
|
||||||
|
|
||||||
|
.uni-numbox__value {
|
||||||
|
margin: 0 4rpx;
|
||||||
|
background-color: $bg;
|
||||||
|
width: 70rpx;
|
||||||
|
height: $box-height;
|
||||||
|
text-align: center;
|
||||||
|
font-size: 24rpx;
|
||||||
|
border-left-width: 0;
|
||||||
|
border-right-width: 0;
|
||||||
|
color: $color;
|
||||||
|
}
|
||||||
|
|
||||||
|
.uni-numbox__minus {
|
||||||
|
border-top-left-radius: $br;
|
||||||
|
border-bottom-left-radius: $br;
|
||||||
|
}
|
||||||
|
|
||||||
|
.uni-numbox__plus {
|
||||||
|
border-top-right-radius: $br;
|
||||||
|
border-bottom-right-radius: $br;
|
||||||
|
}
|
||||||
|
|
||||||
|
.uni-numbox--text {
|
||||||
|
// fix nvue
|
||||||
|
line-height: 40rpx;
|
||||||
|
|
||||||
|
font-size: 40rpx;
|
||||||
|
font-weight: 300;
|
||||||
|
color: $color;
|
||||||
|
}
|
||||||
|
|
||||||
|
.uni-numbox .uni-numbox--disabled {
|
||||||
|
color: #c0c0c0 !important;
|
||||||
|
/* #ifdef H5 */
|
||||||
|
cursor: not-allowed;
|
||||||
|
/* #endif */
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -29,7 +29,8 @@ export default {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
fail() {
|
fail(e) {
|
||||||
|
console.log(e)
|
||||||
that.$emit("close");
|
that.$emit("close");
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
@@ -96,7 +96,7 @@
|
|||||||
name="close"
|
name="close"
|
||||||
></u-icon>
|
></u-icon>
|
||||||
|
|
||||||
<text class="cu-tag bg-cyan round" @click="getCode">刷新拼图</text>
|
<text class="cu-tag round" @click="getCode">刷新拼图</text>
|
||||||
<text class="my-neirong-sm cuIcon-safe" style="color: #c1c1c1"
|
<text class="my-neirong-sm cuIcon-safe" style="color: #c1c1c1"
|
||||||
>Lili-FRAMEWORK</text
|
>Lili-FRAMEWORK</text
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -4,11 +4,16 @@
|
|||||||
*/
|
*/
|
||||||
// 开发环境
|
// 开发环境
|
||||||
const dev = {
|
const dev = {
|
||||||
|
im: "https://im-api.pickmall.cn",
|
||||||
common: "https://common-api.pickmall.cn",
|
common: "https://common-api.pickmall.cn",
|
||||||
buyer: "https://buyer-api.pickmall.cn",
|
buyer: "https://buyer-api.pickmall.cn",
|
||||||
|
// common: "http://192.168.0.113:8890",
|
||||||
|
// buyer: "http://192.168.0.113:8888",
|
||||||
|
// im: "http://192.168.0.113:8885",
|
||||||
};
|
};
|
||||||
// 生产环境
|
// 生产环境
|
||||||
const prod = {
|
const prod = {
|
||||||
|
im: "https://im-api.pickmall.cn",
|
||||||
common: "https://common-api.pickmall.cn",
|
common: "https://common-api.pickmall.cn",
|
||||||
buyer: "https://buyer-api.pickmall.cn",
|
buyer: "https://buyer-api.pickmall.cn",
|
||||||
};
|
};
|
||||||
@@ -28,6 +33,7 @@ api = prod;
|
|||||||
|
|
||||||
api.buyer += "/buyer";
|
api.buyer += "/buyer";
|
||||||
api.common += "/common";
|
api.common += "/common";
|
||||||
|
api.im += "/im";
|
||||||
export default {
|
export default {
|
||||||
...api,
|
...api,
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -6,14 +6,15 @@ export default {
|
|||||||
downloadLink: "https://pickmall.cn/download-page/index.html", //下载地址,下载app的地址
|
downloadLink: "https://pickmall.cn/download-page/index.html", //下载地址,下载app的地址
|
||||||
shareLink: "https://m-b2b2c.pickmall.cn", //分享地址,也就是在h5中默认的复制地址
|
shareLink: "https://m-b2b2c.pickmall.cn", //分享地址,也就是在h5中默认的复制地址
|
||||||
appid: "wx6f10f29075dc1b0b", //小程序唯一凭证,即 AppID,可在「微信公众平台 - 设置 - 开发设置」页中获得。(需要已经成为开发者,且帐号没有异常状态)
|
appid: "wx6f10f29075dc1b0b", //小程序唯一凭证,即 AppID,可在「微信公众平台 - 设置 - 开发设置」页中获得。(需要已经成为开发者,且帐号没有异常状态)
|
||||||
aMapKey: "d649892b3937a5ad20b76dacb2bcb5bd", //在高德中申请Web服务key
|
aMapKey: "1f78544934b66c9fbc0104117f663973", //在高德中申请Web服务key
|
||||||
scanAuthNavigation: ["https://m-b2b2c.pickmall.cn/"], //扫码认证跳转域名配置 会根据此处配置的路由进行跳转
|
scanAuthNavigation: ["https://m-b2b2c.pickmall.cn/"], //扫码认证跳转域名配置 会根据此处配置的路由进行跳转
|
||||||
iosAppId: "id1564638363", //AppStore的应用地址id 具体在分享->拷贝链接中查看
|
iosAppId: "id1564638363", //AppStore的应用地址id 具体在分享->拷贝链接中查看
|
||||||
logo: "https://lilishop-oss.oss-cn-beijing.aliyuncs.com/4c864e133c2944efad1f7282ac8a3b9e.png", //logo地址
|
logo: "https://lilishop-oss.oss-cn-beijing.aliyuncs.com/4c864e133c2944efad1f7282ac8a3b9e.png", //logo地址
|
||||||
customerServiceMobile: "13161366885", //客服电话
|
customerServiceMobile: "13161366885", //客服电话
|
||||||
customerServiceEmail: "lili@lili.com", //客服邮箱
|
customerServiceEmail: "lili@lili.com", //客服邮箱
|
||||||
imWebSrc: "https://im.pickmall.cn", //IM地址
|
imWebSrc: "https://im.pickmall.cn", //IM地址
|
||||||
enableGetClipboard: true, //是否启用粘贴板获取 scanAuthNavigation 中的链接,如果匹配则会跳转到对应页面
|
baseWsUrl: "wss://im-api.pickmall.cn/lili/webSocket", // IM WS 地址
|
||||||
|
enableGetClipboard: false, //是否启用粘贴板获取 scanAuthNavigation 中的链接,如果匹配则会跳转到对应页面
|
||||||
enableMiniBarStartUpApp: true, //是否在h5中右侧浮空按钮点击启动app
|
enableMiniBarStartUpApp: true, //是否在h5中右侧浮空按钮点击启动app
|
||||||
/**
|
/**
|
||||||
* 如需更换主题请修改此处以及uni.scss中的全局颜色
|
* 如需更换主题请修改此处以及uni.scss中的全局颜色
|
||||||
@@ -21,4 +22,6 @@ export default {
|
|||||||
mainColor: "#ff3c2a", // 主题色
|
mainColor: "#ff3c2a", // 主题色
|
||||||
lightColor: "#ff6b35", // 高亮主题色
|
lightColor: "#ff6b35", // 高亮主题色
|
||||||
aiderLightColor: "#ff9f28", // 辅助高亮颜色
|
aiderLightColor: "#ff9f28", // 辅助高亮颜色
|
||||||
|
defaultUserPhoto: "/static/missing-face.png", // 默认用户头像
|
||||||
|
enableFetchMobileLogin: false // 是否启用获取手机号登录 如果微信小程序提示封禁手机号获取权限 可将此选项设置成false作为备用登录方案
|
||||||
};
|
};
|
||||||
|
|||||||
77
js_sdk/t-jwt/jwt.js
Normal file
77
js_sdk/t-jwt/jwt.js
Normal file
@@ -0,0 +1,77 @@
|
|||||||
|
"use strict";
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
var b64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
|
||||||
|
var b64re = /^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/;
|
||||||
|
exports.weBtoa = function (string) {
|
||||||
|
string = String(string);
|
||||||
|
var bitmap, a, b, c, result = "", i = 0, rest = string.length % 3;
|
||||||
|
for (; i < string.length;) {
|
||||||
|
if ((a = string.charCodeAt(i++)) > 255 ||
|
||||||
|
(b = string.charCodeAt(i++)) > 255 ||
|
||||||
|
(c = string.charCodeAt(i++)) > 255)
|
||||||
|
throw new TypeError("Failed to execute 'btoa' on 'Window': The string to be encoded contains characters outside of the Latin1 range.");
|
||||||
|
bitmap = (a << 16) | (b << 8) | c;
|
||||||
|
result += b64.charAt(bitmap >> 18 & 63) + b64.charAt(bitmap >> 12 & 63) +
|
||||||
|
b64.charAt(bitmap >> 6 & 63) + b64.charAt(bitmap & 63);
|
||||||
|
}
|
||||||
|
return rest ? result.slice(0, rest - 3) + "===".substring(rest) : result;
|
||||||
|
};
|
||||||
|
exports.weAtob = function (string) {
|
||||||
|
string = String(string).replace(/[\t\n\f\r ]+/g, "");
|
||||||
|
if (!b64re.test(string))
|
||||||
|
throw new TypeError("Failed to execute 'atob' on 'Window': The string to be decoded is not correctly encoded.");
|
||||||
|
string += "==".slice(2 - (string.length & 3));
|
||||||
|
var bitmap, result = "", r1, r2, i = 0;
|
||||||
|
for (; i < string.length;) {
|
||||||
|
bitmap = b64.indexOf(string.charAt(i++)) << 18 | b64.indexOf(string.charAt(i++)) << 12 |
|
||||||
|
(r1 = b64.indexOf(string.charAt(i++))) << 6 | (r2 = b64.indexOf(string.charAt(i++)));
|
||||||
|
result += r1 === 64 ? String.fromCharCode(bitmap >> 16 & 255) :
|
||||||
|
r2 === 64 ? String.fromCharCode(bitmap >> 16 & 255, bitmap >> 8 & 255) :
|
||||||
|
String.fromCharCode(bitmap >> 16 & 255, bitmap >> 8 & 255, bitmap & 255);
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
};
|
||||||
|
function b64DecodeUnicode(str) {
|
||||||
|
return decodeURIComponent(exports.weAtob(str).replace(/(.)/g, function (p) {
|
||||||
|
var code = p.charCodeAt(0).toString(16).toUpperCase();
|
||||||
|
if (code.length < 2) {
|
||||||
|
code = "0" + code;
|
||||||
|
}
|
||||||
|
return "%" + code;
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
function base64_url_decode(str) {
|
||||||
|
var output = str.replace(/-/g, "+").replace(/_/g, "/");
|
||||||
|
switch (output.length % 4) {
|
||||||
|
case 0:
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
output += "==";
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
output += "=";
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
throw "Illegal base64url string!";
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
return b64DecodeUnicode(output);
|
||||||
|
}
|
||||||
|
catch (err) {
|
||||||
|
return exports.weAtob(output);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function weappJwtDecode(token, options) {
|
||||||
|
if (typeof token !== "string") {
|
||||||
|
throw ("Invalid token specified");
|
||||||
|
}
|
||||||
|
options = options || {};
|
||||||
|
var pos = options.header === true ? 0 : 1;
|
||||||
|
try {
|
||||||
|
return JSON.parse(base64_url_decode(token.split(".")[pos]));
|
||||||
|
}
|
||||||
|
catch (e) {
|
||||||
|
throw ("Invalid token specified: " + e.message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
exports.default = weappJwtDecode;
|
||||||
4
main.js
4
main.js
@@ -5,13 +5,14 @@ import uView from "uview-ui";
|
|||||||
import store from "./store";
|
import store from "./store";
|
||||||
import config from '@/config/config';
|
import config from '@/config/config';
|
||||||
import airBtn from "@/components/m-airbtn/index.vue";
|
import airBtn from "@/components/m-airbtn/index.vue";
|
||||||
|
import socketIO from './pages/mine/im/socket';
|
||||||
/**
|
/**
|
||||||
* 仅在h5中显示唤醒app功能
|
* 仅在h5中显示唤醒app功能
|
||||||
* 在h5页面手动挂载
|
* 在h5页面手动挂载
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
// #ifdef H5
|
// #ifdef H5
|
||||||
if(config.enableMiniBarStartUpApp){
|
if (config.enableMiniBarStartUpApp) {
|
||||||
let btn = Vue.component("airBtn", airBtn); //全局注册
|
let btn = Vue.component("airBtn", airBtn); //全局注册
|
||||||
document.body.appendChild(new btn().$mount().$el);
|
document.body.appendChild(new btn().$mount().$el);
|
||||||
}
|
}
|
||||||
@@ -31,6 +32,7 @@ Object.keys(filters).forEach((key) => {
|
|||||||
|
|
||||||
// 引入Vuex
|
// 引入Vuex
|
||||||
Vue.prototype.$store = store;
|
Vue.prototype.$store = store;
|
||||||
|
// Vue.prototype.socketIo = new socketIO();
|
||||||
Vue.use(uView);
|
Vue.use(uView);
|
||||||
Vue.config.productionTip = false;
|
Vue.config.productionTip = false;
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
{
|
{
|
||||||
"name" : "lili商城",
|
"name" : "lilishop",
|
||||||
"appid" : "__UNI__EC9FD60",
|
"appid" : "__UNI__ED807EA",
|
||||||
"description" : "",
|
"description" : "",
|
||||||
"versionName" : "4.2.7",
|
"versionName" : "4.5.3",
|
||||||
"versionCode" : 4000270,
|
"versionCode" : 4000503,
|
||||||
"transformPx" : false,
|
"transformPx" : false,
|
||||||
"app-plus" : {
|
"app-plus" : {
|
||||||
"compatible" : {
|
"compatible" : {
|
||||||
@@ -64,6 +64,7 @@
|
|||||||
],
|
],
|
||||||
"abiFilters" : [ "armeabi-v7a", "arm64-v8a", "x86" ],
|
"abiFilters" : [ "armeabi-v7a", "arm64-v8a", "x86" ],
|
||||||
"schemes" : "lilishop",
|
"schemes" : "lilishop",
|
||||||
|
//安卓自添加 权限 应用市场 过度索取权限
|
||||||
"permissionExternalStorage" : {
|
"permissionExternalStorage" : {
|
||||||
"request" : "none",
|
"request" : "none",
|
||||||
"prompt" : "应用保存运行状态等信息,需要获取读写手机存储(系统提示为访问设备上的照片、媒体内容和文件)权限,请允许。"
|
"prompt" : "应用保存运行状态等信息,需要获取读写手机存储(系统提示为访问设备上的照片、媒体内容和文件)权限,请允许。"
|
||||||
@@ -74,6 +75,7 @@
|
|||||||
},
|
},
|
||||||
"autoSdkPermissions" : false
|
"autoSdkPermissions" : false
|
||||||
},
|
},
|
||||||
|
//安卓自添加 权限 应用市场 过度索取权限
|
||||||
"ios" : {
|
"ios" : {
|
||||||
"idfa" : false,
|
"idfa" : false,
|
||||||
"privacyDescription" : {
|
"privacyDescription" : {
|
||||||
@@ -114,7 +116,7 @@
|
|||||||
},
|
},
|
||||||
"apple" : {},
|
"apple" : {},
|
||||||
"qq" : {
|
"qq" : {
|
||||||
"appid" : "101918503"
|
"appid" : "101918501"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"geolocation" : {
|
"geolocation" : {
|
||||||
@@ -209,7 +211,8 @@
|
|||||||
"version" : "1.3.0",
|
"version" : "1.3.0",
|
||||||
"provider" : "wx2b03c6e691cd7370"
|
"provider" : "wx2b03c6e691cd7370"
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
"requiredPrivateInfos" : [ "chooseLocation", "getLocation" ]
|
||||||
},
|
},
|
||||||
"h5" : {
|
"h5" : {
|
||||||
"devServer" : {
|
"devServer" : {
|
||||||
|
|||||||
42
pages.json
42
pages.json
@@ -225,6 +225,13 @@
|
|||||||
"navigationBarTitleText": "地址管理"
|
"navigationBarTitleText": "地址管理"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"path": "address/storeAddress",
|
||||||
|
"style": {
|
||||||
|
"enablePullDownRefresh": true,
|
||||||
|
"navigationBarTitleText": "自提点"
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"path": "address/add",
|
"path": "address/add",
|
||||||
"style": {
|
"style": {
|
||||||
@@ -268,7 +275,26 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
"path": "im/list",
|
||||||
|
"style": {
|
||||||
|
"navigationStyle": "custom", // 隐藏系统导航栏
|
||||||
|
"enablePullDownRefresh": true,
|
||||||
|
"app-plus": {
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "im/index",
|
||||||
|
"style": {
|
||||||
|
"navigationStyle": "custom", // 隐藏系统导航栏
|
||||||
|
"enablePullDownRefresh": true,
|
||||||
|
"app-plus": {
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"path": "set/feedBack",
|
"path": "set/feedBack",
|
||||||
"style": {
|
"style": {
|
||||||
@@ -427,6 +453,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
]
|
]
|
||||||
|
|
||||||
},
|
},
|
||||||
@@ -456,6 +483,21 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
"path": "entry/seller/index",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "店铺入驻",
|
||||||
|
"navigationStyle": "custom"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "entry/seller/control",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "",
|
||||||
|
"navigationStyle": "custom"
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"path": "article",
|
"path": "article",
|
||||||
"style": {
|
"style": {
|
||||||
|
|||||||
@@ -25,7 +25,7 @@
|
|||||||
<!-- 根据scopeType 判断是否是 平台、品类或店铺 -->
|
<!-- 根据scopeType 判断是否是 平台、品类或店铺 -->
|
||||||
<view class="coupon-title wes-3" v-if="item.scopeType">
|
<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 == 'ALL' && item.storeId == '0'">全平台</span>
|
||||||
<span v-if="item.scopeType == 'PORTION_CATEGORY'">仅限品类</span>
|
<span v-if="item.scopeType == 'PORTION_GOODS_CATEGORY'">仅限品类</span>
|
||||||
<view v-else>{{ item.storeName == 'platform' ? '全平台' :item.storeName+'店铺' }}使用
|
<view v-else>{{ item.storeName == 'platform' ? '全平台' :item.storeName+'店铺' }}使用
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -98,7 +98,7 @@
|
|||||||
}) : "",
|
}) : "",
|
||||||
getAllCoupons(submitData)
|
getAllCoupons(submitData)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
uni.hideLoading();
|
if (this.$store.state.isShowToast){ uni.hideLoading() };
|
||||||
uni.stopPullDownRefresh();
|
uni.stopPullDownRefresh();
|
||||||
if (res.data.code == 200) {
|
if (res.data.code == 200) {
|
||||||
// 如果请求成功,展示数据并进行展示
|
// 如果请求成功,展示数据并进行展示
|
||||||
@@ -113,14 +113,21 @@
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
uni.hideLoading();
|
if (this.$store.state.isShowToast){ uni.hideLoading() };
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* 领取优惠券
|
* 领取优惠券
|
||||||
*/
|
*/
|
||||||
receive(item) {
|
receive(val) {
|
||||||
receiveCoupons(item.id).then((res) => {
|
this.$u.throttle(()=>{
|
||||||
|
this.fetchCoupon(val)
|
||||||
|
}, 1500)
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
fetchCoupon(val){
|
||||||
|
receiveCoupons(val.id).then((res) => {
|
||||||
if (res.data.code == 200) {
|
if (res.data.code == 200) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: "领取成功",
|
title: "领取成功",
|
||||||
@@ -134,6 +141,7 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 加载更多
|
* 加载更多
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -3,7 +3,8 @@
|
|||||||
<view class="body">
|
<view class="body">
|
||||||
<view class="top-view">
|
<view class="top-view">
|
||||||
<view class="title">{{coupon.title}}</view>
|
<view class="title">{{coupon.title}}</view>
|
||||||
<view class="price"><text>¥</text>{{coupon.price | unitPrice}}</view>
|
<view class="price" v-if="coupon.couponType =='PRICE'"><text>¥</text>{{coupon.price | unitPrice}}</view>
|
||||||
|
<view class="price" v-if="coupon.couponType =='DISCOUNT'">{{coupon.discount}}折</view>
|
||||||
<view class="text">满{{coupon.consumeThreshold}}元可用</view>
|
<view class="text">满{{coupon.consumeThreshold}}元可用</view>
|
||||||
<view class="bg-quan">
|
<view class="bg-quan">
|
||||||
券
|
券
|
||||||
@@ -13,7 +14,7 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="bottom-view">
|
<view class="bottom-view">
|
||||||
<view class="text">• 使用平台:{{
|
<view class="text">• 使用范围:{{
|
||||||
coupon.scopeType == 'ALL' && coupon.storeId == '0'
|
coupon.scopeType == 'ALL' && coupon.storeId == '0'
|
||||||
? "全平台"
|
? "全平台"
|
||||||
: coupon.scopeType == "PORTION_CATEGORY"
|
: coupon.scopeType == "PORTION_CATEGORY"
|
||||||
|
|||||||
@@ -35,7 +35,7 @@
|
|||||||
<view class="desc">
|
<view class="desc">
|
||||||
<view v-if="item.scopeType">
|
<view v-if="item.scopeType">
|
||||||
<span v-if="item.scopeType == 'ALL' && item.storeId == '0'">全平台</span>
|
<span v-if="item.scopeType == 'ALL' && item.storeId == '0'">全平台</span>
|
||||||
<span v-if="item.scopeType == 'PORTION_CATEGORY'">仅限品类</span>
|
<span v-if="item.scopeType == 'PORTION_GOODS_CATEGORY'">仅限品类</span>
|
||||||
<view v-else
|
<view v-else
|
||||||
>{{
|
>{{
|
||||||
item.storeName == "platform" ? "全平台" : item.storeName + "店铺"
|
item.storeName == "platform" ? "全平台" : item.storeName + "店铺"
|
||||||
|
|||||||
@@ -2,28 +2,63 @@
|
|||||||
<view class="b-content">
|
<view class="b-content">
|
||||||
<view class="navbar">
|
<view class="navbar">
|
||||||
<!-- 循环出头部tab栏 -->
|
<!-- 循环出头部tab栏 -->
|
||||||
<view v-for="(item, index) in navList" :key="index" class="nav-item" @click="handleTabClick(index)"><text
|
<view
|
||||||
:class="{ current: tabCurrentIndex === index }">{{
|
v-for="(item, index) in navList"
|
||||||
|
:key="index"
|
||||||
|
class="nav-item"
|
||||||
|
@click="handleTabClick(index)"
|
||||||
|
><text :class="{ current: tabCurrentIndex === index }">{{
|
||||||
item.text
|
item.text
|
||||||
}}</text></view>
|
}}</text></view
|
||||||
|
>
|
||||||
</view>
|
</view>
|
||||||
<swiper :current="tabCurrentIndex" class="swiper-box" duration="300" @change="changeTab">
|
<swiper
|
||||||
<swiper-item class="tab-content" v-for="(navItem, navIndex) in navList" :key="navIndex">
|
:current="tabCurrentIndex"
|
||||||
<scroll-view class="list-scroll-content" scroll-y @scrolltolower="loadData">
|
class="swiper-box"
|
||||||
|
duration="300"
|
||||||
|
@change="changeTab"
|
||||||
|
>
|
||||||
|
<swiper-item
|
||||||
|
class="tab-content"
|
||||||
|
v-for="(navItem, navIndex) in navList"
|
||||||
|
:key="navIndex"
|
||||||
|
>
|
||||||
|
<scroll-view
|
||||||
|
class="list-scroll-content"
|
||||||
|
scroll-y
|
||||||
|
@scrolltolower="loadData"
|
||||||
|
>
|
||||||
<!-- 空白页 -->
|
<!-- 空白页 -->
|
||||||
<u-empty mode="coupon" text="暂无优惠券了" v-if="navItem.wheterEmpty"></u-empty>
|
<u-empty
|
||||||
|
mode="coupon"
|
||||||
|
text="暂无优惠券了"
|
||||||
|
v-if="navItem.whetherEmpty"
|
||||||
|
></u-empty>
|
||||||
|
|
||||||
<!-- 数据 -->
|
<!-- 数据 -->
|
||||||
<view v-if="navItem.dataList && coupon" class="coupon-item" :class="{ 'coupon-used': navIndex != 0 }"
|
<view
|
||||||
v-for="(coupon, index) in navItem.dataList" :key="index">
|
v-if="navItem.dataList && coupon"
|
||||||
|
class="coupon-item"
|
||||||
|
:class="{ 'coupon-used': navIndex != 0 }"
|
||||||
|
v-for="(coupon, index) in navItem.dataList"
|
||||||
|
:key="index"
|
||||||
|
>
|
||||||
<view class="left">
|
<view class="left">
|
||||||
<view class="wave-line">
|
<view class="wave-line">
|
||||||
<view class="wave" v-for="(item, index) in 12" :key="index"></view>
|
<view
|
||||||
|
class="wave"
|
||||||
|
v-for="(item, index) in 12"
|
||||||
|
:key="index"
|
||||||
|
></view>
|
||||||
</view>
|
</view>
|
||||||
<view class="message">
|
<view class="message">
|
||||||
<view class="price" v-if="coupon.couponType == 'DISCOUNT'">{{ coupon.discount }}折</view>
|
<view class="price" v-if="coupon.couponType == 'DISCOUNT'"
|
||||||
|
>{{ coupon.discount }}折</view
|
||||||
|
>
|
||||||
<view class="price" v-else>{{ coupon.price }}元</view>
|
<view class="price" v-else>{{ coupon.price }}元</view>
|
||||||
<view class="sub-price">满{{ coupon.consumeThreshold | unitPrice }}可用</view>
|
<view class="sub-price"
|
||||||
|
>满{{ coupon.consumeThreshold | unitPrice }}可用</view
|
||||||
|
>
|
||||||
</view>
|
</view>
|
||||||
<view class="circle circle-top"></view>
|
<view class="circle circle-top"></view>
|
||||||
<view class="circle circle-bottom"></view>
|
<view class="circle circle-bottom"></view>
|
||||||
@@ -31,27 +66,47 @@
|
|||||||
<view class="right" v-if="coupon">
|
<view class="right" v-if="coupon">
|
||||||
<view class="content">
|
<view class="content">
|
||||||
<view class="title-1">{{ coupon.title }}</view>
|
<view class="title-1">{{ coupon.title }}</view>
|
||||||
<view class="title-2">使用平台:{{
|
<view class="title-2"
|
||||||
coupon.scopeType == 'ALL' && coupon.storeId == '0'
|
>使用范围:{{
|
||||||
|
coupon.scopeType == "ALL" && coupon.storeId == "0"
|
||||||
? "全平台"
|
? "全平台"
|
||||||
: coupon.scopeType == "PORTION_CATEGORY"
|
: coupon.scopeType == "PORTION_CATEGORY"
|
||||||
? "仅限品类"
|
? "仅限品类"
|
||||||
: coupon.storeName == 'platform' ? '全平台' :coupon.storeName+''
|
: coupon.storeName == "platform"
|
||||||
}}使用</view>
|
? "全平台"
|
||||||
<view v-if="coupon.endTime">{{
|
: coupon.storeName + ""
|
||||||
coupon.endTime
|
}}使用</view
|
||||||
}}</view>
|
>
|
||||||
<view @click="couponDetail(coupon)">详细说明
|
<view v-if="coupon.endTime">{{ coupon.endTime }}</view>
|
||||||
<u-icon style="float: right; margin-top: 10rpx" name="arrow-right"></u-icon>
|
<view @click="couponDetail(coupon)"
|
||||||
|
>详细说明
|
||||||
|
<u-icon
|
||||||
|
style="float: right; margin-top: 10rpx"
|
||||||
|
name="arrow-right"
|
||||||
|
></u-icon>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="jiao-1" v-if="navIndex == 0">
|
<view class="jiao-1" v-if="navIndex == 0">
|
||||||
<text class="text-1">新到</text>
|
<text class="text-1">新到</text>
|
||||||
<text class="text-2" v-if="coupon.used_status == 1">将过期</text>
|
<text class="text-2" v-if="coupon.used_status == 1"
|
||||||
|
>将过期</text
|
||||||
|
>
|
||||||
</view>
|
</view>
|
||||||
<image class="no-icon" v-if="navIndex == 1" src="@/static/img/used.png"></image>
|
<image
|
||||||
<image class="no-icon" v-if="navIndex == 2" src="@/static/img/overdue.png"></image>
|
class="no-icon"
|
||||||
<view class="receive" v-if="navIndex == 0" @click="useItNow(coupon)">
|
v-if="navIndex == 1"
|
||||||
|
src="@/static/img/used.png"
|
||||||
|
></image>
|
||||||
|
<image
|
||||||
|
class="no-icon"
|
||||||
|
v-if="navIndex == 2"
|
||||||
|
src="@/static/img/overdue.png"
|
||||||
|
></image>
|
||||||
|
<view
|
||||||
|
class="receive"
|
||||||
|
v-if="navIndex == 0"
|
||||||
|
@click="useItNow(coupon)"
|
||||||
|
>
|
||||||
<text>立即</text><br />
|
<text>立即</text><br />
|
||||||
<text>使用</text>
|
<text>使用</text>
|
||||||
</view>
|
</view>
|
||||||
@@ -84,7 +139,7 @@ export default {
|
|||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
status: 1,
|
status: 1,
|
||||||
},
|
},
|
||||||
wheterEmpty: false,
|
whetherEmpty: false,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
text: "已使用",
|
text: "已使用",
|
||||||
@@ -96,7 +151,7 @@ export default {
|
|||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
status: 2,
|
status: 2,
|
||||||
},
|
},
|
||||||
wheterEmpty: false,
|
whetherEmpty: false,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
text: "已过期",
|
text: "已过期",
|
||||||
@@ -108,7 +163,7 @@ export default {
|
|||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
status: 3,
|
status: 3,
|
||||||
},
|
},
|
||||||
wheterEmpty: false,
|
whetherEmpty: false,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
couponList: [], //优惠券列表
|
couponList: [], //优惠券列表
|
||||||
@@ -116,7 +171,7 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
onShow() {
|
onShow() {
|
||||||
this.navList[this.tabCurrentIndex].params.pageNumber = 1
|
this.navList[this.tabCurrentIndex].params.pageNumber = 1;
|
||||||
this.navList[this.tabCurrentIndex].dataList = [];
|
this.navList[this.tabCurrentIndex].dataList = [];
|
||||||
this.getData();
|
this.getData();
|
||||||
},
|
},
|
||||||
@@ -151,7 +206,7 @@ export default {
|
|||||||
let data = res.data.result.records;
|
let data = res.data.result.records;
|
||||||
if (data.length == 0) {
|
if (data.length == 0) {
|
||||||
if (res.data.pageNumber == 1) {
|
if (res.data.pageNumber == 1) {
|
||||||
this.navList[index].wheterEmpty = true;
|
this.navList[index].whetherEmpty = true;
|
||||||
} else {
|
} else {
|
||||||
this.navList[index].loadStatus = "noMore";
|
this.navList[index].loadStatus = "noMore";
|
||||||
}
|
}
|
||||||
@@ -162,7 +217,7 @@ export default {
|
|||||||
this.navList[index].dataList.push(...data);
|
this.navList[index].dataList.push(...data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
uni.hideLoading();
|
if (this.$store.state.isShowToast){ uni.hideLoading() };
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -188,15 +243,9 @@ export default {
|
|||||||
* 立即使用优惠券
|
* 立即使用优惠券
|
||||||
*/
|
*/
|
||||||
useItNow(item) {
|
useItNow(item) {
|
||||||
if (item.storeId && item.storeId!='0') {
|
uni.navigateTo({
|
||||||
uni.navigateTo({
|
url: `/pages/navigation/search/searchPage?promotionsId=${item.couponId}&promotionType=COUPON`,
|
||||||
url: `/pages/product/shopPage?id=${item.storeId}`,
|
});
|
||||||
});
|
|
||||||
} else {
|
|
||||||
uni.switchTab({
|
|
||||||
url: "/pages/navigation/search/searchPage",
|
|
||||||
});
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -244,7 +244,7 @@
|
|||||||
// 初始化支付签名
|
// 初始化支付签名
|
||||||
await API_Trade.initiatePay(paymentMethod, paymentClient, params).then(
|
await API_Trade.initiatePay(paymentMethod, paymentClient, params).then(
|
||||||
(signXml) => {
|
(signXml) => {
|
||||||
uni.hideLoading();
|
if (this.$store.state.isShowToast){ uni.hideLoading() };
|
||||||
//如果支付异常
|
//如果支付异常
|
||||||
if (!signXml.data.success) {
|
if (!signXml.data.success) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
@@ -334,8 +334,25 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
if (this.$store.state.isShowToast){ uni.hideLoading() };
|
||||||
} else {
|
} else {
|
||||||
window.location.href = JSON.parse(response.result).h5_url;
|
window.location.href = JSON.parse(response.result).h5_url;
|
||||||
|
const searchParams = {
|
||||||
|
...params,
|
||||||
|
price:this.cashierParams,
|
||||||
|
}
|
||||||
|
const timer = setInterval(()=>{
|
||||||
|
payCallback(searchParams).then(res=>{
|
||||||
|
if(res.data.result){
|
||||||
|
clearTimeout(timer);
|
||||||
|
uni.navigateTo({
|
||||||
|
url:"/pages/order/myOrder"
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},3000)
|
||||||
|
|
||||||
|
if (this.$store.state.isShowToast){ uni.hideLoading() };
|
||||||
}
|
}
|
||||||
} else if (paymentMethod === "WALLET") {
|
} else if (paymentMethod === "WALLET") {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="wrapper" v-if="flage">
|
<view class="wrapper" v-if="flag">
|
||||||
<div class='goods' v-if="selectedGoods">
|
<div class='goods' v-if="selectedGoods">
|
||||||
<image class="goods-image" :src="selectedGoods.thumbnail" alt="">
|
<image class="goods-image" :src="selectedGoods.thumbnail" alt="">
|
||||||
<p class="goodsName">{{selectedGoods.goodsName}}</p>
|
<p class="goodsName">{{selectedGoods.goodsName}}</p>
|
||||||
@@ -58,7 +58,7 @@
|
|||||||
|
|
||||||
<popupGoods :addr="addr" ref="popupGoods" :buyMask="maskFlag" @closeBuy="closePopupBuy" :goodsDetail="goodsDetail" :goodsSpec="goodsSpec" v-if="goodsDetail.id " @handleClickSku="getGoodsDetail" />
|
<popupGoods :addr="addr" ref="popupGoods" :buyMask="maskFlag" @closeBuy="closePopupBuy" :goodsDetail="goodsDetail" :goodsSpec="goodsSpec" v-if="goodsDetail.id " @handleClickSku="getGoodsDetail" />
|
||||||
<shares @close="closeShare" :link="'/pages/cart/payment/shareOrderGoods?sn='+this.routers.sn+'&sku='+this.routers.sku+'&goodsId='+this.routers.goodsId" type="pintuan"
|
<shares @close="closeShare" :link="'/pages/cart/payment/shareOrderGoods?sn='+this.routers.sn+'&sku='+this.routers.sku+'&goodsId='+this.routers.goodsId" type="pintuan"
|
||||||
:thumbnail="data.promotionGoods.thumbnail" :goodsName="data.promotionGoods.goodsName" v-if="shareFlage " />
|
:thumbnail="data.promotionGoods.thumbnail" :goodsName="data.promotionGoods.goodsName" v-if="shareFlag " />
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -72,13 +72,13 @@ import popupGoods from "@/components/m-buy/goods"; //购物车商品的模块
|
|||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
flage: false, //判断接口是否正常请求
|
flag: false, //判断接口是否正常请求
|
||||||
addr: {
|
addr: {
|
||||||
id: "",
|
id: "",
|
||||||
},
|
},
|
||||||
maskFlag: false, //商品弹框
|
maskFlag: false, //商品弹框
|
||||||
timeStamp: 0,
|
timeStamp: 0,
|
||||||
shareFlage: false,
|
shareFlag: false,
|
||||||
data: "",
|
data: "",
|
||||||
isMaster: true,
|
isMaster: true,
|
||||||
selectedGoods: "", //选择的商品规格昵称
|
selectedGoods: "", //选择的商品规格昵称
|
||||||
@@ -116,7 +116,7 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
closeShare() {
|
closeShare() {
|
||||||
this.shareFlage = false;
|
this.shareFlag = false;
|
||||||
},
|
},
|
||||||
// 这里的话得先跳到商品详情才能购买商品
|
// 这里的话得先跳到商品详情才能购买商品
|
||||||
toBuy() {
|
toBuy() {
|
||||||
@@ -131,7 +131,7 @@ export default {
|
|||||||
},
|
},
|
||||||
// 分享
|
// 分享
|
||||||
share() {
|
share() {
|
||||||
this.shareFlage = true;
|
this.shareFlag = true;
|
||||||
},
|
},
|
||||||
closePopupBuy(val) {
|
closePopupBuy(val) {
|
||||||
this.maskFlag = false;
|
this.maskFlag = false;
|
||||||
@@ -140,7 +140,7 @@ export default {
|
|||||||
async init(sn, sku) {
|
async init(sn, sku) {
|
||||||
let res = await getPinTuanShare(sn, sku);
|
let res = await getPinTuanShare(sn, sku);
|
||||||
if (res.data.success && res.data.result.promotionGoods) {
|
if (res.data.success && res.data.result.promotionGoods) {
|
||||||
this.flage = true;
|
this.flag = true;
|
||||||
this.data = res.data.result;
|
this.data = res.data.result;
|
||||||
this.selectedGoods = res.data.result.promotionGoods;
|
this.selectedGoods = res.data.result.promotionGoods;
|
||||||
let endTime = Date.parse(
|
let endTime = Date.parse(
|
||||||
@@ -204,7 +204,7 @@ export default {
|
|||||||
this.goodsDetail = response.data.result.data;
|
this.goodsDetail = response.data.result.data;
|
||||||
this.selectedGoods = response.data.result.data;
|
this.selectedGoods = response.data.result.data;
|
||||||
this.goodsSpec = response.data.result.specs;
|
this.goodsSpec = response.data.result.specs;
|
||||||
uni.hideLoading();
|
if (this.$store.state.isShowToast){ uni.hideLoading() };
|
||||||
this.PromotionList = response.data.result.promotionMap;
|
this.PromotionList = response.data.result.promotionMap;
|
||||||
|
|
||||||
// 判断是否拼团活动 如果有则显示拼团活动信息
|
// 判断是否拼团活动 如果有则显示拼团活动信息
|
||||||
|
|||||||
@@ -33,18 +33,18 @@
|
|||||||
<m-city :provinceData="list" headTitle="区域选择" ref="cityPicker" @funcValue="getpickerParentValue" pickerSize="4">
|
<m-city :provinceData="list" headTitle="区域选择" ref="cityPicker" @funcValue="getpickerParentValue" pickerSize="4">
|
||||||
</m-city>
|
</m-city>
|
||||||
|
|
||||||
<uniMap v-if="mapFlage" @close="closeMap" @callback="callBackAddress" />
|
<uniMap v-if="mapFlag" @close="closeMap" @callback="callBackAddress" />
|
||||||
</div>
|
</div>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import { addAddress, editAddress, getAddressDetail } from "@/api/address.js";
|
import { addAddress, editAddress, getAddressDetail } from "@/api/address.js";
|
||||||
import gkcity from "@/components/m-city/m-city.vue";
|
import city from "@/components/m-city/m-city.vue";
|
||||||
import uniMap from "./uniMap";
|
import uniMap from "@/components/uniMap";
|
||||||
import permision from "@/js_sdk/wa-permission/permission.js";
|
import permision from "@/js_sdk/wa-permission/permission.js";
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
"m-city": gkcity,
|
"m-city": city,
|
||||||
uniMap,
|
uniMap,
|
||||||
},
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
@@ -53,7 +53,7 @@ export default {
|
|||||||
methods: {
|
methods: {
|
||||||
// 关闭地图
|
// 关闭地图
|
||||||
closeMap() {
|
closeMap() {
|
||||||
this.mapFlage = false;
|
this.mapFlag = false;
|
||||||
},
|
},
|
||||||
// 打开地图并访问权限
|
// 打开地图并访问权限
|
||||||
clickUniMap() {
|
clickUniMap() {
|
||||||
@@ -61,8 +61,8 @@ export default {
|
|||||||
if (plus.os.name == "iOS") {
|
if (plus.os.name == "iOS") {
|
||||||
// ios系统
|
// ios系统
|
||||||
permision.judgeIosPermission("location")
|
permision.judgeIosPermission("location")
|
||||||
? (this.mapFlage = true)
|
? (this.mapFlag = true)
|
||||||
: this.refuseMapOuther();
|
: this.refuseMap();
|
||||||
} else {
|
} else {
|
||||||
// 安卓
|
// 安卓
|
||||||
this.requestAndroidPermission(
|
this.requestAndroidPermission(
|
||||||
@@ -72,12 +72,12 @@ export default {
|
|||||||
// #endif
|
// #endif
|
||||||
|
|
||||||
// #ifndef APP-PLUS
|
// #ifndef APP-PLUS
|
||||||
this.mapFlage = true;
|
this.mapFlag = true;
|
||||||
// #endif
|
// #endif
|
||||||
},
|
},
|
||||||
|
|
||||||
// 如果拒绝权限 提示区设置
|
// 如果拒绝权限 提示区设置
|
||||||
refuseMapOuther() {
|
refuseMap() {
|
||||||
uni.showModal({
|
uni.showModal({
|
||||||
title: "温馨提示",
|
title: "温馨提示",
|
||||||
content: "您已拒绝定位,请开启",
|
content: "您已拒绝定位,请开启",
|
||||||
@@ -113,14 +113,15 @@ export default {
|
|||||||
var result = await permision.requestAndroidPermission(permisionID);
|
var result = await permision.requestAndroidPermission(permisionID);
|
||||||
|
|
||||||
if (result == 1) {
|
if (result == 1) {
|
||||||
this.mapFlage = true;
|
this.mapFlag = true;
|
||||||
} else {
|
} else {
|
||||||
this.refuseMapOuther();
|
this.refuseMap();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
// 选择地址后数据的回调
|
// 选择地址后数据的回调
|
||||||
callBackAddress(val) {
|
callBackAddress(val) {
|
||||||
|
console.log(val)
|
||||||
uni.showLoading({
|
uni.showLoading({
|
||||||
title: "加载中",
|
title: "加载中",
|
||||||
});
|
});
|
||||||
@@ -133,10 +134,10 @@ export default {
|
|||||||
this.form.consigneeAddressPath = val.data.result.name; //地址名称, ','分割
|
this.form.consigneeAddressPath = val.data.result.name; //地址名称, ','分割
|
||||||
this.form.lat = val.latitude; //纬度
|
this.form.lat = val.latitude; //纬度
|
||||||
this.form.lon = val.longitude; //经度
|
this.form.lon = val.longitude; //经度
|
||||||
uni.hideLoading();
|
uni.hideLoading();
|
||||||
}
|
}
|
||||||
|
|
||||||
this.mapFlage = !this.mapFlage; //关闭地图
|
this.mapFlag = !this.mapFlag; //关闭地图
|
||||||
},
|
},
|
||||||
|
|
||||||
// 保存当前 地址
|
// 保存当前 地址
|
||||||
@@ -206,7 +207,7 @@ export default {
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
lightColor: this.$lightColor, //高亮颜色
|
lightColor: this.$lightColor, //高亮颜色
|
||||||
mapFlage: false, // 地图选择开
|
mapFlag: false, // 地图选择开
|
||||||
routerVal: "",
|
routerVal: "",
|
||||||
form: {
|
form: {
|
||||||
detail: "", //地址详情
|
detail: "", //地址详情
|
||||||
@@ -276,10 +277,10 @@ export default {
|
|||||||
params.___path = params.consigneeAddressPath;
|
params.___path = params.consigneeAddressPath;
|
||||||
this.$set(this, "form", params);
|
this.$set(this, "form", params);
|
||||||
|
|
||||||
uni.hideLoading();
|
if (this.$store.state.isShowToast){ uni.hideLoading() };
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
uni.hideLoading();
|
uni.hideLoading();
|
||||||
},
|
},
|
||||||
// 初始化rules必须要在onReady生命周期,因为onLoad生命周期组件可能尚未创建完毕
|
// 初始化rules必须要在onReady生命周期,因为onLoad生命周期组件可能尚未创建完毕
|
||||||
onReady() {
|
onReady() {
|
||||||
|
|||||||
@@ -101,7 +101,7 @@ export default {
|
|||||||
this.addressList = res.data.result.records;
|
this.addressList = res.data.result.records;
|
||||||
console.log(this.addressList);
|
console.log(this.addressList);
|
||||||
|
|
||||||
uni.hideLoading();
|
if (this.$store.state.isShowToast){ uni.hideLoading() };
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
//删除地址
|
//删除地址
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="address">
|
<view class="address">
|
||||||
<u-empty class="empty" v-if="this.addressList == 0" text="暂无收货地址" mode="address"></u-empty>
|
<u-empty class="empty" v-if="this.addressList.length === 0" text="暂无收货地址" mode="address"></u-empty>
|
||||||
<view class="list" >
|
<view class="list" >
|
||||||
<view class="item c-content" v-for="(item, index) in addressList" :key="index">
|
<view class="item c-content" v-for="(item, index) in addressList" :key="index">
|
||||||
<view class="basic">
|
<view class="basic">
|
||||||
@@ -103,7 +103,7 @@ export default {
|
|||||||
});
|
});
|
||||||
this.addressList = res.data.result.records;
|
this.addressList = res.data.result.records;
|
||||||
|
|
||||||
uni.hideLoading();
|
if (this.$store.state.isShowToast){ uni.hideLoading() };
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
//删除地址
|
//删除地址
|
||||||
|
|||||||
88
pages/mine/address/storeAddress.vue
Normal file
88
pages/mine/address/storeAddress.vue
Normal file
@@ -0,0 +1,88 @@
|
|||||||
|
<template>
|
||||||
|
<view class="address">
|
||||||
|
|
||||||
|
<u-empty class="empty" v-if="storeAddressList.length == 0" text="暂无自提地址" mode="address"></u-empty>
|
||||||
|
<view class="list" v-else>
|
||||||
|
<view class="item c-content" v-for="(item, index) in storeAddressList" :key="index">
|
||||||
|
<view class="basic" @click="selectAddressData(item)">
|
||||||
|
<text>{{ item.addressName }}</text>
|
||||||
|
<text>{{ item.mobile }}</text>
|
||||||
|
<view>
|
||||||
|
<div class="region">
|
||||||
|
<span>{{ item.address }}</span>
|
||||||
|
</div>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view style="height: 100px"></view>
|
||||||
|
</view>
|
||||||
|
<u-action-sheet :list="removeList" :tips="tips" v-model="showAction" @click="deleteAddressMessage"></u-action-sheet>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import * as API_Trade from "@/api/trade";
|
||||||
|
import * as API_Store from "@/api/store.js";
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
storeAddressList: [], //地址列表
|
||||||
|
showAction: false, //是否显示下栏框
|
||||||
|
removeList: [
|
||||||
|
{
|
||||||
|
text: "确定",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
tips: {
|
||||||
|
text: "确定要删除该收货人信息吗?",
|
||||||
|
},
|
||||||
|
removeId: "", //删除的地址id
|
||||||
|
routerVal: "",
|
||||||
|
params: {
|
||||||
|
pageNumber: 1,
|
||||||
|
pageSize: 1000,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
},
|
||||||
|
onPullDownRefresh() {
|
||||||
|
//下拉刷新
|
||||||
|
this.storeAddressList = [];
|
||||||
|
this.getAddressList();
|
||||||
|
},
|
||||||
|
onLoad: function (val) {
|
||||||
|
this.routerVal = val;
|
||||||
|
},
|
||||||
|
onShow() {
|
||||||
|
this.storeAddressList = [];
|
||||||
|
this.getAddressList();
|
||||||
|
},
|
||||||
|
onHide() {},
|
||||||
|
methods: {
|
||||||
|
async selectAddressData(val) {
|
||||||
|
await API_Trade.setStoreAddressId(val.id, this.routerVal.way);
|
||||||
|
|
||||||
|
uni.navigateBack({
|
||||||
|
delta: 1,
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//获取地址列表
|
||||||
|
getAddressList() {
|
||||||
|
uni.showLoading();
|
||||||
|
|
||||||
|
API_Store.getStoreAddress(
|
||||||
|
this.routerVal.storeId,
|
||||||
|
this.params
|
||||||
|
).then((res) => {
|
||||||
|
this.storeAddressList = res.data.result.records;
|
||||||
|
console.log(this.storeAddressList);
|
||||||
|
|
||||||
|
if (this.$store.state.isShowToast){ uni.hideLoading() };
|
||||||
|
});
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
@import "./address.scss";
|
||||||
|
</style>
|
||||||
@@ -14,7 +14,7 @@
|
|||||||
<swiper class="swiper-box" :current="swiperCurrent">
|
<swiper class="swiper-box" :current="swiperCurrent">
|
||||||
<swiper-item class="swiper-item" v-for="index in list.length" :key="index">
|
<swiper-item class="swiper-item" v-for="index in list.length" :key="index">
|
||||||
<scroll-view class="scroll-v view-wrapper" enableBackToTop="true" scroll-with-animation scroll-y @scrolltolower="loadMore">
|
<scroll-view class="scroll-v view-wrapper" enableBackToTop="true" scroll-with-animation scroll-y @scrolltolower="loadMore">
|
||||||
<view v-if="datas.length!=0" class="view-item" v-for="(logItem, logIndex) in datas" :key="logIndex">
|
<view v-if="depositData.length!=0" class="view-item" v-for="(logItem, logIndex) in depositData" :key="logIndex">
|
||||||
<view class="view-item-detail">
|
<view class="view-item-detail">
|
||||||
<view class="-title">{{logItem.detail}}</view>
|
<view class="-title">{{logItem.detail}}</view>
|
||||||
<!-- <view class="-number">{{logItem.detail}}</view> -->
|
<!-- <view class="-number">{{logItem.detail}}</view> -->
|
||||||
@@ -27,7 +27,7 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<u-empty v-if="datas.length==0" mode="history" text="暂无记录" />
|
<u-empty v-if="depositData.length==0" mode="history" text="暂无记录" />
|
||||||
|
|
||||||
</scroll-view>
|
</scroll-view>
|
||||||
|
|
||||||
@@ -45,7 +45,6 @@ export default {
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
walletNum: 0,
|
walletNum: 0,
|
||||||
|
|
||||||
current: 0,
|
current: 0,
|
||||||
swiperCurrent: 0,
|
swiperCurrent: 0,
|
||||||
userInfo: "", //用户详情信息
|
userInfo: "", //用户详情信息
|
||||||
@@ -54,7 +53,7 @@ export default {
|
|||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
order: "desc",
|
order: "desc",
|
||||||
},
|
},
|
||||||
datas: [], //遍历的数据集合
|
depositData: [], //遍历的数据集合
|
||||||
rechargeList: "", //充值明细列表
|
rechargeList: "", //充值明细列表
|
||||||
walletLogList: "", //钱包变动列表
|
walletLogList: "", //钱包变动列表
|
||||||
list: [
|
list: [
|
||||||
@@ -82,12 +81,10 @@ export default {
|
|||||||
|
|
||||||
/**分页获取预存款充值记录 */
|
/**分页获取预存款充值记录 */
|
||||||
getRecharge() {
|
getRecharge() {
|
||||||
|
|
||||||
getUserRecharge(this.params).then((res) => {
|
getUserRecharge(this.params).then((res) => {
|
||||||
if (res.data.success) {
|
if (res.data.success) {
|
||||||
if (res.data.result.records.length != 0) {
|
if (res.data.result.records.length != 0) {
|
||||||
|
this.depositData.push(...res.data.result.records);
|
||||||
this.datas.push(...res.data.result.records);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -98,7 +95,7 @@ export default {
|
|||||||
getWalletLog(this.params).then((res) => {
|
getWalletLog(this.params).then((res) => {
|
||||||
if (res.data.success) {
|
if (res.data.success) {
|
||||||
if (res.data.result.records.length != 0) {
|
if (res.data.result.records.length != 0) {
|
||||||
this.datas.push(...res.data.result.records);
|
this.depositData.push(...res.data.result.records);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -106,7 +103,7 @@ export default {
|
|||||||
|
|
||||||
|
|
||||||
changed(index) {
|
changed(index) {
|
||||||
this.datas = [];
|
this.depositData = [];
|
||||||
this.swiperCurrent = index;
|
this.swiperCurrent = index;
|
||||||
this.params.pageNumber = 1;
|
this.params.pageNumber = 1;
|
||||||
if (index == 0) {
|
if (index == 0) {
|
||||||
|
|||||||
@@ -5,11 +5,11 @@
|
|||||||
<div class="deposit">预存款金额</div>
|
<div class="deposit">预存款金额</div>
|
||||||
<div class="money">¥{{walletNum | unitPrice }}</div>
|
<div class="money">¥{{walletNum | unitPrice }}</div>
|
||||||
<div class="operation-btns">
|
<div class="operation-btns">
|
||||||
<div class="operation-btn light" @click="navgition('/pages/mine/deposit/withdrawal')">提现</div>
|
<div class="operation-btn light" @click="navigateTo('/pages/mine/deposit/withdrawal')">提现</div>
|
||||||
<div class="operation-btn" @click="navgition('/pages/mine/deposit/recharge')">充值</div>
|
<div class="operation-btn" @click="navigateTo('/pages/mine/deposit/recharge')">充值</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="box list" @click="navgition('/pages/mine/deposit/index')">
|
<div class="box list" @click="navigateTo('/pages/mine/deposit/index')">
|
||||||
<div class="list-left">预存款明细</div>
|
<div class="list-left">预存款明细</div>
|
||||||
<div class="list-right">
|
<div class="list-right">
|
||||||
<u-icon name="arrow-right"></u-icon>
|
<u-icon name="arrow-right"></u-icon>
|
||||||
@@ -31,12 +31,6 @@ export default {
|
|||||||
let result = await getUserWallet(); //预存款
|
let result = await getUserWallet(); //预存款
|
||||||
this.walletNum = result.data.result.memberWallet;
|
this.walletNum = result.data.result.memberWallet;
|
||||||
} else {
|
} else {
|
||||||
uni.showToast({
|
|
||||||
icon: "none",
|
|
||||||
duration: 3000,
|
|
||||||
title: "请先登录!",
|
|
||||||
});
|
|
||||||
|
|
||||||
this.$options.filters.navigateToLogin("redirectTo");
|
this.$options.filters.navigateToLogin("redirectTo");
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -49,7 +43,7 @@ export default {
|
|||||||
/**
|
/**
|
||||||
* 跳转
|
* 跳转
|
||||||
*/
|
*/
|
||||||
navgition(url) {
|
navigateTo(url) {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url,
|
url,
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,39 +1,70 @@
|
|||||||
<template>
|
<template>
|
||||||
<view>
|
<view>
|
||||||
<view class="-list">
|
<view class="-list">
|
||||||
<view class="title">提现金额</view>
|
<view class="title">提现类型</view>
|
||||||
<view class="content">
|
<view class="content">
|
||||||
<view class="price">
|
<view class="price">
|
||||||
<span> ¥</span>
|
<u-input disabled :value="type === 'ALI' ? '支付宝' : '微信'" placeholder="" />
|
||||||
<u-input v-model="price" placeholder="" type="number" />
|
|
||||||
</view>
|
</view>
|
||||||
|
</view>
|
||||||
<view class="all">
|
|
||||||
<view @click="handleAll" :style="{ color: $mainColor }">全部</view>
|
|
||||||
<view style="font-size: 24rpx; color: #999">可提现金额<span>{{ walletNum | unitPrice }}</span>元</view>
|
|
||||||
</view>
|
|
||||||
|
|
||||||
</view>
|
|
||||||
<view class="tips">
|
|
||||||
最低提现金额为1.00元
|
|
||||||
</view>
|
|
||||||
</view>
|
</view>
|
||||||
|
<view class="-list">
|
||||||
|
<view class="title">提现金额</view>
|
||||||
|
<view class="content">
|
||||||
|
<view class="price">
|
||||||
|
<span> ¥</span>
|
||||||
|
<u-input v-model="price" placeholder="" type="number" />
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="all">
|
||||||
|
<view @click="handleAll" :style="{ color: $mainColor }">全部</view>
|
||||||
|
<view style="font-size: 24rpx; color: #999">可提现金额<span>{{ walletNum | unitPrice }}</span>元</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
</view>
|
||||||
|
<view class="tips">
|
||||||
|
最低提现金额为 {{ minPrice }} 元
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="-list" v-if="type === 'ALI'">
|
||||||
|
<view class="title">真实姓名</view>
|
||||||
|
<view class="content">
|
||||||
|
<view class="price">
|
||||||
|
<u-input v-model="realName" placeholder="" />
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="-list" v-if="type === 'ALI'">
|
||||||
|
<view class="title">第三方登录账号</view>
|
||||||
|
<view class="content">
|
||||||
|
<view class="price">
|
||||||
|
<u-input v-model="connectNumber" placeholder="" />
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
<view class="submit" @click="cashd">提现</view>
|
<view class="submit" @click="cashd">提现</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import { getUserWallet, withdrawalApply } from "@/api/members";
|
import { getUserWallet, withdrawalApply, withdrawalSettingVO } from "@/api/members";
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
price: 0,
|
price: 0,
|
||||||
walletNum: 0,
|
walletNum: 0,
|
||||||
|
minPrice: 0,
|
||||||
|
type: '',
|
||||||
|
connectNumber: '',
|
||||||
|
realName: ''
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
async mounted() {
|
async mounted() {
|
||||||
let result = await getUserWallet(); //预存款
|
let result = await getUserWallet(); //预存款
|
||||||
|
let res = await withdrawalSettingVO();
|
||||||
this.walletNum = result.data.result.memberWallet;
|
this.walletNum = result.data.result.memberWallet;
|
||||||
|
this.minPrice = res.data.result.minPrice;
|
||||||
|
this.type = res.data.result.type;
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
@@ -41,7 +72,20 @@ export default {
|
|||||||
this.price = this.price + "";
|
this.price = this.price + "";
|
||||||
|
|
||||||
if (this.$u.test.amount(parseInt(this.price))) {
|
if (this.$u.test.amount(parseInt(this.price))) {
|
||||||
withdrawalApply({ price: this.price }).then((res) => {
|
let params = { price: this.price };
|
||||||
|
if (this.type === 'ALI') {
|
||||||
|
if (!this.connectNumber || !this.realName) {
|
||||||
|
uni.showToast({
|
||||||
|
title: "请输入真实姓名和第三方登录账号",
|
||||||
|
duration: 2000,
|
||||||
|
icon: "none",
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
params.connectNumber = this.connectNumber;
|
||||||
|
params.realName = this.realName;
|
||||||
|
}
|
||||||
|
withdrawalApply(params).then((res) => {
|
||||||
if (res.data.success) {
|
if (res.data.success) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: "提现成功!",
|
title: "提现成功!",
|
||||||
|
|||||||
@@ -1,20 +1,15 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="log-list">
|
<view class="log-list">
|
||||||
<!-- 提现记录 -->
|
<!-- 提现记录 -->
|
||||||
<view
|
<view class="log-way" v-if="cashLogData.length != 0" v-for="(item, index) in cashLogData" :key="index">
|
||||||
class="log-way"
|
|
||||||
v-if="cashLogData.length != 0"
|
|
||||||
v-for="(item, index) in cashLogData"
|
|
||||||
:key="index"
|
|
||||||
>
|
|
||||||
<view class="log-item">
|
<view class="log-item">
|
||||||
<view class="log-item-view">
|
<view class="log-item-view">
|
||||||
<view class="title">{{
|
<view class="title">{{
|
||||||
item.distributionCashStatus == "APPLY"
|
item.distributionCashStatus == "APPLY"
|
||||||
? "待处理"
|
? "待处理"
|
||||||
: item.distributionCashStatus == "PASS"
|
: item.distributionCashStatus == "VIA_AUDITING"
|
||||||
? "通过"
|
? "通过"
|
||||||
: "拒绝"
|
: "拒绝"
|
||||||
}}</view>
|
}}</view>
|
||||||
<view class="price">+{{ item.price | unitPrice }}</view>
|
<view class="price">+{{ item.price | unitPrice }}</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -25,12 +20,7 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<!-- 分销业绩 -->
|
<!-- 分销业绩 -->
|
||||||
<view
|
<view class="log-way" v-if="achievementData.length != 0" v-for="(item, index) in achievementData" :key="index">
|
||||||
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 class="log-item-view">
|
<view class="log-item-view">
|
||||||
<view class="title">{{ item.goodsName }}</view>
|
<view class="title">{{ item.goodsName }}</view>
|
||||||
@@ -56,7 +46,7 @@
|
|||||||
<script>
|
<script>
|
||||||
import { cashLog, distributionOrderList } from "@/api/goods";
|
import { cashLog, distributionOrderList } from "@/api/goods";
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data () {
|
||||||
return {
|
return {
|
||||||
cashLogData: [], //提现记录数据集合
|
cashLogData: [], //提现记录数据集合
|
||||||
achievementData: [], //分销业绩数据合集,
|
achievementData: [], //分销业绩数据合集,
|
||||||
@@ -76,7 +66,7 @@ export default {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
onLoad(option) {
|
onLoad (option) {
|
||||||
let title;
|
let title;
|
||||||
option.type == 0 ? (title = "分销业绩") : (title = "提现记录");
|
option.type == 0 ? (title = "分销业绩") : (title = "提现记录");
|
||||||
|
|
||||||
@@ -87,15 +77,15 @@ export default {
|
|||||||
this.type = option.type;
|
this.type = option.type;
|
||||||
option.type == 0 ? this.achievement() : this.history();
|
option.type == 0 ? this.achievement() : this.history();
|
||||||
},
|
},
|
||||||
mounted() {},
|
mounted () { },
|
||||||
onReachBottom() {
|
onReachBottom () {
|
||||||
this.status = "loading";
|
this.status = "loading";
|
||||||
this.type == 0 ? this.achParams.pageNumber++ : this.params.pageNumber++;
|
this.type == 0 ? this.achParams.pageNumber++ : this.params.pageNumber++;
|
||||||
this.type == 0 ? this.achievement() : this.history();
|
this.type == 0 ? this.achievement() : this.history();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
// 业绩
|
// 业绩
|
||||||
achievement() {
|
achievement () {
|
||||||
uni.showLoading({
|
uni.showLoading({
|
||||||
title: "加载中",
|
title: "加载中",
|
||||||
});
|
});
|
||||||
@@ -106,11 +96,11 @@ export default {
|
|||||||
this.status = "nomore";
|
this.status = "nomore";
|
||||||
this.empty = true;
|
this.empty = true;
|
||||||
}
|
}
|
||||||
uni.hideLoading();
|
if (this.$store.state.isShowToast){ uni.hideLoading() };
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
// 初始化提现历史
|
// 初始化提现历史
|
||||||
history() {
|
history () {
|
||||||
uni.showLoading({
|
uni.showLoading({
|
||||||
title: "加载中",
|
title: "加载中",
|
||||||
});
|
});
|
||||||
@@ -121,7 +111,7 @@ export default {
|
|||||||
this.status = "nomore";
|
this.status = "nomore";
|
||||||
this.empty = true;
|
this.empty = true;
|
||||||
}
|
}
|
||||||
uni.hideLoading();
|
if (this.$store.state.isShowToast){ uni.hideLoading() };
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -131,15 +121,18 @@ export default {
|
|||||||
.empty {
|
.empty {
|
||||||
margin: 40rpx 0;
|
margin: 40rpx 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.price {
|
.price {
|
||||||
color: $main-color;
|
color: $main-color;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
|
|
||||||
.log-list {
|
.log-list {
|
||||||
padding: 0 8rpx;
|
padding: 0 8rpx;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
margin: 20rpx 0;
|
margin: 20rpx 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.log-way {
|
.log-way {
|
||||||
margin: 10rpx 0;
|
margin: 10rpx 0;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
@@ -147,22 +140,26 @@ export default {
|
|||||||
border-radius: 10rpx;
|
border-radius: 10rpx;
|
||||||
padding: 20rpx 0;
|
padding: 20rpx 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.title {
|
.title {
|
||||||
font-size: 30rpx;
|
font-size: 30rpx;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
|
|
||||||
.log-item-view {
|
.log-item-view {
|
||||||
padding: 8rpx 32rpx;
|
padding: 8rpx 32rpx;
|
||||||
display: flex;
|
display: flex;
|
||||||
font-size: 13px;
|
font-size: 13px;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
}
|
}
|
||||||
|
|
||||||
.log-item-footer {
|
.log-item-footer {
|
||||||
padding: 8rpx 32rpx;
|
padding: 8rpx 32rpx;
|
||||||
display: flex;
|
display: flex;
|
||||||
font-size: 13px;
|
font-size: 13px;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
}
|
}
|
||||||
|
|
||||||
.log-item-footers {
|
.log-item-footers {
|
||||||
padding: 8rpx 32rpx;
|
padding: 8rpx 32rpx;
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|||||||
@@ -78,7 +78,7 @@ export default {
|
|||||||
if (res.data.result) {
|
if (res.data.result) {
|
||||||
this.distributionData = res.data.result;
|
this.distributionData = res.data.result;
|
||||||
}
|
}
|
||||||
uni.hideLoading();
|
if (this.$store.state.isShowToast){ uni.hideLoading() };
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -98,7 +98,7 @@ export default {
|
|||||||
.nav-list {
|
.nav-list {
|
||||||
color: #fff;
|
color: #fff;
|
||||||
padding: 40rpx 0;
|
padding: 40rpx 0;
|
||||||
background: $aider-light-color;
|
background: linear-gradient(91deg, $light-color 1%, $aider-light-color 99%);
|
||||||
}
|
}
|
||||||
.total {
|
.total {
|
||||||
padding: 10rpx 0;
|
padding: 10rpx 0;
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ export default {
|
|||||||
if (res.data.result) {
|
if (res.data.result) {
|
||||||
this.distributionData = res.data.result;
|
this.distributionData = res.data.result;
|
||||||
}
|
}
|
||||||
uni.hideLoading();
|
if (this.$store.state.isShowToast){ uni.hideLoading() };
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,37 +1,42 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="wrapper">
|
<div class="wrapper">
|
||||||
<u-parse :show-with-animation="true" :lazy-load="true" :selectable="true" :html="res.content"></u-parse>
|
<u-parse :show-with-animation="true" :lazy-load="true" :selectable="true" :html="res.content" v-if="res"></u-parse>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import { getArticleDetail } from "@/api/article";
|
import { getArticleDetailByType } from "@/api/article";
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
res: "",
|
res: "",
|
||||||
way: {
|
way: {
|
||||||
user: {
|
USER_AGREEMENT: {
|
||||||
title: "用户协议",
|
title: "服务协议",
|
||||||
type: "USER_AGREEMENT",
|
type: "USER_AGREEMENT",
|
||||||
},
|
},
|
||||||
privacy: {
|
PRIVACY_POLICY: {
|
||||||
title: "隐私政策",
|
title: "隐私政策",
|
||||||
type: "PRIVACY_POLICY",
|
type: "PRIVACY_POLICY",
|
||||||
},
|
},
|
||||||
message: {
|
LICENSE_INFORMATION: {
|
||||||
title: "证照信息",
|
title: "证照信息",
|
||||||
type: "LICENSE_INFORMATION",
|
type: "LICENSE_INFORMATION",
|
||||||
},
|
},
|
||||||
about: {
|
ABOUT: {
|
||||||
title: "关于我们",
|
title: "关于我们",
|
||||||
type: "ABOUT",
|
type: "ABOUT",
|
||||||
},
|
},
|
||||||
|
STORE_REGISTER: {
|
||||||
|
title: "店铺入驻协议",
|
||||||
|
type: "STORE_REGISTER",
|
||||||
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
mounted() {},
|
mounted() {},
|
||||||
onLoad(option) {
|
onLoad(option) {
|
||||||
|
console.log(this.way)
|
||||||
uni.setNavigationBarTitle({
|
uni.setNavigationBarTitle({
|
||||||
title: this.way[option.type].title,
|
title: this.way[option.type].title,
|
||||||
});
|
});
|
||||||
@@ -40,9 +45,10 @@ export default {
|
|||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
init(option) {
|
init(option) {
|
||||||
getArticleDetail(this.way[option.type].type).then((res) => {
|
getArticleDetailByType(this.way[option.type].type).then((res) => {
|
||||||
if (res.data.success) {
|
if (res.data.success) {
|
||||||
this.res = res.data.result;
|
this.res = res.data.result;
|
||||||
|
console.log(res)
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|||||||
5802
pages/mine/im/index-app.scss
Normal file
5802
pages/mine/im/index-app.scss
Normal file
File diff suppressed because one or more lines are too long
878
pages/mine/im/index.vue
Normal file
878
pages/mine/im/index.vue
Normal file
@@ -0,0 +1,878 @@
|
|||||||
|
<template>
|
||||||
|
<view class="wrapper">
|
||||||
|
<u-navbar class="my-title" title-size="32" :title="toUser.name"></u-navbar>
|
||||||
|
<!-- 空盒子用来防止消息过少时 拉起键盘会遮盖消息 -->
|
||||||
|
<view :animation="anData" style="height:0;">
|
||||||
|
</view>
|
||||||
|
<!-- 消息体 -->
|
||||||
|
<!-- 用来获取消息体高度 -->
|
||||||
|
<view id="msgList">
|
||||||
|
<!-- 消息 -->
|
||||||
|
<view class="flex-column-start" v-if="msgList.length" v-for="(item, index) in msgList" :key="index">
|
||||||
|
<view class="flex-row-start column-time">
|
||||||
|
<!-- <view v-show="compareTime(index, item.createTime)" class="flex-row-start date-text"
|
||||||
|
v-text="beautifyTime(item.createTime)">
|
||||||
|
</view> -->
|
||||||
|
</view>
|
||||||
|
<!-- 用户消息 头像可选加入-->
|
||||||
|
<view v-if="item.my" class="flex justify-end padding-right one-show align-start padding-top">
|
||||||
|
<view class="flex justify-end" style="width: 400rpx;margin-top: 12px;">
|
||||||
|
<view>
|
||||||
|
<view class="user-name">{{ user.nickName }}</view>
|
||||||
|
<view class="margin-left padding-chat bg-user-orang" style="border-radius: 35rpx; ">
|
||||||
|
<text style="word-break: break-all;"
|
||||||
|
v-if="item.messageType === 'MESSAGE' && !emojistwo.includes(item.text)">{{ item.text }}</text>
|
||||||
|
<view v-if="item.messageType === 'MESSAGE' && emojistwo.includes(item.text)"
|
||||||
|
v-html="textReplaceEmoji(item.text)"></view>
|
||||||
|
<view v-if="item.messageType == 'GOODS'">
|
||||||
|
<view class="goods-card u-flex u-row-between u-p-b-0" style="width:100%;margin: 0 0; ">
|
||||||
|
<view class="image-box" @click="jumpGoodDesc(item)">
|
||||||
|
<image class="image" :src="JSON.parse(item.text)['thumbnail']" mode="widthFix"></image>
|
||||||
|
</view>
|
||||||
|
<view class="goods-desc" @click="jumpGoodDesc(item)">
|
||||||
|
<view class="goods-desc-name">
|
||||||
|
<text class="goods-card-goods-name">{{
|
||||||
|
JSON.parse(item.text)['goodsName']
|
||||||
|
}}</text>
|
||||||
|
</view>
|
||||||
|
<view class="goods-desc-rice" >¥{{
|
||||||
|
JSON.parse(item.text)['price'] | unitPrice
|
||||||
|
}}
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view v-if="item.messageType == 'ORDER'" @click="linkTosOrders(item.text)">
|
||||||
|
<view class="order-sn">
|
||||||
|
<div class="wes">订单号:{{ JSON.parse(item.text)['sn'] }}</div>
|
||||||
|
<div class='order-item flex' v-if="JSON.parse(item.text).orderItems.length" v-for='(order,orderIndex) in JSON.parse(item.text).orderItems'>
|
||||||
|
<u-image mode="widthFix" width='120rpx' height='120rpx' :src="order.image" />
|
||||||
|
<view class="name-or-time">
|
||||||
|
<div class="wes-2" >{{
|
||||||
|
order.name
|
||||||
|
}}</div>
|
||||||
|
<div class="main-color goods-desc-rice">{{
|
||||||
|
order.goodsPrice | unitPrice("¥")
|
||||||
|
}}</div>
|
||||||
|
|
||||||
|
</view>
|
||||||
|
</div>
|
||||||
|
<view class="order-list">
|
||||||
|
<view class="order-time">
|
||||||
|
<text>{{ JSON.parse(item.text)['paymentTime'] }}</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view>
|
||||||
|
<u-avatar :src="user.face" :text="user.face ? '' : user.name" bg-color="#DDDDDD"></u-avatar>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<!-- 接收人消息 -->
|
||||||
|
<view v-else class="flex-row-start margin-left margin-top one-show">
|
||||||
|
<view class="chat-img flex-row-center">
|
||||||
|
<u-avatar :src="toUser.face" :text="toUser.face ? '' : toUser.name" bg-color="#DDDDDD">
|
||||||
|
</u-avatar>
|
||||||
|
</view>
|
||||||
|
<view class="flex" style="width: 500rpx;">
|
||||||
|
<view>
|
||||||
|
<view class="other-name">{{ toUser.name }}</view>
|
||||||
|
<view class="margin-left padding-chat flex-column-start bg-to-color" style="border-radius: 35rpx;">
|
||||||
|
<text style="word-break: break-all;"
|
||||||
|
v-if="item.messageType === 'MESSAGE' && !emojistwo.includes(item.text)">{{ item.text }}</text>
|
||||||
|
<view v-if="item.messageType === 'MESSAGE' && emojistwo.includes(item.text)"
|
||||||
|
v-html="textReplaceEmoji(item.text)"></view>
|
||||||
|
<view v-if="item.messageType === 'GOODS'">
|
||||||
|
<view class="goods-card u-flex u-row-between u-p-b-0" style="width:100%;margin: 0 0; ">
|
||||||
|
<view class="image-box" @click="jumpGoodDesc(item)">
|
||||||
|
<image class="image" :src="JSON.parse(item.text)['thumbnail']" mode="widthFix"></image>
|
||||||
|
</view>
|
||||||
|
<view class="goods-desc" @click="jumpGoodDesc(item)">
|
||||||
|
<view class="goods-desc-name">
|
||||||
|
<text class="goods-card-goods-name">{{
|
||||||
|
JSON.parse(item.text)['goodsName']
|
||||||
|
}}</text>
|
||||||
|
</view>
|
||||||
|
<view class="goods-desc-rice" >¥{{
|
||||||
|
JSON.parse(item.text)['price']
|
||||||
|
}}
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view v-if="item.messageType === 'ORDER'">
|
||||||
|
<view class="order-sn">
|
||||||
|
<text>订单号:{{ JSON.parse(item.text)['sn'] }}</text>
|
||||||
|
<view class="order-list">
|
||||||
|
<img style="height: 120rpx; width: 120rpx; margin-top: 15rpx;"
|
||||||
|
:src="JSON.parse(item.text)['groupImages']" mode="widthFix" />
|
||||||
|
<view class="name-or-time">
|
||||||
|
<text @click="linkTosOrders(item.text)">{{
|
||||||
|
JSON.parse(item.text)['groupName']
|
||||||
|
}}</text>
|
||||||
|
<view class="order-time">
|
||||||
|
<text>{{ JSON.parse(item.text)['paymentTime'] }}</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<!-- 防止消息底部被遮 -->
|
||||||
|
<view v-if="showHide && !localImGoodsId && showHideModel" class="flex-row-start margin-left margin-top"
|
||||||
|
style="height: 120rpx;">
|
||||||
|
</view>
|
||||||
|
<!-- 如果没有聊天记录,定位到底部 -->
|
||||||
|
<view
|
||||||
|
:style="{ position:'fixed' , bottom:(inputHeight+66)+'px' , width: '100%' }">
|
||||||
|
<view class="cart-message" v-if="showHide && !localImGoodsId && showHideModel">
|
||||||
|
<view class="goods-card u-flex u-row-between u-p-b-0">
|
||||||
|
<view class="image-box" @click="jumpGoodDesc(item)">
|
||||||
|
<image class="image" :src="goodListData.thumbnail" mode="widthFix"></image>
|
||||||
|
</view>
|
||||||
|
<view class="goods-desc" @click="jumpGoodDesc(item)">
|
||||||
|
<view class="goods-desc-name">
|
||||||
|
<text class="goods-card-goods-name">{{
|
||||||
|
goodListData.goodsName
|
||||||
|
}}</text>
|
||||||
|
</view>
|
||||||
|
<view class="goods-desc-rice" > ¥{{
|
||||||
|
goodListData.price | unitPrice
|
||||||
|
}}
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="cancel" @click="cancelModel">X</view>
|
||||||
|
<view class="send-goods" @click="sendGoodsMessage">
|
||||||
|
<view>发送商品</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<!-- loading是显示 -->
|
||||||
|
<!-- <view v-show="msgLoad" class=" margin-left margin-top">
|
||||||
|
<view class="chat-img flex-row-center">
|
||||||
|
<image style="height: 75rpx;width: 75rpx;" src="../../static/image/robt.png" mode="aspectFit"></image>
|
||||||
|
</view>
|
||||||
|
<view class="flex" style="width: 500rpx;">
|
||||||
|
<view class="margin-left padding-chat flex-column-start"
|
||||||
|
style="border-radius: 35rpx;background-color: #f9f9f9;">
|
||||||
|
<view class="cuIcon-loading turn-load" style="font-size: 35rpx;color: #3e9982;">
|
||||||
|
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view> -->
|
||||||
|
<!-- 防止消息底部被遮 -->
|
||||||
|
<view style="height: 120rpx;">
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<!-- 底部导航栏 -->
|
||||||
|
<view :style="{position: 'fixed',bottom:inputHeight+'px'}" class="flex-column-center" :animation="animationData">
|
||||||
|
<view class="bottom-dh-char flex-row-around" style="font-size: 55rpx;">
|
||||||
|
<!-- vue无法使用软键盘"发送" -->
|
||||||
|
<input @focus="inputBindFocus" @blur="eventHandle" :adjust-position="false" v-model="msg" class="dh-input" type="text" style="background-color: #f0f0f0;" @confirm="sendMessage"
|
||||||
|
confirm-type="send" placeholder="用一句简短的话描述您的问题" />
|
||||||
|
<view @click="sendMessage" class="cu-tag bg-main-color send round">
|
||||||
|
发送
|
||||||
|
</view>
|
||||||
|
<!-- <text @click="ckAdd" class="cuIcon-roundaddfill text-brown"></text> -->
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
// rpx和px的比率
|
||||||
|
var l
|
||||||
|
// 可用窗口高度
|
||||||
|
var wh
|
||||||
|
// 顶部空盒子的高度
|
||||||
|
var mgUpHeight
|
||||||
|
import {
|
||||||
|
getTalkMessage,
|
||||||
|
getTalkByUser,
|
||||||
|
jumpObtain
|
||||||
|
} from "@/api/im.js";
|
||||||
|
import SocketService from "@/utils/socket_service.js";
|
||||||
|
import storage from "@/utils/storage.js";
|
||||||
|
import {
|
||||||
|
beautifyTime
|
||||||
|
} from "@/utils/filters.js"
|
||||||
|
import config from '@/config/config.js'
|
||||||
|
import { textReplaceEmoji, emojistwo } from '@/utils/emojis.js';
|
||||||
|
export default {
|
||||||
|
// 页面卸载后清除imGoodId
|
||||||
|
onUnload () {
|
||||||
|
// #ifdef H5
|
||||||
|
uni.setStorageSync("imGoodId", '');
|
||||||
|
// #endif
|
||||||
|
|
||||||
|
if (this.socketOpen == true) {
|
||||||
|
uni.closeSocket();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onLoad (options) {
|
||||||
|
// 没有goodsid则不显示 发送商品弹窗
|
||||||
|
this.showHideModel = options.goodsid
|
||||||
|
// 发送后刷新页面不显示 发送商品弹窗 local里面imGoodId不为空显示
|
||||||
|
// #ifdef H5
|
||||||
|
this.localImGoodsId = uni.getStorageSync("imGoodId");
|
||||||
|
// #endif
|
||||||
|
this.resolve = options
|
||||||
|
// 请求商品信息
|
||||||
|
if (this.resolve.goodsid) {
|
||||||
|
this.commodityDetails()
|
||||||
|
}
|
||||||
|
// 如果需要缓存消息缓存msgList即可
|
||||||
|
// 监听键盘拉起
|
||||||
|
// 因为无法控制键盘拉起的速度,所以这里尽量以慢速处理
|
||||||
|
uni.onKeyboardHeightChange(res => {
|
||||||
|
const query = uni.createSelectorQuery()
|
||||||
|
query.select('#msgList').boundingClientRect(data => {
|
||||||
|
// 若消息体没有超过2倍的键盘则向下移动差值,防止遮住消息体
|
||||||
|
var up = res.height * 2 - data.height - l * 110
|
||||||
|
if (up > 0) {
|
||||||
|
// 动态改变空盒子高度
|
||||||
|
this.messageBoxMove(up, 300)
|
||||||
|
// 记录改变的值,若不收回键盘且发送了消息用来防止消息过多被遮盖
|
||||||
|
mgUpHeight = up
|
||||||
|
}
|
||||||
|
// 收回
|
||||||
|
if (res.height == 0) {
|
||||||
|
this.messageBoxMove(0, 0)
|
||||||
|
}
|
||||||
|
}).exec();
|
||||||
|
})
|
||||||
|
var query = uni.getSystemInfoSync()
|
||||||
|
|
||||||
|
l = query.screenWidth / 750
|
||||||
|
wh = query.windowHeight
|
||||||
|
this.scrollHeight = (query.windowHeight - 44) + "px"
|
||||||
|
this.user = storage.getUserInfo()
|
||||||
|
this.toUser = storage.getTalkToUser()
|
||||||
|
|
||||||
|
if (options.talkId) {
|
||||||
|
this.params.talkId = options.talkId;
|
||||||
|
this.getTalkMessage()
|
||||||
|
} else {
|
||||||
|
this.getTalk(options.userId)
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// this.ws.connect();
|
||||||
|
this.sokcet();
|
||||||
|
},
|
||||||
|
// 页面隐藏
|
||||||
|
onHide () {
|
||||||
|
uni.closeSocket();
|
||||||
|
},
|
||||||
|
onUnload () {
|
||||||
|
uni.closeSocket();
|
||||||
|
},
|
||||||
|
onPullDownRefresh () {
|
||||||
|
this.params.pageNumber = this.params.pageNumber + 1
|
||||||
|
this.getTalkMessage()
|
||||||
|
setTimeout(function () {
|
||||||
|
uni.stopPullDownRefresh();
|
||||||
|
}, 1000);
|
||||||
|
},
|
||||||
|
|
||||||
|
data () {
|
||||||
|
return {
|
||||||
|
textReplaceEmoji,
|
||||||
|
emojistwo,
|
||||||
|
socketOpen: false, //是否连接
|
||||||
|
storage,
|
||||||
|
fixed: 'fixed',
|
||||||
|
bottom: '50px',
|
||||||
|
width: '100%',
|
||||||
|
showHideModel: undefined,
|
||||||
|
localImGoodsId: '',
|
||||||
|
showHide: true,
|
||||||
|
msgLoad: false,
|
||||||
|
anData: {},
|
||||||
|
animationData: {},
|
||||||
|
msgList: [],
|
||||||
|
oldHeight: 0,
|
||||||
|
params: { //搜索条件
|
||||||
|
talkId: '',
|
||||||
|
pageSize: 10,
|
||||||
|
pageNumber: 1,
|
||||||
|
},
|
||||||
|
goToIndex: 0, // 前往位置
|
||||||
|
msg: "",
|
||||||
|
go: 0,
|
||||||
|
newMessageNum: 0,
|
||||||
|
user: {},
|
||||||
|
toUser: {},
|
||||||
|
scrollHeight: 0,
|
||||||
|
ws: new SocketService(),
|
||||||
|
resolve: {},
|
||||||
|
goodListData: {},
|
||||||
|
count: 0, //判断socket断开连接请求次数
|
||||||
|
inputHeight:0,
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// watch: {
|
||||||
|
// 'ws.callBackMapping': {
|
||||||
|
// handler: function (val) {
|
||||||
|
// val = JSON.parse(val)
|
||||||
|
// if (val.messageResultType == 'MESSAGE') {
|
||||||
|
// this.msgList.push(val.result)
|
||||||
|
// }
|
||||||
|
// this.newMessageNum++;
|
||||||
|
// //接收到消息后发送已读
|
||||||
|
// let msg = val
|
||||||
|
// msg.operation_type = 'READ'
|
||||||
|
// this.ws.send(JSON.stringify(msg))
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// },
|
||||||
|
methods: {
|
||||||
|
eventHandle(){
|
||||||
|
this.inputHeight = 0
|
||||||
|
},
|
||||||
|
inputBindFocus(e){
|
||||||
|
if (e.detail.height) {
|
||||||
|
this.inputHeight = e.detail.height //这个高度就是软键盘的高度
|
||||||
|
}
|
||||||
|
},
|
||||||
|
sendMessage () {
|
||||||
|
if (this.msg == "") {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
if (this.socketOpen == false) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
let msg = {
|
||||||
|
operation_type: "MESSAGE",
|
||||||
|
to: this.toUser.userId,
|
||||||
|
from: this.user.id,
|
||||||
|
message_type: "MESSAGE",
|
||||||
|
context: this.msg,
|
||||||
|
talk_id: this.params.talkId,
|
||||||
|
}
|
||||||
|
let data = JSON.stringify(msg);
|
||||||
|
uni.sendSocketMessage({
|
||||||
|
data: data,
|
||||||
|
});
|
||||||
|
this.msgList.push({
|
||||||
|
"text": this.msg,
|
||||||
|
"my": true,
|
||||||
|
"messageType": 'MESSAGE'
|
||||||
|
})
|
||||||
|
let type = 'down';
|
||||||
|
this.msgGo(type)
|
||||||
|
this.msg = ""
|
||||||
|
},
|
||||||
|
sendGoodsMessage () {
|
||||||
|
let msg = {
|
||||||
|
operation_type: "MESSAGE",
|
||||||
|
to: this.toUser.userId,
|
||||||
|
from: this.user.id,
|
||||||
|
message_type: "GOODS",
|
||||||
|
context: this.goodListData,
|
||||||
|
talk_id: this.params.talkId,
|
||||||
|
}
|
||||||
|
let data = JSON.stringify(msg);
|
||||||
|
uni.sendSocketMessage({
|
||||||
|
data: data
|
||||||
|
});
|
||||||
|
this.msgList.push({
|
||||||
|
"text": JSON.stringify(this.goodListData),
|
||||||
|
"my": true,
|
||||||
|
"messageType": 'GOODS'
|
||||||
|
})
|
||||||
|
this.showHide = false
|
||||||
|
// #ifdef H5
|
||||||
|
uni.setStorageSync("imGoodId", 1111111);
|
||||||
|
// #endif
|
||||||
|
this.$nextTick(() => {
|
||||||
|
uni.pageScrollTo({
|
||||||
|
scrollTop: 2000000,
|
||||||
|
duration: 300
|
||||||
|
});
|
||||||
|
})
|
||||||
|
},
|
||||||
|
sokcet () {
|
||||||
|
var _this = this;
|
||||||
|
uni.closeSocket();
|
||||||
|
this.socketOpen = false;
|
||||||
|
try {
|
||||||
|
//WebSocket的地址
|
||||||
|
var url = config.baseWsUrl + '/' + storage.getAccessToken();
|
||||||
|
// 连接
|
||||||
|
uni.connectSocket({
|
||||||
|
url: url,
|
||||||
|
});
|
||||||
|
// 监听WebSocket连接已打开
|
||||||
|
uni.onSocketOpen(function (res) {
|
||||||
|
_this.socketOpen = true;
|
||||||
|
});
|
||||||
|
if (!this.socketOpen) {
|
||||||
|
// 监听连接失败
|
||||||
|
|
||||||
|
uni.onSocketError(function (err) {
|
||||||
|
if (this.count < 3) {
|
||||||
|
if (err && err.code != 1000) {
|
||||||
|
_this.socketOpen = true;
|
||||||
|
setTimeout(() => {
|
||||||
|
uni.connectSocket({
|
||||||
|
url: url,
|
||||||
|
});
|
||||||
|
}, 2000)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
uni.closeSocket();
|
||||||
|
}
|
||||||
|
this.count++
|
||||||
|
});
|
||||||
|
}
|
||||||
|
// 监听收到信息
|
||||||
|
uni.onSocketMessage(function (res) {
|
||||||
|
res.data = JSON.parse(res.data)
|
||||||
|
console.log(res.data.result);
|
||||||
|
if (res.data.messageResultType == 'MESSAGE') {
|
||||||
|
_this.msgList.push(res.data.result)
|
||||||
|
console.log(_this.msgList)
|
||||||
|
}
|
||||||
|
console.log(res.data)
|
||||||
|
_this.msgGo()
|
||||||
|
})
|
||||||
|
} catch (e) {
|
||||||
|
uni.closeSocket();
|
||||||
|
}
|
||||||
|
// 监听是否断线,断线进行重新连接
|
||||||
|
uni.onSocketClose((res) => {
|
||||||
|
if (res.code != null && res.code != 1000) {
|
||||||
|
this.sokcet()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
beautifyTime,
|
||||||
|
//订单详情
|
||||||
|
linkTosOrders (val) {
|
||||||
|
let order = JSON.parse(val)
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '/pages/order/orderDetail?sn=' + order.sn,
|
||||||
|
});
|
||||||
|
|
||||||
|
},
|
||||||
|
// 跳转商品详情页
|
||||||
|
jumpGoodDesc (item) {
|
||||||
|
let info = JSON.parse(item.text)
|
||||||
|
uni.navigateTo({
|
||||||
|
url: `/pages/product/goods?id=${info.id}&goodsId=${info.goodsId}`,
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
//取消发送
|
||||||
|
cancelModel () {
|
||||||
|
this.showHide = false
|
||||||
|
},
|
||||||
|
// 请求商品详情
|
||||||
|
commodityDetails () {
|
||||||
|
jumpObtain(this.resolve.skuid, this.resolve.goodsid).then((res) => {
|
||||||
|
this.goodListData = res.data.result.data
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 切换输入法时移动输入框(按照官方的上推页面的原理应该会自动适应不同的键盘高度-->官方bug)
|
||||||
|
goPag (kh) {
|
||||||
|
this.retractBox(0, 250)
|
||||||
|
if (this.keyHeight != 0) {
|
||||||
|
if (kh - this.keyHeight > 0) {
|
||||||
|
this.retractBox(this.keyHeight - kh, 250)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 移动顶部的空盒子
|
||||||
|
messageBoxMove (x, t) {
|
||||||
|
var animation = uni.createAnimation({
|
||||||
|
duration: t,
|
||||||
|
timingFunction: 'linear',
|
||||||
|
})
|
||||||
|
this.animation = animation
|
||||||
|
animation.height(x).step()
|
||||||
|
this.anData = animation.export()
|
||||||
|
},
|
||||||
|
// 保持消息体可见
|
||||||
|
msgGo (type) {
|
||||||
|
const query = uni.createSelectorQuery()
|
||||||
|
// 延时100ms保证是最新的高度
|
||||||
|
setTimeout(() => {
|
||||||
|
// 获取消息体高度
|
||||||
|
query.select('#msgList').boundingClientRect(data => {
|
||||||
|
// 如果超过scorll高度就滚动scorll
|
||||||
|
if (type == 'up') {
|
||||||
|
this.go = data.height - this.oldHeight
|
||||||
|
} else if (type == 'down') {
|
||||||
|
this.go = data.height - wh + 120
|
||||||
|
}
|
||||||
|
// if (this.oldHeight > 0) {
|
||||||
|
// this.go = data.height - this.oldHeight
|
||||||
|
// } else {
|
||||||
|
// // if (data.height - (wh - 32) > 0) {
|
||||||
|
// this.go = data.height - wh + 120
|
||||||
|
// }
|
||||||
|
// 保证键盘第一次拉起时消息体能保持可见
|
||||||
|
var moveY = wh - data.height
|
||||||
|
// 超出页面则缩回空盒子
|
||||||
|
if (moveY - mgUpHeight < 0) {
|
||||||
|
// 小于0则视为0
|
||||||
|
if (moveY < 0) {
|
||||||
|
this.messageBoxMove(0, 200)
|
||||||
|
} else {
|
||||||
|
// 否则缩回盒子对应的高度
|
||||||
|
this.messageBoxMove(moveY, 200)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
uni.pageScrollTo({
|
||||||
|
scrollTop: this.go,
|
||||||
|
duration: 0
|
||||||
|
})
|
||||||
|
this.oldHeight = data.height
|
||||||
|
}).exec();
|
||||||
|
}, 100)
|
||||||
|
},
|
||||||
|
// 回答问题的业务逻辑
|
||||||
|
answer (id) {
|
||||||
|
// 这里应该传入问题的id,模拟就用index代替了
|
||||||
|
|
||||||
|
},
|
||||||
|
// 不建议输入框聚焦时操作此动画
|
||||||
|
ckAdd () {
|
||||||
|
if (!this.showTow) {
|
||||||
|
this.retractBox(-180, 350)
|
||||||
|
} else {
|
||||||
|
this.retractBox(0, 200)
|
||||||
|
}
|
||||||
|
this.showTow = !this.showTow
|
||||||
|
},
|
||||||
|
hideKey () {
|
||||||
|
uni.hideKeyboard()
|
||||||
|
},
|
||||||
|
// 拉起/收回附加栏
|
||||||
|
retractBox (x, t) {
|
||||||
|
var animation = uni.createAnimation({
|
||||||
|
duration: t,
|
||||||
|
timingFunction: 'ease',
|
||||||
|
})
|
||||||
|
this.animation = animation
|
||||||
|
animation.translateY(x).step()
|
||||||
|
this.animationData = animation.export()
|
||||||
|
},
|
||||||
|
async getTalkMessage () {
|
||||||
|
let type = '';
|
||||||
|
await getTalkMessage(this.params).then(res => {
|
||||||
|
if (res.data.success) {
|
||||||
|
if (this.msgList.length >= 10) {
|
||||||
|
this.msgList.unshift(...res.data.result)
|
||||||
|
type = 'up'
|
||||||
|
} else {
|
||||||
|
this.msgList.unshift(...res.data.result)
|
||||||
|
type = 'down'
|
||||||
|
}
|
||||||
|
this.msgList.forEach(item => {
|
||||||
|
if (item.fromUser === this.user.id) {
|
||||||
|
item.my = true
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
console.log(this.msgList);
|
||||||
|
this.msgGo(type)
|
||||||
|
},
|
||||||
|
// 上拉加载
|
||||||
|
touchMoreMessage (e) {
|
||||||
|
if (e.target.scrollTop == 0) {
|
||||||
|
this.params.pageNumber = this.params.pageNumber + 1
|
||||||
|
this.getTalkMessage()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
async getTalk (userId) {
|
||||||
|
getTalkByUser(userId).then(res => {
|
||||||
|
if (res.data.success) {
|
||||||
|
this.toUser = res.data.result
|
||||||
|
this.params.talkId = res.data.result.id
|
||||||
|
this.getTalkMessage()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 处理消息时间是否显示
|
||||||
|
compareTime (index, datetime) {
|
||||||
|
if (datetime == undefined) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (typeof datetime == "number") {
|
||||||
|
datetime = this.unixToDate(datetime, "yyyy-MM-dd hh:mm");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.msgList[index].is_revoke == 1) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (datetime) {
|
||||||
|
datetime = datetime.replace(/-/g, "/");
|
||||||
|
}
|
||||||
|
|
||||||
|
let time = Math.floor(Date.parse(datetime) / 1000);
|
||||||
|
let currTime = Math.floor(new Date().getTime() / 1000);
|
||||||
|
|
||||||
|
// 当前时间5分钟内时间不显示
|
||||||
|
if (currTime - time < 300) return false;
|
||||||
|
// 判断是否是最后一条消息,最后一条消息默认显示时间
|
||||||
|
if (index == this.msgList.length - 1) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
let nextDate
|
||||||
|
if (this.msgList[index + 1] && this.msgList[index + 1].createTime) {
|
||||||
|
nextDate = this.msgList[index + 1].createTime.replace(/-/g, "/");
|
||||||
|
if (nextDate - datetime < 300) return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return !(
|
||||||
|
this.unixToDate(new Date(datetime), "{y}-{m}-{d} {h}:{i}") ==
|
||||||
|
this.unixToDate(new Date(nextDate), "{y}-{m}-{d} {h}:{i}")
|
||||||
|
);
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 将unix时间戳转换为指定格式
|
||||||
|
* @param unix 时间戳【秒】
|
||||||
|
* @param format 转换格式
|
||||||
|
* @returns {*|string}
|
||||||
|
*/
|
||||||
|
unixToDate (unix, format) {
|
||||||
|
if (!unix) return unix;
|
||||||
|
let _format = format || "yyyy-MM-dd hh:mm:ss";
|
||||||
|
const d = new Date(unix);
|
||||||
|
const o = {
|
||||||
|
"M+": d.getMonth() + 1,
|
||||||
|
"d+": d.getDate(),
|
||||||
|
"h+": d.getHours(),
|
||||||
|
"m+": d.getMinutes(),
|
||||||
|
"s+": d.getSeconds(),
|
||||||
|
"q+": Math.floor((d.getMonth() + 3) / 3),
|
||||||
|
S: d.getMilliseconds(),
|
||||||
|
};
|
||||||
|
if (/(y+)/.test(_format))
|
||||||
|
_format = _format.replace(
|
||||||
|
RegExp.$1,
|
||||||
|
(d.getFullYear() + "").substr(4 - RegExp.$1.length)
|
||||||
|
);
|
||||||
|
for (const k in o)
|
||||||
|
if (new RegExp("(" + k + ")").test(_format))
|
||||||
|
_format = _format.replace(
|
||||||
|
RegExp.$1,
|
||||||
|
RegExp.$1.length === 1 ?
|
||||||
|
o[k] :
|
||||||
|
("00" + o[k]).substr(("" + o[k]).length)
|
||||||
|
);
|
||||||
|
return _format;
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.send{
|
||||||
|
font-size: 24rpx !important;
|
||||||
|
}
|
||||||
|
.order-time {
|
||||||
|
margin-top: 15rpx;
|
||||||
|
white-space: nowrap;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wrapper {
|
||||||
|
height: auto !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.order-list {
|
||||||
|
display: flex;
|
||||||
|
color: black;
|
||||||
|
font-size: 20rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
width: 95%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.order-sn {
|
||||||
|
width: 350rpx;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.name-or-time {
|
||||||
|
width: 200rpx;
|
||||||
|
margin: 15rpx 15rpx;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.goods-card {
|
||||||
|
border-radius: 20rpx;
|
||||||
|
margin-top: 15rpx;
|
||||||
|
background-color: #ffffff;
|
||||||
|
padding-left: 12rpx;
|
||||||
|
width: 95%;
|
||||||
|
height: 120rpx;
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
color: #302c2b;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
.image-box {
|
||||||
|
width: 122rpx;
|
||||||
|
height: 122rpx;
|
||||||
|
overflow: hidden;
|
||||||
|
|
||||||
|
.image {
|
||||||
|
width: 122rpx;
|
||||||
|
border-radius: 10rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.goods-desc {
|
||||||
|
flex: 1;
|
||||||
|
overflow: hidden;
|
||||||
|
margin-left: 12rpx;
|
||||||
|
width: 400rpx;
|
||||||
|
|
||||||
|
.goods-desc-name {
|
||||||
|
font-size: 30rpx;
|
||||||
|
line-height: 1.5;
|
||||||
|
white-space: nowrap;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
overflow: hidden;
|
||||||
|
margin-bottom: 20rpx;
|
||||||
|
|
||||||
|
|
||||||
|
.goods-card-goods-name {
|
||||||
|
color: black;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
font-size: 26rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.price {
|
||||||
|
margin-top: 50rpx;
|
||||||
|
line-height: 2;
|
||||||
|
margin-left: 5px;
|
||||||
|
font-size: 26rpx;
|
||||||
|
font-weight: 700;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.send-goods {
|
||||||
|
color: #ffffff;
|
||||||
|
height: 50rpx;
|
||||||
|
width: 130rpx;
|
||||||
|
background-color: #f21c0c;
|
||||||
|
font-size: 24rpx;
|
||||||
|
border-radius: 17rpx;
|
||||||
|
text-align: center;
|
||||||
|
line-height: 50rpx;
|
||||||
|
padding: 0 10rpx;
|
||||||
|
position: relative;
|
||||||
|
top: 20rpx;
|
||||||
|
right: 20rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.cancel {
|
||||||
|
color: #737373;
|
||||||
|
position: relative;
|
||||||
|
bottom: 40rpx;
|
||||||
|
left: 12%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cart-message {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.bottom-dh-char {
|
||||||
|
background-color: #f9f9f9;
|
||||||
|
width: 750rpx;
|
||||||
|
height: 110rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.user-name {
|
||||||
|
text-align: right;
|
||||||
|
font-size: 24rpx;
|
||||||
|
color: #737373;
|
||||||
|
margin-bottom: 10rpx;
|
||||||
|
margin-right: 10rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.other-name {
|
||||||
|
text-align: left;
|
||||||
|
font-size: 24rpx;
|
||||||
|
color: #737373;
|
||||||
|
margin-bottom: 10rpx;
|
||||||
|
margin-left: 10rpx;
|
||||||
|
}
|
||||||
|
.dh-input {
|
||||||
|
width: 500rpx;
|
||||||
|
height: 65rpx;
|
||||||
|
border-radius: 30rpx;
|
||||||
|
padding-left: 15rpx;
|
||||||
|
font-size: 22rpx;
|
||||||
|
background-color: #FFFFFF;
|
||||||
|
}
|
||||||
|
.column-time {
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
.chat-img {
|
||||||
|
border-radius: 50%;
|
||||||
|
width: 100rpx;
|
||||||
|
height: 100rpx;
|
||||||
|
background-color: #f7f7f7;
|
||||||
|
}
|
||||||
|
|
||||||
|
.padding-chat {
|
||||||
|
padding: 17rpx 20rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tb-nv {
|
||||||
|
width: 50rpx;
|
||||||
|
height: 50rpx;
|
||||||
|
}
|
||||||
|
.goods-desc-rice{
|
||||||
|
font-size: 24rpx;
|
||||||
|
color: $main-color;
|
||||||
|
font-weight: bold;
|
||||||
|
margin-top: 10rpx;
|
||||||
|
}
|
||||||
|
.order-item{
|
||||||
|
margin: 10rpx 0
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
uni-page-head {
|
||||||
|
position: fixed;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
z-index: 9999;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
@import "./index-app.scss";
|
||||||
|
</style>
|
||||||
237
pages/mine/im/list.vue
Normal file
237
pages/mine/im/list.vue
Normal file
@@ -0,0 +1,237 @@
|
|||||||
|
<template>
|
||||||
|
<view class="content">
|
||||||
|
<u-navbar class="my-title" title-size="32" :title="'消息(' + talkList.length + ')'"></u-navbar>
|
||||||
|
<scroll-view class="list-scroll-content" scroll-y @scrolltolower="loadData(tabIndex)">
|
||||||
|
|
||||||
|
<!-- 消息列表 -->
|
||||||
|
<div class="iconBox">
|
||||||
|
<view class="icon-list">
|
||||||
|
<view class="icon-item" @click="cleanUnread()">
|
||||||
|
<div class="bag bag1">
|
||||||
|
<u-icon name="trash" size="50" color="#fff"></u-icon>
|
||||||
|
</div>
|
||||||
|
<view>清除未读</view>
|
||||||
|
</view>
|
||||||
|
<view class="icon-item" @click="navigateTo('/pages/tabbar/home/title')">
|
||||||
|
<div class="bag bag2">
|
||||||
|
<u-icon name="bell" size="50" color="#fff"></u-icon>
|
||||||
|
</div>
|
||||||
|
<view>系统消息</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</div>
|
||||||
|
<u-search class="nav-search" v-model="userName" clearabled @change="userTalkList()" placeholder="搜索用户"
|
||||||
|
:show-action="false"></u-search>
|
||||||
|
<view class="talk-view" :key="index" v-for="(item, index) in talkList">
|
||||||
|
<view>
|
||||||
|
<view @click="onclickToTalkInfo(item)">
|
||||||
|
<view class="talk-item-view">
|
||||||
|
<view class="talk-img">
|
||||||
|
<u-avatar :src="item.face" :text="item.face ? '' : item.name" bg-color="#DDDDDD"></u-avatar>
|
||||||
|
</view>
|
||||||
|
<view class="talk-info">
|
||||||
|
<view class="talk-name u-line-2">{{ item.name }}
|
||||||
|
<u-tag class="talk-tag" size="mini" text="店铺" type="warning" v-if="item.storeFlag" />
|
||||||
|
</view>
|
||||||
|
<view class="talk-message">
|
||||||
|
<span v-if="item.lastMessageType == 'MESSAGE'">{{ item.lastTalkMessage }}</span>
|
||||||
|
<span v-if="item.lastMessageType == 'GOODS'">[商品链接]</span>
|
||||||
|
<span v-if="item.lastMessageType == 'ORDER'">[订单信息]</span>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="talk-time">
|
||||||
|
<view>
|
||||||
|
{{ beautifyTime(item.lastTalkTime) }}
|
||||||
|
</view>
|
||||||
|
<view>
|
||||||
|
<u-badge type="error" absolute :offset="[45, 20]" :count="item.unread"></u-badge>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<!-- 空白页 -->
|
||||||
|
<u-empty text="暂无信息" mode="list" v-if="talkList.length === 0"></u-empty>
|
||||||
|
</scroll-view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { getTalkList, clearmeaager } from "@/api/im.js";
|
||||||
|
import storage from "@/utils/storage.js";
|
||||||
|
import { beautifyTime } from "@/utils/filters.js"
|
||||||
|
export default {
|
||||||
|
data () {
|
||||||
|
return {
|
||||||
|
storage,
|
||||||
|
count: {
|
||||||
|
loadStatus: "more",
|
||||||
|
},
|
||||||
|
talkList: [], //聊天列表
|
||||||
|
userName: '',
|
||||||
|
pointData: {}, //累计获取 未输入 集合
|
||||||
|
};
|
||||||
|
},
|
||||||
|
|
||||||
|
onShow () {
|
||||||
|
this.userTalkList();
|
||||||
|
},
|
||||||
|
onPullDownRefresh () {
|
||||||
|
this.userTalkList()
|
||||||
|
console.log('下拉事件');
|
||||||
|
setTimeout(function () {
|
||||||
|
uni.stopPullDownRefresh();
|
||||||
|
}, 1000);
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 触底加载
|
||||||
|
*/
|
||||||
|
onReachBottom () {
|
||||||
|
this.userTalkList();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
beautifyTime,
|
||||||
|
onclickToTalkInfo (val) {
|
||||||
|
storage.setTalkToUser(val)
|
||||||
|
uni.navigateTo({
|
||||||
|
url:
|
||||||
|
"/pages/mine/im/index?talkId=" + val.id,
|
||||||
|
});
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 获取聊天列表
|
||||||
|
*/
|
||||||
|
userTalkList () {
|
||||||
|
let params = {
|
||||||
|
userName: this.userName,
|
||||||
|
}
|
||||||
|
uni.showLoading({
|
||||||
|
title: "加载中",
|
||||||
|
});
|
||||||
|
getTalkList(params).then((res) => {
|
||||||
|
if (this.$store.state.isShowToast){ uni.hideLoading() };
|
||||||
|
if (res.data.success) {
|
||||||
|
this.talkList = res.data.result;
|
||||||
|
console.log(this.talkList, 'this.talkListthis.talkList');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
navigateTo (url) {
|
||||||
|
uni.navigateTo({
|
||||||
|
url,
|
||||||
|
});
|
||||||
|
},
|
||||||
|
cleanUnread () {
|
||||||
|
clearmeaager().then((res) => {
|
||||||
|
console.log(res);
|
||||||
|
if (res.data.code == 200) {
|
||||||
|
this.userTalkList();
|
||||||
|
uni.showToast({
|
||||||
|
icon: "none",
|
||||||
|
title: res.data.message,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.talk-view {
|
||||||
|
border-radius: 20rpx;
|
||||||
|
background-color: #fff;
|
||||||
|
|
||||||
|
.talk-item-view {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
flex-direction: row;
|
||||||
|
padding: 10rpx 20rpx;
|
||||||
|
|
||||||
|
.talk-img {
|
||||||
|
width: 100rpx;
|
||||||
|
height: 100rpx;
|
||||||
|
margin-right: 10rpx;
|
||||||
|
margin-bottom: 10rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.talk-info {
|
||||||
|
padding-left: 30rpx;
|
||||||
|
flex: 1;
|
||||||
|
|
||||||
|
.talk-name {
|
||||||
|
font-size: 28rpx;
|
||||||
|
margin-bottom: 10rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
color: #333333;
|
||||||
|
}
|
||||||
|
|
||||||
|
.talk-message {
|
||||||
|
font-size: 28rpx;
|
||||||
|
margin-top: 10rpx;
|
||||||
|
color: #888787;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.talk-tag {
|
||||||
|
margin-left: 10rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.talk-time {
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
.iconBox {
|
||||||
|
width: 94%;
|
||||||
|
margin: 0 3%;
|
||||||
|
background: #fff;
|
||||||
|
border-radius: 20rpx;
|
||||||
|
box-shadow: 0 4rpx 24rpx 0 rgba($color: #f6f6f6, $alpha: 1);
|
||||||
|
// transform: translateY(-30rpx);
|
||||||
|
}
|
||||||
|
|
||||||
|
.icon-list {
|
||||||
|
height: 140rpx;
|
||||||
|
text-align: center;
|
||||||
|
font-size: $font-sm;
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-around;
|
||||||
|
align-items: center;
|
||||||
|
padding: 0 3%;
|
||||||
|
color: #999;
|
||||||
|
|
||||||
|
.icon-item {
|
||||||
|
position: relative;
|
||||||
|
line-height: 2em;
|
||||||
|
width: 96rpx;
|
||||||
|
|
||||||
|
:first-child {
|
||||||
|
font-size: 48rpx;
|
||||||
|
margin-bottom: 10rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.bag {
|
||||||
|
width: 56rpx;
|
||||||
|
height: 56rpx;
|
||||||
|
border-radius: 50%;
|
||||||
|
margin: 0 auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.bag1 {
|
||||||
|
background: #ff0015;
|
||||||
|
}
|
||||||
|
|
||||||
|
.bag2 {
|
||||||
|
background: #73AF7C;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
@import "./index-app.scss";
|
||||||
|
</style>
|
||||||
166
pages/mine/im/socket.js
Normal file
166
pages/mine/im/socket.js
Normal file
@@ -0,0 +1,166 @@
|
|||||||
|
import config from '@/config/config.js'
|
||||||
|
import storage from '@/utils/storage';
|
||||||
|
class socketIO {
|
||||||
|
constructor(data, time, url) {
|
||||||
|
this.socketTask = null
|
||||||
|
this.is_open_socket = false //避免重复连接
|
||||||
|
this.url = config.baseWsUrl + '/' + storage.getAccessToken() //连接地址
|
||||||
|
this.data = data ? data : null
|
||||||
|
this.connectNum = 1 // 重连次数
|
||||||
|
this.traderDetailIndex = 100 // traderDetailIndex ==2 重连
|
||||||
|
this.accountStateIndex = 100 // traderDetailIndex ==1 重连
|
||||||
|
this.followFlake = false // traderDetailIndex == true 重连
|
||||||
|
//心跳检测
|
||||||
|
this.timeout = time ? time : 15000 //多少秒执行检测
|
||||||
|
this.heartbeatInterval = null //检测服务器端是否还活着
|
||||||
|
this.reconnectTimeOut = null //重连之后多久再次重连
|
||||||
|
}
|
||||||
|
// 进入这个页面的时候创建websocket连接【整个页面随时使用】
|
||||||
|
connectSocketInit (data) {
|
||||||
|
this.data = data
|
||||||
|
this.socketTask = uni.connectSocket({
|
||||||
|
url: this.url,
|
||||||
|
success: () => {
|
||||||
|
console.log("正准备建立websocket中...");
|
||||||
|
// 返回实例
|
||||||
|
return this.socketTask
|
||||||
|
},
|
||||||
|
});
|
||||||
|
this.socketTask.onOpen((res) => {
|
||||||
|
this.connectNum = 1
|
||||||
|
console.log("WebSocket连接正常!");
|
||||||
|
this.send(data)
|
||||||
|
clearInterval(this.reconnectTimeOut)
|
||||||
|
clearInterval(this.heartbeatInterval)
|
||||||
|
this.is_open_socket = true;
|
||||||
|
this.start();
|
||||||
|
// 注:只有连接正常打开中 ,才能正常收到消息
|
||||||
|
this.socketTask.onMessage((e) => {
|
||||||
|
// 字符串转json
|
||||||
|
let res = JSON.parse(e.data);
|
||||||
|
console.log("res---------->", res) // 这里 查看 推送过来的消息
|
||||||
|
if (res.data) {
|
||||||
|
uni.$emit('getPositonsOrder', res);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
})
|
||||||
|
// 监听连接失败,这里代码我注释掉的原因是因为如果服务器关闭后,和下面的onclose方法一起发起重连操作,这样会导致重复连接
|
||||||
|
uni.onSocketError((res) => {
|
||||||
|
console.log('WebSocket连接打开失败,请检查!');
|
||||||
|
this.socketTask = null
|
||||||
|
this.is_open_socket = false;
|
||||||
|
clearInterval(this.heartbeatInterval)
|
||||||
|
clearInterval(this.reconnectTimeOut)
|
||||||
|
uni.$off('getPositonsOrder')
|
||||||
|
if (this.connectNum < 6) {
|
||||||
|
uni.showToast({
|
||||||
|
title: `WebSocket连接失败,正尝试第${this.connectNum}次连接`,
|
||||||
|
icon: "none"
|
||||||
|
})
|
||||||
|
this.reconnect();
|
||||||
|
this.connectNum += 1
|
||||||
|
} else {
|
||||||
|
uni.$emit('connectError');
|
||||||
|
this.connectNum = 1
|
||||||
|
}
|
||||||
|
});
|
||||||
|
// 这里仅是事件监听【如果socket关闭了会执行】
|
||||||
|
this.socketTask.onClose(() => {
|
||||||
|
console.log("已经被关闭了-------")
|
||||||
|
clearInterval(this.heartbeatInterval)
|
||||||
|
clearInterval(this.reconnectTimeOut)
|
||||||
|
this.is_open_socket = false;
|
||||||
|
this.socketTask = null
|
||||||
|
uni.$off('getPositonsOrder')
|
||||||
|
if (this.connectNum < 6) {
|
||||||
|
this.reconnect();
|
||||||
|
} else {
|
||||||
|
uni.$emit('connectError');
|
||||||
|
this.connectNum = 1
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 主动关闭socket连接
|
||||||
|
Close () {
|
||||||
|
if (!this.is_open_socket) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.socketTask.close({
|
||||||
|
success () {
|
||||||
|
uni.showToast({
|
||||||
|
title: 'SocketTask 关闭成功',
|
||||||
|
icon: "none"
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
//发送消息
|
||||||
|
send (data) {
|
||||||
|
console.log("data---------->", data);
|
||||||
|
// 注:只有连接正常打开中 ,才能正常成功发送消息
|
||||||
|
if (this.socketTask) {
|
||||||
|
this.socketTask.send({
|
||||||
|
data: JSON.stringify(data),
|
||||||
|
async success () {
|
||||||
|
console.log("消息发送成功");
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//开启心跳检测
|
||||||
|
start () {
|
||||||
|
this.heartbeatInterval = setInterval(() => {
|
||||||
|
this.send({
|
||||||
|
"traderid": 10260,
|
||||||
|
"type": "Ping"
|
||||||
|
});
|
||||||
|
}, this.timeout)
|
||||||
|
}
|
||||||
|
//重新连接
|
||||||
|
reconnect () {
|
||||||
|
//停止发送心跳
|
||||||
|
clearInterval(this.heartbeatInterval)
|
||||||
|
//如果不是人为关闭的话,进行重连
|
||||||
|
if (!this.is_open_socket && (this.traderDetailIndex == 2 || this.accountStateIndex == 0 || this
|
||||||
|
.followFlake)) {
|
||||||
|
this.reconnectTimeOut = setInterval(() => {
|
||||||
|
this.connectSocketInit(this.data);
|
||||||
|
}, 5000)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* @description 将 scoket 数据进行过滤
|
||||||
|
* @param {array} array
|
||||||
|
* @param {string} type 区分 弹窗 openposition 分为跟随和我的
|
||||||
|
*/
|
||||||
|
arrayFilter (array, type = 'normal', signalId = 0) {
|
||||||
|
let arr1 = []
|
||||||
|
let arr2 = []
|
||||||
|
let obj = {
|
||||||
|
arr1: [],
|
||||||
|
arr2: []
|
||||||
|
}
|
||||||
|
arr1 = array.filter(v => v.flwsig == true)
|
||||||
|
arr2 = array.filter(v => v.flwsig == false)
|
||||||
|
if (type == 'normal') {
|
||||||
|
if (signalId) {
|
||||||
|
arr1 = array.filter(v => v.flwsig == true && v.sigtraderid == signalId)
|
||||||
|
return arr1
|
||||||
|
} else {
|
||||||
|
return arr1.concat(arr2)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (signalId > 0) {
|
||||||
|
arr1 = array.filter(v => v.flwsig == true && v.sigtraderid == signalId)
|
||||||
|
obj.arr1 = arr1
|
||||||
|
} else {
|
||||||
|
obj.arr1 = arr1
|
||||||
|
}
|
||||||
|
obj.arr2 = arr2
|
||||||
|
return obj
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
export {
|
||||||
|
socketIO
|
||||||
|
}
|
||||||
@@ -58,7 +58,7 @@ export default {
|
|||||||
title:"加载中"
|
title:"加载中"
|
||||||
})
|
})
|
||||||
API_Message.getLogisticsMessages(this.params).then(async response => {
|
API_Message.getLogisticsMessages(this.params).then(async response => {
|
||||||
uni.hideLoading()
|
if (this.$store.state.isShowToast){ uni.hideLoading() }
|
||||||
const { data } = response
|
const { data } = response
|
||||||
if (!data || !data.length) {
|
if (!data || !data.length) {
|
||||||
this.messageList.push(...data.data)
|
this.messageList.push(...data.data)
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ export default {
|
|||||||
title: "加载中"
|
title: "加载中"
|
||||||
});
|
});
|
||||||
API_Message.getMessages(this.params).then(async response => {
|
API_Message.getMessages(this.params).then(async response => {
|
||||||
uni.hideLoading();
|
if (this.$store.state.isShowToast){ uni.hideLoading() };
|
||||||
const { data } = response;
|
const { data } = response;
|
||||||
if (!data || !data.length) {
|
if (!data || !data.length) {
|
||||||
this.messageList.push(...data.data);
|
this.messageList.push(...data.data);
|
||||||
|
|||||||
@@ -64,6 +64,7 @@
|
|||||||
<script>
|
<script>
|
||||||
import {
|
import {
|
||||||
getGoodsCollection,
|
getGoodsCollection,
|
||||||
|
getStoreCollection,
|
||||||
deleteGoodsCollection,
|
deleteGoodsCollection,
|
||||||
deleteStoreCollection,
|
deleteStoreCollection,
|
||||||
} from "@/api/members.js";
|
} from "@/api/members.js";
|
||||||
@@ -105,21 +106,34 @@
|
|||||||
storeList: [], //店铺集合
|
storeList: [], //店铺集合
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
onLoad() {
|
onShow() {
|
||||||
this.getGoodList();
|
this.fetchReloadOrNextPage('reload')
|
||||||
this.getStoreList();
|
|
||||||
},
|
},
|
||||||
onReachBottom() {
|
onReachBottom() {
|
||||||
if (this.tabCurrentIndex == 0) {
|
this.fetchReloadOrNextPage('next')
|
||||||
this.navList[0].params.pageNumber++;
|
|
||||||
this.getGoodList();
|
|
||||||
} else {
|
|
||||||
this.navList[1].params.pageNumber++;
|
|
||||||
this.getStoreList();
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
|
// 刷新或者下一页
|
||||||
|
fetchReloadOrNextPage(type) {
|
||||||
|
if(type == 'next'){
|
||||||
|
this.navList[this.tabCurrentIndex].params.pageNumber ++;
|
||||||
|
if (this.tabCurrentIndex == 0) {
|
||||||
|
this.getGoodList();
|
||||||
|
} else {
|
||||||
|
this.getStoreList();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
this.navList[0].params.pageNumber = 1;
|
||||||
|
this.navList[1].params.pageNumber = 1;
|
||||||
|
this.goodList = [];
|
||||||
|
this.storeList = [];
|
||||||
|
this.getGoodList();
|
||||||
|
this.getStoreList();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 打开商品左侧取消收藏
|
* 打开商品左侧取消收藏
|
||||||
*/
|
*/
|
||||||
@@ -154,7 +168,7 @@
|
|||||||
* 点击店铺左侧取消收藏
|
* 点击店铺左侧取消收藏
|
||||||
*/
|
*/
|
||||||
clickStoreSwiperAction(val) {
|
clickStoreSwiperAction(val) {
|
||||||
deleteStoreCollection(val.storeId).then((res) => {
|
deleteStoreCollection(val.id).then((res) => {
|
||||||
if (res.statusCode == 200) {
|
if (res.statusCode == 200) {
|
||||||
this.storeList = [];
|
this.storeList = [];
|
||||||
this.getStoreList();
|
this.getStoreList();
|
||||||
@@ -197,7 +211,7 @@
|
|||||||
title: "加载中",
|
title: "加载中",
|
||||||
});
|
});
|
||||||
getGoodsCollection(this.navList[0].params, "GOODS").then((res) => {
|
getGoodsCollection(this.navList[0].params, "GOODS").then((res) => {
|
||||||
uni.hideLoading();
|
if (this.$store.state.isShowToast){ uni.hideLoading() };
|
||||||
uni.stopPullDownRefresh();
|
uni.stopPullDownRefresh();
|
||||||
if (res.data.success) {
|
if (res.data.success) {
|
||||||
let data = res.data.result;
|
let data = res.data.result;
|
||||||
@@ -224,8 +238,8 @@
|
|||||||
uni.showLoading({
|
uni.showLoading({
|
||||||
title: "加载中",
|
title: "加载中",
|
||||||
});
|
});
|
||||||
getGoodsCollection(this.navList[1].params, "store").then((res) => {
|
getStoreCollection(this.navList[1].params, "STORE").then((res) => {
|
||||||
uni.hideLoading();
|
if (this.$store.state.isShowToast){ uni.hideLoading() };
|
||||||
uni.stopPullDownRefresh();
|
uni.stopPullDownRefresh();
|
||||||
if (res.data.success) {
|
if (res.data.success) {
|
||||||
let data = res.data.result;
|
let data = res.data.result;
|
||||||
|
|||||||
@@ -5,17 +5,22 @@
|
|||||||
</u-navbar>
|
</u-navbar>
|
||||||
<u-empty text="暂无历史记录" style="margin-top:200rpx;" mode="history" v-if="whetherEmpty"></u-empty>
|
<u-empty text="暂无历史记录" style="margin-top:200rpx;" mode="history" v-if="whetherEmpty"></u-empty>
|
||||||
<div v-else>
|
<div v-else>
|
||||||
<view v-for="(item, index) in trackList" :key="index">
|
<view v-if="item" v-for="(item, index) in trackList" :key="index">
|
||||||
<view class="myTracks-title" @click="navgaiteToStore(item)">{{item.storeName}}</view>
|
<view class="myTracks-title" @click="navigateToStore(item)" v-if="item.storeName">{{item.storeName}}</view>
|
||||||
<view class="myTracks-items">
|
<view class="myTracks-items">
|
||||||
|
|
||||||
<u-swipe-action style="width: 100%;" :show="item.show" :index="index" :key="item.id"
|
<u-swipe-action style="width: 100%;" :show="item.show" :index="index" :key="item.id"
|
||||||
@click="delTracks" @open="open" :options="options">
|
@click="delTracks" @open="open" :options="options">
|
||||||
<view class="myTracks-item">
|
<!-- 已失效商品 -->
|
||||||
<view class="myTracks-item-img" @click.stop="navgaiteToDetail(item)">
|
<div class="myTracks-item lose-goods" v-if="!item.storeName && !item.goodsName && !item.price">
|
||||||
|
已失效商品
|
||||||
|
</div>
|
||||||
|
<!-- 正常有效商品 -->
|
||||||
|
<view v-else class="myTracks-item">
|
||||||
|
<view class="myTracks-item-img" @click.stop="navigateToDetail(item)">
|
||||||
<image :src="item.thumbnail"></image>
|
<image :src="item.thumbnail"></image>
|
||||||
</view>
|
</view>
|
||||||
<view class="myTracks-item-content" @click.stop="navgaiteToDetail(item)">
|
<view class="myTracks-item-content" @click.stop="navigateToDetail(item)">
|
||||||
<view class="myTracks-item-title">
|
<view class="myTracks-item-title">
|
||||||
{{ item.goodsName }}
|
{{ item.goodsName }}
|
||||||
<view class="myTracks-item-title-desc"> </view>
|
<view class="myTracks-item-title-desc"> </view>
|
||||||
@@ -72,6 +77,7 @@
|
|||||||
this.getList();
|
this.getList();
|
||||||
},
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
|
this.params.pageNumber = 1
|
||||||
this.trackList = [];
|
this.trackList = [];
|
||||||
this.getList();
|
this.getList();
|
||||||
},
|
},
|
||||||
@@ -83,7 +89,7 @@
|
|||||||
/**
|
/**
|
||||||
* 导航到店铺
|
* 导航到店铺
|
||||||
*/
|
*/
|
||||||
navgaiteToStore(val) {
|
navigateToStore(val) {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: "/pages/product/shopPage?id=" + val.storeId,
|
url: "/pages/product/shopPage?id=" + val.storeId,
|
||||||
});
|
});
|
||||||
@@ -99,7 +105,7 @@
|
|||||||
/**
|
/**
|
||||||
* 跳转详情
|
* 跳转详情
|
||||||
*/
|
*/
|
||||||
navgaiteToDetail(item) {
|
navigateToDetail(item) {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: "/pages/product/goods?id=" + item.id + "&goodsId=" + item.goodsId,
|
url: "/pages/product/goods?id=" + item.id + "&goodsId=" + item.goodsId,
|
||||||
});
|
});
|
||||||
@@ -114,7 +120,7 @@
|
|||||||
});
|
});
|
||||||
myTrackList(this.params).then((res) => {
|
myTrackList(this.params).then((res) => {
|
||||||
uni.stopPullDownRefresh();
|
uni.stopPullDownRefresh();
|
||||||
uni.hideLoading();
|
if (this.$store.state.isShowToast){ uni.hideLoading() };
|
||||||
if (res.statusCode == 200) {
|
if (res.statusCode == 200) {
|
||||||
res.data.result.records.length &&
|
res.data.result.records.length &&
|
||||||
res.data.result.records.forEach((item) => {
|
res.data.result.records.forEach((item) => {
|
||||||
@@ -154,6 +160,10 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
.lose-goods{
|
||||||
|
color: $main-color;
|
||||||
|
padding-left: 50rpx !important;
|
||||||
|
}
|
||||||
.myTracks {
|
.myTracks {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
padding-top: 2rpx;
|
padding-top: 2rpx;
|
||||||
@@ -224,36 +234,10 @@
|
|||||||
padding: 10rpx 0 0 0;
|
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;
|
|
||||||
line-height: 60rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.myTracks-divider {
|
.myTracks-divider {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 20rpx;
|
height: 20rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
.myTracks-action-check {
|
|
||||||
align-items: center;
|
|
||||||
display: -webkit-box;
|
|
||||||
display: -webkit-flex;
|
|
||||||
display: flex;
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -22,10 +22,10 @@
|
|||||||
<div class="point-list">
|
<div class="point-list">
|
||||||
<view class="point-item" v-for="(item, index) in pointList" :key="index">
|
<view class="point-item" v-for="(item, index) in pointList" :key="index">
|
||||||
<view>
|
<view>
|
||||||
<view>{{ item.content }}</view>
|
<view class="point-label">{{ item.content }}</view>
|
||||||
<view>{{ item.createTime}}</view>
|
<view>{{ item.createTime}}</view>
|
||||||
</view>
|
</view>
|
||||||
<view><span>{{item.pointType == "INCREASE" ? '+' : '-'}}</span>{{ item.variablePoint }}</view>
|
<view :class="[item.pointType == 'INCREASE' ? 'plus' : 'reduce']"><span>{{item.pointType == "INCREASE" ? '+' : '-'}}</span>{{ item.variablePoint }}</view>
|
||||||
</view>
|
</view>
|
||||||
<uni-load-more :status="count.loadStatus"></uni-load-more>
|
<uni-load-more :status="count.loadStatus"></uni-load-more>
|
||||||
</div>
|
</div>
|
||||||
@@ -72,7 +72,7 @@ export default {
|
|||||||
title: "加载中",
|
title: "加载中",
|
||||||
});
|
});
|
||||||
getPointsData(params).then((res) => {
|
getPointsData(params).then((res) => {
|
||||||
uni.hideLoading();
|
if (this.$store.state.isShowToast){ uni.hideLoading() };
|
||||||
if (res.data.success) {
|
if (res.data.success) {
|
||||||
let data = res.data.result.records;
|
let data = res.data.result.records;
|
||||||
if (data.length < 10) {
|
if (data.length < 10) {
|
||||||
@@ -109,6 +109,14 @@ export default {
|
|||||||
font-size: 32rpx;
|
font-size: 32rpx;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
|
.plus{
|
||||||
|
color: $light-color;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
.reduce{
|
||||||
|
color: $weChat-color;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
.point-item {
|
.point-item {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
@@ -150,7 +158,7 @@ export default {
|
|||||||
border-right: 1px solid $border-color-light;
|
border-right: 1px solid $border-color-light;
|
||||||
}
|
}
|
||||||
.pcolor {
|
.pcolor {
|
||||||
color: #4ebb9d;
|
color: $light-color;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -168,7 +176,7 @@ export default {
|
|||||||
.portrait-box {
|
.portrait-box {
|
||||||
background-color: $main-color;
|
background-color: $main-color;
|
||||||
height: 250rpx;
|
height: 250rpx;
|
||||||
background: linear-gradient(134deg, #28d094 2%, #1abc9c 98%);
|
background: linear-gradient(91deg, $light-color 1%, $aider-light-color 99%);
|
||||||
border-radius: 20rpx 20rpx 0 0;
|
border-radius: 20rpx 20rpx 0 0;
|
||||||
margin: 20rpx 20rpx 0;
|
margin: 20rpx 20rpx 0;
|
||||||
position: relative;
|
position: relative;
|
||||||
@@ -212,5 +220,10 @@ export default {
|
|||||||
.point {
|
.point {
|
||||||
font-size: 56rpx;
|
font-size: 56rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
.point-label{
|
||||||
|
font-weight: bold;
|
||||||
|
margin-bottom: 10rpx;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -20,10 +20,10 @@
|
|||||||
<u-cell-item title="检查更新" @click="checkUpdate"></u-cell-item>
|
<u-cell-item title="检查更新" @click="checkUpdate"></u-cell-item>
|
||||||
<!-- #endif -->
|
<!-- #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=LICENSE_INFORMATION')"></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=USER_AGREEMENT')"></u-cell-item>
|
||||||
<u-cell-item title="隐私协议" @click="navigateTo('/pages/mine/help/tips?type=privacy')"></u-cell-item>
|
<u-cell-item title="隐私协议" @click="navigateTo('/pages/mine/help/tips?type=PRIVACY_POLICY')"></u-cell-item>
|
||||||
<u-cell-item title="关于我们" :border-bottom="false" @click="navigateTo('/pages/mine/help/tips?type=about')"></u-cell-item>
|
<u-cell-item title="关于我们" :border-bottom="false" @click="navigateTo('/pages/mine/help/tips?type=ABOUT')"></u-cell-item>
|
||||||
|
|
||||||
</u-cell-group>
|
</u-cell-group>
|
||||||
|
|
||||||
@@ -32,7 +32,7 @@
|
|||||||
<view style="margin:20rpx 0 0 0;">{{config.customerServiceEmail ? `客服邮箱:${config.customerServiceEmail}` : ``}}</view>
|
<view style="margin:20rpx 0 0 0;">{{config.customerServiceEmail ? `客服邮箱:${config.customerServiceEmail}` : ``}}</view>
|
||||||
|
|
||||||
<view>
|
<view>
|
||||||
<view style="margin:20rpx 0; color:#003a8c;" @click="navigateTo('/pages/mine/help/tips?type=user')">《{{config.name}}用户协议》</view>
|
<view style="margin:20rpx 0; color:#003a8c;" @click="navigateTo('/pages/mine/help/tips?type=USER_AGREEMENT')">《{{config.name}}用户协议》</view>
|
||||||
<view>CopyRight ©{{config.name}} </view>
|
<view>CopyRight ©{{config.name}} </view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|||||||
@@ -23,26 +23,22 @@
|
|||||||
<u-input v-model="form.___path" disabled @click="clickRegion" />
|
<u-input v-model="form.___path" disabled @click="clickRegion" />
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
<view class="submit" @click="submit">保存</view>
|
<view class="submit" @click="submit">保存</view>
|
||||||
<view class="submit" @click="showModalDialog">退出登录</view>
|
<view class="submit" @click="quiteLoginOut">退出登录</view>
|
||||||
<u-modal show-cancel-button v-model="quitShow" @confirm="confirm" :confirm-color="lightColor" :async-close="true"
|
|
||||||
:content="'确定要退出登录么?'"></u-modal>
|
|
||||||
</u-form>
|
</u-form>
|
||||||
|
|
||||||
<m-city :provinceData="region" headTitle="区域选择" ref="cityPicker" @funcValue="getpickerParentValue" pickerSize="4"></m-city>
|
<m-city :provinceData="region" headTitle="区域选择" ref="cityPicker" @funcValue="getPickerParentValue" pickerSize="4"></m-city>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import { logout } from "@/api/login";
|
|
||||||
import { saveUserInfo } from "@/api/members.js";
|
import { saveUserInfo } from "@/api/members.js";
|
||||||
import { upload } from "@/api/common.js";
|
import { upload } from "@/api/common.js";
|
||||||
import storage from "@/utils/storage.js";
|
import storage from "@/utils/storage.js";
|
||||||
import uFormItem from "@/uview-ui/components/u-form-item/u-form-item.vue";
|
import uFormItem from "@/uview-ui/components/u-form-item/u-form-item.vue";
|
||||||
import gkcity from "@/components/m-city/m-city.vue";
|
import city from "@/components/m-city/m-city.vue";
|
||||||
export default {
|
export default {
|
||||||
components: { uFormItem, "m-city": gkcity },
|
components: { uFormItem, "m-city": city },
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
quitShow: false,
|
|
||||||
lightColor: this.$lightColor, //高亮颜色
|
lightColor: this.$lightColor, //高亮颜色
|
||||||
form: {
|
form: {
|
||||||
nickName: storage.getUserInfo().nickName || "",
|
nickName: storage.getUserInfo().nickName || "",
|
||||||
@@ -71,38 +67,16 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
/**
|
/**
|
||||||
* 显示退出登录对话框
|
* 退出登录
|
||||||
*/
|
*/
|
||||||
showModalDialog() {
|
quiteLoginOut() {
|
||||||
this.quitShow = true;
|
this.$options.filters.quiteLoginOut();
|
||||||
},
|
|
||||||
|
|
||||||
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();
|
|
||||||
}
|
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 选择地址回调
|
* 选择地址回调
|
||||||
*/
|
*/
|
||||||
getpickerParentValue(e) {
|
getPickerParentValue(e) {
|
||||||
this.form.region = [];
|
this.form.region = [];
|
||||||
this.form.regionId = [];
|
this.form.regionId = [];
|
||||||
let name = "";
|
let name = "";
|
||||||
|
|||||||
@@ -115,7 +115,7 @@
|
|||||||
title: "正在获取验证码",
|
title: "正在获取验证码",
|
||||||
});
|
});
|
||||||
sendMobile(this.codeForm.mobile, "FIND_USER").then((res) => {
|
sendMobile(this.codeForm.mobile, "FIND_USER").then((res) => {
|
||||||
uni.hideLoading();
|
if (this.$store.state.isShowToast){ uni.hideLoading() };
|
||||||
// 这里此提示会被this.start()方法中的提示覆盖
|
// 这里此提示会被this.start()方法中的提示覆盖
|
||||||
if (res.data.success) {
|
if (res.data.success) {
|
||||||
this.$refs.uCode.start();
|
this.$refs.uCode.start();
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
<view class="securityCenter">
|
<view class="securityCenter">
|
||||||
<u-cell-group>
|
<u-cell-group>
|
||||||
<u-cell-item title="修改密码" @click="navigateTo('/pages/mine/set/securityCenter/editPassword')"></u-cell-item>
|
<u-cell-item title="修改密码" @click="navigateTo('/pages/mine/set/securityCenter/editPassword')"></u-cell-item>
|
||||||
|
<u-cell-item title="注销账户" @click="zhuxiao"></u-cell-item>
|
||||||
</u-cell-group>
|
</u-cell-group>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
@@ -15,6 +16,35 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
|
zhuxiao(){
|
||||||
|
|
||||||
|
uni.showModal({
|
||||||
|
title: "警告",
|
||||||
|
content: "您确定要注销当前账号吗?",
|
||||||
|
confirmText: "确定注销",
|
||||||
|
confirmColor: "#FF0000",
|
||||||
|
cancelText: "取消",
|
||||||
|
success: (res) => {
|
||||||
|
if (res.confirm) {
|
||||||
|
uni.showModal({
|
||||||
|
title: "谨慎操作",
|
||||||
|
content: "再次向您确认,您确定要注销当前账号吗?",
|
||||||
|
confirmText: "坚持注销",
|
||||||
|
confirmColor: "#FF0000",
|
||||||
|
cancelText: "取消",
|
||||||
|
success: (res) => {
|
||||||
|
if (res.confirm) {
|
||||||
|
uni.showToast({
|
||||||
|
title: "您的注销申请已经提交,待管理员审核后。会自动注销当前账号",
|
||||||
|
duration: 10000,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
});
|
||||||
|
},
|
||||||
navigateTo(url) {
|
navigateTo(url) {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: url,
|
url: url,
|
||||||
|
|||||||
@@ -1,10 +1,9 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="container">
|
<view class="container">
|
||||||
<view class="person" @click="checkUserInfo()">
|
<view class="person" @click="checkUserInfo()">
|
||||||
<u-image width=140 height="140" shape="circle" :src="userInfo.face || '/static/missing-face.png'" mode="">
|
<u-image width=140 height="140" shape="circle" :src="userInfo.face || userImage" mode="">
|
||||||
</u-image>
|
</u-image>
|
||||||
<view class="user-name">
|
<view class="user-name">
|
||||||
|
|
||||||
{{ userInfo.id ? userInfo.nickName || '' : '暂未登录' }}
|
{{ userInfo.id ? userInfo.nickName || '' : '暂未登录' }}
|
||||||
</view>
|
</view>
|
||||||
<u-icon color="#ccc" name="arrow-right"></u-icon>
|
<u-icon color="#ccc" name="arrow-right"></u-icon>
|
||||||
@@ -16,28 +15,25 @@
|
|||||||
<!-- #ifdef APP-PLUS -->
|
<!-- #ifdef APP-PLUS -->
|
||||||
<u-cell-item title="清除缓存" :value="fileSizeString" @click="clearCache"></u-cell-item>
|
<u-cell-item title="清除缓存" :value="fileSizeString" @click="clearCache"></u-cell-item>
|
||||||
<!-- #endif -->
|
<!-- #endif -->
|
||||||
|
<!-- #ifndef MP-WEIXIN -->
|
||||||
<u-cell-item title="安全中心" @click="navigateTo('/pages/mine/set/securityCenter/securityCenter')"></u-cell-item>
|
<u-cell-item title="安全中心" @click="navigateTo('/pages/mine/set/securityCenter/securityCenter')"></u-cell-item>
|
||||||
|
<!-- #endif -->
|
||||||
<u-cell-item title="意见反馈" @click="navigateTo('/pages/mine/set/feedBack')"></u-cell-item>
|
<u-cell-item title="意见反馈" @click="navigateTo('/pages/mine/set/feedBack')"></u-cell-item>
|
||||||
<!-- #ifndef H5 -->
|
<!-- #ifndef H5 -->
|
||||||
<!-- #endif -->
|
<!-- #endif -->
|
||||||
<u-cell-item :title="`关于${config.name}`" @click="navigateTo('/pages/mine/set/editionIntro')"></u-cell-item>
|
<u-cell-item :title="`关于${config.name}`" @click="navigateTo('/pages/mine/set/editionIntro')"></u-cell-item>
|
||||||
</u-cell-group>
|
</u-cell-group>
|
||||||
<view class="submit" @click="showModalDialog">{{userInfo.id ?'退出登录':'登录'}}</view>
|
<view class="submit" v-if="userInfo.id" @click="quiteLoginOut">退出登录</view>
|
||||||
<u-modal show-cancel-button v-model="quitShow" @confirm="confirm" :confirm-color="lightColor" :async-close="true"
|
|
||||||
:content="userInfo.id ? '确定要退出登录么?' : '确定要登录么?'"></u-modal>
|
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { logout } from "@/api/login";
|
|
||||||
import storage from "@/utils/storage.js";
|
|
||||||
import config from "@/config/config";
|
import config from "@/config/config";
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
config,
|
config,
|
||||||
lightColor: this.$lightColor,
|
userImage:config.defaultUserPhoto,
|
||||||
quitShow: false,
|
|
||||||
isCertificate: false,
|
isCertificate: false,
|
||||||
userInfo: {},
|
userInfo: {},
|
||||||
fileSizeString: "0B",
|
fileSizeString: "0B",
|
||||||
@@ -53,34 +49,14 @@ export default {
|
|||||||
url: url,
|
url: url,
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
clear() {
|
/**
|
||||||
storage.setAccessToken("");
|
* 退出登录
|
||||||
storage.setRefreshToken("");
|
*/
|
||||||
storage.setUserInfo({});
|
quiteLoginOut() {
|
||||||
this.$options.filters.navigateToLogin("redirectTo");
|
this.$options.filters.quiteLoginOut();
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
|
||||||
* 确认退出
|
|
||||||
* 清除缓存重新登录
|
|
||||||
*/
|
|
||||||
async confirm() {
|
|
||||||
try{
|
|
||||||
await logout();
|
|
||||||
this.clear();
|
|
||||||
}catch(e){
|
|
||||||
//TODO handle the exception
|
|
||||||
this.clear();
|
|
||||||
}
|
|
||||||
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 显示退出登录对话框
|
|
||||||
*/
|
|
||||||
showModalDialog() {
|
|
||||||
this.quitShow = true;
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 读取当前缓存
|
* 读取当前缓存
|
||||||
@@ -112,11 +88,7 @@ export default {
|
|||||||
if (this.$options.filters.isLogin("auth")) {
|
if (this.$options.filters.isLogin("auth")) {
|
||||||
this.navigateTo("/pages/mine/set/personMsg");
|
this.navigateTo("/pages/mine/set/personMsg");
|
||||||
} else {
|
} else {
|
||||||
uni.showToast({
|
this.$options.filters.tipsToLogin();
|
||||||
title: "当前暂无用户请登录后重试",
|
|
||||||
duration: 2000,
|
|
||||||
icon: "none",
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -63,18 +63,18 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="description">
|
<view class="description">
|
||||||
<!-- 售后申请 -->
|
<!-- 售后申请 -->
|
||||||
<view v-if="current === 0 && order.groupAfterSaleStatus">
|
<view v-if="current === 0 && sku.afterSaleStatus">
|
||||||
<view
|
<view
|
||||||
v-if="order.groupAfterSaleStatus.includes('ALREADY_APPLIED')"
|
v-if="sku.afterSaleStatus.includes('ALREADY_APPLIED')"
|
||||||
class="cannot_apply not_center"
|
class="cannot_apply not_center"
|
||||||
>
|
>
|
||||||
<u-icon class="icon" name="info-circle-fill"></u-icon>
|
<u-icon class="icon" name="info-circle-fill"></u-icon>
|
||||||
该商品已申请售后服务
|
该商品已申请售后服务
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view v-if="current === 0 && order.groupAfterSaleStatus">
|
<view v-if="current === 0 && sku.afterSaleStatus">
|
||||||
<view
|
<view
|
||||||
v-if="order.groupAfterSaleStatus.includes('EXPIRED')"
|
v-if="sku.afterSaleStatus.includes('EXPIRED')"
|
||||||
class="cannot_apply not_center"
|
class="cannot_apply not_center"
|
||||||
@click="tipsShow = true"
|
@click="tipsShow = true"
|
||||||
>
|
>
|
||||||
@@ -309,7 +309,7 @@ export default {
|
|||||||
mask: true,
|
mask: true,
|
||||||
});
|
});
|
||||||
getOrderList(this.params).then((res) => {
|
getOrderList(this.params).then((res) => {
|
||||||
uni.hideLoading();
|
if (this.$store.state.isShowToast){ uni.hideLoading() };
|
||||||
const orderList = res.data.result.records;
|
const orderList = res.data.result.records;
|
||||||
if (orderList.length > 0) {
|
if (orderList.length > 0) {
|
||||||
this.orderList = this.orderList.concat(orderList);
|
this.orderList = this.orderList.concat(orderList);
|
||||||
@@ -345,7 +345,7 @@ export default {
|
|||||||
this.orderList = [];
|
this.orderList = [];
|
||||||
this.searchOrderList(this.current);
|
this.searchOrderList(this.current);
|
||||||
|
|
||||||
uni.hideLoading();
|
if (this.$store.state.isShowToast){ uni.hideLoading() };
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -224,7 +224,7 @@ export default {
|
|||||||
this.reasonList = action;
|
this.reasonList = action;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
uni.hideLoading();
|
if (this.$store.state.isShowToast){ uni.hideLoading() };
|
||||||
},
|
},
|
||||||
//打开地区选择器
|
//打开地区选择器
|
||||||
showCitySelect() {
|
showCitySelect() {
|
||||||
@@ -288,7 +288,7 @@ export default {
|
|||||||
this.form.applyRefundPrice = this.applyInfo.applyRefundPrice;
|
this.form.applyRefundPrice = this.applyInfo.applyRefundPrice;
|
||||||
|
|
||||||
applyReturn(this.sn, this.form).then((resp) => {
|
applyReturn(this.sn, this.form).then((resp) => {
|
||||||
uni.hideLoading();
|
if (this.$store.state.isShowToast){ uni.hideLoading() };
|
||||||
if (resp.data.success) {
|
if (resp.data.success) {
|
||||||
this.$refs.uToast.show({ title: "提交成功", type: "success" });
|
this.$refs.uToast.show({ title: "提交成功", type: "success" });
|
||||||
uni.redirectTo({
|
uni.redirectTo({
|
||||||
|
|||||||
@@ -128,7 +128,7 @@ export default {
|
|||||||
});
|
});
|
||||||
delete this.form.courierCompany;
|
delete this.form.courierCompany;
|
||||||
fillShipInfo(this.serviceDetail.sn, this.form).then((res) => {
|
fillShipInfo(this.serviceDetail.sn, this.form).then((res) => {
|
||||||
uni.hideLoading();
|
if (this.$store.state.isShowToast){ uni.hideLoading() };
|
||||||
if (res.statusCode === 200) {
|
if (res.statusCode === 200) {
|
||||||
this.$refs.uToast.show({
|
this.$refs.uToast.show({
|
||||||
title: "提交成功",
|
title: "提交成功",
|
||||||
|
|||||||
@@ -352,7 +352,7 @@ export default {
|
|||||||
title: "加载中",
|
title: "加载中",
|
||||||
});
|
});
|
||||||
getServiceDetail(this.sn).then((res) => {
|
getServiceDetail(this.sn).then((res) => {
|
||||||
uni.hideLoading();
|
if (this.$store.state.isShowToast){ uni.hideLoading() };
|
||||||
this.serviceDetail = res.data.result;
|
this.serviceDetail = res.data.result;
|
||||||
if (
|
if (
|
||||||
this.serviceDetail.serviceType == "RETURN_GOODS" ||
|
this.serviceDetail.serviceType == "RETURN_GOODS" ||
|
||||||
|
|||||||
@@ -45,13 +45,13 @@
|
|||||||
<view class="cell-item">
|
<view class="cell-item">
|
||||||
<view class="cell-title"> 投诉凭证 </view>
|
<view class="cell-title"> 投诉凭证 </view>
|
||||||
<view class="cell-view">
|
<view class="cell-view">
|
||||||
<u-upload ref="uUpload" :header=" { accessToken: storage.getAccessToken() }" upload-text="" :action="action" width="100" @on-uploaded="onUploaded" :max-count="5">
|
<u-upload ref="uUpload" :header=" { accessToken: storage.getAccessToken() }" :action="action" width="200" @on-uploaded="onUploaded" :max-count="5">
|
||||||
</u-upload>
|
</u-upload>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="submit-btn" @click="handleSumit">提交</view>
|
<view class="submit-btn" @click="handleSubmit">提交</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -109,7 +109,15 @@ export default {
|
|||||||
/**
|
/**
|
||||||
* 提交
|
* 提交
|
||||||
*/
|
*/
|
||||||
handleSumit() {
|
handleSubmit() {
|
||||||
|
if(!this.images.length && !this.complainValue){
|
||||||
|
uni.showToast({
|
||||||
|
title:'请上传图片凭证和投诉内容',
|
||||||
|
icon:'none'
|
||||||
|
})
|
||||||
|
return
|
||||||
|
|
||||||
|
}
|
||||||
// 循环出商品
|
// 循环出商品
|
||||||
let goods = this.orderGoodsList.filter((item) => {
|
let goods = this.orderGoodsList.filter((item) => {
|
||||||
return item.skuId == this.skuId;
|
return item.skuId == this.skuId;
|
||||||
@@ -170,7 +178,7 @@ export default {
|
|||||||
this.order = order.order;
|
this.order = order.order;
|
||||||
this.orderGoodsList = order.orderItems;
|
this.orderGoodsList = order.orderItems;
|
||||||
this.orderDetail = res.data.result;
|
this.orderDetail = res.data.result;
|
||||||
uni.hideLoading();
|
if (this.$store.state.isShowToast){ uni.hideLoading() };
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@@ -49,11 +49,13 @@ export default {
|
|||||||
return {
|
return {
|
||||||
complainDetail: "", //投诉详情
|
complainDetail: "", //投诉详情
|
||||||
statusData: {
|
statusData: {
|
||||||
|
NEW: "新投诉",
|
||||||
NO_APPLY: "未申请",
|
NO_APPLY: "未申请",
|
||||||
APPLYING: "申请中",
|
APPLYING: "申请中",
|
||||||
COMPLETE: "已完成,此时可申请",
|
COMPLETE: "已完成",
|
||||||
EXPIRED: "已失效,不可申请",
|
EXPIRED: "已失效",
|
||||||
CANCEL: "已取消",
|
CANCEL: "已取消",
|
||||||
|
WAIT_ARBITRATION:"等待仲裁"
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
@@ -93,7 +95,7 @@ export default {
|
|||||||
icon: "none",
|
icon: "none",
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
uni.hideLoading();
|
if (this.$store.state.isShowToast){ uni.hideLoading() };
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -48,12 +48,13 @@ export default {
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
statusData: {
|
statusData: {
|
||||||
NEW: "新订单",
|
NEW: "新投诉",
|
||||||
NO_APPLY: "未申请",
|
NO_APPLY: "未申请",
|
||||||
APPLYING: "申请中",
|
APPLYING: "申请中",
|
||||||
COMPLETE: "已完成",
|
COMPLETE: "已完成",
|
||||||
EXPIRED: "已失效",
|
EXPIRED: "已失效",
|
||||||
CANCEL: "已取消",
|
CANCEL: "已取消",
|
||||||
|
WAIT_ARBITRATION:"等待仲裁"
|
||||||
},
|
},
|
||||||
show: false,
|
show: false,
|
||||||
content: "是否撤销投诉?",
|
content: "是否撤销投诉?",
|
||||||
@@ -139,7 +140,7 @@ export default {
|
|||||||
} else {
|
} else {
|
||||||
this.empty = true;
|
this.empty = true;
|
||||||
}
|
}
|
||||||
uni.hideLoading();
|
if (this.$store.state.isShowToast){ uni.hideLoading() };
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
<view class="exaluate-member-view">
|
<view class="exaluate-member-view">
|
||||||
<view class="member-view">
|
<view class="member-view">
|
||||||
<view class="member-img">
|
<view class="member-img">
|
||||||
<u-image width="82rpx" style="border: 1px solid #ededed" height="82rpx" shape="circle" :src="comment.memberProfile || '/static/missing-face.png'"></u-image>
|
<u-image width="82rpx" style="border: 1px solid #ededed" height="82rpx" shape="circle" :src="comment.memberProfile || userImage"></u-image>
|
||||||
</view>
|
</view>
|
||||||
<view class="member-info">
|
<view class="member-info">
|
||||||
<view class="memName">{{ comment.memberName }}</view>
|
<view class="memName">{{ comment.memberName }}</view>
|
||||||
@@ -41,9 +41,13 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import configs from '@/config/config'
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
configs,
|
||||||
|
userImage:configs.defaultUserPhoto,
|
||||||
|
|
||||||
comment: {}, //评论信息
|
comment: {}, //评论信息
|
||||||
gradeList: {
|
gradeList: {
|
||||||
//评价grade
|
//评价grade
|
||||||
|
|||||||
@@ -202,7 +202,7 @@ export default {
|
|||||||
title: "加载中",
|
title: "加载中",
|
||||||
});
|
});
|
||||||
getOrderList(this.params).then((res) => {
|
getOrderList(this.params).then((res) => {
|
||||||
uni.hideLoading();
|
if (this.$store.state.isShowToast){ uni.hideLoading() };
|
||||||
const orderList = res.data.result.records;
|
const orderList = res.data.result.records;
|
||||||
if (orderList.length < 10) {
|
if (orderList.length < 10) {
|
||||||
this.params.loadStatus = "noMore";
|
this.params.loadStatus = "noMore";
|
||||||
@@ -234,7 +234,7 @@ export default {
|
|||||||
title: "加载中",
|
title: "加载中",
|
||||||
});
|
});
|
||||||
getComments(this.params).then((res) => {
|
getComments(this.params).then((res) => {
|
||||||
uni.hideLoading();
|
if (this.$store.state.isShowToast){ uni.hideLoading() };
|
||||||
let orderList = res.data.result.records;
|
let orderList = res.data.result.records;
|
||||||
if (orderList.length < 10) {
|
if (orderList.length < 10) {
|
||||||
this.params.loadStatus = "noMore";
|
this.params.loadStatus = "noMore";
|
||||||
|
|||||||
@@ -137,7 +137,7 @@ export default {
|
|||||||
title: "加载中",
|
title: "加载中",
|
||||||
});
|
});
|
||||||
commentsMemberOrder(this.form).then((res) => {
|
commentsMemberOrder(this.form).then((res) => {
|
||||||
uni.hideLoading();
|
if (this.$store.state.isShowToast){ uni.hideLoading() };
|
||||||
if (res.data.success) {
|
if (res.data.success) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: "发布评价成功",
|
title: "发布评价成功",
|
||||||
|
|||||||
@@ -1,7 +1,11 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="wrapper">
|
<div class="wrapper">
|
||||||
<!-- 选择地址 -->
|
<!-- 选择地址 -->
|
||||||
<div class="address-box" @click="clickToAddress()">
|
<div
|
||||||
|
class="address-box"
|
||||||
|
@click="clickToAddress()"
|
||||||
|
v-if="shippingText == 'LOGISTICS' && orderMessage.cartTypeEnum != 'VIRTUAL'"
|
||||||
|
>
|
||||||
<div class="user-box flex">
|
<div class="user-box flex">
|
||||||
<div class="flex-8">
|
<div class="flex-8">
|
||||||
<div v-if="!address.id">请选择地址</div>
|
<div v-if="!address.id">请选择地址</div>
|
||||||
@@ -40,6 +44,29 @@
|
|||||||
<!-- 背景 -->
|
<!-- 背景 -->
|
||||||
<div class="bar"></div>
|
<div class="bar"></div>
|
||||||
</div>
|
</div>
|
||||||
|
<!-- 选择自提点 -->
|
||||||
|
<div class="address-box" v-if="shippingText == 'SELF_PICK_UP'">
|
||||||
|
<div @click="clickToStoreAddress()">
|
||||||
|
<div class="user-box flex">
|
||||||
|
<div class="flex-8">
|
||||||
|
<div v-if="storeAddress">
|
||||||
|
<div class="user-address">
|
||||||
|
<!-- 自提点地址 -->
|
||||||
|
<div class="user-address-detail wes-2">
|
||||||
|
{{ storeAddress.address }}
|
||||||
|
</div>
|
||||||
|
<!-- 联系手机号 -->
|
||||||
|
<div></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div v-else>请选择自提点</div>
|
||||||
|
</div>
|
||||||
|
<u-icon name="arrow-right" style="color: #bababa"></u-icon>
|
||||||
|
</div>
|
||||||
|
<!-- 背景 -->
|
||||||
|
<div class="bar"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<!-- 开团信息 -->
|
<!-- 开团信息 -->
|
||||||
<view class="group-box" v-if="isAssemble">
|
<view class="group-box" v-if="isAssemble">
|
||||||
@@ -58,7 +85,7 @@
|
|||||||
class="head-img"
|
class="head-img"
|
||||||
width="81rpx"
|
width="81rpx"
|
||||||
height="81rpx"
|
height="81rpx"
|
||||||
:src="masterWay.face || '/static/missing-face.png'"
|
:src="masterWay.face || userImage"
|
||||||
></u-image>
|
></u-image>
|
||||||
<view class="btn-one">团长</view>
|
<view class="btn-one">团长</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -83,7 +110,7 @@
|
|||||||
v-else
|
v-else
|
||||||
width="81rpx"
|
width="81rpx"
|
||||||
height="81rpx"
|
height="81rpx"
|
||||||
:src="endWay.face || '/static/missing-face.png'"
|
:src="endWay.face || userImage"
|
||||||
></u-image>
|
></u-image>
|
||||||
|
|
||||||
<view class="wait">{{ endWay.nickname || "等待参团" }}</view>
|
<view class="wait">{{ endWay.nickname || "等待参团" }}</view>
|
||||||
@@ -149,7 +176,11 @@
|
|||||||
<span class="goods-price">{{
|
<span class="goods-price">{{
|
||||||
$options.filters.goodsFormatPrice(val.purchasePrice)[0]
|
$options.filters.goodsFormatPrice(val.purchasePrice)[0]
|
||||||
}}</span>
|
}}</span>
|
||||||
<span>.{{ $options.filters.goodsFormatPrice(val.purchasePrice)[1] }}</span>
|
<span
|
||||||
|
>.{{
|
||||||
|
$options.filters.goodsFormatPrice(val.purchasePrice)[1]
|
||||||
|
}}</span
|
||||||
|
>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -210,7 +241,12 @@
|
|||||||
@callbackInvoice="callbackInvoice"
|
@callbackInvoice="callbackInvoice"
|
||||||
v-if="invoiceFlag"
|
v-if="invoiceFlag"
|
||||||
/>
|
/>
|
||||||
<u-select v-model="shippingFlag" :list="shippingMethod"></u-select>
|
<u-select
|
||||||
|
@confirm="confirmDistribution"
|
||||||
|
v-model="shippingFlag"
|
||||||
|
v-if="shippingMethod.length != 0"
|
||||||
|
:list="shippingMethod"
|
||||||
|
></u-select>
|
||||||
|
|
||||||
<div class="box box5" v-if="orderMessage.priceDetailDTO">
|
<div class="box box5" v-if="orderMessage.priceDetailDTO">
|
||||||
<div>
|
<div>
|
||||||
@@ -224,7 +260,7 @@
|
|||||||
</u-row>
|
</u-row>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<u-row>
|
<u-row v-if="shippingText == 'LOGISTICS'">
|
||||||
<u-col v-if="orderMessage.cartTypeEnum != 'VIRTUAL'" :span="7"
|
<u-col v-if="orderMessage.cartTypeEnum != 'VIRTUAL'" :span="7"
|
||||||
>运费</u-col
|
>运费</u-col
|
||||||
>
|
>
|
||||||
@@ -245,9 +281,13 @@
|
|||||||
</u-col>
|
</u-col>
|
||||||
</u-row>
|
</u-row>
|
||||||
</div>
|
</div>
|
||||||
<u-row>
|
<u-row
|
||||||
|
v-if="
|
||||||
|
orderMessage.priceDetailDTO.goodsPrice != 0 &&
|
||||||
|
orderMessage.priceDetailDTO.goodsPrice != null
|
||||||
|
"
|
||||||
|
>
|
||||||
<u-col :offset="0" :span="9" @click="GET_Discount()">优惠券</u-col>
|
<u-col :offset="0" :span="9" @click="GET_Discount()">优惠券</u-col>
|
||||||
|
|
||||||
<u-col
|
<u-col
|
||||||
:span="3"
|
:span="3"
|
||||||
v-if="
|
v-if="
|
||||||
@@ -277,8 +317,8 @@
|
|||||||
>
|
>
|
||||||
<span class="main-color">
|
<span class="main-color">
|
||||||
-¥{{ orderMessage.priceDetailDTO.couponPrice | unitPrice }}</span
|
-¥{{ orderMessage.priceDetailDTO.couponPrice | unitPrice }}</span
|
||||||
></u-col
|
>
|
||||||
>
|
</u-col>
|
||||||
<u-col :span="3" textAlign="right" v-else>0.00</u-col>
|
<u-col :span="3" textAlign="right" v-else>0.00</u-col>
|
||||||
</u-row>
|
</u-row>
|
||||||
</div>
|
</div>
|
||||||
@@ -315,10 +355,16 @@
|
|||||||
<div v-if="!orderMessage.priceDetailDTO.payPoint" class="number">
|
<div v-if="!orderMessage.priceDetailDTO.payPoint" class="number">
|
||||||
<span>¥</span>
|
<span>¥</span>
|
||||||
<span class="price">{{
|
<span class="price">{{
|
||||||
$options.filters.goodsFormatPrice(orderMessage.priceDetailDTO.flowPrice)[0]
|
$options.filters.goodsFormatPrice(
|
||||||
|
orderMessage.priceDetailDTO.flowPrice
|
||||||
|
)[0]
|
||||||
}}</span>
|
}}</span>
|
||||||
<span
|
<span
|
||||||
>.{{ $options.filters.goodsFormatPrice(orderMessage.priceDetailDTO.flowPrice)[1] }}
|
>.{{
|
||||||
|
$options.filters.goodsFormatPrice(
|
||||||
|
orderMessage.priceDetailDTO.flowPrice
|
||||||
|
)[1]
|
||||||
|
}}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<span v-else class="number"
|
<span v-else class="number"
|
||||||
@@ -344,9 +390,9 @@ import * as API_Trade from "@/api/trade";
|
|||||||
import * as API_Address from "@/api/address";
|
import * as API_Address from "@/api/address";
|
||||||
import * as API_Order from "@/api/order";
|
import * as API_Order from "@/api/order";
|
||||||
import invoices from "@/pages/order/invoice/setInvoice";
|
import invoices from "@/pages/order/invoice/setInvoice";
|
||||||
|
import { mapState } from "vuex";
|
||||||
import LiLiWXPay from "@/js_sdk/lili-pay/wx-pay.js";
|
import LiLiWXPay from "@/js_sdk/lili-pay/wx-pay.js";
|
||||||
|
import configs from "@/config/config";
|
||||||
export default {
|
export default {
|
||||||
onLoad: function (val) {
|
onLoad: function (val) {
|
||||||
this.routerVal = val;
|
this.routerVal = val;
|
||||||
@@ -355,20 +401,27 @@ export default {
|
|||||||
invoices,
|
invoices,
|
||||||
},
|
},
|
||||||
|
|
||||||
watch: {},
|
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
configs,
|
||||||
|
userImage: configs.defaultUserPhoto,
|
||||||
invoiceFlag: false, //开票开关
|
invoiceFlag: false, //开票开关
|
||||||
shippingText: "LOGISTICS",
|
shippingText: "LOGISTICS",
|
||||||
shippingFlag: false,
|
shippingFlag: false,
|
||||||
shippingMethod: [
|
shippingMethod: [],
|
||||||
|
shippingWay: [
|
||||||
{
|
{
|
||||||
value: "LOGISTICS",
|
value: "LOGISTICS",
|
||||||
label: "物流",
|
label: "物流",
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
value: "SELF_PICK_UP",
|
||||||
|
label: "自提",
|
||||||
|
},
|
||||||
],
|
],
|
||||||
isAssemble: false, //是否拼团
|
isAssemble: false, //是否拼团
|
||||||
couponNums: "", //结算页面优惠券数量
|
// 判断是否填写过备注
|
||||||
|
remarkFlag: false,
|
||||||
selectAddressId: "",
|
selectAddressId: "",
|
||||||
routerVal: "",
|
routerVal: "",
|
||||||
params: {},
|
params: {},
|
||||||
@@ -376,6 +429,7 @@ export default {
|
|||||||
couponList: "",
|
couponList: "",
|
||||||
// 已选地址
|
// 已选地址
|
||||||
address: "",
|
address: "",
|
||||||
|
shopAddress: "",
|
||||||
// 发票信息
|
// 发票信息
|
||||||
receiptList: "",
|
receiptList: "",
|
||||||
// 店铺信息
|
// 店铺信息
|
||||||
@@ -383,14 +437,29 @@ export default {
|
|||||||
data: "",
|
data: "",
|
||||||
// 存储备注
|
// 存储备注
|
||||||
remarkVal: [],
|
remarkVal: [],
|
||||||
|
remarkVal1: "",
|
||||||
detail: "", //返回的所有数据
|
detail: "", //返回的所有数据
|
||||||
endWay: "", //最后一个参团人
|
endWay: "", //最后一个参团人
|
||||||
masterWay: "", //团长信息
|
masterWay: "", //团长信息
|
||||||
pintuanFlage: true, //是开团还是拼团
|
pintuanFlage: true, //是开团还是拼团
|
||||||
notSupportFreight: [], //不支持运费
|
notSupportFreight: [], //不支持运费
|
||||||
notSupportFreightGoodsList: ["以下商品超出配送范围:"],
|
notSupportFreightGoodsList: ["以下商品超出配送范围:"],
|
||||||
|
storeAddress: "",
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
watch: {
|
||||||
|
// 监听备注 并在 vuex 中存储
|
||||||
|
remarkVal: {
|
||||||
|
handler(val) {
|
||||||
|
this.$store.commit("setRemark", val);
|
||||||
|
},
|
||||||
|
immediate: true,
|
||||||
|
deep: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
...mapState(["remark"]),
|
||||||
|
},
|
||||||
filters: {
|
filters: {
|
||||||
/**
|
/**
|
||||||
* 发票收据类型
|
* 发票收据类型
|
||||||
@@ -438,12 +507,19 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
onShow() {
|
async onShow() {
|
||||||
|
// 判断是否存在写过备注信息的商品
|
||||||
|
if (this.remark && this.remark.length > 0) {
|
||||||
|
this.remarkFlag = true;
|
||||||
|
}
|
||||||
uni.showLoading({
|
uni.showLoading({
|
||||||
mask: true,
|
mask: true,
|
||||||
});
|
});
|
||||||
this.getOrderList();
|
await this.getOrderList();
|
||||||
uni.hideLoading();
|
await this.getDistribution();
|
||||||
|
if (this.$store.state.isShowToast) {
|
||||||
|
uni.hideLoading();
|
||||||
|
}
|
||||||
if (this.routerVal.way == "PINTUAN") {
|
if (this.routerVal.way == "PINTUAN") {
|
||||||
this.isAssemble = true;
|
this.isAssemble = true;
|
||||||
this.routerVal.parentOrder = JSON.parse(
|
this.routerVal.parentOrder = JSON.parse(
|
||||||
@@ -488,6 +564,11 @@ export default {
|
|||||||
)}`
|
)}`
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
clickToStoreAddress() {
|
||||||
|
this.navigateTo(
|
||||||
|
`/pages/mine/address/storeAddress?from=cart&way=${this.routerVal.way}&storeId=${this.remarkVal[0].storeId}`
|
||||||
|
);
|
||||||
|
},
|
||||||
|
|
||||||
// 判断团长以及团员信息
|
// 判断团长以及团员信息
|
||||||
pintuanWay() {
|
pintuanWay() {
|
||||||
@@ -561,14 +642,26 @@ export default {
|
|||||||
createTradeFun() {
|
createTradeFun() {
|
||||||
// 防抖
|
// 防抖
|
||||||
this.$u.throttle(() => {
|
this.$u.throttle(() => {
|
||||||
if (!this.address.id) {
|
if (this.shippingText === "SELF_PICK_UP") {
|
||||||
uni.showToast({
|
if (!this.storeAddress.id) {
|
||||||
title: "请选择地址",
|
uni.showToast({
|
||||||
duration: 2000,
|
title: "请选择提货点",
|
||||||
icon: "none",
|
duration: 2000,
|
||||||
});
|
icon: "none",
|
||||||
return false;
|
});
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
} else if (this.shippingText === "LOGISTICS" && this.orderMessage.cartTypeEnum != 'VIRTUAL') {
|
||||||
|
if (!this.address.id) {
|
||||||
|
uni.showToast({
|
||||||
|
title: "请选择地址",
|
||||||
|
duration: 2000,
|
||||||
|
icon: "none",
|
||||||
|
});
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 创建订单
|
// 创建订单
|
||||||
let client;
|
let client;
|
||||||
// #ifdef H5
|
// #ifdef H5
|
||||||
@@ -653,9 +746,42 @@ export default {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
// 获取配送列表
|
||||||
|
async getDistribution() {
|
||||||
|
let shopRes = await API_Trade.shippingMethodList({
|
||||||
|
way: this.routerVal.way,
|
||||||
|
});
|
||||||
|
let shopList;
|
||||||
|
if (shopRes.data.success) {
|
||||||
|
shopList = shopRes.data.result;
|
||||||
|
let way = [];
|
||||||
|
console.log(shopList);
|
||||||
|
this.shippingWay.forEach((item) => {
|
||||||
|
shopList.forEach((child) => {
|
||||||
|
if (item.value == child) {
|
||||||
|
way.push(item);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
this.shippingMethod = way;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
// 选择配送
|
||||||
|
async confirmDistribution(val) {
|
||||||
|
let res = await API_Trade.setShipMethod({
|
||||||
|
shippingMethod: val[0].value,
|
||||||
|
way: this.routerVal.way,
|
||||||
|
});
|
||||||
|
|
||||||
|
this.shippingText = val[0].value;
|
||||||
|
if (res.data.success) {
|
||||||
|
this.getOrderList();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
// 获取结算参数
|
// 获取结算参数
|
||||||
getOrderList() {
|
async getOrderList() {
|
||||||
this.notSupportFreight = [];
|
this.notSupportFreight = [];
|
||||||
// 获取结算参数
|
// 获取结算参数
|
||||||
API_Trade.getCheckoutParams(this.routerVal.way).then((res) => {
|
API_Trade.getCheckoutParams(this.routerVal.way).then((res) => {
|
||||||
@@ -672,12 +798,22 @@ export default {
|
|||||||
url: "/pages/order/myOrder?status=0",
|
url: "/pages/order/myOrder?status=0",
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let repeatData;
|
||||||
res.data.result.cartList.forEach((item, index) => {
|
res.data.result.cartList.forEach((item, index) => {
|
||||||
this.remarkVal[index] = {
|
// 如果已经写过备注信息的话赋值
|
||||||
remark: item.remark,
|
repeatData = {
|
||||||
|
remark: this.remarkFlag
|
||||||
|
? this.remark[index].storeId == item.storeId
|
||||||
|
? this.remark[index].remark
|
||||||
|
: item.remark
|
||||||
|
: item.remark,
|
||||||
storeId: item.storeId,
|
storeId: item.storeId,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
this.$set(this.remarkVal, index, repeatData);
|
||||||
});
|
});
|
||||||
|
|
||||||
this.orderMessage = res.data.result;
|
this.orderMessage = res.data.result;
|
||||||
/**
|
/**
|
||||||
* 为了避免路径传值在h5中超出限制问题
|
* 为了避免路径传值在h5中超出限制问题
|
||||||
@@ -686,7 +822,7 @@ export default {
|
|||||||
this.$store.state.canUseCoupons = res.data.result.canUseCoupons;
|
this.$store.state.canUseCoupons = res.data.result.canUseCoupons;
|
||||||
this.$store.state.cantUseCoupons = res.data.result.cantUseCoupons;
|
this.$store.state.cantUseCoupons = res.data.result.cantUseCoupons;
|
||||||
|
|
||||||
if (!res.data.result.memberAddress.id) {
|
if (!res.data.result.memberAddress) {
|
||||||
// 获取会员默认地址
|
// 获取会员默认地址
|
||||||
this.getUserAddress();
|
this.getUserAddress();
|
||||||
} else {
|
} else {
|
||||||
@@ -694,7 +830,10 @@ export default {
|
|||||||
res.data.result.memberAddress.consigneeAddressPath =
|
res.data.result.memberAddress.consigneeAddressPath =
|
||||||
res.data.result.memberAddress.consigneeAddressPath.split(",");
|
res.data.result.memberAddress.consigneeAddressPath.split(",");
|
||||||
}
|
}
|
||||||
|
if (res.data.result.storeAddress) {
|
||||||
|
this.storeAddress = res.data.result.storeAddress;
|
||||||
|
console.log("storeAddress", this.storeAddress);
|
||||||
|
}
|
||||||
if (
|
if (
|
||||||
res.data.result.notSupportFreight &&
|
res.data.result.notSupportFreight &&
|
||||||
res.data.result.notSupportFreight.length != 0
|
res.data.result.notSupportFreight.length != 0
|
||||||
@@ -714,7 +853,7 @@ export default {
|
|||||||
</script>
|
</script>
|
||||||
<style scoped>
|
<style scoped>
|
||||||
page {
|
page {
|
||||||
background: #ededed !important;
|
background: #f7f7f7;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
@@ -723,24 +862,29 @@ page {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.main-color {
|
.main-color {
|
||||||
|
color: $main-color;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
|
|
||||||
.uinput {
|
.uinput {
|
||||||
/deep/ input {
|
/deep/ input {
|
||||||
text-align: right;
|
text-align: right;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.promotionNotice {
|
.promotionNotice {
|
||||||
font-size: 24rpx;
|
font-size: 24rpx;
|
||||||
margin: 20rpx 0;
|
margin: 20rpx 0;
|
||||||
color: $aider-light-color;
|
color: $aider-light-color;
|
||||||
}
|
}
|
||||||
|
|
||||||
.nums {
|
.nums {
|
||||||
flex: 2;
|
flex: 2;
|
||||||
color: $light-color;
|
color: $light-color;
|
||||||
|
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.wait {
|
.wait {
|
||||||
font-size: 22rpx;
|
font-size: 22rpx;
|
||||||
font-family: PingFang SC, PingFang SC-Regular;
|
font-family: PingFang SC, PingFang SC-Regular;
|
||||||
@@ -756,6 +900,7 @@ page {
|
|||||||
width: 143rpx;
|
width: 143rpx;
|
||||||
border-bottom: 2px dotted #999;
|
border-bottom: 2px dotted #999;
|
||||||
}
|
}
|
||||||
|
|
||||||
.tabbar-left {
|
.tabbar-left {
|
||||||
margin-left: 32rpx;
|
margin-left: 32rpx;
|
||||||
}
|
}
|
||||||
@@ -808,6 +953,7 @@ page {
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.tr {
|
.tr {
|
||||||
text-align: right;
|
text-align: right;
|
||||||
}
|
}
|
||||||
@@ -830,6 +976,7 @@ page {
|
|||||||
.box2 {
|
.box2 {
|
||||||
margin-top: 20rpx;
|
margin-top: 20rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.notSupportFreight {
|
.notSupportFreight {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
|
|
||||||
@@ -849,6 +996,7 @@ page {
|
|||||||
margin: 0 32rpx;
|
margin: 0 32rpx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/deep/ .u-notice-bar-wrap {
|
/deep/ .u-notice-bar-wrap {
|
||||||
width: 100% !important;
|
width: 100% !important;
|
||||||
}
|
}
|
||||||
@@ -926,6 +1074,7 @@ page {
|
|||||||
color: $main-color;
|
color: $main-color;
|
||||||
font-size: 26rpx;
|
font-size: 26rpx;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
|
|
||||||
> span {
|
> span {
|
||||||
font-size: 36rpx;
|
font-size: 36rpx;
|
||||||
}
|
}
|
||||||
@@ -936,6 +1085,7 @@ page {
|
|||||||
color: $main-color;
|
color: $main-color;
|
||||||
font-size: 28rpx;
|
font-size: 28rpx;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
|
|
||||||
> .goods-price {
|
> .goods-price {
|
||||||
font-size: 38rpx;
|
font-size: 38rpx;
|
||||||
padding: 0 2rpx;
|
padding: 0 2rpx;
|
||||||
@@ -977,6 +1127,7 @@ page {
|
|||||||
text-align: left;
|
text-align: left;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
.default {
|
.default {
|
||||||
background: $main-color;
|
background: $main-color;
|
||||||
font-size: 24rpx;
|
font-size: 24rpx;
|
||||||
@@ -985,6 +1136,7 @@ page {
|
|||||||
color: #fff;
|
color: #fff;
|
||||||
margin-right: 20rpx;
|
margin-right: 20rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.address-box {
|
.address-box {
|
||||||
border-radius: 40rpx;
|
border-radius: 40rpx;
|
||||||
border-top-left-radius: 0 !important;
|
border-top-left-radius: 0 !important;
|
||||||
@@ -999,9 +1151,11 @@ page {
|
|||||||
font-weight: normal;
|
font-weight: normal;
|
||||||
letter-spacing: 1rpx;
|
letter-spacing: 1rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.user-box {
|
.user-box {
|
||||||
padding: 32rpx;
|
padding: 32rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.user-address-detail {
|
.user-address-detail {
|
||||||
color: #333;
|
color: #333;
|
||||||
font-size: 38rpx;
|
font-size: 38rpx;
|
||||||
@@ -1009,13 +1163,16 @@ page {
|
|||||||
margin: 20rpx 0;
|
margin: 20rpx 0;
|
||||||
letter-spacing: 1rpx;
|
letter-spacing: 1rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mobile {
|
.mobile {
|
||||||
margin-left: 20rpx;
|
margin-left: 20rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.price {
|
.price {
|
||||||
font-size: 50rpx !important;
|
font-size: 50rpx !important;
|
||||||
margin: 0 2rpx;
|
margin: 0 2rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.goods-detail {
|
.goods-detail {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
@@ -1023,12 +1180,14 @@ page {
|
|||||||
justify-content: center;
|
justify-content: center;
|
||||||
flex: 8;
|
flex: 8;
|
||||||
margin-left: 20rpx !important;
|
margin-left: 20rpx !important;
|
||||||
|
|
||||||
> p {
|
> p {
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.goods-item {
|
.goods-item {
|
||||||
margin: 20rpx 0;
|
margin: 20rpx 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -40,8 +40,8 @@
|
|||||||
>
|
>
|
||||||
<!-- 店铺名称 -->
|
<!-- 店铺名称 -->
|
||||||
<view class="seller-info u-flex u-row-between">
|
<view class="seller-info u-flex u-row-between">
|
||||||
<view class="seller-name" @click="navigateToStore(order)">
|
<view class="seller-name wes" @click="navigateToStore(order)">
|
||||||
<view class="name">{{ order.storeName }}</view>
|
<view class="name wes">{{ order.storeName }}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="order-sn">{{
|
<view class="order-sn">{{
|
||||||
order.orderStatus | orderStatusList
|
order.orderStatus | orderStatusList
|
||||||
@@ -90,19 +90,19 @@
|
|||||||
<div v-else>应付金额:</div>
|
<div v-else>应付金额:</div>
|
||||||
<div class="price">¥{{ order.flowPrice | unitPrice }}</div>
|
<div class="price">¥{{ order.flowPrice | unitPrice }}</div>
|
||||||
</view>
|
</view>
|
||||||
<view>
|
<view class="goods-btn flex flex-a-c">
|
||||||
<!-- 全部 -->
|
<!-- 全部 -->
|
||||||
<u-button
|
<view
|
||||||
ripple
|
ripple
|
||||||
class="pay-btn"
|
class="pay-btn"
|
||||||
shape="circle"
|
shape="circle"
|
||||||
size="mini"
|
size="mini"
|
||||||
v-if="order.allowOperationVO.pay"
|
v-if="order.allowOperationVO.pay"
|
||||||
@click="waitPay(order)"
|
@click="waitPay(order)"
|
||||||
>立即付款</u-button
|
>立即付款</view
|
||||||
>
|
>
|
||||||
<!-- 取消订单 -->
|
<!-- 取消订单 -->
|
||||||
<u-button
|
<view
|
||||||
ripple
|
ripple
|
||||||
class="cancel-btn"
|
class="cancel-btn"
|
||||||
shape="circle"
|
shape="circle"
|
||||||
@@ -111,9 +111,9 @@
|
|||||||
@click="onCancel(order.sn)"
|
@click="onCancel(order.sn)"
|
||||||
>
|
>
|
||||||
取消订单
|
取消订单
|
||||||
</u-button>
|
</view>
|
||||||
<!-- 等待收货 -->
|
<!-- 等待收货 -->
|
||||||
<u-button
|
<view
|
||||||
ripple
|
ripple
|
||||||
shape="circle"
|
shape="circle"
|
||||||
class="rebuy-btn"
|
class="rebuy-btn"
|
||||||
@@ -122,10 +122,9 @@
|
|||||||
@click="navigateToLogistics(order)"
|
@click="navigateToLogistics(order)"
|
||||||
>
|
>
|
||||||
查看物流
|
查看物流
|
||||||
</u-button>
|
</view>
|
||||||
<u-button
|
<view
|
||||||
ripple
|
ripple
|
||||||
:customStyle="{ background: lightColor, color: '#fff' }"
|
|
||||||
shape="circle"
|
shape="circle"
|
||||||
class="pay-btn"
|
class="pay-btn"
|
||||||
size="mini"
|
size="mini"
|
||||||
@@ -133,17 +132,17 @@
|
|||||||
@click="onRog(order.sn)"
|
@click="onRog(order.sn)"
|
||||||
>
|
>
|
||||||
确认收货
|
确认收货
|
||||||
</u-button>
|
</view>
|
||||||
<u-button
|
<view
|
||||||
ripple
|
ripple
|
||||||
shape="circle"
|
shape="circle"
|
||||||
class="cancel-btn"
|
class="cancel-btn"
|
||||||
size="mini"
|
size="mini"
|
||||||
v-if="order.groupAfterSaleStatus && order.groupAfterSaleStatus.includes('NOT_APPLIED')"
|
v-if="order.groupAfterSaleStatus && (order.groupAfterSaleStatus==='NOT_APPLIED'|| order.groupAfterSaleStatus==='PART_AFTER_SALE' )"
|
||||||
@click="applyService(order)"
|
@click="applyService(order)"
|
||||||
>
|
>
|
||||||
退款/售后
|
退款/售后
|
||||||
</u-button>
|
</view>
|
||||||
<!-- TODO 后续完善 -->
|
<!-- TODO 后续完善 -->
|
||||||
<!-- <u-button ripple shape="circle" class="rebuy-btn" size="mini" v-if="
|
<!-- <u-button ripple shape="circle" class="rebuy-btn" size="mini" v-if="
|
||||||
order.orderStatus === 'CANCELLED' ||
|
order.orderStatus === 'CANCELLED' ||
|
||||||
@@ -297,6 +296,9 @@ export default {
|
|||||||
{
|
{
|
||||||
orderStatus: "CANCELLED", //已取消
|
orderStatus: "CANCELLED", //已取消
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
orderStatus: "STAY_PICKED_UP", //待自提
|
||||||
|
},
|
||||||
],
|
],
|
||||||
cancelShow: false, //是否显示取消
|
cancelShow: false, //是否显示取消
|
||||||
orderSn: "", //ordersn
|
orderSn: "", //ordersn
|
||||||
@@ -389,7 +391,7 @@ export default {
|
|||||||
if (res.data.result.length >= 1) {
|
if (res.data.result.length >= 1) {
|
||||||
this.cancelList = res.data.result;
|
this.cancelList = res.data.result;
|
||||||
}
|
}
|
||||||
uni.hideLoading();
|
if (this.$store.state.isShowToast){ uni.hideLoading() };
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -470,7 +472,7 @@ export default {
|
|||||||
});
|
});
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.navList[this.tabCurrentIndex].orderList.splice(index, 1);
|
this.navList[this.tabCurrentIndex].orderList.splice(index, 1);
|
||||||
uni.hideLoading();
|
if (this.$store.state.isShowToast){ uni.hideLoading() };
|
||||||
}, 600);
|
}, 600);
|
||||||
},
|
},
|
||||||
//取消订单
|
//取消订单
|
||||||
@@ -490,7 +492,7 @@ export default {
|
|||||||
let list = this.navList[1].orderList;
|
let list = this.navList[1].orderList;
|
||||||
let index = list.findIndex((val) => val.id === item.id);
|
let index = list.findIndex((val) => val.id === item.id);
|
||||||
index !== -1 && list.splice(index, 1);
|
index !== -1 && list.splice(index, 1);
|
||||||
uni.hideLoading();
|
if (this.$store.state.isShowToast){ uni.hideLoading() };
|
||||||
}, 600);
|
}, 600);
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -539,13 +541,13 @@ export default {
|
|||||||
*/
|
*/
|
||||||
submitCancel() {
|
submitCancel() {
|
||||||
cancelOrder(this.orderSn, { reason: this.reason }).then((res) => {
|
cancelOrder(this.orderSn, { reason: this.reason }).then((res) => {
|
||||||
if (res.statusCode == 200) {
|
if (res.data.success) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: "订单已取消",
|
title: "订单已取消",
|
||||||
duration: 2000,
|
duration: 2000,
|
||||||
icon: "none",
|
icon: "none",
|
||||||
});
|
});
|
||||||
this.initData(0);
|
this.initData(this.tabCurrentIndex);
|
||||||
|
|
||||||
this.cancelShow = false;
|
this.cancelShow = false;
|
||||||
} else {
|
} else {
|
||||||
@@ -686,6 +688,7 @@ page,
|
|||||||
padding: 0 20rpx;
|
padding: 0 20rpx;
|
||||||
|
|
||||||
.seller-name {
|
.seller-name {
|
||||||
|
flex:10;
|
||||||
font-size: 28rpx;
|
font-size: 28rpx;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
display: flex;
|
display: flex;
|
||||||
@@ -698,6 +701,9 @@ page,
|
|||||||
}
|
}
|
||||||
|
|
||||||
.order-sn {
|
.order-sn {
|
||||||
|
flex:2;
|
||||||
|
width:120rpx;
|
||||||
|
text-align: center;
|
||||||
color: $aider-light-color;
|
color: $aider-light-color;
|
||||||
font-size: 26rpx;
|
font-size: 26rpx;
|
||||||
}
|
}
|
||||||
@@ -755,6 +761,7 @@ page,
|
|||||||
flex: 1;
|
flex: 1;
|
||||||
.price {
|
.price {
|
||||||
color: $main-color;
|
color: $main-color;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -789,28 +796,33 @@ page,
|
|||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.goods-btn{
|
||||||
.cancel-btn {
|
display: flex;
|
||||||
color: #999999 !important;
|
}
|
||||||
border-color: #999999 !important;
|
.cancel-btn,.pay-btn,.rebuy-btn{
|
||||||
|
text-align: center;
|
||||||
margin-left: 15rpx;
|
margin-left: 15rpx;
|
||||||
height: 60rpx;
|
font-size: 24rpx;
|
||||||
|
padding: 14rpx 20rpx;
|
||||||
|
border-radius: 100px;
|
||||||
|
|
||||||
|
}
|
||||||
|
.cancel-btn {
|
||||||
|
color: #333639 !important;
|
||||||
|
background: rgba(46, 51, 56, .05) !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.pay-btn {
|
.pay-btn {
|
||||||
// #ifndef MP-WEIXIN
|
|
||||||
background-color: $light-color !important;
|
background-color: $light-color !important;
|
||||||
// #endif
|
|
||||||
color: #ffffff !important;
|
color: #ffffff !important;
|
||||||
margin-left: 15rpx;
|
|
||||||
height: 60rpx;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.rebuy-btn {
|
.rebuy-btn {
|
||||||
color: $light-color !important;
|
color: $light-color !important;
|
||||||
border-color: $light-color !important;
|
border-color: $light-color !important;
|
||||||
background-color: #ffffff !important;
|
background-color: #ffffff !important;
|
||||||
margin-left: 15rpx;
|
|
||||||
height: 60rpx;
|
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
|||||||
@@ -9,28 +9,28 @@
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
<!-- 物流信息 -->
|
<!-- 物流信息 -->
|
||||||
<view class="info-view logi-view">
|
<view class="info-view logistics-view">
|
||||||
<view class="logi-List" v-if="logiList && logiList.traces.length != 0">
|
<view class="logistics-List" v-if="logisticsList && logisticsList.traces.length != 0 ">
|
||||||
<view class="logi-List-title">
|
<view class="logistics-List-title">
|
||||||
{{logiList.traces[logiList.traces.length-1].AcceptStation}}
|
{{ logisticsList.traces[logisticsList.traces.length - 1].AcceptStation }}
|
||||||
</view>
|
</view>
|
||||||
<view class="logi-List-time">
|
<view class="logistics-List-time">
|
||||||
{{logiList.traces[logiList.traces.length-1].AcceptTime}}
|
{{ logisticsList.traces[logisticsList.traces.length - 1].AcceptTime }}
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="logi-List" v-else>
|
<view class="logistics-List" v-else>
|
||||||
<view class="verificationCode" v-if="order.verificationCode ">
|
<view class="verificationCode" v-if="order.verificationCode">
|
||||||
券码: {{order.verificationCode}}
|
券码: {{ order.orderStatus == 'CANCELLED' ? '已失效' : order.verificationCode }}
|
||||||
</view>
|
</view>
|
||||||
<view v-else class="logi-List-title">
|
<view v-else class="logistics-List-title">
|
||||||
{{'暂无物流信息'}}
|
{{ '暂无物流信息' }}
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
<!-- 地址 -->
|
<!-- 地址 -->
|
||||||
<view class="info-view">
|
<view class="info-view" v-if="order.deliveryMethod == 'LOGISTICS'">
|
||||||
<view class="address-view">
|
<view class="address-view">
|
||||||
<view>
|
<view>
|
||||||
<view class="address-title">
|
<view class="address-title">
|
||||||
@@ -42,14 +42,33 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
<!-- 提货地址 -->
|
||||||
|
<view class="info-view" v-if="order.deliveryMethod == 'SELF_PICK_UP'">
|
||||||
|
<view class="address-view">
|
||||||
|
<view>
|
||||||
|
<view class="order-info-view">
|
||||||
|
<view class="title">自提点地址:</view>
|
||||||
|
<view class="value address-line-height">{{ order.storeAddressPath }}</view>
|
||||||
|
</view>
|
||||||
|
<view class="order-info-view" @click="callPhone" >
|
||||||
|
<view class="title">联系方式:</view>
|
||||||
|
<view class="value">{{ order.storeAddressMobile }}<u-icon name='phone-fill' ></u-icon></view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
<!-- 商品信息 -->
|
<!-- 商品信息 -->
|
||||||
<view>
|
<view>
|
||||||
<view class="seller-view">
|
<view class="seller-view">
|
||||||
<!-- 店铺名称 -->
|
<!-- 店铺名称 -->
|
||||||
<view class="seller-info u-flex u-row-between">
|
<view class="seller-info u-flex u-row-between">
|
||||||
<view class="seller-name" @click="tostore(order)">
|
<view class="seller-name" @click="goToShopPage(order)">
|
||||||
<view class="name">{{ order.storeName }}</view>
|
<view class="name">{{ order.storeName }}</view>
|
||||||
<view class="status" v-if="orderStatusList[order.orderStatus]"> {{ orderStatusList[order.orderStatus].title }}</view>
|
<view class="status" v-if="orderStatusList[order.orderStatus]"> {{ orderStatusList[order.orderStatus].title
|
||||||
|
}}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="order-sn"></view>
|
<view class="order-sn"></view>
|
||||||
</view>
|
</view>
|
||||||
@@ -70,7 +89,8 @@
|
|||||||
<view>x{{ sku.num }}</view>
|
<view>x{{ sku.num }}</view>
|
||||||
|
|
||||||
<view class="good-complaint">
|
<view class="good-complaint">
|
||||||
<u-tag size="mini" mode="plain" @click="complaint(sku)" v-if="sku.complainStatus == 'NO_APPLY'" text="投诉" type="info" />
|
<u-tag size="mini" mode="plain" @click="complaint(sku)" v-if="sku.complainStatus == 'NO_APPLY'"
|
||||||
|
text="投诉" type="info" />
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -91,11 +111,11 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="order-info-view">
|
<view class="order-info-view">
|
||||||
<view class="title">优惠券:</view>
|
<view class="title">优惠券:</view>
|
||||||
<view class="value">¥{{ order.couponPrice | unitPrice }}</view>
|
<view class="value main-color">-¥{{ order.priceDetailDTO.couponPrice | unitPrice }}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="order-info-view">
|
<view class="order-info-view">
|
||||||
<view class="title">活动优惠:</view>
|
<view class="title">活动优惠:</view>
|
||||||
<view class="value">¥{{ order.discountPrice | unitPrice }}</view>
|
<view class="value main-color">-¥{{ order.discountPrice | unitPrice }}</view>
|
||||||
</view>
|
</view>
|
||||||
<!-- <view class="order-info-view" v-if="order.use_point">
|
<!-- <view class="order-info-view" v-if="order.use_point">
|
||||||
<view class="title">使用积分:</view>
|
<view class="title">使用积分:</view>
|
||||||
@@ -104,16 +124,20 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<!-- 客户服务, 售后,取消订单,查看物流,投诉等 -->
|
<!-- 客户服务, 售后,取消订单,查看物流,投诉等 -->
|
||||||
<view class="info-view"
|
<view class="info-view">
|
||||||
v-if="orderDetail.allowOperationVO && orderDetail.allowOperationVO.cancel == true || order.orderStatus == 'DELIVERED' || order.orderStatus != 'UNPAID' && order.orderPromotionType =='PINTUAN'">
|
|
||||||
<view style="width: 100%">
|
<view style="width: 100%">
|
||||||
<view class="order-info-view">
|
<view class="order-info-view">
|
||||||
<view class="title">服务</view>
|
<view class="title">服务</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="customer-list">
|
<view class="customer-list">
|
||||||
<view class="customer-service" v-if="orderDetail.allowOperationVO && orderDetail.allowOperationVO.cancel == true" @click="onCancel(order.sn)">取消订单</view>
|
<view class="customer-service"
|
||||||
|
v-if="orderDetail.allowOperationVO && orderDetail.allowOperationVO.cancel == true"
|
||||||
|
@click="onCancel(order.sn)">取消订单</view>
|
||||||
<view class="customer-service" v-if="order.orderStatus == 'DELIVERED'" @click="onLogistics(order)">查看物流</view>
|
<view class="customer-service" v-if="order.orderStatus == 'DELIVERED'" @click="onLogistics(order)">查看物流</view>
|
||||||
<view class="customer-service" v-if="order.orderStatus != 'UNPAID' && order.orderPromotionType =='PINTUAN' " @click="ByUserMessage(order)">查看拼团信息</view>
|
<view class="customer-service" v-if="order.orderStatus != 'UNPAID' && order.orderPromotionType == 'PINTUAN'"
|
||||||
|
@click="ByUserMessage(order)">查看拼团信息</view>
|
||||||
|
<view class="customer-service"
|
||||||
|
@click="contact(order.storeId)">联系客服</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -129,23 +153,29 @@
|
|||||||
<view class="order-info-view">
|
<view class="order-info-view">
|
||||||
<view class="title">下单时间:</view>
|
<view class="title">下单时间:</view>
|
||||||
<view class="value">{{
|
<view class="value">{{
|
||||||
order.createTime
|
order.createTime
|
||||||
|
}}</view>
|
||||||
|
</view>
|
||||||
|
<view class="order-info-view">
|
||||||
|
<view class="title">订单备注:</view>
|
||||||
|
<view class="value">{{
|
||||||
|
order.remark
|
||||||
}}</view>
|
}}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="order-info-view">
|
<view class="order-info-view">
|
||||||
<view class="title">支付状态:</view>
|
<view class="title">支付状态:</view>
|
||||||
<view class="value">
|
<view class="value">
|
||||||
{{
|
{{
|
||||||
order.payStatus == "UNPAID"
|
order.payStatus == "UNPAID"
|
||||||
? "未付款"
|
? "未付款"
|
||||||
: order.payStatus == "PAID"
|
: order.payStatus == "PAID"
|
||||||
? "已付款"
|
? "已付款"
|
||||||
: ""
|
: ""
|
||||||
}}</view>
|
}}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="order-info-view">
|
<view class="order-info-view">
|
||||||
<view class="title">支付方式:</view>
|
<view class="title">支付方式:</view>
|
||||||
<view class="value">{{ orderDetail.paymentMethodValue }}</view>
|
<view class="value">{{ orderDetail.paymentMethodValue || '暂无'}}</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -153,7 +183,7 @@
|
|||||||
<view class="info-view" v-if="order.payStatus == 'PAID'">
|
<view class="info-view" v-if="order.payStatus == 'PAID'">
|
||||||
<view>
|
<view>
|
||||||
<view class="invoice-info-view">
|
<view class="invoice-info-view">
|
||||||
<view class="ltitle">发票信息:</view>
|
<view class="invoice-title">发票信息:</view>
|
||||||
<view v-if="!order.needReceipt" class="value">无需发票</view>
|
<view v-if="!order.needReceipt" class="value">无需发票</view>
|
||||||
<view v-else class="value" @click="onReceipt(orderDetail.receipt)">查看发票</view>
|
<view v-else class="value" @click="onReceipt(orderDetail.receipt)">查看发票</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -175,13 +205,16 @@
|
|||||||
<view>
|
<view>
|
||||||
<!-- 全部 -->
|
<!-- 全部 -->
|
||||||
<!-- 等待付款 -->
|
<!-- 等待付款 -->
|
||||||
<u-button type="error" ripple size="mini" v-if=" order.allowOperationVO && order.allowOperationVO.pay" @click="toPay(order)">立即付款</u-button>
|
<u-button type="error" ripple size="mini" v-if="orderDetail.allowOperationVO && orderDetail.allowOperationVO.pay"
|
||||||
|
@click="toPay(order)">立即付款</u-button>
|
||||||
|
|
||||||
<!-- <u-button class="rebuy-btn" size="mini" v-if="order.order_operate_allowable_vo.allow_service_cancel"> 提醒发货</u-button> -->
|
<!-- <u-button class="rebuy-btn" size="mini" v-if="order.order_operate_allowable_vo.allow_service_cancel"> 提醒发货</u-button> -->
|
||||||
<!-- <div class="pay-btn">确认收货</div> -->
|
<!-- <div class="pay-btn">确认收货</div> -->
|
||||||
<u-button shape="circle" ripple type="warning" size="mini" v-if="order.orderStatus == 'DELIVERED'" @click="onRog(order.sn)">确认收货</u-button>
|
<u-button shape="circle" ripple type="warning" size="mini" v-if="order.orderStatus == 'DELIVERED'"
|
||||||
|
@click="onRog(order.sn)">确认收货</u-button>
|
||||||
<!-- 交易完成 未评价 -->
|
<!-- 交易完成 未评价 -->
|
||||||
<u-button shape="circle" ripple size="mini" v-if="order.orderStatus == 'COMPLETE'" @click="onComment(order.sn)">评价商品</u-button>
|
<u-button shape="circle" ripple size="mini" v-if="order.orderStatus == 'COMPLETE'"
|
||||||
|
@click="onComment(order.sn)">评价商品</u-button>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -193,7 +226,8 @@
|
|||||||
<u-radio-group v-model="reason">
|
<u-radio-group v-model="reason">
|
||||||
<view class="value">
|
<view class="value">
|
||||||
<view class="radio-view" v-for="(item, index) in cancelList" :key="index">
|
<view class="radio-view" v-for="(item, index) in cancelList" :key="index">
|
||||||
<u-radio :active-color="lightColor" label-size="25" shape="circle" :name="item.reason" @change="reasonChange">{{ item.reason }}</u-radio>
|
<u-radio :active-color="lightColor" label-size="25" shape="circle" :name="item.reason"
|
||||||
|
@change="reasonChange">{{ item.reason }}</u-radio>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</u-radio-group>
|
</u-radio-group>
|
||||||
@@ -204,10 +238,12 @@
|
|||||||
</view>
|
</view>
|
||||||
</u-popup>
|
</u-popup>
|
||||||
<u-toast ref="uToast" />
|
<u-toast ref="uToast" />
|
||||||
<u-modal v-model="rogShow" :show-cancel-button="true" :content="'是否确认收货?'" :confirm-color="lightColor" @confirm="confirmRog"></u-modal>
|
<u-modal v-model="rogShow" :show-cancel-button="true" :content="'是否确认收货?'" :confirm-color="lightColor"
|
||||||
|
@confirm="confirmRog"></u-modal>
|
||||||
|
|
||||||
<!-- 分享 -->
|
<!-- 分享 -->
|
||||||
<shares v-if="shareFlage " :thumbnail="orderDetail.orderItems[0].image" :goodsName="orderDetail.orderItems[0].goodsName" @close="shareFlage = false" />
|
<shares v-if="shareFlag" :thumbnail="orderDetail.orderItems[0].image"
|
||||||
|
:goodsName="orderDetail.orderItems[0].goodsName" @close="shareFlag = false" />
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
@@ -216,7 +252,6 @@
|
|||||||
import { getExpress } from "@/api/trade.js";
|
import { getExpress } from "@/api/trade.js";
|
||||||
import { cancelOrder, confirmReceipt, getOrderDetail } from "@/api/order.js";
|
import { cancelOrder, confirmReceipt, getOrderDetail } from "@/api/order.js";
|
||||||
|
|
||||||
import { h5Copy } from "@/js_sdk/h5-copy/h5-copy.js";
|
|
||||||
import shares from "@/components/m-share/index"; //分享
|
import shares from "@/components/m-share/index"; //分享
|
||||||
|
|
||||||
import { getClearReason } from "@/api/after-sale.js";
|
import { getClearReason } from "@/api/after-sale.js";
|
||||||
@@ -228,8 +263,8 @@ export default {
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
lightColor: this.$lightColor,
|
lightColor: this.$lightColor,
|
||||||
logiList: "", //物流信息
|
logisticsList: "", //物流信息
|
||||||
shareFlage: false, //拼团分享开关
|
shareFlag: false, //拼团分享开关
|
||||||
orderStatusList: {
|
orderStatusList: {
|
||||||
UNPAID: {
|
UNPAID: {
|
||||||
title: "未付款",
|
title: "未付款",
|
||||||
@@ -255,6 +290,10 @@ export default {
|
|||||||
title: "已完成",
|
title: "已完成",
|
||||||
value: "订单已完成,祝您生活愉快",
|
value: "订单已完成,祝您生活愉快",
|
||||||
},
|
},
|
||||||
|
STAY_PICKED_UP: {
|
||||||
|
title: "待自提",
|
||||||
|
value: "商品正在等待提取",
|
||||||
|
},
|
||||||
TAKE: {
|
TAKE: {
|
||||||
title: "待核验",
|
title: "待核验",
|
||||||
},
|
},
|
||||||
@@ -272,11 +311,17 @@ export default {
|
|||||||
},
|
},
|
||||||
onLoad(options) {
|
onLoad(options) {
|
||||||
this.loadData(options.sn);
|
this.loadData(options.sn);
|
||||||
this.loadLogistics(options.sn);
|
|
||||||
this.sn = options.sn;
|
this.sn = options.sn;
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
tostore(val) {
|
callPhone(){
|
||||||
|
this.$options.filters.callPhone(this.order.storeAddressMobile )
|
||||||
|
},
|
||||||
|
//联系客服
|
||||||
|
contact(storeId){
|
||||||
|
this.$options.filters.talkIm(storeId)
|
||||||
|
},
|
||||||
|
goToShopPage(val) {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: "/pages/product/shopPage?id=" + val.storeId,
|
url: "/pages/product/shopPage?id=" + val.storeId,
|
||||||
});
|
});
|
||||||
@@ -284,13 +329,13 @@ export default {
|
|||||||
// 获取物流信息
|
// 获取物流信息
|
||||||
loadLogistics(sn) {
|
loadLogistics(sn) {
|
||||||
getExpress(sn).then((res) => {
|
getExpress(sn).then((res) => {
|
||||||
this.logiList = res.data.result;
|
this.logisticsList = res.data.result;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
// 分享当前拼团信息
|
// 分享当前拼团信息
|
||||||
inviteGroup() {
|
inviteGroup() {
|
||||||
this.shareFlage = true;
|
this.shareFlag = true;
|
||||||
},
|
},
|
||||||
// #TODO 这块需要写一下 目前没有拼团的详细信息
|
// #TODO 这块需要写一下 目前没有拼团的详细信息
|
||||||
ByUserMessage(order) {
|
ByUserMessage(order) {
|
||||||
@@ -304,7 +349,7 @@ export default {
|
|||||||
this.orderGoodsList[0].goodsId,
|
this.orderGoodsList[0].goodsId,
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
loadData(sn) {
|
async loadData(sn) {
|
||||||
uni.showLoading({
|
uni.showLoading({
|
||||||
title: "加载中",
|
title: "加载中",
|
||||||
});
|
});
|
||||||
@@ -313,9 +358,12 @@ export default {
|
|||||||
this.order = order.order;
|
this.order = order.order;
|
||||||
this.orderGoodsList = order.orderItems;
|
this.orderGoodsList = order.orderItems;
|
||||||
this.orderDetail = res.data.result;
|
this.orderDetail = res.data.result;
|
||||||
|
if (this.order.deliveryMethod === 'LOGISTICS') {
|
||||||
uni.hideLoading();
|
this.loadLogistics(sn)
|
||||||
|
}
|
||||||
|
if (this.$store.state.isShowToast){ uni.hideLoading() };
|
||||||
});
|
});
|
||||||
|
|
||||||
},
|
},
|
||||||
onReceipt(val) {
|
onReceipt(val) {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
@@ -328,35 +376,7 @@ export default {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
onCopy(sn) {
|
onCopy(sn) {
|
||||||
// #ifdef H5
|
this.$options.filters.setClipboard(sn)
|
||||||
if (sn === null || sn === undefined) {
|
|
||||||
sn = "";
|
|
||||||
} else sn = sn + "";
|
|
||||||
const result = h5Copy(sn);
|
|
||||||
if (result === false) {
|
|
||||||
uni.showToast({
|
|
||||||
title: "不支持",
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
uni.showToast({
|
|
||||||
title: "复制成功",
|
|
||||||
icon: "none",
|
|
||||||
});
|
|
||||||
}
|
|
||||||
// #endif
|
|
||||||
|
|
||||||
// #ifndef H5
|
|
||||||
uni.setClipboardData({
|
|
||||||
data: sn,
|
|
||||||
success: function () {
|
|
||||||
uni.showToast({
|
|
||||||
title: "复制成功!",
|
|
||||||
duration: 2000,
|
|
||||||
icon: "none",
|
|
||||||
});
|
|
||||||
},
|
|
||||||
});
|
|
||||||
// #endif
|
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -383,8 +403,8 @@ export default {
|
|||||||
toPay(val) {
|
toPay(val) {
|
||||||
val.sn
|
val.sn
|
||||||
? uni.navigateTo({
|
? uni.navigateTo({
|
||||||
url: "/pages/cart/payment/payOrder?order_sn=" + val.sn,
|
url: "/pages/cart/payment/payOrder?order_sn=" + val.sn,
|
||||||
})
|
})
|
||||||
: false;
|
: false;
|
||||||
}, //删除订单
|
}, //删除订单
|
||||||
deleteOrder(index) {
|
deleteOrder(index) {
|
||||||
@@ -393,7 +413,7 @@ export default {
|
|||||||
});
|
});
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.navList[this.tabCurrentIndex].orderList.splice(index, 1);
|
this.navList[this.tabCurrentIndex].orderList.splice(index, 1);
|
||||||
uni.hideLoading();
|
if (this.$store.state.isShowToast){ uni.hideLoading() };
|
||||||
}, 600);
|
}, 600);
|
||||||
},
|
},
|
||||||
//取消订单
|
//取消订单
|
||||||
@@ -407,7 +427,7 @@ export default {
|
|||||||
if (res.data.result.length >= 1) {
|
if (res.data.result.length >= 1) {
|
||||||
this.cancelList = res.data.result;
|
this.cancelList = res.data.result;
|
||||||
}
|
}
|
||||||
uni.hideLoading();
|
if (this.$store.state.isShowToast){ uni.hideLoading() };
|
||||||
});
|
});
|
||||||
|
|
||||||
this.cancelShow = true;
|
this.cancelShow = true;
|
||||||
@@ -491,9 +511,11 @@ export default {
|
|||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
@import "./goods.scss";
|
@import "./goods.scss";
|
||||||
|
|
||||||
.empty {
|
.empty {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.customer-service {
|
.customer-service {
|
||||||
background: #ededed;
|
background: #ededed;
|
||||||
// padding: 12rpx 40rpx;
|
// padding: 12rpx 40rpx;
|
||||||
@@ -506,51 +528,58 @@ export default {
|
|||||||
font-size: 24rpx;
|
font-size: 24rpx;
|
||||||
border-radius: 10rpx;
|
border-radius: 10rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.customer-list {
|
.customer-list {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
}
|
}
|
||||||
.logi-view {
|
|
||||||
|
.logistics-view {
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
padding: 30rpx !important;
|
padding: 30rpx !important;
|
||||||
margin: 0 !important;
|
margin: 0 !important;
|
||||||
transform: translateY(-10px);
|
transform: translateY(-10px);
|
||||||
}
|
}
|
||||||
|
|
||||||
.order-status {
|
.order-status {
|
||||||
color: #fff;
|
color: #fff;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
font-size: 36rpx;
|
font-size: 36rpx;
|
||||||
margin-top: 40rpx;
|
margin-top: 40rpx;
|
||||||
> div {
|
|
||||||
|
>div {
|
||||||
font-size: 24rpx;
|
font-size: 24rpx;
|
||||||
margin-top: 10rpx;
|
margin-top: 10rpx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.logi-List-title {
|
|
||||||
|
.logistics-List-title {
|
||||||
margin-bottom: 10rpx;
|
margin-bottom: 10rpx;
|
||||||
font-size: 26rpx;
|
font-size: 26rpx;
|
||||||
}
|
}
|
||||||
.logi-List-time {
|
|
||||||
|
.logistics-List-time {
|
||||||
font-size: 24rpx;
|
font-size: 24rpx;
|
||||||
color: #999;
|
color: #999;
|
||||||
}
|
}
|
||||||
|
|
||||||
.info-detail {
|
.info-detail {
|
||||||
margin-right: 30rpx;
|
margin-right: 30rpx;
|
||||||
color: #333;
|
color: #333;
|
||||||
}
|
}
|
||||||
|
|
||||||
.order-view {
|
.order-view {
|
||||||
margin: 0 !important;
|
margin: 0 !important;
|
||||||
border-radius: 0 !important;
|
border-radius: 0 !important;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 200rpx;
|
height: 200rpx;
|
||||||
padding: 0 !important;
|
padding: 0 !important;
|
||||||
background-image: linear-gradient(
|
background-image: linear-gradient(to right,
|
||||||
to right,
|
$light-color 0%,
|
||||||
$light-color 0%,
|
$aider-light-color 100%) !important;
|
||||||
$aider-light-color 100%
|
|
||||||
) !important;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
page,
|
page,
|
||||||
.content {
|
.content {
|
||||||
background: #f1f1f1;
|
background: #f1f1f1;
|
||||||
@@ -575,18 +604,22 @@ page,
|
|||||||
padding: 16rpx 0rpx;
|
padding: 16rpx 0rpx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.seller-view {
|
.seller-view {
|
||||||
margin: 20rpx 0;
|
margin: 20rpx 0;
|
||||||
padding: 15rpx 0;
|
padding: 15rpx 0;
|
||||||
border-radius: 30rpx;
|
border-radius: 30rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.address-title {
|
.address-title {
|
||||||
font-size: 26rpx;
|
font-size: 26rpx;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
> span {
|
|
||||||
|
>span {
|
||||||
margin-right: 20rpx;
|
margin-right: 20rpx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.info-view {
|
.info-view {
|
||||||
display: flex;
|
display: flex;
|
||||||
margin: 0 0 20rpx 0;
|
margin: 0 0 20rpx 0;
|
||||||
@@ -621,11 +654,14 @@ page,
|
|||||||
width: 140rpx;
|
width: 140rpx;
|
||||||
font-size: 24rpx;
|
font-size: 24rpx;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
|
flex:3;
|
||||||
|
min-width: 160rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.value {
|
.value {
|
||||||
color: #666;
|
color: #666;
|
||||||
font-size: 24rpx;
|
font-size: 24rpx;
|
||||||
|
flex:10;
|
||||||
}
|
}
|
||||||
|
|
||||||
.copy {
|
.copy {
|
||||||
@@ -643,7 +679,7 @@ page,
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
margin: 10rpx 0rpx;
|
margin: 10rpx 0rpx;
|
||||||
|
|
||||||
.ltitle {
|
.invoice-title {
|
||||||
width: 550rpx;
|
width: 550rpx;
|
||||||
font-size: 28rpx;
|
font-size: 28rpx;
|
||||||
color: #333333;
|
color: #333333;
|
||||||
@@ -654,10 +690,12 @@ page,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.verificationCode {
|
.verificationCode {
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
letter-spacing: 2rpx;
|
letter-spacing: 2rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.bottom_view {
|
.bottom_view {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100rpx;
|
height: 100rpx;
|
||||||
@@ -718,4 +756,15 @@ page,
|
|||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.address-line-height{
|
||||||
|
line-height: 1.75;
|
||||||
|
}
|
||||||
|
.seller-name{
|
||||||
|
>.name{
|
||||||
|
flex:10 !important;
|
||||||
|
}
|
||||||
|
>.status{
|
||||||
|
flex:2;
|
||||||
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
54
pages/passport/entry/seller/control.vue
Normal file
54
pages/passport/entry/seller/control.vue
Normal file
@@ -0,0 +1,54 @@
|
|||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<u-navbar :border-bottom="false"></u-navbar>
|
||||||
|
<step1 v-if="current == 1" :companyData="companyData" @callback="next()" />
|
||||||
|
<step2 v-if="current == 2" :companyData="companyData" @callback="next()" />
|
||||||
|
<step3
|
||||||
|
v-if="current == 3"
|
||||||
|
:companyData="companyData"
|
||||||
|
@callback="finished()"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { getCompanyDetail } from "@/api/entry";
|
||||||
|
import step1 from "./step1";
|
||||||
|
import step2 from "./step2";
|
||||||
|
import step3 from "./step3";
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
companyData: "",
|
||||||
|
current: 1,
|
||||||
|
};
|
||||||
|
},
|
||||||
|
components: {
|
||||||
|
step1,
|
||||||
|
step2,
|
||||||
|
step3,
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.init();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
async init(next) {
|
||||||
|
const res = await getCompanyDetail();
|
||||||
|
if (res.data.success) {
|
||||||
|
this.companyData = res.data.result;
|
||||||
|
next ? this.current++ : "";
|
||||||
|
}
|
||||||
|
},
|
||||||
|
next() {
|
||||||
|
this.init("next");
|
||||||
|
},
|
||||||
|
finished() {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: "/pages/passport/entry/seller/index",
|
||||||
|
});
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped></style>
|
||||||
18
pages/passport/entry/seller/entry.scss
Normal file
18
pages/passport/entry/seller/entry.scss
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
.flag-title {
|
||||||
|
font-size: 42rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
.submit,
|
||||||
|
.notice {
|
||||||
|
font-weight: bold;
|
||||||
|
font-size: 28rpx;
|
||||||
|
|
||||||
|
height: 92rpx;
|
||||||
|
text-align: center;
|
||||||
|
letter-spacing: 4rpx;
|
||||||
|
line-height: 92rpx;
|
||||||
|
border-radius: 20rpx;
|
||||||
|
}
|
||||||
|
.wrapper {
|
||||||
|
padding:16rpx;
|
||||||
|
}
|
||||||
165
pages/passport/entry/seller/index.vue
Normal file
165
pages/passport/entry/seller/index.vue
Normal file
@@ -0,0 +1,165 @@
|
|||||||
|
<template>
|
||||||
|
<div class="wrapper">
|
||||||
|
<u-navbar :border-bottom="false"></u-navbar>
|
||||||
|
<div>
|
||||||
|
<div class="title">店铺入驻</div>
|
||||||
|
<div class="step-list">
|
||||||
|
<div
|
||||||
|
class="step-item"
|
||||||
|
:class="{ active: current == index }"
|
||||||
|
v-for="(item, index) in entrySteps"
|
||||||
|
:key="index"
|
||||||
|
>
|
||||||
|
{{ item.title }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="submit" @click="keepOn()">开始填写</div>
|
||||||
|
<div class="notice" @click="getEntryNotice">查看店铺入驻协议</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { getCompanyDetail } from "@/api/entry";
|
||||||
|
export default {
|
||||||
|
components: {},
|
||||||
|
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
current: 999,
|
||||||
|
entrySteps: [
|
||||||
|
{
|
||||||
|
title: "填写资质信息",
|
||||||
|
value: "APPLY",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "提交审核",
|
||||||
|
value: "APPLYING",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
|
||||||
|
storeStatusWay: [
|
||||||
|
{
|
||||||
|
title: "申请已通过,请联系管理员",
|
||||||
|
value: "OPEN",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "店铺已关闭,重申请联系管理员",
|
||||||
|
value: "CLOSED",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "审核未通过,请修改资质信息",
|
||||||
|
value: "REFUSED",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
|
||||||
|
companyData: "", // 公司信息
|
||||||
|
};
|
||||||
|
},
|
||||||
|
onShow() {
|
||||||
|
if(this.$options.filters.tipsToLogin()){
|
||||||
|
this.init();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
mounted() {},
|
||||||
|
|
||||||
|
onLoad(options) {},
|
||||||
|
methods: {
|
||||||
|
getEntryNotice() {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: "/pages/mine/help/tips?type=STORE_REGISTER",
|
||||||
|
});
|
||||||
|
},
|
||||||
|
keepOn() {
|
||||||
|
if (this.companyData && this.companyData.storeDisable == "OPEN") {
|
||||||
|
uni.showToast({
|
||||||
|
title:"审核已通过",
|
||||||
|
icon:"none"
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: "/pages/passport/entry/seller/control",
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
async init() {
|
||||||
|
this.entrySteps = [
|
||||||
|
{
|
||||||
|
title: "填写资质信息",
|
||||||
|
value: "APPLY",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "提交审核",
|
||||||
|
value: "APPLYING",
|
||||||
|
},
|
||||||
|
];
|
||||||
|
const res = await getCompanyDetail();
|
||||||
|
if (res.data.success) {
|
||||||
|
this.companyData = res.data.result;
|
||||||
|
|
||||||
|
if (this.companyData) {
|
||||||
|
this.storeStatusWay.forEach((item) => {
|
||||||
|
if (item.value == this.companyData.storeDisable) {
|
||||||
|
this.entrySteps.push(item);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
this.current =
|
||||||
|
this.entrySteps.findIndex(
|
||||||
|
(item) => item.value == this.companyData.storeDisable
|
||||||
|
) || 0;
|
||||||
|
} else {
|
||||||
|
this.current = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
<style>
|
||||||
|
page {
|
||||||
|
background: #fff;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
@import url("./entry.scss");
|
||||||
|
.wrapper {
|
||||||
|
padding: 0 80rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.title {
|
||||||
|
padding-top: calc(104rpx);
|
||||||
|
font-style: normal;
|
||||||
|
line-height: 1;
|
||||||
|
font-weight: 500;
|
||||||
|
font-size: 56rpx;
|
||||||
|
color: #333;
|
||||||
|
padding-left: 20rpx;
|
||||||
|
}
|
||||||
|
.step-item {
|
||||||
|
padding: 30rpx 20rpx;
|
||||||
|
font-size: 40rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
color: #666;
|
||||||
|
}
|
||||||
|
.step-list {
|
||||||
|
margin: 80rpx 0;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
.active {
|
||||||
|
color: $light-color;
|
||||||
|
background: rgba($color: $light-color, $alpha: 0.1);
|
||||||
|
border-radius: 20rpx;
|
||||||
|
}
|
||||||
|
.submit {
|
||||||
|
color: #fff;
|
||||||
|
margin-top: 120rpx;
|
||||||
|
background: rgba($light-color, 0.8);
|
||||||
|
}
|
||||||
|
.notice {
|
||||||
|
margin-top: 40rpx;
|
||||||
|
color: #333;
|
||||||
|
background: $bg-color;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
392
pages/passport/entry/seller/step1.vue
Normal file
392
pages/passport/entry/seller/step1.vue
Normal file
@@ -0,0 +1,392 @@
|
|||||||
|
<template>
|
||||||
|
<div class="wrapper">
|
||||||
|
<u-form label-width="200" :model="form" ref="uForm">
|
||||||
|
<div class="column">
|
||||||
|
<div class="flag-title light-color">基础信息</div>
|
||||||
|
<u-form-item
|
||||||
|
required
|
||||||
|
:border-bottom="false"
|
||||||
|
prop="companyName"
|
||||||
|
label="公司名称"
|
||||||
|
><u-input
|
||||||
|
v-model="form.companyName"
|
||||||
|
:custom-style="defaultInputStyle"
|
||||||
|
/></u-form-item>
|
||||||
|
<u-form-item
|
||||||
|
required
|
||||||
|
:border-bottom="false"
|
||||||
|
prop="companyAddressPath"
|
||||||
|
label="公司所在地"
|
||||||
|
><u-input
|
||||||
|
type="select"
|
||||||
|
:custom-style="defaultInputStyle"
|
||||||
|
v-model="form.companyAddressPath"
|
||||||
|
disabled
|
||||||
|
@click="showPicker()"
|
||||||
|
/></u-form-item>
|
||||||
|
<u-form-item
|
||||||
|
required
|
||||||
|
:border-bottom="false"
|
||||||
|
prop="companyAddress"
|
||||||
|
label="公司详细地址"
|
||||||
|
><u-input
|
||||||
|
:custom-style="defaultInputStyle"
|
||||||
|
v-model="form.companyAddress"
|
||||||
|
/></u-form-item>
|
||||||
|
<u-form-item
|
||||||
|
required
|
||||||
|
:border-bottom="false"
|
||||||
|
prop="employeeNum"
|
||||||
|
label="员工人数"
|
||||||
|
><u-input
|
||||||
|
type="number"
|
||||||
|
:custom-style="defaultInputStyle"
|
||||||
|
v-model="form.employeeNum"
|
||||||
|
/></u-form-item>
|
||||||
|
|
||||||
|
<u-form-item
|
||||||
|
required
|
||||||
|
:border-bottom="false"
|
||||||
|
prop="companyPhone"
|
||||||
|
label="公司电话"
|
||||||
|
><u-input
|
||||||
|
type="number"
|
||||||
|
:custom-style="defaultInputStyle"
|
||||||
|
v-model="form.companyPhone"
|
||||||
|
/></u-form-item>
|
||||||
|
<u-form-item
|
||||||
|
:border-bottom="false"
|
||||||
|
prop="registeredCapital"
|
||||||
|
label="注册资金"
|
||||||
|
required
|
||||||
|
><u-input
|
||||||
|
type="number"
|
||||||
|
:custom-style="defaultInputStyle"
|
||||||
|
v-model="form.registeredCapital"
|
||||||
|
/></u-form-item>
|
||||||
|
<u-form-item
|
||||||
|
required
|
||||||
|
:border-bottom="false"
|
||||||
|
prop="linkName"
|
||||||
|
label="联系人姓名"
|
||||||
|
><u-input :custom-style="defaultInputStyle" v-model="form.linkName"
|
||||||
|
/></u-form-item>
|
||||||
|
<u-form-item
|
||||||
|
required
|
||||||
|
:border-bottom="false"
|
||||||
|
prop="linkPhone"
|
||||||
|
label="联系人电话"
|
||||||
|
><u-input
|
||||||
|
type="number"
|
||||||
|
:custom-style="defaultInputStyle"
|
||||||
|
v-model="form.linkPhone"
|
||||||
|
/></u-form-item>
|
||||||
|
<u-form-item
|
||||||
|
required
|
||||||
|
:border-bottom="false"
|
||||||
|
prop="companyEmail"
|
||||||
|
label="电子邮箱"
|
||||||
|
><u-input
|
||||||
|
:custom-style="defaultInputStyle"
|
||||||
|
v-model="form.companyEmail"
|
||||||
|
/></u-form-item>
|
||||||
|
</div>
|
||||||
|
<div class="column">
|
||||||
|
<div class="flag-title light-color">营业执照信息</div>
|
||||||
|
<u-form-item
|
||||||
|
required
|
||||||
|
:border-bottom="false"
|
||||||
|
prop="licenseNum"
|
||||||
|
label="营业执照号"
|
||||||
|
><u-input :custom-style="defaultInputStyle" v-model="form.licenseNum"
|
||||||
|
/></u-form-item>
|
||||||
|
<u-form-item
|
||||||
|
required
|
||||||
|
:border-bottom="false"
|
||||||
|
prop="scope"
|
||||||
|
label="法定经营范围"
|
||||||
|
><u-input :custom-style="defaultInputStyle" v-model="form.scope"
|
||||||
|
/></u-form-item>
|
||||||
|
<u-form-item
|
||||||
|
:border-bottom="false"
|
||||||
|
prop="licencePhoto"
|
||||||
|
label="营业执照电子版"
|
||||||
|
required
|
||||||
|
>
|
||||||
|
<div>
|
||||||
|
<u-upload
|
||||||
|
:file-list="licencePhotoFileList"
|
||||||
|
:header="{ accessToken: storage.getAccessToken() }"
|
||||||
|
:action="action"
|
||||||
|
width="200"
|
||||||
|
@on-uploaded="onUploaded($event, 'licencePhoto')"
|
||||||
|
:max-count="1"
|
||||||
|
:show-progress="false"
|
||||||
|
></u-upload>
|
||||||
|
|
||||||
|
<div class="tips">
|
||||||
|
请压缩图片在2M以内,确保文字清晰以免上传或审核失败
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</u-form-item>
|
||||||
|
</div>
|
||||||
|
<div class="column">
|
||||||
|
<div class="flag-title light-color">法人信息</div>
|
||||||
|
<u-form-item
|
||||||
|
required
|
||||||
|
:border-bottom="false"
|
||||||
|
prop="legalName"
|
||||||
|
label="法人姓名"
|
||||||
|
><u-input :custom-style="defaultInputStyle" v-model="form.legalName"
|
||||||
|
/></u-form-item>
|
||||||
|
<u-form-item
|
||||||
|
required
|
||||||
|
:border-bottom="false"
|
||||||
|
prop="legalId"
|
||||||
|
label="法人证件号"
|
||||||
|
><u-input :custom-style="defaultInputStyle" v-model="form.legalId"
|
||||||
|
/></u-form-item>
|
||||||
|
<u-form-item
|
||||||
|
required
|
||||||
|
:border-bottom="false"
|
||||||
|
prop="legalPhoto"
|
||||||
|
label="法人证件电子版"
|
||||||
|
>
|
||||||
|
<div>
|
||||||
|
<u-upload
|
||||||
|
:file-list="legalPhotoFileList"
|
||||||
|
:header="{ accessToken: storage.getAccessToken() }"
|
||||||
|
:action="action"
|
||||||
|
width="200"
|
||||||
|
@on-uploaded="onUploaded($event, 'legalPhoto')"
|
||||||
|
:max-count="1"
|
||||||
|
:show-progress="false"
|
||||||
|
></u-upload>
|
||||||
|
</div>
|
||||||
|
</u-form-item>
|
||||||
|
</div>
|
||||||
|
</u-form>
|
||||||
|
<div class="submit" @click="validatorStep1Form">提交/下一步</div>
|
||||||
|
<m-city
|
||||||
|
:provinceData="list"
|
||||||
|
headTitle="区域选择"
|
||||||
|
ref="cityPicker"
|
||||||
|
@funcValue="getPickerParentValue"
|
||||||
|
pickerSize="4"
|
||||||
|
>
|
||||||
|
</m-city>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { applyFirst } from "@/api/entry";
|
||||||
|
import city from "@/components/m-city/m-city.vue";
|
||||||
|
import storage from "@/utils/storage.js";
|
||||||
|
import { upload } from "@/api/common.js";
|
||||||
|
import * as RegExp from "@/utils/RegExp.js";
|
||||||
|
export default {
|
||||||
|
components: { "m-city": city },
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
storage,
|
||||||
|
action: upload, //图片上传数据
|
||||||
|
defaultInputStyle: {
|
||||||
|
background: "#f7f7f7",
|
||||||
|
padding: "0 20rpx",
|
||||||
|
"border-radius": "10rpx",
|
||||||
|
},
|
||||||
|
legalPhotoFileList: [],
|
||||||
|
licencePhotoFileList: [],
|
||||||
|
form: {
|
||||||
|
companyName: "",
|
||||||
|
companyAddressIdPath: [],
|
||||||
|
companyAddressPath: "",
|
||||||
|
companyAddress: "",
|
||||||
|
employeeNum: "",
|
||||||
|
registeredCapital: "",
|
||||||
|
linkName: "",
|
||||||
|
linkPhone: "",
|
||||||
|
companyPhone: "",
|
||||||
|
companyEmail: "",
|
||||||
|
licenseNum: "",
|
||||||
|
scope: "",
|
||||||
|
legalPhoto: "",
|
||||||
|
licencePhoto: "",
|
||||||
|
legalName: "",
|
||||||
|
legalId: "",
|
||||||
|
},
|
||||||
|
list: [
|
||||||
|
{
|
||||||
|
id: "",
|
||||||
|
localName: "请选择",
|
||||||
|
children: [],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
rules: {
|
||||||
|
// 验证规则
|
||||||
|
companyName: [{ required: true, message: "请填写公司信息" }],
|
||||||
|
companyAddressPath: [{ required: true, message: "请选择公司所在地" }],
|
||||||
|
companyAddress: [{ required: true, message: "请填写公司详细地址" }],
|
||||||
|
employeeNum: [{ required: true, message: "请填写公司员工总数" }],
|
||||||
|
registeredCapital: [{ required: true, message: "请填写公司注册资金" }],
|
||||||
|
linkName: [{ required: true, message: "请填写联系人姓名" }],
|
||||||
|
linkPhone: [
|
||||||
|
{ required: true, message: "请填写联系人电话" },
|
||||||
|
{
|
||||||
|
// 自定义验证函数,见上说明
|
||||||
|
validator: (rule, value, callback) => {
|
||||||
|
// 上面有说,返回true表示校验通过,返回false表示不通过
|
||||||
|
// this.$u.test.mobile()就是返回true或者false的
|
||||||
|
return this.$u.test.mobile(value);
|
||||||
|
},
|
||||||
|
message: "手机号码不正确",
|
||||||
|
// 触发器可以同时用blur和change
|
||||||
|
trigger: ["change", "blur"],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
companyPhone: [
|
||||||
|
{ required: true, message: "请填写公司电话" },
|
||||||
|
{
|
||||||
|
// 自定义验证函数,见上说明
|
||||||
|
validator: (rule, value, callback) => {
|
||||||
|
// 上面有说,返回true表示校验通过,返回false表示不通过
|
||||||
|
// this.$u.test.mobile()就是返回true或者false的
|
||||||
|
return this.$u.test.mobile(value);
|
||||||
|
},
|
||||||
|
message: "请填写正确的号码",
|
||||||
|
// 触发器可以同时用blur和change
|
||||||
|
trigger: ["change", "blur"],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
companyEmail: [
|
||||||
|
{ required: true, message: "请填写电子邮箱" },
|
||||||
|
{
|
||||||
|
// 自定义验证函数,见上说明
|
||||||
|
validator: (rule, value, callback) => {
|
||||||
|
// 上面有说,返回true表示校验通过,返回false表示不通过
|
||||||
|
// this.$u.test.mobile()就是返回true或者false的
|
||||||
|
return this.$u.test.email(value);
|
||||||
|
},
|
||||||
|
message: "请填写正确的电子邮箱",
|
||||||
|
// 触发器可以同时用blur和change
|
||||||
|
trigger: ["change", "blur"],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
licenseNum: [
|
||||||
|
{ required: true, message: "请填写营业执照号" },
|
||||||
|
{ pattern: RegExp.licenseNum, message: "请输入正确的营业执照号" },
|
||||||
|
],
|
||||||
|
scope: [{ required: true, message: "请填写营业执照所示经营范围" }],
|
||||||
|
legalPhoto: [{ required: true, message: "请上传法人身份证照片" }],
|
||||||
|
licencePhoto: [{ required: true, message: "请上传营业执照" }],
|
||||||
|
legalName: [{ required: true, message: "请输入法人姓名" }],
|
||||||
|
legalId: [
|
||||||
|
{ required: true, message: "请输入法人证件号" },
|
||||||
|
{ pattern: RegExp.IDCard, message: "请输入正确的证件号" },
|
||||||
|
],
|
||||||
|
},
|
||||||
|
};
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.$refs.uForm.setRules(this.rules);
|
||||||
|
},
|
||||||
|
props: ["companyData"],
|
||||||
|
watch: {
|
||||||
|
companyData: {
|
||||||
|
handler(val) {
|
||||||
|
if (val) {
|
||||||
|
this.$set(this, "form", val);
|
||||||
|
// 给图片赋值
|
||||||
|
const judgeDeepPhoto = ["legalPhoto", "licencePhoto"];
|
||||||
|
judgeDeepPhoto.forEach((key) => {
|
||||||
|
if (this.form[key]) {
|
||||||
|
this.form[key].split(",").forEach((item) => {
|
||||||
|
this[`${key}FileList`].push({ url: item });
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
deep: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
// 图片上传
|
||||||
|
onUploaded(lists, key) {
|
||||||
|
let images = [];
|
||||||
|
lists.forEach((item) => {
|
||||||
|
images.push(item.response.result);
|
||||||
|
});
|
||||||
|
this.form[key] = images;
|
||||||
|
},
|
||||||
|
getPickerParentValue(e) {
|
||||||
|
this.form.companyAddressIdPath = [];
|
||||||
|
|
||||||
|
let name = "";
|
||||||
|
e.forEach((item, index) => {
|
||||||
|
if (item.id) {
|
||||||
|
// 遍历数据
|
||||||
|
this.form.companyAddressIdPath.push(item.id);
|
||||||
|
if (index == e.length - 1) {
|
||||||
|
name += item.localName;
|
||||||
|
} else {
|
||||||
|
name += item.localName + ",";
|
||||||
|
}
|
||||||
|
this.form.companyAddressPath = name;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 显示三级地址联动
|
||||||
|
showPicker() {
|
||||||
|
this.$refs.cityPicker.show();
|
||||||
|
},
|
||||||
|
validatorStep1Form() {
|
||||||
|
this.$refs.uForm.validate(async (valid) => {
|
||||||
|
console.log(valid);
|
||||||
|
if (valid) {
|
||||||
|
const params = { ...this.form };
|
||||||
|
|
||||||
|
params.legalPhoto = params.legalPhoto.toString();
|
||||||
|
params.licencePhoto = params.licencePhoto.toString();
|
||||||
|
params.companyAddressIdPath = params.companyAddressIdPath.toString();
|
||||||
|
delete params.complexAddress;
|
||||||
|
|
||||||
|
const res = await applyFirst(params);
|
||||||
|
if (res.data.success) {
|
||||||
|
uni.showToast({
|
||||||
|
title: "提交成功!",
|
||||||
|
icon: "none",
|
||||||
|
});
|
||||||
|
this.$emit("callback");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
<style>
|
||||||
|
/* page {
|
||||||
|
background: #fff;
|
||||||
|
} */
|
||||||
|
</style>
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
@import url("./entry.scss");
|
||||||
|
|
||||||
|
.column {
|
||||||
|
padding: 32rpx;
|
||||||
|
margin-bottom: 20rpx;
|
||||||
|
background: #fff;
|
||||||
|
}
|
||||||
|
.submit {
|
||||||
|
color: #fff;
|
||||||
|
margin-top: 120rpx;
|
||||||
|
background: rgba($light-color, 0.8);
|
||||||
|
}
|
||||||
|
.tips {
|
||||||
|
color: #999;
|
||||||
|
font-size: 24rpx;
|
||||||
|
line-height: 1.2;
|
||||||
|
margin-top: 10rpx;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
144
pages/passport/entry/seller/step2.vue
Normal file
144
pages/passport/entry/seller/step2.vue
Normal file
@@ -0,0 +1,144 @@
|
|||||||
|
<template>
|
||||||
|
<div class="wrapper">
|
||||||
|
<u-form label-width="250" :model="form" ref="uForm">
|
||||||
|
<div class="column">
|
||||||
|
<div class="flag-title light-color">基础信息</div>
|
||||||
|
<u-form-item
|
||||||
|
required
|
||||||
|
:border-bottom="false"
|
||||||
|
prop="settlementBankAccountName"
|
||||||
|
label="银行开户名"
|
||||||
|
><u-input
|
||||||
|
v-model="form.settlementBankAccountName"
|
||||||
|
:custom-style="defaultInputStyle"
|
||||||
|
/></u-form-item>
|
||||||
|
|
||||||
|
<u-form-item
|
||||||
|
required
|
||||||
|
:border-bottom="false"
|
||||||
|
prop="settlementBankAccountNum"
|
||||||
|
label="银行账号"
|
||||||
|
><u-input
|
||||||
|
:custom-style="defaultInputStyle"
|
||||||
|
v-model="form.settlementBankAccountNum"
|
||||||
|
/></u-form-item>
|
||||||
|
<u-form-item
|
||||||
|
required
|
||||||
|
:border-bottom="false"
|
||||||
|
prop="settlementBankBranchName"
|
||||||
|
label="开户银行支行名称"
|
||||||
|
><u-input
|
||||||
|
:custom-style="defaultInputStyle"
|
||||||
|
v-model="form.settlementBankBranchName"
|
||||||
|
/></u-form-item>
|
||||||
|
|
||||||
|
<u-form-item
|
||||||
|
required
|
||||||
|
:border-bottom="false"
|
||||||
|
prop="settlementBankJointName"
|
||||||
|
label="支行联行号"
|
||||||
|
><u-input
|
||||||
|
:custom-style="defaultInputStyle"
|
||||||
|
v-model="form.settlementBankJointName"
|
||||||
|
/></u-form-item>
|
||||||
|
</div>
|
||||||
|
</u-form>
|
||||||
|
<div class="submit" @click="validatorStep2Form">提交/下一步</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { applySecond } from "@/api/entry";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
defaultInputStyle: {
|
||||||
|
background: "#f7f7f7",
|
||||||
|
padding: "0 20rpx",
|
||||||
|
"border-radius": "10rpx",
|
||||||
|
},
|
||||||
|
form: {
|
||||||
|
settlementBankAccountName: "",
|
||||||
|
settlementBankAccountNum: "",
|
||||||
|
settlementBankBranchName: "",
|
||||||
|
settlementBankJointName: "",
|
||||||
|
},
|
||||||
|
|
||||||
|
rules: {
|
||||||
|
// 验证规则
|
||||||
|
settlementBankAccountName: [
|
||||||
|
{ required: true, message: "请填写银行开户名称" },
|
||||||
|
],
|
||||||
|
settlementBankAccountNum: [
|
||||||
|
{ required: true, message: "请填写银行账号" },
|
||||||
|
],
|
||||||
|
settlementBankBranchName: [
|
||||||
|
{ required: true, message: "请填写开户银行支行名称" },
|
||||||
|
],
|
||||||
|
settlementBankJointName: [
|
||||||
|
{ required: true, message: "请填写支行联行号" },
|
||||||
|
],
|
||||||
|
},
|
||||||
|
};
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.$refs.uForm.setRules(this.rules);
|
||||||
|
},
|
||||||
|
props: ["companyData"],
|
||||||
|
watch: {
|
||||||
|
companyData: {
|
||||||
|
handler(val) {
|
||||||
|
this.$set(this, "form", val);
|
||||||
|
console.log(this.form)
|
||||||
|
},
|
||||||
|
deep: true,
|
||||||
|
immediate:true
|
||||||
|
},
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
validatorStep2Form() {
|
||||||
|
this.$refs.uForm.validate(async (valid) => {
|
||||||
|
if (valid) {
|
||||||
|
const params = { ...this.form };
|
||||||
|
const res = await applySecond(params);
|
||||||
|
if (res.data.success) {
|
||||||
|
uni.showToast({
|
||||||
|
title: "提交成功!",
|
||||||
|
icon: "none",
|
||||||
|
});
|
||||||
|
this.$emit("callback");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
<style>
|
||||||
|
/* page {
|
||||||
|
background: #fff;
|
||||||
|
} */
|
||||||
|
</style>
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
@import url("./entry.scss");
|
||||||
|
.wrapper {
|
||||||
|
// padding: 50rpx 32rpx 16rpx 32rpx;
|
||||||
|
}
|
||||||
|
.column {
|
||||||
|
padding: 32rpx;
|
||||||
|
margin-bottom: 20rpx;
|
||||||
|
background: #fff;
|
||||||
|
}
|
||||||
|
.submit {
|
||||||
|
color: #fff;
|
||||||
|
margin-top: 120rpx;
|
||||||
|
background: rgba($light-color, 0.8);
|
||||||
|
}
|
||||||
|
.tips {
|
||||||
|
color: #999;
|
||||||
|
font-size: 24rpx;
|
||||||
|
line-height: 1.2;
|
||||||
|
margin-top: 10rpx;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
369
pages/passport/entry/seller/step3.vue
Normal file
369
pages/passport/entry/seller/step3.vue
Normal file
@@ -0,0 +1,369 @@
|
|||||||
|
<template>
|
||||||
|
<div class="wrapper">
|
||||||
|
<u-form label-width="200" :model="form" ref="uForm">
|
||||||
|
<div class="column">
|
||||||
|
<div class="flag-title light-color">基础信息</div>
|
||||||
|
<u-form-item
|
||||||
|
required
|
||||||
|
:border-bottom="false"
|
||||||
|
prop="storeName"
|
||||||
|
label="店铺名称"
|
||||||
|
><u-input v-model="form.storeName" :custom-style="defaultInputStyle"
|
||||||
|
/></u-form-item>
|
||||||
|
<u-form-item
|
||||||
|
required
|
||||||
|
:border-bottom="false"
|
||||||
|
prop="storeLogo"
|
||||||
|
label="店铺logo"
|
||||||
|
>
|
||||||
|
<div>
|
||||||
|
<u-upload
|
||||||
|
:file-list="storeLogoFileList"
|
||||||
|
:header="{ accessToken: storage.getAccessToken() }"
|
||||||
|
:action="action"
|
||||||
|
width="200"
|
||||||
|
@on-uploaded="onUploaded($event, 'storeLogo')"
|
||||||
|
:max-count="1"
|
||||||
|
:show-progress="false"
|
||||||
|
></u-upload>
|
||||||
|
</div>
|
||||||
|
</u-form-item>
|
||||||
|
<u-form-item
|
||||||
|
required
|
||||||
|
:border-bottom="false"
|
||||||
|
prop="goodsManagementCategory"
|
||||||
|
label="店铺经营类目"
|
||||||
|
><u-input
|
||||||
|
:custom-style="defaultInputStyle"
|
||||||
|
v-model="goodsManagementCategory"
|
||||||
|
disabled
|
||||||
|
@click="showCategory()"
|
||||||
|
/></u-form-item>
|
||||||
|
|
||||||
|
<u-form-item
|
||||||
|
required
|
||||||
|
:border-bottom="false"
|
||||||
|
prop="storeAddressPath"
|
||||||
|
label="店铺所在地"
|
||||||
|
>
|
||||||
|
<u-input
|
||||||
|
:custom-style="defaultInputStyle"
|
||||||
|
v-model="form.storeAddressPath"
|
||||||
|
disabled
|
||||||
|
@click="showPicker()"
|
||||||
|
/>
|
||||||
|
</u-form-item>
|
||||||
|
|
||||||
|
<u-form-item
|
||||||
|
required
|
||||||
|
:border-bottom="false"
|
||||||
|
prop="storeAddressPath"
|
||||||
|
label="店铺定位"
|
||||||
|
>
|
||||||
|
<div class="get-center" @click="clickUniMap()">开始定位</div>
|
||||||
|
<div class="tips-success" v-if="form.storeCenter">已成功定位</div>
|
||||||
|
</u-form-item>
|
||||||
|
|
||||||
|
<u-form-item
|
||||||
|
required
|
||||||
|
:border-bottom="false"
|
||||||
|
prop="storeAddressDetail"
|
||||||
|
label="店铺详细地址"
|
||||||
|
><u-input
|
||||||
|
:custom-style="defaultInputStyle"
|
||||||
|
v-model="form.storeAddressDetail"
|
||||||
|
/></u-form-item>
|
||||||
|
<u-form-item
|
||||||
|
required
|
||||||
|
:border-bottom="false"
|
||||||
|
prop="storeDesc"
|
||||||
|
label="店铺简介"
|
||||||
|
><u-input
|
||||||
|
type="textarea"
|
||||||
|
:custom-style="defaultInputStyle"
|
||||||
|
v-model="form.storeDesc"
|
||||||
|
/></u-form-item>
|
||||||
|
</div>
|
||||||
|
</u-form>
|
||||||
|
<div class="submit" @click="validatorStep1Form">提交平台审核</div>
|
||||||
|
<m-city
|
||||||
|
:provinceData="list"
|
||||||
|
headTitle="区域选择"
|
||||||
|
ref="cityPicker"
|
||||||
|
@funcValue="getPickerParentValue"
|
||||||
|
pickerSize="4"
|
||||||
|
>
|
||||||
|
</m-city>
|
||||||
|
|
||||||
|
<u-select
|
||||||
|
v-model="enableCategory"
|
||||||
|
@confirm="confirmCategory"
|
||||||
|
:list="categoryList"
|
||||||
|
></u-select>
|
||||||
|
|
||||||
|
<uniMap v-if="mapFlag" @close="closeMap" @callback="callBackAddress" />
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { applyThird } from "@/api/entry";
|
||||||
|
import { getCategoryList } from "@/api/goods";
|
||||||
|
import city from "@/components/m-city/m-city.vue";
|
||||||
|
import storage from "@/utils/storage.js";
|
||||||
|
import { upload } from "@/api/common.js";
|
||||||
|
import uniMap from "@/components/uniMap";
|
||||||
|
import permision from "@/js_sdk/wa-permission/permission.js";
|
||||||
|
export default {
|
||||||
|
components: { "m-city": city, uniMap },
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
storage,
|
||||||
|
mapFlag: false,
|
||||||
|
action: upload, //图片上传数据
|
||||||
|
defaultInputStyle: {
|
||||||
|
background: "#f7f7f7",
|
||||||
|
padding: "0 20rpx",
|
||||||
|
"border-radius": "10rpx",
|
||||||
|
},
|
||||||
|
goodsManagementCategory: "",
|
||||||
|
storeLogoFileList: [],
|
||||||
|
categoryList: [],
|
||||||
|
form: {
|
||||||
|
storeName: "",
|
||||||
|
storeLogo: "",
|
||||||
|
goodsManagementCategory: "",
|
||||||
|
storeAddressPath: "",
|
||||||
|
storeAddressDetail: "",
|
||||||
|
storeDesc: "",
|
||||||
|
},
|
||||||
|
list: [
|
||||||
|
{
|
||||||
|
id: "",
|
||||||
|
localName: "请选择",
|
||||||
|
children: [],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
rules: {
|
||||||
|
// 验证规则
|
||||||
|
goodsManagementCategory: [
|
||||||
|
{ required: true, message: "请选择店铺经营类目" },
|
||||||
|
],
|
||||||
|
storeName: [{ required: true, message: "请填写店铺名称" }],
|
||||||
|
storeLogo: [{ required: true, message: "请上传店铺logo" }],
|
||||||
|
storeDesc: [{ required: true, message: "请填写店铺简介" }],
|
||||||
|
storeCenter: [{ required: true, message: "请选择店铺位置" }],
|
||||||
|
storeAddressIdPath: [{ required: true, message: "请选择店铺位置" }],
|
||||||
|
storeAddressDetail: [{ required: true, message: "请输入店铺详细地址" }],
|
||||||
|
},
|
||||||
|
enableCategory: false,
|
||||||
|
};
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.$refs.uForm.setRules(this.rules);
|
||||||
|
this.fetchCategoryList();
|
||||||
|
},
|
||||||
|
props: ["companyData"],
|
||||||
|
watch: {
|
||||||
|
companyData: {
|
||||||
|
handler(val) {
|
||||||
|
this.$set(this, "form", val);
|
||||||
|
// 给图片赋值
|
||||||
|
const judgeDeepPhoto = ["storeLogo"];
|
||||||
|
|
||||||
|
judgeDeepPhoto.forEach((key) => {
|
||||||
|
if (this.form[key]) {
|
||||||
|
this.form[key].split(",").forEach((item) => {
|
||||||
|
this[`${key}FileList`].push({ url: item });
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
deep: true,
|
||||||
|
immediate: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
methods: {
|
||||||
|
callBackAddress(val) {
|
||||||
|
console.log(val);
|
||||||
|
this.form.storeAddressDetail = val.address;
|
||||||
|
this.form.storeCenter = `${val.longitude},${val.latitude}`;
|
||||||
|
},
|
||||||
|
// 关闭地图
|
||||||
|
closeMap() {
|
||||||
|
this.mapFlag = false;
|
||||||
|
},
|
||||||
|
// 打开地图并访问权限
|
||||||
|
clickUniMap() {
|
||||||
|
console.log("click");
|
||||||
|
// #ifdef APP-PLUS
|
||||||
|
if (plus.os.name == "iOS") {
|
||||||
|
// ios系统
|
||||||
|
permision.judgeIosPermission("location")
|
||||||
|
? (this.mapFlag = true)
|
||||||
|
: this.refuseMap();
|
||||||
|
} else {
|
||||||
|
// 安卓
|
||||||
|
this.requestAndroidPermission(
|
||||||
|
"android.permission.ACCESS_FINE_LOCATION"
|
||||||
|
);
|
||||||
|
}
|
||||||
|
// #endif
|
||||||
|
|
||||||
|
// #ifndef APP-PLUS
|
||||||
|
this.mapFlag = true;
|
||||||
|
// #endif
|
||||||
|
},
|
||||||
|
|
||||||
|
// 如果拒绝权限 提示区设置
|
||||||
|
refuseMap() {
|
||||||
|
uni.showModal({
|
||||||
|
title: "温馨提示",
|
||||||
|
content: "您已拒绝定位,请开启",
|
||||||
|
confirmText: "去设置",
|
||||||
|
success(res) {
|
||||||
|
if (res.confirm) {
|
||||||
|
//打开授权设置
|
||||||
|
// #ifndef MP-WEIXIN
|
||||||
|
uni.getSystemInfo({
|
||||||
|
success(res) {
|
||||||
|
if (res.platform == "ios") {
|
||||||
|
//IOS
|
||||||
|
plus.runtime.openURL("app-settings://");
|
||||||
|
} else if (res.platform == "android") {
|
||||||
|
//安卓
|
||||||
|
let main = plus.android.runtimeMainActivity();
|
||||||
|
let Intent = plus.android.importClass(
|
||||||
|
"android.content.Intent"
|
||||||
|
);
|
||||||
|
let mIntent = new Intent("android.settings.ACTION_SETTINGS");
|
||||||
|
main.startActivity(mIntent);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
});
|
||||||
|
// #endif
|
||||||
|
}
|
||||||
|
},
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 获取安卓是否拥有地址权限
|
||||||
|
async requestAndroidPermission(permisionID) {
|
||||||
|
var result = await permision.requestAndroidPermission(permisionID);
|
||||||
|
|
||||||
|
if (result == 1) {
|
||||||
|
this.mapFlag = true;
|
||||||
|
} else {
|
||||||
|
this.refuseMap();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
confirmCategory(val) {
|
||||||
|
this.form.goodsManagementCategory = val[0].value;
|
||||||
|
this.goodsManagementCategory = val[0].label;
|
||||||
|
},
|
||||||
|
async fetchCategoryList() {
|
||||||
|
const res = await getCategoryList(0);
|
||||||
|
if (res.data.success) {
|
||||||
|
if (res.data.result.length) {
|
||||||
|
this.categoryList = res.data.result.map((item) => {
|
||||||
|
return { label: item.name, value: item.id };
|
||||||
|
});
|
||||||
|
|
||||||
|
if (this.form.goodsManagementCategory) {
|
||||||
|
this.goodsManagementCategory = this.categoryList.find(
|
||||||
|
(item) => this.form.goodsManagementCategory == item.value
|
||||||
|
).label;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 图片上传
|
||||||
|
onUploaded(lists, key) {
|
||||||
|
let images = [];
|
||||||
|
lists.forEach((item) => {
|
||||||
|
images.push(item.response.result);
|
||||||
|
});
|
||||||
|
this.form[key] = images;
|
||||||
|
},
|
||||||
|
getPickerParentValue(e) {
|
||||||
|
this.form.storeAddressIdPath = [];
|
||||||
|
|
||||||
|
let name = "";
|
||||||
|
e.forEach((item, index) => {
|
||||||
|
if (item.id) {
|
||||||
|
// 遍历数据
|
||||||
|
this.form.storeAddressIdPath.push(item.id);
|
||||||
|
if (index == e.length - 1) {
|
||||||
|
name += item.localName;
|
||||||
|
} else {
|
||||||
|
name += item.localName + ",";
|
||||||
|
}
|
||||||
|
this.form.storeAddressPath = name;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 显示三级地址联动
|
||||||
|
showPicker() {
|
||||||
|
this.$refs.cityPicker.show();
|
||||||
|
},
|
||||||
|
showCategory() {
|
||||||
|
this.enableCategory = true;
|
||||||
|
},
|
||||||
|
validatorStep1Form() {
|
||||||
|
this.$refs.uForm.validate(async (valid) => {
|
||||||
|
console.log(valid);
|
||||||
|
if (valid) {
|
||||||
|
const params = { ...this.form };
|
||||||
|
params.storeLogo = params.storeLogo.toString();
|
||||||
|
params.storeAddressIdPath = params.storeAddressIdPath.toString();
|
||||||
|
const res = await applyThird(params);
|
||||||
|
if (res.data.success) {
|
||||||
|
uni.showToast({
|
||||||
|
title: "提交成功!",
|
||||||
|
icon: "none",
|
||||||
|
});
|
||||||
|
this.$emit("callback");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
<style>
|
||||||
|
/* page {
|
||||||
|
background: #fff;
|
||||||
|
} */
|
||||||
|
</style>
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
@import url("./entry.scss");
|
||||||
|
.get-center {
|
||||||
|
padding: 12rpx 30rpx;
|
||||||
|
background: $light-color;
|
||||||
|
border-radius: 10rpx;
|
||||||
|
font-size: 24rpx;
|
||||||
|
color: #fff;
|
||||||
|
font-weight: bold;
|
||||||
|
display: inline;
|
||||||
|
}
|
||||||
|
.column {
|
||||||
|
padding: 32rpx;
|
||||||
|
margin-bottom: 20rpx;
|
||||||
|
background: #fff;
|
||||||
|
}
|
||||||
|
.submit {
|
||||||
|
color: #fff;
|
||||||
|
margin-top: 120rpx;
|
||||||
|
background: rgba($light-color, 0.8);
|
||||||
|
}
|
||||||
|
.tips {
|
||||||
|
color: #999;
|
||||||
|
font-size: 24rpx;
|
||||||
|
line-height: 1.2;
|
||||||
|
margin-top: 10rpx;
|
||||||
|
}
|
||||||
|
.tips-success {
|
||||||
|
color: $weChat-color;
|
||||||
|
font-size: 24rpx;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -50,8 +50,8 @@
|
|||||||
<u-checkbox shape="circle" v-model="enablePrivacy" active-color="#FF5E00"></u-checkbox>
|
<u-checkbox shape="circle" v-model="enablePrivacy" active-color="#FF5E00"></u-checkbox>
|
||||||
</u-checkbox-group>
|
</u-checkbox-group>
|
||||||
<div class="tips">
|
<div class="tips">
|
||||||
未注册的手机号验证后将自动创建用户账号,登录即代表您已同意<span @click="navigateToPrivacy('privacy')">《隐私协议》</span>
|
未注册的手机号验证后将自动创建用户账号,登录即代表您已同意<span @click="navigateToPrivacy('PRIVACY_POLICY')">《隐私协议》</span>
|
||||||
<span @click="navigateToPrivacys('user')">
|
<span @click="navigateToPrivacy('USER_AGREEMENT')">
|
||||||
《用户协议》
|
《用户协议》
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
@@ -204,6 +204,7 @@
|
|||||||
},
|
},
|
||||||
|
|
||||||
mounted() {
|
mounted() {
|
||||||
|
|
||||||
// #ifndef APP-PLUS
|
// #ifndef APP-PLUS
|
||||||
//判断是否微信浏览器
|
//判断是否微信浏览器
|
||||||
var ua = window.navigator.userAgent.toLowerCase();
|
var ua = window.navigator.userAgent.toLowerCase();
|
||||||
@@ -320,7 +321,7 @@
|
|||||||
// 向后端请求验证码
|
// 向后端请求验证码
|
||||||
uni.showLoading({});
|
uni.showLoading({});
|
||||||
let res = await sendMobile(this.mobile);
|
let res = await sendMobile(this.mobile);
|
||||||
uni.hideLoading();
|
if (this.$store.state.isShowToast){ uni.hideLoading() };
|
||||||
// 这里此提示会被this.start()方法中的提示覆盖
|
// 这里此提示会被this.start()方法中的提示覆盖
|
||||||
if (res.data.success) {
|
if (res.data.success) {
|
||||||
this.current = 1;
|
this.current = 1;
|
||||||
@@ -409,6 +410,7 @@
|
|||||||
//微信小程序意外的其它方式直接在storage中写入openid
|
//微信小程序意外的其它方式直接在storage中写入openid
|
||||||
// #ifndef MP-WEIXIN
|
// #ifndef MP-WEIXIN
|
||||||
uni.setStorageSync("openid", res.authResult.openid);
|
uni.setStorageSync("openid", res.authResult.openid);
|
||||||
|
res.authResult.unionId && uni.setStorageSync("unionId", res.authResult.unionId);
|
||||||
// #endif
|
// #endif
|
||||||
},
|
},
|
||||||
fail(e) {
|
fail(e) {
|
||||||
@@ -426,6 +428,7 @@
|
|||||||
//写入用户信息
|
//写入用户信息
|
||||||
uni.setStorageSync("nickname", infoRes.userInfo.nickName);
|
uni.setStorageSync("nickname", infoRes.userInfo.nickName);
|
||||||
uni.setStorageSync("avatar", infoRes.userInfo.avatarUrl);
|
uni.setStorageSync("avatar", infoRes.userInfo.avatarUrl);
|
||||||
|
uni.setStorageSync("unionId", infoRes.userInfo.unionId);
|
||||||
|
|
||||||
// #ifdef MP-WEIXIN
|
// #ifdef MP-WEIXIN
|
||||||
//微信小程序获取openid 需要特殊处理 如需获取openid请参考uni-id: https://uniapp.dcloud.net.cn/uniCloud/uni-id
|
//微信小程序获取openid 需要特殊处理 如需获取openid请参考uni-id: https://uniapp.dcloud.net.cn/uniCloud/uni-id
|
||||||
@@ -450,9 +453,14 @@
|
|||||||
uuid: uni.getStorageSync("openid"), //联合登陆id
|
uuid: uni.getStorageSync("openid"), //联合登陆id
|
||||||
source: uni.getStorageSync("type"), //联合登陆类型
|
source: uni.getStorageSync("type"), //联合登陆类型
|
||||||
nickname: uni.getStorageSync("nickname"), // 昵称
|
nickname: uni.getStorageSync("nickname"), // 昵称
|
||||||
|
username: uni.getStorageSync("openid"), // 昵称
|
||||||
avatar: uni.getStorageSync("avatar"), // 头像
|
avatar: uni.getStorageSync("avatar"), // 头像
|
||||||
uniAccessToken: uni.getStorageSync("uni_access_token"), //第三方token
|
uniAccessToken: uni.getStorageSync("uni_access_token"), //第三方token
|
||||||
|
type:this.clientType,
|
||||||
|
token:{unionId:"",openId:uni.getStorageSync("openid")}
|
||||||
};
|
};
|
||||||
|
uni.getStorageSync("unionId") ? (params.token.unionId = uni.getStorageSync("unionId")) : delete params.token;
|
||||||
|
|
||||||
openIdLogin(params, clientType).then((res) => {
|
openIdLogin(params, clientType).then((res) => {
|
||||||
if (!res.data.success) {
|
if (!res.data.success) {
|
||||||
let errormessage = "第三方登录暂不可用";
|
let errormessage = "第三方登录暂不可用";
|
||||||
@@ -563,6 +571,7 @@
|
|||||||
*/
|
*/
|
||||||
storage.setUserInfo(user.data.result);
|
storage.setUserInfo(user.data.result);
|
||||||
storage.setHasLogin(true);
|
storage.setHasLogin(true);
|
||||||
|
storage.setAutoCp(0)
|
||||||
// 登录成功
|
// 登录成功
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: "登录成功!",
|
title: "登录成功!",
|
||||||
@@ -590,13 +599,9 @@
|
|||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: "/pages/mine/help/tips?type=" + val,
|
url: "/pages/mine/help/tips?type=" + val,
|
||||||
});
|
});
|
||||||
console.log(val)
|
|
||||||
},
|
|
||||||
navigateToPrivacys(val) {
|
|
||||||
uni.navigateTo({
|
|
||||||
url: "/pages/mine/help/tips?type=" + val,
|
|
||||||
})
|
|
||||||
},
|
},
|
||||||
|
|
||||||
// 点击获取验证码
|
// 点击获取验证码
|
||||||
start() {
|
start() {
|
||||||
this.codeColor = "#999";
|
this.codeColor = "#999";
|
||||||
@@ -657,9 +662,8 @@
|
|||||||
const params = JSON.parse(JSON.stringify(this.userData));
|
const params = JSON.parse(JSON.stringify(this.userData));
|
||||||
params.password = md5(params.password);
|
params.password = md5(params.password);
|
||||||
try {
|
try {
|
||||||
let res = await userLogin(params);
|
let res = await userLogin(params,this.clientType);
|
||||||
if (res.data.success) {
|
if (res.data.success) {
|
||||||
console.log("zhixing ")
|
|
||||||
this.getUserInfoMethods(res);
|
this.getUserInfoMethods(res);
|
||||||
} else {
|
} else {
|
||||||
this.$refs.verification.getCode();
|
this.$refs.verification.getCode();
|
||||||
@@ -701,7 +705,7 @@
|
|||||||
clearInterval(timer);
|
clearInterval(timer);
|
||||||
}, 100);
|
}, 100);
|
||||||
}
|
}
|
||||||
uni.hideLoading();
|
if (this.$store.state.isShowToast){ uni.hideLoading() };
|
||||||
}
|
}
|
||||||
if (!this.flage) {
|
if (!this.flage) {
|
||||||
this.$refs.verification.error(); //发送
|
this.$refs.verification.error(); //发送
|
||||||
|
|||||||
@@ -1,245 +1,308 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="container">
|
<view class="container">
|
||||||
<u-navbar :custom-back="back" title="小程序登录"></u-navbar>
|
<u-navbar :custom-back="back" title="小程序登录"></u-navbar>
|
||||||
<u-modal v-model="phoneAuthPopup" :mask-close-able="true" :title="projectName+'商城'" :show-confirm-button="false">
|
<u-modal v-model="phoneAuthPopup" :mask-close-able="true" :title="projectName+'商城'"
|
||||||
<div class="tips">
|
:show-confirm-button="false">
|
||||||
为了更好地用户体验,需要您授权手机号
|
<div class="tips">
|
||||||
</div>
|
为了更好地用户体验,需要您授权手机号
|
||||||
<button class="register" type="primary" open-type="getPhoneNumber" @getphonenumber="getPhoneNumber">
|
</div>
|
||||||
去授权
|
<button class="register" type="primary" open-type="getPhoneNumber" @getphonenumber="getPhoneNumber">
|
||||||
</button>
|
去授权
|
||||||
</u-modal>
|
</button>
|
||||||
<view class="wx-auth-container">
|
</u-modal>
|
||||||
<div class="box">
|
<view class="wx-auth-container">
|
||||||
<view class="logo-info">
|
<div class="box">
|
||||||
<text class="title">欢迎进入{{ projectName }}</text>
|
<view class="logo-info">
|
||||||
</view>
|
<text class="title">欢迎进入{{ projectName }}</text>
|
||||||
<view class="small-tips">
|
</view>
|
||||||
<view>为您提供优质服务,{{ projectName }}需要获取以下信息</view>
|
<view class="small-tips">
|
||||||
<view>您的公开信息(昵称、头像)</view>
|
<view>为您提供优质服务,{{ projectName }}需要获取以下信息</view>
|
||||||
</view>
|
<view>您的公开信息(昵称、头像)</view>
|
||||||
<view class="btns">
|
</view>
|
||||||
<button type="primary" bindtap="getUserProfile" @click="getUserProfile()" class="btn-auth">使用微信授权</button>
|
<view class="btns">
|
||||||
<div @click="backToHome" class="btn-callback">暂不登录</div>
|
<button type="primary" bindtap="getUserProfile" @click="getUserProfile()"
|
||||||
</view>
|
class="btn-auth">登录</button>
|
||||||
</div>
|
<div @click="backToHome" class="btn-callback">暂不登录</div>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</div>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { mpAutoLogin } from "@/api/connect.js";
|
import {
|
||||||
|
mpAutoLogin
|
||||||
|
} from "@/api/connect.js";
|
||||||
|
|
||||||
import { whetherNavigate } from "@/utils/Foundation"; //登录跳转
|
import {
|
||||||
import { getUserInfo } from "@/api/members";
|
whetherNavigate
|
||||||
import storage from "@/utils/storage.js";
|
} from "@/utils/Foundation"; //登录跳转
|
||||||
import config from '@/config/config'
|
import {
|
||||||
export default {
|
getUserInfo
|
||||||
data() {
|
} from "@/api/members";
|
||||||
return {
|
import storage from "@/utils/storage.js";
|
||||||
// 是否展示手机号码授权弹窗,默认第一步不展示,要先获取用户基础信息
|
import config from '@/config/config'
|
||||||
phoneAuthPopup: false,
|
export default {
|
||||||
// 授权信息展示,商城名称
|
data() {
|
||||||
projectName: config.name,
|
return {
|
||||||
//微信返回信息,用于揭秘信息,获取sessionkey
|
configs:config,
|
||||||
code: "",
|
// 是否展示手机号码授权弹窗,默认第一步不展示,要先获取用户基础信息
|
||||||
//微信昵称
|
phoneAuthPopup: false,
|
||||||
nickName: "",
|
// 授权信息展示,商城名称
|
||||||
//微信头像
|
projectName: config.name,
|
||||||
image: "",
|
//微信返回信息,用于揭秘信息,获取sessionkey
|
||||||
};
|
code: "",
|
||||||
},
|
//微信昵称
|
||||||
|
nickName: "",
|
||||||
|
//微信头像
|
||||||
|
image: "",
|
||||||
|
};
|
||||||
|
},
|
||||||
|
|
||||||
//微信小程序进入页面,先获取code,否则几率出现code和后续交互数据不对应情况
|
//微信小程序进入页面,先获取code,否则几率出现code和后续交互数据不对应情况
|
||||||
mounted() {
|
mounted() {
|
||||||
// 小程序默认分享
|
// 小程序默认分享
|
||||||
uni.showShareMenu({ withShareTicket: true });
|
uni.showShareMenu({
|
||||||
|
withShareTicket: true
|
||||||
|
});
|
||||||
|
|
||||||
let that = this;
|
let that = this;
|
||||||
//获取code
|
|
||||||
uni.login({
|
|
||||||
success: (res) => {
|
|
||||||
that.code = res.code;
|
|
||||||
},
|
|
||||||
});
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
/**
|
|
||||||
* TODO 此方法不一定是最优解,如果有更好的办法请在 https://gitee.com/beijing_hongye_huicheng/lilishop/issues 中提出
|
|
||||||
* 小程序返回bug
|
|
||||||
* 1.介于微信登录是在login.vue的基础上作为判断跳转来
|
|
||||||
* 所以在页面栈中会自动记录回退路径,所以导致每次微信小程序点击回退就会自动返回login页面
|
|
||||||
* 当然login页面的判断就是 没有登录就会跳转到微信小程序页面 导致了无法回退到之前页面
|
|
||||||
* 2.解决方法: 尝试在回退的时候判断地址,让回退多一级这样就避免了
|
|
||||||
*/
|
|
||||||
|
|
||||||
back() {
|
},
|
||||||
whetherNavigate("wx");
|
methods: {
|
||||||
},
|
/**
|
||||||
backToHome() {
|
* TODO 此方法不一定是最优解,如果有更好的办法请在 https://gitee.com/beijing_hongye_huicheng/lilishop/issues 中提出
|
||||||
uni.switchTab({
|
* 小程序返回bug
|
||||||
url: `/pages/tabbar/home/index`,
|
* 1.介于微信登录是在login.vue的基础上作为判断跳转来
|
||||||
});
|
* 所以在页面栈中会自动记录回退路径,所以导致每次微信小程序点击回退就会自动返回login页面
|
||||||
},
|
* 当然login页面的判断就是 没有登录就会跳转到微信小程序页面 导致了无法回退到之前页面
|
||||||
//获取用户信息
|
* 2.解决方法: 尝试在回退的时候判断地址,让回退多一级这样就避免了
|
||||||
getUserProfile(e) {
|
*/
|
||||||
let that = this;
|
|
||||||
// 推荐使用wx.getUserProfile获取用户信息,开发者每次通过该接口获取用户个人信息均需用户确认
|
back() {
|
||||||
uni.getUserProfile({
|
whetherNavigate("wx");
|
||||||
desc: "用于完善会员资料", // 声明获取用户个人信息后的用途,后续会展示在弹窗中,请谨慎填写
|
},
|
||||||
success: (res) => {
|
backToHome() {
|
||||||
that.nickName = res.userInfo.nickName;
|
uni.switchTab({
|
||||||
that.image = res.userInfo.avatarUrl;
|
url: `/pages/tabbar/home/index`,
|
||||||
//展示手机号获取授权
|
});
|
||||||
this.phoneAuthPopup = true;
|
},
|
||||||
},
|
|
||||||
fail: (res) => {
|
|
||||||
that.nickName = "微信用户";
|
|
||||||
that.image =
|
|
||||||
"https://thirdwx.qlogo.cn/mmopen/vi_32/POgEwh4mIHO4nibH0KlMECNjjGxQUq24ZEaGT4poC6icRiccVGKSyXwibcPq4BWmiaIGuG1icwxaQX6grC9VemZoJ8rg/132";
|
//获取用户信息
|
||||||
//展示手机号获取授权
|
getUserProfile(e) {
|
||||||
this.phoneAuthPopup = true;
|
let that = this;
|
||||||
},
|
//获取code
|
||||||
});
|
uni.login({
|
||||||
},
|
success: (res) => {
|
||||||
//获取手机号授权
|
if(res.errMsg === "login:ok") {
|
||||||
getPhoneNumber(e) {
|
that.code = res.code
|
||||||
let iv = e.detail.iv;
|
} else {
|
||||||
let encryptedData = e.detail.encryptedData;
|
uni.showToast({
|
||||||
if (!e.detail.encryptedData) {
|
title: "系统异常,请联系管理员!"
|
||||||
uni.showToast({
|
})
|
||||||
title: "请授予手机号码权限,手机号码会和会员系统用户绑定!",
|
}
|
||||||
icon: "none",
|
},
|
||||||
});
|
});
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
let code = this.code;
|
if (this.code) {
|
||||||
let image = this.image;
|
// 推荐使用wx.getUserProfile获取用户信息,开发者每次通过该接口获取用户个人信息均需用户确认
|
||||||
let nickName = this.nickName;
|
uni.getUserProfile({
|
||||||
mpAutoLogin({
|
desc: "用于完善会员资料", // 声明获取用户个人信息后的用途,后续会展示在弹窗中,请谨慎填写
|
||||||
encryptedData,
|
success: (res) => {
|
||||||
iv,
|
that.nickName = res.userInfo.nickName;
|
||||||
code,
|
that.image = res.userInfo.avatarUrl;
|
||||||
image,
|
|
||||||
nickName,
|
|
||||||
}).then((res) => {
|
|
||||||
storage.setAccessToken(res.data.result.accessToken);
|
|
||||||
storage.setRefreshToken(res.data.result.refreshToken);
|
|
||||||
// 登录成功
|
|
||||||
uni.showToast({
|
|
||||||
title: "登录成功!",
|
|
||||||
icon: "none",
|
|
||||||
});
|
|
||||||
//获取用户信息
|
|
||||||
getUserInfo().then((user) => {
|
|
||||||
storage.setUserInfo(user.data.result);
|
|
||||||
storage.setHasLogin(true);
|
|
||||||
|
|
||||||
uni.navigateBack({
|
/**
|
||||||
delta: 1,
|
* 根据公有的配置设置登录方式
|
||||||
|
*/
|
||||||
|
if(this.configs.enableFetchMobileLogin){
|
||||||
|
this.phoneAuthPopup = true;
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
let iv = res.iv;
|
||||||
|
let encryptedData = res.encryptedData;
|
||||||
|
|
||||||
|
let code = this.code;
|
||||||
|
let image = this.image;
|
||||||
|
let nickName = this.nickName;
|
||||||
|
mpAutoLogin({
|
||||||
|
encryptedData,
|
||||||
|
iv,
|
||||||
|
code,
|
||||||
|
image,
|
||||||
|
nickName,
|
||||||
|
}).then((apiRes) => {
|
||||||
|
storage.setAccessToken(apiRes.data.result.accessToken);
|
||||||
|
storage.setRefreshToken(apiRes.data.result.refreshToken);
|
||||||
|
// 登录成功
|
||||||
|
uni.showToast({
|
||||||
|
title: "登录成功!",
|
||||||
|
icon: "none",
|
||||||
|
});
|
||||||
|
//获取用户信息
|
||||||
|
getUserInfo().then((user) => {
|
||||||
|
storage.setUserInfo(user.data.result);
|
||||||
|
storage.setHasLogin(true);
|
||||||
|
|
||||||
|
uni.navigateBack({
|
||||||
|
delta: 1,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
},
|
||||||
|
fail: (res) => {
|
||||||
|
|
||||||
|
},
|
||||||
});
|
});
|
||||||
});
|
}
|
||||||
});
|
|
||||||
},
|
},
|
||||||
},
|
|
||||||
};
|
//获取手机号授权
|
||||||
|
getPhoneNumber(e) {
|
||||||
|
let iv = e.detail.iv;
|
||||||
|
let encryptedData = e.detail.encryptedData;
|
||||||
|
if (!e.detail.encryptedData) {
|
||||||
|
uni.showToast({
|
||||||
|
title: "请授予手机号码权限,手机号码会和会员系统用户绑定!",
|
||||||
|
icon: "none",
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
let code = this.code;
|
||||||
|
let image = this.image;
|
||||||
|
let nickName = this.nickName;
|
||||||
|
mpAutoLogin({
|
||||||
|
encryptedData,
|
||||||
|
iv,
|
||||||
|
code,
|
||||||
|
image,
|
||||||
|
nickName,
|
||||||
|
}).then((res) => {
|
||||||
|
storage.setAccessToken(res.data.result.accessToken);
|
||||||
|
storage.setRefreshToken(res.data.result.refreshToken);
|
||||||
|
// 登录成功
|
||||||
|
uni.showToast({
|
||||||
|
title: "登录成功!",
|
||||||
|
icon: "none",
|
||||||
|
});
|
||||||
|
//获取用户信息
|
||||||
|
getUserInfo().then((user) => {
|
||||||
|
storage.setUserInfo(user.data.result);
|
||||||
|
storage.setHasLogin(true);
|
||||||
|
|
||||||
|
uni.navigateBack({
|
||||||
|
delta: 1,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
},
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
/*微信授权*/
|
/*微信授权*/
|
||||||
page {
|
page {
|
||||||
background-color: #ffffff;
|
background-color: #ffffff;
|
||||||
}
|
}
|
||||||
|
|
||||||
.wx-auth-container {
|
.wx-auth-container {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
margin-top: 20%;
|
margin-top: 20%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.logo-info {
|
.logo-info {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-wrap: nowrap;
|
flex-wrap: nowrap;
|
||||||
justify-content: flex-start;
|
justify-content: flex-start;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
align-items: flex-start;
|
align-items: flex-start;
|
||||||
padding: 20rpx;
|
padding: 20rpx;
|
||||||
|
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
|
|
||||||
image {
|
image {
|
||||||
width: 100px;
|
width: 100px;
|
||||||
height: 100px;
|
height: 100px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
-webkit-transform: scale(2.5);
|
-webkit-transform: scale(2.5);
|
||||||
transform: scale(2.5);
|
transform: scale(2.5);
|
||||||
}
|
}
|
||||||
|
|
||||||
.logo-info-img {
|
.logo-info-img {
|
||||||
width: 80rpx;
|
width: 80rpx;
|
||||||
height: 80rpx;
|
height: 80rpx;
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
border: none;
|
border: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
text.title,
|
text.title,
|
||||||
text.shop {
|
text.shop {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
font-size: 60rpx;
|
font-size: 60rpx;
|
||||||
color: #333;
|
color: #333;
|
||||||
}
|
}
|
||||||
|
|
||||||
text.shop {
|
text.shop {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
font-size: 55rpx;
|
font-size: 55rpx;
|
||||||
color: #333;
|
color: #333;
|
||||||
}
|
}
|
||||||
|
|
||||||
.box {
|
.box {
|
||||||
margin: 0 32rpx;
|
margin: 0 32rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 文字提示*/
|
/* 文字提示*/
|
||||||
.small-tips {
|
.small-tips {
|
||||||
width: 94%;
|
width: 94%;
|
||||||
padding: 20rpx;
|
padding: 20rpx;
|
||||||
font-size: 24rpx;
|
font-size: 24rpx;
|
||||||
margin: 0 0 20rpx;
|
margin: 0 0 20rpx;
|
||||||
color: #999;
|
color: #999;
|
||||||
}
|
}
|
||||||
|
|
||||||
.auth-button {
|
.auth-button {
|
||||||
padding: 10px 20px;
|
padding: 10px 20px;
|
||||||
width: calc(100% - 20 * 4rpx);
|
width: calc(100% - 20 * 4rpx);
|
||||||
}
|
}
|
||||||
|
|
||||||
.tips {
|
.tips {
|
||||||
width: 80%;
|
width: 80%;
|
||||||
text-align: left;
|
text-align: left;
|
||||||
margin: 6% 10%;
|
margin: 6% 10%;
|
||||||
margin-top: 48rpx;
|
margin-top: 48rpx;
|
||||||
line-height: 1.75;
|
line-height: 1.75;
|
||||||
}
|
}
|
||||||
|
|
||||||
.register {
|
.register {
|
||||||
color: $weChat-color !important;
|
color: $weChat-color !important;
|
||||||
border: none !important;
|
border: none !important;
|
||||||
background: #fff !important;
|
background: #fff !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.btn-auth {
|
.btn-auth {
|
||||||
width: 92%;
|
width: 92%;
|
||||||
margin: 0 auto 40rpx;
|
margin: 0 auto 40rpx;
|
||||||
border-radius: 100px;
|
border-radius: 100px;
|
||||||
animation: mymove 5s infinite;
|
// animation: mymove 5s infinite;
|
||||||
-webkit-animation: mymove 5s infinite; /*Safari and Chrome*/
|
// -webkit-animation: mymove 5s infinite; /*Safari and Chrome*/
|
||||||
animation-direction: alternate; /*轮流反向播放动画。*/
|
// animation-direction: alternate; /*轮流反向播放动画。*/
|
||||||
animation-timing-function: ease-in-out; /*动画的速度曲线*/
|
// animation-timing-function: ease-in-out; /*动画的速度曲线*/
|
||||||
/* Safari 和 Chrome */
|
// /* Safari 和 Chrome */
|
||||||
-webkit-animation: mymove 5s infinite;
|
// -webkit-animation: mymove 5s infinite;
|
||||||
-webkit-animation-direction: alternate; /*轮流反向播放动画。*/
|
// -webkit-animation-direction: alternate; /*轮流反向播放动画。*/
|
||||||
-webkit-animation-timing-function: ease-in-out; /*动画的速度曲线*/
|
// -webkit-animation-timing-function: ease-in-out; /*动画的速度曲线*/
|
||||||
}
|
}
|
||||||
.btn-callback {
|
.btn-callback {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
@@ -252,26 +315,42 @@ text.shop {
|
|||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
.btns {
|
.btn-callback {
|
||||||
margin-top: 100rpx;
|
text-align: center;
|
||||||
display: flex;
|
font-size: 30rpx;
|
||||||
flex-direction: column;
|
background: #ededed;
|
||||||
width: 100%;
|
height: 90rpx;
|
||||||
justify-content: center;
|
line-height: 90rpx;
|
||||||
}
|
border-radius: 100px;
|
||||||
|
width: 92%;
|
||||||
|
margin: 0 auto;
|
||||||
|
}
|
||||||
|
|
||||||
@keyframes mymove {
|
.btns {
|
||||||
0% {
|
margin-top: 100rpx;
|
||||||
transform: scale(1); /*开始为原始大小*/
|
display: flex;
|
||||||
}
|
flex-direction: column;
|
||||||
25% {
|
width: 100%;
|
||||||
transform: scale(1.1); /*放大1.1倍*/
|
justify-content: center;
|
||||||
}
|
}
|
||||||
50% {
|
|
||||||
transform: scale(1);
|
@keyframes mymove {
|
||||||
}
|
0% {
|
||||||
75% {
|
transform: scale(1);
|
||||||
transform: scale(1.1);
|
/*开始为原始大小*/
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
25% {
|
||||||
|
transform: scale(1.1);
|
||||||
|
/*放大1.1倍*/
|
||||||
|
}
|
||||||
|
|
||||||
|
50% {
|
||||||
|
transform: scale(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
75% {
|
||||||
|
transform: scale(1.1);
|
||||||
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ export default {
|
|||||||
title: "请填写内容!",
|
title: "请填写内容!",
|
||||||
icon: "none",
|
icon: "none",
|
||||||
});
|
});
|
||||||
uni.hideLoading();
|
if (this.$store.state.isShowToast){ uni.hideLoading() };
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
API_MEM.consultating(
|
API_MEM.consultating(
|
||||||
@@ -86,11 +86,11 @@ export default {
|
|||||||
});
|
});
|
||||||
this.askValue = "";
|
this.askValue = "";
|
||||||
}
|
}
|
||||||
uni.hideLoading();
|
if (this.$store.state.isShowToast){ uni.hideLoading() };
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
|
|
||||||
uni.hideLoading();
|
if (this.$store.state.isShowToast){ uni.hideLoading() };
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
radioGroupChange(e) {
|
radioGroupChange(e) {
|
||||||
|
|||||||
@@ -20,7 +20,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<view class="eva-box" v-for="(item, index) in commDetail" :key="index">
|
<view class="eva-box" v-for="(item, index) in commDetail" :key="index">
|
||||||
<view class="section-info">
|
<view class="section-info">
|
||||||
<image class="portrait" :src="item.memberProfile || '/static/missing-face.png'" mode="aspectFill"></image>
|
<image class="portrait" :src="item.memberProfile || userImage" mode="aspectFit"></image>
|
||||||
<view class="star-content">
|
<view class="star-content">
|
||||||
<text class="name">{{ item.memberName | noPassByName }}</text>
|
<text class="name">{{ item.memberName | noPassByName }}</text>
|
||||||
<text class="time">{{ item.createTime }}</text>
|
<text class="time">{{ item.createTime }}</text>
|
||||||
@@ -65,11 +65,13 @@
|
|||||||
<script>
|
<script>
|
||||||
// import { getGoodsDetail } from '@/api/goods.js';
|
// import { getGoodsDetail } from '@/api/goods.js';
|
||||||
import * as membersApi from "@/api/members.js";
|
import * as membersApi from "@/api/members.js";
|
||||||
|
import configs from '@/config/config'
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
configs,
|
||||||
status: "loadmore", //底部刷新状态
|
status: "loadmore", //底部刷新状态
|
||||||
|
userImage:configs.defaultUserPhoto,
|
||||||
commentDetail: "", //评价详情
|
commentDetail: "", //评价详情
|
||||||
selectIndex: "0", //检索条件
|
selectIndex: "0", //检索条件
|
||||||
params: { // 评论分页提交数据
|
params: { // 评论分页提交数据
|
||||||
|
|||||||
@@ -6,55 +6,28 @@
|
|||||||
<!-- 仅h5有效 打开App -->
|
<!-- 仅h5有效 打开App -->
|
||||||
|
|
||||||
<!-- 分享 -->
|
<!-- 分享 -->
|
||||||
<shares
|
<shares v-if="enableShare && goodsDetail.id" :skuId="this.routerVal.id" :goodsId="this.routerVal.goodsId" :link="
|
||||||
v-if="enableShare && goodsDetail.id"
|
'/pages/product/goods?id=' +
|
||||||
:skuId="this.routerVal.id"
|
this.routerVal.id +
|
||||||
:goodsId="this.routerVal.goodsId"
|
'&goodsId=' +
|
||||||
:link="
|
this.routerVal.goodsId
|
||||||
'/pages/product/goods?id=' +
|
" :thumbnail="goodsDetail.thumbnail" :goodsName="goodsDetail.goodsName" type="goods"
|
||||||
this.routerVal.id +
|
@close="enableShare = false" />
|
||||||
'&goodsId=' +
|
<popups v-model="popupsSwitch" @tapPopup="handleNavbarList" :popData="navbarListData" :x="navbarListX"
|
||||||
this.routerVal.goodsId
|
:y="navbarListY" placement="top-start" />
|
||||||
"
|
|
||||||
: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">
|
<view class="index">
|
||||||
<!-- topBar -->
|
<!-- topBar -->
|
||||||
<u-navbar
|
<u-navbar :background="navbar" :is-back="false" :class="headerFlag ? 'header' : 'header bg-none scroll-hide'">
|
||||||
:background="navbar"
|
|
||||||
:is-back="false"
|
|
||||||
:class="headerFlag ? 'header' : 'header bg-none scroll-hide'"
|
|
||||||
>
|
|
||||||
<div class="headerRow">
|
<div class="headerRow">
|
||||||
<div class="backs">
|
<div class="backs">
|
||||||
<u-icon @click="back()" name="arrow-left" class="icon-back"></u-icon>
|
<u-icon @click="back()" name="arrow-left" class="icon-back"></u-icon>
|
||||||
|
|
||||||
<u-icon
|
<u-icon name="list" @click="popupsSwitch = !popupsSwitch" class="icon-list"></u-icon>
|
||||||
name="list"
|
|
||||||
@click="popupsSwitch = !popupsSwitch"
|
|
||||||
class="icon-list"
|
|
||||||
></u-icon>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="headerList" :class="headerFlag ? 'tab-bar' : 'tab-bar scroll-hide'">
|
<div class="headerList" :class="headerFlag ? 'tab-bar' : 'tab-bar scroll-hide'">
|
||||||
<div class="headerRow">
|
<div class="headerRow">
|
||||||
<div
|
<div class="nav-item" v-for="header in headerList" :key="header.id"
|
||||||
class="nav-item"
|
:class="{ cur: scrollId === header.id }" @click="headerTab(header.id)">
|
||||||
v-for="header in headerList"
|
|
||||||
:key="header.id"
|
|
||||||
:class="{ cur: scrollId === header.id }"
|
|
||||||
@click="headerTab(header.id)"
|
|
||||||
>
|
|
||||||
{{ header.text }}
|
{{ header.text }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -62,57 +35,27 @@
|
|||||||
</div>
|
</div>
|
||||||
</u-navbar>
|
</u-navbar>
|
||||||
|
|
||||||
<u-navbar
|
<u-navbar :border-bottom="false" v-show="!headerFlag" class="header-only-back" :background="navbarOnlyBack"
|
||||||
:border-bottom="false"
|
:is-back="false">
|
||||||
v-show="!headerFlag"
|
|
||||||
class="header-only-back"
|
|
||||||
:background="navbarOnlyBack"
|
|
||||||
:is-back="false"
|
|
||||||
>
|
|
||||||
<div>
|
<div>
|
||||||
<div class="bg-back">
|
<div class="bg-back">
|
||||||
<u-icon
|
<u-icon size="40" @click="back()" name="arrow-left" class="icon-back"></u-icon>
|
||||||
size="40"
|
<u-icon size="40" @click="popupsSwitch = !popupsSwitch" name="list" class="icon-list"></u-icon>
|
||||||
@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>
|
||||||
</div>
|
</div>
|
||||||
</u-navbar>
|
</u-navbar>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view
|
<view class="product-container" :style="{ height: productRefHeight }" ref="productRef" id="productRef">
|
||||||
class="product-container"
|
<scroll-view scroll-anchoring enableBackToTop="true" scroll-with-animation scroll-y class="scroll-page"
|
||||||
:style="{ height: productRefHeight }"
|
:scroll-top="tabScrollTop" @scroll="pageScroll">
|
||||||
ref="productRef"
|
|
||||||
id="productRef"
|
|
||||||
>
|
|
||||||
<scroll-view
|
|
||||||
scroll-anchoring
|
|
||||||
enableBackToTop="true"
|
|
||||||
scroll-with-animation
|
|
||||||
scroll-y
|
|
||||||
class="scroll-page"
|
|
||||||
:scroll-top="tabScrollTop"
|
|
||||||
@scroll="pageScroll"
|
|
||||||
>
|
|
||||||
<view>
|
<view>
|
||||||
<!-- 轮播图 -->
|
<!-- 轮播图 -->
|
||||||
<GoodsSwiper id="main1" :res="imgList" />
|
|
||||||
|
<GoodsSwiper id="main1" :res="imgList" :video="goodsDetail.goodsVideo" />
|
||||||
|
|
||||||
<!-- 促销活动条 -->
|
<!-- 促销活动条 -->
|
||||||
<PromotionAssembleLayout
|
<PromotionAssembleLayout v-if="PromotionList" :detail="goodsDetail" :res="PromotionList" />
|
||||||
v-if="PromotionList"
|
|
||||||
:detail="goodsDetail"
|
|
||||||
:res="PromotionList"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<view class="card-box top-radius-0" id="main2">
|
<view class="card-box top-radius-0" id="main2">
|
||||||
<!-- 活动不显示价钱 -->
|
<!-- 活动不显示价钱 -->
|
||||||
@@ -122,14 +65,10 @@
|
|||||||
{{ goodsDetail.goodsName || "" }}
|
{{ goodsDetail.goodsName || "" }}
|
||||||
</view>
|
</view>
|
||||||
<view class="favorite" @click="clickFavorite(goodsDetail.id)">
|
<view class="favorite" @click="clickFavorite(goodsDetail.id)">
|
||||||
<u-icon
|
<u-icon size="30" :color="favorite ? '#f2270c' : '#262626'" :name="favorite ? 'heart-fill' : 'heart'">
|
||||||
size="30"
|
|
||||||
:color="favorite ? '#f2270c' : '#262626'"
|
|
||||||
:name="favorite ? 'heart-fill' : 'heart'"
|
|
||||||
>
|
|
||||||
</u-icon>
|
</u-icon>
|
||||||
<view :style="{ color: favorite ? '#f2270c' : '#262626' }">{{
|
<view :style="{ color: favorite ? '#f2270c' : '#262626' }">{{
|
||||||
favorite ? "已收藏" : "收藏"
|
favorite? "已收藏": "收藏"
|
||||||
}}</view>
|
}}</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -144,24 +83,35 @@
|
|||||||
<view class="-goods-flex">
|
<view class="-goods-flex">
|
||||||
<!-- 如果有积分显示积分 -->
|
<!-- 如果有积分显示积分 -->
|
||||||
<view class="-goods-price" v-if="goodsDetail.price != undefined">
|
<view class="-goods-price" v-if="goodsDetail.price != undefined">
|
||||||
<span v-if="pointDetail.points">
|
|
||||||
<span class="price">{{ pointDetail.points }}</span>
|
|
||||||
<span>积分</span>
|
|
||||||
</span>
|
|
||||||
|
|
||||||
<span v-else>
|
<span>
|
||||||
<span v-if="wholesaleList.length">
|
<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[wholesaleList.length - 1].price)[0]
|
||||||
<span>¥</span><span class="price">{{ $options.filters.goodsFormatPrice(wholesaleList[0].price)[0] }}</span>.{{ $options.filters.goodsFormatPrice(wholesaleList[0].price)[1] }}
|
}}</span>.{{
|
||||||
</span>
|
$options.filters.goodsFormatPrice(wholesaleList[wholesaleList.length - 1].price)[1]
|
||||||
<span v-else>
|
}}
|
||||||
<span>¥</span><span class="price">{{ $options.filters.goodsFormatPrice(goodsDetail.price)[0] }}</span>.{{ $options.filters.goodsFormatPrice(goodsDetail.price)[1] }}
|
~
|
||||||
</span>
|
<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>
|
</span>
|
||||||
</view>
|
</view>
|
||||||
<view class="-goods-price" v-else>
|
<view class="-goods-price" v-else>
|
||||||
|
<div v-if="takeDownFromSale" class="price down-goods">
|
||||||
|
暂无报价
|
||||||
|
</div>
|
||||||
|
<span v-else>
|
||||||
¥<span class="price">0 </span>.00
|
¥<span class="price">0 </span>.00
|
||||||
|
</span>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="icons share" @click="shareChange()">
|
<view class="icons share" @click="shareChange()">
|
||||||
@@ -169,13 +119,10 @@
|
|||||||
<view>分享</view>
|
<view>分享</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="icons" @click="clickFavorite(goodsDetail.id)">
|
<view class="icons" @click="clickFavorite(goodsDetail.id)">
|
||||||
<u-icon
|
<u-icon size="30" :color="favorite ? '#f2270c' : '#262626'"
|
||||||
size="30"
|
:name="favorite ? 'heart-fill' : 'heart'"></u-icon>
|
||||||
:color="favorite ? '#f2270c' : '#262626'"
|
|
||||||
:name="favorite ? 'heart-fill' : 'heart'"
|
|
||||||
></u-icon>
|
|
||||||
<view :style="{ color: favorite ? '#f2270c' : '#262626' }">{{
|
<view :style="{ color: favorite ? '#f2270c' : '#262626' }">{{
|
||||||
favorite ? "已收藏" : "收藏"
|
favorite? "已收藏": "收藏"
|
||||||
}}</view>
|
}}</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -203,22 +150,16 @@
|
|||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 拼团用户列表 -->
|
<!-- 拼团用户列表 -->
|
||||||
<PromotionAssembleListLayout
|
<PromotionAssembleListLayout v-if="isGroup" @to-assemble-buy-now="toAssembleBuyNow" :res="PromotionList" />
|
||||||
v-if="isGroup"
|
|
||||||
@to-assemble-buy-now="toAssembleBuyNow"
|
|
||||||
:res="PromotionList"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<!-- 配置地址 如果是虚拟产品的时候不展示 -->
|
<!-- 配置地址 如果是虚拟产品的时候不展示 -->
|
||||||
<view class="card-box" v-if="goodsDetail.goodsType != 'VIRTUAL_GOODS'">
|
<view class="card-box" v-if="goodsDetail.goodsType != 'VIRTUAL_GOODS'">
|
||||||
<view class="card-flex" @click="shutMask(4)">
|
<view class="card-flex" @click="shutMask(4)">
|
||||||
<view class="card-title"> 已选 </view>
|
<view class="card-title"> 已选 </view>
|
||||||
<view class="card-content">
|
<view class="card-content">
|
||||||
<span v-if="selectedGoods.spec"
|
<span v-if="selectedGoods.spec">{{ selectedGoods.spec.specName }}-{{
|
||||||
>{{ selectedGoods.spec.specName }}-{{
|
selectedGoods.spec.specValue
|
||||||
selectedGoods.spec.specValue
|
}}</span>
|
||||||
}}</span
|
|
||||||
>
|
|
||||||
<span v-else>默认</span>
|
<span v-else>默认</span>
|
||||||
</view>
|
</view>
|
||||||
<view class="card-bottom">
|
<view class="card-bottom">
|
||||||
@@ -243,27 +184,18 @@
|
|||||||
<Evaluation id="main5" :goodsDetail="goodsDetail" />
|
<Evaluation id="main5" :goodsDetail="goodsDetail" />
|
||||||
|
|
||||||
<!-- 店铺推荐 -->
|
<!-- 店铺推荐 -->
|
||||||
<storeLayout
|
<storeLayout id="main7" :storeDetail="storeDetail" :goodsDetail="goodsDetail" :res="recommendList" />
|
||||||
id="main7"
|
|
||||||
:storeDetail="storeDetail"
|
|
||||||
:goodsDetail="goodsDetail"
|
|
||||||
:res="recommendList"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<!-- 宝贝详情 -->
|
<!-- 宝贝详情 -->
|
||||||
<GoodsIntro
|
<GoodsIntro id="main9" :res="goodsDetail" :goodsParams="goodsParams" :goodsId="goodsDetail.goodsId"
|
||||||
id="main9"
|
v-if="goodsDetail.id" />
|
||||||
:res="goodsDetail"
|
|
||||||
:goodsParams="goodsParams"
|
|
||||||
:goodsId="goodsDetail.goodsId"
|
|
||||||
v-if="goodsDetail.id"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<!-- 宝贝推荐 -->
|
<!-- 宝贝推荐 -->
|
||||||
<GoodsRecommend id="main11" :res="likeGoodsList" />
|
<GoodsRecommend id="main11" :res="likeGoodsList" />
|
||||||
</view>
|
</view>
|
||||||
</scroll-view>
|
</scroll-view>
|
||||||
|
|
||||||
|
|
||||||
<view class="page-bottom mp-iphonex-bottom" id="pageBottom">
|
<view class="page-bottom mp-iphonex-bottom" id="pageBottom">
|
||||||
<view class="icon-btn">
|
<view class="icon-btn">
|
||||||
<view class="icon-btn-item" @click="navigateToStore(goodsDetail.storeId)">
|
<view class="icon-btn-item" @click="navigateToStore(goodsDetail.storeId)">
|
||||||
@@ -280,20 +212,20 @@
|
|||||||
<view v-if="nums && nums > 0" class="num-icon">{{ nums }}</view>
|
<view v-if="nums && nums > 0" class="num-icon">{{ nums }}</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
<!-- 下架展示 -->
|
||||||
|
<div class="detail-btn" v-if="takeDownFromSale">
|
||||||
|
<view class="to-store-car to-store-btn" @click="reStartTakeDownSale">
|
||||||
|
查看类似商品</view>
|
||||||
|
</div>
|
||||||
<!-- 正常结算页面 -->
|
<!-- 正常结算页面 -->
|
||||||
<view class="detail-btn" v-if="!isGroup">
|
<view class="detail-btn" v-if="!isGroup && !takeDownFromSale">
|
||||||
<view
|
<view class="to-store-car to-store-btn" v-if="goodsDetail.goodsType != 'VIRTUAL_GOODS'" @click="shutMask(4)">
|
||||||
class="to-store-car to-store-btn"
|
加入购物车</view>
|
||||||
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-buy to-store-btn" @click="shutMask(4, 'buy')">立即购买</view>
|
||||||
<view class="to-store-car to-store-btn" v-if="startTimer">暂未开始</view>
|
<view class="to-store-car to-store-btn" v-if="startTimer">暂未开始</view>
|
||||||
</view>
|
</view>
|
||||||
<!-- 拼团结算 -->
|
<!-- 拼团结算 -->
|
||||||
<view class="detail-btn" v-else>
|
<view class="detail-btn" v-else-if="isGroup">
|
||||||
<view class="to-store-car pt-buy to-store-btn" @click="shutMask(4, 'buy')">
|
<view class="to-store-car pt-buy to-store-btn" @click="shutMask(4, 'buy')">
|
||||||
<view>¥{{ goodsDetail.price | unitPrice }}</view>
|
<view>¥{{ goodsDetail.price | unitPrice }}</view>
|
||||||
<view>单独购买</view>
|
<view>单独购买</view>
|
||||||
@@ -307,15 +239,8 @@
|
|||||||
<!-- 规格-模态层弹窗 -->
|
<!-- 规格-模态层弹窗 -->
|
||||||
<view class="spec">
|
<view class="spec">
|
||||||
<!-- 促销弹窗 -->
|
<!-- 促销弹窗 -->
|
||||||
<u-popup
|
<u-popup v-model="promotionShow" :height="setup.height" :mode="setup.mode" :border-radius="setup.radius"
|
||||||
v-model="promotionShow"
|
@close="promotionShow = false" :mask-close-able="setup.close" closeable>
|
||||||
: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="header-title">优惠</view>
|
||||||
<view class="cuxiao">
|
<view class="cuxiao">
|
||||||
<scroll-view class="scroll_mask" :scroll-y="true">
|
<scroll-view class="scroll_mask" :scroll-y="true">
|
||||||
@@ -332,31 +257,18 @@
|
|||||||
</u-popup>
|
</u-popup>
|
||||||
|
|
||||||
<!-- 配送地址弹窗 -->
|
<!-- 配送地址弹窗 -->
|
||||||
<popupAddress
|
<popupAddress @closeAddress="closePopupAddress" @deliveryData="deliveryFun" v-if="goodsDetail.id"
|
||||||
@closeAddress="closePopupAddress"
|
:goodsId="goodsDetail.id" :addressFlag="addressFlag" />
|
||||||
@deliveryData="deliveryFun"
|
|
||||||
v-if="goodsDetail.id"
|
|
||||||
:goodsId="goodsDetail.id"
|
|
||||||
:addressFlag="addressFlag"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<!-- 商品规格 商品详情,以及默认参与活动的id-->
|
<!-- 商品规格 商品详情,以及默认参与活动的id-->
|
||||||
<popupGoods
|
<popupGoods :addr="delivery" ref="popupGoods" @changed="changedGoods" @closeBuy="closePopupBuy"
|
||||||
:addr="delivery"
|
@queryCart="cartCount()" :goodsDetail="goodsDetail" :goodsSpec="goodsSpec" :isGroup="isGroup" :id="productId"
|
||||||
ref="popupGoods"
|
v-if="goodsDetail.id" :pointDetail="pointDetail" :wholesaleList="wholesaleList" @handleClickSku="selectSku"
|
||||||
@changed="changedGoods"
|
:buyMask="buyMask" />
|
||||||
@closeBuy="closePopupBuy"
|
|
||||||
@queryCart="cartCount()"
|
|
||||||
:goodsDetail="goodsDetail"
|
<!-- 下架框 -->
|
||||||
:goodsSpec="goodsSpec"
|
<takeDownFormSaleGoods ref="takeDownSale" v-if="takeDownFromSale" />
|
||||||
:isGroup="isGroup"
|
|
||||||
:id="productId"
|
|
||||||
v-if="goodsDetail.id"
|
|
||||||
:pointDetail="pointDetail"
|
|
||||||
:wholesaleList="wholesaleList"
|
|
||||||
@handleClickSku="selectSku"
|
|
||||||
:buyMask="buyMask"
|
|
||||||
/>
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</div>
|
</div>
|
||||||
@@ -388,7 +300,9 @@ import popupGoods from "@/components/m-buy/goods"; //购物车商品的模块
|
|||||||
import popupAddress from "./product/popup/address"; //地址选择模块
|
import popupAddress from "./product/popup/address"; //地址选择模块
|
||||||
import shares from "@/components/m-share/index"; //分享
|
import shares from "@/components/m-share/index"; //分享
|
||||||
import popups from "@/components/popups/popups"; //气泡框
|
import popups from "@/components/popups/popups"; //气泡框
|
||||||
|
import takeDownFormSaleGoods from "@/components/m-take-down-sale-goods/index"; //下架框
|
||||||
import setup from "./product/popup/popup";
|
import setup from "./product/popup/popup";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
popups,
|
popups,
|
||||||
@@ -405,8 +319,9 @@ export default {
|
|||||||
GoodsSwiper,
|
GoodsSwiper,
|
||||||
popupGoods,
|
popupGoods,
|
||||||
popupAddress,
|
popupAddress,
|
||||||
|
takeDownFormSaleGoods
|
||||||
},
|
},
|
||||||
data() {
|
data () {
|
||||||
return {
|
return {
|
||||||
setup,
|
setup,
|
||||||
promotionShow: false, //弹窗开关
|
promotionShow: false, //弹窗开关
|
||||||
@@ -449,7 +364,7 @@ export default {
|
|||||||
enableShare: false,
|
enableShare: false,
|
||||||
selectedGoods: "", //选择的商品规格昵称
|
selectedGoods: "", //选择的商品规格昵称
|
||||||
isGroup: false, // 是否是拼团活动
|
isGroup: false, // 是否是拼团活动
|
||||||
isSeckill:false, // 是否秒杀活动
|
isSeckill: false, // 是否秒杀活动
|
||||||
pointDetail: "", // 是否是积分商品
|
pointDetail: "", // 是否是积分商品
|
||||||
assemble: "", //拼团的sku
|
assemble: "", //拼团的sku
|
||||||
navbarOnlyBack: {
|
navbarOnlyBack: {
|
||||||
@@ -488,10 +403,8 @@ export default {
|
|||||||
tabScrollTop: null,
|
tabScrollTop: null,
|
||||||
scrollArr: [],
|
scrollArr: [],
|
||||||
scrollId: "1",
|
scrollId: "1",
|
||||||
|
|
||||||
scrollFlag: true,
|
scrollFlag: true,
|
||||||
current: "1", //当前显示的轮播图页
|
current: "1", //当前显示的轮播图页
|
||||||
|
|
||||||
goodsDetail: {}, //商品数据
|
goodsDetail: {}, //商品数据
|
||||||
goodsSpec: "", //规格数据
|
goodsSpec: "", //规格数据
|
||||||
imgList: [], //轮播图数据
|
imgList: [], //轮播图数据
|
||||||
@@ -501,12 +414,9 @@ export default {
|
|||||||
goodsInfo: false, //商品介绍弹窗
|
goodsInfo: false, //商品介绍弹窗
|
||||||
addressFlag: false, //配送地址弹窗
|
addressFlag: false, //配送地址弹窗
|
||||||
buyMask: false, //添加购物车直接购买,查看已选 弹窗
|
buyMask: false, //添加购物车直接购买,查看已选 弹窗
|
||||||
|
|
||||||
num: 1, //添加到购物车的数量
|
num: 1, //添加到购物车的数量
|
||||||
|
|
||||||
skuId: "", //
|
skuId: "", //
|
||||||
storeDetail: "", //店铺基本信息,
|
storeDetail: "", //店铺基本信息,
|
||||||
|
|
||||||
// 店铺信息
|
// 店铺信息
|
||||||
storeParams: {
|
storeParams: {
|
||||||
pageNumber: 1,
|
pageNumber: 1,
|
||||||
@@ -516,7 +426,6 @@ export default {
|
|||||||
likeGoodsList: "", //相似商品列表
|
likeGoodsList: "", //相似商品列表
|
||||||
PromotionList: "", //活动,促销,列表
|
PromotionList: "", //活动,促销,列表
|
||||||
specList: [],
|
specList: [],
|
||||||
skusCombination: [],
|
|
||||||
selectedSpec: [],
|
selectedSpec: [],
|
||||||
nums: 0,
|
nums: 0,
|
||||||
delivery: "",
|
delivery: "",
|
||||||
@@ -528,19 +437,20 @@ export default {
|
|||||||
|
|
||||||
routerVal: "",
|
routerVal: "",
|
||||||
IMLink: "", // IM地址
|
IMLink: "", // IM地址
|
||||||
wholesaleList:[]
|
wholesaleList: [],
|
||||||
|
takeDownFromSale: false, // 下架销售状态
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
computed: {
|
computed: {
|
||||||
// udesk IM
|
// udesk IM
|
||||||
IM() {
|
IM () {
|
||||||
return this.IMLink + this.storeDetail.merchantEuid;
|
return this.IMLink + this.storeDetail.merchantEuid;
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
watch: {
|
watch: {
|
||||||
isGroup(val) {
|
isGroup (val) {
|
||||||
if (val) {
|
if (val) {
|
||||||
let timer = setInterval(() => {
|
let timer = setInterval(() => {
|
||||||
this.$refs.popupGoods.buyType = "PINTUAN";
|
this.$refs.popupGoods.buyType = "PINTUAN";
|
||||||
@@ -551,7 +461,7 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted () {
|
||||||
const { windowHeight } = uni.getSystemInfoSync();
|
const { windowHeight } = uni.getSystemInfoSync();
|
||||||
let bottomHeight = 0;
|
let bottomHeight = 0;
|
||||||
let topHeight = 0;
|
let topHeight = 0;
|
||||||
@@ -581,7 +491,7 @@ export default {
|
|||||||
|
|
||||||
this.productRefHeight = windowHeight - bottomHeight + "px";
|
this.productRefHeight = windowHeight - bottomHeight + "px";
|
||||||
},
|
},
|
||||||
async onLoad(options) {
|
async onLoad (options) {
|
||||||
this.routerVal = options;
|
this.routerVal = options;
|
||||||
// #ifdef MP-WEIXIN
|
// #ifdef MP-WEIXIN
|
||||||
// 小程序默认分享
|
// 小程序默认分享
|
||||||
@@ -591,7 +501,7 @@ export default {
|
|||||||
});
|
});
|
||||||
// #endif
|
// #endif
|
||||||
},
|
},
|
||||||
async onShow() {
|
async onShow () {
|
||||||
this.goodsDetail = {};
|
this.goodsDetail = {};
|
||||||
//如果有参数ids说明事分销短连接,需要获取参数
|
//如果有参数ids说明事分销短连接,需要获取参数
|
||||||
if (this.routerVal.scene) {
|
if (this.routerVal.scene) {
|
||||||
@@ -607,20 +517,24 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
share() {
|
// 重新打开下架
|
||||||
|
reStartTakeDownSale(){
|
||||||
|
this.$refs.takeDownSale.show = true
|
||||||
|
},
|
||||||
|
share () {
|
||||||
return `/pages/product/goods?id=${this.routerVal.id}&goodsId=${this.routerVal.goodsId}`;
|
return `/pages/product/goods?id=${this.routerVal.id}&goodsId=${this.routerVal.goodsId}`;
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* 导航栏列表栏
|
* 导航栏列表栏
|
||||||
*/
|
*/
|
||||||
handleNavbarList(val) {
|
handleNavbarList (val) {
|
||||||
modelNavigateTo({ url: val });
|
modelNavigateTo({ url: val });
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 循环出当前促销是否为空
|
* 循环出当前促销是否为空
|
||||||
*/
|
*/
|
||||||
emptyPromotion() {
|
emptyPromotion () {
|
||||||
if (
|
if (
|
||||||
this.PromotionList == "" ||
|
this.PromotionList == "" ||
|
||||||
this.PromotionList == null ||
|
this.PromotionList == null ||
|
||||||
@@ -629,23 +543,28 @@ export default {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
selectSku(idObj) {
|
selectSku (idObj) {
|
||||||
this.init(idObj.skuId, idObj.goodsId);
|
this.init(idObj.skuId, idObj.goodsId);
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* 初始化信息
|
* 初始化信息
|
||||||
*/
|
*/
|
||||||
async init(id, goodsId, distributionId = "") {
|
async init (id, goodsId, distributionId = "") {
|
||||||
this.isGroup = false; //初始化拼团
|
this.isGroup = false; //初始化拼团
|
||||||
this.productId = id; // skuId
|
this.productId = id; // skuId
|
||||||
// 这里请求获取到页面数据 解析数据
|
// 这里请求获取到页面数据 解析数据
|
||||||
|
|
||||||
let response = await getGoods(id, goodsId);
|
let response = await getGoods(id, goodsId);
|
||||||
|
|
||||||
|
// 判断当前接口返回内容
|
||||||
if (!response.data.success) {
|
if (!response.data.success) {
|
||||||
setTimeout(() => {
|
// 商品已下架
|
||||||
uni.navigateBack();
|
if(response.data.code == 11001){
|
||||||
}, 500);
|
this.takeDownFromSale = true
|
||||||
|
}
|
||||||
|
// setTimeout(() => {
|
||||||
|
// uni.navigateBack();
|
||||||
|
// }, 500);
|
||||||
}
|
}
|
||||||
// 这里是绑定分销员
|
// 这里是绑定分销员
|
||||||
if (distributionId || this.$store.state.distributionId) {
|
if (distributionId || this.$store.state.distributionId) {
|
||||||
@@ -668,10 +587,7 @@ export default {
|
|||||||
if (item.indexOf("PINTUAN") == 0) {
|
if (item.indexOf("PINTUAN") == 0) {
|
||||||
this.isGroup = true;
|
this.isGroup = true;
|
||||||
}
|
}
|
||||||
// 积分
|
|
||||||
if (item.indexOf("POINTS_GOODS") == 0) {
|
|
||||||
this.pointDetail = this.PromotionList[item];
|
|
||||||
}
|
|
||||||
// 秒杀
|
// 秒杀
|
||||||
if (item.indexOf("SECKILL") == 0) {
|
if (item.indexOf("SECKILL") == 0) {
|
||||||
this.isSeckill = true
|
this.isSeckill = true
|
||||||
@@ -700,90 +616,90 @@ export default {
|
|||||||
// this.getIMDetailMethods();
|
// this.getIMDetailMethods();
|
||||||
},
|
},
|
||||||
|
|
||||||
async getIMDetailMethods() {
|
async getIMDetailMethods () {
|
||||||
let res = await getIMDetail();
|
let res = await getIMDetail();
|
||||||
if (res.data.success) {
|
if (res.data.success) {
|
||||||
this.IMLink = res.data.result;
|
this.IMLink = res.data.result;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
linkMsgDetail() {
|
linkMsgDetail () {
|
||||||
// lili 基础客服
|
// lili 基础客服
|
||||||
|
this.$options.filters.talkIm(this.goodsDetail.storeId, this.routerVal.goodsId, this.routerVal.id)
|
||||||
|
// uni.navigateTo({
|
||||||
|
// url: `/pages/mine/im/index?userId=${this.goodsDetail.storeId}&goodsid=${this.routerVal.goodsId}&skuid=${this.routerVal.id}`
|
||||||
|
// });
|
||||||
|
|
||||||
uni.navigateTo({
|
// udesk 代码
|
||||||
url: `/pages/tabbar/home/web-view?IM=${this.storeDetail.storeId}`,
|
// if (this.storeDetail.merchantEuid) {
|
||||||
});
|
// uni.navigateTo({
|
||||||
|
// url: `/pages/tabbar/home/web-view?src=${this.IM}`,
|
||||||
// udesk 代码
|
// });
|
||||||
// if (this.storeDetail.merchantEuid) {
|
// }
|
||||||
// uni.navigateTo({
|
|
||||||
// url: `/pages/tabbar/home/web-view?src=${this.IM}`,
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
|
|
||||||
|
|
||||||
// 客服 云智服代码
|
// 客服 云智服代码
|
||||||
// // #ifdef MP-WEIXIN
|
// // #ifdef MP-WEIXIN
|
||||||
// const params = {
|
// const params = {
|
||||||
// storeName: this.storeDetail.storeName,
|
// storeName: this.storeDetail.storeName,
|
||||||
// goodsName: this.goodsDetail.goodsName,
|
// goodsName: this.goodsDetail.goodsName,
|
||||||
// goodsId: this.goodsDetail.goodsId,
|
// goodsId: this.goodsDetail.goodsId,
|
||||||
// goodsImg: this.goodsDetail.thumbnail,
|
// goodsImg: this.goodsDetail.thumbnail,
|
||||||
// price: this.goodsDetail.promotionPrice || this.goodsDetail.price,
|
// price: this.goodsDetail.promotionPrice || this.goodsDetail.price,
|
||||||
// // originalPrice: this.goodsDetail.original || this.goodsDetail.price,
|
// // originalPrice: this.goodsDetail.original || this.goodsDetail.price,
|
||||||
// uuid: storage.getUuid(),
|
// uuid: storage.getUuid(),
|
||||||
// token: storage.getAccessToken(),
|
// token: storage.getAccessToken(),
|
||||||
// sign: this.storeDetail.yzfSign,
|
// sign: this.storeDetail.yzfSign,
|
||||||
// mpSign: this.storeDetail.yzfMpSign,
|
// mpSign: this.storeDetail.yzfMpSign,
|
||||||
// };
|
// };
|
||||||
// uni.navigateTo({
|
// uni.navigateTo({
|
||||||
// url:
|
// url:
|
||||||
// "/pages/product/customerservice/index?params=" +
|
// "/pages/product/customerservice/index?params=" +
|
||||||
// encodeURIComponent(JSON.stringify(params)),
|
// encodeURIComponent(JSON.stringify(params)),
|
||||||
// });
|
// });
|
||||||
// // #endif
|
// // #endif
|
||||||
// // #ifndef MP-WEIXIN
|
// // #ifndef MP-WEIXIN
|
||||||
// const sign = this.storeDetail.yzfSign;
|
// const sign = this.storeDetail.yzfSign;
|
||||||
// uni.navigateTo({
|
// uni.navigateTo({
|
||||||
// url:
|
// url:
|
||||||
// "/pages/tabbar/home/web-view?src=https://yzf.qq.com/xv/web/static/chat/index.html?sign=" +
|
// "/pages/tabbar/home/web-view?src=https://yzf.qq.com/xv/web/static/chat/index.html?sign=" +
|
||||||
// sign,
|
// sign,
|
||||||
// });
|
// });
|
||||||
// // #endif
|
// // #endif
|
||||||
|
|
||||||
},
|
},
|
||||||
/**选择商品 */
|
/**选择商品 */
|
||||||
changedGoods(val) {
|
changedGoods (val) {
|
||||||
this.selectedGoods = val;
|
this.selectedGoods = val;
|
||||||
},
|
},
|
||||||
|
|
||||||
/** 点击子级地址回调参数*/
|
/** 点击子级地址回调参数*/
|
||||||
deliveryFun(val) {
|
deliveryFun (val) {
|
||||||
this.delivery = val;
|
this.delivery = val;
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* 地址子级关闭回调
|
* 地址子级关闭回调
|
||||||
*/
|
*/
|
||||||
closePopupAddress(val) {
|
closePopupAddress (val) {
|
||||||
this.addressFlag = val;
|
this.addressFlag = val;
|
||||||
// this.maskFlag = false;
|
// this.maskFlag = false;
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* 商品规格子级关闭回调
|
* 商品规格子级关闭回调
|
||||||
*/
|
*/
|
||||||
closePopupBuy(val) {
|
closePopupBuy (val) {
|
||||||
this.buyMask = val;
|
this.buyMask = val;
|
||||||
// this.maskFlag = false;
|
// this.maskFlag = false;
|
||||||
},
|
},
|
||||||
|
|
||||||
/** 参与拼团 创建拼团 */
|
/** 参与拼团 创建拼团 */
|
||||||
toAssembleBuyNow(order) {
|
toAssembleBuyNow (order) {
|
||||||
this.shutMask(4, "PINTUAN", order);
|
this.shutMask(4, "PINTUAN", order);
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* 查看购物车
|
* 查看购物车
|
||||||
*/
|
*/
|
||||||
reluchToCart() {
|
reluchToCart () {
|
||||||
let obj = {
|
let obj = {
|
||||||
from: "product",
|
from: "product",
|
||||||
id: this.productId,
|
id: this.productId,
|
||||||
@@ -797,7 +713,7 @@ export default {
|
|||||||
/**
|
/**
|
||||||
* 查询购物车总数量
|
* 查询购物车总数量
|
||||||
*/
|
*/
|
||||||
cartCount() {
|
cartCount () {
|
||||||
if (storage.getHasLogin()) {
|
if (storage.getHasLogin()) {
|
||||||
API_trade.getCartNum().then((res) => {
|
API_trade.getCartNum().then((res) => {
|
||||||
this.nums = res.data.result;
|
this.nums = res.data.result;
|
||||||
@@ -808,7 +724,7 @@ export default {
|
|||||||
/**
|
/**
|
||||||
* 返回
|
* 返回
|
||||||
*/
|
*/
|
||||||
back() {
|
back () {
|
||||||
if (getCurrentPages().length == 1) {
|
if (getCurrentPages().length == 1) {
|
||||||
uni.switchTab({
|
uni.switchTab({
|
||||||
url: "/pages/tabbar/home/index",
|
url: "/pages/tabbar/home/index",
|
||||||
@@ -821,7 +737,7 @@ export default {
|
|||||||
/**
|
/**
|
||||||
* 获取店铺信息
|
* 获取店铺信息
|
||||||
*/
|
*/
|
||||||
getStoreBaseInfoFun(id) {
|
getStoreBaseInfoFun (id) {
|
||||||
API_store.getStoreBaseInfo(id).then((res) => {
|
API_store.getStoreBaseInfo(id).then((res) => {
|
||||||
if (res.data.success) {
|
if (res.data.success) {
|
||||||
this.storeDetail = res.data.result;
|
this.storeDetail = res.data.result;
|
||||||
@@ -832,7 +748,7 @@ export default {
|
|||||||
/**
|
/**
|
||||||
* 删除收藏店铺
|
* 删除收藏店铺
|
||||||
*/
|
*/
|
||||||
deleteGoodsCollectionFun(id) {
|
deleteGoodsCollectionFun (id) {
|
||||||
API_Members.deleteGoodsCollection(id).then((res) => {
|
API_Members.deleteGoodsCollection(id).then((res) => {
|
||||||
if (res.statusCode == 200) {
|
if (res.statusCode == 200) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
@@ -847,7 +763,7 @@ export default {
|
|||||||
/**
|
/**
|
||||||
* 获取商品是否已被收藏
|
* 获取商品是否已被收藏
|
||||||
*/
|
*/
|
||||||
getGoodsCollectionFun(goodsId) {
|
getGoodsCollectionFun (goodsId) {
|
||||||
if (storage.getHasLogin()) {
|
if (storage.getHasLogin()) {
|
||||||
API_Members.getGoodsIsCollect("GOODS", goodsId).then((res) => {
|
API_Members.getGoodsIsCollect("GOODS", goodsId).then((res) => {
|
||||||
this.favorite = res.data.result;
|
this.favorite = res.data.result;
|
||||||
@@ -858,14 +774,14 @@ export default {
|
|||||||
/**
|
/**
|
||||||
* 获取店铺推荐商品列表
|
* 获取店铺推荐商品列表
|
||||||
*/
|
*/
|
||||||
getStoreRecommend() {
|
getStoreRecommend () {
|
||||||
getGoodsList({
|
getGoodsList({
|
||||||
pageNumber: 1,
|
pageNumber: 1,
|
||||||
pageSize: 6,
|
pageSize: 6,
|
||||||
storeId: this.goodsDetail.storeId,
|
storeId: this.goodsDetail.storeId,
|
||||||
recommend: true,
|
recommend: true,
|
||||||
}).then((res) => {
|
}).then((res) => {
|
||||||
this.recommendList = res.data.result.content;
|
this.recommendList = res.data.result.records;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -873,21 +789,21 @@ export default {
|
|||||||
* 获取相似商品列表
|
* 获取相似商品列表
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
getOtherLikeGoods() {
|
getOtherLikeGoods () {
|
||||||
getGoodsList({
|
getGoodsList({
|
||||||
pageNumber: 1,
|
pageNumber: 1,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
category: this.goodsDetail.categoryId,
|
category: this.goodsDetail.categoryId,
|
||||||
keyword: this.goodsDetail.name,
|
keyword: this.goodsDetail.name,
|
||||||
}).then((res) => {
|
}).then((res) => {
|
||||||
this.likeGoodsList = res.data.result.content;
|
this.likeGoodsList = res.data.result.records;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 领取优惠券
|
* 领取优惠券
|
||||||
*/
|
*/
|
||||||
receiveCouponsFun(id) {
|
receiveCouponsFun (id) {
|
||||||
API_Members.receiveCoupons(id).then((res) => {
|
API_Members.receiveCoupons(id).then((res) => {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: res.data.message,
|
title: res.data.message,
|
||||||
@@ -899,7 +815,7 @@ export default {
|
|||||||
/**
|
/**
|
||||||
* 跳转到店铺页面
|
* 跳转到店铺页面
|
||||||
*/
|
*/
|
||||||
navigateToStore(store_id) {
|
navigateToStore (store_id) {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: `/pages/product/shopPage?id=` + store_id,
|
url: `/pages/product/shopPage?id=` + store_id,
|
||||||
});
|
});
|
||||||
@@ -908,14 +824,14 @@ export default {
|
|||||||
/**
|
/**
|
||||||
* 获取优惠券按钮
|
* 获取优惠券按钮
|
||||||
*/
|
*/
|
||||||
getCoupon(item) {
|
getCoupon (item) {
|
||||||
this.receiveCouponsFun(item.id);
|
this.receiveCouponsFun(item.id);
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 规格弹窗开关
|
* 规格弹窗开关
|
||||||
*/
|
*/
|
||||||
shutMask(flag, buyFlag, type) {
|
shutMask (flag, buyFlag, type) {
|
||||||
this.promotionShow = false;
|
this.promotionShow = false;
|
||||||
this.buyMask = false;
|
this.buyMask = false;
|
||||||
this.addressFlag = false;
|
this.addressFlag = false;
|
||||||
@@ -950,7 +866,7 @@ export default {
|
|||||||
/**
|
/**
|
||||||
* 收藏
|
* 收藏
|
||||||
*/
|
*/
|
||||||
clickFavorite(id) {
|
clickFavorite (id) {
|
||||||
if (this.favorite) {
|
if (this.favorite) {
|
||||||
// 取消收藏
|
// 取消收藏
|
||||||
this.deleteGoodsCollectionFun(id);
|
this.deleteGoodsCollectionFun(id);
|
||||||
@@ -970,7 +886,7 @@ export default {
|
|||||||
/**
|
/**
|
||||||
* 顶部header显示或隐藏
|
* 顶部header显示或隐藏
|
||||||
*/
|
*/
|
||||||
pageScroll(e) {
|
pageScroll (e) {
|
||||||
if (this.scrollFlag) {
|
if (this.scrollFlag) {
|
||||||
this.calcSize();
|
this.calcSize();
|
||||||
}
|
}
|
||||||
@@ -998,7 +914,7 @@ export default {
|
|||||||
/**
|
/**
|
||||||
* 计算每个要跳转到的模块高度信息
|
* 计算每个要跳转到的模块高度信息
|
||||||
*/
|
*/
|
||||||
calcSize() {
|
calcSize () {
|
||||||
let h = 0;
|
let h = 0;
|
||||||
let that = this;
|
let that = this;
|
||||||
let arr = [
|
let arr = [
|
||||||
@@ -1043,7 +959,7 @@ export default {
|
|||||||
/**
|
/**
|
||||||
* 点击顶部跳转到对应位置
|
* 点击顶部跳转到对应位置
|
||||||
*/
|
*/
|
||||||
headerTab(id) {
|
headerTab (id) {
|
||||||
if (this.scrollFlag) {
|
if (this.scrollFlag) {
|
||||||
this.calcSize();
|
this.calcSize();
|
||||||
}
|
}
|
||||||
@@ -1057,7 +973,7 @@ export default {
|
|||||||
/**
|
/**
|
||||||
* 点击分享
|
* 点击分享
|
||||||
*/
|
*/
|
||||||
async shareChange() {
|
async shareChange () {
|
||||||
this.enableShare = true;
|
this.enableShare = true;
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
:use-cache="true"
|
:use-cache="true"
|
||||||
:show-with-animation="true"
|
:show-with-animation="true"
|
||||||
:html="res.mobileIntro"
|
:html="res.mobileIntro"
|
||||||
|
:tag-style="style"
|
||||||
></u-parse>
|
></u-parse>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -64,6 +65,9 @@ export default {
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
goodsDetail: "",
|
goodsDetail: "",
|
||||||
|
style: {
|
||||||
|
img:"display:block"
|
||||||
|
}
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
props: ["res", "goodsId", "goodsParams"],
|
props: ["res", "goodsId", "goodsParams"],
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="recommend-box" >
|
<view class="recommend-box" >
|
||||||
<h4 class="goods-recommend-title">宝贝推荐</h4>
|
<h4 class="goods-recommend-title">热门商品</h4>
|
||||||
<goodsList :res='res' v-if="res" :storeName="false" />
|
<goodsList :res='res' v-if="res" :storeName="false" />
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -1,8 +1,24 @@
|
|||||||
<template>
|
<template>
|
||||||
<!-- 轮播图 -->
|
<!-- 轮播图 -->
|
||||||
<view class="carousel">
|
<view class="carousel">
|
||||||
|
|
||||||
<swiper circular="true" duration="400" @change="swiperChange">
|
<swiper circular="true" duration="400" @change="swiperChange">
|
||||||
|
<swiper-item v-if='video'>
|
||||||
|
<!-- #ifndef APP-PLUS -->
|
||||||
|
<video class="video" show-mute-btn style="width:100%; height:100%;" muted autoplay :src='video' loop
|
||||||
|
object-fit="cover"></video>
|
||||||
|
<!-- #endif -->
|
||||||
|
<!-- #ifdef APP-PLUS -->
|
||||||
|
<view style="width:100%; height:100%;">
|
||||||
|
<!-- <video class="video" show-mute-btn style="width:100%; height:100%;" muted autoplay :src='video' loop
|
||||||
|
object-fit="cover"></video> -->
|
||||||
|
<view v-html="html" style="width:100%; height:100%;"></view>
|
||||||
|
</view>
|
||||||
|
<!-- #endif -->
|
||||||
|
|
||||||
|
</swiper-item>
|
||||||
<swiper-item class="swiper-item" v-for="(item, index) in res" :key="index">
|
<swiper-item class="swiper-item" v-for="(item, index) in res" :key="index">
|
||||||
|
|
||||||
<view class="image-wrapper">
|
<view class="image-wrapper">
|
||||||
<u-image :src="item" mode="aspectFit" class="loaded" width="100%" height="100%">
|
<u-image :src="item" mode="aspectFit" class="loaded" width="100%" height="100%">
|
||||||
<u-loading slot="loading"></u-loading>
|
<u-loading slot="loading"></u-loading>
|
||||||
@@ -10,7 +26,7 @@
|
|||||||
</view>
|
</view>
|
||||||
</swiper-item>
|
</swiper-item>
|
||||||
</swiper>
|
</swiper>
|
||||||
<view class="swiper-dots">{{ current }}/{{ res.length }}</view>
|
<view class="swiper-dots">{{ current }}/{{ video ? res.length + 1 : res.length }}</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
@@ -18,15 +34,24 @@ export default {
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
current: 1,
|
current: 1,
|
||||||
|
html: ""
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
props: ["res"],
|
props: ["res", 'video'],
|
||||||
|
watch: {
|
||||||
|
video(val) {
|
||||||
|
this.html = '<video muted="muted" ref="videoPlay" style="width:100%; height:100%;" src=' + val + ' page-gesture show-mute-btn autoplay webkit-playsinline="" playsinline="" ></video>'
|
||||||
|
}
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
// 轮播图对应的dot
|
// 轮播图对应的dot
|
||||||
swiperChange(e) {
|
swiperChange(e) {
|
||||||
this.current = e.detail.current + 1;
|
this.current = e.detail.current + 1;
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
mounted() {
|
||||||
|
console.log(this.video)
|
||||||
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
@@ -82,4 +107,9 @@ export default {
|
|||||||
/deep/ .image-wrapper image {
|
/deep/ .image-wrapper image {
|
||||||
opacity: 1 !important;
|
opacity: 1 !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.video {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
@@ -62,3 +62,7 @@
|
|||||||
color: #262626;
|
color: #262626;
|
||||||
font-weight: 700;
|
font-weight: 700;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.down-goods{
|
||||||
|
font-size: 50rpx !important;
|
||||||
|
}
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<view v-if="assembleOrder.length != 0">
|
<view v-if="assembleOrder.length != 0">
|
||||||
<view class="group-item" v-for="(order, index) in assembleOrder" :key="index">
|
<view class="group-item" v-for="(order, index) in assembleOrder" :key="index">
|
||||||
<view class="group-item-user">
|
<view class="group-item-user">
|
||||||
<u-image shape="circle" width="40px" height="40px" :src="order.face"></u-image>
|
<u-image shape="circle" width="40px" height="40px" :src="order.face || userImage"></u-image>
|
||||||
<span class="group-item-name">{{ order.nickName | noPassByName }}</span>
|
<span class="group-item-name">{{ order.nickName | noPassByName }}</span>
|
||||||
</view>
|
</view>
|
||||||
<view>
|
<view>
|
||||||
@@ -25,9 +25,13 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import * as API_Promotions from "@/api/promotions";
|
import * as API_Promotions from "@/api/promotions";
|
||||||
|
import configs from '@/config/config'
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
configs,
|
||||||
|
userImage:configs.defaultUserPhoto,
|
||||||
|
|
||||||
customStyle: {
|
customStyle: {
|
||||||
background: this.$lightColor,
|
background: this.$lightColor,
|
||||||
color: "#fff",
|
color: "#fff",
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
<div class="coupon-List-title">
|
<div class="coupon-List-title">
|
||||||
<view v-if="item.scopeType">
|
<view v-if="item.scopeType">
|
||||||
<span v-if="item.scopeType == 'ALL' && item.storeId == '0'">全平台</span>
|
<span v-if="item.scopeType == 'ALL' && item.storeId == '0'">全平台</span>
|
||||||
<span v-if="item.scopeType == 'PORTION_CATEGORY'">仅限品类</span>
|
<span v-if="item.scopeType == 'PORTION_GOODS_CATEGORY'">仅限品类</span>
|
||||||
<view v-else>{{
|
<view v-else>{{
|
||||||
item.storeName == "platform" ? "全平台" : item.storeName + "店铺"
|
item.storeName == "platform" ? "全平台" : item.storeName + "店铺"
|
||||||
}}使用</view>
|
}}使用</view>
|
||||||
|
|||||||
@@ -42,6 +42,20 @@
|
|||||||
<span class="pro-text">限时抢购</span>
|
<span class="pro-text">限时抢购</span>
|
||||||
</div>
|
</div>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
<view v-if="prom.split('-')[0] == 'POINTS_GOODS'">
|
||||||
|
<div class="res_prom_item">
|
||||||
|
<u-tag text="积分活动" type="error"></u-tag>
|
||||||
|
<span class="pro-text">当前商品参与积分活动。<span @click="handClickToJoinPromotion(prom)" class="href">点击此处参与活动</span></span>
|
||||||
|
</div>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view v-if="prom.split('-')[0] == 'KANJIA'">
|
||||||
|
<div class="res_prom_item">
|
||||||
|
<u-tag text="砍价活动" type="error"></u-tag>
|
||||||
|
<span class="pro-text">当前商品参与砍价活动。<span @click="handClickToJoinPromotion(prom)" class="href">点击此处参与活动</span></span>
|
||||||
|
</div>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view v-if="!res">暂无促销活动</view>
|
<view v-if="!res">暂无促销活动</view>
|
||||||
@@ -77,7 +91,21 @@ export default {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
mounted() {},
|
mounted() {},
|
||||||
methods: {},
|
methods: {
|
||||||
|
// 跳转到参与商品活动的详情列表中
|
||||||
|
handClickToJoinPromotion(val){
|
||||||
|
|
||||||
|
const promotion = {
|
||||||
|
"POINTS_GOODS": `/pages/promotion/point/detail?id=${this.res[val].id}`,
|
||||||
|
"KANJIA": `/pages/promotion/bargain/detail?id=${this.res[val].id}`,
|
||||||
|
}
|
||||||
|
|
||||||
|
uni.navigateTo({
|
||||||
|
url:promotion[val.split('-')[0]]
|
||||||
|
})
|
||||||
|
|
||||||
|
}
|
||||||
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
@@ -108,4 +136,7 @@ export default {
|
|||||||
.price_image {
|
.price_image {
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
|
.href{
|
||||||
|
color: $main-color;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -1,143 +1,135 @@
|
|||||||
<template>
|
<template>
|
||||||
<view>
|
<view>
|
||||||
<view
|
<view v-for="(promotionItem, promotionIndex) in promotion" :key="promotionIndex" class="promotion_row" @click="shutMask(1)">
|
||||||
v-for="(promotionItem, promotionIndex) in promotion"
|
<view v-if="res != null" v-for="(item, index) in Object.keys(res)" :key="index">
|
||||||
:key="promotionIndex"
|
<div class="promotion_col" v-if="item.split('-')[0] == promotionItem.value && item.split('-')[0] == 'FULL_DISCOUNT'">
|
||||||
class="promotion_row"
|
<!-- 满减,折扣 -->
|
||||||
@click="shutMask(1)"
|
<div class="flex">
|
||||||
>
|
<view class="deg_tag">{{ promotionItem.title }}</view>
|
||||||
<view v-if="res != null" v-for="(item, index) in Object.keys(res)" :key="index">
|
<div class="text proText">满{{ res[item].fullMoney }}元,立享优惠</div>
|
||||||
<div
|
</div>
|
||||||
class="promotion_col"
|
</div>
|
||||||
v-if="
|
<div class="promotion_col" v-if="item.split('-')[0] == promotionItem.value && item.split('-')[0] == 'PINTUAN'">
|
||||||
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].promotionName }}</div>
|
||||||
<!-- 满减,折扣 -->
|
</div>
|
||||||
<div class="flex">
|
</div>
|
||||||
<view class="deg_tag">{{ promotionItem.title }}</view>
|
<div class="promotion_col" v-if="item.split('-')[0] == promotionItem.value && item.split('-')[0] == 'POINTS_GOODS'">
|
||||||
<div class="text proText">满{{ res[item].fullMoney }}元,立享优惠</div>
|
<!-- 积分活动 -->
|
||||||
</div>
|
<div class="flex">
|
||||||
</div>
|
<view class="deg_tag">{{ promotionItem.title }}</view>
|
||||||
<div
|
<div class="text proText">{{ res[item].promotionName }}</div>
|
||||||
class="promotion_col"
|
</div>
|
||||||
v-if="
|
</div>
|
||||||
item.split('-')[0] == promotionItem.value && item.split('-')[0] == 'PINTUAN'
|
<div class="promotion_col" v-if="item.split('-')[0] == promotionItem.value && item.split('-')[0] == 'KANJIA'">
|
||||||
"
|
<!-- 砍价活动 -->
|
||||||
>
|
<div class="flex">
|
||||||
<!-- 拼团 -->
|
<view class="deg_tag">{{ promotionItem.title }}</view>
|
||||||
<div class="flex">
|
<div class="text proText"></div>
|
||||||
<view class="deg_tag">{{ promotionItem.title }}</view>
|
</div>
|
||||||
<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>
|
<!-- 限时抢购 -->
|
||||||
<div
|
<div class="flex">
|
||||||
class="promotion_col"
|
<view class="deg_tag">{{ promotionItem.title }}</view>
|
||||||
v-if="
|
<div class="text proText">{{ res[item].promotionName }}</div>
|
||||||
item.split('-')[0] == promotionItem.value && item.split('-')[0] == 'SECKILL'
|
</div>
|
||||||
"
|
</div>
|
||||||
>
|
</view>
|
||||||
<!-- 限时抢购 -->
|
|
||||||
<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">
|
||||||
<view>
|
<view>
|
||||||
<div class="promotion_col coupon" v-if="couponList && promotionIndex == 1">
|
<div class="promotion_col coupon" v-if="couponList && promotionIndex == 1">
|
||||||
<!-- 优惠券 -->
|
<!-- 优惠券 -->
|
||||||
|
|
||||||
<div>
|
<div><view class="deg_tag">优惠券</view></div>
|
||||||
<view class="deg_tag">优惠券</view>
|
</div>
|
||||||
</div>
|
</view>
|
||||||
</div>
|
</view>
|
||||||
</view>
|
</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>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import promotion from "./promotion_type";
|
import promotion from './promotion_type';
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
promotion,
|
promotion,
|
||||||
couponList: "",
|
couponList: ''
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
// 父组件传递回来的数据
|
// 父组件传递回来的数据
|
||||||
res: {
|
res: {
|
||||||
type: null,
|
type: null,
|
||||||
default: {},
|
default: {}
|
||||||
},
|
}
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
res: {
|
res: {
|
||||||
handler() {
|
handler() {
|
||||||
if (this.res && this.res.length != 0 && this.res != null) {
|
if (this.res && this.res.length != 0 && this.res != null) {
|
||||||
Object.keys(this.res).forEach((item) => {
|
Object.keys(this.res).forEach(item => {
|
||||||
let key = item.split("-")[0];
|
let key = item.split('-')[0];
|
||||||
this.res[item].__key = key;
|
this.res[item].__key = key;
|
||||||
|
|
||||||
if (item.split("-")[0] == "COUPON") {
|
if (item.split('-')[0] == 'COUPON') {
|
||||||
this.couponList = "COUPON";
|
this.couponList = 'COUPON';
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
immediate: true,
|
immediate: true
|
||||||
},
|
}
|
||||||
},
|
},
|
||||||
mounted() {},
|
mounted() {},
|
||||||
methods: {
|
methods: {
|
||||||
// 此方法条用父级方法
|
// 此方法条用父级方法
|
||||||
shutMask(val) {
|
shutMask(val) {
|
||||||
this.$emit("shutMasks", val);
|
this.$emit('shutMasks', val);
|
||||||
},
|
}
|
||||||
},
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.deg_tag {
|
.deg_tag {
|
||||||
color: $price-color;
|
color: $price-color;
|
||||||
padding: 0 4rpx;
|
padding: 0 4rpx;
|
||||||
border: 2rpx solid $price-color;
|
border: 2rpx solid $price-color;
|
||||||
font-size: 22rpx;
|
font-size: 22rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.promotion_col {
|
.promotion_col {
|
||||||
/**/
|
/**/
|
||||||
// margin: 0 0 17rpx 0;
|
// margin: 0 0 17rpx 0;
|
||||||
|
|
||||||
padding: 0 !important;
|
padding: 0 !important;
|
||||||
|
|
||||||
margin: 10rpx 0;
|
margin: 10rpx 0;
|
||||||
}
|
}
|
||||||
.promotion_row {
|
.promotion_row {
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
}
|
}
|
||||||
.flex {
|
.flex {
|
||||||
display: flex;
|
display: flex;
|
||||||
}
|
}
|
||||||
.proText {
|
.proText {
|
||||||
font-size: 26rpx;
|
font-size: 26rpx;
|
||||||
font-family: PingFang SC, PingFang SC-Regular;
|
font-family: PingFang SC, PingFang SC-Regular;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
text-align: left;
|
text-align: left;
|
||||||
color: #333333;
|
color: #333333;
|
||||||
margin-left: 20rpx;
|
margin-left: 20rpx;
|
||||||
}
|
}
|
||||||
/deep/ .u-mode-light-error {
|
/deep/ .u-mode-light-error {
|
||||||
border: none;
|
border: none;
|
||||||
|
}
|
||||||
|
.coupon{
|
||||||
|
display: flex;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -1,7 +1,11 @@
|
|||||||
const promotion = [
|
const promotion = [
|
||||||
{
|
{
|
||||||
title: "积分活动",
|
title: "积分活动",
|
||||||
value: "POINT",
|
value: "POINTS_GOODS",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "砍价活动",
|
||||||
|
value: "KANJIA",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "单品立减",
|
title: "单品立减",
|
||||||
|
|||||||
@@ -21,18 +21,18 @@
|
|||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="store-recommend">
|
<view class="store-recommend">
|
||||||
<view class="store-recommend-title">商品推荐</view>
|
<view class="store-recommend-title">店内其他商品</view>
|
||||||
<view class="recommend-list">
|
<view class="recommend-list">
|
||||||
<view class="recommend-item" @click="clickGoods(item)" v-for="(item, index) in res" :key="index">
|
<view class="recommend-item" @click="clickGoods(item)" v-for="(item, index) in res" :key="index">
|
||||||
<u-image class="recommend-item-img" :fade="true" duration="450" :lazy-load="true" :src="item.content.thumbnail" height="218rpx">
|
<u-image class="recommend-item-img" :fade="true" duration="450" :lazy-load="true" :src="item.thumbnail" height="218rpx">
|
||||||
<u-loading slot="loading"></u-loading>
|
<u-loading slot="loading"></u-loading>
|
||||||
<view slot="error" style="font-size: 24rpx; ">加载失败</view>
|
<view slot="error" style="font-size: 24rpx; ">加载失败</view>
|
||||||
</u-image>
|
</u-image>
|
||||||
<view class="recommend-item-name">
|
<view class="recommend-item-name">
|
||||||
{{ item.content.goodsName }}
|
{{ item.goodsName }}
|
||||||
</view>
|
</view>
|
||||||
<view class="item-price" v-if="item.price != undefined">
|
<view class="item-price" v-if="item.price != undefined">
|
||||||
¥<span class="item-price-blod">{{ $options.filters.goodsFormatPrice(item.content.price)[0] }}</span>.{{ $options.filters.goodsFormatPrice(item.content.price)[1] }}
|
¥<span class="item-price-blod">{{ $options.filters.goodsFormatPrice(item.price)[0] }}</span>.{{ $options.filters.goodsFormatPrice(item.price)[1] }}
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -51,7 +51,7 @@ export default {
|
|||||||
// 点击商品
|
// 点击商品
|
||||||
clickGoods(val) {
|
clickGoods(val) {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: `/pages/product/goods?id=${val.content.id}&goodsId=${val.content.goodsId}`,
|
url: `/pages/product/goods?id=${val.id}&goodsId=${val.goodsId}`,
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@@ -1,109 +1,212 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<view>
|
||||||
<u-navbar :border-bottom="false">
|
<!-- 楼层装修店铺信息 -->
|
||||||
<u-search v-model="keyword" @custom='search' :show-action="true" action-text="搜索" :animation="true" @search="search" @click="search" placeholder="请输入搜索"></u-search>
|
<div>
|
||||||
</u-navbar>
|
<u-navbar :border-bottom="false">
|
||||||
<div class="wrapper">
|
<u-search
|
||||||
<!-- 店铺信息模块 -->
|
v-model="keyword"
|
||||||
<div class="store flex">
|
@search="search"
|
||||||
<u-image border-radius="10" width="150" height="150" :src="storeInfo.storeLogo || config.logo" mode="aspectFit">
|
@click="search"
|
||||||
</u-image>
|
placeholder="请输入搜索"
|
||||||
<div class="box">
|
></u-search>
|
||||||
<div class="store-name" @click="getStoreLicencePhoto">
|
</u-navbar>
|
||||||
{{ storeInfo.storeName || ''}}
|
<div class="wrapper">
|
||||||
<u-icon style="margin-left:10rpx;" name="arrow-right"></u-icon>
|
<!-- 店铺信息模块 -->
|
||||||
|
<div class="store flex">
|
||||||
|
<u-image
|
||||||
|
border-radius="10"
|
||||||
|
width="150"
|
||||||
|
height="150"
|
||||||
|
:src="storeInfo.storeLogo || config.logo"
|
||||||
|
mode="aspectFit"
|
||||||
|
>
|
||||||
|
</u-image>
|
||||||
|
<div class="box">
|
||||||
|
<div class="store-name" @click="getStoreLicencePhoto">
|
||||||
|
{{ storeInfo.storeName || "" }}
|
||||||
|
<u-icon style="margin-left: 10rpx" name="arrow-right"></u-icon>
|
||||||
|
</div>
|
||||||
|
<div class="flex store-message">
|
||||||
|
<div>
|
||||||
|
<span>{{ storeInfo.collectionNum || 0 }}</span
|
||||||
|
>关注
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<span>{{ storeInfo.goodsNum || 0 }}</span
|
||||||
|
>件商品
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex store-message">
|
<div class="collection">
|
||||||
<div> <span>{{ storeInfo.collectionNum || 0 }}</span>关注 </div>
|
<div class="collection-btn" @click="whetherCollection">
|
||||||
<div> <span>{{ storeInfo.goodsNum || 0 }}</span>件商品 </div>
|
{{ isCollection ? "已关注" : "+ 关注" }}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="collection">
|
<!-- 店铺简介 -->
|
||||||
<div class="collection-btn" @click="whetherCollection"> {{ isCollection ? '已关注' : '+ 关注' }}</div>
|
<div class="store-desc wes-2">
|
||||||
|
{{ storeInfo.storeDesc || '' }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
<!-- 店铺简介 -->
|
|
||||||
<div class="store-desc wes-2">
|
|
||||||
{{storeInfo.storeDesc}}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- 联系客服 -->
|
<!-- 联系客服 -->
|
||||||
<div class="kefu" @click="linkKefuDetail">
|
<div class="kefu" @click="talk">
|
||||||
<u-icon name="kefu-ermai"></u-icon>
|
<u-icon name="kefu-ermai"></u-icon>
|
||||||
联系客服
|
联系客服
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<!-- 优惠券 -->
|
||||||
<!-- 优惠券 -->
|
<scroll-view
|
||||||
<scroll-view scroll-x="true" show-scrollbar="false" class="discount" v-if="couponList.length > 0">
|
scroll-x="true"
|
||||||
<view class="card-box" v-for="(item, index) in couponList" :key="index">
|
show-scrollbar="false"
|
||||||
<view class="card" @click="getCoupon(item)">
|
class="discount"
|
||||||
<view class="money">
|
v-if="couponList.length > 0"
|
||||||
<view>
|
>
|
||||||
<span v-if="item.couponType == 'DISCOUNT'">{{ item.couponDiscount }}折</span>
|
<view class="card-box" v-for="(item, index) in couponList" :key="index">
|
||||||
<span v-else>{{ item.price }}元</span>
|
<view class="card" @click="getCoupon(item)">
|
||||||
|
<view class="money">
|
||||||
|
<view>
|
||||||
|
<span v-if="item.couponType == 'DISCOUNT'"
|
||||||
|
>{{ item.couponDiscount }}折</span
|
||||||
|
>
|
||||||
|
<span v-else>{{ item.price }}元</span>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="xian"></view>
|
||||||
|
<view class="text">
|
||||||
|
<text>{{ "领取优惠券" }}</text>
|
||||||
|
<text>满{{ item.consumeThreshold | unitPrice }}元可用</text>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
</view>
|
|
||||||
<view class="xian"></view>
|
|
||||||
<view class="text">
|
|
||||||
<text>{{'领取优惠券'}}</text>
|
|
||||||
<text>满{{ item.consumeThreshold | unitPrice }}元可用</text>
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</scroll-view>
|
||||||
</scroll-view>
|
|
||||||
|
|
||||||
<!-- tab -->
|
<!-- 基础店铺模式 -->
|
||||||
<u-tabs :list="tabs" :active-color="mainColor" :is-scroll="false" :current="current" @change="changeTab"></u-tabs>
|
<div v-if="basePageData">
|
||||||
<!-- menu -->
|
<u-tabs :list="tabs" :active-color="mainColor" :is-scroll="false" :current="current" @change="changeTab"></u-tabs>
|
||||||
|
<div class="content" v-if="current == 0">
|
||||||
<!-- 商品 -->
|
<u-empty style='margin-top:100rpx' v-if="goodsList.length == 0" class="empty" text='暂无商品信息'></u-empty>
|
||||||
<div class="content" v-if="current == 0">
|
<goodsTemplate v-else :res="goodsList" :storeName="false" />
|
||||||
|
|
||||||
<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">
|
|
||||||
<div class="category-item" v-for="(item,index) in categoryList" :key="index">
|
|
||||||
<div class="flex" @click="getCategoryGoodsList(item)">
|
|
||||||
<div>{{item.labelName}}</div>
|
|
||||||
<div>
|
|
||||||
<u-icon color="#999" name="arrow-right"></u-icon>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
<!-- 分类子级 -->
|
<!-- 全部分类 -->
|
||||||
<div class="child-list" v-if="item.children && item.children.length!=0">
|
<div class="category" v-if="current == 1">
|
||||||
<div class="child" @click="getCategoryGoodsList(child)" :key='i' v-for="(child,i) in item.children">{{child.labelName}}
|
<div class="category-item" v-for="(item,index) in categoryList" :key="index">
|
||||||
|
<div class="flex" @click="getCategoryGoodsList(item)">
|
||||||
|
<div>{{item.labelName}}</div>
|
||||||
|
<div>
|
||||||
|
<u-icon color="#999" name="arrow-right"></u-icon>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- 分类子级 -->
|
||||||
|
<div class="child-list" v-if="item.children && item.children.length!=0">
|
||||||
|
<div class="child" @click="getCategoryGoodsList(child)" :key='i' v-for="(child,i) in item.children">{{child.labelName}}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!-- 楼层装修模式 -->
|
||||||
|
<div v-if="enablePageData">
|
||||||
|
<!-- uni 中不能使用 vue component 所以用if判断每个组件 -->
|
||||||
|
<div v-for="(item, index) in pageData.list" :key="index">
|
||||||
|
<!-- 搜索栏,如果在楼层装修顶部则会自动浮动,否则不浮动 -->
|
||||||
|
<u-navbar
|
||||||
|
class="navbar"
|
||||||
|
v-if="item.type == 'search'"
|
||||||
|
:is-fixed="index === 1 ? false : true"
|
||||||
|
>
|
||||||
|
<div class="navbar-right"></div>
|
||||||
|
|
||||||
|
<search style="width: 100%" :res="item.options" :storeId = "storeId"/>
|
||||||
|
</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"
|
||||||
|
/>
|
||||||
|
<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" />
|
||||||
|
<flexTwo v-if="item.type == 'flexTwo'" :res="item.options" />
|
||||||
|
<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" />
|
||||||
|
|
||||||
|
<group v-if="item.type == 'group'" :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>
|
||||||
|
</div>
|
||||||
|
<u-no-network></u-no-network>
|
||||||
</div>
|
</div>
|
||||||
<u-back-top :scroll-top="scrollTop"></u-back-top>
|
</view>
|
||||||
</div>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { getStoreBaseInfo, getStoreCategory } from "@/api/store.js";
|
// 引用组件
|
||||||
|
import tpl_banner from "@/pages/tabbar/home/template/tpl_banner"; //导航栏模块
|
||||||
|
import tpl_title from "@/pages/tabbar/home/template/tpl_title"; //标题栏模块
|
||||||
|
import tpl_left_one_right_two from "@/pages/tabbar/home/template/tpl_left_one_right_two"; //左一右二模块
|
||||||
|
import tpl_left_two_right_one from "@/pages/tabbar/home/template/tpl_left_two_right_one"; //左二右一模块
|
||||||
|
import tpl_top_one_bottom_two from "@/pages/tabbar/home/template/tpl_top_one_bottom_two"; //上一下二模块
|
||||||
|
import tpl_top_two_bottom_one from "@/pages/tabbar/home/template/tpl_top_two_bottom_one"; //上二下一模块
|
||||||
|
import tpl_flex_one from "@/pages/tabbar/home/template/tpl_flex_one"; //单行图片模块
|
||||||
|
import tpl_flex_two from "@/pages/tabbar/home/template/tpl_flex_two"; //两张横图模块
|
||||||
|
import tpl_flex_three from "@/pages/tabbar/home/template/tpl_flex_three"; //三列单行图片模块
|
||||||
|
import tpl_flex_five from "@/pages/tabbar/home/template/tpl_flex_five"; //五列单行图片模块
|
||||||
|
import tpl_flex_four from "@/pages/tabbar/home/template/tpl_flex_four"; //四列单行图片模块
|
||||||
|
import tpl_text_picture from "@/pages/tabbar/home/template/tpl_text_picture"; //文字图片模板
|
||||||
|
import tpl_menu from "@/pages/tabbar/home/template/tpl_menu"; //五列菜单模块
|
||||||
|
import tpl_search from "@/pages/tabbar/home/template/tpl_search"; //搜索栏
|
||||||
|
import tpl_group from "@/pages/tabbar/home/template/tpl_group"; //
|
||||||
|
import tpl_goods from "@/pages/tabbar/home/template/tpl_goods"; //商品分类以及分类中的商品
|
||||||
import goodsTemplate from '@/components/m-goods-list/list'
|
import goodsTemplate from '@/components/m-goods-list/list'
|
||||||
|
import { getStoreBaseInfo, getStoreCategory } from "@/api/store.js";
|
||||||
import {
|
import {
|
||||||
receiveCoupons,
|
receiveCoupons,
|
||||||
deleteStoreCollection,
|
deleteStoreCollection,
|
||||||
collectionGoods,
|
collectionStore,
|
||||||
getGoodsIsCollect,
|
getStoreIsCollect,
|
||||||
} from "@/api/members.js";
|
} from "@/api/members.js";
|
||||||
import config from "@/config/config";
|
import config from "@/config/config";
|
||||||
import storage from "@/utils/storage";
|
|
||||||
import { getGoodsList } from "@/api/goods.js";
|
import { getGoodsList } from "@/api/goods.js";
|
||||||
import { getAllCoupons } from "@/api/promotions.js";
|
import { getAllCoupons } from "@/api/promotions.js";
|
||||||
|
import { getFloorStoreData } from "@/api/home"; //获取楼层装修接口
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
config,
|
config,
|
||||||
|
pageData: "", //楼层页面数据
|
||||||
|
enablePageData: false, //是否显示楼层装修内容
|
||||||
|
basePageData: false, //基础店铺信息
|
||||||
scrollTop: 0,
|
scrollTop: 0,
|
||||||
mainColor: this.$mainColor, //主色调
|
mainColor: this.$mainColor, //主色调
|
||||||
current: 0, //初始tabs的索引
|
current: 0, //初始tabs的索引
|
||||||
tabs: [{ name: "全部商品" }, { name: "分类查看" }], // 标签
|
tabs: [
|
||||||
|
{
|
||||||
|
name: "全部商品",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "分类查看",
|
||||||
|
},
|
||||||
|
], // 标签
|
||||||
storeId: "",
|
storeId: "",
|
||||||
keyword: "",
|
keyword: "",
|
||||||
storeInfo: {}, //店铺详情
|
storeInfo: {}, //店铺详情
|
||||||
@@ -111,22 +214,58 @@ export default {
|
|||||||
goodsList: [], //推荐货物
|
goodsList: [], //推荐货物
|
||||||
couponList: [], //优惠券列表
|
couponList: [], //优惠券列表
|
||||||
categoryList: [],
|
categoryList: [],
|
||||||
couponParams: { pageNumber: 1, pageSize: 50, storeId: "" },
|
couponParams: {
|
||||||
goodsParams: { pageNumber: 1, pageSize: 10, storeId: "" },
|
pageNumber: 1,
|
||||||
|
pageSize: 50,
|
||||||
|
storeId: "",
|
||||||
|
},
|
||||||
|
goodsParams: {
|
||||||
|
pageNumber: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
storeId: "",
|
||||||
|
},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
components: {
|
||||||
|
carousel: tpl_banner,
|
||||||
|
titleLayout: tpl_title,
|
||||||
|
leftOneRightTwo: tpl_left_one_right_two,
|
||||||
|
leftTwoRightOne: tpl_left_two_right_one,
|
||||||
|
topOneBottomTwo: tpl_top_one_bottom_two,
|
||||||
|
topTwoBottomOne: tpl_top_two_bottom_one,
|
||||||
|
flexThree: tpl_flex_three,
|
||||||
|
flexFive: tpl_flex_five,
|
||||||
|
flexFour: tpl_flex_four,
|
||||||
|
flexTwo: tpl_flex_two,
|
||||||
|
textPicture: tpl_text_picture,
|
||||||
|
menuLayout: tpl_menu,
|
||||||
|
search: tpl_search,
|
||||||
|
flexOne: tpl_flex_one,
|
||||||
|
goods: tpl_goods,
|
||||||
|
group: tpl_group,
|
||||||
|
goodsTemplate
|
||||||
|
// spike: tpl_spike,
|
||||||
|
// joinGroup: tpl_join_group,
|
||||||
|
// integral: tpl_integral,
|
||||||
|
},
|
||||||
watch: {
|
watch: {
|
||||||
current(val) {
|
current(val) {
|
||||||
val == 0 ? ()=>{ this.goodsList = []; this.getGoodsData()} : this.getCategoryData();
|
val == 0
|
||||||
|
? () => {
|
||||||
|
this.goodsList = [];
|
||||||
|
this.getGoodsData();
|
||||||
|
}
|
||||||
|
: this.getCategoryData();
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
components:{goodsTemplate},
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 加载
|
* 加载
|
||||||
*/
|
*/
|
||||||
async onLoad(options) {
|
async onLoad(options) {
|
||||||
this.storeId = options.id;
|
this.storeId = options.id;
|
||||||
|
console.log(this.storeId,'this.storeId')
|
||||||
|
|
||||||
this.goodsParams.storeId = options.id;
|
this.goodsParams.storeId = options.id;
|
||||||
this.couponParams.storeId = options.id;
|
this.couponParams.storeId = options.id;
|
||||||
},
|
},
|
||||||
@@ -139,7 +278,9 @@ export default {
|
|||||||
mounted() {
|
mounted() {
|
||||||
// #ifdef MP-WEIXIN
|
// #ifdef MP-WEIXIN
|
||||||
// 小程序默认分享
|
// 小程序默认分享
|
||||||
uni.showShareMenu({ withShareTicket: true });
|
uni.showShareMenu({
|
||||||
|
withShareTicket: true,
|
||||||
|
});
|
||||||
// #endif
|
// #endif
|
||||||
this.init();
|
this.init();
|
||||||
},
|
},
|
||||||
@@ -151,13 +292,33 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
|
talk(){
|
||||||
|
this.$options.filters.talkIm(this.storeInfo.storeId)
|
||||||
|
},
|
||||||
|
back() {
|
||||||
|
uni.navigateBack();
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 实例化首页数据楼层
|
||||||
|
*/
|
||||||
|
initPageData() {
|
||||||
|
this.pageData = "";
|
||||||
|
getFloorStoreData({
|
||||||
|
pageType: "STORE",
|
||||||
|
num: this.storeId,
|
||||||
|
}).then((res) => {
|
||||||
|
if (res.data.success) {
|
||||||
|
this.pageData = JSON.parse(res.data.result.pageData);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
getStoreLicencePhoto() {
|
getStoreLicencePhoto() {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: `/pages/product/licencePhoto?id=${this.storeId}`,
|
url: `/pages/product/licencePhoto?id=${this.storeId}`,
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* 初始化信息
|
* 初始化信息
|
||||||
*/
|
*/
|
||||||
init() {
|
init() {
|
||||||
this.goodsList = [];
|
this.goodsList = [];
|
||||||
@@ -169,27 +330,25 @@ export default {
|
|||||||
}
|
}
|
||||||
// 店铺信息
|
// 店铺信息
|
||||||
this.getStoreData();
|
this.getStoreData();
|
||||||
// 商品信息
|
|
||||||
this.getGoodsData();
|
|
||||||
// 优惠券信息
|
|
||||||
this.getCouponsData();
|
|
||||||
// 店铺分类
|
|
||||||
this.getCategoryData();
|
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* 联系客服
|
* 联系客服
|
||||||
*/
|
*/
|
||||||
linkKefuDetail() {
|
linkKefuDetail() {
|
||||||
// // 客服
|
// 客服
|
||||||
// // #ifdef MP-WEIXIN
|
// #ifdef MP-WEIXIN
|
||||||
|
|
||||||
// const params = {
|
const params = {
|
||||||
// // originalPrice: this.goodsDetail.original || this.goodsDetail.price,
|
// originalPrice: this.goodsDetail.original || this.goodsDetail.price,
|
||||||
// uuid: storage.getUuid(),
|
uuid: storage.getUuid(),
|
||||||
// token: storage.getAccessToken(),
|
token: storage.getAccessToken(),
|
||||||
// sign: this.storeInfo.yzfSign,
|
sign: this.storeInfo.yzfSign,
|
||||||
// mpSign: this.storeInfo.yzfMpSign,
|
mpSign: this.storeInfo.yzfMpSign,
|
||||||
// };
|
};
|
||||||
|
uni.navigateTo({
|
||||||
|
url:
|
||||||
|
"/pages/mine/im/index"
|
||||||
|
});
|
||||||
// uni.navigateTo({
|
// uni.navigateTo({
|
||||||
// url:
|
// url:
|
||||||
// "/pages/product/customerservice/index?params=" +
|
// "/pages/product/customerservice/index?params=" +
|
||||||
@@ -203,11 +362,7 @@ export default {
|
|||||||
// "/pages/tabbar/home/web-view?src=https://yzf.qq.com/xv/web/static/chat/index.html?sign=" +
|
// "/pages/tabbar/home/web-view?src=https://yzf.qq.com/xv/web/static/chat/index.html?sign=" +
|
||||||
// sign,
|
// sign,
|
||||||
// });
|
// });
|
||||||
// // #endif
|
// #endif
|
||||||
|
|
||||||
uni.navigateTo({
|
|
||||||
url: `/pages/tabbar/home/web-view?IM=${this.storeId}`,
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
|
|
||||||
/** 获取店铺分类 */
|
/** 获取店铺分类 */
|
||||||
@@ -219,7 +374,7 @@ export default {
|
|||||||
},
|
},
|
||||||
/**是否收藏店铺 */
|
/**是否收藏店铺 */
|
||||||
async enableGoodsIsCollect() {
|
async enableGoodsIsCollect() {
|
||||||
let res = await getGoodsIsCollect("STORE", this.storeId);
|
let res = await getStoreIsCollect("STORE", this.storeId);
|
||||||
if (res.data.success) {
|
if (res.data.success) {
|
||||||
this.isCollection = res.data.result;
|
this.isCollection = res.data.result;
|
||||||
}
|
}
|
||||||
@@ -236,7 +391,6 @@ export default {
|
|||||||
* 搜索
|
* 搜索
|
||||||
*/
|
*/
|
||||||
search() {
|
search() {
|
||||||
console.log("点击")
|
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: `/pages/navigation/search/searchPage?storeId=${this.storeId}&keyword=${this.keyword}`,
|
url: `/pages/navigation/search/searchPage?storeId=${this.storeId}&keyword=${this.keyword}`,
|
||||||
});
|
});
|
||||||
@@ -252,17 +406,35 @@ export default {
|
|||||||
*/
|
*/
|
||||||
async getStoreData() {
|
async getStoreData() {
|
||||||
let res = await getStoreBaseInfo(this.storeId);
|
let res = await getStoreBaseInfo(this.storeId);
|
||||||
res.data.success
|
if (res.data.success) {
|
||||||
? (this.storeInfo = res.data.result)
|
this.storeInfo = res.data.result;
|
||||||
: uni.reLaunch({ url: "/" });
|
// 优惠券信息
|
||||||
|
this.getCouponsData();
|
||||||
|
if(res.data.result.pageShow == '1'){
|
||||||
|
// 开启了楼层装修店铺
|
||||||
|
this.initPageData();
|
||||||
|
this.enablePageData = true;
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
// 商品信息
|
||||||
|
this.getGoodsData();
|
||||||
|
// 店铺分类
|
||||||
|
this.getCategoryData();
|
||||||
|
|
||||||
|
this.basePageData = true;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
uni.reLaunch({
|
||||||
|
url: "/",
|
||||||
|
});
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
/** 加载商品 */
|
/** 加载商品 */
|
||||||
async getGoodsData() {
|
async getGoodsData() {
|
||||||
let res = await getGoodsList(this.goodsParams);
|
let res = await getGoodsList(this.goodsParams);
|
||||||
if (res.data.success) {
|
if (res.data.success) {
|
||||||
this.goodsList.push(...res.data.result.content);
|
this.goodsList.push(...res.data.result.records);
|
||||||
console.log(this.goodsList)
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -275,6 +447,8 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 是否收藏
|
* 是否收藏
|
||||||
*/
|
*/
|
||||||
@@ -291,7 +465,7 @@ export default {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
collectionGoods("STORE", this.storeId).then((res) => {
|
collectionStore(this.storeId).then((res) => {
|
||||||
if (res.data.success) {
|
if (res.data.success) {
|
||||||
this.isCollection = true;
|
this.isCollection = true;
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
@@ -337,8 +511,10 @@ export default {
|
|||||||
background: #fff;
|
background: #fff;
|
||||||
padding: 32rpx;
|
padding: 32rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.store {
|
.store {
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|
||||||
> .box {
|
> .box {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
@@ -347,17 +523,21 @@ export default {
|
|||||||
font-size: 24rpx;
|
font-size: 24rpx;
|
||||||
color: #999;
|
color: #999;
|
||||||
flex: 2;
|
flex: 2;
|
||||||
|
|
||||||
> .store-name {
|
> .store-name {
|
||||||
font-size: 34rpx;
|
font-size: 34rpx;
|
||||||
color: #333;
|
color: #333;
|
||||||
letter-spacing: 1rpx;
|
letter-spacing: 1rpx;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
|
|
||||||
> .store-message {
|
> .store-message {
|
||||||
margin-top: 25rpx;
|
margin-top: 25rpx;
|
||||||
|
|
||||||
> div {
|
> div {
|
||||||
font-size: 26rpx;
|
font-size: 26rpx;
|
||||||
margin: 0 5rpx;
|
margin: 0 5rpx;
|
||||||
|
|
||||||
> span {
|
> span {
|
||||||
font-size: 26rpx;
|
font-size: 26rpx;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
@@ -368,6 +548,7 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.collection-btn {
|
.collection-btn {
|
||||||
background: $main-color;
|
background: $main-color;
|
||||||
padding: 6rpx 0;
|
padding: 6rpx 0;
|
||||||
@@ -377,6 +558,7 @@ export default {
|
|||||||
border-radius: 100px;
|
border-radius: 100px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.store-desc {
|
.store-desc {
|
||||||
margin: 40rpx 0 0 0;
|
margin: 40rpx 0 0 0;
|
||||||
color: #999;
|
color: #999;
|
||||||
@@ -384,16 +566,57 @@ export default {
|
|||||||
|
|
||||||
.content {
|
.content {
|
||||||
margin-top: 20rpx;
|
margin-top: 20rpx;
|
||||||
// display: flex;
|
display: flex;
|
||||||
// flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
// justify-content: space-between;
|
justify-content: space-between;
|
||||||
|
|
||||||
> .empty {
|
> .empty {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
margin-top: 40rpx;
|
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;
|
||||||
|
height: 80rpx;
|
||||||
|
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 {
|
.discount {
|
||||||
height: 154rpx;
|
height: 154rpx;
|
||||||
border-top: 1px solid #f6f6f6;
|
border-top: 1px solid #f6f6f6;
|
||||||
@@ -401,10 +624,12 @@ export default {
|
|||||||
background: #f6f6f6;
|
background: #f6f6f6;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
|
|
||||||
.card-box {
|
.card-box {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
padding-top: 25rpx;
|
padding-top: 25rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.card {
|
.card {
|
||||||
width: 324rpx;
|
width: 324rpx;
|
||||||
height: 116rpx;
|
height: 116rpx;
|
||||||
@@ -413,19 +638,23 @@ export default {
|
|||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|
||||||
.money {
|
.money {
|
||||||
width: 45%;
|
width: 45%;
|
||||||
color: #fd6466;
|
color: #fd6466;
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
|
||||||
text {
|
text {
|
||||||
font-size: 50rpx;
|
font-size: 50rpx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.xian {
|
.xian {
|
||||||
height: 66rpx;
|
height: 66rpx;
|
||||||
border: 1px dashed #f6f6f6;
|
border: 1px dashed #f6f6f6;
|
||||||
position: relative;
|
position: relative;
|
||||||
|
|
||||||
&:before,
|
&:before,
|
||||||
&:after {
|
&:after {
|
||||||
content: "";
|
content: "";
|
||||||
@@ -434,17 +663,20 @@ export default {
|
|||||||
position: absolute;
|
position: absolute;
|
||||||
background: #f6f6f6;
|
background: #f6f6f6;
|
||||||
}
|
}
|
||||||
|
|
||||||
&:before {
|
&:before {
|
||||||
border-radius: 0 0 22rpx 22rpx;
|
border-radius: 0 0 22rpx 22rpx;
|
||||||
top: -30rpx;
|
top: -30rpx;
|
||||||
left: -10rpx;
|
left: -10rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
&:after {
|
&:after {
|
||||||
border-radius: 22rpx 22rpx 0 0;
|
border-radius: 22rpx 22rpx 0 0;
|
||||||
bottom: -30rpx;
|
bottom: -30rpx;
|
||||||
left: -10rpx;
|
left: -10rpx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.text {
|
.text {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
color: $aider-light-color;
|
color: $aider-light-color;
|
||||||
@@ -452,27 +684,33 @@ export default {
|
|||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
margin-left: 14rpx;
|
margin-left: 14rpx;
|
||||||
|
|
||||||
text:nth-of-type(2) {
|
text:nth-of-type(2) {
|
||||||
color: #ccc;
|
color: #ccc;
|
||||||
}
|
}
|
||||||
|
|
||||||
.cur:nth-of-type(1) {
|
.cur:nth-of-type(1) {
|
||||||
color: #ccc;
|
color: #ccc;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.category-item {
|
.category-item {
|
||||||
background: #fff;
|
background: #fff;
|
||||||
padding: 22rpx;
|
padding: 22rpx;
|
||||||
margin: 20rpx 10rpx;
|
margin: 20rpx 10rpx;
|
||||||
|
|
||||||
> .flex {
|
> .flex {
|
||||||
color: #666;
|
color: #666;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
}
|
}
|
||||||
|
|
||||||
> .child-list {
|
> .child-list {
|
||||||
display: flex;
|
display: flex;
|
||||||
margin: 20rpx 0;
|
margin: 20rpx 0;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
|
|
||||||
> .child {
|
> .child {
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
margin: 1% 0;
|
margin: 1% 0;
|
||||||
@@ -489,6 +727,7 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.kefu {
|
.kefu {
|
||||||
background: #f7f7f7;
|
background: #f7f7f7;
|
||||||
height: 70rpx;
|
height: 70rpx;
|
||||||
|
|||||||
@@ -3,8 +3,8 @@
|
|||||||
<u-navbar :title="title"></u-navbar>
|
<u-navbar :title="title"></u-navbar>
|
||||||
<!-- 商品 -->
|
<!-- 商品 -->
|
||||||
<div class="contant">
|
<div class="contant">
|
||||||
<view v-if="!goodsList.length" class="empty">暂无商品信息</view>
|
<view v-if="!goodsList.length" class="empty">暂无商品信息</view>
|
||||||
<goodsTemplate :res='goodsList' :storeName='false' />
|
<goodsTemplate style="width: 100%;" :res='goodsList' :storeName='false' />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -53,7 +53,7 @@
|
|||||||
// #TODO
|
// #TODO
|
||||||
let goodsList = await getGoodsList(this.params);
|
let goodsList = await getGoodsList(this.params);
|
||||||
if (goodsList.data.success) {
|
if (goodsList.data.success) {
|
||||||
this.goodsList.push(...goodsList.data.result.content);
|
this.goodsList.push(...goodsList.data.result.records);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -74,7 +74,7 @@
|
|||||||
<div class="bargain">
|
<div class="bargain">
|
||||||
<div class="bargain-title">商品详情</div>
|
<div class="bargain-title">商品详情</div>
|
||||||
<view class="u-content">
|
<view class="u-content">
|
||||||
<u-parse :html="bargainDetail.mobileIntro"></u-parse>
|
<u-parse :html="bargainDetail.mobileIntro" :tag-style="style"></u-parse>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
@@ -128,6 +128,9 @@ export default {
|
|||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
style: {
|
||||||
|
img:"display:block"
|
||||||
|
},
|
||||||
background: {
|
background: {
|
||||||
backgroundColor: "transparent",
|
backgroundColor: "transparent",
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="page">
|
<div class="page">
|
||||||
<u-navbar :border-bottom="false" title=""></u-navbar>
|
<u-navbar :border-bottom="false" title="积分商品"></u-navbar>
|
||||||
|
|
||||||
<div class="wrapper">
|
<div class="wrapper">
|
||||||
<!-- 积分商品列表 -->
|
<!-- 积分商品列表 -->
|
||||||
@@ -37,7 +37,7 @@
|
|||||||
<div class="bargain">
|
<div class="bargain">
|
||||||
<div class="row-title">商品详情</div>
|
<div class="row-title">商品详情</div>
|
||||||
<view class="u-content">
|
<view class="u-content">
|
||||||
<u-parse :html="goodsData.mobileIntro"></u-parse>
|
<u-parse :html="goodsData.mobileIntro" :tag-style="style"></u-parse>
|
||||||
</view>
|
</view>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -59,6 +59,9 @@ export default {
|
|||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
style: {
|
||||||
|
img:"display:block"
|
||||||
|
},
|
||||||
maskFlag: false, //商品弹框
|
maskFlag: false, //商品弹框
|
||||||
lightColor: this.$lightColor,
|
lightColor: this.$lightColor,
|
||||||
goodsData: {}, //积分商品中商品详情
|
goodsData: {}, //积分商品中商品详情
|
||||||
|
|||||||
@@ -19,7 +19,7 @@
|
|||||||
<view class="index-items">
|
<view class="index-items">
|
||||||
<view class="index-item" v-for="(item, key) in nav.goods" :key="key" @click="toGoods(item)">
|
<view class="index-item" v-for="(item, key) in nav.goods" :key="key" @click="toGoods(item)">
|
||||||
<view class="index-item-img">
|
<view class="index-item-img">
|
||||||
<u-image :src="item.thumbnail" mode="aspectFill">
|
<u-image :src="item.thumbnail" mode="aspectFit">
|
||||||
<u-loading slot="loading"></u-loading>
|
<u-loading slot="loading"></u-loading>
|
||||||
</u-image>
|
</u-image>
|
||||||
<view class="index-item-title">{{ item.goodsName }}</view>
|
<view class="index-item-title">{{ item.goodsName }}</view>
|
||||||
|
|||||||
@@ -124,21 +124,6 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
|
||||||
* 跳转到商品详情
|
|
||||||
*/
|
|
||||||
navigateToGoodsDetail(item) {
|
|
||||||
if (
|
|
||||||
item.sold_num === item.quantity ||
|
|
||||||
this.timeLine[this.nav].distanceStartTime !== 0
|
|
||||||
) {
|
|
||||||
return;
|
|
||||||
} else {
|
|
||||||
uni.navigateTo({
|
|
||||||
url: `/pages/product/goods?id=${item.skuId}&goodsId=${item.goodsId}`,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 单击导航时间
|
* 单击导航时间
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user