forked from nsjcy/frontEnd/nsjcy

liuwh
2020-02-24 febf1743bfa473d7a00eaec206e833c9bd4ee5e5
修改
6 files modified
120 ■■■■ changed files
SunshineIns/src/page/ActiveManageEdit.jsx 17 ●●●● patch | view | raw | blame | history
SunshineLnsMinApp/pages/activityDetail/activityDetail.js 58 ●●●●● patch | view | raw | blame | history
SunshineLnsMinApp/pages/activityDetail/activityDetail.wxml 13 ●●●●● patch | view | raw | blame | history
SunshineLnsMinApp/pages/activityDetail/activityDetail.wxss 1 ●●●● patch | view | raw | blame | history
SunshineLnsMinApp/pages/fzpxInfo/fzpxInfo.js 29 ●●●●● patch | view | raw | blame | history
SunshineLnsMinApp/pages/myTranslate/myTranslate.js 2 ●●● patch | view | raw | blame | history
SunshineIns/src/page/ActiveManageEdit.jsx
@@ -118,8 +118,8 @@
            return;
        }
        if (savedate.activityPhone) {
            if (!validator.phone(savedate.activityPhone)) {
                return message.warning("联系电话格式不正确");
            if (!savedate.activityPhone) {
                return message.warning("联系电话不能为空");
            }
        }
        Fetch.saveActive(savedate)
@@ -396,15 +396,8 @@
                                        <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>
@@ -448,6 +441,12 @@
                                <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">
SunshineLnsMinApp/pages/activityDetail/activityDetail.js
@@ -14,14 +14,16 @@
    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
    })
    
@@ -37,6 +39,11 @@
          console.log('传过来',options.flag)
          // 处理报名状态
          if (options.signStatus) {
            that.setData({
              signStatus: options.signStatus
            })
          }else{
          if(options.flag == 'true') {
            //可报名
            console.log('可报名')
@@ -74,12 +81,59 @@
              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',
SunshineLnsMinApp/pages/activityDetail/activityDetail.wxml
@@ -32,6 +32,18 @@
  </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}}">
@@ -45,6 +57,7 @@
      <div class="activityDetail-main-buttton">{{statusWord}}</div>
  </view>
</block>
</view>
<view hidden="{{hiddenApply}}">
  <div class="apply">
SunshineLnsMinApp/pages/activityDetail/activityDetail.wxss
@@ -59,7 +59,6 @@
.tel-area{
  height: 6vh;
  margin-top: ;
  padding: 0 2vh;
  font-size: 14px;
  display:flex;
SunshineLnsMinApp/pages/fzpxInfo/fzpxInfo.js
@@ -12,6 +12,7 @@
    loading: false,
    peopleInfo: {},
    signStatus: '',
    id: ""
  },
  /**
@@ -121,11 +122,39 @@
  // 签到
  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'
              })
            }
          }
        })
      }
    })
  },
SunshineLnsMinApp/pages/myTranslate/myTranslate.js
@@ -109,7 +109,7 @@
      })
    } else if (activityType == "南检活动") {
      wx.navigateTo({
        url: '../scanEvildoing/scanEvildoing?id=' + businessId,
        url: '../activityDetail/activityDetail?id=' + id + '&signStatus=' + signStatus,
      })
    } else if (activityType == "基地参观") {
      wx.navigateTo({