瀏覽代碼

提交代码2025年4.14

xjg 1 月之前
父節點
當前提交
0f02a7e393

+ 9 - 3
mer_uniapp/components/merHome/index.vue

@@ -31,9 +31,10 @@
 			<text v-if="!merchantInfoNew.isCollect" class="iconfont icon-guanzhu"></text>
 			{{ merchantInfoNew.isCollect ? '已关注' : '关注' }}
 		</button>
-		<navigator v-if="!isShowTypeId" :url="`/pages/merchant/${type}/index?merId=${merId}`" hover-class="none">
-			<button class="merCollect" hover-class="none">进店</button>
-		</navigator>
+		<!-- :url="`/pages/merchant/${type}/index?merId=${merId}`" -->
+		<!-- <navigator v-if="!isShowTypeId" :url="`/pages/goods_cate/index?id=${merId}`" hover-class="none"> -->
+			<button @click="getshopp" class="merCollect" hover-class="none">进店</button>
+		<!-- </navigator> -->
 	</view>
 </template>
 
@@ -145,6 +146,11 @@
 			this.getnoStarLevel()
 		},
 		methods: {
+			getshopp(){
+				uni.reLaunch({
+					url:`/pages/goods_cate/index?id=${this.merId}`
+				})
+			},
 			getnoStarLevel: function(nVal, oVal) {
 				if (parseInt(this.merchantInfoNew.starLevel) < 5) this.noStarLevel = 5 - parseInt(this.merchantInfoNew
 					.starLevel);

+ 10 - 1
mer_uniapp/pages.json

@@ -992,7 +992,16 @@
 						// #endif
 					}
 				}
-			]
+			    ,{
+                    "path" : "index-bak/index-bak",
+                    "style" :                                                                                    
+                {
+                    "navigationBarTitleText": "",
+                    "enablePullDownRefresh": false
+                }
+                
+                }
+            ]
 		},
 		{
 			"root": "pages/address",

File diff suppressed because it is too large
+ 3241 - 0
mer_uniapp/pages/goods/goods_details/index-bak.vue


+ 41 - 32
mer_uniapp/pages/goods/goods_details/index.vue

@@ -310,30 +310,31 @@
 							</block>
 						</view>
 					</view>
-					<!-- 店铺 -->
-					<view class="borderPad" v-if="
-              productType !== ProductTypeEnum.Integral &&
-              marketingType !== ProductMarketingTypeEnum.Groupbuying
-            ">
-						<view class="superior borRadius14" v-if="merchantInfo">
-							<merHome :merchantInfo="merchantInfo" :merId="productInfo.merId" type="home"
-								:isShowTypeId="isShowTypeId" v-if="merchantInfo"></merHome>
-							<view class="slider-banner banner">
-								<view class="list acea-row row-middle">
-									<view class="item" v-for="(val, indexw) in merchantInfo.proList" :key="indexw"
-										@click="goDetail(val.id)">
-										<view class="pictrue relative">
-											<view v-show="val.stock===0" class="sellOut">已售罄</view>
-											<easy-loadimage mode="widthFix" :image-src="val.image"></easy-loadimage>
+					<!-- 店铺 判断一下是首页进来就显示店铺 详情进来不显示 0不显示 -->
+					<block v-if="iSshop==1">
+						<view class="borderPad" v-if="
+					  productType !== ProductTypeEnum.Integral &&
+					  marketingType !== ProductMarketingTypeEnum.Groupbuying
+					">
+								<view class="superior borRadius14" v-if="merchantInfo">
+									<merHome :merchantInfo="merchantInfo" :merId="productInfo.merId" type="home"
+										:isShowTypeId="isShowTypeId" v-if="merchantInfo"></merHome>
+									<view class="slider-banner banner">
+										<view class="list acea-row row-middle">
+											<view class="item" v-for="(val, indexw) in merchantInfo.proList" :key="indexw"
+												@click="goDetail(val.id)">
+												<view class="pictrue relative">
+													<view v-show="val.stock===0" class="sellOut">已售罄</view>
+													<easy-loadimage mode="widthFix" :image-src="val.image"></easy-loadimage>
+												</view>
+												<view class="name line1">{{ val.name }}</view>
+												<view class="money theme_price">¥{{ val.price }}</view>
+											</view>
 										</view>
-										<view class="name line1">{{ val.name }}</view>
-										<view class="money theme_price">¥{{ val.price }}</view>
 									</view>
 								</view>
 							</view>
-						</view>
-					</view>
-
+					</block>
 					<!-- 产品详情 -->
 					<view class="product-intro detailText" id="past2">
 						<view class="title">
@@ -363,10 +364,10 @@
 					<view class="iconfont icon-kefu"></view>
 					<view>客服</view>
 				</button>
-				<button open-type="contact" hover-class="none" class="item tui-skeleton-rect" v-else>
+			<!-- 	<button open-type="contact" hover-class="none" class="item tui-skeleton-rect" v-else>
 					<view class="iconfont icon-kefu"></view>
 					<view>客服</view>
-				</button>
+				</button> -->
 				<!-- #endif -->
 				<!-- #ifndef MP -->
 				<view class="item tui-skeleton-rect" @click="kefuClick">
@@ -374,14 +375,14 @@
 					<view>客服</view>
 				</view>
 				<!-- #endif -->
-				<navigator v-show="productType !== ProductTypeEnum.Integral"
+				<!-- <navigator v-show="productType !== ProductTypeEnum.Integral"
 					:url="`/pages/merchant/home/index?merId=${productInfo.merId}`" hover-class="none">
 					<view class="item tui-skeleton-rect">
 						<view class="iconfont icon-dianpu1"></view>
 						<view>店铺</view>
 					</view>
-				</navigator>
-				<navigator v-show="productType !== ProductTypeEnum.Integral" open-type="switchTab"
+				</navigator> -->
+			<!-- 	<navigator v-show="productType !== ProductTypeEnum.Integral" open-type="switchTab"
 					class="animated item tui-skeleton-rect" :class="animated == true ? 'bounceIn' : ''"
 					url="/pages/order_addcart/order_addcart" hover-class="none">
 					<view class="iconfont icon-gouwuche1">
@@ -390,7 +391,7 @@
               }}</text>
 					</view>
 					<view>购物车</view>
-				</navigator>
+				</navigator> -->
 				<!-- 普通商品 -->
 				<block v-if="marketingType === ProductMarketingTypeEnum.Normal">
 					<view class="bnt acea-row" v-if="attr.productSelect.stock <= 0">
@@ -406,12 +407,12 @@
 						<!-- 正常商品 -->
 						<block v-if="productType === ProductTypeEnum.Normal">
 							<form v-show="productInfo.systemFormId == 0" @submit="joinCart" report-submit="true">
-								<button class="joinCart bnts" form-type="submit">
+							<!-- 	<button class="joinCart bnts" form-type="submit">
 									加入购物车
-								</button>
+								</button> -->
 							</form>
 							<form @submit="goBuy" report-submit="true">
-								<button :class="productInfo.systemFormId == 0 ? 'bnts' : 'longBnts'" class="buy"
+								<button style="border-radius: 0;" :class="productInfo.systemFormId == 0 ? 'bnts' : 'longBnts'" class="buy"
 									form-type="submit">
 									立即购买
 								</button>
@@ -927,7 +928,9 @@
 				buyLimitNum: "",
 				groupRecordId: 0,
 				isPink: 0,
-				skuImage: [] //规格小图
+				skuImage: [] ,//规格小图
+				
+				iSshop:0,//判断是否显示店铺
 			};
 		},
 		computed: {
@@ -997,7 +1000,8 @@
 		onLoad(options) {
 			//获取浏览器传来的对象
 			this.options = options;
-
+			console.log(this.options)
+			this.iSshop=this.options.iSshop  //判断显示店铺
 			//获取浏览器秒杀状态、秒杀时间
 			if (options.status) this.seckillStatus = Number(options.status); //秒杀状态
 			if (options.datatime) this.seckillTime = Number(options.datatime); //秒杀时间
@@ -1050,7 +1054,10 @@
 				query
 					.select("#home")
 					.boundingClientRect((data) => {
-						this.homeTop = menuButton.top * 2 + menuButton.height - data.height;
+						   // 加强判断 data 是否有效并且包含 height
+						const homeHeight = (data && data.height) ? data.height : 0;  // 如果 data 存在且有 height,则使用 height,否则使用 0
+						this.homeTop = menuButton.top * 2 + menuButton.height - homeHeight;
+						// this.homeTop = menuButton.top * 2 + menuButton.height - data.height;
 					})
 					.exec();
 				// #endif
@@ -2944,6 +2951,8 @@
 		width: 100%;
 		box-sizing: border-box;
 		background-color: #fff;
+		display: flex;
+		justify-content: flex-end;
 		z-index: 277;
 		border-top: 1rpx solid #f0f0f0;
 		height: 100rpx;

+ 918 - 0
mer_uniapp/pages/goods/goods_list/index-bak.vue

@@ -0,0 +1,918 @@
+<template>
+	<view :data-theme="theme">
+		<view class='productList'>
+			<view class='search bg_color acea-row row-between-wrapper'>
+				<!-- #ifdef H5 -->
+				<view class="iconfont icon-xiangzuo" @click="goback()"></view>
+				<!-- #endif -->
+				<view :class="tabIndex !== 2?'searchIpt':''" class='input acea-row row-middle'><text
+						class='iconfont icon-sousuo mr20'></text>
+					<input :placeholder="tabIndex===1?'搜索商品名称':'搜索店铺名称'" placeholder-class='placeholder'
+						confirm-type='search' name="search" v-model="keyword" @confirm="searchSubmit"
+						maxlength="20"></input>
+				</view>
+				<view v-if="tabIndex === 2" class='iconfont icon-shaixuan' @click='open(2)'></view>
+			</view>
+			<view class="nav-wrapper mr-20px" v-if="merId===0 && cid === 0">
+				<view class="tab-bar" :class="{'merTab':tabIndex===2}">
+					<view class="tab-item" :class="{on:tabIndex===1}" @click="changetab(1)">商品</view>
+					<view class="tab-item" :class="{on:tabIndex===2}" @click="changetab(2)">店铺</view>
+				</view>
+			</view>
+			<view v-if="tabIndex===1" class='nav acea-row row-middle' :class="(merId > 0 || cid > 0) ? 'mer-nav' : ''">
+				<view class='item' :class='title ? "font_color":""' @click='set_where(1,tabIndex)'>
+					{{title ? title:'默认'}}
+				</view>
+				<view class='item' @click='set_where(2,tabIndex)'>
+					价格
+					<image v-if="price==1" :src='upPng'></image>
+					<image v-else-if="price==2" :src='downPng'></image>
+					<image v-else :src="urlDomain+'crmebimage/presets/horn.png'"></image>
+				</view>
+				<view class='item-c item' @click='set_where(3,tabIndex)'>
+					销量
+					<image v-if="stock==1" :src='upPng'></image>
+					<image v-else-if="stock==2" :src='downPng'></image>
+					<image v-else :src="urlDomain+'crmebimage/presets/horn.png'"></image>
+				</view>
+				<!-- down -->
+				<view class="item-shu"></view>
+				<view class='item-icon iconfont' :class="is_switch?'icon-pailie':'icon-tupianpailie'" @click='Changswitch()'>
+				</view>
+			</view>
+			<view v-if="tabIndex===1" :class="is_switch==true?'proList':'listBox'">
+				<view :class="[(merId > 0 || cid > 0) ? 'mer-listBox' : '']" v-if="productList.length>0">
+					<view v-if="!is_switch" class='list acea-row row-between-wrapper'
+						:class="[is_switch==true ? '' : 'on', (merId > 0 || cid > 0) ? 'mer-list' : ''] ">
+						<view class='item' :class='is_switch==true?"":"on"' hover-class='none'
+							v-for="(item,index) in productList" :key="index" @click="godDetail(item)">
+							<view class='pictrue' :class='is_switch==true?"":"on"'>
+								<view v-show="item.stock===0" class="sellOut">已售罄</view>
+								<easy-loadimage :image-src="item.image" :class='is_switch==true?"":"on"'>
+								</easy-loadimage>
+								<span class="pictrue_log_class"
+									:class="is_switch === true ? 'pictrue_log_big' : 'pictrue_log'"
+									v-if="item.activityH5 && item.activityH5.type === '1'">秒杀</span>
+								<span class="pictrue_log_class"
+									:class="is_switch === true ? 'pictrue_log_big' : 'pictrue_log'"
+									v-if="item.activityH5 && item.activityH5.type === '2'">砍价</span>
+								<span class="pictrue_log_class"
+									:class="is_switch === true ? 'pictrue_log_big' : 'pictrue_log'"
+									v-if="item.activityH5 && item.activityH5.type === '3'">拼团</span>
+							</view>
+							<view class='text' :class='is_switch==true?"":"on"'>
+								<view class='name box-line2 mb-10'>
+									<span v-if="item.productTags && item.productTags.locationLeftTitle.length"
+										class="font-bg-red mr10 merType bg-color">{{item.productTags.locationLeftTitle[0].tagName}}</span>
+									{{item.name}}
+								</view>
+								<!-- 价格 -->
+								<svip-price :svipIconStyle="svipIconStyle" :productPrice="item"
+									:svipPriceStyle="svipPriceStyle"></svip-price>
+								<view v-if="item.productTags && item.productTags.locationUnderTitle.length">
+									<text
+										v-for="items in item.productTags.locationUnderTitle.length>3?item.productTags.locationUnderTitle.slice(0,3):item.productTags.locationUnderTitle"
+										class="mr10 tagSolid">{{items.tagName}}</text>
+								</view>
+								<view class='vip acea-row row-between-wrapper mt-10 mb-10' :class='is_switch==true?"":"on"'>
+									<view>已售{{item.sales}}{{item.unitName}}</view>
+								</view>
+								<view v-if="item.merName" class="company" @click.stop="goStore(item.merId)">
+									<text class='name line1'>{{item.merName}}</text>
+									<view class="flex">
+										进店
+										<text class="iconfont icon-xiangyou"></text>
+									</view>
+								</view>
+							</view>
+
+						</view>
+					</view>
+					<view v-else class="goods">
+						<WaterfallsFlow :wfList='productList' :type="1">
+							<template slot-scope="{item}">
+								<WaterfallsFlowItem :item="item" :type="1" :isStore="1" />
+							</template>
+						</WaterfallsFlow>
+					</view>
+				</view>
+				<view class='loadingicon acea-row row-center-wrapper'>
+					<text class='loading iconfont icon-jiazai'
+						:hidden='loading==false'></text>{{productList.length>0?loadTitle:''}}
+				</view>
+			</view>
+			<view class="merList" v-if="tabIndex == 2">
+				<view v-if="merchantList.length===0" style="background-color: #F5F5F5;" class='nav acea-row row-middle'
+					:class="(merId > 0 || cid > 0) ? 'mer-nav' : ''">
+				</view>
+				<merchant-list :merchantList="merchantList"></merchant-list>
+				<view class='loadingicon acea-row row-center-wrapper'>
+					<text class='loading iconfont icon-jiazai' :hidden='loading==false'></text>
+				</view>
+			</view>
+		</view>
+		<view class='noCommodity' :class="{'mer-mt194': tabIndex ==2, 'mer-mt100':  cid !== 0}"
+			:style="{'top':!is_switch?'-110rpx':''}"
+			v-if="(productList.length==0 && isShow && tabIndex===1 && !loading )  || (merchantList.length==0 && isShow && tabIndex===2 && !loading)">
+			<view class='pictrue'>
+				<image :src="urlDomain+'crmebimage/presets/noSearch.png'"></image>
+			</view>
+			<text class="text-ccc">{{tabIndex===1?'暂无商品~':'暂无店铺~'}}</text>
+			<recommend v-if="!merId" ref="recommendIndex" class="mt-40"></recommend>
+		</view>
+
+		<tui-drawer mode="right" :visible="rightDrawer" @close="closeDrawer">
+			<merSeach :whereMer="whereMer" @close="closeDrawer" @confirm="confirm"></merSeach>
+		</tui-drawer>
+	</view>
+</template>
+
+<script>
+	// +----------------------------------------------------------------------
+	// | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
+	// +----------------------------------------------------------------------
+	// | Copyright (c) 2016~2025 https://www.crmeb.com All rights reserved.
+	// +----------------------------------------------------------------------
+	// | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
+	// +----------------------------------------------------------------------
+	// | Author: CRMEB Team <admin@crmeb.com>
+	// +----------------------------------------------------------------------
+	import {
+		productList
+	} from '@/api/product.js';
+	import {
+		getMerSearchApi,
+		getMerProListApi
+	} from '@/api/merchant.js';
+	import {
+		mapGetters
+	} from "vuex";
+	import {
+    goProductDetail
+	} from '@/libs/order.js'
+	import merSeach from '../components/merSeach/index.vue'
+	import merchantList from '@/components/merchantList/index.vue'
+	import WaterfallsFlow from '@/components/WaterfallsFlow/WaterfallsFlow.vue'
+	import tuiDrawer from '../components/tui-drawer/index.vue'
+	import recommend from "@/components/base/recommend.vue";
+	import easyLoadimage from '@/components/base/easy-loadimage.vue';
+	import WaterfallsFlowItem from '@/components/WaterfallsFlowItem/WaterfallsFlowItem.vue'
+	import svipPrice from '@/components/svipPrice.vue';
+	let app = getApp();
+	export default {
+		computed: mapGetters(['uid']),
+		components: {
+			merchantList,
+			merSeach,
+			WaterfallsFlow,
+			tuiDrawer,
+			recommend,
+			easyLoadimage,
+			WaterfallsFlowItem,
+			svipPrice
+		},
+		mounted() {
+			this.$store.dispatch('MerCategoryList');
+			this.$store.dispatch('MerTypeList');
+		},
+		data() {
+			return {
+				//普通价格
+				svipPriceStyle: {
+					svipBox: {
+						height: '26rpx',
+						borderRadius: '60rpx 56rpx 56rpx 20rpx',
+					},
+					icon: {
+						height: '26rpx',
+						fontSize: '18rpx',
+						borderRadius: '12rpx 0 12rpx 2rpx'
+					},
+					price: {
+						fontSize: '38rpx'
+					},
+					svipPrice: {
+						fontSize: '22rpx'
+					}
+				},
+				//svip价格
+				svipIconStyle: {
+					svipBox: {
+						height: '26rpx',
+						borderRadius: '24rpx 40rpx 40rpx 0.4rpx',
+					},
+					price: {
+						fontSize: '38rpx'
+					},
+					svipPrice: {
+						fontSize: '18rpx'
+					}
+				},
+				urlDomain: this.$Cache.get("imgHost"),
+				keyword: '',
+				drawers: 0,
+				tabIndex: 1,
+				productList: [],
+				is_switch: true,
+				where: {
+					keyword: '',
+					priceOrder: '',
+					salesOrder: '',
+					//news: 0,
+					page: 1,
+					limit: 20,
+					cid: '', //商城使用
+					merId: '',
+					cids: '' //商户使用
+				},
+				cid: 0, //分类id
+				price: 0,
+				stock: 0,
+				nows: false,
+				loadend: false,
+				loading: false,
+				loadTitle: '加载更多',
+				title: '',
+				theme: app.globalData.theme,
+				upPng: '',
+				downPng: '',
+				whereMer: {
+					categoryIds: '',
+					isSelf: '',
+					keywords: '',
+					page: 1,
+					limit: 20,
+					typeIds: ''
+				},
+				rightDrawer: false,
+				merchantList: [],
+				merId: 0,
+				goodScroll: true,
+				isShow: false
+			};
+		},
+		// 滚动监听
+		onPageScroll(e) {
+			// 传入scrollTop值并触发所有easy-loadimage组件下的滚动监听事件
+			uni.$emit('scroll');
+		},
+		onLoad: function(options) {
+			this.downPng = `${this.urlDomain}crmebimage/presets/down_red.png`;
+			this.upPng = `${this.urlDomain}crmebimage/presets/up_red.png`;
+			this.merId = options.merId ? Number(options.merId) : 0;
+			this.$set(this, 'cid', Number(options.cid) || 0);
+			this.title = options.title || '';
+			this.$set(this, 'keyword', options.searchValue || '');
+			if (this.tabIndex === 1) this.get_product_list();
+			switch (this.theme) {
+				case 'theme2':
+					this.upPng = `${this.urlDomain}crmebimage/presets/up_orange.png`;
+					this.downPng = `${this.urlDomain}crmebimage/presets/down_orange.png`;
+					break;
+				case 'theme3':
+					this.upPng = `${this.urlDomain}crmebimage/presets/up_green.png`;
+					this.downPng = `${this.urlDomain}crmebimage/presets/down_green.png`;
+					break;
+				case 'theme4':
+					this.upPng = `${this.urlDomain}crmebimage/presets/up_blue.png`;
+					this.downPng = `${this.urlDomain}crmebimage/presets/down_blue.png`;
+					break;
+				case 'theme5':
+					this.upPng = `${this.urlDomain}crmebimage/presets/up_pink.png`;
+					this.downPng = `${this.urlDomain}crmebimage/presets/down_pink.png`;
+					break;
+				default:
+					this.upPng = `${this.urlDomain}crmebimage/presets/up_red.png`;
+					this.downPng = `${this.urlDomain}crmebimage/presets/down_red.png`;
+					break;
+			}
+		},
+		methods: {
+			goStore(id) {
+				uni.navigateTo({
+					url: `/pages/merchant/home/index?merId=${id}`
+				})
+			},
+			confirm(data) {
+				this.whereMer.typeIds = data.typeId;
+				this.whereMer.categoryIds = data.categoryId;
+				this.whereMer.keywords = this.where.keyword;
+				this.loadend = false;
+				this.$set(this.whereMer, 'page', 1)
+				this.merchantList = [];
+				this.rightDrawer = false
+				this.getMerStreet();
+			},
+			changetab(n) {
+				this.tabIndex = n;
+				this.nows = 1;
+				this.stock = 0;
+				this.loadend = false;
+				this.loading = false;
+				if (n === 2) {
+					this.merchantList = [];
+					this.$set(this.whereMer, 'page', 1);
+					this.getMerStreet();
+					this.title = '';
+				} else {
+					this.whereMer.typeIds = '';
+					this.whereMer.categoryIds = '';
+					this.productList = [];
+					this.$set(this.where, 'page', 1);
+					this.get_product_list();
+				}
+			},
+			open(n) {
+				if (this.tabIndex === 2) {
+					this.rightDrawer = true;
+					this.drawers = n;
+				}
+			},
+			closeDrawer(e) {
+				this.rightDrawer = false
+				if (!e) {
+					this.rightDrawer = false
+				}
+			},
+			goback() {
+				// #ifdef H5
+				return history.back();
+				// #endif
+				// #ifndef H5
+				return uni.navigateBack({
+					delta: 1,
+				})
+				// #endif
+			},
+			getMerStreet: function(isPage) {
+				this.skeletonShow = true
+				let that = this;
+				that.setWhere();
+				if (that.loadend) return;
+				if (that.loading) return;
+				that.loading = true;
+				if (isPage === true) that.$set(that, 'merchantList', []);
+				that.loadTitle = '';
+				that.whereMer.keywords = encodeURIComponent(that.keyword);
+				getMerSearchApi(that.whereMer).then(res => {
+					let list = res.data.list;
+					let merchantList = that.$util.SplitArray(list, that.merchantList);
+					let loadend = list.length < that.whereMer.limit;
+					that.loadend = loadend;
+					that.loadTitle = loadend ? '没有了' : '加载更多';
+					that.$set(that, 'merchantList', merchantList);
+					that.$set(that.whereMer, 'page', that.whereMer.page + 1);
+					that.loading = false;
+					this.skeletonShow = false;
+					this.isShow = true
+				}).catch(err => {
+					that.loading = false;
+					that.goodScroll = false;
+					that.loadTitle = '加载更多';
+				});
+			},
+			// 去详情页
+			godDetail(item) {
+        goProductDetail(item.id, 0,'');
+			},
+			Changswitch: function() {
+				let that = this;
+				that.is_switch = !that.is_switch
+			},
+			searchSubmit: function(e) {
+				let that = this;
+				that.loadend = false;
+				that.$set(that, 'keyword', e.detail.value || '');
+				if (that.tabIndex === 1) {
+					that.$set(that.where, 'page', 1)
+					this.get_product_list(true);
+				} else {
+					that.$set(that, 'merchantList', []);
+					this.$set(this.whereMer, 'page', 1)
+					this.getMerStreet();
+				}
+			},
+			//点击事件处理
+			set_where: function(e, n) {
+				switch (e) {
+					case 1:
+						this.price = 0;
+						this.stock = 0;
+						break;
+					case 2:
+						if (this.price == 0) this.price = 1;
+						else if (this.price == 1) this.price = 2;
+						else if (this.price == 2) this.price = 0;
+						this.stock = 0;
+						break;
+					case 3:
+						if (this.stock == 0) this.stock = 1;
+						else if (this.stock == 1) this.stock = 2;
+						else if (this.stock == 2) this.stock = 0;
+						this.price = 0
+						break;
+					case 4:
+						this.price = 0;
+						this.stock = 0;
+						break;
+				}
+				if (n === 1) {
+					this.loadend = false;
+					this.$set(this.where, 'page', 1);
+					this.get_product_list(true);
+				} else {
+					this.nows = 1;
+				}
+			},
+			//设置where条件
+			setWhere: function() {
+				if (this.price == 0) this.where.priceOrder = '';
+				else if (this.price == 1) this.where.priceOrder = 'asc';
+				else if (this.price == 2) this.where.priceOrder = 'desc';
+				if (this.stock == 0) this.where.salesOrder = '';
+				else if (this.stock == 1) this.where.salesOrder = 'asc';
+				else if (this.stock == 2) this.where.salesOrder = 'desc';
+				//this.where.news = this.nows ? 1 : 0;
+			},
+			//查找产品
+			get_product_list: function(isPage) {
+				let that = this;
+				that.setWhere();
+				if (that.loadend) return;
+				if (that.loading) return;
+				if (isPage === true) that.$set(that, 'productList', []);
+				that.loading = true;
+				that.loadTitle = '';
+				if (this.merId > 0) that.where.merId = that.merId
+				that.where.keyword = encodeURIComponent(that.keyword);
+				if (that.cid === 0) {
+					that.where.cid = '';
+					that.where.cids = '';
+				} else {
+					if (this.merId > 0){
+						that.where.cids = that.cid
+						that.where.cid = '';
+					}else{
+						that.where.cid = that.cid;
+						that.where.cids = ''
+					}
+					
+				}
+				this.merId === 0 ? productList(that.where).then(res => {
+					let list = res.data.list;
+					let productList = that.$util.SplitArray(list, that.productList);
+					let loadend = list.length < that.where.limit;
+					that.loadend = loadend;
+					that.loading = false;
+					that.loadTitle = loadend ? '已全部加载' : '加载更多';
+					that.$set(that, 'productList', productList);
+					that.$set(that.where, 'page', that.where.page + 1);
+					this.isShow = true
+				}).catch(err => {
+					that.loading = false;
+					that.loadTitle = '加载更多'
+				}) : getMerProListApi(that.where).then(res => {
+					let list = res.data.list;
+					let productList = that.$util.SplitArray(list, that.productList);
+					let loadend = list.length < that.where.limit;
+					that.loadend = loadend;
+					that.loading = false;
+					that.loadTitle = loadend ? '已全部加载' : '加载更多';
+					that.$set(that, 'productList', productList);
+					that.$set(that.where, 'page', that.where.page + 1);
+					this.isShow = true
+				}).catch(err => {
+					that.loading = false;
+					that.loadTitle = '加载更多'
+				})
+			},
+		},
+		onReachBottom() {
+			if(this.tabIndex === 2){
+				this.getMerStreet();
+			}
+			if (this.productList.length > 0) {
+				this.get_product_list();
+			}
+			if ((this.productList.length == 0 && this.isShow && this.tabIndex === 1 && !this.loading) || (this.merchantList
+					.length == 0 && this.isShow && this.tabIndex === 2 && !this.loading)) {
+				this.$refs.recommendIndex.get_host_product();
+			}
+		}
+	}
+</script>
+<style>
+	body {
+		height: auto !important;
+	}
+</style>
+<style scoped lang="scss">
+	.mt80 {
+		margin-top: 80rpx;
+	}
+
+	.searchIpt {
+		/* #ifdef H5 */
+		width: 91% !important;
+		/* #endif */
+		/* #ifndef H5 */
+		width: 100% !important;
+		/* #endif */
+	}
+
+	.store-item .merTab {
+		height: auto !important;
+
+		.tab-item {
+			margin-top: 8rpx !important;
+		}
+	}
+
+	.text-ccc {
+		text-align: center;
+		display: block;
+	}
+
+	.company {
+		display: flex;
+		align-items: center;
+		color: #737373 !important;
+		font-size: 26rpx;
+
+		.name {
+			display: inline-block;
+			// width: 120rpx;
+			height: auto !important;
+			overflow: hidden;
+			white-space: nowrap;
+			text-overflow: ellipsis;
+		}
+
+		.flex {
+			display: flex;
+			align-items: center;
+			margin-left: 10rpx;
+			color: #282828 !important;
+			width: 100rpx;
+
+			.iconfont {
+				font-size: 16rpx;
+				margin-top: 4rpx;
+			}
+		}
+	}
+
+	.icon-xiangzuo {
+		color: #fff;
+	}
+
+	.goods {
+		display: flex;
+		flex-wrap: wrap;
+		justify-content: space-between;
+		padding-left: 24rpx;
+		background-color: #F5F5F5;
+		width: 100%;
+	}
+
+	.proList {
+		margin-top: 256rpx;
+	}
+
+	.merList {
+		position: relative;
+		top: 154rpx;
+		z-index: 66;
+	}
+
+	.merBox {
+		/deep/.tui-drawer-container {
+			width: 635rpx;
+		}
+	}
+
+	.mer {
+		&-nav {
+			top: 80rpx !important;
+			border-radius: inherit !important;
+		}
+
+		&-list {
+			margin-top: 248rpx !important;
+		}
+
+		&-listBox {
+			position: relative;
+			top: -68rpx;
+		}
+
+		&-mt194 {
+			margin-top: 260rpx !important;
+		}
+
+		&-mt100 {
+			top: -200rpx !important;
+		}
+	}
+
+	.no-shop {
+		margin-top: 6rpx;
+		background-color: #fff;
+		padding-bottom: calc(100% - 109rpx);
+
+		.pictrue {
+			display: flex;
+			flex-direction: column;
+			align-items: center;
+
+			//color: $uni-nothing-text;
+			image {
+				width: 414rpx;
+				height: 380rpx;
+			}
+		}
+	}
+
+	.with50 {
+		width: 50% !important;
+	}
+
+	.nav-wrapper {
+		z-index: 9;
+		position: fixed;
+		left: 0;
+		top: 86rpx;
+		width: 100%;
+		@include main_bg_color(theme);
+
+		.tab-bar {
+			display: flex;
+			align-items: center;
+			height: 131rpx;
+
+			.tab-item {
+				position: relative;
+				flex: 1;
+				display: flex;
+				justify-content: center;
+				align-items: center;
+				padding-bottom: 40rpx;
+				color: #fff;
+				font-size: 28rpx;
+				font-weight: bold;
+				margin-top: -36rpx;
+
+				&::after {
+					content: ' ';
+					position: absolute;
+					left: 50%;
+					bottom: 34rpx;
+					width: 60rpx;
+					height: 3rpx;
+					background: transparent;
+					transform: translateX(-50%);
+				}
+
+				&.on {
+					&::after {
+						background: #fff;
+					}
+				}
+			}
+		}
+	}
+
+	.bg_color {
+		@include main_bg_color(theme);
+	}
+
+	.font_color {
+		@include main_color(theme);
+	}
+
+	.x-money {
+		font-size: 38rpx;
+		font-weight: 900;
+		@include price_color(theme);
+	}
+
+	.iconfont {
+		//color: #fff;
+	}
+
+	.listBox {
+		margin-top: 240rpx !important;
+		background-color: #FFFFFF;
+	}
+
+	.fixed-top {
+		position: fixed;
+		top: 0;
+		left: 0;
+		z-index: 9;
+	}
+
+	.productList .search {
+		width: 100%;
+		height: 86rpx;
+		padding: 0 30rpx;
+		box-sizing: border-box;
+		position: fixed;
+		top: 0 !important;
+		left: 0;
+		z-index: 666;
+		color: #fff;
+
+	}
+
+	.productList .search .input {
+		width: 570rpx;
+		height: 60rpx;
+		background-color: #fff;
+		border-radius: 50rpx;
+		padding: 0 20rpx;
+		box-sizing: border-box;
+		color: #333;
+	}
+
+	.productList .search .input input {
+		width: 88%;
+		height: 100%;
+		font-size: 26rpx;
+	}
+
+	.productList .search .input .placeholder {
+		color: #CCCCCC;
+	}
+
+	.productList .search .input .iconfont {
+		font-size: 26rpx;
+		color: #999999;
+	}
+
+	.productList .search .icon-yangshi1,
+	.icon-shaixuan {
+		color: #fff;
+		width: 62rpx;
+		font-size: 40rpx;
+		height: 86rpx;
+		line-height: 86rpx;
+		text-align: right;
+	}
+
+	.productList .nav {
+		height: 86rpx;
+		color: #454545;
+		position: fixed;
+		left: 0;
+		width: 100%;
+		font-size: 28rpx;
+		background-color: #fff;
+		top: 154rpx;
+		z-index: 9;
+		border-radius: 16rpx 16rpx 0rpx 0rpx;
+		padding-left: 20rpx;
+	}
+
+	.productList .nav .item {
+		width: 30%;
+		text-align: center;
+
+		.iconfont {
+			//color: #fff;
+		}
+	}
+	.item-c{
+		width: 27% !important;
+	}
+	.item-icon{
+		width: 8%;
+		margin-left: 30rpx;
+	}
+	.item-shu{
+		width: 1px;
+		height: 12px;
+		background: #666666;
+		opacity: 0.2;
+	}
+	.productList .nav .item.font-color {
+		font-weight: bold;
+	}
+
+	.productList .nav .item image {
+		width: 15rpx;
+		height: 19rpx;
+		margin-left: 10rpx;
+	}
+
+
+	.productList .list.on {
+		padding-top: 30rpx !important;
+		background-color: #fff;
+		border-top: 1px solid #F5F5F5;
+	}
+
+	.productList .list .item {
+		width: 335rpx;
+		background-color: #fff;
+		border-radius: 14rpx;
+		margin-bottom: 20rpx;
+	}
+
+	.productList .list .item.on {
+		width: 100%;
+		display: flex;
+		padding: 0 24rpx 60rpx 24rpx;
+		margin: 0;
+		border-radius: 14rpx;
+	}
+
+	.productList .list .item .pictrue {
+		position: relative;
+		// width: 100%;
+	}
+
+	.productList .list .item .pictrue /deep/.easy-loadimage {
+		width: 240rpx;
+		height: 240rpx;
+		border-radius: 14rpx;
+		overflow: hidden;
+	}
+
+	.productList .list .item .pictrue image {
+		width: 100%;
+		height: 100%;
+		border-radius: 20rpx 20rpx 0 0;
+		overflow: hidden;
+	}
+
+	.productList .list .item .pictrue image.on {
+		border-radius: 6rpx;
+	}
+
+	.productList .list .item .text {
+		padding: 18rpx 20rpx;
+		font-size: 30rpx;
+		color: #222;
+	}
+
+	.productList .list .item .text.on {
+		width: 456rpx;
+		padding: 0 0 0 20rpx;
+		position: relative;
+
+		&::after {
+			content: '';
+			display: block;
+			width: 94%;
+			border-bottom: 1rpx solid #f6f6f6;
+			position: absolute;
+			right: 2rpx;
+			bottom: -24rpx;
+		}
+
+		.name {
+			height: 84rpx;
+			line-height: 42rpx;
+		}
+	}
+
+	.productList .list .item .text .money {
+		font-size: 26rpx;
+		font-weight: bold;
+		margin-top: 8rpx;
+	}
+
+	.productList .list .item .text .money.on {
+		margin-top: 50rpx;
+	}
+
+	.productList .list .item .text .money .num {
+		font-size: 34rpx;
+	}
+
+	.productList .list .item .text .vip {
+		font-size: 20rpx;
+		color: #aaa;
+	}
+
+	.productList .list .item .text .vip .vip-money {
+		font-size: 24rpx;
+		color: #282828;
+		font-weight: bold;
+	}
+
+	.productList .list .item .text .vip .vip-money image {
+		width: 46rpx;
+		height: 21rpx;
+		margin-left: 4rpx;
+	}
+
+	.row-between-wrapper .input {
+		height: 60rpx;
+		margin: 10rpx 0 16rpx;
+	}
+	.box-line2 {
+		overflow: hidden;
+	}
+</style>

+ 130 - 45
mer_uniapp/pages/goods/order_confirm/index.vue

@@ -1,24 +1,24 @@
 <template>
 	<view class="container" :style="{ height: winHeight+ 'px' }">
 		<!-- 状态栏高度 -->
-		<view :style="{ height: `${statusBarHeight}px` }"></view>
+		<view :style="{ height: `${statusBarHeight+20}px` }"></view>
 		<!-- 进行中/历史订单 -->
 		<view class="status-bar">
 			<view>
 				<text :class="isShow? 'status-true': 'status-false'" @click="statusClick">外卖配送</text>
-				<text :class="!isShow? 'status-true': 'status-false'" @click="statusClick">到店自取(15分钟后取餐)</text>
+				<text :class="!isShow? 'status-true': 'status-false'" @click="statusClick">到店自取<text class="box-txt">(15分钟后取餐)</text></text>
 			</view>
 		</view>
 
 		<view style="background-color: white;border-radius: 23rpx;margin-bottom: 10rpx;padding: 19rpx 38rpx 38rpx 38rpx">
 			<view class='address' @tap='onAddress'>
 				<view class='addressCon' v-if="addressInfo.realName">
-					<view class='name acea-row'>
+					<view class='name acea-row boxnamae'>
 						<view class="line1 select-name">{{addressInfo.realName}}</view>
 						<view class='phone'>{{addressInfo.phone}}</view>
 					</view>
 					<view class="acea-row">
-						<view class="line1"><text class='default  font_color' v-if="addressInfo.isDefault">[默认]</text>{{addressInfo.province}}{{addressInfo.city}}{{addressInfo.district}}{{ addressInfo.street}}{{addressInfo.detail}}</view>
+						<view ><text class='default  font_color' v-if="addressInfo.isDefault">[默认]</text>{{addressInfo.province}}{{addressInfo.city}}{{addressInfo.district}}{{ addressInfo.street}}{{addressInfo.detail}}</view>
 					</view>
 				</view>
 				<view class='addressCon' v-else>
@@ -39,12 +39,12 @@
 		</view>
 
 		<view class="item-goods">
-			<text>吉啊婆麻辣烫</text>
+			<text>{{detils.merchantInfoList[0].merName}}</text>
 			<view class="good" v-for="(good, key) in goods_list" :key="key">
-				<image :src="good.images" class="image" @tap="console.log('点击图片')"></image>
+				<image :src="good.image" class="image"></image>
 				<view class="right">
-					<text class="name">{{ good.name }}</text>
-					<text class="tips">{{ good.content }}</text>
+					<text class="name">{{ good.productName }}</text>
+					<text class="tips">x {{ good.payNum }}</text>
 					<view class="price_and_action">
 						<text class="price">¥{{ good.price }}</text>
 						<view class="btn-group">
@@ -72,7 +72,14 @@
 				<text>活动红包</text>
 				<text>- ¥2</text>
 			</view>
+			<!-- 备注 -->
+			<view>备注:</view>
+			<textarea class="remark-txt" v-model="remark">
+				
+			</textarea>
+			
 		</view>
+		<viwe style="height: 200rpx;"></viwe>
 
 		<!-- 购物车栏 begin -->
 		<view class="cart-box" :style="{top: (winHeight - 100) + 'px'}">
@@ -80,7 +87,7 @@
 				<view style="font-weight: 600;font-size: 27rpx;color: #FFFFFF;" class="price">¥{{ total }}</view>
 				<text style="font-weight: 400;font-size: 23rpx;color: #999999;">已优惠¥2</text>
 			</view>
-			<button type="primary" class="pay-btn bg-color" @tap="toPay">
+			<button type="primary" class="pay-btn bg-color" @tap="orderCreate">
 				去支付
 			</button>
 		</view>
@@ -91,8 +98,14 @@
 <script>
 	import {
 		getAddressDetail,
-		getAddressDefault
+		getAddressDefault,
+		getAddressList,
 	} from '@/api/user.js';
+	import {
+	
+		loadPreOrderApi,
+		orderCreate
+	} from '@/api/order.js';
 	var statusBarHeight = uni.getSystemInfoSync().statusBarHeight + 'px';
 	let app = getApp();
 	export default {
@@ -108,29 +121,11 @@
 				orderNo: '', //预下单订单号
 				addressInfo: {}, //地址信息
 				addressId: 0, //地址id
-				goods_list: [{
-						id: 11,
-						name: '土豆片',
-						content: '月销371',
-						price: 1,
-						images: '/static/img/img7.png'
-					},
-					{
-						id: 12,
-						name: '娃娃菜',
-						content: '月销371',
-						price: 2,
-						images: '/static/img/img7.png'
-					},
-					{
-						id: 13,
-						name: '方便面',
-						content: '月销371',
-						price: 3,
-						images: '/static/img/img7.png'
-					}
-				],
-				cart: []
+				goods_list: [],  //购物车数据
+				cart: [],
+				detils:'',//详情数据
+				remark:'',//备注
+				
 			}
 		},
 		//下拉刷新
@@ -138,7 +133,15 @@
 
 		},
 		onLoad(options) {
+	
 			let that = this;
+			that.getAddressList()//获取地址			
+			that.orderNo=options.orderNo
+			console.log('订单号',that.orderNo)
+			that.loadPreOrderApi()  //获取详情
+			// 获取app德地址
+			const app = getApp();
+			let addressList=app.globalData.addressList
 			uni.getSystemInfo({
 				success: function(res) {
 					that.winHeight = res.windowHeight
@@ -154,21 +157,70 @@
 			// console.log("导航栏高度:"+this.globalData.navigationBarHeight)
 			// #endif
 			this.cart = uni.getStorageSync('cart')
-			this.total = (this.cart.reduce((acc, cur) => acc + cur.number * cur.price, 0)).toFixed(2)
+		
 		},
 		onShow() {
-
+				this.getAddressList()//获取地址
 		},
 		methods: {
+			//订单创建
+			orderCreate(){
+				let orderMerchantRequestList = [] //数组	
+				let merId=this.detils.merchantInfoList[0].merId // 商户id
+				orderMerchantRequestList.push({
+				   merId:merId,              // 商户id
+				   remark:this.remark,             // 备注
+				   shippingType: 1,        // 快递类型: 1-快递配送,2-到店自提,3-虚拟发货
+				   userCouponId: 0,        // 惠券编号(不选时为0)
+				})
+				orderCreate({
+					isUseIntegral:false, // 是否使用积分
+					addressId:this.addressInfo.id, //收货地址id
+					orderExtend:  JSON.stringify([{ key: 'value' }, { field: 'data' }]), //系统表单内容
+					orderMerchantRequestList:orderMerchantRequestList, //订单商户对象
+					platUserCouponId:0,//用户平台优惠券编号(不选时为0)
+					preOrderNo:this.orderNo,//预下单订单号
+					systemFormId: '',//系统表单ID
+					traceId:"1 15N4MJksUcgG7onuaA9xuvoZwoLatM4mAE21CqXmMz6",
+				}).then(res=>{
+					console.log('创建',res)
+					let data=res.data
+					if(res.code){
+						let url = `/pages/goods/order_payment/index?orderNo=${data.orderNo}&payPrice=${data.payPrice}`
+						uni.redirectTo({
+							url: url
+						});
+					}
+				})
+			},
+			// 详情数据
+			loadPreOrderApi(){
+				loadPreOrderApi(this.orderNo).then(res=>{
+					console.log('详情数据',res)
+					if(res.code==200){
+						let data=res.data
+						this.detils=data
+						this.goods_list=data.merchantInfoList[0].orderInfoList  //购物车数据
+						// 总价
+						this.total = (this.goods_list.reduce((acc, cur) => acc + cur.payNum * cur.price, 0)).toFixed(2)
+					}
+				})
+			},
+			// 获取地址数据
+			getAddressList(){
+				getAddressList().then(res=>{
+					console.log('地址',res)
+					if(res.code=200){
+						this.addressInfo=res.data.find(item => item.isDefault === true);
+						console.log('默认地址',this.addressInfo)
+					}
+				})
+			},
+			
 			statusClick() {
 				this.isShow = !this.isShow;
 			},
-			toPay() {
-				// if(!this.isLogin) {
-				// 	uni.navigateTo({url: '/pages/login/login'})
-				// 	return
-				// }
-			},
+		
 			onAddress: function() {
 				uni.navigateTo({
 					url: '/pages/address/user_address_list/index?orderNo=' + this.orderNo
@@ -178,14 +230,15 @@
 			 * 获取默认收货地址或者获取某条地址信息
 			 */
 			getaddressInfo: function() {
-				if (this.addressId) {
+				// if (this.addressId) {
 					getAddressDetail(this.addressId).then(res => {
+						console.log('地址信息',res)
 						if (res.data) {
 							res.data.isDefault = res.data.isDefault;
 							this.addressInfo = res.data || {};
 						}
 					})
-				}
+				// }
 			},
 		},
 		mounted() {
@@ -274,8 +327,11 @@
 	}
 
 	.item-goods {
+		display: flex;
+		flex-direction: column;
+		gap: 20rpx;
 		width: 100%;
-		height: 100%;
+		// height: 100%;
 		padding: 19rpx 38rpx;
 		background: #FFFFFF;
 		border-radius: 23rpx 23rpx 0rpx 0rpx;
@@ -284,7 +340,7 @@
 	.good {
 		display: flex;
 		align-items: center;
-		margin-bottom: 30rpx;
+		
 
 		.image {
 			width: 160rpx;
@@ -386,4 +442,33 @@
 		overflow: hidden;
 		position: relative;
 	}
+	.box-txt{
+		 overflow-wrap: break-word;
+	
+		  font-size: 22rpx;
+		  font-family: PingFangSC-Medium;
+		  font-weight: 500;
+		  text-align: left;
+		  white-space: nowrap;
+		  line-height: 40rpx;
+	}
+	.boxnamae{
+		overflow-wrap: break-word;
+		  color: rgba(20, 20, 20, 1);
+		  font-size: 32rpx;
+		  font-family: PingFangSC-Medium;
+		  font-weight: 500;
+		  text-align: center;
+		  white-space: nowrap;
+		  line-height: 44rpx;
+		
+	}
+	.remark-txt{
+		width: 100%;
+		height: 150rpx;
+		background: #D6D7DC;
+		color: #141414;
+		padding: 20rpx;
+		box-sizing: border-box;
+	}
 </style>

+ 319 - 26
mer_uniapp/pages/goods_cate/index.vue

@@ -74,6 +74,8 @@
 					<view :class="{ 'actave': tabindex == 1 }" class="let-line"></view>
 				</view>
 			</view>
+			<!-- 温馨提示 -->
+			<view class="cboxtxt">———— 温馨提示:适度选择,避免浪费 ———— </view>
 			<!-- 点餐页面  0是点餐 1是评价-->
 			<view class="con-box" v-if="tabindex==0">
 			<!-- #endif -->
@@ -81,10 +83,12 @@
 					<!-- 左侧数据 -->
 					<scroll-view scroll-y="true" style="height: 100%; overflow: hidden;" scroll-with-animation='true' :scroll-into-view="intoindex">
 						<view v-for="(item,index) in productList" :key="item.id">
-							<view class='item acea-row row-center-wrapper' :class='index==navActive?"on":""' 
+							<view class='nbox item acea-row row-center-wrapper' :class='index==navActive?"on":""' 
 							 :key="item.id" @click='tap(index,"b"+item.id)' :id='"sort"+index'><text class="item_text skeleton-rect">
 							 {{item.name}}
 							 </text>
+							 <text v-if="calculateSum(item.childList)>0" style="top:8rpx; " class="xun-txt">{{ calculateSum(item.childList) }}</text>
+							
 							 </view>
 						</view>
 					</scroll-view>
@@ -113,19 +117,24 @@
 												</view>
 												<!-- 价格 加 -->
 												<view class="nexbox3">
-													<text class="nexbox-txt3">¥ {{item.price}}</text>
+													<text class="nexbox-txt3">¥ {{item.price}}</text>												  
 													  
-													  <view class="nexbox4">
+													  <!-- 选规格 -->
+													  <view  @click.stop="Selectpox(item)" class="xu-btn">选规格
+													  <text v-if="item.sum>0" class="xun-txt">{{item.sum}}</text>
+													  </view>
+													
+													  <!-- <view  class="nexbox4"> -->
 														  <!-- 减 -->
-														  <view v-if="item.sum>0" @click.stop="letloke(item)" class="neximg1">-</view>   
-														  <text>{{item.sum}}</text>
+														  <!-- <view v-if="item.sum>0" @click.stop="letloke(item)" class="neximg1">-</view>  -->
+														  <!-- <text>{{item.sum}}</text> -->
 														  <!-- 加 -->
-														  <image   @click.stop="Addsum(item)" 
+													<!-- 	  <image   @click.stop="Addsum(item)" 
 														   class="nexbox-img3"	  
 															referrerpolicy="no-referrer"
 															src="https://lanhu-dds-backend.oss-cn-beijing.aliyuncs.com/merge_image/imgs/2eb30a58d13a4d218392389a0a61bee4_mergeImage.png"
-														/>
-													</view>
+														/> -->
+													 <!-- </view> -->
 												</view>
 											</view>
 										</view>
@@ -186,7 +195,7 @@
 			</view>
 		</view>
 		<!-- 购物车栏 begin -->
-		<view v-if="tabindex==0" class="cart-box" style="bottom: 77rpx">
+		<view v-if="tabindex==0&&!selectble" class="cart-box" style="bottom: 77rpx">
 			<view class="mark" @click="lockcatble=!lockcatble">
 				<image src="/static/img/ic-security-settings.png" class="cart-img" @tap=""></image>
 				<view class="tag" v-if="cart.length > 0">{{ getCartGoodsNumber }}</view>
@@ -198,12 +207,60 @@
 				{{ disabledPay ? `差${spread}元起送` : '去结算' }}
 			</button>
 		</view>
+		
+		<!-- 规格弹窗 -->
+		<view class="mode" v-if="selectble">
+			<view class="sel-mode-1">
+				<view class="close" @click="Close">X</view>
+				<view class="sel-2">
+					<image class="neximg" :src="specifications.icon"/>
+					<view class="nexbox1">
+						<text>销量 {{specifications.sales}}</text>
+						<text>好评率 {{ specifications.replyChance*100}}%</text>
+						<text class="nexbox-txt3">¥ {{specifications.price}}</text>
+					</view>
+					
+				</view>
+				<!--规格数组  -->
+				<view class="sel-3">
+					<text>规格</text>
+					<view class="sel-4">
+						<view class="sel-5" 
+						@click="xubox(item.productId)"
+						:style="{background: item.productId == productid ? '#ff9805' : ''}"
+						v-for="(item,index) in productValue" :key="index">
+							{{item.optionName}}
+						</view>
+					</view>
+				</view>
+				<!-- 数量 -->
+				<view class="sel-6">
+					<text>数量</text>
+					<view class="nexbox4">
+						  <!-- 减 -->
+						  <view v-if="specifications.sum>0" @click="selectletloke()" class="neximg1">-</view>  
+						  <text>{{specifications.sum}}</text>
+						  <!-- 加 -->
+						  <image   @click="selectAddsum()" 
+						   class="nexbox-img3"	  
+							referrerpolicy="no-referrer"
+							src="https://lanhu-dds-backend.oss-cn-beijing.aliyuncs.com/merge_image/imgs/2eb30a58d13a4d218392389a0a61bee4_mergeImage.png"
+						/>
+					 </view>
+				</view>
+				
+				<!-- 加入购物车 -->
+				<view class="sel-btn">
+					<view @click="Addshoppcat" class="sel-btn1">加入购物车</view>
+				</view>
+			</view>
+		</view>
 	</view>
 </template>
 <script>
 
 	let app = getApp();
-	import { getCategoryList } from '@/api/product.js';
+	import { getCategoryList,getProductDetail } from '@/api/product.js';
 	import easyLoadimage from '@/components/base/easy-loadimage.vue';
 	import { mapGetters } from "vuex";
 	import tuiSkeleton from '@/components/base/tui-skeleton.vue';
@@ -221,6 +278,12 @@
 		getMerCollectAddApi,
 		getMerCollectCancelApi
 	} from '@/api/merchant.js';
+	// 订单创建
+	
+	import {
+		orderCreate,
+		preOrderApi
+	} from '@/api/order.js';
 	// #endif
 	let sysHeight = uni.getSystemInfoSync().statusBarHeight;
 	export default {
@@ -287,6 +350,11 @@
 				lockcatble:false,//打开的购物车弹窗
 				navigateUrl:'',//跳转详情路径
 				tabindex:0,//点菜评价切换
+				
+				specifications:'',//点击的这一项菜品信息
+				selectble:false,//规格弹窗
+				productValue:[],//规格数组
+				productid:'',//选中规格的id
 			}
 		},
 		onLoad(options) {
@@ -299,7 +367,7 @@
 			  
 			
 			let that = this
-			that.Item=JSON.parse(options.item)
+			that.Item=options.id
 			 console.log('数据',that.Item)
 			 
 			that.getMerchantInfo()//商家信息 
@@ -346,9 +414,15 @@
 
 		},
 		methods: {
+			  // 方法用于计算 childList 数组中的 sum 总和
+			calculateSum(childList) {
+			    return childList.reduce((total, item) => total + (item.sum || 0), 0);
+			},
+			
 			// 收藏接口
 			getMerCollectAddApi(){
-				getMerCollectAddApi(this.merchanInfo.id).then(res=>{
+				// 商户id
+				getMerCollectAddApi(this.merchanInfo.merId).then(res=>{
 					console.log('收藏',res)
 					if(res.code==200){
 						this.$util.Tips({
@@ -360,7 +434,7 @@
 			},
 			// 取消收藏
 			getMerCollectCancelApi(){
-				getMerCollectCancelApi(this.merchanInfo.id).then(res=>{
+				getMerCollectCancelApi(this.merchanInfo.merId).then(res=>{
 					console.log()
 					if(res.code==200){
 						this.$util.Tips({
@@ -378,19 +452,42 @@
 			// 跳转详情
 			getOrderdetils(item){
 				console.log(item)
+				uni.navigateTo({
+						url:`/pages/goods/goods_details/index?id=${item.id}&mt=0`
+				})
+				
 			},
 			// 去结算
 			toPay() {				
 				uni.showLoading({
 					title: '加载中'
 				})
-				let cartList=JSON.stringify(this.cart)
-				uni.setStorageSync('cart', JSON.parse(JSON.stringify(this.cart)))
-			
-				uni.navigateTo({
-					url: `/pages/goods/order_confirm/index?cartList=${cartList}`
-				})
-				uni.hideLoading()
+				let orderDetails = this.cart.map((item) => {
+				  return {
+				    attrValueId: 2819, //商品规格属性id(立即购买、活动购买必填)
+				    groupBuyActivityId: null,//拼团活动id(拼团下单时必填)
+				    groupBuyRecordId: 0, // 拼团记录id,营销类型2=拼团 时必填 0=开团 实际
+				    productId: item.id,  //商品id
+				    productNum: item.sum //商品数量
+				  };
+				});
+				preOrderApi({
+					"preOrderType": 'buyNow', 
+					//类型 预下单类型(“shoppingCart”:购物车下单,“buyNow”:
+					// 立即购买,“video”: 视频号商品下单,“seckill”:秒杀下单,“group”:拼团下单)
+					"orderDetails": orderDetails //购物车信息
+				}).then(res=>{
+					console.log('预下单接口',res)
+					if(res.code==200){			
+						let cartList=JSON.stringify(this.cart)
+						uni.setStorageSync('cart', JSON.parse(JSON.stringify(this.cart)))
+						uni.navigateTo({
+							// url: `/pages/goods/order_confirm/index?cartList=${cartList}`
+							url: '/pages/goods/order_confirm/index?orderNo=' + res.data.orderNo
+						})
+					}
+				})			
+				uni.hideLoading()  //关闭动画
 			},
 			// 购物车清空
 			Clery(){
@@ -398,6 +495,76 @@
 				// 重新获取
 				this.getCategoryCacheTree()// // 商家页面-点菜分类
 			},
+			// 选规格打开
+			Selectpox(item){
+				this.specifications=item  //这一项信息
+				this.selectble=true
+				getProductDetail(
+				item.id,
+				0,0, ''
+				).then((res)=>{
+					console.log('规格',res)
+					if(res.code==200){
+						this.productValue=res.data.productAttr[0].optionList  //规格数组
+						this.productid=res.data.productValue.默认.productId  //默认选择的id
+						console.log('id',this.productid)
+					}
+				})
+			},
+			// 关闭规格
+			Close(){
+				console.log(11)
+				this.selectble=false
+				this.cart=[]//清空购物车
+				// 重新获取
+				this.getCategoryCacheTree()// // 商家页面-点菜分类
+			},
+			// 规格选择
+			xubox(id){
+				if(this.productid==''){
+					this.productid=id
+				}else{
+					this.productid=''
+				}
+			},
+			// 规格加
+			selectAddsum(){
+				this.specifications.sum+=1
+			},
+			// 规格减少
+			selectletloke(){
+				this.specifications.sum-=1
+			},
+			// 规格加入购物车
+			Addshoppcat(){
+				if(this.productid==''){
+					  uni.showToast({
+					    title: '请选择规格', // 提示的文本
+					    icon: 'none', // 不显示图标
+					    duration: 2000 // 提示框显示的时间,单位是毫秒
+					});
+					return; // 阻止继续执行
+				}
+				if(this.specifications.sum==0){
+					uni.showToast({
+					    title: '请加入商品数量', // 提示的文本
+					    icon: 'none', // 不显示图标
+					    duration: 2000 // 提示框显示的时间,单位是毫秒
+					});
+					return; // 阻止继续执行
+				}
+				// 便利数组
+				// 遍历 productList,筛选出 sum > 0 的项并推入 cart 数组
+				this.productList.forEach(item => {
+				    item.childList.forEach(child => {
+				        if (child.sum > 0 && !this.cart.some(cartItem => cartItem.id === child.id)) {
+				                   this.cart.push(child); // 将 sum > 0 且 id 不重复的项推入 cart
+				        }
+				    });
+				})
+				console.log('购物车数组',this.cart)
+				this.selectble=false
+			},
 			// 减少
 			letloke(item){	
 				 console.log('购物车', item);
@@ -435,9 +602,18 @@
 			// 减
 			// 返回
 			handBack() {
-				uni.navigateBack({
-					delta: 1
-				})
+				 const pages = getCurrentPages(); // 获取当前页面栈
+				  if (pages.length <= 1) {
+				    // 如果页面栈中只有一个页面(即当前页面),跳转到首页
+				    uni.switchTab({
+				      url: '/pages/index/index' 
+				    });
+				  } else {
+				    // 如果页面栈有多个页面,返回上一页
+				    uni.navigateBack({
+				    detail: 1
+				    });
+				  }
 			},
 			// 获取高度
 			infoScroll: function() {
@@ -480,7 +656,7 @@
 			
 			// 获取商家信息
 			getMerchantInfo(){
-				getMerchantInfo(this.Item.id).then(res => {
+				getMerchantInfo(this.Item).then(res => {
 					console.log('商家信息',res)
 					this.merchanInfo = res.data
 				});
@@ -488,16 +664,19 @@
 			
 			// 商家页面-点菜分类
 			getCategoryCacheTree(){
-				getCategoryCacheTree(this.Item.id).then(res => {
+				getCategoryCacheTree(this.Item).then(res => {
 					// console.log('点菜分类数据',res.data)										
 						  // 遍历 data 数组
 						  let data=res.data
 						  data.forEach(category => {
+							  // 给 category 添加 sum 字段,表示 childList 的 sum 总和
+							  category.sumber = 1;
 						    if (category.childList && Array.isArray(category.childList)) {
 						      // 给 childList 数组中的每个元素加上 sum 字段
 						      category.childList.forEach(item => {
 						        item.sum = 0;  // 你可以根据需要设置sum的初始值
-						      });
+						      });			 
+							
 						    }
 						  });
 						
@@ -1184,4 +1363,118 @@
 		  height: 40rpx;
 		  flex-shrink: 0;
 	}
+	.cboxtxt{
+		  overflow-wrap: break-word;
+		  color: rgba(153, 153, 153, 1);
+		  font-size: 22rpx;
+		  font-weight: normal;
+		  text-align: left;
+		  white-space: nowrap;
+		  line-height: 32rpx;
+		  display: flex;
+		  align-items: center;
+		  justify-content: flex-end;
+		  padding: 10rpx;
+		  box-sizing: border-box;
+	}
+	
+	.xu-btn{
+		width: 120rpx;
+		border-radius: 10rpx;
+		height: 50rpx;
+		display: flex;
+		align-items: center;
+		justify-content: center;
+		background: rgba(255, 103, 2, 1);
+		color: #FFF;
+		font-size: 24rpx;
+		position: relative;
+	}
+	.nbox{
+		position: relative;
+	}
+	.xun-txt{
+		position: absolute;
+		right: 0;
+		top: -10rpx;
+		border-radius: 30%;
+		width: 30rpx;
+		height: 30rpx;
+		background: rgba(255, 103, 2, 1);
+		color: #FFF;
+		display: flex;
+		align-items: center;
+		justify-content: center;
+	}
+	
+	// 规格弹窗
+	.sel-mode-1{
+		   width: 100%;
+		    height: 440rpx;
+		    background: #FFF;
+		    display: flex;
+		    flex-direction: column;
+		    gap: 20rpx;
+		    box-sizing: border-box;
+		    overflow: auto;
+		    z-index: 9999;
+			padding: 20rpx;
+			box-sizing: border-box;
+			position: relative;
+	}
+	.close{
+		position: absolute;
+		top: 20rpx;
+		right: 20rpx;
+		font-size: 30rpx;
+	}
+	.sel-2{
+		display: flex;
+		align-items: center;
+		gap: 20rpx;
+	}
+	.sel-3{
+		display: flex;
+		flex-direction: column;
+		gap: 10rpx;
+	}
+	.sel-4{
+		display: flex;
+		align-items: center;
+		gap: 10rpx;
+	}
+	.sel-5{
+		width: 80prx;
+		height: 40rpx;
+		box-sizing: border-box;
+		display: flex;
+		align-items: center;
+		justify-content: center;
+		font-size: 24rpx;
+		background: #999999;
+		color: #FFF;
+		padding: 8rpx;
+		border-radius: 8rpx;
+	}
+	.sel-6{
+		display: flex;
+		align-items: center;
+		justify-content: space-between;
+	}
+	.sel-btn{
+		display: flex;
+		align-items: center;
+		justify-content: flex-end;
+	}
+	.sel-btn1{
+		width: 110px;
+		height: 60rpx;
+		display: flex;
+		align-items: center;
+		justify-content: center;
+		background: rgba(255, 103, 2, 1);
+		color: #FFF;
+		font-size: 30rpx;
+		border-radius: 10rpx;
+	}
 </style>

+ 9 - 2
mer_uniapp/pages/index/index.vue

@@ -131,7 +131,7 @@
 
 				<view style="display: flex;">
 
-					<view class="goods-list" v-for="item in proList" :key="item.id">
+					<view @click="getDetils(item)" class="goods-list" v-for="item in proList" :key="item.id">
 						<view style="display: flex;">
 							<view style="margin-right: 20rpx;">
 								<image :src="item.image" style="width: 134rpx;height: 134rpx;border-radius: 12rpx;">
@@ -278,6 +278,13 @@
 			})
 		},
 		methods: {
+			// 跳转商品详情
+			getDetils(item){
+				console.log(item)
+				uni.navigateTo({
+						url:`/pages/goods/goods_details/index?id=${item.productId}&mt=0&iSshop=1`
+				})
+			},
 			getAddressInfo(latitude, longitude) {
 				let that = this;
 				const qqmapsdk = new QQMapWX({
@@ -355,7 +362,7 @@
 				// 修改跳转
 				uni.navigateTo({
 					// url: '/pages/merchant/home/index'
-					 url: `/pages/goods_cate/index?item=${opitem}`
+					 url: `/pages/goods_cate/index?id=${item.id}`
 					
 				})
 			}

+ 108 - 52
mer_uniapp/pages/order/index.vue

@@ -1,69 +1,75 @@
 <template>
 	<view>
-		<!-- 状态栏高度 -->
-		<view :style="{ height: `${statusBarHeight}px` }"></view>
-
-		<!-- 导航栏 -->
-		<view :style="{ height: `${navigationBarHeight}px`,lineHeight: `${navigationBarHeight}px`}" class="order-nav">订单
-		</view>
-
-		<!-- 进行中/历史订单 -->
-		<view class="status-bar">
-			<view>
-				<text :class="isShow? 'status-true': 'status-false'" @click="statusClick">进行中</text>
-				<text :class="!isShow? 'status-true': 'status-false'" @click="statusClick">历史订单</text>
-
-			</view>
-		</view>
+		<view class="top-1">
+			<!-- 状态栏高度 -->
+			<view :style="{ height: `${statusBarHeight}px` }"></view>
+			
+			
+				<!-- 导航栏 -->
+				<view :style="{ height: `${navigationBarHeight}px`,lineHeight: `${navigationBarHeight}px`}" class="order-nav">订单
+				</view>
 
-		<view style="background-color: white;border-radius: 23rpx;margin: 10rpx 20rpx;padding-bottom: 40rpx;">
+				<!-- 进行中/历史订单 -->
+				<view class="status-bar">
+					<view>
+						<text :class="isShow==0? 'status-true': 'status-false'" @click="statusClick(0)">进行中</text>
+						<text :class="isShow==1? 'status-true': 'status-false'" @click="statusClick(1)">历史订单</text>
 
-			<view class="container">
-				<text class="left-text">韩式铁板蛋炒饭</text>
-				<view class="right-group">
-					<text style="color: #0FBA42;font-size: 23rpx;">制作中</text>
-					<!-- <text style="color: #FF5500;font-size: 23rpx;">待取餐</text>
-					<text style="color: #999999;font-size: 23rpx;">已完成</text>
-					<text style="color: #999999;font-size: 23rpx;">已取消</text> -->
-					<image src="/static/img/ic-yx.png" class="image" />
+					</view>
 				</view>
 			</view>
+		
+		<!-- 列表数据 -->
+		<view class="nbox-1">	
+			<view class="nbox-2" v-for="(item,index) in list" :key="index">
+				<view class="container">
+					<text class="left-text">{{item.merName}}</text>
+					<view class="right-group">
+						<text v-if="item.status==1||item.status==2||item.status==3" style="color: #0FBA42;font-size: 23rpx;">制作中</text>
+						<text v-if="item.status==4" style="color: #FF5500;font-size: 23rpx;">待取餐</text>
+				
+						<image src="/static/img/ic-yx.png" class="image" />
+					</view>
+				</view>
 
-			<view class="scroll-container">
-				<view class="item">
-					<img src="/static/img/img8.png">
-					<text>蛋炒饭x1</text>
+				<view class="scroll-container" v-for='(ottm,indexs) in item.orderInfoList' :key="indexs">
+					<view class="item">
+						<img :src='ottm.image'>
+						<text>{{ottm.productName}} x{{ottm.payNum}}</text>
+					</view>
 				</view>
-			</view>
 
-			<view class="dashed-line"></view>
+				<view class="dashed-line"></view>
 
-			<view style="text-align: right; font-size: 23rpx; color: #141414;padding-right: 20rpx;">
-				共2件,实付 ¥16.00元
-			</view>
+				<view style="text-align: right; font-size: 23rpx; color: #141414;padding-right: 20rpx;">
+					共{{item.orderInfoList.length}}件,实付 ¥{{ item.payPrice}}
+				</view>
 
-			<view class="container2">
-				<text class="left-text2">商家正在备餐中</text>
-				<view class="right-group">
-					<image src="/static/img/ic-iphone1.png" class="image2" />
-					<text style="color: #141414;font-size: 21rpx;">联系商家</text>
-					
-					<view style="display: inline-block; width: 2rpx; height: 42rpx;border: 2rpx solid #D5D6DC;"></view>
-					
-					<image src="/static/img/ic-message1.png" class="image2" />
-					<text style="color: #141414;font-size: 21rpx;">留言</text>
+				<view class="container2">
+					<text v-if="item.status==1||item.status==2||item.status==3" class="left-text2">商家正在备餐中</text>
+					<text v-if="item.status==4" class="left-text2">商家备餐完成</text>
+					<view class="right-group" >
+						<image src="/static/img/ic-iphone1.png" class="image2" />
+						<text  @click="makePhoneCall(item)" style="color: #141414;font-size: 21rpx;">联系商家</text>
+						
+						<view style="display: inline-block; width: 2rpx; height: 42rpx;border: 2rpx solid #D5D6DC;"></view>
+						
+						
+						<!-- 留言字段 -->
+						<image src="/static/img/ic-message1.png" class="image2" />
+						<text style="color: #141414;font-size: 21rpx;">留言</text>
+					</view>
 				</view>
 			</view>
-
-
-
-
 		</view>
-
 	</view>
 </template>
 
 <script>
+	import {
+	
+		getOrderList
+	} from '@/api/order.js';
 	var statusBarHeight = uni.getSystemInfoSync().statusBarHeight + 'px';
 	let app = getApp();
 	export default {
@@ -71,7 +77,8 @@
 			return {
 				statusBarHeight: app.globalData.statusBarHeight,
 				navigationBarHeight: 0,
-				isShow: true,
+				isShow: 0,
+				list:[],//订单数据
 			}
 		},
 		//下拉刷新
@@ -89,15 +96,44 @@
 			this.navigationBarHeight = custom.height + (custom.top - this.statusBarHeight) * 2
 			// console.log("导航栏高度:"+this.globalData.navigationBarHeight)
 			// #endif
+			this.getOrderList()//订单列表
 
 		},
 		onShow() {
 
 		},
 		methods: {
-			statusClick() {
-				this.isShow = !this.isShow;
+			// 拨打电话
+			 makePhoneCall(item) {
+			      const phoneNumber = item.merPhone; // 替换为商家的电话号码
+			      uni.makePhoneCall({
+			        phoneNumber: phoneNumber,
+			        success() {
+			          console.log('拨打电话成功');
+			        },
+			        fail() {
+			          console.log('拨打电话失败');
+			        }
+			      });
+			},
+			// 头部切换
+			statusClick(index) {
+				this.isShow = index;
+				this.getOrderList()	// 订单列表
 			},
+			// 订单列表
+			getOrderList(){
+				getOrderList({
+					limit:9999,//条数
+					page:1,//页码
+					orderType:this.isShow,  //类型订单类型:0-进行中,1-完成
+				}).then(res=>{
+					console.log('订单列表',res)
+					if(res.code==200){
+						this.list=res.data.list
+					}
+				})
+			}
 		},
 		mounted() {
 
@@ -112,12 +148,14 @@
 		color: #FFFFFF;
 		background-color: #FF6702;
 		text-align: center;
+		
 	}
 
 	.status-bar {
 		background-color: #FF6702;
 		text-align: center;
-		padding: 20px 0 16rpx 0;
+		padding: 20rpx;
+		box-sizing: border-box;
 	}
 
 	.status-bar view {
@@ -240,4 +278,22 @@
 		/* 控制线条高度 */
 		margin: 0 40rpx 18rpx 40rpx;
 	}
+	
+	.nbox-1{
+		padding: 20rpx;
+		box-sizing: border-box;
+		display: flex;
+		flex-direction: column;
+		gap: 20rpx;
+	}
+	.nbox-2{
+		background: #FFF;
+		padding:15rpx;
+		box-sizing: border-box;
+	}
+	.top-1{
+		background-color: #FF6702;
+		position: sticky;
+		top: 0;
+	}
 </style>

Some files were not shown because too many files changed in this diff