Browse Source

Merge branch 'lyy' of ymy/bc_wx_applet into master

lyy 1 year ago
parent
commit
0e19c1cc65

+ 214 - 29
components/cartPopup.vue

@@ -1,55 +1,240 @@
 <template>
-	<u-popup :show="show" mode="bottom"  @close="close" @open="open" :round="10">
+	<u-popup :show="show" mode="bottom" @close="close" @open="open" :round="10">
 		<view class="my-popup padding">
-			<view class="w-full padding-bottom-lg" v-for="index in 3" :key="index">
-				<my-goods :data="data">
+			<view class="container-sel">
+				<radio :checked="allSelected" color="#E51C23" @click="selectAll">全选
+				</radio>
+				<view class="dflex">
+					<u-tag text="清空购物车" type="info" color="#000" borderColor="#fff" size="mini" icon="trash" plain
+						@click="clearCart"></u-tag>
+				</view>
+			</view>
+			<radio class="w-full padding-bottom-lg" color="#E51C23" v-for="(item, index) in carList" :key="index"
+				:name="item.name" :checked="item.selected" @click="radioChange(item)">
+				<my-goods :item="item" ref="my-goods">
 					<view class="num-step">
-						<uni-number-box v-model="value" :min="1" @change="changeValue" />
+						<u-number-box v-model="item.quantity" :min="1" @change="changeValue($event, item)" />
 					</view>
 				</my-goods>
+			</radio>
+		</view>
+		<view class="cart-bottom padding-sm dflex-b" v-if="showShop">
+			<view class="cart padding-lr">
+				<uni-badge size="small" :text="buyCount" absolute="rightTop">
+					<u-icon name="shopping-cart-fill" size="28" color="#FF873D"></u-icon>
+				</uni-badge>
+				<text class="cart-total">总计:¥{{total}}</text>
 			</view>
-			
+			<view class="balance dflex-c background-gradient" @click="toBuy">去结算</view>
 		</view>
 	</u-popup>
 </template>
 
 <script>
 	export default {
-		name:"cartPopup",
+		name: "cartPopup",
 		data() {
 			return {
-				show:false,
-				value:1,
-				data:{
-					src:'../../static/x0.jpg',
-					title:'标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题',
-					spec:'180cm',
-					price:'53.30'
-				}
+				show: false,
+				allSelected: false,
+				carList: [],
+				showShop: false,
+				total: 0,
+				totalList: []
 			};
 		},
-		methods:{
-			open(){},
-			setShow(v){
-				this.show = v;
+		mounted() {
+			this.fatchDate()
+		},
+		methods: {
+			openShop(v) {
+				this.showShop = v
 			},
-			close(){
+			open() {},
+			async fatchDate() {
+				const e = uni.getStorageSync('carl')
+				const params = {
+					storeId: e.id
+				}
+				const res = await this.$request('get', `/front/shoppingCart/list`, params)
+				console.log('res.data', res.data)
+				if (res) {
+					this.carList = res.data
+				}
+			},
+			setShow(v) {
+				this.show = v
+				this.fatchDate()
+				// 检查 carList 是否存在且至少有一个元素
+				if (this.carList && this.carList.length > 0) {
+					// 检查 carList 的第一个元素是否有 selected 属性
+					if (!this.carList[0].hasOwnProperty('selected')) {
+						// 如果没有 selected 属性,使用 map 方法添加 selected 属性
+						this.carList = this.carList.map(item => ({
+							...item,
+							selected: false
+						}));
+					}
+				} else {
+					// 如果 carList 不存在或没有元素,直接使用 map 方法添加 selected 属性
+					this.carList = this.carList.map(item => ({
+						...item,
+						selected: false
+					}))
+				}
+
+				if (this.carList.length > 0) {
+					this.allSelected = this.carList.every(car => car.selected)
+				}
+				console.log('this.carList2222222222222222222', this.carList)
+			},
+			close() {
 				this.show = false;
 			},
-			changeValue(){}
+			changeValue(value, v) {
+				console.log('更新后的数量=======:', value, '索引=========:', v)
+				const e = uni.getStorageSync('carl')
+				const userId = uni.getStorageSync('appUserId')
+				const params = {
+					id: v.id,
+					storeId: e.id,
+					storeName: e.name,
+					skuId: v.skuId,
+					basePrice: v.basePrice,
+					quantity: value.value,
+					extendProps: userId
+				}
+				console.log('params', params)
+				this.$request('put', `/front/shoppingCart`, params, true)
+
+			},
+			selectAll() {
+				this.allSelected = !this.allSelected
+				this.carList.forEach(item => {
+					item.selected = this.allSelected
+				})
+				this.$emit('selected-changed', this.carList)
+				this.totalList = this.carList
+				this.totalPrice()
+				console.log('this.carList111111111111111', this.carList)
+			},
+			clearCart() {
+				const ids = this.carList.map(car => car.id);
+				console.log('ids', ids)
+				this.$request('delete', `/front/shoppingCart/${ids}`).then(response => {
+					// 请求成功
+					if (response.code = 200) {
+						// 弹出消息
+						uni.showToast({
+							title: '已清空',
+							icon: 'success',
+							duration: 2000
+						})
+						this.carList = []
+						this.$emit('selected-changed', []);
+						this.show = false
+					}
+				}).catch(error => {
+					// 请求失败
+					console.error('请求失败:', error);
+				})
+			},
+			radioChange(e) {
+				console.log(e)
+				e.selected = !e.selected
+				// 检查是否所有车都被选中了
+				this.allSelected = this.carList.every(car => car.selected)
+				this.localList = this.carList.filter(car => car.selected === true);
+
+				this.$emit('selected-changed', this.localList);
+				this.totalList = this.localList
+				this.totalPrice()
+				console.log('this.totalList', this.totalList);
+				// 打印结果
+				console.log('this.allSelected', this.allSelected);
+			},
+			//计算selected为true的
+			totalPrice() {
+				let total = 0;
+				for (let i = 0; i < this.totalList.length; i++) {
+					// 检查商品是否有 selected 属性
+					if (this.totalList[i].hasOwnProperty('selected')) {
+						// 如果 selected 属性存在,只有当它为 true 时才计算
+						if (this.totalList[i].selected) {
+							let priceInCents = Math.round(this.totalList[i].price * 100);
+							let quant = this.totalList[i].quantity;
+							total += priceInCents * quant;
+						}
+					} else {
+						// 如果 selected 属性不存在,直接计算所有商品
+						let priceInCents = Math.round(this.carList[i].price * 100);
+						let quant = this.carList[i].quantity;
+						total += priceInCents * quant;
+					}
+				}
+
+				// 将总价格转换回浮点数(以元为单位)
+				this.total = (total / 100).toFixed(2);
+
+				console.log('total', this.total);
+			},
 		}
 	}
 </script>
 
 <style scoped lang="scss">
-.my-popup{
-	width: 100%;
-	max-height: 800rpx;
-	overflow: auto;
-	padding-bottom: 130rpx;
-	.num-step{
-		width: 200rpx;
-		padding-top: 40rpx;
+	.my-popup {
+		width: 100%;
+		max-height: 800rpx;
+		overflow: auto;
+		padding-bottom: 130rpx;
+
+		.num-step {
+			width: 200rpx;
+			padding-top: 40rpx;
+		}
+
+		.container-sel {
+			display: flex;
+			justify-content: space-between;
+			align-items: center;
+			margin: 10px 0;
+		}
+	}
+
+	.cart-bottom {
+		width: 100%;
+		position: fixed;
+		left: 0;
+		bottom: 0;
+		height: 130rpx;
+		box-sizing: border-box;
+		background-color: #FFF;
+		box-shadow: 0px -4px 16px 0px rgba(0, 0, 0, 0.15);
+		z-index: 10800;
+
+		.cart {
+			width: calc(100% - 220rpx);
+			border-radius: 5px;
+			background-color: #FEEEE4;
+			display: flex;
+			align-items: center;
+			height: 100%;
+
+			.cart-total {
+				padding-left: 40rpx;
+				font-size: 16px;
+				font-weight: 700;
+			}
+		}
+
+		.balance {
+			width: 200rpx;
+			height: 100%;
+			background-color: #FF0000;
+			font-size: $uni-font-size-lg;
+			border-radius: 5px;
+			color: #FFF;
+		}
 	}
-}
 </style>

+ 83 - 55
components/my-goods/my-goods.vue

@@ -1,78 +1,106 @@
 <template>
-	<view class="goods">
-		<view class="goods-img">
-			<image mode="aspectFit" class="wh-full" :src="data.src"></image>
-		</view>
-		<view class="right-info">
-			<view class="good-title">{{data.title}}</view>
-			<view class="w-full flex-a">
-				<view class="g-left">
-					<view class="spec">{{data.spec}}</view>
-					<view class="price">{{data.price}}</view>
-				</view>
-				<view class="g-right">
-					<slot></slot>
+	<view>
+		<view class="goods">
+			<view class="goods-img">
+				<image v-if="item.imgUrl" mode="aspectFit" class="wh-full" :src="item.imgUrl"></image>
+				<view else class="pic"></view>
+			</view>
+			<view class="right-info">
+				<view class="good-title">{{item.skuName}}</view>
+				<view class="w-full flex-a">
+					<view class="g-left">
+						<view class="spec">{{item.skuProperties}}</view>
+						<view class="price">{{item.price}}</view>
+					</view>
+					<view class="g-right">
+						<slot></slot>
+					</view>
 				</view>
 			</view>
-			
 		</view>
-		
 	</view>
 </template>
 
 <script>
 	export default {
-		name:"my-goods",
+		name: "my-goods",
 		data() {
 			return {
-				
+				show: false
 			};
 		},
-		props:{
-			data:{}
+		props: {
+			item: {
+				type: Object,
+				required: true
+			}
+		},
+		methods: {
+			close() {
+				this.show = false;
+			}
 		}
 	}
 </script>
 
 <style scoped lang="scss">
-.goods{
-	width: 100%;
-	display: flex;
-	align-items: center;
-	.goods-img{
-		height: 200rpx;
-		width: 200rpx;
-		flex-shrink: 0;
-	}
-	.right-info{
-		width: calc(100% - 200rpx);
-		box-sizing: border-box;
-		padding-left: 10rpx;
-		.good-title{
-			width: 100%;
-			text-overflow: ellipsis;
-			white-space: nowrap;
-			font-size: $uni-font-size-base;
-			overflow: hidden;
-			padding-bottom: 10rpx;
-		}
-		.spec{
-			height: 50rpx;
-			display: flex;
-			align-items: center;
+	.goods {
+		width: 100%;
+		display: flex;
+		align-items: center;
+
+		.goods-img {
+			height: 200rpx;
 			width: 200rpx;
-			border-radius: 25px;
-			background-color: #EFEFEF;
-			font-size: $uni-font-size-sm;
-			margin-bottom: 20rpx;
+			flex-shrink: 0;
+			.pic {
+				width: 200rpx;
+				height: 200rpx;
+				background-color: #EEE;
+				// flex-shrink: 0;
+			}
+		}
+
+		.right-info {
+			width: calc(100% - 200rpx);
 			box-sizing: border-box;
-			padding: 0 20rpx;
+			padding-left: 10rpx;
+
+			.good-title {
+				width: 100%;
+				text-overflow: ellipsis;
+				white-space: nowrap;
+				font-size: $uni-font-size-base;
+				overflow: hidden;
+				padding-bottom: 10rpx;
+			}
+
+			.spec {
+				height: 50rpx;
+				display: flex;
+				align-items: center;
+				width: 200rpx;
+				border-radius: 25px;
+				background-color: #EFEFEF;
+				font-size: $uni-font-size-sm;
+				margin-bottom: 20rpx;
+				box-sizing: border-box;
+				padding: 0 20rpx;
+			}
+
 		}
-		
 	}
-}
-.flex-a{
-	display: flex;
-	justify-content: space-between;
-}
+
+	.flex-a {
+		display: flex;
+		justify-content: space-between;
+	}
+
+
+	.my-popup {
+		width: 100%;
+		max-height: 800rpx;
+		overflow: auto;
+		padding-bottom: 130rpx;
+	}
 </style>

+ 197 - 48
components/specPopup.vue

@@ -1,79 +1,223 @@
 <template>
-	<uni-popup ref="popup" background-color="#fff" @change="change">
+	<uni-popup ref="popup" background-color="#fff" mode="bottom" @change="change">
 		<view class="s-box padding-sm">
-			<view class="s-img"></view>
+			<view class="s-img">
+				<image mode="aspectFit" class="wh-full"
+					:src="caMsg.img[0].url ? caMsg.img[0].url : cardMsg.imgList[0].url"></image>
+			</view>
 			<view class="g-info">
-				<view class="s-name">商品名称01</view>
-				<view class="s-price">¥12.36</view>
+				<view class="s-name">{{caMsg.skuName ? caMsg.skuName : cardMsg.spuName}}</view>
+				<view class="s-price">{{caMsg.retailPrice ? caMsg.retailPrice : cardMsg.minPrice}}</view>
 			</view>
 		</view>
-		<uni-section title="规格">
-			<view class="spec-box padding-lr-sm">
-				<view class="spec-item padding-lr-sm" :class="{'on-spec':item % 3 == 0}" v-for="item in 5">规格{{item + 1}}</view>
-			</view>
-		</uni-section>
-		<uni-section title="购买数量">
-			<view class="purchase-num padding-lr-sm">
-				<view class="num">剩余562件</view>
-				<uni-number-box v-model="vModelValue" @change="changeValue" />
+		<scroll-view style="height: 270px;" scroll-y>
+			<view v-for="(item, index)  in specs" :key="index">
+				<uni-section :title="item.name">
+					<view class="spec-box padding-lr-sm">
+						<view class="spec-item padding-lr-sm" v-for="(spe, cindex) in item.values"
+							:class="{'on-spec': spe.selected}" :key="cindex" @click="selectSpec1(item, spe)">
+							{{ spe.label }}
+						</view>
+					</view>
+				</uni-section>
 			</view>
-		</uni-section>
+		</scroll-view>
+		<view class="purchase-num padding-lr-sm">
+			<uni-section title="购买数量"></uni-section>
+			<uni-number-box v-model="vModelValue" @change="changeValue(value)" />
+		</view>
 		<view class="btn-box">
-			<view class="btn reset">重置</view>
-			<view class="btn confirm">确定</view>
+			<view class="btn reset" @click="toShop">加入购物车</view>
+			<view class="btn confirm" @click="toBuy">立即购买</view>
 		</view>
 	</uni-popup>
 </template>
 
 <script>
 	export default {
-		name:"specPopup",
-		data(){
-			return{
-				vModelValue:1
+		name: "specPopup",
+		props: {
+			cardMsg: {
+				type: Object,
+				required: true
 			}
 		},
-		methods:{
-			changeValue(){},
-			change(){},
-			open(){
-				this.$refs.popup.open('bottom');
+		data() {
+			return {
+				vModelValue: 1,
+				specs: [], // 总查询数据
+				speL: [],
+				intSkuId: [], // 选择唯一的id
+				caMsg: [], // 根据id查出来的数据
+			}
+		},
+		methods: {
+			changeValue(e) {},
+			change(e) {
+				if (!e.show) { // 当弹出层关闭时
+					// 重置规格选择
+					if (this.specs.length > 0) {
+						this.specs.forEach(e => {
+							e.values.forEach(s => {
+								s.selected = false
+							})
+						})
+					}
+					this.speL = []
+					// 重置购买数量
+					this.vModelValue = 1
+				}
+			},
+			async selectSpec1(item, spec) {
+				// 首先,取消选择所有其他选项
+				item.values.forEach(value => {
+					value.selected = false
+				})
+				// 然后,选择当前点击的选项
+				spec.selected = true
+				if (spec.selected) {
+					this.speL.push(spec)
+				}
+
+				const seleList = this.speL.filter(item => item.selected == true)
+				const items = seleList.map(item => item.label)
+				// 计算选中规格项的skuIds数组的交集
+				if (seleList.length > 0) {
+					let intersection = seleList[0].skuIds
+
+					// 遍历数组中的每个对象
+					for (let i = 1; i < seleList.length; i++) {
+						// 使用filter和includes方法找到交集
+						intersection = intersection.filter(skuId => {
+							return seleList[i].skuIds.includes(skuId);
+						})
+					}
+					// 如果交集不为空,取第一个元素作为唯一字符串
+					const uniqueString = intersection.length > 0 ? intersection[0] : '';
+
+					// 更新组件中的intSkuId
+					this.intSkuId = uniqueString;
+				} else {
+					// 如果没有选中的规格项,返回空字符串
+					this.intSkuId = '';
+				}
+				console.log('speL', this.speL)
+				// 确定每一个都有选择后发起请求
+				const isSelected = this.specs.every(spec => spec.values.some(value => value.selected))
+				if (isSelected) {
+					// 如果所有规格都至少有一个选项被选中
+					const res = await this.$request('get', `/item/sku/${this.intSkuId}`)
+					this.caMsg = res.data
+					// 返回选中规格项的label值
+					console.log('intSkuId', this.intSkuId)
+					console.log('items', items)
+					console.log('所有规格都已选择')
+					const itemDetal = {
+						id: this.intSkuId,
+						item: Array.from(items).join(','),
+						count: this.vModelValue
+					}
+					this.$emit('seChanged', itemDetal);
+				} else {}
+			},
+			async open() {
+				this.$refs.popup.open('bottom')
+				console.log("this.cardMsg")
+				const spuId = this.cardMsg.spuId
+				const res = await this.$request('get', `/item/sku/queryPropMapping?spuId=${spuId}`)
+				this.specs = res.data.filter(item => item.values && item.values.length > 0);
+				this.specs.forEach(item => {
+					Object.assign(item, {
+						values: item.values.map(value => ({
+							...value,
+							ids: item.id,
+							selected: false
+						}))
+					})
+				})
+			},
+			toShop() {
+				const e = uni.getStorageSync('carl')
+				const userId = uni.getStorageSync('appUserId')
+				const count = this.vModelValue
+				const params = {
+					storeId: e.id,
+					storeName: e.name,
+					skuId: this.caMsg.skuId,
+					basePrice: this.caMsg.retailPrice,
+					price: this.caMsg.retailPrice,
+					quantity: count,
+					extendProps: userId
+				}
+				console.log('params', params)
+				this.$request('post', `/front/shoppingCart`, params, true).then(response => {
+					// 请求成功
+					if (response.code = 200) {
+						// 弹出消息
+						uni.showToast({
+							title: '加入购物车成功',
+							icon: 'success',
+							duration: 2000
+						})
+						this.$emit('addShop');
+					}
+				}).catch(error => {
+					// 请求失败
+					console.error('请求失败:', error);
+				})
+				// this.$emit('update-shopmsg', this.shopMsg);
+				// 关闭弹出层
+				this.$refs.popup.close()
+			},
+			toBuy() {
+				uni.navigateTo({
+					url: `/pages/order/submitOrder/submitOrder`
+				})
 			}
 		}
 	}
 </script>
 
 <style lang="scss" scoped>
-	.btn-box{
+	.btn-box {
 		width: 100%;
 		display: flex;
 		justify-content: space-around;
 		align-items: center;
 		padding-top: 80upx;
-		.btn{
+
+		.btn {
 			width: 45%;
-			height: 60upx;
+			height: 80upx;
 			text-align: center;
-			line-height: 60upx;
-			border-radius: 30upx;
+			line-height: 80upx;
+			border-radius: 40upx;
 		}
-		.reset{
-			border:solid 1px #EEE;
+
+		.reset {
+			border: solid 1px #EEE;
+			box-sizing: border-box;
 			box-sizing: border-box;
+			border: solid 1px #FF0000;
+			font-size: 14px;
+			color: #FF0000;
 		}
-		.confirm{
+
+		.confirm {
 			background-image: $base-bg-gradient-color;
 			color: #FFF;
 		}
 	}
-	.spec-box{
+
+	.spec-box {
 		width: 100%;
 		display: flex;
 		flex-wrap: wrap;
-		.spec-item{
+
+		.spec-item {
 			height: 60upx;
 			line-height: 60upx;
-			border:solid 1px #EEE;
+			border: solid 1px #EEE;
 			box-sizing: border-box;
 			text-align: center;
 			margin-left: 20upx;
@@ -81,44 +225,49 @@
 			margin-bottom: 20upx;
 			font-size: 12px;
 		}
-		.spec-item:first-child{
+
+		.spec-item:first-child {
 			margin-left: 0;
 		}
-		.on-spec{
+
+		.on-spec {
 			background-image: $base-bg-gradient-color;
 			color: #FFF;
 		}
 	}
-	.s-box{
+
+	.s-box {
 		width: 100%;
 		display: flex;
 		border-bottom: solid 1px #EEE;
-		.s-img{
+
+		.s-img {
 			width: 140upx;
 			height: 140upx;
 			background-color: #EEE;
 			border-radius: 4px;
 		}
-		.g-info{
+
+		.g-info {
 			padding-left: 20upx;
-			.s-name{
+
+			.s-name {
 				padding-bottom: 4px;
 			}
-			.s-price{
+
+			.s-price {
 				color: #F00;
 				font-size: 14px;
 			}
 		}
 	}
-	.purchase-num{
+
+	.purchase-num {
 		width: 100%;
 		display: flex;
 		justify-content: space-between;
 		align-items: center;
 		border-bottom: solid 1px #EEE;
-		padding-bottom: 30upx;
-		.num{
-			font-size: 12px;
-		}
+		padding-bottom: 20upx;
 	}
 </style>

+ 459 - 0
css/style.css

@@ -0,0 +1,459 @@
+.background-gradient {
+  background-image: linear-gradient(to right, #F54319, #FF6D20);
+}
+* {
+  margin: 0;
+  padding: 0;
+}
+
+.pageBg {
+  background-color: rgb(244, 245, 249);
+  padding-bottom: 30rpx;
+  position: relative;
+  min-height: calc(100vh);
+}
+
+.margin0px {
+  margin: 0 !important;
+}
+
+.padding0px {
+  padding: 0 !important;
+}
+
+
+
+.text-left {
+  text-align: left !important;
+}
+
+.text-right {
+  text-align: right !important;
+}
+
+.text-center {
+  text-align: center !important;
+}
+
+.fl {
+  float: left;
+}
+
+.fr {
+  float: right;
+}
+
+/* 清除浮动 */
+.clearfix:after {
+  content: "";
+  display: block;
+  visibility: hidden;
+  clear: both;
+  height: 0;
+}
+
+.clearfix {
+  /* 为了照顾ie6浏览器*/
+  zoom: 1;
+}
+
+.ml5px {
+  margin-left: 10rpx !important;
+}
+
+.ml10px {
+  margin-left: 20rpx !important;
+}
+
+.ml15px {
+  margin-left: 30rpx !important;
+}
+
+.ml20px {
+  margin-left: 40rpx !important;
+}
+
+.ml40px {
+  margin-left: 80rpx !important;
+}
+
+.mr5px {
+  margin-right: 10rpx !important;
+}
+
+.mr10px {
+  margin-right: 20rpx !important;
+}
+
+.mr15px {
+  margin-right: 30rpx !important;
+}
+
+.mr20px {
+  margin-right: 40rpx !important;
+}
+
+.mt5px {
+  margin-top: 10rpx !important;
+}
+
+.mt10px {
+  margin-top: 20rpx !important;
+}
+
+.mt15px {
+  margin-top: 30rpx !important;
+}
+
+.mt20px {
+  margin-top: 40rpx !important;
+}
+
+.mt40px {
+  margin-top: 80rpx !important;
+}
+
+.mt50px {
+  margin-top: 100rpx !important;
+}
+
+.mt140px {
+  margin-top: 280rpx !important;
+}
+
+.mt28px {
+  margin-top: 56rpx !important;
+}
+
+.mb5px {
+  margin-bottom: 10rpx !important;
+}
+
+.mb10px {
+  margin-bottom: 20rpx !important;
+}
+
+.mb15px {
+  margin-bottom: 40rpx !important;
+}
+
+.mb20px {
+  margin-bottom: 40rpx !important;
+}
+
+.mb60px {
+  margin-bottom: 120rpx !important;
+}
+
+.pb20px {
+  padding-bottom: !40rpx;
+}
+
+.fz12px {
+  font-size: 24rpx !important;
+}
+
+.fz14px {
+  font-size: 28rpx !important;
+}
+
+.fz16px {
+  font-size: 32rpx !important;
+}
+
+.fz18px {
+  font-size: 36rpx !important;
+}
+
+.fz20px {
+  font-size: 40rpx !important;
+}
+
+.fz22px {
+  font-size: 44rpx !important;
+}
+
+.fz24px {
+  font-size: 48rpx !important;
+}
+
+.fz26px {
+  font-size: 52rpx !important;
+}
+
+.fz30px {
+  font-size: 60rpx !important;
+}
+
+.fz32px {
+  font-size: 64rpx !important;
+}
+
+.fz34px {
+  font-size: 68rpx !important;
+}
+
+.fz36px {
+  font-size: 72rpx !important;
+}
+
+.fz38px {
+  font-size: 76rpx !important;
+}
+
+.fz40px {
+  font-size: 80rpx !important;
+}
+
+.w5 {
+  width: 5% !important;
+}
+
+.w10 {
+  width: 10% !important;
+}
+
+.w15 {
+  width: 15% !important;
+}
+
+.w20 {
+  width: 20% !important;
+}
+
+.w25 {
+  width: 25% !important;
+}
+
+.w30 {
+  width: 30% !important;
+}
+
+.w35 {
+  width: 35% !important;
+}
+
+.w40 {
+  width: 40% !important;
+}
+
+.w45 {
+  width: 45% !important;
+}
+
+.w50 {
+  width: 50% !important;
+}
+
+.w55 {
+  width: 55% !important;
+}
+
+.w60 {
+  width: 60% !important;
+}
+
+.w65 {
+  width: 65% !important;
+}
+
+.w70 {
+  width: 70% !important;
+}
+
+.w75 {
+  width: 75% !important;
+}
+
+.w80 {
+  width: 80% !important;
+}
+
+.w85 {
+  width: 85% !important;
+}
+
+.w90 {
+  width: 90% !important;
+}
+
+.w95 {
+  width: 95% !important;
+}
+
+.w100 {
+  width: 100% !important;
+}
+
+.lineHeight28px {
+  line-height: 56rpx !important;
+}
+
+.lineHeight32px {
+  line-height: 64rpx !important;
+}
+
+.lineHeight40px {
+  line-height: 80rpx !important;
+}
+
+/* 更改 elemtui table 的默认样式 */
+.el-table td,
+.el-table th {
+  padding: 20rpx 0 !important;
+}
+
+.has-gutter th,
+.el-table__fixed-header-wrapper tr th {
+  background: rgba(68, 81, 176, 0.08) !important;
+  /* color: #47a1fc; */
+}
+
+.content {
+  padding: 40rpx 5%;
+}
+
+.v-step {
+  z-index: 9999;
+}
+
+.contentHeader {
+  line-height: 80rpx;
+  border-bottom: 2rpx solid #aaa;
+  padding-bottom: 20rpx;
+}
+
+.invalidColor {
+  color: #ccc;
+}
+
+.invalidColor100 {
+  color: #979797;
+}
+
+.warnColor {
+  color: #E6A23C;
+}
+
+.successColor {
+  color: #67C23A;
+}
+
+.failColor {
+  color: #F56C6C;
+}
+
+.rose0 {
+  color: red;
+}
+
+.sky0 {
+  color: #f0f9ff;
+}
+
+.sky5 {
+  color: #0ea5e9;
+}
+
+.pageWrap {
+  position: relative;
+  min-height: 500px;
+  background: #fff;
+  padding: 40rpx 100rpx;
+}
+
+.positionClass {
+  position: absolute;
+  bottom: 50rpx;
+  right: 10%
+}
+
+/* 修改 elementUI 弹框的头部样式 */
+.el-dialog__header .el-dialog__title {
+  display: block;
+  font-size: 40rpx;
+  border-bottom: 2rpx solid #bbbbbb;
+  padding-bottom: 20rpx;
+  font-weight: bold;
+}
+
+.el-dialog__body {
+  padding: 20px 40rpx 40rpx;
+}
+
+/* 文字超出部分显示省略号 */
+.overHide {
+  overflow: hidden;
+  text-overflow: ellipsis;
+  white-space: nowrap;
+}
+
+.fontcolor {
+  /*提示语:字的颜色*/
+  color: #ff9800;
+}
+
+.contain {
+  display: inline-block;
+  width: 100%;
+  padding: 0 30rpx;
+  box-sizing: border-box;
+  margin: auto;
+  position: relative;
+}
+
+.contain1 {
+  width: 100%;
+  box-sizing: border-box;
+  display: inline-block;
+  padding: 0 10%;
+}
+
+.subpageContain {
+  padding: 80rpx 10%;
+}
+
+/*超出一行显示省略号*/
+.ellipsis1 {
+  overflow: hidden;
+  text-overflow: ellipsis;
+  display: -webkit-box;
+  -webkit-line-clamp: 1;
+  line-clamp: 1;
+  -webkit-box-orient: vertical;
+  word-break: break-all;
+}
+
+/*超出两行显示省略号*/
+.ellipsis2 {
+  overflow: hidden;
+  text-overflow: ellipsis;
+  display: -webkit-box;
+  -webkit-line-clamp: 2;
+  line-clamp: 2;
+  -webkit-box-orient: vertical;
+  word-break: break-all;
+}
+
+.isIphoneX {
+  padding-bottom: 60rpx;
+}
+
+.ellipsis {
+  white-space: nowrap;
+  text-overflow: ellipsis;
+  overflow: hidden;
+}
+
+.ellipsis-2 {
+  word-break: break-all;
+  text-overflow: ellipsis;
+  display: -webkit-box;
+  -webkit-box-orient: vertical;
+  -webkit-line-clamp: 2;
+  overflow: hidden;
+}
+
+.inlineBlock {
+  display: inline-block;
+}

+ 11 - 0
env/dev.js

@@ -0,0 +1,11 @@
+const ENV_PATH = {
+  serverPath: 'http://192.168.5.3:8080', // 请求前缀地址
+  //serverFilePath: 'https://lsfdev.benyuntech.com/data/access', // 文件前缀地址
+  appId: 'wxfc1ae62fd810717d', // 小程序 appid
+  appName: '销售小程序', // 小程序名称(登录页面显示的名称)
+  name: '销售系统', // 小程序名称
+  // webSocketURL: 'wss://lsfdev.benyuntech.com/ws/websocket', // websocket url
+  logo: '/1679883944003-logo1.png', // 登录页面显示的 logo
+}
+
+module.exports = ENV_PATH

+ 136 - 13
main.js

@@ -1,14 +1,13 @@
 import App from './App'
 
-// #ifndef VUE3
 import Vue from 'vue'
 import './uni.promisify.adaptor'
 
-import request from './utils/request.js'
-Vue.prototype.$request = request;
-
 import uView from "uview-ui";
 Vue.use(uView);
+Vue.config.productionTip = false
+
+import './css/style.css'
 
 import mySwiper from './components/my-swiper/my-swiper.vue';
 Vue.component('my-swiper', mySwiper);
@@ -27,21 +26,145 @@ Vue.component('send-type', sendType);
 import useListTitle from './components/use-list-title/use-list-title.vue';
 Vue.component('use-list-title', useListTitle);
 
-Vue.config.productionTip = false
-App.mpType = 'app'
+// 配置项
+const config = process.env.ENV_PATH ? require(process.env.ENV_PATH) : require('./env/dev.js')
+Vue.prototype.serverPath = config.serverPath // 请求路径
+Vue.prototype.serverFilePath = config.serverFilePath // 文件路径
+Vue.prototype.appName = config.name // 应用名称
+Vue.prototype.appVersion = config.appVersion // 小程序版本
+Vue.prototype.webSocketURL = config.webSocketURL // socket 链接
+Vue.prototype.logo = config.logo //
+Vue.prototype.appId = config.appId // 微信小程序 appid
+Vue.prototype.$isIphoneX = false
+
+Vue.prototype.$request = function(method, url, data, isJSON, hideLoading, showErrMsg) {
+	return new Promise((resolve) => {
+		if (!hideLoading) {
+			uni.showLoading({
+				title: '请稍后...'
+			})
+		}
 
+		// 过滤 null,undefind,'' 的参数
+		for (let key in data) {
+			if (data[key] === null || data[key] === undefined || data[key] === '') {
+				delete data[key]
+			}
+		}
+
+		const token = uni.getStorageSync('token');
+		const tenantId = uni.getStorageSync('tenantId');
+		// if (tenantId) {
+		// 	data.tenantId = tenantId;
+		// }
+		url = url.indexOf('http') === 0 ? url : `${Vue.prototype.serverPath}${url}`;
+		uni.request({
+			url,
+			method,
+			data,
+			header: {
+			  'Content-Type': isJSON ? 'application/json' : 'application/x-www-form-urlencoded',
+			  'Authorization': 'Bearer ' + token,
+			  'clientId': '8871d05eacc4406083d3bb0a085b6999',
+			  // 'tenantId': Vue.prototype.tenantId 或者 'tenantId': `${tenantId}`
+			  // application/x-www-form-urlencoded application/json
+			},
+			success: (res) => {
+				console.log('resres', res)
+				uni.hideLoading();
+				if (res.statusCode === 200) {
+					resolve(res.data);
+				} else {
+					if (showErrMsg) {
+						resolve({
+							result: false,
+							msg: res.data.msg
+						})
+					} else {
+						resolve(false);
+						if (this.$refs && this.$refs.uNotify) {
+							this.$refs.uNotify.show({
+								type: 'error',
+								top: 0,
+								message: res.data.msg,
+								icon: 'error-circle'
+							})
+						}
+					}
+				}
+			},
+			fail: (err) => {
+				uni.hideLoading()
+				resolve(false)
+			}
+		})
+	})
+}
+
+Vue.prototype.autoLogin = async () => { // 小程序自动登录
+	return new Promise(resolve => {
+		uni.login({
+			success: async (res) => {
+				const result = await Vue.prototype.$request('post', '/miniLogin', {
+					code: res.code,
+					appid: '000000'
+					//appid: Vue.prototype.appId
+				})
+				if (result) {
+					uni.setStorageSync("token", result.data.access_token);
+					//await Vue.prototype.getUser()
+					resolve(true)
+				} else {
+					uni.showModal({
+						title: '温馨提示',
+						content: '您尚未注册,是否前往注册?',
+						showCancel: true,
+						confirmText: '去注册',
+						success: (response) => {
+							if (response.confirm) {
+								// 用户点击确定
+								uni.navigateTo({
+									url: '/pages/bindPhone/bindPhone'
+								})
+								resolve(true)
+							} else if (response.cancel) {
+								// 用户点击取消
+								resolve(false)
+							}
+						},
+						fail: () => {
+							resolve(false)
+						}
+					})
+				}
+			},
+			fail: (e) => {
+				resolve(false)
+			}
+		})
+	})
+}
+
+// 拼接文件完整地址
+Vue.prototype.getFilePath = (path) => {
+	return `${Vue.prototype.serverFilePath}${path}`
+}
+
+App.mpType = 'app'
 const app = new Vue({
-  ...App
+	...App
 })
 app.$mount()
-// #endif
+
 
 // #ifdef VUE3
-import { createSSRApp } from 'vue'
+import {
+	createSSRApp
+} from 'vue'
 export function createApp() {
-  const app = createSSRApp(App)
-  return {
-    app
-  }
+	const app = createSSRApp(App)
+	return {
+		app
+	}
 }
 // #endif

+ 1 - 1
manifest.json

@@ -50,7 +50,7 @@
     "quickapp" : {},
     /* 小程序特有相关 */
     "mp-weixin" : {
-        "appid" : "",
+        "appid": "wxfc1ae62fd810717d",
         "setting" : {
             "urlCheck" : false
         },

+ 262 - 4
package-lock.json

@@ -1,11 +1,269 @@
 {
+  "name": "bc_wx_applet",
+  "lockfileVersion": 3,
   "requires": true,
-  "lockfileVersion": 1,
-  "dependencies": {
-    "uview-ui": {
+  "packages": {
+    "": {
+      "dependencies": {
+        "uview-ui": "^2.0.36",
+        "vuex": "^4.0.2"
+      }
+    },
+    "node_modules/@babel/parser": {
+      "version": "7.24.5",
+      "resolved": "https://registry.npmmirror.com/@babel/parser/-/parser-7.24.5.tgz",
+      "integrity": "sha512-EOv5IK8arwh3LI47dz1b0tKUb/1uhHAnHJOrjgtQMIpu1uXd9mlFrJg9IUgGUgZ41Ch0K8REPTYpO7B76b4vJg==",
+      "peer": true,
+      "bin": {
+        "parser": "bin/babel-parser.js"
+      },
+      "engines": {
+        "node": ">=6.0.0"
+      }
+    },
+    "node_modules/@jridgewell/sourcemap-codec": {
+      "version": "1.4.15",
+      "resolved": "https://registry.npmmirror.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz",
+      "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==",
+      "peer": true
+    },
+    "node_modules/@vue/compiler-core": {
+      "version": "3.4.27",
+      "resolved": "https://registry.npmmirror.com/@vue/compiler-core/-/compiler-core-3.4.27.tgz",
+      "integrity": "sha512-E+RyqY24KnyDXsCuQrI+mlcdW3ALND6U7Gqa/+bVwbcpcR3BRRIckFoz7Qyd4TTlnugtwuI7YgjbvsLmxb+yvg==",
+      "peer": true,
+      "dependencies": {
+        "@babel/parser": "^7.24.4",
+        "@vue/shared": "3.4.27",
+        "entities": "^4.5.0",
+        "estree-walker": "^2.0.2",
+        "source-map-js": "^1.2.0"
+      }
+    },
+    "node_modules/@vue/compiler-dom": {
+      "version": "3.4.27",
+      "resolved": "https://registry.npmmirror.com/@vue/compiler-dom/-/compiler-dom-3.4.27.tgz",
+      "integrity": "sha512-kUTvochG/oVgE1w5ViSr3KUBh9X7CWirebA3bezTbB5ZKBQZwR2Mwj9uoSKRMFcz4gSMzzLXBPD6KpCLb9nvWw==",
+      "peer": true,
+      "dependencies": {
+        "@vue/compiler-core": "3.4.27",
+        "@vue/shared": "3.4.27"
+      }
+    },
+    "node_modules/@vue/compiler-sfc": {
+      "version": "3.4.27",
+      "resolved": "https://registry.npmmirror.com/@vue/compiler-sfc/-/compiler-sfc-3.4.27.tgz",
+      "integrity": "sha512-nDwntUEADssW8e0rrmE0+OrONwmRlegDA1pD6QhVeXxjIytV03yDqTey9SBDiALsvAd5U4ZrEKbMyVXhX6mCGA==",
+      "peer": true,
+      "dependencies": {
+        "@babel/parser": "^7.24.4",
+        "@vue/compiler-core": "3.4.27",
+        "@vue/compiler-dom": "3.4.27",
+        "@vue/compiler-ssr": "3.4.27",
+        "@vue/shared": "3.4.27",
+        "estree-walker": "^2.0.2",
+        "magic-string": "^0.30.10",
+        "postcss": "^8.4.38",
+        "source-map-js": "^1.2.0"
+      }
+    },
+    "node_modules/@vue/compiler-ssr": {
+      "version": "3.4.27",
+      "resolved": "https://registry.npmmirror.com/@vue/compiler-ssr/-/compiler-ssr-3.4.27.tgz",
+      "integrity": "sha512-CVRzSJIltzMG5FcidsW0jKNQnNRYC8bT21VegyMMtHmhW3UOI7knmUehzswXLrExDLE6lQCZdrhD4ogI7c+vuw==",
+      "peer": true,
+      "dependencies": {
+        "@vue/compiler-dom": "3.4.27",
+        "@vue/shared": "3.4.27"
+      }
+    },
+    "node_modules/@vue/devtools-api": {
+      "version": "6.6.1",
+      "resolved": "https://registry.npmmirror.com/@vue/devtools-api/-/devtools-api-6.6.1.tgz",
+      "integrity": "sha512-LgPscpE3Vs0x96PzSSB4IGVSZXZBZHpfxs+ZA1d+VEPwHdOXowy/Y2CsvCAIFrf+ssVU1pD1jidj505EpUnfbA=="
+    },
+    "node_modules/@vue/reactivity": {
+      "version": "3.4.27",
+      "resolved": "https://registry.npmmirror.com/@vue/reactivity/-/reactivity-3.4.27.tgz",
+      "integrity": "sha512-kK0g4NknW6JX2yySLpsm2jlunZJl2/RJGZ0H9ddHdfBVHcNzxmQ0sS0b09ipmBoQpY8JM2KmUw+a6sO8Zo+zIA==",
+      "peer": true,
+      "dependencies": {
+        "@vue/shared": "3.4.27"
+      }
+    },
+    "node_modules/@vue/runtime-core": {
+      "version": "3.4.27",
+      "resolved": "https://registry.npmmirror.com/@vue/runtime-core/-/runtime-core-3.4.27.tgz",
+      "integrity": "sha512-7aYA9GEbOOdviqVvcuweTLe5Za4qBZkUY7SvET6vE8kyypxVgaT1ixHLg4urtOlrApdgcdgHoTZCUuTGap/5WA==",
+      "peer": true,
+      "dependencies": {
+        "@vue/reactivity": "3.4.27",
+        "@vue/shared": "3.4.27"
+      }
+    },
+    "node_modules/@vue/runtime-dom": {
+      "version": "3.4.27",
+      "resolved": "https://registry.npmmirror.com/@vue/runtime-dom/-/runtime-dom-3.4.27.tgz",
+      "integrity": "sha512-ScOmP70/3NPM+TW9hvVAz6VWWtZJqkbdf7w6ySsws+EsqtHvkhxaWLecrTorFxsawelM5Ys9FnDEMt6BPBDS0Q==",
+      "peer": true,
+      "dependencies": {
+        "@vue/runtime-core": "3.4.27",
+        "@vue/shared": "3.4.27",
+        "csstype": "^3.1.3"
+      }
+    },
+    "node_modules/@vue/server-renderer": {
+      "version": "3.4.27",
+      "resolved": "https://registry.npmmirror.com/@vue/server-renderer/-/server-renderer-3.4.27.tgz",
+      "integrity": "sha512-dlAMEuvmeA3rJsOMJ2J1kXU7o7pOxgsNHVr9K8hB3ImIkSuBrIdy0vF66h8gf8Tuinf1TK3mPAz2+2sqyf3KzA==",
+      "peer": true,
+      "dependencies": {
+        "@vue/compiler-ssr": "3.4.27",
+        "@vue/shared": "3.4.27"
+      },
+      "peerDependencies": {
+        "vue": "3.4.27"
+      }
+    },
+    "node_modules/@vue/shared": {
+      "version": "3.4.27",
+      "resolved": "https://registry.npmmirror.com/@vue/shared/-/shared-3.4.27.tgz",
+      "integrity": "sha512-DL3NmY2OFlqmYYrzp39yi3LDkKxa5vZVwxWdQ3rG0ekuWscHraeIbnI8t+aZK7qhYqEqWKTUdijadunb9pnrgA==",
+      "peer": true
+    },
+    "node_modules/csstype": {
+      "version": "3.1.3",
+      "resolved": "https://registry.npmmirror.com/csstype/-/csstype-3.1.3.tgz",
+      "integrity": "sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==",
+      "peer": true
+    },
+    "node_modules/entities": {
+      "version": "4.5.0",
+      "resolved": "https://registry.npmmirror.com/entities/-/entities-4.5.0.tgz",
+      "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==",
+      "peer": true,
+      "engines": {
+        "node": ">=0.12"
+      },
+      "funding": {
+        "url": "https://github.com/fb55/entities?sponsor=1"
+      }
+    },
+    "node_modules/estree-walker": {
+      "version": "2.0.2",
+      "resolved": "https://registry.npmmirror.com/estree-walker/-/estree-walker-2.0.2.tgz",
+      "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==",
+      "peer": true
+    },
+    "node_modules/magic-string": {
+      "version": "0.30.10",
+      "resolved": "https://registry.npmmirror.com/magic-string/-/magic-string-0.30.10.tgz",
+      "integrity": "sha512-iIRwTIf0QKV3UAnYK4PU8uiEc4SRh5jX0mwpIwETPpHdhVM4f53RSwS/vXvN1JhGX+Cs7B8qIq3d6AH49O5fAQ==",
+      "peer": true,
+      "dependencies": {
+        "@jridgewell/sourcemap-codec": "^1.4.15"
+      }
+    },
+    "node_modules/nanoid": {
+      "version": "3.3.7",
+      "resolved": "https://registry.npmmirror.com/nanoid/-/nanoid-3.3.7.tgz",
+      "integrity": "sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==",
+      "funding": [
+        {
+          "type": "github",
+          "url": "https://github.com/sponsors/ai"
+        }
+      ],
+      "peer": true,
+      "bin": {
+        "nanoid": "bin/nanoid.cjs"
+      },
+      "engines": {
+        "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1"
+      }
+    },
+    "node_modules/picocolors": {
+      "version": "1.0.1",
+      "resolved": "https://registry.npmmirror.com/picocolors/-/picocolors-1.0.1.tgz",
+      "integrity": "sha512-anP1Z8qwhkbmu7MFP5iTt+wQKXgwzf7zTyGlcdzabySa9vd0Xt392U0rVmz9poOaBj0uHJKyyo9/upk0HrEQew==",
+      "peer": true
+    },
+    "node_modules/postcss": {
+      "version": "8.4.38",
+      "resolved": "https://registry.npmmirror.com/postcss/-/postcss-8.4.38.tgz",
+      "integrity": "sha512-Wglpdk03BSfXkHoQa3b/oulrotAkwrlLDRSOb9D0bN86FdRyE9lppSp33aHNPgBa0JKCoB+drFLZkQoRRYae5A==",
+      "funding": [
+        {
+          "type": "opencollective",
+          "url": "https://opencollective.com/postcss/"
+        },
+        {
+          "type": "tidelift",
+          "url": "https://tidelift.com/funding/github/npm/postcss"
+        },
+        {
+          "type": "github",
+          "url": "https://github.com/sponsors/ai"
+        }
+      ],
+      "peer": true,
+      "dependencies": {
+        "nanoid": "^3.3.7",
+        "picocolors": "^1.0.0",
+        "source-map-js": "^1.2.0"
+      },
+      "engines": {
+        "node": "^10 || ^12 || >=14"
+      }
+    },
+    "node_modules/source-map-js": {
+      "version": "1.2.0",
+      "resolved": "https://registry.npmmirror.com/source-map-js/-/source-map-js-1.2.0.tgz",
+      "integrity": "sha512-itJW8lvSA0TXEphiRoawsCksnlf8SyvmFzIhltqAHluXd88pkCd+cXJVHTDwdCr0IzwptSm035IHQktUu1QUMg==",
+      "peer": true,
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/uview-ui": {
       "version": "2.0.36",
       "resolved": "https://registry.npmmirror.com/uview-ui/-/uview-ui-2.0.36.tgz",
-      "integrity": "sha512-ASSZT6M8w3GTO1eFPbsgEFV0U5UujK+8pTNr+MSUbRNcRMC1u63DDTLJVeArV91kWM0bfAexK3SK9pnTqF9TtA=="
+      "integrity": "sha512-ASSZT6M8w3GTO1eFPbsgEFV0U5UujK+8pTNr+MSUbRNcRMC1u63DDTLJVeArV91kWM0bfAexK3SK9pnTqF9TtA==",
+      "engines": {
+        "HBuilderX": "^3.1.0"
+      }
+    },
+    "node_modules/vue": {
+      "version": "3.4.27",
+      "resolved": "https://registry.npmmirror.com/vue/-/vue-3.4.27.tgz",
+      "integrity": "sha512-8s/56uK6r01r1icG/aEOHqyMVxd1bkYcSe9j8HcKtr/xTOFWvnzIVTehNW+5Yt89f+DLBe4A569pnZLS5HzAMA==",
+      "peer": true,
+      "dependencies": {
+        "@vue/compiler-dom": "3.4.27",
+        "@vue/compiler-sfc": "3.4.27",
+        "@vue/runtime-dom": "3.4.27",
+        "@vue/server-renderer": "3.4.27",
+        "@vue/shared": "3.4.27"
+      },
+      "peerDependencies": {
+        "typescript": "*"
+      },
+      "peerDependenciesMeta": {
+        "typescript": {
+          "optional": true
+        }
+      }
+    },
+    "node_modules/vuex": {
+      "version": "4.0.2",
+      "resolved": "https://registry.npmmirror.com/vuex/-/vuex-4.0.2.tgz",
+      "integrity": "sha512-M6r8uxELjZIK8kTKDGgZTYX/ahzblnzC4isU1tpmEuOIIKmV+TRdc+H4s8ds2NuZ7wpUTdGRzJRtoj+lI+pc0Q==",
+      "dependencies": {
+        "@vue/devtools-api": "^6.0.0-beta.11"
+      },
+      "peerDependencies": {
+        "vue": "^3.0.2"
+      }
     }
   }
 }

+ 27 - 0
package.json

@@ -0,0 +1,27 @@
+{
+	"name": "my-project",
+	"version": "1.0.0",
+	"description": "",
+	"main": "main.js",
+	"uni-app": {
+		"scripts": {
+			"weixin:dev": {
+				"title": "开发版",
+				"env": {
+					"UNI_PLATFORM": "mp-weixin",
+					"ENV_PATH": "./env/dev.js"
+				},
+				"define": {
+					"WXCS-PLATFORM": true
+				}
+			}
+		}
+	},
+	"keywords": [],
+	"author": "",
+	"license": "ISC",
+	"dependencies": {
+		"uview-ui": "^2.0.36",
+		"vuex": "^4.0.2"
+	}
+}

+ 83 - 24
pages.json

@@ -1,60 +1,100 @@
 {
 	"pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
 		{
-			"path" : "pages/order/myOrder/myOrder",
+			"path" : "pages/classify/classify",
 			"style" : 
 			{
-				"navigationBarTitleText" : "我的订单",
+				"navigationBarTitleText" : "首页",
 				"enablePullDownRefresh" : false
 			}
 		},
 		{
-			"path" : "pages/order/paySuccess/paySuccess",
+			"path" : "pages/user/user",
 			"style" : 
 			{
-				"navigationBarTitleText" : "支付成功",
+				"navigationBarTitleText" : "我的",
 				"enablePullDownRefresh" : false
 			}
 		},
 		{
-			"path" : "pages/order/orderDetail/orderDetail",
+			"path" : "pages/user/myInfo",
 			"style" : 
 			{
-				"navigationBarTitleText" : "订单详情",
+				"navigationBarTitleText" : "个人中心",
 				"enablePullDownRefresh" : false
 			}
 		},
 		{
-			"path" : "pages/classify/classify",
+			"path" : "pages/order/orderPaid/orderPaid",
 			"style" : 
 			{
-				"navigationBarTitleText" : "分类",
+				"navigationBarTitleText" : "订单详情"
+			}
+		},
+		{
+			"path" : "pages/order/submitOrder/submitOrder",
+			"style" : 
+			{
+				"navigationBarTitleText" : "提交订单",
 				"enablePullDownRefresh" : false
 			}
 		},
 		{
-			"path": "pages/index/index",
-			"style": {
-				"navigationBarTitleText": "首页"
+			"path" : "pages/login/qrCode",
+			"style" : 
+			{
+				"navigationBarTitleText" : "登录"
 			}
 		},
+		
 		{
-			"path" : "pages/order/submitOrder/submitOrder",
+			"path" : "pages/diningList/diningList",
 			"style" : 
 			{
-				"navigationBarTitleText" : "提交订单",
+				"navigationBarTitleText" : "餐车列表"
+			}
+		},
+			
+		{
+			"path" : "pages/diningCar/diningCar",
+			"style" : 
+			{
+				"navigationBarTitleText" : "餐车信息",
 				"enablePullDownRefresh" : false
 			}
 		},
 		{
-			"path" : "pages/user/user",
+			"path" : "pages/bindPhone/bindPhone",
 			"style" : 
 			{
-				"navigationBarTitleText" : "我的",
+				"navigationBarTitleText" : "登录",
+				"enablePullDownRefresh" : false
+			}
+		},
+		{
+			"path" : "pages/order/myOrder/myOrder",
+			"style" : 
+			{
+				"navigationBarTitleText" : "我的订单",
+				"enablePullDownRefresh" : false
+			}
+		},
+		{
+			"path" : "pages/order/paySuccess/paySuccess",
+			"style" : 
+			{
+				"navigationBarTitleText" : "支付成功",
+				"enablePullDownRefresh" : false
+			}
+		},
+		{
+			"path" : "pages/order/orderDetail/orderDetail",
+			"style" : 
+			{
+				"navigationBarTitleText" : "订单详情",
 				"enablePullDownRefresh" : false
 			}
 		},
-		
 		{
 			"path" : "pages/goodDetail/goodDetail",
 			"style" : 
@@ -62,6 +102,25 @@
 				"navigationBarTitleText" : "商品详情",
 				"enablePullDownRefresh" : false
 			}
+		},
+		{
+			"path": "pages/index/index",
+			"style": {
+				"navigationBarTitleText": "首页"
+			}
+		},
+		{
+			"path": "pages/index/home",
+			"style": {
+				"navigationBarTitleText": "我的"
+			}
+		},
+		{
+			"path" : "pages/order/orderDetails/orderDetails",
+			"style" : 
+			{
+				"navigationBarTitleText" : ""
+			}
 		}
 	],
 	"easycom": {
@@ -79,14 +138,14 @@
 				"selectedIconPath": "static/ic_hone.png",
 				"text": "首页"
 			},
+			// {
+			// 	"pagePath": "pages/classify/classify",
+			// 	"iconPath": "static/ic_hone.png",
+			// 	"selectedIconPath": "static/ic_hone.png",
+			// 	"text": "分类"
+			// },
 			{
-				"pagePath": "pages/classify/classify",
-				"iconPath": "static/ic_hone.png",
-				"selectedIconPath": "static/ic_hone.png",
-				"text": "分类"
-			},
-			{
-				"pagePath": "pages/user/user",
+				"pagePath": "pages/index/home",
 				"iconPath": "static/ic_hone.png",
 				"selectedIconPath": "static/ic_hone.png",
 				"text": "我的"
@@ -95,7 +154,7 @@
 	},
 	"globalStyle": {
 		"navigationBarTextStyle": "black",
-		"navigationBarTitleText": "uni-app",
+		"navigationBarTitleText": "销售系统",
 		"navigationBarBackgroundColor": "#FFFFFF",
 		"backgroundColor": "#EEEEEE"
 	},

+ 95 - 0
pages/bindPhone/bindPhone.vue

@@ -0,0 +1,95 @@
+<template>
+  <view>
+    <u-notify ref="uNotify"></u-notify>
+    <view class="logoBox text-center">
+      <view class="logo">
+        <!-- <u--image :showLoading="true" shape="circle" :src="getFilePath(logo)" width="100px" height="100px"></u--image> -->
+      </view>
+      <view class="">欢迎加入{{appName}}</view>
+    </view>
+    <view class="invalidColor fz14px text-center mb20px">申请获取您的微信绑定手机号</view>
+    <view class="contain">
+      <u-button text="一键注册" type="success" openType="getPhoneNumber" @getphonenumber="decryptPhoneNumber"></u-button>
+    </view>
+  </view>
+</template>
+
+<script>
+  // import {
+  //   logo
+  // } from '../../env/dev';
+  export default {
+    data() {
+      return {
+        // logo: this.logo,
+        // appName: this.appName
+		appName: '餐车活动'
+      };
+    },
+    onLoad(options) { // 监听页面加载
+    },
+    onUnload() { // 监听页面卸载
+
+    },
+    onShow() { // 监听页面显示
+
+    },
+    onHide() { // 监听页面隐藏
+
+    },
+    onReachBottom() { // 上拉触底
+
+    },
+    methods: {
+      async decryptPhoneNumber(e) {
+        // 获取手机号
+        let result = await this.$request('post', '/userinfo/auth/getWxPhone', {
+          code: e.detail.code,
+          appid: this.appId
+        })
+        if (!result) {
+          uni.showToast({
+            title: '授权失败',
+            icon: 'success'
+          })
+          return
+        }
+        const code = await new Promise((resolve) => {
+          uni.login({
+            success: (res) => {
+              resolve(res.code)
+            },
+            fail: () => {
+              resolve(false)
+            }
+          })
+        })
+        // 注册
+        const res = await this.$request('post', '/userinfo/auth/bindPhone', {
+          code,
+          appid: this.appId,
+          phone: result.msg
+        })
+        if (res) {
+          uni.showToast({
+            title: '注册成功',
+            icon: 'success'
+          })
+          uni.setStorageSync("token", res.data.token);
+          await this.getUser()
+          uni.navigateBack(-1)
+        }
+      }
+    }
+  }
+</script>
+
+<style lang="scss" scoped>
+  .logoBox {
+    margin: 200rpx 0 300rpx;
+
+    .logo {
+      display: inline-block;
+    }
+  }
+</style>

+ 285 - 107
pages/classify/classify.vue

@@ -1,154 +1,332 @@
 <template>
 	<view class="w-full">
-		<!-- <top-search :isSearch="false" @searchClick="searchClick"></top-search>
-		<view class="w-full padding-lr-sm box-sizing-b dflex-b">
-			<scroll-view class="goods-category" scroll-x>
-				<view class="category-box">
-					<view class="category-item padding-lr-lg" v-for="item in 8" :key="item" :class="{'on-category':onIndex === item}">分类{{item+1}}</view>
+		<view>
+			<u-row justify="space-between" customStyle="margin-bottom: 10px">
+				<u-col span="3">
+					<view class="icon-container-l" @click="onOrder">
+						<uni-badge size="normal" :text="txts" absolute="rightTop">
+							<u-icon :name="iconCooking" label="自提" labelPos="bottom" size="32"></u-icon>
+						</uni-badge>
+					</view>
+				</u-col>
+				<view class="container">
+					<u-tag plain :text="cList.openState ? '营业中' : '离线'" :type="cList.openState ? 'success' : 'error'"
+						size="mini"></u-tag>
+					<view @click="btnIc">
+						<u-icon :label="cList.name" labelPos="left" size="16" name="arrow-down"></u-icon>
+					</view>
 				</view>
-			</scroll-view>
-			<view class="classify-icon">
-				<u-icon name="grid-fill" size="30" @click="show = true" />
-			</view>
+				<u-col span="3">
+					<view class="icon-container-r" @click="onMyInfo">
+						<u-icon label="我的" labelPos="bottom" size="32" :name="iconPeople"></u-icon>
+					</view>
+				</u-col>
+			</u-row>
 		</view>
-		<u-popup :show="show" mode="left" @close="show = false">
-			<view class="classify-popup padding-lr-lg padding-tb box-sizing-b">
-				<view class="padding-tb-sm">全部</view>
-				<view class="padding-tb-sm" v-for="index in 8">分类{{index+1}}</view>
-			</view>
-		</u-popup> -->
-		<view class="w-full dflex-b padding-sm box-sizing-b dflex-wrap-w">
-			<view class="goods-item margin-bottom-sm" v-for="index in 4" :key="index">
-				<view class="img dflex-c">
-					<image mode="aspectFit" :src="'../../static/x'+ index%2 +'.jpg'"></image>
+		<view class="w-full dflex-b padding-xs box-sizing-b dflex-wrap-w">
+			<view class="goods-item margin-bottom-sm" v-for="(item, gindex)  in goods" :key="gindex">
+				<view class="img dflex-c" @click="toDetial(item)">
+					<image mode="aspectFit" :src="item.imgList[0].url"></image>
 				</view>
-				<view class="title">我是标题我是标题我是标题我是标题</view>
+				<view class="title">{{item.spuName}}</view>
 				<view class="dflex padding-bottom-xs">
-					<u-tag text="夏季校服" type="error" bgColor="#E8341F" size="mini"></u-tag>
+					<u-tag plain text="销量: 199" borderColor="#FF6D20" color="#FF6D20" size="mini"></u-tag>
 				</view>
 				<view class="w-full dflex-b">
-					<view class="price">23.30</view>
-					<u-tag text="加购" bgColor="#000" shape="circle" size="mini" @click="goCart"></u-tag>
+					<view class="price">{{item.minPrice ? item.minPrice : '无'}}</view>
+					<view>
+						<u-button type="primary" shape="circle" size="small"
+							color="linear-gradient(to right, #F54319, #FF6D20)" @click="goCart(item)">
+							<u-icon name="shopping-cart-fill" size="28" color="#fff"></u-icon>
+						</u-button>
+					</view>
 				</view>
 			</view>
 		</view>
-		<my-gap :height="130" />
-		
+		<my-gap :height="10" />
+		<specPopup class='spec-box' ref="specPopup" :cardMsg="cardMsg" @update-shopmsg="handleUpdateShopMsg"
+			@addShop="carListMeg">
+		</specPopup>
 		<view class="cart-bottom padding-sm dflex-b">
 			<view class="cart padding-lr">
-				<uni-badge size="small" :text="100" absolute="rightTop">
+				<uni-badge size="small" :text="buyCount" absolute="rightTop">
 					<u-icon name="shopping-cart-fill" size="28" color="#FF873D" @click="showCart"></u-icon>
 				</uni-badge>
-				<text class="cart-total">¥35.60</text>
+				<text class="cart-total">总计:¥{{total}}</text>
 			</view>
-			<view class="balance dflex-c">去结算</view>
+			<view class="balance dflex-c background-gradient" @click="toBuy">去结算</view>
 		</view>
-		<cartPopupVue ref="cartPopup" />
+		<cartPopupVue ref="cartPopup" @selected-changed="handleSelectedChanged" />
+
 	</view>
 </template>
 
 <script>
 	import cartPopupVue from '../../components/cartPopup.vue'
+	import specPopup from '@/components/specPopup.vue'
+	import iconCooking from '../../static/cooking.png'
+	import iconPeople from '../../static/people.png'
+	import shoppingCart from '../../static/shoppingCart.png'
 	export default {
-		components:{cartPopupVue},
+		components: {
+			cartPopupVue,
+			specPopup
+		},
 		data() {
 			return {
-				onIndex:0,
-				show:false
+				onIndex: 0,
+				show: false,
+				iconCooking: iconCooking,
+				iconPeople: iconPeople,
+				shoppingCart: shoppingCart,
+				tags: 1,
+				txts: 1,
+				carList: {},
+				goods: [],
+				total: 0,
+				cList: {},
+				cardMsg: {},
+				selectedList: [],
+				buyCount: 0
 			}
 		},
+		onLoad() {
+			const e = uni.getStorageSync('carl')
+			this.cList = e
+			this.fatchDate()
+			this.carListMeg()
+		},
 		methods: {
 			// 加购
-			goCart(){},
-			showCart(){
-				this.$refs.cartPopup.setShow(true);
+			goCart(e) {
+				console.log('================', e)
+				this.cardMsg = e
+				this.$nextTick(() => {
+					this.$refs.specPopup.open();
+				});
+			},
+			handleSelectedChanged(selectedItems) {
+				console.log('选中的数据:', selectedItems)
+				this.carList = selectedItems
+				this.carListMeg()
+				this.totalPrice()
+			},
+
+			//计算selected为true的
+			totalPrice() {
+				let total = 0;
+				for (let i = 0; i < this.carList.length; i++) {
+					// 检查商品是否有 selected 属性
+					if (this.carList[i].hasOwnProperty('selected')) {
+						// 如果 selected 属性存在,只有当它为 true 时才计算
+						if (this.carList[i].selected) {
+							let priceInCents = Math.round(this.carList[i].price * 100);
+							let quant = this.carList[i].quantity;
+							total += priceInCents * quant;
+						}
+					} else {
+						// 如果 selected 属性不存在,直接计算所有商品
+						let priceInCents = Math.round(this.carList[i].price * 100);
+						let quant = this.carList[i].quantity;
+						total += priceInCents * quant;
+					}
+				}
+
+				// 将总价格转换回浮点数(以元为单位)
+				this.total = (total / 100).toFixed(2);
+
+				console.log('total', this.total);
+			},
+			showCart() {
+				this.$nextTick(() => {
+					this.$refs.cartPopup.setShow(true)
+				})
+			},
+			btnIc() {
+				uni.navigateTo({
+					url: `/pages/diningList/diningList`
+				})
+			},
+			toDetial(e) {
+				console.log('eeeeee====================', e)
+				const data = {
+					spuId: e.spuId,
+					tobyC: this.buyCount
+				}
+				uni.navigateTo({
+				  url: `/pages/goodDetail/goodDetail?data=${encodeURIComponent(JSON.stringify(data))}`
+				})
+			},
+			toBuy() {
+				console.log('e========carList', this.carList)
+				// uni.navigateTo({
+				// 	url: `/pages/order/submitOrder/submitOrder`
+				// })
+			},
+			onOrder() {
+				uni.navigateTo({
+					url: `/pages/order/myOrder/myOrder`
+				})
+			},
+			onMyInfo() {
+				const info = {
+					customerPhone: this.cList.customerPhone
+				}
+				console.log('======================', info)
+				uni.setStorageSync("info", info)
+				uni.navigateTo({
+					url: `/pages/user/user`
+				})
+			},
+			// 获取餐车列表
+			async fatchDate() {
+				var queryParmas = {
+					id: this.cList.id
+				}
+				console.log('idididididid', queryParmas)
+				const result = await this.$request('post', '/sale/diningCarProduct/queryDiningCarProduct', queryParmas,
+					true)
+				if (result) {
+					const queIds = new Set(result.rows.map(item => item.spuId));
+					const spuIds = Array.from(queIds).join(',');
+					const res = await this.$request('get', `/item/spu/queryByIds?spuIds=${spuIds}`)
+					const data = res.data
+					this.goods = data.filter(item => item.status !== 1)
+					console.log('res', res.data)
+				}
+			},
+			async carListMeg() {
+				const res = await this.$request('get', `/front/shoppingCart/list`, {
+					storeId: this.cList.id
+				})
+				console.log('res.data==============', res.data)
+				if (res) {
+					const carList = res.data
+					this.buyCount = carList.length
+				}
 			}
 		}
 	}
 </script>
 
 <style scoped lang="scss">
-.goods-category{
-	width: calc(100% - 100rpx);
-	border-radius: 14rpx;
-	overflow: hidden;
-	.category-box{
-		height: 70rpx;
+	.goods-category {
+		width: calc(100% - 100rpx);
+		border-radius: 14rpx;
+		overflow: hidden;
+
+		.category-box {
+			height: 70rpx;
+			width: 100%;
+			display: flex;
+			align-items: center;
+
+			.category-item {
+				font-size: 14px;
+				flex-shrink: 0;
+				height: 100%;
+				line-height: 70rpx;
+			}
+
+			.on-category {
+				color: #FFF;
+				background-color: #000;
+			}
+		}
+
+		.classify-icon {
+			width: 100rpx;
+			display: flex;
+			align-items: center;
+			justify-content: flex-end;
+		}
+	}
+
+	.goods-item {
+		width: 48%;
+		overflow: hidden;
+		box-sizing: border-box;
+		border: solid 4px #FFF;
+		border-radius: 5px;
+		box-shadow: 0px 3px 10px 0px rgba(213, 221, 232, 0.5);
+
+		.img {
+			width: 100%;
+			height: 180rpx;
+			overflow: hidden;
+			background: #EEE;
+		}
+
+		.title {
+			width: 100%;
+			overflow: hidden;
+			white-space: nowrap;
+			text-overflow: ellipsis;
+			padding: 10rpx;
+		}
+	}
+
+	.cart-bottom {
 		width: 100%;
-		display: flex;
-		align-items: center;
-		.category-item{
-			font-size: 14px;
-			flex-shrink: 0;
+		position: fixed;
+		left: 0;
+		bottom: 0;
+		height: 130rpx;
+		box-sizing: border-box;
+		background-color: #FFF;
+		box-shadow: 0px -4px 16px 0px rgba(0, 0, 0, 0.15);
+		z-index: 10800;
+
+		.cart {
+			width: calc(100% - 220rpx);
+			border-radius: 5px;
+			background-color: #FEEEE4;
+			display: flex;
+			align-items: center;
 			height: 100%;
-			line-height: 70rpx;
+
+			.cart-total {
+				padding-left: 40rpx;
+				font-size: 16px;
+				font-weight: 700;
+			}
 		}
-		.on-category{
+
+		.balance {
+			width: 200rpx;
+			height: 100%;
+			background-color: #FF0000;
+			font-size: $uni-font-size-lg;
+			border-radius: 5px;
 			color: #FFF;
-			background-color: #000;
 		}
 	}
-	.classify-icon{
-		width: 100rpx;
-		display: flex;
-		align-items: center;
-		justify-content: flex-end;
-	}
-}
-.goods-item{
-	width: 48%;
-	overflow: hidden;
-	box-sizing: border-box;
-	border:solid 4px #FFF;
-	border-radius: 5px;
-	box-shadow: 0px 3px 10px 0px rgba(213,221,232,0.5);
-	.img{
-		width: 100%;
-		height: 350rpx;
-		overflow: hidden;
-		background: #EEE;
+
+	.spec-box {
+		position: relative;
+		z-index: 99999;
 	}
-	.title{
-		width: 100%;
-		overflow: hidden;
-		white-space: nowrap;
-		text-overflow: ellipsis;
-		padding: 10rpx;
+
+	.classify-popup {
+		width: 400rpx;
 	}
-}
-.cart-bottom{
-	width: 100%;
-	position: fixed;
-	left: 0;
-	bottom: 0;
-	height: 130rpx;
-	box-sizing: border-box;
-	background-color: #FFF;
-	box-shadow: 0px -4px 16px 0px rgba(0,0,0,0.15);
-	z-index: 10800;
-	.cart{
-		width: calc(100% - 220rpx);
-		border-radius: 5px;
-		background-color: #FEEEE4;
+
+	.container {
 		display: flex;
+		flex-direction: column;
+		/* 垂直排列子元素 */
 		align-items: center;
-		height: 100%;
-		.cart-total{
-			padding-left: 40rpx;
-			font-size: 16px;
-			font-weight: 700;
-		}
+		/* 垂直居中子元素 */
+		justify-content: center;
+		/* 水平居中子元素 */
 	}
-	.balance{
-		width: 200rpx;
-		height: 100%;
-		background-color: #FF0000;
-		font-size: $uni-font-size-lg;
-		border-radius: 5px;
-		color: #FFF;
+
+	.icon-container-l {
+		margin-top: 10px;
+		margin-left: 15px;
+	}
+
+	.icon-container-r {
+		margin-left: 20px;
 	}
-}
-.classify-popup{
-	width: 400rpx;
-}
-</style>
+</style>

+ 205 - 0
pages/diningCar/diningCar.vue

@@ -0,0 +1,205 @@
+<template>
+	<view>
+		<view class="boxWarp mb20px">
+			<view class="box" style="height:100vh;">
+				<my-swiper v-if="dinList.diningCarImg && dinList.diningCarImg.length"
+					:datas="dinList.diningCarImg" />
+				<div v-else>
+					<u-empty mode="data" icon="http://cdn.uviewui.com/uview/empty/data.png">
+					</u-empty>
+				</div>
+				<!-- <my-swiper :datas="dinList.diningCarImg" /> -->
+				<view class="boxContent2" style="margin-top:-10%;">
+					<view class="clearfix" style="margin-bottom: 10px;">
+						<text class="fz26px" style="font-weight: bold;">{{dinList.name ? dinList.name : '无'}}</text>
+						<u-line dashed></u-line>
+					</view>
+					<view class="flex-container">
+						<text class="flex-item">营业状态</text>
+						<u-tag class="flex-item tag-item" plain :text="dinList.openState ? '营业中' : '离线'"
+							:type="dinList.openState ? 'success' : 'error'" size="mini"></u-tag>
+					</view>
+					<text>客服电话:{{dinList.customerPhone ? dinList.customerPhone : '无'}}</text>
+				</view>
+				<view class="footer">
+					<u-button type="primary" shape="circle" icon="phone" text="拨打客服电话"
+						color="linear-gradient(to right, #F54319, #FF6D20)" @click="call()"></u-button>
+				</view>
+			</view>
+		</view>
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				img: 'https://cdn.uviewui.com/uview/album/1.jpg',
+				orderinfo: {},
+				dinList: {
+					name: '23333',
+					openState: 1,
+					imageUrl: ''
+				},
+				swiperDatas: [{
+					img: '../../static/banner1.jpg'
+				}, {
+					img: '../../static/banner2.png'
+				}],
+			}
+		},
+		onLoad(e) {
+			this.fatchDate(e);
+		},
+		methods: {
+			call() {
+				if (this.dinList.customerPhone) {
+					uni.makePhoneCall({
+						phoneNumber: this.dinList.customerPhone
+					});
+				} else {
+					uni.showToast({
+						icon: 'none',
+						title: '暂无商家电话'
+					})
+				}
+			},
+			async fatchDate(e) {
+				console.log('e===========================e', e)
+				var queryParmas = {
+					id: e.id
+				}
+				console.log('idididididid', queryParmas)
+				const result = await this.$request('post', '/sale/diningCar/queryDiningCarById', queryParmas, true)
+				if (result) {
+					console.log("result", result)
+					this.dinList = result.data
+					// this.dinList.diningCarImg = JSON.parse(result.data.diningCarImg)
+					this.dinList.diningCarImg = JSON.parse(result.data.diningCarImg).map(item => {
+					  return {...item, img: item.url, ...(item.url ? {url: undefined} : {})};
+					});
+
+					console.log('this.dinList', this.dinList)
+					console.log('this.dinList.diningCarImg', this.dinList.diningCarImg)
+				}
+			}
+
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	.font {
+		font-family: "CustomFont";
+		color: #fff;
+	}
+
+	.flex-container {
+		display: flex;
+		align-items: center;
+		/* 垂直居中 */
+		justify-content: flex-start;
+		/* 水平左对齐 */
+	}
+
+	.flex-item {
+		/* 根据需要设置text的宽度 */
+		width: 100%;
+		/* 或者其他适当的宽度 */
+	}
+
+	.tag-item {
+		margin-left: auto;
+		/* 将标签推到右边 */
+	}
+
+	.box {
+		padding: 20rpx 0;
+		// background-image: linear-gradient(#00a551 10%, #fff 30%);
+		border-bottom-left-radius: 30rpx;
+		border-bottom-right-radius: 30rpx;
+		background-position: top;
+		box-shadow: 0 0 5px 2px #ebebeb;
+		background-repeat: no-repeat;
+	}
+
+	.linear2 {
+		// background-image: linear-gradient(#00a551 20%, #fff 50%);
+		background-image: url('{{dinList.imageUrl}}');
+		// background-image: url('https://cdn.uviewui.com/uview/album/1.jpg');
+	}
+
+	.boxText {
+		font-size: 28rpx;
+		line-height: 40rpx;
+		color: #c8c9cc;
+	}
+
+	.tabFlexBox {
+		display: flex;
+		text-align: center;
+		// background-color: #fff;
+		padding-bottom: 10rpx;
+	}
+
+	.tabFlexBox .tabFlexBoxItem {
+		flex: 1;
+		position: relative;
+	}
+
+	.tabFlexBox .tabFlexBoxItem .tabFlexBoxItemTitle {
+		font-size: 36rpx;
+		font-weight: bold;
+		line-height: 80rpx;
+	}
+
+	.tabFlexBox .tabFlexBoxItem .tabFlexBoxItemDes {
+		color: #c8c9cc;
+		font-size: 28rpx;
+		line-height: 40rpx;
+		display: inline-block;
+		padding: 0 20rpx;
+	}
+
+	.tabFlexBox .tabFlexBoxItem .tabFlexBoxItemLine {
+		width: 1px;
+		height: 50rpx;
+		background-color: #c8c9cc;
+		position: absolute;
+		top: 50%;
+		transform: translateY(-50%);
+		right: 0;
+	}
+
+	.tabFlexBox .tabFlexBoxItem.active .tabFlexBoxItemTitle {
+		color: #00a551;
+		font-size: 40rpx;
+	}
+
+	.tabFlexBox .tabFlexBoxItem.active .tabFlexBoxItemDes {
+		background-color: #00a551;
+		border-radius: 20rpx;
+		color: #fff;
+	}
+
+	.boxContent2 {
+		border-radius: 60rpx;
+		background-color: #fff;
+		padding: 40rpx;
+		position: relative; // 确保它相对于其父元素定位
+		z-index: 2;
+	}
+
+	.carList {
+		display: flex;
+		// flex-wrap: wrap;
+	}
+
+	.footer {
+		flex-direction: column;
+		position: fixed;
+		left: 5px;
+		right: 5px;
+		bottom: 10px;
+	}
+</style>

+ 249 - 0
pages/diningList/diningList.vue

@@ -0,0 +1,249 @@
+<template>
+	<view>
+		<view class="btnS">
+			<view style="width: 90%;">
+				<u-search :clearabled="true" shape="round" :showAction="false" v-model="seaName"
+					@search="searchClick"></u-search>
+			</view>
+		</view>
+
+		<view class="contain" style="margin: 10px 0;" v-for="(item, index)  in tableData" :key="index">
+			<view class="box" :class="{ 'boxed-border': item.defaultState == 2 }">
+				<view class="container" @click="carList(item)">
+					<view class="text-container">
+						<view class="flex-item">{{item.name ? item.name : '无' }}</view>
+						<u-tag plain :text="item.openState ? '营业中' : '离线'" :type="item.openState ? 'success' : 'error'"
+							size="mini"></u-tag>
+					</view>
+				</view>
+				<view class="icon-container">
+					<u-icon name="phone" size="28" @click.stop="call"></u-icon>
+					<u-icon style="margin-left: 10px;" name="info-circle" size="28" @click.stop="btnIC(item)"></u-icon>
+				</view>
+				<view :class="{ 'btnbor': item.defaultState==2 }" v-if="item.defaultState==2">
+					<!-- <u-tag text="当前" bgColor='#FF6D20' borderColor='#FF6D20' icon="checkmark-circle"></u-tag> -->
+					<image src="../../static/danqian.png" class="img-ding"></image>
+				</view>
+			</view>
+		</view>
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				seaName: '',
+				orderinfo: {},
+				tableData: [{
+						name: '23333',
+						tags: 1,
+						showBorder: true,
+					},
+					{
+						name: '门店',
+						tags: 1,
+						showBorder: false,
+					},
+					{
+						name: '店家',
+						tags: 1,
+						showBorder: false,
+					}
+				],
+				page: {
+					pageNum: 1,
+					pageSize: 20,
+					total: 0,
+					totalPage: 0
+				},
+				status: 'loading'
+			}
+		},
+		created() {
+			this.fatchDate()
+		},
+		methods: {
+			searchClick(e) {
+				this.seaName = e
+				this.fatchDate()
+				console.log('==============================', e)
+			},
+			call() {
+				if (this.tableData.customerPhone) {
+					uni.makePhoneCall({
+						phoneNumber: this.tableData.customerPhone
+					});
+				} else {
+					uni.showToast({
+						icon: 'none',
+						title: '暂无商家电话'
+					})
+				}
+			},
+			btnIC(e) {
+				console.log('e=================', e)
+				uni.navigateTo({
+					url: `/pages/diningCar/diningCar?id=${e.id}`
+				})
+			},
+			carList(e) {
+				const carl = {
+					id: e.id,
+					customerPhone: e.customerPhone,
+					name: e.name,
+					openState: e.openState
+				}
+				uni.setStorageSync("carl", carl)
+				console.log('---------------------', carl)
+				uni.navigateTo({
+					url: `/pages/classify/classify`
+				})
+			},
+			async fatchDate() {
+				var queryParams = {
+					"pageSize": this.page.pageSize,
+					"pageNum": this.page.pageNum,
+					"name": this.seaName
+				}
+				try {
+					const response = await this.$request('post', '/sale/diningCar/queryDiningCar', queryParams);
+					console.log('response', response)
+
+					const data = response.rows; // 假设 res.rows 是一个数组
+					console.log('response.rows', response.rows);
+					if (response.code === 200) {
+						const li = data;
+						if (this.page.pageNum === 1) {
+							this.tableData = li;
+						} else {
+							this.tableData = this.tableData.concat(li);
+						}
+						this.page.total = data.count;
+						this.page.totalPage = Math.ceil(data.count / this.page.pageSize);
+						this.status = this.page.totalPage === 0 || this.page.totalPage === this.page.pageNum ?
+							'noMore' : 'more';
+					} else {
+						//this.$toast(data.msg);
+					}
+				} catch (err) {
+					console.error('请求异常', err);
+				}
+
+			}
+		}
+	}
+</script>
+
+<style scoped lang="scss">
+	.box {
+		padding: 20rpx 20rpx 0;
+		height: 80px;
+		border-bottom-left-radius: 30rpx;
+		border-bottom-right-radius: 30rpx;
+		background-position: top;
+		box-shadow: 0 0 5px 2px #ebebeb;
+		background-repeat: no-repeat;
+		border-radius: 20rpx;
+		background-color: #fff;
+
+		.btnbor {
+			margin: -32rpx -20rpx 0;
+			// margin-right: -11px;
+			margin-top: 12px;
+			float: right;
+			position: relative; // 设置为相对定位
+
+			&::after {
+				content: '';
+				display: block;
+				width: 100%;
+				height: 100%;
+				border: 1px solid #FF6D20;
+				border-radius: 20rpx;
+				position: absolute;
+				top: 0;
+				right: 0;
+				background-color: #fff;
+				z-index: -1; // 使边框在图片下面
+			}
+		}
+	}
+
+	.boxed-border {
+		border: 1px solid #FF6D20;
+		/* 边框样式 */
+		padding: 20rpx 20rpx 0;
+		border-radius: 20rpx;
+		/* 添加圆角 */
+
+		// .btnbor {
+		// 	margin-right: -11px;
+		// 	margin-top: -15px;
+		// 	float: right;
+		// }
+	}
+
+	.box:hover {
+		border: 1px solid #FF6D20;
+		/* 鼠标悬停时显示边框 */
+	}
+
+	.box:active {
+		border: 1px solid #F54319;
+		/* 鼠标按下时显示另一种边框颜色 */
+	}
+
+	.container {
+		display: flex;
+		/* 使用 Flexbox 布局 */
+		justify-content: space-between;
+		/* 子元素之间留有空白 */
+	}
+
+	.text-container {
+		display: flex;
+		flex-direction: column;
+		align-items: flex-start;
+		/* 左对齐 */
+	}
+
+	.flex-item {
+		margin-bottom: 10px;
+	}
+
+	.tag-item {
+		margin-left: auto;
+		/* 将标签推到右边 */
+	}
+
+	.icon-container {
+		display: flex;
+		/* 使用 Flexbox 布局 */
+		flex-direction: row;
+		/* 水平排列子元素 */
+		justify-content: flex-end;
+		/* 子元素右对齐 */
+		margin-top: -55px;
+		right: 0;
+		bottom: 0;
+		gap: 10px;
+		/* 设置图标之间的距离 */
+	}
+
+	.img-ding {
+		width: 83px;
+		height: 30px;
+		position: absolute;
+		right: 0;
+		top: 0;
+		margin: 0; // 清除 margin 属性,以避免与边框重叠
+	}
+
+	.btnS {
+		display: flex;
+		justify-content: center;
+		align-items: center;
+		margin-top: 5px;
+	}
+</style>

+ 303 - 162
pages/goodDetail/goodDetail.vue

@@ -3,8 +3,10 @@
 		<!-- 01. 轮播区 -->
 		<view class="swiper-area w-full">
 			<swiper class="h-full pos-r" indicator-dots circular="true" duration="400">
-				<swiper-item v-for="(item, index) in swiperDatas" :key="index">
-					<view class="wh-full"><image :src="item.url" class="wh-full loaded" lazy-load="true" mode="aspectFill"></image></view>
+				<swiper-item v-for="(item, index) in goods.imgList" :key="index">
+					<view class="wh-full">
+						<image :src="item.url" class="wh-full loaded" lazy-load="true" mode="aspectFill"></image>
+					</view>
 				</swiper-item>
 			</swiper>
 		</view>
@@ -13,9 +15,9 @@
 			<view class="goods-area bg-main padding">
 				<view class="price-box dflex-b">
 					<view>
-						<text class="price fwb fs-big">{{ goods.price / 100 || '100' }}</text>
+						<text class="price fwb fs-big">{{ goods.minPrice || '' }} ~ {{ goods.maxPrice || ''}}</text>
 					</view>
-					<view class="dflex fs-sm ft-dark">
+					<!-- <view class="dflex fs-sm ft-dark">
 						<view class="margin-right-sm dflex" @click="">
 							<uni-icons type="headphones" size="24" color="#999"></uni-icons>
 						</view>
@@ -25,7 +27,11 @@
 						<view class="margin-right-sm dflex" @click="">
 							<uni-icons type="redo" size="24" color="#999"></uni-icons>
 						</view>
-					</view>
+					</view> -->
+				</view>
+				<view class="container">
+					<u-tag type="error" icon="coupon"></u-tag>
+					<u-tag text="平台活动" type="error" plain plainFill></u-tag>
 				</view>
 				<!-- <view class="coupon">
 					<view class="mj-tag">
@@ -36,234 +42,369 @@
 					</view>
 					<text class="coupon-name">满30减20</text>
 				</view> -->
-				<view class="title fs">商品名称商品名称商品名称商品名称商品名称商品名称商品名称</view>
+				<view class="title fs">{{goods.spuName}}</view>
 				<view class="sale">月销量:236</view>
 			</view>
-			
+
 			<!-- 06. 详情区 -->
 			<view class="gap"></view>
 			<view class="spec-cell">
 				<u-cell title="已选" isLink clickable @click="clickSpec" :border="false">
-					<text slot="value"  class="u-slot-value">{{specValue}}</text>
+					<text slot="value" class="u-slot-value">{{specValue}}</text>
 				</u-cell>
 			</view>
-			<view class="gap"></view>
+			<!-- <view class="gap"></view>
 			<view class="spec-cell">
-				<u-cell title="发货" isLink clickable  :border="false">
-					<text slot="value"  class="u-slot-value">预计5天内发货</text>
+				<u-cell title="发货" isLink clickable :border="false">
+					<text slot="value" class="u-slot-value">预计5天内发货</text>
 				</u-cell>
-			</view>
-			<view class="gap"></view>		
-			
+			</view> -->
+			<view class="gap"></view>
+
 			<view class="detail-area bg-main">
-				<view class="d-header padding dflex-c"><text>图文详情</text></view>
-				<rich-text class="pro-detail" :nodes="html_nodes"></rich-text>
+				<view class="d-header padding dflex-c"><text>图文详情</text>
+				</view>
+
+				<rich-text class="pro-detail" :nodes="goods.desc"></rich-text>
+				<image mode="aspectFit" :src="goods.imgList[0].url"></image>
 			</view>
 		</view>
 		<my-gap :height="130" bg="#f5f5f5" />
 		<!-- 07. 操作区 -->
 		<view class="cart-bottom padding-sm dflex-b">
-			<view class="go-cart dflex-c">加入购物车</view>
-			<view class="go-buy dflex-c">立即购买</view>
+			<view style="width: 60px;">
+				<u-icon :name="service" label="客服" labelPos="bottom" size="32" @click="call"></u-icon>
+			</view>
+			<view style="width: 60px;">
+				<uni-badge size="small" :text="buyCount" absolute="rightTop">
+					<u-icon :name="shoppingCart" label="购物车" labelPos="bottom" size="32" @click="showCart"></u-icon>
+				</uni-badge>
+			</view>
+			<view class="go-cart dflex-c" @click="toShop">加入购物车</view>
+			<view class="go-buy dflex-c background-gradient" @click="toBuy">立即购买</view>
 		</view>
-		
+
 		<!-- 置顶 -->
 		<use-totop ref="usetop" bottom="120"></use-totop>
-		<specPopup ref="specPopup"></specPopup>
+		<specPopup ref="specPopup" :cardMsg="cardMsg" @seChanged="seChanged" @addShop="carListMeg"></specPopup>
+		<cartPopupVue ref="cartPopup" />
 	</view>
 </template>
 
 <script>
 	import specPopup from '@/components/specPopup.vue'
+	import cartPopupVue from '../../components/cartPopup.vue'
+	import shoppingCart from '../../static/shoppingCart.png'
+	import service from '../../static/service.png'
 	export default {
-		components:{specPopup},
+		components: {
+			specPopup,
+			cartPopupVue
+		},
 		data() {
 			return {
-				specValue:'1包,番茄味',
+				cardMsg: {},
+				buyCount: '',
+				total: 0,
+				carList: {},
+				detailMsg: {},
+				shoppingCart: shoppingCart,
+				service: service,
+				specValue: '',
 				// 商品ID
 				id: 0,
 				// 商品数据
 				goods: {},
 				// 轮播图
-				swiperDatas: [{
-					url:'../../static/banner1.jpg'
-				}],
-				// SKU
-				sku: {},
-				// 商品详情
-				html_nodes: '',
-				// 收藏
-				favorite: false,
-				
-				scrollTop: 0
+				scrollTop: 0,
+				count: 1,
+				dataDel: {}
 			}
 		},
+		onLoad(option) {
+			// 解码 URL 编码的字符串
+			var dataString = decodeURIComponent(option.data);
+			// 尝试将字符串转换为 JSON 对象
+			var data = JSON.parse(dataString);
+			this.dataDel = data
+			// 打印解码后的数据
+			console.log('eeeeeeeeeeeee============data', data);
+			this.fatchDate()
+			const e = uni.getStorageSync('carl')
+			this.cList = e
+			this.buyCount = data.tobyC
+		},
 		methods: {
-			clickSpec(){
-				this.$refs.specPopup.open();
+			call() {
+				console.log('eeeeeeeeeeeeeeee===============', this.cPhone)
+				const e = uni.getStorageSync('info')
+				this.cPhone = e
+				if (this.cPhone.customerPhone) {
+					uni.makePhoneCall({
+						phoneNumber: this.cPhone.customerPhone
+					})
+				} else {
+					uni.showToast({
+						icon: 'none',
+						title: '暂无商家电话'
+					})
+				}
+			},
+			clickSpec() {
+				this.cardMsg = this.goods
+				this.$nextTick(() => {
+					this.$refs.specPopup.open();
+				});
+			},
+			showCart() {
+				this.$refs.cartPopup.setShow(true)
+				this.$refs.cartPopup.openShop(true)
+			},
+			toShop() {
+				const e = uni.getStorageSync('carl')
+				const userId = uni.getStorageSync('appUserId')
+				const params = {
+					storeId: e.id,
+					storeName: e.name,
+					skuId: this.detailMsg.skuId,
+					basePrice: this.detailMsg.retailPrice,
+					price: this.detailMsg.retailPrice,
+					quantity: this.count,
+					extendProps: userId
+				}
+				console.log('params', params)
+				this.$request('post', `/front/shoppingCart`, params, true).then(response => {
+					// 请求成功
+					console.log('response',response)
+					if (response.code = 200) {
+						// 弹出消息
+						uni.showToast({
+							title: '加入购物车成功',
+							icon: 'success',
+							duration: 2000
+						})
+						this.carListMeg()
+					} else if (response.code = 500){
+						uni.showToast({
+							title: response.msg,
+							icon: 'warning',
+							duration: 2000
+						})
+					}
+				}).catch(error => {
+					// 请求失败
+					console.error('请求失败:', response.msg);
+				})
+			},
+			async carListMeg() {
+				const res = await this.$request('get', `/front/shoppingCart/list`, {
+					storeId: this.cList.id
+				})
+				console.log('res.data==============', res.data)
+				if (res) {
+					this.carList = res.data
+					this.buyCount = this.carList.length
+				}
+			},
+			//获取详情列表
+			async fatchDate() {
+				const id = this.dataDel.spuId
+				const res = await this.$request('get', `/item/spu/${id}`)
+				if (res) {
+					this.goods = res.data
+				}
+				console.log('res', res.data)
+			},
+			//根据skuid获取选择商品信息
+			async seChanged(e) {
+				console.log('==================3e', e)
+				this.specValue = e.item
+				this.count = e.count
+				const res = await this.$request('get', `/item/sku/${e.id}`)
+				this.detailMsg = res.data
+				console.log('this.detailMsg', this.detailMsg)
+			},
+			// 去购买
+			toBuy() {
+				
+				uni.navigateTo({
+					url: `/pages/order/submitOrder/submitOrder`
+				})
 			}
 		}
 	}
 </script>
 
 <style scoped lang="scss">
-.d-content{
-	background: $page-color-base;
-	width: 100%;
-}
-
-.fixed-top {
-	bottom: 230rpx;
-}
-
-/* 01. 轮播区 */
-.swiper-area {
-	height: 500rpx;
-	z-index: -1;
-	width: 100%;
-}
-
-/* 02. 商品数据区 */
-.goods-area {
-	// margin-top: 720rpx;
+	.d-content {
+		background: $page-color-base;
+		width: 100%;
+	}
 
-	.price-box {
-		display: flex;
-		align-items: baseline;
+	.fixed-top {
+		bottom: 230rpx;
 	}
 
-	.title {
-		color: $font-color-dark;
-		// height: 46rpx;
-		// line-height: 46rpx;
-		font-weight: 700;
+	/* 01. 轮播区 */
+	.swiper-area {
+		height: 500rpx;
+		z-index: -1;
+		width: 100%;
 	}
-}
 
-/* 06. 详情区 */
-.detail-area {
-	.d-header {
-		font-size: $font-base + 2upx;
-		color: $font-color-dark;
-		position: relative;
+	/* 02. 商品数据区 */
+	.goods-area {
+		// margin-top: 720rpx;
 
-		text {
-			padding: 0 20rpx;
-			background: #fff;
-			position: relative;
-			z-index: 1;
+		.price-box {
+			display: flex;
+			align-items: baseline;
 		}
 
-		&:after {
-			position: absolute;
-			left: 50%;
-			top: 50%;
-			transform: translateX(-50%);
-			width: 300rpx;
-			height: 0;
-			content: '';
-			border-bottom: 1px solid #ccc;
+		.title {
+			color: $font-color-dark;
+			// height: 46rpx;
+			// line-height: 46rpx;
+			font-weight: 700;
 		}
 	}
 
-	/* 产品详情 */
-	.pro-detail {
-		width: 100%;
-		overflow: hidden;
-		-webkit-touch-callout: none;
+	/* 06. 详情区 */
+	.detail-area {
+		.d-header {
+			font-size: $font-base + 2upx;
+			color: $font-color-dark;
+			position: relative;
 
-		img {
+			text {
+				padding: 0 20rpx;
+				background: #fff;
+				position: relative;
+				z-index: 1;
+			}
+
+			&:after {
+				position: absolute;
+				left: 50%;
+				top: 50%;
+				transform: translateX(-50%);
+				width: 300rpx;
+				height: 0;
+				content: '';
+				border-bottom: 1px solid #ccc;
+			}
+		}
+
+		/* 产品详情 */
+		.pro-detail {
 			width: 100%;
-			max-width: 100%;
 			overflow: hidden;
+			-webkit-touch-callout: none;
+
+			img {
+				width: 100%;
+				max-width: 100%;
+				overflow: hidden;
+			}
 		}
 	}
-}
 
 
-/* 优惠券区 */
-.coupon-area {
-	max-height: 60vh;
-	min-height: 30vh;
+	/* 优惠券区 */
+	.coupon-area {
+		max-height: 60vh;
+		min-height: 30vh;
 
-	.coupon-item {
-		margin-bottom: 20rpx;
+		.coupon-item {
+			margin-bottom: 20rpx;
 
-		&:last-child {
-			margin-bottom: 0;
-		}
+			&:last-child {
+				margin-bottom: 0;
+			}
 
-		.content {
-			&:after {
-				position: absolute;
-				left: 0;
-				bottom: 0;
-				content: '';
-				width: 100%;
-				height: 0;
-				border-bottom: 1px dashed #f3f3f3;
-				transform: scaleY(50%);
+			.content {
+				&:after {
+					position: absolute;
+					left: 0;
+					bottom: 0;
+					content: '';
+					width: 100%;
+					height: 0;
+					border-bottom: 1px dashed #f3f3f3;
+					transform: scaleY(50%);
+				}
 			}
-		}
 
-		.circle {
-			position: absolute;
-			bottom: -10rpx;
-			z-index: 10;
-			width: 20rpx;
-			height: 20rpx;
-			background: #f5f5f5;
-			border-radius: 50%;
+			.circle {
+				position: absolute;
+				bottom: -10rpx;
+				z-index: 10;
+				width: 20rpx;
+				height: 20rpx;
+				background: #f5f5f5;
+				border-radius: 50%;
 
-			&.r {
-				right: -6rpx;
-			}
+				&.r {
+					right: -6rpx;
+				}
 
-			&.l {
-				left: -6rpx;
+				&.l {
+					left: -6rpx;
+				}
 			}
 		}
 	}
-}
 
-.sale{
-	color: #999;
-	font-size: 12px;
-	padding-top: 10upx;
-}
-.spec-cell{
-	background: #FFF;
-}
-.u-slot-value{
-	font-size: 12px;
-}
+	.sale {
+		color: #999;
+		font-size: 12px;
+		padding-top: 10upx;
+	}
+
+	.spec-cell {
+		background: #FFF;
+	}
+
+	.u-slot-value {
+		font-size: 12px;
+	}
 
-.cart-bottom{
-	width: 100%;
-	position: fixed;
-	left: 0;
-	bottom: 0;
-	height: 130rpx;
-	box-sizing: border-box;
-	background-color: #FFF;
-	z-index: 10;
-	box-shadow: 0px -4px 16px 0px rgba(0,0,0,0.15);
-	.go-cart{
-		height: 100%;
+	.cart-bottom {
+		width: 100%;
+		position: fixed;
+		left: 0;
+		bottom: 0;
+		height: 130rpx;
 		box-sizing: border-box;
-		border: solid 1px #FF0000;
-		font-size: 14px;
-		color: #FF0000;
-		border-radius: 5px;
-		width: 48%;
+		background-color: #FFF;
+		z-index: 10;
+		box-shadow: 0px -4px 16px 0px rgba(0, 0, 0, 0.15);
+
+		.go-cart {
+			height: 80%;
+			box-sizing: border-box;
+			border: solid 1px #FF0000;
+			font-size: 14px;
+			color: #FF0000;
+			border-radius: 50upx;
+			margin: 0 10px;
+			width: 45%;
+		}
+
+		.go-buy {
+			height: 80%;
+			width: 45%;
+			background-color: #FF0000;
+			color: #FFF;
+			border-radius: 50upx;
+			font-size: 14px;
+		}
 	}
-	.go-buy{
-		height: 100%;
-		width: 48%;
-		background-color: #FF0000;
-		color: #FFF;
-		border-radius: 5px;
-		font-size: 14px;
+
+	.container {
+		display: flex;
+		// justify-content: space-between;
+		margin: 10px 0;
+		/* 添加一些外边距以便查看 */
 	}
-}
-</style>
+</style>

+ 22 - 0
pages/index/home.vue

@@ -0,0 +1,22 @@
+<template>
+	<view>
+
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				
+			}
+		},
+		methods: {
+			
+		}
+	}
+</script>
+
+<style lang="less">
+
+</style>

+ 217 - 0
pages/login/login.vue

@@ -0,0 +1,217 @@
+<!-- <template>
+	<view>
+		<image :src="src" class="img"></image>
+		<view class="btn">
+			<view style="width: 80%;">
+				<u-button v-if="canIUseGetUserProfile" shape="circle" color="linear-gradient(to right, #F54319, #FF6D20)"
+					@click="getUserProfile">选择餐车</u-button>
+			</view>
+		</view>
+	</view>
+</template>
+
+<script>
+	export default {
+		name: 'MyLogin',
+		data() {
+			return {
+				infoData: {},
+				src: '../../static/first.png',
+				userInfo: {},
+				hasUserInfo: false,
+				canIUseGetUserProfile: wx.getUserProfile ? true : false,
+			}
+		},
+		methods: {
+			getUserProfile() {
+				wx.login({
+					success: async (e) => {
+						console.log('数据:', e)
+						try {
+							const result = await this.$request('post', '/auth/miniLogin', {
+								tenantId: '000000',
+								clientId: '8871d05eacc4406083d3bb0a085b6999',
+								code: e.code
+							})
+							console.log('登录成功:', result);
+							if (result && result.result !== false) {
+								var token = result.data.accessToken;
+								var haveOpenid = result.data.openId;
+								var tenantId = result.data.tenantId
+								uni.setStorageSync("token", token);
+								wx.getUserProfile({
+									desc: '用于完善会员资料', // 声明获取用户个人信息后的用途,后续会展示在弹窗中,请谨慎填写
+									success: (res) => {
+										this.setData({
+											userInfo: res.userInfo,
+											hasUserInfo: true
+										})
+									}
+								})
+								console.log('userInfo', this.userInfo)
+								uni.navigateTo({
+									url: `/pages/diningList/diningList`
+								});
+							} else {
+								// 处理错误情况
+							}
+						} catch (error) {
+							// 处理请求失败的情况
+							console.error('登录失败:', error);
+						}
+					}
+				})
+
+				// let that = this;
+				// wx.login({
+				// 	success: function(e) {
+				// 		console.log('数据:', e)
+
+				// 		uni.request({
+				// 			url: 'http://36.137.224.81:8030/auth/miniLogin?tenantId=000000&code=' + e
+				// 				.code,
+				// 			header: {
+				// 				"Content-Type": "application/x-www-form-urlencoded;charset=UTF-8", //
+				// 				// "Content-Type": "application/json;charset=UTF-8", //
+				// 			},
+				// 			method: 'post',
+				// 			success: res => {
+				// 				console.log('登录成功:', res)
+				// 				uni.hideLoading()
+				// 				var token = res.data.data.accessToken;
+				// 				console.log('token:', token)
+				// 				uni.setStorageSync("token", token);
+				// 				uni.navigateTo({
+				// 					url: `/pages/classify/classify`
+				// 				})
+				// 				// if (res.data.code == 200) {
+				// 				// 	that.infoData = res.data.data
+				// 				// }
+				// 			},
+				// 			fail: err => {
+				// 				uni.hideLoading()
+				// 			}
+				// 		})
+				// 	}
+				// })
+
+			}
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	.img {
+		height: 375px;
+		width: 100%;
+	}
+
+	.btn {
+		display: flex;
+		justify-content: center;
+		align-items: center;
+		margin-top: 20px;
+	}
+</style> -->
+<template>
+	<view>
+		<image :src="src" class="img"></image>
+
+		<view class="btn">
+			<view style="width: 80%;">
+				<u-button v-if="canIUseGetUserProfile" shape="circle"
+					color="linear-gradient(to right, #F54319, #FF6D20)" @click="getUserProfile">选择餐车</u-button>
+			</view>
+		</view>
+	</view>
+</template>
+
+<script>
+	export default {
+		name: 'MyLogin',
+		data() {
+			return {
+				src: '../../static/first.png',
+				canIUseGetUserProfile: false,
+			}
+		},
+		onLoad() {
+			// 检查微信版本是否支持 getUserProfile
+			if (wx.getUserProfile) {
+				this.canIUseGetUserProfile = true;
+			}
+		},
+		methods: {
+			getUserProfile() {
+				wx.showModal({
+					title: '温馨提示',
+					content: '亲,授权微信登录后才能正常使用小程序功能',
+				})
+				wx.getUserProfile({
+					desc: '获取用户信息',
+					success: (res) => {
+						console.log('res', res);
+						// 调用微信登录接口
+						wx.login({
+							success: async (loginRes) => {
+								console.log('数据:', loginRes)
+								// 发送code到开发者服务器换取用户信息
+								const result = await this.$request('post', '/auth/miniLogin', {
+									tenantId: '000000',
+									// clientId: '8871d05eacc4406083d3bb0a085b6999',
+									code: loginRes.code
+								})
+								console.log('登录成功:', result);
+								if (result && result.data !== false) {
+									// 保存token
+									uni.setStorageSync("token", result.data.accessToken);
+									uni.setStorageSync("openId", result.data.openId);
+									uni.setStorageSync("tenantId", result.data.tenantId);
+									uni.setStorageSync("appUserId", result.data.appUserId);
+									// 跳转到下一个页面
+									uni.navigateTo({
+										url: `/pages/diningList/diningList`
+									});
+								} else {
+									// 处理错误情况
+								}
+								// 更新用户信息
+								const id = uni.getStorageSync('appUserId');
+								console.log('id', id)
+
+								const userInfo = {
+									"id": id,
+									"nickName": res.userInfo.nickName,
+									"profilePhoto": res.userInfo.avatarUrl,
+								}
+								console.log('userInfo', userInfo)
+								this.$request('post', '/system/appUser/editAppUser',
+									userInfo, true)
+							},
+							fail: (error) => {
+								console.error('登录失败:', error);
+							}
+						})
+					},
+					fail: (error) => {
+						console.error('获取用户信息失败:', error);
+					}
+				})
+			}
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	.img {
+		height: 375px;
+		width: 100%;
+	}
+
+	.btn {
+		display: flex;
+		justify-content: center;
+		align-items: center;
+		margin-top: 20px;
+	}
+</style>

+ 52 - 0
pages/login/qrCode.vue

@@ -0,0 +1,52 @@
+<template>
+  <view>
+    <button @click="createQRCode">生成二维码</button>
+    <image :src="qrCodeImage" @click="scanQRCode"></image>
+  </view>
+</template>
+
+<script>
+export default {
+  data() {
+    return {
+      qrCodeImage: '../../static/nice.jpg', // 二维码图片路径
+    };
+  },
+  methods: {
+    async createQRCode() {
+      // 生成二维码
+      const qrcode = await this.generateQRCode('pages/classify/classify');
+      this.qrCodeImage = qrcode;
+    },
+    async generateQRCode(sceneStr) {
+      // 创建二维码
+      const qrcode = await new Promise((resolve, reject) => {
+        wx.createQRCode({
+          scene: {
+            scene_str: sceneStr
+          },
+          success: (res) => {
+            resolve(res.path);
+          },
+          fail: (err) => {
+            reject(err);
+          }
+        });
+      });
+      return qrcode;
+    },
+    async scanQRCode() {
+      // 扫描二维码
+      wx.scanCode({
+        scanType: ['qrcode'], // 指定扫描类型为二维码
+        success: (res) => {
+          console.log(res.result); // 输出二维码的内容
+        },
+        fail: (err) => {
+          console.log(err);
+        }
+      });
+    }
+  }
+};
+</script>

+ 106 - 132
pages/order/myOrder/myOrder.vue

@@ -12,72 +12,74 @@
 
 		<!-- 订单轮播区 -->
 		<swiper class="swiper-area w-full" :duration="0" :current="tabCurrentIndex" @change="changeTab">
-		<!-- 轮播项对应订单状态 -->
-		<swiper-item class="tab-content wh-full" v-for="(tabItem, tabIndex) in navList" :key="tabIndex">
-			<!-- 滚动区 -->
-			<scroll-view class="h-full" scroll-y @scrolltolower="loadData">
-				<!-- 空白页 -->
-				<use-empty v-if="tabItem.orderList.length === 0 && tabItem.loaded" e-style="round" e-type="cart"
-					tip="订单数据为空" height="93vh"></use-empty>
-				<!-- 订单列表区 -->
-				<view class="margin-bottom-sm" :class="index === 0 ? 'padding-top-sm' : ''"	v-for="(item, index) in tabItem.orderList" :key="index">
-					<!-- 订单项 -->
-					<view class="order-item padding bg-main border-radius">
-						<view @click="todetail(item.order)">
-							<view class="dflex-b padding-bottom-sm">
-								<view class="fs fwb dflex">
-									<u-tag text="自提" size="mini" bgColor="#FFF4E4" color="#F5821F" shape="circle" borderColor="#FFF4E4"></u-tag>
-									订单编号:M000003332
+			<!-- 轮播项对应订单状态 -->
+			<swiper-item class="tab-content wh-full" v-for="(tabItem, tabIndex) in navList" :key="tabIndex">
+				<!-- 滚动区 -->
+				<scroll-view class="h-full" scroll-y @scrolltolower="loadData">
+					<!-- 空白页 -->
+					<use-empty v-if="tabItem.orderList.length === 0 && tabItem.loaded" e-style="round" e-type="cart"
+						tip="订单数据为空" height="93vh"></use-empty>
+					<!-- 订单列表区 -->
+					<view class="margin-bottom-sm" :class="index === 0 ? 'padding-top-sm' : ''"
+						v-for="(item, index) in tabItem.orderList" :key="index">
+						<!-- 订单项 -->
+						<view class="order-item padding bg-main border-radius">
+							<view @click="todetail(item.order)">
+								<view class="dflex-b padding-bottom-sm">
+									<view class="fs fwb dflex">
+										<u-tag text="打包" size="mini" bgColor="#FFF4E4" color="#F5821F" shape="circle"
+											borderColor="#FFF4E4"></u-tag>
+										订单编号:M000003332
+									</view>
+									<text class="fs active">等待付款</text>
 								</view>
-								<text class="fs active">等待付款</text>
-							</view>
-							<!-- 订单商品明细 -->
-							<view class="goods-area dflex-b">
-								<view class="pic-list dflex">
-									<view class="pic"></view>
-									<view class="pic"></view>
-									<view class="pic"></view>
-								</view>
-								<view class="next-detail">
-									<text>共3件</text>
-									<u-icon name="arrow-right" size="20"></u-icon>
+								<!-- 订单商品明细 -->
+								<view class="goods-area dflex-b">
+									<view class="pic-list dflex">
+										<view class="pic"></view>
+										<view class="pic"></view>
+										<view class="pic"></view>
+									</view>
+									<view class="next-detail">
+										<text>共3件</text>
+										<u-icon name="arrow-right" size="20"></u-icon>
+									</view>
+
 								</view>
-								
-							</view>
 
-							<!-- 实付款 -->
-							<view class="dflex-e padding-top-sm">
-								<text class="fs-xs margin-right-xs">共3件</text>
-								<text class="fs-xs margin-right-xs">共6份商品</text>
-								<text class="fs-xs margin-right-xs">实付</text>
-								<text class="price ft-main">{{ item.order.order_actural_paid}}</text>
+								<!-- 实付款 -->
+								<view class="dflex-e padding-top-sm">
+									<text class="fs-xs margin-right-xs">共3件</text>
+									<text class="fs-xs margin-right-xs">共6份商品</text>
+									<text class="fs-xs margin-right-xs">实付</text>
+									<text class="price ft-main">{{ item.order.order_actural_paid}}</text>
+								</view>
 							</view>
-						</view>
 
-						<!-- 订单操作区 -->
-						<view class="dflex-b margin-top-sm">
-							<view>
-								<text class="ft-dark" >更多</text>
-							</view>
+							<!-- 订单操作区 -->
+							<view class="dflex-b margin-top-sm">
+								<view>
+									<text class="ft-dark">更多</text>
+								</view>
 
-							<view class="dflex-e">
-								<view class="dflex">
-									<button class="action-btn border-radius-big bg-main">取消订单</button>
-									<button class="action-btn border-radius-big bg-main">订单详情</button>
-									<button class="action-btn border-radius-big bg-main main-btn">去支付</button>
+								<view class="dflex-e">
+									<view class="dflex">
+										<button class="action-btn border-radius-big bg-main">取消订单</button>
+										<button class="action-btn border-radius-big bg-main" @click="todetail">订单详情</button>
+										<button class="action-btn border-radius-big bg-main main-btn">去支付</button>
+									</view>
 								</view>
 							</view>
 						</view>
 					</view>
-				</view>
 
-				<!-- 上拉加载更多 -->
-				<use-loadmore v-if="tabItem.orderList.length > 0 && tabItem.loaded && tabItem.hasmore"
-					:type="tabItem.loadingType"></use-loadmore>
-			</scroll-view>
-		</swiper-item>
+					<!-- 上拉加载更多 -->
+					<use-loadmore v-if="tabItem.orderList.length > 0 && tabItem.loaded && tabItem.hasmore"
+						:type="tabItem.loadingType"></use-loadmore>
+				</scroll-view>
+			</swiper-item>
 		</swiper>
-	
+
 	</view>
 </template>
 
@@ -91,38 +93,33 @@
 						id: 0,
 						state: '全部',
 						loadingType: 'more',
-						orderList: [
-							{
-								order_detail:[
-									{
-										goods_img:'../../../static/x2.jpg',
-										goods_name:'商品1',
-										goods_name_pw:'小标题',
-										goods_num:1,
-										goods_sku_name:60,
-										goods_price:10
-									}
-								],
-								order:{
-									order_actural_paid:10,
-									order_refund_state:'处理中',
-									state:'待发货'
+						orderList: [{
+								order_detail: [{
+									goods_img: '../../../static/x2.jpg',
+									goods_name: '商品1',
+									goods_name_pw: '小标题',
+									goods_num: 1,
+									goods_sku_name: 60,
+									goods_price: 10
+								}],
+								order: {
+									order_actural_paid: 10,
+									order_refund_state: '处理中',
+									state: '待发货'
 								}
 							},
 							{
-								order_detail:[
-									{
-										goods_img:'../../../static/x2.jpg',
-										goods_name:'商品1',
-										goods_name_pw:'小标题',
-										goods_num:1,
-										goods_sku_name:60,
-										goods_price:10
-									}
-								],
-								order:{
-									order_actural_paid:10,
-									state:'待发货'
+								order_detail: [{
+									goods_img: '../../../static/x2.jpg',
+									goods_name: '商品1',
+									goods_name_pw: '小标题',
+									goods_num: 1,
+									goods_sku_name: 60,
+									goods_price: 10
+								}],
+								order: {
+									order_actural_paid: 10,
+									state: '待发货'
 								}
 							}
 						]
@@ -135,13 +132,13 @@
 					},
 					{
 						id: 2,
-						state: '待收货',
+						state: '待核销',
 						loadingType: 'more',
 						orderList: []
 					},
 					{
 						id: 3,
-						state: '待自提',
+						state: '已取消',
 						loadingType: 'more',
 						orderList: []
 					},
@@ -150,12 +147,6 @@
 						state: '已完成',
 						loadingType: 'more',
 						orderList: []
-					},
-					{
-						id: 5,
-						state: '已关闭',
-						loadingType: 'more',
-						orderList: []
 					}
 				],
 				reqdata: {
@@ -166,25 +157,27 @@
 				title: '全部'
 			}
 		},
+		onLoad(e) {
+			this.tabCurrentIndex = parseFloat(e.type);
+		},
 		methods: {
-			loadData(){},
+			loadData() {},
 			// swiper 切换
 			changeTab(e) {
 				this.tabCurrentIndex = e.target.current;
-			
 			},
 			//顶部tab点击
 			tabClick(index) {
 				this.tabCurrentIndex = index;
 			},
-			
+
 			// 点击跳转详情页面
 			todetail(order) {
 				// uni.navigateTo({
 				// 	url: `/pages/user/order/order-detail?order_id=${order.order_id}`
 				// });
 				uni.navigateTo({
-					url: `/pages/order/orderDetail/orderDetail`
+					url: `/pages/order/orderPaid/orderPaid`
 				});
 			},
 			// 立即支付
@@ -194,7 +187,7 @@
 			// 删除订单
 			delOrder(item) {
 				let _this = this;
-			
+
 				uni.showModal({
 					title: '提示',
 					content: '删除订单',
@@ -203,7 +196,7 @@
 							uni.showLoading({
 								title: '请稍后'
 							});
-							
+
 						} else if (res.cancel) {
 							console.log('点击取消');
 						}
@@ -216,7 +209,7 @@
 			// 取消订单
 			cancelOrder(item) {
 				let _this = this;
-			
+
 				uni.showModal({
 					title: '提示',
 					content: '取消订单',
@@ -225,32 +218,7 @@
 							uni.showLoading({
 								title: '请稍后'
 							});
-							
-						} else if (res.cancel) {
-							console.log('用户点击取消');
-						}
-					},
-					complete() {
-						uni.hideLoading();
-					}
-				});
-			},
-			// 查看物流
-			toexpress(item) {
-				// uni.navigateTo({
-				// 	url: `/pages/user/order/order-express?order_id=${item.order.order_id}`
-				// });
-			},
-			// 已发货
-			toreceipt(item) {
-				let _this = this;
-			
-				uni.showModal({
-					title: '提示',
-					content: '确认收货',
-					success: function(res) {
-						if (res.confirm) {
-							
+
 						} else if (res.cancel) {
 							console.log('用户点击取消');
 						}
@@ -262,18 +230,19 @@
 			},
 			// 申请退款
 			torefund(data) {
-				
+
 			},
 			// 评价
 			toevaluate(item) {
-				
+
 			}
 		}
 	}
 </script>
 
 <style lang="scss">
-	page,.container {
+	page,
+	.container {
 		min-height: 100%;
 		background: $page-color-base;
 	}
@@ -317,6 +286,7 @@
 
 	/* 订单项 */
 	.order-item {
+
 		/* 订单商品明细区 */
 		.goods-area {
 			display: flex;
@@ -366,22 +336,26 @@
 			}
 		}
 	}
-	.pic-list{
+
+	.pic-list {
 		width: calc(100% - 130upx);
-		.pic{
+
+		.pic {
 			margin-right: 20upx;
 			height: 160rpx;
 			width: 160rpx;
 			background-color: #EEE;
 		}
-		.pic:last-child{
+
+		.pic:last-child {
 			margin: 0;
 		}
 	}
-	.next-detail{
+
+	.next-detail {
 		width: 130upx;
 		display: flex;
 		justify-content: flex-end;
 		align-items: center;
 	}
-</style>
+</style>

+ 248 - 0
pages/order/orderDetails/orderDetails.vue

@@ -0,0 +1,248 @@
+<template>
+	<view class="order-detail">
+		<topNavBar title="订单详情" />
+		<view class="order-state padding-sm dflex-b w-full">
+			<view class="state-left">
+				<view class="state-info">等待商家接单</view>
+				<view class="order-code">预计 09:59 分钟后接单</view>
+			</view>
+			<uni-icons type="right" size="24" color="#FFF"></uni-icons>
+		</view>
+		<view class="gap"></view>
+		<view class="padding-sm dflex-b bg-main" @click="show = true">
+			<view class="dflex">
+				<view class="w-full dflex-wrap-w send-label">
+					取餐时间
+				</view>
+			</view>
+			<u-icon slot="icon" size="20" name="arrow-right" label="04:00" labelPos="left"></u-icon>
+		</view>
+		<view class="gap"></view>
+		<view class="padding-sm dflex-b bg-main">
+			<view class="dflex">
+				<view class="w-full dflex-wrap-w send-label">
+					取餐方式
+				</view>
+			</view>
+			<view>
+				<radio style="transform: scale(0.85)" value="r1" :checked="true" color="#ff0000" class="radio">店内用餐
+				</radio>
+			</view>
+		</view>
+
+		<view class="gap"></view>
+		<view class="goods-order-list padding-lr-sm">
+			<view class="shop dflex-b ">
+				<view class="shop-check">
+					<text class="send-label">店铺名称</text>
+				</view>
+				<view class="total-goods">共计2件商品</view>
+			</view>
+			<view class="goods-cart">
+				<view class="goods-cont dflex-b padding-tb-16">
+					<view class="goods-cart-info dflex-b">
+						<view class="pic"></view>
+						<view class="goods-cart-right">
+							<view class="cart-title">商品名称商品名称</view>
+							<view class="order-spec">
+								<text>500g</text>
+							</view>
+							<view class="cart-row-info dflex-s">
+								<view class="cart-price">
+									¥<text>12.30</text>
+								</view>
+								<view class="goods-num">×1</view>
+							</view>
+						</view>
+					</view>
+				</view>
+				<view class="goods-cont dflex-b padding-tb-16">
+					<view class="goods-cart-info dflex-b">
+						<view class="pic"></view>
+						<view class="goods-cart-right">
+							<view class="cart-title">商品名称商品名称</view>
+							<view class="order-spec">
+								<text>500g</text>
+							</view>
+							<view class="cart-row-info dflex-s">
+								<view class="cart-price">
+									¥<text>12.30</text>
+								</view>
+								<view class="goods-num">×1</view>
+							</view>
+						</view>
+					</view>
+				</view>
+			</view>
+		</view>
+		<view class="gap"></view>
+		<!-- 金额明细 -->
+		<view class="bg-main">
+			<view class="dflex-b padding-lr padding-tb-sm">
+				<view class="flex1 send-label">总金额</view>
+				<view class=""><text style="font-size: 24rpx;">¥</text>46.32</view>
+			</view>
+			<view class="gap"></view>
+			<view class="w-full padding-sm order-info">
+				<view class="row-cell dflex-b">
+					<text>订单编号</text>
+					<text class="cell-right">M0000000000</text>
+				</view>
+				<view class="row-cell dflex-b">
+					<text>下单时间</text>
+					<text class="cell-right">2024-03-25 12:23:36</text>
+				</view>
+			</view>
+		</view>
+		<view class="gap"></view>
+		<view class="bar-space"></view>
+		<view class="order-btn background-gradient">取消订单</view>
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+
+			}
+		},
+		methods: {
+
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	.order-state {
+		background-color: #F96C22;
+		box-sizing: border-box;
+		color: #FFF;
+
+		.state-info {
+			font-size: 14px;
+			padding-bottom: 4px;
+		}
+
+		.order-code {
+			font-size: 12px;
+		}
+	}
+
+	.addr-label {
+		padding: 6upx 0;
+		border-radius: 3px;
+		background-color: #F6390D;
+		color: #fff;
+		width: 120upx;
+		text-align: center;
+		flex-shrink: 0;
+		margin-right: 14upx;
+	}
+
+	.order-spec {
+		padding-bottom: 10upx;
+	}
+
+	.shop {
+		padding-top: 20upx;
+	}
+
+	.goods-num {
+		font-size: 16px;
+		padding-left: 20upx;
+	}
+
+	.sub-coupon {
+		padding-top: 20upx;
+		padding-bottom: 0;
+		color: #000;
+
+		.coupon-name {
+			font-weight: normal;
+		}
+
+		.mj-tag {
+			background-color: #F6390D;
+
+			>text {
+				color: #FFF;
+			}
+		}
+	}
+
+	.total-goods {
+		font-size: 12px;
+		color: #999;
+	}
+
+	.submit-bar {
+		height: 100upx;
+		width: 100%;
+		background-color: #FFF;
+		position: fixed;
+		left: 0;
+		bottom: 0;
+
+		.submit-total {
+			font-size: 16px;
+			font-weight: 700;
+			color: #F6390D;
+		}
+
+		.submit-btn {
+			background-image: $base-bg-gradient-color;
+			height: 70upx;
+			width: 200upx;
+			color: #FFF;
+			font-size: 14px;
+			font-weight: 700;
+			border-radius: 35upx;
+		}
+	}
+
+	.order-btn {
+		height: 76upx;
+		border-radius: 38px;
+		background-image: $base-bg-gradient-color;
+		text-align: center;
+		line-height: 76upx;
+		color: #FFF;
+		font-size: 14px;
+		width: 90%;
+		position: fixed;
+		left: 5%;
+		bottom: 30upx;
+		z-index: 99;
+	}
+
+	.order-info {
+		background-color: #FFF;
+		box-sizing: border-box;
+	}
+
+	.row-cell {
+		padding-bottom: 20upx;
+
+		.cell-right {
+			font-size: 12px;
+			color: #999;
+		}
+	}
+
+	.row-cell:last-child {
+		padding-bottom: 0;
+	}
+
+	.pic {
+		margin-right: 20upx;
+		height: 160rpx;
+		width: 160rpx;
+		background-color: #EEE;
+	}
+
+	.send-label {
+		font-size: 14px;
+		font-weight: 700;
+	}
+</style>

+ 272 - 0
pages/order/orderPaid/orderPaid.vue

@@ -0,0 +1,272 @@
+<template>
+	<view class="order-detail">
+		<topNavBar title="订单详情" />
+		<view class="order-state padding-sm dflex-b w-full">
+			<view class="state-left">
+				<view class="state-info">待支付 </view>
+				<view class="order-code">剩余 09:59 逾期未支付将自动取消</view>
+			</view>
+			<uni-icons type="right" size="24" color="#FFF"></uni-icons>
+		</view>
+		<view class="gap"></view>
+		<view class="padding-sm dflex-b bg-main" @click="show = true">
+			<view class="dflex">
+				<view class="w-full dflex-wrap-w send-label">
+					取餐时间
+				</view>
+			</view>
+			<u-icon slot="icon" size="20" name="arrow-right" label="04:00" labelPos="left"></u-icon>
+		</view>
+		<view class="gap"></view>
+		<view class="padding-sm dflex-b bg-main">
+			<view class="dflex">
+				<view class="w-full dflex-wrap-w send-label">
+					取餐方式
+				</view>
+			</view>
+			<view>
+				<radio style="transform: scale(0.85)" value="r1" :checked="true" color="#ff0000" class="radio">店内用餐
+				</radio>
+			</view>
+		</view>
+
+		<view class="gap"></view>
+		<view class="goods-order-list padding-lr-sm">
+			<view class="shop dflex-b ">
+				<view class="shop-check">
+					<text class="send-label">店铺名称</text>
+				</view>
+				<view class="total-goods">共计2件商品</view>
+			</view>
+			<view class="goods-cart">
+				<view class="goods-cont dflex-b padding-tb-16">
+					<view class="goods-cart-info dflex-b">
+						<view class="pic"></view>
+						<view class="goods-cart-right">
+							<view class="cart-title">商品名称商品名称</view>
+							<view class="order-spec">
+								<text>500g</text>
+							</view>
+							<view class="cart-row-info dflex-s">
+								<view class="cart-price">
+									¥<text>12.30</text>
+								</view>
+								<view class="goods-num">×1</view>
+							</view>
+						</view>
+					</view>
+				</view>
+				<view class="goods-cont dflex-b padding-tb-16">
+					<view class="goods-cart-info dflex-b">
+						<view class="pic"></view>
+						<view class="goods-cart-right">
+							<view class="cart-title">商品名称商品名称</view>
+							<view class="order-spec">
+								<text>500g</text>
+							</view>
+							<view class="cart-row-info dflex-s">
+								<view class="cart-price">
+									¥<text>12.30</text>
+								</view>
+								<view class="goods-num">×1</view>
+							</view>
+						</view>
+					</view>
+				</view>
+			</view>
+		</view>
+		<view class="gap"></view>
+		<!-- 金额明细 -->
+		<view class="bg-main">
+			<view class="dflex-b padding-lr padding-tb-sm">
+				<view class="flex1 send-label">总金额</view>
+				<view class=""><text style="font-size: 24rpx;">¥</text>46.32</view>
+			</view>
+		</view>
+		<view class="gap"></view>
+		<view class="bar-space"></view>
+		<view class="cart-bottom padding-sm dflex-b">
+			<view class="go-cart dflex-c">取消订单</view>
+			<view class="go-buy dflex-c background-gradient">去支付</view>
+		</view>
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+
+			}
+		},
+		methods: {
+
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	.order-state {
+		background-color: #F96C22;
+		box-sizing: border-box;
+		color: #FFF;
+
+		.state-info {
+			font-size: 14px;
+			padding-bottom: 4px;
+		}
+
+		.order-code {
+			font-size: 12px;
+		}
+	}
+
+	.addr-label {
+		padding: 6upx 0;
+		border-radius: 3px;
+		background-color: #F6390D;
+		color: #fff;
+		width: 120upx;
+		text-align: center;
+		flex-shrink: 0;
+		margin-right: 14upx;
+	}
+
+	.order-spec {
+		padding-bottom: 10upx;
+	}
+
+	.shop {
+		padding-top: 20upx;
+	}
+
+	.goods-num {
+		font-size: 16px;
+		padding-left: 20upx;
+	}
+
+	.sub-coupon {
+		padding-top: 20upx;
+		padding-bottom: 0;
+		color: #000;
+
+		.coupon-name {
+			font-weight: normal;
+		}
+
+		.mj-tag {
+			background-color: #F6390D;
+
+			>text {
+				color: #FFF;
+			}
+		}
+	}
+
+	.total-goods {
+		font-size: 12px;
+		color: #999;
+	}
+
+	.submit-bar {
+		height: 100upx;
+		width: 100%;
+		background-color: #FFF;
+		position: fixed;
+		left: 0;
+		bottom: 0;
+
+		.submit-total {
+			font-size: 16px;
+			font-weight: 700;
+			color: #F6390D;
+		}
+
+		.submit-btn {
+			background-image: $base-bg-gradient-color;
+			height: 70upx;
+			width: 200upx;
+			color: #FFF;
+			font-size: 14px;
+			font-weight: 700;
+			border-radius: 35upx;
+		}
+	}
+
+	.order-btn {
+		height: 76upx;
+		border-radius: 38px;
+		background-image: $base-bg-gradient-color;
+		text-align: center;
+		line-height: 76upx;
+		color: #FFF;
+		font-size: 14px;
+		width: 90%;
+		position: fixed;
+		left: 5%;
+		bottom: 30upx;
+		z-index: 99;
+	}
+
+	.order-info {
+		background-color: #FFF;
+		box-sizing: border-box;
+	}
+
+	.row-cell {
+		padding-bottom: 20upx;
+
+		.cell-right {
+			font-size: 12px;
+			color: #999;
+		}
+	}
+
+	.row-cell:last-child {
+		padding-bottom: 0;
+	}
+
+	.pic {
+		margin-right: 20upx;
+		height: 160rpx;
+		width: 160rpx;
+		background-color: #EEE;
+	}
+
+	.send-label {
+		font-size: 14px;
+		font-weight: 700;
+	}
+
+	.cart-bottom {
+		width: 100%;
+		position: fixed;
+		left: 0;
+		bottom: 0;
+		height: 130rpx;
+		box-sizing: border-box;
+		background-color: #FFF;
+		z-index: 10;
+		box-shadow: 0px -4px 16px 0px rgba(0, 0, 0, 0.15);
+
+		.go-cart {
+			height: 80%;
+			box-sizing: border-box;
+			border: solid 1px #FF0000;
+			font-size: 14px;
+			color: #FF0000;
+			border-radius: 50upx;
+			margin: 0 10px;
+			width: 45%;
+		}
+
+		.go-buy {
+			height: 80%;
+			width: 45%;
+			background-color: #FF0000;
+			color: #FFF;
+			border-radius: 50upx;
+			font-size: 14px;
+		}
+	}
+</style>

+ 77 - 36
pages/order/submitOrder/submitOrder.vue

@@ -9,20 +9,32 @@
 				</u-cell>
 			</u-cell-group>
 		</view> -->
-		<view class="padding-sm dflex-b bg-main" @click="toaddr">
+		<view class="padding-sm dflex-b bg-main" @click="show = true">
 			<view class="dflex">
-				<view class="addr-label">配送至</view>
-				<view class="w-full dflex-wrap-w">
-					<view>
-						<text>张三</text>
-						<text class="margin-left">18599999999</text>
-					</view>
-					<view class="margin-bottom-xs">
-						<text>广西壮族自治区-柳州市-鱼峰区 xxxx</text>
-					</view>
+				<!-- <view class="addr-label">配送至</view> -->
+				<view class="w-full dflex-wrap-w send-label">
+					取餐时间
 				</view>
 			</view>
-			<u-icon slot="icon" size="20" name="arrow-right"></u-icon>
+			<u-icon slot="icon" size="20" name="arrow-right" :label="value" labelPos="left"></u-icon>
+			<!-- <view class="iconfont iconjiantou-01 fs-sm"></view> -->
+		</view>
+		<u-datetime-picker :show="show" v-model="value" mode="time" @confirm="onConfirm"
+			@cancel="onCancel"></u-datetime-picker>
+		<view class="gap"></view>
+		<view class="padding-sm dflex-b bg-main">
+			<view class="dflex">
+				<!-- <view class="addr-label">配送至</view> -->
+				<view class="w-full dflex-wrap-w send-label">
+					取餐方式
+				</view>
+			</view>
+			<view>
+				<radio style="margin: 0 10px; transform: scale(0.85)" value="r1" :checked="true" color="#ff0000" class="radio">店内用餐
+				</radio >
+				<radio style="transform: scale(0.85)" value="r1" :checked="true" color="#ff0000" class="radio">打包带走
+				</radio>
+			</view>
 			<!-- <view class="iconfont iconjiantou-01 fs-sm"></view> -->
 		</view>
 		<view class="gap"></view>
@@ -33,12 +45,12 @@
 				</view>
 			</view>
 			<view class="goods-cart w-full">
-				<view class="goods-cont padding-tb" v-for="index in 3" :key="index">
+				<view class="goods-cont padding-tb" v-for="index in 1" :key="index">
 					<my-goods :data="data">
 						<view class="good-num">×1</view>
 					</my-goods>
 				</view>
-				
+
 			</view>
 		</view>
 		<!-- 金额明细 -->
@@ -47,7 +59,7 @@
 				<view class="flex1">总金额</view>
 				<view class=""><text style="font-size: 24rpx;">¥</text>46.32</view>
 			</view>
-			<view class="dflex-b padding-lr padding-tb-sm">
+			<!-- <view class="dflex-b padding-lr padding-tb-sm">
 				<view class="flex1">运费 (总重:4.960 kg )</view>
 				<view class="ft-base">¥10.00</view>
 			</view>
@@ -56,12 +68,12 @@
 				<view class="margin-right-xl">备注</view>
 				<input class="flex1 padding-sm" type="text" v-model="order_desc" placeholder="请填写买家备注"
 					placeholder-class="placeholder" />
-			</view>
+			</view> -->
 		</view>
 		<view class="gap"></view>
 		<my-gap :height="130" />
 		<view class="submit-bar padding-sm dflex-b">
-			<view class="submit-btn dflex-c">提交订单</view>
+			<view class="submit-btn dflex-c background-gradient" @click="toBuy">立即下单</view>
 		</view>
 	</view>
 </template>
@@ -70,24 +82,41 @@
 	export default {
 		data() {
 			return {
-				data:{
-					src:'../../static/x0.jpg',
-					title:'标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题',
-					spec:'180cm',
-					price:'53.30'
-				}
+				data: {
+					src: '../../static/x0.jpg',
+					title: '标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题',
+					spec: '180cm',
+					price: '53.30'
+				},
+				show: false,
+				value: '',
 			}
 		},
 		methods: {
-			
+			sendTypeChange(v) {
+				console.log(v)
+			},
+			onConfirm(v) {
+				console.log('vvvvvvvvvvvvvvv', v)
+				this.value = v.value
+				this.show = false
+			},
+			onCancel() {
+				this.show = false
+			},
+			toBuy() {
+				uni.navigateTo({
+					url: `/pages/order/orderPaid/orderPaid`
+				})
+			}
 		}
 	}
 </script>
 
 <style lang="scss" scoped>
-	.addr-label{
+	.addr-label {
 		padding: 6upx 0;
-		border-radius:3px;
+		border-radius: 3px;
 		background-color: #F6390D;
 		color: #fff;
 		width: 120upx;
@@ -95,45 +124,57 @@
 		flex-shrink: 0;
 		margin-right: 14upx;
 	}
-	.order-spec{
+
+	.order-spec {
 		padding-bottom: 10upx;
 	}
-	.shop{
+
+	.shop {
 		padding-top: 20upx;
 	}
-	.goods-num{
+
+	.goods-num {
 		font-size: 16px;
 		padding-left: 20upx;
 	}
-	.goods-cont{
+
+	.goods-cont {
 		width: 100%;
 		box-sizing: border-box;
 	}
-	.total-goods{
+
+	.total-goods {
 		font-size: 12px;
 		color: #999;
 	}
-	.submit-bar{
+
+	.submit-bar {
 		height: 130rpx;
 		width: 100%;
 		background-color: #FFF;
 		position: fixed;
 		left: 0;
 		bottom: 0;
-		box-shadow: 0px -4px 16px 0px rgba(0,0,0,0.15);
+		box-shadow: 0px -4px 16px 0px rgba(0, 0, 0, 0.15);
 		z-index: 10;
-		.submit-btn{
+
+		.submit-btn {
 			background-color: #0581FE;
 			height: 100%;
 			width: 100%;
 			color: #FFF;
 			font-size: 14px;
 			// font-weight: 700;
-			border-radius:35upx ;
+			border-radius: 35upx;
 		}
 	}
-	.good-num{
+
+	.good-num {
 		font-size: 12px;
 		padding-top: 40rpx;
 	}
-</style>
+	.send-label{
+		font-size: 14px;
+		font-weight: 700;
+	}
+</style>

+ 163 - 0
pages/user/myInfo.vue

@@ -0,0 +1,163 @@
+<template>
+	<view>
+		<view style="margin: 20px; background-color: #fff;">
+			<!-- 注意,如果需要兼容微信小程序,最好通过setRules方法设置rules规则 -->
+			<u--form labelPosition="left" :model="userInfo" :rules="rules" ref="uForm">
+				<u-form-item label="姓名" prop="userInfo.name">
+					<u--input v-model="userInfo.name" border="none"></u--input>
+				</u-form-item>
+				<u-form-item label="头像" prop="userInfo.avg">
+					<view slot="right" class="flex-row" @click="onInfo">
+						<u-avatar :src="getFilePath(userInfo.avg ? userInfo.avg : null)" size="50"
+							@click="uploadAvator"></u-avatar>
+						<view class="flex-grow-1">
+							<u-icon name="arrow-right" color="#96989e"></u-icon>
+						</view>
+					</view>
+				</u-form-item>
+				<u-form-item label="生日" prop="userInfo.birthday">
+					<u--input v-model="userInfo.birthday" border="none" placeholder="请选择生日"></u--input>
+					<u-icon slot="right" name="arrow-right" color="#96989e"></u-icon>
+				</u-form-item>
+				<u-form-item label="手机号" prop="userInfo.phone" labelWidth="100px">
+					<u--input v-model="userInfo.phone" border="none"></u--input>
+					<u-button type="primary" shape="circle" size="small" slot="right"
+						color="linear-gradient(to right, #F54319, #FF6D20)" text="解绑">
+					</u-button>
+				</u-form-item>
+			</u--form>
+		</view>
+		<view class="cart-bottom padding-sm dflex-b">
+			<view class="go-cart dflex-c">保存编辑</view>
+			<view class="go-buy dflex-c background-gradient">退出登录</view>
+		</view>
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				userInfo: {
+					name: 'uView UI',
+					avg: '',
+					birthday: '',
+					phone: ''
+				},
+				rules: {
+					// 字段名称
+					phone: [{
+							required: true,
+							message: '请输入手机号',
+							trigger: ['change', 'blur'],
+						},
+						{
+							// 自定义验证函数,见上说明
+							validator: (rule, value, callback) => {
+								// 上面有说,返回true表示校验通过,返回false表示不通过
+								// uni.$u.test.phone()就是返回true或者false的
+								return uni.$u.test.phone(value);
+							},
+							message: '手机号码不正确',
+							// 触发器可以同时用blur和change
+							trigger: ['change', 'blur'],
+						}
+					]
+				}
+
+			}
+		},
+		methods: {
+			uploadAvator() { // 上传头像
+				uni.chooseImage({
+					success: (file) => {
+						uni.showLoading({
+							title: '请稍后',
+						})
+
+						// 上传头像文件
+						uni.uploadFile({
+							url: `${this.serverPath}/resource/oss/upload`,
+							name: 'file',
+							filePath: file.tempFilePaths[0],
+							header: {
+								tenantId: this.tenantId
+							},
+							success: async (response) => {
+								const data = JSON.parse(response.data)
+								// 更新用户头像
+								const result = await this.$request('post',
+									'/userinfo/account/update', {
+										avatarUrl: data.data.url,
+										aid: this.userdata.aid
+									}, false, true)
+
+								if (result) {
+									// 记录埋点
+									this.$setPoint('user_update_avatarUrl', {
+										avatarUrl: data.data.url
+									})
+									uni.showToast({
+										title: '上传成功',
+										icon: 'success'
+									})
+									this.userdata.avatarUrl = data.data.url
+									this.setStoreData('vuex_user', this.userdata)
+								}
+							},
+							fail: (e) => {
+
+							}
+						})
+					},
+					fail: (e) => {
+
+					}
+				})
+			},
+		},
+	}
+</script>
+<style scoped lang="less">
+	.cart-bottom {
+		width: 100%;
+		position: fixed;
+		left: 0;
+		bottom: 0;
+		height: 130rpx;
+		box-sizing: border-box;
+		background-color: #FFF;
+		z-index: 10;
+		box-shadow: 0px -4px 16px 0px rgba(0, 0, 0, 0.15);
+
+		.go-cart {
+			height: 80%;
+			box-sizing: border-box;
+			border: solid 1px #BBBBBB;
+			font-size: 14px;
+			color: #000;
+			border-radius: 50upx;
+			margin: 0 10px;
+			width: 45%;
+		}
+
+		.go-buy {
+			height: 80%;
+			width: 45%;
+			background-color: #FF0000;
+			color: #FFF;
+			border-radius: 50upx;
+			font-size: 14px;
+		}
+	}
+
+	.flex-row {
+		display: flex;
+		align-items: center;
+	}
+
+	.flex-grow-1 {
+		flex-grow: 1;
+		margin-left: 10px;
+	}
+</style>

+ 178 - 6
pages/user/user.vue

@@ -1,6 +1,81 @@
 <template>
-	<view>
-		
+	<view class="pageBg">
+		<view class="page-header">
+			<view class="contain">
+				<view class="page-header-content">
+					<view class="page-header-content-left">
+						<view class="" @click="onInfo">
+							<u-avatar :src="getFilePath(userdata ? userdata.avatarUrl : null)" size="100"></u-avatar>
+						</view>
+					</view>
+					<view class="page-header-content-center">
+						<view>
+							<view class="fz16px mt5px">{{userdata && userdata.phone ? userdata.phone : '22222'}}</view>
+						</view>
+					</view>
+				</view>
+			</view>
+			<!-- 订单 -->
+			<view class="mt20px">
+				<view class="contain">
+					<view class="box">
+						<u-row justify="center">
+							<u-col span="8">
+								<view class="">我的订单</view>
+							</u-col>
+							<u-col span="4">
+								<view class="text-right" @click="openPage('/pages/order/myOrder/myOrder?type=0');">
+									<text class="fz14px" style="color: #96989e;">全部订单</text>
+									<view style="display: inline-block;">
+										<u-icon name="arrow-right" color="#96989e" size="24"></u-icon>
+									</view>
+								</view>
+							</u-col>
+						</u-row>
+						<view class="flex-box mt20px">
+							<view class="flex-box-item" @click="openPage('/pages/order/myOrder/myOrder?type=1')">
+								<u-icon name="rmb-circle" labelColor="#96989e" labelPos="bottom" labelSize="14px"
+									label="待付款" size="40"></u-icon>
+							</view>
+							<view class="flex-box-item" @click="openPage('/pages/order/myOrder/myOrder?type=2')">
+								<u-icon name="clock" labelColor="#96989e" label="待核销" labelSize="14px" labelPos="bottom"
+									size="40"></u-icon>
+							</view>
+							<view class="flex-box-item" @click="openPage('/pages/order/myOrder/myOrder?type=3')">
+								<u-icon name="close-circle" label="已取消" labelColor="#96989e" labelSize="14px" labelPos="bottom"
+									size="40"></u-icon>
+							</view>
+							<view class="flex-box-item" @click="openPage('/pages/order/myOrder/myOrder?type=4')">
+								<u-icon name="bag" label="已完成" labelColor="#96989e" labelSize="14px" labelPos="bottom"
+									size="40"></u-icon>
+							</view>
+						</view>
+					</view>
+				</view>
+			</view>
+		</view>
+		<view class="mt20px">
+			<view class="contain mt20px">
+				<view class="box mt20px">
+					<view class="mb10px">我的应用</view>
+					<view class="flex-box mt20px">
+						<view class="flex-box-item" @click="openPage('/pages/user/myInfo')">
+							<u-icon name="account" labelColor="#96989e" labelPos="bottom" labelSize="14px"
+								label="个人信息" size="40"></u-icon>
+						</view>
+						<view class="flex-box-item" @click="openPage('/pages/classify/classify')">
+							<u-icon name="car" labelColor="#96989e" label="餐车信息" labelSize="14px" labelPos="bottom"
+								size="40"></u-icon>
+						</view>
+						<view class="flex-box-item" @click="call">
+							<u-icon name="kefu-ermai" label="客服电话" labelColor="#96989e" labelSize="14px" labelPos="bottom"
+								size="40"></u-icon>
+						</view>
+					</view>
+				</view>
+				<!-- <u-button type="error" @click="exitMP()">退出登录</u-button> -->
+			</view>
+		</view>
 	</view>
 </template>
 
@@ -8,15 +83,112 @@
 	export default {
 		data() {
 			return {
-				
+				userdata:{
+					avatarUrl:'',
+					phone:''
+				},
+				cPhone: ''
 			}
 		},
+		onLoad() {
+			const e = uni.getStorageSync('info')
+			this.cPhone = e
+		},
 		methods: {
-			
+			openPage(path) {
+				this.$u.route({
+					url: path
+				})
+			},
+			call() {
+				console.log('eeeeeeeeeeeeeeee===============', this.cPhone)
+				if (this.cPhone.customerPhone) {
+					uni.makePhoneCall({
+						phoneNumber: this.cPhone.customerPhone
+					})
+				} else {
+					uni.showToast({
+						icon: 'none',
+						title: '暂无商家电话'
+					})
+				}
+			},
+			onInfo() {
+				uni.navigateTo({
+					url: `/pages/user/myInfo`
+				});
+			}
 		}
 	}
 </script>
 
-<style>
+<style lang="scss">
+	.page-header {
+		width: 100%;
+		display: inline-block;
+		padding-top: 60rpx;
+		background-size: cover;
+		background-position: left;
+		background-repeat: no-repeat;
+		background-image: linear-gradient(to bottom, #FBBD69, #F97023);
+		height: 35vh;
+
+		&-content {
+			display: flex;
+			flex-direction: column; // 设置 Flex 方向为垂直
+			align-items: center; // 水平居中子元素
+			justify-content: center; // 垂直居中子元素
+
+			&-left {
+				margin-right: 20rpx;
+
+				.avator {
+					display: inline-block;
+					border: 2px solid #fff;
+					border-radius: 50%;
+				}
+			}
+
+			&-center {
+				flex: 1;
+				color: #fff;
+			}
+
+			&-right {
+				width: 60rpx;
+			}
+		}
+	}
+
+	.box {
+		padding: 30rpx;
+		border-radius: 20rpx;
+		background-color: #fff;
+	}
+
+	.flex-box {
+		display: flex;
+		text-align: center;
+		background-color: #F1F3F8;
+		border-radius: 10rpx;
 
-</style>
+		&-item {
+			flex: 1;
+			margin: 10px;
+			position: relative;
+
+			.line {
+				height: 70%;
+				width: 1px;
+				background-color: #ebebeb;
+				position: absolute;
+				right: 0;
+				top: 50%;
+				transform: translateY(-50%);
+			}
+		}
+	}
+	.pageBg {
+		background-color: #EFF2F7
+	}
+</style>

BIN
static/aftersale.png


BIN
static/bookmarko.png


BIN
static/clocko.png


BIN
static/close.png


BIN
static/cooking.png


BIN
static/dangq.png


BIN
static/danqian.png


BIN
static/first.png


BIN
static/nice.jpg


BIN
static/people.png


BIN
static/service.png


BIN
static/shoppingCart.png


BIN
static/sign.png


BIN
static/stLine.png


BIN
static/stLineuser.png


+ 1 - 1
utils/request.js

@@ -22,7 +22,7 @@ const request = parames => {
 		console.warn('请求url参数为空,请检查!');
 		return
 	}
-	const port = '';
+	const port = 'http://36.137.224.81:8030/auth';
 	let reqData = {};
 	reqData.url = port + parames.url;
 	reqData.method = parames.method ? parames.method : 'GET';

+ 104 - 0
vue.config.js

@@ -0,0 +1,104 @@
+// 读取 manifest.json ,修改后重新写入
+const {
+  log
+} = require('console')
+const fs = require('fs')
+const package_json = require('./package.json')
+const manifestPath = `${__dirname}/manifest.json`
+const pagePath = `${__dirname}/pages.json`
+const scssPath = `${__dirname}/uni.scss`
+let Manifest = fs.readFileSync(manifestPath, {
+  encoding: 'utf-8'
+})
+let Pagejson = fs.readFileSync(pagePath, {
+  encoding: 'utf-8'
+})
+let Scss = fs.readFileSync(scssPath, {
+  encoding: 'utf-8'
+})
+
+function replaceManifest(path, value) { // 修改 manifest.json 的配置
+  const arr = path.split('.')
+  const len = arr.length
+  const lastItem = arr[len - 1]
+
+  let i = 0
+  let ManifestArr = Manifest.split(/\n/)
+
+  for (let index = 0; index < ManifestArr.length; index++) {
+    const item = ManifestArr[index]
+    if (new RegExp(`"${arr[i]}"`).test(item)) ++i;
+    if (i === len) {
+      const hasComma = /,/.test(item)
+      ManifestArr[index] = item.replace(new RegExp(`"${lastItem}"[\\s\\S]*:[\\s\\S]*`), `"${lastItem}": ${value}${hasComma ? ',' : ''}`)
+      break;
+    }
+  }
+
+  Manifest = ManifestArr.join('\n')
+}
+
+function replacePagejson(path, value) { // 修改 pages.json 的配置
+  const arr = path.split('.')
+  const len = arr.length
+  const lastItem = arr[len - 1]
+
+  let i = 0
+  let PagejsonArr = Pagejson.split(/\n/)
+
+  for (let index = 0; index < PagejsonArr.length; index++) {
+    const item = PagejsonArr[index]
+    if (new RegExp(`"${arr[i]}"`).test(item)) ++i;
+    if (i === len) {
+      const hasComma = /,/.test(item)
+      PagejsonArr[index] = item.replace(new RegExp(`"${lastItem}"[\\s\\S]*:[\\s\\S]*`), `"${lastItem}": ${value}${hasComma ? ',' : ''}`)
+      break;
+    }
+  }
+
+  Pagejson = PagejsonArr.join('\n')
+}
+
+function replaceScssPath(path, value) { // 修改 uni.scss.json 的配置
+  const arr = path.split('.')
+  const len = arr.length
+  const lastItem = arr[len - 1]
+
+  let i = 0
+  let ScssArr = Scss.split(/\n/)
+  for (let index = 0; index < ScssArr.length; index++) {
+    const item = ScssArr[index]
+    const hasComma = /,/.test(item)
+    const reg = new RegExp(`${lastItem}[\\s\\S]*:[\\s\\S]*`)
+    ScssArr[index] = item.replace(reg, `${lastItem}: ${value};`)
+  }
+
+  Scss = ScssArr.join('\n')
+}
+// 使用
+if (process.env.UNI_SCRIPT) {
+  const path = package_json['uni-app']['scripts'][process.env.UNI_SCRIPT]['env']['ENV_PATH'] // 配置文件路径
+  const config = require(path) // 读取配置信息
+  replaceManifest('mp-weixin.appid', `"${config.appId}"`) // 更新 appid
+  replacePagejson('globalStyle.navigationBarTitleText', `"${config.name}"`) // 更新 pages.json
+  replaceScssPath('base-img-url', `'${config.serverFilePath}'`)
+}
+
+// 更新 manifest.json
+fs.writeFileSync(manifestPath, Manifest, {
+  "flag": "w"
+})
+
+// 更新 pages.json
+fs.writeFileSync(pagePath, Pagejson, {
+  "flag": "w"
+})
+
+// 更新 uni.scss
+fs.writeFileSync(scssPath, Scss, {
+  "flag": "w"
+})
+
+module.exports = {
+  // ...
+}