Commit ef4cb324 authored by Xuguangxing's avatar Xuguangxing

feat: 更改api地址

parent 08fc1cb1
...@@ -195,7 +195,10 @@ import groupDescInfo from './components/groupDescInfo'; ...@@ -195,7 +195,10 @@ import groupDescInfo from './components/groupDescInfo';
import { mapState } from 'vuex'; import { mapState } from 'vuex';
import sharePic from '@/components/sharePic'; import sharePic from '@/components/sharePic';
import localStorage from '@/service/localStorage.service'; import localStorage from '@/service/localStorage.service';
import goodsCheckMixin from '@/mixins/goodsCheck.mixin'; // import goodsCheckMixin from '@/mixins/goodsCheck.mixin';
import Bridge from '@qg/js-bridge';
import MpBridge from '@/service/mp';
import { isWxMp, isApp } from '@/service/validation.service';
export default { export default {
// eslint-disable-next-line vue/name-property-casing // eslint-disable-next-line vue/name-property-casing
name: 'goodDetail', name: 'goodDetail',
...@@ -213,7 +216,7 @@ export default { ...@@ -213,7 +216,7 @@ export default {
filters: { filters: {
Img2Thumb Img2Thumb
}, },
mixins: [goodsCheckMixin], // mixins: [goodsCheckMixin],
data() { data() {
return { return {
timestemp: '', // 大活动结束时间 timestemp: '', // 大活动结束时间
...@@ -284,6 +287,48 @@ export default { ...@@ -284,6 +287,48 @@ export default {
}, 5000); }, 5000);
}, },
methods: { methods: {
getToken() {
window.xyqbNativeEvent = function(res) {
const json = typeof res === 'string' ? JSON.parse(res) : res;
if (json.event === 'getTokenSuccess') {
const appData = json.data || {};
if (appData && appData.token) {
localStorage.set('vccToken', appData.token);
window.location.reload();
}
}
};
this.nativeBridge.getToken();
},
checkLogin() {
const vccToken = localStorage.get('vccToken');
const needLogin = vccToken ? false : true;
if (needLogin) {
if (isApp) this.nativeBridge = new Bridge();
else if (isWxMp) this.nativeBridge = new MpBridge();
this.$dialog({
message: '参与拼团活动需要您先进行登录哦~',
title: '',
showCancelButton: false,
confirmButtonText: '登录',
onConfirm: () => {
if (isWxMp) {
this.nativeBridge.getToken();
} else if (isApp) {
// native调用getToken
this.getToken();
} else {
this.$dialog({
message: '请在App或小程序中参与活动~',
title: '',
showCancelButton: false,
confirmButtonText: '我知道了'
});
}
}
});
}
},
onChange(index) { onChange(index) {
this.swiperCurrent = index; this.swiperCurrent = index;
}, },
......
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 to comment