101 lines
1.6 KiB
JavaScript
101 lines
1.6 KiB
JavaScript
// pages/payment/payment.js
|
|
var urlPath = require('../../config.js');
|
|
Page({
|
|
|
|
/**
|
|
* 页面的初始数据
|
|
*/
|
|
data: {
|
|
money: '00',
|
|
imgurl: "/img/zhengshu.png"
|
|
},
|
|
|
|
/**
|
|
* 生命周期函数--监听页面加载
|
|
*/
|
|
onLoad: function(options) {
|
|
var that = this;
|
|
wx.request({
|
|
url: urlPath.gMarketDetail, //查询
|
|
data: {
|
|
'openid': wx.getStorageSync('openid'),
|
|
id: options.id,
|
|
},
|
|
header: {
|
|
'content-type': 'application/x-www-form-urlencoded'
|
|
},
|
|
dataType: 'json', // 添加这个配置
|
|
method: 'post',
|
|
success(res) {
|
|
if (res.data.result == "success") {
|
|
var jsdata = JSON.parse(res.data.data)
|
|
console.log(jsdata);
|
|
that.setData({
|
|
imgurl: (urlPath.host + jsdata.certs[0].img)
|
|
})
|
|
}
|
|
|
|
}
|
|
})
|
|
this.setData({
|
|
money: options.paid_money,
|
|
neutralization_id: options.neutralization_id
|
|
})
|
|
},
|
|
goUrl(e) {
|
|
console.log(this.data.imgurl)
|
|
wx.navigateTo({
|
|
url: '/pages/certificate_detail/certificate_detail?imgurl=' + this.data.imgurl
|
|
});
|
|
},
|
|
|
|
/**
|
|
* 生命周期函数--监听页面初次渲染完成
|
|
*/
|
|
onReady: function() {
|
|
|
|
},
|
|
|
|
/**
|
|
* 生命周期函数--监听页面显示
|
|
*/
|
|
onShow: function() {
|
|
|
|
},
|
|
|
|
/**
|
|
* 生命周期函数--监听页面隐藏
|
|
*/
|
|
onHide: function() {
|
|
|
|
},
|
|
|
|
/**
|
|
* 生命周期函数--监听页面卸载
|
|
*/
|
|
onUnload: function() {
|
|
|
|
},
|
|
|
|
/**
|
|
* 页面相关事件处理函数--监听用户下拉动作
|
|
*/
|
|
onPullDownRefresh: function() {
|
|
|
|
},
|
|
|
|
/**
|
|
* 页面上拉触底事件的处理函数
|
|
*/
|
|
onReachBottom: function() {
|
|
|
|
},
|
|
|
|
/**
|
|
* 用户点击右上角分享
|
|
*/
|
|
onShareAppMessage: function() {
|
|
|
|
}
|
|
})
|