he2802 4 năm trước cách đây
mục cha
commit
e58848fc11

+ 3 - 1
common/api.js

@@ -13,6 +13,7 @@ import advertising from './httpList/advertising.js'
 import system from './httpList/system.js'
 import record from './httpList/record.js'
 import plan from './httpList/plan.js'
+import wxpay from './httpList/wxpay.js'
 export default {
 	...login,
 	...polyvVideo,
@@ -28,5 +29,6 @@ export default {
 	...advertising,
 	...system,
 	...record,
-	...plan
+	...plan,
+	...wxpay
 }

+ 13 - 0
common/httpList/wxpay.js

@@ -0,0 +1,13 @@
+import {
+	myRequest
+} from '../request.js'
+export default {
+	wxPayment(data) {
+		return myRequest({
+			url: '/wx/pay/payment',
+			method: 'post',
+			data: data
+		})
+	},
+	
+}

+ 1 - 1
common/request.js

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

+ 1 - 1
components/my.vue

@@ -15,7 +15,7 @@
 							{{userInfo.nickname}}
 						</navigator>
 						<navigator class="tag" url="/pages2/wd/level" hover-class="none">
-							天资过人
+							初出茅庐
 						</navigator>
 					</view>
 					<navigator url="/pages2/wd/level" hover-class="none" style="position: relative;margin-top: 20rpx;">

+ 14 - 6
pages2/course/detail.vue

@@ -488,17 +488,22 @@ export default {
 				});
 			} else {
 				if(this.userInfo.certified!=1){
-					uni.showToast({
-						title: '请先实名认证',
-						icon: 'none',
-						duration: 2000
+					uni.showModal({
+						title: '提示',
+						content: '请先实名认证',
+						success: function(res) {
+							if (res.confirm) {
+								uni.navigateTo({
+									url: '/pages2/wd/info'
+								});
+							} else if (res.cancel) {
+							}
+						}
 					});
 					return
 				}
 				//模拟今天是否人脸识别
 				if (!this.faceGetState) {
-					let time = (new Date()).getTime()/1000
-					uni.setStorageSync("face",time)
 					this.certification();
 					return;
 				}
@@ -532,12 +537,15 @@ export default {
 			var self = this;
 			const faceBiz = await self.$api.facecertificationPicBizToken();
 			self.BizToken = faceBiz.data.data.bizToken;
+			let time = (new Date()).getTime()/1000
+			uni.setStorageSync("face",time)
 			wx.startVerify({
 				data: {
 					token: self.BizToken
 				},
 				success: result => {
 					setTimeout(() => {
+						self.faceGetState = true
 						self.$api.facecertificationPicDetectInfo(self.BizToken).then(faceRec => {
 							if (faceRec.data.data === 0) {
 								uni.showToast({

+ 4 - 1
pages2/course/keynote.vue

@@ -113,7 +113,7 @@
 					<view class="sc_t">收藏</view>
 				</view>
 				
-				<view class="buy" @click="jumpRead">
+				<view class="buy" @click="jumpPay">
 					开始阅读
 				</view>
 			</view>
@@ -182,6 +182,9 @@
 			change(index) {
 				this.current = index;
 			},
+			jumpPay(){
+				this.$navTo.togo('/pages2/payment/payment', {})
+			},
 			jumpRead(){
 				if(!this.$method.isLogin()){
 					this.$navTo.togo('/pages/login/login');

+ 24 - 2
pages2/payment/payment.vue

@@ -26,8 +26,30 @@
 		},
 		methods: {
 			pay(){
-			}
-		
+				this.wxPayment({orderNo:"123"})
+			},
+			wxPayment(param){
+				let self = this
+				this.$api.wxPayment(param).then(res => {
+					if (res.data.code == 200){
+						let data = res.data.data
+						uni.requestPayment({
+						    provider: data.provider,
+						    nonceStr: data.nonceStr,
+						    package: data.package,
+						    signType: data.signType,
+						    paySign: data.paySign,
+							timeStamp: String(data.timeStamp),
+						    success: function (res) {
+						        console.log('success:' + JSON.stringify(res));
+						    },
+						    fail: function (err) {
+						        console.log('fail:' + JSON.stringify(err));
+						    }
+						});
+					}	
+				})
+			},
 		},
 		
 	}

+ 2 - 2
pages2/wd/ranking.vue

@@ -12,13 +12,13 @@
 							成绩
 						</view>
 					</u-col>
-					<u-col span="5">
+					<u-col span="6">
 						<view style="vertical-align: middle;display: flex;">
 							<image :src="userInfo!=null?$method.splitImgHost(userInfo.avatar):''" style="width: 80rpx;height: 80rpx;border-radius: 50%;"></image>
 							<view class="r_t2">{{userInfo.nickname}}</view>
 						</view>
 					</u-col>
-					<u-col span="5" v-if="current==0">
+					<u-col span="4" v-if="current==0">
 						<view style="color: #0183FE;font-size: 28rpx;" >
 							<view style="line-height: 80rpx;" v-if="info.rank>0">
 								<text>第{{info.rank}}名</text>