store 8.5

This commit is contained in:
ghusermoon 2020-08-05 17:38:11 +08:00
parent a47238a7a4
commit 0057bcd28e
21 changed files with 688 additions and 101 deletions

View File

@ -173,10 +173,17 @@ export default {
goods_id: id
});
},
getStoreGoodsList({ id, page = 0}){
getStoreGoodsList({ id, page, order, gc_id }){
return vm.$u.post('Store/getStoreGoodsList', {
id: id,
page:page
page: page,
order: order,
gc_id: gc_id,
});
},
getStoreClassifyList({ id }) {
return vm.$u.post('Store/getStoreClassifyList', {
id: id
});
},
getStoreImgVideoList({id}){
@ -306,7 +313,11 @@ export default {
// 达人上架商品
goodsShelves({live_id}){
return vm.$u.post('Specialci/goodsShelves',{live_id})
}
},
//
addFavoriteStore({ id }) {
return vm.$u.post('member/addFavoriteStore',{ fid: id })
},
}
}

View File

@ -175,9 +175,10 @@ export default {
return vm.$u.post('Member/getFavoritesList', params);
},
// 取消收藏(商品/店铺)
removeFavorite({ id }) {
removeFavorite({ id, type }) {
return vm.$u.post('Member/removeFavorite', {
id: id,
fav_id: id,
type: type,
});
},
// 设置-用户信息

View File

@ -7,7 +7,7 @@
<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>
</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">
<!-- 最多显示3个 -->
<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;
padding: 0 30rpx;
display: flex;
&:not(:nth-child(3n)) {
> view {
> view {
&:not(:nth-child(3n)) {
margin-right: 20rpx;
}
}

View File

@ -2,7 +2,7 @@
<view class="list">
<view class="top">商品推荐</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>
<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">
@ -39,6 +39,7 @@ export default {
watch: {
current(index) {
this.page = 1;
this.goodsList = [];
const id = this.classifyList[index].gc_id;
this.getGoodsRecommend({gc_id: id});
}
@ -68,7 +69,7 @@ export default {
this.page--;
})
},
getGoodsClassRecommend(gc_id) {
getGoodsClassRecommend() {
this.$u.api.getGoodsClassRecommend().then(res => {
if (res.errCode == 0) {
// current
@ -82,6 +83,7 @@ export default {
page: page,
gc_id: gc_id,
})
// this.swiperCurrent = this.current;
if (res.errCode == 0) {
this.timer = true;
if(reload) this.goodsList = res.data.goodsList;
@ -93,13 +95,14 @@ export default {
},
setSwiperHeight() {
// height: 230px, margin-bottom: 13
// const height = Math.ceil(this.goodsList.length / 2) * (510 + 26);
// this.swiperHeight = height == 0 ? '230rpx' : height + 'rpx';
this.swiperHeight = Math.ceil(this.goodsList.length / 2) * (270 + 13) + 'px';
const height = Math.ceil(this.goodsList.length / 2) * (540 + 26);
this.swiperHeight = height == 0 ? '230rpx' : height + 'rpx';
// this.swiperHeight = Math.ceil(this.goodsList.length / 2) * (270 + 13) + 'px';
},
// tabsswiper
tabsChange(index) {
this.swiperCurrent = index;
this.current = index;
// this.getGoodsRecommend({ gc_id: this.classifyList[this.current].gc_id });
},
// swiper-itemtabs
transition(e) {
@ -111,8 +114,9 @@ export default {
animationfinish(e) {
let current = e.detail.current;
this.$refs.uTabs.setFinishCurrent(current);
this.swiperCurrent = current;
this.current = current;
this.swiperCurrent = current;
// this.getGoodsRecommend({ gc_id: this.classifyList[this.current].gc_id });
},
}
}

View File

@ -135,7 +135,7 @@
</u-popup>
<!-- 普通商品 tool -->
<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>
店铺
</view>
@ -155,7 +155,7 @@
<!-- 秒杀 tool -->
<view class="spike-tool" v-if="type==3">
<view class="left">
<view>
<view @click="toOthersPage('pageC/merchant/index?id=' + storeInfo.store_id)">
<image src="/static/image/common/18.png"></image>
<text>店铺</text>
</view>
@ -183,7 +183,8 @@ export default {
data() {
return {
list: [], //
goodsInfo: {}, //
goodsInfo: {}, //
storeInfo: {},
glist: [], //
id: 0, // id/id/ id
type: '', // 1 2 3 4
@ -311,6 +312,7 @@ export default {
if (res.errCode == 0) {
this.evaluate = res.data.goods_evaluate_info;
this.goodsInfo = res.data.goods;
this.storeInfo = res.data.store;
this.setSwiperList(res.data.goods_image);
this.glist = res.data.spec_list;
// console.log(this.goodsInfo.mobile_body);
@ -452,6 +454,9 @@ export default {
title: title
});
},
toOthersPage(url) {
this.$u.route(url);
},
viewComment() {
this.$u.route({
url: 'pageB/comment/index',

View File

@ -200,11 +200,13 @@ export default {
if(!this.debounce) return;
this.debounce = false;
if(this.orderType == 2) {
// this.sendOrder(0);
this.withImmediate();
} else if(this.orderType == 1) {
this.sendOrder(0);
} else {
this.sendOrder(1);
}
else this.sendOrder(1);
},
// @params {Number} ifcart
sendOrder(ifcart) {
@ -254,6 +256,7 @@ export default {
// console.log(params);
this.$u.api.sendOrder(params).then(res => {
if(res.errCode == 0) {
// this.withImmediate();
this.$u.route({
type: 'redirect',
url: '/pageC/cart/cashier',

View 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>

View File

@ -3,14 +3,14 @@
<view class="top">
<image :src="info.store_avatar"></image>
<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>
<view class="value">{{info.store_collect}}</view>
<view class="title">粉丝数</view>
</view>
<view>
<view class="value">23435</view>
<view class="value">{{ info.evaluatecount }}</view>
<view class="title">评价</view>
</view>
<view>
@ -22,9 +22,9 @@
<view class="bottom">
<view class="title">
<view>工商执照</view>
<image></image>
<u-icon name="arrow-down" color="#999999" size="28"></u-icon>
</view>
<view class="image-list">
<view class="image-list" v-if="info.business_licence_number_electronic">
<image :src="info.business_licence_number_electronic"></image>
</view>
</view>
@ -37,9 +37,9 @@ export default {
info:{}
}
},
onLoad(){
this.$u.api.getStoreInfo({id:1}).then((res)=>{
console.log(res)
onLoad(option){
this.$u.api.getStoreInfo({id: option.id}).then((res)=>{
// console.log(res)
this.info = res.data
})
}
@ -113,11 +113,6 @@ export default {
font-weight: 500;
color: rgba(51,51,51,1);
}
> image {
width: 24rpx;
height: 14rpx;
background-color: aqua;
}
}
.image-list {
background-color: #ffffff;

200
pageC/merchant/goods.vue Normal file
View 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>

View File

@ -1,6 +1,6 @@
<template>
<view class="merchant">
<view v-if="show">
<!-- <view v-if="show" class="show-hide">
<view>
<image></image>
<view>消息</view>
@ -13,67 +13,70 @@
<image></image>
<view>我的</view>
</view>
</view>
</view> -->
<view class="top" :style="{'background-image':'url(' + info.store_banner + ')'}">
<image :src="info.store_avatar"></image>
<view class="info">
<view class="name u-line-1">{{info.store_name}}</view>
<view class="num">粉丝数{{info.store_collect}}</view>
</view>
<view class="btn">
<image></image>
<view>{{ 0 ? "关注" : "已关注" }}</view>
<view class="btn" @click="attentionMember">
<image src="/static/image/shop/8.png"></image>
<view>{{ info.is_attention == 0 ? "关注" : "已关注" }}</view>
</view>
</view>
<view class="follow">
<view class="follow" v-if="info.attention_member && info.attention_member.length">
<view class="title">关注</view>
<scroll-view scroll-x class="list">
<view class="list-items">
<view v-for="(item, index) in 9" :key="index" class="item">
<image></image>
<view class="nickname u-line-1">用户昵称</view>
<view v-for="(item, index) in info.attention_member" :key="index" class="item">
<image :src="item.friend_frommavatar"></image>
<view class="nickname u-line-1">{{ item.friend_frommname }}</view>
</view>
</view>
</scroll-view>
</view>
<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">
<videoTop :url="item.url" v-if="item.type == 2"></videoTop>
<imageTop v-else :url="item.url"></imageTop>
</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>
</view>
</view>
<!-- 商品筛选排序未完成 -->
<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 class="tabbar">
<view @click="cur=0">
<image></image>
<view @click="switchCurrent(0)">
<image src="/static/image/shop/9.png"></image>
<view>商品分类</view>
</view>
<view @click="cur=1">
<image></image>
<view>商品列表</view>
<view @click="switchCurrent(1)">
<image src="/static/image/shop/10.png" v-if="cur != 1"></image>
<image src="/static/image/shop/13.png" v-else></image>
<view :style="{ color: cur == 1 ? '#FF780F' : '#999999' }">商品列表</view>
</view>
<view @click="toDetailsPage">
<image></image>
<view @click="switchCurrent(2)">
<image src="/static/image/shop/11.png"></image>
<view>店铺信息</view>
</view>
<view>
<image></image>
<view @click="switchCurrent(3)">
<image src="/static/image/shop/12.png"></image>
<view>联系客服</view>
</view>
</view>
</view>
</template>
<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 imageTop from "../components/merchant/image-top"
import listitem from "../components/merchant/list-item"
@ -81,6 +84,7 @@ import listitem from "../components/merchant/list-item"
export default {
data() {
return {
sid: '',
show: false,
cur: 0,
list:[],
@ -90,38 +94,64 @@ export default {
}
},
components:{
item,
goods,
videoTop,
imageTop,
listitem
},
methods: {
toDetailsPage() {
uni.navigateTo({
url: './details'
});
}
onPullDownRefresh() {
this.getStoreInfo();
this.getStoreImgVideoList();
},
onLoad(){
this.$u.api.getStoreGoodsList({id:1}).then((res)=>{
// console.log(res.data)
this.list= res.data.list
})
this.$u.api.getStoreImgVideoList({id:1}).then((res)=>{
console.log(res.data)
this.indextop = [res.data[0],res.data[1]]
this.indexlist = res.data.slice(2,)
})
this.$u.api.getStoreInfo({id:1}).then((res)=>{
console.log(res)
this.info = res.data
})
onNavigationBarButtonTap(e) {
// console.log(e.index);
if(e.index == 1) this.$u.route('/pageC/cart/index');
// if(e.index == 0) this.show = true;
},
methods: {
switchCurrent(current) {
this.cur = current;
if(current == 0) {
this.$u.route('/pageC/merchant/storeClassify', { id: this.sid });
} else if(current == 2) {
this.$u.route('./details', { id: this.sid });
}
},
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>
<style lang="scss" scoped>
.merchant {
min-height: 100vh;
// min-height: 100vh;
background-color: #ECECEC;
padding-top: calc(350rpx - var(--window-top));
.top {
@ -168,7 +198,6 @@ export default {
height: 28rpx;
flex-shrink: 0;
margin-right: 14rpx;
background-color: aqua;
}
> view {
white-space: nowrap;
@ -230,13 +259,18 @@ export default {
}
}
.main{
padding-bottom: 98rpx;
.video-image {
padding-bottom: 98rpx;
}
> view {
margin-top: 20rpx;
}
}
.tabbar {
border-top: 1rpx #DBDADA solid;
width: 100%;
height: 98rpx;
background: rgb(95, 64, 64);
background: rgba(251,251,251,1);
display: flex;
padding: 10rpx 55rpx;
position: fixed;
@ -251,7 +285,6 @@ export default {
width: 40rpx;
height: 40rpx;
margin-bottom: 15rpx;
background-color: aqua;
}
> view {
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>

View 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>

View File

@ -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-swipe-action
v-for="(item, index) in list" :key="index"
:index='item.favlog_id'
:index='item.store_id'
:show="item.show"
:options="options"
@click="removeFavorite"
@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>
<!-- 此层wrap在此为必写的否则可能会出现标题定位错误 -->
<view class="title-wrap">
@ -46,12 +46,15 @@ export default {
getStoreFavoritesList() {
this.$u.api.getFavoritesList({
type: 2 // type: 2
}).then(res => {
this.list = res.data;
})
},
removeFavorite(id) {
console.log(id);
this.$u.api.removeFavorite({
id: id
id: id,
type: 'store'
}).then(res => {
this.$u.toast(res.message);
if(res.errCode == 0) {
@ -59,6 +62,11 @@ export default {
}
})
},
toDetailsPage(id) {
this.$u.route('pageC/merchant/index', {
id: id
});
},
open(index) {
// swipeActionprops
// 'false''false'

View File

@ -301,23 +301,28 @@
{
"path": "merchant/index",
"style": {
"enablePullDownRefresh": true,
"app-plus": {
"titleSize": "36px",
"titleNView": {
"titleColor": "#333333",
"backgroundColor": "rgba(255,255,255,0)",
"buttons": [
{
"type":"none",
"text":"...",
"float":"right",
"fontSize":"16"
},
// {
// "type":"none",
// "text":"\ue62b",
// "float":"right",
// "fontSize":"20",
// "fontSrc": "/static/fonts/more.ttf",
// "color": "#FFFFFF"
// },
{
"type":"none",
"text":"\ue582",
"text":"\ue636",
"float":"right",
"fontSize":"16"
"fontSize":"22",
"fontSrc": "/static/fonts/cart.ttf",
"color": "#FFFFFF"
}
],
"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",
"style": {

View File

@ -22,8 +22,8 @@
<!-- <view @click="toOtherPage('/mine/GoodsCollection')">
<view>{{ userInfo.member_fav_goods_num || 0 }}</view>
<view>商品收藏</view>
</view>
<view @click="toOtherPage('/mine/StoreCollection')">
</view> -->
<!-- <view @click="toOtherPage('/mine/StoreCollection')">
<view>{{ userInfo.member_fav_store_num || 0 }}</view>
<view>店铺收藏</view>
</view> -->
@ -248,8 +248,8 @@ export default {
box-sizing: border-box;
padding: 0 30rpx;
display: flex;
justify-content: space-around;
// justify-content: flex-start;
// justify-content: space-between;
justify-content: flex-start;
> view {
margin-right: 80rpx;
text-align: center;

BIN
static/fonts/more.ttf Normal file

Binary file not shown.

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB