api
This commit is contained in:
		
							parent
							
								
									c7136c2c11
								
							
						
					
					
						commit
						dc69746320
					
				| @ -11,10 +11,37 @@ export default { | |||||||
| 					is_video_img: is_video_img, | 					is_video_img: is_video_img, | ||||||
| 				}); | 				}); | ||||||
| 			}, | 			}, | ||||||
|  | 			// 发现(取消)点赞
 | ||||||
|  | 			articleLike({ article_id }) { | ||||||
|  | 				return vm.$u.post('article/articleLike', { | ||||||
|  | 					article_id: article_id, | ||||||
|  | 				}); | ||||||
|  | 			}, | ||||||
|  | 			// 发现(取消)收藏
 | ||||||
|  | 			articleCollect({ article_id }) { | ||||||
|  | 				return vm.$u.post('article/articleCollect', { | ||||||
|  | 					article_id: article_id, | ||||||
|  | 				}); | ||||||
|  | 			}, | ||||||
|  | 			// 屏蔽用户
 | ||||||
|  | 			articleAddShield({ article_id, member_id }) { | ||||||
|  | 				return vm.$u.post('article/articleAddShield', { | ||||||
|  | 					article_id: article_id, | ||||||
|  | 					member_id: member_id, | ||||||
|  | 				}); | ||||||
|  | 			}, | ||||||
|  | 			// 推荐达人
 | ||||||
|  | 			getRecommendList(){ | ||||||
|  |                 return vm.$u.post('MemberExpert/recommendList'); | ||||||
|  | 			}, | ||||||
| 			// 获取商城首页信息(顶部轮播图与商品分类)
 | 			// 获取商城首页信息(顶部轮播图与商品分类)
 | ||||||
| 			getShopTopList(){ | 			getShopTopList(){ | ||||||
|                 return vm.$u.post('Shop/getShopTopList'); |                 return vm.$u.post('Shop/getShopTopList'); | ||||||
| 			}, | 			}, | ||||||
|  | 			// 商品分类列表(树结构)
 | ||||||
|  | 			getGoodsClassifyList() { | ||||||
|  | 				return vm.$u.post('Goods/getGoodsClassifyList'); | ||||||
|  | 			}, | ||||||
| 			// 商品推荐
 | 			// 商品推荐
 | ||||||
|             getGoodsRecommend({page}){ |             getGoodsRecommend({page}){ | ||||||
|                 return vm.$u.post('Goods/getGoodsRecommend', { |                 return vm.$u.post('Goods/getGoodsRecommend', { | ||||||
| @ -42,12 +69,25 @@ export default { | |||||||
| 					cart_ids: id | 					cart_ids: id | ||||||
| 				}); | 				}); | ||||||
| 			}, | 			}, | ||||||
|  | 			// 购物车更新商品数量
 | ||||||
|  | 			cartUpdateNumber({ cart_id, quantity }) { | ||||||
|  | 				return vm.$u.post('cart/cartUpdate', { | ||||||
|  | 					cart_id: cart_id, | ||||||
|  | 					quantity: quantity | ||||||
|  | 				}); | ||||||
|  | 			}, | ||||||
|  | 			// 订单结算数据
 | ||||||
|  | 			settlementOrder({ cart_id }) { | ||||||
|  | 				return vm.$u.post('buy/buy_step1', { | ||||||
|  | 					cart_id: cart_id, | ||||||
|  | 				}); | ||||||
|  | 			}, | ||||||
| 			// 商品详情
 | 			// 商品详情
 | ||||||
| 			getGoodsDetails({ id }) { | 			getGoodsDetails({ id }) { | ||||||
| 				return vm.$u.post('Goods/goodDetails', { | 				return vm.$u.post('Goods/goodDetails', { | ||||||
| 					goods_id: id | 					goods_id: id | ||||||
| 				}); | 				}); | ||||||
| 			} | 			}, | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
|      |      | ||||||
|  | |||||||
| @ -183,18 +183,26 @@ export default { | |||||||
| 				return vm.$u.post('Member/MemberInfo'); | 				return vm.$u.post('Member/MemberInfo'); | ||||||
| 			}, | 			}, | ||||||
| 			// 设置-修改用户信息
 | 			// 设置-修改用户信息
 | ||||||
| 			updateMemberInfo({ nickname, gender, avatar }) { | 			updateMemberInfo({ nickname, gender, avatar, birthday }) { | ||||||
| 				return vm.$u.post('Member/changeMemberInfo', { | 				return vm.$u.post('Member/changeMemberInfo', { | ||||||
| 					nickname: nickname, | 					nickname: nickname, | ||||||
| 					sex: gender, | 					sex: gender, | ||||||
| 					avatar: avatar, | 					avatar: avatar, | ||||||
|  | 					birthday: birthday, | ||||||
| 				}); | 				}); | ||||||
| 			}, | 			}, | ||||||
| 			// 用户浏览记录
 | 			// 用户浏览记录
 | ||||||
| 			getBrowseList() { | 			getBrowseList() { | ||||||
| 				return vm.$u.post('Member/BrowseList'); | 				return vm.$u.post('Member/BrowseList'); | ||||||
| 			}, | 			}, | ||||||
| 
 | 			// 订单列表
 | ||||||
|  | 			getOrderList({ page }) { | ||||||
|  | 				return vm.$u.post('Goods/orderList', { page }); | ||||||
|  | 			}, | ||||||
|  | 			// 订单详情
 | ||||||
|  | 			getOrderInfo({ order_id }) { | ||||||
|  | 				return vm.$u.post('Goods/orderInfo', { order_id }); | ||||||
|  | 			}, | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
| } | } | ||||||
| @ -1,14 +1,17 @@ | |||||||
| <template> | <template> | ||||||
|     <view class="daren-item"> |     <view class="daren-item"> | ||||||
|         <image class="head"></image> |         <image class="head" :src="info.member_avatar"></image> | ||||||
|         <text class="name">这是名字</text> |         <text class="name">{{ info.member_nickname }}</text> | ||||||
|         <text class="zhuangtai">直播状态</text> |         <text class="zhuangtai">状态: {{ info.live_status == 1 ? '正在直播' : '未开播' }}</text> | ||||||
|         <view class="guanzhu">关注</view> |         <view class="guanzhu">关注</view> | ||||||
|     </view> |     </view> | ||||||
| </template> | </template> | ||||||
| <script> | <script> | ||||||
| export default { | export default { | ||||||
|     name:"daren-item"     | 	name:"daren-item", | ||||||
|  | 	props: { | ||||||
|  | 		info: Object, | ||||||
|  | 	} | ||||||
| } | } | ||||||
| </script> | </script> | ||||||
| <style lang="scss" scoped> | <style lang="scss" scoped> | ||||||
|  | |||||||
| @ -2,7 +2,7 @@ | |||||||
|     <view class="video-item" v-if="item"> |     <view class="video-item" v-if="item"> | ||||||
|         <image class="head" :src="item.article_pic"></image> |         <image class="head" :src="item.article_pic"></image> | ||||||
|         <view class="title" v-if="!isguanzhu">{{ item.article_title }}</view> |         <view class="title" v-if="!isguanzhu">{{ item.article_title }}</view> | ||||||
|         <view class="jianjie">这是简介这是简介这是简介</view> |         <view class="jianjie">{{ item.article_content }}</view> | ||||||
|         <view class="user"> |         <view class="user"> | ||||||
|             <view class="info"> |             <view class="info"> | ||||||
|                 <image :src="item.member_avatar"></image> |                 <image :src="item.member_avatar"></image> | ||||||
| @ -11,17 +11,17 @@ | |||||||
|             <image src="/static/image/common/4.png" @click="showAction"></image> |             <image src="/static/image/common/4.png" @click="showAction"></image> | ||||||
| 			<view class="action" v-if="show == item.article_id"> | 			<view class="action" v-if="show == item.article_id"> | ||||||
| 				<view class="bubble"> | 				<view class="bubble"> | ||||||
| 					<view> | 					<view @click="articleLike"> | ||||||
| 						<image src="/static/image/common/5.png" v-if="item.is_like == 0"></image> | 						<image src="/static/image/common/5.png" v-if="item.is_like == 0"></image> | ||||||
| 						<image src="/static/image/common/8.png" v-else></image> | 						<image src="/static/image/common/8.png" v-else></image> | ||||||
| 						<text>点赞</text> | 						<text>点赞</text> | ||||||
| 					</view> | 					</view> | ||||||
| 					<view> | 					<view @click="articleCollect"> | ||||||
| 						<image src="/static/image/common/6.png" v-if="item.is_collect == 0"></image> | 						<image src="/static/image/common/6.png" v-if="item.is_collect == 0"></image> | ||||||
| 						<image src="/static/image/common/9.png" v-else></image> | 						<image src="/static/image/common/9.png" v-else></image> | ||||||
| 						<text>收藏</text> | 						<text>收藏</text> | ||||||
| 					</view> | 					</view> | ||||||
| 					<view> | 					<view @click="articleAddShield"> | ||||||
| 						<image src="/static/image/common/7.png"></image> | 						<image src="/static/image/common/7.png"></image> | ||||||
| 						<text>屏蔽用户</text> | 						<text>屏蔽用户</text> | ||||||
| 					</view> | 					</view> | ||||||
| @ -70,7 +70,6 @@ | |||||||
|         display:-webkit-box;  |         display:-webkit-box;  | ||||||
|         -webkit-box-orient:vertical; |         -webkit-box-orient:vertical; | ||||||
|         -webkit-line-clamp:2;  |         -webkit-line-clamp:2;  | ||||||
| 
 |  | ||||||
|     } |     } | ||||||
|     .user{ |     .user{ | ||||||
|         display: flex; |         display: flex; | ||||||
| @ -182,7 +181,35 @@ export default { | |||||||
| 	methods: { | 	methods: { | ||||||
| 		showAction() { | 		showAction() { | ||||||
| 			this.show = this.show > 0 ? -1 : this.item.article_id; | 			this.show = this.show > 0 ? -1 : this.item.article_id; | ||||||
|  | 		}, | ||||||
|  | 		articleLike() { | ||||||
|  | 			this.$u.api.articleLike({ | ||||||
|  | 				article_id: this.item.article_id, | ||||||
|  | 			}).then(res => { | ||||||
|  | 				if(res.errCode == 0) { | ||||||
|  | 					this.$emit("getArticlelist"); | ||||||
| 				} | 				} | ||||||
|  | 			}) | ||||||
|  | 		}, | ||||||
|  | 		articleCollect() { | ||||||
|  | 			this.$u.api.articleCollect({ | ||||||
|  | 				article_id: this.item.article_id, | ||||||
|  | 			}).then(res => { | ||||||
|  | 				if(res.errCode == 0) { | ||||||
|  | 					this.$emit("getArticlelist"); | ||||||
|  | 				} | ||||||
|  | 			}) | ||||||
|  | 		}, | ||||||
|  | 		articleAddShield() { | ||||||
|  | 			this.$u.api.articleAddShield({ | ||||||
|  | 				article_id: this.item.article_id, | ||||||
|  | 				member_id: this.item.member_id, | ||||||
|  | 			}).then(res => { | ||||||
|  | 				if(res.errCode == 0) { | ||||||
|  | 					this.$emit("getArticlelist"); | ||||||
|  | 				} | ||||||
|  | 			}) | ||||||
|  | 		}, | ||||||
| 	}, | 	}, | ||||||
| } | } | ||||||
| </script> | </script> | ||||||
| @ -121,7 +121,12 @@ export default { | |||||||
| 					this.$refs.uToast.show({ | 					this.$refs.uToast.show({ | ||||||
| 						title: res.message, | 						title: res.message, | ||||||
| 						type: 'success', | 						type: 'success', | ||||||
|  | 						// url: '/pageE/more/Address', | ||||||
|  | 						callback() { | ||||||
|  | 							uni.redirectTo({ | ||||||
| 								url: '/pageE/more/Address' | 								url: '/pageE/more/Address' | ||||||
|  | 							}); | ||||||
|  | 						} | ||||||
| 					}) | 					}) | ||||||
| 				} else { | 				} else { | ||||||
| 					this.showToast(res.message, 'warning'); | 					this.showToast(res.message, 'warning'); | ||||||
| @ -146,7 +151,12 @@ export default { | |||||||
| 					this.$refs.uToast.show({ | 					this.$refs.uToast.show({ | ||||||
| 						title: res.message, | 						title: res.message, | ||||||
| 						type: 'success', | 						type: 'success', | ||||||
|  | 						// url: '/pageE/more/Address', | ||||||
|  | 						callback() { | ||||||
|  | 							uni.redirectTo({ | ||||||
| 								url: '/pageE/more/Address' | 								url: '/pageE/more/Address' | ||||||
|  | 							}); | ||||||
|  | 						} | ||||||
| 					}) | 					}) | ||||||
| 				} else { | 				} else { | ||||||
| 					this.showToast(res.message, 'warning'); | 					this.showToast(res.message, 'warning'); | ||||||
|  | |||||||
| @ -54,6 +54,7 @@ export default { | |||||||
| 	methods: { | 	methods: { | ||||||
| 		editAddress() { | 		editAddress() { | ||||||
| 			this.$u.route({ | 			this.$u.route({ | ||||||
|  | 				type: 'redirect', | ||||||
| 				url: '/pageE/more/EditAddress', | 				url: '/pageE/more/EditAddress', | ||||||
| 				params: { | 				params: { | ||||||
| 					item: JSON.stringify(this.item) | 					item: JSON.stringify(this.item) | ||||||
| @ -69,7 +70,7 @@ export default { | |||||||
| 					this.showToast(res.message, 'success'); | 					this.showToast(res.message, 'success'); | ||||||
| 					this.$emit('getAddressList'); | 					this.$emit('getAddressList'); | ||||||
| 				} else { | 				} else { | ||||||
| 					this.showToast(res.message, 'warning'); | 					this.showToast(res.message, 'error'); | ||||||
| 				} | 				} | ||||||
| 			}) | 			}) | ||||||
| 		}, | 		}, | ||||||
|  | |||||||
| @ -1,12 +1,15 @@ | |||||||
| <template> | <template> | ||||||
|     <view class="shop-item"> |     <view class="shop-item"> | ||||||
|         <image></image> |         <image :src="info.goodscn_pic"></image> | ||||||
|         <text>1</text> |         <text class="u-line-1">{{ info.gc_name }}</text> | ||||||
|     </view>     |     </view>     | ||||||
| </template> | </template> | ||||||
| <script> | <script> | ||||||
| export default { | export default { | ||||||
| 	name:"shopItem", | 	name:"shopItem", | ||||||
|  | 	props: { | ||||||
|  | 		info: Object, | ||||||
|  | 	} | ||||||
| } | } | ||||||
| </script> | </script> | ||||||
| <style lang="scss" scoped> | <style lang="scss" scoped> | ||||||
| @ -18,9 +21,9 @@ export default { | |||||||
|         width: 80rpx; |         width: 80rpx; | ||||||
|         height: 80rpx; |         height: 80rpx; | ||||||
|         border-radius: 50%; |         border-radius: 50%; | ||||||
| 
 |  | ||||||
|     } |     } | ||||||
|     >text{ |     >text{ | ||||||
|  | 		width: 80rpx; | ||||||
|         font-size: 24rpx; |         font-size: 24rpx; | ||||||
|         color: #333; |         color: #333; | ||||||
|         margin-top: 14rpx; |         margin-top: 14rpx; | ||||||
|  | |||||||
| @ -115,6 +115,11 @@ | |||||||
| 			}, | 			}, | ||||||
| 			// 用户登录 | 			// 用户登录 | ||||||
| 			loginOn() { | 			loginOn() { | ||||||
|  | 				// 测试用的 | ||||||
|  | 				uni.switchTab({ | ||||||
|  | 					url: '/pages/index/index' | ||||||
|  | 				}) | ||||||
|  | 				return false; | ||||||
| 				console.log("登录") | 				console.log("登录") | ||||||
| 				// console.log(this.member_mobile) | 				// console.log(this.member_mobile) | ||||||
| 				// console.log(this.sms_code) | 				// console.log(this.sms_code) | ||||||
| @ -180,7 +185,6 @@ | |||||||
| 							type: 'error' | 							type: 'error' | ||||||
| 						}) | 						}) | ||||||
| 					} | 					} | ||||||
| 
 |  | ||||||
| 				}) | 				}) | ||||||
| 			}, | 			}, | ||||||
| 			// qq授权登录 | 			// qq授权登录 | ||||||
|  | |||||||
| @ -12,9 +12,9 @@ | |||||||
|         </view> |         </view> | ||||||
|         <view class="hr"></view> |         <view class="hr"></view> | ||||||
| 		<!-- <navs :value="领券"></navs> --> | 		<!-- <navs :value="领券"></navs> --> | ||||||
|         <navs :value="产品规格"></navs> |         <navs :value="'产品规格'"></navs> | ||||||
| 		<navs :value="产品颜色"></navs> | 		<navs :value="'产品颜色'"></navs> | ||||||
| 		<navs :value="选择尺码"></navs> | 		<navs :value="'选择尺码'"></navs> | ||||||
|         <view class="xiangqing"> |         <view class="xiangqing"> | ||||||
|             <view class="heng"></view> |             <view class="heng"></view> | ||||||
|             <view class="title">商品详情</view> |             <view class="title">商品详情</view> | ||||||
| @ -46,7 +46,7 @@ export default { | |||||||
| 	}, | 	}, | ||||||
| 	methods: { | 	methods: { | ||||||
| 		getGoodsDetails(id) { | 		getGoodsDetails(id) { | ||||||
| 			this.$u.api.getGoodsDetails({ id: 169 }).then((res)=>{ | 			this.$u.api.getGoodsDetails({ id: id }).then((res)=>{ | ||||||
| 				if (res.errCode == 0) { | 				if (res.errCode == 0) { | ||||||
| 					this.goodsInfo = res.data; | 					this.goodsInfo = res.data; | ||||||
| 					this.goodsInfo.goods_image_mobile.forEach(item => { | 					this.goodsInfo.goods_image_mobile.forEach(item => { | ||||||
|  | |||||||
| @ -12,20 +12,21 @@ | |||||||
| 			<image src="../static/image/1.png" class="right"></image> | 			<image src="../static/image/1.png" class="right"></image> | ||||||
| 		</view> | 		</view> | ||||||
| 		<view class="main"> | 		<view class="main"> | ||||||
|  | 			<view v-for="(item, index) in orderInfo.store_cart_list" :key="index"> | ||||||
| 				<view class="goods-info"> | 				<view class="goods-info"> | ||||||
| 					<view class="store"> | 					<view class="store"> | ||||||
| 					<image class="avatar"></image> | 						<image class="avatar" :src="item[0].store_avatar"></image> | ||||||
| 					<view>胖胖的店</view> | 						<view>{{ item[0].store_name }}</view> | ||||||
| 						<image src="../static/image/1.png" class="right"></image> | 						<image src="../static/image/1.png" class="right"></image> | ||||||
| 					</view> | 					</view> | ||||||
| 					<view class="goods"> | 					<view class="goods"> | ||||||
| 					<view v-for="(goods, g_index) in 1" :key="g_index" class="goods-item"> | 						<view v-for="(goods, g_index) in item" :key="g_index" class="goods-item"> | ||||||
| 						<image></image> | 							<image :src="goods.goods_image_url"></image> | ||||||
| 							<view class="info"> | 							<view class="info"> | ||||||
| 							<view class="name u-line-2">木糖少女小紫薯西装领连衣裙夏季新款女装夏收腰格子格纹裙子</view> | 								<view class="name u-line-2">{{ goods.goods_name }}</view> | ||||||
| 								<view class="cart-info"> | 								<view class="cart-info"> | ||||||
| 								<view class="price">¥99</view> | 									<view class="price">¥{{ goods.goods_price }}</view> | ||||||
| 								<u-number-box :input-width="38" :input-height="39" :size="22" bg-color="#FFFFFF" color="#FF780F" :index="g_index"></u-number-box> | 									<u-number-box :input-width="38" :input-height="39" :size="22" bg-color="#FFFFFF" color="#FF780F" :index="g_index" v-model="goods.goods_num"></u-number-box> | ||||||
| 								</view> | 								</view> | ||||||
| 							</view> | 							</view> | ||||||
| 						</view> | 						</view> | ||||||
| @ -55,10 +56,11 @@ | |||||||
| 					</view> | 					</view> | ||||||
| 				</view> | 				</view> | ||||||
| 			</view> | 			</view> | ||||||
|  | 		</view> | ||||||
| 		<view class="bottom"> | 		<view class="bottom"> | ||||||
| 			<view class="left"> | 			<view class="left"> | ||||||
| 				<view class="title">合计:</view> | 				<view class="title">合计:</view> | ||||||
| 				<view class="price">¥9.80</view> | 				<view class="price">¥{{ orderInfo.store_goods_total | showTotalPrice }}</view> | ||||||
| 			</view> | 			</view> | ||||||
| 			<view class="right"> | 			<view class="right"> | ||||||
| 				<view class="num">共1件商品</view> | 				<view class="num">共1件商品</view> | ||||||
| @ -70,9 +72,57 @@ | |||||||
| <script> | <script> | ||||||
| export default { | export default { | ||||||
| 	data() { | 	data() { | ||||||
| 		return {} | 		return { | ||||||
|  | 			orderInfo: {}, | ||||||
|  | 			totalPrice: '0.00', | ||||||
|  | 		} | ||||||
|  | 	}, | ||||||
|  | 	filters: { | ||||||
|  | 		showTotalPrice(object) { | ||||||
|  | 			let price = 0; | ||||||
|  | 			for (const key in object) { | ||||||
|  | 				if (object.hasOwnProperty(key)) { | ||||||
|  | 					const element = object[key]; | ||||||
|  | 					price += Number(element); | ||||||
|  | 				} | ||||||
|  | 			} | ||||||
|  | 			return price.toFixed(2); | ||||||
|  | 		} | ||||||
|  | 	}, | ||||||
|  | 	onLoad(option) { | ||||||
|  | 		console.log(JSON.parse(option.info)); | ||||||
|  | 		this.orderInfo = JSON.parse(option.info); | ||||||
|  | 		// this.orderListInit(); | ||||||
|  | 		this.showTotalPrice(); | ||||||
| 	}, | 	}, | ||||||
| 	methods: { | 	methods: { | ||||||
|  | 		// orderListInit() { | ||||||
|  | 		// 	this.orderList = this.orderInfo.store_list; | ||||||
|  | 		// 	for (const key in this.orderList) { | ||||||
|  | 		// 		if (this.orderList.hasOwnProperty(key)) { | ||||||
|  | 		// 			const element = this.orderList[key]; | ||||||
|  | 		// 			let tempArray = Object.entries(this.orderInfo.store_cart_list); | ||||||
|  | 		// 			tempArray.forEach(item => { | ||||||
|  | 		// 				if (item[0]) | ||||||
|  | 		// 			}) | ||||||
|  | 		// 			let temp = this.orderInfo.store_cart_list.filters(store => { | ||||||
|  | 		// 				return store.store_id == item.store_id | ||||||
|  | 		// 			}) | ||||||
|  | 		// 			element | ||||||
|  | 		// 		} | ||||||
|  | 		// 	} | ||||||
|  | 		// 	this.orderList.forEach(item => { | ||||||
|  | 		// 		let temp = this.orderInfo.store_cart_list.filters(store => { | ||||||
|  | 		// 			return store.store_id == item.store_id | ||||||
|  | 		// 		}) | ||||||
|  | 		// 		Object.assign(item, { goods_list: temp }); | ||||||
|  | 		// 	}) | ||||||
|  | 		// 	console.log(this.orderList); | ||||||
|  | 			 | ||||||
|  | 		// }, | ||||||
|  | 		showTotalPrice() { | ||||||
|  | 			 | ||||||
|  | 		}, | ||||||
| 		settlement() { | 		settlement() { | ||||||
| 			uni.navigateTo({ | 			uni.navigateTo({ | ||||||
| 				url: '/pageE/order/Details' | 				url: '/pageE/order/Details' | ||||||
| @ -127,6 +177,7 @@ export default { | |||||||
| 		} | 		} | ||||||
| 	} | 	} | ||||||
| 	.main { | 	.main { | ||||||
|  | 		> view { | ||||||
| 			.goods-info { | 			.goods-info { | ||||||
| 				background-color: #ffffff; | 				background-color: #ffffff; | ||||||
| 				padding: 30rpx; | 				padding: 30rpx; | ||||||
| @ -232,6 +283,7 @@ export default { | |||||||
| 				} | 				} | ||||||
| 			} | 			} | ||||||
| 		} | 		} | ||||||
|  | 	} | ||||||
| 	.bottom { | 	.bottom { | ||||||
| 		padding: 35rpx 30rpx; | 		padding: 35rpx 30rpx; | ||||||
| 		position: fixed; | 		position: fixed; | ||||||
|  | |||||||
| @ -18,7 +18,7 @@ | |||||||
| 								<view class="name u-line-2">{{ goods.goods_name }}</view> | 								<view class="name u-line-2">{{ goods.goods_name }}</view> | ||||||
| 								<view class="cart-info"> | 								<view class="cart-info"> | ||||||
| 									<view class="price">¥{{ goods.goods_price }}</view> | 									<view class="price">¥{{ goods.goods_price }}</view> | ||||||
| 									<u-number-box :input-width="38" :input-height="39" :size="22" bg-color="#FFFFFF" color="#FF780F" :index="g_index" @minus="reduce($event, s_index)" @plus="plus($event, s_index)" v-model="goods.goods_num"></u-number-box> | 									<u-number-box :input-width="38" :input-height="39" :size="22" bg-color="#FFFFFF" :disabled-input=true color="#FF780F" :index="goods.cart_id" @minus="reduce" @plus="plus" v-model="goods.goods_num"></u-number-box> | ||||||
| 								</view> | 								</view> | ||||||
| 							</view> | 							</view> | ||||||
| 						</view> | 						</view> | ||||||
| @ -36,7 +36,7 @@ | |||||||
| 				<view class="title">合计:</view> | 				<view class="title">合计:</view> | ||||||
| 				<view class="value">¥{{ totalPrice }}</view> | 				<view class="value">¥{{ totalPrice }}</view> | ||||||
| 			</view> | 			</view> | ||||||
| 			<view class="cart-btn" v-if="status == '编辑'" @click="settlement">结算</view> | 			<view class="cart-btn" v-if="status == '编辑'" @click="settlementOrder">结算</view> | ||||||
| 			<view class="delete-btn" v-if="status == '完成'" @click="deleteGoods">删除</view> | 			<view class="delete-btn" v-if="status == '完成'" @click="deleteGoods">删除</view> | ||||||
| 			<u-toast ref="uToast" /> | 			<u-toast ref="uToast" /> | ||||||
| 		</view> | 		</view> | ||||||
| @ -63,8 +63,9 @@ export default { | |||||||
| 					}) | 					}) | ||||||
| 					checkedGoods = checkedGoods.concat(temp); | 					checkedGoods = checkedGoods.concat(temp); | ||||||
| 				}) | 				}) | ||||||
| 				console.log(checkedGoods); | 				// console.log(checkedGoods); | ||||||
| 				this.checkedGoods = checkedGoods; | 				this.checkedGoods = checkedGoods; | ||||||
|  | 				this.calculatePrice(); | ||||||
| 			}, | 			}, | ||||||
| 			deep: true | 			deep: true | ||||||
| 		} | 		} | ||||||
| @ -73,14 +74,45 @@ export default { | |||||||
| 		this.getCartList(); | 		this.getCartList(); | ||||||
| 	}, | 	}, | ||||||
| 	methods: { | 	methods: { | ||||||
|  | 		// 计算价格 | ||||||
|  | 		calculatePrice() { | ||||||
|  | 			// console.log(this.checkedGoods); | ||||||
|  | 			let temp = 0; | ||||||
|  | 			this.checkedGoods.forEach(item => { | ||||||
|  | 				temp += item.goods_num * (item.goods_price * 100) / 100; | ||||||
|  | 			}) | ||||||
|  | 			this.totalPrice = temp.toFixed(2); | ||||||
|  | 		}, | ||||||
|  | 		// 结算 | ||||||
|  | 		settlementOrder() { | ||||||
|  | 			let id = [], temp = ''; | ||||||
|  | 			this.checkedGoods.forEach(item => { | ||||||
|  | 				temp = item.cart_id + '|' + item.goods_num; | ||||||
|  | 				id.push(temp); | ||||||
|  | 				temp = ''; | ||||||
|  | 			}) | ||||||
|  | 			// console.log(id); | ||||||
|  | 			 | ||||||
|  | 			this.$u.api.settlementOrder({ cart_id: id }).then(res => { | ||||||
|  | 				if(res.errCode == 0) { | ||||||
|  | 					this.$u.route({ | ||||||
|  | 						url: '/pageC/cart/ConfirmOrder', | ||||||
|  | 						params: { | ||||||
|  | 							info: JSON.stringify(res.data), | ||||||
|  | 						} | ||||||
|  | 					}) | ||||||
|  | 				} | ||||||
|  | 			}) | ||||||
|  | 		}, | ||||||
| 		getCartList() { | 		getCartList() { | ||||||
| 			this.$u.api.getCartTreeList().then((res)=>{ | 			this.$u.api.getCartTreeList().then(res => { | ||||||
| 				if (res.errCode == 0) { | 				if (res.errCode == 0) { | ||||||
| 					let list = res.data.store_cart_list; | 					let list = res.data.store_cart_list; | ||||||
| 					list.forEach(item => { | 					list.forEach((item, l_index) => { | ||||||
| 						Object.assign(item, { checked: false }); | 						// 判断有无 checked 属性,如果有取值再赋值, 没有给默认值 false | ||||||
| 						item.goods.forEach(goods => { | 						Object.assign(item, { checked: this.list.length ? this.list[l_index].checked : false }); | ||||||
| 							Object.assign(goods, { checked: false }); | 						item.goods.forEach((goods, g_index) => { | ||||||
|  | 							Object.assign(goods, { checked: this.list.length ? this.list[l_index].goods[g_index].checked : false }); | ||||||
| 						}) | 						}) | ||||||
| 					}) | 					}) | ||||||
| 					// console.log(list); | 					// console.log(list); | ||||||
| @ -95,7 +127,6 @@ export default { | |||||||
| 				id.push(item.cart_id); | 				id.push(item.cart_id); | ||||||
| 			}) | 			}) | ||||||
| 			// console.log(id); | 			// console.log(id); | ||||||
| 			 |  | ||||||
| 			this.$u.api.deleteCart({ id }).then(res => { | 			this.$u.api.deleteCart({ id }).then(res => { | ||||||
| 				if (res.errCode == 0) { | 				if (res.errCode == 0) { | ||||||
| 					if(!res.data.msg) { | 					if(!res.data.msg) { | ||||||
| @ -109,16 +140,23 @@ export default { | |||||||
| 				} | 				} | ||||||
| 			}) | 			}) | ||||||
| 		}, | 		}, | ||||||
| 		reduce(value, store) { | 		reduce(e) { | ||||||
| 			console.log(value, store) | 			this.cartUpdateNumber(e.index, e.value); | ||||||
| 		}, | 		}, | ||||||
| 		plus(value, store) { | 		plus(e) { | ||||||
| 			console.log(value, store) | 			this.cartUpdateNumber(e.index, e.value); | ||||||
| 		}, | 		}, | ||||||
| 		settlement() { | 		async cartUpdateNumber(id, number) { | ||||||
| 			uni.navigateTo({ | 			try { | ||||||
| 				url: './ConfirmOrder' | 				await this.$u.api.cartUpdateNumber({ | ||||||
| 			}); | 					cart_id: id, | ||||||
|  | 					quantity: number, | ||||||
|  | 				}).then(res => { | ||||||
|  | 					this.getCartList(); | ||||||
|  | 				}) | ||||||
|  | 			} catch (error) { | ||||||
|  | 				this.getCartList(); | ||||||
|  | 			} | ||||||
| 		}, | 		}, | ||||||
| 		totalChange(e) { | 		totalChange(e) { | ||||||
| 			// 切换所有商品的状态 | 			// 切换所有商品的状态 | ||||||
| @ -171,7 +209,6 @@ export default { | |||||||
| 			// #ifdef APP-PLUS | 			// #ifdef APP-PLUS | ||||||
| 			let currentWebview = page.$getAppWebview(); | 			let currentWebview = page.$getAppWebview(); | ||||||
| 			let titleObj = currentWebview.getStyle().titleNView; | 			let titleObj = currentWebview.getStyle().titleNView; | ||||||
| 			console.log(1); |  | ||||||
| 			console.log(JSON.stringify(titleObj.buttons[0])); | 			console.log(JSON.stringify(titleObj.buttons[0])); | ||||||
| 			if (!titleObj.buttons) { | 			if (!titleObj.buttons) { | ||||||
| 				return; | 				return; | ||||||
|  | |||||||
| @ -5,19 +5,19 @@ | |||||||
| 			 :scroll-into-view="itemId"> | 			 :scroll-into-view="itemId"> | ||||||
| 				<view v-for="(item,index) in tabbar" :key="index" class="u-tab-item" :class="[current == index ? 'u-tab-item-active' : '']" | 				<view v-for="(item,index) in tabbar" :key="index" class="u-tab-item" :class="[current == index ? 'u-tab-item-active' : '']" | ||||||
| 				 @tap.stop="swichMenu(index)"> | 				 @tap.stop="swichMenu(index)"> | ||||||
| 					<text class="u-line-1">{{item.name}}</text> | 					<text class="u-line-1">{{item.gc_name}}</text> | ||||||
| 				</view> | 				</view> | ||||||
| 			</scroll-view> | 			</scroll-view> | ||||||
| 			<scroll-view :scroll-top="scrollRightTop" scroll-y scroll-with-animation class="right-box" @scroll="rightScroll"> | 			<scroll-view :scroll-top="scrollRightTop" scroll-y scroll-with-animation class="right-box" @scroll="rightScroll"> | ||||||
| 				<view class="page-view"> | 				<view class="page-view"> | ||||||
| 					<view class="class-item" :id="'item' + index" v-for="(item, index) in tabbar" :key="index"> | 					<view class="class-item" :id="'item' + index" v-for="(item, index) in tabbar" :key="index"> | ||||||
| 						<view class="item-title"> | 						<view class="item-title"> | ||||||
| 							<text>{{item.name}}</text> | 							<text>{{item.gc_name}}</text> | ||||||
| 						</view> | 						</view> | ||||||
| 						<view class="item-container"> | 						<view class="item-container"> | ||||||
| 							<view class="thumb-box" v-for="(item1, index1) in item.foods" :key="index1"> | 							<view class="thumb-box" v-for="(item1, index1) in item._child" :key="index1"> | ||||||
| 								<image class="item-menu-image" :src="item1.icon" mode=""></image> | 								<image class="item-menu-image" :src="item1.img" mode=""></image> | ||||||
| 								<view class="item-menu-name">{{item1.name}}</view> | 								<view class="item-menu-name">{{item1.gc_name}}</view> | ||||||
| 							</view> | 							</view> | ||||||
| 						</view> | 						</view> | ||||||
| 					</view> | 					</view> | ||||||
| @ -27,7 +27,6 @@ | |||||||
| 	</view> | 	</view> | ||||||
| </template> | </template> | ||||||
| <script> | <script> | ||||||
| 	import classifyData from '@/static/js/classify.data.js'; |  | ||||||
| 	export default { | 	export default { | ||||||
| 		data() { | 		data() { | ||||||
| 			return { | 			return { | ||||||
| @ -37,21 +36,28 @@ | |||||||
| 				menuHeight: 0, // 左边菜单的高度 | 				menuHeight: 0, // 左边菜单的高度 | ||||||
| 				menuItemHeight: 0, // 左边菜单item的高度 | 				menuItemHeight: 0, // 左边菜单item的高度 | ||||||
| 				itemId: '', // 栏目右边scroll-view用于滚动的id | 				itemId: '', // 栏目右边scroll-view用于滚动的id | ||||||
| 				tabbar: classifyData, | 				tabbar: [], | ||||||
| 				menuItemPos: [], | 				menuItemPos: [], | ||||||
| 				arr: [], | 				arr: [], | ||||||
| 				scrollRightTop: 0, // 右边栏目scroll-view的滚动条高度 | 				scrollRightTop: 0, // 右边栏目scroll-view的滚动条高度 | ||||||
| 				timer: null, // 定时器 | 				timer: null, // 定时器 | ||||||
| 				 |  | ||||||
| 			} | 			} | ||||||
| 		}, | 		}, | ||||||
| 		onLoad() { | 		onShow() { | ||||||
| 			 | 			this.getClassifyList(); | ||||||
| 		}, | 		}, | ||||||
| 		onReady() { | 		onReady() { | ||||||
| 			this.getMenuItemTop() | 			this.getMenuItemTop() | ||||||
| 		}, | 		}, | ||||||
| 		methods: { | 		methods: { | ||||||
|  | 			// 获取分类列表 | ||||||
|  | 			getClassifyList() { | ||||||
|  | 				this.$u.api.getGoodsClassifyList().then(res => { | ||||||
|  | 					if(res.errCode == 0) { | ||||||
|  | 						this.tabbar = res.data; | ||||||
|  | 					} | ||||||
|  | 				}) | ||||||
|  | 			}, | ||||||
| 			// 点击左边的栏目切换 | 			// 点击左边的栏目切换 | ||||||
| 			async swichMenu(index) { | 			async swichMenu(index) { | ||||||
| 				if(this.arr.length == 0) { | 				if(this.arr.length == 0) { | ||||||
| @ -205,6 +211,7 @@ | |||||||
| 		justify-content: center; | 		justify-content: center; | ||||||
| 		font-size: 28rpx; | 		font-size: 28rpx; | ||||||
| 		color: #666666; | 		color: #666666; | ||||||
|  | 		padding: 0 30rpx; | ||||||
| 	} | 	} | ||||||
| 	.u-tab-item-active { | 	.u-tab-item-active { | ||||||
| 		position: relative; | 		position: relative; | ||||||
| @ -223,7 +230,7 @@ | |||||||
| 		height: 100%; | 		height: 100%; | ||||||
| 	} | 	} | ||||||
| 	.right-box { | 	.right-box { | ||||||
| 		background-color: rgb(250, 250, 250); | 		background-color: #fff; | ||||||
| 	} | 	} | ||||||
| 	.page-view { | 	.page-view { | ||||||
| 		padding: 16rpx; | 		padding: 16rpx; | ||||||
| @ -261,5 +268,6 @@ | |||||||
| 	.item-menu-image { | 	.item-menu-image { | ||||||
| 		width: 150rpx; | 		width: 150rpx; | ||||||
| 		height: 150rpx; | 		height: 150rpx; | ||||||
|  | 		margin-bottom: 15rpx; | ||||||
| 	} | 	} | ||||||
| </style> | </style> | ||||||
| @ -12,7 +12,7 @@ | |||||||
| 			</view> | 			</view> | ||||||
| 			<view class="info-item"> | 			<view class="info-item"> | ||||||
| 				<view class="title">性别</view> | 				<view class="title">性别</view> | ||||||
| 				<view class="value" @click="selectGender=true">{{ gender }}</view> | 				<view class="value" @click="selectGender=true">{{ gender == '1' ? '男' : '女' }}</view> | ||||||
| 			</view> | 			</view> | ||||||
| 			<u-select v-model="selectGender" mode="single-column" :list="list" @confirm="setGender"></u-select> | 			<u-select v-model="selectGender" mode="single-column" :list="list" @confirm="setGender"></u-select> | ||||||
| 			<view class="info-item"> | 			<view class="info-item"> | ||||||
| @ -55,9 +55,10 @@ export default { | |||||||
| 				second: false | 				second: false | ||||||
| 			}, | 			}, | ||||||
| 			nickname: '胖胖', | 			nickname: '胖胖', | ||||||
| 			gender: '', | 			gender: '', // 1男  2女 | ||||||
| 			birthday: '', | 			birthday: '', | ||||||
| 			phoneNumber: '', | 			phoneNumber: '', | ||||||
|  | 			avatar: '', | ||||||
| 		} | 		} | ||||||
| 	}, | 	}, | ||||||
| 	onLoad() { | 	onLoad() { | ||||||
| @ -78,20 +79,21 @@ export default { | |||||||
| 				} | 				} | ||||||
| 			}) | 			}) | ||||||
| 		}, | 		}, | ||||||
| 		updateMemberInfo({ avatar = '' }) { | 		updateMemberInfo() { | ||||||
| 			this.$u.api.updateMemberInfo({ | 			this.$u.api.updateMemberInfo({ | ||||||
| 				nickname: this.nickname, | 				nickname: this.nickname, | ||||||
| 				sex: this.gender, | 				gender: this.gender, | ||||||
| 				avatar: avatar, | 				avatar: this.avatar, | ||||||
| 				birthday: this.birthday, | 				birthday: this.birthday, | ||||||
| 			}).then(res => { | 			}).then(res => { | ||||||
| 				if (res.errCode == 0) { | 				if (res.errCode == 0) { | ||||||
|  | 					this.getUserInfo(); | ||||||
| 				} | 				} | ||||||
| 			}) | 			}) | ||||||
| 		}, | 		}, | ||||||
| 		setGender(value) { | 		setGender(value) { | ||||||
| 			console.log(value); | 			// console.log(value); | ||||||
| 			this.gender = value[0].label; | 			this.gender = value[0].value; | ||||||
| 		}, | 		}, | ||||||
| 		setBirthday(value) { | 		setBirthday(value) { | ||||||
| 			// console.log(value); | 			// console.log(value); | ||||||
|  | |||||||
| @ -22,7 +22,7 @@ export default { | |||||||
| 	components: { | 	components: { | ||||||
| 		AddressItem | 		AddressItem | ||||||
| 	}, | 	}, | ||||||
| 	onLoad() { | 	onShow() { | ||||||
| 		this.getAddressList(); | 		this.getAddressList(); | ||||||
| 	}, | 	}, | ||||||
| 	methods: { | 	methods: { | ||||||
|  | |||||||
| @ -78,7 +78,8 @@ | |||||||
| export default { | export default { | ||||||
| 	data() { | 	data() { | ||||||
| 		return { | 		return { | ||||||
| 			current: 0 | 			current: 0, | ||||||
|  | 			orderInfo: {} | ||||||
| 		} | 		} | ||||||
| 	}, | 	}, | ||||||
| 	onLoad(option) { | 	onLoad(option) { | ||||||
| @ -87,6 +88,15 @@ export default { | |||||||
| 		this.setTitle(); | 		this.setTitle(); | ||||||
| 	}, | 	}, | ||||||
| 	methods: { | 	methods: { | ||||||
|  | 		getOrderInfo(id) { | ||||||
|  | 			this.$u.api.getOrderInfo({ | ||||||
|  | 				order_id: id, | ||||||
|  | 			}).then(res => { | ||||||
|  | 				if(res.errCode == 0) { | ||||||
|  | 					this.orderInfo = res.data; | ||||||
|  | 				} | ||||||
|  | 			}) | ||||||
|  | 		}, | ||||||
| 		setTitle(){ | 		setTitle(){ | ||||||
| 			let title = '' | 			let title = '' | ||||||
| 			switch (this.current) { | 			switch (this.current) { | ||||||
|  | |||||||
| @ -112,8 +112,18 @@ export default { | |||||||
| 			this.current = Number(option.current); | 			this.current = Number(option.current); | ||||||
| 			this.swiperCurrent = this.current; | 			this.swiperCurrent = this.current; | ||||||
| 		} | 		} | ||||||
|  | 		this.getOrderList(); | ||||||
| 	}, | 	}, | ||||||
| 	methods: { | 	methods: { | ||||||
|  | 		getOrderList() { | ||||||
|  | 			this.$u.api.getOrderList({ | ||||||
|  | 				page: this.page, | ||||||
|  | 			}).then(res => { | ||||||
|  | 				if(res.errCode == 0) { | ||||||
|  | 
 | ||||||
|  | 				} | ||||||
|  | 			}) | ||||||
|  | 		}, | ||||||
| 		reachBottom() { | 		reachBottom() { | ||||||
| 			// console.log(this.page); | 			// console.log(this.page); | ||||||
| 			if(this.page >= 3) return; | 			if(this.page >= 3) return; | ||||||
|  | |||||||
| @ -155,12 +155,6 @@ | |||||||
| 										"text":"搜索", | 										"text":"搜索", | ||||||
| 										"float":"right", | 										"float":"right", | ||||||
| 										"fontSize":"16" | 										"fontSize":"16" | ||||||
| 									}, |  | ||||||
| 									{   |  | ||||||
| 										"type":"none", |  | ||||||
| 										"text":"\ue582", |  | ||||||
| 										"float":"left", |  | ||||||
| 										"fontSize":"16" |  | ||||||
| 									} | 									} | ||||||
| 								], | 								], | ||||||
| 								"searchInput": { | 								"searchInput": { | ||||||
| @ -316,9 +310,6 @@ | |||||||
| 						} | 						} | ||||||
| 					} | 					} | ||||||
| 				} | 				} | ||||||
| 				 |  | ||||||
| 				 |  | ||||||
| 				 |  | ||||||
| 			] | 			] | ||||||
| 		}, | 		}, | ||||||
| 		{ | 		{ | ||||||
|  | |||||||
| @ -23,10 +23,10 @@ | |||||||
|                         <indexad style="width:690rpx"></indexad> |                         <indexad style="width:690rpx"></indexad> | ||||||
|                         <view class="list"> |                         <view class="list"> | ||||||
|                             <view > |                             <view > | ||||||
|                                 <videoItem v-for="item in articleList.filter((_, index) => !(index&1))" :key="item.article_id" :item="item"></videoItem> |                                 <videoItem v-for="item in articleList.filter((_, index) => !(index&1))" :key="item.article_id" :item="item" @getArticlelist="getArticlelist"></videoItem> | ||||||
|                             </view> |                             </view> | ||||||
|                             <view style="margin-left:20rpx"> |                             <view style="margin-left:20rpx"> | ||||||
|                                 <videoItem v-for="item in articleList.filter((_, index) => index&1)" :key="item.article_id" :item="item"></videoItem> |                                 <videoItem v-for="item in articleList.filter((_, index) => index&1)" :key="item.article_id" :item="item" @getArticlelist="getArticlelist"></videoItem> | ||||||
|                             </view> |                             </view> | ||||||
|                         </view> |                         </view> | ||||||
|                     </view> |                     </view> | ||||||
| @ -60,18 +60,19 @@ | |||||||
|                                 <image class="right"></image> |                                 <image class="right"></image> | ||||||
|                             </view> |                             </view> | ||||||
|                             <view class="tuijianlist"> |                             <view class="tuijianlist"> | ||||||
|                                 <darenItem style="margin-right:23rpx"></darenItem> |                                 <!-- <darenItem style="margin-right:23rpx"></darenItem> | ||||||
|                                 <darenItem style="margin-right:23rpx"></darenItem> |                                 <darenItem style="margin-right:23rpx"></darenItem> --> | ||||||
|                                 <darenItem></darenItem> |                                 <darenItem v-for="item in recommendList" :key="item.id" :info="item"></darenItem> | ||||||
| 
 |  | ||||||
|                             </view> |                             </view> | ||||||
|                         </view> |                         </view> | ||||||
|                         <view class="list"> |                         <view class="list"> | ||||||
|                             <view > |                             <view > | ||||||
|                                 <videoItem isguanzhu="true" v-for="item in 10"></videoItem> |                                 <!-- <videoItem isguanzhu="true" v-for="item in 10"></videoItem> --> | ||||||
|  | 								<videoItem isguanzhu="true" v-for="item in articleList.filter((_, index) => !(index&1))" :key="item.article_id" :item="item" @getArticlelist="getArticlelist"></videoItem> | ||||||
|                             </view> |                             </view> | ||||||
|                             <view style="margin-left:20rpx"> |                             <view style="margin-left:20rpx"> | ||||||
|                                 <videoItem isguanzhu="true" v-for="item in 10"></videoItem> |                                 <!-- <videoItem isguanzhu="true" v-for="item in 10"></videoItem> --> | ||||||
|  | 								<videoItem isguanzhu="true" v-for="item in articleList.filter((_, index) => index&1)" :key="item.article_id" :item="item" @getArticlelist="getArticlelist"></videoItem> | ||||||
|                             </view> |                             </view> | ||||||
|                         </view> |                         </view> | ||||||
|                     </view> |                     </view> | ||||||
| @ -154,6 +155,9 @@ | |||||||
|             height: 282rpx; |             height: 282rpx; | ||||||
|             margin-top: 30rpx; |             margin-top: 30rpx; | ||||||
|             display: flex; |             display: flex; | ||||||
|  | 			> view:not(:last-child) { | ||||||
|  | 				margin-right: 23rpx; | ||||||
|  | 			} | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
| } | } | ||||||
| @ -180,6 +184,7 @@ export default { | |||||||
| 			num:0, | 			num:0, | ||||||
| 			page: 0, // 0即第一页 | 			page: 0, // 0即第一页 | ||||||
| 			articleList: [], | 			articleList: [], | ||||||
|  | 			recommendList: [], // 推荐达人 | ||||||
|         } |         } | ||||||
|     }, |     }, | ||||||
|     components:{ |     components:{ | ||||||
| @ -188,12 +193,13 @@ export default { | |||||||
|         indexad, |         indexad, | ||||||
|         darenItem |         darenItem | ||||||
|     }, |     }, | ||||||
|     onLoad(){ |     onShow(){ | ||||||
| 	   this.getArticlelist(); | 	   this.getArticlelist(); | ||||||
|  | 	   this.getRecommendList(); | ||||||
|     }, |     }, | ||||||
|     methods:{ |     methods:{ | ||||||
|         dianji(a){ |         dianji(a){ | ||||||
|             console.log(a) |             // console.log(a) | ||||||
|             if(typeof a == "object"){ |             if(typeof a == "object"){ | ||||||
|                 this.num = a.detail.current |                 this.num = a.detail.current | ||||||
|             }else{ |             }else{ | ||||||
| @ -209,7 +215,14 @@ export default { | |||||||
| 					this.articleList = res.data.list; | 					this.articleList = res.data.list; | ||||||
| 				} | 				} | ||||||
| 			}) | 			}) | ||||||
|  | 		}, | ||||||
|  | 		getRecommendList() { | ||||||
|  | 			this.$u.api.getRecommendList().then(res => { | ||||||
|  | 				if(res.errCode == 0) { | ||||||
|  | 					this.recommendList = res.data.list; | ||||||
| 				} | 				} | ||||||
|  | 			}) | ||||||
|  | 		}, | ||||||
|     }, |     }, | ||||||
| } | } | ||||||
| </script> | </script> | ||||||
| @ -113,6 +113,10 @@ | |||||||
| 						<img src="/static/image/mine/15.png" /> | 						<img src="/static/image/mine/15.png" /> | ||||||
| 						<view>投诉意见</view> | 						<view>投诉意见</view> | ||||||
| 					</view> | 					</view> | ||||||
|  | 					<view @click="clickaa()"> | ||||||
|  | 						<img src="/static/image/mine/15.png" /> | ||||||
|  | 						<view>投诉意见11</view> | ||||||
|  | 					</view> | ||||||
| 				</view> | 				</view> | ||||||
| 			</view> | 			</view> | ||||||
| 		</view> | 		</view> | ||||||
| @ -120,6 +124,7 @@ | |||||||
| </template> | </template> | ||||||
| 
 | 
 | ||||||
| <script> | <script> | ||||||
|  | var testModule = uni.requireNativePlugin("TestModule") | ||||||
| export default { | export default { | ||||||
|     data() { |     data() { | ||||||
|         return { |         return { | ||||||
| @ -138,6 +143,9 @@ export default { | |||||||
| 		this.toOtherPage("/setting/Index"); | 		this.toOtherPage("/setting/Index"); | ||||||
| 	}, | 	}, | ||||||
|     methods: { |     methods: { | ||||||
|  | 		clickaa() { | ||||||
|  | 			testModule.gotoNativePage(); | ||||||
|  | 		}, | ||||||
| 		getUserInfo() { | 		getUserInfo() { | ||||||
| 			this.$u.api.getMemberInfo().then(res => { | 			this.$u.api.getMemberInfo().then(res => { | ||||||
| 				if (res.errCode == 0) { | 				if (res.errCode == 0) { | ||||||
|  | |||||||
| @ -7,9 +7,9 @@ | |||||||
|                 <image src="/static/image/shop/2.png"></image> |                 <image src="/static/image/shop/2.png"></image> | ||||||
|             </view> |             </view> | ||||||
|             <u-search placeholder="日照香炉生紫烟" v-model="keyword" :show-action="false" bg-color="#fff" border-color="#999999"></u-search> |             <u-search placeholder="日照香炉生紫烟" v-model="keyword" :show-action="false" bg-color="#fff" border-color="#999999"></u-search> | ||||||
|             <image src="/static/image/shop/3.png" class="mnue"></image> |             <image src="/static/image/shop/3.png" class="mnue" @click="toClassifyPage"></image> | ||||||
|         </view> |         </view> | ||||||
|         <u-swiper :list="list"></u-swiper> |         <u-swiper :list="list" mode="dot" @click="clickImage"></u-swiper> | ||||||
|         <view class="chengnuo"> |         <view class="chengnuo"> | ||||||
|             <view> |             <view> | ||||||
|                 <image src="/static/image/shop/4.png"></image> |                 <image src="/static/image/shop/4.png"></image> | ||||||
| @ -28,11 +28,11 @@ | |||||||
|                 <text>上门取件</text> |                 <text>上门取件</text> | ||||||
|             </view> |             </view> | ||||||
|         </view> |         </view> | ||||||
|         <view class="fenlei"> |         <!-- <view class="fenlei"> | ||||||
|             <shopitem v-for="item in 5" class="item"></shopitem> |             <shopitem v-for="item in 5" class="item"></shopitem> | ||||||
|         </view> |         </view> --> | ||||||
|         <view class="fenlei"> |         <view class="fenlei"> | ||||||
|             <shopitem v-for="item in 5" class="item"></shopitem> |             <shopitem v-for="item in goodsClassify" :key="item.gc_id" :info="item" class="item"></shopitem> | ||||||
|         </view> |         </view> | ||||||
|         <view class="hr" style="margin-top:80rpx"></view> |         <view class="hr" style="margin-top:80rpx"></view> | ||||||
|         <recommend></recommend> |         <recommend></recommend> | ||||||
| @ -72,7 +72,7 @@ export default { | |||||||
|     }, |     }, | ||||||
|     data(){ |     data(){ | ||||||
|         return { |         return { | ||||||
| 			area: "北京市", | 			area: "请选择", | ||||||
| 			chooseArea: false, | 			chooseArea: false, | ||||||
| 			areaParams: { | 			areaParams: { | ||||||
| 				province: true, | 				province: true, | ||||||
| @ -80,34 +80,33 @@ export default { | |||||||
| 				area: false | 				area: false | ||||||
| 			}, | 			}, | ||||||
|             keyword:"", |             keyword:"", | ||||||
|             list:[{ | 			list:[], | ||||||
| 					image: '/static/uView/swiper/swiper1.jpg', | 			goodsClassify: [], // 商品分类 | ||||||
| 					title: '蒹葭苍苍,白露为霜。所谓伊人,在水一方' |  | ||||||
| 				}, |  | ||||||
| 				{ |  | ||||||
| 					image: '/static/uView/swiper/swiper2.jpg', |  | ||||||
| 					title: '溯洄从之,道阻且长。溯游从之,宛在水中央' |  | ||||||
| 				}, |  | ||||||
| 				{ |  | ||||||
| 					image: '/static/uView/swiper/swiper3.jpg', |  | ||||||
| 					title: '蒹葭萋萋,白露未晞。所谓伊人,在水之湄' |  | ||||||
| 				} |  | ||||||
| 			], |  | ||||||
| 			classifyList: [], | 			classifyList: [], | ||||||
| 			goodsList: [] | 			goodsList: [] | ||||||
|         } |         } | ||||||
| 	}, | 	}, | ||||||
| 	onLoad() { | 	onLoad() { | ||||||
| 		// this.getShopTopList(); | 		this.getShopTopList(); | ||||||
| 		this.getGoodsRecommend(); | 		this.getGoodsRecommend(); | ||||||
| 	}, | 	}, | ||||||
| 	methods: { | 	methods: { | ||||||
| 		// getShopTopList() { | 		getShopTopList() { | ||||||
| 		// 	this.$u.api.getShopTopList().then((res)=>{ | 			this.$u.api.getShopTopList().then((res)=>{ | ||||||
| 		// 		if (res.errCode == 0) { | 				if (res.errCode == 0) { | ||||||
| 		// 		} | 					let temp = []; | ||||||
| 		// 	}) | 					res.data.banner.forEach(item => { | ||||||
| 		// }, | 						temp.push({ | ||||||
|  | 							image: item.adv_code, | ||||||
|  | 							adv_link: item.adv_link, | ||||||
|  | 							adv_id: item.adv_id, | ||||||
|  | 						}) | ||||||
|  | 					}) | ||||||
|  | 					this.list = temp; | ||||||
|  | 					this.goodsClassify = res.data.goodsclass; | ||||||
|  | 				} | ||||||
|  | 			}) | ||||||
|  | 		}, | ||||||
| 		getGoodsRecommend() { | 		getGoodsRecommend() { | ||||||
| 			this.$u.api.getGoodsRecommend({ | 			this.$u.api.getGoodsRecommend({ | ||||||
| 				page: 1, | 				page: 1, | ||||||
| @ -120,6 +119,11 @@ export default { | |||||||
| 				} | 				} | ||||||
| 			}) | 			}) | ||||||
| 		}, | 		}, | ||||||
|  | 		clickImage(index) { | ||||||
|  | 			console.log(index); | ||||||
|  | 			console.log(this.list[index]); | ||||||
|  | 			 | ||||||
|  | 		}, | ||||||
| 		setArea(e) { | 		setArea(e) { | ||||||
| 			// console.log(e); | 			// console.log(e); | ||||||
| 			this.area = e.city.label; | 			this.area = e.city.label; | ||||||
| @ -128,7 +132,12 @@ export default { | |||||||
| 			uni.navigateTo({ | 			uni.navigateTo({ | ||||||
| 				url: '/pageC/cart/index' | 				url: '/pageC/cart/index' | ||||||
| 			}); | 			}); | ||||||
| 		} | 		}, | ||||||
|  | 		toClassifyPage() { | ||||||
|  | 			uni.navigateTo({ | ||||||
|  | 				url: '/pageC/classify/index' | ||||||
|  | 			}); | ||||||
|  | 		}, | ||||||
| 	}, | 	}, | ||||||
| } | } | ||||||
| </script> | </script> | ||||||
| @ -189,8 +198,15 @@ export default { | |||||||
|     } |     } | ||||||
|     .fenlei{ |     .fenlei{ | ||||||
|         display: flex; |         display: flex; | ||||||
|         justify-content: space-between; |         // justify-content: space-between; | ||||||
|         margin-top: 30rpx; |         margin-top: 30rpx; | ||||||
|  | 		flex-wrap: wrap; | ||||||
|  | 		> view { | ||||||
|  | 			margin-bottom: 30rpx; | ||||||
|  | 			&:not(:nth-child(5n)) { | ||||||
|  | 				margin-right: 70rpx; | ||||||
|  | 			} | ||||||
|  | 		} | ||||||
|     } |     } | ||||||
|     .hr{ |     .hr{ | ||||||
|         width: 750rpx; |         width: 750rpx; | ||||||
|  | |||||||
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user