Merge pull request 'api' (#37) from zhy into master

Reviewed-on: http://git.luyuan.tk/luyuan/deming/pulls/37
This commit is contained in:
hansu 2020-06-30 18:07:52 +08:00
commit 7b60b756d0
21 changed files with 471 additions and 1315 deletions

View File

@ -11,10 +11,37 @@ export default {
is_video_img: is_video_img,
});
},
// 发现(取消)点赞
articleLike({ article_id }) {
return vm.$u.post('article/articleLike', {
article_id: article_id,
});
},
// 发现(取消)收藏
articleCollect({ article_id }) {
return vm.$u.post('article/articleCollect', {
article_id: article_id,
});
},
// 屏蔽用户
articleAddShield({ article_id, member_id }) {
return vm.$u.post('article/articleAddShield', {
article_id: article_id,
member_id: member_id,
});
},
// 推荐达人
getRecommendList(){
return vm.$u.post('MemberExpert/recommendList');
},
// 获取商城首页信息(顶部轮播图与商品分类)
getShopTopList(){
return vm.$u.post('Shop/getShopTopList');
},
// 商品分类列表(树结构)
getGoodsClassifyList() {
return vm.$u.post('Goods/getGoodsClassifyList');
},
// 商品推荐
getGoodsRecommend({page}){
return vm.$u.post('Goods/getGoodsRecommend', {
@ -42,12 +69,25 @@ export default {
cart_ids: id
});
},
// 购物车更新商品数量
cartUpdateNumber({ cart_id, quantity }) {
return vm.$u.post('cart/cartUpdate', {
cart_id: cart_id,
quantity: quantity
});
},
// 订单结算数据
settlementOrder({ cart_id }) {
return vm.$u.post('buy/buy_step1', {
cart_id: cart_id,
});
},
// 商品详情
getGoodsDetails({ id }) {
return vm.$u.post('Goods/goodDetails', {
goods_id: id
});
}
},
}
}

View File

@ -183,18 +183,26 @@ export default {
return vm.$u.post('Member/MemberInfo');
},
// 设置-修改用户信息
updateMemberInfo({ nickname, gender, avatar }) {
updateMemberInfo({ nickname, gender, avatar, birthday }) {
return vm.$u.post('Member/changeMemberInfo', {
nickname: nickname,
sex: gender,
avatar: avatar,
birthday: birthday,
});
},
// 用户浏览记录
getBrowseList() {
return vm.$u.post('Member/BrowseList');
},
// 订单列表
getOrderList({ page }) {
return vm.$u.post('Goods/orderList', { page });
},
// 订单详情
getOrderInfo({ order_id }) {
return vm.$u.post('Goods/orderInfo', { order_id });
},
}
}
}

View File

@ -1,14 +1,17 @@
<template>
<view class="daren-item">
<image class="head"></image>
<text class="name">这是名字</text>
<text class="zhuangtai">直播状态</text>
<image class="head" :src="info.member_avatar"></image>
<text class="name">{{ info.member_nickname }}</text>
<text class="zhuangtai">状态: {{ info.live_status == 1 ? '正在直播' : '未开播' }}</text>
<view class="guanzhu">关注</view>
</view>
</template>
<script>
export default {
name:"daren-item"
name:"daren-item",
props: {
info: Object,
}
}
</script>
<style lang="scss" scoped>

View File

@ -2,7 +2,7 @@
<view class="video-item" v-if="item">
<image class="head" :src="item.article_pic"></image>
<view class="title" v-if="!isguanzhu">{{ item.article_title }}</view>
<view class="jianjie">这是简介这是简介这是简介</view>
<view class="jianjie">{{ item.article_content }}</view>
<view class="user">
<view class="info">
<image :src="item.member_avatar"></image>
@ -11,17 +11,17 @@
<image src="/static/image/common/4.png" @click="showAction"></image>
<view class="action" v-if="show == item.article_id">
<view class="bubble">
<view>
<view @click="articleLike">
<image src="/static/image/common/5.png" v-if="item.is_like == 0"></image>
<image src="/static/image/common/8.png" v-else></image>
<text>点赞</text>
</view>
<view>
<view @click="articleCollect">
<image src="/static/image/common/6.png" v-if="item.is_collect == 0"></image>
<image src="/static/image/common/9.png" v-else></image>
<text>收藏</text>
</view>
<view>
<view @click="articleAddShield">
<image src="/static/image/common/7.png"></image>
<text>屏蔽用户</text>
</view>
@ -70,7 +70,6 @@
display:-webkit-box;
-webkit-box-orient:vertical;
-webkit-line-clamp:2;
}
.user{
display: flex;
@ -182,7 +181,35 @@ export default {
methods: {
showAction() {
this.show = this.show > 0 ? -1 : this.item.article_id;
},
articleLike() {
this.$u.api.articleLike({
article_id: this.item.article_id,
}).then(res => {
if(res.errCode == 0) {
this.$emit("getArticlelist");
}
})
},
articleCollect() {
this.$u.api.articleCollect({
article_id: this.item.article_id,
}).then(res => {
if(res.errCode == 0) {
this.$emit("getArticlelist");
}
})
},
articleAddShield() {
this.$u.api.articleAddShield({
article_id: this.item.article_id,
member_id: this.item.member_id,
}).then(res => {
if(res.errCode == 0) {
this.$emit("getArticlelist");
}
})
},
},
}
</script>

View File

@ -121,7 +121,12 @@ export default {
this.$refs.uToast.show({
title: res.message,
type: 'success',
// url: '/pageE/more/Address',
callback() {
uni.redirectTo({
url: '/pageE/more/Address'
});
}
})
} else {
this.showToast(res.message, 'warning');
@ -146,7 +151,12 @@ export default {
this.$refs.uToast.show({
title: res.message,
type: 'success',
// url: '/pageE/more/Address',
callback() {
uni.redirectTo({
url: '/pageE/more/Address'
});
}
})
} else {
this.showToast(res.message, 'warning');

View File

@ -54,6 +54,7 @@ export default {
methods: {
editAddress() {
this.$u.route({
type: 'redirect',
url: '/pageE/more/EditAddress',
params: {
item: JSON.stringify(this.item)
@ -69,7 +70,7 @@ export default {
this.showToast(res.message, 'success');
this.$emit('getAddressList');
} else {
this.showToast(res.message, 'warning');
this.showToast(res.message, 'error');
}
})
},

View File

@ -1,12 +1,15 @@
<template>
<view class="shop-item">
<image></image>
<text>1</text>
<image :src="info.goodscn_pic"></image>
<text class="u-line-1">{{ info.gc_name }}</text>
</view>
</template>
<script>
export default {
name:"shopItem",
props: {
info: Object,
}
}
</script>
<style lang="scss" scoped>
@ -18,9 +21,9 @@ export default {
width: 80rpx;
height: 80rpx;
border-radius: 50%;
}
>text{
width: 80rpx;
font-size: 24rpx;
color: #333;
margin-top: 14rpx;

View File

@ -115,6 +115,11 @@
},
//
loginOn() {
//
uni.switchTab({
url: '/pages/index/index'
})
return false;
console.log("登录")
// console.log(this.member_mobile)
// console.log(this.sms_code)
@ -180,7 +185,6 @@
type: 'error'
})
}
})
},
// qq

View File

@ -12,9 +12,9 @@
</view>
<view class="hr"></view>
<!-- <navs :value="领券"></navs> -->
<navs :value="产品规格"></navs>
<navs :value="产品颜色"></navs>
<navs :value="选择尺码"></navs>
<navs :value="'产品规格'"></navs>
<navs :value="'产品颜色'"></navs>
<navs :value="'选择尺码'"></navs>
<view class="xiangqing">
<view class="heng"></view>
<view class="title">商品详情</view>
@ -46,7 +46,7 @@ export default {
},
methods: {
getGoodsDetails(id) {
this.$u.api.getGoodsDetails({ id: 169 }).then((res)=>{
this.$u.api.getGoodsDetails({ id: id }).then((res)=>{
if (res.errCode == 0) {
this.goodsInfo = res.data;
this.goodsInfo.goods_image_mobile.forEach(item => {

View File

@ -12,20 +12,21 @@
<image src="../static/image/1.png" class="right"></image>
</view>
<view class="main">
<view v-for="(item, index) in orderInfo.store_cart_list" :key="index">
<view class="goods-info">
<view class="store">
<image class="avatar"></image>
<view>胖胖的店</view>
<image class="avatar" :src="item[0].store_avatar"></image>
<view>{{ item[0].store_name }}</view>
<image src="../static/image/1.png" class="right"></image>
</view>
<view class="goods">
<view v-for="(goods, g_index) in 1" :key="g_index" class="goods-item">
<image></image>
<view v-for="(goods, g_index) in item" :key="g_index" class="goods-item">
<image :src="goods.goods_image_url"></image>
<view class="info">
<view class="name u-line-2">木糖少女小紫薯西装领连衣裙夏季新款女装夏收腰格子格纹裙子</view>
<view class="name u-line-2">{{ goods.goods_name }}</view>
<view class="cart-info">
<view class="price">99</view>
<u-number-box :input-width="38" :input-height="39" :size="22" bg-color="#FFFFFF" color="#FF780F" :index="g_index"></u-number-box>
<view class="price">{{ goods.goods_price }}</view>
<u-number-box :input-width="38" :input-height="39" :size="22" bg-color="#FFFFFF" color="#FF780F" :index="g_index" v-model="goods.goods_num"></u-number-box>
</view>
</view>
</view>
@ -55,10 +56,11 @@
</view>
</view>
</view>
</view>
<view class="bottom">
<view class="left">
<view class="title">合计</view>
<view class="price">9.80</view>
<view class="price">{{ orderInfo.store_goods_total | showTotalPrice }}</view>
</view>
<view class="right">
<view class="num">共1件商品</view>
@ -70,9 +72,57 @@
<script>
export default {
data() {
return {}
return {
orderInfo: {},
totalPrice: '0.00',
}
},
filters: {
showTotalPrice(object) {
let price = 0;
for (const key in object) {
if (object.hasOwnProperty(key)) {
const element = object[key];
price += Number(element);
}
}
return price.toFixed(2);
}
},
onLoad(option) {
console.log(JSON.parse(option.info));
this.orderInfo = JSON.parse(option.info);
// this.orderListInit();
this.showTotalPrice();
},
methods: {
// orderListInit() {
// this.orderList = this.orderInfo.store_list;
// for (const key in this.orderList) {
// if (this.orderList.hasOwnProperty(key)) {
// const element = this.orderList[key];
// let tempArray = Object.entries(this.orderInfo.store_cart_list);
// tempArray.forEach(item => {
// if (item[0])
// })
// let temp = this.orderInfo.store_cart_list.filters(store => {
// return store.store_id == item.store_id
// })
// element
// }
// }
// this.orderList.forEach(item => {
// let temp = this.orderInfo.store_cart_list.filters(store => {
// return store.store_id == item.store_id
// })
// Object.assign(item, { goods_list: temp });
// })
// console.log(this.orderList);
// },
showTotalPrice() {
},
settlement() {
uni.navigateTo({
url: '/pageE/order/Details'
@ -127,6 +177,7 @@ export default {
}
}
.main {
> view {
.goods-info {
background-color: #ffffff;
padding: 30rpx;
@ -232,6 +283,7 @@ export default {
}
}
}
}
.bottom {
padding: 35rpx 30rpx;
position: fixed;

View File

@ -18,7 +18,7 @@
<view class="name u-line-2">{{ goods.goods_name }}</view>
<view class="cart-info">
<view class="price">{{ goods.goods_price }}</view>
<u-number-box :input-width="38" :input-height="39" :size="22" bg-color="#FFFFFF" color="#FF780F" :index="g_index" @minus="reduce($event, s_index)" @plus="plus($event, s_index)" v-model="goods.goods_num"></u-number-box>
<u-number-box :input-width="38" :input-height="39" :size="22" bg-color="#FFFFFF" :disabled-input=true color="#FF780F" :index="goods.cart_id" @minus="reduce" @plus="plus" v-model="goods.goods_num"></u-number-box>
</view>
</view>
</view>
@ -36,7 +36,7 @@
<view class="title">合计</view>
<view class="value">{{ totalPrice }}</view>
</view>
<view class="cart-btn" v-if="status == '编辑'" @click="settlement">结算</view>
<view class="cart-btn" v-if="status == '编辑'" @click="settlementOrder">结算</view>
<view class="delete-btn" v-if="status == '完成'" @click="deleteGoods">删除</view>
<u-toast ref="uToast" />
</view>
@ -63,8 +63,9 @@ export default {
})
checkedGoods = checkedGoods.concat(temp);
})
console.log(checkedGoods);
// console.log(checkedGoods);
this.checkedGoods = checkedGoods;
this.calculatePrice();
},
deep: true
}
@ -73,14 +74,45 @@ export default {
this.getCartList();
},
methods: {
//
calculatePrice() {
// console.log(this.checkedGoods);
let temp = 0;
this.checkedGoods.forEach(item => {
temp += item.goods_num * (item.goods_price * 100) / 100;
})
this.totalPrice = temp.toFixed(2);
},
//
settlementOrder() {
let id = [], temp = '';
this.checkedGoods.forEach(item => {
temp = item.cart_id + '|' + item.goods_num;
id.push(temp);
temp = '';
})
// console.log(id);
this.$u.api.settlementOrder({ cart_id: id }).then(res => {
if(res.errCode == 0) {
this.$u.route({
url: '/pageC/cart/ConfirmOrder',
params: {
info: JSON.stringify(res.data),
}
})
}
})
},
getCartList() {
this.$u.api.getCartTreeList().then((res)=>{
this.$u.api.getCartTreeList().then(res => {
if (res.errCode == 0) {
let list = res.data.store_cart_list;
list.forEach(item => {
Object.assign(item, { checked: false });
item.goods.forEach(goods => {
Object.assign(goods, { checked: false });
list.forEach((item, l_index) => {
// checked ,, false
Object.assign(item, { checked: this.list.length ? this.list[l_index].checked : false });
item.goods.forEach((goods, g_index) => {
Object.assign(goods, { checked: this.list.length ? this.list[l_index].goods[g_index].checked : false });
})
})
// console.log(list);
@ -95,7 +127,6 @@ export default {
id.push(item.cart_id);
})
// console.log(id);
this.$u.api.deleteCart({ id }).then(res => {
if (res.errCode == 0) {
if(!res.data.msg) {
@ -109,16 +140,23 @@ export default {
}
})
},
reduce(value, store) {
console.log(value, store)
reduce(e) {
this.cartUpdateNumber(e.index, e.value);
},
plus(value, store) {
console.log(value, store)
plus(e) {
this.cartUpdateNumber(e.index, e.value);
},
settlement() {
uni.navigateTo({
url: './ConfirmOrder'
});
async cartUpdateNumber(id, number) {
try {
await this.$u.api.cartUpdateNumber({
cart_id: id,
quantity: number,
}).then(res => {
this.getCartList();
})
} catch (error) {
this.getCartList();
}
},
totalChange(e) {
//
@ -171,7 +209,6 @@ export default {
// #ifdef APP-PLUS
let currentWebview = page.$getAppWebview();
let titleObj = currentWebview.getStyle().titleNView;
console.log(1);
console.log(JSON.stringify(titleObj.buttons[0]));
if (!titleObj.buttons) {
return;

View File

@ -5,19 +5,19 @@
:scroll-into-view="itemId">
<view v-for="(item,index) in tabbar" :key="index" class="u-tab-item" :class="[current == index ? 'u-tab-item-active' : '']"
@tap.stop="swichMenu(index)">
<text class="u-line-1">{{item.name}}</text>
<text class="u-line-1">{{item.gc_name}}</text>
</view>
</scroll-view>
<scroll-view :scroll-top="scrollRightTop" scroll-y scroll-with-animation class="right-box" @scroll="rightScroll">
<view class="page-view">
<view class="class-item" :id="'item' + index" v-for="(item , index) in tabbar" :key="index">
<view class="class-item" :id="'item' + index" v-for="(item, index) in tabbar" :key="index">
<view class="item-title">
<text>{{item.name}}</text>
<text>{{item.gc_name}}</text>
</view>
<view class="item-container">
<view class="thumb-box" v-for="(item1, index1) in item.foods" :key="index1">
<image class="item-menu-image" :src="item1.icon" mode=""></image>
<view class="item-menu-name">{{item1.name}}</view>
<view class="thumb-box" v-for="(item1, index1) in item._child" :key="index1">
<image class="item-menu-image" :src="item1.img" mode=""></image>
<view class="item-menu-name">{{item1.gc_name}}</view>
</view>
</view>
</view>
@ -27,7 +27,6 @@
</view>
</template>
<script>
import classifyData from '@/static/js/classify.data.js';
export default {
data() {
return {
@ -37,21 +36,28 @@
menuHeight: 0, //
menuItemHeight: 0, // item
itemId: '', // scroll-viewid
tabbar: classifyData,
tabbar: [],
menuItemPos: [],
arr: [],
scrollRightTop: 0, // scroll-view
timer: null, //
}
},
onLoad() {
onShow() {
this.getClassifyList();
},
onReady() {
this.getMenuItemTop()
},
methods: {
//
getClassifyList() {
this.$u.api.getGoodsClassifyList().then(res => {
if(res.errCode == 0) {
this.tabbar = res.data;
}
})
},
//
async swichMenu(index) {
if(this.arr.length == 0) {
@ -137,7 +143,7 @@
if(this.arr.length == 0) {
await this.getMenuItemTop();
}
if(this.timer) return ;
if(this.timer) return;
if(!this.menuHeight) {
await this.getElRect('menu-scroll-view', 'menuHeight');
}
@ -205,6 +211,7 @@
justify-content: center;
font-size: 28rpx;
color: #666666;
padding: 0 30rpx;
}
.u-tab-item-active {
position: relative;
@ -223,7 +230,7 @@
height: 100%;
}
.right-box {
background-color: rgb(250, 250, 250);
background-color: #fff;
}
.page-view {
padding: 16rpx;
@ -261,5 +268,6 @@
.item-menu-image {
width: 150rpx;
height: 150rpx;
margin-bottom: 15rpx;
}
</style>

View File

@ -12,7 +12,7 @@
</view>
<view class="info-item">
<view class="title">性别</view>
<view class="value" @click="selectGender=true">{{ gender }}</view>
<view class="value" @click="selectGender=true">{{ gender == '1' ? '' : '' }}</view>
</view>
<u-select v-model="selectGender" mode="single-column" :list="list" @confirm="setGender"></u-select>
<view class="info-item">
@ -55,9 +55,10 @@ export default {
second: false
},
nickname: '胖胖',
gender: '',
gender: '', // 1 2
birthday: '',
phoneNumber: '',
avatar: '',
}
},
onLoad() {
@ -78,20 +79,21 @@ export default {
}
})
},
updateMemberInfo({ avatar = '' }) {
updateMemberInfo() {
this.$u.api.updateMemberInfo({
nickname: this.nickname,
sex: this.gender,
avatar: avatar,
gender: this.gender,
avatar: this.avatar,
birthday: this.birthday,
}).then(res => {
if (res.errCode == 0) {
this.getUserInfo();
}
})
},
setGender(value) {
console.log(value);
this.gender = value[0].label;
// console.log(value);
this.gender = value[0].value;
},
setBirthday(value) {
// console.log(value);

View File

@ -22,7 +22,7 @@ export default {
components: {
AddressItem
},
onLoad() {
onShow() {
this.getAddressList();
},
methods: {

View File

@ -78,7 +78,8 @@
export default {
data() {
return {
current: 0
current: 0,
orderInfo: {}
}
},
onLoad(option) {
@ -87,6 +88,15 @@ export default {
this.setTitle();
},
methods: {
getOrderInfo(id) {
this.$u.api.getOrderInfo({
order_id: id,
}).then(res => {
if(res.errCode == 0) {
this.orderInfo = res.data;
}
})
},
setTitle(){
let title = ''
switch (this.current) {

View File

@ -112,8 +112,18 @@ export default {
this.current = Number(option.current);
this.swiperCurrent = this.current;
}
this.getOrderList();
},
methods: {
getOrderList() {
this.$u.api.getOrderList({
page: this.page,
}).then(res => {
if(res.errCode == 0) {
}
})
},
reachBottom() {
// console.log(this.page);
if(this.page >= 3) return;

View File

@ -155,12 +155,6 @@
"text":"搜索",
"float":"right",
"fontSize":"16"
},
{
"type":"none",
"text":"\ue582",
"float":"left",
"fontSize":"16"
}
],
"searchInput": {
@ -316,9 +310,6 @@
}
}
}
]
},
{

View File

@ -23,10 +23,10 @@
<indexad style="width:690rpx"></indexad>
<view class="list">
<view >
<videoItem v-for="item in articleList.filter((_, index) => !(index&1))" :key="item.article_id" :item="item"></videoItem>
<videoItem v-for="item in articleList.filter((_, index) => !(index&1))" :key="item.article_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>
<videoItem v-for="item in articleList.filter((_, index) => index&1)" :key="item.article_id" :item="item" @getArticlelist="getArticlelist"></videoItem>
</view>
</view>
</view>
@ -60,18 +60,19 @@
<image class="right"></image>
</view>
<view class="tuijianlist">
<darenItem style="margin-right:23rpx"></darenItem>
<darenItem style="margin-right:23rpx"></darenItem>
<darenItem></darenItem>
<!-- <darenItem style="margin-right:23rpx"></darenItem>
<darenItem style="margin-right:23rpx"></darenItem> -->
<darenItem v-for="item in recommendList" :key="item.id" :info="item"></darenItem>
</view>
</view>
<view class="list">
<view >
<videoItem isguanzhu="true" v-for="item in 10"></videoItem>
<!-- <videoItem isguanzhu="true" v-for="item in 10"></videoItem> -->
<videoItem isguanzhu="true" v-for="item in articleList.filter((_, index) => !(index&1))" :key="item.article_id" :item="item" @getArticlelist="getArticlelist"></videoItem>
</view>
<view style="margin-left:20rpx">
<videoItem isguanzhu="true" v-for="item in 10"></videoItem>
<!-- <videoItem isguanzhu="true" v-for="item in 10"></videoItem> -->
<videoItem isguanzhu="true" v-for="item in articleList.filter((_, index) => index&1)" :key="item.article_id" :item="item" @getArticlelist="getArticlelist"></videoItem>
</view>
</view>
</view>
@ -154,6 +155,9 @@
height: 282rpx;
margin-top: 30rpx;
display: flex;
> view:not(:last-child) {
margin-right: 23rpx;
}
}
}
}
@ -180,6 +184,7 @@ export default {
num:0,
page: 0, // 0
articleList: [],
recommendList: [], //
}
},
components:{
@ -188,12 +193,13 @@ export default {
indexad,
darenItem
},
onLoad(){
onShow(){
this.getArticlelist();
this.getRecommendList();
},
methods:{
dianji(a){
console.log(a)
// console.log(a)
if(typeof a == "object"){
this.num = a.detail.current
}else{
@ -209,7 +215,14 @@ export default {
this.articleList = res.data.list;
}
})
},
getRecommendList() {
this.$u.api.getRecommendList().then(res => {
if(res.errCode == 0) {
this.recommendList = res.data.list;
}
})
},
},
}
</script>

View File

@ -113,6 +113,10 @@
<img src="/static/image/mine/15.png" />
<view>投诉意见</view>
</view>
<view @click="clickaa()">
<img src="/static/image/mine/15.png" />
<view>投诉意见11</view>
</view>
</view>
</view>
</view>
@ -120,6 +124,7 @@
</template>
<script>
var testModule = uni.requireNativePlugin("TestModule")
export default {
data() {
return {
@ -138,6 +143,9 @@ export default {
this.toOtherPage("/setting/Index");
},
methods: {
clickaa() {
testModule.gotoNativePage();
},
getUserInfo() {
this.$u.api.getMemberInfo().then(res => {
if (res.errCode == 0) {

View File

@ -7,9 +7,9 @@
<image src="/static/image/shop/2.png"></image>
</view>
<u-search placeholder="日照香炉生紫烟" v-model="keyword" :show-action="false" bg-color="#fff" border-color="#999999"></u-search>
<image src="/static/image/shop/3.png" class="mnue"></image>
<image src="/static/image/shop/3.png" class="mnue" @click="toClassifyPage"></image>
</view>
<u-swiper :list="list"></u-swiper>
<u-swiper :list="list" mode="dot" @click="clickImage"></u-swiper>
<view class="chengnuo">
<view>
<image src="/static/image/shop/4.png"></image>
@ -28,11 +28,11 @@
<text>上门取件</text>
</view>
</view>
<view class="fenlei">
<!-- <view class="fenlei">
<shopitem v-for="item in 5" class="item"></shopitem>
</view>
</view> -->
<view class="fenlei">
<shopitem v-for="item in 5" class="item"></shopitem>
<shopitem v-for="item in goodsClassify" :key="item.gc_id" :info="item" class="item"></shopitem>
</view>
<view class="hr" style="margin-top:80rpx"></view>
<recommend></recommend>
@ -72,7 +72,7 @@ export default {
},
data(){
return {
area: "北京市",
area: "请选择",
chooseArea: false,
areaParams: {
province: true,
@ -80,34 +80,33 @@ export default {
area: false
},
keyword:"",
list:[{
image: '/static/uView/swiper/swiper1.jpg',
title: '蒹葭苍苍,白露为霜。所谓伊人,在水一方'
},
{
image: '/static/uView/swiper/swiper2.jpg',
title: '溯洄从之,道阻且长。溯游从之,宛在水中央'
},
{
image: '/static/uView/swiper/swiper3.jpg',
title: '蒹葭萋萋,白露未晞。所谓伊人,在水之湄'
}
],
list:[],
goodsClassify: [], //
classifyList: [],
goodsList: []
}
},
onLoad() {
// this.getShopTopList();
this.getShopTopList();
this.getGoodsRecommend();
},
methods: {
// getShopTopList() {
// this.$u.api.getShopTopList().then((res)=>{
// if (res.errCode == 0) {
// }
// })
// },
getShopTopList() {
this.$u.api.getShopTopList().then((res)=>{
if (res.errCode == 0) {
let temp = [];
res.data.banner.forEach(item => {
temp.push({
image: item.adv_code,
adv_link: item.adv_link,
adv_id: item.adv_id,
})
})
this.list = temp;
this.goodsClassify = res.data.goodsclass;
}
})
},
getGoodsRecommend() {
this.$u.api.getGoodsRecommend({
page: 1,
@ -120,6 +119,11 @@ export default {
}
})
},
clickImage(index) {
console.log(index);
console.log(this.list[index]);
},
setArea(e) {
// console.log(e);
this.area = e.city.label;
@ -128,7 +132,12 @@ export default {
uni.navigateTo({
url: '/pageC/cart/index'
});
}
},
toClassifyPage() {
uni.navigateTo({
url: '/pageC/classify/index'
});
},
},
}
</script>
@ -189,8 +198,15 @@ export default {
}
.fenlei{
display: flex;
justify-content: space-between;
// justify-content: space-between;
margin-top: 30rpx;
flex-wrap: wrap;
> view {
margin-bottom: 30rpx;
&:not(:nth-child(5n)) {
margin-right: 70rpx;
}
}
}
.hr{
width: 750rpx;

File diff suppressed because it is too large Load Diff