he2802 4 years ago
parent
commit
e6de0aee8f

+ 1 - 1
common/request.js

@@ -1,5 +1,5 @@
 //const BASE_URL = 'http://192.168.1.222:8088'
-// const BASE_URL = 'http://127.0.0.1:8088' 
+//const BASE_URL = 'http://127.0.0.1:8088' 
 const BASE_URL = 'https://api.xyyxt.net' 
 import store from '@/store/index.js'
 import api from './api.js'

+ 7 - 1
components/my.vue

@@ -29,7 +29,13 @@
 							<view class="head_t2">{{ collectTotal }}</view>
 						</navigator>
 					</u-col>
-					<u-col span="4" offset="4" text-align="center">
+					<u-col span="4" text-align="center">
+						<navigator url="/pages2/wd/collect" hover-class="none">
+							<view class="head_t1">金币</view>
+							<view class="head_t2">{{ userInfo.money }}</view>
+						</navigator>
+					</u-col>
+					<u-col span="4"  text-align="center">
 						<navigator url="/pages2/wd/ranking" hover-class="none">
 							<view class="head_t1">学习排名</view>
 							<view class="head_t2" v-if="rank > 0">NO.{{ rank }}</view>

+ 8 - 2
pages/index/index.vue

@@ -35,9 +35,11 @@ export default {
 			current: 0
 		};
 	},
-	onLoad(option) {},
-	onShow() {
+	onLoad(option) {
 		this.$refs.home.init();
+	},
+	onShow() {
+		
 	},
 	onShareAppMessage(res) {
 		var self = this;
@@ -47,6 +49,10 @@ export default {
 		};
 	},
 	methods: {
+		updateHomePlan(){
+			console.log(3434)
+			this.$refs.home.init();
+		},
 		beforeSwitch(index) {
 			let that = this;
 			if (index == this.current) {

+ 14 - 31
pages2/bank/detail.vue

@@ -347,38 +347,21 @@ export default {
 			}
 			self.$api.order(data).then(res => {
 				if(res.data.code === 200){
-					let objarr = res.data.data
-					wx.requestPayment({
-						timeStamp: objarr.timeStamp,
-						nonceStr: objarr.nonceStr,
-						package: objarr.package,
-						signType: objarr.signType,
-						paySign: objarr.sign,
-						success (result) {
-							uni.showModal({
-							    title: '提示',
-							    content: '支付成功',
-								showCancel: false,
-							    success: function (resst) {
-									if(resst.confirm){
-									self.showPricePop = false
-									self.getHaveThis()
-									}
-							    }
-							});
-						},
-						fail (err){
-							uni.showModal({
-							    title: '提示',
-							    content: '支付失败',
-								showCancel: false,
-							    success: function (resst) {
-									self.showPricePop = false
-									self.getHaveThis()
-							    }
-							});
+					uni.showModal({
+						title: '提示',
+						content: '兑换成功',
+						showCancel: false,
+						success: function(resst) {
+							self.showPricePop = false;
+							self.getHaveThis();
 						}
-					})
+					});
+				}else {
+					uni.showToast({
+						title: res.data.msg,
+						icon: 'none',
+						duration: 2000
+					});
 				}
 			})
 		},

+ 9 - 32
pages2/course/detail.vue

@@ -416,38 +416,15 @@ export default {
 			}
 			self.$api.order(data).then(res => {
 				if (res.data.code === 200) {
-					let objarr = res.data.data;
-					wx.requestPayment({
-						timeStamp: objarr.timeStamp,
-						nonceStr: objarr.nonceStr,
-						package: objarr.package,
-						signType: objarr.signType,
-						paySign: objarr.sign,
-						success(result) {
-							uni.showModal({
-								title: '提示',
-								content: '支付成功',
-								showCancel: false,
-								success: function(resst) {
-									if (resst.confirm) {
-										self.showPricePop = false;
-										self.getHaveThis();
-									}
-								}
-							});
-						},
-						fail(err) {
-							uni.showModal({
-								title: '提示',
-								content: '支付失败',
-								showCancel: false,
-								success: function(resst) {
-									self.showPricePop = false;
-									self.getHaveThis();
-								}
-							});
-						}
-					});
+				uni.showModal({
+					title: '提示',
+					content: '兑换成功',
+					showCancel: false,
+					success: function(resst) {
+						self.showPricePop = false;
+						self.getHaveThis();
+					}
+				});
 				} else {
 					uni.showToast({
 						title: res.data.msg,

+ 24 - 8
pages2/course/keynote.vue

@@ -247,7 +247,16 @@
 				}
 				self.$api.order(data).then(res => {
 					if(res.data.code === 200){
-						let objarr = res.data.data
+						uni.showModal({
+							title: '提示',
+							content: '兑换成功',
+							showCancel: false,
+							success: function(resst) {
+								self.showPricePop = false;
+								self.getHaveThis();
+							}
+						});
+				/*		let objarr = res.data.data
 						wx.requestPayment({
 							timeStamp: objarr.timeStamp,
 							nonceStr: objarr.nonceStr,
@@ -278,7 +287,13 @@
 								    }
 								});
 							}
-						})
+						})*/
+					}else {
+						uni.showToast({
+							title: res.data.msg,
+							icon: 'none',
+							duration: 2000
+						});
 					}
 				})
 			},
@@ -333,15 +348,16 @@
 				this.current = index;
 			},
 			jumpPay(){
-				this.$navTo.togo('/pages2/payment/payment', {})
+				let url = 'https://m.xyyxt.net/'+this.detail.fileUrls
+				this.$navTo.togo('/pages2/course/read', {url:url})
 			},
 			jumpRead(){
 				if(!this.$method.isLogin()){
 					this.$navTo.togo('/pages/login/login');
 				}else{
-					let url = this.$method.splitImgHost(this.detail.fileUrls)
-					console.log(url)
-					uni.downloadFile({
+					let url = 'https://m.xyyxt.net/'+(this.detail.fileUrls)
+				//	console.log(url)
+				/*	uni.downloadFile({
 					        url:url,
 					        success(res){
 					          console.log(res)
@@ -351,9 +367,9 @@
 					            fileType:'pdf'
 					          })
 					        }
-					      })
+					      })*/
 				//	this.$navTo.togo('/pages2/payment/payment', {})
-				//	this.$navTo.togo('/pages2/course/read', {})
+					this.$navTo.togo('/pages2/course/read', {url:url})
 				}
 				
 			}

+ 5 - 1
pages2/course/read.vue

@@ -10,10 +10,14 @@
 	export default {
 		data() {
 			return {
-				webUrl : 'https://file-dev.xyyxt.net/oss/images/20210602/2021_6_2_1763607338.pdf'
+				webUrl : 'https://m.xyyxt.net/oss/images/20210602/2021_6_2_1763607338.pdf'
 			}
 		},
+
 		onLoad(option) {
+			let url = decodeURIComponent(option.url)
+			console.log(url)
+			this.webUrl = 'https://m.xyyxt.net/pages/note/index?pdfUrl='+url
 			/* uni.downloadFile({
 			  url: 'http://192.168.0.222:8080/img/test.pdf',
 			  success: function (res) {

+ 6 - 0
pages2/plan/detail.vue

@@ -313,9 +313,15 @@ export default {
 				}else{
 					self.havePlan = false
 				}
+				self.updateHomePlan()
 
 			});
 		},
+		updateHomePlan(){
+			const pages = getCurrentPages(); //获取页面栈
+			const beforePage = pages[pages.length - 2]; //前一个页面
+			beforePage.$vm.updateHomePlan();
+		},
 		newPlan() {
 			this.$navTo.togo('/pages2/plan/create');
 		},