|
|
@@ -1,6 +1,7 @@ |
|
|
|
const util = require("../../../utils/util.js"); |
|
|
|
const Http = require("../../../utils/HttpBasics"); |
|
|
|
const config = require("../../../config/config"); |
|
|
|
let app = getApp(); |
|
|
|
Page({ |
|
|
|
/** |
|
|
|
* 页面的初始数据 |
|
|
@@ -10,6 +11,7 @@ Page({ |
|
|
|
flag: 1, |
|
|
|
answerflag: "", |
|
|
|
flagsex: 0, |
|
|
|
useImg:0, |
|
|
|
items: [{ |
|
|
|
name: 1, |
|
|
|
value: '男', |
|
|
@@ -184,6 +186,30 @@ Page({ |
|
|
|
that.getDetail(options.activityId); |
|
|
|
} |
|
|
|
}, |
|
|
|
uploadImg() { |
|
|
|
let that = this; |
|
|
|
wx.chooseImage({ |
|
|
|
success(res) { |
|
|
|
const tempFilePaths = res.tempFilePaths |
|
|
|
console.log(config.api.imgUpload) |
|
|
|
console.log(res) |
|
|
|
wx.uploadFile({ |
|
|
|
url: config.api.imgUpload, // 仅为示例,非真实的接口地址 |
|
|
|
filePath: tempFilePaths[0], |
|
|
|
name: 'file', |
|
|
|
header: { |
|
|
|
'token': app.globalData.token |
|
|
|
}, |
|
|
|
success(res) { |
|
|
|
const data = res.data |
|
|
|
that.setData({ |
|
|
|
receiptUrl: JSON.parse(res.data).data.url |
|
|
|
}) |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
getDetail(activityId) { |
|
|
|
let that = this; |
|
|
|
Http.get({ |
|
|
@@ -193,6 +219,9 @@ Page({ |
|
|
|
} |
|
|
|
}).then(res => { |
|
|
|
if (res && res.data && res.data.activity) { |
|
|
|
this.setData({ |
|
|
|
useImg: res.data.activity.useImg |
|
|
|
}) |
|
|
|
if (res.data && res.data.activity && res.data.activity.question) { |
|
|
|
that.setData({ |
|
|
|
question: JSON.parse(res.data.activity.question) |
|
|
|