From ee0d49d38ab716c4b79c48d8dd1728d39a78da3e Mon Sep 17 00:00:00 2001 From: blak-kong <546598185@qq.com> Date: Mon, 15 Jan 2024 11:43:51 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84readme?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 40 +++++++++++---- src/pages/instrument/instrument.config.js | 2 +- src/pages/instrument/instrument.tsx | 19 ------- src/pages/integral_list/integral_list.tsx | 61 ++++++++++++++++------- src/store/features/globalStore.js | 7 --- src/utils/Interface.js | 2 +- 6 files changed, 76 insertions(+), 55 deletions(-) diff --git a/README.md b/README.md index a6e47eb..bd204da 100644 --- a/README.md +++ b/README.md @@ -1,25 +1,48 @@ # flossomWechat #### 介绍 + {**以下是 Gitee 平台说明,您可以替换此简介** Gitee 是 OSCHINA 推出的基于 Git 的代码托管平台(同时支持 SVN)。专为开发者提供稳定、高效、安全的云端软件开发协作平台 无论是个人、团队、或是企业,都能够用 Gitee 实现代码托管、项目管理、协作开发。企业项目请看 [https://gitee.com/enterprises](https://gitee.com/enterprises)} #### 软件架构 -软件架构说明 +软件架构说明 #### 安装教程 -1. xxxx -2. xxxx -3. xxxx +1. 电脑需要安装 node,16.18.0 以上版本 + +2. 下载项目依赖 + +```javascript +npm i -f // 强制下载安装依赖 +``` + +3. 启动与打包命令 + +```javascript +npm run dev:weapp // 启动命令 +npm run build:weapp // 打包命令 +``` + +4. 使用微信开发者工具预览 + +开发者工具下载地址 +https://servicewechat.com/wxa-dev-logic/download_redirect?type=win32_x64&from=mpwiki&download_version=1062401020&version_type=1 + +安装开发者工具后需要扫码登录工具,然后点击目录,导入项目打包生成的 dist 文件夹 + +APPID 的下拉填写,需要登录用户拥有本项目的开发者权限,用于选中本项目的 APPID。如果没有权限,则无法选择下拉框,需要联系本项目管理员添加权限。 + +APPID 填写后,点击确定即可预览项目。 + +如果项目运行后无法连接网络,则需要 点击开发者工具右上角的详情, 勾选 不校验域名 #### 使用说明 -1. xxxx -2. xxxx -3. xxxx +1. 如何设置全局接口地址:打开 flowsomwechat\src\store\features\globalStore.js,修改 domain 即可 #### 参与贡献 @@ -28,10 +51,9 @@ Gitee 是 OSCHINA 推出的基于 Git 的代码托管平台(同时支持 SVN 3. 提交代码 4. 新建 Pull Request - #### 特技 -1. 使用 Readme\_XXX.md 来支持不同的语言,例如 Readme\_en.md, Readme\_zh.md +1. 使用 Readme_XXX.md 来支持不同的语言,例如 Readme_en.md, Readme_zh.md 2. Gitee 官方博客 [blog.gitee.com](https://blog.gitee.com) 3. 你可以 [https://gitee.com/explore](https://gitee.com/explore) 这个地址来了解 Gitee 上的优秀开源项目 4. [GVP](https://gitee.com/gvp) 全称是 Gitee 最有价值开源项目,是综合评定出的优秀开源项目 diff --git a/src/pages/instrument/instrument.config.js b/src/pages/instrument/instrument.config.js index 04e6a32..62d26c9 100644 --- a/src/pages/instrument/instrument.config.js +++ b/src/pages/instrument/instrument.config.js @@ -1,3 +1,3 @@ export default definePageConfig({ - navigationBarTitleText: "模板页", + navigationBarTitleText: "仪器绑定", }); diff --git a/src/pages/instrument/instrument.tsx b/src/pages/instrument/instrument.tsx index 7843313..3ee62d4 100644 --- a/src/pages/instrument/instrument.tsx +++ b/src/pages/instrument/instrument.tsx @@ -32,7 +32,6 @@ const log = require("../../utils/log"); import Navbar from "../../components/navbar/navbar"; -// import "taro-ui/dist/style/components/button.scss"; // 按需引入 import "./instrument.less"; export default class Instrument extends Component { @@ -437,24 +436,6 @@ export default class Instrument extends Component { )} - - - 选择购买渠道 - - - - - - )} diff --git a/src/pages/integral_list/integral_list.tsx b/src/pages/integral_list/integral_list.tsx index e72dc38..a96133f 100644 --- a/src/pages/integral_list/integral_list.tsx +++ b/src/pages/integral_list/integral_list.tsx @@ -12,9 +12,8 @@ import { userRefresh } from "../../store/features/userInfo"; /** 自定义组件 **/ import Navbar from "../../components/navbar/navbar"; -/** 自定义组件 **/ - import PopupAlert from "../../components/popup/popup-alert"; +/** 自定义组件 **/ import { GetOtherSetting, @@ -25,6 +24,8 @@ import { GetCloseOfficialAccount, } from "../../utils/Interface"; +import { msg } from "../../utils/traoAPI"; + class IntegralList extends Component { constructor(props) { super(props); @@ -58,8 +59,6 @@ class IntegralList extends Component { async initData() { this.GetObtainUserIntegral(); - // this.checkOfficialAccount(); - this.GetOfficialAccount(); this.GetIsAttentionOfficialAccount(); } @@ -111,27 +110,52 @@ class IntegralList extends Component { let targetTime = dayjs().month(9).day(30).valueOf(); // 仅9月30日前触发:提醒过期弹窗 if (currentTime <= targetTime) { - let isOfficialAccount = Taro.getStorageSync("isOfficialAccount"); - if (isOfficialAccount) { - let oldYear = isOfficialAccount; - let currentYear = dayjs().format("YYYY"); - if (currentYear < oldYear) { - // 检查:今年未提醒,则弹窗 - this.setState({ isOfficialAccount: true }); - } - } else { - this.setState({ isOfficialAccount: true }); - } + // 检查:今年未提醒,则弹窗 + this.setState({ isOfficialAccount: true }); + // let isOfficialAccount = Taro.getStorageSync("isOfficialAccount"); + // if (isOfficialAccount) { + // let oldYear = isOfficialAccount; + // let currentYear = dayjs().format("YYYY"); + // if (currentYear < oldYear) { + // // 检查:今年未提醒,则弹窗 + // this.setState({ isOfficialAccount: true }); + // } + // } else { + // this.setState({ isOfficialAccount: true }); + // } } } + // 用户是否已关闭提醒 GetOfficialAccount = async () => { let res = await GetOfficialAccount(); - console.log("GetOfficialAccount", res); + if (res.data.code === 200) { + if (!res.data.data) { + // 如果false则是未关闭提醒 + this.checkOfficialAccount(); // 检测时间,弹窗提示关注公众号 + } + } }; + // 用户是否关注公众号 GetIsAttentionOfficialAccount = async () => { let res = await GetIsAttentionOfficialAccount(); console.log("GetIsAttentionOfficialAccount", res); + if (res.data.code === 200) { + if (!res.data.data) { + // 如果false则是没关注 + this.GetOfficialAccount(); + } + } + }; + + // 用户关闭提醒 + GetCloseOfficialAccount = async () => { + let { data } = await GetCloseOfficialAccount(); + if (data.code === 200) { + msg("已关闭提醒"); + } else { + msg("操作失败"); + } }; GetObtainUserIntegral = async () => { @@ -167,8 +191,9 @@ class IntegralList extends Component { /** 关注公众号弹窗 */ officialPopupConfirm = () => { - let currentYear = dayjs().format("YYYY"); - Taro.setStorageSync("isOfficialAccount", currentYear); // 标记:本年度已提醒 + // let currentYear = dayjs().format("YYYY"); + // Taro.setStorageSync("isOfficialAccount", currentYear); // 标记:本年度已提醒 + this.GetCloseOfficialAccount(); this.officialPopupClose(); }; officialPopupClose = () => { diff --git a/src/store/features/globalStore.js b/src/store/features/globalStore.js index 420b273..203786a 100644 --- a/src/store/features/globalStore.js +++ b/src/store/features/globalStore.js @@ -7,18 +7,11 @@ const globalStoreReducer = createSlice({ initialState: { domain: "http://110.41.134.131:8080", // 请求地址 // domain: "http://192.168.10.147:8080", // 请求地址 - token: "", - // 是否首次进入首页 isShowIndexFlag: false, }, reducers: { - setToken(state, { payload }) { - // Taro.setStorageSync.setItem("token", payload); - state.token = payload; - }, setIndexFlag(state, { payload }) { - // Taro.setStorageSync.setItem("token", payload); state.isShowIndexFlag = payload; }, }, diff --git a/src/utils/Interface.js b/src/utils/Interface.js index 09f1f0a..e38a5b6 100644 --- a/src/utils/Interface.js +++ b/src/utils/Interface.js @@ -171,7 +171,7 @@ export const GetOfficialAccount = (data) => { }); }; export const GetCloseOfficialAccount = (data) => { - // 查询用户是否关闭提醒关注公众号 + // 查询关闭提醒关注公众号 return Ajax({ url: "/hzwx/noRemind/closeOfficialAccount", data,