Commit fd519921 authored by 郑秀明's avatar 郑秀明

修改未登录跳转

parent eec050df
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
"name": "shop_mobile_uni", "name": "shop_mobile_uni",
"appid": "__UNI__F904656", "appid": "__UNI__F904656",
"description": "", "description": "",
"versionName": "1.0.19", "versionName": "1.0.22",
"versionCode": "100", "versionCode": "100",
"transformPx": false, "transformPx": false,
"app-plus": { "app-plus": {
...@@ -51,7 +51,7 @@ ...@@ -51,7 +51,7 @@
"mode": "history", "mode": "history",
"base": "/uni" "base": "/uni"
}, },
"publicPath": "https://dbc-static.oss-cn-beijing.aliyuncs.com/dbc-shop/uni/prod/1.0.19/", "publicPath": "https://dbc-static.oss-cn-beijing.aliyuncs.com/dbc-shop/uni/test/1.0.22/",
"optimization": { "optimization": {
"treeShaking": { "treeShaking": {
"enable": true "enable": true
......
...@@ -13,6 +13,9 @@ ...@@ -13,6 +13,9 @@
> >
<view class="homeContent" style="padding: 100rpx 0 110rpx;background-color: #f8f8f8;"> <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>
<view class="protocol">
<text @click="jumpPhp('app=member&act=register_agree')">《服务协议》</text> | <text @click="jumpPhp('app=member&act=register_privacy')">《隐私政策》</text>
</view>
<BottomBar /> <BottomBar />
<uni-popup ref="popup" type="center" :maskClick="true"> <uni-popup ref="popup" type="center" :maskClick="true">
<view class='coupon_dialog'> <view class='coupon_dialog'>
...@@ -21,30 +24,32 @@ ...@@ -21,30 +24,32 @@
</view> </view>
</uni-popup> </uni-popup>
</view> </view>
</skeleton> </skeleton>
</template> </template>
<script> <script>
import SearchBar from './components/searchbar.vue'; import SearchBar from './components/searchbar.vue';
import Navigation from './components/navigation.vue'; import Navigation from './components/navigation.vue';
import Slide from './components/slide.vue'; import Slide from './components/slide.vue';
import MainTitle from './components/maintitle.vue'; import MainTitle from './components/maintitle.vue';
import GoodsList from './components/goodslist.vue'; import GoodsList from './components/goodslist.vue';
import FunctionMenu from './components/functionmenu.vue'; import FunctionMenu from './components/functionmenu.vue';
import Promotion from './components/promotion.vue'; import Promotion from './components/promotion.vue';
import HotRecommd from './components/hotrecommd.vue'; import HotRecommd from './components/hotrecommd.vue';
import CustomStyle from './components/custowstyle.vue'; import CustomStyle from './components/custowstyle.vue';
import MultImage from './components/multimage.vue'; import MultImage from './components/multimage.vue';
import BottomBar from "@/components/BottomBar/BottomBar.vue"; import BottomBar from "@/components/BottomBar/BottomBar.vue";
import uniPopup from '@/components/uni-popup/uni-popup.vue'; import uniPopup from '@/components/uni-popup/uni-popup.vue';
import Skeleton from '@/components/J-skeleton/J-skeleton.vue'; import Skeleton from '@/components/J-skeleton/J-skeleton.vue';
export default { import { php } from '../../common/host.js';
data() { export default {
return { data() {
return {
data: [], data: [],
isLogin: 0, isLogin: 0,
fixFlag: false, fixFlag: false,
loading: true, loading: true,
from_login: 0,
skeleton1 : { skeleton1 : {
avatarSize: '160rpx', avatarSize: '160rpx',
row: 2, row: 2,
...@@ -56,10 +61,12 @@ ...@@ -56,10 +61,12 @@
avatarShape: 'square', avatarShape: 'square',
titleWidth: '100%' titleWidth: '100%'
}, },
COUPON_ID: '185' //优惠券ID COUPON_ID: '185' //优惠券ID
} }
}, },
onLoad() { onLoad(option) {
const {from_login} = option;
this.from_login = from_login;
this.loading = true; this.loading = true;
this.getData(); this.getData();
// uni.showLoading({ // uni.showLoading({
...@@ -98,6 +105,10 @@ ...@@ -98,6 +105,10 @@
// 获取是否领取优惠券 // 获取是否领取优惠券
if(res.data.login_flg === 1){ if(res.data.login_flg === 1){
this.get_coupon(res.data.reg_time); this.get_coupon(res.data.reg_time);
}else{
// if(!this.from_login){
// window.location.href = `${php}app=member&act=login`
// }
} }
}else{ }else{
uni.showToast({ uni.showToast({
...@@ -121,6 +132,9 @@ ...@@ -121,6 +132,9 @@
this.$jump(`${origin}/mobile/index.php?app=coupon&act=view&id=${this.COUPON_ID}`); this.$jump(`${origin}/mobile/index.php?app=coupon&act=view&id=${this.COUPON_ID}`);
this.$refs.popup.close(); this.$refs.popup.close();
}, },
jumpPhp(url){
window.location.href = `${php}${url}`;
},
// 向小程序发送数据 // 向小程序发送数据
postData(){ postData(){
jWeixin.miniProgram.getEnv(function (res) { jWeixin.miniProgram.getEnv(function (res) {
...@@ -156,30 +170,40 @@ ...@@ -156,30 +170,40 @@
} }
}) })
} }
}, },
components: { components: {
BottomBar, BottomBar,
SearchBar, SearchBar,
Navigation, Navigation,
Slide, Slide,
MainTitle, MainTitle,
GoodsList, GoodsList,
FunctionMenu, FunctionMenu,
Promotion, Promotion,
HotRecommd, HotRecommd,
CustomStyle, CustomStyle,
MultImage, MultImage,
uniPopup, uniPopup,
Skeleton Skeleton
} }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.homeContent{ .homeContent{
padding: 100rpx 0 110rpx; padding: 100rpx 0 110rpx;
background-color: #f8f8f8; background-color: #f8f8f8;
} }
.protocol{
font-size: 24rpx;
text-align: center;
height: 46rpx;
line-height: 46rpx;
text{
color: #B1825A;
font-size: 24rpx;
}
}
.coupon_dialog{ .coupon_dialog{
width: 600rpx; width: 600rpx;
height: 786rpx; height: 786rpx;
...@@ -203,5 +227,5 @@ ...@@ -203,5 +227,5 @@
text-align: center; text-align: center;
border-radius: 84rpx; border-radius: 84rpx;
} }
} }
</style> </style>
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