-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
62 changed files
with
510 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
export async function chat(messageList, apiKey) { | ||
try { | ||
const result = await fetch("https://api.openai.com/v1/chat/completions", { | ||
method: "post", | ||
// signal: AbortSignal.timeout(8000), | ||
// 开启后到达设定时间会中断流式输出 | ||
headers: { | ||
"Content-Type": "application/json", | ||
Authorization: `Bearer ${apiKey}`, | ||
}, | ||
body: JSON.stringify({ | ||
model: "gpt-3.5-turbo", | ||
stream: true, | ||
messages: messageList, | ||
}), | ||
}); | ||
return result; | ||
} catch (error) { | ||
throw error; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
import Vue from 'vue'; | ||
Vue.directive('drag', { | ||
bind: function (el) { | ||
const odiv = el; | ||
// 缓存 clientX clientY 的对象: 用于判断是点击事件还是移动事件 | ||
const clientOffset = {}; | ||
odiv.style.position = 'fixed'; | ||
odiv.onmousedown = (e) => { | ||
const disX = e.clientX - odiv.offsetLeft; | ||
const disY = e.clientY - odiv.offsetTop; | ||
// 缓存 clientX clientY | ||
clientOffset.clientX = e.clientX; | ||
clientOffset.clientY = e.clientY; | ||
document.onmousemove = (e) => { | ||
const left = e.clientX - disX; | ||
const top = e.clientY - disY; | ||
odiv.style.left = left + 'px'; | ||
odiv.style.top = top + 'px'; | ||
// odiv 距离顶部的距离 | ||
const dragDivTop = window.innerHeight - odiv.getBoundingClientRect().height; | ||
// odiv 距离左部的距离 | ||
const dragDivLeft = window.innerWidth - odiv.getBoundingClientRect().width; | ||
// 边界判断处理 | ||
// 2、超出顶部处理 | ||
if (odiv.getBoundingClientRect().top <= 0) { | ||
odiv.style.top = '0px'; | ||
} | ||
// 3、超出底部处理 | ||
if (odiv.getBoundingClientRect().top >= dragDivTop) { | ||
odiv.style.top = dragDivTop + 'px'; | ||
} | ||
// 4、超出右边边界区域处理 | ||
if (odiv.getBoundingClientRect().left >= dragDivLeft) { | ||
odiv.style.left = dragDivLeft + 'px'; | ||
} | ||
// 5、超出左边边界区域处理 | ||
if (odiv.getBoundingClientRect().left <= 0) { | ||
odiv.style.left = '0px'; | ||
} | ||
}; | ||
document.onmouseup = () => { | ||
document.onmousemove = null; | ||
document.onmouseup = null; | ||
}; | ||
}; | ||
// 绑定鼠标松开事件 | ||
odiv.addEventListener('mouseup', (event) => { | ||
const clientX = event.clientX; | ||
const clientY = event.clientY; | ||
if (clientX === clientOffset.clientX && clientY === clientOffset.clientY) { | ||
return false | ||
// console.log('click 事件'); | ||
} else { | ||
return false | ||
// console.log('drag 事件'); | ||
} | ||
}) | ||
} | ||
}); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
import http from './public' | ||
// 商品列表 | ||
export const getAllGoods = (params) => { | ||
return http.fetchGet('/goods/allGoods', params) | ||
} | ||
// 获取购物车列表 | ||
export const getCartList = (params) => { | ||
return http.fetchPost('/member/cartList', params) | ||
} | ||
// 加入购物车 | ||
export const addCart = (params) => { | ||
return http.fetchPost('/member/addCart', params) | ||
} | ||
// 删除购物车 | ||
export const delCart = (params) => { | ||
return http.fetchPost('/member/delCart', params) | ||
} | ||
// 删除购物车勾选商品 | ||
export const delCartChecked = (params) => { | ||
return http.fetchPost('/member/delCartChecked', params) | ||
} | ||
// 编辑购物车 | ||
export const cartEdit = (params) => { | ||
return http.fetchPost('/member/cartEdit', params) | ||
} | ||
// 全选 | ||
export const editCheckAll = (params) => { | ||
return http.fetchPost('/member/editCheckAll', params) | ||
} | ||
// 删除整条购物车 | ||
export const cartDel = (params) => { | ||
return http.fetchPost('/member/cartDel', params) | ||
} | ||
// 获取用户地址 | ||
export const addressList = (params) => { | ||
return http.fetchPost('/member/addressList', params) | ||
} | ||
// 通过id获取地址 | ||
export const getAddress = (params) => { | ||
return http.fetchPost('/member/address', params) | ||
} | ||
// 修改收货地址 | ||
export const addressUpdate = (params) => { | ||
return http.fetchPost('/member/updateAddress', params) | ||
} | ||
// 添加收货地址 | ||
export const addressAdd = (params) => { | ||
return http.fetchPost('/member/addAddress', params) | ||
} | ||
// 删除收货地址 | ||
export const addressDel = (params) => { | ||
return http.fetchPost('/member/delAddress', params) | ||
} | ||
// 生成订单 | ||
export const submitOrder = (params) => { | ||
return http.fetchPost('/member/addOrder', params) | ||
} | ||
// 支付 | ||
export const payMent = (params) => { | ||
return http.fetchPost('/member/payOrder', params) | ||
} | ||
// 获取用户订单 | ||
export const orderList = (params) => { | ||
return http.fetchGet('/member/orderList', params) | ||
} | ||
// 获取单个订单详情 | ||
export const getOrderDet = (params) => { | ||
return http.fetchGet('/member/orderDetail', params) | ||
} | ||
// 取消订单 | ||
export const cancelOrder = (params) => { | ||
return http.fetchPost('/member/cancelOrder', params) | ||
} | ||
// 商品详情 | ||
export const productDet = (params) => { | ||
return http.fetchGet('/goods/productDet', params) | ||
} | ||
// 删除订单 | ||
export const delOrder = (params) => { | ||
return http.fetchGet('/member/delOrder', params) | ||
} | ||
// 商品列表 | ||
export const getSearch = (params) => { | ||
return http.fetchGet('/goods/search', params) | ||
} | ||
// 快速搜索 | ||
export const getQuickSearch = (params) => { | ||
return http.fetchGet('/goods/quickSearch', params) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import http from './public' | ||
// 登陆 | ||
export const userLogin = (params) => { | ||
return http.fetchPost('/user/login', params) | ||
} | ||
|
||
|
||
// 商品详情页上传交易时间 | ||
export const updatetime = (params) => { | ||
|
||
} | ||
|
||
export const emailnotify = (params) => { | ||
return http.fetchPost('/api/Mail/SendHtml', params) | ||
} | ||
|
||
|
||
export const userInfoUpdate = (params) => { | ||
return http.fetchPost('/api/user/infoUpdate', params) | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import axios from 'axios' | ||
axios.defaults.timeout = 100000 | ||
axios.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded' | ||
export default { | ||
fetchGet (url, params = {}) { | ||
return new Promise((resolve, reject) => { | ||
axios.get(url, params).then(res => { | ||
resolve(res.data) | ||
}).catch(error => { | ||
reject(error) | ||
}) | ||
}) | ||
}, | ||
fetchPost (url, params = {}) { | ||
return new Promise((resolve, reject) => { | ||
axios.post(url, params).then(res => { | ||
resolve(res.data) | ||
}).catch(error => { | ||
reject(error) | ||
}) | ||
}) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,110 @@ | ||
import http from './public' | ||
|
||
export const userinfo = (params) => { | ||
return http.fetchPost('/member/info', params) | ||
} | ||
|
||
|
||
|
||
// 获取appnav里各类选项数据 | ||
|
||
|
||
export const usersinfo = (params) => { | ||
return http.fetchPost('/usersinfo', params) | ||
} | ||
|
||
export const insertGood = (params) => { | ||
return http.fetchPost('/user/insertiGood', params) | ||
} | ||
|
||
export const getGoodList = (params) => { | ||
return http.fetchPost('/user/getOrderList', params) | ||
} | ||
|
||
|
||
|
||
|
||
export const login = (params) => { | ||
return http.fetchPost('/api/auth/login', params) | ||
} | ||
export const bannerpic = () => { | ||
return http.fetchGet('/api/Good/Banner') | ||
} | ||
export const goodsitem = (params) => { | ||
return http.fetchPost('/api/Good/GoodsItem',params) | ||
} | ||
export const goodsitemleft = () => { | ||
return http.fetchGet('/api/Good/GoodsItemLeft') | ||
} | ||
export const hotlist = () => { | ||
return http.fetchGet('/api/Good/hotlist1') | ||
} | ||
export const hotlist2 = () => { | ||
return http.fetchGet('/api/Good/hotlist2') | ||
} | ||
export const hotlist3 = () => { | ||
return http.fetchGet('/api/Good/hotlist3') | ||
} | ||
export const KaoYanList_shuxue = () => { | ||
return http.fetchGet('/api/Good/KaoYanList_shuxue') | ||
} | ||
export const KaoYanList_zhengzhi = () => { | ||
return http.fetchGet('/api/Good/KaoYanList_zhengzhi') | ||
} | ||
export const KeWaiList_xiaoshuo = () => { | ||
return http.fetchGet('/api/Good/KeWaiList_xiaoshuo') | ||
} | ||
export const KeWaiList_manhua = () => { | ||
return http.fetchGet('/api/Good/KeWaiList_manhua') | ||
} | ||
export const TongXiuList_shuxue = () => { | ||
return http.fetchGet('/api/Good/TongXiuList_shuxue', ) | ||
} | ||
export const TongXiuList_yingyu = () => { | ||
return http.fetchGet('/api/Good/TongXiuList_yingyu', ) | ||
} | ||
export const TongXiuList_zhengzhi = () => { | ||
return http.fetchGet('/api/Good/TongXiuList_zhengzhi', ) | ||
} | ||
export const ZhuanYeList_dike = () => { | ||
return http.fetchGet('/api/Good/ZhuanYeList_dike', ) | ||
} | ||
export const ZhuanYeList_jike = () => { | ||
return http.fetchGet('/api/Good/ZhuanYeList_jike', ) | ||
} | ||
export const MianFeiList_jiaoke = () => { | ||
return http.fetchGet('/api/Good/MianFeiList_jiaoke', ) | ||
} | ||
export const MianFeiList_kewai = () => { | ||
return http.fetchGet('/api/Good/MianFeiList_kewai', ) | ||
} | ||
export const detailslist = (params) => { | ||
return http.fetchPost('/api/Good/detailslist', params) | ||
} | ||
export const insertGoodMysql = (params) => { | ||
return http.fetchPost('/api/Good/insert', params) | ||
} | ||
|
||
export const getUser = (params) => { | ||
return http.fetchPost('/api/user/getUserById', params) | ||
} | ||
|
||
export const getGoodById = (params) => { | ||
return http.fetchPost('/api/Good/getByUid', params) | ||
} | ||
|
||
export const deleteOrder = (params) => { | ||
return http.fetchPost('/api/Order/del', params) | ||
} | ||
export const updateGood = (params) => { | ||
return http.fetchPost('/api/Good/updateGoodStatus', params) | ||
} | ||
export const getOrder = (params) => { | ||
return http.fetchPost('/api/Order/getByuid', params) | ||
} | ||
export const updateStatus = (params) => { | ||
return http.fetchPost('/api/Good/updateGoodStatus', params) | ||
} | ||
export const orderInsert = (params) => { | ||
return http.fetchPost('/api/Order/insert', params) | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
* { | ||
padding: 0; | ||
margin: 0; | ||
} | ||
|
||
body { | ||
min-width: 1100px; | ||
height: 100%; | ||
font-size: 14px; | ||
font-family: '微软雅黑', Arial, Helvetica, sans-serif; | ||
} | ||
|
||
|
||
|
||
|
||
|
||
input { | ||
outline: none; | ||
} | ||
|
||
/* 提取版心 */ | ||
.w { | ||
width: 1100px; | ||
margin: 0 auto; | ||
} | ||
ul { | ||
list-style: none; | ||
} | ||
a { | ||
color: #333; | ||
text-decoration: none; | ||
outline: none; | ||
} | ||
|
||
.ellipsis { | ||
white-space: nowrap; | ||
text-overflow: ellipsis; | ||
overflow: hidden; | ||
} | ||
|
||
/* 超过两行生省略号 */ | ||
.ellipsis-2 { | ||
word-break: break-all; | ||
text-overflow: ellipsis; | ||
display: -webkit-box; | ||
-webkit-box-orient: vertical; | ||
-webkit-line-clamp: 2; | ||
overflow: hidden; | ||
} | ||
|
||
.fr { | ||
float: right; | ||
} | ||
|
||
.fl { | ||
float: left; | ||
} | ||
|
||
.clearfix::after { | ||
content: '.'; | ||
display: block; | ||
visibility: hidden; | ||
height: 0; | ||
line-height: 0; | ||
clear: both; | ||
} |
Oops, something went wrong.