index.vue 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564
  1. <template>
  2. <!-- <custom-navigation-bar class="bar">
  3. {{$t('navigationBarTitleText')}}
  4. </custom-navigation-bar> -->
  5. <!-- <page-meta>
  6. <navigation-bar
  7. :title="$t('navigationBarTitleText')"
  8. front-color="#fff"
  9. background-color="#648EB8"
  10. title-align="center"
  11. />
  12. </page-meta> -->
  13. <!-- <view class="">
  14. <navbar :title="$t('show_report')" size="48" :backtext="$t('back')" background="#648EB8" color="#fff" :backShow="false"></navbar>
  15. </view> -->
  16. <view class="app_content">
  17. <uv-toast ref="toast"></uv-toast>
  18. <view class="page">
  19. <view class="bar">
  20. <uv-text :text="$t('navigationBarTitleText')" align="center" color="#fff" size="20"></uv-text>
  21. </view>
  22. <view class="bottomarc"></view>
  23. <view style="max-width: 810px;margin: 0 auto;">
  24. <uv-row justify="space-between" customStyle="margin-top: 6%">
  25. <uv-col span="10" offset="1" class="box1">
  26. <view class='hometitle'>
  27. {{$t('index_text_1')}}
  28. </view>
  29. <view class="userlist">
  30. <uv-row>
  31. <uv-col span="10" class="scroll_div">
  32. <uv-scroll-list :indicator="false">
  33. <view v-for="(item, index) in userlist" :key="index" class="item">
  34. <uv-image class="img" :src="item.photourl" mode="aspectFill"
  35. shape="circle" :lazy-load="true" width="60" height="60"
  36. :class="{ memberphoto_select: item.selected }"
  37. @click="selected(index)">
  38. </uv-image>
  39. <uv-text :text="item.membername" align="center" customStyle="margin-top:0.3rem"></uv-text>
  40. </view>
  41. </uv-scroll-list>
  42. </uv-col>
  43. <uv-col span="2">
  44. <view class="addmember">
  45. <uv-image class="img" src="/static/image/fabu1.png" mode="aspectFill"
  46. shape="circle" :lazy-load="true" width="50" height="50"
  47. @click="insertmembe">
  48. </uv-image>
  49. <uv-text :text="$t('new_member')" align="center" customStyle="margin-top:0.3rem"></uv-text>
  50. </view>
  51. </uv-col>
  52. </uv-row>
  53. </view>
  54. </uv-col>
  55. </uv-row>
  56. <view class="">
  57. <uv-row justify="space-between" customStyle="margin-top: 2rem">
  58. <uv-col span="10" offset="1">
  59. <view class="box2">
  60. <view class="scalename">
  61. {{$t('index_text_2')}}
  62. </view>
  63. <view class="div1">
  64. <uv-row>
  65. <uv-col span="6">
  66. <image class="img" src="http://qiniusave.chienxutech.com/sdzyy/img/xgng3.png" ></image>
  67. </uv-col>
  68. <uv-col span="6">
  69. <view class="">
  70. <uv-text :text="$t('index_text_3')"></uv-text>
  71. <uv-text :text="$t('index_text_4')" align="center" customStyle="margin-top:30px;margin-bottom:40px"></uv-text>
  72. <uv-text :text="$t('index_text_5')" align="center" size="12" color="#1a1a1a"></uv-text>
  73. </view>
  74. </uv-col>
  75. </uv-row>
  76. </view>
  77. <view class='scalename'>{{$t('index_text_6')}}</view>
  78. <view v-if="selectuser" class="btns">
  79. <!-- <view v-show="1!=selectuser.fmemberid"> -->
  80. <view>
  81. <uv-row v-show="0==reportinfo.comstatus">
  82. <uv-col span="6" offset="3">
  83. <view class='mybtn' @click="tostem">
  84. {{$t('index_btn_1')}}
  85. </view>
  86. </uv-col>
  87. </uv-row>
  88. <uv-row gutter="20" v-show="1==reportinfo.comstatus">
  89. <uv-col span="6" >
  90. <view class='mybtn' @click="showreport">
  91. {{$t('index_btn_2')}}
  92. </view>
  93. </uv-col>
  94. <uv-col span="6" >
  95. <view class='mybtn' @click="restem">
  96. {{$t('index_btn_3')}}
  97. </view>
  98. </uv-col>
  99. </uv-row>
  100. </view>
  101. </view>
  102. <view v-else>
  103. <p>{{$t('not_selected')}}</p>
  104. </view>
  105. <!-- mergerscale.comstatus -->
  106. </view>
  107. </uv-col>
  108. </uv-row>
  109. <!-- <uv-row justify="space-between" customStyle="margin-top: 6%">
  110. <uv-col span="10" offset="1" >
  111. <share @dosharewechat="share"></share>
  112. </uv-col>
  113. </uv-row> -->
  114. </view>
  115. </view>
  116. </view>
  117. <view class="">
  118. <!--@maskClick="maskClick"-->
  119. <uv-popup ref="popup" mode="bottom" :closeable="false" :close-on-click-overlay="false">
  120. <view class="showinfo">
  121. <!-- <h3>เรียนผู้ใช้ ยินดีต้อนรับสู่ NDAID!</h3>
  122. <br />
  123. <text>
  124. ที่นี่ คุณจะได้รับความรู้ด้านสุขภาพเกี่ยวกับหัวใจและหลอดเลือด และเรียนรู้เกี่ยวกับนิสัยการใช้ชีวิตเพื่อสุขภาพที่ดีต่างๆ แต่โปรดทราบว่าแอปนี้มีวัตถุประสงค์เพื่อทำให้วิทยาศาสตร์สุขภาพเป็นที่นิยม และให้คำแนะนำด้านสุขภาพในชีวิตประจำวันแก่คุณ ไม่ใช่การวินิจฉัยทางการแพทย์
  125. </text>
  126. <br />
  127. <text>
  128. เรามุ่งมั่นที่จะช่วยให้คุณพัฒนาวิถีชีวิตที่ดี เช่น การรับประทานอาหารที่เหมาะสม การออกกำลังกายในระดับปานกลาง งานประจำ และเวลาพักผ่อน เป็นต้น อย่างไรก็ตาม หากคุณมีปัญหาสุขภาพโดยเฉพาะ เราขอแนะนำให้คุณไปที่สถาบันการแพทย์ทั่วไปเพื่อรับการวินิจฉัยและการรักษา
  129. </text>
  130. <br />
  131. <text>
  132. ให้เราทำงานร่วมกันเพื่อใช้ความรู้ทางวิทยาศาสตร์เพื่อส่งเสริมชีวิตที่มีสุขภาพที่ดี!
  133. </text> -->
  134. <h4>คุณกำลังจะใช้ฟังก์ชันที่เกี่ยวข้องกับข้อมูลสุขภาพ โปรด lưu ý:</h4>
  135. <br />
  136. <ul>
  137. <li>ผลลัพธ์ขึ้นอยู่ наการวิจัยทางการแพทย์ที่เปิดเผย อาจมีความคลาดเคลื่อน</li>
  138. <li>เป็นไปไม่ได้ที่จะแทนการวินิจฉัยของแพทย์</li>
  139. <li>การใช้ต่อไปหมายความว่าคุณตระหนักถึงความเสี่ยงข้างต้นสำรวจสาธารณสุขในประเทศไทยที่จัดทำโดยมหาวิทยาลัยเกลอ</li>
  140. </ul>
  141. <br/>
  142. <h4>The feature you are about to use involves health data. Please note:</h4>
  143. <br />
  144. <ul>
  145. <li>The results are based on publicly available medical research and may contain errors.</li>
  146. <li>It is strictly prohibited to substitute a doctor's diagnosis.</li>
  147. <li>Continuing to use this feature indicates that you are aware of the above risks.</li>
  148. </ul>
  149. <br />
  150. <view class="">
  151. <!-- @change="checkchange" -->
  152. <uv-checkbox-group v-model="checkvalue" >
  153. <uv-checkbox :customStyle="{marginBottom: '8px'}"
  154. v-for="(item, index) in checkboxrange" :key="index" :label="item.text" :name="item.value"></uv-checkbox>
  155. </uv-checkbox-group>
  156. <uv-button type="primary" :text="$t('continue')" v-show="checkvalue==1" @click="close_showinfo"></uv-button>
  157. </view>
  158. </view>
  159. </uv-popup>
  160. </view>
  161. </view>
  162. </template>
  163. <script>
  164. import {getlist} from "@/common/api/fmember.js"
  165. import {querymergescalebyuserid} from "@/common/api/scale.js"
  166. import {tostemlistnext} from "@/common/js/common.js"
  167. import share from "@/components/share/share.vue"
  168. import {addlog} from "@/common/api/system.js"
  169. export default {
  170. data() {
  171. return {
  172. userinfo:{},
  173. userlist:[],
  174. reportinfo:{},
  175. selectuser:false,
  176. isshowinfo:0,
  177. checkvalue:0,
  178. checkboxrange: [{"value": 1,"text": "ฉันได้อ่านและ đồngยอม/I have read and agree."}]
  179. }
  180. },
  181. components:{
  182. share
  183. },
  184. methods: {
  185. checkchange(e){
  186. console.log(this.checkvalue,e)
  187. this.close_showinfo()
  188. },
  189. getlist(){
  190. let data ={userid:this.userinfo.id}
  191. getlist(data).then(res=>{
  192. res = res.data
  193. if(0==res.code){
  194. this.$refs.toast.show({
  195. type: 'error',
  196. message: res.errmsg
  197. })
  198. }
  199. if(200==res.code){
  200. let userlist = res.resultData
  201. let fmemberid = this.selectuser?this.selectuser.fmemberid:this.userinfo.fmemberid
  202. if(this.selectuser){
  203. userlist.map((item,index)=>{
  204. item.selected=0
  205. if(item.fmemberid==fmemberid){
  206. item.selected=1
  207. return
  208. }
  209. })
  210. }else{
  211. userlist[0].selected=1
  212. uni.setStorage({
  213. key: 'selectuser',
  214. data: userlist[0],
  215. });
  216. this.selectuser = userlist[0]
  217. uni.setStorage({
  218. key: 'selectuser',
  219. data: this.selectuser,
  220. });
  221. }
  222. userlist.map((item,index)=>{
  223. if(!item.gender){
  224. item.photourl="/static/image/member.svg"
  225. }else{
  226. switch(item.gender){
  227. case 1:
  228. case '1':
  229. item.photourl="/static/image/selecttype/man.png"
  230. break;
  231. case 2:
  232. case '2':
  233. item.photourl="/static/image/selecttype/woman.png"
  234. break;
  235. }
  236. }
  237. })
  238. this.userlist = userlist
  239. uni.setStorage({
  240. key: 'memberlist',
  241. data: this.userlist,
  242. });
  243. }
  244. })
  245. },
  246. selected(index){
  247. let that = this
  248. this.userlist.map((item,index1)=>{
  249. if(index1==index){
  250. item.selected=1
  251. that.selectuser = item
  252. }else{
  253. item.selected=0
  254. }
  255. })
  256. uni.setStorage({
  257. key: 'selectuser',
  258. data: this.selectuser,
  259. });
  260. this.querymergescalebyuserid()
  261. },
  262. insertmembe(){
  263. let count = this.userlist.length-1
  264. if(count>=this.userinfo.fmembercount){
  265. this.$refs.toast.show({
  266. type: 'error',
  267. message: this.$t('member_num_than_max')
  268. })
  269. }else{
  270. uni.navigateTo({
  271. url: '/pages/member/add'
  272. });
  273. }
  274. },
  275. querymergescalebyuserid(){
  276. let userid = this.userinfo.id
  277. let fmemberid=this.selectuser.fmemberid?this.selectuser.fmemberid:0
  278. let data={userid:userid,fmemberid:fmemberid}
  279. querymergescalebyuserid(data).then(res=>{
  280. res =res.data
  281. if(0==res.code){
  282. this.$refs.toast.show({
  283. type: 'error',
  284. message: res.errmsg
  285. })
  286. return false
  287. }
  288. if(200==res.code){
  289. this.reportinfo = res.resultData
  290. }
  291. })
  292. },
  293. showreport(){
  294. uni.navigateTo({
  295. url: '/pages/report/report'
  296. });
  297. },
  298. init_reload(){
  299. this.userinfo = uni.getStorageSync("userinfo")
  300. this.selectuser = uni.getStorageSync("selectuser")
  301. this.getlist()
  302. this.querymergescalebyuserid()
  303. },
  304. init(){
  305. this.userinfo = uni.getStorageSync("userinfo")
  306. this.selectuser = uni.getStorageSync("selectuser")
  307. this.getlist()
  308. this.querymergescalebyuserid()
  309. // uni.$on('dosharewechat',function(data){
  310. // uni.share({
  311. // provider: "weixin",
  312. // scene: "WXSceneSession",
  313. // type: 0,
  314. // href:"testapp://",
  315. // title: "uni-app分享",
  316. // summary: "我正在使用HBuilderX开发uni-app,赶紧跟我一起来体验!",
  317. // imageUrl: data.shareimg,
  318. // success: function (res) {
  319. // addlog({
  320. // json: JSON.stringify(res),
  321. // type: 'uniapp信息'
  322. // })
  323. // console.log("success:" + JSON.stringify(res));
  324. // },
  325. // fail: function (err) {
  326. // addlog({
  327. // json: JSON.stringify(res),
  328. // type: 'uniapp错误'
  329. // })
  330. // console.log("fail:" + JSON.stringify(err));
  331. // }
  332. // })
  333. // })
  334. if(1==this.isshowinfo){
  335. this.showinfo()
  336. }
  337. },
  338. tostem(){
  339. if(this.reportinfo.stemlist == undefined){
  340. return
  341. }
  342. uni.setStorage({
  343. key: 'stemlist',
  344. data: this.reportinfo.stemlist,
  345. });
  346. if(this.reportinfo.srid == undefined){
  347. this.reportinfo.srid =0
  348. }
  349. let stemlist = this.reportinfo.stemlist
  350. let srid =this.reportinfo.srid
  351. uni.setStorage({
  352. key: 'srid',
  353. data: srid,
  354. });
  355. let stepprogress = this.reportinfo.stepprogress
  356. tostemlistnext(stepprogress)
  357. // let item = stemlist[stepprogress]
  358. // if(item.stemtype<101){
  359. // //标准答题
  360. // uni.navigateTo({
  361. // url: '/pages/topic/common'
  362. // });
  363. // }else{
  364. // //特殊答题
  365. // let scaleid=4
  366. // let url = "/pages/topic/"+item.stemdefinepage+"?scaleid="+scaleid + "&srid=" + srid + `&sindex=` + stepprogress
  367. // uni.navigateTo({
  368. // url: url
  369. // });
  370. // }
  371. },
  372. restem(){
  373. uni.setStorage({
  374. key: 'stemlist',
  375. data: this.reportinfo.stemlist,
  376. });
  377. if(this.reportinfo.srid == undefined){
  378. this.reportinfo.srid =0
  379. }
  380. let stemlist = this.reportinfo.stemlist
  381. let srid = 0
  382. uni.setStorage({
  383. key: 'srid',
  384. data: srid,
  385. });
  386. //let stepprogress = this.reportinfo.stepprogress
  387. let stepprogress = 0
  388. var scaleid = 4
  389. tostemlistnext(stepprogress,0,scaleid,srid)
  390. },
  391. share(data){
  392. // this.$refs.toast.show({
  393. // type: 'error',
  394. // message: data.shareimg
  395. // })
  396. // console.log(data)
  397. uni.share({
  398. provider: "weixin",
  399. scene: "WXSceneSession",
  400. type: 0,
  401. href:"testapp://",
  402. //title: this.$t('navigationBarTitleText')+"分享",
  403. title: this.$t('share'),
  404. summary: this.$t('share_text'),
  405. imageUrl: data.shareimg,
  406. success: function (res) {
  407. addlog({
  408. json: JSON.stringify(res),
  409. type: 'uniapp信息'
  410. })
  411. console.log("success:" + JSON.stringify(res));
  412. },
  413. fail: function (err) {
  414. addlog({
  415. json: JSON.stringify(err),
  416. type: 'uniapp错误'
  417. })
  418. console.log("fail:" + JSON.stringify(err));
  419. }
  420. })
  421. },
  422. showinfo(){
  423. console.log(this.$refs);
  424. this.$refs.popup.open()
  425. },
  426. close_showinfo(){
  427. this.$refs.popup.close()
  428. },
  429. maskClick(){
  430. this.$refs.popup.close();
  431. }
  432. },
  433. mounted() {
  434. // uni.setNavigationBarTitle({
  435. // title: this.$t('navigationBarTitleText')
  436. // });
  437. this.init()
  438. uni.setTabBarItem({
  439. index: 0,
  440. text: this.$t('review'),
  441. iconPath: "/static/image/btns/review/dangeritem-r.png",
  442. selectedIconPath: "/static/image/btns/review/dangeritem.png",
  443. })
  444. uni.setTabBarItem({
  445. index: 1,
  446. text: this.$t('health_center'),
  447. iconPath: "/static/image/btns/health_center/videolist.png",
  448. selectedIconPath: "/static/image/btns/health_center/videolist_r.png",
  449. })
  450. },
  451. onLoad(option){
  452. if(1==option.islogin){
  453. this.isshowinfo=1
  454. }
  455. },
  456. onShow(option){
  457. this.init_reload()
  458. // uni.reLaunch()
  459. },
  460. onPullDownRefresh(){
  461. this.init()
  462. setTimeout(function () {
  463. uni.stopPullDownRefresh();
  464. }, 1000);
  465. }
  466. }
  467. </script>
  468. <style scoped>
  469. .box1{
  470. background-color: #fff;
  471. border-radius:20rpx;
  472. box-shadow: 3px 3px 0px 0px rgba(0, 0, 0, 0.3);
  473. display:flex;
  474. flex-direction:column;
  475. align-items:center;
  476. width: 80%;
  477. }
  478. .box1 .userlist{
  479. width: 100%;
  480. }
  481. .box1 .userlist .item{
  482. display: flex;
  483. flex-direction: column;
  484. align-items: center;
  485. text-align: center;
  486. width: 60px;
  487. }
  488. .box1 .userlist .scroll_div{
  489. max-width: 80%;
  490. }
  491. .addmember{
  492. width: 50px;
  493. display: flex;
  494. flex-direction: column;
  495. align-items: center;
  496. text-align: center;
  497. }
  498. .addmember{
  499. padding-bottom: 10px;
  500. }
  501. .box2{
  502. background-color: #fff;
  503. border-radius:20rpx;
  504. box-shadow: 3px 3px 0px 0px rgba(0, 0, 0, 0.3);
  505. display:flex;
  506. flex-direction:column;
  507. align-items:center;
  508. width: 100%;
  509. padding: 0.5em;
  510. box-sizing: border-box;
  511. }
  512. .box1 .hometitle{
  513. height:80rpx;
  514. display:flex;
  515. align-items:center;
  516. justify-content:center;
  517. font-weight:700;
  518. color:#47689D;
  519. }
  520. .box1 .userlist .item .memberphoto_select{
  521. overflow: hidden;
  522. box-shadow:1px 3px 3px 1px rgba(0, 0, 0, 0.3);
  523. }
  524. .box1 .userlist{
  525. padding-left: 10px;
  526. padding-right: 10px;
  527. }
  528. .box2 .scalename{
  529. font-size:36rpx;
  530. display:flex;
  531. justify-content:center;
  532. align-items:center;
  533. color:#3f73b3;
  534. margin-top:5rpx;
  535. font-weight:700;
  536. }
  537. .box2 .img{
  538. width: 100%;
  539. object-fit: contain;
  540. height: 350rpx;
  541. }
  542. .box2 .div1{
  543. width: 100%;
  544. }
  545. .box2 .btns{
  546. width: 100%;
  547. margin-top: 30rpx;
  548. margin-bottom: 30rpx;
  549. }
  550. .app_content{
  551. margin-top:0px ;
  552. }
  553. .showinfo{
  554. height: 50%;
  555. padding: 1.5em;
  556. padding-bottom: 5em;
  557. text-align: 12rpx;
  558. }
  559. </style>