From 666bcc20d989be1c7a2acb314594e8e017a611ac Mon Sep 17 00:00:00 2001
From: xuxueyang <xuxy@fengyuntec.com>
Date: 星期日, 11 八月 2024 23:18:51 +0800
Subject: [PATCH] update花店的一些问题等

---
 sub_pages/customer/shop/shop.vue |  110 +++++++++++++++++++++++++++++++------------------------
 1 files changed, 62 insertions(+), 48 deletions(-)

diff --git a/sub_pages/customer/shop/shop.vue b/sub_pages/customer/shop/shop.vue
index a3e0675..c83a059 100644
--- a/sub_pages/customer/shop/shop.vue
+++ b/sub_pages/customer/shop/shop.vue
@@ -2,15 +2,7 @@
 	<view class="brand-detail" style="background: #20613D;">
 
 		<view class="brand-top-info">
-			<view class="search-container  flex" style="padding-left: 20rpx;padding-right: 20rpx;padding-top: 20rpx">
-				<view class="flex1 input">
-					<u-input placeholder="请输入花名" v-model="search_flow">
-						<template slot="suffix">
-							<uni-icons color="#20613D" type="search" size="24" @tap="buttonSearchFlow"></uni-icons>
-						</template>
-					</u-input>
-				</view>
-			</view>
+
 			<view class="info-brand m-t-12" v-if="id">
 				<view class="flex">
 					<image class="store-logo" :src="dto.cover"></image>
@@ -62,6 +54,19 @@
 		</view>
 		<view class="brand-info">
 			<view v-if="flg==='0'" class="brand-info-0">
+				<view class="search-container  flex"
+					style="padding-left: 20rpx;padding-right: 20rpx;padding-top: 20rpx">
+					<view class="flex1 input">
+						<u-input placeholder="请输入花名" v-model="query.name" clearable @confirm="buttonSearchFlow" @clear="()=>{
+					$nextTick(()=>{buttonSearchFlow()})
+				}">
+							<template slot="suffix">
+								<uni-icons color="#20613D" type="search" size="24"
+									@click="buttonSearchFlow"></uni-icons>
+							</template>
+						</u-input>
+					</view>
+				</view>
 				<view class="component-filter-container" style="padding-top: 12rpx;">
 					<view class="flex1" @click.stop="$refs.popup_column.open()">
 						排序{{ query.columnStr&&('-'+query.columnStr) || '' }}
@@ -75,9 +80,8 @@
 				<view class="top-title m-t-12">
 					报价已包含打包费、材料费、交易佣金
 				</view>
-				<view class="component-shop-item flex" v-for="(item,index) of list" :key="index"
-					@click.stop="toDetail(item)">
-					<view class="img">
+				<view class="component-shop-item flex" v-for="(item,index) of list" :key="index">
+					<view class="img" @click.stop="toDetail(item)">
 						<image class="img img100" :src="item.cover" lazy-load>
 						</image>
 						<view class="level">
@@ -86,16 +90,16 @@
 					</view>
 
 					<view class="m-l-12 info-container flex1">
-						<view class="title">
+						<view class="title" @click.stop="toDetail(item)">
 							{{item.name}}
 							<view class="price">
 								¥{{item.price}}/扎
 							</view>
 						</view>
-						<view class="shop-name">
+						<view class="shop-name" @click.stop="toDetail(item)">
 							{{item.categoryStr}}
 						</view>
-						<view class="other-info flex">
+						<view class="other-info flex" @click.stop="toDetail(item)">
 							<view class="m-r-15">
 								已售:{{item.sales || 0}}
 							</view>
@@ -115,7 +119,8 @@
 							<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="updateItemNum(item)" v-if="item.shopnum&&item.shopnum>=1">
+								<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"
@@ -127,8 +132,9 @@
 
 			</view>
 
-			<view v-if="flg==='1'" class="brand-info-1">
-				<trade :hidefooter="true" :catgoryTree="catgoryTree" v-if="catgoryTree" ref="trade"></trade>
+			<view v-show="flg==='1'" class="brand-info-1">
+				<trade :hidefooter="true" :supplierId="id" :catgoryTree="catgoryTree" v-if="catgoryTree" ref="trade">
+				</trade>
 				<!-- // 构建一个分类树 -->
 				<!-- catgoryTree -->
 
@@ -184,29 +190,29 @@
 			</view>
 		</uni-popup>
 
-		<uni-popup ref="popup_level" type="bottom">
-			<view class="component-popup_input_all">
-				<view class="text-center m-b-40" style="font-size: 48rpx;font-weight: 600;">点击选择不同级别</view>
-				<view v-for="(item,i) in level_columns" :key="i" class="m-t-20">
-					<view class="m-t-12 flex value-items">
-						<view class="value-item" @click="()=>{
-							if(each.value!==query.value){
-								query.level = each.value
-								query.levelStr = each.label
-								refreshList('post')
-								$refs.popup_level.close()
-							}																																						
-						}" :class="[query.level==each.value?'cur':'']" v-for="(each, j) in item" :key="j">
-							{{ each.label || '-' }}
-						</view>
-					</view>
-				</view>
-				<view class="button-space"></view>
-				<view>
-					<view class="button-green" @click="$refs.popup_level.close()">关闭
-					</view>
-				</view>
-			</view>
+		<uni-popup ref="popup_level" type="bottom">
+			<view class="component-popup_input_all">
+				<view class="text-center m-b-40" style="font-size: 48rpx;font-weight: 600;">点击选择不同级别</view>
+				<view v-for="(item,i) in level_columns" :key="i" class="m-t-20">
+					<view class="m-t-12 flex value-items">
+						<view class="value-item" @click="()=>{
+							if(each.value!==query.value){
+								query.level = each.value
+								query.levelStr = each.label
+								refreshList('post')
+								$refs.popup_level.close()
+							}																																						
+						}" :class="[query.level==each.value?'cur':'']" v-for="(each, j) in item" :key="j">
+							{{ each.label || '-' }}
+						</view>
+					</view>
+				</view>
+				<view class="button-space"></view>
+				<view>
+					<view class="button-green" @click="$refs.popup_level.close()">关闭
+					</view>
+				</view>
+			</view>
 		</uni-popup>
 	</view>
 </template>
@@ -221,7 +227,7 @@
 		},
 		data() {
 			return {
-				search_flow: '',
+				// search_flow: '',
 				flg: '0',
 				tabs: [{
 						name: '全部商品'
@@ -245,6 +251,7 @@
 					column: '',
 					levelStr: '',
 					level: '',
+					name: '',
 				},
 				level_show: false,
 				level_columns: [
@@ -257,9 +264,13 @@
 				]
 			}
 		},
+		onShow() {
+			//避免商品数目不一样
+			this.refreshList('post')
+		},
 		onLoad(options) {
 			this.id = options.id || ''
-			// this.page.size =
+			this.page.size = 300
 			if (this.id) {
 				this.getDetail()
 			}
@@ -316,9 +327,9 @@
 		},
 		// #endif
 		onReachBottom() {
-			if (this.flg === '0') {
-				this.getMore('post')
-			}
+			// if (this.flg === '0') {
+			// 	this.getMore('post')
+			// }
 		},
 		methods: {
 
@@ -419,7 +430,8 @@
 
 			},
 			buttonSearchFlow() {
-
+				// this.query.name = this.search_flow || ''
+				this.refreshList('post')
 			},
 			async updateItemNum(item) {
 				const res = await this.$message.confirm('', {
@@ -494,6 +506,8 @@
 
 <style lang="scss" scoped>
 	.brand-detail {
+
+		// min-height: 99vh;
 		.brand-info {
 			background: #FFFFFF;
 			// border-radius: 40rpx 40rpx 0rpx 0rpx;
@@ -502,7 +516,7 @@
 			overflow: hidden;
 			overflow-y: scroll;
 			padding: 40rpx 32rpx;
-			height: calc(100vh - 650rpx);
+			height: calc(100vh - 450rpx);
 			padding-top: 0rpx;
 
 			.brand-info-0 {

--
Gitblit v1.9.3