当前位置: 首页 > news >正文

若依前端APP版使用教程

1 增加页面流程

        新增Page>新增API>新增组件>新增样式>新增路径(page.json)

 {"path": "pages/mes/pro/feedback/index","style": {"navigationBarTitleText": "工单报工"}}
<template><view class="container"><view class="example"><uni-forms ref="form" :model="user" labelWidth="80px"><uni-forms-item label="工单号码" name="workorderCode"><uni-data-select collection="workorderList" field="workorderCode as value, workorderCode as text"   @change="change"></uni-data-select></uni-forms-item>  <uni-forms-item label="用户昵称" name="nickName"><uni-easyinput v-model="user.nickName" placeholder="请输入昵称" /></uni-forms-item><uni-forms-item label="手机号码" name="phonenumber"><uni-easyinput v-model="user.phonenumber" placeholder="请输入手机号码" /></uni-forms-item><uni-forms-item label="邮箱" name="email"><uni-easyinput v-model="user.email" placeholder="请输入邮箱" /></uni-forms-item><uni-forms-item label="性别" name="sex" required><uni-data-checkbox v-model="user.sex" :localdata="sexs" /></uni-forms-item></uni-forms><button type="primary" @click="submit">提交</button></view></view>
</template><script>import { getUserProfile } from "@/api/system/user"import { updateUserProfile } from "@/api/system/user"import  workOrder from "@/api/mes/pro/workorder"import { listWorkorder} from "@/api/mes/pro/workorder";export default {data() {return {user: {nickName: "",phonenumber: "",email: "",sex: ""},sexs: [{text: '男',value: "0"}, {text: '女',value: "1"}],rules: {nickName: {rules: [{required: true,errorMessage: '用户昵称不能为空'}]},phonenumber: {rules: [{required: true,errorMessage: '手机号码不能为空'}, {pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,errorMessage: '请输入正确的手机号码'}]},email: {rules: [{required: true,errorMessage: '邮箱地址不能为空'}, {format: 'email',errorMessage: '请输入正确的邮箱地址'}]}},workorderCode:123456,workorderList: [],// 遮罩层loading: true,// 查询参数queryParams: {workorderCode: null,workorderName: null,workorderType: null,orderSource: null,sourceCode: null,productId: null,productCode: null,productName: null,productSpc: null,unitOfMeasure: null,quantity: null,quantityProduced: null,quantityChanged: null,quantityScheduled: null,clientId: null,clientCode: null,clientName: null,requestDate: null,parentId: null,ancestors: null,status: 'CONFIRMED',}}},created() {console.log("created 开始")this.getListWorkOrder()console.log("created 开始")},onLoad() {this.getUser()},onReady() {this.$refs.form.setRules(this.rules)},methods: {getUser() {getUserProfile().then(response => {this.user = response.data})},submit(ref) {this.$refs.form.validate().then(res => {updateUserProfile(this.user).then(response => {this.$modal.msgSuccess("修改成功")})})},getListWorkOrder(){console.log("查询工单开始")listWorkorder(this.queryParams).then(response => {this.workorderList = response.rows;this.loading = false;console.log(response.rows);	});console.log(this.workorderList);	console.log("查询工单结束");}}}
</script><style lang="scss">page {background-color: #ffffff;}.example {padding: 15px;background-color: #fff;}.segmented-control {margin-bottom: 15px;}.button-group {margin-top: 15px;display: flex;justify-content: space-around;}.form-item {display: flex;align-items: center;flex: 1;}.button {display: flex;align-items: center;height: 35px;line-height: 35px;margin-left: 10px;}
</style>

2 APP中调用企业微信扫一扫功能

        如果公众号,服务号,小程序,引用相应的artifacetId就行了,可参生作者说明文档

2.1  在pom.xml中文件引用包

           <dependency><groupId>com.github.binarywang</groupId><artifactId>weixin-java-cp</artifactId><version>4.5.0</version></dependency>
package com.ktg.web.controller.system;import me.chanjar.weixin.common.bean.WxJsapiSignature;
import me.chanjar.weixin.common.error.WxErrorException;
import me.chanjar.weixin.cp.api.impl.WxCpServiceImpl;
import me.chanjar.weixin.cp.config.impl.WxCpDefaultConfigImpl;
import org.springframework.stereotype.Service;@Service
public class QywxService {//获取对应应用的签名public WxJsapiSignature getJsapiSignture(String url) throws WxErrorException, WxErrorException {// 替换成自己应用的appId和secret,agentIdInteger agentId = 1111111;String corpId="XXXXXXXX";String corpSecret = "XXXXXXXX";WxCpDefaultConfigImpl config = new WxCpDefaultConfigImpl();config.setCorpId(corpId);      // 设置微信企业号的appidconfig.setCorpSecret(corpSecret);  // 设置微信企业号的app corpSecretconfig.setAgentId(agentId);     // 设置微信企业号应用IDWxCpServiceImpl wxCpService = new WxCpServiceImpl();wxCpService.setWxCpConfigStorage(config);System.out.println("WxJsapiSignature===url==="+url);WxJsapiSignature wxJsapiSignature = wxCpService.createJsapiSignature(url);//wxJsapiSignature中可以直接获取签名信息 且方法内部添加了缓存功能return wxJsapiSignature;}}
package com.ktg.web.controller.system;import me.chanjar.weixin.common.bean.WxJsapiSignature;
import me.chanjar.weixin.common.error.WxErrorException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;@RestController
public class QywxController {@Autowiredprivate QywxService qywxService;@GetMapping(value = "/system/qywx/signature/")public WxJsapiSignature getJsapiSignature(@RequestParam("url") String url) {try {  // 直接调用wxMpServer 接口System.out.println("访问WxJsapiSignature=====/system/qywx/signature/" + url + "");WxJsapiSignature wxJsapiSignature = qywxService.getJsapiSignture(url);System.out.println("AppId===" + wxJsapiSignature.getAppId());System.out.println("Timestamp===" + wxJsapiSignature.getTimestamp());System.out.println("NonceStr===" + wxJsapiSignature.getNonceStr());System.out.println("Signature===" + wxJsapiSignature.getSignature());return wxJsapiSignature;} catch (WxErrorException e) {return null;}}}

http://www.lryc.cn/news/254392.html

相关文章:

  • 2023 年工程师不可错过的 AI 主要发展趋势
  • 记录 | 安装地平线工具链install_ai_toolchain.sh出现cython版本问题报错解决
  • Java8流操作
  • vue-socket.io以及原生websocket的使用
  • 谷歌推出功能最强大的大语言模型Gemini;大规模语言模型:从理论到实践
  • Android studio 工程的 module 依赖关系图绘制 、 Android Module 依赖关系的可视化实现
  • Qt之QGraphicsView —— 笔记1.2:将QGraphicsView放置主窗口上,绘制简单图元(附完整源码)
  • linux的权限管理
  • 什么是 performance_schema ?
  • 软件多开助手的创新使用:在同一设备上玩转多个游戏
  • [linux] 输出文本文件的最后一列并去重
  • 新能源车交直流充电解释
  • Failed to connect to gitee.com port 443: Time out 连接超时提示【Bug已完美解决-鸿蒙开发】
  • 【开源】基于Vue+SpringBoot的智慧家政系统
  • javaee实验:文件上传及拦截器的使用
  • 二分查找19(Leetcode540有序数组中的单一元素)-1
  • 字节开源的netPoll底层LinkBuffer设计与实现
  • 《点云进阶》专栏文章目录
  • 二分查找算法-查找最接近的元素Python实现(题目来源dotcpp: 2926)
  • debian11,debian 如何删除虚拟内存,交换分区
  • 智能优化算法应用:基于人工大猩猩部队算法无线传感器网络(WSN)覆盖优化 - 附代码
  • 鼎捷受邀出席“中国制造业产品创新数字化国际峰会”,共话工业软件创新发展
  • 大话数据结构-查找-多路查找树
  • unity 2d 入门 飞翔小鸟 飞翔脚本(五)
  • Linux系统调试课:I2C tools调试工具
  • uniapp中解决swiper高度自适应内容高度
  • Contrast and Generation Make BART a Good Dialogue Emotion Recognizer
  • 图的深度优先搜索(数据结构实训)
  • VUEX使用总结
  • 指定分隔符对字符串进行分割 numpy.char.split()