This commit is contained in:
Gdpao 2020-08-07 19:56:47 +08:00
parent 71e984b2ed
commit 502e020000
17 changed files with 238 additions and 136 deletions

View File

@ -43,12 +43,15 @@ const install = (Vue, vm) => {
vm.$u.route('/pageA/login/login')
}, 500)
}
if (res.cancel) {
}
}
})
}
return false;
} else if (res.errCode == 1) {
console.log(res.message);
return res;
} else {
// 如果返回false则会调用Promise的reject回调
// 并将进入this.$u.post(url).then().catch(res=>{})的catch回调中res为服务端的返回值

View File

@ -44,49 +44,57 @@
this.$emit('tochange');
let member_mobile = this.member_mobile;
//
let type_phone = this.$u.test.mobile(member_mobile)
console.log(member_mobile)
console.log(this.smslog_type)
let type_phone = this.$u.test.mobile(member_mobile);
// console.log(member_mobile);
// console.log(this.smslog_type);
//
if (type_phone == false) {
this.$refs.uToast.show({
title: '手机号格式不正确',
type: 'error'
})
this.$refs.uToast.show({
title: "手机号格式不正确"
})
} else {
//
if (this.$refs.uCode.canGetCode) {
//
uni.showLoading({
title: '正在获取验证码'
})
setTimeout(() => {
uni.hideLoading();
// this.start()
this.$u.toast('验证码已发送');
//
this.$refs.uCode.start();
}, 2000);
uni.showLoading({
title: '正在获取验证码'
})
//
this.$u.api.sendSmsCode({
member_mobile: this.member_mobile,
smslog_type: this.smslog_type
}).then((res) => {
if (res.errCode == 0) {
console.log(res);
this.$refs.uToast.show({
title: res.message,
})
setTimeout(() => {
uni.hideLoading();
// this.start()
// this.$u.toast('');
//
this.$refs.uCode.start();
}, 100);
} else {
this.$refs.uToast.show({
title: res.message,
})
}
})
} else {
// this.$u.toast('');
console.log("倒计时结束后再发送");
// console.log("");
}
}
},
end() {
this.$u.toast('倒计时结束');
// this.$u.toast('');
},
start() {
// this.$u.toast('');
console.log(this.smslog_type)
// console.log(this.smslog_type)
//
this.$u.api.sendSmsCode({
member_mobile: this.member_mobile,
smslog_type: this.smslog_type
}).then((res) => {
console.log(res)
})
}
}
}

View File

@ -297,17 +297,18 @@
height: 560rpx;
.protocol_content {
display: block;
width: 494rpx;
height: 528rpx;
margin: 10rpx auto 30rpx;
font-size: 24rpx;
font-weight: 400;
color: rgba(51, 51, 51, 1);
display: block;
text-align: left;
margin: 80rpx auto 33rpx;
letter-spacing: 1rpx;
text-align: justify;
line-height: 36rpx;
text-align: justify;
letter-spacing: 1rpx;
text-indent: 2rem;
color: rgba(51, 51, 51, 1);
}
}

View File

@ -95,7 +95,7 @@ export default {
},
setSwiperHeight() {
// height: 230px, margin-bottom: 13
const height = Math.ceil(this.goodsList.length / 2) * (540 + 26);
const height = Math.ceil(this.goodsList.length / 2) * (500 + 26);
this.swiperHeight = height == 0 ? '230rpx' : height + 'rpx';
// this.swiperHeight = Math.ceil(this.goodsList.length / 2) * (270 + 13) + 'px';
},

View File

@ -3,7 +3,7 @@
<image :src="info.goods_image" mode="aspectFill" class="img"></image>
<view class="info">
<text class="title u-line-2">{{ info.goods_name }}</text>
<text class="jianjie u-line-1">{{ info.goods_advword }}</text>
<!-- <text class="jianjie u-line-1">{{ info.goods_advword }}</text> -->
<text class="price">{{ info.goods_price }}</text>
</view>
</view>
@ -44,7 +44,7 @@ export default {
<style lang="scss" scoped>
.item{
width: 330rpx;
height: 520rpx;
height: 480rpx;
margin-bottom: 26rpx;
background-color: #f8f8f8;
border-radius: 10rpx 10rpx 0rpx 0rpx;
@ -62,10 +62,11 @@ export default {
flex-direction: column;
justify-content: space-around;
.title{
line-height: 40rpx;
font-size: 30rpx;
margin-bottom: 16rpx;
font-size: 26rpx;
font-weight: 600;
line-height: 30rpx;
color: #333;
margin-bottom: 13rpx;
}
.jianjie{
font-size: 26rpx;

View File

@ -3,7 +3,7 @@
<view class="top">
<text>今日秒杀推荐</text>
<view class="more" @click="toOthersPage">
<text>点击查看更多</text>
<text>查看更多</text>
<u-icon name="arrow-right" color="#999" size="22"></u-icon>
</view>
</view>
@ -68,6 +68,7 @@ export default {
display: flex;
align-items: center;
color: #999;
font-size: 20rpx;
}
}
.connect{

View File

@ -3,7 +3,7 @@
<view class="top">
<text>今日拼团推荐</text>
<view class="more" @click="toDetailsPage">
<text>点击查看详情</text>
<text>查看详情</text>
<u-icon name="arrow-right" color="#999" size="22"></u-icon>
</view>
</view>
@ -23,7 +23,7 @@
<text>{{ info.goods_price }}</text>
</view>
</view>
<image class="img" :src="info.pintuan_image" @click="toDetailsPage"></image>
<image class="img" :src="info.pintuan_image" @click="toDetailsPage" mode="aspectFill"></image>
</view>
</view>
</template>
@ -158,10 +158,11 @@ export default {
}
}
.img{
width: 213rpx;
height: 160rpx;
flex-shrink: 0;
margin-left: 13rpx;
width: 210rpx;
height: 200rpx;
margin-left: 10rpx;
border-radius: 4rpx;
background-color: antiquewhite;
}
}

View File

@ -9,7 +9,7 @@
<text class="num">00</text>
<text class="mah">:</text>
<text class="num">00</text>
<text>-</text>
<text class="heng">-</text>
<text class="num">{{ time.bigHour }}</text>
<text class="mah">:</text>
<text class="num">00</text>
@ -47,10 +47,10 @@ export default {
<style lang="scss" scoped>
.seckill{
background-color: #fff;
padding: 30rpx;
padding: 0 30rpx 30rpx;
margin-bottom: 20rpx;
.top{
height: 60rpx;
height: 90rpx;
display: flex;
align-items: center;
justify-content: space-between;
@ -66,13 +66,23 @@ export default {
display: flex;
align-items: center;
font-size: 20rpx;
.heng {
margin: 0 6rpx;
}
.num{
box-sizing: content-box;
width: 25rpx;
height: 25rpx;
background-color: #bfbfbf;
margin: 0 10rpx;
padding: 2rpx;
padding: 2rpx 4rpx;
margin: 0 6rpx;
color: #fff;
text-align: center;
line-height: 25rpx;
border-radius: 4rpx;
box-sizing: content-box;
background-color: #000;
}
.mah {
vertical-align: text-top;
}
}
}
@ -85,7 +95,7 @@ export default {
}
.list{
display: flex;
justify-content: space-between;
// justify-content: space-between;
}
}
</style>

View File

@ -1,12 +1,12 @@
<template>
<view class="item" @click="spikeGoods">
<image class="head" :src="item.groupbuy_image1"></image>
<image class="head" :src="item.groupbuy_image1" mode="aspectFill"></image>
<text class="title u-line-2">{{ item.goods_name }}</text>
<view class="price">
<text>{{ item.groupbuy_price }}</text>
<text class="origin">{{ item.goods_price }}</text>
</view>
<view class="info">
<view class="info" v-if="0">
<text>剩余{{ item.inventory | formatValue }}</text>
<text>立即购买</text>
</view>
@ -55,23 +55,28 @@ export default {
</script>
<style lang="scss" scoped>
.item{
width: 220rpx;
width: 30%;
margin-right: 50rpx;
.head{
width: 210rpx;
height: 131rpx;
width: 100%;
height: 210rpx;
border-radius: 6rpx;
background-color: antiquewhite;
}
.title{
width: 200rpx;
height: 30rpx;
margin-top: 6rpx;
font-size: 26rpx;
line-height: 30rpx;
color: #333;
margin-top: 16rpx;
-webkit-line-clamp: 1 !important;
}
.price{
display: flex;
align-items: center;
justify-content: space-between;
margin-top: 19rpx;
margin-top: 10rpx;
>text:first-child{
font-size: 26rpx;
color: #FF3131;
@ -88,7 +93,7 @@ export default {
align-items: center;
justify-content: space-between;
font-size: 20rpx;
margin-top: 19rpx;
margin-top: 10rpx;
>text:first-child{
color: #666;
}

View File

@ -6,7 +6,7 @@
</view>
<u-tabs-swiper ref="coupon" :list="couponGroupList" name="gc_name" :is-scroll="true" active-color="#FF780F" :current="couponCurrent" font-size="24" :show-bar="false" @change="couponTabsChange" height="60" ></u-tabs-swiper>
<!-- :style="{ height: swiperHeight }" -->
<swiper :current="swiperCouponCurrent" @animationfinish="couponAnimationFinish" :style="{height: swiperHeight}">
<swiper class="box" :current="swiperCouponCurrent" @animationfinish="couponAnimationFinish" :style="{height: swiperHeight}">
<swiper-item class="swiper-coupon-item" v-for="(_, i) in couponGroupList" :key="i">
<!-- 最多显示四个 -->
<view v-for="(coupon, index) in couponList.slice(0, 4)" :key="index" class="coupon-item">
@ -107,18 +107,21 @@ export default {
color: rgba(51,51,51,1);
}
.view-more {
font-size: 18rpx;
font-size: 20rpx;
color: rgba(153,153,153,1);
}
}
.swiper-coupon-item {
padding: 0 30rpx;
box-sizing: border-box;
background-color: #ffffff;
.coupon-item {
height: 200rpx;
margin-bottom: 20rpx;
}
}
.box {
padding-top: 20rpx;
.swiper-coupon-item {
padding: 0 30rpx;
box-sizing: border-box;
background-color: #ffffff;
.coupon-item {
height: 200rpx;
margin-bottom: 20rpx;
}
}
}
}
</style>

View File

@ -101,7 +101,7 @@
},
onLoad() {
//
this.apiwelcome();
// this.apiwelcome();
},
onShow() {
let pages = getCurrentPages();
@ -123,7 +123,9 @@
...mapMutations(['loginIn']),
apiwelcome() {
this.$u.api.sendSmsCode({}).then((res) => {
console.log(res)
if (res.errCode == 0) {
console.log(res)
}
})
},
//
@ -148,21 +150,18 @@
if (this.member_mobile == '') {
this.$refs.uToast.show({
title: '手机号不能为空',
type: 'error'
})
return false;
}
if (type_phone == false) {
this.$refs.uToast.show({
title: '手机号格式不正确',
type: 'error'
});
return false;
}
if (this.sms_code == '') {
this.$refs.uToast.show({
title: '验证码不能为空',
type: 'error'
})
return false;
}
@ -176,7 +175,6 @@
if (res.data == '') {
this.$refs.uToast.show({
title: res.message,
type: 'error'
})
return false
} else {
@ -205,7 +203,6 @@
} else {
this.$refs.uToast.show({
title: res.message,
type: 'error'
})
}
})

View File

@ -109,28 +109,24 @@
if( this.member_mobile == ''){
this.$refs.uToast.show({
title: '手机号不能为空!',
type: 'error'
})
return false;
}
if (type_phone == false) {
this.$refs.uToast.show({
title: '手机号格式不正确!',
type: 'error'
});
return false;
}
if( this.sms_code == ''){
this.$refs.uToast.show({
title: '验证码不能为空!',
type: 'error'
})
return false;
}
if (this.is_check) {
this.$refs.uToast.show({
title: '请同意协议!',
type: 'error'
})
return false;
}
@ -138,10 +134,6 @@
member_mobile: this.member_mobile,
sms_code: this.sms_code
}).then((res) => {
console.log('3333333333',res);
//
// console.log(res)
if(res.errCode == 0){
//
me.loginIn(res.data.token);
@ -159,20 +151,18 @@
// type: 'success',
// url: '/pageA/topick/topick'
// })
}
if(res.errCode == 1){
this.$refs.uToast.show({
title: res.message,
type: 'error'
})
}
if(res.errCode == 2){
} else if(res.errCode == 2){
this.$refs.uToast.show({
title: res.message,
type: 'primary',
url: '/pageA/login/login'
})
}
} else {
this.$refs.uToast.show({
title: res.message,
type: 'primary'
})
}
})
},
// checkbox
@ -196,7 +186,6 @@
// console.log("")
// console.log('2222',this._data.member_mobile)
let member_mobile = this._data.member_mobile;
}
},
components: {

View File

@ -18,7 +18,7 @@
<!-- 评论 -->
<view class="operat pinglun">
<u-icon name="more-circle-fill" :color=" is_content ? '#FF7807' : '#ffffff' " :size="50" @click="editing()"></u-icon>
<text>{{item.comment_num}}</text>
<text>{{ comment_num }}</text>
</view>
<!-- 购物车 -->
<view class="operat gouwu">
@ -74,7 +74,7 @@
<script>
export default {
name:'userinfo',
props:['list','cart','comment'],
props:['list','cart','comment','num'],
data(){
return {
is_follow: this.list.is_attention || false,
@ -82,6 +82,7 @@ export default {
is_collect: this.list.is_collect || false,
is_content: false,
is_cart: false,
comment_num: this.list.comment_num || 0,
item: this.list || {}
}
},
@ -92,15 +93,21 @@ export default {
this.is_follow = this.list.is_attention || false;
this.is_like = this.list.is_like || false;
this.is_collect = this.list.is_collect || false;
this.comment_num = this.list.comment_num || 0;
},
cart(newValue,old) {
// console.log(newValue,old);
// console.log(newValue);
this.is_cart = newValue;
},
comment(newValue,old) {
// console.log(newValue,old);
this.is_content = newValue;
},
num(newVal,old) {
// console.log(newVal);
this.comment_num = newVal;
// this.item.comment_num = newVal;
},
deep: true
},
methods: {

View File

@ -102,7 +102,7 @@ export default {
if (res.errCode == 0) {
// console.log(res);
this.listInfo = res.data.list;
console.log(this.listInfo);
// console.log(this.listInfo);
} else {
console.log(res.message);
}

View File

@ -22,14 +22,14 @@
</view>
</view>
<!-- 用户操作 -->
<userinfo class="userinfo" :list="list" :cart="cart_type" :comment="is_comment" @openCart="openPopup"></userinfo>
<userinfo class="userinfo" :list="list" :cart="cart_type" :comment="is_comment" :num="comment_num" @openCart="openPopup"></userinfo>
<!-- 评论 -->
<u-popup v-model="is_comment" class="pl" mode="bottom" border-radius="10" height="700rpx">
<view class="top">
<text>评论</text>
<u-icon name="arrow-down" color="#333" size="28" @click="is_comment=false"></u-icon>
</view>
<scroll-view class="scroll-box" scroll-y="true" @scrolltolower="scrollBottom">
<scroll-view class="scroll-box" scroll-y="true" lower-threshold="50" @scrolltolower="scrollBottom">
<block v-for="(item,index) in commentList" :key="index">
<view class="box">
<image :src="item.member_avatar" mode="aspectFill"></image>
@ -55,7 +55,8 @@
<view class="more-reply" v-if="item.reply_count" @click="getReplyList(item.id)">展开更多回复<u-icon name="arrow-down"></u-icon></view>
</view>
</block>
<!-- <view class="no-data" v-else>111</view> -->
<view class="no-data" v-if="!commentList.length">还没有评论快来评论吧</view>
<u-loadmore v-else :status="status" icon-type="iconType" margin-top="50" margin-bottom="50" :load-text="loadText" />
</scroll-view>
<view class="editing" @click="openKeyInput">
<input type="text" value="" :placeholder="edit_text" disabled="disabled" />
@ -258,9 +259,11 @@
}
}
.no-data {
margin-top: 100rpx;
margin-top: 200rpx;
text-align: center;
}
.editing {
z-index: 1000;
position: fixed;
bottom: 0;
display: flex;
@ -411,10 +414,19 @@ export default {
cartList: [],
cart_len: 0,
photo_len: 0,
comment_num: 0,
edit_text: "有爱评论,说点好听的 ~",
edit_text_other: "有爱评论,说点好听的 ~",
commentList: [], //
allList: [], //
status: 'loadmore',
iconType: 'circle',
loadText: {
loadmore: '轻轻上拉',
loading: '努力加载中',
nomore: '暂时没有更多了',
no: '评论'
}
}
},
onLoad(option){
@ -455,7 +467,7 @@ export default {
this.is_comment = data.comment;
if (this.is_comment) {
this.page = 0;
this.getComment(this.article_id,0);
this.getComment();
}
},
//
@ -464,13 +476,20 @@ export default {
article_id: this.article_id,
page: this.page,
}).then(res => {
console.log(res);
if (res.errCode == 0 && this.page == 0) {
this.commentList = res.data;
} else if (res.errCode == 0 && this.page > 0) {
this.commentList = this.commentList.concat(res.data);
} else {
this.status = "loading";
// console.log(res);
if (res.errCode == 0) {
if (this.commentList.length < 8) {
this.status = "nomore";
}
if (this.page == 0) {
this.commentList = res.data;
} else if (res.data.length == 0 && this.page > 0) {
this.status = "nomore";
} else {
this.commentList = this.commentList.concat(res.data);
}
this.page++;
}
})
},
@ -501,6 +520,8 @@ export default {
}).then(res => {
// console.log(res.data.data);
if (res.errCode == 0) {
this.comment_num = res.data.num;
// console.log(this.comment_num);
this.is_edit = false;
if (res.data.data.pid) {
this.commentList[this.comment_id].reply_count = true;
@ -540,7 +561,6 @@ export default {
},
//
scrollBottom(e) {
this.page++;
this.getComment();
},
//

View File

@ -20,20 +20,21 @@
</view>
<swiper class="card" @change="dianji" :current="num">
<swiper-item>
<scroll-view style="width:100%;height:100%" scroll-y="true">
<scroll-view style="width:100%;height:100%" scroll-y="true" lower-threshold="200" @scrolltolower="swiperBottom">
<view class="box">
<!-- <indexad style="width:690rpx"></indexad> -->
<u-swiper mode="dot" :list="indexImageSwiper" name="adv_code" @click="clickFImage"></u-swiper>
<view class="list">
<view>
<videoItem v-for="item in articleList.filter((_, index) => !(index&1))" :key="item.article_id" :item="item"
<videoItem v-for="(item,id) in articleList.filter((_, index) => !(index&1))" :key="id" :item="item"
@getArticlelist="getArticlelist"></videoItem>
</view>
<view style="margin-left:20rpx">
<videoItem v-for="item in articleList.filter((_, index) => index&1)" :key="item.article_id" :item="item"
<videoItem v-for="(item,id) in articleList.filter((_, index) => index&1)" :key="id" :item="item"
@getArticlelist="getArticlelist"></videoItem>
</view>
</view>
<u-loadmore :status="status" icon-type="iconType" margin-top="50" margin-bottom="50" :load-text="loadText" />
</view>
</scroll-view>
</swiper-item>
@ -55,7 +56,7 @@
</scroll-view>
</swiper-item>
<swiper-item>
<scroll-view style="width:100%;height:100%" scroll-y="true">
<scroll-view style="width:100%;height:100%" scroll-y="true" @scrolltolower="followBotton" lower-threshold="200">
<view class="box">
<view class="tuijian">
<view class="title" @click="toSearchPage">
@ -74,9 +75,11 @@
<view class="rec-list">
<view class="rec-box">
<!-- {{ fansList }} -->
<videoItem isguanzhu="true" v-for="item in fansList" :key="item.article_id"
:item="item"></videoItem>
<view class="no-data" v-show="!fansList.length">您还没有关注哦赶紧去点点关注</view>
<view class="item">
<videoItem isguanzhu="true" v-for="(item,id) in fansList" :key="id" :item="item"></videoItem>
</view>
<view class="no-data" v-if="!fansList.length">您还没有关注哦赶紧去点点关注</view>
<u-loadmore v-else :status="status_1" icon-type="iconType" margin-top="50" margin-bottom="50" :load-text="loadText" />
</view>
</view>
</view>
@ -182,15 +185,19 @@
.rec-list {
width: 100%;
.rec-box {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
.no-data {
margin: 200rpx auto 0;
width: 100%;
.item {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
}
}
}
}
.no-data {
margin: 200rpx auto 0;
text-align: center;
}
</style>
<script>
import { mapState } from 'vuex'
@ -215,12 +222,21 @@
}],
num: 0,
page: 0, // 0
follow_page: 0, //
articleList: [],
recommendList: [], //
indexImageSwiper: [],
zhiboImageSwiper: [],
tabLiveLists: [],
fansList: [], //
status: 'loadmore',
status_1: 'loadmore',
iconType: 'circle',
loadText: {
loadmore: '轻轻上拉',
loading: '努力加载中',
nomore: '实在没有了'
}
}
},
components: {
@ -230,6 +246,8 @@
darenItem
},
onShow() {
this.articleList = [];
this.page = 0;
this.getArticlelist();
this.getSwiper();
},
@ -260,8 +278,9 @@
this.$u.api.attentionMember({
member_id: member_id
}).then((res) => {
console.log(res)
this.getRecommendList();
console.log(res);
this.follow_page = 0;
this.getRecommendList(); //
this.getFollowList(); //
})
},
@ -282,12 +301,16 @@
}
//
if (this.num == 0) {
this.page = 0;
this.status = "loadmore";
this.getArticlelist();
this.getSwiper();
} else if (this.num == 1) {
this.getZhiBoSwiper(); //
this.tabLiveList();
} else if (this.num == 2) {
this.follow_page = 0;
this.status = "loadmore";
if (this.hasLogin) {
this.getFollowList(); //
}
@ -300,13 +323,33 @@
page: this.page,
is_video_img: 0, // 1 2 0
}).then(res => {
// uni.stopPullDownRefresh();
// console.log('37647744ghj', res)
if (res.errCode == 0) {
this.articleList = res.data.list;
}
this.status = "loading";
if (res.errCode == 0) {
// uni.stopPullDownRefresh();
// console.log('37647744ghj', res)
if (this.page == 0) {
this.articleList = res.data.list;
this.status = "loadmore";
} else if (res.data.length == 0 && this.page > 0) {
this.status = "nomore";
} else {
this.articleList = this.articleList.concat(res.data.list);
}
this.page++;
} else {
this.status = "nomore"
}
})
},
//
swiperBottom(e) {
this.getArticlelist();
// console.log(e);
},
followBotton(e) {
this.getFollowList();
// console.log(e);
},
//
getRecommendList() {
this.$u.api.getRecommendList().then(res => {
@ -319,12 +362,24 @@
//
getFollowList() {
this.$u.post("article/attentionArticleList",{
page: 0,
page: this.follow_page,
}).then(res => {
this.status_1 = "loading";
if (res.errCode == 0) {
this.fansList = res.data.list;
// uni.stopPullDownRefresh();
// console.log('37647744ghj', res)
if (this.follow_page == 0) {
this.fansList = res.data.list;
this.status_1 = "loadmore";
} else if (res.data.list.length == 0 && this.follow_page > 0) {
this.status_1 = "nomore";
} else {
this.fansList = this.fansList.concat(res.data.list);
}
this.follow_page++;
} else {
this.status_1 = "nomore"
}
// console.log(res);
})
},
toSearchPage() {

View File

@ -226,9 +226,10 @@
</script>
<style lang="scss" scoped>
.shop {
height: calc(100vh - var(--window-top));
height: calc(100% - var(--window-top));
box-sizing: border-box;
background-color: #F0EDF1;
overflow-y: scroll;
.top {
padding: 0 30rpx;