diff --git a/.env.development b/.env.development index 95de7c1..840d2e6 100644 --- a/.env.development +++ b/.env.development @@ -1,5 +1,5 @@ # API -VUE_APP_API_URL = 'http://192.168.100.22:3006/api' +VUE_APP_API_URL = 'http://192.168.100.22:3006' # VUE_APP_API_URL = 'http://127.0.0.1:3006/api' VUE_APP_WL_URL = 'https://nftwl.counterfire.games/wl_test' VUE_APP_CONFIG_URL = 'https://sepolia.infura.io/v3/b6bf7d3508c941499b10025c0776eaf8' diff --git a/.env.production b/.env.production index 2d11b2f..1440b65 100644 --- a/.env.production +++ b/.env.production @@ -15,4 +15,4 @@ VUE_APP_CHAIN_ID = '5611' VUE_APP_APP_NAME = 'CF UAW' -VUE_APP_SCRIPTION_ADDRESS='0x50A8e60041A206AcaA5F844a1104896224be6F39' \ No newline at end of file +VUE_APP_SCRIPTION_ADDRESS='0xcd4bb3402f1a444a1af10f31946ed37dac0eac4d' \ No newline at end of file diff --git a/src/assets/common/Icon_Points.png b/src/assets/common/Icon_Points.png index 7e94d4a..2d2ae99 100644 Binary files a/src/assets/common/Icon_Points.png and b/src/assets/common/Icon_Points.png differ diff --git a/src/assets/common/bg_p3.png b/src/assets/common/bg_p3.png new file mode 100644 index 0000000..330e17a Binary files /dev/null and b/src/assets/common/bg_p3.png differ diff --git a/src/assets/ranking/Background_shine.png b/src/assets/ranking/Background_shine.png new file mode 100644 index 0000000..a5aa409 Binary files /dev/null and b/src/assets/ranking/Background_shine.png differ diff --git a/src/assets/ranking/Bg_chest.png b/src/assets/ranking/Bg_chest.png new file mode 100644 index 0000000..8dd3f35 Binary files /dev/null and b/src/assets/ranking/Bg_chest.png differ diff --git a/src/assets/ranking/Glow01.png b/src/assets/ranking/Glow01.png new file mode 100644 index 0000000..06b333f Binary files /dev/null and b/src/assets/ranking/Glow01.png differ diff --git a/src/assets/ranking/My points bg.png b/src/assets/ranking/My points bg.png new file mode 100644 index 0000000..9833208 Binary files /dev/null and b/src/assets/ranking/My points bg.png differ diff --git a/src/assets/ranking/Point bg.png b/src/assets/ranking/Point bg.png new file mode 100644 index 0000000..8fc9161 Binary files /dev/null and b/src/assets/ranking/Point bg.png differ diff --git a/src/assets/ranking/Ranking1.png b/src/assets/ranking/Ranking1.png new file mode 100644 index 0000000..fa803d9 Binary files /dev/null and b/src/assets/ranking/Ranking1.png differ diff --git a/src/assets/ranking/Ranking2.png b/src/assets/ranking/Ranking2.png new file mode 100644 index 0000000..a19cf07 Binary files /dev/null and b/src/assets/ranking/Ranking2.png differ diff --git a/src/assets/ranking/Ranking3.png b/src/assets/ranking/Ranking3.png new file mode 100644 index 0000000..ed10656 Binary files /dev/null and b/src/assets/ranking/Ranking3.png differ diff --git a/src/assets/ranking/button02.png b/src/assets/ranking/button02.png new file mode 100644 index 0000000..da09228 Binary files /dev/null and b/src/assets/ranking/button02.png differ diff --git a/src/assets/ranking/leaderboard.png b/src/assets/ranking/leaderboard.png new file mode 100644 index 0000000..27667ac Binary files /dev/null and b/src/assets/ranking/leaderboard.png differ diff --git a/src/components/errorDialog/errorDialog.vue b/src/components/errorDialog/errorDialog.vue new file mode 100644 index 0000000..9181b0d --- /dev/null +++ b/src/components/errorDialog/errorDialog.vue @@ -0,0 +1,47 @@ + + + \ No newline at end of file diff --git a/src/components/errorDialog/index.js b/src/components/errorDialog/index.js new file mode 100644 index 0000000..3364e53 --- /dev/null +++ b/src/components/errorDialog/index.js @@ -0,0 +1,29 @@ +import Vue from 'vue'; +import confirm from './errorDialog.vue'; +const iErrorMessage = Vue.extend(confirm); +function showErrMsg(err) { + let errmsg = err; + if (typeof err === 'object') { + errmsg = JSON.stringify(err); + } + if (errmsg.indexOf('User denied message signature') > -1) { + errmsg = `User denied message signature`; + } else if (errmsg.indexOf('insufficient funds') > -1) { + errmsg = 'Insufficient funds'; + } + + const _confirm = new iErrorMessage({ + data() { + return { + message: errmsg, + dialogVisible: true, + }; + }, + }); + const element = _confirm.$mount().$el; + document.body.appendChild(element); +} +showErrMsg.install = (Vue) => { + Vue.prototype.$showErr = showErrMsg; +}; +export default showErrMsg; diff --git a/src/components/formatPrice.vue b/src/components/formatPrice.vue new file mode 100644 index 0000000..57e897c --- /dev/null +++ b/src/components/formatPrice.vue @@ -0,0 +1,39 @@ + + + + + \ No newline at end of file diff --git a/src/components/linkButton/linkBtnView.vue b/src/components/linkButton/linkBtnView.vue index 25bd0db..7209ed9 100644 --- a/src/components/linkButton/linkBtnView.vue +++ b/src/components/linkButton/linkBtnView.vue @@ -82,7 +82,7 @@ export default { // 获取用户状态 getUserState(token) { - this.$axios.get('/api/user/state',{ params: '', + this.$axios.get(process.env.VUE_APP_API_URL+'/api/user/state',{ params: '', headers: { Authorization: `Bearer ${token}` }, }).then(res => { localStorage.setItem('userData', JSON.stringify(res.data.data)) diff --git a/src/main.js b/src/main.js index 19f88d0..bc03638 100644 --- a/src/main.js +++ b/src/main.js @@ -7,10 +7,13 @@ import ElementUI from 'element-ui' import 'element-ui/lib/theme-chalk/index.css' import moment from 'moment' import axios from 'axios' +import iErrorMsg from './components/errorDialog/index.js' Vue.prototype.$axios = axios // import Web3 from 'web3' Vue.use(ElementUI) +// 全局的错误提示, this.$showErr(string|object) +Vue.use(iErrorMsg) import {Message} from 'element-ui' Vue.prototype.$message = Message @@ -19,17 +22,17 @@ Vue.filter('formatDate', function (value) { return moment(value).format('YYYY-MM-DD HH:mm:ss') }) -Vue.config.errorHandler = function(err, vm, info){ - //todo: show error message - console.error('[vue error handler|error]: ', err) - console.error('[vue error handler|VM]: ', vm) - console.warn('[vue error handler|info]: ', info) - Message({ - message: info, - type: 'error', - duration: 3 * 1000 - }) -} +// Vue.config.errorHandler = function(err, vm, info){ +// //todo: show error message +// console.error('[vue error handler|error]: ', err) +// console.error('[vue error handler|VM]: ', vm) +// console.warn('[vue error handler|info]: ', info) +// Message({ +// message: info, +// type: 'error', +// duration: 3 * 1000 +// }) +// } Vue.config.productionTip = false diff --git a/src/utils/webapi.js b/src/utils/webapi.js index 185a567..34f84b4 100644 --- a/src/utils/webapi.js +++ b/src/utils/webapi.js @@ -247,3 +247,9 @@ export const joinDiscord = (id) => { const url = `https://discord.gg/${id}` window.open(url, '_blank'); } + +// NFT 合作伙伴列表 +export const apiNftList = async () => { + const url = `${API_BASE}/api/partner/nfts`; + return httpPost(url, {}) +} diff --git a/src/views/bonus/index.vue b/src/views/bonus/index.vue index 64b1bb8..5973690 100644 --- a/src/views/bonus/index.vue +++ b/src/views/bonus/index.vue @@ -141,7 +141,7 @@ export default { async getHistorical(id) { let res = await this.$axios .post( - "/api/chest/enhance/list", + process.env.VUE_APP_API_URL+"/api/chest/enhance/list", { chestid: id }, { headers: { Authorization: `Bearer ${this.token}` } @@ -154,7 +154,7 @@ export default { // 邀请列表 getBoosting() { this.$axios - .get("/api/activity/invite_list", { + .get(process.env.VUE_APP_API_URL+"/api/activity/invite_list", { params: "", headers: { Authorization: `Bearer ${this.token}` } }) @@ -170,7 +170,7 @@ export default { // 复制助力链接 copyLink(text) { console.log(text) - let url = `http://192.168.100.216:8030/home/new=${this.userData.code}/box=${text}/id=${this.boxList[0].id}` + let url = `${location.protocol}//${location.host}/home/new=${this.userData.code}/box=${text}/id=${this.boxList[0].id}` let oInput = document.createElement("input"); oInput.value = url; document.body.appendChild(oInput); @@ -184,7 +184,7 @@ export default { // 宝箱列表 async getBoxList() { let res = await this.$axios - .get("/api/chest/list", { + .get(process.env.VUE_APP_API_URL+"/api/chest/list", { params: "", headers: { Authorization: `Bearer ${this.token}` } }) @@ -199,7 +199,7 @@ export default { // 宝箱开启记录 async getOpenBox() { - let res = await this.$axios.get('/api/chest/open/history',{params: '',headers: { Authorization: `Bearer ${this.token}` }}) + let res = await this.$axios.get(process.env.VUE_APP_API_URL+'/api/chest/open/history',{params: '',headers: { Authorization: `Bearer ${this.token}` }}) console.log('宝箱开启记录', res.data) }, @@ -208,7 +208,7 @@ export default { // const address = localStorage.getItem('address') try{ // let res = await sendOpenChest(address,id) - let res = await this.$axios.post('/api/chest/open',{chestId: id},{ + let res = await this.$axios.post(process.env.VUE_APP_API_URL+'/api/chest/open',{chestId: id},{ headers: { Authorization: `Bearer ${this.token}` } }) console.log('开宝箱', res) diff --git a/src/views/home/awardDialog.vue b/src/views/home/awardDialog.vue index 5fc6ef6..91b0e56 100644 --- a/src/views/home/awardDialog.vue +++ b/src/views/home/awardDialog.vue @@ -72,7 +72,7 @@
Confirm
-
+
@@ -81,13 +81,20 @@
{{ dialogTitle }}
-
+
Points
X {{ awardData.score }}
+
+
Points
+
+ X {{ awardData.ticket }} + +
+
Complete tasks to get more rewards
To complete
diff --git a/src/views/home/boxBtm.vue b/src/views/home/boxBtm.vue index 8495dca..070d143 100644 --- a/src/views/home/boxBtm.vue +++ b/src/views/home/boxBtm.vue @@ -382,7 +382,7 @@ export default { // 我的宝箱 async getMyBoxList() { let res = await this.$axios - .get("/api/chest/list", { + .get(process.env.VUE_APP_API_URL+"/api/chest/list", { params: "", headers: { Authorization: `Bearer ${this.token}` } }) @@ -419,7 +419,7 @@ export default { async getHistorical(id) { let res = await this.$axios .post( - "/api/chest/enhance/list", + process.env.VUE_APP_API_URL+"/api/chest/enhance/list", { chestid: id }, { headers: { Authorization: `Bearer ${this.token}` } @@ -475,7 +475,7 @@ export default { if(resOpen) { let serTimeId = setInterval(async () => { let res = await this.$axios.post( - "/api/chest/open", + process.env.VUE_APP_API_URL+"/api/chest/open", { chestId: id }, { headers: { Authorization: `Bearer ${this.token}` } } ); @@ -494,7 +494,7 @@ export default { // 开箱子记录 async openBoxLog() { - let res = await this.$axios.get('/api/chest/open/history', { + let res = await this.$axios.get(process.env.VUE_APP_API_URL+'/api/chest/open/history', { params: { }, headers: { Authorization: `Bearer ${this.token}` } }) @@ -508,7 +508,7 @@ export default { // 我的助力记录 async getMyHistoricalLog() { - let res = await this.$axios.post('/api/user/enhance/list', {},{headers: { Authorization: `Bearer ${this.token}` }}) + let res = await this.$axios.post(process.env.VUE_APP_API_URL+'/api/user/enhance/list', {},{headers: { Authorization: `Bearer ${this.token}` }}) this.myRecordsList = res.data.data }, // 我的助力记录 @@ -521,7 +521,7 @@ export default { this.userData = JSON.parse(localStorage.getItem("userData")) // console.log(data, this.userData.code) // return - let url = `http://192.168.100.216:8030/home/new=${this.userData.code}/box=${data.shareCode}/id=${data.id}` + let url = `${location.protocol}//${location.host}/home/new=${this.userData.code}/box=${data.shareCode}/id=${data.id}` let oInput = document.createElement("input"); oInput.value = url; document.body.appendChild(oInput); diff --git a/src/views/home/gameView.vue b/src/views/home/gameView.vue index db130a2..c6e3390 100644 --- a/src/views/home/gameView.vue +++ b/src/views/home/gameView.vue @@ -119,7 +119,7 @@ export default { if(amount >= 1) { cc.mainAnim.setCurrPos(getTotalUsed) cc.mainAnim.setData(amount) - let res = await this.$axios.post('/api/game/pre_step',{step: amount},{headers: { Authorization: `Bearer ${this.token}` }}) + let res = await this.$axios.post(process.env.VUE_APP_API_URL+'/api/game/pre_step',{step: amount},{headers: { Authorization: `Bearer ${this.token}` }}) let id = res.data.data.id if(id){ try{ diff --git a/src/views/home/helpDialog.vue b/src/views/home/helpDialog.vue index 48bf051..d409a54 100644 --- a/src/views/home/helpDialog.vue +++ b/src/views/home/helpDialog.vue @@ -108,7 +108,7 @@ export default { methods: { // 宝箱信息接口 async getBoxData() { - let res = await this.$axios.post('/api/chest/enhance/state', {chestId: '660a4b63de92bca95af2b714'},{}) + let res = await this.$axios.post(process.env.VUE_APP_API_URL+'/api/chest/enhance/state', {chestId: '660a4b63de92bca95af2b714'},{}) this.boxData = res.data.data }, @@ -117,7 +117,7 @@ export default { if (this.$route.params.boxId != undefined) { let rtoken = await checkReCaptcha("chest_share"); let res = await this.$axios.post( - "/api/chest/enhance/list", + process.env.VUE_APP_API_URL+"/api/chest/enhance/list", { chestid: this.boxId, rtoken: rtoken }, { headers: { Authorization: `Bearer ${this.token}` } @@ -134,7 +134,7 @@ export default { if(this.$route.params.name != undefined) { let newInvite = this.$route.params.name.split("new=")[1]; let rtoken = await checkReCaptcha("invite_user"); - let res = await this.$axios.get("/api/activity/upload_invite_code", { + let res = await this.$axios.get(process.env.VUE_APP_API_URL+"/api/activity/upload_invite_code", { params: { code: newInvite, rtoken: rtoken }, headers: { Authorization: `Bearer ${this.token}` } }); @@ -248,7 +248,7 @@ export default { // 助力状态查询 async initBoxState(code,chestId) { - let res = await this.$axios.post('/api/chest/enhance/state',{code: code, chestId: chestId, },{headers: { Authorization: `Bearer ${this.token}` }}) + let res = await this.$axios.post(process.env.VUE_APP_API_URL+'/api/chest/enhance/state',{code: code, chestId: chestId, },{headers: { Authorization: `Bearer ${this.token}` }}) this.boxState = res.data.data if (this.boxState.userCurrent == this.boxState.userMax) { if(this.boxState.enhanced == 1) { diff --git a/src/views/home/index.vue b/src/views/home/index.vue index e4b187c..21d167a 100644 --- a/src/views/home/index.vue +++ b/src/views/home/index.vue @@ -142,7 +142,7 @@
-
+

Phase 1

Complete quests to shatter the looming

fog that veils the unknown!

@@ -390,12 +390,43 @@
-
- 其他钱包链合作 +
+
+
+
Partner
+
+
+
+
+
  • +
    + +
    +

    {{ item.title }}

    +

    {{ item.desc }}

    +
    +
    +
    +
    +
    {{ item.actionTitle }}
    + Check +
    Claim
    +
    +{{ item.score }}
    +
    +
    +
    Connect Wallet
    +
  • +
    +
    -
    +
    @@ -488,9 +519,12 @@
    -
    +
    +
    + +
    @@ -512,6 +546,7 @@ + + \ No newline at end of file diff --git a/src/views/ranking/index.vue b/src/views/ranking/index.vue index c1622ad..187f69d 100644 --- a/src/views/ranking/index.vue +++ b/src/views/ranking/index.vue @@ -248,7 +248,7 @@ export default { methods: { // 我的积分记录 async getMyIntegralList() { - let res = await this.$axios.get(`/api/user/checkin/list/1month`,{ params: '', + let res = await this.$axios.get(process.env.VUE_APP_API_URL+`/api/user/checkin/list/all`,{ params: '', headers: { Authorization: `Bearer ${this.token}` }, }) this.detailsList = res.data.data @@ -256,13 +256,13 @@ export default { // 获取总积分榜 async getLeaderBoard () { - let res = await this.$axios.get(`/api/activity/leaderboard/uaw_activity/0`) + let res = await this.$axios.get(process.env.VUE_APP_API_URL+`/api/activity/leaderboard/uaw_activity/0`) console.log(res.data.data) this.rankingTableData = res.data.data }, // 获取用户状态 getUserState() { - this.$axios.get('/api/user/state',{ params: '', + this.$axios.get(process.env.VUE_APP_API_URL+'/api/user/state',{ params: '', headers: { Authorization: `Bearer ${this.token}` }, }).then(res => { this.userData = res.data.data diff --git a/uaw.zip b/uaw.zip new file mode 100644 index 0000000..0152437 Binary files /dev/null and b/uaw.zip differ diff --git a/vue.config.js b/vue.config.js index aeb408b..db47130 100644 --- a/vue.config.js +++ b/vue.config.js @@ -4,65 +4,28 @@ const CopyWebpackPlugin = require("copy-webpack-plugin"); function resolve(dir) { return path.join(__dirname, dir) } - module.exports = defineConfig({ transpileDependencies: true, - // configureWebpack: config => { - // const plugins = [ - // new CopyWebpackPlugin( - // { - // patterns: [ - // { - // from: __dirname + '/src/assets', - // to: "assets" - // }, - // // { - // // from: __dirname + '/src/assets/horse_avatar', - // // to: "assets/horse_avatar" - // // }, - // // { - // // from: __dirname + '/src/assets/parts', - // // to: "assets/parts" - // // }, - // // { - // // from: __dirname + '/src/assets/partsTwo', - // // to: "assets/partsTwo" - // // }, - // // { - // // from: __dirname + '/src/assets/skills', - // // to: "assets/skills" - // // }, - // // { - // // from: __dirname + '/src/assets/fusion', - // // to: "assets/fusion" - // // } - // ] - // } - // ), - // //...其他的插件 - // ]; - // return { plugins } - // }, lintOnSave: false, // productionSourceMap: false, publicPath: '/', - devServer: { - open: false, - // host: '0.0.0.0', // 允许外部ip访问 - port: 8030, // 端口 - https: false, // 启用https - // overlay: { - // warnings: true, - // errors: true - // }, // 错误、警告在页面弹出 - proxy: { - '/api': { - target: process.env.VUE_APP_API_URL, - changeOrigin: true, // 允许websockets跨域 - pathRewrite: { - '^/api': '' - } - }, - }, // 代理转发配置,用于调试环境 - }, + // devServer: { + // open: false, + // // host: '0.0.0.0', // 允许外部ip访问 + // port: 8030, // 端口 + // https: false, // 启用https + // // overlay: { + // // warnings: true, + // // errors: true + // // }, // 错误、警告在页面弹出 + // proxy: { + // '/api': { + // target: process.env.VUE_APP_API_URL, + // changeOrigin: true, // 允许websockets跨域 + // pathRewrite: { + // '^/api': '' + // } + // }, + // }, // 代理转发配置,用于调试环境 + // }, })