xuqiaoying před 3 roky
rodič
revize
e9356c37b4

+ 3 - 0
pages3/live/detail.vue

@@ -612,6 +612,7 @@ export default {
     ...mapGetters(["userInfo", "playSectionId", "playChannelId", "playVID"]),
   },
   onLoad(option) {
+    console.log('option====', option)
     this.courseId = Number(option.courseId);
     this.goodsId = Number(option.goodsId);
 		// this.gradeId = option.gradeId || 0
@@ -1840,6 +1841,7 @@ export default {
     },
     getGoodsDetail() {
       let self = this;
+      // app/common/goods/'+ data
       this.$api.goodsDetail(this.goodsId).then((res) => {
         self.goodsData = res.data.data;
         console.log(self.gradeId, "班级ID");
@@ -1914,6 +1916,7 @@ export default {
     },
     courseDetail() {
       let self = this;
+      // /course/'+data 获取课程详细信息
       this.$api.courseDetail(this.courseId).then((res) => {
         if (res.data.code == 200) {
           // if (res.data.data.educationName == "继续教育") {

+ 23 - 14
pages4/login/login.vue

@@ -128,27 +128,36 @@ export default {
 		} else if (option.scanCode) {
 			this.scanCode = option.scanCode
 		}
-		let that = this;
 		// this.from = option.from; 
-		uni.login({
-			provider: 'weixin',
-			success: function(loginRes) {
-				that.code = loginRes.code;
-			}
-		});
+		
+	},
+	onShow() {
+		// 获取code
+		this.getwxCode()
 	},
-	mounted() {},
 	methods: {
+		getwxCode() {
+			uni.login({
+				provider: 'weixin',
+				success: (loginRes) => {
+					this.code = loginRes.code
+					console.log('获取的code:', this.code)
+				}
+			})
+		},
 		wxLogin(e) {
-			
-			console.log(e)
-						
+			console.log('eeeee:', e, this.code)
 			this.$api.wxLogin({
 				code: this.code,
 				encryptedData: e.detail.encryptedData,
 				iv:  e.detail.iv
 			}).then(res => {
-				this.loginCallback(res, 'wxlogin')
+				if (res.data.code == 200) {
+					this.loginCallback(res, 'wxlogin')
+				} else {
+					this.getwxCode()
+					// this.$u.toast(res.data.msg);
+				}
 			})
 		},
 		canLogin() {
@@ -341,8 +350,8 @@ export default {
 		},
 		// 微信、密码、验证码 登录成功的回调
 		loginCallback(res, types) {
-			console.log('登录后的回调',res)
-			if(res.data.data.full_info){
+			console.log('登录后的回调',res, res.data)
+			if(res.data.data && res.data.data.full_info){
 				//信息完善,直接进入页面
 				uni.setStorageSync('user_account', res.data.data.user_account);
 				uni.setStorageSync('token', res.data.data.token);

+ 2 - 0
pages4/login/pcLogin.vue

@@ -29,7 +29,9 @@ export default {
         console.log('扫描后得:', q, this.scanCode)
         // 扫描二维码后调用,小程序已扫码
         if (this.scanCode) {
+            console.log('进入扫码后的接口')
             this.$api.scanhasCode({scanCode: this.scanCode}).then((res) => {
+                console.log('调用扫码接口返回的:', res)
                 if (res.data.code == 200) {
                     console.log('扫码成功')
                 }

+ 1 - 1
pages4/login/pcLoginSuccess.vue

@@ -13,7 +13,7 @@
                 <view class="pc_learn">你可以在电脑端学习了</view>
             </view>
             <view class="bg_pic">
-                <image class="poster" src="/pages4/static/poster.png"></image>
+                <image class="poster" src="/pages4/static/poster.jpg"></image>
             </view>
         </view>
         <view v-if="!hidden" class="toLearn" @click="toHome()"></view>

binární
pages4/static/poster.jpg


binární
pages4/static/poster.png