From f837b731f571bb53cee99f9bc22a6f74855f3e6c Mon Sep 17 00:00:00 2001
From: xuxueyang <xuxy@fengyuntec.com>
Date: 星期一, 12 八月 2024 02:43:20 +0800
Subject: [PATCH] add 商品结算测试

---
 sub_pages/customer/shop/shop.vue |  193 +++++++++++++++++++++++++++++++++++++----------
 1 files changed, 150 insertions(+), 43 deletions(-)

diff --git a/sub_pages/customer/shop/shop.vue b/sub_pages/customer/shop/shop.vue
index c7f1e1d..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>
@@ -38,7 +30,7 @@
 			</view>
 			<view class="tj-info m-t-12">
 				<view class="form-item">
-					<view class="value">0</view>
+					<view class="value">{{page.total || 0}}</view>
 					<view class="label">发布</view>
 				</view>
 				<view class="form-item">
@@ -62,26 +54,34 @@
 		</view>
 		<view class="brand-info">
 			<view v-if="flg==='0'" class="brand-info-0">
-				<view class="component-filter-container" style="padding-top: 12rpx;">
-					<!-- <view class="flex1">
-						排序
-						<image src="../../../static/common/icon-arrow-down.png" class="icon-arrow-down"></image>
+				<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 class="flex1">
-						等级
-						<image src="../../../static/common/icon-arrow-down.png" class="icon-arrow-down"></image>
-					</view>
-					<view class="flex1">
-						参数
-						<image src="../../../static/common/icon-arrow-down.png" class="icon-arrow-down"></image>
-					</view> -->
 				</view>
-				<view class="top-title">
+				<view class="component-filter-container" style="padding-top: 12rpx;">
+					<view class="flex1" @click.stop="$refs.popup_column.open()">
+						排序{{ query.columnStr&&('-'+query.columnStr) || '' }}
+						<image src="../../../static/common/icon-arrow-down.png" class="icon-arrow-down"></image>
+					</view>
+					<view class="flex1" @click.stop="$refs.popup_level.open()">
+						{{ query.levelStr || '级别' }}
+						<image src="../../../static/common/icon-arrow-down.png" class="icon-arrow-down"></image>
+					</view>
+				</view>
+				<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">
@@ -90,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>
@@ -112,14 +112,15 @@
 						</view>
 						<view class="bottom-buttons  flex">
 							<view class="m-l-0 m-r-a">
-								<view class="m-r-15">
+								<view class="m-r-15 desc-gray other-info">
 									颜色:{{item.color||'-'}}
 								</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="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"
@@ -131,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 -->
 
@@ -157,10 +159,61 @@
 					<view class="label">身份认证</view>
 					<view class="value">{{dto.idcardTypeStr||'未认证'}}</view>
 				</view>
+				<!-- 	<view class="form-input flex">
+					<view class="label">&nbsp;&nbsp;</view>
+					<view class="value">{{'已实名'}}</view>
+				</view> -->
 			</view>
 		</view>
+		<uni-popup ref="popup_column" 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 order_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.column = each.value
+								query.columnStr = each.label
+								refreshList('post')
+								$refs.popup_column.close()
+							}																																						
+						}" :class="[query.column==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_column.close()">关闭
+					</view>
+				</view>
+			</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>
 	</view>
 </template>
 
@@ -174,7 +227,7 @@
 		},
 		data() {
 			return {
-				search_flow: '',
+				// search_flow: '',
 				flg: '0',
 				tabs: [{
 						name: '全部商品'
@@ -193,22 +246,67 @@
 				list: [],
 				id: '',
 				catgoryTree: undefined,
+				query: {
+					columnStr: '',
+					column: '',
+					levelStr: '',
+					level: '',
+					name: '',
+				},
+				level_show: false,
+				level_columns: [
+					[]
+				],
+
+				order_show: false,
+				order_columns: [
+					[]
+				]
 			}
+		},
+		onShow() {
+			//避免商品数目不一样
+			this.refreshList('post')
 		},
 		onLoad(options) {
 			this.id = options.id || ''
-			// this.page.size =
+			this.page.size = 300
 			if (this.id) {
 				this.getDetail()
 			}
 			this.listApi = `/api/customer/flower/list`
 			this.query.supplierId = this.id
 			this.getList('post')
+			this.$http.request('get', '/api/code/value', {
+				params: {
+					type: 'FLOWER_LEVEL'
+				}
+			}).then(res => {
+				var data = res.data
+				this.level_columns = [data || []]
+				this.level_columns[0].unshift({
+					label: '全部',
+					value: ''
+				})
+			})
+			this.$http.request('get', '/api/code/value', {
+				params: {
+					type: 'FLOWER_ORDER_BY'
+				}
+			}).then(res => {
+				var data = res.data
+				this.order_columns = [data || []]
+				this.order_columns[0].unshift({
+					label: '默认',
+					value: ''
+				})
+			})
 		},
 		// #ifdef PUB_CUSTOMER
 		onShareAppMessage() {
 			let that = this;
-			var name = that.currentInfo.customerDTO&&that.currentInfo.customerDTO.name || that.currentInfo.supplierDTO&&that.currentInfo.supplierDTO.name || that.currentInfo.partnerDTO&&that.currentInfo.partnerDTO.name || ''
+			var name = that.currentInfo.customerDTO && that.currentInfo.customerDTO.name || that.currentInfo.supplierDTO &&
+				that.currentInfo.supplierDTO.name || that.currentInfo.partnerDTO && that.currentInfo.partnerDTO.name || ''
 			var url =
 				`/sub_pages/customer/shop/shop?id=${this.id}&shareId=${this.currentInfo&&this.currentInfo.id||''}&shareName=${name||''}`; //你的转发页面路径拼接参数
 			return {
@@ -218,7 +316,8 @@
 		},
 		onShareTimeline() {
 			let that = this;
-			var name = that.currentInfo.customerDTO&&that.currentInfo.customerDTO.name || that.currentInfo.supplierDTO&&that.currentInfo.supplierDTO.name || that.currentInfo.partnerDTO&&that.currentInfo.partnerDTO.name || ''
+			var name = that.currentInfo.customerDTO && that.currentInfo.customerDTO.name || that.currentInfo.supplierDTO &&
+				that.currentInfo.supplierDTO.name || that.currentInfo.partnerDTO && that.currentInfo.partnerDTO.name || ''
 			var url =
 				`/sub_pages/customer/shop/shop?id=${this.id}&shareId=${this.currentInfo&&this.currentInfo.id||''}&shareName=${name||''}`; //你的转发页面路径拼接参数
 			return {
@@ -228,9 +327,9 @@
 		},
 		// #endif
 		onReachBottom() {
-			if (this.flg === '0') {
-				this.getMore('post')
-			}
+			// if (this.flg === '0') {
+			// 	this.getMore('post')
+			// }
 		},
 		methods: {
 
@@ -331,7 +430,8 @@
 
 			},
 			buttonSearchFlow() {
-
+				// this.query.name = this.search_flow || ''
+				this.refreshList('post')
 			},
 			async updateItemNum(item) {
 				const res = await this.$message.confirm('', {
@@ -395,12 +495,19 @@
 				}
 			},
 
+			toDetail(item) {
+				uni.navigateTo({
+					url: `/sub_pages/customer/trade/detail?id=${item.id}`
+				})
+			},
 		}
 	}
 </script>
 
 <style lang="scss" scoped>
 	.brand-detail {
+
+		// min-height: 99vh;
 		.brand-info {
 			background: #FFFFFF;
 			// border-radius: 40rpx 40rpx 0rpx 0rpx;
@@ -409,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