| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600 |
- <template>
- <!-- <page-meta :page-font-size="`${this.scaleFontSize}px`" :root-font-size="`${this.scaleFontSize}px`"></page-meta> -->
- <view class="border-box">
- <view class="content y-ac">
- <view class="logo">
- <image class="logo-1" src='/static/image/new/logo.svg'></image>
- <image class="logo-2" src='/static/image/new/img_welcom.svg'></image>
- </view>
- <view class="checkbox">
- <view class="btn" @click="goTest()">开始检测</view>
- <view class="checkbox-icon x-c" @tap="handleAgree">
- <image src="/static/image/new/icon_check_default.svg" v-show="!agree"></image>
- <image src="/static/image/new/icon_check.svg" v-show="agree"></image>
- <view class="checkbox-text">我已阅读并同意<text @tap="goToWeb(0)">《用户协议》</text><text @tap="goToWeb(1)">《隐私政策》</text></view>
- </view>
-
- </view>
- <!-- <view class="center-box" :class="{ 'flex-box': width < height }">
- <view class="bg-item y-start" @click="goTest()">
- <view class="title">体质辨识</view>
- <view class="more">
- <text>点击了解</text>
- </view>
- </view>
- <view class="bg-item y-start" @click="goUser()">
- <view class="title">客户管理</view>
- <view class="more">
- <text>点击了解</text>
- </view>
- </view>
- </view> -->
- <!-- <view class="footer">
- <view>登录账号:{{info.userName||'-'}}</view>
- <view>姓名:{{info.nickName||'-'}}</view>
- </view> -->
- </view>
- </view>
- </template>
- <script>
- import store from '@/store';
- import {selectUserInfo} from '@/api/user.js';
- export default {
- components: {
-
- },
- data() {
- return {
- height: uni.getSystemInfoSync().screenHeight,
- width: uni.getSystemInfoSync().screenWidth,
- statusBarHeight: uni.getSystemInfoSync().statusBarHeight,
- option: '',
- top: 0,
- statusBarBG: 'none',
- headerHeight: 44,
- // locCity: '国健通',
- scaleFontSize: uni.getStorageSync('fontSize'),
- info:{},
- user:{},
- agree: false,
-
- };
- },
- onPageScroll(e) {
- if (this.template == 'homeIndex') {
- this.top = e.scrollTop;
- }
- },
- computed: {
- // 计算属性的 getter
- headerBG() {
- if (this.template == 'homeIndex') {
- var top = this.top / 88;
- return 'rgba(255,92,3, ' + top + ')';
- }
- }
- },
- onLoad(option) {
-
- const systemInfo = uni.getSystemInfoSync();
- console.log("qxj screenWidth:"+systemInfo.screenWidth);
- console.log("qxj screenHeight:"+systemInfo.screenHeight); //定制设备平板 800x1232 平板设备1280x785
-
- let that = this;
- uni.setNavigationBarTitle({
- title: that.$qconfig.appName
- });
- uni.setStorageSync('indexTemplate', 0);
- this.option = option;
- // this.user=JSON.parse(uni.getStorageSync('userInfo'));
- // this.selectUserInfo();
- //this.scaleFontSize = store.state.timStore.fontSize;
- // this.$nextTick(()=>{
- // this.$refs[this.template].initLoad(this.option)
- // })
- },
- onReady() {
- // this.$refs.indexSubsection.selectorQuery();
- // this.$refs[this.template].initReady();
- },
- onShow() {
- // if (!this.$isLogin()) {
- // uni.navigateTo({
- // url: '/pages/auth/loginIndex'
- // });
- // } else {
- // // this.$updateMsgDot();
- // }
- },
- methods: {
- // 同意
- handleAgree() {
- this.agree = !this.agree
- },
- goToWeb(index) {
- // uni.setStorageSync('url', index == 0 ? "https://userapp.his.cdwjyyh.com/web/userAgreement" :
- // "https://userapp.his.cdwjyyh.com/web/privacyPolicy");
- uni.navigateTo({
- url: "/pages/index/agreement"
- })
- },
- selectUserInfo(){
- selectUserInfo().then(res => {
- if(res.code==200){
- console.log('res',res)
- this.info=res.user
- }
- else{
- uni.showToast({title: res.msg,icon: 'none'});
- }
- },
- rej => {}
- );
- },
- logout(){
- uni.showModal({
- title:"提示",
- content:"确认退出登录吗?",
- showCancel:true,
- cancelText:'取消',
- confirmText:'确定',
- success:res=>{
- if(res.confirm){
- // this.$logout();
- uni.removeStorageSync('AppToken');
- uni.removeStorageSync('selectUser');
- uni.$emit('loginOut');
- uni.reLaunch({
- url: '/pages/auth/loginIndex'
- });
- }else{
-
- }
- }
- })
- },
- goUser(){
- // uni.redirectTo({
- // url: '/pages/user/myUserList?userId='+this.user.userId
- // });
- uni.navigateTo({
- url: '/pages/user/myUserList?userId='+this.user.userId
- })
- },
- goTest(){
- if (!this.agree) {
- uni.showToast({
- title: "请同意相关协议",
- icon: 'none'
- });
- return
- }
- // uni.navigateTo({
- // //url:"/pages/device/tongue/indexOld"
- // url:"/pages/device/tongue/facePhoto"
- // });
- uni.navigateTo({
- url:'/pages/user/userInfo'
- })
- },
- changeTemplate(e) {
- const tem = e == 1 ? 'watchIndex' : 'homeIndex';
- if (this.template == tem) return;
- this.template = tem;
- uni.pageScrollTo({
- scrollTop: 0,
- duration: 100
- });
- this.$nextTick(() => {
- //this.$refs[this.template].initLoad(this.option)
- this.$refs[this.template].initReady();
- // this.$refs[this.template].initShow();
- });
- },
- registerIdCode() {
- //注册,先注册再获取,注意APP合规性,若最终用户未同意隐私政策则不要调用
- idCode.register((res) => {
- console.log(res);
- });
- },
- async getLocation() {
- let status;
- // #ifdef APP-PLUS
- status = await this.checkPermission();
- if (status !== 1) {
- return;
- }
- // #endif
- // #ifdef MP-WEIXIN || MP-TOUTIAO || MP-QQ
- status = await this.getSetting();
- if (status === 2) {
- this.showConfirm();
- return;
- }
- // #endif
- this.doGetLocation();
- },
- doGetLocation() {
- getLocation().then((res) => {
- this.locCity = res.city.replace(/市|区/g, '');
- });
- },
- getSetting: function() {
- return new Promise((resolve, reject) => {
- uni.getSetting({
- success: (res) => {
- if (res.authSetting['scope.userLocation'] === undefined) {
- resolve(0);
- return;
- }
- if (res.authSetting['scope.userLocation']) {
- resolve(1);
- } else {
- resolve(2);
- }
- }
- });
- });
- },
- openSetting: function() {
- this.hideConfirm();
- uni.openSetting({
- success: (res) => {
- if (res.authSetting && res.authSetting['scope.userLocation']) {
- this.doGetLocation();
- }
- },
- fail: (err) => {}
- });
- },
- async checkPermission() {
- let status = permision1.isIOS ? await permision1.requestIOS('location') : await permision1
- .requestAndroid('android.permission.ACCESS_FINE_LOCATION');
- if (status === null || status === 1) {
- status = 1;
- } else if (status === 2) {
- uni.showModal({
- content: '系统定位已关闭',
- confirmText: '确定',
- showCancel: false,
- success: function(res) {}
- });
- } else if (status.code) {
- uni.showModal({
- content: status.message
- });
- } else {
- uni.showModal({
- content: '需要定位权限',
- confirmText: '设置',
- success: function(res) {
- if (res.confirm) {
- permision1.gotoAppSetting();
- }
- }
- });
- }
- return status;
- },
- showQidai() {
- uni.showToast({
- title: '功能完善中,敬请期待...',
- icon: 'none'
- });
- },
- goToMsg() {
- uni.switchTab({
- url: '/pages_im/pages/conversation/conversationList/index'
- });
- },
- async goToWXMsg() {
- const url = getApp().globalData.kfurl; //企业微信客服链接
- const corpId = getApp().globalData.corpId; //企业id
- // #ifdef H5
- window.location.href = url;
- // #endif
- // #ifdef MP-WEIXIN
- wx.openCustomerServiceChat({
- extInfo: {
- url
- },
- corpId,
- success(res) {
- console.log('成功');
- },
- fail(err) {
- console.log(err, '报错');
- }
- });
- // #endif
- // #ifdef APP-PLUS
- let shares = await this.getAppShare().catch((err) => {
- throw Error(err);
- });
- shares['weixin'].openCustomerServiceChat({
- corpid: corpId,
- url
- },
- (suc) => {
- console.log('客服打开成功', JSON.stringify(res));
- },
- (err) => {
- console.log('error', JSON.stringify(err));
- }
- );
- // #endif
- },
- getAppShare() {
- // #ifdef APP-PLUS
- return new Promise((re, rj) => {
- let shares = null;
- var pusher = plus.share.getServices(
- function(s) {
- shares = {};
- s.forEach((e) => (shares[e.id] = e));
- re(shares);
- },
- function(e) {
- rj(e);
- }
- );
- });
- // #endif
- },
-
- getIdCodes() {
- //获取设备的各种标识码
- idCode.getIdCodes((res) => {
- if (res.data) {
- //this.msgList.unshift(JSON.stringify(res.data));
- let ua = plus.navigator.getUserAgent();
- console.log('qxj ua:' + ua);
- console.log('qxj getIdCodes:' + JSON.stringify(res.data));
- }
- });
- },
-
- scanQRCode() {
- const that = this;
- uni.scanCode({
- success(res) {
- if (res.result) {
- // 扫描成功,处理二维码内容
- console.log('扫描结果:', res.result);
- const scanInfo = res.result;
- if (scanInfo && scanInfo.indexOf('https://userapp.his.cdwjyyh.com/bindcompanyuser') > -
- 1) {
- const companyUserId = this.getUrlParam(scanInfo).companyUserId;
- console.log('扫描结果公司码:', companyUserId);
- this.$handleBindCompanyFsUser(companyUserId);
- }
- } else {
- // 扫描失败
- uni.showToast({
- title: '扫描失败',
- icon: 'none'
- });
- }
- },
- fail() {}
- });
- },
- getUrlParam(url) {
- const queryStr = url.split('?')[1];
- if (!queryStr) {
- return {};
- }
- const params = queryStr.split('&');
- const queryParams = {};
- params.forEach((param) => {
- const [key, value] = param.split('=');
- queryParams[key] = value;
- });
- return queryParams;
- }
- }
- };
- </script>
- <style lang="scss" scoped>
- // @mixin u-flex($flexD, $alignI, $justifyC) {
- // display: flex;
- // flex-direction: $flexD;
- // align-items: $alignI;
- // justify-content: $justifyC;
- // }
- .border-box{
- width: 100vw;
- height: 100vh;
- // background-image:url(/static/image/device/ipad_yjf_boder.png);
- // background-repeat: no-repeat;
- // position: relative;
- // background-size: 100% 100%;
- // box-sizing: border-box;
- // padding: 10px;
- }
- .content{
- // display: flex;
- width: 100%;
- height: 100%;
- background-image:url(/static/image/new/bg_home.png);
- background-repeat: no-repeat;
- background-size: 100% 100%;
- position: relative;
- // padding-top: 20px;
- .logo{
- margin-top: 30px;
- width: 100%;
- display: flex;
- align-items: center;
- flex-direction: column;
- .logo-1{
- width: 536px;
- height: 263px;
- }
- .logo-2{
- margin-top: 55px;
- width: 490px;
- height: 104px;
- }
- }
- .btn-box{
- width: 100%;
- text-align: right;
- justify-content: right;
- margin-top: 50px;
- padding-right: 37px;
- .item-box{
- width: 167px;
- height: 47px;
- background: #8F6726;
- border-radius: 9px 9px 9px 9px;
- margin-left: 16px;
- font-family: Microsoft YaHei, Microsoft YaHei;
- font-weight: 400;
- font-size: 18px;
- color: #FFFFFF;
- text-align: center;
- image{
- width: 24px;
- height: 24px;
- margin-right:10px ;
- }
- }
- }
- .center-box{
- width: 100%;
- display: flex;
- align-items: center;
- justify-content: center;
- &.flex-box{
- flex-direction: column;
- .bg-item:last-child{
- margin-left: 0px;
- margin-top: 40px;
- }
- }
- .bg-item{
- width: 504px;
- height: 267px;
- padding: 41px;
- border-radius: 16px;
- background-image:url(/static/image/device/tzbs_bg.png);
- background-repeat: no-repeat;
- background-size: 100% 100%;
- &:last-child{
- margin-left: 40px;
- background-image:url(/static/image/device/khgl_bg.png);
- }
- .title{
- font-family: Source Han Serif CN, Source Han Serif CN;
- font-weight: bold;
- font-size: 39px;
- color: #FFFFFF;
- text-align: left;
- }
- .more{
- margin-top: 15px;
- width: 89px;
- height: 30px;
- background: #FFFFFF;
- border-radius: 6px 6px 6px 6px;
- display: flex;
- align-items: center;
- justify-content: center;
- background: #FFFFFF;
- text-align: center;
- text{
- font-family: PingFang SC, PingFang SC;
- font-weight: 400;
- font-size: 16px;
- color: #A14212;
- }
- }
- }
-
- }
- .footer{
- width: 100%;
- display: flex;
- align-items: center;
- justify-content: center;
- // position: absolute;
- padding-bottom:50px;
- view{
- font-family: PingFang SC, PingFang SC;
- font-weight: 400;
- font-size: 20px;
- color: #8F6726;
- text-align: center;
- &:last-child{
- margin-left: 40px;
- }
- }
- }
- }
- .checkbox {
- // margin: 20px;
- margin-top: 20px;
- display: flex;
- // flex-direction: row;
- align-items: center;
- // justify-content: flex-start;
- font-family: PingFang SC, PingFang SC;
- font-weight: 400;
- font-size: 18px;
- color: #999999;
- // line-height: 38px;
- text-align: left;
- flex-direction: column;
- .uni-label-pointer{
- display: flex;
- // flex-direction: row;
- align-items: center;
- }
- text {
- color: #3BABAF;
- }
- &-icon {
- flex-shrink: 0;
-
- image {
- height: 24px;
- width: 24px;
- margin-right: 10px;
- }
- }
- &-text{
- font-family: PingFang SC, PingFang SC;
- font-weight: 400;
- font-size: 22px;
- color: #333333;
- }
- .btn{
- display: flex;
- align-items: center;
- justify-content: center;
- width: 535px;
- height: 95px;
- background: #37C3A0;
- border-radius: 158px 158px 158px 158px;
- font-family: PingFang SC, PingFang SC;
- font-weight: 600;
- font-size: 40px;
- color: #FFFFFF;
- margin-bottom: 40px;
- }
- }
- // @media screen and (max-width: 1149px) and (min-aspect-ratio: 1/1) {
- // .bg-item{
- // margin-left: 0 !important;
- // transform: scale(0.85);
- // }
- // .content .logo{
- // transform: scale(0.9);
- // }
- // }
- </style>
|