|
@@ -0,0 +1,767 @@
|
|
|
+// pages/my/activity/activity.js
|
|
|
+const App = getApp();
|
|
|
+const util = require("../../utils/tool");
|
|
|
+let CityArray0 = [];
|
|
|
+let CityArray1 = [];
|
|
|
+let CityArray2 = [];
|
|
|
+Page({
|
|
|
+ /**
|
|
|
+ * 页面的初始数据
|
|
|
+ */
|
|
|
+ data: {
|
|
|
+ appAssetsUrl2: App.appAssetsUrl2,
|
|
|
+ user: wx.getStorageSync("USER"),
|
|
|
+ lng: null,
|
|
|
+ lat: null,
|
|
|
+ activityId: null,
|
|
|
+ detail: {},
|
|
|
+ region: [],
|
|
|
+ // 负责人
|
|
|
+ staffId: null,
|
|
|
+ // 负责人联系电话
|
|
|
+ teacherPhone: null,
|
|
|
+ // 活动标题
|
|
|
+ title: null,
|
|
|
+ // 省
|
|
|
+ province: null,
|
|
|
+ // 市
|
|
|
+ city: null,
|
|
|
+ // 区
|
|
|
+ area: null,
|
|
|
+ // 活动地址
|
|
|
+ address: null,
|
|
|
+ // 坐标
|
|
|
+ coordinate: null,
|
|
|
+ // 活动时间
|
|
|
+ startTime: null,
|
|
|
+ endTime: null,
|
|
|
+ startTimeDate: null,
|
|
|
+ startTimeHS: null,
|
|
|
+ endTimeDate: null,
|
|
|
+ endTimeHS: null,
|
|
|
+ // 报名截止
|
|
|
+ registrationEnd: null,
|
|
|
+ registrationEndDate: null,
|
|
|
+ registrationEndHS: null,
|
|
|
+ // 集合时间
|
|
|
+ meetingTime: null,
|
|
|
+ // 集合日期
|
|
|
+ meetingTimeDate: null,
|
|
|
+ // 集合日期时间
|
|
|
+ meetingTimeHS: null,
|
|
|
+ // 活动费用
|
|
|
+ isNeedVip: 0,
|
|
|
+ money: null,
|
|
|
+ // 是否推荐至首页
|
|
|
+ isTop: null,
|
|
|
+ // 报名数
|
|
|
+ willnum: null,
|
|
|
+ // 活动封面图
|
|
|
+ thumbnailImg: null,
|
|
|
+ // 兼职banner图
|
|
|
+ bannerImg: null,
|
|
|
+ // 活动详情
|
|
|
+ content: null,
|
|
|
+ // 联系二维码
|
|
|
+ qrCodePicture: null,
|
|
|
+ contactInstructions: null,
|
|
|
+ multiArray: [],
|
|
|
+ multiIndex: [],
|
|
|
+ activityjs: null,
|
|
|
+ activityyq: null,
|
|
|
+ activitysx: null,
|
|
|
+ auditStatus: null,
|
|
|
+ labelListIndex: null,
|
|
|
+ labelList: []
|
|
|
+ },
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 生命周期函数--监听页面加载
|
|
|
+ */
|
|
|
+ onLoad(options) {
|
|
|
+ if (options.activityId) {
|
|
|
+ this.setData({
|
|
|
+ activityId: options.activityId,
|
|
|
+ });
|
|
|
+ this.getDetail();
|
|
|
+ } else {
|
|
|
+ this.getProvince();
|
|
|
+ }
|
|
|
+ this.setData({
|
|
|
+ staffId: this.data.user.id,
|
|
|
+ teacherPhone: this.data.user.phone,
|
|
|
+ });
|
|
|
+ this.getCoord();
|
|
|
+ this.getLabel()
|
|
|
+ },
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 生命周期函数--监听页面初次渲染完成
|
|
|
+ */
|
|
|
+ onReady() {},
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 生命周期函数--监听页面显示
|
|
|
+ */
|
|
|
+ onShow() {},
|
|
|
+
|
|
|
+ // 获取经纬度
|
|
|
+ getCoord() {
|
|
|
+ wx.getLocation({
|
|
|
+ type: "gcj02",
|
|
|
+ success: (res) => {
|
|
|
+ const latitude = res.latitude;
|
|
|
+ const longitude = res.longitude;
|
|
|
+ this.setData({
|
|
|
+ lng: Number(longitude),
|
|
|
+ lat: Number(latitude),
|
|
|
+ });
|
|
|
+ },
|
|
|
+ fail: (e) => {},
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
+ // 获取省
|
|
|
+ getProvince() {
|
|
|
+ App._get("region/provinceList", {}, (res) => {
|
|
|
+ let pId = "";
|
|
|
+ let prov = "";
|
|
|
+ if (res.code === 0) {
|
|
|
+ let provice = res.data;
|
|
|
+ this.data.multiArray[0] = provice;
|
|
|
+ CityArray0 = provice;
|
|
|
+ if (CityArray0.length) {
|
|
|
+ for (let i = 0; i < CityArray0.length; i++) {
|
|
|
+ if (CityArray0[i].id == this.data.province) {
|
|
|
+ this.data.multiIndex[0] = i;
|
|
|
+ break;
|
|
|
+ } else {
|
|
|
+ this.data.multiIndex[0] = 0;
|
|
|
+ // break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (this.data.province) {
|
|
|
+ pId = this.data.province;
|
|
|
+ } else {
|
|
|
+ //根据默认省,获取默认市
|
|
|
+ if (this.data.multiArray[0].length) {
|
|
|
+ pId = this.data.multiArray[0][0].id;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.getCity(pId);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ //选择标签
|
|
|
+ labelPickerChange(e){
|
|
|
+ let labelListIndex = e.detail.value;
|
|
|
+ this.setData({
|
|
|
+ labelListIndex
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // labelList
|
|
|
+ getLabel() {
|
|
|
+ let that = this;
|
|
|
+ App._post_form('bizcatelog/apiSelectBizcatelog/act_title', '', null,
|
|
|
+ function(res) {
|
|
|
+ if(res.code == 0){
|
|
|
+ that.setData({
|
|
|
+ labelList: res.dictList
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ getCity(pId) {
|
|
|
+ App._get(`region/urbanDistrictList?id=${pId}`, {}, (res) => {
|
|
|
+ // App._get(`region/urbanDistrictList?id=420000`, {}, res => {
|
|
|
+ if (res.code === 0) {
|
|
|
+ let city = res.data;
|
|
|
+ this.data.multiArray[1] = city;
|
|
|
+ CityArray1 = city;
|
|
|
+ if (CityArray1.length) {
|
|
|
+ for (let i = 0; i < CityArray1.length; i++) {
|
|
|
+ // console.log(CityArray1[i].id, pId, 222)
|
|
|
+ if (CityArray1[i].pid === pId) {
|
|
|
+ this.data.multiIndex[1] = i;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ let cityId = "";
|
|
|
+ if (this.data.city) {
|
|
|
+ cityId = this.data.city;
|
|
|
+ } else {
|
|
|
+ if (this.data.multiArray[1].length) {
|
|
|
+ cityId = this.data.multiArray[1][0].id;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.getArea(cityId);
|
|
|
+ this.setData({
|
|
|
+ multiArray: this.data.multiArray,
|
|
|
+ multiIndex: this.data.multiIndex,
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
+ // 获取区
|
|
|
+ getArea(cityId) {
|
|
|
+ for (let i = 0; i < this.data.multiArray[1].length; i++) {
|
|
|
+ console.log(this.data.multiArray[1], cityId, "area");
|
|
|
+ if (this.data.multiArray[1][i].id === cityId) {
|
|
|
+ CityArray2 = this.data.multiArray[1][i].childRegionList;
|
|
|
+ this.data.multiArray[2] = this.data.multiArray[1][i].childRegionList;
|
|
|
+ this.data.multiIndex[2] = i;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (this.data.area) {
|
|
|
+ for (let j = 0; j < this.data.multiArray[2].length; j++) {
|
|
|
+ if (this.data.multiArray[2][j].id === this.data.area) {
|
|
|
+ this.data.multiIndex[2] = j;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.setData({
|
|
|
+ multiArray: this.data.multiArray,
|
|
|
+ multiIndex: this.data.multiIndex,
|
|
|
+ });
|
|
|
+ console.log(this.data.multiArray, this.data.multiIndex, 1111);
|
|
|
+ },
|
|
|
+
|
|
|
+ areaChange(e) {
|
|
|
+ this.data.multiIndex[0] = e.detail.value[0];
|
|
|
+ this.data.multiIndex[1] = e.detail.value[1];
|
|
|
+ this.data.multiIndex[2] = e.detail.value[2];
|
|
|
+ let province = CityArray0[e.detail.value[0]].id;
|
|
|
+ let city = CityArray1[e.detail.value[1]].id;
|
|
|
+ let area = CityArray2[e.detail.value[2]].id;
|
|
|
+ this.setData({
|
|
|
+ multiIndex: this.data.multiIndex,
|
|
|
+ province: province,
|
|
|
+ city: city,
|
|
|
+ area: area,
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
+ MultiPickerAreaChange(e) {
|
|
|
+ if (e.detail.column == 0) {
|
|
|
+ let pid = CityArray0[e.detail.value].id;
|
|
|
+ this.data.multiIndex[0] = e.detail.value;
|
|
|
+ this.getCity(pid);
|
|
|
+ } else if (e.detail.column == 1) {
|
|
|
+ let pid = CityArray1[e.detail.value].id;
|
|
|
+ this.data.multiIndex[1] = e.detail.value;
|
|
|
+ this.getArea(pid);
|
|
|
+ } else {
|
|
|
+ this.data.multiIndex[2] = e.detail.value;
|
|
|
+ }
|
|
|
+ this.setData({
|
|
|
+ multiIndex: this.data.multiIndex,
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
+ // 活动时间
|
|
|
+ startTimeBindDateChange(e) {
|
|
|
+ this.setData({
|
|
|
+ startTimeDate: e.detail.value,
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
+ startTimeBindTimeChange(e) {
|
|
|
+ this.setData({
|
|
|
+ startTimeHS: e.detail.value,
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
+ endTimeBindDateChange(e) {
|
|
|
+ this.setData({
|
|
|
+ endTimeDate: e.detail.value,
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
+ endTimeBindTimeChange(e) {
|
|
|
+ this.setData({
|
|
|
+ endTimeHS: e.detail.value,
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
+ // 报名截止
|
|
|
+ registrationEndBindDateChange(e) {
|
|
|
+ this.setData({
|
|
|
+ registrationEndDate: e.detail.value,
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
+ registrationEndBindTimeChange(e) {
|
|
|
+ this.setData({
|
|
|
+ registrationEndHS: e.detail.value,
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
+ // 集合时间
|
|
|
+ meetingBindDateChange(e) {
|
|
|
+ this.setData({
|
|
|
+ meetingTimeDate: e.detail.value,
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
+ meetingBindTimeChange(e) {
|
|
|
+ this.setData({
|
|
|
+ meetingTimeHS: e.detail.value,
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
+ // 活动 免费
|
|
|
+ freeRadioChange(e) {
|
|
|
+ if (e.detail.value == 1) {
|
|
|
+ this.data.money = 0;
|
|
|
+ }
|
|
|
+ this.setData({
|
|
|
+ isNeedVip: e.detail.value,
|
|
|
+ money: this.data.money,
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
+ // 推荐首页
|
|
|
+ recommendRadioChange(e) {
|
|
|
+ this.setData({
|
|
|
+ isTop: e.detail.value,
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
+ changeAddress() {
|
|
|
+ if (this.data.auditStatus == 1) {
|
|
|
+ wx.showToast({
|
|
|
+ icon: "none",
|
|
|
+ title: "活动进行中",
|
|
|
+ });
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ wx.chooseLocation({
|
|
|
+ success: (res) => {
|
|
|
+ console.log(res, 1111);
|
|
|
+ wx.showLoading({
|
|
|
+ title: "获取位置中...",
|
|
|
+ });
|
|
|
+ App._get(
|
|
|
+ "store/getDetailsAddress",
|
|
|
+ {
|
|
|
+ lon: res.longitude,
|
|
|
+ lat: res.latitude,
|
|
|
+ },
|
|
|
+ (res2) => {
|
|
|
+ if (res2.code === 0) {
|
|
|
+ wx.hideLoading();
|
|
|
+ this.setData({
|
|
|
+ address: res2.data.street_number,
|
|
|
+ coordinate: res.longitude + "," + res.latitude,
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ );
|
|
|
+ },
|
|
|
+ });
|
|
|
+ // wx.navigateTo({
|
|
|
+ // url: `/activity/map/map?lng=${this.data.lng}&lat=${this.data.lat}`,
|
|
|
+ // })
|
|
|
+ },
|
|
|
+
|
|
|
+ uploadHandle(e) {
|
|
|
+ if (this.data.auditStatus == 1) {
|
|
|
+ wx.showToast({
|
|
|
+ icon: "none",
|
|
|
+ title: "活动进行中",
|
|
|
+ });
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ console.log(e, 11111111);
|
|
|
+ let currentIndex = e.currentTarget.dataset.index;
|
|
|
+ // if (this.data.list.length == 3) {
|
|
|
+ // return false
|
|
|
+ // }
|
|
|
+ let _this = this;
|
|
|
+ var tempFile;
|
|
|
+ wx.showActionSheet({
|
|
|
+ itemList: ["拍照上传", "从相册中选择"],
|
|
|
+ success(res) {
|
|
|
+ if (res.tapIndex === 0) {
|
|
|
+ wx.chooseImage({
|
|
|
+ count: 1,
|
|
|
+ sizeType: ["original", "compressed"],
|
|
|
+ sourceType: ["camera"],
|
|
|
+ success(res) {
|
|
|
+ const tempFilePaths = res.tempFilePaths;
|
|
|
+ wx.uploadFile({
|
|
|
+ url: App.apiRoot + "file/upload",
|
|
|
+ filePath: tempFilePaths[0],
|
|
|
+ name: "file",
|
|
|
+ success: function (res) {
|
|
|
+ if (res.errMsg === "uploadFile:ok") {
|
|
|
+ wx.showToast({
|
|
|
+ title: "上传成功",
|
|
|
+ image: "",
|
|
|
+ duration: 1500,
|
|
|
+ mask: false,
|
|
|
+ });
|
|
|
+ let data = JSON.parse(res.data);
|
|
|
+ if (currentIndex == 0) {
|
|
|
+ _this.data.thumbnailImg = data.data;
|
|
|
+ _this.setData({
|
|
|
+ thumbnailImg: _this.data.thumbnailImg,
|
|
|
+ });
|
|
|
+ } else if (currentIndex == 1) {
|
|
|
+ _this.data.bannerImg = data.data;
|
|
|
+ _this.setData({
|
|
|
+ bannerImg: _this.data.bannerImg,
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ _this.data.qrCodePicture = data.data;
|
|
|
+ _this.setData({
|
|
|
+ qrCodePicture: _this.data.qrCodePicture,
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ function() {
|
|
|
+ wx.showToast({
|
|
|
+ title: "上传失败",
|
|
|
+ icon: "none",
|
|
|
+ image: "",
|
|
|
+ duration: 1500,
|
|
|
+ mask: false,
|
|
|
+ });
|
|
|
+ },
|
|
|
+ });
|
|
|
+ },
|
|
|
+ });
|
|
|
+ } else if (res.tapIndex === 1) {
|
|
|
+ wx.chooseImage({
|
|
|
+ count: 1,
|
|
|
+ sizeType: ["original", "compressed"],
|
|
|
+ sourceType: ["album"],
|
|
|
+ success(res) {
|
|
|
+ const tempFilePaths = res.tempFilePaths;
|
|
|
+ wx.uploadFile({
|
|
|
+ url: App.apiRoot + "file/upload",
|
|
|
+ filePath: tempFilePaths[0],
|
|
|
+ name: "file",
|
|
|
+ success: function (res) {
|
|
|
+ if (res.errMsg === "uploadFile:ok") {
|
|
|
+ wx.showToast({
|
|
|
+ title: "上传成功",
|
|
|
+ image: "",
|
|
|
+ duration: 1500,
|
|
|
+ mask: false,
|
|
|
+ });
|
|
|
+
|
|
|
+ let data = JSON.parse(res.data);
|
|
|
+ if (currentIndex == 0) {
|
|
|
+ _this.data.thumbnailImg = data.data;
|
|
|
+ _this.setData({
|
|
|
+ thumbnailImg: _this.data.thumbnailImg,
|
|
|
+ });
|
|
|
+ } else if (currentIndex == 1) {
|
|
|
+ _this.data.bannerImg = data.data;
|
|
|
+ _this.setData({
|
|
|
+ bannerImg: _this.data.bannerImg,
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ _this.data.qrCodePicture = data.data;
|
|
|
+ _this.setData({
|
|
|
+ qrCodePicture: _this.data.qrCodePicture,
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ function() {
|
|
|
+ wx.showToast({
|
|
|
+ title: "上传失败",
|
|
|
+ icon: "none",
|
|
|
+ image: "",
|
|
|
+ duration: 1500,
|
|
|
+ mask: false,
|
|
|
+ success: (result) => {},
|
|
|
+ fail: () => {},
|
|
|
+ complete: () => {},
|
|
|
+ });
|
|
|
+ },
|
|
|
+ });
|
|
|
+ },
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
+ fail(res) {},
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
+ submit() {
|
|
|
+ let startTime = this.data.startTimeDate + " " + this.data.startTimeHS;
|
|
|
+ let endTime = this.data.endTimeDate + " " + this.data.endTimeHS;
|
|
|
+ if (!this.data.title) {
|
|
|
+ return util.alert("请先填写活动标题");
|
|
|
+ }
|
|
|
+ if (!this.data.city || !this.data.area) {
|
|
|
+ return util.alert("请先选择所属区域");
|
|
|
+ }
|
|
|
+ if (!this.data.address) {
|
|
|
+ return util.alert("请先选择活动地址");
|
|
|
+ }
|
|
|
+ // if (!startTime || !endTime) {
|
|
|
+ // return util.alert("请先选择活动时间");
|
|
|
+ // }
|
|
|
+ if (!this.data.startTimeDate || !this.data.startTimeHS || !this.data.endTimeDate || !this.data.endTimeHS) {
|
|
|
+ return util.alert("请先选择活动时间");
|
|
|
+ }
|
|
|
+ if (!this.data.registrationEndDate || !this.data.registrationEndHS) {
|
|
|
+ return util.alert("请先选择报名截止时间");
|
|
|
+ }
|
|
|
+ if (!this.data.meetingTimeDate || !this.data.meetingTimeHS) {
|
|
|
+ return util.alert("请先选择集合时间");
|
|
|
+ }
|
|
|
+ console.log(this.data.money,'this.data.money')
|
|
|
+ if (this.data.money === null) {
|
|
|
+ return util.alert("请填写活动费用");
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!this.data.willnum) {
|
|
|
+ return util.alert("请输入报名人数");
|
|
|
+ }
|
|
|
+ if (!this.data.thumbnailImg) {
|
|
|
+ return util.alert("请先上传活动封面缩略图");
|
|
|
+ }
|
|
|
+ if (!this.data.bannerImg) {
|
|
|
+ return util.alert("请先上传兼职详情banner图");
|
|
|
+ }
|
|
|
+ if (!this.data.qrCodePicture) {
|
|
|
+ return util.alert("请先上传联系二维码图");
|
|
|
+ }
|
|
|
+ if (!this.data.contactInstructions) {
|
|
|
+ return util.alert("请先填写联系说明");
|
|
|
+ }
|
|
|
+ wx.showLoading({
|
|
|
+ title: "提交中,请稍后",
|
|
|
+ });
|
|
|
+ let list = [
|
|
|
+ this.data.activityjs,
|
|
|
+ this.data.activityyq,
|
|
|
+ this.data.activitysx,
|
|
|
+ ];
|
|
|
+ let obj = {
|
|
|
+ address: this.data.address,
|
|
|
+ area: this.data.area,
|
|
|
+ bannerImg: this.data.bannerImg,
|
|
|
+ city: this.data.city,
|
|
|
+ activityAppletsDetailsList: list,
|
|
|
+ coordinate: this.data.coordinate,
|
|
|
+ // endTime: this.data.endTimeDate + ' ' + this.data.endTimeHS,
|
|
|
+ endTime: endTime,
|
|
|
+ isNeedVip: this.data.isNeedVip,
|
|
|
+ isTop: this.data.isTop,
|
|
|
+ meetingTime: this.data.meetingTimeDate + " " + this.data.meetingTimeHS,
|
|
|
+ money: this.data.money,
|
|
|
+ province: this.data.province,
|
|
|
+ registrationEnd:
|
|
|
+ this.data.registrationEndDate + " " + this.data.registrationEndHS,
|
|
|
+ staffId: this.data.staffId,
|
|
|
+ // startTime: this.data.startTimeDate + ' ' + this.data.startTimeHS,
|
|
|
+ startTime: startTime,
|
|
|
+ teacherPhone: this.data.teacherPhone,
|
|
|
+ thumbnailImg: this.data.thumbnailImg,
|
|
|
+ qrCodePicture: this.data.qrCodePicture,
|
|
|
+ contactInstructions: this.data.contactInstructions,
|
|
|
+ title: this.data.title,
|
|
|
+ willnum: this.data.willnum,
|
|
|
+ memberId: this.data.user.id,
|
|
|
+ // is_applets_release 是否是小程序发布 1是 0否
|
|
|
+ isAppletsRelease: 1,
|
|
|
+ titleCode:this.data.labelList[this.data.labelListIndex].itemcode
|
|
|
+ };
|
|
|
+ wx.setStorageSync("activityDetail", obj);
|
|
|
+ if (this.data.activityId) {
|
|
|
+ wx.navigateTo({
|
|
|
+ url: "/activity/detail/detail?activityId=" + this.data.activityId,
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ wx.navigateTo({
|
|
|
+ url: "/activity/detail/detail",
|
|
|
+ });
|
|
|
+ }
|
|
|
+ return false;
|
|
|
+ // if (this.data.activityId) {
|
|
|
+ // App._put_form('activity/updateActivity', '', {
|
|
|
+ // ...obj,
|
|
|
+ // id: this.data.activityId
|
|
|
+ // }, res => {
|
|
|
+ // if (res.code === 0) {
|
|
|
+ // wx.showToast({
|
|
|
+ // title: '修改成功',
|
|
|
+ // })
|
|
|
+ // }
|
|
|
+ // }, err => {}, complete => {
|
|
|
+ // setTimeout(() => {
|
|
|
+ // wx.hideLoading()
|
|
|
+ // }, 300)
|
|
|
+ // })
|
|
|
+ // } else {
|
|
|
+ // App._post_form('activity/saveActivity', '', obj, res => {
|
|
|
+ // if (res.code === 0) {
|
|
|
+ // wx.showToast({
|
|
|
+ // title: '添加成功',
|
|
|
+ // })
|
|
|
+ // }
|
|
|
+ // }, err => {}, complete => {
|
|
|
+ // setTimeout(() => {
|
|
|
+ // wx.hideLoading()
|
|
|
+ // }, 300)
|
|
|
+ // })
|
|
|
+ // }
|
|
|
+ },
|
|
|
+
|
|
|
+ // 获取活动详情
|
|
|
+ getDetail() {
|
|
|
+ wx.showLoading({
|
|
|
+ title: "努力加载中...",
|
|
|
+ });
|
|
|
+ App._post_form(
|
|
|
+ "act/one",
|
|
|
+ "",
|
|
|
+ {
|
|
|
+ id: this.data.activityId,
|
|
|
+ stuId: this.data.user.id,
|
|
|
+ },
|
|
|
+ (res) => {
|
|
|
+ if (res.code === 0) {
|
|
|
+ this.setData({
|
|
|
+ detail: res.data,
|
|
|
+ title: res.data.title,
|
|
|
+ province: res.data.province,
|
|
|
+ city: res.data.city,
|
|
|
+ area: res.data.area,
|
|
|
+ // provincename: res.data.provincename,
|
|
|
+ // cityname: res.data.cityname,
|
|
|
+ // areaName: res.data.areaName,
|
|
|
+ address: res.data.address,
|
|
|
+ coordinate: res.data.coordinate,
|
|
|
+ startTime: res.data.startTime,
|
|
|
+ endTime: res.data.endTime,
|
|
|
+ startTimeDate: res.data.startTime.split(" ")[0],
|
|
|
+ startTimeHS: res.data.startTime.split(" ")[1],
|
|
|
+ endTimeDate: res.data.endTime.split(" ")[0],
|
|
|
+ endTimeHS: res.data.endTime.split(" ")[1],
|
|
|
+ registrationEnd: res.data.registrationEnd,
|
|
|
+ registrationEndDate: res.data.endTime.split(" ")[0],
|
|
|
+ registrationEndHS: res.data.endTime.split(" ")[1],
|
|
|
+ meetingTime: res.data.meetingTime,
|
|
|
+ meetingTimeDate: res.data.endTime.split(" ")[0],
|
|
|
+ meetingTimeHS: res.data.endTime.split(" ")[1],
|
|
|
+ isNeedVip: res.data.isNeedVip,
|
|
|
+ money: res.data.money,
|
|
|
+ isTop: res.data.isTop,
|
|
|
+ willnum: res.data.willnum,
|
|
|
+ thumbnailImg: res.data.thumbnailImg,
|
|
|
+ bannerImg: res.data.bannerImg,
|
|
|
+ qrCodePicture: res.data.qrCodePicture,
|
|
|
+ contactInstructions: res.data.contactInstructions,
|
|
|
+ activityjs: res.data.activityAppletsDetailsList[0],
|
|
|
+ activityyq: res.data.activityAppletsDetailsList[1],
|
|
|
+ activitysx: res.data.activityAppletsDetailsList[2],
|
|
|
+ auditStatus: res.data.auditStatus,
|
|
|
+ });
|
|
|
+ this.getProvince();
|
|
|
+ }
|
|
|
+ },
|
|
|
+ (err) => {},
|
|
|
+ (complete) => {
|
|
|
+ setTimeout(() => {
|
|
|
+ wx.hideLoading();
|
|
|
+ }, 300);
|
|
|
+ }
|
|
|
+ );
|
|
|
+ },
|
|
|
+
|
|
|
+ // 取消活动
|
|
|
+ // cancel() {
|
|
|
+ // let parm = {
|
|
|
+ // sid: this.data.user.id,
|
|
|
+ // aid: this.data.activityId,
|
|
|
+ // };
|
|
|
+ // App._post_form(
|
|
|
+ // "act/cancel",
|
|
|
+ // "application/json",
|
|
|
+ // JSON.stringify(parm),
|
|
|
+ // (res) => {
|
|
|
+ // if (res.code === 0) {
|
|
|
+ // wx.showModal({
|
|
|
+ // title: "温馨提示",
|
|
|
+ // content: "取消成功",
|
|
|
+ // showCancel: false,
|
|
|
+ // });
|
|
|
+ // wx.navigateBack();
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // );
|
|
|
+ // },
|
|
|
+ cancel() {
|
|
|
+ // let parm = {
|
|
|
+ // sid: this.data.user.id,
|
|
|
+ // aid: this.data.activityId,
|
|
|
+ // };
|
|
|
+ App._put_form(
|
|
|
+ "activity/cancelActivity/"+this.data.activityId,
|
|
|
+ "",
|
|
|
+ {},
|
|
|
+ (res) => {
|
|
|
+ if (res.code === 0) {
|
|
|
+ wx.showModal({
|
|
|
+ title: "温馨提示",
|
|
|
+ content: "取消成功",
|
|
|
+ showCancel: false,
|
|
|
+ });
|
|
|
+ wx.navigateBack();
|
|
|
+ }
|
|
|
+ },
|
|
|
+ err => {
|
|
|
+ wx.showToast({
|
|
|
+ icon: 'error',
|
|
|
+ title: '服务端异常',
|
|
|
+ })
|
|
|
+ }
|
|
|
+ );
|
|
|
+ },
|
|
|
+ // 查看报名信息
|
|
|
+ toApply() {
|
|
|
+ wx.navigateTo({
|
|
|
+ url:
|
|
|
+ "/activity/activityInfo/activityInfo?activityId=" +
|
|
|
+ this.data.activityId + "&willnum=" + this.data.willnum
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 生命周期函数--监听页面隐藏
|
|
|
+ */
|
|
|
+ onHide() {},
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 生命周期函数--监听页面卸载
|
|
|
+ */
|
|
|
+ onUnload() {},
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 页面相关事件处理函数--监听用户下拉动作
|
|
|
+ */
|
|
|
+ onPullDownRefresh() {},
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 页面上拉触底事件的处理函数
|
|
|
+ */
|
|
|
+ onReachBottom() {},
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 用户点击右上角分享
|
|
|
+ */
|
|
|
+ onShareAppMessage() {},
|
|
|
+});
|