Commit 536b25df authored by Xuguangxing's avatar Xuguangxing

fix: 处理线上右上角分享标题、主图的问题

parent 83f37962
...@@ -105,6 +105,12 @@ ...@@ -105,6 +105,12 @@
</script> </script>
</head> </head>
<body> <body>
<script src="https://cdn.bootcdn.net/ajax/libs/vConsole/3.9.0/vconsole.min.js"></script>
<script>
// init vConsole
var vConsole = new VConsole();
console.log('Hello world');
</script>
<noscript> <noscript>
<strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong> <strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
</noscript> </noscript>
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
<div id="app"> <div id="app">
<cr-nav-bar v-if="header" :title="title" left-text="" @click-left="backFun" /> <cr-nav-bar v-if="header" :title="title" left-text="" @click-left="backFun" />
<div class="app"> <div class="app">
<Weapp v-if="isWeixinBrowser" jump-url="/pages/user/login" />
<router-view /> <router-view />
</div> </div>
<div v-if="loading" class="loading-container"> <div v-if="loading" class="loading-container">
...@@ -13,13 +14,14 @@ ...@@ -13,13 +14,14 @@
<script> <script>
import { mapState } from 'vuex'; import { mapState } from 'vuex';
import NetError from '@/components/NetError'; import NetError from '@/components/NetError';
import { isApp, isWxMp } from '@/service/validation.service'; import { isApp, isWxMp, isWechat } from '@/service/validation.service';
import store from '@/store'; import store from '@/store';
import Weapp from '@/components/weapp';
export default { export default {
name: 'App', name: 'App',
components: { components: {
NetError NetError,
Weapp
}, },
data() { data() {
return {}; return {};
...@@ -29,7 +31,8 @@ export default { ...@@ -29,7 +31,8 @@ export default {
title: state => state.pay.title, title: state => state.pay.title,
header: state => state.pay.header, header: state => state.pay.header,
loading: state => state.pay.loading, loading: state => state.pay.loading,
showMiniappGuide: state => state.pay.showMiniappGuide isPrimordialBrowser: state => state.pay.isPrimordialBrowser,
isWeixinBrowser: state => state.pay.isWeixinBrowser
}) })
}, },
watch: { watch: {
...@@ -42,10 +45,12 @@ export default { ...@@ -42,10 +45,12 @@ export default {
} }
}, },
$route() { $route() {
console.log(isApp, isWxMp, isWechat);
store.dispatch('change_show_mini_app_guide', { store.dispatch('change_show_mini_app_guide', {
bool: !isApp && !isWxMp ? true : false, bool: !isApp && !isWxMp && !isWechat ? true : false,
pointer: this pointer: this
}); });
store.dispatch('change_is_weixin_browser', !isApp && !isWxMp && isWechat ? true : false);
} }
}, },
methods: { methods: {
......
...@@ -33,5 +33,10 @@ export default { ...@@ -33,5 +33,10 @@ export default {
url: url, url: url,
appId: 'wx2f44c7fe7b08458d' appId: 'wx2f44c7fe7b08458d'
}); });
},
getScheme(data) {
return http.get(`${talosHost}/api/kdsp/ka/info/getShareMiniUrl`, data, {
hideLoading: true
});
} }
}; };
...@@ -7,9 +7,9 @@ ...@@ -7,9 +7,9 @@
const protocol = window.location.protocol; const protocol = window.location.protocol;
const qiniuHost = protocol + '//kdspstatic.q-gp.com/'; const qiniuHost = protocol + '//kdspstatic.q-gp.com/';
const shenceHost = 'https://bn.xyqb.com/sa?project=default'; // 测试地址 const shenceHost = 'https://bn.xyqb.com/sa?project=default'; // 测试地址
const talosHost = 'https://talos-vcc2.liangkebang.net'; const talosHost = 'https://talos-vcc3.liangkebang.net';
const faceHost = 'https://auth-vcc2.liangkebang.net'; const faceHost = 'https://auth-vcc3.liangkebang.net';
const kdspHost = 'https://kdsp-api-vcc2.liangkebang.net'; const kdspHost = 'https://kdsp-api-vcc3.liangkebang.net';
const VCC_CHANNEL = ''; const VCC_CHANNEL = '';
const TERMINAL = 'H5'; const TERMINAL = 'H5';
const VERSION = '7.9.00'; const VERSION = '7.9.00';
......
...@@ -7,6 +7,7 @@ const VCC_CHANNEL = ''; ...@@ -7,6 +7,7 @@ const VCC_CHANNEL = '';
const TERMINAL = 'H5'; const TERMINAL = 'H5';
const VERSION = '7.9.00'; const VERSION = '7.9.00';
const kdspHost = 'https://kdsp-api.q-gp.com'; const kdspHost = 'https://kdsp-api.q-gp.com';
export default { export default {
// apiHost, // apiHost,
faceHost, faceHost,
......
...@@ -25,6 +25,7 @@ Vue.prototype.util = new Bridge(); ...@@ -25,6 +25,7 @@ Vue.prototype.util = new Bridge();
saService.init(router); saService.init(router);
Vue.use(lazyload); Vue.use(lazyload);
Vue.config.productionTip = false; Vue.config.productionTip = false;
Vue.config.ignoredElements = ['wx-open-launch-weapp'];
new Vue({ new Vue({
router, router,
......
import * as types from './type'; import * as types from './type';
import groupBuy from '@/api/groupBuy';
const state = { const state = {
header: true, header: true,
title: '支付中心', title: '支付中心',
loading: false, loading: false,
meta: {}, meta: {},
keepAliveMap: [], keepAliveMap: [],
showMiniappGuide: false isPrimordialBrowser: false, // 是否是原生浏览器
isWeixinBrowser: false // 是否是微信浏览器
}; };
// getters // getters
...@@ -30,6 +32,9 @@ const actions = { ...@@ -30,6 +32,9 @@ const actions = {
}, },
change_show_mini_app_guide({ commit }, obj) { change_show_mini_app_guide({ commit }, obj) {
commit(types.CHANGE_SHOW_MINI_APP_GUIDE, obj); commit(types.CHANGE_SHOW_MINI_APP_GUIDE, obj);
},
change_is_weixin_browser({ commit }, bool) {
commit(types.CHANGE_IS_WEIXIN_BROWSER, bool);
} }
}; };
...@@ -68,8 +73,11 @@ const mutations = { ...@@ -68,8 +73,11 @@ const mutations = {
[types.CLEAR_KEEP_ALIVE](state) { [types.CLEAR_KEEP_ALIVE](state) {
state.keepAliveMap = []; state.keepAliveMap = [];
}, },
[types.CHANGE_IS_WEIXIN_BROWSER](state, bool) {
state.isWeixinBrowser = bool;
},
[types.CHANGE_SHOW_MINI_APP_GUIDE](state, { bool, pointer }) { [types.CHANGE_SHOW_MINI_APP_GUIDE](state, { bool, pointer }) {
state.showMiniappGuide = bool; state.isPrimordialBrowser = bool;
if (bool) { if (bool) {
// 如果非app webview并且非小程序webview,直接拦截提示,到小程序操作 // 如果非app webview并且非小程序webview,直接拦截提示,到小程序操作
pointer.$dialog({ pointer.$dialog({
...@@ -78,6 +86,14 @@ const mutations = { ...@@ -78,6 +86,14 @@ const mutations = {
confirmButtonText: '打开微信小程序', confirmButtonText: '打开微信小程序',
onConfirm: () => { onConfirm: () => {
// todo 跳转到小程序 // todo 跳转到小程序
const getScheme = async function() {
const [res] = await groupBuy.getScheme({
miniUrl: 'pages/user/login'
});
const url = res;
window.location.href = url;
};
getScheme();
} }
}); });
} }
......
...@@ -3,6 +3,7 @@ export const CHANGE_TITLE = 'CHANGE_TITLE'; ...@@ -3,6 +3,7 @@ export const CHANGE_TITLE = 'CHANGE_TITLE';
export const CHANGE_META = 'CHANGE_META'; export const CHANGE_META = 'CHANGE_META';
export const CHANGE_LOADING = 'CHANGE_LOADING'; export const CHANGE_LOADING = 'CHANGE_LOADING';
export const CHANGE_SHOW_MINI_APP_GUIDE = 'CHANGE_SHOW_MINI_APP_GUIDE'; export const CHANGE_SHOW_MINI_APP_GUIDE = 'CHANGE_SHOW_MINI_APP_GUIDE';
export const CHANGE_IS_WEIXIN_BROWSER = 'CHANGE_IS_WEIXIN_BROWSER';
export const ADD_KEEP_ALIVE = 'ADD_KEEP_ALIVE'; export const ADD_KEEP_ALIVE = 'ADD_KEEP_ALIVE';
export const DEL_KEEP_ALIVE = 'DEL_KEEP_ALIVE'; export const DEL_KEEP_ALIVE = 'DEL_KEEP_ALIVE';
export const CLEAR_KEEP_ALIVE = 'CLEAR_KEEP_ALIVE'; export const CLEAR_KEEP_ALIVE = 'CLEAR_KEEP_ALIVE';
...@@ -164,7 +164,7 @@ ...@@ -164,7 +164,7 @@
</div> </div>
</cr-popup> </cr-popup>
<bottom-nav <bottom-nav
v-if="!showMiniappGuide" v-if="!isPrimordialBrowser && !isWeixinBrowser"
type="shoppingCar" type="shoppingCar"
:disabled="false" :disabled="false"
@buy="goVccOrDetail" @buy="goVccOrDetail"
...@@ -235,7 +235,8 @@ export default { ...@@ -235,7 +235,8 @@ export default {
return this.detailInfo.stock ? 1 : 0; return this.detailInfo.stock ? 1 : 0;
}, },
...mapState({ ...mapState({
showMiniappGuide: state => state.pay.showMiniappGuide isPrimordialBrowser: state => state.pay.showMiniappGuide,
isWeixinBrowser: state => state.pay.isWeixinBrowser
}) })
}, },
created() { created() {
...@@ -439,7 +440,7 @@ export default { ...@@ -439,7 +440,7 @@ export default {
this.swiperCurrent = e.detail.current; this.swiperCurrent = e.detail.current;
}, },
handleParamsClick(eventType, name) { handleParamsClick(eventType, name) {
if (this.showMiniappGuide) return; if (this.isPrimordialBrowser) return;
this.currentPopupType = eventType; this.currentPopupType = eventType;
this.currentPopupName = name; this.currentPopupName = name;
switch (eventType) { switch (eventType) {
......
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
</template> </template>
<!-- 底部 --> <!-- 底部 -->
<bottom-nav <bottom-nav
v-if="orderInfo.shopSkuList.length && !showMiniappGuide" v-if="orderInfo.shopSkuList.length && !isPrimordialBrowser && !isWeixinBrowser"
type="submitOrder" type="submitOrder"
:info="orderInfo.calcFeeInfo" :info="orderInfo.calcFeeInfo"
@buy="handleBuy" @buy="handleBuy"
......
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