Commit 1864773e by hank

bug

parent c92e045c
......@@ -2,7 +2,9 @@
<section class="detailWrap">
<div v-if="pictureInfo">
<div v-if="imgLock" :class="['imgBox',top0]">
<img ref="picte" :src="pictureInfo.image" alt>
<img ref="picte" v-if="!pictureInfo.video" :src="pictureInfo.image" alt>
<video ref="picte" controls v-if="pictureInfo.video" :src="pictureInfo.video" alt>
</video>
</div>
<div v-else class="loadingBox">loading</div>
<div class="userInfo">
......@@ -335,7 +337,16 @@ export default {
});
},
share() {
this.shareOnoff = true;
var _this = this
window.wx.miniProgram.getEnv(function (res) {
if (res.miniprogram) {
// alert(res.miniprogram)
window.wx.miniProgram.postMessage({data: {id: '1234'}, page: 'detail'}); // 传的参数
} else {
_this.shareOnoff = true;
}
})
// this.shareOnoff = true;
},
closeShare() {
this.shareOnoff = false;
......@@ -519,6 +530,11 @@ export default {
transform: translate(-50%, -50%);
img {
width: 100%;
height: auto;
}
video {
width: 100%;
height: auto;
}
}
......
......@@ -31,7 +31,7 @@ var wrapHref = ( mode === 'development' ? 'http://web-comment.iyunfish.cn' : 'ht
//首页地址
var indexHref = url + '/video/index.html';
// 个人中心地址
var userCenterHref = url + '/video/user.html';
var userCenterHref = 'https://wanda-h5.bdideal.com' + '/video/user.html';
var shareImg = url + '/static/share.jpg';
var signHref = 'http://mr-static.maxrocky.com/h5/wanda/dzgp/index.html'
export default{
......
......@@ -17,6 +17,9 @@ axios.interceptors.request.use(
if (store.state.token) {
config.headers['accessToken'] = store.state.token // 让每个请求携带token--['ticket']为自定义key 请根据实际情况自行修改
}
if (store.state.type) {
config.headers['type'] = store.state.type // 让每个请求携带token--['ticket']为自定义key 请根据实际情况自行修改
}
if (!config.headers['Content-Type']) {
if (config.url != '/upload') {
config.headers['Content-Type'] = 'application/json'
......
......@@ -15,7 +15,8 @@ export default new Vuex.Store({
ruweiBoxScroll: 0,
ruweigonggao: null,
userInfo: localStorage.getItem('userInfo') || {},
token: localStorage.getItem('token') || ''
token: localStorage.getItem('token') || '',
type: localStorage.getItem('type') || ''
},
mutations: {
changeLastBoxScrollY(state, num) {
......@@ -59,6 +60,10 @@ export default new Vuex.Store({
state.token = token
localStorage.setItem('token', JSON.stringify(token))
},
setType (state, type) {
state.type = type
localStorage.setItem('type', JSON.stringify(type))
},
getAuth (state, auth) {
},
......@@ -83,8 +88,13 @@ export default new Vuex.Store({
actions: {
getAuth({commit,state}) {
window.localStorage.removeItem('token')
window.localStorage.removeItem('type')
return new Promise((resolve, reject) => {
axios.get('/weixin/info').then(res => {
axios.get('/weixin/info', {
params : {
type: 1
}
}).then(res => {
window.localStorage.setItem('callbackurl', location.href)
location.href = res.data.data.url
})
......@@ -99,7 +109,9 @@ export default new Vuex.Store({
}
}).then(res => {
window.localStorage.setItem('token', res.data.data.accessToken)
window.localStorage.setItem('type', res.data.data.type)
state.token = res.data.data.accessToken
state.type = res.data.data.type
// location.href = res.data.data.url + '/video/2.html'
resolve(res.data.data.accessToken)
commit('getUserInfo')
......
......@@ -121,7 +121,7 @@
<!-- <a v-show="tabActive !== 3" href="./user.html" class="user"></a> -->
<a v-show="tabActive !== 3" :href="userCenter" class="user"></a>
<mt-actionsheet :actions="wangqiTitle" v-model="wangqiList"></mt-actionsheet>
<Fuceng v-if="fucengButton=== 'close'?false:true"></Fuceng>
<!-- <Fuceng v-if="fucengButton=== 'close'?false:true"></Fuceng> -->
</div>
</template>
......@@ -1244,7 +1244,7 @@ export default {
}
.joinus {
position: fixed;
// position: fixed;
bottom: 0;
width: 100%;
height: 90px;
......
......@@ -94,6 +94,9 @@ router.beforeEach((to, from, next) => {
_hmt.push(['_trackPageview', '/#' + to.fullPath]);
}
}
if(getQuery('type')) {
store.commit('setType', getQuery('type'))
}
if(getQuery('code') && !store.state.token) {
store.dispatch('getToken', getQuery('code')).then(res => {
next()
......
......@@ -72,6 +72,9 @@ router.beforeEach((to, from, next) => {
_hmt.push(['_trackPageview', '/#' + to.fullPath]);
}
}
if(getQuery('type')) {
store.commit('setType', getQuery('type'))
}
if(getQuery('code') && !store.state.token) {
store.dispatch('getToken', getQuery('code')).then(res => {
next()
......
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