From 891b5db055a1d27c6bda2e9700aa57f8bacd7cd2 Mon Sep 17 00:00:00 2001
From: xuxueyang <xuxy@fengyuntec.com>
Date: 星期四, 15 八月 2024 09:58:44 +0800
Subject: [PATCH] add 部分ui
---
sub_pages/customer/trade/list.vue | 36 ++--
pages/home/home.vue | 2
sub_pages/customer/shopping/shopping.vue | 32 ++++
pages.json | 3
pages/home/components/home-top-flow.vue | 14 +-
sub_pages/customer/shop/shop.vue | 232 +++++++++++++++++---------------
sub_pages/customer/trade/trade.vue | 12
pages/order/order-detail.vue | 4
pages/user/supplier-user.vue | 2
sub_pages/customer/trade/detail.vue | 36 ++--
10 files changed, 208 insertions(+), 165 deletions(-)
diff --git a/pages.json b/pages.json
index 4165edf..472fdb1 100644
--- a/pages.json
+++ b/pages.json
@@ -381,7 +381,8 @@
{
"path": "shop/shop",
"style": {
- "navigationBarTitleText": "商家主页"
+ "navigationBarTitleText": "商家主页",
+ "enablePullDownRefresh": true
}
},
{
diff --git a/pages/home/components/home-top-flow.vue b/pages/home/components/home-top-flow.vue
index 4deada1..890a250 100644
--- a/pages/home/components/home-top-flow.vue
+++ b/pages/home/components/home-top-flow.vue
@@ -125,13 +125,13 @@
display: flex;
.tag {
- min-width: 80rpx;
- padding-left: 20rpx;
- padding-right: 20rpx;
- line-height: 36rpx;
+ min-width: 60rpx;
+ padding-left: 10rpx;
+ padding-right: 10rpx;
+ line-height: 30rpx;
background: #FEE6E6;
- border-radius: 21rpx;
- font-size: 24rpx;
+ border-radius: 10rpx;
+ font-size: 22rpx;
color: #CD1212;
margin-right: 12rpx;
text-align: center;
@@ -140,7 +140,7 @@
.tag.green {
color: rgba(110, 159, 102, 1);
background: rgba(202, 229, 214, 1);
- border-radius: 21rpx;
+ border-radius: 10rpx;
// opacity: 0.57;
}
}
diff --git a/pages/home/home.vue b/pages/home/home.vue
index 9900960..396d4e7 100644
--- a/pages/home/home.vue
+++ b/pages/home/home.vue
@@ -71,7 +71,7 @@
<!-- 置顶的花列表 -->
<home-top-flow></home-top-flow>
- <view style="min-height:180rpx">
+ <view style="min-height:140rpx">
</view>
<common-footer flg="0"></common-footer>
diff --git a/pages/order/order-detail.vue b/pages/order/order-detail.vue
index cd9ad89..9cac196 100644
--- a/pages/order/order-detail.vue
+++ b/pages/order/order-detail.vue
@@ -339,7 +339,9 @@
this.$message.showToast('提交成功')
this.showSales = false
this.$forceUpdate()
- uni.navigateBack()
+ setTimeout(() => {
+ uni.navigateBack()
+ }, 1200)
}
},
},
diff --git a/pages/user/supplier-user.vue b/pages/user/supplier-user.vue
index 8c2da6b..aab37ab 100644
--- a/pages/user/supplier-user.vue
+++ b/pages/user/supplier-user.vue
@@ -287,7 +287,7 @@
<!-- #ifdef PUB_CUSTOMER -->
- <view style="padding-bottom:200rpx">
+ <view style="padding-bottom:140rpx">
</view>
<common-footer flg="3"></common-footer>
diff --git a/sub_pages/customer/shop/shop.vue b/sub_pages/customer/shop/shop.vue
index ec463fa..e05d579 100644
--- a/sub_pages/customer/shop/shop.vue
+++ b/sub_pages/customer/shop/shop.vue
@@ -82,74 +82,76 @@
</view>
<no-data v-if="(!list||list.length==0)&&true" style="width: 100%;margin-top: 120rpx;"></no-data>
<view class="flex m-t-12 flex-wrap-normal">
- <view class="type-list" v-if="flg==='1'">
- <view v-for="(item,index) of catgoryTree" @click="changeType(item)"
- :class="[query.categoryRoot===item.id?'current':'']" :key="index" class="p10 flex type-item">
- {{item.name || '-'}}
- </view>
- </view>
- <view class="flex1">
-
-
- <view class="component-shop-item flex" v-for="(item,index) of list" :key="index" :class="flg==='1'?'flg-category':''">
- <view class="img" @click.stop="toDetail(item)">
- <image class="img img100" :src="item.cover" lazy-load>
- </image>
- <view class="level">
- {{item.levelStr||''}}
- </view>
+ <view class="type-list" v-if="flg==='1'">
+ <view v-for="(item,index) of catgoryTree" @click="changeType(item)"
+ :class="[query.categoryRoot===item.id?'current':'']" :key="index"
+ class="p10 flex type-item">
+ {{item.name || '-'}}
</view>
+ </view>
+ <view class="flex1">
- <view class="m-l-12 info-container flex1">
- <view class="title" @click.stop="toDetail(item)">
- {{item.name}}
- <view class="price">
- ¥{{item.price}}/扎
+
+ <view class="component-shop-item flex" v-for="(item,index) of list" :key="index"
+ :class="flg==='1'?'flg-category':''">
+ <view class="img" @click.stop="toDetail(item)">
+ <image class="img img100" :src="item.cover" lazy-load>
+ </image>
+ <view class="level">
+ {{item.levelStr||''}}
</view>
- </view>
- <view class="tags" v-if="item.tags||false" @click.stop="toDetail(item)">
- <!-- <view class="tag red">限时抢购</view>
- <view class="tag green">品质严选</view> -->
- <view class="tag red" v-for="(tag,k) of item.tagArr" :class="[k===0?'red':'green']"
- :key="tag">{{
- tag
- }}
- </view>
</view>
- <!-- <view class="shop-name" @click.stop="toDetail(item)">
+
+ <view class="m-l-12 info-container flex1">
+ <view class="title" @click.stop="toDetail(item)">
+ {{item.name}}
+ <view class="price">
+ ¥{{item.price}}/扎
+ </view>
+ </view>
+ <view class="tags" v-if="item.tags||false" @click.stop="toDetail(item)">
+ <!-- <view class="tag red">限时抢购</view>
+ <view class="tag green">品质严选</view> -->
+ <view class="tag red" v-for="(tag,k) of item.tagArr" :class="[k===0?'red':'green']"
+ :key="tag">{{
+ tag
+ }}
+ </view>
+ </view>
+ <!-- <view class="shop-name" @click.stop="toDetail(item)">
{{item.categoryStr}}
</view> -->
- <view class="other-info flex" @click.stop="toDetail(item)">
- <view class="m-r-15">
- 已售:{{item.sales || 0}}
- </view>
- <view class="m-r-15">
- 剩余:{{item.stock || 0}}
- </view>
- <view class="m-r-15">
- {{item.unit}}
- </view>
- </view>
- <view class="bottom-buttons flex">
- <view class="m-l-0 m-r-a">
- <view class="m-r-15 desc-gray other-info">
- 颜色:{{item.color||'-'}}
+ <view class="other-info flex" @click.stop="toDetail(item)">
+ <view class="m-r-15">
+ 已售:{{item.sales || 0}}
+ </view>
+ <view class="m-r-15">
+ 剩余:{{item.stock || 0}}
+ </view>
+ <view class="m-r-15">
+ {{item.unit}}
</view>
</view>
- <view class="icons flex">
- <uni-icons v-if="item.shopnum&&item.shopnum>=1" type="minus" size="32"
- @click.stop="addnum(item,-1)"></uni-icons>
- <view class="curnums" @click.stop="updateItemNum(item)"
- v-if="item.shopnum&&item.shopnum>=1">
- {{ item.shopnum }}
+ <view class="bottom-buttons flex">
+ <view class="m-l-0 m-r-a">
+ <view class="m-r-15 desc-gray other-info">
+ 颜色:{{item.color||'-'}}
+ </view>
</view>
- <uni-icons v-if="!item.shopnum||item.shopnum<=99" type="plus-filled" size="32"
- @click.stop="addnum(item,1)"></uni-icons>
+ <view class="icons flex">
+ <uni-icons v-if="item.shopnum&&item.shopnum>=1" type="minus" size="32"
+ @click.stop="addnum(item,-1)"></uni-icons>
+ <view class="curnums" @click.stop="updateItemNum(item)"
+ v-if="item.shopnum&&item.shopnum>=1">
+ {{ item.shopnum }}
+ </view>
+ <uni-icons v-if="!item.shopnum||item.shopnum<=99" type="plus-filled" size="32"
+ @click.stop="addnum(item,1)"></uni-icons>
+ </view>
</view>
</view>
</view>
</view>
- </view>
</view>
</view>
@@ -271,7 +273,7 @@
levelStr: '',
level: '',
name: '',
- categoryRoot:'',
+ categoryRoot: '',
},
level_show: false,
level_columns: [
@@ -285,8 +287,16 @@
}
},
onShow() {
- //避免商品数目不一样
+ //避免商品数目不一样
this.refreshList('post')
+ },
+ async onPullDownRefresh() {
+ if (this.id) {
+ await this.getDetail()
+ }
+ await this.refreshList('post')
+ uni.stopPullDownRefresh()
+
},
onLoad(options) {
this.id = options.id || ''
@@ -351,16 +361,16 @@
// this.getMore('post')
// }
},
- methods: {
- getList_after() {
- if (this.list) {
- for (var item of this.list) {
- item.tagArr = []
- if (item.tags) {
- item.tagArr = item.tags.split(",") || []
- }
- }
- }
+ methods: {
+ getList_after() {
+ if (this.list) {
+ for (var item of this.list) {
+ item.tagArr = []
+ if (item.tags) {
+ item.tagArr = item.tags.split(",") || []
+ }
+ }
+ }
},
async getDetail() {
@@ -460,13 +470,13 @@
this.$message.hideLoading()
}
//如果存在第一个分类,根据一级分类查询
- if(this.catgoryTree.length>0){
- this.query.categoryRoot =this.catgoryTree[0].id
+ if (this.catgoryTree.length > 0) {
+ this.query.categoryRoot = this.catgoryTree[0].id
//然后刷新
this.refreshList('post')
-
+
}
-
+
}
this.flg = '' + flg
//如果没有加载数据,需要加载一下
@@ -474,12 +484,12 @@
},
changeType(item) {
- if(item.id!==this.query.categoryRoot){
+ if (item.id !== this.query.categoryRoot) {
this.query.categoryRoot = item.id || ''
this.refreshList('post')
//拼接二级分类,然后查询商品列表
}
-
+
},
buttonSearchFlow() {
// this.query.name = this.search_flow || ''
@@ -557,30 +567,30 @@
</script>
<style lang="scss" scoped>
- .brand-detail {
- .tags {
- margin-top: 12rpx;
- display: flex;
-
- .tag {
- min-width: 80rpx;
- padding-left: 20rpx;
- padding-right: 20rpx;
- line-height: 36rpx;
- background: #FEE6E6;
- border-radius: 21rpx;
- font-size: 24rpx;
- color: #CD1212;
- margin-right: 12rpx;
- text-align: center;
- }
-
- .tag.green {
- color: rgba(110, 159, 102, 1);
- background: rgba(202, 229, 214, 1);
- border-radius: 21rpx;
- // opacity: 0.57;
- }
+ .brand-detail {
+ .tags {
+ margin-top: 12rpx;
+ display: flex;
+
+ .tag {
+ min-width: 60rpx;
+ padding-left: 10rpx;
+ padding-right: 10rpx;
+ line-height: 30rpx;
+ background: #FEE6E6;
+ border-radius: 10rpx;
+ font-size: 22rpx;
+ color: #CD1212;
+ margin-right: 12rpx;
+ text-align: center;
+ }
+
+ .tag.green {
+ color: rgba(110, 159, 102, 1);
+ background: rgba(202, 229, 214, 1);
+ border-radius: 10rpx;
+ // opacity: 0.57;
+ }
}
// min-height: 99vh;
@@ -592,9 +602,10 @@
overflow: hidden;
overflow-y: scroll;
padding: 40rpx 32rpx;
- height: calc(100vh - 450rpx);
+ min-height: calc(100vh - 470rpx);
+ max-height: calc(100vh - 470rpx);
padding-top: 0rpx;
-
+
.type-list {
max-width: 140rpx;
min-width: 140rpx;
@@ -604,7 +615,7 @@
// max-height: calc(100vh - 600rpx);
overflow-y: scroll;
margin-right: 10rpx;
-
+
.type-item {
text-align: center;
font-weight: 400;
@@ -615,30 +626,33 @@
// padding-left: 30rpx;
// padding-right: 30rpx;
}
-
+
.type-item.current {
font-weight: 600;
color: #04BA97;
}
}
- .flg-category.component-shop-item{
- .img{
+
+ .flg-category.component-shop-item {
+ .img {
width: 140rpx;
height: 140rpx;
margin-top: 10rpx;
}
- .info-container{
+
+ .info-container {
.title {
margin-top: 0rpx;
}
- .shop-name{
-
- }
+
+ .shop-name {}
+
.other-info {
margin-bottom: 60rpx;
}
- .bottom-buttons{
- bottom: -50rpx;
+
+ .bottom-buttons {
+ bottom: -50rpx;
}
}
diff --git a/sub_pages/customer/shopping/shopping.vue b/sub_pages/customer/shopping/shopping.vue
index 766613d..f5a0f50 100644
--- a/sub_pages/customer/shopping/shopping.vue
+++ b/sub_pages/customer/shopping/shopping.vue
@@ -63,7 +63,7 @@
</view>
</view>
- <view style="min-height:200rpx">
+ <view style="min-height:140rpx;background-color: #fff;">
</view>
<view class="bottom-price flex">
<view class="m-t-12">
@@ -77,7 +77,7 @@
提交订单
</view>
</view>
- <view style="min-height:200rpx">
+ <view style="min-height:140rpx">
</view>
<common-footer flg="2"></common-footer>
</view>
@@ -269,6 +269,20 @@
this.ids.push(item.id)
}
})
+ //如果所有的话都悬赏了,设置为return true;
+ var tmpSelectAll = true
+ for (var i = 0; i < this.list.length; i++) {
+ for (var j = 0; j < this.list[i].flowerList.length; j++) {
+ if (this.ids.indexOf(this.list[i].flowerList[j].id) < 0) {
+ tmpSelectAll = false
+ break
+ }
+ }
+
+ }
+ this.checkall = tmpSelectAll
+
+
} else {
this.checkall = false
this.ids.splice(this.ids.indexOf('supplier@' + dto.supplierId), 1)
@@ -305,6 +319,18 @@
} else {
console.log('has', this.ids, dto)
}
+ //如果所有的话都悬赏了,设置为return true;
+ var tmpSelectAll = true
+ for (var i = 0; i < this.list.length; i++) {
+ for (var j = 0; j < this.list[i].flowerList.length; j++) {
+ if (this.ids.indexOf(this.list[i].flowerList[j].id) < 0) {
+ tmpSelectAll = false
+ break
+ }
+ }
+
+ }
+ this.checkall = tmpSelectAll
} else {
this.checkall = false
@@ -426,7 +452,7 @@
padding: 20rpx;
right: 0rpx;
// bottom: 160rpx;
- bottom: 130rpx;
+ bottom: 120rpx;
z-index: 11;
}
diff --git a/sub_pages/customer/trade/detail.vue b/sub_pages/customer/trade/detail.vue
index 420baa3..86b8350 100644
--- a/sub_pages/customer/trade/detail.vue
+++ b/sub_pages/customer/trade/detail.vue
@@ -590,24 +590,24 @@
margin-top: 12rpx;
display: flex;
- .tag {
- min-width: 80rpx;
- padding-left: 20rpx;
- padding-right: 20rpx;
- line-height: 36rpx;
- background: #FEE6E6;
- border-radius: 21rpx;
- font-size: 24rpx;
- color: #CD1212;
- margin-right: 12rpx;
- text-align: center;
- }
-
- .tag.green {
- color: rgba(110, 159, 102, 1);
- background: rgba(202, 229, 214, 1);
- border-radius: 21rpx;
- // opacity: 0.57;
+ .tag {
+ min-width: 60rpx;
+ padding-left: 10rpx;
+ padding-right: 10rpx;
+ line-height: 30rpx;
+ background: #FEE6E6;
+ border-radius: 10rpx;
+ font-size: 22rpx;
+ color: #CD1212;
+ margin-right: 12rpx;
+ text-align: center;
+ }
+
+ .tag.green {
+ color: rgba(110, 159, 102, 1);
+ background: rgba(202, 229, 214, 1);
+ border-radius: 10rpx;
+ // opacity: 0.57;
}
}
diff --git a/sub_pages/customer/trade/list.vue b/sub_pages/customer/trade/list.vue
index 77af631..6cd22bc 100644
--- a/sub_pages/customer/trade/list.vue
+++ b/sub_pages/customer/trade/list.vue
@@ -525,24 +525,24 @@
margin-top: 12rpx;
display: flex;
- .tag {
- min-width: 80rpx;
- padding-left: 20rpx;
- padding-right: 20rpx;
- line-height: 36rpx;
- background: #FEE6E6;
- border-radius: 21rpx;
- font-size: 24rpx;
- color: #CD1212;
- margin-right: 12rpx;
- text-align: center;
- }
-
- .tag.green {
- color: rgba(110, 159, 102, 1);
- background: rgba(202, 229, 214, 1);
- border-radius: 21rpx;
- // opacity: 0.57;
+ .tag {
+ min-width: 60rpx;
+ padding-left: 10rpx;
+ padding-right: 10rpx;
+ line-height: 30rpx;
+ background: #FEE6E6;
+ border-radius: 10rpx;
+ font-size: 22rpx;
+ color: #CD1212;
+ margin-right: 12rpx;
+ text-align: center;
+ }
+
+ .tag.green {
+ color: rgba(110, 159, 102, 1);
+ background: rgba(202, 229, 214, 1);
+ border-radius: 10rpx;
+ // opacity: 0.57;
}
}
diff --git a/sub_pages/customer/trade/trade.vue b/sub_pages/customer/trade/trade.vue
index e99cd81..12b3abf 100644
--- a/sub_pages/customer/trade/trade.vue
+++ b/sub_pages/customer/trade/trade.vue
@@ -19,7 +19,7 @@
</u-input>
</view>
</view>
- <view class="canteen-items" :style="{'min-height':hidefooter?'':'calc(100vh - 160rpx)'}">
+ <view class="canteen-items" :style="{'min-height':hidefooter?'':'calc(100vh - 340rpx)'}">
<view v-if="(!list||list.length==0)&&true" style="width: 100%;min-height: 200rpx;">
</view>
@@ -60,7 +60,7 @@
</view>
</view>
- <view style="padding-bottom:100rpx">
+ <view style="padding-bottom:40rpx">
</view>
</view>
<footer-msg v-if="!hidefooter" :more="page.total>0&&page.total>page.current*page.size"></footer-msg>
@@ -72,7 +72,7 @@
- <view style="min-height:200rpx" v-if="!hidefooter">
+ <view style="min-height:100rpx" v-if="!hidefooter">
</view>
<common-footer flg="1" v-if="!hidefooter">></common-footer>
@@ -358,8 +358,8 @@
min-width: 178rpx;
background: #EEF7F5;
border-radius: 8rpx;
- min-height: calc(100vh - 300rpx);
- max-height: calc(100vh - 300rpx);
+ min-height: calc(100vh - 270rpx);
+ max-height: calc(100vh - 270rpx);
overflow-y: scroll;
margin-right: 16rpx;
@@ -455,7 +455,7 @@
.canteen-item-container {
width: 100%;
min-height: 300rpx;
- max-height: calc(100vh - 200rpx);
+ max-height: calc(100vh - 270rpx);
overflow-y: scroll;
}
--
Gitblit v1.9.3