140 Commits

Author SHA1 Message Date
chc
9b5e2ec7f0 显示价格修改 2022-10-20 10:03:58 +08:00
chc
adf4e106d8 销售模式判断 2022-10-19 14:42:37 +08:00
学习很差啦
d01edbdfe2 feat: 楼层装修新增绑定分类功能 2022-10-19 11:56:42 +08:00
学习很差啦
f08d166c86 fix: 🐛 修改在关于我们等页面展示问题 2022-10-17 15:28:31 +08:00
学习很差啦
b8c61fdabd Merge branch 'master' of https://gitee.com/beijing_hongye_huicheng/lilishop-uniapp 2022-10-17 14:27:27 +08:00
学习很差啦
6b3b61acb5 fix: 🐛 修复搜索页面展开历史的bug 2022-10-17 14:27:24 +08:00
1a6951b717 Merge branch 'master' of https://gitee.com/beijing_hongye_huicheng/lilishop-uniapp 2022-10-13 15:37:06 +08:00
165df678b3 微信登陆不跳转 2022-10-13 15:36:59 +08:00
学习很差啦
2abbee0a49 Merge branch 'master' of https://gitee.com/beijing_hongye_huicheng/lilishop-uniapp 2022-10-13 14:27:37 +08:00
学习很差啦
a6883fe607 fix: 🐛 修复在ios中使用手势回退会导致在我的订单页面回退按钮丢失bug 2022-10-13 14:27:34 +08:00
夜良king
6ee0abd150 站内信 入口 2022-10-11 19:09:22 +08:00
夜良king
68e927c6f4 Merge branch 'master' of https://gitee.com/beijing_hongye_huicheng/lilishop-uniapp 2022-10-11 18:27:54 +08:00
夜良king
1776f43425 站内信 app端 2022-10-11 18:27:42 +08:00
学习很差啦
fc8123c194 feat: 🎨 新增专题功能 2022-10-11 17:36:40 +08:00
学习很差啦
34448b8a23 merge code 2022-10-10 18:56:56 +08:00
学习很差啦
7179ca41de feat: 🎨 在config中新增5个便捷功能选项,更加简单便捷配置以及使用代码。优化部分冗余的代码 2022-10-10 18:53:14 +08:00
lemon橪
3c7d940ba8 fix: 🐛 提交parseInt导致的bug 2022-10-03 12:47:03 +08:00
学习很差啦
1225a41de4 fix: 🐛 修改格式化金额可能会出现的问题 2022-09-30 18:36:21 +08:00
学习很差啦
d101cd1b6a 修改之前封装方法出错导致出现的bug 2022-09-30 16:29:16 +08:00
学习很差啦
4851487ecd Merge branch 'master' of https://gitee.com/beijing_hongye_huicheng/lilishop-uniapp 2022-09-30 09:58:10 +08:00
学习很差啦
eb0faad7ec refactor: 🐛 优化部分代码逻辑 2022-09-30 09:58:08 +08:00
lemon橪
524666f6e4 fix: 🐛 首次进入订单不刷新数据bug 2022-09-28 17:24:51 +08:00
lemon橪
e9da67dcce 修改砍价跳转问题 2022-09-27 12:40:30 +08:00
学习很差啦
aa8fc523df !4 1.在我的界面增加我的消息链接到IM消息
更新@Neo0820提交的pr
2022-09-23 07:35:17 +00:00
学习很差啦
63570a923b Merge branch 'master' of https://gitee.com/beijing_hongye_huicheng/lilishop-uniapp 2022-09-23 15:10:28 +08:00
学习很差啦
638e82dd28 feat: 🎨 合并其他分支代码 2022-09-23 15:10:25 +08:00
学习很差啦
68dc960232 style: 💄 优化商品购买时商品数量显示问题 以及修改地址跳转问题 2022-09-23 15:05:19 +08:00
neo0820
bbbe25e339 1.在我的界面增加我的消息链接到IM消息
1.在我的界面增加我的消息链接到IM消息
2.调整了一下我的界面菜单的排序
3.顶部点击用户进去的personMsg增加一个退出登录的按钮
2022-09-23 09:00:41 +08:00
lemon橪
d8cca8b372 feat: 基于 @xiaochangbai 老哥的代码进行了一点样式优化
看到老哥有引入其他的qr插件,在项目里面本身自带了一个,稍微改了一下部分样式

https://gitee.com/beijing_hongye_huicheng/lilishop-uniapp/pulls/3
2022-09-16 16:39:32 +08:00
lemon橪
1e9df74034 perf: 🎨 改善促销部分荣誉代码 封装为组件使用 更加便捷以及好看。 优化部分页面显示问题
删除部分原有的老样式  更新新版促销样式 页面更加好看 删除冗余代码 封装多种方法以及组件
2022-09-15 15:40:50 +08:00
学习很差啦
8c8522c68e temp commit 2022-09-14 10:53:19 +08:00
学习很差啦
5afc5477a9 Merge branch 'master' of https://gitee.com/beijing_hongye_huicheng/lilishop-uniapp into test-lmr 2022-09-14 10:51:18 +08:00
学习很差啦
a6e48813cd Merge branch 'master' of https://gitee.com/beijing_hongye_huicheng/lilishop-uniapp 2022-09-14 10:50:11 +08:00
学习很差啦
a1a286dfb6 temp commit 2022-09-14 10:48:30 +08:00
学习很差啦
132c64f438 提交app版本重复升级bug 2022-09-14 10:48:12 +08:00
学习很差啦
8e0bde3428 优化小程序分享 2022-09-14 10:48:12 +08:00
学习很差啦
d9ac9eb2eb 优化部分代码 2022-09-14 10:48:12 +08:00
paulGao
6ccdeba85e 增加热区功能 2022-09-14 10:47:52 +08:00
lemon橪
bbf0f39d69 优化分享链接多次提示问题,优化店铺点击搜索bug,优化登录页面在h5部分手机显示第三方登录样式问题 2022-09-14 10:47:52 +08:00
lemon橪
109af44c6b 高亮搜索热词,修改分销部分字段 2022-09-14 10:47:52 +08:00
lemon橪
bc9c012bb2 修改微信h5中充值会出现零钱充值的问题 2022-09-14 10:47:52 +08:00
paulGao
ba02c6ca7d 优化某些情况下登录权限问题 2022-09-14 10:47:52 +08:00
lemon橪
b840a0adf1 修改意见反馈以及修改密码发现的bug 2022-09-14 10:47:52 +08:00
Chopper711
5cb2f6ad91 update README.md. 2022-09-14 10:47:52 +08:00
fengtianyangyang
36a7a80814 获取物流列表失败 2022-09-14 10:47:52 +08:00
lemon橪
17299d00e1 解决在app中断网没有及时更新首页的问题 2022-09-14 10:47:52 +08:00
paulGao
a56ea2d456 适配优化的sql,将平台id改为0 2022-09-14 10:47:52 +08:00
paulGao
3a705cce8e 适配优化的sql,将平台id改为0 2022-09-14 10:47:39 +08:00
lemon橪
5550285531 修改零钱反复充值bug 2022-09-14 10:46:53 +08:00
lemon橪
0ba7644862 提交楼层跳转sku字段替换为 id字段 2022-09-14 10:46:53 +08:00
lemon橪
0e169bd116 修改已发现的问题 2022-09-14 10:46:53 +08:00
lemon橪
4b9515b21a 修复店铺联系客服跳转问题 2022-09-14 10:43:59 +08:00
lemon橪
3f0e34b715 修改商品详情中发现的展示问题 2022-09-14 10:43:59 +08:00
lemon橪
a393910c0a 补全提交 2022-09-14 10:43:59 +08:00
lemon橪
213f4b8408 优化批发商品展示样式 2022-09-14 10:43:59 +08:00
lemon橪
8cb01d0ba8 优化领劵中心的逻辑以及页面 2022-09-14 10:43:59 +08:00
lemon橪
d8c46b49d9 解决小程序中 修改密码样式问题 2022-09-14 10:43:59 +08:00
lemon橪
73e4ba9994 封装商品展示模块,全局统一管理格式,将旧版商品展示部分优化。 2022-09-14 10:43:59 +08:00
lemon橪
3aa5b21d49 优化商品搜索 空数据显示 2022-09-14 10:43:59 +08:00
Chopper
f90807ebc6 token刷新问题 2022-09-14 10:43:59 +08:00
paulGao
a555009ac9 Merge branch 'master' of gitee.com:beijing_hongye_huicheng/lilishop-uniapp 2022-09-06 19:46:47 +08:00
paulGao
af21d1abba 增加热区功能 2022-09-06 19:46:00 +08:00
学习很差啦
dcf77ba862 提交app版本重复升级bug 2022-09-06 16:25:53 +08:00
学习很差啦
f281011a47 优化小程序分享 2022-08-25 18:25:45 +08:00
学习很差啦
6bb8ca73d3 优化部分代码 2022-08-25 12:46:52 +08:00
学习很差啦
a070edc1c2 部分细节处理 2022-08-10 18:28:06 +08:00
学习很差啦
09485747a6 [仅供测试]重写navigateTo方法,解决微信小程序中超过10个页面栈时会出现的bug 2022-07-20 18:24:49 +08:00
lemon橪
cbd73ae638 优化分享链接多次提示问题,优化店铺点击搜索bug,优化登录页面在h5部分手机显示第三方登录样式问题 2022-07-14 14:20:15 +08:00
lemon橪
1aeec348eb 高亮搜索热词,修改分销部分字段 2022-07-08 17:43:04 +08:00
lemon橪
ea8e783909 修改微信h5中充值会出现零钱充值的问题 2022-07-08 11:26:10 +08:00
lemon橪
e06338dd2e 修改意见反馈和修改密码发现的bug 2022-07-06 18:34:05 +08:00
lemon橪
d6fffc43e4 修改意见反馈以及修改密码发现的bug 2022-07-06 18:32:53 +08:00
paulGao
7633f84385 优化某些情况下登录权限问题 2022-07-06 16:22:46 +08:00
lemon橪
93fc20c825 Merge branch 'master' of https://gitee.com/beijing_hongye_huicheng/lilishop-uniapp 2022-06-24 16:59:08 +08:00
lemon橪
ca32c11296 解决在app中断网没有及时更新首页的问题 2022-06-24 16:59:04 +08:00
Chopper711
d2b8d2238a update README.md. 2022-06-23 01:46:16 +00:00
fengtianyangyang
04ea9c39e1 获取物流列表失败 2022-06-17 17:24:00 +08:00
lemon橪
905e965917 Merge branch 'master' of https://gitee.com/beijing_hongye_huicheng/lilishop-uniapp 2022-06-15 10:09:42 +08:00
lemon橪
1ada23584d 修改零钱反复充值bug 2022-06-15 10:09:40 +08:00
paulGao
1456fd9076 适配优化的sql,将平台id改为0 2022-06-08 16:10:43 +08:00
paulGao
941dd6015d Merge branch 'master' of gitee.com:beijing_hongye_huicheng/lilishop-uniapp 2022-06-08 16:09:52 +08:00
paulGao
b1f320f361 适配优化的sql,将平台id改为0 2022-06-08 16:08:58 +08:00
lemon橪
63e3718178 提交楼层跳转sku字段替换为 id字段 2022-06-07 15:34:09 +08:00
Chopper
9bfa30f849 Merge branch 'master' of gitee.com:beijing_hongye_huicheng/lilishop-uniapp
# Conflicts:
#	App.vue
2022-06-06 10:23:58 +08:00
Chopper
bb24b27963 token刷新问题 2022-06-06 10:23:33 +08:00
lemon橪
403d93831f 修改已发现的问题 2022-06-02 19:09:57 +08:00
lemon橪
9a149eb673 修复店铺联系客服跳转问题 2022-06-01 17:28:46 +08:00
lemon橪
470995c13d 修改商品详情中发现的展示问题 2022-06-01 11:30:23 +08:00
lemon橪
ddcd03f096 补全提交 2022-06-01 11:02:25 +08:00
lemon橪
b8fe2aacf1 优化批发商品展示样式 2022-06-01 10:58:54 +08:00
lemon橪
3c9f0d3c5c 优化领劵中心的逻辑以及页面 2022-05-31 15:42:21 +08:00
lemon橪
ded0ab5381 解决小程序中 修改密码样式问题 2022-05-31 12:06:30 +08:00
lemon橪
42d20f0fd9 封装商品展示模块,全局统一管理格式,将旧版商品展示部分优化。 2022-05-30 16:37:50 +08:00
lemon橪
0e8ace560b 批发商品展示 2022-05-27 18:18:02 +08:00
lemon橪
6e04a5d3da 批发商品展示 2022-05-27 18:17:23 +08:00
lemon橪
a3d8a8037f 优化商品搜索 空数据显示 2022-05-27 15:45:37 +08:00
lemon橪
1dc42e1333 提交批量购买样式 2022-05-27 10:32:08 +08:00
lemon橪
68cdcd8587 优化我的足迹 2022-05-19 09:31:32 +08:00
lemon橪
ebf0d585fc 解决订单发现的问题 2022-05-18 15:30:17 +08:00
lemon橪
75365c428d 合并提交 2022-05-10 12:08:45 +08:00
lemon橪
3e30f5e18f 修复我的足迹分页bug 2022-05-10 12:06:28 +08:00
yeliang-king
e8d3b3decb Merge branch 'master' of https://gitee.com/beijing_hongye_huicheng/lilishop-uniapp 2022-05-09 09:36:16 +08:00
yeliang-king
5dcb364469 账号密码登录 和 获取权限问题 2022-05-09 09:36:02 +08:00
yeliang-king
df9530e48f 账号 密码登录 与 获取权限问题 2022-05-09 09:34:49 +08:00
lemon橪
240a27a61a Merge branch 'master' of https://gitee.com/beijing_hongye_huicheng/lilishop-uniapp 2022-05-05 15:11:50 +08:00
lemon橪
a6a8a5d583 提交修改购物车bug 2022-05-05 15:11:45 +08:00
ran
a9046aded4 优化我的足迹部分代码 2022-05-03 10:12:01 +08:00
ran
6f60cc6afb 补充提交 2022-04-29 12:10:19 +08:00
ran
6e5470e20c Merge branch 'master' of https://gitee.com/beijing_hongye_huicheng/lilishop-uniapp 2022-04-29 12:07:37 +08:00
ran
dc04b4220f 修复购物车添加促销商品出现的Bug 2022-04-29 12:07:30 +08:00
lemon橪
b1cfdef41c app更新判断问题 2022-04-26 17:21:03 +08:00
lemon橪
06e609613e Merge branch 'master' of https://gitee.com/beijing_hongye_huicheng/lilishop-uniapp 2022-04-26 15:17:04 +08:00
lemon橪
8e66c24ff9 修改售后管理页面 样式以及小程序中不显示问题,新增订单判断 修改直播部分判断 2022-04-26 15:17:00 +08:00
yeliang-king
b4e2761b1f app 弹框协议等 2022-04-24 22:41:00 +08:00
paulGao
884d3e8c34 修复结算页只存在无效商品的店铺,显示空白店铺信息问题 2022-04-22 16:32:33 +08:00
paulGao
53739d24df 修复楼层装修标题组件小标题跳转问题 2022-04-21 16:53:53 +08:00
paulGao
f59a76d9a0 修复结算页面显示失效商品问题 2022-04-21 16:06:53 +08:00
paulGao
6cd36b19b2 Merge branch 'master' of gitee.com:beijing_hongye_huicheng/lilishop-uniapp 2022-04-21 14:58:36 +08:00
paulGao
b22ad88f37 优化移动端楼层装修 2022-04-21 14:58:18 +08:00
lemon橪
f87ec18669 删除云智服 2022-04-21 11:58:34 +08:00
lemon橪
64686e165f 修改我的订单多次请求bug 2022-04-21 11:50:13 +08:00
lemon橪
055bad9ca9 Merge branch 'master' of https://gitee.com/beijing_hongye_huicheng/lilishop-uniapp 2022-04-19 14:09:00 +08:00
lemon橪
c6e04bc4b9 修改优惠券显示有问题 2022-04-19 14:08:57 +08:00
Chopper
b6782df565 Merge branch 'master' of gitee.com:beijing_hongye_huicheng/lilishop-uniapp 2022-04-19 10:40:51 +08:00
Chopper
2b4cb2cc88 积分命名展示问题处理 2022-04-19 10:40:46 +08:00
paulGao
14d12d90e3 优化楼层装修 2022-04-18 09:51:00 +08:00
paulGao
4ed3832a5f 增加根据更新时间排序足迹 2022-04-08 16:28:14 +08:00
lemon橪
b0714ab27e Merge branch 'master' of https://gitee.com/beijing_hongye_huicheng/lilishop-uniapp 2022-04-02 18:32:04 +08:00
lemon橪
201ee840d5 提交im 优化app 中余额支付 2022-04-02 18:32:01 +08:00
paulGao
79f737404e 优化订单刷新 2022-03-31 15:23:31 +08:00
paulGao
0b649e3f5b 修复app更新接口错误问题 2022-03-24 16:02:31 +08:00
lemon橪
c756223363 修改刷新token问题 2022-03-23 20:03:06 +08:00
lemon橪
ea60742d82 修改部分bug 2022-03-10 17:15:59 +08:00
lemon橪
2ce90ba008 Merge branch 'master' of https://gitee.com/beijing_hongye_huicheng/lilishop-uniapp 2022-02-28 21:12:02 +08:00
lemon橪
63211457e4 修改登录可能会出现的bug 2022-02-28 21:12:00 +08:00
夜良king
67f014d74a 更新微信订阅 2022-02-28 15:18:18 +08:00
lemon橪
08fffade74 适配api 2022-02-14 18:33:23 +08:00
lemon橪
c8adb52660 修改接口地址 2022-02-14 18:23:00 +08:00
paulGao
4f74502951 connect 2022-02-14 18:16:48 +08:00
paulGao
4a5a4c19a5 修改第三方登录 2022-02-14 18:09:51 +08:00
102 changed files with 6886 additions and 4624 deletions

1
.gitignore vendored
View File

@@ -1,6 +1,7 @@
# OSX # OSX
# #
.DS_Store .DS_Store
node_modules/
#Intellij idea #Intellij idea
.idea/ .idea/

442
App.vue
View File

@@ -1,221 +1,259 @@
<script> <script>
/** /**
* vuex管理登录状态具体可以参考官方登录模板示例 * vuex管理登录状态具体可以参考官方登录模板示例
*/ */
import { mapMutations } from "vuex"; import {
import APPUpdate from "@/plugins/APPUpdate"; mapMutations
import { getClipboardData } from "@/js_sdk/h5-copy/h5-copy.js"; } from "vuex";
import config from "@/config/config"; import APPUpdate from "@/plugins/APPUpdate";
// 悬浮球 import {
getClipboardData
} from "@/js_sdk/h5-copy/h5-copy.js";
import config from "@/config/config";
import storage from "@/utils/storage";
export default {
data() {
return { /**
config, * 路由监听并删除路由
}; * https://developers.weixin.qq.com/miniprogram/dev/api/route/wx.navigateTo.html
}, * */
// #ifdef MP-WEIXIN
wx.onAppRoute((res) => {
const pages = getCurrentPages();
console.log("pages:" + pages.length,pages);
if (pages.length > 3) {
delete getCurrentPages()[2]
}
console.log('路由监听', {
res
})
})
// #endif
/** export default {
* 监听返回 data() {
*/ return {
onBackPress(e) { config,
if (e.from == "backbutton") { };
let routes = getCurrentPages(); },
let curRoute = routes[routes.length - 1].options;
routes.forEach((item) => {
if (
item.route == "pages/tabbar/cart/cartList" ||
item.route.indexOf("pages/product/goods") != -1
) {
uni.redirectTo({
url: item.route,
});
}
});
if (curRoute.addId) {
uni.reLaunch({
url: "/pages/tabbar/cart/cartList",
});
} else {
uni.navigateBack();
}
return true; //阻止默认返回行为
}
},
methods: {
...mapMutations(["login"]),
},
onLaunch: function () {
// #ifdef APP-PLUS
this.checkArguments(); // 检测启动参数
APPUpdate();
// 重点是以下: 一定要监听后台恢复 !一定要 /**
plus.globalEvent.addEventListener("newintent", (e) => { * 监听返回
this.checkArguments(); // 检测启动参数 */
}); onBackPress(e) {
// #endif if (e.from == "backbutton") {
let routes = getCurrentPages();
let curRoute = routes[routes.length - 1].options;
routes.forEach((item) => {
if (
item.route == "pages/tabbar/cart/cartList" ||
item.route.indexOf("pages/product/goods") != -1
) {
uni.redirectTo({
url: item.route,
});
}
});
// #ifdef MP-WEIXIN if (curRoute.addId) {
this.applyUpdateWeChat(); uni.reLaunch({
// #endif url: "/pages/tabbar/cart/cartList",
}, });
} else {
uni.navigateBack();
}
return true; //阻止默认返回行为
}
},
methods: {
...mapMutations(["login"]),
},
onLaunch: function() {
// #ifdef APP-PLUS
this.checkArguments(); // 检测启动参数
APPUpdate();
onShow() { // 重点是以下: 一定要监听后台恢复 !一定要
// #ifndef H5 plus.globalEvent.addEventListener("newintent", (e) => {
this.getClipboard(); this.checkArguments(); // 检测启动参数
// #endif });
}, // #endif
methods: {
/**
* 微信小程序版本提交更新版本 解决缓存问题
*/
applyUpdateWeChat() {
const updateManager = uni.getUpdateManager();
updateManager.onCheckForUpdate(function (res) { // #ifdef MP-WEIXIN
// 请求完新版本信息的回调 this.applyUpdateWeChat();
}); // #endif
},
updateManager.onUpdateReady(function (res) { onShow() {
uni.showModal({ // #ifndef H5
title: "更新提示", if(this.config.enableGetClipboard){
content: "发现新版本,是否重启应用?", this.getClipboard();
success(res) { }
if (res.confirm) { // #endif
// 新的版本已经下载好,调用 applyUpdate 应用新版本并重启 // #ifdef APP-PLUS
updateManager.applyUpdate();
}
},
});
});
updateManager.onUpdateFailed(function (res) {
// 新的版本下载失败
});
},
// TODO 开屏广告 后续优化添加 if (storage.getShow()) {
launch() { if (uni.getSystemInfoSync().platform == 'ios') {
try { this.$u.route("/pages/tabbar/screen/fullScreen");
// 获取本地存储中launchFlag标识 开屏广告
const value = uni.getStorageSync("launchFlag");
if (!value) {
// this.$u.route("/pages/index/agreement");
} else {
//app启动时打开启动广告页
var w = plus.webview.open(
"/hybrid/html/advertise/advertise.html",
"本地地址",
{
top: 0,
bottom: 0,
zindex: 999,
},
"fade-in",
500
);
//设置定时器4s后关闭启动广告页
setTimeout(function () {
plus.webview.close(w);
APPUpdate();
}, 3000);
}
} catch (e) {
// error
uni.setStorage({
key: "launchFlag",
data: true,
success: function () {
console.log("error时存储launchFlag");
},
});
}
},
/** }
* 获取粘贴板数据 }
*/ // #endif
async getClipboard() { },
let res = await getClipboardData(); methods: {
/** /**
* 解析粘贴板数据 * 微信小程序版本提交更新版本 解决缓存问题
*/ */
if (res.indexOf(config.shareLink) != -1) { applyUpdateWeChat() {
uni.showModal({ const updateManager = uni.getUpdateManager();
title: "提示",
content: "检测到一个分享链接是否跳转?",
confirmText: "跳转",
success: function (callback) {
if (callback.confirm) {
const path = res.split(config.shareLink)[1];
if (path.indexOf("tabbar") != -1) {
uni.switchTab({
url: path,
});
} else {
uni.navigateTo({
url: path,
});
}
}
},
});
}
},
/** updateManager.onCheckForUpdate(function(res) {
* h5中打开app获取跳转app的链接并跳转 // 请求完新版本信息的回调
*/ });
checkArguments() {
// #ifdef APP-PLUS updateManager.onUpdateReady(function(res) {
setTimeout(() => { uni.showModal({
const args = plus.runtime.arguments; title: "更新提示",
if (args) { content: "发现新版本,是否重启应用?",
const argsStr = decodeURIComponent(args); success(res) {
const path = argsStr.split("//")[1]; if (res.confirm) {
if (path.indexOf("tabbar") != -1) { // 新的版本已经下载好,调用 applyUpdate 应用新版本并重启
uni.switchTab({ updateManager.applyUpdate();
url: `/${path}`, }
}); },
} else { });
uni.navigateTo({ });
url: `/${path}`, updateManager.onUpdateFailed(function(res) {
}); // 新的版本下载失败
} });
} },
});
// #endif // TODO 开屏广告 后续优化添加
}, launch() {
}, try {
}; // 获取本地存储中launchFlag标识 开屏广告
const value = uni.getStorageSync("launchFlag");
if (!value) {
// this.$u.route("/pages/index/agreement");
} else {
//app启动时打开启动广告页
var w = plus.webview.open(
"/hybrid/html/advertise/advertise.html",
"本地地址", {
top: 0,
bottom: 0,
zindex: 999,
},
"fade-in",
500
);
//设置定时器4s后关闭启动广告页
setTimeout(function() {
plus.webview.close(w);
APPUpdate();
}, 3000);
}
} catch (e) {
// error
uni.setStorage({
key: "launchFlag",
data: true,
success: function() {
console.log("error时存储launchFlag");
},
});
}
},
/**
* 获取粘贴板数据
*/
async getClipboard() {
let res = await getClipboardData();
/**
* 解析粘贴板数据
*/
if (res.indexOf(config.shareLink) != -1 && (res != this.$store.state.shareLink)) {
this.$store.state.shareLink = res
uni.showModal({
title: "提示",
content: "检测到一个分享链接是否跳转?",
confirmText: "跳转",
success: function(callback) {
if (callback.confirm) {
const path = res.split(config.shareLink)[1];
if (path.indexOf("tabbar") != -1) {
uni.switchTab({
url: path,
});
} else {
uni.navigateTo({
url: path,
});
}
}
},
});
}
},
/**
* h5中打开app获取跳转app的链接并跳转
*/
checkArguments() {
// #ifdef APP-PLUS
setTimeout(() => {
const args = plus.runtime.arguments;
if (args) {
const argsStr = decodeURIComponent(args);
const path = argsStr.split("//")[1];
if (path.indexOf("tabbar") != -1) {
uni.switchTab({
url: `/${path}`,
});
} else {
uni.navigateTo({
url: `/${path}`,
});
}
}
});
// #endif
},
},
};
</script> </script>
<style lang="scss"> <style lang="scss">
@import "uview-ui/index.scss"; @import "uview-ui/index.scss";
// -------适配底部安全区 苹果x系列刘海屏 // -------适配底部安全区 苹果x系列刘海屏
// #ifdef MP-WEIXIN // #ifdef MP-WEIXIN
.mp-iphonex-bottom { .mp-iphonex-bottom {
padding-bottom: constant(safe-area-inset-bottom); padding-bottom: constant(safe-area-inset-bottom);
padding-bottom: env(safe-area-inset-bottom); padding-bottom: env(safe-area-inset-bottom);
box-sizing: content-box; box-sizing: content-box;
height: auto !important; height: auto !important;
padding-top: 10rpx; padding-top: 10rpx;
} }
// #endif
body { // #endif
background-color: $bg-color;
} body {
/************************ */ background-color: $bg-color;
.w200 { }
width: 200rpx !important;
} /************************ */
.flex1 { .w200 {
flex: 1; //必须父级设置flex width: 200rpx !important;
} }
.flex1 {
flex: 1; //必须父级设置flex
}
</style> </style>

View File

@@ -1 +0,0 @@
qSyvBPhDsPdxvOhC

179
README.md
View File

@@ -1,18 +1,22 @@
## 🔥 Lilishop B2B2C商城系统 ## Lilishop B2B2C商城系统
##### 🌹 开源不易如有帮助请点Star #### 欢迎交流需求,交流业务,交流技术(基础问题自行解决,其他问题先看文档后提问)
#### 欢迎交流需求,交流业务,交流技术(基础问题自行解决,进群先看文档后提问)
##### 交流 qq 1群 961316482已满 ##### 交流 qq 1群 961316482已满
<a target="_blank" href="https://qm.qq.com/cgi-bin/qm/qr?k=BAhURE3DG2YWhQk6kRxVapbLykqMoPS8&jump_from=webapi"><img border="0" src="https://pub.idqqimg.com/wpa/images/group.png" alt="Lilishop交流群" title="Lilishop交流群">点击快捷加群</a>
##### 交流 qq 2群 875294241 ##### 交流 qq 2群 875294241(已满)
<a target="_blank" href="https://qm.qq.com/cgi-bin/qm/qr?k=_lrekOvr5k2p5uTn5GRidI-chKEmpCX3&jump_from=webapi"><img border="0" src="https://pub.idqqimg.com/wpa/images/group.png" alt="Lilishop交流群2群" title="Lilishop交流群2群">点击快捷加群</a>
##### 交流 qq 3群 263785057
##### 商城 公众号/小程序体验,扫描二维码 <a target="_blank" href="https://qm.qq.com/cgi-bin/qm/qr?k=VUogkDvaso4zLTFH8nxFPDRKq0EthUn1&jump_from=webapi"><img border="0" src="//pub.idqqimg.com/wpa/images/group.png" alt="Lilishop交流群3群" title="Lilishop交流群3群">点击快捷加群</a>
##### 体验 公众号/小程序/APP 体验,扫描二维码
![image-20210511171611793](https://pickmall.cn/assets/imgs/h5-qrcode.png) ![image-20210511171611793](https://pickmall.cn/assets/imgs/h5-qrcode.png)
@@ -20,148 +24,88 @@
&nbsp;&nbsp;![github](https://img.shields.io/github/stars/hongyehuicheng/lilishop.svg?style=social&logo=#181717) &nbsp;&nbsp;![github](https://img.shields.io/github/stars/hongyehuicheng/lilishop.svg?style=social&logo=#181717)
### 🔥 商城介绍 ### 商城介绍
**官网**https://pickmall.cn **官网**https://pickmall.cn
Lilishop 商城系统 基于SpringBoot 研发,B2B2C多用户商城系统前端使用 Vue、uniapp开发 **系统全端全部代码开源** Lilishop商城系统支持商家入驻,后端基于SpringBoot 研发,前端使用 Vue、uniapp开发 **系统全端全部代码开源**
业务兼容O2O商城/B2B商城/B2B2C商城/F2B2C商城/S2B2C商城。支持小程序商城、H5商城、APP商城、 PC商城 前后端分离支持分布式部署支持Docker各个API独立并且有独立的消费者
### 商城 API/消费者 聚合版
api不需要单独部署只需启动一个jar包就可以正常运转 如有需要,可以点击跳转
https://gitee.com/beijing_hongye_huicheng/lilishop-simplify
商城前后端分离、支持分布式部署。 ### 开发/使用/常见问题 帮助文档
商城包含 会员模块、**第三方登录模块**、**第三方支付模块**、**楼层装修模块**、订单模块、分销模块、文章模块、系统设置模块、流量分析模块
商城包含各种中间件、搜索引擎、多级缓存、分布式事务、分布式任务调度等支持Docker支持k8s。是一款高性能支持高并发的商城系统。
##### 商城 API/消费者 聚合版
api不需要单独部署只需启动一个jar包就可以正常运转 如有需要可以点击跳转https://gitee.com/beijing_hongye_huicheng/lilishop-simplify
### ☃️ 商城 开发/使用/常见问题 帮助文档
https://docs.pickmall.cn https://docs.pickmall.cn
### 💧 开源商城项目地址(gitee) ### 项目地址
**API商城所有API**https://gitee.com/beijing_hongye_huicheng/lilishop.git gitee : https://gitee.com/beijing_hongye_huicheng
**UI商城管理端/商家端/买家PC端** https://gitee.com/beijing_hongye_huicheng/lilishop-ui.git github 镜像: https://github.com/lilishop?tab=repositories
**uniapp商城移动端支持小程序/APP/H5**https://gitee.com/beijing_hongye_huicheng/lilishop-uniapp.git 商城UI 项目下3个文件夹
buyer买家PC端seller商家端manager后台管理端
**docker一键部署商城部署脚本**https://gitee.com/beijing_hongye_huicheng/docker.git
### 💧 开源商城项目地址(github)
**API商城所有API**https://github.com/hongyehuicheng/lilishop.git
**UI商城管理端/商家端/买家PC端** https://github.com/hongyehuicheng/lilishop-ui.git
**uniapp商城移动端支持小程序/APP/H5**https://github.com/hongyehuicheng/lilishop-uniapp.git
**docker一键部署商城部署脚本**https://github.com/hongyehuicheng/docker.git
☃️ UI 项目下3个文件夹 buyer买家PC端seller商家端manager后台管理端 ### 演示地址
PS手机验证码为 111111
**平台管理端**https://admin-b2b2c.pickmall.cn 账号admin/123456
### 💧 演示地址(手机验证码为 111111) **店铺管理端**https://store-b2b2c.pickmall.cn 账号13011111111/111111
**商城管理端**https://admin-b2b2c.pickmall.cn 账号admin/123456
**商城店铺后台**https://store-b2b2c.pickmall.cn 账号13011111111/111111
**商城PC页面**https://pc-b2b2c.pickmall.cn **商城PC页面**https://pc-b2b2c.pickmall.cn
**商城移动端(请使浏览器手机模式,或者用手机浏览器打开)**https://m-b2b2c.pickmall.cn **商城 小程序/公众号/APP**:扫描二维码
**小程序/公众号**:扫描二维码
![image-20210511171611793](https://pickmall.cn/assets/imgs/h5-qrcode.png) ![image-20210511171611793](https://pickmall.cn/assets/imgs/h5-qrcode.png)
### 🚙 3行命令搭建本地商城只能本机访问如需调整请自行操作镜像 ### 快速本地部署
温馨提示由于服务中间件较多如果笔记本环境启动内存没有32g可能无法启动成功macbookpro 2020 16g内存启动无法成功台式机在16g内存、AMD 3700x 的ubuntu系统成功运行。 [点击跳转](https://docs.pickmall.cn/deploy/%E8%BF%90%E8%A1%8C%E7%8E%AF%E5%A2%83%E5%87%86%E5%A4%87.html)
**商城数据库**
使用docker-compose部署数据库自动初始化数据库不需要手动下载等操作
如果手动部署才需要获取sql [点击跳转](https://gitee.com/beijing_hongye_huicheng/docker/tree/master/init/mysql) PS这里有与tag版本一致的sql如果是历史版本则docker项目也切换至历史版本获取sql即可历史版本升级则根据java相聚的根目录DB目录下的升级sql按需执行
##### docker环境安装 [点击跳转](https://docs.pickmall.cn/deploy/%E8%BF%90%E8%A1%8C%E7%8E%AF%E5%A2%83%E5%87%86%E5%A4%87.html) ### 功能列表
##### 下载docker-compose脚本 #### 平台管理端功能
`git clone https://gitee.com/beijing_hongye_huicheng/docker.git `
##### 部署商城所需中间件 ![平台管理端功能](https://pickmall.cn/assets/imgs/other/managerList1.jpg)
`docker-compose up -d`
##### 部署商城应用
`docker-compose -f docker-compose-application.yml up -d`
PS:商城数据库单独部署 https://gitee.com/beijing_hongye_huicheng/docker/tree/master/init/mysql 这里有与tag版本一致的sql根据tag获取sql如果使用master代码则需要在lilishop项目根目录的DB目录中获取对应的升级sql。 #### 卖家功能
##### 商城 API/UI 地址
| API | 地址 |
| -------------- | --------------- |
| 商城买家API | http://127.0.0.1:8888 |
| 商城商家API | http://127.0.0.1:8889 |
| 商城管理端API | http://127.0.0.1:8887 |
| 商城基础API | http://127.0.0.1:8890 |
| 前端演示 | 地址 |
| -------------- | --------------- |
| 商城PC端 | http://127.0.0.1:10000 |
| 商城WAP端 | http://127.0.0.1:10001 |
| 商城卖家端 | http://127.0.0.1:10002 |
| 商城管理端 | http://127.0.0.1:10003 |
### ⚾️ 功能列表
#### 🥎 商城平台功能
![平台功能](https://pickmall.cn/assets/imgs/other/managerList.jpg)
#### 🥎 商城卖家功能
![商家端功能](https://pickmall.cn/assets/imgs/other/storeList.jpg) ![商家端功能](https://pickmall.cn/assets/imgs/other/storeList.jpg)
### 商城前端功能展示
#### 商城移动端
### 🧩 商城前端功能展示
#### ⚽️ 商城移动端
<img src="https://pickmall.cn/assets/imgs/other/app.gif" alt="移动端功能展示" style="zoom:50%;" /> <img src="https://pickmall.cn/assets/imgs/other/app.gif" alt="移动端功能展示" style="zoom:50%;" />
#### 平台管理端
#### ⚽️ 商城管理端
![管理端功能展示](https://pickmall.cn/assets/imgs/other/manager.gif) ![管理端功能展示](https://pickmall.cn/assets/imgs/other/manager.gif)
### 商城技术选型 ### 技术选型
#### 🥅 架构图 #### 架构图
![架构](https://lili-system.oss-cn-beijing.aliyuncs.com/docs/%E6%9E%B6%E6%9E%84.png) ![技术选型](https://lili-system.oss-cn-beijing.aliyuncs.com/docs/%E6%9E%B6%E6%9E%84.png)
##### 🕹 后台技术选型 ##### 后台技术选型
| 说明 | 框架 | 说明 | | | 说明 | 框架 | 说明 | |
| -------------- | --------------- | -------------- | ------------- | | -------------- | --------------- | -------------- | ------------- |
@@ -175,7 +119,7 @@ PS:商城数据库单独部署 https://gitee.com/beijing_hongye_huicheng/docker/
| 短信 | 阿里云短信 | 认证 | JWT | | 短信 | 阿里云短信 | 认证 | JWT |
| 日志处理 | Log4j | 接口规范 | RESTful | | 日志处理 | Log4j | 接口规范 | RESTful |
##### 🖥 前端-运营后台、店铺后台 ##### 前端-运营后台、店铺后台
| 说明 | 框架 | 说明 | 框架 | | 说明 | 框架 | 说明 | 框架 |
| ---------- | ---------- | ---------- | ------- | | ---------- | ---------- | ---------- | ------- |
@@ -185,34 +129,43 @@ PS:商城数据库单独部署 https://gitee.com/beijing_hongye_huicheng/docker/
| 基础UI库 | iView | UI界面基于 | iView | | 基础UI库 | iView | UI界面基于 | iView |
| 网络请求 | axios | | | | 网络请求 | axios | | |
##### 📱前端-移动端 ##### 前端-移动端
| 说明 | 架构 | 说明 | 架构 | | 说明 | 架构 | 说明 | 架构 |
| --------- | ------- | -------- | ------- | | --------- | ------- | -------- | ------- |
| 基础UI库 | uViewui | 基础框架 | uni-app | | 基础UI库 | uViewui | 基础框架 | uni-app |
| CSS预处理 | scss | 地图引擎 | amap | | CSS预处理 | scss | 地图引擎 | amap |
### 🌟 版本升级 ### 版本升级
``` ```
商城后续会持续版本升级修复bug完善功能覆盖更多业务场景 o2o/b2b/s2b2b2c/跨境电商 系统后续会提供多场景解决方案。
更多架构微服务、Saas、中台等都会支持。 支持差价升级商业授权
后续会考虑推出微服务商城系统/商城中台等
``` ```
### 商业授权
商业版本与开源版本代码一致,没有区分
### ⚠️ 开源须知 商业使用需要授权授权方式可选择联系官网客服或者qq群联系群主。
商业授权模式为永久授权,支持永久升级。
商业案例由于涉及部分多层二开关系,如需了解可以咨询销售。
### 开源须知
1.仅允许用于个人学习研究使用. 1.仅允许用于个人学习研究使用.
2.禁止将本开源的代码和资源进行任何形式任何名义的出售. 2.禁止将本开源的代码和资源进行任何形式任何名义的出售.
3.软件受国家计算机软件著作权保护登记号2021SR0805085 3.软件受国家计算机软件著作权保护登记号2021SR0805085
4.限制商用如果需要商业使用请联系我们。QQ3409056806. 4.限制商用如果需要商业使用请联系我们。QQ3409056806.或者加入qq群联系群主。
### 🐧 交流群
### 交流群
##### 官方qq 1群 961316482已满 ##### 官方qq 1群 961316482已满
##### 官方qq 2群 875294241 ##### 官方qq 2群 875294241(已满)
##### 官网qq 3群 263785057

17
androidPrivacy.json Normal file
View File

@@ -0,0 +1,17 @@
{
"version" : "1",
"prompt" : "template",
"title" : "服务协议和隐私政策",
"message" : "  请你务必审慎阅读、充分理解“服务协议”和“隐私政策”各条款,包括但不限于:为了更好的向你提供服务,我们需要收集你的设备标识、操作日志等信息用于分析、优化应用性能。<br/>  你可阅读<a href=\"https://pc-b2b2c.pickmall.cn/article/detail?id=1371992704333905920\">《服务协议》</a>和<a href=\"https://pc-b2b2c.pickmall.cn/article/detail?id=1371779927900160000\">《隐私政策》</a>了解详细信息。如果你同意,请点击下面按钮开始接受我们的服务。",
"buttonAccept" : "同意并接受",
"buttonRefuse" : "暂不同意",
"second" : {
"title" : "确认提示",
"message" : "  进入应用前,你需先同意<a href=\"https://pc-b2b2c.pickmall.cn/article/detail?id=1371992704333905920\">《服务协议》</a>和<a href=\"https://pc-b2b2c.pickmall.cn/article/detail?id=1371779927900160000\">《隐私政策》</a>,否则将退出应用。",
"buttonAccept" : "同意并继续",
"buttonRefuse" : "退出应用"
},
"styles" : {
"borderRadius" : "5px"
}
}

View File

@@ -25,7 +25,7 @@ export function getAddressList(pageNumber, pageSize) {
*/ */
export function getLogistics() { export function getLogistics() {
return http.request({ return http.request({
url: "/logistics", url: "/other/logistics",
method: Method.GET, method: Method.GET,
needToken: true, needToken: true,
params: { pageNumber: 1, pageSize: 200, disabled: "OPEN" }, params: { pageNumber: 1, pageSize: 200, disabled: "OPEN" },

View File

@@ -15,7 +15,7 @@ const request = http.request;
*/ */
export function webConnect(code) { export function webConnect(code) {
return http.request({ return http.request({
url: `connect/login/web/${code}`, url: `passport/connect/connect/login/web/${code}`,
method: Method.GET, method: Method.GET,
needToken: true, needToken: true,
header: { header: {
@@ -25,7 +25,7 @@ export function webConnect(code) {
} }
export function openIdLogin(params, clientType) { export function openIdLogin(params, clientType) {
return http.request({ return http.request({
url: `connect/app/login`, url: `passport/connect/connect/app/login`,
method: Method.GET, method: Method.GET,
needToken: true, needToken: true,
data: params, data: params,
@@ -40,7 +40,7 @@ export function openIdLogin(params, clientType) {
*/ */
export function loginCallback(state) { export function loginCallback(state) {
return http.request({ return http.request({
url: `connect/result?state=${state}`, url: `passport/connect/connect/result?state=${state}`,
method: Method.GET, method: Method.GET,
needToken: false needToken: false
}); });
@@ -54,7 +54,7 @@ export function loginCallback(state) {
*/ */
export function mpAutoLogin(params) { export function mpAutoLogin(params) {
return http.request({ return http.request({
url: 'mini-program/auto-login', url: 'passport/connect/miniProgram/auto-login',
method: Method.GET, method: Method.GET,
params params
}); });

View File

@@ -1,6 +1,21 @@
import { http, Method } from "@/utils/request.js"; import { http, Method } from "@/utils/request.js";
export function toSpecial(data) {
return http.request({
url: `/other/pageData/getSpecial`,
method: Method.GET,
data
});
}
/**
* 专题内容
*/
export function getSpecial(id) {
return http.request({
url: `/other/pageData/get/${id}`,
method: Method.GET,
});
}
/** /**
* 获取广告图 * 获取广告图

View File

@@ -14,6 +14,23 @@ export function resetByMobile(params) {
}); });
} }
/**
* 账号密码登陆
* @params password
* @params username
*/
export function userLogin(params){
return http.request({
method: "POST",
url:`/passport/member/userLogin`,
data: params,
header: {
"content-type": "application/x-www-form-urlencoded",
},
})
}
/** /**
* 发送验证码 * 发送验证码
* @param mobile * @param mobile
@@ -74,3 +91,20 @@ export function logout () {
needToken: true, needToken: true,
}) })
} }
export function scannerCodeLogin(params){
return http.request({
url: '/passport/member/app_scanner',
method: "POST",
params,
needToken: true,
});
}
export function scannerCodeLoginConfirm(params){
return http.request({
url: '/passport/member/app_confirm',
method: "POST",
params,
needToken: true,
});
}

View File

@@ -14,7 +14,7 @@ import api from '@/config/api.js';
*/ */
export function getWeChatMpMessage() { export function getWeChatMpMessage() {
return http.request({ return http.request({
url: 'mini-program/subscribeMessage', url: 'passport/connect/miniProgram/subscribeMessage',
method: Method.GET method: Method.GET
}); });
} }
@@ -48,6 +48,24 @@ export function messageMarkAsRead(ids) {
}); });
} }
//读取站内消息
export function editMessages(message_id,params){
return http.request({
url:`/message/member/${message_id}`,
method:Method.PUT,
needToken:true,
params
})
}
//获取站内消息
export function messages(params) {
return http.request({
url: "/message/member",
method: Method.GET,
needToken: true,
params,
});
}
/** /**
* 获取物流消息列表 * 获取物流消息列表
@@ -73,7 +91,7 @@ export function getLogisticsMessages(params) {
*/ */
export function getAppVersion(appType) { export function getAppVersion(appType) {
return http.request({ return http.request({
url: `/appVersion/${appType}`, url: `/other/appVersion/${appType}`,
method: Method.GET, method: Method.GET,
type:"manager" type:"manager"
}); });
@@ -86,7 +104,7 @@ export function getLogisticsMessages(params) {
*/ */
export function getAppVersionList(type,data) { export function getAppVersionList(type,data) {
return http.request({ return http.request({
url: `/appVersion/appVersion/${type}`, url: `/other/appVersion/appVersion/${type}`,
method: Method.GET, method: Method.GET,
type:"manager", type:"manager",
data data

File diff suppressed because it is too large Load Diff

View File

@@ -200,7 +200,7 @@ export default {
this.tabCurrentIndex++; this.tabCurrentIndex++;
// 当前距离重新为最上面 // 当前距离重新为最上面
this.scrollTop = 0; this.$set(this,'scrollTop',0)
} }
} else { } else {
this.$emit("funcValue", this.tabbars); this.$emit("funcValue", this.tabbars);

View File

@@ -0,0 +1,11 @@
## 商品列表展示
### OBJECT 参数说明
| 属性 | 说明 | 类型 | 必填 |
| ----------- | ---------------------------------------------------------- | ------- | ---- |
| `res` | 显示数据 | Array | 是 |
| `type` | 商品展示类型 oneColumns twoColumns ,默认展示一行两列商品 | String | 否 |
| `storeName` | 是否展示店铺名称,默认展示 | Boolean | 否 |
| `keywords` | 高亮展示搜索内容 | String | 否 |

View File

@@ -0,0 +1,276 @@
<template>
<div>
<!-- 一行两列商品展示 -->
<view class="goods-list" v-if="type == 'twoColumns'">
<view v-for="(item, index) in res" :key="index" class="goods-item">
<view class="image-wrapper" @click="navigateToDetailPage(item)">
<u-image
:src="item.thumbnail"
width="100%"
height="330rpx"
mode="aspectFill"
>
<u-loading slot="loading"></u-loading>
</u-image>
</view>
<view class="goods-detail">
<div
class="title clamp"
v-html="lightSearchStr(keyword, item.goodsName)"
@click="navigateToDetailPage(item)"
></div>
<view class="price-box" @click="navigateToDetailPage(item)">
<div class="price" v-if="item.price != undefined">
¥<span
>{{
$options.filters.goodsFormatPrice(item.price)[0]
}} </span
>.{{ $options.filters.goodsFormatPrice(item.price)[1] }}
</div>
</view>
<div class="count-config" @click="navigateToDetailPage(item)">
<span>已售 {{ item.buyCount || "0" }}</span>
<span>{{ item.commentNum || "0" }}条评论</span>
</div>
<div
class="store-seller-name"
v-if="storeName"
@click="navigateToStoreDetailPage(item)"
>
<div class="text-hidden">
<u-tag
style="margin-right: 10rpx"
size="mini"
mode="dark"
v-if="item.selfOperated"
text="自营"
type="error"
/>
<span>{{ item.storeName || "暂无" }}</span>
</div>
<span>
<u-icon name="arrow-right"></u-icon>
</span>
</div>
</view>
</view>
</view>
<!-- 一行一列商品展示 -->
<div v-if="type == 'oneColumns'">
<div v-for="(item, index) in res" :key="index" class="goods-row">
<div class="flex goods-col">
<div class="goods-img" @click="navigateToDetailPage(item)">
<u-image
width="230rpx"
border-radius="16"
height="230rpx"
:src="item.goodsImage || item.thumbnail"
>
<u-loading slot="loading"></u-loading>
</u-image>
</div>
<div class="goods-detail">
<div class="title clamp3" @click="navigateToDetailPage(item)">
{{ item.goodsName }}
</div>
<view class="price-box" @click="navigateToDetailPage(item)">
<div class="price" v-if="item.price != undefined">
¥<span
>{{ $options.filters.goodsFormatPrice(item.price)[0] }} </span
>.{{ $options.filters.goodsFormatPrice(item.price)[1] }}
</div>
</view>
<div class="promotion" @click="navigateToDetailPage(item)">
<div v-if="item.salesModel == 'WHOLESALE'">
<span></span>
</div>
<div
v-for="(promotionItem, promotionIndex) in getPromotion(item)"
:key="promotionIndex"
>
<span v-if="promotionItem.indexOf('COUPON') != -1"></span>
<span v-if="promotionItem.indexOf('FULL_DISCOUNT') != -1"
>满减</span
>
<span v-if="promotionItem.indexOf('SECKILL') != -1">秒杀</span>
</div>
</div>
<div
style="overflow: hidden"
@click="navigateToDetailPage(item)"
class="count-config"
>
<span style="float: left; font-size: 22rpx"
>已售 {{ item.buyCount || "0" }}</span
>
<span style="float: right; font-size: 22rpx"
>{{ item.commentNum || "0" }}条评论</span
>
</div>
</div>
</div>
</div>
</div>
</div>
</template>
<script>
import commonTpl from "@/components/m-goods-list/common";
export default {
data() {
return {
lightColor: this.$mainColor,
};
},
mixins: [commonTpl],
props: {
// 展示的类型
type:{
type:String,
default:"oneColumns"
},
// 遍历的数据
res: {
type: Array,
default: () => {
return [];
},
},
},
methods: {
// 跳转到商品详情
navigateToDetailPage(item) {
uni.navigateTo({
url: `/pages/product/goods?id=${item.id}&goodsId=${item.goodsId}`,
});
},
},
};
</script>
<style lang="scss" scoped>
.goods-list {
display: flex;
flex-wrap: wrap;
margin: 10rpx 20rpx 284rpx;
width: 100%;
> .goods-item {
background-color: #ffffff;
display: flex;
border-radius: 16rpx;
flex-direction: column;
width: calc(50% - 30rpx);
margin-bottom: 20rpx;
padding-bottom: 20rpx;
&:nth-child(2n + 1) {
margin-right: 20rpx;
}
.image-wrapper {
width: 100%;
height: 330rpx;
border-radius: 16rpx 16rpx 0 0;
overflow: hidden;
padding: 0;
}
}
.count-config,
.store-seller-name {
font-size: $font-sm;
}
.text-hidden {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
}
.goods-row {
background: #fff;
padding: 16rpx;
> .goods-col {
display: flex;
> .goods-img {
overflow: hidden;
flex: 4;
}
> .goods-detail {
flex: 7;
}
}
}
.goods-detail {
margin: 0 20rpx;
> .title {
font-size: $font-base;
color: $font-color-dark;
line-height: 1.5;
height: 86rpx;
padding: 10rpx 0 0;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
overflow: hidden;
}
.promotion {
margin-top: 4rpx;
display: flex;
div {
span {
font-size: 24rpx;
color: $light-color;
margin-right: 10rpx;
padding: 0 4rpx;
border-radius: 2rpx;
}
}
}
.store-seller-name {
color: #666;
overflow: hidden;
display: flex;
justify-content: space-between;
}
.count-config {
padding: 5rpx 0;
color: #666;
display: flex;
font-size: 24rpx;
justify-content: space-between;
}
> .price-box {
margin-top: 10rpx;
display: flex;
align-items: center;
justify-content: space-between;
padding-right: 10rpx;
font-size: 24rpx;
color: $font-color-light;
> .price {
font-size: 26rpx;
line-height: 1;
color: $main-color;
font-weight: bold;
/deep/ span:nth-of-type(1) {
font-size: 38rpx;
}
}
}
}
</style>

View File

@@ -0,0 +1,69 @@
<template>
</template>
<script>
export default {
methods: {
// 高亮显示搜索内容
lightSearchStr(keyword, str) {
if (!keyword) {
return str
} else {
let unicodes = '';
for (let i of Array.from(keyword)) {
unicodes += this.unicode(i) + "|"
}
const rule = '(' + unicodes + ')'
const reg = new RegExp(rule, 'gi');
return str ? str.replace(reg, matchValue =>
`<span style="color:${this.lightColor}">${matchValue}</span>`
) : ''
}
},
// 转换为unicode
unicode(str) {
var value = '';
for (var i = 0; i < str.length; i++) {
value += '\\u' + this.left_zero_4(parseInt(str.charCodeAt(i)).toString(16));
}
return value;
},
left_zero_4(str) {
if (str != null && str != '' && str != 'undefined') {
if (str.length == 2) {
return '00' + str;
}
}
return str;
},
// 数据去重一下 只显示一次 减免 劵 什么的
getPromotion(item) {
if (item.promotionMap) {
let array = [];
Object.keys(item.promotionMap).forEach((child) => {
if (!array.includes(child.split("-")[0])) {
array.push(child.split("-")[0]);
}
});
return array;
}
},
// 跳转到商品详情
navigateToDetailPage(item) {
uni.navigateTo({
url: `/pages/product/goods?id=${item.content.id}&goodsId=${item.content.goodsId}`,
});
},
// 跳转地址
navigateToStoreDetailPage(item) {
uni.navigateTo({
url: `/pages/product/shopPage?id=${item.content.storeId}`,
});
},
},
}
</script>
<style lang='scss' scoped>
</style>

View File

@@ -0,0 +1,337 @@
<template>
<view>
<!-- 一行两列商品展示 -->
<view class="goods-list" v-if="type == 'twoColumns'">
<view v-for="(item, index) in res" :key="index" class="goods-item">
<view class="image-wrapper" @click="navigateToDetailPage(item)">
<u-image :src="item.content.thumbnail" width="100%" height='330rpx' mode="aspectFill">
<u-loading slot="loading"></u-loading>
</u-image>
</view>
<view class="goods-detail">
<div class="title clamp" v-html="lightSearchStr(keyword,item.content.goodsName)"
@click="navigateToDetailPage(item)">
</div>
<view class="price-box" @click="navigateToDetailPage(item)">
<div class="price" v-if="item.content.price!=undefined">
¥<span>{{ $options.filters.goodsFormatPrice(item.content.price )[0] }} </span>.{{
$options.filters.goodsFormatPrice(item.content.price )[1]
}}
</div>
</view>
<div class="promotion" @click="navigateToDetailPage(item)">
<div v-if="item.content.salesModel == 'WHOLESALE'">
<span></span>
</div>
<div v-for="(promotionItem,promotionIndex) in getPromotion(item)" :key="promotionIndex">
<span v-if="promotionItem.indexOf('COUPON') != -1"></span>
<span v-if="promotionItem.indexOf('FULL_DISCOUNT') != -1">满减</span>
<span v-if="promotionItem.indexOf('SECKILL') != -1">秒杀</span>
</div>
</div>
<div class="count-config" @click="navigateToDetailPage(item)">
<span>已售 {{ item.content.buyCount || "0" }}</span>
<span>{{ item.content.commentNum || "0" }}条评论</span>
</div>
<div class="store-seller-name" v-if="storeName" @click="navigateToStoreDetailPage(item)">
<div class="text-hidden">
<u-tag style="margin-right: 10rpx" size="mini" mode="dark" v-if="item.selfOperated"
text="自营" type="error" />
<span>{{ item.content.storeName || "暂无" }}</span>
</div>
<span>
<u-icon name="arrow-right"></u-icon>
</span>
</div>
</view>
</view>
</view>
<!-- 一行一列商品展示 -->
<div v-if="type == 'oneColumns'">
<div v-for="(item, index) in res" :key="index" class="goods-row">
<div class="flex goods-col">
<div class="goods-img" @click="navigateToDetailPage(item)">
<u-image width="230rpx" border-radius='16' height="230rpx" :src="item.content.thumbnail">
<u-loading slot="loading"></u-loading>
</u-image>
</div>
<div class="goods-detail">
<div class="title clamp3" @click="navigateToDetailPage(item)">{{ item.content.goodsName }}</div>
<view class="price-box" @click="navigateToDetailPage(item)">
<div class="price" v-if="item.content.price!=undefined">
¥<span>{{ $options.filters.goodsFormatPrice(item.content.price )[0] }} </span>.{{
$options.filters.goodsFormatPrice(item.content.price )[1]
}}
</div>
</view>
<div class="promotion" @click="navigateToDetailPage(item)">
<div v-if="item.content.salesModel == 'WHOLESALE'">
<span></span>
</div>
<div v-for="(promotionItem,promotionIndex) in getPromotion(item)" :key="promotionIndex">
<span v-if="promotionItem.indexOf('COUPON') != -1"></span>
<span v-if="promotionItem.indexOf('FULL_DISCOUNT') != -1">满减</span>
<span v-if="promotionItem.indexOf('SECKILL') != -1">秒杀</span>
</div>
</div>
<div style="overflow: hidden" @click="navigateToDetailPage(item)" class="count-config">
<span style="float: left; font-size: 22rpx">已售 {{ item.content.buyCount || '0' }}</span>
<span style="float: right; font-size: 22rpx">{{ item.content.commentNum || '0' }}条评论</span>
</div>
<div style="overflow: hidden" @click="navigateToStoreDetailPage(item)" class="count-config">
<div class="text-hidden" v-if="storeName">
<u-tag style="margin-right: 10rpx" size="mini" mode="dark" v-if="item.selfOperated"
text="自营" type="error" />
<span class="line1-store-name">{{ item.content.storeName }}</span>
<span class="to-store">进店<u-icon size="24" name="arrow-right" color="#666"></u-icon>
</span>
</div>
<span>
<u-icon name="arrow-right" color="#c5c5c5"></u-icon>
</span>
</div>
</div>
</div>
</div>
</div>
</view>
</template>
<script>
import commonTpl from '@/components/m-goods-list/common'
export default {
data() {
return {
lightColor: this.$mainColor
}
},
mixins: [commonTpl],
props: {
// 遍历的数据
res: {
type: Array,
default: () => {
return []
}
},
// 一行两列还是一行一列显示
type: {
type: String,
default: 'twoColumns',
validator() {
return ['twoColumns', 'oneColumns']
}
},
storeName: {
type: Boolean,
default: true
},
keyword: {
type: null,
default: ''
}
},
watch: {
keyword(val) {
if (val) {
this.lightSearchStr(val)
}
}
},
methods: {
// 高亮显示搜索内容
lightSearchStr(keyword, str) {
if (!keyword) {
return str
} else {
let unicodes = '';
for (let i of Array.from(keyword)) {
unicodes += this.unicode(i) + "|"
}
const rule = '(' + unicodes + ')'
const reg = new RegExp(rule, 'gi');
return str ? str.replace(reg, matchValue =>
`<span style="color:${this.lightColor}">${matchValue}</span>`
) : ''
}
},
// 转换为unicode
unicode(str) {
var value = '';
for (var i = 0; i < str.length; i++) {
value += '\\u' + this.left_zero_4(parseInt(str.charCodeAt(i)).toString(16));
}
return value;
},
left_zero_4(str) {
if (str != null && str != '' && str != 'undefined') {
if (str.length == 2) {
return '00' + str;
}
}
return str;
},
// 数据去重一下 只显示一次 减免 劵 什么的
getPromotion(item) {
if (item.promotionMap) {
let array = [];
Object.keys(item.promotionMap).forEach((child) => {
if (!array.includes(child.split("-")[0])) {
array.push(child.split("-")[0]);
}
});
return array;
}
},
// 跳转到商品详情
navigateToDetailPage(item) {
uni.navigateTo({
url: `/pages/product/goods?id=${item.content.id}&goodsId=${item.content.goodsId}`,
});
},
// 跳转地址
navigateToStoreDetailPage(item) {
uni.navigateTo({
url: `/pages/product/shopPage?id=${item.content.storeId}`,
});
},
}
}
</script>
<style lang='scss' scoped>
/* 商品列表 */
.goods-list {
display: flex;
flex-wrap: wrap;
margin: 10rpx 20rpx 284rpx;
width: 100%;
>.goods-item {
background-color: #ffffff;
display: flex;
border-radius: 16rpx;
flex-direction: column;
width: calc(50% - 30rpx);
margin-bottom: 20rpx;
padding-bottom: 20rpx;
&:nth-child(2n + 1) {
margin-right: 20rpx;
}
.image-wrapper {
width: 100%;
height: 330rpx;
border-radius: 16rpx 16rpx 0 0;
overflow: hidden;
padding: 0;
}
}
.count-config,
.store-seller-name {
font-size: $font-sm;
}
.text-hidden {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
}
.goods-row {
background: #fff;
padding: 16rpx;
>.goods-col {
display: flex;
>.goods-img {
overflow: hidden;
flex: 4;
}
>.goods-detail {
flex: 7;
}
}
}
.goods-detail {
margin: 0 20rpx;
>.title {
font-size: $font-base;
color: $font-color-dark;
line-height: 1.5;
height: 86rpx;
padding: 10rpx 0 0;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
overflow: hidden;
}
.promotion {
margin-top: 4rpx;
display: flex;
div {
span {
font-size: 24rpx;
color: $light-color;
margin-right: 10rpx;
padding: 0 4rpx;
border-radius: 2rpx;
}
}
}
.store-seller-name {
color: #666;
overflow: hidden;
display: flex;
justify-content: space-between;
}
.count-config {
padding: 5rpx 0;
color: #666;
display: flex;
font-size: 24rpx;
justify-content: space-between;
}
>.price-box {
margin-top: 10rpx;
display: flex;
align-items: center;
justify-content: space-between;
padding-right: 10rpx;
font-size: 24rpx;
color: $font-color-light;
>.price {
font-size: 26rpx;
line-height: 1;
color: $main-color;
font-weight: bold;
/deep/ span:nth-of-type(1) {
font-size: 38rpx;
}
}
}
}
</style>

View File

@@ -0,0 +1,166 @@
<template>
<div>
<div v-for="(item, index) in res" :key="index" class="goods-row" @click="navigateToDetailPage(item)">
<div class="flex goods-col">
<div class="goods-img">
<u-image width="230rpx" border-radius='16' height="230rpx" :src="item.goodsImage || item.thumbnail">
<u-loading slot="loading"></u-loading>
</u-image>
</div>
<div class="goods-detail">
<div class="title clamp3">{{ item.goodsName }}</div>
<div class='flex flex-a-c flex-j-sb'>
<view class="price-box">
<!-- 秒杀 / 拼团 -->
<div class="price" v-if="!type && item.price!=undefined">
¥<span>{{ $options.filters.goodsFormatPrice(item.price )[0] }} </span>.{{
$options.filters.goodsFormatPrice(item.price )[1]
}}
</div>
<!-- 砍价 -->
<div class="price" v-if="type && item.purchasePrice!=undefined">
最低
¥<span>{{ $options.filters.goodsFormatPrice(item.purchasePrice )[0] }} </span>.{{
$options.filters.goodsFormatPrice(item.purchasePrice )[1]
}}
</div>
</view>
<div>
<image class='buy' :src="buy"></image>
</div>
</div>
<div class='count-config' v-if="!type">
<span>即将恢复{{ item.originalPrice}}</span>
</div>
</div>
</div>
</div>
</div>
</template>
<script>
import commonTpl from '@/components/m-goods-list/common'
export default {
data() {
return {
lightColor: this.$mainColor,
buy: require('@/static/buy.png')
}
},
mixins: [commonTpl],
props: {
// 遍历的数据
res: {
type: Array,
default: () => {
return []
}
},
type:{
type:null,
default:""
}
},
methods: {
// 跳转到商品详情
navigateToDetailPage(item) {
if(this.type == 'kanJia'){
uni.navigateTo({
url: `/pages/promotion/bargain/detail?id=${item.id}`,
});
return
}
uni.navigateTo({
url: `/pages/product/goods?id=${item.skuId}&goodsId=${item.goodsId}`,
});
},
}
}
</script>
<style lang='scss' scoped>
.buy {
width: 152rpx;
height: 108rpx;
}
.flex-j-sb {
width: 100%;
}
.goods-row {
background: #fff;
padding: 16rpx;
>.goods-col {
display: flex;
>.goods-img {
overflow: hidden;
flex: 4;
}
>.goods-detail {
flex: 7;
}
}
}
.goods-detail {
margin: 0 20rpx;
>.title {
font-size: $font-base;
color: $font-color-dark;
line-height: 1.5;
height: 86rpx;
padding: 10rpx 0 0;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
overflow: hidden;
}
.promotion {
margin-top: 4rpx;
display: flex;
div {
span {
font-size: 24rpx;
color: $light-color;
margin-right: 10rpx;
padding: 0 4rpx;
border-radius: 2rpx;
}
}
}
.count-config {
padding: 5rpx 0;
color: #666;
display: flex;
font-size: 24rpx;
letter-spacing:2rpx;
padding-left: 10rpx;
}
}
.price-box {
margin-top: 10rpx;
display: flex;
align-items: center;
justify-content: space-between;
padding-right: 10rpx;
font-size: 24rpx;
color: $font-color-light;
>.price {
font-size: 26rpx;
line-height: 1;
color: $main-color;
font-weight: bold;
/deep/ span:nth-of-type(1) {
font-size: 48rpx;
}
}
}
</style>

View File

@@ -1,27 +1,11 @@
<template> <template>
<div> <div>
<div class="goods-recommend">{{title ? `--${title}-- `:''}}</div> <div class="goods-recommend">{{title ? `--${title}-- `:''}}</div>
<div class="goods-list"> <goodsTemplate :res='goodsList' />
<div @click="handleClick(item)" class="goods-item" v-for="(item, item_index) in goodsList" :key="item_index">
<div class="goods-img">
<u-image :src="item.content.thumbnail" mode="aspectFill" height="350rpx" width="100%">
<u-loading slot="loading"></u-loading>
</u-image>
</div>
<div class="goods-desc">
<div class="goods-title">
{{ item.content.goodsName }}
</div>
<div class="goods-bottom">
<div class="goods-price">{{ item.content.price | unitPrice }}</div>
</div>
</div>
</div>
</div>
</div> </div>
</template> </template>
<script> <script>
import goodsTemplate from '@/components/m-goods-list/list'
import { getGoodsList } from "@/api/goods.js"; import { getGoodsList } from "@/api/goods.js";
export default { export default {
data() { data() {
@@ -50,6 +34,7 @@ export default {
default: "", default: "",
}, },
}, },
components:{goodsTemplate},
mounted() { mounted() {
this.initGoods(); this.initGoods();
}, },

View File

@@ -8,7 +8,7 @@
<view class="share-list"> <view class="share-list">
<!-- #ifdef MP-WEIXIN --> <!-- #ifdef MP-WEIXIN -->
<view class="share-item"> <view class="share-item">
<button class="share-btn" open-type="share"> <button class="share-btn" @click="weChatShare" open-type="share">
<u-icon color="#04BE02" size="80" name="weixin-fill"></u-icon>微信好友 <u-icon color="#04BE02" size="80" name="weixin-fill"></u-icon>微信好友
</button> </button>
</view> </view>
@@ -19,7 +19,7 @@
<view>{{ item.title }}</view> <view>{{ item.title }}</view>
</view> </view>
<!-- #endif --> <!-- #endif -->
<!-- #ifdef H5 --> <!-- #ifdef H5 -->
<view class="share-item" @click="copyLink()"> <view class="share-item" @click="copyLink()">
<u-icon color="#b4aee8" size="80" name="share-fill"></u-icon> <u-icon color="#b4aee8" size="80" name="share-fill"></u-icon>
<view>{{ '复制链接' }}</view> <view>{{ '复制链接' }}</view>
@@ -62,6 +62,16 @@ export default {
close() { close() {
this.$emit("close"); this.$emit("close");
}, },
weChatShare(){
this.$u.mpShare = {
title: this.shareTitle(), // 默认为小程序名称,可自定义
path: '', // 默认为当前页面路径一般无需修改QQ小程序不支持
// 分享图标,路径可以是本地文件路径、代码包文件路径或者网络图片路径。
// 支持PNG及JPG默认为当前页面的截图
imageUrl: this.thumbnail ||''
}
},
// h5复制链接 // h5复制链接
// #ifdef H5 // #ifdef H5
copyLink() { copyLink() {
@@ -93,13 +103,13 @@ export default {
shareTitle() { shareTitle() {
let shareTitle; let shareTitle;
if (this.type == "goods") { if (this.type == "goods") {
shareTitle = `我发现了一个${this.goodsName}商品快来跟我一起看看吧`; shareTitle = `[好友推荐]${this.goodsName}快来跟我一起看看吧`;
} else if (this.type == "shops") { } else if (this.type == "shops") {
shareTitle = `我发现了一个${this.goodsName}店铺快来跟我一起看看吧`; shareTitle = `[好友发现]${this.goodsName}快来跟我一起看看吧`;
} else if (this.type == "pintuan") { } else if (this.type == "pintuan") {
shareTitle = `我拼了一个${this.goodsName}快来跟我一起抢购吧!`; shareTitle = `[好友邀请]${this.goodsName}快来跟我一起抢购吧!`;
} else if (this.type == "kanjia") { } else if (this.type == "kanjia") {
shareTitle = `请快来帮我砍一刀${this.goodsName}`; shareTitle = `[好友邀请]请快来帮我砍一刀${this.goodsName}`;
} }
return shareTitle; return shareTitle;
}, },

View File

@@ -4,12 +4,8 @@
*/ */
// 开发环境 // 开发环境
const dev = { const dev = {
// common: "https://common-api.pickmall.cn", common: "https://common-api.pickmall.cn",
// buyer: "https://buyer-api.pickmall.cn", buyer: "https://buyer-api.pickmall.cn",
common: "http://192.168.111:8890",
buyer: "http://192.168.111:8888",
}; };
// 生产环境 // 生产环境
const prod = { const prod = {

View File

@@ -1,16 +1,24 @@
const name = "lilishop"; //全局商城name const name = "lilishop"; //全局商城name
const schemeName = 'lilishop' //唤醒app需要的schemeName const schemeName = "lilishop"; //唤醒app需要的schemeName
export default { export default {
name: name, name: name,
schemeLink: `${schemeName}://`, //唤起app地址 schemeLink: `${schemeName}://`, //唤起app地址
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可在「微信公众平台 - 设置 - 开发设置」页中获得。(需要已经成为开发者,且帐号没有异常状态)
appSecret: "6dfbe0c72380dce5d49d65b3c91059b1", //可在 manifest.json 查看 aMapKey: "d649892b3937a5ad20b76dacb2bcb5bd", //在高德中申请Web服务key
aMapKey: "d649892b3937a5ad20b76dacb2bcb5bd", //在高德中申请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地址
}; enableGetClipboard: true, //是否启用粘贴板获取 scanAuthNavigation 中的链接,如果匹配则会跳转到对应页面
enableMiniBarStartUpApp: true, //是否在h5中右侧浮空按钮点击启动app
/**
* 如需更换主题请修改此处以及uni.scss中的全局颜色
*/
mainColor: "#ff3c2a", // 主题色
lightColor: "#ff6b35", // 高亮主题色
aiderLightColor: "#ff9f28", // 辅助高亮颜色
};

20
main.js
View File

@@ -3,19 +3,23 @@ import App from "./App";
import * as filters from "./utils/filters.js"; // global filter import * as filters from "./utils/filters.js"; // global filter
import uView from "uview-ui"; import uView from "uview-ui";
import store from "./store"; import store from "./store";
import config from '@/config/config';
import airBtn from "@/components/m-airbtn/index.vue";
/** /**
* 仅在h5中显示唤醒app功能 * 仅在h5中显示唤醒app功能
* 在h5页面手动挂载 * 在h5页面手动挂载
* *
*/ */
// #ifdef H5 // #ifdef H5
import airBtn from "@/components/m-airbtn/index.vue"; 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);
}
// #endif // #endif
// 引入uView对小程序分享的mixin封装
let mpShare = require('uview-ui/libs/mixin/mpShare.js');
Vue.mixin(mpShare)
/** /**
* 全局filters * 全局filters
@@ -38,11 +42,11 @@ Vue.config.productionTip = false;
* 如需更换主题请修改此处以及uni.scss中的全局颜色 * 如需更换主题请修改此处以及uni.scss中的全局颜色
*/ */
// 主题色 // 主题色
Vue.prototype.$mainColor = "#ff3c2a"; Vue.prototype.$mainColor = config.mainColor;
// 高亮主题色 // 高亮主题色
Vue.prototype.$lightColor = "#ff6b35"; Vue.prototype.$lightColor = config.lightColor;
// 辅助高亮颜色 // 辅助高亮颜色
Vue.prototype.$aiderLightColor = "#ff9f28"; Vue.prototype.$aiderLightColor = config.aiderLightColor;
App.mpType = "app"; App.mpType = "app";

View File

@@ -1,9 +1,9 @@
{ {
"name" : "lili商城", "name" : "lili商城",
"appid" : "__UNI__C100675", "appid" : "__UNI__EC9FD60",
"description" : "", "description" : "",
"versionName" : "4.0.49", "versionName" : "4.2.7",
"versionCode" : 4000049, "versionCode" : 4000270,
"transformPx" : false, "transformPx" : false,
"app-plus" : { "app-plus" : {
"compatible" : { "compatible" : {
@@ -63,7 +63,16 @@
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>" "<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
], ],
"abiFilters" : [ "armeabi-v7a", "arm64-v8a", "x86" ], "abiFilters" : [ "armeabi-v7a", "arm64-v8a", "x86" ],
"schemes" : "lilishop" "schemes" : "lilishop",
"permissionExternalStorage" : {
"request" : "none",
"prompt" : "应用保存运行状态等信息,需要获取读写手机存储(系统提示为访问设备上的照片、媒体内容和文件)权限,请允许。"
},
"permissionPhoneState" : {
"request" : "none",
"prompt" : "为保证您正常、安全地使用,需要获取设备识别码(部分手机提示为获取手机号码)使用权限,请允许"
},
"autoSdkPermissions" : false
}, },
"ios" : { "ios" : {
"idfa" : false, "idfa" : false,
@@ -75,7 +84,8 @@
"NSLocationAlwaysAndWhenInUseUsageDescription" : "位置信息将用于高德地图的效果展示", "NSLocationAlwaysAndWhenInUseUsageDescription" : "位置信息将用于高德地图的效果展示",
"NSMicrophoneUsageDescription" : "用户上传视频时需使用音频信息" "NSMicrophoneUsageDescription" : "用户上传视频时需使用音频信息"
}, },
"urltypes" : "lilishop" "urltypes" : "lilishop",
"dSYMs" : false
}, },
/* ios */ /* ios */
"sdkConfigs" : { "sdkConfigs" : {
@@ -195,10 +205,6 @@
} }
}, },
"plugins" : { "plugins" : {
"myPlugin" : {
"version" : "1.1.0",
"provider" : "wx738958e0f4c894f9"
},
"live-player-plugin" : { "live-player-plugin" : {
"version" : "1.3.0", "version" : "1.3.0",
"provider" : "wx2b03c6e691cd7370" "provider" : "wx2b03c6e691cd7370"

View File

@@ -14,7 +14,24 @@
"enablePullDownRefresh":true "enablePullDownRefresh":true
} }
}, },
{
"path":"pages/tabbar/screen/fullScreen",
"style": {
"navigationStyle": "custom", // 隐藏系统导航栏
"app-plus":{
"animationType": "fade-in", // 设置fade-in淡入动画为最合理的动画类型
"background": "transparent", // 背景透明
"backgroundColor": "rgba(0,0,0,0)", // 背景透明
"popGesture": "none" // 关闭IOS屏幕左边滑动关闭当前页面的功能
}
}
},
{
"path": "pages/tabbar/home/title",
"style": {
"navigationBarTitleText": "消息"
}
},
{ {
"path": "pages/tabbar/cart/cartList", "path": "pages/tabbar/cart/cartList",
"style": { "style": {
@@ -68,6 +85,12 @@
"style": { "style": {
} }
},
{
"path": "pages/tabbar/special/special",
"style": {
"navigationBarTitleText": "专题"
}
} }
], ],
@@ -233,6 +256,8 @@
"navigationBarTitleText": "面容登录" "navigationBarTitleText": "面容登录"
} }
}, },
{ {
"path": "set/securityCenter/editPassword", "path": "set/securityCenter/editPassword",
"style": { "style": {
@@ -444,6 +469,14 @@
"navigationStyle": "custom", "navigationStyle": "custom",
"navigationBarTextStyle": "black" "navigationBarTextStyle": "black"
} }
},
{
"path": "scannerCodeLoginConfirm",
"style": {
"navigationBarTitleText": "扫码登录",
"navigationStyle": "custom",
"navigationBarTextStyle": "black"
}
} }
] ]
@@ -455,6 +488,8 @@
"path": "seckill", "path": "seckill",
"style": { "style": {
"navigationBarTitleText": "限时抢购", "navigationBarTitleText": "限时抢购",
"navigationStyle": "custom", // 隐藏系统导航栏
"navigationBarTextStyle": "white" ,
"app-plus": { "app-plus": {
"titleNView": { "titleNView": {
"homeButton":true "homeButton":true
@@ -468,6 +503,7 @@
"style": { "style": {
"navigationBarTitleText": "拼团活动", "navigationBarTitleText": "拼团活动",
"navigationStyle": "custom", // 隐藏系统导航栏 "navigationStyle": "custom", // 隐藏系统导航栏
"navigationBarTextStyle": "white" ,
"app-plus": { "app-plus": {
// 将回弹属性关掉 // 将回弹属性关掉
"bounce": "none" "bounce": "none"

View File

@@ -1,299 +1,294 @@
<template> <template>
<view class="coupon-center"> <view class="coupon-center">
<swiper class="swiper-box"> <div class="swiper-box">
<swiper-item class="swiper-item"> <div class="swiper-item">
<scroll-view class="scroll-v" enableBackToTop="true" scroll-y @scrolltolower="loadMore"> <div class="scroll-v" enableBackToTop="true" scroll-y>
<u-empty mode="coupon" text="没有优惠券了" v-if="whetherEmpty"></u-empty> <u-empty mode="coupon" style='margin-top: 20%;' text="没有优惠券了" v-if="whetherEmpty"></u-empty>
<view v-else class="coupon-item" v-for="(item, index) in couponList" :key="index"> <view v-else class="coupon-item" v-for="(item, index) in couponList" :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> <view>
<!--判断当前优惠券类型 couponType PRICE || DISCOUNT --> <!--判断当前优惠券类型 couponType PRICE || DISCOUNT -->
<span v-if="item.couponType == 'DISCOUNT'">{{ item.couponDiscount }}</span> <span v-if="item.couponType == 'DISCOUNT'">{{ item.couponDiscount }}</span>
<span v-else>{{ item.price }}</span> <span v-else>{{ item.price }}</span>
</view> </view>
<view>{{ item.consumeThreshold | unitPrice }}元可用</view> <view>{{ item.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>
</view> </view>
<view class="right"> <view class="right">
<view> <view>
<!-- 根据scopeType 判断是否是 平台品类或店铺 --> <!-- 根据scopeType 判断是否是 平台品类或店铺 -->
<view v-if="item.scopeType"> <view class="coupon-title wes-3" v-if="item.scopeType">
<span v-if="item.scopeType == 'ALL' && item.id == 'platform'">全平台</span> <span v-if="item.scopeType == 'ALL' && item.storeId == '0'">全平台</span>
<span v-if="item.scopeType == 'PORTION_CATEGORY'">仅限品类</span> <span v-if="item.scopeType == 'PORTION_CATEGORY'">仅限品类</span>
<view v-else>{{ item.storeName == 'platform' ? '全平台' :item.storeName+'店铺' }}使用</view> <view v-else>{{ item.storeName == 'platform' ? '全平台' :item.storeName+'店铺' }}使用
</view> </view>
<view v-if="item.endTime">有效期至:{{ item.endTime.split(" ")[0] }}</view> </view>
</view> <view v-if="item.endTime">有效期至:{{ item.endTime.split(" ")[0] }}</view>
<view class="receive" @click="receive(item)"> </view>
<text>点击</text><br /> <view class="receive" @click="receive(item)">
<text>领取</text> <text>点击</text><br />
</view> <text>领取</text>
<view class="bg-quan"> </view> </view>
</view> <view class="bg-quan"> </view>
</view> </view>
<uni-load-more :status="loadStatus"></uni-load-more> </view>
</scroll-view>
</swiper-item> </div>
</swiper> </div>
</view> </div>
</view>
</template> </template>
<script> <script>
import { receiveCoupons } from "@/api/members.js"; import {
import { getAllCoupons } from "@/api/promotions.js"; receiveCoupons
export default { } from "@/api/members.js";
data() { import {
return { getAllCoupons
loadStatus: "more", //下拉状态 } from "@/api/promotions.js";
whetherEmpty: false, //是否为空 export default {
couponList: [], // 优惠券列表 data() {
params: { return {
pageNumber: 1, loadStatus: "more", //下拉状态
pageSize: 10, whetherEmpty: false, //是否为空
}, couponList: [], // 优惠券列表
storeId: "", //店铺 id params: {
}; pageNumber: 1,
}, pageSize: 10,
onLoad(option) { },
this.storeId = option.storeId; storeId: "", //店铺 id,
this.getCoupon(); couponData: ""
}, };
onPullDownRefresh() { },
//下拉刷新 onLoad(option) {
this.params.pageNumber = 1; this.storeId = option.storeId;
this.couponList = []; this.getCoupon();
this.getCoupon(); },
}, onReachBottom() {
methods: {
/** this.loadMore()
* 获取当前优惠券 },
*/ onPullDownRefresh() {
getCoupon() { //下拉刷新
uni.showLoading({ this.params.pageNumber = 1;
title: "加载中", this.couponList = [];
}); this.getCoupon();
let submitData = { ...this.params }; },
// 判断当前是否有店铺 methods: {
this.storeId ? (submitData = { ...this.params, storeId: this.storeId }): "", /**
getAllCoupons(submitData) * 获取当前优惠券
.then((res) => { */
uni.hideLoading(); getCoupon() {
uni.stopPullDownRefresh(); uni.showLoading({
if (res.data.code == 200) { title: "加载中",
// 如果请求成功,展示数据并进行展示 });
let data = res.data.result; let submitData = {
if (data.total == 0) { ...this.params
// 当本次请求数据为空展示空信息 };
this.whetherEmpty = true; // 判断当前是否有店铺
} else { this.storeId ? (submitData = {
this.couponList.push(...data.records); ...this.params,
this.loadStatus = "noMore"; storeId: this.storeId
} }) : "",
} getAllCoupons(submitData)
}) .then((res) => {
.catch((err) => { uni.hideLoading();
uni.hideLoading(); uni.stopPullDownRefresh();
}); if (res.data.code == 200) {
}, // 如果请求成功,展示数据并进行展示
/** this.couponData = res.data.result
* 领取优惠券 if (this.couponData.total == 0) {
*/ // 当本次请求数据为空展示空信息
receive(item) { this.whetherEmpty = true;
receiveCoupons(item.id).then((res) => { } else {
if (res.data.code == 200) { this.couponList.push(...this.couponData.records);
uni.showToast({ this.loadStatus = "noMore";
title: "领取成功", }
icon: "none", }
}); })
} else { .catch((err) => {
uni.showToast({ uni.hideLoading();
title: res.data.message, });
icon: "none", },
}); /**
} * 领取优惠券
}); */
}, receive(item) {
/** receiveCoupons(item.id).then((res) => {
* 加载更多 if (res.data.code == 200) {
*/ uni.showToast({
loadMore() { title: "领取成功",
if (this.loadStatus != "noMore") { icon: "none",
this.params.pageNumber++; });
this.getAllCoupons(); } else {
} uni.showToast({
}, title: res.data.message,
}, icon: "none",
onNavigationBarButtonTap(e) { });
uni.navigateTo({ }
url: "/pages/cart/coupon/couponIntro", });
}); },
}, /**
}; * 加载更多
*/
loadMore() {
if (this.couponData.total > this.params.pageNumber * this.params.pageSize) {
this.params.pageNumber++;
this.getCoupon();
}
},
},
onNavigationBarButtonTap(e) {
uni.navigateTo({
url: "/pages/cart/coupon/couponIntro",
});
},
};
</script> </script>
<style> <style>
page { page {
height: 100%; height: 100%;
} }
</style> </style>
<style lang="scss" scoped> <style lang="scss" scoped>
.coupon-center { .coupon-center {
height: 100%; height: 100%;
.couponList-scroll-content { .swiper-box {
position: relative; .coupon-item {
width: 100%; display: flex;
display: flex; align-items: center;
white-space: nowrap; height: 220rpx;
align-items: center; margin: 20rpx;
justify-content: space-between;
align-items: center;
background-color: $main-color;
color: #ffffff;
.tab-item { .left {
width: 160rpx; height: 100%;
height: 80rpx; width: 260rpx;
line-height: 60rpx; background-color: $light-color;
text-align: center; position: relative;
display: inline-block;
}
.active { .message {
border-bottom: 2px solid #ffffff; color: $font-color-white;
broder-width: 60rpx; display: flex;
font-size: 30rpx; justify-content: center;
font-weight: 700; align-items: center;
padding-bottom: 4rpx; flex-direction: column;
} margin-top: 40rpx;
}
.swiper-box { view:nth-child(1) {
height: 100%; font-weight: bold;
font-size: 60rpx;
}
.scroll-v { view:nth-child(2) {
height: 100%; font-size: $font-sm;
} }
}
.coupon-item { .wave-line {
display: flex; height: 220rpx;
align-items: center; width: 8rpx;
height: 220rpx; position: absolute;
margin: 20rpx; top: 0;
left: 0;
background-color: $light-color;
overflow: hidden;
.left { .wave {
height: 100%; width: 8rpx;
width: 260rpx; height: 16rpx;
background-color: $light-color; background-color: #ffffff;
position: relative; border-radius: 0 16rpx 16rpx 0;
.message { margin-top: 4rpx;
color: $font-color-white; }
display: flex; }
justify-content: center;
align-items: center;
flex-direction: column;
margin-top: 40rpx;
view:nth-child(1) { .circle {
font-weight: bold; width: 40rpx;
font-size: 60rpx; height: 40rpx;
} background-color: $bg-color;
position: absolute;
border-radius: 50%;
z-index: 111;
}
view:nth-child(2) { .circle-top {
font-size: $font-sm; top: -20rpx;
} right: -20rpx;
} }
.wave-line { .circle-bottom {
height: 220rpx; bottom: -20rpx;
width: 8rpx; right: -20rpx;
position: absolute; }
top: 0; }
left: 0;
background-color: $light-color;
overflow: hidden;
.wave { .right {
width: 8rpx; display: flex;
height: 16rpx; justify-content: space-between;
background-color: #ffffff; align-items: center;
border-radius: 0 16rpx 16rpx 0; width: 450rpx;
margin-top: 4rpx; font-size: $font-sm;
} height: 100%;
} background-color: #ffffff;
.circle { overflow: hidden;
width: 40rpx; position: relative;
height: 40rpx;
background-color: $bg-color;
position: absolute;
border-radius: 50%;
z-index: 111;
}
.circle-top {
top: -20rpx;
right: -20rpx;
}
.circle-bottom {
bottom: -20rpx;
right: -20rpx;
}
}
.right { >view:nth-child(1) {
display: flex; color: #666666;
justify-content: space-between; margin-left: 20rpx;
align-items: center; display: flex;
width: 450rpx; height: 100%;
font-size: $font-sm; flex-direction: column;
height: 100%; justify-content: space-around;
background-color: #ffffff;
overflow: hidden;
position: relative;
> view:nth-child(1) {
color: #666666;
margin-left: 20rpx;
line-height: 3em;
> view:nth-child(1) {
color: #ff6262;
font-size: 30rpx;
}
}
.receive { >view:nth-child(1) {
color: #ffffff; color: #ff6262;
background-color: $main-color; font-size: 30rpx;
border-radius: 50%; }
width: 86rpx; }
height: 86rpx;
text-align: center;
margin-right: 30rpx;
vertical-align: middle;
padding-top: 8rpx;
position: relative;
z-index: 2;
}
.bg-quan { .receive {
width: 244rpx; color: #ffffff;
height: 244rpx; background-color: $main-color;
border: 6rpx solid $main-color; border-radius: 50%;
border-radius: 50%; width: 86rpx;
opacity: 0.1; height: 86rpx;
color: $main-color; text-align: center;
text-align: center; margin-right: 30rpx;
padding-top: 30rpx; vertical-align: middle;
font-size: 130rpx; padding-top: 8rpx;
position: absolute; position: relative;
right: -54rpx; z-index: 2;
bottom: -60rpx; }
}
} .bg-quan {
} width: 244rpx;
} height: 244rpx;
} border: 6rpx solid $main-color;
border-radius: 50%;
opacity: 0.1;
color: $main-color;
text-align: center;
padding-top: 30rpx;
font-size: 130rpx;
position: absolute;
right: -54rpx;
bottom: -60rpx;
}
}
}
}
}
.coupon-title {
width: 260rpx;
}
</style> </style>

View File

@@ -14,7 +14,7 @@
</view> </view>
<view class="bottom-view"> <view class="bottom-view">
<view class="text"> 使用平台{{ <view class="text"> 使用平台{{
coupon.scopeType == 'ALL' && coupon.id == 'platform' coupon.scopeType == 'ALL' && coupon.storeId == '0'
? "全平台" ? "全平台"
: coupon.scopeType == "PORTION_CATEGORY" : coupon.scopeType == "PORTION_CATEGORY"
? "仅限品类" ? "仅限品类"

View File

@@ -34,7 +34,7 @@
<view class="right"> <view class="right">
<view class="desc"> <view class="desc">
<view v-if="item.scopeType"> <view v-if="item.scopeType">
<span v-if="item.scopeType == 'ALL' && item.id == 'platform'">全平台</span> <span v-if="item.scopeType == 'ALL' && item.storeId == '0'">全平台</span>
<span v-if="item.scopeType == 'PORTION_CATEGORY'">仅限品类</span> <span v-if="item.scopeType == 'PORTION_CATEGORY'">仅限品类</span>
<view v-else <view v-else
>{{ >{{

View File

@@ -32,7 +32,7 @@
<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.id == 'platform' coupon.scopeType == 'ALL' && coupon.storeId == '0'
? "全平台" ? "全平台"
: coupon.scopeType == "PORTION_CATEGORY" : coupon.scopeType == "PORTION_CATEGORY"
? "仅限品类" ? "仅限品类"
@@ -188,7 +188,7 @@ export default {
* 立即使用优惠券 * 立即使用优惠券
*/ */
useItNow(item) { useItNow(item) {
if (item.storeId && item.storeId!='platform') { if (item.storeId && item.storeId!='0') {
uni.navigateTo({ uni.navigateTo({
url: `/pages/product/shopPage?id=${item.storeId}`, url: `/pages/product/shopPage?id=${item.storeId}`,
}); });

View File

@@ -98,18 +98,18 @@
}, },
onBackPress(e) { onBackPress(e) {
if (e.from == "backbutton") { if (e.from == "backbutton") {
if(this.routerVal.recharge_sn){ if(this.routerVal.recharge_sn){
uni.switchTab({ uni.switchTab({
url: '/pages/tabbar/user/my' url: '/pages/tabbar/user/my'
}); });
} }
else{ else{
uni.redirectTo({ uni.navigateTo({
url: "/pages/order/myOrder?status=0", url: "/pages/order/myOrder?status=0",
}); });
} }
return true; //阻止默认返回行为 return true; //阻止默认返回行为
} }
}, },
mounted() { mounted() {
this.cashierData(); this.cashierData();
@@ -139,6 +139,7 @@
// 判断当前是否是充值 // 判断当前是否是充值
this.sn = this.routerVal.recharge_sn; this.sn = this.routerVal.recharge_sn;
this.orderType = "RECHARGE"; this.orderType = "RECHARGE";
} else if (this.routerVal.trade_sn) { } else if (this.routerVal.trade_sn) {
this.sn = this.routerVal.trade_sn; this.sn = this.routerVal.trade_sn;
this.orderType = "TRADE"; this.orderType = "TRADE";
@@ -161,16 +162,16 @@
}); });
// #endif // #endif
// #ifndef MP-WEIXIN
if(this.routerVal.recharge_sn){ if(this.routerVal.recharge_sn){
this.payList = res.data.result.support.filter((item) => { this.payList = res.data.result.support.filter((item) => {
return item != "WALLET"; return item != "WALLET";
}) })
} }
else{ else{
this.payList = res.data.result.support; this.payList = res.data.result.support;
} }
// #ifndef APP-PLUS // #ifdef H5
//判断是否微信浏览器 //判断是否微信浏览器
var ua = window.navigator.userAgent.toLowerCase(); var ua = window.navigator.userAgent.toLowerCase();
if (ua.match(/MicroMessenger/i) == 'micromessenger') { if (ua.match(/MicroMessenger/i) == 'micromessenger') {
@@ -178,11 +179,17 @@
this.payList = res.data.result.support.filter((item) => { this.payList = res.data.result.support.filter((item) => {
return item != "ALIPAY"; return item != "ALIPAY";
}); });
// 充值的话仅保留微信支付
if(this.orderType == "RECHARGE"){
this.payList = res.data.result.support.filter((item) => {
return item == "WECHAT";
});
}
} }
// #endif // #endif
// #endif
this.walletValue = res.data.result.walletValue; this.walletValue = res.data.result.walletValue;
@@ -226,13 +233,18 @@
const paymentMethod = payment; const paymentMethod = payment;
// 客户端类型 APP/NATIVE/JSAPI/H5 // 客户端类型 APP/NATIVE/JSAPI/H5
const paymentClient = this.paymentClient; const paymentClient = this.paymentClient;
uni.showLoading({
title: "正在唤起支付...",
mask:true
});
// #ifdef APP-PLUS // #ifdef APP-PLUS
//APP pay //APP pay
// 初始化支付签名 // 初始化支付签名
await API_Trade.initiatePay(paymentMethod, paymentClient, params).then( await API_Trade.initiatePay(paymentMethod, paymentClient, params).then(
(signXml) => { (signXml) => {
uni.hideLoading();
//如果支付异常 //如果支付异常
if (!signXml.data.success) { if (!signXml.data.success) {
uni.showToast({ uni.showToast({
@@ -241,33 +253,39 @@
}); });
return; return;
} }
let payForm = signXml.data.result; let payForm = signXml.data.result;
let paymentType = paymentMethod === "WECHAT" ? "wxpay" : "alipay"; let paymentType = paymentMethod === "WECHAT" ? "wxpay" : "alipay";
uni.requestPayment({
provider: paymentType, if(paymentMethod === "WALLET"){
orderInfo: payForm, uni.showToast({
success: (e) => { icon: "none",
console.log(e); title: "支付成功!",
uni.showToast({ });
icon: "none", this.callback(paymentMethod)
title: "支付成功!", }
}); else{
uni.requestPayment({
this.callback(paymentMethod) provider: paymentType,
orderInfo: payForm || '',
success: (e) => {
}, uni.showToast({
fail: (e) => { icon: "none",
console.log(this); title: "支付成功!",
this.exception = e; });
uni.showModal({ this.callback(paymentMethod)
content: "支付失败,如果您已支付,请勿反复支付", },
showCancel: false, fail: (e) => {
}); console.log(this);
}, this.exception = e;
}); uni.showModal({
content: "支付失败,如果您已支付,请勿反复支付",
showCancel: false,
});
},
});
}
} }
); );
//APP pay //APP pay

View File

@@ -2,9 +2,11 @@
<view class="add-address"> <view class="add-address">
<div class="uForm"> <div class="uForm">
<u-form :border-bottom="false" :model="form" ref="uForm" :error-type="['toast']" :rule="rules"> <u-form :border-bottom="false" :model="form" ref="uForm" :error-type="['toast']" :rule="rules">
<!-- #ifndef H5 -->
<view class="selectAddress" @click="clickUniMap"> <view class="selectAddress" @click="clickUniMap">
选择收货地址 选择收货地址
</view> </view>
<!-- #endif -->
<u-form-item class="border" label="收货人" label-width="130" prop="name"> <u-form-item class="border" label="收货人" label-width="130" prop="name">
<u-input v-model="form.name" clearable placeholder="请输入收货人姓名" /> <u-input v-model="form.name" clearable placeholder="请输入收货人姓名" />
</u-form-item> </u-form-item>
@@ -160,9 +162,7 @@ export default {
delete this.form.updateTime; delete this.form.updateTime;
editAddress(this.form).then((res) => { editAddress(this.form).then((res) => {
if (res.data.success) { if (res.data.success) {
uni.navigateTo({ uni.navigateBack();
url: `/${beforePage.route}`,
});
} }
}); });
} }

View File

@@ -86,23 +86,9 @@ export default {
* 进入页面检测当前账户是否登录 * 进入页面检测当前账户是否登录
*/ */
onShow() { onShow() {
let that = this; if (this.$options.filters.tipsToLogin()) {
if (this.$options.filters.isLogin("auth")) {
this.getAddressList(); this.getAddressList();
} else { }
uni.showModal({
title: "提示",
content: "检测到您的账号还未登录,是否去登录?",
confirmColor: this.$lightColor,
success: function (res) {
if (res.confirm) {
that.$options.filters.navigateToLogin();
} else if (res.cancel) {
uni.navigateBack();
}
},
});
}
}, },
methods: { methods: {
//获取地址列表 //获取地址列表

View File

@@ -1,6 +1,6 @@
<template> <template>
<view class="wap"> <view class="wap">
<u-navbar back-text="" title="预存款列表"> <u-navbar title="预存款列表">
</u-navbar> </u-navbar>
<view class="wrapper-show-money"> <view class="wrapper-show-money">
<view class="money-view"> <view class="money-view">
@@ -28,7 +28,7 @@
</view> </view>
<u-empty v-if="datas.length==0" mode="history" text="暂无记录" /> <u-empty v-if="datas.length==0" mode="history" text="暂无记录" />
<u-loadmore v-else bg-color='#f8f8f8' :status="status" />
</scroll-view> </scroll-view>
</swiper-item> </swiper-item>
@@ -45,7 +45,7 @@ export default {
data() { data() {
return { return {
walletNum: 0, walletNum: 0,
status: "loadmore",
current: 0, current: 0,
swiperCurrent: 0, swiperCurrent: 0,
userInfo: "", //用户详情信息 userInfo: "", //用户详情信息
@@ -82,27 +82,23 @@ export default {
/**分页获取预存款充值记录 */ /**分页获取预存款充值记录 */
getRecharge() { getRecharge() {
this.status = "loading";
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.status = "loadmore";
this.datas.push(...res.data.result.records); this.datas.push(...res.data.result.records);
} else {
this.status = "nomore";
} }
} }
}); });
}, },
getWallet() { getWallet() {
this.status = "loading";
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.datas.push(...res.data.result.records);
} else {
this.status = "nomore";
} }
} }
}); });

View File

@@ -1,3 +1,4 @@
<template> <template>
<view> <view>
<view class="-list"> <view class="-list">
@@ -5,7 +6,8 @@
<view class="content"> <view class="content">
<view class="price"> <view class="price">
<span> </span> <span> </span>
<u-input v-model="price" placeholder="" type="number" /> <u-input v-model="price" placeholder='金额' type="number" />
</view> </view>
</view> </view>

View File

@@ -42,7 +42,6 @@
</view> </view>
<view class="log-item-footer"> <view class="log-item-footer">
<view>会员名称{{ item.memberName }}</view> <view>会员名称{{ item.memberName }}</view>
<view>订单金额{{ item.flowPrice | unitPrice }}</view>
</view> </view>
<view class="log-item-footers"> <view class="log-item-footers">
<view>订单号{{ item.orderSn }}</view> <view>订单号{{ item.orderSn }}</view>

View File

@@ -1,6 +1,6 @@
<template> <template>
<div class="wrapper"> <div class="wrapper">
<u-parse v-html="res.content"></u-parse> <u-parse :show-with-animation="true" :lazy-load="true" :selectable="true" :html="res.content"></u-parse>
</div> </div>
</template> </template>

View File

@@ -1,340 +1,259 @@
<template> <template>
<view class="myTracks"> <view class="myTracks">
<u-navbar title="我的足迹"> <u-navbar title="我的足迹">
<div @click="changeRightBtn" slot="right" style="margin-right:32rpx">
{{edit}}
</div>
</u-navbar>
<u-empty text="暂无历史记录" style="margin-top:200rpx;" mode="history" v-if="whetherEmpty"></u-empty>
<div v-else>
<view v-for="(item, index) in trackList" :key="index">
<view class="myTracks-title" @click="navgaiteToStore(item)">{{item.storeName}}</view>
<view class="myTracks-items">
<view class="myTracks-item">
<u-checkbox-group>
<u-checkbox v-model="item.___isDel" v-if="editFlag" active-color="#ff6b35" style="margin-right: 10rpx"
@change="changeChecked(item)"></u-checkbox>
</u-checkbox-group>
<view class="myTracks-item-img" @click.stop="navgaiteToDetail(item)">
<image :src="item.thumbnail"></image>
</view>
<view class="myTracks-item-content" @click.stop="navgaiteToDetail(item)">
<view class="myTracks-item-title">
{{ item.goodsName }}
<view class="myTracks-item-title-desc"> </view>
</view>
<view class="myTracks-item-price">
{{ item.price | unitPrice }}
</view>
</view>
</view>
</view>
<view class="myTracks-divider"></view>
</view> </u-navbar>
<uni-load-more :status="loadStatus"></uni-load-more> <u-empty text="暂无历史记录" style="margin-top:200rpx;" mode="history" v-if="whetherEmpty"></u-empty>
</div> <div v-else>
<view v-if="editFlag"> <view v-for="(item, index) in trackList" :key="index">
<view class="myTracks-action"> <view class="myTracks-title" @click="navgaiteToStore(item)">{{item.storeName}}</view>
<view class="myTracks-action-check"> <view class="myTracks-items">
<u-checkbox-group>
<u-checkbox v-model="allChecked" v-if="editFlag" active-color="#ff6b35" style="margin-right: 10rpx"
@change="checkedAllitem"></u-checkbox>
全选
</u-checkbox-group>
</view>
<view> <u-swipe-action style="width: 100%;" :show="item.show" :index="index" :key="item.id"
<u-button type="warning" @click="delAllTracks" class="myTracks-action-btn"> @click="delTracks" @open="open" :options="options">
删除 <view class="myTracks-item">
</u-button> <view class="myTracks-item-img" @click.stop="navgaiteToDetail(item)">
</view> <image :src="item.thumbnail"></image>
</view> </view>
</view> <view class="myTracks-item-content" @click.stop="navgaiteToDetail(item)">
</view> <view class="myTracks-item-title">
{{ item.goodsName }}
<view class="myTracks-item-title-desc"> </view>
</view>
<view class="myTracks-item-price">
{{ item.price | unitPrice }}
</view>
</view>
</view>
</u-swipe-action>
</view>
<view class="myTracks-divider"></view>
</view>
</div>
</view>
</template> </template>
<script> <script>
import { myTrackList, deleteHistoryListId } from "@/api/members.js"; import {
myTrackList,
deleteHistoryListId
} from "@/api/members.js";
export default { export default {
data() { data() {
return { return {
edit: "编辑",
editFlag: false, //是否编辑
allChecked: false, //是否全选
loadStatus: "more", //底部下拉加载状态
whetherEmpty: false, //是否数据为空
params: {
pageNumber: 1,
pageSize: 10,
},
trackList: [], //足迹列表 whetherEmpty: false, //是否数据为空
}; params: {
}, pageNumber: 1,
pageSize: 10,
order: "desc",
sort: "updateTime",
},
options: [{
text: '删除',
style: {
backgroundColor: '#dd524d'
}
}],
trackList: [], //足迹列表
};
},
/** /**
* 滑到底部加载下一页数据 * 滑到底部加载下一页数据
*/ */
onReachBottom() { onReachBottom() {
if (this.loadStatus != "noMore") { this.params.pageNumber++;
this.params.pageNumber++; this.getList();
this.getList(); },
} onShow() {
}, this.trackList = [];
onLoad() { this.getList();
this.getList(); },
}, onPullDownRefresh() {
onPullDownRefresh() { this.trackList = [];
this.trackList = []; this.getList();
this.getList(); },
}, methods: {
methods: { /**
/** * 导航到店铺
* 导航到店铺 */
*/ navgaiteToStore(val) {
navgaiteToStore(val) { uni.navigateTo({
uni.navigateTo({ url: "/pages/product/shopPage?id=" + val.storeId,
url: "/pages/product/shopPage?id=" + val.storeId, });
}); },
}, open(index) {
// 先将正在被操作的swipeAction标记为打开状态否则由于props的特性限制
// 原本为'false',再次设置为'false'会无效
this.trackList[index].show = true;
this.trackList.map((val, idx) => {
if (index != idx) this.trackList[idx].show = false;
})
},
/**
* 跳转详情
*/
navgaiteToDetail(item) {
uni.navigateTo({
url: "/pages/product/goods?id=" + item.id + "&goodsId=" + item.goodsId,
});
},
/** /**
* 设置右侧导航栏文本 * 获取我的足迹列表
*/ */
setStyle(text) { getList() {
//导航按钮文本设置 uni.showLoading({
let pages = getCurrentPages(); title: "加载中",
let page = pages[pages.length - 1]; });
// #ifdef APP-PLUS myTrackList(this.params).then((res) => {
let currentWebview = page.$getAppWebview(); uni.stopPullDownRefresh();
let titleNView = currentWebview.getStyle().titleNView; uni.hideLoading();
titleNView.buttons[0].text = text; if (res.statusCode == 200) {
if (text == "完成") { res.data.result.records.length &&
this.trackList.forEach((key) => { res.data.result.records.forEach((item) => {
key.history.forEach((item) => { item.show = false;
this.$set(item, "___isDel", false); });
});
});
}
currentWebview.setStyle({
titleNView: titleNView,
});
// #endif
// #ifdef H5
// h5 临时方案
document.getElementsByClassName("uni-btn-icon")[1].innerText = text;
// #endif
},
/** let data = res.data.result.records;
* 跳转详情 if (data.total == 0) {
*/ this.whetherEmpty = true;
navgaiteToDetail(item) { } else {
uni.navigateTo({ this.trackList.push(...data);
url: "/pages/product/goods?id=" + item.id + "&goodsId=" + item.goodsId, }
}); }
}, });
},
/**
* 获取我的足迹列表
*/
getList() {
uni.showLoading({
title: "加载中",
});
myTrackList(this.params).then((res) => {
uni.stopPullDownRefresh();
uni.hideLoading();
if (res.statusCode == 200) {
res.data.result &&
res.data.result.forEach((item) => {
item.___isDel = false;
});
let data = res.data.result; /**
if (data.total == 0) { * 删除足迹
this.whetherEmpty = true; */
} else if (data.total < 10) { delTracks(index) {
this.loadStatus = "noMore"; deleteHistoryListId(this.trackList[index].goodsId).then((res) => {
this.trackList.push(...data); if (res.data.code == 200) {
} else { this.trackList = [];
this.trackList.push(...data); this.getList();
if (data.length < 10) this.loadStatus = "noMore"; } else {
} uni.showToast({
} title: res.data.message,
}); duration: 2000,
}, icon: "none",
});
/** }
* 点击后判断是不是全选 });
*/ },
},
changeChecked(val) { };
var opt = null;
const isCheckedAll = this.trackList.every((key) => {
key.___isDel == val.___isDel;
opt = key.___isDel;
return opt;
});
if(opt){
this.allChecked = isCheckedAll;
}else{
this.allChecked = false;
}
},
/**
* 右侧标签栏切换
*/
changeRightBtn(e) {
if (!this.editFlag) {
this.edit = "完成";
} else {
this.edit = "编辑";
}
this.editFlag = !this.editFlag;
},
/**
* 点击全选按钮
*/
checkedAllitem() {
//全选按钮
this.trackList.forEach((key) => {
this.$set(key, "___isDel", this.allChecked);
});
},
/**
* 删除足迹
*/
delAllTracks() {
let way = [];
this.trackList.forEach((key) => {
if (key.___isDel) {
way.push(key.goodsId);
}
});
if (way.length == 0) return false;
deleteHistoryListId(way).then((res) => {
if (res.data.code == 200) {
this.trackList = [];
this.allChecked = false;
this.getList();
} else {
uni.showToast({
title: res.data.message,
duration: 2000,
icon: "none",
});
}
});
},
},
};
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.myTracks { .myTracks {
width: 100%; width: 100%;
padding-top: 2rpx; padding-top: 2rpx;
} }
.myTracks-title { .myTracks-title {
width: 100%; width: 100%;
height: 110rpx; height: 110rpx;
padding-left: 20rpx; padding-left: 20rpx;
font-size: 28rpx; font-size: 28rpx;
color: #666; color: #666;
font-weight: bold; font-weight: bold;
background-color: #fff; background-color: #fff;
align-items: center; align-items: center;
display: -webkit-box; display: -webkit-box;
display: -webkit-flex; display: -webkit-flex;
display: flex; display: flex;
} }
.myTracks-items { .myTracks-items {
padding-top: 2rpx; padding-top: 2rpx;
align-items: center; align-items: center;
display: -webkit-box; display: -webkit-box;
display: -webkit-flex; display: -webkit-flex;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
} }
.myTracks-item { .myTracks-item {
width: 100%; width: 100%;
height: 226rpx; height: 226rpx;
padding-left: 20rpx; padding-left: 20rpx;
padding-right: 20rpx; padding-right: 20rpx;
margin-bottom: 2rpx; margin-bottom: 2rpx;
// border-radius: 6/@px; // border-radius: 6/@px;
background-color: #fff; background-color: #fff;
position: relative; position: relative;
align-items: center; align-items: center;
display: -webkit-box; display: -webkit-box;
display: -webkit-flex; display: -webkit-flex;
display: flex; display: flex;
} }
.myTracks-item-img { .myTracks-item-img {
margin-right: 20rpx; margin-right: 20rpx;
border-radius: 8rpx; border-radius: 8rpx;
image {
width: 130rpx;
height: 130rpx;
border-radius: 8rpx;
}
}
.myTracks-item-title { image {
font-size: 28rpx; width: 130rpx;
color: #333; height: 130rpx;
} border-radius: 8rpx;
}
}
.myTracks-item-title-desc { .myTracks-item-title {
font-size: 28rpx; font-size: 28rpx;
color: #999; color: #333;
} }
.myTracks-item-price { .myTracks-item-title-desc {
font-size: 28rpx; font-size: 28rpx;
color: $light-color; color: #999;
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 { .myTracks-item-price {
width: 130rpx; font-size: 28rpx;
height: 60rpx; color: $light-color;
line-height: 60rpx; padding: 10rpx 0 0 0;
} }
.myTracks-divider { .myTracks-action {
width: 100%; display: flex;
height: 20rpx; 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 {
width: 100%;
height: 20rpx;
}
.myTracks-action-check { .myTracks-action-check {
align-items: center; align-items: center;
display: -webkit-box; display: -webkit-box;
display: -webkit-flex; display: -webkit-flex;
display: flex; display: flex;
} }
</style> </style>

View File

@@ -11,11 +11,11 @@
<u-row class="portrait-box2"> <u-row class="portrait-box2">
<u-col span="6" class="portrait-box2-col" :gutter="16"> <u-col span="6" class="portrait-box2-col" :gutter="16">
<text>累计获得</text> <text>累计获得</text>
<text class="pcolor">{{ pointData.point || 0 }}</text> <text class="pcolor">{{ pointData.totalPoint || 0 }}</text>
</u-col> </u-col>
<u-col span="6" class="portrait-box2-col"> <u-col span="6" class="portrait-box2-col">
<text>未使用</text> <text>剩余积分</text>
<text class="pcolor">{{ pointData.variablePoint || 0 }}</text> <text class="pcolor">{{ pointData.point || 0 }}</text>
</u-col> </u-col>
</u-row> </u-row>

View File

@@ -7,6 +7,9 @@
<!-- #ifdef APP-PLUS --> <!-- #ifdef APP-PLUS -->
Version {{localVersion.version}} Version {{localVersion.version}}
<!-- #endif --> <!-- #endif -->
<!-- #ifdef MP-WEIXIN -->
小程序版本: {{localVersion.version}} {{ localVersion.envVersion}}
<!-- #endif -->
</view> </view>
<!-- {{localVersion}} --> <!-- {{localVersion}} -->
@@ -16,6 +19,7 @@
<u-cell-item title="功能介绍" @click="navigateTo('/pages/mine/set/versionFunctionList')"></u-cell-item> <u-cell-item title="功能介绍" @click="navigateTo('/pages/mine/set/versionFunctionList')"></u-cell-item>
<u-cell-item title="检查更新" @click="checkUpdate"></u-cell-item> <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=message')"></u-cell-item>
<u-cell-item title="服务协议" @click="navigateTo('/pages/mine/help/tips?type=user')"></u-cell-item> <u-cell-item title="服务协议" @click="navigateTo('/pages/mine/help/tips?type=user')"></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')"></u-cell-item>
@@ -29,7 +33,7 @@
<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')">{{config.name}}用户协议</view>
<view>CopyRight @{{config.name}} </view> <view>CopyRight ©{{config.name}} </view>
</view> </view>
</view> </view>
</view> </view>
@@ -74,6 +78,19 @@ export default {
}; };
}); });
// #endif // #endif
// #ifdef MP-WEIXIN
const accountInfo = wx.getAccountInfoSync();
console.log("===========accountInfo==============");
console.log(accountInfo);
this.version_number = accountInfo.miniProgram.version // 小程序 版本号
this.localVersion = {
versionCode: accountInfo.miniProgram.version.replace(/\./g, ""),
version: accountInfo.miniProgram.version ,// 小程序 版本号,
envVersion:accountInfo.miniProgram.envVersion, //判断小程序是开发版本还是release版本
};
// #endif
}, },
methods: { methods: {

View File

@@ -16,9 +16,9 @@
<!-- 上传凭证 --> <!-- 上传凭证 -->
<div class="feedBack-box"> <div class="feedBack-box">
<view class="opt-view"> <view class="opt-view">
<view class="img-title">上传凭证最多5</view> <view class="img-title">上传凭证最多2</view>
<view class="images-view"> <view class="images-view">
<u-upload :header=" { accessToken: storage.getAccessToken() }" :action="action" width="150" @on-uploaded="onUploaded" :max-count="5" :show-progress="false"></u-upload> <u-upload :header=" { accessToken: storage.getAccessToken() }" :action="action" width="150" @on-uploaded="onUploaded" :max-count="2" :show-progress="false"></u-upload>
</view> </view>
</view> </view>
</div> </div>

View File

@@ -23,12 +23,16 @@
<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>
<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";
@@ -38,6 +42,7 @@ export default {
components: { uFormItem, "m-city": gkcity }, components: { uFormItem, "m-city": gkcity },
data() { data() {
return { return {
quitShow: false,
lightColor: this.$lightColor, //高亮颜色 lightColor: this.$lightColor, //高亮颜色
form: { form: {
nickName: storage.getUserInfo().nickName || "", nickName: storage.getUserInfo().nickName || "",
@@ -65,6 +70,35 @@ export default {
}; };
}, },
methods: { methods: {
/**
* 显示退出登录对话框
*/
showModalDialog() {
this.quitShow = true;
},
clear() {
storage.setAccessToken("");
storage.setRefreshToken("");
storage.setUserInfo({});
this.$options.filters.navigateToLogin("redirectTo");
},
/**
* 确认退出
* 清除缓存重新登录
*/
async confirm() {
try{
await logout();
this.clear();
}catch(e){
//TODO handle the exception
this.clear();
}
},
/** /**
* 选择地址回调 * 选择地址回调
*/ */

View File

@@ -1,251 +1,277 @@
<template> <template>
<view class="box"> <view class="box">
<view class="box-tips"> <view class="box-tips">
<h2> <h2 class='h2'>
{{verificationTitle[validateFlage==false ? 0 : 1].title}} {{verificationTitle[validateFlage==false ? 0 : 1].title}}
</h2> </h2>
<view class="verification">{{verificationTitle[step].desc}}</view> <view class="verification">{{verificationTitle[step].desc}}</view>
</view> </view>
<u-form :model="codeForm" class="form" ref="validateCodeForm"> <view class="form">
<view v-if="!validateFlage"> <u-form :model="codeForm" ref="validateCodeForm">
<u-form-item label-width="120" label="手机号" prop="mobile"> <view v-if="!validateFlage">
<u-input maxlength="11" v-model="codeForm.mobile" placeholder="请输入您的手机号" /> <u-form-item label-width="120" label="手机号" prop="mobile">
</u-form-item> <u-input maxlength="11" v-model="codeForm.mobile" placeholder="请输入您的手机号" />
</u-form-item>
<u-form-item class="sendCode" label-width="120" prop="code" label="验证码">
<u-input v-model="codeForm.code" placeholder="请输入验证码" /> <u-form-item class="sendCode" label-width="120" prop="code" label="验证码">
<u-verification-code unique-key="page-edit" :seconds="seconds" @end="end" @start="start" ref="uCode" @change="codeChange"></u-verification-code> <u-input v-model="codeForm.code" placeholder="请输入验证码" />
<view @tap="getCode" class="text-tips">{{ tips }}</view> <u-verification-code unique-key="page-edit" :seconds="seconds" @end="end" @start="start"
</u-form-item> ref="uCode" @change="codeChange"></u-verification-code>
<view @tap="getCode" class="text-tips">{{ tips }}</view>
<view class="submit" @click="validatePhone">验证</view> </u-form-item>
<myVerification keep-running @send="verification" class="verification" ref="verification" business="FIND_USER" />
</view> <view class="submit" @click="validatePhone">验证</view>
<view v-if="validateFlage"> <myVerification keep-running @send="verification" class="verification" ref="verification"
<u-form-item label-width="120" label="旧密码"> business="FIND_USER" />
<u-input type="password" v-model="password" placeholder="请输入您的旧密码" /> </view>
</u-form-item> <view v-if="validateFlage">
<u-form-item label-width="120" label="旧密码">
<u-form-item label-width="120" label="新密码"> <u-input type="password" v-model="password" placeholder="请输入您的旧密码" />
</u-form-item>
<u-input type="password" v-model="newPassword" placeholder="请输入您的新密码" />
<u-form-item label-width="120" label="新密码">
</u-form-item>
<u-input type="password" v-model="newPassword" placeholder="请输入您的新密码" />
<view class="submit" @click="updatePassword">修改密码</view>
</view> </u-form-item>
</u-form>
</view> <view class="submit" @click="updatePassword">修改密码</view>
</template> </view>
</u-form>
<script> </view>
import { sendMobile, resetByMobile, modifyPass } from "@/api/login"; </view>
</template>
import { md5 } from "@/utils/md5.js"; // md5
import myVerification from "@/components/verification/verification.vue"; //验证 <script>
import uuid from "@/utils/uuid.modified.js"; import {
export default { sendMobile,
components: { resetByMobile,
myVerification, modifyPass
}, } from "@/api/login";
data() {
return { import {
uuid, md5
validateFlage: false, //是否进行了手机号验证 } from "@/utils/md5.js"; // md5
verificationTitle: [ import myVerification from "@/components/verification/verification.vue"; //验证
{ import uuid from "@/utils/uuid.modified.js";
title: "安全验证", export default {
desc: "请输入当前手机号进行安全验证", components: {
}, myVerification,
{ },
title: "修改密码", data() {
desc: "请输入新密码", return {
}, uuid,
], validateFlage: false, //是否进行了手机号验证
step: 0, //当前验证步骤 verificationTitle: [{
flage: false, //是否验证码验证 title: "安全验证",
desc: "请输入当前手机号进行安全验证",
codeForm: { },
mobile: "", //手机号 {
code: "", //验证码 title: "修改密码",
}, desc: "请输入新密码",
newPassword: "", //新密码 },
password: "", //密码 ],
tips: "", //提示 step: 0, //当前验证步骤
seconds: 60, // 60s等待时间 flage: false, //是否验证码验证
// 验证码登录校验 codeForm: {
codeRules: { mobile: "", //手机号
mobile: [ code: "", //验证码
{ },
validator: (rule, value, callback) => { newPassword: "", //新密码
return this.$u.test.mobile(value); password: "", //密码
}, tips: "", //提示
message: "手机号码不正确", seconds: 69, // 60s等待时间
trigger: ["blur"],
}, // 验证码登录校验
], codeRules: {
code: [ mobile: [{
{ validator: (rule, value, callback) => {
min: 4, return this.$u.test.mobile(value);
max: 6, },
required: true, message: "手机号码不正确",
message: "请输入验证码", trigger: ["blur"],
trigger: ["blur"], }, ],
}, code: [{
], min: 4,
}, max: 6,
}; required: true,
}, message: "请输入验证码",
onReady() { trigger: ["blur"],
// 必须要在onReady生命周期因为onLoad生命周期组件可能尚未创建完毕 }, ],
this.$refs.validateCodeForm.setRules(this.codeRules); },
}, };
watch: { },
flage(val) { onReady() {
if (val) { // 必须要在onReady生命周期因为onLoad生命周期组件可能尚未创建完毕
if (this.$refs.uCode.canGetCode) { this.$refs.validateCodeForm.setRules(this.codeRules);
uni.showLoading({ },
title: "正在获取验证码", watch: {
}); flage(val) {
sendMobile(this.codeForm.mobile, "FIND_USER").then((res) => { if (val) {
uni.hideLoading();
// 这里此提示会被this.start()方法中的提示覆盖 if (this.$refs.uCode.canGetCode) {
if (res.data.code == 200) { uni.showLoading({
this.$refs.uCode.start(); title: "正在获取验证码",
} else { });
uni.showToast({ sendMobile(this.codeForm.mobile, "FIND_USER").then((res) => {
title: res.data.message, uni.hideLoading();
duration: 2000, // 这里此提示会被this.start()方法中的提示覆盖
icon: "none", if (res.data.success) {
}); this.$refs.uCode.start();
} } else {
}); uni.showToast({
} else { title: res.data.message,
this.$u.toast("请倒计时结束后再发送"); duration: 2000,
} icon: "none",
} });
}, this.flage = false;
}, this.$refs.verification.getCode();
}
methods: { })
// 修改密码 } else {
updatePassword() { this.$u.toast("请倒计时结束后再发送");
modifyPass({ }
newPassword: md5(this.newPassword), }
password: md5(this.password), },
}).then((res) => { },
if (res.data.success) {
uni.showToast({ methods: {
title: "修改成功!", // 修改密码
duration: 2000, updatePassword() {
icon: "none", modifyPass({
}); newPassword: md5(this.newPassword),
setTimeout(() => { password: md5(this.password),
uni.navigateBack({ }).then((res) => {
delta: 1, if (res.data.success) {
}); uni.showToast({
}, 1000); title: "修改成功!",
} duration: 2000,
}); icon: "none",
}, });
setTimeout(() => {
// 验证码验证 uni.navigateBack({
verification(val) { delta: 1,
this.flage = val == this.$store.state.verificationKey ? true : false; });
}, }, 1000);
}
// 验证手机号 });
validatePhone() { },
this.$refs.validateCodeForm.validate((valid) => {
if (valid) { // 验证码验证
resetByMobile(this.codeForm).then((res) => { verification(val) {
if (res.data.success) { this.flage = val == this.$store.state.verificationKey ? true : false;
this.validateFlage = !this.validateFlage; },
// 登录成功
uni.showToast({ // 验证手机号
title: "验证成功!", validatePhone() {
icon: "none", this.$refs.validateCodeForm.validate((valid) => {
}); if (valid) {
} resetByMobile(this.codeForm).then((res) => {
}); if (res.data.success) {
} this.validateFlage = !this.validateFlage;
}); // 登录成功
}, uni.showToast({
title: "验证成功!",
codeChange(text) { icon: "none",
this.tips = text; });
}, }
end() {}, });
}
/**判断是否是当前用户的手机号 */ });
isUserPhone() { },
let flage = false;
let user = this.$options.filters.isLogin(); codeChange(text) {
if (user.mobile != this.codeForm.mobile) { this.tips = text;
uni.showToast({ },
title: "请输入当前绑定手机号", end() {
icon: "none",
}); this.flage = false;
flage = false; this.$refs.verification.getCode()
} else { },
flage = true;
} /**判断是否是当前用户的手机号 */
isUserPhone() {
return flage; let flage = false;
}, let user = this.$options.filters.isLogin();
/**获取验证码 */ if (user.mobile != this.codeForm.mobile) {
getCode() { uni.showToast({
if (this.isUserPhone()) { title: "请输入当前绑定手机号",
if (this.tips == "重新获取") { icon: "none",
this.flage = true; });
} flage = false;
if (!this.$u.test.mobile(this.codeForm.mobile)) { } else {
uni.showToast({ flage = true;
title: "请输入正确手机号", }
icon: "none",
}); return flage;
return false; },
} /**获取验证码 */
if (!this.flage) { getCode() {
this.$refs.verification.hide(); if (this.isUserPhone()) {
return false; if (this.tips == "重新获取") {
} this.$refs.verification.error(); //发送
} }
}, if (!this.$u.test.mobile(this.codeForm.mobile)) {
start() { uni.showToast({
this.$u.toast("验证码已发送"); title: "请输入正确手机号",
this.flage = false; icon: "none",
}, });
}, return false;
}; }
</script> if (!this.flage) {
<style lang="scss" scoped> this.$refs.verification.error(); //发送
@import url("../../../passport/login.scss"); return false;
.u-form-item { }
margin: 40rpx 0; }
} },
.sendCode { start() {
/deep/ .u-form-item--right__content__slot { this.$u.toast("验证码已发送");
display: flex; this.flage = true;
}
} this.$refs.verification.hide();
page { },
background: #fff; },
} };
.box { </script>
padding: 80rpx 0; <style lang="scss" scoped>
border-radius: 20rpx; @import url("@/pages/passport/login.scss");
}
.submit { /deep/ .u-form-item {
background: $light-color; margin: 40rpx 0;
} }
.box-tips {
margin: 0 72rpx; .sendCode {
} /deep/ .u-form-item--right__content__slot {
.verification { display: flex;
font-size: 24rpx; }
color: #999; }
margin-top: 10rpx;
} .h2 {
</style> font-size: 40rpx;
font-weight: bold;
}
page {
background: #fff;
}
.box {
padding: 80rpx 0;
border-radius: 20rpx;
}
.submit {
background: $light-color;
}
.box-tips {
margin: 0 72rpx;
}
.verification {
font-size: 24rpx;
color: #999;
margin-top: 10rpx;
}
</style>

View File

@@ -22,9 +22,9 @@
<!-- #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" @click="showModalDialog">{{userInfo.id ?'退出登录':'登录'}}</view>
<u-modal show-cancel-button v-model="quitShow" @confirm="confirm" :confirm-color="lightColor" :async-close="true" <u-modal show-cancel-button v-model="quitShow" @confirm="confirm" :confirm-color="lightColor" :async-close="true"
:content="userInfo.id ? '确定要退出登录么?' : '确定要返回登录么?'"></u-modal> :content="userInfo.id ? '确定要退出登录么?' : '确定要登录么?'"></u-modal>
</view> </view>
</template> </template>
@@ -65,8 +65,14 @@ export default {
* 清除缓存重新登录 * 清除缓存重新登录
*/ */
async confirm() { async confirm() {
await logout(); try{
this.clear(); await logout();
this.clear();
}catch(e){
//TODO handle the exception
this.clear();
}
}, },
/** /**

View File

@@ -22,19 +22,6 @@
} }
} }
.promotion {
margin-top: 4rpx;
display: flex;
div {
span {
font-size: 24rpx;
color: $light-color;
margin-right: 10rpx;
padding: 0 4rpx;
border-radius: 2rpx;
}
}
}
.status_bar { .status_bar {
height: var(--status-bar-height); height: var(--status-bar-height);
background: #fff !important; background: #fff !important;
@@ -437,180 +424,13 @@ view {
margin-left: 4rpx; margin-left: 4rpx;
font-size: 26rpx; font-size: 26rpx;
color: #888; color: #888;
} }
.xia { .xia {
transform: scaleY(-1); transform: scaleY(-1);
} }
} }
.cate-item {
display: flex;
justify-content: center;
align-items: center;
height: 100%;
width: 80rpx;
position: relative;
font-size: 44rpx;
&:after {
content: "";
position: absolute;
left: 0;
top: 50%;
transform: translateY(-50%);
border-left: 1px solid #ddd;
width: 0;
height: 36rpx;
}
}
} }
/* 分类 */
.cate-mask {
position: fixed;
left: 0;
top: var(--window-top);
bottom: 0;
width: 100%;
background: rgba(0, 0, 0, 0);
z-index: 95;
transition: 0.3s;
.cate-content {
width: 630rpx;
height: 100%;
background: #fff;
float: right;
transform: translateX(100%);
transition: 0.3s;
}
&.none {
display: none;
}
&.show {
background: rgba(0, 0, 0, 0.4);
.cate-content {
transform: translateX(0);
}
}
}
.cate-list {
display: flex;
flex-direction: column;
height: 100%;
.cate-item {
display: flex;
align-items: center;
height: 90rpx;
padding-left: 30rpx;
font-size: 28rpx;
color: #555;
position: relative;
}
.two {
height: 64rpx;
color: #303133;
font-size: 30rpx;
background: #f8f8f8;
}
}
.price-box {
margin-top: 10rpx;
display: flex;
align-items: center;
justify-content: space-between;
padding-right: 10rpx;
font-size: 24rpx;
color: $font-color-light;
}
.price {
font-size: 26rpx;
line-height: 1;
color: $main-color;
font-weight: bold;
/deep/ span:nth-of-type(1) {
font-size: 38rpx;
}
}
/* 商品列表 */
.goods-list {
display: flex;
flex-wrap: wrap;
margin: 10rpx 20rpx 284rpx;
// background: #fff;
width: 100%;
.goods-item {
background-color: #ffffff;
display: flex;
border-radius: 16rpx;
flex-direction: column;
width: calc(50% - 30rpx);
margin-bottom: 20rpx;
padding-bottom: 20rpx;
&:nth-child(2n + 1) {
margin-right: 20rpx;
}
.goods-detail {
margin: 0 20rpx;
}
}
.image-wrapper {
width: 100%;
height: 330rpx;
border-radius: 16rpx 16rpx 0 0;
overflow: hidden;
padding: 0;
image {
width: 100%;
height: 100%;
opacity: 1;
border-radius: 16rpx 16rpx 0 0;
}
}
.title {
font-size: $font-base;
color: $font-color-dark;
line-height: 1.5;
height: 84rpx;
padding: 10rpx 0 0;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
overflow: hidden;
}
.count-config,
.store-seller-name {
font-size: $font-sm;
}
.text-hidden {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
}
.status_bar { .status_bar {
height: var(--status-bar-height); height: var(--status-bar-height);
width: 100%; width: 100%;

View File

@@ -35,7 +35,8 @@
@click="doSearch(keyword)"> @click="doSearch(keyword)">
<span>{{ keyword }} </span> <span>{{ keyword }} </span>
</div> </div>
<div @click="showMore" v-if=" oldKeywordIndex > loadIndex" class="oldKeyItem">展示更多</div>
<div @click="showMore" v-if="oldKeywordIndex > loadIndex" class="oldKeyItem">展示更多</div>
</div> </div>
</view> </view>
@@ -82,65 +83,10 @@
<div v-if="isSWitch"> <div v-if="isSWitch">
<scroll-view :style="{ height: goodsHeight }" enableBackToTop="true" lower-threshold="250" <scroll-view :style="{ height: goodsHeight }" enableBackToTop="true" lower-threshold="250"
@scrolltolower="loadmore()" scroll-with-animation scroll-y class="scoll-page"> @scrolltolower="loadmore()" scroll-with-animation scroll-y class="scoll-page">
<div class="goods-class"> <goodsList :res='goodsList' type='oneColumns' :keyword='keyword' />
<div v-for="(item, index) in goodsList" :key="index" class="goods-row">
<div class="flex goods-col">
<div class="goods-img" @click="navigateToDetailPage(item)">
<u-image width="230rpx" height="230rpx" :src="item.content.thumbnail">
<u-loading slot="loading"></u-loading>
</u-image>
</div>
<div class="goods-detail">
<div class="title clamp3" @click="navigateToDetailPage(item)">{{ item.content.goodsName }}</div>
<view class="price-box" @click="navigateToDetailPage(item)">
<div class="price" v-if="item.content.price!=undefined">
¥<span>{{ formatPrice(item.content.price )[0] }} </span>.{{
formatPrice(item.content.price )[1]
}}
</div>
</view>
<div class="promotion" @click="navigateToDetailPage(item)">
<div v-for="(promotionItem,promotionIndex) in getPromotion(item)" :key="promotionIndex">
<span v-if="promotionItem.indexOf('COUPON') != -1"></span>
<span v-if="promotionItem.indexOf('FULL_DISCOUNT') != -1">满减</span>
<span v-if="promotionItem.indexOf('SECKILL') != -1">秒杀</span>
</div>
</div>
<div style="overflow: hidden" @click="navigateToDetailPage(item)" class="count-config">
<span style="float: left; font-size: 22rpx">已售 {{ item.content.buyCount || '0' }}</span>
<span style="float: right; font-size: 22rpx">{{ item.content.commentNum || '0' }}条评论</span>
</div>
<div style="overflow: hidden" @click="navigateToStoreDetailPage(item)" class="count-config">
<div class="text-hidden">
<u-tag style="margin-right: 10rpx" size="mini" mode="dark" v-if="item.selfOperated" text="自营"
type="error" />
<span class="line1-store-name">{{ item.content.storeName }}</span>
<span class="to-store">进店<u-icon size="24" name="arrow-right" color="#666"></u-icon></span>
</div>
<span>
<u-icon name="arrow-right" color="#c5c5c5"></u-icon>
</span>
</div>
</div>
</div>
</div>
</div>
<uni-load-more :status="loadingType" @loadmore="loadmore()"></uni-load-more> <uni-load-more :status="loadingType" @loadmore="loadmore()"></uni-load-more>
</scroll-view> </scroll-view>
</div> </div>
<div class="empty" v-if="goodsList == [] || goodsList == '' || goodsList == null">
<view>
<image style="width: 320rpx; height: 240rpx" src="/static/nodata.png">
</image>
</view>
<view>
<p>没有找到相关的商品信息</p>
<p>请换一个关键词试试吧</p>
</view>
</div>
<!-- 一行两个商品展示 --> <!-- 一行两个商品展示 -->
<div v-if=" <div v-if="
!isSWitch && !isSWitch &&
@@ -148,45 +94,7 @@
"> ">
<scroll-view :style="{ height: goodsHeight }" scroll-anchoring enableBackToTop="true" <scroll-view :style="{ height: goodsHeight }" scroll-anchoring enableBackToTop="true"
@scrolltolower="loadmore()" scroll-with-animation scroll-y lower-threshold="250" class="scoll-page"> @scrolltolower="loadmore()" scroll-with-animation scroll-y lower-threshold="250" class="scoll-page">
<view class="goods-list"> <goodsList :res='goodsList' :keyword='keyword' />
<view v-for="(item, index) in goodsList" :key="index" class="goods-item">
<view class="image-wrapper" @click="navigateToDetailPage(item)">
<image :src="item.content.thumbnail" mode="aspectFill"></image>
</view>
<view class="goods-detail">
<div class="title clamp" @click="navigateToDetailPage(item)">{{ item.content.goodsName }}</div>
<view class="price-box" @click="navigateToDetailPage(item)">
<div class="price" v-if="item.content.price!=undefined">
¥<span>{{ formatPrice(item.content.price )[0] }} </span>.{{
formatPrice(item.content.price )[1]
}}
</div>
</view>
<div class="promotion" @click="navigateToDetailPage(item)">
<div v-for="(promotionItem,promotionIndex) in getPromotion(item)" :key="promotionIndex">
<span v-if="promotionItem.indexOf('COUPON') != -1">劵</span>
<span v-if="promotionItem.indexOf('FULL_DISCOUNT') != -1">满减</span>
<span v-if="promotionItem.indexOf('SECKILL') != -1">秒杀</span>
</div>
</div>
<div class="count-config" @click="navigateToDetailPage(item)">
<span>已售 {{ item.content.buyCount || "0" }}</span>
<span>{{ item.content.commentNum || "0" }}条评论</span>
</div>
<div class="store-seller-name" @click="navigateToStoreDetailPage(item)">
<div class="text-hidden">
<u-tag style="margin-right: 10rpx" size="mini" mode="dark" v-if="item.selfOperated" text="自营"
type="error" />
<span>{{ item.content.storeName || "暂无" }}</span>
</div>
<span>
<u-icon name="arrow-right"></u-icon>
</span>
</div>
</view>
</view>
</view>
<uni-load-more :status="loadingType"></uni-load-more> <uni-load-more :status="loadingType"></uni-load-more>
</scroll-view> </scroll-view>
</div> </div>
@@ -268,22 +176,34 @@
</view> </view>
</view> </view>
</u-popup> </u-popup>
<div class="empty" v-if="empty">
<view>
<image style="width: 320rpx; height: 240rpx" src="/static/nodata.png">
</image>
</view>
<view>
<p>没有找到相关的商品信息</p>
<p>请换一个关键词试试吧</p>
</view>
</div>
<u-back-top :scroll-top="scrollTop"></u-back-top> <u-back-top :scroll-top="scrollTop"></u-back-top>
</view> </view>
</template> </template>
<script> <script>
import { getGoodsList, getGoodsRelated } from "@/api/goods.js"; import { getGoodsList, getGoodsRelated } from "@/api/goods.js";
import goodsList from '@/components/m-goods-list/list.vue'
import { getHotKeywords } from "@/api/home.js"; import { getHotKeywords } from "@/api/home.js";
import mSearch from "@/components/m-search-revision/m-search-revision.vue"; import mSearch from "@/components/m-search-revision/m-search-revision.vue";
import storage from "@/utils/storage"; import storage from "@/utils/storage";
export default { export default {
data() { data() {
return { return {
empty:false,
scrollTop: 0, scrollTop: 0,
loadIndex: 10, loadIndex: 10,
oldKeywordIndex: "", oldKeywordIndex: 0,
selectedWay: { selectedWay: {
brand: [], brand: [],
categoryId: [], categoryId: [],
@@ -339,6 +259,7 @@ export default {
routerVal: "", routerVal: "",
}; };
}, },
onPageScroll(e) { onPageScroll(e) {
console.log(e); console.log(e);
this.scrollTop = e.scrollTop; this.scrollTop = e.scrollTop;
@@ -371,6 +292,7 @@ export default {
}, },
components: { components: {
mSearch, mSearch,
goodsList
}, },
watch: { watch: {
/** /**
@@ -449,15 +371,6 @@ export default {
return array; return array;
} }
}, },
// 格式化金钱 1999 --> [1999,00]
formatPrice(val) {
if (typeof val == "undefined") {
return val;
}
return val.toFixed(2).split(".");
},
// 展示更多数据 // 展示更多数据
showMore() { showMore() {
this.loadOldKeyword(this.oldKeywordIndex); this.loadOldKeyword(this.oldKeywordIndex);
@@ -658,7 +571,7 @@ export default {
key: "OldKeys", key: "OldKeys",
success: (res) => { success: (res) => {
var OldKeys = JSON.parse(res.data); var OldKeys = JSON.parse(res.data);
this.oldKeywordIndex = res.data.length; this.oldKeywordIndex = OldKeys.length;
for (let i = 0; i < index; i++) { for (let i = 0; i < index; i++) {
this.oldKeywordList.push(OldKeys[i]); this.oldKeywordList.push(OldKeys[i]);
} }
@@ -709,8 +622,11 @@ export default {
let goodsList = await getGoodsList(this.params); let goodsList = await getGoodsList(this.params);
if (goodsList.data.result.content.length < 10) { if (goodsList.data.result.content.length < 10) {
this.loadingType = "noMore"; this.loadingType = "noMore";
} this.empty = true
} else {
this.empty = false
}
this.goodsList.push(...goodsList.data.result.content); this.goodsList.push(...goodsList.data.result.content);
this.initSortGoods(); this.initSortGoods();
uni.hideLoading(); uni.hideLoading();
@@ -759,6 +675,9 @@ export default {
doSearchSwitch() { doSearchSwitch() {
this.isSWitch = !this.isSWitch; this.isSWitch = !this.isSWitch;
this.isShowSeachGoods = true; this.isShowSeachGoods = true;
this.params.pageNumber = 1
this.params.pageSize = 10
this.loadData("refresh", 1);
}, },
/** /**

View File

@@ -1,31 +1,54 @@
<template> <template>
<view class="content"> <view class="content">
<view class="u-tabs-box"> <view class="u-tabs-box">
<u-tabs bg-color="#fff" :list="list" :is-scroll="false" :current="current" @change="change" <u-tabs
:active-color="$lightColor"></u-tabs> bg-color="#fff"
:list="list"
:is-scroll="false"
:current="current"
@change="change"
:active-color="$lightColor"
></u-tabs>
</view> </view>
<div class="u-tabs-search"> <div class="u-tabs-search">
<u-search placeholder="请输入订单编号" @search="handleGetOrderList(current)" @clear="handleGetOrderList(current)" <u-search
@custom="handleGetOrderList(current)" v-model="params.orderSn"></u-search> placeholder="请输入订单编号"
@search="submitSearchOrderList(current)"
@clear="submitSearchOrderList(current)"
@custom="submitSearchOrderList(current)"
v-model="orderSn"
>
</u-search>
</div> </div>
<scroll-view class="body-view" scroll-y @scrolltolower="renderDate"> <scroll-view class="body-view" scroll-y @scrolltolower="renderDate">
<view class="seller-view" v-for="(order, orderIndex) in orderList" :key="orderIndex"> <view
class="seller-view"
v-for="(order, orderIndex) in orderList"
:key="orderIndex"
>
<!-- 店铺名称 --> <!-- 店铺名称 -->
<view class="seller-info u-flex u-row-between" v-if="current == 0"> <view class="seller-info u-flex u-row-between" v-if="current == 0">
<view class="seller-name"> <view class="seller-name">
<view class="name">{{ order.storeName }}</view> <view class="name">{{ order.storeName }}</view>
</view> </view>
<view class="order-sn">订单编号:{{order.sn}}</view> <view class="order-sn">订单编号:{{ order.sn }}</view>
</view> </view>
<!-- 申请记录 选项卡 --> <!-- 申请记录 选项卡 -->
<view class="seller-info u-flex u-row-between" v-if="current != 0"> <view class="seller-info u-flex u-row-between" v-if="current != 0">
<view class="order-sn">售后单号{{ order.service_sn || order.sn }}</view> <view class="order-sn"
>售后单号{{ order.service_sn || order.sn }}</view
>
<view class="order-sn">{{ order.serviceType_text }}</view> <view class="order-sn">{{ order.serviceType_text }}</view>
</view> </view>
<view v-for="(sku, goodsIndex) in order.orderItems" :key="goodsIndex"> <view v-for="(sku, goodsIndex) in order.orderItems" :key="goodsIndex">
<view class="goods-item-view" @click="onDetail(order,sku)"> <view class="goods-item-view" @click="onDetail(order, sku)">
<view class="goods-img"> <view class="goods-img">
<u-image border-radius="6" width="100%" height="100%" :src="sku.image"></u-image> <u-image
border-radius="6"
width="100%"
height="100%"
:src="sku.image"
></u-image>
</view> </view>
<view class="goods-info"> <view class="goods-info">
<view class="goods-title u-line-2">{{ sku.name }}</view> <view class="goods-title u-line-2">{{ sku.name }}</view>
@@ -38,80 +61,139 @@
<view>x{{ sku.num }}</view> <view>x{{ sku.num }}</view>
</view> </view>
</view> </view>
<view class="btn-view u-flex u-row-between"> <view class="description">
<view class="description"> <!-- 售后申请 -->
<!-- 售后申请 --> <view v-if="current === 0 && order.groupAfterSaleStatus">
<view v-if=" <view
current === 0 && order.groupAfterSaleStatus && v-if="order.groupAfterSaleStatus.includes('ALREADY_APPLIED')"
order.groupAfterSaleStatus.includes('ALREADY_APPLIED') class="cannot_apply not_center"
" class="cannot_apply"> >
<u-icon class="icon" name="info-circle-fill"></u-icon> <u-icon class="icon" name="info-circle-fill"></u-icon>
该商品已申请售后服务 该商品已申请售后服务
</view> </view>
<view class="cannot_apply" </view>
v-if="current === 0 && order.groupAfterSaleStatus && order.groupAfterSaleStatus.includes('EXPIRED') " <view v-if="current === 0 && order.groupAfterSaleStatus">
@click="tipsShow = true"> <view
v-if="order.groupAfterSaleStatus.includes('EXPIRED')"
class="cannot_apply not_center"
@click="tipsShow = true"
>
<u-icon class="icon" name="info-circle-fill"></u-icon> <u-icon class="icon" name="info-circle-fill"></u-icon>
该商品无法申请售后 该商品无法申请售后
</view> </view>
<div v-if="current === 1 || current === 2">
<!-- 申请中 -->
<view class="cannot_apply" v-if="order.serviceType == 'RETURN_GOODS'">
退货处理-{{ order.serviceStatus | serviceStatusList }}</view>
<view class="cannot_apply" v-if="order.serviceType == 'SUPPLY_AGAIN_GOODS'">
补发商品-{{ order.serviceStatus | serviceStatusList }}</view>
<view class="cannot_apply" v-if="order.serviceType == 'RETURN_MONEY'">
退款-{{ order.serviceStatus | serviceStatusList }}</view>
<view class="cannot_apply" v-if="order.serviceType == 'EXCHANGE_GOODS'">
换货-{{ order.serviceStatus | serviceStatusList }}</view>
<view class="cannot_apply" v-if="order.serviceType == 'CANCEL'">
取消订单-{{ order.serviceStatus | serviceStatusList }}</view>
</div>
<!-- 申请记录 -->
</view> </view>
<!-- 售后申请 -->
<div v-if="current === 0 && sku.afterSaleStatus && (sku.afterSaleStatus.includes('NOT_APPLIED') || sku.afterSaleStatus.includes('PART_AFTER_SALE')) " @click="applyService(sku.sn, order, sku)" class="sale">
<view class=" default-btn border" >
申请售后
</view>
</div>
<view class="after-line">
<div v-if="current === 1 || current === 2">
<!-- 申请中 --> <!-- 申请中 -->
<view class="default-btn border" v-if=" <view
class="cannot_apply not_center"
v-if="order.serviceType == 'RETURN_GOODS'"
>
退货处理-{{ order.serviceStatus | serviceStatusList }}</view
>
<view
class="cannot_apply not_center"
v-if="order.serviceType == 'SUPPLY_AGAIN_GOODS'"
>
补发商品-{{ order.serviceStatus | serviceStatusList }}</view
>
<view
class="cannot_apply not_center"
v-if="order.serviceType == 'RETURN_MONEY'"
>
退款-{{ order.serviceStatus | serviceStatusList }}</view
>
<view
class="cannot_apply not_center"
v-if="order.serviceType == 'EXCHANGE_GOODS'"
>
换货-{{ order.serviceStatus | serviceStatusList }}</view
>
<view
class="cannot_apply not_center"
v-if="order.serviceType == 'CANCEL'"
>
取消订单-{{ order.serviceStatus | serviceStatusList }}</view
>
</div>
<!-- 申请记录 -->
</view>
<view class="btn-view u-flex u-row-right">
<!-- 售后申请 -->
<div class="sale" v-if="current === 0 && sku.afterSaleStatus">
<div
v-if="
order.flowPrice != 0 &&
sku.afterSaleStatus.includes('NOT_APPLIED') ||
sku.afterSaleStatus.includes('PART_AFTER_SALE')
"
@click="applyService(sku.sn, order, sku)"
>
<view class="default-btn border"> 申请售后 </view>
</div>
</div>
<view class="after-line">
<!-- 申请中 -->
<view
class="default-btn border"
v-if="
current === 2 && current === 2 &&
order.serviceStatus && order.serviceStatus &&
order.serviceStatus == 'PASS' && order.serviceStatus == 'PASS' &&
order.serviceType != 'RETURN_MONEY' order.serviceType != 'RETURN_MONEY'
" @click="onExpress(order, sku)"> "
@click="onExpress(order, sku)"
>
提交物流 提交物流
</view> </view>
<view @click="close(order,sku)" v-if="current === 1" class="default-btn close"> <view
@click="close(order, sku)"
v-if="current === 1"
class="default-btn close"
>
取消售后 取消售后
</view> </view>
<view @click="afterDetails(order, sku)" v-if="current === 1 || current === 2" class="default-btn border"> <view
@click="afterDetails(order, sku)"
v-if="current === 1 || current === 2"
class="default-btn border"
>
售后详情 售后详情
</view> </view>
</view> </view>
</view> </view>
</view> </view>
<view v-if=" <view
current === 0 && order.groupAfterSaleStatus && v-if="
current === 0 &&
order.groupAfterSaleStatus &&
order.groupAfterSaleStatus != 'ALREADY_APPLIED' && order.groupAfterSaleStatus != 'ALREADY_APPLIED' &&
order.orderItems.length >= 1 order.orderItems.length >= 1
" class="btn-view u-flex u-row-between"> "
class="btn-view u-flex u-row-between"
>
<!-- 多个商品显示订单总价格 --> <!-- 多个商品显示订单总价格 -->
<view class="cannot_apply"> <view class="cannot_apply">
订单总金额:<span class="countMoney">¥{{ order.flowPrice | unitPrice }}</span> 订单总金额:<span class="countMoney"
>¥{{ order.flowPrice | unitPrice }}</span
>
</view> </view>
</view> </view>
</view> </view>
<u-loadmore bg-color="#f8f8f8" :status="status" /> <u-loadmore bg-color="#f8f8f8" :status="status" />
</scroll-view> </scroll-view>
<u-modal show-cancel-button @confirm="closeService" v-model="cancelShow" content="确认取消售后"></u-modal> <u-modal
<u-modal v-model="tipsShow" content="当订单未确认收货|已过售后服务有效期|已申请售后服务时,不能申请售后"></u-modal> show-cancel-button
@confirm="closeService"
v-model="cancelShow"
content="确认取消售后"
></u-modal>
<u-modal
v-model="tipsShow"
content="当订单未确认收货|已过售后服务有效期|已申请售后服务时,不能申请售后"
></u-modal>
</view> </view>
</template> </template>
@@ -148,7 +230,7 @@ export default {
pageNumber: 1, pageNumber: 1,
pageSize: 10, pageSize: 10,
sort: "createTime", sort: "createTime",
flowPrice: 1, flowPrice: 0,
order: "desc", order: "desc",
}, },
@@ -157,21 +239,27 @@ export default {
pageSize: 10, pageSize: 10,
}, },
status: "loadmore", status: "loadmore",
orderSn: "", // 搜索订单sn
}; };
}, },
onLoad(options) { onLoad(options) {
this.orderList = []; this.orderList = [];
this.params.pageNumber = 1; this.params.pageNumber = 1;
if (options.orderSn) this.params.orderSn = options.orderSn; if (options.orderSn) this.params.orderSn = options.orderSn;
this.getOrderList(this.current); this.searchOrderList(this.current);
}, },
onPullDownRefresh() { onPullDownRefresh() {
this.change(this.current); this.change(this.current);
}, },
methods: { methods: {
handleGetOrderList(current) { /**
* 点击搜索执行搜索
*/
submitSearchOrderList(current) {
this.params.pageNumber = 1;
this.logParams.pageNumber = 1;
this.orderList = []; this.orderList = [];
this.getOrderList(current); this.searchOrderList(current);
}, },
/** /**
* 切换tab页时初始化数据 * 切换tab页时初始化数据
@@ -184,8 +272,18 @@ export default {
}; };
this.orderList = []; this.orderList = [];
//如果是2 则读取售后申请记录列表 //如果是2 则读取售后申请记录列表
this.searchOrderList(index);
uni.stopPullDownRefresh();
},
/**
* 搜索初始化
* 根据当前tab传值的索引进行更改
*/
searchOrderList(index) {
if (index == 0) { if (index == 0) {
this.getOrderList(index); this.orderSn ? (this.params.orderSn = this.orderSn) : "";
this.getOrderList();
} else { } else {
this.logParams = { this.logParams = {
pageNumber: 1, pageNumber: 1,
@@ -196,16 +294,16 @@ export default {
if (index === 1) { if (index === 1) {
this.logParams.serviceStatus = "APPLY"; this.logParams.serviceStatus = "APPLY";
} }
this.orderSn ? (this.logParams.orderSn = this.orderSn) : "";
this.orderList = []; this.orderList = [];
this.getAfterSaleLogList(); this.getAfterSaleLogList();
} }
uni.stopPullDownRefresh();
}, },
/** /**
* 获取订单列表 * 获取订单列表
*/ */
getOrderList(index) { getOrderList() {
uni.showLoading({ uni.showLoading({
title: "加载中", title: "加载中",
mask: true, mask: true,
@@ -245,7 +343,7 @@ export default {
}); });
} }
this.orderList = []; this.orderList = [];
this.getOrderList(this.current); this.searchOrderList(this.current);
uni.hideLoading(); uni.hideLoading();
}, },
@@ -307,6 +405,10 @@ export default {
*/ */
onExpress(order, sku) { onExpress(order, sku) {
sku.storeName = order.storeName; sku.storeName = order.storeName;
let data = {
...order,
...sku,
};
storage.setAfterSaleData(data); storage.setAfterSaleData(data);
uni.navigateTo({ uni.navigateTo({
@@ -361,31 +463,38 @@ page,
overflow-y: auto; overflow-y: auto;
height: calc(100vh - 44px - 80rpx - 104rpx); height: calc(100vh - 44px - 80rpx - 104rpx);
} }
.u-tabs-search { .u-tabs-search {
padding: 20rpx; padding: 20rpx;
background: #fff; background: #fff;
} }
.countMoney { .countMoney {
margin-left: 7rpx; margin-left: 7rpx;
color: $main-color; color: $main-color;
font-size: 28rpx; font-size: 28rpx;
} }
.seller-view { .seller-view {
background-color: #fff; background-color: #fff;
margin: 20rpx 0rpx; margin: 20rpx 0rpx;
padding: 0rpx 20rpx; padding: 0rpx 20rpx;
border-radius: 20rpx; border-radius: 20rpx;
.seller-info { .seller-info {
height: 70rpx; height: 70rpx;
.seller-name { .seller-name {
font-size: 28rpx; font-size: 28rpx;
display: flex; display: flex;
flex-direction: row; flex-direction: row;
.name { .name {
margin-left: 15rpx; margin-left: 15rpx;
margin-top: -2rpx; margin-top: -2rpx;
} }
} }
.order-sn { .order-sn {
font-size: 22rpx; font-size: 22rpx;
color: #909399; color: #909399;
@@ -429,6 +538,7 @@ page,
color: $main-color; color: $main-color;
} }
} }
.btn-view { .btn-view {
padding: 16rpx 0; padding: 16rpx 0;
@@ -438,10 +548,12 @@ page,
} }
} }
} }
.description { .description {
color: #909399; color: #909399;
size: 25rpx; size: 25rpx;
} }
.cannot_apply { .cannot_apply {
text-align: center; text-align: center;
font-size: 22rpx; font-size: 22rpx;
@@ -450,6 +562,10 @@ page,
height: 70rpx; height: 70rpx;
line-height: 70rpx; line-height: 70rpx;
} }
.not_center {
text-align: left;
}
.icon { .icon {
margin-right: 10rpx; margin-right: 10rpx;
} }
@@ -459,6 +575,7 @@ page,
display: flex; display: flex;
justify-content: flex-end; justify-content: flex-end;
} }
.default-btn { .default-btn {
background-color: #ffffff; background-color: #ffffff;
margin-left: 15rpx; margin-left: 15rpx;
@@ -469,9 +586,11 @@ page,
padding: 0 24rpx; padding: 0 24rpx;
border-radius: 200px; border-radius: 200px;
} }
.close { .close {
color: $light-color; color: $light-color;
} }
.border { .border {
border: 2rpx solid $light-color; border: 2rpx solid $light-color;
color: $light-color; color: $light-color;

View File

@@ -335,12 +335,6 @@ export default {
type: "error", type: "error",
}); });
return false; return false;
} else if (checkBankno(this.form.bankAccountNumber) === false) {
this.$refs.uToast.show({
title: "银行卡卡号不正确",
type: "error",
});
return false;
} else if (this.$u.test.chinese(this.form.bankAccountName) === false) { } else if (this.$u.test.chinese(this.form.bankAccountName) === false) {
this.$refs.uToast.show({ this.$refs.uToast.show({
title: "银行开户名输入错误", title: "银行开户名输入错误",

View File

@@ -10,7 +10,10 @@
<!-- 省市区 --> <!-- 省市区 -->
<div class="flex flex-a-c"> <div class="flex flex-a-c">
<span class="default" v-if="address.isDefault">默认</span> <span class="default" v-if="address.isDefault">默认</span>
<div class="address-list" v-if="address.consigneeAddressPath.length != 0"> <div
class="address-list"
v-if="address.consigneeAddressPath.length != 0"
>
<span <span
class="address-item" class="address-item"
v-for="(item, index) in address.consigneeAddressPath" v-for="(item, index) in address.consigneeAddressPath"
@@ -89,100 +92,124 @@
</view> </view>
<!-- 店铺商品信息 --> <!-- 店铺商品信息 -->
<div class="box box2" v-for="(item, index) in orderMessage.cartList" :key="index"> <div
<div @click="navigateToStore(item)"> class="box box2"
<div class="store-name"> v-for="(item, index) in orderMessage.cartList"
<span>{{ item.storeName }}</span> :key="index"
</div> >
</div> <div v-if="item.checked">
<div class="promotionNotice">{{ item.promotionNotice || "" }}</div> <div @click="navigateToStore(item)">
<div class="flex goods-item" v-for="(val, i) in item.skuList" :key="i"> <div class="store-name">
<div <span>{{ item.storeName }}</span>
class="goods-image"
@click="
navigateTo(
'/pages/product/goods?id=' +
val.goodsSku.id +
'&goodsId=' +
val.goodsSku.goodsId
)
"
:span="3"
>
<u-image
borderRadius="10rpx"
width="200rpx"
height="200rpx"
:src="val.goodsSku.thumbnail"
alt
/>
</div>
<div
@click="
navigateTo(
'/pages/product/goods?id=' +
val.goodsSku.id +
'&goodsId=' +
val.goodsSku.goodsId
)
"
class="goods-detail"
>
<div class="flex">
<p class="goods-name">{{ val.goodsSku.goodsName }}</p>
<span class="nums">x{{ val.num }}</span>
</div> </div>
<p class="goods-prices">
<span></span>
<span class="goods-price">{{ formatPrice(val.goodsSku.price)[0] }}</span>
<span>.{{ formatPrice(val.goodsSku.price)[1] }}</span>
</p>
</div> </div>
</div> <div class="promotionNotice">{{ item.promotionNotice || "" }}</div>
<u-row> <div
<u-col :offset="0" :span="4">发票信息</u-col> class="flex goods-item"
<u-col :span="8" class="tipsColor" textAlign="right" @click.native="invoice()"> v-for="(val, i) in item.checkedSkuList"
<span v-if="receiptList" :key="i"
>{{ receiptList.receiptTitle }} - {{ receiptList.receiptContent }}</span
>
<span v-else>不开发票</span>
</u-col>
</u-row>
<u-row>
<u-col
v-if="orderMessage.cartTypeEnum != 'VIRTUAL'"
:offset="0"
:span="9"
@click="shippingFlag = true"
>配送
</u-col>
<u-col
v-if="orderMessage.cartTypeEnum != 'VIRTUAL'"
:span="3"
textAlign="right"
@click="shippingFlag = true"
> >
{{ <div
shippingMethod.find((e) => { class="goods-image"
return e.value == shippingText; @click="
}).label navigateTo(
}} '/pages/product/goods?id=' +
</u-col> val.goodsSku.id +
</u-row> '&goodsId=' +
<u-row> val.goodsSku.goodsId
<u-col :offset="0" :span="4" class="tl" style="text-align: left">备注信息</u-col> )
<u-col :span="8" textAlign="right"> "
<u-input :span="3"
style="text-align: right" >
class="uinput" <u-image
v-model="remarkVal[index].remark" borderRadius="10rpx"
/> width="200rpx"
</u-col> height="200rpx"
</u-row> :src="val.goodsSku.thumbnail"
alt
/>
</div>
<div
@click="
navigateTo(
'/pages/product/goods?id=' +
val.goodsSku.id +
'&goodsId=' +
val.goodsSku.goodsId
)
"
class="goods-detail"
>
<div class="flex">
<p class="goods-name">{{ val.goodsSku.goodsName }}</p>
<span class="nums">x{{ val.num }}</span>
</div>
<p class="goods-prices">
<span></span>
<span class="goods-price">{{
$options.filters.goodsFormatPrice(val.purchasePrice)[0]
}}</span>
<span>.{{ $options.filters.goodsFormatPrice(val.purchasePrice)[1] }}</span>
</p>
</div>
</div>
<u-row>
<u-col :offset="0" :span="4">发票信息</u-col>
<u-col
:span="8"
class="tipsColor"
textAlign="right"
@click.native="invoice()"
>
<span v-if="receiptList"
>{{ receiptList.receiptTitle }} -
{{ receiptList.receiptContent }}</span
>
<span v-else>不开发票</span>
</u-col>
</u-row>
<u-row>
<u-col
v-if="orderMessage.cartTypeEnum != 'VIRTUAL'"
:offset="0"
:span="9"
@click="shippingFlag = true"
>配送
</u-col>
<u-col
v-if="orderMessage.cartTypeEnum != 'VIRTUAL'"
:span="3"
textAlign="right"
@click="shippingFlag = true"
>
{{
shippingMethod.find((e) => {
return e.value == shippingText;
}).label
}}
</u-col>
</u-row>
<u-row>
<u-col :offset="0" :span="4" class="tl" style="text-align: left"
>备注信息</u-col
>
<u-col :span="8" textAlign="right">
<u-input
style="text-align: right"
class="uinput"
v-model="remarkVal[index].remark"
/>
</u-col>
</u-row>
</div>
</div> </div>
<!-- 发票信息 --> <!-- 发票信息 -->
<invoices :res="receiptList" @callbackInvoice="callbackInvoice" v-if="invoiceFlag" /> <invoices
:res="receiptList"
@callbackInvoice="callbackInvoice"
v-if="invoiceFlag"
/>
<u-select v-model="shippingFlag" :list="shippingMethod"></u-select> <u-select v-model="shippingFlag" :list="shippingMethod"></u-select>
<div class="box box5" v-if="orderMessage.priceDetailDTO"> <div class="box box5" v-if="orderMessage.priceDetailDTO">
@@ -190,22 +217,30 @@
<u-row> <u-row>
<u-col :span="9">商品合计</u-col> <u-col :span="9">商品合计</u-col>
<u-col :span="3" textAlign="right"> <u-col :span="3" textAlign="right">
<span>{{ orderMessage.priceDetailDTO.goodsPrice | unitPrice }}</span> <span
>{{ orderMessage.priceDetailDTO.goodsPrice | unitPrice }}</span
>
</u-col> </u-col>
</u-row> </u-row>
</div> </div>
<div> <div>
<u-row> <u-row>
<u-col v-if="orderMessage.cartTypeEnum != 'VIRTUAL'" :span="7">运费</u-col> <u-col v-if="orderMessage.cartTypeEnum != 'VIRTUAL'" :span="7"
>运费</u-col
>
<u-col <u-col
v-if="orderMessage.cartTypeEnum != 'VIRTUAL'" v-if="orderMessage.cartTypeEnum != 'VIRTUAL'"
:span="5" :span="5"
class="tr tipsColor" class="tr tipsColor"
textAlign="right" textAlign="right"
> >
<span v-if="orderMessage.priceDetailDTO.freightPrice == 0">包邮</span> <span v-if="orderMessage.priceDetailDTO.freightPrice == 0"
>包邮</span
>
<span v-else <span v-else
>{{ orderMessage.priceDetailDTO.freightPrice | unitPrice }}</span >{{
orderMessage.priceDetailDTO.freightPrice | unitPrice
}}</span
> >
</u-col> </u-col>
</u-row> </u-row>
@@ -215,7 +250,10 @@
<u-col <u-col
:span="3" :span="3"
v-if="orderMessage.priceDetailDTO && orderMessage.priceDetailDTO.couponPrice" v-if="
orderMessage.priceDetailDTO &&
orderMessage.priceDetailDTO.couponPrice
"
textAlign="right" textAlign="right"
@click="GET_Discount()" @click="GET_Discount()"
> >
@@ -249,7 +287,9 @@
<u-col :span="6">活动优惠</u-col> <u-col :span="6">活动优惠</u-col>
<u-col :span="6" class="tr tipsColor" textAlign="right"> <u-col :span="6" class="tr tipsColor" textAlign="right">
<span v-if="orderMessage.priceDetailDTO.discountPrice" <span v-if="orderMessage.priceDetailDTO.discountPrice"
>-{{ orderMessage.priceDetailDTO.discountPrice | unitPrice }}</span >-¥{{
orderMessage.priceDetailDTO.discountPrice | unitPrice
}}</span
> >
<span v-else>0.00</span> <span v-else>0.00</span>
</u-col> </u-col>
@@ -275,9 +315,11 @@
<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">{{
formatPrice(orderMessage.priceDetailDTO.flowPrice)[0] $options.filters.goodsFormatPrice(orderMessage.priceDetailDTO.flowPrice)[0]
}}</span> }}</span>
<span>.{{ formatPrice(orderMessage.priceDetailDTO.flowPrice)[1] }} </span> <span
>.{{ $options.filters.goodsFormatPrice(orderMessage.priceDetailDTO.flowPrice)[1] }}
</span>
</div> </div>
<span v-else class="number" <span v-else class="number"
><span style="margin-right: 10rpx">{{ ><span style="margin-right: 10rpx">{{
@@ -379,7 +421,7 @@ export default {
item.route == "pages/tabbar/cart/cartList" || item.route == "pages/tabbar/cart/cartList" ||
item.route.indexOf("pages/product/goods") != -1 item.route.indexOf("pages/product/goods") != -1
) { ) {
uni.redirectTo({ uni.navigateTo({
url: item.route, url: item.route,
}); });
} }
@@ -413,13 +455,6 @@ export default {
mounted() {}, mounted() {},
methods: { methods: {
// 格式化金钱 1999 --> [1999,00]
formatPrice(val) {
if (typeof val == "undefined") {
return val;
}
return val.toFixed(2).split(".");
},
//发票回调 选择发票之后刷新购物车 //发票回调 选择发票之后刷新购物车
async callbackInvoice(val) { async callbackInvoice(val) {
this.invoiceFlag = false; this.invoiceFlag = false;
@@ -448,7 +483,9 @@ export default {
this.navigateTo( this.navigateTo(
`/pages/mine/address/address?from=cart&way=${ `/pages/mine/address/address?from=cart&way=${
this.routerVal.way this.routerVal.way
}&parentOrder=${encodeURIComponent(JSON.stringify(this.routerVal.parentOrder))}` }&parentOrder=${encodeURIComponent(
JSON.stringify(this.routerVal.parentOrder)
)}`
); );
}, },
@@ -483,9 +520,11 @@ export default {
this.orderMessage.storeCoupons && this.orderMessage.storeCoupons &&
Object.keys(this.orderMessage.storeCoupons)[0] Object.keys(this.orderMessage.storeCoupons)[0]
) { ) {
let storeMemberCouponsId = Object.keys(this.orderMessage.storeCoupons)[0]; let storeMemberCouponsId = Object.keys(
let storeCouponId = this.orderMessage.storeCoupons[storeMemberCouponsId] this.orderMessage.storeCoupons
.memberCoupon.id; )[0];
let storeCouponId =
this.orderMessage.storeCoupons[storeMemberCouponsId].memberCoupon.id;
selectedCoupon.push(storeCouponId); selectedCoupon.push(storeCouponId);
} }
this.orderMessage.cartList.forEach((item) => { this.orderMessage.cartList.forEach((item) => {
@@ -565,7 +604,7 @@ export default {
}); });
// 如果当前价格为0跳转到订单列表 // 如果当前价格为0跳转到订单列表
if (this.orderMessage.priceDetailDTO.billPrice == 0) { if (this.orderMessage.priceDetailDTO.billPrice == 0) {
uni.redirectTo({ uni.navigateTo({
url: "/pages/order/myOrder?status=0", url: "/pages/order/myOrder?status=0",
}); });
} else { } else {
@@ -608,9 +647,8 @@ export default {
// 如果没有商品选择地址的话 则选择 默认地址 // 如果没有商品选择地址的话 则选择 默认地址
API_Address.getAddressDefault().then((res) => { API_Address.getAddressDefault().then((res) => {
if (res.data.result) { if (res.data.result) {
res.data.result.consigneeAddressPath = res.data.result.consigneeAddressPath.split( res.data.result.consigneeAddressPath =
"," res.data.result.consigneeAddressPath.split(",");
);
this.address = res.data.result; this.address = res.data.result;
} }
}); });
@@ -621,8 +659,16 @@ export default {
this.notSupportFreight = []; this.notSupportFreight = [];
// 获取结算参数 // 获取结算参数
API_Trade.getCheckoutParams(this.routerVal.way).then((res) => { API_Trade.getCheckoutParams(this.routerVal.way).then((res) => {
if (
!res.data.result.checkedSkuList ||
res.data.result.checkedSkuList.length === 0
) {
uni.switchTab({
url: "/pages/tabbar/cart/cartList",
});
}
if (res.data.result.skuList.length <= 0) { if (res.data.result.skuList.length <= 0) {
uni.redirectTo({ uni.navigateTo({
url: "/pages/order/myOrder?status=0", url: "/pages/order/myOrder?status=0",
}); });
} }
@@ -645,9 +691,8 @@ export default {
this.getUserAddress(); this.getUserAddress();
} else { } else {
this.address = res.data.result.memberAddress; this.address = res.data.result.memberAddress;
res.data.result.memberAddress.consigneeAddressPath = res.data.result.memberAddress.consigneeAddressPath.split( res.data.result.memberAddress.consigneeAddressPath =
"," res.data.result.memberAddress.consigneeAddressPath.split(",");
);
} }
if ( if (

View File

@@ -1,15 +1,43 @@
<template> <template>
<view class="content"> <view class="content">
<view class="navbar"> <view class="navbar">
<view v-for="(item, index) in navList" :key="index" class="nav-item" :class="{ current: tabCurrentIndex === index }" @click="tabClick(index)">{{ item.text }}</view> <view
v-for="(item, index) in navList"
:key="index"
class="nav-item"
:class="{ current: tabCurrentIndex === index }"
@click="tabClick(index)"
>{{ item.text }}</view
>
</view> </view>
<swiper :current="tabCurrentIndex" class="swiper-box" duration="300" @change="changeTab"> <swiper
<swiper-item class="tab-content" v-for="(tabItem, tabIndex) in navList" :key="tabIndex"> :current="tabCurrentIndex"
<scroll-view class="list-scroll-content" scroll-y @scrolltolower="loadData(tabIndex)"> class="swiper-box"
duration="300"
@change="changeTab"
>
<swiper-item
class="tab-content"
v-for="(tabItem, tabIndex) in navList"
:key="tabIndex"
>
<scroll-view
class="list-scroll-content"
scroll-y
@scrolltolower="loadData(tabIndex)"
>
<!-- 空白页 --> <!-- 空白页 -->
<u-empty text="暂无订单" mode="list" v-if="tabItem.loaded === true && tabItem.orderList.length === 0"></u-empty> <u-empty
text="暂无订单"
mode="list"
v-if="tabItem.loaded === true && tabItem.orderList.length === 0"
></u-empty>
<!-- 订单列表 --> <!-- 订单列表 -->
<view class="seller-view" :key="oderIndex" v-for="(order, oderIndex) in tabItem.orderList"> <view
class="seller-view"
:key="oderIndex"
v-for="(order, oderIndex) in tabItem.orderList"
>
<!-- 店铺名称 --> <!-- 店铺名称 -->
<view class="seller-info u-flex u-row-between"> <view class="seller-info u-flex u-row-between">
<view class="seller-name" @click="navigateToStore(order)"> <view class="seller-name" @click="navigateToStore(order)">
@@ -21,13 +49,32 @@
</view> </view>
<view> <view>
<view> <view>
<view class="goods-item-view" @click="navigateToOrderDetail(order.sn)"> <view
<view class="goods-img" v-for="(goods, goodsIndex) in order.orderItems" :key="goodsIndex"> class="goods-item-view"
<u-image border-radius="6" width="100%" height="100%" :src="goods.image"></u-image> @click="navigateToOrderDetail(order.sn)"
>
<view
class="goods-img"
v-for="(goods, goodsIndex) in order.orderItems"
:key="goodsIndex"
>
<u-image
border-radius="6"
width="100%"
height="100%"
:src="goods.image"
></u-image>
</view> </view>
<view class="goods-info"> <view class="goods-info">
<view v-if="order.orderItems.length <= 1" class="goods-title u-line-2">{{ order.groupName }}</view> <view
<view v-if="order.orderItems.length <= 1" class="goods-price"> v-if="order.orderItems.length <= 1"
class="goods-title u-line-2"
>{{ order.groupName }}</view
>
<view
v-if="order.orderItems.length <= 1"
class="goods-price"
>
{{ order.flowPrice | unitPrice }} {{ order.flowPrice | unitPrice }}
</view> </view>
</view> </view>
@@ -45,19 +92,56 @@
</view> </view>
<view> <view>
<!-- 全部 --> <!-- 全部 -->
<u-button ripple class="pay-btn" shape="circle" size="mini" v-if="order.allowOperationVO.pay" @click="waitPay(order)">立即付款</u-button> <u-button
ripple
class="pay-btn"
shape="circle"
size="mini"
v-if="order.allowOperationVO.pay"
@click="waitPay(order)"
>立即付款</u-button
>
<!-- 取消订单 --> <!-- 取消订单 -->
<u-button ripple class="cancel-btn" shape="circle" size="mini" v-if="order.allowOperationVO.cancel" @click="onCancel(order.sn)"> <u-button
ripple
class="cancel-btn"
shape="circle"
size="mini"
v-if="order.allowOperationVO.cancel"
@click="onCancel(order.sn)"
>
取消订单 取消订单
</u-button> </u-button>
<!-- 等待收货 --> <!-- 等待收货 -->
<u-button ripple shape="circle" class="rebuy-btn" size="mini" v-if="order.allowOperationVO.showLogistics" @click="navigateToLogistics(order)"> <u-button
ripple
shape="circle"
class="rebuy-btn"
size="mini"
v-if="order.allowOperationVO.showLogistics"
@click="navigateToLogistics(order)"
>
查看物流 查看物流
</u-button> </u-button>
<u-button ripple :customStyle="{'background':lightColor,'color':'#fff' }" shape="circle" class="pay-btn" size="mini" v-if="order.allowOperationVO.rog" @click="onRog(order.sn)"> <u-button
ripple
:customStyle="{ background: lightColor, color: '#fff' }"
shape="circle"
class="pay-btn"
size="mini"
v-if="order.allowOperationVO.rog"
@click="onRog(order.sn)"
>
确认收货 确认收货
</u-button> </u-button>
<u-button ripple shape="circle" class="cancel-btn" size="mini" v-if="order.groupAfterSaleStatus.includes('NOT_APPLIED')" @click="applyService(order)"> <u-button
ripple
shape="circle"
class="cancel-btn"
size="mini"
v-if="order.groupAfterSaleStatus && order.groupAfterSaleStatus.includes('NOT_APPLIED')"
@click="applyService(order)"
>
退款/售后 退款/售后
</u-button> </u-button>
<!-- TODO 后续完善 --> <!-- TODO 后续完善 -->
@@ -75,26 +159,57 @@
</scroll-view> </scroll-view>
</swiper-item> </swiper-item>
</swiper> </swiper>
<u-popup class="cancel-popup" v-model="cancelShow" mode="bottom" length="60%"> <u-popup
class="cancel-popup"
v-model="cancelShow"
mode="bottom"
length="60%"
>
<view class="header">取消订单</view> <view class="header">取消订单</view>
<view class="body"> <view class="body">
<view class="title">取消订单后,本单享有的优惠可能会一并取消,是否继续?</view> <view class="title"
>取消订单后,本单享有的优惠可能会一并取消,是否继续?</view
>
<view> <view>
<u-radio-group v-model="reason"> <u-radio-group v-model="reason">
<view class="value"> <view class="value">
<view class="radio-view" :key="index" v-for="(item, index) in cancelList"> <view
<u-radio :active-color="lightColor" label-size="25" shape="circle" :name="item.reason" @change="reasonChange">{{ item.reason }}</u-radio> class="radio-view"
:key="index"
v-for="(item, index) in cancelList"
>
<u-radio
:active-color="lightColor"
label-size="25"
shape="circle"
:name="item.reason"
@change="reasonChange"
>{{ item.reason }}</u-radio
>
</view> </view>
</view> </view>
</u-radio-group> </u-radio-group>
</view> </view>
</view> </view>
<view class="footer"> <view class="footer">
<u-button size="medium" ripple v-if="reason" shape="circle" @click="submitCancel">提交</u-button> <u-button
size="medium"
ripple
v-if="reason"
shape="circle"
@click="submitCancel"
>提交</u-button
>
</view> </view>
</u-popup> </u-popup>
<u-toast ref="uToast" /> <u-toast ref="uToast" />
<u-modal :confirm-color="lightColor" v-model="rogShow" :show-cancel-button="true" :content="'是否确认收货?'" @confirm="confirmRog"></u-modal> <u-modal
:confirm-color="lightColor"
v-model="rogShow"
:show-cancel-button="true"
:content="'是否确认收货?'"
@confirm="confirmRog"
></u-modal>
</view> </view>
</template> </template>
@@ -196,17 +311,28 @@ export default {
*/ */
onBackPress(e) { onBackPress(e) {
if (e.from == "backbutton") { if (e.from == "backbutton") {
uni.reLaunch({ uni.switchTab({
url: "/pages/tabbar/user/my", url: "/pages/tabbar/user/my",
}); });
return true; //阻止默认返回行为 return true; //阻止默认返回行为
} }
}, },
onPullDownRefresh() { onPullDownRefresh() {
this.loadData(this.status); if (this.tabCurrentIndex) {
this.initData(this.tabCurrentIndex);
} else {
this.initData(0);
}
// this.loadData(this.status);
},
onShow() {
if(this.$options.filters.tipsToLogin()){
if (!this.tabCurrentIndex) {
this.initData(0);
}
}
// this.loadData(this.status);
}, },
onLoad(options) { onLoad(options) {
/** /**
@@ -215,11 +341,11 @@ export default {
*/ */
let status = Number(options.status); let status = Number(options.status);
this.status = status; this.status = status;
this.tabCurrentIndex = status; this.tabCurrentIndex = status;
if (status == 0) { // if (status == 0) {
this.loadData(status); // this.loadData(status);
} // }
}, },
watch: { watch: {
@@ -236,16 +362,11 @@ export default {
}, },
}, },
methods: { methods: {
// 售后 // 售后
applyService(order){ applyService(order) {
uni.navigateTo({ uni.navigateTo({
url: `/pages/order/afterSales/afterSales?orderSn=${order.sn}` url: `/pages/order/afterSales/afterSales?orderSn=${order.sn}`,
}); });
}, },
// 店铺详情 // 店铺详情
@@ -314,6 +435,7 @@ export default {
*/ */
loadData(index) { loadData(index) {
this.params.pageNumber = this.navList[index].pageNumber; this.params.pageNumber = this.navList[index].pageNumber;
// this.params.tag = this.orderStatus[index].orderStatus;
getOrderList(this.params).then((res) => { getOrderList(this.params).then((res) => {
uni.stopPullDownRefresh(); uni.stopPullDownRefresh();
if (!res.data.success) { if (!res.data.success) {

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,164 @@
<template>
<view class="container">
<u-navbar title="扫码登录授权"></u-navbar>
<view class="wx-auth-container">
<div class="box">
<!-- <div v-if="!errorMsg"> -->
<div>
<view class="small-tips flex flex-center">
<u-image
width="400rpx"
height="300rpx"
src="https://lili-system.oss-cn-beijing.aliyuncs.com/confirm.png"
></u-image>
<div>电脑端登录确认</div>
<div>为确保帐号安全请确认是您本人操作</div>
</view>
<view class="btns">
<button @click="confirmLogin()" class="btn-auth">确认登录</button>
<div @click="cancelLogin()" class="btn-callback">取消登录</div>
</view>
</div>
</div>
</view>
</view>
</template>
<script>
import { scannerCodeLogin, scannerCodeLoginConfirm } from "@/api/login";
export default {
data() {
return {
errorMsg: "",
token: "",
};
},
watch: {
errorMsg(val) {
if (val) {
uni.showToast({
title: val,
icon: "none",
});
// uni.navigateBack()
}
},
},
onShow() {
this.$options.filters.forceLogin();
scannerCodeLogin({ token: this.token }).then((res) => {
if (res.data.code == 200) {
let code = res.data.result;
switch (code) {
case 0:
case 1:
this.errorMsg = "";
break;
case 2:
case 3:
this.errorMsg = "请勿重复扫码";
break;
case 4:
this.errorMsg = "二维码已过期,重新扫码";
break;
default:
this.errorMsg = "状态异常";
}
} else {
this.errorMsg = res.data.message;
}
});
},
onLoad(params) {
this.token = params.token;
if (this.token == undefined || this.token == "") {
this.errorMsg = "信息异常";
}
},
methods: {
confirmLogin() {
this.config(1);
},
cancelLogin() {
this.config(0);
},
config(code) {
scannerCodeLoginConfirm({ token: this.token, code: code }).then((res) => {
let title = res.data.success ? "操作成功" : "操作失败";
uni.showToast({
title: title,
duration: 1500,
icon: "none",
});
setTimeout(function () {
uni.navigateBack();
}, 1000);
});
},
},
};
</script>
<style lang="scss" scoped>
page {
background: #fff;
}
</style>
<style lang="scss" scoped>
.container {
background-color: #fff;
width: 100vw;
height: 100vh;
}
.wx-auth-container {
width: 100%;
background: #fff;
margin-top: 20%;
}
text.title,
text.shop {
display: inline-block;
font-size: 60rpx;
color: #333;
}
.box {
margin: 0 32rpx;
}
/* 文字提示*/
.small-tips {
width: 100%;
padding: 20rpx;
font-size: 29rpx;
margin: 0 0 20rpx;
color: #999;
}
.btn-auth {
width: 92%;
background: $main-color;
color: #fff;
margin: 0 auto 40rpx;
border-radius: 100px;
}
.btn-callback {
text-align: center;
font-size: 30rpx;
background: #ededed;
height: 90rpx;
line-height: 90rpx;
border-radius: 100px;
width: 92%;
margin: 0 auto;
}
.btns {
margin-top: 100rpx;
display: flex;
flex-direction: column;
width: 100%;
justify-content: center;
}
</style>

View File

@@ -43,7 +43,7 @@ export default {
getUserProfile() { getUserProfile() {
let code = "WECHAT"; let code = "WECHAT";
let buyer = api.buyer; let buyer = api.buyer;
window.open(buyer + `/connect/login/web/` + code, "_self"); window.open(buyer + `/passport/connect/connect/login/web/` + code, "_self");
}, },
backToHome() { backToHome() {
uni.switchTab({ uni.switchTab({
@@ -55,11 +55,9 @@ export default {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.wx-auth-container { .wx-auth-container {
width: 100%; width: 100%;
margin-top: 20%; margin-top: 20%;
} }

View File

@@ -7,7 +7,7 @@
<!-- 分享 --> <!-- 分享 -->
<shares <shares
v-if="shareFlage && goodsDetail.id" v-if="enableShare && goodsDetail.id"
:skuId="this.routerVal.id" :skuId="this.routerVal.id"
:goodsId="this.routerVal.goodsId" :goodsId="this.routerVal.goodsId"
:link=" :link="
@@ -19,7 +19,7 @@
:thumbnail="goodsDetail.thumbnail" :thumbnail="goodsDetail.thumbnail"
:goodsName="goodsDetail.goodsName" :goodsName="goodsDetail.goodsName"
type="goods" type="goods"
@close="shareFlage = false" @close="enableShare = false"
/> />
<popups <popups
v-model="popupsSwitch" v-model="popupsSwitch"
@@ -116,7 +116,7 @@
<view class="card-box top-radius-0" id="main2"> <view class="card-box top-radius-0" id="main2">
<!-- 活动不显示价钱 --> <!-- 活动不显示价钱 -->
<view v-if="!promotionFlag" class="desc-bold -goods-msg"> <view v-if="isSeckill || isGroup" class="desc-bold -goods-msg">
<view class="-goods-flex"> <view class="-goods-flex">
<view class="desc-bold"> <view class="desc-bold">
{{ goodsDetail.goodsName || "" }} {{ goodsDetail.goodsName || "" }}
@@ -150,9 +150,14 @@
</span> </span>
<span v-else> <span v-else>
<span>¥</span <span v-if="wholesaleList.length">
><span class="price">{{ formatPrice(goodsDetail.price)[0] }}</span <span>¥</span><span class="price">{{ $options.filters.goodsFormatPrice(wholesaleList[wholesaleList.length-1].price)[0] }}</span>.{{ $options.filters.goodsFormatPrice(wholesaleList[wholesaleList.length-1].price)[1] }}
>.{{ formatPrice(goodsDetail.price)[1] }} ~
<span>¥</span><span class="price">{{ $options.filters.goodsFormatPrice(wholesaleList[0].price)[0] }}</span>.{{ $options.filters.goodsFormatPrice(wholesaleList[0].price)[1] }}
</span>
<span v-else>
<span>¥</span><span class="price">{{ $options.filters.goodsFormatPrice(goodsDetail.price)[0] }}</span>.{{ $options.filters.goodsFormatPrice(goodsDetail.price)[1] }}
</span>
</span> </span>
</view> </view>
<view class="-goods-price" v-else> <view class="-goods-price" v-else>
@@ -348,6 +353,7 @@
:id="productId" :id="productId"
v-if="goodsDetail.id" v-if="goodsDetail.id"
:pointDetail="pointDetail" :pointDetail="pointDetail"
:wholesaleList="wholesaleList"
@handleClickSku="selectSku" @handleClickSku="selectSku"
:buyMask="buyMask" :buyMask="buyMask"
/> />
@@ -382,7 +388,6 @@ 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 setup from "./product/popup/popup"; import setup from "./product/popup/popup";
export default { export default {
components: { components: {
@@ -405,7 +410,6 @@ export default {
return { return {
setup, setup,
promotionShow: false, //弹窗开关 promotionShow: false, //弹窗开关
promotionFlag: true, //活动开关
// #ifdef H5 // #ifdef H5
navbarListX: 110, //导航栏列表栏x轴 navbarListX: 110, //导航栏列表栏x轴
navbarListY: 80, //导航栏列表栏y轴 navbarListY: 80, //导航栏列表栏y轴
@@ -442,9 +446,10 @@ export default {
}, },
], ],
popupsSwitch: false, //导航栏列表栏开关 popupsSwitch: false, //导航栏列表栏开关
shareFlage: false, enableShare: false,
selectedGoods: "", //选择的商品规格昵称 selectedGoods: "", //选择的商品规格昵称
isGroup: false, // 是否是拼团活动 isGroup: false, // 是否是拼团活动
isSeckill:false, // 是否秒杀活动
pointDetail: "", // 是否是积分商品 pointDetail: "", // 是否是积分商品
assemble: "", //拼团的sku assemble: "", //拼团的sku
navbarOnlyBack: { navbarOnlyBack: {
@@ -480,7 +485,6 @@ export default {
id: "4", id: "4",
}, },
], ],
oldtabScrollTop: 0,
tabScrollTop: null, tabScrollTop: null,
scrollArr: [], scrollArr: [],
scrollId: "1", scrollId: "1",
@@ -524,10 +528,12 @@ export default {
routerVal: "", routerVal: "",
IMLink: "", // IM地址 IMLink: "", // IM地址
wholesaleList:[]
}; };
}, },
computed: { computed: {
// udesk IM
IM() { IM() {
return this.IMLink + this.storeDetail.merchantEuid; return this.IMLink + this.storeDetail.merchantEuid;
}, },
@@ -540,10 +546,7 @@ export default {
this.$refs.popupGoods.buyType = "PINTUAN"; this.$refs.popupGoods.buyType = "PINTUAN";
clearInterval(timer); clearInterval(timer);
}, 100); }, 100);
this.promotionFlag = false;
} else { } else {
this.promotionFlag = true;
this.$refs.popupGoods.buyType = ""; this.$refs.popupGoods.buyType = "";
} }
}, },
@@ -602,15 +605,7 @@ export default {
this.init(this.routerVal.id, this.routerVal.goodsId, this.routerVal.distributionId); this.init(this.routerVal.id, this.routerVal.goodsId, this.routerVal.distributionId);
} }
}, },
// #ifdef MP-WEIXIN
onShareAppMessage(res) {
return {
path: this.share(),
title: `[好友推荐]${this.goodsDetail.goodsName}`,
imageUrl: this.goodsDetail.goodsGalleryList[0],
};
},
// #endif
methods: { methods: {
share() { 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}`;
@@ -661,6 +656,7 @@ export default {
} }
/**商品信息以及规格信息存储 */ /**商品信息以及规格信息存储 */
this.goodsDetail = response.data.result.data; this.goodsDetail = response.data.result.data;
this.wholesaleList = response.data.result.wholesaleList;
this.goodsSpec = response.data.result.specs; this.goodsSpec = response.data.result.specs;
this.PromotionList = response.data.result.promotionMap; this.PromotionList = response.data.result.promotionMap;
this.goodsParams = response.data.result.goodsParamsDTOList || []; this.goodsParams = response.data.result.goodsParamsDTOList || [];
@@ -676,6 +672,10 @@ export default {
if (item.indexOf("POINTS_GOODS") == 0) { if (item.indexOf("POINTS_GOODS") == 0) {
this.pointDetail = this.PromotionList[item]; this.pointDetail = this.PromotionList[item];
} }
// 秒杀
if (item.indexOf("SECKILL") == 0) {
this.isSeckill = true
}
}); });
// 轮播图 // 轮播图
this.imgList = this.goodsDetail.goodsGalleryList; this.imgList = this.goodsDetail.goodsGalleryList;
@@ -708,49 +708,50 @@ export default {
}, },
linkMsgDetail() { linkMsgDetail() {
if (this.storeDetail.merchantEuid) { // lili 基础客服
uni.navigateTo({
url: `/pages/tabbar/home/web-view?src=${this.IM}`, uni.navigateTo({
}); url: `/pages/tabbar/home/web-view?IM=${this.storeDetail.storeId}`,
} else { });
// 客服
// #ifdef MP-WEIXIN // udesk 代码
const params = { // if (this.storeDetail.merchantEuid) {
storeName: this.storeDetail.storeName, // uni.navigateTo({
goodsName: this.goodsDetail.goodsName, // url: `/pages/tabbar/home/web-view?src=${this.IM}`,
goodsId: this.goodsDetail.goodsId, // });
goodsImg: this.goodsDetail.thumbnail, // }
price: this.goodsDetail.promotionPrice || this.goodsDetail.price,
// originalPrice: this.goodsDetail.original || this.goodsDetail.price,
uuid: storage.getUuid(), // 客服 云智服代码
token: storage.getAccessToken(), // // #ifdef MP-WEIXIN
sign: this.storeDetail.yzfSign, // const params = {
mpSign: this.storeDetail.yzfMpSign, // storeName: this.storeDetail.storeName,
}; // goodsName: this.goodsDetail.goodsName,
uni.navigateTo({ // goodsId: this.goodsDetail.goodsId,
url: // goodsImg: this.goodsDetail.thumbnail,
"/pages/product/customerservice/index?params=" + // price: this.goodsDetail.promotionPrice || this.goodsDetail.price,
encodeURIComponent(JSON.stringify(params)), // // originalPrice: this.goodsDetail.original || this.goodsDetail.price,
}); // uuid: storage.getUuid(),
// #endif // token: storage.getAccessToken(),
// #ifndef MP-WEIXIN // sign: this.storeDetail.yzfSign,
const sign = this.storeDetail.yzfSign; // mpSign: this.storeDetail.yzfMpSign,
uni.navigateTo({ // };
url: // uni.navigateTo({
"/pages/tabbar/home/web-view?src=https://yzf.qq.com/xv/web/static/chat/index.html?sign=" + // url:
sign, // "/pages/product/customerservice/index?params=" +
}); // encodeURIComponent(JSON.stringify(params)),
// #endif // });
} // // #endif
// // #ifndef MP-WEIXIN
// const sign = this.storeDetail.yzfSign;
// uni.navigateTo({
// url:
// "/pages/tabbar/home/web-view?src=https://yzf.qq.com/xv/web/static/chat/index.html?sign=" +
// sign,
// });
// // #endif
}, },
// 格式化金钱 1999 --> [1999,00]
formatPrice(val) {
if (typeof val == "undefined") {
return val;
}
return val.toFixed(2).split(".");
},
/**选择商品 */ /**选择商品 */
changedGoods(val) { changedGoods(val) {
this.selectedGoods = val; this.selectedGoods = val;
@@ -1057,7 +1058,7 @@ export default {
* 点击分享 * 点击分享
*/ */
async shareChange() { async shareChange() {
this.shareFlage = true; this.enableShare = true;
}, },
}, },
}; };

View File

@@ -1,169 +1,20 @@
<template> <template>
<view class="recommend-box" > <view class="recommend-box" >
<h4 class="goods-recommend-title">宝贝推荐</h4> <h4 class="goods-recommend-title">宝贝推荐</h4>
<view class="like-goods-list"> <goodsList :res='res' v-if="res" :storeName="false" />
<view class="like-goods-list"> </view>
<view
class="like-goods-item"
@click="clickGoods(item)"
v-for="(item, index) in res"
:key="index"
>
<u-image
:fade="true"
duration="450"
:lazy-load="true"
:src="item.content.thumbnail"
width="330rpx"
height="330rpx"
class="like-goods-uimage"
>
<u-loading slot="loading"></u-loading>
</u-image>
<view style="background-color: #ffffff; width: 100%">
<view class="name">{{ item.content.goodsName }}</view>
<view class="price-sales">
<div class="item-price" v-if="item.content.price != undefined">
<span>{{ formatPrice(item.content.price)[0] }}</span>
.{{formatPrice(item.content.price)[1]}}
<!-- <text v-if="item.point != undefined">+{{ item.point }}积分</text> -->
</div>
</view>
</view>
</view>
</view>
</view>
</view>
</template> </template>
<script> <script>
import goodsList from '@/components/m-goods-list/list.vue'
export default { export default {
props: ["res"], props: ["res"],
components:{goodsList},
methods: { methods: {
// 点击店铺推荐
clickGoods(val) {
uni.navigateTo({
url: `/pages/product/goods?id=${val.content.id}&goodsId=${val.content.goodsId}`
});
},
// 格式化金钱 1999 --> [1999,00]
formatPrice(val) {
if (typeof val == "undefined") {
return val;
}
return val.toFixed(2).split(".");
} }
}
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@import "../mp-goods.scss";
@import "../product.scss"; @import "../product.scss";
.goods_recomm {
padding: 12px 0 20rpx 20rpx;
color: #000;
font-size: 30rpx;
font-weight: 400;
margin-bottom: 28rpx;
}
.like-goods-uimage {
/deep/ .u-image {
height: 350rpx !important;
}
width: 100%;
}
.recommend-box {
background-color: #ffffff;
width: 100%;
padding-bottom: 120rpx;
.title {
width: 120rpx;
height: 42rpx;
font-size: 30rpx;
font-weight: 700;
text-align: left;
color: #333333;
margin-left: 20rpx;
}
}
.like-goods-list {
display: flex;
width: 100%;
flex-wrap: wrap;
}
.like-goods-item {
padding: 0 !important;
width: 48%;
margin: 0 1% 10rpx 1%;
background: #f7f7f7;
border-radius: 12rpx;
overflow: hidden;
/deep/ .u-image {
width: 100%;
}
}
.like-goods-list {
// background-color: #f8f8f8;
width: 100%;
margin-bottom: 100rpx;
.name {
padding: 14rpx 8rpx 0 8rpx;
color: #333;
font-size: 24rpx;
display: -webkit-box;
overflow: hidden;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
background: #f7f7f7;
height: 80rpx;
}
.price-sales {
padding: 8rpx;
background: #f7f7f7;
display: flex;
justify-content: space-between;
align-items: center;
.item-price {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
font-size: 26rpx;
text-align: left;
color: $price-color;
line-height: 23px;
font-weight: bold;
> span {
font-size: 32rpx;
}
}
.sales {
line-height: 23px;
font-size: 22rpx;
text-align: left;
letter-spacing: 0;
color: #cccccc;
// padding-right: 10rpx;
}
}
}
</style> </style>

View File

@@ -21,15 +21,15 @@
> >
<span class="flex-price"> <span class="flex-price">
{{ formatPrice(detail.promotionPrice)[0] }}.{{ {{ $options.filters.goodsFormatPrice(detail.promotionPrice)[0] }}.{{
formatPrice(detail.promotionPrice)[1] $options.filters.goodsFormatPrice(detail.promotionPrice)[1]
}}</span }}</span
> >
</span> </span>
<view class="u-group-flex" v-if="detail.price != undefined"> <view class="u-group-flex" v-if="detail.price != undefined">
<span class="old-price" <span class="old-price"
>¥{{ formatPrice(detail.price)[0] }}.{{ >¥{{ $options.filters.goodsFormatPrice(detail.price)[0] }}.{{
formatPrice(detail.price)[1] $options.filters.goodsFormatPrice(detail.price)[1]
}}</span }}</span
> >
<view class="promotion">限时抢购</view> <view class="promotion">限时抢购</view>
@@ -42,8 +42,8 @@
<span <span
class="flex-price" class="flex-price"
v-if="promotion.groupbuy_goods_vo.price != undefined" v-if="promotion.groupbuy_goods_vo.price != undefined"
>¥{{ formatPrice(promotion.groupbuy_goods_vo.price)[0] }}.{{ >¥{{ $options.filters.goodsFormatPrice(promotion.groupbuy_goods_vo.price)[0] }}.{{
formatPrice(promotion.groupbuy_goods_vo.price)[1] $options.filters.goodsFormatPrice(promotion.groupbuy_goods_vo.price)[1]
}}</span }}</span
> >
<!-- <span v-if="promotion.point">+{{promotion.point}}积分</span> --> <!-- <span v-if="promotion.point">+{{promotion.point}}积分</span> -->
@@ -53,9 +53,9 @@
class="old-price" class="old-price"
v-if="promotion.groupbuy_goods_vo.original_price != undefined" v-if="promotion.groupbuy_goods_vo.original_price != undefined"
>¥{{ >¥{{
formatPrice(promotion.groupbuy_goods_vo.original_price)[0] $options.filters.goodsFormatPrice(promotion.groupbuy_goods_vo.original_price)[0]
}}.{{ }}.{{
formatPrice(promotion.groupbuy_goods_vo.original_price)[1] $options.filters.goodsFormatPrice(promotion.groupbuy_goods_vo.original_price)[1]
}}</span }}</span
> >
<view class="promotion">团购活动</view> <view class="promotion">团购活动</view>
@@ -68,13 +68,13 @@
v-if="detail.promotionPrice != undefined" v-if="detail.promotionPrice != undefined"
> >
¥<span class="flex-price"> ¥<span class="flex-price">
{{ formatPrice(detail.promotionPrice)[0] }}.</span {{ $options.filters.goodsFormatPrice(detail.promotionPrice)[0] }}.</span
>{{ formatPrice(detail.promotionPrice)[1] }} >{{ $options.filters.goodsFormatPrice(detail.promotionPrice)[1] }}
</span> </span>
<view class="u-group-flex" v-if="detail.price != undefined"> <view class="u-group-flex" v-if="detail.price != undefined">
<span class="old-price" <span class="old-price"
>¥{{ formatPrice(detail.price)[0] }}.{{ >¥{{ $options.filters.goodsFormatPrice(detail.price)[0] }}.{{
formatPrice(detail.price)[1] $options.filters.goodsFormatPrice(detail.price)[1]
}}</span }}</span
> >
<view class="promotion">拼团活动</view> <view class="promotion">拼团活动</view>
@@ -141,13 +141,6 @@ export default {
}, },
mounted() {}, mounted() {},
methods: { methods: {
// 格式化金钱 1999 --> [1999,00]
formatPrice(val) {
if (typeof val == "undefined") {
return val;
}
return val.toFixed(2).split(".");
},
getCountDownTime(val) { getCountDownTime(val) {
let date = new Date(val); let date = new Date(val);
let timeSimple = new Date(date).getTime() / 1000; let timeSimple = new Date(date).getTime() / 1000;

View File

@@ -1,184 +1,184 @@
<template> <template>
<view class="wrapper"> <view class="wrapper">
<div class="coupon-empty" v-if="!res">暂无优惠券</div> <div class="coupon-empty" v-if="!res">暂无优惠券</div>
<view class="coupon-List" v-for="(item, index) in couponRes" :key="index"> <view class="coupon-List" v-for="(item, index) in couponRes" :key="index">
<view class="coupon-item"> <view class="coupon-item">
<view class="top"> <view class="top">
<div class="price"> <div class="price">
<span v-if="item.couponType == 'DISCOUNT'">{{ item.couponDiscount }}</span> <span v-if="item.couponType == 'DISCOUNT'">{{ item.couponDiscount }}</span>
<span v-if="item.couponType == 'PRICE'">{{ item.price | unitPrice }}</span> <span v-if="item.couponType == 'PRICE'">{{ item.price | unitPrice }}</span>
</div> </div>
<view class="text"> <view class="text">
<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.id == 'platform'" <span v-if="item.scopeType == 'ALL' && item.storeId == '0'">全平台</span>
>全平台</span <span v-if="item.scopeType == 'PORTION_CATEGORY'">仅限品类</span>
> <view v-else>{{
<span v-if="item.scopeType == 'PORTION_CATEGORY'">仅限品类</span> item.storeName == "platform" ? "全平台" : item.storeName + "店铺"
<view v-else }}使用</view>
>{{ </view>
item.storeName == "platform" ? "全平台" : item.storeName + "店铺" </div>
}}使</view <div>{{ item.consumeThreshold | unitPrice }}</div>
> </view>
</view> <view class="lingqu-btn" @click="getCoupon(item, index)">
</div> <div :class="yhqFlag[index] ? 'cur' : ''">
<div>{{ item.consumeThreshold | unitPrice }}可用</div> {{ yhqFlag[index] ? "已领取或领完" : "立即领取" }}
</view> </div>
<view class="lingqu-btn" @click="getCoupon(item, index)"> </view>
<div :class="yhqFlag[index] ? 'cur' : ''"> </view>
{{ yhqFlag[index] ? "已领取或领完" : "立即领取" }} <view class="line"></view>
</div> <view class="time">{{ item.startTime / 1000 | unixToDate }} - {{ item.endTime / 1000 | unixToDate }}</view>
</view> </view>
</view> </view>
<view class="line"></view> </view>
<view class="time">{{ item.startTime }} - {{ item.endTime }}</view> </template>
</view>
</view> <script>
</view> export default {
</template> data() {
return {
<script> yhqFlag: [], //获取优惠券判断是否点击
export default { couponRes: [],
data() { };
return { },
yhqFlag: [], //获取优惠券判断是否点击 props: {
couponRes: {}, res: {
}; type: null,
}, default: "",
props: { },
res: { },
type: null, watch: {
default: "", res: {
}, handler() {
}, if (this.res && this.res.length != 0) {
watch: { Object.keys(this.res).forEach((item) => {
res: { let key = item.split("-")[0];
handler() { if (key === "COUPON") {
if (this.res && this.res.length != 0) { this.couponRes.push(this?.res[item]);
Object.keys(this.res).forEach((item) => {
let key = item.split("-")[0]; }
if (key === "COUPON") { });
this.couponRes[item] = this?.res[item]; }
} },
}); immediate: true,
} },
}, },
immediate: true, methods: {
}, // 提交优惠券
}, getCoupon(item, index) {
methods: { this.yhqFlag[index] = true;
// 提交优惠券 this.$emit("getCoupon", item);
getCoupon(item, index) { },
this.yhqFlag[index] = true; },
this.$emit("getCoupon", item); };
}, </script>
},
}; <style lang="scss" scoped>
</script> .coupon-item {
width: 100%;
<style lang="scss" scoped> height: 100%;
.coupon-item { display: flex;
width: 100%; flex-direction: column;
height: 100%; justify-content: space-between;
display: flex; }
flex-direction: column;
justify-content: space-between; .coupon-List {
} display: flex;
.coupon-List { flex-direction: column;
display: flex; height: 230rpx;
flex-direction: column; background: #e9ebfb;
height: 230rpx; margin: 30rpx 0;
background: #e9ebfb; padding: 10rpx 30rpx;
margin: 30rpx 0;
padding: 10rpx 30rpx; .line {
height: 1px;
.line { background: #fff;
height: 1px; margin: 0 20rpx;
background: #fff; position: relative;
margin: 0 20rpx;
position: relative; &:before,
&:after {
&:before, content: "";
&:after { display: block;
content: ""; width: 15rpx;
display: block; height: 30rpx;
width: 15rpx; background: #fff;
height: 30rpx; position: absolute;
background: #fff; top: -15rpx;
position: absolute; }
top: -15rpx;
} &:before {
left: -50rpx;
&:before { }
left: -50rpx;
} &:after {
right: -50rpx;
&:after { }
right: -50rpx; }
}
} .time {
flex: 1;
.time { font-size: 24rpx;
flex: 1; align-items: center;
font-size: 24rpx; display: flex;
align-items: center; align-items: center;
display: flex; }
align-items: center; }
}
} .top {
height: 140rpx;
.top { display: flex;
height: 140rpx;
display: flex; .price {
width: 33%;
.price { justify-content: center;
width: 33%; color: #6772e5;
justify-content: center; font-size: 40rpx;
color: #6772e5; display: flex;
font-size: 40rpx;
display: flex; height: 100%;
align-items: center;
height: 100%;
align-items: center; span {
span { font-size: 50rpx;
font-size: 50rpx; }
} }
}
.text {
.text { width: 33%;
width: 33%; display: flex;
display: flex; flex-direction: column;
flex-direction: column; justify-content: center;
justify-content: center; font-size: 26rpx;
font-size: 26rpx; color: 333;
color: 333; margin-left: 40rpx;
margin-left: 40rpx;
.coupon-List-title {
.coupon-List-title { font-size: 30rpx;
font-size: 30rpx; font-weight: bold;
font-weight: bold; }
} }
}
.lingqu-btn {
.lingqu-btn { display: flex;
display: flex; align-items: center;
align-items: center; margin-left: 40rpx;
margin-left: 40rpx;
text { text {
width: 140rpx; width: 140rpx;
height: 40rpx; height: 40rpx;
text-align: center; text-align: center;
line-height: 40rpx; line-height: 40rpx;
color: #fff; color: #fff;
background: #6772e5; background: #6772e5;
border-radius: 5px; border-radius: 5px;
font-size: 26rpx; font-size: 26rpx;
&.cur { &.cur {
background: none; background: none;
transform: rotate(45deg) translate(10rpx, -46rpx); transform: rotate(45deg) translate(10rpx, -46rpx);
} }
} }
} }
} }
</style> </style>

View File

@@ -15,7 +15,7 @@
<span v-if="res[prom].freeFreightFlag">赠送包邮服务</span> <span v-if="res[prom].freeFreightFlag">赠送包邮服务</span>
</span> </span>
</div> </div>
<div class="res_prom_item" v-if="res[prom].fullRate"> <div class="res_prom_item" v-if="res[prom].fullRate && res[prom].fullRateFlag">
<u-tag text="打折" type="error"></u-tag> <u-tag text="打折" type="error"></u-tag>
<span class="pro-text" <span class="pro-text"
>{{ res[prom].fullMoney }}立享<span class="price" >{{ res[prom].fullMoney }}立享<span class="price"

View File

@@ -32,7 +32,7 @@
{{ item.content.goodsName }} {{ item.content.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">{{ formatPrice(item.content.price)[0] }}</span>.{{ formatPrice(item.content.price)[1] }} <span class="item-price-blod">{{ $options.filters.goodsFormatPrice(item.content.price)[0] }}</span>.{{ $options.filters.goodsFormatPrice(item.content.price)[1] }}
</view> </view>
</view> </view>
</view> </view>
@@ -48,13 +48,6 @@ export default {
props: ["res", "goodsDetail", "storeDetail"], props: ["res", "goodsDetail", "storeDetail"],
mounted() {}, mounted() {},
methods: { methods: {
// 格式化金钱 1999 --> [1999,00]
formatPrice(val) {
if (typeof val == "undefined") {
return val;
}
return val.toFixed(2).split(".");
},
// 点击商品 // 点击商品
clickGoods(val) { clickGoods(val) {
uni.navigateTo({ uni.navigateTo({

View File

@@ -82,13 +82,7 @@ export default {
this.storeList = []; this.storeList = [];
this.init(); this.init();
}, },
// 格式化金钱 1999 --> [1999,00]
formatPrice(val) {
if (typeof val == "undefined") {
return val;
}
return val.toFixed(2).split(".");
},
async init() { async init() {
let res = await getStoreList(this.params); let res = await getStoreList(this.params);
if (res.data.success) { if (res.data.success) {

View File

@@ -1,7 +1,7 @@
<template> <template>
<div> <div>
<u-navbar :border-bottom="false"> <u-navbar :border-bottom="false">
<u-search v-model="keyword" @search="search" @click="search" placeholder="请输入搜索"></u-search> <u-search v-model="keyword" @custom='search' :show-action="true" action-text="搜索" :animation="true" @search="search" @click="search" placeholder="请输入搜索"></u-search>
</u-navbar> </u-navbar>
<div class="wrapper"> <div class="wrapper">
<!-- 店铺信息模块 --> <!-- 店铺信息模块 -->
@@ -58,20 +58,10 @@
<!-- menu --> <!-- menu -->
<!-- 商品 --> <!-- 商品 -->
<div class="contant" v-if="current == 0"> <div class="content" v-if="current == 0">
<view v-if="!goodsList.length" class="empty">暂无商品信息</view>
<view v-else class="item" v-for="(item,index) in goodsList" :key="index" @click="navigateToGoodsDetail(item)"> <u-empty style='margin-top:100rpx' v-if="goodsList.length == 0" class="empty" text='暂无商品信息'></u-empty>
<u-image width="100%" height="330rpx" mode="aspectFit" :src="item.content.thumbnail"> <goodsTemplate v-else :res="goodsList" :storeName="false" />
<u-loading slot="loading"></u-loading>
</u-image>
<div class="name wes-2">{{ item.content.goodsName }}</div>
<div class="price">
<div>{{ item.content.price | unitPrice }}</div>
</div>
<view class="buyCount">
<div>已售 {{ item.content.buyCount || "0" }}</div>
</view>
</view>
</div> </div>
<!-- 全部分类 --> <!-- 全部分类 -->
<div class="category" v-if="current == 1"> <div class="category" v-if="current == 1">
@@ -84,7 +74,7 @@
</div> </div>
<!-- 分类子级 --> <!-- 分类子级 -->
<div class="child-list" v-if="item.children && item.children.length!=0"> <div class="child-list" v-if="item.children && item.children.length!=0">
<div class="child" @click="getCategoryGoodsList(child)" v-for="(child,i) in item.children">{{child.labelName}} <div class="child" @click="getCategoryGoodsList(child)" :key='i' v-for="(child,i) in item.children">{{child.labelName}}
</div> </div>
</div> </div>
</div> </div>
@@ -95,6 +85,7 @@
<script> <script>
import { getStoreBaseInfo, getStoreCategory } from "@/api/store.js"; import { getStoreBaseInfo, getStoreCategory } from "@/api/store.js";
import goodsTemplate from '@/components/m-goods-list/list'
import { import {
receiveCoupons, receiveCoupons,
deleteStoreCollection, deleteStoreCollection,
@@ -121,7 +112,7 @@ export default {
couponList: [], //优惠券列表 couponList: [], //优惠券列表
categoryList: [], categoryList: [],
couponParams: { pageNumber: 1, pageSize: 50, storeId: "" }, couponParams: { pageNumber: 1, pageSize: 50, storeId: "" },
goodsParams: { pageNumber: 1, pageSize: 50, storeId: "" }, goodsParams: { pageNumber: 1, pageSize: 10, storeId: "" },
}; };
}, },
watch: { watch: {
@@ -129,6 +120,7 @@ export default {
val == 0 ? ()=>{ this.goodsList = []; this.getGoodsData()} : this.getCategoryData(); val == 0 ? ()=>{ this.goodsList = []; this.getGoodsData()} : this.getCategoryData();
}, },
}, },
components:{goodsTemplate},
/** /**
* 加载 * 加载
@@ -188,30 +180,34 @@ export default {
* 联系客服 * 联系客服
*/ */
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({ // 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.storeInfo.yzfSign; // const sign = this.storeInfo.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
uni.navigateTo({
url: `/pages/tabbar/home/web-view?IM=${this.storeId}`,
});
}, },
/** 获取店铺分类 */ /** 获取店铺分类 */
@@ -240,6 +236,7 @@ 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}`,
}); });
@@ -265,6 +262,7 @@ export default {
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.content);
console.log(this.goodsList)
} }
}, },
@@ -277,15 +275,6 @@ export default {
} }
}, },
/**
* 跳转到商品详情
*/
navigateToGoodsDetail(val) {
uni.navigateTo({
url: `/pages/product/goods?id=${val.content.id}&goodsId=${val.content.goodsId}`,
});
},
/** /**
* 是否收藏 * 是否收藏
*/ */
@@ -393,53 +382,17 @@ export default {
color: #999; color: #999;
} }
.contant { .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;

View File

@@ -1,127 +1,77 @@
<template> <template>
<div> <div>
<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>
<view v-else class="item" v-for="(item,index) in goodsList" :key="index" @click="navigateToGoodsDetail(item)"> <goodsTemplate :res='goodsList' :storeName='false' />
<u-image width="100%" mode="aspectFit" height="324rpx" :src="item.content.thumbnail"> </div>
<u-loading slot="loading"></u-loading> </div>
</u-image>
<div class="name">{{ item.content.goodsName }}</div> </template>
<div class="price">
<div>{{ item.content.price | unitPrice }}</div> <script>
</div> import {
<view class="buyCount"> getGoodsList
<div>已售 {{ item.content.buyCount || "0" }}</div> } from "@/api/goods.js";
</view> import goodsTemplate from '@/components/m-goods-list/list'
</view> export default {
</div> data() {
</div> return {
title: "",
</template> routerVal: "",
goodsList: [],
<script> params: {
import { getGoodsList } from "@/api/goods.js"; pageNumber: 1,
export default { pageSize: 10,
data() { keyword: "",
return { storeCatId: "",
title: "", storeId: "",
routerVal: "", },
goodsList: [], };
params: { },
pageNumber: 1, components: {
pageSize: 10, goodsTemplate
keyword: "", },
storeCatId: "", onLoad(options) {
storeId: "", this.routerVal = options;
}, this.params.storeId = options.storeId;
}; this.params.storeCatId = options.id;
}, this.title = options.title;
onLoad(options) { },
this.routerVal = options; onShow() {
this.params.storeId = options.storeId; this.goodsList = []
this.params.storeCatId = options.id; this.params.pageNumber = 1;
this.title = options.title; this.getGoodsData();
}, },
onShow() { onReachBottom() {
this.goodsList =[] this.params.pageNumber++;
this.params.pageNumber = 1; this.getGoodsData();
this.getGoodsData(); },
}, methods: {
onReachBottom(){ async getGoodsData() {
this.params.pageNumber ++; // #TODO
this.getGoodsData(); let goodsList = await getGoodsList(this.params);
}, if (goodsList.data.success) {
methods: { this.goodsList.push(...goodsList.data.result.content);
/** }
* 跳转到商品详情 },
*/ },
navigateToGoodsDetail(val) { };
uni.navigateTo({ </script>
url: `/pages/product/goods?id=${val.content.id}&goodsId=${val.content.goodsId}`,
}); <style lang="scss" scoped>
}, .contant {
margin-top: 20rpx;
async getGoodsData() { display: flex;
// #TODO flex-wrap: wrap;
let goodsList = await getGoodsList(this.params); justify-content: space-between;
if (goodsList.data.success) {
this.goodsList.push(...goodsList.data.result.content); >.empty {
} width: 100%;
}, display: flex;
}, justify-content: center;
}; margin-top: 40rpx;
</script> }
}
<style lang="scss" scoped> </style>
.contant {
margin-top: 20rpx;
display: flex;
flex-wrap: wrap;
justify-content: space-between;
> .empty {
width: 100%;
display: flex;
justify-content: center;
margin-top: 40rpx;
}
.item {
overflow: hidden;
background: #fff;
width: 49%;
height: 484rpx;
font-size: 26rpx;
display: flex;
flex-direction: column;
border: 1px solid #f8f8f8;
margin-bottom: 20rpx;
.name {
text-align: left !important;
color: #333;
padding: 0 20rpx;
margin-top: 20rpx;
line-height: 1.4em;
max-height: 2.8em; //height是line-height的整数倍防止文字显示不全
overflow: hidden;
}
.price {
font-weight: 500;
color: $main-color;
font-size: 30rpx;
padding: 0 20rpx;
margin-top: 20rpx;
white-space: nowrap;
}
.buyCount {
display: flex;
padding: 0 20rpx;
font-size: 24upx;
justify-content: space-between;
color: #999;
}
}
}
</style>

View File

@@ -3,7 +3,7 @@
<u-navbar :custom-back="back" back-icon-color="#fff" :background="background" :border-bottom="false"> <u-navbar :custom-back="back" back-icon-color="#fff" :background="background" :border-bottom="false">
</u-navbar> </u-navbar>
<div class="wrapper"> <div class="wrapper-box">
<!-- 砍价列表 --> <!-- 砍价列表 -->
<div class="box box1"> <div class="box box1">
<div class="bargain"> <div class="bargain">
@@ -106,10 +106,6 @@
<popupGoods ref="popupGoods" :buyMask="maskFlag" @closeBuy="closePopupBuy" :goodsDetail="bargainDetail" <popupGoods ref="popupGoods" :buyMask="maskFlag" @closeBuy="closePopupBuy" :goodsDetail="bargainDetail"
:goodsSpec="goodsSpec" v-if="bargainDetail.id " @handleClickSku="getGoodsDetail" /> :goodsSpec="goodsSpec" v-if="bargainDetail.id " @handleClickSku="getGoodsDetail" />
<!-- 产品详情 -->
<div class=" box4">
</div>
</div> </div>
</div> </div>
</template> </template>
@@ -352,11 +348,11 @@ page {
align-items: center; align-items: center;
padding: 10rpx 0; padding: 10rpx 0;
} }
.wrapper { .wrapper-box {
background: url("https://lilishop-oss.oss-cn-beijing.aliyuncs.com/aac88f4e8eff452a8010af42c4560b04.png"); background: url("https://lili-system.oss-cn-beijing.aliyuncs.com/kanjia.png");
background-repeat: no-repeat; background-repeat: no-repeat;
background-size: 100% 100%; background-size: 100% 100%;
height: 700rpx; height: 506rpx;
width: 100%; width: 100%;
} }
@@ -371,16 +367,16 @@ page {
} }
} }
.box1 { .box1 {
top: 750rpx; top: 560rpx;
} }
.box2 { .box2 {
top: 770rpx; top: 580rpx;
} }
.box3 { .box3 {
top: 790rpx; top: 600rpx;
} }
.box4 { .box4 {
top: 810rpx; top: 620 rpx;
height: 200rpx; height: 200rpx;
} }
.bargain-item { .bargain-item {

View File

@@ -6,22 +6,7 @@
<!-- 砍价列表 --> <!-- 砍价列表 -->
<div class="box"> <div class="box">
<!-- 已砍的商品 --> <!-- 已砍的商品 -->
<div class="bargain" v-if="bargainList.length!=0"> <goodsTemplate type="kanJia" v-if="bargainList.length!=0" :res="bargainList" />
<div class="flex bargain-item" v-for="(item,index) in bargainList" :key="index">
<div class="goods-img">
<u-image width="150" height="150" :src="item.thumbnail"></u-image>
</div>
<div class="goods-config">
<div class="goods-title wes-2">
{{item.goodsName}}
</div>
<div class="flex goods-buy">
<div class="max-price">最低<span>{{item.purchasePrice | unitPrice}}</span></div>
<div class="bargaining" @click="navigateToBargainDetail(item)">参与砍价</div>
</div>
</div>
</div>
</div>
<div class="bargain empty" v-else> <div class="bargain empty" v-else>
<u-empty text="暂无活动" mode="list"></u-empty> <u-empty text="暂无活动" mode="list"></u-empty>
</div> </div>
@@ -32,7 +17,9 @@
<script> <script>
import { getBargainList } from "@/api/promotions"; import { getBargainList } from "@/api/promotions";
import goodsTemplate from '@/components/m-goods-list/promotion'
export default { export default {
components:{goodsTemplate},
data() { data() {
return { return {
background: { background: {
@@ -88,10 +75,10 @@ page {
</style> </style>
<style lang="scss" scoped> <style lang="scss" scoped>
.wrapper { .wrapper {
background: url("https://lilishop-oss.oss-cn-beijing.aliyuncs.com/aac88f4e8eff452a8010af42c4560b04.png"); background: url("https://lili-system.oss-cn-beijing.aliyuncs.com/kanjia.png");
background-repeat: no-repeat; background-repeat: no-repeat;
background-size: 100% 100%; background-size: 100% 100%;
height: 700rpx; height: 506rpx;
width: 100%; width: 100%;
} }
@@ -99,7 +86,7 @@ page {
background: #fff; background: #fff;
border-radius: 20rpx; border-radius: 20rpx;
position: relative; position: relative;
top: 750rpx; top: 560rpx;
width: 94%; width: 94%;
margin: 0 auto; margin: 0 auto;
> .bargain { > .bargain {

View File

@@ -1,155 +1,133 @@
<template> <template>
<view class="wrapper"> <view class="wrapper">
<u-navbar :border-bottom="false" :title="title">
<!-- 中间 -->
<view class="slot-wrap container-wrap">
<view v-if="search">
<u-search @search="searchFun()" @custom="searchFun()" v-model="params.goodsName"></u-search>
</view>
</view>
<!-- 右侧 -->
<view slot="right">
<view style="margin-right: 24rpx;" @click="searchFlag()">
<view v-if="search">取消</view>
<u-icon v-if="!search" size="44rpx" name="search"></u-icon>
</view>
</view>
</u-navbar>
<!-- 顶部栏 -->
<div class='header-wraper'>
<image src="/static/join-buy.png"></image>
</div>
<!-- 商品栏 -->
<div class="swiper">
<goodsTemplate v-if="goodsList.length" :res="goodsList" />
<u-empty v-else style="margin-top:20%" text="暂无拼团活动" mode="data"></u-empty>
</div>
<u-navbar :border-bottom="false" :background="background" class="unavbar" :title="title"> </view>
<!-- 中间 -->
<view class="slot-wrap container-wrap">
<view v-if="search">
<u-search @search="searchFun()" @custom="searchFun()" v-model="params.goodsName"></u-search>
</view>
</view>
<!-- 右侧 -->
<view slot="right">
<view style="margin-right: 24rpx;" @click="searchFlag()">
<view v-if="search">取消</view>
<u-icon v-if="!search" size="44rpx" name="search"></u-icon>
</view>
</view>
</u-navbar>
<!-- 顶部栏 -->
<!-- 商品栏 -->
<div class="swiper">
<div v-if="groupBuy.length !=0">
<view class="view-item" v-for="(groupItem, groupIndex) in groupBuy" :key="groupIndex">
<view class="view-left">
<u-image border-radius="10" shape="square" :src="groupItem.thumbnail" width="186rpx" height="186rpx">
<view slot="error" style="font-size: 24rpx;">加载失败</view>
</u-image>
</view>
<view class="view-content">
<view class="view-content-name">
{{ groupItem.goodsName }}
</view>
<view class="view-content-bottom">
<view>
<view class="view-content-price">
<!-- {{groupItem.sales_price | unitPrice }} <span v-if="groupItem.point">+{{groupItem.point}}积分</span> -->
{{groupItem.price | unitPrice }}
</view>
<view class="view-content-original_price">
{{ groupItem.originalPrice | unitPrice }}
</view>
</view>
<view>
<view class="btn-group" @click="toHref(groupItem)"> 去拼团 </view>
<view class="buy-content">已售{{groupItem.num || 0}}</view>
</view>
</view>
</view>
</view>
<u-loadmore bg-color='#f8f8f8' :status="status" />
</div>
<u-empty v-else style="margin-top:20%" text="暂无拼团活动" mode="data"></u-empty>
</div>
</view>
</template> </template>
<script> <script>
import * as API_Promotions from "@/api/promotions"; import * as API_Promotions from "@/api/promotions";
import * as API_Goods from "@/api/goods"; import * as API_Goods from "@/api/goods";
export default { import goodsTemplate from '@/components/m-goods-list/promotion.vue'
components: {}, export default {
data() { components: {
return { goodsTemplate
status: "loadmore", },
is_empty: false, data() {
search: false, return {
title: "拼团活动", is_empty: false,
background: { search: false,
backgroundColor: "#fff", title: "拼团活动",
},
empty: false,
params: {
pageNumber: 1,
pageSize: 10,
categoryPath: "",
goodsName: "",
},
groupBuy: [],
};
},
mounted() {},
watch: {
search(val) {
val ? (this.title = "") : (this.title = "拼团活动");
},
},
onReachBottom() {
this.loadMore();
},
// 点击搜索按钮
onNavigationBarButtonTap(e) {
this.popupFlag = !this.popupFlag;
},
async onLoad() {
this.GET_AssembleGoods();
},
methods: { empty: false,
loadMore() { params: {
this.params.pageNumber++; pageNumber: 1,
this.GET_AssembleGoods(); pageSize: 10,
}, categoryPath: "",
searchFlag() { goodsName: "",
this.search = !this.search; },
}, goodsList: [],
};
},
mounted() {},
watch: {
search(val) {
val ? (this.title = "") : (this.title = "拼团活动");
},
},
onReachBottom() {
this.loadMore();
},
// 点击搜索按钮
onNavigationBarButtonTap(e) {
this.popupFlag = !this.popupFlag;
},
async onLoad() {
this.GET_AssembleGoods();
},
toHref(goods) { methods: {
uni.navigateTo({ loadMore() {
url: `/pages/product/goods?id=${goods.skuId}&goodsId=${goods.goodsId}`, this.params.pageNumber++;
}); this.GET_AssembleGoods();
}, },
searchFun() { searchFlag() {
this.groupBuy = []; this.search = !this.search;
this.GET_AssembleGoods(); },
},
// 请求拼团数据
GET_AssembleGoods() {
this.status = "loading";
const params = JSON.parse(JSON.stringify(this.params));
if (params.category_id === 0) delete params.category_id;
API_Promotions.getAssembleList(params) toHref(goods) {
.then((response) => { uni.navigateTo({
const data = response.data.result.records; url: `/pages/product/goods?id=${goods.skuId}&goodsId=${goods.goodsId}`,
});
},
searchFun() {
this.goodsList = [];
this.GET_AssembleGoods();
},
// 请求拼团数据
GET_AssembleGoods() {
if (!data || !data.length) { const params = JSON.parse(JSON.stringify(this.params));
this.is_empty = true; if (params.category_id === 0) delete params.category_id;
this.status = "nomore";
} else { API_Promotions.getAssembleList(params)
if (data.length <= this.params.pageSize) { .then((response) => {
this.status = "nomore"; const data = response.data.result.records;
} else {
this.status = "loadmore"; if (!data || !data.length) {
} this.is_empty = true;
this.is_empty = false;
this.groupBuy.push(...(data || [])); } else {
} if (data.length <= this.params.pageSize) {
})
.catch(() => {}); } else {
},
}, }
}; this.is_empty = false;
this.goodsList.push(...(data || []));
}
})
.catch(() => {});
},
},
};
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@import "./style.scss"; .header-wraper {
background: url('/static/bg.png');
height: 200rpx;
display: flex;
align-items: center;
justify-content: center;
>image{
width: 188rpx;
height: 60rpx;
}
}
</style> </style>

View File

@@ -159,7 +159,7 @@ export default {
let recommendLives = await getLiveList(this.recommendParams); let recommendLives = await getLiveList(this.recommendParams);
if (recommendLives.data.success) { if (recommendLives.data.success) {
// 推荐直播间 // 推荐直播间
if (recommendLives.data.result.records.length != 0) { if (recommendLives.data.result.records.length ) {
this.status = "loadmore"; this.status = "loadmore";
this.recommendLives = recommendLives.data.result.records; this.recommendLives = recommendLives.data.result.records;
} else { } else {
@@ -172,7 +172,7 @@ export default {
* 2.如果没有直播间设置一个默认图片 * 2.如果没有直播间设置一个默认图片
*/ */
if (this.recommendLives.length == 0) { if (!this.recommendLives.length) {
if (this.liveList[0].shareImg) { if (this.liveList[0].shareImg) {
this.$set(this, "swiperImg", [ this.$set(this, "swiperImg", [
{ {
@@ -199,7 +199,7 @@ export default {
let res = await getLiveList(this.params[this.current]); let res = await getLiveList(this.params[this.current]);
// 直播间 // 直播间
if (res.data.success) { if (res.data.success) {
if (res.data.result.records.length != 0) { if (res.data.result.records.length ) {
this.status = "loadmore"; this.status = "loadmore";
this.liveList.push(...res.data.result.records); this.liveList.push(...res.data.result.records);
} else { } else {
@@ -211,7 +211,7 @@ export default {
? (this.status = "loadmore") ? (this.status = "loadmore")
: (this.status = "noMore"); : (this.status = "noMore");
console.log(this.status);
this.liveList.forEach((item) => { this.liveList.forEach((item) => {
if (item.roomGoodsList) { if (item.roomGoodsList) {
item.roomGoodsList = JSON.parse(item.roomGoodsList); item.roomGoodsList = JSON.parse(item.roomGoodsList);

View File

@@ -23,8 +23,8 @@
<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>
<view class="index-item-price"> <view class="index-item-price flex flex-a-c flex-j-sb">
{{ item.points }}积分 <div class="point"><span>{{ item.points }}</span>积分</div>
<span class="tipsMkt">¥{{ item.originalPrice | unitPrice }}</span> <span class="tipsMkt">¥{{ item.originalPrice | unitPrice }}</span>
</view> </view>
</view> </view>
@@ -194,46 +194,12 @@ page {
height: 100%; height: 100%;
} }
.tipsMkt { .tipsMkt {
float: right;
color: #c0c4cc; color: #c0c4cc;
font-size: 24rpx; font-size: 24rpx !important;
text-decoration: line-through; text-decoration: line-through;
margin-right: 20rpx; margin-right: 20rpx !important;
} }
.header {
background: $light-color;
position: relative;
color: #fff;
display: flex;
height: 80rpx;
align-items: center;
justify-content: center;
font-size: 26rpx;
font-size: 34rpx;
.left,
.right {
position: absolute;
width: max-content;
height: max-content;
top: 0;
bottom: 0;
margin: auto;
}
.left {
float: left;
top: 0;
bottom: 0;
left: 20rpx;
}
.right {
float: right;
right: 20rpx;
}
}
.index { .index {
height: 100vh; height: 100vh;
@@ -341,15 +307,19 @@ page {
overflow: hidden; overflow: hidden;
} }
.index-item-title-desc {
font-size: 25rpx;
color: #999999;
margin-top: 10rpx;
}
.index-item-price { .index-item-price {
font-size: 28rpx; font-size: 28rpx;
color: #ff5a10; overflow: hidden;
color: $main-color;
padding: 20rpx 0 0 20rpx; padding: 20rpx 0 0 20rpx;
>.point{
>span{
font-size: 42rpx;
font-weight: bold;
margin-right:10rpx;
}
}
} }
</style> </style>

View File

@@ -1,387 +1,255 @@
<template> <template>
<view class="sale"> <view class="sale">
<view class="sale-head"> <u-navbar title='限时抢购'></u-navbar>
<image src="@/pages/promotion/static/head-sample.png"></image> <view class="header-wraper">
</view> <image mode="widthFix" src="/static/seckill.png"></image>
<scroll-view scroll-x> </view>
<view class="index-navs"> <scroll-view scroll-x>
<view class="index-nav-v"> <view class="index-navs">
<view class="index-nav" :class="{ 'index-nav-active': nav == index }" @click="clickNavigateTime(index)" <view class="index-nav-v">
v-for="(item, index) in timeLine" :key="index"> <view class="index-nav" :class="{ 'index-nav-active': nav == index }"
{{ item.timeLine }}:00 @click="clickNavigateTime(index)" v-for="(item, index) in timeLine" :key="index">
<view class="index-nav-desc">{{ index === 0 && item.distanceStartTime === 0 ? '抢购中' : '即将开始' }} {{ item.timeLine }}:00
</view> <view class="index-nav-desc">{{ index === 0 && item.distanceStartTime === 0 ? '抢购中' : '即将开始' }}
</view> </view>
</view> </view>
</view> </view>
<view class="trailer" v-if="timeLine[nav] && times"> </view>
{{ timeLine[nav].distanceStartTime === 0 ? (onlyOne ? '距结束' : '距下一轮') : '距开始' }}
{{ times.hours == '00' ? '0' : times.hours }}小时{{ times.minutes }}{{ times.seconds }} </scroll-view>
</view> <view class="sale-items" v-if="goodsList.length > 0">
</scroll-view> <goodsTemplate :res="goodsList" />
<view class="sale-items" v-if="goodsList.length > 0">
<view class="sale-item" v-for="(item,index) in goodsList" :key="index">
<view class="sale-item-img">
<image :src="item.goodsImage" mode="aspectFill"></image>
</view>
<view class="sale-item-content">
<view class="sale-item-title">
{{ item.goodsName }}
<view class="sale-item-title-desc"></view>
</view>
<view class="sale-item-price">
<text class="sale-item-price-now">¥{{ item.price | unitPrice}}</text>
<text class="sale-item-price-origin"> ¥{{ item.originalPrice | unitPrice }}</text>
</view>
<view class="sale-item-surplus">
仅剩{{ item.quantity - item.salesNum }}
<view class="sale-item-surplus-text"
:style="{ width: (item.quantity / (item.quantity - item.salesNum)) * 100 + '%' }">
</view>
</view>
<view class="sale-item-btn" @click="navigateToGoodsDetail(item)">
{{ timeLine[nav].distanceStartTime === 0 ? (item.salesNum === item.quantity ? '已售空' : '购买') : '即将开始' }}
</view>
</view>
</view>
</view>
<view v-else>
<view class="nodata">
<image style="height: 240rpx;width: 320rpx;" src="/static/nodata.png" alt="" />
<div>暂无商品</div>
</view>
</view>
</view> </view>
<view v-else>
<view class="nodata">
<image style="height: 240rpx;width: 320rpx;" src="/static/nodata.png" alt="" />
<div>暂无商品</div>
</view>
</view>
</view>
</template> </template>
<script> <script>
import { getSeckillTimeLine, getSeckillTimeGoods } from "@/api/promotions.js"; import {
import Foundation from "@/utils/Foundation.js"; getSeckillTimeLine,
export default { getSeckillTimeGoods
data() { } from "@/api/promotions.js";
return { import Foundation from "@/utils/Foundation.js";
nav: 0, //默认选择第一个时间 import goodsTemplate from '@/components/m-goods-list/promotion.vue'
timeLine: "", //获取几个点活动 export default {
resTime: 0, //当前时间 components: {
time: 0, //距离下一个活动的时间值 goodsTemplate
times: {}, //时间集合 },
onlyOne: "", //是否最后一个商品 data() {
goodsList: [], //商品集合 return {
params: { nav: 0, //默认选择第一个时间
pageNumber: 1, timeLine: "", //获取几个点活动
pageSize: 10, resTime: 0, //当前时间
}, time: 0, //距离下一个活动的时间值
}; times: {}, //时间集合
}, onlyOne: "", //是否最后一个商品
goodsList: [], //商品集合
params: {
pageNumber: 1,
pageSize: 10,
},
};
},
/** /**
* 显示时间活动 * 显示时间活动
*/ */
async onShow() { async onShow() {
await this.getTimeLine(); await this.getTimeLine();
if (!this.timeLine) { if (!this.timeLine) {
await uni.showToast({ await uni.showToast({
icon: "none", icon: "none",
duration: 2000, duration: 2000,
title: "今天没有活动,明天再来吧", title: "今天没有活动,明天再来吧",
}); });
} }
this._setTimeInterval = setInterval(() => { this._setTimeInterval = setInterval(() => {
if (this.time <= 0) { if (this.time <= 0) {
clearInterval(this._setTimeInterval); clearInterval(this._setTimeInterval);
this.getGoodsList(); this.getGoodsList();
this.getTimeLine(); this.getTimeLine();
} else { } else {
this.times = Foundation.countTimeDown(this.time); this.times = Foundation.countTimeDown(this.time);
this.time--; this.time--;
} }
}, 1000); }, 1000);
}, },
onUnload() { onUnload() {
this._setTimeInterval && clearInterval(this._setTimeInterval); this._setTimeInterval && clearInterval(this._setTimeInterval);
}, },
methods: { methods: {
/** /**
* 获取时间线商品 * 获取时间线商品
*/ */
async getTimeLine() { async getTimeLine() {
let res = await getSeckillTimeLine(); let res = await getSeckillTimeLine();
if (res.data.success && res.data.result.length > 0) { if (res.data.success && res.data.result.length > 0) {
let timeLine = res.data.result.sort( let timeLine = res.data.result.sort(
(x, y) => Number(x.timeLine) - Number(y.timeLine) (x, y) => Number(x.timeLine) - Number(y.timeLine)
); );
this.timeLine = timeLine.slice(0, 5); this.timeLine = timeLine.slice(0, 5);
this.resTime = parseInt(new Date().getTime() / 1000); this.resTime = parseInt(new Date().getTime() / 1000);
this.onlyOne = res.data.result.length === 1; this.onlyOne = res.data.result.length === 1;
this.diffTime = parseInt(new Date().getTime() / 1000) - this.resTime; this.diffTime = parseInt(new Date().getTime() / 1000) - this.resTime;
this.time = this.time =
this.timeLine[this.nav].distanceStartTime || this.timeLine[this.nav].distanceStartTime ||
(this.timeLine[this.nav + 1] && (this.timeLine[this.nav + 1] &&
this.timeLine[this.nav + 1].distanceStartTime) || this.timeLine[this.nav + 1].distanceStartTime) ||
Foundation.theNextDayTime() - this.diffTime; Foundation.theNextDayTime() - this.diffTime;
this.times = Foundation.countTimeDown(this.time); this.times = Foundation.countTimeDown(this.time);
this.getGoodsList(); this.getGoodsList();
} }
}, },
/** /**
* 获取商品集合 * 获取商品集合
*/ */
async getGoodsList() { async getGoodsList() {
this.params.timeLine = this.timeLine[this.nav].timeLine; this.params.timeLine = this.timeLine[this.nav].timeLine;
let res = await getSeckillTimeGoods(this.params.timeLine); let res = await getSeckillTimeGoods(this.params.timeLine);
if (res.data.success && res.data.result.length != 0) { if (res.data.success && res.data.result.length != 0) {
this.goodsList = res.data.result; this.goodsList = res.data.result;
} else { } else {
this.goodsList = []; this.goodsList = [];
} }
}, },
/** /**
* 跳转到商品详情 * 跳转到商品详情
*/ */
navigateToGoodsDetail(item) { navigateToGoodsDetail(item) {
if ( if (
item.sold_num === item.quantity || item.sold_num === item.quantity ||
this.timeLine[this.nav].distanceStartTime !== 0 this.timeLine[this.nav].distanceStartTime !== 0
) { ) {
return; return;
} else { } else {
uni.navigateTo({ uni.navigateTo({
url: `/pages/product/goods?id=${item.skuId}&goodsId=${item.goodsId}`, url: `/pages/product/goods?id=${item.skuId}&goodsId=${item.goodsId}`,
}); });
} }
}, },
/** /**
* 单击导航时间 * 单击导航时间
*/ */
clickNavigateTime(type) { clickNavigateTime(type) {
this.nav = type; this.nav = type;
this.goodsList = []; this.goodsList = [];
this.diffTime = parseInt(new Date().getTime() / 1000) - this.resTime; this.diffTime = parseInt(new Date().getTime() / 1000) - this.resTime;
this.time = this.time =
this.timeLine[this.nav].distanceStartTime || this.timeLine[this.nav].distanceStartTime ||
(this.timeLine[this.nav + 1] && (this.timeLine[this.nav + 1] &&
this.timeLine[this.nav + 1].distanceStartTime) || this.timeLine[this.nav + 1].distanceStartTime) ||
Foundation.theNextDayTime() - this.diffTime; Foundation.theNextDayTime() - this.diffTime;
this.times = Foundation.countTimeDown(this.time); this.times = Foundation.countTimeDown(this.time);
this.getGoodsList(); this.getGoodsList();
}, },
}, },
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.sale { .sale {
width: 100%; width: 100%;
min-height: 100vh; min-height: 100vh;
background-color: #f7f7f7; background-color: #f7f7f7;
} }
.nodata { .nodata {
flex-direction: column; flex-direction: column;
display: flex; display: flex;
width: 100%; width: 100%;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
margin-top: 40rpx; margin-top: 40rpx;
> div { >div {
font-size: 24rpx; font-size: 24rpx;
margin-top: 20rpx; margin-top: 20rpx;
color: #666; color: #666;
} }
} }
.sale-head { .header-wraper {
image { background: url('/static/bg.png');
width: 100%; height: 200rpx;
height: 280rpx; display: flex;
} align-items: center;
} justify-content: center;
>image{
width: 300rpx;
height: 100rpx;
}
}
.sale-items { .sale-items {
padding-top: 20rpx; padding-top: 20rpx;
display: -webkit-box; }
display: -webkit-flex;
display: flex;
align-items: center;
flex-direction: column;
}
.sale-item { .index-navs {
width: 710rpx; background: #fff;
height: 226rpx; background-color: #f7f7f7;
padding-left: 20rpx; display: -webkit-box;
margin-bottom: 10rpx; display: -webkit-flex;
border-radius: 12rpx; display: flex;
background-color: #fff; align-items: center;
position: relative; justify-content: space-between;
display: -webkit-box; }
display: -webkit-flex;
display: flex;
align-items: center;
}
.sale-item-img { .index-nav-v {
margin-right: 20rpx; display: -webkit-box;
image { display: -webkit-flex;
width: 186rpx; display: flex;
height: 186rpx; justify-content: center;
border-radius: 8rpx; align-items: center;
} position: relative;
} }
.sale-item-content { .index-nav {
line-height: 2em; font-size: 28rpx;
} display: -webkit-box;
display: -webkit-flex;
display: flex;
justify-content: center;
align-items: center;
width: 150rpx;
flex-direction: column;
color: #bababa;
height: 115rpx;
line-height: 1em;
position: relative;
font-size: 32rpx;
font-weight: bold;
.sale-item-title { &-active {
display: -webkit-box; color: $main-color;
-webkit-box-orient: vertical; position: relative;
-webkit-line-clamp: 2; z-index: 30;
overflow: hidden; .index-nav-desc {
line-height: 1.5; color: #fff;
font-size: 28rpx; font-weight: bold;
color: #333; background: $main-color;
} padding: 6rpx 16rpx;
border-radius: 50px;
}
}
}
.sale-item-title-desc { .index-nav-desc {
font-size: 22rpx; margin-top: 8rpx;
color: #999; font-size: 22rpx;
} color: #bababa;
}
.sale-item-price {
font-size: 22rpx;
color: 999;
}
.sale-item-price-now {
font-size: 40rpx;
color: #ff5a10;
margin: 0 10rpx;
}
.sale-item-price-origin {
font-size: 20rpx;
color: #999;
-webkit-text-decoration-line: line-through;
text-decoration-line: line-through;
text-decoration: line-through;
}
.sale-item-surplus {
border: 2rpx solid rgb(34, 178, 140);
border-radius: 12px;
width: 166rpx;
color: rgb(31, 177, 138);
font-size: 20rpx;
position: relative;
text-align: center;
z-index: 2;
height: 32rpx;
line-height: 28rpx;
overflow: hidden;
}
.sale-item-surplus-text {
width: 166rpx;
background: rgb(234, 247, 245);
position: absolute;
top: 0;
left: 0;
z-index: -1;
height: 100%;
}
.sale-item-btn {
position: absolute;
right: 20rpx;
bottom: 20rpx;
padding: 0 20rpx;
height: 60rpx;
background-color: #1abc9c;
border-radius: 10rpx;
font-size: 25rpx;
color: #fff;
display: -webkit-box;
display: -webkit-flex;
display: flex;
justify-content: center;
align-items: center;
}
.trailer {
height: 100rpx;
background: #ffffff;
display: -webkit-box;
display: -webkit-flex;
display: flex;
justify-content: center;
align-items: center;
font-size: 22rpx;
color: #666666;
box-sizing: border-box;
position: relative;
z-index: 0;
}
.index-navs {
background-color: #f7f7f7;
display: -webkit-box;
display: -webkit-flex;
display: flex;
align-items: center;
justify-content: space-between;
}
.index-nav-v {
display: -webkit-box;
display: -webkit-flex;
display: flex;
justify-content: center;
align-items: center;
position: relative;
}
.index-nav {
font-size: 28rpx;
display: -webkit-box;
display: -webkit-flex;
display: flex;
justify-content: center;
align-items: center;
width: 150rpx;
flex-direction: column;
color: #bababa;
height: 115rpx;
line-height: 1em;
position: relative;
&-active {
background-image: url(/static/seckill/active.png);
background-size: 100% 115rpx;
background-repeat: no-repeat;
color: #ffffff;
position: relative;
z-index: 30;
.index-nav-desc {
color: #ffffff;
}
}
}
.index-nav-desc {
margin-top: 8rpx;
font-size: 22rpx;
color: #bababa;
}
</style> </style>

View File

@@ -51,7 +51,7 @@
<view class="goods-row" :class="{ invalid: isInvalid(skuItem) }"> <view class="goods-row" :class="{ invalid: isInvalid(skuItem) }">
<view class="goods-config"> <view class="goods-config">
<view> <view>
<u-checkbox-group v-if="skuItem.invalid == 0"> <u-checkbox-group v-if="skuItem.invalid == 0 && !skuItem.errorMessage">
<!-- #ifndef MP-WEIXIN --> <!-- #ifndef MP-WEIXIN -->
<u-checkbox shape="circle" :active-color="lightColor" class="c-left" v-model="skuItem.checked" <u-checkbox shape="circle" :active-color="lightColor" class="c-left" v-model="skuItem.checked"
@change="checkboxChange(skuItem)"></u-checkbox> @change="checkboxChange(skuItem)"></u-checkbox>
@@ -74,12 +74,13 @@
</p> </p>
<!-- 规格 --> <!-- 规格 -->
<p class="sp-type">{{skuItem.goodsSku.simpleSpecs}}</p> <p class="sp-type">{{skuItem.goodsSku.simpleSpecs}}</p>
<p class="sp-type" v-if="skuItem.goodsSku.salesModel == 'WHOLESALE'">批发商品</p>
<p class="sp-number"> <p class="sp-number">
<view class="sp-price"> <view class="sp-price">
<div class="default-color" :class="{'main-color':Object.keys(skuItem.promotionMap).length ==0 }"> <div class="default-color" :class="{'main-color':Object.keys(skuItem.promotionMap).length ==0 }">
<span>{{ formatPrice(skuItem.goodsSku.price)[0] }}</span> <span>{{ $options.filters.goodsFormatPrice(skuItem.goodsSku.price)[0] }}</span>
<span>.{{ formatPrice(skuItem.goodsSku.price)[1] }}</span> <span>.{{ $options.filters.goodsFormatPrice(skuItem.goodsSku.price)[1] }}</span>
</div> </div>
</view> </view>
<view> <view>
@@ -99,7 +100,7 @@
> >
<div class="promotions-item-seckill" v-if="getPromotion(skuItem).includes('SECKILL')"> <div class="promotions-item-seckill" v-if="getPromotion(skuItem).includes('SECKILL')">
距秒杀结束: <u-count-down show-border :hide-zero-day="true" :color="$mainColor" border-color="#ededed" 距秒杀结束: <u-count-down show-border :hide-zero-day="true" :color="$mainColor" border-color="#ededed"
font-size="24" :timestamp="getCountDownTime(seckill.endTime)"> font-size="24" :timestamp="getCountDownTime(skuItem)">
</u-count-down> </u-count-down>
</div> </div>
</div> </div>
@@ -107,10 +108,12 @@
<!-- 如果有活动 并且是选中的状态,显示预估到手价格 --> <!-- 如果有活动 并且是选中的状态,显示预估到手价格 -->
<div class="priceDetail-flowPrice" :class="{'main-color':skuItem.priceDetailDTO}" <div class="priceDetail-flowPrice" :class="{'main-color':skuItem.priceDetailDTO}"
v-if="skuItem.priceDetailDTO && skuItem.invalid == 0 && Object.keys(skuItem.promotionMap).length != 0 && skuItem.checked && skuItem.checked"> v-if="skuItem.priceDetailDTO && skuItem.invalid == 0 && Object.keys(skuItem.promotionMap).length != 0 && skuItem.checked && skuItem.checked">
预估到手价 <span>{{ formatPrice(skuItem.priceDetailDTO.flowPrice)[0]}}</span> 预估到手价 <span>{{ $options.filters.goodsFormatPrice(skuItem.priceDetailDTO.flowPrice)[0]}}</span>
<span>.{{ formatPrice(skuItem.priceDetailDTO.flowPrice)[1] }} </span> <span>.{{ $options.filters.goodsFormatPrice(skuItem.priceDetailDTO.flowPrice)[1] }} </span>
</div> </div>
<div style='margin-left: 20rpx;' v-if="!skuItem.checked && skuItem.errorMessage">
{{skuItem.errorMessage}}
</div>
</view> </view>
</view> </view>
</u-swipe-action> </u-swipe-action>
@@ -128,7 +131,7 @@
<div class="fullPrice"> <div class="fullPrice">
<span class="number" v-if="cartDetail && cartDetail.priceDetailDTO"> <span class="number" v-if="cartDetail && cartDetail.priceDetailDTO">
总计: 总计:
<span>¥{{ formatPrice(cartDetail.priceDetailDTO.flowPrice)[0] }}</span>.<span>{{ formatPrice(cartDetail.priceDetailDTO.flowPrice)[1] }}</span> <span>¥{{ $options.filters.goodsFormatPrice(cartDetail.priceDetailDTO.flowPrice)[0] }}</span>.<span>{{ $options.filters.goodsFormatPrice(cartDetail.priceDetailDTO.flowPrice)[1] }}</span>
</span> </span>
<span class="number" v-else>总计:0.00</span> <span class="number" v-else>总计:0.00</span>
</div> </div>
@@ -192,8 +195,8 @@ export default {
}, },
], ],
isInvalid(val) { isInvalid(val) {
//是否无效商品 //是否无效商品/没库存商品
if (val.invalid == 1) { if (val.invalid == 1 || (!val.checked && val.errorMessage)) {
return true; return true;
} else { } else {
return false; return false;
@@ -236,12 +239,15 @@ export default {
}, },
methods: { methods: {
/** /**
* 倒数计时 * 倒数计时
*/ */
getCountDownTime(val) { getCountDownTime(val) {
let date = new Date(val.replace(/-/g, "/")); if (val.promotionMap) {
let timeSimple = new Date(date).getTime() / 1000; let key = Object.keys(val.promotionMap).find((child, index) => {
return timeSimple - new Date().getTime() / 1000; return child.split("-")[0] == 'SECKILL'
});
return val.promotionMap[key].endTime / 1000 - (new Date().getTime() / 1000)
}
}, },
/** /**
@@ -250,17 +256,6 @@ export default {
discountDetails() { discountDetails() {
this.discountDetailsFlag = true; this.discountDetailsFlag = true;
}, },
/**
* 格式化金钱 1999 --> [1999,00]
*/
formatPrice(val) {
if (typeof val == "undefined") {
return val;
}
return val.toFixed(2).split(".");
},
/** /**
* 左滑打开删除 * 左滑打开删除
*/ */

View File

@@ -15,6 +15,11 @@ export default {
}, },
}; };
}, },
onReachBottom(){
// 给子级监听触底加载
uni.$emit('onReachBottom',true)
},
onPullDownRefresh() { onPullDownRefresh() {
this.$refs.tpl.init(); this.$refs.tpl.init();

View File

@@ -1,109 +1,208 @@
/** 配置楼层模块的跳转 */ /** 配置楼层模块的跳转 */
export function modelNavigateTo(item) { export function modelNavigateTo(item) {
let val = item.url; let val = item.url || item;
//链接跳转到专题
switch (val.___type) { if (val && val.id && val.pageType == "special") {
case "goods": uni.navigateTo({
uni.navigateTo({ url: `/pages/tabbar/special/special?id=${val.id}`,
url: "/pages/product/goods?id=" + val.id + "&goodsId=" + val.goodsId, });
}); }
break; switch (val.___type || val.type) {
case "category": case "goods":
if (val.id) { uni.navigateTo({
url: "/pages/product/goods?id=" + val.id + "&goodsId=" + val.goodsId,
});
break;
case "category":
if (val.id) {
uni.navigateTo({
url: `/pages/navigation/search/searchPage?category=${val.id}`,
});
} else {
uni.navigateTo({
url: `/pages/navigation/search/searchPage`,
});
}
break;
case "shops":
uni.navigateTo({
url: `/pages/product/shopPage?id=${val.id}`,
});
break;
// 活动
case "marketing":
uni.navigateTo({
url: "/pages/product/goods?id=" + val.id + "goodsId=" + val.goodsId,
});
break;
case "pages":
uni.navigateTo({
url: val.___path + "?id=" + val.id + "&title=" + val.title,
});
break;
case "other":
switch (val.title || item.title) {
case "首页":
uni.switchTab({
url: `/pages/tabbar/home/index`,
});
break;
case "购物车":
uni.switchTab({
url: `/pages/tabbar/cart/cartList`,
});
return;
case "个人中心":
uni.switchTab({
url: `/pages/tabbar/user/my`,
});
break;
case "收藏商品":
uni.navigateTo({
url: `/pages/mine/myCollect`,
});
break;
case "我的订单":
uni.navigateTo({
url: `/pages/order/myOrder?status=0`,
});
break;
case "领券中心":
uni.navigateTo({
url: `/pages/cart/coupon/couponCenter`,
});
break;
case "签到":
uni.navigateTo({
url: `/pages/mine/signIn`,
});
break;
case "秒杀频道":
uni.navigateTo({
url: `/pages/promotion/seckill`,
});
break;
case "拼团频道":
uni.navigateTo({
url: `/pages/promotion/joinGroup`,
});
break;
case "小程序直播":
uni.navigateTo({
url: `/pages/promotion/lives`,
});
break;
case "砍价":
uni.navigateTo({
url: `/pages/promotion/bargain/list`,
});
break;
case "积分商城":
uni.navigateTo({
url: `/pages/promotion/point/pointList`,
});
break;
case "店铺列表":
uni.navigateTo({
url: `/pages/product/shopList`,
});
break;
default:
// #ifdef H5
window.location.href = val.url || item.link;
// #endif
// #ifdef APP-PLUS
plus.runtime.openURL(val.url || item.link) //不需要拼接\
// #endif
break;
}
break;
}
}
import config from "@/config/config";
async function scan() {
// #ifdef APP-PLUS
let isIos = plus.os.name == "iOS";
// 判断是否是Ios
if (isIos) {
const iosFirstCamera = uni.getStorageSync("iosFirstCamera"); //是不是第一次开启相机
if (iosFirstCamera !== "false") {
uni.setStorageSync("iosFirstCamera", "false"); //设为false就代表不是第一次开启相机
seacnCode();
} else {
if (permision.judgeIosPermission("camera")) {
seacnCode();
} else {
// 没有权限提醒是否去申请权限
tipsGetSettings();
}
}
} else {
/**
* TODO 安卓 权限已经授权了调用api总是显示用户已永久拒绝申请。人傻了
* TODO 如果xdm有更好的办法请在 https://gitee.com/beijing_hongye_huicheng/lilishop/issues 提下谢谢
*/
seacnCode();
}
// #endif
// #ifdef MP-WEIXIN
seacnCode();
// #endif
}
/**
* 提示获取权限
*/
function tipsGetSettings() {
uni.showModal({
title: "提示",
content: "您已经关闭相机权限,去设置",
success: function (res) {
if (res.confirm) {
if (isIos) {
plus.runtime.openURL("app-settings:");
} else {
permision.gotoAppPermissionSetting();
}
}
},
});
}
function seacnCode() {
uni.scanCode({
success: function (res) {
let path = encodeURIComponent(res.result);
// WX_CODE 为小程序码
if (res.scanType == "WX_CODE") {
console.log(res);
uni.navigateTo({ uni.navigateTo({
url: `/pages/navigation/search/searchPage?category=${val.id}`, url: `/${res.path}`,
}); });
} else { } else {
uni.navigateTo({ config.scanAuthNavigation.forEach((src) => {
url: `/pages/navigation/search/searchPage`, if (res.result.indexOf(src) != -1) {
uni.navigateTo({
url: `/${res.result.substring(src.length)}`,
});
} else {
setTimeout(() => {
uni.navigateTo({
url: "/pages/tabbar/home/web-view?src=" + path,
});
}, 100);
}
}); });
} }
break; },
case "shops": });
uni.navigateTo({ }
url: `/pages/product/shopPage?id=${val.id}`,
});
break;
// 活动
case "marketing":
uni.navigateTo({
url: "/pages/product/goods?id=" + val.skuId + "goodsId=" + val.goodsId,
});
break;
case "pages":
uni.navigateTo({
url: val.___path + "?id=" + val.id + "&title=" + val.title,
});
break;
case "other":
switch (val.title) {
case "首页":
uni.switchTab({
url: `/pages/tabbar/home/index`,
});
break;
case "购物车":
uni.switchTab({
url: `/pages/tabbar/cart/cartList`,
});
return;
case "个人中心":
uni.switchTab({
url: `/pages/tabbar/user/my`,
});
break;
case "收藏商品":
uni.navigateTo({
url: `/pages/mine/myCollect`,
});
break;
case "我的订单":
uni.navigateTo({
url: `/pages/order/myOrder?status=0`,
});
break;
case "领券中心":
uni.navigateTo({
url: `/pages/cart/coupon/couponCenter`,
});
break;
case "签到":
uni.navigateTo({
url: `/pages/mine/signIn`,
});
break;
case "秒杀频道":
uni.navigateTo({
url: `/pages/promotion/seckill`,
});
break;
case "拼团频道":
uni.navigateTo({
url: `/pages/promotion/joinGroup`,
});
break;
case "小程序直播":
uni.navigateTo({
url: `/pages/promotion/lives`,
});
break;
case "砍价":
uni.navigateTo({
url: `/pages/promotion/bargain/list`,
});
break;
case "积分商城":
uni.navigateTo({
url: `/pages/promotion/point/pointList`,
});
break;
case "店铺列表":
uni.navigateTo({
url: `/pages/product/shopList`,
});
break;
}
break;
}
}

View File

@@ -1,7 +1,7 @@
<template> <template>
<div class="layout"> <div class="layout">
<div class="box"> <div class="box">
<u-swiper @click="clickSwiper" interval="5000" duration="500" height="300" v-if="res" name="img" :list="res.list"> <u-swiper @click="clickSwiper" interval="5000" duration="500" height="350" v-if="res" name="img" :list="res.list">
<u-loading slot="loading"></u-loading> <u-loading slot="loading"></u-loading>
</u-swiper> </u-swiper>
</div> </div>

View File

@@ -1,15 +1,20 @@
<template> <template>
<div class="layout"> <div class="layout">
<div class="flex-one" @click="modelNavigateTo(res.list[0])"> <div class="flex-one">
<u-image width="100%" mode="aspectFit" height="280rpx" :src="res.list[0].img" alt=""></u-image> <!-- <u-image width="100%" mode="aspectFit" height="280rpx" :src="res.list[0].img" alt=""></u-image> -->
<hotzone :res="res"></hotzone>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
import { modelNavigateTo } from "./tpl"; import { modelNavigateTo } from "./tpl";
import hotzone from "@/pages/tabbar/home/template/tpl_hot_zone.vue";
export default { export default {
title: "单行图片模块", title: "单行图片模块",
components: {
hotzone,
},
data() { data() {
return { return {
modelNavigateTo, modelNavigateTo,

View File

@@ -1,21 +1,38 @@
<template> <template>
<div class="layout"> <div class="layout">
<u-sticky> <u-sticky>
<div class="goods-cell-title"> <div class="goods-cell-title">
<div class="goods-item-title" :class="{ 'selected-title': selected.index == index }" <div
@click="handleClickTitle(title, index)" v-for="(title, index) in res.list[0].titleWay" :key="index"> class="goods-item-title"
:class="{ 'selected-title': selected.index == index }"
@click="handleClickTitle(title, index)"
v-for="(title, index) in res.list[0].titleWay"
:key="index"
>
<h4 class="h4">{{ title.title }}</h4> <h4 class="h4">{{ title.title }}</h4>
<div>{{ title.desc }}</div> <div>{{ title.desc }}</div>
</div> </div>
</div> </div>
</u-sticky> </u-sticky>
<div class="goods-list"> <div class="goods-list">
<div v-if="item.___index != undefined ? (selected.index == item.___index) : ( selected.val == item.type)" <div
@click="handleClick(item)" class="goods-item" v-for="(item, item_index) in res.list[0].listWay" v-if="
:key="item_index"> item.___index != undefined
? selected.index == item.___index
: selected.val == item.type
"
@click="handleClick(item)"
class="goods-item"
v-for="(item, item_index) in res.list[0].listWay"
:key="item_index"
>
<div class="goods-img"> <div class="goods-img">
<u-image :src="item.img" height="350rpx" mode="aspectFit" width="100%"> <u-image
:src="item.img"
height="350rpx"
mode="aspectFit"
width="100%"
>
<u-loading slot="loading"></u-loading> <u-loading slot="loading"></u-loading>
</u-image> </u-image>
</div> </div>
@@ -24,7 +41,42 @@
{{ item.title }} {{ item.title }}
</div> </div>
<div class="goods-bottom"> <div class="goods-bottom">
<div class="goods-price">{{ item.price | unitPrice }}</div> <div class="goods-price">
¥<span
>{{ $options.filters.goodsFormatPrice(item.price)[0] }} </span
>.{{ $options.filters.goodsFormatPrice(item.price)[1] }}
</div>
</div>
</div>
</div>
<div
v-if="res.list[0].titleWay[selected.index].bindCategory && goodsData.length"
v-for="(item, index) in goodsData"
:key="index"
class="goods-item"
@click="handleClick(item)"
>
<div class="goods-img">
<u-image
:src="item.thumbnail"
height="350rpx"
mode="aspectFit"
width="100%"
>
<u-loading slot="loading"></u-loading>
</u-image>
</div>
<div class="goods-desc">
<div class="goods-title">
{{ item.goodsName }}
</div>
<div class="goods-bottom">
<div class="goods-price">
¥<span
>{{ $options.filters.goodsFormatPrice(item.price)[0] }} </span
>.{{ $options.filters.goodsFormatPrice(item.price)[1] }}
</div>
</div> </div>
</div> </div>
</div> </div>
@@ -32,6 +84,7 @@
</div> </div>
</template> </template>
<script> <script>
import { getGoodsList } from "@/api/goods.js";
export default { export default {
title: "商品分类以及商品", title: "商品分类以及商品",
data() { data() {
@@ -40,21 +93,43 @@ export default {
index: 0, index: 0,
val: "", val: "",
}, },
params: {
pageNumber: 1,
pageSize: 100,
categoryId: "",
},
goodsData: [], //商品循环内容
goodsResult:"", //es总返回内容
}; };
}, },
props: ["res"], props: ["res","enableBottomLoad"],
watch: { watch: {
res: { res: {
handler(val) { handler(val) {
// 监听父级的值 如果有值将值赋给selected // 监听父级的值 如果有值将值赋给selected
if (val) { if (val) {
this.selected.val = this.res.list[0].listWay[0].type; console.log(val)
// 如果第一个标签页绑定为商品
this.selected.val = this.res.list[0].listWay[0] ? this.res.list[0].listWay[0].type: '';
// 如果第一个标签为绑定为分类
this.res.list[0].titleWay[0].bindCategory ? this.initGoods(this.res.list[0].titleWay[0]) : ''
} }
}, },
immediate: true, immediate: true,
}, },
}, },
mounted() {}, mounted() {
uni.$on('onReachBottom',()=>{
if(this.enableBottomLoad && this.goodsResult.totalElements >= this.params.pageNumber * this.params.pageSize){
this.params.pageNumber++
this.initGoods(this.res.list[0].titleWay[this.selected.index])
}
})
},
destroyed(){
uni.$off('onReachBottom')
},
methods: { methods: {
handleClick(item) { handleClick(item) {
uni.navigateTo({ uni.navigateTo({
@@ -64,9 +139,25 @@ export default {
closeGoods(val, index) { closeGoods(val, index) {
this.res.list[0].listWay.splice(index, 1); this.res.list[0].listWay.splice(index, 1);
}, },
async initGoods(val) {
if(this.enableBottomLoad) this.params.pageSize = 20
val ? this.params.categoryId = val.bindCategory.id : '';
const res = await getGoodsList(this.params);
if (res.data.success) {
this.goodsResult = res.data.result
const result = res.data.result.content.map(item=>item.content)
this.goodsData.push(...result);
console.log(this.goodsData)
}
},
handleClickTitle(val, index) { handleClickTitle(val, index) {
this.selected.index = index; this.selected.index = index;
this.selected.val = val.title; this.selected.val = val.title;
if (val.bindCategory) {
this.params.pageNumber = 1
this.goodsData = []
this.initGoods(val);
}
}, },
}, },
}; };
@@ -149,7 +240,7 @@ $w_94: 94%;
margin: 0 auto; margin: 0 auto;
> .goods-title { > .goods-title {
font-size: 24rpx; font-size: 24rpx;
height: 70rpx; height: 67rpx;
display: -webkit-box; display: -webkit-box;
font-weight: 500; font-weight: 500;
-webkit-box-orient: vertical; -webkit-box-orient: vertical;
@@ -163,13 +254,10 @@ $w_94: 94%;
> .goods-price { > .goods-price {
line-height: 2; line-height: 2;
color: $main-color; color: $main-color;
> span {
font-size: 42rpx;
}
} }
} }
} }
.goods-icon {
right: 10rpx;
top: 10rpx;
position: absolute;
}
</style> </style>

View File

@@ -0,0 +1,57 @@
<template>
<div class="layout">
<div class="flex-one hot-image">
<image mode="widthFix" :src="res.list[0].img" alt=""></image>
<image
v-for="(area, index) in res.list[0].zoneInfo"
:key="index"
@click="modelNavigateTo(area)"
mode="widthFix"
class="hot-area"
:style="{
left: area.leftPer * 100 + '%',
top: area.topPer * 100 + '%',
width: area.widthPer * 100 + '%',
height: area.heightPer * 100 + '%',
}"
:src="area.img"
alt=""
></image>
</div>
</div>
</template>
<script>
import { modelNavigateTo } from "./tpl";
export default {
title: "热区模块",
data() {
return {
modelNavigateTo,
};
},
props: ["res"],
};
</script>
<style lang="scss" scoped>
@import "./tpl.scss";
.hot-image {
position: relative;
}
.hot-area {
position: absolute;
z-index: 99;
}
.flex-one {
width: 100%;
display: block;
overflow: hidden;
image {
width: 100%;
min-height: 200rpx;
// height: 100%;
}
}
</style>

View File

@@ -1,7 +1,12 @@
<template> <template>
<div class="layout"> <div class="layout">
<div class="menu-list"> <div class="menu-list">
<div class="menu-item" @click="modelNavigateTo(item)" v-for="(item, index) in res.list" :key="index"> <div
class="menu-item"
@click="modelNavigateTo(item)"
v-for="(item, index) in res.list"
:key="index"
>
<div> <div>
<u-image <u-image
width="88rpx" width="88rpx"
@@ -9,7 +14,7 @@
class="menu-img" class="menu-img"
:src="item.img" :src="item.img"
> >
<u-loading slot="loading"></u-loading> <u-loading slot="loading"></u-loading>
</u-image> </u-image>
</div> </div>
<div class="menu-title">{{ item.title }}</div> <div class="menu-title">{{ item.title }}</div>
@@ -18,15 +23,15 @@
</div> </div>
</template> </template>
<script> <script>
import {modelNavigateTo} from './tpl' import { modelNavigateTo } from "./tpl";
export default { export default {
title:"五列菜单", title: "五列菜单",
props: ["res"], props: ["res"],
data () { data() {
return { return {
modelNavigateTo, modelNavigateTo,
} };
} },
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@@ -34,6 +39,7 @@ export default {
.menu-list { .menu-list {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between;
flex-wrap: wrap; flex-wrap: wrap;
> .menu-item { > .menu-item {

View File

@@ -0,0 +1,49 @@
<template>
<div class="layout">
<div class="background">
<u-notice-bar mode="vertical" :bg-color="res.list[0].bk_color" :color="res.list[0].color" :list="list"></u-notice-bar>
</div>
</div>
</template>
<script>
export default {
title: "公告",
props: ["res"],
data() {
return {
list: []
}
},
mounted() {
this.list = this.res.list[0].title.map(i => i.context);
},
};
</script>
<style lang="scss" scoped>
@import "./tpl.scss";
.background {
position: absolute;
z-index: 2;
width: 100%;
height: 84rpx;
text-align: left;
font-size: 20rpx;
background-size: cover;
}
.layout {
text-align: center;
position: relative;
height: 84rpx;
display: flex;
align-items: center;
justify-content: center;
background: #ffffff;
}
.title {
line-height: 84rpx;
font-size: 20px;
font-weight: bold;
}
</style>

View File

@@ -0,0 +1,273 @@
<template>
<div class="layout">
<div class="join-list">
<div
v-for="(item, index) in res.list"
:key="index"
class="join-list-item"
@click="goToDetail(item.type)"
>
<div>
<div class="join-title">
<div>{{ item.title }}</div>
<div
class="sub"
v-if="item.type !== 'SECKILL'"
:style="{
backgroundColor: item.bk_color,
color: item.color1,
borderColor: item.bk_color,
}"
>
{{ item.title1 }}
</div>
<div class="sub-seckill" v-else>
<div class="sub-seckill-block flex">
<div class="sub-seckill-block-text">
{{ timeLine[0] ? timeLine[0].timeLine : "x" }}点场
</div>
{{ times.hours == "00" ? "0" : times.hours }}:{{
times.minutes
}}:{{ times.seconds }}
</div>
</div>
</div>
<div class="join-box">
<div
class="join-item"
v-for="(i, _index) in item.data"
:key="_index"
>
<div class="item-img-box">
<u-image
class="item-img"
width="156rpx"
height="156rpx"
:src="i.thumbnail ? i.thumbnail : i.goodsImage"
alt
/>
</div>
<div
class="ellipsis"
:class="{ 'max-width': res.list.length <= 1 }"
>
{{ i.goodsName ? i.goodsName : i.name }}
</div>
<div class="item-price">
<span>{{ i.price ? i.price : i.originalPrice }}</span>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</template>
<script>
import * as API_Promotions from "@/api/promotions";
import Foundation from "@/utils/Foundation.js";
export default {
props: ["res"],
data() {
return {
timeLine: "", //获取几个点活动
resTime: 0, //当前时间
time: 0, //距离下一个活动的时间值
times: {}, //时间集合
onlyOne: "", //是否最后一个商品
};
},
mounted() {
let params = {
pageNumber: 1,
pageSize: 2,
status: "START",
promotionStatus: "START",
};
this._setTimeInterval = setInterval(() => {
if (this.time <= 0) {
clearInterval(this._setTimeInterval);
} else {
this.times = Foundation.countTimeDown(this.time);
this.time--;
}
}, 1000);
this.res.list.forEach((ele) => {
switch (ele.type) {
case "PINTUAN":
API_Promotions.getAssembleList(params).then((response) => {
const data = response.data.result.records;
if (data) {
ele.data = data;
}
});
break;
case "SECKILL":
API_Promotions.getSeckillTimeLine().then((response) => {
if (response.data.success && response.data.result) {
ele.data = response.data.result[0].seckillGoodsList.slice(0, 2);
let timeLine = response.data.result.sort(
(x, y) => Number(x.timeLine) - Number(y.timeLine)
);
this.timeLine = timeLine.slice(0, 5);
this.resTime = parseInt(new Date().getTime() / 1000);
this.onlyOne = response.data.result.length === 1;
this.diffTime = parseInt(new Date().getTime() / 1000) - this.resTime;
this.time =
this.timeLine[0].distanceStartTime ||
(this.timeLine[1] && this.timeLine[1].distanceStartTime) ||
Foundation.theNextDayTime() - this.diffTime;
this.times = Foundation.countTimeDown(this.time);
console.log(this.timeLine);
}
});
break;
case "LIVE":
API_Promotions.getLiveList(params).then((response) => {
if (response.success && response.result.records) {
ele.data = response.result.records[0].commodityList.slice(0, 2);
}
});
break;
case "KANJIA":
API_Promotions.getBargainList(params).then((response) => {
if (response.success && response.result) {
ele.data = response.result.records(0, 2);
}
});
break;
default:
break;
}
});
},
methods: {
//跳转详情
goToDetail(type) {
switch(type) {
case "SECKILL":
uni.navigateTo({
url: `/pages/promotion/seckill`,
});
break;
case "PINTUAN":
uni.navigateTo({
url: `/pages/promotion/joinGroup`,
});
break;
case "LIVE":
uni.navigateTo({
url: `/pages/promotion/lives`,
});
break;
case "KANJIA":
uni.navigateTo({
url: `/pages/promotion/bargain/list`,
});
break;
};
}
},
};
</script>
<style lang="scss" scoped>
@import "./tpl.scss";
.join-box {
display: flex;
}
.join-list {
width: 100%;
display: flex;
overflow: hidden;
}
.join-list-item {
flex: 1;
}
.ellipsis {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
width: 108rpx; // 大于1个活动
font-size: 22rpx;
}
.max-width {
width: 316rpx !important;
}
.item-price {
> span {
font-size: 28rpx;
font-weight: 500;
color: #e1212b;
}
}
.join-item {
flex: 1;
}
.item-img {
width: 150rpx;
height: 150rpx;
margin: 0 auto;
display: block;
}
.item-img-box {
position: relative;
}
.item-line-through {
> span {
font-size: 20rpx;
font-weight: 400;
text-decoration: line-through;
color: #999;
}
}
.item-position-tips {
position: absolute;
right: 0;
color: #fff;
font-size: 24rpx;
bottom: 0;
}
.join-title {
display: flex;
align-items: center;
background: #fff;
height: 100rpx;
> div:nth-of-type(1) {
font-size: 30rpx;
font-weight: bold;
}
> div:nth-of-type(2) {
font-size: 20rpx;
line-height: 1.75;
border-radius: 16rpx;
text-align: center;
padding: 0 16rpx;
margin-left: 20rpx;
}
.sub {
background-color: #e1212b;
margin-right: 80rpx;
}
.sub-seckill {
white-space: nowrap;
padding: 0 !important;
}
.sub-seckill-block {
background: rgba($main-color, 0.3);
border-radius: 100px !important;
color: rgba($main-color, 0.7);
overflow: hidden;
padding-right: 8rpx;
}
.sub-seckill-block-text {
background-color: $main-color;
color: #fff;
border-top-right-radius: 100px;
border-bottom-right-radius: 100px;
padding: 0 12rpx !important;
margin-right: 12rpx;
}
}
</style>

View File

@@ -4,6 +4,9 @@
<u-icon name="search"></u-icon> <u-icon name="search"></u-icon>
{{ res.list[0].title }} {{ res.list[0].title }}
</div> </div>
<div slot="right" open-type="contact" class="navbar-right message" @click="linkMsgDetail" style="border-style:none;background:rgb(234,234,234);" >
<image style="width:53rpx;height:53rpx;margin-top:6rpx;" src="@/static/img/title.png"></image>
</div>
</div> </div>
</template> </template>
<script> <script>
@@ -11,6 +14,11 @@ export default {
title:"搜索栏", title:"搜索栏",
props: ["res"], props: ["res"],
methods: { methods: {
linkMsgDetail(){
uni.navigateTo({
url:`/pages/tabbar/home/title`
})
},
handleSearch() { handleSearch() {
uni.navigateTo({ uni.navigateTo({
url: "/pages/navigation/search/searchPage", url: "/pages/navigation/search/searchPage",
@@ -34,5 +42,14 @@ export default {
.layout { .layout {
background: #fff; background: #fff;
padding: 0 16rpx; padding: 0 16rpx;
position: relative;
}
.navbar-right{
position: absolute;
top: 0;
// right: 0;
}
.message{
right:40rpx;
} }
</style> </style>

View File

@@ -1,24 +1,34 @@
<template> <template>
<div class="layout"> <div class="layout" :style="{textAlign: res.list[0].textAlign}" @click="modelNavigateTo(res.list[0])" >
<div class="background"> <div class="background" :style="{ backgroundColor: res.list[0].bk_color}">
<div class="title" :style="{ color: res.list[0].color }"> <div class="title" :style="{ color: res.list[0].color }">
{{ res.list[0].title }} {{ res.list[0].title }}
</div> </div>
<div style="position: absolute;right: 10px;top:2px;color: #fff;line-height: 42px;font-size: 10px">
<a :style="{ color: res.list[0].color1 }" style="text-decoration: none">{{ res.list[0].title1 }}</a>
</div>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
import { modelNavigateTo } from "./tpl";
export default { export default {
title: "标题栏", title: "标题栏",
props: ["res"], props: ["res"],
data() {
return {
modelNavigateTo,
};
},
mounted() {}, mounted() {},
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@import "./tpl.scss"; @import "./tpl.scss";
.background { .background {
background: url("/static/title.png") no-repeat; // background: url("/static/title.png") no-repeat;
position: absolute; position: absolute;
z-index: 2; z-index: 2;
width: 100%; width: 100%;
@@ -43,5 +53,6 @@ export default {
line-height: 84rpx; line-height: 84rpx;
font-size: 30rpx; font-size: 30rpx;
font-weight: bold; font-weight: bold;
margin-left: 8rpx;
} }
</style> </style>

182
pages/tabbar/home/title.vue Normal file
View File

@@ -0,0 +1,182 @@
<template>
<view>
<view>
<u-tabs :list="list" :is-scroll="false" :current="current" @change="change"></u-tabs>
<u-cell-group v-if="current == 0">
<view v-for="(item,index) in lists" :key="index">
<u-cell-item :arrow="false" v-if="item.status =='UN_READY'" style="position: relative;"
@click="linkMsgDetail(item)">
<template slot="label">
<view style="display: inline-block;
width: 100%;
height: auto;
font-family: Gibson;
font-size: 25rpx;
word-break: break-all;
text-overflow: ellipsis;
word-wrap: break-word;
white-space: pre-wrap;">{{item.title}}
<view style="width:400rpx;padding: 10rpx 0;">{{item.createTime}}</view>
</view>
</template>
<!-- <button style="width:100rpx;height:60rpx;float:right;font-size:20rpx;line-height:60rpx;background:#000000;color:white;">未读</button> -->
</u-cell-item>
</view>
</u-cell-group>
<u-cell-group v-if="current == 1">
<view v-for="(item,index) in lists" :key="index">
<u-cell-item :arrow="false" v-if="item.status == 'ALREADY_READY'" style="position: relative;"
@click="linkMsgDetail(item)">
<template slot="label">
<view style="display: inline-block;
width: 100%;
height: auto;
font-family: Gibson;
font-size: 25rpx;
word-break: break-all;
text-overflow: ellipsis;
word-wrap: break-word;
white-space: pre-wrap;">{{item.title}}
<view style="width:400rpx;padding: 10rpx 0;">{{item.createTime}}</view>
</view>
</template>
<!-- <button style="width:100rpx;height:60rpx;float:right;font-size:20rpx;line-height:60rpx;background:#F3F3FA;color:black;">已读</button> -->
</u-cell-item>
</view>
</u-cell-group>
</view>
</view>
</template>
<script>
import {
messages,
editMessages
} from "@/api/message.js"
export default {
data() {
return {
params: {
pageSize: 20,
pageNumber: 1,
memberId: "",
messageId: "",
status:"UN_READY"
},
loadText: {
loadmore: '轻轻上拉',
loading: '努力加载中',
nomore: '实在没有了'
},
list: [{
name: "未读"
}, {
name: "已读"
}],
current: 0,
lists: [],
status: "loadmore"
}
},
onShow() {
this.getMessage()
},
onReachBottom() {
this.params.pageNumber++;
this.statuss = "loading";
this.getMessage()
},
methods: {
linkMsgDetail(v) {
if (v.status == 'UN_READY') {
let params = {}
params.messageId = v.memberId
editMessages(v.id, params).then(res => {
if (res.data.success) {
console.log( this.lists)
this.lists.forEach((item,index)=>{
console.log(item)
if(item.id == v.id){
this.lists.splice(index, 1)
}
})
}
})
}
// uni.navigateTo({
// url:`/pages/tabbar/home/messageDetail?data=${encodeURIComponent(JSON.stringify(v))}`
// })
},
/**
* 返回
*/
back() {
if (getCurrentPages().length == 1) {
uni.switchTab({
url: "/pages/tabbar/home/index",
});
} else {
uni.navigateBack();
}
},
change(e) {
console.log(e)
this.current = e;
if (e == 0) {
this.params.status = "UN_READY"
this.params.pageNumber = 1;
} else if (e == 1) {
this.params.status = "ALREADY_READY"
this.params.pageNumber = 1;
}
this.lists = []
this.getMessage()
},
getMessage() {
this.params.memberId = this.$options.filters.isLogin().id;
messages(this.params).then(res => {
console.log(res)
if (res.data.success) {
if (res.data.result.records == '') {
console.log(11111)
this.status = "nomore"
}
res.data.result.records.forEach(item => {
this.lists.push(item)
let obj = {};
this.lists = this.lists.reduce(
(cur, next) => {
//对象去重
if (next.id != undefined) {
obj[next.id] ?
"" :
(obj[next.id] = true && cur.push(next));
}
console.log(cur);
return cur;
},
[]
)
})
}
})
}
},
}
</script>
<style>
.foot {
position: fixed;
bottom: 0;
}
</style>

View File

@@ -1,10 +1,15 @@
<template> <template>
<div class="wrapper"> <div class="wrapper">
<!-- uni 中不能使用 vue component 所以用if判断每个组件 --> <!-- uni 中不能使用 vue component 所以用if判断每个组件 -->
<div v-for="(item,index) in pageData.list" :key="index"> <div v-for="(item, index) in pageData.list" :key="index">
<!-- 搜索栏如果在楼层装修顶部则会自动浮动否则不浮动 --> <!-- 搜索栏如果在楼层装修顶部则会自动浮动否则不浮动 -->
<u-navbar class="navbar" v-if="item.type == 'search'" :is-back="false" :is-fixed="index ===1 ? false : true"> <u-navbar
<search style="width:100%" :res="item.options" /> class="navbar"
v-if="item.type == 'search'"
:is-back="false"
:is-fixed="index === 1 ? false : true"
>
<search style="width: 100%" :res="item.options" />
<!-- #ifndef H5 --> <!-- #ifndef H5 -->
<!-- 扫码功能 不兼容h5 详情文档: https://uniapp.dcloud.io/api/system/barcode?id=scancode --> <!-- 扫码功能 不兼容h5 详情文档: https://uniapp.dcloud.io/api/system/barcode?id=scancode -->
<div slot="right" class="navbar-right"> <div slot="right" class="navbar-right">
@@ -14,10 +19,22 @@
</u-navbar> </u-navbar>
<carousel v-if="item.type == 'carousel'" :res="item.options" /> <carousel v-if="item.type == 'carousel'" :res="item.options" />
<titleLayout v-if="item.type == 'title'" :res="item.options" /> <titleLayout v-if="item.type == 'title'" :res="item.options" />
<leftOneRightTwo v-if="item.type == 'leftOneRightTwo'" :res="item.options" /> <leftOneRightTwo
<leftTwoRightOne v-if="item.type == 'leftTwoRightOne'" :res="item.options" /> v-if="item.type == 'leftOneRightTwo'"
<topOneBottomTwo v-if="item.type == 'topOneBottomTwo'" :res="item.options" /> :res="item.options"
<topTwoBottomOne v-if="item.type == 'topTwoBottomOne'" :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" /> <flexThree v-if="item.type == 'flexThree'" :res="item.options" />
<flexFive v-if="item.type == 'flexFive'" :res="item.options" /> <flexFive v-if="item.type == 'flexFive'" :res="item.options" />
<flexFour v-if="item.type == 'flexFour'" :res="item.options" /> <flexFour v-if="item.type == 'flexFour'" :res="item.options" />
@@ -25,16 +42,15 @@
<textPicture v-if="item.type == 'textPicture'" :res="item.options" /> <textPicture v-if="item.type == 'textPicture'" :res="item.options" />
<menuLayout v-if="item.type == 'menu'" :res="item.options" /> <menuLayout v-if="item.type == 'menu'" :res="item.options" />
<flexOne v-if="item.type == 'flexOne'" :res="item.options" /> <flexOne v-if="item.type == 'flexOne'" :res="item.options" />
<goods :enableBottomLoad="enableLoad" v-if="item.type == 'goods'" :res="item.options" />
<goods v-if="item.type == 'goods'" :res="item.options" />
<group v-if="item.type == 'group'" :res="item.options" /> <group v-if="item.type == 'group'" :res="item.options" />
<notice v-if="item.type == 'notice'" :res="item.options" />
<promotions v-if="item.type == 'promotionDetail'" :res="item.options" />
<!-- <joinGroup v-if="item.type == 'joinGroup'" :res="item.options" /> --> <!-- <joinGroup v-if="item.type == 'joinGroup'" :res="item.options" /> -->
<!-- <integral v-if="item.type == 'integral'" :res="item.options" /> --> <!-- <integral v-if="item.type == 'integral'" :res="item.options" /> -->
<!-- <spike v-if="item.type == 'spike'" :res="item.options" /> --> <!-- <spike v-if="item.type == 'spike'" :res="item.options" /> -->
</div> </div>
<u-no-network></u-no-network> <u-no-network @retry="init" @isConnected="isConnected"></u-no-network>
</div> </div>
</template> </template>
@@ -60,10 +76,8 @@ import tpl_goods from "@/pages/tabbar/home/template/tpl_goods"; //商品分类
import { getFloorData } from "@/api/home"; //获取楼层装修接口 import { getFloorData } from "@/api/home"; //获取楼层装修接口
import permision from "@/js_sdk/wa-permission/permission.js"; //权限工具类 import permision from "@/js_sdk/wa-permission/permission.js"; //权限工具类
import config from "@/config/config"; import config from "@/config/config";
// TODO 后续开发 import tpl_notice from "@/pages/tabbar/home/template/tpl_notice"; //标题栏模块
// import tpl_join_group from "@/pages/tabbar/home/template/tpl_join_group"; import tpl_promotions from "@/pages/tabbar/home/template/tpl_promotions_detail"; //标题栏模块
// import tpl_integral from "@/pages/tabbar/home/template/tpl_integral";
// import tpl_spike from "@/pages/tabbar/home/template/tpl_spike";
export default { export default {
data() { data() {
@@ -71,6 +85,7 @@ export default {
config, config,
pageData: "", //楼层页面数据 pageData: "", //楼层页面数据
isIos: "", isIos: "",
enableLoad:false, //触底加载 针对于商品模块
}; };
}, },
components: { components: {
@@ -90,9 +105,8 @@ export default {
flexOne: tpl_flex_one, flexOne: tpl_flex_one,
goods: tpl_goods, goods: tpl_goods,
group: tpl_group, group: tpl_group,
// spike: tpl_spike, notice: tpl_notice,
// joinGroup: tpl_join_group, promotions: tpl_promotions,
// integral: tpl_integral,
}, },
mounted() { mounted() {
@@ -111,10 +125,19 @@ export default {
this.pageData = ""; this.pageData = "";
getFloorData().then((res) => { getFloorData().then((res) => {
if (res.data.success) { if (res.data.success) {
this.pageData = JSON.parse(res.data.result.pageData); const result = JSON.parse(res.data.result.pageData)
this.pageData = result;
if(result.list.length){
// 如果最后一个装修模块是商品模块的话 默认启用自动加载
result.list[result.list.length-1] ? result.list[result.list.length-1].model == 'goods' ? this.enableLoad = true : '' : ''
}
} }
}); });
}, },
// 是否有网络链接
isConnected(val){
val ? this.init() : ''
},
/** /**
* TODO 扫码功能后续还会后续增加 * TODO 扫码功能后续还会后续增加
@@ -128,10 +151,22 @@ export default {
uni.scanCode({ uni.scanCode({
success: function (res) { success: function (res) {
let path = encodeURIComponent(res.result); let path = encodeURIComponent(res.result);
if(path!=undefined && path.indexOf("QR_CODE_LOGIN_SESSION")==0){
console.log(path)
//app扫码登录
uni.navigateTo({
url:"/pages/passport/scannerCodeLoginConfirm?token="+path
});
return;
}
// WX_CODE 为小程序码 // WX_CODE 为小程序码
if (res.scanType == "WX_CODE") { if (res.scanType == "WX_CODE") {
console.log(res) console.log(res);
uni.navigateTo({ uni.navigateTo({
url: `/${res.path}`, url: `/${res.path}`,
}); });

View File

@@ -5,9 +5,13 @@
</template> </template>
<script> <script>
import configs from "@/config/config";
import storage from "@/utils/storage";
export default { export default {
data() { data() {
return { return {
configs,
storage,
webviewStyles: { webviewStyles: {
progress: { progress: {
color: this.$lightColor, color: this.$lightColor,
@@ -17,7 +21,24 @@ export default {
}; };
}, },
onLoad(params) { onLoad(params) {
this.src = decodeURIComponent(params.src); // params.IM ? (this.src = `${configs.imWebSrc}?token=${storage.getAccessToken()}&id=${params.IM}`): (this.src = decodeURIComponent(params.src));
if(params.IM)
{
if(params.IM==0)
{
this.src = `${configs.imWebSrc}?token=${storage.getAccessToken()}`;
}
else
{
this.src = `${configs.imWebSrc}?token=${storage.getAccessToken()}&id=${params.IM}`;
}
}
else
{
this.src = decodeURIComponent(params.src);
console.log(this.src);
}
}, },
}; };
</script> </script>
@@ -29,4 +50,4 @@ export default {
margin: 0; margin: 0;
} }
} }
</style> </style>

View File

@@ -0,0 +1,95 @@
<template>
<u-modal v-model="show" cancelText="不同意" confirmText="同意" showCancelButton="btnShow" title="服务协议和隐私政策" @confirm="confirm" @cancel="cancel">
<view class="u-update-content">
请您务必审慎阅读,充分理解服务协议隐私政策各条款
包括但不限于为了更好的向你提供服务我们需要收集你的设备标识,
操作日志等信息用于分析优化应用性能 您可阅读你可阅读
<a @click="gotoLink">服务协议</a>
<a @click="gotoB"> 隐私政策</a>了解详细信息
如果您同意请点击下面按钮开始接受我们的服务
</view>
</u-modal>
</template>
<script>
import storage from "@/utils/storage";
export default {
created() {
//先进入 created
// if (storage.getShow()) {
// //展示的话进入 true
// console.log(this.show); //如果上面没读缓存 此时 this.show 为true
// if (!this.show) {
// //如果等于 false 了 就跳到主页
// this.show = storage.getShow(); //这里就为false
// setTimeout(() => {
// //然后这里就跳转到 首页
// uni.reLaunch({
// //跳转到 首页
// url: "/pages/tabbar/home/index",
// });
// }, 500);
// }
// }
},
data() {
return {
show: true, //展示
btnShow:true,
a: "",
};
},
// onReady() {
// this.show = true;
// },
methods: {
gotoLink() {
uni.navigateTo({
//点击跳转到浏览器
url:
"/pages/tabbar/home/web-view?src=https://pc-b2b2c.pickmall.cn/article/detail?id=1371992704333905920",
});
},
gotoB() {
uni.navigateTo({
url:
"/pages/tabbar/home/web-view?src=https://pc-b2b2c.pickmall.cn/article/detail?id=1371779927900160000",
});
},
//取消
cancel(){
// #ifdef APP-PLUS
const threadClass = plus.ios.importClass("NSThread");
const mainThread = plus.ios.invoke(threadClass, "mainThread");
plus.ios.invoke(mainThread, "exit")
// #endif
},
confirm() {
//点击
this.show = false; // 让这个框为false
storage.setShow(this.show); //存入缓存
if (!this.show) {
// 他如果 不展示 就跳转到主页
setTimeout(() => {
uni.reLaunch({
//跳转到 首页
url: "/pages/tabbar/home/index",
});
}, 500);
}
},
},
};
</script>
<style scoped>
.u-update-content {
font-size: 26rpx;
padding: 30rpx;
}
a {
text-decoration: blue;
color: blue;
}
</style>

View File

@@ -0,0 +1,247 @@
<template>
<div class="wrapper">
<!-- uni 中不能使用 vue component 所以用if判断每个组件 -->
<div v-for="(item, index) in pageData.list" :key="index">
<!-- 搜索栏如果在楼层装修顶部则会自动浮动否则不浮动 -->
<div class="navbar" v-if="item.type == 'search'">
<search style="width: 100%" :res="item.options" />
<!-- #ifndef H5 -->
<!-- 扫码功能 不兼容h5 详情文档: https://uniapp.dcloud.io/api/system/barcode?id=scancode -->
<div slot="right" class="navbar-right">
<u-icon name="scan" @click="scan()" color="#666" size="50"></u-icon>
</div>
<!-- #endif -->
</div>
<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" />
<notice v-if="item.type == 'notice'" :res="item.options" />
<promotions v-if="item.type == 'promotionDetail'" :res="item.options" />
<!-- <joinGroup v-if="item.type == 'joinGroup'" :res="item.options" /> -->
<!-- <integral v-if="item.type == 'integral'" :res="item.options" /> -->
<!-- <spike v-if="item.type == 'spike'" :res="item.options" /> -->
</div>
<u-no-network></u-no-network>
</div>
</template>
<script>
// 引用组件
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 { toSpecial, getSpecial } from "@/api/home"; //获取楼层装修接口
import permision from "@/js_sdk/wa-permission/permission.js"; //权限工具类
import config from "@/config/config";
import tpl_notice from "@/pages/tabbar/home/template/tpl_notice"; //标题栏模块
import tpl_promotions from "@/pages/tabbar/home/template/tpl_promotions_detail"; //标题栏模块
export default {
data() {
return {
id: "",
config,
pageData: "", //楼层页面数据
bodyParam: "",
isIos: ""
};
},
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,
notice: tpl_notice,
promotions: tpl_promotions
},
mounted() {
this.init();
// #ifdef MP-WEIXIN
// 小程序默认分享
uni.showShareMenu({ withShareTicket: true });
// #endif
},
onLoad(val) {
this.id = val.id;
this.bodyParam = val.body;
},
methods: {
/**
* 实例化首页数据楼层
*/
init() {
this.pageData = "";
console.log(this.bodyParam);
if (this.bodyParam) {
toSpecial({body: this.bodyParam}).then(res => {
if (res.data.success) {
this.pageData = JSON.parse(res.data.result.pageData);
}
});
} else {
getSpecial(this.id).then(res => {
if (res.data.success) {
this.pageData = JSON.parse(res.data.result.pageData);
}
});
}
},
/**
* TODO 扫码功能后续还会后续增加
* 应该实现的功能目前计划有:
* 扫描商品跳转商品页面
* 扫描活动跳转活动页面
* 扫描二维码登录
* 扫描其他站信息 弹出提示,返回首页。
*/
seacnCode() {
uni.scanCode({
success: function(res) {
let path = encodeURIComponent(res.result);
// WX_CODE 为小程序码
if (res.scanType == "WX_CODE") {
console.log(res);
uni.navigateTo({
url: `/${res.path}`
});
} else {
config.scanAuthNavigation.forEach(src => {
if (res.result.indexOf(src) != -1) {
uni.navigateTo({
url: `/${res.result.substring(src.length)}`
});
} else {
setTimeout(() => {
uni.navigateTo({
url: "/pages/tabbar/home/web-view?src=" + path
});
}, 100);
}
});
}
}
});
},
/**
* 提示获取权限
*/
tipsGetSettings() {
uni.showModal({
title: "提示",
content: "您已经关闭相机权限,去设置",
success: function(res) {
if (res.confirm) {
if (this.isIos) {
plus.runtime.openURL("app-settings:");
} else {
permision.gotoAppPermissionSetting();
}
}
}
});
},
/**
* 唤醒客户端扫码
* 没权限去申请权限,有权限获取扫码功能
*/
async scan() {
// #ifdef APP-PLUS
this.isIos = plus.os.name == "iOS";
// 判断是否是Ios
if (this.isIos) {
const iosFirstCamera = uni.getStorageSync("iosFirstCamera"); //是不是第一次开启相机
if (iosFirstCamera !== "false") {
uni.setStorageSync("iosFirstCamera", "false"); //设为false就代表不是第一次开启相机
this.seacnCode();
} else {
if (permision.judgeIosPermission("camera")) {
this.seacnCode();
} else {
// 没有权限提醒是否去申请权限
this.tipsGetSettings();
}
}
} else {
/**
* TODO 安卓 权限已经授权了调用api总是显示用户已永久拒绝申请。人傻了
* TODO 如果xdm有更好的办法请在 https://gitee.com/beijing_hongye_huicheng/lilishop/issues 提下谢谢
*/
this.seacnCode();
}
// #endif
// #ifdef MP-WEIXIN
this.seacnCode();
// #endif
}
}
};
</script>
<style scoped lang="scss">
.navbar-right {
padding: 0 16rpx 0 0;
}
.navbar {
display: flex;
align-items: center;
}
</style>

View File

@@ -36,12 +36,7 @@
</u-row> </u-row>
<!-- 我的订单代付款 --> <!-- 我的订单代付款 -->
<view class="order"> <view class="order">
<view class="order-item" @click="navigateTo('/pages/order/myOrder?status=0')">
<div class="bag bag1">
<u-icon name="order" size="35" color="#fff"></u-icon>
</div>
<view>我的订单</view>
</view>
<view class="order-item" @click="navigateTo('/pages/order/myOrder?status=1')"> <view class="order-item" @click="navigateTo('/pages/order/myOrder?status=1')">
<div class="bag bag2"> <div class="bag bag2">
<u-icon name="bag-fill" size="35" color="#fff"></u-icon> <u-icon name="bag-fill" size="35" color="#fff"></u-icon>
@@ -64,8 +59,14 @@
<div class="bag bag5"> <div class="bag bag5">
<u-icon name="server-fill" size="35" color="#fff"></u-icon> <u-icon name="server-fill" size="35" color="#fff"></u-icon>
</div> </div>
<view>售后服务</view> <view>售后</view>
</view> </view>
<view class="order-item" @click="navigateTo('/pages/order/myOrder?status=0')">
<div class="bag bag1">
<u-icon name="order" size="35" color="#fff"></u-icon>
</div>
<view>我的订单</view>
</view>
</view> </view>
</div> </div>
<!-- 常用工具 --> <!-- 常用工具 -->

View File

@@ -5,59 +5,99 @@
<div class="paddingBox"> <div class="paddingBox">
<view class="interact-container"> <view class="interact-container">
<view class="interact-item" @click="navigateTo('/pages/mine/address/addressManage')">
<image src="/static/mine/myaddress.png" mode=""></image>
<view>地址管理</view>
</view>
<view class="interact-item" @click="navigateTo('/pages/mine/myTracks')">
<image src="/static/mine/logistics.png" mode=""></image>
<view>我的足迹</view>
</view>
<view class="interact-item" @click="navigateTo('/pages/order/evaluate/myEvaluate')">
<image src="/static/mine/feedback.png" mode=""></image>
<view>我的评价</view>
</view>
<view class="interact-item" @click="linkMsgDetail()">
<image src="/static/mine/mycommit.png" mode=""></image>
<view>我的消息</view>
</view>
<view class="interact-item" @click="navigateTo('/pages/mine/myCollect')">
<image src="/static/mine/myfavorite.png" mode=""></image>
<view>我的关注</view>
</view>
<view class="interact-item" @click="navigateTo('/pages/mine/point/myPoint')">
<image src="/static/mine/mypoint.png" mode=""></image>
<view>我的积分</view>
</view>
<view class="interact-item" @click="distribution">
<image src="/static/mine/distribution.png" mode=""></image>
<view>我的分销</view>
</view>
<view class="interact-item" @click="navigateTo('/pages/order/complain/complainList')">
<image src="/static/mine/shensu.png" mode=""></image>
<view>我的投诉</view>
</view>
<view class="interact-item" @click="navigateTo('/pages/cart/coupon/myCoupon')">
<image src="/static/mine/mycoupon.png" mode=""></image>
<view>优惠券</view>
</view>
<view class="interact-item" @click="navigateTo('/pages/mine/signIn')"> <view class="interact-item" @click="navigateTo('/pages/mine/signIn')">
<image src="/static/mine/sign.png" mode=""></image> <image src="/static/mine/sign.png" mode=""></image>
<view>每日签到</view> <view>每日签到</view>
</view> </view>
<view class="interact-item" @click="navigateTo('/pages/mine/point/myPoint')">
<image src="/static/mine/mypoint.png" mode=""></image>
<view>我的积分</view>
</view>
<view class="interact-item" @click="navigateTo('/pages/cart/coupon/myCoupon')">
<image src="/static/mine/mycoupon.png" mode=""></image>
<view>优惠券</view>
</view>
<view class="interact-item" @click="navigateTo('/pages/mine/myCollect')">
<image src="/static/mine/myfavorite.png" mode=""></image>
<view>我的关注</view>
</view>
<view class="interact-item" @click="navigateTo('/pages/mine/myTracks')">
<image src="/static/mine/myhistory.png" mode=""></image>
<view>我的足迹</view>
</view>
<view class="interact-item" @click="navigateTo('/pages/order/evaluate/myEvaluate')">
<image src="/static/mine/mycommit.png" mode=""></image>
<view>我的评价</view>
</view>
<view class="interact-item" @click="navigateTo('/pages/order/complain/complainList')">
<image src="/static/mine/shensu.png" mode=""></image>
<view>我的投诉</view>
</view>
<view class="interact-item" @click="navigateTo('/pages/mine/set/feedBack')">
<image src="/static/mine/feedback.png" mode=""></image>
<view>意见反馈</view>
</view>
<view class="interact-item" @click="navigateTo('/pages/cart/coupon/couponCenter')"> <view class="interact-item" @click="navigateTo('/pages/cart/coupon/couponCenter')">
<image src="/static/mine/couponcenter.png" mode=""></image> <image src="/static/mine/couponcenter.png" mode=""></image>
<view>领券中心</view> <view>领券中心</view>
</view> </view>
<view class="interact-item" @click="navigateTo('/pages/mine/address/addressManage')">
<image src="/static/mine/myaddress.png" mode=""></image>
<view>地址管理</view>
</view>
<view class="interact-item" @click="navigateTo('/pages/mine/set/setUp')">
<image src="/static/mine/setting.png" mode=""></image>
<view>设置</view>
</view>
<view class="interact-item" @click="distribution">
<image src="/static/mine/distribution.png" mode=""></image>
<view>我的分销</view>
</view>
<view class="interact-item" @click="navigateTo('/pages/promotion/bargain/log')"> <view class="interact-item" @click="navigateTo('/pages/promotion/bargain/log')">
<image src="/static/mine/kanjia.png" mode=""></image> <image src="/static/mine/kanjia.png" mode=""></image>
<view>砍价记录</view> <view>砍价记录</view>
</view> </view>
<view class="interact-item" @click="navigateTo('/pages/mine/set/feedBack')">
<image src="/static/mine/feedback.png" mode=""></image>
<view>意见反馈</view>
</view>
<view class="interact-item" @click="navigateTo('/pages/mine/set/editionIntro')">
<image src="/static/mine/pointgift.png" mode=""></image>
<view>关于</view>
</view>
<view class="interact-item" @click="navigateTo('/pages/mine/set/setUp')">
<image src="/static/mine/setting.png" mode=""></image>
<view>设置</view>
</view>
</view> </view>
</div> </div>
</view> </view>
@@ -66,13 +106,30 @@
<script> <script>
import { distribution } from "@/api/goods"; import { distribution } from "@/api/goods";
import configs from "@/config/config";
import storage from "@/utils/storage";
export default { export default {
data() {
return {
configs,
storage
}
},
methods: { methods: {
navigateTo(url) { navigateTo(url) {
uni.navigateTo({ uni.navigateTo({
url, url,
}); });
}, },
linkMsgDetail(){
uni.navigateTo({
url: `/pages/tabbar/home/web-view?IM=0`,
});
},
distribution() { distribution() {
distribution().then((res) => { distribution().then((res) => {
if (res.data.result) { if (res.data.result) {

View File

@@ -854,7 +854,8 @@ function downloadPopup(data, callback, cancelCallback, rebootCallback) {
export default function (isPrompt = false) { export default function (isPrompt = false) {
getCurrentNo((version) => { getCurrentNo((version) => {
getServerNo((res) => { getServerNo((res) => {
if (res.versionCode.replace(/\./g, "") <= version.versionCode) {
if (res.versionCode.replace(/\./g, "") <= version.version.replace(/\./g, "")) {
return false; return false;
} }

28
project.config.json Normal file
View File

@@ -0,0 +1,28 @@
{
"appid": "wx98ebde1da5b340d4",
"compileType": "miniprogram",
"libVersion": "2.27.0",
"packOptions": {
"ignore": [],
"include": []
},
"setting": {
"coverView": true,
"es6": true,
"postcss": true,
"minified": true,
"enhance": true,
"showShadowRootInWxmlPanel": true,
"packNpmRelationList": [],
"babelSetting": {
"ignore": [],
"disablePlugins": [],
"outputPath": ""
}
},
"condition": {},
"editorSetting": {
"tabIndent": "insertSpaces",
"tabSize": 2
}
}

View File

@@ -0,0 +1,7 @@
{
"description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html",
"projectname": "lilishop-uniapp",
"setting": {
"compileHotReLoad": true
}
}

BIN
static/bg.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

BIN
static/bg1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

BIN
static/buy.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

BIN
static/img/title.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.6 KiB

BIN
static/join-buy.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

BIN
static/seckill.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 692 B

View File

@@ -6,6 +6,7 @@ Vue.use(Vuex);
const store = new Vuex.Store({ const store = new Vuex.Store({
state: { state: {
shareLink:"", //分享链接
verificationKey: "", //获取key表示验证通过 verificationKey: "", //获取key表示验证通过
distributionId:"", //分销员Id 如果当前账户从未登录过时记录 distributionId:"", //分销员Id 如果当前账户从未登录过时记录
hasLogin: storage.getHasLogin(), hasLogin: storage.getHasLogin(),

View File

@@ -150,6 +150,9 @@ $font-weight: 400;
.flex-a-c{ .flex-a-c{
align-items: center; align-items: center;
} }
.flex-j-sb{
justify-content: space-between;
}
.relative { .relative {
position: relative; position: relative;
} }
@@ -169,3 +172,11 @@ $font-weight: 400;
-webkit-line-clamp: 2; -webkit-line-clamp: 2;
overflow: hidden; overflow: hidden;
} }
.wes-3 {
/* 适用于webkit内核和移动端 */
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 3;
overflow: hidden;
}

View File

@@ -1,5 +1,7 @@
import Foundation from "./Foundation.js"; import Foundation from "./Foundation.js";
import storage from "@/utils/storage.js"; import storage from "@/utils/storage.js";
import { getUserInfo } from "@/api/members";
import Vue from "vue";
/** /**
* 金钱单位置换 2999 --> 2,999.00 * 金钱单位置换 2999 --> 2,999.00
* @param val * @param val
@@ -19,6 +21,20 @@ export function unitPrice(val, unit, location) {
return (unit || "") + price; return (unit || "") + price;
} }
/**
* 格式化价格 1999 --> [1999,00]
* @param {*} val
* @returns
*/
export function goodsFormatPrice(val) {
if (typeof val == "undefined") {
return val;
}
let valNum = new Number(val);
return valNum.toFixed(2).split(".");
}
/** /**
* 脱敏姓名 * 脱敏姓名
*/ */
@@ -99,12 +115,44 @@ export function clearStrComma(str) {
export function isLogin(val) { export function isLogin(val) {
let userInfo = storage.getUserInfo(); let userInfo = storage.getUserInfo();
if (val == "auth") { if (val == "auth") {
return userInfo.id ? true : false; return userInfo && userInfo.id ? true : false;
} else { } else {
return storage.getUserInfo(); return storage.getUserInfo();
} }
} }
export function tipsToLogin() {
if (!isLogin("auth")) {
uni.showModal({
title: "提示",
content: "当前用户未登录是否登录?",
confirmText: "确定",
cancelText: "取消",
confirmColor: Vue.prototype.$mainColor,
success: (res) => {
if (res.confirm) {
navigateToLogin();
} else if (res.cancel) {
uni.navigateBack();
}
},
});
return false;
}
return true;
}
/**
* 获取用户信息并重新添加到缓存里面
*/
export async function userInfo() {
let res = await getUserInfo();
if (res.data.success) {
storage.setUserInfo(res.data.result);
return res.data.result;
}
}
/** /**
* 验证是否登录如果没登录则去登录 * 验证是否登录如果没登录则去登录
* @param {*} val * @param {*} val
@@ -113,7 +161,7 @@ export function isLogin(val) {
export function forceLogin() { export function forceLogin() {
let userInfo = storage.getUserInfo(); let userInfo = storage.getUserInfo();
if (!userInfo.id) { if (!userInfo || !userInfo.id) {
// #ifdef MP-WEIXIN // #ifdef MP-WEIXIN
uni.navigateTo({ uni.navigateTo({

View File

@@ -1,187 +1,206 @@
import Request from "@/lib/request/index.js"; import Request from "@/lib/request/index.js";
import { refreshTokenFn } from "@/api/login.js"; import {
import storage from "@/utils/storage.js"; refreshTokenFn
import { md5 } from "@/utils/md5.js"; } from "@/api/login.js";
import Foundation from "@/utils/Foundation.js"; import storage from "@/utils/storage.js";
import api from "@/config/api.js"; import {
md5
import uuid from "@/utils/uuid.modified.js"; } from "@/utils/md5.js";
import Foundation from "@/utils/Foundation.js";
function cleanStorage() { import api from "@/config/api.js";
uni.showToast({
title: "你的登录状态已过期,请重新登录", import uuid from "@/utils/uuid.modified.js";
icon: "none",
duration: 1500,
}); let isNavigateTo = false
if (uni.showLoading()) {
uni.hideLoading(); function cleanStorage() {
} uni.showToast({
title: "你的登录状态已过期,请重新登录",
storage.setHasLogin(false); icon: "none",
storage.setAccessToken(""); duration: 1500,
storage.setRefreshToken(""); });
console.log("清空token"); if (uni.showLoading()) {
storage.setUuid(""); uni.hideLoading();
storage.setUserInfo({}); }
storage.setHasLogin(false);
storage.setAccessToken("");
// 防抖处理跳转 storage.setRefreshToken("");
// #ifdef MP-WEIXIN console.log("清空token");
storage.setUuid("");
uni.navigateTo({ storage.setUserInfo({});
url: "/pages/passport/wechatMPLogin",
});
if (!isNavigateTo) {
// #endif isNavigateTo = true
// 防抖处理跳转
// #ifndef MP-WEIXIN // #ifdef MP-WEIXIN
uni.navigateTo({
uni.navigateTo({ url: "/pages/passport/wechatMPLogin",
url: "/pages/passport/login", });
}); // #endif
// #ifndef MP-WEIXIN
// #endif uni.navigateTo({
} url: "/pages/passport/login",
});
let http = new Request(); // #endif
}
}
http.setConfig((config) => {
// 没有uuid创建 let http = new Request();
if (!storage.getUuid()) {
storage.setUuid(uuid.v1());
} http.setConfig((config) => {
// 没有uuid创建
/* 设置全局配置 */ if (!storage.getUuid()) {
config.baseURL = api.buyer; storage.setUuid(uuid.v1());
config.header = { }
...config.header,
}; /* 设置全局配置 */
config.validateStatus = (statusCode) => { config.baseURL = api.buyer;
// 不论什么状态,统一在正确中处理 config.header = {
return true; ...config.header,
}; };
return config; config.validateStatus = (statusCode) => {
}); // 不论什么状态,统一在正确中处理
return true;
http.interceptors.request.use( };
(config) => { return config;
/* 请求之前拦截器。可以使用async await 做异步操作 */ });
let accessToken = storage.getAccessToken();
if (accessToken) { http.interceptors.request.use(
const nonce = Foundation.randomString(6); (config) => {
const timestamp = parseInt(new Date().getTime() / 1000); /* 请求之前拦截器。可以使用async await 做异步操作 */
const sign = md5(nonce + timestamp + accessToken); let accessToken = storage.getAccessToken();
const _params = { if (accessToken) {
nonce, const nonce = Foundation.randomString(6);
timestamp, const timestamp = parseInt(new Date().getTime() / 1000);
sign, const sign = md5(nonce + timestamp + accessToken);
}; const _params = {
let params = config.params || {}; nonce,
params = { ...params, ..._params }; timestamp,
sign,
config.params = params; };
config.header.accessToken = accessToken; let params = config.params || {};
params = {
...params,
} ..._params
config.header = { };
...config.header,
uuid: storage.getUuid() || uuid.v1(), config.params = params;
}; config.header.accessToken = accessToken;
return config;
},
(config) => { }
return Promise.reject(config); config.header = {
} ...config.header,
); uuid: storage.getUuid() || uuid.v1(),
};
return config;
// 是否正在刷新的标记 },
let isRefreshing = false; (config) => {
//重试队列 return Promise.reject(config);
let requests = []; }
// 必须使用异步函数,注意 );
http.interceptors.response.use(
async (response) => {
/* 请求之后拦截器。可以使用async await 做异步操作 */ // 是否正在刷新的标记
// token存在并且token过期 let isRefreshing = false;
if (isRefreshing && response.statusCode === 403) { //重试队列
cleanStorage(); let requests = [];
isRefreshing = false; // 必须使用异步函数,注意
} http.interceptors.response.use(
async (response) => {
let token = storage.getAccessToken(); isNavigateTo = false
if ( /* 请求之后拦截器。可以使用async await 做异步操作 */
(token && response.statusCode === 403) || // token存在并且token过期
response.data.status === 403 // if (isRefreshing && response.statusCode === 403) {
) { // cleanStorage();
if (!isRefreshing) { // isRefreshing = false;
isRefreshing = true; // }
//调用刷新token的接口
return refreshTokenFn(storage.getRefreshToken()) let token = storage.getAccessToken();
.then((res) => { if (
let { accessToken, refreshToken } = res.data.result; (token && response.statusCode === 403) ||
storage.setAccessToken(accessToken); response.data.status === 403
storage.setRefreshToken(refreshToken); ) {
if (!isRefreshing) {
response.header.accessToken = `${accessToken}`; console.log('旧token', token)
// token 刷新后将数组的方法重新执行 isRefreshing = true;
requests.forEach((cb) => cb(accessToken)); storage.setAccessToken('')
requests = []; // 重新请求完清空 let oldRefreshToken = storage.getRefreshToken();
return http.request(response.config); //调用刷新token的接口
}) return refreshTokenFn(oldRefreshToken)
.catch((err) => { .then((res) => {
cleanStorage(); let {
return Promise.reject(err); accessToken,
}) refreshToken
.finally(() => { } = res.data.result;
isRefreshing = false; storage.setAccessToken(accessToken);
}); storage.setRefreshToken(refreshToken);
} else {
// 返回未执行 resolve 的 Promise response.header.accessToken = `${accessToken}`;
return new Promise((resolve) => { // token 刷新后将数组的方法重新执行
// 用函数形式将 resolve 存入,等待刷新后再执行 console.log('接口队列', requests, '新token', accessToken)
requests.push((token) => { requests.forEach((cb) => cb(accessToken));
response.header.accessToken = `${token}`; requests = []; // 重新请求完清空
resolve(http.request(response.config)); return http.request(response.config);
}); })
}); .catch((err) => {
} console.log('刷新token报错' + oldRefreshToken, err)
cleanStorage();
// 如果当前返回没登录 return Promise.reject(err);
} else if ( })
(!token && response.statusCode === 403) || .finally(() => {
response.data.code === 403 isRefreshing = false;
) { });
cleanStorage(); } else {
// 返回未执行 resolve 的 Promise
// 如果当前状态码为正常但是success为不正常时 return new Promise((resolve) => {
} else if ( // 用函数形式将 resolve 存入,等待刷新后再执行
(response.statusCode == 200 && !response.data.success) || requests.push((token) => {
response.statusCode == 400 response.header.accessToken = `${token}`;
) { resolve(http.request(response.config));
if (response.data.message) { });
uni.showToast({ });
title: response.data.message, }
icon: "none",
duration: 1500, // 如果当前返回没登录
}); } else if (
} (!token && !storage.getRefreshToken() && response.statusCode === 403) ||
} response.data.code === 403
return response; ) {
}, console.log('没有token 以及刷新token 内容', token, storage.getRefreshToken())
(error) => { cleanStorage();
return error;
} // 如果当前状态码为正常但是success为不正常时
); } else if (
(response.statusCode == 200 && !response.data.success) ||
export { http }; response.statusCode == 400
) {
export const Method = { if (response.data.message) {
GET: "GET", uni.showToast({
POST: "POST", title: response.data.message,
PUT: "PUT", icon: "none",
DELETE: "DELETE", duration: 1500,
}; });
}
}
return response;
},
(error) => {
return error;
}
);
export {
http
};
export const Method = {
GET: "GET",
POST: "POST",
PUT: "PUT",
DELETE: "DELETE",
};

View File

@@ -18,7 +18,16 @@ export default {
getHotWords() { getHotWords() {
return uni.getStorageSync(`hotWords`); return uni.getStorageSync(`hotWords`);
}, },
//写入 展示还是不展示
setShow(val) {
uni.setStorageSync("show", val);
},
getShow() {
if (uni.getStorageSync(`show`) === "" || uni.getStorageSync(`show`) === undefined) {
return true;
}
return uni.getStorageSync(`show`);
},
// 获取face id登录 // 获取face id登录
getFaceLogin() { getFaceLogin() {
return uni.getStorageSync(FACE_LOGIN); return uni.getStorageSync(FACE_LOGIN);
@@ -92,11 +101,11 @@ export default {
removeRefreshToken() { removeRefreshToken() {
uni.removeStorageSync(REFRESH_TOKEN); uni.removeStorageSync(REFRESH_TOKEN);
}, },
// 写入刷新token
setAfterSaleData(val) { setAfterSaleData(val) {
uni.setStorageSync(AFTERSALE_DATA, val); uni.setStorageSync(AFTERSALE_DATA, val);
}, },
// 获取刷新token
getAfterSaleData() { getAfterSaleData() {
return uni.getStorageSync(AFTERSALE_DATA); return uni.getStorageSync(AFTERSALE_DATA);
}, },

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