2312970463@qq.com 4 年之前
父节点
当前提交
6078600963

+ 1 - 0
components/Authorize.vue

@@ -99,6 +99,7 @@ export default {
 				.then(res => {
 					console.log('获取授权信息',res);
 					// #ifdef MP-TOUTIAO
+						// console.log("获取授权信息toutiao")
 						this.getUserInfo();
 					// #endif
 					// #ifdef MP-WEIXIN

+ 4 - 1
components/addressWindow/index.vue

@@ -55,7 +55,10 @@
 				is_loading: true
 			};
 		},
-
+		mounted(){
+			console.log('dd')
+			this.getAddressList()
+		},
 		methods: {
 			tapAddress: function(e, addressid) {
 				this.active = e;

+ 10 - 2
libs/routine.js

@@ -28,14 +28,18 @@ class Routine
 		return new Promise( (resolve,reject) => {
 			// console.log(code);
 			uni.getUserInfo({
+				// withCredentials:true,
+				// #ifndef MP-TOUTIAO
 				lang: 'zh_CN',
+				// #endif
 				success(user) {
 					// console.log(user);
 					if(code) user.code = code;
-					// console.log(user);
+					// console.log(user.rawData);
 					resolve({userInfo:user,islogin:false});
 				},
 				fail(res){
+					console.log(res,"getUserInfo--------err")
 					reject(res);
 				}
 			})
@@ -57,8 +61,9 @@ class Routine
 			uni.authorize({
 			    scope: that.scopeUserInfo,
 			    success(res) {
+					console.log(res,'uni.authorize++++++++++');
 					// #ifdef MP-TOUTIAO
-					console.log(res);
+					console.log(res,'uni.authorize++++++++++');
 					resolve({islogin:false},res.data);
 					// #endif
 					// #ifdef MP-WEIXIN
@@ -66,6 +71,7 @@ class Routine
 					// #endif
 			    },
 				fail(res){
+					console.log('uni.authorize-------------')
 					reject(res);
 				}
 			})
@@ -151,6 +157,7 @@ class Routine
 	{
 		return new Promise((resolve, reject)=>{
 			login(data).then(res=>{
+				console.log("login",res)
 				let time = res.data.expires_time - Cache.time();
 				store.commit('UPDATE_USERINFO', res.data.user);
 				store.commit('LOGIN', {token:res.data.token, time:time});
@@ -159,6 +166,7 @@ class Routine
 				Cache.set(USER_INFO,res.data.userInfo,time);
 				return resolve(res);
 			}).catch(res=>{
+				console.log("7777777777777")
 				return reject(res);
 			})
 		})

+ 13 - 4
pages/user/index.vue

@@ -138,10 +138,6 @@
 				</view>
 			</view>
 		</view>
-		<view class="copy-right">
-			<view class="iconfont icon-crmeb"></view>
-			<view class="text">众邦科技提供技术支持</view>
-		</view>
 		<view style="height: 50rpx;"></view>
 		<!-- #ifdef MP -->
 		<authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize>
@@ -343,6 +339,19 @@
 					that.userInfo = res.data,
 						that.is_promoter = res.data.is_promoter
 						that.extension_status = res.data.extension_status
+						console.log(that.userInfo,'that.userInfo++++++')
+						if(that.userInfo.phone){
+							uni.showModal({
+								title: "请绑定手机号",
+								content: "为了方便您的取货和我们的送货,并获取更多优惠活动,需要您的手机授权!",
+								showCancel: false,
+								// complete() {
+								// 	uni.navigateTo({
+								// 		url: '/pages/users/user_phone/index'
+								// 	})
+								// }
+							})
+						}
 				});
 			},
 			// 订单数字

+ 14 - 8
pages/users/order_confirm/index.vue

@@ -501,8 +501,10 @@
 			this.textareaStatus = true;
 			if (this.isLogin && this.toPay == false && !this.orderPay) {
 				this.getaddressInfo();
-				this.$nextTick(function() {
-					this.$refs.addressWindow.getAddressList();
+				this.$nextTick(function() {
+					console.log('1')
+					// this.$refs.addressWindow.getAddressList();
+					console.log('2')
 					this.getUserInfo()
 				})
 			}
@@ -524,8 +526,9 @@
 				if(!that.go_map && !that.orderPay){
 					that.getaddressInfo();
 				}
-				that.$nextTick(function() {
-					that.$refs.addressWindow.getAddressList();
+				that.$nextTick(function() {
+					
+					// that.$refs.addressWindow.getAddressList();
 					that.getUserInfo()
 				})
 			})
@@ -562,8 +565,9 @@
 			// 获取个人信息
 			getUserInfo() {
 				getUserInfo().then(res => {
-					// console.log(res)
-					this.userInfo = res.data
+					console.log(res,"+++++++++++++++userInfo")
+					this.userInfo = res.data
+					
 				})
 			},
 
@@ -908,7 +912,8 @@
 				let that = this;
 				that.animated = false;
 			},
-			onAddress: function() {
+			onAddress: function() {
+				console.log("555555555555")
 				let that = this;
 				that.textareaStatus = false;
 				that.address.address = true;
@@ -941,6 +946,7 @@
 						callback_key = res.data.result.pay_key,
 						jsConfig = res.data.result.config,
 						goPages = '/pages/order_pay_status/index?order_id=' + orderId + '&msg=' + res.message;
+						console.log(jsConfig,'jsConfig+++++++++')
 						that.orderPay = true;
 					switch (status) {
 						case 'ORDER_EXIST':
@@ -1115,7 +1121,7 @@
 				}
 			},
 			SubOrder: function(e) {
-
+				this.payType="h5"
 				let that = this,
 					data = {};
 				if (!that.payType) return that.$util.Tips({

+ 2 - 1
pages/users/order_list/index.vue

@@ -477,7 +477,8 @@
 			 * 
 			 */
 			goPay: function(pay_price, order_id) {
-				console.log(order_id)
+				console.log(order_id)
+				console.log(pay_price,"pay_price")
 				this.$set(this, 'pay_close', true);
 				this.order_id = order_id;
 				this.pay_order_id = order_id.toString()

+ 133 - 114
utils/SubscribeMessage.js

@@ -1,115 +1,134 @@
-import {
-	SUBSCRIBE_MESSAGE
-} from '../config/cache.js';
-
-export function auth() {
-	let tmplIds = {};
-	let messageTmplIds = uni.getStorageSync(SUBSCRIBE_MESSAGE);
-	console.log(messageTmplIds,'messageTmplIds')
-	tmplIds = messageTmplIds ? messageTmplIds : {};
-	return tmplIds;
-}
-
-/**
- * 支付成功后订阅消息id
- * 订阅  订单支付成功 订单发货提醒(快递)  订单发货提醒(送货) 
- */
-export function openPaySubscribe() {
-	let tmplIds = auth();
-	return subscribe([
-		tmplIds.ORDER_POSTAGE_SUCCESS ,
-		tmplIds.ORDER_DELIVER_SUCCESS,
-		tmplIds.ORDER_PAY_SUCCESS,
-	]); 
-}
-
-/**
- * 订单相关订阅消息
- * 送货 发货
- */
-export function openOrderSubscribe() {
-	let tmplIds = auth();
-	return subscribe([
-		tmplIds.ORDER_DELIVER_SUCCESS,
-		tmplIds.ORDER_POSTAGE_SUCCESS,
-	]);
-}
-
-/**
- * 提现消息订阅
- * 成功 和 失败 消息
- */
-export function openExtrctSubscribe() {
-	let tmplIds = auth();
-	return subscribe([
-		tmplIds.user_extract
-	]);
-}
-
-/**
- * 拼团成功
- */
-export function openPinkSubscribe() {
-	let tmplIds = auth();
-	return subscribe([
-		tmplIds.pink_true
-	]);
-}
-
-/**
- * 砍价成功
- */
-export function openBargainSubscribe() {
-	let tmplIds = auth();
-	return subscribe([
-		tmplIds.bargain_success
-	]);
-}
-
-/**
- * 订单退款
- */
-export function openOrderRefundSubscribe() {
-	let tmplIds = auth();
-	return subscribe([tmplIds.ORDER_REFUND_NOTICE]);
-}
-
-/**
- * 充值成功
- */
-export function openRechargeSubscribe() {
-	let tmplIds = auth();
-	return subscribe([tmplIds.RECHARGE_SUCCESS]);
-}
-
-/**
- * 提现
- */
-export function openEextractSubscribe() {
-	let tmplIds = auth();
-	return subscribe([tmplIds.USER_EXTRACT]);
-}
-
-/**
- * 调起订阅界面
- * array tmplIds 模板id
- */
-export function subscribe(tmplIds) {
-	 let wecaht = wx;
-	return new Promise((reslove, reject) => {
-		uni.requestSubscribeMessage({
-			tmplIds: tmplIds,
-			success(res) {
-				console.log(res,'requestSubscribeMessage')
-				return reslove(res);
-			},
-			fail(res) {
-				console.log(res,'fail')
-				return reslove(res);
-			},
-			complete(res){
-				console.log(res,'complete')
-			}
-		})
-	});
+import {
+	SUBSCRIBE_MESSAGE
+} from '../config/cache.js';
+
+export function auth() {
+	let tmplIds = {};
+	let messageTmplIds = uni.getStorageSync(SUBSCRIBE_MESSAGE);
+	console.log(messageTmplIds, 'messageTmplIds')
+	tmplIds = messageTmplIds ? messageTmplIds : {};
+	return tmplIds;
+}
+
+/**
+ * 支付成功后订阅消息id
+ * 订阅  订单支付成功 订单发货提醒(快递)  订单发货提醒(送货) 
+ */
+export function openPaySubscribe() {
+	let tmplIds = auth();
+	return subscribe([
+		tmplIds.ORDER_POSTAGE_SUCCESS,
+		tmplIds.ORDER_DELIVER_SUCCESS,
+		tmplIds.ORDER_PAY_SUCCESS,
+	]);
+}
+
+/**
+ * 订单相关订阅消息
+ * 送货 发货
+ */
+export function openOrderSubscribe() {
+	let tmplIds = auth();
+	return subscribe([
+		tmplIds.ORDER_DELIVER_SUCCESS,
+		tmplIds.ORDER_POSTAGE_SUCCESS,
+	]);
+}
+
+/**
+ * 提现消息订阅
+ * 成功 和 失败 消息
+ */
+export function openExtrctSubscribe() {
+	let tmplIds = auth();
+	return subscribe([
+		tmplIds.user_extract
+	]);
+}
+
+/**
+ * 拼团成功
+ */
+export function openPinkSubscribe() {
+	let tmplIds = auth();
+	return subscribe([
+		tmplIds.pink_true
+	]);
+}
+
+/**
+ * 砍价成功
+ */
+export function openBargainSubscribe() {
+	let tmplIds = auth();
+	return subscribe([
+		tmplIds.bargain_success
+	]);
+}
+
+/**
+ * 订单退款
+ */
+export function openOrderRefundSubscribe() {
+	let tmplIds = auth();
+	return subscribe([tmplIds.ORDER_REFUND_NOTICE]);
+}
+
+/**
+ * 充值成功
+ */
+export function openRechargeSubscribe() {
+	let tmplIds = auth();
+	return subscribe([tmplIds.RECHARGE_SUCCESS]);
+}
+
+/**
+ * 提现
+ */
+export function openEextractSubscribe() {
+	let tmplIds = auth();
+	return subscribe([tmplIds.USER_EXTRACT]);
+}
+
+/**
+ * 调起订阅界面
+ * array tmplIds 模板id
+ */
+export function subscribe(tmplIds) {
+	let wecaht = wx;
+	return new Promise((reslove, reject) => {
+		// #ifdef MP-WEIXIN
+		uni.requestSubscribeMessage({
+			tmplIds: tmplIds,
+			success(res) {
+				console.log(res, 'requestSubscribeMessage')
+				return reslove(res);
+			},
+			fail(res) {
+				console.log(res, 'fail')
+				return reslove(res);
+			},
+			complete(res) {
+				console.log(res, 'complete')
+			}
+		})
+		// #endif
+		// #ifdef MP-TOUTIAO
+		uni.requestSubscribeMessage({
+			tmplIds: tmplIds,
+			success(res) {
+				console.log(res, 'requestSubscribeMessage')
+				return reslove(res);
+			},
+			fail(res) {
+				console.log(res, 'fail')
+				return reslove(res);
+			},
+			complete(res) {
+				console.log(res, 'complete')
+			}
+		})
+		// #endif
+
+	});
 }