gyh change

This commit is contained in:
Gdpao 2020-07-31 08:45:30 +08:00
parent 8bb1cdfd39
commit d817d0c28b
15 changed files with 708 additions and 460 deletions

27
App.vue
View File

@ -1,6 +1,27 @@
<script> <script>
export default {} import { mapMutations } from 'vuex';
export default {
onLaunch() {
// token
uni.getStorage({
key: "token",
success: (res) => {
this.loginIn(res.data);
}
})
},
methods: {
...mapMutations(['loginIn'])
}
}
</script> </script>
<style lang="scss"> <style lang="scss">
@import "/static/css/normalize"; /* #ifndef APP-PLUS-NVUE */
</style> @import "/static/css/normalize";
/* #endif */
/* 顶部自定义导航留白 */
.status_bar {
width: 100%;
height: var(--status-bar-height);
}
</style>

View File

@ -48,7 +48,7 @@
export default { export default {
data() { data() {
return { return {
remaining: 4, remaining: 11,
type: true, type: true,
banner: false, banner: false,
protocol: false, protocol: false,
@ -142,12 +142,19 @@
uni.getSystemInfo({ uni.getSystemInfo({
success: function(res) { success: function(res) {
that.heightOut = res.windowHeight; that.heightOut = res.windowHeight;
console.log('666666666666666' + that.heightOut) console.log(that.heightOut)
} }
}); });
}, },
// //
to_agree() { to_agree() {
uni.setStorage({
key: 'launchFlag',
data: true,
success: function() {
console.log('error时存储launchFlag');
}
});
uni.navigateTo({ uni.navigateTo({
url: '/pageA/login/login' url: '/pageA/login/login'
}); });
@ -174,8 +181,7 @@
}) })
}, },
videoErrorCallback: function(e) { videoErrorCallback: function(e) {
console.log('视频错误信息:') console.log('视频错误信息:',e);
console.log(e.target.errMsg)
}, },
getRandomColor: function() { getRandomColor: function() {
const rgb = [] const rgb = []
@ -222,19 +228,18 @@
// height: 400rpx; // height: 400rpx;
} }
.welcome_jumpes { .welcome_jumpes {
width: 94rpx; z-index: 10;
height: 36rpx;
opacity: 0.5;
border-radius: 18rpx;
position: absolute; position: absolute;
right: 37rpx; top: 80rpx;
top: 66rpx; right: 60rpx;
width: 100rpx;
height: 40rpx;
border-radius: 20rpx;
font-size: 22rpx; font-size: 22rpx;
text-align: center; text-align: center;
line-height: 35rpx; line-height: 40rpx;
color: #fff; color: #fff;
background: #C4CAC6; background-color: rgba(0,0,0,0.5);
z-index: 10;
} }
#myVideo { #myVideo {
@ -257,8 +262,8 @@
.welcome_images { .welcome_images {
width: 100%; width: 100%;
height: 100vh;
position: fixed; position: fixed;
height: 100%
} }
uni-swiper, uni-swiper,
@ -266,7 +271,7 @@
uni-image { uni-image {
width: 100%; width: 100%;
// position: fixed; // position: fixed;
height: 100% height: 100vh;
} }
uni-image { uni-image {

View File

@ -23,7 +23,9 @@
"Push" : {}, "Push" : {},
"Maps" : {}, "Maps" : {},
"LivePusher" : {}, "LivePusher" : {},
"Payment" : {} "Payment" : {},
"VideoPlayer" : {},
"Speech" : {}
}, },
/* */ /* */
"distribute" : { "distribute" : {
@ -64,6 +66,12 @@
"oauth" : { "oauth" : {
"qq" : { "qq" : {
"appid" : "101884160" "appid" : "101884160"
},
"apple" : {},
"weixin" : {
"appid" : "wx556db1531ec35dc7",
"appsecret" : "f441fc15dd21543871a818f40ce92016",
"UniversalLinks" : "https://demo.dcloud.net.cn/ulink/"
} }
}, },
"maps" : { "maps" : {
@ -72,7 +80,20 @@
"appkey_android" : "8045e8a4cd6d544690c786265b248f91" "appkey_android" : "8045e8a4cd6d544690c786265b248f91"
} }
}, },
"share" : {} "share" : {
"weixin" : {
"appid" : "wx556db1531ec35dc7",
"UniversalLinks" : "https://demo.dcloud.net.cn/ulink/"
}
},
"speech" : {},
"payment" : {
"alipay" : {},
"weixin" : {
"appid" : "wx556db1531ec35dc7",
"UniversalLinks" : "https://demo.dcloud.net.cn/ulink/"
}
}
} }
} }
}, },

View File

@ -43,11 +43,11 @@
<u-mask :show="show" @click="show = false"> <u-mask :show="show" @click="show = false">
<view class="warp"> <view class="warp">
<view class="rect" @tap.stop> <view class="rect" @tap.stop>
<view class="rect_view" @click="rect_qq()"> <view class="rect_view" @click="loginOther(1)">
<image src="../../static/pageA/qq.png" class="image"></image> <image src="../../static/pageA/qq.png" class="image"></image>
<view>QQ登录</view> <view>QQ登录</view>
</view> </view>
<view class="rect_view"> <view class="rect_view" @click="loginOther(2)">
<image src="../../static/pageA/weixin.png" class="image"></image> <image src="../../static/pageA/weixin.png" class="image"></image>
<view>微信登录</view> <view>微信登录</view>
</view> </view>
@ -61,7 +61,9 @@
</template> </template>
<script> <script>
import identifying from '@/components/logininput/identifying' import identifying from '@/components/logininput/identifying'
import { mapMutations } from 'vuex'; import {
mapMutations
} from 'vuex';
export default { export default {
data() { data() {
return { return {
@ -83,29 +85,43 @@
sms_code: '', // sms_code: '', //
// //
pact_text: [{ pact_text: [{
"id": '1', "id": '1',
"text": "《用户协议》" "text": "《用户协议》"
}, { }, {
"id": '2', "id": '2',
"text": "《隐私协议》" "text": "《隐私协议》"
}, { }, {
"id": '3', "id": '3',
"text": "《使用协议》" "text": "《使用协议》"
}, }, ],
temp_url: "", //
] pagesArr: ["pages/mine/index"], //
}; };
}, },
onLoad() { onLoad() {
// //
this.apiwelcome(); this.apiwelcome();
}, },
onShow() {
let pages = getCurrentPages();
let prePage = pages[pages.length - 2];
this.temp_url = prePage.route;
// console.log(this.temp_url);
},
//
onBackPress(e) {
console.log(1, e);
if (this.pagesArr.includes(this.temp_url) && !this.hasLogin) {
uni.switchTab({
url: '../../pages/index/index'
})
return true;
}
},
methods: { methods: {
...mapMutations(['loginIn']), ...mapMutations(['loginIn']),
apiwelcome() { apiwelcome() {
this.$u.api.sendSmsCode({ this.$u.api.sendSmsCode({}).then((res) => {
}).then((res) => {
console.log(res) console.log(res)
}) })
}, },
@ -189,8 +205,7 @@
// type: 'success', // type: 'success',
// url: '/pageA/topick/topick' // url: '/pageA/topick/topick'
// }) // })
} } else {
if (res.errCode == 1) {
this.$refs.uToast.show({ this.$refs.uToast.show({
title: res.message, title: res.message,
type: 'error' type: 'error'
@ -199,40 +214,75 @@
}) })
}, },
// qq // qq
rect_qq() { loginOther(type) {
console.log("授权QQ") var me = this;
var vm = this;
uni.getProvider({ uni.getProvider({
service: 'oauth', service: 'oauth',
success: function(res) { success: (res) => {
console.log('qq', res) //weixin if (type == 1) {
if (~res.provider.indexOf('qq')) {
uni.login({ uni.login({
provider: 'qq', provider: 'qq',
success: function(loginRes) { success: (qqres) => {
console.log(loginRes) console.log(qqres);
this.getApplogin(loginRes) uni.getUserInfo({
vm.$HTTP({ provider: 'qq',
method: 'GET', success: (data) => {
baseURL: 'https://graph.qq.com/user/get_user_info', console.log(data);
url: '', this.$u.api.qqLogin({
data: { member_qqopenid: data.userInfo.openId,
openid: loginRes.authResult.openid, member_nickname: data.userInfo.nickName,
access_token: loginRes.authResult.access_token, member_avatar: data.userInfo.avatarUrl,
appid: '101884160' }).then(res => {
}, console.log(res.errCode);
load: true if (res.errCode == 0) {
}).then((data) => { this.loginIn(res.data.token);
console.log(data) this.show = false;
uni.switchTab({
}, (err) => { url: "../../pages/index/index"
console.log(err) })
}); }
})
}
})
},
fail: (e) => {
console.log(e);
} }
}); });
} else { } else {
console.log("错误") uni.login({
provider: 'weixin',
success: (wxres) => {
console.log(wxres);
uni.getUserInfo({
provider: 'weixin',
success: (data) => {
console.log(data);
this.$u.api.wechatLogin({
member_wxopenid: data.userInfo.openId,
member_nickname: data.userInfo.nickName,
member_avatar: data.userInfo.avatarUrl,
}).then(res => {
console.log(res);
if (res.errCode == 0) {
this.loginIn(res.data.token);
this.show = false;
uni.switchTab({
url: "../../pages/index/index"
})
}
})
}
})
},
fail: (e) => {
console.log(e);
}
});
} }
},
fail: (e) => {
console.log(e);
} }
}); });
}, },
@ -242,10 +292,6 @@
url: '/pageA/register/register' url: '/pageA/register/register'
}); });
}, },
//
getApplogin() {
console.log("11")
},
// checkbox // checkbox
checkboxChange(e) { checkboxChange(e) {
//console.log(e); //console.log(e);

View File

@ -62,10 +62,14 @@ export default {
<style lang="scss" scoped> <style lang="scss" scoped>
.packlist{} .packlist{}
.packlist > view{ .packlist > view{
width:676px;
font-size:26rpx;
color: #333;
width: 90%; width: 90%;
margin: 0 auto; margin: 0 auto;
padding: 16upx 0;
font-size: 26upx;
color: #333;
}
.rict_type {
text-indent: 1rem;
line-height: 1.2;
} }
</style> </style>

View File

@ -10,7 +10,7 @@
</view> </view>
<!-- 标签 --> <!-- 标签 -->
<view class="tab_lable"> <view class="tab_lable">
<view :class="{'cur': rSelect.indexOf(index)!=-1}" v-for="(item,index) in tab_lables" :key="index" @click="tapClick(index)">{{item.name}}</view> <view :class="{'cur': rSelect.indexOf(index)!=-1}" v-for="(item,index) in tab_lables" :key="index" @click="tapClick(index,item.id)">{{item.name}}</view>
</view> </view>
<!-- 提交按钮 --> <!-- 提交按钮 -->
<view class="submites" @click="toHomePage">{{submites}}</view> <view class="submites" @click="toHomePage">{{submites}}</view>
@ -30,12 +30,12 @@
show: false, show: false,
tab_lables: [], tab_lables: [],
submites: '选好了进入首页', submites: '选好了进入首页',
rSelect:[] rSelect:[],
list: [],
}; };
}, },
onLoad(){ onLoad(){
// //
console.log("11111222")
this.$u.api.labelList({ this.$u.api.labelList({
}).then((res) => { }).then((res) => {
@ -59,14 +59,17 @@
this.show = !this.show this.show = !this.show
}, },
// //
tapClick(index) { tapClick(index,id) {
console.log(index) // console.log(id);
if (this.rSelect.indexOf(index) == -1) { if (this.rSelect.indexOf(index) == -1) {
console.log(index) // this.rSelect.push(index);
this.rSelect.push(index); // this.list.push(id); //
} else { } else {
this.rSelect.splice(this.rSelect.indexOf(index), 1); // this.rSelect.splice(this.rSelect.indexOf(index), 1); //
this.list.splice(this.rSelect.indexOf(id), 1); //
} }
// console.log(this.rSelect);
// console.log(this.list);
}, },
toHomePage() { toHomePage() {
uni.switchTab({ uni.switchTab({

View File

@ -1,45 +1,76 @@
<template> <template>
<view class="welcome"> <view class="welcome">
<!-- 倒计时跳过 --> <!-- 倒计时跳过 -->
<remaining></remaining> <remaining v-if="guidePages"></remaining>
</view> </view>
</template> </template>
<script> <script>
import {
mapState
} from 'vuex';
import remaining from '@/components/remaining/remaining'; import remaining from '@/components/remaining/remaining';
export default { export default {
computed: {
...mapState(['hasLogin', 'token'])
},
data() { data() {
return { return {
guidePages: true
} }
}, },
onLoad() { onLoad() {
this.loadExecution();
}, },
methods: { methods: {
loadExecution() {
}, /**
mounted(){ * 获取本地存储中launchFlag的值
}, * 若存在说明不是首次启动直接进入首页
components:{} * 若不存在说明是首次启动进入引导页
*/
// launchFlag
const value = uni.getStorageSync('launchFlag') || "";
// console.log(value, this.hasLogin);
if (value) {
this.guidePages = false;
if (this.hasLogin) {
uni.switchTab({
url: '../../pages/index/index'
});
} else {
// launchFlag=true
uni.navigateTo({
url: '../../pageA/login/login'
});
}
} else {
// launchFlag!=true
this.guidePages = true;
}
}
}
} }
</script> </script>
<style> <style>
.welcome {} .welcome {}
.welcome_jumpes{
.welcome_jumpes {
width: 90rpx; width: 90rpx;
height: 35rpx; height: 35rpx;
opacity:0.5; opacity: 0.5;
border-radius:18rpx; border-radius: 18rpx;
position: absolute; position: absolute;
right: 37rpx; right: 37rpx;
top: 34rpx; top: 34rpx;
font-size:20rpx; font-size: 20rpx;
text-align: center; text-align: center;
line-height: 35rpx; line-height: 35rpx;
color: #fff; color: #fff;
background: #C4CAC6; background: #C4CAC6;
} }
.welcome_images { .welcome_images {
width: 100%; width: 100%;
position: fixed; position: fixed;

View File

@ -1,7 +1,7 @@
<template> <template>
<view class="photo"> <view class="photo">
<view class="back"> <view class="back">
<u-icon name="close" color="#999999" :size="30"></u-icon> <u-icon name="close" color="#999999" :size="30" @click="goBack"></u-icon>
</view> </view>
<swiper class="swiper"> <swiper class="swiper">
<swiper-item> <swiper-item>
@ -128,7 +128,12 @@ export default {
console.log(res) console.log(res)
this.list = res.data.info this.list = res.data.info
}) })
} },
goBack() {
uni.navigateBack({
delta: 1
})
}
}, },
onLoad(o){ onLoad(o){
this.id = o.id this.id = o.id

View File

@ -553,14 +553,16 @@ export default {
.title{ .title{
flex-wrap: wrap; flex-wrap: wrap;
margin-bottom: 30rpx; margin-bottom: 30rpx;
line-height: 1.2;
>text{ >text{
padding: 13rpx;
font-size: 24rpx;
color:#fff;
margin-right: 13rpx;
background-color: #FF780F;
display: inline-block; display: inline-block;
border-radius: 25rpx; padding: 8rpx 10rpx;
margin: 0 10rpx 4rpx 0;
vertical-align: middle;
font-size: 20rpx;
color: #fff;
border-radius: 30rpx;
background-color: #FF780F;
} }
} }
.pic{ .pic{

View File

@ -40,7 +40,10 @@ export default {
}, },
search(value){ search(value){
// console.log(value) // console.log(value)
if(!value) this.$u.toast('搜索内容不可为空'); if(!value) {
this.$u.toast('搜索内容不可为空');
return false;
}
this.$u.route({ this.$u.route({
url: "/pageB/search/out", url: "/pageB/search/out",
params: { params: {

View File

@ -16,6 +16,7 @@
</view> </view>
<u-action-sheet v-model="sheetStatus" :list="list" :tips="tips" :border-radius="20" @click="choiceOption"> <u-action-sheet v-model="sheetStatus" :list="list" :tips="tips" :border-radius="20" @click="choiceOption">
</u-action-sheet> </u-action-sheet>
<u-modal v-model="show" show-confirm-button show-cancel-button :content="content" @confirm="loginOut"></u-modal>
</view> </view>
</template> </template>
<script> <script>
@ -67,7 +68,9 @@
title: '帮助与反馈', title: '帮助与反馈',
link: './feedback' link: './feedback'
}, },
] ],
content: "是否退出登录!",
show: false
} }
}, },
methods: { methods: {
@ -76,13 +79,19 @@
choiceOption(index) { choiceOption(index) {
console.log(index); console.log(index);
if (index == 1) { if (index == 1) {
this.logout(); this.show = true;
} }
}, },
toNextPage(url, ...params) { toNextPage(url, ...params) {
uni.navigateTo({ uni.navigateTo({
url: url url: url
}); });
},
loginOut() {
this.logout();
uni.redirectTo({
url: "../../pageA/login/login",
})
} }
}, },
}; };

View File

@ -145,17 +145,57 @@
{ {
"path": "search/index", "path": "search/index",
"style": { "style": {
"navigationBarTitleText": "", "app-plus": {
"navigationStyle": "custom" "titleNView": {
"titleColor": "#333333",
"backgroundColor": "#FFFFFF",
"buttons": [
{
"type":"none",
"text":"搜索",
"float":"right",
"fontSize":"16",
"color": "#FF780F"
}
],
"searchInput": {
"align": "left",
"borderRadius": "15px",
"placeholder": "搜索您需要的商品",
"backgroundColor": "rgb(236,236,236)",
"placeholderColor": "#999999",
"disabled": false
}
}
}
} }
}, },
{ {
"path": "search/out", "path": "search/out",
"style": { "style": {
"navigationBarTitleText": "", "app-plus": {
"navigationStyle": "custom" "titleNView": {
"titleColor": "#333333",
"backgroundColor": "#FFFFFF",
"buttons": [
{
"type":"none",
"text":"搜索",
"float":"right",
"fontSize":"16",
"color": "#FF780F"
}
],
"searchInput": {
"align": "left",
"borderRadius": "15px",
"placeholder": "搜索您需要的商品",
"backgroundColor": "rgb(236,236,236)",
"placeholderColor": "#999999",
"disabled": false
}
}
}
} }
}, },
{ {

View File

@ -1,88 +1,93 @@
<template> <template>
<view class="index"> <view>
<view class="top"> <view class="status_bar"></view>
<view class="sosuo"></view> <view class="index">
<view class="tabs"> <view class="top">
<u-tabs :is-scroll="false" bar-width="70" ref="tabs" :list="list" :current="num" :bar-style="{ <view class="sosuo"></view>
<view class="tabs">
<u-tabs :is-scroll="false" bar-width="70" ref="tabs" :list="list" :current="num" :bar-style="{
'background-color':'#FF780F', 'background-color':'#FF780F',
'bottom':'10rpx' 'bottom':'10rpx'
}" }"
inactive-color="#333" :active-item-style="{ inactive-color="#333" :active-item-style="{
'color':'#333' 'color':'#333'
}" :bold="false" }" :bold="false"
@change="dianji"></u-tabs> @change="dianji"></u-tabs>
</view>
<view class="sosuo"></view>
</view> </view>
<view class="sosuo"></view> <swiper class="card" @change="dianji" :current="num">
</view> <swiper-item>
<swiper class="card" @change="dianji" :current="num"> <scroll-view style="width:100%;height:100%" scroll-y="true">
<swiper-item> <view class="box">
<scroll-view style="width:100%;height:100%" scroll-y="true"> <!-- <indexad style="width:690rpx"></indexad> -->
<view class="box"> <u-swiper mode="dot" :list="indexImageSwiper" name="adv_code"></u-swiper>
<!-- <indexad style="width:690rpx"></indexad> --> <view class="list">
<u-swiper mode="dot" :list="indexImageSwiper" name="adv_code"></u-swiper> <view>
<view class="list"> <videoItem v-for="item in articleList.filter((_, index) => !(index&1))" :key="item.article_id" :item="item"
<view> @getArticlelist="getArticlelist"></videoItem>
<videoItem v-for="item in articleList.filter((_, index) => !(index&1))" :key="item.article_id" :item="item" </view>
@getArticlelist="getArticlelist"></videoItem> <view style="margin-left:20rpx">
</view> <videoItem v-for="item in articleList.filter((_, index) => index&1)" :key="item.article_id" :item="item"
<view style="margin-left:20rpx"> @getArticlelist="getArticlelist"></videoItem>
<videoItem v-for="item in articleList.filter((_, index) => index&1)" :key="item.article_id" :item="item"
@getArticlelist="getArticlelist"></videoItem>
</view>
</view>
</view>
</scroll-view>
</swiper-item>
<swiper-item>
<scroll-view style="width:100%;height:100%" scroll-y="true">
<view class="box">
<u-swiper mode="dot" :list="zhiboImageSwiper" name="adv_code"></u-swiper>
<view class="list">
<view>
<zhiboItem v-for="item in tabLiveLists.filter((_, index) => !(index&1))" :key="item.live_id" :name="item.store_name" :image="item.cover_img" :url="item.url"></zhiboItem>
</view>
<view style="margin-left:20rpx">
<zhiboItem v-for="item in tabLiveLists.filter((_, index) => index&1)" :key="item.live_id" :name="item.store_name" :image="item.cover_img" :url="item.url"></zhiboItem>
</view>
</view>
</view>
</scroll-view>
</swiper-item>
<swiper-item>
<scroll-view style="width:100%;height:100%" scroll-y="true">
<view class="box">
<view class="tuijian">
<view class="title" @click="toSearchPage" >
<view class="left">
<view></view>
<text>推荐达人</text>
</view> </view>
<image class="right" src="/static/image/common/1.png"></image>
</view>
<view class="tuijianlist">
<!-- <darenItem style="margin-right:23rpx"></darenItem>
<darenItem style="margin-right:23rpx"></darenItem> -->
<darenItem v-for="item in recommendList.slice(0,3)" :key="item.id" :info="item" v-on:pChangeType="changeType" ></darenItem>
</view> </view>
</view> </view>
<view class="list"> </scroll-view>
<view> </swiper-item>
<!-- <videoItem isguanzhu="true" v-for="item in 10"></videoItem> --> <swiper-item>
<videoItem isguanzhu="true" v-for="item in articleList.filter((_, index) => !(index&1))" :key="item.article_id" <scroll-view style="width:100%;height:100%" scroll-y="true">
:item="item" @getArticlelist="getArticlelist"></videoItem> <view class="box">
</view> <u-swiper mode="dot" :list="zhiboImageSwiper" name="adv_code"></u-swiper>
<view style="margin-left:20rpx"> <view class="list">
<!-- <videoItem isguanzhu="true" v-for="item in 10"></videoItem> --> <view>
<videoItem isguanzhu="true" v-for="item in articleList.filter((_, index) => index&1)" :key="item.article_id" <zhiboItem v-for="item in tabLiveLists.filter((_, index) => !(index&1))" :key="item.live_id" :name="item.store_name"
:item="item" @getArticlelist="getArticlelist"></videoItem> :image="item.cover_img" :url="item.url"></zhiboItem>
</view>
<view style="margin-left:20rpx">
<zhiboItem v-for="item in tabLiveLists.filter((_, index) => index&1)" :key="item.live_id" :name="item.store_name"
:image="item.cover_img" :url="item.url"></zhiboItem>
</view>
</view> </view>
</view> </view>
</view>
</scroll-view> </scroll-view>
</swiper-item> </swiper-item>
</swiper> <swiper-item>
<scroll-view style="width:100%;height:100%" scroll-y="true">
<view class="box">
<view class="tuijian">
<view class="title" @click="toSearchPage">
<view class="left">
<view></view>
<text>推荐达人</text>
</view>
<image class="right" src="/static/image/common/1.png"></image>
</view>
<view class="tuijianlist">
<!-- <darenItem style="margin-right:23rpx"></darenItem>
<darenItem style="margin-right:23rpx"></darenItem> -->
<darenItem v-for="item in recommendList.slice(0,3)" :key="item.id" :info="item" v-on:pChangeType="changeType"></darenItem>
</view>
</view>
<view class="list">
<view>
<!-- <videoItem isguanzhu="true" v-for="item in 10"></videoItem> -->
<videoItem isguanzhu="true" v-for="item in articleList.filter((_, index) => !(index&1))" :key="item.article_id"
:item="item" @getArticlelist="getArticlelist"></videoItem>
</view>
<view style="margin-left:20rpx">
<!-- <videoItem isguanzhu="true" v-for="item in 10"></videoItem> -->
<videoItem isguanzhu="true" v-for="item in articleList.filter((_, index) => index&1)" :key="item.article_id"
:item="item" @getArticlelist="getArticlelist"></videoItem>
</view>
</view>
</view>
</scroll-view>
</swiper-item>
</swiper>
</view>
</view> </view>
</template> </template>
@ -203,7 +208,7 @@
recommendList: [], // recommendList: [], //
indexImageSwiper: [], indexImageSwiper: [],
zhiboImageSwiper: [], zhiboImageSwiper: [],
tabLiveLists:[] tabLiveLists: []
} }
}, },
components: { components: {
@ -220,8 +225,8 @@
this.tabLiveList(); this.tabLiveList();
}, },
methods: { methods: {
tabLiveList(){ tabLiveList() {
this.$u.api.tabLiveList().then((res)=>{ this.$u.api.tabLiveList().then((res) => {
console.log(res) console.log(res)
this.tabLiveLists = res.data this.tabLiveLists = res.data
}) })
@ -233,12 +238,12 @@
} }
}) })
}, },
changeType(member_id){ changeType(member_id) {
console.log(member_id); console.log(member_id);
this.$emit("pChangeType") this.$emit("pChangeType")
this.$u.api.attentionMember({ this.$u.api.attentionMember({
member_id: member_id member_id: member_id
}).then((res)=>{ }).then((res) => {
console.log(res) console.log(res)
this.getRecommendList(); this.getRecommendList();
}) })
@ -263,7 +268,7 @@
page: this.page, page: this.page,
is_video_img: 0, // 1 2 0 is_video_img: 0, // 1 2 0
}).then(res => { }).then(res => {
console.log('37647744ghj',res) console.log('37647744ghj', res)
if (res.errCode == 0) { if (res.errCode == 0) {
this.articleList = res.data.list; this.articleList = res.data.list;
} }
@ -278,11 +283,11 @@
}) })
}, },
toSearchPage() { toSearchPage() {
console.log("22"); console.log("22");
uni.navigateTo({ uni.navigateTo({
url: '/pageB/follow/index' url: '/pageB/follow/index'
}); });
}, },
}, },
} }
</script> </script>

View File

@ -124,7 +124,11 @@
</template> </template>
<script> <script>
import { mapState } from 'vuex';
export default { export default {
computed: {
...mapState(['hasLogin', 'token'])
},
data() { data() {
return { return {
userInfo: {}, userInfo: {},
@ -136,6 +140,12 @@ export default {
} }
}, },
onShow() { onShow() {
//
if (!this.hasLogin) {
uni.navigateTo({
url: "../../pageA/login/login"
})
}
this.getUserInfo(); this.getUserInfo();
}, },
onNavigationBarButtonTap() { onNavigationBarButtonTap() {
@ -160,7 +170,7 @@ export default {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.mine { .mine {
min-height: calc(calc(100vh - var(--window-top)) - 50px); min-height: calc(calc(100vh - var(--window-top)));
background: #ECECEC; background: #ECECEC;
.mine-top { .mine-top {
// width: 100%; // width: 100%;

View File

@ -1,280 +1,323 @@
<template> <template>
<scroll-view class="shop" scroll-y @scrolltolower="onreachBottom">
<view class="top"> <view>
<image src="/static/image/shop/1.png" class="local"></image> <view class="status_bar"></view>
<view class="add" @click="chooseArea=true"> <scroll-view class="shop" scroll-y @scrolltolower="onreachBottom">
<text class="u-line-1">{{ area }}</text> <view class="top">
<image src="/static/image/shop/2.png"></image> <image src="/static/image/shop/1.png" class="local"></image>
</view> <view class="add" @click="chooseArea=true">
<view @click="sousuo"> <text class="u-line-1">{{ area }}</text>
<u-search placeholder="" v-model="keyword" :show-action="false" bg-color="#fff" border-color="#999999" :disabled="true"></u-search> <image src="/static/image/shop/2.png"></image>
</view> </view>
<image src="/static/image/shop/3.png" class="mnue" @click="toClassifyPage"></image> <view @click="sousuo">
</view> <u-search placeholder="" v-model="keyword" :show-action="false" bg-color="#fff" border-color="#999999" :disabled="true"></u-search>
<view class="swiper-image"> </view>
<u-swiper :list="list" mode="dot" @click="clickImage"></u-swiper> <image src="/static/image/shop/3.png" class="mnue" @click="toClassifyPage"></image>
</view> </view>
<view class="chengnuo"> <view class="swiper-image">
<view> <u-swiper :list="list" mode="dot" @click="clickImage"></u-swiper>
<image src="/static/image/shop/4.png"></image> </view>
<text>免费洗衣</text> <view class="chengnuo">
</view> <view>
<view> <image src="/static/image/shop/4.png"></image>
<image src="/static/image/shop/5.png"></image> <text>免费洗衣</text>
<text>全国包邮</text> </view>
</view> <view>
<view> <image src="/static/image/shop/5.png"></image>
<image src="/static/image/shop/6.png"></image> <text>全国包邮</text>
<text>延误必赔</text> </view>
</view> <view>
<view> <image src="/static/image/shop/6.png"></image>
<image src="/static/image/shop/7.png"></image> <text>延误必赔</text>
<text>上门取件</text> </view>
</view> <view>
</view> <image src="/static/image/shop/7.png"></image>
<view class="fenlei"> <text>上门取件</text>
<shopitem v-for="item in goodsClassify" :key="item.gc_id" :info="item" class="item"></shopitem> </view>
</view> </view>
<!-- 秒杀 --> <view class="fenlei">
<recommend v-if="JSON.stringify(recommendedSpike) != '{}'" :recommendData="recommendedSpike" type="spike"></recommend> <shopitem v-for="item in goodsClassify" :key="item.gc_id" :info="item" class="item"></shopitem>
<!-- 秒杀列表 --> </view>
<seckill v-if="spikeList.length" :list="spikeList" :time="seckillTime"></seckill> <!-- 秒杀 -->
<!-- 拼团推荐 --> <recommend v-if="JSON.stringify(recommendedSpike) != '{}'" :recommendData="recommendedSpike" type="spike"></recommend>
<pintuan v-if="JSON.stringify(pinTuanPush) != '{}'" :recommendData="pinTuanPush"></pintuan> <!-- 秒杀列表 -->
<!-- 拼团列表 --> <seckill v-if="spikeList.length" :list="spikeList" :time="seckillTime"></seckill>
<group></group> <!-- 拼团推荐 -->
<image class="lingquan"></image> <pintuan v-if="JSON.stringify(pinTuanPush) != '{}'" :recommendData="pinTuanPush"></pintuan>
<youhq></youhq> <!-- 拼团列表 -->
<list ref="recommendGoods"></list> <group></group>
<view class="cart" @click="toCartPage"> <image class="lingquan"></image>
<image src="/static/image/common/3.png"></image> <youhq></youhq>
</view> <list ref="recommendGoods"></list>
<u-picker mode="region" :params="areaParams" v-model="chooseArea" @confirm="setArea"></u-picker> <view class="cart" @click="toCartPage">
</scroll-view> <image src="/static/image/common/3.png"></image>
</view>
<u-picker mode="selector" :range="areaList" v-model="chooseArea" range-key="area_name" @confirm="setArea"></u-picker>
</scroll-view>
</view>
</template> </template>
<script> <script>
import shopitem from "@/components/shop/shop-item/index"; import shopitem from "@/components/shop/shop-item/index";
import recommend from "@/components/shop/recommend/index"; import recommend from "@/components/shop/recommend/index";
import pintuan from "@/components/shop/recommend/pintuan"; import pintuan from "@/components/shop/recommend/pintuan";
import seckill from "@/components/shop/seckill/index"; import seckill from "@/components/shop/seckill/index";
import group from "@/components/shop/group/index"; import group from "@/components/shop/group/index";
import youhq from "@/components/shop/youhq/index"; import youhq from "@/components/shop/youhq/index";
import list from "@/components/shop/list/index"; import list from "@/components/shop/list/index";
export default { export default {
name: "shop", name: "shop",
components: { components: {
shopitem, shopitem,
recommend, recommend,
seckill, seckill,
group, group,
youhq, youhq,
list, list,
pintuan pintuan
}, },
data() { data() {
return { return {
area: "请选择", area: "请选择",
chooseArea: false, chooseArea: false,
areaParams: { keyword: "",
province: true, list: [],
city: true, goodsClassify: [], //
area: false // classifyList: [],
recommendedSpike: {}, //
spikeList: [], //
seckillTime: {}, //
// couponGroupList: [], //
pinTuanPush: {}, //
areaList: [], //
}
},
onLoad() {
this.getShopTopList();
this.getLocation(); //
// this.area = uni.getStorageSync("address") || "";
},
onShow() {
this.getRecommendedSpike();
this.getSpikeList();
this.getPinTuanPush();
this.getAllLoaction(); //
},
methods: {
sousuo() {
// console.log(123)
this.$u.route({
url: "pageB/search/index"
})
}, },
keyword: "", //
list: [], getLocation() {
goodsClassify: [], // uni.getLocation({
// classifyList: [], type: 'wgs84',
recommendedSpike: {}, // geocode: true,
spikeList: [], // success: (res) => {
seckillTime: {}, // // console.log(res.address);
// couponGroupList: [], // this.area = res.address.city;
pinTuanPush: {}, // },
} fail: (e) => {
}, console.log(e);
onLoad() {
this.getShopTopList();
},
onShow() {
this.getRecommendedSpike();
this.getSpikeList();
this.getPinTuanPush();
},
methods: {
sousuo() {
// console.log(123)
this.$u.route({
url:"pageB/search/index"
})
},
getShopTopList() {
this.$u.api.getShopTopList().then((res)=>{
if (res.errCode == 0) {
let temp = [];
res.data.banner.forEach(item => {
temp.push({
image: item.adv_code,
adv_link: item.adv_link,
adv_id: item.adv_id,
})
})
this.list = temp;
this.goodsClassify = res.data.goodsclass;
}
})
},
getRecommendedSpike() {
this.$u.api.recommendedSpike().then(res => {
if(res.errCode == 0) this.recommendedSpike = res.data;
// console.log(this.recommendedSpike);
})
},
//
getPinTuanPush() {
this.$u.api.getPinTuanPush().then(res => {
if(res.errCode == 0) {
this.pinTuanPush = res.data;
}
})
},
//
getSpikeList() {
this.$u.api.getSpikeList({ page: 0 }).then(res => {
if(res.errCode == 0) {
this.spikeList = res.data.list;
this.seckillTime = {
bigHour: res.data.bigHour,
littleHour: res.data.littleHour,
} }
} });
}) },
//
getAllLoaction() {
this.$u.api.getAreaList({pid: 0}).then(res => {
// console.log(res);
this.areaList = res.data;
})
},
getShopTopList() {
this.$u.api.getShopTopList().then((res) => {
if (res.errCode == 0) {
let temp = [];
res.data.banner.forEach(item => {
temp.push({
image: item.adv_code,
adv_link: item.adv_link,
adv_id: item.adv_id,
})
})
this.list = temp;
this.goodsClassify = res.data.goodsclass;
}
})
},
getRecommendedSpike() {
this.$u.api.recommendedSpike().then(res => {
if (res.errCode == 0) this.recommendedSpike = res.data;
// console.log(this.recommendedSpike);
})
},
//
getPinTuanPush() {
this.$u.api.getPinTuanPush().then(res => {
if (res.errCode == 0) {
this.pinTuanPush = res.data;
}
})
},
//
getSpikeList() {
this.$u.api.getSpikeList({
page: 0
}).then(res => {
if (res.errCode == 0) {
this.spikeList = res.data.list;
this.seckillTime = {
bigHour: res.data.bigHour,
littleHour: res.data.littleHour,
}
}
})
},
clickImage(index) {
console.log(index);
console.log(this.list[index]);
},
//
onreachBottom() {
this.$refs.recommendGoods.loadMore();
},
setArea(e) {
console.log(e);
this.area = this.areaList[e[0]].area_name;
},
toCartPage() {
uni.navigateTo({
url: '/pageC/cart/index'
});
},
toClassifyPage() {
uni.navigateTo({
url: '/pageC/classify/index'
});
},
}, },
clickImage(index) { }
console.log(index);
console.log(this.list[index]);
},
//
onreachBottom() {
this.$refs.recommendGoods.loadMore();
},
setArea(e) {
// console.log(e);
this.area = e.city.label;
},
toCartPage() {
uni.navigateTo({
url: '/pageC/cart/index'
});
},
toClassifyPage() {
uni.navigateTo({
url: '/pageC/classify/index'
});
},
},
}
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.shop { .shop {
height: calc(100vh - var(--window-top)); height: calc(100vh - var(--window-top));
box-sizing: border-box; box-sizing: border-box;
background-color: #F0EDF1; background-color: #F0EDF1;
.top {
padding: 0 30rpx; .top {
background-color: #ffffff; padding: 0 30rpx;
width: 100%; background-color: #ffffff;
height: 88rpx; width: 100%;
display: flex; height: 88rpx;
align-items: center; display: flex;
.local{ align-items: center;
width: 31rpx;
height: 37rpx; .local {
} width: 31rpx;
} height: 37rpx;
.swiper-image {
background-color: #ffffff;
padding: 0 30rpx;
}
.add {
width: 115rpx;
height: 25rpx;
display: flex;
font-size: 26rpx;
color: #333;
justify-content: space-between;
align-items: center;
margin-left: 14rpx;
margin-right: 37rpx;
> text {
width: 80rpx;
}
> image {
width: 24rpx;
height: 15rpx;
}
}
.mnue {
background-color: #ffffff;
width: 35rpx;
height: 26rpx;
margin-left: 36rpx;
}
.chengnuo {
padding: 30rpx;
background-color: #ffffff;
display: flex;
justify-content: space-between;
align-items: center;
> view {
display: flex;
align-items: center;
> image {
width: 23rpx;
height: 23rpx;
}
> text {
font-size: 22rpx;
color: #999;
margin-left: 8rpx;
}
}
}
.fenlei {
padding: 30rpx;
background-color: #ffffff;
display: flex;
flex-wrap: wrap;
margin-bottom: 20rpx;
> view {
margin-bottom: 30rpx;
&:not(:nth-child(5n)) {
margin-right: 70rpx;
} }
} }
}
.lingquan { .swiper-image {
width: 750rpx; background-color: #ffffff;
height: 177rpx; padding: 0 30rpx;
margin-left: -33rpx; }
margin-top: 29rpx;
background-color: #ececec; .add {
} width: 115rpx;
.cart { height: 25rpx;
z-index: 9; display: flex;
position: fixed; font-size: 26rpx;
right: 30rpx; color: #333;
bottom: 300rpx; justify-content: space-between;
width: 100rpx; align-items: center;
height: 100rpx; margin-left: 14rpx;
background: rgba(253, 211, 96, 1); margin-right: 37rpx;
box-shadow: 0rpx 10rpx 6rpx 0rpx rgba(253,211,96,0.34);
border-radius: 50%; >text {
display: flex; width: 80rpx;
align-items: center; }
justify-content: center;
> image { >image {
width: 56rpx; width: 24rpx;
height: 54rpx; height: 15rpx;
}
}
.mnue {
background-color: #ffffff;
width: 35rpx;
height: 26rpx;
margin-left: 36rpx;
}
.chengnuo {
padding: 30rpx;
background-color: #ffffff;
display: flex;
justify-content: space-between;
align-items: center;
>view {
display: flex;
align-items: center;
>image {
width: 23rpx;
height: 23rpx;
}
>text {
font-size: 22rpx;
color: #999;
margin-left: 8rpx;
}
}
}
.fenlei {
padding: 30rpx;
background-color: #ffffff;
display: flex;
flex-wrap: wrap;
margin-bottom: 20rpx;
>view {
margin-bottom: 30rpx;
&:not(:nth-child(5n)) {
margin-right: 70rpx;
}
}
}
.lingquan {
width: 750rpx;
height: 177rpx;
margin-left: -33rpx;
margin-top: 29rpx;
background-color: #ececec;
}
.cart {
z-index: 9;
position: fixed;
right: 30rpx;
bottom: 300rpx;
width: 100rpx;
height: 100rpx;
background: rgba(253, 211, 96, 1);
box-shadow: 0rpx 10rpx 6rpx 0rpx rgba(253, 211, 96, 0.34);
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
>image {
width: 56rpx;
height: 54rpx;
}
} }
} }
} </style>
</style>