|
@@ -50,34 +50,6 @@ Page({
|
|
app.globalData.ptStudent = pt_student;
|
|
app.globalData.ptStudent = pt_student;
|
|
}
|
|
}
|
|
|
|
|
|
- wx.request({
|
|
|
|
- url: api.getShareInfoUrl,
|
|
|
|
- method: 'GET',
|
|
|
|
- data: {
|
|
|
|
- 'student_id': pt_student.id
|
|
|
|
- },
|
|
|
|
- success: res => {
|
|
|
|
- if(res.data.status == 'success') {
|
|
|
|
- this.setData({
|
|
|
|
- shareCanvasWidth: res.data.width,
|
|
|
|
- shareCanvasHeight: res.data.height,
|
|
|
|
- shareImage: res.data.shareImage,
|
|
|
|
- shareText: res.data.shareText,
|
|
|
|
- shareTextPosX: res.data.shareTextPosX,
|
|
|
|
- shareTextPosY: res.data.shareTextPosY,
|
|
|
|
- })
|
|
|
|
- wx.downloadFile({
|
|
|
|
- url: res.data.shareImage,
|
|
|
|
- success: res => {
|
|
|
|
- this.setData({
|
|
|
|
- shareImage: res.tempFilePath
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
-
|
|
|
|
wx.getLocation({
|
|
wx.getLocation({
|
|
success: (res) => {
|
|
success: (res) => {
|
|
// let validLocation = this.validLocation(res.latitude, res.longitude)
|
|
// let validLocation = this.validLocation(res.latitude, res.longitude)
|
|
@@ -86,9 +58,11 @@ Page({
|
|
method: 'GET',
|
|
method: 'GET',
|
|
data: {
|
|
data: {
|
|
latitude: res.latitude,
|
|
latitude: res.latitude,
|
|
- longitude: res.longitude
|
|
|
|
|
|
+ longitude: res.longitude,
|
|
|
|
+ student_id: pt_student.id
|
|
},
|
|
},
|
|
success: res => {
|
|
success: res => {
|
|
|
|
+ console.log(res)
|
|
if (res.data.status == 'success' && res.data.result == 'ok') {
|
|
if (res.data.status == 'success' && res.data.result == 'ok') {
|
|
let validLocation = api.isTest ? true : false;
|
|
let validLocation = api.isTest ? true : false;
|
|
this.setData({
|
|
this.setData({
|
|
@@ -105,6 +79,34 @@ Page({
|
|
|
|
|
|
}
|
|
}
|
|
})
|
|
})
|
|
|
|
+
|
|
|
|
+ wx.request({
|
|
|
|
+ url: api.getShareInfoUrl,
|
|
|
|
+ method: 'GET',
|
|
|
|
+ data: {
|
|
|
|
+ 'student_id': pt_student.id
|
|
|
|
+ },
|
|
|
|
+ success: res => {
|
|
|
|
+ if (res.data.status == 'success') {
|
|
|
|
+ this.setData({
|
|
|
|
+ shareCanvasWidth: res.data.width,
|
|
|
|
+ shareCanvasHeight: res.data.height,
|
|
|
|
+ shareImage: res.data.shareImage,
|
|
|
|
+ shareText: res.data.shareText,
|
|
|
|
+ shareTextPosX: res.data.shareTextPosX,
|
|
|
|
+ shareTextPosY: res.data.shareTextPosY,
|
|
|
|
+ })
|
|
|
|
+ wx.downloadFile({
|
|
|
|
+ url: res.data.shareImage,
|
|
|
|
+ success: res => {
|
|
|
|
+ this.setData({
|
|
|
|
+ shareImage: res.tempFilePath
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ })
|
|
},
|
|
},
|
|
validLocation(latitude, longitude) {
|
|
validLocation(latitude, longitude) {
|
|
let res = api.isTest ? true : false;
|
|
let res = api.isTest ? true : false;
|