Commit bc1342f7 by 万亚飞

fix

parent a7e1d712
......@@ -23,7 +23,7 @@ class App extends React.Component {
vc();
let newObj = this.analysisQuery();
if (newObj && newObj.uid) {
storage.setSS('urlQuery', this.analysisQuery());
storage.setSS('appInfo', this.analysisQuery());
}
}
componentDidMount() {}
......
import React, { Component } from 'react';
import { ImagePicker } from 'antd-mobile';
import app from '../../../static/js/native';
import { ImagePicker, Modal } from 'antd-mobile';
import { isIOS } from '@/utils/tools';
import storage from '@/utils/storage.plugin';
import { PhotoSwipeGallery } from 'react-photoswipe';
import * as qiniu from 'qiniu-js';
import API from './api';
import 'react-photoswipe/lib/photoswipe.css';
import '@/static/styles/photoswipe.css';
class UpLoad extends Component {
state = {
isOpen: false,
maxSelectImageNumber: 1, //上传文件数
// certificateFiles: [],
ViewImagesIndex: 0
ViewImagesIndex: 0,
appInfo: null
// viewImages: [] //查看大图list
};
componentDidMount() {
// appBridge({
// name: 'action_needLoad',
// option: {
// needLoad: false
// }
// });
this.setState({
appInfo: storage.getSS('appInfo')
});
}
// 获取随机字符串
random_string(len = 32) {
......@@ -125,7 +124,19 @@ class UpLoad extends Component {
return (
<div className="photo-wrap">
<ImagePicker accept="image/png, image/jpeg, image/jpg" files={certificateFiles} onChange={this.certificateChange} onImageClick={this.onImageClickFun} selectable={certificateFiles.length < maxSelectImageNumber} />
<ImagePicker
onAddImageClick={e => {
if (this.state.appInfo.v <= '2.2.50' && isIOS) {
e.preventDefault();
Modal.alert('您的APP版本太低,升级后可使用上传图片功能');
}
}}
accept="image/png, image/jpeg, image/jpg"
files={certificateFiles}
onChange={this.certificateChange}
onImageClick={this.onImageClickFun}
selectable={certificateFiles.length < maxSelectImageNumber}
/>
<PhotoSwipeGallery items={viewImages} isOpen={isOpen} thumbnailContent={this.getThumbnailContent} options={{ closeOnScroll: false }} onClose={this.closePhoto} />
</div>
);
......
......@@ -74,7 +74,6 @@ class Page extends Component {
}
qiniuNext(res) {
// console.log("qiniuNext >>>>>>>")
// console.log(res)
}
qiniuError(err) {
this.props.refresh({
......
......@@ -39,7 +39,6 @@ class TrainItem extends Component {
</span>
<span
onClick={() => {
console.log(this.props.history);
if (data.auditStatus == 1) return;
if (iType === 3) {
linkTo(`/new/user/train/${data.id}?modifyId=${data.modifyId}`);
......
......@@ -20,7 +20,7 @@ export default class Layout extends Component {
vc();
let newObj = this.analysisQuery();
if (newObj && newObj.uid) {
storage.setSS('urlQuery', this.analysisQuery());
storage.setSS('appInfo', this.analysisQuery());
}
// ENV === 'development' && storage.setLS('uid', 13090225);
}
......
......@@ -6,14 +6,13 @@ import { Toast } from 'antd-mobile';
import { getParameterByName } from '../utils/common';
export default function ajax(apiKey, options) {
const userInfo = storage.getSS('urlQuery');
const userInfo = storage.getSS('appInfo');
const uinfo = userInfo
? {
uid: userInfo.uid,
accessToken: userInfo.accessToken
}
: '';
// console.log(uid);
const option = Object.assign(
{},
{
......
......@@ -102,7 +102,7 @@ export default class DepositPay extends Component {
}
componentDidMount() {
const userInfo = storage.getSS('urlQuery');
const userInfo = storage.getSS('appInfo');
this.setState({
userInfo
});
......
......@@ -39,7 +39,6 @@ export default class DepositPay extends Component {
fetchData = () => {
fetch('myDeposit', {
success: result => {
console.log(result);
let { cateDepositAmount, cateMeetRequired, qualityDepositAmount, qualityDepositDeficiency } = result.data;
this.setState({
depositMoney: cateDepositAmount, //类目保证金
......
......@@ -13,7 +13,6 @@ import { getParameterByName } from '../../utils/common';
import '@/static/styles/user/train-list.less';
function AddView(props) {
console.log(props);
return (
<div className="bottom-operate">
<a
......@@ -147,7 +146,6 @@ class JobList extends Component {
};
render() {
const { authList, backList, honorList, delDialogObj, tabIndex } = this.state;
console.log(tabIndex);
// title="执业背景"
return (
<div>
......
......@@ -29,7 +29,6 @@ class Train extends Component {
};
//初始化图片
initImgs(imgs) {
console.log('initImgs', imgs);
let viewArr = [],
creArr = [];
const _this = this;
......@@ -161,7 +160,7 @@ class Train extends Component {
fetch(subType, {
data: param,
success: res => {
Toast.info(`${str}成功,请刷新列表页查看`);
Toast.info(`${str}成功`);
fetch('fetchTrainList', {
loading: false
});
......
......@@ -23,7 +23,7 @@ class TrainList extends Component {
document.title = '受训背景';
app().downRefresh(true);
app().notRefresh(true);
const userInfo = storage.getSS('urlQuery');
const userInfo = storage.getSS('appInfo');
this.setState({
userInfo
});
......
import React, { Component } from 'react';
import { Toast, Modal } from 'antd-mobile';
import Layout from '../../Components/static/Layout/Layout';
import { MATERIAL_ARR } from '../../static/js/constant';
import { getParam, getImgNaturalDimensions, linkTo } from '../../utils/tools';
import UpLoad from '../../Components/common/Upload/Upload';
......@@ -64,7 +63,6 @@ class AddMaterial extends Component {
}
initImgs = imgs => {
console.log('initImgs', imgs);
let viewArr = [],
creArr = [];
const _this = this;
......@@ -109,7 +107,6 @@ class AddMaterial extends Component {
} else {
Toast.info('上传图片失败,请重试', 2);
}
console.log(res);
};
delFile = () => {
this.setState({
......@@ -160,7 +157,7 @@ class AddMaterial extends Component {
fetch(`${subType}${this.state.materialType}`, {
data: param,
success: res => {
Toast.info(`${str}成功,请刷新列表页查看`);
Toast.info(`${str}成功`);
fetch('fetchJobList', {
loading: false
});
......
......@@ -179,16 +179,11 @@ export default function() {
var ua = window.navigator.userAgent.toLowerCase();
if (ua.match(/MicroMessenger/i) == 'micromessenger') {
// console.log('微信')
return 'wx';
} else {
// console.log('非微信')
if (isiOS) {
console.log('iOS');
return 'iOS';
} else if (isAndroid) {
console.log('isAndroid');
return 'Android';
} else {
console.log('非微信web', ua);
......@@ -204,7 +199,6 @@ export default function() {
* connectWebViewJavascriptBridge
* ***/
function connectWebViewJavascriptBridge(callback) {
console.log('connectWebViewJavascriptBridge');
if (window.WebViewJavascriptBridge) {
callback(WebViewJavascriptBridge);
} else {
......@@ -217,18 +211,11 @@ export default function() {
);
}
}
window.sendDataToOC = function(params) {};
console.log('system', browser);
if (browser == 'iOS') {
console.log('isIos');
connectWebViewJavascriptBridge(function(bridge) {
bridge.init(function(message, responseCallback) {});
bridge.registerHandler('javascriptHandler', function(data, responseCallback) {});
console.log('isIos2222');
window.sendDataToOC = function(params) {
bridge.callHandler('javascriptHandler', params, function(response) {
if (typeof response.uid == 'undefined') {
......@@ -253,7 +240,6 @@ export default function() {
function sendDataToExp(params) {
try {
if (browser == 'iOS') {
console.log('postMessage', params);
window.webkit.messageHandlers.MModel.postMessage(params);
} else {
var a = '';
......@@ -281,37 +267,20 @@ export default function() {
};
params.cmd.action_name = 'action_needLoad';
params.url = 'ydl_app';
console.log('notRefresh,2.2.50');
sendDataToExp(params);
};
// 跳转到m站
native.openApp = function() {
console.log('openApp');
setTimeout(function() {
var parmas = {};
parmas.url = 'ydl-user://confide/home';
sendDataToOC(parmas);
}, 300);
};
native.goPage = function(url) {
setTimeout(function() {
var parmas = {
var params = {
url: 'http',
cmd: {
params: { url: url },
action_name: ''
action_name: '',
params: { url: url }
}
};
sendDataToExp(parmas);
sendDataToExp(params);
}, 300);
};
native.toPage = function(url) {
sendDataToExp(url);
};
native.setParams = function(action_name, params, _url) {
setParams(action_name, params, _url);
};
native.gotoOCChat = function(args) {
const params = {
cmd: {
......@@ -331,7 +300,6 @@ export default function() {
url: _url
}
};
console.log(data);
sendDataToExp(data);
};
return native;
......
......@@ -637,7 +637,7 @@ textarea::placeholder {
background: black;
}
/*常用按钮*/
btn.active,
.btn.active,
.btn:active {
background-image: none;
outline: 0;
......@@ -912,6 +912,9 @@ textarea::placeholder {
.am-toast-notice-content .am-toast-text {
min-width: 100px;
}
.am-modal-title {
line-height: 1.4;
}
.am-modal {
margin-bottom: 60px;
}
......@@ -927,12 +930,12 @@ textarea::placeholder {
.am-button {
height: 45px;
line-height: 45px;
}
.am-button[disabled] {
&[disabled] {
background-color: #ddd;
&::before {
border: 1px solid #ddd !important;
}
}
}
.deposit-user .my-list .am-list-item .am-list-line .am-list-content,
......
......@@ -54,9 +54,14 @@ export function getImgNaturalDimensions(imgSrc, callback) {
}
export function linkTo(url) {
location.href = url;
// alert(`${location.origin}${url}`);
// alert(`${location.origin}${url}`);
// history.pushState(null, 'hello', `${location.origin}${url}`);
// window.webkit.messageHandlers.MModel.postMessage({
// url: 'http',
// cmd: {
// action_name: '',
// params: { url: 'https://testh2.yidianling.com/new/user/train?uid=13089811&ts=1559025371&sign=39549b2a339e5a56bbb8a1d2bb594d67&accessToken=d86ec45b5fcf9cd1a10dfaa17b527d67MTkwNTIwv=2.3.00&uid=13089811&ts=1559025371&sign=fe3e41e54912f6e5d366b346eaccfd2d&accessToken=d86ec45b5fcf9cd1a10dfaa17b527d67MTkwNTIw' }
// }
// });
// app().goPage(`${location.origin}${url}`);
// alert(`${location.origin}${url}`);
// app().gotoOCChat('壹点零', `${location.origin}${url}`);
}
......@@ -65,7 +65,7 @@ export default function() {
lastZ = z; // 赋值,为下一次计算做准备
}
}
if (root.DeviceMotionEvent && !navigator.userAgent.match(/OS 8/)) {
if (root.DeviceMotionEvent && !navigator.userAgent.match(/OS 8/) && location.hostname.match('test')) {
styleDom = document.createElement('style');
// styleDom.innerText = '#__vconsole{display:none}';
document.head.appendChild(styleDom);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment