riku
2022-10-10 437144f41c74505d362a5214a18cec3d01b3ce4b
2022.10.10
已修改29个文件
已添加36个文件
2383 ■■■■ 文件已修改
app.js 24 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app.json 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app.wxss 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
component/checkboxgroup/checkboxgroup.js 64 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
component/checkboxgroup/checkboxgroup.json 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
component/checkboxgroup/checkboxgroup.wxml 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
component/checkboxgroup/checkboxgroup.wxss 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
component/inputcell/inputcell.wxml 22 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
component/inputcell/inputcell.wxss 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
component/radiogroup/radiogroup.js 42 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
component/radiogroup/radiogroup.json 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
component/radiogroup/radiogroup.wxml 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
component/radiogroup/radiogroup.wxss 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
data/ScheduleItem.js 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
data/sceneInfo.js 394 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
data/schedules.js 89 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/m_assessment/assessment/assessment.wxml 56 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/m_assessment/assessment/assessment.wxss 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/m_consult/consulthome/consulthome.wxss 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/m_consult/consultonline/consultonline.js 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/m_consult/consultonline/consultonline.wxml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/m_consult/consultonline/consultonline.wxss 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/m_promise/promisehome/promise.wxml 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/m_service/behaviors/b_scheduleManager.js 80 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/m_service/c_schedule/c_schedule.js 44 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/m_service/c_schedule/c_schedule.wxml 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/m_service/c_schedule/c_schedule.wxss 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/m_service/p_schedule/p_schedule.js 119 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/m_service/p_schedule/p_schedule.wxml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/m_service/p_scheduledetail/p_scheduledetail.js 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/m_service/p_scheduledetail/p_scheduledetail.wxml 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/m_user/base_c/c_company-info/c_company-info.js 88 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/m_user/base_c/c_company-info/c_company-info.json 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/m_user/base_c/c_company-info/c_company-info.wxml 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/m_user/base_c/c_company-info/c_company-info.wxss 48 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/m_user/base_c/c_scene-info/c_scene-info.js 82 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/m_user/base_c/c_scene-info/c_scene-info.json 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/m_user/base_c/c_scene-info/c_scene-info.wxml 42 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/m_user/base_c/c_scene-info/c_scene-info.wxss 78 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/m_user/behaviors/b_inputCheck.js 169 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/m_user/behaviors/b_login.js 99 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/m_user/companyauthentication/companyauthentication.js 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/m_user/companyauthentication/companyauthentication.json 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/m_user/companyauthentication/companyauthentication.wxml 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/m_user/companyauthentication/companyauthentication.wxss 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/m_user/companyregister/companyregister.js 66 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/m_user/companyregister/companyregister.json 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/m_user/companyregister/companyregister.wxml 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/m_user/companyregister/companyregister.wxss 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/m_user/mine/mine.js 69 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/m_user/mine/mine.wxml 26 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/m_user/mine/mine.wxss 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/m_user/sceneauthentication/sceneauthentication.js 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/m_user/sceneauthentication/sceneauthentication.json 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/m_user/sceneauthentication/sceneauthentication.wxml 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/m_user/sceneauthentication/sceneauthentication.wxss 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/m_user/userlogin/userlogin.js 110 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/m_user/userlogin/userlogin.wxml 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/m_user/userlogin/userlogin.wxss 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/m_user/userloginpw/userloginpw.js 119 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/m_user/userloginpw/userloginpw.wxml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
res/icons/companyinfo-1.png 补丁 | 查看 | 原始文档 | blame | 历史
service/baserequest.js 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service/scheduleservice.js 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service/userservice.js 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app.js
@@ -1,18 +1,20 @@
// app.js
import moment from './utils/moment.min'
App({
  onLaunch() {
    // å±•示本地存储能力
    // const logs = wx.getStorageSync('logs') || []
    // logs.unshift(Date.now())
    // wx.setStorageSync('logs', logs)
    // ç™»å½•
    // wx.login({
    //   success: res => {
    //     // å‘送 res.code åˆ°åŽå°æ¢å– openId, sessionKey, unionId
    //   }
    // })
    console.log('onLaunch');
    moment.updateLocale('en', {
      weekdays: '星期日_星期一_星期二_星期三_星期四_星期五_星期六'.split('_')
    });
    wx.getStorage({
      key: 'userProfile',
      success: (res) => {
        this.globalData.userProfile = res.data
      },
    })
  },
  globalData: {
    perPage: 5,
app.json
@@ -41,12 +41,16 @@
    "pages/icons/icons",
    "pages/text/text",
    "pages/test/test",
    "pages/test2/test2"
    "pages/test2/test2",
    "pages/m_user/companyregister/companyregister",
    "pages/m_user/companyauthentication/companyauthentication",
    "pages/m_user/base_c/c_company-info/c_company-info",
    "pages/m_user/sceneauthentication/sceneauthentication"
  ],
  "window": {
    "backgroundTextStyle": "light",
    "navigationBarBackgroundColor": "#fff",
    "navigationBarTitleText": "中小企业环境守法服务平台",
    "navigationBarTitleText": "中小微企业生态环境智能服务",
    "navigationBarTextStyle": "black",
    "backgroundColor": "#57E4CB"
  },
app.wxss
@@ -80,7 +80,7 @@
}
.submit:active {
  background-color: var(--fyui-BG-COLOR-ACTIVE);
  background: linear-gradient(to right, #b7e9ce, #adebde);
}
.no-data {
component/checkboxgroup/checkboxgroup.js
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,64 @@
// component/checkboxgroup/checkboxgroup.js
Component({
  options: {
    addGlobalClass: true
  },
  /**
   * ç»„件的属性列表
   */
  properties: {
    remarkPlaceholder: {
      type: String,
      value: '请输入备注'
    },
    options: {
      type: Array,
      value: []
    }
  },
  /**
   * ç»„件的初始数据
   */
  data: {
  },
  /**
   * ç»„件的方法列表
   */
  methods: {
    remarkChange:function(e){
      const value = e.detail.value
      const index = e.currentTarget.dataset.index
      this.setData({
        [`options[${index}].remark`]: value,
        [`options[${index}].noValue`]: false,
      })
      this.triggerEvent('change', {options: this.data.options})
    },
    checkboxChange(e) {
      // console.log('checkbox发生change事件,携带value值为:', e.detail.value)
      const options = this.data.options
      const values = e.detail.value
      for (let i = 0, lenI = options.length; i < lenI; ++i) {
        options[i].checked = false
        for (let j = 0, lenJ = values.length; j < lenJ; ++j) {
          if (options[i].value === values[j]) {
            options[i].checked = true
            break
          }
        }
      }
      this.setData({
        options
      })
      this.triggerEvent('change', {options: this.data.options})
    }
  }
})
component/checkboxgroup/checkboxgroup.json
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,4 @@
{
  "component": true,
  "usingComponents": {}
}
component/checkboxgroup/checkboxgroup.wxml
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,11 @@
<!--component/checkboxgroup/checkboxgroup.wxml-->
<checkbox-group class="item-group" bindchange="checkboxChange">
  <block wx:for="{{options}}" wx:for-item="checkItem" wx:key="index">
    <label class="weui-agree">
      <checkbox class="weui-agree__checkbox-check" value="{{checkItem.value}}" checked="{{checkItem.checked}}" />
      <span class="weui-agree__checkbox"></span>
      <span class="">{{checkItem.name}}</span>
    </label>
    <input wx:if="{{checkItem.hasRemark && checkItem.checked}}" class="item-input" placeholder="{{checkItem.placeholder}}" placeholder-style="color:{{checkItem.noValue?'red':'#B2B2B2'}};" type="text" value="{{checkItem.remark}}" data-index="{{index}}" bindinput="remarkChange"></input>
  </block>
</checkbox-group>
component/checkboxgroup/checkboxgroup.wxss
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,25 @@
/* component/checkboxgroup/checkboxgroup.wxss */
.item-group {
  display: flex;
  flex-wrap: wrap;
  padding: 4px 0 20px 0;
}
.weui-agree{
  padding: 6px 8px;
}
.weui-agree__checkbox {
  width: 20px;
  height: 20px;
}
.item-input {
  display: inline;
  /* width: 20vw; */
  /* background-color: beige; */
  font-size: 0.8rem;
  margin-top: 2px;
  /* margin-bottom: 6px; */
  border-bottom: 1px solid var(--fyui-text-color_3);
}
component/inputcell/inputcell.wxml
@@ -1,13 +1,11 @@
<view class="page">
  <view class="hr-view"></view>
  <mp-cell ext-class="ext-cell">
    <view slot="title" class="title-cell"><text class="{{item.required != false ? 'required' : 'not-required'}}">*</text>{{item.name}}</view>
    <image wx:if="{{item.src}}" slot="icon" class="header-img" src="{{item.src}}"></image>
<view class="hr-view"></view>
<mp-cell ext-class="ext-cell">
  <view slot="title" class="title-cell"><text class="{{item.required != false ? 'required' : 'not-required'}}">*</text>{{item.name}}</view>
  <image wx:if="{{item.src}}" slot="icon" class="header-img" src="{{item.src}}"></image>
    <view class="flexbox {{alignLeft?'':'flexbox-end'}}">
      <input wx:if="{{item.input}}" type="{{item.type?item.type:'text'}}" maxlength="{{item.maxLength?item.maxLength:'-1'}}" id="{{item.id?item.id:''}}" placeholder-style="color:{{item.noValue?'red':'#B2B2B2'}};" class="weui-up-input {{inputClass}} {{alignLeft?'':'input-right'}}" bindinput="changeV" value="{{item.value}}" placeholder="{{item.placeholder ? item.placeholder : '请输入' + item.name}} " />
      <view wx:else="{{text}}" class="weui-up-input {{inputClass}} {{alignLeft?'':'input-right'}}">{{item.value}}</view>
      <view class="unit">{{item.unit}}</view>
    </view>
  </mp-cell>
</view>
  <view class="flexbox {{alignLeft?'':'flexbox-end'}}">
    <input wx:if="{{item.input}}" type="{{item.type?item.type:'text'}}" maxlength="{{item.maxLength?item.maxLength:'-1'}}" id="{{item.id?item.id:''}}" placeholder-style="color:{{item.noValue?'red':'#B2B2B2'}};" class="weui-up-input {{inputClass}} {{alignLeft?'':'input-right'}}" bindinput="changeV" value="{{item.value}}" placeholder="{{item.placeholder ? item.placeholder : '请输入' + item.name}} " />
    <view wx:else="{{text}}" class="weui-up-input {{inputClass}} {{alignLeft?'':'input-right'}}">{{item.value}}</view>
    <view class="unit">{{item.unit}}</view>
  </view>
</mp-cell>
component/inputcell/inputcell.wxss
@@ -6,7 +6,7 @@
}
.weui-up-input{
  color: black;
  font-size: var(--ffui-font-size-2);
  font-size: 1rem;
  /* border-radius: 10rpx; */
  width: 100%;
  /* background-color: seagreen; */
@@ -21,6 +21,7 @@
.required {
  color: red;
  text-align: center;
  vertical-align: middle;
}
.not-required {
@@ -30,9 +31,10 @@
.title-cell{
  white-space: nowrap;
  display: inline-block;
  font-size: var(--ffui-font-size-2);
  width: 105px;
  color:var(--ffui-text-color-1);
  font-size: 1rem;
  width: 32vw;
  color:var(--fyui-text-color-1);
  /* background-color: seagreen; */
}
.hr-view{
  height: 2rpx;
component/radiogroup/radiogroup.js
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,42 @@
// component/radiogroup/radiogroup.js
Component({
  options: {
    addGlobalClass: true
  },
  /**
   * ç»„件的属性列表
   */
  properties: {
    options: {
      type: Array,
      value: []
    }
  },
  /**
   * ç»„件的初始数据
   */
  data: {
  },
  /**
   * ç»„件的方法列表
   */
  methods: {
    radioChange(e) {
      console.log('radio发生change事件,携带value值为:', e.detail.value)
      const items = this.data.options
      for (let i = 0, len = items.length; i < len; ++i) {
        items[i].checked = items[i].value === e.detail.value
      }
      this.setData({
        options: items
      })
      this.triggerEvent('change', {options: this.data.options})
    }
  }
})
component/radiogroup/radiogroup.json
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,4 @@
{
  "component": true,
  "usingComponents": {}
}
component/radiogroup/radiogroup.wxml
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,11 @@
<!--component/radiogroup/radiogroup.wxml-->
<radio-group class="item-group" bindchange="radioChange">
  <block wx:for="{{options}}" wx:for-item="checkItem" wx:key="i" wx:for-index="i">
    <label class="weui-agree">
      <radio class="weui-agree__checkbox-check" value="{{checkItem.value}}" checked="{{checkItem.checked}}" />
      <span class="weui-agree__checkbox"></span>
      <span class="">{{checkItem.name}}</span>
    </label>
    <input class="item-input" placeholder="{{checkItem.placeholder}}" wx:if="{{checkItem.hasRemark && checkItem.checked}}" type="text" value="{{checkItem.remark}}"></input>
  </block>
</radio-group>
component/radiogroup/radiogroup.wxss
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,25 @@
/* component/radiogroup/radiogroup.wxss */
.item-group {
  display: flex;
  flex-wrap: wrap;
  padding: 4px 0 20px 0;
}
.weui-agree{
  padding: 6px 8px;
}
.weui-agree__checkbox {
  width: 20px;
  height: 20px;
}
.item-input {
  display: inline;
  /* width: 20vw; */
  /* background-color: beige; */
  font-size: 0.8rem;
  margin-top: 2px;
  /* margin-bottom: 6px; */
  border-bottom: 1px solid var(--fyui-text-color_3);
}
data/ScheduleItem.js
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,17 @@
function ScheduleItem({
  name,
  noticeBef,
  noticeNow,
  noticeAft,
  type,
}) {
  // this.name: '本月10号为台账准时提交限期',
  //   noticeBef: '',
  //   noticeNow: '',
  //   noticeAft: '',
  //   type: ''
}
ScheduleItem.prototype = {
}
data/sceneInfo.js
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,394 @@
//场景注册信息
const sceneInfo = ()=> {
  const map = new Map()
  //餐饮**************************************************************************************************
  map.set('1', [{
      name: "店铺名称",
      id: "sceneName",
      input: true,
      value: '',
      noValue: false,
    },
    {
      name: "店铺简称",
      id: "sceneNickName",
      input: true,
      value: '',
      noValue: false,
    },
    {
      name: "经营菜系",
      id: "cuisine",
      type: 'checkbox',
      value: '',
      options: [
        {name: '中式', value: '0', checked: true},
        {name: '西式', value: '1', },
        {name: '日式', value: '2', },
        {name: '韩式', value: '3', },
        {name: '泰式', value: '4', },
        {name: '火锅', value: '5', },
        {name: '烧烤', value: '6', },
        {name: '综合', value: '7', },
        {name: '其他', value: '99', hasRemark: true, remark: '', placeholder: '输入其他菜系'},
      ]
    },
    {
      name: "经营地址",
      id: "address",
      input: true,
      value: '',
      noValue: false,
    },
    {
      name: "就餐位数",
      id: "totalSeating",
      type: 'radio',
      value: '',
      options: [
        {name: '无', value: '0', checked: true},
        {name: '1~20', value: '1', },
        {name: '21~50', value: '2', },
        {name: '51~100', value: '3', },
        {name: '100以上', value: '4', },
      ]
    },
    {
      name: "净化设备数量",
      id: "purifyDeviceNum",
      type: 'number',
      input: true,
      value: "",
      noValue: false,
      unit: '台'
    },
    {
      name: "监测设备数量",
      id: "supervisionDeviceNum",
      type: 'number',
      input: true,
      value: "",
      noValue: false,
      unit: '台'
    },
    {
      name: "灶头数量",
      id: "cookingRangeNum",
      type: 'number',
      input: true,
      value: "",
      noValue: false,
      unit: '个'
    },
    {
      name: "年均用油量",
      id: "annualAvgOil",
      type: 'number',
      input: true,
      value: "",
      noValue: false,
      unit: '升'
    },
    {
      name: "用油类型",
      id: "oilType",
      type: 'checkbox',
      value: "",
      options: [
        {name: '豆油', value: '0', checked: true},
        {name: '起酥油', value: '1', },
        {name: '其他', value: '99', hasRemark: true, remark: '', placeholder: '输入其他类型'},
      ]
    },
    {
      name: "联系人",
      id: "contract",
      input: true,
      value: '',
      noValue: false,
    },
    {
      name: "联系方式",
      id: "telephone",
      input: true,
      value: '',
      noValue: false,
    },
    {
      name: "街镇",
      id: "town",
      type: 'picker',
      pickerMode: 'region',
      // value: ['上海市', '上海市', '金山区', '石化街道'],
      value: [],
      noValue: false,
      required: false,
    },
    {
      name: "集中区",
      id: "concentrationArea",
      input: true,
      value: '',
      noValue: false,
      required: false
    },
    {
      name: "排口数量",
      id: "outfallCount",
      type: 'number',
      input: true,
      value: '',
      noValue: false,
      required: false,
      unit: '个'
    },
    {
      name: "排口位置",
      id: "outfallLocation",
      input: true,
      value: '',
      noValue: false,
      required: false,
    },
    {
      name: "排口编号",
      id: "outfallNum",
      input: true,
      value: '',
      noValue: false,
      required: false
    },
  ])
  //工地**************************************************************************************************
  map.set('2', [{
      name: "店铺名称",
      id: "sceneName",
      input: true,
      value: '',
      noValue: false,
    },
    {
      name: "店铺简称",
      id: "sceneNickName",
      input: true,
      value: '',
      noValue: false,
    },
    {
      name: "经营地址",
      id: "address",
      input: true,
      value: '',
      noValue: false,
    },
    {
      name: "联系人",
      id: "contract",
      input: true,
      value: '',
      noValue: false,
    },
    {
      name: "联系方式",
      id: "telephone",
      input: true,
      value: '',
      noValue: false,
    },
  ])
  //码头**************************************************************************************************
  map.set('3', [{
      name: "店铺名称",
      id: "sceneName",
      input: true,
      value: '',
      noValue: false,
    },
    {
      name: "店铺简称",
      id: "sceneNickName",
      input: true,
      value: '',
      noValue: false,
    },
    {
      name: "经营地址",
      id: "address",
      input: true,
      value: '',
      noValue: false,
    },
    {
      name: "联系人",
      id: "contract",
      input: true,
      value: '',
      noValue: false,
    },
    {
      name: "联系方式",
      id: "telephone",
      input: true,
      value: '',
      noValue: false,
    },
  ])
  //堆场**************************************************************************************************
  map.set('4', [{
      name: "店铺名称",
      id: "sceneName",
      input: true,
      value: '',
      noValue: false,
    },
    {
      name: "店铺简称",
      id: "sceneNickName",
      input: true,
      value: '',
      noValue: false,
    },
    {
      name: "经营地址",
      id: "address",
      input: true,
      value: '',
      noValue: false,
    },
    {
      name: "联系人",
      id: "contract",
      input: true,
      value: '',
      noValue: false,
    },
    {
      name: "联系方式",
      id: "telephone",
      input: true,
      value: '',
      noValue: false,
    },
  ])
  //搅拌站**************************************************************************************************
  map.set('5', [{
      name: "店铺名称",
      id: "sceneName",
      input: true,
      value: '',
      noValue: false,
    },
    {
      name: "店铺简称",
      id: "sceneNickName",
      input: true,
      value: '',
      noValue: false,
    },
    {
      name: "经营地址",
      id: "address",
      input: true,
      value: '',
      noValue: false,
    },
    {
      name: "联系人",
      id: "contract",
      input: true,
      value: '',
      noValue: false,
    },
    {
      name: "联系方式",
      id: "telephone",
      input: true,
      value: '',
      noValue: false,
    },
  ])
  //工业企业**************************************************************************************************
  map.set('6', [{
      name: "店铺名称",
      id: "sceneName",
      input: true,
      value: '',
      noValue: false,
    },
    {
      name: "店铺简称",
      id: "sceneNickName",
      input: true,
      value: '',
      noValue: false,
    },
    {
      name: "经营地址",
      id: "address",
      input: true,
      value: '',
      noValue: false,
    },
    {
      name: "联系人",
      id: "contract",
      input: true,
      value: '',
      noValue: false,
    },
    {
      name: "联系方式",
      id: "telephone",
      input: true,
      value: '',
      noValue: false,
    },
  ])
  //汽修**************************************************************************************************
  map.set('7', [{
      name: "店铺名称",
      id: "sceneName",
      input: true,
      value: '',
      noValue: false,
    },
    {
      name: "店铺简称",
      id: "sceneNickName",
      input: true,
      value: '',
      noValue: false,
    },
    {
      name: "经营地址",
      id: "address",
      input: true,
      value: '',
      noValue: false,
    },
    {
      name: "联系人",
      id: "contract",
      input: true,
      value: '',
      noValue: false,
    },
    {
      name: "联系方式",
      id: "telephone",
      input: true,
      value: '',
      noValue: false,
    },
  ])
  return map
}
export default sceneInfo
data/schedules.js
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,89 @@
import moment from '../utils/moment.min'
//
const sysSchedules = function () {
  let s = []
  const now = moment().hour(0).minute(0).second(0).millisecond(0)
  const year = now.year()
  //台账每月10号为提交日
  const day = 10
  for (let m = 1; m <= 12; m++) {
    const mon = m > 9 ? m : `0${m}`
    const item = {
      time: moment(`${year}-${mon}-10`),
      events: [{
        category: `${year}å¹´${m}月环保工作日程`,
        name: `本月需提交台账`,
        type: 1, //系统日程
        steps: [{
          index: '01',
          title: ['提交', '方式'],
          content: '前往台账管理界面,根据台账类型分类上传台账图片。'
        }, {
          index: '02',
          title: ['提交', '期限'],
          content: '注意台账提交周期为一个月,每月尽量10号之前提交上月台账,逾期后环保信用评估会有所影响。'
        }]
      }]
    }
    s.push(item)
  }
  //评估每月提交一次,定为5号
  for (let m = 1; m <= 12; m++) {
    const mon = m > 9 ? m : `0${m}`
    const item = {
      time: moment(`${year}-${mon}-05`),
      events: [{
        category: `${year}å¹´${m}月环保工作日程`,
        name: `本月需要完成自测智评`,
        type: 1, //系统日程
        steps: [{
          index: '01',
          title: ['自评', '方法'],
          content: '前往自测智评界面,点击“去测评”按钮进行自评。'
        }, {
          index: '02',
          title: ['测评', '周期'],
          content: '测评周期为一个月一次,积极自评可有效帮助您知晓企业当前的环保隐患。'
        }]
      }]
    }
    s.push(item)
  }
  //承诺每一年提交一次
  const item = {
    category: `${year}å¹´12月环保工作日程`,
    time: moment(`${year}-12-31`),
    events: [{
      name: `本年度需要完成守法承诺`,
      type: 1, //系统日程
      steps: [{
        index: '01',
        title: ['承诺', '方法'],
        content: '前往守法承诺界面,根据提示,签署守法承诺书。'
      }, {
        index: '02',
        title: ['承诺书', '作用'],
        content: '签署守法承诺书,意味着您主动向环保部门承诺遵守相关规章制度。'
      }, {
        index: '03',
        title: ['承诺书', '有效期'],
        content: '守法承诺书从签署之日起,有效期为一年'
      }]
    }],
  }
  s.push(item)
  s.sort(function (x, y) {
    if (x.time.isBefore(y.time)) {
      return -1;
    } else if (x.time.isAfter(y.time)) {
      return 1;
    } else {
      return 0;
    }
  })
  return s
}
export default sysSchedules
pages/m_assessment/assessment/assessment.wxml
@@ -1,4 +1,6 @@
<!--pages/assessment/assessment.wxml-->
<import src="/template/nodata.wxml"></import>
<view class="page">
  <!-- <view class="banner-bg"></view> -->
@@ -65,43 +67,47 @@
        </picker>
      </view>
      <ec-canvas id="mychart-dom-line" canvas-id="mychart-line" ec="{{ ec }}"></ec-canvas>
      <!-- <template wx:else is="nodataPage"></template> -->
    </view>
    <view class="fyui-cell fyui-cell_select title">
      <view class="fyui-cell__bd">历史测评</view>
      <view class="fyui-cell__ft">查看更多</view>
    </view>
    <view wx:for="{{historys}}" wx:key="index" data-index="index" class="flex-h" style="align-items: flex-start;">
      <view class="history_icon">
        <view class="history_icon_1">
          <view></view>
        </view>
        <view class="history_icon_2"></view>
      </view>
      <view style="flex: 1;">
        <view class="history_time">{{item.time}}</view>
        <view class="h-cell fyui-panel">
          <view class="h-tag">{{item.updateTime}}</view>
          <view class="h-line_1">
            <view class="flex-h">
              <view class="h-score" style="background-color: {{item.color}};">
                {{item.score}}
              </view>
              <view class="h-rank">
                <view>风险排名:{{item.rank}}</view>
                <view>风险等级:{{item.level}}</view>
              </view>
            </view>
            <view data-id="{{item.scoreId}}" class="h-btn" bindtap="goto" data-index="1" data-period="{{item.period}}">去看看</view>
    <block wx:if="{{historys.length > 0}}">
      <view wx:for="{{historys}}" wx:key="index" data-index="index" class="flex-h" style="align-items: flex-start;">
        <view class="history_icon">
          <view class="history_icon_1">
            <view></view>
          </view>
          <!-- <view class="h-line_2">
          <view class="history_icon_2"></view>
        </view>
        <view style="flex: 1;">
          <view class="history_time">{{item.time}}</view>
          <view class="h-cell fyui-panel">
            <view class="h-tag">{{item.updateTime}}</view>
            <view class="h-line_1">
              <view class="flex-h">
                <view class="h-score" style="background-color: {{item.color}};">
                  {{item.score}}
                </view>
                <view class="h-rank">
                  <view>风险排名:{{item.rank}}</view>
                  <view>风险等级:{{item.level}}</view>
                </view>
              </view>
              <view data-id="{{item.scoreId}}" class="h-btn" bindtap="goto" data-index="1" data-period="{{item.period}}">去看看</view>
            </view>
            <!-- <view class="h-line_2">
            <view data-id="{{item.scoreId}}" class="h-btn" bindtap="goto" data-index="1" data-period="{{item.time}}">去看看</view>
          </view> -->
          </view>
        </view>
      </view>
    </view>
    </block>
    <template wx:else is="nodataPage"></template>
  </view>
  <view class="page__ft">
  </view>
pages/m_assessment/assessment/assessment.wxss
@@ -41,7 +41,7 @@
.line-chart-card {
  position: relative;
  height: 30vh;
  padding: 0;
  padding: 0 0 8px 0;
}
.h-cell {
pages/m_consult/consulthome/consulthome.wxss
@@ -39,7 +39,7 @@
  width: 8px;
}
.card .card-title {
  font-size: 18px;
  font-size: 16px;
  font-weight: bold;
}
pages/m_consult/consultonline/consultonline.js
@@ -28,7 +28,9 @@
   * ç”Ÿå‘½å‘¨æœŸå‡½æ•°--监听页面加载
   */
  onLoad(options) {
    this.setData({
      userId: app.globalData.accessToken.userId
    })
  },
  clearInput() {
@@ -54,6 +56,9 @@
      type: 0,
      text: this.data.value,
    })
    console.log('-----------chat------------------');
    console.log(record);
    console.log(this.data.userId);
    this.lastKeyword = this.data.value
    this.setData({
      record,
@@ -110,7 +115,7 @@
        userId: 'system',
        userName: '智能客服',
        type: 0,
        text: '不好意思,暂无相关解答,请试试其他关键词'
        text: '抱歉,我还不理解您的意思。请尝试重新咨询。'
      })
    } else {
      record.push({
@@ -119,9 +124,12 @@
        userId: 'system',
        userName: '智能客服',
        type: 0,
        text: '小白给您提供参考如下'
        text: '小白给您提供参考如下:'
      })
      const map = new Map()
      results.sort((a, b) => {
        return b.typeId - a.typeId
      })
      results.forEach(r => {
        if (!map.has(r.typeName)) {
          r.keyword = this.lastKeyword
pages/m_consult/consultonline/consultonline.wxml
@@ -6,7 +6,7 @@
        <view class="consult-text_user">{{item.text}}</view>
      </view>
      <view wx:else class="consult-record_item">
        <image wx:if="{{item.type == 0}}" src="/res/icons/avator_sys.png" class="consult-avator"></image>
        <image wx:if="{{item.type == 0}}" src="/res/icons/con_qa.png" class="consult-avator"></image>
        <view wx:if="{{item.type == 0}}" class="consult-text">{{item.text}}</view>
        <view wx:elif="{{item.type == 1}}" class="consult-text consult-qa">
          <switch-tab tabList="{{item.text.tabList}}" refresh="{{item.refresh}}">
pages/m_consult/consultonline/consultonline.wxss
@@ -28,6 +28,7 @@
.consult-avator {
  width: 40px;
  height: 40px;
  border-radius: 50%;
}
.consult-text {
pages/m_promise/promisehome/promise.wxml
@@ -1,4 +1,6 @@
<!--pages/promise/promise.wxml-->
<import src="/template/nodata.wxml"></import>
<view class="page">
  <!-- <view class="banner-bg"></view> -->
@@ -18,13 +20,16 @@
      <view class="fyui-cell__bd">历史承诺</view>
      <view class="fyui-cell__ft">查看更多</view>
    </view>
    <view wx:for="{{promise}}" wx:key="index">
      <view class="p-cell fyui-panel">
        <view class="p-title">| å®ˆæ³•承诺</view>
        <view class="p-content">{{item.period}}</view>
        <view class="p-tag">{{item.time}}</view>
        <view class="p-btn" bindtap="gotoDetail" data-index="{{index}}">去看看</view>
    <block wx:if="{{promise.length > 0}}">
      <view wx:for="{{promise}}" wx:key="index">
        <view class="p-cell fyui-panel">
          <view class="p-title">| å®ˆæ³•承诺</view>
          <view class="p-content">{{item.period}}</view>
          <view class="p-tag">{{item.time}}</view>
          <view class="p-btn" bindtap="gotoDetail" data-index="{{index}}">去看看</view>
        </view>
      </view>
    </view>
    </block>
    <template wx:else is="nodataPage"></template>
  </view>
</view>
pages/m_service/behaviors/b_scheduleManager.js
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,80 @@
import scheduleservice from '../../../service/scheduleservice'
import sysSchedules from '../../../data/schedules'
import moment from '../../../utils/moment.min'
import util from '../../../utils/util'
const app = getApp()
/**
 * çŽ¯ä¿æ—¥ç¨‹ç®¡ç†
 */
module.exports = Behavior({
  // behaviors: [b_loadingStatus],
  data: {
    allSchedules: [],
    thisSchedule: {},
    index: 0
  },
  lifetimes: {
    attached: function () {
      this.getRecentSchedule()
      // this.getAllSchedules()
    }
  },
  methods: {
    //查找最临近的日程
    getRecentSchedule() {
      //1. ä»ŽæŽ¥å£èŽ·å–ç”¨æˆ·ä¸ªäººã€ç”¨æˆ·ä¼ä¸šç±»åž‹çš„ç›¸å…³æœ€ä¸´è¿‘æ—¥ç¨‹
      //2. æŒ‰ç…§æœ¬åœ°é€»è¾‘,得出最邻近日程
      const schedules = sysSchedules()
      //2.1 å°†å°è´¦ã€è¯„估、承诺三项APP功能定义为日程
      //2.2 é€‰æ‹©æœ€é‚»è¿‘的事项作为当日的提醒事项
      const today = moment().hour(0).minute(0).second(0).millisecond(0)
      let diffDays = 999
      let schedule
      let index = 0
      for (let i = 0; i < schedules.length; i++) {
        const s = schedules[i];
        const d = s.time.diff(today, 'days')
        s.diffDays = d
        if (Math.abs(d) < Math.abs(diffDays)) {
          schedule = s
          diffDays = d
          index = i
        }
      }
      //2.3 æ—¥ç¨‹åœ¨æ—¶é—´ç»´åº¦ä¸Šåˆ†ä¸ºä¸‰ç±»æé†’,预告、当日、未完成的逾期提醒
      this.setData({
        allSchedules: schedules,
        thisSchedule: {
          time: schedule.time.format('YYYY-MM-DD dddd'),
          events: schedule.events,
          diffDays: schedule.diffDays,
          steps: schedule.steps,
          category: schedule.category
        },
        index
      })
    },
    //获取所有日程
    getAllSchedules() {
      console.log('getAllSchedules');
      scheduleservice.getAllSchedules(app.globalData.accessToken.userId, {
        success(res) {
          console.log('success');
          console.log(res);
        },
        fail(e) {
          console.log('fail');
          console.log(e);
        },
        complete(res) {
          console.log('complete');
        },
      })
    }
  }
})
pages/m_service/c_schedule/c_schedule.js
@@ -1,7 +1,9 @@
// pages/m_service/c_schedule/c_schedule.js
const moment = require('../../../utils/moment.min')
import moment from '../../../utils/moment.min'
import b_scheduleManager from '../behaviors/b_scheduleManager'
Component({
  behaviors: [b_scheduleManager],
  options: {
    addGlobalClass: true
  },
@@ -9,18 +11,7 @@
   * ç»„件的属性列表
   */
  properties: {
    title: {
      type: String,
      value: '营业执照续期'
    },
    time: {
      type: String,
      value: '2022-9-10 æ˜ŸæœŸå…­'
    },
    leftDays: {
      type: Number,
      value: 2
    },
  },
  /**
@@ -30,36 +21,17 @@
  },
  lifetimes: {
    attached: function () {
      this._init()
    }
  },
  /**
   * ç»„件的方法列表
   */
  methods: {
    _init() {
      moment.updateLocale('en', {
        weekdays: '星期日_星期一_星期二_星期三_星期四_星期五_星期六'.split('_')
      });
      // console.log(moment.locales());
      // moment.locale('ch')
      const now = moment().hour(0).minute(0).second(0).millisecond(0)
      const s = moment(now).add(3, 'days')
      let leftDays = now.diff(s, 'days')
      const time = s.format('YYYY-MM-DD dddd')
      this.setData({
        time,
        leftDays
      })
    },
    goto() {
      var that = this
      wx.navigateTo({
        url: '/pages/m_service/p_scheduledetail/p_scheduledetail',
        success: (result) => {},
        success: (res) => {
          res.eventChannel.emit('acceptDataFromOpenerPage', that.data.thisSchedule)
        },
      })
    }
  }
pages/m_service/c_schedule/c_schedule.wxml
@@ -1,15 +1,15 @@
<!--pages/m_service/c_schedule/c_schedule.wxml-->
<view class="schedule-card {{leftDays < 0 ? 'schedule-card__2' : ''}}" bindtap="goto">
  <view class="schedule-tag">{{leftDays < 0 ? 'FUTURE' : 'TODAY'}}</view>
<view class="schedule-card {{thisSchedule.diffDays > 0 ? 'schedule-card__2' : (thisSchedule.diffDays < 0 ? 'schedule-card__3' : '')}}" bindtap="goto">
  <view class="schedule-tag">{{thisSchedule.diffDays > 0 ? 'FUTURE' : (thisSchedule.diffDays == 0 ? 'TODAY' : 'PAST')}}</view>
  <view class="schedule-category">
    <image class="image-16" src="/res/icons/schedule_1.png"></image>
    <text>环保日程</text>
    <text>{{thisSchedule.events[0].type == 1 ? '系统日程' : '环保日程'}}</text>
  </view>
  <view class="schedule-title">{{title}}</view>
  <view class="schedule-title">{{thisSchedule.events[0].name}}</view>
  <view class="schedule-time">
    <text>{{time}}</text>
    <text wx:if="{{leftDays > 0}}">过去{{leftDays}}天</text>
    <text wx:elif="{{leftDays == 0}}">今天</text>
    <text wx:else>还有{{-leftDays}}天</text>
    <text>{{thisSchedule.time}}</text>
    <text wx:if="{{thisSchedule.diffDays < 0}}">过去{{-thisSchedule.diffDays}}天</text>
    <text wx:elif="{{thisSchedule.diffDays == 0}}">今天</text>
    <text wx:else>还有{{thisSchedule.diffDays}}天</text>
  </view>
</view>
pages/m_service/c_schedule/c_schedule.wxss
@@ -13,6 +13,10 @@
  background: linear-gradient(0deg, #7bc8fc, #72c4fc, #64BEFB);
}
.schedule-card__3 {
  background: linear-gradient(0deg, #e97f7f, #f86b6b, #ff3838);
}
.schedule-tag {
  font-size: 14px;
  position: absolute;
pages/m_service/p_schedule/p_schedule.js
@@ -1,8 +1,9 @@
// pages/m_service/p_schedule/p_schedule.js
import b_scheduleManager from '../behaviors/b_scheduleManager'
const moment = require('../../../utils/moment.min')
Page({
  behaviors: [b_scheduleManager],
  /**
   * é¡µé¢çš„初始数据
   */
@@ -22,90 +23,44 @@
   * ç”Ÿå‘½å‘¨æœŸå‡½æ•°--监听页面加载
   */
  onLoad(options) {
    const now = moment().hour(0).minute(0).second(0).millisecond(0)
    const year = now.year()
    // const now = moment().hour(0).minute(0).second(0).millisecond(0)
    // const year = now.year()
    const schedules = []
    let totals = 0
    for (let m = 1; m <= 12; m++) {
      const s = {
        category: `${year}å¹´${m}月环保工作日程`,
        details: []
      }
      const mon = m > 9 ? m : `0${m}`
      //10,15,20
      let t1 = moment(`${year}-${mon}-10`)
      let d1 = t1.diff(now, 'days')
      s.details.push({
        time: t1.format('MM月DD日'),
        name: '环保日程环保日程环保日程环保日程环保日程环保日程',
        left: d1,
      })
      let t2 = moment(`${year}-${mon}-15`)
      let d2 = t2.diff(now, 'days')
      s.details.push({
        time: t2.format('MM月DD日'),
        name: '环保日程',
        left: d2,
      })
      let t3 = moment(`${year}-${mon}-20`)
      let d3 = t3.diff(now, 'days')
      s.details.push({
        time: t3.format('MM月DD日'),
        name: '环保日程',
        left: d3,
      })
      schedules.push(s)
      totals += 3
    let totals = this.data.allSchedules.length
    const map = new Map()
    for (let i = 0; i < this.data.allSchedules.length; i++) {
      const s = this.data.allSchedules[i];
      s.events.forEach(e => {
        if (!map.has(e.category)) {
          map.set(e.category, [])
        }
        map.get(e.category).push({
          time: s.time.format('MM月DD日'),
          name: e.name,
          left: s.diffDays,
        })
      });
    }
    this.setData({schedules, totals})
    for (let item of map) {
      schedules.push({
        category: item[0],
        details: item[1]
      })
    }
    this.setData({
      schedules,
      totals
    })
  },
  /**
   * ç”Ÿå‘½å‘¨æœŸå‡½æ•°--监听页面初次渲染完成
   */
  onReady() {
  },
  /**
   * ç”Ÿå‘½å‘¨æœŸå‡½æ•°--监听页面显示
   */
  onShow() {
  },
  /**
   * ç”Ÿå‘½å‘¨æœŸå‡½æ•°--监听页面隐藏
   */
  onHide() {
  },
  /**
   * ç”Ÿå‘½å‘¨æœŸå‡½æ•°--监听页面卸载
   */
  onUnload() {
  },
  /**
   * é¡µé¢ç›¸å…³äº‹ä»¶å¤„理函数--监听用户下拉动作
   */
  onPullDownRefresh() {
  },
  /**
   * é¡µé¢ä¸Šæ‹‰è§¦åº•事件的处理函数
   */
  onReachBottom() {
  },
  /**
   * ç”¨æˆ·ç‚¹å‡»å³ä¸Šè§’分享
   */
  onShareAppMessage() {
  goto() {
    var that = this
    wx.navigateTo({
      url: '/pages/m_service/p_scheduledetail/p_scheduledetail',
      success: (res) => {
        res.eventChannel.emit('acceptDataFromOpenerPage', that.data.thisSchedule)
      },
    })
  }
})
pages/m_service/p_schedule/p_schedule.wxml
@@ -5,7 +5,7 @@
  <view class="page__bd">
    <block wx:for="{{schedules}}" wx:key="index">
      <view class="sm-title">{{item.category}}</view>
      <view wx:for="{{item.details}}" wx:key="i" wx:for-item="d" class="sm-card">
      <view wx:for="{{item.details}}" wx:key="i" wx:for-item="d" class="sm-card" bindtap="goto">
        <view class="sm-time">{{d.time}}</view>
        <view class="history_icon">
          <view class="history_icon_1">
pages/m_service/p_scheduledetail/p_scheduledetail.js
@@ -5,15 +5,15 @@
   * é¡µé¢çš„初始数据
   */
  data: {
    steps:[{
    steps: [{
      index: '01',
      title: ['前往环', '保部门'],
      content: '前往相关环保部门提供相关证件,可进行营业执照续期。'
    },{
    }, {
      index: '02',
      title: ['营业执', '照续期'],
      content: '前往相关环保部门提供相关证件,可进行营业执照续期。'
    },{
    }, {
      index: '03',
      title: ['营业执', '照续期'],
      content: '前往相关环保部门提供相关证件,可进行营业执照续期。'
@@ -24,7 +24,11 @@
   * ç”Ÿå‘½å‘¨æœŸå‡½æ•°--监听页面加载
   */
  onLoad(options) {
    this.getOpenerEventChannel().on('acceptDataFromOpenerPage', (data) => {
      this.setData({
        thisSchedule: data
      })
    })
  },
  onSubmit() {
pages/m_service/p_scheduledetail/p_scheduledetail.wxml
@@ -2,26 +2,26 @@
<view class="page">
  <view class="page__hd">
    <view class="sd-card">
      <view class="sd-card__title">今日</view>
      <view class="sd-card__content">营业执照续期</view>
      <view class="sd-card__title">{{thisSchedule.time}}</view>
      <view class="sd-card__content">{{thisSchedule.events[0].name}}</view>
    </view>
    <view class="sd-item">
      <view>日程类别</view>
      <view>环保日程</view>
      <view>{{thisSchedule.events[0].type == 1 ? '系统日程' : '环保日程'}}</view>
    </view>
    <view class="sd-item">
      <view>开始时间</view>
      <view class="sd-item__time">2022å¹´9月01日</view>
      <view class="sd-item__time">{{thisSchedule.time}}</view>
    </view>
    <view class="sd-item">
      <view>结束时间</view>
      <view class="sd-item__time">2022å¹´9月10日</view>
      <view class="sd-item__time">{{thisSchedule.time}}</view>
    </view>
  </view>
  <view class="page__bd">
    <view class="sd-divider"> <text>* * *</text> æ—¥ç¨‹æ“ä½œæµç¨‹æç¤º <text>* * *</text> </view>
    <view class="sd-step" wx:for="{{steps}}" wx:key="index">
    <view class="sd-divider"> <text>* * *</text> æ—¥ç¨‹æé†’ <text>* * *</text> </view>
    <view class="sd-step" wx:for="{{thisSchedule.events[0].steps}}" wx:key="index">
      <text class="sd-step__index">{{item.index}}</text>
      <view class="sd-step__title">{{item.title[0]}}<text>{{item.title[1]}}</text></view>
      <view class="sd-step__content">{{item.content}}</view>
pages/m_user/base_c/c_company-info/c_company-info.js
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,88 @@
// pages/m_user/base_c/c_company-info/c_company-info.js
Component({
  options: {
    addGlobalClass: true,
  },
  /**
   * ç»„件的属性列表
   */
  properties: {
    submitText: {
      type: String,
      value: '提交'
    },
  },
  /**
   * é¡µé¢çš„初始数据
   */
  data: {
    sceneTypes: [
      {value: '1', name: '餐饮'},
      {value: '7', name: '汽修'},
      {value: '6', name: '工业企业' },
      {value: '2', name: '工地'},
      {value: '3', name: '码头'},
      {value: '4', name: '堆场'},
      {value: '5', name: '搅拌站' },
    ],
    sceneTypeIndex: 0,
    msg: [{
        name: "企业名称",
        id: "department",
        input: true,
        value: '',
        noValue: false,
      },
      {
        name: "企业地址",
        id: "address",
        input: true,
        value: '',
        noValue: false,
      },
      {
        name: "信用代码",
        id: "code",
        input: true,
        value: "",
        noValue: false,
      },
      {
        name: "法人",
        id: "contract",
        input: true,
        value: '',
        noValue: false,
      },
      {
        name: "联系人",
        id: "contract",
        input: true,
        value: '',
        noValue: false,
      },
      {
        name: "联系方式",
        id: "contract",
        input: true,
        value: '',
        noValue: false,
      },
    ],
  },
  /**
   * ç»„件的方法列表
   */
  methods: {
    changeSceneType(e) {
      let i = e.detail.value
      this.setData({
        sceneTypeIndex: i
      })
    },
  }
})
pages/m_user/base_c/c_company-info/c_company-info.json
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,10 @@
{
  "component": true,
  "usingComponents": {
    "mp-cells":"/component/cells/cells",
    "input-cell":"/component/inputcell/inputcell",
    "mp-icon": "/component/icon/icon",
    "mp-toptips":"/component/toptips/toptips",
    "mp-upload":"/component/uploader/uploader"
  }
}
pages/m_user/base_c/c_company-info/c_company-info.wxml
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,21 @@
<!--pages/m_user/base_c/c_company-info/c_company-info.wxml-->
<view class="page__bd">
  <view class="top-card">
    <view class="tag"><text style="color: transparent;">*</text>企业类型</view>
    <picker mode="selector" bindchange="changeSceneType" value="{{sceneTypeIndex}}" range="{{sceneTypes}}" range-key="name" class="value">
      <view class="picker-text">{{sceneTypes[sceneTypeIndex].name}}</view>
    </picker>
    <mp-icon icon="arrow" color="#59D5B3" size="{{10}}"></mp-icon>
  </view>
  <view class="items">
    <mp-cells>
      <input-cell wx:for="{{msg}}" wx:key="id" item="{{item}}" bindpassValue="changeMsg"></input-cell>
    </mp-cells>
  </view>
  <view class="weui-upload-view">
    <mp-upload title="上传营业执照" titleClass="upload-title-class" max-count="1" files="{{imgFiles}}" binduploadImg="uploadFile" binddelete="delImg"></mp-upload>
  </view>
</view>
<view class="page__ft">
  <view class="submit" bindtap="onSubmit">{{submitText}}</view>
</view>
pages/m_user/base_c/c_company-info/c_company-info.wxss
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,48 @@
/* pages/m_user/base_c/c_company-info/c_company-info.wxss */
.top-card {
  position: relative;
  display: flex;
  flex-direction: row;
  background-color: white;
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
  padding: 8px 16px;
  /* margin: 0 8px; */
  font-size: 16px;
}
.picker-text {
  color: var(--fyui-primary-color);
}
.items {
  position: relative;
  padding: 0 16px;
  background-color: white;
}
.top-card .tag {
  /* display: inline-block; */
  width: 105px;
  white-space: nowrap;
}
.top-card .value {
  flex-grow: 1;
}
.top-card .value view {
  max-width: 200px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.weui-upload-view {
  background-color: white;
  padding: 16px;
}
.page__ft {
  background-color: white;
}
pages/m_user/base_c/c_scene-info/c_scene-info.js
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,82 @@
// pages/m_user/base_c/c_scene-info/c_scene-info.js
import b_inputCheck from '../../behaviors/b_inputCheck'
import sceneInfo from '../../../../data/sceneInfo'
Component({
  behaviors: [b_inputCheck],
  options: {
    addGlobalClass: true,
  },
  /**
   * ç»„件的属性列表
   */
  properties: {
    submitText: {
      type: String,
      value: '提交'
    },
    sceneType: {
      type: String,
      value: '1'
    }
  },
  attached() {
  },
  pageLifetimes: {
    show: function () {
      // é¡µé¢è¢«å±•示
      const info = sceneInfo()
      this.setData({
        msg: info.get(this.data.sceneType)
      })
    },
    hide: function () {
      // é¡µé¢è¢«éšè—
    },
    resize: function (size) {
      // é¡µé¢å°ºå¯¸å˜åŒ–
    }
  },
  /**
   * ç»„件的初始数据
   */
  data: {
  },
  /**
   * ç»„件的方法列表
   */
  methods: {
    selectChange(e) {
      const index = e.currentTarget.dataset.index
      const options = e.detail.options
      this.setData({
        [`msg[${index}].options`]: options
      })
    },
    pickerChange(e) {
      console.log(e);
      const {
        index,
        mode
      } = e.currentTarget.dataset
      let i = e.detail.value
      if (mode == 'region') {
        this.setData({
          [`msg[${index}].value`]: i
        })
      } else if (mode == 'selector') {
        this.setData({
          [`msg[${index}].selectIndex`]: i,
          [`msg[${index}].value`]: this.data.msg[index].options[i].value
        })
      }
    }
  }
})
pages/m_user/base_c/c_scene-info/c_scene-info.json
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,12 @@
{
  "component": true,
  "usingComponents": {
    "mp-cells":"/component/cells/cells",
    "input-cell":"/component/inputcell/inputcell",
    "mp-icon": "/component/icon/icon",
    "mp-toptips":"/component/toptips/toptips",
    "mp-upload":"/component/uploader/uploader",
    "mp-checkboxgroup": "/component/checkboxgroup/checkboxgroup",
    "mp-radiogroup": "/component/radiogroup/radiogroup"
  }
}
pages/m_user/base_c/c_scene-info/c_scene-info.wxml
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,42 @@
<!--pages/m_user/base_c/c_scene-info/c_scene-info.wxml-->
<view class="page__bd">
  <mp-toptips type="error" msg="{{errorMsg}}" show="{{errorMsg}}" delay="2000"></mp-toptips>
  <view class="items">
    <mp-cells>
      <block wx:for="{{msg}}" wx:key="index">
        <block wx:if="{{item.type == 'checkbox'}}">
          <view class="hr-view"></view>
          <view id="{{item.id}}" class="item-title"><text class="{{item.required != false ? 'required' : 'not-required'}}">*</text>{{item.name}}</view>
          <mp-checkboxgroup options="{{item.options}}" data-index="{{index}}" bindchange="selectChange"></mp-checkboxgroup>
        </block>
        <block wx:elif="{{item.type == 'radio'}}">
          <view class="hr-view"></view>
          <view id="{{item.id}}" class="item-title"><text class="{{item.required != false ? 'required' : 'not-required'}}">*</text>{{item.name}}</view>
          <mp-radiogroup options="{{item.options}}" data-index="{{index}}" bindchange="selectChange"></mp-radiogroup>
        </block>
        <block wx:elif="{{item.type == 'picker'}}">
          <view class="hr-view"></view>
          <view class="top-card">
            <view id="{{item.id}}" class="tag"><text class="{{item.required != false ? 'required' : 'not-required'}}">*</text>{{item.name}}</view>
            <picker wx:if="{{item.pickerMode == 'selector'}}" mode="selector" bindchange="pickerChange" data-index="{{index}}" data-mode="selector" value="{{item.selectIndex}}" range="{{item.options}}" range-key="name" class="value">
              <view class="picker-text">{{item.options[item.selectIndex].name}}</view>
            </picker>
            <picker wx:elif="{{item.pickerMode == 'region'}}" mode="region" bindchange="pickerChange" data-index="{{index}}" data-mode="region" value="{{item.value}}" class="value" level="sub-district" custom-item="空">
              <view class="picker-text" wx:if="{{item.value.length > 0}}">{{item.value[0] + (item.value[1] == item.value[0] ? '' : item.value[1]) + item.value[2] + item.value[3]}}</view>
              <view wx:else class="picker-text" style="color: #B2B2B2;">请选择街镇</view>
            </picker>
            <mp-icon icon="arrow" color="black" size="{{10}}"></mp-icon>
          </view>
        </block>
        <input-cell id="{{item.id}}" wx:else item="{{item}}" bindpassValue="changeMsg"></input-cell>
      </block>
    </mp-cells>
  </view>
  <view class="weui-upload-view">
    <mp-upload title="上传食品经营许可证" titleClass="upload-title-class" max-count="1" files="{{imgFiles}}" binduploadImg="uploadFile" binddelete="delImg"></mp-upload>
  </view>
</view>
<view class="page__ft">
  <view class="submit" bindtap="onSubmit">{{submitText}}</view>
</view>
pages/m_user/base_c/c_scene-info/c_scene-info.wxss
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,78 @@
/* pages/m_user/base_c/c_scene-info/c_scene-info.wxss */
.top-card {
  /* width: 100vw; */
  position: relative;
  display: flex;
  flex-direction: row;
  /* justify-content: space-between; */
  background-color: white;
  padding: 8px 0px;
  /* margin: 0 8px; */
  font-size: 1rem;
  flex-wrap: nowrap;
}
.picker-text {
  /* color: var(--fyui-primary-color); */
  color: var(--fyui-text-color_1);
}
.items {
  position: relative;
  padding: 0 10px;
  background-color: white;
}
.item-title {
  white-space: nowrap;
  display: inline-block;
  font-size: 1rem;
  width: 32vw;
  margin-top: 8px;
}
.top-card .tag {
  flex-shrink: 0;
  width: 32vw;
  white-space: nowrap;
  /* background-color: seagreen; */
}
.top-card .value {
  flex-grow: 1;
}
.top-card .value view {
  /* white-space: nowrap; */
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow-x: hidden;
  text-overflow: ellipsis;
  /* background-color: bisque; */
}
.weui-upload-view {
  background-color: white;
  padding: 16px;
}
.page__ft {
  background-color: white;
}
.hr-view {
  height: 2rpx;
  margin: 0 0rpx;
  background-color: #f1f1f1;
}
.required {
  color: red;
  text-align: center;
  vertical-align: middle;
}
.not-required {
  color: transparent;
}
pages/m_user/behaviors/b_inputCheck.js
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,169 @@
/**
 *
 */
module.exports = Behavior({
  data: {
    msg: [],
    info: {}
  },
  lifetimes: {
    attached: function () {}
  },
  methods: {
    changeMsg(e) {
      let id = e.detail.params.id
      let value = e.detail.params.value
      let msg = this.data.msg
      let msgLength = msg.length
      for (let i = 0; i < msgLength; i++) {
        if (msg[i].id === id) {
          let path = "msg[" + i + "].value"
          let nPath = "msg[" + i + "].noValue"
          this.setData({
            [path]: value,
            [nPath]: false
          })
        }
      }
    },
    onSubmit: function () {
      console.log('onSubmit');
      if (!this.submitCheck()) return
      let msg = this.data.msg
      if (msg) {
        let info = {}
        msg.forEach(m => {
          info[m.id] = m.value
        });
        // console.log(info);
        this.setData({info})
        this.triggerEvent('onSubmit', info)
        // wx.showToast({
        //   title: 'onSubmit',
        //   duration: 1000,
        //   icon: 'none',
        //   success: (res) => {},
        //   fail: (res) => {},
        //   complete: (res) => {},
        // })
      }
    },
    /**
     * ä¿¡æ¯å®Œæ•´åº¦æ£€æŸ¥
     */
    submitCheck() {
      let msg = this.data.msg
      //确认信息完整度
      for (let i = 0; i < msg.length; i++) {
        const m = msg[i]
        //选填项直接略过
        if (m.required == false) continue
        //复选框和单选框(复选框的逻辑包含了单选框)
        if (m.type == 'checkbox' || m.type == 'radio') {
          // console.log('m.options', m.options);
          m.value = ''
          for (let t = 0; t < m.options.length; t++) {
            const o = m.options[t];
            if (o.checked) {
              if (m.value != '') {
                m.value += ';'
              }
              if (o.hasRemark) {
                // console.log('o.remark', o.remark);
                if (o.remark == '') {
                  this.setData({
                    [`msg[${i}].options[${t}].noValue`]: true
                  })
                  this.showErrorMsg(i, '备注信息不能为空')
                  return false
                } else {
                  m.value += o.remark
                }
              } else {
                m.value += o.name
              }
            }
          }
          if (m.value == '') {
            this.showErrorMsg(i)
            return false
          }
        }
        //下拉选择框
        else if (m.type == 'picker') {
          if (m.pickerMode == 'selector') {
            if (m.selectIndex == 0) {
              this.showErrorMsg(i, `${this.data.msg[i].name}未选择`)
              return false
            } else {
              m.value = m.options[m.selectIndex].name
            }
          } else if (m.pickerMode == 'region') {
            if (m.value.length == 0) {
              this.showErrorMsg(i, `${this.data.msg[i].name}未选择`)
              return false
            }
          }
        }
        //输入框
        else if (m.value === "") {
          this.showErrorMsg(i)
          return false
        }
      }
      // //密码一致性确认
      // if (msg[1].value != msg[2].value) {
      //   let error = "两次输入的密码不一致"
      //   this.setData({
      //     errorMsg: error,
      //   })
      //   return false
      // }
      // //密码复杂度确认
      // var pwError
      // var pw = msg[1].value
      // var regex1 = /[a-zA-Z]/
      // var regex2 = /[0-9]/
      // var r = regex1.test(pw) && regex2.test(pw)
      // console.log('regex:' + r);
      // if (pw.length < 6) {
      //   pwError = '密码位数最少6位'
      // } else if (!r) {
      //   pwError = '密码必须包含字母和数字'
      // }
      // if (pwError) {
      //   this.setData({
      //     errorMsg: pwError,
      //   })
      //   return false
      // }
      return true
    },
    showErrorMsg(index, err = `${this.data.msg[index].name}不可为空`) {
      this.setData({
        errorMsg: err,
        [`msg[${index}].noValue`]: true
      })
      const id = "#" + this.data.msg[index].id
      wx.createSelectorQuery().select('.page').boundingClientRect(res1 => {
        const top1 = res1.top
        wx.createSelectorQuery().in(this).select(id).boundingClientRect(res => {
          const h = res.top - top1 - 60
          // console.log(h);
          wx.pageScrollTo({
            // duration: 300,
            scrollTop: h,
            // selector: id,
            // offsetTop: -60,
          })
        }).exec();
      }).exec();
    }
  }
})
pages/m_user/behaviors/b_login.js
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,99 @@
import userservice from '../../../service/userservice'
const app = getApp()
/**
 * ç™»å½•流程
 */
module.exports = Behavior({
  data: {
  },
  lifetimes: {
    attached: function () {}
  },
  methods: {
    loginPw(accessTokenPW) {
      wx.showLoading({
        title: '登录中',
        mask: true,
      })
      setTimeout(() => {
        wx.hideLoading()
      }, 10000);
      var that = this
      wx.login({
        success: (res) => {
          console.log(res);
          accessTokenPW.code = res.code
          userservice.loginPW(accessTokenPW, {
            success(data) {
              if (data.success) {
                wx.getStorage({
                  key: 'accessToken',
                  success(res) {
                    app.globalData.accessToken = res.data
                    app.globalData.accessToken.userId = data.userId
                    app.globalData.accessToken.suserId = data.suserId
                    if (accessTokenPW.userName) {
                      app.globalData.accessToken.userName = accessTokenPW.userName
                    }
                    if (accessTokenPW.password) {
                      app.globalData.accessToken.password = accessTokenPW.password
                    }
                    wx.setStorage({
                      key: 'accessToken',
                      data: app.globalData.accessToken,
                    })
                    that.gotoHomePage()
                  },
                  fail(e) {
                    app.globalData.accessToken = {
                      userName: accessTokenPW.userName,
                      password: accessTokenPW.password,
                      userId: data.userId,
                      suserId: data.suserId,
                    }
                    wx.setStorage({
                      key: 'accessToken',
                      data: app.globalData.accessToken,
                    })
                    that.gotoHomePage()
                  }
                })
              } else {
                that._onLoginFail()
              }
              wx.hideLoading()
            },
            complete() {
              // wx.hideLoading()
              that.setData({
                loading: false
              })
            }
          })
        },
      })
    },
    gotoHomePage() {
      userservice.getUserInfo(app.globalData.accessToken.userId, {
        success(data) {
          app.globalData.userInfo = data
          app.globalData.isLogin = true
          wx.setStorage({
            key: 'userInfo',
            data: data,
            success: (result) => {
              wx.switchTab({
                url: '/pages/home/home',
              })
            }
          })
        }
      })
    },
  }
})
pages/m_user/companyauthentication/companyauthentication.js
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,19 @@
// pages/m_user/companyauthentication/companyauthentication.js
import $f from '../../../service/baserequest'
Page({
  /**
   * é¡µé¢çš„初始数据
   */
  data: {
  },
  /**
   * ç”Ÿå‘½å‘¨æœŸå‡½æ•°--监听页面加载
   */
  onLoad(options) {
  },
})
pages/m_user/companyauthentication/companyauthentication.json
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,6 @@
{
  "navigationBarTitleText": "企业认证",
  "usingComponents": {
    "c-company-info": "../base_c/c_company-info/c_company-info"
  }
}
pages/m_user/companyauthentication/companyauthentication.wxml
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,6 @@
<!--pages/m_user/companyauthentication/companyauthentication.wxml-->
<view class="page">
  <image class="banner-bg" src="/res/icons/companyinfo-1.png" mode="widthFix"></image>
  <view class="tips">请仔细检查系统预留的企业信息,确认是否正确,调整完成后提交完成企业认证</view>
  <c-company-info></c-company-info>
</view>
pages/m_user/companyauthentication/companyauthentication.wxss
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,18 @@
/* pages/m_user/companyauthentication/companyauthentication.wxss */
.tips {
  position: relative;
  color: white;
  padding: 16px;
  font-size: 14px;
  font-weight: 550;
}
.banner-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  /* background-color: aqua; */
}
pages/m_user/companyregister/companyregister.js
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,66 @@
// pages/m_user/companyregister/companyregister.js
Page({
  /**
   * é¡µé¢çš„初始数据
   */
  data: {
  },
  /**
   * ç”Ÿå‘½å‘¨æœŸå‡½æ•°--监听页面加载
   */
  onLoad(options) {
  },
  /**
   * ç”Ÿå‘½å‘¨æœŸå‡½æ•°--监听页面初次渲染完成
   */
  onReady() {
  },
  /**
   * ç”Ÿå‘½å‘¨æœŸå‡½æ•°--监听页面显示
   */
  onShow() {
  },
  /**
   * ç”Ÿå‘½å‘¨æœŸå‡½æ•°--监听页面隐藏
   */
  onHide() {
  },
  /**
   * ç”Ÿå‘½å‘¨æœŸå‡½æ•°--监听页面卸载
   */
  onUnload() {
  },
  /**
   * é¡µé¢ç›¸å…³äº‹ä»¶å¤„理函数--监听用户下拉动作
   */
  onPullDownRefresh() {
  },
  /**
   * é¡µé¢ä¸Šæ‹‰è§¦åº•事件的处理函数
   */
  onReachBottom() {
  },
  /**
   * ç”¨æˆ·ç‚¹å‡»å³ä¸Šè§’分享
   */
  onShareAppMessage() {
  }
})
pages/m_user/companyregister/companyregister.json
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,3 @@
{
  "usingComponents": {}
}
pages/m_user/companyregister/companyregister.wxml
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,2 @@
<!--pages/m_user/companyregister/companyregister.wxml-->
pages/m_user/companyregister/companyregister.wxss
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1 @@
/* pages/m_user/companyregister/companyregister.wxss */
pages/m_user/mine/mine.js
@@ -23,5 +23,74 @@
    wx.reLaunch({
      url: '/pages/m_user/userlogin/userlogin',
    })
  },
  goto(e) {
    var url = ""
    var index = e.currentTarget.dataset.index
    switch (index) {
      case "0":
        url = "/pages/m_user/companyauthentication/companyauthentication"
        break;
      case "1":
        url = ""
        break;
      case "2":
        url = ""
        break;
      case "3":
        url = ""
        break;
      case "4":
        url = "/pages/m_consult/consultonline/consultonline"
        break;
      case "5":
        url = "/pages/m_service/p_schedule/p_schedule"
        break;
    }
    if (url != "") {
      wx.navigateTo({
        url: url
      })
    } else {
      wx.showToast({
        title: '功能敬请期待',
        duration: 1000,
        icon: 'none',
        mask: true,
      })
    }
  },
  //认证
  gotoAuthentication(e) {
    var url = ""
    var index = e.currentTarget.dataset.index
    switch (index) {
      //企业认证
      case "0":
        url = "/pages/m_user/companyauthentication/companyauthentication"
        break;
      //场景认证
      case "1":
        url = "/pages/m_user/sceneauthentication/sceneauthentication"
        break;
      //个人认证
      case "2":
        url = ""
        break;
    }
    if (url != "") {
      wx.navigateTo({
        url: url
      })
    } else {
      wx.showToast({
        title: '功能敬请期待',
        duration: 1000,
        icon: 'none',
        mask: true,
      })
    }
  }
})
pages/m_user/mine/mine.wxml
@@ -5,19 +5,37 @@
      <image class="user-icon" src="/res/icons/learn_2.png" mode="aspectFill"></image>
      <view class="flex-v">
        <view class="user-name">{{userRealName}}</view>
        <view class="user-tag"></view>
        <view class="user-tag">
          <!-- <view>企业未认证</view>
          <view>店铺未认证</view>
          <view>个人未认证</view> -->
        </view>
      </view>
    </view>
  </view>
  <view class="page__bd">
    <view class="fyui-panel user-authentication">
      <view bindtap="gotoAuthentication" data-index="0">
        <image src="/res/icons/icon3.png"></image>
        <view>企业认证</view>
      </view>
      <view bindtap="gotoAuthentication" data-index="1">
        <image src="/res/icons/icon3.png"></image>
        <view>店铺认证</view>
      </view>
      <view bindtap="gotoAuthentication" data-index="2">
        <image src="/res/icons/icon3.png"></image>
        <view>个人认证</view>
      </view>
    </view>
    <view class="fyui-panel">
      <view class="fyui-cell fyui-cell_select title" bindtap="goto" data-index="0">
      <!-- <view class="fyui-cell fyui-cell_select title" bindtap="goto" data-index="0">
        <view class="fyui-cell__hd">
          <image src="/res/icons/icon3.png" class="icon" />
        </view>
        <view class="fyui-cell__bd">企业认证</view>
        <view class="fyui-cell__ft"></view>
      </view>
      </view> -->
      <view class="fyui-cell fyui-cell_select title" bindtap="goto" data-index="1">
        <view class="fyui-cell__hd">
          <image src="/res/icons/icon4.png" class="icon" />
@@ -59,4 +77,4 @@
  <view class="page__ft">
    <view class="logout" bindtap="logout">退出账户</view>
  </view>
</view>
</view>
pages/m_user/mine/mine.wxss
@@ -43,10 +43,28 @@
}
.user-tag {
  display: flex;
  font-size: 12px;
  color: var(--fyui-text-color_2);
}
.title:active {
  background-color: var(--fyui-BG-COLOR-ACTIVE);
}
.user-authentication {
  display: flex;
  justify-content: space-between;
}
.user-authentication>view {
  text-align: center;
  padding: 36px 16px;
  font-size: 14px;
  color: var(--fyui-text-color_1);
}
.user-authentication>view>image {
  width: 40px;
  height: 40px;
}
pages/m_user/sceneauthentication/sceneauthentication.js
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,28 @@
// pages/m_user/sceneauthentication/sceneauthentication.js
const app = getApp()
Page({
  /**
   * é¡µé¢çš„初始数据
   */
  data: {
  },
  /**
   * ç”Ÿå‘½å‘¨æœŸå‡½æ•°--监听页面加载
   */
  onLoad(options) {
    console.log(app.globalData.userInfo.extension2);
    this.setData({
      sceneType: app.globalData.userInfo.extension2
    })
  },
  onSubmit(e) {
    console.log(e);
    const info = e.detail
  }
})
pages/m_user/sceneauthentication/sceneauthentication.json
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,6 @@
{
  "navigationBarTitleText": "店铺认证",
  "usingComponents": {
    "c-scene-info": "../base_c/c_scene-info/c_scene-info"
  }
}
pages/m_user/sceneauthentication/sceneauthentication.wxml
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,7 @@
<!--pages/m_user/sceneauthentication/sceneauthentication.wxml-->
<view class="page">
  <image class="banner-bg" src="/res/icons/companyinfo-1.png" mode="widthFix"></image>
  <view class="tips">请仔细检查系统预留的企业信息,确认是否正确,调整完成后提交完成企业认证</view>
  <c-scene-info sceneType="{{sceneType}}" bindonSubmit="onSubmit"></c-scene-info>
</view>
pages/m_user/sceneauthentication/sceneauthentication.wxss
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,18 @@
/* pages/m_user/sceneauthentication/sceneauthentication.wxss */
.tips {
  position: relative;
  color: white;
  padding: 16px;
  font-size: 14px;
  font-weight: 550;
}
.banner-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  /* background-color: aqua; */
}
pages/m_user/userlogin/userlogin.js
@@ -1,22 +1,40 @@
// pages/m_user/userlogin/userlogin.js
import b_login from '../behaviors/b_login'
const $f = require("../../../service//baserequest")
const userservice = require("../../../service/userservice")
const app = getApp()
Page({
  behaviors: [b_login],
  /**
   * é¡µé¢çš„初始数据
   */
  data: {
    bgPath: $f.baseIconUrl + 'userlogin-1.png'
    bgPath: $f.baseIconUrl + 'userlogin-1.png',
    agree: false,
  },
  /**
   * ç”Ÿå‘½å‘¨æœŸå‡½æ•°--监听页面加载
   */
  onLoad: function (options) {
    wx.getStorage({
      key: 'agree',
      success: (res) => {
        this.setData({
          agree: res.data
        })
      }
    })
    wx.getStorage({
      key: 'userProfile',
      success: (res) => {
        this.setData({
          userProfile: res.data
        })
      },
    })
  },
  /**
@@ -34,16 +52,28 @@
  },
  loginWx() {
    var that = this
    wx.getUserProfile({
      lang: 'zh_CN',
      desc: '用于显示,提示用户当前已登录',
      success(res) {
        console.log(res);
        that.login()
      }
    })
    if (!this.waitAgree()) return
    if (app.globalData.userProfile) {
      this.loginPw(app.globalData.userProfile)
    }else {
      wx.getUserProfile({
        lang: 'zh_CN',
        desc: '用于显示,提示用户当前已登录',
        success:(res)=> {
          console.log(res);
          wx.setStorage({
            data: res.userInfo,
            key: 'userProfile',
          })
          this.loginPw(res.userInfo)
          // that.login()
        }
      })
    }
  },
  login() {
@@ -107,30 +137,50 @@
    })
  },
  getUserInfo() {
    userservice.getUserInfo(app.globalData.accessToken.userId, {
      success(data) {
        app.globalData.userInfo = data
        app.globalData.isLogin = true
        wx.setStorage({
          key: 'userInfo',
          data: data,
          success: (result) => {
            wx.switchTab({
              url: '/pages/home/home',
            })
          }
        })
      }
  _onLoginFail(e) {
    this.gotoLogin(function () {
      wx.showToast({
        title: '未绑定账号',
        duration: 1000,
        icon: 'none',
      })
    })
  },
  gotoLogin() {
  gotoLogin(toast) {
    if (!this.waitAgree()) return
    wx.navigateTo({
      url: '/pages/m_user/userloginpw/userloginpw',
      success: (result) => {},
      success: (result) => {
        if (typeof toast === 'function') {
          toast()
        }
      },
      fail: (res) => {},
      complete: (res) => {},
    })
  },
  checkboxChange(e) {
    var a = !this.data.agree
    this.setData({
      agree: a
    })
    wx.setStorage({
      key: 'agree',
      data: a
    })
  },
  waitAgree() {
    if (this.data.agree) {
      return true
    } else {
      wx.showToast({
        title: '请先同意说明',
        icon: 'none'
      })
      return false
    }
  }
})
pages/m_user/userlogin/userlogin.wxml
@@ -5,5 +5,9 @@
    <view class="submit" bindtap="loginWx">微信用户一键登录</view>
    <view class="login-btn_text" bindtap="gotoLogin">账号密码登录/注册</view>
  </view>
  <label class="weui-agree" bindtap="checkboxChange">
    <checkbox class="weui-agree__checkbox-check" value="{{agree}}" checked="{{agree}}" />
    <span class="weui-agree__checkbox"></span>
    <span class="weui-agree__text">阅读并同意<text>《中小企业守法服务平台用户条款》</text>及<text>《隐私条款》</text></span>
  </label>
</view>
pages/m_user/userlogin/userlogin.wxss
@@ -19,4 +19,13 @@
.login-btn_text:active {
  color: #2f655b71;
}
.weui-agree {
  margin-top: 50px;
  /* font-size: 14px; */
}
.weui-agree__text>text {
  color: #3CD0B6;
}
pages/m_user/userloginpw/userloginpw.js
@@ -1,9 +1,10 @@
// pages/m_user/userloginpw/userloginpw.js
const userservice = require("../../../service/userservice")
import b_login from '../behaviors/b_login'
const app = getApp()
Page({
  behaviors: [b_login],
  /**
   * é¡µé¢çš„初始数据
   */
@@ -35,13 +36,13 @@
    })
  },
  inputUserName (e) {
  inputUserName(e) {
    this.setData({
      userName: e.detail.value
    });
  },
  inputPassword (e) {
  inputPassword(e) {
    this.setData({
      password: e.detail.value
    });
@@ -54,7 +55,7 @@
        icon: 'none'
      })
      return
    }
    }
    if (this.data.password == '') {
      wx.showToast({
        title: '请输入密码',
@@ -62,65 +63,83 @@
      })
      return
    }
    var that = this
    this.setData({
      loading: true
    })
    userservice.login(this.data.userName, this.data.password, {
      success (data) {
        if (data.success) {
          app.globalData.accessToken = {
            userName: that.data.userName,
            password: that.data.password,
            userId: data.userId,
            suserId: data.suserId,
          }
    // userservice.login(this.data.userName, this.data.password, {
    //   success (data) {
    //     if (data.success) {
    //       app.globalData.accessToken = {
    //         userName: that.data.userName,
    //         password: that.data.password,
    //         userId: data.userId,
    //         suserId: data.suserId,
    //       }
    //       wx.setStorage({
    //         key: 'accessToken',
    //         data: app.globalData.accessToken,
    //       })
    //       that.getUserInfo()
    //     } else {
    //       wx.showToast({
    //         title: '账户或密码错误',
    //         duration: 1000,
    //         icon: 'none',
    //       })
    //     }
    //   },
    //   complete () {
    //     that.setData({
    //       loading: false
    //     })
    //   }
    // })
    if (app.globalData.userProfile) {
      app.globalData.userProfile.userName = this.data.userName
      app.globalData.userProfile.password = this.data.password
      this.loginPw(app.globalData.userProfile)
    } else {
      wx.getUserProfile({
        lang: 'zh_CN',
        desc: '用于显示,提示用户当前已登录',
        success:(res)=> {
          console.log(res);
          wx.setStorage({
            key: 'accessToken',
            data: app.globalData.accessToken,
            data: res.userInfo,
            key: 'userProfile',
          })
          that.getUserInfo()
        } else {
          wx.showToast({
            title: '账户或密码错误',
            duration: 1000,
            icon: 'none',
          })
          const token = res.userInfo
          token.userName = this.data.userName
          token.password = this.data.password
          this.loginPw(token)
        }
      },
      complete () {
        that.setData({
          loading: false
        })
      }
    })
      })
    }
  },
  getUserInfo() {
    var that = this
    userservice.getUserInfo(app.globalData.accessToken.userId, {
      success(data) {
        app.globalData.userInfo = data
        app.globalData.isLogin = true
        wx.setStorage({
          key: 'userInfo',
          data: data,
          success: (result) => {
            wx.switchTab({
              url: '/pages/home/home',
            })
          }
        })
      }
  _onLoginFail(e) {
    wx.showToast({
      title: '账户或密码错误',
      duration: 1000,
      icon: 'none',
    })
  },
  gotoRegister() {
    wx.navigateTo({
      url: '/pages/m_user/userregistertype/userregistertype',
      success: (result) => {},
    wx.showToast({
      title: '暂不开放注册',
      duration: 1000,
      icon: 'error',
      success: (res) => {},
      fail: (res) => {},
      complete: (res) => {},
    })
    // wx.navigateTo({
    //   url: '/pages/m_user/userregistertype/userregistertype',
    //   success: (result) => {},
    //   fail: (res) => {},
    //   complete: (res) => {},
    // })
  }
})
pages/m_user/userloginpw/userloginpw.wxml
@@ -14,7 +14,7 @@
    <button class="bottom-btn {{password.length > 0 ? 'bottom-btn_active' : ''}}" bindtap="login" loading="{{loading}}" disabled="{{password.length == 0}}">
      ç™»å½•
    </button>
    <view class="login-btn_text" bindtap="gotoRegister">去注册</view>
    <view class="login-btn_text" style="color: gray;" bindtap="gotoRegister">去注册</view>
    <!-- <view>
      <label class="weui-agree" bindtap="checkboxChange">
        <checkbox class="weui-agree__checkbox-check" value="agree" checked="{{agree}}"/>
res/icons/companyinfo-1.png
service/baserequest.js
@@ -7,12 +7,13 @@
 * fail: function(error)
 * } 
 */
const { duration } = require("../utils/moment.min.js");
const util = require("../utils/util.js")
const originProperties = ['url', 'data', 'header', 'method', 'success', 'fail', 'complete'];
// const baseUrl = "http://127.0.0.1:8080"
const baseUrl = "http://192.168.0.111:8080"
// const baseUrl = "https://fyami.com.cn:447"
// const baseUrl = "http://192.168.1.106:8080"
const baseUrl = "https://fyami.com.cn:447"
// const basePicUrl = baseUrl + "/images/"
const basePicUrl = "https://fyami.com.cn:447/images/"
const baseIconUrl = "https://fyami.com.cn:447/images/weixin/eplaw/"
@@ -37,9 +38,9 @@
  }
  var fun1 = util.deepCopy(fun)
  fun1.success = function (res) {
    // console.log("--------------请求结果----------------");
    console.log("|--访问: " + fun.url);
    console.log(res);
    console.log("|------------------------------------------------------------------------------------------------------------");
    console.log("|--访问: ", fun.url);
    console.log("|--结果: ", res);
    if (fun.onHead) {
      fun.onHead(res.header)
@@ -59,8 +60,9 @@
    console.log("--------------请求错误----------------" + fun.url);
    console.log(error);
    wx.showToast({
      title: '网络连接失败',
      icon: 'none'
      title: error.errMsg,
      icon: 'none',
      duration: 2000
    })
    if (fun.fail) {
      fun.fail(error)
service/scheduleservice.js
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,18 @@
const $f = require('./baserequest')
const util = require('../utils/util')
module.exports = {
  //获取所有环保日程
  getAllSchedules: function (userId, fun) {
    let cb = {
      url: `schedules.json`,
      method: 'GET',
      params: {
        userId: userId,
      },
    }
    Object.assign(cb, fun)
    wx.request(cb)
  },
}
service/userservice.js
@@ -45,4 +45,26 @@
    $f.get(cb)
  },
  //登录
  loginPW: function (accessTokenPW, fun) {
    let cb = {
      url: '/wxuser/loginPW',
      data: accessTokenPW,
    }
    Object.assign(cb, fun)
    $f.post(cb)
  },
  //场景信息认证
  authScene: function (userId, info, fun) {
    let cb = {
      url: '/wxuser/loginPW',
      data: accessTokenPW,
    }
    Object.assign(cb, fun)
    $f.post(cb)
  },
}