mirror of
https://gitee.com/beijing_hongye_huicheng/lilishop-uniapp.git
synced 2025-12-20 01:15:53 +08:00
Compare commits
424 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7939998a30 | ||
|
|
1fcc016ccd | ||
|
|
3219f6d576 | ||
|
|
83da8f3003 | ||
|
|
c858c82950 | ||
|
|
f9c7610976 | ||
|
|
919af44fda | ||
|
|
db7cfcea85 | ||
|
|
e95aed8e38 | ||
|
|
24454e2546 | ||
|
|
0ee03d9fcf | ||
|
|
c93862066b | ||
|
|
46dbeb77c8 | ||
|
|
8bcc9de352 | ||
|
|
bac8e3a327 | ||
|
|
29a20afe93 | ||
|
|
0ef3eb9bf7 | ||
|
|
ef6f572311 | ||
|
|
c1fce859ce | ||
|
|
2cd7b7b63f | ||
|
|
75991db6f6 | ||
|
|
f894b5b1fc | ||
|
|
7ae6967b1e | ||
|
|
de94f212c3 | ||
|
|
d166d5943c | ||
|
|
c0e5d75cc6 | ||
|
|
9195bcdeb5 | ||
|
|
7778a62d6a | ||
|
|
31c341148f | ||
|
|
0b601e4f3e | ||
|
|
1d93d9103d | ||
|
|
5bc5152e49 | ||
|
|
e9d1a81612 | ||
|
|
7d3d06e8af | ||
|
|
55bb6ab51a | ||
|
|
70c2e68bff | ||
|
|
17287df293 | ||
|
|
a8d321c66d | ||
|
|
fad004aed5 | ||
|
|
fe9060073f | ||
|
|
393c60200f | ||
|
|
e61222928e | ||
|
|
b51caa9135 | ||
|
|
992bb76072 | ||
|
|
863315eaed | ||
|
|
52bf47e358 | ||
|
|
8f49dce8f0 | ||
|
|
4490a4119e | ||
|
|
2d0b78af52 | ||
|
|
7148b32c43 | ||
|
|
20b2ca04f0 | ||
|
|
25677ced97 | ||
|
|
4517c9562a | ||
|
|
2634017fb3 | ||
|
|
b69c7d5a05 | ||
|
|
098bee9bb4 | ||
|
|
2d369ad729 | ||
|
|
3bf0be98cb | ||
|
|
1046a1052e | ||
|
|
1cc6cc4ac7 | ||
|
|
dae3e74a60 | ||
|
|
fddceb5f36 | ||
|
|
2aed3b9305 | ||
|
|
101aa279d8 | ||
|
|
abbadfbab1 | ||
|
|
8ad76a5278 | ||
|
|
726a85e76c | ||
|
|
2d69967f51 | ||
|
|
4aeaa115dc | ||
|
|
2d251faff1 | ||
|
|
231936c91d | ||
|
|
37b8e17cba | ||
|
|
7d928e3df9 | ||
|
|
bb4435fab4 | ||
|
|
1e0580ba15 | ||
|
|
f5716c901d | ||
|
|
2c4c0ea4f0 | ||
|
|
63fee6f272 | ||
|
|
9ab1cec1bb | ||
|
|
7c2a50eec0 | ||
|
|
82810eb179 | ||
|
|
53917d32c0 | ||
|
|
f324fbe71d | ||
|
|
c6afd889ef | ||
|
|
116ba65bda | ||
|
|
02812a9128 | ||
|
|
fcc99b61e8 | ||
|
|
c9a3c72c10 | ||
|
|
abc9c59e29 | ||
|
|
9ed897aa85 | ||
|
|
5a84f2192f | ||
|
|
9ac9cd480b | ||
|
|
b635f91e9f | ||
|
|
99079f0b3d | ||
|
|
317c2171e4 | ||
|
|
cba7ae98fa | ||
|
|
e6dcb5cd3a | ||
|
|
94f1da349a | ||
|
|
06b5a9d7f1 | ||
|
|
48bebc0503 | ||
|
|
af1897f4ea | ||
|
|
8238211f33 | ||
|
|
907f51b13a | ||
|
|
3b036a7cb7 | ||
|
|
9a0cb35637 | ||
|
|
1c938e0007 | ||
|
|
f31ff79a39 | ||
|
|
d5ea5a4fa9 | ||
|
|
c7237e561c | ||
|
|
6717721725 | ||
|
|
5e5d5b904b | ||
|
|
a353022d36 | ||
|
|
ca4e458db1 | ||
|
|
7b8e954555 | ||
|
|
b4f46ded2b | ||
|
|
274a03fe73 | ||
|
|
0a07ebfe8b | ||
|
|
39c82361b6 | ||
|
|
89f4e051ca | ||
|
|
c04ae5eb39 | ||
|
|
ec692e1134 | ||
|
|
02a1f7ee83 | ||
|
|
97aa989e0b | ||
|
|
ac67c16378 | ||
|
|
2bdb8682e1 | ||
|
|
c070ed01f7 | ||
|
|
af4cfe7fba | ||
|
|
6a8e666fb8 | ||
|
|
c097a423f9 | ||
|
|
f0dcf473e8 | ||
|
|
bdff6a3c93 | ||
|
|
74829c966d | ||
|
|
77db8df123 | ||
|
|
a403a7d432 | ||
|
|
951d2d7f30 | ||
|
|
e8ddc53188 | ||
|
|
0708226890 | ||
|
|
b0447eec3a | ||
|
|
e37a8ec41d | ||
|
|
467b7a0cba | ||
|
|
9a583e75f3 | ||
|
|
f9ae51606f | ||
|
|
e768a4c1db | ||
|
|
a77390bf5c | ||
|
|
1e41801612 | ||
|
|
d870ee409a | ||
|
|
b2a448447c | ||
|
|
38a00e6177 | ||
|
|
767ad94565 | ||
|
|
7499682883 | ||
|
|
9192f32bbb | ||
|
|
d256fd3559 | ||
|
|
5844e74d32 | ||
|
|
989a567ecb | ||
|
|
d5d47ffae5 | ||
|
|
8001622be2 | ||
|
|
fc5a6a6f7f | ||
|
|
dc15439861 | ||
|
|
c9c0d2d171 | ||
|
|
44cf46fed3 | ||
|
|
63ebf1a7c5 | ||
|
|
bc10d774a7 | ||
|
|
90f656beab | ||
|
|
66c729b539 | ||
|
|
db4dfd3edc | ||
|
|
e7879aac65 | ||
|
|
723570b392 | ||
|
|
5dc562396c | ||
|
|
b266aad634 | ||
|
|
a25c75bf7a | ||
|
|
43fc159e27 | ||
|
|
2e37cb8158 | ||
|
|
529175c0ab | ||
|
|
071599074c | ||
|
|
d420c128eb | ||
|
|
b33fd7e2b3 | ||
|
|
815118d496 | ||
|
|
83031507b9 | ||
|
|
7565086291 | ||
|
|
7c71375b6c | ||
|
|
c919b1463c | ||
|
|
b72d831df9 | ||
|
|
2c494ac0d1 | ||
|
|
83b2295818 | ||
|
|
11a831299a | ||
|
|
bbe315fb45 | ||
|
|
9c03205c9f | ||
|
|
12a4e15c13 | ||
|
|
0843e457b0 | ||
|
|
b1bde2f105 | ||
|
|
d2ff0b1ea1 | ||
|
|
7ff13babaa | ||
|
|
0da7dc6796 | ||
|
|
f84f9ab696 | ||
|
|
8b5f7def93 | ||
|
|
8c33b899bf | ||
|
|
8767ad6d3f | ||
|
|
f797538935 | ||
|
|
cfb4310d6f | ||
|
|
d59cd74bf0 | ||
|
|
c378ce7d71 | ||
|
|
9cc6f519a9 | ||
|
|
18251dde89 | ||
|
|
04bf707836 | ||
|
|
5e38247ce8 | ||
|
|
979a1e6b14 | ||
|
|
9127d61a59 | ||
|
|
fed76499a0 | ||
|
|
6843feebfa | ||
|
|
e650ee66ff | ||
|
|
fa6f571f61 | ||
|
|
09b7ece510 | ||
|
|
b30caf051c | ||
|
|
861bf1eb07 | ||
|
|
a0f1417f42 | ||
|
|
2b5f57dfab | ||
|
|
22a5f15201 | ||
|
|
6baf1534c1 | ||
|
|
df3ce9eda7 | ||
|
|
7f71614781 | ||
|
|
8c5b703c47 | ||
|
|
394cda3efd | ||
|
|
7b9b5c2819 | ||
|
|
4625c087d5 | ||
|
|
f7c3c56b53 | ||
|
|
0aa9831a62 | ||
|
|
ea32948b84 | ||
|
|
0feaf55381 | ||
|
|
eaa04e395b | ||
|
|
0f8d53b09a | ||
|
|
031aa0f173 | ||
|
|
5f5b571899 | ||
|
|
b6f041f68c | ||
|
|
558a3228be | ||
|
|
2e4bedae31 | ||
|
|
e2905e8fdd | ||
|
|
ddee1fca8e | ||
|
|
d2b13e146e | ||
|
|
9b3704a141 | ||
|
|
9b5e2ec7f0 | ||
|
|
adf4e106d8 | ||
|
|
d01edbdfe2 | ||
|
|
f08d166c86 | ||
|
|
b8c61fdabd | ||
|
|
6b3b61acb5 | ||
|
|
1a6951b717 | ||
|
|
165df678b3 | ||
|
|
2abbee0a49 | ||
|
|
a6883fe607 | ||
|
|
6ee0abd150 | ||
|
|
68e927c6f4 | ||
|
|
1776f43425 | ||
|
|
fc8123c194 | ||
|
|
34448b8a23 | ||
|
|
7179ca41de | ||
|
|
3c7d940ba8 | ||
|
|
1225a41de4 | ||
|
|
d101cd1b6a | ||
|
|
4851487ecd | ||
|
|
eb0faad7ec | ||
|
|
524666f6e4 | ||
|
|
e9da67dcce | ||
|
|
aa8fc523df | ||
|
|
63570a923b | ||
|
|
638e82dd28 | ||
|
|
68dc960232 | ||
|
|
bbbe25e339 | ||
|
|
d8cca8b372 | ||
|
|
1e9df74034 | ||
|
|
8c8522c68e | ||
|
|
5afc5477a9 | ||
|
|
a6e48813cd | ||
|
|
a1a286dfb6 | ||
|
|
132c64f438 | ||
|
|
8e0bde3428 | ||
|
|
d9ac9eb2eb | ||
|
|
6ccdeba85e | ||
|
|
bbf0f39d69 | ||
|
|
109af44c6b | ||
|
|
bc9c012bb2 | ||
|
|
ba02c6ca7d | ||
|
|
b840a0adf1 | ||
|
|
5cb2f6ad91 | ||
|
|
36a7a80814 | ||
|
|
17299d00e1 | ||
|
|
a56ea2d456 | ||
|
|
3a705cce8e | ||
|
|
5550285531 | ||
|
|
0ba7644862 | ||
|
|
0e169bd116 | ||
|
|
4b9515b21a | ||
|
|
3f0e34b715 | ||
|
|
a393910c0a | ||
|
|
213f4b8408 | ||
|
|
8cb01d0ba8 | ||
|
|
d8c46b49d9 | ||
|
|
73e4ba9994 | ||
|
|
3aa5b21d49 | ||
|
|
f90807ebc6 | ||
|
|
a555009ac9 | ||
|
|
af21d1abba | ||
|
|
dcf77ba862 | ||
|
|
f281011a47 | ||
|
|
6bb8ca73d3 | ||
|
|
a070edc1c2 | ||
|
|
09485747a6 | ||
|
|
cbd73ae638 | ||
|
|
1aeec348eb | ||
|
|
ea8e783909 | ||
|
|
e06338dd2e | ||
|
|
d6fffc43e4 | ||
|
|
7633f84385 | ||
|
|
93fc20c825 | ||
|
|
ca32c11296 | ||
|
|
d2b8d2238a | ||
|
|
04ea9c39e1 | ||
|
|
905e965917 | ||
|
|
1ada23584d | ||
|
|
1456fd9076 | ||
|
|
941dd6015d | ||
|
|
b1f320f361 | ||
|
|
63e3718178 | ||
|
|
9bfa30f849 | ||
|
|
bb24b27963 | ||
|
|
403d93831f | ||
|
|
9a149eb673 | ||
|
|
470995c13d | ||
|
|
ddcd03f096 | ||
|
|
b8fe2aacf1 | ||
|
|
3c9f0d3c5c | ||
|
|
ded0ab5381 | ||
|
|
42d20f0fd9 | ||
|
|
0e8ace560b | ||
|
|
6e04a5d3da | ||
|
|
a3d8a8037f | ||
|
|
1dc42e1333 | ||
|
|
68cdcd8587 | ||
|
|
ebf0d585fc | ||
|
|
75365c428d | ||
|
|
3e30f5e18f | ||
|
|
e8d3b3decb | ||
|
|
5dcb364469 | ||
|
|
df9530e48f | ||
|
|
240a27a61a | ||
|
|
a6a8a5d583 | ||
|
|
a9046aded4 | ||
|
|
6f60cc6afb | ||
|
|
6e5470e20c | ||
|
|
dc04b4220f | ||
|
|
b1cfdef41c | ||
|
|
06e609613e | ||
|
|
8e66c24ff9 | ||
|
|
b4e2761b1f | ||
|
|
884d3e8c34 | ||
|
|
53739d24df | ||
|
|
f59a76d9a0 | ||
|
|
6cd36b19b2 | ||
|
|
b22ad88f37 | ||
|
|
f87ec18669 | ||
|
|
64686e165f | ||
|
|
055bad9ca9 | ||
|
|
c6e04bc4b9 | ||
|
|
b6782df565 | ||
|
|
2b4cb2cc88 | ||
|
|
14d12d90e3 | ||
|
|
4ed3832a5f | ||
|
|
b0714ab27e | ||
|
|
201ee840d5 | ||
|
|
79f737404e | ||
|
|
0b649e3f5b | ||
|
|
c756223363 | ||
|
|
ea60742d82 | ||
|
|
2ce90ba008 | ||
|
|
63211457e4 | ||
|
|
67f014d74a | ||
|
|
08fffade74 | ||
|
|
c8adb52660 | ||
|
|
4f74502951 | ||
|
|
4a5a4c19a5 | ||
|
|
e73d76eb57 | ||
|
|
b9a89d7c40 | ||
|
|
1a1bf814a0 | ||
|
|
f52e929d04 | ||
|
|
38d8d2e1ca | ||
|
|
ab4015d0e0 | ||
|
|
15027e51ee | ||
|
|
557d7ef1d9 | ||
|
|
4dea906e23 | ||
|
|
68e25cb0b3 | ||
|
|
4d033e59f1 | ||
|
|
a80c579d8a | ||
|
|
5cc48ed462 | ||
|
|
2abc8ff9d8 | ||
|
|
198bd6c322 | ||
|
|
7fb96f1eac | ||
|
|
2020f55826 | ||
|
|
c58f8d7831 | ||
|
|
32a6bbacd0 | ||
|
|
b08c77b6c0 | ||
|
|
a8836744f6 | ||
|
|
3a2202a2e8 | ||
|
|
896749d812 | ||
|
|
09ec1e8c06 | ||
|
|
07627c41e3 | ||
|
|
e4e278c2fa | ||
|
|
1b1b239ba0 | ||
|
|
c1d4d39265 | ||
|
|
dfd3885486 | ||
|
|
892f49c83a | ||
|
|
85d0671443 | ||
|
|
f22e7b9fcb | ||
|
|
d282ef1b24 | ||
|
|
9c2529ae3d | ||
|
|
108b7f5b0b | ||
|
|
b4c8be3e63 | ||
|
|
4064c56b21 | ||
|
|
1416762afe | ||
|
|
17f23fe920 | ||
|
|
c412c92b3e | ||
|
|
deed875c1b | ||
|
|
f600b628ce | ||
|
|
0c887a25e3 | ||
|
|
89dbd32351 | ||
|
|
98c5863973 |
4
.gitignore
vendored
4
.gitignore
vendored
@@ -1,6 +1,7 @@
|
|||||||
# OSX
|
# OSX
|
||||||
#
|
#
|
||||||
.DS_Store
|
.DS_Store
|
||||||
|
node_modules/
|
||||||
|
|
||||||
#Intellij idea
|
#Intellij idea
|
||||||
.idea/
|
.idea/
|
||||||
@@ -8,3 +9,6 @@
|
|||||||
.vscode/
|
.vscode/
|
||||||
/unpackage/
|
/unpackage/
|
||||||
.hbuilderx/launch.json
|
.hbuilderx/launch.json
|
||||||
|
.project.config.json
|
||||||
|
.project.private.config.json
|
||||||
|
|
||||||
|
|||||||
443
App.vue
443
App.vue
@@ -1,221 +1,254 @@
|
|||||||
|
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
/**
|
/**
|
||||||
* vuex管理登录状态,具体可以参考官方登录模板示例
|
* vuex管理登录状态,具体可以参考官方登录模板示例
|
||||||
*/
|
*/
|
||||||
import { mapMutations } from "vuex";
|
import config from "@/config/config";
|
||||||
|
import {
|
||||||
|
getClipboardData
|
||||||
|
} from "@/js_sdk/h5-copy/h5-copy.js";
|
||||||
import APPUpdate from "@/plugins/APPUpdate";
|
import APPUpdate from "@/plugins/APPUpdate";
|
||||||
import { getClipboardData } from "@/js_sdk/h5-copy/h5-copy.js";
|
import storage from "@/utils/storage";
|
||||||
import config from "@/config/config";
|
import {
|
||||||
// 悬浮球
|
mapMutations
|
||||||
|
} from "vuex";
|
||||||
|
|
||||||
export default {
|
|
||||||
data() {
|
|
||||||
return {
|
/**
|
||||||
config,
|
* 路由监听并删除路由
|
||||||
};
|
* https://developers.weixin.qq.com/miniprogram/dev/api/route/wx.navigateTo.html
|
||||||
},
|
* */
|
||||||
|
// #ifdef MP-WEIXIN
|
||||||
|
wx.onAppRoute((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
|
console.log("onBackPress-APP", e);
|
||||||
|
if (e.from == "backbutton") {
|
||||||
|
let routes = getCurrentPages();
|
||||||
|
let curRoute = routes[routes.length - 1].options;
|
||||||
|
routes.forEach((item) => {
|
||||||
|
if (
|
||||||
|
item.route == "pages/tabbar/cart/cartList" ||
|
||||||
|
item.route.indexOf("pages/product/goods") != -1
|
||||||
|
) {
|
||||||
|
uni.redirectTo({
|
||||||
|
url: item.route,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
// #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(val) {
|
||||||
|
if(val.query.inviter){
|
||||||
|
storage.setInviter(val.query.inviter)
|
||||||
|
}
|
||||||
|
|
||||||
onShow() {
|
|
||||||
// #ifndef H5
|
|
||||||
this.getClipboard();
|
|
||||||
// #endif
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
/**
|
|
||||||
* 微信小程序版本提交更新版本 解决缓存问题
|
|
||||||
*/
|
|
||||||
applyUpdateWeChat() {
|
|
||||||
const updateManager = uni.getUpdateManager();
|
|
||||||
|
|
||||||
updateManager.onCheckForUpdate(function (res) {
|
|
||||||
// 请求完新版本信息的回调
|
|
||||||
});
|
|
||||||
|
|
||||||
updateManager.onUpdateReady(function (res) {
|
|
||||||
uni.showModal({
|
|
||||||
title: "更新提示",
|
|
||||||
content: "发现新版本,是否重启应用?",
|
|
||||||
success(res) {
|
|
||||||
if (res.confirm) {
|
|
||||||
// 新的版本已经下载好,调用 applyUpdate 应用新版本并重启
|
|
||||||
updateManager.applyUpdate();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
});
|
|
||||||
});
|
|
||||||
updateManager.onUpdateFailed(function (res) {
|
|
||||||
// 新的版本下载失败
|
|
||||||
});
|
|
||||||
},
|
|
||||||
|
|
||||||
// TODO 开屏广告 后续优化添加
|
|
||||||
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) {
|
|
||||||
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
|
// #ifdef APP-PLUS
|
||||||
setTimeout(() => {
|
// 重点是以下: 一定要监听后台恢复 !一定要
|
||||||
const args = plus.runtime.arguments;
|
plus.globalEvent.addEventListener("newintent", (e) => {
|
||||||
if (args) {
|
this.checkArguments(); // 检测启动参数
|
||||||
const argsStr = decodeURIComponent(args);
|
});
|
||||||
const path = argsStr.split("//")[1];
|
// #endif
|
||||||
if (path.indexOf("tabbar") != -1) {
|
|
||||||
uni.switchTab({
|
// #ifdef MP-WEIXIN
|
||||||
url: `/${path}`,
|
this.applyUpdateWeChat();
|
||||||
});
|
// #endif
|
||||||
} else {
|
},
|
||||||
uni.navigateTo({
|
|
||||||
url: `/${path}`,
|
onShow() {
|
||||||
});
|
// #ifndef H5
|
||||||
}
|
if(this.config.enableGetClipboard){
|
||||||
}
|
this.getClipboard();
|
||||||
});
|
}
|
||||||
// #endif
|
// #endif
|
||||||
},
|
// #ifdef APP-PLUS
|
||||||
},
|
|
||||||
};
|
if (storage.getShow()) {
|
||||||
|
if (uni.getSystemInfoSync().platform == 'ios') {
|
||||||
|
this.$u.route("/pages/tabbar/screen/fullScreen");
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// #endif
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
/**
|
||||||
|
* 微信小程序版本提交更新版本 解决缓存问题
|
||||||
|
*/
|
||||||
|
applyUpdateWeChat() {
|
||||||
|
const updateManager = uni.getUpdateManager();
|
||||||
|
|
||||||
|
updateManager.onCheckForUpdate(function(res) {
|
||||||
|
// 请求完新版本信息的回调
|
||||||
|
});
|
||||||
|
|
||||||
|
updateManager.onUpdateReady(function(res) {
|
||||||
|
uni.showModal({
|
||||||
|
title: "更新提示",
|
||||||
|
content: "发现新版本,是否重启应用?",
|
||||||
|
success(res) {
|
||||||
|
if (res.confirm) {
|
||||||
|
// 新的版本已经下载好,调用 applyUpdate 应用新版本并重启
|
||||||
|
updateManager.applyUpdate();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
});
|
||||||
|
});
|
||||||
|
updateManager.onUpdateFailed(function(res) {
|
||||||
|
// 新的版本下载失败
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
// TODO 开屏广告 后续优化添加
|
||||||
|
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>
|
||||||
|
|||||||
@@ -1 +0,0 @@
|
|||||||
qSyvBPhDsPdxvOhC
|
|
||||||
376
README.md
376
README.md
@@ -1,218 +1,226 @@
|
|||||||
## 🔥 Lilishop B2B2C商城系统
|
## Lilishop B2B2C 商城系统
|
||||||
|
|
||||||
##### 🌹 开源不易,如有帮助请点Star
|
### 近期常出现的问题解决方法
|
||||||
|
|
||||||
|
1. 高版本hbulider启动会报错建议先固定使用 4.45
|
||||||
|
2. 编译到微信小程序会报错 xxx defined 这里注意微信小程序基础调试库要使用 3.5.3
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#### 欢迎交流需求,交流业务,交流技术(基础问题自行解决,进群先看文档后提问)
|
### 商城介绍
|
||||||
|
|
||||||
##### 交流 qq 1群 961316482(已满)
|
|
||||||
|
|
||||||
##### 交流 qq 2群 875294241
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
##### 商城 公众号/小程序体验,扫描二维码
|
|
||||||
|
|
||||||

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

|
|
||||||
|
|
||||||
|
|
||||||
### 🔥 商城介绍
|
|
||||||
**官网**:https://pickmall.cn
|
**官网**:https://pickmall.cn
|
||||||
|
|
||||||
Lilishop 商城系统 基于SpringBoot 研发,B2B2C多用户商城系统,前端使用 Vue、uniapp开发 **系统全端全部代码开源**
|
**更多 README**:https://gitee.com/beijing_hongye_huicheng/lilishop/blob/master/README.md
|
||||||
|
|
||||||
业务兼容O2O商城/B2B商城/B2B2C商城/F2B2C商城/S2B2C商城。支持小程序商城、H5商城、APP商城、 PC商城。
|
**演示站点**:https://m-b2b2c.pickmall.cn/ 账号:13011111111 验证码:111111
|
||||||
|
|
||||||
|
**商城 小程序/公众号/APP**:扫描二维码
|
||||||
|
|
||||||
商城前后端分离、支持分布式部署。
|

|
||||||
|
|
||||||
商城包含 会员模块、**第三方登录模块**、**第三方支付模块**、**楼层装修模块**、订单模块、分销模块、文章模块、系统设置模块、流量分析模块
|
## lilishop-uniapp如何在本地h5和微信小程序中运行
|
||||||
|
https://www.bilibili.com/video/BV17K8EemEh2/
|
||||||
|
|
||||||
商城包含各种中间件、搜索引擎、多级缓存、分布式事务、分布式任务调度等,支持Docker,支持k8s。是一款高性能,支持高并发的商城系统。
|
## lilishop-uniapp如何打包h5到服务器
|
||||||
|
https://www.bilibili.com/video/BV1CX87exE64/
|
||||||
|
|
||||||
##### 商城 API/消费者 聚合版
|
### 快速开始
|
||||||
api不需要单独部署,只需启动一个jar包就可以正常运转 如有需要,可以点击跳转https://gitee.com/beijing_hongye_huicheng/lilishop-simplify
|
|
||||||
|
|
||||||
### ☃️ 商城 开发/使用/常见问题 帮助文档
|
#### 阅读文档
|
||||||
|
|
||||||
https://docs.pickmall.cn
|
`uni-app` https://uniapp.dcloud.net.cn/api/
|
||||||
|
|
||||||
### 💧 开源商城项目地址(gitee)
|
`vue2` https://v2.cn.vuejs.org/
|
||||||
|
|
||||||
**API(商城所有API)**:https://gitee.com/beijing_hongye_huicheng/lilishop.git
|
`uView v1` https://v1.uviewui.com/
|
||||||
|
|
||||||
**UI(商城管理端/商家端/买家PC端)**: https://gitee.com/beijing_hongye_huicheng/lilishop-ui.git
|
#### 环境
|
||||||
|
|
||||||
**uniapp(商城移动端,支持小程序/APP/H5)**:https://gitee.com/beijing_hongye_huicheng/lilishop-uniapp.git
|
在开发之前保证本地安装了以下软件
|
||||||
|
`hbulider` https://www.dcloud.io/hbuilderx.html
|
||||||
|
|
||||||
**docker一键部署(商城部署脚本)**:https://gitee.com/beijing_hongye_huicheng/docker.git
|
### 技术栈
|
||||||
|
|
||||||
### 💧 开源商城项目地址(github)
|
本项目技术栈为 `uni-app` + `scss` + `ES2015` + `uView` 提前学习和了解这些知识将帮助你更好地上手我们的项目。
|
||||||
|
|
||||||
**API(商城所有API)**:https://github.com/hongyehuicheng/lilishop.git
|
### 安装
|
||||||
|
|
||||||
**UI(商城管理端/商家端/买家PC端)**: https://github.com/hongyehuicheng/lilishop-ui.git
|
1. 克隆项目到本地
|
||||||
|
|
||||||
**uniapp(商城移动端,支持小程序/APP/H5)**:https://github.com/hongyehuicheng/lilishop-uniapp.git
|
```shell
|
||||||
|
git clone https://gitee.com/beijing_hongye_huicheng/lilishop-uniapp.git
|
||||||
**docker一键部署(商城部署脚本)**:https://github.com/hongyehuicheng/docker.git
|
|
||||||
|
|
||||||
|
|
||||||
☃️ UI 项目下3个文件夹 buyer:买家PC端,seller:商家端,manager:后台管理端
|
|
||||||
|
|
||||||
|
|
||||||
### 💧 演示地址(手机验证码为 ‘111111’)
|
|
||||||
|
|
||||||
**商城管理端**:https://admin-b2b2c.pickmall.cn 账号:admin/123456
|
|
||||||
|
|
||||||
**商城店铺后台**:https://store-b2b2c.pickmall.cn 账号:13011111111/111111
|
|
||||||
|
|
||||||
**商城PC页面**:https://pc-b2b2c.pickmall.cn
|
|
||||||
|
|
||||||
**商城移动端(请使浏览器手机模式,或者用手机浏览器打开)**:https://m-b2b2c.pickmall.cn
|
|
||||||
|
|
||||||
**小程序/公众号**:扫描二维码
|
|
||||||
|
|
||||||

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

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

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

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

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

|
||||||
|
|
||||||
|
#### 微信小程序上传文件过大超出 2MB
|
||||||
|
|
||||||
|
1.关闭微信小程序,停止微信小程序运行
|
||||||
|
|
||||||
|
2.重新点击运行小程序模拟器,在最下方有一个 `运行时是否压缩代码` 勾选并重新运行
|
||||||
|
|
||||||
|
3.如果还是提示超出2MB,重新执行1步骤,然后点击`发行`->`小程序`即可
|
||||||
|
|
||||||
|
4.以上1-3步骤都不行,可以尝试删除一些自己开发的代码或本地的静态资源图片
|
||||||
|
|
||||||
|
#### 微信小程序在开发者工具中可以使用接口在测试版却不行
|
||||||
|
1.首先保证是否填写`request`合法域名 在微信小程序后台配置
|
||||||
|
|
||||||
|
2.需保证接口为https请求
|
||||||
|
|
||||||
|
request合法域名基础配置如下
|
||||||
|
```
|
||||||
|
https://buyer-api.pickmall.cn
|
||||||
|
https://common-api.pickmall.cn
|
||||||
|
https://im-api.pickmall.cn
|
||||||
|
https://restapi.amap.com
|
||||||
|
```
|
||||||
|
|
||||||
|
socket合法域名
|
||||||
|
```
|
||||||
|
wss://im-api.pickmall.cn
|
||||||
|
```
|
||||||
|
uploadFile合法域名
|
||||||
|
```
|
||||||
|
https://common-api.pickmall.cn
|
||||||
|
```
|
||||||
|
downloadFile合法域名
|
||||||
|
```
|
||||||
|
https://buyer-api.pickmall.cn
|
||||||
|
https://common-api.pickmall.cn
|
||||||
|
https://im-api.pickmall.cn
|
||||||
|
https://lilishop-oss.oss-cn-beijing.aliyuncs.com
|
||||||
|
```
|
||||||
|
|
||||||
|
#### 如何配置API
|
||||||
|
在根目录 `config` -> `api` 中配置开发环境以及生产环境 api 接口地址
|
||||||
|
|
||||||
|
#### 运行报错
|
||||||
|
初次运行时候可能因为本地环境缺少编译插件,这个时候一定要注意看报错信息,根据报错信息安装相应的插件即可
|
||||||
|
|
||||||
|
#### 如何配置微信小程序appid
|
||||||
|
在根目录 `manifest.json` 中配置微信小程序appid
|
||||||
|
|
||||||
|
|
||||||
|
#### 微信登录报错
|
||||||
|
需检查appId是否配置正确,在后台管理中信任登录的`appId`以及`appSecret`是否配置正确
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
17
androidPrivacy.json
Normal file
17
androidPrivacy.json
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
{
|
||||||
|
"version" : "1",
|
||||||
|
"prompt" : "template",
|
||||||
|
"title" : "服务协议和隐私政策",
|
||||||
|
"message" : " 请你务必审慎阅读、充分理解“服务协议”和“隐私政策”各条款,包括但不限于:为了更好的向你提供服务,我们需要收集你的设备标识、操作日志等信息用于分析、优化应用性能。<br/> 你可阅读<a href=\"https://pc-b2b2c.pickmall.cn/article/detail?id=1371992704333905920\">《服务协议》</a>和<a href=\"https://pc-b2b2c.pickmall.cn/article/detail?id=1371779927900160000\">《隐私政策》</a>了解详细信息。如果你同意,请点击下面按钮开始接受我们的服务。",
|
||||||
|
"buttonAccept" : "同意并接受",
|
||||||
|
"buttonRefuse" : "暂不同意",
|
||||||
|
"second" : {
|
||||||
|
"title" : "确认提示",
|
||||||
|
"message" : " 进入应用前,你需先同意<a href=\"https://pc-b2b2c.pickmall.cn/article/detail?id=1371992704333905920\">《服务协议》</a>和<a href=\"https://pc-b2b2c.pickmall.cn/article/detail?id=1371779927900160000\">《隐私政策》</a>,否则将退出应用。",
|
||||||
|
"buttonAccept" : "同意并继续",
|
||||||
|
"buttonRefuse" : "退出应用"
|
||||||
|
},
|
||||||
|
"styles" : {
|
||||||
|
"borderRadius" : "5px"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -12,7 +12,7 @@ import api from "@/config/api.js";
|
|||||||
*/
|
*/
|
||||||
export function getAddressList(pageNumber, pageSize) {
|
export function getAddressList(pageNumber, pageSize) {
|
||||||
return http.request({
|
return http.request({
|
||||||
url: "/memberAddress",
|
url: "/member/address",
|
||||||
method: Method.GET,
|
method: Method.GET,
|
||||||
needToken: true,
|
needToken: true,
|
||||||
params: { pageNumber, pageSize },
|
params: { pageNumber, pageSize },
|
||||||
@@ -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" },
|
||||||
@@ -37,7 +37,7 @@ export function getLogistics() {
|
|||||||
*/
|
*/
|
||||||
export function getAddressCode(cityCode, townName) {
|
export function getAddressCode(cityCode, townName) {
|
||||||
return http.request({
|
return http.request({
|
||||||
url: api.common + "/region/region",
|
url: api.common + "/common/region/region",
|
||||||
method: Method.GET,
|
method: Method.GET,
|
||||||
needToken: true,
|
needToken: true,
|
||||||
params: { cityCode, townName },
|
params: { cityCode, townName },
|
||||||
@@ -51,7 +51,7 @@ export function getAddressCode(cityCode, townName) {
|
|||||||
*/
|
*/
|
||||||
export function addAddress(data) {
|
export function addAddress(data) {
|
||||||
return http.request({
|
return http.request({
|
||||||
url: "/memberAddress",
|
url: "/member/address",
|
||||||
method: Method.POST,
|
method: Method.POST,
|
||||||
needToken: true,
|
needToken: true,
|
||||||
header: { "content-type": "application/x-www-form-urlencoded" },
|
header: { "content-type": "application/x-www-form-urlencoded" },
|
||||||
@@ -67,7 +67,7 @@ export function addAddress(data) {
|
|||||||
*/
|
*/
|
||||||
export function editAddress(params) {
|
export function editAddress(params) {
|
||||||
return http.request({
|
return http.request({
|
||||||
url: `/memberAddress`,
|
url: `/member/address`,
|
||||||
method: Method.PUT,
|
method: Method.PUT,
|
||||||
needToken: true,
|
needToken: true,
|
||||||
header: { "content-type": "application/x-www-form-urlencoded" },
|
header: { "content-type": "application/x-www-form-urlencoded" },
|
||||||
@@ -81,7 +81,7 @@ export function editAddress(params) {
|
|||||||
*/
|
*/
|
||||||
export function deleteAddress(id) {
|
export function deleteAddress(id) {
|
||||||
return http.request({
|
return http.request({
|
||||||
url: `/memberAddress/delById/${id}`,
|
url: `/member/address/delById/${id}`,
|
||||||
method: Method.DELETE,
|
method: Method.DELETE,
|
||||||
needToken: true,
|
needToken: true,
|
||||||
});
|
});
|
||||||
@@ -95,7 +95,7 @@ export function deleteAddress(id) {
|
|||||||
*/
|
*/
|
||||||
export function getAddressDetail(id) {
|
export function getAddressDetail(id) {
|
||||||
return http.request({
|
return http.request({
|
||||||
url: `/memberAddress/get/${id}`,
|
url: `/member/address/get/${id}`,
|
||||||
method: Method.GET,
|
method: Method.GET,
|
||||||
loading: false,
|
loading: false,
|
||||||
needToken: true,
|
needToken: true,
|
||||||
@@ -107,7 +107,7 @@ export function getAddressDetail(id) {
|
|||||||
*/
|
*/
|
||||||
export function getAddressDefault() {
|
export function getAddressDefault() {
|
||||||
return http.request({
|
return http.request({
|
||||||
url: `/memberAddress/get/default`,
|
url: `/member/address/get/default`,
|
||||||
method: Method.GET,
|
method: Method.GET,
|
||||||
loading: false,
|
loading: false,
|
||||||
needToken: true,
|
needToken: true,
|
||||||
|
|||||||
@@ -34,16 +34,29 @@ export function applyCancelOrder(params) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
/**
|
/**
|
||||||
* 获取商家售后收件地址
|
* 获取商家售后收件地址
|
||||||
*/
|
*/
|
||||||
export function getstoreAfterSaleAddress(sn) {
|
export function getStoreAfterSaleAddress(sn) {
|
||||||
return http.request({
|
return http.request({
|
||||||
url: `/afterSale/getStoreAfterSaleAddress/${sn}`,
|
url: `/order/afterSale/getStoreAfterSaleAddress/${sn}`,
|
||||||
method: Method.GET,
|
method: Method.GET,
|
||||||
needToken: true,
|
needToken: true,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* 取消售后
|
||||||
|
*/
|
||||||
|
export function cancelAfterSale(afterSaleSn) {
|
||||||
|
return http.request({
|
||||||
|
url: `/order/afterSale/cancel/${afterSaleSn}`,
|
||||||
|
method: Method.POST,
|
||||||
|
needToken: true,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取售后服务记录相关数据
|
* 获取售后服务记录相关数据
|
||||||
@@ -51,7 +64,7 @@ export function getstoreAfterSaleAddress(sn) {
|
|||||||
*/
|
*/
|
||||||
export function getAfterSaleList(params) {
|
export function getAfterSaleList(params) {
|
||||||
return http.request({
|
return http.request({
|
||||||
url: `/afterSale/page`,
|
url: `/order/afterSale/page`,
|
||||||
method: Method.GET,
|
method: Method.GET,
|
||||||
needToken: true,
|
needToken: true,
|
||||||
params,
|
params,
|
||||||
@@ -64,7 +77,7 @@ export function getAfterSaleList(params) {
|
|||||||
*/
|
*/
|
||||||
export function getServiceDetail(sn) {
|
export function getServiceDetail(sn) {
|
||||||
return http.request({
|
return http.request({
|
||||||
url: `/afterSale/get/${sn}`,
|
url: `/order/afterSale/get/${sn}`,
|
||||||
method: Method.GET,
|
method: Method.GET,
|
||||||
needToken: true,
|
needToken: true,
|
||||||
});
|
});
|
||||||
@@ -76,7 +89,7 @@ export function getServiceDetail(sn) {
|
|||||||
*/
|
*/
|
||||||
export function addComplain(params) {
|
export function addComplain(params) {
|
||||||
return http.request({
|
return http.request({
|
||||||
url: `/complain`,
|
url: `/order/complain`,
|
||||||
method: Method.POST,
|
method: Method.POST,
|
||||||
needToken: true,
|
needToken: true,
|
||||||
header: {
|
header: {
|
||||||
@@ -91,7 +104,7 @@ export function addComplain(params) {
|
|||||||
*/
|
*/
|
||||||
export function clearComplain(id, params) {
|
export function clearComplain(id, params) {
|
||||||
return http.request({
|
return http.request({
|
||||||
url: `/complain/status/${id}`,
|
url: `/order/complain/status/${id}`,
|
||||||
method: Method.PUT,
|
method: Method.PUT,
|
||||||
needToken: true,
|
needToken: true,
|
||||||
params,
|
params,
|
||||||
@@ -103,7 +116,7 @@ export function clearComplain(id, params) {
|
|||||||
*/
|
*/
|
||||||
export function getAfterSaleLog(sn) {
|
export function getAfterSaleLog(sn) {
|
||||||
return http.request({
|
return http.request({
|
||||||
url: `/afterSale/get/getAfterSaleLog/${sn}`,
|
url: `/order/afterSale/get/getAfterSaleLog/${sn}`,
|
||||||
method: Method.GET,
|
method: Method.GET,
|
||||||
needToken: true,
|
needToken: true,
|
||||||
});
|
});
|
||||||
@@ -114,7 +127,7 @@ export function getAfterSaleLog(sn) {
|
|||||||
*/
|
*/
|
||||||
export function getComplain(params) {
|
export function getComplain(params) {
|
||||||
return http.request({
|
return http.request({
|
||||||
url: `/complain`,
|
url: `/order/complain`,
|
||||||
method: Method.GET,
|
method: Method.GET,
|
||||||
needToken: true,
|
needToken: true,
|
||||||
params,
|
params,
|
||||||
@@ -126,7 +139,7 @@ export function getComplain(params) {
|
|||||||
*/
|
*/
|
||||||
export function getAfterSaleReason(serviceType) {
|
export function getAfterSaleReason(serviceType) {
|
||||||
return http.request({
|
return http.request({
|
||||||
url: `/afterSale/get/afterSaleReason/${serviceType}`,
|
url: `/order/afterSale/get/afterSaleReason/${serviceType}`,
|
||||||
method: Method.GET,
|
method: Method.GET,
|
||||||
needToken: true,
|
needToken: true,
|
||||||
});
|
});
|
||||||
@@ -137,7 +150,7 @@ export function getAfterSaleReason(serviceType) {
|
|||||||
*/
|
*/
|
||||||
export function getClearReason() {
|
export function getClearReason() {
|
||||||
return http.request({
|
return http.request({
|
||||||
url: `/afterSale/get/afterSaleReason/CANCEL`,
|
url: `/order/afterSale/get/afterSaleReason/CANCEL`,
|
||||||
method: Method.GET,
|
method: Method.GET,
|
||||||
needToken: true,
|
needToken: true,
|
||||||
});
|
});
|
||||||
@@ -148,7 +161,7 @@ export function getClearReason() {
|
|||||||
*/
|
*/
|
||||||
export function getComplainReason() {
|
export function getComplainReason() {
|
||||||
return http.request({
|
return http.request({
|
||||||
url: `/afterSale/get/afterSaleReason/COMPLAIN`,
|
url: `/order/afterSale/get/afterSaleReason/COMPLAIN`,
|
||||||
method: Method.GET,
|
method: Method.GET,
|
||||||
needToken: true,
|
needToken: true,
|
||||||
});
|
});
|
||||||
@@ -158,7 +171,7 @@ export function getComplainReason() {
|
|||||||
*/
|
*/
|
||||||
export function getComplainDetail(id) {
|
export function getComplainDetail(id) {
|
||||||
return http.request({
|
return http.request({
|
||||||
url: `/complain/${id}`,
|
url: `/order/complain/${id}`,
|
||||||
method: Method.GET,
|
method: Method.GET,
|
||||||
needToken: true,
|
needToken: true,
|
||||||
});
|
});
|
||||||
@@ -169,7 +182,7 @@ export function getComplainDetail(id) {
|
|||||||
*/
|
*/
|
||||||
export function getAfterSaleInfo(sn) {
|
export function getAfterSaleInfo(sn) {
|
||||||
return http.request({
|
return http.request({
|
||||||
url: `/afterSale/applyAfterSaleInfo/${sn}`,
|
url: `/order/afterSale/applyAfterSaleInfo/${sn}`,
|
||||||
method: Method.GET,
|
method: Method.GET,
|
||||||
needToken: true,
|
needToken: true,
|
||||||
});
|
});
|
||||||
@@ -181,7 +194,7 @@ export function getAfterSaleInfo(sn) {
|
|||||||
*/
|
*/
|
||||||
export function applyReturn(orderItemSn, params) {
|
export function applyReturn(orderItemSn, params) {
|
||||||
return http.request({
|
return http.request({
|
||||||
url: `/afterSale/save/${orderItemSn}`,
|
url: `/order/afterSale/save/${orderItemSn}`,
|
||||||
method: Method.POST,
|
method: Method.POST,
|
||||||
header: {
|
header: {
|
||||||
"Content-Type": "application/x-www-form-urlencoded",
|
"Content-Type": "application/x-www-form-urlencoded",
|
||||||
@@ -197,7 +210,7 @@ export function applyReturn(orderItemSn, params) {
|
|||||||
*/
|
*/
|
||||||
export function fillShipInfo(afterSaleSn, params) {
|
export function fillShipInfo(afterSaleSn, params) {
|
||||||
return http.request({
|
return http.request({
|
||||||
url: `/afterSale/delivery/${afterSaleSn}`,
|
url: `/order/afterSale/delivery/${afterSaleSn}`,
|
||||||
method: Method.POST,
|
method: Method.POST,
|
||||||
header: {
|
header: {
|
||||||
"Content-Type": "application/x-www-form-urlencoded",
|
"Content-Type": "application/x-www-form-urlencoded",
|
||||||
@@ -205,3 +218,13 @@ export function fillShipInfo(afterSaleSn, params) {
|
|||||||
data: params,
|
data: params,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 添加交易投诉对话
|
||||||
|
export function communication(params) {
|
||||||
|
return http.request({
|
||||||
|
url: `/order/complain/communication`,
|
||||||
|
method: Method.POST,
|
||||||
|
needToken: true,
|
||||||
|
params
|
||||||
|
});
|
||||||
|
}
|
||||||
@@ -23,8 +23,21 @@ export function getArticleCategory(category_type) {
|
|||||||
*/
|
*/
|
||||||
export function getArticleDetail(type) {
|
export function getArticleDetail(type) {
|
||||||
return http.request({
|
return http.request({
|
||||||
url: `/article/type/${type}`,
|
url: `/other/article/get/${type}`,
|
||||||
method: Method.GET,
|
method: Method.GET,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取文章详情
|
||||||
|
* @param type
|
||||||
|
*/
|
||||||
|
export function getArticleDetailByType(type) {
|
||||||
|
return http.request({
|
||||||
|
url: `/other/article/type/${type}`,
|
||||||
|
method: Method.GET,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,26 +1,32 @@
|
|||||||
/**
|
/**
|
||||||
* 公共API
|
* 公共API
|
||||||
*/
|
*/
|
||||||
import {http, Method} from '@/utils/request.js';
|
import { http, Method } from "@/utils/request.js";
|
||||||
import api from '@/config/api.js';
|
import api from "@/config/api.js";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取地区数据
|
||||||
/**
|
* @param id
|
||||||
* 获取地区数据
|
*/
|
||||||
* @param id
|
export function getRegionsById(id = 0) {
|
||||||
*/
|
return http.request({
|
||||||
export function getRegionsById(id = 0) {
|
url: `${api.common}/common/region/item/${id}`,
|
||||||
return http.request({
|
method: Method.GET,
|
||||||
url: `${api.common}/region/item/${id}`,
|
message: false,
|
||||||
method: Method.GET,
|
});
|
||||||
message: false,
|
}
|
||||||
});
|
|
||||||
}
|
// 获取IM接口前缀
|
||||||
|
export function getIMDetail() {
|
||||||
/**
|
return http.request({
|
||||||
* 文件上传地址
|
url: `${api.common}/IM`,
|
||||||
* @type {string}
|
method: Method.GET,
|
||||||
*/
|
message: false,
|
||||||
export const upload =api.common+'/upload/file';
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文件上传地址
|
||||||
|
* @type {string}
|
||||||
|
*/
|
||||||
|
export const upload = api.common + "/common/upload/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,8 +25,8 @@ 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.POST,
|
||||||
needToken: true,
|
needToken: true,
|
||||||
data: params,
|
data: params,
|
||||||
header: {
|
header: {
|
||||||
@@ -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
|
||||||
});
|
});
|
||||||
|
|||||||
41
api/entry.js
Normal file
41
api/entry.js
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
/**
|
||||||
|
* 入驻类相关api
|
||||||
|
*/
|
||||||
|
|
||||||
|
import { http, Method } from "@/utils/request.js";
|
||||||
|
|
||||||
|
// 获取当前用户的代理入驻详情
|
||||||
|
export function getCompanyDetail(params) {
|
||||||
|
return http.request({
|
||||||
|
url: "/store/store/apply",
|
||||||
|
method: Method.GET,
|
||||||
|
params,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 申请店铺第一步-填写企业信息
|
||||||
|
export function applyFirst(params) {
|
||||||
|
return http.request({
|
||||||
|
url: "/store/store/apply/first",
|
||||||
|
method: Method.PUT,
|
||||||
|
params,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 申请店铺第二步-填写银行
|
||||||
|
export function applySecond(params) {
|
||||||
|
return http.request({
|
||||||
|
url: "/store/store/apply/second",
|
||||||
|
method: Method.PUT,
|
||||||
|
params,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 申请店铺第三步-填写银行
|
||||||
|
export function applyThird(params) {
|
||||||
|
return http.request({
|
||||||
|
url: "/store/store/apply/third",
|
||||||
|
method: Method.PUT,
|
||||||
|
params,
|
||||||
|
});
|
||||||
|
}
|
||||||
26
api/goods.js
26
api/goods.js
@@ -9,7 +9,7 @@ import { http, Method } from "@/utils/request.js";
|
|||||||
*/
|
*/
|
||||||
export function getGoodsMessage(goodsId) {
|
export function getGoodsMessage(goodsId) {
|
||||||
return http.request({
|
return http.request({
|
||||||
url: `/goods/get/${goodsId}`,
|
url: `/goods/goods/get/${goodsId}`,
|
||||||
method: Method.GET,
|
method: Method.GET,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -19,7 +19,7 @@ import { http, Method } from "@/utils/request.js";
|
|||||||
*/
|
*/
|
||||||
export function getGoodsRelated(params) {
|
export function getGoodsRelated(params) {
|
||||||
return http.request({
|
return http.request({
|
||||||
url: `/goods/es/related`,
|
url: `/goods/goods/es/related`,
|
||||||
method: Method.GET,
|
method: Method.GET,
|
||||||
params,
|
params,
|
||||||
});
|
});
|
||||||
@@ -32,7 +32,7 @@ export function getGoodsRelated(params) {
|
|||||||
*/
|
*/
|
||||||
export function getGoods(skuId, goodsId) {
|
export function getGoods(skuId, goodsId) {
|
||||||
return http.request({
|
return http.request({
|
||||||
url: `/goods/sku/${goodsId}/${skuId}`,
|
url: `/goods/goods/sku/${goodsId}/${skuId}`,
|
||||||
method: Method.GET,
|
method: Method.GET,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -43,7 +43,7 @@ export function getGoodsRelated(params) {
|
|||||||
*/
|
*/
|
||||||
export function getGoodsDistribution(distributionId) {
|
export function getGoodsDistribution(distributionId) {
|
||||||
return http.request({
|
return http.request({
|
||||||
url: `/distribution/bindingDistribution/${distributionId}`,
|
url: `/distribution/distribution/bindingDistribution/${distributionId}`,
|
||||||
method: Method.GET,
|
method: Method.GET,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -56,7 +56,7 @@ export function getGoodsRelated(params) {
|
|||||||
*/
|
*/
|
||||||
export function getGoodsList(params) {
|
export function getGoodsList(params) {
|
||||||
return http.request({
|
return http.request({
|
||||||
url: "/goods/es",
|
url: "/goods/goods/es",
|
||||||
method: Method.GET,
|
method: Method.GET,
|
||||||
params,
|
params,
|
||||||
});
|
});
|
||||||
@@ -112,7 +112,7 @@ export function getPlateformTagGoods(tag_id) {
|
|||||||
*/
|
*/
|
||||||
export function getCategoryList(id) {
|
export function getCategoryList(id) {
|
||||||
return http.request({
|
return http.request({
|
||||||
url: `/category/get/${id}`,
|
url: `/goods/category/get/${id}`,
|
||||||
method: Method.GET,
|
method: Method.GET,
|
||||||
loading: false,
|
loading: false,
|
||||||
});
|
});
|
||||||
@@ -126,7 +126,7 @@ export function getCategoryList(id) {
|
|||||||
*/
|
*/
|
||||||
export function distribution() {
|
export function distribution() {
|
||||||
return http.request({
|
return http.request({
|
||||||
url: `/distribution`,
|
url: `/distribution/distribution`,
|
||||||
method: Method.GET,
|
method: Method.GET,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -136,7 +136,7 @@ export function distribution() {
|
|||||||
*/
|
*/
|
||||||
export function applyDistribution(params) {
|
export function applyDistribution(params) {
|
||||||
return http.request({
|
return http.request({
|
||||||
url: `/distribution`,
|
url: `/distribution/distribution`,
|
||||||
method: Method.POST,
|
method: Method.POST,
|
||||||
params,
|
params,
|
||||||
});
|
});
|
||||||
@@ -170,7 +170,7 @@ export function cashLog(params) {
|
|||||||
*/
|
*/
|
||||||
export function distributionOrderList(params) {
|
export function distributionOrderList(params) {
|
||||||
return http.request({
|
return http.request({
|
||||||
url: `/distribution/distributionOrder`,
|
url: `/distribution/distribution/distributionOrder`,
|
||||||
method: Method.GET,
|
method: Method.GET,
|
||||||
params
|
params
|
||||||
});
|
});
|
||||||
@@ -181,7 +181,7 @@ export function distributionOrderList(params) {
|
|||||||
*/
|
*/
|
||||||
export function distributionGoods(params) {
|
export function distributionGoods(params) {
|
||||||
return http.request({
|
return http.request({
|
||||||
url: `/distributionGoods`,
|
url: `/distribution/goods`,
|
||||||
method: Method.GET,
|
method: Method.GET,
|
||||||
params,
|
params,
|
||||||
});
|
});
|
||||||
@@ -191,7 +191,7 @@ export function distributionGoods(params) {
|
|||||||
*/
|
*/
|
||||||
export function checkedDistributionGoods(params) {
|
export function checkedDistributionGoods(params) {
|
||||||
return http.request({
|
return http.request({
|
||||||
url: `/distributionGoods/checked/${params.id}`,
|
url: `/distribution/goods/checked/${params.id}`,
|
||||||
method: Method.GET,
|
method: Method.GET,
|
||||||
params
|
params
|
||||||
});
|
});
|
||||||
@@ -202,7 +202,7 @@ export function checkedDistributionGoods(params) {
|
|||||||
*/
|
*/
|
||||||
export function getMpCode(params){
|
export function getMpCode(params){
|
||||||
return http.request({
|
return http.request({
|
||||||
url:`/mini-program/mp/unlimited`,
|
url:`/passport/connect/miniProgram/mp/unlimited`,
|
||||||
method:Method.GET,
|
method:Method.GET,
|
||||||
params
|
params
|
||||||
})
|
})
|
||||||
@@ -213,7 +213,7 @@ export function checkedDistributionGoods(params) {
|
|||||||
*/
|
*/
|
||||||
export function getMpScene(id){
|
export function getMpScene(id){
|
||||||
return http.request({
|
return http.request({
|
||||||
url:`/mini-program/mp/unlimited/scene?id=${id}`,
|
url:`/passport/connect/miniProgram/mp/unlimited/scene?id=${id}`,
|
||||||
method:Method.GET,
|
method:Method.GET,
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|||||||
37
api/home.js
37
api/home.js
@@ -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,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取广告图
|
* 获取广告图
|
||||||
@@ -32,7 +47,7 @@ export function getCategory(parent_id = 0) {
|
|||||||
*/
|
*/
|
||||||
export function getHotKeywords(count) {
|
export function getHotKeywords(count) {
|
||||||
return http.request({
|
return http.request({
|
||||||
url: "/goods/hot-words",
|
url: "/goods/goods/hot-words",
|
||||||
method: Method.GET,
|
method: Method.GET,
|
||||||
loading: false,
|
loading: false,
|
||||||
params: { count },
|
params: { count },
|
||||||
@@ -44,10 +59,22 @@ export function getHotKeywords(count) {
|
|||||||
* @param client_type
|
* @param client_type
|
||||||
* @param page_type
|
* @param page_type
|
||||||
*/
|
*/
|
||||||
export function getFloorData() {
|
export function getFloorData(params) {
|
||||||
return http.request({
|
return http.request({
|
||||||
url: `/pageData/getIndex?clientType=H5`,
|
url: `/other/pageData/getIndex?clientType=H5`,
|
||||||
method: "get",
|
method: "get",
|
||||||
|
params
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取店铺楼层数据
|
||||||
|
*/
|
||||||
|
export function getFloorStoreData(params) {
|
||||||
|
return http.request({
|
||||||
|
url: `/other/pageData?pageClientType=H5`,
|
||||||
|
method: "get",
|
||||||
|
params
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -56,7 +83,7 @@ export function getFloorData() {
|
|||||||
*/
|
*/
|
||||||
export function getCategoryIndexData(parentId = 0) {
|
export function getCategoryIndexData(parentId = 0) {
|
||||||
return http.request({
|
return http.request({
|
||||||
url: `/category/get/${parentId}`,
|
url: `/goods/category/get/${parentId}`,
|
||||||
method: "get",
|
method: "get",
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
82
api/im.js
Normal file
82
api/im.js
Normal file
@@ -0,0 +1,82 @@
|
|||||||
|
import { http,Method } from "@/utils/request.js";
|
||||||
|
|
||||||
|
import api from "@/config/api.js";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取聊天详情接口
|
||||||
|
* @param {*} talkId
|
||||||
|
* @returns
|
||||||
|
*/
|
||||||
|
export function getTalk(talkId) {
|
||||||
|
return http.request({
|
||||||
|
url: `${api.im}/talk/${talkId}`,
|
||||||
|
method: Method.GET,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取与用户的聊天详情
|
||||||
|
* @param {*} talkId
|
||||||
|
* @returns
|
||||||
|
*/
|
||||||
|
export function getTalkByUser(userId) {
|
||||||
|
return http.request({
|
||||||
|
url: `${api.im}/talk/by/user/${userId}`,
|
||||||
|
method: Method.GET,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取聊天列表
|
||||||
|
* @param {*} talkId
|
||||||
|
* @returns
|
||||||
|
*/
|
||||||
|
export function getTalkList(params) {
|
||||||
|
return http.request({
|
||||||
|
url: `${api.im}/talk/list`,
|
||||||
|
method: Method.GET,
|
||||||
|
params
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取聊天信息接口
|
||||||
|
* @param {*} params
|
||||||
|
* @returns
|
||||||
|
*/
|
||||||
|
export function getTalkMessage(params) {
|
||||||
|
return http.request({
|
||||||
|
url: `${api.im}/message`,
|
||||||
|
method: Method.GET,
|
||||||
|
params
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取聊天信息接口
|
||||||
|
* @param {*} params
|
||||||
|
* @returns
|
||||||
|
*/
|
||||||
|
export function cleanUnreadMessage(params) {
|
||||||
|
return http.request({
|
||||||
|
url: `${api.im}/message/clean/unred`,
|
||||||
|
method: Method.PUT,
|
||||||
|
params
|
||||||
|
});
|
||||||
|
}
|
||||||
|
// 从商品页点击 客服 跳转 获取商品详情
|
||||||
|
export function jumpObtain(skuId, goodsId) {
|
||||||
|
return http.request({
|
||||||
|
url: `/goods/goods/sku/${goodsId}/${skuId}`,
|
||||||
|
method: Method.GET,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
// 清除未读
|
||||||
|
// /im/message/clean/unred
|
||||||
|
export function clearmeaager() {
|
||||||
|
return http.request({
|
||||||
|
url: `${api.im}/message/clean/unred`,
|
||||||
|
method: Method.PUT,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
90
api/login.js
90
api/login.js
@@ -8,19 +8,58 @@ import api from "@/config/api.js";
|
|||||||
*/
|
*/
|
||||||
export function resetByMobile(params) {
|
export function resetByMobile(params) {
|
||||||
return http.request({
|
return http.request({
|
||||||
url: `/members/resetByMobile`,
|
url: `/passport/member/resetByMobile`,
|
||||||
method: "POST",
|
method: "POST",
|
||||||
params,
|
params,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 绑定手机号码
|
||||||
|
* @param mobile
|
||||||
|
*/
|
||||||
|
export function bindMobile(params) {
|
||||||
|
return http.request({
|
||||||
|
url: `/passport/member/bindMobile`,
|
||||||
|
method: "POST",
|
||||||
|
params,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
//获取自动发券
|
||||||
|
export function getAutoCoup(){
|
||||||
|
return http.request({
|
||||||
|
url:`/promotion/coupon/activity`,
|
||||||
|
method:"GET",
|
||||||
|
needToken: true,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 账号密码登陆
|
||||||
|
* @params password
|
||||||
|
* @params username
|
||||||
|
*/
|
||||||
|
export function userLogin(params, clientType){
|
||||||
|
return http.request({
|
||||||
|
method: "POST",
|
||||||
|
url:`/passport/member/userLogin`,
|
||||||
|
data: params,
|
||||||
|
header: {
|
||||||
|
"content-type": "application/x-www-form-urlencoded",
|
||||||
|
clientType: clientType,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 发送验证码
|
* 发送验证码
|
||||||
* @param mobile
|
* @param mobile
|
||||||
*/
|
*/
|
||||||
export function sendMobile(mobile,type='LOGIN') {
|
export function sendMobile(mobile,type='LOGIN') {
|
||||||
return http.request({
|
return http.request({
|
||||||
url: `${api.common}/sms/${type}/${mobile}`,
|
url: `${api.common}/common/sms/${type}/${mobile}`,
|
||||||
method: "GET",
|
method: "GET",
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -32,7 +71,7 @@ export function sendMobile(mobile,type='LOGIN') {
|
|||||||
*/
|
*/
|
||||||
export function smsLogin(params, clientType) {
|
export function smsLogin(params, clientType) {
|
||||||
return http.request({
|
return http.request({
|
||||||
url: `/members/smsLogin`,
|
url: `/passport/member/smsLogin`,
|
||||||
method: "POST",
|
method: "POST",
|
||||||
data: params,
|
data: params,
|
||||||
header: {
|
header: {
|
||||||
@@ -50,18 +89,31 @@ export function smsLogin(params, clientType) {
|
|||||||
|
|
||||||
export function modifyPass(params) {
|
export function modifyPass(params) {
|
||||||
return http.request({
|
return http.request({
|
||||||
url: `/members/modifyPass`,
|
url: `/passport/member/modifyPass`,
|
||||||
method: "PUT",
|
method: "PUT",
|
||||||
params,
|
params,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改密码
|
||||||
|
* @param newPassword
|
||||||
|
* @param password
|
||||||
|
*/
|
||||||
|
export function resetPassword(params) {
|
||||||
|
return http.request({
|
||||||
|
url: `/passport/member/resetPassword`,
|
||||||
|
method: "POST",
|
||||||
|
params,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 刷新token
|
* 刷新token
|
||||||
*/
|
*/
|
||||||
export function refreshTokenFn(refresh_token) {
|
export function refreshTokenFn(refresh_token) {
|
||||||
return http.request({
|
return http.request({
|
||||||
url: `/members/refresh/${refresh_token}`,
|
url: `/passport/member/refresh/${refresh_token}`,
|
||||||
method: "GET",
|
method: "GET",
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -69,8 +121,34 @@ export function refreshTokenFn(refresh_token) {
|
|||||||
// 获取密码状态
|
// 获取密码状态
|
||||||
export function logout () {
|
export function logout () {
|
||||||
return http.request({
|
return http.request({
|
||||||
url: '/members/logout',
|
url: '/passport/member/logout',
|
||||||
method: "POST",
|
method: "POST",
|
||||||
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,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 注销用户
|
||||||
|
export function logoffConfirm() {
|
||||||
|
return http.request({
|
||||||
|
url: '/passport/member/cancellation',
|
||||||
|
method: "PUT",
|
||||||
|
needToken: true,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import { http, Method } from "@/utils/request.js";
|
|||||||
*/
|
*/
|
||||||
export function feedBack(params) {
|
export function feedBack(params) {
|
||||||
return http.request({
|
return http.request({
|
||||||
url: "/feedback",
|
url: "/other/feedback",
|
||||||
method: Method.POST,
|
method: Method.POST,
|
||||||
needToken: true,
|
needToken: true,
|
||||||
params,
|
params,
|
||||||
@@ -16,7 +16,7 @@ export function feedBack(params) {
|
|||||||
// 提现
|
// 提现
|
||||||
export function withdrawalApply(params) {
|
export function withdrawalApply(params) {
|
||||||
return http.request({
|
return http.request({
|
||||||
url: "/members/wallet/withdrawal",
|
url: "/wallet/wallet/withdrawal",
|
||||||
method: Method.POST,
|
method: Method.POST,
|
||||||
needToken: true,
|
needToken: true,
|
||||||
params,
|
params,
|
||||||
@@ -30,7 +30,7 @@ export function withdrawalApply(params) {
|
|||||||
*/
|
*/
|
||||||
export function payCallback(params) {
|
export function payCallback(params) {
|
||||||
return http.request({
|
return http.request({
|
||||||
url: `/cashier/result`,
|
url: `/payment/cashier/result`,
|
||||||
method: Method.GET,
|
method: Method.GET,
|
||||||
params,
|
params,
|
||||||
});
|
});
|
||||||
@@ -117,7 +117,7 @@ export function getPointsData(params) {
|
|||||||
*/
|
*/
|
||||||
export function getComments(params) {
|
export function getComments(params) {
|
||||||
return http.request({
|
return http.request({
|
||||||
url: "/memberEvaluation",
|
url: "/member/evaluation",
|
||||||
method: Method.GET,
|
method: Method.GET,
|
||||||
needToken: true,
|
needToken: true,
|
||||||
params,
|
params,
|
||||||
@@ -131,7 +131,7 @@ export function getComments(params) {
|
|||||||
*/
|
*/
|
||||||
export function getFootprintNum(params) {
|
export function getFootprintNum(params) {
|
||||||
return http.request({
|
return http.request({
|
||||||
url: "/footprint/getFootprintNum",
|
url: "/member/footprint/getFootprintNum",
|
||||||
method: Method.GET,
|
method: Method.GET,
|
||||||
needToken: true,
|
needToken: true,
|
||||||
params,
|
params,
|
||||||
@@ -144,7 +144,7 @@ export function getFootprintNum(params) {
|
|||||||
*/
|
*/
|
||||||
export function commentsMemberOrder(params) {
|
export function commentsMemberOrder(params) {
|
||||||
return http.request({
|
return http.request({
|
||||||
url: "/memberEvaluation",
|
url: "/member/evaluation",
|
||||||
method: Method.POST,
|
method: Method.POST,
|
||||||
needToken: true,
|
needToken: true,
|
||||||
header: { "content-type": "application/x-www-form-urlencoded" },
|
header: { "content-type": "application/x-www-form-urlencoded" },
|
||||||
@@ -202,6 +202,22 @@ export function getGoodsCollection(params, type) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取商品收藏
|
||||||
|
* @param params
|
||||||
|
* @returns {AxiosPromise}
|
||||||
|
*/
|
||||||
|
export function getStoreCollection(params, type) {
|
||||||
|
return http.request({
|
||||||
|
url: `/member/storeCollection/${type}`,
|
||||||
|
method: Method.GET,
|
||||||
|
needToken: true,
|
||||||
|
loading: false,
|
||||||
|
message: false,
|
||||||
|
params,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 收藏商品
|
* 收藏商品
|
||||||
* @returns {AxiosPromise}
|
* @returns {AxiosPromise}
|
||||||
@@ -236,7 +252,7 @@ export function deleteGoodsCollection(ids) {
|
|||||||
*/
|
*/
|
||||||
export function deleteStoreCollection(store_id) {
|
export function deleteStoreCollection(store_id) {
|
||||||
return http.request({
|
return http.request({
|
||||||
url: `/member/collection/delete/STORE/${store_id}`,
|
url: `/member/storeCollection/delete/STORE/${store_id}`,
|
||||||
method: Method.DELETE,
|
method: Method.DELETE,
|
||||||
needToken: true,
|
needToken: true,
|
||||||
});
|
});
|
||||||
@@ -255,6 +271,19 @@ export function getGoodsIsCollect(type, good_id) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取商品是否被收藏
|
||||||
|
* @param good_id
|
||||||
|
*/
|
||||||
|
export function getStoreIsCollect(type, store_id) {
|
||||||
|
return http.request({
|
||||||
|
url: `/member/storeCollection/isCollection/${type}/${store_id}`,
|
||||||
|
method: Method.GET,
|
||||||
|
needToken: true,
|
||||||
|
loading: false,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 收藏店铺
|
* 收藏店铺
|
||||||
* @param store_id 店铺ID
|
* @param store_id 店铺ID
|
||||||
@@ -262,10 +291,9 @@ export function getGoodsIsCollect(type, good_id) {
|
|||||||
*/
|
*/
|
||||||
export function collectionStore(store_id) {
|
export function collectionStore(store_id) {
|
||||||
return http.request({
|
return http.request({
|
||||||
url: "members/collection/store",
|
url: `/member/storeCollection/add/STORE/${store_id}`,
|
||||||
header: { "content-type": "application/x-www-form-urlencoded" },
|
|
||||||
method: Method.POST,
|
method: Method.POST,
|
||||||
data: { store_id },
|
needToken: true,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -275,7 +303,7 @@ export function collectionStore(store_id) {
|
|||||||
*/
|
*/
|
||||||
export function getUserInfo() {
|
export function getUserInfo() {
|
||||||
return http.request({
|
return http.request({
|
||||||
url: "/members",
|
url: "/passport/member",
|
||||||
method: Method.GET,
|
method: Method.GET,
|
||||||
needToken: true,
|
needToken: true,
|
||||||
});
|
});
|
||||||
@@ -287,7 +315,7 @@ export function getUserInfo() {
|
|||||||
*/
|
*/
|
||||||
export function getUserWallet() {
|
export function getUserWallet() {
|
||||||
return http.request({
|
return http.request({
|
||||||
url: "/members/wallet",
|
url: "/wallet/wallet",
|
||||||
method: Method.GET,
|
method: Method.GET,
|
||||||
needToken: true,
|
needToken: true,
|
||||||
});
|
});
|
||||||
@@ -300,7 +328,7 @@ export function getUserWallet() {
|
|||||||
*/
|
*/
|
||||||
export function saveUserInfo(params) {
|
export function saveUserInfo(params) {
|
||||||
return http.request({
|
return http.request({
|
||||||
url: "/members/editOwn",
|
url: "/passport/member/editOwn",
|
||||||
method: Method.PUT,
|
method: Method.PUT,
|
||||||
header: { "content-type": "application/x-www-form-urlencoded" },
|
header: { "content-type": "application/x-www-form-urlencoded" },
|
||||||
needToken: true,
|
needToken: true,
|
||||||
@@ -328,7 +356,7 @@ export function addReceipt(params) {
|
|||||||
*/
|
*/
|
||||||
export function getGoodsComments(goodsId, params) {
|
export function getGoodsComments(goodsId, params) {
|
||||||
return http.request({
|
return http.request({
|
||||||
url: `/memberEvaluation/${goodsId}/goodsEvaluation`,
|
url: `/member/evaluation/${goodsId}/goodsEvaluation`,
|
||||||
method: Method.GET,
|
method: Method.GET,
|
||||||
loading: false,
|
loading: false,
|
||||||
params,
|
params,
|
||||||
@@ -341,7 +369,7 @@ export function getGoodsComments(goodsId, params) {
|
|||||||
*/
|
*/
|
||||||
export function getGoodsCommentsCount(goodsId) {
|
export function getGoodsCommentsCount(goodsId) {
|
||||||
return http.request({
|
return http.request({
|
||||||
url: `/memberEvaluation/${goodsId}/evaluationNumber`,
|
url: `/member/evaluation/${goodsId}/evaluationNumber`,
|
||||||
method: Method.GET,
|
method: Method.GET,
|
||||||
loading: false,
|
loading: false,
|
||||||
});
|
});
|
||||||
@@ -365,7 +393,7 @@ export function getNoReadMessageNum() {
|
|||||||
*/
|
*/
|
||||||
export function myTrackList(params) {
|
export function myTrackList(params) {
|
||||||
return http.request({
|
return http.request({
|
||||||
url: `/footprint`,
|
url: `/member/footprint`,
|
||||||
method: Method.GET,
|
method: Method.GET,
|
||||||
needToken: true,
|
needToken: true,
|
||||||
params,
|
params,
|
||||||
@@ -378,7 +406,7 @@ export function myTrackList(params) {
|
|||||||
*/
|
*/
|
||||||
export function deleteHistoryListId(ids) {
|
export function deleteHistoryListId(ids) {
|
||||||
return http.request({
|
return http.request({
|
||||||
url: `/footprint/delByIds/${ids}`,
|
url: `/member/footprint/delByIds/${ids}`,
|
||||||
method: Method.DELETE,
|
method: Method.DELETE,
|
||||||
needToken: true,
|
needToken: true,
|
||||||
});
|
});
|
||||||
@@ -419,3 +447,16 @@ export function getMemberPointSum() {
|
|||||||
method: Method.GET,
|
method: Method.GET,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取会员积分VO
|
||||||
|
* @param
|
||||||
|
*/
|
||||||
|
export function withdrawalSettingVO() {
|
||||||
|
return http.request({
|
||||||
|
url: `/wallet/wallet/withdrawalSettingVO`,
|
||||||
|
method: Method.GET,
|
||||||
|
needToken: true,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -14,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
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -42,12 +42,30 @@ export function getMessages(params) {
|
|||||||
*/
|
*/
|
||||||
export function messageMarkAsRead(ids) {
|
export function messageMarkAsRead(ids) {
|
||||||
return http.request({
|
return http.request({
|
||||||
url: `members/member-nocice-logs/${ids}/read`,
|
url: `/message/member/${ids}`,
|
||||||
method: Method.PUT,
|
method: Method.PUT,
|
||||||
needToken: true,
|
needToken: true,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//读取站内消息
|
||||||
|
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
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ export function selectedShipMethod(params) {
|
|||||||
*/
|
*/
|
||||||
export function getOrderList(params) {
|
export function getOrderList(params) {
|
||||||
return http.request({
|
return http.request({
|
||||||
url: "/orders",
|
url: "/order/order",
|
||||||
method: Method.GET,
|
method: Method.GET,
|
||||||
needToken: true,
|
needToken: true,
|
||||||
params,
|
params,
|
||||||
@@ -64,7 +64,7 @@ export function getOrderList(params) {
|
|||||||
*/
|
*/
|
||||||
export function getOrderDetail(orderSn) {
|
export function getOrderDetail(orderSn) {
|
||||||
return http.request({
|
return http.request({
|
||||||
url: `/orders/${orderSn}`,
|
url: `/order/order/${orderSn}`,
|
||||||
method: Method.GET,
|
method: Method.GET,
|
||||||
needToken: true,
|
needToken: true,
|
||||||
});
|
});
|
||||||
@@ -77,7 +77,7 @@ export function getOrderDetail(orderSn) {
|
|||||||
*/
|
*/
|
||||||
export function cancelOrder(orderSn, reason) {
|
export function cancelOrder(orderSn, reason) {
|
||||||
return http.request({
|
return http.request({
|
||||||
url: `/orders/${orderSn}/cancel`,
|
url: `/order/order/${orderSn}/cancel`,
|
||||||
method: Method.POST,
|
method: Method.POST,
|
||||||
needToken: true,
|
needToken: true,
|
||||||
header: { "content-type": "application/x-www-form-urlencoded" },
|
header: { "content-type": "application/x-www-form-urlencoded" },
|
||||||
@@ -91,7 +91,7 @@ export function cancelOrder(orderSn, reason) {
|
|||||||
*/
|
*/
|
||||||
export function confirmReceipt(orderSn) {
|
export function confirmReceipt(orderSn) {
|
||||||
return http.request({
|
return http.request({
|
||||||
url: `/orders/${orderSn}/receiving`,
|
url: `/order/order/${orderSn}/receiving`,
|
||||||
method: Method.POST,
|
method: Method.POST,
|
||||||
needToken: true,
|
needToken: true,
|
||||||
});
|
});
|
||||||
|
|||||||
25
api/store.js
25
api/store.js
@@ -4,13 +4,16 @@
|
|||||||
|
|
||||||
import {http, Method} from '@/utils/request.js';
|
import {http, Method} from '@/utils/request.js';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取店铺列表
|
* 获取店铺列表
|
||||||
* @param params
|
* @param params
|
||||||
*/
|
*/
|
||||||
export function getstoreList(params) {
|
export function getStoreList(params) {
|
||||||
return http.request({
|
return http.request({
|
||||||
url: '/store',
|
url: '/store/store',
|
||||||
method: Method.GET,
|
method: Method.GET,
|
||||||
params,
|
params,
|
||||||
});
|
});
|
||||||
@@ -22,7 +25,7 @@ export function getstoreList(params) {
|
|||||||
*/
|
*/
|
||||||
export function getStoreBaseInfo(storeId) {
|
export function getStoreBaseInfo(storeId) {
|
||||||
return http.request({
|
return http.request({
|
||||||
url: `/store/get/detail/${storeId}`,
|
url: `/store/store/get/detail/${storeId}`,
|
||||||
method: Method.GET,
|
method: Method.GET,
|
||||||
loading: false,
|
loading: false,
|
||||||
});
|
});
|
||||||
@@ -34,7 +37,7 @@ export function getstoreList(params) {
|
|||||||
*/
|
*/
|
||||||
export function getStoreCategory(id) {
|
export function getStoreCategory(id) {
|
||||||
return http.request({
|
return http.request({
|
||||||
url: `/store/label/get/${id}`,
|
url: `/store/store/label/get/${id}`,
|
||||||
method: Method.GET,
|
method: Method.GET,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -46,11 +49,23 @@ export function getstoreList(params) {
|
|||||||
*/
|
*/
|
||||||
export function getLicencePhoto(id) {
|
export function getLicencePhoto(id) {
|
||||||
return http.request({
|
return http.request({
|
||||||
url: `/store/get/licencePhoto/${id}`,
|
url: `/store/store/get/licencePhoto/${id}`,
|
||||||
method: Method.GET,
|
method: Method.GET,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取自提点信息
|
||||||
|
* @param id
|
||||||
|
*/
|
||||||
|
export function getStoreAddress(storeId,params) {
|
||||||
|
return http.request({
|
||||||
|
url: `/store/address/page/${storeId}`,
|
||||||
|
method: Method.GET,
|
||||||
|
params
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
53
api/trade.js
53
api/trade.js
@@ -155,6 +155,18 @@ export function setAddressId(addressId,way) {
|
|||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* 设置收货地址ID
|
||||||
|
* @param addressId
|
||||||
|
*/
|
||||||
|
export function setStoreAddressId(storeAddressId,way) {
|
||||||
|
return http.request({
|
||||||
|
url: `/trade/carts/storeAddress?storeAddressId=${storeAddressId}&way=${way}`,
|
||||||
|
method: Method.GET,
|
||||||
|
needToken: true,
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -177,7 +189,7 @@ export function createTrade(params) {
|
|||||||
*/
|
*/
|
||||||
export function getCashierData(params) {
|
export function getCashierData(params) {
|
||||||
return http.request({
|
return http.request({
|
||||||
url: "cashier/tradeDetail",
|
url: "payment/cashier/tradeDetail",
|
||||||
method: Method.GET,
|
method: Method.GET,
|
||||||
needToken: true,
|
needToken: true,
|
||||||
params,
|
params,
|
||||||
@@ -194,7 +206,7 @@ export function getCashierData(params) {
|
|||||||
*/
|
*/
|
||||||
export function initiatePay(paymentMethod, paymentClient, params) {
|
export function initiatePay(paymentMethod, paymentClient, params) {
|
||||||
return http.request({
|
return http.request({
|
||||||
url: `cashier/pay/${paymentMethod}/${paymentClient}`,
|
url: `payment/cashier/pay/${paymentMethod}/${paymentClient}`,
|
||||||
method: Method.GET,
|
method: Method.GET,
|
||||||
needToken: true,
|
needToken: true,
|
||||||
params,
|
params,
|
||||||
@@ -209,7 +221,7 @@ export function initiatePay(paymentMethod, paymentClient, params) {
|
|||||||
*/
|
*/
|
||||||
export function getExpress(orderSn) {
|
export function getExpress(orderSn) {
|
||||||
return http.request({
|
return http.request({
|
||||||
url: `/orders/getTraces/${orderSn}`,
|
url: `/order/order/getTraces/${orderSn}`,
|
||||||
method: Method.POST,
|
method: Method.POST,
|
||||||
needToken: true,
|
needToken: true,
|
||||||
|
|
||||||
@@ -281,3 +293,38 @@ export function reBuy(sn) {
|
|||||||
needToken: true,
|
needToken: true,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取全部配送方式
|
||||||
|
*/
|
||||||
|
export function shippingMethodList(params) {
|
||||||
|
return http.request({
|
||||||
|
url: `/trade/carts/shippingMethodList`,
|
||||||
|
method: Method.GET,
|
||||||
|
needToken: true,
|
||||||
|
params: params,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 提交配送方式
|
||||||
|
* @param params
|
||||||
|
*/
|
||||||
|
export function setShipMethod(params) {
|
||||||
|
return http.request({
|
||||||
|
url: "/trade/carts/shippingMethod",
|
||||||
|
method: Method.PUT,
|
||||||
|
needToken: true,
|
||||||
|
params,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查看包裹列表
|
||||||
|
export function getPackage(orderSn) {
|
||||||
|
return http.request({
|
||||||
|
url: `/order/order/getPackage/${orderSn}`,
|
||||||
|
method: Method.GET,
|
||||||
|
needToken: true,
|
||||||
|
});
|
||||||
|
}
|
||||||
1439
components/Sansnn-uQRCode/uqrcode.js
Normal file
1439
components/Sansnn-uQRCode/uqrcode.js
Normal file
File diff suppressed because it is too large
Load Diff
@@ -1,475 +1,574 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="wrapper">
|
<div class="wrapper">
|
||||||
<u-popup class="popup" v-model="buyMask" :height="setup.height" closeable :mode="setup.mode"
|
<u-popup class="popup" v-model="buyMask" :height="setup.height" closeable :mode="setup.mode" :border-radius="setup.radius" @close="closeMask()">
|
||||||
:border-radius="setup.radius" @close="closeMask()">
|
<!-- 商品 -->
|
||||||
<!-- 商品 -->
|
<view class="goods-box bottom">
|
||||||
<view class="goods-box bottom">
|
<view class="goods-header">
|
||||||
<view class="goods-header">
|
<view class="goods-img">
|
||||||
<view class="goods-img">
|
<u-image width="200rpx" border-radius="20" class="uimage" height="200rpx" :src="selectedSpecImg ? selectedSpecImg : goodsDetail.thumbnail"></u-image>
|
||||||
<u-image width="200rpx" border-radius="20" class="uimage" height="200rpx"
|
</view>
|
||||||
:src="selectedSpecImg ? selectedSpecImg : goodsDetail.thumbnail"></u-image>
|
<view class="goods-skus">
|
||||||
</view>
|
<!-- 有活动商品价格 -->
|
||||||
<view class="goods-skus">
|
<view class="goods-price" v-if="goodsDetail.promotionPrice && ((isGroup && buyType === 'PINTUAN') || !isGroup)">
|
||||||
|
<span v-if="goodsDetail.promotionPrice && !pointDetail">
|
||||||
|
¥
|
||||||
|
<span class="goods-price-promotionShow goods-price-bigshow">{{ $options.filters.goodsFormatPrice(goodsDetail.promotionPrice)[0] }}</span>
|
||||||
|
.{{ $options.filters.goodsFormatPrice(goodsDetail.promotionPrice)[1] }}
|
||||||
|
</span>
|
||||||
|
<span v-if="pointDetail.points">
|
||||||
|
<span class="goods-price-promotionShow goods-price-bigshow">{{ pointDetail.points }}</span>
|
||||||
|
积分
|
||||||
|
</span>
|
||||||
|
<div class="promotion-box">
|
||||||
|
¥
|
||||||
|
<span class="goods-price-bigshow">{{ $options.filters.goodsFormatPrice(goodsDetail.price)[0] }}</span>
|
||||||
|
.{{ $options.filters.goodsFormatPrice(goodsDetail.price)[1] }}
|
||||||
|
</div>
|
||||||
|
</view>
|
||||||
|
<!-- 正常商品的价格 -->
|
||||||
|
<view v-else>
|
||||||
|
<!-- 批发价格 -->
|
||||||
|
<div class="price-row flex" v-if="goodsDetail.salesModel === 'WHOLESALE'">
|
||||||
|
<div class="goods-price" v-for="(item, index) in wholesaleList" :key="index">
|
||||||
|
<span>
|
||||||
|
¥
|
||||||
|
<span class="goods-price-bigshow">{{ $options.filters.goodsFormatPrice(item.price)[0] }}</span>
|
||||||
|
.{{ $options.filters.goodsFormatPrice(item.price)[1] }}
|
||||||
|
</span>
|
||||||
|
<span class="wholesale-item">{{ item.num }}{{ goodsDetail.goodsUnit }}</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="goods-price" v-else>
|
||||||
|
<span>
|
||||||
|
¥
|
||||||
|
<span class="goods-price-bigshow">{{ $options.filters.goodsFormatPrice(goodsDetail.price)[0] }}</span>
|
||||||
|
.{{ $options.filters.goodsFormatPrice(goodsDetail.price)[1] }}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</view>
|
||||||
|
<view class="goods-check-skus">
|
||||||
|
已选
|
||||||
|
<span class="goods-check-skus-name">
|
||||||
|
{{ selectName }}
|
||||||
|
<span>,{{ num }}个</span>
|
||||||
|
</span>
|
||||||
|
</view>
|
||||||
|
<view class="goods-check-skus">
|
||||||
|
库存
|
||||||
|
<span class="goods-check-skus-name">
|
||||||
|
<span>{{ goodsDetail.quantity }}</span>
|
||||||
|
</span>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<!-- 商品信息 -->
|
||||||
|
<scroll-view class="goods-skus-box" :scroll-y="true">
|
||||||
|
<!-- 规格 -->
|
||||||
|
<view class="goods-skus-view" :key="specIndex" v-for="(spec, specIndex) in formatList">
|
||||||
|
<view class="skus-view-list">
|
||||||
|
<view class="view-class-title">{{ spec.name }}</view>
|
||||||
|
|
||||||
<!-- 有活动商品价格 -->
|
<!-- 正常逻辑 循环出sku -->
|
||||||
<view class="goods-price " v-if="goodsDetail.promotionPrice">
|
<view
|
||||||
<span v-if="goodsDetail.promotionPrice && !pointDetail">
|
v-if="!parentOrder"
|
||||||
¥
|
:class="{ active: spec_val.value == currentSelected[specIndex] }"
|
||||||
<span
|
class="skus-view-item"
|
||||||
class="goods-price-promotionShow goods-price-bigshow">{{ formatPrice(goodsDetail.promotionPrice)[0] }}</span>
|
v-for="(spec_val, spec_index) in spec.values"
|
||||||
.{{ formatPrice(goodsDetail.promotionPrice)[1] }}
|
:key="spec_index"
|
||||||
</span>
|
@click="handleClickSpec(spec, specIndex, spec_val)"
|
||||||
<span v-if="pointDetail.points">
|
>
|
||||||
<span class="goods-price-promotionShow goods-price-bigshow">{{ pointDetail.points }}</span>
|
{{ spec_val.value }}
|
||||||
积分
|
</view>
|
||||||
</span>
|
|
||||||
<div class="promotion-box">
|
|
||||||
¥
|
|
||||||
<span class="goods-price-bigshow">{{
|
|
||||||
formatPrice(goodsDetail.price)[0]
|
|
||||||
}}</span>
|
|
||||||
.{{ formatPrice(goodsDetail.price)[1] }}
|
|
||||||
|
|
||||||
</div>
|
<!-- 拼团购买,仅筛选出当前拼团类型商品 -->
|
||||||
</view>
|
<view
|
||||||
<!-- 正常商品的价格 -->
|
v-if="parentOrder && spec_val.skuId == goodsDetail.id"
|
||||||
<view class="goods-price" v-else>
|
:class="{ active: spec_val.value == currentSelected[specIndex] }"
|
||||||
<span>
|
class="skus-view-item"
|
||||||
¥
|
v-for="(spec_val, spec_index) in spec.values"
|
||||||
<span class="goods-price-bigshow">{{
|
:key="spec_index"
|
||||||
formatPrice(goodsDetail.price)[0]
|
@click="handleClickSpec(spec, specIndex, spec_val)"
|
||||||
}}</span>
|
>
|
||||||
.{{ formatPrice(goodsDetail.price)[1] }}
|
{{ spec_val.value }}
|
||||||
|
</view>
|
||||||
</span>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="goods-check-skus">
|
<div class="soldout" v-if="goodsDetail.quantity === 0">
|
||||||
已选
|
<u-alert-tips type="warning" title="商品已售罄" description="当前商品库存为0"></u-alert-tips>
|
||||||
<span class="goods-check-skus-name">
|
</div>
|
||||||
{{ selectName }}
|
<!-- 数量 -->
|
||||||
<span>,{{ num }}个</span>
|
<view v-if="goodsDetail.quantity !== 0" class="goods-skus-number flex flex-a-c flex-j-sb">
|
||||||
</span>
|
<view class="view-class-title">数量</view>
|
||||||
</view>
|
<uni-number-box class="uNumber" :min="1" :max="999" :disabled="goodsDetail.quantity === 0" v-model="num"></uni-number-box>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</scroll-view>
|
||||||
<!-- 商品信息 -->
|
<!-- 按钮 -->
|
||||||
<scroll-view class="goods-skus-box" :scroll-y="true">
|
<view class="btns" v-if="goodsDetail.quantity !== 0">
|
||||||
<!-- 规格 -->
|
<view class="box-btn card" v-if="buyType != 'PINTUAN' && goodsDetail.goodsType != 'VIRTUAL_GOODS'" @click="addToCartOrBuy('cart')">加入购物车</view>
|
||||||
<view class="goods-skus-view" :key="specIndex" v-for="(spec, specIndex) in formatList">
|
<view class="box-btn buy" @click="addToCartOrBuy('buy')">立即购买</view>
|
||||||
<view class="skus-view-list">
|
</view>
|
||||||
<view class="view-class-title">{{ spec.name }}</view>
|
</view>
|
||||||
|
</u-popup>
|
||||||
|
</div>
|
||||||
<!-- 正常逻辑 循环出sku -->
|
|
||||||
<view v-if="!parentOrder" :class="{ active: spec_val.value == currentSelceted[specIndex] }" class="skus-view-item"
|
|
||||||
v-for="(spec_val, spec_index) in spec.values" :key="spec_index"
|
|
||||||
@click="handleClickSpec(spec, specIndex, spec_val)">{{ spec_val.value }} </view>
|
|
||||||
|
|
||||||
<!-- 拼团购买,仅筛选出当前拼团类型商品 -->
|
|
||||||
<view v-if="parentOrder && spec_val.skuId == goodsDetail.id" :class="{ active: spec_val.value == currentSelceted[specIndex] }" class="skus-view-item"
|
|
||||||
v-for="(spec_val, spec_index) in spec.values" :key="spec_index"
|
|
||||||
@click="handleClickSpec(spec, specIndex, spec_val)">{{ spec_val.value }} </view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<!-- 数量 -->
|
|
||||||
<view class="goods-skus-number">
|
|
||||||
<view class="view-class-title">数量</view>
|
|
||||||
<u-number-box :bg-color="numberBox.bgColor" :max="200" :color="numberBox.color"
|
|
||||||
:input-width="numberBox.width" :input-height="numberBox.height" :size="numberBox.size" :min="1"
|
|
||||||
v-model="num">
|
|
||||||
</u-number-box>
|
|
||||||
</view>
|
|
||||||
</scroll-view>
|
|
||||||
<!-- 按钮 -->
|
|
||||||
<view class="btns">
|
|
||||||
|
|
||||||
<view class="box-btn card" v-if="buyType != 'PINTUAN' && goodsDetail.goodsType!='VIRTUAL_GOODS'"
|
|
||||||
@click="addToCartOrBuy('cart')">加入购物车</view>
|
|
||||||
<view class="box-btn buy" @click="addToCartOrBuy('buy')">立即购买</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</u-popup>
|
|
||||||
</div>
|
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import * as API_trade from "@/api/trade.js";
|
import * as API_trade from '@/api/trade.js';
|
||||||
import setup from "./popup";
|
import setup from './popup';
|
||||||
|
import uniNumberBox from '@/components/uni-number-box'
|
||||||
export default {
|
export default {
|
||||||
data() {
|
components: {
|
||||||
return {
|
uniNumberBox
|
||||||
setup,
|
},
|
||||||
num: 1,
|
data() {
|
||||||
// 步进器的大小尺寸单位是 rpx
|
return {
|
||||||
numberBox: {
|
setup,
|
||||||
width: "50",
|
num: this.wholesaleList && this.wholesaleList.length > 0 ? this.wholesaleList[0].num : 1,
|
||||||
height: "50",
|
|
||||||
size: "22",
|
|
||||||
color: "#333",
|
|
||||||
bgColor: "#fff",
|
|
||||||
},
|
|
||||||
selectName: "", //选中商品的昵称
|
|
||||||
selectSkuList: "", //选中商铺sku,
|
|
||||||
selectedSpecImg: "", //选中的图片路径
|
|
||||||
buyType: "", //用于存储促销,拼团等活动类型
|
|
||||||
parentOrder: "", //父级拼团活动的数据 - 如果是团员则有数据
|
|
||||||
formatList: [],
|
|
||||||
currentSelceted: [],
|
|
||||||
skuList: "",
|
|
||||||
isClose: false, //是否可以点击遮罩关闭
|
|
||||||
};
|
|
||||||
},
|
|
||||||
props: {
|
|
||||||
buyMask: {
|
|
||||||
type: Boolean,
|
|
||||||
default: false,
|
|
||||||
},
|
|
||||||
goodsDetail: {
|
|
||||||
default: "",
|
|
||||||
type: null,
|
|
||||||
},
|
|
||||||
selectedSku: {
|
|
||||||
default: "",
|
|
||||||
type: null,
|
|
||||||
},
|
|
||||||
goodsSpec: {
|
|
||||||
default: "",
|
|
||||||
type: null,
|
|
||||||
},
|
|
||||||
addr: {
|
|
||||||
default: "",
|
|
||||||
type: null,
|
|
||||||
},
|
|
||||||
pointDetail:{
|
|
||||||
default: "",
|
|
||||||
type: null,
|
|
||||||
}
|
|
||||||
},
|
|
||||||
watch: {
|
|
||||||
buyType: {
|
|
||||||
handler(val) {
|
|
||||||
this.buyType = val;
|
|
||||||
},
|
|
||||||
immediate: true,
|
|
||||||
},
|
|
||||||
selectSkuList: {
|
|
||||||
handler(val, oldval) {
|
|
||||||
this.$emit("changed", val);
|
|
||||||
},
|
|
||||||
deep: true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
|
|
||||||
methods: {
|
selectName: '', //选中商品的昵称
|
||||||
|
selectSkuList: '', //选中商铺sku,
|
||||||
|
selectedSpecImg: '', //选中的图片路径
|
||||||
|
buyType: '', //用于存储促销,拼团等活动类型
|
||||||
|
parentOrder: '', //父级拼团活动的数据 - 如果是团员则有数据
|
||||||
|
formatList: [],
|
||||||
|
currentSelected: [],
|
||||||
|
skuList: '',
|
||||||
|
isClose: false //是否可以点击遮罩关闭
|
||||||
|
};
|
||||||
|
},
|
||||||
|
props: {
|
||||||
|
wholesaleList: {
|
||||||
|
type: null,
|
||||||
|
default: false
|
||||||
|
},
|
||||||
|
buyMask: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
|
},
|
||||||
|
isGroup: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
|
},
|
||||||
|
goodsDetail: {
|
||||||
|
default: '',
|
||||||
|
type: null
|
||||||
|
},
|
||||||
|
selectedSku: {
|
||||||
|
default: '',
|
||||||
|
type: null
|
||||||
|
},
|
||||||
|
goodsSpec: {
|
||||||
|
default: '',
|
||||||
|
type: null
|
||||||
|
},
|
||||||
|
addr: {
|
||||||
|
default: '',
|
||||||
|
type: null
|
||||||
|
},
|
||||||
|
pointDetail: {
|
||||||
|
default: '',
|
||||||
|
type: null
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
wholesalePrice(key) {
|
||||||
|
return this.wholesaleList.length
|
||||||
|
? this.wholesaleList.map(item => {
|
||||||
|
return item.price;
|
||||||
|
})
|
||||||
|
: [];
|
||||||
|
},
|
||||||
|
wholesaleNum(key) {
|
||||||
|
return this.wholesaleList.length
|
||||||
|
? this.wholesaleList.map(item => {
|
||||||
|
return item.num;
|
||||||
|
})
|
||||||
|
: [];
|
||||||
|
}
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
num(val) {
|
||||||
|
|
||||||
|
val == 0 ? this.num = 1 : ''
|
||||||
|
if (val) {
|
||||||
|
|
||||||
|
//超过库存后修改回库存
|
||||||
|
if (val > this.goodsDetail.quantity) {
|
||||||
|
this.$nextTick(function() {
|
||||||
|
this.num = this.goodsDetail.quantity;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
buyType: {
|
||||||
|
handler(val) {
|
||||||
|
if (val) {
|
||||||
|
this.buyType = val;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
immediate: true
|
||||||
|
},
|
||||||
|
selectSkuList: {
|
||||||
|
handler(val, oldval) {
|
||||||
|
this.$emit('changed', val);
|
||||||
|
},
|
||||||
|
deep: true
|
||||||
|
},
|
||||||
|
'goodsDetail.quantity': {
|
||||||
|
handler(val) {
|
||||||
|
if (val == 0) {
|
||||||
|
uni.showToast({
|
||||||
|
title: '商品已售罄',
|
||||||
|
duration: 2000,
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
this.num = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
// 格式化金钱 1999 --> [1999,00]
|
methods: {
|
||||||
formatPrice(val) {
|
numCheck(val) {
|
||||||
if (typeof val == "undefined") {
|
if (this.wholesaleList && this.wholesaleList.length > 0) {
|
||||||
return val;
|
if (this.num <= this.wholesaleList[0].num) {
|
||||||
}
|
uni.showToast({
|
||||||
return val.toFixed(2).split(".");
|
title: '批发商品购买数量不能小于起批数量!',
|
||||||
},
|
duration: 2000,
|
||||||
|
icon: 'none'
|
||||||
|
});
|
||||||
|
this.num = this.wholesaleList[0].num;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
closeMask() {
|
||||||
|
this.$emit('closeBuy', false);
|
||||||
|
},
|
||||||
|
|
||||||
|
/**点击规格 */
|
||||||
|
handleClickSpec(val, index, specValue) {
|
||||||
|
this.currentSelected[index] = specValue.value;
|
||||||
|
let selectedSkuId = this.goodsSpec.find(i => {
|
||||||
|
let matched = true;
|
||||||
|
let specValues = i.specValues.filter(j => j.specName !== 'images');
|
||||||
|
for (let n = 0; n < specValues.length; n++) {
|
||||||
|
if (specValues[n].specValue !== this.currentSelected[n]) {
|
||||||
|
matched = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (matched) {
|
||||||
|
return i;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
if (selectedSkuId?.skuId) {
|
||||||
|
this.$set(this.currentSelected, index, specValue.value);
|
||||||
|
this.selectSkuList = {
|
||||||
|
spec: {
|
||||||
|
specName: val.name,
|
||||||
|
specValue: specValue.value
|
||||||
|
},
|
||||||
|
data: this.goodsDetail
|
||||||
|
};
|
||||||
|
this.selectName = specValue.value;
|
||||||
|
|
||||||
closeMask() {
|
this.$emit('handleClickSku', {
|
||||||
this.$emit("closeBuy", false);
|
skuId: selectedSkuId.skuId,
|
||||||
},
|
goodsId: this.goodsDetail.goodsId
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
uni.showToast({
|
||||||
|
title: '暂无该商品!',
|
||||||
|
duration: 2000,
|
||||||
|
icon: 'none'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
/**点击规格 */
|
/**
|
||||||
handleClickSpec(val, index, specValue) {
|
* 直接购买
|
||||||
this.currentSelceted[index] = specValue.value;
|
*/
|
||||||
let selectedSkuId = this.goodsSpec.find((i) => {
|
buy(data) {
|
||||||
let matched = true;
|
API_trade.addToCart(data).then(res => {
|
||||||
let specValues = i.specValues.filter((j) => j.specName !== "images");
|
if (res.data.success) {
|
||||||
for (let n = 0; n < specValues.length; n++) {
|
uni.navigateTo({
|
||||||
if (specValues[n].specValue !== this.currentSelceted[n]) {
|
url: `/pages/order/fillorder?way=${data.cartType}&addr=${''}&parentOrder=${encodeURIComponent(JSON.stringify(this.parentOrder))}`
|
||||||
matched = false;
|
});
|
||||||
return;
|
}
|
||||||
}
|
});
|
||||||
}
|
},
|
||||||
if (matched) {
|
|
||||||
return i;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
if (selectedSkuId?.skuId) {
|
|
||||||
this.$set(this.currentSelceted, index, specValue.value);
|
|
||||||
this.selectSkuList = {
|
|
||||||
spec: {
|
|
||||||
specName: val.name,
|
|
||||||
specValue: specValue.value,
|
|
||||||
},
|
|
||||||
data: this.goodsDetail,
|
|
||||||
};
|
|
||||||
this.selectName = specValue.value;
|
|
||||||
|
|
||||||
this.$emit("handleClickSku", {
|
/**
|
||||||
skuId: selectedSkuId.skuId,
|
* 添加到购物车或购买
|
||||||
goodsId: this.goodsDetail.goodsId,
|
*/
|
||||||
});
|
addToCartOrBuy(val) {
|
||||||
} else {
|
if (!this.selectSkuList) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: "暂无该商品!",
|
title: '请选择规格商品',
|
||||||
duration: 2000,
|
icon: 'none'
|
||||||
icon: "none",
|
});
|
||||||
});
|
return;
|
||||||
}
|
}
|
||||||
},
|
let data = {
|
||||||
|
skuId: this.goodsDetail.id,
|
||||||
|
num: this.num
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
if (val == 'cart') {
|
||||||
* 直接购买
|
API_trade.addToCart(data).then(res => {
|
||||||
*/
|
if (res.data.code == 200) {
|
||||||
buy(data) {
|
uni.showToast({
|
||||||
API_trade.addToCart(data).then((res) => {
|
title: '商品已添加到购物车',
|
||||||
if (res.data.success) {
|
icon: 'none'
|
||||||
uni.navigateTo({
|
});
|
||||||
url: `/pages/order/fillorder?way=${
|
|
||||||
data.cartType
|
|
||||||
}&addr=${""}&parentOrder=${encodeURIComponent(
|
|
||||||
JSON.stringify(this.parentOrder)
|
|
||||||
)}`,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
|
|
||||||
|
this.$emit('queryCart');
|
||||||
|
this.closeMask();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
// 判断是否拼团商品
|
||||||
|
if (this.buyType) {
|
||||||
|
data.cartType = 'PINTUAN';
|
||||||
|
} else if (this.goodsDetail.goodsType == 'VIRTUAL_GOODS') {
|
||||||
|
data.cartType = 'VIRTUAL';
|
||||||
|
} else {
|
||||||
|
data.cartType = 'BUY_NOW';
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
API_trade.addToCart(data).then(res => {
|
||||||
* 添加到购物车或购买
|
if (res.data.code == 200) {
|
||||||
*/
|
uni.navigateTo({
|
||||||
addToCartOrBuy(val) {
|
url: `/pages/order/fillorder?way=${data.cartType}&addr=${this.addr.id || ''}&parentOrder=${encodeURIComponent(JSON.stringify(this.parentOrder))}`
|
||||||
if (!this.selectSkuList) {
|
});
|
||||||
uni.showToast({
|
}
|
||||||
title: "请选择规格商品",
|
});
|
||||||
icon: "none",
|
}
|
||||||
});
|
},
|
||||||
return;
|
formatSku(list) {
|
||||||
}
|
// 格式化数据
|
||||||
let data = {
|
let arr = [{}];
|
||||||
skuId: this.goodsDetail.id,
|
|
||||||
num: this.num,
|
|
||||||
};
|
|
||||||
|
|
||||||
if (val == "cart") {
|
if (!Array.isArray(list)) {
|
||||||
API_trade.addToCart(data).then((res) => {
|
return false;
|
||||||
if (res.data.code == 200) {
|
}
|
||||||
uni.showToast({
|
list.forEach((item, index) => {
|
||||||
title: "商品已添加到购物车",
|
item.specValues.forEach((spec, specIndex) => {
|
||||||
icon: "none",
|
let name = spec.specName;
|
||||||
});
|
let values = {
|
||||||
|
value: spec.specValue,
|
||||||
|
quantity: item.quantity,
|
||||||
|
skuId: item.skuId
|
||||||
|
};
|
||||||
|
if (name === 'images') {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
this.$emit("queryCart");
|
arr.forEach((arrItem, arrIndex) => {
|
||||||
this.closeMask();
|
if (
|
||||||
}
|
arrItem.name == name &&
|
||||||
});
|
arrItem.values &&
|
||||||
} else {
|
!arrItem.values.find(i => {
|
||||||
// 判断是否拼团商品
|
return i.value === values.value;
|
||||||
if (this.buyType) {
|
})
|
||||||
data.cartType = "PINTUAN";
|
) {
|
||||||
} else if (this.goodsDetail.goodsType == "VIRTUAL_GOODS") {
|
arrItem.values.push(values);
|
||||||
data.cartType = "VIRTUAL";
|
}
|
||||||
} else {
|
|
||||||
data.cartType = "BUY_NOW";
|
|
||||||
}
|
|
||||||
|
|
||||||
API_trade.addToCart(data).then((res) => {
|
let keys = arr.map(key => {
|
||||||
if (res.data.code == 200) {
|
return key.name;
|
||||||
uni.navigateTo({
|
});
|
||||||
url: `/pages/order/fillorder?way=${data.cartType}&addr=${
|
if (!keys.includes(name)) {
|
||||||
this.addr.id || ""
|
arr.push({
|
||||||
}&parentOrder=${encodeURIComponent(
|
name: name,
|
||||||
JSON.stringify(this.parentOrder)
|
values: [values]
|
||||||
)}`,
|
});
|
||||||
});
|
}
|
||||||
}
|
});
|
||||||
});
|
});
|
||||||
}
|
});
|
||||||
},
|
|
||||||
formatSku(list) {
|
|
||||||
// 格式化数据
|
|
||||||
console.log(list);
|
|
||||||
let arr = [{}];
|
|
||||||
list.forEach((item, index) => {
|
|
||||||
item.specValues.forEach((spec, specIndex) => {
|
|
||||||
let name = spec.specName;
|
|
||||||
let values = {
|
|
||||||
value: spec.specValue,
|
|
||||||
quantity: item.quantity,
|
|
||||||
skuId: item.skuId,
|
|
||||||
};
|
|
||||||
if (name === "images") {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
arr.forEach((arrItem, arrIndex) => {
|
arr.shift();
|
||||||
if (
|
this.formatList = arr;
|
||||||
arrItem.name == name &&
|
|
||||||
arrItem.values &&
|
|
||||||
!arrItem.values.find((i) => {
|
|
||||||
return i.value === values.value;
|
|
||||||
})
|
|
||||||
) {
|
|
||||||
arrItem.values.push(values);
|
|
||||||
}
|
|
||||||
|
|
||||||
let keys = arr.map((key) => {
|
list.forEach(item => {
|
||||||
return key.name;
|
// 默认选中
|
||||||
});
|
if (item.skuId === this.goodsDetail.id) {
|
||||||
if (!keys.includes(name)) {
|
item.specValues
|
||||||
console.log(name, values);
|
.filter(i => i.specName !== 'images')
|
||||||
arr.push({
|
.forEach((value, _index) => {
|
||||||
name: name,
|
this.currentSelected[_index] = value.specValue;
|
||||||
values: [values],
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
arr.shift();
|
this.selectName = value.specValue;
|
||||||
this.formatList = arr;
|
|
||||||
|
|
||||||
list.forEach((item) => {
|
this.selectSkuList = {
|
||||||
// 默认选中
|
spec: value,
|
||||||
if (item.skuId === this.goodsDetail.id) {
|
data: this.goodsDetail
|
||||||
item.specValues
|
};
|
||||||
.filter((i) => i.specName !== "images")
|
});
|
||||||
.forEach((value, _index) => {
|
}
|
||||||
this.currentSelceted[_index] = value.specValue;
|
});
|
||||||
|
|
||||||
this.selectName = value.specValue;
|
this.skuList = list;
|
||||||
|
// console.log(" this.skuList", this.skuList)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
this.selectSkuList = {
|
mounted() {
|
||||||
spec: value,
|
this.formatSku(this.goodsSpec);
|
||||||
data: this.goodsDetail,
|
|
||||||
};
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
this.skuList = list;
|
console.log("goodsDetail",this.goodsDetail)
|
||||||
// console.log(" this.skuList", this.skuList)
|
}
|
||||||
},
|
|
||||||
},
|
|
||||||
|
|
||||||
mounted() {
|
|
||||||
this.formatSku(this.goodsSpec);
|
|
||||||
},
|
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
@import "./popup.scss";
|
@import './popup.scss';
|
||||||
|
|
||||||
|
.price-row {
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
.buy {
|
.buy {
|
||||||
background-image: linear-gradient(135deg, #ffba0d, #ffc30d 69%, #ffcf0d);
|
background-image: linear-gradient(135deg, #ffba0d, #ffc30d 69%, #ffcf0d);
|
||||||
box-shadow: 0 2px 6px 0 rgba(255, 65, 66, 0.2);
|
box-shadow: 0 2px 6px 0 rgba(255, 65, 66, 0.2);
|
||||||
}
|
}
|
||||||
|
|
||||||
.card {
|
.card {
|
||||||
background-image: linear-gradient(135deg, #f2140c, #f2270c 70%, #f24d0c);
|
background-image: linear-gradient(135deg, #f2140c, #f2270c 70%, #f24d0c);
|
||||||
box-shadow: 0 2px 6px 0 rgba(255, 65, 66, 0.2);
|
box-shadow: 0 2px 6px 0 rgba(255, 65, 66, 0.2);
|
||||||
}
|
}
|
||||||
|
|
||||||
/deep/.u-icon-plus,
|
::v-deep.u-icon-plus,
|
||||||
.u-icon-minus,
|
.u-icon-minus,
|
||||||
.u-icon-disabled {
|
.u-icon-disabled {
|
||||||
height: 30rpx !important;
|
height: 30rpx !important;
|
||||||
background: #fff !important;
|
background: #fff !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.goods-skus-number {
|
.goods-skus-number {
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|
||||||
|
> .view-class-title {
|
||||||
|
flex: 8;
|
||||||
|
}
|
||||||
|
|
||||||
|
> .view-class-input {
|
||||||
|
flex: 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/deep/ .uni-scroll-view {
|
::v-deep .uni-scroll-view {
|
||||||
overflow: hidden !important;
|
overflow: hidden !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.active {
|
.active {
|
||||||
background: $price-light-color !important;
|
background: $price-light-color !important;
|
||||||
border: 2rpx solid $price-color;
|
border: 2rpx solid $price-color;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
color: $price-color !important;
|
color: $price-color !important;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
}
|
}
|
||||||
|
|
||||||
.goods-skus-box {
|
.goods-skus-box {
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
height: 610rpx;
|
height: 610rpx;
|
||||||
// #ifdef MP-WEIXIN
|
// #ifdef MP-WEIXIN
|
||||||
height: 570rpx;
|
height: 570rpx;
|
||||||
// #endif
|
// #endif
|
||||||
margin-bottom: 10rpx;
|
margin-bottom: 10rpx;
|
||||||
|
}
|
||||||
|
.soldout{
|
||||||
|
margin: 20rpx 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.goods-skus-view {
|
.goods-skus-view {
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
|
||||||
.skus-view-list {
|
.skus-view-list {
|
||||||
> .skus-view-item {
|
> .skus-view-item {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
padding: 0 36rpx;
|
padding: 0 36rpx;
|
||||||
|
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
height: 60rpx;
|
height: 60rpx;
|
||||||
line-height: 60rpx;
|
line-height: 60rpx;
|
||||||
float: left;
|
float: left;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
margin-left: 24rpx;
|
margin-left: 24rpx;
|
||||||
margin-bottom: 20rpx;
|
margin-bottom: 20rpx;
|
||||||
font-size: 22rpx;
|
font-size: 22rpx;
|
||||||
color: #262626;
|
color: #262626;
|
||||||
background: #f2f2f2;
|
background: #f2f2f2;
|
||||||
border-radius: 30rpx;
|
border-radius: 30rpx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.wholesale-item {
|
||||||
|
color: #999 !important;
|
||||||
|
font-size: 24rpx;
|
||||||
|
margin: 0 20rpx;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.goods-header {
|
.goods-header {
|
||||||
height: 200rpx;
|
height: 200rpx;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
margin-bottom: 36rpx;
|
margin-bottom: 36rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.goods-box {
|
.goods-box {
|
||||||
padding: 50rpx 36rpx 0 36rpx;
|
padding: 50rpx 36rpx 0 36rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.goods-skus {
|
.goods-skus {
|
||||||
padding: 0 20rpx;
|
padding: 0 20rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.goods-price {
|
.goods-price {
|
||||||
color: $price-color;
|
color: $price-color;
|
||||||
line-height: 80rpx;
|
line-height: 80rpx;
|
||||||
display: flex;
|
margin-right: 20rpx;
|
||||||
|
|
||||||
|
> * {
|
||||||
|
color: $price-color;
|
||||||
|
line-height: 80rpx;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.promotion-box {
|
.promotion-box {
|
||||||
line-height: 1;
|
line-height: 1;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
text-decoration: line-through;
|
text-decoration: line-through;
|
||||||
color: #999;
|
color: #999;
|
||||||
margin-left: 10rpx;
|
margin-left: 10rpx;
|
||||||
/deep/ span {
|
|
||||||
font-size: 30rpx;
|
::v-deep span {
|
||||||
}
|
font-size: 30rpx;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.promotion {
|
.promotion {
|
||||||
font-size: 30rpx;
|
font-size: 30rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.goods-price-promotionShow {
|
.goods-price-promotionShow {
|
||||||
font-size: 48rpx;
|
font-size: 48rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.goods-check-skus {
|
.goods-check-skus {
|
||||||
font-size: 24rpx;
|
font-size: 24rpx;
|
||||||
color: #999;
|
color: #999;
|
||||||
> .goods-check-skus-name {
|
|
||||||
margin-left: 4rpx;
|
> .goods-check-skus-name {
|
||||||
}
|
margin-left: 4rpx;
|
||||||
> span {
|
}
|
||||||
color: #333;
|
|
||||||
}
|
> span {
|
||||||
|
color: #333;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -180,28 +180,40 @@ export default {
|
|||||||
if (this.tabbars[index].id != item.id) {
|
if (this.tabbars[index].id != item.id) {
|
||||||
this.tabbars[index].localName = item.name;
|
this.tabbars[index].localName = item.name;
|
||||||
this.tabbars[index].id = item.id;
|
this.tabbars[index].id = item.id;
|
||||||
|
this.tabbars[index].center = item.center
|
||||||
if (index < this.tabbars.length - 1) {
|
if (index < this.tabbars.length - 1) {
|
||||||
this.tabbars.splice(index + 1, this.tabbars.length - index - 1);
|
this.tabbars.splice(index + 1, this.tabbars.length - index - 1);
|
||||||
}
|
}
|
||||||
if (this.tabbars.length < this.pickersize) {
|
if (this.tabbars.length < this.pickersize) {
|
||||||
let data = await getRegionsById(item.id);
|
uni.showLoading({
|
||||||
// 当前选项级为最后一级时回调,将选中的数据返回
|
title: "加载中",
|
||||||
if (data.data.result.length == 0) {
|
mask:true
|
||||||
this.$emit("funcValue", this.tabbars);
|
});
|
||||||
this.hide();
|
try {
|
||||||
} else {
|
let data = await getRegionsById(item.id);
|
||||||
// 将新的数据填充进下一级
|
uni.hideLoading();
|
||||||
var current = {
|
// 当前选项级为最后一级时回调,将选中的数据返回
|
||||||
localName: "请选择",
|
if (data.data.result.length == 0) {
|
||||||
id: "",
|
this.$emit("funcValue", this.tabbars);
|
||||||
children: data.data.result,
|
this.hide();
|
||||||
};
|
} else {
|
||||||
this.tabbars.push(current);
|
// 将新的数据填充进下一级
|
||||||
this.tabCurrentIndex++;
|
var current = {
|
||||||
|
localName: "请选择",
|
||||||
|
id: "",
|
||||||
|
children: data.data.result,
|
||||||
|
|
||||||
|
};
|
||||||
|
this.tabbars.push(current);
|
||||||
|
this.tabCurrentIndex++;
|
||||||
|
|
||||||
// 当前距离重新为最上面
|
// 当前距离重新为最上面
|
||||||
this.scrollTop = 0;
|
this.$set(this,'scrollTop',0)
|
||||||
}
|
}
|
||||||
|
} catch (error) {
|
||||||
|
uni.hideLoading();
|
||||||
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
this.$emit("funcValue", this.tabbars);
|
this.$emit("funcValue", this.tabbars);
|
||||||
this.hide();
|
this.hide();
|
||||||
@@ -387,4 +399,4 @@ export default {
|
|||||||
icon {
|
icon {
|
||||||
margin-left: 40rpx;
|
margin-left: 40rpx;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
11
components/m-goods-list/README.md
Normal file
11
components/m-goods-list/README.md
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
## 商品列表展示
|
||||||
|
|
||||||
|
### OBJECT 参数说明
|
||||||
|
|
||||||
|
| 属性 | 说明 | 类型 | 必填 |
|
||||||
|
| ----------- | ---------------------------------------------------------- | ------- | ---- |
|
||||||
|
| `res` | 显示数据 | Array | 是 |
|
||||||
|
| `type` | 商品展示类型 oneColumns twoColumns ,默认展示一行两列商品 | String | 否 |
|
||||||
|
| `storeName` | 是否展示店铺名称,默认展示 | Boolean | 否 |
|
||||||
|
| `keywords` | 高亮展示搜索内容 | String | 否 |
|
||||||
|
|
||||||
277
components/m-goods-list/base-list.vue
Normal file
277
components/m-goods-list/base-list.vue
Normal file
@@ -0,0 +1,277 @@
|
|||||||
|
<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="aspectFit"
|
||||||
|
>
|
||||||
|
<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"
|
||||||
|
mode="aspectFit"
|
||||||
|
: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;
|
||||||
|
|
||||||
|
::v-deep span:nth-of-type(1) {
|
||||||
|
font-size: 38rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
69
components/m-goods-list/common.vue
Normal file
69
components/m-goods-list/common.vue
Normal file
@@ -0,0 +1,69 @@
|
|||||||
|
<template>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
methods: {
|
||||||
|
// 高亮显示搜索内容
|
||||||
|
lightSearchStr(keyword, str) {
|
||||||
|
if (!keyword) {
|
||||||
|
return str
|
||||||
|
} else {
|
||||||
|
let unicodes = '';
|
||||||
|
for (let i of Array.from(keyword)) {
|
||||||
|
unicodes += this.unicode(i) + "|"
|
||||||
|
}
|
||||||
|
const rule = '(' + unicodes + ')'
|
||||||
|
const reg = new RegExp(rule, 'gi');
|
||||||
|
return str ? str.replace(reg, matchValue =>
|
||||||
|
`<span style="color:${this.lightColor}">${matchValue}</span>`
|
||||||
|
) : ''
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 转换为unicode
|
||||||
|
unicode(str) {
|
||||||
|
var value = '';
|
||||||
|
for (var i = 0; i < str.length; i++) {
|
||||||
|
value += '\\u' + this.left_zero_4(parseInt(str.charCodeAt(i)).toString(16));
|
||||||
|
}
|
||||||
|
return value;
|
||||||
|
},
|
||||||
|
left_zero_4(str) {
|
||||||
|
if (str != null && str != '' && str != 'undefined') {
|
||||||
|
if (str.length == 2) {
|
||||||
|
return '00' + str;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return str;
|
||||||
|
},
|
||||||
|
// 数据去重一下 只显示一次 减免 劵 什么的
|
||||||
|
getPromotion(item) {
|
||||||
|
if (item.promotionMap) {
|
||||||
|
let array = [];
|
||||||
|
Object.keys(item.promotionMap).forEach((child) => {
|
||||||
|
if (!array.includes(child.split("-")[0])) {
|
||||||
|
array.push(child.split("-")[0]);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return array;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 跳转到商品详情
|
||||||
|
navigateToDetailPage(item) {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: `/pages/product/goods?id=${item.id}&goodsId=${item.goodsId}`,
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 跳转地址
|
||||||
|
navigateToStoreDetailPage(item) {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: `/pages/product/shopPage?id=${item.storeId}`,
|
||||||
|
});
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang='scss' scoped>
|
||||||
|
|
||||||
|
</style>
|
||||||
341
components/m-goods-list/list.vue
Normal file
341
components/m-goods-list/list.vue
Normal file
@@ -0,0 +1,341 @@
|
|||||||
|
<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.thumbnail" width="100%" height='330rpx' mode="aspectFit">
|
||||||
|
<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="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 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'" class="goods-one-row">
|
||||||
|
<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" mode="aspectFit" border-radius='16' height="230rpx" :src="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 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.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 ? item.promotionMap : item.promotionMap) {
|
||||||
|
const fieldList = item ? item.promotionMap : item.promotionMap
|
||||||
|
let array = [];
|
||||||
|
Object.keys(fieldList).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.id}&goodsId=${item.goodsId}`,
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 跳转地址
|
||||||
|
navigateToStoreDetailPage(item) {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: `/pages/product/shopPage?id=${item.storeId}`,
|
||||||
|
});
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang='scss' scoped>
|
||||||
|
.goods-one-row{
|
||||||
|
padding-bottom: 250rpx;
|
||||||
|
}
|
||||||
|
/* 商品列表 */
|
||||||
|
.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;
|
||||||
|
|
||||||
|
::v-deep span:nth-of-type(1) {
|
||||||
|
font-size: 38rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
</style>
|
||||||
170
components/m-goods-list/promotion.vue
Normal file
170
components/m-goods-list/promotion.vue
Normal file
@@ -0,0 +1,170 @@
|
|||||||
|
<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" mode="aspectFit" 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>
|
||||||
|
<!-- 兜底策略如果金额是0 -->
|
||||||
|
<div class="price" v-if="!item.price && !type">
|
||||||
|
¥<span>0 </span>.00
|
||||||
|
</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;
|
||||||
|
|
||||||
|
::v-deep span:nth-of-type(1) {
|
||||||
|
font-size: 48rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -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();
|
||||||
},
|
},
|
||||||
@@ -74,11 +59,11 @@ export default {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
let goodsList = await getGoodsList(submit);
|
let goodsList = await getGoodsList(submit);
|
||||||
this.goodsList.push(...goodsList.data.result.content);
|
this.goodsList.push(...goodsList.data.result.records);
|
||||||
},
|
},
|
||||||
handleClick(item) {
|
handleClick(item) {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: `/pages/product/goods?id=${item.content.id}&goodsId=${item.content.goodsId}`,
|
url: `/pages/product/goods?id=${item.id}&goodsId=${item.goodsId}`,
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
225
components/m-placard/index.vue
Normal file
225
components/m-placard/index.vue
Normal file
@@ -0,0 +1,225 @@
|
|||||||
|
<template>
|
||||||
|
<div class="index">
|
||||||
|
<view v-model="show" class="slot-content">
|
||||||
|
<image @click="downLoad()" class="img" :src="imgUrl" />
|
||||||
|
<div class="canvas-hide">
|
||||||
|
<!-- #ifdef MP-WEIXIN -->
|
||||||
|
<canvas id="canvas" type="2d" style="width: 560px; height: 800px" />
|
||||||
|
<!-- #endif -->
|
||||||
|
<!-- #ifndef MP-WEIXIN -->
|
||||||
|
<canvas canvas-id="canvas" id="canvas" style="width: 560px; height: 800px" />
|
||||||
|
<!-- #endif -->
|
||||||
|
</div>
|
||||||
|
</view>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
// 引入绘制插件
|
||||||
|
import DrawPoster from "@/js_sdk/u-draw-poster";
|
||||||
|
// 生成二维码
|
||||||
|
import uQRCode from '@/components/Sansnn-uQRCode/uqrcode.js';
|
||||||
|
|
||||||
|
export default {
|
||||||
|
data: () => ({
|
||||||
|
imgUrl: "", //绘制出来的图片路径
|
||||||
|
show: false, //是否展示模态框
|
||||||
|
dp: {}, //绘制的dp对象,用于存储绘制等一些方法。
|
||||||
|
logo: require("@/pages/passport/static/logo-title.png"), // 本地logo地址
|
||||||
|
myFace: require("@/pages/passport/static/missing-face.png"), // 本地默认头像
|
||||||
|
sharingLink: '', // 二维码链接
|
||||||
|
}),
|
||||||
|
props: {
|
||||||
|
/**
|
||||||
|
* 父级传参的数据
|
||||||
|
*/
|
||||||
|
res: {
|
||||||
|
type: null,
|
||||||
|
default: "",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
onUnload() {},
|
||||||
|
onReady() {},
|
||||||
|
methods: {
|
||||||
|
/** 解决微信小程序中图片模糊问题 */
|
||||||
|
// #ifdef MP-WEIXIN
|
||||||
|
st2: (size) => size * 2,
|
||||||
|
// #endif
|
||||||
|
|
||||||
|
// #ifndef MP-WEIXIN
|
||||||
|
st2: (size) => size,
|
||||||
|
// #endif
|
||||||
|
|
||||||
|
/** 保存图片 */
|
||||||
|
downLoad() {
|
||||||
|
uni.saveImageToPhotosAlbum({
|
||||||
|
filePath: this.imgUrl,
|
||||||
|
success: function () {
|
||||||
|
uni.showToast({title: "保存成功!",icon: "none",});
|
||||||
|
},
|
||||||
|
fail: function () {
|
||||||
|
uni.showToast({title: "保存失败,请稍后重试!",icon: "none",});
|
||||||
|
},
|
||||||
|
});
|
||||||
|
},
|
||||||
|
/** 创建canvas */
|
||||||
|
async init() {
|
||||||
|
this.show = true;
|
||||||
|
this.dp = await DrawPoster.build({
|
||||||
|
selector: "canvas",
|
||||||
|
componentThis: this,
|
||||||
|
loading: true,
|
||||||
|
debugging: true,
|
||||||
|
});
|
||||||
|
let dp = this.dp;
|
||||||
|
// #ifdef MP-WEIXIN
|
||||||
|
// 用于微信小程序中画布错乱问题
|
||||||
|
dp.canvas.width = this.st2(560);
|
||||||
|
dp.canvas.height = this.st2(800);
|
||||||
|
// #endif
|
||||||
|
this.showQRCode(dp);
|
||||||
|
},
|
||||||
|
/** 生成二维码 */
|
||||||
|
async showQRCode(dp){
|
||||||
|
await uQRCode.make({
|
||||||
|
canvasId: 'canvas', // canvas画布
|
||||||
|
componentInstance: this,
|
||||||
|
text: this.res.bottom.code, // 二维码内容
|
||||||
|
size: 130, // 二维码大小
|
||||||
|
margin: 5, // 二维码内边距
|
||||||
|
backgroundColor: '#ffffff', // ! 二维码背景颜色
|
||||||
|
foregroundColor: '#000000', // !二维码色块颜色
|
||||||
|
fileType: 'jpg',
|
||||||
|
errorCorrectLevel: 0, // <== 关键 容错率,M:0,L:1,H:2,Q:3,
|
||||||
|
// errorCorrectLevel: uQRCode.errorCorrectLevel.M, // <== 关键 容错率,M:0,L:1,H:2,Q:3,
|
||||||
|
success: res => {
|
||||||
|
this.sharingLink = res; // res => 图片路径
|
||||||
|
// 对画布进行绘制
|
||||||
|
this.draw(dp);
|
||||||
|
},
|
||||||
|
fail: res => {
|
||||||
|
// console.log('失败',res)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
async draw(dp) {
|
||||||
|
const { face, nickName, desc } = this.res.memberInfo;
|
||||||
|
const { width, height, background, title } = this.res.container;
|
||||||
|
const { code, img, price } = this.res.bottom;
|
||||||
|
|
||||||
|
/** 绘制背景 */
|
||||||
|
await dp.draw((ctx) => {
|
||||||
|
ctx.fillStyle = background;
|
||||||
|
ctx.fillRoundRect( this.st2(0), this.st2(0), this.st2(width), this.st2(height), this.st2(12));
|
||||||
|
ctx.clip();
|
||||||
|
});
|
||||||
|
/** 绘制圆角矩形 */
|
||||||
|
await dp.draw(async (ctx)=>{
|
||||||
|
// 设置矩形色彩
|
||||||
|
ctx.fillStyle = "#ffffff";
|
||||||
|
// 设置图形轮廓的颜色。默认情况下,线条和填充颜色都是黑色(CSS 颜色值 #000000)
|
||||||
|
ctx.strokeStyle = "#ffffff";
|
||||||
|
// 这个属性设置当前绘线的粗细。属性值必须为正数。描述线段宽度的数字。 0、 负数、 Infinity 和 NaN 会被忽略。默认值是1.0。
|
||||||
|
ctx.lineWidth = this.st2(1);
|
||||||
|
// 进行绘制
|
||||||
|
ctx.fillRoundRect(30, 150, 500, 620, 0);
|
||||||
|
// ctx.strokeRoundRect(30, 150, 500, 620, 0);
|
||||||
|
// ctx.strokeRect(30, 150, 500, 620, 0);
|
||||||
|
})
|
||||||
|
/** 绘制图片 */
|
||||||
|
dp.draw(async (ctx) => {
|
||||||
|
await Promise.all([
|
||||||
|
// 绘制头像face
|
||||||
|
ctx.drawImage(face?face:this.myFace, this.st2(30), this.st2(30), this.st2(90), this.st2(90)),
|
||||||
|
// 绘制Logo
|
||||||
|
// ctx.drawImage( this.logo, this.st2(175), this.st2(0), this.st2(256), this.st2(144)),
|
||||||
|
// 中间图片
|
||||||
|
ctx.drawImage(img, this.st2(60), this.st2(170), this.st2(440), this.st2(440)),
|
||||||
|
// 二维码
|
||||||
|
ctx.drawImage(this.sharingLink, this.st2(375), this.st2(625), this.st2(130), this.st2(130))
|
||||||
|
]);
|
||||||
|
});
|
||||||
|
/** 绘制顶部文字(昵称 简述) */
|
||||||
|
await dp.draw((ctx) => {
|
||||||
|
ctx.fillStyle = "#666";
|
||||||
|
ctx.font = `${this.st2(24)}px PingFang SC`;
|
||||||
|
ctx.fillText(nickName, this.st2(150), this.st2(65));
|
||||||
|
ctx.fillStyle = "#666";
|
||||||
|
ctx.font = `${this.st2(24)}px PingFang SC`;
|
||||||
|
ctx.fillText(desc, this.st2(150), this.st2(105));
|
||||||
|
});
|
||||||
|
/** 绘制中间文字(商品名称 价格) */
|
||||||
|
await dp.draw((ctx) => {
|
||||||
|
ctx.fillStyle = "#333";
|
||||||
|
ctx.font = `bold ${this.st2(24)}px PingFang SC`;
|
||||||
|
ctx.textAlign = "left";
|
||||||
|
ctx.fillWarpText({
|
||||||
|
text: title,
|
||||||
|
lineHeight: this.st2(32),
|
||||||
|
maxWidth: this.st2(280),
|
||||||
|
x: this.st2(60),
|
||||||
|
y: this.st2(710),
|
||||||
|
layer: 2,
|
||||||
|
});
|
||||||
|
ctx.fillStyle = "#ff3c2a";
|
||||||
|
ctx.font = `${this.st2(38)}px PingFang SC`;
|
||||||
|
ctx.textAlign = "left";
|
||||||
|
ctx.fillText(price, this.st2(60), this.st2(665));
|
||||||
|
});
|
||||||
|
/** 绘制底部文字 */
|
||||||
|
// await dp.draw((ctx) => {
|
||||||
|
// ctx.fillStyle = "#666";
|
||||||
|
// ctx.font = `${this.st2(24)}px PingFang SC`;
|
||||||
|
// ctx.fillText("长按图片,识别二维码", this.st2(200), this.st2(866));
|
||||||
|
// ctx.fillStyle = "#666";
|
||||||
|
// ctx.font = `${this.st2(24)}px PingFang SC`;
|
||||||
|
// ctx.fillText("查看商品详情", this.st2(200), this.st2(900));
|
||||||
|
// });
|
||||||
|
|
||||||
|
// 绘制生成本地地址
|
||||||
|
this.imgUrl = await dp.createImagePath();
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
async mounted() {
|
||||||
|
this.init();
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
page,
|
||||||
|
.index {
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
.canvas-hide {
|
||||||
|
/* 1 */
|
||||||
|
position: fixed;
|
||||||
|
right: 100vw;
|
||||||
|
bottom: 100vh;
|
||||||
|
/* 2 */
|
||||||
|
z-index: -9999;
|
||||||
|
/* 3 */
|
||||||
|
opacity: 0;
|
||||||
|
}
|
||||||
|
.index {
|
||||||
|
position: relative;
|
||||||
|
text-align: center;
|
||||||
|
background: rgba($color: grey, $alpha: 0.2);
|
||||||
|
}
|
||||||
|
|
||||||
|
image {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
.img {
|
||||||
|
width: 560rpx;
|
||||||
|
height: 800rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.qrcode-content {
|
||||||
|
width: 100rpx;
|
||||||
|
height: 100rpx;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -121,7 +121,15 @@ export default {
|
|||||||
* 回退到上一级
|
* 回退到上一级
|
||||||
*/
|
*/
|
||||||
onClickLeft() {
|
onClickLeft() {
|
||||||
uni.navigateBack();
|
const paths = getCurrentPages();
|
||||||
|
console.log(paths)
|
||||||
|
if(paths.length > 1){
|
||||||
|
uni.navigateBack();
|
||||||
|
}else{
|
||||||
|
uni.switchTab({
|
||||||
|
url:"/pages/tabbar/home/index"
|
||||||
|
})
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -156,7 +164,7 @@ export default {
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
//border-bottom: 1px #f5f5f5 solid; //HM修改 去掉边框
|
//border-bottom: 1px #f5f5f5 solid; //HM修改 去掉边框
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
font-size: $uni-font-size-base;
|
font-size: 24rpx;
|
||||||
|
|
||||||
.left-box {
|
.left-box {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|||||||
@@ -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() {
|
||||||
@@ -73,33 +83,20 @@ export default {
|
|||||||
this.configs.shareLink +
|
this.configs.shareLink +
|
||||||
getCurrentPages()[getCurrentPages().length - 1].__page__.fullPath;
|
getCurrentPages()[getCurrentPages().length - 1].__page__.fullPath;
|
||||||
}
|
}
|
||||||
if (content === null || content === undefined) {
|
this.$options.filters.setClipboard(content)
|
||||||
content = "";
|
|
||||||
} else content = content + "";
|
|
||||||
const result = h5Copy(content);
|
|
||||||
if (result === false) {
|
|
||||||
uni.showToast({
|
|
||||||
title: "不支持",
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
uni.showToast({
|
|
||||||
title: "复制成功",
|
|
||||||
icon: "none",
|
|
||||||
});
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
// #endif
|
// #endif
|
||||||
|
|
||||||
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;
|
||||||
},
|
},
|
||||||
|
|||||||
34
components/m-take-down-sale-goods/index.vue
Normal file
34
components/m-take-down-sale-goods/index.vue
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<u-popup v-model="show" mode="bottom" height="800rpx" border-radius="14">
|
||||||
|
<div class="wrapper">
|
||||||
|
<view class="down-goods-tips">该商品已下架</view>
|
||||||
|
<scroll-view scroll-y="true" style="height: 670rpx">
|
||||||
|
<goodsRecommend title="其他商品" />
|
||||||
|
</scroll-view>
|
||||||
|
</div>
|
||||||
|
</u-popup>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import goodsRecommend from "@/components/m-goods-recommend/index.vue";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
show: true, // 是否显示
|
||||||
|
};
|
||||||
|
},
|
||||||
|
components: { goodsRecommend },
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.down-goods-tips {
|
||||||
|
font-size: 36rpx;
|
||||||
|
text-align: center;
|
||||||
|
font-weight: bold;
|
||||||
|
padding: 40rpx 0;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
220
components/uni-number-box.vue
Normal file
220
components/uni-number-box.vue
Normal file
@@ -0,0 +1,220 @@
|
|||||||
|
<template>
|
||||||
|
<view class="uni-numbox">
|
||||||
|
<view @click="_calcValue('minus')" class="uni-numbox__minus uni-numbox-btns" :style="{background}">
|
||||||
|
<text class="uni-numbox--text" :class="{ 'uni-numbox--disabled': inputValue <= min || disabled }" :style="{color}">-</text>
|
||||||
|
</view>
|
||||||
|
<input :disabled="disabled" @focus="_onFocus" @blur="_onBlur" class="uni-numbox__value" type="number"
|
||||||
|
v-model="inputValue" :style="{background, color}" />
|
||||||
|
<view @click="_calcValue('plus')" class="uni-numbox__plus uni-numbox-btns" :style="{background}">
|
||||||
|
<text class="uni-numbox--text" :class="{ 'uni-numbox--disabled': inputValue >= max || disabled }" :style="{color}">+</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
/**
|
||||||
|
* NumberBox 数字输入框
|
||||||
|
* @description 带加减按钮的数字输入框
|
||||||
|
* @tutorial https://ext.dcloud.net.cn/plugin?id=31
|
||||||
|
* @property {Number} value 输入框当前值
|
||||||
|
* @property {Number} min 最小值
|
||||||
|
* @property {Number} max 最大值
|
||||||
|
* @property {Number} step 每次点击改变的间隔大小
|
||||||
|
* @property {String} background 背景色
|
||||||
|
* @property {String} color 字体颜色(前景色)
|
||||||
|
* @property {Boolean} disabled = [true|false] 是否为禁用状态
|
||||||
|
* @event {Function} change 输入框值改变时触发的事件,参数为输入框当前的 value
|
||||||
|
* @event {Function} focus 输入框聚焦时触发的事件,参数为 event 对象
|
||||||
|
* @event {Function} blur 输入框失焦时触发的事件,参数为 event 对象
|
||||||
|
*/
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: "UniNumberBox",
|
||||||
|
emits: ['change', 'input', 'update:modelValue', 'blur', 'focus'],
|
||||||
|
props: {
|
||||||
|
value: {
|
||||||
|
type: [Number, String],
|
||||||
|
default: 1
|
||||||
|
},
|
||||||
|
modelValue: {
|
||||||
|
type: [Number, String],
|
||||||
|
default: 1
|
||||||
|
},
|
||||||
|
min: {
|
||||||
|
type: Number,
|
||||||
|
default: 0
|
||||||
|
},
|
||||||
|
max: {
|
||||||
|
type: Number,
|
||||||
|
default: 100
|
||||||
|
},
|
||||||
|
step: {
|
||||||
|
type: Number,
|
||||||
|
default: 1
|
||||||
|
},
|
||||||
|
background: {
|
||||||
|
type: String,
|
||||||
|
default: '#f5f5f5'
|
||||||
|
},
|
||||||
|
color: {
|
||||||
|
type: String,
|
||||||
|
default: '#333'
|
||||||
|
},
|
||||||
|
disabled: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
inputValue: 0
|
||||||
|
};
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
value(val) {
|
||||||
|
this.inputValue = +val;
|
||||||
|
},
|
||||||
|
modelValue(val) {
|
||||||
|
this.inputValue = +val;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
if (this.value === 1) {
|
||||||
|
this.inputValue = +this.modelValue;
|
||||||
|
}
|
||||||
|
if (this.modelValue === 1) {
|
||||||
|
this.inputValue = +this.value;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
_calcValue(type) {
|
||||||
|
if (this.disabled) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const scale = this._getDecimalScale();
|
||||||
|
let value = this.inputValue * scale;
|
||||||
|
let step = this.step * scale;
|
||||||
|
if (type === "minus") {
|
||||||
|
value -= step;
|
||||||
|
if (value < (this.min * scale)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (value > (this.max * scale)) {
|
||||||
|
value = this.max * scale
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (type === "plus") {
|
||||||
|
value += step;
|
||||||
|
if (value > (this.max * scale)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (value < (this.min * scale)) {
|
||||||
|
value = this.min * scale
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
this.inputValue = (value / scale).toFixed(String(scale).length - 1);
|
||||||
|
this.$emit("change", +this.inputValue);
|
||||||
|
// TODO vue2 兼容
|
||||||
|
this.$emit("input", +this.inputValue);
|
||||||
|
// TODO vue3 兼容
|
||||||
|
this.$emit("update:modelValue", +this.inputValue);
|
||||||
|
},
|
||||||
|
_getDecimalScale() {
|
||||||
|
|
||||||
|
let scale = 1;
|
||||||
|
// 浮点型
|
||||||
|
if (~~this.step !== this.step) {
|
||||||
|
scale = Math.pow(10, String(this.step).split(".")[1].length);
|
||||||
|
}
|
||||||
|
return scale;
|
||||||
|
},
|
||||||
|
_onBlur(event) {
|
||||||
|
this.$emit('blur', event)
|
||||||
|
let value = event.detail.value;
|
||||||
|
if (!value) {
|
||||||
|
// this.inputValue = 0;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
value = +value;
|
||||||
|
if (value > this.max) {
|
||||||
|
value = this.max;
|
||||||
|
} else if (value < this.min) {
|
||||||
|
value = this.min;
|
||||||
|
}
|
||||||
|
const scale = this._getDecimalScale();
|
||||||
|
this.inputValue = value.toFixed(String(scale).length - 1);
|
||||||
|
this.$emit("change", +this.inputValue);
|
||||||
|
this.$emit("input", +this.inputValue);
|
||||||
|
},
|
||||||
|
_onFocus(event) {
|
||||||
|
this.$emit('focus', event)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
$box-height: 48rpx;
|
||||||
|
$bg: #f5f5f5;
|
||||||
|
$br: 4rpx;
|
||||||
|
$color: #333;
|
||||||
|
|
||||||
|
.uni-numbox {
|
||||||
|
/* #ifndef APP-NVUE */
|
||||||
|
display: flex;
|
||||||
|
/* #endif */
|
||||||
|
flex-direction: row;
|
||||||
|
}
|
||||||
|
|
||||||
|
.uni-numbox-btns {
|
||||||
|
/* #ifndef APP-NVUE */
|
||||||
|
display: flex;
|
||||||
|
/* #endif */
|
||||||
|
flex-direction: row;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
padding: 0 8px;
|
||||||
|
background-color: $bg;
|
||||||
|
/* #ifdef H5 */
|
||||||
|
cursor: pointer;
|
||||||
|
/* #endif */
|
||||||
|
}
|
||||||
|
|
||||||
|
.uni-numbox__value {
|
||||||
|
margin: 0 4rpx;
|
||||||
|
background-color: $bg;
|
||||||
|
width: 70rpx;
|
||||||
|
height: $box-height;
|
||||||
|
text-align: center;
|
||||||
|
font-size: 24rpx;
|
||||||
|
border-left-width: 0;
|
||||||
|
border-right-width: 0;
|
||||||
|
color: $color;
|
||||||
|
}
|
||||||
|
|
||||||
|
.uni-numbox__minus {
|
||||||
|
border-top-left-radius: $br;
|
||||||
|
border-bottom-left-radius: $br;
|
||||||
|
}
|
||||||
|
|
||||||
|
.uni-numbox__plus {
|
||||||
|
border-top-right-radius: $br;
|
||||||
|
border-bottom-right-radius: $br;
|
||||||
|
}
|
||||||
|
|
||||||
|
.uni-numbox--text {
|
||||||
|
// fix nvue
|
||||||
|
line-height: 40rpx;
|
||||||
|
|
||||||
|
font-size: 40rpx;
|
||||||
|
font-weight: 300;
|
||||||
|
color: $color;
|
||||||
|
}
|
||||||
|
|
||||||
|
.uni-numbox .uni-numbox--disabled {
|
||||||
|
color: #c0c0c0 !important;
|
||||||
|
/* #ifdef H5 */
|
||||||
|
cursor: not-allowed;
|
||||||
|
/* #endif */
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -29,7 +29,8 @@ export default {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
fail() {
|
fail(e) {
|
||||||
|
console.log(e)
|
||||||
that.$emit("close");
|
that.$emit("close");
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
@@ -1,39 +1,87 @@
|
|||||||
<template>
|
<template>
|
||||||
<view>
|
<view>
|
||||||
<view v-if="!hid" class="flex-row-center" :style="{ top: scHight }" style="width: 750rpx; position: fixed; z-index: 100; left: 0">
|
<view
|
||||||
<view class="flex-column-center" style="background-color: #fcfcfc; padding: 30rpx; border-radius: 10rpx">
|
v-if="!hid"
|
||||||
<movable-area class="flex" style="width: 100%" animation="false" :style="{ height: originalHeight }">
|
class="flex-row-center"
|
||||||
<movable-view scale-value="1" animation="false" damping="5000" :x="moveX" :style="{
|
:style="{ top: scHight }"
|
||||||
|
style="width: 750rpx; position: fixed; z-index: 100; left: 0"
|
||||||
|
>
|
||||||
|
<view
|
||||||
|
class="flex-column-center"
|
||||||
|
style="background-color: #fcfcfc; padding: 30rpx; border-radius: 10rpx"
|
||||||
|
>
|
||||||
|
<movable-area
|
||||||
|
class="flex"
|
||||||
|
style="width: 100%"
|
||||||
|
animation="false"
|
||||||
|
:style="{ height: originalHeight }"
|
||||||
|
>
|
||||||
|
<movable-view
|
||||||
|
scale-value="1"
|
||||||
|
animation="false"
|
||||||
|
damping="5000"
|
||||||
|
:x="moveX"
|
||||||
|
:style="{
|
||||||
height: sliderHeight,
|
height: sliderHeight,
|
||||||
width: sliderWidth,
|
width: sliderWidth,
|
||||||
'z-index': 101,
|
'z-index': 101,
|
||||||
}" direction="horizontal">
|
}"
|
||||||
<image :src="imgbk" class="image" mode="aspectFit" :style="{
|
direction="horizontal"
|
||||||
|
>
|
||||||
|
<image
|
||||||
|
:src="imgbk"
|
||||||
|
class="image"
|
||||||
|
mode="aspectFit"
|
||||||
|
:style="{
|
||||||
height: sliderHeight,
|
height: sliderHeight,
|
||||||
width: sliderWidth,
|
width: sliderWidth,
|
||||||
'margin-top': imgbKH,
|
'margin-top': imgbKH,
|
||||||
}"></image>
|
}"
|
||||||
|
></image>
|
||||||
</movable-view>
|
</movable-view>
|
||||||
<image :src="img" mode="aspectFit" :style="{ height: originalHeight, width: originalWidth }" style="border-radius: 10rpx"></image>
|
<image
|
||||||
|
:src="img"
|
||||||
|
mode="aspectFit"
|
||||||
|
:style="{ height: originalHeight, width: originalWidth }"
|
||||||
|
style="border-radius: 10rpx"
|
||||||
|
></image>
|
||||||
</movable-area>
|
</movable-area>
|
||||||
|
|
||||||
<movable-area class="flex-row-start" style="
|
<movable-area
|
||||||
|
class="flex-row-start"
|
||||||
|
style="
|
||||||
width: 100%;
|
width: 100%;
|
||||||
background-color: #efefef;
|
background-color: #efefef;
|
||||||
height: 80rpx;
|
height: 80rpx;
|
||||||
border-radius: 40rpx;
|
border-radius: 40rpx;
|
||||||
margin-top: 30rpx;
|
margin-top: 30rpx;
|
||||||
">
|
"
|
||||||
<movable-view scale-value="1" animation="false" damping="50" :x="movePv" class="flex-row-center" style="
|
>
|
||||||
|
<movable-view
|
||||||
|
scale-value="1"
|
||||||
|
animation="false"
|
||||||
|
damping="50"
|
||||||
|
:x="movePv"
|
||||||
|
class="flex-row-center"
|
||||||
|
style="
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
height: 100rpx;
|
height: 100rpx;
|
||||||
width: 100rpx;
|
width: 100rpx;
|
||||||
background-color: #ffffff;
|
background-color: #ffffff;
|
||||||
border: 2rpx solid #e3e3e3;
|
border: 2rpx solid #e3e3e3;
|
||||||
margin-top: -13rpx;
|
margin-top: -13rpx;
|
||||||
" direction="horizontal" @change="moveChange" @touchend="end">
|
"
|
||||||
<view :class="endLoad ? 'cuIcon-right' : 'cuIcon-loading turn-load'" class="loadIcon" style="">
|
direction="horizontal"
|
||||||
</view>
|
@change="moveChange"
|
||||||
|
@touchend="end"
|
||||||
|
>
|
||||||
|
<u-icon
|
||||||
|
:color="mainColor"
|
||||||
|
size="40"
|
||||||
|
v-if="endLoad"
|
||||||
|
name="arrow-right"
|
||||||
|
></u-icon>
|
||||||
|
<u-icon :color="mainColor" size="40" v-else name="reload"></u-icon>
|
||||||
</movable-view>
|
</movable-view>
|
||||||
|
|
||||||
<text style="padding-left: 140rpx" :style="{ color: col }">{{
|
<text style="padding-left: 140rpx" :style="{ color: col }">{{
|
||||||
@@ -41,15 +89,20 @@
|
|||||||
}}</text>
|
}}</text>
|
||||||
</movable-area>
|
</movable-area>
|
||||||
<view class="flex-row-around padding-top" style="width: 100%">
|
<view class="flex-row-around padding-top" style="width: 100%">
|
||||||
<view @click="hide" class="cuIcon-close" style="font-size: 50rpx; color: #e25915">
|
<u-icon
|
||||||
</view>
|
@click="hide"
|
||||||
|
:color="mainColor"
|
||||||
|
size="40"
|
||||||
|
name="close"
|
||||||
|
></u-icon>
|
||||||
|
|
||||||
<text class="cu-tag bg-cyan round" @click="getCode">刷新拼图</text>
|
<text class="cu-tag round" @click="getCode">刷新拼图</text>
|
||||||
<text class="my-neirong-sm cuIcon-safe" style="color: #c1c1c1">Lili-FRAMEWORK</text>
|
<text class="my-neirong-sm cuIcon-safe" style="color: #c1c1c1"
|
||||||
|
>Lili-FRAMEWORK</text
|
||||||
|
>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -90,6 +143,7 @@ export default {
|
|||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
mainColor: this.$mainColor,
|
||||||
flage: false,
|
flage: false,
|
||||||
key: "", //key
|
key: "", //key
|
||||||
vsrtx: "点击进行验证", //按钮提示语
|
vsrtx: "点击进行验证", //按钮提示语
|
||||||
@@ -144,7 +198,7 @@ export default {
|
|||||||
storage.setUuid(uuid.v1());
|
storage.setUuid(uuid.v1());
|
||||||
}
|
}
|
||||||
uni.request({
|
uni.request({
|
||||||
url: api.common + "/slider/" + this.business,
|
url: api.common + "/common/slider/" + this.business,
|
||||||
header: {
|
header: {
|
||||||
uuid: storage.getUuid(),
|
uuid: storage.getUuid(),
|
||||||
},
|
},
|
||||||
@@ -179,7 +233,7 @@ export default {
|
|||||||
method: "POST",
|
method: "POST",
|
||||||
url:
|
url:
|
||||||
api.common +
|
api.common +
|
||||||
"/slider/" +
|
"/common/slider/" +
|
||||||
this.business +
|
this.business +
|
||||||
"?xPos=" +
|
"?xPos=" +
|
||||||
parseInt(this.moveCode * this.tl),
|
parseInt(this.moveCode * this.tl),
|
||||||
@@ -252,10 +306,6 @@ export default {
|
|||||||
.border-index {
|
.border-index {
|
||||||
border: 1rpx solid $main-color;
|
border: 1rpx solid $main-color;
|
||||||
}
|
}
|
||||||
.loadIcon {
|
|
||||||
color: $main-color;
|
|
||||||
font-size: 40rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.status_bar {
|
.status_bar {
|
||||||
height: var(--status-bar-height);
|
height: var(--status-bar-height);
|
||||||
|
|||||||
@@ -4,12 +4,16 @@
|
|||||||
*/
|
*/
|
||||||
// 开发环境
|
// 开发环境
|
||||||
const dev = {
|
const dev = {
|
||||||
|
im: "https://im-api.pickmall.cn",
|
||||||
common: "https://common-api.pickmall.cn",
|
common: "https://common-api.pickmall.cn",
|
||||||
buyer: "https://buyer-api.pickmall.cn",
|
buyer: "https://buyer-api.pickmall.cn",
|
||||||
|
// common: "http://192.168.0.113:8890",
|
||||||
|
// buyer: "http://192.168.0.113:8888",
|
||||||
|
// im: "http://192.168.0.113:8885",
|
||||||
};
|
};
|
||||||
// 生产环境
|
// 生产环境
|
||||||
const prod = {
|
const prod = {
|
||||||
|
im: "https://im-api.pickmall.cn",
|
||||||
common: "https://common-api.pickmall.cn",
|
common: "https://common-api.pickmall.cn",
|
||||||
buyer: "https://buyer-api.pickmall.cn",
|
buyer: "https://buyer-api.pickmall.cn",
|
||||||
};
|
};
|
||||||
@@ -29,6 +33,7 @@ api = prod;
|
|||||||
|
|
||||||
api.buyer += "/buyer";
|
api.buyer += "/buyer";
|
||||||
api.common += "/common";
|
api.common += "/common";
|
||||||
|
api.im += "/im";
|
||||||
export default {
|
export default {
|
||||||
...api,
|
...api,
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,16 +1,27 @@
|
|||||||
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: "1f78544934b66c9fbc0104117f663973", //在高德中申请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地址
|
||||||
};
|
baseWsUrl: "wss://im-api.pickmall.cn/lili/webSocket", // IM WS 地址
|
||||||
|
enableGetClipboard: false, //是否启用粘贴板获取 scanAuthNavigation 中的链接,如果匹配则会跳转到对应页面
|
||||||
|
enableMiniBarStartUpApp: true, //是否在h5中右侧浮空按钮点击启动app
|
||||||
|
/**
|
||||||
|
* 如需更换主题请修改此处以及uni.scss中的全局颜色
|
||||||
|
*/
|
||||||
|
mainColor: "#ff3c2a", // 主题色
|
||||||
|
lightColor: "#ff6b35", // 高亮主题色
|
||||||
|
aiderLightColor: "#ff9f28", // 辅助高亮颜色
|
||||||
|
defaultUserPhoto: "/static/missing-face.png", // 默认用户头像
|
||||||
|
enableFetchMobileLogin: false // 是否启用获取手机号登录 如果微信小程序提示封禁手机号获取权限 可将此选项设置成false作为备用登录方案
|
||||||
|
};
|
||||||
|
|||||||
@@ -7,8 +7,8 @@
|
|||||||
* @param {sn,price}
|
* @param {sn,price}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { initiatePay } from "@/api/trade";
|
|
||||||
import { getWeChatMpMessage } from "@/api/message.js";
|
import { getWeChatMpMessage } from "@/api/message.js";
|
||||||
|
import { initiatePay } from "@/api/trade";
|
||||||
class LiLiWXPay {
|
class LiLiWXPay {
|
||||||
constructor(...payList) {
|
constructor(...payList) {
|
||||||
this.data = payList[0];
|
this.data = payList[0];
|
||||||
@@ -65,52 +65,40 @@ class LiLiWXPay {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function sendMessage(price) {
|
function sendMessage(price) {
|
||||||
//判断用户是否已经进行了订阅
|
|
||||||
if (!uni.getStorageSync("acceptSubscribeMessage")) {
|
|
||||||
//订阅消息
|
//订阅消息
|
||||||
getWeChatMpMessage().then((res) => {
|
getWeChatMpMessage().then((res) => {
|
||||||
var message = res.data.result;
|
var message = res.data.result;
|
||||||
var templateid = message.map((item) => item.code);
|
var templateid = message.map((item) => item.code);
|
||||||
uni.requestSubscribeMessage({
|
uni.requestSubscribeMessage({
|
||||||
tmplIds: templateid,
|
tmplIds: templateid,
|
||||||
success: (res) => {
|
success: (res) => {
|
||||||
for (let key in res) {
|
|
||||||
// 表示用户拒绝订阅该信息
|
},
|
||||||
if (res[key] == "reject") {
|
fail: (res) => {
|
||||||
this.checked = false;
|
console.log('fail', res)
|
||||||
} else {
|
uni.showToast({
|
||||||
uni.setStorageSync("acceptSubscribeMessage", res);
|
icon: "none",
|
||||||
}
|
title: "订阅消息失败",
|
||||||
}
|
})
|
||||||
},
|
},
|
||||||
fail: (res) => {
|
complete: (res) => {
|
||||||
uni.removeStorageSync("acceptSubscribeMessage");
|
console.log('complete', res)
|
||||||
this.checked = false;
|
|
||||||
},
|
/**
|
||||||
complete: () => {
|
* 已经支付成功
|
||||||
/**
|
*/
|
||||||
* 已经支付成功
|
uni.redirectTo({
|
||||||
*/
|
url:
|
||||||
uni.redirectTo({
|
"/pages/cart/payment/success?paymentMethod=WECHAT" +
|
||||||
url:
|
"&payPrice=" +
|
||||||
"/pages/cart/payment/success?paymentMethod=WECHAT" +
|
price,
|
||||||
"&payPrice=" +
|
});
|
||||||
price,
|
},
|
||||||
});
|
|
||||||
},
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
} else {
|
});
|
||||||
/**
|
|
||||||
* 已经支付成功
|
|
||||||
*/
|
|
||||||
uni.redirectTo({
|
|
||||||
url:
|
|
||||||
"/pages/cart/payment/success?paymentMethod=WECHAT" +
|
|
||||||
"&payPrice=" +
|
|
||||||
price,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export default LiLiWXPay;
|
export default LiLiWXPay;
|
||||||
|
|||||||
77
js_sdk/t-jwt/jwt.js
Normal file
77
js_sdk/t-jwt/jwt.js
Normal file
@@ -0,0 +1,77 @@
|
|||||||
|
"use strict";
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
var b64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
|
||||||
|
var b64re = /^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/;
|
||||||
|
exports.weBtoa = function (string) {
|
||||||
|
string = String(string);
|
||||||
|
var bitmap, a, b, c, result = "", i = 0, rest = string.length % 3;
|
||||||
|
for (; i < string.length;) {
|
||||||
|
if ((a = string.charCodeAt(i++)) > 255 ||
|
||||||
|
(b = string.charCodeAt(i++)) > 255 ||
|
||||||
|
(c = string.charCodeAt(i++)) > 255)
|
||||||
|
throw new TypeError("Failed to execute 'btoa' on 'Window': The string to be encoded contains characters outside of the Latin1 range.");
|
||||||
|
bitmap = (a << 16) | (b << 8) | c;
|
||||||
|
result += b64.charAt(bitmap >> 18 & 63) + b64.charAt(bitmap >> 12 & 63) +
|
||||||
|
b64.charAt(bitmap >> 6 & 63) + b64.charAt(bitmap & 63);
|
||||||
|
}
|
||||||
|
return rest ? result.slice(0, rest - 3) + "===".substring(rest) : result;
|
||||||
|
};
|
||||||
|
exports.weAtob = function (string) {
|
||||||
|
string = String(string).replace(/[\t\n\f\r ]+/g, "");
|
||||||
|
if (!b64re.test(string))
|
||||||
|
throw new TypeError("Failed to execute 'atob' on 'Window': The string to be decoded is not correctly encoded.");
|
||||||
|
string += "==".slice(2 - (string.length & 3));
|
||||||
|
var bitmap, result = "", r1, r2, i = 0;
|
||||||
|
for (; i < string.length;) {
|
||||||
|
bitmap = b64.indexOf(string.charAt(i++)) << 18 | b64.indexOf(string.charAt(i++)) << 12 |
|
||||||
|
(r1 = b64.indexOf(string.charAt(i++))) << 6 | (r2 = b64.indexOf(string.charAt(i++)));
|
||||||
|
result += r1 === 64 ? String.fromCharCode(bitmap >> 16 & 255) :
|
||||||
|
r2 === 64 ? String.fromCharCode(bitmap >> 16 & 255, bitmap >> 8 & 255) :
|
||||||
|
String.fromCharCode(bitmap >> 16 & 255, bitmap >> 8 & 255, bitmap & 255);
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
};
|
||||||
|
function b64DecodeUnicode(str) {
|
||||||
|
return decodeURIComponent(exports.weAtob(str).replace(/(.)/g, function (p) {
|
||||||
|
var code = p.charCodeAt(0).toString(16).toUpperCase();
|
||||||
|
if (code.length < 2) {
|
||||||
|
code = "0" + code;
|
||||||
|
}
|
||||||
|
return "%" + code;
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
function base64_url_decode(str) {
|
||||||
|
var output = str.replace(/-/g, "+").replace(/_/g, "/");
|
||||||
|
switch (output.length % 4) {
|
||||||
|
case 0:
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
output += "==";
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
output += "=";
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
throw "Illegal base64url string!";
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
return b64DecodeUnicode(output);
|
||||||
|
}
|
||||||
|
catch (err) {
|
||||||
|
return exports.weAtob(output);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function weappJwtDecode(token, options) {
|
||||||
|
if (typeof token !== "string") {
|
||||||
|
throw ("Invalid token specified");
|
||||||
|
}
|
||||||
|
options = options || {};
|
||||||
|
var pos = options.header === true ? 0 : 1;
|
||||||
|
try {
|
||||||
|
return JSON.parse(base64_url_decode(token.split(".")[pos]));
|
||||||
|
}
|
||||||
|
catch (e) {
|
||||||
|
throw ("Invalid token specified: " + e.message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
exports.default = weappJwtDecode;
|
||||||
22
main.js
22
main.js
@@ -3,19 +3,24 @@ 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";
|
||||||
|
import socketIO from './pages/mine/im/socket';
|
||||||
/**
|
/**
|
||||||
* 仅在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
|
||||||
@@ -27,6 +32,7 @@ Object.keys(filters).forEach((key) => {
|
|||||||
|
|
||||||
// 引入Vuex
|
// 引入Vuex
|
||||||
Vue.prototype.$store = store;
|
Vue.prototype.$store = store;
|
||||||
|
// Vue.prototype.socketIo = new socketIO();
|
||||||
Vue.use(uView);
|
Vue.use(uView);
|
||||||
Vue.config.productionTip = false;
|
Vue.config.productionTip = false;
|
||||||
|
|
||||||
@@ -38,11 +44,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";
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
{
|
{
|
||||||
"name" : "lili商城",
|
"name" : "lilishop",
|
||||||
"appid" : "__UNI__C100675",
|
"appid" : "__UNI__ED807EA",
|
||||||
"description" : "",
|
"description" : "",
|
||||||
"versionName" : "4.0.47",
|
"versionName" : "4.5.3",
|
||||||
"versionCode" : 4000047,
|
"versionCode" : 4000503,
|
||||||
"transformPx" : false,
|
"transformPx" : false,
|
||||||
"app-plus" : {
|
"app-plus" : {
|
||||||
"compatible" : {
|
"compatible" : {
|
||||||
@@ -63,8 +63,19 @@
|
|||||||
"<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,
|
||||||
"privacyDescription" : {
|
"privacyDescription" : {
|
||||||
@@ -75,7 +86,8 @@
|
|||||||
"NSLocationAlwaysAndWhenInUseUsageDescription" : "位置信息将用于高德地图的效果展示",
|
"NSLocationAlwaysAndWhenInUseUsageDescription" : "位置信息将用于高德地图的效果展示",
|
||||||
"NSMicrophoneUsageDescription" : "用户上传视频时需使用音频信息"
|
"NSMicrophoneUsageDescription" : "用户上传视频时需使用音频信息"
|
||||||
},
|
},
|
||||||
"urltypes" : "lilishop"
|
"urltypes" : "lilishop",
|
||||||
|
"dSYMs" : false
|
||||||
},
|
},
|
||||||
/* ios打包配置 */
|
/* ios打包配置 */
|
||||||
"sdkConfigs" : {
|
"sdkConfigs" : {
|
||||||
@@ -192,18 +204,18 @@
|
|||||||
"permission" : {
|
"permission" : {
|
||||||
"scope.userLocation" : {
|
"scope.userLocation" : {
|
||||||
"desc" : "位置信息将用于高德地图的效果展示"
|
"desc" : "位置信息将用于高德地图的效果展示"
|
||||||
|
},
|
||||||
|
"scope.writePhotosAlbum" : {
|
||||||
|
"desc" : "将用于保存图片"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"plugins" : {
|
"plugins" : {},
|
||||||
"myPlugin" : {
|
// 直播插件注释
|
||||||
"version" : "1.1.0",
|
// "live-player-plugin" : {
|
||||||
"provider" : "wx738958e0f4c894f9"
|
// "version" : "1.3.0",
|
||||||
},
|
// "provider" : "wx2b03c6e691cd7370"
|
||||||
"live-player-plugin" : {
|
// }
|
||||||
"version" : "1.3.0",
|
"requiredPrivateInfos" : [ "chooseLocation", "getLocation" ]
|
||||||
"provider" : "wx2b03c6e691cd7370"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
"h5" : {
|
"h5" : {
|
||||||
"devServer" : {
|
"devServer" : {
|
||||||
|
|||||||
132
pages.json
132
pages.json
@@ -14,12 +14,31 @@
|
|||||||
"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": {
|
||||||
"navigationBarTitleText": "购物车",
|
"navigationBarTitleText": "购物车",
|
||||||
"navigationBarBackgroundColor": "#fff"
|
"navigationStyle": "custom", // 隐藏系统导航栏
|
||||||
|
"navigationBarBackgroundColor": "#fff",
|
||||||
|
"enablePullDownRefresh":true //实现下拉刷新样式
|
||||||
|
|
||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
@@ -67,6 +86,12 @@
|
|||||||
"style": {
|
"style": {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "pages/tabbar/special/special",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "专题"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
],
|
],
|
||||||
@@ -86,21 +111,14 @@
|
|||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "我的足迹",
|
"navigationBarTitleText": "我的足迹",
|
||||||
"enablePullDownRefresh": true,
|
"enablePullDownRefresh": true,
|
||||||
"app-plus": {
|
"navigationStyle": "custom"
|
||||||
"titleNView": {
|
|
||||||
"buttons": [{
|
|
||||||
"text": "编辑",
|
|
||||||
"fontSize": "14"
|
|
||||||
|
|
||||||
}]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
"path": "myCollect",
|
"path": "myCollect",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "收藏",
|
"navigationBarTitleText": "收藏",
|
||||||
"enablePullDownRefresh": true, //下拉刷新
|
"enablePullDownRefresh": true, //下拉刷新
|
||||||
|
"navigationStyle": "custom",
|
||||||
"app-plus": {
|
"app-plus": {
|
||||||
"scrollIndicator": "none"
|
"scrollIndicator": "none"
|
||||||
}
|
}
|
||||||
@@ -208,6 +226,13 @@
|
|||||||
"navigationBarTitleText": "地址管理"
|
"navigationBarTitleText": "地址管理"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"path": "address/storeAddress",
|
||||||
|
"style": {
|
||||||
|
"enablePullDownRefresh": true,
|
||||||
|
"navigationBarTitleText": "自提点"
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"path": "address/add",
|
"path": "address/add",
|
||||||
"style": {
|
"style": {
|
||||||
@@ -239,6 +264,8 @@
|
|||||||
"navigationBarTitleText": "面容登录"
|
"navigationBarTitleText": "面容登录"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
{
|
{
|
||||||
"path": "set/securityCenter/editPassword",
|
"path": "set/securityCenter/editPassword",
|
||||||
"style": {
|
"style": {
|
||||||
@@ -248,14 +275,55 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
"path": "set/securityCenter/bindMobile",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "绑定手机号",
|
||||||
|
"app-plus": {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
"path": "im/list",
|
||||||
|
"style": {
|
||||||
|
"navigationStyle": "custom", // 隐藏系统导航栏
|
||||||
|
"enablePullDownRefresh": true,
|
||||||
|
"app-plus": {
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "im/index",
|
||||||
|
"style": {
|
||||||
|
"navigationStyle": "custom", // 隐藏系统导航栏
|
||||||
|
"enablePullDownRefresh": true,
|
||||||
|
"app-plus": {
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"path": "set/feedBack",
|
"path": "set/feedBack",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "意见反馈"
|
"navigationBarTitleText": "意见反馈"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"path": "set/securityCenter/updatePwdTab",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "修改密码"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "set/securityCenter/editLoginPassword",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "修改密码"
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"path": "set/securityCenter/securityCenter",
|
"path": "set/securityCenter/securityCenter",
|
||||||
"style": {
|
"style": {
|
||||||
@@ -346,6 +414,12 @@
|
|||||||
"navigationBarTitleText": "",
|
"navigationBarTitleText": "",
|
||||||
"navigationStyle": "custom"
|
"navigationStyle": "custom"
|
||||||
}
|
}
|
||||||
|
},{
|
||||||
|
"path": "shopList",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "",
|
||||||
|
"navigationStyle": "custom"
|
||||||
|
}
|
||||||
},{
|
},{
|
||||||
"path": "licencePhoto",
|
"path": "licencePhoto",
|
||||||
"style": {
|
"style": {
|
||||||
@@ -402,6 +476,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
]
|
]
|
||||||
|
|
||||||
},
|
},
|
||||||
@@ -431,6 +506,21 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
"path": "entry/seller/index",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "店铺入驻",
|
||||||
|
"navigationStyle": "custom"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "entry/seller/control",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "",
|
||||||
|
"navigationStyle": "custom"
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"path": "article",
|
"path": "article",
|
||||||
"style": {
|
"style": {
|
||||||
@@ -444,6 +534,14 @@
|
|||||||
"navigationStyle": "custom",
|
"navigationStyle": "custom",
|
||||||
"navigationBarTextStyle": "black"
|
"navigationBarTextStyle": "black"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "scannerCodeLoginConfirm",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "扫码登录",
|
||||||
|
"navigationStyle": "custom",
|
||||||
|
"navigationBarTextStyle": "black"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
||||||
@@ -455,6 +553,8 @@
|
|||||||
"path": "seckill",
|
"path": "seckill",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "限时抢购",
|
"navigationBarTitleText": "限时抢购",
|
||||||
|
"navigationStyle": "custom", // 隐藏系统导航栏
|
||||||
|
"navigationBarTextStyle": "black" ,
|
||||||
"app-plus": {
|
"app-plus": {
|
||||||
"titleNView": {
|
"titleNView": {
|
||||||
"homeButton":true
|
"homeButton":true
|
||||||
@@ -468,7 +568,7 @@
|
|||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "拼团活动",
|
"navigationBarTitleText": "拼团活动",
|
||||||
"navigationStyle": "custom", // 隐藏系统导航栏
|
"navigationStyle": "custom", // 隐藏系统导航栏
|
||||||
|
"navigationBarTextStyle": "black" ,
|
||||||
"app-plus": {
|
"app-plus": {
|
||||||
// 将回弹属性关掉
|
// 将回弹属性关掉
|
||||||
"bounce": "none"
|
"bounce": "none"
|
||||||
@@ -630,6 +730,12 @@
|
|||||||
"navigationBarTitleText": "订单详情"
|
"navigationBarTitleText": "订单详情"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"path": "deliverDetail",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "物流详情"
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"path": "evaluate/evaluateDetail",
|
"path": "evaluate/evaluateDetail",
|
||||||
"style": {
|
"style": {
|
||||||
|
|||||||
@@ -1,299 +1,302 @@
|
|||||||
<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_GOODS_CATEGORY'">仅限品类</span>
|
||||||
<view v-else>{{ item.storeName == 'platform' ? '全平台' :item.storeName+'店铺' }}使用</view>
|
<view v-else>{{ item.storeName == 'platform' ? '全平台' :item.storeName+'店铺' }}使用
|
||||||
</view>
|
</view>
|
||||||
<view>有效期至:{{ 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) => {
|
if (this.$store.state.isShowToast){ 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({
|
if (this.$store.state.isShowToast){ uni.hideLoading() };
|
||||||
title: res.data.message,
|
});
|
||||||
icon: "none",
|
},
|
||||||
});
|
/**
|
||||||
}
|
* 领取优惠券
|
||||||
});
|
*/
|
||||||
},
|
receive(val) {
|
||||||
/**
|
this.$u.throttle(()=>{
|
||||||
* 加载更多
|
this.fetchCoupon(val)
|
||||||
*/
|
}, 1500)
|
||||||
loadMore() {
|
|
||||||
if (this.loadStatus != "noMore") {
|
},
|
||||||
this.params.pageNumber++;
|
|
||||||
this.getAllCoupons();
|
fetchCoupon(val){
|
||||||
}
|
receiveCoupons(val.id).then((res) => {
|
||||||
},
|
if (res.data.code == 200) {
|
||||||
},
|
uni.showToast({
|
||||||
onNavigationBarButtonTap(e) {
|
title: "领取成功",
|
||||||
uni.navigateTo({
|
icon: "none",
|
||||||
url: "/pages/cart/coupon/couponIntro",
|
});
|
||||||
});
|
} else {
|
||||||
},
|
uni.showToast({
|
||||||
};
|
title: res.data.message,
|
||||||
|
icon: "none",
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 加载更多
|
||||||
|
*/
|
||||||
|
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>
|
||||||
|
|||||||
@@ -3,7 +3,8 @@
|
|||||||
<view class="body">
|
<view class="body">
|
||||||
<view class="top-view">
|
<view class="top-view">
|
||||||
<view class="title">{{coupon.title}}</view>
|
<view class="title">{{coupon.title}}</view>
|
||||||
<view class="price"><text>¥</text>{{coupon.price | unitPrice}}</view>
|
<view class="price" v-if="coupon.couponType =='PRICE'"><text>¥</text>{{coupon.price | unitPrice}}</view>
|
||||||
|
<view class="price" v-if="coupon.couponType =='DISCOUNT'">{{coupon.discount}}折</view>
|
||||||
<view class="text">满{{coupon.consumeThreshold}}元可用</view>
|
<view class="text">满{{coupon.consumeThreshold}}元可用</view>
|
||||||
<view class="bg-quan">
|
<view class="bg-quan">
|
||||||
券
|
券
|
||||||
@@ -13,11 +14,13 @@
|
|||||||
</view>
|
</view>
|
||||||
</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_GOODS"
|
||||||
? "仅限品类"
|
? "部分商品"
|
||||||
|
: coupon.scopeType == "PORTION_GOODS_CATEGORY"
|
||||||
|
? "部分分类商品"
|
||||||
: coupon.storeName == 'platform' ? '全平台' :coupon.storeName+''
|
: coupon.storeName == 'platform' ? '全平台' :coupon.storeName+''
|
||||||
}}使用</view>
|
}}使用</view>
|
||||||
<view class="text">• 有效期至:{{coupon.endTime}}</view>
|
<view class="text">• 有效期至:{{coupon.endTime}}</view>
|
||||||
|
|||||||
@@ -1,12 +1,22 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="wrapper">
|
<div class="wrapper">
|
||||||
<u-tabs :list="list" :is-scroll="false" :active-color="lightColor" :current="current" @change="(i)=>{current = i}">
|
<u-tabs
|
||||||
|
:list="list"
|
||||||
|
:is-scroll="false"
|
||||||
|
:active-color="lightColor"
|
||||||
|
:current="current"
|
||||||
|
@change="
|
||||||
|
(i) => {
|
||||||
|
current = i;
|
||||||
|
}
|
||||||
|
"
|
||||||
|
>
|
||||||
</u-tabs>
|
</u-tabs>
|
||||||
|
|
||||||
<div class="empty" v-if="couponsList.length <= 0">
|
<div class="empty" v-if="couponsList.length <= 0">
|
||||||
<u-empty text="暂无优惠券" mode="coupon"></u-empty>
|
<u-empty text="暂无优惠券" mode="coupon"></u-empty>
|
||||||
</div>
|
</div>
|
||||||
<view class="coupon-item" v-for="(item, index) in couponsList" :key="index" >
|
<view class="coupon-item" v-for="(item, index) in couponsList" :key="index">
|
||||||
<view class="left">
|
<view class="left">
|
||||||
<view class="wave-line">
|
<view class="wave-line">
|
||||||
<view class="wave" v-for="(item, index) in 12" :key="index"></view>
|
<view class="wave" v-for="(item, index) in 12" :key="index"></view>
|
||||||
@@ -24,17 +34,29 @@
|
|||||||
<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_GOODS_CATEGORY'">仅限品类</span>
|
||||||
<view v-else>{{ item.storeName == 'platform' ? '全平台' :item.storeName+'店铺' }}使用</view>
|
<view v-else
|
||||||
|
>{{
|
||||||
|
item.storeName == "platform" ? "全平台" : item.storeName + "店铺"
|
||||||
|
}}使用</view
|
||||||
|
>
|
||||||
</view>
|
</view>
|
||||||
<view class="reason" v-if="item.reason">{{item.reason}}</view>
|
<view class="reason" v-if="item.reason">{{ item.reason }}</view>
|
||||||
<view class="end-time">有效期至:{{item.endTime}}</view>
|
<view class="end-time">有效期至:{{ item.endTime }}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="receive" v-if="current ==0" @click="clickWay(item)">
|
<view
|
||||||
|
class="receive"
|
||||||
|
v-if="current == 0 && !routerVal.selectedCoupon.includes(item.id)"
|
||||||
|
@click="clickWay(item)"
|
||||||
|
>
|
||||||
<text>立即</text><br />
|
<text>立即</text><br />
|
||||||
<text>使用</text>
|
<text>使用</text>
|
||||||
</view>
|
</view>
|
||||||
|
<view class="used" v-if="current == 0 && routerVal.selectedCoupon.includes(item.id)" @click="clickWay(item)">
|
||||||
|
<text>取消</text><br />
|
||||||
|
<text>使用</text>
|
||||||
|
</view>
|
||||||
<view class="bg-quan">券</view>
|
<view class="bg-quan">券</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -69,9 +91,8 @@ export default {
|
|||||||
routerVal: "", //上级传参
|
routerVal: "", //上级传参
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
onLoad(options){
|
onLoad(options) {
|
||||||
this.routerVal = options
|
this.routerVal = options;
|
||||||
|
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
current(val) {
|
current(val) {
|
||||||
@@ -84,6 +105,7 @@ export default {
|
|||||||
|
|
||||||
mounted() {
|
mounted() {
|
||||||
this.init();
|
this.init();
|
||||||
|
console.log(this.routerVal);
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
@@ -99,7 +121,7 @@ export default {
|
|||||||
clickWay(coupon) {
|
clickWay(coupon) {
|
||||||
useCoupon({
|
useCoupon({
|
||||||
memberCouponId: coupon.id,
|
memberCouponId: coupon.id,
|
||||||
used: true,
|
used: !this.routerVal.selectedCoupon.includes(coupon.id),
|
||||||
way: this.routerVal.way,
|
way: this.routerVal.way,
|
||||||
}).then((res) => {
|
}).then((res) => {
|
||||||
if (res.data.success) {
|
if (res.data.success) {
|
||||||
@@ -216,7 +238,7 @@ export default {
|
|||||||
> view:nth-child(1) {
|
> view:nth-child(1) {
|
||||||
color: #666666;
|
color: #666666;
|
||||||
margin-left: 20rpx;
|
margin-left: 20rpx;
|
||||||
|
|
||||||
> view:nth-child(1) {
|
> view:nth-child(1) {
|
||||||
color: #ff6262;
|
color: #ff6262;
|
||||||
font-size: 30rpx;
|
font-size: 30rpx;
|
||||||
@@ -237,6 +259,20 @@ export default {
|
|||||||
z-index: 2;
|
z-index: 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.used {
|
||||||
|
color: #ffffff;
|
||||||
|
background-color: black;
|
||||||
|
border-radius: 50%;
|
||||||
|
width: 86rpx;
|
||||||
|
height: 86rpx;
|
||||||
|
text-align: center;
|
||||||
|
margin-right: 30rpx;
|
||||||
|
vertical-align: middle;
|
||||||
|
padding-top: 8rpx;
|
||||||
|
position: relative;
|
||||||
|
z-index: 2;
|
||||||
|
}
|
||||||
|
|
||||||
.bg-quan {
|
.bg-quan {
|
||||||
width: 244rpx;
|
width: 244rpx;
|
||||||
height: 244rpx;
|
height: 244rpx;
|
||||||
|
|||||||
@@ -2,28 +2,63 @@
|
|||||||
<view class="b-content">
|
<view class="b-content">
|
||||||
<view class="navbar">
|
<view class="navbar">
|
||||||
<!-- 循环出头部tab栏 -->
|
<!-- 循环出头部tab栏 -->
|
||||||
<view v-for="(item, index) in navList" :key="index" class="nav-item" @click="handleTabClick(index)"><text
|
<view
|
||||||
:class="{ current: tabCurrentIndex === index }">{{
|
v-for="(item, index) in navList"
|
||||||
|
:key="index"
|
||||||
|
class="nav-item"
|
||||||
|
@click="handleTabClick(index)"
|
||||||
|
><text :class="{ current: tabCurrentIndex === index }">{{
|
||||||
item.text
|
item.text
|
||||||
}}</text></view>
|
}}</text></view
|
||||||
|
>
|
||||||
</view>
|
</view>
|
||||||
<swiper :current="tabCurrentIndex" class="swiper-box" duration="300" @change="changeTab">
|
<swiper
|
||||||
<swiper-item class="tab-content" v-for="(navItem, navIndex) in navList" :key="navIndex">
|
:current="tabCurrentIndex"
|
||||||
<scroll-view class="list-scroll-content" scroll-y @scrolltolower="loadData">
|
class="swiper-box"
|
||||||
|
duration="300"
|
||||||
|
@change="changeTab"
|
||||||
|
>
|
||||||
|
<swiper-item
|
||||||
|
class="tab-content"
|
||||||
|
v-for="(navItem, navIndex) in navList"
|
||||||
|
:key="navIndex"
|
||||||
|
>
|
||||||
|
<scroll-view
|
||||||
|
class="list-scroll-content"
|
||||||
|
scroll-y
|
||||||
|
@scrolltolower="loadData"
|
||||||
|
>
|
||||||
<!-- 空白页 -->
|
<!-- 空白页 -->
|
||||||
<u-empty mode="coupon" text="暂无优惠券了" v-if="navItem.wheterEmpty"></u-empty>
|
<u-empty
|
||||||
|
mode="coupon"
|
||||||
|
text="暂无优惠券了"
|
||||||
|
v-if="navItem.whetherEmpty"
|
||||||
|
></u-empty>
|
||||||
|
|
||||||
<!-- 数据 -->
|
<!-- 数据 -->
|
||||||
<view v-if="navItem.dataList && coupon" class="coupon-item" :class="{ 'coupon-used': navIndex != 0 }"
|
<view
|
||||||
v-for="(coupon, index) in navItem.dataList" :key="index">
|
v-if="navItem.dataList && coupon"
|
||||||
|
class="coupon-item"
|
||||||
|
:class="{ 'coupon-used': navIndex != 0 }"
|
||||||
|
v-for="(coupon, index) in navItem.dataList"
|
||||||
|
:key="index"
|
||||||
|
>
|
||||||
<view class="left">
|
<view class="left">
|
||||||
<view class="wave-line">
|
<view class="wave-line">
|
||||||
<view class="wave" v-for="(item, index) in 12" :key="index"></view>
|
<view
|
||||||
|
class="wave"
|
||||||
|
v-for="(item, index) in 12"
|
||||||
|
:key="index"
|
||||||
|
></view>
|
||||||
</view>
|
</view>
|
||||||
<view class="message">
|
<view class="message">
|
||||||
<view class="price" v-if="coupon.couponType == 'DISCOUNT'">{{ coupon.discount }}折</view>
|
<view class="price" v-if="coupon.couponType == 'DISCOUNT'"
|
||||||
|
>{{ coupon.discount }}折</view
|
||||||
|
>
|
||||||
<view class="price" v-else>{{ coupon.price }}元</view>
|
<view class="price" v-else>{{ coupon.price }}元</view>
|
||||||
<view class="sub-price">满{{ coupon.consumeThreshold | unitPrice }}可用</view>
|
<view class="sub-price"
|
||||||
|
>满{{ coupon.consumeThreshold | unitPrice }}可用</view
|
||||||
|
>
|
||||||
</view>
|
</view>
|
||||||
<view class="circle circle-top"></view>
|
<view class="circle circle-top"></view>
|
||||||
<view class="circle circle-bottom"></view>
|
<view class="circle circle-bottom"></view>
|
||||||
@@ -31,27 +66,49 @@
|
|||||||
<view class="right" v-if="coupon">
|
<view class="right" v-if="coupon">
|
||||||
<view class="content">
|
<view class="content">
|
||||||
<view class="title-1">{{ coupon.title }}</view>
|
<view class="title-1">{{ coupon.title }}</view>
|
||||||
<view class="title-2">使用平台:{{
|
<view class="title-2"
|
||||||
coupon.scopeType == 'ALL' && coupon.id == 'platform'
|
>使用范围:{{
|
||||||
|
coupon.scopeType == "ALL" && coupon.storeId == "0"
|
||||||
? "全平台"
|
? "全平台"
|
||||||
: coupon.scopeType == "PORTION_CATEGORY"
|
: coupon.scopeType == "PORTION_GOODS"
|
||||||
? "仅限品类"
|
? "部分商品"
|
||||||
: coupon.storeName == 'platform' ? '全平台' :coupon.storeName+''
|
: coupon.scopeType == "PORTION_GOODS_CATEGORY"
|
||||||
}}使用</view>
|
? "部分分类商品"
|
||||||
<view v-if="coupon.endTime">{{
|
: coupon.storeName == "platform"
|
||||||
coupon.endTime
|
? "全平台"
|
||||||
}}</view>
|
: coupon.storeName + ""
|
||||||
<view @click="couponDetail(coupon)">详细说明
|
}}使用</view
|
||||||
<u-icon style="float: right; margin-top: 10rpx" name="arrow-right"></u-icon>
|
>
|
||||||
|
<view v-if="coupon.endTime">{{ coupon.endTime }}</view>
|
||||||
|
<view @click="couponDetail(coupon)"
|
||||||
|
>详细说明
|
||||||
|
<u-icon
|
||||||
|
style="float: right; margin-top: 10rpx"
|
||||||
|
name="arrow-right"
|
||||||
|
></u-icon>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="jiao-1" v-if="navIndex == 0">
|
<view class="jiao-1" v-if="navIndex == 0">
|
||||||
<text class="text-1">新到</text>
|
<text class="text-1">新到</text>
|
||||||
<text class="text-2" v-if="coupon.used_status == 1">将过期</text>
|
<text class="text-2" v-if="coupon.used_status == 1"
|
||||||
|
>将过期</text
|
||||||
|
>
|
||||||
</view>
|
</view>
|
||||||
<image class="no-icon" v-if="navIndex == 1" src="@/static/img/used.png"></image>
|
<image
|
||||||
<image class="no-icon" v-if="navIndex == 2" src="@/static/img/overdue.png"></image>
|
class="no-icon"
|
||||||
<view class="receive" v-if="navIndex == 0" @click="useItNow(coupon)">
|
v-if="navIndex == 1"
|
||||||
|
src="@/static/img/used.png"
|
||||||
|
></image>
|
||||||
|
<image
|
||||||
|
class="no-icon"
|
||||||
|
v-if="navIndex == 2"
|
||||||
|
src="@/static/img/overdue.png"
|
||||||
|
></image>
|
||||||
|
<view
|
||||||
|
class="receive"
|
||||||
|
v-if="navIndex == 0"
|
||||||
|
@click="useItNow(coupon)"
|
||||||
|
>
|
||||||
<text>立即</text><br />
|
<text>立即</text><br />
|
||||||
<text>使用</text>
|
<text>使用</text>
|
||||||
</view>
|
</view>
|
||||||
@@ -84,7 +141,7 @@ export default {
|
|||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
status: 1,
|
status: 1,
|
||||||
},
|
},
|
||||||
wheterEmpty: false,
|
whetherEmpty: false,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
text: "已使用",
|
text: "已使用",
|
||||||
@@ -96,7 +153,7 @@ export default {
|
|||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
status: 2,
|
status: 2,
|
||||||
},
|
},
|
||||||
wheterEmpty: false,
|
whetherEmpty: false,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
text: "已过期",
|
text: "已过期",
|
||||||
@@ -108,7 +165,7 @@ export default {
|
|||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
status: 3,
|
status: 3,
|
||||||
},
|
},
|
||||||
wheterEmpty: false,
|
whetherEmpty: false,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
couponList: [], //优惠券列表
|
couponList: [], //优惠券列表
|
||||||
@@ -116,6 +173,7 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
onShow() {
|
onShow() {
|
||||||
|
this.navList[this.tabCurrentIndex].params.pageNumber = 1;
|
||||||
this.navList[this.tabCurrentIndex].dataList = [];
|
this.navList[this.tabCurrentIndex].dataList = [];
|
||||||
this.getData();
|
this.getData();
|
||||||
},
|
},
|
||||||
@@ -150,7 +208,7 @@ export default {
|
|||||||
let data = res.data.result.records;
|
let data = res.data.result.records;
|
||||||
if (data.length == 0) {
|
if (data.length == 0) {
|
||||||
if (res.data.pageNumber == 1) {
|
if (res.data.pageNumber == 1) {
|
||||||
this.navList[index].wheterEmpty = true;
|
this.navList[index].whetherEmpty = true;
|
||||||
} else {
|
} else {
|
||||||
this.navList[index].loadStatus = "noMore";
|
this.navList[index].loadStatus = "noMore";
|
||||||
}
|
}
|
||||||
@@ -161,7 +219,7 @@ export default {
|
|||||||
this.navList[index].dataList.push(...data);
|
this.navList[index].dataList.push(...data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
uni.hideLoading();
|
if (this.$store.state.isShowToast){ uni.hideLoading() };
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -187,15 +245,9 @@ export default {
|
|||||||
* 立即使用优惠券
|
* 立即使用优惠券
|
||||||
*/
|
*/
|
||||||
useItNow(item) {
|
useItNow(item) {
|
||||||
if (item.storeId) {
|
uni.navigateTo({
|
||||||
uni.navigateTo({
|
url: `/pages/navigation/search/searchPage?promotionsId=${item.couponId}&promotionType=COUPON`,
|
||||||
url: `/pages/product/shopPage?id=${item.storeId}`,
|
});
|
||||||
});
|
|
||||||
} else {
|
|
||||||
uni.switchTab({
|
|
||||||
url: "/pages/tabbar/home/index",
|
|
||||||
});
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -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) => {
|
||||||
|
if (this.$store.state.isShowToast){ 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
|
||||||
@@ -316,8 +334,25 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
if (this.$store.state.isShowToast){ uni.hideLoading() };
|
||||||
} else {
|
} else {
|
||||||
window.location.href = JSON.parse(response.result).h5_url;
|
window.location.href = JSON.parse(response.result).h5_url;
|
||||||
|
const searchParams = {
|
||||||
|
...params,
|
||||||
|
price:this.cashierParams,
|
||||||
|
}
|
||||||
|
const timer = setInterval(()=>{
|
||||||
|
payCallback(searchParams).then(res=>{
|
||||||
|
if(res.data.result){
|
||||||
|
clearTimeout(timer);
|
||||||
|
uni.navigateTo({
|
||||||
|
url:"/pages/order/myOrder"
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},3000)
|
||||||
|
|
||||||
|
if (this.$store.state.isShowToast){ uni.hideLoading() };
|
||||||
}
|
}
|
||||||
} else if (paymentMethod === "WALLET") {
|
} else if (paymentMethod === "WALLET") {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
@@ -412,7 +447,7 @@
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
/deep/ .u-row {
|
::v-deep .u-row {
|
||||||
width: 100% !important;
|
width: 100% !important;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between !important;
|
justify-content: space-between !important;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="wrapper" v-if="flage">
|
<view class="wrapper" v-if="flag">
|
||||||
<div class='goods' v-if="selectedGoods">
|
<div class='goods' v-if="selectedGoods">
|
||||||
<image class="goods-image" :src="selectedGoods.thumbnail" alt="">
|
<image class="goods-image" :src="selectedGoods.thumbnail" alt="">
|
||||||
<p class="goodsName">{{selectedGoods.goodsName}}</p>
|
<p class="goodsName">{{selectedGoods.goodsName}}</p>
|
||||||
@@ -14,6 +14,9 @@
|
|||||||
<span v-if="isBuy &&!master.toBeGroupedNum >0">
|
<span v-if="isBuy &&!master.toBeGroupedNum >0">
|
||||||
已成功拼团
|
已成功拼团
|
||||||
</span>
|
</span>
|
||||||
|
<span v-if="!master.toBeGroupedNum >0">
|
||||||
|
拼团已结束
|
||||||
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div v-if="isMaster && !isOver">
|
<div v-if="isMaster && !isOver">
|
||||||
@@ -24,7 +27,7 @@
|
|||||||
去首页逛逛
|
去首页逛逛
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="!isMaster && !isOver && !isBuy">
|
<div v-if="!isMaster && !isOver && !isBuy && master.toBeGroupedNum">
|
||||||
<div class="share-user" @click="toBuy">
|
<div class="share-user" @click="toBuy">
|
||||||
参与拼团
|
参与拼团
|
||||||
</div>
|
</div>
|
||||||
@@ -45,7 +48,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- 倒计时 -->
|
<!-- 倒计时 -->
|
||||||
<div class="count-down" v-if="!isOver">
|
<div class="count-down" v-if="!isOver && master.toBeGroupedNum">
|
||||||
<u-count-down bg-color="#ededed" :hide-zero-day="true" @end="isOver" :timestamp="timeStamp"></u-count-down>
|
<u-count-down bg-color="#ededed" :hide-zero-day="true" @end="isOver" :timestamp="timeStamp"></u-count-down>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -58,7 +61,7 @@
|
|||||||
|
|
||||||
<popupGoods :addr="addr" ref="popupGoods" :buyMask="maskFlag" @closeBuy="closePopupBuy" :goodsDetail="goodsDetail" :goodsSpec="goodsSpec" v-if="goodsDetail.id " @handleClickSku="getGoodsDetail" />
|
<popupGoods :addr="addr" ref="popupGoods" :buyMask="maskFlag" @closeBuy="closePopupBuy" :goodsDetail="goodsDetail" :goodsSpec="goodsSpec" v-if="goodsDetail.id " @handleClickSku="getGoodsDetail" />
|
||||||
<shares @close="closeShare" :link="'/pages/cart/payment/shareOrderGoods?sn='+this.routers.sn+'&sku='+this.routers.sku+'&goodsId='+this.routers.goodsId" type="pintuan"
|
<shares @close="closeShare" :link="'/pages/cart/payment/shareOrderGoods?sn='+this.routers.sn+'&sku='+this.routers.sku+'&goodsId='+this.routers.goodsId" type="pintuan"
|
||||||
:thumbnail="data.promotionGoods.thumbnail" :goodsName="data.promotionGoods.goodsName" v-if="shareFlage " />
|
:thumbnail="data.promotionGoods.thumbnail" :goodsName="data.promotionGoods.goodsName" v-if="shareFlag " />
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -72,13 +75,13 @@ import popupGoods from "@/components/m-buy/goods"; //购物车商品的模块
|
|||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
flage: false, //判断接口是否正常请求
|
flag: false, //判断接口是否正常请求
|
||||||
addr: {
|
addr: {
|
||||||
id: "",
|
id: "",
|
||||||
},
|
},
|
||||||
maskFlag: false, //商品弹框
|
maskFlag: false, //商品弹框
|
||||||
timeStamp: 0,
|
timeStamp: 0,
|
||||||
shareFlage: false,
|
shareFlag: false,
|
||||||
data: "",
|
data: "",
|
||||||
isMaster: true,
|
isMaster: true,
|
||||||
selectedGoods: "", //选择的商品规格昵称
|
selectedGoods: "", //选择的商品规格昵称
|
||||||
@@ -116,7 +119,7 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
closeShare() {
|
closeShare() {
|
||||||
this.shareFlage = false;
|
this.shareFlag = false;
|
||||||
},
|
},
|
||||||
// 这里的话得先跳到商品详情才能购买商品
|
// 这里的话得先跳到商品详情才能购买商品
|
||||||
toBuy() {
|
toBuy() {
|
||||||
@@ -131,7 +134,7 @@ export default {
|
|||||||
},
|
},
|
||||||
// 分享
|
// 分享
|
||||||
share() {
|
share() {
|
||||||
this.shareFlage = true;
|
this.shareFlag = true;
|
||||||
},
|
},
|
||||||
closePopupBuy(val) {
|
closePopupBuy(val) {
|
||||||
this.maskFlag = false;
|
this.maskFlag = false;
|
||||||
@@ -140,7 +143,7 @@ export default {
|
|||||||
async init(sn, sku) {
|
async init(sn, sku) {
|
||||||
let res = await getPinTuanShare(sn, sku);
|
let res = await getPinTuanShare(sn, sku);
|
||||||
if (res.data.success && res.data.result.promotionGoods) {
|
if (res.data.success && res.data.result.promotionGoods) {
|
||||||
this.flage = true;
|
this.flag = true;
|
||||||
this.data = res.data.result;
|
this.data = res.data.result;
|
||||||
this.selectedGoods = res.data.result.promotionGoods;
|
this.selectedGoods = res.data.result.promotionGoods;
|
||||||
let endTime = Date.parse(
|
let endTime = Date.parse(
|
||||||
@@ -204,7 +207,7 @@ export default {
|
|||||||
this.goodsDetail = response.data.result.data;
|
this.goodsDetail = response.data.result.data;
|
||||||
this.selectedGoods = response.data.result.data;
|
this.selectedGoods = response.data.result.data;
|
||||||
this.goodsSpec = response.data.result.specs;
|
this.goodsSpec = response.data.result.specs;
|
||||||
uni.hideLoading();
|
if (this.$store.state.isShowToast){ uni.hideLoading() };
|
||||||
this.PromotionList = response.data.result.promotionMap;
|
this.PromotionList = response.data.result.promotionMap;
|
||||||
|
|
||||||
// 判断是否拼团活动 如果有则显示拼团活动信息
|
// 判断是否拼团活动 如果有则显示拼团活动信息
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
¥{{ Number(payPrice) | unitPrice }}
|
¥{{ Number(payPrice) | unitPrice }}
|
||||||
</div>
|
</div>
|
||||||
<div class="pay-btns">
|
<div class="pay-btns">
|
||||||
<div v-show="!from" @click="checkOrder">查看{{this.orderType == "RECHARGE" ? '余额' : '订单'}}</div>
|
<div v-show="!from" @click="checkOrder">查看{{ this.orderType == "RECHARGE" ? '余额' : '订单' }}</div>
|
||||||
<div @click="navigateTo('/pages/tabbar/home/index', 'switch')">回到首页</div>
|
<div @click="navigateTo('/pages/tabbar/home/index', 'switch')">回到首页</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -16,7 +16,7 @@
|
|||||||
<div>
|
<div>
|
||||||
支付方式:
|
支付方式:
|
||||||
</div>
|
</div>
|
||||||
<div>{{paymentMethod | paymentTypeFilter}}</div>
|
<div>{{ paymentMethod | paymentTypeFilter }}</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -60,7 +60,7 @@ export default {
|
|||||||
this.from = options.from || "";
|
this.from = options.from || "";
|
||||||
this.payPrice = options.payPrice || 0;
|
this.payPrice = options.payPrice || 0;
|
||||||
this.orderType = options.orderType;
|
this.orderType = options.orderType;
|
||||||
// this.sendMessage()
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
checkOrder() {
|
checkOrder() {
|
||||||
@@ -77,11 +77,6 @@ export default {
|
|||||||
this.navigateTo("/pages/order/myOrder?status=0");
|
this.navigateTo("/pages/order/myOrder?status=0");
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
changeStatus(val) {
|
|
||||||
if (val) {
|
|
||||||
this.sendMessage();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
navigateTo(url, type) {
|
navigateTo(url, type) {
|
||||||
if (type === "switch") {
|
if (type === "switch") {
|
||||||
@@ -105,6 +100,7 @@ export default {
|
|||||||
padding: 0 20rpx 20rpx;
|
padding: 0 20rpx 20rpx;
|
||||||
width: 80%;
|
width: 80%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.pay-btns {
|
.pay-btns {
|
||||||
display: flex;
|
display: flex;
|
||||||
width: 50%;
|
width: 50%;
|
||||||
@@ -112,7 +108,7 @@ export default {
|
|||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
|
|
||||||
> div {
|
>div {
|
||||||
padding: 6px 12px;
|
padding: 6px 12px;
|
||||||
border: 1px solid #fff;
|
border: 1px solid #fff;
|
||||||
border-radius: 100px;
|
border-radius: 100px;
|
||||||
@@ -146,7 +142,7 @@ export default {
|
|||||||
border-radius: 20rpx;
|
border-radius: 20rpx;
|
||||||
background: rgba($color: $main-color, $alpha: 0.2);
|
background: rgba($color: $main-color, $alpha: 0.2);
|
||||||
|
|
||||||
> h2 {
|
>h2 {
|
||||||
margin-top: 20rpx;
|
margin-top: 20rpx;
|
||||||
font-size: 40rpx;
|
font-size: 40rpx;
|
||||||
color: $main-color;
|
color: $main-color;
|
||||||
|
|||||||
@@ -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>
|
||||||
@@ -13,7 +15,9 @@
|
|||||||
<u-input v-model="form.mobile" type="number" maxlength="11" placeholder="请输入收货人手机号码" />
|
<u-input v-model="form.mobile" type="number" maxlength="11" placeholder="请输入收货人手机号码" />
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
<u-form-item label="所在区域" label-width="130" prop="___path">
|
<u-form-item label="所在区域" label-width="130" prop="___path">
|
||||||
<u-input v-model="form.___path" type="select" @click="showPicker" placeholder="请选择所在地区" />
|
<div @click="showPicker" >
|
||||||
|
{{ form.___path || '请选择所在地区' }}
|
||||||
|
</div>
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
<u-form-item class="detailAddress" label="详细地址" label-width="130" prop="detail">
|
<u-form-item class="detailAddress" label="详细地址" label-width="130" prop="detail">
|
||||||
<u-input type="textarea" v-model="form.detail" maxlength="100" height="150" placeholder="街道楼牌号等" />
|
<u-input type="textarea" v-model="form.detail" maxlength="100" height="150" placeholder="街道楼牌号等" />
|
||||||
@@ -31,18 +35,18 @@
|
|||||||
<m-city :provinceData="list" headTitle="区域选择" ref="cityPicker" @funcValue="getpickerParentValue" pickerSize="4">
|
<m-city :provinceData="list" headTitle="区域选择" ref="cityPicker" @funcValue="getpickerParentValue" pickerSize="4">
|
||||||
</m-city>
|
</m-city>
|
||||||
|
|
||||||
<uniMap v-if="mapFlage" @close="closeMap" @callback="callBackAddress" />
|
<uniMap v-if="mapFlag" @close="closeMap" @callback="callBackAddress" />
|
||||||
</div>
|
</div>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import { addAddress, editAddress, getAddressDetail } from "@/api/address.js";
|
import { addAddress, editAddress, getAddressDetail } from "@/api/address.js";
|
||||||
import gkcity from "@/components/m-city/m-city.vue";
|
import city from "@/components/m-city/m-city.vue";
|
||||||
import uniMap from "./uniMap";
|
import uniMap from "@/components/uniMap";
|
||||||
import permision from "@/js_sdk/wa-permission/permission.js";
|
import permision from "@/js_sdk/wa-permission/permission.js";
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
"m-city": gkcity,
|
"m-city": city,
|
||||||
uniMap,
|
uniMap,
|
||||||
},
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
@@ -51,7 +55,7 @@ export default {
|
|||||||
methods: {
|
methods: {
|
||||||
// 关闭地图
|
// 关闭地图
|
||||||
closeMap() {
|
closeMap() {
|
||||||
this.mapFlage = false;
|
this.mapFlag = false;
|
||||||
},
|
},
|
||||||
// 打开地图并访问权限
|
// 打开地图并访问权限
|
||||||
clickUniMap() {
|
clickUniMap() {
|
||||||
@@ -59,8 +63,8 @@ export default {
|
|||||||
if (plus.os.name == "iOS") {
|
if (plus.os.name == "iOS") {
|
||||||
// ios系统
|
// ios系统
|
||||||
permision.judgeIosPermission("location")
|
permision.judgeIosPermission("location")
|
||||||
? (this.mapFlage = true)
|
? (this.mapFlag = true)
|
||||||
: this.refuseMapOuther();
|
: this.refuseMap();
|
||||||
} else {
|
} else {
|
||||||
// 安卓
|
// 安卓
|
||||||
this.requestAndroidPermission(
|
this.requestAndroidPermission(
|
||||||
@@ -70,12 +74,12 @@ export default {
|
|||||||
// #endif
|
// #endif
|
||||||
|
|
||||||
// #ifndef APP-PLUS
|
// #ifndef APP-PLUS
|
||||||
this.mapFlage = true;
|
this.mapFlag = true;
|
||||||
// #endif
|
// #endif
|
||||||
},
|
},
|
||||||
|
|
||||||
// 如果拒绝权限 提示区设置
|
// 如果拒绝权限 提示区设置
|
||||||
refuseMapOuther() {
|
refuseMap() {
|
||||||
uni.showModal({
|
uni.showModal({
|
||||||
title: "温馨提示",
|
title: "温馨提示",
|
||||||
content: "您已拒绝定位,请开启",
|
content: "您已拒绝定位,请开启",
|
||||||
@@ -111,14 +115,15 @@ export default {
|
|||||||
var result = await permision.requestAndroidPermission(permisionID);
|
var result = await permision.requestAndroidPermission(permisionID);
|
||||||
|
|
||||||
if (result == 1) {
|
if (result == 1) {
|
||||||
this.mapFlage = true;
|
this.mapFlag = true;
|
||||||
} else {
|
} else {
|
||||||
this.refuseMapOuther();
|
this.refuseMap();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
// 选择地址后数据的回调
|
// 选择地址后数据的回调
|
||||||
callBackAddress(val) {
|
callBackAddress(val) {
|
||||||
|
console.log(val)
|
||||||
uni.showLoading({
|
uni.showLoading({
|
||||||
title: "加载中",
|
title: "加载中",
|
||||||
});
|
});
|
||||||
@@ -131,10 +136,10 @@ export default {
|
|||||||
this.form.consigneeAddressPath = val.data.result.name; //地址名称, ','分割
|
this.form.consigneeAddressPath = val.data.result.name; //地址名称, ','分割
|
||||||
this.form.lat = val.latitude; //纬度
|
this.form.lat = val.latitude; //纬度
|
||||||
this.form.lon = val.longitude; //经度
|
this.form.lon = val.longitude; //经度
|
||||||
uni.hideLoading();
|
uni.hideLoading();
|
||||||
}
|
}
|
||||||
|
|
||||||
this.mapFlage = !this.mapFlage; //关闭地图
|
this.mapFlag = !this.mapFlag; //关闭地图
|
||||||
},
|
},
|
||||||
|
|
||||||
// 保存当前 地址
|
// 保存当前 地址
|
||||||
@@ -160,9 +165,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}`,
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -206,7 +209,7 @@ export default {
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
lightColor: this.$lightColor, //高亮颜色
|
lightColor: this.$lightColor, //高亮颜色
|
||||||
mapFlage: false, // 地图选择开
|
mapFlag: false, // 地图选择开
|
||||||
routerVal: "",
|
routerVal: "",
|
||||||
form: {
|
form: {
|
||||||
detail: "", //地址详情
|
detail: "", //地址详情
|
||||||
@@ -276,10 +279,10 @@ export default {
|
|||||||
params.___path = params.consigneeAddressPath;
|
params.___path = params.consigneeAddressPath;
|
||||||
this.$set(this, "form", params);
|
this.$set(this, "form", params);
|
||||||
|
|
||||||
uni.hideLoading();
|
if (this.$store.state.isShowToast){ uni.hideLoading() };
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
uni.hideLoading();
|
uni.hideLoading();
|
||||||
},
|
},
|
||||||
// 初始化rules必须要在onReady生命周期,因为onLoad生命周期组件可能尚未创建完毕
|
// 初始化rules必须要在onReady生命周期,因为onLoad生命周期组件可能尚未创建完毕
|
||||||
onReady() {
|
onReady() {
|
||||||
@@ -289,7 +292,7 @@ export default {
|
|||||||
</script>
|
</script>
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
.detailAddress {
|
.detailAddress {
|
||||||
/deep/ .u-form-item--left {
|
::v-deep .u-form-item--left {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: flex-start;
|
align-items: flex-start;
|
||||||
}
|
}
|
||||||
@@ -329,7 +332,7 @@ export default {
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
padding-top: 3%;
|
padding-top: 3%;
|
||||||
|
|
||||||
/deep/ .u-form-item {
|
::v-deep .u-form-item {
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
padding: 24rpx 30rpx;
|
padding: 24rpx 30rpx;
|
||||||
}
|
}
|
||||||
@@ -338,7 +341,7 @@ export default {
|
|||||||
background-color: $main-color;
|
background-color: $main-color;
|
||||||
}
|
}
|
||||||
|
|
||||||
/deep/.u-checkbox {
|
::v-deep.u-checkbox {
|
||||||
margin: 30rpx 30rpx 0 30rpx;
|
margin: 30rpx 30rpx 0 30rpx;
|
||||||
|
|
||||||
.u-label-class.u-checkbox__label {
|
.u-label-class.u-checkbox__label {
|
||||||
@@ -347,7 +350,7 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/deep/ .u-checkbox__label {
|
::v-deep .u-checkbox__label {
|
||||||
font-size: 28rpx;
|
font-size: 28rpx;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -101,7 +101,7 @@ export default {
|
|||||||
this.addressList = res.data.result.records;
|
this.addressList = res.data.result.records;
|
||||||
console.log(this.addressList);
|
console.log(this.addressList);
|
||||||
|
|
||||||
uni.hideLoading();
|
if (this.$store.state.isShowToast){ uni.hideLoading() };
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
//删除地址
|
//删除地址
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="address">
|
<view class="address">
|
||||||
<u-empty class="empty" v-if="this.addressList == 0" text="暂无收货地址" mode="address"></u-empty>
|
<u-empty class="empty" v-if="this.addressList.length === 0" text="暂无收货地址" mode="address"></u-empty>
|
||||||
<view class="list" >
|
<view class="list" >
|
||||||
<view class="item c-content" v-for="(item, index) in addressList" :key="index">
|
<view class="item c-content" v-for="(item, index) in addressList" :key="index">
|
||||||
<view class="basic">
|
<view class="basic">
|
||||||
@@ -50,7 +50,7 @@ export default {
|
|||||||
return {
|
return {
|
||||||
addressList: [], //地址列表
|
addressList: [], //地址列表
|
||||||
showAction: false, //是否显示下栏框
|
showAction: false, //是否显示下栏框
|
||||||
|
|
||||||
removeList: [
|
removeList: [
|
||||||
{
|
{
|
||||||
text: "确定",
|
text: "确定",
|
||||||
@@ -86,22 +86,8 @@ 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: {
|
||||||
@@ -117,7 +103,7 @@ export default {
|
|||||||
});
|
});
|
||||||
this.addressList = res.data.result.records;
|
this.addressList = res.data.result.records;
|
||||||
|
|
||||||
uni.hideLoading();
|
if (this.$store.state.isShowToast){ uni.hideLoading() };
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
//删除地址
|
//删除地址
|
||||||
|
|||||||
88
pages/mine/address/storeAddress.vue
Normal file
88
pages/mine/address/storeAddress.vue
Normal file
@@ -0,0 +1,88 @@
|
|||||||
|
<template>
|
||||||
|
<view class="address">
|
||||||
|
|
||||||
|
<u-empty class="empty" v-if="storeAddressList.length == 0" text="暂无自提地址" mode="address"></u-empty>
|
||||||
|
<view class="list" v-else>
|
||||||
|
<view class="item c-content" v-for="(item, index) in storeAddressList" :key="index">
|
||||||
|
<view class="basic" @click="selectAddressData(item)">
|
||||||
|
<text>{{ item.addressName }}</text>
|
||||||
|
<text>{{ item.mobile }}</text>
|
||||||
|
<view>
|
||||||
|
<div class="region">
|
||||||
|
<span>{{ item.address }}</span>
|
||||||
|
</div>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view style="height: 100px"></view>
|
||||||
|
</view>
|
||||||
|
<u-action-sheet :list="removeList" :tips="tips" v-model="showAction" @click="deleteAddressMessage"></u-action-sheet>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import * as API_Trade from "@/api/trade";
|
||||||
|
import * as API_Store from "@/api/store.js";
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
storeAddressList: [], //地址列表
|
||||||
|
showAction: false, //是否显示下栏框
|
||||||
|
removeList: [
|
||||||
|
{
|
||||||
|
text: "确定",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
tips: {
|
||||||
|
text: "确定要删除该收货人信息吗?",
|
||||||
|
},
|
||||||
|
removeId: "", //删除的地址id
|
||||||
|
routerVal: "",
|
||||||
|
params: {
|
||||||
|
pageNumber: 1,
|
||||||
|
pageSize: 1000,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
},
|
||||||
|
onPullDownRefresh() {
|
||||||
|
//下拉刷新
|
||||||
|
this.storeAddressList = [];
|
||||||
|
this.getAddressList();
|
||||||
|
},
|
||||||
|
onLoad: function (val) {
|
||||||
|
this.routerVal = val;
|
||||||
|
},
|
||||||
|
onShow() {
|
||||||
|
this.storeAddressList = [];
|
||||||
|
this.getAddressList();
|
||||||
|
},
|
||||||
|
onHide() {},
|
||||||
|
methods: {
|
||||||
|
async selectAddressData(val) {
|
||||||
|
await API_Trade.setStoreAddressId(val.id, this.routerVal.way);
|
||||||
|
|
||||||
|
uni.navigateBack({
|
||||||
|
delta: 1,
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//获取地址列表
|
||||||
|
getAddressList() {
|
||||||
|
uni.showLoading();
|
||||||
|
|
||||||
|
API_Store.getStoreAddress(
|
||||||
|
this.routerVal.storeId,
|
||||||
|
this.params
|
||||||
|
).then((res) => {
|
||||||
|
this.storeAddressList = res.data.result.records;
|
||||||
|
console.log(this.storeAddressList);
|
||||||
|
|
||||||
|
if (this.$store.state.isShowToast){ uni.hideLoading() };
|
||||||
|
});
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
@import "./address.scss";
|
||||||
|
</style>
|
||||||
@@ -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">
|
||||||
@@ -14,7 +14,7 @@
|
|||||||
<swiper class="swiper-box" :current="swiperCurrent">
|
<swiper class="swiper-box" :current="swiperCurrent">
|
||||||
<swiper-item class="swiper-item" v-for="index in list.length" :key="index">
|
<swiper-item class="swiper-item" v-for="index in list.length" :key="index">
|
||||||
<scroll-view class="scroll-v view-wrapper" enableBackToTop="true" scroll-with-animation scroll-y @scrolltolower="loadMore">
|
<scroll-view class="scroll-v view-wrapper" enableBackToTop="true" scroll-with-animation scroll-y @scrolltolower="loadMore">
|
||||||
<view v-if="datas.length!=0" class="view-item" v-for="(logItem, logIndex) in datas" :key="logIndex">
|
<view v-if="depositData.length!=0" class="view-item" v-for="(logItem, logIndex) in depositData" :key="logIndex">
|
||||||
<view class="view-item-detail">
|
<view class="view-item-detail">
|
||||||
<view class="-title">{{logItem.detail}}</view>
|
<view class="-title">{{logItem.detail}}</view>
|
||||||
<!-- <view class="-number">{{logItem.detail}}</view> -->
|
<!-- <view class="-number">{{logItem.detail}}</view> -->
|
||||||
@@ -27,8 +27,8 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<u-empty v-if="datas.length==0" mode="history" text="暂无记录" />
|
<u-empty v-if="depositData.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,6 @@ export default {
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
walletNum: 0,
|
walletNum: 0,
|
||||||
status: "loadmore",
|
|
||||||
current: 0,
|
current: 0,
|
||||||
swiperCurrent: 0,
|
swiperCurrent: 0,
|
||||||
userInfo: "", //用户详情信息
|
userInfo: "", //用户详情信息
|
||||||
@@ -54,7 +53,7 @@ export default {
|
|||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
order: "desc",
|
order: "desc",
|
||||||
},
|
},
|
||||||
datas: [], //遍历的数据集合
|
depositData: [], //遍历的数据集合
|
||||||
rechargeList: "", //充值明细列表
|
rechargeList: "", //充值明细列表
|
||||||
walletLogList: "", //钱包变动列表
|
walletLogList: "", //钱包变动列表
|
||||||
list: [
|
list: [
|
||||||
@@ -82,27 +81,21 @@ 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.depositData.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.depositData.push(...res.data.result.records);
|
||||||
} else {
|
|
||||||
this.status = "nomore";
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -110,7 +103,7 @@ export default {
|
|||||||
|
|
||||||
|
|
||||||
changed(index) {
|
changed(index) {
|
||||||
this.datas = [];
|
this.depositData = [];
|
||||||
this.swiperCurrent = index;
|
this.swiperCurrent = index;
|
||||||
this.params.pageNumber = 1;
|
this.params.pageNumber = 1;
|
||||||
if (index == 0) {
|
if (index == 0) {
|
||||||
|
|||||||
@@ -5,11 +5,11 @@
|
|||||||
<div class="deposit">预存款金额</div>
|
<div class="deposit">预存款金额</div>
|
||||||
<div class="money">¥{{walletNum | unitPrice }}</div>
|
<div class="money">¥{{walletNum | unitPrice }}</div>
|
||||||
<div class="operation-btns">
|
<div class="operation-btns">
|
||||||
<div class="operation-btn light" @click="navgition('/pages/mine/deposit/withdrawal')">提现</div>
|
<div class="operation-btn light" @click="navigateTo('/pages/mine/deposit/withdrawal')">提现</div>
|
||||||
<div class="operation-btn" @click="navgition('/pages/mine/deposit/recharge')">充值</div>
|
<div class="operation-btn" @click="navigateTo('/pages/mine/deposit/recharge')">充值</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="box list" @click="navgition('/pages/mine/deposit/index')">
|
<div class="box list" @click="navigateTo('/pages/mine/deposit/index')">
|
||||||
<div class="list-left">预存款明细</div>
|
<div class="list-left">预存款明细</div>
|
||||||
<div class="list-right">
|
<div class="list-right">
|
||||||
<u-icon name="arrow-right"></u-icon>
|
<u-icon name="arrow-right"></u-icon>
|
||||||
@@ -31,12 +31,6 @@ export default {
|
|||||||
let result = await getUserWallet(); //预存款
|
let result = await getUserWallet(); //预存款
|
||||||
this.walletNum = result.data.result.memberWallet;
|
this.walletNum = result.data.result.memberWallet;
|
||||||
} else {
|
} else {
|
||||||
uni.showToast({
|
|
||||||
icon: "none",
|
|
||||||
duration: 3000,
|
|
||||||
title: "请先登录!",
|
|
||||||
});
|
|
||||||
|
|
||||||
this.$options.filters.navigateToLogin("redirectTo");
|
this.$options.filters.navigateToLogin("redirectTo");
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -49,7 +43,7 @@ export default {
|
|||||||
/**
|
/**
|
||||||
* 跳转
|
* 跳转
|
||||||
*/
|
*/
|
||||||
navgition(url) {
|
navigateTo(url) {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url,
|
url,
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,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>
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
/deep/ .u-input__input,
|
::v-deep .u-input__input,
|
||||||
.u-input {
|
.u-input {
|
||||||
font-size: 80rpx !important;
|
font-size: 80rpx !important;
|
||||||
height: 102rpx !important;
|
height: 102rpx !important;
|
||||||
}
|
}
|
||||||
/deep/ .u-input__input {
|
::v-deep .u-input__input {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
font-size: 80rpx;
|
font-size: 80rpx;
|
||||||
}
|
}
|
||||||
@@ -43,4 +43,4 @@
|
|||||||
border-radius: 10rpx;
|
border-radius: 10rpx;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
line-height: 90rpx;
|
line-height: 90rpx;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,39 +1,70 @@
|
|||||||
<template>
|
<template>
|
||||||
<view>
|
<view>
|
||||||
<view class="-list">
|
<view class="-list">
|
||||||
<view class="title">提现金额</view>
|
<view class="title">提现类型</view>
|
||||||
<view class="content">
|
<view class="content">
|
||||||
<view class="price">
|
<view class="price">
|
||||||
<span> ¥</span>
|
<u-input disabled :value="type === 'ALI' ? '支付宝' : '微信'" placeholder="" />
|
||||||
<u-input v-model="price" placeholder="" type="number" />
|
|
||||||
</view>
|
</view>
|
||||||
|
</view>
|
||||||
<view class="all">
|
|
||||||
<view @click="handleAll" :style="{ color: $mainColor }">全部</view>
|
|
||||||
<view style="font-size: 24rpx; color: #999">可提现金额<span>{{ walletNum | unitPrice }}</span>元</view>
|
|
||||||
</view>
|
|
||||||
|
|
||||||
</view>
|
|
||||||
<view class="tips">
|
|
||||||
最低提现金额为1.00元
|
|
||||||
</view>
|
|
||||||
</view>
|
</view>
|
||||||
|
<view class="-list">
|
||||||
|
<view class="title">提现金额</view>
|
||||||
|
<view class="content">
|
||||||
|
<view class="price">
|
||||||
|
<span> ¥</span>
|
||||||
|
<u-input v-model="price" placeholder="" type="number" />
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="all">
|
||||||
|
<view @click="handleAll" :style="{ color: $mainColor }">全部</view>
|
||||||
|
<view style="font-size: 24rpx; color: #999">可提现金额<span>{{ walletNum | unitPrice }}</span>元</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
</view>
|
||||||
|
<view class="tips">
|
||||||
|
最低提现金额为 {{ minPrice }} 元
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="-list" v-if="type === 'ALI'">
|
||||||
|
<view class="title">真实姓名</view>
|
||||||
|
<view class="content">
|
||||||
|
<view class="price">
|
||||||
|
<u-input v-model="realName" placeholder="" />
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="-list" v-if="type === 'ALI'">
|
||||||
|
<view class="title">第三方登录账号</view>
|
||||||
|
<view class="content">
|
||||||
|
<view class="price">
|
||||||
|
<u-input v-model="connectNumber" placeholder="" />
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
<view class="submit" @click="cashd">提现</view>
|
<view class="submit" @click="cashd">提现</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import { getUserWallet, withdrawalApply } from "@/api/members";
|
import { getUserWallet, withdrawalApply, withdrawalSettingVO } from "@/api/members";
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
price: 0,
|
price: 0,
|
||||||
walletNum: 0,
|
walletNum: 0,
|
||||||
|
minPrice: 0,
|
||||||
|
type: '',
|
||||||
|
connectNumber: '',
|
||||||
|
realName: ''
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
async mounted() {
|
async mounted() {
|
||||||
let result = await getUserWallet(); //预存款
|
let result = await getUserWallet(); //预存款
|
||||||
|
let res = await withdrawalSettingVO();
|
||||||
this.walletNum = result.data.result.memberWallet;
|
this.walletNum = result.data.result.memberWallet;
|
||||||
|
this.minPrice = res.data.result.minPrice;
|
||||||
|
this.type = res.data.result.type;
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
@@ -41,7 +72,20 @@ export default {
|
|||||||
this.price = this.price + "";
|
this.price = this.price + "";
|
||||||
|
|
||||||
if (this.$u.test.amount(parseInt(this.price))) {
|
if (this.$u.test.amount(parseInt(this.price))) {
|
||||||
withdrawalApply({ price: this.price }).then((res) => {
|
let params = { price: this.price };
|
||||||
|
if (this.type === 'ALI') {
|
||||||
|
if (!this.connectNumber || !this.realName) {
|
||||||
|
uni.showToast({
|
||||||
|
title: "请输入真实姓名和第三方登录账号",
|
||||||
|
duration: 2000,
|
||||||
|
icon: "none",
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
params.connectNumber = this.connectNumber;
|
||||||
|
params.realName = this.realName;
|
||||||
|
}
|
||||||
|
withdrawalApply(params).then((res) => {
|
||||||
if (res.data.success) {
|
if (res.data.success) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: "提现成功!",
|
title: "提现成功!",
|
||||||
|
|||||||
@@ -7,9 +7,9 @@
|
|||||||
<view class="title">{{
|
<view class="title">{{
|
||||||
item.distributionCashStatus == "APPLY"
|
item.distributionCashStatus == "APPLY"
|
||||||
? "待处理"
|
? "待处理"
|
||||||
: item.distributionCashStatus == "PASS"
|
: item.distributionCashStatus == "VIA_AUDITING"
|
||||||
? "通过"
|
? "通过"
|
||||||
: "拒绝"
|
: "拒绝"
|
||||||
}}</view>
|
}}</view>
|
||||||
<view class="price">+{{ item.price | unitPrice }}</view>
|
<view class="price">+{{ item.price | unitPrice }}</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -23,25 +23,30 @@
|
|||||||
<view class="log-way" v-if="achievementData.length != 0" v-for="(item, index) in achievementData" :key="index">
|
<view class="log-way" v-if="achievementData.length != 0" v-for="(item, index) in achievementData" :key="index">
|
||||||
<view class="log-item">
|
<view class="log-item">
|
||||||
<view class="log-item-view">
|
<view class="log-item-view">
|
||||||
<view class="title">{{item.goodsName}}</view>
|
<view class="title">{{ item.goodsName }}</view>
|
||||||
<view class="price">+{{ item.rebate | unitPrice }}</view>
|
<view class="price">提成金额:+{{ item.rebate | unitPrice }}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="log-item-view">
|
<view class="log-item-view">
|
||||||
<view>{{ item.createTime }}</view>
|
<view>创建时间:{{ item.createTime }}</view>
|
||||||
<view>{{item.storeName}}</view>
|
<view>店铺:{{ item.storeName }}</view>
|
||||||
|
</view>
|
||||||
|
<view class="log-item-footer">
|
||||||
|
<view>会员名称:{{ item.memberName }}</view>
|
||||||
|
</view>
|
||||||
|
<view class="log-item-footers">
|
||||||
|
<view>订单号:{{ item.orderSn }}</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="empty" v-if="empty">
|
<view class="empty" v-if="empty">
|
||||||
<u-loadmore :status="status" :icon-type="iconType" bg-color="#f7f7f7" />
|
<u-loadmore :status="status" :icon-type="iconType" bg-color="#f7f7f7" />
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import { cashLog, distributionOrderList } from "@/api/goods";
|
import { cashLog, distributionOrderList } from "@/api/goods";
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data () {
|
||||||
return {
|
return {
|
||||||
cashLogData: [], //提现记录数据集合
|
cashLogData: [], //提现记录数据集合
|
||||||
achievementData: [], //分销业绩数据合集,
|
achievementData: [], //分销业绩数据合集,
|
||||||
@@ -61,7 +66,7 @@ export default {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
onLoad(option) {
|
onLoad (option) {
|
||||||
let title;
|
let title;
|
||||||
option.type == 0 ? (title = "分销业绩") : (title = "提现记录");
|
option.type == 0 ? (title = "分销业绩") : (title = "提现记录");
|
||||||
|
|
||||||
@@ -72,41 +77,41 @@ export default {
|
|||||||
this.type = option.type;
|
this.type = option.type;
|
||||||
option.type == 0 ? this.achievement() : this.history();
|
option.type == 0 ? this.achievement() : this.history();
|
||||||
},
|
},
|
||||||
mounted() {},
|
mounted () { },
|
||||||
onReachBottom() {
|
onReachBottom () {
|
||||||
this.status = "loading";
|
this.status = "loading";
|
||||||
this.type == 0 ? this.achParams.pageNumber++ : this.params.pageNumber++;
|
this.type == 0 ? this.achParams.pageNumber++ : this.params.pageNumber++;
|
||||||
this.type == 0 ? this.achievement() : this.history();
|
this.type == 0 ? this.achievement() : this.history();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
// 业绩
|
// 业绩
|
||||||
achievement() {
|
achievement () {
|
||||||
uni.showLoading({
|
uni.showLoading({
|
||||||
title: "加载中",
|
title: "加载中",
|
||||||
});
|
});
|
||||||
distributionOrderList(this.achParams).then((res) => {
|
distributionOrderList(this.achParams).then((res) => {
|
||||||
if (res.data.success && res.data.result.records.length >= 1) {
|
if (res.data.success && res.data.result.records.length >= 1) {
|
||||||
this.achievementData = res.data.result.records;
|
this.achievementData.push(...res.data.result.records);
|
||||||
} else {
|
} else {
|
||||||
this.status = "nomore";
|
this.status = "nomore";
|
||||||
this.empty = true;
|
this.empty = true;
|
||||||
}
|
}
|
||||||
uni.hideLoading();
|
if (this.$store.state.isShowToast){ uni.hideLoading() };
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
// 初始化提现历史
|
// 初始化提现历史
|
||||||
history() {
|
history () {
|
||||||
uni.showLoading({
|
uni.showLoading({
|
||||||
title: "加载中",
|
title: "加载中",
|
||||||
});
|
});
|
||||||
cashLog(this.params).then((res) => {
|
cashLog(this.params).then((res) => {
|
||||||
if (res.data.success && res.data.result.records.length >= 1) {
|
if (res.data.success && res.data.result.records.length >= 1) {
|
||||||
this.cashLogData = res.data.result.records;
|
this.cashLogData.push(...res.data.result.records);
|
||||||
} else {
|
} else {
|
||||||
this.status = "nomore";
|
this.status = "nomore";
|
||||||
this.empty = true;
|
this.empty = true;
|
||||||
}
|
}
|
||||||
uni.hideLoading();
|
if (this.$store.state.isShowToast){ uni.hideLoading() };
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -116,15 +121,18 @@ export default {
|
|||||||
.empty {
|
.empty {
|
||||||
margin: 40rpx 0;
|
margin: 40rpx 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.price {
|
.price {
|
||||||
color: $main-color;
|
color: $main-color;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
|
|
||||||
.log-list {
|
.log-list {
|
||||||
padding: 0 8rpx;
|
padding: 0 8rpx;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
margin: 20rpx 0;
|
margin: 20rpx 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.log-way {
|
.log-way {
|
||||||
margin: 10rpx 0;
|
margin: 10rpx 0;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
@@ -132,13 +140,30 @@ export default {
|
|||||||
border-radius: 10rpx;
|
border-radius: 10rpx;
|
||||||
padding: 20rpx 0;
|
padding: 20rpx 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.title {
|
.title {
|
||||||
font-size: 30rpx;
|
font-size: 30rpx;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
|
|
||||||
.log-item-view {
|
.log-item-view {
|
||||||
padding: 8rpx 32rpx;
|
padding: 8rpx 32rpx;
|
||||||
display: flex;
|
display: flex;
|
||||||
|
font-size: 13px;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
}
|
}
|
||||||
</style>
|
|
||||||
|
.log-item-footer {
|
||||||
|
padding: 8rpx 32rpx;
|
||||||
|
display: flex;
|
||||||
|
font-size: 13px;
|
||||||
|
justify-content: space-between;
|
||||||
|
}
|
||||||
|
|
||||||
|
.log-item-footers {
|
||||||
|
padding: 8rpx 32rpx;
|
||||||
|
display: flex;
|
||||||
|
font-size: 13px;
|
||||||
|
justify-content: space-between;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|||||||
@@ -78,7 +78,7 @@ export default {
|
|||||||
if (res.data.result) {
|
if (res.data.result) {
|
||||||
this.distributionData = res.data.result;
|
this.distributionData = res.data.result;
|
||||||
}
|
}
|
||||||
uni.hideLoading();
|
if (this.$store.state.isShowToast){ uni.hideLoading() };
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -98,7 +98,7 @@ export default {
|
|||||||
.nav-list {
|
.nav-list {
|
||||||
color: #fff;
|
color: #fff;
|
||||||
padding: 40rpx 0;
|
padding: 40rpx 0;
|
||||||
background: $aider-light-color;
|
background: linear-gradient(91deg, $light-color 1%, $aider-light-color 99%);
|
||||||
}
|
}
|
||||||
.total {
|
.total {
|
||||||
padding: 10rpx 0;
|
padding: 10rpx 0;
|
||||||
|
|||||||
@@ -66,42 +66,45 @@
|
|||||||
<!-- 商品列表 -->
|
<!-- 商品列表 -->
|
||||||
|
|
||||||
<view class="goods-list">
|
<view class="goods-list">
|
||||||
<u-swipe-action v-for="(item, index) in goodsList" :disabled="!params.checked" :show="item.___selected" @open="openAction(item)" :index="index" :options="options" bg-color="#fff"
|
<scroll-view class="body-view" scroll-y @scrolltolower="renderDate">
|
||||||
ref="swiperAction" :key="item.id" @click="changeActionTab(item)">
|
<u-swipe-action v-for="(item, index) in goodsList" :disabled="!params.checked" :show="item.___selected" @open="openAction(item)" :index="index" :options="options" bg-color="#fff"
|
||||||
|
ref="swiperAction" :key="item.id" @click="changeActionTab(item)">
|
||||||
|
|
||||||
<div class="goods-item">
|
<div class="goods-item">
|
||||||
<view class="goods-item-img" @click="handleNavgationGoods(item)">
|
<view class="goods-item-img" @click="handleNavgationGoods(item)">
|
||||||
<u-image width="176rpx" height="176rpx" :src="item.thumbnail"></u-image>
|
<u-image width="176rpx" height="176rpx" :src="item.thumbnail"></u-image>
|
||||||
</view>
|
|
||||||
<view class="goods-item-desc">
|
|
||||||
<!-- 商品描述 -->
|
|
||||||
<view class="-item-title" @click="handleNavgationGoods(item)">
|
|
||||||
{{ item.goodsName }}
|
|
||||||
</view>
|
</view>
|
||||||
<!-- 商品金额 -->
|
<view class="goods-item-desc">
|
||||||
<view class="-item-price" @click="handleNavgationGoods(item)">
|
<!-- 商品描述 -->
|
||||||
佣金:
|
<view class="-item-title" @click="handleNavgationGoods(item)">
|
||||||
<span> ¥{{ item.commission | unitPrice }}</span>
|
{{ item.goodsName }}
|
||||||
</view>
|
</view>
|
||||||
<!-- 比率佣金 -->
|
<!-- 商品金额 -->
|
||||||
<view class="-item-bottom">
|
<view class="-item-price" @click="handleNavgationGoods(item)">
|
||||||
<view class="-item-bootom-money" @click="handleNavgationGoods(item)">
|
佣金:
|
||||||
<!-- <view class="-item-bl">
|
<span> ¥{{ item.commission | unitPrice }}</span>
|
||||||
比率:
|
</view>
|
||||||
<span>{{ "5.00%" }}</span>
|
<!-- 比率佣金 -->
|
||||||
</view> -->
|
<view class="-item-bottom">
|
||||||
<view class="-item-yj">
|
<view class="-item-bootom-money" @click="handleNavgationGoods(item)">
|
||||||
<span>¥{{ item.price | unitPrice }}</span>
|
<!-- <view class="-item-bl">
|
||||||
|
比率:
|
||||||
|
<span>{{ "5.00%" }}</span>
|
||||||
|
</view> -->
|
||||||
|
<view class="-item-yj">
|
||||||
|
<span>¥{{ item.price | unitPrice }}</span>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view>
|
||||||
|
<view class="click" v-if="!params.checked" @click="handleClickGoods(item)">立即选取</view>
|
||||||
|
<view class="click" v-if="params.checked" @click="handleLink(item)">分销商品</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view>
|
|
||||||
<view class="click" v-if="!params.checked" @click="handleClickGoods(item)">立即选取</view>
|
|
||||||
<view class="click" v-if="params.checked" @click="handleLink(item)">分销商品</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</div>
|
||||||
</div>
|
</u-swipe-action>
|
||||||
</u-swipe-action>
|
</scroll-view>
|
||||||
|
|
||||||
|
|
||||||
<view class="empty">
|
<view class="empty">
|
||||||
<!-- <u-empty v-if="empty" text="没有分销商品了" mode="list"></u-empty> -->
|
<!-- <u-empty v-if="empty" text="没有分销商品了" mode="list"></u-empty> -->
|
||||||
@@ -295,15 +298,30 @@ export default {
|
|||||||
});
|
});
|
||||||
this.goodsList.push(...res.data.result.records);
|
this.goodsList.push(...res.data.result.records);
|
||||||
}
|
}
|
||||||
if (this.goodsList.length == 0) {
|
if (this.goodsList.length === 0) {
|
||||||
this.empty = true;
|
this.empty = true;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 底部加载数据
|
||||||
|
*/
|
||||||
|
renderDate() {
|
||||||
|
|
||||||
|
this.params.pageNumber += 1;
|
||||||
|
this.init();
|
||||||
|
},
|
||||||
|
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
|
||||||
|
.body-view {
|
||||||
|
overflow-y: auto;
|
||||||
|
height: calc(100vh - 44px - 80rpx - 104rpx);
|
||||||
|
}
|
||||||
.canvas-hide {
|
.canvas-hide {
|
||||||
/* 1 */
|
/* 1 */
|
||||||
position: fixed;
|
position: fixed;
|
||||||
|
|||||||
@@ -75,20 +75,20 @@ export default {
|
|||||||
if (res.data.result) {
|
if (res.data.result) {
|
||||||
this.distributionData = res.data.result;
|
this.distributionData = res.data.result;
|
||||||
}
|
}
|
||||||
uni.hideLoading();
|
if (this.$store.state.isShowToast){ uni.hideLoading() };
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
/deep/ .u-input__input,
|
::v-deep .u-input__input,
|
||||||
.u-input {
|
.u-input {
|
||||||
font-size: 80rpx !important;
|
font-size: 80rpx !important;
|
||||||
height: 102rpx !important;
|
height: 102rpx !important;
|
||||||
|
|
||||||
}
|
}
|
||||||
/deep/ .u-input__input{
|
::v-deep .u-input__input{
|
||||||
height: 100%;
|
height: 100%;
|
||||||
font-size: 80rpx;
|
font-size: 80rpx;
|
||||||
}
|
}
|
||||||
@@ -126,4 +126,4 @@ export default {
|
|||||||
text-align: center;
|
text-align: center;
|
||||||
line-height: 90rpx;
|
line-height: 90rpx;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -1,37 +1,42 @@
|
|||||||
<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" v-if="res"></u-parse>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import { getArticleDetail } from "@/api/article";
|
import { getArticleDetailByType } from "@/api/article";
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
res: "",
|
res: "",
|
||||||
way: {
|
way: {
|
||||||
user: {
|
USER_AGREEMENT: {
|
||||||
title: "用户协议",
|
title: "服务协议",
|
||||||
type: "USER_AGREEMENT",
|
type: "USER_AGREEMENT",
|
||||||
},
|
},
|
||||||
privacy: {
|
PRIVACY_POLICY: {
|
||||||
title: "隐私政策",
|
title: "隐私政策",
|
||||||
type: "PRIVACY_POLICY",
|
type: "PRIVACY_POLICY",
|
||||||
},
|
},
|
||||||
message: {
|
LICENSE_INFORMATION: {
|
||||||
title: "证照信息",
|
title: "证照信息",
|
||||||
type: "LICENSE_INFORMATION",
|
type: "LICENSE_INFORMATION",
|
||||||
},
|
},
|
||||||
about: {
|
ABOUT: {
|
||||||
title: "关于我们",
|
title: "关于我们",
|
||||||
type: "ABOUT",
|
type: "ABOUT",
|
||||||
},
|
},
|
||||||
|
STORE_REGISTER: {
|
||||||
|
title: "店铺入驻协议",
|
||||||
|
type: "STORE_REGISTER",
|
||||||
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
mounted() {},
|
mounted() {},
|
||||||
onLoad(option) {
|
onLoad(option) {
|
||||||
|
console.log(this.way)
|
||||||
uni.setNavigationBarTitle({
|
uni.setNavigationBarTitle({
|
||||||
title: this.way[option.type].title,
|
title: this.way[option.type].title,
|
||||||
});
|
});
|
||||||
@@ -40,9 +45,10 @@ export default {
|
|||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
init(option) {
|
init(option) {
|
||||||
getArticleDetail(this.way[option.type].type).then((res) => {
|
getArticleDetailByType(this.way[option.type].type).then((res) => {
|
||||||
if (res.data.success) {
|
if (res.data.success) {
|
||||||
this.res = res.data.result;
|
this.res = res.data.result;
|
||||||
|
console.log(res)
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|||||||
5802
pages/mine/im/index-app.scss
Normal file
5802
pages/mine/im/index-app.scss
Normal file
File diff suppressed because one or more lines are too long
912
pages/mine/im/index.vue
Normal file
912
pages/mine/im/index.vue
Normal file
@@ -0,0 +1,912 @@
|
|||||||
|
<template>
|
||||||
|
<view class="wrapper">
|
||||||
|
<u-navbar class="my-title" title-size="32" :title="toUser.name"></u-navbar>
|
||||||
|
<!-- 空盒子用来防止消息过少时 拉起键盘会遮盖消息 -->
|
||||||
|
<view :animation="anData" style="height:0;">
|
||||||
|
</view>
|
||||||
|
<!-- 消息体 -->
|
||||||
|
<!-- 用来获取消息体高度 -->
|
||||||
|
<view id="msgList">
|
||||||
|
<!-- 消息 -->
|
||||||
|
<view class="flex-column-start" v-if="msgList.length" v-for="(item, index) in msgList" :key="index">
|
||||||
|
<view class="flex-row-start column-time">
|
||||||
|
<!-- <view v-show="compareTime(index, item.createTime)" class="flex-row-start date-text"
|
||||||
|
v-text="beautifyTime(item.createTime)">
|
||||||
|
</view> -->
|
||||||
|
</view>
|
||||||
|
<!-- 用户消息 头像可选加入-->
|
||||||
|
<view v-if="item.my" class="flex justify-end padding-right one-show align-start padding-top">
|
||||||
|
<view class="flex justify-end" style="width: 400rpx;margin-top: 12px;">
|
||||||
|
<view>
|
||||||
|
<view class="user-name">{{ user.nickName }}</view>
|
||||||
|
<view class="margin-left padding-chat bg-user-orang" style="border-radius: 35rpx; ">
|
||||||
|
<text style="word-break: break-all;"
|
||||||
|
v-if="item.messageType === 'MESSAGE' && !emojistwo.includes(item.text)">{{ item.text }}</text>
|
||||||
|
<view v-if="item.messageType === 'MESSAGE' && emojistwo.includes(item.text)"
|
||||||
|
v-html="textReplaceEmoji(item.text)"></view>
|
||||||
|
<view v-if="item.messageType == 'GOODS'">
|
||||||
|
<view class="goods-card u-flex u-row-between u-p-b-0" style="width:100%;margin: 0 0; ">
|
||||||
|
<view class="image-box" @click="jumpGoodDesc(item)">
|
||||||
|
<image class="image" :src="JSON.parse(item.text)['thumbnail']" mode="widthFix"></image>
|
||||||
|
</view>
|
||||||
|
<view class="goods-desc" @click="jumpGoodDesc(item)">
|
||||||
|
<view class="goods-desc-name">
|
||||||
|
<text class="goods-card-goods-name">{{
|
||||||
|
JSON.parse(item.text)['goodsName']
|
||||||
|
}}</text>
|
||||||
|
</view>
|
||||||
|
<view class="goods-desc-rice" >¥{{
|
||||||
|
JSON.parse(item.text)['price'] | unitPrice
|
||||||
|
}}
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view v-if="item.messageType == 'ORDER'" @click="linkTosOrders(item.text)">
|
||||||
|
<view class="order-sn">
|
||||||
|
<div class="wes">订单号:{{ JSON.parse(item.text)['sn'] }}</div>
|
||||||
|
<div class='order-item flex' v-if="JSON.parse(item.text).orderItems.length" v-for='(order,orderIndex) in JSON.parse(item.text).orderItems'>
|
||||||
|
<u-image mode="widthFix" width='120rpx' height='120rpx' :src="order.image" />
|
||||||
|
<view class="name-or-time">
|
||||||
|
<div class="wes-2" >{{
|
||||||
|
order.name
|
||||||
|
}}</div>
|
||||||
|
<div class="main-color goods-desc-rice">{{
|
||||||
|
order.goodsPrice | unitPrice("¥")
|
||||||
|
}}</div>
|
||||||
|
|
||||||
|
</view>
|
||||||
|
</div>
|
||||||
|
<view class="order-list">
|
||||||
|
<view class="order-time">
|
||||||
|
<text>{{ JSON.parse(item.text)['paymentTime'] }}</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view>
|
||||||
|
<u-avatar :src="user.face" :text="user.face ? '' : user.name" bg-color="#DDDDDD"></u-avatar>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<!-- 接收人消息 -->
|
||||||
|
<view v-else class="flex-row-start margin-left margin-top one-show">
|
||||||
|
<view class="chat-img flex-row-center">
|
||||||
|
<u-avatar :src="toUser.face" :text="toUser.face ? '' : toUser.name" bg-color="#DDDDDD">
|
||||||
|
</u-avatar>
|
||||||
|
</view>
|
||||||
|
<view class="flex" style="width: 500rpx;">
|
||||||
|
<view>
|
||||||
|
<view class="other-name">{{ toUser.name }}</view>
|
||||||
|
<view class="margin-left padding-chat flex-column-start bg-to-color" style="border-radius: 35rpx;">
|
||||||
|
<text style="word-break: break-all;"
|
||||||
|
v-if="item.messageType === 'MESSAGE' && !emojistwo.includes(item.text)">{{ item.text }}</text>
|
||||||
|
<view v-if="item.messageType === 'MESSAGE' && emojistwo.includes(item.text)"
|
||||||
|
v-html="textReplaceEmoji(item.text)"></view>
|
||||||
|
<view v-if="item.messageType === 'GOODS'">
|
||||||
|
<view class="goods-card u-flex u-row-between u-p-b-0" style="width:100%;margin: 0 0; ">
|
||||||
|
<view class="image-box" @click="jumpGoodDesc(item)">
|
||||||
|
<image class="image" :src="JSON.parse(item.text)['thumbnail']" mode="widthFix"></image>
|
||||||
|
</view>
|
||||||
|
<view class="goods-desc" @click="jumpGoodDesc(item)">
|
||||||
|
<view class="goods-desc-name">
|
||||||
|
<text class="goods-card-goods-name">{{
|
||||||
|
JSON.parse(item.text)['goodsName']
|
||||||
|
}}</text>
|
||||||
|
</view>
|
||||||
|
<view class="goods-desc-rice" >¥{{
|
||||||
|
JSON.parse(item.text)['price']
|
||||||
|
}}
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view v-if="item.messageType === 'ORDER'">
|
||||||
|
<view class="order-sn">
|
||||||
|
<text>订单号:{{ JSON.parse(item.text)['sn'] }}</text>
|
||||||
|
<view class="order-list">
|
||||||
|
<img style="height: 120rpx; width: 120rpx; margin-top: 15rpx;"
|
||||||
|
:src="JSON.parse(item.text)['groupImages']" mode="widthFix" />
|
||||||
|
<view class="name-or-time">
|
||||||
|
<text @click="linkTosOrders(item.text)">{{
|
||||||
|
JSON.parse(item.text)['groupName']
|
||||||
|
}}</text>
|
||||||
|
<view class="order-time">
|
||||||
|
<text>{{ JSON.parse(item.text)['paymentTime'] }}</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<!-- 防止消息底部被遮 -->
|
||||||
|
<view v-if="showHide && !localImGoodsId && showHideModel" class="flex-row-start margin-left margin-top"
|
||||||
|
style="height: 120rpx;">
|
||||||
|
</view>
|
||||||
|
<!-- 如果没有聊天记录,定位到底部 -->
|
||||||
|
<view
|
||||||
|
:style="{ position:'fixed' , bottom:(inputHeight+66)+'px' , width: '100%' }">
|
||||||
|
<view class="cart-message" v-if="showHide && !localImGoodsId && showHideModel">
|
||||||
|
<view class="goods-card u-flex u-row-between u-p-b-0">
|
||||||
|
<view class="image-box" @click="jumpGoodDesc(item)">
|
||||||
|
<image class="image" :src="goodListData.thumbnail" mode="widthFix"></image>
|
||||||
|
</view>
|
||||||
|
<view class="goods-desc" @click="jumpGoodDesc(item)">
|
||||||
|
<view class="goods-desc-name">
|
||||||
|
<text class="goods-card-goods-name">{{
|
||||||
|
goodListData.goodsName
|
||||||
|
}}</text>
|
||||||
|
</view>
|
||||||
|
<view class="goods-desc-rice" > ¥{{
|
||||||
|
goodListData.price | unitPrice
|
||||||
|
}}
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="cancel" @click="cancelModel">X</view>
|
||||||
|
<view class="send-goods" @click="sendGoodsMessage">
|
||||||
|
<view>发送商品</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<!-- 防止消息底部被遮 -->
|
||||||
|
<view style="height: 120rpx;">
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<!-- 底部导航栏 -->
|
||||||
|
<view :style="{position: 'fixed', bottom:inputHeight+'px'}" class="flex-column-center bottom-dh" :animation="animationData">
|
||||||
|
<view class="bottom-dh-char flex-row-around" style="font-size: 55rpx;">
|
||||||
|
<!-- vue无法使用软键盘"发送" -->
|
||||||
|
|
||||||
|
<!-- #ifndef MP-WEIXIN -->
|
||||||
|
<div v-if="!isShow" @click="navigateToBottom" class="dh-input">
|
||||||
|
用一句简短的话描述您的问题
|
||||||
|
</div>
|
||||||
|
<input v-show="isShow" ref="inputRef" :focus="isShow" @focus="inputBindFocus" @blur="eventHandle" :adjust-position="false" v-model="msg" class="dh-input" type="text" style="background-color: #f0f0f0;" @confirm="sendMessage"
|
||||||
|
confirm-type="send" placeholder="用一句简短的话描述您的问题" />
|
||||||
|
<!-- #endif -->
|
||||||
|
|
||||||
|
<!-- #ifdef MP-WEIXIN -->
|
||||||
|
<input ref="inputRef" @focus="inputBindFocus" @blur="eventHandle" :adjust-position="false" v-model="msg" class="dh-input" type="text" style="background-color: #f0f0f0;" @confirm="sendMessage"
|
||||||
|
confirm-type="send" placeholder="用一句简短的话描述您的问题" />
|
||||||
|
<!-- #endif -->
|
||||||
|
|
||||||
|
<view @click="sendMessage" class="cu-tag bg-main-color send round">
|
||||||
|
发送
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<!-- <text @click="ckAdd" class="cuIcon-roundaddfill text-brown"></text> -->
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<div id="bottom"></div>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
// rpx和px的比率
|
||||||
|
var l
|
||||||
|
// 可用窗口高度
|
||||||
|
var wh
|
||||||
|
// 顶部空盒子的高度
|
||||||
|
var mgUpHeight
|
||||||
|
import {
|
||||||
|
getTalkMessage,
|
||||||
|
getTalkByUser,
|
||||||
|
jumpObtain
|
||||||
|
} from "@/api/im.js";
|
||||||
|
import SocketService from "@/utils/socket_service.js";
|
||||||
|
import storage from "@/utils/storage.js";
|
||||||
|
import {
|
||||||
|
beautifyTime
|
||||||
|
} from "@/utils/filters.js"
|
||||||
|
import config from '@/config/config.js'
|
||||||
|
import { textReplaceEmoji, emojistwo } from '@/utils/emojis.js';
|
||||||
|
export default {
|
||||||
|
// 页面卸载后清除imGoodId
|
||||||
|
onUnload () {
|
||||||
|
// #ifdef H5
|
||||||
|
uni.setStorageSync("imGoodId", '');
|
||||||
|
// #endif
|
||||||
|
|
||||||
|
if (this.socketOpen == true) {
|
||||||
|
uni.closeSocket();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onLoad (options) {
|
||||||
|
// 没有goodsid则不显示 发送商品弹窗
|
||||||
|
this.showHideModel = options.goodsid
|
||||||
|
// 发送后刷新页面不显示 发送商品弹窗 local里面imGoodId不为空显示
|
||||||
|
// #ifdef H5
|
||||||
|
this.localImGoodsId = uni.getStorageSync("imGoodId");
|
||||||
|
// #endif
|
||||||
|
this.resolve = options
|
||||||
|
// 请求商品信息
|
||||||
|
if (this.resolve.goodsid) {
|
||||||
|
this.commodityDetails()
|
||||||
|
}
|
||||||
|
|
||||||
|
var query = uni.getSystemInfoSync()
|
||||||
|
|
||||||
|
l = query.screenWidth / 750
|
||||||
|
wh = query.windowHeight
|
||||||
|
this.scrollHeight = (query.windowHeight - 44) + "px"
|
||||||
|
this.user = storage.getUserInfo()
|
||||||
|
this.toUser = storage.getTalkToUser()
|
||||||
|
|
||||||
|
if (options.talkId) {
|
||||||
|
this.params.talkId = options.talkId;
|
||||||
|
this.getTalkMessage()
|
||||||
|
} else {
|
||||||
|
this.getTalk(options.userId)
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// this.ws.connect();
|
||||||
|
this.socket();
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// 页面隐藏
|
||||||
|
onHide () {
|
||||||
|
uni.closeSocket();
|
||||||
|
},
|
||||||
|
onUnload () {
|
||||||
|
uni.closeSocket();
|
||||||
|
},
|
||||||
|
onPullDownRefresh () {
|
||||||
|
this.params.pageNumber = this.params.pageNumber + 1
|
||||||
|
this.getTalkMessage()
|
||||||
|
setTimeout(function () {
|
||||||
|
uni.stopPullDownRefresh();
|
||||||
|
}, 1000);
|
||||||
|
},
|
||||||
|
|
||||||
|
data () {
|
||||||
|
return {
|
||||||
|
textReplaceEmoji,
|
||||||
|
emojistwo,
|
||||||
|
socketOpen: false, //是否连接
|
||||||
|
storage,
|
||||||
|
fixed: 'fixed',
|
||||||
|
bottom: '50px',
|
||||||
|
width: '100%',
|
||||||
|
showHideModel: undefined,
|
||||||
|
localImGoodsId: '',
|
||||||
|
showHide: true,
|
||||||
|
msgLoad: false,
|
||||||
|
anData: {},
|
||||||
|
animationData: {},
|
||||||
|
msgList: [],
|
||||||
|
oldHeight: 0,
|
||||||
|
params: { //搜索条件
|
||||||
|
talkId: '',
|
||||||
|
pageSize: 10,
|
||||||
|
pageNumber: 1,
|
||||||
|
},
|
||||||
|
goToIndex: 0, // 前往位置
|
||||||
|
msg: "",
|
||||||
|
go: 0,
|
||||||
|
newMessageNum: 0,
|
||||||
|
user: {},
|
||||||
|
toUser: {},
|
||||||
|
scrollHeight: 0,
|
||||||
|
ws: new SocketService(),
|
||||||
|
resolve: {},
|
||||||
|
goodListData: {},
|
||||||
|
count: 0, //判断socket断开连接请求次数
|
||||||
|
inputHeight:0,
|
||||||
|
isShow:false,
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onPageScroll (e) {
|
||||||
|
|
||||||
|
// #ifdef APP-PLUS
|
||||||
|
uni.hideKeyboard()
|
||||||
|
this.isShow = false
|
||||||
|
// #endif
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
navigateToBottom(){
|
||||||
|
// #ifdef H5
|
||||||
|
this.isShow = true
|
||||||
|
this.$refs.inputRef.focus()
|
||||||
|
// #endif
|
||||||
|
|
||||||
|
// #ifdef APP-PLUS
|
||||||
|
this.$nextTick(() => {
|
||||||
|
uni.pageScrollTo({
|
||||||
|
scrollTop: 5000000,
|
||||||
|
duration: 50,
|
||||||
|
success: () => {
|
||||||
|
setTimeout(() => {
|
||||||
|
this.isShow = true
|
||||||
|
}, 200);
|
||||||
|
;
|
||||||
|
},
|
||||||
|
fail: () => { },
|
||||||
|
complete: () => {}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
// #endif
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
eventHandle(){
|
||||||
|
|
||||||
|
this.inputHeight = 0
|
||||||
|
this.isShow = false
|
||||||
|
},
|
||||||
|
inputBindFocus(e){
|
||||||
|
if (e.detail.height) {
|
||||||
|
|
||||||
|
|
||||||
|
// #ifdef APP-PLUS
|
||||||
|
// 判断是否是ios
|
||||||
|
if (uni.getSystemInfoSync().platform == 'ios') {
|
||||||
|
this.inputHeight = e.detail.height - 40 //这个高度就是软键盘的高度
|
||||||
|
}else{
|
||||||
|
this.inputHeight = e.detail.height
|
||||||
|
}
|
||||||
|
// #endif
|
||||||
|
|
||||||
|
// #ifndef APP-PLUS
|
||||||
|
this.inputHeight = e.detail.height //这个高度就是软键盘的高度
|
||||||
|
// #endif
|
||||||
|
}
|
||||||
|
},
|
||||||
|
sendMessage () {
|
||||||
|
if (this.msg == "") {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
if (this.socketOpen == false) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
let msg = {
|
||||||
|
operation_type: "MESSAGE",
|
||||||
|
to: this.toUser.userId,
|
||||||
|
from: this.user.id,
|
||||||
|
message_type: "MESSAGE",
|
||||||
|
context: this.msg,
|
||||||
|
talk_id: this.params.talkId,
|
||||||
|
}
|
||||||
|
let data = JSON.stringify(msg);
|
||||||
|
uni.sendSocketMessage({
|
||||||
|
data: data,
|
||||||
|
});
|
||||||
|
this.msgList.push({
|
||||||
|
"text": this.msg,
|
||||||
|
"my": true,
|
||||||
|
"messageType": 'MESSAGE'
|
||||||
|
})
|
||||||
|
let type = 'down';
|
||||||
|
this.msgGo(type)
|
||||||
|
this.msg = ""
|
||||||
|
},
|
||||||
|
sendGoodsMessage () {
|
||||||
|
let msg = {
|
||||||
|
operation_type: "MESSAGE",
|
||||||
|
to: this.toUser.userId,
|
||||||
|
from: this.user.id,
|
||||||
|
message_type: "GOODS",
|
||||||
|
context: this.goodListData,
|
||||||
|
talk_id: this.params.talkId,
|
||||||
|
}
|
||||||
|
let data = JSON.stringify(msg);
|
||||||
|
uni.sendSocketMessage({
|
||||||
|
data: data
|
||||||
|
});
|
||||||
|
this.msgList.push({
|
||||||
|
"text": JSON.stringify(this.goodListData),
|
||||||
|
"my": true,
|
||||||
|
"messageType": 'GOODS'
|
||||||
|
})
|
||||||
|
this.showHide = false
|
||||||
|
// #ifdef H5
|
||||||
|
uni.setStorageSync("imGoodId", 1111111);
|
||||||
|
// #endif
|
||||||
|
this.$nextTick(() => {
|
||||||
|
uni.pageScrollTo({
|
||||||
|
scrollTop: 2000000,
|
||||||
|
duration: 300
|
||||||
|
});
|
||||||
|
})
|
||||||
|
},
|
||||||
|
socket () {
|
||||||
|
var _this = this;
|
||||||
|
uni.closeSocket();
|
||||||
|
this.socketOpen = false;
|
||||||
|
try {
|
||||||
|
//WebSocket的地址
|
||||||
|
var url = config.baseWsUrl + '/' + storage.getAccessToken();
|
||||||
|
// 连接
|
||||||
|
uni.connectSocket({
|
||||||
|
url: url,
|
||||||
|
});
|
||||||
|
// 监听WebSocket连接已打开
|
||||||
|
uni.onSocketOpen(function (res) {
|
||||||
|
_this.socketOpen = true;
|
||||||
|
});
|
||||||
|
if (!this.socketOpen) {
|
||||||
|
// 监听连接失败
|
||||||
|
|
||||||
|
uni.onSocketError(function (err) {
|
||||||
|
if (this.count < 3) {
|
||||||
|
if (err && err.code != 1000) {
|
||||||
|
_this.socketOpen = true;
|
||||||
|
setTimeout(() => {
|
||||||
|
uni.connectSocket({
|
||||||
|
url: url,
|
||||||
|
});
|
||||||
|
}, 2000)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
uni.closeSocket();
|
||||||
|
}
|
||||||
|
this.count++
|
||||||
|
});
|
||||||
|
}
|
||||||
|
// 监听收到信息
|
||||||
|
uni.onSocketMessage(function (res) {
|
||||||
|
res.data = JSON.parse(res.data)
|
||||||
|
console.log(res.data.result);
|
||||||
|
if (res.data.messageResultType == 'MESSAGE') {
|
||||||
|
_this.msgList.push(res.data.result)
|
||||||
|
console.log(_this.msgList)
|
||||||
|
}
|
||||||
|
console.log(res.data)
|
||||||
|
_this.msgGo()
|
||||||
|
})
|
||||||
|
} catch (e) {
|
||||||
|
uni.closeSocket();
|
||||||
|
}
|
||||||
|
// 监听是否断线,断线进行重新连接
|
||||||
|
uni.onSocketClose((res) => {
|
||||||
|
if (res.code != null && res.code != 1000) {
|
||||||
|
this.socket()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
beautifyTime,
|
||||||
|
//订单详情
|
||||||
|
linkTosOrders (val) {
|
||||||
|
let order = JSON.parse(val)
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '/pages/order/orderDetail?sn=' + order.sn,
|
||||||
|
});
|
||||||
|
|
||||||
|
},
|
||||||
|
// 跳转商品详情页
|
||||||
|
jumpGoodDesc (item) {
|
||||||
|
let info = JSON.parse(item.text)
|
||||||
|
uni.navigateTo({
|
||||||
|
url: `/pages/product/goods?id=${info.id}&goodsId=${info.goodsId}`,
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
//取消发送
|
||||||
|
cancelModel () {
|
||||||
|
this.showHide = false
|
||||||
|
},
|
||||||
|
// 请求商品详情
|
||||||
|
commodityDetails () {
|
||||||
|
jumpObtain(this.resolve.skuid, this.resolve.goodsid).then((res) => {
|
||||||
|
this.goodListData = res.data.result.data
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 切换输入法时移动输入框(按照官方的上推页面的原理应该会自动适应不同的键盘高度-->官方bug)
|
||||||
|
goPag (kh) {
|
||||||
|
this.retractBox(0, 250)
|
||||||
|
if (this.keyHeight != 0) {
|
||||||
|
if (kh - this.keyHeight > 0) {
|
||||||
|
this.retractBox(this.keyHeight - kh, 250)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 移动顶部的空盒子
|
||||||
|
messageBoxMove (x, t) {
|
||||||
|
var animation = uni.createAnimation({
|
||||||
|
duration: t,
|
||||||
|
timingFunction: 'linear',
|
||||||
|
})
|
||||||
|
this.animation = animation
|
||||||
|
animation.height(x).step()
|
||||||
|
this.anData = animation.export()
|
||||||
|
},
|
||||||
|
// 保持消息体可见
|
||||||
|
msgGo (type) {
|
||||||
|
const query = uni.createSelectorQuery()
|
||||||
|
// 延时100ms保证是最新的高度
|
||||||
|
setTimeout(() => {
|
||||||
|
// 获取消息体高度
|
||||||
|
query.select('#msgList').boundingClientRect(data => {
|
||||||
|
// 如果超过scorll高度就滚动scorll
|
||||||
|
if (type == 'up') {
|
||||||
|
this.go = data.height - this.oldHeight
|
||||||
|
} else if (type == 'down') {
|
||||||
|
this.go = data.height - wh + 120
|
||||||
|
}
|
||||||
|
// if (this.oldHeight > 0) {
|
||||||
|
// this.go = data.height - this.oldHeight
|
||||||
|
// } else {
|
||||||
|
// // if (data.height - (wh - 32) > 0) {
|
||||||
|
// this.go = data.height - wh + 120
|
||||||
|
// }
|
||||||
|
// 保证键盘第一次拉起时消息体能保持可见
|
||||||
|
var moveY = wh - data.height
|
||||||
|
// 超出页面则缩回空盒子
|
||||||
|
if (moveY - mgUpHeight < 0) {
|
||||||
|
// 小于0则视为0
|
||||||
|
if (moveY < 0) {
|
||||||
|
this.messageBoxMove(0, 200)
|
||||||
|
} else {
|
||||||
|
// 否则缩回盒子对应的高度
|
||||||
|
this.messageBoxMove(moveY, 200)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
uni.pageScrollTo({
|
||||||
|
scrollTop: this.go,
|
||||||
|
duration: 0
|
||||||
|
})
|
||||||
|
this.oldHeight = data.height
|
||||||
|
}).exec();
|
||||||
|
}, 100)
|
||||||
|
},
|
||||||
|
// 回答问题的业务逻辑
|
||||||
|
answer (id) {
|
||||||
|
// 这里应该传入问题的id,模拟就用index代替了
|
||||||
|
|
||||||
|
},
|
||||||
|
// 不建议输入框聚焦时操作此动画
|
||||||
|
ckAdd () {
|
||||||
|
if (!this.showTow) {
|
||||||
|
this.retractBox(-180, 350)
|
||||||
|
} else {
|
||||||
|
this.retractBox(0, 200)
|
||||||
|
}
|
||||||
|
this.showTow = !this.showTow
|
||||||
|
},
|
||||||
|
hideKey () {
|
||||||
|
uni.hideKeyboard()
|
||||||
|
},
|
||||||
|
// 拉起/收回附加栏
|
||||||
|
retractBox (x, t) {
|
||||||
|
var animation = uni.createAnimation({
|
||||||
|
duration: t,
|
||||||
|
timingFunction: 'ease',
|
||||||
|
})
|
||||||
|
this.animation = animation
|
||||||
|
animation.translateY(x).step()
|
||||||
|
this.animationData = animation.export()
|
||||||
|
},
|
||||||
|
async getTalkMessage () {
|
||||||
|
let type = '';
|
||||||
|
await getTalkMessage(this.params).then(res => {
|
||||||
|
if (res.data.success) {
|
||||||
|
if (this.msgList.length >= 10) {
|
||||||
|
this.msgList.unshift(...res.data.result)
|
||||||
|
type = 'up'
|
||||||
|
} else {
|
||||||
|
this.msgList.unshift(...res.data.result)
|
||||||
|
type = 'down'
|
||||||
|
}
|
||||||
|
this.msgList.forEach(item => {
|
||||||
|
if (item.fromUser === this.user.id) {
|
||||||
|
item.my = true
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
console.log(this.msgList);
|
||||||
|
this.msgGo(type)
|
||||||
|
},
|
||||||
|
// 上拉加载
|
||||||
|
touchMoreMessage (e) {
|
||||||
|
if (e.target.scrollTop == 0) {
|
||||||
|
this.params.pageNumber = this.params.pageNumber + 1
|
||||||
|
this.getTalkMessage()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
async getTalk (userId) {
|
||||||
|
getTalkByUser(userId).then(res => {
|
||||||
|
if (res.data.success) {
|
||||||
|
this.toUser = res.data.result
|
||||||
|
this.params.talkId = res.data.result.id
|
||||||
|
this.getTalkMessage()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 处理消息时间是否显示
|
||||||
|
compareTime (index, datetime) {
|
||||||
|
if (datetime == undefined) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (typeof datetime == "number") {
|
||||||
|
datetime = this.unixToDate(datetime, "yyyy-MM-dd hh:mm");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.msgList[index].is_revoke == 1) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (datetime) {
|
||||||
|
datetime = datetime.replace(/-/g, "/");
|
||||||
|
}
|
||||||
|
|
||||||
|
let time = Math.floor(Date.parse(datetime) / 1000);
|
||||||
|
let currTime = Math.floor(new Date().getTime() / 1000);
|
||||||
|
|
||||||
|
// 当前时间5分钟内时间不显示
|
||||||
|
if (currTime - time < 300) return false;
|
||||||
|
// 判断是否是最后一条消息,最后一条消息默认显示时间
|
||||||
|
if (index == this.msgList.length - 1) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
let nextDate
|
||||||
|
if (this.msgList[index + 1] && this.msgList[index + 1].createTime) {
|
||||||
|
nextDate = this.msgList[index + 1].createTime.replace(/-/g, "/");
|
||||||
|
if (nextDate - datetime < 300) return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return !(
|
||||||
|
this.unixToDate(new Date(datetime), "{y}-{m}-{d} {h}:{i}") ==
|
||||||
|
this.unixToDate(new Date(nextDate), "{y}-{m}-{d} {h}:{i}")
|
||||||
|
);
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 将unix时间戳转换为指定格式
|
||||||
|
* @param unix 时间戳【秒】
|
||||||
|
* @param format 转换格式
|
||||||
|
* @returns {*|string}
|
||||||
|
*/
|
||||||
|
unixToDate (unix, format) {
|
||||||
|
if (!unix) return unix;
|
||||||
|
let _format = format || "yyyy-MM-dd hh:mm:ss";
|
||||||
|
const d = new Date(unix);
|
||||||
|
const o = {
|
||||||
|
"M+": d.getMonth() + 1,
|
||||||
|
"d+": d.getDate(),
|
||||||
|
"h+": d.getHours(),
|
||||||
|
"m+": d.getMinutes(),
|
||||||
|
"s+": d.getSeconds(),
|
||||||
|
"q+": Math.floor((d.getMonth() + 3) / 3),
|
||||||
|
S: d.getMilliseconds(),
|
||||||
|
};
|
||||||
|
if (/(y+)/.test(_format))
|
||||||
|
_format = _format.replace(
|
||||||
|
RegExp.$1,
|
||||||
|
(d.getFullYear() + "").substr(4 - RegExp.$1.length)
|
||||||
|
);
|
||||||
|
for (const k in o)
|
||||||
|
if (new RegExp("(" + k + ")").test(_format))
|
||||||
|
_format = _format.replace(
|
||||||
|
RegExp.$1,
|
||||||
|
RegExp.$1.length === 1 ?
|
||||||
|
o[k] :
|
||||||
|
("00" + o[k]).substr(("" + o[k]).length)
|
||||||
|
);
|
||||||
|
return _format;
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.send{
|
||||||
|
font-size: 24rpx !important;
|
||||||
|
}
|
||||||
|
.order-time {
|
||||||
|
margin-top: 15rpx;
|
||||||
|
white-space: nowrap;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wrapper {
|
||||||
|
height: auto !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.order-list {
|
||||||
|
display: flex;
|
||||||
|
color: black;
|
||||||
|
font-size: 20rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
width: 95%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.order-sn {
|
||||||
|
width: 350rpx;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.name-or-time {
|
||||||
|
width: 200rpx;
|
||||||
|
margin: 15rpx 15rpx;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.goods-card {
|
||||||
|
border-radius: 20rpx;
|
||||||
|
margin-top: 15rpx;
|
||||||
|
background-color: #ffffff;
|
||||||
|
padding-left: 12rpx;
|
||||||
|
width: 95%;
|
||||||
|
height: 120rpx;
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
color: #302c2b;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
.image-box {
|
||||||
|
width: 122rpx;
|
||||||
|
height: 122rpx;
|
||||||
|
overflow: hidden;
|
||||||
|
|
||||||
|
.image {
|
||||||
|
width: 122rpx;
|
||||||
|
border-radius: 10rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.goods-desc {
|
||||||
|
flex: 1;
|
||||||
|
overflow: hidden;
|
||||||
|
margin-left: 12rpx;
|
||||||
|
width: 400rpx;
|
||||||
|
|
||||||
|
.goods-desc-name {
|
||||||
|
font-size: 30rpx;
|
||||||
|
line-height: 1.5;
|
||||||
|
white-space: nowrap;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
overflow: hidden;
|
||||||
|
margin-bottom: 20rpx;
|
||||||
|
|
||||||
|
|
||||||
|
.goods-card-goods-name {
|
||||||
|
color: black;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
font-size: 26rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.price {
|
||||||
|
margin-top: 50rpx;
|
||||||
|
line-height: 2;
|
||||||
|
margin-left: 5px;
|
||||||
|
font-size: 26rpx;
|
||||||
|
font-weight: 700;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.send-goods {
|
||||||
|
color: #ffffff;
|
||||||
|
height: 50rpx;
|
||||||
|
width: 130rpx;
|
||||||
|
background-color: #f21c0c;
|
||||||
|
font-size: 24rpx;
|
||||||
|
border-radius: 17rpx;
|
||||||
|
text-align: center;
|
||||||
|
line-height: 50rpx;
|
||||||
|
padding: 0 10rpx;
|
||||||
|
position: relative;
|
||||||
|
top: 20rpx;
|
||||||
|
right: 20rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.cancel {
|
||||||
|
color: #737373;
|
||||||
|
position: relative;
|
||||||
|
bottom: 40rpx;
|
||||||
|
left: 12%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cart-message {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.bottom-dh-char {
|
||||||
|
background-color: #f9f9f9;
|
||||||
|
width: 750rpx;
|
||||||
|
height: 110rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.user-name {
|
||||||
|
text-align: right;
|
||||||
|
font-size: 24rpx;
|
||||||
|
color: #737373;
|
||||||
|
margin-bottom: 10rpx;
|
||||||
|
margin-right: 10rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.other-name {
|
||||||
|
text-align: left;
|
||||||
|
font-size: 24rpx;
|
||||||
|
color: #737373;
|
||||||
|
margin-bottom: 10rpx;
|
||||||
|
margin-left: 10rpx;
|
||||||
|
}
|
||||||
|
.dh-input {
|
||||||
|
line-height: 65rpx;
|
||||||
|
width: 500rpx;
|
||||||
|
height: 65rpx;
|
||||||
|
border-radius: 30rpx;
|
||||||
|
padding-left: 15rpx;
|
||||||
|
font-size: 22rpx;
|
||||||
|
background-color: #FFFFFF;
|
||||||
|
}
|
||||||
|
.column-time {
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
.chat-img {
|
||||||
|
border-radius: 50%;
|
||||||
|
width: 100rpx;
|
||||||
|
height: 100rpx;
|
||||||
|
background-color: #f7f7f7;
|
||||||
|
}
|
||||||
|
|
||||||
|
.padding-chat {
|
||||||
|
padding: 17rpx 20rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tb-nv {
|
||||||
|
width: 50rpx;
|
||||||
|
height: 50rpx;
|
||||||
|
}
|
||||||
|
.goods-desc-rice{
|
||||||
|
font-size: 24rpx;
|
||||||
|
color: $main-color;
|
||||||
|
font-weight: bold;
|
||||||
|
margin-top: 10rpx;
|
||||||
|
}
|
||||||
|
.order-item{
|
||||||
|
margin: 10rpx 0
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
uni-page-head {
|
||||||
|
position: fixed;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
z-index: 9999;
|
||||||
|
}
|
||||||
|
.bottom-dh{
|
||||||
|
position: fixed; // input 所在盒子设置绝对定位
|
||||||
|
flex-shrink: 0;
|
||||||
|
width: 100%;
|
||||||
|
left: 0;
|
||||||
|
bottom: 0; // 默认 0
|
||||||
|
z-index: 199;
|
||||||
|
padding-bottom: env(safe-area-inset-bottom);
|
||||||
|
background: #FFFFFF;
|
||||||
|
box-sizing: border-box;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
@import "./index-app.scss";
|
||||||
|
</style>
|
||||||
237
pages/mine/im/list.vue
Normal file
237
pages/mine/im/list.vue
Normal file
@@ -0,0 +1,237 @@
|
|||||||
|
<template>
|
||||||
|
<view class="content">
|
||||||
|
<u-navbar class="my-title" title-size="32" :title="'消息(' + talkList.length + ')'"></u-navbar>
|
||||||
|
<scroll-view class="list-scroll-content" scroll-y @scrolltolower="loadData(tabIndex)">
|
||||||
|
|
||||||
|
<!-- 消息列表 -->
|
||||||
|
<div class="iconBox">
|
||||||
|
<view class="icon-list">
|
||||||
|
<view class="icon-item" @click="cleanUnread()">
|
||||||
|
<div class="bag bag1">
|
||||||
|
<u-icon name="trash" size="50" color="#fff"></u-icon>
|
||||||
|
</div>
|
||||||
|
<view>清除未读</view>
|
||||||
|
</view>
|
||||||
|
<view class="icon-item" @click="navigateTo('/pages/tabbar/home/title')">
|
||||||
|
<div class="bag bag2">
|
||||||
|
<u-icon name="bell" size="50" color="#fff"></u-icon>
|
||||||
|
</div>
|
||||||
|
<view>系统消息</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</div>
|
||||||
|
<u-search class="nav-search" v-model="userName" clearabled @change="userTalkList()" placeholder="搜索用户"
|
||||||
|
:show-action="false"></u-search>
|
||||||
|
<view class="talk-view" :key="index" v-for="(item, index) in talkList">
|
||||||
|
<view>
|
||||||
|
<view @click="onclickToTalkInfo(item)">
|
||||||
|
<view class="talk-item-view">
|
||||||
|
<view class="talk-img">
|
||||||
|
<u-avatar :src="item.face" :text="item.face ? '' : item.name" bg-color="#DDDDDD"></u-avatar>
|
||||||
|
</view>
|
||||||
|
<view class="talk-info">
|
||||||
|
<view class="talk-name u-line-2">{{ item.name }}
|
||||||
|
<u-tag class="talk-tag" size="mini" text="店铺" type="warning" v-if="item.storeFlag" />
|
||||||
|
</view>
|
||||||
|
<view class="talk-message">
|
||||||
|
<span v-if="item.lastMessageType == 'MESSAGE'">{{ item.lastTalkMessage }}</span>
|
||||||
|
<span v-if="item.lastMessageType == 'GOODS'">[商品链接]</span>
|
||||||
|
<span v-if="item.lastMessageType == 'ORDER'">[订单信息]</span>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="talk-time">
|
||||||
|
<view>
|
||||||
|
{{ beautifyTime(item.lastTalkTime) }}
|
||||||
|
</view>
|
||||||
|
<view>
|
||||||
|
<u-badge type="error" absolute :offset="[45, 20]" :count="item.unread"></u-badge>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<!-- 空白页 -->
|
||||||
|
<u-empty text="暂无信息" mode="list" v-if="talkList.length === 0"></u-empty>
|
||||||
|
</scroll-view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { getTalkList, clearmeaager } from "@/api/im.js";
|
||||||
|
import storage from "@/utils/storage.js";
|
||||||
|
import { beautifyTime } from "@/utils/filters.js"
|
||||||
|
export default {
|
||||||
|
data () {
|
||||||
|
return {
|
||||||
|
storage,
|
||||||
|
count: {
|
||||||
|
loadStatus: "more",
|
||||||
|
},
|
||||||
|
talkList: [], //聊天列表
|
||||||
|
userName: '',
|
||||||
|
pointData: {}, //累计获取 未输入 集合
|
||||||
|
};
|
||||||
|
},
|
||||||
|
|
||||||
|
onShow () {
|
||||||
|
this.userTalkList();
|
||||||
|
},
|
||||||
|
onPullDownRefresh () {
|
||||||
|
this.userTalkList()
|
||||||
|
console.log('下拉事件');
|
||||||
|
setTimeout(function () {
|
||||||
|
uni.stopPullDownRefresh();
|
||||||
|
}, 1000);
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 触底加载
|
||||||
|
*/
|
||||||
|
onReachBottom () {
|
||||||
|
this.userTalkList();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
beautifyTime,
|
||||||
|
onclickToTalkInfo (val) {
|
||||||
|
storage.setTalkToUser(val)
|
||||||
|
uni.navigateTo({
|
||||||
|
url:
|
||||||
|
"/pages/mine/im/index?talkId=" + val.id,
|
||||||
|
});
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 获取聊天列表
|
||||||
|
*/
|
||||||
|
userTalkList () {
|
||||||
|
let params = {
|
||||||
|
userName: this.userName,
|
||||||
|
}
|
||||||
|
uni.showLoading({
|
||||||
|
title: "加载中",
|
||||||
|
});
|
||||||
|
getTalkList(params).then((res) => {
|
||||||
|
if (this.$store.state.isShowToast){ uni.hideLoading() };
|
||||||
|
if (res.data.success) {
|
||||||
|
this.talkList = res.data.result;
|
||||||
|
console.log(this.talkList, 'this.talkListthis.talkList');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
navigateTo (url) {
|
||||||
|
uni.navigateTo({
|
||||||
|
url,
|
||||||
|
});
|
||||||
|
},
|
||||||
|
cleanUnread () {
|
||||||
|
clearmeaager().then((res) => {
|
||||||
|
console.log(res);
|
||||||
|
if (res.data.code == 200) {
|
||||||
|
this.userTalkList();
|
||||||
|
uni.showToast({
|
||||||
|
icon: "none",
|
||||||
|
title: res.data.message,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.talk-view {
|
||||||
|
border-radius: 20rpx;
|
||||||
|
background-color: #fff;
|
||||||
|
|
||||||
|
.talk-item-view {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
flex-direction: row;
|
||||||
|
padding: 10rpx 20rpx;
|
||||||
|
|
||||||
|
.talk-img {
|
||||||
|
width: 100rpx;
|
||||||
|
height: 100rpx;
|
||||||
|
margin-right: 10rpx;
|
||||||
|
margin-bottom: 10rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.talk-info {
|
||||||
|
padding-left: 30rpx;
|
||||||
|
flex: 1;
|
||||||
|
|
||||||
|
.talk-name {
|
||||||
|
font-size: 28rpx;
|
||||||
|
margin-bottom: 10rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
color: #333333;
|
||||||
|
}
|
||||||
|
|
||||||
|
.talk-message {
|
||||||
|
font-size: 28rpx;
|
||||||
|
margin-top: 10rpx;
|
||||||
|
color: #888787;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.talk-tag {
|
||||||
|
margin-left: 10rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.talk-time {
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
.iconBox {
|
||||||
|
width: 94%;
|
||||||
|
margin: 0 3%;
|
||||||
|
background: #fff;
|
||||||
|
border-radius: 20rpx;
|
||||||
|
box-shadow: 0 4rpx 24rpx 0 rgba($color: #f6f6f6, $alpha: 1);
|
||||||
|
// transform: translateY(-30rpx);
|
||||||
|
}
|
||||||
|
|
||||||
|
.icon-list {
|
||||||
|
height: 140rpx;
|
||||||
|
text-align: center;
|
||||||
|
font-size: $font-sm;
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-around;
|
||||||
|
align-items: center;
|
||||||
|
padding: 0 3%;
|
||||||
|
color: #999;
|
||||||
|
|
||||||
|
.icon-item {
|
||||||
|
position: relative;
|
||||||
|
line-height: 2em;
|
||||||
|
width: 96rpx;
|
||||||
|
|
||||||
|
:first-child {
|
||||||
|
font-size: 48rpx;
|
||||||
|
margin-bottom: 10rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.bag {
|
||||||
|
width: 56rpx;
|
||||||
|
height: 56rpx;
|
||||||
|
border-radius: 50%;
|
||||||
|
margin: 0 auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.bag1 {
|
||||||
|
background: #ff0015;
|
||||||
|
}
|
||||||
|
|
||||||
|
.bag2 {
|
||||||
|
background: #73AF7C;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
@import "./index-app.scss";
|
||||||
|
</style>
|
||||||
166
pages/mine/im/socket.js
Normal file
166
pages/mine/im/socket.js
Normal file
@@ -0,0 +1,166 @@
|
|||||||
|
import config from '@/config/config.js'
|
||||||
|
import storage from '@/utils/storage';
|
||||||
|
class socketIO {
|
||||||
|
constructor(data, time, url) {
|
||||||
|
this.socketTask = null
|
||||||
|
this.is_open_socket = false //避免重复连接
|
||||||
|
this.url = config.baseWsUrl + '/' + storage.getAccessToken() //连接地址
|
||||||
|
this.data = data ? data : null
|
||||||
|
this.connectNum = 1 // 重连次数
|
||||||
|
this.traderDetailIndex = 100 // traderDetailIndex ==2 重连
|
||||||
|
this.accountStateIndex = 100 // traderDetailIndex ==1 重连
|
||||||
|
this.followFlake = false // traderDetailIndex == true 重连
|
||||||
|
//心跳检测
|
||||||
|
this.timeout = time ? time : 15000 //多少秒执行检测
|
||||||
|
this.heartbeatInterval = null //检测服务器端是否还活着
|
||||||
|
this.reconnectTimeOut = null //重连之后多久再次重连
|
||||||
|
}
|
||||||
|
// 进入这个页面的时候创建websocket连接【整个页面随时使用】
|
||||||
|
connectSocketInit (data) {
|
||||||
|
this.data = data
|
||||||
|
this.socketTask = uni.connectSocket({
|
||||||
|
url: this.url,
|
||||||
|
success: () => {
|
||||||
|
console.log("正准备建立websocket中...");
|
||||||
|
// 返回实例
|
||||||
|
return this.socketTask
|
||||||
|
},
|
||||||
|
});
|
||||||
|
this.socketTask.onOpen((res) => {
|
||||||
|
this.connectNum = 1
|
||||||
|
console.log("WebSocket连接正常!");
|
||||||
|
this.send(data)
|
||||||
|
clearInterval(this.reconnectTimeOut)
|
||||||
|
clearInterval(this.heartbeatInterval)
|
||||||
|
this.is_open_socket = true;
|
||||||
|
this.start();
|
||||||
|
// 注:只有连接正常打开中 ,才能正常收到消息
|
||||||
|
this.socketTask.onMessage((e) => {
|
||||||
|
// 字符串转json
|
||||||
|
let res = JSON.parse(e.data);
|
||||||
|
console.log("res---------->", res) // 这里 查看 推送过来的消息
|
||||||
|
if (res.data) {
|
||||||
|
uni.$emit('getPositonsOrder', res);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
})
|
||||||
|
// 监听连接失败,这里代码我注释掉的原因是因为如果服务器关闭后,和下面的onclose方法一起发起重连操作,这样会导致重复连接
|
||||||
|
uni.onSocketError((res) => {
|
||||||
|
console.log('WebSocket连接打开失败,请检查!');
|
||||||
|
this.socketTask = null
|
||||||
|
this.is_open_socket = false;
|
||||||
|
clearInterval(this.heartbeatInterval)
|
||||||
|
clearInterval(this.reconnectTimeOut)
|
||||||
|
uni.$off('getPositonsOrder')
|
||||||
|
if (this.connectNum < 6) {
|
||||||
|
uni.showToast({
|
||||||
|
title: `WebSocket连接失败,正尝试第${this.connectNum}次连接`,
|
||||||
|
icon: "none"
|
||||||
|
})
|
||||||
|
this.reconnect();
|
||||||
|
this.connectNum += 1
|
||||||
|
} else {
|
||||||
|
uni.$emit('connectError');
|
||||||
|
this.connectNum = 1
|
||||||
|
}
|
||||||
|
});
|
||||||
|
// 这里仅是事件监听【如果socket关闭了会执行】
|
||||||
|
this.socketTask.onClose(() => {
|
||||||
|
console.log("已经被关闭了-------")
|
||||||
|
clearInterval(this.heartbeatInterval)
|
||||||
|
clearInterval(this.reconnectTimeOut)
|
||||||
|
this.is_open_socket = false;
|
||||||
|
this.socketTask = null
|
||||||
|
uni.$off('getPositonsOrder')
|
||||||
|
if (this.connectNum < 6) {
|
||||||
|
this.reconnect();
|
||||||
|
} else {
|
||||||
|
uni.$emit('connectError');
|
||||||
|
this.connectNum = 1
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 主动关闭socket连接
|
||||||
|
Close () {
|
||||||
|
if (!this.is_open_socket) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.socketTask.close({
|
||||||
|
success () {
|
||||||
|
uni.showToast({
|
||||||
|
title: 'SocketTask 关闭成功',
|
||||||
|
icon: "none"
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
//发送消息
|
||||||
|
send (data) {
|
||||||
|
console.log("data---------->", data);
|
||||||
|
// 注:只有连接正常打开中 ,才能正常成功发送消息
|
||||||
|
if (this.socketTask) {
|
||||||
|
this.socketTask.send({
|
||||||
|
data: JSON.stringify(data),
|
||||||
|
async success () {
|
||||||
|
console.log("消息发送成功");
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//开启心跳检测
|
||||||
|
start () {
|
||||||
|
this.heartbeatInterval = setInterval(() => {
|
||||||
|
this.send({
|
||||||
|
"traderid": 10260,
|
||||||
|
"type": "Ping"
|
||||||
|
});
|
||||||
|
}, this.timeout)
|
||||||
|
}
|
||||||
|
//重新连接
|
||||||
|
reconnect () {
|
||||||
|
//停止发送心跳
|
||||||
|
clearInterval(this.heartbeatInterval)
|
||||||
|
//如果不是人为关闭的话,进行重连
|
||||||
|
if (!this.is_open_socket && (this.traderDetailIndex == 2 || this.accountStateIndex == 0 || this
|
||||||
|
.followFlake)) {
|
||||||
|
this.reconnectTimeOut = setInterval(() => {
|
||||||
|
this.connectSocketInit(this.data);
|
||||||
|
}, 5000)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* @description 将 scoket 数据进行过滤
|
||||||
|
* @param {array} array
|
||||||
|
* @param {string} type 区分 弹窗 openposition 分为跟随和我的
|
||||||
|
*/
|
||||||
|
arrayFilter (array, type = 'normal', signalId = 0) {
|
||||||
|
let arr1 = []
|
||||||
|
let arr2 = []
|
||||||
|
let obj = {
|
||||||
|
arr1: [],
|
||||||
|
arr2: []
|
||||||
|
}
|
||||||
|
arr1 = array.filter(v => v.flwsig == true)
|
||||||
|
arr2 = array.filter(v => v.flwsig == false)
|
||||||
|
if (type == 'normal') {
|
||||||
|
if (signalId) {
|
||||||
|
arr1 = array.filter(v => v.flwsig == true && v.sigtraderid == signalId)
|
||||||
|
return arr1
|
||||||
|
} else {
|
||||||
|
return arr1.concat(arr2)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (signalId > 0) {
|
||||||
|
arr1 = array.filter(v => v.flwsig == true && v.sigtraderid == signalId)
|
||||||
|
obj.arr1 = arr1
|
||||||
|
} else {
|
||||||
|
obj.arr1 = arr1
|
||||||
|
}
|
||||||
|
obj.arr2 = arr2
|
||||||
|
return obj
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
export {
|
||||||
|
socketIO
|
||||||
|
}
|
||||||
@@ -86,7 +86,7 @@
|
|||||||
background: #f9f9f9;
|
background: #f9f9f9;
|
||||||
}
|
}
|
||||||
|
|
||||||
/deep/ .u-col-2 {
|
::v-deep .u-col-2 {
|
||||||
height: 60px;
|
height: 60px;
|
||||||
line-height: 60px;
|
line-height: 60px;
|
||||||
text-align: center !important;
|
text-align: center !important;
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ export default {
|
|||||||
title:"加载中"
|
title:"加载中"
|
||||||
})
|
})
|
||||||
API_Message.getLogisticsMessages(this.params).then(async response => {
|
API_Message.getLogisticsMessages(this.params).then(async response => {
|
||||||
uni.hideLoading()
|
if (this.$store.state.isShowToast){ uni.hideLoading() }
|
||||||
const { data } = response
|
const { data } = response
|
||||||
if (!data || !data.length) {
|
if (!data || !data.length) {
|
||||||
this.messageList.push(...data.data)
|
this.messageList.push(...data.data)
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ export default {
|
|||||||
title: "加载中"
|
title: "加载中"
|
||||||
});
|
});
|
||||||
API_Message.getMessages(this.params).then(async response => {
|
API_Message.getMessages(this.params).then(async response => {
|
||||||
uni.hideLoading();
|
if (this.$store.state.isShowToast){ uni.hideLoading() };
|
||||||
const { data } = response;
|
const { data } = response;
|
||||||
if (!data || !data.length) {
|
if (!data || !data.length) {
|
||||||
this.messageList.push(...data.data);
|
this.messageList.push(...data.data);
|
||||||
|
|||||||
@@ -1,422 +1,454 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="content">
|
<view class="content">
|
||||||
<view class="navbar">
|
<u-navbar>
|
||||||
<!-- 循环出顶部nav栏 -->
|
<u-tabs :active-color="lightColor" class="slot-wrap" :list="navList" count="count" :is-scroll="true" :current="tabCurrentIndex" @change="tabClick"></u-tabs>
|
||||||
<view v-for="(item, index) in navList" :key="index" class="nav-item" @click="tabClick(index)">
|
</u-navbar>
|
||||||
<text :class="{current: tabCurrentIndex === index}">{{item.text}}</text>
|
<view class="swiper-box">
|
||||||
</view>
|
<!-- 显示商品栏 -->
|
||||||
</view>
|
<view v-if="tabCurrentIndex == 0" class="tab-content">
|
||||||
<view class="swiper-box">
|
<scroll-view class="list-scroll-content" scroll-y>
|
||||||
<!-- 显示商品栏 -->
|
<!-- 空白页 -->
|
||||||
<view v-if="tabCurrentIndex == 0" class="tab-content">
|
<u-empty style="margin-top: 40rpx" text="暂无收藏商品数据" mode="favor" v-if="goodsEmpty"></u-empty>
|
||||||
<scroll-view class="list-scroll-content" scroll-y @scrolltolower="loadMore">
|
<!-- 商品展示数据 -->
|
||||||
<!-- 空白页 -->
|
<u-swipe-action @open="openLeftChange(item, index, 'goods')" :show="item.selected" btn-width="180"
|
||||||
<u-empty style="margin-top:40rpx;" text="暂无收藏商品数据" mode="favor" v-if="goodsEmpty"></u-empty>
|
:options="LeftOptions" v-else v-for="(item, index) in goodList"
|
||||||
<!-- 商品展示数据 -->
|
@click="clickGoodsSwiperAction(item, index)" :index="index" :key="index">
|
||||||
<u-swipe-action @open="openLeftChange(item,index,'goods')" :show="item.selected" btn-width="180"
|
<view class="goods" @click="goGoodsDetail(item)">
|
||||||
:options="LeftOptions" v-else v-for="(item,index) in goodList" @click="clickGoodsSwiperAction(item,index)"
|
<u-image width="131rpx" height="131rpx" :src="item.image" mode="aspectFit">
|
||||||
:index="index" :key="index">
|
<u-loading slot="loading"></u-loading>
|
||||||
<view class="goods" @click="goGoodsDetail(item)">
|
</u-image>
|
||||||
<u-image width="131rpx" height="131rpx" :src="item.image" mode="aspectFit">
|
<view class="goods-intro">
|
||||||
<u-loading slot="loading"></u-loading>
|
<view>{{ item.goodsName }}</view>
|
||||||
</u-image>
|
<view class="goods-sn">{{ item.goods_sn }}</view>
|
||||||
<view class="goods-intro">
|
<view>¥{{ item.price | unitPrice }}</view>
|
||||||
<view>{{item.goodsName}}</view>
|
</view>
|
||||||
<view class="goods-sn">{{item.goods_sn}}</view>
|
</view>
|
||||||
<view>¥{{item.price | unitPrice}}</view>
|
</u-swipe-action>
|
||||||
</view>
|
|
||||||
</view>
|
</scroll-view>
|
||||||
</u-swipe-action>
|
</view>
|
||||||
|
<!-- 显示收藏的店铺栏 -->
|
||||||
<uni-load-more :status="goodsLoad"></uni-load-more>
|
<view v-else class="tab-content">
|
||||||
</scroll-view>
|
<scroll-view class="list-scroll-content" scroll-y>
|
||||||
</view>
|
<!-- 空白页 -->
|
||||||
<!-- 显示收藏的店铺栏 -->
|
<u-empty style="margin-top: 40rpx" text="暂无收藏店铺数据" mode="favor" v-if="storeEmpty"></u-empty>
|
||||||
<view v-else class="tab-content">
|
<!-- 店铺展示数据 -->
|
||||||
<scroll-view class="list-scroll-content" scroll-y @scrolltolower="loadMore">
|
<u-swipe-action @open="openLeftChange(item, 'store')" :show="item.selected" btn-width="180"
|
||||||
<!-- 空白页 -->
|
:options="LeftOptions" v-else v-for="(item, index) in storeList" :key="index"
|
||||||
<u-empty style="margin-top:40rpx;" text="暂无收藏店铺数据" mode="favor" v-if="storeEmpty"></u-empty>
|
@click="clickStoreSwiperAction(item)">
|
||||||
<!-- 店铺展示数据 -->
|
<view class="store" @click="goStoreMainPage(item.id)">
|
||||||
<u-swipe-action @open="openLeftChange(item,'store')" :show="item.selected" btn-width="180"
|
<view class="intro">
|
||||||
:options="LeftOptions" v-else v-for="(item,index) in storeList" :key="index"
|
<view class="store-logo">
|
||||||
@click="clickstoreSwiperAction(item)">
|
<u-image width="102rpx" height="102rpx" :src="item.storeLogo" :alt="item.storeName"
|
||||||
<view class="store" @click="gostoreMainPage(item.id)">
|
mode="aspectFit">
|
||||||
<view class="intro">
|
<u-loading slot="loading"></u-loading>
|
||||||
<view class="store-logo">
|
</u-image>
|
||||||
<u-image width="102rpx" height="102rpx" :src="item.storeLogo" :alt="item.storeName" mode="aspectFit">
|
</view>
|
||||||
<u-loading slot="loading"></u-loading>
|
<view class="store-name">
|
||||||
</u-image>
|
<view>{{ item.storeName }}</view>
|
||||||
</view>
|
<u-tag size="mini" type="error" :color="$mainColor" v-if="item.selfOperated"
|
||||||
<view class="store-name">
|
text="自营" mode="plain" shape="circle" />
|
||||||
<view>{{item.storeName}}</view>
|
</view>
|
||||||
<u-tag size="mini" type="error" :color="$mainColor" v-if="item.selfOperated" text="自营" mode="plain"
|
<view class="store-collect">
|
||||||
shape="circle" />
|
<view>进店逛逛</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="store-collect">
|
</view>
|
||||||
<view>进店逛逛</view>
|
</view>
|
||||||
</view>
|
</u-swipe-action>
|
||||||
</view>
|
</scroll-view>
|
||||||
</view>
|
</view>
|
||||||
</u-swipe-action>
|
</view>
|
||||||
<uni-load-more :status="storeLoad"></uni-load-more>
|
</view>
|
||||||
</scroll-view>
|
</template>
|
||||||
</view>
|
|
||||||
</view>
|
<script>
|
||||||
</view>
|
import {
|
||||||
</template>
|
getGoodsCollection,
|
||||||
|
getStoreCollection,
|
||||||
<script>
|
deleteGoodsCollection,
|
||||||
import {
|
deleteStoreCollection,
|
||||||
getGoodsCollection,
|
} from "@/api/members.js";
|
||||||
deleteGoodsCollection,
|
export default {
|
||||||
deleteStoreCollection,
|
data() {
|
||||||
} from "@/api/members.js";
|
return {
|
||||||
export default {
|
lightColor:this.$lightColor,
|
||||||
data() {
|
// 商品左滑侧边栏
|
||||||
return {
|
LeftOptions: [{
|
||||||
// 商品左滑侧边栏
|
text: "取消",
|
||||||
LeftOptions: [
|
style: {
|
||||||
{
|
backgroundColor: this.$lightColor,
|
||||||
text: "取消",
|
},
|
||||||
style: {
|
}, ],
|
||||||
backgroundColor: this.$lightColor,
|
tabCurrentIndex: 0, //tab的下标默认为0,也就是说会默认请求商品
|
||||||
},
|
navList: [
|
||||||
},
|
//tab显示数据
|
||||||
],
|
{
|
||||||
tabCurrentIndex: 0, //tab的下标默认为0,也就是说会默认请求商品
|
name: "商品(0)",
|
||||||
navList: [
|
|
||||||
//tab显示数据
|
params: {
|
||||||
{
|
pageNumber: 1,
|
||||||
text: "商品(0)",
|
pageSize: 10,
|
||||||
loadingType: "more",
|
},
|
||||||
params: {
|
},
|
||||||
pageNumber: 1,
|
{
|
||||||
pageSize: 10,
|
name: "店铺(0)",
|
||||||
},
|
|
||||||
},
|
params: {
|
||||||
{
|
pageNumber: 1,
|
||||||
text: "店铺(0)",
|
pageSize: 10,
|
||||||
loadingType: "more",
|
},
|
||||||
params: {
|
},
|
||||||
pageNumber: 1,
|
],
|
||||||
pageSize: 10,
|
|
||||||
},
|
goodsEmpty: false, //商品数据是否为空
|
||||||
},
|
storeEmpty: false, //店铺数据是否为空
|
||||||
],
|
goodList: [], //商品集合
|
||||||
goodsLoad: "more", //商品加载
|
storeList: [], //店铺集合
|
||||||
storeLoad: "more", //店铺加载
|
};
|
||||||
goodsEmpty: false, //商品数据是否为空
|
},
|
||||||
storeEmpty: false, //店铺数据是否为空
|
onShow() {
|
||||||
goodList: [], //商品集合
|
this.fetchReloadOrNextPage('reload')
|
||||||
storeList: [], //店铺集合
|
},
|
||||||
};
|
onReachBottom() {
|
||||||
},
|
this.fetchReloadOrNextPage('next')
|
||||||
onLoad() {
|
},
|
||||||
this.getGoodList();
|
|
||||||
this.getstoreList();
|
methods: {
|
||||||
},
|
// 刷新或者下一页
|
||||||
|
fetchReloadOrNextPage(type) {
|
||||||
methods: {
|
if(type == 'next'){
|
||||||
/**
|
this.navList[this.tabCurrentIndex].params.pageNumber ++;
|
||||||
* 打开商品左侧取消收藏
|
if (this.tabCurrentIndex == 0) {
|
||||||
*/
|
this.getGoodList();
|
||||||
openLeftChange(val, type) {
|
} else {
|
||||||
const { goodList, storeList } = this;
|
this.getStoreList();
|
||||||
let way;
|
}
|
||||||
type == "goods" ? (way = goodList) : (way = storeList);
|
}
|
||||||
way.forEach((item) => {
|
else{
|
||||||
this.$set(item, "selected", false);
|
this.navList[0].params.pageNumber = 1;
|
||||||
});
|
this.navList[1].params.pageNumber = 1;
|
||||||
this.$set(val, "selected", false);
|
this.goodList = [];
|
||||||
val.selected = true;
|
this.storeList = [];
|
||||||
},
|
this.getGoodList();
|
||||||
|
this.getStoreList();
|
||||||
/**
|
}
|
||||||
* 点击商品左侧取消收藏
|
},
|
||||||
*/
|
|
||||||
clickGoodsSwiperAction(val) {
|
/**
|
||||||
deleteGoodsCollection(val.skuId).then((res) => {
|
* 打开商品左侧取消收藏
|
||||||
if (res.statusCode == 200) {
|
*/
|
||||||
this.storeList = [];
|
openLeftChange(val, type) {
|
||||||
this.goodList = [];
|
const {
|
||||||
this.getGoodList();
|
goodList,
|
||||||
}
|
storeList
|
||||||
});
|
} = this;
|
||||||
},
|
let way;
|
||||||
|
type == "goods" ? (way = goodList) : (way = storeList);
|
||||||
/**
|
way.forEach((item) => {
|
||||||
* 点击店铺左侧取消收藏
|
this.$set(item, "selected", false);
|
||||||
*/
|
});
|
||||||
clickstoreSwiperAction(val) {
|
this.$set(val, "selected", false);
|
||||||
deleteStoreCollection(val.storeId).then((res) => {
|
val.selected = true;
|
||||||
if (res.statusCode == 200) {
|
},
|
||||||
this.storeList = [];
|
|
||||||
this.getstoreList();
|
/**
|
||||||
}
|
* 点击商品左侧取消收藏
|
||||||
});
|
*/
|
||||||
},
|
clickGoodsSwiperAction(val) {
|
||||||
|
deleteGoodsCollection(val.skuId).then((res) => {
|
||||||
/**
|
if (res.statusCode == 200) {
|
||||||
* 顶部tab点击
|
this.storeList = [];
|
||||||
*/
|
this.goodList = [];
|
||||||
tabClick(index) {
|
this.getGoodList();
|
||||||
this.tabCurrentIndex = index;
|
}
|
||||||
},
|
});
|
||||||
|
},
|
||||||
/**
|
|
||||||
* 查看商品详情
|
/**
|
||||||
*/
|
* 点击店铺左侧取消收藏
|
||||||
goGoodsDetail(val) {
|
*/
|
||||||
//商品详情
|
clickStoreSwiperAction(val) {
|
||||||
uni.navigateTo({
|
deleteStoreCollection(val.id).then((res) => {
|
||||||
url: "/pages/product/goods?id=" + val.skuId + "&goodsId=" + val.goodsId,
|
if (res.statusCode == 200) {
|
||||||
});
|
this.storeList = [];
|
||||||
},
|
this.getStoreList();
|
||||||
|
}
|
||||||
/**
|
});
|
||||||
* 查看店铺详情
|
},
|
||||||
*/
|
|
||||||
gostoreMainPage(id) {
|
/**
|
||||||
//店铺主页
|
* 顶部tab点击
|
||||||
uni.navigateTo({
|
*/
|
||||||
url: "/pages/product/shopPage?id=" + id,
|
tabClick(index) {
|
||||||
});
|
this.tabCurrentIndex = index;
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取商品集合
|
* 查看商品详情
|
||||||
*/
|
*/
|
||||||
getGoodList() {
|
goGoodsDetail(val) {
|
||||||
uni.showLoading({
|
//商品详情
|
||||||
title: "加载中",
|
uni.navigateTo({
|
||||||
});
|
url: "/pages/product/goods?id=" + val.skuId + "&goodsId=" + val.goodsId,
|
||||||
getGoodsCollection(this.navList[0].params, "GOODS").then((res) => {
|
});
|
||||||
uni.hideLoading();
|
},
|
||||||
uni.stopPullDownRefresh();
|
|
||||||
if (res.data.success) {
|
/**
|
||||||
let data = res.data.result;
|
* 查看店铺详情
|
||||||
data.selected = false;
|
*/
|
||||||
this.navList[0].text = `商品(${data.total})`;
|
goStoreMainPage(id) {
|
||||||
if (data.total == 0) {
|
//店铺主页
|
||||||
this.goodsEmpty = true;
|
uni.navigateTo({
|
||||||
} else if (data.total < 10) {
|
url: "/pages/product/shopPage?id=" + id,
|
||||||
this.goodsLoad = "noMore";
|
});
|
||||||
this.goodList.push(...data.records);
|
},
|
||||||
} else {
|
|
||||||
this.goodList.push(...data.records);
|
/**
|
||||||
if (data.total.length < 10) this.goodsLoad = "noMore";
|
* 获取商品集合
|
||||||
}
|
*/
|
||||||
}
|
getGoodList() {
|
||||||
});
|
uni.showLoading({
|
||||||
},
|
title: "加载中",
|
||||||
|
});
|
||||||
/**
|
getGoodsCollection(this.navList[0].params, "GOODS").then((res) => {
|
||||||
* 获取店铺集合
|
if (this.$store.state.isShowToast){ uni.hideLoading() };
|
||||||
*/
|
uni.stopPullDownRefresh();
|
||||||
getstoreList() {
|
if (res.data.success) {
|
||||||
uni.showLoading({
|
let data = res.data.result;
|
||||||
title: "加载中",
|
data.selected = false;
|
||||||
});
|
this.navList[0].name = `商品(${data.total})`;
|
||||||
getGoodsCollection(this.navList[1].params, "store").then((res) => {
|
|
||||||
uni.hideLoading();
|
if (data.total == 0) {
|
||||||
uni.stopPullDownRefresh();
|
this.goodsEmpty = true;
|
||||||
if (res.data.success) {
|
} else if (data.total < 10) {
|
||||||
let data = res.data.result;
|
this.goodsLoad = "noMore";
|
||||||
data.selected = false;
|
this.goodList.push(...data.records);
|
||||||
this.navList[1].text = `店铺(${data.total})`;
|
} else {
|
||||||
if (data.total == 0) {
|
this.goodList.push(...data.records);
|
||||||
this.storeEmpty = true;
|
if (data.total.length < 10) this.goodsLoad = "noMore";
|
||||||
} else if (data.total < 10) {
|
}
|
||||||
this.storeLoad = "noMore";
|
}
|
||||||
this.storeList.push(...data.records);
|
});
|
||||||
} else {
|
},
|
||||||
this.storeList.push(...data.records);
|
|
||||||
if (data.total.length < 10) this.storeLoad = "noMore";
|
/**
|
||||||
}
|
* 获取店铺集合
|
||||||
}
|
*/
|
||||||
});
|
getStoreList() {
|
||||||
},
|
uni.showLoading({
|
||||||
|
title: "加载中",
|
||||||
/**
|
});
|
||||||
* 底部加载更多
|
getStoreCollection(this.navList[1].params, "STORE").then((res) => {
|
||||||
*/
|
if (this.$store.state.isShowToast){ uni.hideLoading() };
|
||||||
loadMore() {
|
uni.stopPullDownRefresh();
|
||||||
if (this.tabCurrentIndex == 0) {
|
if (res.data.success) {
|
||||||
this.navList[0].params.pageNumber++;
|
let data = res.data.result;
|
||||||
this.getGoodList();
|
data.selected = false;
|
||||||
} else {
|
this.navList[1].name = `店铺(${data.total})`;
|
||||||
this.navList[1].params.pageNumber++;
|
if (data.total == 0) {
|
||||||
this.getstoreList();
|
this.storeEmpty = true;
|
||||||
}
|
} else if (data.total < 10) {
|
||||||
},
|
|
||||||
},
|
this.storeList.push(...data.records);
|
||||||
|
}
|
||||||
/**
|
}
|
||||||
* 下拉刷新时
|
});
|
||||||
*/
|
},
|
||||||
onPullDownRefresh() {
|
},
|
||||||
if (this.tabCurrentIndex == 0) {
|
|
||||||
this.navList[0].params.pageNumber = 1;
|
/**
|
||||||
this.goodList = [];
|
* 下拉刷新时
|
||||||
this.getGoodList();
|
*/
|
||||||
} else {
|
onPullDownRefresh() {
|
||||||
this.navList[1].params.pageNumber = 1;
|
if (this.tabCurrentIndex == 0) {
|
||||||
this.storeList = [];
|
this.navList[0].params.pageNumber = 1;
|
||||||
this.getstoreList();
|
this.goodList = [];
|
||||||
}
|
this.getGoodList();
|
||||||
},
|
} else {
|
||||||
};
|
this.navList[1].params.pageNumber = 1;
|
||||||
</script>
|
this.storeList = [];
|
||||||
|
this.getStoreList();
|
||||||
<style lang="scss">
|
}
|
||||||
page,
|
},
|
||||||
.content {
|
};
|
||||||
background: $page-color-base;
|
</script>
|
||||||
height: 100%;
|
|
||||||
}
|
<style lang="scss">
|
||||||
.content {
|
page,
|
||||||
width: 100%;
|
.content {
|
||||||
overflow: hidden;
|
background: $page-color-base;
|
||||||
}
|
height: 100%;
|
||||||
.swiper-box {
|
}
|
||||||
overflow-y: auto;
|
|
||||||
}
|
.slot-wrap{
|
||||||
|
flex: 1;
|
||||||
.list-scroll-content {
|
display: flex;
|
||||||
height: 100%;
|
justify-content: center;
|
||||||
width: 100%;
|
padding-right: 72rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
/deep/ .u-swipe-content {
|
.content {
|
||||||
overflow: hidden;
|
width: 100%;
|
||||||
}
|
}
|
||||||
.goods {
|
|
||||||
background-color: #fff;
|
.swiper-box {
|
||||||
border-bottom: 1px solid $border-color-light;
|
overflow-y: auto;
|
||||||
height: 190rpx;
|
}
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
.list-scroll-content {
|
||||||
padding: 30rpx 20rpx;
|
height: 100%;
|
||||||
margin-top: 20rpx;
|
width: 100%;
|
||||||
image {
|
}
|
||||||
width: 131rpx;
|
|
||||||
height: 131rpx;
|
::v-deep .u-swipe-content {
|
||||||
border-radius: 10rpx;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
.goods-intro {
|
|
||||||
flex: 1;
|
.goods {
|
||||||
font-size: $font-base;
|
background-color: #fff;
|
||||||
line-height: 48rpx;
|
border-bottom: 1px solid $border-color-light;
|
||||||
margin-left: 30rpx;
|
height: 190rpx;
|
||||||
|
display: flex;
|
||||||
view:nth-child(1) {
|
align-items: center;
|
||||||
line-height: 1.4em;
|
padding: 30rpx 20rpx;
|
||||||
font-size: 24rpx;
|
margin-top: 20rpx;
|
||||||
max-height: 2.8em; //height是line-height的整数倍,防止文字显示不全
|
|
||||||
overflow: hidden;
|
image {
|
||||||
color: #666;
|
width: 131rpx;
|
||||||
}
|
height: 131rpx;
|
||||||
view:nth-child(2) {
|
border-radius: 10rpx;
|
||||||
color: #cccccc;
|
}
|
||||||
font-size: 24rpx;
|
|
||||||
}
|
.goods-intro {
|
||||||
view:nth-child(3) {
|
flex: 1;
|
||||||
color: $light-color;
|
font-size: $font-base;
|
||||||
}
|
line-height: 48rpx;
|
||||||
}
|
margin-left: 30rpx;
|
||||||
button {
|
|
||||||
color: $main-color;
|
view:nth-child(1) {
|
||||||
height: 50rpx;
|
line-height: 1.4em;
|
||||||
width: 120rpx;
|
font-size: 24rpx;
|
||||||
font-size: $font-sm;
|
max-height: 2.8em; //height是line-height的整数倍,防止文字显示不全
|
||||||
padding: 0;
|
overflow: hidden;
|
||||||
line-height: 50rpx;
|
color: #666;
|
||||||
background-color: #ffffff;
|
}
|
||||||
margin-top: 80rpx;
|
|
||||||
&::after {
|
view:nth-child(2) {
|
||||||
border-color: $main-color;
|
color: #cccccc;
|
||||||
}
|
font-size: 24rpx;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
.store {
|
view:nth-child(3) {
|
||||||
background-color: #fff;
|
color: $light-color;
|
||||||
border: 1px solid $border-color-light;
|
}
|
||||||
border-radius: 16rpx;
|
}
|
||||||
margin: 20rpx 10rpx;
|
|
||||||
.intro {
|
button {
|
||||||
display: flex;
|
color: $main-color;
|
||||||
justify-content: space-between;
|
height: 50rpx;
|
||||||
align-items: center;
|
width: 120rpx;
|
||||||
padding: 0 30rpx 0 40rpx;
|
font-size: $font-sm;
|
||||||
height: 170rpx;
|
padding: 0;
|
||||||
|
line-height: 50rpx;
|
||||||
.store-logo {
|
background-color: #ffffff;
|
||||||
width: 102rpx;
|
margin-top: 80rpx;
|
||||||
height: 102rpx;
|
|
||||||
border-radius: 50%;
|
&::after {
|
||||||
overflow: hidden;
|
border-color: $main-color;
|
||||||
image {
|
}
|
||||||
width: 100%;
|
}
|
||||||
height: 100%;
|
}
|
||||||
border-radius: 50%;
|
|
||||||
}
|
.store {
|
||||||
}
|
background-color: #fff;
|
||||||
.store-name {
|
border: 1px solid $border-color-light;
|
||||||
flex: 1;
|
border-radius: 16rpx;
|
||||||
margin-left: 30rpx;
|
margin: 20rpx 10rpx;
|
||||||
line-height: 2em;
|
|
||||||
:first-child {
|
.intro {
|
||||||
font-size: $font-base;
|
display: flex;
|
||||||
}
|
justify-content: space-between;
|
||||||
:last-child {
|
align-items: center;
|
||||||
font-size: $font-sm;
|
padding: 0 30rpx 0 40rpx;
|
||||||
color: #999;
|
height: 170rpx;
|
||||||
}
|
|
||||||
}
|
.store-logo {
|
||||||
.store-collect {
|
width: 102rpx;
|
||||||
border-left: 1px solid $border-color-light;
|
height: 102rpx;
|
||||||
padding-left: 20rpx;
|
border-radius: 50%;
|
||||||
text-align: center;
|
overflow: hidden;
|
||||||
:last-child {
|
|
||||||
color: #999;
|
image {
|
||||||
font-size: $font-sm;
|
width: 100%;
|
||||||
}
|
height: 100%;
|
||||||
}
|
border-radius: 50%;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.navbar {
|
|
||||||
display: flex;
|
.store-name {
|
||||||
height: 40px;
|
flex: 1;
|
||||||
padding: 0 5px;
|
margin-left: 30rpx;
|
||||||
background: #fff;
|
line-height: 2em;
|
||||||
box-shadow: 0 1px 5px rgba(0, 0, 0, 0.06);
|
|
||||||
position: relative;
|
:first-child {
|
||||||
z-index: 10;
|
font-size: $font-base;
|
||||||
.nav-item {
|
}
|
||||||
flex: 1;
|
|
||||||
display: flex;
|
:last-child {
|
||||||
justify-content: center;
|
font-size: $font-sm;
|
||||||
align-items: center;
|
color: #999;
|
||||||
height: 100%;
|
}
|
||||||
font-size: 26rpx;
|
}
|
||||||
|
|
||||||
text {
|
.store-collect {
|
||||||
position: relative;
|
border-left: 1px solid $border-color-light;
|
||||||
}
|
padding-left: 20rpx;
|
||||||
text.current {
|
text-align: center;
|
||||||
color: $light-color;
|
|
||||||
font-weight: bold;
|
:last-child {
|
||||||
font-size: 28rpx;
|
color: #999;
|
||||||
&::after {
|
font-size: $font-sm;
|
||||||
content: "";
|
}
|
||||||
position: absolute;
|
}
|
||||||
left: 20rpx;
|
}
|
||||||
bottom: -10rpx;
|
}
|
||||||
width: 30rpx;
|
|
||||||
height: 0;
|
.navbar {
|
||||||
border-bottom: 2px solid $light-color;
|
display: flex;
|
||||||
}
|
height: 40px;
|
||||||
}
|
padding: 0 5px;
|
||||||
}
|
background: #fff;
|
||||||
}
|
box-shadow: 0 1px 5px rgba(0, 0, 0, 0.06);
|
||||||
</style>
|
position: relative;
|
||||||
|
z-index: 10;
|
||||||
|
|
||||||
|
.nav-item {
|
||||||
|
flex: 1;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
height: 100%;
|
||||||
|
font-size: 26rpx;
|
||||||
|
|
||||||
|
text {
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
text.current {
|
||||||
|
color: $light-color;
|
||||||
|
font-weight: bold;
|
||||||
|
font-size: 28rpx;
|
||||||
|
|
||||||
|
&::after {
|
||||||
|
content: "";
|
||||||
|
position: absolute;
|
||||||
|
left: 20rpx;
|
||||||
|
bottom: -10rpx;
|
||||||
|
width: 30rpx;
|
||||||
|
height: 0;
|
||||||
|
border-bottom: 2px solid $light-color;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|||||||
@@ -1,317 +1,304 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="myTracks">
|
<view class="myTracks">
|
||||||
<u-empty text="暂无历史记录" style="margin-top:200rpx;" mode="history" v-if="whetherEmpty"></u-empty>
|
<u-navbar title="我的足迹">
|
||||||
<div v-else>
|
<div slot="right">
|
||||||
<view v-for="(item, index) in trackList" :key="index">
|
<div class="light-color edit" @click="isEdit = !isEdit">{{ !isEdit ? '编辑' : '完成'}}</div>
|
||||||
<view class="myTracks-title" @click="navgaiteToStore(item)">{{item.storeName}}</view>
|
</div>
|
||||||
<view class="myTracks-items">
|
</u-navbar>
|
||||||
<view class="myTracks-item">
|
<u-notice-bar mode="vertical" :list="['右划删除浏览记录']"></u-notice-bar>
|
||||||
<u-checkbox-group>
|
<u-empty text="暂无历史记录" style="margin-top:200rpx;" mode="history" v-if="whetherEmpty"></u-empty>
|
||||||
<u-checkbox v-model="item.___isDel" v-if="editFlag" active-color="#ff6b35" style="margin-right: 10rpx"
|
<div v-else>
|
||||||
@change="changeChecked(item)"></u-checkbox>
|
<view v-for="(item, index) in trackList" :key="index">
|
||||||
</u-checkbox-group>
|
<view class="myTracks-title" @click="navigateToStore(item)">{{item.storeName}}</view>
|
||||||
<view class="myTracks-item-img" @click.stop="navgaiteToDetail(item)">
|
<view class="myTracks-items">
|
||||||
<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-swipe-action style="width: 100%;" :show="item.show" :index="index" :key="item.id"
|
||||||
<uni-load-more :status="loadStatus"></uni-load-more>
|
@click="delTracks" @open="open" :options="options">
|
||||||
</div>
|
|
||||||
<view v-if="editFlag">
|
<view class="myTracks-item">
|
||||||
<view class="myTracks-action-placeholder"></view>
|
<u-checkbox-group v-if="isEdit" class="store-line-check">
|
||||||
<view class="myTracks-action">
|
<u-checkbox shape="circle" :active-color="lightColor" v-model="item.checked"
|
||||||
<view class="myTracks-action-check">
|
@change="checkboxChangeDP(item)"></u-checkbox>
|
||||||
<u-checkbox-group>
|
</u-checkbox-group>
|
||||||
<u-checkbox v-model="allChecked" v-if="editFlag" active-color="#ff6b35" style="margin-right: 10rpx"
|
<view class="myTracks-item-img" @click.stop="navigateToDetail(item)">
|
||||||
@change="checkedAllitem"></u-checkbox>
|
<image :src="item.thumbnail"></image>
|
||||||
全选
|
</view>
|
||||||
</u-checkbox-group>
|
<view class="myTracks-item-content" @click.stop="navigateToDetail(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>
|
||||||
<u-button type="warning" plain="true" @click="delAllTracks" class="myTracks-action-btn">
|
<view class="myTracks-divider"></view>
|
||||||
删除
|
|
||||||
</u-button>
|
</view>
|
||||||
</view>
|
<div @click="handleClickDeleteSelected" v-if="isEdit" class="submit">
|
||||||
</view>
|
删除所选
|
||||||
</view>
|
</div>
|
||||||
</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 {
|
||||||
editFlag: false, //是否编辑
|
isEdit:false,
|
||||||
allChecked: false, //是否全选
|
whetherEmpty: false, //是否数据为空
|
||||||
loadStatus: "more", //底部下拉加载状态
|
params: {
|
||||||
whetherEmpty: false, //是否数据为空
|
pageNumber: 1,
|
||||||
params: {
|
pageSize: 10,
|
||||||
pageNumber: 1,
|
order: "desc",
|
||||||
pageSize: 10,
|
sort: "updateTime",
|
||||||
},
|
},
|
||||||
|
lightColor:this.$lightColor,
|
||||||
|
options: [{
|
||||||
|
text: '删除',
|
||||||
|
style: {
|
||||||
|
backgroundColor: '#dd524d'
|
||||||
|
}
|
||||||
|
}],
|
||||||
|
trackList: [], //足迹列表
|
||||||
|
};
|
||||||
|
},
|
||||||
|
|
||||||
trackList: [], //足迹列表
|
/**
|
||||||
};
|
* 滑到底部加载下一页数据
|
||||||
},
|
*/
|
||||||
|
onReachBottom() {
|
||||||
|
this.params.pageNumber++;
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
onShow() {
|
||||||
|
this.params.pageNumber = 1
|
||||||
|
this.trackList = [];
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
onPullDownRefresh() {
|
||||||
|
this.trackList = [];
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
checkboxChangeDP(val){
|
||||||
|
console.log(val)
|
||||||
|
},
|
||||||
|
// 删除所选的数据
|
||||||
|
handleClickDeleteSelected(val){
|
||||||
|
const ids = this.trackList.filter(item=>item.checked).map(item=>item.goodsId);
|
||||||
|
if(!ids.length){
|
||||||
|
uni.showToast({
|
||||||
|
title:"请选择删除数据",
|
||||||
|
icon:"none"
|
||||||
|
})
|
||||||
|
}else{
|
||||||
|
this.delTracks(0,ids)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 导航到店铺
|
||||||
|
*/
|
||||||
|
navigateToStore(val) {
|
||||||
|
uni.navigateTo({
|
||||||
|
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;
|
||||||
|
})
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 跳转详情
|
||||||
|
*/
|
||||||
|
navigateToDetail(item) {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: "/pages/product/goods?id=" + item.id + "&goodsId=" + item.goodsId,
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 滑到底部加载下一页数据
|
* 获取我的足迹列表
|
||||||
*/
|
*/
|
||||||
onReachBottom() {
|
getList() {
|
||||||
if (this.loadStatus != "noMore") {
|
uni.showLoading({
|
||||||
this.params.pageNumber++;
|
title: "加载中",
|
||||||
this.getList();
|
});
|
||||||
}
|
myTrackList(this.params).then((res) => {
|
||||||
},
|
uni.stopPullDownRefresh();
|
||||||
onLoad() {
|
uni.hideLoading();
|
||||||
this.getList();
|
if (res.statusCode == 200) {
|
||||||
},
|
res.data.result.records.length &&
|
||||||
onPullDownRefresh() {
|
res.data.result.records.forEach((item) => {
|
||||||
this.trackList = [];
|
item.show = false;
|
||||||
this.getList();
|
item.checked = false
|
||||||
},
|
});
|
||||||
methods: {
|
|
||||||
/**
|
|
||||||
* 导航到店铺
|
|
||||||
*/
|
|
||||||
navgaiteToStore(val) {
|
|
||||||
uni.navigateTo({
|
|
||||||
url: "/pages/product/shopPage?id=" + val.storeId,
|
|
||||||
});
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
let data = res.data.result.records;
|
||||||
* 设置右侧导航栏文本
|
if (data.total == 0) {
|
||||||
*/
|
this.whetherEmpty = true;
|
||||||
setStyle(text) {
|
} else {
|
||||||
//导航按钮文本设置
|
this.trackList.push(...data);
|
||||||
let pages = getCurrentPages();
|
}
|
||||||
let page = pages[pages.length - 1];
|
}
|
||||||
// #ifdef APP-PLUS
|
});
|
||||||
let currentWebview = page.$getAppWebview();
|
},
|
||||||
let titleNView = currentWebview.getStyle().titleNView;
|
|
||||||
titleNView.buttons[0].text = text;
|
|
||||||
if (text == "完成") {
|
|
||||||
this.trackList.forEach((key) => {
|
|
||||||
key.history.forEach((item) => {
|
|
||||||
this.$set(item, "___isDel", false);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
currentWebview.setStyle({
|
|
||||||
titleNView: titleNView,
|
|
||||||
});
|
|
||||||
// #endif
|
|
||||||
// #ifdef H5
|
|
||||||
// h5 临时方案
|
|
||||||
document.getElementsByClassName("uni-btn-icon")[1].innerText = text;
|
|
||||||
// #endif
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 跳转详情
|
|
||||||
*/
|
|
||||||
navgaiteToDetail(item) {
|
|
||||||
uni.navigateTo({
|
|
||||||
url: "/pages/product/goods?id=" + item.id + "&goodsId=" + item.goodsId,
|
|
||||||
});
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取我的足迹列表
|
* 删除足迹
|
||||||
*/
|
*/
|
||||||
getList() {
|
delTracks(index,ids) {
|
||||||
uni.showLoading({
|
deleteHistoryListId(ids || this.trackList[index].goodsId).then((res) => {
|
||||||
title: "加载中",
|
if (res.data.code == 200) {
|
||||||
});
|
this.trackList = [];
|
||||||
myTrackList(this.params).then((res) => {
|
this.params.pageNumber = 1
|
||||||
uni.stopPullDownRefresh();
|
this.getList();
|
||||||
uni.hideLoading();
|
} else {
|
||||||
if (res.statusCode == 200) {
|
uni.showToast({
|
||||||
res.data.result &&
|
title: res.data.message,
|
||||||
res.data.result.forEach((item) => {
|
duration: 2000,
|
||||||
item.___isDel = false;
|
icon: "none",
|
||||||
});
|
});
|
||||||
|
}
|
||||||
let data = res.data.result;
|
});
|
||||||
if (data.total == 0) {
|
},
|
||||||
this.whetherEmpty = true;
|
},
|
||||||
} else if (data.total < 10) {
|
};
|
||||||
this.loadStatus = "noMore";
|
|
||||||
this.trackList.push(...data);
|
|
||||||
} else {
|
|
||||||
this.trackList.push(...data);
|
|
||||||
if (data.length < 10) this.loadStatus = "noMore";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 点击后判断是不是全选
|
|
||||||
*/
|
|
||||||
changeChecked(val) {
|
|
||||||
const isCheckedAll = this.trackList.every((key) => {
|
|
||||||
return key.___isDel == val.___isDel;
|
|
||||||
});
|
|
||||||
this.allChecked = isCheckedAll;
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 点击全选按钮
|
|
||||||
*/
|
|
||||||
checkedAllitem() {
|
|
||||||
//全选按钮
|
|
||||||
this.trackList.forEach((key) => {
|
|
||||||
this.$set(key, "___isDel", this.allChecked);
|
|
||||||
});
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除足迹
|
|
||||||
*/
|
|
||||||
delAllTracks() {
|
|
||||||
let way = [];
|
|
||||||
this.trackList.forEach((key) => {
|
|
||||||
if (key.___isDel) {
|
|
||||||
way.push(key.goodsId);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
if (way.length == 0) return false;
|
|
||||||
deleteHistoryListId(way).then((res) => {
|
|
||||||
if (res.data.code == 200) {
|
|
||||||
this.trackList = [];
|
|
||||||
this.allChecked = false;
|
|
||||||
this.getList();
|
|
||||||
} else {
|
|
||||||
uni.showToast({
|
|
||||||
title: res.data.message,
|
|
||||||
duration: 2000,
|
|
||||||
icon: "none",
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 右侧标签栏切换
|
|
||||||
*/
|
|
||||||
onNavigationBarButtonTap(e) {
|
|
||||||
if (!this.editFlag) {
|
|
||||||
this.setStyle("完成");
|
|
||||||
} else {
|
|
||||||
this.setStyle("编辑");
|
|
||||||
}
|
|
||||||
this.editFlag = !this.editFlag;
|
|
||||||
},
|
|
||||||
};
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.myTracks {
|
.submit{
|
||||||
width: 100%;
|
position: fixed;
|
||||||
padding-top: 2rpx;
|
bottom: 20rpx;
|
||||||
}
|
left: 10%;
|
||||||
|
width: 80%;
|
||||||
|
height: 80rpx;
|
||||||
|
color: #fff;
|
||||||
|
border-radius: 100px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
background: $light-color;
|
||||||
|
}
|
||||||
|
.myTracks {
|
||||||
|
width: 100%;
|
||||||
|
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-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-placeholder {
|
.myTracks-action-btn {
|
||||||
height: 110rpx;
|
width: 130rpx;
|
||||||
}
|
height: 60rpx;
|
||||||
|
line-height: 60rpx;
|
||||||
|
}
|
||||||
|
|
||||||
.myTracks-action-check {
|
.myTracks-divider {
|
||||||
align-items: center;
|
width: 100%;
|
||||||
display: -webkit-box;
|
height: 20rpx;
|
||||||
display: -webkit-flex;
|
}
|
||||||
display: flex;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
.myTracks-action-check {
|
||||||
|
align-items: center;
|
||||||
|
display: -webkit-box;
|
||||||
|
display: -webkit-flex;
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
.edit{
|
||||||
|
padding-right: 32rpx;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -11,21 +11,21 @@
|
|||||||
<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>
|
||||||
|
|
||||||
<div class="point-list">
|
<div class="point-list">
|
||||||
<view class="point-item" v-for="(item, index) in pointList" :key="index">
|
<view class="point-item" v-for="(item, index) in pointList" :key="index">
|
||||||
<view>
|
<view>
|
||||||
<view>{{ item.content }}</view>
|
<view class="point-label">{{ item.content }}</view>
|
||||||
<view>{{ item.createTime}}</view>
|
<view>{{ item.createTime}}</view>
|
||||||
</view>
|
</view>
|
||||||
<view><span>{{item.pointType == "INCREASE" ? '+' : '-'}}</span>{{ item.variablePoint }}</view>
|
<view :class="[item.pointType == 'INCREASE' ? 'plus' : 'reduce']"><span>{{item.pointType == "INCREASE" ? '+' : '-'}}</span>{{ item.variablePoint }}</view>
|
||||||
</view>
|
</view>
|
||||||
<uni-load-more :status="count.loadStatus"></uni-load-more>
|
<uni-load-more :status="count.loadStatus"></uni-load-more>
|
||||||
</div>
|
</div>
|
||||||
@@ -72,7 +72,7 @@ export default {
|
|||||||
title: "加载中",
|
title: "加载中",
|
||||||
});
|
});
|
||||||
getPointsData(params).then((res) => {
|
getPointsData(params).then((res) => {
|
||||||
uni.hideLoading();
|
if (this.$store.state.isShowToast){ uni.hideLoading() };
|
||||||
if (res.data.success) {
|
if (res.data.success) {
|
||||||
let data = res.data.result.records;
|
let data = res.data.result.records;
|
||||||
if (data.length < 10) {
|
if (data.length < 10) {
|
||||||
@@ -109,6 +109,14 @@ export default {
|
|||||||
font-size: 32rpx;
|
font-size: 32rpx;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
|
.plus{
|
||||||
|
color: $light-color;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
.reduce{
|
||||||
|
color: $weChat-color;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
.point-item {
|
.point-item {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
@@ -143,14 +151,14 @@ export default {
|
|||||||
border-radius: 0 0 20rpx 20rpx;
|
border-radius: 0 0 20rpx 20rpx;
|
||||||
margin: 0 20rpx;
|
margin: 0 20rpx;
|
||||||
font-size: 26rpx;
|
font-size: 26rpx;
|
||||||
/deep/ .u-col {
|
::v-deep .u-col {
|
||||||
text-align: center !important;
|
text-align: center !important;
|
||||||
}
|
}
|
||||||
/deep/ .u-col:first-child {
|
::v-deep .u-col:first-child {
|
||||||
border-right: 1px solid $border-color-light;
|
border-right: 1px solid $border-color-light;
|
||||||
}
|
}
|
||||||
.pcolor {
|
.pcolor {
|
||||||
color: #4ebb9d;
|
color: $light-color;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -168,7 +176,7 @@ export default {
|
|||||||
.portrait-box {
|
.portrait-box {
|
||||||
background-color: $main-color;
|
background-color: $main-color;
|
||||||
height: 250rpx;
|
height: 250rpx;
|
||||||
background: linear-gradient(134deg, #28d094 2%, #1abc9c 98%);
|
background: linear-gradient(91deg, $light-color 1%, $aider-light-color 99%);
|
||||||
border-radius: 20rpx 20rpx 0 0;
|
border-radius: 20rpx 20rpx 0 0;
|
||||||
margin: 20rpx 20rpx 0;
|
margin: 20rpx 20rpx 0;
|
||||||
position: relative;
|
position: relative;
|
||||||
@@ -212,5 +220,10 @@ export default {
|
|||||||
.point {
|
.point {
|
||||||
font-size: 56rpx;
|
font-size: 56rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
.point-label{
|
||||||
|
font-weight: bold;
|
||||||
|
margin-bottom: 10rpx;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -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,10 +19,11 @@
|
|||||||
<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=user')"></u-cell-item>
|
<u-cell-item title="证照信息" @click="navigateTo('/pages/mine/help/tips?type=LICENSE_INFORMATION')"></u-cell-item>
|
||||||
<u-cell-item title="隐私协议" @click="navigateTo('/pages/mine/help/tips?type=privacy')"></u-cell-item>
|
<u-cell-item title="服务协议" @click="navigateTo('/pages/mine/help/tips?type=USER_AGREEMENT')"></u-cell-item>
|
||||||
<u-cell-item title="关于我们" :border-bottom="false" @click="navigateTo('/pages/mine/help/tips?type=about')"></u-cell-item>
|
<u-cell-item title="隐私协议" @click="navigateTo('/pages/mine/help/tips?type=PRIVACY_POLICY')"></u-cell-item>
|
||||||
|
<u-cell-item title="关于我们" :border-bottom="false" @click="navigateTo('/pages/mine/help/tips?type=ABOUT')"></u-cell-item>
|
||||||
|
|
||||||
</u-cell-group>
|
</u-cell-group>
|
||||||
|
|
||||||
@@ -28,8 +32,8 @@
|
|||||||
<view style="margin:20rpx 0 0 0;">{{config.customerServiceEmail ? `客服邮箱:${config.customerServiceEmail}` : ``}}</view>
|
<view style="margin:20rpx 0 0 0;">{{config.customerServiceEmail ? `客服邮箱:${config.customerServiceEmail}` : ``}}</view>
|
||||||
|
|
||||||
<view>
|
<view>
|
||||||
<view style="margin:20rpx 0; color:#003a8c;" @click="navigateTo('/pages/mine/help/tips?type=user')">《{{config.name}}用户协议》</view>
|
<view style="margin:20rpx 0; color:#003a8c;" @click="navigateTo('/pages/mine/help/tips?type=USER_AGREEMENT')">《{{config.name}}用户协议》</view>
|
||||||
<view>CopyRight @{{config.name}} </view>
|
<view>CopyRight ©{{config.name}} </view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</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: {
|
||||||
|
|||||||
@@ -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>
|
||||||
@@ -84,7 +84,7 @@ export default {
|
|||||||
}
|
}
|
||||||
if (!this.feedBack.context) {
|
if (!this.feedBack.context) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: "请填写反馈类型",
|
title: "请填写反馈信息",
|
||||||
duration: 2000,
|
duration: 2000,
|
||||||
icon: "none",
|
icon: "none",
|
||||||
});
|
});
|
||||||
@@ -143,7 +143,7 @@ export default {
|
|||||||
padding: 32rpx;
|
padding: 32rpx;
|
||||||
margin-bottom: 40rpx;
|
margin-bottom: 40rpx;
|
||||||
}
|
}
|
||||||
/deep/ .u-input__textarea {
|
::v-deep .u-input__textarea {
|
||||||
padding: 12px;
|
padding: 12px;
|
||||||
}
|
}
|
||||||
.feedBack-box:nth-of-type(1) {
|
.feedBack-box:nth-of-type(1) {
|
||||||
|
|||||||
@@ -16,26 +16,38 @@
|
|||||||
</u-form-item>
|
</u-form-item>
|
||||||
|
|
||||||
<u-form-item label="生日" label-width="150" right-icon="arrow-right">
|
<u-form-item label="生日" label-width="150" right-icon="arrow-right">
|
||||||
<u-input v-model="birthday" disabled placeholder="请选择出生日期" @click="showBirthday = true" />
|
<div style="width: 100%;" @click="showBirthday = true">{{ birthday || '请选择出生日期' }}</div>
|
||||||
<u-picker v-model="showBirthday" mode="time" :confirm-color="lightColor" @confirm="selectTime"></u-picker>
|
<u-picker v-model="showBirthday" mode="time" :confirm-color="lightColor" @confirm="selectTime"></u-picker>
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
<u-form-item label="城市" label-width="150" placeholder="请选择城市" right-icon="arrow-right">
|
<u-form-item label="城市" label-width="150" placeholder="请选择城市" right-icon="arrow-right">
|
||||||
<u-input v-model="form.___path" disabled @click="clickRegion" />
|
<div style="width: 100%;" @click="clickRegion">{{ form.___path || '请选择城市' }}</div>
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
<view class="submit" @click="submit">保存</view>
|
|
||||||
|
<u-form-item label="手机号" label-width="150">
|
||||||
|
<view v-if="form.mobile">
|
||||||
|
{{form.mobile}}
|
||||||
|
</view>
|
||||||
|
<view v-else>
|
||||||
|
<view class="submit" style="text-align: left;" @click="navigateTo(form.username)">绑定手机号码</view>
|
||||||
|
</view>
|
||||||
|
</u-form-item>
|
||||||
|
|
||||||
</u-form>
|
</u-form>
|
||||||
|
<div class="bottom">
|
||||||
<m-city :provinceData="region" headTitle="区域选择" ref="cityPicker" @funcValue="getpickerParentValue" pickerSize="4"></m-city>
|
<view class="submit" @click="submit">保存</view>
|
||||||
|
<view class="submit light" @click="quiteLoginOut">退出登录</view>
|
||||||
|
</div>
|
||||||
|
<m-city :provinceData="region" headTitle="区域选择" ref="cityPicker" @funcValue="getPickerParentValue" pickerSize="4"></m-city>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import { saveUserInfo } from "@/api/members.js";
|
import { saveUserInfo, getUserInfo } from "@/api/members.js";
|
||||||
import { upload } from "@/api/common.js";
|
import { upload } from "@/api/common.js";
|
||||||
import storage from "@/utils/storage.js";
|
import storage from "@/utils/storage.js";
|
||||||
import uFormItem from "@/uview-ui/components/u-form-item/u-form-item.vue";
|
import uFormItem from "@/uview-ui/components/u-form-item/u-form-item.vue";
|
||||||
import gkcity from "@/components/m-city/m-city.vue";
|
import city from "@/components/m-city/m-city.vue";
|
||||||
export default {
|
export default {
|
||||||
components: { uFormItem, "m-city": gkcity },
|
components: { uFormItem, "m-city": city },
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
lightColor: this.$lightColor, //高亮颜色
|
lightColor: this.$lightColor, //高亮颜色
|
||||||
@@ -47,6 +59,8 @@ export default {
|
|||||||
region: storage.getUserInfo().region || [], //地址
|
region: storage.getUserInfo().region || [], //地址
|
||||||
sex: storage.getUserInfo().sex, //性别
|
sex: storage.getUserInfo().sex, //性别
|
||||||
___path: storage.getUserInfo().region,
|
___path: storage.getUserInfo().region,
|
||||||
|
mobile: storage.getUserInfo().mobile,
|
||||||
|
username: storage.getUserInfo().username,
|
||||||
},
|
},
|
||||||
birthday: storage.getUserInfo().birthday || "", //生日
|
birthday: storage.getUserInfo().birthday || "", //生日
|
||||||
photo: [
|
photo: [
|
||||||
@@ -65,10 +79,17 @@ export default {
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
/**
|
||||||
|
* 退出登录
|
||||||
|
*/
|
||||||
|
quiteLoginOut() {
|
||||||
|
this.$options.filters.quiteLoginOut();
|
||||||
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 选择地址回调
|
* 选择地址回调
|
||||||
*/
|
*/
|
||||||
getpickerParentValue(e) {
|
getPickerParentValue(e) {
|
||||||
this.form.region = [];
|
this.form.region = [];
|
||||||
this.form.regionId = [];
|
this.form.regionId = [];
|
||||||
let name = "";
|
let name = "";
|
||||||
@@ -150,15 +171,43 @@ export default {
|
|||||||
this.form.birthday = `${time.year}-${time.month}-${time.day}`;
|
this.form.birthday = `${time.year}-${time.month}-${time.day}`;
|
||||||
this.birthday = `${time.year} - ${time.month} - ${time.day}`;
|
this.birthday = `${time.year} - ${time.month} - ${time.day}`;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
navigateTo(username) {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '/pages/mine/set/securityCenter/bindMobile' + '?username=' + username,
|
||||||
|
});
|
||||||
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 加载数据
|
* 加载数据
|
||||||
*/
|
*/
|
||||||
onLoad() {},
|
onLoad() {},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面显示时执行
|
||||||
|
*/
|
||||||
|
onShow() {
|
||||||
|
// 从缓存中重新获取用户信息
|
||||||
|
const userInfo = storage.getUserInfo();
|
||||||
|
// 更新表单数据
|
||||||
|
this.form.nickName = userInfo.nickName || "";
|
||||||
|
this.form.birthday = userInfo.birthday || "";
|
||||||
|
this.form.face = userInfo.face || "/static/missing-face.png";
|
||||||
|
this.form.region = userInfo.region || [];
|
||||||
|
this.form.sex = userInfo.sex;
|
||||||
|
this.form.___path = userInfo.region;
|
||||||
|
this.form.mobile = userInfo.mobile;
|
||||||
|
this.form.username = userInfo.username;
|
||||||
|
this.birthday = userInfo.birthday || "";
|
||||||
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
<style>
|
||||||
|
page{
|
||||||
|
background: #fff;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.submit {
|
.submit {
|
||||||
height: 90rpx;
|
height: 90rpx;
|
||||||
@@ -170,6 +219,7 @@ export default {
|
|||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
color: $main-color;
|
color: $main-color;
|
||||||
border-radius: 100px;
|
border-radius: 100px;
|
||||||
|
|
||||||
}
|
}
|
||||||
.head {
|
.head {
|
||||||
height: 260rpx;
|
height: 260rpx;
|
||||||
@@ -186,7 +236,7 @@ export default {
|
|||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/deep/ .u-form {
|
::v-deep .u-form {
|
||||||
background-color: #ffffff;
|
background-color: #ffffff;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
margin-top: 30rpx;
|
margin-top: 30rpx;
|
||||||
@@ -199,4 +249,21 @@ export default {
|
|||||||
.form {
|
.form {
|
||||||
background-color: #ffffff;
|
background-color: #ffffff;
|
||||||
}
|
}
|
||||||
|
.bottom{
|
||||||
|
position: fixed;
|
||||||
|
bottom: 40px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
width: 100%;
|
||||||
|
>.submit{
|
||||||
|
background: $light-color;
|
||||||
|
color: #fff;
|
||||||
|
width: 40%;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
.light{
|
||||||
|
background: rgba($color: $light-color, $alpha: 0.2) !important;
|
||||||
|
color: $light-color !important;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
227
pages/mine/set/securityCenter/bindMobile.vue
Normal file
227
pages/mine/set/securityCenter/bindMobile.vue
Normal file
@@ -0,0 +1,227 @@
|
|||||||
|
<template>
|
||||||
|
<view class="box">
|
||||||
|
<view class="box-tips">
|
||||||
|
<h2 class='h2'>
|
||||||
|
绑定手机号码
|
||||||
|
</h2>
|
||||||
|
<view class="verification"></view>
|
||||||
|
</view>
|
||||||
|
<view class="form">
|
||||||
|
<u-form :model="codeForm" ref="validateCodeForm">
|
||||||
|
<view v-if="!validateFlage">
|
||||||
|
<u-form-item label-width="120" label="手机号" prop="mobile">
|
||||||
|
<u-input maxlength="11" v-model="codeForm.mobile" placeholder="请输入您的手机号" />
|
||||||
|
</u-form-item>
|
||||||
|
|
||||||
|
<u-form-item class="sendCode" label-width="120" prop="code" label="验证码">
|
||||||
|
<u-input v-model="codeForm.code" placeholder="请输入验证码" />
|
||||||
|
<u-verification-code unique-key="page-edit" :seconds="seconds" @end="end" @start="start"
|
||||||
|
ref="uCode" @change="codeChange"></u-verification-code>
|
||||||
|
<view @tap="getCode" class="text-tips">{{ tips }}</view>
|
||||||
|
</u-form-item>
|
||||||
|
|
||||||
|
<view class="submit" @click="validatePhone">绑定</view>
|
||||||
|
<myVerification keep-running @send="verification" class="verification" ref="verification"
|
||||||
|
business="BIND_MOBILE" />
|
||||||
|
</view>
|
||||||
|
</u-form>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import {
|
||||||
|
sendMobile,
|
||||||
|
bindMobile
|
||||||
|
} from "@/api/login";
|
||||||
|
import { getUserInfo } from "@/api/members.js";
|
||||||
|
import storage from "@/utils/storage.js";
|
||||||
|
|
||||||
|
import myVerification from "@/components/verification/verification.vue"; //验证
|
||||||
|
import uuid from "@/utils/uuid.modified.js";
|
||||||
|
export default {
|
||||||
|
components: {
|
||||||
|
myVerification,
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
uuid,
|
||||||
|
validateFlage: false, //是否进行了手机号验证
|
||||||
|
step: 0, //当前验证步骤
|
||||||
|
flage: false, //是否验证码验证
|
||||||
|
codeForm: {
|
||||||
|
mobile: "", //手机号
|
||||||
|
code: "", //验证码
|
||||||
|
username: "", //用户名
|
||||||
|
},
|
||||||
|
tips: "", //提示
|
||||||
|
seconds: 69, // 60s等待时间
|
||||||
|
|
||||||
|
// 验证码登录校验
|
||||||
|
codeRules: {
|
||||||
|
mobile: [{
|
||||||
|
validator: (rule, value, callback) => {
|
||||||
|
return this.$u.test.mobile(value);
|
||||||
|
},
|
||||||
|
message: "手机号码不正确",
|
||||||
|
trigger: ["blur"],
|
||||||
|
}, ],
|
||||||
|
code: [{
|
||||||
|
min: 4,
|
||||||
|
max: 6,
|
||||||
|
required: true,
|
||||||
|
message: "请输入验证码",
|
||||||
|
trigger: ["blur"],
|
||||||
|
}, ],
|
||||||
|
},
|
||||||
|
};
|
||||||
|
},
|
||||||
|
onLoad(options) {
|
||||||
|
this.codeForm.username = options.username;
|
||||||
|
},
|
||||||
|
onReady() {
|
||||||
|
// 必须要在onReady生命周期,因为onLoad生命周期组件可能尚未创建完毕
|
||||||
|
this.$refs.validateCodeForm.setRules(this.codeRules);
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
flage(val) {
|
||||||
|
if (val) {
|
||||||
|
if (this.$refs.uCode.canGetCode) {
|
||||||
|
uni.showLoading({
|
||||||
|
title: "正在获取验证码",
|
||||||
|
});
|
||||||
|
sendMobile(this.codeForm.mobile, "BIND_MOBILE").then((res) => {
|
||||||
|
if (this.$store.state.isShowToast){ uni.hideLoading() };
|
||||||
|
// 这里此提示会被this.start()方法中的提示覆盖
|
||||||
|
if (res.data.success) {
|
||||||
|
this.$refs.uCode.start();
|
||||||
|
} else {
|
||||||
|
uni.showToast({
|
||||||
|
title: res.data.message,
|
||||||
|
duration: 2000,
|
||||||
|
icon: "none",
|
||||||
|
});
|
||||||
|
this.flage = false;
|
||||||
|
this.$refs.verification.getCode();
|
||||||
|
}
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
this.$u.toast("请倒计时结束后再发送");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
methods: {
|
||||||
|
// 验证码验证
|
||||||
|
verification(val) {
|
||||||
|
this.flage = val == this.$store.state.verificationKey ? true : false;
|
||||||
|
},
|
||||||
|
|
||||||
|
// 验证手机号
|
||||||
|
validatePhone() {
|
||||||
|
this.$refs.validateCodeForm.validate((valid) => {
|
||||||
|
if (valid) {
|
||||||
|
bindMobile(this.codeForm).then((res) => {
|
||||||
|
if (res.data.success) {
|
||||||
|
this.validateFlage = !this.validateFlage;
|
||||||
|
// 获取最新的用户信息并更新缓存
|
||||||
|
getUserInfo().then(userRes => {
|
||||||
|
if (userRes.data.success) {
|
||||||
|
storage.setUserInfo(userRes.data.result);
|
||||||
|
}
|
||||||
|
// 显示成功提示
|
||||||
|
uni.showToast({
|
||||||
|
title: "绑定成功!",
|
||||||
|
duration: 2000,
|
||||||
|
icon: "none",
|
||||||
|
});
|
||||||
|
// 返回上一页
|
||||||
|
setTimeout(() => {
|
||||||
|
uni.navigateBack({
|
||||||
|
delta: 1,
|
||||||
|
});
|
||||||
|
}, 1000);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
codeChange(text) {
|
||||||
|
this.tips = text;
|
||||||
|
},
|
||||||
|
end() {
|
||||||
|
|
||||||
|
this.flage = false;
|
||||||
|
this.$refs.verification.getCode()
|
||||||
|
},
|
||||||
|
|
||||||
|
/**获取验证码 */
|
||||||
|
getCode() {
|
||||||
|
if (this.tips == "重新获取") {
|
||||||
|
this.$refs.verification.error(); //发送
|
||||||
|
}
|
||||||
|
if (!this.$u.test.mobile(this.codeForm.mobile)) {
|
||||||
|
uni.showToast({
|
||||||
|
title: "请输入正确手机号",
|
||||||
|
icon: "none",
|
||||||
|
});
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (!this.flage) {
|
||||||
|
this.$refs.verification.error(); //发送
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
start() {
|
||||||
|
this.$u.toast("验证码已发送");
|
||||||
|
this.flage = true;
|
||||||
|
|
||||||
|
this.$refs.verification.hide();
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
@import url("@/pages/passport/login.scss");
|
||||||
|
|
||||||
|
::v-deep .u-form-item {
|
||||||
|
margin: 40rpx 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sendCode {
|
||||||
|
::v-deep .u-form-item--right__content__slot {
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.h2 {
|
||||||
|
font-size: 40rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
page {
|
||||||
|
background: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.box {
|
||||||
|
padding: 80rpx 0;
|
||||||
|
border-radius: 20rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.submit {
|
||||||
|
background: $light-color;
|
||||||
|
}
|
||||||
|
|
||||||
|
.box-tips {
|
||||||
|
margin: 0 72rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.verification {
|
||||||
|
font-size: 24rpx;
|
||||||
|
color: #999;
|
||||||
|
margin-top: 10rpx;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
160
pages/mine/set/securityCenter/editLoginPassword.vue
Normal file
160
pages/mine/set/securityCenter/editLoginPassword.vue
Normal file
@@ -0,0 +1,160 @@
|
|||||||
|
<template>
|
||||||
|
<view class="box">
|
||||||
|
<view class="box-tips">
|
||||||
|
<h2 class='h2'>
|
||||||
|
{{verificationTitle.title}}
|
||||||
|
</h2>
|
||||||
|
<view class="verification">{{verificationTitle.desc}}</view>
|
||||||
|
</view>
|
||||||
|
<view class="form">
|
||||||
|
<u-form :model="codeForm" ref="validateCodeForm">
|
||||||
|
<u-form-item label-width="120" label="旧密码">
|
||||||
|
<u-input type="password" v-model="oldPassword" placeholder="请输入您的旧密码" />
|
||||||
|
</u-form-item>
|
||||||
|
|
||||||
|
<u-form-item label-width="120" label="密码">
|
||||||
|
<u-input type="password" v-model="password" placeholder="请输入您的密码" />
|
||||||
|
</u-form-item>
|
||||||
|
|
||||||
|
<u-form-item label-width="120" label="确认密码">
|
||||||
|
<u-input type="password" v-model="newPassword" placeholder="请再次输入您的密码" />
|
||||||
|
</u-form-item>
|
||||||
|
|
||||||
|
<view class="submit" @click="updatePassword">修改密码</view>
|
||||||
|
</u-form>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import {
|
||||||
|
resetByMobile,
|
||||||
|
modifyPass
|
||||||
|
} from "@/api/login";
|
||||||
|
|
||||||
|
import {
|
||||||
|
md5
|
||||||
|
} from "@/utils/md5.js"; // md5
|
||||||
|
import myVerification from "@/components/verification/verification.vue"; //验证
|
||||||
|
import uuid from "@/utils/uuid.modified.js";
|
||||||
|
export default {
|
||||||
|
components: {
|
||||||
|
myVerification,
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
uuid,
|
||||||
|
validateFlage: false, //是否进行了手机号验证
|
||||||
|
verificationTitle: {
|
||||||
|
title: "修改密码",
|
||||||
|
desc: "请验证并输入密码",
|
||||||
|
},
|
||||||
|
step: 0, //当前验证步骤
|
||||||
|
flage: false, //是否验证码验证
|
||||||
|
|
||||||
|
codeForm: {
|
||||||
|
mobile: "", //手机号
|
||||||
|
code: "", //验证码
|
||||||
|
},
|
||||||
|
newPassword: "", //新密码
|
||||||
|
password: "", //密码
|
||||||
|
oldPassword: '', //旧密码
|
||||||
|
tips: "", //提示
|
||||||
|
seconds: 69, // 60s等待时间
|
||||||
|
|
||||||
|
// 验证码登录校验
|
||||||
|
codeRules: {
|
||||||
|
mobile: [{
|
||||||
|
validator: (rule, value, callback) => {
|
||||||
|
return this.$u.test.mobile(value);
|
||||||
|
},
|
||||||
|
message: "手机号码不正确",
|
||||||
|
trigger: ["blur"],
|
||||||
|
}, ],
|
||||||
|
code: [{
|
||||||
|
min: 4,
|
||||||
|
max: 6,
|
||||||
|
required: true,
|
||||||
|
message: "请输入验证码",
|
||||||
|
trigger: ["blur"],
|
||||||
|
}, ],
|
||||||
|
},
|
||||||
|
};
|
||||||
|
},
|
||||||
|
onReady() {
|
||||||
|
// 必须要在onReady生命周期,因为onLoad生命周期组件可能尚未创建完毕
|
||||||
|
this.$refs.validateCodeForm.setRules(this.codeRules);
|
||||||
|
},
|
||||||
|
|
||||||
|
methods: {
|
||||||
|
// 修改密码
|
||||||
|
updatePassword() {
|
||||||
|
if(this.password !== this.newPassword){
|
||||||
|
uni.showToast({
|
||||||
|
title: "两次输入密码不一致!",
|
||||||
|
icon: "none",
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
modifyPass({
|
||||||
|
password: md5(this.oldPassword),
|
||||||
|
newPassword: md5(this.newPassword),
|
||||||
|
}).then((res) => {
|
||||||
|
if (res.data.success) {
|
||||||
|
uni.showToast({
|
||||||
|
title: "修改成功!",
|
||||||
|
duration: 2000,
|
||||||
|
icon: "none",
|
||||||
|
});
|
||||||
|
setTimeout(() => {
|
||||||
|
uni.navigateBack({
|
||||||
|
delta: 1,
|
||||||
|
});
|
||||||
|
}, 1000);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
@import url("@/pages/passport/login.scss");
|
||||||
|
|
||||||
|
::v-deep .u-form-item {
|
||||||
|
margin: 40rpx 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sendCode {
|
||||||
|
::v-deep .u-form-item--right__content__slot {
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.h2 {
|
||||||
|
font-size: 40rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
page {
|
||||||
|
background: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.box {
|
||||||
|
padding: 80rpx 0;
|
||||||
|
border-radius: 20rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.submit {
|
||||||
|
background: $light-color;
|
||||||
|
}
|
||||||
|
|
||||||
|
.box-tips {
|
||||||
|
margin: 0 72rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.verification {
|
||||||
|
font-size: 24rpx;
|
||||||
|
color: #999;
|
||||||
|
margin-top: 10rpx;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -1,251 +1,281 @@
|
|||||||
<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="请再次输入您的密码" />
|
||||||
|
</u-form-item>
|
||||||
<view class="submit" @click="updatePassword">修改密码</view>
|
|
||||||
</view>
|
<view class="submit" @click="updatePassword">修改密码</view>
|
||||||
</u-form>
|
</view>
|
||||||
</view>
|
</u-form>
|
||||||
</template>
|
</view>
|
||||||
|
</view>
|
||||||
<script>
|
</template>
|
||||||
import { sendMobile, resetByMobile, modifyPass } from "@/api/login";
|
|
||||||
|
<script>
|
||||||
import { md5 } from "@/utils/md5.js"; // md5
|
import {
|
||||||
import myVerification from "@/components/verification/verification.vue"; //验证
|
sendMobile,
|
||||||
import uuid from "@/utils/uuid.modified.js";
|
resetByMobile,
|
||||||
export default {
|
resetPassword
|
||||||
components: {
|
} from "@/api/login";
|
||||||
myVerification,
|
|
||||||
},
|
import {
|
||||||
data() {
|
md5
|
||||||
return {
|
} from "@/utils/md5.js"; // md5
|
||||||
uuid,
|
import myVerification from "@/components/verification/verification.vue"; //验证
|
||||||
validateFlage: false, //是否进行了手机号验证
|
import uuid from "@/utils/uuid.modified.js";
|
||||||
verificationTitle: [
|
export default {
|
||||||
{
|
components: {
|
||||||
title: "安全验证",
|
myVerification,
|
||||||
desc: "请输入当前手机号进行安全验证",
|
},
|
||||||
},
|
data() {
|
||||||
{
|
return {
|
||||||
title: "修改密码",
|
uuid,
|
||||||
desc: "请输入新密码",
|
validateFlage: false, //是否进行了手机号验证
|
||||||
},
|
verificationTitle: [{
|
||||||
],
|
title: "安全验证",
|
||||||
step: 0, //当前验证步骤
|
desc: "请输入当前手机号进行安全验证",
|
||||||
flage: false, //是否验证码验证
|
},
|
||||||
|
{
|
||||||
codeForm: {
|
title: "修改密码",
|
||||||
mobile: "", //手机号
|
desc: "请输入新密码",
|
||||||
code: "", //验证码
|
},
|
||||||
},
|
],
|
||||||
newPassword: "", //新密码
|
step: 0, //当前验证步骤
|
||||||
password: "", //密码
|
flage: false, //是否验证码验证
|
||||||
tips: "", //提示
|
|
||||||
seconds: 60, // 60s等待时间
|
codeForm: {
|
||||||
|
mobile: "", //手机号
|
||||||
// 验证码登录校验
|
code: "", //验证码
|
||||||
codeRules: {
|
},
|
||||||
mobile: [
|
newPassword: "", //新密码
|
||||||
{
|
password: "", //密码
|
||||||
validator: (rule, value, callback) => {
|
tips: "", //提示
|
||||||
return this.$u.test.mobile(value);
|
seconds: 69, // 60s等待时间
|
||||||
},
|
|
||||||
message: "手机号码不正确",
|
// 验证码登录校验
|
||||||
trigger: ["blur"],
|
codeRules: {
|
||||||
},
|
mobile: [{
|
||||||
],
|
validator: (rule, value, callback) => {
|
||||||
code: [
|
return this.$u.test.mobile(value);
|
||||||
{
|
},
|
||||||
min: 4,
|
message: "手机号码不正确",
|
||||||
max: 6,
|
trigger: ["blur"],
|
||||||
required: true,
|
}, ],
|
||||||
message: "请输入验证码",
|
code: [{
|
||||||
trigger: ["blur"],
|
min: 4,
|
||||||
},
|
max: 6,
|
||||||
],
|
required: true,
|
||||||
},
|
message: "请输入验证码",
|
||||||
};
|
trigger: ["blur"],
|
||||||
},
|
}, ],
|
||||||
onReady() {
|
},
|
||||||
// 必须要在onReady生命周期,因为onLoad生命周期组件可能尚未创建完毕
|
};
|
||||||
this.$refs.validateCodeForm.setRules(this.codeRules);
|
},
|
||||||
},
|
onReady() {
|
||||||
watch: {
|
// 必须要在onReady生命周期,因为onLoad生命周期组件可能尚未创建完毕
|
||||||
flage(val) {
|
this.$refs.validateCodeForm.setRules(this.codeRules);
|
||||||
if (val) {
|
},
|
||||||
if (this.$refs.uCode.canGetCode) {
|
watch: {
|
||||||
uni.showLoading({
|
flage(val) {
|
||||||
title: "正在获取验证码",
|
if (val) {
|
||||||
});
|
|
||||||
sendMobile(this.codeForm.mobile, "FIND_USER").then((res) => {
|
if (this.$refs.uCode.canGetCode) {
|
||||||
uni.hideLoading();
|
uni.showLoading({
|
||||||
// 这里此提示会被this.start()方法中的提示覆盖
|
title: "正在获取验证码",
|
||||||
if (res.data.code == 200) {
|
});
|
||||||
this.$refs.uCode.start();
|
sendMobile(this.codeForm.mobile, "FIND_USER").then((res) => {
|
||||||
} else {
|
if (this.$store.state.isShowToast){ uni.hideLoading() };
|
||||||
uni.showToast({
|
// 这里此提示会被this.start()方法中的提示覆盖
|
||||||
title: res.data.message,
|
if (res.data.success) {
|
||||||
duration: 2000,
|
this.$refs.uCode.start();
|
||||||
icon: "none",
|
} else {
|
||||||
});
|
uni.showToast({
|
||||||
}
|
title: res.data.message,
|
||||||
});
|
duration: 2000,
|
||||||
} else {
|
icon: "none",
|
||||||
this.$u.toast("请倒计时结束后再发送");
|
});
|
||||||
}
|
this.flage = false;
|
||||||
}
|
this.$refs.verification.getCode();
|
||||||
},
|
}
|
||||||
},
|
})
|
||||||
|
} else {
|
||||||
methods: {
|
this.$u.toast("请倒计时结束后再发送");
|
||||||
// 修改密码
|
}
|
||||||
updatePassword() {
|
}
|
||||||
modifyPass({
|
},
|
||||||
newPassword: md5(this.newPassword),
|
},
|
||||||
password: md5(this.password),
|
|
||||||
}).then((res) => {
|
methods: {
|
||||||
if (res.data.success) {
|
// 修改密码
|
||||||
uni.showToast({
|
updatePassword() {
|
||||||
title: "修改成功!",
|
if(this.password !== this.newPassword){
|
||||||
duration: 2000,
|
uni.showToast({
|
||||||
icon: "none",
|
title: "两次输入密码不一致!",
|
||||||
});
|
icon: "none",
|
||||||
setTimeout(() => {
|
});
|
||||||
uni.navigateBack({
|
return;
|
||||||
delta: 1,
|
}
|
||||||
});
|
resetPassword({
|
||||||
}, 1000);
|
password: md5(this.password),
|
||||||
}
|
}).then((res) => {
|
||||||
});
|
if (res.data.success) {
|
||||||
},
|
uni.showToast({
|
||||||
|
title: "修改成功!",
|
||||||
// 验证码验证
|
duration: 2000,
|
||||||
verification(val) {
|
icon: "none",
|
||||||
this.flage = val == this.$store.state.verificationKey ? true : false;
|
});
|
||||||
},
|
setTimeout(() => {
|
||||||
|
uni.navigateBack({
|
||||||
// 验证手机号
|
delta: 1,
|
||||||
validatePhone() {
|
});
|
||||||
this.$refs.validateCodeForm.validate((valid) => {
|
}, 1000);
|
||||||
if (valid) {
|
}
|
||||||
resetByMobile(this.codeForm).then((res) => {
|
});
|
||||||
if (res.data.success) {
|
},
|
||||||
this.validateFlage = !this.validateFlage;
|
|
||||||
// 登录成功
|
// 验证码验证
|
||||||
uni.showToast({
|
verification(val) {
|
||||||
title: "验证成功!",
|
this.flage = val == this.$store.state.verificationKey ? true : false;
|
||||||
icon: "none",
|
},
|
||||||
});
|
|
||||||
}
|
// 验证手机号
|
||||||
});
|
validatePhone() {
|
||||||
}
|
this.$refs.validateCodeForm.validate((valid) => {
|
||||||
});
|
if (valid) {
|
||||||
},
|
resetByMobile(this.codeForm).then((res) => {
|
||||||
|
if (res.data.success) {
|
||||||
codeChange(text) {
|
this.validateFlage = !this.validateFlage;
|
||||||
this.tips = text;
|
// 登录成功
|
||||||
},
|
uni.showToast({
|
||||||
end() {},
|
title: "验证成功!",
|
||||||
|
icon: "none",
|
||||||
/**判断是否是当前用户的手机号 */
|
});
|
||||||
isUserPhone() {
|
}
|
||||||
let flage = false;
|
});
|
||||||
let user = this.$options.filters.isLogin();
|
}
|
||||||
if (user.mobile != this.codeForm.mobile) {
|
});
|
||||||
uni.showToast({
|
},
|
||||||
title: "请输入当前绑定手机号",
|
|
||||||
icon: "none",
|
codeChange(text) {
|
||||||
});
|
this.tips = text;
|
||||||
flage = false;
|
},
|
||||||
} else {
|
end() {
|
||||||
flage = true;
|
|
||||||
}
|
this.flage = false;
|
||||||
|
this.$refs.verification.getCode()
|
||||||
return flage;
|
},
|
||||||
},
|
|
||||||
/**获取验证码 */
|
/**判断是否是当前用户的手机号 */
|
||||||
getCode() {
|
isUserPhone() {
|
||||||
if (this.isUserPhone()) {
|
let flage = false;
|
||||||
if (this.tips == "重新获取") {
|
let user = this.$options.filters.isLogin();
|
||||||
this.flage = true;
|
if (user.mobile != this.codeForm.mobile) {
|
||||||
}
|
uni.showToast({
|
||||||
if (!this.$u.test.mobile(this.codeForm.mobile)) {
|
title: "请输入当前绑定手机号",
|
||||||
uni.showToast({
|
icon: "none",
|
||||||
title: "请输入正确手机号",
|
});
|
||||||
icon: "none",
|
flage = false;
|
||||||
});
|
} else {
|
||||||
return false;
|
flage = true;
|
||||||
}
|
}
|
||||||
if (!this.flage) {
|
|
||||||
this.$refs.verification.hide();
|
return flage;
|
||||||
return false;
|
},
|
||||||
}
|
/**获取验证码 */
|
||||||
}
|
getCode() {
|
||||||
},
|
if (this.isUserPhone()) {
|
||||||
start() {
|
if (this.tips == "重新获取") {
|
||||||
this.$u.toast("验证码已发送");
|
this.$refs.verification.error(); //发送
|
||||||
this.flage = false;
|
}
|
||||||
},
|
if (!this.$u.test.mobile(this.codeForm.mobile)) {
|
||||||
},
|
uni.showToast({
|
||||||
};
|
title: "请输入正确手机号",
|
||||||
</script>
|
icon: "none",
|
||||||
<style lang="scss" scoped>
|
});
|
||||||
@import url("../../../passport/login.scss");
|
return false;
|
||||||
.u-form-item {
|
}
|
||||||
margin: 40rpx 0;
|
if (!this.flage) {
|
||||||
}
|
this.$refs.verification.error(); //发送
|
||||||
.sendCode {
|
return false;
|
||||||
/deep/ .u-form-item--right__content__slot {
|
}
|
||||||
display: flex;
|
}
|
||||||
}
|
},
|
||||||
}
|
start() {
|
||||||
page {
|
this.$u.toast("验证码已发送");
|
||||||
background: #fff;
|
this.flage = true;
|
||||||
}
|
|
||||||
.box {
|
this.$refs.verification.hide();
|
||||||
padding: 80rpx 0;
|
},
|
||||||
border-radius: 20rpx;
|
},
|
||||||
}
|
};
|
||||||
.submit {
|
</script>
|
||||||
background: $light-color;
|
<style lang="scss" scoped>
|
||||||
}
|
@import url("@/pages/passport/login.scss");
|
||||||
.box-tips {
|
|
||||||
margin: 0 72rpx;
|
::v-deep .u-form-item {
|
||||||
}
|
margin: 40rpx 0;
|
||||||
.verification {
|
}
|
||||||
font-size: 24rpx;
|
|
||||||
color: #999;
|
.sendCode {
|
||||||
margin-top: 10rpx;
|
::v-deep .u-form-item--right__content__slot {
|
||||||
}
|
display: flex;
|
||||||
</style>
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.h2 {
|
||||||
|
font-size: 40rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
page {
|
||||||
|
background: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.box {
|
||||||
|
padding: 80rpx 0;
|
||||||
|
border-radius: 20rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.submit {
|
||||||
|
background: $light-color;
|
||||||
|
}
|
||||||
|
|
||||||
|
.box-tips {
|
||||||
|
margin: 0 72rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.verification {
|
||||||
|
font-size: 24rpx;
|
||||||
|
color: #999;
|
||||||
|
margin-top: 10rpx;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="securityCenter">
|
<view class="securityCenter">
|
||||||
<u-cell-group>
|
<u-cell-group>
|
||||||
<u-cell-item title="修改密码" @click="navigateTo('/pages/mine/set/securityCenter/editPassword')"></u-cell-item>
|
<u-cell-item title="修改密码" @click="navigateTo('/pages/mine/set/securityCenter/updatePwdTab')"></u-cell-item>
|
||||||
|
<u-cell-item title="注销账户" @click="zhuxiao"></u-cell-item>
|
||||||
</u-cell-group>
|
</u-cell-group>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
@@ -15,6 +16,35 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
|
zhuxiao(){
|
||||||
|
|
||||||
|
uni.showModal({
|
||||||
|
title: "警告",
|
||||||
|
content: "您确定要注销当前账号吗?",
|
||||||
|
confirmText: "确定注销",
|
||||||
|
confirmColor: "#FF0000",
|
||||||
|
cancelText: "取消",
|
||||||
|
success: (res) => {
|
||||||
|
if (res.confirm) {
|
||||||
|
uni.showModal({
|
||||||
|
title: "谨慎操作",
|
||||||
|
content: "再次向您确认,您确定要注销当前账号吗?",
|
||||||
|
confirmText: "坚持注销",
|
||||||
|
confirmColor: "#FF0000",
|
||||||
|
cancelText: "取消",
|
||||||
|
success: (res) => {
|
||||||
|
if (res.confirm) {
|
||||||
|
uni.showToast({
|
||||||
|
title: "您的注销申请已经提交,待管理员审核后。会自动注销当前账号",
|
||||||
|
duration: 10000,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
});
|
||||||
|
},
|
||||||
navigateTo(url) {
|
navigateTo(url) {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: url,
|
url: url,
|
||||||
|
|||||||
34
pages/mine/set/securityCenter/updatePwdTab.vue
Normal file
34
pages/mine/set/securityCenter/updatePwdTab.vue
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
<template>
|
||||||
|
<view class="securityCenter">
|
||||||
|
<u-cell-group>
|
||||||
|
<u-cell-item title="验证密码" @click="navigateTo('/pages/mine/set/securityCenter/editLoginPassword')"></u-cell-item>
|
||||||
|
<u-cell-item title="验证手机号" @click="navigateTo('/pages/mine/set/securityCenter/editPassword')"></u-cell-item>
|
||||||
|
</u-cell-group>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
mobile: "", //存储手机号
|
||||||
|
};
|
||||||
|
},
|
||||||
|
|
||||||
|
methods: {
|
||||||
|
navigateTo(url) {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: url,
|
||||||
|
});
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.securityCenter {
|
||||||
|
.u-cell {
|
||||||
|
line-height: normal;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -1,10 +1,9 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="container">
|
<view class="container">
|
||||||
<view class="person" @click="checkUserInfo()">
|
<view class="person" @click="checkUserInfo()">
|
||||||
<u-image width=140 height="140" shape="circle" :src="userInfo.face || '/static/missing-face.png'" mode="">
|
<u-image width=140 height="140" shape="circle" :src="userInfo.face || userImage" mode="">
|
||||||
</u-image>
|
</u-image>
|
||||||
<view class="user-name">
|
<view class="user-name">
|
||||||
|
|
||||||
{{ userInfo.id ? userInfo.nickName || '' : '暂未登录' }}
|
{{ userInfo.id ? userInfo.nickName || '' : '暂未登录' }}
|
||||||
</view>
|
</view>
|
||||||
<u-icon color="#ccc" name="arrow-right"></u-icon>
|
<u-icon color="#ccc" name="arrow-right"></u-icon>
|
||||||
@@ -16,28 +15,26 @@
|
|||||||
<!-- #ifdef APP-PLUS -->
|
<!-- #ifdef APP-PLUS -->
|
||||||
<u-cell-item title="清除缓存" :value="fileSizeString" @click="clearCache"></u-cell-item>
|
<u-cell-item title="清除缓存" :value="fileSizeString" @click="clearCache"></u-cell-item>
|
||||||
<!-- #endif -->
|
<!-- #endif -->
|
||||||
|
<!-- #ifndef MP-WEIXIN -->
|
||||||
<u-cell-item title="安全中心" @click="navigateTo('/pages/mine/set/securityCenter/securityCenter')"></u-cell-item>
|
<u-cell-item title="安全中心" @click="navigateTo('/pages/mine/set/securityCenter/securityCenter')"></u-cell-item>
|
||||||
|
<!-- #endif -->
|
||||||
|
<u-cell-item title="用户注销" v-if="userInfo.id" @click="logoff"></u-cell-item>
|
||||||
<u-cell-item title="意见反馈" @click="navigateTo('/pages/mine/set/feedBack')"></u-cell-item>
|
<u-cell-item title="意见反馈" @click="navigateTo('/pages/mine/set/feedBack')"></u-cell-item>
|
||||||
<!-- #ifndef H5 -->
|
<!-- #ifndef H5 -->
|
||||||
<!-- #endif -->
|
<!-- #endif -->
|
||||||
<u-cell-item :title="`关于${config.name}`" @click="navigateTo('/pages/mine/set/editionIntro')"></u-cell-item>
|
<u-cell-item :title="`关于${config.name}`" @click="navigateTo('/pages/mine/set/editionIntro')"></u-cell-item>
|
||||||
</u-cell-group>
|
</u-cell-group>
|
||||||
<view class="submit" @click="showModalDialog">{{userInfo.id ?'退出登录':'返回登录'}}</view>
|
<view class="submit" v-if="userInfo.id" @click="quiteLoginOut">退出登录</view>
|
||||||
<u-modal show-cancel-button v-model="quitShow" @confirm="confirm" :confirm-color="lightColor" :async-close="true"
|
|
||||||
:content="userInfo.id ? '确定要退出登录么?' : '确定要返回登录么?'"></u-modal>
|
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { logout } from "@/api/login";
|
|
||||||
import storage from "@/utils/storage.js";
|
|
||||||
import config from "@/config/config";
|
import config from "@/config/config";
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
config,
|
config,
|
||||||
lightColor: this.$lightColor,
|
userImage:config.defaultUserPhoto,
|
||||||
quitShow: false,
|
|
||||||
isCertificate: false,
|
isCertificate: false,
|
||||||
userInfo: {},
|
userInfo: {},
|
||||||
fileSizeString: "0B",
|
fileSizeString: "0B",
|
||||||
@@ -53,28 +50,19 @@ export default {
|
|||||||
url: url,
|
url: url,
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
clear() {
|
/**
|
||||||
storage.setAccessToken("");
|
* 退出登录
|
||||||
storage.setRefreshToken("");
|
*/
|
||||||
storage.setUserInfo({});
|
quiteLoginOut() {
|
||||||
this.$options.filters.navigateToLogin("redirectTo");
|
this.$options.filters.quiteLoginOut();
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 确认退出
|
* 用户注销
|
||||||
* 清除缓存重新登录
|
*/
|
||||||
*/
|
logoff(){
|
||||||
async confirm() {
|
this.$options.filters.logoff();
|
||||||
await logout();
|
},
|
||||||
this.clear();
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 显示退出登录对话框
|
|
||||||
*/
|
|
||||||
showModalDialog() {
|
|
||||||
this.quitShow = true;
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 读取当前缓存
|
* 读取当前缓存
|
||||||
@@ -106,11 +94,7 @@ export default {
|
|||||||
if (this.$options.filters.isLogin("auth")) {
|
if (this.$options.filters.isLogin("auth")) {
|
||||||
this.navigateTo("/pages/mine/set/personMsg");
|
this.navigateTo("/pages/mine/set/personMsg");
|
||||||
} else {
|
} else {
|
||||||
uni.showToast({
|
this.$options.filters.tipsToLogin();
|
||||||
title: "当前暂无用户请登录后重试",
|
|
||||||
duration: 2000,
|
|
||||||
icon: "none",
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -218,11 +202,11 @@ export default {
|
|||||||
color: #333333;
|
color: #333333;
|
||||||
}
|
}
|
||||||
|
|
||||||
/deep/ .u-cell__value {
|
::v-deep .u-cell__value {
|
||||||
color: #cccccc !important;
|
color: #cccccc !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
/deep/ .u-cell__right-icon-wrap {
|
::v-deep .u-cell__right-icon-wrap {
|
||||||
color: #cccccc !important;
|
color: #cccccc !important;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -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;
|
||||||
@@ -99,7 +86,7 @@ page {
|
|||||||
line-height: 70rpx;
|
line-height: 70rpx;
|
||||||
font-size: 24rpx;
|
font-size: 24rpx;
|
||||||
}
|
}
|
||||||
/deep/ .uni-input-input {
|
::v-deep .uni-input-input {
|
||||||
font-size: 24rpx;
|
font-size: 24rpx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -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%;
|
||||||
@@ -621,7 +441,7 @@ view {
|
|||||||
padding-top: 300rpx;
|
padding-top: 300rpx;
|
||||||
color: #999999;
|
color: #999999;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
/deep/ .u-image {
|
::v-deep .u-image {
|
||||||
width: 346rpx;
|
width: 346rpx;
|
||||||
height: 304rpx;
|
height: 304rpx;
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -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="clear(current)"
|
||||||
|
@custom="submitSearchOrderList(current)"
|
||||||
|
v-model="keywords"
|
||||||
|
>
|
||||||
|
</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,81 +61,147 @@
|
|||||||
<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 && sku.afterSaleStatus">
|
||||||
<view v-if="
|
<view
|
||||||
current === 0 && order.groupAfterSaleStatus &&
|
v-if="sku.afterSaleStatus.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 && sku.afterSaleStatus">
|
||||||
@click="tipsShow = true">
|
<view
|
||||||
|
v-if="sku.afterSaleStatus.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>
|
||||||
<view class="after-line">
|
|
||||||
<!-- 售后申请 -->
|
<div v-if="current === 1 || current === 2">
|
||||||
<view v-if="
|
|
||||||
current === 0 && order.groupAfterSaleStatus.includes('NOT_APPLIED')
|
|
||||||
" @click="applyService(sku.sn, order, sku)" class="rebuy-btn">
|
|
||||||
申请售后
|
|
||||||
</view>
|
|
||||||
<!-- 申请中 -->
|
<!-- 申请中 -->
|
||||||
<view class="rebuy-btn" 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="afterDetails(order, sku)" v-if="current === 1 || current === 2" class="rebuy-btn">
|
<view
|
||||||
|
@click="close(order, sku)"
|
||||||
|
v-if="current === 1"
|
||||||
|
class="default-btn close"
|
||||||
|
>
|
||||||
|
取消售后
|
||||||
|
</view>
|
||||||
|
<view
|
||||||
|
@click="afterDetails(order, sku)"
|
||||||
|
v-if="current === 1 || current === 2"
|
||||||
|
class="default-btn border"
|
||||||
|
>
|
||||||
售后详情
|
售后详情
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</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 v-model="tipsShow" content="当订单未确认收货|已过售后服务有效期|已申请售后服务时,不能申请售后"></u-modal>
|
<u-modal
|
||||||
|
show-cancel-button
|
||||||
|
@confirm="closeService"
|
||||||
|
v-model="cancelShow"
|
||||||
|
content="确认取消售后"
|
||||||
|
></u-modal>
|
||||||
|
<u-modal
|
||||||
|
v-model="tipsShow"
|
||||||
|
content="当订单未确认收货|已过售后服务有效期|已申请售后服务时,不能申请售后"
|
||||||
|
></u-modal>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import uniLoadMore from "@/components/uni-load-more/uni-load-more.vue";
|
import uniLoadMore from "@/components/uni-load-more/uni-load-more.vue";
|
||||||
import { getAfterSaleList } from "@/api/after-sale.js";
|
import { getAfterSaleList, cancelAfterSale } from "@/api/after-sale.js";
|
||||||
import { getOrderList } from "@/api/order.js";
|
import { getOrderList } from "@/api/order.js";
|
||||||
|
import storage from "@/utils/storage";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
@@ -134,11 +223,14 @@ export default {
|
|||||||
],
|
],
|
||||||
current: 0, //当前表头索引
|
current: 0, //当前表头索引
|
||||||
tipsShow: false, //提示开关
|
tipsShow: false, //提示开关
|
||||||
|
cancelShow: false, //取消显示开关
|
||||||
|
selectedOrder: "", //选中的order
|
||||||
orderList: [], //订单集合
|
orderList: [], //订单集合
|
||||||
params: {
|
params: {
|
||||||
pageNumber: 1,
|
pageNumber: 1,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
sort: "createTime",
|
sort: "createTime",
|
||||||
|
flowPrice: 0,
|
||||||
order: "desc",
|
order: "desc",
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -147,21 +239,35 @@ export default {
|
|||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
},
|
},
|
||||||
status: "loadmore",
|
status: "loadmore",
|
||||||
|
keywords: "", // 搜索订单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.keywords = 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);
|
||||||
|
},
|
||||||
|
// 清空
|
||||||
|
clear(current){
|
||||||
|
this.params.pageNumber = 1;
|
||||||
|
this.logParams.pageNumber = 1;
|
||||||
|
this.params.keywords = ''
|
||||||
|
this.orderList = [];
|
||||||
|
this.searchOrderList(current);
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* 切换tab页时,初始化数据
|
* 切换tab页时,初始化数据
|
||||||
@@ -174,8 +280,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.keywords ? (this.params.keywords = this.keywords) : "";
|
||||||
|
this.getOrderList();
|
||||||
} else {
|
} else {
|
||||||
this.logParams = {
|
this.logParams = {
|
||||||
pageNumber: 1,
|
pageNumber: 1,
|
||||||
@@ -186,28 +302,28 @@ export default {
|
|||||||
if (index === 1) {
|
if (index === 1) {
|
||||||
this.logParams.serviceStatus = "APPLY";
|
this.logParams.serviceStatus = "APPLY";
|
||||||
}
|
}
|
||||||
|
this.keywords ? (this.logParams.keywords = this.keywords) : "";
|
||||||
this.orderList = [];
|
this.orderList = [];
|
||||||
this.getAfterSaleLogList();
|
this.getAfterSaleLogList();
|
||||||
}
|
}
|
||||||
uni.stopPullDownRefresh();
|
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取订单列表
|
* 获取订单列表
|
||||||
*/
|
*/
|
||||||
getOrderList(index) {
|
getOrderList() {
|
||||||
uni.showLoading({
|
uni.showLoading({
|
||||||
title: "加载中",
|
title: "加载中",
|
||||||
mask: true,
|
mask: true,
|
||||||
});
|
});
|
||||||
getOrderList(this.params).then((res) => {
|
getOrderList(this.params).then((res) => {
|
||||||
uni.hideLoading();
|
if (this.$store.state.isShowToast){ uni.hideLoading() };
|
||||||
const orderlist = res.data.result.records;
|
const orderList = res.data.result.records;
|
||||||
if (orderlist.length > 0) {
|
if (orderList.length > 0) {
|
||||||
this.orderList = this.orderList.concat(orderlist);
|
this.orderList = this.orderList.concat(orderList);
|
||||||
this.params.pageNumber += 1;
|
this.params.pageNumber += 1;
|
||||||
}
|
}
|
||||||
if (orderlist.length < 10) {
|
if (orderList.length < 10) {
|
||||||
this.status = "nomore";
|
this.status = "nomore";
|
||||||
} else {
|
} else {
|
||||||
this.status = "loading";
|
this.status = "loading";
|
||||||
@@ -215,6 +331,31 @@ export default {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
close(order, sku) {
|
||||||
|
console.log(order, sku);
|
||||||
|
this.selectedOrder = order;
|
||||||
|
this.cancelShow = true;
|
||||||
|
},
|
||||||
|
|
||||||
|
async closeService() {
|
||||||
|
uni.showLoading({
|
||||||
|
title: "加载中",
|
||||||
|
});
|
||||||
|
console.log(this.selectedOrder);
|
||||||
|
let res = await cancelAfterSale(this.selectedOrder.sn);
|
||||||
|
if (res.data.success) {
|
||||||
|
uni.showToast({
|
||||||
|
title: "取消成功!",
|
||||||
|
duration: 2000,
|
||||||
|
icon: "none",
|
||||||
|
});
|
||||||
|
}
|
||||||
|
this.orderList = [];
|
||||||
|
this.searchOrderList(this.current);
|
||||||
|
|
||||||
|
if (this.$store.state.isShowToast){ uni.hideLoading() };
|
||||||
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 售后详情
|
* 售后详情
|
||||||
*/
|
*/
|
||||||
@@ -261,11 +402,9 @@ export default {
|
|||||||
...order,
|
...order,
|
||||||
...sku,
|
...sku,
|
||||||
};
|
};
|
||||||
|
storage.setAfterSaleData(data);
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: `/pages/order/afterSales/afterSalesSelect?sn=${sn}&sku=${encodeURIComponent(
|
url: `/pages/order/afterSales/afterSalesSelect?sn=${sn}`,
|
||||||
JSON.stringify(data)
|
|
||||||
)}`,
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -274,11 +413,14 @@ export default {
|
|||||||
*/
|
*/
|
||||||
onExpress(order, sku) {
|
onExpress(order, sku) {
|
||||||
sku.storeName = order.storeName;
|
sku.storeName = order.storeName;
|
||||||
|
let data = {
|
||||||
|
...order,
|
||||||
|
...sku,
|
||||||
|
};
|
||||||
|
|
||||||
|
storage.setAfterSaleData(data);
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: `./afterSalesDetailExpress?serviceSn=${
|
url: `./afterSalesDetailExpress?serviceSn=${order.sn}`,
|
||||||
order.sn
|
|
||||||
}&sku=${encodeURIComponent(JSON.stringify(sku))}`,
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -324,35 +466,43 @@ page,
|
|||||||
background: $page-color-base;
|
background: $page-color-base;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.body-view {
|
.body-view {
|
||||||
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;
|
||||||
@@ -396,6 +546,7 @@ page,
|
|||||||
color: $main-color;
|
color: $main-color;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.btn-view {
|
.btn-view {
|
||||||
padding: 16rpx 0;
|
padding: 16rpx 0;
|
||||||
|
|
||||||
@@ -405,10 +556,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;
|
||||||
@@ -417,31 +570,37 @@ page,
|
|||||||
height: 70rpx;
|
height: 70rpx;
|
||||||
line-height: 70rpx;
|
line-height: 70rpx;
|
||||||
}
|
}
|
||||||
|
.not_center {
|
||||||
|
text-align: left;
|
||||||
|
}
|
||||||
|
|
||||||
.icon {
|
.icon {
|
||||||
margin-right: 10rpx;
|
margin-right: 10rpx;
|
||||||
}
|
}
|
||||||
.cancel-btn {
|
|
||||||
color: #999999;
|
.sale {
|
||||||
border-color: #999999;
|
width: 100%;
|
||||||
margin-left: 15rpx;
|
display: flex;
|
||||||
height: 60rpx;
|
justify-content: flex-end;
|
||||||
}
|
}
|
||||||
.pay-btn {
|
|
||||||
background-color: #1abc9c;
|
.default-btn {
|
||||||
color: #ffffff;
|
|
||||||
margin-left: 15rpx;
|
|
||||||
height: 60rpx;
|
|
||||||
}
|
|
||||||
.rebuy-btn {
|
|
||||||
background-color: #ffffff;
|
background-color: #ffffff;
|
||||||
margin-left: 15rpx;
|
margin-left: 15rpx;
|
||||||
height: 60rpx;
|
height: 60rpx;
|
||||||
line-height: 60rpx;
|
line-height: 60rpx;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
font-size: 24rpx;
|
font-size: 24rpx;
|
||||||
border: 2rpx solid $light-color;
|
|
||||||
color: $light-color;
|
|
||||||
padding: 0 24rpx;
|
padding: 0 24rpx;
|
||||||
border-radius: 200px;
|
border-radius: 200px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.close {
|
||||||
|
color: $light-color;
|
||||||
|
}
|
||||||
|
|
||||||
|
.border {
|
||||||
|
border: 2rpx solid $light-color;
|
||||||
|
color: $light-color;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -37,9 +37,8 @@
|
|||||||
<view class="body-view">
|
<view class="body-view">
|
||||||
<!-- 退款原因 -->
|
<!-- 退款原因 -->
|
||||||
<view class="opt-view">
|
<view class="opt-view">
|
||||||
<u-form-item label="申请原因" :label-width="150">
|
<u-form-item label="申请原因" :label-width="150" >
|
||||||
<u-input v-model="form.reason" type="select" input-align="right" :select-open="reasonSelectShow"
|
<div style="width: 100%; text-align: right;" @click="reasonSelectShow = true">{{ form.reason || '请选择申请原因' }}</div>
|
||||||
@click="reasonSelectShow = true" placeholder="请选择申请原因" />
|
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
<u-form-item label="申请说明" :label-width="150">
|
<u-form-item label="申请说明" :label-width="150">
|
||||||
<u-input input-align="right" type="textarea" v-model="form.problemDesc" placeholder="请描述申请售后的说明" />
|
<u-input input-align="right" type="textarea" v-model="form.problemDesc" placeholder="请描述申请售后的说明" />
|
||||||
@@ -195,9 +194,7 @@ export default {
|
|||||||
title: navTitle, //此处写页面的title
|
title: navTitle, //此处写页面的title
|
||||||
});
|
});
|
||||||
this.sn = options.sn;
|
this.sn = options.sn;
|
||||||
let dsku = decodeURIComponent(options.sku);
|
this.sku = storage.getAfterSaleData();;
|
||||||
let newSku = JSON.parse(dsku);
|
|
||||||
this.sku = newSku;
|
|
||||||
|
|
||||||
this.form.orderItemSn = options.sn;
|
this.form.orderItemSn = options.sn;
|
||||||
this.form.skuId = this.sku.skuId;
|
this.form.skuId = this.sku.skuId;
|
||||||
@@ -226,7 +223,7 @@ export default {
|
|||||||
this.reasonList = action;
|
this.reasonList = action;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
uni.hideLoading();
|
if (this.$store.state.isShowToast){ uni.hideLoading() };
|
||||||
},
|
},
|
||||||
//打开地区选择器
|
//打开地区选择器
|
||||||
showCitySelect() {
|
showCitySelect() {
|
||||||
@@ -290,7 +287,7 @@ export default {
|
|||||||
this.form.applyRefundPrice = this.applyInfo.applyRefundPrice;
|
this.form.applyRefundPrice = this.applyInfo.applyRefundPrice;
|
||||||
|
|
||||||
applyReturn(this.sn, this.form).then((resp) => {
|
applyReturn(this.sn, this.form).then((resp) => {
|
||||||
uni.hideLoading();
|
if (this.$store.state.isShowToast){ uni.hideLoading() };
|
||||||
if (resp.data.success) {
|
if (resp.data.success) {
|
||||||
this.$refs.uToast.show({ title: "提交成功", type: "success" });
|
this.$refs.uToast.show({ title: "提交成功", type: "success" });
|
||||||
uni.redirectTo({
|
uni.redirectTo({
|
||||||
@@ -312,6 +309,7 @@ export default {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
console.log(this.form.accountType)
|
||||||
if (this.form.accountType == "BANK_TRANSFER") {
|
if (this.form.accountType == "BANK_TRANSFER") {
|
||||||
// 银行开户行校验
|
// 银行开户行校验
|
||||||
if (this.$u.test.isEmpty(this.form.bankDepositName)) {
|
if (this.$u.test.isEmpty(this.form.bankDepositName)) {
|
||||||
@@ -336,12 +334,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: "银行开户名输入错误",
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view>
|
<view>
|
||||||
<view class="goods-item-view" @click="gotoGoodsDetail(sku.skuId)">
|
<view class="goods-item-view" @click="gotoGoodsDetail(sku)">
|
||||||
<view class="goods-img">
|
<view class="goods-img">
|
||||||
<u-image border-radius="6" width="131rpx" height="131rpx" :src="sku.image"></u-image>
|
<u-image border-radius="6" width="131rpx" height="131rpx" :src="sku.image"></u-image>
|
||||||
</view>
|
</view>
|
||||||
@@ -30,33 +30,42 @@
|
|||||||
<view class="opt-view">
|
<view class="opt-view">
|
||||||
<view class="img-title" style="font-size: 30rpx">填写物流信息</view>
|
<view class="img-title" style="font-size: 30rpx">填写物流信息</view>
|
||||||
<u-form-item label="返回方式" :label-width="150">
|
<u-form-item label="返回方式" :label-width="150">
|
||||||
<u-input type="text" input-align="right" value="快递至第三方卖家" />
|
<div style="width: 100%; text-align: right;">快递至第三方卖家</div>
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
<u-form-item label="快递公司" :label-width="150">
|
<u-form-item label="快递公司" :label-width="150">
|
||||||
<u-input v-model="form.courierCompany" type="select" input-align="right" :select-open="companySelectShow" @click="companySelectShow = true" placeholder="请选择快递公司" />
|
<div style="width: 100%; text-align: right;" @click="companySelectShow = true">
|
||||||
|
{{ form.courierCompany || '请选择快递公司' }}
|
||||||
|
</div>
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
<u-form-item label="快递单号" :label-width="150">
|
<u-form-item label="快递单号" :label-width="150">
|
||||||
<u-input input-align="right" v-model="form.logisticsNo" placeholder="请输入快递单号" />
|
<u-input input-align="right" v-model="form.logisticsNo" placeholder="请输入快递单号"/>
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
<u-form-item label="发货时间" :label-width="150">
|
<u-form-item label="发货时间" :label-width="150">
|
||||||
<u-input input-align="right" type="selects" disabled v-model="form.mDeliverTime" @click="timeshow = true" placeholder="请选择发货时间" />
|
<div style="width: 100%; text-align: right;" @click="timeshow = true">{{
|
||||||
|
form.mDeliverTime || '请选择发货时间'
|
||||||
|
}}
|
||||||
|
</div>
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
</view>
|
</view>
|
||||||
</scroll-view>
|
</scroll-view>
|
||||||
|
|
||||||
<view class="submit-view">
|
<view class="submit-view">
|
||||||
<u-button ripple :customStyle="{'background':$lightColor,'color':'#fff' }" shape="circle" @click="onSubmit">提交申请</u-button>
|
<u-button ripple :customStyle="{'background':$lightColor,'color':'#fff' }" shape="circle" @click="onSubmit">
|
||||||
|
提交申请
|
||||||
|
</u-button>
|
||||||
</view>
|
</view>
|
||||||
</u-form>
|
</u-form>
|
||||||
<u-select mode="single-column" :list="companyList" v-model="companySelectShow" @confirm="companySelectConfirm"></u-select>
|
<u-select mode="single-column" :list="companyList" v-model="companySelectShow"
|
||||||
|
@confirm="companySelectConfirm"></u-select>
|
||||||
<u-calendar v-model="timeshow" :mode="'date'" @change="onTimeChange"></u-calendar>
|
<u-calendar v-model="timeshow" :mode="'date'" @change="onTimeChange"></u-calendar>
|
||||||
<u-toast ref="uToast" />
|
<u-toast ref="uToast"/>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { getLogistics } from "@/api/address.js";
|
import {getLogistics} from "@/api/address.js";
|
||||||
import { fillShipInfo } from "@/api/after-sale.js";
|
import {fillShipInfo} from "@/api/after-sale.js";
|
||||||
|
import storage from "@/utils/storage";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
@@ -76,7 +85,8 @@ export default {
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
onLoad(options) {
|
onLoad(options) {
|
||||||
this.sku = JSON.parse(decodeURIComponent(options.sku));
|
|
||||||
|
this.sku = storage.getAfterSaleData();
|
||||||
let navTitle = "服务单详情";
|
let navTitle = "服务单详情";
|
||||||
uni.setNavigationBarTitle({
|
uni.setNavigationBarTitle({
|
||||||
title: navTitle, //此处写页面的title
|
title: navTitle, //此处写页面的title
|
||||||
@@ -120,13 +130,39 @@ export default {
|
|||||||
* 点击提交
|
* 点击提交
|
||||||
*/
|
*/
|
||||||
onSubmit() {
|
onSubmit() {
|
||||||
|
delete this.form.courierCompany;
|
||||||
|
|
||||||
|
if (this.form.logisticsId == "") {
|
||||||
|
this.$refs.uToast.show({
|
||||||
|
title: "请选择快递公司",
|
||||||
|
type: "error",
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (this.form.logisticsNo == "") {
|
||||||
|
this.$refs.uToast.show({
|
||||||
|
title: "请填写快递单号",
|
||||||
|
type: "error",
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (this.form.mDeliverTime == "") {
|
||||||
|
this.$refs.uToast.show({
|
||||||
|
title: "请选择发货时间",
|
||||||
|
type: "error",
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
uni.showLoading({
|
uni.showLoading({
|
||||||
title: "加载中",
|
title: "加载中",
|
||||||
mask: true,
|
mask: true,
|
||||||
});
|
});
|
||||||
delete this.form.courierCompany;
|
|
||||||
fillShipInfo(this.serviceDetail.sn, this.form).then((res) => {
|
fillShipInfo(this.serviceDetail.sn, this.form).then((res) => {
|
||||||
uni.hideLoading();
|
if (this.$store.state.isShowToast) {
|
||||||
|
uni.hideLoading()
|
||||||
|
}
|
||||||
|
;
|
||||||
if (res.statusCode === 200) {
|
if (res.statusCode === 200) {
|
||||||
this.$refs.uToast.show({
|
this.$refs.uToast.show({
|
||||||
title: "提交成功",
|
title: "提交成功",
|
||||||
@@ -137,6 +173,11 @@ export default {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
gotoGoodsDetail(sku) {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: `/pages/product/goods?id=${sku.skuId}&goodsId=${sku.goodsId}`,
|
||||||
|
});
|
||||||
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
@@ -147,12 +188,15 @@ page,
|
|||||||
background: $page-color-base;
|
background: $page-color-base;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mp-iphonex-bottom {
|
.mp-iphonex-bottom {
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
.after-sales-goods-detail-view {
|
.after-sales-goods-detail-view {
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
padding: 10rpx 0rpx;
|
padding: 10rpx 0rpx;
|
||||||
|
|
||||||
.header {
|
.header {
|
||||||
background-color: #f7f7f7;
|
background-color: #f7f7f7;
|
||||||
color: #999999;
|
color: #999999;
|
||||||
@@ -162,15 +206,18 @@ page,
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
line-height: 70rpx;
|
line-height: 70rpx;
|
||||||
|
|
||||||
.header-text {
|
.header-text {
|
||||||
background-color: #999999;
|
background-color: #999999;
|
||||||
padding: 10rpx 30rpx;
|
padding: 10rpx 30rpx;
|
||||||
border-radius: 50rpx;
|
border-radius: 50rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.seller-name {
|
.seller-name {
|
||||||
color: $main-color;
|
color: $main-color;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.goods-item-view {
|
.goods-item-view {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
@@ -180,15 +227,18 @@ page,
|
|||||||
.goods-info {
|
.goods-info {
|
||||||
padding-left: 30rpx;
|
padding-left: 30rpx;
|
||||||
flex: 1;
|
flex: 1;
|
||||||
|
|
||||||
.goods-title {
|
.goods-title {
|
||||||
margin-bottom: 10rpx;
|
margin-bottom: 10rpx;
|
||||||
color: $font-color-dark;
|
color: $font-color-dark;
|
||||||
}
|
}
|
||||||
|
|
||||||
.goods-specs {
|
.goods-specs {
|
||||||
font-size: 24rpx;
|
font-size: 24rpx;
|
||||||
margin-bottom: 10rpx;
|
margin-bottom: 10rpx;
|
||||||
color: #cccccc;
|
color: #cccccc;
|
||||||
}
|
}
|
||||||
|
|
||||||
.goods-price {
|
.goods-price {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
@@ -196,23 +246,27 @@ page,
|
|||||||
font-size: 28rpx;
|
font-size: 28rpx;
|
||||||
margin-bottom: 10rpx;
|
margin-bottom: 10rpx;
|
||||||
color: $light-color;
|
color: $light-color;
|
||||||
|
|
||||||
.num {
|
.num {
|
||||||
font-size: 24rpx;
|
font-size: 24rpx;
|
||||||
color: #999999;
|
color: #999999;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.goods-num {
|
.goods-num {
|
||||||
width: 60rpx;
|
width: 60rpx;
|
||||||
color: $main-color;
|
color: $main-color;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.opt-view {
|
.opt-view {
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
padding: 40rpx 30rpx 0rpx 30rpx;
|
padding: 40rpx 30rpx 0rpx 30rpx;
|
||||||
|
|
||||||
font-size: 26rpx;
|
font-size: 26rpx;
|
||||||
|
|
||||||
.how-view {
|
.how-view {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
@@ -221,18 +275,21 @@ page,
|
|||||||
height: 80rpx;
|
height: 80rpx;
|
||||||
border-bottom: 1px solid $page-color-base;
|
border-bottom: 1px solid $page-color-base;
|
||||||
}
|
}
|
||||||
|
|
||||||
.explain-view {
|
.explain-view {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
height: 150rpx;
|
height: 150rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.img-title {
|
.img-title {
|
||||||
height: 80rpx;
|
height: 80rpx;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.images-view {
|
.images-view {
|
||||||
padding: 20rpx;
|
padding: 20rpx;
|
||||||
display: flex;
|
display: flex;
|
||||||
@@ -241,6 +298,7 @@ page,
|
|||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.submit-view {
|
.submit-view {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
z-index: 999;
|
z-index: 999;
|
||||||
|
|||||||
@@ -56,6 +56,7 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { getAfterSaleInfo } from "@/api/after-sale";
|
import { getAfterSaleInfo } from "@/api/after-sale";
|
||||||
|
import storage from "@/utils/storage";
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@@ -66,10 +67,7 @@ export default {
|
|||||||
},
|
},
|
||||||
onLoad(options) {
|
onLoad(options) {
|
||||||
this.sn = options.sn;
|
this.sn = options.sn;
|
||||||
let dData = decodeURIComponent(options.sku);
|
this.sku = storage.getAfterSaleData();
|
||||||
let newData = JSON.parse(dData);
|
|
||||||
this.sku = newData;
|
|
||||||
|
|
||||||
// 查看当前商品是否支持退款退货
|
// 查看当前商品是否支持退款退货
|
||||||
this.init()
|
this.init()
|
||||||
},
|
},
|
||||||
@@ -88,9 +86,7 @@ export default {
|
|||||||
*/
|
*/
|
||||||
onSelect(value) {
|
onSelect(value) {
|
||||||
uni.redirectTo({
|
uni.redirectTo({
|
||||||
url: `./afterSalesDetail?sn=${this.sn}&sku=${encodeURIComponent(
|
url: `./afterSalesDetail?sn=${this.sn}&value=${value}`,
|
||||||
JSON.stringify(this.sku)
|
|
||||||
)}&value=${value}`,
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@@ -90,9 +90,10 @@
|
|||||||
serviceDetail.afterSaleImage &&
|
serviceDetail.afterSaleImage &&
|
||||||
serviceDetail.afterSaleImage.split(',').length != 0
|
serviceDetail.afterSaleImage.split(',').length != 0
|
||||||
">
|
">
|
||||||
<image :src="img" @click="preview(serviceDetail.afterSaleImage.split(','), index)"
|
<view v-for="(img, index) in serviceDetail.afterSaleImage.split(',')" :key="index">
|
||||||
v-for="(img, index) in serviceDetail.afterSaleImage.split(',')" :key="index"
|
<u-image width="100" height="100" :src="img" @click="preview(serviceDetail.afterSaleImage.split(','), index)"
|
||||||
style="width: 50px; height: 50px; margin: 0px 5px"></image>
|
></u-image>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<!-- 如果服务类型为退款则不显示 -->
|
<!-- 如果服务类型为退款则不显示 -->
|
||||||
<view class="detail-item"
|
<view class="detail-item"
|
||||||
@@ -197,7 +198,7 @@
|
|||||||
<script>
|
<script>
|
||||||
import {
|
import {
|
||||||
getServiceDetail,
|
getServiceDetail,
|
||||||
getstoreAfterSaleAddress,
|
getStoreAfterSaleAddress,
|
||||||
getAfterSaleLog,
|
getAfterSaleLog,
|
||||||
getAfterSaleReason,
|
getAfterSaleReason,
|
||||||
} from "@/api/after-sale.js";
|
} from "@/api/after-sale.js";
|
||||||
@@ -315,7 +316,7 @@ export default {
|
|||||||
* 获取地址信息
|
* 获取地址信息
|
||||||
*/
|
*/
|
||||||
getAddress() {
|
getAddress() {
|
||||||
getstoreAfterSaleAddress(this.sn).then((res) => {
|
getStoreAfterSaleAddress(this.sn).then((res) => {
|
||||||
if (res.data.success) {
|
if (res.data.success) {
|
||||||
this.storeAfterSaleAddress = res.data.result;
|
this.storeAfterSaleAddress = res.data.result;
|
||||||
}
|
}
|
||||||
@@ -351,7 +352,7 @@ export default {
|
|||||||
title: "加载中",
|
title: "加载中",
|
||||||
});
|
});
|
||||||
getServiceDetail(this.sn).then((res) => {
|
getServiceDetail(this.sn).then((res) => {
|
||||||
uni.hideLoading();
|
if (this.$store.state.isShowToast){ uni.hideLoading() };
|
||||||
this.serviceDetail = res.data.result;
|
this.serviceDetail = res.data.result;
|
||||||
if (
|
if (
|
||||||
this.serviceDetail.serviceType == "RETURN_GOODS" ||
|
this.serviceDetail.serviceType == "RETURN_GOODS" ||
|
||||||
|
|||||||
@@ -45,13 +45,13 @@
|
|||||||
<view class="cell-item">
|
<view class="cell-item">
|
||||||
<view class="cell-title"> 投诉凭证 </view>
|
<view class="cell-title"> 投诉凭证 </view>
|
||||||
<view class="cell-view">
|
<view class="cell-view">
|
||||||
<u-upload ref="uUpload" :header=" { accessToken: storage.getAccessToken() }" upload-text="" :show-progress="false" :action="action" width="100" @on-uploaded="onUploaded" :max-count="5">
|
<u-upload ref="uUpload" :header=" { accessToken: storage.getAccessToken() }" :action="action" width="200" @on-uploaded="onUploaded" :max-count="5">
|
||||||
</u-upload>
|
</u-upload>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="submit-btn" @click="handleSumit">提交</view>
|
<view class="submit-btn" @click="handleSubmit">提交</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -68,6 +68,7 @@ export default {
|
|||||||
orderStatusList: {
|
orderStatusList: {
|
||||||
//订单状态列表
|
//订单状态列表
|
||||||
UNDELIVERED: "待发货",
|
UNDELIVERED: "待发货",
|
||||||
|
PARTS_DELIVERED: "部分发货",
|
||||||
UNPAID: "未付款",
|
UNPAID: "未付款",
|
||||||
PAID: "已付款",
|
PAID: "已付款",
|
||||||
DELIVERED: "已发货",
|
DELIVERED: "已发货",
|
||||||
@@ -109,7 +110,15 @@ export default {
|
|||||||
/**
|
/**
|
||||||
* 提交
|
* 提交
|
||||||
*/
|
*/
|
||||||
handleSumit() {
|
handleSubmit() {
|
||||||
|
if(!this.images.length && !this.complainValue){
|
||||||
|
uni.showToast({
|
||||||
|
title:'请上传图片凭证和投诉内容',
|
||||||
|
icon:'none'
|
||||||
|
})
|
||||||
|
return
|
||||||
|
|
||||||
|
}
|
||||||
// 循环出商品
|
// 循环出商品
|
||||||
let goods = this.orderGoodsList.filter((item) => {
|
let goods = this.orderGoodsList.filter((item) => {
|
||||||
return item.skuId == this.skuId;
|
return item.skuId == this.skuId;
|
||||||
@@ -170,7 +179,7 @@ export default {
|
|||||||
this.order = order.order;
|
this.order = order.order;
|
||||||
this.orderGoodsList = order.orderItems;
|
this.orderGoodsList = order.orderItems;
|
||||||
this.orderDetail = res.data.result;
|
this.orderDetail = res.data.result;
|
||||||
uni.hideLoading();
|
if (this.$store.state.isShowToast){ uni.hideLoading() };
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -208,7 +217,7 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/deep/ .u-input__textarea {
|
::v-deep .u-input__textarea {
|
||||||
padding: 0;
|
padding: 0;
|
||||||
}
|
}
|
||||||
.cell-title {
|
.cell-title {
|
||||||
|
|||||||
@@ -34,7 +34,16 @@
|
|||||||
<span>{{ complaint.content }}</span>
|
<span>{{ complaint.content }}</span>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="speak-way" v-else>暂无对话</view>
|
<view class="speak-way" v-else>暂无对话</view>
|
||||||
|
<div v-if="complainDetail.complainStatus!='COMPLETE'">
|
||||||
|
<view class="tips">回复对话</view>
|
||||||
|
<view class="cell-item complain-content">
|
||||||
|
<view class="cell-view content">
|
||||||
|
<u-input type="textarea" height="70rpx" auto-height v-model="complainValue" />
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="submit-btn" @click="handleSubmit">回复</view>
|
||||||
|
</div>
|
||||||
<view class="tips">平台仲裁</view>
|
<view class="tips">平台仲裁</view>
|
||||||
<u-cell-group>
|
<u-cell-group>
|
||||||
<u-cell-item :arrow="false" title="仲裁意见" :value="complainDetail.arbitrationResult || '暂无'"></u-cell-item>
|
<u-cell-item :arrow="false" title="仲裁意见" :value="complainDetail.arbitrationResult || '暂无'"></u-cell-item>
|
||||||
@@ -43,22 +52,27 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { getComplainDetail } from "@/api/after-sale";
|
import { getComplainDetail, communication } from "@/api/after-sale";
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
complainId: "",
|
||||||
|
complainValue: "", //回复内容
|
||||||
complainDetail: "", //投诉详情
|
complainDetail: "", //投诉详情
|
||||||
statusData: {
|
statusData: {
|
||||||
|
NEW: "新投诉",
|
||||||
NO_APPLY: "未申请",
|
NO_APPLY: "未申请",
|
||||||
APPLYING: "申请中",
|
APPLYING: "申请中",
|
||||||
COMPLETE: "已完成,此时可申请",
|
COMPLETE: "已完成",
|
||||||
EXPIRED: "已失效,不可申请",
|
EXPIRED: "已失效",
|
||||||
CANCEL: "已取消",
|
CANCEL: "已取消",
|
||||||
|
WAIT_ARBITRATION:"等待仲裁"
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
onLoad(option) {
|
onLoad(option) {
|
||||||
|
this.complainId = option.id;
|
||||||
this.init(option.id);
|
this.init(option.id);
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
@@ -76,6 +90,38 @@ export default {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
handleSubmit() {
|
||||||
|
if (!this.complainValue) {
|
||||||
|
uni.showToast({
|
||||||
|
title: "请输入回复内容",
|
||||||
|
duration: 2000,
|
||||||
|
icon: "none",
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
let params = {
|
||||||
|
content: this.complainValue,
|
||||||
|
complainId: this.complainId,
|
||||||
|
};
|
||||||
|
communication(params).then((res) => {
|
||||||
|
if (res.data.success) {
|
||||||
|
uni.showToast({
|
||||||
|
title: "回复成功",
|
||||||
|
duration: 2000,
|
||||||
|
icon: "none",
|
||||||
|
});
|
||||||
|
this.complainValue = '';
|
||||||
|
this.init(this.complainId);
|
||||||
|
} else {
|
||||||
|
uni.showToast({
|
||||||
|
title: res.data.message,
|
||||||
|
duration: 2000,
|
||||||
|
icon: "none",
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
},
|
||||||
/**
|
/**
|
||||||
* 初始化投诉详情
|
* 初始化投诉详情
|
||||||
*/
|
*/
|
||||||
@@ -93,7 +139,7 @@ export default {
|
|||||||
icon: "none",
|
icon: "none",
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
uni.hideLoading();
|
if (this.$store.state.isShowToast){ uni.hideLoading() };
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -124,4 +170,32 @@ export default {
|
|||||||
.tips {
|
.tips {
|
||||||
margin: 40rpx 32rpx;
|
margin: 40rpx 32rpx;
|
||||||
}
|
}
|
||||||
|
.cell {
|
||||||
|
width: 100%;
|
||||||
|
background: #fff;
|
||||||
|
padding: 26rpx;
|
||||||
|
}
|
||||||
|
.complain-content {
|
||||||
|
margin: 40rpx 32rpx;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
|
||||||
|
.content {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
.title {
|
||||||
|
width: 140rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.submit-btn {
|
||||||
|
width: 70%;
|
||||||
|
margin: 0 auto;
|
||||||
|
height: 80rpx;
|
||||||
|
line-height: 80rpx;
|
||||||
|
color: #fff;
|
||||||
|
text-align: center;
|
||||||
|
background: $light-color;
|
||||||
|
margin-top: 20px;
|
||||||
|
border-radius: 200px;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -28,9 +28,8 @@
|
|||||||
<view class="complain-speak"> {{ item.complainTopic }} </view>
|
<view class="complain-speak"> {{ item.complainTopic }} </view>
|
||||||
</view>
|
</view>
|
||||||
<view class="complain-btn">
|
<view class="complain-btn">
|
||||||
<u-tag mode="plain" @click="handleClear(item)" class="complain-tag" text="撤销投诉" type="info" v-if="
|
<u-tag mode="plain" @click="handleClear(item)" class="complain-tag" text="撤销投诉" type="info"
|
||||||
item.complainStatus != 'EXPIRED' && item.complainStatus != 'CANCEL'
|
v-if="item.complainStatus === 'APPLYING' || item.complainStatus === 'NEW'" />
|
||||||
" />
|
|
||||||
<u-tag mode="plain" @click="handleInfo(item)" class="complain-tag" text="投诉详情" type="info" />
|
<u-tag mode="plain" @click="handleInfo(item)" class="complain-tag" text="投诉详情" type="info" />
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -48,12 +47,13 @@ export default {
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
statusData: {
|
statusData: {
|
||||||
NEW: "新订单",
|
NEW: "新投诉",
|
||||||
NO_APPLY: "未申请",
|
NO_APPLY: "未申请",
|
||||||
APPLYING: "申请中",
|
APPLYING: "申请中",
|
||||||
COMPLETE: "已完成",
|
COMPLETE: "已完成",
|
||||||
EXPIRED: "已失效",
|
EXPIRED: "已失效",
|
||||||
CANCEL: "已取消",
|
CANCEL: "已取消",
|
||||||
|
WAIT_ARBITRATION:"等待仲裁"
|
||||||
},
|
},
|
||||||
show: false,
|
show: false,
|
||||||
content: "是否撤销投诉?",
|
content: "是否撤销投诉?",
|
||||||
@@ -139,7 +139,7 @@ export default {
|
|||||||
} else {
|
} else {
|
||||||
this.empty = true;
|
this.empty = true;
|
||||||
}
|
}
|
||||||
uni.hideLoading();
|
if (this.$store.state.isShowToast){ uni.hideLoading() };
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -162,7 +162,7 @@ export default {
|
|||||||
font-size: 24rpx;
|
font-size: 24rpx;
|
||||||
color: #999;
|
color: #999;
|
||||||
}
|
}
|
||||||
/deep/ .seller-name {
|
::v-deep .seller-name {
|
||||||
width: auto !important;
|
width: auto !important;
|
||||||
}
|
}
|
||||||
.complain-btn {
|
.complain-btn {
|
||||||
|
|||||||
248
pages/order/deliverDetail.vue
Normal file
248
pages/order/deliverDetail.vue
Normal file
@@ -0,0 +1,248 @@
|
|||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<view class="logistics-detail">
|
||||||
|
<view class="card">
|
||||||
|
<div v-if="logisticsList && logisticsList.length>0">
|
||||||
|
<ul class="express-log" v-for="(packageItem, packageIndex) in logisticsList" :key="packageIndex" v-if="packageItem">
|
||||||
|
<div class="layui-layer-wrap">
|
||||||
|
<dl>
|
||||||
|
<dt>物流公司:</dt>
|
||||||
|
<dd><div class="text-box">{{ packageItem.logisticsName }}</div></dd>
|
||||||
|
</dl>
|
||||||
|
<dl>
|
||||||
|
<dt>快递单号:</dt>
|
||||||
|
<dd>
|
||||||
|
<div nctype="ordersSn" class="text-box">
|
||||||
|
<a class="item" :href='"https://www.baidu.com/s?wd="+packageItem.logisticsNo' target="_blank">{{ packageItem.logisticsNo }}</a>
|
||||||
|
</div>
|
||||||
|
</dd>
|
||||||
|
</dl>
|
||||||
|
<div class="div-express-log">
|
||||||
|
<ul class="express-log express-log-name">
|
||||||
|
<li v-for="(item, index) in packageItem.orderPackageItemList" :key="index">
|
||||||
|
<p class="time" style="width: 50%;"><span>商品名称:</span><span>{{ item.goodsName }}</span></p>
|
||||||
|
<p class="time" style="width: 30%;"><span>发货时间:</span><span>{{ item.logisticsTime }}</span></p>
|
||||||
|
<p class="time" style="width: 20%;"><span>发货数量:</span><span>{{ item.deliverNumber }}</span></p>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<div class="div-express-log">
|
||||||
|
<ul class="express-log" v-if="packageItem.traces && packageItem.traces.traces">
|
||||||
|
<li v-for="(item, index) in packageItem.traces.traces" :key="index">
|
||||||
|
<span class="time">{{ item.AcceptTime || item.acceptTime }}</span>
|
||||||
|
<span class="detail">{{ item.AcceptStation || item.remark }}</span>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
<ul class="express-log" v-else>
|
||||||
|
<li>暂无物流信息</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { getPackage } from "@/api/trade.js";
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
order: {},
|
||||||
|
logisticsList: [],
|
||||||
|
}
|
||||||
|
},
|
||||||
|
components: {
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
},
|
||||||
|
onLoad(option) {
|
||||||
|
let sn = option.order_sn;
|
||||||
|
this.tracesList(sn);
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
tracesList(sn) {
|
||||||
|
getPackage(sn).then((res) => {
|
||||||
|
if(res.data.success){
|
||||||
|
this.logisticsList = res.data.result;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<style >
|
||||||
|
page {
|
||||||
|
background: #fff;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
// @import url('./goods.scss');
|
||||||
|
.goods-item-view {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
padding: 10rpx 30rpx;
|
||||||
|
|
||||||
|
.goods-img {
|
||||||
|
flex: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.goods-info {
|
||||||
|
padding-left: 30rpx;
|
||||||
|
flex: 3;
|
||||||
|
|
||||||
|
.goods-title {
|
||||||
|
margin-bottom: 10rpx;
|
||||||
|
color: $font-color-dark;
|
||||||
|
}
|
||||||
|
|
||||||
|
.goods-specs {
|
||||||
|
font-size: 24rpx;
|
||||||
|
margin-bottom: 10rpx;
|
||||||
|
color: #cccccc;
|
||||||
|
}
|
||||||
|
|
||||||
|
.goods-price {
|
||||||
|
font-size: 28rpx;
|
||||||
|
margin-bottom: 10rpx;
|
||||||
|
color: #ff5a10;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.goods-num {
|
||||||
|
>.good-complaint {
|
||||||
|
margin-top: 10rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
text-align: center;
|
||||||
|
flex: 1;
|
||||||
|
width: 60rpx;
|
||||||
|
color: $main-color;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.goods-info {
|
||||||
|
flex: 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card-title {
|
||||||
|
background: #f2f2f2;
|
||||||
|
}
|
||||||
|
.logistics-detail {
|
||||||
|
margin-top: 20rpx;
|
||||||
|
padding: 0 16rpx;
|
||||||
|
}
|
||||||
|
.card {
|
||||||
|
background: #fff;
|
||||||
|
border-radius: 20rpx;
|
||||||
|
width: 100%;
|
||||||
|
> .card-title {
|
||||||
|
font-size: 24rpx;
|
||||||
|
border-top-left-radius: 20rpx;
|
||||||
|
border-top-right-radius: 20rpx;
|
||||||
|
padding: 16rpx;
|
||||||
|
}
|
||||||
|
> .time-line {
|
||||||
|
padding: 16rpx 32rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.u-order-title {
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
.u-order-desc {
|
||||||
|
font-size: 26rpx;
|
||||||
|
color: #666;
|
||||||
|
margin: 10rpx 0;
|
||||||
|
}
|
||||||
|
.u-order-time {
|
||||||
|
font-size: 24rpx;
|
||||||
|
color: #999;
|
||||||
|
}
|
||||||
|
.empty {
|
||||||
|
padding: 40rpx 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
.express-log {
|
||||||
|
/*margin: 5px -10px 5px 5px;*/
|
||||||
|
padding: 20rpx;
|
||||||
|
list-style-type: none;
|
||||||
|
li {
|
||||||
|
display: flex;
|
||||||
|
margin-top: 18rpx;
|
||||||
|
}
|
||||||
|
li:nth-of-type(1) {
|
||||||
|
margin-top: 0;
|
||||||
|
}
|
||||||
|
.time {
|
||||||
|
width: 140rpx;
|
||||||
|
display: flex;
|
||||||
|
// float: left;
|
||||||
|
flex-direction: column;
|
||||||
|
font-size: 24rpx;
|
||||||
|
line-height: 40rpx;
|
||||||
|
span:nth-of-type(1) {
|
||||||
|
margin-bottom: 16rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.detail {
|
||||||
|
width: 100%;
|
||||||
|
flex: 1;
|
||||||
|
margin-left: 30rpx;
|
||||||
|
display: inline-block;
|
||||||
|
font-size: 24rpx;
|
||||||
|
line-height: 40rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
li {
|
||||||
|
line-height: 60rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.layui-layer-wrap {
|
||||||
|
dl {
|
||||||
|
border-top: solid 1px #f5f5f5;
|
||||||
|
margin-top: -2rpx;
|
||||||
|
overflow: hidden;
|
||||||
|
|
||||||
|
dt {
|
||||||
|
font-size: 26rpx;
|
||||||
|
line-height: 40rpx;
|
||||||
|
display: inline-block;
|
||||||
|
padding: 16rpx 1% 16rpx 0;
|
||||||
|
color: #999;
|
||||||
|
}
|
||||||
|
|
||||||
|
dd {
|
||||||
|
font-size: 26rpx;
|
||||||
|
line-height: 40rpx;
|
||||||
|
display: inline-block;
|
||||||
|
padding: 16rpx 0 16rpx 16rpx;
|
||||||
|
border-left: solid 2rpx #f5f5f5;
|
||||||
|
|
||||||
|
.text-box {
|
||||||
|
line-height: 40rpx;
|
||||||
|
color: #333;
|
||||||
|
word-break: break-all;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.div-express-log {
|
||||||
|
// max-height: 600rpx;
|
||||||
|
border: solid 2rpx #e7e7e7;
|
||||||
|
background: #fafafa;
|
||||||
|
border-radius: 10rpx;
|
||||||
|
margin-bottom: 6rpx;
|
||||||
|
// overflow-y: auto;
|
||||||
|
// overflow-x: auto;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -3,7 +3,7 @@
|
|||||||
<view class="exaluate-member-view">
|
<view class="exaluate-member-view">
|
||||||
<view class="member-view">
|
<view class="member-view">
|
||||||
<view class="member-img">
|
<view class="member-img">
|
||||||
<u-image width="82rpx" style="border: 1px solid #ededed" height="82rpx" shape="circle" :src="comment.memberProfile || '/static/missing-face.png'"></u-image>
|
<u-image width="82rpx" style="border: 1px solid #ededed" height="82rpx" shape="circle" :src="comment.memberProfile || userImage"></u-image>
|
||||||
</view>
|
</view>
|
||||||
<view class="member-info">
|
<view class="member-info">
|
||||||
<view class="memName">{{ comment.memberName }}</view>
|
<view class="memName">{{ comment.memberName }}</view>
|
||||||
@@ -41,9 +41,13 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import configs from '@/config/config'
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
configs,
|
||||||
|
userImage:configs.defaultUserPhoto,
|
||||||
|
|
||||||
comment: {}, //评论信息
|
comment: {}, //评论信息
|
||||||
gradeList: {
|
gradeList: {
|
||||||
//评价grade
|
//评价grade
|
||||||
|
|||||||
@@ -115,7 +115,8 @@ export default {
|
|||||||
onShow() {
|
onShow() {
|
||||||
this.orderList = [];
|
this.orderList = [];
|
||||||
this.params.pageNumber = 1;
|
this.params.pageNumber = 1;
|
||||||
this.current == 0 ? this.loadData() : this.loadComments();
|
this.current = 0
|
||||||
|
this.loadData()
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
/**
|
/**
|
||||||
@@ -202,7 +203,7 @@ export default {
|
|||||||
title: "加载中",
|
title: "加载中",
|
||||||
});
|
});
|
||||||
getOrderList(this.params).then((res) => {
|
getOrderList(this.params).then((res) => {
|
||||||
uni.hideLoading();
|
if (this.$store.state.isShowToast){ uni.hideLoading() };
|
||||||
const orderList = res.data.result.records;
|
const orderList = res.data.result.records;
|
||||||
if (orderList.length < 10) {
|
if (orderList.length < 10) {
|
||||||
this.params.loadStatus = "noMore";
|
this.params.loadStatus = "noMore";
|
||||||
@@ -234,7 +235,7 @@ export default {
|
|||||||
title: "加载中",
|
title: "加载中",
|
||||||
});
|
});
|
||||||
getComments(this.params).then((res) => {
|
getComments(this.params).then((res) => {
|
||||||
uni.hideLoading();
|
if (this.$store.state.isShowToast){ uni.hideLoading() };
|
||||||
let orderList = res.data.result.records;
|
let orderList = res.data.result.records;
|
||||||
if (orderList.length < 10) {
|
if (orderList.length < 10) {
|
||||||
this.params.loadStatus = "noMore";
|
this.params.loadStatus = "noMore";
|
||||||
|
|||||||
@@ -137,7 +137,7 @@ export default {
|
|||||||
title: "加载中",
|
title: "加载中",
|
||||||
});
|
});
|
||||||
commentsMemberOrder(this.form).then((res) => {
|
commentsMemberOrder(this.form).then((res) => {
|
||||||
uni.hideLoading();
|
if (this.$store.state.isShowToast){ uni.hideLoading() };
|
||||||
if (res.data.success) {
|
if (res.data.success) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: "发布评价成功",
|
title: "发布评价成功",
|
||||||
|
|||||||
@@ -1,7 +1,11 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="wrapper">
|
<div class="wrapper">
|
||||||
<!-- 选择地址 -->
|
<!-- 选择地址 -->
|
||||||
<div class="address-box" @click="clickToAddress()">
|
<div
|
||||||
|
class="address-box"
|
||||||
|
@click="clickToAddress()"
|
||||||
|
v-if="shippingText == 'LOGISTICS' && orderMessage.cartTypeEnum != 'VIRTUAL'"
|
||||||
|
>
|
||||||
<div class="user-box flex">
|
<div class="user-box flex">
|
||||||
<div class="flex-8">
|
<div class="flex-8">
|
||||||
<div v-if="!address.id">请选择地址</div>
|
<div v-if="!address.id">请选择地址</div>
|
||||||
@@ -10,9 +14,16 @@
|
|||||||
<!-- 省市区 -->
|
<!-- 省市区 -->
|
||||||
<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
|
||||||
<span class="address-item" v-for="(item,index) in address.consigneeAddressPath" :key="index">
|
class="address-list"
|
||||||
{{item}}
|
v-if="address.consigneeAddressPath.length != 0"
|
||||||
|
>
|
||||||
|
<span
|
||||||
|
class="address-item"
|
||||||
|
v-for="(item, index) in address.consigneeAddressPath"
|
||||||
|
:key="index"
|
||||||
|
>
|
||||||
|
{{ item }}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -33,28 +44,74 @@
|
|||||||
<!-- 背景 -->
|
<!-- 背景 -->
|
||||||
<div class="bar"></div>
|
<div class="bar"></div>
|
||||||
</div>
|
</div>
|
||||||
|
<!-- 选择自提点 -->
|
||||||
|
<div class="address-box" v-if="shippingText == 'SELF_PICK_UP'">
|
||||||
|
<div @click="clickToStoreAddress()">
|
||||||
|
<div class="user-box flex">
|
||||||
|
<div class="flex-8">
|
||||||
|
<div v-if="storeAddress">
|
||||||
|
<div class="user-address">
|
||||||
|
<!-- 自提点地址 -->
|
||||||
|
<div class="user-address-detail wes-2">
|
||||||
|
{{ storeAddress.address }}
|
||||||
|
</div>
|
||||||
|
<!-- 联系手机号 -->
|
||||||
|
<div></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div v-else>请选择自提点</div>
|
||||||
|
</div>
|
||||||
|
<u-icon name="arrow-right" style="color: #bababa"></u-icon>
|
||||||
|
</div>
|
||||||
|
<!-- 背景 -->
|
||||||
|
<div class="bar"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<!-- 开团信息 -->
|
<!-- 开团信息 -->
|
||||||
<view class="group-box" v-if="isAssemble">
|
<view class="group-box" v-if="isAssemble">
|
||||||
<view class="group-title">
|
<view class="group-title">
|
||||||
<span v-if="pintuanFlage">你正在开团购买</span>
|
<span v-if="pintuanFlage">你正在开团购买</span>
|
||||||
<span v-else>为你加入仅差<span>{{routerVal.parentOrder.toBeGroupedNum }}</span>人的团购买</span>
|
<span v-else
|
||||||
|
>为你加入仅差<span>{{ routerVal.parentOrder.toBeGroupedNum }}</span
|
||||||
|
>人的团购买</span
|
||||||
|
>
|
||||||
</view>
|
</view>
|
||||||
<view class="group">
|
<view class="group">
|
||||||
<view>
|
<view>
|
||||||
<u-image borderRadius="50%" shape="square" class="head-img" width="81rpx" height="81rpx"
|
<u-image
|
||||||
:src="masterWay.face || '/static/missing-face.png'"></u-image>
|
borderRadius="50%"
|
||||||
|
shape="square"
|
||||||
|
class="head-img"
|
||||||
|
width="81rpx"
|
||||||
|
height="81rpx"
|
||||||
|
:src="masterWay.face || userImage"
|
||||||
|
></u-image>
|
||||||
<view class="btn-one">团长</view>
|
<view class="btn-one">团长</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="line"> </view>
|
<view class="line"> </view>
|
||||||
<view>
|
<view>
|
||||||
<!-- 如果有最后一名,显示最后一名,没有最后一名,显示等待参团 -->
|
<!-- 如果有最后一名,显示最后一名,没有最后一名,显示等待参团 -->
|
||||||
<u-image class="head-img" v-if="endWay.face" :src="endWay.face" borderRadius="50%" shape="square"
|
<u-image
|
||||||
width="81rpx" height="81rpx">
|
class="head-img"
|
||||||
|
v-if="endWay.face"
|
||||||
|
:src="endWay.face"
|
||||||
|
borderRadius="50%"
|
||||||
|
shape="square"
|
||||||
|
width="81rpx"
|
||||||
|
height="81rpx"
|
||||||
|
>
|
||||||
<view slot="loading"></view>
|
<view slot="loading"></view>
|
||||||
</u-image>
|
</u-image>
|
||||||
<u-image class="head-img" borderRadius="50%" shape="square" v-else width="81rpx" height="81rpx"
|
<u-image
|
||||||
:src="endWay.face || '/static/missing-face.png'"></u-image>
|
class="head-img"
|
||||||
|
borderRadius="50%"
|
||||||
|
shape="square"
|
||||||
|
v-else
|
||||||
|
width="81rpx"
|
||||||
|
height="81rpx"
|
||||||
|
:src="endWay.face || userImage"
|
||||||
|
></u-image>
|
||||||
|
|
||||||
<view class="wait">{{ endWay.nickname || "等待参团" }}</view>
|
<view class="wait">{{ endWay.nickname || "等待参团" }}</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -62,83 +119,187 @@
|
|||||||
</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 class="goods-image"
|
<span>{{ item.storeName }}</span>
|
||||||
@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 class="promotionNotice">{{ item.promotionNotice || "" }}</div>
|
||||||
|
<div
|
||||||
|
class="flex goods-item"
|
||||||
|
v-for="(val, i) in item.checkedSkuList"
|
||||||
|
:key="i"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
class="goods-image"
|
||||||
|
@click="
|
||||||
|
navigateTo(
|
||||||
|
'/pages/product/goods?id=' +
|
||||||
|
val.goodsSku.id +
|
||||||
|
'&goodsId=' +
|
||||||
|
val.goodsSku.goodsId
|
||||||
|
)
|
||||||
|
"
|
||||||
|
:span="3"
|
||||||
|
>
|
||||||
|
<u-image
|
||||||
|
borderRadius="10rpx"
|
||||||
|
width="200rpx"
|
||||||
|
height="200rpx"
|
||||||
|
:src="val.goodsSku.thumbnail"
|
||||||
|
alt
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
@click="
|
||||||
|
navigateTo(
|
||||||
|
'/pages/product/goods?id=' +
|
||||||
|
val.goodsSku.id +
|
||||||
|
'&goodsId=' +
|
||||||
|
val.goodsSku.goodsId
|
||||||
|
)
|
||||||
|
"
|
||||||
|
class="goods-detail"
|
||||||
|
>
|
||||||
|
<div 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>
|
||||||
<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>
|
||||||
|
|
||||||
<!-- 发票信息 -->
|
<!-- 发票信息 -->
|
||||||
<invoices :res="receiptList" @callbackInvoice="callbackInvoice" v-if="invoiceFlag" />
|
<invoices
|
||||||
<u-select v-model="shippingFlag" :list="shippingMethod"></u-select>
|
:res="receiptList"
|
||||||
|
@callbackInvoice="callbackInvoice"
|
||||||
|
v-if="invoiceFlag"
|
||||||
|
/>
|
||||||
|
<u-select
|
||||||
|
@confirm="confirmDistribution"
|
||||||
|
v-model="shippingFlag"
|
||||||
|
v-if="shippingMethod.length != 0"
|
||||||
|
:list="shippingMethod"
|
||||||
|
></u-select>
|
||||||
|
|
||||||
<div class="box box5" v-if="orderMessage.priceDetailDTO">
|
<div class="box box5" v-if="orderMessage.priceDetailDTO">
|
||||||
<div>
|
<div>
|
||||||
<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 v-if="shippingText == 'LOGISTICS'">
|
||||||
<u-col v-if="orderMessage.cartTypeEnum != 'VIRTUAL'" :span="7">运费</u-col>
|
<u-col v-if="orderMessage.cartTypeEnum != 'VIRTUAL'" :span="7"
|
||||||
<u-col v-if="orderMessage.cartTypeEnum != 'VIRTUAL'" :span="5" class="tr tipsColor" textAlign="right">
|
>运费</u-col
|
||||||
<span v-if="orderMessage.priceDetailDTO.freightPrice == 0">包邮</span>
|
>
|
||||||
<span v-else>¥{{
|
<u-col
|
||||||
|
v-if="orderMessage.cartTypeEnum != 'VIRTUAL'"
|
||||||
|
:span="5"
|
||||||
|
class="tr tipsColor"
|
||||||
|
textAlign="right"
|
||||||
|
>
|
||||||
|
<span v-if="orderMessage.priceDetailDTO.freightPrice == 0"
|
||||||
|
>包邮</span
|
||||||
|
>
|
||||||
|
<span v-else
|
||||||
|
>¥{{
|
||||||
orderMessage.priceDetailDTO.freightPrice | unitPrice
|
orderMessage.priceDetailDTO.freightPrice | unitPrice
|
||||||
}}</span>
|
}}</span
|
||||||
|
>
|
||||||
</u-col>
|
</u-col>
|
||||||
</u-row>
|
</u-row>
|
||||||
</div>
|
</div>
|
||||||
<u-row>
|
<u-row
|
||||||
|
v-if="
|
||||||
|
orderMessage.priceDetailDTO.goodsPrice != 0 &&
|
||||||
|
orderMessage.priceDetailDTO.goodsPrice != null
|
||||||
|
"
|
||||||
|
>
|
||||||
<u-col :offset="0" :span="9" @click="GET_Discount()">优惠券</u-col>
|
<u-col :offset="0" :span="9" @click="GET_Discount()">优惠券</u-col>
|
||||||
|
<u-col
|
||||||
<u-col :span="3" v-if="orderMessage.priceDetailDTO && orderMessage.priceDetailDTO.couponPrice" textAlign="right"
|
:span="3"
|
||||||
@click="GET_Discount()">
|
v-if="
|
||||||
<span class="main-color">-¥{{orderMessage.priceDetailDTO.couponPrice | unitPrice}}</span>
|
orderMessage.priceDetailDTO &&
|
||||||
|
orderMessage.priceDetailDTO.couponPrice
|
||||||
|
"
|
||||||
|
textAlign="right"
|
||||||
|
@click="GET_Discount()"
|
||||||
|
>
|
||||||
|
<span class="main-color"
|
||||||
|
>-¥{{ orderMessage.priceDetailDTO.couponPrice | unitPrice }}</span
|
||||||
|
>
|
||||||
</u-col>
|
</u-col>
|
||||||
<!-- orderMessage.priceDetailDTO.couponPrice | unitPrice -->
|
<!-- orderMessage.priceDetailDTO.couponPrice | unitPrice -->
|
||||||
<u-col :span="3" v-else textAlign="right" @click="GET_Discount()">
|
<u-col :span="3" v-else textAlign="right" @click="GET_Discount()">
|
||||||
@@ -149,8 +310,15 @@
|
|||||||
<div>
|
<div>
|
||||||
<u-row>
|
<u-row>
|
||||||
<u-col :span="9">优惠金额</u-col>
|
<u-col :span="9">优惠金额</u-col>
|
||||||
<u-col :span="3" textAlign="right" v-if=" orderMessage.priceDetailDTO.couponPrice">
|
<u-col
|
||||||
<span class="main-color"> -¥{{ orderMessage.priceDetailDTO.couponPrice | unitPrice }}</span></u-col>
|
:span="3"
|
||||||
|
textAlign="right"
|
||||||
|
v-if="orderMessage.priceDetailDTO.couponPrice"
|
||||||
|
>
|
||||||
|
<span class="main-color">
|
||||||
|
-¥{{ orderMessage.priceDetailDTO.couponPrice | unitPrice }}</span
|
||||||
|
>
|
||||||
|
</u-col>
|
||||||
<u-col :span="3" textAlign="right" v-else>0.00</u-col>
|
<u-col :span="3" textAlign="right" v-else>0.00</u-col>
|
||||||
</u-row>
|
</u-row>
|
||||||
</div>
|
</div>
|
||||||
@@ -158,18 +326,25 @@
|
|||||||
<u-row>
|
<u-row>
|
||||||
<u-col :span="6">活动优惠</u-col>
|
<u-col :span="6">活动优惠</u-col>
|
||||||
<u-col :span="6" class="tr tipsColor" textAlign="right">
|
<u-col :span="6" class="tr tipsColor" textAlign="right">
|
||||||
<span
|
<span v-if="orderMessage.priceDetailDTO.discountPrice"
|
||||||
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>
|
||||||
</u-row>
|
</u-row>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- 配送地区没有提示 -->
|
<!-- 配送地区没有提示 -->
|
||||||
<div class="notSupportFreight" v-if="notSupportFreight.length !=0">
|
<div class="notSupportFreight" v-if="notSupportFreight.length != 0">
|
||||||
<u-notice-bar style="width:100%" :volume-icon="false" mode="horizontal" :list="notSupportFreightGoodsList">
|
<u-notice-bar
|
||||||
|
style="width: 100%"
|
||||||
|
:volume-icon="false"
|
||||||
|
mode="horizontal"
|
||||||
|
:list="notSupportFreightGoodsList"
|
||||||
|
>
|
||||||
</u-notice-bar>
|
</u-notice-bar>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -179,11 +354,25 @@
|
|||||||
<div class="tabbar-left">
|
<div class="tabbar-left">
|
||||||
<div v-if="!orderMessage.priceDetailDTO.payPoint" class="number">
|
<div v-if="!orderMessage.priceDetailDTO.payPoint" class="number">
|
||||||
<span>¥</span>
|
<span>¥</span>
|
||||||
<span class="price">{{ formatPrice(orderMessage.priceDetailDTO.flowPrice)[0] }}</span>
|
<span class="price">{{
|
||||||
<span>.{{formatPrice(orderMessage.priceDetailDTO.flowPrice)[1] }} </span>
|
$options.filters.goodsFormatPrice(
|
||||||
|
orderMessage.priceDetailDTO.flowPrice
|
||||||
|
)[0]
|
||||||
|
}}</span>
|
||||||
|
<span
|
||||||
|
>.{{
|
||||||
|
$options.filters.goodsFormatPrice(
|
||||||
|
orderMessage.priceDetailDTO.flowPrice
|
||||||
|
)[1]
|
||||||
|
}}
|
||||||
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<span v-else class="number"><span
|
<span v-else class="number"
|
||||||
style="margin-right:10rpx;">{{orderMessage.priceDetailDTO.payPoint | unitPrice }}</span>积分</span>
|
><span style="margin-right: 10rpx">{{
|
||||||
|
orderMessage.priceDetailDTO.payPoint | unitPrice
|
||||||
|
}}</span
|
||||||
|
>积分</span
|
||||||
|
>
|
||||||
</div>
|
</div>
|
||||||
<div class="navRiv" @click="createTradeFun()">
|
<div class="navRiv" @click="createTradeFun()">
|
||||||
<!-- #ifndef MP-WEIXIN -->
|
<!-- #ifndef MP-WEIXIN -->
|
||||||
@@ -192,19 +381,18 @@
|
|||||||
<!-- #ifdef MP-WEIXIN -->
|
<!-- #ifdef MP-WEIXIN -->
|
||||||
<div class="tabbar-right">微信支付</div>
|
<div class="tabbar-right">微信支付</div>
|
||||||
<!-- #endif -->
|
<!-- #endif -->
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import * as API_Trade from "@/api/trade";
|
|
||||||
import * as API_Address from "@/api/address";
|
import * as API_Address from "@/api/address";
|
||||||
import * as API_Order from "@/api/order";
|
import * as API_Order from "@/api/order";
|
||||||
import invoices from "@/pages/order/invoice/setInvoice";
|
import * as API_Trade from "@/api/trade";
|
||||||
|
import configs from "@/config/config";
|
||||||
import LiLiWXPay from "@/js_sdk/lili-pay/wx-pay.js";
|
import LiLiWXPay from "@/js_sdk/lili-pay/wx-pay.js";
|
||||||
|
import invoices from "@/pages/order/invoice/setInvoice";
|
||||||
|
import { mapState } from "vuex";
|
||||||
export default {
|
export default {
|
||||||
onLoad: function (val) {
|
onLoad: function (val) {
|
||||||
this.routerVal = val;
|
this.routerVal = val;
|
||||||
@@ -213,20 +401,27 @@ export default {
|
|||||||
invoices,
|
invoices,
|
||||||
},
|
},
|
||||||
|
|
||||||
watch: {},
|
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
configs,
|
||||||
|
userImage: configs.defaultUserPhoto,
|
||||||
invoiceFlag: false, //开票开关
|
invoiceFlag: false, //开票开关
|
||||||
shippingText: "LOGISTICS",
|
shippingText: "LOGISTICS",
|
||||||
shippingFlag: false,
|
shippingFlag: false,
|
||||||
shippingMethod: [
|
shippingMethod: [],
|
||||||
|
shippingWay: [
|
||||||
{
|
{
|
||||||
value: "LOGISTICS",
|
value: "LOGISTICS",
|
||||||
label: "物流",
|
label: "物流",
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
value: "SELF_PICK_UP",
|
||||||
|
label: "自提",
|
||||||
|
},
|
||||||
],
|
],
|
||||||
isAssemble: false, //是否拼团
|
isAssemble: false, //是否拼团
|
||||||
couponNums: "", //结算页面优惠券数量
|
// 判断是否填写过备注
|
||||||
|
remarkFlag: false,
|
||||||
selectAddressId: "",
|
selectAddressId: "",
|
||||||
routerVal: "",
|
routerVal: "",
|
||||||
params: {},
|
params: {},
|
||||||
@@ -234,6 +429,7 @@ export default {
|
|||||||
couponList: "",
|
couponList: "",
|
||||||
// 已选地址
|
// 已选地址
|
||||||
address: "",
|
address: "",
|
||||||
|
shopAddress: "",
|
||||||
// 发票信息
|
// 发票信息
|
||||||
receiptList: "",
|
receiptList: "",
|
||||||
// 店铺信息
|
// 店铺信息
|
||||||
@@ -241,14 +437,31 @@ export default {
|
|||||||
data: "",
|
data: "",
|
||||||
// 存储备注
|
// 存储备注
|
||||||
remarkVal: [],
|
remarkVal: [],
|
||||||
|
remarkVal1: "",
|
||||||
detail: "", //返回的所有数据
|
detail: "", //返回的所有数据
|
||||||
endWay: "", //最后一个参团人
|
endWay: "", //最后一个参团人
|
||||||
masterWay: "", //团长信息
|
masterWay: "", //团长信息
|
||||||
pintuanFlage: true, //是开团还是拼团
|
pintuanFlage: true, //是开团还是拼团
|
||||||
notSupportFreight: [], //不支持运费
|
notSupportFreight: [], //不支持运费
|
||||||
notSupportFreightGoodsList: ["以下商品超出配送范围:"],
|
notSupportFreightGoodsList: ["以下商品超出配送范围:"],
|
||||||
|
storeAddress: "",
|
||||||
|
|
||||||
|
originOrderData:"", // 原始订单数据
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
watch: {
|
||||||
|
// 监听备注 并在 vuex 中存储
|
||||||
|
remarkVal: {
|
||||||
|
handler(val) {
|
||||||
|
this.$store.commit("setRemark", val);
|
||||||
|
},
|
||||||
|
immediate: true,
|
||||||
|
deep: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
...mapState(["remark"]),
|
||||||
|
},
|
||||||
filters: {
|
filters: {
|
||||||
/**
|
/**
|
||||||
* 发票收据类型
|
* 发票收据类型
|
||||||
@@ -271,6 +484,7 @@ export default {
|
|||||||
* 监听返回
|
* 监听返回
|
||||||
*/
|
*/
|
||||||
onBackPress(e) {
|
onBackPress(e) {
|
||||||
|
console.log("onBackPress", e);
|
||||||
if (e.from == "backbutton") {
|
if (e.from == "backbutton") {
|
||||||
let routes = getCurrentPages();
|
let routes = getCurrentPages();
|
||||||
let curRoute = routes[routes.length - 1].options;
|
let curRoute = routes[routes.length - 1].options;
|
||||||
@@ -279,12 +493,12 @@ 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,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
console.log("curRoute.addId",curRoute.addId)
|
||||||
if (curRoute.addId) {
|
if (curRoute.addId) {
|
||||||
uni.reLaunch({
|
uni.reLaunch({
|
||||||
url: "/pages/tabbar/cart/cartList",
|
url: "/pages/tabbar/cart/cartList",
|
||||||
@@ -296,12 +510,19 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
onShow() {
|
async onShow() {
|
||||||
|
// 判断是否存在写过备注信息的商品
|
||||||
|
if (this.remark && this.remark.length > 0) {
|
||||||
|
this.remarkFlag = true;
|
||||||
|
}
|
||||||
uni.showLoading({
|
uni.showLoading({
|
||||||
mask: true,
|
mask: true,
|
||||||
});
|
});
|
||||||
this.getOrderList();
|
await this.getOrderList();
|
||||||
uni.hideLoading();
|
await this.getDistribution();
|
||||||
|
if (this.$store.state.isShowToast) {
|
||||||
|
uni.hideLoading();
|
||||||
|
}
|
||||||
if (this.routerVal.way == "PINTUAN") {
|
if (this.routerVal.way == "PINTUAN") {
|
||||||
this.isAssemble = true;
|
this.isAssemble = true;
|
||||||
this.routerVal.parentOrder = JSON.parse(
|
this.routerVal.parentOrder = JSON.parse(
|
||||||
@@ -313,13 +534,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;
|
||||||
@@ -353,6 +567,11 @@ export default {
|
|||||||
)}`
|
)}`
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
clickToStoreAddress() {
|
||||||
|
this.navigateTo(
|
||||||
|
`/pages/mine/address/storeAddress?from=cart&way=${this.routerVal.way}&storeId=${this.remarkVal[0].storeId}`
|
||||||
|
);
|
||||||
|
},
|
||||||
|
|
||||||
// 判断团长以及团员信息
|
// 判断团长以及团员信息
|
||||||
pintuanWay() {
|
pintuanWay() {
|
||||||
@@ -378,6 +597,20 @@ export default {
|
|||||||
// 循环店铺id,商品id获取优惠券
|
// 循环店铺id,商品id获取优惠券
|
||||||
let store = [];
|
let store = [];
|
||||||
let skus = [];
|
let skus = [];
|
||||||
|
let selectedCoupon = [];
|
||||||
|
if (this.orderMessage.platformCoupon)
|
||||||
|
selectedCoupon.push(this.orderMessage.platformCoupon.memberCoupon.id);
|
||||||
|
if (
|
||||||
|
this.orderMessage.storeCoupons &&
|
||||||
|
Object.keys(this.orderMessage.storeCoupons)[0]
|
||||||
|
) {
|
||||||
|
let storeMemberCouponsId = Object.keys(
|
||||||
|
this.orderMessage.storeCoupons
|
||||||
|
)[0];
|
||||||
|
let storeCouponId =
|
||||||
|
this.orderMessage.storeCoupons[storeMemberCouponsId].memberCoupon.id;
|
||||||
|
selectedCoupon.push(storeCouponId);
|
||||||
|
}
|
||||||
this.orderMessage.cartList.forEach((item) => {
|
this.orderMessage.cartList.forEach((item) => {
|
||||||
item.skuList.forEach((sku) => {
|
item.skuList.forEach((sku) => {
|
||||||
store.push(sku.storeId);
|
store.push(sku.storeId);
|
||||||
@@ -391,7 +624,7 @@ export default {
|
|||||||
data: this.orderMessage.priceDetailDTO.goodsPrice,
|
data: this.orderMessage.priceDetailDTO.goodsPrice,
|
||||||
});
|
});
|
||||||
this.navigateTo(
|
this.navigateTo(
|
||||||
`/pages/cart/coupon/index?way=${this.routerVal.way}&storeId=${store}&skuId=${skus}`
|
`/pages/cart/coupon/index?way=${this.routerVal.way}&storeId=${store}&skuId=${skus}&selectedCoupon=${selectedCoupon}`
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -412,14 +645,26 @@ export default {
|
|||||||
createTradeFun() {
|
createTradeFun() {
|
||||||
// 防抖
|
// 防抖
|
||||||
this.$u.throttle(() => {
|
this.$u.throttle(() => {
|
||||||
if (!this.address.id) {
|
if (this.shippingText === "SELF_PICK_UP") {
|
||||||
uni.showToast({
|
if (!this.storeAddress.id) {
|
||||||
title: "请选择地址",
|
uni.showToast({
|
||||||
duration: 2000,
|
title: "请选择提货点",
|
||||||
icon: "none",
|
duration: 2000,
|
||||||
});
|
icon: "none",
|
||||||
return false;
|
});
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
} else if (this.shippingText === "LOGISTICS" && this.orderMessage.cartTypeEnum !== 'VIRTUAL') {
|
||||||
|
if (!this.address.id) {
|
||||||
|
uni.showToast({
|
||||||
|
title: "请选择地址",
|
||||||
|
duration: 2000,
|
||||||
|
icon: "none",
|
||||||
|
});
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 创建订单
|
// 创建订单
|
||||||
let client;
|
let client;
|
||||||
// #ifdef H5
|
// #ifdef H5
|
||||||
@@ -455,7 +700,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 {
|
||||||
@@ -504,18 +749,85 @@ export default {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
// 获取配送列表
|
||||||
|
async getDistribution() {
|
||||||
|
let shopRes = await API_Trade.shippingMethodList({
|
||||||
|
way: this.routerVal.way,
|
||||||
|
});
|
||||||
|
let shopList;
|
||||||
|
if (shopRes.data.success) {
|
||||||
|
shopList = shopRes.data.result;
|
||||||
|
let way = [];
|
||||||
|
console.log(shopList);
|
||||||
|
this.shippingWay.forEach((item) => {
|
||||||
|
shopList.forEach((child) => {
|
||||||
|
if (item.value == child) {
|
||||||
|
way.push(item);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
this.shippingMethod = way;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
// 选择配送
|
||||||
|
async confirmDistribution(val) {
|
||||||
|
let res = await API_Trade.setShipMethod({
|
||||||
|
shippingMethod: val[0].value,
|
||||||
|
way: this.routerVal.way,
|
||||||
|
});
|
||||||
|
|
||||||
|
this.shippingText = val[0].value;
|
||||||
|
if (res.data.success) {
|
||||||
|
this.getOrderList();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
// 获取结算参数
|
// 获取结算参数
|
||||||
getOrderList() {
|
async getOrderList() {
|
||||||
this.notSupportFreight = []
|
this.notSupportFreight = [];
|
||||||
// 获取结算参数
|
// 获取结算参数
|
||||||
API_Trade.getCheckoutParams(this.routerVal.way).then((res) => {
|
API_Trade.getCheckoutParams(this.routerVal.way).then((res) => {
|
||||||
|
// 获取结算参数 进行首次判断
|
||||||
|
this.originOrderData = this.orderMessage ? JSON.parse(JSON.stringify(this.orderMessage)) : ""
|
||||||
|
|
||||||
|
if (
|
||||||
|
!res.data.result.checkedSkuList ||
|
||||||
|
res.data.result.checkedSkuList.length === 0
|
||||||
|
) {
|
||||||
|
|
||||||
|
if(!this.originOrderData.checkedSkuList.length){
|
||||||
|
uni.switchTab({
|
||||||
|
url: "/pages/tabbar/cart/cartList",
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
if (res.data.result.skuList.length <= 0) {
|
||||||
|
|
||||||
|
if(!this.originOrderData.skuList.length){
|
||||||
|
uni.navigateTo({
|
||||||
|
url: "/pages/order/myOrder?status=0",
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
let repeatData;
|
||||||
res.data.result.cartList.forEach((item, index) => {
|
res.data.result.cartList.forEach((item, index) => {
|
||||||
this.remarkVal[index] = {
|
// 如果已经写过备注信息的话赋值
|
||||||
remark: item.remark,
|
repeatData = {
|
||||||
|
remark: this.remarkFlag
|
||||||
|
? this.remark[index].storeId == item.storeId
|
||||||
|
? this.remark[index].remark
|
||||||
|
: item.remark
|
||||||
|
: item.remark,
|
||||||
storeId: item.storeId,
|
storeId: item.storeId,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
this.$set(this.remarkVal, index, repeatData);
|
||||||
});
|
});
|
||||||
|
|
||||||
this.orderMessage = res.data.result;
|
this.orderMessage = res.data.result;
|
||||||
/**
|
/**
|
||||||
* 为了避免路径传值在h5中超出限制问题
|
* 为了避免路径传值在h5中超出限制问题
|
||||||
@@ -524,7 +836,7 @@ export default {
|
|||||||
this.$store.state.canUseCoupons = res.data.result.canUseCoupons;
|
this.$store.state.canUseCoupons = res.data.result.canUseCoupons;
|
||||||
this.$store.state.cantUseCoupons = res.data.result.cantUseCoupons;
|
this.$store.state.cantUseCoupons = res.data.result.cantUseCoupons;
|
||||||
|
|
||||||
if (!res.data.result.memberAddress.id) {
|
if (!res.data.result.memberAddress) {
|
||||||
// 获取会员默认地址
|
// 获取会员默认地址
|
||||||
this.getUserAddress();
|
this.getUserAddress();
|
||||||
} else {
|
} else {
|
||||||
@@ -532,7 +844,10 @@ export default {
|
|||||||
res.data.result.memberAddress.consigneeAddressPath =
|
res.data.result.memberAddress.consigneeAddressPath =
|
||||||
res.data.result.memberAddress.consigneeAddressPath.split(",");
|
res.data.result.memberAddress.consigneeAddressPath.split(",");
|
||||||
}
|
}
|
||||||
|
if (res.data.result.storeAddress) {
|
||||||
|
this.storeAddress = res.data.result.storeAddress;
|
||||||
|
console.log("storeAddress", this.storeAddress);
|
||||||
|
}
|
||||||
if (
|
if (
|
||||||
res.data.result.notSupportFreight &&
|
res.data.result.notSupportFreight &&
|
||||||
res.data.result.notSupportFreight.length != 0
|
res.data.result.notSupportFreight.length != 0
|
||||||
@@ -552,7 +867,7 @@ export default {
|
|||||||
</script>
|
</script>
|
||||||
<style scoped>
|
<style scoped>
|
||||||
page {
|
page {
|
||||||
background: #ededed !important;
|
background: #f7f7f7;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
@@ -561,24 +876,29 @@ page {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.main-color {
|
.main-color {
|
||||||
|
color: $main-color;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
|
|
||||||
.uinput {
|
.uinput {
|
||||||
/deep/ input {
|
::v-deep input {
|
||||||
text-align: right;
|
text-align: right;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.promotionNotice {
|
.promotionNotice {
|
||||||
font-size: 24rpx;
|
font-size: 24rpx;
|
||||||
margin: 20rpx 0;
|
margin: 20rpx 0;
|
||||||
color: $aider-light-color;
|
color: $aider-light-color;
|
||||||
}
|
}
|
||||||
|
|
||||||
.nums {
|
.nums {
|
||||||
flex: 2;
|
flex: 2;
|
||||||
color: $light-color;
|
color: $light-color;
|
||||||
|
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.wait {
|
.wait {
|
||||||
font-size: 22rpx;
|
font-size: 22rpx;
|
||||||
font-family: PingFang SC, PingFang SC-Regular;
|
font-family: PingFang SC, PingFang SC-Regular;
|
||||||
@@ -594,6 +914,7 @@ page {
|
|||||||
width: 143rpx;
|
width: 143rpx;
|
||||||
border-bottom: 2px dotted #999;
|
border-bottom: 2px dotted #999;
|
||||||
}
|
}
|
||||||
|
|
||||||
.tabbar-left {
|
.tabbar-left {
|
||||||
margin-left: 32rpx;
|
margin-left: 32rpx;
|
||||||
}
|
}
|
||||||
@@ -646,6 +967,7 @@ page {
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.tr {
|
.tr {
|
||||||
text-align: right;
|
text-align: right;
|
||||||
}
|
}
|
||||||
@@ -654,7 +976,7 @@ page {
|
|||||||
text-align: left;
|
text-align: left;
|
||||||
}
|
}
|
||||||
|
|
||||||
/deep/ .u-col-3 {
|
::v-deep .u-col-3 {
|
||||||
text-align: right;
|
text-align: right;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -668,6 +990,7 @@ page {
|
|||||||
.box2 {
|
.box2 {
|
||||||
margin-top: 20rpx;
|
margin-top: 20rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.notSupportFreight {
|
.notSupportFreight {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
|
|
||||||
@@ -687,7 +1010,8 @@ page {
|
|||||||
margin: 0 32rpx;
|
margin: 0 32rpx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/deep/ .u-notice-bar-wrap {
|
|
||||||
|
::v-deep .u-notice-bar-wrap {
|
||||||
width: 100% !important;
|
width: 100% !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -764,6 +1088,7 @@ page {
|
|||||||
color: $main-color;
|
color: $main-color;
|
||||||
font-size: 26rpx;
|
font-size: 26rpx;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
|
|
||||||
> span {
|
> span {
|
||||||
font-size: 36rpx;
|
font-size: 36rpx;
|
||||||
}
|
}
|
||||||
@@ -774,6 +1099,7 @@ page {
|
|||||||
color: $main-color;
|
color: $main-color;
|
||||||
font-size: 28rpx;
|
font-size: 28rpx;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
|
|
||||||
> .goods-price {
|
> .goods-price {
|
||||||
font-size: 38rpx;
|
font-size: 38rpx;
|
||||||
padding: 0 2rpx;
|
padding: 0 2rpx;
|
||||||
@@ -802,11 +1128,11 @@ page {
|
|||||||
color: #333333;
|
color: #333333;
|
||||||
}
|
}
|
||||||
|
|
||||||
/deep/ .u-col {
|
::v-deep .u-col {
|
||||||
padding: 36rpx 0 !important;
|
padding: 36rpx 0 !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
/deep/ .u-col-3,
|
::v-deep .u-col-3,
|
||||||
.tipsColor {
|
.tipsColor {
|
||||||
color: #333;
|
color: #333;
|
||||||
}
|
}
|
||||||
@@ -815,14 +1141,16 @@ page {
|
|||||||
text-align: left;
|
text-align: left;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
.default {
|
.default {
|
||||||
background: $main-color;
|
background: $main-color;
|
||||||
font-size: 24rpx;
|
font-size: 24rpx;
|
||||||
border-radius: 8rpx;
|
border-radius: 8rpx;
|
||||||
padding: 0rpx 12rpx;
|
padding: 0rpx 12rpx;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
margin-right: 20rpx;
|
margin-right: 20rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.address-box {
|
.address-box {
|
||||||
border-radius: 40rpx;
|
border-radius: 40rpx;
|
||||||
border-top-left-radius: 0 !important;
|
border-top-left-radius: 0 !important;
|
||||||
@@ -837,9 +1165,11 @@ page {
|
|||||||
font-weight: normal;
|
font-weight: normal;
|
||||||
letter-spacing: 1rpx;
|
letter-spacing: 1rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.user-box {
|
.user-box {
|
||||||
padding: 32rpx;
|
padding: 32rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.user-address-detail {
|
.user-address-detail {
|
||||||
color: #333;
|
color: #333;
|
||||||
font-size: 38rpx;
|
font-size: 38rpx;
|
||||||
@@ -847,13 +1177,16 @@ page {
|
|||||||
margin: 20rpx 0;
|
margin: 20rpx 0;
|
||||||
letter-spacing: 1rpx;
|
letter-spacing: 1rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mobile {
|
.mobile {
|
||||||
margin-left: 20rpx;
|
margin-left: 20rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.price {
|
.price {
|
||||||
font-size: 50rpx !important;
|
font-size: 50rpx !important;
|
||||||
margin: 0 2rpx;
|
margin: 0 2rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.goods-detail {
|
.goods-detail {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
@@ -861,12 +1194,14 @@ page {
|
|||||||
justify-content: center;
|
justify-content: center;
|
||||||
flex: 8;
|
flex: 8;
|
||||||
margin-left: 20rpx !important;
|
margin-left: 20rpx !important;
|
||||||
|
|
||||||
> p {
|
> p {
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.goods-item {
|
.goods-item {
|
||||||
margin: 20rpx 0;
|
margin: 20rpx 0;
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -9,28 +9,28 @@
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
<!-- 物流信息 -->
|
<!-- 物流信息 -->
|
||||||
<view class="info-view logi-view">
|
<view class="info-view logistics-view">
|
||||||
<view class="logi-List" v-if="logiList && logiList.traces.length != 0">
|
|
||||||
<view class="logi-List-title">
|
|
||||||
{{logiList.traces[logiList.traces.length-1].AcceptStation}}
|
|
||||||
</view>
|
|
||||||
<view class="logi-List-time">
|
|
||||||
{{logiList.traces[logiList.traces.length-1].AcceptTime}}
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
|
|
||||||
<view class="logi-List" v-else>
|
<view class="logistics-List">
|
||||||
<view class="verificationCode" v-if="order.verificationCode ">
|
<view class="verificationCode" v-if="order.verificationCode">
|
||||||
券码: {{order.verificationCode}}
|
券码: {{ order.orderStatus == 'CANCELLED' ? '已失效' : order.verificationCode }}
|
||||||
</view>
|
</view>
|
||||||
<view v-else class="logi-List-title">
|
<view @click="handleClickDeliver()" class="info-view logi-view" v-else-if="orderPackage && orderPackage.length">
|
||||||
{{'暂无物流信息'}}
|
<view class="verificationCode">
|
||||||
|
当前订单有 {{ orderPackage.length }} 个包裹快递
|
||||||
|
</view>
|
||||||
|
<div>
|
||||||
|
点击此处查看
|
||||||
|
</div>
|
||||||
|
</view>
|
||||||
|
<view v-else class="logistics-List-title">
|
||||||
|
{{ '暂无物流信息' }}
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
<!-- 地址 -->
|
<!-- 地址 -->
|
||||||
<view class="info-view">
|
<view class="info-view" v-if="order.deliveryMethod === 'LOGISTICS' && order.orderType !== 'VIRTUAL'">
|
||||||
<view class="address-view">
|
<view class="address-view">
|
||||||
<view>
|
<view>
|
||||||
<view class="address-title">
|
<view class="address-title">
|
||||||
@@ -42,14 +42,33 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
<!-- 提货地址 -->
|
||||||
|
<view class="info-view" v-if="order.deliveryMethod === 'SELF_PICK_UP'">
|
||||||
|
<view class="address-view">
|
||||||
|
<view>
|
||||||
|
<view class="order-info-view">
|
||||||
|
<view class="title">自提点地址:</view>
|
||||||
|
<view class="value address-line-height">{{ order.storeAddressPath }}</view>
|
||||||
|
</view>
|
||||||
|
<view class="order-info-view" @click="callPhone" >
|
||||||
|
<view class="title">联系方式:</view>
|
||||||
|
<view class="value">{{ order.storeAddressMobile }}<u-icon name='phone-fill' ></u-icon></view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
<!-- 商品信息 -->
|
<!-- 商品信息 -->
|
||||||
<view>
|
<view>
|
||||||
<view class="seller-view">
|
<view class="seller-view">
|
||||||
<!-- 店铺名称 -->
|
<!-- 店铺名称 -->
|
||||||
<view class="seller-info u-flex u-row-between">
|
<view class="seller-info u-flex u-row-between">
|
||||||
<view class="seller-name" @click="tostore(order)">
|
<view class="seller-name" @click="goToShopPage(order)">
|
||||||
<view class="name">{{ order.storeName }}</view>
|
<view class="name">{{ order.storeName }}</view>
|
||||||
<view class="status" v-if="orderStatusList[order.orderStatus]"> {{ orderStatusList[order.orderStatus].title }}</view>
|
<view class="status" v-if="orderStatusList[order.orderStatus]"> {{ orderStatusList[order.orderStatus].title
|
||||||
|
}}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="order-sn"></view>
|
<view class="order-sn"></view>
|
||||||
</view>
|
</view>
|
||||||
@@ -64,13 +83,17 @@
|
|||||||
<view class="goods-price">
|
<view class="goods-price">
|
||||||
¥{{ sku.goodsPrice | unitPrice }}
|
¥{{ sku.goodsPrice | unitPrice }}
|
||||||
<!-- <span v-if="sku.point">+{{ sku.point }}积分</span> -->
|
<!-- <span v-if="sku.point">+{{ sku.point }}积分</span> -->
|
||||||
|
<span style="font-size: 24rpx;margin-left: 14rpx;color: #ff9900;" v-if="sku.isRefund && sku.isRefund !== 'NO_REFUND'">
|
||||||
|
{{refundPriceList(sku.isRefund)}} ({{ sku.refundPrice | unitPrice("¥") }})
|
||||||
|
</span>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="goods-num">
|
<view class="goods-num">
|
||||||
<view>x{{ sku.num }}</view>
|
<view>x{{ sku.num }}</view>
|
||||||
|
|
||||||
<view class="good-complaint">
|
<view class="good-complaint">
|
||||||
<u-tag size="mini" mode="plain" @click="complaint(sku)" v-if="sku.complainStatus == 'NO_APPLY'" text="投诉" type="info" />
|
<u-tag size="mini" mode="plain" @click="complaint(sku)" v-if="sku.complainStatus == 'NO_APPLY'"
|
||||||
|
text="投诉" type="info" />
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -85,17 +108,17 @@
|
|||||||
<view class="title">商品总价:</view>
|
<view class="title">商品总价:</view>
|
||||||
<view class="value">¥{{ order.goodsPrice | unitPrice }}</view>
|
<view class="value">¥{{ order.goodsPrice | unitPrice }}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="order-info-view">
|
<view class="order-info-view" v-if="order.freightPrice">
|
||||||
<view class="title">运费:</view>
|
<view class="title">运费:</view>
|
||||||
<view class="value">¥{{ order.freightPrice | unitPrice }}</view>
|
<view class="value">¥{{ order.freightPrice | unitPrice }}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="order-info-view">
|
<view class="order-info-view" v-if="order.priceDetailDTO">
|
||||||
<view class="title">优惠券:</view>
|
<view class="title">优惠券:</view>
|
||||||
<view class="value">¥{{ order.couponPrice | unitPrice }}</view>
|
<view class="value main-color">-¥{{ order.priceDetailDTO.couponPrice | unitPrice }}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="order-info-view">
|
<view class="order-info-view">
|
||||||
<view class="title">活动优惠:</view>
|
<view class="title">活动优惠:</view>
|
||||||
<view class="value">¥{{ order.discountPrice | unitPrice }}</view>
|
<view class="value main-color">-¥{{ order.discountPrice | unitPrice }}</view>
|
||||||
</view>
|
</view>
|
||||||
<!-- <view class="order-info-view" v-if="order.use_point">
|
<!-- <view class="order-info-view" v-if="order.use_point">
|
||||||
<view class="title">使用积分:</view>
|
<view class="title">使用积分:</view>
|
||||||
@@ -104,16 +127,20 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<!-- 客户服务, 售后,取消订单,查看物流,投诉等 -->
|
<!-- 客户服务, 售后,取消订单,查看物流,投诉等 -->
|
||||||
<view class="info-view"
|
<view class="info-view">
|
||||||
v-if="orderDetail.allowOperationVO && orderDetail.allowOperationVO.cancel == true || order.orderStatus == 'DELIVERED' || order.orderStatus != 'UNPAID' && order.orderPromotionType =='PINTUAN'">
|
|
||||||
<view style="width: 100%">
|
<view style="width: 100%">
|
||||||
<view class="order-info-view">
|
<view class="order-info-view">
|
||||||
<view class="title">服务</view>
|
<view class="title">服务</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="customer-list">
|
<view class="customer-list">
|
||||||
<view class="customer-service" v-if="orderDetail.allowOperationVO && orderDetail.allowOperationVO.cancel == true" @click="onCancel(order.sn)">取消订单</view>
|
<view class="customer-service"
|
||||||
|
v-if="orderDetail.allowOperationVO && orderDetail.allowOperationVO.cancel == true"
|
||||||
|
@click="onCancel(order.sn)">取消订单</view>
|
||||||
<view class="customer-service" v-if="order.orderStatus == 'DELIVERED'" @click="onLogistics(order)">查看物流</view>
|
<view class="customer-service" v-if="order.orderStatus == 'DELIVERED'" @click="onLogistics(order)">查看物流</view>
|
||||||
<view class="customer-service" v-if="order.orderStatus != 'UNPAID' && order.orderPromotionType =='PINTUAN' " @click="ByUserMessage(order)">查看拼团信息</view>
|
<view class="customer-service" v-if="order.orderStatus != 'UNPAID' && order.orderPromotionType == 'PINTUAN'"
|
||||||
|
@click="ByUserMessage(order)">查看拼团信息</view>
|
||||||
|
<view class="customer-service"
|
||||||
|
@click="contact(order.storeId)">联系客服</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -129,23 +156,29 @@
|
|||||||
<view class="order-info-view">
|
<view class="order-info-view">
|
||||||
<view class="title">下单时间:</view>
|
<view class="title">下单时间:</view>
|
||||||
<view class="value">{{
|
<view class="value">{{
|
||||||
order.createTime
|
order.createTime
|
||||||
|
}}</view>
|
||||||
|
</view>
|
||||||
|
<view class="order-info-view">
|
||||||
|
<view class="title">订单备注:</view>
|
||||||
|
<view class="value">{{
|
||||||
|
order.remark || '暂无备注'
|
||||||
}}</view>
|
}}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="order-info-view">
|
<view class="order-info-view">
|
||||||
<view class="title">支付状态:</view>
|
<view class="title">支付状态:</view>
|
||||||
<view class="value">
|
<view class="value">
|
||||||
{{
|
{{
|
||||||
order.payStatus == "UNPAID"
|
order.payStatus == "UNPAID"
|
||||||
? "未付款"
|
? "未付款"
|
||||||
: order.payStatus == "PAID"
|
: order.payStatus == "PAID"
|
||||||
? "已付款"
|
? "已付款"
|
||||||
: ""
|
: ""
|
||||||
}}</view>
|
}}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="order-info-view">
|
<view class="order-info-view">
|
||||||
<view class="title">支付方式:</view>
|
<view class="title">支付方式:</view>
|
||||||
<view class="value">{{ orderDetail.paymentMethodValue }}</view>
|
<view class="value">{{ orderDetail.paymentMethodValue || '暂无'}}</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -153,7 +186,7 @@
|
|||||||
<view class="info-view" v-if="order.payStatus == 'PAID'">
|
<view class="info-view" v-if="order.payStatus == 'PAID'">
|
||||||
<view>
|
<view>
|
||||||
<view class="invoice-info-view">
|
<view class="invoice-info-view">
|
||||||
<view class="ltitle">发票信息:</view>
|
<view class="invoice-title">发票信息:</view>
|
||||||
<view v-if="!order.needReceipt" class="value">无需发票</view>
|
<view v-if="!order.needReceipt" class="value">无需发票</view>
|
||||||
<view v-else class="value" @click="onReceipt(orderDetail.receipt)">查看发票</view>
|
<view v-else class="value" @click="onReceipt(orderDetail.receipt)">查看发票</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -175,13 +208,16 @@
|
|||||||
<view>
|
<view>
|
||||||
<!-- 全部 -->
|
<!-- 全部 -->
|
||||||
<!-- 等待付款 -->
|
<!-- 等待付款 -->
|
||||||
<u-button type="error" ripple size="mini" v-if=" order.allowOperationVO && order.allowOperationVO.pay" @click="toPay(order)">立即付款</u-button>
|
<u-button type="error" ripple size="mini" v-if="orderDetail.allowOperationVO && orderDetail.allowOperationVO.pay"
|
||||||
|
@click="toPay(order)">立即付款</u-button>
|
||||||
|
|
||||||
<!-- <u-button class="rebuy-btn" size="mini" v-if="order.order_operate_allowable_vo.allow_service_cancel"> 提醒发货</u-button> -->
|
<!-- <u-button class="rebuy-btn" size="mini" v-if="order.order_operate_allowable_vo.allow_service_cancel"> 提醒发货</u-button> -->
|
||||||
<!-- <div class="pay-btn">确认收货</div> -->
|
<!-- <div class="pay-btn">确认收货</div> -->
|
||||||
<u-button shape="circle" ripple type="warning" size="mini" v-if="order.orderStatus == 'DELIVERED'" @click="onRog(order.sn)">确认收货</u-button>
|
<u-button shape="circle" ripple type="warning" size="mini" v-if="order.orderStatus == 'DELIVERED'"
|
||||||
|
@click="onRog(order.sn)">确认收货</u-button>
|
||||||
<!-- 交易完成 未评价 -->
|
<!-- 交易完成 未评价 -->
|
||||||
<u-button shape="circle" ripple size="mini" v-if="order.orderStatus == 'COMPLETE'" @click="onComment(order.sn)">评价商品</u-button>
|
<u-button shape="circle" ripple size="mini" v-if="order.orderStatus == 'COMPLETE'"
|
||||||
|
@click="onComment(order.sn)">评价商品</u-button>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -193,7 +229,8 @@
|
|||||||
<u-radio-group v-model="reason">
|
<u-radio-group v-model="reason">
|
||||||
<view class="value">
|
<view class="value">
|
||||||
<view class="radio-view" v-for="(item, index) in cancelList" :key="index">
|
<view class="radio-view" v-for="(item, index) in cancelList" :key="index">
|
||||||
<u-radio :active-color="lightColor" label-size="25" shape="circle" :name="item.reason" @change="reasonChange">{{ item.reason }}</u-radio>
|
<u-radio :active-color="lightColor" label-size="25" shape="circle" :name="item.reason"
|
||||||
|
@change="reasonChange">{{ item.reason }}</u-radio>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</u-radio-group>
|
</u-radio-group>
|
||||||
@@ -204,19 +241,20 @@
|
|||||||
</view>
|
</view>
|
||||||
</u-popup>
|
</u-popup>
|
||||||
<u-toast ref="uToast" />
|
<u-toast ref="uToast" />
|
||||||
<u-modal v-model="rogShow" :show-cancel-button="true" :content="'是否确认收货?'" :confirm-color="lightColor" @confirm="confirmRog"></u-modal>
|
<u-modal v-model="rogShow" :show-cancel-button="true" :content="'是否确认收货?'" :confirm-color="lightColor"
|
||||||
|
@confirm="confirmRog"></u-modal>
|
||||||
|
|
||||||
<!-- 分享 -->
|
<!-- 分享 -->
|
||||||
<shares v-if="shareFlage " :thumbnail="orderDetail.orderItems[0].image" :goodsName="orderDetail.orderItems[0].goodsName" @close="shareFlage = false" />
|
<shares v-if="shareFlag" :thumbnail="orderDetail.orderItems[0].image"
|
||||||
|
:goodsName="orderDetail.orderItems[0].goodsName" @close="shareFlag = false" />
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { getExpress } from "@/api/trade.js";
|
import { getExpress, getPackage } from "@/api/trade.js";
|
||||||
import { cancelOrder, confirmReceipt, getOrderDetail } from "@/api/order.js";
|
import { cancelOrder, confirmReceipt, getOrderDetail } from "@/api/order.js";
|
||||||
|
|
||||||
import { h5Copy } from "@/js_sdk/h5-copy/h5-copy.js";
|
|
||||||
import shares from "@/components/m-share/index"; //分享
|
import shares from "@/components/m-share/index"; //分享
|
||||||
|
|
||||||
import { getClearReason } from "@/api/after-sale.js";
|
import { getClearReason } from "@/api/after-sale.js";
|
||||||
@@ -228,8 +266,8 @@ export default {
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
lightColor: this.$lightColor,
|
lightColor: this.$lightColor,
|
||||||
logiList: "", //物流信息
|
logisticsList: "", //物流信息
|
||||||
shareFlage: false, //拼团分享开关
|
shareFlag: false, //拼团分享开关
|
||||||
orderStatusList: {
|
orderStatusList: {
|
||||||
UNPAID: {
|
UNPAID: {
|
||||||
title: "未付款",
|
title: "未付款",
|
||||||
@@ -243,6 +281,10 @@ export default {
|
|||||||
title: "待发货",
|
title: "待发货",
|
||||||
value: "商品等待发货中",
|
value: "商品等待发货中",
|
||||||
},
|
},
|
||||||
|
PARTS_DELIVERED: {
|
||||||
|
title: "部分发货",
|
||||||
|
value: "商品已部分发货。",
|
||||||
|
},
|
||||||
DELIVERED: {
|
DELIVERED: {
|
||||||
title: "已发货",
|
title: "已发货",
|
||||||
value: "商品已发货,请您耐心等待",
|
value: "商品已发货,请您耐心等待",
|
||||||
@@ -255,6 +297,10 @@ export default {
|
|||||||
title: "已完成",
|
title: "已完成",
|
||||||
value: "订单已完成,祝您生活愉快",
|
value: "订单已完成,祝您生活愉快",
|
||||||
},
|
},
|
||||||
|
STAY_PICKED_UP: {
|
||||||
|
title: "待自提",
|
||||||
|
value: "商品正在等待提取",
|
||||||
|
},
|
||||||
TAKE: {
|
TAKE: {
|
||||||
title: "待核验",
|
title: "待核验",
|
||||||
},
|
},
|
||||||
@@ -268,15 +314,50 @@ export default {
|
|||||||
cancelList: "",
|
cancelList: "",
|
||||||
rogShow: false,
|
rogShow: false,
|
||||||
reason: "",
|
reason: "",
|
||||||
|
orderPackage:"",
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
onLoad(options) {
|
onLoad(options) {
|
||||||
this.loadData(options.sn);
|
this.loadData(options.sn);
|
||||||
this.loadLogistics(options.sn);
|
|
||||||
this.sn = options.sn;
|
this.sn = options.sn;
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
tostore(val) {
|
//获取包裹
|
||||||
|
async getOrderPackage() {
|
||||||
|
getPackage(this.order.sn).then(res => {
|
||||||
|
if (res.data.success) {
|
||||||
|
this.orderPackage = res.data.result
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
handleClickDeliver(){
|
||||||
|
uni.navigateTo({
|
||||||
|
url: `/pages/order/deliverDetail?order_sn=${this.order.sn}`,
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 退款状态枚举
|
||||||
|
refundPriceList(status) {
|
||||||
|
switch (status) {
|
||||||
|
case 'ALL_REFUND':
|
||||||
|
return "全部退款";
|
||||||
|
case 'PART_REFUND':
|
||||||
|
return "部分退款";
|
||||||
|
case 'NO_REFUND':
|
||||||
|
return "未退款";
|
||||||
|
case 'REFUNDING':
|
||||||
|
return "退款中";
|
||||||
|
default:
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
},
|
||||||
|
callPhone(){
|
||||||
|
this.$options.filters.callPhone(this.order.storeAddressMobile )
|
||||||
|
},
|
||||||
|
//联系客服
|
||||||
|
contact(storeId){
|
||||||
|
this.$options.filters.talkIm(storeId)
|
||||||
|
},
|
||||||
|
goToShopPage(val) {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: "/pages/product/shopPage?id=" + val.storeId,
|
url: "/pages/product/shopPage?id=" + val.storeId,
|
||||||
});
|
});
|
||||||
@@ -284,13 +365,13 @@ export default {
|
|||||||
// 获取物流信息
|
// 获取物流信息
|
||||||
loadLogistics(sn) {
|
loadLogistics(sn) {
|
||||||
getExpress(sn).then((res) => {
|
getExpress(sn).then((res) => {
|
||||||
this.logiList = res.data.result;
|
this.logisticsList = res.data.result;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
// 分享当前拼团信息
|
// 分享当前拼团信息
|
||||||
inviteGroup() {
|
inviteGroup() {
|
||||||
this.shareFlage = true;
|
this.shareFlag = true;
|
||||||
},
|
},
|
||||||
// #TODO 这块需要写一下 目前没有拼团的详细信息
|
// #TODO 这块需要写一下 目前没有拼团的详细信息
|
||||||
ByUserMessage(order) {
|
ByUserMessage(order) {
|
||||||
@@ -304,7 +385,7 @@ export default {
|
|||||||
this.orderGoodsList[0].goodsId,
|
this.orderGoodsList[0].goodsId,
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
loadData(sn) {
|
async loadData(sn) {
|
||||||
uni.showLoading({
|
uni.showLoading({
|
||||||
title: "加载中",
|
title: "加载中",
|
||||||
});
|
});
|
||||||
@@ -313,9 +394,13 @@ export default {
|
|||||||
this.order = order.order;
|
this.order = order.order;
|
||||||
this.orderGoodsList = order.orderItems;
|
this.orderGoodsList = order.orderItems;
|
||||||
this.orderDetail = res.data.result;
|
this.orderDetail = res.data.result;
|
||||||
|
if (this.order.deliveryMethod === 'LOGISTICS') {
|
||||||
uni.hideLoading();
|
this.loadLogistics(sn);
|
||||||
|
this.getOrderPackage();
|
||||||
|
}
|
||||||
|
if (this.$store.state.isShowToast){ uni.hideLoading() };
|
||||||
});
|
});
|
||||||
|
|
||||||
},
|
},
|
||||||
onReceipt(val) {
|
onReceipt(val) {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
@@ -324,39 +409,11 @@ export default {
|
|||||||
},
|
},
|
||||||
gotoGoodsDetail(sku) {
|
gotoGoodsDetail(sku) {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: `/pages/product/goods?id=${sku.id}&goodsId=${sku.goodsId}`,
|
url: `/pages/product/goods?id=${sku.skuId}&goodsId=${sku.goodsId}`,
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
onCopy(sn) {
|
onCopy(sn) {
|
||||||
// #ifdef H5
|
this.$options.filters.setClipboard(sn)
|
||||||
if (sn === null || sn === undefined) {
|
|
||||||
sn = "";
|
|
||||||
} else sn = sn + "";
|
|
||||||
const result = h5Copy(sn);
|
|
||||||
if (result === false) {
|
|
||||||
uni.showToast({
|
|
||||||
title: "不支持",
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
uni.showToast({
|
|
||||||
title: "复制成功",
|
|
||||||
icon: "none",
|
|
||||||
});
|
|
||||||
}
|
|
||||||
// #endif
|
|
||||||
|
|
||||||
// #ifndef H5
|
|
||||||
uni.setClipboardData({
|
|
||||||
data: sn,
|
|
||||||
success: function () {
|
|
||||||
uni.showToast({
|
|
||||||
title: "复制成功!",
|
|
||||||
duration: 2000,
|
|
||||||
icon: "none",
|
|
||||||
});
|
|
||||||
},
|
|
||||||
});
|
|
||||||
// #endif
|
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -383,8 +440,8 @@ export default {
|
|||||||
toPay(val) {
|
toPay(val) {
|
||||||
val.sn
|
val.sn
|
||||||
? uni.navigateTo({
|
? uni.navigateTo({
|
||||||
url: "/pages/cart/payment/payOrder?order_sn=" + val.sn,
|
url: "/pages/cart/payment/payOrder?order_sn=" + val.sn,
|
||||||
})
|
})
|
||||||
: false;
|
: false;
|
||||||
}, //删除订单
|
}, //删除订单
|
||||||
deleteOrder(index) {
|
deleteOrder(index) {
|
||||||
@@ -393,7 +450,7 @@ export default {
|
|||||||
});
|
});
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.navList[this.tabCurrentIndex].orderList.splice(index, 1);
|
this.navList[this.tabCurrentIndex].orderList.splice(index, 1);
|
||||||
uni.hideLoading();
|
if (this.$store.state.isShowToast){ uni.hideLoading() };
|
||||||
}, 600);
|
}, 600);
|
||||||
},
|
},
|
||||||
//取消订单
|
//取消订单
|
||||||
@@ -407,7 +464,7 @@ export default {
|
|||||||
if (res.data.result.length >= 1) {
|
if (res.data.result.length >= 1) {
|
||||||
this.cancelList = res.data.result;
|
this.cancelList = res.data.result;
|
||||||
}
|
}
|
||||||
uni.hideLoading();
|
if (this.$store.state.isShowToast){ uni.hideLoading() };
|
||||||
});
|
});
|
||||||
|
|
||||||
this.cancelShow = true;
|
this.cancelShow = true;
|
||||||
@@ -491,9 +548,11 @@ export default {
|
|||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
@import "./goods.scss";
|
@import "./goods.scss";
|
||||||
|
|
||||||
.empty {
|
.empty {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.customer-service {
|
.customer-service {
|
||||||
background: #ededed;
|
background: #ededed;
|
||||||
// padding: 12rpx 40rpx;
|
// padding: 12rpx 40rpx;
|
||||||
@@ -506,51 +565,58 @@ export default {
|
|||||||
font-size: 24rpx;
|
font-size: 24rpx;
|
||||||
border-radius: 10rpx;
|
border-radius: 10rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.customer-list {
|
.customer-list {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
}
|
}
|
||||||
.logi-view {
|
|
||||||
|
.logistics-view {
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
padding: 30rpx !important;
|
padding: 30rpx !important;
|
||||||
margin: 0 !important;
|
margin: 0 !important;
|
||||||
transform: translateY(-10px);
|
transform: translateY(-10px);
|
||||||
}
|
}
|
||||||
|
|
||||||
.order-status {
|
.order-status {
|
||||||
color: #fff;
|
color: #fff;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
font-size: 36rpx;
|
font-size: 36rpx;
|
||||||
margin-top: 40rpx;
|
margin-top: 40rpx;
|
||||||
> div {
|
|
||||||
|
>div {
|
||||||
font-size: 24rpx;
|
font-size: 24rpx;
|
||||||
margin-top: 10rpx;
|
margin-top: 10rpx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.logi-List-title {
|
|
||||||
|
.logistics-List-title {
|
||||||
margin-bottom: 10rpx;
|
margin-bottom: 10rpx;
|
||||||
font-size: 26rpx;
|
font-size: 26rpx;
|
||||||
}
|
}
|
||||||
.logi-List-time {
|
|
||||||
|
.logistics-List-time {
|
||||||
font-size: 24rpx;
|
font-size: 24rpx;
|
||||||
color: #999;
|
color: #999;
|
||||||
}
|
}
|
||||||
|
|
||||||
.info-detail {
|
.info-detail {
|
||||||
margin-right: 30rpx;
|
margin-right: 30rpx;
|
||||||
color: #333;
|
color: #333;
|
||||||
}
|
}
|
||||||
|
|
||||||
.order-view {
|
.order-view {
|
||||||
margin: 0 !important;
|
margin: 0 !important;
|
||||||
border-radius: 0 !important;
|
border-radius: 0 !important;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 200rpx;
|
height: 200rpx;
|
||||||
padding: 0 !important;
|
padding: 0 !important;
|
||||||
background-image: linear-gradient(
|
background-image: linear-gradient(to right,
|
||||||
to right,
|
$light-color 0%,
|
||||||
$light-color 0%,
|
$aider-light-color 100%) !important;
|
||||||
$aider-light-color 100%
|
|
||||||
) !important;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
page,
|
page,
|
||||||
.content {
|
.content {
|
||||||
background: #f1f1f1;
|
background: #f1f1f1;
|
||||||
@@ -575,18 +641,22 @@ page,
|
|||||||
padding: 16rpx 0rpx;
|
padding: 16rpx 0rpx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.seller-view {
|
.seller-view {
|
||||||
margin: 20rpx 0;
|
margin: 20rpx 0;
|
||||||
padding: 15rpx 0;
|
padding: 15rpx 0;
|
||||||
border-radius: 30rpx;
|
border-radius: 30rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.address-title {
|
.address-title {
|
||||||
font-size: 26rpx;
|
font-size: 26rpx;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
> span {
|
|
||||||
|
>span {
|
||||||
margin-right: 20rpx;
|
margin-right: 20rpx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.info-view {
|
.info-view {
|
||||||
display: flex;
|
display: flex;
|
||||||
margin: 0 0 20rpx 0;
|
margin: 0 0 20rpx 0;
|
||||||
@@ -621,11 +691,14 @@ page,
|
|||||||
width: 140rpx;
|
width: 140rpx;
|
||||||
font-size: 24rpx;
|
font-size: 24rpx;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
|
flex:3;
|
||||||
|
min-width: 160rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.value {
|
.value {
|
||||||
color: #666;
|
color: #666;
|
||||||
font-size: 24rpx;
|
font-size: 24rpx;
|
||||||
|
flex:10;
|
||||||
}
|
}
|
||||||
|
|
||||||
.copy {
|
.copy {
|
||||||
@@ -643,7 +716,7 @@ page,
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
margin: 10rpx 0rpx;
|
margin: 10rpx 0rpx;
|
||||||
|
|
||||||
.ltitle {
|
.invoice-title {
|
||||||
width: 550rpx;
|
width: 550rpx;
|
||||||
font-size: 28rpx;
|
font-size: 28rpx;
|
||||||
color: #333333;
|
color: #333333;
|
||||||
@@ -654,10 +727,12 @@ page,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.verificationCode {
|
.verificationCode {
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
letter-spacing: 2rpx;
|
letter-spacing: 2rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.bottom_view {
|
.bottom_view {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100rpx;
|
height: 100rpx;
|
||||||
@@ -718,4 +793,15 @@ page,
|
|||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.address-line-height{
|
||||||
|
line-height: 1.75;
|
||||||
|
}
|
||||||
|
.seller-name{
|
||||||
|
>.name{
|
||||||
|
flex:10 !important;
|
||||||
|
}
|
||||||
|
>.status{
|
||||||
|
flex:2;
|
||||||
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user