Commit 668bee6f by 汪睦雄

'ddd'

parent d1e19931
......@@ -32,7 +32,7 @@ Page({
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
onLoad: function(options) {
if (options.id) {
this.setData({
id: options.id
......@@ -43,7 +43,7 @@ Page({
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
onReady: function() {
let that = this
wx.showNavigationBarLoading()
wx.showLoading({
......@@ -58,7 +58,7 @@ Page({
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
onShow: function() {
this.setData({
user: app.globalData.userInfo
})
......@@ -72,7 +72,7 @@ Page({
}
},
getDetailData: function () {
getDetailData: function() {
api.project.detail({
id: this.data.id
}).then(res => {
......@@ -84,8 +84,9 @@ Page({
})
},
handlePhoneAuth: function (event) {
handlePhoneAuth: function(event) {
Wx.login().then(res => {
console.log('wx.login', res, ' event:', event)
let encryptedData = event.detail.encryptedData
let iv = event.detail.iv
this.decodePhoneData(res.code, encryptedData, iv)
......@@ -95,13 +96,15 @@ Page({
/**
* 解密手机号数据
*/
decodePhoneData: function (code, encryptedData, iv) {
decodePhoneData: function(code, encryptedData, iv) {
let that = this
api.getPhoneNumber({
code: code,
encryptedData: encryptedData,
iv: iv
iv: encodeURIComponent(iv),
version: 1.1
}).then(res => {
console.log('iv: ', iv, ' res.code: ', res.code)
if (!res.code) {
$Toast({
content: '手机号授权成功',
......@@ -111,12 +114,12 @@ Page({
phone: res.data.phone
})
// 将刚拿到的手机号码放到全局数据中,否则phone数据只会是当前页面数据
if (app.globalData.userInfo){
if (app.globalData.userInfo) {
app.globalData.userInfo.phone = res.data.phone
}
} else {
$Toast({
content: '手机号授权失败',
content: res.msg,
type: 'error'
});
}
......@@ -124,48 +127,48 @@ Page({
},
// 家庭组数
bindPickerChange: function (event) {
bindPickerChange: function(event) {
this.setData({
familyNum: parseInt(event.detail.value)
})
},
handleNickname: function (event) {
handleNickname: function(event) {
this.setData({
nickname: event.detail.value
})
},
handleAdultNum: function (event) {
handleAdultNum: function(event) {
this.setData({
adultNum: parseInt(event.detail.value)
})
},
handleChildrenNum: function (event) {
handleChildrenNum: function(event) {
this.setData({
childrenNum: parseInt(event.detail.value)
})
},
handleChildrenAge: function (event) {
handleChildrenAge: function(event) {
this.setData({
childrenAge: event.detail.value
})
},
handleRemark: function (event) {
handleRemark: function(event) {
this.setData({
remark: event.detail.value
})
},
handleAddress: function (event) {
handleAddress: function(event) {
this.setData({
address: event.detail.value
})
},
handleSubmit: function () {
handleSubmit: function() {
let that = this
if (!this.data.nickname || !this.data.phone) {
$Toast({
......@@ -209,10 +212,10 @@ Page({
package: '' + res.result.package,
signType: '' + res.result.signType,
paySign: '' + res.result.paySign,
success: function (ret) {
success: function(ret) {
console.log(ret)
if (ret.errMsg === 'requestPayment:ok') {
that.setOrderPaid(that.data.order.order_id, function (res) {
that.setOrderPaid(that.data.order.order_id, function(res) {
// 支付同步回调结果
console.log("发送模版消息", res)
// 跳转到订单页面
......
......@@ -41,12 +41,12 @@
<input slot="footer" class='input' type='text' placeholder='请输入您的姓名' bindinput='handleNickname' value='{{nickname}}'></input>
</i-cell>
<i-cell title="手机号" i-class="cell-class">
<block wx:if="{{phone.length == 0}}">
<!-- <block wx:if="{{phone.length == 0}}"> -->
<button slot="footer" bindgetphonenumber="handlePhoneAuth" type="info" open-type="getPhoneNumber" class="btn-auth-phone">授权手机号</button>
</block>
<!-- </block>
<block wx:else>
<text slot="footer">{{phone}}</text>
</block>
</block> -->
</i-cell>
<i-cell title="成人人数" is-link i-class="cell-class">
<picker slot="footer" class="num-picker" bindchange="handleAdultNum" range="{{nums}}" value="{{adultNum}}">
......
......@@ -38,7 +38,7 @@
"list": []
},
"miniprogram": {
"current": 14,
"current": 2,
"list": [
{
"id": 0,
......@@ -54,9 +54,9 @@
},
{
"id": 2,
"name": "下单",
"pathName": "pages/me/order/index",
"query": ""
"name": "立即报名",
"pathName": "pages/detail/enroll/index",
"query": "id=298"
},
{
"id": 3,
......
......@@ -5,9 +5,9 @@
// }
export const Config = {
apiPath: "https://meixzz.usa1.utools.club/api/",
mobPath: "https://mavaler.jqhulian.com/mob/",
shopJoinPath: "https://mavaler.jqhulian.com/mob/Index/shopjoin"
apiPath: "https://wxapp.maveler.com/api/",
mobPath: "https://wxapp.maveler.com/mob/",
shopJoinPath: "https://wxapp.maveler.com/mob/Index/shopjoin"
}
export default Config
\ No newline at end of file
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