| | |
| | | return; |
| | | } |
| | | if (savedate.activityPhone) { |
| | | if (!validator.phone(savedate.activityPhone)) { |
| | | return message.warning("联系电话格式不正确"); |
| | | if (!savedate.activityPhone) { |
| | | return message.warning("联系电话不能为空"); |
| | | } |
| | | } |
| | | Fetch.saveActive(savedate) |
| | |
| | | <Option value='act_3'>普法预约</Option> |
| | | </Select> |
| | | </Col> |
| | | <Col span={12} pull={0}></Col> |
| | | </Row> |
| | | </div> |
| | | <div style={divStyle}> |
| | | <Row type="flex" align='middle' justify="space-around"> |
| | | <Col span={6} pull={0} style={{ textAlign: 'center' }}><span>主持人</span></Col> |
| | | <Col span={6} push={0} ><Input disabled={disabled} placeholder="请输入主持人姓名" style={{ width: '300px' }} name='host' onChange={this.saveInputChange} value={savedate.host || ""} /></Col> |
| | | <Col span={6} pull={0} style={{ textAlign: 'center' }}><span>报名要求</span></Col> |
| | | <Col span={6} push={0} ><Input disabled={disabled} placeholder="请输入报名要求" style={{ width: '300px' }} name='requirement' onChange={this.saveInputChange} value={savedate.requirement || ""} /></Col> |
| | | </Row> |
| | | </div> |
| | | |
| | |
| | | <Col span={18} push={0} ><TextArea disabled={disabled} rows={4} placeholder="请输入活动描述" style={{ width: '92%' }} value={savedate.activityDesc || ""} onChange={this.saveInputChange} name='activityDesc' /></Col> |
| | | </Row> |
| | | </div> |
| | | <div style={divStyle}> |
| | | <Row type="flex" align='middle' justify="space-around"> |
| | | <Col span={6} pull={0} style={{ textAlign: 'center' }}><span>报名要求</span></Col> |
| | | <Col span={18} push={0} ><TextArea disabled={disabled} placeholder="请输入报名要求" style={{ width: '92%' }} name='requirement' onChange={this.saveInputChange} value={savedate.requirement || ""} /></Col> |
| | | </Row> |
| | | </div> |
| | | |
| | | <div style={divStyle}> |
| | | <Row type="flex" align='top' justify="space-around"> |
| | |
| | | flag: true, |
| | | hiddenApply: true, |
| | | // canApply: true, |
| | | statusWord: '' |
| | | |
| | | statusWord: '', |
| | | signStatus: '', |
| | | id: "" |
| | | }, |
| | | |
| | | onLoad: function (options) { |
| | | var that = this; |
| | | that.setData({ |
| | | id: options.id, |
| | | signStatus: options.signStatus || '', |
| | | flag: options.flag |
| | | }) |
| | | |
| | |
| | | |
| | | console.log('传过来',options.flag) |
| | | // 处理报名状态 |
| | | if (options.signStatus) { |
| | | that.setData({ |
| | | signStatus: options.signStatus |
| | | }) |
| | | }else{ |
| | | if(options.flag == 'true') { |
| | | //可报名 |
| | | console.log('可报名') |
| | |
| | | statusWord: '您已报名' |
| | | }) |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | // 签到 |
| | | 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 () { |
| | | wx.navigateBack({ |
| | | delta: 1 |
| | | }); |
| | | }, |
| | | |
| | | apply: function () { |
| | | // wx.navigateTo({ |
| | | // url: '../apply/apply', |
| | |
| | | </view> |
| | | </view> |
| | | |
| | | |
| | | <view wx:if="{{signStatus}}"> |
| | | <div class="submit" bindtap='submit'>提交报名</div> |
| | | <view wx:if="{{signStatus == 2}}"> |
| | | <view class="submit" bindtap='sign'>签到</view> |
| | | </view> |
| | | |
| | | <view wx:else> |
| | | <view class="submit bg-grey" bindtap='goBack'>返回</view> |
| | | </view> |
| | | </view> |
| | | <view wx:else> |
| | | <!-- 我要报名窗口 --> |
| | | <block wx:if="{{canApply == true}}"> |
| | | <view class="activityDetail-apply" hidden="{{!hiddenApply}}"> |
| | |
| | | <div class="activityDetail-main-buttton">{{statusWord}}</div> |
| | | </view> |
| | | </block> |
| | | </view> |
| | | |
| | | <view hidden="{{hiddenApply}}"> |
| | | <div class="apply"> |
| | |
| | | |
| | | .tel-area{ |
| | | height: 6vh; |
| | | margin-top: ; |
| | | padding: 0 2vh; |
| | | font-size: 14px; |
| | | display:flex; |
| | |
| | | loading: false, |
| | | peopleInfo: {}, |
| | | signStatus: '', |
| | | id: "" |
| | | }, |
| | | |
| | | /** |
| | |
| | | |
| | | // 签到 |
| | | 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' |
| | | }) |
| | | } |
| | | } |
| | | }) |
| | | } |
| | | }) |
| | | }, |
| | |
| | | }) |
| | | } else if (activityType == "南检活动") { |
| | | wx.navigateTo({ |
| | | url: '../scanEvildoing/scanEvildoing?id=' + businessId, |
| | | url: '../activityDetail/activityDetail?id=' + id + '&signStatus=' + signStatus, |
| | | }) |
| | | } else if (activityType == "基地参观") { |
| | | wx.navigateTo({ |