Authored by TaoHuang

add switch service close

... ... @@ -7,7 +7,7 @@
</template>
<script>
import {mapState, mapMutations} from 'vuex';
import { mapState, mapMutations, mapActions } from 'vuex';
export default {
name: 'App',
... ... @@ -29,7 +29,6 @@ export default {
// this.$xianyu.setXianyuWebview();
this.$xianyu.setXianyuNav();
this.$sdk.getUser().then(user => {
if (user && user.uid) {
this.SET_LOGIN_INFO(user);
... ... @@ -41,6 +40,7 @@ export default {
}
});
this.getZkConfig();
},
watch: {
'yoho.context.needLogin': function(newVal) {
... ... @@ -50,7 +50,8 @@ export default {
},
},
methods: {
...mapMutations(['SET_LOGIN_INFO'])
...mapMutations(['SET_LOGIN_INFO']),
...mapActions(['getZkConfig'])
}
};
</script>
... ...
... ... @@ -9,19 +9,15 @@
</template>
<script>
import {createNamespacedHelpers} from 'vuex';
import { createNamespacedHelpers } from 'vuex';
const {mapState, mapActions} = createNamespacedHelpers('home/mine');
const { mapState, mapActions } = createNamespacedHelpers('home/mine');
export default {
name: 'scroll',
props: {
},
props: {},
data() {
return {
};
return {};
},
computed: {
...mapState({
... ... @@ -31,10 +27,10 @@ export default {
},
mounted() {
this.fetchRollBoardList().then((data) => {
if(data.length > 1) {
this.scrollTimer = setInterval(this.showMarquee, 3000)
if (data.length > 1) {
this.scrollTimer = setInterval(this.showMarquee, 3000);
}
})
});
},
beforeDestroy() {
... ... @@ -42,9 +38,9 @@ export default {
clearInterval(this.scrollTimer);
},
methods: {
...mapActions(['fetchRollBoardList','showMarquee','hideMarquee']),
...mapActions(['fetchRollBoardList', 'showMarquee', 'hideMarquee']),
}
}
};
</script>
<style lang="scss" scoped>
... ... @@ -65,7 +61,7 @@ export default {
.marquee_top {
transition: all 0.8s;
margin-top: -90px
margin-top: -90px;
}
.marquee_list li {
... ...
... ... @@ -8,12 +8,13 @@
</template>
<script>
import { createNamespacedHelpers } from "vuex";
import { createNamespacedHelpers, mapState } from 'vuex';
import { get } from 'lodash';
const { mapActions } = createNamespacedHelpers("home/mine");
const { mapActions } = createNamespacedHelpers('home/mine');
export default {
name: "tabItem",
name: 'tabItem',
props: {
data: {
type: Object,
... ... @@ -61,35 +62,39 @@ export default {
},
titleClass() {
return {
"title-bold": this.titleBold,
"title-small": this.titleSmall
'title-bold': this.titleBold,
'title-small': this.titleSmall
};
}
},
...mapState(['yoho'])
},
mounted() {
},
methods: {
goPage({ page: name, params = {} }) {
if (!name) {
return;
}
if (name === 'service') {
if (get(this.yoho.config, 'closeservice', false)) {
this.$createDialog({
type: 'alert',
content: '请致电 <a href="tel:400-889-9646"> 400-889-9646 </a>联系有货客服',
confirmBtn: {
text: '我知道了',
active: true
}
if(name === 'service') {
// this.$createDialog({
// type: 'alert',
// content: '请致电 <a href="tel:400-889-9646"> 400-889-9646 </a>联系有货客服',
// confirmBtn: {
// text: '我知道了',
// active: true
// }
// }).show()
// this.$router.push({path: '/xianyu-service/service/im'})
}).show();
} else {
this.$xianyu.goXianyuNewPage({
url: window.location.origin+'/xianyu-service/service/im'
url: window.location.origin + '/xianyu-service/service/im?nodownload=1'
});
return
}
return;
}
this.$router.push({ name, params });
}
}
... ... @@ -103,19 +108,23 @@ export default {
height: 120px;
line-height: 120px;
}
.tab-icon {
font-size: 36px;
color: #444;
}
.small {
height: 90px;
line-height: 90px;
}
.title-small {
font-size: 30px;
}
.grey {
background-color: #F2F2F2;
background-color: #f2f2f2;
margin: 0 -40px;
padding: 0 40px;
}
... ... @@ -139,7 +148,8 @@ export default {
color: black;
text-align: right;
font-size: 32px;
@include num
@include num;
}
.cubeic-arrow {
... ...
... ... @@ -48,18 +48,18 @@ export default {
this.fetchFavoriteNum();
this.fetchOrderSummary();
this.fetchSellerOrder();
this.fetchAssets(true)
this.fetchAssets(true);
// this.fetchUserWalletInfo();
this.fetchCoupon();
},
beforeRouteEnter (to, from, next) {
beforeRouteEnter(to, from, next) {
// 从我的绑定支付宝后进入交易明细
next(vm => {
let isbind = vm.$store.state.home.bindAccount.validStatus === 1
if(isbind && from.name === 'bindAccount') {
vm.$router.push({name: 'tradeIncome'})
let isbind = vm.$store.state.home.bindAccount.validStatus === 1;
if (isbind && from.name === 'bindAccount') {
vm.$router.push({ name: 'tradeIncome' });
}
})
});
},
methods: {
...mapActions(['fetchFavoriteNum', 'fetchResource', 'fetchSellerOrder', 'fetchOrderSummary', 'fetchAssets', 'fetchUserWalletInfo', 'fetchCoupon']),
... ...
... ... @@ -40,6 +40,7 @@ export default function(mergeState = {}) {
direction: 'forword',
homePage: true,
user: {},
config: {}
},
mergeState,
),
... ... @@ -137,6 +138,9 @@ export default function(mergeState = {}) {
[Types.UPDATE_SYSTEM_CONFIG_QIUGOU](state, { enabled }) {
state.context.enableQiugou = enabled;
},
[Types.FETCH_XIANYU_CONFIG](state, data) {
state.config = data;
}
},
getters: {
getLogin(state) {
... ... @@ -253,6 +257,14 @@ export default function(mergeState = {}) {
return isEnabled;
},
async getZkConfig({ commit }) {
const res = await this.$api.post('/config');
if (res.code === 200) {
commit(Types.FETCH_XIANYU_CONFIG, res.data);
}
}
},
};
}
... ...
... ... @@ -19,3 +19,5 @@ export const UPDATE_SYSTEM_CONFIG_QIUGOU = 'UPDATE_SYSTEM_CONFIG_QIUGOU';
export const FETCH_USER_INFO_FAILD = 'FETCH_USER_INFO_FAILD';
export const FETCH_USER_INFO_SUCCESS = 'FETCH_USER_INFO_SUCCESS';
export const FETCH_XIANYU_CONFIG = 'FETCH_XIANYU_CONFIG';
... ...
... ... @@ -12,7 +12,7 @@ const isTest = process.env.NODE_ENV === 'test3';
const domains = {
// api: 'http://api.yoho.cn/',
// service: 'http://service.yoho.cn/',
// ufo: 'http://java-yohoufo-fore.test3.ingress.dev.yohocorp.com/ufo-gateway/',
// ufo: 'http://2.yobobuy.cn',
// liveApi: 'http://testapi.live.yohops.com:9999/',
// singleApi: 'http://api-test3.yohops.com:9999/',
... ... @@ -37,7 +37,7 @@ module.exports = {
assetUrl: '//m.yohobuy.com:5001/yohoapp-node/',
testCode: 'yoho4946abcdef#$%&!@',
domains,
yohoVerifyUdid: 'ca5c462a-e28b-407d-8061-5e204398e3cc',
// yohoVerifyUdid: 'ca5c462a-e28b-407d-8061-5e204398e3cc',
signExtend: {
business_line: 'yohobuy',
business_client: 'h5/xianyu',
... ...
... ... @@ -117,6 +117,13 @@ exports.createApp = async(app) => {
});
}
app.post('/xianyu/config', (req, res) => {
res.json({
code: 200,
data: _.get(req.app.locals.wap, 'xianyu', {})
});
});
app.use('/xianyu', ssrApiMiddleware);
app.use(ssrRouteMiddleware.routers);
... ...