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

23
App.vue
View File

@ -1,6 +1,27 @@
<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>
<style lang="scss">
/* #ifndef APP-PLUS-NVUE */
@import "/static/css/normalize";
/* #endif */
/* 顶部自定义导航留白 */
.status_bar {
width: 100%;
height: var(--status-bar-height);
}
</style>

View File

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

View File

@ -23,7 +23,9 @@
"Push" : {},
"Maps" : {},
"LivePusher" : {},
"Payment" : {}
"Payment" : {},
"VideoPlayer" : {},
"Speech" : {}
},
/* */
"distribute" : {
@ -64,6 +66,12 @@
"oauth" : {
"qq" : {
"appid" : "101884160"
},
"apple" : {},
"weixin" : {
"appid" : "wx556db1531ec35dc7",
"appsecret" : "f441fc15dd21543871a818f40ce92016",
"UniversalLinks" : "https://demo.dcloud.net.cn/ulink/"
}
},
"maps" : {
@ -72,7 +80,20 @@
"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">
<view class="warp">
<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>
<view>QQ登录</view>
</view>
<view class="rect_view">
<view class="rect_view" @click="loginOther(2)">
<image src="../../static/pageA/weixin.png" class="image"></image>
<view>微信登录</view>
</view>
@ -61,7 +61,9 @@
</template>
<script>
import identifying from '@/components/logininput/identifying'
import { mapMutations } from 'vuex';
import {
mapMutations
} from 'vuex';
export default {
data() {
return {
@ -91,21 +93,35 @@
}, {
"id": '3',
"text": "《使用协议》"
},
]
}, ],
temp_url: "", //
pagesArr: ["pages/mine/index"], //
};
},
onLoad() {
//
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: {
...mapMutations(['loginIn']),
apiwelcome() {
this.$u.api.sendSmsCode({
}).then((res) => {
this.$u.api.sendSmsCode({}).then((res) => {
console.log(res)
})
},
@ -189,8 +205,7 @@
// type: 'success',
// url: '/pageA/topick/topick'
// })
}
if (res.errCode == 1) {
} else {
this.$refs.uToast.show({
title: res.message,
type: 'error'
@ -199,40 +214,75 @@
})
},
// qq
rect_qq() {
console.log("授权QQ")
var vm = this;
loginOther(type) {
var me = this;
uni.getProvider({
service: 'oauth',
success: function(res) {
console.log('qq', res) //weixin
if (~res.provider.indexOf('qq')) {
success: (res) => {
if (type == 1) {
uni.login({
provider: 'qq',
success: function(loginRes) {
console.log(loginRes)
this.getApplogin(loginRes)
vm.$HTTP({
method: 'GET',
baseURL: 'https://graph.qq.com/user/get_user_info',
url: '',
data: {
openid: loginRes.authResult.openid,
access_token: loginRes.authResult.access_token,
appid: '101884160'
success: (qqres) => {
console.log(qqres);
uni.getUserInfo({
provider: 'qq',
success: (data) => {
console.log(data);
this.$u.api.qqLogin({
member_qqopenid: data.userInfo.openId,
member_nickname: data.userInfo.nickName,
member_avatar: data.userInfo.avatarUrl,
}).then(res => {
console.log(res.errCode);
if (res.errCode == 0) {
this.loginIn(res.data.token);
this.show = false;
uni.switchTab({
url: "../../pages/index/index"
})
}
})
}
})
},
load: true
}).then((data) => {
console.log(data)
}, (err) => {
console.log(err)
});
fail: (e) => {
console.log(e);
}
});
} 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'
});
},
//
getApplogin() {
console.log("11")
},
// checkbox
checkboxChange(e) {
//console.log(e);

View File

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

View File

@ -10,7 +10,7 @@
</view>
<!-- 标签 -->
<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 class="submites" @click="toHomePage">{{submites}}</view>
@ -30,12 +30,12 @@
show: false,
tab_lables: [],
submites: '选好了进入首页',
rSelect:[]
rSelect:[],
list: [],
};
},
onLoad(){
//
console.log("11111222")
this.$u.api.labelList({
}).then((res) => {
@ -59,14 +59,17 @@
this.show = !this.show
},
//
tapClick(index) {
console.log(index)
tapClick(index,id) {
// console.log(id);
if (this.rSelect.indexOf(index) == -1) {
console.log(index) //
this.rSelect.push(index); //
this.rSelect.push(index);
this.list.push(id); //
} else {
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() {
uni.switchTab({

View File

@ -1,31 +1,61 @@
<template>
<view class="welcome">
<!-- 倒计时跳过 -->
<remaining></remaining>
<remaining v-if="guidePages"></remaining>
</view>
</template>
<script>
import {
mapState
} from 'vuex';
import remaining from '@/components/remaining/remaining';
export default {
computed: {
...mapState(['hasLogin', 'token'])
},
data() {
return {
guidePages: true
}
},
onLoad() {
this.loadExecution();
},
methods: {
},
mounted(){
},
components:{}
loadExecution() {
/**
* 获取本地存储中launchFlag的值
* 若存在说明不是首次启动直接进入首页
* 若不存在说明是首次启动进入引导页
*/
// 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>
<style>
.welcome {}
.welcome_jumpes {
width: 90rpx;
height: 35rpx;
@ -40,6 +70,7 @@
color: #fff;
background: #C4CAC6;
}
.welcome_images {
width: 100%;
position: fixed;

View File

@ -1,7 +1,7 @@
<template>
<view class="photo">
<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>
<swiper class="swiper">
<swiper-item>
@ -128,6 +128,11 @@ export default {
console.log(res)
this.list = res.data.info
})
},
goBack() {
uni.navigateBack({
delta: 1
})
}
},
onLoad(o){

View File

@ -553,14 +553,16 @@ export default {
.title{
flex-wrap: wrap;
margin-bottom: 30rpx;
line-height: 1.2;
>text{
padding: 13rpx;
font-size: 24rpx;
color:#fff;
margin-right: 13rpx;
background-color: #FF780F;
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{

View File

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

View File

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

View File

@ -145,17 +145,57 @@
{
"path": "search/index",
"style": {
"navigationBarTitleText": "",
"navigationStyle": "custom"
"app-plus": {
"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",
"style": {
"navigationBarTitleText": "",
"navigationStyle": "custom"
"app-plus": {
"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,4 +1,6 @@
<template>
<view>
<view class="status_bar"></view>
<view class="index">
<view class="top">
<view class="sosuo"></view>
@ -39,10 +41,12 @@
<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>
<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>
<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>
@ -84,6 +88,7 @@
</swiper-item>
</swiper>
</view>
</view>
</template>
<style lang="scss" scoped>

View File

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

View File

@ -1,4 +1,7 @@
<template>
<view>
<view class="status_bar"></view>
<scroll-view class="shop" scroll-y @scrolltolower="onreachBottom">
<view class="top">
<image src="/static/image/shop/1.png" class="local"></image>
@ -49,8 +52,9 @@
<view class="cart" @click="toCartPage">
<image src="/static/image/common/3.png"></image>
</view>
<u-picker mode="region" :params="areaParams" v-model="chooseArea" @confirm="setArea"></u-picker>
<u-picker mode="selector" :range="areaList" v-model="chooseArea" range-key="area_name" @confirm="setArea"></u-picker>
</scroll-view>
</view>
</template>
<script>
import shopitem from "@/components/shop/shop-item/index";
@ -75,11 +79,6 @@ export default {
return {
area: "请选择",
chooseArea: false,
areaParams: {
province: true,
city: true,
area: false
},
keyword: "",
list: [],
goodsClassify: [], //
@ -89,15 +88,19 @@ export default {
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() {
@ -106,6 +109,27 @@ export default {
url: "pageB/search/index"
})
},
//
getLocation() {
uni.getLocation({
type: 'wgs84',
geocode: true,
success: (res) => {
// console.log(res.address);
this.area = res.address.city;
},
fail: (e) => {
console.log(e);
}
});
},
//
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) {
@ -138,7 +162,9 @@ export default {
},
//
getSpikeList() {
this.$u.api.getSpikeList({ page: 0 }).then(res => {
this.$u.api.getSpikeList({
page: 0
}).then(res => {
if (res.errCode == 0) {
this.spikeList = res.data.list;
this.seckillTime = {
@ -157,8 +183,8 @@ export default {
this.$refs.recommendGoods.loadMore();
},
setArea(e) {
// console.log(e);
this.area = e.city.label;
console.log(e);
this.area = this.areaList[e[0]].area_name;
},
toCartPage() {
uni.navigateTo({
@ -178,6 +204,7 @@ export default {
height: calc(100vh - var(--window-top));
box-sizing: border-box;
background-color: #F0EDF1;
.top {
padding: 0 30rpx;
background-color: #ffffff;
@ -185,15 +212,18 @@ export default {
height: 88rpx;
display: flex;
align-items: center;
.local {
width: 31rpx;
height: 37rpx;
}
}
.swiper-image {
background-color: #ffffff;
padding: 0 30rpx;
}
.add {
width: 115rpx;
height: 25rpx;
@ -204,33 +234,40 @@ export default {
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;
@ -238,19 +275,23 @@ export default {
}
}
}
.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;
@ -258,6 +299,7 @@ export default {
margin-top: 29rpx;
background-color: #ececec;
}
.cart {
z-index: 9;
position: fixed;
@ -271,6 +313,7 @@ export default {
display: flex;
align-items: center;
justify-content: center;
>image {
width: 56rpx;
height: 54rpx;