Tang 4 лет назад
Родитель
Сommit
24a7b600b0

+ 7 - 1
common/httpList/order.js

@@ -9,5 +9,11 @@ export default {
 			data: data
 		})
 	},
-	
+	orderSmallCoin(data) {
+		return myRequest({
+			url: '/order/smallCoin',
+			method: 'post',
+			data: data
+		})
+	}
 }

+ 1 - 0
common/methodTool.js

@@ -45,6 +45,7 @@ export default {
 		return Y + M + D + h + m + s;
 	},
 	TimeTotimestamp(date) {
+		var date= date.replace(/-/g, '/');
 		var newDate = new Date(date)
 		return (newDate.getTime() / 1000)
 	},

+ 3 - 4
common/request.js

@@ -1,7 +1,6 @@
-
-// const BASE_URL = 'http://192.168.1.222:8088'
-const BASE_URL = 'http://192.168.1.20:8088' 
-// const BASE_URL = 'https://api.xyyxt.net' 
+const BASE_URL = 'http://192.168.1.222: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'
 var num = 1

+ 3 - 4
components/home.vue

@@ -279,8 +279,7 @@ export default {
 					}
 				}else{
 					self.initDay()
-				}
-				 
+				}		 
 			});
 		},
 		getMonDate(){
@@ -304,7 +303,7 @@ export default {
 			this.$api.advertisingList().then(res => {
 				let index;
 				for (index in res.data.rows ) {
-				  res.data.rows[index].image = res.data.rows[index].adverUrl
+				  res.data.rows[index].image = self.$method.splitImgHost(res.data.rows[index].adverUrl)
 				}
 				self.list = res.data.rows
 			});
@@ -554,11 +553,11 @@ page {
 }
 .calendar_card {
 	width: 100%;
-	height: 300rpx;
 	background: #ffffff;
 	box-shadow: 0rpx 0rpx 16rpx 4rpx rgba(47, 67, 121, 0.1);
 	border-radius: 22rpx;
 	margin-top: 25rpx;
+	padding-bottom: 15rpx;
 }
 .box {
 	margin: 30rpx;

+ 9 - 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/coin/index"  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>
@@ -146,6 +152,8 @@ export default {
 			self.$api.taskSignIn(data).then(res => {
 				if(res.data.code === 200){
 					self.getInfoAttached()
+					//刷新用户信息
+					self.$api.refreshUserInfo() 
 				}
 			})
 		},

+ 9 - 0
pages.json

@@ -262,6 +262,15 @@
 						"bounce": "none"
 					}
 				}
+			}, {
+				"path": "coin/index",
+				"style": {
+					"navigationBarTitleText": "我的金币",
+					"app-plus": {
+						"titleNView": false, //禁用原生导航栏 
+						"bounce": "none"
+					}
+				}
 			}
 		],
 		"plugins": {

+ 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
+					});
 				}
 			})
 		},

+ 15 - 0
pages2/bank/question.vue

@@ -490,6 +490,21 @@ export default {
 			}
 			if (this.typeId === '1') {
 				self.$api.questionsimulate(self.bankId).then(res => {
+					if(res.data.code!=200){
+						uni.showModal({
+							title: '提示',
+							content: '没有题目',
+							showCancel: false,
+							confirmText: '返回上级',
+							success: function(res) {
+								if (res.confirm) {
+									uni.navigateBack({
+										delta: 1
+									});
+								}
+							}
+						});
+					}
 					self.simulateId = res.data.data.simulateId;
 					if (res.data.data.list.length) {
 						res.data.data.list.forEach((items, indexs) => {

+ 107 - 0
pages2/coin/index.vue

@@ -0,0 +1,107 @@
+<template>
+	<view class="content">
+		<u-cell-group>
+				<u-cell-item icon="integral" title="我的金币" :value="userInfo.money" :arrow="false"></u-cell-item>
+				<u-cell-item icon="integral" hover-class="cell-hover-class" title="特惠100金币" :value-style="{'color':'#FFCC00'}" value="¥0.01" :arrow="false" @click="pay(0.01)"></u-cell-item>
+				<u-cell-item icon="integral" hover-class="cell-hover-class" title="10金币" :value-style="{'color':'#FFCC00'}" value="¥10" :arrow="false" @click="pay(10)">></u-cell-item>
+				<u-cell-item icon="integral" hover-class="cell-hover-class" title="100金币" :value-style="{'color':'#FFCC00'}" value="¥100" :arrow="false" @click="pay(100)"></u-cell-item>
+				<u-cell-item icon="integral" hover-class="cell-hover-class" title="200金币" :value-style="{'color':'#FFCC00'}" value="¥200" :arrow="false" @click="pay(200)"></u-cell-item>
+				<u-cell-item icon="integral" hover-class="cell-hover-class" title="500金币" :value-style="{'color':'#FFCC00'}" value="¥500" :arrow="false" @click="pay(500)"></u-cell-item>
+			</u-cell-group>
+			
+	</view>
+</template>
+
+<script>
+import { mapGetters } from 'vuex';
+	export default {
+		data() {
+			return {
+				pdfh5: null
+			}
+		},
+		onLoad(option) {
+			this.$api.refreshUserInfo() 
+			
+		},
+		computed: {...mapGetters(['userInfo'])},
+		onShow(){
+		},
+		methods: {
+			pay(money){ 
+				if(uni.getSystemInfoSync().platform== 'ios'){
+					uni.showModal({
+						title: '提示',
+						content: 'IOS用户前往公众号充值',
+						showCancel: false
+					});
+					return
+				}
+				let that = this;
+				let list = []
+				list.push({goodsPrice:money,num:1})
+				let order = {goodsList:list};
+				this.$api.orderSmallCoin(order).then(
+					res => {
+						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){
+										that.$api.refreshUserInfo() 
+										}
+								    }
+								});
+							},
+							fail (err){
+								uni.showModal({
+								    title: '提示',
+								    content: '支付失败',
+									showCancel: false,
+								    success: function (resst) {
+										
+								    }
+								});
+							}
+						})
+					},
+					err => {
+						console.log(err);
+					}
+				);
+				
+			}
+			
+		}
+
+	}
+</script>
+
+<style scope>
+.cell-hover-class {
+	opacity: 0.5;
+}
+* {
+  padding: 0;
+  margin: 0;
+}
+html,
+body,
+#app {
+  width: 100%;
+  height: 100%;
+}
+page{
+	height: 100%;
+	
+}
+</style>

+ 17 - 40
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,
@@ -696,6 +673,14 @@ export default {
 					url: '/pages/login/login'
 				});
 			} else {
+				if (this.payStatus === 0) {
+					uni.showToast({
+						title: '暂未购买该课程',
+						icon: 'none',
+						duration: 2000
+					});
+					return;
+				}
 				if (this.userInfo.certified != 1) {
 					uni.showModal({
 						title: '提示',
@@ -716,14 +701,6 @@ export default {
 					this.certification();
 					return;
 				}
-				if (this.payStatus === 0) {
-					uni.showToast({
-						title: '暂未购买该课程',
-						icon: 'none',
-						duration: 2000
-					});
-					return;
-				}
 				if (this.vid === null) {
 					uni.showToast({
 						title: '视频加载失败',

+ 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})
 				}
 				
 			}

+ 6 - 2
pages2/course/read.vue

@@ -1,6 +1,6 @@
 <template>
 	<view  >
-	<view style="width: 100%;">
+	<view style="width: 100%;" id="app">
 	        <web-view :src="webUrl"></web-view>
 	    </view>
 	</view>
@@ -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) {

+ 1 - 0
pages2/plan/create.vue

@@ -213,6 +213,7 @@ export default {
 				studyDay: this.array_review[this.index_review],
 				status: 1
 			};
+			console.log(this.form);
 			console.log(data);
 			this.$api.planGenerate(data).then(result => {
 				if (result.data.code == 200) {

+ 7 - 1
pages2/plan/detail.vue

@@ -67,7 +67,7 @@
 								<view v-for="(item1, index) in item.studyCount" :key="index" class="item_date">{{ replay(item1) }}</view>
 							</view>
 						</view>
-						<view style="display: flex;margin-top: 20rpx;"><text class="item_t2">学习进度:60/120</text></view>
+						<view style="display: flex;margin-top: 20rpx;"><text class="item_t2">学习进度:{{item.studyNum}}/{{item.pitchNum}}</text></view>
 					</view>
 					<template v-slot:right>
 						<view class="operate">
@@ -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');
 		},

+ 1 - 1
pages2/wd/ranking.vue

@@ -12,7 +12,7 @@
 					<view class="fie" v-if="info.rank > 0" style="display: flex;align-items: center;font-size: 28rpx;color: #0183fe;font-weight: 500;">
 						<span>第{{ info.rank }}名</span>
 						<view class="ics" style="margin: 0rpx 17rpx;width: 1rpx;height: 26rpx;background-color: #d9edff;border-radius: 1rpx;"></view>
-						<span>{{ info.hourse }}h</span>
+						<span>{{ info.hourse === null ? '0' : info.hourse}}h</span>
 					</view>
 					<view v-else style="display: flex;align-items: center;font-size: 28rpx;color: #0183fe;font-weight: 500;">
 						暂未上榜