fix:bug修复

master
blak-kong 2 years ago
parent 64302d397e
commit 75413856f7

@ -0,0 +1,19 @@
.nodata {
width: 200rpx;
height: 300rpx;
margin: 0 auto;
// margin-top: 310rpx;
text-align: center;
.nodata_img {
display: inline-block;
width: 160rpx;
height: 160rpx;
margin-bottom: 34rpx;
}
.nodata_text {
font-size: 30rpx;
font-family: PingFang SC;
font-weight: 400;
color: #666666;
}
}

@ -0,0 +1,45 @@
import classnames from "classnames";
import Taro from "@tarojs/taro";
import { Component } from "react";
import { Block, View, Image } from "@tarojs/components";
import "./nodata.less";
export default class NoDataComponent extends Component<any, any> {
constructor(props) {
super(props);
this.state = {
name: "无数据组件",
};
}
async onLoad() {}
componentDidMount() {}
componentWillUnmount() {}
componentDidShow() {}
componentDidHide() {}
async initData() {}
showInit() {}
render() {
return (
<Block>
<View>
<View className="nodata">
<Image
className="nodata_img"
src={require("../../img/nodata.png")}
></Image>
<View className="nodata_text"></View>
</View>
</View>
</Block>
);
}
}

@ -104,10 +104,8 @@ class UpdateIotWL200 extends Component<any, any> {
let objStr = getStorageSync("instrument_detail");
if (objStr) {
let info = JSON.parse(objStr);
this.setState({
currentDevice: info,
currentDevice: objStr,
});
}
setTimeout(() => {

@ -64,6 +64,9 @@ class Index extends Component<any, any> {
constructor(props) {
super(props);
this.state = {
isCommonError: false, // 是否显示通用错误提示
commonErrorText: [], // 通用错误提示
showEquipment: false, // 扫码绑定设备弹窗
isRegisterBoolean: false, // 是否已登录
isShowPrivacyPopup: false,
@ -172,7 +175,7 @@ class Index extends Component<any, any> {
componentDidHide() {}
showInit() {
showInit = async () => {
// 判断是否登录
let mobile = Taro.getStorageSync("mobile");
if (mobile) {
@ -198,6 +201,7 @@ class Index extends Component<any, any> {
let serial = ids[1];
Taro.setStorageSync("serial", serial);
if (!Taro.getStorageSync("mobile")) {
await this.onlyLogin();
go("/pages/register/register");
}
}
@ -205,7 +209,7 @@ class Index extends Component<any, any> {
}
this.checkShowPrivacyPopup();
}
}
};
// 检测是否弹出隐私协议
checkShowPrivacyPopup() {
@ -446,6 +450,26 @@ class Index extends Component<any, any> {
}, 2000);
}
}
// 只登陆,不做其他操作
async onlyLogin() {
Taro.showLoading({
title: "请求中...",
mask: true,
});
const { code } = await Taro.login();
const { data } = await WCUserLogin({ code });
Taro.hideLoading();
if (data.code === 200) {
Taro.setStorageSync("isWelcome", true);
Taro.setStorageSync("mobile", data.data.mobile);
this.props.tokenRefresh(data.data);
} else {
msg("请求失败,尝试重新请求");
}
}
closeBinding = () => {
this.setState({ isVisibleBinding: false });
};
@ -503,8 +527,7 @@ class Index extends Component<any, any> {
this.setState({ isBindingError: true });
}
Taro.removeStorageSync("isScan"); // 扫码弹窗显示完后,不需要再判断是否扫码
Taro.removeStorageSync("serial"); // 扫码弹窗显示完后,删除缓存的扫码序列号
this.removeScanFun();
}
};
@ -540,6 +563,7 @@ class Index extends Component<any, any> {
});
Taro.hideLoading();
this.closeBinding();
this.removeScanFun();
if (data.code === 200) {
msg("绑定成功");
setTimeout(() => {
@ -577,6 +601,7 @@ class Index extends Component<any, any> {
// 仪器绑定失败弹窗
onBindErrorClose = () => {
this.setState({ isBindingError: false });
this.removeScanFun();
};
onBindErrorConfirm = () => {
this.onBindErrorClose();
@ -584,16 +609,31 @@ class Index extends Component<any, any> {
};
onBeforeBindClose = () => {
this.setState({ isBeforeBinding: false });
this.removeScanFun();
};
onBeforeBindConfirm = () => {
this.setState({ isBeforeBinding: false });
this.removeScanFun();
};
/**删除扫码缓存*/
removeScanFun = () => {
Taro.removeStorageSync("isScan"); // 扫码弹窗显示完后,不需要再判断是否扫码
Taro.removeStorageSync("serial"); // 扫码弹窗显示完后,删除缓存的扫码序列号
};
// 跳转仪器介绍页
goNursing = (item) => {
setStorageSync("instrument_detail", JSON.stringify(item));
this.setState({ connectInstrument: item });
setTimeout(() => this.bindBlockLeft());
if (item.status === 0) {
setStorageSync("instrument_detail", item);
this.setState({ connectInstrument: item });
setTimeout(() => this.bindBlockLeft());
} else {
// todo
this.openCommonError([
"该仪器暂时无法进行在线护理,",
"请联系微信小助理",
]);
}
};
/* 扫码进入逻辑 */
@ -760,8 +800,26 @@ class Index extends Component<any, any> {
// this.goNursing()
};
/**
* @name
* @description
* @params
*/
openCommonError = (text) => {
this.setState({
commonErrorText: text,
isCommonError: true,
});
};
onCommonErrorFun = () => {
this.setState({
isCommonError: false,
});
};
render() {
let {
isCommonError,
commonErrorText,
calendarComplete,
calendarInComplete,
currentDate,
@ -800,6 +858,21 @@ class Index extends Component<any, any> {
return (
<Block>
<View catchMove>
<PopupAlert
isShow={isCommonError}
title="提示"
content={
<Block>
{commonErrorText.map((item) => {
return <View>{item}</View>;
})}
</Block>
}
confirmButtonText="知道了"
textAlgin="center"
close={this.onCommonErrorFun}
confirm={this.onCommonErrorFun}
/>
<PopupConfirm
isShow={isShowReConnectDeviceRecordWL200}
isClose
@ -829,7 +902,6 @@ class Index extends Component<any, any> {
}
confirmButtonText="知道了"
textAlgin="center"
isClose={false}
close={this.onBindErrorClose}
confirm={this.onBindErrorConfirm}
/>
@ -878,7 +950,6 @@ class Index extends Component<any, any> {
}
confirmButtonText="知道了"
textAlgin="center"
isClose={false}
close={this.onBindErrorClose}
confirm={this.onBindErrorConfirm}
/>
@ -888,7 +959,6 @@ class Index extends Component<any, any> {
content="您选择的仪器有误,请重新确认选择"
confirmButtonText="知道了"
textAlgin="center"
isClose={false}
close={this.onBeforeBindClose}
confirm={this.onBeforeBindConfirm}
/>
@ -907,7 +977,6 @@ class Index extends Component<any, any> {
}
confirmButtonText="知道了"
textAlgin="center"
isClose={false}
close={this.onUnloginClose.bind(this)}
confirm={this.onUnloginConfirm.bind(this)}
></PopupAlert>
@ -1040,24 +1109,22 @@ class Index extends Component<any, any> {
<View style="overflow-x: auto;">
<View className="device_list flex">
{instrumentList.map((item, index) => {
if (item.status === 0) {
return (
<View
key={"instrumentList" + index}
className="device_item"
onClick={this.goNursing.bind(this, item)}
>
<Image
className="banner_img"
src={item.banner}
mode="aspectFill"
/>
<View className="device_name ellipsis1">
{item.name}
</View>
return (
<View
key={"instrumentList" + index}
className="device_item"
onClick={this.goNursing.bind(this, item)}
>
<Image
className="banner_img"
src={item.banner}
mode="aspectFill"
/>
<View className="device_name ellipsis1">
{item.name}
</View>
);
}
</View>
);
})}
</View>
</View>

@ -18,7 +18,7 @@ import {
} from "@tarojs/components";
import { InstrumentInfo } from "@/utils/Interface";
import { go, msg, setStorageSync, getStorageSync } from "@/utils/traoAPI";
import { go, msg, setStorageSync } from "@/utils/traoAPI";
import { getImgInfo, contraction } from "@/utils/compressImage";
@ -26,6 +26,7 @@ import { getImgInfo, contraction } from "@/utils/compressImage";
import Navbar from "@/components/navbar/navbar";
import PopupAlert from "@/components/popup/popup-alert";
import PopupBinding from "@/components/popup/popup-binding";
import NoDataComponent from "@/components/base/nodata";
/* 组件 */
import "./instrument.less";
@ -66,6 +67,9 @@ export default class Instrument extends Component<any, any> {
isVisibleBinding: false,
isRegisterBoolean: false,
isExchangeBinding: false,
/** INPUT序列号拎出来防止上传图片被清空bug */
serialCodeValue: "",
};
}
$instance = Taro.getCurrentInstance();
@ -79,6 +83,13 @@ export default class Instrument extends Component<any, any> {
componentWillUnmount() {}
componentDidShow() {
// 进入页面判断是否注册,用于扫码登录
let mobile = Taro.getStorageSync("mobile");
if (mobile) {
this.setState({ isRegisterBoolean: true });
}
// 用于判断是否只显示一个设备
let params: any = this.$instance.router?.params;
if (params?.isOnly && params?.id) {
if (params?.isOnly === "true") {
@ -96,10 +107,7 @@ export default class Instrument extends Component<any, any> {
onSerial = (event) => {
const { value } = event.detail;
let { channelInfo } = this.state;
channelInfo.serialCode = value;
this.setState({ channelInfo });
this.setState({ serialCodeValue: value });
};
onTipShow = () => {
@ -170,16 +178,20 @@ export default class Instrument extends Component<any, any> {
let compressImage = await contraction(img, "compressImage");
// 压缩后文件地址
let compressTempFilePath = compressImage.tempFilePath;
let { channelInfo } = this.state;
channelInfo.serialImage = compressTempFilePath;
this.setState({ channelInfo });
setTimeout(() => {
let { channelInfo } = this.state;
channelInfo.serialImage = compressTempFilePath;
this.setState({ channelInfo });
});
},
});
};
onSubmit = () => {
const { serialCode, serialImage, id } = this.state.channelInfo;
if (!serialCode?.trim()) return msg("请填写序列号");
const { serialImage } = this.state.channelInfo;
if (!this.state.serialCodeValue?.trim()) return msg("请填写序列号");
if (!serialImage) return msg("请上传序列号照片");
this.manualCodeBinding();
};
@ -194,6 +206,7 @@ export default class Instrument extends Component<any, any> {
this.setState({
channelInfo: channelInfo,
isVideo: this.isVideo(item.banner),
serialCodeValue: "",
});
setTimeout(() => {
@ -226,27 +239,34 @@ export default class Instrument extends Component<any, any> {
if (data.code === 200) {
if (data.data.length) {
if (!this.isOnly) {
let item = data.data[0];
let equipmentList = data.data.filter((item) => item.status === 0);
if (equipmentList.length === 0) {
return;
}
let item = equipmentList[0];
item.serialCode = "";
this.setState({
equipmentList: data.data,
equipmentList: equipmentList,
channelInfo: item,
isVideo: this.isVideo(item.banner),
});
} else {
let item = data.data.find((item) => String(item.id) === this.id);
item.serialCode = "";
this.setState({
equipmentList: [item],
channelInfo: item,
isVideo: this.isVideo(item.banner),
});
if (item) {
item.serialCode = "";
this.setState({
equipmentList: [item],
channelInfo: item,
isVideo: this.isVideo(item.banner),
});
}
}
}
}
};
// 绑定仪器
// 手写绑定仪器
manualCodeBinding = async () => {
Taro.showLoading({
title: "请求中...",
@ -255,12 +275,12 @@ export default class Instrument extends Component<any, any> {
let { channelInfo } = this.state;
let res = await InstrumentInfo.manualCodeBinding({
serial: channelInfo.serialCode,
serial: this.state.serialCodeValue,
serialImage: channelInfo.serialImage,
instrumentId: channelInfo.id,
});
console.log("bindingInstrument", res);
Taro.hideLoading();
// 文件上传接口返回格式不需要加data
if (res.code === 200) {
this.openBindingVisible();
} else if (res.code === 204) {
@ -326,8 +346,8 @@ export default class Instrument extends Component<any, any> {
console.log("exchangeBinding", data);
Taro.hideLoading();
this.closeBinding();
if (data.code !== 200) {
//todo
if (data.code === 200) {
msg("换绑成功");
}
};
@ -377,6 +397,7 @@ export default class Instrument extends Component<any, any> {
isVisibleBinding,
isRegisterBoolean,
isExchangeBinding,
serialCodeValue,
} = this.state;
return (
<Block>
@ -412,9 +433,8 @@ export default class Instrument extends Component<any, any> {
content="序列号库仍在更新,请联系微信助手"
confirmButtonText="知道了"
textAlgin="center"
isClose={false}
close={this.onBindErrorClose}
confirm={this.onBindErrorClose}
confirm={this.onBindErrorConfirm}
></PopupAlert>
<PopupAlert
isShow={isBindingCheckError}
@ -422,7 +442,6 @@ export default class Instrument extends Component<any, any> {
content="您选择的仪器有误,请重新选择确认"
confirmButtonText="知道了"
textAlgin="center"
isClose={false}
close={this.onBindCheckErrorClose}
confirm={this.onBindCheckErrorClose}
></PopupAlert>
@ -481,26 +500,35 @@ export default class Instrument extends Component<any, any> {
style="width: 100%; white-space: nowrap;"
scrollIntoView={"scroll" + channelInfo.id}
>
{equipmentList.map((item, index) => {
return (
<View
className={classnames("cover", {
active_cover: channelInfo.id === item.id,
})}
id={"scroll" + item.id}
key={index}
onClick={this.onSelectChange.bind(this, item)}
>
<Image
className="instrument_img"
src={item.banner}
mode="aspectFill"
// mode="aspectFit"
></Image>
<View className="desc">{item.name}</View>
{equipmentList.length > 0 &&
equipmentList.map((item, index) => {
return (
<View
className={classnames("cover", {
active_cover: channelInfo.id === item.id,
})}
id={"scroll" + item.id}
key={index}
onClick={this.onSelectChange.bind(this, item)}
>
<Image
className="instrument_img"
src={item.banner}
mode="aspectFill"
// mode="aspectFit"
></Image>
<View className="desc">{item.name}</View>
</View>
);
})}
{equipmentList.length === 0 && (
<Block>
<View>
<NoDataComponent />
</View>
);
})}
</Block>
)}
</ScrollView>
</View>
<View className="form_item is-tab">
@ -555,7 +583,7 @@ export default class Instrument extends Component<any, any> {
placeholder="例如FR10*********1"
placeholder-style={style}
onInput={this.onSerial}
value={channelInfo.serialCode}
value={serialCodeValue}
></Input>
</View>
</View>

@ -25,30 +25,29 @@ class Intro extends Component<any, any> {
constructor(props) {
super(props);
this.state = {
name: "template模板页",
name: "仪器介绍页",
current: 0,
instrument: {},
introList: [],
isNursing: false,
};
}
$instance = Taro.getCurrentInstance();
async onLoad() {}
componentDidMount() {}
componentWillMount() {
// let params = Taro.Current?.router?.params;
// if (params) {
// this.getInstrumentInfo(params.id);
// }
componentDidMount() {
let strObj = getStorageSync("instrument_detail");
if (strObj) {
let instrument = JSON.parse(strObj);
let instrument = strObj;
this.getInstrumentInfo(instrument.id);
this.setState({ instrument });
}
}
componentWillMount() {
// let params = Taro.Current?.router?.params;
// if (params) {
// this.getInstrumentInfo(params.id);
// }
}
componentWillUnmount() {}
componentDidShow() {}
@ -64,35 +63,33 @@ class Intro extends Component<any, any> {
}
// 获取设备信息
async getInstrumentInfo(id) {
getInstrumentInfo = async (id) => {
let res = await InstrumentInfo.instructionInfo({
instrumentId: id,
});
if (res.data.code === 200) {
this.setState({ introList: res.data.data });
}
}
};
toNursing() {
// if (this.state.info.iot === 2) {
// this.setState({ isNursing: true }, () => {
// this.toHomePage();
// });
// } else {
// go("/pages/clock_in2/clock_in2?iid=" + this.state.info.id);
// }
}
/** 跳转至打卡页或护理页 */
toNursing = () => {
const { instrument } = this.state;
console.log("instrument", instrument);
toHomePage() {
// const { isNursing, info } = this.state;
// if (isNursing) {
// setStorageSync("introduceId", info.id);
// }
if (instrument.type === 1) {
go("/pages/instrumentClickinUpload/index");
} else {
go("/pages/iotCarePlan/iotCarePlan");
}
};
toHomePage = () => {
const url = "/pages/index/index";
Taro.switchTab({
url,
});
}
};
customBack = () => {
let customBack = this.$instance.router?.params?.customBack;

@ -216,7 +216,8 @@ page {
.block1_1 {
height: 100%;
flex-direction: column;
width: 134rpx;
// width: 134rpx;
min-width: 80rpx;
.icon {
width: 30rpx;
height: 30rpx;

@ -82,10 +82,9 @@ export default class InstrumentClickInUpload extends Component<any, any> {
componentDidHide() {}
async initData() {
let objStr = getStorageSync("instrument_detail");
if (objStr) {
let instrumentDetail = JSON.parse(objStr);
this.setState({ instrumentDetail });
let obj = getStorageSync("instrument_detail");
if (obj) {
this.setState({ instrumentDetail: obj });
}
setTimeout(() => {
this.firstNurseInfo();
@ -94,19 +93,24 @@ export default class InstrumentClickInUpload extends Component<any, any> {
}, 10);
}
// 打卡介绍
// 首次护理弹窗
firstNurseInfo = async () => {
let { instrumentDetail } = this.state;
let res = await InstrumentInfo.firstNurseInfo({
instrumentId: instrumentDetail.id,
});
if (res.data.code === 200) {
let isTipShow = getStorageSync("first_instrument_" + instrumentDetail.id);
if (!isTipShow) {
// 首次进入页面:自动打开打卡介绍弹窗
this.setState({ nurseInfo: res.data.data, isTipShow: true });
} else {
this.setState({ nurseInfo: res.data.data });
// 仅在有数据的时候执行
if (res.data.length) {
let isTipShow = getStorageSync(
"first_instrument_" + instrumentDetail.id
);
if (!isTipShow) {
// 首次进入页面:自动打开打卡介绍弹窗
this.setState({ nurseInfo: res.data.data, isTipShow: true });
} else {
this.setState({ nurseInfo: res.data.data });
}
}
}
};
@ -265,7 +269,11 @@ export default class InstrumentClickInUpload extends Component<any, any> {
};
onTipShowOpen = async () => {
this.setState({ isTipShow: true });
if (this.state.nurseInfo.length) {
this.setState({ isTipShow: true });
} else {
msg("暂无数据");
}
};
onTipShowClose = async () => {
setStorageSync(
@ -384,10 +392,7 @@ export default class InstrumentClickInUpload extends Component<any, any> {
}}
>
<View className="block1">
<View
className="block1_1 flex aitems "
style="min-width: 80rpx"
>
<View className="block1_1 flex aitems ">
<View className="tip1">{item.modeName}</View>
<View className="tip2">{item.modeDesc}</View>

@ -33,10 +33,9 @@ export default class InstrumentDetail extends Component<any, any> {
componentDidHide() {}
async initData() {
let objStr = getStorageSync("instrument_detail");
if (objStr) {
let info = JSON.parse(objStr);
this.bindingInstrumentInfo(info.id);
let obj = getStorageSync("instrument_detail");
if (obj) {
this.bindingInstrumentInfo(obj.id);
}
}

@ -87,39 +87,46 @@ export default class InstrumentManage extends Component<any, any> {
}
};
goIntro(item) {
goIntro = (item) => {
console.log("item", item);
setStorageSync("instrument_detail", item);
let bindid = item.id;
go("/pages/introduce/introduce?id=" + bindid);
}
goBind(item) {
go("/pages/instrument/intro?id=" + bindid);
};
goBind = (item) => {
let bindid = item.id;
go("/pages/instrument/instrument?isOnly=true&id=" + bindid); // 只显示当前仪器内容
}
};
goBindInfo(item) {
goBindInfo = (item) => {
// let bindid = item.id;
setStorageSync("instrument_detail", JSON.stringify(item));
setStorageSync("instrument_detail", item);
go("/pages/instrument_detail/index");
}
};
async lesgobuy(item) {
lesgobuy = (item) => {
console.log(item);
// if (item.programs_json) {
// item.programs_json = JSON.parse(item.programs_json);
// // console.log(item.programs_json)
// Taro.navigateToMiniProgram({
// appId: item.programs_json.buylink,
// path: item.programs_json.buypath,
// envVersion: "release",
// success(res) {
// // 打开成功
// },
// fail() {},
// });
// } else {
// msg("暂无购买链接");
// }
}
if (item.isPurchase === 1) {
if (item.programs_json) {
item.programs_json = JSON.parse(item.programs_json);
// console.log(item.programs_json)
Taro.navigateToMiniProgram({
appId: item.programs_json.buylink,
path: item.programs_json.buypath,
envVersion: "release",
success(res) {
// 打开成功
},
fail() {},
});
} else {
msg("暂无购买链接");
}
} else {
msg("暂无购买链接");
}
};
render() {
let { bindList, unBindList, current } = this.state;
@ -146,7 +153,10 @@ export default class InstrumentManage extends Component<any, any> {
return (
<SwiperItem key={index}>
<View className="wrapper" key={"bind_" + index}>
<View className="cover" onClick={this.goIntro}>
<View
className="cover"
onClick={this.goIntro.bind(this, item)}
>
<Image
className="Image"
src={item.banner}
@ -154,7 +164,10 @@ export default class InstrumentManage extends Component<any, any> {
></Image>
<View className="bind_status"></View>
<View className="intro">
<View className="tips" onClick={this.goIntro}>
<View
className="tips"
onClick={this.goIntro.bind(this, item)}
>
</View>
<View className="right">
@ -184,51 +197,57 @@ export default class InstrumentManage extends Component<any, any> {
</View>
</Block>
)}
<View className="title"></View>
<View className="scroll">
<ScrollView scroll-x="true" className="un_bind_list">
{unBindList.map((item, index) => {
if (item.status === 0) {
return (
<View className="wrapper" key={index}>
<View
className="cover"
onClick={this.lesgobuy.bind(this, item)}
>
<Image
className="image"
src={item.banner}
mode="aspectFill"
></Image>
<View className="name">{item.name}</View>
<View
className="buy"
onClick={this.lesgobuy.bind(this, item)}
>
<View className="tips"></View>
<View className="right">
{/* 当且仅当未绑定仪器存在时显示 */}
{unBindList.length > 0 && (
<Block>
<View className="title"></View>
<View className="scroll">
<ScrollView scroll-x="true" className="un_bind_list">
{unBindList.map((item, index) => {
if (item.status === 0) {
return (
<View className="wrapper" key={index}>
<View className="cover">
<Image
src={require("../../img/index/right.png")}
mode="widthFix"
style="height: 20rpx;"
/>
className="image"
src={item.banner}
mode="aspectFill"
></Image>
<View className="name">{item.name}</View>
{item.isPurchase === 1 && (
<View
className="buy"
onClick={this.lesgobuy.bind(this, item)}
>
<View className="tips"></View>
<View className="right">
<Image
src={require("../../img/index/right.png")}
mode="widthFix"
style="height: 20rpx;"
/>
</View>
</View>
)}
</View>
<View className="bind_cont">
<View
className="tobind"
onClick={this.goBind.bind(this, item)}
>
</View>
</View>
</View>
</View>
<View className="bind_cont">
<View
className="tobind"
onClick={this.goBind.bind(this, item)}
>
</View>
</View>
</View>
);
}
})}
</ScrollView>
</View>
);
}
})}
</ScrollView>
</View>
</Block>
)}
</View>
</Block>
);

@ -255,18 +255,16 @@ class IotCarePlan extends Component<any, any> {
}
async initData() {
let objStr = getStorageSync("instrument_detail");
if (objStr) {
let info = JSON.parse(objStr);
let obj = getStorageSync("instrument_detail");
if (obj) {
this.setState({
currentDevice: info,
currentDevice: obj,
});
await this.GetModeList(info.id);
await this.GetModeList(obj.id);
// 如果不存在设备模式值,则判断为首次进入,弹窗提示
let isFirstTipShow = getStorageSync("first_instrument_" + info.id);
let isFirstTipShow = getStorageSync("first_instrument_" + obj.id);
if (!isFirstTipShow) {
this.firstNurseInfo();
}

@ -163,6 +163,7 @@ class Register extends Component<any, any> {
componentDidHide() {}
async initData() {
console.log("MpSplashDetail Register");
const { data } = await MpSplashDetail({
pageNum: 1,
pageSize: 5,

@ -51,7 +51,6 @@ export const Ajax = (params) => {
},
data: params.data,
success(res) {
// console.log("res", res);
if (res.data.code == 401 || res.data.code == 403) {
// 自动重新登录
Taro.removeStorageSync("token");
@ -59,14 +58,6 @@ export const Ajax = (params) => {
return;
}
// if (res.statusCode !== 200) {
// Taro.showModal({
// title: "提示",
// content: String("错误码:" + res.statusCode),
// showCancel: false,
// });
// return false;
// }
if (res.data.code === 500) {
let msg = "系统异常,请联系管理人员";
@ -148,7 +139,7 @@ export const AjaxUploadFile = (params, formData) => {
});
return false;
}
if (o.code !== 200) {
if (o.code !== 200 && o.code !== 204 && o.code !== 205) {
let msg =
typeof o.msg == "string" ? o.msg : "系统异常,请联系管理人员";
Taro.showModal({
@ -217,7 +208,7 @@ export const AjaxFormData = (params) => {
});
return false;
}
if (res.data.code !== 200) {
if (res.data.code !== 200 && o.code !== 204 && o.code !== 205) {
let msg =
typeof res.data.msg == "string"
? res.data.msg

Loading…
Cancel
Save