Commit d74819a3 by Lays-lzq

feat: dms消息适配

parent fc9e537e
......@@ -11,7 +11,7 @@ const axiosService = axios.create();
// 默认content-type
axiosService.defaults.headers["Content-Type"] = "application/x-www-form-urlencoded";
// 默认baseURL
axiosService.defaults.baseURL = `//${process.env.CUSTOMER_API_DOMAIN}/v1`;
axiosService.defaults.baseURL = `https://${process.env.CUSTOMER_API_DOMAIN}/v1`;
// 默认请求超时时间
axiosService.defaults.timeout = 3 * 1000;
......
......@@ -27,7 +27,8 @@ export default {
[LOTTERY_TYPE.timing]: () => import('@/components/Lottery/Timing/Main')
},
id: this.$route.query.id || null, // 接收抽奖id
sessionId: this.$route.query.sessionId || null // 接收抽奖场次id
sessionId: this.$route.query.sessionId || null, // 接收抽奖场次id
trueId: null
}
},
computed: {
......@@ -37,6 +38,13 @@ export default {
lotteryInfo: 'lottery/lotteryInfo'
})
},
watch: {
trueId(nVal, oVal) {
if (nVal) {
this.postInfo(nVal)
}
}
},
created() {
this.dataInit()
},
......@@ -57,6 +65,8 @@ export default {
this.getLotteryDetail({ id, playId, uin })
.then(() => {
this.isLoading = false
this.trueId = this.lotteryInfo.id
console.log(this.lotteryInfo, 888888);
// 微信分享
if (UserAgents.isWx && process.client) {
const { lotteryInfo } = this
......@@ -84,7 +94,7 @@ export default {
Bus.$on('LotteryInfoUpdate', data => {
const { id } = data
const { uin, id: currentId, sessionId: currentPlayId } = this
if (+id === +currentId) {
if (id === currentId) {
this.getLotteryDetail({ id, playId: currentPlayId, uin })
}
})
......@@ -92,7 +102,7 @@ export default {
Bus.$on('LotteryStateUpdate', data => {
const { id, playId } = data
const { sessionId: currentPlayId, id: currentId } = this
if (+id === +currentId && +playId === +currentPlayId) {
if (id === currentId && playId === currentPlayId) {
const { status, startTime, endTime } = data
// 状态
this.updateInfo({
......
......@@ -106,7 +106,7 @@ export default {
Bus.$on('LotteryInfoUpdate', data => {
const { id } = data
const { uin, id: currentId } = this.$route.query
if (+id === +currentId) {
if (id === currentId) {
this.getSessionList({ id, uin })
}
})
......
......@@ -152,8 +152,8 @@ export default {
contactPhone: addressInfo?.mobile || '',
name: addressInfo?.name || ''
}
this.winInfo = { ...this.winInfo,
address: `${addressInfo?.province || ''}-${addressInfo?.city || ''}-${addressInfo?.area || ''}-${addressInfo?.detail}`,
this.winInfo = { ...this.winInfo,
address: `${addressInfo?.province || ''}-${addressInfo?.city || ''}-${addressInfo?.area || ''}-${addressInfo?.detail}`,
contactPhone: addressInfo?.mobile || '',
name: addressInfo?.name || ''
}
......@@ -257,14 +257,14 @@ export default {
Bus.$on('LotteryInfoUpdate', data => {
const { id } = data
const { id: currentId } = this.$route.query
if (+id === +currentId) {
if (id === currentId) {
this.loadData()
}
})
Bus.$on('LotteryStateUpdate', data => {
const { id } = data
const { id: currentId } = this.$route.query
if (+id === +currentId) {
if (id === currentId) {
this.loadData()
}
})
......
......@@ -30,7 +30,8 @@ export default {
id: this.$route.query.id || null, // 接收抽奖id
sessionId: this.$route.query.sessionId || null, // 接收抽奖场次id
connection: null,
timer: null
timer: null,
trueId: null
}
},
computed: {
......@@ -40,6 +41,13 @@ export default {
lotteryInfo: 'lottery/lotteryInfo'
})
},
watch: {
trueId(nVal, oVal) {
if (nVal) {
this.postInfo(nVal)
}
}
},
created() {
this.connectionInit()
this.dataInit()
......@@ -79,6 +87,7 @@ export default {
this.getLotteryDetail({ id, playId, uin })
.then(() => {
this.isLoading = false
this.trueId = this.lotteryInfo.id
// 微信分享
if (UserAgents.isWx && process.client) {
const { lotteryInfo } = this
......@@ -106,7 +115,7 @@ export default {
Bus.$on('LotteryInfoUpdate', data => {
const { id } = data
const { uin, id: currentId, sessionId: currentPlayId } = this
if (+id === +currentId) {
if (id === currentId) {
this.getLotteryDetail({ id, playId: currentPlayId, uin })
}
})
......@@ -114,7 +123,7 @@ export default {
Bus.$on('LotteryStateUpdate', data => {
const { id, playId } = data
const { sessionId: currentPlayId, id: currentId } = this
if (+id === +currentId && +playId === +currentPlayId) {
if (id === currentId && playId === currentPlayId) {
// eslint-disable-next-line no-unused-vars
const { status, startTime, endTime, userTimes } = data
// 状态
......
......@@ -92,7 +92,7 @@ export default {
Bus.$on('LotteryInfoUpdate', data => {
const { id } = data
const { uin, id: currentId } = this.$route.query
if (+id === +currentId) {
if (id === currentId) {
this.getSessionList({ id, uin })
}
})
......
export default async function ({ route, store }) {
const { id = 0, uin = 0 } = route.query
const { uin = 0 } = route.query
try {
await store.dispatch('users/getUerInfo', { uin })
// pv统计
await store.dispatch('users/postInfo', id)
}
catch (error) {
console.log(error)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment