Commit 14f4ecf0 authored by 郑秀明's avatar 郑秀明

bug 修改

parent bc960610
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
// export const php = 'https://jingxiang.pet-dbc.cn/mobile/index.php?' // export const php = 'https://jingxiang.pet-dbc.cn/mobile/index.php?'
// php正式环境 // php正式环境
export const php = 'https://shop.pet-dbc.cn/mobile/index.php?' // export const php = 'https://shop.pet-dbc.cn/mobile/index.php?'
// go测试环境 // go测试环境
// export const go = 'https://tm.pet-dbc.cn' // export const go = 'https://tm.pet-dbc.cn'
...@@ -14,4 +14,50 @@ export const php = 'https://shop.pet-dbc.cn/mobile/index.php?' ...@@ -14,4 +14,50 @@ export const php = 'https://shop.pet-dbc.cn/mobile/index.php?'
// export const go = 'https://jxm.pet-dbc.cn' // export const go = 'https://jxm.pet-dbc.cn'
// go正式环境 // go正式环境
export const go = 'https://m.pet-dbc.cn'; // export const go = 'https://m.pet-dbc.cn';
\ No newline at end of file
// 获取php正式环境
export const php = phpfunc();
// 获取跳转白条地址
export const go = gofunc();
/**
* 根据当前域名返回ecmall地址
* */
function phpfunc(){
const { origin } = window.location;
let url = '';
// 测试环境
if(origin.indexOf('localhost') > -1 || origin.indexOf('test') > -1){
if(origin.indexOf('test') > -1){
url = `${origin}/mobile/index.php?`;
}else{
url = 'https://test.pet-dbc.cn/mobile/index.php?';
}
}else if(origin.indexOf('jingxiang') > -1){
url = 'https://jingxiang.pet-dbc.cn/mobile/index.php?';
}else{
url = 'https://shop.pet-dbc.cn/mobile/index.php?';
}
return url;
}
/**
* 根据当前域名返回白条地址
* */
function gofunc(){
const { origin } = window.location;
let url = '';
// 测试环境
if(origin.indexOf('localhost') > -1 || origin.indexOf('test') > -1){
url = 'https://tm.pet-dbc.cn';
}else if(origin.indexOf('jingxiang') > -1){
url = 'https://jxm.pet-dbc.cn';
}else{
url = 'https://m.pet-dbc.cn';
}
return url;
}
<template> <template>
<view class="navigation" :style="[{'height': style_setting.height*2+'rpx', 'height': style_setting.height*2+'rpx'}, style_setting.bg_show ? {'background-image': 'url('+style_setting.bg_url+')'} : null, {'background-color': style_setting.bg_color}]"> <view class="navigation" :style="[{'height': style_setting.height*2+'rpx', 'height': style_setting.height*2+'rpx'}, style_setting.bg_show ? {'background-image': 'url('+style_setting.bg_url+')'} : null, {'background-color': style_setting.bg_color}]">
<view> <view>
<text class="navigation_item" v-for="(item, key) in list" :key="key" v-if="item.goods_type ? item.goods_type === goods_type : true" > <text class="navigation_item" v-for="(item, key) in list" :key="key" v-if="!item.goods_type || (item.goods_type > 0 && goods_type > 0)" >
<text class="navigation_text" :style="[{'color': item.title_color}, item.title_bg_show ? {'background-image': 'url('+item.title_bg_url+')'} : '']" @click="$jump(item.link)"> <text class="navigation_text" :style="[{'color': item.title_color}, item.title_bg_show ? {'background-image': 'url('+item.title_bg_url+')'} : '']" @click="$jump(item.link)">
<i v-if="item.title_icon_show" class="navigation_icon" :style="{'background-image': 'url('+item.title_icon_url+')'}"></i> <i v-if="item.title_icon_show" class="navigation_icon" :style="{'background-image': 'url('+item.title_icon_url+')'}"></i>
<text v-if="item.title_show">{{item.title}}</text> <text v-if="item.title_show">{{item.title}}</text>
...@@ -22,12 +22,21 @@ ...@@ -22,12 +22,21 @@
return { return {
style_setting: this.wrapper_props.style_setting, style_setting: this.wrapper_props.style_setting,
list: this.wrapper_props.list, list: this.wrapper_props.list,
goods_type: '' goods_type: '-1' //默认不可见
} }
}, },
mounted() { mounted() {
const goods_type = getCurrentPages()[0]['$route']['query']['goods_type'] || ''; const goods_type = getCurrentPages()[0]['$route']['query']['goods_type'] || '-1';
this.goods_type = goods_type; const gt = uni.getStorageSync('goods_type');
// 判断goods_type是否有值
if(goods_type === '-1' && gt){
this.goods_type = gt;
}else{
this.goods_type = goods_type;
}
if(this.goods_type){
uni.setStorageSync('goods_type', this.goods_type);
}
} }
} }
</script> </script>
...@@ -37,12 +46,12 @@ ...@@ -37,12 +46,12 @@
display: flex; display: flex;
align-items: center; align-items: center;
white-space: nowrap; white-space: nowrap;
overflow: scroll; overflow-x: auto;
background-repeat: no-repeat; background-repeat: no-repeat;
background-size: 100% 100%; background-size: 100% 100%;
padding: 0 24rpx; padding: 0 24rpx;
box-sizing: border-box; box-sizing: border-box;
border-right: 10rpx solid rgba(0,0,0,0.4); // border-right: 10rpx solid rgba(0,0,0,0.4);
.navigation_item { .navigation_item {
width: 177.5rpx; width: 177.5rpx;
display: inline-block; display: inline-block;
......
...@@ -30,11 +30,19 @@ ...@@ -30,11 +30,19 @@
} }
}, },
mounted() { mounted() {
const goods_type = getCurrentPages()[0]['$route']['query']['goods_type'] || ''; let goods_type = getCurrentPages()[0]['$route']['query']['goods_type'] || '-1';
const { infinite } = this.slide_setting; const { infinite } = this.slide_setting;
const list = []; const list = [];
const gt = uni.getStorageSync('goods_type');
// 判断goods_type是否有值
if(goods_type === '-1' && gt){
goods_type = gt;
}
if(goods_type){
uni.setStorageSync('goods_type', goods_type);
}
this.slide_list.map((item, index) => { this.slide_list.map((item, index) => {
if((item.goods_type && item.goods_type === goods_type) || !item.goods_type) { if((item.goods_type > 0 && goods_type > 0) || !item.goods_type) {
list.push(item) list.push(item)
} }
}); });
...@@ -45,7 +53,6 @@ ...@@ -45,7 +53,6 @@
this.autoplay = false; this.autoplay = false;
}, time); }, time);
} }
}, },
methods: { methods: {
change(e) { change(e) {
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
:avatarShape='skeleton1.avatarShape' :avatarShape='skeleton1.avatarShape'
:titleWidth='skeleton1.titleWidth' :titleWidth='skeleton1.titleWidth'
> >
<view class="homeContent"> <view class="homeContent" style="padding: 100rpx 0 110rpx;background-color: #f8f8f8;">
<component v-for="(item, index) in data" :key="index" :is="item.name" :wrapper_props="item.wrapper_props" :isLogin="isLogin" :ref="item.name"></component> <component v-for="(item, index) in data" :key="index" :is="item.name" :wrapper_props="item.wrapper_props" :isLogin="isLogin" :ref="item.name"></component>
<BottomBar /> <BottomBar />
<uni-popup ref="popup" type="center" :maskClick="false"> <uni-popup ref="popup" type="center" :maskClick="false">
...@@ -95,10 +95,10 @@ ...@@ -95,10 +95,10 @@
this.loading = false; this.loading = false;
// 打开广告弹窗 // 打开广告弹窗
const timestamp = new Date('2020/05/18 00:00:00').getTime() / 1000; const timestamp = new Date('2020/05/18 00:00:00').getTime() / 1000;
console.log(timestamp); // console.log(timestamp);
if(res.data.login_flg === 1 && res.data.reg_time > timestamp){ if(res.data.login_flg === 1 && res.data.reg_time > timestamp){
setTimeout(() => { setTimeout(() => {
this.$refs.popup.open(); // this.$refs.popup.open();
}, 600); }, 600);
} }
}else{ }else{
...@@ -137,8 +137,8 @@ ...@@ -137,8 +137,8 @@
} }
</script> </script>
<style lang="less" scoped> <style>
.homeContent { .homeContent{
padding: 100rpx 0 110rpx; padding: 100rpx 0 110rpx;
background-color: #f8f8f8; background-color: #f8f8f8;
} }
......
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