store 8.5
This commit is contained in:
@@ -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',
|
||||
|
||||
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">
|
||||
<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
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>
|
||||
<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>
|
||||
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>
|
||||
Reference in New Issue
Block a user