From 42b61fbfa135fff78f40f0eae446550b2b77645b Mon Sep 17 00:00:00 2001 From: YeMingfei666 <1619116647@qq.com> Date: Mon, 2 Dec 2024 09:35:07 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=8A=96=E9=9F=B3=E7=BE=8E?= =?UTF-8?q?=E5=9B=A2=E6=A0=B8=E9=94=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/coup/index.js | 40 +- src/utils/request-php.js | 38 +- src/views/login.vue | 8 +- src/views/order_manage/douyin_list.vue | 238 ++++++++++++ .../Instead/components/choose-quan-goods.vue | 161 ++++++++ .../components/douyin-quan-bind-shop.vue | 234 ++++++++++++ .../Instead/components/popup-quan-hexiao.vue | 225 ++++++++++++ .../Instead/components/popup-weight-goods.vue | 343 ++++++++++++++++++ src/views/tool/Instead/index.vue | 55 ++- 9 files changed, 1317 insertions(+), 25 deletions(-) create mode 100644 src/views/order_manage/douyin_list.vue create mode 100644 src/views/tool/Instead/components/choose-quan-goods.vue create mode 100644 src/views/tool/Instead/components/douyin-quan-bind-shop.vue create mode 100644 src/views/tool/Instead/components/popup-quan-hexiao.vue create mode 100644 src/views/tool/Instead/components/popup-weight-goods.vue diff --git a/src/api/coup/index.js b/src/api/coup/index.js index 9ba574a..246fff7 100644 --- a/src/api/coup/index.js +++ b/src/api/coup/index.js @@ -1,13 +1,17 @@ // 代客下单 import request from "@/utils/request-php"; - +import { getToken } from '@/utils/auth' +function getLoginName() { + const obj = localStorage.getItem("userInfo") || ''; + const { username } = obj ? JSON.parse(obj) : {}; + return username +} // 抖音团购核销准备 export function $douyin_fulfilmentcertificateprepare(data) { return request({ url: 'douyin/fulfilmentcertificateprepare', method: "post", data: { - shopId: localStorage.getItem("shopId"), ...data } }); @@ -18,7 +22,7 @@ export function $douyin_certificateprepare(data) { url: 'douyin/certificateprepare', method: "post", data: { - shopId: localStorage.getItem("shopId"), + ...data } }); @@ -30,7 +34,6 @@ export function $douyin_fulfilmentcertificatecancel(data) { url: 'douyin/fulfilmentcertificatecancel', method: "post", data: { - shopId: localStorage.getItem("shopId"), ...data } }); @@ -41,7 +44,7 @@ export function $douyin_orderlist(data) { url: 'douyin/orderlist', method: "post", data: { - shopId: localStorage.getItem("shopId"), + ...data } }); @@ -54,7 +57,7 @@ export function $douyin_storelist(data) { url: 'douyin/storelist', method: "post", data: { - shopId: localStorage.getItem("shopId"), + ...data } }); @@ -66,7 +69,7 @@ export function $douyin_bindstore(data) { url: 'douyin/bindstore', method: "post", data: { - shopId: localStorage.getItem("shopId"), + ...data } }); @@ -78,7 +81,7 @@ export function $douyin_orderquery(data) { url: 'douyin/orderquery', method: "post", data: { - shopId: localStorage.getItem("shopId"), + ...data } }); @@ -89,7 +92,10 @@ export function $douyin_checkIn(data) { url: 'douyin/checkIn', method: "post", data: { - shopId: localStorage.getItem("shopId"), + clientType: 'ADMIN', + token: getToken(), + loginName: getLoginName(), + ...data } }); @@ -104,7 +110,7 @@ export function $meituan_getuisdkurl(data) { url: 'meituan/getuisdkurl', method: "post", data: { - shopId: localStorage.getItem("shopId"), + ...data } }); @@ -116,7 +122,7 @@ export function $meituan_getuisdkuniurl(data) { url: 'meituan/getuisdkuniurl', method: "post", data: { - shopId: localStorage.getItem("shopId"), + ...data } }); @@ -128,7 +134,7 @@ export function $meituan_fulfilmentcertificateprepare(data) { url: 'meituan/fulfilmentcertificateprepare', method: "post", data: { - shopId: localStorage.getItem("shopId"), + ...data } }); @@ -140,7 +146,7 @@ export function $meituan_certificateprepare(data) { url: 'meituan/certificateprepare', method: "post", data: { - shopId: localStorage.getItem("shopId"), + ...data } }); @@ -153,7 +159,7 @@ export function $meituan_orderlist(data) { url: 'meituan/orderlist', method: "post", data: { - shopId: localStorage.getItem("shopId"), + ...data } }); @@ -167,7 +173,7 @@ export function $meituan_fulfilmentcertificatecancel(data) { url: 'meituan/fulfilmentcertificatecancel', method: "post", data: { - shopId: localStorage.getItem("shopId"), + ...data } }); @@ -179,7 +185,7 @@ export function $meituan_searchstorestatus(data) { url: 'meituan/searchstorestatus', method: "post", data: { - shopId: localStorage.getItem("shopId"), + ...data } }); @@ -191,7 +197,7 @@ export function $logout(data) { url: 'user/logout', method: "post", data: { - shopId: localStorage.getItem("shopId"), + ...data } }); diff --git a/src/utils/request-php.js b/src/utils/request-php.js index a19cfbb..477ab99 100644 --- a/src/utils/request-php.js +++ b/src/utils/request-php.js @@ -2,10 +2,12 @@ import axios from 'axios' import router from '@/router/routers' import { Notification } from 'element-ui' import store from '../store' -import { getToken } from '@/utils/auth' import Config from '@/settings' import Cookies from 'js-cookie' import { setToken } from '@/utils/globalCancelToken.js' +function getToken() { + return localStorage.getItem('bausertoken') +} // 创建axios实例 const service = axios.create({ // baseURL: process.env.NODE_ENV === 'production' ? process.env.VUE_APP_BASE_API : '/', @@ -17,7 +19,7 @@ const service = axios.create({ service.interceptors.request.use( config => { if (getToken()) { - config.headers['Authorization'] = getToken() // 让每个请求携带自定义token 请根据实际情况自行修改 + config.headers['bausertoken'] = getToken() } config.headers['Content-Type'] = 'application/json' // 添加可取消请求配置 @@ -32,7 +34,37 @@ service.interceptors.request.use( // response 拦截器 service.interceptors.response.use( response => { - return response.data + const data = response.data + console.log(data) + if (data.code == 0) { + Notification.error({ + title: data.msg, + duration: 5000 + }) + return + } + if (data.code == 439) { + Notification.error({ + title: '请登录', + duration: 5000 + }) + return + } + if (data.code == 4399) { + Notification.error({ + title: data.msg, + duration: 5000 + }) + return data + } + if (data.code == 1&&!data.data) { + // Notification.success({ + // title: data.msg, + // duration: 5000 + // }) + return true + } + return data.data }, error => { console.log(error); diff --git a/src/views/login.vue b/src/views/login.vue index 43df8f2..a022e0d 100644 --- a/src/views/login.vue +++ b/src/views/login.vue @@ -64,6 +64,7 @@ import { encrypt } from '@/utils/rsaEncrypt' import Config from '@/settings' import { getCodeImg } from '@/api/login' +import { $douyin_checkIn } from '@/api/coup/index' import Cookies from 'js-cookie' import qs from 'qs' import Background from '@/assets/images/background_img.jpg' @@ -175,8 +176,12 @@ export default { // } // console.log(user); const user = { ...this.loginForm } + console.log(user) user.password = encrypt(user.password) this.$store.dispatch('Login', user).then(() => { + $douyin_checkIn({ + loginName:user.username + }) this.loading = false // 保存商户号 localStorage.setItem('MerchantId', JSON.stringify({ @@ -185,7 +190,8 @@ export default { })) this.$router.push({ path: this.redirect || '/' }) // window.location.replace = './' - }).catch(() => { + }).catch((err) => { + console.log(err) this.loading = false this.getCode() }) diff --git a/src/views/order_manage/douyin_list.vue b/src/views/order_manage/douyin_list.vue new file mode 100644 index 0000000..07ca293 --- /dev/null +++ b/src/views/order_manage/douyin_list.vue @@ -0,0 +1,238 @@ + + + diff --git a/src/views/tool/Instead/components/choose-quan-goods.vue b/src/views/tool/Instead/components/choose-quan-goods.vue new file mode 100644 index 0000000..056bc6b --- /dev/null +++ b/src/views/tool/Instead/components/choose-quan-goods.vue @@ -0,0 +1,161 @@ + + + + + + \ No newline at end of file diff --git a/src/views/tool/Instead/components/douyin-quan-bind-shop.vue b/src/views/tool/Instead/components/douyin-quan-bind-shop.vue new file mode 100644 index 0000000..ab594c5 --- /dev/null +++ b/src/views/tool/Instead/components/douyin-quan-bind-shop.vue @@ -0,0 +1,234 @@ + + + + + + \ No newline at end of file diff --git a/src/views/tool/Instead/components/popup-quan-hexiao.vue b/src/views/tool/Instead/components/popup-quan-hexiao.vue new file mode 100644 index 0000000..cee7ba8 --- /dev/null +++ b/src/views/tool/Instead/components/popup-quan-hexiao.vue @@ -0,0 +1,225 @@ + + + + \ No newline at end of file diff --git a/src/views/tool/Instead/components/popup-weight-goods.vue b/src/views/tool/Instead/components/popup-weight-goods.vue new file mode 100644 index 0000000..9525f79 --- /dev/null +++ b/src/views/tool/Instead/components/popup-weight-goods.vue @@ -0,0 +1,343 @@ + + + + + \ No newline at end of file diff --git a/src/views/tool/Instead/index.vue b/src/views/tool/Instead/index.vue index a0c6186..077fc2f 100644 --- a/src/views/tool/Instead/index.vue +++ b/src/views/tool/Instead/index.vue @@ -83,6 +83,13 @@ {{ table ? "桌台号:" + table.name : "选择桌号" }} + +
+ 扫码验券 +
+ {{ item | returntypeName }}
-
{{ item.name }}
+
+ 称重 + {{ item.name }} +
@@ -1504,8 +1525,10 @@ import moneyKeyboard from "./components/money-keyboard.vue"; import caiAdd from "./components/popup-linshiCai.vue"; import cartChangePrice from "./components/popup-cart-changePrice.vue"; import popTuanQuan from "./components/popup-tuan-quan.vue"; +import popQuanHexiao from "./components/popup-quan-hexiao.vue"; import tuanQuanTable from "./components/tuan-quan-table.vue"; import popupChooseGuazhang from "./components/popup-choose-guazhang.vue"; +import popupWeightGoods from "./components/popup-weight-goods.vue"; import dayjs from "dayjs"; import { tbShopInfo } from "@/api/user"; @@ -1562,7 +1585,7 @@ import PopupChooseGuazhang from "./components/popup-choose-guazhang.vue"; let $originTableList = []; export default { - components: { + components: {popupWeightGoods,popQuanHexiao, popupChooseGuazhang, cartChangePrice, popTuanQuan, @@ -2328,6 +2351,18 @@ export default { this.open(this.$route.query); }, methods: { + //美团抖音团购券核销弹窗 + refQuanHexiaoOpen(){ + this.$refs.refQuanHexiao.open() + }, + //称重商品弹窗 + refWeightGoodsShow() { + this.$refs.refWeightGoods.open(); + }, + //称重商品确认 + refWeightGoodsConfirm(){ + + }, //挂账人支付确认 guazhangPayConfirm(guazhangren, price) { this.guazhangRen = guazhangren; @@ -4027,6 +4062,9 @@ export default { // if (!this.table) { // return this.$message.error("暂不支持无桌台下单,请先选择桌台"); // } + if(item.type=='weigh'){ + return this.refWeightGoodsShow() + } if (item.typeEnum === "sku") { this.selGoods.data = item; this.selGoods.skuMap = {}; @@ -5476,7 +5514,16 @@ input[type="number"]::-webkit-outer-spin-button { border-radius: 4px; overflow-y: auto; } - +.weight{ + height: 15px; + background: linear-gradient(124deg, rgb(115, 201, 105) 6%, rgb(39, 146, 27) 93%); + border-radius: 2px; + font-size: 12px; + text-align: center; + line-height: 15px; + padding: 0px 2px; + margin-right: 2px; +} .cashier_left .el-form-item { margin-bottom: 0; }