[体验官活动]

This commit is contained in:
2023-07-12 17:56:36 +08:00
parent f870682e25
commit a9588815b8
29 changed files with 1599 additions and 217 deletions

View File

@@ -6,7 +6,6 @@
Page({
data: {
barHeight : getApp().globalData.barHeight, // 状态栏高度
openId : '',
nameValue : '', // 姓名
testTitle : '',
nameStatus : false, // 姓名填写弹框
@@ -20,19 +19,8 @@ Page({
onLoad(options) {
// 体验官 type=1或者type=2 直接面检,不用交钱
this.setData({
refertoType: options.type
refertoType: options.type || 0
})
this.setData({
openId: options.code
})
if(options) {
wx.login({
success: res => {
// 获取openid
this.openInfo(res.code)
}
})
}
},
onShow() {
@@ -47,18 +35,6 @@ Page({
this.ifAnalyze();
},
/**
* openid
*/
openInfo(code) {
wx.$api.auth.codeOpenid({code: code}).then(res => {
this.setData({
openId: res.data
})
}).catch(err => {})
},
/**
* 是否可检测
*/
@@ -192,11 +168,12 @@ Page({
* 确认支付1元
*/
payBtn(orderid) {
wx.showLoading({
title: '支付中...',
mask : true
})
wx.$api.index.skinPay(orderid,{type: 'miniapp', openid: this.data.openId}).then(res=>{
wx.$api.index.skinPay(orderid,{type: 'miniapp', openid: wx.getStorageSync("openid")}).then(res=>{
wx.hideLoading()
let payInfo = JSON.parse(res.data.wechat)
wx.requestPayment({

View File

@@ -5,8 +5,6 @@
Page({
data: {
payCode : '', // code获取openid
openId : '', // openid
userLogin : false, // 是否登录
testTitle : '', // 检测文字
disabled : false, // 支付按钮
@@ -21,16 +19,6 @@ Page({
},
onShow() {
wx.login({
success: res => {
this.setData({
payCode: res.code
})
// 获取openid
this.openInfo()
}
})
// 获取登录状态
if(wx.getStorageSync("token") != ''){
this.setData({
@@ -46,17 +34,6 @@ Page({
})
},
/**
* openid
*/
openInfo() {
wx.$api.auth.codeOpenid({code: this.data.payCode}).then(res => {
this.setData({
openId: res.data
})
}).catch(err => {})
},
/**
* 是否可检测
*/