lhl 2 rokov pred
rodič
commit
11bf00004a

+ 7 - 3
components/payment/payment.vue

@@ -109,9 +109,10 @@
 				}
 			});
 			let config = that.$init_config(1, function(res) {
+				console.log(res,'res');
 				if (res && res.app) {
-					that.weixinpay2 = res.app.pay.wx.isopen;
-					that.alipay2 = res.app.pay.ali.isopen;
+					// that.weixinpay2 = res.app.pay.wx.isopen;
+					// that.alipay2 = res.app.pay.ali.isopen;
 				}
 			});
 		},
@@ -192,8 +193,10 @@
 			},
 			paywx() {
 				let that = this;
+				console.log(this.channel,'channel',that.params);
 				if (that.channel == 1) {
 					that.$paycenter.paygood(that.params).then(res => {
+						console.log(res,'支付回调');
 						if (res.status === 0 || res.code === 0) {
 							uni.showToast({
 								title: res.msg,
@@ -599,9 +602,10 @@
 
 			wxPayH5(paydata) {
 				let that = this;
+				console.log(paydata,'paydata.appid');
 				wx.config({
 					debug: false,
-					appId: paydata.appid, // 必填,公众号的唯一标识
+					appId: paydata.appId, // 必填,公众号的唯一标识
 					timestamp: paydata.timeStamp, // 必填,生成签名的时间戳
 					nonceStr: paydata.nonceStr, // 必填,生成签名的随机串
 					signature: paydata.paySign,

+ 4 - 0
js/util.js

@@ -211,6 +211,7 @@ util.request = function (option) {
 			if (response.data.errno) {
 				if (response.data.errno == '41009') {
 					wx.setStorageSync('userInfo', '');
+					uni.setStorageSync('userInfo', '');
 					util.getUserInfo(function () {
 						util.request(option)
 					});
@@ -291,10 +292,12 @@ util.getUserInfo = function (cb) {
 						if (!session.data.errno) {
 							userInfo.sessionid = session.data.data.sessionid
 							wx.setStorageSync('userInfo', userInfo);
+							uni.setStorageSync('userInfo', userInfo);
 							wx.getUserInfo({
 								success: function (wxInfo) {
 									userInfo.wxInfo = wxInfo.userInfo
 									wx.setStorageSync('userInfo', userInfo);
+									uni.setStorageSync('userInfo', userInfo);
 									util.request({
 										url: 'auth/session/userinfo',
 										data: {
@@ -312,6 +315,7 @@ util.getUserInfo = function (cb) {
 											if (!res.data.errno) {
 												userInfo.memberInfo = res.data.data;
 												wx.setStorageSync('userInfo', userInfo);
+												uni.setStorageSync('userInfo', userInfo);
 											}
 											typeof cb == "function" && cb(userInfo);
 										}

+ 10 - 0
pagesD/pages/product/product.vue

@@ -351,7 +351,12 @@
 				if (index == 1) {
 					if (this.specClass === 'show') {
 						this.stock();
+						// #ifdef MP-WEIXIN
 						let id = uni.getStorageSync('userInfo').id;
+						// #endif
+						// #ifdef H5
+						let id = uni.getStorageSync('userInfo').userinfo.id || uni.getStorageSync('userInfo').id;
+						// #endif
 						let obj = {
 							sid: 0,
 							goodstype: this.cache.type,
@@ -390,7 +395,12 @@
 				if (index == 2) {
 					if (this.specClass === 'show') {
 						this.stock();
+						// #ifdef MP-WEIXIN
 						let id = uni.getStorageSync('userInfo').id;
+						// #endif
+						// #ifdef H5
+						let id = uni.getStorageSync('userInfo').userinfo.id || uni.getStorageSync('userInfo').id;
+						// #endif
 						let obj = {
 							sid: 0,
 							goodstype: this.cache.type,