feature/v-xuexi
wangdong 11 months ago
parent a3cd1f9253
commit f2e04f70c1
  1. 75
      components/BaseLogin/index.vue
  2. 68
      pages/course/special_cate.vue
  3. 160
      pages/index/index.vue
  4. 38
      pages/store/index.vue
  5. 9
      utils/utils.js

@ -220,21 +220,64 @@ export default {
if (!this.agree) {
return this.$util.showMsg("请勾选用户协议");
}
const that = this;
// #ifdef MP-WEIXIN
let provider = 'weixin';
uni.login({
provider: provider,
success: function (loginRes) {
//
uni.getUserInfo({
provider: provider,
success: function (infoRes) {
let userInfo = {};
userInfo.encryptedData = JSON.stringify(infoRes.userInfo)
userInfo.ucode = loginRes.code;
userInfo.type = 'weixin';
console.log(userInfo);
that.type == 1 ? that.pwdLogin(userInfo) : that.smsLogin(userInfo);
},
fail() {
uni.showToast({
title: `获取用户信息失败`,
icon: 'none',
duration: 2000
})
},
complete() {
uni.hideLoading()
}
});
},
fail: function (err) {
console.log(err);
uni.showToast({
title: err.msg,
icon: 'none',
duration: 2000
});
}
});
// #endif
// #ifndef MP-WEIXIN
this.type == 1 ? this.pwdLogin() : this.smsLogin();
// #endif
},
//
async pwdLogin() {
async pwdLogin(userInfo = {}) {
const app = getApp();
uni.showLoading({
mask: true,
});
const sendData = {
account: this.phone,
pwd: this.$util.hexMd5(this.pwd),
agent_id: app.globalData.agent_id || 0,
...userInfo
};
try {
const { data } = await userLogin({
account: this.phone,
pwd: this.$util.hexMd5(this.pwd),
agent_id: app.globalData.agent_id || 0
});
const { data } = await userLogin(sendData);
uni.hideLoading();
@ -256,7 +299,7 @@ export default {
},
//
//
async smsLogin() {
async smsLogin(userInfo = {}) {
const app = getApp();
if (this.timer) {
clearInterval(this.timer);
@ -266,14 +309,14 @@ export default {
uni.showLoading({
mask: true,
});
const sendData = {
phone: this.phone,
code: this.code,
agent_id: app.globalData.agent_id || 0,
...userInfo
};
try {
const { data, msg } = await smsLogin(
{
phone: this.phone,
code: this.code,
agent_id: app.globalData.agent_id || 0
});
const { data, msg } = await smsLogin(sendData);
uni.hideLoading();
this.$util.showMsg(msg);
@ -462,7 +505,7 @@ export default {
box-sizing: border-box;
vertical-align: middle;
font-size: 0;
line-height: 30rpx;
line-height: 40rpx;
text-align: center;
color: #c3c3c3;

@ -1,20 +1,23 @@
<template>
<BaseContainer class="goodsClass" :fixedNav="false">
<view class="header"
:style="'padding-top:' + menutop+ 'px;'">
:style="'padding-top:' + (menutop * 2 + 58 + 38) + 'rpx;'">
<view class="search"
@click="getsearch()"
:style="{background: scrollTop > 10 ? '#f5f5f5' : 'transparent', paddingTop: (menutop * 2) + 'rpx', paddingBottom: '20rpx', height: (menutop * 2 + 58 + 20) + 'rpx'}"
>
<view>
<image class="image_icon" :src="getImgPath('/public/images/icon.png')" mode="aspectFill" />
<view class="name">
搜索课程讲师
</view>
</view>
</view>
<Carousel v-if="bannerList.length > 0" :bannerList="bannerList"></Carousel>
</view>
<!--功能菜单-->
<view v-if="gradeCate.length" class="nav">
<view class="acea-row">
<view class="acea-row nav-list">
<view class="item" :key="index" v-for="(item, index) in gradeCate" @click="showCateCourse(item)">
<view class="pictrue">
<image v-if="item.name !== '全部分类'" :src="item.pic" mode="aspectFit"/>
@ -129,6 +132,7 @@ import OfflineStyleCourse from '@/components/Course/offlineStyleCourse.vue';
{ menuName: '线下课堂', key: 'offline_courses' },
],
specialData: [],
scrollTop: 0,
};
},
onLoad() {
@ -149,6 +153,9 @@ import OfflineStyleCourse from '@/components/Course/offlineStyleCourse.vue';
/* #endif */
},
onPageScroll(e) {
this.scrollTop = e.scrollTop;
},
onShow() {
this.getSpecialIndexData();
},
@ -318,27 +325,32 @@ import OfflineStyleCourse from '@/components/Course/offlineStyleCourse.vue';
}
/* #endif */
.goodsClass .header {
background: linear-gradient(to top, transparent 0%, #f4f4f4 40%, #D3F2FF 80%, #53B2F5 100%);
background: linear-gradient(to top, transparent 0%, #f4f4f4 20%, #D3F2FF 40%, #53B2F5 100%);
z-index: 99;
width: 100%;
}
.goodsClass .header .search {
width: 90%;
height: 58rpx;
border-radius: 40rpx;
background-color: #f5f5f5;
width: 100%;
font-size: 26rpx;
color: #aaa;
margin-left: 5%;
margin-bottom: 38rpx;
display: flex;
align-items: center;
padding: 0;
/* #ifdef MP-WEIXIN */
width: 65%;
/* #endif */
position: fixed;
top: 0;
left: 0;
z-index: 100;
>view {
width: 90%;
background-color: #fff;
display: flex;
align-items: center;
border-radius: 40rpx;
height: 100%;
margin-left: 5%;
/* #ifdef MP-WEIXIN */
width: 65%;
/* #endif */
}
.iconfont2,
.iconfont {
margin-right: 16rpx;
@ -360,20 +372,23 @@ import OfflineStyleCourse from '@/components/Course/offlineStyleCourse.vue';
}
.nav {
background-color: #ffffff;
margin: 30rpx 30rpx;
width: 690rpx;
padding-top: 30rpx;
border-radius: 10rpx;
padding: 15rpx 16rpx 0;
}
.goodsClass .nav .item {
flex: 0 0 20%;
min-width: 0;
padding-bottom: 50rpx;
font-size: 24rpx;
line-height: 30rpx;
text-align: center;
color: #666666;
word-break: break-all;
font-size: 24rpx;
line-height: 30rpx;
text-align: center;
color: #666666;
word-break: break-all;
margin-right: 45rpx;
margin-bottom: 32rpx;
&:nth-child(4n) {
margin-right: 0;
}
}
.goodsClass .nav .item .text {
@ -382,9 +397,8 @@ import OfflineStyleCourse from '@/components/Course/offlineStyleCourse.vue';
}
.goodsClass .nav .item .pictrue {
width: 94rpx;
height: 94rpx;
margin: 0 auto 19rpx;
width: 124rpx;
height: 124rpx;
}
.goodsClass .nav .item .pictrue image {

@ -1,9 +1,9 @@
<template>
<BaseContainer :fixedNav="false">
<view class="indexNew">
<view class="TaberList"
:style="{ background: `linear-gradient(180deg, rgb(${color_one}) 0%, #FFF 100%)` }">
<view class="flex header">
<view class="TaberList" :style="{ background: `linear-gradient(180deg, rgb(${color_one}) 0%, #FFF 100%)` }">
<view class="header" :style="{background: scrollTop > 10 ? '#f5f5f5' : 'transparent'}">
<view class="flex">
<view class="position header-info">
<image src="@/static/images/position.png" mode="aspectfill"></image>
<text>南京</text>
@ -18,6 +18,7 @@
<image src="@/static/images/notice.png" mode="aspectfill"></image>
<text class="notice-num">6</text>
</view>
</view>
</view>
<view v-if="bannerList.length" class="carousel">
<swiper id="swiper1" class="swiper-container" indicator-dots circular autoplay @change="getChangeImage">
@ -37,7 +38,7 @@
<!-- #ifndef MP-TOUTIAO -->
<view class="col-8"></view>
<!-- #endif -->
<view class="acea-row">
<view class="acea-row nav-list">
<view class="item" :key="index" v-for="(item, index) in navList" @click="getNavHrefTaber(item, 1)">
<view class="pictrue">
<image :src="item.icon" mode="aspectFit"/>
@ -598,6 +599,7 @@ export default {
ICP: {},
specialList: [],
goodsList: [],
scrollTop: 0,
};
},
onShow() {
@ -635,6 +637,10 @@ export default {
});
//#endif
},
onPageScroll(e) {
this.scrollTop = e.scrollTop;
},
//
onShareAppMessage() {
return {};
@ -866,17 +872,69 @@ page {
</style>
<style lang="scss" scoped>
.indexNew .TaberList .header {
/* #ifndef MP-TOUTIAO */
padding-top: calc(14rpx + var(--safe-top)) !important;
/* #endif */
z-index: 99;
/* #ifdef MP-WEIXIN */
width: 75%;
/* #endif */
/* #ifndef MP-WEIXIN */
width: 100%;
/* #endif */
.indexNew {
background: #f6f6f6;
}
.indexNew .TaberList {
padding-top: calc(102rpx + var(--safe-top)) !important;
.header {
padding-top: var(--safe-top) !important;
z-index: 99;
width: 100%;
height: calc(102rpx + var(--safe-top));
padding-right: 35rpx;
padding-left: 24rpx;
position: fixed;
top: 0;
left: 0;
>view {
/* #ifdef MP-WEIXIN */
width: 75%;
/* #endif */
/* #ifndef MP-WEIXIN */
width: 100%;
/* #endif */
align-items: center;
height: 100%;
}
.header-info {
display: flex;
align-items: center;
position: relative;
&:last-child {
margin-left: 5rpx;
}
image {
width: 44rpx;
height: 44rpx;
}
text {
width: 70rpx;
font-size: 28rpx;
color: #333;
&:not(.notice-num) {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
margin-left: 0 4rpx;
}
&.notice-num {
position: absolute;
width: 22rpx;
height: 22rpx;
top: -3rpx;
right: -1rpx;
color: #fff;
font-size: 18rpx;
font-weight: bold;
background: #FE4944;
border-radius: 50%;
line-height: 22rpx;
text-align: center;
}
}
}
}
}
@ -1009,11 +1067,6 @@ page {
margin-right: 20rpx;
}
.thematic-details,
.nav {
background-color: #ffffff;
}
.indexNew {
padding-bottom: var(--tab-bar-height);
}
@ -1099,51 +1152,6 @@ page {
height: 70rpx;
}
.indexNew .header {
height: calc(109rpx + var(--safe-top));
padding-top: calc(20rpx + var(--safe-top));
padding-right: 35rpx;
padding-left: 24rpx;
align-items: center;
}
.indexNew .header .header-info {
display: flex;
align-items: center;
position: relative;
&:last-child {
margin-left: 5rpx;
}
image {
width: 44rpx;
height: 44rpx;
}
text {
width: 70rpx;
font-size: 28rpx;
color: #333;
&:not(.notice-num) {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
margin-left: 0 4rpx;
}
&.notice-num {
position: absolute;
width: 22rpx;
height: 22rpx;
top: -3rpx;
right: -1rpx;
color: #fff;
font-size: 18rpx;
font-weight: bold;
background: #FE4944;
border-radius: 50%;
line-height: 22rpx;
text-align: center;
}
}
}
.indexNew .header .search {
/* #ifdef MP-WEIXIN */
// height: 60rpx !important;
@ -1155,7 +1163,7 @@ page {
flex: 1;
height: 58rpx;
border-radius: 40rpx;
background-color: #f5f5f5;
background-color: #fff;
font-size: 26rpx;
color: #aaa;
}
@ -1242,22 +1250,30 @@ swiper {
opacity: 0.8;
}
.nav .nav-list {
width: 690rpx;
margin: 0 auto;
background: #fff;
border-radius: 10rpx;
padding: 15rpx 16rpx 0;
}
.indexNew .nav .item {
flex: 0 0 20%;
min-width: 0;
padding-top: 14rpx;
padding-bottom: 14rpx;
font-size: 24rpx;
line-height: 30rpx;
text-align: center;
color: #666666;
word-break: break-all;
margin-right: 52rpx;
margin-bottom: 32rpx;
&:nth-child(4n) {
margin-right: 0;
}
}
.indexNew .nav .item .pictrue {
width: 112rpx;
height: 112rpx;
margin: 0 auto 14rpx;
width: 124rpx;
height: 124rpx;
}
.indexNew .nav .item .pictrue image {

@ -1,14 +1,17 @@
<template>
<BaseContainer class="store" :fixedNav="false">
<view class="header"
:style="'padding-top:' + menutop+ 'px;'">
:style="'padding-top:' + (menutop * 2 + 58 + 18) + 'rpx;'">
<view class="search"
@click="getsearch()"
:style="{background: scrollTop > 10 ? '#f5f5f5' : 'transparent', paddingTop: (menutop * 2) + 'rpx', paddingBottom: '20rpx', height: (menutop * 2 + 58 + 20) + 'rpx'}"
>
<view>
<image class="image_icon" :src="getImgPath('/public/images/icon.png')" mode="aspectFill" />
<view class="name">
搜索商品
</view>
</view>
</view>
</view>
<view style="padding: 0 30rpx;">
@ -109,6 +112,7 @@ import RecommendPoster from "@/components/RecommendPoster/index.vue";
color_one: '',
color_two: '',
menutop: 10,
scrollTop: 0,
};
},
onLoad() {
@ -137,6 +141,7 @@ import RecommendPoster from "@/components/RecommendPoster/index.vue";
// this.getGoodsList();
},
onPageScroll({ scrollTop }) {
this.scrollTop = scrollTop;
this.handlePageScroll(scrollTop);
},
onShareAppMessage() {
@ -415,27 +420,32 @@ page{
/* #endif */
.store{
// padding-bottom: calc(var(--tab-bar-height) + 60rpx);
background: linear-gradient(to top, transparent 0%, #f4f4f4 80%, #D3F2FF 90%, #53B2F5 100%);
background: linear-gradient(to top, transparent 0%, #f6f6f6 70%, #D3F2FF 80%, #53B2F5 100%);
}
.store .header {
z-index: 99;
width: 100%;
}
.store .header .search {
width: 90%;
height: 58rpx;
border-radius: 40rpx;
background-color: #f5f5f5;
.store .header .search {width: 100%;
font-size: 26rpx;
color: #aaa;
margin-left: 5%;
display: flex;
align-items: center;
padding: 0;
/* #ifdef MP-WEIXIN */
width: 65%;
/* #endif */
position: fixed;
top: 0;
left: 0;
z-index: 100;
>view {
width: 90%;
background-color: #fff;
display: flex;
align-items: center;
border-radius: 40rpx;
height: 100%;
margin-left: 5%;
/* #ifdef MP-WEIXIN */
width: 65%;
/* #endif */
}
.iconfont2,
.iconfont {
margin-right: 16rpx;

@ -764,8 +764,13 @@ export default {
userInfo.encryptedData = JSON.stringify(infoRes.userInfo)
userInfo.code = loginRes.code;
userInfo.spread_spid = app.globalData.spid || 0; //获取推广人ID
userInfo.agent_id=app.globalData.agent_id || 0
userInfo.type = 'wxapp'
userInfo.agent_id=app.globalData.agent_id || 0;
// #ifdef MP-WEIXIN
userInfo.type = 'weixin'
// #endif
// #ifndef MP-WEIXIN
userInfo.type = 'wxapp'
// #endif
Routine.authUserInfo(userInfo).then(res => {
uni.hideLoading();
store.commit("app/" + SET_LOGIN, {

Loading…
Cancel
Save