Browse Source

Merge branch 'master' of http://git.liuniu946.com/lhl/tlfb

lhl 3 years ago
parent
commit
075801610f

+ 0 - 8
api/product.js

@@ -28,14 +28,6 @@ export function goodsDetail(data, id) {
 	});
 }
 
-// 砍价列表
-export function getBargainList(data) {
-	return request({
-		url: '/api/bargain/list',
-		method: 'get',
-		data
-	});
-}
 // 加入购物车
 export function cartAdd(data) {
 	return request({

+ 9 - 0
api/user.js

@@ -126,3 +126,12 @@ export function getVip(data) {
 		data
 	});
 }
+
+//申请美容院
+export function editStore(data) {
+	return request({
+		url:'/api/store_edit',
+		method:'post',
+		data
+	})
+}

+ 10 - 5
components/datalist.vue

@@ -1,7 +1,7 @@
 <template>
 	<view class="dataList">
 		<view class="list">
-			<view class="item" v-for="d in data">
+			<view class="item" v-for="d in data" @click="navto('/pages/product/product?id=' + d.id + '&is_gold=' + 1)">
 				<view class="img">
 					<image :src="d.image" mode=""></image>
 				</view>
@@ -13,7 +13,6 @@
 				</view>
 				<view class="allprice">
 					<text class="price">¥{{ d.price }}</text>
-					<text class="ot-price">¥{{ d.ot_price }}</text>
 				</view>
 			</view>
 		</view>
@@ -25,7 +24,14 @@
 
 <script>
 	export default {
-		props: ['data']
+		props: ['data'],
+		methods: {
+			navto(url){
+				uni.navigateTo({
+					url
+				})
+			}
+		}
 	}
 </script>
 
@@ -52,8 +58,7 @@ $red: #FF4C4C;
 					border-radius: 10rpx;
 					overflow: hidden;
 					width: 100%;
-					height: 0;
-					padding-bottom: 100%;
+					height: 344rpx;
 					image {
 						width: 100%;
 						height: 100%;

+ 7 - 0
manifest.json

@@ -80,6 +80,13 @@
                     }
                 }
             }
+        },
+        "sdkConfigs" : {
+            "maps" : {
+                "qqmap" : {
+                    "key" : "VYZBZ-P2TRG-RMIQ3-ITAIN-2DKBK-CKFQQ"
+                }
+            }
         }
     }
 }

+ 248 - 161
pages/category/fillTable.vue

@@ -1,119 +1,156 @@
 <template>
-	<view class="wrapper">
-		<view class="tab-wrapper">
-			<view class="tab-item">
-				<view class="itemx">
-					<view class="item-tit">店铺名称:</view>
-					<input type="text" v-model="merchant_name" placeholder="请输入店铺名称" />
-				</view>
-				<view class="up-wrapper">
-					店铺logo
-					<view class="imgs">
-						<view class="imgs-item">
-							<image :src="sfzz" mode="" v-if="yyzz" @click.stop="upImg('yyzz')"></image>
-							<image src="../../static/img/add.png" mode="" v-if="!yyzz" @click.stop="upImg('yyzz')"></image>
-						</view>
+	<view class="content">
+		<view class="item">
+			<view class="item-tit">店铺名称</view>
+			<input type="text" v-model="store.name" placeholder="请输入店铺名称" />
+		</view>
+		<view class="item">
+					<view class="item-tit">店铺logo</view>
+					<view class="up-wrapper">
+						<image :src="store.image" mode="" v-if="store.image" @click.stop="upImg"></image>
+						<image src="../../static/img/add.png" mode="" v-else @click.stop="upImg"></image>
 					</view>
 				</view>
-				
-				<view class="itemx">
-					<view class="item-tit">联系电话:</view>
-					<input type="text" v-model="phone" placeholder="请输入联系电话" />
-				</view>
-				<view class="itemx">
-					<view class="item-tit">营业时间:</view>
-					<input type="text" v-model="time" placeholder="请输入营业时间" disabled />
-				</view>
-				<view class="itemx">
-					<view class="item-tit">店铺地址:</view>
-					<input type="text" v-model="area" placeholder="请输入店铺地址" />
-				</view>
-			</view>
-			
-			<view class="btn-tc"></view>
-			<view class="sub-btn" @click="sub">提交申请</view>
+		<view class="item">
+			<view class="item-tit">联系电话</view>
+			<input type="number" v-model="store.phone" placeholder="请输入商家电话" />
 		</view>
+		<view class="item">
+			<view class="item-tit">营业时间</view>
+			<picker mode="time" :value="bgtime"  @change="bindBgtimeChange" class="picker">
+				<view class="uni-input">{{ bgtime }}</view>
+			</picker>
+			<view class="line">至</view>
+			<picker mode="time" :value="edtime"  @change="bindEdtimeChange" class="picker prcker-t">
+				<view class="uni-input">{{ edtime }}</view>
+			</picker>
+		</view>
+		<view class="item" @click="getLocation" v-if="type == 'add'">
+			<view class="item-tit">经纬度</view>
+			<input type="text" v-model="store.latlng" placeholder="请选择经纬度" />
+		</view>
+		<view class="item" >
+			<view class="item-tit">详细地址</view>
+			<input type="text" v-model="store.detailed_address" placeholder="请输入详细地址" />
+		</view>
+		
+		<view class="sub" @click="sub" v-if="type == 'edit'">确认修改</view>
+		<view class="sub" @click="add" v-if="type == 'add'">提交</view>
 	</view>
 </template>
 
 <script>
-import { mapState, mapMutations } from 'vuex';
-import { register, verify } from '@/api/login.js';
-import { upload, enter } from '@/api/user.js';
+import { editStore } from '@/api/user.js';
+import { upload } from '@/api/order.js';
 export default {
 	data() {
 		return {
-			phone: '',
-			time:'',//输入营业时间
-			yyzz: '', //店铺logo
-			merchant_name: '', //店铺名称
-			area: '' //店长区域
+			store: {
+				name: '',
+				phone: '',
+				id: '',
+				image: '',
+				id: '',
+				detailed_address: '',
+				day_time: '',
+				latlng: ''
+			},
+			bgtime: '请选择时间',
+			edtime: '请选择时间',
+			detailed_address: '',
+			type: 'add',
 		};
 	},
-	onLoad() {
-		let obj = this;
-		obj.speed_id = uni.getStorageSync('spread') || '';
-		if (obj.speed_id == '') {
-			obj.speed_id = obj.userInfo.spread_uid || '';
+	onLoad(opt) {
+		if(opt.type == 'edit') {
+			this.store = JSON.parse(opt.item);
+			console.log(this.store, 'this.store++++++++++++');
+			let time = this.store.day_time.split(' - ');
+			this.bgtime = time[0].substring(0, 5);
+			this.edtime = time[1].substring(0, 5);
 		}
-	},
-	computed: {
-		...mapState('user', ['userInfo', 'orderInfo', 'hasLogin'])
-	},
-	watch: {
-		countDown(i) {
-			if (i == 0) {
-				clearInterval(this.time);
-			}
+		if(opt.type == 'add') {
+			this.type = 'add'
+			this.bgtime = '00:00'
+			this.edtime = '00:00'
 		}
+		
 	},
 	methods: {
-		upImg(item) {
+		// 选择当前位置
+		getLocation() {
+			console.log('选择当前位置');
+			let obj = this;
+			uni.chooseLocation({
+				success: function(res) {
+					// obj.addressData.area = res.name;
+					console.log('位置名称:' + res.name);
+					console.log('详细地址:' + res.address);
+					console.log('纬度:' + res.latitude);
+					console.log('经度:' + res.longitude);
+					// obj.addressData.latitude = res.latitude;
+					// obj.addressData.longitude = res.longitude;
+					obj.$set(obj.store,'latlng',res.latitude + ',' + res.longitude)
+					// obj.store.latlng = res.latitude + ',' + res.longitude
+				}
+			});
+		},
+		bindBgtimeChange(e) {
+			console.log(e);
+			this.bgtime = e.detail.value;
+		},
+		bindEdtimeChange(e) {
+			console.log(e);
+			this.edtime = e.detail.value;
+		},
+		indicatorStyle() {},
+		// 修改logo
+		upImg() {
 			let obj = this;
 			upload({
 				filename: ''
-			})
-				.then(res => {
-					console.log(res[0].url);
-
-					obj[item] = res[0].url;
-				})
-				.catch(err => {
-					console.log(err);
-				});
+			}).then(res => {
+				console.log(res[0].url);
+				obj.store.image = res[0].url;
+			});
 		},
 		//提交
 		sub() {
 			let obj = this;
-			if (obj.phone == '') {
-				obj.$api.msg('请输入联系方式');
+			let store = obj.store;
+			if (store.name == '') {
+				obj.$api.msg('请输入店铺名称');
+				return;
+			}
+			if (store.phone == '') {
+				obj.$api.msg('请输入店铺电话');
 				return;
 			}
-			if (this.phone.length < 11) {
-				this.$api.msg('请输入正确的手机号');
+			if (store.image == '') {
+				obj.$api.msg('请选择店铺logo');
 				return;
 			}
-			if (obj.yyzz == '') {
-				obj.$api.msg('请上传店铺logo');
+			if (store.day_time == '') {
+				obj.$api.msg('请输入营业时间');
 				return;
 			}
-			if (obj.area == '') {
+			if (store.detailed_address == '') {
 				obj.$api.msg('请输入店铺地址');
 				return;
 			}
-			let card_id = obj.sfzz + ',' + obj.sfzf;
 			uni.showLoading({
 				title: '提交中...',
 				mask: true
 			});
-			enter({
-				type: 1,
-				merchant_name: obj.area,
-				link_user: obj.name,
-				link_tel: obj.phone,
-				spread_uid: obj.speed_id,
-				charter: obj.yyzz,
-				card_id: card_id
+			let day_time = obj.bgtime + ':00 - ' + obj.edtime + ':00';
+			editStore({
+				id: store.id,
+				name: store.name,
+				detailed_address: store.detailed_address,
+				image: store.image,
+				phone: store.phone,
+				day_time: day_time,
+				latlng: store.latitude + ',' + store.longitude,
 			})
 				.then(res => {
 					uni.hideLoading();
@@ -121,11 +158,65 @@ export default {
 						title: '提交成功',
 						duration: 2000
 					});
-					setTimeout(() => {
-						uni.navigateBack({});
-					}, 2000);
-
-					console.log(res);
+					obj.$api.prePage().refreshList();
+					setTimeout(function() {
+						uni.navigateBack();
+					}, 800);
+				})
+				.catch(err => {
+					uni.hideLoading();
+					console.log(err);
+				});
+		},
+		add() {
+			let obj = this;
+			let store = obj.store;
+			if (store.name == '') {
+				obj.$api.msg('请输入店铺名称');
+				return;
+			}
+			if (store.phone == '') {
+				obj.$api.msg('请输入店铺电话');
+				return;
+			}
+			if (store.image == '') {
+				obj.$api.msg('请选择店铺头像');
+				return;
+			}
+			// if (store.day_time == '') {
+			// 	obj.$api.msg('请输入营业时间');
+			// 	return;
+			// }
+			if (store.introduction == '') {
+				obj.$api.msg('请输入店铺简介');
+				return;
+			}
+			if (store.detailed_address == '') {
+				obj.$api.msg('请输入店铺地址');
+				return;
+			}
+			let day_time = obj.bgtime + ':00 - ' + obj.edtime + ':00';
+			editStore({
+				id: 0,
+				name: store.name,
+				introduction: store.introduction,
+				image: store.image,
+				phone: store.phone,
+				day_time: day_time,
+				latlng: store.latlng,
+				detailed_address: store.detailed_address,
+				is_show: 0
+			})
+				.then(res => {
+					uni.hideLoading();
+					uni.showToast({
+						title: '提交成功',
+						duration: 2000
+					});
+					obj.$api.prePage().refreshList();
+					setTimeout(function() {
+						uni.navigateBack();
+					}, 800);
 				})
 				.catch(err => {
 					uni.hideLoading();
@@ -137,94 +228,90 @@ export default {
 </script>
 
 <style lang="scss" scoped>
-.wrapper {
+page {
 	height: 100%;
+	background-color: #f8f6f6;
 }
-.tab-wrapper {
-	padding: 20rpx 30rpx;
-	background-color: #f2f3f5;
-	.itemx {
-		margin: 0 auto;
-		width: 100%;
-		background-color: #fff !important;
+.item {
+	background-color: #fff !important;
+	min-height: 100rpx;
+	display: flex;
+	width: 750px;
+	border: 1px #f4f4f4 solid;
+	.line {
+		display: inline-block;
+		line-height: 100rpx;
+	}
+	.item-tit {
 		height: 100rpx;
-		display: flex;
-		// width: 690px;
-		border: 1px #f4f4f4 solid;
-		.code {
-			width: 150rpx;
-			flex-shrink: 0;
-			text-align: center;
-			font-size: 28rpx;
-			font-family: PingFang SC;
-			font-weight: 500;
-			color: #ff4c4c;
-			line-height: 100rpx;
-		}
-		.item-tit {
-			height: 100rpx;
-			line-height: 100rpx;
-			padding-left: 30rpx;
-			width: 310rpx;
-			font-size: 30rpx;
-			font-family: PingFang SC;
-			font-weight: 500;
-			color: #666666;
-			flex-shrink: 0;
-		}
-		input {
-			width: 440rpx;
-			padding-right: 20rpx;
-			height: 100rpx;
-			line-height: 100rpx;
-			font-size: 30rpx;
-			font-family: PingFang SC;
-			font-weight: 500;
-			color: #333333;
+		line-height: 100rpx;
+		padding-left: 30rpx;
+		width: 200rpx;
+		font-size: 30rpx;
+		font-family: PingFang SC;
+		font-weight: 500;
+		color: #666666;
+		flex-shrink: 0;
+	}
+	input {
+		width: 550rpx;
+		height: 100rpx;
+		line-height: 100rpx;
+		font-size: 30rpx;
+		font-family: PingFang SC;
+		font-weight: 500;
+		color: #333333;
+	}
+	textarea {
+		width: 550rpx;
+		height: 257rpx;
+		padding-top: 25rpx;
+		padding-right: 30rpx;
+		line-height: 50rpx;
+		font-size: 30rpx;
+		font-family: PingFang SC;
+		font-weight: 500;
+		color: #333333;
+	}
+	.up-wrapper {
+		height: 352rpx;
+		width: 550rpx;
+		position: relative;
+		image {
+			position: absolute;
+			height: 160rpx;
+			width: 160rpx;
+			top: 0;
+			bottom: 0;
+			left: 94rpx;
+			margin: auto;
 		}
 	}
 }
-.sub-btn {
-	// position: fixed;
-	// bottom: 0;
-	margin: 60rpx auto;
-	width: 600rpx;
-	height: 98rpx;
-	border-radius: 49rpx;
-	background: linear-gradient(180deg, #fd4646, #ff3535);
+.sub {
+	width: 674rpx;
+	height: 88rpx;
+	background: #ff4c4c;
+	border-radius: 44rpx;
+	line-height: 88rpx;
+	text-align: center;
 	font-size: 36rpx;
 	font-family: PingFang SC;
 	font-weight: 500;
 	color: #ffffff;
-	line-height: 98rpx;
-	text-align: center;
+	position: absolute;
+	bottom: 35rpx;
+	left: 0;
+	right: 0;
+	margin: auto;
 }
-.btn-tc {
-	height: 98rpx;
+.picker {
+	display: inline-block;
+	padding-right: 40rpx;
+	height: 100rpx;
+	line-height: 100rpx;
 }
-.up-wrapper {
-	margin: auto;
-	padding: 38rpx 21rpx;
-	width: 690rpx;
-	// height: 250rpx;
-	background: #ffffff;
-	border-radius: 10rpx;
-	font-size: 28rpx;
-	font-family: PingFang SC;
-	font-weight: 500;
-	color: #333333;
-	.imgs {
-		padding: 27rpx 70rpx;
-		display: flex;
-		justify-content: space-around;
-		.imgs-item {
-			height: 160rpx;
-			width: 160rpx;
-			image {
-				width: 100%;
-				height: 100%;
-			}
-		}
-	}
+.prcker-t {
+	padding-left: 40rpx;
 }
 </style>

+ 2 - 2
pages/index/child/goldenBean.vue

@@ -21,7 +21,7 @@
 			</view>
 			<view class="footer">
 				<view class="list">
-					<view class="item" v-for="d in data">
+					<view class="item" v-for="d in data" @click="navto('/pages/product/product?id=' + d.id + '&is_gold=' + 1)">
 						<view class="img">
 							<image :src="d.image" mode=""></image>
 						</view>
@@ -29,7 +29,7 @@
 							{{ d.store_name }}
 						</view>
 						<view class="price">
-							{{ d.price }}
+							{{ d.price }}金豆
 						</view>
 					</view>
 				</view>

+ 3 - 4
pages/index/child/recommend.vue

@@ -20,9 +20,9 @@
 				</view>
 			</view>
 		</view>
-		<view class="load"> 
+		<!-- <view class="load"> 
 		 ---------{{ loadingType == 'loadmore'?'加载中': '加载完成'}}---------
-		</view>
+		</view> -->
 	</view>
 </template>
 
@@ -83,8 +83,7 @@ $red: #FF4C4C;
 					border-radius: 10rpx;
 					overflow: hidden;
 					width: 100%;
-					height: 0;
-					padding-bottom: 100%;
+					height: 344rpx;
 					image {
 						width: 100%;
 						height: 100%;

+ 15 - 198
pages/index/index.vue

@@ -17,14 +17,14 @@
 			<!-- 背景色区域 -->
 			<view class="titleNview-background" :style="{ backgroundColor: '#5DBC7C' }"></view>
 			<swiper class="carousel" autoplay="true" duration="400" interval="5000" @change="swiperChange">
-				<swiper-item v-for="(item, index) in carouselList" :key="index" class="carousel-item" @click="bannerNavToUrl(item)"><image :src="item.pic" /></swiper-item>
+				<swiper-item v-for="(item, index) in carouselList" :key="index" class="carousel-item"><image :src="item.pic" /></swiper-item>
 			</swiper>
 			<!-- 自定义swiper指示器 -->
-			<view class="swiper-dots">
+			<!-- <view class="swiper-dots">
 				<text class="num">{{ swiperCurrent + 1 }}</text>
 				<text class="sign">/</text>
 				<text class="num">{{ swiperLength }}</text>
-			</view>
+			</view> -->
 		</view>
 		<!-- 分类 -->
 		<view class="cate-section">
@@ -54,7 +54,7 @@
 			</navigator>
 		</view>
 		<!-- 金豆专区 -->
-		<golden-bean :data='bastList'></golden-bean>
+		<golden-bean :data='jdList'></golden-bean>
 		<!-- 批发专区 -->
 		<wholesale></wholesale>
 		<!-- 为你推荐 -->
@@ -63,61 +63,22 @@
 </template>
 
 <script>
-import goldenBean from './child/goldenBean.vue'
-import wholesale from './child/wholesale.vue'
-import recommend from './child/recommend.vue'
-import seckill from '../../components/seckill/seckill.vue';
+import { getProducts } from '@/api/product.js';
+import goldenBean from './child/goldenBean.vue';
+import wholesale from './child/wholesale.vue';
+import recommend from './child/recommend.vue';
 import { loadIndexs } from '@/api/index.js';
 import { getUserInfo } from '@/api/user.js';
 import { setCoupons } from '@/api/functionalUnit.js';
-import { getBargainList } from '@/api/product.js';
 import { interceptor } from '@/utils/loginUtils';
 import { mapState } from 'vuex';
 
 export default {
 	components: {
-		seckill,
 		goldenBean,
 		wholesale,
 		recommend
 	},
-	watch: {
-		//自适应swiper高度
-		checkid(newValue, oldValue) {
-			let obj = this;
-			if (newValue == 0) {
-				let bHeight = Math.ceil(obj.bastList.length / 2);
-				obj.swiperHeight = Math.ceil(obj.pageProportion * 520 * bHeight);
-			}
-			if (newValue == 1) {
-				let bHeight = Math.ceil(obj.goodsList.length / 2);
-				obj.swiperHeight = Math.ceil(obj.pageProportion * 520 * bHeight);
-			}
-			if (newValue == 2) {
-				let bHeight = Math.ceil(obj.bastBanner.length / 2);
-				obj.swiperHeight = Math.ceil(obj.pageProportion * 520 * bHeight);
-			}
-		},
-		// 初次加载页面高度时修改页面高度
-		// bastList(newValue, oldValue) {
-		// 	let obj = this;
-		// 	let bHeight = Math.ceil(newValue.length / 2);
-		// 	obj.$nextTick(function() {
-		// 		uni.createSelectorQuery()
-		// 			.select('#list-box')
-		// 			.fields(
-		// 				{
-		// 					size: true
-		// 				},
-		// 				function(data) {
-		// 					obj.pageProportion = data.width / 750;
-		// 					obj.swiperHeight = Math.ceil(obj.pageProportion * 520 * bHeight);
-		// 				}
-		// 			)
-		// 			.exec();
-		// 	});
-		// }
-	},
 	data() {
 		return {
 			shareShow: false, //分享海报
@@ -127,38 +88,11 @@ export default {
 			titleNViewBackground: '',
 			swiperCurrent: 0,
 			swiperLength: 0,
-			bargainlist: [], //砍价商品
 			carouselList: [], //轮播列表
-			goodsList: [], //最新商品列表
-			bastList: [], //精品推荐列表
-			bastBanner: [], //促销商品列表
-			menusList: [], //头部菜单
+			bastList: [], //商品
+			jdList:[],//金豆商品
 			page: 1,
-			limit: 5,
-			userServant: [
-				{
-					image: ''
-				}
-			], //用户推广服务
-			couponArray: [], //可领取优惠券
-			recommend: [
-				{
-					id: 0,
-					re_title: '精选',
-					re_name: '为你推荐'
-				},
-				{
-					id: 1,
-					re_title: '最新',
-					re_name: '最新好货优选'
-				},
-				{
-					id: 2,
-					re_title: '便宜好货',
-					re_name: '90天便宜好货'
-				}
-			],
-			actTime: new Date()
+			limit: 3,
 		};
 	},
 	computed: {
@@ -222,126 +156,26 @@ export default {
 	},
 	// #endif
 	methods: {
-		//砍价商品推荐详情页
-		navToDetailPages(item) {
-			let id = item.product_id;
-			//let type = 2;
-		
-			uni.navigateTo({
-				url: '/pages/product/product?id=' + id
-			});
-		},
-		openSubscribe: function(e) {
-			let page = e;
-			// #ifndef MP
-			uni.navigateTo({
-				url: page
-			});
-			// #endif
-			// #ifdef MP
-			uni.showLoading({
-				title: '正在加载'
-			});
-			openBargainSubscribe()
-				.then(res => {
-					uni.hideLoading();
-					uni.navigateTo({
-						url: page
-					});
-				})
-				.catch(err => {
-					uni.hideLoading();
-				});
-			// #endif
-		},
 		getBargainList() {
 			let that = this;
 		
-			getBargainList({
+			getProducts({
 				page: that.page,
-				limit: that.limit
+				limit: that.limit,
+				is_gold: 1
 			})
 				.then(function(res) {
-					that.$set(that, 'bargainlist', res.data.slice(0, 2));
+					that.jdList = res.data
 				})
 				.catch(res => {
-					console.log(res, 'getBargainList');
 				});
 		},
-		Mask() {
-			this.MaskShow = false;
-			this.shareShow = true;
-			uni.setStorage({
-				key: 'FirstEntry',
-				data: true,
-				success: function() {
-					console.log(uni.getStorageSync('FirstEntry'), 'Mask');
-				}
-			});
-		},
-		Toshare() {
-			if (this.userInfo == '') {
-				getUserInfo({})
-					.then(({ data }) => {
-						this.setUserInfo(data);
-						this.userInfo = data;
-					})
-					.catch(e => {});
-			} else {
-				this.shareShow = false;
-				uni.navigateTo({
-					url: '/pages/user/shareQrCode?spread=' + this.userInfo.uid
-				});
-			}
-		},
-		Tocancel() {
-			this.shareShow = false;
-		},
-		// 监听切换事件
-		listChange(e) {
-			this.checkid = e.detail.current;
-		},
 		// 點擊搜索框
 		clickSearch() {
 			uni.navigateTo({
 				url: '/pages/product/search'
 			});
 		},
-		// 点击触发领取优惠券
-		setCoupons(item) {
-			// 判断是否已经领取了优惠券
-			let obj = this;
-			uni.showModal({
-				title: '领取提示',
-				content: '是否领取优惠券',
-				success(e) {
-					if (e.confirm) {
-						setCoupons({ couponId: item.id }).then(e => {
-							item.is_use = true;
-							uni.showToast({
-								title: '领取成功',
-								type: 'top',
-								duration: 2000
-							});
-						});
-					}
-				}
-			});
-		},
-		//商品种类切换
-		change(item) {
-			let id = item;
-			this.checkid = id;
-			if (this.checkid == 1) {
-				// console.log(1);
-				this.detail = this.selected_detail;
-			} else if (this.checkid == 2) {
-				// console.log(2);
-				this.detail = this.new_product;
-			} else {
-				this.detail = this.cheap_good;
-			}
-		},
 		// 监听图片加载完成
 		onImageError(key, index) {
 			this[key][index].image = '/static/error/errorImage.jpg';
@@ -353,11 +187,7 @@ export default {
 					let goods = data.info;
 					this.carouselList = data.banner;
 					this.swiperLength = this.carouselList.length;
-					this.menusList = data.menus;
-					this.goodsList = goods.firstList; //最新商品
 					this.bastList = goods.bastList; //精品推荐
-					this.bastBanner = data.benefit; //促销单品
-					this.$set(this, 'couponArray', data.couponList); //保存卡包券
 
 					uni.stopPullDownRefresh();
 				})
@@ -378,19 +208,6 @@ export default {
 				url: '/pages/product/product?id=' + id
 			});
 		},
-
-		// 轮播图跳转
-		bannerNavToUrl(item) {
-			// #ifdef H5
-			if (item.wap_url.indexOf('http') > 0) {
-				window.location.href = item.wap_url;
-			}
-			// #endif
-			//测试数据没有写id,用title代替
-			uni.navigateTo({
-				url: item.wap_url
-			});
-		}
 	}
 };
 </script>

+ 6 - 0
pages/money/pay.vue

@@ -40,6 +40,7 @@ import { mapState } from 'vuex';
 export default {
 	data() {
 		return {
+			is_gold: 0,
 			payType: 1, //支付类型
 			// #ifdef H5
 			payName: 'weixin',
@@ -66,6 +67,10 @@ export default {
 		// #endif
 	},
 	onLoad(options) {
+		// 判断是否是金豆商品
+		if (options.is_gold){
+			this.is_gold = options.is_gold
+		}
 		if (options.type == 1) {
 			this.type = 1;
 			this.orderId = options.ordid;
@@ -223,6 +228,7 @@ export default {
 			let prepage = obj.$api.prePage();
 
 			let data = {
+				is_gold: obj.is_gold,
 				real_name: prepage.addressData.real_name, //联系人名称
 				phone: prepage.addressData.phone, //联系人号码
 				couponId: prepage.couponChecked.id, //优惠券编号

File diff suppressed because it is too large
+ 15 - 56
pages/order/createOrder.vue


+ 30 - 58
pages/product/common/productBottom.vue

@@ -1,9 +1,5 @@
 <template>
-	<view class="page-bottom">
-		<navigator url="/pages/index/index" open-type="switchTab" class="p-b-btn">
-			<text class="iconfont iconhome"></text>
-			<text>首页</text>
-		</navigator>
+	<view class="page-bottom" v-if="is_gold == 0">
 		<view class="p-b-btn" :class="{ active: goodsObjact.userCollect }" @click="toFavorite(goodsObjact)">
 			<text class="iconfont " :class="{ iconlike: !goodsObjact.userCollect, iconlikefill: goodsObjact.userCollect }"></text>
 			<text>收藏</text>
@@ -13,6 +9,11 @@
 			<button type="primary" class=" action-btn no-border buy-now-btn" @click="buy(1)">立即购买</button>
 		</view>
 	</view>
+	<view class="page-bottom" v-else>
+		<view class="action-btn-group">
+			<button type="primary" style="width: 750rpx;" class=" action-btn no-border buy-now-btn" @click="buy(1)">立即购买</button>
+		</view>
+	</view>
 </template>
 
 <script>
@@ -29,11 +30,17 @@ export default {
 		},
 		goodsid:{
 			default: ''
+		},
+		is_gold: {
+			default: 0
 		}
 	},
 	data() {
 		return {};
 	},
+	mounted() {
+		console.log(this.is_gold)
+	},
 	methods: {
 		buy(type) {
 			this.$emit('specOPne',type);
@@ -68,16 +75,17 @@ export default {
 /* 底部操作菜单 */
 .page-bottom {
 	position: fixed;
+	left: 0rpx;
 	bottom: 0rpx;
 	z-index: 95;
 	display: flex;
 	justify-content: center;
 	align-items: center;
 	width: 750rpx;
-	height: 120rpx;
-	background-color: #ffffff;
-	/* box-shadow: 0 0 20rpx 0 rgba(0, 0, 0, 0.5);
-	border-radius: 16rpx; */
+	height: 98rpx;
+	background: rgba(255, 255, 255, 0.9);
+	box-shadow: 0 0 20rpx 0 rgba(0, 0, 0, 0.5);
+	// border-radius: 16rpx;
 	.p-b-btn {
 		display: flex;
 		flex-direction: column;
@@ -85,8 +93,8 @@ export default {
 		justify-content: center;
 		font-size: $font-sm;
 		color: $font-color-base;
-		width: 96rpx;
-		height: 80rpx;
+		width: 100rpx;
+		height: 98rpx;
 		.iconfont {
 			font-size: 40rpx;
 			line-height: 48rpx;
@@ -96,74 +104,38 @@ export default {
 		&.active .iconfont {
 			color: $uni-color-primary;
 		}
+		.icon-fenxiang2 {
+			font-size: 42rpx;
+			transform: translateY(-2rpx);
+		}
 		.iconlikefill {
 			font-size: 46rpx;
 		}
-		image {
-			width: 56rpx;
-			height: 58rpx;
-		}
 	}
 	.action-btn-group {
 		display: flex;
-		height: 76rpx;
-		border-radius: 100px;
+		height: 98rpx;
 		overflow: hidden;
-		margin-left: 20rpx;
 		position: relative;
-		&:after {
-			content: '';
-			position: absolute;
-			top: 50%;
-			right: 50%;
-			transform: translateY(-50%);
-			height: 28rpx;
-			width: 0;
-			border-right: 1px solid rgba(255, 255, 255, 0.5);
-		}
 		.action-btn {
 			display: flex;
 			align-items: center;
 			justify-content: center;
-			width: 270rpx;
+			width: 375rpx;
 			height: 100%;
 			font-size: $font-base;
 			padding: 0;
 			border-radius: 0;
-			background: transparent;
+			// background: transparent;
+			background: #ffb238;
 			&.buy-now-btn {
-				background-color: #303e49;
+				background-color: #FF4C4C;
 			}
 			&.add-cart-btn {
-				background-color: $base-color;
+				background: #ffb238;
 			}
 		}
 	}
 }
-.p-b-btn {
-	display: flex;
-	flex-direction: column;
-	align-items: center;
-	justify-content: center;
-	font-size: $font-sm;
-	color: $font-color-base;
-	width: 96rpx;
-	height: 80rpx;
-	.iconfont {
-		font-size: 40rpx;
-		line-height: 48rpx;
-		color: $font-color-light;
-	}
-	&.active,
-	&.active .iconfont {
-		color: $uni-color-primary;
-	}
-	.icon-fenxiang2 {
-		font-size: 42rpx;
-		transform: translateY(-2rpx);
-	}
-	.iconlikefill {
-		font-size: 46rpx;
-	}
-}
+
 </style>

+ 11 - 40
pages/product/common/productContent.vue

@@ -1,27 +1,13 @@
 <template>
 	<view class="introduce-section">
-		<text class="title clamp2">{{ goodsObjact.store_name }}</text>
-		<button open-type="share" class="shareDate">
-			<image class="share-img" src="../../../static/img/img57.png"></image>
-			好物推荐
-		</button>
-		<text class="info" v-if="goodsObjact.store_info">{{ goodsObjact.store_info }}</text>
-		<!-- <view class="progress-box">
-			<progress :percent="goodsObjact.percent | parseIntTo" activeColor="#F65527" font-size="10" show-info border-radius="5" stroke-width="9" />
-			<view class="number">剩余{{ goodsObjact.percent | parseIntTo }}%</view>
-		</view> -->
 		<view class="price-box">
 			<text class="price-tip">¥</text>
 			<view class="price">
 				{{ goodsObjact.price }}
-				<text class="text">/份</text>
 				<text class="m-price" v-if="goodsObjact.ot_price > goodsObjact.price">¥{{ goodsObjact.ot_price }}</text>
 			</view>
 		</view>
-		<view class="price-green">
-			¥{{ goodsObjact.ot_price }}
-			<text>市场价</text>
-		</view>
+		<text class="title clamp2">{{ goodsObjact.store_name }}</text>
 	</view>
 </template>
 
@@ -59,10 +45,9 @@ export default {
 .introduce-section {
 	position: relative;
 	background: #fff;
-	padding: 35rpx 0rpx;
-	padding-left: 35rpx;
+	padding: 26rpx 24rpx 30rpx;
 	.title {
-		font-size: 32rpx;
+		font-size: 36rpx;
 		color: $font-color-dark;
 		.tip-o {
 			color: #ff3334;
@@ -110,37 +95,23 @@ export default {
 	.price-box {
 		display: flex;
 		align-items: baseline;
-		height: 64rpx;
-		padding: 10rpx 0;
 		font-size: 26rpx;
 		color: $uni-color-primary;
 	}
-	.price {
-		font-size: $font-lg + 6rpx;
-		.text {
-			padding-left: 5rpx;
-			color: #b0b0b0;
-			font-size: 22rpx !important;
-		}
+	.price-tip {
+		color: #FF4C4C;
 	}
-	.price-green {
-		color: #2dbd59;
-		font-size: 28rpx !important;
-		text {
-			background: #2dbd59;
-			color: #ffffff;
-			padding: 0rpx 10rpx;
-			border-radius: 5rpx;
-			font-size: 22rpx !important;
-			margin-left: 15rpx;
-		}
+	.price {
+		font-size: 50rpx;
+		font-family: PingFang SC;
+		font-weight: 800;
+		color: #FF4C4C;
 	}
 	.m-price {
 		margin: 0 12rpx;
 		color: $font-color-light;
 		text-decoration: line-through;
-		margin-left: 25rpx;
-		font-size: 24rpx;
+		font-size: 34rpx;
 	}
 }
 </style>

+ 19 - 12
pages/product/exchange.vue

@@ -9,7 +9,7 @@
 					我的金豆
 				</view>
 				<view class="quantity">
-					8
+					{{ userInfo.integral }}
 				</view>
 				<view class="button">
 					查看明细
@@ -27,15 +27,15 @@
 </template>
 
 <script>
-import { loadIndexs } from '@/api/index.js';
-import dataList from '@/components/datalist.vue'
+import { getProducts } from '@/api/product.js';
+import dataList from '@/components/datalist.vue';
+import { mapState, mapMutations } from 'vuex';
 	export default {
 		data() {
 			return {
 				data: {
 					page: 1,
 					limit: 10,
-					sum: 0,
 					loadingType: 'loadmore',
 					data: []
 				}
@@ -45,8 +45,11 @@ import dataList from '@/components/datalist.vue'
 		components: {
 			dataList
 		},
-		mounted() {
-			this.init()
+		computed: {
+			...mapState('user', ['userInfo', 'orderInfo', 'hasLogin'])
+		},
+		onLoad() {
+			this.getData()
 		},
 		methods: {
 			// 點擊搜索框
@@ -55,14 +58,18 @@ import dataList from '@/components/datalist.vue'
 					url: '/pages/product/search'
 				});
 			},
-			init() {
-				this.getData()
-			},
 			getData() {
-				loadIndexs().then(res => {
-					this.data = res.data.info.bastList
-					this.loadingType = 'nomore'
+				const obj = this
+				getProducts({
+					page: this.page,
+					limit: this.limit,
+					is_gold: 1
 				})
+					.then(function(res) {
+						obj.data = res.data
+					})
+					.catch(res => {
+					});
 			}
 		}
 	}

+ 113 - 94
pages/product/product.vue

@@ -4,20 +4,23 @@
 		<top-swiper :imgList="imgList"></top-swiper>
 		<!-- 标题 -->
 		<product-content :goodsObjact="goodsObjact"></product-content>
-		<!-- 拼货时间及优惠 -->
-		<!-- <discounts @clickCoupon="Getcoupon" :Info="goodsObjact.store_info" :showCoupon="true"></discounts> -->
-		<!-- 猜你喜欢 -->
-		<!-- <guess-like @Addcar='Addcar' @clickNavTo='navToDetailPage' :goodList = 'good_list||[]'></guess-like> -->
+		<view class="c-list">
+			<view class="c-row b-b" @click="toggleSpec">
+				<text class="tit">购买数量</text>
+				<view class="con">
+					<text class="selected-text">{{ goodsNumber }}</text>
+				</view>
+				<text class="iconfont iconenter"></text>
+			</view>
+		</view>
 		<!-- 评价 -->
 		<estimate @navTo="navTo('/pages/product/reply?id=' + goodsid)" v-if="reply" :reply="reply" :list="list"></estimate>
-		<!-- 规格信息 -->
-		<fresh-detail :goodsObjact="goodsObjact"></fresh-detail>
 		<!-- 图文详情 -->
 		<content-text :description="description"></content-text>
 		<!-- 底部高度撑开 -->
 		<view class="contentBottomHeight"></view>
 		<!-- 底部操作菜单 -->
-		<product-bottom @buy="buy" :goodsObjact="goodsObjact" :goodsid="goodsid" @specOPne="specOPne"></product-bottom>
+		<product-bottom @buy="buy" :goodsObjact="goodsObjact" :goodsid="goodsid" @specOPne="specOPne" :is_gold="is_gold"></product-bottom>
 		<!-- 规格-模态层弹窗 -->
 		<view class="popup spec" :class="specClass" @touchmove.stop.prevent="stopPrevent" @click="toggleSpec">
 			<!-- 遮罩层 -->
@@ -26,13 +29,13 @@
 				<view class="a-t">
 					<image :src="actionImage"></image>
 					<view class="right">
-						<text class="name">{{ goodsObjact.store_name }}</text>
-						<text class="price">¥{{ actionPrice * goodsNumber }}</text>
-						<text class="stock">库存:{{ goodsStore }}件</text>
-						<view class="selected" v-if="specList != ''">
+						<view class="good-name clamp">{{ goodsObjact.store_name }}</view>
+						<text class="price">¥{{ actionPrice }}</text>
+						<!-- <text class="stock">库存:{{ goodsObjact.stock }}件</text>
+						<view class="selected" v-if="goodsType == 0">
 							已选:
 							<text class="selected-text" v-for="(sItem, sIndex) in specSelected" :key="sIndex">{{ sItem }}</text>
-						</view>
+						</view> -->
 					</view>
 				</view>
 				<view v-for="(item, index) in specList" :key="index" class="attr-list">
@@ -49,20 +52,20 @@
 						</text>
 					</view>
 				</view>
-				<!-- <view class="attr-list">
+				<view class="attr-list">
 					<text>购买数量</text>
 					<view class="item-list">
 						<uni-number-box class="step" :isMin="true" :value="goodsNumber" :min="1" :max="goodsNumberMax" @eventChange="numberChange"></uni-number-box>
 					</view>
-				</view> -->
-				<button class="btn" @click.stop="buy" v-show="buys_show">完成</button>
-				<button class="btn" style="background-color: #999999;" v-show="buys_shows">售罄</button>
+				</view>
+				<button class="btn" @click.stop="buy">完成</button>
 			</view>
 		</view>
 	</view>
 </template>
 
 <script>
+import uniNumberBox from '@/components/uni-number-box.vue';
 import { goodsDetail, cartAdd } from '@/api/product.js';
 import { mapState } from 'vuex';
 import store from '@/store/index.js';
@@ -88,6 +91,7 @@ import guessLike from './common/guessLike.vue';
 import estimate from './common/estimate.vue';
 export default {
 	components: {
+		uniNumberBox,
 		guessLike,
 		topSwiper,
 		productContent,
@@ -109,6 +113,7 @@ export default {
 			reply: '', //评论
 			list: '', //商品详情的数据
 			type: 1, //默认支付方式add为
+			is_gold: 0,//是否是金豆商品
 			goodsType: 0,
 			goodsNumber: 1, //购买数量
 			goodsid: '', //商品id
@@ -167,6 +172,10 @@ export default {
 		//保存商品id
 		this.goodsid = options.id;
 		this.goodsType = options.type;
+		// 判断是否是金豆商品
+		if (options.is_gold){
+			obj.is_gold = options.is_gold
+		}
 		// 判断有无人邀请
 		if (options.spread) {
 			// 存储邀请人
@@ -279,30 +288,6 @@ export default {
 				url: '/pages/product/reply?id=' + this.goodsid
 			});
 		},
-		//加入购物车
-		Addcar(item) {
-			let obj = this;
-			cartAdd({
-				cartNum: '1', //商品数量
-				uniqueId: '', //商品标签
-				new: 0, //商品是否新增加到购物车1为不加入0为加入
-				mer_id: '',
-				productId: item.id //商品编号
-			})
-				.then(function(e) {
-					uni.showToast({
-						title: '成功加入购物车',
-						type: 'top',
-						duration: 500,
-						icon: 'none'
-					});
-
-					obj.goodsDetail();
-				})
-				.catch(e => {
-					console.log(e);
-				});
-		},
 		goodsDetail() {
 			let obj = this;
 			// 获取普通商品信息
@@ -317,33 +302,28 @@ export default {
 				} //小程序商品详情图超出屏幕问题
 				obj.imgList = goods.slider_image; //保存轮播图
 				obj.specList = data.productAttr; //保存分类列表
-				if (Array.isArray(data.productValue) != true) {
-					obj.many = 2;
-					obj.specList = data.productAttr; //保存产品属性
-					obj.productValue = data.productValue; //保存属性值
-					obj.specSelected = []; //初始化默认选择对象
-					for (let i = 0; i < obj.specList.length; i++) {
-						// 设置默认数据
-						let attrValue = obj.specList[i].attr_value[0];
-						attrValue.check = true;
-						obj.specSelected.push(attrValue.attr);
-					}
-					let str = obj.specSelected.join(',');
-					console.log(str, 'str');
-					// 设置默认值
-					obj.actionPrice = obj.productValue[str].price;
-					obj.goodsNumberMax = obj.productValue[str].stock;
-					obj.actionImage = obj.productValue[str].image;
-					obj.uniqueId = obj.productValue[str].unique;
-					obj.goodsStore = obj.productValue[str].quota;
-				} else {
-					obj.many = 1;
-					obj.productValue = data.productValue; //保存分类查询数据
-					obj.actionPrice = goods.price; //保存默认选中商品价格
-					obj.actionImage = goods.image_base; //保存默认选中商品图片
-					obj.goodsNumberMax = goods.stock; //保存默认选中最大可购买商品数量
-				}
+				obj.productValue = data.productValue; //保存分类查询数据
+				obj.actionPrice = goods.price; //保存默认选中商品价格
+				obj.actionImage = goods.image_base; //保存默认选中商品价格
+				obj.goodsNumberMax = goods.stock; //保存默认选中最大可购买商品数量
 				obj.shopId = data.mer_id; //保存商店id
+				// 保存默认选中的对象
+				obj.specSelected = []; //初始化默认选择对象
+				for (let i = 0; i < obj.specList.length; i++) {
+					// 设置默认数据
+					let attrValue = obj.specList[i].attr_value[0];
+					attrValue.check = true;
+					obj.specSelected.push(attrValue.attr);
+				}
+				
+				//保存默认选中的对象字符串名称
+				let str = obj.specSelected.join(',');
+				// 设置默认值
+				// obj.actionImage = obj.productValue[str].image;
+				// obj.uniqueId = obj.productValue[str].unique;
+				// #ifdef H5
+				// obj.shareDate();
+				// #endif
 			});
 		},
 		// 立即购买
@@ -354,7 +334,8 @@ export default {
 				cartNum: obj.goodsNumber, //商品数量
 				new: 1,
 				productId: obj.goodsid, //商品编号
-				uniqueId: obj.uniqueId
+				uniqueId: obj.uniqueId,
+				is_gold: obj.is_gold,//是否是金豆商品
 			};
 
 			if (obj.type == 2) {
@@ -366,7 +347,7 @@ export default {
 					if (obj.type == 1) {
 						// 跳转到支付页
 						uni.navigateTo({
-							url: '/pages/order/createOrder?id=' + da.cartId
+							url: '/pages/order/createOrder?id=' + da.cartId + '&is_gold=' + obj.is_gold
 						});
 					}
 					if (obj.type == 2) {
@@ -496,18 +477,15 @@ export default {
 }
 /* 规格选择弹窗 */
 .attr-content {
-	padding: 25rpx 30rpx;
-
+	padding: 10rpx 30rpx;
 	.a-t {
 		display: flex;
-
 		image {
 			width: 170rpx;
 			height: 170rpx;
 			flex-shrink: 0;
 			border-radius: 8rpx;
 		}
-
 		.right {
 			display: flex;
 			flex-direction: column;
@@ -515,30 +493,30 @@ export default {
 			font-size: $font-sm + 2rpx;
 			color: $font-color-base;
 			line-height: 42rpx;
-			width: 75%;
-
-			.price {
-				font-size: $font-lg;
-				color: $uni-color-primary;
-				margin: 10rpx 0rpx;
+			.good-name {
+				padding-top: 20rpx;
+				max-width: 320rpx;
+				font-size: 30rpx;
+				font-family: PingFang SC;
+				font-weight: bold;
+				color: #1d2023;
+				line-height: 42rpx;
+				margin-bottom: 15rpx;
 			}
-
-			.name {
-				font-size: 32rpx;
-				color: $font-color-dark;
-				height: 50rpx;
-				overflow: hidden;
-				text-overflow: ellipsis;
-				white-space: nowrap;
-				display: block;
+			.price {
+				font-size: 60rpx;
+				font-family: PingFang SC;
+				font-weight: bold;
+				color: #ff6f0f;
+				// font-size: $font-lg;
+				// color: $uni-color-primary;
+				// margin-bottom: 10rpx;
 			}
-
 			.selected-text {
 				margin-right: 10rpx;
 			}
 		}
 	}
-
 	.attr-list {
 		display: flex;
 		flex-direction: column;
@@ -547,17 +525,16 @@ export default {
 		padding-top: 30rpx;
 		padding-left: 10rpx;
 	}
-
 	.item-list {
 		padding: 20rpx 0 0;
 		display: flex;
 		flex-wrap: wrap;
-
-		text {
+		.tit {
 			display: flex;
 			align-items: center;
 			justify-content: center;
 			background: #eee;
+			// margin-left: 10rpx;
 			margin-right: 20rpx;
 			margin-bottom: 20rpx;
 			border-radius: 100rpx;
@@ -567,14 +544,56 @@ export default {
 			font-size: $font-base;
 			color: $font-color-dark;
 		}
-
 		.selected {
-			background: #ddffdf;
+			background: #fbebee;
 			color: $uni-color-primary;
 		}
 	}
 }
 
+.c-list {
+	margin-top: 20rpx;
+	font-size: $font-sm + 2rpx;
+	color: $font-color-base;
+	background: #fff;
+	.c-row {
+		display: flex;
+		align-items: center;
+		padding: 20rpx 30rpx;
+		position: relative;
+	}
+	.tit {
+		width: 140rpx;
+	}
+	.con {
+		flex: 1;
+		color: $font-color-dark;
+		.selected-text {
+			margin-right: 10rpx;
+		}
+	}
+	.bz-list {
+		height: 40rpx;
+		font-size: $font-sm + 2rpx;
+		color: $font-color-dark;
+		text {
+			display: inline-block;
+			margin-right: 30rpx;
+		}
+	}
+	.con-list {
+		flex: 1;
+		display: flex;
+		flex-direction: column;
+		color: $font-color-dark;
+		line-height: 40rpx;
+	}
+	.red {
+		color: $uni-color-primary;
+	}
+}
+
+
 //默认商品底部高度
 .goodsBottom {
 	height: 160rpx;

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