@@ -613,17 +489,18 @@ export default {
},
data() {
return {
- typeList:[],
- showPrices:false,
- printHiddenFlag:false,//隐藏信息
- printInfoObj:{
+ typeList: [],
+ showPrices: false,
+ printHiddenFlag: false,//隐藏信息
+ printInfoObj: {
id: "printInfo",//要打印的id名 无#号
- popTitle:' ',//页眉标题 默认浏览器标题 空字符串时显示undefined 使用html语言
- extraHead:'',//头部文字 默认空
+ popTitle: ' ',//页眉标题 默认浏览器标题 空字符串时显示undefined 使用html语言
+ extraHead: '',//头部文字 默认空
},
submitLoading: false, // 添加或编辑提交状态
region: [], //地区
regionId: [], //地区id
+ logisticsType: 'KUAIDINIAO', //物流类型
showRegion: false,
someJSONdata: '',
faceSheetForm: {
@@ -631,7 +508,7 @@ export default {
},
faceSheetFormValidate: {
logisticsId: [
- { required: true, message: "请选择物流公司"},
+ { required: true, message: "请选择物流公司" },
],
},
facesheetFlag: false, //电子面单标识
@@ -652,7 +529,7 @@ export default {
},
},
modal: false, //弹出调整价格框
- printModal:false,//弹出打印发货单
+ printModal: false,//弹出打印发货单
//调整价格表单
modifyPriceForm: {
orderPrice: 0,
@@ -826,13 +703,13 @@ export default {
this.orderTakeModal = true;
},
//打印发货单
- printOrder(){
+ printOrder() {
this.printModal = true;
},
- printHiddenInfo(){
+ printHiddenInfo() {
this.printHiddenFlag = !this.printHiddenFlag;
},
- printCancel(){
+ printCancel() {
// this.printHiddenFlag = false;
},
//订单核销提交
@@ -851,28 +728,28 @@ export default {
}
});
},
- getOrderPrice(){
- if(this.showPrices){
+ getOrderPrice() {
+ if (this.showPrices) {
this.showPrices = false
- }else if(!this.showPrices){
+ } else if (!this.showPrices) {
this.showPrices = true
}
},
- getContentPrice(){
- for (let i = 0; i < this.typeList.length; i++) {
- for (let j = i + 1; j < this.typeList.length; j++) {
- if (this.typeList[i].promotionId === this.typeList[j].promotionId) {
- this.typeList[i].discountPrice = this.typeList[i].discountPrice + this.typeList[j].discountPrice
- this.typeList.splice(j, 1)
- }
+ getContentPrice() {
+ for (let i = 0; i < this.typeList.length; i++) {
+ for (let j = i + 1; j < this.typeList.length; j++) {
+ if (this.typeList[i].promotionId === this.typeList[j].promotionId) {
+ this.typeList[i].discountPrice = this.typeList[i].discountPrice + this.typeList[j].discountPrice
+ this.typeList.splice(j, 1)
}
}
- console.log(this.typeList)
- if(this.typeList.length >= 3){
- console.log(123123)
- this.getContentPrice()
- }
- },
+ }
+ console.log(this.typeList)
+ if (this.typeList.length >= 3) {
+ console.log(123123)
+ this.getContentPrice()
+ }
+ },
//获取订单详细信息
getDataDetail() {
this.loading = true;
@@ -889,7 +766,7 @@ export default {
}
});
},
- Toprint(){
+ Toprint() {
this.facesheetFlag = true;
API_Logistics.getCheckedOn().then(res => {
if (res.success) {
@@ -937,35 +814,83 @@ export default {
//订单发货
orderDeliver() {
this.facesheetFlag = false
- API_Order.getLogisticsChecked().then((res) => {
- if (res.success) {
- this.checkedLogistics = res.result;
- this.orderDeliverModal = true;
- }
- });
+ if (this.logisticsType == 'SHUNFENG') {
+ this.$Modal.confirm({
+ title: "确认发货",
+ content: "您确认使用顺丰发货 " + this.sn + " 订单?",
+ loading: true,
+ onOk: () => {
+ API_Order.orderShunFengDelivery(this.sn).then((res) => {
+ if (res.success) {
+ this.$Modal.remove();
+ this.$Message.success("订单发货成功");
+ this.getDataDetail()
+ }
+ })
+ }
+ })
+ } else {
+ API_Order.getLogisticsChecked().then((res) => {
+ if (res.success) {
+ this.checkedLogistics = res.result;
+ this.orderDeliverModal = true;
+ }
+ });
+ }
},
- Toprints(){
- if(this.form.logisticsId != null && this.form.logisticsId != ''){
+ //顺丰打印面单
+ sfPrint() {
+ API_Order.getOrderFaceSheet(this.sn, this.faceSheetForm).then(res => {
+ if (res.success) {
+ let headers = {
+ 'X-Auth-token': res.result.token
+ }
+ API_Logistics.getShunFengFaceSheet(res.result.url, headers).then(res => {
+ const blob = new Blob([res], {
+ type: "application/pdf;charset=utf-8",
+ });
+ console.log("出发blob");
+ //对于
标签,只有 Firefox 和 Chrome(内核) 支持 download 属性
+ //IE10以上支持blob但是依然不支持download
+ if ("download" in document.createElement("a")) {
+ //支持a标签download的浏览器
+ const link = document.createElement("a"); //创建a标签
+ link.download = this.orderInfo.order.sn + ".pdf"; //a标签添加属性
+ link.style.display = "none";
+ link.href = URL.createObjectURL(blob);
+ document.body.appendChild(link);
+ link.click(); //执行下载
+ URL.revokeObjectURL(link.href); //释放url
+ document.body.removeChild(link); //释放标签
+ } else {
+ navigator.msSaveBlob(blob, fileName);
+ }
+ })
+ }
+ })
+ },
+ Toprints() {
+ if (this.form.logisticsId != null && this.form.logisticsId != '') {
this.orderDeliverModal = false;
}
},
//订单发货提交
orderDeliverySubmit() {
- if(this.facesheetFlag){
+ if (this.facesheetFlag) {
this.$refs['faceSheetForm'].validate((valid) => {
if (valid) {
API_Order.getOrderFaceSheet(this.sn, this.faceSheetForm).then(res => {
if (res.success) {
- this.someJSONdata = res.result;
+ this.someJSONdata = res.result.printTemplate;
this.Toprints();
}
})
}
})
- }else{
+ } else {
this.$refs['orderDeliveryForm'].validate((valid) => {
if (valid) {
- API_Order.orderDelivery(this.sn,this.orderDeliveryForm).then(
+ API_Order.orderDelivery(this.sn, this.orderDeliveryForm).then(
(res) => {
if (res.success) {
this.$Message.success("订单发货成功");
@@ -1014,14 +939,24 @@ export default {
}
});
},
+
+ getLogisticsSetting() {
+ API_Logistics.getLogisticsSetting().then(res => {
+ if (res.success) {
+ this.logisticsType = res.result;
+ }
+ })
+ },
+
},
mounted() {
this.sn = this.$route.query.sn;
this.getDataDetail();
+ this.getLogisticsSetting();
},
// 如果是从详情页返回列表页,修改列表页keepAlive为true,确保不刷新页面
- beforeRouteLeave(to, from, next){
- if(to.name === 'orderList' || to.name === 'virtualOrderList') {
+ beforeRouteLeave(to, from, next) {
+ if (to.name === 'orderList' || to.name === 'virtualOrderList') {
to.meta.keepAlive = true
}
next()
@@ -1031,9 +966,10 @@ export default {
From 7d0b3c6908d46f82a285d5206ef165ea6488406f Mon Sep 17 00:00:00 2001
From: chc <1501738723@qq.com>
Date: Wed, 8 Mar 2023 10:25:23 +0800
Subject: [PATCH 3/7] =?UTF-8?q?feat:=20:sparkles:=20=E5=95=86=E5=AE=B6?=
=?UTF-8?q?=E7=AB=AF=E5=A2=9E=E5=8A=A0=E4=BF=AE=E6=94=B9=E5=AF=86=E7=A0=81?=
=?UTF-8?q?,=E6=89=8B=E6=9C=BA=E5=8F=B7=E7=99=BB=E5=BD=95?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
seller/src/api/common.js | 9 +-
seller/src/api/index.js | 14 +-
seller/src/router/index.js | 23 +-
seller/src/router/router.js | 7 +-
seller/src/views/ForgetPassword.vue | 331 ++++++++++++++++++++++++++++
seller/src/views/login.vue | 229 +++++++++++++------
6 files changed, 529 insertions(+), 84 deletions(-)
create mode 100644 seller/src/views/ForgetPassword.vue
diff --git a/seller/src/api/common.js b/seller/src/api/common.js
index 0b024239..5951ab3f 100644
--- a/seller/src/api/common.js
+++ b/seller/src/api/common.js
@@ -1,4 +1,4 @@
-import { commonUrl, getRequest, uploadFileRequest ,uploadFile} from "@/libs/axios";
+import { commonUrl, getRequest, uploadFileRequest, uploadFile, request} from "@/libs/axios";
// 通过id获取子地区
export const getChildRegion = (id) => {
@@ -25,3 +25,10 @@ export const upLoadFileMethods = (bold) => {
console.log(bold)
return uploadFileRequest(uploadFile, bold);
};
+
+/**
+ * 发送短信验证码
+ */
+export function sendSms (params) {
+ return getRequest(`${commonUrl}/common/common/sms/${params.verificationEnums}/${params.mobile}`,params);
+}
diff --git a/seller/src/api/index.js b/seller/src/api/index.js
index 38e125cc..3c124882 100644
--- a/seller/src/api/index.js
+++ b/seller/src/api/index.js
@@ -37,6 +37,11 @@ export const login = params => {
return postRequestWithNoTokenData("/passport/login/userLogin", params);
};
+// 手机登陆
+export const storeSmsLogin = params => {
+ return postRequestWithNoToken("/passport/login/smsLogin", params);
+};
+
// 登出
export const logout = () => {
return postRequest("/passport/login/logout");
@@ -50,7 +55,10 @@ export const userInfo = params => {
export const userMsg = params => {
return getRequest('/settings/storeSettings', params)
}
-
+//验证短信验证码
+export const validateCode = params => {
+ return postRequestWithNoToken("/passport/login/resetByMobile", params);
+};
// 初始化验证码
export const initCaptcha = params => {
return getRequestWithNoToken("/common/captcha/init", params);
@@ -107,6 +115,10 @@ export const sendCodeEmail = (email, params) => {
export const editEmail = params => {
return postRequest("/email/editEmail", params);
};
+// 忘记密码并修改
+export const forgetAndModify = params => {
+ return postRequest("/passport/login/resetPassword", params);
+};
// 个人中心修改密码
export const changePass = params => {
return postRequest("/passport/login/modifyPass", params);
diff --git a/seller/src/router/index.js b/seller/src/router/index.js
index 176eb936..7ab1a445 100644
--- a/seller/src/router/index.js
+++ b/seller/src/router/index.js
@@ -3,7 +3,7 @@ import ViewUI from 'view-design';
import Util from '../libs/util';
import VueRouter from 'vue-router';
import Cookies from 'js-cookie';
-import {routers} from './router';
+import { routers } from './router';
Vue.use(VueRouter);
@@ -16,10 +16,10 @@ const RouterConfig = {
/**
* 解决重复点击菜单会控制台报错bug
*/
- const routerPush = VueRouter.prototype.push
- VueRouter.prototype.push = function push(location) {
- return routerPush.call(this, location).catch(error=> error)
- }
+const routerPush = VueRouter.prototype.push
+VueRouter.prototype.push = function push(location) {
+ return routerPush.call(this, location).catch(error => error)
+}
export const router = new VueRouter(RouterConfig);
@@ -32,10 +32,15 @@ router.beforeEach((to, from, next) => {
const name = to.name;
if (!Cookies.get('userInfoSeller') && name !== 'login') {
- // 判断是否已经登录且前往的页面不是登录页
- next({
- name: 'login'
- });
+ if (name === 'forgetPassword') {
+ console.log(name)
+ Util.toDefaultPage([...routers], name, router, next);
+ } else {
+ // 判断是否已经登录且前往的页面不是登录页
+ next({
+ name: 'login'
+ });
+ }
} else if (Cookies.get('userInfoSeller') && name === 'login') {
// 判断是否已经登录且前往的是登录页
Util.title();
diff --git a/seller/src/router/router.js b/seller/src/router/router.js
index 61acc146..e47bb194 100644
--- a/seller/src/router/router.js
+++ b/seller/src/router/router.js
@@ -10,6 +10,11 @@ export const loginRouter = {
},
component: () => import("@/views/login.vue")
};
+export const forgetPasswordRouter = {
+ path: "/forgetPassword",
+ name: "forgetPassword",
+ component: () => import("@/views/ForgetPassword.vue")
+};
// 作为Main组件的子页面展示但是不在左侧菜单显示的路由写在otherRouter里
export const otherRouter = {
@@ -193,4 +198,4 @@ export const page500 = {
component: () => import("@/views/error-page/500.vue")
};
// 所有上面定义的路由都要写在下面的routers里
-export const routers = [loginRouter, otherRouter, page500, page403];
+export const routers = [loginRouter, forgetPasswordRouter, otherRouter, page500, page403];
diff --git a/seller/src/views/ForgetPassword.vue b/seller/src/views/ForgetPassword.vue
new file mode 100644
index 00000000..8c706cc8
--- /dev/null
+++ b/seller/src/views/ForgetPassword.vue
@@ -0,0 +1,331 @@
+
+
+
+
+
+
+
修改密码
+
+
+
+
+
+
+
+
+
diff --git a/seller/src/views/login.vue b/seller/src/views/login.vue
index e46cbc8e..64b05c3c 100644
--- a/seller/src/views/login.vue
+++ b/seller/src/views/login.vue
@@ -2,59 +2,58 @@
-
-
-
-
-
-
-
登录
-
登录中
+
+
+
+
+
+
+
-
+
+
+
+
+
+
+
+
+ 登录
+ 登录中
+
-
-
-
+
+
+
+
@@ -62,7 +61,8 @@
@@ -184,12 +265,14 @@ export default {
display: flex;
align-items: center;
justify-content: center;
+
.verify-con {
position: absolute;
top: 126px;
z-index: 10;
left: 20px;
}
+
.form {
padding-top: 1vh;
}
@@ -208,9 +291,11 @@ export default {
text-align: center;
transition: 0.35s;
}
+
.login-btn:hover {
opacity: 0.9;
border-radius: 10px;
}
+
}
From f4ddeaa5c5884a8a0f40bebd3239c2c10539d8c4 Mon Sep 17 00:00:00 2001
From: 17600048398 <277692624@qq.com>
Date: Thu, 9 Mar 2023 18:16:10 +0800
Subject: [PATCH 4/7] =?UTF-8?q?=E5=89=8D=E7=AB=AF=E9=97=AE=E9=A2=98?=
=?UTF-8?q?=E5=A4=84=E7=90=86?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
buyer/src/api/member.js | 45 +++++++++++++++++--
buyer/src/pages/GoodsDetail.vue | 12 ++---
buyer/src/pages/Merchant.vue | 6 +--
.../src/pages/home/memberCenter/Favorites.vue | 30 ++++++++++---
manager/src/views/member/list/index.vue | 5 ++-
manager/src/views/seller/shop/shopDetail.vue | 12 ++++-
seller/src/api/logistics.js | 2 +-
7 files changed, 90 insertions(+), 22 deletions(-)
diff --git a/buyer/src/api/member.js b/buyer/src/api/member.js
index 301b7414..eeb7de21 100644
--- a/buyer/src/api/member.js
+++ b/buyer/src/api/member.js
@@ -59,7 +59,7 @@ export function withdrawalApply (params) {
});
}
-// 收藏商品、店铺
+// 收藏商品
export function collectGoods (type, id) {
return request({
url: `/buyer/member/collection/add/${type}/${id}`,
@@ -68,7 +68,16 @@ export function collectGoods (type, id) {
});
}
-// 取消 收藏商品、店铺
+// 收藏店铺
+export function collectStore (type, id) {
+ return request({
+ url: `/buyer/member/storeCollection/add/${type}/${id}`,
+ method: Method.POST,
+ needToken: true
+ });
+}
+
+// 取消 收藏商品
export function cancelCollect (type, id) {
return request({
url: `/buyer/member/collection/delete/${type}/${id}`,
@@ -77,7 +86,16 @@ export function cancelCollect (type, id) {
});
}
-// 查看是否收藏
+// 取消 收藏店铺
+export function cancelStoreCollect (type, id) {
+ return request({
+ url: `/buyer/member/storeCollection/delete/${type}/${id}`,
+ method: Method.DELETE,
+ needToken: true
+ });
+}
+
+// 查看是否收藏商品
export function isCollection (type, goodsId) {
return request({
url: `/buyer/member/collection/isCollection/${type}/${goodsId}`,
@@ -86,7 +104,16 @@ export function isCollection (type, goodsId) {
});
}
-// 会员收藏列表
+// 查看是否收藏店铺
+export function isStoreCollection (type, goodsId) {
+ return request({
+ url: `/buyer/member/storeCollection/isCollection/${type}/${goodsId}`,
+ method: Method.GET,
+ needToken: true
+ });
+}
+
+// 会员收藏商品列表
export function collectList (params) {
return request({
url: `/buyer/member/collection/${params.type}`,
@@ -96,6 +123,16 @@ export function collectList (params) {
});
}
+// 会员收藏店铺列表
+export function storeCollectList (params) {
+ return request({
+ url: `/buyer/member/storeCollection/${params.type}`,
+ method: Method.GET,
+ needToken: true,
+ params
+ });
+}
+
// 单个商品评价
export function goodsComment (params) {
return request({
diff --git a/buyer/src/pages/GoodsDetail.vue b/buyer/src/pages/GoodsDetail.vue
index 14870db6..63a421f0 100644
--- a/buyer/src/pages/GoodsDetail.vue
+++ b/buyer/src/pages/GoodsDetail.vue
@@ -44,9 +44,9 @@ import ShowGoods from "@/components/goodsDetail/ShowGoods";
import ShowGoodsDetail from "@/components/goodsDetail/ShowGoodsDetail";
import { goodsSkuDetail } from "@/api/goods";
import {
- cancelCollect,
- collectGoods,
- isCollection,
+ cancelStoreCollect,
+ collectStore,
+ isStoreCollection,
getGoodsDistribution,
} from "@/api/member";
import { getDetailById } from "@/api/shopentry";
@@ -121,7 +121,7 @@ export default {
this.$set(this, "goodsMsg", res.result);
// 判断是否收藏
if (this.Cookies.getItem("userInfo")) {
- isCollection("STORE", this.goodsMsg.data.storeId).then((res) => {
+ isStoreCollection("STORE", this.goodsMsg.data.storeId).then((res) => {
if (res.success && res.result) {
this.storeCollected = true;
}
@@ -159,13 +159,13 @@ export default {
async collect () {
// 收藏店铺
if (this.storeCollected) {
- let cancel = await cancelCollect("STORE", this.goodsMsg.data.storeId);
+ let cancel = await cancelStoreCollect("STORE", this.goodsMsg.data.storeId);
if (cancel.success) {
this.$Message.success("已取消收藏");
this.storeCollected = false;
}
} else {
- let collect = await collectGoods("STORE", this.goodsMsg.data.storeId);
+ let collect = await collectStore("STORE", this.goodsMsg.data.storeId);
if (collect.code === 200) {
this.storeCollected = true;
this.$Message.success("收藏店铺成功,可以前往个人中心我的收藏查看");
diff --git a/buyer/src/pages/Merchant.vue b/buyer/src/pages/Merchant.vue
index 3cf82442..773d8ac8 100644
--- a/buyer/src/pages/Merchant.vue
+++ b/buyer/src/pages/Merchant.vue
@@ -108,7 +108,7 @@