Commit dfda60ab by suwenbiao

观看方式完结

parent 449f5879
......@@ -8,7 +8,7 @@
var reg2 = new RegExp("#","g")
room_id = room_id.replace(reg2,"")
uni.setStorageSync('room_id', room_id)
window.location.href = window.location.href.slice(0, window.location.href.indexOf('/',10));
window.location.replace(window.location.href.slice(0, window.location.href.indexOf('/',10)))
}
},
onShow() {
......
<template>
<view class="">
<u-notify ref="uNotify" message=""></u-notify>
<view class="pwd_view">
<!-- <view class="cancel">
<image src="../../static/images/close.png" mode=""></image>
......@@ -13,7 +14,7 @@
<view class="tips">
备注:请输入账号登录,如没有账号请找授课老师获取
</view>
<view class="btn_pwd">
<view class="btn_pwd" @click="send">
进入
</view>
</view>
......@@ -21,32 +22,91 @@
</template>
<script>
export default {
name: "acount_login",
props: {
logintype:Object
},
mounted() {
// uni.showToast({
// title:"owewqo"
// })
},
data() {
return {
acount_input:''
}
export default {
name: "acount_login",
props: {
logintype: Object
},
mounted() {
},
data() {
return {
acount_input: '',
nickname:''
}
},
methods: {
send() {
if (this.acount_input.length <= 0) {
uni.showToast({
title:"账号不能为空",
icon:"none"
})
} else {
this.$api.roomwatchytypephone(this.acount_input).then(res => {
console.log(res);
if (res.data.code == 200) {
this.nickname = res.data.data
if (localStorage.getItem('wxnick') == 1) {
this.$api.getusertoken('', this.acount_input, true).then(res => {
uni.setStorageSync('room_token', res.data.data)
this.$refs.uNotify.show({
top: 30,
type: 'success',
message: '验证成功',
duration: 1000 * 3,
fontSize: 20,
safeAreaInsetTop:true
})
setTimeout(() => {
location.reload()
}, 1500);
})
}
if (localStorage.getItem('wxnick') == 0) {
this.nickname = this.nickname + ""
uni.setStorageSync("user_name1",this.nickname)
this.$api.getusertoken(this.nickname, this.acount_input, true).then(res => {
uni.setStorageSync('room_token', res.data.data)
this.$refs.uNotify.show({
top: 30,
type: 'success',
message: '验证成功',
duration: 1000 * 3,
fontSize: 20,
safeAreaInsetTop:true
})
setTimeout(() => {
window.location.reload()
}, 1500);
})
}
} else {
this.$refs.uNotify.show({
top: 30,
type: 'error',
message: res.data.msg,
duration: 1000 * 3,
fontSize: 20,
safeAreaInsetTop:true
})
}
})
}
},
},
}
}
</script>
<style>
.pwd_view{
.pwd_view {
padding: 45rpx 60rpx;
text-align: center;
}
.btn_pwd{
.btn_pwd {
margin-top: 80rpx;
height: 80rpx;
background: #266FE8;
......@@ -54,6 +114,7 @@ export default {
color: #fff;
border-radius: 40rpx;
}
/* .cancel{
margin-top: -20rpx;
margin-bottom: 50rpx;
......@@ -64,4 +125,9 @@ export default {
float: right;
height: 30rpx;
} */
</style>
\ No newline at end of file
.tips {
font-size: 24rpx;
color: #777777;
margin-top: 90rpx;
}
</style>
......@@ -8,7 +8,7 @@
<view class="" style="font-size: 30rpx;margin-bottom: 42rpx;">
邀请码登录
</view>
<u--input placeholder="请输入账号" border="none" inputAlign="center" v-model="acount_input"
<u--input placeholder="请输入账号" border="none" inputAlign="center" v-model="bacount_input"
style="background-color: #F2F2F4;border-radius: 10rpx;font-size: 28rpx;padding: 20rpx 0;">
</u--input>
<view class="tips">
......@@ -32,12 +32,12 @@
},
data() {
return {
bacount_input:''
}
},
methods: {
sumbit_invitation() {
this.$api.roomwatchytypeinvite(this.acount_input).then(res => {
this.$api.roomwatchytypeinvite(this.bacount_input).then(res => {
if (res.data.code == 200) {
this.$refs.uNotify.show({
top: 30,
......
......@@ -7,6 +7,7 @@
登录即可查看详情内容
</view>
<view class="" v-if="log_types==1">
<u-notify ref="uNotify" message=""></u-notify>
<view class="wx_btn" @click="go_login">
<img src="../../static/images/wx_pic.png" alt="">
<text>微信快捷登录</text>
......@@ -34,7 +35,10 @@
<view class="btn_getsms">
<u-notify ref="uNotify" message=""></u-notify>
<u-code :seconds="seconds" ref="uCode" @change="codeChange" @start="start"></u-code>
<u-button @tap="getCode" style="border: 2rpx solid #276EE8;outline: none;color: #276EE8;margin-top: 4rpx;">{{tips}}</u-button>
<u-button @tap="getCode"
style="border: 2rpx solid #276EE8;outline: none;color: #276EE8;margin-top: 4rpx;">
{{tips}}
</u-button>
</view>
</view>
</view>
......@@ -55,7 +59,7 @@
<view class="" v-if="!login_show">
<pwdlogin v-if="watch_info.types == 3" :logintype="watch_info"></pwdlogin>
<actlogin v-if="watch_info.types == 4" :logintype="watch_info"></actlogin>
<paylogin v-if="watch_info.types == 2" :logintype="watch_info"></paylogin>
<paylogin v-if="watch_info.types == 2" :logintype="watch_info" @excitpay="excitpay"></paylogin>
<invlogin v-if="watch_info.types == 6" :logintype="watch_info"></invlogin>
<signlogin v-if="watch_info.types == 5" :logintype="watch_info"></signlogin>
</view>
......@@ -74,7 +78,7 @@
props: {
},
components:{
components: {
pwdlogin,
actlogin,
paylogin,
......@@ -83,32 +87,32 @@
},
data() {
return {
tel:'',
icode:'',
smscode:'',
tel: '',
icode: '',
smscode: '',
is_show: false,
login_show:false,
login_show: false,
agree_agreement: true,
authorization_info: {},
code_src: '',
numrandom: '',
seconds: 60,
tips: '获取验证码',
log_types:'',
watch_info:{},
log_types: '',
watch_info: {},
};
},
mounted() {
if(!uni.getStorageSync("user_token")){
this.is_show = true
this.login_show = true
}
else{
this.$api.livechecktoken(uni.getStorageSync("user_token")).then(res=>{
var that = this
if (!uni.getStorageSync("user_token")) {
that.is_show = true
that.login_show = true
} else {
that.$api.livechecktoken(uni.getStorageSync("user_token")).then(res => {
console.log(res);
if(res.data.data.stats == 0){
this.is_show = true
this.login_show = true
if (res.data.data.stats == 0) {
that.is_show = true
that.login_show = true
}
})
}
......@@ -116,15 +120,39 @@
if (status.match(/MicroMessenger/i) == "micromessenger") {
//微信浏览器
this.log_types = 1
}else{
} else {
//其他浏览器
this.log_types = 0
}
this.wx_loginok()
this.getwxid()
this.clickcodeimg()
this.get_watchtype()
},
created() {
var ahref = window.location.href
console.log(ahref);
var that = this
if (ahref.indexOf("code=") != -1) {
var wxcode = ahref.slice(ahref.indexOf("code=") + 5, ahref.indexOf("&state="))
console.log(wxcode);
that.$api.loginbywx(wxcode).then(res => {
console.log(res);
this.is_show = false
if (res.data.data) {
uni.showToast({
title:"登录成功"
})
setTimeout(()=>{
location.reload();
},1800);
uni.setStorageSync("user_name", res.data.data.account);
uni.setStorageSync("user_headimg", res.data.data.avatar);
uni.setStorageSync("user_token", res.data.data.token);
}
})
}
},
methods: {
//获取appid
getwxid() {
......@@ -132,64 +160,54 @@
this.authorization_info = res.data.data
})
},
excitpay(val) {
this.is_show = val
},
//获取观看方式
get_watchtype(){
this.$api.roomwatchytype().then(res=>{
get_watchtype() {
this.$api.roomwatchytype().then(res => {
this.watch_info = res.data.data
console.log(res.data.data);
if(this.watch_info.types == 1){
if (this.watch_info.types == 1) {
this.$api.roomwatchytypefree()
this.is_show = false
}
else{
} else {
this.check_watchtype()
}
})
},
//验证观看方式
check_watchtype(){
this.$api.roomwatchytypeverify().then(res=>{
check_watchtype() {
this.$api.roomwatchytypeverify().then(res => {
console.log(res);
if(res.data.code === 200){
if(this.watch_info.types == 4){
if(!uni.getStorageSync("wxnick") || uni.getStorageSync("wxnick") != this.watch_info.wxNick){
if (res.data.code === 200) {
if (this.watch_info.types == 4) {
console.log(this.watch_info)
if (!uni.getStorageSync("wxnick") || uni.getStorageSync("wxnick") != this.watch_info.wxNick) {
this.is_show = true
uni.setStorageSync("wxnick",this.watch_info.wxNick)
this.$api.roomwatchytype().then(res => {
var wxis = "0"
String()
if(res.data.data.wxNick===1){
wxis="1"
}
uni.setStorageSync("wxnick",wxis)
})
}
}
else{
} else {
uni.removeStorageSync("room_token")
this.is_show = false
}
}
else{
} else {
this.is_show = true
}
})
},
start() {},
//判断是否微信登录成功
wx_loginok(){
var ahref = window.location.href
console.log(ahref);
if(ahref.indexOf("code=") != -1){
var wxcode = ahref.slice(ahref.indexOf("code=") + 5,ahref.indexOf("&state="))
this.$api.loginbywx(wxcode).then(res=>{
uni.setStorageSync("user_name", res.data.data.account);
uni.setStorageSync("user_headimg", res.data.data.avatar);
uni.setStorageSync("user_token", res.data.data.token);
this.$refs.uNotify.show({
top: 30,
type: 'success',
message: '登录成功',
duration: 1000 * 3,
fontSize: 20,
safeAreaInsetTop:true
})
setTimeout(() => {
window.location.reload()
}, 1000);
})
}
wx_loginok() {
},
//发起登录
go_login() {
......@@ -211,70 +229,70 @@
//获取短信验证码
getCode() {
if (this.$refs.uCode.canGetCode) {
this.$api.sendsms(this.tel,this.numrandom, this.icode).then(res => {
console.log(res);
if(res.data.code === 200){
this.$refs.uNotify.show({
top: 30,
type: 'success',
message: '发送成功',
duration: 1000 * 3,
fontSize: 20,
safeAreaInsetTop:true
})
this.$refs.uCode.start();
}
else{
this.$refs.uNotify.show({
top: 30,
type: 'error',
message: res.data.msg,
duration: 1000 * 3,
fontSize: 20,
safeAreaInsetTop:true
})
}
})
this.$api.sendsms(this.tel, this.numrandom, this.icode).then(res => {
console.log(res);
if (res.data.code === 200) {
this.$refs.uNotify.show({
top: 30,
type: 'success',
message: '发送成功',
duration: 1000 * 3,
fontSize: 20,
safeAreaInsetTop: true
})
this.$refs.uCode.start();
} else {
this.$refs.uNotify.show({
top: 30,
type: 'error',
message: res.data.msg,
duration: 1000 * 3,
fontSize: 20,
safeAreaInsetTop: true
})
}
})
// 通知验证码组件内部开始倒计时
} else {
this.$refs.uNotify.show({
top: 30,
type: 'warning',
message: '请在倒计时结束后再试',
duration: 1000 * 3,
fontSize: 20,
safeAreaInsetTop:true
top: 30,
type: 'warning',
message: '请在倒计时结束后再试',
duration: 1000 * 3,
fontSize: 20,
safeAreaInsetTop: true
})
}
},
//短信登录
sumbit() {
this.$api.loginforphone(this.tel, this.smscode,
this.numrandom, this.icode, "0").then(res => {
this.$api.loginforphone(this.tel, this.smscode,
this.numrandom, this.icode, "0").then(res => {
console.log(res);
if (!res.data.data.avatar) {
uni.setStorageSync('user_headimg',
'https://ts1.cn.mm.bing.net/th/id/R-C.baa2d1577cf82ad47aa705957237bff6?rik=IciTRLgFHnunww&riu=http%3a%2f%2fwww.sucaijishi.com%2fuploadfile%2f2016%2f0203%2f20160203022632945.png&ehk=4PjlDtyivWKN7CP%2b5JlcgUiuD1nyme8IaxbNbPnANIw%3d&risl=&pid=ImgRaw&r=0')
uni.setStorageSync("user_token", res.data.data.token);
uni.setStorageSync("user_phone", this.tel);
uni.setStorageSync("user_name", res.data.data.account);
this.$refs.uNotify.show({
top: 30,
type: 'success',
message: '登录成功',
duration: 1000 * 3,
fontSize: 20,
safeAreaInsetTop:true
})
setTimeout(() => {
window.location.reload()
}, 1000);
}
}).catch(err => {
console.log(err);
});
},
if (!res.data.data.avatar) {
uni.setStorageSync('user_headimg',
'https://ts1.cn.mm.bing.net/th/id/R-C.baa2d1577cf82ad47aa705957237bff6?rik=IciTRLgFHnunww&riu=http%3a%2f%2fwww.sucaijishi.com%2fuploadfile%2f2016%2f0203%2f20160203022632945.png&ehk=4PjlDtyivWKN7CP%2b5JlcgUiuD1nyme8IaxbNbPnANIw%3d&risl=&pid=ImgRaw&r=0'
)
uni.setStorageSync("user_token", res.data.data.token);
uni.setStorageSync("user_phone", this.tel);
uni.setStorageSync("user_name", res.data.data.account);
this.$refs.uNotify.show({
top: 30,
type: 'success',
message: '登录成功',
duration: 1000 * 3,
fontSize: 20,
safeAreaInsetTop: true
})
setTimeout(() => {
window.location.reload()
}, 1500);
}
}).catch(err => {
console.log(err);
});
},
}
}
</script>
......@@ -361,12 +379,13 @@
float: right;
width: 280rpx;
}
.btn_smslogin{
.btn_smslogin {
width: 686rpx;
height: 80rpx;
background: #256EE7;
border-radius: 40rpx;
margin: 80rpx auto 5rpx auto ;
margin: 80rpx auto 5rpx auto;
line-height: 80rpx;
color: #fff;
font-size: 30rpx;
......
<template>
<view class="">
<u-notify ref="uNotify" message=""></u-notify>
<view class="pwd_view">
<!-- <view class="cancel">
<image src="../../static/images/close.png" mode=""></image>
......@@ -11,40 +12,100 @@
价格:
<text style="color: #FF4A43;">{{logintype.payment}}</text>
</view>
<view class="btn_pwd">
<view class="btn_pwd" @click="go_pay">
立即支付
</view>
<view class="btn_pwd" @click="close">
取消
</view>
</view>
</view>
</template>
<script>
export default {
name: "pay_login",
mounted() {
this.$api.roomwatchytypepay('WX').then(res=>{
console.log(res);
})
},
props: {
logintype:Object
},
data() {
return {
pwd:''
}
export default {
name: "pay_login",
mounted() {
// this.go_pay()
},
props: {
logintype: Object
},
data() {
return {
pwd: ''
}
},
methods: {
close(){
this.$emit("excitpay",false)
},
go_pay() {
var that = this
this.$api.roomwatchytypepay('WX').then(res => {
console.log(res.data.data);
if (res.data.data.url) {
var num = res.data.data.orderNum
var parms = res.data.data.url
var jWeixin = require('jweixin-module')
jWeixin.config({
debug: false,
appId: parms.jsapiAppid,
timestamp: parms.timeStamp, // 支付签名时间戳,注意微信 jssdk 中的所有使用 timestamp 字段均为小写。但最新版的支付后台生成签名使用的 timeStamp 字段名需大写其中的 S 字符
nonceStr: parms.nonceStr, // 支付签名随机串,不长于 32 位
package: parms.jsapipackage, // 统一支付接口返回的prepay_id参数值,提交格式如:prepay_id=\*\*\*)
signType: parms.signType, // 微信支付V3的传入 RSA ,微信支付V2的传入格式与V2统一下单的签名格式保持一致
paySign: parms.paySign, // 支付签名
});
jWeixin.chooseWXPay({
appId: parms.jsapiAppid,
timestamp: parms.timeStamp, // 支付签名时间戳,注意微信 jssdk 中的所有使用 timestamp 字段均为小写。但最新版的支付后台生成签名使用的 timeStamp 字段名需大写其中的 S 字符
nonceStr: parms.nonceStr, // 支付签名随机串,不长于 32 位
package: parms.jsapipackage, // 统一支付接口返回的prepay_id参数值,提交格式如:prepay_id=\*\*\*)
signType: parms.signType, // 微信支付V3的传入 RSA ,微信支付V2的传入格式与V2统一下单的签名格式保持一致
paySign: parms.paySign, // 支付签名
success:function(e){
that.$refs.uNotify.show({
top: 30,
type: 'success',
message: '支付成功',
duration: 1000 * 3,
fontSize: 20,
safeAreaInsetTop:true
})
that.$api.roomwatchytypeverifyPay(num).then(res=>{
console.log(res);
})
setTimeout(() => {
location.reload()
}, 1500);
},
fail:function(){
that.$refs.uNotify.show({
top: 30,
type: 'error',
message: '支付失败',
duration: 1000 * 3,
fontSize: 20,
safeAreaInsetTop:true
})
},
});
}
})
},
},
}
}
</script>
<style>
.pwd_view{
.pwd_view {
padding: 45rpx 60rpx;
text-align: center;
}
.btn_pwd{
.btn_pwd {
margin-top: 80rpx;
height: 80rpx;
background: #FF4A43;
......@@ -52,7 +113,8 @@ export default {
color: #fff;
border-radius: 40rpx;
}
/* .cancel{
/* .cancel{
margin-top: -20rpx;
margin-bottom: 50rpx;
margin-right: -20rpx;
......@@ -62,4 +124,4 @@ export default {
float: right;
height: 30rpx;
} */
</style>
\ No newline at end of file
</style>
......@@ -4,21 +4,26 @@
<view class="">
报名登录
</view>
<view class="scorll_view">
<u-notify ref="zNotify" message=""></u-notify>
<view class="scorll_view" v-if="!show_wait">
<view class="">
<u--input placeholder="请输入手机号" border="none" maxlength="11" clearable type="number"
inputAlign="center" v-model="tel"
<u--input :placeholder="form[0].remark" border="none" clearable inputAlign="center"
v-model="datalist.nickname" v-if="form[0].choose"
style="width: 88%;margin: 62rpx auto 32rpx auto;background-color: #F2F2F4;border-radius: 10rpx;font-size: 28rpx;padding: 20rpx 0;">
</u--input>
<view class="input_imgcode">
<u--input placeholder="请输入图片验证码" border="none" inputAlign="center" v-model="icode"
<u--input :placeholder="form[1].remark" border="none" maxlength="11" clearable type="number"
inputAlign="center" v-model="datalist.phone" v-if="form[1].choose"
style="width: 88%;margin: 62rpx auto 32rpx auto;background-color: #F2F2F4;border-radius: 10rpx;font-size: 28rpx;padding: 20rpx 0;">
</u--input>
<view class="input_imgcode" v-if="form[1].phone_on && form[1].choose">
<u--input placeholder="请输入图片验证码" border="none" inputAlign="center" v-model="datalist.imageCode"
style="width: 52.5%;background-color: #F2F2F4;border-radius: 10rpx;font-size: 28rpx;padding: 20rpx 0;float: left;">
</u--input>
<u--image :showLoading="true" :src="code_src" width="280rpx" height="88rpx"
@click="clickcodeimg" style="float: left;margin-left: 5%;"></u--image>
</view>
<view class="input_imgcode">
<u--input placeholder="请输入短信验证码" border="none" inputAlign="center" v-model="smscode"
<view class="input_imgcode" v-if="form[1].phone_on && form[1].choose">
<u--input placeholder="请输入短信验证码" border="none" inputAlign="center" v-model="datalist.code"
style="width: 52.5%;background-color: #F2F2F4;border-radius: 10rpx;font-size: 28rpx;padding: 20rpx 0;float: left;">
</u--input>
<view class="btn_getsms">
......@@ -26,14 +31,26 @@
<u-code :seconds="seconds" ref="uCode" @change="codeChange" @start="start"></u-code>
<u-button @tap="getCode"
style="border: 2rpx solid #276EE8;outline: none;color: #276EE8;margin-top: 4rpx;">
{{tips}}</u-button>
{{tips}}
</u-button>
</view>
</view>
<view class="" v-for="(item,index) in form" v-if="index>1 && form[index].choose">
<u--input :placeholder="item.remark" border="none" clearable inputAlign="center"
v-model="item.val" v-if="form[0].choose"
style="width: 88%;margin: 62rpx auto 32rpx auto;background-color: #F2F2F4;border-radius: 10rpx;font-size: 28rpx;padding: 20rpx 0;">
</u--input>
</view>
</view>
</view>
<view class="btn_smslogin" @click="sumbit">
<view class="btn_smslogin" @click="sumbit" v-if="!show_wait">
登录
</view>
<view class="" v-if="show_wait">
<view class="" style="padding: 50rpx;font-size: 26rpx;">
报名信息已提交,请等待管理员审核
</view>
</view>
</view>
</view>
</template>
......@@ -42,7 +59,7 @@
export default {
name: "sign_login",
props: {
logintype:Object
logintype: Object
},
components: {},
data() {
......@@ -57,10 +74,27 @@
numrandom: '',
seconds: 60,
tips: '获取验证码',
form: [],
datalist: {
nickname: '',
phone: '',
subject: '',
uniqueCode: '',
code: '',
time: '',
imageCode: '',
type: '',
},
show_wait:false
};
},
mounted() {
created() {
this.clickcodeimg()
this.checkwatchtype()
this.form = JSON.parse(this.logintype.applyJson)
},
mounted() {
},
methods: {
start() {
......@@ -113,6 +147,47 @@
})
}
},
//验证观看方式是否认证
checkwatchtype() {
this.$api.roomwatchytypeverify().then(res => {
if (res.data.code === 200) {} else {
if (res.data.data == 1) {
this.show_wait = true
}
}
})
},
sumbit(){
var that = this
if(that.form.length>2){
for(var index in that.form){
if(index > 1){
var title = that.form[index].title
var val = that.form[index].val
if (that.form[index].choose) {
var sub = title+':'+val+","
that.datalist.subject = that.datalist.subject + sub
}
}
}
}
console.log(that.datalist);
that.$api.roomwatchytypesubmit(that.datalist).then(res=>{
if(res.data.code == 200){
that.$refs.zNotify.show({
top: 30,
type: 'success',
message: '报名成功',
duration: 1000 * 3,
fontSize: 20,
safeAreaInsetTop: true
})
setTimeout(() => {
location.reload()
}, 1000);
}
})
},
}
}
</script>
......@@ -210,7 +285,8 @@
color: #fff;
font-size: 30rpx;
}
.scorll_view{
.scorll_view {
max-height: 600rpx;
overflow-y: scroll;
}
......
# jweixin-module
微信JS-SDK
## 安装
### NPM
```shell
npm install jweixin-module --save
```
### UMD
```http
https://unpkg.com/jweixin-module/out/index.js
```
## 使用
```js
var jweixin = require('jweixin-module')
jweixin.ready(function(){
// TODO
});
```
## 完整API
>[微信JS-SDK说明文档](https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1421141115)
!function(e,n){"function"==typeof define&&(define.amd||define.cmd)?define(function(){return n(e)}):n(e,!0)}(window,function(o,e){if(!o.jWeixin){var n,c={config:"preVerifyJSAPI",onMenuShareTimeline:"menu:share:timeline",onMenuShareAppMessage:"menu:share:appmessage",onMenuShareQQ:"menu:share:qq",onMenuShareWeibo:"menu:share:weiboApp",onMenuShareQZone:"menu:share:QZone",previewImage:"imagePreview",getLocation:"geoLocation",openProductSpecificView:"openProductViewWithPid",addCard:"batchAddCard",openCard:"batchViewCard",chooseWXPay:"getBrandWCPayRequest",openEnterpriseRedPacket:"getRecevieBizHongBaoRequest",startSearchBeacons:"startMonitoringBeacons",stopSearchBeacons:"stopMonitoringBeacons",onSearchBeacons:"onBeaconsInRange",consumeAndShareCard:"consumedShareCard",openAddress:"editAddress"},a=function(){var e={};for(var n in c)e[c[n]]=n;return e}(),i=o.document,t=i.title,r=navigator.userAgent.toLowerCase(),s=navigator.platform.toLowerCase(),d=!(!s.match("mac")&&!s.match("win")),u=-1!=r.indexOf("wxdebugger"),l=-1!=r.indexOf("micromessenger"),p=-1!=r.indexOf("android"),f=-1!=r.indexOf("iphone")||-1!=r.indexOf("ipad"),m=(n=r.match(/micromessenger\/(\d+\.\d+\.\d+)/)||r.match(/micromessenger\/(\d+\.\d+)/))?n[1]:"",g={initStartTime:L(),initEndTime:0,preVerifyStartTime:0,preVerifyEndTime:0},h={version:1,appId:"",initTime:0,preVerifyTime:0,networkType:"",isPreVerifyOk:1,systemType:f?1:p?2:-1,clientVersion:m,url:encodeURIComponent(location.href)},v={},S={_completes:[]},y={state:0,data:{}};O(function(){g.initEndTime=L()});var I=!1,_=[],w={config:function(e){B("config",v=e);var t=!1!==v.check;O(function(){if(t)M(c.config,{verifyJsApiList:C(v.jsApiList),verifyOpenTagList:C(v.openTagList)},function(){S._complete=function(e){g.preVerifyEndTime=L(),y.state=1,y.data=e},S.success=function(e){h.isPreVerifyOk=0},S.fail=function(e){S._fail?S._fail(e):y.state=-1};var t=S._completes;return t.push(function(){!function(){if(!(d||u||v.debug||m<"6.0.2"||h.systemType<0)){var i=new Image;h.appId=v.appId,h.initTime=g.initEndTime-g.initStartTime,h.preVerifyTime=g.preVerifyEndTime-g.preVerifyStartTime,w.getNetworkType({isInnerInvoke:!0,success:function(e){h.networkType=e.networkType;var n="https://open.weixin.qq.com/sdk/report?v="+h.version+"&o="+h.isPreVerifyOk+"&s="+h.systemType+"&c="+h.clientVersion+"&a="+h.appId+"&n="+h.networkType+"&i="+h.initTime+"&p="+h.preVerifyTime+"&u="+h.url;i.src=n}})}}()}),S.complete=function(e){for(var n=0,i=t.length;n<i;++n)t[n]();S._completes=[]},S}()),g.preVerifyStartTime=L();else{y.state=1;for(var e=S._completes,n=0,i=e.length;n<i;++n)e[n]();S._completes=[]}}),w.invoke||(w.invoke=function(e,n,i){o.WeixinJSBridge&&WeixinJSBridge.invoke(e,x(n),i)},w.on=function(e,n){o.WeixinJSBridge&&WeixinJSBridge.on(e,n)})},ready:function(e){0!=y.state?e():(S._completes.push(e),!l&&v.debug&&e())},error:function(e){m<"6.0.2"||(-1==y.state?e(y.data):S._fail=e)},checkJsApi:function(e){M("checkJsApi",{jsApiList:C(e.jsApiList)},(e._complete=function(e){if(p){var n=e.checkResult;n&&(e.checkResult=JSON.parse(n))}e=function(e){var n=e.checkResult;for(var i in n){var t=a[i];t&&(n[t]=n[i],delete n[i])}return e}(e)},e))},onMenuShareTimeline:function(e){P(c.onMenuShareTimeline,{complete:function(){M("shareTimeline",{title:e.title||t,desc:e.title||t,img_url:e.imgUrl||"",link:e.link||location.href,type:e.type||"link",data_url:e.dataUrl||""},e)}},e)},onMenuShareAppMessage:function(n){P(c.onMenuShareAppMessage,{complete:function(e){"favorite"===e.scene?M("sendAppMessage",{title:n.title||t,desc:n.desc||"",link:n.link||location.href,img_url:n.imgUrl||"",type:n.type||"link",data_url:n.dataUrl||""}):M("sendAppMessage",{title:n.title||t,desc:n.desc||"",link:n.link||location.href,img_url:n.imgUrl||"",type:n.type||"link",data_url:n.dataUrl||""},n)}},n)},onMenuShareQQ:function(e){P(c.onMenuShareQQ,{complete:function(){M("shareQQ",{title:e.title||t,desc:e.desc||"",img_url:e.imgUrl||"",link:e.link||location.href},e)}},e)},onMenuShareWeibo:function(e){P(c.onMenuShareWeibo,{complete:function(){M("shareWeiboApp",{title:e.title||t,desc:e.desc||"",img_url:e.imgUrl||"",link:e.link||location.href},e)}},e)},onMenuShareQZone:function(e){P(c.onMenuShareQZone,{complete:function(){M("shareQZone",{title:e.title||t,desc:e.desc||"",img_url:e.imgUrl||"",link:e.link||location.href},e)}},e)},updateTimelineShareData:function(e){M("updateTimelineShareData",{title:e.title,link:e.link,imgUrl:e.imgUrl},e)},updateAppMessageShareData:function(e){M("updateAppMessageShareData",{title:e.title,desc:e.desc,link:e.link,imgUrl:e.imgUrl},e)},startRecord:function(e){M("startRecord",{},e)},stopRecord:function(e){M("stopRecord",{},e)},onVoiceRecordEnd:function(e){P("onVoiceRecordEnd",e)},playVoice:function(e){M("playVoice",{localId:e.localId},e)},pauseVoice:function(e){M("pauseVoice",{localId:e.localId},e)},stopVoice:function(e){M("stopVoice",{localId:e.localId},e)},onVoicePlayEnd:function(e){P("onVoicePlayEnd",e)},uploadVoice:function(e){M("uploadVoice",{localId:e.localId,isShowProgressTips:0==e.isShowProgressTips?0:1},e)},downloadVoice:function(e){M("downloadVoice",{serverId:e.serverId,isShowProgressTips:0==e.isShowProgressTips?0:1},e)},translateVoice:function(e){M("translateVoice",{localId:e.localId,isShowProgressTips:0==e.isShowProgressTips?0:1},e)},chooseImage:function(e){M("chooseImage",{scene:"1|2",count:e.count||9,sizeType:e.sizeType||["original","compressed"],sourceType:e.sourceType||["album","camera"]},(e._complete=function(e){if(p){var n=e.localIds;try{n&&(e.localIds=JSON.parse(n))}catch(e){}}},e))},getLocation:function(e){},previewImage:function(e){M(c.previewImage,{current:e.current,urls:e.urls},e)},uploadImage:function(e){M("uploadImage",{localId:e.localId,isShowProgressTips:0==e.isShowProgressTips?0:1},e)},downloadImage:function(e){M("downloadImage",{serverId:e.serverId,isShowProgressTips:0==e.isShowProgressTips?0:1},e)},getLocalImgData:function(e){!1===I?(I=!0,M("getLocalImgData",{localId:e.localId},(e._complete=function(e){if(I=!1,0<_.length){var n=_.shift();wx.getLocalImgData(n)}},e))):_.push(e)},getNetworkType:function(e){M("getNetworkType",{},(e._complete=function(e){e=function(e){var n=e.errMsg;e.errMsg="getNetworkType:ok";var i=e.subtype;if(delete e.subtype,i)e.networkType=i;else{var t=n.indexOf(":"),o=n.substring(t+1);switch(o){case"wifi":case"edge":case"wwan":e.networkType=o;break;default:e.errMsg="getNetworkType:fail"}}return e}(e)},e))},openLocation:function(e){M("openLocation",{latitude:e.latitude,longitude:e.longitude,name:e.name||"",address:e.address||"",scale:e.scale||28,infoUrl:e.infoUrl||""},e)},getLocation:function(e){M(c.getLocation,{type:(e=e||{}).type||"wgs84"},(e._complete=function(e){delete e.type},e))},hideOptionMenu:function(e){M("hideOptionMenu",{},e)},showOptionMenu:function(e){M("showOptionMenu",{},e)},closeWindow:function(e){M("closeWindow",{},e=e||{})},hideMenuItems:function(e){M("hideMenuItems",{menuList:e.menuList},e)},showMenuItems:function(e){M("showMenuItems",{menuList:e.menuList},e)},hideAllNonBaseMenuItem:function(e){M("hideAllNonBaseMenuItem",{},e)},showAllNonBaseMenuItem:function(e){M("showAllNonBaseMenuItem",{},e)},scanQRCode:function(e){M("scanQRCode",{needResult:(e=e||{}).needResult||0,scanType:e.scanType||["qrCode","barCode"]},(e._complete=function(e){if(f){var n=e.resultStr;if(n){var i=JSON.parse(n);e.resultStr=i&&i.scan_code&&i.scan_code.scan_result}}},e))},openAddress:function(e){M(c.openAddress,{},(e._complete=function(e){e=function(e){return e.postalCode=e.addressPostalCode,delete e.addressPostalCode,e.provinceName=e.proviceFirstStageName,delete e.proviceFirstStageName,e.cityName=e.addressCitySecondStageName,delete e.addressCitySecondStageName,e.countryName=e.addressCountiesThirdStageName,delete e.addressCountiesThirdStageName,e.detailInfo=e.addressDetailInfo,delete e.addressDetailInfo,e}(e)},e))},openProductSpecificView:function(e){M(c.openProductSpecificView,{pid:e.productId,view_type:e.viewType||0,ext_info:e.extInfo},e)},addCard:function(e){for(var n=e.cardList,i=[],t=0,o=n.length;t<o;++t){var r=n[t],a={card_id:r.cardId,card_ext:r.cardExt};i.push(a)}M(c.addCard,{card_list:i},(e._complete=function(e){var n=e.card_list;if(n){for(var i=0,t=(n=JSON.parse(n)).length;i<t;++i){var o=n[i];o.cardId=o.card_id,o.cardExt=o.card_ext,o.isSuccess=!!o.is_succ,delete o.card_id,delete o.card_ext,delete o.is_succ}e.cardList=n,delete e.card_list}},e))},chooseCard:function(e){M("chooseCard",{app_id:v.appId,location_id:e.shopId||"",sign_type:e.signType||"SHA1",card_id:e.cardId||"",card_type:e.cardType||"",card_sign:e.cardSign,time_stamp:e.timestamp+"",nonce_str:e.nonceStr},(e._complete=function(e){e.cardList=e.choose_card_info,delete e.choose_card_info},e))},openCard:function(e){for(var n=e.cardList,i=[],t=0,o=n.length;t<o;++t){var r=n[t],a={card_id:r.cardId,code:r.code};i.push(a)}M(c.openCard,{card_list:i},e)},consumeAndShareCard:function(e){M(c.consumeAndShareCard,{consumedCardId:e.cardId,consumedCode:e.code},e)},chooseWXPay:function(e){M(c.chooseWXPay,V(e),e)},openEnterpriseRedPacket:function(e){M(c.openEnterpriseRedPacket,V(e),e)},startSearchBeacons:function(e){M(c.startSearchBeacons,{ticket:e.ticket},e)},stopSearchBeacons:function(e){M(c.stopSearchBeacons,{},e)},onSearchBeacons:function(e){P(c.onSearchBeacons,e)},openEnterpriseChat:function(e){M("openEnterpriseChat",{useridlist:e.userIds,chatname:e.groupName},e)},launchMiniProgram:function(e){M("launchMiniProgram",{targetAppId:e.targetAppId,path:function(e){if("string"==typeof e&&0<e.length){var n=e.split("?")[0],i=e.split("?")[1];return n+=".html",void 0!==i?n+"?"+i:n}}(e.path),envVersion:e.envVersion},e)},openBusinessView:function(e){M("openBusinessView",{businessType:e.businessType,queryString:e.queryString||"",envVersion:e.envVersion},(e._complete=function(n){if(p){var e=n.extraData;if(e)try{n.extraData=JSON.parse(e)}catch(e){n.extraData={}}}},e))},miniProgram:{navigateBack:function(e){e=e||{},O(function(){M("invokeMiniProgramAPI",{name:"navigateBack",arg:{delta:e.delta||1}},e)})},navigateTo:function(e){O(function(){M("invokeMiniProgramAPI",{name:"navigateTo",arg:{url:e.url}},e)})},redirectTo:function(e){O(function(){M("invokeMiniProgramAPI",{name:"redirectTo",arg:{url:e.url}},e)})},switchTab:function(e){O(function(){M("invokeMiniProgramAPI",{name:"switchTab",arg:{url:e.url}},e)})},reLaunch:function(e){O(function(){M("invokeMiniProgramAPI",{name:"reLaunch",arg:{url:e.url}},e)})},postMessage:function(e){O(function(){M("invokeMiniProgramAPI",{name:"postMessage",arg:e.data||{}},e)})},getEnv:function(e){O(function(){e({miniprogram:"miniprogram"===o.__wxjs_environment})})}}},T=1,k={};return i.addEventListener("error",function(e){if(!p){var n=e.target,i=n.tagName,t=n.src;if("IMG"==i||"VIDEO"==i||"AUDIO"==i||"SOURCE"==i)if(-1!=t.indexOf("wxlocalresource://")){e.preventDefault(),e.stopPropagation();var o=n["wx-id"];if(o||(o=T++,n["wx-id"]=o),k[o])return;k[o]=!0,wx.ready(function(){wx.getLocalImgData({localId:t,success:function(e){n.src=e.localData}})})}}},!0),i.addEventListener("load",function(e){if(!p){var n=e.target,i=n.tagName;n.src;if("IMG"==i||"VIDEO"==i||"AUDIO"==i||"SOURCE"==i){var t=n["wx-id"];t&&(k[t]=!1)}}},!0),e&&(o.wx=o.jWeixin=w),w}function M(n,e,i){o.WeixinJSBridge?WeixinJSBridge.invoke(n,x(e),function(e){A(n,e,i)}):B(n,i)}function P(n,i,t){o.WeixinJSBridge?WeixinJSBridge.on(n,function(e){t&&t.trigger&&t.trigger(e),A(n,e,i)}):B(n,t||i)}function x(e){return(e=e||{}).appId=v.appId,e.verifyAppId=v.appId,e.verifySignType="sha1",e.verifyTimestamp=v.timestamp+"",e.verifyNonceStr=v.nonceStr,e.verifySignature=v.signature,e}function V(e){return{timeStamp:e.timestamp+"",nonceStr:e.nonceStr,package:e.package,paySign:e.paySign,signType:e.signType||"SHA1"}}function A(e,n,i){"openEnterpriseChat"!=e&&"openBusinessView"!==e||(n.errCode=n.err_code),delete n.err_code,delete n.err_desc,delete n.err_detail;var t=n.errMsg;t||(t=n.err_msg,delete n.err_msg,t=function(e,n){var i=e,t=a[i];t&&(i=t);var o="ok";if(n){var r=n.indexOf(":");"confirm"==(o=n.substring(r+1))&&(o="ok"),"failed"==o&&(o="fail"),-1!=o.indexOf("failed_")&&(o=o.substring(7)),-1!=o.indexOf("fail_")&&(o=o.substring(5)),"access denied"!=(o=(o=o.replace(/_/g," ")).toLowerCase())&&"no permission to execute"!=o||(o="permission denied"),"config"==i&&"function not exist"==o&&(o="ok"),""==o&&(o="fail")}return n=i+":"+o}(e,t),n.errMsg=t),(i=i||{})._complete&&(i._complete(n),delete i._complete),t=n.errMsg||"",v.debug&&!i.isInnerInvoke&&alert(JSON.stringify(n));var o=t.indexOf(":");switch(t.substring(o+1)){case"ok":i.success&&i.success(n);break;case"cancel":i.cancel&&i.cancel(n);break;default:i.fail&&i.fail(n)}i.complete&&i.complete(n)}function C(e){if(e){for(var n=0,i=e.length;n<i;++n){var t=e[n],o=c[t];o&&(e[n]=o)}return e}}function B(e,n){if(!(!v.debug||n&&n.isInnerInvoke)){var i=a[e];i&&(e=i),n&&n._complete&&delete n._complete,console.log('"'+e+'",',n||"")}}function L(){return(new Date).getTime()}function O(e){l&&(o.WeixinJSBridge?e():i.addEventListener&&i.addEventListener("WeixinJSBridgeReady",e,!1))}});
\ No newline at end of file
{
"_from": "jweixin-module",
"_id": "jweixin-module@1.6.0",
"_inBundle": false,
"_integrity": "sha512-dGk9cf+ipipHmtzYmKZs5B2toX+p4hLyllGLF6xuC8t+B05oYxd8fYoaRz0T30U2n3RUv8a4iwvjhA+OcYz52w==",
"_location": "/jweixin-module",
"_phantomChildren": {},
"_requested": {
"type": "tag",
"registry": true,
"raw": "jweixin-module",
"name": "jweixin-module",
"escapedName": "jweixin-module",
"rawSpec": "",
"saveSpec": null,
"fetchSpec": "latest"
},
"_requiredBy": [
"#USER",
"/"
],
"_resolved": "https://registry.npmmirror.com/jweixin-module/-/jweixin-module-1.6.0.tgz",
"_shasum": "4a7ea614083e3c9c3f49e2fdc2bb882cfa58dfcd",
"_spec": "jweixin-module",
"_where": "C:\\Users\\t1089\\Desktop\\新建文件夹 (2)",
"author": {
"name": "Shengqiang Guo"
},
"bugs": {
"url": "https://github.com/zhetengbiji/jweixin-module/issues"
},
"bundleDependencies": false,
"deprecated": false,
"description": "微信JS-SDK",
"devDependencies": {},
"homepage": "https://github.com/zhetengbiji/jweixin-module#readme",
"keywords": [
"wxjssdk",
"weixin",
"jweixin",
"wechat",
"jssdk",
"wx"
],
"license": "ISC",
"main": "lib/index.js",
"name": "jweixin-module",
"repository": {
"type": "git",
"url": "git+https://github.com/zhetengbiji/jweixin-module.git"
},
"scripts": {},
"version": "1.6.0"
}
......@@ -67,6 +67,11 @@
"mime-types": "^2.1.12"
}
},
"jweixin-module": {
"version": "1.6.0",
"resolved": "https://registry.npmmirror.com/jweixin-module/-/jweixin-module-1.6.0.tgz",
"integrity": "sha512-dGk9cf+ipipHmtzYmKZs5B2toX+p4hLyllGLF6xuC8t+B05oYxd8fYoaRz0T30U2n3RUv8a4iwvjhA+OcYz52w=="
},
"mime-db": {
"version": "1.52.0",
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz",
......
......@@ -5,6 +5,7 @@
"main": "main.js",
"dependencies": {
"axios": "^1.1.3",
"jweixin-module": "^1.6.0",
"vconsole": "^3.14.7"
},
"devDependencies": {},
......
<!DOCTYPE html><html lang=zh-CN><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge"><title>智课</title><script>var coverSupport = 'CSS' in window && typeof CSS.supports === 'function' && (CSS.supports('top: env(a)') || CSS.supports('top: constant(a)'))
document.write('<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' + (coverSupport ? ', viewport-fit=cover' : '') + '" />')</script><link rel=stylesheet href=/static/index.2772579d.css></head><body><noscript><strong>Please enable JavaScript to continue.</strong></noscript><div id=app></div><script src=/static/js/chunk-vendors.93fd1780.js></script><script src=/static/js/index.604e2e21.js></script></body></html>
\ No newline at end of file
document.write('<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' + (coverSupport ? ', viewport-fit=cover' : '') + '" />')</script><link rel=stylesheet href=/static/index.2772579d.css></head><body><noscript><strong>Please enable JavaScript to continue.</strong></noscript><div id=app></div><script src=/static/js/chunk-vendors.93fd1780.js></script><script src=/static/js/index.32321f34.js></script></body></html>
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment