Commit 1864773e by hank

bug

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