update
This commit is contained in:
parent
f30c4f4922
commit
5b31193750
@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<view class="notice">
|
||||
<view v-for="(item,index) in notice">
|
||||
<view v-for="(item,index) in notice" :key="index">
|
||||
<view class="time_notice">2020-05-14 20:11</view>
|
||||
<view class="notice_view">
|
||||
<image :src="item.url" mode="aspectFill" ></image>
|
||||
|
@ -18,7 +18,7 @@
|
||||
<view class="page-section swiper">
|
||||
<view class="page-section-spacing">
|
||||
<swiper class="swiper" :indicator-dots="true" :style="{height:heightOut+'px'}" :autoplay="false" :interval="3000" :duration="1000">
|
||||
<swiper-item v-for="item in list" >
|
||||
<swiper-item v-for="(item,index) in list" :key="index">
|
||||
<view class="swiper-item uni-bg-red">
|
||||
<image :src=" 'https://' + item.launch_path"></image>
|
||||
</view>
|
||||
|
@ -180,9 +180,15 @@
|
||||
return false
|
||||
} else {
|
||||
me.loginIn(res.data.token); //存储一个字符传值
|
||||
if (res.data.member.has_labels) {
|
||||
uni.switchTab({
|
||||
url: '/pages/index/index'
|
||||
})
|
||||
} else {
|
||||
uni.navigateTo({
|
||||
url: '/pageA/topick/topick'
|
||||
})
|
||||
}
|
||||
// 缓存用户的信息
|
||||
// uni.setStorageSync({
|
||||
// key: 'user_info',
|
||||
@ -198,7 +204,6 @@
|
||||
}
|
||||
|
||||
// 存储接口请求所需token
|
||||
me.loginIn(res.data.token); //存储一个字符传值
|
||||
// // 注册返回参数
|
||||
// this.$refs.uToast.show({
|
||||
// title: res.message,
|
||||
|
@ -59,25 +59,35 @@
|
||||
},
|
||||
// 点击切换颜色
|
||||
tapClick(index, id) {
|
||||
// console.log(id);
|
||||
// console.log(index);
|
||||
if (this.rSelect.indexOf(index) == -1) {
|
||||
this.rSelect.push(index); // 选中状态
|
||||
this.list.push(id); //选中添加到数组里
|
||||
if (this.rSelect.length > 9) {
|
||||
this.$u.toast("只能选择10个标签!");
|
||||
return false;
|
||||
}
|
||||
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);
|
||||
console.log(this.list);
|
||||
},
|
||||
toHomePage() {
|
||||
this.$u.post("StartUp/addLabel", {
|
||||
label_ids: this.list
|
||||
}).then(res => {
|
||||
// console.log(res);
|
||||
if (res.errCode == 0) {
|
||||
// this.$u.toast(res.message);
|
||||
uni.switchTab({
|
||||
url: '/pages/index/index'
|
||||
});
|
||||
} else {
|
||||
this.$u.toast(res.message);
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
}
|
||||
|
@ -2,10 +2,17 @@
|
||||
<u-popup v-model="show" mode="bottom" length="782" border-radius="20">
|
||||
<view class="top">
|
||||
<text>全部商品</text>
|
||||
<image></image>
|
||||
<u-icon name="close" color="#999999" :size="30" @click="toggerList"></u-icon>
|
||||
</view>
|
||||
<scroll-view :scroll-y="true" class="scroll-box">
|
||||
<view v-for="(item,index) in cartList" :key="index" class="item">
|
||||
<image :src="item.goods_image" mode="aspectFill"></image>
|
||||
<view>
|
||||
<text class="title">{{ item.goods_advword }}</text>
|
||||
<text class="name">{{ item.goods_name }}{{ item.goods_name }}{{ item.goods_name }}{{ item.goods_name }}{{ item.goods_name }}</text>
|
||||
<text class="price">{{ item.goods_promotion_price }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<scroll-view :scroll-y="true" style="padding:0 30rpx;height:692rpx">
|
||||
<sitem v-for="i in 10"></sitem>
|
||||
</scroll-view>
|
||||
</u-popup>
|
||||
</template>
|
||||
@ -13,20 +20,30 @@
|
||||
import sitem from "./item"
|
||||
export default {
|
||||
name:'shoplist',
|
||||
props: ['list'],
|
||||
components:{
|
||||
sitem
|
||||
},
|
||||
data(){
|
||||
return {
|
||||
show: true
|
||||
show: true,
|
||||
cartList: this.list || [],
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
list() {
|
||||
this.cartList = this.list;
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
toggerList() {
|
||||
this.show = false;
|
||||
this.$emit("hideCart",this.show);
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
image{
|
||||
background-color: #0f0;
|
||||
}
|
||||
.top{
|
||||
height: 88rpx;
|
||||
width: 100%;
|
||||
@ -39,9 +56,41 @@ image{
|
||||
font-size: 30rpx;
|
||||
color: #333;
|
||||
}
|
||||
>image{
|
||||
width: 33rpx;
|
||||
height: 33rpx;
|
||||
}
|
||||
.scroll-box {
|
||||
.item {
|
||||
display: flex;
|
||||
padding: 20rpx;
|
||||
border-bottom: 1px solid #ECECEC;
|
||||
& > image {
|
||||
flex-shrink: 0;
|
||||
width: 160rpx;
|
||||
height: 160rpx;
|
||||
margin-right: 14rpx;
|
||||
border-radius: 10rpx;
|
||||
}
|
||||
& > view {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
color: #333;
|
||||
font-size: 28rpx;
|
||||
.title {
|
||||
}
|
||||
.name {
|
||||
width: 500rpx;
|
||||
height: 80rpx;
|
||||
font-size: 24rpx;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
display: -webkit-box;
|
||||
-webkit-box-orient: vertical;
|
||||
-webkit-line-clamp: 2;
|
||||
}
|
||||
.price {
|
||||
color: #FF3131;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
@ -9,16 +9,13 @@
|
||||
</view>
|
||||
</template>
|
||||
<style lang="scss" scoped>
|
||||
image{
|
||||
background-color: #0f0;
|
||||
}
|
||||
.shopone{
|
||||
display: flex;
|
||||
width: 442rpx;
|
||||
height: 200rpx;
|
||||
background:rgba(0,0,0,0.4);
|
||||
padding: 20rpx;
|
||||
display: flex;
|
||||
border-radius: 10rpx;
|
||||
background:rgba(0,0,0,0.4);
|
||||
>image{
|
||||
width: 160rpx;
|
||||
height: 160rpx;
|
||||
|
@ -1,30 +1,32 @@
|
||||
<template>
|
||||
<view class="userinfo">
|
||||
<view class="userhead">
|
||||
<image :src="list.member_avatar"></image>
|
||||
<text>+</text>
|
||||
<image :src="item.member_avatar"></image>
|
||||
<text class="follow" v-if="!is_follow" @click="following(item.member_id)">+</text>
|
||||
<u-icon v-else name="checkbox-mark" color="#ffffff" :size="28" class="follow" @click="following(item.member_id)"></u-icon>
|
||||
</view>
|
||||
<view class="zan">
|
||||
<image></image>
|
||||
<text>{{list.like_num}}</text>
|
||||
<!-- 点赞 -->
|
||||
<view class="operat zan">
|
||||
<u-icon name="thumb-up-fill" :color=" is_like ? '#FF7807' : '#ffffff' " :size="50" @click="likeType(item.article_id)"></u-icon>
|
||||
<text>{{item.like_num}}</text>
|
||||
</view>
|
||||
<view class="shoucang">
|
||||
<image></image>
|
||||
<text>{{list.collect_num}}</text>
|
||||
<!-- 收藏 -->
|
||||
<view class="operat shoucang">
|
||||
<u-icon name="star-fill" :color=" is_collect ? '#FF7807' : '#ffffff' " :size="50" @click="collecting(item.article_id)"></u-icon>
|
||||
<text>{{item.collect_num}}</text>
|
||||
</view>
|
||||
<view class="pinglun">
|
||||
<image></image>
|
||||
<text>{{list.comment_num}}</text>
|
||||
<!-- 评论 -->
|
||||
<view class="operat pinglun">
|
||||
<u-icon name="more-circle-fill" color="#ffffff" :size="50" @click="editing()"></u-icon>
|
||||
<text>{{item.comment_num}}</text>
|
||||
</view>
|
||||
<view class="gouwu">
|
||||
<image></image>
|
||||
<!-- 购物车 -->
|
||||
<view class="operat gouwu">
|
||||
<u-icon name="shopping-cart-fill" :color=" is_cart ? '#FF7807' : '#ffffff' " :size="50" @click="carting()"></u-icon>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
<style lang="scss" scoped>
|
||||
image{
|
||||
background-color: #0f0;
|
||||
}
|
||||
.userinfo{
|
||||
width: 110rpx;
|
||||
height: 570rpx;
|
||||
@ -32,41 +34,39 @@ image{
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
>view{
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
font-size: 28rpx;
|
||||
color: #fff;
|
||||
>text{
|
||||
margin-top: 17rpx;
|
||||
}
|
||||
>image{
|
||||
width: 50rpx;
|
||||
height: 50rpx;
|
||||
}
|
||||
}
|
||||
>view:first-child{
|
||||
.userhead{
|
||||
position: relative;
|
||||
display: flex;
|
||||
position: relative;
|
||||
align-items: center;
|
||||
>image{
|
||||
&>image{
|
||||
width: 110rpx;
|
||||
height: 110rpx;
|
||||
border-radius: 50%;
|
||||
border: 2rpx solid #fff;
|
||||
|
||||
}
|
||||
>text{
|
||||
.follow {
|
||||
position: absolute;
|
||||
top: 90rpx;
|
||||
left: 35%;
|
||||
width: 36rpx;
|
||||
height: 36rpx;
|
||||
font-size: 36rpx;
|
||||
background-color: #FF780F;
|
||||
position: absolute;
|
||||
top: 75rpx;
|
||||
border-radius: 50%;
|
||||
line-height: 36rpx;
|
||||
text-align: center;
|
||||
line-height: 36rpx;
|
||||
font-size: 36rpx;
|
||||
border-radius: 50%;
|
||||
color: #fff;
|
||||
background-color: #FF780F;
|
||||
}
|
||||
}
|
||||
.operat {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-direction: column;
|
||||
& > text {
|
||||
margin-top: 10rpx;
|
||||
font-size: 28rpx;
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -74,11 +74,70 @@ image{
|
||||
<script>
|
||||
export default {
|
||||
name:'userinfo',
|
||||
props:['list','cart'],
|
||||
data(){
|
||||
return {
|
||||
|
||||
is_follow: this.list.is_attention || false,
|
||||
is_like: this.list.is_like || false,
|
||||
is_collect: this.list.is_collect || false,
|
||||
is_content: false,
|
||||
is_cart: this.cart || false,
|
||||
item: this.list || []
|
||||
}
|
||||
},
|
||||
props:['list']
|
||||
watch: {
|
||||
list(newValue,old) {
|
||||
console.log(newValue,old);
|
||||
},
|
||||
cart(newValue,old) {
|
||||
// console.log(newValue,old);
|
||||
this.is_cart = newValue;
|
||||
},
|
||||
deep: true
|
||||
},
|
||||
methods: {
|
||||
// 关注
|
||||
following(id) {
|
||||
this.is_follow = !this.is_follow;
|
||||
this.$u.api.attentionMember({member_id: id}).then(res => {
|
||||
if (res.errCode == 0) {
|
||||
this.$u.toast(res.message);
|
||||
}
|
||||
})
|
||||
},
|
||||
// 点赞
|
||||
likeType(id) {
|
||||
// console.log(id);
|
||||
this.is_like = !this.is_like;
|
||||
this.$u.post("article/articleLike",{article_id: id}).then(res => {
|
||||
if (res.errCode == 0) {
|
||||
// console.log(res);
|
||||
this.list.like_num = res.data.num;
|
||||
} else {
|
||||
this.$u.toast(res.message);
|
||||
}
|
||||
})
|
||||
},
|
||||
// 收藏
|
||||
collecting(id) {
|
||||
this.is_collect = !this.is_collect;
|
||||
this.$u.post("article/articleCollect",{article_id: id}).then(res => {
|
||||
if (res.errCode == 0) {
|
||||
// console.log(res);
|
||||
this.list.collect_num = res.data.num;
|
||||
} else {
|
||||
this.$u.toast(res.message);
|
||||
}
|
||||
})
|
||||
},
|
||||
// 评论
|
||||
editing() {},
|
||||
// 购物车
|
||||
carting() {
|
||||
this.is_cart = !this.is_cart;
|
||||
// console.log(this.is_cart);
|
||||
this.$emit("openCart",this.is_cart);
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
@ -20,10 +20,10 @@
|
||||
<view class="box">
|
||||
<view class="list">
|
||||
<view >
|
||||
<videoItem v-for="item in 10"></videoItem>
|
||||
<videoItem v-for="item in 10" :key="index"></videoItem>
|
||||
</view>
|
||||
<view style="margin-left:20rpx">
|
||||
<videoItem v-for="item in 10"></videoItem>
|
||||
<videoItem v-for="item in 10" :key="index"></videoItem>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@ -35,10 +35,10 @@
|
||||
<view class="box">
|
||||
<view class="list">
|
||||
<view >
|
||||
<zhiboItem v-for="item in 10"></zhiboItem>
|
||||
<zhiboItem v-for="item in 10" :key="index"></zhiboItem>
|
||||
</view>
|
||||
<view style="margin-left:20rpx">
|
||||
<zhiboItem v-for="item in 10"></zhiboItem>
|
||||
<zhiboItem v-for="item in 10" :key="index"></zhiboItem>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
@ -3,27 +3,26 @@
|
||||
<view class="back">
|
||||
<u-icon name="close" color="#999999" :size="30" @click="goBack"></u-icon>
|
||||
</view>
|
||||
<swiper class="swiper">
|
||||
<swiper-item>
|
||||
<image :src="list.article_pic"></image>
|
||||
<swiper class="swiper" circular autoplay @change="changeSwiper">
|
||||
<swiper-item v-for="(simg,sindex) in list.photo" :key="sindex">
|
||||
<image :src="simg.url" mode="aspectFill" @tap="viewImage" :data-index="sindex"></image>
|
||||
</swiper-item>
|
||||
<!-- <swiper-item>
|
||||
<image></image>
|
||||
</swiper-item> -->
|
||||
|
||||
</swiper>
|
||||
<view class="bottom">
|
||||
<scroll-view scroll-y="true" class="bottom">
|
||||
<view class="item">
|
||||
<text>图片</text>
|
||||
<view v-for="(item,index) in 4" :key="index" :style="{'background-color':index == 2 ? '#fff' : '#ede8e8'}"></view>
|
||||
<view v-for="(item,index) in list.photo" :key="index" :style="{'background-color':index == swiper_id ? '#fff' : '#ede8e8'}"></view>
|
||||
</view>
|
||||
<view class="username">自己黑的哈万岁哦划u将</view>
|
||||
<view class="title">hasjdhajskhj</view>
|
||||
<view class="info u-line-2">asdjhasjdkasljdklasjkl</view>
|
||||
<view class="username">{{ list.member_nickname }}</view>
|
||||
<view class="title">{{ list.article_title }}</view>
|
||||
<view class="info">{{ list.article_content }}</view>
|
||||
<view class="box">
|
||||
<view class="label" v-for="(label,id) in list.label" :key="id">{{ label.name }}</view>
|
||||
</view>
|
||||
<userinfo class="userinfo" :list="list"></userinfo>
|
||||
<shpoone class="shpoone"></shpoone>
|
||||
<shoplist></shoplist>
|
||||
</scroll-view>
|
||||
<userinfo class="userinfo" :list="list" :cart="cart_type" @openCart="openCart"></userinfo>
|
||||
<shpoone class="shpoone" v-show="list.goods.length == 1 && cart_type"></shpoone>
|
||||
<shoplist :list="list.goods" v-show="list.goods.length > 1 && cart_type" @hideCart="hideCart"></shoplist>
|
||||
</view>
|
||||
</template>
|
||||
<style lang="scss" scoped>
|
||||
@ -46,23 +45,23 @@
|
||||
}
|
||||
}
|
||||
.bottom{
|
||||
width: 100%;
|
||||
height: 270rpx;
|
||||
background-color: #fff;
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
width: 700rpx;
|
||||
height: 300rpx;
|
||||
padding: 20rpx 30rpx;
|
||||
background-color: #fff;
|
||||
.item{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 8rpx 16rpx;
|
||||
font-size: 24rpx;
|
||||
color: #fff;
|
||||
background-color: #999;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
border-radius: 10rpx;
|
||||
background-color: #999;
|
||||
>view{
|
||||
width: 12rpx;
|
||||
height: 12rpx;
|
||||
@ -71,46 +70,61 @@
|
||||
}
|
||||
}
|
||||
.username{
|
||||
margin: 20rpx 0;
|
||||
font-size: 36rpx;
|
||||
color: #333;
|
||||
margin-top: 20rpx;
|
||||
|
||||
}
|
||||
.title{
|
||||
font-size: 26rpx;
|
||||
color: #333;
|
||||
margin-top: 23rpx;
|
||||
}
|
||||
.info{
|
||||
margin: 20rpx 0;
|
||||
display: -webkit-box;
|
||||
-webkit-box-orient: vertical;
|
||||
-webkit-line-clamp: 2;
|
||||
overflow: hidden;
|
||||
font-size: 28rpx;
|
||||
line-height: 42rpx;
|
||||
margin-top: 20rpx;
|
||||
}
|
||||
.box {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
.label {
|
||||
padding: 6rpx 10rpx;
|
||||
margin: 0 10rpx 10rpx 0;
|
||||
font-size: 24rpx;
|
||||
color: #fff;
|
||||
border-radius: 6rpx;
|
||||
background-color: #000000;
|
||||
opacity: 0.5;
|
||||
}
|
||||
}
|
||||
}
|
||||
.userinfo{
|
||||
position: absolute;
|
||||
right: 30rpx;
|
||||
top: 50%;
|
||||
transform: translateY(-285rpx);
|
||||
right: 30rpx;
|
||||
}
|
||||
.shpoone{
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
z-index: 999;
|
||||
position: absolute;
|
||||
right: 139rpx;
|
||||
top: 54%;
|
||||
transform: translateY(100rpx);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
import userinfo from "../components/userinfo/index"
|
||||
import shpoone from "../components/shpoone/index"
|
||||
import shoplist from "../components/shoplist/index"
|
||||
import userinfo from "../components/userinfo/index" // 点赞组件
|
||||
import shpoone from "../components/shpoone/index" //
|
||||
import shoplist from "../components/shoplist/index" // 商品列表
|
||||
|
||||
export default {
|
||||
name:"photo",
|
||||
onLoad(e) {
|
||||
console.log('dhdhdhdhd',e)
|
||||
onLoad(option) {
|
||||
console.log(option);
|
||||
},
|
||||
components:{
|
||||
userinfo,
|
||||
@ -119,15 +133,35 @@ export default {
|
||||
},
|
||||
data(){
|
||||
return {
|
||||
list:{}
|
||||
list:{},
|
||||
swiper_id: "",
|
||||
cart_type: false,
|
||||
}
|
||||
},
|
||||
methods:{
|
||||
// 发现详情
|
||||
articleInfo(article_id){
|
||||
this.$u.api.articleInfo({article_id}).then((res)=>{
|
||||
console.log(res)
|
||||
this.list = res.data.info
|
||||
this.list = res.data.info;
|
||||
})
|
||||
},
|
||||
// 改变swiper
|
||||
changeSwiper(e) {
|
||||
// console.log(e.detail.current);
|
||||
this.swiper_id = e.detail.current; // 储存swiper id
|
||||
},
|
||||
// 更改购物车状态
|
||||
openCart(data) {
|
||||
console.log(data);
|
||||
this.cart_type = data;
|
||||
},
|
||||
hideCart(data) {
|
||||
// console.log(data);
|
||||
this.cart_type = data;
|
||||
},
|
||||
// 预览图片
|
||||
viewImage(e) {
|
||||
console.log(e);
|
||||
},
|
||||
goBack() {
|
||||
uni.navigateBack({
|
||||
|
@ -13,7 +13,7 @@
|
||||
<view class="guanzhu" @click="guanzhu"><text style="color:#fff;font-size:24rpx">{{info.is_attention == 1 ? '已关注' : '关注'}}</text></view>
|
||||
</view>
|
||||
<view class="userlist" :style="{'top': top + 10 * rpx}">
|
||||
<image class="userlistitem" v-for="(i,j) in [0,1,2]" :style="{'right': (-j * 15 * rpx) + 'px'}"></image>
|
||||
<image class="userlistitem" v-for="(i,j) in [0,1,2]" :style="{'right': (-j * 15 * rpx) + 'px'}" :key="j"></image>
|
||||
</view>
|
||||
<view class="hot" :style="{'top': top + 10 * rpx}">
|
||||
<text class="hottext">2.8w</text>
|
||||
@ -36,7 +36,7 @@
|
||||
</div> -->
|
||||
</div>
|
||||
<list class="list">
|
||||
<cell class="item" v-for="(i,j) in list" @click="xuanzhong(j)">
|
||||
<cell class="item" v-for="(i,j) in list" :key="j" @click="xuanzhong(j)">
|
||||
<image class="shopimg" :src="i.goods_image"></image>
|
||||
<div class="infos">
|
||||
<div>
|
||||
|
Loading…
Reference in New Issue
Block a user