mirror of
https://gitee.com/beijing_hongye_huicheng/lilishop-uniapp.git
synced 2025-12-19 17:05:55 +08:00
Compare commits
216 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9b5e2ec7f0 | ||
|
|
adf4e106d8 | ||
|
|
d01edbdfe2 | ||
|
|
f08d166c86 | ||
|
|
b8c61fdabd | ||
|
|
6b3b61acb5 | ||
|
|
1a6951b717 | ||
|
|
165df678b3 | ||
|
|
2abbee0a49 | ||
|
|
a6883fe607 | ||
|
|
6ee0abd150 | ||
|
|
68e927c6f4 | ||
|
|
1776f43425 | ||
|
|
fc8123c194 | ||
|
|
34448b8a23 | ||
|
|
7179ca41de | ||
|
|
3c7d940ba8 | ||
|
|
1225a41de4 | ||
|
|
d101cd1b6a | ||
|
|
4851487ecd | ||
|
|
eb0faad7ec | ||
|
|
524666f6e4 | ||
|
|
e9da67dcce | ||
|
|
aa8fc523df | ||
|
|
63570a923b | ||
|
|
638e82dd28 | ||
|
|
68dc960232 | ||
|
|
bbbe25e339 | ||
|
|
d8cca8b372 | ||
|
|
1e9df74034 | ||
|
|
8c8522c68e | ||
|
|
5afc5477a9 | ||
|
|
a6e48813cd | ||
|
|
a1a286dfb6 | ||
|
|
132c64f438 | ||
|
|
8e0bde3428 | ||
|
|
d9ac9eb2eb | ||
|
|
6ccdeba85e | ||
|
|
bbf0f39d69 | ||
|
|
109af44c6b | ||
|
|
bc9c012bb2 | ||
|
|
ba02c6ca7d | ||
|
|
b840a0adf1 | ||
|
|
5cb2f6ad91 | ||
|
|
36a7a80814 | ||
|
|
17299d00e1 | ||
|
|
a56ea2d456 | ||
|
|
3a705cce8e | ||
|
|
5550285531 | ||
|
|
0ba7644862 | ||
|
|
0e169bd116 | ||
|
|
4b9515b21a | ||
|
|
3f0e34b715 | ||
|
|
a393910c0a | ||
|
|
213f4b8408 | ||
|
|
8cb01d0ba8 | ||
|
|
d8c46b49d9 | ||
|
|
73e4ba9994 | ||
|
|
3aa5b21d49 | ||
|
|
f90807ebc6 | ||
|
|
a555009ac9 | ||
|
|
af21d1abba | ||
|
|
dcf77ba862 | ||
|
|
f281011a47 | ||
|
|
6bb8ca73d3 | ||
|
|
a070edc1c2 | ||
|
|
09485747a6 | ||
|
|
cbd73ae638 | ||
|
|
1aeec348eb | ||
|
|
ea8e783909 | ||
|
|
e06338dd2e | ||
|
|
d6fffc43e4 | ||
|
|
7633f84385 | ||
|
|
93fc20c825 | ||
|
|
ca32c11296 | ||
|
|
d2b8d2238a | ||
|
|
04ea9c39e1 | ||
|
|
905e965917 | ||
|
|
1ada23584d | ||
|
|
1456fd9076 | ||
|
|
941dd6015d | ||
|
|
b1f320f361 | ||
|
|
63e3718178 | ||
|
|
9bfa30f849 | ||
|
|
bb24b27963 | ||
|
|
403d93831f | ||
|
|
9a149eb673 | ||
|
|
470995c13d | ||
|
|
ddcd03f096 | ||
|
|
b8fe2aacf1 | ||
|
|
3c9f0d3c5c | ||
|
|
ded0ab5381 | ||
|
|
42d20f0fd9 | ||
|
|
0e8ace560b | ||
|
|
6e04a5d3da | ||
|
|
a3d8a8037f | ||
|
|
1dc42e1333 | ||
|
|
68cdcd8587 | ||
|
|
ebf0d585fc | ||
|
|
75365c428d | ||
|
|
3e30f5e18f | ||
|
|
e8d3b3decb | ||
|
|
5dcb364469 | ||
|
|
df9530e48f | ||
|
|
240a27a61a | ||
|
|
a6a8a5d583 | ||
|
|
a9046aded4 | ||
|
|
6f60cc6afb | ||
|
|
6e5470e20c | ||
|
|
dc04b4220f | ||
|
|
b1cfdef41c | ||
|
|
06e609613e | ||
|
|
8e66c24ff9 | ||
|
|
b4e2761b1f | ||
|
|
884d3e8c34 | ||
|
|
53739d24df | ||
|
|
f59a76d9a0 | ||
|
|
6cd36b19b2 | ||
|
|
b22ad88f37 | ||
|
|
f87ec18669 | ||
|
|
64686e165f | ||
|
|
055bad9ca9 | ||
|
|
c6e04bc4b9 | ||
|
|
b6782df565 | ||
|
|
2b4cb2cc88 | ||
|
|
14d12d90e3 | ||
|
|
4ed3832a5f | ||
|
|
b0714ab27e | ||
|
|
201ee840d5 | ||
|
|
79f737404e | ||
|
|
0b649e3f5b | ||
|
|
c756223363 | ||
|
|
ea60742d82 | ||
|
|
2ce90ba008 | ||
|
|
63211457e4 | ||
|
|
67f014d74a | ||
|
|
08fffade74 | ||
|
|
c8adb52660 | ||
|
|
4f74502951 | ||
|
|
4a5a4c19a5 | ||
|
|
e73d76eb57 | ||
|
|
b9a89d7c40 | ||
|
|
1a1bf814a0 | ||
|
|
f52e929d04 | ||
|
|
38d8d2e1ca | ||
|
|
ab4015d0e0 | ||
|
|
15027e51ee | ||
|
|
557d7ef1d9 | ||
|
|
4dea906e23 | ||
|
|
68e25cb0b3 | ||
|
|
4d033e59f1 | ||
|
|
a80c579d8a | ||
|
|
5cc48ed462 | ||
|
|
2abc8ff9d8 | ||
|
|
198bd6c322 | ||
|
|
7fb96f1eac | ||
|
|
2020f55826 | ||
|
|
c58f8d7831 | ||
|
|
32a6bbacd0 | ||
|
|
b08c77b6c0 | ||
|
|
a8836744f6 | ||
|
|
3a2202a2e8 | ||
|
|
896749d812 | ||
|
|
09ec1e8c06 | ||
|
|
07627c41e3 | ||
|
|
e4e278c2fa | ||
|
|
1b1b239ba0 | ||
|
|
c1d4d39265 | ||
|
|
dfd3885486 | ||
|
|
892f49c83a | ||
|
|
85d0671443 | ||
|
|
f22e7b9fcb | ||
|
|
d282ef1b24 | ||
|
|
9c2529ae3d | ||
|
|
108b7f5b0b | ||
|
|
b4c8be3e63 | ||
|
|
4064c56b21 | ||
|
|
1416762afe | ||
|
|
17f23fe920 | ||
|
|
c412c92b3e | ||
|
|
deed875c1b | ||
|
|
f600b628ce | ||
|
|
0c887a25e3 | ||
|
|
89dbd32351 | ||
|
|
98c5863973 | ||
|
|
3d1089b756 | ||
|
|
6c8102aecd | ||
|
|
56fdb2c2f0 | ||
|
|
7c85460fbb | ||
|
|
47b58c290a | ||
|
|
cdf57806d6 | ||
|
|
9671d60555 | ||
|
|
f8b388c968 | ||
|
|
91cc98e853 | ||
|
|
58484f1b61 | ||
|
|
d65ad6c5fd | ||
|
|
68bc1d6974 | ||
|
|
b1c518c3a8 | ||
|
|
48c7030c0e | ||
|
|
13c9d521f9 | ||
|
|
375653eb78 | ||
|
|
8c72cdcb0a | ||
|
|
cfb88d798b | ||
|
|
ebf32a18b0 | ||
|
|
5f6c1adf91 | ||
|
|
44648e9971 | ||
|
|
fd37087c43 | ||
|
|
4c47a1249f | ||
|
|
ea3563e4e9 | ||
|
|
c98c5b64e1 | ||
|
|
3b9b2e8ba2 | ||
|
|
cebde87682 | ||
|
|
0b2bf1faf1 | ||
|
|
73560e8366 | ||
|
|
afabfdd1d5 | ||
|
|
dadce33d74 |
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1,6 +1,7 @@
|
|||||||
# OSX
|
# OSX
|
||||||
#
|
#
|
||||||
.DS_Store
|
.DS_Store
|
||||||
|
node_modules/
|
||||||
|
|
||||||
#Intellij idea
|
#Intellij idea
|
||||||
.idea/
|
.idea/
|
||||||
|
|||||||
442
App.vue
442
App.vue
@@ -1,221 +1,259 @@
|
|||||||
|
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
/**
|
/**
|
||||||
* vuex管理登录状态,具体可以参考官方登录模板示例
|
* vuex管理登录状态,具体可以参考官方登录模板示例
|
||||||
*/
|
*/
|
||||||
import { mapMutations } from "vuex";
|
import {
|
||||||
import APPUpdate from "@/plugins/APPUpdate";
|
mapMutations
|
||||||
import { getClipboardData } from "@/js_sdk/h5-copy/h5-copy.js";
|
} from "vuex";
|
||||||
import config from "@/config/config";
|
import APPUpdate from "@/plugins/APPUpdate";
|
||||||
// 悬浮球
|
import {
|
||||||
|
getClipboardData
|
||||||
|
} from "@/js_sdk/h5-copy/h5-copy.js";
|
||||||
|
import config from "@/config/config";
|
||||||
|
import storage from "@/utils/storage";
|
||||||
|
|
||||||
export default {
|
|
||||||
data() {
|
|
||||||
return {
|
/**
|
||||||
config,
|
* 路由监听并删除路由
|
||||||
};
|
* https://developers.weixin.qq.com/miniprogram/dev/api/route/wx.navigateTo.html
|
||||||
},
|
* */
|
||||||
|
// #ifdef MP-WEIXIN
|
||||||
|
wx.onAppRoute((res) => {
|
||||||
|
const pages = getCurrentPages();
|
||||||
|
console.log("pages:" + pages.length,pages);
|
||||||
|
if (pages.length > 3) {
|
||||||
|
delete getCurrentPages()[2]
|
||||||
|
}
|
||||||
|
console.log('路由监听', {
|
||||||
|
res
|
||||||
|
})
|
||||||
|
})
|
||||||
|
// #endif
|
||||||
|
|
||||||
/**
|
export default {
|
||||||
* 监听返回
|
data() {
|
||||||
*/
|
return {
|
||||||
onBackPress(e) {
|
config,
|
||||||
if (e.from == "backbutton") {
|
};
|
||||||
let routes = getCurrentPages();
|
},
|
||||||
let curRoute = routes[routes.length - 1].options;
|
|
||||||
routes.forEach((item) => {
|
|
||||||
if (
|
|
||||||
item.route == "pages/tabbar/cart/cartList" ||
|
|
||||||
item.route.indexOf("pages/product/goods") != -1
|
|
||||||
) {
|
|
||||||
uni.redirectTo({
|
|
||||||
url: item.route,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
if (curRoute.addId) {
|
|
||||||
uni.reLaunch({
|
|
||||||
url: "/pages/tabbar/cart/cartList",
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
uni.navigateBack();
|
|
||||||
}
|
|
||||||
return true; //阻止默认返回行为
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
...mapMutations(["login"]),
|
|
||||||
},
|
|
||||||
onLaunch: function () {
|
|
||||||
// #ifdef APP-PLUS
|
|
||||||
this.checkArguments(); // 检测启动参数
|
|
||||||
APPUpdate();
|
|
||||||
|
|
||||||
// 重点是以下: 一定要监听后台恢复 !一定要
|
/**
|
||||||
plus.globalEvent.addEventListener("newintent", (e) => {
|
* 监听返回
|
||||||
this.checkArguments(); // 检测启动参数
|
*/
|
||||||
});
|
onBackPress(e) {
|
||||||
// #endif
|
if (e.from == "backbutton") {
|
||||||
|
let routes = getCurrentPages();
|
||||||
|
let curRoute = routes[routes.length - 1].options;
|
||||||
|
routes.forEach((item) => {
|
||||||
|
if (
|
||||||
|
item.route == "pages/tabbar/cart/cartList" ||
|
||||||
|
item.route.indexOf("pages/product/goods") != -1
|
||||||
|
) {
|
||||||
|
uni.redirectTo({
|
||||||
|
url: item.route,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
// #ifdef MP-WEIXIN
|
if (curRoute.addId) {
|
||||||
this.applyUpdateWeChat();
|
uni.reLaunch({
|
||||||
// #endif
|
url: "/pages/tabbar/cart/cartList",
|
||||||
},
|
});
|
||||||
|
} else {
|
||||||
|
uni.navigateBack();
|
||||||
|
}
|
||||||
|
return true; //阻止默认返回行为
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
...mapMutations(["login"]),
|
||||||
|
},
|
||||||
|
onLaunch: function() {
|
||||||
|
// #ifdef APP-PLUS
|
||||||
|
this.checkArguments(); // 检测启动参数
|
||||||
|
APPUpdate();
|
||||||
|
|
||||||
onShow() {
|
// 重点是以下: 一定要监听后台恢复 !一定要
|
||||||
// #ifndef H5
|
plus.globalEvent.addEventListener("newintent", (e) => {
|
||||||
this.getClipboard();
|
this.checkArguments(); // 检测启动参数
|
||||||
// #endif
|
});
|
||||||
},
|
// #endif
|
||||||
methods: {
|
|
||||||
/**
|
|
||||||
* 微信小程序版本提交更新版本 解决缓存问题
|
|
||||||
*/
|
|
||||||
applyUpdateWeChat() {
|
|
||||||
const updateManager = uni.getUpdateManager();
|
|
||||||
|
|
||||||
updateManager.onCheckForUpdate(function (res) {
|
// #ifdef MP-WEIXIN
|
||||||
// 请求完新版本信息的回调
|
this.applyUpdateWeChat();
|
||||||
});
|
// #endif
|
||||||
|
},
|
||||||
|
|
||||||
updateManager.onUpdateReady(function (res) {
|
onShow() {
|
||||||
uni.showModal({
|
// #ifndef H5
|
||||||
title: "更新提示",
|
if(this.config.enableGetClipboard){
|
||||||
content: "发现新版本,是否重启应用?",
|
this.getClipboard();
|
||||||
success(res) {
|
}
|
||||||
if (res.confirm) {
|
// #endif
|
||||||
// 新的版本已经下载好,调用 applyUpdate 应用新版本并重启
|
// #ifdef APP-PLUS
|
||||||
updateManager.applyUpdate();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
});
|
|
||||||
});
|
|
||||||
updateManager.onUpdateFailed(function (res) {
|
|
||||||
// 新的版本下载失败
|
|
||||||
});
|
|
||||||
},
|
|
||||||
|
|
||||||
// TODO 开屏广告 后续优化添加
|
if (storage.getShow()) {
|
||||||
launch() {
|
if (uni.getSystemInfoSync().platform == 'ios') {
|
||||||
try {
|
this.$u.route("/pages/tabbar/screen/fullScreen");
|
||||||
// 获取本地存储中launchFlag标识 开屏广告
|
|
||||||
const value = uni.getStorageSync("launchFlag");
|
|
||||||
if (!value) {
|
|
||||||
// this.$u.route("/pages/index/agreement");
|
|
||||||
} else {
|
|
||||||
//app启动时打开启动广告页
|
|
||||||
var w = plus.webview.open(
|
|
||||||
"/hybrid/html/advertise/advertise.html",
|
|
||||||
"本地地址",
|
|
||||||
{
|
|
||||||
top: 0,
|
|
||||||
bottom: 0,
|
|
||||||
zindex: 999,
|
|
||||||
},
|
|
||||||
"fade-in",
|
|
||||||
500
|
|
||||||
);
|
|
||||||
//设置定时器,4s后关闭启动广告页
|
|
||||||
setTimeout(function () {
|
|
||||||
plus.webview.close(w);
|
|
||||||
APPUpdate();
|
|
||||||
}, 3000);
|
|
||||||
}
|
|
||||||
} catch (e) {
|
|
||||||
// error
|
|
||||||
uni.setStorage({
|
|
||||||
key: "launchFlag",
|
|
||||||
data: true,
|
|
||||||
success: function () {
|
|
||||||
console.log("error时存储launchFlag");
|
|
||||||
},
|
|
||||||
});
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
}
|
||||||
* 获取粘贴板数据
|
}
|
||||||
*/
|
// #endif
|
||||||
async getClipboard() {
|
},
|
||||||
let res = await getClipboardData();
|
methods: {
|
||||||
/**
|
/**
|
||||||
* 解析粘贴板数据
|
* 微信小程序版本提交更新版本 解决缓存问题
|
||||||
*/
|
*/
|
||||||
if (res.indexOf(config.shareLink) != -1) {
|
applyUpdateWeChat() {
|
||||||
uni.showModal({
|
const updateManager = uni.getUpdateManager();
|
||||||
title: "提示",
|
|
||||||
content: "检测到一个分享链接是否跳转?",
|
|
||||||
confirmText: "跳转",
|
|
||||||
success: function (callback) {
|
|
||||||
if (callback.confirm) {
|
|
||||||
const path = res.split(config.shareLink)[1];
|
|
||||||
if (path.indexOf("tabbar") != -1) {
|
|
||||||
uni.switchTab({
|
|
||||||
url: path,
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
uni.navigateTo({
|
|
||||||
url: path,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
});
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
updateManager.onCheckForUpdate(function(res) {
|
||||||
* h5中打开app获取跳转app的链接并跳转
|
// 请求完新版本信息的回调
|
||||||
*/
|
});
|
||||||
checkArguments() {
|
|
||||||
// #ifdef APP-PLUS
|
updateManager.onUpdateReady(function(res) {
|
||||||
setTimeout(() => {
|
uni.showModal({
|
||||||
const args = plus.runtime.arguments;
|
title: "更新提示",
|
||||||
if (args) {
|
content: "发现新版本,是否重启应用?",
|
||||||
const argsStr = decodeURIComponent(args);
|
success(res) {
|
||||||
const path = argsStr.split("//")[1];
|
if (res.confirm) {
|
||||||
if (path.indexOf("tabbar") != -1) {
|
// 新的版本已经下载好,调用 applyUpdate 应用新版本并重启
|
||||||
uni.switchTab({
|
updateManager.applyUpdate();
|
||||||
url: `/${path}`,
|
}
|
||||||
});
|
},
|
||||||
} else {
|
});
|
||||||
uni.navigateTo({
|
});
|
||||||
url: `/${path}`,
|
updateManager.onUpdateFailed(function(res) {
|
||||||
});
|
// 新的版本下载失败
|
||||||
}
|
});
|
||||||
}
|
},
|
||||||
});
|
|
||||||
// #endif
|
// TODO 开屏广告 后续优化添加
|
||||||
},
|
launch() {
|
||||||
},
|
try {
|
||||||
};
|
// 获取本地存储中launchFlag标识 开屏广告
|
||||||
|
const value = uni.getStorageSync("launchFlag");
|
||||||
|
if (!value) {
|
||||||
|
// this.$u.route("/pages/index/agreement");
|
||||||
|
} else {
|
||||||
|
//app启动时打开启动广告页
|
||||||
|
var w = plus.webview.open(
|
||||||
|
"/hybrid/html/advertise/advertise.html",
|
||||||
|
"本地地址", {
|
||||||
|
top: 0,
|
||||||
|
bottom: 0,
|
||||||
|
zindex: 999,
|
||||||
|
},
|
||||||
|
"fade-in",
|
||||||
|
500
|
||||||
|
);
|
||||||
|
//设置定时器,4s后关闭启动广告页
|
||||||
|
setTimeout(function() {
|
||||||
|
plus.webview.close(w);
|
||||||
|
APPUpdate();
|
||||||
|
}, 3000);
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
// error
|
||||||
|
uni.setStorage({
|
||||||
|
key: "launchFlag",
|
||||||
|
data: true,
|
||||||
|
success: function() {
|
||||||
|
console.log("error时存储launchFlag");
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取粘贴板数据
|
||||||
|
*/
|
||||||
|
async getClipboard() {
|
||||||
|
let res = await getClipboardData();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 解析粘贴板数据
|
||||||
|
*/
|
||||||
|
|
||||||
|
if (res.indexOf(config.shareLink) != -1 && (res != this.$store.state.shareLink)) {
|
||||||
|
this.$store.state.shareLink = res
|
||||||
|
uni.showModal({
|
||||||
|
title: "提示",
|
||||||
|
content: "检测到一个分享链接是否跳转?",
|
||||||
|
confirmText: "跳转",
|
||||||
|
success: function(callback) {
|
||||||
|
if (callback.confirm) {
|
||||||
|
const path = res.split(config.shareLink)[1];
|
||||||
|
if (path.indexOf("tabbar") != -1) {
|
||||||
|
uni.switchTab({
|
||||||
|
url: path,
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: path,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* h5中打开app获取跳转app的链接并跳转
|
||||||
|
*/
|
||||||
|
checkArguments() {
|
||||||
|
// #ifdef APP-PLUS
|
||||||
|
setTimeout(() => {
|
||||||
|
const args = plus.runtime.arguments;
|
||||||
|
if (args) {
|
||||||
|
const argsStr = decodeURIComponent(args);
|
||||||
|
const path = argsStr.split("//")[1];
|
||||||
|
if (path.indexOf("tabbar") != -1) {
|
||||||
|
uni.switchTab({
|
||||||
|
url: `/${path}`,
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: `/${path}`,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
// #endif
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
@import "uview-ui/index.scss";
|
@import "uview-ui/index.scss";
|
||||||
|
|
||||||
// -------适配底部安全区 苹果x系列刘海屏
|
// -------适配底部安全区 苹果x系列刘海屏
|
||||||
|
|
||||||
// #ifdef MP-WEIXIN
|
// #ifdef MP-WEIXIN
|
||||||
.mp-iphonex-bottom {
|
.mp-iphonex-bottom {
|
||||||
padding-bottom: constant(safe-area-inset-bottom);
|
padding-bottom: constant(safe-area-inset-bottom);
|
||||||
padding-bottom: env(safe-area-inset-bottom);
|
padding-bottom: env(safe-area-inset-bottom);
|
||||||
box-sizing: content-box;
|
box-sizing: content-box;
|
||||||
height: auto !important;
|
height: auto !important;
|
||||||
padding-top: 10rpx;
|
padding-top: 10rpx;
|
||||||
}
|
}
|
||||||
// #endif
|
|
||||||
|
|
||||||
body {
|
// #endif
|
||||||
background-color: $bg-color;
|
|
||||||
}
|
body {
|
||||||
/************************ */
|
background-color: $bg-color;
|
||||||
.w200 {
|
}
|
||||||
width: 200rpx !important;
|
|
||||||
}
|
/************************ */
|
||||||
.flex1 {
|
.w200 {
|
||||||
flex: 1; //必须父级设置flex
|
width: 200rpx !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.flex1 {
|
||||||
|
flex: 1; //必须父级设置flex
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -1 +0,0 @@
|
|||||||
qSyvBPhDsPdxvOhC
|
|
||||||
238
README.md
238
README.md
@@ -1,96 +1,75 @@
|
|||||||
## Lilishop B2B2C商城系统
|
## Lilishop B2B2C商城系统
|
||||||
|
|
||||||
##### 官方公众号 & 开源不易,如有帮助请点Star
|
#### 欢迎交流需求,交流业务,交流技术(基础问题自行解决,其他问题先看文档后提问)
|
||||||
|
|
||||||
|
|
||||||
|
##### 交流 qq 1群 961316482(已满)
|
||||||
|
<a target="_blank" href="https://qm.qq.com/cgi-bin/qm/qr?k=BAhURE3DG2YWhQk6kRxVapbLykqMoPS8&jump_from=webapi"><img border="0" src="https://pub.idqqimg.com/wpa/images/group.png" alt="Lilishop交流群" title="Lilishop交流群">点击快捷加群</a>
|
||||||
|
|
||||||
|
##### 交流 qq 2群 875294241(已满)
|
||||||
|
|
||||||
|
<a target="_blank" href="https://qm.qq.com/cgi-bin/qm/qr?k=_lrekOvr5k2p5uTn5GRidI-chKEmpCX3&jump_from=webapi"><img border="0" src="https://pub.idqqimg.com/wpa/images/group.png" alt="Lilishop交流群2群" title="Lilishop交流群2群">点击快捷加群</a>
|
||||||
|
|
||||||
|
|
||||||
|
##### 交流 qq 3群 263785057
|
||||||
|
|
||||||
|
<a target="_blank" href="https://qm.qq.com/cgi-bin/qm/qr?k=VUogkDvaso4zLTFH8nxFPDRKq0EthUn1&jump_from=webapi"><img border="0" src="//pub.idqqimg.com/wpa/images/group.png" alt="Lilishop交流群3群" title="Lilishop交流群3群">点击快捷加群</a>
|
||||||
|
|
||||||
|
|
||||||
|
##### 体验 公众号/小程序/APP 体验,扫描二维码
|
||||||
|
|
||||||

|

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

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

|

|
||||||
|
|
||||||
### 3行命令搭建本地环境
|
### 快速本地部署
|
||||||
|
|
||||||
温馨提示:由于服务较多,如果笔记本环境启动内存没有32g可能无法启动成功(macbookpro 2020 16g内存启动无法成功),台式机在16g内存、AMD 3700x 的ubuntu系统成功运行。
|
[点击跳转](https://docs.pickmall.cn/deploy/%E8%BF%90%E8%A1%8C%E7%8E%AF%E5%A2%83%E5%87%86%E5%A4%87.html)
|
||||||
|
|
||||||
##### 下载docker脚本
|
|
||||||
`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
|
|
||||||
|
|
||||||
##### 各个地址
|
|
||||||
|
|
||||||
| 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 |
|
|
||||||
|
|
||||||
|
**商城数据库**
|
||||||
|
使用docker-compose部署数据库,自动初始化数据库,不需要手动下载等操作
|
||||||
|
|
||||||
|
如果手动部署,才需要获取sql [点击跳转](https://gitee.com/beijing_hongye_huicheng/docker/tree/master/init/mysql) (PS:这里有与tag版本一致的sql,如果是历史版本,则docker项目也切换至历史版本获取sql即可,历史版本升级则根据java相聚的根目录DB目录下的升级sql,按需执行)。
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -98,33 +77,24 @@ PS:单独部署的话,数据库文件访问这里:https://gitee.com/beijing_
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
#### 平台功能
|
#### 平台管理端功能
|
||||||
|
|
||||||

|

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

|

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

|

|
||||||
|
|
||||||
@@ -133,9 +103,9 @@ PS:单独部署的话,数据库文件访问这里:https://gitee.com/beijing_
|
|||||||
|
|
||||||
#### 架构图
|
#### 架构图
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
##### Java后台
|
##### 后台技术选型
|
||||||
|
|
||||||
| 说明 | 框架 | 说明 | |
|
| 说明 | 框架 | 说明 | |
|
||||||
| -------------- | --------------- | -------------- | ------------- |
|
| -------------- | --------------- | -------------- | ------------- |
|
||||||
@@ -166,102 +136,21 @@ PS:单独部署的话,数据库文件访问这里:https://gitee.com/beijing_
|
|||||||
| 基础UI库 | uViewui | 基础框架 | uni-app |
|
| 基础UI库 | uViewui | 基础框架 | uni-app |
|
||||||
| CSS预处理 | scss | 地图引擎 | amap |
|
| CSS预处理 | scss | 地图引擎 | amap |
|
||||||
|
|
||||||
### 升级计划
|
|
||||||
|
|
||||||
#### 计划每个月发布一个版本,具体时间可能有出入
|
|
||||||
|
|
||||||
时间:2021年6月15日
|
|
||||||
|
|
||||||
```
|
|
||||||
新增功能:
|
|
||||||
1.微信小程序直播
|
|
||||||
2.优惠券活动
|
|
||||||
3.新人赠券
|
|
||||||
4.准确发券
|
|
||||||
5.用户等级
|
|
||||||
6.数据导出
|
|
||||||
7.订单批量
|
|
||||||
8.APP版本升级检测
|
|
||||||
9.积分商城
|
|
||||||
|
|
||||||
功能优化:
|
|
||||||
1.优惠券有效期增加类型:设置领取后*内有效。
|
|
||||||
2.秒杀活动设置为每天开启,需设置秒杀活动开启时间。
|
|
||||||
3.店铺配送模板,配送地区如果选择省份则下方的市级地址不展示。
|
|
||||||
4.店铺配送模板支持,店铺包邮。
|
|
||||||
5.普通商品设置去除卖家承担运费。
|
|
||||||
|
|
||||||
```
|
|
||||||
|
|
||||||
时间:2021年7月15日
|
|
||||||
|
|
||||||
```
|
|
||||||
新增功能:
|
|
||||||
1.会员权益
|
|
||||||
2.支持用户升级会员
|
|
||||||
3.供求单
|
|
||||||
4.IM:腾讯云智服
|
|
||||||
5.服务商品
|
|
||||||
6.店铺支持订单核销
|
|
||||||
7.店铺自提点
|
|
||||||
功能优化:
|
|
||||||
1.用户分享商城、关注店铺、邀请新用户可获取积分、经验值。
|
|
||||||
```
|
|
||||||
|
|
||||||
时间:2021年8月16日
|
|
||||||
|
|
||||||
```
|
|
||||||
新增功能:
|
|
||||||
1.微淘功能
|
|
||||||
2.店铺移动端
|
|
||||||
3.店铺发货单
|
|
||||||
```
|
|
||||||
|
|
||||||
时间:2021年9月15日
|
|
||||||
|
|
||||||
```
|
|
||||||
新增功能:
|
|
||||||
增加供应商功能
|
|
||||||
```
|
|
||||||
|
|
||||||
### 版本升级
|
### 版本升级
|
||||||
|
|
||||||
```
|
```
|
||||||
后续会持续版本升级,修复bug,完善功能,覆盖更多业务场景 o2o/b2b/s2b2b2c/跨境电商
|
系统后续会提供多场景解决方案。
|
||||||
|
更多架构:微服务、Saas、中台等,都会支持。 支持差价升级商业授权
|
||||||
后续会考虑推出微服务/中台等 企业级版本
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### 技术亮点
|
### 商业授权
|
||||||
|
商业版本与开源版本代码一致,没有区分
|
||||||
|
|
||||||
|
商业使用需要授权,授权方式可选择联系官网客服,或者qq群联系群主。
|
||||||
|
|
||||||
1.后端框架基于Springboot,构建基于maven,持久层使用MyBatisPlus。使用elasticsearch、redis、mongodb、rocketmq 等各种中间健。都是主流架构,轻松应对各种环境。
|
商业授权模式为永久授权,支持永久升级。
|
||||||
|
|
||||||
2.支持集群、分布式,支持docker 轻松部署,解决各种复杂场景!
|
商业案例由于涉及部分多层二开关系,如需了解可以咨询销售。
|
||||||
|
|
||||||
3.代码模块清晰,主要分为三端api(买家、卖家、管理),各端API互相隔离,自己鉴权,自己操作业务。
|
|
||||||
|
|
||||||
4.使用阿里开源的RocketMQ,基于mq解决各种并发场景,解决事务一致性,解决搞并发延迟场景问题。
|
|
||||||
|
|
||||||
5.项目使用多级缓存,应用不同场景,redis缓存业务数据、mongodb缓存关系型多对多关系问题、nginx缓存高频访问低频修改的页面。
|
|
||||||
|
|
||||||
6.支持各种联合登陆,支持各种客户端的支付问题,灵活配置灵活开启。
|
|
||||||
|
|
||||||
7.内置完善的楼层装修机制,各种拖拉拽,维护跳转页面或外网,即便是一个什么都不懂的运营也可以轻松掌握。
|
|
||||||
|
|
||||||
8.内置阿里短信接口,可以在线申请短信模版。内置阿里oss系统,可以对文件执行各种操作。oss商家端资源相互隔离。
|
|
||||||
|
|
||||||
10.强大的统计报表,统计效果,可以实现各个场景,包含在线人数,历史在线人数,活跃人数等信息。
|
|
||||||
|
|
||||||
11.标准Api接口、提供swagger文档,快速二开。
|
|
||||||
|
|
||||||
12.分布式调度任务中心,解决分布式定时任务多次执行问题。
|
|
||||||
|
|
||||||
13.代码注释完善,快速上手。
|
|
||||||
|
|
||||||
14.非移动端采用IView框架,各种自定义插件、选择器实现。移动端采用uniapp,一次编写,全端使用
|
|
||||||
|
|
||||||
15.已经对接好各种第三方插件,支持各种复杂等联合登陆,联合支付等场景。
|
|
||||||
|
|
||||||
|
|
||||||
### 开源须知
|
### 开源须知
|
||||||
@@ -269,9 +158,14 @@ PS:单独部署的话,数据库文件访问这里:https://gitee.com/beijing_
|
|||||||
|
|
||||||
2.禁止将本开源的代码和资源进行任何形式任何名义的出售.
|
2.禁止将本开源的代码和资源进行任何形式任何名义的出售.
|
||||||
|
|
||||||
3.限制商用,如果需要商业使用请联系我们。QQ3409056806.
|
3.软件受国家计算机软件著作权保护(登记号:2021SR0805085)。
|
||||||
|
|
||||||
|
4.限制商用,如果需要商业使用请联系我们。QQ3409056806.或者加入qq群联系群主。
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
### 交流群
|
### 交流群
|
||||||
|
|
||||||
**QQ群**:961316482
|
##### 官方qq 1群 961316482(已满)
|
||||||
|
##### 官方qq 2群 875294241(已满)
|
||||||
|
##### 官网qq 3群 263785057
|
||||||
|
|||||||
17
androidPrivacy.json
Normal file
17
androidPrivacy.json
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
{
|
||||||
|
"version" : "1",
|
||||||
|
"prompt" : "template",
|
||||||
|
"title" : "服务协议和隐私政策",
|
||||||
|
"message" : " 请你务必审慎阅读、充分理解“服务协议”和“隐私政策”各条款,包括但不限于:为了更好的向你提供服务,我们需要收集你的设备标识、操作日志等信息用于分析、优化应用性能。<br/> 你可阅读<a href=\"https://pc-b2b2c.pickmall.cn/article/detail?id=1371992704333905920\">《服务协议》</a>和<a href=\"https://pc-b2b2c.pickmall.cn/article/detail?id=1371779927900160000\">《隐私政策》</a>了解详细信息。如果你同意,请点击下面按钮开始接受我们的服务。",
|
||||||
|
"buttonAccept" : "同意并接受",
|
||||||
|
"buttonRefuse" : "暂不同意",
|
||||||
|
"second" : {
|
||||||
|
"title" : "确认提示",
|
||||||
|
"message" : " 进入应用前,你需先同意<a href=\"https://pc-b2b2c.pickmall.cn/article/detail?id=1371992704333905920\">《服务协议》</a>和<a href=\"https://pc-b2b2c.pickmall.cn/article/detail?id=1371779927900160000\">《隐私政策》</a>,否则将退出应用。",
|
||||||
|
"buttonAccept" : "同意并继续",
|
||||||
|
"buttonRefuse" : "退出应用"
|
||||||
|
},
|
||||||
|
"styles" : {
|
||||||
|
"borderRadius" : "5px"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -12,7 +12,7 @@ import api from "@/config/api.js";
|
|||||||
*/
|
*/
|
||||||
export function getAddressList(pageNumber, pageSize) {
|
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",
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ 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,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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,7 +25,7 @@ export function webConnect(code) {
|
|||||||
}
|
}
|
||||||
export function openIdLogin(params, clientType) {
|
export function openIdLogin(params, clientType) {
|
||||||
return http.request({
|
return http.request({
|
||||||
url: `connect/app/login`,
|
url: `passport/connect/connect/app/login`,
|
||||||
method: Method.GET,
|
method: Method.GET,
|
||||||
needToken: true,
|
needToken: true,
|
||||||
data: params,
|
data: params,
|
||||||
@@ -40,7 +40,7 @@ export function openIdLogin(params, clientType) {
|
|||||||
*/
|
*/
|
||||||
export function loginCallback(state) {
|
export function loginCallback(state) {
|
||||||
return http.request({
|
return http.request({
|
||||||
url: `connect/result?state=${state}`,
|
url: `passport/connect/connect/result?state=${state}`,
|
||||||
method: Method.GET,
|
method: Method.GET,
|
||||||
needToken: false
|
needToken: false
|
||||||
});
|
});
|
||||||
@@ -54,7 +54,7 @@ export function loginCallback(state) {
|
|||||||
*/
|
*/
|
||||||
export function mpAutoLogin(params) {
|
export function mpAutoLogin(params) {
|
||||||
return http.request({
|
return http.request({
|
||||||
url: 'mini-program/auto-login',
|
url: 'passport/connect/miniProgram/auto-login',
|
||||||
method: Method.GET,
|
method: Method.GET,
|
||||||
params
|
params
|
||||||
});
|
});
|
||||||
|
|||||||
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,
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|||||||
23
api/home.js
23
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 },
|
||||||
@@ -46,7 +61,7 @@ export function getHotKeywords(count) {
|
|||||||
*/
|
*/
|
||||||
export function getFloorData() {
|
export function getFloorData() {
|
||||||
return http.request({
|
return http.request({
|
||||||
url: `/pageData/getIndex?clientType=H5`,
|
url: `/other/pageData/getIndex?clientType=H5`,
|
||||||
method: "get",
|
method: "get",
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -56,7 +71,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",
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
53
api/login.js
53
api/login.js
@@ -8,19 +8,36 @@ 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,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 账号密码登陆
|
||||||
|
* @params password
|
||||||
|
* @params username
|
||||||
|
*/
|
||||||
|
export function userLogin(params){
|
||||||
|
return http.request({
|
||||||
|
method: "POST",
|
||||||
|
url:`/passport/member/userLogin`,
|
||||||
|
data: params,
|
||||||
|
header: {
|
||||||
|
"content-type": "application/x-www-form-urlencoded",
|
||||||
|
},
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 发送验证码
|
* 发送验证码
|
||||||
* @param mobile
|
* @param mobile
|
||||||
*/
|
*/
|
||||||
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 +49,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,7 +67,7 @@ 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,
|
||||||
});
|
});
|
||||||
@@ -61,7 +78,33 @@ export function modifyPass(params) {
|
|||||||
*/
|
*/
|
||||||
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",
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 获取密码状态
|
||||||
|
export function logout () {
|
||||||
|
return http.request({
|
||||||
|
url: '/passport/member/logout',
|
||||||
|
method: "POST",
|
||||||
|
needToken: true,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function scannerCodeLogin(params){
|
||||||
|
return http.request({
|
||||||
|
url: '/passport/member/app_scanner',
|
||||||
|
method: "POST",
|
||||||
|
params,
|
||||||
|
needToken: true,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
export function scannerCodeLoginConfirm(params){
|
||||||
|
return http.request({
|
||||||
|
url: '/passport/member/app_confirm',
|
||||||
|
method: "POST",
|
||||||
|
params,
|
||||||
|
needToken: true,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import { http, Method } from "@/utils/request.js";
|
|||||||
*/
|
*/
|
||||||
export function feedBack(params) {
|
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" },
|
||||||
@@ -275,7 +275,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 +287,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 +300,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 +328,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 +341,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 +365,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 +378,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,
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ import api from '@/config/api.js';
|
|||||||
*/
|
*/
|
||||||
export function getWeChatMpMessage() {
|
export function getWeChatMpMessage() {
|
||||||
return http.request({
|
return http.request({
|
||||||
url: 'mini-program/subscribeMessage',
|
url: 'passport/connect/miniProgram/subscribeMessage',
|
||||||
method: Method.GET
|
method: Method.GET
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -48,6 +48,24 @@ export function messageMarkAsRead(ids) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//读取站内消息
|
||||||
|
export function editMessages(message_id,params){
|
||||||
|
return http.request({
|
||||||
|
url:`/message/member/${message_id}`,
|
||||||
|
method:Method.PUT,
|
||||||
|
needToken:true,
|
||||||
|
params
|
||||||
|
})
|
||||||
|
}
|
||||||
|
//获取站内消息
|
||||||
|
export function messages(params) {
|
||||||
|
return http.request({
|
||||||
|
url: "/message/member",
|
||||||
|
method: Method.GET,
|
||||||
|
needToken: true,
|
||||||
|
params,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取物流消息列表
|
* 获取物流消息列表
|
||||||
@@ -73,7 +91,7 @@ export function getLogisticsMessages(params) {
|
|||||||
*/
|
*/
|
||||||
export function getAppVersion(appType) {
|
export function getAppVersion(appType) {
|
||||||
return http.request({
|
return http.request({
|
||||||
url: `/appVersion/${appType}`,
|
url: `/other/appVersion/${appType}`,
|
||||||
method: Method.GET,
|
method: Method.GET,
|
||||||
type:"manager"
|
type:"manager"
|
||||||
});
|
});
|
||||||
@@ -86,7 +104,7 @@ export function getLogisticsMessages(params) {
|
|||||||
*/
|
*/
|
||||||
export function getAppVersionList(type,data) {
|
export function getAppVersionList(type,data) {
|
||||||
return http.request({
|
return http.request({
|
||||||
url: `/appVersion/appVersion/${type}`,
|
url: `/other/appVersion/appVersion/${type}`,
|
||||||
method: Method.GET,
|
method: Method.GET,
|
||||||
type:"manager",
|
type:"manager",
|
||||||
data
|
data
|
||||||
|
|||||||
@@ -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,
|
||||||
});
|
});
|
||||||
|
|||||||
11
api/store.js
11
api/store.js
@@ -4,11 +4,14 @@
|
|||||||
|
|
||||||
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',
|
||||||
method: Method.GET,
|
method: Method.GET,
|
||||||
@@ -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,7 +49,7 @@ 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,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -177,7 +177,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 +194,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 +209,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,
|
||||||
|
|
||||||
|
|||||||
@@ -1,424 +1,536 @@
|
|||||||
<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"
|
||||||
:mask-close-able="isClose" :mask="isMask" :border-radius="setup.radius" @close="closeMask()">
|
:border-radius="setup.radius" @close="closeMask()">
|
||||||
<!-- 商品 -->
|
<!-- 商品 -->
|
||||||
<view class="goods-box bottom">
|
<view class="goods-box bottom">
|
||||||
<view class="goods-header">
|
<view class="goods-header">
|
||||||
<view class="goods-img">
|
<view class="goods-img">
|
||||||
<u-image width="200rpx" border-radius="20" class="uimage" height="200rpx"
|
<u-image width="200rpx" border-radius="20" class="uimage" height="200rpx"
|
||||||
:src="selectedSpecImg ? selectedSpecImg : goodsDetail.thumbnail"></u-image>
|
:src="selectedSpecImg ? selectedSpecImg : goodsDetail.thumbnail"></u-image>
|
||||||
</view>
|
</view>
|
||||||
<view class="goods-skus">
|
<view class="goods-skus">
|
||||||
<!-- 有活动商品价格 -->
|
<!-- 有活动商品价格 -->
|
||||||
<view class="goods-price " v-if="goodsDetail.promotionPrice">
|
<view class="goods-price"
|
||||||
<span>
|
v-if="goodsDetail.promotionPrice && ((isGroup && buyType === 'PINTUAN') || !isGroup)">
|
||||||
¥
|
<span v-if="goodsDetail.promotionPrice && !pointDetail">
|
||||||
<span class="goods-price-promotionShow goods-price-bigshow"
|
¥
|
||||||
v-if="goodsDetail.promotionPrice">{{ formatPrice(goodsDetail.promotionPrice)[0] }}</span>
|
<span class="goods-price-promotionShow goods-price-bigshow">{{
|
||||||
.{{ formatPrice(goodsDetail.promotionPrice)[1] }}
|
$options.filters.goodsFormatPrice(goodsDetail.promotionPrice)[0]
|
||||||
<span></span>
|
}}</span>
|
||||||
</span>
|
.{{ $options.filters.goodsFormatPrice(goodsDetail.promotionPrice)[1] }}
|
||||||
<div class="promotion-box">
|
</span>
|
||||||
¥
|
<span v-if="pointDetail.points">
|
||||||
<span class="goods-price-bigshow">{{
|
<span class="goods-price-promotionShow goods-price-bigshow">{{
|
||||||
formatPrice(goodsDetail.price)[0]
|
pointDetail.points
|
||||||
}}</span>
|
}}</span>
|
||||||
.{{ formatPrice(goodsDetail.price)[1] }}
|
积分
|
||||||
|
</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>
|
||||||
|
|
||||||
</div>
|
<!-- 正常逻辑 循环出sku -->
|
||||||
</view>
|
<view v-if="!parentOrder" :class="{ active: spec_val.value == currentSelceted[specIndex] }"
|
||||||
<!-- 正常商品的价格 -->
|
class="skus-view-item" v-for="(spec_val, spec_index) in spec.values" :key="spec_index"
|
||||||
<view class="goods-price" v-else>
|
@click="handleClickSpec(spec, specIndex, spec_val)">{{ spec_val.value }}
|
||||||
<span>
|
</view>
|
||||||
¥
|
|
||||||
<span class="goods-price-bigshow">{{
|
|
||||||
formatPrice(goodsDetail.price)[0]
|
|
||||||
}}</span>
|
|
||||||
.{{ formatPrice(goodsDetail.price)[1] }}
|
|
||||||
</span>
|
|
||||||
</view>
|
|
||||||
<view class="goods-check-skus">
|
|
||||||
已选
|
|
||||||
<span class="goods-check-skus-name">
|
|
||||||
{{ selectName }}
|
|
||||||
<span>,{{ num }}个</span>
|
|
||||||
</span>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<!-- 商品信息 -->
|
|
||||||
<view class="goods-skus-box">
|
|
||||||
<!-- 规格 -->
|
|
||||||
<view class="goods-skus-view" :key="specIndex" v-for="(spec, specIndex) in formatList">
|
|
||||||
<view class="skus-view-list">
|
|
||||||
<view class="view-class-title">{{ spec.name }}</view>
|
|
||||||
<view :class="{ active: spec_val.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" :color="numberBox.color" :input-width="numberBox.width"
|
|
||||||
:input-height="numberBox.height" :size="numberBox.size" :min="1" v-model="num">
|
|
||||||
</u-number-box>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<!-- 按钮 -->
|
|
||||||
<view class="btns">
|
|
||||||
|
|
||||||
<view class="box-btn card" v-if="buyType != 'PINTUAN' && goodsDetail.goodsType!='VIRTUAL_GOODS'"
|
<!-- 拼团购买,仅筛选出当前拼团类型商品 -->
|
||||||
@click="addToCartOrBuy('cart')">加入购物车</view>
|
<view v-if="parentOrder && spec_val.skuId == goodsDetail.id"
|
||||||
<view class="box-btn buy" @click="addToCartOrBuy('buy')">立即购买</view>
|
:class="{ active: spec_val.value == currentSelceted[specIndex] }" class="skus-view-item"
|
||||||
</view>
|
v-for="(spec_val, spec_index) in spec.values" :key="spec_index"
|
||||||
</view>
|
@click="handleClickSpec(spec, specIndex, spec_val)">{{ spec_val.value }}
|
||||||
</u-popup>
|
</view>
|
||||||
</div>
|
</view>
|
||||||
|
</view>
|
||||||
|
<!-- 数量 -->
|
||||||
|
<view class="goods-skus-number flex flex-a-c flex-j-sb">
|
||||||
|
<view class="view-class-title">数量</view>
|
||||||
|
|
||||||
|
<u-input class="view-class-input" v-model="num" type="number" />
|
||||||
|
</view>
|
||||||
|
</scroll-view>
|
||||||
|
<!-- 按钮 -->
|
||||||
|
<view class="btns">
|
||||||
|
<view class="box-btn card" v-if="buyType != 'PINTUAN' && goodsDetail.goodsType != 'VIRTUAL_GOODS'"
|
||||||
|
@click="addToCartOrBuy('cart')">加入购物车</view>
|
||||||
|
<view class="box-btn buy" @click="addToCartOrBuy('buy')">立即购买</view>
|
||||||
|
</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";
|
||||||
export default {
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
setup,
|
|
||||||
num: 1,
|
|
||||||
// 步进器的大小尺寸单位是 rpx
|
|
||||||
numberBox: {
|
|
||||||
width: "50",
|
|
||||||
height: "50",
|
|
||||||
size: "22",
|
|
||||||
color: "#333",
|
|
||||||
bgColor: "#fff",
|
|
||||||
},
|
|
||||||
selectName: "", //选中商品的昵称
|
|
||||||
selectSkuList: "", //选中商铺sku,
|
|
||||||
selectedSpecImg: "", //选中的图片路径
|
|
||||||
buyType: "", //用于存储促销,拼团等活动类型
|
|
||||||
parentOrder: "", //父级拼团活动的数据 - 如果是团员则有数据
|
|
||||||
formatList: [],
|
|
||||||
currentSelceted: [],
|
|
||||||
skuList: "",
|
|
||||||
isMask: false, //是否显示遮罩层
|
|
||||||
isClose: false, //是否可以点击遮罩关闭
|
|
||||||
};
|
|
||||||
},
|
|
||||||
props: [
|
|
||||||
"goodsDetail", //商品详情
|
|
||||||
"buyMask",
|
|
||||||
"selectedSku",
|
|
||||||
"goodsSpec",
|
|
||||||
"addr",
|
|
||||||
],
|
|
||||||
watch: {
|
|
||||||
buyType: {
|
|
||||||
handler(val) {
|
|
||||||
this.buyType = val;
|
|
||||||
},
|
|
||||||
immediate: true,
|
|
||||||
},
|
|
||||||
selectSkuList: {
|
|
||||||
handler(val) {
|
|
||||||
this.$emit("changed", val);
|
|
||||||
},
|
|
||||||
deep: true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
|
|
||||||
methods: {
|
export default {
|
||||||
// 格式化金钱 1999 --> [1999,00]
|
data() {
|
||||||
formatPrice(val) {
|
return {
|
||||||
if (typeof val == "undefined") {
|
setup,
|
||||||
return val;
|
num: 1,
|
||||||
}
|
|
||||||
return val.toFixed(2).split(".");
|
selectName: "", //选中商品的昵称
|
||||||
},
|
selectSkuList: "", //选中商铺sku,
|
||||||
|
selectedSpecImg: "", //选中的图片路径
|
||||||
|
buyType: "", //用于存储促销,拼团等活动类型
|
||||||
|
parentOrder: "", //父级拼团活动的数据 - 如果是团员则有数据
|
||||||
|
formatList: [],
|
||||||
|
currentSelceted: [],
|
||||||
|
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){
|
||||||
|
if(val){
|
||||||
|
if(val > this.goodsDetail.quantity){
|
||||||
|
this.val = this.goodsDetail.quantity
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
buyType: {
|
||||||
|
handler(val) {
|
||||||
|
if (val) {
|
||||||
|
this.buyType = val;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
immediate: true,
|
||||||
|
},
|
||||||
|
selectSkuList: {
|
||||||
|
handler(val, oldval) {
|
||||||
|
this.$emit("changed", val);
|
||||||
|
},
|
||||||
|
deep: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
closeMask() {
|
methods: {
|
||||||
this.$emit("closeBuy", false);
|
closeMask() {
|
||||||
},
|
this.$emit("closeBuy", false);
|
||||||
|
},
|
||||||
|
|
||||||
/**点击规格 */
|
/**点击规格 */
|
||||||
handleClickSpec(val, index, specValue) {
|
handleClickSpec(val, index, specValue) {
|
||||||
this.$set(this.currentSelceted, index, specValue.value);
|
this.currentSelceted[index] = specValue.value;
|
||||||
let selectedSkuId = this.goodsSpec.find((i) => {
|
let selectedSkuId = this.goodsSpec.find((i) => {
|
||||||
let matched = true;
|
let matched = true;
|
||||||
let specValues = i.specValues.filter((j) => j.specName !== "images");
|
let specValues = i.specValues.filter((j) => j.specName !== "images");
|
||||||
for (let n = 0; n < specValues.length; n++) {
|
for (let n = 0; n < specValues.length; n++) {
|
||||||
if (specValues[n].specValue !== this.currentSelceted[n]) {
|
if (specValues[n].specValue !== this.currentSelceted[n]) {
|
||||||
matched = false;
|
matched = false;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (matched) {
|
if (matched) {
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
this.selectSkuList = {
|
if (selectedSkuId?.skuId) {
|
||||||
spec: {
|
this.$set(this.currentSelceted, index, specValue.value);
|
||||||
specName: val.name,
|
this.selectSkuList = {
|
||||||
specValue: specValue.value,
|
spec: {
|
||||||
},
|
specName: val.name,
|
||||||
data: this.goodsDetail,
|
specValue: specValue.value,
|
||||||
};
|
},
|
||||||
this.selectName = specValue.value;
|
data: this.goodsDetail,
|
||||||
|
};
|
||||||
|
this.selectName = specValue.value;
|
||||||
|
|
||||||
this.$emit("handleClickSku", {
|
this.$emit("handleClickSku", {
|
||||||
skuId: selectedSkuId.skuId,
|
skuId: selectedSkuId.skuId,
|
||||||
goodsId: this.goodsDetail.goodsId,
|
goodsId: this.goodsDetail.goodsId,
|
||||||
});
|
});
|
||||||
},
|
} else {
|
||||||
|
uni.showToast({
|
||||||
|
title: "暂无该商品!",
|
||||||
|
duration: 2000,
|
||||||
|
icon: "none",
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 添加到购物车或购买
|
* 直接购买
|
||||||
*/
|
*/
|
||||||
addToCartOrBuy(val) {
|
buy(data) {
|
||||||
if (!this.selectSkuList) {
|
API_trade.addToCart(data).then((res) => {
|
||||||
uni.showToast({
|
if (res.data.success) {
|
||||||
title: "请选择规格商品",
|
uni.navigateTo({
|
||||||
icon: "none",
|
url: `/pages/order/fillorder?way=${
|
||||||
});
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
let data = {
|
|
||||||
skuId: this.goodsDetail.id,
|
|
||||||
num: this.num,
|
|
||||||
};
|
|
||||||
|
|
||||||
if (val == "cart") {
|
|
||||||
API_trade.addToCart(data).then((res) => {
|
|
||||||
if (res.data.code == 200) {
|
|
||||||
uni.showToast({
|
|
||||||
title: "商品已添加到购物车",
|
|
||||||
icon: "none",
|
|
||||||
});
|
|
||||||
|
|
||||||
this.$emit("queryCart");
|
|
||||||
this.closeMask();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
// 判断是否拼团商品
|
|
||||||
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({
|
|
||||||
url: `/pages/order/fillorder?way=${data.cartType}&addr=${
|
|
||||||
this.addr.id || ""
|
|
||||||
}&parentOrder=${encodeURIComponent(
|
|
||||||
JSON.stringify(this.parentOrder)
|
|
||||||
)}`,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 直接购买
|
|
||||||
*/
|
|
||||||
buy(data) {
|
|
||||||
API_trade.addToCart(data).then((res) => {
|
|
||||||
if (res.data.success) {
|
|
||||||
uni.navigateTo({
|
|
||||||
url: `/pages/order/fillorder?way=${
|
|
||||||
data.cartType
|
data.cartType
|
||||||
}&addr=${""}&parentOrder=${encodeURIComponent(
|
}&addr=${""}&parentOrder=${encodeURIComponent(
|
||||||
JSON.stringify(this.parentOrder)
|
JSON.stringify(this.parentOrder)
|
||||||
)}`,
|
)}`,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
formatSku(list) {
|
/**
|
||||||
// 格式化数据
|
* 添加到购物车或购买
|
||||||
if (!Array.isArray(list)) return false;
|
*/
|
||||||
let arr = [{}];
|
addToCartOrBuy(val) {
|
||||||
list.forEach((item, index) => {
|
if (!this.selectSkuList) {
|
||||||
item.specValues.forEach((spec, specIndex) => {
|
uni.showToast({
|
||||||
let name = spec.specName;
|
title: "请选择规格商品",
|
||||||
let values = {
|
icon: "none",
|
||||||
value: spec.specValue,
|
});
|
||||||
quantity: item.quantity,
|
return;
|
||||||
};
|
}
|
||||||
if (name === "images") {
|
let data = {
|
||||||
return;
|
skuId: this.goodsDetail.id,
|
||||||
}
|
num: this.num,
|
||||||
|
};
|
||||||
|
|
||||||
arr.forEach((arrItem, arrIndex) => {
|
if (val == "cart") {
|
||||||
if (
|
API_trade.addToCart(data).then((res) => {
|
||||||
arrItem.name == name &&
|
if (res.data.code == 200) {
|
||||||
arrItem.values &&
|
uni.showToast({
|
||||||
!arrItem.values.find((i) => i.value === values.value)
|
title: "商品已添加到购物车",
|
||||||
) {
|
icon: "none",
|
||||||
arrItem.values.push(values);
|
});
|
||||||
}
|
|
||||||
|
|
||||||
let keys = arr.map((key) => {
|
this.$emit("queryCart");
|
||||||
return key.name;
|
this.closeMask();
|
||||||
});
|
}
|
||||||
if (!keys.includes(name)) {
|
});
|
||||||
arr.push({
|
} else {
|
||||||
name: name,
|
// 判断是否拼团商品
|
||||||
values: [values],
|
if (this.buyType) {
|
||||||
});
|
data.cartType = "PINTUAN";
|
||||||
}
|
} else if (this.goodsDetail.goodsType == "VIRTUAL_GOODS") {
|
||||||
});
|
data.cartType = "VIRTUAL";
|
||||||
});
|
} else {
|
||||||
});
|
data.cartType = "BUY_NOW";
|
||||||
arr.shift();
|
}
|
||||||
this.formatList = arr;
|
|
||||||
|
|
||||||
list.forEach((item) => {
|
API_trade.addToCart(data).then((res) => {
|
||||||
if (item.skuId === this.goodsDetail.id) {
|
if (res.data.code == 200) {
|
||||||
item.specValues
|
uni.navigateTo({
|
||||||
.filter((i) => i.specName !== "images")
|
url: `/pages/order/fillorder?way=${data.cartType}&addr=${
|
||||||
.forEach((value, _index) => {
|
this.addr.id || ""
|
||||||
this.currentSelceted[_index] = value.specValue;
|
}&parentOrder=${encodeURIComponent(JSON.stringify(this.parentOrder))}`,
|
||||||
this.selectName = value.specValue;
|
});
|
||||||
this.selectSkuList = {
|
}
|
||||||
spec: value,
|
});
|
||||||
data: this.goodsDetail,
|
}
|
||||||
};
|
},
|
||||||
});
|
formatSku(list) {
|
||||||
}
|
// 格式化数据
|
||||||
});
|
let arr = [{}];
|
||||||
|
|
||||||
this.skuList = list;
|
if (!Array.isArray(list)) {
|
||||||
},
|
return false
|
||||||
},
|
}
|
||||||
|
list.forEach((item, index) => {
|
||||||
|
item.specValues.forEach((spec, specIndex) => {
|
||||||
|
let name = spec.specName;
|
||||||
|
let values = {
|
||||||
|
value: spec.specValue,
|
||||||
|
quantity: item.quantity,
|
||||||
|
skuId: item.skuId,
|
||||||
|
};
|
||||||
|
if (name === "images") {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
mounted() {
|
arr.forEach((arrItem, arrIndex) => {
|
||||||
this.formatSku(this.goodsSpec);
|
if (
|
||||||
|
arrItem.name == name &&
|
||||||
|
arrItem.values &&
|
||||||
|
!arrItem.values.find((i) => {
|
||||||
|
return i.value === values.value;
|
||||||
|
})
|
||||||
|
) {
|
||||||
|
arrItem.values.push(values);
|
||||||
|
}
|
||||||
|
|
||||||
console.log(this.goodsDetail);
|
let keys = arr.map((key) => {
|
||||||
},
|
return key.name;
|
||||||
};
|
});
|
||||||
|
if (!keys.includes(name)) {
|
||||||
|
arr.push({
|
||||||
|
name: name,
|
||||||
|
values: [values],
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
arr.shift();
|
||||||
|
this.formatList = arr;
|
||||||
|
|
||||||
|
list.forEach((item) => {
|
||||||
|
// 默认选中
|
||||||
|
if (item.skuId === this.goodsDetail.id) {
|
||||||
|
item.specValues
|
||||||
|
.filter((i) => i.specName !== "images")
|
||||||
|
.forEach((value, _index) => {
|
||||||
|
this.currentSelceted[_index] = value.specValue;
|
||||||
|
|
||||||
|
this.selectName = value.specValue;
|
||||||
|
|
||||||
|
this.selectSkuList = {
|
||||||
|
spec: value,
|
||||||
|
data: this.goodsDetail,
|
||||||
|
};
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
this.skuList = list;
|
||||||
|
// console.log(" this.skuList", this.skuList)
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
mounted() {
|
||||||
|
this.formatSku(this.goodsSpec);
|
||||||
|
},
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
@import "./popup.scss";
|
@import "./popup.scss";
|
||||||
|
.price-row{
|
||||||
|
text-align: center;
|
||||||
|
|
||||||
|
}
|
||||||
|
.buy {
|
||||||
|
background-image: linear-gradient(135deg, #ffba0d, #ffc30d 69%, #ffcf0d);
|
||||||
|
box-shadow: 0 2px 6px 0 rgba(255, 65, 66, 0.2);
|
||||||
|
}
|
||||||
|
|
||||||
.buy {
|
.card {
|
||||||
background-image: linear-gradient(135deg, #ffba0d, #ffc30d 69%, #ffcf0d);
|
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);
|
||||||
}
|
}
|
||||||
|
|
||||||
.card {
|
/deep/.u-icon-plus,
|
||||||
background-image: linear-gradient(135deg, #f2140c, #f2270c 70%, #f24d0c);
|
.u-icon-minus,
|
||||||
box-shadow: 0 2px 6px 0 rgba(255, 65, 66, 0.2);
|
.u-icon-disabled {
|
||||||
}
|
height: 30rpx !important;
|
||||||
|
background: #fff !important;
|
||||||
|
}
|
||||||
|
|
||||||
/deep/.u-icon-plus,
|
.goods-skus-number {
|
||||||
.u-icon-minus,
|
justify-content: space-between;
|
||||||
.u-icon-disabled {
|
display: flex;
|
||||||
height: 30rpx !important;
|
|
||||||
background: #fff !important;
|
>.view-class-title{
|
||||||
}
|
flex: 8;
|
||||||
|
}
|
||||||
|
>.view-class-input{
|
||||||
|
flex:1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.goods-skus-number {
|
/deep/ .uni-scroll-view {
|
||||||
justify-content: space-between;
|
overflow: hidden !important;
|
||||||
display: flex;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/deep/ .uni-scroll-view {
|
.active {
|
||||||
overflow: hidden !important;
|
background: $price-light-color !important;
|
||||||
}
|
border: 2rpx solid $price-color;
|
||||||
|
font-weight: bold;
|
||||||
|
color: $price-color !important;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
.active {
|
.goods-skus-box {
|
||||||
background: $price-light-color !important;
|
overflow-y: auto;
|
||||||
border: 2rpx solid $price-color;
|
height: 610rpx;
|
||||||
font-weight: bold;
|
// #ifdef MP-WEIXIN
|
||||||
color: $price-color !important;
|
height: 570rpx;
|
||||||
box-sizing: border-box;
|
// #endif
|
||||||
}
|
margin-bottom: 10rpx;
|
||||||
|
}
|
||||||
|
|
||||||
.goods-skus-box {
|
.goods-skus-view {
|
||||||
overflow-y: auto;
|
overflow: hidden;
|
||||||
height: 610rpx;
|
|
||||||
// #ifdef MP-WEIXIN
|
|
||||||
height: 570rpx;
|
|
||||||
// #endif
|
|
||||||
margin-bottom: 10rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.goods-skus-view {
|
.skus-view-list {
|
||||||
overflow: hidden;
|
>.skus-view-item {
|
||||||
|
flex: 1;
|
||||||
|
padding: 0 36rpx;
|
||||||
|
|
||||||
.skus-view-list {
|
overflow: hidden;
|
||||||
> .skus-view-item {
|
height: 60rpx;
|
||||||
flex: 1;
|
line-height: 60rpx;
|
||||||
padding: 0 36rpx;
|
float: left;
|
||||||
|
text-align: center;
|
||||||
|
margin-left: 24rpx;
|
||||||
|
margin-bottom: 20rpx;
|
||||||
|
font-size: 22rpx;
|
||||||
|
color: #262626;
|
||||||
|
background: #f2f2f2;
|
||||||
|
border-radius: 30rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.wholesale-item{
|
||||||
|
color: #999 !important;
|
||||||
|
font-size: 24rpx;
|
||||||
|
margin:0 20rpx;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
overflow: hidden;
|
.goods-header {
|
||||||
height: 60rpx;
|
height: 200rpx;
|
||||||
line-height: 60rpx;
|
display: flex;
|
||||||
float: left;
|
align-items: center;
|
||||||
text-align: center;
|
margin-bottom: 36rpx;
|
||||||
margin-left: 24rpx;
|
}
|
||||||
margin-bottom: 20rpx;
|
|
||||||
font-size: 22rpx;
|
|
||||||
color: #262626;
|
|
||||||
background: #f2f2f2;
|
|
||||||
border-radius: 30rpx;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.goods-header {
|
.goods-box {
|
||||||
height: 200rpx;
|
padding: 50rpx 36rpx 0 36rpx;
|
||||||
display: flex;
|
}
|
||||||
align-items: center;
|
|
||||||
margin-bottom: 36rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.goods-box {
|
.goods-skus {
|
||||||
padding: 50rpx 36rpx 0 36rpx;
|
padding: 0 20rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.goods-skus {
|
.goods-price {
|
||||||
padding: 0 20rpx;
|
color: $price-color;
|
||||||
}
|
line-height: 80rpx;
|
||||||
|
margin-right: 20rpx;
|
||||||
|
>* {
|
||||||
|
color: $price-color;
|
||||||
|
line-height: 80rpx;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.goods-price {
|
.promotion-box {
|
||||||
color: $price-color;
|
line-height: 1;
|
||||||
line-height: 80rpx;
|
display: flex;
|
||||||
display: flex;
|
align-items: center;
|
||||||
}
|
text-decoration: line-through;
|
||||||
.promotion-box {
|
color: #999;
|
||||||
line-height: 1;
|
margin-left: 10rpx;
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
/deep/ span {
|
||||||
text-decoration: line-through;
|
font-size: 30rpx;
|
||||||
color: #999;
|
}
|
||||||
margin-left: 10rpx;
|
}
|
||||||
/deep/ span {
|
|
||||||
font-size: 30rpx;
|
.promotion {
|
||||||
}
|
font-size: 30rpx;
|
||||||
}
|
}
|
||||||
.promotion {
|
|
||||||
font-size: 30rpx;
|
.goods-price-promotionShow {
|
||||||
}
|
font-size: 48rpx;
|
||||||
.goods-price-promotionShow {
|
}
|
||||||
font-size: 48rpx;
|
|
||||||
}
|
.goods-check-skus {
|
||||||
.goods-check-skus {
|
font-size: 24rpx;
|
||||||
font-size: 24rpx;
|
color: #999;
|
||||||
color: #999;
|
|
||||||
> .goods-check-skus-name {
|
>.goods-check-skus-name {
|
||||||
margin-left: 4rpx;
|
margin-left: 4rpx;
|
||||||
}
|
}
|
||||||
> span {
|
|
||||||
color: #333;
|
>span {
|
||||||
}
|
color: #333;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -200,7 +200,7 @@ export default {
|
|||||||
this.tabCurrentIndex++;
|
this.tabCurrentIndex++;
|
||||||
|
|
||||||
// 当前距离重新为最上面
|
// 当前距离重新为最上面
|
||||||
this.scrollTop = 0;
|
this.$set(this,'scrollTop',0)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
this.$emit("funcValue", this.tabbars);
|
this.$emit("funcValue", this.tabbars);
|
||||||
|
|||||||
11
components/m-goods-list/README.md
Normal file
11
components/m-goods-list/README.md
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
## 商品列表展示
|
||||||
|
|
||||||
|
### OBJECT 参数说明
|
||||||
|
|
||||||
|
| 属性 | 说明 | 类型 | 必填 |
|
||||||
|
| ----------- | ---------------------------------------------------------- | ------- | ---- |
|
||||||
|
| `res` | 显示数据 | Array | 是 |
|
||||||
|
| `type` | 商品展示类型 oneColumns twoColumns ,默认展示一行两列商品 | String | 否 |
|
||||||
|
| `storeName` | 是否展示店铺名称,默认展示 | Boolean | 否 |
|
||||||
|
| `keywords` | 高亮展示搜索内容 | String | 否 |
|
||||||
|
|
||||||
276
components/m-goods-list/base-list.vue
Normal file
276
components/m-goods-list/base-list.vue
Normal file
@@ -0,0 +1,276 @@
|
|||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<!-- 一行两列商品展示 -->
|
||||||
|
<view class="goods-list" v-if="type == 'twoColumns'">
|
||||||
|
<view v-for="(item, index) in res" :key="index" class="goods-item">
|
||||||
|
<view class="image-wrapper" @click="navigateToDetailPage(item)">
|
||||||
|
<u-image
|
||||||
|
:src="item.thumbnail"
|
||||||
|
width="100%"
|
||||||
|
height="330rpx"
|
||||||
|
mode="aspectFill"
|
||||||
|
>
|
||||||
|
<u-loading slot="loading"></u-loading>
|
||||||
|
</u-image>
|
||||||
|
</view>
|
||||||
|
<view class="goods-detail">
|
||||||
|
<div
|
||||||
|
class="title clamp"
|
||||||
|
v-html="lightSearchStr(keyword, item.goodsName)"
|
||||||
|
@click="navigateToDetailPage(item)"
|
||||||
|
></div>
|
||||||
|
<view class="price-box" @click="navigateToDetailPage(item)">
|
||||||
|
<div class="price" v-if="item.price != undefined">
|
||||||
|
¥<span
|
||||||
|
>{{
|
||||||
|
$options.filters.goodsFormatPrice(item.price)[0]
|
||||||
|
}} </span
|
||||||
|
>.{{ $options.filters.goodsFormatPrice(item.price)[1] }}
|
||||||
|
</div>
|
||||||
|
</view>
|
||||||
|
<div class="count-config" @click="navigateToDetailPage(item)">
|
||||||
|
<span>已售 {{ item.buyCount || "0" }}</span>
|
||||||
|
<span>{{ item.commentNum || "0" }}条评论</span>
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
class="store-seller-name"
|
||||||
|
v-if="storeName"
|
||||||
|
@click="navigateToStoreDetailPage(item)"
|
||||||
|
>
|
||||||
|
<div class="text-hidden">
|
||||||
|
<u-tag
|
||||||
|
style="margin-right: 10rpx"
|
||||||
|
size="mini"
|
||||||
|
mode="dark"
|
||||||
|
v-if="item.selfOperated"
|
||||||
|
text="自营"
|
||||||
|
type="error"
|
||||||
|
/>
|
||||||
|
<span>{{ item.storeName || "暂无" }}</span>
|
||||||
|
</div>
|
||||||
|
<span>
|
||||||
|
<u-icon name="arrow-right"></u-icon>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<!-- 一行一列商品展示 -->
|
||||||
|
<div v-if="type == 'oneColumns'">
|
||||||
|
<div v-for="(item, index) in res" :key="index" class="goods-row">
|
||||||
|
<div class="flex goods-col">
|
||||||
|
<div class="goods-img" @click="navigateToDetailPage(item)">
|
||||||
|
<u-image
|
||||||
|
width="230rpx"
|
||||||
|
border-radius="16"
|
||||||
|
height="230rpx"
|
||||||
|
:src="item.goodsImage || item.thumbnail"
|
||||||
|
>
|
||||||
|
<u-loading slot="loading"></u-loading>
|
||||||
|
</u-image>
|
||||||
|
</div>
|
||||||
|
<div class="goods-detail">
|
||||||
|
<div class="title clamp3" @click="navigateToDetailPage(item)">
|
||||||
|
{{ item.goodsName }}
|
||||||
|
</div>
|
||||||
|
<view class="price-box" @click="navigateToDetailPage(item)">
|
||||||
|
<div class="price" v-if="item.price != undefined">
|
||||||
|
¥<span
|
||||||
|
>{{ $options.filters.goodsFormatPrice(item.price)[0] }} </span
|
||||||
|
>.{{ $options.filters.goodsFormatPrice(item.price)[1] }}
|
||||||
|
</div>
|
||||||
|
</view>
|
||||||
|
<div class="promotion" @click="navigateToDetailPage(item)">
|
||||||
|
<div v-if="item.salesModel == 'WHOLESALE'">
|
||||||
|
<span>批</span>
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
v-for="(promotionItem, promotionIndex) in getPromotion(item)"
|
||||||
|
:key="promotionIndex"
|
||||||
|
>
|
||||||
|
<span v-if="promotionItem.indexOf('COUPON') != -1">劵</span>
|
||||||
|
<span v-if="promotionItem.indexOf('FULL_DISCOUNT') != -1"
|
||||||
|
>满减</span
|
||||||
|
>
|
||||||
|
<span v-if="promotionItem.indexOf('SECKILL') != -1">秒杀</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
style="overflow: hidden"
|
||||||
|
@click="navigateToDetailPage(item)"
|
||||||
|
class="count-config"
|
||||||
|
>
|
||||||
|
<span style="float: left; font-size: 22rpx"
|
||||||
|
>已售 {{ item.buyCount || "0" }}</span
|
||||||
|
>
|
||||||
|
<span style="float: right; font-size: 22rpx"
|
||||||
|
>{{ item.commentNum || "0" }}条评论</span
|
||||||
|
>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import commonTpl from "@/components/m-goods-list/common";
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
lightColor: this.$mainColor,
|
||||||
|
};
|
||||||
|
},
|
||||||
|
mixins: [commonTpl],
|
||||||
|
props: {
|
||||||
|
// 展示的类型
|
||||||
|
type:{
|
||||||
|
type:String,
|
||||||
|
default:"oneColumns"
|
||||||
|
},
|
||||||
|
// 遍历的数据
|
||||||
|
res: {
|
||||||
|
type: Array,
|
||||||
|
default: () => {
|
||||||
|
return [];
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
// 跳转到商品详情
|
||||||
|
navigateToDetailPage(item) {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: `/pages/product/goods?id=${item.id}&goodsId=${item.goodsId}`,
|
||||||
|
});
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.goods-list {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
margin: 10rpx 20rpx 284rpx;
|
||||||
|
width: 100%;
|
||||||
|
|
||||||
|
> .goods-item {
|
||||||
|
background-color: #ffffff;
|
||||||
|
display: flex;
|
||||||
|
border-radius: 16rpx;
|
||||||
|
flex-direction: column;
|
||||||
|
width: calc(50% - 30rpx);
|
||||||
|
margin-bottom: 20rpx;
|
||||||
|
padding-bottom: 20rpx;
|
||||||
|
|
||||||
|
&:nth-child(2n + 1) {
|
||||||
|
margin-right: 20rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.image-wrapper {
|
||||||
|
width: 100%;
|
||||||
|
height: 330rpx;
|
||||||
|
border-radius: 16rpx 16rpx 0 0;
|
||||||
|
overflow: hidden;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.count-config,
|
||||||
|
.store-seller-name {
|
||||||
|
font-size: $font-sm;
|
||||||
|
}
|
||||||
|
|
||||||
|
.text-hidden {
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.goods-row {
|
||||||
|
background: #fff;
|
||||||
|
padding: 16rpx;
|
||||||
|
|
||||||
|
> .goods-col {
|
||||||
|
display: flex;
|
||||||
|
|
||||||
|
> .goods-img {
|
||||||
|
overflow: hidden;
|
||||||
|
flex: 4;
|
||||||
|
}
|
||||||
|
|
||||||
|
> .goods-detail {
|
||||||
|
flex: 7;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.goods-detail {
|
||||||
|
margin: 0 20rpx;
|
||||||
|
|
||||||
|
> .title {
|
||||||
|
font-size: $font-base;
|
||||||
|
color: $font-color-dark;
|
||||||
|
line-height: 1.5;
|
||||||
|
height: 86rpx;
|
||||||
|
padding: 10rpx 0 0;
|
||||||
|
display: -webkit-box;
|
||||||
|
-webkit-box-orient: vertical;
|
||||||
|
-webkit-line-clamp: 2;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
.promotion {
|
||||||
|
margin-top: 4rpx;
|
||||||
|
display: flex;
|
||||||
|
|
||||||
|
div {
|
||||||
|
span {
|
||||||
|
font-size: 24rpx;
|
||||||
|
color: $light-color;
|
||||||
|
margin-right: 10rpx;
|
||||||
|
padding: 0 4rpx;
|
||||||
|
border-radius: 2rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.store-seller-name {
|
||||||
|
color: #666;
|
||||||
|
overflow: hidden;
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
}
|
||||||
|
|
||||||
|
.count-config {
|
||||||
|
padding: 5rpx 0;
|
||||||
|
color: #666;
|
||||||
|
display: flex;
|
||||||
|
font-size: 24rpx;
|
||||||
|
justify-content: space-between;
|
||||||
|
}
|
||||||
|
|
||||||
|
> .price-box {
|
||||||
|
margin-top: 10rpx;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
padding-right: 10rpx;
|
||||||
|
font-size: 24rpx;
|
||||||
|
color: $font-color-light;
|
||||||
|
|
||||||
|
> .price {
|
||||||
|
font-size: 26rpx;
|
||||||
|
line-height: 1;
|
||||||
|
color: $main-color;
|
||||||
|
font-weight: bold;
|
||||||
|
|
||||||
|
/deep/ span:nth-of-type(1) {
|
||||||
|
font-size: 38rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
69
components/m-goods-list/common.vue
Normal file
69
components/m-goods-list/common.vue
Normal file
@@ -0,0 +1,69 @@
|
|||||||
|
<template>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
methods: {
|
||||||
|
// 高亮显示搜索内容
|
||||||
|
lightSearchStr(keyword, str) {
|
||||||
|
if (!keyword) {
|
||||||
|
return str
|
||||||
|
} else {
|
||||||
|
let unicodes = '';
|
||||||
|
for (let i of Array.from(keyword)) {
|
||||||
|
unicodes += this.unicode(i) + "|"
|
||||||
|
}
|
||||||
|
const rule = '(' + unicodes + ')'
|
||||||
|
const reg = new RegExp(rule, 'gi');
|
||||||
|
return str ? str.replace(reg, matchValue =>
|
||||||
|
`<span style="color:${this.lightColor}">${matchValue}</span>`
|
||||||
|
) : ''
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 转换为unicode
|
||||||
|
unicode(str) {
|
||||||
|
var value = '';
|
||||||
|
for (var i = 0; i < str.length; i++) {
|
||||||
|
value += '\\u' + this.left_zero_4(parseInt(str.charCodeAt(i)).toString(16));
|
||||||
|
}
|
||||||
|
return value;
|
||||||
|
},
|
||||||
|
left_zero_4(str) {
|
||||||
|
if (str != null && str != '' && str != 'undefined') {
|
||||||
|
if (str.length == 2) {
|
||||||
|
return '00' + str;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return str;
|
||||||
|
},
|
||||||
|
// 数据去重一下 只显示一次 减免 劵 什么的
|
||||||
|
getPromotion(item) {
|
||||||
|
if (item.promotionMap) {
|
||||||
|
let array = [];
|
||||||
|
Object.keys(item.promotionMap).forEach((child) => {
|
||||||
|
if (!array.includes(child.split("-")[0])) {
|
||||||
|
array.push(child.split("-")[0]);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return array;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 跳转到商品详情
|
||||||
|
navigateToDetailPage(item) {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: `/pages/product/goods?id=${item.content.id}&goodsId=${item.content.goodsId}`,
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 跳转地址
|
||||||
|
navigateToStoreDetailPage(item) {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: `/pages/product/shopPage?id=${item.content.storeId}`,
|
||||||
|
});
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang='scss' scoped>
|
||||||
|
|
||||||
|
</style>
|
||||||
337
components/m-goods-list/list.vue
Normal file
337
components/m-goods-list/list.vue
Normal file
@@ -0,0 +1,337 @@
|
|||||||
|
<template>
|
||||||
|
<view>
|
||||||
|
<!-- 一行两列商品展示 -->
|
||||||
|
<view class="goods-list" v-if="type == 'twoColumns'">
|
||||||
|
<view v-for="(item, index) in res" :key="index" class="goods-item">
|
||||||
|
<view class="image-wrapper" @click="navigateToDetailPage(item)">
|
||||||
|
<u-image :src="item.content.thumbnail" width="100%" height='330rpx' mode="aspectFill">
|
||||||
|
<u-loading slot="loading"></u-loading>
|
||||||
|
</u-image>
|
||||||
|
</view>
|
||||||
|
<view class="goods-detail">
|
||||||
|
<div class="title clamp" v-html="lightSearchStr(keyword,item.content.goodsName)"
|
||||||
|
@click="navigateToDetailPage(item)">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<view class="price-box" @click="navigateToDetailPage(item)">
|
||||||
|
<div class="price" v-if="item.content.price!=undefined">
|
||||||
|
¥<span>{{ $options.filters.goodsFormatPrice(item.content.price )[0] }} </span>.{{
|
||||||
|
$options.filters.goodsFormatPrice(item.content.price )[1]
|
||||||
|
}}
|
||||||
|
</div>
|
||||||
|
</view>
|
||||||
|
<div class="promotion" @click="navigateToDetailPage(item)">
|
||||||
|
<div v-if="item.content.salesModel == 'WHOLESALE'">
|
||||||
|
<span>批</span>
|
||||||
|
</div>
|
||||||
|
<div v-for="(promotionItem,promotionIndex) in getPromotion(item)" :key="promotionIndex">
|
||||||
|
<span v-if="promotionItem.indexOf('COUPON') != -1">劵</span>
|
||||||
|
<span v-if="promotionItem.indexOf('FULL_DISCOUNT') != -1">满减</span>
|
||||||
|
<span v-if="promotionItem.indexOf('SECKILL') != -1">秒杀</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="count-config" @click="navigateToDetailPage(item)">
|
||||||
|
<span>已售 {{ item.content.buyCount || "0" }}</span>
|
||||||
|
<span>{{ item.content.commentNum || "0" }}条评论</span>
|
||||||
|
</div>
|
||||||
|
<div class="store-seller-name" v-if="storeName" @click="navigateToStoreDetailPage(item)">
|
||||||
|
<div class="text-hidden">
|
||||||
|
<u-tag style="margin-right: 10rpx" size="mini" mode="dark" v-if="item.selfOperated"
|
||||||
|
text="自营" type="error" />
|
||||||
|
<span>{{ item.content.storeName || "暂无" }}</span>
|
||||||
|
</div>
|
||||||
|
<span>
|
||||||
|
<u-icon name="arrow-right"></u-icon>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<!-- 一行一列商品展示 -->
|
||||||
|
<div v-if="type == 'oneColumns'">
|
||||||
|
<div v-for="(item, index) in res" :key="index" class="goods-row">
|
||||||
|
<div class="flex goods-col">
|
||||||
|
<div class="goods-img" @click="navigateToDetailPage(item)">
|
||||||
|
<u-image width="230rpx" border-radius='16' height="230rpx" :src="item.content.thumbnail">
|
||||||
|
<u-loading slot="loading"></u-loading>
|
||||||
|
</u-image>
|
||||||
|
</div>
|
||||||
|
<div class="goods-detail">
|
||||||
|
<div class="title clamp3" @click="navigateToDetailPage(item)">{{ item.content.goodsName }}</div>
|
||||||
|
<view class="price-box" @click="navigateToDetailPage(item)">
|
||||||
|
<div class="price" v-if="item.content.price!=undefined">
|
||||||
|
¥<span>{{ $options.filters.goodsFormatPrice(item.content.price )[0] }} </span>.{{
|
||||||
|
$options.filters.goodsFormatPrice(item.content.price )[1]
|
||||||
|
}}
|
||||||
|
</div>
|
||||||
|
</view>
|
||||||
|
<div class="promotion" @click="navigateToDetailPage(item)">
|
||||||
|
<div v-if="item.content.salesModel == 'WHOLESALE'">
|
||||||
|
<span>批</span>
|
||||||
|
</div>
|
||||||
|
<div v-for="(promotionItem,promotionIndex) in getPromotion(item)" :key="promotionIndex">
|
||||||
|
<span v-if="promotionItem.indexOf('COUPON') != -1">劵</span>
|
||||||
|
<span v-if="promotionItem.indexOf('FULL_DISCOUNT') != -1">满减</span>
|
||||||
|
<span v-if="promotionItem.indexOf('SECKILL') != -1">秒杀</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div style="overflow: hidden" @click="navigateToDetailPage(item)" class="count-config">
|
||||||
|
<span style="float: left; font-size: 22rpx">已售 {{ item.content.buyCount || '0' }}</span>
|
||||||
|
<span style="float: right; font-size: 22rpx">{{ item.content.commentNum || '0' }}条评论</span>
|
||||||
|
</div>
|
||||||
|
<div style="overflow: hidden" @click="navigateToStoreDetailPage(item)" class="count-config">
|
||||||
|
<div class="text-hidden" v-if="storeName">
|
||||||
|
<u-tag style="margin-right: 10rpx" size="mini" mode="dark" v-if="item.selfOperated"
|
||||||
|
text="自营" type="error" />
|
||||||
|
<span class="line1-store-name">{{ item.content.storeName }}</span>
|
||||||
|
<span class="to-store">进店<u-icon size="24" name="arrow-right" color="#666"></u-icon>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<span>
|
||||||
|
<u-icon name="arrow-right" color="#c5c5c5"></u-icon>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import commonTpl from '@/components/m-goods-list/common'
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
lightColor: this.$mainColor
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mixins: [commonTpl],
|
||||||
|
|
||||||
|
props: {
|
||||||
|
// 遍历的数据
|
||||||
|
res: {
|
||||||
|
type: Array,
|
||||||
|
default: () => {
|
||||||
|
return []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 一行两列还是一行一列显示
|
||||||
|
type: {
|
||||||
|
type: String,
|
||||||
|
default: 'twoColumns',
|
||||||
|
validator() {
|
||||||
|
return ['twoColumns', 'oneColumns']
|
||||||
|
}
|
||||||
|
},
|
||||||
|
storeName: {
|
||||||
|
type: Boolean,
|
||||||
|
default: true
|
||||||
|
},
|
||||||
|
keyword: {
|
||||||
|
type: null,
|
||||||
|
default: ''
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
keyword(val) {
|
||||||
|
if (val) {
|
||||||
|
this.lightSearchStr(val)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
|
||||||
|
// 高亮显示搜索内容
|
||||||
|
lightSearchStr(keyword, str) {
|
||||||
|
if (!keyword) {
|
||||||
|
return str
|
||||||
|
} else {
|
||||||
|
let unicodes = '';
|
||||||
|
for (let i of Array.from(keyword)) {
|
||||||
|
unicodes += this.unicode(i) + "|"
|
||||||
|
}
|
||||||
|
const rule = '(' + unicodes + ')'
|
||||||
|
const reg = new RegExp(rule, 'gi');
|
||||||
|
return str ? str.replace(reg, matchValue =>
|
||||||
|
`<span style="color:${this.lightColor}">${matchValue}</span>`
|
||||||
|
) : ''
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 转换为unicode
|
||||||
|
unicode(str) {
|
||||||
|
var value = '';
|
||||||
|
for (var i = 0; i < str.length; i++) {
|
||||||
|
value += '\\u' + this.left_zero_4(parseInt(str.charCodeAt(i)).toString(16));
|
||||||
|
}
|
||||||
|
return value;
|
||||||
|
},
|
||||||
|
left_zero_4(str) {
|
||||||
|
if (str != null && str != '' && str != 'undefined') {
|
||||||
|
if (str.length == 2) {
|
||||||
|
return '00' + str;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return str;
|
||||||
|
},
|
||||||
|
// 数据去重一下 只显示一次 减免 劵 什么的
|
||||||
|
getPromotion(item) {
|
||||||
|
if (item.promotionMap) {
|
||||||
|
let array = [];
|
||||||
|
Object.keys(item.promotionMap).forEach((child) => {
|
||||||
|
if (!array.includes(child.split("-")[0])) {
|
||||||
|
array.push(child.split("-")[0]);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return array;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 跳转到商品详情
|
||||||
|
navigateToDetailPage(item) {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: `/pages/product/goods?id=${item.content.id}&goodsId=${item.content.goodsId}`,
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 跳转地址
|
||||||
|
navigateToStoreDetailPage(item) {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: `/pages/product/shopPage?id=${item.content.storeId}`,
|
||||||
|
});
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang='scss' scoped>
|
||||||
|
/* 商品列表 */
|
||||||
|
.goods-list {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
margin: 10rpx 20rpx 284rpx;
|
||||||
|
width: 100%;
|
||||||
|
|
||||||
|
>.goods-item {
|
||||||
|
background-color: #ffffff;
|
||||||
|
display: flex;
|
||||||
|
border-radius: 16rpx;
|
||||||
|
flex-direction: column;
|
||||||
|
width: calc(50% - 30rpx);
|
||||||
|
margin-bottom: 20rpx;
|
||||||
|
padding-bottom: 20rpx;
|
||||||
|
|
||||||
|
&:nth-child(2n + 1) {
|
||||||
|
margin-right: 20rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.image-wrapper {
|
||||||
|
width: 100%;
|
||||||
|
height: 330rpx;
|
||||||
|
border-radius: 16rpx 16rpx 0 0;
|
||||||
|
overflow: hidden;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.count-config,
|
||||||
|
.store-seller-name {
|
||||||
|
font-size: $font-sm;
|
||||||
|
}
|
||||||
|
|
||||||
|
.text-hidden {
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.goods-row {
|
||||||
|
background: #fff;
|
||||||
|
padding: 16rpx;
|
||||||
|
|
||||||
|
>.goods-col {
|
||||||
|
display: flex;
|
||||||
|
|
||||||
|
>.goods-img {
|
||||||
|
overflow: hidden;
|
||||||
|
flex: 4;
|
||||||
|
}
|
||||||
|
|
||||||
|
>.goods-detail {
|
||||||
|
flex: 7;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.goods-detail {
|
||||||
|
margin: 0 20rpx;
|
||||||
|
|
||||||
|
>.title {
|
||||||
|
font-size: $font-base;
|
||||||
|
color: $font-color-dark;
|
||||||
|
line-height: 1.5;
|
||||||
|
height: 86rpx;
|
||||||
|
padding: 10rpx 0 0;
|
||||||
|
display: -webkit-box;
|
||||||
|
-webkit-box-orient: vertical;
|
||||||
|
-webkit-line-clamp: 2;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
.promotion {
|
||||||
|
margin-top: 4rpx;
|
||||||
|
display: flex;
|
||||||
|
|
||||||
|
div {
|
||||||
|
span {
|
||||||
|
font-size: 24rpx;
|
||||||
|
color: $light-color;
|
||||||
|
margin-right: 10rpx;
|
||||||
|
padding: 0 4rpx;
|
||||||
|
border-radius: 2rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.store-seller-name {
|
||||||
|
color: #666;
|
||||||
|
overflow: hidden;
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
}
|
||||||
|
|
||||||
|
.count-config {
|
||||||
|
padding: 5rpx 0;
|
||||||
|
color: #666;
|
||||||
|
display: flex;
|
||||||
|
font-size: 24rpx;
|
||||||
|
justify-content: space-between;
|
||||||
|
}
|
||||||
|
|
||||||
|
>.price-box {
|
||||||
|
margin-top: 10rpx;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
padding-right: 10rpx;
|
||||||
|
font-size: 24rpx;
|
||||||
|
color: $font-color-light;
|
||||||
|
|
||||||
|
>.price {
|
||||||
|
font-size: 26rpx;
|
||||||
|
line-height: 1;
|
||||||
|
color: $main-color;
|
||||||
|
font-weight: bold;
|
||||||
|
|
||||||
|
/deep/ span:nth-of-type(1) {
|
||||||
|
font-size: 38rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
</style>
|
||||||
166
components/m-goods-list/promotion.vue
Normal file
166
components/m-goods-list/promotion.vue
Normal file
@@ -0,0 +1,166 @@
|
|||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<div v-for="(item, index) in res" :key="index" class="goods-row" @click="navigateToDetailPage(item)">
|
||||||
|
<div class="flex goods-col">
|
||||||
|
<div class="goods-img">
|
||||||
|
<u-image width="230rpx" border-radius='16' height="230rpx" :src="item.goodsImage || item.thumbnail">
|
||||||
|
<u-loading slot="loading"></u-loading>
|
||||||
|
</u-image>
|
||||||
|
</div>
|
||||||
|
<div class="goods-detail">
|
||||||
|
<div class="title clamp3">{{ item.goodsName }}</div>
|
||||||
|
<div class='flex flex-a-c flex-j-sb'>
|
||||||
|
<view class="price-box">
|
||||||
|
<!-- 秒杀 / 拼团 -->
|
||||||
|
<div class="price" v-if="!type && item.price!=undefined">
|
||||||
|
¥<span>{{ $options.filters.goodsFormatPrice(item.price )[0] }} </span>.{{
|
||||||
|
$options.filters.goodsFormatPrice(item.price )[1]
|
||||||
|
}}
|
||||||
|
</div>
|
||||||
|
<!-- 砍价 -->
|
||||||
|
<div class="price" v-if="type && item.purchasePrice!=undefined">
|
||||||
|
最低:
|
||||||
|
¥<span>{{ $options.filters.goodsFormatPrice(item.purchasePrice )[0] }} </span>.{{
|
||||||
|
$options.filters.goodsFormatPrice(item.purchasePrice )[1]
|
||||||
|
}}
|
||||||
|
</div>
|
||||||
|
</view>
|
||||||
|
<div>
|
||||||
|
<image class='buy' :src="buy"></image>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class='count-config' v-if="!type">
|
||||||
|
<span>即将恢复{{ item.originalPrice}}元</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import commonTpl from '@/components/m-goods-list/common'
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
lightColor: this.$mainColor,
|
||||||
|
buy: require('@/static/buy.png')
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mixins: [commonTpl],
|
||||||
|
props: {
|
||||||
|
// 遍历的数据
|
||||||
|
res: {
|
||||||
|
type: Array,
|
||||||
|
default: () => {
|
||||||
|
return []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
type:{
|
||||||
|
type:null,
|
||||||
|
default:""
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
// 跳转到商品详情
|
||||||
|
navigateToDetailPage(item) {
|
||||||
|
if(this.type == 'kanJia'){
|
||||||
|
uni.navigateTo({
|
||||||
|
url: `/pages/promotion/bargain/detail?id=${item.id}`,
|
||||||
|
});
|
||||||
|
return
|
||||||
|
}
|
||||||
|
uni.navigateTo({
|
||||||
|
url: `/pages/product/goods?id=${item.skuId}&goodsId=${item.goodsId}`,
|
||||||
|
});
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang='scss' scoped>
|
||||||
|
.buy {
|
||||||
|
width: 152rpx;
|
||||||
|
height: 108rpx;
|
||||||
|
}
|
||||||
|
.flex-j-sb {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
.goods-row {
|
||||||
|
background: #fff;
|
||||||
|
padding: 16rpx;
|
||||||
|
>.goods-col {
|
||||||
|
display: flex;
|
||||||
|
>.goods-img {
|
||||||
|
overflow: hidden;
|
||||||
|
flex: 4;
|
||||||
|
}
|
||||||
|
>.goods-detail {
|
||||||
|
flex: 7;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.goods-detail {
|
||||||
|
margin: 0 20rpx;
|
||||||
|
>.title {
|
||||||
|
font-size: $font-base;
|
||||||
|
color: $font-color-dark;
|
||||||
|
line-height: 1.5;
|
||||||
|
height: 86rpx;
|
||||||
|
padding: 10rpx 0 0;
|
||||||
|
display: -webkit-box;
|
||||||
|
-webkit-box-orient: vertical;
|
||||||
|
-webkit-line-clamp: 2;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
.promotion {
|
||||||
|
margin-top: 4rpx;
|
||||||
|
display: flex;
|
||||||
|
|
||||||
|
div {
|
||||||
|
span {
|
||||||
|
font-size: 24rpx;
|
||||||
|
color: $light-color;
|
||||||
|
margin-right: 10rpx;
|
||||||
|
padding: 0 4rpx;
|
||||||
|
border-radius: 2rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.count-config {
|
||||||
|
padding: 5rpx 0;
|
||||||
|
color: #666;
|
||||||
|
display: flex;
|
||||||
|
font-size: 24rpx;
|
||||||
|
letter-spacing:2rpx;
|
||||||
|
padding-left: 10rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.price-box {
|
||||||
|
margin-top: 10rpx;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
padding-right: 10rpx;
|
||||||
|
font-size: 24rpx;
|
||||||
|
color: $font-color-light;
|
||||||
|
|
||||||
|
>.price {
|
||||||
|
font-size: 26rpx;
|
||||||
|
line-height: 1;
|
||||||
|
color: $main-color;
|
||||||
|
font-weight: bold;
|
||||||
|
|
||||||
|
/deep/ span:nth-of-type(1) {
|
||||||
|
font-size: 48rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -1,27 +1,11 @@
|
|||||||
<template>
|
<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();
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,20 +1,21 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="serach">
|
<view class="serach">
|
||||||
<view class="left-box" @tap="onClickLeft">
|
<view class="left-box" @tap="onClickLeft">
|
||||||
<uni-icons style="line-height:70rpx" type="back" size="24" />
|
<u-icon name="arrow-left" size="40" color="#666"></u-icon>
|
||||||
</view>
|
</view>
|
||||||
<view class="content" :style="{ 'border-radius': radius + 'px' }">
|
<view class="content" :style="{ 'border-radius': radius + 'px' }">
|
||||||
<!-- HM修改 增加进入输入状态的点击范围 -->
|
<!-- HM修改 增加进入输入状态的点击范围 -->
|
||||||
<view class="content-box" :class="{ center: mode === 2 }">
|
<view class="content-box" :class="{ center: mode === 2 }">
|
||||||
<u-icon name="search" size="32" style="padding:0 15rpx;"></u-icon>
|
<u-icon name="search" size="32" style="padding:0 15rpx;"></u-icon>
|
||||||
<!-- HM修改 增加placeholder input confirm-type confirm-->
|
<!-- HM修改 增加placeholder input confirm-type confirm-->
|
||||||
<input style="width:100%; " :placeholder="placeholder" placeholder-class="placeholder-color" @input="inputChange" confirm-type="search" @confirm="triggerConfirm" class="input"
|
<input style="width:100%; " :placeholder="placeholder" placeholder-class="placeholder-color"
|
||||||
|
@input="inputChange" confirm-type="search" @confirm="triggerConfirm" class="input"
|
||||||
:class="{ center: !active && mode === 2 }" :focus="isFocus" v-model="inputVal" @focus="focus" @blur="blur" />
|
:class="{ center: !active && mode === 2 }" :focus="isFocus" v-model="inputVal" @focus="focus" @blur="blur" />
|
||||||
<u-icon name="close" v-if="isDelShow" style="padding:0 30rpx;" @click="clear"></u-icon>
|
<u-icon name="close" v-if="isDelShow" style="padding:0 30rpx;" @click="clear"></u-icon>
|
||||||
</view>
|
</view>
|
||||||
<view v-show="(active && show && button === 'inside') || (isDelShow && button === 'inside')" class="serachBtn" @click="search">搜索</view>
|
|
||||||
</view>
|
</view>
|
||||||
<view v-if="button === 'outside'" class="button" :class="{ active: show || active }">
|
<view class="button active" >
|
||||||
<view v-if="isShowSeachGoods !=true" class="button-item">
|
<view v-if="isShowSeachGoods !=true" class="button-item">
|
||||||
<div @click="out()">取消</div>
|
<div @click="out()">取消</div>
|
||||||
</view>
|
</view>
|
||||||
@@ -28,14 +29,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import uniStatusBar from "../uni-status-bar/uni-status-bar.vue";
|
|
||||||
import uniIcons from "../uni-icons/uni-icons.vue";
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
|
||||||
uniStatusBar,
|
|
||||||
uniIcons,
|
|
||||||
},
|
|
||||||
props: {
|
props: {
|
||||||
mode: {
|
mode: {
|
||||||
value: Number,
|
value: Number,
|
||||||
@@ -50,15 +44,6 @@ export default {
|
|||||||
type: String,
|
type: String,
|
||||||
default: "",
|
default: "",
|
||||||
},
|
},
|
||||||
button: {
|
|
||||||
value: String,
|
|
||||||
default: "outside",
|
|
||||||
},
|
|
||||||
//
|
|
||||||
show: {
|
|
||||||
value: Boolean,
|
|
||||||
default: true,
|
|
||||||
},
|
|
||||||
// 默认半径为60
|
// 默认半径为60
|
||||||
radius: {
|
radius: {
|
||||||
value: String,
|
value: String,
|
||||||
@@ -131,7 +116,6 @@ export default {
|
|||||||
this.$emit("input", "");
|
this.$emit("input", "");
|
||||||
//this.$emit('search', '');//HM修改 清空内容时候不进行搜索
|
//this.$emit('search', '');//HM修改 清空内容时候不进行搜索
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 回退到上一级
|
* 回退到上一级
|
||||||
@@ -145,7 +129,7 @@ export default {
|
|||||||
*/
|
*/
|
||||||
search() {
|
search() {
|
||||||
if (!this.inputVal) {
|
if (!this.inputVal) {
|
||||||
if (!this.show && this.searchName == "取消") {
|
if (this.searchName == "取消") {
|
||||||
uni.hideKeyboard();
|
uni.hideKeyboard();
|
||||||
this.isFocus = false;
|
this.isFocus = false;
|
||||||
this.active = false;
|
this.active = false;
|
||||||
@@ -175,6 +159,9 @@ export default {
|
|||||||
font-size: $uni-font-size-base;
|
font-size: $uni-font-size-base;
|
||||||
|
|
||||||
.left-box {
|
.left-box {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
width: 15%;
|
width: 15%;
|
||||||
/* #ifndef APP-NVUE */
|
/* #ifndef APP-NVUE */
|
||||||
text-align: center;
|
text-align: center;
|
||||||
@@ -225,19 +212,6 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.serachBtn {
|
|
||||||
height: 100%;
|
|
||||||
flex-shrink: 0;
|
|
||||||
padding: 0 30rpx;
|
|
||||||
//HM修改 按钮背景色
|
|
||||||
background: linear-gradient(to right, grey, grey);
|
|
||||||
//background: $uni-color-success;
|
|
||||||
line-height: 60rpx;
|
|
||||||
color: #eee;
|
|
||||||
//border-left: 1px #ccc solid; //HM修改 去掉边框
|
|
||||||
transition: all 0.3s;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.button {
|
.button {
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
<view class="share-list">
|
<view class="share-list">
|
||||||
<!-- #ifdef MP-WEIXIN -->
|
<!-- #ifdef MP-WEIXIN -->
|
||||||
<view class="share-item">
|
<view class="share-item">
|
||||||
<button class="share-btn" open-type="share">
|
<button class="share-btn" @click="weChatShare" open-type="share">
|
||||||
<u-icon color="#04BE02" size="80" name="weixin-fill"></u-icon>微信好友
|
<u-icon color="#04BE02" size="80" name="weixin-fill"></u-icon>微信好友
|
||||||
</button>
|
</button>
|
||||||
</view>
|
</view>
|
||||||
@@ -19,7 +19,7 @@
|
|||||||
<view>{{ item.title }}</view>
|
<view>{{ item.title }}</view>
|
||||||
</view>
|
</view>
|
||||||
<!-- #endif -->
|
<!-- #endif -->
|
||||||
<!-- #ifdef H5 -->
|
<!-- #ifdef H5 -->
|
||||||
<view class="share-item" @click="copyLink()">
|
<view class="share-item" @click="copyLink()">
|
||||||
<u-icon color="#b4aee8" size="80" name="share-fill"></u-icon>
|
<u-icon color="#b4aee8" size="80" name="share-fill"></u-icon>
|
||||||
<view>{{ '复制链接' }}</view>
|
<view>{{ '复制链接' }}</view>
|
||||||
@@ -62,6 +62,16 @@ export default {
|
|||||||
close() {
|
close() {
|
||||||
this.$emit("close");
|
this.$emit("close");
|
||||||
},
|
},
|
||||||
|
weChatShare(){
|
||||||
|
this.$u.mpShare = {
|
||||||
|
title: this.shareTitle(), // 默认为小程序名称,可自定义
|
||||||
|
path: '', // 默认为当前页面路径,一般无需修改,QQ小程序不支持
|
||||||
|
// 分享图标,路径可以是本地文件路径、代码包文件路径或者网络图片路径。
|
||||||
|
// 支持PNG及JPG,默认为当前页面的截图
|
||||||
|
imageUrl: this.thumbnail ||''
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
// h5复制链接
|
// h5复制链接
|
||||||
// #ifdef H5
|
// #ifdef H5
|
||||||
copyLink() {
|
copyLink() {
|
||||||
@@ -93,13 +103,13 @@ export default {
|
|||||||
shareTitle() {
|
shareTitle() {
|
||||||
let shareTitle;
|
let shareTitle;
|
||||||
if (this.type == "goods") {
|
if (this.type == "goods") {
|
||||||
shareTitle = `我发现了一个${this.goodsName}商品快来跟我一起看看吧`;
|
shareTitle = `[好友推荐]${this.goodsName}快来跟我一起看看吧`;
|
||||||
} else if (this.type == "shops") {
|
} else if (this.type == "shops") {
|
||||||
shareTitle = `我发现了一个${this.goodsName}店铺快来跟我一起看看吧`;
|
shareTitle = `[好友发现]${this.goodsName}快来跟我一起看看吧`;
|
||||||
} else if (this.type == "pintuan") {
|
} else if (this.type == "pintuan") {
|
||||||
shareTitle = `我拼了一个${this.goodsName}快来跟我一起抢购吧!`;
|
shareTitle = `[好友邀请]${this.goodsName}快来跟我一起抢购吧!`;
|
||||||
} else if (this.type == "kanjia") {
|
} else if (this.type == "kanjia") {
|
||||||
shareTitle = `请快来帮我砍一刀${this.goodsName}`;
|
shareTitle = `[好友邀请]请快来帮我砍一刀${this.goodsName}`;
|
||||||
}
|
}
|
||||||
return shareTitle;
|
return shareTitle;
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,241 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div class="dropdown-item">
|
|
||||||
<!-- selected -->
|
|
||||||
<view class="dropdown-item__selected" @click="changePopup">
|
|
||||||
<slot name="title" v-if="$slots.title"></slot>
|
|
||||||
<block v-else>
|
|
||||||
<view class="selected__name">
|
|
||||||
{{title ? title : selectItem.text}}
|
|
||||||
</view>
|
|
||||||
<!-- <view class="selected__icon"
|
|
||||||
:class="showClass === 'show'? 'up' : 'down'"
|
|
||||||
>
|
|
||||||
<span class="iconfont"></span>
|
|
||||||
</view> -->
|
|
||||||
</block>
|
|
||||||
</view>
|
|
||||||
<view class="dropdown-item__content" :style="{top: contentTop + 'px'}" v-if="showList">
|
|
||||||
<!-- dropdown -->
|
|
||||||
<view :class="['list', showClass]">
|
|
||||||
<slot v-if="$slots.default"></slot>
|
|
||||||
<block v-else>
|
|
||||||
<view class="list__option" v-for="(item, index) in list" :key="index" @click="choose(item)">
|
|
||||||
<view>{{item.text}}</view>
|
|
||||||
<icon v-if="item.value === value" type="success_no_circle" size="26" />
|
|
||||||
</view>
|
|
||||||
</block>
|
|
||||||
</view>
|
|
||||||
<!-- dropdown-mask -->
|
|
||||||
|
|
||||||
<!-- @touchmove 禁止滑动 -->
|
|
||||||
<view @touchmove.stop.prevent="moveHandle" :class="['dropdown-mask', showClass]" v-if="showList" @click="closePopup"></view>
|
|
||||||
</view>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
export default {
|
|
||||||
components: {},
|
|
||||||
props: {
|
|
||||||
value: [Number, String, Object],
|
|
||||||
list: {
|
|
||||||
type: Array,
|
|
||||||
default: () => {
|
|
||||||
return []
|
|
||||||
}
|
|
||||||
},
|
|
||||||
title: [Number, String],
|
|
||||||
contentTopReduse: {
|
|
||||||
type: Number,
|
|
||||||
default: 0
|
|
||||||
}
|
|
||||||
},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
showList: "",
|
|
||||||
showClass: '',
|
|
||||||
selectItem: {},
|
|
||||||
contentTop: 0
|
|
||||||
}
|
|
||||||
},
|
|
||||||
watch: {},
|
|
||||||
mounted() {
|
|
||||||
this.showList = this.active;
|
|
||||||
this.selectItem = this.list[this.value];
|
|
||||||
// document.addEventListener('click', e => {
|
|
||||||
// //this.$el 可以获取当前组件的容器节点
|
|
||||||
// if (!this.$el.contains(e.target)) {
|
|
||||||
// console.log('change');
|
|
||||||
// this.close()
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
// 禁止滑动
|
|
||||||
moveHandle() {},
|
|
||||||
choose(item) {
|
|
||||||
this.selectItem = item
|
|
||||||
this.$emit('input', item.value)
|
|
||||||
this.closePopup()
|
|
||||||
},
|
|
||||||
changePopup() {
|
|
||||||
if (this.showList) {
|
|
||||||
this.closePopup()
|
|
||||||
} else {
|
|
||||||
this.openPopup()
|
|
||||||
}
|
|
||||||
},
|
|
||||||
openPopup() {
|
|
||||||
// this.$parent -> dropdown-menu
|
|
||||||
this.$parent.$emit('close')
|
|
||||||
this.showList = true
|
|
||||||
this.$nextTick(() => {
|
|
||||||
this.getElementData('.dropdown-item__selected', (data) => {
|
|
||||||
this.contentTop = data[0].bottom - this.contentTopReduse;
|
|
||||||
this.showClass = 'show'
|
|
||||||
})
|
|
||||||
})
|
|
||||||
},
|
|
||||||
closePopup() {
|
|
||||||
this.showClass = ''
|
|
||||||
setTimeout(() => {
|
|
||||||
this.showList = false
|
|
||||||
}, 300)
|
|
||||||
},
|
|
||||||
close() {
|
|
||||||
this.showClass = ''
|
|
||||||
this.showList = false
|
|
||||||
},
|
|
||||||
getElementData(el, callback) {
|
|
||||||
uni.createSelectorQuery().in(this).selectAll(el).boundingClientRect().exec((data) => {
|
|
||||||
callback(data[0]);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="scss">
|
|
||||||
@font-face {
|
|
||||||
font-family: 'iconfont';
|
|
||||||
/* project id 1564327 */
|
|
||||||
src: url('https://at.alicdn.com/t/font_1564327_fcszez4n5i.eot');
|
|
||||||
src: url('https://at.alicdn.com/t/font_1564327_fcszez4n5i.eot?#iefix') format('embedded-opentype'),
|
|
||||||
url('https://at.alicdn.com/t/font_1564327_fcszez4n5i.woff2') format('woff2'),
|
|
||||||
url('https://at.alicdn.com/t/font_1564327_fcszez4n5i.woff') format('woff'),
|
|
||||||
url('https://at.alicdn.com/t/font_1564327_fcszez4n5i.ttf') format('truetype'),
|
|
||||||
url('https://at.alicdn.com/t/font_1564327_fcszez4n5i.svg#iconfont') format('svg');
|
|
||||||
}
|
|
||||||
|
|
||||||
.iconfont {
|
|
||||||
font-family: "iconfont" !important;
|
|
||||||
font-size: 28rpx;
|
|
||||||
font-style: normal;
|
|
||||||
-webkit-font-smoothing: antialiased;
|
|
||||||
-webkit-text-stroke-width: 0.2px;
|
|
||||||
-moz-osx-font-smoothing: grayscale;
|
|
||||||
}
|
|
||||||
|
|
||||||
.line {
|
|
||||||
position: absolute;
|
|
||||||
height: 3px;
|
|
||||||
width: 100px;
|
|
||||||
background: #1abc9c;
|
|
||||||
}
|
|
||||||
|
|
||||||
.dropdown-item {
|
|
||||||
position: relative;
|
|
||||||
|
|
||||||
&__selected {
|
|
||||||
position: relative;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
background: transparent;
|
|
||||||
// padding: 10rpx;
|
|
||||||
box-sizing: border-box;
|
|
||||||
justify-content: center;
|
|
||||||
|
|
||||||
.selected__name {
|
|
||||||
font-size: 32rpx;
|
|
||||||
white-space: nowrap;
|
|
||||||
position: relative;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
.selected__icon {
|
|
||||||
margin-left: 8rpx;
|
|
||||||
|
|
||||||
&.down {
|
|
||||||
transition: transform .3s;
|
|
||||||
transform: rotateZ(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
&.up {
|
|
||||||
transition: transform .3s;
|
|
||||||
transform: rotateZ(-180deg);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
&__content {
|
|
||||||
position: fixed;
|
|
||||||
left: 0;
|
|
||||||
right: 0;
|
|
||||||
overflow: hidden;
|
|
||||||
top: 0;
|
|
||||||
bottom: 0;
|
|
||||||
z-index: 10;
|
|
||||||
|
|
||||||
.list {
|
|
||||||
max-height: 400px;
|
|
||||||
overflow-y: auto;
|
|
||||||
position: absolute;
|
|
||||||
left: 0;
|
|
||||||
right: 0;
|
|
||||||
z-index: 3;
|
|
||||||
background: #fff;
|
|
||||||
transform: translateY(-100%);
|
|
||||||
transition: all .3s;
|
|
||||||
|
|
||||||
&.show {
|
|
||||||
transform: translateY(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
&__option {
|
|
||||||
font-size: 32rpx;
|
|
||||||
padding: 26rpx 28rpx;
|
|
||||||
display: flex;
|
|
||||||
justify-content: space-between;
|
|
||||||
|
|
||||||
&:not(:last-child) {
|
|
||||||
border-bottom: 1rpx solid #DDDDDD;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.dropdown-mask {
|
|
||||||
position: absolute;
|
|
||||||
left: 0;
|
|
||||||
right: 0;
|
|
||||||
top: 0;
|
|
||||||
bottom: 0;
|
|
||||||
transition: all .3s;
|
|
||||||
z-index: 2;
|
|
||||||
|
|
||||||
&.show {
|
|
||||||
background: rgba(0, 0, 0, 0.5);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
&:not(:last-child):after {
|
|
||||||
content: ' ';
|
|
||||||
position: absolute;
|
|
||||||
width: 2rpx;
|
|
||||||
top: 36rpx;
|
|
||||||
bottom: 36rpx;
|
|
||||||
right: 0;
|
|
||||||
background: $uni-border-color;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -1,35 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div class="dropdown-menu">
|
|
||||||
<slot></slot>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
export default {
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
}
|
|
||||||
},
|
|
||||||
mounted() {
|
|
||||||
this.$on('close', this.closeDropdown)
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
closeDropdown() {
|
|
||||||
this.$children.forEach(item =>{
|
|
||||||
item.close();
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="scss">
|
|
||||||
.dropdown-menu {
|
|
||||||
display: flex;
|
|
||||||
overflow: auto;
|
|
||||||
white-space: nowrap;
|
|
||||||
}
|
|
||||||
dropdown-item {
|
|
||||||
flex: 1;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -1,132 +0,0 @@
|
|||||||
export default {
|
|
||||||
"pulldown": "\ue588",
|
|
||||||
"refreshempty": "\ue461",
|
|
||||||
"back": "\ue471",
|
|
||||||
"forward": "\ue470",
|
|
||||||
"more": "\ue507",
|
|
||||||
"more-filled": "\ue537",
|
|
||||||
"scan": "\ue612",
|
|
||||||
"qq": "\ue264",
|
|
||||||
"weibo": "\ue260",
|
|
||||||
"weixin": "\ue261",
|
|
||||||
"pengyouquan": "\ue262",
|
|
||||||
"loop": "\ue565",
|
|
||||||
"refresh": "\ue407",
|
|
||||||
"refresh-filled": "\ue437",
|
|
||||||
"arrowthindown": "\ue585",
|
|
||||||
"arrowthinleft": "\ue586",
|
|
||||||
"arrowthinright": "\ue587",
|
|
||||||
"arrowthinup": "\ue584",
|
|
||||||
"undo-filled": "\ue7d6",
|
|
||||||
"undo": "\ue406",
|
|
||||||
"redo": "\ue405",
|
|
||||||
"redo-filled": "\ue7d9",
|
|
||||||
"bars": "\ue563",
|
|
||||||
"chatboxes": "\ue203",
|
|
||||||
"camera": "\ue301",
|
|
||||||
"chatboxes-filled": "\ue233",
|
|
||||||
"camera-filled": "\ue7ef",
|
|
||||||
"cart-filled": "\ue7f4",
|
|
||||||
"cart": "\ue7f5",
|
|
||||||
"checkbox-filled": "\ue442",
|
|
||||||
"checkbox": "\ue7fa",
|
|
||||||
"arrowleft": "\ue582",
|
|
||||||
"arrowdown": "\ue581",
|
|
||||||
"arrowright": "\ue583",
|
|
||||||
"smallcircle-filled": "\ue801",
|
|
||||||
"arrowup": "\ue580",
|
|
||||||
"circle": "\ue411",
|
|
||||||
"eye-filled": "\ue568",
|
|
||||||
"eye-slash-filled": "\ue822",
|
|
||||||
"eye-slash": "\ue823",
|
|
||||||
"eye": "\ue824",
|
|
||||||
"flag-filled": "\ue825",
|
|
||||||
"flag": "\ue508",
|
|
||||||
"gear-filled": "\ue532",
|
|
||||||
"reload": "\ue462",
|
|
||||||
"gear": "\ue502",
|
|
||||||
"hand-thumbsdown-filled": "\ue83b",
|
|
||||||
"hand-thumbsdown": "\ue83c",
|
|
||||||
"hand-thumbsup-filled": "\ue83d",
|
|
||||||
"heart-filled": "\ue83e",
|
|
||||||
"hand-thumbsup": "\ue83f",
|
|
||||||
"heart": "\ue840",
|
|
||||||
"home": "\ue500",
|
|
||||||
"info": "\ue504",
|
|
||||||
"home-filled": "\ue530",
|
|
||||||
"info-filled": "\ue534",
|
|
||||||
"circle-filled": "\ue441",
|
|
||||||
"chat-filled": "\ue847",
|
|
||||||
"chat": "\ue263",
|
|
||||||
"mail-open-filled": "\ue84d",
|
|
||||||
"email-filled": "\ue231",
|
|
||||||
"mail-open": "\ue84e",
|
|
||||||
"email": "\ue201",
|
|
||||||
"checkmarkempty": "\ue472",
|
|
||||||
"list": "\ue562",
|
|
||||||
"locked-filled": "\ue856",
|
|
||||||
"locked": "\ue506",
|
|
||||||
"map-filled": "\ue85c",
|
|
||||||
"map-pin": "\ue85e",
|
|
||||||
"map-pin-ellipse": "\ue864",
|
|
||||||
"map": "\ue364",
|
|
||||||
"minus-filled": "\ue440",
|
|
||||||
"mic-filled": "\ue332",
|
|
||||||
"minus": "\ue410",
|
|
||||||
"micoff": "\ue360",
|
|
||||||
"mic": "\ue302",
|
|
||||||
"clear": "\ue434",
|
|
||||||
"smallcircle": "\ue868",
|
|
||||||
"close": "\ue404",
|
|
||||||
"closeempty": "\ue460",
|
|
||||||
"paperclip": "\ue567",
|
|
||||||
"paperplane": "\ue503",
|
|
||||||
"paperplane-filled": "\ue86e",
|
|
||||||
"person-filled": "\ue131",
|
|
||||||
"contact-filled": "\ue130",
|
|
||||||
"person": "\ue101",
|
|
||||||
"contact": "\ue100",
|
|
||||||
"images-filled": "\ue87a",
|
|
||||||
"phone": "\ue200",
|
|
||||||
"images": "\ue87b",
|
|
||||||
"image": "\ue363",
|
|
||||||
"image-filled": "\ue877",
|
|
||||||
"location-filled": "\ue333",
|
|
||||||
"location": "\ue303",
|
|
||||||
"plus-filled": "\ue439",
|
|
||||||
"plus": "\ue409",
|
|
||||||
"plusempty": "\ue468",
|
|
||||||
"help-filled": "\ue535",
|
|
||||||
"help": "\ue505",
|
|
||||||
"navigate-filled": "\ue884",
|
|
||||||
"navigate": "\ue501",
|
|
||||||
"mic-slash-filled": "\ue892",
|
|
||||||
"search": "\ue466",
|
|
||||||
"settings": "\ue560",
|
|
||||||
"sound": "\ue590",
|
|
||||||
"sound-filled": "\ue8a1",
|
|
||||||
"spinner-cycle": "\ue465",
|
|
||||||
"download-filled": "\ue8a4",
|
|
||||||
"personadd-filled": "\ue132",
|
|
||||||
"videocam-filled": "\ue8af",
|
|
||||||
"personadd": "\ue102",
|
|
||||||
"upload": "\ue402",
|
|
||||||
"upload-filled": "\ue8b1",
|
|
||||||
"starhalf": "\ue463",
|
|
||||||
"star-filled": "\ue438",
|
|
||||||
"star": "\ue408",
|
|
||||||
"trash": "\ue401",
|
|
||||||
"phone-filled": "\ue230",
|
|
||||||
"compose": "\ue400",
|
|
||||||
"videocam": "\ue300",
|
|
||||||
"trash-filled": "\ue8dc",
|
|
||||||
"download": "\ue403",
|
|
||||||
"chatbubble-filled": "\ue232",
|
|
||||||
"chatbubble": "\ue202",
|
|
||||||
"cloud-download": "\ue8e4",
|
|
||||||
"cloud-upload-filled": "\ue8e5",
|
|
||||||
"cloud-upload": "\ue8e6",
|
|
||||||
"cloud-download-filled": "\ue8e9",
|
|
||||||
"headphones":"\ue8bf",
|
|
||||||
"store":"\ue609"
|
|
||||||
}
|
|
||||||
File diff suppressed because one or more lines are too long
@@ -1,25 +0,0 @@
|
|||||||
<template>
|
|
||||||
<view :style="{ height: statusBarHeight }" class="uni-status-bar">
|
|
||||||
<slot />
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
var statusBarHeight = uni.getSystemInfoSync().statusBarHeight + 'px'
|
|
||||||
export default {
|
|
||||||
name: 'UniStatusBar',
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
statusBarHeight: statusBarHeight
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
.uni-status-bar {
|
|
||||||
width: 750rpx;
|
|
||||||
height: 20px;
|
|
||||||
// height: var(--status-bar-height);
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -1,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 bg-cyan round" @click="getCode">刷新拼图</text>
|
||||||
<text class="my-neirong-sm cuIcon-safe" style="color: #c1c1c1">Lili-FRAMEWORK</text>
|
<text class="my-neirong-sm cuIcon-safe" style="color: #c1c1c1"
|
||||||
|
>Lili-FRAMEWORK</text
|
||||||
|
>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</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);
|
||||||
|
|||||||
278
components/verify-code/verify-code.vue
Normal file
278
components/verify-code/verify-code.vue
Normal file
@@ -0,0 +1,278 @@
|
|||||||
|
<template>
|
||||||
|
<view class="xt__verify-code">
|
||||||
|
<!-- 输入框 -->
|
||||||
|
<input
|
||||||
|
id="xt__input"
|
||||||
|
:value="code"
|
||||||
|
class="xt__input"
|
||||||
|
:focus="isFocus"
|
||||||
|
:password="isPassword"
|
||||||
|
:type="inputType"
|
||||||
|
:maxlength="size"
|
||||||
|
@input="input"
|
||||||
|
@focus="inputFocus"
|
||||||
|
@blur="inputBlur"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<!-- 光标 -->
|
||||||
|
<view
|
||||||
|
id="xt__cursor"
|
||||||
|
v-if="cursorVisible && type !== 'middle'"
|
||||||
|
class="xt__cursor"
|
||||||
|
:style="{ left: codeCursorLeft[code.length] + 'px', height: cursorHeight + 'px', backgroundColor: cursorColor }"
|
||||||
|
></view>
|
||||||
|
|
||||||
|
<!-- 输入框 - 组 -->
|
||||||
|
<view id="xt__input-ground" class="xt__input-ground">
|
||||||
|
<template v-for="(item, index) in size">
|
||||||
|
<view
|
||||||
|
:key="index"
|
||||||
|
:style="{ borderColor: code.length === index && cursorVisible ? boxActiveColor : boxNormalColor }"
|
||||||
|
:class="['xt__box', `xt__box-${type + ''}`, `xt__box::after`]"
|
||||||
|
>
|
||||||
|
<view :style="{ borderColor: boxActiveColor }" class="xt__middle-line" v-if="type === 'middle' && !code[index]"></view>
|
||||||
|
<text class="xt__code-text">{{ code[index] | codeFormat(isPassword) }}</text>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
/**
|
||||||
|
* @description 输入验证码组件
|
||||||
|
* @property {string} type = [box|middle|bottom] - 显示类型 默认:box -eg:bottom
|
||||||
|
* @property {string} inputType = [text|number] - 输入框类型 默认:number -eg:number
|
||||||
|
* @property {number} size = [4|6] - 支持的验证码数量 默认:6 -eg:6
|
||||||
|
* @property {boolean} isFocus - 是否立即聚焦 默认:true
|
||||||
|
* @property {boolean} isPassword - 是否以密码形式显示 默认false -eg:false
|
||||||
|
* @property {string} cursorColor - 光标颜色 默认:#cccccc
|
||||||
|
* @property {string} boxNormalColor - 光标未聚焦到的框的颜色 默认:#cccccc
|
||||||
|
* @property {string} boxActiveColor - 光标聚焦到的框的颜色 默认:#000000
|
||||||
|
* @event {Function(data)} confirm - 输入完成
|
||||||
|
*/
|
||||||
|
export default {
|
||||||
|
name: 'xt-verify-code',
|
||||||
|
props: {
|
||||||
|
value: {
|
||||||
|
type: String,
|
||||||
|
default: () => ''
|
||||||
|
},
|
||||||
|
type: {
|
||||||
|
type: String,
|
||||||
|
default: () => 'box'
|
||||||
|
},
|
||||||
|
inputType: {
|
||||||
|
type: String,
|
||||||
|
default: () => 'number'
|
||||||
|
},
|
||||||
|
size: {
|
||||||
|
type: Number,
|
||||||
|
default: () => 6
|
||||||
|
},
|
||||||
|
isFocus: {
|
||||||
|
type: Boolean,
|
||||||
|
default: () => true
|
||||||
|
},
|
||||||
|
isPassword: {
|
||||||
|
type: Boolean,
|
||||||
|
default: () => false
|
||||||
|
},
|
||||||
|
cursorColor: {
|
||||||
|
type: String,
|
||||||
|
default: () => '#cccccc'
|
||||||
|
},
|
||||||
|
boxNormalColor: {
|
||||||
|
type: String,
|
||||||
|
default: () => '#cccccc'
|
||||||
|
},
|
||||||
|
boxActiveColor: {
|
||||||
|
type: String,
|
||||||
|
default: () => '#000000'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
model: {
|
||||||
|
prop: 'value',
|
||||||
|
event: 'input'
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
cursorVisible: false,
|
||||||
|
cursorHeight: 35,
|
||||||
|
code: '', // 输入的验证码
|
||||||
|
codeCursorLeft: [] // 向左移动的距离数组
|
||||||
|
};
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.cursorVisible = this.isFocus;
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.init();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
/**
|
||||||
|
* @description 初始化
|
||||||
|
*/
|
||||||
|
init() {
|
||||||
|
this.getCodeCursorLeft();
|
||||||
|
this.setCursorHeight();
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* @description 获取元素节点
|
||||||
|
* @param {string} elm - 节点的id、class 相当于 document.querySelect的参数 -eg: #id
|
||||||
|
* @param {string} type = [single|array] - 单个元素获取多个元素 默认是单个元素
|
||||||
|
* @param {Function} callback - 回调函数
|
||||||
|
*/
|
||||||
|
getElement(elm, type = 'single', callback) {
|
||||||
|
uni
|
||||||
|
.createSelectorQuery()
|
||||||
|
.in(this)
|
||||||
|
[type === 'array' ? 'selectAll' : 'select'](elm)
|
||||||
|
.boundingClientRect()
|
||||||
|
.exec(data => {
|
||||||
|
callback(data[0]);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* @description 计算光标的高度
|
||||||
|
*/
|
||||||
|
setCursorHeight() {
|
||||||
|
this.getElement('.xt__box', 'single', boxElm => {
|
||||||
|
this.cursorHeight = boxElm.height * 0.6;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* @description 获取光标在每一个box的left位置
|
||||||
|
*/
|
||||||
|
getCodeCursorLeft() {
|
||||||
|
// 获取父级框的位置信息
|
||||||
|
this.getElement('#xt__input-ground', 'single', parentElm => {
|
||||||
|
const parentLeft = parentElm.left;
|
||||||
|
// 获取各个box信息
|
||||||
|
this.getElement('.xt__box', 'array', elms => {
|
||||||
|
this.codeCursorLeft = [];
|
||||||
|
elms.forEach(elm => {
|
||||||
|
this.codeCursorLeft.push(elm.left - parentLeft + elm.width / 2);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
// 输入框输入变化的回调
|
||||||
|
input(e) {
|
||||||
|
const value = e.detail.value;
|
||||||
|
this.cursorVisible = value.length !== this.size;
|
||||||
|
this.$emit('input', value);
|
||||||
|
this.inputSuccess(value);
|
||||||
|
},
|
||||||
|
|
||||||
|
// 输入完成回调
|
||||||
|
inputSuccess(value) {
|
||||||
|
if (value.length === this.size) {
|
||||||
|
this.$emit('confirm', value);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 输入聚焦
|
||||||
|
inputFocus() {
|
||||||
|
this.cursorVisible = this.code.length !== this.size;
|
||||||
|
},
|
||||||
|
// 输入失去焦点
|
||||||
|
inputBlur() {
|
||||||
|
this.cursorVisible = false;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
value(val) {
|
||||||
|
this.code = val;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
filters: {
|
||||||
|
codeFormat(val, isPassword) {
|
||||||
|
let value = '';
|
||||||
|
if (val) {
|
||||||
|
value = isPassword ? '*' : val;
|
||||||
|
}
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.xt__verify-code {
|
||||||
|
position: relative;
|
||||||
|
width: 100%;
|
||||||
|
box-sizing: border-box;
|
||||||
|
|
||||||
|
.xt__input {
|
||||||
|
height: 100%;
|
||||||
|
width: 200%;
|
||||||
|
position: absolute;
|
||||||
|
left: -100%;
|
||||||
|
z-index: 1;
|
||||||
|
}
|
||||||
|
.xt__cursor {
|
||||||
|
position: absolute;
|
||||||
|
top: 50%;
|
||||||
|
transform: translateY(-50%);
|
||||||
|
display: inline-block;
|
||||||
|
width: 2px;
|
||||||
|
animation-name: cursor;
|
||||||
|
animation-duration: 0.8s;
|
||||||
|
animation-iteration-count: infinite;
|
||||||
|
}
|
||||||
|
|
||||||
|
.xt__input-ground {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
width: 100%;
|
||||||
|
box-sizing: border-box;
|
||||||
|
.xt__box {
|
||||||
|
position: relative;
|
||||||
|
display: inline-block;
|
||||||
|
width: 76rpx;
|
||||||
|
height: 112rpx;
|
||||||
|
&-bottom {
|
||||||
|
border-bottom-width: 2px;
|
||||||
|
border-bottom-style: solid;
|
||||||
|
}
|
||||||
|
|
||||||
|
&-box {
|
||||||
|
border-width: 2px;
|
||||||
|
border-style: solid;
|
||||||
|
}
|
||||||
|
|
||||||
|
&-middle {
|
||||||
|
border: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.xt__middle-line {
|
||||||
|
position: absolute;
|
||||||
|
top: 50%;
|
||||||
|
left: 50%;
|
||||||
|
width: 50%;
|
||||||
|
transform: translate(-50%, -50%);
|
||||||
|
border-bottom-width: 2px;
|
||||||
|
border-bottom-style: solid;
|
||||||
|
}
|
||||||
|
|
||||||
|
.xt__code-text {
|
||||||
|
position: absolute;
|
||||||
|
top: 50%;
|
||||||
|
left: 50%;
|
||||||
|
font-size:52rpx;
|
||||||
|
transform: translate(-50%, -50%);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes cursor {
|
||||||
|
0% {
|
||||||
|
opacity: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
100% {
|
||||||
|
opacity: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -6,7 +6,6 @@
|
|||||||
const dev = {
|
const dev = {
|
||||||
common: "https://common-api.pickmall.cn",
|
common: "https://common-api.pickmall.cn",
|
||||||
buyer: "https://buyer-api.pickmall.cn",
|
buyer: "https://buyer-api.pickmall.cn",
|
||||||
|
|
||||||
};
|
};
|
||||||
// 生产环境
|
// 生产环境
|
||||||
const prod = {
|
const prod = {
|
||||||
|
|||||||
@@ -1,16 +1,24 @@
|
|||||||
const name = "lilishop"; //全局商城name
|
const name = "lilishop"; //全局商城name
|
||||||
const schemeName = 'lilishop' //唤醒app需要的schemeName
|
const schemeName = "lilishop"; //唤醒app需要的schemeName
|
||||||
export default {
|
export default {
|
||||||
name: name,
|
name: name,
|
||||||
schemeLink: `${schemeName}://`, //唤起app地址
|
schemeLink: `${schemeName}://`, //唤起app地址
|
||||||
downloadLink: "https://pickmall.cn/download-page/index.html", //下载地址,下载app的地址
|
downloadLink: "https://pickmall.cn/download-page/index.html", //下载地址,下载app的地址
|
||||||
shareLink: "https://m-b2b2c.pickmall.cn", //分享地址,也就是在h5中默认的复制地址
|
shareLink: "https://m-b2b2c.pickmall.cn", //分享地址,也就是在h5中默认的复制地址
|
||||||
appid: "wx6f10f29075dc1b0b", //小程序唯一凭证,即 AppID,可在「微信公众平台 - 设置 - 开发设置」页中获得。(需要已经成为开发者,且帐号没有异常状态)
|
appid: "wx6f10f29075dc1b0b", //小程序唯一凭证,即 AppID,可在「微信公众平台 - 设置 - 开发设置」页中获得。(需要已经成为开发者,且帐号没有异常状态)
|
||||||
appSecret: "6dfbe0c72380dce5d49d65b3c91059b1", //可在 manifest.json 查看
|
aMapKey: "d649892b3937a5ad20b76dacb2bcb5bd", //在高德中申请Web服务key
|
||||||
aMapKey: "d649892b3937a5ad20b76dacb2bcb5bd", //在高德中申请web端key
|
scanAuthNavigation: ["https://m-b2b2c.pickmall.cn/"], //扫码认证跳转域名配置 会根据此处配置的路由进行跳转
|
||||||
scanAuthNavigation:['https://m-b2b2c.pickmall.cn/'], //扫码认证跳转域名配置 会根据此处配置的路由进行跳转
|
iosAppId: "id1564638363", //AppStore的应用地址id 具体在分享->拷贝链接中查看
|
||||||
iosAppId:"id1564638363", //AppStore的应用地址id 具体在分享->拷贝链接中查看
|
logo: "https://lilishop-oss.oss-cn-beijing.aliyuncs.com/4c864e133c2944efad1f7282ac8a3b9e.png", //logo地址
|
||||||
logo:"https://lilishop-oss.oss-cn-beijing.aliyuncs.com/4c864e133c2944efad1f7282ac8a3b9e.png", //logo地址
|
customerServiceMobile: "13161366885", //客服电话
|
||||||
customerServiceMobile:"13161366885", //客服电话
|
customerServiceEmail: "lili@lili.com", //客服邮箱
|
||||||
customerServiceEmail:"lili@lili.com" //客服邮箱
|
imWebSrc: "https://im.pickmall.cn", //IM地址
|
||||||
};
|
enableGetClipboard: true, //是否启用粘贴板获取 scanAuthNavigation 中的链接,如果匹配则会跳转到对应页面
|
||||||
|
enableMiniBarStartUpApp: true, //是否在h5中右侧浮空按钮点击启动app
|
||||||
|
/**
|
||||||
|
* 如需更换主题请修改此处以及uni.scss中的全局颜色
|
||||||
|
*/
|
||||||
|
mainColor: "#ff3c2a", // 主题色
|
||||||
|
lightColor: "#ff6b35", // 高亮主题色
|
||||||
|
aiderLightColor: "#ff9f28", // 辅助高亮颜色
|
||||||
|
};
|
||||||
|
|||||||
20
main.js
20
main.js
@@ -3,19 +3,23 @@ import App from "./App";
|
|||||||
import * as filters from "./utils/filters.js"; // global filter
|
import * as filters from "./utils/filters.js"; // global filter
|
||||||
import uView from "uview-ui";
|
import uView from "uview-ui";
|
||||||
import store from "./store";
|
import store from "./store";
|
||||||
|
import config from '@/config/config';
|
||||||
|
import airBtn from "@/components/m-airbtn/index.vue";
|
||||||
/**
|
/**
|
||||||
* 仅在h5中显示唤醒app功能
|
* 仅在h5中显示唤醒app功能
|
||||||
* 在h5页面手动挂载
|
* 在h5页面手动挂载
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
// #ifdef H5
|
// #ifdef H5
|
||||||
import airBtn from "@/components/m-airbtn/index.vue";
|
if(config.enableMiniBarStartUpApp){
|
||||||
let btn = Vue.component("airBtn", airBtn); //全局注册
|
let btn = Vue.component("airBtn", airBtn); //全局注册
|
||||||
document.body.appendChild(new btn().$mount().$el);
|
document.body.appendChild(new btn().$mount().$el);
|
||||||
|
}
|
||||||
// #endif
|
// #endif
|
||||||
|
|
||||||
|
// 引入uView对小程序分享的mixin封装
|
||||||
|
let mpShare = require('uview-ui/libs/mixin/mpShare.js');
|
||||||
|
Vue.mixin(mpShare)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 全局filters
|
* 全局filters
|
||||||
@@ -38,11 +42,11 @@ Vue.config.productionTip = false;
|
|||||||
* 如需更换主题请修改此处以及uni.scss中的全局颜色
|
* 如需更换主题请修改此处以及uni.scss中的全局颜色
|
||||||
*/
|
*/
|
||||||
// 主题色
|
// 主题色
|
||||||
Vue.prototype.$mainColor = "#ff3c2a";
|
Vue.prototype.$mainColor = config.mainColor;
|
||||||
// 高亮主题色
|
// 高亮主题色
|
||||||
Vue.prototype.$lightColor = "#ff6b35";
|
Vue.prototype.$lightColor = config.lightColor;
|
||||||
// 辅助高亮颜色
|
// 辅助高亮颜色
|
||||||
Vue.prototype.$aiderLightColor = "#ff9f28";
|
Vue.prototype.$aiderLightColor = config.aiderLightColor;
|
||||||
|
|
||||||
|
|
||||||
App.mpType = "app";
|
App.mpType = "app";
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
{
|
{
|
||||||
"name" : "lili商城",
|
"name" : "lili商城",
|
||||||
"appid" : "__UNI__C100675",
|
"appid" : "__UNI__EC9FD60",
|
||||||
"description" : "",
|
"description" : "",
|
||||||
"versionName" : "4.0.42",
|
"versionName" : "4.2.7",
|
||||||
"versionCode" : 4000042,
|
"versionCode" : 4000270,
|
||||||
"transformPx" : false,
|
"transformPx" : false,
|
||||||
"app-plus" : {
|
"app-plus" : {
|
||||||
"compatible" : {
|
"compatible" : {
|
||||||
@@ -63,7 +63,16 @@
|
|||||||
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
|
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
|
||||||
],
|
],
|
||||||
"abiFilters" : [ "armeabi-v7a", "arm64-v8a", "x86" ],
|
"abiFilters" : [ "armeabi-v7a", "arm64-v8a", "x86" ],
|
||||||
"schemes" : "lilishop"
|
"schemes" : "lilishop",
|
||||||
|
"permissionExternalStorage" : {
|
||||||
|
"request" : "none",
|
||||||
|
"prompt" : "应用保存运行状态等信息,需要获取读写手机存储(系统提示为访问设备上的照片、媒体内容和文件)权限,请允许。"
|
||||||
|
},
|
||||||
|
"permissionPhoneState" : {
|
||||||
|
"request" : "none",
|
||||||
|
"prompt" : "为保证您正常、安全地使用,需要获取设备识别码(部分手机提示为获取手机号码)使用权限,请允许"
|
||||||
|
},
|
||||||
|
"autoSdkPermissions" : false
|
||||||
},
|
},
|
||||||
"ios" : {
|
"ios" : {
|
||||||
"idfa" : false,
|
"idfa" : false,
|
||||||
@@ -72,9 +81,11 @@
|
|||||||
"NSPhotoLibraryAddUsageDescription" : "保存商品图片到本地",
|
"NSPhotoLibraryAddUsageDescription" : "保存商品图片到本地",
|
||||||
"NSFaceIDUsageDescription" : "使用面部识别进行登录",
|
"NSFaceIDUsageDescription" : "使用面部识别进行登录",
|
||||||
"NSCameraUsageDescription" : "需要用与扫描二维码和商品评论图片拍摄",
|
"NSCameraUsageDescription" : "需要用与扫描二维码和商品评论图片拍摄",
|
||||||
"NSLocationAlwaysAndWhenInUseUsageDescription" : "位置信息将用于高德地图的效果展示"
|
"NSLocationAlwaysAndWhenInUseUsageDescription" : "位置信息将用于高德地图的效果展示",
|
||||||
|
"NSMicrophoneUsageDescription" : "用户上传视频时需使用音频信息"
|
||||||
},
|
},
|
||||||
"urltypes" : "lilishop"
|
"urltypes" : "lilishop",
|
||||||
|
"dSYMs" : false
|
||||||
},
|
},
|
||||||
/* ios打包配置 */
|
/* ios打包配置 */
|
||||||
"sdkConfigs" : {
|
"sdkConfigs" : {
|
||||||
@@ -194,10 +205,6 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"plugins" : {
|
"plugins" : {
|
||||||
"myPlugin" : {
|
|
||||||
"version" : "1.1.0",
|
|
||||||
"provider" : "wx738958e0f4c894f9"
|
|
||||||
},
|
|
||||||
"live-player-plugin" : {
|
"live-player-plugin" : {
|
||||||
"version" : "1.3.0",
|
"version" : "1.3.0",
|
||||||
"provider" : "wx2b03c6e691cd7370"
|
"provider" : "wx2b03c6e691cd7370"
|
||||||
|
|||||||
89
pages.json
89
pages.json
@@ -10,17 +10,34 @@
|
|||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "首页",
|
"navigationBarTitleText": "首页",
|
||||||
"navigationStyle": "custom", // 隐藏系统导航栏
|
"navigationStyle": "custom", // 隐藏系统导航栏
|
||||||
"navigationBarTextStyle": "black"
|
"navigationBarTextStyle": "black",
|
||||||
|
"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": "购物车",
|
||||||
"navigationStyle": "custom",
|
"navigationBarBackgroundColor": "#fff",
|
||||||
|
"enablePullDownRefresh":true //实现下拉刷新样式
|
||||||
"navigationBarBackgroundColor": "#fff"
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
@@ -42,9 +59,16 @@
|
|||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "搜索",
|
"navigationBarTitleText": "搜索",
|
||||||
"navigationStyle": "custom",
|
"navigationStyle": "custom",
|
||||||
|
|
||||||
"app-plus": {
|
"app-plus": {
|
||||||
//app页面不显示滚动条
|
//app页面不显示滚动条
|
||||||
"scrollIndicator": "none"
|
"scrollIndicator": "none",
|
||||||
|
"bottom": "0",
|
||||||
|
"contentAdjust": "false",
|
||||||
|
"bounce": "none",
|
||||||
|
"safearea": {
|
||||||
|
"bottom": "none"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
@@ -61,6 +85,12 @@
|
|||||||
"style": {
|
"style": {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "pages/tabbar/special/special",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "专题"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
],
|
],
|
||||||
@@ -80,21 +110,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"
|
||||||
}
|
}
|
||||||
@@ -233,6 +256,8 @@
|
|||||||
"navigationBarTitleText": "面容登录"
|
"navigationBarTitleText": "面容登录"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
{
|
{
|
||||||
"path": "set/securityCenter/editPassword",
|
"path": "set/securityCenter/editPassword",
|
||||||
"style": {
|
"style": {
|
||||||
@@ -340,6 +365,12 @@
|
|||||||
"navigationBarTitleText": "",
|
"navigationBarTitleText": "",
|
||||||
"navigationStyle": "custom"
|
"navigationStyle": "custom"
|
||||||
}
|
}
|
||||||
|
},{
|
||||||
|
"path": "shopList",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "",
|
||||||
|
"navigationStyle": "custom"
|
||||||
|
}
|
||||||
},{
|
},{
|
||||||
"path": "licencePhoto",
|
"path": "licencePhoto",
|
||||||
"style": {
|
"style": {
|
||||||
@@ -438,6 +469,14 @@
|
|||||||
"navigationStyle": "custom",
|
"navigationStyle": "custom",
|
||||||
"navigationBarTextStyle": "black"
|
"navigationBarTextStyle": "black"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "scannerCodeLoginConfirm",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "扫码登录",
|
||||||
|
"navigationStyle": "custom",
|
||||||
|
"navigationBarTextStyle": "black"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
||||||
@@ -445,17 +484,12 @@
|
|||||||
|
|
||||||
{
|
{
|
||||||
"root": "pages/promotion",
|
"root": "pages/promotion",
|
||||||
"pages": [{
|
"pages": [ {
|
||||||
"path": "sale",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "特惠推荐",
|
|
||||||
"navigationStyle": "custom"
|
|
||||||
|
|
||||||
}
|
|
||||||
}, {
|
|
||||||
"path": "seckill",
|
"path": "seckill",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "限时抢购",
|
"navigationBarTitleText": "限时抢购",
|
||||||
|
"navigationStyle": "custom", // 隐藏系统导航栏
|
||||||
|
"navigationBarTextStyle": "white" ,
|
||||||
"app-plus": {
|
"app-plus": {
|
||||||
"titleNView": {
|
"titleNView": {
|
||||||
"homeButton":true
|
"homeButton":true
|
||||||
@@ -469,19 +503,12 @@
|
|||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "拼团活动",
|
"navigationBarTitleText": "拼团活动",
|
||||||
"navigationStyle": "custom", // 隐藏系统导航栏
|
"navigationStyle": "custom", // 隐藏系统导航栏
|
||||||
|
"navigationBarTextStyle": "white" ,
|
||||||
"app-plus": {
|
"app-plus": {
|
||||||
// 将回弹属性关掉
|
// 将回弹属性关掉
|
||||||
"bounce": "none"
|
"bounce": "none"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}, {
|
|
||||||
"path": "recommend",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "人气推荐",
|
|
||||||
"navigationStyle": "custom"
|
|
||||||
|
|
||||||
}
|
|
||||||
},{
|
},{
|
||||||
"path": "lives",
|
"path": "lives",
|
||||||
"style": {
|
"style": {
|
||||||
|
|||||||
@@ -1,299 +1,294 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="coupon-center">
|
<view class="coupon-center">
|
||||||
<swiper class="swiper-box">
|
<div class="swiper-box">
|
||||||
<swiper-item class="swiper-item">
|
<div class="swiper-item">
|
||||||
<scroll-view class="scroll-v" enableBackToTop="true" scroll-y @scrolltolower="loadMore">
|
<div class="scroll-v" enableBackToTop="true" scroll-y>
|
||||||
<u-empty mode="coupon" text="没有优惠券了" v-if="whetherEmpty"></u-empty>
|
<u-empty mode="coupon" style='margin-top: 20%;' text="没有优惠券了" v-if="whetherEmpty"></u-empty>
|
||||||
<view v-else class="coupon-item" v-for="(item, index) in couponList" :key="index">
|
<view v-else class="coupon-item" v-for="(item, index) in couponList" :key="index">
|
||||||
<view class="left">
|
<view class="left">
|
||||||
<view class="wave-line">
|
<view class="wave-line">
|
||||||
<view class="wave" v-for="(item, index) in 12" :key="index"></view>
|
<view class="wave" v-for="(item, index) in 12" :key="index"></view>
|
||||||
</view>
|
</view>
|
||||||
<view class="message">
|
<view class="message">
|
||||||
<view>
|
<view>
|
||||||
<!--判断当前优惠券类型 couponType PRICE || DISCOUNT -->
|
<!--判断当前优惠券类型 couponType PRICE || DISCOUNT -->
|
||||||
<span v-if="item.couponType == 'DISCOUNT'">{{ item.couponDiscount }}折</span>
|
<span v-if="item.couponType == 'DISCOUNT'">{{ item.couponDiscount }}折</span>
|
||||||
<span v-else>{{ item.price }}元</span>
|
<span v-else>{{ item.price }}元</span>
|
||||||
</view>
|
</view>
|
||||||
<view>满{{ item.consumeThreshold | unitPrice }}元可用</view>
|
<view>满{{ item.consumeThreshold | unitPrice }}元可用</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="circle circle-top"></view>
|
<view class="circle circle-top"></view>
|
||||||
<view class="circle circle-bottom"></view>
|
<view class="circle circle-bottom"></view>
|
||||||
</view>
|
</view>
|
||||||
<view class="right">
|
<view class="right">
|
||||||
<view>
|
<view>
|
||||||
<!-- 根据scopeType 判断是否是 平台、品类或店铺 -->
|
<!-- 根据scopeType 判断是否是 平台、品类或店铺 -->
|
||||||
<view v-if="item.scopeType">
|
<view class="coupon-title wes-3" v-if="item.scopeType">
|
||||||
<span v-if="item.scopeType == 'ALL' && item.id == 'platform'">全平台</span>
|
<span v-if="item.scopeType == 'ALL' && item.storeId == '0'">全平台</span>
|
||||||
<span v-if="item.scopeType == 'PORTION_CATEGORY'">仅限品类</span>
|
<span v-if="item.scopeType == 'PORTION_CATEGORY'">仅限品类</span>
|
||||||
<view v-else>{{ item.storeName == 'platform' ? '全平台' :item.storeName+'店铺' }}使用</view>
|
<view v-else>{{ item.storeName == 'platform' ? '全平台' :item.storeName+'店铺' }}使用
|
||||||
</view>
|
</view>
|
||||||
<view>有效期至:{{ item.endTime.split(" ")[0] }}</view>
|
</view>
|
||||||
</view>
|
<view v-if="item.endTime">有效期至:{{ item.endTime.split(" ")[0] }}</view>
|
||||||
<view class="receive" @click="receive(item)">
|
</view>
|
||||||
<text>点击</text><br />
|
<view class="receive" @click="receive(item)">
|
||||||
<text>领取</text>
|
<text>点击</text><br />
|
||||||
</view>
|
<text>领取</text>
|
||||||
<view class="bg-quan"> 券 </view>
|
</view>
|
||||||
</view>
|
<view class="bg-quan"> 券 </view>
|
||||||
</view>
|
</view>
|
||||||
<uni-load-more :status="loadStatus"></uni-load-more>
|
</view>
|
||||||
</scroll-view>
|
|
||||||
</swiper-item>
|
</div>
|
||||||
</swiper>
|
</div>
|
||||||
</view>
|
</div>
|
||||||
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { receiveCoupons } from "@/api/members.js";
|
import {
|
||||||
import { getAllCoupons } from "@/api/promotions.js";
|
receiveCoupons
|
||||||
export default {
|
} from "@/api/members.js";
|
||||||
data() {
|
import {
|
||||||
return {
|
getAllCoupons
|
||||||
loadStatus: "more", //下拉状态
|
} from "@/api/promotions.js";
|
||||||
whetherEmpty: false, //是否为空
|
export default {
|
||||||
couponList: [], // 优惠券列表
|
data() {
|
||||||
params: {
|
return {
|
||||||
pageNumber: 1,
|
loadStatus: "more", //下拉状态
|
||||||
pageSize: 10,
|
whetherEmpty: false, //是否为空
|
||||||
},
|
couponList: [], // 优惠券列表
|
||||||
storeId: "", //店铺 id
|
params: {
|
||||||
};
|
pageNumber: 1,
|
||||||
},
|
pageSize: 10,
|
||||||
onLoad(option) {
|
},
|
||||||
this.storeId = option.storeId;
|
storeId: "", //店铺 id,
|
||||||
this.getCoupon();
|
couponData: ""
|
||||||
},
|
};
|
||||||
onPullDownRefresh() {
|
},
|
||||||
//下拉刷新
|
onLoad(option) {
|
||||||
this.params.pageNumber = 1;
|
this.storeId = option.storeId;
|
||||||
this.couponList = [];
|
this.getCoupon();
|
||||||
this.getCoupon();
|
},
|
||||||
},
|
onReachBottom() {
|
||||||
methods: {
|
|
||||||
/**
|
this.loadMore()
|
||||||
* 获取当前优惠券
|
},
|
||||||
*/
|
onPullDownRefresh() {
|
||||||
getCoupon() {
|
//下拉刷新
|
||||||
uni.showLoading({
|
this.params.pageNumber = 1;
|
||||||
title: "加载中",
|
this.couponList = [];
|
||||||
});
|
this.getCoupon();
|
||||||
let submitData = { ...this.params };
|
},
|
||||||
// 判断当前是否有店铺
|
methods: {
|
||||||
this.storeId ? (submitData = { ...this.params, storeId: this.storeId }): "",
|
/**
|
||||||
getAllCoupons(submitData)
|
* 获取当前优惠券
|
||||||
.then((res) => {
|
*/
|
||||||
uni.hideLoading();
|
getCoupon() {
|
||||||
uni.stopPullDownRefresh();
|
uni.showLoading({
|
||||||
if (res.data.code == 200) {
|
title: "加载中",
|
||||||
// 如果请求成功,展示数据并进行展示
|
});
|
||||||
let data = res.data.result;
|
let submitData = {
|
||||||
if (data.total == 0) {
|
...this.params
|
||||||
// 当本次请求数据为空展示空信息
|
};
|
||||||
this.whetherEmpty = true;
|
// 判断当前是否有店铺
|
||||||
} else {
|
this.storeId ? (submitData = {
|
||||||
this.couponList.push(...data.records);
|
...this.params,
|
||||||
this.loadStatus = "noMore";
|
storeId: this.storeId
|
||||||
}
|
}) : "",
|
||||||
}
|
getAllCoupons(submitData)
|
||||||
})
|
.then((res) => {
|
||||||
.catch((err) => {
|
uni.hideLoading();
|
||||||
uni.hideLoading();
|
uni.stopPullDownRefresh();
|
||||||
});
|
if (res.data.code == 200) {
|
||||||
},
|
// 如果请求成功,展示数据并进行展示
|
||||||
/**
|
this.couponData = res.data.result
|
||||||
* 领取优惠券
|
if (this.couponData.total == 0) {
|
||||||
*/
|
// 当本次请求数据为空展示空信息
|
||||||
receive(item) {
|
this.whetherEmpty = true;
|
||||||
receiveCoupons(item.id).then((res) => {
|
} else {
|
||||||
if (res.data.code == 200) {
|
this.couponList.push(...this.couponData.records);
|
||||||
uni.showToast({
|
this.loadStatus = "noMore";
|
||||||
title: "领取成功",
|
}
|
||||||
icon: "none",
|
}
|
||||||
});
|
})
|
||||||
} else {
|
.catch((err) => {
|
||||||
uni.showToast({
|
uni.hideLoading();
|
||||||
title: res.data.message,
|
});
|
||||||
icon: "none",
|
},
|
||||||
});
|
/**
|
||||||
}
|
* 领取优惠券
|
||||||
});
|
*/
|
||||||
},
|
receive(item) {
|
||||||
/**
|
receiveCoupons(item.id).then((res) => {
|
||||||
* 加载更多
|
if (res.data.code == 200) {
|
||||||
*/
|
uni.showToast({
|
||||||
loadMore() {
|
title: "领取成功",
|
||||||
if (this.loadStatus != "noMore") {
|
icon: "none",
|
||||||
this.params.pageNumber++;
|
});
|
||||||
this.getAllCoupons();
|
} else {
|
||||||
}
|
uni.showToast({
|
||||||
},
|
title: res.data.message,
|
||||||
},
|
icon: "none",
|
||||||
onNavigationBarButtonTap(e) {
|
});
|
||||||
uni.navigateTo({
|
}
|
||||||
url: "/pages/cart/coupon/couponIntro",
|
});
|
||||||
});
|
},
|
||||||
},
|
/**
|
||||||
};
|
* 加载更多
|
||||||
|
*/
|
||||||
|
loadMore() {
|
||||||
|
if (this.couponData.total > this.params.pageNumber * this.params.pageSize) {
|
||||||
|
this.params.pageNumber++;
|
||||||
|
this.getCoupon();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
onNavigationBarButtonTap(e) {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: "/pages/cart/coupon/couponIntro",
|
||||||
|
});
|
||||||
|
},
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
<style>
|
<style>
|
||||||
page {
|
page {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.coupon-center {
|
.coupon-center {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
|
||||||
.couponList-scroll-content {
|
.swiper-box {
|
||||||
position: relative;
|
.coupon-item {
|
||||||
width: 100%;
|
display: flex;
|
||||||
display: flex;
|
align-items: center;
|
||||||
white-space: nowrap;
|
height: 220rpx;
|
||||||
align-items: center;
|
margin: 20rpx;
|
||||||
justify-content: space-between;
|
|
||||||
align-items: center;
|
|
||||||
background-color: $main-color;
|
|
||||||
color: #ffffff;
|
|
||||||
|
|
||||||
.tab-item {
|
.left {
|
||||||
width: 160rpx;
|
height: 100%;
|
||||||
height: 80rpx;
|
width: 260rpx;
|
||||||
line-height: 60rpx;
|
background-color: $light-color;
|
||||||
text-align: center;
|
position: relative;
|
||||||
display: inline-block;
|
|
||||||
}
|
|
||||||
|
|
||||||
.active {
|
.message {
|
||||||
border-bottom: 2px solid #ffffff;
|
color: $font-color-white;
|
||||||
broder-width: 60rpx;
|
display: flex;
|
||||||
font-size: 30rpx;
|
justify-content: center;
|
||||||
font-weight: 700;
|
align-items: center;
|
||||||
padding-bottom: 4rpx;
|
flex-direction: column;
|
||||||
}
|
margin-top: 40rpx;
|
||||||
}
|
|
||||||
|
|
||||||
.swiper-box {
|
view:nth-child(1) {
|
||||||
height: 100%;
|
font-weight: bold;
|
||||||
|
font-size: 60rpx;
|
||||||
|
}
|
||||||
|
|
||||||
.scroll-v {
|
view:nth-child(2) {
|
||||||
height: 100%;
|
font-size: $font-sm;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.coupon-item {
|
.wave-line {
|
||||||
display: flex;
|
height: 220rpx;
|
||||||
align-items: center;
|
width: 8rpx;
|
||||||
height: 220rpx;
|
position: absolute;
|
||||||
margin: 20rpx;
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
background-color: $light-color;
|
||||||
|
overflow: hidden;
|
||||||
|
|
||||||
.left {
|
.wave {
|
||||||
height: 100%;
|
width: 8rpx;
|
||||||
width: 260rpx;
|
height: 16rpx;
|
||||||
background-color: $light-color;
|
background-color: #ffffff;
|
||||||
position: relative;
|
border-radius: 0 16rpx 16rpx 0;
|
||||||
.message {
|
margin-top: 4rpx;
|
||||||
color: $font-color-white;
|
}
|
||||||
display: flex;
|
}
|
||||||
justify-content: center;
|
|
||||||
align-items: center;
|
|
||||||
flex-direction: column;
|
|
||||||
margin-top: 40rpx;
|
|
||||||
|
|
||||||
view:nth-child(1) {
|
.circle {
|
||||||
font-weight: bold;
|
width: 40rpx;
|
||||||
font-size: 60rpx;
|
height: 40rpx;
|
||||||
}
|
background-color: $bg-color;
|
||||||
|
position: absolute;
|
||||||
|
border-radius: 50%;
|
||||||
|
z-index: 111;
|
||||||
|
}
|
||||||
|
|
||||||
view:nth-child(2) {
|
.circle-top {
|
||||||
font-size: $font-sm;
|
top: -20rpx;
|
||||||
}
|
right: -20rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.wave-line {
|
.circle-bottom {
|
||||||
height: 220rpx;
|
bottom: -20rpx;
|
||||||
width: 8rpx;
|
right: -20rpx;
|
||||||
position: absolute;
|
}
|
||||||
top: 0;
|
}
|
||||||
left: 0;
|
|
||||||
background-color: $light-color;
|
|
||||||
overflow: hidden;
|
|
||||||
|
|
||||||
.wave {
|
.right {
|
||||||
width: 8rpx;
|
display: flex;
|
||||||
height: 16rpx;
|
justify-content: space-between;
|
||||||
background-color: #ffffff;
|
align-items: center;
|
||||||
border-radius: 0 16rpx 16rpx 0;
|
width: 450rpx;
|
||||||
margin-top: 4rpx;
|
font-size: $font-sm;
|
||||||
}
|
height: 100%;
|
||||||
}
|
background-color: #ffffff;
|
||||||
.circle {
|
overflow: hidden;
|
||||||
width: 40rpx;
|
position: relative;
|
||||||
height: 40rpx;
|
|
||||||
background-color: $bg-color;
|
|
||||||
position: absolute;
|
|
||||||
border-radius: 50%;
|
|
||||||
z-index: 111;
|
|
||||||
}
|
|
||||||
.circle-top {
|
|
||||||
top: -20rpx;
|
|
||||||
right: -20rpx;
|
|
||||||
}
|
|
||||||
.circle-bottom {
|
|
||||||
bottom: -20rpx;
|
|
||||||
right: -20rpx;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.right {
|
>view:nth-child(1) {
|
||||||
display: flex;
|
color: #666666;
|
||||||
justify-content: space-between;
|
margin-left: 20rpx;
|
||||||
align-items: center;
|
display: flex;
|
||||||
width: 450rpx;
|
height: 100%;
|
||||||
font-size: $font-sm;
|
flex-direction: column;
|
||||||
height: 100%;
|
justify-content: space-around;
|
||||||
background-color: #ffffff;
|
|
||||||
overflow: hidden;
|
|
||||||
position: relative;
|
|
||||||
> view:nth-child(1) {
|
|
||||||
color: #666666;
|
|
||||||
margin-left: 20rpx;
|
|
||||||
line-height: 3em;
|
|
||||||
> view:nth-child(1) {
|
|
||||||
color: #ff6262;
|
|
||||||
font-size: 30rpx;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.receive {
|
>view:nth-child(1) {
|
||||||
color: #ffffff;
|
color: #ff6262;
|
||||||
background-color: $main-color;
|
font-size: 30rpx;
|
||||||
border-radius: 50%;
|
}
|
||||||
width: 86rpx;
|
}
|
||||||
height: 86rpx;
|
|
||||||
text-align: center;
|
|
||||||
margin-right: 30rpx;
|
|
||||||
vertical-align: middle;
|
|
||||||
padding-top: 8rpx;
|
|
||||||
position: relative;
|
|
||||||
z-index: 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
.bg-quan {
|
.receive {
|
||||||
width: 244rpx;
|
color: #ffffff;
|
||||||
height: 244rpx;
|
background-color: $main-color;
|
||||||
border: 6rpx solid $main-color;
|
border-radius: 50%;
|
||||||
border-radius: 50%;
|
width: 86rpx;
|
||||||
opacity: 0.1;
|
height: 86rpx;
|
||||||
color: $main-color;
|
text-align: center;
|
||||||
text-align: center;
|
margin-right: 30rpx;
|
||||||
padding-top: 30rpx;
|
vertical-align: middle;
|
||||||
font-size: 130rpx;
|
padding-top: 8rpx;
|
||||||
position: absolute;
|
position: relative;
|
||||||
right: -54rpx;
|
z-index: 2;
|
||||||
bottom: -60rpx;
|
}
|
||||||
}
|
|
||||||
}
|
.bg-quan {
|
||||||
}
|
width: 244rpx;
|
||||||
}
|
height: 244rpx;
|
||||||
}
|
border: 6rpx solid $main-color;
|
||||||
|
border-radius: 50%;
|
||||||
|
opacity: 0.1;
|
||||||
|
color: $main-color;
|
||||||
|
text-align: center;
|
||||||
|
padding-top: 30rpx;
|
||||||
|
font-size: 130rpx;
|
||||||
|
position: absolute;
|
||||||
|
right: -54rpx;
|
||||||
|
bottom: -60rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.coupon-title {
|
||||||
|
width: 260rpx;
|
||||||
|
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="bottom-view">
|
<view class="bottom-view">
|
||||||
<view class="text">• 使用平台:{{
|
<view class="text">• 使用平台:{{
|
||||||
coupon.scopeType == 'ALL' && coupon.id == 'platform'
|
coupon.scopeType == 'ALL' && coupon.storeId == '0'
|
||||||
? "全平台"
|
? "全平台"
|
||||||
: coupon.scopeType == "PORTION_CATEGORY"
|
: coupon.scopeType == "PORTION_CATEGORY"
|
||||||
? "仅限品类"
|
? "仅限品类"
|
||||||
|
|||||||
@@ -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_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-else @click="clickWay(item)">
|
||||||
|
<text>取消</text><br />
|
||||||
|
<text>使用</text>
|
||||||
|
</view>
|
||||||
<view class="bg-quan">券</view>
|
<view class="bg-quan">券</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -69,6 +91,9 @@ export default {
|
|||||||
routerVal: "", //上级传参
|
routerVal: "", //上级传参
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
onLoad(options) {
|
||||||
|
this.routerVal = options;
|
||||||
|
},
|
||||||
watch: {
|
watch: {
|
||||||
current(val) {
|
current(val) {
|
||||||
console.log(this.$store.state.cantUseCoupons);
|
console.log(this.$store.state.cantUseCoupons);
|
||||||
@@ -80,6 +105,7 @@ export default {
|
|||||||
|
|
||||||
mounted() {
|
mounted() {
|
||||||
this.init();
|
this.init();
|
||||||
|
console.log(this.routerVal);
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
@@ -95,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) {
|
||||||
@@ -114,10 +140,11 @@ export default {
|
|||||||
</script>
|
</script>
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
.desc {
|
.desc {
|
||||||
height: 100%;
|
height: 220rpx;
|
||||||
|
flex: 2;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
justify-content: center;
|
justify-content: space-around;
|
||||||
}
|
}
|
||||||
.end-time,
|
.end-time,
|
||||||
.reason {
|
.reason {
|
||||||
@@ -204,14 +231,14 @@ export default {
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
width: 450rpx;
|
width: 450rpx;
|
||||||
font-size: $font-sm;
|
font-size: $font-sm;
|
||||||
height: 100%;
|
height: 220rpx;
|
||||||
background-color: #ffffff;
|
background-color: #ffffff;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
position: relative;
|
position: relative;
|
||||||
> view:nth-child(1) {
|
> view:nth-child(1) {
|
||||||
color: #666666;
|
color: #666666;
|
||||||
margin-left: 20rpx;
|
margin-left: 20rpx;
|
||||||
line-height: 3em;
|
|
||||||
> view:nth-child(1) {
|
> view:nth-child(1) {
|
||||||
color: #ff6262;
|
color: #ff6262;
|
||||||
font-size: 30rpx;
|
font-size: 30rpx;
|
||||||
@@ -232,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,7 +2,8 @@
|
|||||||
<view class="b-content">
|
<view class="b-content">
|
||||||
<view class="navbar">
|
<view class="navbar">
|
||||||
<!-- 循环出头部tab栏 -->
|
<!-- 循环出头部tab栏 -->
|
||||||
<view v-for="(item, index) in navList" :key="index" class="nav-item" @click="handleTabClick(index)"><text :class="{ current: tabCurrentIndex === index }">{{
|
<view v-for="(item, index) in navList" :key="index" class="nav-item" @click="handleTabClick(index)"><text
|
||||||
|
:class="{ current: tabCurrentIndex === index }">{{
|
||||||
item.text
|
item.text
|
||||||
}}</text></view>
|
}}</text></view>
|
||||||
</view>
|
</view>
|
||||||
@@ -11,9 +12,10 @@
|
|||||||
<scroll-view class="list-scroll-content" scroll-y @scrolltolower="loadData">
|
<scroll-view class="list-scroll-content" scroll-y @scrolltolower="loadData">
|
||||||
<!-- 空白页 -->
|
<!-- 空白页 -->
|
||||||
<u-empty mode="coupon" text="暂无优惠券了" v-if="navItem.wheterEmpty"></u-empty>
|
<u-empty mode="coupon" text="暂无优惠券了" v-if="navItem.wheterEmpty"></u-empty>
|
||||||
|
|
||||||
<!-- 数据 -->
|
<!-- 数据 -->
|
||||||
<view v-if="navItem.dataList && coupon" class="coupon-item" :class="{ 'coupon-used': navIndex != 0 }" v-for="(coupon, index) in navItem.dataList" :key="index">
|
<view v-if="navItem.dataList && coupon" class="coupon-item" :class="{ 'coupon-used': navIndex != 0 }"
|
||||||
|
v-for="(coupon, index) in navItem.dataList" :key="index">
|
||||||
<view class="left">
|
<view class="left">
|
||||||
<view class="wave-line">
|
<view class="wave-line">
|
||||||
<view class="wave" v-for="(item, index) in 12" :key="index"></view>
|
<view class="wave" v-for="(item, index) in 12" :key="index"></view>
|
||||||
@@ -30,7 +32,7 @@
|
|||||||
<view class="content">
|
<view class="content">
|
||||||
<view class="title-1">{{ coupon.title }}</view>
|
<view class="title-1">{{ coupon.title }}</view>
|
||||||
<view class="title-2">使用平台:{{
|
<view class="title-2">使用平台:{{
|
||||||
coupon.scopeType == 'ALL' && coupon.id == 'platform'
|
coupon.scopeType == 'ALL' && coupon.storeId == '0'
|
||||||
? "全平台"
|
? "全平台"
|
||||||
: coupon.scopeType == "PORTION_CATEGORY"
|
: coupon.scopeType == "PORTION_CATEGORY"
|
||||||
? "仅限品类"
|
? "仅限品类"
|
||||||
@@ -114,6 +116,8 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
onShow() {
|
onShow() {
|
||||||
|
this.navList[this.tabCurrentIndex].params.pageNumber = 1
|
||||||
|
this.navList[this.tabCurrentIndex].dataList = [];
|
||||||
this.getData();
|
this.getData();
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -158,7 +162,6 @@ export default {
|
|||||||
this.navList[index].dataList.push(...data);
|
this.navList[index].dataList.push(...data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
console.log(this.navList[index].dataList)
|
|
||||||
uni.hideLoading();
|
uni.hideLoading();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@@ -185,13 +188,13 @@ export default {
|
|||||||
* 立即使用优惠券
|
* 立即使用优惠券
|
||||||
*/
|
*/
|
||||||
useItNow(item) {
|
useItNow(item) {
|
||||||
if (item.storeId) {
|
if (item.storeId && item.storeId!='0') {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: `/pages/product/shopPage?id=${item.storeId}`,
|
url: `/pages/product/shopPage?id=${item.storeId}`,
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
uni.switchTab({
|
uni.switchTab({
|
||||||
url: "/pages/tabbar/home/index",
|
url: "/pages/navigation/search/searchPage",
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -98,18 +98,18 @@
|
|||||||
},
|
},
|
||||||
onBackPress(e) {
|
onBackPress(e) {
|
||||||
if (e.from == "backbutton") {
|
if (e.from == "backbutton") {
|
||||||
if(this.routerVal.recharge_sn){
|
if(this.routerVal.recharge_sn){
|
||||||
uni.switchTab({
|
uni.switchTab({
|
||||||
url: '/pages/tabbar/user/my'
|
url: '/pages/tabbar/user/my'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
uni.redirectTo({
|
uni.navigateTo({
|
||||||
url: "/pages/order/myOrder?status=0",
|
url: "/pages/order/myOrder?status=0",
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
return true; //阻止默认返回行为
|
return true; //阻止默认返回行为
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.cashierData();
|
this.cashierData();
|
||||||
@@ -139,6 +139,7 @@
|
|||||||
// 判断当前是否是充值
|
// 判断当前是否是充值
|
||||||
this.sn = this.routerVal.recharge_sn;
|
this.sn = this.routerVal.recharge_sn;
|
||||||
this.orderType = "RECHARGE";
|
this.orderType = "RECHARGE";
|
||||||
|
|
||||||
} else if (this.routerVal.trade_sn) {
|
} else if (this.routerVal.trade_sn) {
|
||||||
this.sn = this.routerVal.trade_sn;
|
this.sn = this.routerVal.trade_sn;
|
||||||
this.orderType = "TRADE";
|
this.orderType = "TRADE";
|
||||||
@@ -161,16 +162,16 @@
|
|||||||
});
|
});
|
||||||
// #endif
|
// #endif
|
||||||
|
|
||||||
// #ifndef MP-WEIXIN
|
|
||||||
if(this.routerVal.recharge_sn){
|
if(this.routerVal.recharge_sn){
|
||||||
this.payList = res.data.result.support.filter((item) => {
|
this.payList = res.data.result.support.filter((item) => {
|
||||||
return item != "WALLET";
|
return item != "WALLET";
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
this.payList = res.data.result.support;
|
this.payList = res.data.result.support;
|
||||||
}
|
}
|
||||||
// #ifndef APP-PLUS
|
// #ifdef H5
|
||||||
//判断是否微信浏览器
|
//判断是否微信浏览器
|
||||||
var ua = window.navigator.userAgent.toLowerCase();
|
var ua = window.navigator.userAgent.toLowerCase();
|
||||||
if (ua.match(/MicroMessenger/i) == 'micromessenger') {
|
if (ua.match(/MicroMessenger/i) == 'micromessenger') {
|
||||||
@@ -178,11 +179,17 @@
|
|||||||
this.payList = res.data.result.support.filter((item) => {
|
this.payList = res.data.result.support.filter((item) => {
|
||||||
return item != "ALIPAY";
|
return item != "ALIPAY";
|
||||||
});
|
});
|
||||||
|
// 充值的话仅保留微信支付
|
||||||
|
if(this.orderType == "RECHARGE"){
|
||||||
|
this.payList = res.data.result.support.filter((item) => {
|
||||||
|
return item == "WECHAT";
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
// #endif
|
// #endif
|
||||||
|
|
||||||
// #endif
|
|
||||||
|
|
||||||
|
|
||||||
this.walletValue = res.data.result.walletValue;
|
this.walletValue = res.data.result.walletValue;
|
||||||
@@ -226,13 +233,18 @@
|
|||||||
const paymentMethod = payment;
|
const paymentMethod = payment;
|
||||||
// 客户端类型 APP/NATIVE/JSAPI/H5
|
// 客户端类型 APP/NATIVE/JSAPI/H5
|
||||||
const paymentClient = this.paymentClient;
|
const paymentClient = this.paymentClient;
|
||||||
|
|
||||||
|
uni.showLoading({
|
||||||
|
title: "正在唤起支付...",
|
||||||
|
mask:true
|
||||||
|
});
|
||||||
|
|
||||||
// #ifdef APP-PLUS
|
// #ifdef APP-PLUS
|
||||||
//APP pay
|
//APP pay
|
||||||
// 初始化支付签名
|
// 初始化支付签名
|
||||||
await API_Trade.initiatePay(paymentMethod, paymentClient, params).then(
|
await API_Trade.initiatePay(paymentMethod, paymentClient, params).then(
|
||||||
(signXml) => {
|
(signXml) => {
|
||||||
|
uni.hideLoading();
|
||||||
//如果支付异常
|
//如果支付异常
|
||||||
if (!signXml.data.success) {
|
if (!signXml.data.success) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
@@ -241,33 +253,39 @@
|
|||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
let payForm = signXml.data.result;
|
let payForm = signXml.data.result;
|
||||||
|
|
||||||
let paymentType = paymentMethod === "WECHAT" ? "wxpay" : "alipay";
|
let paymentType = paymentMethod === "WECHAT" ? "wxpay" : "alipay";
|
||||||
uni.requestPayment({
|
|
||||||
provider: paymentType,
|
if(paymentMethod === "WALLET"){
|
||||||
orderInfo: payForm,
|
uni.showToast({
|
||||||
success: (e) => {
|
icon: "none",
|
||||||
console.log(e);
|
title: "支付成功!",
|
||||||
uni.showToast({
|
});
|
||||||
icon: "none",
|
this.callback(paymentMethod)
|
||||||
title: "支付成功!",
|
}
|
||||||
});
|
else{
|
||||||
|
uni.requestPayment({
|
||||||
this.callback(paymentMethod)
|
provider: paymentType,
|
||||||
|
orderInfo: payForm || '',
|
||||||
|
success: (e) => {
|
||||||
},
|
uni.showToast({
|
||||||
fail: (e) => {
|
icon: "none",
|
||||||
console.log(this);
|
title: "支付成功!",
|
||||||
this.exception = e;
|
});
|
||||||
uni.showModal({
|
this.callback(paymentMethod)
|
||||||
content: "支付失败,如果您已支付,请勿反复支付",
|
},
|
||||||
showCancel: false,
|
fail: (e) => {
|
||||||
});
|
console.log(this);
|
||||||
},
|
this.exception = e;
|
||||||
});
|
uni.showModal({
|
||||||
|
content: "支付失败,如果您已支付,请勿反复支付",
|
||||||
|
showCancel: false,
|
||||||
|
});
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
//APP pay
|
//APP pay
|
||||||
|
|||||||
@@ -1,427 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div class="wrapper">
|
|
||||||
<u-popup class="popup" v-model="buyMask" :height="setup.height" closeable :mode="setup.mode"
|
|
||||||
:mask-close-able="isClose" :mask="isMask" :border-radius="setup.radius" @close="closeMask()">
|
|
||||||
<!-- 商品 -->
|
|
||||||
<view class="goods-box bottom">
|
|
||||||
<view class="goods-header">
|
|
||||||
<view class="goods-img">
|
|
||||||
<u-image width="200rpx" border-radius="20" class="uimage" height="200rpx"
|
|
||||||
:src="selectedSpecImg ? selectedSpecImg : goodsDetail.thumbnail"></u-image>
|
|
||||||
</view>
|
|
||||||
<view class="goods-skus">
|
|
||||||
<!-- 有活动商品价格 -->
|
|
||||||
<view class="goods-price " v-if="goodsDetail.promotionPrice">
|
|
||||||
<span>
|
|
||||||
¥
|
|
||||||
<span class="goods-price-promotionShow goods-price-bigshow"
|
|
||||||
v-if="goodsDetail.promotionPrice">{{ formatPrice(goodsDetail.promotionPrice)[0] }}</span>
|
|
||||||
.{{ formatPrice(goodsDetail.promotionPrice)[1] }}
|
|
||||||
<span></span>
|
|
||||||
</span>
|
|
||||||
<div class="promotion-box">
|
|
||||||
¥
|
|
||||||
<span class="goods-price-bigshow">{{
|
|
||||||
formatPrice(goodsDetail.price)[0]
|
|
||||||
}}</span>
|
|
||||||
.{{ formatPrice(goodsDetail.price)[1] }}
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</view>
|
|
||||||
<!-- 正常商品的价格 -->
|
|
||||||
<view class="goods-price" v-else>
|
|
||||||
<span>
|
|
||||||
¥
|
|
||||||
<span class="goods-price-bigshow">{{
|
|
||||||
formatPrice(goodsDetail.price)[0]
|
|
||||||
}}</span>
|
|
||||||
.{{ formatPrice(goodsDetail.price)[1] }}
|
|
||||||
</span>
|
|
||||||
</view>
|
|
||||||
<view class="goods-check-skus">
|
|
||||||
已选
|
|
||||||
<span class="goods-check-skus-name">
|
|
||||||
{{ selectName }}
|
|
||||||
<span>,{{ num }}个</span>
|
|
||||||
</span>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<!-- 商品信息 -->
|
|
||||||
<view class="goods-skus-box">
|
|
||||||
<!-- 规格 -->
|
|
||||||
<view class="goods-skus-view" :key="specIndex" v-for="(spec, specIndex) in formatList">
|
|
||||||
<view class="skus-view-list">
|
|
||||||
<view class="view-class-title">{{ spec.name }}</view>
|
|
||||||
<view :class="{ active: spec_val.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" :color="numberBox.color" :input-width="numberBox.width"
|
|
||||||
:input-height="numberBox.height" :size="numberBox.size" :min="1" v-model="num">
|
|
||||||
</u-number-box>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<!-- 按钮 -->
|
|
||||||
<view class="btns">
|
|
||||||
|
|
||||||
<view class="box-btn card" v-if="buyType != 'PINTUAN' && goodsDetail.goodsType!='VIRTUAL_GOODS'"
|
|
||||||
@click="addToCartOrBuy('cart')">加入购物车</view>
|
|
||||||
<view class="box-btn buy" @click="addToCartOrBuy('buy')">立即购买</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</u-popup>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
<script>
|
|
||||||
import * as API_trade from "@/api/trade.js";
|
|
||||||
import setup from "./popup";
|
|
||||||
export default {
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
setup,
|
|
||||||
num: 1,
|
|
||||||
// 步进器的大小尺寸单位是 rpx
|
|
||||||
numberBox: {
|
|
||||||
width: "50",
|
|
||||||
height: "50",
|
|
||||||
size: "22",
|
|
||||||
color: "#333",
|
|
||||||
bgColor: "#fff",
|
|
||||||
},
|
|
||||||
selectName: "", //选中商品的昵称
|
|
||||||
selectSkuList: "", //选中商铺sku,
|
|
||||||
selectedSpecImg: "", //选中的图片路径
|
|
||||||
buyType: "", //用于存储促销,拼团等活动类型
|
|
||||||
parentOrder: "", //父级拼团活动的数据 - 如果是团员则有数据
|
|
||||||
formatList: [],
|
|
||||||
currentSelceted: [],
|
|
||||||
skuList: "",
|
|
||||||
isMask: false, //是否显示遮罩层
|
|
||||||
isClose: false, //是否可以点击遮罩关闭
|
|
||||||
};
|
|
||||||
},
|
|
||||||
props: [
|
|
||||||
"goodsDetail", //商品详情
|
|
||||||
"buyMask",
|
|
||||||
"selectedSku",
|
|
||||||
"goodsSpec",
|
|
||||||
"addr",
|
|
||||||
],
|
|
||||||
watch: {
|
|
||||||
buyType: {
|
|
||||||
handler(val) {
|
|
||||||
this.buyType = val;
|
|
||||||
},
|
|
||||||
immediate: true,
|
|
||||||
},
|
|
||||||
selectSkuList: {
|
|
||||||
handler(val, oldval) {
|
|
||||||
this.$emit("changed", val);
|
|
||||||
},
|
|
||||||
deep: true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
|
|
||||||
methods: {
|
|
||||||
// 格式化金钱 1999 --> [1999,00]
|
|
||||||
formatPrice(val) {
|
|
||||||
if (typeof val == "undefined") {
|
|
||||||
return val;
|
|
||||||
}
|
|
||||||
return val.toFixed(2).split(".");
|
|
||||||
},
|
|
||||||
|
|
||||||
closeMask() {
|
|
||||||
this.$emit("closeBuy", false);
|
|
||||||
},
|
|
||||||
|
|
||||||
/**点击规格 */
|
|
||||||
handleClickSpec(val, index, specValue) {
|
|
||||||
this.$set(this.currentSelceted, index, specValue.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.currentSelceted[n]) {
|
|
||||||
matched = false;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (matched) {
|
|
||||||
return i;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
this.selectSkuList = {
|
|
||||||
spec: {
|
|
||||||
specName: val.name,
|
|
||||||
specValue: specValue.value,
|
|
||||||
},
|
|
||||||
data: this.goodsDetail,
|
|
||||||
};
|
|
||||||
this.selectName = specValue.value;
|
|
||||||
|
|
||||||
this.$emit("handleClickSku", {
|
|
||||||
skuId: selectedSkuId.skuId,
|
|
||||||
goodsId: this.goodsDetail.goodsId,
|
|
||||||
});
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 添加到购物车或购买
|
|
||||||
*/
|
|
||||||
addToCartOrBuy(val) {
|
|
||||||
if (!this.selectSkuList) {
|
|
||||||
uni.showToast({
|
|
||||||
title: "请选择规格商品",
|
|
||||||
icon: "none",
|
|
||||||
});
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
let data = {
|
|
||||||
skuId: this.goodsDetail.id,
|
|
||||||
num: this.num,
|
|
||||||
};
|
|
||||||
|
|
||||||
if (val == "cart") {
|
|
||||||
API_trade.addToCart(data).then((res) => {
|
|
||||||
if (res.data.code == 200) {
|
|
||||||
uni.showToast({
|
|
||||||
title: "商品已添加到购物车",
|
|
||||||
icon: "none",
|
|
||||||
});
|
|
||||||
|
|
||||||
this.$emit("queryCart");
|
|
||||||
this.closeMask();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
// 判断是否拼团商品
|
|
||||||
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({
|
|
||||||
url: `/pages/order/fillorder?way=${data.cartType}&addr=${
|
|
||||||
this.addr.id || ""
|
|
||||||
}&parentOrder=${encodeURIComponent(
|
|
||||||
JSON.stringify(this.parentOrder)
|
|
||||||
)}`,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 直接购买
|
|
||||||
*/
|
|
||||||
buy(data) {
|
|
||||||
API_trade.addToCart(data).then((res) => {
|
|
||||||
if (res.data.success) {
|
|
||||||
uni.navigateTo({
|
|
||||||
url: `/pages/order/fillorder?way=${
|
|
||||||
data.cartType
|
|
||||||
}&addr=${""}&parentOrder=${encodeURIComponent(
|
|
||||||
JSON.stringify(this.parentOrder)
|
|
||||||
)}`,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
|
|
||||||
formatSku(list) {
|
|
||||||
// 格式化数据
|
|
||||||
|
|
||||||
let arr = [{}];
|
|
||||||
list.forEach((item, index) => {
|
|
||||||
item.specValues.forEach((spec, specIndex) => {
|
|
||||||
let name = spec.specName;
|
|
||||||
let values = {
|
|
||||||
value: spec.specValue,
|
|
||||||
quantity: item.quantity,
|
|
||||||
};
|
|
||||||
if (name === "images") {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
arr.forEach((arrItem, arrIndex) => {
|
|
||||||
if (
|
|
||||||
arrItem.name == name &&
|
|
||||||
arrItem.values &&
|
|
||||||
!arrItem.values.find((i) => i.value === values.value)
|
|
||||||
) {
|
|
||||||
arrItem.values.push(values);
|
|
||||||
}
|
|
||||||
|
|
||||||
let keys = arr.map((key) => {
|
|
||||||
return key.name;
|
|
||||||
});
|
|
||||||
if (!keys.includes(name)) {
|
|
||||||
arr.push({
|
|
||||||
name: name,
|
|
||||||
values: [values],
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
arr.shift();
|
|
||||||
this.formatList = arr;
|
|
||||||
|
|
||||||
list.forEach((item) => {
|
|
||||||
if (item.skuId === this.goodsDetail.id) {
|
|
||||||
item.specValues
|
|
||||||
.filter((i) => i.specName !== "images")
|
|
||||||
.forEach((value, _index) => {
|
|
||||||
this.currentSelceted[_index] = value.specValue;
|
|
||||||
|
|
||||||
this.selectName = value.specValue;
|
|
||||||
|
|
||||||
this.selectSkuList = {
|
|
||||||
spec: value,
|
|
||||||
data: this.goodsDetail,
|
|
||||||
};
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
this.skuList = list;
|
|
||||||
},
|
|
||||||
},
|
|
||||||
|
|
||||||
mounted() {
|
|
||||||
this.formatSku(this.goodsSpec);
|
|
||||||
|
|
||||||
console.log(this.goodsDetail);
|
|
||||||
},
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
@import "./popup.scss";
|
|
||||||
|
|
||||||
.buy {
|
|
||||||
background-image: linear-gradient(135deg, #ffba0d, #ffc30d 69%, #ffcf0d);
|
|
||||||
box-shadow: 0 2px 6px 0 rgba(255, 65, 66, 0.2);
|
|
||||||
}
|
|
||||||
|
|
||||||
.card {
|
|
||||||
background-image: linear-gradient(135deg, #f2140c, #f2270c 70%, #f24d0c);
|
|
||||||
box-shadow: 0 2px 6px 0 rgba(255, 65, 66, 0.2);
|
|
||||||
}
|
|
||||||
|
|
||||||
/deep/.u-icon-plus,
|
|
||||||
.u-icon-minus,
|
|
||||||
.u-icon-disabled {
|
|
||||||
height: 30rpx !important;
|
|
||||||
background: #fff !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.goods-skus-number {
|
|
||||||
justify-content: space-between;
|
|
||||||
display: flex;
|
|
||||||
}
|
|
||||||
|
|
||||||
/deep/ .uni-scroll-view {
|
|
||||||
overflow: hidden !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.active {
|
|
||||||
background: $price-light-color !important;
|
|
||||||
border: 2rpx solid $price-color;
|
|
||||||
font-weight: bold;
|
|
||||||
color: $price-color !important;
|
|
||||||
box-sizing: border-box;
|
|
||||||
}
|
|
||||||
|
|
||||||
.goods-skus-box {
|
|
||||||
overflow-y: auto;
|
|
||||||
height: 610rpx;
|
|
||||||
// #ifdef MP-WEIXIN
|
|
||||||
height: 570rpx;
|
|
||||||
// #endif
|
|
||||||
margin-bottom: 10rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.goods-skus-view {
|
|
||||||
overflow: hidden;
|
|
||||||
|
|
||||||
.skus-view-list {
|
|
||||||
> .skus-view-item {
|
|
||||||
flex: 1;
|
|
||||||
padding: 0 36rpx;
|
|
||||||
|
|
||||||
overflow: hidden;
|
|
||||||
height: 60rpx;
|
|
||||||
line-height: 60rpx;
|
|
||||||
float: left;
|
|
||||||
text-align: center;
|
|
||||||
margin-left: 24rpx;
|
|
||||||
margin-bottom: 20rpx;
|
|
||||||
font-size: 22rpx;
|
|
||||||
color: #262626;
|
|
||||||
background: #f2f2f2;
|
|
||||||
border-radius: 30rpx;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.goods-header {
|
|
||||||
height: 200rpx;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
margin-bottom: 36rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.goods-box {
|
|
||||||
padding: 50rpx 36rpx 0 36rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.goods-skus {
|
|
||||||
padding: 0 20rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.goods-price {
|
|
||||||
color: $price-color;
|
|
||||||
line-height: 80rpx;
|
|
||||||
display: flex;
|
|
||||||
}
|
|
||||||
.promotion-box {
|
|
||||||
line-height: 1;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
text-decoration: line-through;
|
|
||||||
color: #999;
|
|
||||||
margin-left: 10rpx;
|
|
||||||
/deep/ span {
|
|
||||||
font-size: 30rpx;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.promotion {
|
|
||||||
font-size: 30rpx;
|
|
||||||
}
|
|
||||||
.goods-price-promotionShow {
|
|
||||||
font-size: 48rpx;
|
|
||||||
}
|
|
||||||
.goods-check-skus {
|
|
||||||
font-size: 24rpx;
|
|
||||||
color: #999;
|
|
||||||
> .goods-check-skus-name {
|
|
||||||
margin-left: 4rpx;
|
|
||||||
}
|
|
||||||
> span {
|
|
||||||
color: #333;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
|
|
||||||
|
|
||||||
export default {
|
|
||||||
height:"1000rpx", //弹出层高度
|
|
||||||
mode:"bottom", //弹出层位置
|
|
||||||
radius:"32", //圆角 rpx,
|
|
||||||
close:false //能否点击遮罩退出
|
|
||||||
}
|
|
||||||
@@ -1,37 +0,0 @@
|
|||||||
.view-class-title {
|
|
||||||
font-size: 26rpx;
|
|
||||||
color: #262626;
|
|
||||||
|
|
||||||
font-weight: 700;
|
|
||||||
height: 80rpx;
|
|
||||||
line-height: 80rpx;
|
|
||||||
}
|
|
||||||
.confirmBtn {
|
|
||||||
width: 90%;
|
|
||||||
}
|
|
||||||
.confirmBtn,
|
|
||||||
.box-btn {
|
|
||||||
line-height: 80rpx;
|
|
||||||
height: 80rpx;
|
|
||||||
|
|
||||||
background: $price-color;
|
|
||||||
color: #fff;
|
|
||||||
border-radius: 200px;
|
|
||||||
text-align: center;
|
|
||||||
margin: 5rpx auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
.btns {
|
|
||||||
display: flex;
|
|
||||||
width: 100%;
|
|
||||||
|
|
||||||
margin: 0 auto;
|
|
||||||
}
|
|
||||||
.goods-price-bigshow {
|
|
||||||
font-size: 48rpx;
|
|
||||||
font-weight: bold;
|
|
||||||
}
|
|
||||||
.box-btn {
|
|
||||||
flex: 1;
|
|
||||||
margin: 0 10rpx;
|
|
||||||
}
|
|
||||||
@@ -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>
|
||||||
@@ -28,7 +30,8 @@
|
|||||||
<div class="saveBtn" @click="save">保存</div>
|
<div class="saveBtn" @click="save">保存</div>
|
||||||
</u-form>
|
</u-form>
|
||||||
|
|
||||||
<m-city :provinceData="list" headTitle="区域选择" ref="cityPicker" @funcValue="getpickerParentValue" pickerSize="4"></m-city>
|
<m-city :provinceData="list" headTitle="区域选择" ref="cityPicker" @funcValue="getpickerParentValue" pickerSize="4">
|
||||||
|
</m-city>
|
||||||
|
|
||||||
<uniMap v-if="mapFlage" @close="closeMap" @callback="callBackAddress" />
|
<uniMap v-if="mapFlage" @close="closeMap" @callback="callBackAddress" />
|
||||||
</div>
|
</div>
|
||||||
@@ -149,7 +152,7 @@ export default {
|
|||||||
delete this.form.___path;
|
delete this.form.___path;
|
||||||
addAddress(this.form).then((res) => {
|
addAddress(this.form).then((res) => {
|
||||||
if (res.data.success) {
|
if (res.data.success) {
|
||||||
uni.navigateBack();
|
uni.navigateBack();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
@@ -159,9 +162,7 @@ export default {
|
|||||||
delete this.form.updateTime;
|
delete this.form.updateTime;
|
||||||
editAddress(this.form).then((res) => {
|
editAddress(this.form).then((res) => {
|
||||||
if (res.data.success) {
|
if (res.data.success) {
|
||||||
uni.navigateTo({
|
uni.navigateBack();
|
||||||
url: `/${beforePage.route}`,
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -190,8 +191,8 @@ export default {
|
|||||||
return _child.id == item.id;
|
return _child.id == item.id;
|
||||||
});
|
});
|
||||||
|
|
||||||
this.form.lat = _town[0].center.split(",")[0];
|
this.form.lat = _town[0].center.split(",")[1];
|
||||||
this.form.lon = _town[0].center.split(",")[1];
|
this.form.lon = _town[0].center.split(",")[0];
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -86,23 +86,9 @@ export default {
|
|||||||
* 进入页面检测当前账户是否登录
|
* 进入页面检测当前账户是否登录
|
||||||
*/
|
*/
|
||||||
onShow() {
|
onShow() {
|
||||||
let that = this;
|
if (this.$options.filters.tipsToLogin()) {
|
||||||
if (this.$options.filters.isLogin("auth")) {
|
|
||||||
this.getAddressList();
|
this.getAddressList();
|
||||||
} else {
|
}
|
||||||
uni.showModal({
|
|
||||||
title: "提示",
|
|
||||||
content: "检测到您的账号还未登录,是否去登录?",
|
|
||||||
confirmColor: this.$lightColor,
|
|
||||||
success: function (res) {
|
|
||||||
if (res.confirm) {
|
|
||||||
that.$options.filters.navigateToLogin();
|
|
||||||
} else if (res.cancel) {
|
|
||||||
uni.navigateBack();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
});
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
//获取地址列表
|
//获取地址列表
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="wap">
|
<view class="wap">
|
||||||
<u-navbar back-text="" title="预存款列表">
|
<u-navbar title="预存款列表">
|
||||||
</u-navbar>
|
</u-navbar>
|
||||||
<view class="wrapper-show-money">
|
<view class="wrapper-show-money">
|
||||||
<view class="money-view">
|
<view class="money-view">
|
||||||
@@ -28,7 +28,7 @@
|
|||||||
</view>
|
</view>
|
||||||
|
|
||||||
<u-empty v-if="datas.length==0" mode="history" text="暂无记录" />
|
<u-empty v-if="datas.length==0" mode="history" text="暂无记录" />
|
||||||
<u-loadmore v-else bg-color='#f8f8f8' :status="status" />
|
|
||||||
</scroll-view>
|
</scroll-view>
|
||||||
|
|
||||||
</swiper-item>
|
</swiper-item>
|
||||||
@@ -45,7 +45,7 @@ export default {
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
walletNum: 0,
|
walletNum: 0,
|
||||||
status: "loadmore",
|
|
||||||
current: 0,
|
current: 0,
|
||||||
swiperCurrent: 0,
|
swiperCurrent: 0,
|
||||||
userInfo: "", //用户详情信息
|
userInfo: "", //用户详情信息
|
||||||
@@ -82,27 +82,23 @@ export default {
|
|||||||
|
|
||||||
/**分页获取预存款充值记录 */
|
/**分页获取预存款充值记录 */
|
||||||
getRecharge() {
|
getRecharge() {
|
||||||
this.status = "loading";
|
|
||||||
getUserRecharge(this.params).then((res) => {
|
getUserRecharge(this.params).then((res) => {
|
||||||
if (res.data.success) {
|
if (res.data.success) {
|
||||||
if (res.data.result.records.length != 0) {
|
if (res.data.result.records.length != 0) {
|
||||||
this.status = "loadmore";
|
|
||||||
this.datas.push(...res.data.result.records);
|
this.datas.push(...res.data.result.records);
|
||||||
} else {
|
|
||||||
this.status = "nomore";
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
getWallet() {
|
getWallet() {
|
||||||
this.status = "loading";
|
|
||||||
getWalletLog(this.params).then((res) => {
|
getWalletLog(this.params).then((res) => {
|
||||||
if (res.data.success) {
|
if (res.data.success) {
|
||||||
if (res.data.result.records.length != 0) {
|
if (res.data.result.records.length != 0) {
|
||||||
this.datas.push(...res.data.result.records);
|
this.datas.push(...res.data.result.records);
|
||||||
} else {
|
|
||||||
this.status = "nomore";
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -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,7 +1,12 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="log-list">
|
<view class="log-list">
|
||||||
<!-- 提现记录 -->
|
<!-- 提现记录 -->
|
||||||
<view class="log-way" v-if="cashLogData.length != 0" v-for="(item, index) in cashLogData" :key="index">
|
<view
|
||||||
|
class="log-way"
|
||||||
|
v-if="cashLogData.length != 0"
|
||||||
|
v-for="(item, index) in cashLogData"
|
||||||
|
:key="index"
|
||||||
|
>
|
||||||
<view class="log-item">
|
<view class="log-item">
|
||||||
<view class="log-item-view">
|
<view class="log-item-view">
|
||||||
<view class="title">{{
|
<view class="title">{{
|
||||||
@@ -20,21 +25,31 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<!-- 分销业绩 -->
|
<!-- 分销业绩 -->
|
||||||
<view class="log-way" v-if="achievementData.length != 0" v-for="(item, index) in achievementData" :key="index">
|
<view
|
||||||
|
class="log-way"
|
||||||
|
v-if="achievementData.length != 0"
|
||||||
|
v-for="(item, index) in achievementData"
|
||||||
|
:key="index"
|
||||||
|
>
|
||||||
<view class="log-item">
|
<view class="log-item">
|
||||||
<view 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>
|
||||||
@@ -86,7 +101,7 @@ export default {
|
|||||||
});
|
});
|
||||||
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;
|
||||||
@@ -101,7 +116,7 @@ export default {
|
|||||||
});
|
});
|
||||||
cashLog(this.params).then((res) => {
|
cashLog(this.params).then((res) => {
|
||||||
if (res.data.success && res.data.result.records.length >= 1) {
|
if (res.data.success && res.data.result.records.length >= 1) {
|
||||||
this.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;
|
||||||
@@ -139,6 +154,19 @@ export default {
|
|||||||
.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>
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="wrapper">
|
<div class="wrapper">
|
||||||
<u-parse v-html="res.content"></u-parse>
|
<u-parse :show-with-animation="true" :lazy-load="true" :selectable="true" :html="res.content"></u-parse>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -1,422 +1,440 @@
|
|||||||
<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,
|
||||||
|
deleteGoodsCollection,
|
||||||
<script>
|
deleteStoreCollection,
|
||||||
import {
|
} from "@/api/members.js";
|
||||||
getGoodsCollection,
|
export default {
|
||||||
deleteGoodsCollection,
|
data() {
|
||||||
deleteStoreCollection,
|
return {
|
||||||
} from "@/api/members.js";
|
lightColor:this.$lightColor,
|
||||||
export default {
|
// 商品左滑侧边栏
|
||||||
data() {
|
LeftOptions: [{
|
||||||
return {
|
text: "取消",
|
||||||
// 商品左滑侧边栏
|
style: {
|
||||||
LeftOptions: [
|
backgroundColor: this.$lightColor,
|
||||||
{
|
},
|
||||||
text: "取消",
|
}, ],
|
||||||
style: {
|
tabCurrentIndex: 0, //tab的下标默认为0,也就是说会默认请求商品
|
||||||
backgroundColor: this.$lightColor,
|
navList: [
|
||||||
},
|
//tab显示数据
|
||||||
},
|
{
|
||||||
],
|
name: "商品(0)",
|
||||||
tabCurrentIndex: 0, //tab的下标默认为0,也就是说会默认请求商品
|
|
||||||
navList: [
|
params: {
|
||||||
//tab显示数据
|
pageNumber: 1,
|
||||||
{
|
pageSize: 10,
|
||||||
text: "商品(0)",
|
},
|
||||||
loadingType: "more",
|
},
|
||||||
params: {
|
{
|
||||||
pageNumber: 1,
|
name: "店铺(0)",
|
||||||
pageSize: 10,
|
|
||||||
},
|
params: {
|
||||||
},
|
pageNumber: 1,
|
||||||
{
|
pageSize: 10,
|
||||||
text: "店铺(0)",
|
},
|
||||||
loadingType: "more",
|
},
|
||||||
params: {
|
],
|
||||||
pageNumber: 1,
|
|
||||||
pageSize: 10,
|
goodsEmpty: false, //商品数据是否为空
|
||||||
},
|
storeEmpty: false, //店铺数据是否为空
|
||||||
},
|
goodList: [], //商品集合
|
||||||
],
|
storeList: [], //店铺集合
|
||||||
goodsLoad: "more", //商品加载
|
};
|
||||||
storeLoad: "more", //店铺加载
|
},
|
||||||
goodsEmpty: false, //商品数据是否为空
|
onLoad() {
|
||||||
storeEmpty: false, //店铺数据是否为空
|
this.getGoodList();
|
||||||
goodList: [], //商品集合
|
this.getStoreList();
|
||||||
storeList: [], //店铺集合
|
},
|
||||||
};
|
onReachBottom() {
|
||||||
},
|
if (this.tabCurrentIndex == 0) {
|
||||||
onLoad() {
|
this.navList[0].params.pageNumber++;
|
||||||
this.getGoodList();
|
this.getGoodList();
|
||||||
this.getstoreList();
|
} else {
|
||||||
},
|
this.navList[1].params.pageNumber++;
|
||||||
|
this.getStoreList();
|
||||||
methods: {
|
}
|
||||||
/**
|
},
|
||||||
* 打开商品左侧取消收藏
|
|
||||||
*/
|
methods: {
|
||||||
openLeftChange(val, type) {
|
/**
|
||||||
const { goodList, storeList } = this;
|
* 打开商品左侧取消收藏
|
||||||
let way;
|
*/
|
||||||
type == "goods" ? (way = goodList) : (way = storeList);
|
openLeftChange(val, type) {
|
||||||
way.forEach((item) => {
|
const {
|
||||||
this.$set(item, "selected", false);
|
goodList,
|
||||||
});
|
storeList
|
||||||
this.$set(val, "selected", false);
|
} = this;
|
||||||
val.selected = true;
|
let way;
|
||||||
},
|
type == "goods" ? (way = goodList) : (way = storeList);
|
||||||
|
way.forEach((item) => {
|
||||||
/**
|
this.$set(item, "selected", false);
|
||||||
* 点击商品左侧取消收藏
|
});
|
||||||
*/
|
this.$set(val, "selected", false);
|
||||||
clickGoodsSwiperAction(val) {
|
val.selected = true;
|
||||||
deleteGoodsCollection(val.skuId).then((res) => {
|
},
|
||||||
if (res.statusCode == 200) {
|
|
||||||
this.storeList = [];
|
/**
|
||||||
this.goodList = [];
|
* 点击商品左侧取消收藏
|
||||||
this.getGoodList();
|
*/
|
||||||
}
|
clickGoodsSwiperAction(val) {
|
||||||
});
|
deleteGoodsCollection(val.skuId).then((res) => {
|
||||||
},
|
if (res.statusCode == 200) {
|
||||||
|
this.storeList = [];
|
||||||
/**
|
this.goodList = [];
|
||||||
* 点击店铺左侧取消收藏
|
this.getGoodList();
|
||||||
*/
|
}
|
||||||
clickstoreSwiperAction(val) {
|
});
|
||||||
deleteStoreCollection(val.storeId).then((res) => {
|
},
|
||||||
if (res.statusCode == 200) {
|
|
||||||
this.storeList = [];
|
/**
|
||||||
this.getstoreList();
|
* 点击店铺左侧取消收藏
|
||||||
}
|
*/
|
||||||
});
|
clickStoreSwiperAction(val) {
|
||||||
},
|
deleteStoreCollection(val.storeId).then((res) => {
|
||||||
|
if (res.statusCode == 200) {
|
||||||
/**
|
this.storeList = [];
|
||||||
* 顶部tab点击
|
this.getStoreList();
|
||||||
*/
|
}
|
||||||
tabClick(index) {
|
});
|
||||||
this.tabCurrentIndex = index;
|
},
|
||||||
},
|
|
||||||
|
/**
|
||||||
/**
|
* 顶部tab点击
|
||||||
* 查看商品详情
|
*/
|
||||||
*/
|
tabClick(index) {
|
||||||
goGoodsDetail(val) {
|
this.tabCurrentIndex = index;
|
||||||
//商品详情
|
},
|
||||||
uni.navigateTo({
|
|
||||||
url: "/pages/product/goods?id=" + val.skuId + "&goodsId=" + val.goodsId,
|
/**
|
||||||
});
|
* 查看商品详情
|
||||||
},
|
*/
|
||||||
|
goGoodsDetail(val) {
|
||||||
/**
|
//商品详情
|
||||||
* 查看店铺详情
|
uni.navigateTo({
|
||||||
*/
|
url: "/pages/product/goods?id=" + val.skuId + "&goodsId=" + val.goodsId,
|
||||||
gostoreMainPage(id) {
|
});
|
||||||
//店铺主页
|
},
|
||||||
uni.navigateTo({
|
|
||||||
url: "/pages/product/shopPage?id=" + id,
|
/**
|
||||||
});
|
* 查看店铺详情
|
||||||
},
|
*/
|
||||||
|
goStoreMainPage(id) {
|
||||||
/**
|
//店铺主页
|
||||||
* 获取商品集合
|
uni.navigateTo({
|
||||||
*/
|
url: "/pages/product/shopPage?id=" + id,
|
||||||
getGoodList() {
|
});
|
||||||
uni.showLoading({
|
},
|
||||||
title: "加载中",
|
|
||||||
});
|
/**
|
||||||
getGoodsCollection(this.navList[0].params, "GOODS").then((res) => {
|
* 获取商品集合
|
||||||
uni.hideLoading();
|
*/
|
||||||
uni.stopPullDownRefresh();
|
getGoodList() {
|
||||||
if (res.data.success) {
|
uni.showLoading({
|
||||||
let data = res.data.result;
|
title: "加载中",
|
||||||
data.selected = false;
|
});
|
||||||
this.navList[0].text = `商品(${data.total})`;
|
getGoodsCollection(this.navList[0].params, "GOODS").then((res) => {
|
||||||
if (data.total == 0) {
|
uni.hideLoading();
|
||||||
this.goodsEmpty = true;
|
uni.stopPullDownRefresh();
|
||||||
} else if (data.total < 10) {
|
if (res.data.success) {
|
||||||
this.goodsLoad = "noMore";
|
let data = res.data.result;
|
||||||
this.goodList.push(...data.records);
|
data.selected = false;
|
||||||
} else {
|
this.navList[0].name = `商品(${data.total})`;
|
||||||
this.goodList.push(...data.records);
|
|
||||||
if (data.total.length < 10) this.goodsLoad = "noMore";
|
if (data.total == 0) {
|
||||||
}
|
this.goodsEmpty = true;
|
||||||
}
|
} else if (data.total < 10) {
|
||||||
});
|
this.goodsLoad = "noMore";
|
||||||
},
|
this.goodList.push(...data.records);
|
||||||
|
} else {
|
||||||
/**
|
this.goodList.push(...data.records);
|
||||||
* 获取店铺集合
|
if (data.total.length < 10) this.goodsLoad = "noMore";
|
||||||
*/
|
}
|
||||||
getstoreList() {
|
}
|
||||||
uni.showLoading({
|
});
|
||||||
title: "加载中",
|
},
|
||||||
});
|
|
||||||
getGoodsCollection(this.navList[1].params, "store").then((res) => {
|
/**
|
||||||
uni.hideLoading();
|
* 获取店铺集合
|
||||||
uni.stopPullDownRefresh();
|
*/
|
||||||
if (res.data.success) {
|
getStoreList() {
|
||||||
let data = res.data.result;
|
uni.showLoading({
|
||||||
data.selected = false;
|
title: "加载中",
|
||||||
this.navList[1].text = `店铺(${data.total})`;
|
});
|
||||||
if (data.total == 0) {
|
getGoodsCollection(this.navList[1].params, "store").then((res) => {
|
||||||
this.storeEmpty = true;
|
uni.hideLoading();
|
||||||
} else if (data.total < 10) {
|
uni.stopPullDownRefresh();
|
||||||
this.storeLoad = "noMore";
|
if (res.data.success) {
|
||||||
this.storeList.push(...data.records);
|
let data = res.data.result;
|
||||||
} else {
|
data.selected = false;
|
||||||
this.storeList.push(...data.records);
|
this.navList[1].name = `店铺(${data.total})`;
|
||||||
if (data.total.length < 10) this.storeLoad = "noMore";
|
if (data.total == 0) {
|
||||||
}
|
this.storeEmpty = true;
|
||||||
}
|
} else if (data.total < 10) {
|
||||||
});
|
|
||||||
},
|
this.storeList.push(...data.records);
|
||||||
|
}
|
||||||
/**
|
}
|
||||||
* 底部加载更多
|
});
|
||||||
*/
|
},
|
||||||
loadMore() {
|
},
|
||||||
if (this.tabCurrentIndex == 0) {
|
|
||||||
this.navList[0].params.pageNumber++;
|
/**
|
||||||
this.getGoodList();
|
* 下拉刷新时
|
||||||
} else {
|
*/
|
||||||
this.navList[1].params.pageNumber++;
|
onPullDownRefresh() {
|
||||||
this.getstoreList();
|
if (this.tabCurrentIndex == 0) {
|
||||||
}
|
this.navList[0].params.pageNumber = 1;
|
||||||
},
|
this.goodList = [];
|
||||||
},
|
this.getGoodList();
|
||||||
|
} else {
|
||||||
/**
|
this.navList[1].params.pageNumber = 1;
|
||||||
* 下拉刷新时
|
this.storeList = [];
|
||||||
*/
|
this.getStoreList();
|
||||||
onPullDownRefresh() {
|
}
|
||||||
if (this.tabCurrentIndex == 0) {
|
},
|
||||||
this.navList[0].params.pageNumber = 1;
|
};
|
||||||
this.goodList = [];
|
</script>
|
||||||
this.getGoodList();
|
|
||||||
} else {
|
<style lang="scss">
|
||||||
this.navList[1].params.pageNumber = 1;
|
page,
|
||||||
this.storeList = [];
|
.content {
|
||||||
this.getstoreList();
|
background: $page-color-base;
|
||||||
}
|
height: 100%;
|
||||||
},
|
}
|
||||||
};
|
|
||||||
</script>
|
.slot-wrap{
|
||||||
|
flex: 1;
|
||||||
<style lang="scss">
|
display: flex;
|
||||||
page,
|
justify-content: center;
|
||||||
.content {
|
padding-right: 72rpx;
|
||||||
background: $page-color-base;
|
}
|
||||||
height: 100%;
|
|
||||||
}
|
.content {
|
||||||
.content {
|
width: 100%;
|
||||||
width: 100%;
|
}
|
||||||
overflow: hidden;
|
|
||||||
}
|
.swiper-box {
|
||||||
.swiper-box {
|
overflow-y: auto;
|
||||||
overflow-y: auto;
|
}
|
||||||
}
|
|
||||||
|
.list-scroll-content {
|
||||||
.list-scroll-content {
|
height: 100%;
|
||||||
height: 100%;
|
width: 100%;
|
||||||
width: 100%;
|
}
|
||||||
}
|
|
||||||
|
/deep/ .u-swipe-content {
|
||||||
/deep/ .u-swipe-content {
|
overflow: hidden;
|
||||||
overflow: hidden;
|
}
|
||||||
}
|
|
||||||
.goods {
|
.goods {
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
border-bottom: 1px solid $border-color-light;
|
border-bottom: 1px solid $border-color-light;
|
||||||
height: 190rpx;
|
height: 190rpx;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
padding: 30rpx 20rpx;
|
padding: 30rpx 20rpx;
|
||||||
margin-top: 20rpx;
|
margin-top: 20rpx;
|
||||||
image {
|
|
||||||
width: 131rpx;
|
image {
|
||||||
height: 131rpx;
|
width: 131rpx;
|
||||||
border-radius: 10rpx;
|
height: 131rpx;
|
||||||
}
|
border-radius: 10rpx;
|
||||||
.goods-intro {
|
}
|
||||||
flex: 1;
|
|
||||||
font-size: $font-base;
|
.goods-intro {
|
||||||
line-height: 48rpx;
|
flex: 1;
|
||||||
margin-left: 30rpx;
|
font-size: $font-base;
|
||||||
|
line-height: 48rpx;
|
||||||
view:nth-child(1) {
|
margin-left: 30rpx;
|
||||||
line-height: 1.4em;
|
|
||||||
font-size: 24rpx;
|
view:nth-child(1) {
|
||||||
max-height: 2.8em; //height是line-height的整数倍,防止文字显示不全
|
line-height: 1.4em;
|
||||||
overflow: hidden;
|
font-size: 24rpx;
|
||||||
color: #666;
|
max-height: 2.8em; //height是line-height的整数倍,防止文字显示不全
|
||||||
}
|
overflow: hidden;
|
||||||
view:nth-child(2) {
|
color: #666;
|
||||||
color: #cccccc;
|
}
|
||||||
font-size: 24rpx;
|
|
||||||
}
|
view:nth-child(2) {
|
||||||
view:nth-child(3) {
|
color: #cccccc;
|
||||||
color: $light-color;
|
font-size: 24rpx;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
button {
|
view:nth-child(3) {
|
||||||
color: $main-color;
|
color: $light-color;
|
||||||
height: 50rpx;
|
}
|
||||||
width: 120rpx;
|
}
|
||||||
font-size: $font-sm;
|
|
||||||
padding: 0;
|
button {
|
||||||
line-height: 50rpx;
|
color: $main-color;
|
||||||
background-color: #ffffff;
|
height: 50rpx;
|
||||||
margin-top: 80rpx;
|
width: 120rpx;
|
||||||
&::after {
|
font-size: $font-sm;
|
||||||
border-color: $main-color;
|
padding: 0;
|
||||||
}
|
line-height: 50rpx;
|
||||||
}
|
background-color: #ffffff;
|
||||||
}
|
margin-top: 80rpx;
|
||||||
.store {
|
|
||||||
background-color: #fff;
|
&::after {
|
||||||
border: 1px solid $border-color-light;
|
border-color: $main-color;
|
||||||
border-radius: 16rpx;
|
}
|
||||||
margin: 20rpx 10rpx;
|
}
|
||||||
.intro {
|
}
|
||||||
display: flex;
|
|
||||||
justify-content: space-between;
|
.store {
|
||||||
align-items: center;
|
background-color: #fff;
|
||||||
padding: 0 30rpx 0 40rpx;
|
border: 1px solid $border-color-light;
|
||||||
height: 170rpx;
|
border-radius: 16rpx;
|
||||||
|
margin: 20rpx 10rpx;
|
||||||
.store-logo {
|
|
||||||
width: 102rpx;
|
.intro {
|
||||||
height: 102rpx;
|
display: flex;
|
||||||
border-radius: 50%;
|
justify-content: space-between;
|
||||||
overflow: hidden;
|
align-items: center;
|
||||||
image {
|
padding: 0 30rpx 0 40rpx;
|
||||||
width: 100%;
|
height: 170rpx;
|
||||||
height: 100%;
|
|
||||||
border-radius: 50%;
|
.store-logo {
|
||||||
}
|
width: 102rpx;
|
||||||
}
|
height: 102rpx;
|
||||||
.store-name {
|
border-radius: 50%;
|
||||||
flex: 1;
|
overflow: hidden;
|
||||||
margin-left: 30rpx;
|
|
||||||
line-height: 2em;
|
image {
|
||||||
:first-child {
|
width: 100%;
|
||||||
font-size: $font-base;
|
height: 100%;
|
||||||
}
|
border-radius: 50%;
|
||||||
:last-child {
|
}
|
||||||
font-size: $font-sm;
|
}
|
||||||
color: #999;
|
|
||||||
}
|
.store-name {
|
||||||
}
|
flex: 1;
|
||||||
.store-collect {
|
margin-left: 30rpx;
|
||||||
border-left: 1px solid $border-color-light;
|
line-height: 2em;
|
||||||
padding-left: 20rpx;
|
|
||||||
text-align: center;
|
:first-child {
|
||||||
:last-child {
|
font-size: $font-base;
|
||||||
color: #999;
|
}
|
||||||
font-size: $font-sm;
|
|
||||||
}
|
:last-child {
|
||||||
}
|
font-size: $font-sm;
|
||||||
}
|
color: #999;
|
||||||
}
|
}
|
||||||
.navbar {
|
}
|
||||||
display: flex;
|
|
||||||
height: 40px;
|
.store-collect {
|
||||||
padding: 0 5px;
|
border-left: 1px solid $border-color-light;
|
||||||
background: #fff;
|
padding-left: 20rpx;
|
||||||
box-shadow: 0 1px 5px rgba(0, 0, 0, 0.06);
|
text-align: center;
|
||||||
position: relative;
|
|
||||||
z-index: 10;
|
:last-child {
|
||||||
.nav-item {
|
color: #999;
|
||||||
flex: 1;
|
font-size: $font-sm;
|
||||||
display: flex;
|
}
|
||||||
justify-content: center;
|
}
|
||||||
align-items: center;
|
}
|
||||||
height: 100%;
|
}
|
||||||
font-size: 26rpx;
|
|
||||||
|
.navbar {
|
||||||
text {
|
display: flex;
|
||||||
position: relative;
|
height: 40px;
|
||||||
}
|
padding: 0 5px;
|
||||||
text.current {
|
background: #fff;
|
||||||
color: $light-color;
|
box-shadow: 0 1px 5px rgba(0, 0, 0, 0.06);
|
||||||
font-weight: bold;
|
position: relative;
|
||||||
font-size: 28rpx;
|
z-index: 10;
|
||||||
&::after {
|
|
||||||
content: "";
|
.nav-item {
|
||||||
position: absolute;
|
flex: 1;
|
||||||
left: 20rpx;
|
display: flex;
|
||||||
bottom: -10rpx;
|
justify-content: center;
|
||||||
width: 30rpx;
|
align-items: center;
|
||||||
height: 0;
|
height: 100%;
|
||||||
border-bottom: 2px solid $light-color;
|
font-size: 26rpx;
|
||||||
}
|
|
||||||
}
|
text {
|
||||||
}
|
position: relative;
|
||||||
}
|
}
|
||||||
</style>
|
|
||||||
|
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,311 +1,259 @@
|
|||||||
<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>
|
|
||||||
<view v-for="(item, index) in trackList" :key="index">
|
|
||||||
<view class="myTracks-title" @click="navgaiteToStore(item)">{{item.storeName}}</view>
|
|
||||||
<view class="myTracks-items">
|
|
||||||
<view class="myTracks-item">
|
|
||||||
<u-checkbox-group>
|
|
||||||
<u-checkbox v-model="item.___isDel" v-if="editFlag" active-color="#ff6b35" style="margin-right: 10rpx" @change="changeChecked(item)"></u-checkbox>
|
|
||||||
</u-checkbox-group>
|
|
||||||
<view class="myTracks-item-img" @click.stop="navgaiteToDetail(item)">
|
|
||||||
<image :src="item.thumbnail"></image>
|
|
||||||
</view>
|
|
||||||
<view class="myTracks-item-content" @click.stop="navgaiteToDetail(item)">
|
|
||||||
<view class="myTracks-item-title">
|
|
||||||
{{ item.goodsName }}
|
|
||||||
<view class="myTracks-item-title-desc"> </view>
|
|
||||||
</view>
|
|
||||||
<view class="myTracks-item-price">
|
|
||||||
¥{{ item.price | unitPrice }}
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="myTracks-divider"></view>
|
|
||||||
|
|
||||||
</view>
|
</u-navbar>
|
||||||
<uni-load-more :status="loadStatus"></uni-load-more>
|
<u-empty text="暂无历史记录" style="margin-top:200rpx;" mode="history" v-if="whetherEmpty"></u-empty>
|
||||||
</div>
|
<div v-else>
|
||||||
<view v-if="editFlag">
|
<view v-for="(item, index) in trackList" :key="index">
|
||||||
<view class="myTracks-action-placeholder"></view>
|
<view class="myTracks-title" @click="navgaiteToStore(item)">{{item.storeName}}</view>
|
||||||
<view class="myTracks-action">
|
<view class="myTracks-items">
|
||||||
<view class="myTracks-action-check">
|
|
||||||
<u-checkbox-group>
|
|
||||||
<u-checkbox v-model="allChecked" v-if="editFlag" active-color="#ff6b35" style="margin-right: 10rpx" @change="checkedAllitem"></u-checkbox>
|
|
||||||
全选
|
|
||||||
</u-checkbox-group>
|
|
||||||
</view>
|
|
||||||
|
|
||||||
<view>
|
<u-swipe-action style="width: 100%;" :show="item.show" :index="index" :key="item.id"
|
||||||
<u-button type="warning" plain="true" @click="delAllTracks" class="myTracks-action-btn">
|
@click="delTracks" @open="open" :options="options">
|
||||||
删除
|
<view class="myTracks-item">
|
||||||
</u-button>
|
<view class="myTracks-item-img" @click.stop="navgaiteToDetail(item)">
|
||||||
</view>
|
<image :src="item.thumbnail"></image>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
<view class="myTracks-item-content" @click.stop="navgaiteToDetail(item)">
|
||||||
</view>
|
<view class="myTracks-item-title">
|
||||||
|
{{ item.goodsName }}
|
||||||
|
<view class="myTracks-item-title-desc"> </view>
|
||||||
|
</view>
|
||||||
|
<view class="myTracks-item-price">
|
||||||
|
¥{{ item.price | unitPrice }}
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</u-swipe-action>
|
||||||
|
|
||||||
|
</view>
|
||||||
|
<view class="myTracks-divider"></view>
|
||||||
|
|
||||||
|
</view>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { myTrackList, deleteHistoryListId } from "@/api/members.js";
|
import {
|
||||||
|
myTrackList,
|
||||||
|
deleteHistoryListId
|
||||||
|
} from "@/api/members.js";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
editFlag: false, //是否编辑
|
|
||||||
allChecked: false, //是否全选
|
|
||||||
loadStatus: "more", //底部下拉加载状态
|
|
||||||
whetherEmpty: false, //是否数据为空
|
|
||||||
params: {
|
|
||||||
pageNumber: 1,
|
|
||||||
pageSize: 10,
|
|
||||||
},
|
|
||||||
|
|
||||||
trackList: [], //足迹列表
|
whetherEmpty: false, //是否数据为空
|
||||||
};
|
params: {
|
||||||
},
|
pageNumber: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
order: "desc",
|
||||||
|
sort: "updateTime",
|
||||||
|
},
|
||||||
|
options: [{
|
||||||
|
text: '删除',
|
||||||
|
style: {
|
||||||
|
backgroundColor: '#dd524d'
|
||||||
|
}
|
||||||
|
}],
|
||||||
|
trackList: [], //足迹列表
|
||||||
|
};
|
||||||
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 滑到底部加载下一页数据
|
* 滑到底部加载下一页数据
|
||||||
*/
|
*/
|
||||||
onReachBottom() {
|
onReachBottom() {
|
||||||
if (this.loadStatus != "noMore") {
|
this.params.pageNumber++;
|
||||||
this.params.pageNumber++;
|
this.getList();
|
||||||
this.getList();
|
},
|
||||||
}
|
onShow() {
|
||||||
},
|
this.trackList = [];
|
||||||
onLoad() {
|
this.getList();
|
||||||
this.getList();
|
},
|
||||||
},
|
onPullDownRefresh() {
|
||||||
methods: {
|
this.trackList = [];
|
||||||
/**
|
this.getList();
|
||||||
* 导航到店铺
|
},
|
||||||
*/
|
methods: {
|
||||||
navgaiteToStore(val) {
|
/**
|
||||||
uni.navigateTo({
|
* 导航到店铺
|
||||||
url: "/pages/product/shopPage?id=" + val.storeId,
|
*/
|
||||||
});
|
navgaiteToStore(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;
|
||||||
|
})
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 跳转详情
|
||||||
|
*/
|
||||||
|
navgaiteToDetail(item) {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: "/pages/product/goods?id=" + item.id + "&goodsId=" + item.goodsId,
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 设置右侧导航栏文本
|
* 获取我的足迹列表
|
||||||
*/
|
*/
|
||||||
setStyle(text) {
|
getList() {
|
||||||
//导航按钮文本设置
|
uni.showLoading({
|
||||||
let pages = getCurrentPages();
|
title: "加载中",
|
||||||
let page = pages[pages.length - 1];
|
});
|
||||||
// #ifdef APP-PLUS
|
myTrackList(this.params).then((res) => {
|
||||||
let currentWebview = page.$getAppWebview();
|
uni.stopPullDownRefresh();
|
||||||
let titleNView = currentWebview.getStyle().titleNView;
|
uni.hideLoading();
|
||||||
titleNView.buttons[0].text = text;
|
if (res.statusCode == 200) {
|
||||||
if (text == "完成") {
|
res.data.result.records.length &&
|
||||||
this.trackList.forEach((key) => {
|
res.data.result.records.forEach((item) => {
|
||||||
key.history.forEach((item) => {
|
item.show = false;
|
||||||
this.$set(item, "___isDel", false);
|
});
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
currentWebview.setStyle({
|
|
||||||
titleNView: titleNView,
|
|
||||||
});
|
|
||||||
// #endif
|
|
||||||
// #ifdef H5
|
|
||||||
// h5 临时方案
|
|
||||||
document.getElementsByClassName("uni-btn-icon")[1].innerText = text;
|
|
||||||
// #endif
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
let data = res.data.result.records;
|
||||||
* 跳转详情
|
if (data.total == 0) {
|
||||||
*/
|
this.whetherEmpty = true;
|
||||||
navgaiteToDetail(item) {
|
} else {
|
||||||
uni.navigateTo({
|
this.trackList.push(...data);
|
||||||
url: "/pages/product/goods?id=" + item.id + "&goodsId=" + item.goodsId,
|
}
|
||||||
});
|
}
|
||||||
},
|
});
|
||||||
|
},
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取我的足迹列表
|
|
||||||
*/
|
|
||||||
getList() {
|
|
||||||
uni.showLoading({
|
|
||||||
title: "加载中",
|
|
||||||
});
|
|
||||||
myTrackList(this.params).then((res) => {
|
|
||||||
uni.stopPullDownRefresh();
|
|
||||||
uni.hideLoading();
|
|
||||||
if (res.statusCode == 200) {
|
|
||||||
res.data.result &&
|
|
||||||
res.data.result.forEach((item) => {
|
|
||||||
item.___isDel = false;
|
|
||||||
});
|
|
||||||
|
|
||||||
let data = res.data.result;
|
/**
|
||||||
if (data.total == 0) {
|
* 删除足迹
|
||||||
this.whetherEmpty = true;
|
*/
|
||||||
} else if (data.total < 10) {
|
delTracks(index) {
|
||||||
this.loadStatus = "noMore";
|
deleteHistoryListId(this.trackList[index].goodsId).then((res) => {
|
||||||
this.trackList.push(...data);
|
if (res.data.code == 200) {
|
||||||
} else {
|
this.trackList = [];
|
||||||
this.trackList.push(...data);
|
this.getList();
|
||||||
if (data.length < 10) this.loadStatus = "noMore";
|
} else {
|
||||||
}
|
uni.showToast({
|
||||||
}
|
title: res.data.message,
|
||||||
});
|
duration: 2000,
|
||||||
},
|
icon: "none",
|
||||||
|
});
|
||||||
/**
|
}
|
||||||
* 点击后判断是不是全选
|
});
|
||||||
*/
|
},
|
||||||
changeChecked(val) {
|
},
|
||||||
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 {
|
.myTracks {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
padding-top: 2rpx;
|
padding-top: 2rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.myTracks-title {
|
.myTracks-title {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 110rpx;
|
height: 110rpx;
|
||||||
padding-left: 20rpx;
|
padding-left: 20rpx;
|
||||||
font-size: 28rpx;
|
font-size: 28rpx;
|
||||||
color: #666;
|
color: #666;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
display: -webkit-box;
|
display: -webkit-box;
|
||||||
display: -webkit-flex;
|
display: -webkit-flex;
|
||||||
display: flex;
|
display: flex;
|
||||||
}
|
}
|
||||||
|
|
||||||
.myTracks-items {
|
.myTracks-items {
|
||||||
padding-top: 2rpx;
|
padding-top: 2rpx;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
display: -webkit-box;
|
display: -webkit-box;
|
||||||
display: -webkit-flex;
|
display: -webkit-flex;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
}
|
}
|
||||||
|
|
||||||
.myTracks-item {
|
.myTracks-item {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 226rpx;
|
height: 226rpx;
|
||||||
padding-left: 20rpx;
|
padding-left: 20rpx;
|
||||||
padding-right: 20rpx;
|
padding-right: 20rpx;
|
||||||
margin-bottom: 2rpx;
|
margin-bottom: 2rpx;
|
||||||
// border-radius: 6/@px;
|
// border-radius: 6/@px;
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
position: relative;
|
position: relative;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
display: -webkit-box;
|
display: -webkit-box;
|
||||||
display: -webkit-flex;
|
display: -webkit-flex;
|
||||||
display: flex;
|
display: flex;
|
||||||
}
|
}
|
||||||
|
|
||||||
.myTracks-item-img {
|
.myTracks-item-img {
|
||||||
margin-right: 20rpx;
|
margin-right: 20rpx;
|
||||||
border-radius: 8rpx;
|
border-radius: 8rpx;
|
||||||
image {
|
|
||||||
width: 130rpx;
|
|
||||||
height: 130rpx;
|
|
||||||
border-radius: 8rpx;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.myTracks-item-title {
|
image {
|
||||||
font-size: 28rpx;
|
width: 130rpx;
|
||||||
color: #333;
|
height: 130rpx;
|
||||||
}
|
border-radius: 8rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.myTracks-item-title-desc {
|
.myTracks-item-title {
|
||||||
font-size: 28rpx;
|
font-size: 28rpx;
|
||||||
color: #999;
|
color: #333;
|
||||||
}
|
}
|
||||||
|
|
||||||
.myTracks-item-price {
|
.myTracks-item-title-desc {
|
||||||
font-size: 28rpx;
|
font-size: 28rpx;
|
||||||
color: $light-color;
|
color: #999;
|
||||||
padding: 10rpx 0 0 0;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
.myTracks-action-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;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -11,11 +11,11 @@
|
|||||||
<u-row class="portrait-box2">
|
<u-row class="portrait-box2">
|
||||||
<u-col span="6" class="portrait-box2-col" :gutter="16">
|
<u-col span="6" class="portrait-box2-col" :gutter="16">
|
||||||
<text>累计获得:</text>
|
<text>累计获得:</text>
|
||||||
<text class="pcolor">{{ pointData.point || 0 }}</text>
|
<text class="pcolor">{{ pointData.totalPoint || 0 }}</text>
|
||||||
</u-col>
|
</u-col>
|
||||||
<u-col span="6" class="portrait-box2-col">
|
<u-col span="6" class="portrait-box2-col">
|
||||||
<text>未使用:</text>
|
<text>剩余积分:</text>
|
||||||
<text class="pcolor">{{ pointData.variablePoint || 0 }}</text>
|
<text class="pcolor">{{ pointData.point || 0 }}</text>
|
||||||
</u-col>
|
</u-col>
|
||||||
</u-row>
|
</u-row>
|
||||||
|
|
||||||
|
|||||||
@@ -7,6 +7,9 @@
|
|||||||
<!-- #ifdef APP-PLUS -->
|
<!-- #ifdef APP-PLUS -->
|
||||||
Version {{localVersion.version}}
|
Version {{localVersion.version}}
|
||||||
<!-- #endif -->
|
<!-- #endif -->
|
||||||
|
<!-- #ifdef MP-WEIXIN -->
|
||||||
|
小程序版本: {{localVersion.version}} {{ localVersion.envVersion}}
|
||||||
|
<!-- #endif -->
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- {{localVersion}} -->
|
<!-- {{localVersion}} -->
|
||||||
@@ -16,6 +19,7 @@
|
|||||||
<u-cell-item title="功能介绍" @click="navigateTo('/pages/mine/set/versionFunctionList')"></u-cell-item>
|
<u-cell-item title="功能介绍" @click="navigateTo('/pages/mine/set/versionFunctionList')"></u-cell-item>
|
||||||
<u-cell-item title="检查更新" @click="checkUpdate"></u-cell-item>
|
<u-cell-item title="检查更新" @click="checkUpdate"></u-cell-item>
|
||||||
<!-- #endif -->
|
<!-- #endif -->
|
||||||
|
|
||||||
<u-cell-item title="证照信息" @click="navigateTo('/pages/mine/help/tips?type=message')"></u-cell-item>
|
<u-cell-item title="证照信息" @click="navigateTo('/pages/mine/help/tips?type=message')"></u-cell-item>
|
||||||
<u-cell-item title="服务协议" @click="navigateTo('/pages/mine/help/tips?type=user')"></u-cell-item>
|
<u-cell-item title="服务协议" @click="navigateTo('/pages/mine/help/tips?type=user')"></u-cell-item>
|
||||||
<u-cell-item title="隐私协议" @click="navigateTo('/pages/mine/help/tips?type=privacy')"></u-cell-item>
|
<u-cell-item title="隐私协议" @click="navigateTo('/pages/mine/help/tips?type=privacy')"></u-cell-item>
|
||||||
@@ -29,7 +33,7 @@
|
|||||||
|
|
||||||
<view>
|
<view>
|
||||||
<view style="margin:20rpx 0; color:#003a8c;" @click="navigateTo('/pages/mine/help/tips?type=user')">《{{config.name}}用户协议》</view>
|
<view style="margin:20rpx 0; color:#003a8c;" @click="navigateTo('/pages/mine/help/tips?type=user')">《{{config.name}}用户协议》</view>
|
||||||
<view>CopyRight @{{config.name}} </view>
|
<view>CopyRight ©{{config.name}} </view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -74,6 +78,19 @@ export default {
|
|||||||
};
|
};
|
||||||
});
|
});
|
||||||
// #endif
|
// #endif
|
||||||
|
|
||||||
|
|
||||||
|
// #ifdef MP-WEIXIN
|
||||||
|
const accountInfo = wx.getAccountInfoSync();
|
||||||
|
console.log("===========accountInfo==============");
|
||||||
|
console.log(accountInfo);
|
||||||
|
this.version_number = accountInfo.miniProgram.version // 小程序 版本号
|
||||||
|
this.localVersion = {
|
||||||
|
versionCode: accountInfo.miniProgram.version.replace(/\./g, ""),
|
||||||
|
version: accountInfo.miniProgram.version ,// 小程序 版本号,
|
||||||
|
envVersion:accountInfo.miniProgram.envVersion, //判断小程序是开发版本还是release版本
|
||||||
|
};
|
||||||
|
// #endif
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
<div class="feedBack">
|
<div class="feedBack">
|
||||||
<div class="feedBack-box">
|
<div class="feedBack-box">
|
||||||
<h4>猜你想问</h4>
|
<h4>猜你想问</h4>
|
||||||
<div class="feedBack-item" @click="handleClick(index)" v-for="(item,index) in list" :key="index">
|
<div class="feedBack-item" :class="{'active':feedBack.type == item.value }" @click="handleClick(index)" v-for="(item,index) in list" :key="index">
|
||||||
{{item.text}}
|
{{item.text}}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -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>
|
||||||
@@ -130,6 +130,10 @@ export default {
|
|||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
border-radius: 100px;
|
border-radius: 100px;
|
||||||
}
|
}
|
||||||
|
.active{
|
||||||
|
color: $light-color !important;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
.feedBack {
|
.feedBack {
|
||||||
padding-bottom: 100rpx;
|
padding-bottom: 100rpx;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,12 +23,16 @@
|
|||||||
<u-input v-model="form.___path" disabled @click="clickRegion" />
|
<u-input v-model="form.___path" disabled @click="clickRegion" />
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
<view class="submit" @click="submit">保存</view>
|
<view class="submit" @click="submit">保存</view>
|
||||||
|
<view class="submit" @click="showModalDialog">退出登录</view>
|
||||||
|
<u-modal show-cancel-button v-model="quitShow" @confirm="confirm" :confirm-color="lightColor" :async-close="true"
|
||||||
|
:content="'确定要退出登录么?'"></u-modal>
|
||||||
</u-form>
|
</u-form>
|
||||||
|
|
||||||
<m-city :provinceData="region" headTitle="区域选择" ref="cityPicker" @funcValue="getpickerParentValue" pickerSize="4"></m-city>
|
<m-city :provinceData="region" headTitle="区域选择" ref="cityPicker" @funcValue="getpickerParentValue" pickerSize="4"></m-city>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
|
import { logout } from "@/api/login";
|
||||||
import { saveUserInfo } from "@/api/members.js";
|
import { saveUserInfo } from "@/api/members.js";
|
||||||
import { upload } from "@/api/common.js";
|
import { upload } from "@/api/common.js";
|
||||||
import storage from "@/utils/storage.js";
|
import storage from "@/utils/storage.js";
|
||||||
@@ -38,6 +42,7 @@ export default {
|
|||||||
components: { uFormItem, "m-city": gkcity },
|
components: { uFormItem, "m-city": gkcity },
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
quitShow: false,
|
||||||
lightColor: this.$lightColor, //高亮颜色
|
lightColor: this.$lightColor, //高亮颜色
|
||||||
form: {
|
form: {
|
||||||
nickName: storage.getUserInfo().nickName || "",
|
nickName: storage.getUserInfo().nickName || "",
|
||||||
@@ -45,7 +50,7 @@ export default {
|
|||||||
face: storage.getUserInfo().face || "/static/missing-face.png", //默认头像
|
face: storage.getUserInfo().face || "/static/missing-face.png", //默认头像
|
||||||
regionId: [], //地址Id
|
regionId: [], //地址Id
|
||||||
region: storage.getUserInfo().region || [], //地址
|
region: storage.getUserInfo().region || [], //地址
|
||||||
sex: storage.getUserInfo().sex || 1, //性别
|
sex: storage.getUserInfo().sex, //性别
|
||||||
___path: storage.getUserInfo().region,
|
___path: storage.getUserInfo().region,
|
||||||
},
|
},
|
||||||
birthday: storage.getUserInfo().birthday || "", //生日
|
birthday: storage.getUserInfo().birthday || "", //生日
|
||||||
@@ -65,6 +70,35 @@ export default {
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
/**
|
||||||
|
* 显示退出登录对话框
|
||||||
|
*/
|
||||||
|
showModalDialog() {
|
||||||
|
this.quitShow = true;
|
||||||
|
},
|
||||||
|
|
||||||
|
clear() {
|
||||||
|
storage.setAccessToken("");
|
||||||
|
storage.setRefreshToken("");
|
||||||
|
storage.setUserInfo({});
|
||||||
|
this.$options.filters.navigateToLogin("redirectTo");
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 确认退出
|
||||||
|
* 清除缓存重新登录
|
||||||
|
*/
|
||||||
|
async confirm() {
|
||||||
|
try{
|
||||||
|
await logout();
|
||||||
|
this.clear();
|
||||||
|
}catch(e){
|
||||||
|
//TODO handle the exception
|
||||||
|
this.clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 选择地址回调
|
* 选择地址回调
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -1,251 +1,277 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="box">
|
<view class="box">
|
||||||
<view class="box-tips">
|
<view class="box-tips">
|
||||||
<h2>
|
<h2 class='h2'>
|
||||||
{{verificationTitle[validateFlage==false ? 0 : 1].title}}
|
{{verificationTitle[validateFlage==false ? 0 : 1].title}}
|
||||||
</h2>
|
</h2>
|
||||||
<view class="verification">{{verificationTitle[step].desc}}</view>
|
<view class="verification">{{verificationTitle[step].desc}}</view>
|
||||||
</view>
|
</view>
|
||||||
<u-form :model="codeForm" class="form" ref="validateCodeForm">
|
<view class="form">
|
||||||
<view v-if="!validateFlage">
|
<u-form :model="codeForm" ref="validateCodeForm">
|
||||||
<u-form-item label-width="120" label="手机号" prop="mobile">
|
<view v-if="!validateFlage">
|
||||||
<u-input maxlength="11" v-model="codeForm.mobile" placeholder="请输入您的手机号" />
|
<u-form-item label-width="120" label="手机号" prop="mobile">
|
||||||
</u-form-item>
|
<u-input maxlength="11" v-model="codeForm.mobile" placeholder="请输入您的手机号" />
|
||||||
|
</u-form-item>
|
||||||
<u-form-item class="sendCode" label-width="120" prop="code" label="验证码">
|
|
||||||
<u-input v-model="codeForm.code" placeholder="请输入验证码" />
|
<u-form-item class="sendCode" label-width="120" prop="code" label="验证码">
|
||||||
<u-verification-code unique-key="page-edit" :seconds="seconds" @end="end" @start="start" ref="uCode" @change="codeChange"></u-verification-code>
|
<u-input v-model="codeForm.code" placeholder="请输入验证码" />
|
||||||
<view @tap="getCode" class="text-tips">{{ tips }}</view>
|
<u-verification-code unique-key="page-edit" :seconds="seconds" @end="end" @start="start"
|
||||||
</u-form-item>
|
ref="uCode" @change="codeChange"></u-verification-code>
|
||||||
|
<view @tap="getCode" class="text-tips">{{ tips }}</view>
|
||||||
<view class="submit" @click="validatePhone">验证</view>
|
</u-form-item>
|
||||||
<myVerification keep-running @send="verification" class="verification" ref="verification" business="FIND_USER" />
|
|
||||||
</view>
|
<view class="submit" @click="validatePhone">验证</view>
|
||||||
<view v-if="validateFlage">
|
<myVerification keep-running @send="verification" class="verification" ref="verification"
|
||||||
<u-form-item label-width="120" label="旧密码">
|
business="FIND_USER" />
|
||||||
<u-input type="password" v-model="password" placeholder="请输入您的旧密码" />
|
</view>
|
||||||
</u-form-item>
|
<view v-if="validateFlage">
|
||||||
|
<u-form-item label-width="120" label="旧密码">
|
||||||
<u-form-item label-width="120" label="新密码">
|
<u-input type="password" v-model="password" placeholder="请输入您的旧密码" />
|
||||||
|
</u-form-item>
|
||||||
<u-input type="password" v-model="newPassword" placeholder="请输入您的新密码" />
|
|
||||||
|
<u-form-item label-width="120" label="新密码">
|
||||||
</u-form-item>
|
|
||||||
|
<u-input type="password" v-model="newPassword" placeholder="请输入您的新密码" />
|
||||||
<view class="submit" @click="updatePassword">修改密码</view>
|
|
||||||
</view>
|
</u-form-item>
|
||||||
</u-form>
|
|
||||||
</view>
|
<view class="submit" @click="updatePassword">修改密码</view>
|
||||||
</template>
|
</view>
|
||||||
|
</u-form>
|
||||||
<script>
|
</view>
|
||||||
import { sendMobile, resetByMobile, modifyPass } from "@/api/login";
|
</view>
|
||||||
|
</template>
|
||||||
import { md5 } from "@/utils/md5.js"; // md5
|
|
||||||
import myVerification from "@/components/verification/verification.vue"; //验证
|
<script>
|
||||||
import uuid from "@/utils/uuid.modified.js";
|
import {
|
||||||
export default {
|
sendMobile,
|
||||||
components: {
|
resetByMobile,
|
||||||
myVerification,
|
modifyPass
|
||||||
},
|
} from "@/api/login";
|
||||||
data() {
|
|
||||||
return {
|
import {
|
||||||
uuid,
|
md5
|
||||||
validateFlage: false, //是否进行了手机号验证
|
} from "@/utils/md5.js"; // md5
|
||||||
verificationTitle: [
|
import myVerification from "@/components/verification/verification.vue"; //验证
|
||||||
{
|
import uuid from "@/utils/uuid.modified.js";
|
||||||
title: "安全验证",
|
export default {
|
||||||
desc: "请输入当前手机号进行安全验证",
|
components: {
|
||||||
},
|
myVerification,
|
||||||
{
|
},
|
||||||
title: "修改密码",
|
data() {
|
||||||
desc: "请输入新密码",
|
return {
|
||||||
},
|
uuid,
|
||||||
],
|
validateFlage: false, //是否进行了手机号验证
|
||||||
step: 0, //当前验证步骤
|
verificationTitle: [{
|
||||||
flage: false, //是否验证码验证
|
title: "安全验证",
|
||||||
|
desc: "请输入当前手机号进行安全验证",
|
||||||
codeForm: {
|
},
|
||||||
mobile: "", //手机号
|
{
|
||||||
code: "", //验证码
|
title: "修改密码",
|
||||||
},
|
desc: "请输入新密码",
|
||||||
newPassword: "", //新密码
|
},
|
||||||
password: "", //密码
|
],
|
||||||
tips: "", //提示
|
step: 0, //当前验证步骤
|
||||||
seconds: 60, // 60s等待时间
|
flage: false, //是否验证码验证
|
||||||
|
|
||||||
// 验证码登录校验
|
codeForm: {
|
||||||
codeRules: {
|
mobile: "", //手机号
|
||||||
mobile: [
|
code: "", //验证码
|
||||||
{
|
},
|
||||||
validator: (rule, value, callback) => {
|
newPassword: "", //新密码
|
||||||
return this.$u.test.mobile(value);
|
password: "", //密码
|
||||||
},
|
tips: "", //提示
|
||||||
message: "手机号码不正确",
|
seconds: 69, // 60s等待时间
|
||||||
trigger: ["blur"],
|
|
||||||
},
|
// 验证码登录校验
|
||||||
],
|
codeRules: {
|
||||||
code: [
|
mobile: [{
|
||||||
{
|
validator: (rule, value, callback) => {
|
||||||
min: 4,
|
return this.$u.test.mobile(value);
|
||||||
max: 6,
|
},
|
||||||
required: true,
|
message: "手机号码不正确",
|
||||||
message: "请输入验证码",
|
trigger: ["blur"],
|
||||||
trigger: ["blur"],
|
}, ],
|
||||||
},
|
code: [{
|
||||||
],
|
min: 4,
|
||||||
},
|
max: 6,
|
||||||
};
|
required: true,
|
||||||
},
|
message: "请输入验证码",
|
||||||
onReady() {
|
trigger: ["blur"],
|
||||||
// 必须要在onReady生命周期,因为onLoad生命周期组件可能尚未创建完毕
|
}, ],
|
||||||
this.$refs.validateCodeForm.setRules(this.codeRules);
|
},
|
||||||
},
|
};
|
||||||
watch: {
|
},
|
||||||
flage(val) {
|
onReady() {
|
||||||
if (val) {
|
// 必须要在onReady生命周期,因为onLoad生命周期组件可能尚未创建完毕
|
||||||
if (this.$refs.uCode.canGetCode) {
|
this.$refs.validateCodeForm.setRules(this.codeRules);
|
||||||
uni.showLoading({
|
},
|
||||||
title: "正在获取验证码",
|
watch: {
|
||||||
});
|
flage(val) {
|
||||||
sendMobile(this.codeForm.mobile, "FIND_USER").then((res) => {
|
if (val) {
|
||||||
uni.hideLoading();
|
|
||||||
// 这里此提示会被this.start()方法中的提示覆盖
|
if (this.$refs.uCode.canGetCode) {
|
||||||
if (res.data.code == 200) {
|
uni.showLoading({
|
||||||
this.$refs.uCode.start();
|
title: "正在获取验证码",
|
||||||
} else {
|
});
|
||||||
uni.showToast({
|
sendMobile(this.codeForm.mobile, "FIND_USER").then((res) => {
|
||||||
title: res.data.message,
|
uni.hideLoading();
|
||||||
duration: 2000,
|
// 这里此提示会被this.start()方法中的提示覆盖
|
||||||
icon: "none",
|
if (res.data.success) {
|
||||||
});
|
this.$refs.uCode.start();
|
||||||
}
|
} else {
|
||||||
});
|
uni.showToast({
|
||||||
} else {
|
title: res.data.message,
|
||||||
this.$u.toast("请倒计时结束后再发送");
|
duration: 2000,
|
||||||
}
|
icon: "none",
|
||||||
}
|
});
|
||||||
},
|
this.flage = false;
|
||||||
},
|
this.$refs.verification.getCode();
|
||||||
|
}
|
||||||
methods: {
|
})
|
||||||
// 修改密码
|
} else {
|
||||||
updatePassword() {
|
this.$u.toast("请倒计时结束后再发送");
|
||||||
modifyPass({
|
}
|
||||||
newPassword: md5(this.newPassword),
|
}
|
||||||
password: md5(this.password),
|
},
|
||||||
}).then((res) => {
|
},
|
||||||
if (res.data.success) {
|
|
||||||
uni.showToast({
|
methods: {
|
||||||
title: "修改成功!",
|
// 修改密码
|
||||||
duration: 2000,
|
updatePassword() {
|
||||||
icon: "none",
|
modifyPass({
|
||||||
});
|
newPassword: md5(this.newPassword),
|
||||||
setTimeout(() => {
|
password: md5(this.password),
|
||||||
uni.navigateBack({
|
}).then((res) => {
|
||||||
delta: 1,
|
if (res.data.success) {
|
||||||
});
|
uni.showToast({
|
||||||
}, 1000);
|
title: "修改成功!",
|
||||||
}
|
duration: 2000,
|
||||||
});
|
icon: "none",
|
||||||
},
|
});
|
||||||
|
setTimeout(() => {
|
||||||
// 验证码验证
|
uni.navigateBack({
|
||||||
verification(val) {
|
delta: 1,
|
||||||
this.flage = val == this.$store.state.verificationKey ? true : false;
|
});
|
||||||
},
|
}, 1000);
|
||||||
|
}
|
||||||
// 验证手机号
|
});
|
||||||
validatePhone() {
|
},
|
||||||
this.$refs.validateCodeForm.validate((valid) => {
|
|
||||||
if (valid) {
|
// 验证码验证
|
||||||
resetByMobile(this.codeForm).then((res) => {
|
verification(val) {
|
||||||
if (res.data.success) {
|
this.flage = val == this.$store.state.verificationKey ? true : false;
|
||||||
this.validateFlage = !this.validateFlage;
|
},
|
||||||
// 登录成功
|
|
||||||
uni.showToast({
|
// 验证手机号
|
||||||
title: "验证成功!",
|
validatePhone() {
|
||||||
icon: "none",
|
this.$refs.validateCodeForm.validate((valid) => {
|
||||||
});
|
if (valid) {
|
||||||
}
|
resetByMobile(this.codeForm).then((res) => {
|
||||||
});
|
if (res.data.success) {
|
||||||
}
|
this.validateFlage = !this.validateFlage;
|
||||||
});
|
// 登录成功
|
||||||
},
|
uni.showToast({
|
||||||
|
title: "验证成功!",
|
||||||
codeChange(text) {
|
icon: "none",
|
||||||
this.tips = text;
|
});
|
||||||
},
|
}
|
||||||
end() {},
|
});
|
||||||
|
}
|
||||||
/**判断是否是当前用户的手机号 */
|
});
|
||||||
isUserPhone() {
|
},
|
||||||
let flage = false;
|
|
||||||
let user = this.$options.filters.isLogin();
|
codeChange(text) {
|
||||||
if (user.mobile != this.codeForm.mobile) {
|
this.tips = text;
|
||||||
uni.showToast({
|
},
|
||||||
title: "请输入当前绑定手机号",
|
end() {
|
||||||
icon: "none",
|
|
||||||
});
|
this.flage = false;
|
||||||
flage = false;
|
this.$refs.verification.getCode()
|
||||||
} else {
|
},
|
||||||
flage = true;
|
|
||||||
}
|
/**判断是否是当前用户的手机号 */
|
||||||
|
isUserPhone() {
|
||||||
return flage;
|
let flage = false;
|
||||||
},
|
let user = this.$options.filters.isLogin();
|
||||||
/**获取验证码 */
|
if (user.mobile != this.codeForm.mobile) {
|
||||||
getCode() {
|
uni.showToast({
|
||||||
if (this.isUserPhone()) {
|
title: "请输入当前绑定手机号",
|
||||||
if (this.tips == "重新获取") {
|
icon: "none",
|
||||||
this.flage = true;
|
});
|
||||||
}
|
flage = false;
|
||||||
if (!this.$u.test.mobile(this.codeForm.mobile)) {
|
} else {
|
||||||
uni.showToast({
|
flage = true;
|
||||||
title: "请输入正确手机号",
|
}
|
||||||
icon: "none",
|
|
||||||
});
|
return flage;
|
||||||
return false;
|
},
|
||||||
}
|
/**获取验证码 */
|
||||||
if (!this.flage) {
|
getCode() {
|
||||||
this.$refs.verification.hide();
|
if (this.isUserPhone()) {
|
||||||
return false;
|
if (this.tips == "重新获取") {
|
||||||
}
|
this.$refs.verification.error(); //发送
|
||||||
}
|
}
|
||||||
},
|
if (!this.$u.test.mobile(this.codeForm.mobile)) {
|
||||||
start() {
|
uni.showToast({
|
||||||
this.$u.toast("验证码已发送");
|
title: "请输入正确手机号",
|
||||||
this.flage = false;
|
icon: "none",
|
||||||
},
|
});
|
||||||
},
|
return false;
|
||||||
};
|
}
|
||||||
</script>
|
if (!this.flage) {
|
||||||
<style lang="scss" scoped>
|
this.$refs.verification.error(); //发送
|
||||||
@import url("../../../passport/login.scss");
|
return false;
|
||||||
.u-form-item {
|
}
|
||||||
margin: 40rpx 0;
|
}
|
||||||
}
|
},
|
||||||
.sendCode {
|
start() {
|
||||||
/deep/ .u-form-item--right__content__slot {
|
this.$u.toast("验证码已发送");
|
||||||
display: flex;
|
this.flage = true;
|
||||||
}
|
|
||||||
}
|
this.$refs.verification.hide();
|
||||||
page {
|
},
|
||||||
background: #fff;
|
},
|
||||||
}
|
};
|
||||||
.box {
|
</script>
|
||||||
padding: 80rpx 0;
|
<style lang="scss" scoped>
|
||||||
border-radius: 20rpx;
|
@import url("@/pages/passport/login.scss");
|
||||||
}
|
|
||||||
.submit {
|
/deep/ .u-form-item {
|
||||||
background: $light-color;
|
margin: 40rpx 0;
|
||||||
}
|
}
|
||||||
.box-tips {
|
|
||||||
margin: 0 72rpx;
|
.sendCode {
|
||||||
}
|
/deep/ .u-form-item--right__content__slot {
|
||||||
.verification {
|
display: flex;
|
||||||
font-size: 24rpx;
|
}
|
||||||
color: #999;
|
}
|
||||||
margin-top: 10rpx;
|
|
||||||
}
|
.h2 {
|
||||||
</style>
|
font-size: 40rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
page {
|
||||||
|
background: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.box {
|
||||||
|
padding: 80rpx 0;
|
||||||
|
border-radius: 20rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.submit {
|
||||||
|
background: $light-color;
|
||||||
|
}
|
||||||
|
|
||||||
|
.box-tips {
|
||||||
|
margin: 0 72rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.verification {
|
||||||
|
font-size: 24rpx;
|
||||||
|
color: #999;
|
||||||
|
margin-top: 10rpx;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="container">
|
<view class="container">
|
||||||
<view class="person" @click="checkUserInfo()">
|
<view class="person" @click="checkUserInfo()">
|
||||||
<u-image width=140 height="140" shape="circle" :src="userInfo.face || '/static/missing-face.png'" mode=""></u-image>
|
<u-image width=140 height="140" shape="circle" :src="userInfo.face || '/static/missing-face.png'" mode="">
|
||||||
|
</u-image>
|
||||||
<view class="user-name">
|
<view class="user-name">
|
||||||
|
|
||||||
{{ userInfo.id ? userInfo.nickName || '' : '暂未登录' }}
|
{{ userInfo.id ? userInfo.nickName || '' : '暂未登录' }}
|
||||||
@@ -21,12 +22,14 @@
|
|||||||
<!-- #endif -->
|
<!-- #endif -->
|
||||||
<u-cell-item :title="`关于${config.name}`" @click="navigateTo('/pages/mine/set/editionIntro')"></u-cell-item>
|
<u-cell-item :title="`关于${config.name}`" @click="navigateTo('/pages/mine/set/editionIntro')"></u-cell-item>
|
||||||
</u-cell-group>
|
</u-cell-group>
|
||||||
<view class="submit" @click="showModalDialog">{{userInfo.id ?'退出登录':'返回登录'}}</view>
|
<view class="submit" @click="showModalDialog">{{userInfo.id ?'退出登录':'登录'}}</view>
|
||||||
<u-modal show-cancel-button v-model="quitShow" @confirm="confirm" :confirm-color="lightColor" :async-close="true" :content="userInfo.id ? '确定要退出登录么?' : '确定要返回登录么?'"></u-modal>
|
<u-modal show-cancel-button v-model="quitShow" @confirm="confirm" :confirm-color="lightColor" :async-close="true"
|
||||||
|
:content="userInfo.id ? '确定要退出登录么?' : '确定要登录么?'"></u-modal>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import { logout } from "@/api/login";
|
||||||
import storage from "@/utils/storage.js";
|
import storage from "@/utils/storage.js";
|
||||||
import config from "@/config/config";
|
import config from "@/config/config";
|
||||||
export default {
|
export default {
|
||||||
@@ -50,16 +53,26 @@ export default {
|
|||||||
url: url,
|
url: url,
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
clear() {
|
||||||
|
storage.setAccessToken("");
|
||||||
|
storage.setRefreshToken("");
|
||||||
|
storage.setUserInfo({});
|
||||||
|
this.$options.filters.navigateToLogin("redirectTo");
|
||||||
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 确认退出
|
* 确认退出
|
||||||
* 清除缓存重新登录
|
* 清除缓存重新登录
|
||||||
*/
|
*/
|
||||||
confirm() {
|
async confirm() {
|
||||||
storage.setAccessToken("");
|
try{
|
||||||
storage.setRefreshToken("");
|
await logout();
|
||||||
storage.setUserInfo({});
|
this.clear();
|
||||||
this.$options.filters.navigateToLogin("redirectTo");
|
}catch(e){
|
||||||
|
//TODO handle the exception
|
||||||
|
this.clear();
|
||||||
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -22,26 +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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/deep/ .u-row {
|
|
||||||
// #ifdef MP-WEIXIN
|
|
||||||
padding: 0 5%;
|
|
||||||
// #endif
|
|
||||||
}
|
|
||||||
|
|
||||||
.status_bar {
|
.status_bar {
|
||||||
height: var(--status-bar-height);
|
height: var(--status-bar-height);
|
||||||
background: #fff !important;
|
background: #fff !important;
|
||||||
@@ -62,6 +42,7 @@ page {
|
|||||||
padding: 30rpx;
|
padding: 30rpx;
|
||||||
> .sort-item {
|
> .sort-item {
|
||||||
> .sort-title {
|
> .sort-title {
|
||||||
|
margin: 20rpx 0;
|
||||||
font-size: 26rpx;
|
font-size: 26rpx;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
@@ -121,7 +102,7 @@ page {
|
|||||||
font-size: 24rpx;
|
font-size: 24rpx;
|
||||||
}
|
}
|
||||||
.flex {
|
.flex {
|
||||||
margin: 30rpx 0;
|
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
> .sort-brand-item {
|
> .sort-brand-item {
|
||||||
@@ -138,47 +119,36 @@ page {
|
|||||||
height: 100vh;
|
height: 100vh;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
.storeSellerBox {
|
|
||||||
// #ifndef MP-WEIXIN
|
|
||||||
padding: 16rpx !important;
|
|
||||||
|
|
||||||
// #endif
|
|
||||||
}
|
|
||||||
.goodsClass {
|
|
||||||
padding: 0 20rpx;
|
|
||||||
|
|
||||||
/deep/ .u-row {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.index-nav-arrow:last-child {
|
.index-nav-arrow:last-child {
|
||||||
margin-top: -22rpx;
|
margin-top: -22rpx;
|
||||||
}
|
}
|
||||||
|
.line1-store-name{
|
||||||
|
font-size: 24rpx;
|
||||||
|
color: #999;
|
||||||
|
}
|
||||||
|
.to-store{
|
||||||
|
font-size: 24rpx;
|
||||||
|
color: #333;
|
||||||
|
margin-left: 10rpx;
|
||||||
|
}
|
||||||
.img {
|
.img {
|
||||||
width: 26rpx;
|
width: 26rpx;
|
||||||
height: 26rpx;
|
height: 26rpx;
|
||||||
}
|
}
|
||||||
.goodsRow {
|
.goods-row {
|
||||||
/deep/ .u-row {
|
|
||||||
// #ifdef MP-WEIXIN
|
|
||||||
padding: 0%;
|
|
||||||
background: #fff;
|
|
||||||
// padding: 16rpx;
|
|
||||||
border-radius: 0.4em;
|
|
||||||
margin: 0 !important;
|
|
||||||
|
|
||||||
// #endif
|
|
||||||
}
|
|
||||||
|
|
||||||
background: #fff;
|
background: #fff;
|
||||||
border-radius: 0.4em;
|
padding: 16rpx;
|
||||||
margin: 20rpx 0;
|
|
||||||
// #ifdef MP-WEIXIN
|
>.goods-col{
|
||||||
margin: 10rpx 0;
|
display: flex;
|
||||||
// #endif
|
>.goods-img{
|
||||||
padding: 0 16rpx;
|
flex: 4;
|
||||||
width: 100%;
|
}
|
||||||
|
>.goods-detail{
|
||||||
|
flex: 7;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.add1 {
|
.add1 {
|
||||||
@@ -192,21 +162,14 @@ page {
|
|||||||
border-bottom: 1px solid #eeeeee;
|
border-bottom: 1px solid #eeeeee;
|
||||||
}
|
}
|
||||||
|
|
||||||
.logimg {
|
|
||||||
width: 40rpx;
|
|
||||||
height: 40rpx;
|
|
||||||
vertical-align: middle;
|
|
||||||
}
|
|
||||||
|
|
||||||
.clamp3 {
|
.clamp3 {
|
||||||
padding-top: 30rpx;
|
|
||||||
margin-bottom: 10rpx;
|
margin-bottom: 10rpx;
|
||||||
font-size: 28rpx;
|
font-size: 28rpx;
|
||||||
color: #333333;
|
color: #333333;
|
||||||
|
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
display: -webkit-box;
|
display: -webkit-box;
|
||||||
line-height: 40rpx;
|
height: 80rpx;
|
||||||
-webkit-box-orient: vertical;
|
-webkit-box-orient: vertical;
|
||||||
|
|
||||||
-webkit-line-clamp: 2 !important;
|
-webkit-line-clamp: 2 !important;
|
||||||
@@ -217,25 +180,12 @@ page {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.switchType1 {
|
|
||||||
width: 50%;
|
|
||||||
overflow: hidden;
|
|
||||||
text-align: center;
|
|
||||||
|
|
||||||
> .img {
|
|
||||||
width: 182rpx;
|
|
||||||
height: 200rpx;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.imgGoods {
|
|
||||||
width: 182rpx;
|
|
||||||
height: 200rpx;
|
|
||||||
}
|
|
||||||
view {
|
view {
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
|
|
||||||
.storeSellerName {
|
.store-seller-name {
|
||||||
color: #666;
|
color: #666;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
|
||||||
@@ -248,7 +198,7 @@ view {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.countConfig {
|
.count-config {
|
||||||
padding: 10rpx 0;
|
padding: 10rpx 0;
|
||||||
color: #666;
|
color: #666;
|
||||||
display: flex;
|
display: flex;
|
||||||
@@ -474,181 +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;
|
|
||||||
}
|
|
||||||
|
|
||||||
.countConfig,
|
|
||||||
.storeSellerName {
|
|
||||||
font-size: $font-sm;
|
|
||||||
}
|
|
||||||
|
|
||||||
.textHidden {
|
|
||||||
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%;
|
||||||
|
|||||||
@@ -35,7 +35,8 @@
|
|||||||
@click="doSearch(keyword)">
|
@click="doSearch(keyword)">
|
||||||
<span>{{ keyword }} </span>
|
<span>{{ keyword }} </span>
|
||||||
</div>
|
</div>
|
||||||
<div @click="showMore" v-if=" oldKeywordIndex > loadIndex" class="oldKeyItem">展示更多</div>
|
|
||||||
|
<div @click="showMore" v-if="oldKeywordIndex > loadIndex" class="oldKeyItem">展示更多</div>
|
||||||
</div>
|
</div>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
@@ -82,69 +83,10 @@
|
|||||||
<div v-if="isSWitch">
|
<div v-if="isSWitch">
|
||||||
<scroll-view :style="{ height: goodsHeight }" enableBackToTop="true" lower-threshold="250"
|
<scroll-view :style="{ height: goodsHeight }" enableBackToTop="true" lower-threshold="250"
|
||||||
@scrolltolower="loadmore()" scroll-with-animation scroll-y class="scoll-page">
|
@scrolltolower="loadmore()" scroll-with-animation scroll-y class="scoll-page">
|
||||||
<div class="goodsClass">
|
<goodsList :res='goodsList' type='oneColumns' :keyword='keyword' />
|
||||||
<u-row v-for="(item, index) in goodsList" :key="index" class="goodsRow">
|
|
||||||
<u-col :span="4" @click.native="navigateToDetailPage(item)" class="switchType1">
|
|
||||||
<u-image width="182rpx" height="200rpx" class="imgGoods" :src="item.content.thumbnail">
|
|
||||||
<u-loading slot="loading"></u-loading>
|
|
||||||
</u-image>
|
|
||||||
</u-col>
|
|
||||||
<u-col :span="8" @click.native="navigateToDetailPage(item)" class="switchType2">
|
|
||||||
<div class="title clamp3" style="">{{ item.content.goodsName }}</div>
|
|
||||||
<view class="price-box">
|
|
||||||
<div class="price" v-if="item.content.price!=undefined">
|
|
||||||
¥<span>{{ formatPrice(item.content.price )[0] }} </span>.{{
|
|
||||||
formatPrice(item.content.price )[1]
|
|
||||||
}}
|
|
||||||
</div>
|
|
||||||
</view>
|
|
||||||
<div class="promotion">
|
|
||||||
<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" class="countConfig">
|
|
||||||
<span style="float: left; font-size: 22rpx">已售 {{ item.buyCount || '0' }}</span>
|
|
||||||
<span style="float: right; font-size: 22rpx">{{ item.commentNum || '0' }}条评论</span>
|
|
||||||
</div>
|
|
||||||
</u-col>
|
|
||||||
<u-col :span="12" class="storeSellerBox">
|
|
||||||
<div class="storeSellerName" @click="clickTostore()">
|
|
||||||
<div class="textHidden">
|
|
||||||
<u-tag style="margin-right: 10rpx" size="mini" mode="dark" v-if="item.selfOperated" text="自营"
|
|
||||||
type="error" />
|
|
||||||
|
|
||||||
<span style="
|
|
||||||
color: #333333;
|
|
||||||
font-size: 28rpx;
|
|
||||||
padding-left: 17rpx;
|
|
||||||
">{{ item.storeName }}</span>
|
|
||||||
</div>
|
|
||||||
<span>
|
|
||||||
<u-icon name="arrow-right" color="#c5c5c5"></u-icon>
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
</u-col>
|
|
||||||
</u-row>
|
|
||||||
</div>
|
|
||||||
<uni-load-more :status="loadingType" @loadmore="loadmore()"></uni-load-more>
|
<uni-load-more :status="loadingType" @loadmore="loadmore()"></uni-load-more>
|
||||||
</scroll-view>
|
</scroll-view>
|
||||||
</div>
|
</div>
|
||||||
<div class="empty" v-if="goodsList == [] || goodsList == '' || goodsList == null">
|
|
||||||
<view>
|
|
||||||
<image style="width: 320rpx; height: 240rpx" src="/static/nodata.png">
|
|
||||||
|
|
||||||
</image>
|
|
||||||
</view>
|
|
||||||
<view>
|
|
||||||
<p>没有找到相关的商品信息</p>
|
|
||||||
<p>请换一个关键词试试吧</p>
|
|
||||||
</view>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- 一行两个商品展示 -->
|
<!-- 一行两个商品展示 -->
|
||||||
<div v-if="
|
<div v-if="
|
||||||
!isSWitch &&
|
!isSWitch &&
|
||||||
@@ -152,48 +94,7 @@
|
|||||||
">
|
">
|
||||||
<scroll-view :style="{ height: goodsHeight }" scroll-anchoring enableBackToTop="true"
|
<scroll-view :style="{ height: goodsHeight }" scroll-anchoring enableBackToTop="true"
|
||||||
@scrolltolower="loadmore()" scroll-with-animation scroll-y lower-threshold="250" class="scoll-page">
|
@scrolltolower="loadmore()" scroll-with-animation scroll-y lower-threshold="250" class="scoll-page">
|
||||||
<view class="goods-list">
|
<goodsList :res='goodsList' :keyword='keyword' />
|
||||||
<view v-for="(item, index) in goodsList" :key="index" class="goods-item"
|
|
||||||
@click="navigateToDetailPage(item)">
|
|
||||||
<view class="image-wrapper">
|
|
||||||
<image :src="item.content.thumbnail" mode="aspectFill"></image>
|
|
||||||
</view>
|
|
||||||
<view class="goods-detail">
|
|
||||||
<div class="title clamp">{{ item.content.goodsName }}</div>
|
|
||||||
<view class="price-box">
|
|
||||||
<div class="price" v-if="item.content.price!=undefined">
|
|
||||||
|
|
||||||
¥<span>{{ formatPrice(item.content.price )[0] }} </span>.{{
|
|
||||||
formatPrice(item.content.price )[1]
|
|
||||||
}}
|
|
||||||
</div>
|
|
||||||
</view>
|
|
||||||
|
|
||||||
<div class="promotion">
|
|
||||||
<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="countConfig">
|
|
||||||
<span>已售 {{ item.buyCount || "0" }}</span>
|
|
||||||
<span>{{ item.commentNum || "0" }}条评论</span>
|
|
||||||
</div>
|
|
||||||
<div class="storeSellerName">
|
|
||||||
<div class="textHidden">
|
|
||||||
<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>
|
|
||||||
<uni-load-more :status="loadingType"></uni-load-more>
|
<uni-load-more :status="loadingType"></uni-load-more>
|
||||||
</scroll-view>
|
</scroll-view>
|
||||||
</div>
|
</div>
|
||||||
@@ -275,20 +176,34 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</u-popup>
|
</u-popup>
|
||||||
|
<div class="empty" v-if="empty">
|
||||||
|
<view>
|
||||||
|
<image style="width: 320rpx; height: 240rpx" src="/static/nodata.png">
|
||||||
|
|
||||||
|
</image>
|
||||||
|
</view>
|
||||||
|
<view>
|
||||||
|
<p>没有找到相关的商品信息</p>
|
||||||
|
<p>请换一个关键词试试吧</p>
|
||||||
|
</view>
|
||||||
|
</div>
|
||||||
|
<u-back-top :scroll-top="scrollTop"></u-back-top>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { getGoodsList, getGoodsRelated } from "@/api/goods.js";
|
import { getGoodsList, getGoodsRelated } from "@/api/goods.js";
|
||||||
|
import goodsList from '@/components/m-goods-list/list.vue'
|
||||||
import { getHotKeywords } from "@/api/home.js";
|
import { getHotKeywords } from "@/api/home.js";
|
||||||
import mSearch from "@/components/m-search-revision/m-search-revision.vue";
|
import mSearch from "@/components/m-search-revision/m-search-revision.vue";
|
||||||
import storage from "@/utils/storage";
|
import storage from "@/utils/storage";
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
empty:false,
|
||||||
|
scrollTop: 0,
|
||||||
loadIndex: 10,
|
loadIndex: 10,
|
||||||
oldKeywordIndex: "",
|
oldKeywordIndex: 0,
|
||||||
selectedWay: {
|
selectedWay: {
|
||||||
brand: [],
|
brand: [],
|
||||||
categoryId: [],
|
categoryId: [],
|
||||||
@@ -326,8 +241,7 @@ export default {
|
|||||||
pageNumber: 1,
|
pageNumber: 1,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
// sort: 'grade_asc',
|
// sort: 'grade_asc',
|
||||||
sort: "releaseTime",
|
|
||||||
order: "desc",
|
|
||||||
keyword: "",
|
keyword: "",
|
||||||
},
|
},
|
||||||
minPrice: "",
|
minPrice: "",
|
||||||
@@ -345,9 +259,14 @@ export default {
|
|||||||
routerVal: "",
|
routerVal: "",
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
|
onPageScroll(e) {
|
||||||
|
console.log(e);
|
||||||
|
this.scrollTop = e.scrollTop;
|
||||||
|
},
|
||||||
onLoad(val) {
|
onLoad(val) {
|
||||||
this.init();
|
this.init();
|
||||||
this.initSortGoods();
|
// this.initSortGoods();
|
||||||
// 接收分类的数据
|
// 接收分类的数据
|
||||||
|
|
||||||
this.routerVal = val;
|
this.routerVal = val;
|
||||||
@@ -355,7 +274,11 @@ export default {
|
|||||||
// 有值
|
// 有值
|
||||||
if (this.routerVal.category) {
|
if (this.routerVal.category) {
|
||||||
this.params.categoryId = this.routerVal.category;
|
this.params.categoryId = this.routerVal.category;
|
||||||
|
this.sortParams.categoryId = this.routerVal.category;
|
||||||
this.isShowSeachGoods = true;
|
this.isShowSeachGoods = true;
|
||||||
|
this.$nextTick(()=>{
|
||||||
|
this.$refs.mSearch.isShowSeachGoods = true;
|
||||||
|
})
|
||||||
}
|
}
|
||||||
if (this.routerVal.keyword) {
|
if (this.routerVal.keyword) {
|
||||||
this.params.keyword = this.routerVal.keyword;
|
this.params.keyword = this.routerVal.keyword;
|
||||||
@@ -369,6 +292,7 @@ export default {
|
|||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
mSearch,
|
mSearch,
|
||||||
|
goodsList
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
/**
|
/**
|
||||||
@@ -383,6 +307,12 @@ export default {
|
|||||||
this.defaultKeyword = "请输入搜索商品";
|
this.defaultKeyword = "请输入搜索商品";
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
sortPopup(val) {
|
||||||
|
if (val) {
|
||||||
|
this.selectedWay = { brand: [], categoryId: [], prop: [] };
|
||||||
|
console.log(this.selectedWay);
|
||||||
|
}
|
||||||
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
onReachBottom() {
|
onReachBottom() {
|
||||||
@@ -441,15 +371,6 @@ export default {
|
|||||||
return array;
|
return array;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
// 格式化金钱 1999 --> [1999,00]
|
|
||||||
formatPrice(val) {
|
|
||||||
if (typeof val == "undefined") {
|
|
||||||
return val;
|
|
||||||
}
|
|
||||||
return val.toFixed(2).split(".");
|
|
||||||
},
|
|
||||||
|
|
||||||
// 展示更多数据
|
// 展示更多数据
|
||||||
showMore() {
|
showMore() {
|
||||||
this.loadOldKeyword(this.oldKeywordIndex);
|
this.loadOldKeyword(this.oldKeywordIndex);
|
||||||
@@ -458,19 +379,32 @@ export default {
|
|||||||
// 点击确定进行筛选
|
// 点击确定进行筛选
|
||||||
sortConfim() {
|
sortConfim() {
|
||||||
// 处理品牌(多选
|
// 处理品牌(多选
|
||||||
this.params.brandId = [];
|
if (!this.params.brandId) {
|
||||||
|
this.params.brandId = [];
|
||||||
|
} else {
|
||||||
|
this.params.brandId = [this.params.brandId];
|
||||||
|
}
|
||||||
|
|
||||||
|
// 如果选中品牌 赋值
|
||||||
this.selectedWay["brand"].forEach((item) => {
|
this.selectedWay["brand"].forEach((item) => {
|
||||||
if (item.__selected) {
|
if (item.__selected) {
|
||||||
this.params.brandId.push(item.value);
|
this.params.brandId.push(item.value);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
this.params.brandId = this.params.brandId.join("@");
|
|
||||||
|
this.params.brandId = this.params.brandId.join("@") || "";
|
||||||
|
|
||||||
|
console.log(this.params.brandId);
|
||||||
// 处理分类 (单选)
|
// 处理分类 (单选)
|
||||||
if (this.selectedWay["categoryId"][0]) {
|
if (this.selectedWay["categoryId"][0]) {
|
||||||
this.params.categoryId = this.selectedWay["categoryId"][0].value;
|
this.params.categoryId = this.selectedWay["categoryId"][0].value;
|
||||||
}
|
}
|
||||||
// 处理属性
|
if (!this.params.prop) {
|
||||||
this.params.prop = [];
|
this.params.prop = [];
|
||||||
|
} else {
|
||||||
|
this.params.prop = [this.params.prop];
|
||||||
|
}
|
||||||
|
|
||||||
this.selectedWay["prop"].forEach((item) => {
|
this.selectedWay["prop"].forEach((item) => {
|
||||||
if (item.__selected) {
|
if (item.__selected) {
|
||||||
this.params.prop.push(`${item.parent}_${item.title}`);
|
this.params.prop.push(`${item.parent}_${item.title}`);
|
||||||
@@ -485,19 +419,32 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
this.goodsList = [];
|
this.goodsList = [];
|
||||||
|
|
||||||
|
this.params.pageNumber = 1;
|
||||||
|
this.sortParams = this.params;
|
||||||
|
|
||||||
|
|
||||||
this.loadData();
|
this.loadData();
|
||||||
this.sortPopup = false;
|
this.sortPopup = false;
|
||||||
},
|
},
|
||||||
|
|
||||||
// 重置
|
// 重置
|
||||||
repick() {
|
repick() {
|
||||||
|
this.sortParams = {
|
||||||
|
pageNumber: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
categoryId: this.routerVal.category || "",
|
||||||
|
};
|
||||||
|
this.sortPopup = false;
|
||||||
this.initSortGoods();
|
this.initSortGoods();
|
||||||
this.minPrice = "";
|
this.minPrice = "";
|
||||||
this.maxPrice = "";
|
this.maxPrice = "";
|
||||||
this.params = {
|
this.params = {
|
||||||
pageNumber: 1,
|
pageNumber: 1,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
|
categoryId: this.routerVal.category || "",
|
||||||
};
|
};
|
||||||
|
this.goodsList = [];
|
||||||
this.loadData();
|
this.loadData();
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -531,11 +478,18 @@ export default {
|
|||||||
delta: 1,
|
delta: 1,
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
// 跳转到商品详情
|
||||||
navigateToDetailPage(item) {
|
navigateToDetailPage(item) {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: `/pages/product/goods?id=${item.content.id}&goodsId=${item.content.goodsId}`,
|
url: `/pages/product/goods?id=${item.content.id}&goodsId=${item.content.goodsId}`,
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
// 跳转地址
|
||||||
|
navigateToStoreDetailPage(item) {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: `/pages/product/shopPage?id=${item.content.storeId}`,
|
||||||
|
});
|
||||||
|
},
|
||||||
loadmore() {
|
loadmore() {
|
||||||
this.params.pageNumber++;
|
this.params.pageNumber++;
|
||||||
this.loadData();
|
this.loadData();
|
||||||
@@ -617,7 +571,7 @@ export default {
|
|||||||
key: "OldKeys",
|
key: "OldKeys",
|
||||||
success: (res) => {
|
success: (res) => {
|
||||||
var OldKeys = JSON.parse(res.data);
|
var OldKeys = JSON.parse(res.data);
|
||||||
this.oldKeywordIndex = res.data.length;
|
this.oldKeywordIndex = OldKeys.length;
|
||||||
for (let i = 0; i < index; i++) {
|
for (let i = 0; i < index; i++) {
|
||||||
this.oldKeywordList.push(OldKeys[i]);
|
this.oldKeywordList.push(OldKeys[i]);
|
||||||
}
|
}
|
||||||
@@ -668,8 +622,11 @@ export default {
|
|||||||
let goodsList = await getGoodsList(this.params);
|
let goodsList = await getGoodsList(this.params);
|
||||||
|
|
||||||
if (goodsList.data.result.content.length < 10) {
|
if (goodsList.data.result.content.length < 10) {
|
||||||
this.loadingType = "noMore";
|
this.loadingType = "noMore";
|
||||||
}
|
this.empty = true
|
||||||
|
} else {
|
||||||
|
this.empty = false
|
||||||
|
}
|
||||||
this.goodsList.push(...goodsList.data.result.content);
|
this.goodsList.push(...goodsList.data.result.content);
|
||||||
this.initSortGoods();
|
this.initSortGoods();
|
||||||
uni.hideLoading();
|
uni.hideLoading();
|
||||||
@@ -718,6 +675,9 @@ export default {
|
|||||||
doSearchSwitch() {
|
doSearchSwitch() {
|
||||||
this.isSWitch = !this.isSWitch;
|
this.isSWitch = !this.isSWitch;
|
||||||
this.isShowSeachGoods = true;
|
this.isShowSeachGoods = true;
|
||||||
|
this.params.pageNumber = 1
|
||||||
|
this.params.pageSize = 10
|
||||||
|
this.loadData("refresh", 1);
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,29 +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" :active-color="$lightColor"></u-tabs>
|
<u-tabs
|
||||||
|
bg-color="#fff"
|
||||||
|
:list="list"
|
||||||
|
:is-scroll="false"
|
||||||
|
:current="current"
|
||||||
|
@change="change"
|
||||||
|
:active-color="$lightColor"
|
||||||
|
></u-tabs>
|
||||||
</view>
|
</view>
|
||||||
<div class="u-tabs-search">
|
<div class="u-tabs-search">
|
||||||
<u-search placeholder="请输入订单编号" @search="handleGetOrderList(current)" @clear="handleGetOrderList(current)" @custom="handleGetOrderList(current)" v-model="params.orderSn"></u-search>
|
<u-search
|
||||||
|
placeholder="请输入订单编号"
|
||||||
|
@search="submitSearchOrderList(current)"
|
||||||
|
@clear="submitSearchOrderList(current)"
|
||||||
|
@custom="submitSearchOrderList(current)"
|
||||||
|
v-model="orderSn"
|
||||||
|
>
|
||||||
|
</u-search>
|
||||||
</div>
|
</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(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>
|
||||||
@@ -36,74 +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 && order.groupAfterSaleStatus">
|
||||||
<view v-if="
|
<view
|
||||||
current === 0 && order.groupAfterSaleStatus &&
|
v-if="order.groupAfterSaleStatus.includes('ALREADY_APPLIED')"
|
||||||
order.groupAfterSaleStatus === '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" v-if="current === 0 && order.groupAfterSaleStatus && order.groupAfterSaleStatus === 'EXPIRED'" @click="tipsShow = true">
|
</view>
|
||||||
|
<view v-if="current === 0 && order.groupAfterSaleStatus">
|
||||||
|
<view
|
||||||
|
v-if="order.groupAfterSaleStatus.includes('EXPIRED')"
|
||||||
|
class="cannot_apply not_center"
|
||||||
|
@click="tipsShow = true"
|
||||||
|
>
|
||||||
<u-icon class="icon" name="info-circle-fill"></u-icon>
|
<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=='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: {
|
||||||
@@ -125,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",
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -138,21 +239,27 @@ export default {
|
|||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
},
|
},
|
||||||
status: "loadmore",
|
status: "loadmore",
|
||||||
|
orderSn: "", // 搜索订单sn
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
onLoad(options) {
|
onLoad(options) {
|
||||||
this.orderList = [];
|
this.orderList = [];
|
||||||
this.params.pageNumber = 1;
|
this.params.pageNumber = 1;
|
||||||
if (options.orderSn) this.params.orderSn = options.orderSn;
|
if (options.orderSn) this.params.orderSn = options.orderSn;
|
||||||
this.getOrderList(this.current);
|
this.searchOrderList(this.current);
|
||||||
},
|
},
|
||||||
onPullDownRefresh() {
|
onPullDownRefresh() {
|
||||||
this.change(this.current);
|
this.change(this.current);
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
handleGetOrderList(current) {
|
/**
|
||||||
|
* 点击搜索执行搜索
|
||||||
|
*/
|
||||||
|
submitSearchOrderList(current) {
|
||||||
|
this.params.pageNumber = 1;
|
||||||
|
this.logParams.pageNumber = 1;
|
||||||
this.orderList = [];
|
this.orderList = [];
|
||||||
this.getOrderList(current);
|
this.searchOrderList(current);
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* 切换tab页时,初始化数据
|
* 切换tab页时,初始化数据
|
||||||
@@ -165,8 +272,18 @@ export default {
|
|||||||
};
|
};
|
||||||
this.orderList = [];
|
this.orderList = [];
|
||||||
//如果是2 则读取售后申请记录列表
|
//如果是2 则读取售后申请记录列表
|
||||||
|
this.searchOrderList(index);
|
||||||
|
uni.stopPullDownRefresh();
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 搜索初始化
|
||||||
|
* 根据当前tab传值的索引进行更改
|
||||||
|
*/
|
||||||
|
searchOrderList(index) {
|
||||||
if (index == 0) {
|
if (index == 0) {
|
||||||
this.getOrderList(index);
|
this.orderSn ? (this.params.orderSn = this.orderSn) : "";
|
||||||
|
this.getOrderList();
|
||||||
} else {
|
} else {
|
||||||
this.logParams = {
|
this.logParams = {
|
||||||
pageNumber: 1,
|
pageNumber: 1,
|
||||||
@@ -177,28 +294,28 @@ export default {
|
|||||||
if (index === 1) {
|
if (index === 1) {
|
||||||
this.logParams.serviceStatus = "APPLY";
|
this.logParams.serviceStatus = "APPLY";
|
||||||
}
|
}
|
||||||
|
this.orderSn ? (this.logParams.orderSn = this.orderSn) : "";
|
||||||
this.orderList = [];
|
this.orderList = [];
|
||||||
this.getAfterSaleLogList();
|
this.getAfterSaleLogList();
|
||||||
}
|
}
|
||||||
uni.stopPullDownRefresh();
|
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取订单列表
|
* 获取订单列表
|
||||||
*/
|
*/
|
||||||
getOrderList(index) {
|
getOrderList() {
|
||||||
uni.showLoading({
|
uni.showLoading({
|
||||||
title: "加载中",
|
title: "加载中",
|
||||||
mask: true,
|
mask: true,
|
||||||
});
|
});
|
||||||
getOrderList(this.params).then((res) => {
|
getOrderList(this.params).then((res) => {
|
||||||
uni.hideLoading();
|
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";
|
||||||
@@ -206,6 +323,31 @@ export default {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
close(order, sku) {
|
||||||
|
console.log(order, sku);
|
||||||
|
this.selectedOrder = order;
|
||||||
|
this.cancelShow = true;
|
||||||
|
},
|
||||||
|
|
||||||
|
async closeService() {
|
||||||
|
uni.showLoading({
|
||||||
|
title: "加载中",
|
||||||
|
});
|
||||||
|
console.log(this.selectedOrder);
|
||||||
|
let res = await cancelAfterSale(this.selectedOrder.sn);
|
||||||
|
if (res.data.success) {
|
||||||
|
uni.showToast({
|
||||||
|
title: "取消成功!",
|
||||||
|
duration: 2000,
|
||||||
|
icon: "none",
|
||||||
|
});
|
||||||
|
}
|
||||||
|
this.orderList = [];
|
||||||
|
this.searchOrderList(this.current);
|
||||||
|
|
||||||
|
uni.hideLoading();
|
||||||
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 售后详情
|
* 售后详情
|
||||||
*/
|
*/
|
||||||
@@ -252,11 +394,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)
|
|
||||||
)}`,
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -265,21 +405,33 @@ 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))}`,
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查看详情
|
* 查看详情
|
||||||
*/
|
*/
|
||||||
onDetail(sku) {
|
onDetail(goods, sku) {
|
||||||
if (!this.$u.test.isEmpty(sku.skuId)) {
|
// 售后申请
|
||||||
|
if (this.current == 0) {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: `/pages/product/goods?id=${sku.skuId}&goodsId=${sku.goodsId}`,
|
url: `/pages/product/goods?id=${sku.skuId}&goodsId=${
|
||||||
|
sku.goodsId || sku.goodsId
|
||||||
|
}`,
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: `/pages/product/goods?id=${goods.skuId}&goodsId=${
|
||||||
|
goods.goodsId || goods.goodsId
|
||||||
|
}`,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -306,35 +458,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;
|
||||||
@@ -378,6 +538,7 @@ page,
|
|||||||
color: $main-color;
|
color: $main-color;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.btn-view {
|
.btn-view {
|
||||||
padding: 16rpx 0;
|
padding: 16rpx 0;
|
||||||
|
|
||||||
@@ -387,10 +548,12 @@ page,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.description {
|
.description {
|
||||||
color: #909399;
|
color: #909399;
|
||||||
size: 25rpx;
|
size: 25rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.cannot_apply {
|
.cannot_apply {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
font-size: 22rpx;
|
font-size: 22rpx;
|
||||||
@@ -399,31 +562,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>
|
||||||
|
|||||||
@@ -10,7 +10,8 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view>
|
<view>
|
||||||
<view class="goods-item-view" v-for="(item,index) in sku.orderItems" v-if="item.sn == sn" @click="gotoGoodsDetail(sku.goods_id)">
|
<view class="goods-item-view" v-for="(item,index) in sku.orderItems" v-if="item.sn == sn"
|
||||||
|
@click="gotoGoodsDetail(sku.goods_id)">
|
||||||
<view class="goods-img">
|
<view class="goods-img">
|
||||||
<u-image border-radius="6" width="131rpx" height="131rpx" :src="item.image"></u-image>
|
<u-image border-radius="6" width="131rpx" height="131rpx" :src="item.image"></u-image>
|
||||||
</view>
|
</view>
|
||||||
@@ -27,7 +28,8 @@
|
|||||||
<view class="after-num">
|
<view class="after-num">
|
||||||
<view>申请数量</view>
|
<view>申请数量</view>
|
||||||
<view>
|
<view>
|
||||||
<u-number-box :value="parseInt(form.num)" disabled-input :min="1" :max="parseInt(sku.num)" bg-color="#fff" @change="valChange"></u-number-box>
|
<u-number-box :value="parseInt(form.num)" disabled-input :min="1" :max="parseInt(sku.num)" bg-color="#fff"
|
||||||
|
@change="valChange"></u-number-box>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -36,7 +38,8 @@
|
|||||||
<!-- 退款原因 -->
|
<!-- 退款原因 -->
|
||||||
<view class="opt-view">
|
<view class="opt-view">
|
||||||
<u-form-item label="申请原因" :label-width="150">
|
<u-form-item label="申请原因" :label-width="150">
|
||||||
<u-input v-model="form.reason" type="select" input-align="right" :select-open="reasonSelectShow" @click="reasonSelectShow = true" placeholder="请选择申请原因" />
|
<u-input v-model="form.reason" type="select" input-align="right" :select-open="reasonSelectShow"
|
||||||
|
@click="reasonSelectShow = true" placeholder="请选择申请原因" />
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
<u-form-item label="申请说明" :label-width="150">
|
<u-form-item label="申请说明" :label-width="150">
|
||||||
<u-input input-align="right" type="textarea" v-model="form.problemDesc" placeholder="请描述申请售后的说明" />
|
<u-input input-align="right" type="textarea" v-model="form.problemDesc" placeholder="请描述申请售后的说明" />
|
||||||
@@ -47,7 +50,8 @@
|
|||||||
<view class="opt-view">
|
<view class="opt-view">
|
||||||
<view class="img-title">上传凭证(最多5张)</view>
|
<view class="img-title">上传凭证(最多5张)</view>
|
||||||
<view class="images-view">
|
<view class="images-view">
|
||||||
<u-upload :header=" { accessToken: storage.getAccessToken() }" :action="action" width="150" @on-uploaded="onUploaded" :max-count="5" :show-progress="false"></u-upload>
|
<u-upload :header=" { accessToken: storage.getAccessToken() }" :action="action" width="150"
|
||||||
|
@on-uploaded="onUploaded" :max-count="5" :show-progress="false"></u-upload>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
@@ -81,11 +85,14 @@
|
|||||||
</u-form>
|
</u-form>
|
||||||
|
|
||||||
<view class="submit-view">
|
<view class="submit-view">
|
||||||
<u-button type="primary" ripple shape="circle" v-if="applyInfo.refundWay" :custom-style="customStyle" @click="onSubmit">提交申请</u-button>
|
<u-button type="primary" ripple shape="circle" v-if="applyInfo.refundWay" :custom-style="customStyle"
|
||||||
|
@click="onSubmit">提交申请</u-button>
|
||||||
</view>
|
</view>
|
||||||
<u-select mode="single-column" :list="reasonList" v-model="reasonSelectShow" @confirm="reasonSelectConfirm"></u-select>
|
<u-select mode="single-column" :list="reasonList" v-model="reasonSelectShow" @confirm="reasonSelectConfirm">
|
||||||
|
</u-select>
|
||||||
<u-select mode="single-column" :list="typeList" v-model="typeSelectShow" @confirm="typeSelectConfirm"></u-select>
|
<u-select mode="single-column" :list="typeList" v-model="typeSelectShow" @confirm="typeSelectConfirm"></u-select>
|
||||||
<u-select mode="single-column" :list="returnList" v-model="returnSelectShow" @confirm="returnSelectConfirm"></u-select>
|
<u-select mode="single-column" :list="returnList" v-model="returnSelectShow" @confirm="returnSelectConfirm">
|
||||||
|
</u-select>
|
||||||
<u-toast ref="uToast" />
|
<u-toast ref="uToast" />
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
@@ -188,9 +195,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;
|
||||||
@@ -305,6 +310,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)) {
|
||||||
@@ -329,12 +335,6 @@ export default {
|
|||||||
type: "error",
|
type: "error",
|
||||||
});
|
});
|
||||||
return false;
|
return false;
|
||||||
} else if (checkBankno(this.form.bankAccountNumber) === false) {
|
|
||||||
this.$refs.uToast.show({
|
|
||||||
title: "银行卡卡号不正确",
|
|
||||||
type: "error",
|
|
||||||
});
|
|
||||||
return false;
|
|
||||||
} else if (this.$u.test.chinese(this.form.bankAccountName) === false) {
|
} else if (this.$u.test.chinese(this.form.bankAccountName) === false) {
|
||||||
this.$refs.uToast.show({
|
this.$refs.uToast.show({
|
||||||
title: "银行开户名输入错误",
|
title: "银行开户名输入错误",
|
||||||
@@ -462,7 +462,6 @@ page,
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
}
|
}
|
||||||
.images-view {
|
.images-view {
|
||||||
|
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
@@ -484,12 +483,11 @@ page,
|
|||||||
background-color: #ffffff;
|
background-color: #ffffff;
|
||||||
height: 100rpx;
|
height: 100rpx;
|
||||||
width: 750rpx;
|
width: 750rpx;
|
||||||
|
justify-content: flex-end;
|
||||||
|
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
/deep/ .u-btn{
|
padding-right: 32rpx;
|
||||||
width: 94% !important;
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -57,6 +57,7 @@
|
|||||||
<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 +77,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
|
||||||
|
|||||||
@@ -34,7 +34,7 @@
|
|||||||
<view class="select-title">退货</view>
|
<view class="select-title">退货</view>
|
||||||
<view class="select-sub-title">
|
<view class="select-sub-title">
|
||||||
退回收到的商品
|
退回收到的商品
|
||||||
<uni-icons color="#BABABA" type="arrowright"></uni-icons>
|
<u-icon name="arrow-right" color="#bababa"></u-icon>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -46,7 +46,7 @@
|
|||||||
<view class="select-title">退款</view>
|
<view class="select-title">退款</view>
|
||||||
<view class="select-sub-title">
|
<view class="select-sub-title">
|
||||||
退款商品返还金额
|
退款商品返还金额
|
||||||
<uni-icons color="#BABABA" type="arrowright"></uni-icons>
|
<u-icon name="arrow-right" color="#bababa"></u-icon>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -55,13 +55,9 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import UniIcons from "@/components/uni-icons/uni-icons.vue";
|
|
||||||
|
|
||||||
import { getAfterSaleInfo } from "@/api/after-sale";
|
import { getAfterSaleInfo } from "@/api/after-sale";
|
||||||
|
import storage from "@/utils/storage";
|
||||||
export default {
|
export default {
|
||||||
components: {
|
|
||||||
UniIcons,
|
|
||||||
},
|
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
sn: "",
|
sn: "",
|
||||||
@@ -71,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()
|
||||||
},
|
},
|
||||||
@@ -93,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}`,
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@@ -28,7 +28,7 @@
|
|||||||
logs[0].message
|
logs[0].message
|
||||||
}}</view>
|
}}</view>
|
||||||
</view>
|
</view>
|
||||||
<uni-icons type="arrowright" style="margin-right: 5px"></uni-icons>
|
<u-icon name="arrow-right" style="margin-right: 5px" size="30" color="#999"></u-icon>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="goods-info">
|
<view class="goods-info">
|
||||||
@@ -90,11 +90,14 @@
|
|||||||
serviceDetail.afterSaleImage &&
|
serviceDetail.afterSaleImage &&
|
||||||
serviceDetail.afterSaleImage.split(',').length != 0
|
serviceDetail.afterSaleImage.split(',').length != 0
|
||||||
">
|
">
|
||||||
<image :src="img" @click="preview(serviceDetail.afterSaleImage.split(','), index)" v-for="(img, index) in serviceDetail.afterSaleImage.split(',')" :key="index"
|
<view v-for="(img, index) in serviceDetail.afterSaleImage.split(',')" :key="index">
|
||||||
style="width: 50px; height: 50px; margin: 0px 5px"></image>
|
<u-image width="100" height="100" :src="img" @click="preview(serviceDetail.afterSaleImage.split(','), index)"
|
||||||
|
></u-image>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<!-- 如果服务类型为退款则不显示 -->
|
<!-- 如果服务类型为退款则不显示 -->
|
||||||
<view class="detail-item" v-if="serviceDetail.serviceType != 'RETURN_MONEY' && serviceDetail.serviceStatus != 'APPLY'">
|
<view class="detail-item"
|
||||||
|
v-if="serviceDetail.serviceType != 'RETURN_MONEY' && serviceDetail.serviceStatus != 'APPLY'">
|
||||||
<view class="title">收货地址:</view>
|
<view class="title">收货地址:</view>
|
||||||
<view class="value">
|
<view class="value">
|
||||||
<span v-if="storeAfterSaleAddress.salesConsigneeAddressPath">{{
|
<span v-if="storeAfterSaleAddress.salesConsigneeAddressPath">{{
|
||||||
@@ -103,12 +106,14 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<!-- 如果服务类型为退款则不显示 -->
|
<!-- 如果服务类型为退款则不显示 -->
|
||||||
<view class="detail-item" v-if="serviceDetail.serviceType != 'RETURN_MONEY' && serviceDetail.serviceStatus != 'APPLY'">
|
<view class="detail-item"
|
||||||
|
v-if="serviceDetail.serviceType != 'RETURN_MONEY' && serviceDetail.serviceStatus != 'APPLY'">
|
||||||
<view class="title">联系人:</view>
|
<view class="title">联系人:</view>
|
||||||
<view class="value">{{ storeAfterSaleAddress.salesConsigneeName }}</view>
|
<view class="value">{{ storeAfterSaleAddress.salesConsigneeName }}</view>
|
||||||
</view>
|
</view>
|
||||||
<!-- 如果服务类型为退款则不显示 -->
|
<!-- 如果服务类型为退款则不显示 -->
|
||||||
<view class="detail-item" v-if="serviceDetail.serviceType != 'RETURN_MONEY' && serviceDetail.serviceStatus != 'APPLY'">
|
<view class="detail-item"
|
||||||
|
v-if="serviceDetail.serviceType != 'RETURN_MONEY' && serviceDetail.serviceStatus != 'APPLY'">
|
||||||
<view class="title">联系方式:</view>
|
<view class="title">联系方式:</view>
|
||||||
<view class="value">{{
|
<view class="value">{{
|
||||||
storeAfterSaleAddress.salesConsigneeMobile || "" | secrecyMobile
|
storeAfterSaleAddress.salesConsigneeMobile || "" | secrecyMobile
|
||||||
@@ -193,16 +198,11 @@
|
|||||||
<script>
|
<script>
|
||||||
import {
|
import {
|
||||||
getServiceDetail,
|
getServiceDetail,
|
||||||
getstoreAfterSaleAddress,
|
getStoreAfterSaleAddress,
|
||||||
getAfterSaleLog,
|
getAfterSaleLog,
|
||||||
getAfterSaleReason,
|
getAfterSaleReason,
|
||||||
} from "@/api/after-sale.js";
|
} from "@/api/after-sale.js";
|
||||||
import UniIcons from "@/components/uni-icons/uni-icons.vue";
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
|
||||||
UniIcons,
|
|
||||||
},
|
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
reason: "", //申请原因
|
reason: "", //申请原因
|
||||||
@@ -316,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;
|
||||||
}
|
}
|
||||||
@@ -339,9 +339,7 @@ export default {
|
|||||||
getAfterSaleReason(serviceType).then((res) => {
|
getAfterSaleReason(serviceType).then((res) => {
|
||||||
if (res.data.success) {
|
if (res.data.success) {
|
||||||
// 1357583466371219456
|
// 1357583466371219456
|
||||||
this.reason = res.data.result.filter((item) => {
|
this.reason = this.serviceDetail.reason;
|
||||||
return item.id == this.serviceDetail.reason;
|
|
||||||
})[0].reason;
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@@ -367,12 +365,13 @@ export default {
|
|||||||
(this.serviceDetail.serviceType === "RETURN_GOODS" ||
|
(this.serviceDetail.serviceType === "RETURN_GOODS" ||
|
||||||
this.serviceDetail.serviceType === "ORDER_CANCEL") &&
|
this.serviceDetail.serviceType === "ORDER_CANCEL") &&
|
||||||
this.serviceDetail.refundWay === "OFFLINE";
|
this.serviceDetail.refundWay === "OFFLINE";
|
||||||
|
|
||||||
this.bankShow =
|
this.bankShow =
|
||||||
this.serviceDetail.serviceType === "RETURN_MONEY" ||
|
this.serviceDetail.accountType === "BANK_TRANSFER" &&
|
||||||
((this.serviceDetail.serviceType === "RETURN_GOODS" ||
|
this.serviceDetail.refundWay === "OFFLINE" &&
|
||||||
this.serviceDetail.serviceType === "ORDER_CANCEL") &&
|
((this.serviceDetail.serviceType === "RETURN_GOODS") |
|
||||||
this.serviceDetail.refundWay === "OFFLINE" &&
|
(this.serviceDetail.serviceType === "ORDER_CANCEL") ||
|
||||||
this.serviceDetail.accountType === "BANK_TRANSFER");
|
this.serviceDetail.serviceType === "RETURN_MONEY");
|
||||||
|
|
||||||
this.getReasonList(this.serviceDetail.serviceType);
|
this.getReasonList(this.serviceDetail.serviceType);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -45,7 +45,7 @@
|
|||||||
<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() }" upload-text="" :action="action" width="100" @on-uploaded="onUploaded" :max-count="5">
|
||||||
</u-upload>
|
</u-upload>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|||||||
@@ -2,7 +2,8 @@
|
|||||||
<view>
|
<view>
|
||||||
<view class="wrap">
|
<view class="wrap">
|
||||||
<view class="u-tabs-box">
|
<view class="u-tabs-box">
|
||||||
<u-tabs :list="list" :is-scroll="false" inactive-color="#333" :current="current" class="utabs" :active-color="$lightColor" @change="changeTab"></u-tabs>
|
<u-tabs :list="list" :is-scroll="false" inactive-color="#333" :current="current" class="utabs"
|
||||||
|
:active-color="$lightColor" @change="changeTab"></u-tabs>
|
||||||
</view>
|
</view>
|
||||||
<swiper class="swiper-box" :current="current" @change="changeSwiper" duration="500">
|
<swiper class="swiper-box" :current="current" @change="changeSwiper" duration="500">
|
||||||
<swiper-item v-for="(item, listIndex) in list" :key="listIndex">
|
<swiper-item v-for="(item, listIndex) in list" :key="listIndex">
|
||||||
@@ -18,14 +19,15 @@
|
|||||||
<view v-for="(sku, _index) in order.orderItems" :key="_index">
|
<view v-for="(sku, _index) in order.orderItems" :key="_index">
|
||||||
<view class="goods-item-view">
|
<view class="goods-item-view">
|
||||||
<view>
|
<view>
|
||||||
<u-image border-radius="6rpx" width="132rpx" height="132rpx" class="goods_img" :src="sku.image" alt />
|
<u-image border-radius="6rpx" width="132rpx" height="132rpx" class="goods_img" :src="sku.image"
|
||||||
|
alt />
|
||||||
</view>
|
</view>
|
||||||
<view class="goods-info">
|
<view class="goods-info">
|
||||||
<view class="goods-title u-line-2">{{ sku.name }}</view>
|
<view class="goods-title u-line-2">{{ sku.name }}</view>
|
||||||
<view class="text title">{{ gradeList[order.grade] || '' }}</view>
|
<view class="text title">{{ gradeList[order.grade] || '' }}</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="btn-view u-row-between" v-if="current != 0">
|
<view class="btn-view u-row-between" v-if="current == 2">
|
||||||
<view class="description">
|
<view class="description">
|
||||||
<view class="text title">
|
<view class="text title">
|
||||||
<u-read-more ref="uReadMore" :color="$lightColor" text-indent="0">
|
<u-read-more ref="uReadMore" :color="$lightColor" text-indent="0">
|
||||||
@@ -34,7 +36,8 @@
|
|||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="goods-imgs-view" v-if="order.image">
|
<view class="goods-imgs-view" v-if="order.image">
|
||||||
<view class="img-view" v-if="order.image" v-for="(img, imgIndex) in order.image.split(',')" :key="imgIndex">
|
<view class="img-view" v-if="order.image" v-for="(img, imgIndex) in order.image.split(',')"
|
||||||
|
:key="imgIndex">
|
||||||
<u-image v-if="order.image" @click.native="
|
<u-image v-if="order.image" @click.native="
|
||||||
preview(order.image.split(','), imgIndex)
|
preview(order.image.split(','), imgIndex)
|
||||||
" width="160rpx" height="160rpx" :src="img"></u-image>
|
" width="160rpx" height="160rpx" :src="img"></u-image>
|
||||||
@@ -42,17 +45,21 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="again-btn" @click="onDetail(order)" v-if="current == 1">
|
<view class="again-btn" @click="onDetail(order)" v-if="current == 2">
|
||||||
<u-tag text="评价详情" shape="circle" mode="plain" type="error" />
|
<u-tag text="评价详情" shape="circle" mode="plain" type="error" />
|
||||||
</view>
|
</view>
|
||||||
<view v-if="current == 0 && sku.commentStatus == 'UNFINISHED'">
|
<view v-if="current == 1 && sku.commentStatus == 'UNFINISHED'">
|
||||||
<view class="evaluate">
|
<view class="evaluate">
|
||||||
<view @click="talkCommont(order)">
|
<view @click="talkCommont(sku)">
|
||||||
<u-tag text="发表评价" shape="circle" mode="plain" type="error" />
|
<u-tag text="发表评价" shape="circle" mode="plain" type="error" />
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
<view class="tips" v-if="sku.commentStatus">
|
||||||
|
{{groupCommentStatusWay[sku.commentStatus]}}
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
<uni-load-more :status="params.loadStatus"></uni-load-more>
|
<uni-load-more :status="params.loadStatus"></uni-load-more>
|
||||||
</scroll-view>
|
</scroll-view>
|
||||||
@@ -69,7 +76,12 @@ import { getComments } from "@/api/members.js";
|
|||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
list: [ //顶部tab
|
list: [
|
||||||
|
//顶部tab
|
||||||
|
|
||||||
|
{
|
||||||
|
name: "全部订单",
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name: "待评价",
|
name: "待评价",
|
||||||
},
|
},
|
||||||
@@ -77,12 +89,19 @@ export default {
|
|||||||
name: "已评价",
|
name: "已评价",
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
gradeList: { //评论表
|
gradeList: {
|
||||||
|
//评论表
|
||||||
GOOD: "好评",
|
GOOD: "好评",
|
||||||
MODERATE: "中评",
|
MODERATE: "中评",
|
||||||
WORSE: "差评",
|
WORSE: "差评",
|
||||||
haveImage: "有图",
|
haveImage: "有图",
|
||||||
},
|
},
|
||||||
|
groupCommentStatusWay: {
|
||||||
|
NEW: "新订单,不能进行评论",
|
||||||
|
UNFINISHED: "未完成评论",
|
||||||
|
WAIT_CHASE: "待追评的评论信息",
|
||||||
|
FINISHED: "已经完成评论",
|
||||||
|
},
|
||||||
current: 0, //当前tabIndex
|
current: 0, //当前tabIndex
|
||||||
orderList: [], //商品集合
|
orderList: [], //商品集合
|
||||||
params: {
|
params: {
|
||||||
@@ -108,12 +127,18 @@ export default {
|
|||||||
this.params.loadStatus = "more";
|
this.params.loadStatus = "more";
|
||||||
this.orderList = [];
|
this.orderList = [];
|
||||||
//重新读取数据
|
//重新读取数据
|
||||||
|
|
||||||
if (val == 0) {
|
if (val == 0) {
|
||||||
|
delete this.params.commentStatus
|
||||||
this.loadData();
|
this.loadData();
|
||||||
}
|
} else if (val == 1) {
|
||||||
if (val == 1) {
|
this.params.commentStatus = "UNFINISHED";
|
||||||
this.orderList = [];
|
this.orderList = [];
|
||||||
this.loadComments();
|
this.loadData();
|
||||||
|
} else {
|
||||||
|
this.params.commentStatus = "FINISHED";
|
||||||
|
this.orderList = [];
|
||||||
|
return this.loadComments();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -123,7 +148,7 @@ export default {
|
|||||||
* 判断当前店铺是否有可评价的商品
|
* 判断当前店铺是否有可评价的商品
|
||||||
*/
|
*/
|
||||||
commentStatus(val) {
|
commentStatus(val) {
|
||||||
if (this.current == 1) {
|
if (this.current == 2) {
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
let show;
|
let show;
|
||||||
@@ -192,10 +217,11 @@ export default {
|
|||||||
/**
|
/**
|
||||||
* 发表评价
|
* 发表评价
|
||||||
*/
|
*/
|
||||||
talkCommont(order) {
|
talkCommont(sku) {
|
||||||
|
console.log(sku);
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: `./releaseEvaluate?sn=${order.sn}&order=${encodeURIComponent(
|
url: `./releaseEvaluate?sn=${sku.sn}&sku=${encodeURIComponent(
|
||||||
JSON.stringify(order)
|
JSON.stringify(sku)
|
||||||
)}`,
|
)}`,
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@@ -235,11 +261,7 @@ export default {
|
|||||||
if (this.params.loadStatus == "noMore") return;
|
if (this.params.loadStatus == "noMore") return;
|
||||||
if (index == 0) {
|
if (index == 0) {
|
||||||
this.loadData();
|
this.loadData();
|
||||||
}
|
} else {
|
||||||
if (index == 1) {
|
|
||||||
this.params.audit_status = "PASS_AUDIT";
|
|
||||||
this.params.comments_type = "INITIAL";
|
|
||||||
this.params.comment_status = "WAIT_CHASE";
|
|
||||||
this.loadComments();
|
this.loadComments();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -261,6 +283,11 @@ export default {
|
|||||||
page {
|
page {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
}
|
}
|
||||||
|
.tips {
|
||||||
|
text-align: right;
|
||||||
|
font-size: 24rpx;
|
||||||
|
color: #999;
|
||||||
|
}
|
||||||
.wrap {
|
.wrap {
|
||||||
background: #f6f6f6;
|
background: #f6f6f6;
|
||||||
height: calc(100vh - var(--window-top));
|
height: calc(100vh - var(--window-top));
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<view>
|
<view>
|
||||||
<!-- 遍历出评价商品 -->
|
<!-- 遍历出评价商品 -->
|
||||||
<view v-for="(sku, index) in order.orderItems" :key="index">
|
<view>
|
||||||
<view class="after-sales-goods-detail-view">
|
<view class="after-sales-goods-detail-view">
|
||||||
<view>
|
<view>
|
||||||
<view class="goods-item-view">
|
<view class="goods-item-view">
|
||||||
@@ -23,23 +23,27 @@
|
|||||||
<view class="sub-title">满意请打好评哦</view>
|
<view class="sub-title">满意请打好评哦</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="rate-view">
|
<view class="rate-view">
|
||||||
<view class="rate-btn" @click="onGrade('GOOD', index)">
|
<view class="rate-btn" @click="onGrade('GOOD')">
|
||||||
<view style="font-size: 42rpx" :style="{ color: form.grade === 'GOOD' ? 'red' : '#CCCCCC' }" class="alifont icon-haoping1"></view>
|
<u-icon name="heart-fill" style="font-size: 42rpx"
|
||||||
|
:style="{ color: form.grade === 'GOOD' ? 'red' : '#CCCCCC' }"></u-icon>
|
||||||
<text>好评</text>
|
<text>好评</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="rate-btn" @click="onGrade('MODERATE', index)">
|
<view class="rate-btn" @click="onGrade('MODERATE')">
|
||||||
<view style="font-size: 42rpx" :style="{ color: form.grade === 'MODERATE' ? 'red' : '#CCCCCC' }" class="alifont icon-zhongping1"></view>
|
<u-icon name="heart-fill" style="font-size: 42rpx"
|
||||||
|
:style="{ color: form.grade === 'MODERATE' ? 'red' : '#CCCCCC' }"></u-icon>
|
||||||
<text>中评</text>
|
<text>中评</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="rate-btn" @click="onGrade('WORSE', index)">
|
<view class="rate-btn" @click="onGrade('WORSE')">
|
||||||
<view style="font-size: 42rpx" :style="{ color: form.grade === 'WORSE' ? 'red' : '#CCCCCC' }" class="alifont icon-chaping"></view>
|
<u-icon name="heart-fill" style="font-size: 42rpx"
|
||||||
|
:style="{ color: form.grade === 'WORSE' ? 'red' : '#CCCCCC' }"></u-icon>
|
||||||
<text>差评</text>
|
<text>差评</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="info-evaluate-view">
|
<view class="info-evaluate-view">
|
||||||
<view class="input-view">
|
<view class="input-view">
|
||||||
<u-input v-model="form.content" height="200" placeholder-style="font-size:12px;color:#CCCCCC" :type="type" :border="border" :maxlength="maxlength" :placeholder="placeholder" />
|
<u-input v-model="form.content" height="200" placeholder-style="font-size:12px;color:#CCCCCC" :type="type"
|
||||||
|
:border="border" :maxlength="maxlength" :placeholder="placeholder" />
|
||||||
</view>
|
</view>
|
||||||
<view class="input-num">
|
<view class="input-num">
|
||||||
<text>{{ form.content.length }}/{{ maxlength }}</text>
|
<text>{{ form.content.length }}/{{ maxlength }}</text>
|
||||||
@@ -47,7 +51,8 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="info-evaluate-view">
|
<view class="info-evaluate-view">
|
||||||
<view class="images-view">
|
<view class="images-view">
|
||||||
<u-upload :header=" { accessToken: storage.getAccessToken() }" :action="action" width="150" @on-uploaded="onUploaded" :max-count="5" :show-progress="false"></u-upload>
|
<u-upload :header=" { accessToken: storage.getAccessToken() }" :action="action" width="150"
|
||||||
|
@on-uploaded="onUploaded" :max-count="5" :show-progress="false"></u-upload>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -57,7 +62,8 @@
|
|||||||
<view class="seller-rate-view">
|
<view class="seller-rate-view">
|
||||||
<view class="rate-title">描述相符</view>
|
<view class="rate-title">描述相符</view>
|
||||||
<view>
|
<view>
|
||||||
<u-rate count="count" gutter="20" active-color="#FFC71C" v-model="form.descriptionScore" :size="40"></u-rate>
|
<u-rate count="count" gutter="20" active-color="#FFC71C" v-model="form.descriptionScore" :size="40">
|
||||||
|
</u-rate>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="seller-rate-view">
|
<view class="seller-rate-view">
|
||||||
@@ -94,7 +100,7 @@ export default {
|
|||||||
maxlength: 500, //评价最大字数为500字
|
maxlength: 500, //评价最大字数为500字
|
||||||
placeholder:
|
placeholder:
|
||||||
"宝贝满足您的期待吗?说说它的优点和美中不足的地方吧。您的评价会帮助更多的人",
|
"宝贝满足您的期待吗?说说它的优点和美中不足的地方吧。您的评价会帮助更多的人",
|
||||||
order: {}, //订单信息
|
sku: {}, //订单信息
|
||||||
form: {
|
form: {
|
||||||
content: "", //评价详情
|
content: "", //评价详情
|
||||||
goodsId: "", //商品id
|
goodsId: "", //商品id
|
||||||
@@ -111,10 +117,9 @@ export default {
|
|||||||
onLoad(options) {
|
onLoad(options) {
|
||||||
// 获取上一级传过来的数据进行解析
|
// 获取上一级传过来的数据进行解析
|
||||||
this.form.orderItemSn = options.sn;
|
this.form.orderItemSn = options.sn;
|
||||||
this.order = JSON.parse(decodeURIComponent(options.order));
|
this.sku = JSON.parse(decodeURIComponent(options.sku));
|
||||||
this.form.goodsId = this.order.orderItems[0].goodsId;
|
this.form.goodsId = this.sku.goodsId;
|
||||||
this.form.orderItemSn = this.order.orderItems[0].sn;
|
this.form.skuId = this.sku.skuId;
|
||||||
this.form.skuId = this.order.orderItems[0].skuId;
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
/**
|
/**
|
||||||
@@ -141,7 +146,7 @@ export default {
|
|||||||
success: () => {
|
success: () => {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
uni.navigateBack();
|
uni.navigateBack();
|
||||||
}, 2000);
|
}, 500);
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,9 +10,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>
|
||||||
@@ -38,23 +45,46 @@
|
|||||||
<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 || '/static/missing-face.png'"
|
||||||
|
></u-image>
|
||||||
<view class="btn-one">团长</view>
|
<view class="btn-one">团长</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="line"> </view>
|
<view class="line"> </view>
|
||||||
<view>
|
<view>
|
||||||
<!-- 如果有最后一名,显示最后一名,没有最后一名,显示等待参团 -->
|
<!-- 如果有最后一名,显示最后一名,没有最后一名,显示等待参团 -->
|
||||||
<u-image class="head-img" v-if="endWay.face" :src="endWay.face" borderRadius="50%" shape="square"
|
<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 || '/static/missing-face.png'"
|
||||||
|
></u-image>
|
||||||
|
|
||||||
<view class="wait">{{ endWay.nickname || "等待参团" }}</view>
|
<view class="wait">{{ endWay.nickname || "等待参团" }}</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -62,55 +92,124 @@
|
|||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 店铺商品信息 -->
|
<!-- 店铺商品信息 -->
|
||||||
<div class="box box2" v-for="(item, index) in orderMessage.cartList" :key="index">
|
<div
|
||||||
<div @click="navigateToStore(item)">
|
class="box box2"
|
||||||
<div class="store-name">
|
v-for="(item, index) in orderMessage.cartList"
|
||||||
<span>{{ item.storeName }}</span>
|
:key="index"
|
||||||
</div>
|
>
|
||||||
</div>
|
<div v-if="item.checked">
|
||||||
<div class="promotionNotice">{{ item.promotionNotice || '' }}</div>
|
<div @click="navigateToStore(item)">
|
||||||
<div class="flex goods-item" v-for="(val, i) in item.skuList" :key="i">
|
<div class="store-name">
|
||||||
<div 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
|
||||||
|
:res="receiptList"
|
||||||
|
@callbackInvoice="callbackInvoice"
|
||||||
|
v-if="invoiceFlag"
|
||||||
|
/>
|
||||||
<u-select v-model="shippingFlag" :list="shippingMethod"></u-select>
|
<u-select v-model="shippingFlag" :list="shippingMethod"></u-select>
|
||||||
|
|
||||||
<div class="box box5" v-if="orderMessage.priceDetailDTO">
|
<div class="box box5" v-if="orderMessage.priceDetailDTO">
|
||||||
@@ -118,27 +217,49 @@
|
|||||||
<u-row>
|
<u-row>
|
||||||
<u-col :span="9">商品合计</u-col>
|
<u-col :span="9">商品合计</u-col>
|
||||||
<u-col :span="3" textAlign="right">
|
<u-col :span="3" textAlign="right">
|
||||||
<span>¥{{ orderMessage.priceDetailDTO.goodsPrice | unitPrice }}</span>
|
<span
|
||||||
|
>¥{{ orderMessage.priceDetailDTO.goodsPrice | unitPrice }}</span
|
||||||
|
>
|
||||||
</u-col>
|
</u-col>
|
||||||
</u-row>
|
</u-row>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<u-row>
|
<u-row>
|
||||||
<u-col v-if="orderMessage.cartTypeEnum != 'VIRTUAL'" :span="7">运费</u-col>
|
<u-col v-if="orderMessage.cartTypeEnum != 'VIRTUAL'" :span="7"
|
||||||
<u-col 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>
|
||||||
<u-col :offset="0" :span="9" @click="GET_Discount()">优惠券</u-col>
|
<u-col :offset="0" :span="9" @click="GET_Discount()">优惠券</u-col>
|
||||||
|
|
||||||
<u-col :span="3" v-if="orderMessage.priceDetailDTO && orderMessage.priceDetailDTO.couponPrice" textAlign="right"
|
<u-col
|
||||||
@click="GET_Discount()">
|
:span="3"
|
||||||
<span class="main-color">-¥{{orderMessage.priceDetailDTO.couponPrice | unitPrice}}</span>
|
v-if="
|
||||||
|
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 +270,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
|
||||||
-¥{{ orderMessage.priceDetailDTO.couponPrice | unitPrice }}</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 +286,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 +314,19 @@
|
|||||||
<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,7 +335,6 @@
|
|||||||
<!-- #ifdef MP-WEIXIN -->
|
<!-- #ifdef MP-WEIXIN -->
|
||||||
<div class="tabbar-right">微信支付</div>
|
<div class="tabbar-right">微信支付</div>
|
||||||
<!-- #endif -->
|
<!-- #endif -->
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -279,7 +421,7 @@ export default {
|
|||||||
item.route == "pages/tabbar/cart/cartList" ||
|
item.route == "pages/tabbar/cart/cartList" ||
|
||||||
item.route.indexOf("pages/product/goods") != -1
|
item.route.indexOf("pages/product/goods") != -1
|
||||||
) {
|
) {
|
||||||
uni.redirectTo({
|
uni.navigateTo({
|
||||||
url: item.route,
|
url: item.route,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -313,13 +455,6 @@ export default {
|
|||||||
mounted() {},
|
mounted() {},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
// 格式化金钱 1999 --> [1999,00]
|
|
||||||
formatPrice(val) {
|
|
||||||
if (typeof val == "undefined") {
|
|
||||||
return val;
|
|
||||||
}
|
|
||||||
return val.toFixed(2).split(".");
|
|
||||||
},
|
|
||||||
//发票回调 选择发票之后刷新购物车
|
//发票回调 选择发票之后刷新购物车
|
||||||
async callbackInvoice(val) {
|
async callbackInvoice(val) {
|
||||||
this.invoiceFlag = false;
|
this.invoiceFlag = false;
|
||||||
@@ -378,6 +513,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 +540,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}`
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -455,7 +604,7 @@ export default {
|
|||||||
});
|
});
|
||||||
// 如果当前价格为0跳转到订单列表
|
// 如果当前价格为0跳转到订单列表
|
||||||
if (this.orderMessage.priceDetailDTO.billPrice == 0) {
|
if (this.orderMessage.priceDetailDTO.billPrice == 0) {
|
||||||
uni.redirectTo({
|
uni.navigateTo({
|
||||||
url: "/pages/order/myOrder?status=0",
|
url: "/pages/order/myOrder?status=0",
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
@@ -507,8 +656,22 @@ export default {
|
|||||||
|
|
||||||
// 获取结算参数
|
// 获取结算参数
|
||||||
getOrderList() {
|
getOrderList() {
|
||||||
|
this.notSupportFreight = [];
|
||||||
// 获取结算参数
|
// 获取结算参数
|
||||||
API_Trade.getCheckoutParams(this.routerVal.way).then((res) => {
|
API_Trade.getCheckoutParams(this.routerVal.way).then((res) => {
|
||||||
|
if (
|
||||||
|
!res.data.result.checkedSkuList ||
|
||||||
|
res.data.result.checkedSkuList.length === 0
|
||||||
|
) {
|
||||||
|
uni.switchTab({
|
||||||
|
url: "/pages/tabbar/cart/cartList",
|
||||||
|
});
|
||||||
|
}
|
||||||
|
if (res.data.result.skuList.length <= 0) {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: "/pages/order/myOrder?status=0",
|
||||||
|
});
|
||||||
|
}
|
||||||
res.data.result.cartList.forEach((item, index) => {
|
res.data.result.cartList.forEach((item, index) => {
|
||||||
this.remarkVal[index] = {
|
this.remarkVal[index] = {
|
||||||
remark: item.remark,
|
remark: item.remark,
|
||||||
@@ -575,7 +738,7 @@ page {
|
|||||||
.nums {
|
.nums {
|
||||||
flex: 2;
|
flex: 2;
|
||||||
color: $light-color;
|
color: $light-color;
|
||||||
|
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
.wait {
|
.wait {
|
||||||
@@ -820,6 +983,7 @@ page {
|
|||||||
border-radius: 8rpx;
|
border-radius: 8rpx;
|
||||||
padding: 0rpx 12rpx;
|
padding: 0rpx 12rpx;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
|
margin-right: 20rpx;
|
||||||
}
|
}
|
||||||
.address-box {
|
.address-box {
|
||||||
border-radius: 40rpx;
|
border-radius: 40rpx;
|
||||||
@@ -830,9 +994,7 @@ page {
|
|||||||
margin-bottom: 20rpx;
|
margin-bottom: 20rpx;
|
||||||
color: #666;
|
color: #666;
|
||||||
}
|
}
|
||||||
.address-list {
|
|
||||||
margin-left: 20rpx;
|
|
||||||
}
|
|
||||||
.address-item {
|
.address-item {
|
||||||
font-weight: normal;
|
font-weight: normal;
|
||||||
letter-spacing: 1rpx;
|
letter-spacing: 1rpx;
|
||||||
|
|||||||
@@ -1,15 +1,43 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="content">
|
<view class="content">
|
||||||
<view class="navbar">
|
<view class="navbar">
|
||||||
<view v-for="(item, index) in navList" :key="index" class="nav-item" :class="{ current: tabCurrentIndex === index }" @click="tabClick(index)">{{ item.text }}</view>
|
<view
|
||||||
|
v-for="(item, index) in navList"
|
||||||
|
:key="index"
|
||||||
|
class="nav-item"
|
||||||
|
:class="{ current: tabCurrentIndex === index }"
|
||||||
|
@click="tabClick(index)"
|
||||||
|
>{{ item.text }}</view
|
||||||
|
>
|
||||||
</view>
|
</view>
|
||||||
<swiper :current="tabCurrentIndex" class="swiper-box" duration="300" @change="changeTab">
|
<swiper
|
||||||
<swiper-item class="tab-content" v-for="(tabItem, tabIndex) in navList" :key="tabIndex">
|
:current="tabCurrentIndex"
|
||||||
<scroll-view class="list-scroll-content" scroll-y @scrolltolower="loadData(tabIndex)">
|
class="swiper-box"
|
||||||
|
duration="300"
|
||||||
|
@change="changeTab"
|
||||||
|
>
|
||||||
|
<swiper-item
|
||||||
|
class="tab-content"
|
||||||
|
v-for="(tabItem, tabIndex) in navList"
|
||||||
|
:key="tabIndex"
|
||||||
|
>
|
||||||
|
<scroll-view
|
||||||
|
class="list-scroll-content"
|
||||||
|
scroll-y
|
||||||
|
@scrolltolower="loadData(tabIndex)"
|
||||||
|
>
|
||||||
<!-- 空白页 -->
|
<!-- 空白页 -->
|
||||||
<u-empty text="暂无订单" mode="list" v-if="tabItem.loaded === true && tabItem.orderList.length === 0"></u-empty>
|
<u-empty
|
||||||
|
text="暂无订单"
|
||||||
|
mode="list"
|
||||||
|
v-if="tabItem.loaded === true && tabItem.orderList.length === 0"
|
||||||
|
></u-empty>
|
||||||
<!-- 订单列表 -->
|
<!-- 订单列表 -->
|
||||||
<view class="seller-view" :key="oderIndex" v-for="(order, oderIndex) in tabItem.orderList">
|
<view
|
||||||
|
class="seller-view"
|
||||||
|
:key="oderIndex"
|
||||||
|
v-for="(order, oderIndex) in tabItem.orderList"
|
||||||
|
>
|
||||||
<!-- 店铺名称 -->
|
<!-- 店铺名称 -->
|
||||||
<view class="seller-info u-flex u-row-between">
|
<view class="seller-info u-flex u-row-between">
|
||||||
<view class="seller-name" @click="navigateToStore(order)">
|
<view class="seller-name" @click="navigateToStore(order)">
|
||||||
@@ -21,13 +49,32 @@
|
|||||||
</view>
|
</view>
|
||||||
<view>
|
<view>
|
||||||
<view>
|
<view>
|
||||||
<view class="goods-item-view" @click="navigateToOrderDetail(order.sn)">
|
<view
|
||||||
<view class="goods-img" v-for="(goods, goodsIndex) in order.orderItems" :key="goodsIndex">
|
class="goods-item-view"
|
||||||
<u-image border-radius="6" width="100%" height="100%" :src="goods.image"></u-image>
|
@click="navigateToOrderDetail(order.sn)"
|
||||||
|
>
|
||||||
|
<view
|
||||||
|
class="goods-img"
|
||||||
|
v-for="(goods, goodsIndex) in order.orderItems"
|
||||||
|
:key="goodsIndex"
|
||||||
|
>
|
||||||
|
<u-image
|
||||||
|
border-radius="6"
|
||||||
|
width="100%"
|
||||||
|
height="100%"
|
||||||
|
:src="goods.image"
|
||||||
|
></u-image>
|
||||||
</view>
|
</view>
|
||||||
<view class="goods-info">
|
<view class="goods-info">
|
||||||
<view v-if="order.orderItems.length <= 1" class="goods-title u-line-2">{{ order.groupName }}</view>
|
<view
|
||||||
<view v-if="order.orderItems.length <= 1" class="goods-price">
|
v-if="order.orderItems.length <= 1"
|
||||||
|
class="goods-title u-line-2"
|
||||||
|
>{{ order.groupName }}</view
|
||||||
|
>
|
||||||
|
<view
|
||||||
|
v-if="order.orderItems.length <= 1"
|
||||||
|
class="goods-price"
|
||||||
|
>
|
||||||
¥{{ order.flowPrice | unitPrice }}
|
¥{{ order.flowPrice | unitPrice }}
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -45,19 +92,56 @@
|
|||||||
</view>
|
</view>
|
||||||
<view>
|
<view>
|
||||||
<!-- 全部 -->
|
<!-- 全部 -->
|
||||||
<u-button ripple class="pay-btn" shape="circle" size="mini" v-if="order.allowOperationVO.pay" @click="waitPay(order)">立即付款</u-button>
|
<u-button
|
||||||
|
ripple
|
||||||
|
class="pay-btn"
|
||||||
|
shape="circle"
|
||||||
|
size="mini"
|
||||||
|
v-if="order.allowOperationVO.pay"
|
||||||
|
@click="waitPay(order)"
|
||||||
|
>立即付款</u-button
|
||||||
|
>
|
||||||
<!-- 取消订单 -->
|
<!-- 取消订单 -->
|
||||||
<u-button ripple class="cancel-btn" shape="circle" size="mini" v-if="order.allowOperationVO.cancel" @click="onCancel(order.sn)">
|
<u-button
|
||||||
|
ripple
|
||||||
|
class="cancel-btn"
|
||||||
|
shape="circle"
|
||||||
|
size="mini"
|
||||||
|
v-if="order.allowOperationVO.cancel"
|
||||||
|
@click="onCancel(order.sn)"
|
||||||
|
>
|
||||||
取消订单
|
取消订单
|
||||||
</u-button>
|
</u-button>
|
||||||
<!-- 等待收货 -->
|
<!-- 等待收货 -->
|
||||||
<u-button ripple shape="circle" class="rebuy-btn" size="mini" v-if="order.allowOperationVO.showLogistics" @click="navigateToLogistics(order)">
|
<u-button
|
||||||
|
ripple
|
||||||
|
shape="circle"
|
||||||
|
class="rebuy-btn"
|
||||||
|
size="mini"
|
||||||
|
v-if="order.allowOperationVO.showLogistics"
|
||||||
|
@click="navigateToLogistics(order)"
|
||||||
|
>
|
||||||
查看物流
|
查看物流
|
||||||
</u-button>
|
</u-button>
|
||||||
<u-button ripple :customStyle="{'background':lightColor,'color':'#fff' }" shape="circle" class="pay-btn" size="mini" v-if="order.allowOperationVO.rog" @click="onRog(order.sn)">
|
<u-button
|
||||||
|
ripple
|
||||||
|
:customStyle="{ background: lightColor, color: '#fff' }"
|
||||||
|
shape="circle"
|
||||||
|
class="pay-btn"
|
||||||
|
size="mini"
|
||||||
|
v-if="order.allowOperationVO.rog"
|
||||||
|
@click="onRog(order.sn)"
|
||||||
|
>
|
||||||
确认收货
|
确认收货
|
||||||
</u-button>
|
</u-button>
|
||||||
<u-button ripple shape="circle" class="cancel-btn" size="mini" v-if="order.groupAfterSaleStatus=='NOT_APPLIED'" @click="applyService(order)">
|
<u-button
|
||||||
|
ripple
|
||||||
|
shape="circle"
|
||||||
|
class="cancel-btn"
|
||||||
|
size="mini"
|
||||||
|
v-if="order.groupAfterSaleStatus && order.groupAfterSaleStatus.includes('NOT_APPLIED')"
|
||||||
|
@click="applyService(order)"
|
||||||
|
>
|
||||||
退款/售后
|
退款/售后
|
||||||
</u-button>
|
</u-button>
|
||||||
<!-- TODO 后续完善 -->
|
<!-- TODO 后续完善 -->
|
||||||
@@ -75,26 +159,57 @@
|
|||||||
</scroll-view>
|
</scroll-view>
|
||||||
</swiper-item>
|
</swiper-item>
|
||||||
</swiper>
|
</swiper>
|
||||||
<u-popup class="cancel-popup" v-model="cancelShow" mode="bottom" length="60%">
|
<u-popup
|
||||||
|
class="cancel-popup"
|
||||||
|
v-model="cancelShow"
|
||||||
|
mode="bottom"
|
||||||
|
length="60%"
|
||||||
|
>
|
||||||
<view class="header">取消订单</view>
|
<view class="header">取消订单</view>
|
||||||
<view class="body">
|
<view class="body">
|
||||||
<view class="title">取消订单后,本单享有的优惠可能会一并取消,是否继续?</view>
|
<view class="title"
|
||||||
|
>取消订单后,本单享有的优惠可能会一并取消,是否继续?</view
|
||||||
|
>
|
||||||
<view>
|
<view>
|
||||||
<u-radio-group v-model="reason">
|
<u-radio-group v-model="reason">
|
||||||
<view class="value">
|
<view class="value">
|
||||||
<view class="radio-view" :key="index" v-for="(item, index) in cancelList">
|
<view
|
||||||
<u-radio :active-color="lightColor" label-size="25" shape="circle" :name="item.reason" @change="reasonChange">{{ item.reason }}</u-radio>
|
class="radio-view"
|
||||||
|
:key="index"
|
||||||
|
v-for="(item, index) in cancelList"
|
||||||
|
>
|
||||||
|
<u-radio
|
||||||
|
:active-color="lightColor"
|
||||||
|
label-size="25"
|
||||||
|
shape="circle"
|
||||||
|
:name="item.reason"
|
||||||
|
@change="reasonChange"
|
||||||
|
>{{ item.reason }}</u-radio
|
||||||
|
>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</u-radio-group>
|
</u-radio-group>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="footer">
|
<view class="footer">
|
||||||
<u-button size="medium" ripple v-if="reason" shape="circle" @click="submitCancel">提交</u-button>
|
<u-button
|
||||||
|
size="medium"
|
||||||
|
ripple
|
||||||
|
v-if="reason"
|
||||||
|
shape="circle"
|
||||||
|
@click="submitCancel"
|
||||||
|
>提交</u-button
|
||||||
|
>
|
||||||
</view>
|
</view>
|
||||||
</u-popup>
|
</u-popup>
|
||||||
<u-toast ref="uToast" />
|
<u-toast ref="uToast" />
|
||||||
<u-modal :confirm-color="lightColor" v-model="rogShow" :show-cancel-button="true" :content="'是否确认收货?'" @confirm="confirmRog"></u-modal>
|
<u-modal
|
||||||
|
:confirm-color="lightColor"
|
||||||
|
v-model="rogShow"
|
||||||
|
:show-cancel-button="true"
|
||||||
|
:content="'是否确认收货?'"
|
||||||
|
@confirm="confirmRog"
|
||||||
|
></u-modal>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -196,17 +311,28 @@ export default {
|
|||||||
*/
|
*/
|
||||||
onBackPress(e) {
|
onBackPress(e) {
|
||||||
if (e.from == "backbutton") {
|
if (e.from == "backbutton") {
|
||||||
uni.reLaunch({
|
uni.switchTab({
|
||||||
url: "/pages/tabbar/user/my",
|
url: "/pages/tabbar/user/my",
|
||||||
});
|
});
|
||||||
return true; //阻止默认返回行为
|
return true; //阻止默认返回行为
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onPullDownRefresh() {
|
onPullDownRefresh() {
|
||||||
this.loadData(this.status);
|
if (this.tabCurrentIndex) {
|
||||||
|
this.initData(this.tabCurrentIndex);
|
||||||
|
} else {
|
||||||
|
this.initData(0);
|
||||||
|
}
|
||||||
|
// this.loadData(this.status);
|
||||||
|
},
|
||||||
|
onShow() {
|
||||||
|
if(this.$options.filters.tipsToLogin()){
|
||||||
|
if (!this.tabCurrentIndex) {
|
||||||
|
this.initData(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// this.loadData(this.status);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
onLoad(options) {
|
onLoad(options) {
|
||||||
/**
|
/**
|
||||||
@@ -215,11 +341,11 @@ export default {
|
|||||||
*/
|
*/
|
||||||
let status = Number(options.status);
|
let status = Number(options.status);
|
||||||
this.status = status;
|
this.status = status;
|
||||||
|
|
||||||
this.tabCurrentIndex = status;
|
this.tabCurrentIndex = status;
|
||||||
if (status == 0) {
|
// if (status == 0) {
|
||||||
this.loadData(status);
|
// this.loadData(status);
|
||||||
}
|
// }
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
watch: {
|
watch: {
|
||||||
@@ -236,16 +362,11 @@ export default {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|
||||||
|
|
||||||
// 售后
|
// 售后
|
||||||
applyService(order){
|
applyService(order) {
|
||||||
|
|
||||||
|
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: `/pages/order/afterSales/afterSales?orderSn=${order.sn}`
|
url: `/pages/order/afterSales/afterSales?orderSn=${order.sn}`,
|
||||||
});
|
});
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
// 店铺详情
|
// 店铺详情
|
||||||
@@ -314,6 +435,7 @@ export default {
|
|||||||
*/
|
*/
|
||||||
loadData(index) {
|
loadData(index) {
|
||||||
this.params.pageNumber = this.navList[index].pageNumber;
|
this.params.pageNumber = this.navList[index].pageNumber;
|
||||||
|
// this.params.tag = this.orderStatus[index].orderStatus;
|
||||||
getOrderList(this.params).then((res) => {
|
getOrderList(this.params).then((res) => {
|
||||||
uni.stopPullDownRefresh();
|
uni.stopPullDownRefresh();
|
||||||
if (!res.data.success) {
|
if (!res.data.success) {
|
||||||
|
|||||||
@@ -155,7 +155,7 @@
|
|||||||
<view class="invoice-info-view">
|
<view class="invoice-info-view">
|
||||||
<view class="ltitle">发票信息:</view>
|
<view class="ltitle">发票信息:</view>
|
||||||
<view v-if="!order.needReceipt" class="value">无需发票</view>
|
<view v-if="!order.needReceipt" class="value">无需发票</view>
|
||||||
<view v-else class="value" @click="onReceipt(order.receiptVO)">查看发票</view>
|
<view v-else class="value" @click="onReceipt(orderDetail.receipt)">查看发票</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -324,7 +324,7 @@ 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) {
|
||||||
|
|||||||
@@ -1,250 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div class="form">
|
|
||||||
<u-form :model="codeForm" ref="validateCodeForm">
|
|
||||||
<u-form-item class="cell" label-width="120" label="手机号" prop="mobile">
|
|
||||||
<u-input maxlength="11" v-model="codeForm.mobile" placeholder="请输入您的手机号" />
|
|
||||||
</u-form-item>
|
|
||||||
|
|
||||||
<u-form-item class="cell code" label-width="120" prop="code" label="验证码">
|
|
||||||
<div style="display:flex; width:100%;">
|
|
||||||
<u-input maxlength="6" v-model="codeForm.code" placeholder="请输入验证码" />
|
|
||||||
<u-verification-code keep-running unique-key="page-login" :seconds="seconds" @end="end" @start="start"
|
|
||||||
ref="uCode" @change="codeChange"></u-verification-code>
|
|
||||||
<view @tap="getCode" :style="{color:aiderLightColor}" class="text-tips">{{ tips }}</view>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</u-form-item>
|
|
||||||
|
|
||||||
<view class="submit bg-linear-gradient" @click="submit">登录</view>
|
|
||||||
<view :style="{color:aiderLightColor}" class="text-tips cell" @click="clickLogin">一键登录</view>
|
|
||||||
<myVerification v-if="codeFlag" @send="verification" class="verification" ref="verification" business="LOGIN" />
|
|
||||||
</u-form>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import { sendMobile, smsLogin } from "@/api/login";
|
|
||||||
import { getUserInfo } from "@/api/members";
|
|
||||||
import storage from "@/utils/storage.js"; //缓存
|
|
||||||
import { whetherNavigate } from "@/utils/Foundation"; //登录跳转
|
|
||||||
import myVerification from "@/components/verification/verification.vue"; //验证码模块
|
|
||||||
import uuid from "@/utils/uuid.modified.js"; // uuid
|
|
||||||
export default {
|
|
||||||
components: {
|
|
||||||
myVerification,
|
|
||||||
},
|
|
||||||
props: ["status"], //是否勾选 《用户隐私》和《隐私政策》
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
aiderLightColor: this.$aiderLightColor,
|
|
||||||
uuid,
|
|
||||||
flage: false, //是否验证码验证
|
|
||||||
codeFlag: true, //验证开关,用于是否展示验证码
|
|
||||||
codeForm: {
|
|
||||||
mobile: "", //手机号
|
|
||||||
code: "", //验证码
|
|
||||||
},
|
|
||||||
tips: "", //提示,点击发送验证码和重新发送时赋值
|
|
||||||
clientType: "", // 客户端类型
|
|
||||||
seconds: 60, //默认验证码等待时间
|
|
||||||
// 二维码登录验证规则
|
|
||||||
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生命周期setRules,因为onLoad生命周期组件可能尚未创建完毕
|
|
||||||
mounted() {
|
|
||||||
this.$refs.validateCodeForm.setRules(this.codeRules);
|
|
||||||
/**
|
|
||||||
* 条件编译判断当前客户端类型
|
|
||||||
*/
|
|
||||||
//#ifdef H5
|
|
||||||
this.clientType = "H5";
|
|
||||||
//#endif
|
|
||||||
//#ifdef APP-PLUS
|
|
||||||
|
|
||||||
this.clientType = "APP";
|
|
||||||
//#endif
|
|
||||||
},
|
|
||||||
watch: {
|
|
||||||
async flage(val) {
|
|
||||||
if (val) {
|
|
||||||
if (this.$refs.uCode.canGetCode) {
|
|
||||||
// 向后端请求验证码
|
|
||||||
uni.showLoading({
|
|
||||||
title: "正在获取验证码",
|
|
||||||
});
|
|
||||||
|
|
||||||
let res = await sendMobile(this.codeForm.mobile);
|
|
||||||
|
|
||||||
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;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
this.$u.toast("请倒计时结束后再发送");
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
this.$refs.verification.hide();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
},
|
|
||||||
|
|
||||||
methods: {
|
|
||||||
// 验证码验证
|
|
||||||
verification(val) {
|
|
||||||
this.flage = val == this.$store.state.verificationKey ? true : false;
|
|
||||||
},
|
|
||||||
// 登录
|
|
||||||
submit() {
|
|
||||||
if (!this.status) {
|
|
||||||
/**
|
|
||||||
* 用户必须了解
|
|
||||||
* 用户协议以及隐私政策
|
|
||||||
*/
|
|
||||||
uni.showToast({
|
|
||||||
title: "请您阅读并同意用户协议以及隐私政策",
|
|
||||||
duration: 2000,
|
|
||||||
icon: "none",
|
|
||||||
});
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
let _this = this;
|
|
||||||
this.$refs.validateCodeForm.validate((valid) => {
|
|
||||||
if (valid) {
|
|
||||||
/**
|
|
||||||
* 清空当前账号信息
|
|
||||||
*/
|
|
||||||
storage.setHasLogin(false);
|
|
||||||
storage.setAccessToken("");
|
|
||||||
storage.setRefreshToken("");
|
|
||||||
storage.setUuid(this.uuid.v1());
|
|
||||||
storage.setUserInfo({});
|
|
||||||
/**
|
|
||||||
* 执行登录
|
|
||||||
*/
|
|
||||||
smsLogin(this.codeForm, _this.clientType).then((res) => {
|
|
||||||
if (res.data.success) {
|
|
||||||
storage.setAccessToken(res.data.result.accessToken);
|
|
||||||
storage.setRefreshToken(res.data.result.refreshToken);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 登录成功后获取个人信息
|
|
||||||
*/
|
|
||||||
getUserInfo().then((user) => {
|
|
||||||
if (user.data.success) {
|
|
||||||
/**
|
|
||||||
* 个人信息存储到缓存userInfo中
|
|
||||||
*/
|
|
||||||
storage.setUserInfo(user.data.result);
|
|
||||||
storage.setHasLogin(true);
|
|
||||||
// 登录成功
|
|
||||||
uni.showToast({
|
|
||||||
title: "登录成功!",
|
|
||||||
icon: "none",
|
|
||||||
});
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 计算出当前router路径
|
|
||||||
* 1.如果跳转的链接为登录页面或跳转的链接为空页面。则会重新跳转到首页
|
|
||||||
* 2.都不满足返回跳转页面
|
|
||||||
*/
|
|
||||||
whetherNavigate();
|
|
||||||
} else {
|
|
||||||
uni.switchTab({
|
|
||||||
url: "/pages/tabbar/home/index",
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
// 跳转到一键登录
|
|
||||||
clickLogin() {
|
|
||||||
this.$emit("open", "click");
|
|
||||||
|
|
||||||
},
|
|
||||||
|
|
||||||
/**点击验证码*/
|
|
||||||
codeChange(text) {
|
|
||||||
this.tips = text;
|
|
||||||
},
|
|
||||||
/** 结束验证码后执行 */
|
|
||||||
end() {},
|
|
||||||
/**获取验证码 */
|
|
||||||
getCode() {
|
|
||||||
if (this.tips == "重新获取") {
|
|
||||||
this.codeFlag = true;
|
|
||||||
|
|
||||||
uni.showLoading({
|
|
||||||
title: "加载中",
|
|
||||||
});
|
|
||||||
setTimeout(() => {
|
|
||||||
this.$refs.verification.hide();
|
|
||||||
uni.hideLoading();
|
|
||||||
}, 2000);
|
|
||||||
}
|
|
||||||
|
|
||||||
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 = false;
|
|
||||||
|
|
||||||
this.codeFlag = false;
|
|
||||||
this.$refs.verification.hide();
|
|
||||||
},
|
|
||||||
},
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
@import url("./login.scss");
|
|
||||||
|
|
||||||
// #ifdef MP-WEIXIN
|
|
||||||
@import url("./mp-codeLogin.scss");
|
|
||||||
|
|
||||||
// #endif
|
|
||||||
</style>
|
|
||||||
@@ -1,68 +1,68 @@
|
|||||||
.sub-title {
|
.sub-title {
|
||||||
font-size: 24rpx;
|
font-size: 24rpx;
|
||||||
color: #999;
|
color: #999;
|
||||||
}
|
}
|
||||||
.cell {
|
.cell {
|
||||||
margin: 40rpx 0;
|
margin: 40rpx 0;
|
||||||
}
|
}
|
||||||
.login-ball {
|
.login-ball {
|
||||||
border-bottom-left-radius: 300rpx;
|
border-bottom-left-radius: 300rpx;
|
||||||
height: 400rpx;
|
height: 400rpx;
|
||||||
position: relative;
|
position: relative;
|
||||||
}
|
}
|
||||||
|
|
||||||
/deep/ .u-form-item--right__content__slot {
|
/deep/ .u-form-item--right__content__slot {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
|
|
||||||
.title {
|
.title {
|
||||||
font-size: 48rpx;
|
font-size: 48rpx;
|
||||||
color: #000;
|
color: #000;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
.privacy {
|
.privacy {
|
||||||
font-size: 24upx;
|
font-size: 24upx;
|
||||||
color: #999;
|
color: #999;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
margin-top: 360rpx;
|
margin-top: 360rpx;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
}
|
}
|
||||||
span {
|
span {
|
||||||
color: $aider-light-color;
|
color: $aider-light-color;
|
||||||
}
|
}
|
||||||
.form {
|
.form {
|
||||||
padding: 0 72rpx;
|
padding: 0 72rpx;
|
||||||
}
|
}
|
||||||
.divider {
|
.divider {
|
||||||
margin: 30rpx 0 !important;
|
margin: 30rpx 0 !important;
|
||||||
}
|
}
|
||||||
.submit {
|
.submit {
|
||||||
height: 80rpx;
|
height: 80rpx;
|
||||||
line-height: 80rpx;
|
line-height: 80rpx;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
font-size: 30rpx;
|
font-size: 30rpx;
|
||||||
border-radius: 100px;
|
border-radius: 100px;
|
||||||
}
|
}
|
||||||
.logo {
|
.logo {
|
||||||
margin-top: 20rpx;
|
margin-top: 20rpx;
|
||||||
width: 200rpx;
|
width: 200rpx;
|
||||||
height: 200rpx;
|
height: 200rpx;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
.logo-cell {
|
.logo-cell {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
.text-tips {
|
.text-tips {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
.tips {
|
.tips {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
bottom: 10rpx;
|
bottom: 10rpx;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,142 +1,831 @@
|
|||||||
<template>
|
<template>
|
||||||
<view>
|
<div class="wrapper">
|
||||||
<!-- -->
|
<div v-if="!wechatLogin">
|
||||||
<view v-if="codeLogin">
|
<u-navbar :is-back="showBack" :border-bottom="false"></u-navbar>
|
||||||
<!-- 背景 -->
|
<div>
|
||||||
<view class="login-ball bg-linear-gradient small"></view>
|
<div class="title">{{ loginTitleWay[current].title }}</div>
|
||||||
|
<div :class="current == 1 ? 'desc-light' : 'desc'">
|
||||||
|
{{ loginTitleWay[current].desc
|
||||||
|
}}<span v-if="current == 1">{{ mobile | secrecyMobile }}</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- 手机号 -->
|
||||||
|
<div v-show="!enableUserPwdBox">
|
||||||
|
<div v-show="current == 0">
|
||||||
|
<u-input :custom-style="inputStyle" :placeholder-style="placeholderStyle" placeholder="请输入手机号 (11位)"
|
||||||
|
class="mobile" focus v-model="mobile" type="number" maxlength="11" />
|
||||||
|
<div :class="!enableFetchCode ? 'disable' : 'fetch'" @click="fetchCode" class="btn">
|
||||||
|
获取验证码
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- 输入验证码 -->
|
||||||
|
<div v-show="current == 1" class="box-code">
|
||||||
|
<verifyCode type="bottom" @confirm="submit" boxActiveColor="#D8D8D8" v-model="code" isFocus
|
||||||
|
boxNormalColor="#D8D8D8" cursorColor="#D8D8D8" />
|
||||||
|
|
||||||
<view class="logo-cell">
|
<div class="fetch-btn">
|
||||||
<image class="logo" :src="config.logo" mode="aspectFit"></image>
|
<u-verification-code change-text="验证码已发送(x)" end-text="重新获取验证码" unique-key="page-login"
|
||||||
</view>
|
:seconds="seconds" @end="end" @start="start" ref="uCode" @change="codeChange">
|
||||||
<view class="title">{{config.name}}</view>
|
</u-verification-code>
|
||||||
|
<span @tap="fetchCode" :style="{ color: codeColor }">
|
||||||
|
{{ tips }}</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<!-- 验证码登录 -->
|
<!-- 帐号密码登录 -->
|
||||||
<codeLogin @open="open" :status="value" v-if="login && loginData.code" />
|
<div v-show="enableUserPwdBox">
|
||||||
<!-- 账号密码登录 -->
|
<u-input :custom-style="inputStyle" :placeholder-style="placeholderStyle" placeholder="请输入用户名"
|
||||||
<onClickLogin @open="open" :status="value" v-if="login && loginData.click" />
|
class="mobile" focus v-model="userData.username" />
|
||||||
<view class="form"> </view>
|
<u-input :custom-style="inputStyle" :placeholder-style="placeholderStyle" placeholder="请输入密码"
|
||||||
|
class="mobile" focus v-model="userData.password" type="password" />
|
||||||
|
|
||||||
<!-- 隐私政策 -->
|
<div :class="!enableUserBtnColor ? 'disable' : 'fetch'" @click="passwordLogin" class="btn">
|
||||||
<div class="privacy">
|
帐号密码登录
|
||||||
<u-checkbox-group :icon-size="24" width="45rpx">
|
</div>
|
||||||
<u-checkbox v-model="value" :active-color="lightColor"></u-checkbox>
|
</div>
|
||||||
|
|
||||||
</u-checkbox-group>
|
<div class="flex" v-show="current != 1">
|
||||||
同意<span @click="handleClick('user')">《用户协议》</span>和<span @click="handleClick('privacy')">《隐私政策》</span>
|
<u-checkbox-group :icon-size="24" width="45rpx">
|
||||||
</div>
|
<u-checkbox shape="circle" v-model="enablePrivacy" active-color="#FF5E00"></u-checkbox>
|
||||||
</view>
|
</u-checkbox-group>
|
||||||
<view v-if="wechatLogin">
|
<div class="tips">
|
||||||
<wechatH5Login />
|
未注册的手机号验证后将自动创建用户账号,登录即代表您已同意<span @click="navigateToPrivacy('privacy')">《隐私协议》</span>
|
||||||
</view>
|
<span @click="navigateToPrivacys('user')">
|
||||||
</view>
|
《用户协议》
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div v-if="current != 1" class="user-password-tips" @click="enableUserPwdBox = !enableUserPwdBox">
|
||||||
|
{{ !enableUserPwdBox ? "帐号密码" : "手机号" }}登录
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 循环出当前可使用的第三方登录模式 -->
|
||||||
|
<div class="flex login-list">
|
||||||
|
<div v-if="item.code" :style="{ background: item.color }" class="login-item"
|
||||||
|
v-for="(item, index) in loginList" :key="index">
|
||||||
|
<u-icon v-if="item.title != 'APPLE'" color="#fff" size="42" :name="item.icon"
|
||||||
|
@click="navigateLogin(item)">
|
||||||
|
</u-icon>
|
||||||
|
<u-image v-else src="/static/appleidButton@2x.png" :lazy-load="false" @click="navigateLogin(item)"
|
||||||
|
width="80" height="80" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<myVerification v-if="codeFlag" @send="verification" class="verification" ref="verification"
|
||||||
|
business="LOGIN" />
|
||||||
|
</div>
|
||||||
|
<view v-else>
|
||||||
|
<wechatH5Login />
|
||||||
|
</view>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
|
||||||
import codeLogin from "./codeLogin";
|
|
||||||
import onClickLogin from "./onClickLogin";
|
|
||||||
import { getUserInfo } from "@/api/members";
|
|
||||||
import storage from "@/utils/storage.js";
|
|
||||||
import { loginCallback } from "@/api/connect.js";
|
|
||||||
import { webConnect } from "@/api/connect.js";
|
|
||||||
import config from "@/config/config";
|
|
||||||
import wechatH5Login from "./wechatH5Login.vue";
|
|
||||||
export default {
|
|
||||||
onShow() {
|
|
||||||
//#ifdef H5
|
|
||||||
let isWXBrowser = /micromessenger/i.test(navigator.userAgent);
|
|
||||||
if (isWXBrowser) {
|
|
||||||
webConnect("WECHAT").then((res) => {
|
|
||||||
let data = res.data;
|
|
||||||
if (data.success) {
|
|
||||||
window.location = data.result;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
//#endif
|
|
||||||
},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
config,
|
|
||||||
lightColor: this.$lightColor,
|
|
||||||
wechatLogin: false, //是否加载微信公众号登录
|
|
||||||
codeLogin: false, //是否加载正常验证码登录
|
|
||||||
value: true, //隐私政策
|
|
||||||
loginData: {
|
|
||||||
code: true, //验证码登录
|
|
||||||
click: false,
|
|
||||||
},
|
|
||||||
login: true, //登录
|
|
||||||
};
|
|
||||||
},
|
|
||||||
watch: {},
|
|
||||||
components: {
|
|
||||||
codeLogin,
|
|
||||||
onClickLogin,
|
|
||||||
wechatH5Login,
|
|
||||||
},
|
|
||||||
mounted() {
|
|
||||||
// #ifndef APP-PLUS
|
|
||||||
//判断是否微信浏览器
|
|
||||||
var ua = window.navigator.userAgent.toLowerCase();
|
|
||||||
if (ua.match(/MicroMessenger/i) == "micromessenger") {
|
|
||||||
this.wechatLogin = true;
|
|
||||||
return;
|
|
||||||
|
|
||||||
} else {
|
|
||||||
this.codeLogin = true;
|
|
||||||
}
|
|
||||||
// #endif
|
|
||||||
// #ifdef APP-PLUS
|
|
||||||
this.codeLogin = true;
|
|
||||||
// #endif
|
|
||||||
},
|
|
||||||
|
|
||||||
onLoad(options) {
|
<script>
|
||||||
if (options && options.state) {
|
import {
|
||||||
this.stateLogin(options.state);
|
openIdLogin,
|
||||||
}
|
loginCallback
|
||||||
},
|
} from "@/api/connect.js";
|
||||||
methods: {
|
import api from "@/config/api.js";
|
||||||
handleClick(val) {
|
import {
|
||||||
uni.navigateTo({
|
sendMobile,
|
||||||
url: "/pages/mine/help/tips?type=" + val,
|
smsLogin,
|
||||||
});
|
userLogin
|
||||||
},
|
} from "@/api/login";
|
||||||
// open 开启另一个模板
|
import myVerification from "@/components/verification/verification.vue"; //验证码模块
|
||||||
open(val) {
|
import uuid from "@/utils/uuid.modified.js"; // uuid
|
||||||
Object.keys(this.loginData).forEach((item) => {
|
import verifyCode from "@/components/verify-code/verify-code";
|
||||||
this.$set(this.loginData, item, false);
|
import {
|
||||||
});
|
getUserInfo
|
||||||
this.$set(this.loginData, val, true);
|
} from "@/api/members";
|
||||||
},
|
import {
|
||||||
//联合信息返回登录
|
whetherNavigate
|
||||||
stateLogin(state) {
|
} from "@/utils/Foundation"; //登录跳转
|
||||||
loginCallback(state).then((res) => {
|
import storage from "@/utils/storage.js"; //缓存
|
||||||
let data = res.data;
|
import wechatH5Login from "./wechatH5Login.vue";
|
||||||
if (data.success) {
|
import {
|
||||||
storage.setAccessToken(data.result.accessToken);
|
webConnect
|
||||||
storage.setRefreshToken(data.result.refreshToken);
|
} from "@/api/connect.js";
|
||||||
// 登录成功
|
import {
|
||||||
uni.showToast({
|
md5
|
||||||
title: "登录成功!",
|
} from "@/utils/md5.js";
|
||||||
icon: "none",
|
|
||||||
});
|
export default {
|
||||||
getUserInfo().then((user) => {
|
components: {
|
||||||
storage.setUserInfo(user.data.result);
|
myVerification,
|
||||||
storage.setHasLogin(true);
|
verifyCode,
|
||||||
});
|
wechatH5Login
|
||||||
getCurrentPages().length > 1
|
},
|
||||||
? uni.navigateBack({
|
|
||||||
delta: getCurrentPages().length - 2,
|
data() {
|
||||||
})
|
return {
|
||||||
: uni.switchTab({
|
uuid,
|
||||||
url: "/pages/tabbar/home/index",
|
wechatLogin: false, //是否加载微信公众号登录
|
||||||
});
|
flage: false, //是否验证码验证
|
||||||
}
|
codeFlag: true, //验证开关,用于是否展示验证码
|
||||||
});
|
tips: "",
|
||||||
},
|
enableUserPwdBox: false, //帐号密码登录
|
||||||
},
|
current: 0,
|
||||||
};
|
codeColor: "#999", //按钮验证码颜色
|
||||||
|
lightColor: this.$lightColor,
|
||||||
|
seconds: 60, //默认验证码等待时间
|
||||||
|
loginTitleWay: [{
|
||||||
|
title: "欢迎登录",
|
||||||
|
desc: "登录后更精彩,美好生活即将开始",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "请输入验证码",
|
||||||
|
desc: "已经发送验证码至",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
userData: {
|
||||||
|
username: "",
|
||||||
|
password: "",
|
||||||
|
},
|
||||||
|
showBack: false,
|
||||||
|
enableFetchCode: false,
|
||||||
|
enableUserBtnColor: false,
|
||||||
|
enablePrivacy: false, //隐私政策
|
||||||
|
mobile: "", //手机号
|
||||||
|
code: "", //验证码
|
||||||
|
inputStyle: {
|
||||||
|
height: "104rpx",
|
||||||
|
"border-bottom": "1rpx solid #D8D8D8",
|
||||||
|
"letter-spacing": "1rpx",
|
||||||
|
"font-size": "40rpx",
|
||||||
|
"line-height": "40rpx",
|
||||||
|
color: "#333",
|
||||||
|
},
|
||||||
|
placeholderStyle: "font-size: 32rpx;line-height: 32rpx;color: #999999;",
|
||||||
|
loginList: [
|
||||||
|
//第三方登录集合
|
||||||
|
{
|
||||||
|
icon: "weixin-fill",
|
||||||
|
color: "#00a327",
|
||||||
|
title: "微信",
|
||||||
|
code: "WECHAT",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
icon: "qq-fill",
|
||||||
|
color: "#38ace9",
|
||||||
|
title: "QQ",
|
||||||
|
code: "QQ",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
icon: "apple-fill",
|
||||||
|
color: "#000000",
|
||||||
|
title: "Apple",
|
||||||
|
code: "APPLE",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
};
|
||||||
|
},
|
||||||
|
onShow() {
|
||||||
|
|
||||||
|
// 只要是app登录的全部清除内容
|
||||||
|
// #ifdef APP-PLUS
|
||||||
|
storage.setAccessToken("");
|
||||||
|
storage.setRefreshToken("");
|
||||||
|
storage.setUserInfo({});
|
||||||
|
// #endif
|
||||||
|
|
||||||
|
|
||||||
|
//#ifdef H5
|
||||||
|
let isWXBrowser = /micromessenger/i.test(navigator.userAgent);
|
||||||
|
if (isWXBrowser) {
|
||||||
|
webConnect("WECHAT").then((res) => {
|
||||||
|
let data = res.data;
|
||||||
|
if (data.success) {
|
||||||
|
window.location = data.result;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
//#endif
|
||||||
|
},
|
||||||
|
|
||||||
|
mounted() {
|
||||||
|
// #ifndef APP-PLUS
|
||||||
|
//判断是否微信浏览器
|
||||||
|
var ua = window.navigator.userAgent.toLowerCase();
|
||||||
|
if (ua.match(/MicroMessenger/i) == "micromessenger") {
|
||||||
|
this.wechatLogin = true;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// #endif
|
||||||
|
/**
|
||||||
|
* 条件编译判断当前客户端类型
|
||||||
|
*/
|
||||||
|
//#ifdef H5
|
||||||
|
this.clientType = "H5";
|
||||||
|
//#endif
|
||||||
|
|
||||||
|
//#ifdef APP-PLUS
|
||||||
|
this.clientType = "APP";
|
||||||
|
/**如果是app 加载支持的登录方式*/
|
||||||
|
let _this = this;
|
||||||
|
uni.getProvider({
|
||||||
|
service: "oauth",
|
||||||
|
success: (result) => {
|
||||||
|
_this.loginList = result.provider.map((value) => {
|
||||||
|
//展示title
|
||||||
|
let title = "";
|
||||||
|
//系统code
|
||||||
|
let code = "";
|
||||||
|
//颜色
|
||||||
|
let color = "#8b8b8b";
|
||||||
|
//图标
|
||||||
|
let icon = "";
|
||||||
|
//uni 联合登录 code
|
||||||
|
let appcode = "";
|
||||||
|
switch (value) {
|
||||||
|
case "weixin":
|
||||||
|
icon = "weixin-circle-fill";
|
||||||
|
color = "#00a327";
|
||||||
|
title = "微信";
|
||||||
|
code = "WECHAT";
|
||||||
|
break;
|
||||||
|
case "qq":
|
||||||
|
icon = "qq-circle-fill";
|
||||||
|
color = "#38ace9";
|
||||||
|
title = "QQ";
|
||||||
|
code = "QQ";
|
||||||
|
break;
|
||||||
|
case "apple":
|
||||||
|
icon = "apple-fill";
|
||||||
|
color = "#000000";
|
||||||
|
title = "Apple";
|
||||||
|
code = "APPLE";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
title: title,
|
||||||
|
code: code,
|
||||||
|
color: color,
|
||||||
|
icon: icon,
|
||||||
|
appcode: value,
|
||||||
|
};
|
||||||
|
});
|
||||||
|
},
|
||||||
|
fail: (error) => {
|
||||||
|
uni.showToast({
|
||||||
|
title: "获取登录通道失败" + error,
|
||||||
|
duration: 2000,
|
||||||
|
icon: "none",
|
||||||
|
});
|
||||||
|
},
|
||||||
|
});
|
||||||
|
//#endif
|
||||||
|
|
||||||
|
//特殊平台,登录方式需要过滤
|
||||||
|
// #ifdef H5
|
||||||
|
this.methodFilter(["QQ"]);
|
||||||
|
// #endif
|
||||||
|
|
||||||
|
//微信小程序,只支持微信登录
|
||||||
|
// #ifdef MP-WEIXIN
|
||||||
|
this.methodFilter(["WECHAT"]);
|
||||||
|
// #endif
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
current(val) {
|
||||||
|
val ? (this.showBack = true) : (this.showBack = false);
|
||||||
|
},
|
||||||
|
userData: {
|
||||||
|
handler(val) {
|
||||||
|
if (this.userData.username && this.userData.password) {
|
||||||
|
this.enableUserBtnColor = true;
|
||||||
|
} else {
|
||||||
|
this.enableUserBtnColor = false;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
deep: true,
|
||||||
|
|
||||||
|
},
|
||||||
|
mobile: {
|
||||||
|
handler(val) {
|
||||||
|
if (val.length == 11) {
|
||||||
|
this.enableFetchCode = true;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
async flage(val) {
|
||||||
|
if (val) {
|
||||||
|
if (this.$refs.uCode.canGetCode) {
|
||||||
|
if (this.enableUserPwdBox) {
|
||||||
|
this.submitUserLogin();
|
||||||
|
return;
|
||||||
|
// 执行登录
|
||||||
|
} else {
|
||||||
|
// 向后端请求验证码
|
||||||
|
uni.showLoading({});
|
||||||
|
let res = await sendMobile(this.mobile);
|
||||||
|
uni.hideLoading();
|
||||||
|
// 这里此提示会被this.start()方法中的提示覆盖
|
||||||
|
if (res.data.success) {
|
||||||
|
this.current = 1;
|
||||||
|
this.$refs.uCode.start();
|
||||||
|
} else {
|
||||||
|
uni.showToast({
|
||||||
|
title: res.data.message,
|
||||||
|
duration: 2000,
|
||||||
|
icon: "none",
|
||||||
|
});
|
||||||
|
this.flage = false;
|
||||||
|
this.$refs.verification.getCode();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
!this.enableUserPwdBox ? this.$u.toast("请倒计时结束后再发送") : "";
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.$refs.verification.hide();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
onLoad(options) {
|
||||||
|
if (options && options.state) {
|
||||||
|
this.stateLogin(options.state);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
//联合信息返回登录
|
||||||
|
stateLogin(state) {
|
||||||
|
loginCallback(state).then((res) => {
|
||||||
|
let data = res.data;
|
||||||
|
if (data.success) {
|
||||||
|
storage.setAccessToken(data.result.accessToken);
|
||||||
|
storage.setRefreshToken(data.result.refreshToken);
|
||||||
|
// 登录成功
|
||||||
|
uni.showToast({
|
||||||
|
title: "登录成功!",
|
||||||
|
icon: "none",
|
||||||
|
});
|
||||||
|
getUserInfo().then((user) => {
|
||||||
|
storage.setUserInfo(user.data.result);
|
||||||
|
storage.setHasLogin(true);
|
||||||
|
});
|
||||||
|
getCurrentPages().length > 1 ?
|
||||||
|
uni.navigateBack({
|
||||||
|
delta: getCurrentPages().length - 2,
|
||||||
|
}) :
|
||||||
|
uni.switchTab({
|
||||||
|
url: "/pages/tabbar/home/index",
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
/** 根据参数显示登录模块 */
|
||||||
|
methodFilter(code) {
|
||||||
|
let way = [];
|
||||||
|
this.loginList.forEach((item) => {
|
||||||
|
if (code.length != 0) {
|
||||||
|
code.forEach((val) => {
|
||||||
|
if (item.code == val) {
|
||||||
|
way.push(item);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
uni.showToast({
|
||||||
|
title: "配置有误请联系管理员",
|
||||||
|
duration: 2000,
|
||||||
|
icon: "none",
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
this.loginList = way;
|
||||||
|
},
|
||||||
|
//非h5 获取openid
|
||||||
|
async nonH5OpenId(item) {
|
||||||
|
let _this = this;
|
||||||
|
//获取各个openid
|
||||||
|
await uni.login({
|
||||||
|
provider: item.appcode,
|
||||||
|
// #ifdef MP-ALIPAY
|
||||||
|
scopes: "auth_user", //支付宝小程序需设置授权类型
|
||||||
|
// #endif
|
||||||
|
success: function(res) {
|
||||||
|
uni.setStorageSync("type", item.code);
|
||||||
|
//微信小程序意外的其它方式直接在storage中写入openid
|
||||||
|
// #ifndef MP-WEIXIN
|
||||||
|
uni.setStorageSync("openid", res.authResult.openid);
|
||||||
|
// #endif
|
||||||
|
},
|
||||||
|
fail(e) {
|
||||||
|
uni.showToast({
|
||||||
|
title: "第三方登录暂不可用!",
|
||||||
|
icon: "none",
|
||||||
|
duration: 3000,
|
||||||
|
});
|
||||||
|
},
|
||||||
|
complete(e) {
|
||||||
|
//获取用户信息
|
||||||
|
uni.getUserInfo({
|
||||||
|
provider: item.appcode,
|
||||||
|
success: function(infoRes) {
|
||||||
|
//写入用户信息
|
||||||
|
uni.setStorageSync("nickname", infoRes.userInfo.nickName);
|
||||||
|
uni.setStorageSync("avatar", infoRes.userInfo.avatarUrl);
|
||||||
|
|
||||||
|
// #ifdef MP-WEIXIN
|
||||||
|
//微信小程序获取openid 需要特殊处理 如需获取openid请参考uni-id: https://uniapp.dcloud.net.cn/uniCloud/uni-id
|
||||||
|
_this.weixinMPOpenID(res).then((res) => {
|
||||||
|
//这里需要先行获得openid,再使用openid登录,小程序登录需要两步,所以这里特殊编译
|
||||||
|
_this.goOpenidLogin("WECHAT_MP");
|
||||||
|
});
|
||||||
|
// #endif
|
||||||
|
|
||||||
|
// #ifndef MP-WEIXIN
|
||||||
|
_this.goOpenidLogin("APP");
|
||||||
|
//#endif
|
||||||
|
},
|
||||||
|
});
|
||||||
|
},
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//openid 登录
|
||||||
|
goOpenidLogin(clientType) {
|
||||||
|
// 获取准备好的参数,进行登录系统
|
||||||
|
let params = {
|
||||||
|
uuid: uni.getStorageSync("openid"), //联合登陆id
|
||||||
|
source: uni.getStorageSync("type"), //联合登陆类型
|
||||||
|
nickname: uni.getStorageSync("nickname"), // 昵称
|
||||||
|
avatar: uni.getStorageSync("avatar"), // 头像
|
||||||
|
uniAccessToken: uni.getStorageSync("uni_access_token"), //第三方token
|
||||||
|
};
|
||||||
|
openIdLogin(params, clientType).then((res) => {
|
||||||
|
if (!res.data.success) {
|
||||||
|
let errormessage = "第三方登录暂不可用";
|
||||||
|
uni.showToast({
|
||||||
|
// title: '未绑定第三方账号',
|
||||||
|
title: errormessage,
|
||||||
|
icon: "none",
|
||||||
|
duration: 3000,
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
} else {
|
||||||
|
storage.setAccessToken(res.data.result.accessToken);
|
||||||
|
storage.setRefreshToken(res.data.result.refreshToken);
|
||||||
|
// 登录成功
|
||||||
|
uni.showToast({
|
||||||
|
title: "第三方登录成功!",
|
||||||
|
icon: "none",
|
||||||
|
});
|
||||||
|
// 执行登录
|
||||||
|
getUserInfo().then((user) => {
|
||||||
|
if (user.data.success) {
|
||||||
|
/**
|
||||||
|
* 个人信息存储到缓存userInfo中
|
||||||
|
*/
|
||||||
|
storage.setUserInfo(user.data.result);
|
||||||
|
storage.setHasLogin(true);
|
||||||
|
uni.switchTab({
|
||||||
|
url: "/pages/tabbar/home/index",
|
||||||
|
});
|
||||||
|
/**
|
||||||
|
* 计算出当前router路径
|
||||||
|
* 1.如果跳转的链接为登录页面或跳转的链接为空页面。则会重新跳转到首页
|
||||||
|
* 2.都不满足返回跳转页面
|
||||||
|
*/
|
||||||
|
if (user.data.result.mobile) {
|
||||||
|
whetherNavigate();
|
||||||
|
} else {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: "/pages/passport/bindUserPhone",
|
||||||
|
});
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
uni.switchTab({
|
||||||
|
url: "/pages/tabbar/home/index",
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//微信小程序获取openid
|
||||||
|
async weixinMPOpenID(res) {
|
||||||
|
await miniProgramLogin(res.code).then((res) => {
|
||||||
|
uni.setStorageSync("openid", res.data);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
/**跳转到登录页面 */
|
||||||
|
navigateLogin(connectLogin) {
|
||||||
|
// #ifdef H5
|
||||||
|
let code = connectLogin.code;
|
||||||
|
let buyer = api.buyer;
|
||||||
|
window.open(
|
||||||
|
buyer + `/passport/connect/connect/login/web/` + code,
|
||||||
|
"_self"
|
||||||
|
);
|
||||||
|
// #endif
|
||||||
|
// #ifdef APP-PLUS
|
||||||
|
this.nonH5OpenId(connectLogin);
|
||||||
|
// #endif
|
||||||
|
},
|
||||||
|
|
||||||
|
// 提交
|
||||||
|
submit() {
|
||||||
|
/**
|
||||||
|
* 清空当前账号信息
|
||||||
|
*/
|
||||||
|
storage.setHasLogin(false);
|
||||||
|
storage.setAccessToken("");
|
||||||
|
storage.setRefreshToken("");
|
||||||
|
storage.setUserInfo({});
|
||||||
|
/**
|
||||||
|
* 执行登录
|
||||||
|
*/
|
||||||
|
smsLogin({
|
||||||
|
mobile: this.mobile,
|
||||||
|
code: this.code
|
||||||
|
}, this.clientType).then(
|
||||||
|
(res) => {
|
||||||
|
this.getUserInfoMethods(res);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
},
|
||||||
|
|
||||||
|
// 登录成功之后获取用户信息
|
||||||
|
getUserInfoMethods(res) {
|
||||||
|
console.log(res);
|
||||||
|
if (res.data.success) {
|
||||||
|
storage.setAccessToken(res.data.result.accessToken);
|
||||||
|
storage.setRefreshToken(res.data.result.refreshToken);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 登录成功后获取个人信息
|
||||||
|
*/
|
||||||
|
getUserInfo().then((user) => {
|
||||||
|
if (user.data.success) {
|
||||||
|
/**
|
||||||
|
* 个人信息存储到缓存userInfo中
|
||||||
|
*/
|
||||||
|
storage.setUserInfo(user.data.result);
|
||||||
|
storage.setHasLogin(true);
|
||||||
|
// 登录成功
|
||||||
|
uni.showToast({
|
||||||
|
title: "登录成功!",
|
||||||
|
icon: "none",
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
whetherNavigate();
|
||||||
|
|
||||||
|
} else {
|
||||||
|
uni.switchTab({
|
||||||
|
url: "/pages/tabbar/home/index",
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
// 验证码验证
|
||||||
|
verification(val) {
|
||||||
|
this.flage = val == this.$store.state.verificationKey ? true : false;
|
||||||
|
},
|
||||||
|
// 跳转
|
||||||
|
navigateToPrivacy(val) {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: "/pages/mine/help/tips?type=" + val,
|
||||||
|
});
|
||||||
|
console.log(val)
|
||||||
|
},
|
||||||
|
navigateToPrivacys(val) {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: "/pages/mine/help/tips?type=" + val,
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 点击获取验证码
|
||||||
|
start() {
|
||||||
|
this.codeColor = "#999";
|
||||||
|
this.$u.toast("验证码已发送");
|
||||||
|
this.flage = false;
|
||||||
|
this.codeFlag = false;
|
||||||
|
|
||||||
|
this.$refs.verification.hide();
|
||||||
|
},
|
||||||
|
/**点击验证码*/
|
||||||
|
codeChange(text) {
|
||||||
|
this.tips = text;
|
||||||
|
},
|
||||||
|
/** 结束验证码后执行 */
|
||||||
|
end() {
|
||||||
|
this.codeColor = this.lightColor;
|
||||||
|
this.codeFlag = true;
|
||||||
|
console.log(this.codeColor);
|
||||||
|
},
|
||||||
|
|
||||||
|
passwordLogin() {
|
||||||
|
if (!this.enablePrivacy) {
|
||||||
|
uni.showToast({
|
||||||
|
title: "请同意用户隐私",
|
||||||
|
duration: 2000,
|
||||||
|
icon: "none",
|
||||||
|
});
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!this.userData.username) {
|
||||||
|
uni.showToast({
|
||||||
|
title: "请填写用户名",
|
||||||
|
duration: 2000,
|
||||||
|
icon: "none",
|
||||||
|
});
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!this.userData.password) {
|
||||||
|
uni.showToast({
|
||||||
|
title: "请填写密码",
|
||||||
|
duration: 2000,
|
||||||
|
icon: "none",
|
||||||
|
});
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!this.flage) {
|
||||||
|
this.$refs.verification.error(); //发送
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
// 提交用户登录
|
||||||
|
async submitUserLogin() {
|
||||||
|
const params = JSON.parse(JSON.stringify(this.userData));
|
||||||
|
params.password = md5(params.password);
|
||||||
|
try {
|
||||||
|
let res = await userLogin(params);
|
||||||
|
if (res.data.success) {
|
||||||
|
console.log("zhixing ")
|
||||||
|
this.getUserInfoMethods(res);
|
||||||
|
} else {
|
||||||
|
this.$refs.verification.getCode();
|
||||||
|
this.flage = false;
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
this.$refs.verification.getCode();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
// 发送验证码
|
||||||
|
fetchCode() {
|
||||||
|
if (!this.enablePrivacy) {
|
||||||
|
uni.showToast({
|
||||||
|
title: "请同意用户隐私",
|
||||||
|
duration: 2000,
|
||||||
|
icon: "none",
|
||||||
|
});
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!this.$u.test.mobile(this.mobile)) {
|
||||||
|
uni.showToast({
|
||||||
|
title: "请填写正确手机号",
|
||||||
|
duration: 2000,
|
||||||
|
icon: "none",
|
||||||
|
});
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (this.tips == "重新获取验证码") {
|
||||||
|
uni.showLoading({
|
||||||
|
title: "加载中",
|
||||||
|
});
|
||||||
|
if (!this.codeFlag) {
|
||||||
|
let timer = setInterval(() => {
|
||||||
|
if (this.$refs.verification) {
|
||||||
|
this.$refs.verification.error(); //发送
|
||||||
|
}
|
||||||
|
clearInterval(timer);
|
||||||
|
}, 100);
|
||||||
|
}
|
||||||
|
uni.hideLoading();
|
||||||
|
}
|
||||||
|
if (!this.flage) {
|
||||||
|
this.$refs.verification.error(); //发送
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style>
|
||||||
@import url("./login.scss");
|
page {
|
||||||
|
background: #fff;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.wrapper {
|
||||||
|
padding: 0 80rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.title {
|
||||||
|
padding-top: calc(104rpx);
|
||||||
|
font-style: normal;
|
||||||
|
line-height: 1;
|
||||||
|
font-weight: 500;
|
||||||
|
font-size: 56rpx;
|
||||||
|
color: #333;
|
||||||
|
}
|
||||||
|
|
||||||
|
.box-code {
|
||||||
|
margin-top: 78rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.desc,
|
||||||
|
.desc-light {
|
||||||
|
font-size: 32rpx;
|
||||||
|
line-height: 32rpx;
|
||||||
|
color: #333333;
|
||||||
|
margin-top: 40rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.desc {
|
||||||
|
color: #333;
|
||||||
|
}
|
||||||
|
|
||||||
|
.desc-light {
|
||||||
|
color: #999999;
|
||||||
|
|
||||||
|
>span {
|
||||||
|
color: #333;
|
||||||
|
margin-left: 8rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.mobile {
|
||||||
|
margin-top: 80rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.disable {
|
||||||
|
background: linear-gradient(90deg, #ffdcba 2.21%, #ffcfb2 99.86%);
|
||||||
|
}
|
||||||
|
|
||||||
|
.fetch {
|
||||||
|
background: linear-gradient(57.72deg, #ff8a19 18.14%, #ff5e00 98.44%);
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn {
|
||||||
|
border-radius: 100px;
|
||||||
|
width: 590rpx;
|
||||||
|
margin-top: 97rpx;
|
||||||
|
height: 80rpx;
|
||||||
|
font-size: 30rpx;
|
||||||
|
line-height: 80rpx;
|
||||||
|
text-align: center;
|
||||||
|
color: #ffffff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tips {
|
||||||
|
font-size: 12px;
|
||||||
|
line-height: 20px;
|
||||||
|
margin-top: 32rpx;
|
||||||
|
width: 546rpx;
|
||||||
|
|
||||||
|
>span {
|
||||||
|
color: $light-color;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.fetch-btn {
|
||||||
|
width: 370rpx;
|
||||||
|
height: 80rpx;
|
||||||
|
line-height: 80rpx;
|
||||||
|
text-align: center;
|
||||||
|
background: #f2f2f2;
|
||||||
|
border-radius: 100rpx;
|
||||||
|
font-size: 28rpx;
|
||||||
|
color: #999;
|
||||||
|
|
||||||
|
margin: 71rpx auto 0 auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.login-list {
|
||||||
|
display: flex;
|
||||||
|
width: 590rpx;
|
||||||
|
position: absolute;
|
||||||
|
top: 1200rpx;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.login-item {
|
||||||
|
width: 80rpx;
|
||||||
|
border-radius: 10rpx;
|
||||||
|
height: 80rpx;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
|
||||||
|
margin: 0 20rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.user-password-tips {
|
||||||
|
text-align: center;
|
||||||
|
color: $main-color;
|
||||||
|
margin: 20px 0;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|||||||
@@ -1,8 +0,0 @@
|
|||||||
|
|
||||||
/deep/ .u-form-item {
|
|
||||||
margin: 40rpx 0 !important;
|
|
||||||
padding: 40rpx 0 !important;
|
|
||||||
}
|
|
||||||
.submit {
|
|
||||||
margin-top: 40rpx;
|
|
||||||
}
|
|
||||||
@@ -1,296 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div class="form">
|
|
||||||
<u-form ref="validateCodeForm">
|
|
||||||
<div class="login-list">
|
|
||||||
<!-- 循环出当前可使用的第三方登录模式 -->
|
|
||||||
<div :style="{background:item.color}" class="login-item" v-for="(item,index) in loginList" :key="index">
|
|
||||||
<u-icon v-if="item.title!='APPLE'" color="#fff" size="42" :name="item.icon" @click="navigateLogin(item)"></u-icon>
|
|
||||||
<u-image v-else src="/static/appleidButton@2x.png" :lazy-load="false" @click="navigateLogin(item)" width="80" height="80" />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<view :style="{color:aiderLightColor}" class="text-tips cell" @click="clickCodeLogin">账号密码登录</view>
|
|
||||||
</u-form>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import { openIdLogin } from "@/api/connect.js";
|
|
||||||
import { whetherNavigate } from "@/utils/Foundation"; //登录跳转
|
|
||||||
import { getUserInfo } from "@/api/members";
|
|
||||||
import storage from "@/utils/storage.js";
|
|
||||||
import api from "@/config/api.js";
|
|
||||||
|
|
||||||
export default {
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
aiderLightColor: this.$aiderLightColor,
|
|
||||||
loginList: [
|
|
||||||
{
|
|
||||||
icon: "weixin-fill",
|
|
||||||
color: "#00a327",
|
|
||||||
title: "微信",
|
|
||||||
code: "WECHAT",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
icon: "qq-fill",
|
|
||||||
color: "#38ace9",
|
|
||||||
title: "QQ",
|
|
||||||
code: "QQ",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
icon: "apple-fill",
|
|
||||||
color: "#000000",
|
|
||||||
title: "Apple",
|
|
||||||
code: "APPLE",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
tips: "",
|
|
||||||
};
|
|
||||||
},
|
|
||||||
props: ["status"],
|
|
||||||
mounted() {
|
|
||||||
//#ifdef APP-PLUS
|
|
||||||
/**如果是app 加载支持的登录方式*/
|
|
||||||
let _this = this;
|
|
||||||
uni.getProvider({
|
|
||||||
service: "oauth",
|
|
||||||
success: (result) => {
|
|
||||||
_this.loginList = result.provider.map((value) => {
|
|
||||||
//展示title
|
|
||||||
let title = "";
|
|
||||||
//系统code
|
|
||||||
let code = "";
|
|
||||||
//颜色
|
|
||||||
let color = "#8b8b8b";
|
|
||||||
//图标
|
|
||||||
let icon = "";
|
|
||||||
//uni 联合登录 code
|
|
||||||
let appcode = "";
|
|
||||||
switch (value) {
|
|
||||||
case "weixin":
|
|
||||||
icon = "weixin-circle-fill";
|
|
||||||
color = "#00a327";
|
|
||||||
title = "微信";
|
|
||||||
code = "WECHAT";
|
|
||||||
break;
|
|
||||||
case "qq":
|
|
||||||
icon = "qq-circle-fill";
|
|
||||||
color = "#38ace9";
|
|
||||||
title = "QQ";
|
|
||||||
code = "QQ";
|
|
||||||
break;
|
|
||||||
case "apple":
|
|
||||||
icon = "apple-fill";
|
|
||||||
color = "#000000";
|
|
||||||
title = "Apple";
|
|
||||||
code = "APPLE";
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return {
|
|
||||||
title: title,
|
|
||||||
code: code,
|
|
||||||
color: color,
|
|
||||||
icon: icon,
|
|
||||||
appcode: value,
|
|
||||||
};
|
|
||||||
});
|
|
||||||
},
|
|
||||||
fail: (error) => {
|
|
||||||
uni.showToast({
|
|
||||||
title: "获取登录通道失败" + error,
|
|
||||||
duration: 2000,
|
|
||||||
icon: "none",
|
|
||||||
});
|
|
||||||
},
|
|
||||||
});
|
|
||||||
//#endif
|
|
||||||
|
|
||||||
//特殊平台,登录方式需要过滤
|
|
||||||
// #ifdef H5
|
|
||||||
this.methodFilter(["QQ"]);
|
|
||||||
// #endif
|
|
||||||
|
|
||||||
//微信小程序,只支持微信登录
|
|
||||||
// #ifdef MP-WEIXIN
|
|
||||||
this.methodFilter(["WECHAT"]);
|
|
||||||
// #endif
|
|
||||||
},
|
|
||||||
|
|
||||||
methods: {
|
|
||||||
/** 根据参数显示登录模块 */
|
|
||||||
methodFilter(code) {
|
|
||||||
let way = [];
|
|
||||||
this.loginList.forEach((item) => {
|
|
||||||
if (code.length != 0) {
|
|
||||||
code.forEach((val) => {
|
|
||||||
if (item.code == val) {
|
|
||||||
way.push(item);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
uni.showToast({
|
|
||||||
title: "配置有误请联系管理员",
|
|
||||||
duration: 2000,
|
|
||||||
icon: "none",
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
this.loginList = way;
|
|
||||||
},
|
|
||||||
/**跳转到登录页面 */
|
|
||||||
navigateLogin(connectLogin) {
|
|
||||||
if (!this.status) {
|
|
||||||
uni.showToast({
|
|
||||||
title: "请您阅读并同意用户协议以及隐私政策",
|
|
||||||
duration: 2000,
|
|
||||||
icon: "none",
|
|
||||||
});
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// #ifdef H5
|
|
||||||
let code = connectLogin.code;
|
|
||||||
let buyer = api.buyer;
|
|
||||||
window.open(buyer + `/connect/login/web/` + code, "_self");
|
|
||||||
// #endif
|
|
||||||
// #ifdef APP-PLUS
|
|
||||||
this.nonH5OpenId(connectLogin);
|
|
||||||
// #endif
|
|
||||||
},
|
|
||||||
|
|
||||||
// 跳转到一键登录
|
|
||||||
clickCodeLogin() {
|
|
||||||
this.$emit("open", "code");
|
|
||||||
},
|
|
||||||
|
|
||||||
//非h5 获取openid
|
|
||||||
async nonH5OpenId(item) {
|
|
||||||
let _this = this;
|
|
||||||
//获取各个openid
|
|
||||||
await uni.login({
|
|
||||||
provider: item.appcode,
|
|
||||||
// #ifdef MP-ALIPAY
|
|
||||||
scopes: "auth_user", //支付宝小程序需设置授权类型
|
|
||||||
// #endif
|
|
||||||
success: function (res) {
|
|
||||||
uni.setStorageSync("type", item.code);
|
|
||||||
//微信小程序意外的其它方式直接在storage中写入openid
|
|
||||||
// #ifndef MP-WEIXIN
|
|
||||||
uni.setStorageSync("openid", res.authResult.openid);
|
|
||||||
// #endif
|
|
||||||
},
|
|
||||||
fail(e) {
|
|
||||||
uni.showToast({
|
|
||||||
title: "第三方登录暂不可用!",
|
|
||||||
icon: "none",
|
|
||||||
duration: 3000,
|
|
||||||
});
|
|
||||||
},
|
|
||||||
complete(e) {
|
|
||||||
//获取用户信息
|
|
||||||
uni.getUserInfo({
|
|
||||||
provider: item.appcode,
|
|
||||||
success: function (infoRes) {
|
|
||||||
//写入用户信息
|
|
||||||
uni.setStorageSync("nickname", infoRes.userInfo.nickName);
|
|
||||||
uni.setStorageSync("avatar", infoRes.userInfo.avatarUrl);
|
|
||||||
|
|
||||||
// #ifdef MP-WEIXIN
|
|
||||||
//微信小程序获取openid 需要特殊处理 如需获取openid请参考uni-id: https://uniapp.dcloud.net.cn/uniCloud/uni-id
|
|
||||||
_this.weixinMPOpenID(res).then((res) => {
|
|
||||||
//这里需要先行获得openid,再使用openid登录,小程序登录需要两步,所以这里特殊编译
|
|
||||||
_this.goOpenidLogin("WECHAT_MP");
|
|
||||||
});
|
|
||||||
// #endif
|
|
||||||
|
|
||||||
// #ifndef MP-WEIXIN
|
|
||||||
_this.goOpenidLogin("APP");
|
|
||||||
//#endif
|
|
||||||
},
|
|
||||||
});
|
|
||||||
},
|
|
||||||
});
|
|
||||||
},
|
|
||||||
//openid 登录
|
|
||||||
goOpenidLogin(clientType) {
|
|
||||||
let _this = this;
|
|
||||||
// 获取准备好的参数,进行登录系统
|
|
||||||
let params = {
|
|
||||||
uuid: uni.getStorageSync("openid"), //联合登陆id
|
|
||||||
source: uni.getStorageSync("type"), //联合登陆类型
|
|
||||||
nickname: uni.getStorageSync("nickname"), // 昵称
|
|
||||||
avatar: uni.getStorageSync("avatar"), // 头像
|
|
||||||
uniAccessToken: uni.getStorageSync("uni_access_token"), //第三方token
|
|
||||||
};
|
|
||||||
openIdLogin(params, clientType).then((res) => {
|
|
||||||
if (!res.data.success) {
|
|
||||||
let errormessage = "第三方登录暂不可用";
|
|
||||||
uni.showToast({
|
|
||||||
// title: '未绑定第三方账号',
|
|
||||||
title: errormessage,
|
|
||||||
icon: "none",
|
|
||||||
duration: 3000,
|
|
||||||
});
|
|
||||||
return;
|
|
||||||
} else {
|
|
||||||
storage.setAccessToken(res.data.result.accessToken);
|
|
||||||
storage.setRefreshToken(res.data.result.refreshToken);
|
|
||||||
// 登录成功
|
|
||||||
uni.showToast({
|
|
||||||
title: "第三方登录成功!",
|
|
||||||
icon: "none",
|
|
||||||
});
|
|
||||||
// 执行登录
|
|
||||||
getUserInfo().then((user) => {
|
|
||||||
if (user.data.success) {
|
|
||||||
/**
|
|
||||||
* 个人信息存储到缓存userInfo中
|
|
||||||
*/
|
|
||||||
storage.setUserInfo(user.data.result);
|
|
||||||
storage.setHasLogin(true);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 计算出当前router路径
|
|
||||||
* 1.如果跳转的链接为登录页面或跳转的链接为空页面。则会重新跳转到首页
|
|
||||||
* 2.都不满足返回跳转页面
|
|
||||||
*/
|
|
||||||
whetherNavigate();
|
|
||||||
} else {
|
|
||||||
uni.switchTab({
|
|
||||||
url: "/pages/tabbar/home/index",
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
//微信小程序获取openid
|
|
||||||
async weixinMPOpenID(res) {
|
|
||||||
await miniProgramLogin(res.code).then((res) => {
|
|
||||||
uni.setStorageSync("openid", res.data);
|
|
||||||
});
|
|
||||||
},
|
|
||||||
},
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
@import url("./login.scss");
|
|
||||||
|
|
||||||
.login-list {
|
|
||||||
margin: 140rpx 0;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: space-around;
|
|
||||||
}
|
|
||||||
|
|
||||||
.login-item {
|
|
||||||
width: 80rpx;
|
|
||||||
|
|
||||||
border-radius: 10rpx;
|
|
||||||
height: 80rpx;
|
|
||||||
display: flex;
|
|
||||||
justify-content: center;
|
|
||||||
align-items: center;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
164
pages/passport/scannerCodeLoginConfirm.vue
Normal file
164
pages/passport/scannerCodeLoginConfirm.vue
Normal file
@@ -0,0 +1,164 @@
|
|||||||
|
<template>
|
||||||
|
<view class="container">
|
||||||
|
<u-navbar title="扫码登录授权"></u-navbar>
|
||||||
|
<view class="wx-auth-container">
|
||||||
|
<div class="box">
|
||||||
|
<!-- <div v-if="!errorMsg"> -->
|
||||||
|
<div>
|
||||||
|
<view class="small-tips flex flex-center">
|
||||||
|
<u-image
|
||||||
|
width="400rpx"
|
||||||
|
height="300rpx"
|
||||||
|
src="https://lili-system.oss-cn-beijing.aliyuncs.com/confirm.png"
|
||||||
|
></u-image>
|
||||||
|
<div>电脑端登录确认</div>
|
||||||
|
<div>为确保帐号安全,请确认是您本人操作</div>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="btns">
|
||||||
|
<button @click="confirmLogin()" class="btn-auth">确认登录</button>
|
||||||
|
<div @click="cancelLogin()" class="btn-callback">取消登录</div>
|
||||||
|
</view>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { scannerCodeLogin, scannerCodeLoginConfirm } from "@/api/login";
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
errorMsg: "",
|
||||||
|
token: "",
|
||||||
|
};
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
errorMsg(val) {
|
||||||
|
if (val) {
|
||||||
|
uni.showToast({
|
||||||
|
title: val,
|
||||||
|
icon: "none",
|
||||||
|
});
|
||||||
|
// uni.navigateBack()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
onShow() {
|
||||||
|
this.$options.filters.forceLogin();
|
||||||
|
scannerCodeLogin({ token: this.token }).then((res) => {
|
||||||
|
if (res.data.code == 200) {
|
||||||
|
let code = res.data.result;
|
||||||
|
switch (code) {
|
||||||
|
case 0:
|
||||||
|
case 1:
|
||||||
|
this.errorMsg = "";
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
case 3:
|
||||||
|
this.errorMsg = "请勿重复扫码";
|
||||||
|
break;
|
||||||
|
case 4:
|
||||||
|
this.errorMsg = "二维码已过期,重新扫码";
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
this.errorMsg = "状态异常";
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.errorMsg = res.data.message;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
onLoad(params) {
|
||||||
|
this.token = params.token;
|
||||||
|
if (this.token == undefined || this.token == "") {
|
||||||
|
this.errorMsg = "信息异常";
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
confirmLogin() {
|
||||||
|
this.config(1);
|
||||||
|
},
|
||||||
|
cancelLogin() {
|
||||||
|
this.config(0);
|
||||||
|
},
|
||||||
|
config(code) {
|
||||||
|
scannerCodeLoginConfirm({ token: this.token, code: code }).then((res) => {
|
||||||
|
let title = res.data.success ? "操作成功" : "操作失败";
|
||||||
|
uni.showToast({
|
||||||
|
title: title,
|
||||||
|
duration: 1500,
|
||||||
|
icon: "none",
|
||||||
|
});
|
||||||
|
setTimeout(function () {
|
||||||
|
uni.navigateBack();
|
||||||
|
}, 1000);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
page {
|
||||||
|
background: #fff;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.container {
|
||||||
|
background-color: #fff;
|
||||||
|
width: 100vw;
|
||||||
|
height: 100vh;
|
||||||
|
}
|
||||||
|
.wx-auth-container {
|
||||||
|
width: 100%;
|
||||||
|
background: #fff;
|
||||||
|
margin-top: 20%;
|
||||||
|
}
|
||||||
|
text.title,
|
||||||
|
text.shop {
|
||||||
|
display: inline-block;
|
||||||
|
font-size: 60rpx;
|
||||||
|
color: #333;
|
||||||
|
}
|
||||||
|
|
||||||
|
.box {
|
||||||
|
margin: 0 32rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 文字提示*/
|
||||||
|
.small-tips {
|
||||||
|
width: 100%;
|
||||||
|
|
||||||
|
padding: 20rpx;
|
||||||
|
font-size: 29rpx;
|
||||||
|
margin: 0 0 20rpx;
|
||||||
|
color: #999;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn-auth {
|
||||||
|
width: 92%;
|
||||||
|
background: $main-color;
|
||||||
|
color: #fff;
|
||||||
|
margin: 0 auto 40rpx;
|
||||||
|
border-radius: 100px;
|
||||||
|
}
|
||||||
|
.btn-callback {
|
||||||
|
text-align: center;
|
||||||
|
font-size: 30rpx;
|
||||||
|
background: #ededed;
|
||||||
|
height: 90rpx;
|
||||||
|
line-height: 90rpx;
|
||||||
|
border-radius: 100px;
|
||||||
|
width: 92%;
|
||||||
|
margin: 0 auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btns {
|
||||||
|
margin-top: 100rpx;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
width: 100%;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -43,7 +43,7 @@ export default {
|
|||||||
getUserProfile() {
|
getUserProfile() {
|
||||||
let code = "WECHAT";
|
let code = "WECHAT";
|
||||||
let buyer = api.buyer;
|
let buyer = api.buyer;
|
||||||
window.open(buyer + `/connect/login/web/` + code, "_self");
|
window.open(buyer + `/passport/connect/connect/login/web/` + code, "_self");
|
||||||
},
|
},
|
||||||
backToHome() {
|
backToHome() {
|
||||||
uni.switchTab({
|
uni.switchTab({
|
||||||
@@ -55,11 +55,9 @@ export default {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
|
||||||
|
|
||||||
.wx-auth-container {
|
.wx-auth-container {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
|
||||||
margin-top: 20%;
|
margin-top: 20%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,31 +1,60 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="main-page">
|
<div class="main-page">
|
||||||
|
|
||||||
<!-- #ifdef APP-PLUS -->
|
<!-- #ifdef APP-PLUS -->
|
||||||
<view class="status_bar"></view>
|
<view class="status_bar"></view>
|
||||||
<!-- #endif -->
|
<!-- #endif -->
|
||||||
<!-- 仅h5有效 打开App -->
|
<!-- 仅h5有效 打开App -->
|
||||||
|
|
||||||
<!-- 分享 -->
|
<!-- 分享 -->
|
||||||
<shares v-if="shareFlage && goodsDetail.id" :skuId="this.routerVal.id" :goodsId="this.routerVal.goodsId"
|
<shares
|
||||||
:link="'/pages/product/goods?id='+this.routerVal.id+'&goodsId='+this.routerVal.goodsId"
|
v-if="enableShare && goodsDetail.id"
|
||||||
:thumbnail="goodsDetail.thumbnail" :goodsName="goodsDetail.goodsName" type="goods" @close="shareFlage = false" />
|
:skuId="this.routerVal.id"
|
||||||
<popups v-model="popupsSwitch" @tapPopup="handleNavbarList" :popData="navbarListData" :x="navbarListX"
|
:goodsId="this.routerVal.goodsId"
|
||||||
:y="navbarListY" placement="top-start" />
|
:link="
|
||||||
|
'/pages/product/goods?id=' +
|
||||||
|
this.routerVal.id +
|
||||||
|
'&goodsId=' +
|
||||||
|
this.routerVal.goodsId
|
||||||
|
"
|
||||||
|
:thumbnail="goodsDetail.thumbnail"
|
||||||
|
:goodsName="goodsDetail.goodsName"
|
||||||
|
type="goods"
|
||||||
|
@close="enableShare = false"
|
||||||
|
/>
|
||||||
|
<popups
|
||||||
|
v-model="popupsSwitch"
|
||||||
|
@tapPopup="handleNavbarList"
|
||||||
|
:popData="navbarListData"
|
||||||
|
:x="navbarListX"
|
||||||
|
:y="navbarListY"
|
||||||
|
placement="top-start"
|
||||||
|
/>
|
||||||
<view class="index">
|
<view class="index">
|
||||||
|
|
||||||
<!-- topBar -->
|
<!-- topBar -->
|
||||||
<u-navbar :background="navbar" :is-back="false" :class="headerFlag ? 'header' : 'header bg-none scroll-hide'">
|
<u-navbar
|
||||||
|
:background="navbar"
|
||||||
|
:is-back="false"
|
||||||
|
:class="headerFlag ? 'header' : 'header bg-none scroll-hide'"
|
||||||
|
>
|
||||||
<div class="headerRow">
|
<div class="headerRow">
|
||||||
<div class="backs">
|
<div class="backs">
|
||||||
<u-icon @click="back()" name="arrow-left" class="icon-back"></u-icon>
|
<u-icon @click="back()" name="arrow-left" class="icon-back"></u-icon>
|
||||||
|
|
||||||
<u-icon name="list" @click="popupsSwitch = !popupsSwitch" class="icon-list"></u-icon>
|
<u-icon
|
||||||
|
name="list"
|
||||||
|
@click="popupsSwitch = !popupsSwitch"
|
||||||
|
class="icon-list"
|
||||||
|
></u-icon>
|
||||||
</div>
|
</div>
|
||||||
<div class="headerList" :class="headerFlag ? 'tab-bar' : 'tab-bar scroll-hide'">
|
<div class="headerList" :class="headerFlag ? 'tab-bar' : 'tab-bar scroll-hide'">
|
||||||
<div class="headerRow">
|
<div class="headerRow">
|
||||||
<div class="nav-item" v-for="header in headerList" :key="header.id"
|
<div
|
||||||
:class="{ cur: scrollId === header.id }" @click="headerTab(header.id)">
|
class="nav-item"
|
||||||
|
v-for="header in headerList"
|
||||||
|
:key="header.id"
|
||||||
|
:class="{ cur: scrollId === header.id }"
|
||||||
|
@click="headerTab(header.id)"
|
||||||
|
>
|
||||||
{{ header.text }}
|
{{ header.text }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -33,44 +62,80 @@
|
|||||||
</div>
|
</div>
|
||||||
</u-navbar>
|
</u-navbar>
|
||||||
|
|
||||||
<u-navbar :border-bottom="false" v-show="!headerFlag" class="header-only-back" :background="navbarOnlyBack"
|
<u-navbar
|
||||||
:is-back="false">
|
:border-bottom="false"
|
||||||
|
v-show="!headerFlag"
|
||||||
|
class="header-only-back"
|
||||||
|
:background="navbarOnlyBack"
|
||||||
|
:is-back="false"
|
||||||
|
>
|
||||||
<div>
|
<div>
|
||||||
<div class="bg-back">
|
<div class="bg-back">
|
||||||
<u-icon size="40" @click="back()" name="arrow-left" class="icon-back"></u-icon>
|
<u-icon
|
||||||
<u-icon size="40" @click="popupsSwitch = !popupsSwitch" name="list" class="icon-list"></u-icon>
|
size="40"
|
||||||
|
@click="back()"
|
||||||
|
name="arrow-left"
|
||||||
|
class="icon-back"
|
||||||
|
></u-icon>
|
||||||
|
<u-icon
|
||||||
|
size="40"
|
||||||
|
@click="popupsSwitch = !popupsSwitch"
|
||||||
|
name="list"
|
||||||
|
class="icon-list"
|
||||||
|
></u-icon>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</u-navbar>
|
</u-navbar>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="product-container" :style="{ height: productRefHeight }" ref="productRef" id="productRef">
|
<view
|
||||||
<scroll-view scroll-anchoring enableBackToTop="true" scroll-with-animation scroll-y class="scroll-page"
|
class="product-container"
|
||||||
:scroll-top="tabScrollTop" @scroll="pageScroll">
|
:style="{ height: productRefHeight }"
|
||||||
|
ref="productRef"
|
||||||
|
id="productRef"
|
||||||
|
>
|
||||||
|
<scroll-view
|
||||||
|
scroll-anchoring
|
||||||
|
enableBackToTop="true"
|
||||||
|
scroll-with-animation
|
||||||
|
scroll-y
|
||||||
|
class="scroll-page"
|
||||||
|
:scroll-top="tabScrollTop"
|
||||||
|
@scroll="pageScroll"
|
||||||
|
>
|
||||||
<view>
|
<view>
|
||||||
<!-- 轮播图 -->
|
<!-- 轮播图 -->
|
||||||
<GoodsSwiper id="main1" :res="imgList" />
|
<GoodsSwiper id="main1" :res="imgList" />
|
||||||
|
|
||||||
<!-- 促销活动条 -->
|
<!-- 促销活动条 -->
|
||||||
<PromotionAssembleLayout v-if="PromotionList" :detail="goodsDetail" :res="PromotionList" />
|
<PromotionAssembleLayout
|
||||||
|
v-if="PromotionList"
|
||||||
|
:detail="goodsDetail"
|
||||||
|
:res="PromotionList"
|
||||||
|
/>
|
||||||
|
|
||||||
<view class="card-box top-radius-0" id="main2">
|
<view class="card-box top-radius-0" id="main2">
|
||||||
<!-- 活动不显示价钱 -->
|
<!-- 活动不显示价钱 -->
|
||||||
<view v-if="!isPromotion" class="desc-bold -goods-msg">
|
<view v-if="isSeckill || isGroup" class="desc-bold -goods-msg">
|
||||||
<view class="-goods-flex">
|
<view class="-goods-flex">
|
||||||
<view class="desc-bold">
|
<view class="desc-bold">
|
||||||
{{ goodsDetail.goodsName || "" }}
|
{{ goodsDetail.goodsName || "" }}
|
||||||
</view>
|
</view>
|
||||||
<view class="favorite" @click="clickFavorite(goodsDetail.id)">
|
<view class="favorite" @click="clickFavorite(goodsDetail.id)">
|
||||||
<u-icon size="30" :color="favorite ? '#f2270c' : '#262626'" :name="favorite ? 'heart-fill' : 'heart'">
|
<u-icon
|
||||||
|
size="30"
|
||||||
|
:color="favorite ? '#f2270c' : '#262626'"
|
||||||
|
:name="favorite ? 'heart-fill' : 'heart'"
|
||||||
|
>
|
||||||
</u-icon>
|
</u-icon>
|
||||||
<view :style="{ color: favorite ? '#f2270c' : '#262626' }">{{ favorite ? "已收藏" : "收藏" }}</view>
|
<view :style="{ color: favorite ? '#f2270c' : '#262626' }">{{
|
||||||
|
favorite ? "已收藏" : "收藏"
|
||||||
|
}}</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<!-- 商品描述 -->
|
<!-- 商品描述 -->
|
||||||
<view class="-goods-desc">
|
<view class="-goods-desc">
|
||||||
{{ goodsDetail.sellingPoint || '' }}
|
{{ goodsDetail.sellingPoint || "" }}
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view v-else class="-goods-msg">
|
<view v-else class="-goods-msg">
|
||||||
@@ -79,31 +144,46 @@
|
|||||||
<view class="-goods-flex">
|
<view class="-goods-flex">
|
||||||
<!-- 如果有积分显示积分 -->
|
<!-- 如果有积分显示积分 -->
|
||||||
<view class="-goods-price" v-if="goodsDetail.price != undefined">
|
<view class="-goods-price" v-if="goodsDetail.price != undefined">
|
||||||
<span v-if="pointDetail.points"> <span class="price">{{pointDetail.points}}</span>
|
<span v-if="pointDetail.points">
|
||||||
|
<span class="price">{{ pointDetail.points }}</span>
|
||||||
<span>积分</span>
|
<span>积分</span>
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
<span v-else> <span>¥</span><span class="price">{{ formatPrice(goodsDetail.price)[0] }}</span>.{{
|
<span v-else>
|
||||||
formatPrice(goodsDetail.price)[1]
|
<span v-if="wholesaleList.length">
|
||||||
}} </span>
|
<span>¥</span><span class="price">{{ $options.filters.goodsFormatPrice(wholesaleList[wholesaleList.length-1].price)[0] }}</span>.{{ $options.filters.goodsFormatPrice(wholesaleList[wholesaleList.length-1].price)[1] }}
|
||||||
|
~
|
||||||
|
<span>¥</span><span class="price">{{ $options.filters.goodsFormatPrice(wholesaleList[0].price)[0] }}</span>.{{ $options.filters.goodsFormatPrice(wholesaleList[0].price)[1] }}
|
||||||
|
</span>
|
||||||
|
<span v-else>
|
||||||
|
<span>¥</span><span class="price">{{ $options.filters.goodsFormatPrice(goodsDetail.price)[0] }}</span>.{{ $options.filters.goodsFormatPrice(goodsDetail.price)[1] }}
|
||||||
|
</span>
|
||||||
|
</span>
|
||||||
|
</view>
|
||||||
|
<view class="-goods-price" v-else>
|
||||||
|
¥<span class="price">0 </span>.00
|
||||||
</view>
|
</view>
|
||||||
<view class="-goods-price" v-else> ¥<span class="price">0 </span>.00 </view>
|
|
||||||
|
|
||||||
<view class="icons share" @click="shareChange()">
|
<view class="icons share" @click="shareChange()">
|
||||||
<u-icon size="30" name="share-fill"></u-icon>
|
<u-icon size="30" name="share-fill"></u-icon>
|
||||||
<view>分享</view>
|
<view>分享</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="icons" @click="clickFavorite(goodsDetail.id)">
|
<view class="icons" @click="clickFavorite(goodsDetail.id)">
|
||||||
<u-icon size="30" :color="favorite ? '#f2270c' : '#262626'"
|
<u-icon
|
||||||
:name="favorite ? 'heart-fill' : 'heart'"></u-icon>
|
size="30"
|
||||||
<view :style="{ color: favorite ? '#f2270c' : '#262626' }">{{ favorite ? "已收藏" : "收藏" }}</view>
|
:color="favorite ? '#f2270c' : '#262626'"
|
||||||
|
:name="favorite ? 'heart-fill' : 'heart'"
|
||||||
|
></u-icon>
|
||||||
|
<view :style="{ color: favorite ? '#f2270c' : '#262626' }">{{
|
||||||
|
favorite ? "已收藏" : "收藏"
|
||||||
|
}}</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="-goods-name desc-bold">
|
<view class="-goods-name desc-bold">
|
||||||
{{ goodsDetail.goodsName || "" }}
|
{{ goodsDetail.goodsName || "" }}
|
||||||
</view>
|
</view>
|
||||||
<view class="-goods-desc">
|
<view class="-goods-desc">
|
||||||
{{ goodsDetail.sellingPoint || '' }}
|
{{ goodsDetail.sellingPoint || "" }}
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -123,16 +203,22 @@
|
|||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 拼团用户列表 -->
|
<!-- 拼团用户列表 -->
|
||||||
<PromotionAssembleListLayout v-if="isGroup" @to-assemble-buy-now="toAssembleBuyNow" :res="PromotionList" />
|
<PromotionAssembleListLayout
|
||||||
|
v-if="isGroup"
|
||||||
|
@to-assemble-buy-now="toAssembleBuyNow"
|
||||||
|
:res="PromotionList"
|
||||||
|
/>
|
||||||
|
|
||||||
<!-- 配置地址 如果是虚拟产品的时候不展示 -->
|
<!-- 配置地址 如果是虚拟产品的时候不展示 -->
|
||||||
<view class="card-box" v-if="goodsDetail.goodsType !='VIRTUAL_GOODS'">
|
<view class="card-box" v-if="goodsDetail.goodsType != 'VIRTUAL_GOODS'">
|
||||||
<view class="card-flex" @click="shutMask(4)">
|
<view class="card-flex" @click="shutMask(4)">
|
||||||
<view class="card-title"> 已选 </view>
|
<view class="card-title"> 已选 </view>
|
||||||
<view class="card-content">
|
<view class="card-content">
|
||||||
<span v-if="selectedGoods.spec">{{ selectedGoods.spec.specName }}-{{
|
<span v-if="selectedGoods.spec"
|
||||||
|
>{{ selectedGoods.spec.specName }}-{{
|
||||||
selectedGoods.spec.specValue
|
selectedGoods.spec.specValue
|
||||||
}}</span>
|
}}</span
|
||||||
|
>
|
||||||
<span v-else>默认</span>
|
<span v-else>默认</span>
|
||||||
</view>
|
</view>
|
||||||
<view class="card-bottom">
|
<view class="card-bottom">
|
||||||
@@ -140,7 +226,7 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="card-flex" @click="shutMask(3)">
|
<view class="card-flex" @click="shutMask(3)">
|
||||||
<view class="card-title"> 送至 </view>
|
<view class="card-title"> 送至</view>
|
||||||
<view class="card-content">
|
<view class="card-content">
|
||||||
<span v-if="delivery">{{
|
<span v-if="delivery">{{
|
||||||
delivery.consigneeAddressPath | clearStrComma
|
delivery.consigneeAddressPath | clearStrComma
|
||||||
@@ -157,11 +243,21 @@
|
|||||||
<Evaluation id="main5" :goodsDetail="goodsDetail" />
|
<Evaluation id="main5" :goodsDetail="goodsDetail" />
|
||||||
|
|
||||||
<!-- 店铺推荐 -->
|
<!-- 店铺推荐 -->
|
||||||
<storeLayout id="main7" :storeDetail="storeDetail" :goodsDetail="goodsDetail" :res="recommendList" />
|
<storeLayout
|
||||||
|
id="main7"
|
||||||
|
:storeDetail="storeDetail"
|
||||||
|
:goodsDetail="goodsDetail"
|
||||||
|
:res="recommendList"
|
||||||
|
/>
|
||||||
|
|
||||||
<!-- 宝贝详情 -->
|
<!-- 宝贝详情 -->
|
||||||
<GoodsIntro id="main9" :res="goodsDetail" :goodsParams="goodsParams" :goodsId="goodsDetail.goodsId"
|
<GoodsIntro
|
||||||
v-if="goodsDetail.id" />
|
id="main9"
|
||||||
|
:res="goodsDetail"
|
||||||
|
:goodsParams="goodsParams"
|
||||||
|
:goodsId="goodsDetail.goodsId"
|
||||||
|
v-if="goodsDetail.id"
|
||||||
|
/>
|
||||||
|
|
||||||
<!-- 宝贝推荐 -->
|
<!-- 宝贝推荐 -->
|
||||||
<GoodsRecommend id="main11" :res="likeGoodsList" />
|
<GoodsRecommend id="main11" :res="likeGoodsList" />
|
||||||
@@ -186,8 +282,13 @@
|
|||||||
</view>
|
</view>
|
||||||
<!-- 正常结算页面 -->
|
<!-- 正常结算页面 -->
|
||||||
<view class="detail-btn" v-if="!isGroup">
|
<view class="detail-btn" v-if="!isGroup">
|
||||||
<view class="to-store-car to-store-btn" v-if="goodsDetail.goodsType!='VIRTUAL_GOODS'" @click="shutMask(4)">
|
<view
|
||||||
加入购物车</view>
|
class="to-store-car to-store-btn"
|
||||||
|
v-if="goodsDetail.goodsType != 'VIRTUAL_GOODS'"
|
||||||
|
@click="shutMask(4)"
|
||||||
|
>
|
||||||
|
加入购物车</view
|
||||||
|
>
|
||||||
<view class="to-buy to-store-btn" @click="shutMask(4, 'buy')">立即购买</view>
|
<view class="to-buy to-store-btn" @click="shutMask(4, 'buy')">立即购买</view>
|
||||||
<view class="to-store-car to-store-btn" v-if="startTimer">暂未开始</view>
|
<view class="to-store-car to-store-btn" v-if="startTimer">暂未开始</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -204,33 +305,58 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<!-- 规格-模态层弹窗 -->
|
<!-- 规格-模态层弹窗 -->
|
||||||
<view class="popup spec" @click="shutMask(false)" v-show="maskFlag">
|
<view class="spec">
|
||||||
<!-- 促销弹窗 -->
|
<!-- 促销弹窗 -->
|
||||||
<view class="cuxiao mask" v-show="cuxiao">
|
<u-popup
|
||||||
<view ref="mask_title" class="title mask_title">
|
v-model="promotionShow"
|
||||||
优惠
|
:height="setup.height"
|
||||||
<span @click="shutMask(false)">×</span>
|
:mode="setup.mode"
|
||||||
|
:border-radius="setup.radius"
|
||||||
|
@close="promotionShow = false"
|
||||||
|
:mask-close-able="setup.close"
|
||||||
|
closeable
|
||||||
|
>
|
||||||
|
<view class="header-title">优惠</view>
|
||||||
|
<view class="cuxiao">
|
||||||
|
<scroll-view class="scroll_mask" :scroll-y="true">
|
||||||
|
<view class="con-cuxiao">
|
||||||
|
<view class="cuxiao-title">促销活动</view>
|
||||||
|
<PromotionDetailsLayout :res="PromotionList" />
|
||||||
|
</view>
|
||||||
|
<view class="con-cuxiao coupons">
|
||||||
|
<view class="cuxiao-title">可领优惠券</view>
|
||||||
|
<PromotionCoupon @getCoupon="getCoupon" :res="PromotionList" />
|
||||||
|
</view>
|
||||||
|
</scroll-view>
|
||||||
</view>
|
</view>
|
||||||
<scroll-view class="scroll_mask" :scroll-y="true">
|
</u-popup>
|
||||||
<view class="con-cuxiao">
|
|
||||||
<text>促销活动</text>
|
|
||||||
<PromotionDetailsLayout :res="PromotionList" />
|
|
||||||
</view>
|
|
||||||
<view class="con-cuxiao coupons">
|
|
||||||
<text>可领优惠券</text>
|
|
||||||
<PromotionCoupon @getCoupon="getCoupon" :res="PromotionList" />
|
|
||||||
</view>
|
|
||||||
</scroll-view>
|
|
||||||
</view>
|
|
||||||
|
|
||||||
<!-- 配送地址弹窗 -->
|
<!-- 配送地址弹窗 -->
|
||||||
<popupAddress @closeAddress="closePopupAddress" @deliveryData="deliveryFun" v-if="goodsDetail.id"
|
<popupAddress
|
||||||
:goodsId="goodsDetail.id" :addressFlag="addressFlag" />
|
@closeAddress="closePopupAddress"
|
||||||
|
@deliveryData="deliveryFun"
|
||||||
|
v-if="goodsDetail.id"
|
||||||
|
:goodsId="goodsDetail.id"
|
||||||
|
:addressFlag="addressFlag"
|
||||||
|
/>
|
||||||
|
|
||||||
<!-- 商品规格 商品详情,以及默认参与活动的id-->
|
<!-- 商品规格 商品详情,以及默认参与活动的id-->
|
||||||
<popupGoods :addr="delivery" ref="popupGoods" @changed="changedGoods" @closeBuy="closePopupBuy"
|
<popupGoods
|
||||||
@queryCart="cartCount()" :goodsDetail="goodsDetail" :goodsSpec="goodsSpec" :id="productId"
|
:addr="delivery"
|
||||||
v-if="goodsDetail.id " :pointDetail="pointDetail" @handleClickSku="selectSku" :buyMask="buyMask" />
|
ref="popupGoods"
|
||||||
|
@changed="changedGoods"
|
||||||
|
@closeBuy="closePopupBuy"
|
||||||
|
@queryCart="cartCount()"
|
||||||
|
:goodsDetail="goodsDetail"
|
||||||
|
:goodsSpec="goodsSpec"
|
||||||
|
:isGroup="isGroup"
|
||||||
|
:id="productId"
|
||||||
|
v-if="goodsDetail.id"
|
||||||
|
:pointDetail="pointDetail"
|
||||||
|
:wholesaleList="wholesaleList"
|
||||||
|
@handleClickSku="selectSku"
|
||||||
|
:buyMask="buyMask"
|
||||||
|
/>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</div>
|
</div>
|
||||||
@@ -238,15 +364,11 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
/************接口API***************/
|
/************接口API***************/
|
||||||
import {
|
import { getGoods, getGoodsList, getMpScene, getGoodsDistribution } from "@/api/goods.js";
|
||||||
getGoods,
|
|
||||||
getGoodsList,
|
|
||||||
getMpScene,
|
|
||||||
getGoodsDistribution,
|
|
||||||
} from "@/api/goods.js";
|
|
||||||
import * as API_trade from "@/api/trade.js";
|
import * as API_trade from "@/api/trade.js";
|
||||||
import * as API_Members from "@/api/members.js";
|
import * as API_Members from "@/api/members.js";
|
||||||
import * as API_store from "@/api/store.js";
|
import * as API_store from "@/api/store.js";
|
||||||
|
import { getIMDetail } from "@/api/common";
|
||||||
import { modelNavigateTo } from "@/pages/tabbar/home/template/tpl.js";
|
import { modelNavigateTo } from "@/pages/tabbar/home/template/tpl.js";
|
||||||
/************请求存储***************/
|
/************请求存储***************/
|
||||||
import storage from "@/utils/storage.js";
|
import storage from "@/utils/storage.js";
|
||||||
@@ -262,10 +384,11 @@ import GoodsRecommend from "./product/goods/-goods-recommend"; //宝贝推荐
|
|||||||
import storeLayout from "./product/shop/-shop"; //店铺组件
|
import storeLayout from "./product/shop/-shop"; //店铺组件
|
||||||
import Evaluation from "./product/evaluation/-evaluation"; //评价组件
|
import Evaluation from "./product/evaluation/-evaluation"; //评价组件
|
||||||
import GoodsSwiper from "./product/goods/-goods-swiper"; //轮播图组件
|
import GoodsSwiper from "./product/goods/-goods-swiper"; //轮播图组件
|
||||||
import popupGoods from "./product/popup/goods"; //购物车商品的模块
|
import popupGoods from "@/components/m-buy/goods"; //购物车商品的模块
|
||||||
import popupAddress from "./product/popup/address"; //地址选择模块
|
import popupAddress from "./product/popup/address"; //地址选择模块
|
||||||
import shares from "@/components/m-share/index"; //分享
|
import shares from "@/components/m-share/index"; //分享
|
||||||
import popups from "@/components/popups/popups"; //气泡框
|
import popups from "@/components/popups/popups"; //气泡框
|
||||||
|
import setup from "./product/popup/popup";
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
popups,
|
popups,
|
||||||
@@ -285,6 +408,8 @@ export default {
|
|||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
setup,
|
||||||
|
promotionShow: false, //弹窗开关
|
||||||
// #ifdef H5
|
// #ifdef H5
|
||||||
navbarListX: 110, //导航栏列表栏x轴
|
navbarListX: 110, //导航栏列表栏x轴
|
||||||
navbarListY: 80, //导航栏列表栏y轴
|
navbarListY: 80, //导航栏列表栏y轴
|
||||||
@@ -321,10 +446,10 @@ export default {
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
popupsSwitch: false, //导航栏列表栏开关
|
popupsSwitch: false, //导航栏列表栏开关
|
||||||
shareFlage: false,
|
enableShare: false,
|
||||||
selectedGoods: "", //选择的商品规格昵称
|
selectedGoods: "", //选择的商品规格昵称
|
||||||
isPromotion: true, //判断显示拼团活动文字
|
|
||||||
isGroup: false, // 是否是拼团活动
|
isGroup: false, // 是否是拼团活动
|
||||||
|
isSeckill:false, // 是否秒杀活动
|
||||||
pointDetail: "", // 是否是积分商品
|
pointDetail: "", // 是否是积分商品
|
||||||
assemble: "", //拼团的sku
|
assemble: "", //拼团的sku
|
||||||
navbarOnlyBack: {
|
navbarOnlyBack: {
|
||||||
@@ -360,7 +485,6 @@ export default {
|
|||||||
id: "4",
|
id: "4",
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
oldtabScrollTop: 0,
|
|
||||||
tabScrollTop: null,
|
tabScrollTop: null,
|
||||||
scrollArr: [],
|
scrollArr: [],
|
||||||
scrollId: "1",
|
scrollId: "1",
|
||||||
@@ -373,8 +497,7 @@ export default {
|
|||||||
imgList: [], //轮播图数据
|
imgList: [], //轮播图数据
|
||||||
favorite: false, //收藏与否flag
|
favorite: false, //收藏与否flag
|
||||||
recommendList: [], //推荐列表
|
recommendList: [], //推荐列表
|
||||||
maskFlag: false, //模态显示与否
|
// maskFlag: false, //模态显示与否
|
||||||
cuxiao: false, //促销弹窗
|
|
||||||
goodsInfo: false, //商品介绍弹窗
|
goodsInfo: false, //商品介绍弹窗
|
||||||
addressFlag: false, //配送地址弹窗
|
addressFlag: false, //配送地址弹窗
|
||||||
buyMask: false, //添加购物车直接购买,查看已选 弹窗
|
buyMask: false, //添加购物车直接购买,查看已选 弹窗
|
||||||
@@ -404,19 +527,18 @@ export default {
|
|||||||
startTimer: false, //未开启 是false
|
startTimer: false, //未开启 是false
|
||||||
|
|
||||||
routerVal: "",
|
routerVal: "",
|
||||||
|
IMLink: "", // IM地址
|
||||||
|
wholesaleList:[]
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
// #ifdef MP-WEIXNI
|
|
||||||
shareAppMessage() {
|
computed: {
|
||||||
return {
|
// udesk IM
|
||||||
title: this.goodsDetail.goodsName,
|
IM() {
|
||||||
type: 0,
|
return this.IMLink + this.storeDetail.merchantEuid;
|
||||||
query: `id=${this.routerVal.id}&goodsId=${this.routerVal.goodsId}`,
|
},
|
||||||
path: `/pages/product/goods`,
|
|
||||||
imageUrl: this.goodsDetail.goodsGalleryList[0],
|
|
||||||
};
|
|
||||||
},
|
},
|
||||||
// #endif
|
|
||||||
watch: {
|
watch: {
|
||||||
isGroup(val) {
|
isGroup(val) {
|
||||||
if (val) {
|
if (val) {
|
||||||
@@ -424,10 +546,7 @@ export default {
|
|||||||
this.$refs.popupGoods.buyType = "PINTUAN";
|
this.$refs.popupGoods.buyType = "PINTUAN";
|
||||||
clearInterval(timer);
|
clearInterval(timer);
|
||||||
}, 100);
|
}, 100);
|
||||||
|
|
||||||
this.isPromotion = false;
|
|
||||||
} else {
|
} else {
|
||||||
this.isPromotion = true;
|
|
||||||
this.$refs.popupGoods.buyType = "";
|
this.$refs.popupGoods.buyType = "";
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -483,14 +602,14 @@ export default {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
this.init(
|
this.init(this.routerVal.id, this.routerVal.goodsId, this.routerVal.distributionId);
|
||||||
this.routerVal.id,
|
|
||||||
this.routerVal.goodsId,
|
|
||||||
this.routerVal.distributionId
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
|
share() {
|
||||||
|
return `/pages/product/goods?id=${this.routerVal.id}&goodsId=${this.routerVal.goodsId}`;
|
||||||
|
},
|
||||||
/**
|
/**
|
||||||
* 导航栏列表栏
|
* 导航栏列表栏
|
||||||
*/
|
*/
|
||||||
@@ -516,16 +635,17 @@ export default {
|
|||||||
/**
|
/**
|
||||||
* 初始化信息
|
* 初始化信息
|
||||||
*/
|
*/
|
||||||
async init(id, goodsId, distributionId) {
|
async init(id, goodsId, distributionId = "") {
|
||||||
this.isGroup = false; //初始化拼团
|
this.isGroup = false; //初始化拼团
|
||||||
this.productId = id; // skuId
|
this.productId = id; // skuId
|
||||||
// 这里请求获取到页面数据 解析数据
|
// 这里请求获取到页面数据 解析数据
|
||||||
|
|
||||||
let response = await getGoods(id, goodsId);
|
let response = await getGoods(id, goodsId);
|
||||||
|
|
||||||
if (!response.data.success) {
|
if (!response.data.success) {
|
||||||
setTimeout(()=>{
|
setTimeout(() => {
|
||||||
uni.navigateBack();
|
uni.navigateBack();
|
||||||
},500)
|
}, 500);
|
||||||
}
|
}
|
||||||
// 这里是绑定分销员
|
// 这里是绑定分销员
|
||||||
if (distributionId || this.$store.state.distributionId) {
|
if (distributionId || this.$store.state.distributionId) {
|
||||||
@@ -536,6 +656,7 @@ export default {
|
|||||||
}
|
}
|
||||||
/**商品信息以及规格信息存储 */
|
/**商品信息以及规格信息存储 */
|
||||||
this.goodsDetail = response.data.result.data;
|
this.goodsDetail = response.data.result.data;
|
||||||
|
this.wholesaleList = response.data.result.wholesaleList;
|
||||||
this.goodsSpec = response.data.result.specs;
|
this.goodsSpec = response.data.result.specs;
|
||||||
this.PromotionList = response.data.result.promotionMap;
|
this.PromotionList = response.data.result.promotionMap;
|
||||||
this.goodsParams = response.data.result.goodsParamsDTOList || [];
|
this.goodsParams = response.data.result.goodsParamsDTOList || [];
|
||||||
@@ -551,6 +672,10 @@ export default {
|
|||||||
if (item.indexOf("POINTS_GOODS") == 0) {
|
if (item.indexOf("POINTS_GOODS") == 0) {
|
||||||
this.pointDetail = this.PromotionList[item];
|
this.pointDetail = this.PromotionList[item];
|
||||||
}
|
}
|
||||||
|
// 秒杀
|
||||||
|
if (item.indexOf("SECKILL") == 0) {
|
||||||
|
this.isSeckill = true
|
||||||
|
}
|
||||||
});
|
});
|
||||||
// 轮播图
|
// 轮播图
|
||||||
this.imgList = this.goodsDetail.goodsGalleryList;
|
this.imgList = this.goodsDetail.goodsGalleryList;
|
||||||
@@ -562,7 +687,7 @@ export default {
|
|||||||
this.cartCount();
|
this.cartCount();
|
||||||
|
|
||||||
// 获取店铺推荐商品
|
// 获取店铺推荐商品
|
||||||
this.getstoreRecommend();
|
this.getStoreRecommend();
|
||||||
|
|
||||||
// 获取商品列表
|
// 获取商品列表
|
||||||
this.getOtherLikeGoods();
|
this.getOtherLikeGoods();
|
||||||
@@ -571,46 +696,62 @@ export default {
|
|||||||
if (this.$options.filters.isLogin("auth")) {
|
if (this.$options.filters.isLogin("auth")) {
|
||||||
this.getGoodsCollectionFun(this.goodsDetail.id);
|
this.getGoodsCollectionFun(this.goodsDetail.id);
|
||||||
}
|
}
|
||||||
|
// 获取IM 需要的话使用
|
||||||
|
// this.getIMDetailMethods();
|
||||||
},
|
},
|
||||||
linkMsgDetail() {
|
|
||||||
// 客服
|
|
||||||
// #ifdef MP-WEIXIN
|
|
||||||
|
|
||||||
const params = {
|
async getIMDetailMethods() {
|
||||||
storeName: this.storeDetail.storeName,
|
let res = await getIMDetail();
|
||||||
goodsName: this.goodsDetail.goodsName,
|
if (res.data.success) {
|
||||||
goodsId: this.goodsDetail.goodsId,
|
this.IMLink = res.data.result;
|
||||||
goodsImg: this.goodsDetail.thumbnail,
|
|
||||||
price: this.goodsDetail.promotionPrice || this.goodsDetail.price,
|
|
||||||
// originalPrice: this.goodsDetail.original || this.goodsDetail.price,
|
|
||||||
uuid: storage.getUuid(),
|
|
||||||
token: storage.getAccessToken(),
|
|
||||||
sign: this.storeDetail.yzfSign,
|
|
||||||
mpSign: this.storeDetail.yzfMpSign,
|
|
||||||
};
|
|
||||||
uni.navigateTo({
|
|
||||||
url:
|
|
||||||
"/pages/product/customerservice/index?params=" +
|
|
||||||
encodeURIComponent(JSON.stringify(params)),
|
|
||||||
});
|
|
||||||
// #endif
|
|
||||||
// #ifndef MP-WEIXIN
|
|
||||||
const sign = this.storeDetail.yzfSign;
|
|
||||||
uni.navigateTo({
|
|
||||||
url:
|
|
||||||
"/pages/tabbar/home/web-view?src=https://yzf.qq.com/xv/web/static/chat/index.html?sign=" +
|
|
||||||
sign,
|
|
||||||
});
|
|
||||||
// #endif
|
|
||||||
},
|
|
||||||
// 格式化金钱 1999 --> [1999,00]
|
|
||||||
formatPrice(val) {
|
|
||||||
if (typeof val == "undefined") {
|
|
||||||
return val;
|
|
||||||
}
|
}
|
||||||
return val.toFixed(2).split(".");
|
|
||||||
},
|
},
|
||||||
|
|
||||||
|
linkMsgDetail() {
|
||||||
|
// lili 基础客服
|
||||||
|
|
||||||
|
uni.navigateTo({
|
||||||
|
url: `/pages/tabbar/home/web-view?IM=${this.storeDetail.storeId}`,
|
||||||
|
});
|
||||||
|
|
||||||
|
// udesk 代码
|
||||||
|
// if (this.storeDetail.merchantEuid) {
|
||||||
|
// uni.navigateTo({
|
||||||
|
// url: `/pages/tabbar/home/web-view?src=${this.IM}`,
|
||||||
|
// });
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
// 客服 云智服代码
|
||||||
|
// // #ifdef MP-WEIXIN
|
||||||
|
// const params = {
|
||||||
|
// storeName: this.storeDetail.storeName,
|
||||||
|
// goodsName: this.goodsDetail.goodsName,
|
||||||
|
// goodsId: this.goodsDetail.goodsId,
|
||||||
|
// goodsImg: this.goodsDetail.thumbnail,
|
||||||
|
// price: this.goodsDetail.promotionPrice || this.goodsDetail.price,
|
||||||
|
// // originalPrice: this.goodsDetail.original || this.goodsDetail.price,
|
||||||
|
// uuid: storage.getUuid(),
|
||||||
|
// token: storage.getAccessToken(),
|
||||||
|
// sign: this.storeDetail.yzfSign,
|
||||||
|
// mpSign: this.storeDetail.yzfMpSign,
|
||||||
|
// };
|
||||||
|
// uni.navigateTo({
|
||||||
|
// url:
|
||||||
|
// "/pages/product/customerservice/index?params=" +
|
||||||
|
// encodeURIComponent(JSON.stringify(params)),
|
||||||
|
// });
|
||||||
|
// // #endif
|
||||||
|
// // #ifndef MP-WEIXIN
|
||||||
|
// const sign = this.storeDetail.yzfSign;
|
||||||
|
// uni.navigateTo({
|
||||||
|
// url:
|
||||||
|
// "/pages/tabbar/home/web-view?src=https://yzf.qq.com/xv/web/static/chat/index.html?sign=" +
|
||||||
|
// sign,
|
||||||
|
// });
|
||||||
|
// // #endif
|
||||||
|
|
||||||
|
},
|
||||||
/**选择商品 */
|
/**选择商品 */
|
||||||
changedGoods(val) {
|
changedGoods(val) {
|
||||||
this.selectedGoods = val;
|
this.selectedGoods = val;
|
||||||
@@ -625,14 +766,14 @@ export default {
|
|||||||
*/
|
*/
|
||||||
closePopupAddress(val) {
|
closePopupAddress(val) {
|
||||||
this.addressFlag = val;
|
this.addressFlag = val;
|
||||||
this.maskFlag = false;
|
// this.maskFlag = false;
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* 商品规格子级关闭回调
|
* 商品规格子级关闭回调
|
||||||
*/
|
*/
|
||||||
closePopupBuy(val) {
|
closePopupBuy(val) {
|
||||||
this.buyMask = val;
|
this.buyMask = val;
|
||||||
this.maskFlag = false;
|
// this.maskFlag = false;
|
||||||
},
|
},
|
||||||
|
|
||||||
/** 参与拼团 创建拼团 */
|
/** 参与拼团 创建拼团 */
|
||||||
@@ -708,7 +849,7 @@ export default {
|
|||||||
*/
|
*/
|
||||||
getGoodsCollectionFun(goodsId) {
|
getGoodsCollectionFun(goodsId) {
|
||||||
if (storage.getHasLogin()) {
|
if (storage.getHasLogin()) {
|
||||||
API_Members.getGoodsIsCollect("GOODS",goodsId ).then((res) => {
|
API_Members.getGoodsIsCollect("GOODS", goodsId).then((res) => {
|
||||||
this.favorite = res.data.result;
|
this.favorite = res.data.result;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -717,7 +858,7 @@ export default {
|
|||||||
/**
|
/**
|
||||||
* 获取店铺推荐商品列表
|
* 获取店铺推荐商品列表
|
||||||
*/
|
*/
|
||||||
getstoreRecommend() {
|
getStoreRecommend() {
|
||||||
getGoodsList({
|
getGoodsList({
|
||||||
pageNumber: 1,
|
pageNumber: 1,
|
||||||
pageSize: 6,
|
pageSize: 6,
|
||||||
@@ -730,7 +871,7 @@ export default {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取相似商品列表
|
* 获取相似商品列表
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
getOtherLikeGoods() {
|
getOtherLikeGoods() {
|
||||||
getGoodsList({
|
getGoodsList({
|
||||||
@@ -775,22 +916,21 @@ export default {
|
|||||||
* 规格弹窗开关
|
* 规格弹窗开关
|
||||||
*/
|
*/
|
||||||
shutMask(flag, buyFlag, type) {
|
shutMask(flag, buyFlag, type) {
|
||||||
// type是指是否点击底部按钮
|
this.promotionShow = false;
|
||||||
|
this.buyMask = false;
|
||||||
|
this.addressFlag = false;
|
||||||
if (flag) {
|
if (flag) {
|
||||||
switch (flag) {
|
switch (flag) {
|
||||||
case 1: //优惠券弹窗
|
case 1: //优惠券弹窗
|
||||||
this.maskFlag = true;
|
this.promotionShow = true;
|
||||||
this.cuxiao = true;
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 3:
|
case 3:
|
||||||
this.maskFlag = true;
|
|
||||||
this.addressFlag = true;
|
this.addressFlag = true;
|
||||||
break;
|
break;
|
||||||
case 4: //添加购物车直接购买,查看已选 弹窗
|
case 4: //添加购物车直接购买,查看已选 弹窗
|
||||||
// 判断是否是一个规格
|
// 判断是否是一个规格
|
||||||
this.maskFlag = true;
|
|
||||||
this.buyMask = true;
|
this.buyMask = true;
|
||||||
if (buyFlag == "PINTUAN") {
|
if (buyFlag == "PINTUAN") {
|
||||||
if (type.orderSn) {
|
if (type.orderSn) {
|
||||||
@@ -804,10 +944,6 @@ export default {
|
|||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
this.maskFlag = false;
|
|
||||||
this.cuxiao = false;
|
|
||||||
this.buyMask = false;
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -820,7 +956,7 @@ export default {
|
|||||||
this.deleteGoodsCollectionFun(id);
|
this.deleteGoodsCollectionFun(id);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
API_Members.collectionGoods("GOODS",id ).then((res) => {
|
API_Members.collectionGoods("GOODS", id).then((res) => {
|
||||||
if (res.data.success) {
|
if (res.data.success) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: "收藏成功!",
|
title: "收藏成功!",
|
||||||
@@ -922,7 +1058,7 @@ export default {
|
|||||||
* 点击分享
|
* 点击分享
|
||||||
*/
|
*/
|
||||||
async shareChange() {
|
async shareChange() {
|
||||||
this.shareFlage = true;
|
this.enableShare = true;
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -6,8 +6,19 @@
|
|||||||
<div class="goods-detail-box">
|
<div class="goods-detail-box">
|
||||||
<div class="goods-detail-item goods-active">商品介绍</div>
|
<div class="goods-detail-item goods-active">商品介绍</div>
|
||||||
</div>
|
</div>
|
||||||
<u-empty class="empty" text="暂无商品介绍" mode="data" v-if="!res.intro"></u-empty>
|
<u-empty
|
||||||
<u-parse class="vhtml" :lazy-load="true" :use-cache="true" :show-with-animation="true" :html="res.mobileIntro"></u-parse>
|
class="empty"
|
||||||
|
text="暂无商品介绍"
|
||||||
|
mode="data"
|
||||||
|
v-if="!res.mobileIntro"
|
||||||
|
></u-empty>
|
||||||
|
<u-parse
|
||||||
|
class="vhtml"
|
||||||
|
:lazy-load="true"
|
||||||
|
:use-cache="true"
|
||||||
|
:show-with-animation="true"
|
||||||
|
:html="res.mobileIntro"
|
||||||
|
></u-parse>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -20,17 +31,27 @@
|
|||||||
</div>
|
</div>
|
||||||
<!-- <u-divider>商品参数</u-divider> -->
|
<!-- <u-divider>商品参数</u-divider> -->
|
||||||
<div class="param-list" v-if="goodsParams.length == 0">
|
<div class="param-list" v-if="goodsParams.length == 0">
|
||||||
<u-empty text="暂无商品参数" mode="list"></u-empty>
|
<u-empty text="暂无商品参数" mode="list"></u-empty>
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
class="params-group"
|
||||||
|
v-for="(group, groupIndex) in goodsParams"
|
||||||
|
:key="groupIndex"
|
||||||
|
>
|
||||||
|
<view style="font-weight: bold; margin-left: 10px">{{
|
||||||
|
group.groupName
|
||||||
|
}}</view>
|
||||||
|
<div class="param-list">
|
||||||
|
<div
|
||||||
|
class="param-item"
|
||||||
|
v-for="(param, index) in group.goodsParamsItemDTOList"
|
||||||
|
:key="index"
|
||||||
|
>
|
||||||
|
<div class="param-left">{{ param.paramName }}</div>
|
||||||
|
<div class="param-right">{{ param.paramValue }}</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="params-group" v-for="(group,groupIndex) in goodsParams" :key="groupIndex">
|
|
||||||
<view style="font-weight: bold;margin-left: 10px;">{{group.groupName}}</view>
|
|
||||||
<div class="param-list">
|
|
||||||
<div class="param-item" v-for="(param,index) in group.goodsParamsItemDTOList" :key="index">
|
|
||||||
<div class="param-left">{{param.paramName}}</div>
|
|
||||||
<div class="param-right">{{param.paramValue}}</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -42,16 +63,14 @@ import { getGoodsMessage } from "@/api/goods";
|
|||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
goodsDetail: ""
|
goodsDetail: "",
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
props: ["res", "goodsId", "goodsParams"],
|
props: ["res", "goodsId", "goodsParams"],
|
||||||
async mounted() {
|
async mounted() {
|
||||||
console.log(this.res)
|
|
||||||
let res = await getGoodsMessage(this.goodsId);
|
let res = await getGoodsMessage(this.goodsId);
|
||||||
if (res.data.success) {
|
if (res.data.success) {
|
||||||
this.goodsDetail = res.data.result;
|
this.goodsDetail = res.data.result;
|
||||||
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
@@ -102,6 +121,11 @@ export default {
|
|||||||
|
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
.vhtml {
|
||||||
|
/deep/ img {
|
||||||
|
display: block !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/deep/ img {
|
/deep/ img {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
|||||||
@@ -1,169 +1,20 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="recommend-box" >
|
<view class="recommend-box" >
|
||||||
<h4 class="goods-recommend-title">宝贝推荐</h4>
|
<h4 class="goods-recommend-title">宝贝推荐</h4>
|
||||||
<view class="like-goods-list">
|
<goodsList :res='res' v-if="res" :storeName="false" />
|
||||||
<view class="like-goods-list">
|
</view>
|
||||||
<view
|
|
||||||
class="like-goods-item"
|
|
||||||
@click="clickGoods(item)"
|
|
||||||
v-for="(item, index) in res"
|
|
||||||
:key="index"
|
|
||||||
>
|
|
||||||
<u-image
|
|
||||||
:fade="true"
|
|
||||||
duration="450"
|
|
||||||
:lazy-load="true"
|
|
||||||
:src="item.content.thumbnail"
|
|
||||||
width="330rpx"
|
|
||||||
height="330rpx"
|
|
||||||
class="like-goods-uimage"
|
|
||||||
>
|
|
||||||
<u-loading slot="loading"></u-loading>
|
|
||||||
</u-image>
|
|
||||||
<view style="background-color: #ffffff; width: 100%">
|
|
||||||
<view class="name">{{ item.content.goodsName }}</view>
|
|
||||||
<view class="price-sales">
|
|
||||||
<div class="item-price" v-if="item.content.price != undefined">
|
|
||||||
¥
|
|
||||||
<span>{{ formatPrice(item.content.price)[0] }}</span>
|
|
||||||
.{{formatPrice(item.content.price)[1]}}
|
|
||||||
<!-- <text v-if="item.point != undefined">+{{ item.point }}积分</text> -->
|
|
||||||
</div>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import goodsList from '@/components/m-goods-list/list.vue'
|
||||||
export default {
|
export default {
|
||||||
props: ["res"],
|
props: ["res"],
|
||||||
|
components:{goodsList},
|
||||||
methods: {
|
methods: {
|
||||||
// 点击店铺推荐
|
|
||||||
clickGoods(val) {
|
|
||||||
uni.navigateTo({
|
|
||||||
url: `/pages/product/goods?id=${val.content.id}&goodsId=${val.content.goodsId}`
|
|
||||||
});
|
|
||||||
},
|
|
||||||
// 格式化金钱 1999 --> [1999,00]
|
|
||||||
formatPrice(val) {
|
|
||||||
if (typeof val == "undefined") {
|
|
||||||
return val;
|
|
||||||
}
|
|
||||||
|
|
||||||
return val.toFixed(2).split(".");
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
@import "../mp-goods.scss";
|
|
||||||
@import "../product.scss";
|
@import "../product.scss";
|
||||||
|
|
||||||
.goods_recomm {
|
|
||||||
padding: 12px 0 20rpx 20rpx;
|
|
||||||
color: #000;
|
|
||||||
font-size: 30rpx;
|
|
||||||
font-weight: 400;
|
|
||||||
margin-bottom: 28rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.like-goods-uimage {
|
|
||||||
/deep/ .u-image {
|
|
||||||
height: 350rpx !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.recommend-box {
|
|
||||||
background-color: #ffffff;
|
|
||||||
|
|
||||||
width: 100%;
|
|
||||||
|
|
||||||
padding-bottom: 120rpx;
|
|
||||||
|
|
||||||
.title {
|
|
||||||
width: 120rpx;
|
|
||||||
height: 42rpx;
|
|
||||||
font-size: 30rpx;
|
|
||||||
font-weight: 700;
|
|
||||||
text-align: left;
|
|
||||||
color: #333333;
|
|
||||||
margin-left: 20rpx;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.like-goods-list {
|
|
||||||
display: flex;
|
|
||||||
width: 100%;
|
|
||||||
flex-wrap: wrap;
|
|
||||||
}
|
|
||||||
.like-goods-item {
|
|
||||||
padding: 0 !important;
|
|
||||||
width: 48%;
|
|
||||||
margin: 0 1% 10rpx 1%;
|
|
||||||
background: #f7f7f7;
|
|
||||||
border-radius: 12rpx;
|
|
||||||
|
|
||||||
overflow: hidden;
|
|
||||||
|
|
||||||
/deep/ .u-image {
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.like-goods-list {
|
|
||||||
// background-color: #f8f8f8;
|
|
||||||
width: 100%;
|
|
||||||
margin-bottom: 100rpx;
|
|
||||||
|
|
||||||
.name {
|
|
||||||
padding: 14rpx 8rpx 0 8rpx;
|
|
||||||
|
|
||||||
color: #333;
|
|
||||||
font-size: 24rpx;
|
|
||||||
display: -webkit-box;
|
|
||||||
overflow: hidden;
|
|
||||||
-webkit-box-orient: vertical;
|
|
||||||
|
|
||||||
-webkit-line-clamp: 2;
|
|
||||||
|
|
||||||
background: #f7f7f7;
|
|
||||||
height: 80rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.price-sales {
|
|
||||||
padding: 8rpx;
|
|
||||||
background: #f7f7f7;
|
|
||||||
display: flex;
|
|
||||||
justify-content: space-between;
|
|
||||||
align-items: center;
|
|
||||||
|
|
||||||
.item-price {
|
|
||||||
overflow: hidden;
|
|
||||||
text-overflow: ellipsis;
|
|
||||||
white-space: nowrap;
|
|
||||||
font-size: 26rpx;
|
|
||||||
text-align: left;
|
|
||||||
color: $price-color;
|
|
||||||
line-height: 23px;
|
|
||||||
font-weight: bold;
|
|
||||||
> span {
|
|
||||||
font-size: 32rpx;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.sales {
|
|
||||||
line-height: 23px;
|
|
||||||
font-size: 22rpx;
|
|
||||||
text-align: left;
|
|
||||||
letter-spacing: 0;
|
|
||||||
color: #cccccc;
|
|
||||||
// padding-right: 10rpx;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<u-popup class="popup" v-model="addressFlag" :height="setup.height" :mode="setup.mode" :border-radius="setup.radius" @close="closeAddress()" :mask-close-able="setup.close" :mask="false" closeable>
|
<u-popup class="popup" v-model="addressFlag" :height="setup.height" :mode="setup.mode" :border-radius="setup.radius" @close="closeAddress()" closeable>
|
||||||
<view class="header-title">选择地址</view>
|
<view class="header-title">选择地址</view>
|
||||||
<view class="view-box" v-if="addressDetail">
|
<view class="view-box" v-if="addressDetail">
|
||||||
<view class="view-item" v-for="(item, index) in addressDetail" :key="index" @click="clickAddress(item)">
|
<view class="view-item" v-for="(item, index) in addressDetail" :key="index" @click="clickAddress(item)">
|
||||||
@@ -27,7 +27,7 @@
|
|||||||
</u-popup>
|
</u-popup>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import setup from "./popup";
|
import setup from "@/components/m-buy/popup.js";
|
||||||
/************请求存储***************/
|
/************请求存储***************/
|
||||||
|
|
||||||
import * as API_Address from "@/api/address.js";
|
import * as API_Address from "@/api/address.js";
|
||||||
@@ -157,7 +157,7 @@ export default {
|
|||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
border: 2rpx solid #ededed;
|
border: 2rpx solid #ededed;
|
||||||
}
|
}
|
||||||
@import "./popup.scss";
|
@import "@/components/m-buy/popup.scss";
|
||||||
.view-box {
|
.view-box {
|
||||||
height: 810rpx;
|
height: 810rpx;
|
||||||
// #ifdef MP-WEIXIN
|
// #ifdef MP-WEIXIN
|
||||||
|
|||||||
@@ -1,411 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div class="wrapper">
|
|
||||||
<u-popup class="popup" v-model="buyMask" :height="setup.height" closeable :mode="setup.mode" :mask-close-able="isClose" :mask="isMask" :border-radius="setup.radius" @close="closeMask()">
|
|
||||||
<!-- 商品 -->
|
|
||||||
<view class="goods-box bottom">
|
|
||||||
<view class="goods-header">
|
|
||||||
<view class="goods-img">
|
|
||||||
<u-image width="200rpx" border-radius="20" class="uimage" height="200rpx" :src="selectedSpecImg ? selectedSpecImg : goodsDetail.thumbnail"></u-image>
|
|
||||||
</view>
|
|
||||||
<view class="goods-skus">
|
|
||||||
|
|
||||||
<!-- 有活动商品价格 -->
|
|
||||||
<view class="goods-price " v-if="goodsDetail.promotionPrice">
|
|
||||||
<span v-if="goodsDetail.promotionPrice && !pointDetail">
|
|
||||||
¥
|
|
||||||
<span class="goods-price-promotionShow goods-price-bigshow">{{ formatPrice(goodsDetail.promotionPrice)[0] }}</span>
|
|
||||||
.{{ formatPrice(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">{{
|
|
||||||
formatPrice(goodsDetail.price)[0]
|
|
||||||
}}</span>
|
|
||||||
.{{ formatPrice(goodsDetail.price)[1] }}
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</view>
|
|
||||||
<!-- 正常商品的价格 -->
|
|
||||||
<view class="goods-price" v-else>
|
|
||||||
<span>
|
|
||||||
¥
|
|
||||||
<span class="goods-price-bigshow">{{
|
|
||||||
formatPrice(goodsDetail.price)[0]
|
|
||||||
}}</span>
|
|
||||||
.{{ formatPrice(goodsDetail.price)[1] }}
|
|
||||||
|
|
||||||
</span>
|
|
||||||
</view>
|
|
||||||
<view class="goods-check-skus">
|
|
||||||
已选
|
|
||||||
<span class="goods-check-skus-name">
|
|
||||||
{{ selectName }}
|
|
||||||
<span>,{{ num }}个</span>
|
|
||||||
</span>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<!-- 商品信息 -->
|
|
||||||
<view class="goods-skus-box">
|
|
||||||
<!-- 规格 -->
|
|
||||||
<view class="goods-skus-view" :key="specIndex" v-for="(spec, specIndex) in formatList">
|
|
||||||
<view class="skus-view-list">
|
|
||||||
<view class="view-class-title">{{ spec.name }}</view>
|
|
||||||
<view :class="{ active: spec_val.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>
|
|
||||||
</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>
|
|
||||||
<script>
|
|
||||||
import * as API_trade from "@/api/trade.js";
|
|
||||||
import setup from "./popup";
|
|
||||||
export default {
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
setup,
|
|
||||||
num: 1,
|
|
||||||
// 步进器的大小尺寸单位是 rpx
|
|
||||||
numberBox: {
|
|
||||||
width: "50",
|
|
||||||
height: "50",
|
|
||||||
size: "22",
|
|
||||||
color: "#333",
|
|
||||||
bgColor: "#fff",
|
|
||||||
},
|
|
||||||
selectName: "", //选中商品的昵称
|
|
||||||
selectSkuList: "", //选中商铺sku,
|
|
||||||
selectedSpecImg: "", //选中的图片路径
|
|
||||||
buyType: "", //用于存储促销,拼团等活动类型
|
|
||||||
parentOrder: "", //父级拼团活动的数据 - 如果是团员则有数据
|
|
||||||
formatList: [],
|
|
||||||
currentSelceted: [],
|
|
||||||
skuList: "",
|
|
||||||
isMask: false, //是否显示遮罩层
|
|
||||||
isClose: false, //是否可以点击遮罩关闭
|
|
||||||
};
|
|
||||||
},
|
|
||||||
props: [
|
|
||||||
"goodsDetail", //商品详情
|
|
||||||
"buyMask",
|
|
||||||
"selectedSku",
|
|
||||||
"goodsSpec",
|
|
||||||
"addr",
|
|
||||||
"pointDetail", // 积分详情
|
|
||||||
],
|
|
||||||
watch: {
|
|
||||||
buyType: {
|
|
||||||
handler(val) {
|
|
||||||
this.buyType = val;
|
|
||||||
},
|
|
||||||
immediate: true,
|
|
||||||
},
|
|
||||||
selectSkuList: {
|
|
||||||
handler(val, oldval) {
|
|
||||||
this.$emit("changed", val);
|
|
||||||
},
|
|
||||||
deep: true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
|
|
||||||
methods: {
|
|
||||||
|
|
||||||
|
|
||||||
// 格式化金钱 1999 --> [1999,00]
|
|
||||||
formatPrice(val) {
|
|
||||||
if (typeof val == "undefined") {
|
|
||||||
return val;
|
|
||||||
}
|
|
||||||
return val.toFixed(2).split(".");
|
|
||||||
},
|
|
||||||
|
|
||||||
closeMask() {
|
|
||||||
this.$emit("closeBuy", false);
|
|
||||||
},
|
|
||||||
|
|
||||||
/**点击规格 */
|
|
||||||
handleClickSpec(val, index, specValue) {
|
|
||||||
this.$set(this.currentSelceted, index, specValue.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.currentSelceted[n]) {
|
|
||||||
matched = false;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (matched) {
|
|
||||||
return i;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
this.selectSkuList = {
|
|
||||||
spec: {
|
|
||||||
specName: val.name,
|
|
||||||
specValue: specValue.value,
|
|
||||||
},
|
|
||||||
data: this.goodsDetail,
|
|
||||||
};
|
|
||||||
this.selectName = specValue.value;
|
|
||||||
|
|
||||||
this.$emit("handleClickSku", {skuId: selectedSkuId.skuId, goodsId: this.goodsDetail.goodsId});
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 添加到购物车或购买
|
|
||||||
*/
|
|
||||||
addToCartOrBuy(val) {
|
|
||||||
if (!this.selectSkuList) {
|
|
||||||
uni.showToast({
|
|
||||||
title: "请选择规格商品",
|
|
||||||
icon: "none",
|
|
||||||
});
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
let data = {
|
|
||||||
skuId: this.goodsDetail.id,
|
|
||||||
num: this.num,
|
|
||||||
};
|
|
||||||
|
|
||||||
if (val == "cart") {
|
|
||||||
API_trade.addToCart(data).then((res) => {
|
|
||||||
if (res.data.code == 200) {
|
|
||||||
uni.showToast({
|
|
||||||
title: "商品已添加到购物车",
|
|
||||||
icon: "none",
|
|
||||||
});
|
|
||||||
|
|
||||||
this.$emit("queryCart");
|
|
||||||
this.closeMask();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
// 判断是否拼团商品
|
|
||||||
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({
|
|
||||||
url: `/pages/order/fillorder?way=${data.cartType}&addr=${
|
|
||||||
this.addr.id || ""
|
|
||||||
}&parentOrder=${encodeURIComponent(
|
|
||||||
JSON.stringify(this.parentOrder)
|
|
||||||
)}`,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
},
|
|
||||||
formatSku(list) {
|
|
||||||
// 格式化数据
|
|
||||||
|
|
||||||
let arr = [{}];
|
|
||||||
list.forEach((item, index) => {
|
|
||||||
item.specValues.forEach((spec, specIndex) => {
|
|
||||||
let name = spec.specName;
|
|
||||||
let values = {
|
|
||||||
value: spec.specValue,
|
|
||||||
quantity: item.quantity,
|
|
||||||
};
|
|
||||||
if (name === "images") {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
arr.forEach((arrItem, arrIndex) => {
|
|
||||||
if (
|
|
||||||
arrItem.name == name &&
|
|
||||||
arrItem.values &&
|
|
||||||
!arrItem.values.find((i) => i.value === values.value)
|
|
||||||
) {
|
|
||||||
arrItem.values.push(values);
|
|
||||||
}
|
|
||||||
|
|
||||||
let keys = arr.map((key) => {
|
|
||||||
return key.name;
|
|
||||||
});
|
|
||||||
if (!keys.includes(name)) {
|
|
||||||
arr.push({
|
|
||||||
name: name,
|
|
||||||
values: [values],
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
arr.shift();
|
|
||||||
this.formatList = arr;
|
|
||||||
|
|
||||||
list.forEach((item) => {
|
|
||||||
if (item.skuId === this.goodsDetail.id) {
|
|
||||||
item.specValues
|
|
||||||
.filter((i) => i.specName !== "images")
|
|
||||||
.forEach((value, _index) => {
|
|
||||||
this.currentSelceted[_index] = value.specValue;
|
|
||||||
|
|
||||||
this.selectName = value.specValue;
|
|
||||||
|
|
||||||
this.selectSkuList = {
|
|
||||||
spec: value,
|
|
||||||
data: this.goodsDetail,
|
|
||||||
};
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
this.skuList = list;
|
|
||||||
},
|
|
||||||
},
|
|
||||||
|
|
||||||
mounted() {
|
|
||||||
this.formatSku(this.goodsSpec);
|
|
||||||
|
|
||||||
console.log(this.goodsDetail);
|
|
||||||
},
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
@import "./popup.scss";
|
|
||||||
|
|
||||||
.buy {
|
|
||||||
background-image: linear-gradient(135deg, #ffba0d, #ffc30d 69%, #ffcf0d);
|
|
||||||
box-shadow: 0 2px 6px 0 rgba(255, 65, 66, 0.2);
|
|
||||||
}
|
|
||||||
|
|
||||||
.card {
|
|
||||||
background-image: linear-gradient(135deg, #f2140c, #f2270c 70%, #f24d0c);
|
|
||||||
box-shadow: 0 2px 6px 0 rgba(255, 65, 66, 0.2);
|
|
||||||
}
|
|
||||||
|
|
||||||
/deep/.u-icon-plus,
|
|
||||||
.u-icon-minus,
|
|
||||||
.u-icon-disabled {
|
|
||||||
height: 30rpx !important;
|
|
||||||
background: #fff !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.goods-skus-number {
|
|
||||||
justify-content: space-between;
|
|
||||||
display: flex;
|
|
||||||
}
|
|
||||||
|
|
||||||
/deep/ .uni-scroll-view {
|
|
||||||
overflow: hidden !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.active {
|
|
||||||
background: $price-light-color !important;
|
|
||||||
border: 2rpx solid $price-color;
|
|
||||||
font-weight: bold;
|
|
||||||
color: $price-color !important;
|
|
||||||
box-sizing: border-box;
|
|
||||||
}
|
|
||||||
|
|
||||||
.goods-skus-box {
|
|
||||||
overflow-y: auto;
|
|
||||||
height: 610rpx;
|
|
||||||
// #ifdef MP-WEIXIN
|
|
||||||
height: 570rpx;
|
|
||||||
// #endif
|
|
||||||
margin-bottom: 10rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.goods-skus-view {
|
|
||||||
overflow: hidden;
|
|
||||||
|
|
||||||
.skus-view-list {
|
|
||||||
> .skus-view-item {
|
|
||||||
flex: 1;
|
|
||||||
padding: 0 36rpx;
|
|
||||||
|
|
||||||
overflow: hidden;
|
|
||||||
height: 60rpx;
|
|
||||||
line-height: 60rpx;
|
|
||||||
float: left;
|
|
||||||
text-align: center;
|
|
||||||
margin-left: 24rpx;
|
|
||||||
margin-bottom: 20rpx;
|
|
||||||
font-size: 22rpx;
|
|
||||||
color: #262626;
|
|
||||||
background: #f2f2f2;
|
|
||||||
border-radius: 30rpx;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.goods-header {
|
|
||||||
height: 200rpx;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
margin-bottom: 36rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.goods-box {
|
|
||||||
padding: 50rpx 36rpx 0 36rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.goods-skus {
|
|
||||||
padding: 0 20rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.goods-price {
|
|
||||||
color: $price-color;
|
|
||||||
line-height: 80rpx;
|
|
||||||
display: flex;
|
|
||||||
}
|
|
||||||
.promotion-box {
|
|
||||||
line-height: 1;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
text-decoration: line-through;
|
|
||||||
color: #999;
|
|
||||||
margin-left: 10rpx;
|
|
||||||
/deep/ span {
|
|
||||||
font-size: 30rpx;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.promotion {
|
|
||||||
font-size: 30rpx;
|
|
||||||
}
|
|
||||||
.goods-price-promotionShow {
|
|
||||||
font-size: 48rpx;
|
|
||||||
}
|
|
||||||
.goods-check-skus {
|
|
||||||
font-size: 24rpx;
|
|
||||||
color: #999;
|
|
||||||
> .goods-check-skus-name {
|
|
||||||
margin-left: 4rpx;
|
|
||||||
}
|
|
||||||
> span {
|
|
||||||
color: #333;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -4,5 +4,5 @@ export default {
|
|||||||
height:"1000rpx", //弹出层高度
|
height:"1000rpx", //弹出层高度
|
||||||
mode:"bottom", //弹出层位置
|
mode:"bottom", //弹出层位置
|
||||||
radius:"32", //圆角 rpx,
|
radius:"32", //圆角 rpx,
|
||||||
close:false //能否点击遮罩退出
|
close:true //能否点击遮罩退出
|
||||||
}
|
}
|
||||||
@@ -1,37 +0,0 @@
|
|||||||
.view-class-title {
|
|
||||||
font-size: 26rpx;
|
|
||||||
color: #262626;
|
|
||||||
|
|
||||||
font-weight: 700;
|
|
||||||
height: 80rpx;
|
|
||||||
line-height: 80rpx;
|
|
||||||
}
|
|
||||||
.confirmBtn {
|
|
||||||
width: 90%;
|
|
||||||
}
|
|
||||||
.confirmBtn,
|
|
||||||
.box-btn {
|
|
||||||
line-height: 80rpx;
|
|
||||||
height: 80rpx;
|
|
||||||
|
|
||||||
background: $price-color;
|
|
||||||
color: #fff;
|
|
||||||
border-radius: 200px;
|
|
||||||
text-align: center;
|
|
||||||
margin: 5rpx auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
.btns {
|
|
||||||
display: flex;
|
|
||||||
width: 100%;
|
|
||||||
|
|
||||||
margin: 0 auto;
|
|
||||||
}
|
|
||||||
.goods-price-bigshow {
|
|
||||||
font-size: 48rpx;
|
|
||||||
font-weight: bold;
|
|
||||||
}
|
|
||||||
.box-btn {
|
|
||||||
flex: 1;
|
|
||||||
margin: 0 10rpx;
|
|
||||||
}
|
|
||||||
@@ -34,14 +34,12 @@
|
|||||||
height: 15px;
|
height: 15px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.scroll_mask{
|
.scroll_mask {
|
||||||
height: 555px;
|
height: 868rpx;
|
||||||
// padding-bottom: 100rpx;
|
// padding-bottom: 100rpx;
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
}
|
}
|
||||||
.coupons {
|
|
||||||
padding-bottom: 200rpx !important;
|
|
||||||
}
|
|
||||||
.mask {
|
.mask {
|
||||||
height: 600px;
|
height: 600px;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,23 +1,23 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="group-list">
|
<view class="group-list">
|
||||||
<view class="group-name">拼购列表</view>
|
<view class="group-name">拼购列表</view>
|
||||||
<view v-if="assembleOrder.length !=0">
|
<view v-if="assembleOrder.length != 0">
|
||||||
<view class="group-item" v-for="(order,index) in assembleOrder" :key="index">
|
<view class="group-item" v-for="(order, index) in assembleOrder" :key="index">
|
||||||
<view class="group-item-user">
|
<view class="group-item-user">
|
||||||
<u-image shape="circle" width="40px" height="40px" :src="order.face"></u-image>
|
<u-image shape="circle" width="40px" height="40px" :src="order.face"></u-image>
|
||||||
<span class="group-item-name">{{order.nickName | noPassByName}}</span>
|
<span class="group-item-name">{{ order.nickName | noPassByName }}</span>
|
||||||
</view>
|
</view>
|
||||||
<view>
|
<view>
|
||||||
<span class="group-item-name">还差{{ order.toBeGroupedNum}}人成团</span>
|
<span class="group-item-name">还差{{ order.toBeGroupedNum }}人成团</span>
|
||||||
</view>
|
</view>
|
||||||
<view>
|
<view>
|
||||||
<u-button size="mini" :custom-style="customStyle" @click="buy(order)">去参团</u-button>
|
<u-button size="mini" :custom-style="customStyle" @click="buy(order)"
|
||||||
|
>去参团</u-button
|
||||||
|
>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
<view v-else class="nomore">
|
<view v-else class="nomore">
|
||||||
|
|
||||||
<u-empty text="暂无拼团信息" mode="list"></u-empty>
|
<u-empty text="暂无拼团信息" mode="list"></u-empty>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|||||||
@@ -1,61 +1,105 @@
|
|||||||
<template>
|
<template>
|
||||||
<view>
|
<view>
|
||||||
|
|
||||||
<div v-for="(promotion, promotion_index) in res" :key="promotion_index">
|
<div v-for="(promotion, promotion_index) in res" :key="promotion_index">
|
||||||
<div class="showBox" v-if="promotion.__key == 'SECKILL' || promotion.__key =='GROUPBUY' || promotion.__key == 'PINTUAN'">
|
<div
|
||||||
|
class="showBox"
|
||||||
|
v-if="
|
||||||
|
promotion.__key == 'SECKILL' ||
|
||||||
|
promotion.__key == 'GROUPBUY' ||
|
||||||
|
promotion.__key == 'PINTUAN'
|
||||||
|
"
|
||||||
|
>
|
||||||
<view class="group-wrapper">
|
<view class="group-wrapper">
|
||||||
<div class="u-group-row">
|
<div class="u-group-row">
|
||||||
<view :span="8" class="showBox_L">
|
<view :span="8" class="showBox_L">
|
||||||
<view class="u-group-flex">
|
<view class="u-group-flex">
|
||||||
|
|
||||||
<!-- 限时抢购 -->
|
<!-- 限时抢购 -->
|
||||||
<view class="u-group-flex-left" v-if="promotion.__key == 'SECKILL' ">
|
<view class="u-group-flex-left" v-if="promotion.__key == 'SECKILL'">
|
||||||
|
<span
|
||||||
<span class="u-group-flex-left-span" v-if="detail.promotionPrice!=undefined">
|
class="u-group-flex-left-span"
|
||||||
¥ <span class="flex-price"> {{ formatPrice(detail.promotionPrice)[0]}}.{{ formatPrice(detail.promotionPrice)[1]}}</span>
|
v-if="detail.promotionPrice != undefined"
|
||||||
|
>
|
||||||
|
¥
|
||||||
|
<span class="flex-price">
|
||||||
|
{{ $options.filters.goodsFormatPrice(detail.promotionPrice)[0] }}.{{
|
||||||
|
$options.filters.goodsFormatPrice(detail.promotionPrice)[1]
|
||||||
|
}}</span
|
||||||
|
>
|
||||||
</span>
|
</span>
|
||||||
<view class="u-group-flex" v-if="detail.price!=undefined">
|
<view class="u-group-flex" v-if="detail.price != undefined">
|
||||||
<span class="old-price">¥{{ formatPrice(detail.price)[0]}}.{{ formatPrice(detail.price)[1]}}</span>
|
<span class="old-price"
|
||||||
|
>¥{{ $options.filters.goodsFormatPrice(detail.price)[0] }}.{{
|
||||||
|
$options.filters.goodsFormatPrice(detail.price)[1]
|
||||||
|
}}</span
|
||||||
|
>
|
||||||
<view class="promotion">限时抢购</view>
|
<view class="promotion">限时抢购</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 团购 -->
|
<!-- 团购 -->
|
||||||
<view class="u-group-flex-left" v-if="promotion.__key == 'GROUPBUY' ">
|
<view class="u-group-flex-left" v-if="promotion.__key == 'GROUPBUY'">
|
||||||
<span class="u-group-flex-left-span">
|
<span class="u-group-flex-left-span">
|
||||||
<span class="flex-price"
|
<span
|
||||||
v-if="promotion.groupbuy_goods_vo.price !=undefined">¥{{ formatPrice(promotion.groupbuy_goods_vo.price )[0]}}.{{ formatPrice(promotion.groupbuy_goods_vo.price )[1]}}</span>
|
class="flex-price"
|
||||||
|
v-if="promotion.groupbuy_goods_vo.price != undefined"
|
||||||
|
>¥{{ $options.filters.goodsFormatPrice(promotion.groupbuy_goods_vo.price)[0] }}.{{
|
||||||
|
$options.filters.goodsFormatPrice(promotion.groupbuy_goods_vo.price)[1]
|
||||||
|
}}</span
|
||||||
|
>
|
||||||
<!-- <span v-if="promotion.point">+{{promotion.point}}积分</span> -->
|
<!-- <span v-if="promotion.point">+{{promotion.point}}积分</span> -->
|
||||||
</span>
|
</span>
|
||||||
<view class="u-group-flex">
|
<view class="u-group-flex">
|
||||||
<span class="old-price"
|
<span
|
||||||
v-if="promotion.groupbuy_goods_vo.original_price!=undefined">¥{{ formatPrice(promotion.groupbuy_goods_vo.original_price)[0]}}.{{ formatPrice(promotion.groupbuy_goods_vo.original_price)[1]}}</span>
|
class="old-price"
|
||||||
|
v-if="promotion.groupbuy_goods_vo.original_price != undefined"
|
||||||
|
>¥{{
|
||||||
|
$options.filters.goodsFormatPrice(promotion.groupbuy_goods_vo.original_price)[0]
|
||||||
|
}}.{{
|
||||||
|
$options.filters.goodsFormatPrice(promotion.groupbuy_goods_vo.original_price)[1]
|
||||||
|
}}</span
|
||||||
|
>
|
||||||
<view class="promotion">团购活动</view>
|
<view class="promotion">团购活动</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="u-group-flex-left" v-if="promotion.__key == 'PINTUAN' ">
|
<view class="u-group-flex-left" v-if="promotion.__key == 'PINTUAN'">
|
||||||
|
<span
|
||||||
<span class="u-group-flex-left-span" v-if="detail.promotionPrice != undefined">
|
class="u-group-flex-left-span"
|
||||||
¥<span class="flex-price"> {{ formatPrice(detail.promotionPrice)[0]}}.</span>{{ formatPrice(detail.promotionPrice)[1]}}
|
v-if="detail.promotionPrice != undefined"
|
||||||
|
>
|
||||||
|
¥<span class="flex-price">
|
||||||
|
{{ $options.filters.goodsFormatPrice(detail.promotionPrice)[0] }}.</span
|
||||||
|
>{{ $options.filters.goodsFormatPrice(detail.promotionPrice)[1] }}
|
||||||
</span>
|
</span>
|
||||||
<view class="u-group-flex" v-if="detail.price != undefined">
|
<view class="u-group-flex" v-if="detail.price != undefined">
|
||||||
<span class="old-price">¥{{ formatPrice(detail.price)[0]}}.{{ formatPrice(detail.price)[1]}}</span>
|
<span class="old-price"
|
||||||
|
>¥{{ $options.filters.goodsFormatPrice(detail.price)[0] }}.{{
|
||||||
|
$options.filters.goodsFormatPrice(detail.price)[1]
|
||||||
|
}}</span
|
||||||
|
>
|
||||||
<view class="promotion">拼团活动</view>
|
<view class="promotion">拼团活动</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<!-- 拼团右侧 -->
|
<!-- 拼团右侧 -->
|
||||||
<view class="u-group-flex-right" v-if="promotion.__key == 'PINTUAN' ">
|
<view class="u-group-flex-right" v-if="promotion.__key == 'PINTUAN'">
|
||||||
<span class="group-bag">{{promotion.requiredNum}}人拼团 </span>
|
<span class="group-bag">{{ promotion.requiredNum }}人拼团 </span>
|
||||||
<span class="group-bag">限购{{promotion.limitNum}}件</span>
|
<span class="group-bag">限购{{ promotion.limitNum }}件</span>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="showBox_R" v-if="promotion && promotion.endTime">
|
<view class="showBox_R" v-if="promotion && promotion.endTime">
|
||||||
<u-tag :text="getIsTimer(promotion)" size="mini" type="error" />
|
<u-tag :text="getIsTimer(promotion)" size="mini" type="error" />
|
||||||
<u-count-down :hide-zero-day="true" font-size="25" color="#fff" bg-color="#f71471" separator-size="25" separator-color="#f71471" :show-hours="true" :show-minutes="true"
|
<u-count-down
|
||||||
:timestamp="getCountDownTime(promotion.endTime)"></u-count-down>
|
:hide-zero-day="true"
|
||||||
|
font-size="25"
|
||||||
|
color="#fff"
|
||||||
|
bg-color="#f71471"
|
||||||
|
separator-size="25"
|
||||||
|
separator-color="#f71471"
|
||||||
|
:show-hours="true"
|
||||||
|
:show-minutes="true"
|
||||||
|
:timestamp="getCountDownTime(promotion.endTime)"
|
||||||
|
></u-count-down>
|
||||||
</view>
|
</view>
|
||||||
</div>
|
</div>
|
||||||
</view>
|
</view>
|
||||||
@@ -97,21 +141,13 @@ export default {
|
|||||||
},
|
},
|
||||||
mounted() {},
|
mounted() {},
|
||||||
methods: {
|
methods: {
|
||||||
// 格式化金钱 1999 --> [1999,00]
|
|
||||||
formatPrice(val) {
|
|
||||||
if (typeof val == "undefined") {
|
|
||||||
return val;
|
|
||||||
}
|
|
||||||
return val.toFixed(2).split(".");
|
|
||||||
},
|
|
||||||
getCountDownTime(val) {
|
getCountDownTime(val) {
|
||||||
let date = new Date(val.replace(/-/g, "/"))
|
let date = new Date(val);
|
||||||
let timeSimple = new Date(date).getTime() / 1000;
|
let timeSimple = new Date(date).getTime() / 1000;
|
||||||
return timeSimple - new Date().getTime() / 1000;
|
return timeSimple - new Date().getTime() / 1000;
|
||||||
},
|
},
|
||||||
getIsTimer(val) {
|
getIsTimer(val) {
|
||||||
var timestamp = new Date().getTime();
|
var timestamp = new Date().getTime();
|
||||||
|
|
||||||
|
|
||||||
if (timestamp < val.start_time) {
|
if (timestamp < val.start_time) {
|
||||||
this.startTimer = true;
|
this.startTimer = true;
|
||||||
|
|||||||
@@ -1,178 +1,184 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="wrapper">
|
<view class="wrapper">
|
||||||
|
<div class="coupon-empty" v-if="!res">暂无优惠券</div>
|
||||||
<div class="coupon-empty" v-if="!res">暂无优惠券</div>
|
<view class="coupon-List" v-for="(item, index) in couponRes" :key="index">
|
||||||
<view class="coupon-List" v-if="res && item.__key=='COUPON'" v-for="(item, index) in res" :key="index">
|
<view class="coupon-item">
|
||||||
|
<view class="top">
|
||||||
<view class="coupon-item">
|
<div class="price">
|
||||||
<view class="top">
|
<span v-if="item.couponType == 'DISCOUNT'">{{ item.couponDiscount }}折</span>
|
||||||
<div class="price">
|
<span v-if="item.couponType == 'PRICE'">¥{{ item.price | unitPrice }}</span>
|
||||||
|
</div>
|
||||||
<span v-if="item.couponType == 'DISCOUNT'">{{ item.couponDiscount }}折</span>
|
<view class="text">
|
||||||
<span v-if="item.couponType == 'PRICE'">¥{{ item.price | unitPrice }}</span>
|
<div class="coupon-List-title">
|
||||||
</div>
|
<view v-if="item.scopeType">
|
||||||
<view class="text">
|
<span v-if="item.scopeType == 'ALL' && item.storeId == '0'">全平台</span>
|
||||||
|
<span v-if="item.scopeType == 'PORTION_CATEGORY'">仅限品类</span>
|
||||||
<div class="coupon-List-title">
|
<view v-else>{{
|
||||||
<view v-if="item.scopeType">
|
item.storeName == "platform" ? "全平台" : item.storeName + "店铺"
|
||||||
<span v-if="item.scopeType == 'ALL' && item.id == 'platform'">全平台</span>
|
}}使用</view>
|
||||||
<span v-if="item.scopeType == 'PORTION_CATEGORY'">仅限品类</span>
|
</view>
|
||||||
<view v-else>{{ item.storeName == 'platform' ? '全平台' :item.storeName+'店铺' }}使用</view>
|
</div>
|
||||||
</view>
|
<div>满{{ item.consumeThreshold | unitPrice }}可用</div>
|
||||||
</div>
|
</view>
|
||||||
<div>满{{ item.consumeThreshold | unitPrice }}可用</div>
|
<view class="lingqu-btn" @click="getCoupon(item, index)">
|
||||||
</view>
|
<div :class="yhqFlag[index] ? 'cur' : ''">
|
||||||
<view class="lingqu-btn" @click="getCoupon(item)">
|
{{ yhqFlag[index] ? "已领取或领完" : "立即领取" }}
|
||||||
<div :class="yhqFlag ? 'cur' : ''">{{ yhqFlag ? '已领取或领完' : '立即领取' }}</div>
|
</div>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="line"></view>
|
<view class="line"></view>
|
||||||
<view class="time">{{ item.startTime }} - {{item.endTime }}</view>
|
<view class="time">{{ item.startTime / 1000 | unixToDate }} - {{ item.endTime / 1000 | unixToDate }}</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
yhqFlag: false, //获取优惠券判断是否点击
|
yhqFlag: [], //获取优惠券判断是否点击
|
||||||
};
|
couponRes: [],
|
||||||
},
|
};
|
||||||
props: {
|
},
|
||||||
res: {
|
props: {
|
||||||
type: null,
|
res: {
|
||||||
default: "",
|
type: null,
|
||||||
},
|
default: "",
|
||||||
},
|
},
|
||||||
watch: {
|
},
|
||||||
res: {
|
watch: {
|
||||||
handler() {
|
res: {
|
||||||
if (this.res && this.res.length != 0) {
|
handler() {
|
||||||
Object.keys(this.res).forEach((item) => {
|
if (this.res && this.res.length != 0) {
|
||||||
let key = item.split("-")[0];
|
Object.keys(this.res).forEach((item) => {
|
||||||
this.res[item].__key = key;
|
let key = item.split("-")[0];
|
||||||
});
|
if (key === "COUPON") {
|
||||||
}
|
this.couponRes.push(this?.res[item]);
|
||||||
},
|
|
||||||
immediate: true,
|
}
|
||||||
},
|
});
|
||||||
},
|
}
|
||||||
methods: {
|
},
|
||||||
// 提交优惠券
|
immediate: true,
|
||||||
getCoupon(item) {
|
},
|
||||||
this.yhqFlag = true;
|
},
|
||||||
|
methods: {
|
||||||
this.$emit("getCoupon", item);
|
// 提交优惠券
|
||||||
},
|
getCoupon(item, index) {
|
||||||
},
|
this.yhqFlag[index] = true;
|
||||||
};
|
this.$emit("getCoupon", item);
|
||||||
</script>
|
},
|
||||||
|
},
|
||||||
<style lang="scss" scoped>
|
};
|
||||||
.coupon-item {
|
</script>
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
<style lang="scss" scoped>
|
||||||
display: flex;
|
.coupon-item {
|
||||||
flex-direction: column;
|
width: 100%;
|
||||||
justify-content: space-between;
|
height: 100%;
|
||||||
}
|
display: flex;
|
||||||
.coupon-List {
|
flex-direction: column;
|
||||||
display: flex;
|
justify-content: space-between;
|
||||||
flex-direction: column;
|
}
|
||||||
height: 230rpx;
|
|
||||||
background: #e9ebfb;
|
.coupon-List {
|
||||||
margin: 30rpx 0;
|
display: flex;
|
||||||
padding: 10rpx 30rpx;
|
flex-direction: column;
|
||||||
|
height: 230rpx;
|
||||||
.line {
|
background: #e9ebfb;
|
||||||
height: 1px;
|
margin: 30rpx 0;
|
||||||
background: #fff;
|
padding: 10rpx 30rpx;
|
||||||
margin: 0 20rpx;
|
|
||||||
position: relative;
|
.line {
|
||||||
|
height: 1px;
|
||||||
&:before,
|
background: #fff;
|
||||||
&:after {
|
margin: 0 20rpx;
|
||||||
content: "";
|
position: relative;
|
||||||
display: block;
|
|
||||||
width: 15rpx;
|
&:before,
|
||||||
height: 30rpx;
|
&:after {
|
||||||
background: #fff;
|
content: "";
|
||||||
position: absolute;
|
display: block;
|
||||||
top: -15rpx;
|
width: 15rpx;
|
||||||
}
|
height: 30rpx;
|
||||||
|
background: #fff;
|
||||||
&:before {
|
position: absolute;
|
||||||
left: -50rpx;
|
top: -15rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
&:after {
|
&:before {
|
||||||
right: -50rpx;
|
left: -50rpx;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
&:after {
|
||||||
.time {
|
right: -50rpx;
|
||||||
flex: 1;
|
}
|
||||||
font-size: 24rpx;
|
}
|
||||||
align-items: center;
|
|
||||||
display: flex;
|
.time {
|
||||||
align-items: center;
|
flex: 1;
|
||||||
}
|
font-size: 24rpx;
|
||||||
}
|
align-items: center;
|
||||||
|
display: flex;
|
||||||
.top {
|
align-items: center;
|
||||||
height: 140rpx;
|
}
|
||||||
display: flex;
|
}
|
||||||
|
|
||||||
.price {
|
.top {
|
||||||
width: 33%;
|
height: 140rpx;
|
||||||
justify-content: center;
|
display: flex;
|
||||||
color: #6772e5;
|
|
||||||
font-size: 40rpx;
|
.price {
|
||||||
display: flex;
|
width: 33%;
|
||||||
|
justify-content: center;
|
||||||
height: 100%;
|
color: #6772e5;
|
||||||
align-items: center;
|
font-size: 40rpx;
|
||||||
span {
|
display: flex;
|
||||||
font-size: 50rpx;
|
|
||||||
}
|
height: 100%;
|
||||||
}
|
align-items: center;
|
||||||
|
|
||||||
.text {
|
span {
|
||||||
width: 33%;
|
font-size: 50rpx;
|
||||||
display: flex;
|
}
|
||||||
flex-direction: column;
|
}
|
||||||
justify-content: center;
|
|
||||||
font-size: 26rpx;
|
.text {
|
||||||
color: 333;
|
width: 33%;
|
||||||
margin-left: 40rpx;
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
.coupon-List-title {
|
justify-content: center;
|
||||||
font-size: 30rpx;
|
font-size: 26rpx;
|
||||||
font-weight: bold;
|
color: 333;
|
||||||
}
|
margin-left: 40rpx;
|
||||||
}
|
|
||||||
|
.coupon-List-title {
|
||||||
.lingqu-btn {
|
font-size: 30rpx;
|
||||||
display: flex;
|
font-weight: bold;
|
||||||
align-items: center;
|
}
|
||||||
margin-left: 40rpx;
|
}
|
||||||
text {
|
|
||||||
width: 140rpx;
|
.lingqu-btn {
|
||||||
height: 40rpx;
|
display: flex;
|
||||||
text-align: center;
|
align-items: center;
|
||||||
line-height: 40rpx;
|
margin-left: 40rpx;
|
||||||
color: #fff;
|
|
||||||
background: #6772e5;
|
text {
|
||||||
border-radius: 5px;
|
width: 140rpx;
|
||||||
font-size: 26rpx;
|
height: 40rpx;
|
||||||
|
text-align: center;
|
||||||
&.cur {
|
line-height: 40rpx;
|
||||||
background: none;
|
color: #fff;
|
||||||
transform: rotate(45deg) translate(10rpx, -46rpx);
|
background: #6772e5;
|
||||||
}
|
border-radius: 5px;
|
||||||
}
|
font-size: 26rpx;
|
||||||
}
|
|
||||||
}
|
&.cur {
|
||||||
</style>
|
background: none;
|
||||||
|
transform: rotate(45deg) translate(10rpx, -46rpx);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|||||||
@@ -1,32 +1,45 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="wrapper" v-if="res">
|
<view class="wrapper" v-if="res">
|
||||||
|
|
||||||
<view v-for="(prom, index) in Object.keys(res)" :key="index">
|
<view v-for="(prom, index) in Object.keys(res)" :key="index">
|
||||||
<view>
|
<view>
|
||||||
|
|
||||||
<view v-if="prom.split('-')[0] == 'FULL_DISCOUNT'">
|
<view v-if="prom.split('-')[0] == 'FULL_DISCOUNT'">
|
||||||
<div class="res_prom_item" v-if="res[prom].fullMinus">
|
<div class="res_prom_item" v-if="res[prom].fullMinus">
|
||||||
<u-tag text="满减" type="error"></u-tag>
|
<u-tag text="满减" type="error"></u-tag>
|
||||||
<span class="proText">满{{ res[prom].fullMoney }}元,立减现金 <span class="price">{{ res[prom].fullMinus}}元</span></span>
|
<!-- TODO 后续将优化为可点击的商品以及优惠券显示明细 -->
|
||||||
|
<span class="pro-text"
|
||||||
|
>满{{ res[prom].fullMoney }}元 立减现金
|
||||||
|
<span class="price">{{ res[prom].fullMinus }}元</span>
|
||||||
|
<span v-if="res[prom].couponFlag"> 赠送<span>优惠券</span></span>
|
||||||
|
<span v-if="res[prom].pointFlag"> 赠送{{ res[prom].point }}积分</span>
|
||||||
|
<span v-if="res[prom].giftFlag"> 赠送商品</span>
|
||||||
|
<span v-if="res[prom].freeFreightFlag">赠送包邮服务</span>
|
||||||
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="res_prom_item" v-if="res[prom].fullRate">
|
<div class="res_prom_item" v-if="res[prom].fullRate && res[prom].fullRateFlag">
|
||||||
<u-tag text="打折" type="error"></u-tag>
|
<u-tag text="打折" type="error"></u-tag>
|
||||||
<span class="proText">满{{ res[prom].fullMoney }}元,立享<span class="price">{{ res[prom].fullRate }}折</span>优惠</span>
|
<span class="pro-text"
|
||||||
|
>满{{ res[prom].fullMoney }}元,立享<span class="price"
|
||||||
|
>{{ res[prom].fullRate }}折</span
|
||||||
|
>优惠</span
|
||||||
|
>
|
||||||
</div>
|
</div>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view v-if="prom.split('-')[0] == 'PINTUAN'">
|
<view v-if="prom.split('-')[0] == 'PINTUAN'">
|
||||||
|
|
||||||
<div class="res_prom_item" v-if="res[prom].requiredNum">
|
<div class="res_prom_item" v-if="res[prom].requiredNum">
|
||||||
<u-tag text="拼团" type="error"></u-tag>
|
<u-tag text="拼团" type="error"></u-tag>
|
||||||
<span class="proText">{{ res[prom].requiredNum }}人拼团 限购<span class="price">{{ res[prom].limitNum}}件</span></span>
|
<span class="pro-text"
|
||||||
|
>{{ res[prom].requiredNum }}人拼团 限购<span class="price"
|
||||||
|
>{{ res[prom].limitNum }}件</span
|
||||||
|
></span
|
||||||
|
>
|
||||||
</div>
|
</div>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view v-if="prom.split('-')[0] == 'SECKILL'">
|
<view v-if="prom.split('-')[0] == 'SECKILL'">
|
||||||
<div class="res_prom_item">
|
<div class="res_prom_item">
|
||||||
<u-tag text="限时抢购" type="error"></u-tag>
|
<u-tag text="限时抢购" type="error"></u-tag>
|
||||||
<span class="proText">限时抢购</span>
|
<span class="pro-text">限时抢购</span>
|
||||||
</div>
|
</div>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -68,13 +81,16 @@ export default {
|
|||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.proText {
|
.pro-text {
|
||||||
font-size: 26rpx;
|
font-size: 26rpx;
|
||||||
font-family: PingFang SC, PingFang SC-Regular;
|
font-family: PingFang SC, PingFang SC-Regular;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
text-align: left;
|
text-align: left;
|
||||||
color: #333333;
|
color: #333333;
|
||||||
margin-left: 20rpx;
|
margin-left: 20rpx;
|
||||||
|
> span {
|
||||||
|
margin-right: 15rpx;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.wrapper {
|
.wrapper {
|
||||||
|
|||||||
@@ -1,50 +1,65 @@
|
|||||||
<template>
|
<template>
|
||||||
<view>
|
<view>
|
||||||
|
<view
|
||||||
<view v-for="(promotionItem,promotionIndex) in promotion" :key="promotionIndex" class="promotion_row" @click="shutMask(1)">
|
v-for="(promotionItem, promotionIndex) in promotion"
|
||||||
<view v-if="res!=null" v-for="(item, index) in Object.keys(res)" :key="index">
|
:key="promotionIndex"
|
||||||
<div class="promotion_col" v-if="item.split('-')[0] == promotionItem.value && item.split('-')[0] == 'FULL_DISCOUNT'">
|
class="promotion_row"
|
||||||
|
@click="shutMask(1)"
|
||||||
|
>
|
||||||
|
<view v-if="res != null" v-for="(item, index) in Object.keys(res)" :key="index">
|
||||||
|
<div
|
||||||
|
class="promotion_col"
|
||||||
|
v-if="
|
||||||
|
item.split('-')[0] == promotionItem.value &&
|
||||||
|
item.split('-')[0] == 'FULL_DISCOUNT'
|
||||||
|
"
|
||||||
|
>
|
||||||
<!-- 满减,折扣 -->
|
<!-- 满减,折扣 -->
|
||||||
<div class="flex">
|
<div class="flex">
|
||||||
<view class="deg_tag">{{promotionItem.title}}</view>
|
<view class="deg_tag">{{ promotionItem.title }}</view>
|
||||||
<div class="text proText">满{{ res[item].fullMoney }}元,立享优惠</div>
|
<div class="text proText">满{{ res[item].fullMoney }}元,立享优惠</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="promotion_col" v-if="item.split('-')[0] == promotionItem.value && item.split('-')[0] == 'PINTUAN'">
|
<div
|
||||||
|
class="promotion_col"
|
||||||
|
v-if="
|
||||||
|
item.split('-')[0] == promotionItem.value && item.split('-')[0] == 'PINTUAN'
|
||||||
|
"
|
||||||
|
>
|
||||||
<!-- 拼团 -->
|
<!-- 拼团 -->
|
||||||
<div class="flex">
|
<div class="flex">
|
||||||
<view class="deg_tag">{{promotionItem.title}}</view>
|
<view class="deg_tag">{{ promotionItem.title }}</view>
|
||||||
<div class="text proText">{{ res[item].promotionName }}</div>
|
<div class="text proText">{{ res[item].promotionName }}</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="promotion_col" v-if="item.split('-')[0] == promotionItem.value && item.split('-')[0] == 'SECKILL'">
|
<div
|
||||||
|
class="promotion_col"
|
||||||
|
v-if="
|
||||||
|
item.split('-')[0] == promotionItem.value && item.split('-')[0] == 'SECKILL'
|
||||||
|
"
|
||||||
|
>
|
||||||
<!-- 限时抢购 -->
|
<!-- 限时抢购 -->
|
||||||
<div class="flex">
|
<div class="flex">
|
||||||
<view class="deg_tag">{{promotionItem.title}}</view>
|
<view class="deg_tag">{{ promotionItem.title }}</view>
|
||||||
<div class="text proText">{{ res[item].promotionName }}</div>
|
<div class="text proText">{{ res[item].promotionName }}</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="promotion_row" style="display:inline;">
|
<view class="promotion_row" style="display: inline">
|
||||||
<view>
|
<view>
|
||||||
<div class="promotion_col coupon" v-if="couponList && promotionIndex ==1">
|
<div class="promotion_col coupon" v-if="couponList && promotionIndex == 1">
|
||||||
<!-- 优惠券 -->
|
<!-- 优惠券 -->
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<view class="deg_tag">优惠券</view>
|
<view class="deg_tag">优惠券</view>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view v-if=" this.res != null && Object.keys(res).length == 0">
|
<view v-if="this.res != null && Object.keys(res).length == 0"> 暂无促销信息 </view>
|
||||||
暂无促销信息
|
|
||||||
</view>
|
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -69,7 +84,6 @@ export default {
|
|||||||
handler() {
|
handler() {
|
||||||
if (this.res && this.res.length != 0 && this.res != null) {
|
if (this.res && this.res.length != 0 && this.res != null) {
|
||||||
Object.keys(this.res).forEach((item) => {
|
Object.keys(this.res).forEach((item) => {
|
||||||
|
|
||||||
let key = item.split("-")[0];
|
let key = item.split("-")[0];
|
||||||
this.res[item].__key = key;
|
this.res[item].__key = key;
|
||||||
|
|
||||||
|
|||||||
@@ -32,7 +32,7 @@
|
|||||||
{{ item.content.goodsName }}
|
{{ item.content.goodsName }}
|
||||||
</view>
|
</view>
|
||||||
<view class="item-price" v-if="item.price != undefined">
|
<view class="item-price" v-if="item.price != undefined">
|
||||||
¥<span class="item-price-blod">{{ formatPrice(item.content.price)[0] }}</span>.{{ formatPrice(item.content.price)[1] }}
|
¥<span class="item-price-blod">{{ $options.filters.goodsFormatPrice(item.content.price)[0] }}</span>.{{ $options.filters.goodsFormatPrice(item.content.price)[1] }}
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -48,13 +48,6 @@ export default {
|
|||||||
props: ["res", "goodsDetail", "storeDetail"],
|
props: ["res", "goodsDetail", "storeDetail"],
|
||||||
mounted() {},
|
mounted() {},
|
||||||
methods: {
|
methods: {
|
||||||
// 格式化金钱 1999 --> [1999,00]
|
|
||||||
formatPrice(val) {
|
|
||||||
if (typeof val == "undefined") {
|
|
||||||
return val;
|
|
||||||
}
|
|
||||||
return val.toFixed(2).split(".");
|
|
||||||
},
|
|
||||||
// 点击商品
|
// 点击商品
|
||||||
clickGoods(val) {
|
clickGoods(val) {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
|
|||||||
@@ -16,7 +16,22 @@ page {
|
|||||||
border-radius: 200px;
|
border-radius: 200px;
|
||||||
line-height: 18rpx;
|
line-height: 18rpx;
|
||||||
}
|
}
|
||||||
|
.header-title{
|
||||||
|
font-weight: bold;
|
||||||
|
color: #333;
|
||||||
|
text-align: center;
|
||||||
|
height: 90rpx;
|
||||||
|
line-height: 90rpx;
|
||||||
|
font-size: 34rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cuxiao-title{
|
||||||
|
color: #999;
|
||||||
|
font-size: 24rpx;
|
||||||
|
}
|
||||||
|
.cuxiao{
|
||||||
|
padding:16rpx 32rpx;
|
||||||
|
}
|
||||||
.detail-btn {
|
.detail-btn {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
@@ -56,7 +71,8 @@ page {
|
|||||||
font-size: 32rpx;
|
font-size: 32rpx;
|
||||||
}
|
}
|
||||||
.-goods-desc {
|
.-goods-desc {
|
||||||
padding: 36rpx 0 24rpx 0;
|
padding: 36rpx 0 0 0;
|
||||||
|
margin-bottom: 24rpx;
|
||||||
font-size: 24rpx;
|
font-size: 24rpx;
|
||||||
color: #666;
|
color: #666;
|
||||||
display: -webkit-box;
|
display: -webkit-box;
|
||||||
@@ -326,50 +342,6 @@ page {
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 弹出层 */
|
|
||||||
.popup {
|
|
||||||
position: fixed;
|
|
||||||
left: 0;
|
|
||||||
top: 0;
|
|
||||||
right: 0;
|
|
||||||
bottom: -1px;
|
|
||||||
z-index: 9;
|
|
||||||
background: rgba(0, 0, 0, 0.5);
|
|
||||||
|
|
||||||
.mask {
|
|
||||||
position: absolute;
|
|
||||||
left: 0;
|
|
||||||
top: 30%;
|
|
||||||
right: 0;
|
|
||||||
bottom: 0;
|
|
||||||
background: #fff;
|
|
||||||
|
|
||||||
.title {
|
|
||||||
position: relative;
|
|
||||||
height: 90rpx;
|
|
||||||
line-height: 90rpx;
|
|
||||||
font-size: 32rpx;
|
|
||||||
text-align: center;
|
|
||||||
border-bottom: 1px solid #f2f2f2;
|
|
||||||
|
|
||||||
span {
|
|
||||||
position: absolute;
|
|
||||||
right: 30rpx;
|
|
||||||
font-size: 40rpx;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.con-cuxiao {
|
|
||||||
padding: 30rpx 30rpx 0 30rpx;
|
|
||||||
|
|
||||||
> text {
|
|
||||||
font-size: 26rpx;
|
|
||||||
color: #999;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.u-mode-light-error {
|
.u-mode-light-error {
|
||||||
|
|||||||
157
pages/product/shopList.vue
Normal file
157
pages/product/shopList.vue
Normal file
@@ -0,0 +1,157 @@
|
|||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<u-navbar>
|
||||||
|
<u-search placeholder="请输入店铺名称" @search="search" @clear="search" @custom="search" v-model="params.storeName">
|
||||||
|
</u-search>
|
||||||
|
</u-navbar>
|
||||||
|
<div class="wrapper" v-if="storeList.length!=0">
|
||||||
|
<div class="store-item" @click="handleClickStore(item)" v-for="(item,index) in storeList" :key="index">
|
||||||
|
<div>
|
||||||
|
<u-image shape="circle" width="100" height="100" :src="item.storeLogo">
|
||||||
|
</u-image>
|
||||||
|
</div>
|
||||||
|
<div class="store-msg">
|
||||||
|
<div class="store-name">
|
||||||
|
{{item.storeName}}
|
||||||
|
</div>
|
||||||
|
<div class="goods-num">
|
||||||
|
商品 {{item.goodsNum}}
|
||||||
|
</div>
|
||||||
|
<div class="flex store-distance">
|
||||||
|
<div>
|
||||||
|
<span class="store-score">{{item.serviceScore | unitPrice}}</span>
|
||||||
|
<span class="line">|</span>
|
||||||
|
<span class="store-collection">收藏 {{item.collectionNum}}</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!--
|
||||||
|
#TODO 后续将和后端补充从此处
|
||||||
|
<div class="flex store-goods">
|
||||||
|
<div class="store-goods-item" v-for="i in 3" :key="i">
|
||||||
|
<div>
|
||||||
|
<u-image src="https://picsum.photos/id/341/200/200" border-radius="20" width="215rpx" height="215rpx">
|
||||||
|
</u-image>
|
||||||
|
</div>
|
||||||
|
<div class="price">
|
||||||
|
<span>
|
||||||
|
¥
|
||||||
|
<span class=" goods-price-bigshow">{{ formatPrice(16)[0] }}</span>
|
||||||
|
.{{ formatPrice(16)[1] }}
|
||||||
|
</span>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="wes">test</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
-->
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<u-empty style="margin-top:20%;" text="暂无店铺信息" v-else></u-empty>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { getStoreList } from "@/api/store";
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
keyword: "",
|
||||||
|
params: {
|
||||||
|
pageNumber: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
storeName: "",
|
||||||
|
},
|
||||||
|
storeList: [], // 店铺列表
|
||||||
|
};
|
||||||
|
},
|
||||||
|
onReachBottom() {
|
||||||
|
this.params.pageNumber++;
|
||||||
|
this.init();
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.init();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
handleClickStore(val){
|
||||||
|
uni.navigateTo({
|
||||||
|
url: `/pages/product/shopPage?id=${val.id}`
|
||||||
|
});
|
||||||
|
},
|
||||||
|
search() {
|
||||||
|
this.storeList = [];
|
||||||
|
this.init();
|
||||||
|
},
|
||||||
|
|
||||||
|
async init() {
|
||||||
|
let res = await getStoreList(this.params);
|
||||||
|
if (res.data.success) {
|
||||||
|
let data = res.data.result;
|
||||||
|
|
||||||
|
this.storeList.push(...data.records);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.wrapper {
|
||||||
|
padding: 0 16rpx;
|
||||||
|
}
|
||||||
|
.store-item {
|
||||||
|
display: flex;
|
||||||
|
background: #fff;
|
||||||
|
border-radius: 20rpx;
|
||||||
|
margin: 20rpx 0;
|
||||||
|
padding: 24rpx;
|
||||||
|
}
|
||||||
|
.store-msg {
|
||||||
|
margin-left: 20rpx;
|
||||||
|
}
|
||||||
|
.store-name {
|
||||||
|
font-weight: bold;
|
||||||
|
font-size: 30rpx;
|
||||||
|
}
|
||||||
|
.goods-num,
|
||||||
|
.store-collection {
|
||||||
|
color: #999;
|
||||||
|
font-size: 24rpx;
|
||||||
|
line-height: 1.5;
|
||||||
|
}
|
||||||
|
.store-goods {
|
||||||
|
margin: 20rpx 0;
|
||||||
|
}
|
||||||
|
.store-goods-item {
|
||||||
|
flex: 1;
|
||||||
|
overflow: hidden;
|
||||||
|
display: flex;
|
||||||
|
justify-content: flex-start;
|
||||||
|
flex-direction: column;
|
||||||
|
margin: 0 5rpx;
|
||||||
|
}
|
||||||
|
.wes {
|
||||||
|
margin: 10rpx 0;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
.store-score {
|
||||||
|
color: $light-color;
|
||||||
|
font-size: 24rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
.line {
|
||||||
|
margin: 0 6rpx;
|
||||||
|
color: #999;
|
||||||
|
}
|
||||||
|
.store-distance {
|
||||||
|
justify-content: space-between;
|
||||||
|
}
|
||||||
|
.price {
|
||||||
|
margin-top: 10rpx;
|
||||||
|
color: $main-color;
|
||||||
|
}
|
||||||
|
.goods-price-bigshow {
|
||||||
|
font-size: 34rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<u-navbar :border-bottom="false">
|
<u-navbar :border-bottom="false">
|
||||||
<u-search v-model="keyword" @search="search" @click="search" placeholder="请输入搜索"></u-search>
|
<u-search v-model="keyword" @custom='search' :show-action="true" action-text="搜索" :animation="true" @search="search" @click="search" placeholder="请输入搜索"></u-search>
|
||||||
</u-navbar>
|
</u-navbar>
|
||||||
<div class="wrapper">
|
<div class="wrapper">
|
||||||
<!-- 店铺信息模块 -->
|
<!-- 店铺信息模块 -->
|
||||||
@@ -58,20 +58,10 @@
|
|||||||
<!-- menu -->
|
<!-- menu -->
|
||||||
|
|
||||||
<!-- 商品 -->
|
<!-- 商品 -->
|
||||||
<div class="contant" v-if="current == 0">
|
<div class="content" v-if="current == 0">
|
||||||
<view v-if="!goodsList.length" class="empty">暂无商品信息</view>
|
|
||||||
<view v-else class="item" v-for="(item,index) in goodsList" :key="index" @click="navigateToGoodsDetail(item)">
|
<u-empty style='margin-top:100rpx' v-if="goodsList.length == 0" class="empty" text='暂无商品信息'></u-empty>
|
||||||
<u-image width="100%" height="330rpx" mode="aspectFit" :src="item.content.thumbnail">
|
<goodsTemplate v-else :res="goodsList" :storeName="false" />
|
||||||
<u-loading slot="loading"></u-loading>
|
|
||||||
</u-image>
|
|
||||||
<div class="name">{{ item.content.goodsName }}</div>
|
|
||||||
<div class="price">
|
|
||||||
<div>¥{{ item.content.price | unitPrice }}</div>
|
|
||||||
</div>
|
|
||||||
<view class="buyCount">
|
|
||||||
<div>已售 {{ item.content.buyCount || "0" }}</div>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</div>
|
</div>
|
||||||
<!-- 全部分类 -->
|
<!-- 全部分类 -->
|
||||||
<div class="category" v-if="current == 1">
|
<div class="category" v-if="current == 1">
|
||||||
@@ -84,7 +74,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<!-- 分类子级 -->
|
<!-- 分类子级 -->
|
||||||
<div class="child-list" v-if="item.children && item.children.length!=0">
|
<div class="child-list" v-if="item.children && item.children.length!=0">
|
||||||
<div class="child" @click="getCategoryGoodsList(child)" v-for="(child,i) in item.children">{{child.labelName}}
|
<div class="child" @click="getCategoryGoodsList(child)" :key='i' v-for="(child,i) in item.children">{{child.labelName}}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -95,6 +85,7 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { getStoreBaseInfo, getStoreCategory } from "@/api/store.js";
|
import { getStoreBaseInfo, getStoreCategory } from "@/api/store.js";
|
||||||
|
import goodsTemplate from '@/components/m-goods-list/list'
|
||||||
import {
|
import {
|
||||||
receiveCoupons,
|
receiveCoupons,
|
||||||
deleteStoreCollection,
|
deleteStoreCollection,
|
||||||
@@ -121,36 +112,38 @@ export default {
|
|||||||
couponList: [], //优惠券列表
|
couponList: [], //优惠券列表
|
||||||
categoryList: [],
|
categoryList: [],
|
||||||
couponParams: { pageNumber: 1, pageSize: 50, storeId: "" },
|
couponParams: { pageNumber: 1, pageSize: 50, storeId: "" },
|
||||||
goodsParams: { pageNumber: 1, pageSize: 50, storeId: "" },
|
goodsParams: { pageNumber: 1, pageSize: 10, storeId: "" },
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
current(val) {
|
current(val) {
|
||||||
val == 0 ? this.getGoodsData() : this.getCategoryData();
|
val == 0 ? ()=>{ this.goodsList = []; this.getGoodsData()} : this.getCategoryData();
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
components:{goodsTemplate},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 加载
|
* 加载
|
||||||
*/
|
*/
|
||||||
async onLoad(options) {
|
async onLoad(options) {
|
||||||
this.storeId = options.id;
|
this.storeId = options.id;
|
||||||
|
this.goodsParams.storeId = options.id;
|
||||||
|
this.couponParams.storeId = options.id;
|
||||||
},
|
},
|
||||||
onPageScroll(e) {
|
onPageScroll(e) {
|
||||||
this.scrollTop = e.scrollTop;
|
this.scrollTop = e.scrollTop;
|
||||||
},
|
},
|
||||||
onPullDownRefresh() {
|
onPullDownRefresh() {
|
||||||
|
this.init();
|
||||||
this.init();
|
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
// #ifdef MP-WEIXIN
|
// #ifdef MP-WEIXIN
|
||||||
// 小程序默认分享
|
// 小程序默认分享
|
||||||
uni.showShareMenu({ withShareTicket: true });
|
uni.showShareMenu({ withShareTicket: true });
|
||||||
// #endif
|
// #endif
|
||||||
this.init();
|
this.init();
|
||||||
},
|
},
|
||||||
|
|
||||||
// 下拉加载
|
// 下拉加载
|
||||||
onReachBottom() {
|
onReachBottom() {
|
||||||
this.goodsParams.pageNumber++;
|
this.goodsParams.pageNumber++;
|
||||||
@@ -187,30 +180,34 @@ export default {
|
|||||||
* 联系客服
|
* 联系客服
|
||||||
*/
|
*/
|
||||||
linkKefuDetail() {
|
linkKefuDetail() {
|
||||||
// 客服
|
// // 客服
|
||||||
// #ifdef MP-WEIXIN
|
// // #ifdef MP-WEIXIN
|
||||||
|
|
||||||
const params = {
|
// const params = {
|
||||||
// originalPrice: this.goodsDetail.original || this.goodsDetail.price,
|
// // originalPrice: this.goodsDetail.original || this.goodsDetail.price,
|
||||||
uuid: storage.getUuid(),
|
// uuid: storage.getUuid(),
|
||||||
token: storage.getAccessToken(),
|
// token: storage.getAccessToken(),
|
||||||
sign: this.storeInfo.yzfSign,
|
// sign: this.storeInfo.yzfSign,
|
||||||
mpSign: this.storeInfo.yzfMpSign,
|
// mpSign: this.storeInfo.yzfMpSign,
|
||||||
};
|
// };
|
||||||
uni.navigateTo({
|
// uni.navigateTo({
|
||||||
url:
|
// url:
|
||||||
"/pages/product/customerservice/index?params=" +
|
// "/pages/product/customerservice/index?params=" +
|
||||||
encodeURIComponent(JSON.stringify(params)),
|
// encodeURIComponent(JSON.stringify(params)),
|
||||||
});
|
// });
|
||||||
// #endif
|
// // #endif
|
||||||
// #ifndef MP-WEIXIN
|
// // #ifndef MP-WEIXIN
|
||||||
const sign = this.storeInfo.yzfSign;
|
// const sign = this.storeInfo.yzfSign;
|
||||||
uni.navigateTo({
|
// uni.navigateTo({
|
||||||
url:
|
// url:
|
||||||
"/pages/tabbar/home/web-view?src=https://yzf.qq.com/xv/web/static/chat/index.html?sign=" +
|
// "/pages/tabbar/home/web-view?src=https://yzf.qq.com/xv/web/static/chat/index.html?sign=" +
|
||||||
sign,
|
// sign,
|
||||||
});
|
// });
|
||||||
// #endif
|
// // #endif
|
||||||
|
|
||||||
|
uni.navigateTo({
|
||||||
|
url: `/pages/tabbar/home/web-view?IM=${this.storeId}`,
|
||||||
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
/** 获取店铺分类 */
|
/** 获取店铺分类 */
|
||||||
@@ -239,6 +236,7 @@ export default {
|
|||||||
* 搜索
|
* 搜索
|
||||||
*/
|
*/
|
||||||
search() {
|
search() {
|
||||||
|
console.log("点击")
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: `/pages/navigation/search/searchPage?storeId=${this.storeId}&keyword=${this.keyword}`,
|
url: `/pages/navigation/search/searchPage?storeId=${this.storeId}&keyword=${this.keyword}`,
|
||||||
});
|
});
|
||||||
@@ -264,6 +262,7 @@ export default {
|
|||||||
let res = await getGoodsList(this.goodsParams);
|
let res = await getGoodsList(this.goodsParams);
|
||||||
if (res.data.success) {
|
if (res.data.success) {
|
||||||
this.goodsList.push(...res.data.result.content);
|
this.goodsList.push(...res.data.result.content);
|
||||||
|
console.log(this.goodsList)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -276,15 +275,6 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
|
||||||
* 跳转到商品详情
|
|
||||||
*/
|
|
||||||
navigateToGoodsDetail(val) {
|
|
||||||
uni.navigateTo({
|
|
||||||
url: `/pages/product/goods?id=${val.content.id}&goodsId=${val.content.goodsId}`,
|
|
||||||
});
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 是否收藏
|
* 是否收藏
|
||||||
*/
|
*/
|
||||||
@@ -392,54 +382,17 @@ export default {
|
|||||||
color: #999;
|
color: #999;
|
||||||
}
|
}
|
||||||
|
|
||||||
.contant {
|
.content {
|
||||||
margin-top: 20rpx;
|
margin-top: 20rpx;
|
||||||
display: flex;
|
// display: flex;
|
||||||
flex-wrap: wrap;
|
// flex-wrap: wrap;
|
||||||
justify-content: space-between;
|
// justify-content: space-between;
|
||||||
> .empty {
|
> .empty {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
margin-top: 40rpx;
|
margin-top: 40rpx;
|
||||||
}
|
}
|
||||||
.item {
|
|
||||||
overflow: hidden;
|
|
||||||
|
|
||||||
background: #fff;
|
|
||||||
width: 49%;
|
|
||||||
height: 484rpx;
|
|
||||||
font-size: 26rpx;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
border: 1px solid #f8f8f8;
|
|
||||||
margin-bottom: 20rpx;
|
|
||||||
|
|
||||||
.name {
|
|
||||||
text-align: left !important;
|
|
||||||
color: #333;
|
|
||||||
padding: 0 20rpx;
|
|
||||||
margin-top: 20rpx;
|
|
||||||
line-height: 1.4em;
|
|
||||||
max-height: 2.8em; //height是line-height的整数倍,防止文字显示不全
|
|
||||||
overflow: hidden;
|
|
||||||
}
|
|
||||||
.price {
|
|
||||||
font-weight: 500;
|
|
||||||
color: $main-color;
|
|
||||||
font-size: 30rpx;
|
|
||||||
padding: 0 20rpx;
|
|
||||||
margin-top: 20rpx;
|
|
||||||
white-space: nowrap;
|
|
||||||
}
|
|
||||||
.buyCount {
|
|
||||||
display: flex;
|
|
||||||
padding: 0 20rpx;
|
|
||||||
font-size: 24upx;
|
|
||||||
justify-content: space-between;
|
|
||||||
color: #999;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
.discount {
|
.discount {
|
||||||
height: 154rpx;
|
height: 154rpx;
|
||||||
|
|||||||
@@ -1,129 +1,77 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<u-navbar :title="title"></u-navbar>
|
<u-navbar :title="title"></u-navbar>
|
||||||
<!-- 商品 -->
|
<!-- 商品 -->
|
||||||
<div class="contant">
|
<div class="contant">
|
||||||
<view v-if="!goodsList.length" class="empty">暂无商品信息</view>
|
<view v-if="!goodsList.length" class="empty">暂无商品信息</view>
|
||||||
<view v-else class="item" v-for="(item,index) in goodsList" :key="index" @click="navigateToGoodsDetail(item)">
|
<goodsTemplate :res='goodsList' :storeName='false' />
|
||||||
<u-image width="100%" mode="aspectFit" height="324rpx" :src="item.content.thumbnail">
|
</div>
|
||||||
<u-loading slot="loading"></u-loading>
|
</div>
|
||||||
</u-image>
|
|
||||||
<div class="name">{{ item.content.goodsName }}</div>
|
</template>
|
||||||
<div class="price">
|
|
||||||
<div>¥{{ item.content.price | unitPrice }}</div>
|
<script>
|
||||||
</div>
|
import {
|
||||||
<view class="buyCount">
|
getGoodsList
|
||||||
<div>已售 {{ item.buyCount || "0" }}</div>
|
} from "@/api/goods.js";
|
||||||
</view>
|
import goodsTemplate from '@/components/m-goods-list/list'
|
||||||
</view>
|
export default {
|
||||||
</div>
|
data() {
|
||||||
</div>
|
return {
|
||||||
|
title: "",
|
||||||
</template>
|
routerVal: "",
|
||||||
|
goodsList: [],
|
||||||
<script>
|
params: {
|
||||||
import { getGoodsList } from "@/api/goods.js";
|
pageNumber: 1,
|
||||||
export default {
|
pageSize: 10,
|
||||||
data() {
|
keyword: "",
|
||||||
return {
|
storeCatId: "",
|
||||||
title: "",
|
storeId: "",
|
||||||
routerVal: "",
|
},
|
||||||
goodsList: [],
|
};
|
||||||
params: {
|
},
|
||||||
pageNumber: 1,
|
components: {
|
||||||
pageSize: 10,
|
goodsTemplate
|
||||||
|
},
|
||||||
order: "desc",
|
onLoad(options) {
|
||||||
keyword: "",
|
this.routerVal = options;
|
||||||
storeCatId: "",
|
this.params.storeId = options.storeId;
|
||||||
storeId: "",
|
this.params.storeCatId = options.id;
|
||||||
},
|
this.title = options.title;
|
||||||
};
|
},
|
||||||
},
|
onShow() {
|
||||||
onLoad(options) {
|
this.goodsList = []
|
||||||
this.routerVal = options;
|
this.params.pageNumber = 1;
|
||||||
this.params.storeId = options.storeId;
|
this.getGoodsData();
|
||||||
this.params.storeCatId = options.id;
|
},
|
||||||
this.title = options.title;
|
onReachBottom() {
|
||||||
},
|
this.params.pageNumber++;
|
||||||
onShow() {
|
this.getGoodsData();
|
||||||
this.goodsList =[]
|
},
|
||||||
this.params.pageNumber = 1;
|
methods: {
|
||||||
this.getGoodsData();
|
async getGoodsData() {
|
||||||
},
|
// #TODO
|
||||||
onReachBottom(){
|
let goodsList = await getGoodsList(this.params);
|
||||||
this.params.pageNumber ++;
|
if (goodsList.data.success) {
|
||||||
this.getGoodsData();
|
this.goodsList.push(...goodsList.data.result.content);
|
||||||
},
|
}
|
||||||
methods: {
|
},
|
||||||
/**
|
},
|
||||||
* 跳转到商品详情
|
};
|
||||||
*/
|
</script>
|
||||||
navigateToGoodsDetail(val) {
|
|
||||||
uni.navigateTo({
|
<style lang="scss" scoped>
|
||||||
url: `/pages/product/goods?id=${val.content.id}&goodsId=${val.content.goodsId}`,
|
.contant {
|
||||||
});
|
margin-top: 20rpx;
|
||||||
},
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
async getGoodsData() {
|
justify-content: space-between;
|
||||||
// #TODO
|
|
||||||
let goodsList = await getGoodsList(this.params);
|
>.empty {
|
||||||
if (goodsList.data.success) {
|
width: 100%;
|
||||||
this.goodsList.push(...goodsList.data.result.content);
|
display: flex;
|
||||||
}
|
justify-content: center;
|
||||||
},
|
margin-top: 40rpx;
|
||||||
},
|
}
|
||||||
};
|
}
|
||||||
</script>
|
</style>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
.contant {
|
|
||||||
margin-top: 20rpx;
|
|
||||||
display: flex;
|
|
||||||
flex-wrap: wrap;
|
|
||||||
justify-content: space-between;
|
|
||||||
> .empty {
|
|
||||||
width: 100%;
|
|
||||||
display: flex;
|
|
||||||
justify-content: center;
|
|
||||||
margin-top: 40rpx;
|
|
||||||
}
|
|
||||||
.item {
|
|
||||||
overflow: hidden;
|
|
||||||
|
|
||||||
background: #fff;
|
|
||||||
width: 49%;
|
|
||||||
height: 484rpx;
|
|
||||||
font-size: 26rpx;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
border: 1px solid #f8f8f8;
|
|
||||||
margin-bottom: 20rpx;
|
|
||||||
|
|
||||||
.name {
|
|
||||||
text-align: left !important;
|
|
||||||
color: #333;
|
|
||||||
padding: 0 20rpx;
|
|
||||||
margin-top: 20rpx;
|
|
||||||
line-height: 1.4em;
|
|
||||||
max-height: 2.8em; //height是line-height的整数倍,防止文字显示不全
|
|
||||||
overflow: hidden;
|
|
||||||
}
|
|
||||||
.price {
|
|
||||||
font-weight: 500;
|
|
||||||
color: $main-color;
|
|
||||||
font-size: 30rpx;
|
|
||||||
padding: 0 20rpx;
|
|
||||||
margin-top: 20rpx;
|
|
||||||
white-space: nowrap;
|
|
||||||
}
|
|
||||||
.buyCount {
|
|
||||||
display: flex;
|
|
||||||
padding: 0 20rpx;
|
|
||||||
font-size: 24upx;
|
|
||||||
justify-content: space-between;
|
|
||||||
color: #999;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user