gdpao #96

Merged
gyh merged 1 commits from gyh into master 2020-08-01 09:24:12 +00:00
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_CONTACTS\"/>",
"<uses-permission android:name=\"android.permission.WRITE_EXTERNAL_STORAGE\"/>", "<uses-permission android:name=\"android.permission.WRITE_EXTERNAL_STORAGE\"/>",
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>" "<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
] ],
"abiFilters" : [ "armeabi-v7a", "x86" ]
}, },
/* ios */ /* ios */
"ios" : {}, "ios" : {},
@ -86,7 +87,9 @@
"UniversalLinks" : "https://demo.dcloud.net.cn/ulink/" "UniversalLinks" : "https://demo.dcloud.net.cn/ulink/"
} }
}, },
"speech" : {}, "speech" : {
"ifly" : {}
},
"payment" : { "payment" : {
"alipay" : {}, "alipay" : {},
"weixin" : { "weixin" : {

View File

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

View File

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

View File

@ -1,48 +1,89 @@
<template> <template>
<view class="shopone"> <view>
<image></image> <u-popup v-model="is_comment" mode="bottom" border-radius="10" height="700rpx">
<view> <view class="top">
<text>sadas</text> <text>评论</text>
<text>dasadas</text> <u-icon name="arrow-down" color="#333" size="28" @click="close"></u-icon>
<text>dsadas</text> </view>
</view> <scroll-view class="scroll-box" scroll-y="true" >
</view> <view></view>
</scroll-view>
<view class="editing">
<input type="text" value="" />
<text>发送</text>
</view>
</u-popup>
</view>
</template> </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> <script>
export default { 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"> <view class="userhead">
<image :src="item.member_avatar"></image> <image :src="item.member_avatar"></image>
<text class="follow" v-if="!is_follow" @click="following(item.member_id)">+</text> <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>
<!-- 点赞 --> <!-- 点赞 -->
<view class="operat zan"> <view class="operat zan">
@ -17,7 +17,7 @@
</view> </view>
<!-- 评论 --> <!-- 评论 -->
<view class="operat pinglun"> <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> <text>{{item.comment_num}}</text>
</view> </view>
<!-- 购物车 --> <!-- 购物车 -->
@ -74,25 +74,33 @@
<script> <script>
export default { export default {
name:'userinfo', name:'userinfo',
props:['list','cart'], props:['list','cart','comment'],
data(){ data(){
return { return {
is_follow: this.list.is_attention || false, is_follow: this.list.is_attention || false,
is_like: this.list.is_like || false, is_like: this.list.is_like || false,
is_collect: this.list.is_collect || false, is_collect: this.list.is_collect || false,
is_content: false, is_content: false,
is_cart: this.cart || false, is_cart: false,
item: this.list || [] item: this.list || {}
} }
}, },
watch: { watch: {
list(newValue,old) { 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) { cart(newValue,old) {
// console.log(newValue,old); // console.log(newValue,old);
this.is_cart = newValue; this.is_cart = newValue;
}, },
comment(newValue,old) {
console.log(newValue,old);
this.is_content = newValue;
},
deep: true deep: true
}, },
methods: { 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() { carting() {
this.is_cart = !this.is_cart; this.is_cart = !this.is_cart;
// console.log(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> <template>
<view class="photo"> <view class="photo">
<view class="status_bar"></view>
<view class="back"> <view class="back">
<u-icon name="close" color="#999999" :size="30" @click="goBack"></u-icon> <u-icon name="close" color="#999999" :size="30" @click="goBack"></u-icon>
</view> </view>
<swiper class="swiper" circular autoplay @change="changeSwiper"> <swiper class="swiper" circular autoplay @change="changeSwiper">
<swiper-item v-for="(simg,sindex) in list.photo" :key="sindex"> <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-item>
</swiper> </swiper>
<scroll-view scroll-y="true" class="bottom"> <view class="bottom">
<view class="item"> <view class="item">
<text>图片</text> <text>图片</text>
<view v-for="(item,index) in list.photo" :key="index" :style="{'background-color':index == swiper_id ? '#fff' : '#ede8e8'}"></view> <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="box">
<view class="label" v-for="(label,id) in list.label" :key="id">{{ label.name }}</view> <view class="label" v-for="(label,id) in list.label" :key="id">{{ label.name }}</view>
</view> </view>
</scroll-view> </view>
<userinfo class="userinfo" :list="list" :cart="cart_type" @openCart="openCart"></userinfo> <!-- 用户操作 -->
<shpoone class="shpoone" v-show="list.goods.length == 1 && cart_type"></shpoone> <userinfo class="userinfo" :list="list" :cart="cart_type" :comment="is_comment" @openCart="openCart"></userinfo>
<shoplist :list="list.goods" v-show="list.goods.length > 1 && cart_type" @hideCart="hideCart"></shoplist> <!-- 评论 -->
<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> </view>
</template> </template>
<style lang="scss" scoped> <style lang="scss" scoped>
.photo{ .photo{
height: 100vh;
background-color: #ececec;
width: 100%; width: 100%;
height: 100%;
background-color: #ececec;
.back{ .back{
padding-top: 28rpx; padding-top: 28rpx;
padding-right: 31rpx; padding-right: 31rpx;
text-align: right; text-align: right;
} }
.swiper{ .swiper{
width: 100%; width: 750rpx;
height: 702rpx; height: 702rpx;
margin-top: 102rpx; margin-top: 102rpx;
image{ image{
@ -45,13 +88,8 @@
} }
} }
.bottom{ .bottom{
position: fixed; width: 100%;
bottom: 0; margin-top: 150rpx;
display: flex;
flex-direction: column;
align-items: flex-start;
width: 700rpx;
height: 300rpx;
padding: 20rpx 30rpx; padding: 20rpx 30rpx;
background-color: #fff; background-color: #fff;
.item{ .item{
@ -107,42 +145,170 @@
top: 50%; top: 50%;
transform: translateY(-285rpx); 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; z-index: 999;
position: absolute; position: absolute;
right: 139rpx; right: 139rpx;
top: 54%; top: 54%;
transform: translateY(100rpx); 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> </style>
<script> <script>
import userinfo from "../components/userinfo/index" // import userinfo from "../components/userinfo/index" //
import shpoone from "../components/shpoone/index" // import contentBox from "../components/shpoone/index" //
import shoplist from "../components/shoplist/index" // // import shoplist from "../components/shoplist/index" //
export default { export default {
name:"photo", name:"photo",
onLoad(option) {
console.log(option);
},
components:{ components:{
userinfo, userinfo
shpoone,
shoplist
}, },
data(){ data(){
return { return {
list:{}, list:{},
swiper_id: "", swiper_id: "",
cart_type: false, cart_type: false,
is_comment: false,
cartList: [],
cart_len: 0,
} }
}, },
onLoad(o){
this.id = o.id;
this.articleInfo(this.id);
},
methods:{ methods:{
// //
articleInfo(article_id){ articleInfo(article_id){
this.$u.api.articleInfo({article_id}).then((res)=>{ this.$u.api.articleInfo({article_id}).then((res)=>{
this.list = res.data.info; this.list = res.data.info;
this.cart_len = res.data.info.goods.length;
}) })
}, },
// swiper // swiper
@ -153,15 +319,33 @@ export default {
// //
openCart(data) { openCart(data) {
console.log(data); console.log(data);
this.cart_type = data; this.cart_type = data.cart;
this.is_comment = data.comment;
}, },
hideCart(data) { hideCart(data) {
// console.log(data); // console.log(data);
this.cart_type = data; this.cart_type = data.cart;
},
close() {
this.is_comment = false;
}, },
// //
viewImage(e) { 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() { goBack() {
uni.navigateBack({ uni.navigateBack({
@ -169,9 +353,5 @@ export default {
}) })
} }
}, },
onLoad(o){
this.id = o.id
this.articleInfo(this.id)
}
} }
</script> </script>

View File

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