Merge pull request 'store 8.5' (#119) from zhy into master
Reviewed-on: http://git.luyuan.tk/luyuan/deming/pulls/119
This commit is contained in:
commit
e1519b8d68
@ -173,10 +173,17 @@ export default {
|
|||||||
goods_id: id
|
goods_id: id
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
getStoreGoodsList({ id, page = 0}){
|
getStoreGoodsList({ id, page, order, gc_id }){
|
||||||
return vm.$u.post('Store/getStoreGoodsList', {
|
return vm.$u.post('Store/getStoreGoodsList', {
|
||||||
id: id,
|
id: id,
|
||||||
page:page
|
page: page,
|
||||||
|
order: order,
|
||||||
|
gc_id: gc_id,
|
||||||
|
});
|
||||||
|
},
|
||||||
|
getStoreClassifyList({ id }) {
|
||||||
|
return vm.$u.post('Store/getStoreClassifyList', {
|
||||||
|
id: id
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
getStoreImgVideoList({id}){
|
getStoreImgVideoList({id}){
|
||||||
@ -306,7 +313,11 @@ export default {
|
|||||||
// 达人上架商品
|
// 达人上架商品
|
||||||
goodsShelves({live_id}){
|
goodsShelves({live_id}){
|
||||||
return vm.$u.post('Specialci/goodsShelves',{live_id})
|
return vm.$u.post('Specialci/goodsShelves',{live_id})
|
||||||
}
|
},
|
||||||
|
//
|
||||||
|
addFavoriteStore({ id }) {
|
||||||
|
return vm.$u.post('member/addFavoriteStore',{ fid: id })
|
||||||
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -175,9 +175,10 @@ export default {
|
|||||||
return vm.$u.post('Member/getFavoritesList', params);
|
return vm.$u.post('Member/getFavoritesList', params);
|
||||||
},
|
},
|
||||||
// 取消收藏(商品/店铺)
|
// 取消收藏(商品/店铺)
|
||||||
removeFavorite({ id }) {
|
removeFavorite({ id, type }) {
|
||||||
return vm.$u.post('Member/removeFavorite', {
|
return vm.$u.post('Member/removeFavorite', {
|
||||||
id: id,
|
fav_id: id,
|
||||||
|
type: type,
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
// 设置-用户信息
|
// 设置-用户信息
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
<view class="label">
|
<view class="label">
|
||||||
<u-tabs-swiper ref="group" :list="classifyList" name="gc_name" :is-scroll="true" active-color="#FF780F" :current="current" font-size="24" :show-bar="false" @change="tabsChange" height="88"></u-tabs-swiper>
|
<u-tabs-swiper ref="group" :list="classifyList" name="gc_name" :is-scroll="true" active-color="#FF780F" :current="current" font-size="24" :show-bar="false" @change="tabsChange" height="88"></u-tabs-swiper>
|
||||||
</view>
|
</view>
|
||||||
<swiper :current="swiperCurrent" @animationfinish="animationfinish" style="height: 130px">
|
<swiper :current="swiperCurrent" @animationfinish="animationfinish" style="height: 260rpx">
|
||||||
<swiper-item class="swiper-item list" v-for="(_, i) in classifyList" :key="i">
|
<swiper-item class="swiper-item list" v-for="(_, i) in classifyList" :key="i">
|
||||||
<!-- 最多显示3个 -->
|
<!-- 最多显示3个 -->
|
||||||
<sitem :info="info" v-for="(info, index) in groupList.slice(0, 3)" :key="index"></sitem>
|
<sitem :info="info" v-for="(info, index) in groupList.slice(0, 3)" :key="index"></sitem>
|
||||||
@ -97,8 +97,8 @@ export default {
|
|||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
padding: 0 30rpx;
|
padding: 0 30rpx;
|
||||||
display: flex;
|
display: flex;
|
||||||
&:not(:nth-child(3n)) {
|
> view {
|
||||||
> view {
|
&:not(:nth-child(3n)) {
|
||||||
margin-right: 20rpx;
|
margin-right: 20rpx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
<view class="list">
|
<view class="list">
|
||||||
<view class="top">商品推荐</view>
|
<view class="top">商品推荐</view>
|
||||||
<view>
|
<view>
|
||||||
<u-tabs-swiper ref="uTabs" :list="classifyList" name="gc_name" :is-scroll="true" active-color="#FF780F" :current="current" font-size="24" :show-bar="false" @change="tabsChange" height="60" ></u-tabs-swiper>
|
<u-tabs-swiper ref="uTabs" :list="classifyList" name="gc_name" :is-scroll="true" active-color="#FF780F" :current="current" font-size="24" :show-bar="false" @change="tabsChange" height="60"></u-tabs-swiper>
|
||||||
</view>
|
</view>
|
||||||
<swiper class="swiper-box" :current="swiperCurrent" @transition="transition" @animationfinish="animationfinish" :style="{height: swiperHeight}">
|
<swiper class="swiper-box" :current="swiperCurrent" @transition="transition" @animationfinish="animationfinish" :style="{height: swiperHeight}">
|
||||||
<swiper-item class="swiper-item" v-for="(_, index) in classifyList" :key="index">
|
<swiper-item class="swiper-item" v-for="(_, index) in classifyList" :key="index">
|
||||||
@ -39,6 +39,7 @@ export default {
|
|||||||
watch: {
|
watch: {
|
||||||
current(index) {
|
current(index) {
|
||||||
this.page = 1;
|
this.page = 1;
|
||||||
|
this.goodsList = [];
|
||||||
const id = this.classifyList[index].gc_id;
|
const id = this.classifyList[index].gc_id;
|
||||||
this.getGoodsRecommend({gc_id: id});
|
this.getGoodsRecommend({gc_id: id});
|
||||||
}
|
}
|
||||||
@ -68,7 +69,7 @@ export default {
|
|||||||
this.page--;
|
this.page--;
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
getGoodsClassRecommend(gc_id) {
|
getGoodsClassRecommend() {
|
||||||
this.$u.api.getGoodsClassRecommend().then(res => {
|
this.$u.api.getGoodsClassRecommend().then(res => {
|
||||||
if (res.errCode == 0) {
|
if (res.errCode == 0) {
|
||||||
// 初始化 current
|
// 初始化 current
|
||||||
@ -82,6 +83,7 @@ export default {
|
|||||||
page: page,
|
page: page,
|
||||||
gc_id: gc_id,
|
gc_id: gc_id,
|
||||||
})
|
})
|
||||||
|
// this.swiperCurrent = this.current;
|
||||||
if (res.errCode == 0) {
|
if (res.errCode == 0) {
|
||||||
this.timer = true;
|
this.timer = true;
|
||||||
if(reload) this.goodsList = res.data.goodsList;
|
if(reload) this.goodsList = res.data.goodsList;
|
||||||
@ -93,13 +95,14 @@ export default {
|
|||||||
},
|
},
|
||||||
setSwiperHeight() {
|
setSwiperHeight() {
|
||||||
// height: 230px, margin-bottom: 13
|
// height: 230px, margin-bottom: 13
|
||||||
// const height = Math.ceil(this.goodsList.length / 2) * (510 + 26);
|
const height = Math.ceil(this.goodsList.length / 2) * (540 + 26);
|
||||||
// this.swiperHeight = height == 0 ? '230rpx' : height + 'rpx';
|
this.swiperHeight = height == 0 ? '230rpx' : height + 'rpx';
|
||||||
this.swiperHeight = Math.ceil(this.goodsList.length / 2) * (270 + 13) + 'px';
|
// this.swiperHeight = Math.ceil(this.goodsList.length / 2) * (270 + 13) + 'px';
|
||||||
},
|
},
|
||||||
// tabs通知swiper切换
|
// tabs通知swiper切换
|
||||||
tabsChange(index) {
|
tabsChange(index) {
|
||||||
this.swiperCurrent = index;
|
this.current = index;
|
||||||
|
// this.getGoodsRecommend({ gc_id: this.classifyList[this.current].gc_id });
|
||||||
},
|
},
|
||||||
// swiper-item左右移动,通知tabs的滑块跟随移动
|
// swiper-item左右移动,通知tabs的滑块跟随移动
|
||||||
transition(e) {
|
transition(e) {
|
||||||
@ -111,8 +114,9 @@ export default {
|
|||||||
animationfinish(e) {
|
animationfinish(e) {
|
||||||
let current = e.detail.current;
|
let current = e.detail.current;
|
||||||
this.$refs.uTabs.setFinishCurrent(current);
|
this.$refs.uTabs.setFinishCurrent(current);
|
||||||
this.swiperCurrent = current;
|
|
||||||
this.current = current;
|
this.current = current;
|
||||||
|
this.swiperCurrent = current;
|
||||||
|
// this.getGoodsRecommend({ gc_id: this.classifyList[this.current].gc_id });
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -135,7 +135,7 @@
|
|||||||
</u-popup>
|
</u-popup>
|
||||||
<!-- 普通商品 tool -->
|
<!-- 普通商品 tool -->
|
||||||
<view class="tloos" v-if="type == 1">
|
<view class="tloos" v-if="type == 1">
|
||||||
<view class="navs">
|
<view class="navs" @click="toOthersPage('pageC/merchant/index?id=' + storeInfo.store_id)">
|
||||||
<image src="/static/image/common/18.png"></image>
|
<image src="/static/image/common/18.png"></image>
|
||||||
店铺
|
店铺
|
||||||
</view>
|
</view>
|
||||||
@ -155,7 +155,7 @@
|
|||||||
<!-- 秒杀 tool -->
|
<!-- 秒杀 tool -->
|
||||||
<view class="spike-tool" v-if="type==3">
|
<view class="spike-tool" v-if="type==3">
|
||||||
<view class="left">
|
<view class="left">
|
||||||
<view>
|
<view @click="toOthersPage('pageC/merchant/index?id=' + storeInfo.store_id)">
|
||||||
<image src="/static/image/common/18.png"></image>
|
<image src="/static/image/common/18.png"></image>
|
||||||
<text>店铺</text>
|
<text>店铺</text>
|
||||||
</view>
|
</view>
|
||||||
@ -183,7 +183,8 @@ export default {
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
list: [], // 轮播图列表
|
list: [], // 轮播图列表
|
||||||
goodsInfo: {}, // 商品信息
|
goodsInfo: {}, // 商品信息
|
||||||
|
storeInfo: {},
|
||||||
glist: [], // 规格列表
|
glist: [], // 规格列表
|
||||||
id: 0, // 商品id/秒杀id/拼团 id
|
id: 0, // 商品id/秒杀id/拼团 id
|
||||||
type: '', // 商品类型 商品详情 1普通 2拼团 3秒杀 4优惠券
|
type: '', // 商品类型 商品详情 1普通 2拼团 3秒杀 4优惠券
|
||||||
@ -311,6 +312,7 @@ export default {
|
|||||||
if (res.errCode == 0) {
|
if (res.errCode == 0) {
|
||||||
this.evaluate = res.data.goods_evaluate_info;
|
this.evaluate = res.data.goods_evaluate_info;
|
||||||
this.goodsInfo = res.data.goods;
|
this.goodsInfo = res.data.goods;
|
||||||
|
this.storeInfo = res.data.store;
|
||||||
this.setSwiperList(res.data.goods_image);
|
this.setSwiperList(res.data.goods_image);
|
||||||
this.glist = res.data.spec_list;
|
this.glist = res.data.spec_list;
|
||||||
// console.log(this.goodsInfo.mobile_body);
|
// console.log(this.goodsInfo.mobile_body);
|
||||||
@ -452,6 +454,9 @@ export default {
|
|||||||
title: title
|
title: title
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
toOthersPage(url) {
|
||||||
|
this.$u.route(url);
|
||||||
|
},
|
||||||
viewComment() {
|
viewComment() {
|
||||||
this.$u.route({
|
this.$u.route({
|
||||||
url: 'pageB/comment/index',
|
url: 'pageB/comment/index',
|
||||||
|
@ -200,11 +200,13 @@ export default {
|
|||||||
if(!this.debounce) return;
|
if(!this.debounce) return;
|
||||||
this.debounce = false;
|
this.debounce = false;
|
||||||
if(this.orderType == 2) {
|
if(this.orderType == 2) {
|
||||||
|
// this.sendOrder(0);
|
||||||
this.withImmediate();
|
this.withImmediate();
|
||||||
} else if(this.orderType == 1) {
|
} else if(this.orderType == 1) {
|
||||||
this.sendOrder(0);
|
this.sendOrder(0);
|
||||||
|
} else {
|
||||||
|
this.sendOrder(1);
|
||||||
}
|
}
|
||||||
else this.sendOrder(1);
|
|
||||||
},
|
},
|
||||||
// @params {Number} ifcart 是否是购物车商品
|
// @params {Number} ifcart 是否是购物车商品
|
||||||
sendOrder(ifcart) {
|
sendOrder(ifcart) {
|
||||||
@ -254,6 +256,7 @@ export default {
|
|||||||
// console.log(params);
|
// console.log(params);
|
||||||
this.$u.api.sendOrder(params).then(res => {
|
this.$u.api.sendOrder(params).then(res => {
|
||||||
if(res.errCode == 0) {
|
if(res.errCode == 0) {
|
||||||
|
// this.withImmediate();
|
||||||
this.$u.route({
|
this.$u.route({
|
||||||
type: 'redirect',
|
type: 'redirect',
|
||||||
url: '/pageC/cart/cashier',
|
url: '/pageC/cart/cashier',
|
||||||
|
215
pageC/merchant/classifyGoods.vue
Normal file
215
pageC/merchant/classifyGoods.vue
Normal file
@ -0,0 +1,215 @@
|
|||||||
|
<template>
|
||||||
|
<view class="classify-goods">
|
||||||
|
<view class="tab-container">
|
||||||
|
<view class="overall" :class="{ 'current' : current == 0 }" @click="switchCurrent(0)">综合</view>
|
||||||
|
<view class="salenum" :class="{ 'current' : current == 1 }" @click="switchCurrent(1)">销量</view>
|
||||||
|
<view class="new" :class="{ 'current' : current == 2 }" @click="switchCurrent(2)">新品</view>
|
||||||
|
<view class="price" :class="{ 'current' : current == 3 }" @click="switchCurrent(3)">
|
||||||
|
<view class="text">价格</view>
|
||||||
|
<view class="icon">
|
||||||
|
<u-icon name="arrow-up-fill" :color="(current == 3 && priceOrderAsc) ? '#FF780F' : '#333333'" size="22"></u-icon>
|
||||||
|
<u-icon name="arrow-down-fill" :color="(current == 3 && !priceOrderAsc) ? '#FF780F' : '#333333'" size="22"></u-icon>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<scroll-view scroll-y class="scroll-container" :style="{ height: scrollHeight }" @scrolltolower="loadMore">
|
||||||
|
<view class="goods-container">
|
||||||
|
<view v-for="goods in goodsList" :key="goods.goods_id" class="goods-view" @click="toDetailsPage(goods.goods_id)">
|
||||||
|
<goodsItem :info="goods"></goodsItem>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<u-loadmore :status="loadStatus" bgColor="#FFFFFF" margin-top="20" margin-bottom="20" v-if="goodsList.length >= pageSize"></u-loadmore>
|
||||||
|
<u-empty mode="list" v-if="!goodsList.length"></u-empty>
|
||||||
|
</scroll-view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
import goodsItem from "@/components/shop/list/item"
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
pageSize: 15,
|
||||||
|
cid: '',
|
||||||
|
page: 1,
|
||||||
|
current: 0,
|
||||||
|
priceOrderAsc: true, // 是否升序
|
||||||
|
goodsList: [],
|
||||||
|
scrollHeight: '',
|
||||||
|
loadStatus: 'loadmore',
|
||||||
|
timer: true, // 防止上拉加载短时间内多次调用
|
||||||
|
}
|
||||||
|
},
|
||||||
|
components: {
|
||||||
|
goodsItem
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
current(value) {
|
||||||
|
this.page = 1;
|
||||||
|
this.goodsList = [];
|
||||||
|
this.getStoreGoodsList({ laod: 'reload' });
|
||||||
|
},
|
||||||
|
priceOrderAsc(value) {
|
||||||
|
this.page = 1;
|
||||||
|
this.getStoreGoodsList({ laod: 'reload' });
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onLoad(option) {
|
||||||
|
if(option.cid == 'all') {
|
||||||
|
this.current = 0;
|
||||||
|
this.cid = 0;
|
||||||
|
} else if(option.cid == 'new') {
|
||||||
|
this.current = 2;
|
||||||
|
this.cid = 0;
|
||||||
|
} else {
|
||||||
|
this.cid = option.cid;
|
||||||
|
}
|
||||||
|
this.setTitle(option.name);
|
||||||
|
this.sid = option.sid;
|
||||||
|
this.setViewHeight();
|
||||||
|
this.getStoreGoodsList({ load: 'reload' });
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
setOrderSort() {
|
||||||
|
let sort = '';
|
||||||
|
if(this.current == 0) {
|
||||||
|
sort = 'goods_sort';
|
||||||
|
} else if(this.current == 1) {
|
||||||
|
sort = 'goods_salenum';
|
||||||
|
} else if(this.current == 2) {
|
||||||
|
sort = 'goods_addtime';
|
||||||
|
} else if(this.current == 3) {
|
||||||
|
if(this.priceOrderAsc) sort = 'goods_price_asc';
|
||||||
|
else sort = 'goods_price_desc';
|
||||||
|
}
|
||||||
|
return sort;
|
||||||
|
},
|
||||||
|
// 排序方式 goods_salenum:销量 evaluation_count:评价 goods_price_asc:价格从低到高 goods_price_desc:价格从高到低
|
||||||
|
async getStoreGoodsList({ load = 'reload' } = {}) {
|
||||||
|
const sort = this.setOrderSort();
|
||||||
|
let params = {
|
||||||
|
id: this.sid,
|
||||||
|
page: this.page,
|
||||||
|
order: sort,
|
||||||
|
};
|
||||||
|
console.log(this.cid);
|
||||||
|
if(this.cid) Object.assign(params, { gc_id: this.cid })
|
||||||
|
const res = await this.$u.api.getStoreGoodsList(params);
|
||||||
|
this.timer = true;
|
||||||
|
if(res.errCode == 0) {
|
||||||
|
this.pageSize = res.data.per_page;
|
||||||
|
if(load == 'reload') this.goodsList = res.data.data;
|
||||||
|
else if(load == 'loadmore') this.goodsList.push(...res.data.data);
|
||||||
|
}
|
||||||
|
return res.data.data.length;
|
||||||
|
},
|
||||||
|
loadMore() {
|
||||||
|
if(this.goodsList.length < this.pageSize) return false;
|
||||||
|
if(!this.timer) return false;
|
||||||
|
this.loadStatus = "loading";
|
||||||
|
this.page++;
|
||||||
|
this.getStoreGoodsList({ load: 'loadmore' }).then(length => {
|
||||||
|
if(length == 0) {
|
||||||
|
this.page--;
|
||||||
|
this.loadStatus = 'nomore';
|
||||||
|
} else {
|
||||||
|
this.loadStatus = 'loading';
|
||||||
|
}
|
||||||
|
}).catch(() => {
|
||||||
|
this.loadStatus = "nomore";
|
||||||
|
this.page--;
|
||||||
|
})
|
||||||
|
},
|
||||||
|
switchCurrent(current) {
|
||||||
|
if(current == 3 && this.current == 3) this.priceOrderAsc = !this.priceOrderAsc;
|
||||||
|
this.current = current;
|
||||||
|
},
|
||||||
|
setViewHeight() {
|
||||||
|
const res = uni.getSystemInfoSync();
|
||||||
|
this.scrollHeight = res.windowHeight - 90 / 2 + 'px';
|
||||||
|
// console.log(this.scrollHeight);
|
||||||
|
},
|
||||||
|
toDetailsPage(id) {
|
||||||
|
this.$u.route('/pageB/sdetails/index', {
|
||||||
|
id: id,
|
||||||
|
type: 1 // 商品详情 商品类型 1普通 2拼团 3秒杀 4优惠券
|
||||||
|
});
|
||||||
|
},
|
||||||
|
setTitle(title){
|
||||||
|
uni.setNavigationBarTitle({
|
||||||
|
title: title
|
||||||
|
});
|
||||||
|
},
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.classify-goods {
|
||||||
|
width: 100%;
|
||||||
|
background-color: #FFFFFF;
|
||||||
|
.tab-container {
|
||||||
|
box-sizing: border-box;
|
||||||
|
padding: 30rpx 40rpx;
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
> view {
|
||||||
|
height: 30rpx;
|
||||||
|
line-height: 30rpx;
|
||||||
|
font-size: 32rpx;
|
||||||
|
color: rgba(51,51,51,1);
|
||||||
|
}
|
||||||
|
.price {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: flex-end;
|
||||||
|
.text {
|
||||||
|
margin-right: 5rpx;
|
||||||
|
}
|
||||||
|
.icon {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.current {
|
||||||
|
color: rgba(255,120,15,1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.scroll-container {
|
||||||
|
box-sizing: border-box;
|
||||||
|
padding: 0 30rpx;
|
||||||
|
.goods-container {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
justify-content: space-between;
|
||||||
|
}
|
||||||
|
// .goods-view {
|
||||||
|
// margin: 0 auto;
|
||||||
|
// width: 690rpx;
|
||||||
|
// display: flex;
|
||||||
|
// background-color: #F5F5F5;
|
||||||
|
// margin-bottom: 30rpx;
|
||||||
|
// align-items: center;
|
||||||
|
// > image {
|
||||||
|
// width: 220rpx;
|
||||||
|
// height: 170rpx;
|
||||||
|
// flex-shrink: 0;
|
||||||
|
// margin-right: 30rpx;
|
||||||
|
// }
|
||||||
|
// .right {
|
||||||
|
// width: 418rpx;
|
||||||
|
// .name {
|
||||||
|
// font-size: 30rpx;
|
||||||
|
// color: rgba(51,51,51,1);
|
||||||
|
// margin-bottom: 20rpx;
|
||||||
|
// }
|
||||||
|
// .briefing {
|
||||||
|
// font-size: 28rpx;
|
||||||
|
// color: rgba(102,102,102,1);
|
||||||
|
// line-height: 36rpx;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
@ -3,14 +3,14 @@
|
|||||||
<view class="top">
|
<view class="top">
|
||||||
<image :src="info.store_avatar"></image>
|
<image :src="info.store_avatar"></image>
|
||||||
<view class="name">{{info.store_name}}</view>
|
<view class="name">{{info.store_name}}</view>
|
||||||
<view class="info">创建时间:{{store_addtime|date}} | {{info.live_store_address}}</view>
|
<view class="info">创建时间:{{ info.store_addtime | date('yyyy年mm月dd日') }} | {{ info.live_store_address || '暂无地址' }}</view>
|
||||||
<view class="num">
|
<view class="num">
|
||||||
<view>
|
<view>
|
||||||
<view class="value">{{info.store_collect}}</view>
|
<view class="value">{{info.store_collect}}</view>
|
||||||
<view class="title">粉丝数</view>
|
<view class="title">粉丝数</view>
|
||||||
</view>
|
</view>
|
||||||
<view>
|
<view>
|
||||||
<view class="value">23435</view>
|
<view class="value">{{ info.evaluatecount }}</view>
|
||||||
<view class="title">评价</view>
|
<view class="title">评价</view>
|
||||||
</view>
|
</view>
|
||||||
<view>
|
<view>
|
||||||
@ -22,9 +22,9 @@
|
|||||||
<view class="bottom">
|
<view class="bottom">
|
||||||
<view class="title">
|
<view class="title">
|
||||||
<view>工商执照</view>
|
<view>工商执照</view>
|
||||||
<image></image>
|
<u-icon name="arrow-down" color="#999999" size="28"></u-icon>
|
||||||
</view>
|
</view>
|
||||||
<view class="image-list">
|
<view class="image-list" v-if="info.business_licence_number_electronic">
|
||||||
<image :src="info.business_licence_number_electronic"></image>
|
<image :src="info.business_licence_number_electronic"></image>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@ -37,9 +37,9 @@ export default {
|
|||||||
info:{}
|
info:{}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad(){
|
onLoad(option){
|
||||||
this.$u.api.getStoreInfo({id:1}).then((res)=>{
|
this.$u.api.getStoreInfo({id: option.id}).then((res)=>{
|
||||||
console.log(res)
|
// console.log(res)
|
||||||
this.info = res.data
|
this.info = res.data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@ -113,11 +113,6 @@ export default {
|
|||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
color: rgba(51,51,51,1);
|
color: rgba(51,51,51,1);
|
||||||
}
|
}
|
||||||
> image {
|
|
||||||
width: 24rpx;
|
|
||||||
height: 14rpx;
|
|
||||||
background-color: aqua;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
.image-list {
|
.image-list {
|
||||||
background-color: #ffffff;
|
background-color: #ffffff;
|
||||||
|
200
pageC/merchant/goods.vue
Normal file
200
pageC/merchant/goods.vue
Normal file
@ -0,0 +1,200 @@
|
|||||||
|
<template>
|
||||||
|
<view class="classify-goods">
|
||||||
|
<view class="tab-container">
|
||||||
|
<view class="overall" :class="{ 'current' : current == 0 }" @click="switchCurrent(0)">综合</view>
|
||||||
|
<view class="salenum" :class="{ 'current' : current == 1 }" @click="switchCurrent(1)">销量</view>
|
||||||
|
<view class="new" :class="{ 'current' : current == 2 }" @click="switchCurrent(2)">新品</view>
|
||||||
|
<view class="price" :class="{ 'current' : current == 3 }" @click="switchCurrent(3)">
|
||||||
|
<view class="text">价格</view>
|
||||||
|
<view class="icon">
|
||||||
|
<u-icon name="arrow-up-fill" :color="(current == 3 && priceOrderAsc) ? '#FF780F' : '#333333'" size="22"></u-icon>
|
||||||
|
<u-icon name="arrow-down-fill" :color="(current == 3 && !priceOrderAsc) ? '#FF780F' : '#333333'" size="22"></u-icon>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<scroll-view scroll-y class="scroll-container" :style="{ height: scrollHeight }" @scrolltolower="loadMore">
|
||||||
|
<view class="goods-container">
|
||||||
|
<view v-for="goods in goodsList" :key="goods.goods_id" class="goods-view" @click="toDetailsPage(goods.goods_id)">
|
||||||
|
<goodsItem :info="goods"></goodsItem>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<u-loadmore :status="loadStatus" bgColor="#FFFFFF" margin-top="20" margin-bottom="20" v-if="goodsList.length >= pageSize"></u-loadmore>
|
||||||
|
<u-empty mode="list" v-if="!goodsList.length"></u-empty>
|
||||||
|
</scroll-view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
import goodsItem from "@/components/shop/list/item"
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
pageSize: 15,
|
||||||
|
cid: '',
|
||||||
|
page: 1,
|
||||||
|
current: 0,
|
||||||
|
priceOrderAsc: true, // 是否升序
|
||||||
|
goodsList: [],
|
||||||
|
scrollHeight: '',
|
||||||
|
loadStatus: 'loadmore',
|
||||||
|
timer: true, // 防止上拉加载短时间内多次调用
|
||||||
|
}
|
||||||
|
},
|
||||||
|
components: {
|
||||||
|
goodsItem
|
||||||
|
},
|
||||||
|
props: {
|
||||||
|
sid: String
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
current(value) {
|
||||||
|
this.page = 1;
|
||||||
|
this.goodsList = [];
|
||||||
|
this.getStoreGoodsList({ laod: 'reload' });
|
||||||
|
},
|
||||||
|
priceOrderAsc(value) {
|
||||||
|
this.page = 1;
|
||||||
|
this.getStoreGoodsList({ laod: 'reload' });
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.setViewHeight();
|
||||||
|
this.getStoreGoodsList({ load: 'reload' });
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
setOrderSort() {
|
||||||
|
let sort = '';
|
||||||
|
if(this.current == 0) {
|
||||||
|
sort = 'goods_sort';
|
||||||
|
} else if(this.current == 1) {
|
||||||
|
sort = 'goods_salenum';
|
||||||
|
} else if(this.current == 2) {
|
||||||
|
sort = 'goods_addtime';
|
||||||
|
} else if(this.current == 3) {
|
||||||
|
if(this.priceOrderAsc) sort = 'goods_price_asc';
|
||||||
|
else sort = 'goods_price_desc';
|
||||||
|
}
|
||||||
|
return sort;
|
||||||
|
},
|
||||||
|
// 排序方式 goods_salenum:销量 evaluation_count:评价 goods_price_asc:价格从低到高 goods_price_desc:价格从高到低
|
||||||
|
async getStoreGoodsList({ load = 'reload' } = {}) {
|
||||||
|
const sort = this.setOrderSort();
|
||||||
|
const res = await this.$u.api.getStoreGoodsList({
|
||||||
|
id: this.sid,
|
||||||
|
page: this.page,
|
||||||
|
order: sort,
|
||||||
|
})
|
||||||
|
this.timer = true;
|
||||||
|
if(res.errCode == 0) {
|
||||||
|
this.pageSize = res.data.per_page;
|
||||||
|
if(load == 'reload') this.goodsList = res.data.data;
|
||||||
|
else if(load == 'loadmore') this.goodsList.push(...res.data.data);
|
||||||
|
}
|
||||||
|
return res.data.data.length;
|
||||||
|
},
|
||||||
|
loadMore() {
|
||||||
|
if(this.goodsList.length < this.pageSize) return false;
|
||||||
|
if(!this.timer) return false;
|
||||||
|
this.loadStatus = "loading";
|
||||||
|
this.page++;
|
||||||
|
this.getStoreGoodsList({ load: 'loadmore' }).then(length => {
|
||||||
|
if(length == 0) {
|
||||||
|
this.page--;
|
||||||
|
this.loadStatus = 'nomore';
|
||||||
|
} else {
|
||||||
|
this.loadStatus = 'loading';
|
||||||
|
}
|
||||||
|
}).catch(() => {
|
||||||
|
this.loadStatus = "nomore";
|
||||||
|
this.page--;
|
||||||
|
})
|
||||||
|
},
|
||||||
|
switchCurrent(current) {
|
||||||
|
if(current == 1 && this.current == 1) this.priceOrderAsc = !this.priceOrderAsc;
|
||||||
|
this.current = current;
|
||||||
|
},
|
||||||
|
setViewHeight() {
|
||||||
|
const res = uni.getSystemInfoSync();
|
||||||
|
const otherHeight = 347 + 140 + 20 + 98;
|
||||||
|
this.scrollHeight = res.windowHeight - otherHeight / 2 + 'px';
|
||||||
|
// console.log(this.scrollHeight);
|
||||||
|
},
|
||||||
|
toDetailsPage(id) {
|
||||||
|
this.$u.route('/pageB/sdetails/index', {
|
||||||
|
id: id,
|
||||||
|
type: 1 // 商品详情 商品类型 1普通 2拼团 3秒杀 4优惠券
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.classify-goods {
|
||||||
|
width: 100%;
|
||||||
|
background-color: #FFFFFF;
|
||||||
|
.tab-container {
|
||||||
|
box-sizing: border-box;
|
||||||
|
padding: 30rpx 40rpx;
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
> view {
|
||||||
|
height: 30rpx;
|
||||||
|
line-height: 30rpx;
|
||||||
|
font-size: 32rpx;
|
||||||
|
color: rgba(51,51,51,1);
|
||||||
|
}
|
||||||
|
.price {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: flex-end;
|
||||||
|
.text {
|
||||||
|
margin-right: 5rpx;
|
||||||
|
}
|
||||||
|
.icon {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.current {
|
||||||
|
color: rgba(255,120,15,1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.scroll-container {
|
||||||
|
box-sizing: border-box;
|
||||||
|
padding: 0 30rpx;
|
||||||
|
.goods-container {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
justify-content: space-between;
|
||||||
|
}
|
||||||
|
// .goods-view {
|
||||||
|
// margin: 0 auto;
|
||||||
|
// width: 690rpx;
|
||||||
|
// display: flex;
|
||||||
|
// background-color: #F5F5F5;
|
||||||
|
// margin-bottom: 30rpx;
|
||||||
|
// align-items: center;
|
||||||
|
// > image {
|
||||||
|
// width: 220rpx;
|
||||||
|
// height: 170rpx;
|
||||||
|
// flex-shrink: 0;
|
||||||
|
// margin-right: 30rpx;
|
||||||
|
// }
|
||||||
|
// .right {
|
||||||
|
// width: 418rpx;
|
||||||
|
// .name {
|
||||||
|
// font-size: 30rpx;
|
||||||
|
// color: rgba(51,51,51,1);
|
||||||
|
// margin-bottom: 20rpx;
|
||||||
|
// }
|
||||||
|
// .briefing {
|
||||||
|
// font-size: 28rpx;
|
||||||
|
// color: rgba(102,102,102,1);
|
||||||
|
// line-height: 36rpx;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="merchant">
|
<view class="merchant">
|
||||||
<view v-if="show">
|
<!-- <view v-if="show" class="show-hide">
|
||||||
<view>
|
<view>
|
||||||
<image></image>
|
<image></image>
|
||||||
<view>消息</view>
|
<view>消息</view>
|
||||||
@ -13,67 +13,70 @@
|
|||||||
<image></image>
|
<image></image>
|
||||||
<view>我的</view>
|
<view>我的</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view> -->
|
||||||
<view class="top" :style="{'background-image':'url(' + info.store_banner + ')'}">
|
<view class="top" :style="{'background-image':'url(' + info.store_banner + ')'}">
|
||||||
<image :src="info.store_avatar"></image>
|
<image :src="info.store_avatar"></image>
|
||||||
<view class="info">
|
<view class="info">
|
||||||
<view class="name u-line-1">{{info.store_name}}</view>
|
<view class="name u-line-1">{{info.store_name}}</view>
|
||||||
<view class="num">粉丝数:{{info.store_collect}}</view>
|
<view class="num">粉丝数:{{info.store_collect}}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="btn">
|
<view class="btn" @click="attentionMember">
|
||||||
<image></image>
|
<image src="/static/image/shop/8.png"></image>
|
||||||
<view>{{ 0 ? "关注" : "已关注" }}</view>
|
<view>{{ info.is_attention == 0 ? "关注" : "已关注" }}</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="follow">
|
<view class="follow" v-if="info.attention_member && info.attention_member.length">
|
||||||
<view class="title">关注</view>
|
<view class="title">关注</view>
|
||||||
<scroll-view scroll-x class="list">
|
<scroll-view scroll-x class="list">
|
||||||
<view class="list-items">
|
<view class="list-items">
|
||||||
<view v-for="(item, index) in 9" :key="index" class="item">
|
<view v-for="(item, index) in info.attention_member" :key="index" class="item">
|
||||||
<image></image>
|
<image :src="item.friend_frommavatar"></image>
|
||||||
<view class="nickname u-line-1">用户昵称</view>
|
<view class="nickname u-line-1">{{ item.friend_frommname }}</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</scroll-view>
|
</scroll-view>
|
||||||
</view>
|
</view>
|
||||||
<view class="main">
|
<view class="main">
|
||||||
<view class="classify" v-if="cur==0">
|
<view class="video-image" v-if="cur==0 && indextop.length">
|
||||||
<view v-for="item in indextop" :key="item.id">
|
<view v-for="item in indextop" :key="item.id">
|
||||||
<videoTop :url="item.url" v-if="item.type == 2"></videoTop>
|
<videoTop :url="item.url" v-if="item.type == 2"></videoTop>
|
||||||
<imageTop v-else :url="item.url"></imageTop>
|
<imageTop v-else :url="item.url"></imageTop>
|
||||||
</view>
|
</view>
|
||||||
<view style="display: flex;flex-wrap: wrap;">
|
<view style="display: flex;flex-wrap: wrap;" v-if="indexlist.length">
|
||||||
<listitem :style="{'margin-left': index%2 == 1 ? '20rpx':'0'}" v-for="(item,index) in indexlist" :key="item.id" :type="item.type" :url="item.url"></listitem>
|
<listitem :style="{'margin-left': index%2 == 1 ? '20rpx':'0'}" v-for="(item,index) in indexlist" :key="item.id" :type="item.type" :url="item.url"></listitem>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
<!-- 商品筛选排序未完成 -->
|
<!-- 商品筛选排序未完成 -->
|
||||||
<view class="item" v-if="cur==1">
|
<view class="item" v-if="cur==1">
|
||||||
<item v-for="item in list" :key="item.gc_id" :info="item" class="item"></item>
|
<!-- <item v-for="item in list" :key="item.gc_id" :info="item" class="item"></item> -->
|
||||||
|
<goods :sid="sid"></goods>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="tabbar">
|
<view class="tabbar">
|
||||||
<view @click="cur=0">
|
<view @click="switchCurrent(0)">
|
||||||
<image></image>
|
<image src="/static/image/shop/9.png"></image>
|
||||||
<view>商品分类</view>
|
<view>商品分类</view>
|
||||||
</view>
|
</view>
|
||||||
<view @click="cur=1">
|
<view @click="switchCurrent(1)">
|
||||||
<image></image>
|
<image src="/static/image/shop/10.png" v-if="cur != 1"></image>
|
||||||
<view>商品列表</view>
|
<image src="/static/image/shop/13.png" v-else></image>
|
||||||
|
<view :style="{ color: cur == 1 ? '#FF780F' : '#999999' }">商品列表</view>
|
||||||
</view>
|
</view>
|
||||||
<view @click="toDetailsPage">
|
<view @click="switchCurrent(2)">
|
||||||
<image></image>
|
<image src="/static/image/shop/11.png"></image>
|
||||||
<view>店铺信息</view>
|
<view>店铺信息</view>
|
||||||
</view>
|
</view>
|
||||||
<view>
|
<view @click="switchCurrent(3)">
|
||||||
<image></image>
|
<image src="/static/image/shop/12.png"></image>
|
||||||
<view>联系客服</view>
|
<view>联系客服</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import item from "@/components/shop/list/item"
|
// import item from "@/components/shop/list/item"
|
||||||
|
import goods from "./goods"
|
||||||
import videoTop from "../components/merchant/video-top"
|
import videoTop from "../components/merchant/video-top"
|
||||||
import imageTop from "../components/merchant/image-top"
|
import imageTop from "../components/merchant/image-top"
|
||||||
import listitem from "../components/merchant/list-item"
|
import listitem from "../components/merchant/list-item"
|
||||||
@ -81,6 +84,7 @@ import listitem from "../components/merchant/list-item"
|
|||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
sid: '',
|
||||||
show: false,
|
show: false,
|
||||||
cur: 0,
|
cur: 0,
|
||||||
list:[],
|
list:[],
|
||||||
@ -90,38 +94,64 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
components:{
|
components:{
|
||||||
item,
|
goods,
|
||||||
videoTop,
|
videoTop,
|
||||||
imageTop,
|
imageTop,
|
||||||
listitem
|
listitem
|
||||||
},
|
},
|
||||||
methods: {
|
onPullDownRefresh() {
|
||||||
toDetailsPage() {
|
this.getStoreInfo();
|
||||||
uni.navigateTo({
|
this.getStoreImgVideoList();
|
||||||
url: './details'
|
|
||||||
});
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
onLoad(){
|
onNavigationBarButtonTap(e) {
|
||||||
this.$u.api.getStoreGoodsList({id:1}).then((res)=>{
|
// console.log(e.index);
|
||||||
// console.log(res.data)
|
if(e.index == 1) this.$u.route('/pageC/cart/index');
|
||||||
this.list= res.data.list
|
// if(e.index == 0) this.show = true;
|
||||||
})
|
},
|
||||||
this.$u.api.getStoreImgVideoList({id:1}).then((res)=>{
|
methods: {
|
||||||
console.log(res.data)
|
switchCurrent(current) {
|
||||||
this.indextop = [res.data[0],res.data[1]]
|
this.cur = current;
|
||||||
this.indexlist = res.data.slice(2,)
|
if(current == 0) {
|
||||||
})
|
this.$u.route('/pageC/merchant/storeClassify', { id: this.sid });
|
||||||
this.$u.api.getStoreInfo({id:1}).then((res)=>{
|
} else if(current == 2) {
|
||||||
console.log(res)
|
this.$u.route('./details', { id: this.sid });
|
||||||
this.info = res.data
|
}
|
||||||
})
|
},
|
||||||
|
getStoreInfo() {
|
||||||
|
this.$u.api.getStoreInfo({ id: this.sid }).then((res)=>{
|
||||||
|
this.info = res.data;
|
||||||
|
uni.stopPullDownRefresh();
|
||||||
|
})
|
||||||
|
},
|
||||||
|
getStoreImgVideoList() {
|
||||||
|
this.$u.api.getStoreImgVideoList({ id: this.sid }).then((res)=>{
|
||||||
|
if(res.data.length) {
|
||||||
|
this.indextop = [res.data[0], res.data[1]];
|
||||||
|
this.indexlist = res.data.slice(2,);
|
||||||
|
}
|
||||||
|
uni.stopPullDownRefresh();
|
||||||
|
})
|
||||||
|
},
|
||||||
|
attentionMember() {
|
||||||
|
this.$u.api.attentionMember({ member_id: this.info.member_id }).then(res => {
|
||||||
|
if(res.errCode == 0) {
|
||||||
|
this.getStoreInfo();
|
||||||
|
}
|
||||||
|
this.$u.toast(res.message);
|
||||||
|
})
|
||||||
|
},
|
||||||
|
},
|
||||||
|
onLoad(option){
|
||||||
|
this.sid = option.id;
|
||||||
|
console.log(this.sid);
|
||||||
|
this.getStoreInfo();
|
||||||
|
this.getStoreImgVideoList();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.merchant {
|
.merchant {
|
||||||
min-height: 100vh;
|
// min-height: 100vh;
|
||||||
background-color: #ECECEC;
|
background-color: #ECECEC;
|
||||||
padding-top: calc(350rpx - var(--window-top));
|
padding-top: calc(350rpx - var(--window-top));
|
||||||
.top {
|
.top {
|
||||||
@ -168,7 +198,6 @@ export default {
|
|||||||
height: 28rpx;
|
height: 28rpx;
|
||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
margin-right: 14rpx;
|
margin-right: 14rpx;
|
||||||
background-color: aqua;
|
|
||||||
}
|
}
|
||||||
> view {
|
> view {
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
@ -230,13 +259,18 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
.main{
|
.main{
|
||||||
padding-bottom: 98rpx;
|
.video-image {
|
||||||
|
padding-bottom: 98rpx;
|
||||||
|
}
|
||||||
|
> view {
|
||||||
|
margin-top: 20rpx;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
.tabbar {
|
.tabbar {
|
||||||
border-top: 1rpx #DBDADA solid;
|
border-top: 1rpx #DBDADA solid;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 98rpx;
|
height: 98rpx;
|
||||||
background: rgb(95, 64, 64);
|
background: rgba(251,251,251,1);
|
||||||
display: flex;
|
display: flex;
|
||||||
padding: 10rpx 55rpx;
|
padding: 10rpx 55rpx;
|
||||||
position: fixed;
|
position: fixed;
|
||||||
@ -251,7 +285,6 @@ export default {
|
|||||||
width: 40rpx;
|
width: 40rpx;
|
||||||
height: 40rpx;
|
height: 40rpx;
|
||||||
margin-bottom: 15rpx;
|
margin-bottom: 15rpx;
|
||||||
background-color: aqua;
|
|
||||||
}
|
}
|
||||||
> view {
|
> view {
|
||||||
font-size: 24rpx;
|
font-size: 24rpx;
|
||||||
@ -259,12 +292,5 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.item{
|
|
||||||
display: flex;
|
|
||||||
flex-wrap: wrap;
|
|
||||||
justify-content: space-between;
|
|
||||||
// margin-top: 20rpx;
|
|
||||||
padding:25rpx;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
88
pageC/merchant/storeClassify.vue
Normal file
88
pageC/merchant/storeClassify.vue
Normal file
@ -0,0 +1,88 @@
|
|||||||
|
<template>
|
||||||
|
<view class="classify">
|
||||||
|
<view class="item-view" @click="viewGoods({ type: 'all', name: '全部宝贝' })">
|
||||||
|
<view>全部宝贝</view>
|
||||||
|
<u-icon name="arrow-right" color="#999999" size="28"></u-icon>
|
||||||
|
</view>
|
||||||
|
<view class="item-view" @click="viewGoods({ type: 'new', name: '新品上架' })">
|
||||||
|
<view>新品上架</view>
|
||||||
|
<u-icon name="arrow-right" color="#999999" size="28"></u-icon>
|
||||||
|
</view>
|
||||||
|
<view class="classify-container">
|
||||||
|
<view v-for="classifyA in classifyList" :key="classifyA.gc_parent_id" class="classify-view">
|
||||||
|
<view class="title">{{ classifyA.gc_parent_name }}</view>
|
||||||
|
<view class="classifyA-view">
|
||||||
|
<view v-for="classifyB in classifyA.gc_child" :key="classifyB.gc_id" class="classifyB-item u-line-1" @click="viewGoods({ type: classifyB.gc_parent_id, name: classifyB.gc_parent_name })">{{ classifyB.gc_parent_name }}</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
classifyList: [],
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onLoad(option) {
|
||||||
|
this.sid = option.id;
|
||||||
|
this.getStoreClassifyList();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
viewGoods({ type, name }) {
|
||||||
|
console.log(11);
|
||||||
|
this.$u.route('pageC/merchant/classifyGoods', { sid: this.sid, cid: type, name: name });
|
||||||
|
},
|
||||||
|
getStoreClassifyList() {
|
||||||
|
this.$u.api.getStoreClassifyList({ id: this.sid }).then(res => {
|
||||||
|
this.classifyList = res.data;
|
||||||
|
})
|
||||||
|
},
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.classify {
|
||||||
|
padding-top: 20rpx;
|
||||||
|
background-color: #ECECEC;
|
||||||
|
min-height: calc(100vh - var(--window-top));
|
||||||
|
.item-view {
|
||||||
|
margin-bottom: 20rpx;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
padding: 35rpx 30rpx;
|
||||||
|
font-size: 30rpx;
|
||||||
|
color: rgba(51,51,51,1);
|
||||||
|
background-color: #FFFFFF;
|
||||||
|
}
|
||||||
|
.classify-container {
|
||||||
|
.classify-view {
|
||||||
|
padding: 30rpx 35rpx;
|
||||||
|
background-color: #FFFFFF;
|
||||||
|
margin-bottom: 20rpx;
|
||||||
|
.title {
|
||||||
|
font-size: 30rpx;
|
||||||
|
color: rgba(51,51,51,1);
|
||||||
|
margin-bottom: 34rpx;
|
||||||
|
}
|
||||||
|
.classifyA-view {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
justify-content: space-between;
|
||||||
|
.classifyB-item {
|
||||||
|
width: 335rpx;
|
||||||
|
height: 74rpx;
|
||||||
|
line-height: 74rpx;
|
||||||
|
background: rgba(255,241,230,1);
|
||||||
|
padding: 0 20rpx;
|
||||||
|
font-size: 30rpx;
|
||||||
|
color: rgba(51,51,51,1);
|
||||||
|
margin-bottom: 20rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
@ -3,13 +3,13 @@
|
|||||||
<u-empty mode="list" v-if="!list.length" color="#000" img-width="200" font-size="30" margin-top="300"></u-empty>
|
<u-empty mode="list" v-if="!list.length" color="#000" img-width="200" font-size="30" margin-top="300"></u-empty>
|
||||||
<u-swipe-action
|
<u-swipe-action
|
||||||
v-for="(item, index) in list" :key="index"
|
v-for="(item, index) in list" :key="index"
|
||||||
:index='item.favlog_id'
|
:index='item.store_id'
|
||||||
:show="item.show"
|
:show="item.show"
|
||||||
:options="options"
|
:options="options"
|
||||||
@click="removeFavorite"
|
@click="removeFavorite"
|
||||||
@open="open"
|
@open="open"
|
||||||
>
|
>
|
||||||
<view class="item u-border-bottom">
|
<view class="item u-border-bottom" @click="toDetailsPage(item.store_id)">
|
||||||
<image :src="item.store_avatar"></image>
|
<image :src="item.store_avatar"></image>
|
||||||
<!-- 此层wrap在此为必写的,否则可能会出现标题定位错误 -->
|
<!-- 此层wrap在此为必写的,否则可能会出现标题定位错误 -->
|
||||||
<view class="title-wrap">
|
<view class="title-wrap">
|
||||||
@ -46,12 +46,15 @@ export default {
|
|||||||
getStoreFavoritesList() {
|
getStoreFavoritesList() {
|
||||||
this.$u.api.getFavoritesList({
|
this.$u.api.getFavoritesList({
|
||||||
type: 2 // 店铺 type: 2
|
type: 2 // 店铺 type: 2
|
||||||
|
}).then(res => {
|
||||||
|
this.list = res.data;
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
removeFavorite(id) {
|
removeFavorite(id) {
|
||||||
console.log(id);
|
console.log(id);
|
||||||
this.$u.api.removeFavorite({
|
this.$u.api.removeFavorite({
|
||||||
id: id
|
id: id,
|
||||||
|
type: 'store'
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
this.$u.toast(res.message);
|
this.$u.toast(res.message);
|
||||||
if(res.errCode == 0) {
|
if(res.errCode == 0) {
|
||||||
@ -59,6 +62,11 @@ export default {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
toDetailsPage(id) {
|
||||||
|
this.$u.route('pageC/merchant/index', {
|
||||||
|
id: id
|
||||||
|
});
|
||||||
|
},
|
||||||
open(index) {
|
open(index) {
|
||||||
// 先将正在被操作的swipeAction标记为打开状态,否则由于props的特性限制,
|
// 先将正在被操作的swipeAction标记为打开状态,否则由于props的特性限制,
|
||||||
// 原本为'false',再次设置为'false'会无效
|
// 原本为'false',再次设置为'false'会无效
|
||||||
|
47
pages.json
47
pages.json
@ -301,23 +301,28 @@
|
|||||||
{
|
{
|
||||||
"path": "merchant/index",
|
"path": "merchant/index",
|
||||||
"style": {
|
"style": {
|
||||||
|
"enablePullDownRefresh": true,
|
||||||
"app-plus": {
|
"app-plus": {
|
||||||
"titleSize": "36px",
|
"titleSize": "36px",
|
||||||
"titleNView": {
|
"titleNView": {
|
||||||
"titleColor": "#333333",
|
"titleColor": "#333333",
|
||||||
"backgroundColor": "rgba(255,255,255,0)",
|
"backgroundColor": "rgba(255,255,255,0)",
|
||||||
"buttons": [
|
"buttons": [
|
||||||
|
// {
|
||||||
|
// "type":"none",
|
||||||
|
// "text":"\ue62b",
|
||||||
|
// "float":"right",
|
||||||
|
// "fontSize":"20",
|
||||||
|
// "fontSrc": "/static/fonts/more.ttf",
|
||||||
|
// "color": "#FFFFFF"
|
||||||
|
// },
|
||||||
{
|
{
|
||||||
"type":"none",
|
"type":"none",
|
||||||
"text":"...",
|
"text":"\ue636",
|
||||||
"float":"right",
|
"float":"right",
|
||||||
"fontSize":"16"
|
"fontSize":"22",
|
||||||
},
|
"fontSrc": "/static/fonts/cart.ttf",
|
||||||
{
|
"color": "#FFFFFF"
|
||||||
"type":"none",
|
|
||||||
"text":"\ue582",
|
|
||||||
"float":"right",
|
|
||||||
"fontSize":"16"
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"searchInput": {
|
"searchInput": {
|
||||||
@ -345,6 +350,32 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"path": "merchant/storeClassify",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "商品分类",
|
||||||
|
"app-plus": {
|
||||||
|
"titleSize": "36px",
|
||||||
|
"titleNView": {
|
||||||
|
"titleColor": "#333333",
|
||||||
|
"backgroundColor": "#FFFFFF"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "merchant/classifyGoods",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "",
|
||||||
|
"app-plus": {
|
||||||
|
"titleSize": "36px",
|
||||||
|
"titleNView": {
|
||||||
|
"titleColor": "#333333",
|
||||||
|
"backgroundColor": "#FFFFFF"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"path": "cart/ConfirmOrder",
|
"path": "cart/ConfirmOrder",
|
||||||
"style": {
|
"style": {
|
||||||
|
@ -22,8 +22,8 @@
|
|||||||
<!-- <view @click="toOtherPage('/mine/GoodsCollection')">
|
<!-- <view @click="toOtherPage('/mine/GoodsCollection')">
|
||||||
<view>{{ userInfo.member_fav_goods_num || 0 }}</view>
|
<view>{{ userInfo.member_fav_goods_num || 0 }}</view>
|
||||||
<view>商品收藏</view>
|
<view>商品收藏</view>
|
||||||
</view>
|
</view> -->
|
||||||
<view @click="toOtherPage('/mine/StoreCollection')">
|
<!-- <view @click="toOtherPage('/mine/StoreCollection')">
|
||||||
<view>{{ userInfo.member_fav_store_num || 0 }}</view>
|
<view>{{ userInfo.member_fav_store_num || 0 }}</view>
|
||||||
<view>店铺收藏</view>
|
<view>店铺收藏</view>
|
||||||
</view> -->
|
</view> -->
|
||||||
@ -248,8 +248,8 @@ export default {
|
|||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
padding: 0 30rpx;
|
padding: 0 30rpx;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-around;
|
// justify-content: space-between;
|
||||||
// justify-content: flex-start;
|
justify-content: flex-start;
|
||||||
> view {
|
> view {
|
||||||
margin-right: 80rpx;
|
margin-right: 80rpx;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
BIN
static/fonts/more.ttf
Normal file
BIN
static/fonts/more.ttf
Normal file
Binary file not shown.
BIN
static/image/shop/10.png
Normal file
BIN
static/image/shop/10.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.9 KiB |
BIN
static/image/shop/11.png
Normal file
BIN
static/image/shop/11.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.7 KiB |
BIN
static/image/shop/12.png
Normal file
BIN
static/image/shop/12.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.0 KiB |
BIN
static/image/shop/13.png
Normal file
BIN
static/image/shop/13.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.1 KiB |
BIN
static/image/shop/8.png
Normal file
BIN
static/image/shop/8.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.2 KiB |
BIN
static/image/shop/9.png
Normal file
BIN
static/image/shop/9.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.0 KiB |
Loading…
Reference in New Issue
Block a user