| | |
| | | // 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, |
| | |
| | | "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" |
| | | }, |
| | |
| | | } |
| | | |
| | | .submit:active { |
| | | background-color: var(--fyui-BG-COLOR-ACTIVE); |
| | | background: linear-gradient(to right, #b7e9ce, #adebde); |
| | | } |
| | | |
| | | .no-data { |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | // 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": true, |
| | | "usingComponents": {} |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <!--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 */ |
| | | .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); |
| | | } |
| | |
| | | <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> |
| | |
| | | } |
| | | .weui-up-input{ |
| | | color: black; |
| | | font-size: var(--ffui-font-size-2); |
| | | font-size: 1rem; |
| | | /* border-radius: 10rpx; */ |
| | | width: 100%; |
| | | /* background-color: seagreen; */ |
| | |
| | | .required { |
| | | color: red; |
| | | text-align: center; |
| | | vertical-align: middle; |
| | | } |
| | | |
| | | .not-required { |
| | |
| | | .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 |
| | | 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": true, |
| | | "usingComponents": {} |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <!--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 */ |
| | | .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); |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | function ScheduleItem({ |
| | | name, |
| | | noticeBef, |
| | | noticeNow, |
| | | noticeAft, |
| | | type, |
| | | }) { |
| | | // this.name: 'æ¬æ10å·ä¸ºå°è´¦åæ¶æäº¤éæ', |
| | | // noticeBef: '', |
| | | // noticeNow: '', |
| | | // noticeAft: '', |
| | | // type: '' |
| | | } |
| | | |
| | | ScheduleItem.prototype = { |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | //åºæ¯æ³¨åä¿¡æ¯ |
| | | 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 |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | 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/assessment/assessment.wxml--> |
| | | <import src="/template/nodata.wxml"></import> |
| | | |
| | | <view class="page"> |
| | | <!-- <view class="banner-bg"></view> --> |
| | | |
| | |
| | | </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> |
| | |
| | | .line-chart-card { |
| | | position: relative; |
| | | height: 30vh; |
| | | padding: 0; |
| | | padding: 0 0 8px 0; |
| | | } |
| | | |
| | | .h-cell { |
| | |
| | | width: 8px; |
| | | } |
| | | .card .card-title { |
| | | font-size: 18px; |
| | | font-size: 16px; |
| | | font-weight: bold; |
| | | } |
| | | |
| | |
| | | * çå½å¨æå½æ°--çå¬é¡µé¢å è½½ |
| | | */ |
| | | onLoad(options) { |
| | | |
| | | this.setData({ |
| | | userId: app.globalData.accessToken.userId |
| | | }) |
| | | }, |
| | | |
| | | clearInput() { |
| | |
| | | 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, |
| | |
| | | userId: 'system', |
| | | userName: 'æºè½å®¢æ', |
| | | type: 0, |
| | | text: 'ä¸å¥½ææï¼ææ ç¸å
³è§£çï¼è¯·è¯è¯å
¶ä»å
³é®è¯' |
| | | text: 'æ±æï¼æè¿ä¸çè§£æ¨çææã请å°è¯éæ°å¨è¯¢ã' |
| | | }) |
| | | } else { |
| | | record.push({ |
| | |
| | | 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 |
| | |
| | | <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}}"> |
| | |
| | | .consult-avator { |
| | | width: 40px; |
| | | height: 40px; |
| | | border-radius: 50%; |
| | | } |
| | | |
| | | .consult-text { |
| | |
| | | <!--pages/promise/promise.wxml--> |
| | | <import src="/template/nodata.wxml"></import> |
| | | |
| | | <view class="page"> |
| | | <!-- <view class="banner-bg"></view> --> |
| | | |
| | |
| | | <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> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | 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 |
| | | 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 |
| | | }, |
| | |
| | | * ç»ä»¶ç屿§å表 |
| | | */ |
| | | properties: { |
| | | title: { |
| | | type: String, |
| | | value: 'è¥ä¸æ§ç
§ç»æ' |
| | | }, |
| | | time: { |
| | | type: String, |
| | | value: '2022-9-10 ææå
' |
| | | }, |
| | | leftDays: { |
| | | type: Number, |
| | | value: 2 |
| | | }, |
| | | |
| | | }, |
| | | |
| | | /** |
| | |
| | | |
| | | }, |
| | | |
| | | 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--> |
| | | <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> |
| | |
| | | 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 |
| | | import b_scheduleManager from '../behaviors/b_scheduleManager' |
| | | const moment = require('../../../utils/moment.min') |
| | | |
| | | Page({ |
| | | |
| | | behaviors: [b_scheduleManager], |
| | | /** |
| | | * 页é¢çåå§æ°æ® |
| | | */ |
| | |
| | | * çå½å¨æå½æ°--çå¬é¡µé¢å è½½ |
| | | */ |
| | | 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) |
| | | }, |
| | | }) |
| | | } |
| | | }) |
| | |
| | | <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"> |
| | |
| | | * 页é¢çåå§æ°æ® |
| | | */ |
| | | data: { |
| | | steps:[{ |
| | | steps: [{ |
| | | index: '01', |
| | | title: ['åå¾ç¯', 'ä¿é¨é¨'], |
| | | content: 'åå¾ç¸å
³ç¯ä¿é¨é¨æä¾ç¸å
³è¯ä»¶ï¼å¯è¿è¡è¥ä¸æ§ç
§ç»æã' |
| | | },{ |
| | | }, { |
| | | index: '02', |
| | | title: ['è¥ä¸æ§', 'ç
§ç»æ'], |
| | | content: 'åå¾ç¸å
³ç¯ä¿é¨é¨æä¾ç¸å
³è¯ä»¶ï¼å¯è¿è¡è¥ä¸æ§ç
§ç»æã' |
| | | },{ |
| | | }, { |
| | | index: '03', |
| | | title: ['è¥ä¸æ§', 'ç
§ç»æ'], |
| | | content: 'åå¾ç¸å
³ç¯ä¿é¨é¨æä¾ç¸å
³è¯ä»¶ï¼å¯è¿è¡è¥ä¸æ§ç
§ç»æã' |
| | |
| | | * çå½å¨æå½æ°--çå¬é¡µé¢å è½½ |
| | | */ |
| | | onLoad(options) { |
| | | |
| | | this.getOpenerEventChannel().on('acceptDataFromOpenerPage', (data) => { |
| | | this.setData({ |
| | | thisSchedule: data |
| | | }) |
| | | }) |
| | | }, |
| | | |
| | | onSubmit() { |
| | |
| | | <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 |
| | | |
| | | 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 |
| | | }) |
| | | }, |
| | | |
| | | |
| | | } |
| | | }) |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | { |
| | | "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--> |
| | | <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 */ |
| | | .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 |
| | | 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 |
| | | }) |
| | | } |
| | | } |
| | | } |
| | | }) |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | { |
| | | "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--> |
| | | <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 */ |
| | | .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; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /** |
| | | * |
| | | */ |
| | | 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(); |
| | | } |
| | | } |
| | | }) |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | 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 |
| | | import $f from '../../../service/baserequest' |
| | | |
| | | Page({ |
| | | |
| | | /** |
| | | * 页é¢çåå§æ°æ® |
| | | */ |
| | | data: { |
| | | |
| | | }, |
| | | |
| | | /** |
| | | * çå½å¨æå½æ°--çå¬é¡µé¢å è½½ |
| | | */ |
| | | onLoad(options) { |
| | | |
| | | }, |
| | | }) |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | { |
| | | "navigationBarTitleText": "ä¼ä¸è®¤è¯", |
| | | "usingComponents": { |
| | | "c-company-info": "../base_c/c_company-info/c_company-info" |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <!--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 */ |
| | | .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 |
| | | Page({ |
| | | |
| | | /** |
| | | * 页é¢çåå§æ°æ® |
| | | */ |
| | | data: { |
| | | |
| | | }, |
| | | |
| | | /** |
| | | * çå½å¨æå½æ°--çå¬é¡µé¢å è½½ |
| | | */ |
| | | onLoad(options) { |
| | | |
| | | }, |
| | | |
| | | /** |
| | | * çå½å¨æå½æ°--çå¬é¡µé¢å次渲æå®æ |
| | | */ |
| | | onReady() { |
| | | |
| | | }, |
| | | |
| | | /** |
| | | * çå½å¨æå½æ°--çå¬é¡µé¢æ¾ç¤º |
| | | */ |
| | | onShow() { |
| | | |
| | | }, |
| | | |
| | | /** |
| | | * çå½å¨æå½æ°--çå¬é¡µé¢éè |
| | | */ |
| | | onHide() { |
| | | |
| | | }, |
| | | |
| | | /** |
| | | * çå½å¨æå½æ°--çå¬é¡µé¢å¸è½½ |
| | | */ |
| | | onUnload() { |
| | | |
| | | }, |
| | | |
| | | /** |
| | | * 页é¢ç¸å
³äºä»¶å¤ç彿°--çå¬ç¨æ·ä¸æå¨ä½ |
| | | */ |
| | | onPullDownRefresh() { |
| | | |
| | | }, |
| | | |
| | | /** |
| | | * 页é¢ä¸æè§¦åºäºä»¶çå¤ç彿° |
| | | */ |
| | | onReachBottom() { |
| | | |
| | | }, |
| | | |
| | | /** |
| | | * ç¨æ·ç¹å»å³ä¸è§å享 |
| | | */ |
| | | onShareAppMessage() { |
| | | |
| | | } |
| | | }) |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | { |
| | | "usingComponents": {} |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <!--pages/m_user/companyregister/companyregister.wxml--> |
| | | |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /* pages/m_user/companyregister/companyregister.wxss */ |
| | |
| | | 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, |
| | | }) |
| | | } |
| | | } |
| | | }) |
| | |
| | | <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" /> |
| | |
| | | <view class="page__ft"> |
| | | <view class="logout" bindtap="logout">éåºè´¦æ·</view> |
| | | </view> |
| | | </view> |
| | | </view> |
| | |
| | | } |
| | | |
| | | .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 |
| | | 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 |
| | | |
| | | } |
| | | }) |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | { |
| | | "navigationBarTitleText": "åºéºè®¤è¯", |
| | | "usingComponents": { |
| | | "c-scene-info": "../base_c/c_scene-info/c_scene-info" |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <!--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 */ |
| | | .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 |
| | | 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 |
| | | }) |
| | | }, |
| | | }) |
| | | }, |
| | | |
| | | /** |
| | |
| | | }, |
| | | |
| | | 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() { |
| | |
| | | }) |
| | | }, |
| | | |
| | | 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 |
| | | } |
| | | } |
| | | }) |
| | |
| | | <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> |
| | |
| | | |
| | | .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 |
| | | const userservice = require("../../../service/userservice") |
| | | import b_login from '../behaviors/b_login' |
| | | |
| | | const app = getApp() |
| | | |
| | | Page({ |
| | | |
| | | behaviors: [b_login], |
| | | /** |
| | | * 页é¢çåå§æ°æ® |
| | | */ |
| | |
| | | }) |
| | | }, |
| | | |
| | | inputUserName (e) { |
| | | inputUserName(e) { |
| | | this.setData({ |
| | | userName: e.detail.value |
| | | }); |
| | | }, |
| | | |
| | | inputPassword (e) { |
| | | inputPassword(e) { |
| | | this.setData({ |
| | | password: e.detail.value |
| | | }); |
| | |
| | | icon: 'none' |
| | | }) |
| | | return |
| | | } |
| | | } |
| | | if (this.data.password == '') { |
| | | wx.showToast({ |
| | | title: '请è¾å
¥å¯ç ', |
| | |
| | | }) |
| | | 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) => {}, |
| | | // }) |
| | | } |
| | | }) |
| | |
| | | <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}}"/> |
| | |
| | | * 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/" |
| | |
| | | } |
| | | 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) |
| | |
| | | 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) |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | 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) |
| | | }, |
| | | } |
| | |
| | | |
| | | $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) |
| | | }, |
| | | } |