1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- import axios from "axios"
- import { goodsData as rawData } from "@/assets/data/data.js"
- import { deepProcess } from "@/utils.js"
- function _like() {
- return axios({
- method: 'post',
- url: `http://project.4dage.com:8036/api/visit/saveType`,
- headers: {
- appId: "E9A27605CEB3FFAF48F4D7B86858A03D9868419F60B5A45027FB6E6867F4EDA9",
- "Content-Type": "application/json",
- },
- data: {
- moduleType: "web",
- type: 'star',
- },
- })
- }
- export default {
- recordVisit() {
- axios({
- method: 'post',
- url: `http://project.4dage.com:8036/api/visit/saveType`,
- headers: {
- appId: "E9A27605CEB3FFAF48F4D7B86858A03D9868419F60B5A45027FB6E6867F4EDA9",
- "Content-Type": "application/json",
- },
- data: {
- moduleType: "web",
- type: 'visit',
- },
- })
- },
- like: globalUtils.throttle(_like, 2000),
- async fetchPanoData() {
- const res = await axios({
- method: 'get',
- url: `${process.env.VUE_APP_CDN_PATH_QJKK_SOME_DATA}?_=${Math.random()}`,
- })
- console.log('fetch pano data: ', res.data)
- function changeSubStr(str) {
- return str.replace('https://4dkk.4dage.com/720yun_fd_manage/image/', `${process.env.VUE_APP_QJKK_XML_FILE_PATH}images/`)
- }
- if (process.env.VUE_APP_CLI_MODE === 'local') {
- deepProcess(res, changeSubStr)
- }
- return res.data
- },
- // type: straw(手稿) book(书刊) tool(用具) clothing(服装) Italy(油画)
- fetchRelicList(dimNum = 3, type = 'all', keyword = '', pageNum = 0, pageSize = 20) {
- return rawData[`${dimNum}D`].filter((item) => {
- return item.type === type || type === 'all'
- }).filter((item) => {
- return item.name.includes(keyword) || keyword === ''
- }).filter((item) => {
- return !item.noShow
- }).slice(pageNum * pageSize, pageNum * pageSize + pageSize)
- }
- }
|