This commit is contained in:
Gdpao 2020-08-01 17:22:46 +08:00
parent 223dd51db7
commit 8a213ba094
7 changed files with 330 additions and 103 deletions

View File

@ -56,7 +56,8 @@
"<uses-permission android:name=\"android.permission.WRITE_CONTACTS\"/>",
"<uses-permission android:name=\"android.permission.WRITE_EXTERNAL_STORAGE\"/>",
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
]
],
"abiFilters" : [ "armeabi-v7a", "x86" ]
},
/* ios */
"ios" : {},
@ -86,7 +87,9 @@
"UniversalLinks" : "https://demo.dcloud.net.cn/ulink/"
}
},
"speech" : {},
"speech" : {
"ifly" : {}
},
"payment" : {
"alipay" : {},
"weixin" : {

View File

@ -190,17 +190,13 @@
})
}
//
// uni.setStorageSync({
// key: 'user_info',
// data: res.data,
// success: function() {
// console.log('success');
// //
// uni.navigateTo({
// url : '/pageA/topick/topick'
// })
// }
// });
uni.setStorageSync({
key: 'user_info',
data: res.data,
success: function() {
console.log('success');
}
});
}
// token

View File

@ -27,18 +27,12 @@ export default {
data(){
return {
show: true,
cartList: this.list || [],
cartList: [],
}
},
watch: {
list() {
this.cartList = this.list;
}
},
methods: {
toggerList() {
this.show = false;
this.$emit("hideCart",this.show);
}
}
}

View File

@ -1,48 +1,89 @@
<template>
<view class="shopone">
<image></image>
<view>
<text>sadas</text>
<text>dasadas</text>
<text>dsadas</text>
</view>
</view>
<view>
<u-popup v-model="is_comment" mode="bottom" border-radius="10" height="700rpx">
<view class="top">
<text>评论</text>
<u-icon name="arrow-down" color="#333" size="28" @click="close"></u-icon>
</view>
<scroll-view class="scroll-box" scroll-y="true" >
<view></view>
</scroll-view>
<view class="editing">
<input type="text" value="" />
<text>发送</text>
</view>
</u-popup>
</view>
</template>
<style lang="scss" scoped>
.shopone{
display: flex;
width: 442rpx;
height: 200rpx;
padding: 20rpx;
border-radius: 10rpx;
background:rgba(0,0,0,0.4);
>image{
width: 160rpx;
height: 160rpx;
}
>view{
margin-left: 20rpx;
display: flex;
flex-direction: column;
justify-content: space-between;
>text{
font-size: 24rpx;
color: #fff;
line-height: 36rpx;
}
>text:first-child{
font-size: 28rpx;
}
>text:last-child{
font-size: 28rpx;
color: #FF3131;
}
}
}
</style>
<script>
export default {
name:"shopone"
name: "shopone",
props: ['comment'],
data() {
return {
is_comment: true
}
},
onReady() {
this.getComment(); //
},
watch: {
comment(newValue,old) {
console.log(newValue,old);
},
deep: true
},
methods: {
getComment() {
this.$u.post("Specialci/getAllEvalue", {
goods_id: goods_id,
page: 1
}).then(res => {
console.log(res);
})
},
close() {
this.is_comment = false;
}
}
}
</script>
</script>
<style lang="scss" scoped>
.top {
position: fixed;
top: 0;
width: 100%;
height: 88rpx;
padding: 0 20rpx;
line-height: 88rpx;
background-color: #ECECEC;
& > text {
margin-right: 280rpx;
color: #333;
font-size: 30rpx;
font-weight: 500;
}
}
.scroll-box {
margin: 88rpx 0 100rpx 0;
height: 100%;
}
.editing {
position: fixed;
bottom: 0;
display: flex;
align-items: center;
justify-content: space-between;
width: 100%;
height: 90rpx;
padding: 0 30rpx;
background-color: #ECECEC;
& > input {
width: 80%;
height: 60rpx;
padding: 0 20rpx;
border-radius: 30rpx;
background-color: #fff;
}
}
</style>

View File

@ -3,7 +3,7 @@
<view class="userhead">
<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>
<u-icon v-else name="checkmark" color="#ffffff" :size="28" class="follow" @click="following(item.member_id)"></u-icon>
</view>
<!-- 点赞 -->
<view class="operat zan">
@ -17,7 +17,7 @@
</view>
<!-- 评论 -->
<view class="operat pinglun">
<u-icon name="more-circle-fill" color="#ffffff" :size="50" @click="editing()"></u-icon>
<u-icon name="more-circle-fill" :color=" is_content ? '#FF7807' : '#ffffff' " :size="50" @click="editing()"></u-icon>
<text>{{item.comment_num}}</text>
</view>
<!-- 购物车 -->
@ -74,25 +74,33 @@
<script>
export default {
name:'userinfo',
props:['list','cart'],
props:['list','cart','comment'],
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 || []
is_cart: false,
item: this.list || {}
}
},
watch: {
list(newValue,old) {
console.log(newValue,old);
// console.log(newValue,old);
this.item = newValue || {};
this.is_follow = this.list.is_attention || false;
this.is_like = this.list.is_like || false;
this.is_collect = this.list.is_collect || false;
},
cart(newValue,old) {
// console.log(newValue,old);
this.is_cart = newValue;
},
comment(newValue,old) {
console.log(newValue,old);
this.is_content = newValue;
},
deep: true
},
methods: {
@ -131,12 +139,16 @@ export default {
})
},
//
editing() {},
editing() {
this.is_content = !this.is_content;
// console.log(this.is_content);
this.$emit("openCart",{ comment: this.is_content, cart: this.is_cart});
},
//
carting() {
this.is_cart = !this.is_cart;
// console.log(this.is_cart);
this.$emit("openCart",this.is_cart);
this.$emit("openCart",{ comment: this.is_content, cart: this.is_cart});
},
}
}

View File

@ -1,14 +1,15 @@
<template>
<view class="photo">
<view class="status_bar"></view>
<view class="back">
<u-icon name="close" color="#999999" :size="30" @click="goBack"></u-icon>
</view>
<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>
<image :src="simg.url" mode="aspectFill" @tap="viewImage" :data-url="simg.url"></image>
</swiper-item>
</swiper>
<scroll-view scroll-y="true" class="bottom">
<view class="bottom">
<view class="item">
<text>图片</text>
<view v-for="(item,index) in list.photo" :key="index" :style="{'background-color':index == swiper_id ? '#fff' : '#ede8e8'}"></view>
@ -19,24 +20,66 @@
<view class="box">
<view class="label" v-for="(label,id) in list.label" :key="id">{{ label.name }}</view>
</view>
</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>
<!-- 用户操作 -->
<userinfo class="userinfo" :list="list" :cart="cart_type" :comment="is_comment" @openCart="openCart"></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="close"></u-icon>
</view>
<scroll-view class="scroll-box" scroll-y="true" >
<view></view>
</scroll-view>
<view class="editing">
<input type="text" value="" />
<text>发送</text>
</view>
</u-popup>
<!-- 购物车 -->
<u-popup v-if="cart_len > 1" class="cart" v-model="cart_type" mode="bottom" length="782" border-radius="20">
<view class="top">
<text>全部商品</text>
<u-icon name="close" color="#999999" :size="30" @click="cart_type = false"></u-icon>
</view>
<scroll-view :scroll-y="true" class="scroll-box">
<view v-for="(item,index) in list.goods" :key="index" class="item" @click="gotoInfo(item.goods_id)">
<image :src="item.goods_image" mode="aspectFill"></image>
<view>
<text class="title">{{ item.goods_advword }}</text>
<text class="name">{{ item.goods_name }}</text>
<text class="price">{{ item.goods_promotion_price }}</text>
</view>
</view>
</scroll-view>
</u-popup>
<!-- 单个 -->
<view class="good-one" v-else v-show="cart_type">
<view class="box" v-for="(item,index) in list.goods" :key="index" @click="gotoInfo(item.goods_id)">
<image :src="item.goods_image" mode=""></image>
<view>
<view class="title u-line-1">{{ item.goods_advword }}</view>
<view class="content u-line-2">{{ item.goods_name }}</view>
<view class="price">{{ item.goods_promotion_price }}</view>
</view>
</view>
</view>
<!-- <shoplist :list="list.goods" v-show="list.goods.length > 1 && cart_type" @hideCart="hideCart"></shoplist> -->
</view>
</template>
<style lang="scss" scoped>
.photo{
height: 100vh;
background-color: #ececec;
width: 100%;
height: 100%;
background-color: #ececec;
.back{
padding-top: 28rpx;
padding-right: 31rpx;
text-align: right;
}
.swiper{
width: 100%;
width: 750rpx;
height: 702rpx;
margin-top: 102rpx;
image{
@ -45,13 +88,8 @@
}
}
.bottom{
position: fixed;
bottom: 0;
display: flex;
flex-direction: column;
align-items: flex-start;
width: 700rpx;
height: 300rpx;
width: 100%;
margin-top: 150rpx;
padding: 20rpx 30rpx;
background-color: #fff;
.item{
@ -107,42 +145,170 @@
top: 50%;
transform: translateY(-285rpx);
}
.shpoone{
.pl {
.top {
position: fixed;
top: 0;
width: 100%;
height: 88rpx;
padding: 0 20rpx;
line-height: 88rpx;
background-color: #ECECEC;
& > text {
margin-right: 280rpx;
color: #333;
font-size: 30rpx;
font-weight: 500;
}
}
.scroll-box {
margin: 88rpx 0 100rpx 0;
height: 100%;
}
.editing {
position: fixed;
bottom: 0;
display: flex;
align-items: center;
justify-content: space-between;
width: 100%;
height: 90rpx;
padding: 0 30rpx;
background-color: #ECECEC;
& > input {
width: 80%;
height: 60rpx;
padding: 0 20rpx;
border-radius: 30rpx;
background-color: #fff;
}
}
}
.cart {
.top{
z-index: 1000;
position: fixed;
top: 0;
display: flex;
align-items: center;
justify-content: space-between;
width: 100%;
height: 88rpx;
padding: 0 30rpx;
border-bottom: 1rpx solid #ececec;
background-color: #fff;
>text{
font-size: 30rpx;
color: #333;
}
}
.scroll-box {
margin-top: 88rpx;
.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;
}
}
}
}
}
.good-one{
z-index: 999;
position: absolute;
right: 139rpx;
top: 54%;
transform: translateY(100rpx);
.box {
display: flex;
align-items: center;
width: 440rpx;
height: 200rpx;
padding: 20rpx;
font-size: 28rpx;
color: #fff;
border-radius: 10rpx;
background-color: rgba(0,0,0,0.5);
& > image {
flex-shrink: 0;
width: 160rpx;
height: 100%;
margin-right: 10rpx;
border-radius: 10rpx;
}
& > view {
width: 200rpx;
}
.title {}
.content {
height: 60rpx;
margin: 10rpx 0;
font-size: 24rpx;
}
.price {
color: #FF3131;
}
}
}
}
</style>
<script>
import userinfo from "../components/userinfo/index" //
import shpoone from "../components/shpoone/index" //
import shoplist from "../components/shoplist/index" //
import contentBox from "../components/shpoone/index" //
// import shoplist from "../components/shoplist/index" //
export default {
name:"photo",
onLoad(option) {
console.log(option);
},
components:{
userinfo,
shpoone,
shoplist
userinfo
},
data(){
return {
list:{},
swiper_id: "",
cart_type: false,
is_comment: false,
cartList: [],
cart_len: 0,
}
},
onLoad(o){
this.id = o.id;
this.articleInfo(this.id);
},
methods:{
//
articleInfo(article_id){
this.$u.api.articleInfo({article_id}).then((res)=>{
this.list = res.data.info;
this.cart_len = res.data.info.goods.length;
})
},
// swiper
@ -153,15 +319,33 @@ export default {
//
openCart(data) {
console.log(data);
this.cart_type = data;
this.cart_type = data.cart;
this.is_comment = data.comment;
},
hideCart(data) {
// console.log(data);
this.cart_type = data;
this.cart_type = data.cart;
},
close() {
this.is_comment = false;
},
//
viewImage(e) {
console.log(e);
let arr = [];
this.list.photo.forEach(item => {
arr.push(item.url);
})
uni.previewImage({
urls: arr,
current: e.currentTarget.dataset.url,
})
},
//
gotoInfo(id) {
console.log(id);
uni.navigateTo({
url: "/pageB/sdetails/index?id=" + id + "&type=" + 1,
})
},
goBack() {
uni.navigateBack({
@ -169,9 +353,5 @@ export default {
})
}
},
onLoad(o){
this.id = o.id
this.articleInfo(this.id)
}
}
</script>

View File

@ -2,6 +2,7 @@
<view>
<view class="status_bar"></view>
<view class="index">
<navigator url="/pageB/photo/index?id=28">qqq</navigator>
<view class="top">
<view class="sosuo"></view>
<view class="tabs">