Commit 536b25df authored by Xuguangxing's avatar Xuguangxing

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

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