zs 2 years ago
parent
commit
c05198a7e1

+ 0 - 2
pagesHome/group/.gitignore

@@ -1,2 +0,0 @@
-unpackage/
-.hbuilderx/

+ 101 - 0
pagesHome/order/components/dialog_1.vue

@@ -0,0 +1,101 @@
+<template>
+	<view class="dialog">
+		<view v-if="dialog.show==true" @tap="dialogClose">
+			<view class="dialog_1" v-if="dialog.type=='1'">
+				<swiper class="swiper" circular @change="diaSpecs" :current="is_specs">
+					<swiper-item class="list" v-for="(item,index) in specsList" :key="index">
+						<view class="list_1">
+							<image class="image"
+								:src="item.file&&item.file.length>0?item.file[0].url:info.goods.file[0].url"
+								mode="aspectFit"></image>
+						</view>
+						<view class="name">
+							<text>{{item.name}}</text>
+						</view>
+					</swiper-item>
+				</swiper>
+			</view>
+		</view>
+	</view>
+</template>
+
+<script>
+	export default {
+		props: {
+			dialog: {
+				type: Object,
+			},
+			info: {
+				type: Object
+			},
+			is_specs: {
+				type: Number
+			},
+		},
+		data() {
+			return {
+				specsList: [],
+			};
+		},
+		methods: {
+			dialogClose() {
+				const that = this;
+				that.$emit('dialogClose')
+			},
+			diaSpecs() {
+				const that = this;
+				that.$emit('diaSpecs')
+			},
+		},
+		watch: {
+			info: {
+				deep: true,
+				immediate: true,
+				handler(val) {
+					if (val && val.specs && val.specs.length > 0) this.$set(this, `specsList`, val?.specs)
+				}
+			}
+		},
+	}
+</script>
+
+<style lang="scss">
+	.dialog {
+
+		swiper {
+			height: 60vh;
+		}
+
+		.list {
+			.list_1 {
+				padding: 2vw;
+				margin: 0 0 5vw 0;
+
+				.image {
+					width: 100%;
+					height: 40vh;
+				}
+			}
+
+			.name {
+				text-align: center;
+				margin: 0 10vw;
+				background-color: #6666669f;
+				border-radius: 25px;
+				padding: 2vw;
+
+				text {
+					color: #fff;
+					font-size: 15px;
+					overflow: hidden;
+					text-overflow: ellipsis;
+					-webkit-line-clamp: 2;
+					word-break: break-all;
+					display: -webkit-box;
+					-webkit-box-orient: vertical;
+				}
+			}
+
+		}
+	}
+</style>

+ 22 - 86
pagesHome/order/components/specs_1.vue

@@ -134,31 +134,12 @@
 				</view>
 				</view>
 			</scroll-view>
 			</scroll-view>
 		</view>
 		</view>
-		<view class="dialog" v-if="dialog.show==true" @tap="dialogClose">
-			<view class="dialog_1" v-if="dialog.type=='1'">
-				<swiper class="swiper" circular @change="diaSpecs" :current="is_specs">
-					<swiper-item class="list" v-for="(item,index) in specsList" :key="index">
-						<view class="list_1">
-							<image class="image"
-								:src="item.file&&item.file.length>0?item.file[0].url:info.goods.file[0].url"
-								mode="aspectFit"></image>
-						</view>
-						<view class="name">
-							<text>{{item.name}}</text>
-						</view>
-					</swiper-item>
-				</swiper>
-			</view>
-		</view>
 	</view>
 	</view>
 </template>
 </template>
 
 
 <script>
 <script>
 	export default {
 	export default {
 		props: {
 		props: {
-			goodsInfo: {
-				type: Object,
-			},
 			info: {
 			info: {
 				type: Object,
 				type: Object,
 			},
 			},
@@ -174,9 +155,6 @@
 			is_specs: {
 			is_specs: {
 				type: Number
 				type: Number
 			},
 			},
-			buy_num: {
-				type: Number
-			},
 			is_zero: {
 			is_zero: {
 				type: Boolean
 				type: Boolean
 			},
 			},
@@ -193,6 +171,7 @@
 				actList: [],
 				actList: [],
 				setList: [],
 				setList: [],
 				specsList: [],
 				specsList: [],
+				buy_num: 1,
 			};
 			};
 		},
 		},
 		methods: {
 		methods: {
@@ -204,9 +183,9 @@
 				const that = this;
 				const that = this;
 				that.$emit('toSpecs', item)
 				that.$emit('toSpecs', item)
 			},
 			},
-			toCount() {
+			toCount(e) {
 				const that = this;
 				const that = this;
-				that.$emit('toCount')
+				that.$emit('toCount', e)
 			},
 			},
 			toMarket() {
 			toMarket() {
 				const that = this;
 				const that = this;
@@ -232,37 +211,36 @@
 				const that = this;
 				const that = this;
 				that.$emit('toSetMarket', item)
 				that.$emit('toSetMarket', item)
 			},
 			},
-			dialogClose() {
-				const that = this;
-				that.$emit('dialogClose')
-			},
 			diaSpecs() {
 			diaSpecs() {
 				const that = this;
 				const that = this;
 				that.$emit('diaSpecs')
 				that.$emit('diaSpecs')
 			},
 			},
+			toDeatil(item) {
+				const that = this;
+				that.$emit('toDeatil', item)
+			},
 		},
 		},
 		watch: {
 		watch: {
 			specsInfo: {
 			specsInfo: {
 				deep: true,
 				deep: true,
 				immediate: true,
 				immediate: true,
 				handler(val) {
 				handler(val) {
-					if (val && val?.file.length > 0) this.$set(this, `specfileList`, val?.file)
-				}
-			},
-			goodsInfo: {
-				deep: true,
-				immediate: true,
-				handler(val) {
-					if (val && val?.file.length > 0) this.$set(this, `goodsfileList`, val?.file)
+					if (val && val.file && val.file.length > 0) this.$set(this, `specfileList`, val?.file)
 				}
 				}
 			},
 			},
 			info: {
 			info: {
 				deep: true,
 				deep: true,
 				immediate: true,
 				immediate: true,
 				handler(val) {
 				handler(val) {
-					if (val && val?.act.length > 0) this.$set(this, `actList`, val?.act)
-					if (val && val?.sets.length > 0) this.$set(this, `setList`, val?.sets)
-					if (val && val?.specs.length > 0) this.$set(this, `specsList`, val?.specs)
+					if (val && val.goods && val?.goods.length > 0) {
+						this.$set(this, `goodsInfo`, val?.goods)
+						if (val.goods && val.goods.file && val.goods.file.length > 0) {
+							this.$set(this, `goodsfileList`, val.goods.file)
+						}
+					}
+					if (val && val.act && val.act.length > 0) this.$set(this, `actList`, val?.act)
+					if (val && val.sets && val.sets.length > 0) this.$set(this, `setList`, val?.sets)
+					if (val && val.specs && val.specs.length > 0) this.$set(this, `specsList`, val?.specs)
 				}
 				}
 			}
 			}
 		},
 		},
@@ -271,6 +249,11 @@
 
 
 <style lang="scss">
 <style lang="scss">
 	.specs {
 	.specs {
+		position: relative;
+		display: flex;
+		flex-direction: column;
+		height: 54vh;
+
 		.specs_1 {
 		.specs_1 {
 			position: relative;
 			position: relative;
 			display: flex;
 			display: flex;
@@ -584,52 +567,5 @@
 				}
 				}
 			}
 			}
 		}
 		}
-
-		.dialog {
-			position: fixed;
-			width: 100vw;
-			height: 100vh;
-			background-color: #000000;
-			z-index: 99999;
-			display: flex;
-			flex-direction: column;
-			justify-content: center;
-
-			swiper {
-				height: 60vh;
-			}
-
-			.list {
-				.list_1 {
-					padding: 2vw;
-					margin: 0 0 5vw 0;
-
-					.image {
-						width: 100%;
-						height: 40vh;
-					}
-				}
-
-				.name {
-					text-align: center;
-					margin: 0 10vw;
-					background-color: #6666669f;
-					border-radius: 25px;
-					padding: 2vw;
-
-					text {
-						color: #fff;
-						font-size: 15px;
-						overflow: hidden;
-						text-overflow: ellipsis;
-						-webkit-line-clamp: 2;
-						word-break: break-all;
-						display: -webkit-box;
-						-webkit-box-orient: vertical;
-					}
-				}
-
-			}
-		}
 	}
 	}
 </style>
 </style>

+ 67 - 11
pagesHome/order/detail.vue

@@ -5,8 +5,8 @@
 				<scroll-view scroll-y="true" class="scroll-view">
 				<scroll-view scroll-y="true" class="scroll-view">
 					<view class="list-scroll-view">
 					<view class="list-scroll-view">
 						<view class="one_1">
 						<view class="one_1">
-							<banner :goodsInfo="info.goods" :goodsColect="goodsColect" @toGoodscolect="toGoodscolect">
-							</banner>
+							<banner_1 :goodsInfo="info.goods" :goodsColect="goodsColect" @toGoodscolect="toGoodscolect">
+							</banner_1>
 						</view>
 						</view>
 						<view class="one_2">
 						<view class="one_2">
 							<text class="money_1"
 							<text class="money_1"
@@ -142,23 +142,31 @@
 				<view class="close">
 				<view class="close">
 					<text @click="toClose" class="iconfont icon-shanchu"></text>
 					<text @click="toClose" class="iconfont icon-shanchu"></text>
 				</view>
 				</view>
-				<specs_1 :info="info" :goodsInfo="info.goods" :specsInfo="specsInfo" :btn_type="btn_type"
-					:dialog="dialog" :is_zero="is_zero" :buy_num="buy_num" :popupShow="popupShow" :is_specs="is_specs"
-					@diaView="diaView" @toSpecs="toSpecs" @toCount="toCount" @toMarket="toMarket" @toBuy="toBuy"
-					@toGroup="toGroup" @dialogClose="dialogClose" @diaSpecs="diaSpecs">
+				<specs_1 :info="info" :specsInfo="specsInfo" :btn_type="btn_type" :is_zero="is_zero" :buy_num="buy_num"
+					:popupShow="popupShow" :is_specs="is_specs" @diaView="diaView" @toSpecs="toSpecs" @toCount="toCount"
+					@toMarket="toMarket" @toBuy="toBuy" @toGroup="toGroup" @diaSpecs="diaSpecs"
+					@toSetMarket="toSetMarket" @toAct="toAct" @toDeatil="toDeatil">
 				</specs_1>
 				</specs_1>
 			</view>
 			</view>
 		</uni-popup>
 		</uni-popup>
+		<!-- 弹框 -->
+		<view class="dislog">
+			<dialog_1 :info="info" :dialog="dialog" @dialogClose="dialogClose" :is_specs="is_specs"
+				@diaSpecs="diaSpecs">
+			</dialog_1>
+		</view>
 	</mobile-frame>
 	</mobile-frame>
 </template>
 </template>
 
 
 <script>
 <script>
-	import banner from './components/banner_1.vue';
+	import banner_1 from './components/banner_1.vue';
 	import specs_1 from './components/specs_1.vue';
 	import specs_1 from './components/specs_1.vue';
+	import dialog_1 from './components/dialog_1.vue';
 	export default {
 	export default {
 		components: {
 		components: {
-			banner,
+			banner_1,
 			specs_1,
 			specs_1,
+			dialog_1
 		},
 		},
 		data() {
 		data() {
 			return {
 			return {
@@ -228,7 +236,7 @@
 				buy_num: 1,
 				buy_num: 1,
 				// 规格弹出框
 				// 规格弹出框
 				dialog: {
 				dialog: {
-					show: false,
+					show: true,
 					type: '1'
 					type: '1'
 				},
 				},
 			};
 			};
@@ -529,8 +537,9 @@
 			},
 			},
 			// 计数器
 			// 计数器
 			toCount(e) {
 			toCount(e) {
-				const that = this;
-				that.$set(that, `buy_num`, e)
+				console.log(e);
+				// const that = this;
+				// that.$set(that, `buy_num`, e)
 			},
 			},
 			// 立即购买
 			// 立即购买
 			async toBuy() {
 			async toBuy() {
@@ -617,6 +626,12 @@
 					url: `/pagesHome/group/index?shop=${that.info?.shop?._id}&goods=${that.id}`
 					url: `/pagesHome/group/index?shop=${that.info?.shop?._id}&goods=${that.id}`
 				})
 				})
 			},
 			},
+			// 查看活动
+			toAct(item) {
+				uni.navigateTo({
+					url: `/pagesRest/activity/info?id=${item._id}`
+				})
+			},
 			// 店铺,购物车
 			// 店铺,购物车
 			toNavleft(e) {
 			toNavleft(e) {
 				const that = this;
 				const that = this;
@@ -649,6 +664,36 @@
 				if (data.num <= 0) that.$set(that, `is_zero`, true)
 				if (data.num <= 0) that.$set(that, `is_zero`, true)
 				else that.$set(that, `is_zero`, false)
 				else that.$set(that, `is_zero`, false)
 			},
 			},
+			// 套装加入购物车
+			async toSetMarket(e) {
+				const that = this;
+				let user = that.user;
+				if (user && user._id) {
+					let obj = {
+						customer: user._id,
+						set_id: e._id,
+						is_set: '0',
+						num: 1,
+					}
+					let res = await that.$api(`/cart`, 'POST', obj)
+					if (res.errcode == '0') {
+						uni.showToast({
+							title: `加入购物车成功`,
+							icon: 'none'
+						})
+						that.toClose();
+					} else {
+						uni.showToast({
+							title: res.errmsg,
+							icon: 'none'
+						})
+					}
+				} else {
+					uni.navigateTo({
+						url: `/pages/login/index`
+					})
+				}
+			},
 			// 加入购物车,立即购买
 			// 加入购物车,立即购买
 			toNavright(e) {
 			toNavright(e) {
 				const that = this;
 				const that = this;
@@ -1015,4 +1060,15 @@
 			padding: 2vw;
 			padding: 2vw;
 		}
 		}
 	}
 	}
+
+	.dialog {
+		position: fixed;
+		width: 100vw;
+		height: 100vh;
+		background-color: #000000;
+		z-index: 99999;
+		display: flex;
+		flex-direction: column;
+		justify-content: center;
+	}
 </style>
 </style>

+ 4 - 4
pagesRest/activity/info.vue

@@ -4,7 +4,7 @@
 			<scroll-view scroll-y="true" class="scroll-view" @scrolltolower="toPage" @scroll="toScroll">
 			<scroll-view scroll-y="true" class="scroll-view" @scrolltolower="toPage" @scroll="toScroll">
 				<view class="list-scroll-view">
 				<view class="list-scroll-view">
 					<view class="one">
 					<view class="one">
-						<rich-text :nodes="info.content.value"></rich-text>
+						<rich-text :nodes="info.content&&info.content.value"></rich-text>
 					</view>
 					</view>
 					<view class="two">
 					<view class="two">
 						<view class="list" v-for="(item,index) in list" :key="index" @tap="toBuy(item)">
 						<view class="list" v-for="(item,index) in list" :key="index" @tap="toBuy(item)">
@@ -17,14 +17,14 @@
 							</view>
 							</view>
 							<view class="money">
 							<view class="money">
 								<view class="money_1">
 								<view class="money_1">
-									<text>{{item.platform_act_type=='3'?'特价¥':'¥'}}</text><text>{{item.platform_act_type=='3'?item.config.sp_price:item.sell_money}}</text>
+									<text>{{item.platform_act_type=='3'?'特价¥':'¥'}}</text><text>{{item.platform_act_type=='3'?item.config&&item.config.sp_price:item.sell_money}}</text>
 								</view>
 								</view>
 								<view class="money_2">
 								<view class="money_2">
 									<text>¥</text><text>{{item.flow_money||0}}</text>
 									<text>¥</text><text>{{item.flow_money||0}}</text>
 								</view>
 								</view>
 							</view>
 							</view>
 							<view class="acttags">
 							<view class="acttags">
-								<text v-for="i in item.act_tags" :key="i">{{i.label}}</text>
+								<text v-for="(i,indexx) in item.act_tags" :key="indexx">{{i.label}}</text>
 							</view>
 							</view>
 						</view>
 						</view>
 					</view>
 					</view>
@@ -166,7 +166,7 @@
 			configShare() {
 			configShare() {
 				const that = this;
 				const that = this;
 				let info = that.info;
 				let info = that.info;
-				let imageUrl = that.config.config.logo[0].url;
+				let imageUrl = that.config?.config?.logo[0].url;
 				if (info.share.length > 0) imageUrl = info.share[0].url;
 				if (info.share.length > 0) imageUrl = info.share[0].url;
 				that.$config.share = {
 				that.$config.share = {
 					title: info.act_time.title,
 					title: info.act_time.title,

+ 4 - 3
pagesRest/activity/list.vue

@@ -9,13 +9,14 @@
 					<view class="list-scroll-view">
 					<view class="list-scroll-view">
 						<view class="list" v-for="(item,index) in list" :key="index" @tap="toInfo(item)">
 						<view class="list" v-for="(item,index) in list" :key="index" @tap="toInfo(item)">
 							<view class="img">
 							<view class="img">
-								<image class="image" :src="item.cover&&item.cover.length>0?item.cover[0].url:''" mode="">
+								<image class="image" :src="item.cover&&item.cover.length>0?item.cover[0].url:''"
+									mode="">
 								</image>
 								</image>
 							</view>
 							</view>
-							<view class="title" v-if="item.act_time.is_use=='0'">
+							<view class="title" v-if="item.act_time&&item.act_time.is_use=='0'">
 								<text>{{item.act_time.title}}</text>
 								<text>{{item.act_time.title}}</text>
 							</view>
 							</view>
-							<view class="time" v-if="item.act_time.is_use=='0'">
+							<view class="time" v-if="item.act_time&&item.act_time.is_use=='0'">
 								<text>{{item.act_time.value}}</text>
 								<text>{{item.act_time.value}}</text>
 							</view>
 							</view>
 						</view>
 						</view>