Commit 668bee6f by 汪睦雄

'ddd'

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