2312970463@qq.com 3 years ago
parent
commit
7b54ecfa74

+ 6 - 3
api/index.js

@@ -38,7 +38,10 @@ export function loadIndexs(data) {
  * 获取主页数据 无需授权
  * 
 */
-export function getIndexData()
-{
-  return request.get("common/home",{},{ noAuth : true});
+export function getIndexData(data) {
+	return request({
+		url: '/api/common/home',
+		method: 'get',
+		data
+	})
 }

+ 88 - 57
api/login.js

@@ -1,57 +1,88 @@
-import request from '@/utils/request'
-
-// 登录
-export function login(data) {
-	return request({
-		url: '/api/login',
-		method: 'post',
-		data
-	});
-}
-// 注册
-export function register(data) {
-	return request({
-		url: '/api/register',
-		method: 'post',
-		data
-	});
-}
-// 验证码
-export function verify(data) {
-	// type=register为注册
-	// type=login为登录
-	return request({
-		url: '/api/register/verify',
-		method: 'post',
-		data
-	});
-}
-
-// 获取用户信息
-export function getUserInfo(data) {
-	return request({
-		url: '/api/userinfo',
-		method: 'get',
-		data
-	});
-}
-
-// 短信登录
-export function loginMobile(data) {
-	return request({
-		url: '/api/login/mobile',
-		method: 'post',
-		data
-	});
-}
-// #ifdef APP-PLUS
-// 微信授权登录
-export function loginWx(data) {
-	return request({
-		url: '/api/wechat/appauth',
-		method: 'get',
-		data
-	});
-}
-// #endif
-
+import request from '@/utils/request'
+
+// 登录
+export function login(data) {
+	return request({
+		url: '/api/login',
+		method: 'post',
+		data
+	});
+}
+// 注册
+// export function register(data) {
+// 	return request({
+// 		url: '/api/register',
+// 		method: 'post',
+// 		data
+// 	});
+// }
+// 验证码
+export function verify(data) {
+	// type=register为注册
+	// type=login为登录
+	return request({
+		// url: '/api/register/verify',
+		// url:'/api/auth/verify',
+		url:'/api/verify_code',
+		method: 'post',
+		data
+	});
+}
+
+// 获取用户信息
+export function getUserInfo(data) {
+	return request({
+		url: '/api/userinfo',
+		method: 'get',
+		data
+	});
+}
+
+// 短信登录
+export function loginMobile(data) {
+	return request({
+		url: '/api/login/mobile',
+		method: 'post',
+		data
+	});
+}
+// #ifdef APP-PLUS
+// 微信授权登录
+export function loginWx(data) {
+	return request({
+		url: '/api/wechat/appauth',
+		method: 'get',
+		data
+	});
+}
+// #endif
+/**
+ * h5用户手机号注册
+ * @param data object 用户手机号 验证码 密码
+ */
+export function register(data) {
+	return request({
+		url: '/api/register',
+		data
+	})
+}
+/**
+ * h5用户发送验证码
+ * @param data object 用户手机号
+ */
+export function registerVerify(data) {
+	return request({
+		url: '/api/auth/verify',
+		data
+	})
+}
+export function jiaMobile(data) {
+	// return request.post("/api/auth/smslogin", data, {
+	// 	noAuth: true
+	// });
+	return request({
+		url: '/api/auth/smslogin',
+		method: 'post',
+		data
+	})
+}

+ 215 - 185
api/product.js

@@ -1,186 +1,216 @@
-import request from '@/utils/request'
-
-// 获取商品列表
-export function getProducts(data) {
-	// 	{
-	// 参数名称	是否必须	示例	备注
-	// sid			否			二级分类编号
-	// cid			否			一级分类编号(!)
-	// keyword		否			搜索
-	// priceOrder	否			价格排序
-	// salesOrder	否			销量排序
-	// news			否			是否新品
-	// page			否			分页参数起始值
-	// limit		否			分页数步长值
-	// }
-	return request({
-		url: '/api/products',
-		method: 'get',
-		data
-	});
+import request from '@/utils/request'
+
+// 获取商品列表
+export function getProducts(data) {
+	// 	{
+	// 参数名称	是否必须	示例	备注
+	// sid			否			二级分类编号
+	// cid			否			一级分类编号(!)
+	// keyword		否			搜索
+	// priceOrder	否			价格排序
+	// salesOrder	否			销量排序
+	// news			否			是否新品
+	// page			否			分页参数起始值
+	// limit		否			分页数步长值
+	// }
+	return request({
+		url: '/api/products',
+		method: 'get',
+		data
+	});
+}
+// 获取商品详情
+export function goodsDetail(data, id) {
+	return request({
+		url: '/api/product/detail/' + id,
+		method: 'get',
+		data
+	});
+}
+
+// 砍价列表
+// export function getBargainList(data) {
+// 	return request({
+// 		url: '/api/bargain/list',
+// 		method: 'get',
+// 		data
+// 	});
+// }
+// 加入购物车
+export function cartAdd(data) {
+	return request({
+		url: '/api/cart/add',
+		method: 'post',
+		data
+	});
+}
+
+// 收藏商品
+export function collectAdd(data) {
+	return request({
+		url: '/api/collect/add',
+		method: 'post',
+		data
+	});
+}
+
+// 取消收藏商品
+export function collectDel(data) {
+	return request({
+		url: '/api/collect/del',
+		method: 'post',
+		data
+	});
+}
+
+// 获取搜搜关键字
+export function searchKeyword(data) {
+	return request({
+		url: '/api/search/keyword',
+		method: 'get',
+		data
+	});
+}
+
+// 获取热门分类信息
+export function groomList(data, type) {
+	// 获取产品类型 1 精品推荐 2 热门榜单 3首发新品 4促销单品
+	return request({
+		url: '/api/groom/list/' + type,
+		method: 'get',
+		data
+	});
+}
+
+
+// 获取秒杀商品详细
+export function seckillGoods(data, id) {
+	return request({
+		url: '/api/seckill/detail/' + id,
+		method: 'get',
+		data
+	});
+}
+
+// 获取拼团商品详细
+export function groupGoods(data, id) {
+	return request({
+		url: '/api/store/product/group/detail/' + id,
+		method: 'get',
+		data
+	});
+}
+
+
+// 获取商品分类
+export function getCategoryList(data) {
+	return request({
+		url: '/api/category',
+		method: 'get',
+		data
+	});
+}
+
+
+// 获取拼团列表
+export function getCombinationList(data) {
+	return request({
+		url: '/api/store/product/group/lst',
+		method: 'get',
+		data
+	});
+}
+
+//取消拼团
+export function getCombinationLisRemove(data, id) {
+	return request({
+		url: '/api/combination/remove' + id,
+		method: 'get',
+		data
+	});
+}
+
+//拼团开团页面数据
+export function getCombinationLisPink(data, id) {
+	return request({
+		url: '/api/combination/pink/' + id,
+		method: 'get',
+		data
+	});
+}
+
+// 获取拼团海报
+export function getCombinationPoster(data) {
+	return request({
+		url: '/api/combination/poster',
+		method: 'post',
+		data
+	});
+}
+/**
+ * 秒杀产品时间区间
+ * 
+ */
+export function getSeckillIndexTime(data) {
+	return request({
+			url: '/api/store/product/seckill/select',
+			methods: 'get',
+			data
+	});
+}
+// 获取秒杀分类
+export function getSeckillClass(data) {
+	return request({
+		// url: '/api/seckill/index',
+		url: '/api/store/product/seckill/select',
+		method: 'get',
+		data
+	});
+}
+
+// 获取秒杀列表
+export function getSeckillList(data) {
+	return request({
+		url: '/api/store/product/seckill/lst',
+		method: 'get',
+		data
+	});
+}
+
+
+// 产品评价数量和好评度
+export function reply_config(data, id) {
+	return request({
+		url: '/api/reply/config/' + id,
+		method: 'get',
+		data
+	});
+}
+// 获取产品评论
+export function reply_list(data, id) {
+	return request({
+		url: '/api/reply/list/' + id,
+		method: 'get',
+		data
+	});
+}
+//获取商店详情
+export function getStoreDetail(id, data) {
+	return request({
+		url: '/api/store/merchant/detail/' + id,
+		method: 'get',
+		data
+	})
+}
+/**
+ * 获取秒杀商品详情
+ * @param int id
+ * 
+ */
+export function getSeckillProductDetail(data,id) {
+	return request({
+		url:'/api/store/product/seckill/detail/'+id,
+		method:'get',
+		data
+	})
 }
-// 获取商品详情
-export function goodsDetail(data, id) {
-	return request({
-		url: '/api/product/detail/' + id,
-		method: 'get',
-		data
-	});
-}
-
-// 砍价列表
-export function getBargainList(data) {
-	return request({
-		url: '/api/bargain/list',
-		method: 'get',
-		data
-	});
-}
-// 加入购物车
-export function cartAdd(data) {
-	return request({
-		url: '/api/cart/add',
-		method: 'post',
-		data
-	});
-}
-
-// 收藏商品
-export function collectAdd(data) {
-	return request({
-		url: '/api/collect/add',
-		method: 'post',
-		data
-	});
-}
-
-// 取消收藏商品
-export function collectDel(data) {
-	return request({
-		url: '/api/collect/del',
-		method: 'post',
-		data
-	});
-}
-
-// 获取搜搜关键字
-export function searchKeyword(data) {
-	return request({
-		url: '/api/search/keyword',
-		method: 'get',
-		data
-	});
-}
-
-// 获取热门分类信息
-export function groomList(data,type) {
-	// 获取产品类型 1 精品推荐 2 热门榜单 3首发新品 4促销单品
-	return request({
-		url: '/api/groom/list/'+type,
-		method: 'get',
-		data
-	});
-}
-
-
-// 获取秒杀商品详细
-export function seckillGoods(data,id) {
-	return request({
-		url: '/api/seckill/detail/'+id,
-		method: 'get',
-		data
-	});
-}
-
-// 获取拼团商品详细
-export function groupGoods(data,id) {
-	return request({
-		url: '/api/combination/detail/'+id,
-		method: 'get',
-		data
-	});
-}
-
-
-// 获取商品分类
-export function getCategoryList(data) {
-	return request({
-		url: '/api/category',
-		method: 'get',
-		data
-	});
-}
-
-
-// 获取拼团列表
-export function getCombinationList(data) {
-	return request({
-		url: '/api/combination/list',
-		method: 'get',
-		data
-	});
-}
-
-//取消拼团
-export function getCombinationLisRemove(data,id) {
-	return request({
-		url: '/api/combination/remove'+id,
-		method: 'get',
-		data
-	});
-}
-
-//拼团开团页面数据
-export function getCombinationLisPink(data,id) {
-	return request({
-		url: '/api/combination/pink/'+id,
-		method: 'get',
-		data
-	});
-}
-
-// 获取拼团海报
-export function getCombinationPoster(data) {
-	return request({
-		url: '/api/combination/poster',
-		method: 'post',
-		data
-	});
-}
-
-
-// 获取秒杀分类
-export function getSeckillClass(data) {
-	return request({
-		url: '/api/seckill/index',
-		method: 'get',
-		data
-	});
-}
-// 获取秒杀列表
-export function getSeckillList(data,id) {
-	return request({
-		url: '/api/seckill/list/'+id,
-		method: 'get',
-		data
-	});
-}
-
-
-// 产品评价数量和好评度
-export function reply_config(data,id) {
-	return request({
-		url: '/api/reply/config/'+id,
-		method: 'get',
-		data
-	});
-}
-// 获取产品评论
-export function reply_list(data,id) {
-	return request({
-		url: '/api/reply/list/'+id,
-		method: 'get',
-		data
-	});
-}
-

+ 329 - 318
components/seckill/seckill.vue

@@ -1,5 +1,5 @@
 <template>
-<!--  <view class="seckill-section m-t" v-if="show">
+	<!--  <view class="seckill-section m-t" v-if="show">
     <view class="s-header">
 			<view class="f-left-icon"></view>
 			<view class="tit-box"><text class="tit">限时秒杀</text></view>
@@ -29,342 +29,353 @@
       </view>
     </scroll-view>
   </view> -->
-  <view class="sckill-wrapper">
-  	<scroll-view scroll-x="true" class="sckill">
-  		<view class="item-wrapper" @click="navTo('/pages/product/seckill')">
-  			<view class="goods-box" v-for="(item, index) in list" :key="index" >
-  				<view class="image-wrapper"><image :src="item.image" mode="scaleToFill"></image></view>
-  				<view class="good-title">{{ item.title }}</view>
-  				<view class="price">
-  					<view class="now-price">¥{{ item.price | mon}}</view>
-  					<view class="old-price">¥{{ item.ot_price }}</view>
-  				</view>
-  			</view>
-        <view v-if="list.length == 0" class="noGoodsBg">
-          <view>敬请期待</view>
-        </view>
-  		</view>
-  	</scroll-view>
-  </view>
+	<view class="sckill-wrapper">
+		<scroll-view scroll-x="true" class="sckill">
+			<view class="item-wrapper">
+				<view class="goods-box" v-for="(item, index) in list" :key="index" @click="navTo('/pages/product/product?id='+ item.product_id + '&type=1')">
+					<view class="image-wrapper"><image :src="item.image" mode="scaleToFill"></image></view>
+					<view class="good-title">{{ item.store_name }}</view>
+					<view class="price">
+						<view class="now-price">¥{{ item.price | mon }}</view>
+						<view class="old-price">¥{{ item.ot_price }}</view>
+					</view>
+				</view>
+				<view v-if="list.length == 0" class="noGoodsBg"><view>敬请期待</view></view>
+			</view>
+		</scroll-view>
+	</view>
 </template>
 
 <script>
-  import uniCountdown from '@/components/uni-countdown/uni-countdown.vue';
-  import {
-    getSeckillList,
-    getSeckillClass
-  } from '@/api/product.js';
-  import {
-    timeComputed
-  } from '@/utils/rocessor.js';
-  export default {
-    components: {
-      uniCountdown
-    },
-    data() {
-      return {
-        list: [],
-        page: 1,
-        limit: 10,
-        showTime: '', //显示的时间
-        showTImeId: '', //显示时间id用于查询数据
-        stopTimeH: 0,
-        stopTimeM: 0,
-        stopTimeS: 0,
-        // 判断是否所有活动已经结束
-        stop: false, //活动是否已经结束
-        show: false, //是否显示活动
-        status: 0 //获取状态值1为有活动开始中 2为活动未开始 0为活动已经结束
-      };
-    },
-	filters: {
-		mon(value) {
-			return +value
-		}
+import uniCountdown from '@/components/uni-countdown/uni-countdown.vue';
+import { getSeckillList, getSeckillIndexTime } from '@/api/product.js';
+import { timeComputed } from '@/utils/rocessor.js';
+export default {
+	components: {
+		uniCountdown
+	},
+	data() {
+		return {
+			list: [],
+			page: 1,
+			limit: 10,
+			showTime: '', //显示的时间
+			showTImeId: '', //显示时间id用于查询数据
+			stopTimeH: 0,
+			stopTimeM: 0,
+			stopTimeS: 0,
+			// 判断是否所有活动已经结束
+			stop: false, //活动是否已经结束
+			show: false, //是否显示活动
+			status: 0 //获取状态值1为有活动开始中 2为活动未开始 0为活动已经结束
+		};
+	},
+	filters: {
+		mon(value) {
+			return +value;
+		}
+	},
+	created: function(e) {
+		// 载入分类
+		this.getClass();
 	},
-    created: function(e) {
-      // 载入分类
-      this.getClass();
-    },
-    methods: {
-      navTo(url) {
-        uni.navigateTo({
-          url
-        });
-      },
-      getList() {
-        getSeckillList({
-              page: this.page,
-              limit: this.limit
-            },
-            this.showTImeId
-          )
-          .then(e => {
-            this.list = e.data;
-            console.log(this.list)
-          })
-          .catch(e => {
-            console.log(e);
-          });
-      },
-      getClass() {
-        let obj = this;
-        getSeckillClass({})
-          .then(({
-            data
-          }) => {
-            let arr = data.seckillTime;
-            // 用于判断是否有数据
-            let showDate = false;
-            for (var i = 0; i < arr.length; i++) {
-              let ar = arr[i];
-              if (ar.status === 1 || ar.status === 2) {
-                obj.status = ar.status;
-                // 保存要显示的场次时间
-                obj.showTime = ar.time;
-                // 保存要显示活动商品的id
-                obj.showTImeId = ar.id;
-                // 保存当前状态值
-                // 计算倒计时时间
-                if (ar.status === 1) {
-                  obj.timeComputed(ar.stop * 1000);
-                } else {
-                  // 获取需要开始
-                  let arTime = ar.time.split(':');
-                  let h = arTime[0];
-                  let m = arTime[1];
-                  let time = new Date();
-                  // 设置时间
-                  time.setHours(h, m, 0);
-                  obj.timeComputed(time.getTime());
-                }
-                // 获取商品列表
-                obj.getList();
-                // 保存当前有活动在举行
-                showDate = true;
-                // 任务查询结束跳出循环
-                break;
-              }
-            }
-            // 判断是否有活动
-            if (arr.length > 0) {
-              obj.show = true;
-            }
-            // 判断今天活动是否已经全部结束
-            if (!showDate) {
-              // 保存活动结束最后一个小时的活动商品
-              obj.showTImeId = arr[arr.length - 1].id;
-              // 活动已经结束
-              obj.status = 0;
-              // 获取结束时的商品
-              obj.getList();
-              console.log(obj.status);
-            }
-            // 如果所有场次均已经结束
-          })
-          .catch(e => {
-            uni.showModal({
-              title: JSON.stringify(e)
-            });
-          });
-      },
-      // 计算倒计时时间
-      timeComputed(da) {
-        let obj = this;
-        let stopTime = timeComputed(da)
-        obj.stopTimeH = stopTime.hours;
-        obj.stopTimeM = stopTime.minutes;
-        obj.stopTimeS = stopTime.seconds;
-      }
-    }
-  };
+	methods: {
+		navTo(url) {
+			uni.navigateTo({
+				url
+			});
+		},
+		getList() {
+			// getSeckillList(
+			// 	{
+			// 		page: this.page,
+			// 		limit: this.limit
+			// 	},
+			// 	this.showTImeId
+			// )
+			// 	.then(e => {
+			// 		this.list = e.data;
+			// 		console.log(this.list);
+			// 	})
+			// 	.catch(e => {
+			// 		console.log(e);
+			// 	});
+			getSeckillList().then(({ data }) => {
+				console.log(data,'------------');
+				this.list = data.list;
+			});
+		},
+		getClass() {
+			let obj = this;
+			// getSeckillIndexTime().then(res=> {
+			// 	console.log(res)
+			// })
+			getSeckillIndexTime()
+				.then(({ data }) => {
+					let arr = data.seckillTime;
+					console.log(arr)
+					// 用于判断是否有数据
+					let showDate = false;
+					
+					for (var i = 0; i < arr.length; i++) {
+						let ar = arr[i];
+						if (ar.pc_status === 1 || ar.pc_status === 2) {
+							obj.status = ar.pc_status;
+							// 保存要显示的场次时间
+							console.log(ar.start_time)
+							if(ar.start_time < 10) {
+								obj.showTime = '0'+ar.start_time + ':00'
+							}else {
+								obj.showTime = ar.start_time + ':00'
+							}
+							// obj.showTime = ar.time;
+							console.log(obj.showTime)
+							// 保存要显示活动商品的id
+							obj.showTImeId = ar.seckill_time_id;
+							// 保存当前状态值
+							// 计算倒计时时间
+							if (ar.status === 1) {
+								obj.timeComputed(ar.stop * 1000);
+							} else {
+								// 获取需要开始
+								let arTime = ar.time.split(':');
+								let h = arTime[0];
+								let m = arTime[1];
+								console.log(h,m,'h,m')
+								let time = new Date();
+								// 设置时间
+								time.setHours(h, m, 0);
+								obj.timeComputed(time.getTime());
+							}
+							// 获取商品列表
+							obj.getList();
+							// 保存当前有活动在举行
+							showDate = true;
+							// 任务查询结束跳出循环
+							break;
+						}
+					}
+					// 判断是否有活动
+					if (arr.length > 0) {
+						obj.show = true;
+					}
+					// 判断今天活动是否已经全部结束
+					if (!showDate) {
+						// 保存活动结束最后一个小时的活动商品
+						obj.showTImeId = arr[arr.length - 1].seckill_time_id;
+						// 活动已经结束
+						obj.status = 0;
+						// 获取结束时的商品
+						obj.getList();
+						console.log(obj.status);
+					}
+					// 如果所有场次均已经结束
+				})
+				.catch(e => {
+					console.log(e)
+					uni.showModal({
+						title: JSON.stringify(e)
+					});
+				});
+		},
+		// 计算倒计时时间
+		timeComputed(da) {
+			let obj = this;
+			let stopTime = timeComputed(da);
+			obj.stopTimeH = stopTime.hours;
+			obj.stopTimeM = stopTime.minutes;
+			obj.stopTimeS = stopTime.seconds;
+			console.log(obj.stopTimeH,obj.stopTimeM,obj.stopTimeS)
+		}
+	}
+};
 </script>
 
 <style lang="scss">
-  /* 秒杀专区 */
-  .seckill-section {
-    padding: 4rpx 30rpx 24rpx;
+/* 秒杀专区 */
+.seckill-section {
+	padding: 4rpx 30rpx 24rpx;
 
-    .s-header {
-      display: flex;
-      align-items: center;
-      height: 92rpx;
-      line-height: 1;
+	.s-header {
+		display: flex;
+		align-items: center;
+		height: 92rpx;
+		line-height: 1;
 
-      .tit-box {
-        flex-shrink: 0;
-      }
+		.tit-box {
+			flex-shrink: 0;
+		}
 
-      .tit {
-        @extend %font-title;
-      }
+		.tit {
+			@extend %font-title;
+		}
 
-      .f-left-icon {
-        @extend %f-left-icon;
-      }
+		.f-left-icon {
+			@extend %f-left-icon;
+		}
 
-      .textNav {
-        line-height: 1;
-        padding: 15rpx 0;
-        flex-shrink: 0;
-        flex-grow: 1;
-        min-width: 100rpx;
-      }
+		.textNav {
+			line-height: 1;
+			padding: 15rpx 0;
+			flex-shrink: 0;
+			flex-grow: 1;
+			min-width: 100rpx;
+		}
 
-      .tip-box {
-        flex-grow: 1;
-        display: flex;
-        justify-content: flex-start;
-        align-items: center;
-      }
+		.tip-box {
+			flex-grow: 1;
+			display: flex;
+			justify-content: flex-start;
+			align-items: center;
+		}
 
-      .tip {
-        font-size: $font-sm;
-        color: $font-color-light;
-        padding-left: 10rpx;
-        padding-right: 10rpx;
-      }
+		.tip {
+			font-size: $font-sm;
+			color: $font-color-light;
+			padding-left: 10rpx;
+			padding-right: 10rpx;
+		}
 
-      .timer {
-        display: inline-block;
-        width: 40rpx;
-        height: 36rpx;
-        text-align: center;
-        line-height: 36rpx;
-        margin-right: 14rpx;
-        font-size: $font-sm + 2rpx;
-        color: #fff;
-        border-radius: 2px;
-        background: rgba(0, 0, 0, 0.8);
-      }
+		.timer {
+			display: inline-block;
+			width: 40rpx;
+			height: 36rpx;
+			text-align: center;
+			line-height: 36rpx;
+			margin-right: 14rpx;
+			font-size: $font-sm + 2rpx;
+			color: #fff;
+			border-radius: 2px;
+			background: rgba(0, 0, 0, 0.8);
+		}
 
-      .iconenter {
-        font-size: $font-sm;
-        color: $font-color-light;
-        flex: 1;
-        text-align: right;
-      }
-    }
+		.iconenter {
+			font-size: $font-sm;
+			color: $font-color-light;
+			flex: 1;
+			text-align: right;
+		}
+	}
 
-    .floor-list {
-      white-space: nowrap;
-      background-color: white;
-      padding: 20rpx;
-      border-radius: 5rpx;
-      box-shadow: $box-shadow;
-    }
+	.floor-list {
+		white-space: nowrap;
+		background-color: white;
+		padding: 20rpx;
+		border-radius: 5rpx;
+		box-shadow: $box-shadow;
+	}
 
-    .scoll-wrapper {
-      display: flex;
-      align-items: flex-start;
+	.scoll-wrapper {
+		display: flex;
+		align-items: flex-start;
 
-      .noGoodsBg {
-        display: flex;
-        align-items: center;
-        justify-content: center;
-        height: 100%;
-        position: absolute;
-        top: 0;
-        left: 0;
-        width: 100%;
-        color: $font-color-light;
-      }
+		.noGoodsBg {
+			display: flex;
+			align-items: center;
+			justify-content: center;
+			height: 100%;
+			position: absolute;
+			top: 0;
+			left: 0;
+			width: 100%;
+			color: $font-color-light;
+		}
 
-      .floor-item {
-        width: 150rpx;
-        margin-right: 20rpx;
-        font-size: $font-sm + 2rpx;
-        color: $font-color-dark;
-        line-height: 1.8;
+		.floor-item {
+			width: 150rpx;
+			margin-right: 20rpx;
+			font-size: $font-sm + 2rpx;
+			color: $font-color-dark;
+			line-height: 1.8;
 
-        .list-image {
-          width: 150rpx;
-          height: 150rpx;
-          border-radius: 6rpx;
-        }
+			.list-image {
+				width: 150rpx;
+				height: 150rpx;
+				border-radius: 6rpx;
+			}
 
-        .price {
-          color: $color-red;
-        }
-      }
-    }
-  }
-  .sckill-wrapper {
-  	width: 701rpx;
-  	height: 293rpx;
-  	background-image: url(../../static/img/sckillbg.png);
-  	background-size: 100% 100%;
-  	margin: 34rpx auto 37rpx;
-  	padding: 31rpx 21rpx;
-  	.sckill {
-  		width: 659rpx;
-  		height: 231rpx;
-      .noGoodsBg {
-        display: flex;
-        align-items: center;
-        justify-content: center;
-        height: 100%;
-        position: absolute;
-        top: 0;
-        left: 0;
-        width: 100%;
-        color: $font-color-light;
-      }
-  		.item-wrapper {
-  			display: flex;
-  			.goods-box {
-  				width: 192rpx;
-  				height: 231rpx;
-  				margin: 0 42rpx 0 0;
-  				flex-shrink: 0;
-  				.image-wrapper {
-  					width: 192rpx;
-  					height: 150rpx;
-  					border-radius: 10rpx;
-  					overflow: hidden;
-  					image {
-  						width: 100%;
-  						height: 100%;
-  						opacity: 1;
-  					}
-  				}
-  				.good-title {
-  					padding: 15rpx 0rpx 0rpx 6rpx;
-  					font-size: 26rpx;
-  					font-weight: 500;
-  					color: #333333;
-  					line-height: 26rpx;
-  					opacity: 0.8;
-  					white-space: nowrap;
-  					overflow: hidden;
-  					text-overflow: ellipsis;
-  				}
-  				.price {
-  					display: flex;
-  					height: 39rpx;
-  					justify-content: space-between;
-  					.now-price {
-  						// padding-top:19rpx ;
-  						font-size: 24rpx;
-  						font-weight: bold;
-  						color: #901b21;
-  						line-height: 16rpx;
-  						// padding-left: 10rpx;
-  						align-self: flex-end;
-  					}
-  					.old-price {
-  						// padding-top:27rpx ;
-  						align-self: flex-end;
-  						font-size: 15rpx;
-  						font-weight: 500;
-  						text-decoration: line-through;
-  						color: #9d9d9d;
-  						line-height: 16rpx;
-  						// padding-right: 10rpx;
-  					}
-  				}
-  			}
-  		}
-  	}
-  }
-</style>
+			.price {
+				color: $color-red;
+			}
+		}
+	}
+}
+.sckill-wrapper {
+	width: 701rpx;
+	height: 293rpx;
+	background-image: url(../../static/img/sckillbg.png);
+	background-size: 100% 100%;
+	margin: 34rpx auto 37rpx;
+	padding: 31rpx 21rpx;
+	.sckill {
+		width: 659rpx;
+		height: 231rpx;
+		.noGoodsBg {
+			display: flex;
+			align-items: center;
+			justify-content: center;
+			height: 100%;
+			position: absolute;
+			top: 0;
+			left: 0;
+			width: 100%;
+			color: $font-color-light;
+		}
+		.item-wrapper {
+			display: flex;
+			.goods-box {
+				width: 192rpx;
+				height: 231rpx;
+				margin: 0 42rpx 0 0;
+				flex-shrink: 0;
+				.image-wrapper {
+					width: 192rpx;
+					height: 150rpx;
+					border-radius: 10rpx;
+					overflow: hidden;
+					image {
+						width: 100%;
+						height: 100%;
+						opacity: 1;
+					}
+				}
+				.good-title {
+					padding: 15rpx 0rpx 0rpx 6rpx;
+					font-size: 26rpx;
+					font-weight: 500;
+					color: #333333;
+					line-height: 26rpx;
+					opacity: 0.8;
+					white-space: nowrap;
+					overflow: hidden;
+					text-overflow: ellipsis;
+				}
+				.price {
+					display: flex;
+					height: 39rpx;
+					justify-content: space-between;
+					.now-price {
+						// padding-top:19rpx ;
+						font-size: 24rpx;
+						font-weight: bold;
+						color: #901b21;
+						line-height: 16rpx;
+						// padding-left: 10rpx;
+						align-self: flex-end;
+					}
+					.old-price {
+						// padding-top:27rpx ;
+						align-self: flex-end;
+						font-size: 15rpx;
+						font-weight: 500;
+						text-decoration: line-through;
+						color: #9d9d9d;
+						line-height: 16rpx;
+						// padding-right: 10rpx;
+					}
+				}
+			}
+		}
+	}
+}
+</style>

+ 4 - 2
manifest.json

@@ -73,10 +73,12 @@
         "devServer" : {
             "proxy" : {
                 "/api" : {
-                    "target" : "http://base.liuniu946.com", //请求的目标域名
+                    "target" : "http://zccy.liuniu946.com", //请求的目标域名
                     "changeOrigin" : true,
                     // "secure": false,
-                    "pathRewrite" : {}
+                    "pathRewrite" : {
+						// "^/api": "/"
+					}
                 }
             }
         }

+ 48 - 263
pages/index/index.vue

@@ -49,19 +49,19 @@
 		<view class="groupBooking-wrapper">
 			<template v-for="(item,index) in czgoodList">
 				<view class="spgood" :key="item.id" @click="goProduct(item)">
-					<view class="left-wrapper"><image :src="item.image" mode="scaleToFill"></image></view>
+					<view class="left-wrapper"><image :src="item.product.image" mode="scaleToFill"></image></view>
 					<view class="right-wrapper">
-						<view class="right-title clamp">{{ item.title }}</view>
+						<view class="right-title clamp">{{ item.product.store_name }}</view>
 						<view class="ex-addr">
 							<image src="../../static/img/shop.png" mode="" class="name-img"></image>
-							子臣台州旗舰店
+							{{item.merchant.mer_name}}
 							<image src="../../static/img/point.png" mode="" class="point-img"></image>
 							200m
 						</view>
 						<view class="right-bottom">
 							<view class="sp-price">
 								<view class="now-price">¥ {{ item.price }}</view>
-								<view class="old-price">¥ {{ item.product_price }}</view>
+								<view class="old-price">¥ {{ item.product.price }}</view>
 							</view>
 							<view class="sp-btn">马上拼</view>
 						</view>
@@ -111,107 +111,7 @@
 				<view class="bg"></view>
 			</view>
 		</view>
-		<!-- 分类 -->
-		<view class="cate-section">
-			<view class="cate-item">
-				<image src="/static/icon/c3.png"></image>
-				<text>联盟礼包</text>
-			</view>
-			<navigator url="/pages/product/groupBooking/index">
-				<view class="cate-item">
-					<image src="/static/icon/c5.png"></image>
-					<text>超值拼团</text>
-				</view>
-			</navigator>
-			<navigator url="/pages/product/seckill">
-				<view class="cate-item">
-					<image src="/static/icon/c7.png"></image>
-					<text>限时秒杀</text>
-				</view>
-			</navigator>
-			<navigator url="/pages/index/sign">
-				<view class="cate-item">
-					<image src="/static/icon/c8.png"></image>
-					<text>每日签到</text>
-				</view>
-			</navigator>
-		</view>
-
-		<view class="ad-1"><image src="/static/temp/ad1.jpg" mode="scaleToFill"></image></view>
-		<!-- 可领取优惠券 -->
-		<!-- <scroll-view class="coupon-box clamp" :scroll-x="true">
-			<view v-for="(item, index) in couponArray" :key="item.id" class="coupon-list">
-				<view class="row flex">
-					<view class="list-money flex">
-						<image :src="item.is_use ? '/static/img/img02.png' : '/static/img/img03.png'" mode="scaleToFill"></image>
-						<view class="list-money-text">
-							<view class="tit" :class="{ noAction: item.is_use }">
-								<text>{{ item.coupon_price }}</text>
-							</view>
-						</view>
-					</view>
-					<view class="list-interval position-relative">
-						<view class="bottom"></view>
-						<view class="top"></view>
-					</view>
-					<view class="row_list_right">
-						<view class="right_top"><text class="right_title" :class="{ noAction: item.is_use }">满减券</text></view>
-						<view class="right_time">
-							<text>满{{ item.use_min_price }}使用</text>
-						</view>
-					</view>
-					<view class="right_use" :class="{ noAction: item.is_use }" @click="setCoupons(item)">
-						<text>{{ item.is_use ? '已领取' : '立即领取' }}</text>
-					</view>
-				</view>
-			</view>
-		</scroll-view> -->
-
-		<!-- 秒杀楼层 -->
-		<!-- <seckill></seckill> -->
-		<!-- 砍价 -->
-		<view class="hot-goods">
-			<view class="hot-headers flex-upDown-center">
-				<!-- <image class="img" src="../../static/img/img44.png"></image> -->
-				<view class="hot-title">超值砍价</view>
-				<view><view class="more" @click.stop="navTo('/pages/activity/goods_bargain/index')">更多</view></view>
-			</view>
-			<view class="hot-lists" v-for="(baritem, barindex) in bargainlist" :key="barindex" @click.stop="navToDetailPages(baritem)">
-				<view class="hot-produce">
-					<view class="produce-image"><image :src="baritem.image"></image></view>
-					<view class="produce-content">
-						<view class="produce-price1 ">
-							<view class="produce-name line2">{{ baritem.title }}</view>
-							<!-- <view class="produce-info">
-								已抢
-								<text style="color: #FF383E">{{ baritem.sales }}</text>
-								箱/仅剩
-								<text style="color:#FF383E">{{ baritem.stock }}</text>
-								箱
-							</view> -->
-							<view class="produce-center">
-								<view class="kanjia_word">
-									<view class="word-1">原价:¥{{ baritem.price }}</view>
-									<view class="word-2">
-										砍后价
-										<text style="font-size: 24rpx;">¥</text>
-										<text style="font-size: 36rpx;">{{ baritem.min_price }}</text>
-									</view>
-								</view>
-								<view
-									class="kanjia_button flex-center"
-									@tap.stop="openSubscribe('/pages/activity/goods_bargain_details/index?id=' + baritem.id + '&bargain=' + userInfo.uid)"
-								>
-									<view>查看详情</view>
-								</view>
-							</view>
-						</view>
-					</view>
-				</view>
-			</view>
-		</view>
-		<!-- 拼团楼层 -->
-
+		<!-- <view class="ad-1"><image src="/static/temp/ad1.jpg" mode="scaleToFill"></image></view> -->
 		<view class="recommend flex">
 			<view class="recommend_list" @click="change(ls.id)" v-for="ls in recommend" :key="ls.re_title">
 				<view class="re_title" v-bind:class="{ active_color: ls.id == checkid }">{{ ls.re_title }}</view>
@@ -283,127 +183,6 @@
 				</scroll-view>
 			</swiper-item>
 		</swiper>
-
-		<!-- 精品 商品 -->
-		<view class="f-header m-t">
-			<view class="f-left-icon"></view>
-			<view class="tit-box"><text class="tit">精品推荐</text></view>
-			<navigator url="/pages/product/classify?type=1"><text class="iconfont iconenter">更多</text></navigator>
-		</view>
-		<view class="guess-section">
-			<view v-for="(item, index) in bastList" :key="index" class="guess-item" @click="navToDetailPage(item)">
-				<view class="image-wrapper"><image :src="item.image" mode="scaleToFill"></image></view>
-				<text class="title clamp margin-c-20">{{ item.store_name }}</text>
-				<view class="cmy-hr"></view>
-				<view class="price margin-c-20 flex">
-					<view>
-						<text class="font-size-sm ">¥</text>
-						{{ item.price }}
-					</view>
-					<view class="font-size-sm">
-						<text class="font-color-gray">{{ item.sales }}人购买</text>
-					</view>
-				</view>
-			</view>
-		</view>
-		<!-- 最新 商品 -->
-		<view class="f-header m-t">
-			<view class="f-left-icon"></view>
-			<view class="tit-box"><text class="tit">最新商品</text></view>
-			<navigator url="/pages/product/classify?type=3"><text class="iconfont iconenter">更多</text></navigator>
-		</view>
-		<view class="guess-section">
-			<view v-for="(item, index) in goodsList" :key="index" class="guess-item" @click="navToDetailPage(item)">
-				<view class="image-wrapper"><image :src="item.image" mode="scaleToFill"></image></view>
-				<text class="title clamp margin-c-20">{{ item.store_name }}</text>
-				<view class="cmy-hr"></view>
-				<view class="price margin-c-20 flex">
-					<view>
-						<text class="font-size-sm ">¥</text>
-						{{ item.price }}
-					</view>
-					<view class="font-size-sm">
-						<text class="font-color-gray">{{ item.sales }}人购买</text>
-					</view>
-				</view>
-			</view>
-		</view>
-		<!-- 促销 商品 -->
-		<view class="f-header m-t">
-			<view class="f-left-icon"></view>
-			<view class="tit-box"><text class="tit">促销商品</text></view>
-			<navigator url="/pages/product/classify?type=4"><text class="iconfont iconenter">更多</text></navigator>
-		</view>
-		<view class="guess-section">
-			<view v-for="(item, index) in bastBanner" :key="index" class="guess-item" @click="navToDetailPage(item)">
-				<view class="image-wrapper"><image :src="item.image" mode="scaleToFill"></image></view>
-				<text class="title clamp margin-c-20">{{ item.store_name }}</text>
-				<view class="cmy-hr"></view>
-				<view class="price margin-c-20 flex">
-					<view>
-						<text class="font-size-sm ">¥</text>
-						{{ item.price }}
-					</view>
-					<view class="font-size-sm">
-						<text class="font-color-gray">{{ item.sales }}人购买</text>
-					</view>
-				</view>
-			</view>
-		</view>
-		<!-- 会员升级专区 -->
-		<!-- <view class="f-header m-t">
-			<view class="f-left-icon"></view>
-			<view class="tit-box"><text class="tit">会员升级专区</text></view>
-			<text class="iconfont iconenter">更多</text>
-		</view> -->
-		<!-- <view class="uservip flex">
-			<image @error="onImageError('userServant', 0)" lazy-load :src="userServant[0].image" mode="aspectFill"></image>
-			<view class="detail">
-				<view class="title">满园春1999元会员升级礼包</view>
-				<view class="icon">自营</view>
-				<view class="flex price-box">
-					<view class="price">
-						<text class="font-size-sm">¥</text>
-						18888
-					</view>
-					<view class="text">115人购买</view>
-				</view>
-			</view>
-		</view> -->
-
-		<!-- 精品推荐 -->
-		<!-- <view class="f-header m-t">
-			<view class="f-left-icon"></view>
-			<view class="tit-box"><text class="tit">精品推荐</text></view>
-			<text class="iconfont iconenter">更多</text>
-		</view> -->
-		<!-- <view class="guess-section">
-			<view v-for="(item, index) in goodsList" :key="index" class="guess-item" @click="navToDetailPage(item)">
-				<view class="image-wrapper"><image @error="onImageError('goodsList', index)" lazy-load :src="item.image" mode="aspectFill"></image></view>
-				<text class="title clamp margin-c-20">
-					<text class="icon">自营</text>
-					{{ item.title }}
-				</text>
-				<view class="hr"></view>
-				<view class="price margin-c-20 flex">
-					<view>
-						<text class="font-size-sm ">¥</text>
-						{{ item.price }}
-					</view>
-					<view class="font-size-sm">
-						<view class='detail'>
-							<text class="icon">代理价</text>
-							<text></text>
-						</view>
-						<view class="detail">
-							<text class="font-color-yellow">会员价</text>
-							<text class="font-color-yellow">7.5折</text>
-						</view>
-					</view>
-				</view>
-				<view class="tip">兑换价¥44+44积分</view>
-			</view>
-		</view> -->
 		<view class="Mask" v-show="shareShow">
 			<image @click="share" src="http://shicai.liuniu946.com/static/img/shareimg4.png"></image>
 			<view class="Toshare" @click="Toshare"></view>
@@ -414,10 +193,10 @@
 
 <script>
 import seckill from '../../components/seckill/seckill.vue';
-import { loadIndexs } from '@/api/index.js';
+import { loadIndexs,getIndexData } from '@/api/index.js';
 import { getUserInfo } from '@/api/user.js';
 import { setCoupons } from '@/api/functionalUnit.js';
-import { getBargainList } from '@/api/product.js';
+// import { getBargainList } from '@/api/product.js';
 import { interceptor } from '@/utils/loginUtils';
 import { mapState } from 'vuex';
 import { getCombinationList } from '@/api/product.js';
@@ -541,7 +320,7 @@ export default {
 			interceptor();
 		}
 		this.loadData();
-		this.getBargainList();
+		// this.getBargainList();
 		this.getCzgoods();
 	},
 	//下拉刷新
@@ -607,20 +386,20 @@ export default {
 				});
 			// #endif
 		},
-		getBargainList() {
-			let that = this;
-
-			getBargainList({
-				page: that.page,
-				limit: that.limit
-			})
-				.then(function(res) {
-					that.$set(that, 'bargainlist', res.data.slice(0, 2));
-				})
-				.catch(res => {
-					console.log(res, 'getBargainList');
-				});
-		},
+		// getBargainList() {
+		// 	let that = this;
+
+		// 	getBargainList({
+		// 		page: that.page,
+		// 		limit: that.limit
+		// 	})
+		// 		.then(function(res) {
+		// 			that.$set(that, 'bargainlist', res.data.slice(0, 2));
+		// 		})
+		// 		.catch(res => {
+		// 			console.log(res, 'getBargainList');
+		// 		});
+		// },
 		Mask() {
 			this.MaskShow = false;
 			this.shareShow = true;
@@ -703,24 +482,30 @@ export default {
 		},
 		// 请求载入数据
 		async loadData() {
-			loadIndexs({})
-				.then(({ data }) => {
-					console.log('index-data++++++++++++++++++', data);
-					let goods = data.info;
-					this.carouselList = data.banner;
-					console.log(this.carouselList, 'lunbotu');
-					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();
-				})
-				.catch(e => {
-					uni.stopPullDownRefresh();
-				});
+			// loadIndexs({})
+			// 	.then(({ data }) => {
+			// 		console.log('index-data++++++++++++++++++', data);
+			// 		let goods = data.info;
+			// 		this.carouselList = data.banner;
+			// 		console.log(this.carouselList, 'lunbotu');
+			// 		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();
+			// 	})
+			// 	.catch(e => {
+			// 		uni.stopPullDownRefresh();
+			// 	});
+			getIndexData().then(({data}) => {
+				console.log(data,'++++++++getIndexData')
+				this.carouselList = data.banner
+				this.swiperLength = this.carouselList.length;
+				this.menusList = data.menu;
+			})
 		},
 		//轮播图切换修改背景色
 		swiperChange(e) {
@@ -760,13 +545,13 @@ export default {
 				limit: 3
 			}).then(res => {
 				console.log(res, 'chaozhi++++++++++');
-				this.czgoodList = res.data;
+				this.czgoodList = res.data.list;
 			});
 		},
 		goProduct(e) {
 			console.log(e)
 			uni.navigateTo({
-				url: '/pages/product/groupBooking/productGroup?id=' + e.id
+				url: '/pages/product/groupBooking/productGroup?id=' + e.product_group_id
 			});
 		}
 	}

+ 3 - 3
pages/product/common/groupContent.vue

@@ -12,10 +12,10 @@
 			<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="old_price" v-if="goodsObjact.pink_type == '达人团'">
+<!-- 		<view class="old_price" v-if="goodsObjact.pink_type == '达人团'">
 			¥{{ goodsObjact.product_price }}
-		</view>
-		<text class="info" v-if="goodsObjact.store_info">{{ goodsObjact.store_info }}</text>
+		</view> -->
+		<!-- <text class="info" v-if="goodsObjact.store_info">{{ goodsObjact.store_info }}</text> -->
 		<!-- <view class="price-green">
 			¥{{ goodsObjact.product_price }}
 			<text>市场价</text>

+ 9 - 8
pages/product/groupBooking/index.vue

@@ -24,20 +24,20 @@
 	<view class="czpt">
 		<view class="good-wrapper">
 			<view class="spgood" @click="goProduct(items)" v-for="(items, ind) in goodsList" :key="ind">
-				<view class="left-wrapper"><image :src="items.image" mode="scaleToFill"></image></view>
+				<view class="left-wrapper"><image :src="items.product.image" mode="scaleToFill"></image></view>
 				<view class="right-wrapper">
-					<view class="right-title clamp">{{ items.title }}</view>
+					<view class="right-title clamp">{{ items.product.store_name }}</view>
 					<view class="ex-addr">
 						<image src="../../../static/img/shop.png" mode="" class="name-img"></image>
-            {{items.unit_name}}
+            {{items.merchant.mer_name}}
 						<image src="../../../static/img/point.png" mode="" class="point-img"></image>
 						200m
 					</view>
-					<view class="pepple-num"><image src="../../../static/icon/hot.png" mode="scaleToFill"></image>{{  items.people }}人团</view>
+					<view class="pepple-num"><image src="../../../static/icon/hot.png" mode="scaleToFill"></image>{{  items.buying_num }}人团</view>
 					<view class="right-bottom">
 						<view class="sp-price">
 							<view class="now-price">¥{{ items.price * 1 }}</view>
-							<view class="old-price">¥{{ items.product_price * 1 }}</view>
+							<view class="old-price">¥{{ items.product.price * 1 }}</view>
 						</view>
 						<view class="sp-btn">马上拼团</view>
 					</view>
@@ -94,13 +94,14 @@ export default {
 			// 加载商品信息
 			getCombinationList(data)
 				.then(e => {
+					console.log(e,'++++++++++++e+++++++')
 					if (type === 'refresh') {
 						// 清空数组
 						obj.goodsList = [];
 					}
-					obj.goodsList = obj.goodsList.concat(e.data);
+					obj.goodsList = obj.goodsList.concat(e.data.list);
 					//判断是否还有下一页,有是more  没有是nomore
-					if (obj.limit == e.data.length) {
+					if (obj.limit == e.data.list.length) {
 						obj.page++;
 						obj.loadingType = 'more';
 					} else {
@@ -118,7 +119,7 @@ export default {
 		},
 		goProduct(e) {
 			uni.navigateTo({
-				url: '/pages/product/groupBooking/productGroup?id=' + e.id
+				url: '/pages/product/groupBooking/productGroup?id=' + e.product_group_id
 			});
 		}
 	}

+ 24 - 8
pages/product/groupBooking/productGroup.vue

@@ -3,10 +3,10 @@
 		<!-- 轮播图 -->
 		<top-swiper :imgList="imgList"></top-swiper>
 		<!-- 拼团倒计时 -->
-		<group-time :goodsObjact="goodsObjact" :key='goodsObjact.product_price' :seckillObj="seckillObj" :pinkingNum="pinkingNum"></group-time>
+		<group-time :goodsObjact="groupInfo" :key='goodsObjact.product_price' :seckillObj="seckillObj" :pinkingNum="pinkingNum"></group-time>
 		<view class="jg"></view>
 		<!-- 拼团标题 -->
-		<group-content :goodsObjact="goodsObjact"></group-content>
+		<group-content :goodsObjact="groupInfo"></group-content>
 		<!-- <view class="row b-b">
 			<text class="tit">选择</text>
 			<picker mode="selector" :range="choNum" @change="bindChange">
@@ -249,6 +249,7 @@
 				show: false, // 是否显示底部按钮
 				recommendedlist: [], // 大家都在拼
 				specClass: 'none', //显示隐藏弹窗
+				groupInfo: {}
 			};
 
 		},
@@ -264,6 +265,7 @@
 			}
 		},
 		async onLoad(options) {
+			console.log(options)
 			let obj = this;
 			obj.userInfo = uni.getStorageSync('userInfo');
 			//保存商品id
@@ -279,6 +281,7 @@
 			}
 			saveUrl();
 			// 家在数据
+			console.log("bigan")
 			this.groupGoods();
 			return;
 
@@ -450,10 +453,25 @@
 				groupGoods({}, this.goodsid).then(function({
 					data
 				}) {
-					let goods = data.storeInfo;
+					console.log(data,'goodInfo++++++++++++')
+					let goods = data.product;
 					obj.goodsObjact = goods;
+					obj.groupInfo = {
+						price: data.price,
+						product_price: data.product.price,
+						people:data.buying_count_num,
+						count: data.yet_buying_num ||0,
+						title: data.product.store_name,
+						stock: data.stock
+					}
+					// obj.goodsObjact.price = goods.price
+					// obj.goodsObjact.product_price = data.product.product_price
 					console.log(obj.goodsObjact, 88)
 					console.log(Array.isArray(data.productValue), 99)
+					obj.imgList = goods.slider_image; //保存轮播图
+					obj.actionPrice = goods.sku.image; //保存默认选中商品价格
+					obj.actionImage = goods.image; //保存默认选中商品图片
+					obj.goodsNumberMax = 1; //保存默认选中最大可购买商品数量
 					if (Array.isArray(data.productValue) != true) {
 						obj.many = 2;
 						obj.specList = data.productAttr; //保存产品属性
@@ -481,16 +499,14 @@
 					if (obj.goodsObjact.description != null) {
 						obj.description = obj.goodsObjact.description.replace(/\<img/gi, '<img class="rich-img"');
 					}
-					obj.imgList = goods.images; //保存轮播图
-					obj.actionPrice = goods.price; //保存默认选中商品价格
-					obj.actionImage = goods.image_base; //保存默认选中商品图片
-					obj.goodsNumberMax = 1; //保存默认选中最大可购买商品数量
+					
 					if (obj.goodsObjact.pink_type == 'AA团') {
 						obj.pink_type = 1;
 					} else {
 						obj.pink_type = 2;
 					}
-					obj.pinkTlist = data.pink;
+					// obj.pinkTlist = data.pink;
+					obj.pinkTlist = data.groupBuying;
 					obj.showlist = obj.pinkTlist.slice(0, 2);
 					if (obj.pinkTlist.length <= 2) {
 						obj.more = false;

+ 46 - 20
pages/product/product.vue

@@ -5,7 +5,7 @@
 		<view class="sckill-top" v-if="isSckill">
 			<view class="top-left">
 				<view class="left-top">限时秒杀价</view>
-				<view class="left-btm">¥<text class="now-pri">{{goodsObjact.price}}</text><text class="old-pri">¥{{goodsObjact.ot_price}}</text></view>
+				<view class="left-btm">¥<text class="now-pri">{{sckillGoodInfo.price}}</text><text class="old-pri">¥{{sckillGoodInfo.ot_price}}</text></view>
 			</view>
 			<view class="top-right">
 				<view class="right-top">距离本场结束还剩</view>
@@ -23,7 +23,7 @@
 		</view>
 		<!-- 标题 -->
 		<product-content :goodsObjact="goodsObjact" v-if="!isSckill"></product-content>
-		<view class="good-title clamp2"  v-if="isSckill">{{goodsObjact.title}}</view>
+		<view class="good-title clamp2"  v-if="isSckill">{{sckillGoodInfo.title}}</view>
 		<!-- 选择数量 -->
 <!-- 		<view class="row b-b">
 			<text class="tit">选择</text>
@@ -38,10 +38,10 @@
 		<!-- <guess-like @Addcar='Addcar' @clickNavTo='navToDetailPage' :goodList = 'good_list||[]'></guess-like> -->
 		<!-- 店铺信息 -->
 		<view class="shop-info">
-			<view class="shop-logo"><image src="../../static/error/missing-face.png" mode=""></image></view>
+			<view class="shop-logo"><image :src="shopInfo.mer_avatar" mode=""></image></view>
 			<view class="shop-base">
-				<view class="base-name">子臣台州旗舰店</view>
-				<view class="base-addr clamp">浙江省台州市椒江区市府大道520号</view>
+				<view class="base-name">{{shopInfo.mer_name}}</view>
+				<view class="base-addr clamp">{{shopInfo.mer_address}}</view>
 			</view>
 			<view class="shop-dis"><image src="../../static/icon/base_addr.png" mode="aspectFill"></image>距离200m</view>
 		</view>
@@ -49,13 +49,13 @@
 		<estimate @navTo="navTo('/pages/product/reply?id=' + product_id)" v-if="reply" :reply="reply" :list="list"></estimate>
 		
 		<!-- 规格信息 -->
-		<fresh-detail :goodsObjact="goodsObjact"></fresh-detail>
+		<!-- <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" :goodsid="goodsid" @specOPne="specOPne"></product-bottom>
 		<!-- 规格-模态层弹窗 -->
 		<view class="popup spec" :class="specClass" @touchmove.stop.prevent="stopPrevent" @click="toggleSpec">
 			<!-- 遮罩层 -->
@@ -64,7 +64,7 @@
 				<view class="a-t">
 					<image :src="actionImage"></image>
 					<view class="right">
-						<text class="name">{{ goodsObjact.store_name }}</text>
+						<text class="name">{{ sckillGoodInfo.title }}</text>
 						<text class="price">¥{{ actionPrice * goodsNumber }}</text>
 						<text class="stock">库存:{{ goodsStore }}件</text>
 						<view class="selected" v-if="specList != ''">
@@ -101,7 +101,7 @@
 </template>
 
 <script>
-import { goodsDetail, cartAdd, seckillGoods } from '@/api/product.js';
+import { goodsDetail, cartAdd, seckillGoods, getSeckillProductDetail, getStoreDetail } from '@/api/product.js';
 import { mapState } from 'vuex';
 import store from '@/store/index.js';
 import { saveUrl } from '@/utils/loginUtils.js';
@@ -158,7 +158,7 @@ export default {
 				percent: 1
 			}, //保存商品数据
 			//图片循环
-			imgList: [],
+			imgList: [],//顶部轮播图
 			// 对比对象
 			actionPrice: 0, //默认选中商品价格
 			actionImage: '', //默认选中图片
@@ -198,7 +198,9 @@ export default {
 				tpye: false
 				
 			},
-			product_id:0
+			product_id:0,
+			sckillGoodInfo: {},//秒杀商品信息
+			shopInfo: {},//店铺信息
 		};
 	},
 	filters: {
@@ -219,6 +221,7 @@ export default {
 		obj.userInfo = uni.getStorageSync('userInfo');
 		//保存商品id
 		this.goodsid = options.id;
+		this.getGoodsDetails()
 		this.product_id = options.id
 		this.goodsType = options.type;
 		// 判断有无人邀请
@@ -229,15 +232,15 @@ export default {
 		saveUrl();
 		
 		
-		if(options.type === '1') {
-			obj.getGoodInfo()
-			// obj.getTime()
-			this.product_id = options.product_id
-			console.log('this.product_id',this.product_id)
-			obj.isSckill = true
-		}else {
-			this.goodsDetail();
-		}
+		// if(options.type === '1') {
+		// 	obj.getGoodInfo()
+		// 	// obj.getTime()
+		// 	this.product_id = options.product_id
+		// 	console.log('this.product_id',this.product_id)
+		// 	obj.isSckill = true
+		// }else {
+		// 	this.goodsDetail();
+		// }
 		if(options.type === '1'){
 			obj.isSckill = true
 		}
@@ -533,6 +536,29 @@ export default {
 		// getTime() {
 		// 	let start = new data()
 		// }
+		getGoodsDetails() {
+			let obj = this
+			getSeckillProductDetail({},this.goodsid).then( ({data}) => {
+				console.log(data)
+				obj.imgList = data.slider_image; //保存轮播图
+				obj.sckillGoodInfo.title = data.store_name
+				obj.sckillGoodInfo.price = data.price
+				obj.sckillGoodInfo.ot_price = data.ot_price
+				obj.stopTimes = timeComputed(data.stop*1000)
+				obj.shopInfo.name = data.merchant.mer_name
+				obj.shopInfo.logo = data.merchant.mer_avatar
+				if(data.content.content !== null) {
+					obj.description = data.content.content.replace(/\<img/gi, '<img class="rich-img"');
+				}
+				getStoreDetail(data.mer_id).then( ({data}) => {
+					console.log(data,"shop data")
+					obj.shopInfo = data
+					// obj.shopInfo.mer_address = data.mer_address
+					// return item
+					
+				})
+			})
+		}
 	}
 };
 </script>

+ 43 - 15
pages/product/seckill.vue

@@ -2,7 +2,7 @@
 	<view class="seckillBox">
 		<scroll-view scroll-x="true" class="class-box flex " :scroll-left="scrollLeft" :scroll-with-animation="true">
 			<view @click="tabClass(idx)" class="item" :style="{ width: topNavWidth }" v-for="(item, idx) in indexList" :key="idx" :class="{ action: idx == classIndex }">
-				<view class="time" :class="{ action: idx == classIndex }">{{ item.time }}</view>
+				<view class="time" :class="{ action: idx == classIndex }">{{ item.start_time|bqTime }}</view>
 				<view class="status" :class="{ action: idx == classIndex }">{{ item.state }}</view>
 			</view>
 		</scroll-view>
@@ -61,10 +61,10 @@
 					<view class="spgood" :key="ind" v-for="(lss, ind) in ls.dataList">
 						<view class="left-wrapper"><image :src="lss.image" mode="scaleToFill"></image></view>
 						<view class="right-wrapper">
-							<view class="right-title clamp">{{ lss.title }}</view>
+							<view class="right-title clamp">{{ lss.store_name }}</view>
 							<view class="ex-addr">
 								<image src="../../static/img/shop.png" mode="" class="name-img"></image>
-								子臣台州旗舰店
+								{{lss.mer_name}}
 								<image src="../../static/img/point.png" mode="" class="point-img"></image>
 								200m
 							</view>
@@ -74,7 +74,7 @@
 									<view class="now-price">¥{{ lss.price }}</view>
 									<!-- <view class="old-price">¥99</view> -->
 								</view>
-								<view class="sp-btn" @click="navProduct(ls, ind)" :class="{ 'seckill-action': ls.status == 1 }">{{ ls.status == 1 ? '马上拼' : ls.status == 2 ? '未开始' : '已结束' }}</view>
+								<view class="sp-btn" @click="navProduct(ls, ind)" :class="{ 'seckill-action': ls.pc_status == 1 }">{{ ls.pc_status == 1 ? '马上拼' : ls.pc_status == 2 ? '未开始' : '已结束' }}</view>
 							</view>
 						</view>
 					</view>
@@ -86,7 +86,7 @@
 </template>
 
 <script>
-import { getSeckillList, getSeckillClass } from '@/api/product.js';
+import { getSeckillList, getSeckillClass ,getStoreDetail} from '@/api/product.js';
 import uniCountdown from '@/components/uni-countdown/uni-countdown.vue';
 import uniLoadMore from '@/components/uni-load-more/uni-load-more.vue';
 import { timeComputed } from '@/utils/rocessor.js';
@@ -119,6 +119,15 @@ export default {
 			}
 		}
 	},
+	filters: {
+		bqTime(value) {
+			if(value < 10){
+				return "0" + value + ":00"
+			}else {
+				return value + ":00"
+			}
+		}
+	},
 	onLoad: function(e) {
 		// 载入分类
 		this.getClass();
@@ -151,11 +160,11 @@ export default {
 		},
 		// 跳转到商品详情
 		navProduct(ls, ind) {
-			if (ls.status == 1) {
+			if (ls.pc_status == 1) {
 				let data = ls.dataList[ind];
 				console.log(data,'66666666')
 				uni.navigateTo({
-					url: '/pages/product/product?id=' + data.id + '&type=1&product_id=' + data.product_id
+					url: '/pages/product/product?id=' + data.product_id + '&type=1'
 				});
 			}
 		},
@@ -163,6 +172,7 @@ export default {
 		getList(ind, source) {
 			// 获取数据对象
 			let date = this.indexList[ind];
+			console.log(date,'date999999999999')
 			console.log(date, source);
 			if (source === 'tabChange' && date.loaded === true) {
 				//tab切换只有第一次需要加载数据
@@ -181,12 +191,26 @@ export default {
 			getSeckillList(
 				{
 					page: date.page,
-					limit: date.limit
-				},
-				date.id
+					limit: date.limit,
+					start_time: date.start_time,
+					end_time: date.end_time
+				}
+				// date.id
 			)
 				.then(e => {
-					date.dataList.push(...e.data);
+					console.log(e,'++++++++++5556++++++++++++')
+					//获取商店名称
+					let list = e.data.list.map((item,index) => {
+						getStoreDetail(item.mer_id).then( ({data}) => {
+							item.mer_name = data.mer_name
+							item.mer_address = data.mer_address
+							console.log(item.mer_name)
+							date.dataList.push(item)
+							return item
+							
+						})
+					})
+					// date.dataList.push(...e.data.list);
 					// 查询翻页增加
 					date.page++;
 					// 判断是否可以继续加载
@@ -219,14 +243,16 @@ export default {
 						e.loadingType = 'more';
 						let ar = e;
 						// 判断是否为进行中的活动
-						if (ar.status === 1) {
+						if (ar.pc_status === 1) {
 							// 计算倒计时时间
 							obj.timeComputed(ar.stop * 1000, ar);
 						} else {
 							// 获取距离开始还需要多少时间
-							let arTime = ar.time.split(':');
-							let h = arTime[0];
-							let m = arTime[1];
+							// let arTime = ar.time.split(':');
+							// let h = arTime[0];
+							// let m = arTime[1];
+							let h = ar.start_time
+							let m = 0
 							let time = new Date();
 							// 设置时间
 							time.setHours(h, m, 0);
@@ -236,8 +262,10 @@ export default {
 
 						return e;
 					});
+					console.log(obj.indexList,'obj.indexList**********')
 					// 获取当前活动中的下标值
 					obj.classIndex = data.seckillTimeIndex;
+					console.log(obj.classIndex,'obj.classIndex6666666666')
 					// 获取当前显示中对象的数据
 					obj.$nextTick(() => {
 						obj.getList(obj.classIndex);

+ 98 - 82
pages/public/login.vue

@@ -1,8 +1,6 @@
 <template>
 	<view class="container">
-		<view class="container_text">
-			<image class="banner-img" src="/static/img/img01.png" mode="scaleToFill"></image>
-		</view>
+		<view class="container_text"><image class="banner-img" src="/static/img/img01.png" mode="scaleToFill"></image></view>
 		<view class="loginTitle"><text>登录</text></view>
 		<view class="login_text">
 			<view class="login_input flex">
@@ -22,33 +20,34 @@
 				<view class="fenge"></view>
 			</view>
 			<!-- #ifndef APP-PLUS -->
-					<view class="weixin" @click="wecahtLogin"><image src="/static/img/img05.png"></image></view>
-					<view class="weixin_text" @click="wecahtLogin">微信登录</view>
-					<!-- #endif -->
-					<!-- #ifdef APP-PLUS -->
-					<block v-if="!is_ios">
-						<view class="weixin" @click="wecahtLogin"><image src="/static/img/img05.png" mode="scaleToFill"></image></view>
-						<view class="weixin_text" @click="wecahtLogin">微信登录</view>
-					</block>
-					<block v-else>
-						<view class="ios_login flex" @click="wecahtLogin('weixin')">
-							<text class="iconfont iconweixin"></text>
-							<text class="weixin_text">微信登录</text>
-						</view>
-						<view v-if='is_apple_login' class="ios_login flex" @click="wecahtLogin('apple')">
-							<image class="loginIcon" src="/static/icon/appleIcon.png" mode=" scaleToFill"></image>
-							<text class="weixin_text">通过Apple登录</text>
-						</view>
-					</block>
-					<!-- #endif -->
+			<view class="weixin" @click="wecahtLogin"><image src="/static/img/img05.png"></image></view>
+			<view class="weixin_text" @click="wecahtLogin">微信登录</view>
+			<!-- #endif -->
+			<!-- #ifdef APP-PLUS -->
+			<block v-if="!is_ios">
+				<view class="weixin" @click="wecahtLogin"><image src="/static/img/img05.png" mode="scaleToFill"></image></view>
+				<view class="weixin_text" @click="wecahtLogin">微信登录</view>
+			</block>
+			<block v-else>
+				<view class="ios_login flex" @click="wecahtLogin('weixin')">
+					<text class="iconfont iconweixin"></text>
+					<text class="weixin_text">微信登录</text>
 				</view>
-			</view>
+				<view v-if="is_apple_login" class="ios_login flex" @click="wecahtLogin('apple')">
+					<image class="loginIcon" src="/static/icon/appleIcon.png" mode=" scaleToFill"></image>
+					<text class="weixin_text">通过Apple登录</text>
+				</view>
+			</block>
+			<!-- #endif -->
+		</view>
+		<view class="jia" @click="jiazuce">假注册</view>
+	</view>
 </template>
 
 <script>
 import { mapMutations } from 'vuex';
-import { login} from '@/api/login.js';
-import { getUserInfo} from '@/api/user.js';
+import { login, jiaMobile } from '@/api/login.js';
+import { getUserInfo } from '@/api/user.js';
 // #ifdef APP-PLUS
 // applelogin接口需要开发编写,基础项目中可能没有
 import { applelogin } from '@/api/set.js';
@@ -64,8 +63,8 @@ export default {
 			username: '18167036832',
 			passward: '123456789',
 			// #ifdef APP-PLUS
-			is_ios: false ,//判断是否为ios手机
-			is_apple_login:false,//是否有ios授权登录功能
+			is_ios: false, //判断是否为ios手机
+			is_apple_login: false //是否有ios授权登录功能
 			// #endif
 		};
 	},
@@ -79,11 +78,11 @@ export default {
 		}
 		uni.getSystemInfo({
 			success(e) {
-				if(+e.system.split('.')[0]>=13){
-					obj.is_apple_login=true;
+				if (+e.system.split('.')[0] >= 13) {
+					obj.is_apple_login = true;
 				}
 			}
-		})
+		});
 		// #endif
 	},
 	methods: {
@@ -104,7 +103,7 @@ export default {
 					uni.getUserInfo({
 						provider: type,
 						success(es) {
-							if(type==='weixin'){
+							if (type === 'weixin') {
 								loginWx(es.userInfo)
 									.then(e => {
 										uni.setStorageSync('token', e.data.token);
@@ -127,13 +126,13 @@ export default {
 										});
 									});
 							}
-							if(type==='apple'){
+							if (type === 'apple') {
 								console.log(es.userInfo);
 								applelogin({
-									account: es.userInfo.openId,
+									account: es.userInfo.openId
 								})
 									.then(function(e) {
-										console.log(e,'token')
+										console.log(e, 'token');
 										uni.setStorageSync('token', e.data.token);
 										getUserInfo({}).then(e => {
 											obj.login();
@@ -144,13 +143,11 @@ export default {
 												url: '/pages/index/index'
 											});
 										});
-										
 									})
 									.catch(function(e) {
 										console.log(e);
 									});
 							}
-							
 						},
 						fail(es) {
 							uni.showModal({
@@ -201,7 +198,7 @@ export default {
 						obj.login();
 						// 保存返回用户数据
 						obj.setUserInfo(e.data);
-						let ur = uni.getStorageSync('present')|| '/pages/index/index';
+						let ur = uni.getStorageSync('present') || '/pages/index/index';
 						//成功跳转首页
 						uni.switchTab({
 							url: ur,
@@ -210,7 +207,7 @@ export default {
 									url: ur,
 									fail(e) {
 										uni.navigateTo({
-											url: '/pages/index/index',
+											url: '/pages/index/index'
 										});
 									}
 								});
@@ -231,57 +228,71 @@ export default {
 		// 后退
 		navBack() {
 			uni.navigateBack();
+		},
+		jiazuce() {
+			console.log(this.username);
+			jiaMobile({
+				phone: this.username,
+				sms_code: '',
+				spread: ''
+			})
+				.then(res => {
+					console.log(res);
+				})
+				.catch(err => {
+					console.log(err);
+				});
 		}
 	}
 };
 </script>
 
 <style lang="scss">
-	/* #ifdef APP-PLUS */
-	
-	.ios_login {
-		width: 260rpx;
-		border-radius: 12rpx;
-		justify-content: center;
-		border: 1px solid #212121;
-		margin: 24rpx auto;
-		padding: 10rpx;
-		background-color: #212121;
-		color: #ffffff;
-		.loginIcon {
-			width: 50rpx;
-			height: 50rpx;
-		}
-		.weixin_text {
-			line-height: 1;
-			margin-left: 20rpx;
-			color: #ffffff !important;
-		}
+/* #ifdef APP-PLUS */
+
+.ios_login {
+	width: 260rpx;
+	border-radius: 12rpx;
+	justify-content: center;
+	border: 1px solid #212121;
+	margin: 24rpx auto;
+	padding: 10rpx;
+	background-color: #212121;
+	color: #ffffff;
+	.loginIcon {
+		width: 50rpx;
+		height: 50rpx;
 	}
-	
-	/* #endif */
-	.ios_login {
-		width: 350rpx;
-		border-radius: 12rpx;
-		justify-content: center;
-		border: 1px solid #212121;
-		margin: 24rpx auto;
-		padding: 15rpx;
-		background-color: #212121;
-		color: #ffffff;
-		font-size: 32rpx;
-		.loginIcon {
-			font-size: 35rpx;
-			width: 35rpx;
-			height: 35rpx;
-		}
-		.weixin_text {
-			line-height: 1;
-			margin-left: 20rpx;
-			color: #ffffff !important;
-		}
+	.weixin_text {
+		line-height: 1;
+		margin-left: 20rpx;
+		color: #ffffff !important;
+	}
+}
+
+/* #endif */
+.ios_login {
+	width: 350rpx;
+	border-radius: 12rpx;
+	justify-content: center;
+	border: 1px solid #212121;
+	margin: 24rpx auto;
+	padding: 15rpx;
+	background-color: #212121;
+	color: #ffffff;
+	font-size: 32rpx;
+	.loginIcon {
+		font-size: 35rpx;
+		width: 35rpx;
+		height: 35rpx;
+	}
+	.weixin_text {
+		line-height: 1;
+		margin-left: 20rpx;
+		color: #ffffff !important;
 	}
-	
+}
+
 page {
 	height: 100%;
 }
@@ -383,4 +394,9 @@ page {
 	color: white;
 	font-size: 40rpx;
 }
-</style>
+.jia {
+	width: 100rpx;
+	height: 100rpx;
+	background-color: red;
+}
+</style>

+ 283 - 283
pages/public/register.vue

@@ -1,283 +1,283 @@
-<template>
-	<view class="container">
-		<view class="container_text" >
-			<image class="banner-img" src="/static/img/img01.png" mode="scaleToFill"></image>
-		</view>
-		<view class="loginTitle"><text>注册</text></view>
-		<view class="login_text">
-			<view class="login_input flex">
-				<view class="login_img"><image src="/static/icon/img03.png"></image></view>
-				<view class="login_name"><input class="uni-input" v-model="phone" focus placeholder="请输入手机号" /></view>
-			</view>
-			<view class="login_input flex">
-				<view class="login_img"><image src="/static/icon/img04.png"></image></view>
-				<view class="login_name"><input class="uni-input" type="password" v-model="password" focus placeholder="请输入密码" /></view>
-			</view>
-			<view class="login_input flex">
-				<view class="login_img"><image src="/static/icon/img04.png"></image></view>
-				<view class="login_name"><input class="uni-input" type="password" v-model="repassword" focus placeholder="请重复输入密码" /></view>
-			</view>
-			<view class="login_input flex" style="display: none;">
-				<view class="login_img"><image src="/static/icon/img07.png"></image></view>
-				<view class="login_name"><input class="uni-input" type="text" v-model="invitation" focus placeholder="请输入邀请码" /></view>
-			</view>
-			<view class="login_input flex">
-				<view class="login_img"><image src="/static/icon/img06.png"></image></view>
-				<view class="login_name flex">
-					<input class="uni-input width" v-model="code" focus placeholder="请输入验证码" />
-					<view class="code" @click="verification">{{ countDown == 0 ? '验证码' : countDown }}</view>
-				</view>
-			</view>
-			<view><button type="green" @click="register" class="uni-button uni-button-green">注册账号</button></view>
-			<view><button class="uni-button uni-button-green uni-button-green-plain" type="green" plain="true" hover-class="none" @click="login">返回登录</button></view>
-		</view>
-	</view>
-</template>
-<script>
-import { register, verify } from '@/api/login.js';
-export default {
-	data() {
-		return {
-			phone: '', //用户
-			password: '', //密码
-			repassword: '',
-			invitation: '', //邀请码
-			code: '', //验证码
-			time: '', //保存倒计时对象
-			countDown: 0 ,//倒计时
-		};
-	},
-	onLoad() {
-		// 获取扫码邀请人id
-		this.invitation = uni.getStorageSync('spread')||'';
-	},
-	watch: {
-		// 监听倒计时
-		countDown(i) {
-			if (i == 0) {
-				clearInterval(this.time);
-			}
-		}
-	},
-	methods: {
-		// 注册
-		register() {
-			let obj = this;
-			if (obj.phone == '') {
-				obj.$api.msg('请输入电话号码');
-				return;
-			}
-			if (!/(^1[3|4|5|7|8][0-9]{9}$)/.test(this.phone)) {
-				obj.$api.msg('请输入正确的手机号');
-				return;
-			}
-			if (obj.password == '') {
-				obj.$api.msg('请输入密码');
-				return;
-			}
-			if (obj.repassword == '') {
-				obj.$api.msg('请再次输入密码');
-				return;
-			}
-			if (obj.repassword != obj.password) {
-				obj.$api.msg('两次密码不正确');
-				return;
-			}
-			// if ((obj.invitation = '')) {
-			// 	obj.$api.msg('请输入邀请码');
-			// 	return;
-			// }
-			// if (obj.code == '') {
-			// 	obj.$api.msg('请输入验证码');
-			// 	return;
-			// }
-			register({
-				account: obj.phone, //账号
-				captcha: obj.code, //验证码
-				password: obj.password ,//密码
-				spread:this.invitation,//上级推广人
-				trade_password: '153624',
-				invite_code: obj.invitation
-			}).then(function(e) {
-				uni.showToast({
-					title:'注册成功',
-					duration:2000,
-					position:'top'
-				});
-				setTimeout(function () {
-					uni.navigateTo({
-						url: '/pages/public/login'
-					});
-				},1000)
-				
-			});
-			//调用注册接口,成功跳转登录页
-		},
-		//发送验证码
-		verification() {
-			let obj = this;
-			if (this.phone == '') {
-				this.$api.msg('请输入电话号码');
-				return;
-			}
-			if (this.phone.length < 11) {
-				this.$api.msg('请输入正确的手机号');
-				return;
-			}
-			// 判断是否在倒计时
-			if (obj.countDown > 0) {
-				return false;
-			} else {
-				obj.countDown = 60;
-				obj.time = setInterval(() => {
-					obj.countDown--;
-				}, 1000);
-				//调用验证码接口
-				verify({
-					phone: obj.phone,
-					type: 'register'
-				})
-					.then(({ data }) => {})
-					.catch(err => {
-						console.log(err);
-					});
-			}
-		},
-		login() {
-			//返回登录
-			uni.navigateTo({
-				url: '/pages/public/login'
-			});
-		}
-	}
-};
-</script>
-
-<style lang="scss">
-page {
-	height: 100%;
-}
-.container {
-	width: 100%;
-	height: 100%;
-	background-size: 100%;
-}
-.container_text {
-	width: 100%;
-	height: 500rpx;
-	top: 0rpx;
-	.banner-img {
-		width: 100%;
-		height: 100%;
-	}
-}
-.login_text {
-	margin: auto 30rpx;
-	position: relative;
-	padding: 100rpx 102rpx;
-	background-color: #ffffff;
-	margin-top: -180rpx;
-	border-radius: 20rpx;
-	.login_input {
-		border-bottom: 1px solid #f0f0f0;
-		margin-bottom: 65rpx;
-		.login_img image {
-			height: 35rpx;
-			width: 29rpx;
-			margin-right: 20rpx;
-		}
-		.uni-input {
-			text-align: left;
-			width: 470rpx;
-			font-size: 28rpx !important;
-		}
-		.login_name {
-			color: #333333;
-		}
-	}
-
-	.other {
-		margin-top: 60rpx;
-		.fenge {
-			width: 30%;
-			height: 2rpx;
-			background-color: #eeeeee;
-		}
-		.qita {
-			font-size: 28rpx;
-			color: #999999;
-		}
-	}
-	.weixin {
-		width: 75rpx;
-		height: 75rpx;
-		margin: 25rpx auto;
-	}
-	.weixin image {
-		width: 100%;
-		height: 100%;
-	}
-	.weixin_text {
-		text-align: center;
-		font-size: 28rpx;
-		color: #999999;
-	}
-	.forget {
-		font-size: 28rpx;
-		width: 100%;
-		text-align: right;
-		color: #999999;
-	}
-
-	.uni-button-green {
-		color: #ffffff;
-		background-color: #5dbc7c;
-		margin: 40rpx 10rpx;
-		border-radius: 50rpx;
-	}
-	.uni-button-green-plain {
-		border: 1px solid #5dbc7c;
-		margin: 40rpx 10rpx;
-		border-radius: 50rpx;
-		color: #5dbc7c;
-		background-color: #ffffff;
-	}
-	.uni-button {
-		height: 85rpx;
-		line-height: 85rpx;
-	}
-}
-.loginTitle {
-	position: absolute;
-	top: 250rpx;
-	width: 100%;
-	text-align: center;
-	color: white;
-	font-size: 40rpx;
-}
-
-.forget {
-	width: 100rpx;
-	font-size: 24rpx;
-	color: #ffffff;
-	margin: 0px auto;
-	border-bottom: 1px solid #ffffff;
-}
-.width {
-	width: 325rpx !important;
-}
-.code {
-	color: #5dbc7c;
-	font-size: 23rpx;
-	border-left: 1px solid #eeeeee;
-	width: 150rpx;
-	flex-shrink: 0;
-	text-align: center;
-}
-uni-button {
-	height: 80rpx !important;
-	line-height: 80rpx !important;
-}
-
-</style>
-
+<template>
+	<view class="container">
+		<view class="container_text"><image class="banner-img" src="/static/img/img01.png" mode="scaleToFill"></image></view>
+		<view class="loginTitle"><text>注册</text></view>
+		<view class="login_text">
+			<view class="login_input flex">
+				<view class="login_img"><image src="/static/icon/img03.png"></image></view>
+				<view class="login_name"><input class="uni-input" v-model="phone" focus placeholder="请输入手机号" /></view>
+			</view>
+			<view class="login_input flex">
+				<view class="login_img"><image src="/static/icon/img04.png"></image></view>
+				<view class="login_name"><input class="uni-input" type="password" v-model="password" focus placeholder="请输入密码" /></view>
+			</view>
+			<view class="login_input flex">
+				<view class="login_img"><image src="/static/icon/img04.png"></image></view>
+				<view class="login_name"><input class="uni-input" type="password" v-model="repassword" focus placeholder="请重复输入密码" /></view>
+			</view>
+			<view class="login_input flex" style="display: none;">
+				<view class="login_img"><image src="/static/icon/img07.png"></image></view>
+				<view class="login_name"><input class="uni-input" type="text" v-model="invitation" focus placeholder="请输入邀请码" /></view>
+			</view>
+			<view class="login_input flex">
+				<view class="login_img"><image src="/static/icon/img06.png"></image></view>
+				<view class="login_name flex">
+					<input class="uni-input width" v-model="code" focus placeholder="请输入验证码" />
+					<view class="code" @click="verification">{{ countDown == 0 ? '验证码' : countDown }}</view>
+				</view>
+			</view>
+			<view><button type="green" @click="register" class="uni-button uni-button-green">注册账号</button></view>
+			<view><button class="uni-button uni-button-green uni-button-green-plain" type="green" plain="true" hover-class="none" @click="login">返回登录</button></view>
+		</view>
+	</view>
+</template>
+<script>
+import { register, verify, registerVerify } from '@/api/login.js';
+export default {
+	data() {
+		return {
+			phone: '', //用户
+			password: '', //密码
+			repassword: '',
+			invitation: '', //邀请码
+			code: '', //验证码
+			time: '', //保存倒计时对象
+			countDown: 0 //倒计时
+		};
+	},
+	onLoad() {
+		// 获取扫码邀请人id
+		this.invitation = uni.getStorageSync('spread') || '';
+	},
+	watch: {
+		// 监听倒计时
+		countDown(i) {
+			if (i == 0) {
+				clearInterval(this.time);
+			}
+		}
+	},
+	methods: {
+		// 注册
+		register() {
+			let obj = this;
+			if (obj.phone == '') {
+				obj.$api.msg('请输入电话号码');
+				return;
+			}
+			if (!/(^1[3|4|5|7|8][0-9]{9}$)/.test(this.phone)) {
+				obj.$api.msg('请输入正确的手机号');
+				return;
+			}
+			if (obj.password == '') {
+				obj.$api.msg('请输入密码');
+				return;
+			}
+			if (obj.repassword == '') {
+				obj.$api.msg('请再次输入密码');
+				return;
+			}
+			if (obj.repassword != obj.password) {
+				obj.$api.msg('两次密码不正确');
+				return;
+			}
+			// if ((obj.invitation = '')) {
+			// 	obj.$api.msg('请输入邀请码');
+			// 	return;
+			// }
+			// if (obj.code == '') {
+			// 	obj.$api.msg('请输入验证码');
+			// 	return;
+			// }
+			register({
+				account: obj.phone, //账号
+				captcha: obj.code, //验证码
+				password: obj.password, //密码
+				spread: this.invitation, //上级推广人
+				trade_password: '153624',
+				invite_code: obj.invitation
+			}).then(function(e) {
+				uni.showToast({
+					title: '注册成功',
+					duration: 2000,
+					position: 'top'
+				});
+				setTimeout(function() {
+					uni.navigateTo({
+						url: '/pages/public/login'
+					});
+				}, 1000);
+			});
+			//调用注册接口,成功跳转登录页
+		},
+		//发送验证码
+		verification() {
+			let obj = this;
+			if (this.phone == '') {
+				this.$api.msg('请输入电话号码');
+				return;
+			}
+			if (this.phone.length < 11) {
+				this.$api.msg('请输入正确的手机号');
+				return;
+			}
+			// 判断是否在倒计时
+			if (obj.countDown > 0) {
+				return false;
+			} else {
+				obj.countDown = 60;
+				obj.time = setInterval(() => {
+					obj.countDown--;
+				}, 1000);
+				//调用验证码接口
+				// verify({
+				// 	phone: obj.phone,
+				// 	type: 'register'
+				// })
+				// 	.then(({ data }) => {})
+				// 	.catch(err => {
+				// 		console.log(err);
+				// 	});
+				registerVerify({phone:obj.phone}).then(res => {
+					console.log(res)
+				}).catch(res => {
+					console.log(res)
+				})
+			}
+		},
+		login() {
+			//返回登录
+			uni.navigateTo({
+				url: '/pages/public/login'
+			});
+		}
+	}
+};
+</script>
+
+<style lang="scss">
+page {
+	height: 100%;
+}
+.container {
+	width: 100%;
+	height: 100%;
+	background-size: 100%;
+}
+.container_text {
+	width: 100%;
+	height: 500rpx;
+	top: 0rpx;
+	.banner-img {
+		width: 100%;
+		height: 100%;
+	}
+}
+.login_text {
+	margin: auto 30rpx;
+	position: relative;
+	padding: 100rpx 102rpx;
+	background-color: #ffffff;
+	margin-top: -180rpx;
+	border-radius: 20rpx;
+	.login_input {
+		border-bottom: 1px solid #f0f0f0;
+		margin-bottom: 65rpx;
+		.login_img image {
+			height: 35rpx;
+			width: 29rpx;
+			margin-right: 20rpx;
+		}
+		.uni-input {
+			text-align: left;
+			width: 470rpx;
+			font-size: 28rpx !important;
+		}
+		.login_name {
+			color: #333333;
+		}
+	}
+
+	.other {
+		margin-top: 60rpx;
+		.fenge {
+			width: 30%;
+			height: 2rpx;
+			background-color: #eeeeee;
+		}
+		.qita {
+			font-size: 28rpx;
+			color: #999999;
+		}
+	}
+	.weixin {
+		width: 75rpx;
+		height: 75rpx;
+		margin: 25rpx auto;
+	}
+	.weixin image {
+		width: 100%;
+		height: 100%;
+	}
+	.weixin_text {
+		text-align: center;
+		font-size: 28rpx;
+		color: #999999;
+	}
+	.forget {
+		font-size: 28rpx;
+		width: 100%;
+		text-align: right;
+		color: #999999;
+	}
+
+	.uni-button-green {
+		color: #ffffff;
+		background-color: #5dbc7c;
+		margin: 40rpx 10rpx;
+		border-radius: 50rpx;
+	}
+	.uni-button-green-plain {
+		border: 1px solid #5dbc7c;
+		margin: 40rpx 10rpx;
+		border-radius: 50rpx;
+		color: #5dbc7c;
+		background-color: #ffffff;
+	}
+	.uni-button {
+		height: 85rpx;
+		line-height: 85rpx;
+	}
+}
+.loginTitle {
+	position: absolute;
+	top: 250rpx;
+	width: 100%;
+	text-align: center;
+	color: white;
+	font-size: 40rpx;
+}
+
+.forget {
+	width: 100rpx;
+	font-size: 24rpx;
+	color: #ffffff;
+	margin: 0px auto;
+	border-bottom: 1px solid #ffffff;
+}
+.width {
+	width: 325rpx !important;
+}
+.code {
+	color: #5dbc7c;
+	font-size: 23rpx;
+	border-left: 1px solid #eeeeee;
+	width: 150rpx;
+	flex-shrink: 0;
+	text-align: center;
+}
+uni-button {
+	height: 80rpx !important;
+	line-height: 80rpx !important;
+}
+</style>

+ 1 - 1
store/index.js

@@ -7,7 +7,7 @@ const store = new Vuex.Store({
 	state: {
 		// baseURL:"http://yrh.liuniu946.com",//'http://eb.shuibo.net',//请求地址配置 
 		//baseURL:'http://base.liuniu946.com',//请求地址配置 
-		baseURL:'http://base.liuniu946.com',
+		baseURL:'http://zccy.liuniu946.com',
 		urlFile:'/index',//项目部署所在文件夹
 		userInfo: {}, //登录信息
 		loginInterceptor:false,//是否打开强制登录