From 62a240df3ff2f1bcddea834ccb15fccefc51ae26 Mon Sep 17 00:00:00 2001
From: liuwh <hugeinfo123>
Date: Sat, 09 May 2020 09:18:16 +0800
Subject: [PATCH] 5-8开发任务
---
SunshineLnsMinApp/pages/fzpxInfo/fzpxInfo.js | 86 +++++++++++++++++++++++++++++++++++++------
1 files changed, 74 insertions(+), 12 deletions(-)
diff --git a/SunshineLnsMinApp/pages/fzpxInfo/fzpxInfo.js b/SunshineLnsMinApp/pages/fzpxInfo/fzpxInfo.js
index 1efb2b9..ad275eb 100644
--- a/SunshineLnsMinApp/pages/fzpxInfo/fzpxInfo.js
+++ b/SunshineLnsMinApp/pages/fzpxInfo/fzpxInfo.js
@@ -9,19 +9,25 @@
* 页面的初始数据
*/
data: {
+ user: app.globalData.imgUrl + '/image/user.svg',
loading: false,
peopleInfo: {},
signStatus: '',
+ id: "",
+ topattList: [],
+ bottomattList: [],
+ statequeId: '',
},
/**
* 生命周期函数--监听页面加载
*/
- onLoad: function (options) {
+ onLoad: function(options) {
+ console.log('options', options)
var that = this;
that.setData({
id: options.id,
- signStatus: options.signStatus || '',
+ signStatus: options.signStatus || '1',
flag: options.flag || '',
loading: true
});
@@ -30,7 +36,7 @@
})
wx.request({
url: app.globalData.url + '/api/activity/find?id=' + options.id,
- success: function (res) {
+ success: function(res) {
console.log(res);
that.setData({
loading: false
@@ -38,8 +44,21 @@
wx.hideLoading();
if (res.data.code == 0) {
res.data.data.startTime = app.formatDate(res.data.data.startTime)
+ if (res.data.data.activityStatus == 3) {
+ if (res.data.data.queId) {
+ that.setData({
+ statequeId: res.data.data.queId
+ })
+ }
+ } else {
+ that.setData({
+ statequeId: ''
+ })
+ }
that.setData({
- activity: res.data.data
+ activity: res.data.data,
+ bottomattList: res.data.data.attList.filter((item) => (item.associateType == 1020)),
+ topattList: res.data.data.attList.filter((item) => (item.associateType == 1000))
})
console.log('传过来', options.flag)
console.log('传过来', options.signStatus)
@@ -93,7 +112,7 @@
},
// 跳转
- linkFunction: function () {
+ linkFunction: function() {
wx.showToast({
title: '抱歉,报名人数已满',
icon: 'none',
@@ -102,14 +121,29 @@
},
// 呼叫组织方
- makePhoneCall: function (e) {
+ makePhoneCall: function(e) {
var phone = e.currentTarget.dataset['phone'];
wx.makePhoneCall({
phoneNumber: phone
})
},
- inputChange: function (e) {
+ //跳转问卷调查
+ businessSchedule: function(e) {
+ var id = e.currentTarget.dataset['id'];
+ var questatus = e.currentTarget.dataset['questatus'];
+ if (questatus == 4) {
+ wx.navigateTo({
+ url: '/pages/warning/warning?msg=1',
+ })
+ } else {
+ wx.navigateTo({
+ url: '/pages/createSub/createSub?id=' + id,
+ })
+ }
+ },
+
+ inputChange: function(e) {
var name = e.currentTarget.dataset.name;
this.setData({
peopleInfo: {
@@ -120,25 +154,53 @@
},
// 签到
- sign: function () {
+ sign: function() {
+ var id = this.data.id;
+ var userinfo = wx.getStorageSync("user");
+ var userId = userinfo.id;
// 只允许从相机扫码
wx.scanCode({
onlyFromCamera: true,
success(res) {
console.log(res)
+ wx.showLoading({
+ title: '识别中',
+ })
+ wx.request({
+ url: app.globalData.url + '/api/activity/sign?id=' + id + '&code=' + res.result + '&userId=' + userId,
+ method: 'GET',
+ header: {
+ "Content-Type": "application/json"
+ },
+ success: function(res) {
+ wx.hideLoading();
+ if (res.data.code == 0) {
+ wx.showToast({
+ title: '签到成功!',
+ icon: 'success',
+ duration: 2000
+ })
+ } else {
+ wx.showToast({
+ title: '签到失败,请稍后重试!',
+ icon: 'none'
+ })
+ }
+ }
+ })
}
})
},
// 返回
- goBack: function () {
+ goBack: function() {
wx.navigateBack({
delta: 1
});
},
// 提交报名
- submit: function () {
+ submit: function() {
var peopleInfo = this.data.peopleInfo;
var userinfo = wx.getStorageSync("user");
var personId = userinfo.id;
@@ -176,7 +238,7 @@
header: {
"Content-Type": "application/json"
},
- success: function (res) {
+ success: function(res) {
wx.hideLoading();
if (res.data.code == 0) {
wx.reLaunch({
@@ -188,7 +250,7 @@
}))
} else {
wx.showToast({
- title: '报名失败,请稍后重试!',
+ title: res.data.msg,
icon: 'none'
})
}
--
Gitblit v1.8.0