api #37

Merged
hansu merged 1 commits from zhy into master 2020-06-30 10:07:53 +00:00
21 changed files with 471 additions and 1315 deletions

View File

@ -11,10 +11,37 @@ export default {
is_video_img: is_video_img, 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(){ getShopTopList(){
return vm.$u.post('Shop/getShopTopList'); return vm.$u.post('Shop/getShopTopList');
}, },
// 商品分类列表(树结构)
getGoodsClassifyList() {
return vm.$u.post('Goods/getGoodsClassifyList');
},
// 商品推荐 // 商品推荐
getGoodsRecommend({page}){ getGoodsRecommend({page}){
return vm.$u.post('Goods/getGoodsRecommend', { return vm.$u.post('Goods/getGoodsRecommend', {
@ -42,12 +69,25 @@ export default {
cart_ids: id 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 }) { getGoodsDetails({ id }) {
return vm.$u.post('Goods/goodDetails', { return vm.$u.post('Goods/goodDetails', {
goods_id: id goods_id: id
}); });
} },
} }
} }

View File

@ -183,18 +183,26 @@ export default {
return vm.$u.post('Member/MemberInfo'); return vm.$u.post('Member/MemberInfo');
}, },
// 设置-修改用户信息 // 设置-修改用户信息
updateMemberInfo({ nickname, gender, avatar }) { updateMemberInfo({ nickname, gender, avatar, birthday }) {
return vm.$u.post('Member/changeMemberInfo', { return vm.$u.post('Member/changeMemberInfo', {
nickname: nickname, nickname: nickname,
sex: gender, sex: gender,
avatar: avatar, avatar: avatar,
birthday: birthday,
}); });
}, },
// 用户浏览记录 // 用户浏览记录
getBrowseList() { getBrowseList() {
return vm.$u.post('Member/BrowseList'); 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> <template>
<view class="daren-item"> <view class="daren-item">
<image class="head"></image> <image class="head" :src="info.member_avatar"></image>
<text class="name">这是名字</text> <text class="name">{{ info.member_nickname }}</text>
<text class="zhuangtai">直播状态</text> <text class="zhuangtai">状态: {{ info.live_status == 1 ? '正在直播' : '未开播' }}</text>
<view class="guanzhu">关注</view> <view class="guanzhu">关注</view>
</view> </view>
</template> </template>
<script> <script>
export default { export default {
name:"daren-item" name:"daren-item",
props: {
info: Object,
}
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -12,45 +12,47 @@
<image src="../static/image/1.png" class="right"></image> <image src="../static/image/1.png" class="right"></image>
</view> </view>
<view class="main"> <view class="main">
<view class="goods-info"> <view v-for="(item, index) in orderInfo.store_cart_list" :key="index">
<view class="store"> <view class="goods-info">
<image class="avatar"></image> <view class="store">
<view>胖胖的店</view> <image class="avatar" :src="item[0].store_avatar"></image>
<image src="../static/image/1.png" class="right"></image> <view>{{ item[0].store_name }}</view>
</view> <image src="../static/image/1.png" class="right"></image>
<view class="goods"> </view>
<view v-for="(goods, g_index) in 1" :key="g_index" class="goods-item"> <view class="goods">
<image></image> <view v-for="(goods, g_index) in item" :key="g_index" class="goods-item">
<view class="info"> <image :src="goods.goods_image_url"></image>
<view class="name u-line-2">木糖少女小紫薯西装领连衣裙夏季新款女装夏收腰格子格纹裙子</view> <view class="info">
<view class="cart-info"> <view class="name u-line-2">{{ goods.goods_name }}</view>
<view class="price">99</view> <view class="cart-info">
<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>
</view> </view>
</view> </view>
</view> </view>
</view> <view class="order-info">
<view class="order-info"> <view>
<view> <view class="title">优惠券折扣</view>
<view class="title">优惠券折扣</view> <view class="value">
<view class="value"> <view>-10.00</view>
<view>-10.00</view> <image src="../static/image/1.png"></image>
<image src="../static/image/1.png"></image> </view>
</view> </view>
</view> <view>
<view> <view class="title">配送方式</view>
<view class="title">配送方式</view> <view class="value">
<view class="value"> <view>快递</view>
<view>快递</view> <image src="../static/image/1.png"></image>
<image src="../static/image/1.png"></image> </view>
</view> </view>
</view> <view>
<view> <view class="title">支付方式</view>
<view class="title">支付方式</view> <view class="value">
<view class="value"> <view>微信</view>
<view>微信</view> <image src="../static/image/1.png"></image>
<image src="../static/image/1.png"></image> </view>
</view> </view>
</view> </view>
</view> </view>
@ -58,7 +60,7 @@
<view class="bottom"> <view class="bottom">
<view class="left"> <view class="left">
<view class="title">合计</view> <view class="title">合计</view>
<view class="price">9.80</view> <view class="price">{{ orderInfo.store_goods_total | showTotalPrice }}</view>
</view> </view>
<view class="right"> <view class="right">
<view class="num">共1件商品</view> <view class="num">共1件商品</view>
@ -70,9 +72,57 @@
<script> <script>
export default { export default {
data() { 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: { 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() { settlement() {
uni.navigateTo({ uni.navigateTo({
url: '/pageE/order/Details' url: '/pageE/order/Details'
@ -127,75 +177,77 @@ export default {
} }
} }
.main { .main {
.goods-info { > view {
background-color: #ffffff; .goods-info {
padding: 30rpx; background-color: #ffffff;
margin-bottom: 2rpx; padding: 30rpx;
.store { margin-bottom: 2rpx;
display: flex; .store {
align-items: center;
margin-bottom: 20rpx;
.avatar {
width: 60rpx;
height: 60rpx;
border-radius: 50%;
border: 1rpx solid #000;
margin-right: 15rpx;
}
> view {
font-size: 28rpx;
color: rgba(51,51,51,1);
margin-right: 15rpx;
}
.right {
flex-shrink: 0;
width: 11rpx;
height: 22rpx;
}
}
.goods {
.goods-item {
display: flex; display: flex;
align-items: center; align-items: center;
&:not(:last-child) { margin-bottom: 20rpx;
margin-bottom: 20rpx; .avatar {
width: 60rpx;
height: 60rpx;
border-radius: 50%;
border: 1rpx solid #000;
margin-right: 15rpx;
} }
> image { > view {
margin-right: 30rpx; font-size: 28rpx;
width: 180rpx; color: rgba(51,51,51,1);
height: 160rpx; margin-right: 15rpx;
border-radius: 10rpx; }
background-color: aqua; .right {
flex-shrink: 0; flex-shrink: 0;
width: 11rpx;
height: 22rpx;
} }
.info { }
// width: 418rpx; .goods {
height: 160rpx; .goods-item {
display: flex; display: flex;
flex-direction: column; align-items: center;
justify-content: space-between; &:not(:last-child) {
.name { margin-bottom: 20rpx;
font-size: 30rpx;
color: rgba(51,51,51,1);
} }
.cart-info { > image {
margin-right: 30rpx;
width: 180rpx;
height: 160rpx;
border-radius: 10rpx;
background-color: aqua;
flex-shrink: 0;
}
.info {
// width: 418rpx;
height: 160rpx;
display: flex; display: flex;
align-items: center; flex-direction: column;
justify-content: space-between; justify-content: space-between;
.price { .name {
font-size: 30rpx; font-size: 30rpx;
font-weight: 500; color: rgba(51,51,51,1);
color: rgba(255,49,49,1);
} }
.u-numberbox { .cart-info {
border: 1rpx solid rgba(217,215,215,1); display: flex;
border-radius:4px; align-items: center;
/deep/ .u-number-input { justify-content: space-between;
margin: 0; .price {
color: #333 !important; font-size: 30rpx;
border: 1rpx #D9D7D7 solid { font-weight: 500;
top: 0px; color: rgba(255,49,49,1);
bottom: 0px; }
.u-numberbox {
border: 1rpx solid rgba(217,215,215,1);
border-radius:4px;
/deep/ .u-number-input {
margin: 0;
color: #333 !important;
border: 1rpx #D9D7D7 solid {
top: 0px;
bottom: 0px;
}
} }
} }
} }
@ -203,30 +255,30 @@ export default {
} }
} }
} }
} .order-info {
.order-info { > view {
> view { height: 98rpx;
height: 98rpx; background: rgba(255,255,255,1);
background: rgba(255,255,255,1); padding: 35rpx 30rpx;
padding: 35rpx 30rpx;
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 2rpx;
.title {
font-size: 28rpx;
color: rgba(102,102,102,1);
}
.value {
display: flex; display: flex;
align-items: center; align-items: center;
font-size: 30rpx; justify-content: space-between;
color:rgba(51,51,51,1); margin-bottom: 2rpx;
> image { .title {
width: 12rpx; font-size: 28rpx;
height: 22rpx; color: rgba(102,102,102,1);
flex-shrink: 0; }
margin-left: 20rpx; .value {
display: flex;
align-items: center;
font-size: 30rpx;
color:rgba(51,51,51,1);
> image {
width: 12rpx;
height: 22rpx;
flex-shrink: 0;
margin-left: 20rpx;
}
} }
} }
} }

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

File diff suppressed because it is too large Load Diff