lhl 2 years ago
parent
commit
f404ea12ee
13 changed files with 45 additions and 1507 deletions
  1. 1 1
      App.vue
  2. 0 276
      api/activity.js
  3. 0 66
      api/functionalUnit.js
  4. 0 147
      api/order.js
  5. 0 186
      api/product.js
  6. 0 46
      api/set.js
  7. 0 104
      api/user.js
  8. 0 37
      api/wx.js
  9. 0 253
      libs/wechat.js
  10. 7 11
      pages.json
  11. 0 312
      pages/public/wxLogin.vue
  12. 33 0
      pages/user/allorder.vue
  13. 4 68
      utils/wxAuthorized.js

+ 1 - 1
App.vue

@@ -47,7 +47,7 @@ export default {
 		}
 		if (bool) {
 			// 加载微信信息
-			weixindata();
+			// weixindata();
 		}
 		// #endif
 		// #ifdef APP-PLUS

+ 0 - 276
api/activity.js

@@ -1,276 +0,0 @@
-import request from "@/utils/request.js";
-/**
- * 
- * 所有活动接口 包括:拼团,砍价,秒杀
- * 
-*/
-// 砍价产品详情
-export function getBargainDetail(data,id) {
-	return request({
-		url: '/api/bargain/detail/' + id,
-		method: 'get',
-		data
-	});
-}
-
-/**
- * 砍价产品详情
- */
-// export function getBargainDetail(id) {
-//   return request.get("bargain/detail/" + id);
-// }
-
-//砍价 砍价帮总人数、剩余金额、进度条、已经砍掉的价格
-export function postBargainHelpCount(data) {
-	return request({
-		url: '/api/bargain/help/count',
-		method: 'post',
-		data
-	});
-}
-
-/**
- * 砍价 砍价帮总人数、剩余金额、进度条、已经砍掉的价格
- */
-// export function postBargainHelpCount(data) {
-//   return request.post("bargain/help/count", data);
-// }
-
-//砍价 开启砍价用户信息
-export function postBargainStartUser(data) {
-	return request({
-		url: '/api/bargain/start/user',
-		method: 'post',
-		data
-	});
-}
-
-/**
- * 砍价 开启砍价用户信息
- */
-// export function postBargainStartUser(data) {
-//   return request.post("bargain/start/user", data);
-// }
-
-//砍价开启
-export function postBargainStart(data) {
-	return request({
-		url: '/api/bargain/start',
-		method: 'post',
-		data
-	});
-}
-
-/**
- * 砍价开启
- */
-// export function postBargainStart(bargainId) {
-//   return request.post("bargain/start", { bargainId: bargainId});
-// }
-
-// 砍价 砍掉金额
-export function postBargainHelpPrice(data) {
-	return request({
-		url: '/api/bargain/help/price',
-		method: 'post',
-		data
-	});
-}
-
-/**
- * 砍价 砍掉金额
- */
-// export function postBargainHelpPrice(data) {
-//   return request.post("bargain/help/price", data);
-// }
-
-// 砍价 帮助好友砍价
-export function postBargainHelp(data) {
-	return request({
-		url: '/api/bargain/help',
-		method: 'post',
-		data
-	});
-}
-
-/**
- * 砍价 帮助好友砍价
- */
-// export function postBargainHelp(data) {
-//   return request.post("bargain/help", data);
-// }
-
-// 砍价 砍价帮
-export function postBargainHelpList(data) {
-	return request({
-		url: '/api/bargain/help/list',
-		method: 'post',
-		data
-	});
-}
-
-
-/**
- * 砍价 砍价帮
- */
-// export function postBargainHelpList(data) {
-//   return request.post("bargain/help/list", data);
-// }
-
-// 砍价 观看/分享/参与次数
-export function postBargainShare(data) {
-	return request({
-		url: '/api/bargain/share',
-		method: 'post',
-		data
-	});
-}
-
-/**
- * 砍价 观看/分享/参与次数
- */
-// export function postBargainShare(bargainId) {
-//   return request.post("bargain/share", { bargainId: bargainId});
-// }
-
-// 砍价列表(已参与)
-export function getBargainUserList(data) {
-	return request({
-		url: '/api/bargain/user/list',
-		method: 'get',
-		data
-	});
-}
-
-/**
- * 
- * 砍价列表(已参与)
- * @param object data
-*/
-// export function getBargainUserList(data){
-//   return request.get('bargain/user/list',data);
-// }
-
-// 砍价取消
-export function getBargainUserCancel(data) {
-	return request({
-		url: '/api/bargain/user/cancel',
-		method: 'post',
-		data
-	});
-}
-
-/**
- * 砍价取消
- */
-// export function getBargainUserCancel(data) {
-//   return request.post("/bargain/user/cancel", data);
-// }
-
-
-
-
-
-/**
- * 拼团列表
- * 
-*/
-export function getCombinationList(data) {
-  return request.get('combination/list', data,{noAuth:true});
-}
-
-/**
- * 拼团详情
- * 
-*/
-export function getCombinationDetail(id) {
-  return request.get('combination/detail/'+id);
-}
-
-/**
- * 拼团 开团
- */
-export function getCombinationPink(id) {
-  return request.get("combination/pink/" + id);
-}
-
-/**
- * 拼团 取消开团
- */
-export function postCombinationRemove(data) {
-  return request.post("combination/remove",data);
-}
-
-/**
- * 砍价列表
- */
-export function getBargainList(data) {
-  return request.get("bargain/list", data,{noAuth:true});
-}
-
-
-/**
- * 
- * 取消砍价
- * @param int bargainId
-*/
-export function bargainUserCancel(bargainId){
-  return request.post('bargain/user/cancel', { bargainId: bargainId})
-}
-
-/**
- * 秒杀产品时间区间
- * 
-*/
-export function getSeckillIndexTime(){
-  return request.get('seckill/index',{},{noAuth:true});
-}
-
-/**
- * 秒杀产品列表
- * @param int time
- * @param object data
-*/
-export function getSeckillList(time,data){
-  return request.get('seckill/list/'+time,data,{noAuth:true});
-}
-
-/**
- * 秒杀产品详情
- * @param int id
-*/
-export function getSeckillDetail(id){
-  return request.get('seckill/detail/'+id);
-}
-
-/**
- * 砍价海报
- * @param object data
- * 
-*/
-export function getBargainPoster(data){
-  return request.post('bargain/poster',data)
-}
-
-/**
- * 拼团海报
- * @param object data
- * 
-*/
-export function getCombinationPoster(data){
-  return request.post('combination/poster',data)
-}
-
-/**
- * 获取秒杀小程序二维码
- */
-export function seckillCode(id,data) {
-  return request.get("seckill/code/"+id,data);
-}
-
-/**
- * 获取拼团小程序二维码
- */
-export function scombinationCode(id) {
-  return request.get("combination/code/"+id);
-}

+ 0 - 66
api/functionalUnit.js

@@ -1,66 +0,0 @@
-import request from '@/utils/request'
-
-//获取优惠券列表
-export function getCouponsList(data,types) {
-	//优惠券状态 0全部 1未使用 2已使用
-	return request({
-		url: '/api/coupons/user/'+types,
-		method: 'get',
-		data
-	});
-}
-
-//领取优惠券
-export function setCoupons(data) {
-	return request({
-		url: '/api/coupon/receive',
-		method: 'post',
-		data
-	});
-}
-
-//获取可使用优惠券
-export function couponsOrder(data,price) {
-	return request({
-		url: '/api/coupons/order/'+price,
-		method: 'get',
-		data
-	});
-}
-
-
-//	积分列表
-export function integrallist(data) {
-	return request({
-		url: '/api/integral/list',
-		method: 'get',
-		data
-	});
-}
-
-
-// 获取签到列表
-export function signList(data) {
-	return request({
-		url: '/api/sign/list',
-		method: 'get',
-		data
-	});
-}
-// 点击签到
-export function integral(data) {
-	return request({
-		url: '/api/sign/integral',
-		method: 'post',
-		data
-	});
-}
-
-// 签到信息
-export function signUser(data) {
-	return request({
-		url: '/api/sign/user',
-		method: 'post',
-		data
-	});
-}

+ 0 - 147
api/order.js

@@ -1,147 +0,0 @@
-import request from '@/utils/request'
-import {upFilse} from '@/utils/request'
-// 订单确认
-export function confirm(data) {
-	return request({
-		url: '/api/order/confirm',
-		method: 'post',
-		data
-	});
-}
-//获取可使用优惠券
-export function couponsOrder(data,price) {
-	return request({
-		url: '/api/coupons/order/'+price,
-		method: 'get',
-		data
-	});
-}
-//获取优惠券列表
-export function getCouponsList(data,types) {
-	//优惠券状态 0全部 1未使用 2已使用
-	return request({
-		url: '/api/coupons/user/'+types,
-		method: 'get',
-		data
-	});
-}
-//提交评论
-export function order_comment(data) {
-	return request({
-		url: '/api/order/comment',
-		method: 'post',
-		data
-	});
-}
-//订单产品信息
-export function product(data) {
-	return request({
-		url: '/api/order/product',
-		method: 'post',
-		data
-	});
-}
-// 快递查询
-export function express_query(data) {
-	return request({
-		url: '/api/order/express_query',
-		method: 'get',
-		data
-	});
-}
-//上传图片
-export function upload(data) {
-	return upFilse({
-		url: '/api/upload/image',
-		method: 'post',
-		data
-	});
-}
-// 订单列表
-export function orderList(data) {
-	return request({
-		url: '/api/order/list',
-		method: 'get',
-		data
-	});
-}
-// 订单详细
-export function orderDetail(data,orderid) {
-	return request({
-		url: '/api/order/detail/'+orderid,
-		method: 'get',
-		data
-	});
-}
-
-// 取消订单
-export function orderCancel(data) {
-	return request({
-		url: '/api/order/cancel',
-		method: 'post',
-		data
-	});
-}
-
-// 删除订单
-export function orderDel(data) {
-	return request({
-		url: '/api/order/del',
-		method: 'get',
-		data
-	});
-}
-// 申请退款
-export function refund(data) {
-	return request({
-		url: '/api/order/refund/verify',
-		method: 'post',
-		data
-	});
-}
-// 退款理由列表
-export function refundReason(data) {
-	return request({
-		url: '/api/order/refund/reason',
-		method: 'get',
-		data
-	});
-}
-
-// 确认收货
-export function orderTake(data) {
-	return request({
-		url: '/api/order/take',
-		method: 'post',
-		data
-	});
-}
-
-// 订单支付
-export function orderPay(data) {
-	return request({
-		url: '/api/order/pay',
-		method: 'post',
-		data
-	});
-}
-
-// 创建订单
-export function createOrderkey(data,key) {
-	return request({
-		url: '/api/order/create/'+key,
-		method: 'post',
-		data
-	});
-}
-
-// 统计订单金额
-export function computedOrderkey(data) {
-	return request({
-		url: '/api/order/computed/'+data.orderkey,
-		method: 'post',
-		data
-	});
-}
-
-

+ 0 - 186
api/product.js

@@ -1,186 +0,0 @@
-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/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
-	});
-}
-

+ 0 - 46
api/set.js

@@ -1,46 +0,0 @@
-import request from '@/utils/request'
-
-// 修改用户信息
-export function userEdit(data) {
-	return request({
-		url: '/api/user/edit',
-		method: 'post',
-		data
-	});
-}
-
-//退出登录
-export function logout(data) {
-	return request({
-		url: '/api/logout',
-		method: 'get',
-		data
-	});
-}
-//修改密码
-export function registerReset(data) {
-	return request({
-		url: '/api/register/reset',
-		method: 'post',
-		data
-	});
-}
-
-//绑定手机
-export function binding(data) {
-	return request({
-		url: '/api/binding',
-		method: 'post',
-		data
-	});
-}
-// #ifdef APP-PLUS
-//苹果生成账户
-export function applelogin(data) {
-	return request({
-		url: '/api/applelogin',
-		method: 'post',
-		data
-	});
-}
-// #endif

+ 0 - 104
api/user.js

@@ -1,104 +0,0 @@
-import request from '@/utils/request'
-
-// 订单统计信息
-export function orderData(data) {
-	return request({
-		url: '/api/order/data',
-		method: 'get',
-		data
-	});
-}
-
-// 获取用户信息
-export function getUserInfo(data) {
-	return request({
-		url: '/api/userinfo',
-		method: 'get',
-		data
-	});
-}
-
-// 用户分享图
-export function spreadBanner(data) {
-	return request({
-		url: '/api/spread/banner',
-		method: 'get',
-		data
-	});
-}
-
-// 获取地址列表
-export function getAddressList(data) {
-	return request({
-		url: '/api/address/list',
-		method: 'get',
-		data
-	});
-}
-// 修改地址
-export function addressEdit(data) {
-	return request({
-		url: '/api/address/edit',
-		method: 'post',
-		data
-	});
-}
-// 删除地址
-export function addressDel(data) {
-	return request({
-		url: '/api/address/del',
-		method: 'post',
-		data
-	});
-}
-// 设为默认地址
-export function setAddressDefault(data) {
-	return request({
-		url: '/api/address/default/set',
-		method: 'post',
-		data
-	});
-}
-// 购物车列表
-export function getCartList(data) {
-	return request({
-		url: '/api/cart/list',
-		method: 'get',
-		data
-	});
-}
-
-// 修改购物车数量
-export function getCartNum(data) {
-	return request({
-		url: '/api/cart/num',
-		method: 'post',
-		data
-	});
-}
-//删除购物车
-export function cartDel(data) {
-	return request({
-		url: '/api/cart/del',
-		method: 'post',
-		data
-	});
-}
-//获取收藏夹列表
-export function getcollectList(data) {
-	return request({
-		url: '/api/collect/user',
-		method: 'get',
-		data
-	});
-}
-// 取消收藏
-export function delcollect(data) {
-	return request({
-		url: '/api/collect/del',
-		method: 'post',
-		data
-	});
-}
-
-

+ 0 - 37
api/wx.js

@@ -1,37 +0,0 @@
-import request from '@/utils/request'
-// #ifdef H5
-// 微信分享信息
-export function share(data) {
-	return request({
-		url: '/api/share',
-		method: 'get',
-		data
-	});
-}
-//微信配置
-export function wechatConfig(data) {
-	return request({
-		url: '/api/wechat/config',
-		method: 'get',
-		data
-	});
-}
-// 微信code地址
-export function wechatAuth(data) {
-	return request({
-		url: '/api/wechat/auth',
-		method: 'get',
-		data
-	});
-}
-// #endif
-// #ifdef MP-WEIXIN
-// 微信code地址
-export function wechatMpAuth(data) {
-	return request({
-		url: '/api/wechat/mp_auth',
-		method: 'post',
-		data
-	});
-}
-// #endif

+ 0 - 253
libs/wechat.js

@@ -1,253 +0,0 @@
-// #ifdef H5
-import WechatJSSDK from "@/plugin/jweixin-module/index.js";
-// #endif
-
-import {
-	wechatConfig,
-	wechatAuth
-} from "@/api/wx.js";
-import {
-	WX_AUTH,
-	STATE_KEY,
-	LOGINTYPE,
-	BACK_URL
-} from '@/config/cache';
-import {
-	parseQuery
-} from '@/utils';
-import store from '@/store';
-import Cache from '@/utils/cache';
-
-class AuthWechat {
-	// #ifdef H5
-	constructor() {
-		//微信实例化对象
-		this.instance = WechatJSSDK;
-		//是否实例化
-		this.status = false;
-
-		this.initConfig = {};
-
-	}
-	// #endif
-	
-	isAndroid(){
-		let u = navigator.userAgent;
-		return u.indexOf('Android') > -1 || u.indexOf('Adr') > -1;
-	}
-
-	/**
-	 * 初始化wechat(分享配置)
-	 */
-	wechat() {
-		return new Promise((resolve, reject) => {
-			// if (this.status && !this.isAndroid()) return resolve(this.instance);
-			wechatConfig()
-				.then(res => {
-					this.instance.config(res.data);
-					this.initConfig = res.data;
-					this.status = true;
-					this.instance.ready(() => {
-						resolve(this.instance);
-					})
-				}).catch(err => {
-					console.log(err);
-					this.status = false;
-					reject(err);
-				});
-		});
-	}
-
-	/**
-	 * 验证是否初始化
-	 */
-	verifyInstance() {
-		let that = this;
-		return new Promise((resolve, reject) => {
-			if (that.instance === null && !that.status) {
-				that.wechat().then(res => {
-					resolve(that.instance);
-				}).catch(() => {
-					return reject();
-				})
-			} else {
-				return resolve(that.instance);
-			}
-		})
-	}
-	// 微信公众号的共享地址
-	openAddress() {
-		return new Promise((resolve, reject) => {
-			this.wechat().then(wx => {
-				this.toPromise(wx.openAddress).then(res => {
-					resolve(res);
-				}).catch(err => {
-					reject(err);
-				});
-			}).catch(err => {
-				reject(err);
-			})
-		});
-	}
-
-	/**
-	 * 微信支付
-	 * @param {Object} config
-	 */
-	pay(config) {
-		return new Promise((resolve, reject) => {
-			this.wechat().then((wx) => {
-				this.toPromise(wx.chooseWXPay, config).then(res => {
-					resolve(res);
-				}).catch(res => {
-					reject(res);
-				});
-			}).catch(res => {
-				reject(res);
-			});
-		});
-	}
-
-	toPromise(fn, config = {}) {
-		return new Promise((resolve, reject) => {
-			fn({
-				...config,
-				success(res) {
-					resolve(res);
-				},
-				fail(err) {
-					reject(err);
-				},
-				complete(err) {
-					reject(err);
-				},
-				cancel(err) {
-					reject(err);
-				}
-			});
-		});
-	}
-
-	/**
-	 * 自动去授权
-	 */
-	oAuth() {
-		if (uni.getStorageSync(WX_AUTH) && store.state.app.token) return;
-		const {
-			code
-		} = parseQuery();
-		if (!code) return this.toAuth();
-	}
-
-	clearAuthStatus() {
-
-	}
-
-	/**
-	 * 授权登陆获取token
-	 * @param {Object} code
-	 */
-	auth(code) {
-		return new Promise((resolve, reject) => {
-			let loginType = Cache.get(LOGINTYPE);
-			wechatAuth(code, parseInt(Cache.get("spread")), loginType)
-				.then(({
-					data
-				}) => {
-					let expires_time = data.expires_time.substring(0, 19);
-					expires_time = expires_time.replace(/-/g, '/');
-					expires_time = new Date(expires_time).getTime();
-					let newTime = Math.round(new Date() / 1000);
-					store.commit("LOGIN", {
-						token: data.token,
-						time: expires_time - newTime
-					});
-					Cache.set(WX_AUTH, code);
-					Cache.clear(STATE_KEY);
-					loginType && Cache.clear(LOGINTYPE);
-					resolve();
-				})
-				.catch(reject);
-		});
-	}
-
-	/**
-	 * 获取跳转授权后的地址
-	 * @param {Object} appId
-	 */
-	getAuthUrl(appId) {
-		const redirect_uri = encodeURIComponent(
-			`${location.origin}/pages/auth/index?back_url=` +
-			encodeURIComponent(
-				encodeURIComponent(
-					uni.getStorageSync(BACK_URL) ?
-					uni.getStorageSync(BACK_URL) :
-					location.pathname + location.search
-				)
-			)
-		);
-		uni.removeStorageSync(BACK_URL);
-		const state = encodeURIComponent(
-			("" + Math.random()).split(".")[1] + "authorizestate"
-		);
-		uni.setStorageSync(STATE_KEY, state);
-		return `https://open.weixin.qq.com/connect/oauth2/authorize?appid=${appId}&redirect_uri=${redirect_uri}&response_type=code&scope=snsapi_userinfo&state=${state}#wechat_redirect`;
-	}
-
-	/**
-	 * 跳转自动登陆
-	 */
-	toAuth() {
-		let that = this;
-		this.wechat().then(wx => {
-			location.href = this.getAuthUrl(that.initConfig.appId);
-		})
-	}
-
-	/**
-	 * 绑定事件
-	 * @param {Object} name 事件名
-	 * @param {Object} config 参数
-	 */
-	wechatEvevt(name, config) {
-		let that = this;
-		return new Promise((resolve, reject) => {
-			let configDefault = {
-				fail(res) {
-					console.log(res,11111);
-					if (that.instance) return reject({
-						is_ready: true,
-						wx: that.instance
-					});
-					that.verifyInstance().then(wx => {
-						return reject({
-							is_ready: true,
-							wx: wx
-						});
-					})
-				},
-				success(res) {
-					return resolve(res,2222);
-				}
-			};
-			Object.assign(configDefault, config);
-			that.wechat().then(wx => {
-				if (typeof name === 'object') {
-					name.forEach(item => {
-						wx[item] && wx[item](configDefault)
-					})
-				} else {
-					wx[name] && wx[name](configDefault)
-				}
-			})
-		});
-	}
-
-	isWeixin() {
-		return navigator.userAgent.toLowerCase().indexOf("micromessenger") !== -1;
-	}
-
-}
-
-export default new AuthWechat();
-

+ 7 - 11
pages.json

@@ -49,6 +49,7 @@
 			"path": "pages/heyue/heyue",
 			"style": {
 				"navigationBarTitleText": "合約交易",
+				"enablePullDownRefresh": false,
 				"navigationStyle": "custom"
 			}
 		},
@@ -63,17 +64,6 @@
 				"navigationBarTitleText": "登錄"
 			}
 		},
-		{
-			"path": "pages/public/wxLogin",
-			"style": {
-				"navigationBarTitleText": "微信登录",
-				"app-plus": {
-					"titleNView": {
-						"type": "transparent"
-					}
-				}
-			}
-		},
 		{
 			"path": "pages/public/forget",
 			"style": {
@@ -91,6 +81,12 @@
 			"style": {
 				"navigationBarTitleText": ""
 			}
+		},
+		{
+			"path": "pages/user/allorder",
+			"style": {
+				"navigationBarTitleText": ""
+			}
 		}
 	],
 	"globalStyle": {

+ 0 - 312
pages/public/wxLogin.vue

@@ -1,312 +0,0 @@
-<template>
-	<view class="content">
-		<!-- #ifdef MP -->
-		<image class="bg-img" :src="/static/img/img09.png" mode=" scaleToFill"></image>
-		<view class="logo-img-box">
-			<image class="logo-img" src="/static/img/img10.png" mode=" aspectFit"></image>
-			<button class="userInfo" type="warn" open-type="getUserInfo" @getuserinfo="userInfoData">
-				<text class="iconfont iconweixin"></text>
-				<text>微信授权登录</text>
-			</button>
-		</view>
-		<!-- #endif -->
-		<view class="Mask" v-show="MaskShow">
-			<view class="Mask-box">
-				<view class="title">申请获取您的手机号</view>
-				<view class="text">为了方便您的取货和我们的送货,并获取更多优惠活动,需要您的手机授权</view>
-				<view class="btn_box">
-					<button class="weixin" @click="ToIndex()">取消</button>
-					<button class="weixin" open-type="getPhoneNumber" @getphonenumber="PhoneNumber">手机号授权</button>
-				</view>
-			</view>
-		</view>
-	</view>
-</template>
-
-<script>
-// #ifdef H5
-import { loginWinxin } from '@/utils/wxAuthorized';
-// #endif
-// #ifdef MP-WEIXIN
-import { wechatMpAuth } from '@/api/wx';
-// #endif
-import { mapMutations } from 'vuex';
-import { getUserInfo, bangding } from '@/api/login.js';
-export default {
-	data() {
-		return {
-			userInfo: {}, //授权用户信息
-			code: '', //授权code
-			loding: false, //判断是否在点击中
-			MaskShow: false // 手机号授权弹窗
-		};
-	},
-	onLoad(option) {
-		this.loadData();
-	},
-	methods: {
-		loadData() {
-			// #ifdef H5
-			loginWinxin();
-			// #endif
-		},
-		// #ifndef H5
-		// 用户确认授权
-		userInfoData(e) {
-			const that = this;
-			// #ifdef MP-WEIXIN
-			if (!this.loding) {
-				uni.showModal({
-					title: '温馨提示',
-					content: '亲,授权微信登录后才能正常使用小程序功能',
-					success: res => {
-						if (res.confirm) {
-							wx.getUserProfile({
-								desc: '用于完善会员资料', // 声明获取用户个人信息后的用途,后续会展示在弹窗中,请谨慎填写
-								success: res => {
-									that.userInfo = res;
-									that.loadMp();
-								},
-								fail: err => {
-									uni.showToast({
-										title: '您拒绝了请求,不能正常使用小程序',
-										icon: 'error',
-										duration: 2000
-									});
-									return;
-								}
-							});
-						} else if (res.cancel) {
-							//如果用户点击了取消按钮
-							uni.showToast({
-								title: '您拒绝了请求,不能正常使用小程序',
-								icon: 'error',
-								duration: 2000
-							});
-							return;
-						}
-					}
-				});
-			}
-			// #endif
-		},
-		// #endif
-		// #ifdef MP-WEIXIN
-		loadMp(option) {
-			let obj = this;
-			obj.loding = true;
-			// 获取登录授权页数据
-			let user = obj.userInfo;
-			// 获取推广人id
-			let spread_spid = uni.getStorageSync('spread') || '';
-			// let spread_code = uni.getStorageSync('spread_code') || '';
-			uni.showLoading({
-				title: '授权中',
-				mask: true
-			});
-			wx.login({
-				success(e) {
-					wechatMpAuth({
-						code: e.code,
-						iv: user.iv,
-						encryptedData: user.encryptedData,
-						spread_spid: spread_spid,
-						// #ifdef MP
-						spread_code: spread_code
-						// #endif
-					})
-						.then(({ data }) => {
-							obj.loding = false;
-							obj.wchatAuth(data);
-							console.log(data);
-						})
-						.catch(e => {
-							obj.loding = false;
-							uni.hideLoading();
-						});
-				},
-				fill: function(e) {
-					obj.loding = false;
-					console.log(e);
-				}
-			});
-		},
-		wchatAuth(data) {
-			let obj = this;
-			// 保存token
-			uni.setStorageSync('token', data.token);
-			// 获取用户基础信息
-			getUserInfo({})
-				.then(e => {
-					uni.hideLoading();
-					obj.login();
-					// 保存返回用户数据
-					obj.setUserInfo(e.data);
-					obj.ToIndex();
-					// if (e.data.phone == null || !e.data.phone ) {
-					// 	obj.MaskShow = true;
-					// } else {
-					// 	obj.ToIndex();
-					// }
-				})
-				.catch(e => {
-					uni.hideLoading();
-				});
-		},
-		// #endif
-		ToIndex() {
-			let obj = this;
-			let ur = uni.getStorageSync('present') || '/pages/index/index';
-			// 用于处理缓存bug
-			if (ur == 'pages/product/product') {
-				ur = '/pages/index/index';
-			}
-			uni.switchTab({
-				url: ur,
-				fail(e) {
-					uni.navigateTo({
-						url: ur,
-						fail(e) {
-							uni.navigateTo({
-								url: '/pages/index/index'
-							});
-						}
-					});
-				}
-			});
-		},
-		// 绑定手机号
-		PhoneNumber(e) {
-			let obj = this;
-			obj.MaskShow = false;
-			(obj.iv = e.detail.iv), (obj.encryptedData = e.detail.encryptedData);
-
-			uni.setStorageSync('code', obj.code);
-			bangding({
-				flag: 1,
-				cache_key: obj.cache_key,
-				code: obj.code,
-				iv: obj.iv,
-				encryptedData: obj.encryptedData
-			}).then(function(e) {
-				if (e.data.is_bind == 1) {
-					console.log('bangding1');
-					bangding({
-						flag: 1,
-						cache_key: obj.cache_key,
-						code: obj.code,
-						iv: obj.iv,
-						encryptedData: obj.encryptedData,
-						step: 1
-					})
-						.then(function(e) {
-							// 获取用户基础信息
-							obj.GetUser();
-							obj.$api.msg(e.msg);
-							obj.$nextTick(function() {
-								obj.ToIndex();
-							});
-						})
-						.catch(e => {
-							console.log(e);
-						});
-				} else {
-					console.log('bangding2');
-					obj.$api.msg(e.msg);
-					// 获取用户基础信息
-					obj.GetUser();
-					obj.$api.msg(e.msg);
-					obj.$nextTick(function() {
-						obj.ToIndex();
-					});
-				}
-			});
-		},
-		GetUser() {
-			// 获取用户基础信息
-			getUserInfo({})
-				.then(({ data }) => {
-					this.setUserInfo(data);
-					console.log(data, 11);
-					console.log(uni.getStorageSync('userInfo'), 55);
-				})
-				.catch(e => {
-					console.log(e);
-				});
-		}
-	}
-};
-</script>
-
-<style lang="scss">
-page,
-.content {
-	height: 100%;
-}
-
-.Mask {
-	position: fixed;
-	top: 0;
-	width: 100%;
-	height: 100%;
-	background-color: rgba(51, 51, 51, 0.7);
-	.Mask-box {
-		margin: auto;
-		margin-top: 320rpx;
-		padding: 50rpx 30rpx;
-		width: 90%;
-		height: 450rpx;
-		top: 500rpx;
-		left: 10%;
-		background-color: #ffffff;
-		border-radius: 15rpx;
-		.title {
-			text-align: center;
-			font-size: 35rpx;
-			font-weight: 700;
-		}
-		.text {
-			font-size: 30rpx;
-			color: #848484;
-			padding-top: 50rpx;
-		}
-		.btn_box {
-			margin: 70rpx 0 0 0;
-			display: flex;
-			align-items: center;
-			justify-content: space-between;
-		}
-	}
-}
-
-.weixin {
-	// background: linear-gradient(90deg, rgba(36, 214, 78, 1), rgba(45, 187, 89, 1));
-	background: $base-color;
-	width: 40%;
-	color: #ffffff;
-	border-radius: 50rpx;
-	border: none;
-	margin: 0 20rpx;
-}
-.bg-img,
-.logo-img-box {
-	position: absolute;
-	top: 0;
-	left: 0;
-	width: 100%;
-	height: 100%;
-}
-.logo-img {
-	margin-top: 20vh;
-	margin-left: 176rpx;
-	width: 385rpx;
-	height: 394rpx;
-}
-.userInfo {
-	margin: 0 100rpx;
-	margin-top: 50rpx;
-	color: #ffffff;
-	border-radius: 99rpx;
-	background-color: $base-color !important;
-}
-</style>

+ 33 - 0
pages/user/allorder.vue

@@ -0,0 +1,33 @@
+<template>
+	<view class="content">
+
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+
+			}
+		},
+		onLoad() {
+
+		},
+		onShow() {
+
+		},
+		onReachBottom() {
+
+		},
+		onReady() {
+
+		},
+		methods: {
+
+		}
+	}
+</script>
+
+<style lang="scss">
+</style>

+ 4 - 68
utils/wxAuthorized.js

@@ -1,7 +1,7 @@
-import {
-	wechatConfig,
-	share
-} from '@/api/wx';
+// import {
+// 	wechatConfig,
+// 	share
+// } from '@/api/wx';
 // 加载日志
 import * as log from './log.js'
 import {
@@ -73,70 +73,6 @@ function weixinSq() {
 	}
 };
 
-// 微信注册
-export async function weixindata(config) {
-	let url;
-	try {
-		// 判断是否存在router
-		if (!router) {
-			router = await setRouter();
-		}
-		if (router.mode === "history") {
-			// 在ios中时候注册为微信刚进入时候的页面
-			if (!window.entryUrl) {
-				window.entryUrl = location.href.split('#')[0]
-			}
-			url = isAndroid() ? location.href.split('#')[0] : window.entryUrl;
-		}
-		if (router.mode === "hash") {
-			url = location.href.split('#')[0];
-		}
-		log.addLog('注册开始', url)
-		console.log('开始注册', url);
-
-	} catch (e) {
-		console.log('错误', e);
-	}
-	return new Promise((ok, error) => {
-		try {
-			//注册微信信息
-			wechatConfig({
-					url
-				})
-				.then(({
-					data
-				}) => {
-					try {
-						// 保存appId
-						appId = data.appId
-						// 微信信息配置
-						weixinObj.config({
-							debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
-							appId: data.appId, // 必填,企业号的唯一标识,此处填写企业号corpid
-							timestamp: data.timestamp, // 必填,生成签名的时间戳
-							nonceStr: data.nonceStr, // 必填,生成签名的随机串
-							signature: data.signature, // 必填,签名,见附录1
-							jsApiList: data.jsApiList // 必填,需要使用的JS接口列表,所有JS接口列表见附录2
-						});
-						weixinObj.ready((e) => {
-							log.addLog("注册完毕", data)
-							console.log('注册完毕');
-							ok(data)
-						})
-					} catch (e) {
-						console.log(e)
-					}
-				})
-				.catch(e => {
-					error(e);
-					console.log(e);
-				});
-		} catch (e) {
-			console.log(e);
-			//TODO handle the exception
-		}
-	})
-}
 
 // 判断分享调用方法
 export function shareLoad(config) {