index.vue 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533
  1. <template>
  2. <view class="border-box">
  3. <view class="content">
  4. <!-- <view style="width:100%;height: 20px;"></view> -->
  5. <view class="top-box">
  6. <view class="back-box x-f">
  7. <image src="/static/image/device/back_icon32.png"></image>
  8. <view @click="goBack()">返回</view>
  9. </view>
  10. <view class="title">
  11. 体质辨识
  12. </view>
  13. <view class="select" @click="onOpenList">
  14. <view class="date x-bc">
  15. <image src="/static/image/device/user_icon32.png"></image>
  16. <text class="text">
  17. {{selectUser!==null?selectUser.nickName:'选择用户'}}
  18. </text>
  19. <image src="/static/image/device/arrow_icon16.png"></image>
  20. </view>
  21. </view>
  22. </view>
  23. <view class="list">
  24. <view class="tab-box">
  25. <view class="tabs">
  26. <view class="item" @click="navTo('/pages/device/tongue/index')">
  27. <image src="/static/image/device/tongue_icon68.png"></image>
  28. <view class="title">舌面诊</view>
  29. </view>
  30. <view class="item active">
  31. <image src="/static/image/device/pulse_diagnosis_on_icon68.png"></image>
  32. <view class="title">脉诊</view>
  33. </view>
  34. </view>
  35. <view class="test-box">
  36. <!-- <view class="note">请选择手腕,再点击开始测量</view> -->
  37. <view class="note2">蓝牙版</view>
  38. <view class="img-box">
  39. <image class="bg-box" src="/static/image/device/pulse_diagnosis_img.png"></image>
  40. <!-- <view class="left">
  41. <view class="bg">
  42. <image src="/static/image/device/left_hand_img.png"></image>
  43. </view>
  44. <view class="btn">
  45. <view class="checkbox-icon">
  46. <image src="/static/image/device/radio_default_icon16.png" v-show="!left">
  47. </image>
  48. <image src="/static/image/device/radio_choose_icon16.png" v-show="left"></image>
  49. </view>
  50. <text>左手</text>
  51. </view>
  52. </view> -->
  53. <!-- <view class="right">
  54. <view class="bg">
  55. <image src="/static/image/device/right_hand_img.png"></image>
  56. </view>
  57. <view class="btn">
  58. <view class="checkbox-icon">
  59. <image src="/static/image/device/radio_default_icon16.png" v-show="!right">
  60. </image>
  61. <image src="/static/image/device/radio_choose_icon16.png" v-show="right">
  62. </image>
  63. </view>
  64. <text>右手</text>
  65. </view>
  66. </view> -->
  67. </view>
  68. <view class="btn-box" @click="toConnect">
  69. 去测脉
  70. </view>
  71. </view>
  72. </view>
  73. </view>
  74. <!-- <u-popup :show="isConnect" @close="close" mode="center" :round="10">
  75. <view style="width: 400px;height: 200px;display: flex;align-items: center;justify-content: center;">
  76. <u-loading-icon color="#8F6726"></u-loading-icon>
  77. <view style="color: #8F6726;font-size:32px;margin-left: 10px;">设备连接中</view>
  78. </view>
  79. </u-popup> -->
  80. <!-- <u-popup :show="left" @close="closeLeft" mode="center" :round="10">
  81. <view style="width: 400px;height: 200px;display: flex;align-items: center;justify-content: center;">
  82. <u-loading-icon color="#8F6726"></u-loading-icon>
  83. <view style="color: #8F6726;font-size:32px;margin-left: 10px;">左手测量中</view>
  84. </view>
  85. </u-popup>
  86. <u-popup :show="right" @close="closeRight" mode="center" :round="10">
  87. <view style="width: 400px;height: 200px;display: flex;align-items: center;justify-content: center;">
  88. <u-loading-icon color="#8F6726"></u-loading-icon>
  89. <view style="color: #8F6726;font-size:32px;margin-left: 10px;">右手测量中</view>
  90. </view>
  91. </u-popup> -->
  92. <view v-if="isResult" class="mask">
  93. <view class="popup-container2">
  94. <view class="title-t">测量完成</view>
  95. <view class="title-r">点击确认查看检测报告</view>
  96. <!-- <image style="width: 200px;height: 200px;margin-bottom: 20px;" :src="qUrl"></image> -->
  97. <view class="btn-r" @click="closeP">确认</view>
  98. </view>
  99. </view>
  100. <view v-if="showList" class="mask">
  101. <!-- 弹窗内容 -->
  102. <view class="popup-container">
  103. <!-- 弹窗头部 -->
  104. <view class="popup-header">
  105. <text class="popup-title">选择用户</text>
  106. <view class="close-btn" @click="onCloseList">
  107. <image src="/static/image/device/close_icon32.png"></image>
  108. </view>
  109. </view>
  110. <!-- 弹窗主体内容 -->
  111. <view class="popup-content">
  112. <view class="search-cont">
  113. <input type="text" v-model="keyword" class="form-input" placeholder="请输入用户姓名或者手机号"
  114. placeholder-class="text-input" />
  115. <view class="search-btn" @click="doSearch">
  116. <image src="/static/image/device/search_icon24.png"></image>
  117. <text>搜索</text>
  118. </view>
  119. </view>
  120. <view class="userList-box">
  121. <view class="userList" v-if="dataList.length>0">
  122. <view class="item" v-for="(item,index) in dataList" :key="index">
  123. <view class="title">{{item.nickName||''}}-{{item.phone||''}}</view>
  124. <view class="right-box">
  125. <view class="rest" @click="onOpenDetail(item)">
  126. 查看
  127. </view>
  128. <view class="rest" @click="editDetail(item)">
  129. 编辑
  130. </view>
  131. <view :class="item.userId==aIndex?'select active':'select'"
  132. @click="select(item)">
  133. 选择
  134. </view>
  135. </view>
  136. </view>
  137. </view>
  138. </view>
  139. <view v-if="dataList.length==0" class="isNull">暂无数据</view>
  140. </view>
  141. <!-- 弹窗底部按钮 -->
  142. <view class="popup-footer">
  143. <view class="btn2 confirm-btn" @click="onOpen">
  144. <image src="/static/image/device/add_icon32.png"></image>
  145. <text>新建用户</text>
  146. </view>
  147. </view>
  148. </view>
  149. </view>
  150. <user-card :show="show" :initial-form="initData" @close="onClose" @confirm="onConfirm" @update="onEdit"></user-card>
  151. <view v-if="showDetail" class="mask">
  152. <!-- 弹窗内容 -->
  153. <view class="popup-container">
  154. <!-- 弹窗头部 -->
  155. <view class="popup-header">
  156. <view class="goback" @click="onOpenList">返回</view>
  157. <text class="popup-title">选择用户</text>
  158. <view class="close-btn" @click="onCloseDetail">
  159. <image src="/static/image/device/close_icon32.png"></image>
  160. </view>
  161. </view>
  162. <!-- 弹窗主体内容 -->
  163. <view class="popup-content">
  164. <view class="userDetail">
  165. <view class="item">
  166. <view class="label">姓名:</view>
  167. <text>{{detail.username||'-'}}</text>
  168. </view>
  169. <view class="item">
  170. <view class="label">性别:</view>
  171. <text>{{detail.sex==1?"男":"女"}}</text>
  172. </view>
  173. <view class="item">
  174. <view class="label">年龄:</view>
  175. <text>{{detail.age||'-'}}岁</text>
  176. </view>
  177. <view class="item">
  178. <view class="label">身高:</view>
  179. <text>{{detail.height||'-'}}cm</text>
  180. </view>
  181. <view class="item">
  182. <view class="label">体重:</view>
  183. <text>{{detail.weight||'-'}}kg</text>
  184. </view>
  185. <view class="item">
  186. <view class="label">手机号:</view>
  187. <text>{{detail.phone||'-'}}</text>
  188. </view>
  189. <view class="item">
  190. <view class="label">既往病史:</view>
  191. <text>{{detail.previousMedicalHistory||'-'}}</text>
  192. </view>
  193. <view class="item">
  194. <view class="label">过敏史:</view>
  195. <text>{{detail.historyOfAllergies||'-'}}</text>
  196. </view>
  197. <view v-if="detail.habitList.length>0" class="item" v-for="item in detail.habitList"
  198. :key="item.optionId">
  199. <view class="label">{{item.typeName ||'-'}}:</view>
  200. <text>{{item.optionName||'-'}}</text>
  201. </view>
  202. </view>
  203. </view>
  204. <!-- 弹窗底部按钮 -->
  205. <view class="popup-footer">
  206. <view class="btn2 confirm-btn" @click="selectBtn(detail)">
  207. <text>选择该用户</text>
  208. </view>
  209. </view>
  210. </view>
  211. </view>
  212. </view>
  213. </view>
  214. </template>
  215. <script>
  216. import MescrollMixin from "@/uni_modules/mescroll-uni/components/mescroll-uni/mescroll-mixins.js";
  217. import {
  218. selectUsernameOrPhoneOrTime,
  219. addUser,
  220. selectQueryFsUser,
  221. editUser
  222. } from '@/api/user.js'
  223. import {
  224. addPulse
  225. } from '@/api/healthTongue.js'
  226. import {
  227. getDictByKey
  228. } from '@/api/common.js'
  229. import {
  230. tr
  231. } from "date-fns/locale";
  232. import userCard from "@/components/userCard.vue"
  233. export default {
  234. components: {
  235. userCard
  236. },
  237. mixins: [MescrollMixin], // 使用mixin
  238. data() {
  239. return {
  240. isResult: false,
  241. selectedDate: "",
  242. selectUser: null,
  243. show: false,
  244. showList: false,
  245. showDetail: false,
  246. total: 0,
  247. aIndex: '',
  248. createTimes: null,
  249. keyword: '',
  250. type: 0,
  251. left: false,
  252. right: false,
  253. isConnect: false,
  254. dataList: [],
  255. detail: {},
  256. status: 'loading',
  257. loadingText: '设备连接中',
  258. form: {
  259. sex: 0
  260. },
  261. info: null,
  262. // 插件实例
  263. tyPulse: null,
  264. // 状态
  265. initStatus: false,
  266. deviceConnected: false,
  267. measuring: false,
  268. // 设备信息
  269. deviceInfo: null,
  270. // 测量相关
  271. measureProgress: 0,
  272. currentStage: '待机',
  273. lastResult: null,
  274. appId: "nehijR6y",
  275. appSecret: "f740435d1b84b9944a52f064dd1ecf6e8a76f546",
  276. uid: "userid000067",
  277. qUrl: '',
  278. initData:{}
  279. }
  280. },
  281. onLoad(options) {
  282. this.userId = options.userId
  283. this.selectUser = uni.getStorageSync('selectUser') || null;
  284. // this.selectUsernameOrPhoneOrTime()
  285. this.initPlugin()
  286. // var info=uni.getSystemInfoSync()
  287. // console.log('info',info)
  288. // this.getDictByKey("sys_hospital_level");
  289. },
  290. methods: {
  291. goBack() {
  292. uni.navigateBack({
  293. delta:1
  294. })
  295. },
  296. // 初始化插件
  297. async initPlugin() {
  298. try {
  299. // this.addLog('开始初始化插件...');
  300. // 获取插件实例
  301. this.tyPulse = uni.requireNativePlugin('TyPulseManager');
  302. if (!this.tyPulse) {
  303. throw new Error('无法获取插件实例');
  304. }
  305. // 初始化
  306. await new Promise((resolve, reject) => {
  307. this.tyPulse.initSDK(this.appId, this.appSecret, this.uid, (
  308. result) => {
  309. if (result.success) {
  310. resolve();
  311. } else {
  312. reject(new Error(result.error));
  313. }
  314. });
  315. });
  316. this.initStatus = true;
  317. console.log('插件初始化成功');
  318. // uni.showToast({
  319. // title: '初始化成功',
  320. // icon: 'success'
  321. // });
  322. } catch (error) {
  323. console.log(`初始化失败: ${error.message}`);
  324. uni.showToast({
  325. title: '初始化失败',
  326. icon: 'error'
  327. });
  328. }
  329. },
  330. toMeasure() {
  331. try {
  332. // 设置自动屏幕方向
  333. this.tyPulse.toMeasure((result) => {
  334. if (result.success) {
  335. if (result.cmdType == "pulseResult") {
  336. this.info = result;
  337. console.log('脉诊回调结果:', result);
  338. this.addPulse()
  339. }
  340. if (result.cmdType == "deviceConnect") {
  341. //获取设备信息
  342. this.getDeviceInfo();
  343. }
  344. }
  345. });
  346. } catch (error) {
  347. console.log(`测脉失败: ${error.message}`);
  348. }
  349. },
  350. // 获取设备信息
  351. getDeviceInfo() {
  352. try {
  353. this.tyPulse.getDeviceInfo((result) => {
  354. if (result.success && result.data) {
  355. this.deviceInfo = result.data;
  356. this.deviceConnected = result.data.isConnected;
  357. //console.log('设备信息获取成功:' + JSON.stringify(result.data));
  358. }
  359. });
  360. } catch (error) {
  361. console.log(`获取设备信息失败: ${error.message}`);
  362. }
  363. },
  364. doSearch() {
  365. console.log(this.keyword, '---')
  366. // if(this.keyword!==''){
  367. this.selectUsernameOrPhoneOrTime()
  368. // }
  369. },
  370. // 选择
  371. handleLeft() {
  372. this.left = !this.left
  373. this.right = !this.left
  374. },
  375. // 选择
  376. handleRight() {
  377. this.right = !this.right
  378. this.left = !this.right
  379. },
  380. toConnect() {
  381. if (this.$isEmpty(this.selectUser)) {
  382. uni.showToast({
  383. title: '请先选择就诊人',
  384. icon: 'none'
  385. });
  386. return;
  387. }
  388. this.isConnect = true
  389. this.toMeasure()
  390. },
  391. addPulse() {
  392. if (this.$isEmpty(this.info)) {
  393. uni.showToast({
  394. title: '测量失败,请重试',
  395. icon: 'none'
  396. });
  397. return;
  398. }
  399. const data = {
  400. userId: this.selectUser.userId,
  401. sex: this.selectUser.sex,
  402. name: this.selectUser.nickName,
  403. pulseEquipmentResult: {
  404. reportData: JSON.parse(this.info.reportData),
  405. success: this.info.success,
  406. measureId: this.info.measureId,
  407. pulseUrl: JSON.parse(this.info.pr)
  408. }
  409. }
  410. console.log("qxj addPulse data",data);
  411. uni.showLoading({
  412. title: "处理中...",
  413. mask: true
  414. })
  415. addPulse(data).then(res => {
  416. console.log('zaizz', data, res)
  417. if (res.code == 200) {
  418. uni.hideLoading();
  419. // this.qUrl = res.codeImage
  420. this.isConnect = false
  421. this.isResult = true
  422. } else {
  423. uni.hideLoading();
  424. this.isConnect = false
  425. this.errMsg = res.msg;
  426. uni.showToast({
  427. icon: 'none',
  428. title: res.msg,
  429. });
  430. }
  431. },
  432. rej => {}
  433. );
  434. },
  435. close() {
  436. this.isConnect = false
  437. },
  438. closeLeft() {
  439. this.left = false
  440. },
  441. closeRight() {
  442. this.right = false
  443. },
  444. select(item) {
  445. this.aIndex = item.userId
  446. this.selectUser = item
  447. uni.setStorageSync("selectUser", item)
  448. this.showList = false
  449. },
  450. selectBtn(item) {
  451. if(item.id==null){
  452. uni.showToast({
  453. title: '请先完善用户基本信息',
  454. icon: 'none'
  455. });
  456. return;
  457. }
  458. this.selectUser = this.dataList.find(it => it.userId === item.fsUserId);
  459. uni.setStorageSync("selectUser", this.selectUser)
  460. this.show = false
  461. this.showList = false
  462. this.showDetail = false
  463. },
  464. createTimesChange(e) {
  465. this.selectedDate = e.detail.value; // 例如:"2025-09-17"
  466. this.form.birthday = this.selectedDate.replace(/-/g, ""); // 去除 "-"
  467. },
  468. genderChange(type) {
  469. this.form.sex = type
  470. },
  471. onOpen() {
  472. this.show = true
  473. this.showList = false
  474. },
  475. onOpenList() {
  476. this.selectUsernameOrPhoneOrTime()
  477. this.showList = true
  478. this.showDetail = false
  479. },
  480. onOpenDetail(item) {
  481. this.showDetail = true
  482. this.showList = false
  483. this.detail={}
  484. this.selectQueryFsUser(item.userId)
  485. },
  486. editDetail(item){
  487. this.show = true
  488. this.showList = false
  489. this.selectQueryFsUser(item.userId,'edit')
  490. },
  491. // 关闭弹窗
  492. onClose() {
  493. this.show = false
  494. },
  495. onCloseList() {
  496. this.showList = false
  497. this.keyword=''
  498. },
  499. onCloseDetail() {
  500. this.showDetail = false
  501. },
  502. closeP() {
  503. this.isResult = false
  504. uni.navigateTo({
  505. url: "/pages/user/healthReport?userId="+this.selectUser.userId
  506. })
  507. },
  508. // 点击确认按钮
  509. onConfirm(data) {
  510. // var data=this.form
  511. //var data = this.form
  512. uni.showLoading({
  513. title: "处理中...",
  514. mask: true
  515. })
  516. addUser(data).then(res => {
  517. if (res.code == 200) {
  518. setTimeout(() => {
  519. uni.showToast({
  520. icon: 'success',
  521. title: "创建成功",
  522. });
  523. }, 200)
  524. uni.hideLoading();
  525. this.show = false
  526. this.showList = true
  527. this.form = {
  528. sex: 1
  529. }
  530. this.selectUsernameOrPhoneOrTime()
  531. } else {
  532. uni.showToast({
  533. title: res.msg,
  534. icon: 'none'
  535. });
  536. }
  537. },
  538. rej => {}
  539. );
  540. },
  541. // 点击确认按钮
  542. onEdit(data) {
  543. // var data=this.form
  544. //var data = this.form
  545. uni.showLoading({
  546. title: "处理中...",
  547. mask: true
  548. })
  549. data.userId=this.initData.userId
  550. data.fsUserId=this.initData.userId
  551. editUser(data).then(res => {
  552. if (res.code == 200) {
  553. setTimeout(() => {
  554. uni.showToast({
  555. icon: 'success',
  556. title: "修改成功",
  557. });
  558. }, 200)
  559. uni.hideLoading();
  560. this.show = false
  561. this.showList = true
  562. this.form = {
  563. sex: 1
  564. }
  565. this.selectUsernameOrPhoneOrTime()
  566. } else {
  567. uni.showToast({
  568. title: res.msg,
  569. icon: 'none'
  570. });
  571. }
  572. },
  573. rej => {}
  574. );
  575. },
  576. selectUsernameOrPhoneOrTime() {
  577. var data = {
  578. nickName: this.keyword,
  579. phone: this.keyword
  580. }
  581. uni.showLoading({
  582. title: "加载中..."
  583. })
  584. // var user=uni.getStorageSync('userInfo');
  585. selectUsernameOrPhoneOrTime(data).then(res => {
  586. if (res.code == 200) {
  587. uni.hideLoading();
  588. this.dataList = res.data
  589. this.total = res.data.total || 0
  590. } else {
  591. uni.hideLoading();
  592. uni.showToast({
  593. title: res.msg,
  594. icon: 'none'
  595. });
  596. }
  597. },
  598. rej => {}
  599. );
  600. },
  601. selectQueryFsUser(id,val) {
  602. selectQueryFsUser({
  603. userId: id
  604. }).then(res => {
  605. if (res.code == 200) {
  606. this.detail = res.data
  607. if(val=='edit'){
  608. this.initData=res.data
  609. this.initData.userId=id
  610. }
  611. } else {
  612. uni.showToast({
  613. title: res.msg,
  614. icon: 'none'
  615. });
  616. }
  617. },
  618. rej => {}
  619. );
  620. },
  621. getDictByKey(key) {
  622. var data = {
  623. key: key
  624. }
  625. getDictByKey(data).then(
  626. res => {
  627. if (res.code == 200) {
  628. if (key == "sys_hospital_level") {
  629. this.hosLevelOptions = res.data;
  630. }
  631. }
  632. },
  633. err => {}
  634. );
  635. },
  636. navTo(url) {
  637. uni.redirectTo({
  638. url: url + '?userId=' + this.userId
  639. })
  640. },
  641. // 手机号校验函数
  642. checkPhone(val) {
  643. const phone = val?.trim(); // 去除首尾空格
  644. // 1. 非空校验
  645. if (!phone) {
  646. uni.showToast({
  647. title: "手机号不能为空",
  648. icon: "none"
  649. });
  650. return "请输入正确的手机号";
  651. }
  652. // 2. 格式校验(中国大陆手机号规则:11位数字,以1开头)
  653. const phoneReg = /^1[3-9]\d{9}$/; // 正则表达式
  654. if (!phoneReg.test(phone)) {
  655. uni.showToast({
  656. title: "请输入正确的手机号",
  657. icon: "none"
  658. });
  659. return "请输入正确的手机号";
  660. }
  661. // 校验通过
  662. return '';
  663. }
  664. }
  665. }
  666. </script>
  667. <style lang="scss">
  668. page {
  669. height: 100%;
  670. background: #f6f6f6;
  671. }
  672. </style>
  673. <style scoped lang="scss">
  674. .border-box {
  675. width: 100vw;
  676. height: 100vh;
  677. background-image: url(/static/image/device/ipad_yjf_boder.png);
  678. background-repeat: no-repeat;
  679. position: relative;
  680. background-size: 100% 100%;
  681. box-sizing: border-box;
  682. padding: 12px;
  683. }
  684. .content {
  685. // height: 100%;
  686. width: 100%;
  687. height: 100%;
  688. background-image: url(/static/image/device/inner_page_bg.png);
  689. background-repeat: no-repeat;
  690. background-size: 100% 100%;
  691. position: relative;
  692. padding: 30px;
  693. .top-box {
  694. width: 100%;
  695. display: flex;
  696. align-items: center;
  697. justify-content: space-between;
  698. margin-bottom: 30px;
  699. .title {
  700. font-family: Source Han Serif CN, Source Han Serif CN;
  701. font-weight: bold;
  702. font-size: 30px;
  703. color: #8F6726;
  704. text-align: center;
  705. }
  706. .back-box {
  707. width: 102px;
  708. height: 47px;
  709. background: #FFFFFF;
  710. border-radius: 6px 6px 6px 6px;
  711. border: 1px solid #8F6726;
  712. // padding: 12px 8px;
  713. justify-content: center;
  714. view {
  715. font-family: PingFang SC, PingFang SC;
  716. font-weight: 400;
  717. font-size: 18px;
  718. color: #8F6726;
  719. text-align: center;
  720. margin-left: 10px;
  721. }
  722. // position: absolute;
  723. // left: 30px;
  724. image {
  725. width: 24px;
  726. height: 24px;
  727. }
  728. }
  729. .select {
  730. min-width: 160px;
  731. height: 47px;
  732. background: #FFFFFF;
  733. border-radius: 6px 6px 6px 6px;
  734. border: 1px solid #8F6726;
  735. padding: 12px;
  736. display: flex;
  737. align-items: center;
  738. justify-content: center;
  739. image {
  740. width: 24px;
  741. height: 24px;
  742. &:last-child {
  743. width: 12px;
  744. height: 12px;
  745. }
  746. }
  747. .date {
  748. width: 100%;
  749. display: flex;
  750. align-items: center;
  751. justify-content: space-between;
  752. }
  753. .text {
  754. margin-left: 10px;
  755. margin-right: 10px;
  756. font-family: PingFang SC, PingFang SC;
  757. font-weight: 400;
  758. font-size: 18px;
  759. color: #8F6726;
  760. text-align: center;
  761. }
  762. }
  763. }
  764. .list {
  765. width: 100%;
  766. height: calc(100% - 76px);
  767. display: flex;
  768. align-items: center;
  769. justify-content: center;
  770. }
  771. .tab-box {
  772. width: 100%;
  773. height: 100%;
  774. // margin-top: 40px;
  775. display: flex;
  776. align-items: center;
  777. // justify-content: center;
  778. .tabs {
  779. display: flex;
  780. flex-direction: column;
  781. align-items: center;
  782. justify-content: flex-start;
  783. .item {
  784. // padding:40px;
  785. display: flex;
  786. flex-direction: column;
  787. align-items: center;
  788. justify-content: center;
  789. width: 113px;
  790. height: 163px;
  791. background: #FBF4EE;
  792. border-radius: 18px 0px 0px 18px;
  793. border: 2px solid rgba(143, 103, 38, 0.3);
  794. &:last-child {
  795. margin-top: 30px;
  796. }
  797. image {
  798. width: 50px;
  799. height: 50px;
  800. margin-bottom: 12px;
  801. }
  802. .title {
  803. font-family: PingFang SC, PingFang SC;
  804. font-weight: 600;
  805. font-size: 24px;
  806. color: #8F6726;
  807. text-align: center;
  808. }
  809. &.active {
  810. background: linear-gradient(180deg, #E3B379 0%, #8F6726 100%);
  811. border: 2px solid #8F6726;
  812. .title {
  813. color: #fff;
  814. }
  815. }
  816. }
  817. }
  818. }
  819. .test-box {
  820. flex: 1;
  821. height: 100%;
  822. // width: 1460px;
  823. // height: 862px;
  824. border-radius: 15px;
  825. display: flex;
  826. flex-direction: column;
  827. align-items: center;
  828. justify-content: center;
  829. padding: 80px 20px;
  830. background: #FFFFFF;
  831. border: 2px solid #8F6726;
  832. .note {
  833. width: 100%;
  834. font-family: PingFang SC, PingFang SC;
  835. font-weight: 500;
  836. font-size: 24px;
  837. color: #8F6726;
  838. text-align: center;
  839. margin-bottom: 20px;
  840. }
  841. .note2 {
  842. font-family: PingFang SC, PingFang SC;
  843. font-weight: 500;
  844. font-size: 21px;
  845. color: #A14212;
  846. text-align: center;
  847. margin-bottom: 40px;
  848. }
  849. .img-box {
  850. display: flex;
  851. align-items: center;
  852. justify-content: center;
  853. .bg-box {
  854. width: 396px;
  855. height: 370px;
  856. background: #FBF4EE;
  857. border-radius: 12px 12px 12px 12px;
  858. border: 1px solid #8F6726;
  859. }
  860. }
  861. .left {
  862. width: 320px;
  863. height: 400px;
  864. background: #FBF4EE;
  865. border-radius: 16px;
  866. border: 1px solid #8F6726;
  867. margin-right: 70px;
  868. .bg {
  869. width: 100%;
  870. height: 320px;
  871. border-radius: 16px 16px 0 0;
  872. background-image: url(/static/image/device/left_hand_img.png);
  873. background-repeat: no-repeat;
  874. background-size: 100% 100%;
  875. display: flex;
  876. align-items: center;
  877. justify-content: center;
  878. image {
  879. width: 68px;
  880. height: 68px;
  881. }
  882. }
  883. .btn {
  884. width: 100%;
  885. display: flex;
  886. align-items: center;
  887. justify-content: center;
  888. text-align: center;
  889. image {
  890. width: 24px;
  891. height: 24px;
  892. margin-right: 10px;
  893. }
  894. text {
  895. line-height: 80px;
  896. font-family: PingFang SC, PingFang SC;
  897. font-weight: 500;
  898. font-size: 24px;
  899. color: #8F6726;
  900. }
  901. }
  902. }
  903. .right {
  904. width: 320px;
  905. height: 400px;
  906. background: #FBF4EE;
  907. border-radius: 16px;
  908. border: 1px solid #8F6726;
  909. .bg {
  910. width: 100%;
  911. height: 320px;
  912. border-radius: 16px 16px 0 0;
  913. background-image: url(/static/image/device/right_hand_img.png);
  914. background-repeat: no-repeat;
  915. background-size: 100% 100%;
  916. display: flex;
  917. align-items: center;
  918. justify-content: center;
  919. image {
  920. width: 68px;
  921. height: 68px;
  922. }
  923. }
  924. .btn {
  925. width: 100%;
  926. display: flex;
  927. align-items: center;
  928. justify-content: center;
  929. text-align: center;
  930. image {
  931. width: 24px;
  932. height: 24px;
  933. margin-right: 10px;
  934. }
  935. text {
  936. line-height: 80px;
  937. font-family: PingFang SC, PingFang SC;
  938. font-weight: 500;
  939. font-size: 24px;
  940. color: #8F6726;
  941. }
  942. }
  943. }
  944. .btn-box {
  945. margin-top: 40px;
  946. width: 196px;
  947. height: 53px;
  948. line-height: 53px;
  949. border-radius: 12px 12px 12px 12px;
  950. display: flex;
  951. align-items: center;
  952. justify-content: center;
  953. background: #8F6726;
  954. font-family: PingFang SC, PingFang SC;
  955. font-weight: 400;
  956. font-size: 21px;
  957. color: #FFFFFF;
  958. text-align: center;
  959. }
  960. }
  961. }
  962. .connect-box {}
  963. /* 遮罩层样式 */
  964. .mask {
  965. position: fixed;
  966. top: 0;
  967. left: 0;
  968. right: 0;
  969. bottom: 0;
  970. background-color: rgba(0, 0, 0, 0.5);
  971. display: flex;
  972. justify-content: center;
  973. align-items: center;
  974. z-index: 999;
  975. animation: fadeIn 0.3s ease;
  976. }
  977. /* 弹窗容器样式 */
  978. .popup-container2 {
  979. //width: 50%;
  980. min-height: 250px;
  981. background: #FBF4EE;
  982. border-radius: 12px;
  983. box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  984. animation: scaleIn 0.3s ease;
  985. overflow: hidden;
  986. display: flex;
  987. flex-direction: column;
  988. align-items: center;
  989. justify-content: space-between;
  990. padding: 30px 50px;
  991. .title-t {
  992. font-size: 24px;
  993. font-weight: bold;
  994. color: #8F6726;
  995. text-align: center;
  996. margin-bottom: 10px;
  997. }
  998. .title-r {
  999. font-size: 20px;
  1000. color: #8F6726;
  1001. text-align: center;
  1002. padding: 20px 0;
  1003. }
  1004. .btn-r {
  1005. text-align: center;
  1006. background: #8F6726;
  1007. font-size: 20px;
  1008. color: #FBF4EE;
  1009. border-radius: 12px;
  1010. width: 100%;
  1011. height: 50px;
  1012. line-height: 50px;
  1013. margin-top: 10px;
  1014. }
  1015. }
  1016. /* 弹窗容器样式 */
  1017. .popup-container {
  1018. width: 80%;
  1019. //min-width: 840px;
  1020. background: #FBF4EE;
  1021. border-radius: 12px;
  1022. box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  1023. animation: scaleIn 0.3s ease;
  1024. overflow: hidden;
  1025. }
  1026. /* 弹窗头部样式 */
  1027. .popup-header {
  1028. padding: 20px;
  1029. display: flex;
  1030. justify-content: space-between;
  1031. align-items: center;
  1032. background: #E9DDCD;
  1033. .goback {
  1034. background: #FFFFFF;
  1035. border-radius: 4px;
  1036. border: 1px solid #8F6726;
  1037. padding: 8px 16px;
  1038. font-size: 16px;
  1039. color: #8F6726;
  1040. text-align: center;
  1041. }
  1042. }
  1043. .popup-title {
  1044. flex: 1;
  1045. font-family: Source Han Serif CN, Source Han Serif CN;
  1046. font-weight: bold;
  1047. font-size: 24px;
  1048. color: #8F6726;
  1049. text-align: center;
  1050. }
  1051. .close-btn {
  1052. display: flex;
  1053. justify-content: center;
  1054. align-items: center;
  1055. transition: all 0.2s ease;
  1056. image {
  1057. width: 24px;
  1058. height: 24px;
  1059. }
  1060. }
  1061. /* 弹窗内容样式 */
  1062. .popup-content {
  1063. width: 90%;
  1064. padding: 40px 30px;
  1065. font-size: 20px;
  1066. color: #666;
  1067. line-height: 1.6;
  1068. background: #FBF4EE;
  1069. display: flex;
  1070. flex-direction: column;
  1071. align-items: center;
  1072. margin: auto;
  1073. .form-item {
  1074. display: flex;
  1075. align-items: center;
  1076. margin-bottom: 20px;
  1077. .label {
  1078. width: 100px;
  1079. font-family: PingFang SC, PingFang SC;
  1080. font-weight: 500;
  1081. font-size: 20px;
  1082. color: #8F6726;
  1083. text-align: right;
  1084. }
  1085. .form-input {
  1086. width: 400px;
  1087. height: 47px;
  1088. box-sizing: border-box;
  1089. background: #FFFFFF;
  1090. border-radius: 6px;
  1091. border: 1px solid #8F6726;
  1092. padding: 15px 26px;
  1093. }
  1094. .text-input {
  1095. font-family: PingFang SC, PingFang SC;
  1096. font-weight: 400;
  1097. font-size: 18px;
  1098. color: #9B9B9B;
  1099. text-align: left;
  1100. }
  1101. .r-box {
  1102. width: 400px;
  1103. height: 47px;
  1104. }
  1105. .picker-box {
  1106. // width: 540px;
  1107. // height: 64px;
  1108. // box-sizing: border-box;
  1109. // background: #FFFFFF;
  1110. // border-radius: 8px;
  1111. // border: 2px solid #8F6726;
  1112. // padding: 15px 26px;
  1113. .date {
  1114. image {
  1115. width: 32px;
  1116. height: 32px;
  1117. }
  1118. }
  1119. }
  1120. &:last-child {
  1121. margin-bottom: 0;
  1122. }
  1123. }
  1124. .form-item2 {
  1125. display: flex;
  1126. align-items: center;
  1127. margin-bottom: 20px;
  1128. .label {
  1129. width: 120px;
  1130. font-family: PingFang SC, PingFang SC;
  1131. font-weight: 500;
  1132. font-size: 20px;
  1133. color: #8F6726;
  1134. text-align: right;
  1135. }
  1136. .form-input {
  1137. width: 150px;
  1138. height: 47px;
  1139. box-sizing: border-box;
  1140. background: #FFFFFF;
  1141. border-radius: 6px;
  1142. border: 1px solid #8F6726;
  1143. padding: 15px 26px;
  1144. }
  1145. .text-input {
  1146. font-family: PingFang SC, PingFang SC;
  1147. font-weight: 400;
  1148. font-size: 18px;
  1149. color: #9B9B9B;
  1150. text-align: left;
  1151. }
  1152. .r-box {
  1153. width: 400px;
  1154. height: 47px;
  1155. }
  1156. .picker-box {
  1157. // width: 540px;
  1158. // height: 64px;
  1159. // box-sizing: border-box;
  1160. // background: #FFFFFF;
  1161. // border-radius: 8px;
  1162. // border: 2px solid #8F6726;
  1163. // padding: 15px 26px;
  1164. .date {
  1165. image {
  1166. width: 32px;
  1167. height: 32px;
  1168. }
  1169. }
  1170. }
  1171. }
  1172. }
  1173. .search-cont {
  1174. width: 100%;
  1175. display: flex;
  1176. align-items: center;
  1177. justify-content: space-between;
  1178. .form-input {
  1179. flex: 1;
  1180. height: 47px;
  1181. margin-right: 15px;
  1182. box-sizing: border-box;
  1183. background: #FFFFFF;
  1184. border-radius: 8px;
  1185. border: 1px solid #8F6726;
  1186. padding: 11px 20px;
  1187. }
  1188. .text-input {
  1189. font-family: PingFang SC, PingFang SC;
  1190. font-weight: 400;
  1191. font-size: 18px;
  1192. color: #9B9B9B;
  1193. text-align: left;
  1194. }
  1195. .search-btn {
  1196. width: 108px;
  1197. height: 47px;
  1198. background: #8F6726;
  1199. border-radius: 6px 6px 6px 6px;
  1200. display: flex;
  1201. align-items: center;
  1202. justify-content: center;
  1203. image {
  1204. width: 18px;
  1205. height: 18px;
  1206. margin-right: 5px;
  1207. }
  1208. text {
  1209. font-family: PingFang SC, PingFang SC;
  1210. font-weight: 400;
  1211. font-size: 18px;
  1212. color: #FFFFFF;
  1213. text-align: center;
  1214. }
  1215. }
  1216. }
  1217. .isNull {
  1218. text-align: center;
  1219. color: #8F6726;
  1220. }
  1221. .userList-box {
  1222. margin-top: 30px;
  1223. width: 100%;
  1224. background: #FFFFFF;
  1225. border-radius: 12px;
  1226. overflow: hidden;
  1227. }
  1228. .userList {
  1229. width: 100%;
  1230. height: 330px;
  1231. overflow-y: auto;
  1232. &::-webkit-scrollbar {
  1233. display: block !important;
  1234. width: 10px !important;
  1235. /* 滚动条宽度 */
  1236. }
  1237. &::-webkit-scrollbar-thumb {
  1238. background: #8F6726 !important;
  1239. /* 滚动条滑块颜色 */
  1240. border-radius: 5px !important;
  1241. /* 滑块圆角 */
  1242. }
  1243. .item {
  1244. width: 100%;
  1245. padding: 17px 22px;
  1246. display: flex;
  1247. align-items: center;
  1248. justify-content: space-between;
  1249. .title {
  1250. flex: 1;
  1251. font-family: PingFang SC, PingFang SC;
  1252. font-weight: 400;
  1253. font-size: 18px;
  1254. color: #8F6726;
  1255. text-align: left;
  1256. }
  1257. .right-box {
  1258. display: flex;
  1259. align-items: center;
  1260. justify-content: space-between;
  1261. .rest {
  1262. display: flex;
  1263. align-items: center;
  1264. justify-content: center;
  1265. width: 59px;
  1266. height: 33px;
  1267. border-radius: 6px 6px 6px 6px;
  1268. border: 1px solid #8F6726;
  1269. font-family: PingFang SC, PingFang SC;
  1270. font-weight: 400;
  1271. font-size: 16px;
  1272. color: #8F6726;
  1273. margin-right: 16px;
  1274. }
  1275. .select {
  1276. display: flex;
  1277. align-items: center;
  1278. justify-content: center;
  1279. width: 59px;
  1280. height: 33px;
  1281. border-radius: 6px 6px 6px 6px;
  1282. border: 1px solid #8F6726;
  1283. font-family: PingFang SC, PingFang SC;
  1284. font-weight: 400;
  1285. font-size: 16px;
  1286. color: #8F6726;
  1287. &.active {
  1288. background: #8F6726;
  1289. color: #fff;
  1290. }
  1291. }
  1292. }
  1293. }
  1294. }
  1295. .userDetail {
  1296. // margin-top: 30px;
  1297. width: 100%;
  1298. background: #FFFFFF;
  1299. border-radius: 12px;
  1300. padding: 0 30px;
  1301. height: 50vh;
  1302. overflow-y: auto;
  1303. &::-webkit-scrollbar {
  1304. display: block !important;
  1305. width: 10px !important;
  1306. /* 滚动条宽度 */
  1307. }
  1308. &::-webkit-scrollbar-thumb {
  1309. background: #8F6726 !important;
  1310. /* 滚动条滑块颜色 */
  1311. border-radius: 5px !important;
  1312. /* 滑块圆角 */
  1313. }
  1314. .item {
  1315. width: 100%;
  1316. padding: 15px 0px;
  1317. display: flex;
  1318. align-items: center;
  1319. justify-content: space-between;
  1320. font-family: PingFang SC, PingFang SC;
  1321. font-weight: 400;
  1322. font-size: 20px;
  1323. color: #8F6726;
  1324. border-bottom: 1px dashed #8F6726;
  1325. text {
  1326. flex: 1
  1327. }
  1328. &:last-child {
  1329. border: 0;
  1330. }
  1331. }
  1332. }
  1333. /* 弹窗底部样式 */
  1334. .popup-footer {
  1335. display: flex;
  1336. align-items: center;
  1337. justify-content: center;
  1338. margin-bottom: 30px;
  1339. // background: #FBF4EE;
  1340. // border-top: 1px solid #eee;
  1341. }
  1342. .btn2 {
  1343. // flex: 1;
  1344. padding: 26px 0;
  1345. text-align: center;
  1346. font-size: 20px;
  1347. transition: all 0.2s ease;
  1348. }
  1349. .confirm-btn {
  1350. width: 185px;
  1351. height: 53px;
  1352. background: #8F6726;
  1353. border-radius: 12px 12px 12px 12px;
  1354. display: flex;
  1355. align-items: center;
  1356. justify-content: center;
  1357. text {
  1358. font-family: PingFang SC, PingFang SC;
  1359. font-weight: 400;
  1360. font-size: 20px;
  1361. color: #FFFFFF;
  1362. text-align: center;
  1363. }
  1364. image {
  1365. width: 24px;
  1366. height: 24px;
  1367. margin-right: 10px;
  1368. }
  1369. }
  1370. .confirm-btn2 {
  1371. width: 113px;
  1372. height: 53px;
  1373. background: #8F6726;
  1374. border-radius: 12px;
  1375. display: flex;
  1376. align-items: center;
  1377. justify-content: center;
  1378. text {
  1379. font-family: PingFang SC, PingFang SC;
  1380. font-weight: 400;
  1381. font-size: 20px;
  1382. color: #FFFFFF;
  1383. text-align: center;
  1384. }
  1385. }
  1386. /* 动画效果 */
  1387. @keyframes fadeIn {
  1388. from {
  1389. opacity: 0;
  1390. }
  1391. to {
  1392. opacity: 1;
  1393. }
  1394. }
  1395. @keyframes scaleIn {
  1396. from {
  1397. transform: scale(0.9);
  1398. opacity: 0;
  1399. }
  1400. to {
  1401. transform: scale(1);
  1402. opacity: 1;
  1403. }
  1404. }
  1405. </style>