yuantianjiao 6 年之前
父節點
當前提交
da6e6bb5be

二進制
src/common/icon/title.png 查看文件


+ 47
- 0
src/pages/bodyCheck/App.vue 查看文件

@@ -0,0 +1,47 @@
1
+<template>
2
+  <div id="app" v-if="showPage">
3
+    <router-view></router-view>
4
+  </div>
5
+</template>
6
+
7
+<script>
8
+import '../../common/css/reset.css'
9
+import { mapState, createNamespacedHelpers } from 'vuex'
10
+const { mapActions: actions } = createNamespacedHelpers('userCenter')
11
+
12
+  export default {
13
+    name: 'app',
14
+    data () {
15
+      return {
16
+        showPage: false
17
+      }
18
+    },
19
+    computed: {
20
+      ...mapState({
21
+        userInfo: x => x.userCenter.userInfo,
22
+        org: x => x.app.orgId
23
+      })
24
+    },
25
+    created () {
26
+      if (location.search && this.toolClass.UrlSearch(location.search).code) {
27
+        this.code = this.toolClass.UrlSearch(location.search).code
28
+      } else {
29
+        this.code = null
30
+      }
31
+      this.getUserInfo({ org: this.org, code: this.code }).then(() => {
32
+        this.showPage = true
33
+      })
34
+    },
35
+    methods: {
36
+      ...actions(['getUserInfo'])
37
+    }
38
+  }
39
+</script>
40
+
41
+<style>
42
+  #app {
43
+    width: 100%;
44
+    height: 100%;
45
+    position: relative;
46
+  }
47
+</style>

+ 23
- 0
src/pages/bodyCheck/app.js 查看文件

@@ -0,0 +1,23 @@
1
+import Vue from 'vue'
2
+import App from './App.vue'
3
+import Vant from 'vant'
4
+import 'vant/lib/vant-css/index.css'
5
+import router from './router'
6
+import store from '../../store/index'
7
+import Vuex from 'vuex'
8
+import Ajax from '../../util/ajax'
9
+import api from '../../util/api'
10
+import toolClass from '../../util/util'
11
+
12
+Vue.use(Vant)
13
+Vue.use(Vuex)
14
+Vue.prototype.$api = api
15
+Vue.prototype.$ajax = Ajax
16
+Vue.prototype.toolClass = toolClass
17
+/* eslint-disable no-new */
18
+new Vue({
19
+  el: '#app',
20
+  router,
21
+  store,
22
+  render: h => h(App) 
23
+})

+ 90
- 0
src/pages/bodyCheck/index/index.vue 查看文件

@@ -0,0 +1,90 @@
1
+<template>
2
+  <div class="mainPage">
3
+    <img :src="title" class="title" alt="">
4
+    <div v-if="result && result.length">
5
+      <div class="userInfo flex-h">
6
+        <div class="flex-item">
7
+          <span>{{user.Username}}</span>
8
+          <span>{{user.Sex=='0' ? '先生' : '女士'}}</span>
9
+        </div>
10
+        <div>
11
+          <span>体检时间</span>
12
+          <span>{{toolClass.dateFormat(user.CreateTime)}}</span>
13
+        </div>
14
+      </div>
15
+      <ul>
16
+        <li v-for="(item,index) in result" @click="linkTo(item.ReportUrl)" :key="index" class="flex-h">
17
+            <div class="flex-item">
18
+            <h1>{{item.TypeName}}:</h1>
19
+            <span v-for="(subItem,subIndex) in item.Details" :key="subIndex">{{subItem.SpecName}}({{subItem.CheckName}}):{{subItem.CheckVal}}</span>
20
+            </div>
21
+            <i class="iconfont icon-buoumaotubiao52"></i>
22
+        </li>
23
+      </ul>
24
+      <span class="tip">本报告单仅提供临床参考,不作为诊断依据</span>
25
+      <div class="view-report">
26
+        <i class="iconfont icon-shuoming" style="font-size: 1.2em"></i> <a :href="mainInfo.ReportUrl">点击查看完整报告</a>
27
+      </div>
28
+    </div>
29
+    <div v-else class="nodata">
30
+        暂无体检数据 .
31
+    </div>
32
+
33
+
34
+    <div class="bg-white" :hidden="ishidden">
35
+    </div>
36
+  </div>
37
+</template>
38
+
39
+<script>
40
+// import { Indicator } from 'mint-ui'
41
+import title from '../../../common/icon/title.png'
42
+import { createNamespacedHelpers } from 'vuex'
43
+const { mapState: mapBodyCheckState, mapActions: mapBodyCheckActions } = createNamespacedHelpers('bodyCheck')
44
+export default {
45
+  data() {
46
+    return {
47
+      title,
48
+      ishidden: true
49
+    }
50
+  },
51
+  computed: {
52
+    ...mapBodyCheckState({
53
+      result: x => x.result,
54
+      mainInfo: x => x.mainInfo,
55
+      user: x => x.user
56
+    })
57
+  },
58
+  methods:{
59
+    linkTo(url){
60
+      window.location.href=url
61
+    },
62
+    loaded() {
63
+      var _that = this
64
+      setTimeout(() => {
65
+        // Indicator.close()
66
+        _that.ishidden = true
67
+      }, 500)
68
+    },
69
+  },
70
+  beforeMount() {
71
+    // Indicator.open()
72
+  },
73
+  created() {
74
+    
75
+  }
76
+}
77
+</script>
78
+
79
+<style lang="scss" scoped>
80
+@import "page.scss";
81
+
82
+.bg-white{
83
+  width: 100%;
84
+  height: 100%;
85
+  position: absolute;
86
+  left: 0;
87
+  top: 0;
88
+  background-color: #fff;
89
+}
90
+</style>

+ 111
- 0
src/pages/bodyCheck/index/page.scss 查看文件

@@ -0,0 +1,111 @@
1
+
2
+.mainPage{
3
+  overflow-y: scroll;
4
+  -webkit-overflow-scrolling: touch;
5
+  transform: translateZ(0);
6
+  -webkit-transform: translateZ(0);
7
+  background: #fff;
8
+}
9
+
10
+img.title{
11
+  width: 2rem;
12
+  display: block;
13
+  margin: .44rem auto 0;
14
+}
15
+
16
+.userInfo{
17
+  margin: .2rem auto 0;
18
+}
19
+
20
+.userInfo>div{
21
+  font-size: 0;
22
+  white-space: nowrap;
23
+}
24
+
25
+.userInfo>div:nth-child(1){
26
+  margin-left: .38rem;
27
+}
28
+
29
+.userInfo>div>span{
30
+  font-size: .14rem;
31
+}
32
+
33
+.userInfo>div:nth-child(2){
34
+  margin-right: .38rem;
35
+}
36
+
37
+.userInfo>div>span:nth-child(1){
38
+  font-weight: bold;
39
+  margin-right: .05rem;
40
+}
41
+
42
+ul{
43
+  width: 100%;
44
+  position: relative;
45
+  overflow: visible;
46
+  box-sizing: border-box;
47
+  border-left: .2rem solid transparent;
48
+  border-right: .2rem solid transparent;
49
+}
50
+
51
+ul>li{
52
+  width: 100%;
53
+  position: relative;
54
+  overflow: hidden;
55
+  border-radius: .04rem;
56
+  box-shadow: 0 0 .02rem .02rem rgba(0, 0, 0, .03);
57
+  margin-top: .2rem;
58
+  padding: .12rem 0;
59
+  align-items: center;
60
+}
61
+
62
+ul>li>i{
63
+  font-size: .15rem;
64
+  color: #e0e0e0;
65
+  margin-right: .14rem;
66
+}
67
+
68
+ul>li>div{
69
+  margin-left: .14rem;
70
+  margin-right: .14rem;
71
+}
72
+
73
+ul>li>div>*{
74
+  width: 100%;
75
+  display: block;
76
+  line-height: .2rem;
77
+  font-size: .13rem;
78
+}
79
+
80
+ul>li>div>h1{
81
+  line-height: .22rem;
82
+  font-size: .17rem;
83
+  margin-bottom: .1rem;
84
+}
85
+
86
+.mainPage .tip{
87
+  width: 100%;
88
+  display: block;
89
+  box-sizing: border-box;
90
+  border-left: .2rem solid transparent;
91
+  border-right: .2rem solid transparent;
92
+  line-height: .2rem;
93
+  margin-top: .2rem;
94
+  font-size: .15rem;
95
+  margin-bottom: .2rem;
96
+}
97
+
98
+.mainPage .nodata {
99
+  margin: .5rem .2rem;
100
+  text-align: center;
101
+}
102
+
103
+.mainPage .view-report {
104
+  margin: .2rem;
105
+  text-align: right;
106
+  font-size: 14px;
107
+}
108
+
109
+.mainPage .view-report a {
110
+  color: #2F6CA4;
111
+}

+ 21
- 0
src/pages/bodyCheck/router.js 查看文件

@@ -0,0 +1,21 @@
1
+import Vue from 'vue'
2
+import Router from 'vue-router'
3
+
4
+import index from './index/index'
5
+
6
+Vue.use(Router)
7
+
8
+const router = new Router({
9
+  routes: [{ // 体检首页
10
+    path: '/',
11
+    name: 'index',
12
+    component: index,
13
+    children: []
14
+  }],
15
+})
16
+
17
+router.beforeEach((to, from, next) => {
18
+  next()
19
+})
20
+
21
+export default router

+ 2
- 0
src/pages/user/App.vue 查看文件

@@ -32,6 +32,8 @@ export default {
32 32
     this.getUserInfo({ org: this.org, code: this.code }).then(() => {
33 33
       this.showPage = true
34 34
     })
35
+    // 计算距离方法
36
+    console.log(this.toolClass.getGreatCircleDistance(117.225495, 39.133713, 117.225962, 39.132573))
35 37
   },
36 38
   methods: {
37 39
     ...actions(['getUserInfo'])

+ 12
- 5
src/pages/user/bindMobile/bindMobile.vue 查看文件

@@ -170,10 +170,17 @@ export default {
170 170
       }
171 171
       this.submitData(this.postData).then((res) => {
172 172
         this.$toast(res)
173
-        setTimeout(function(){
174
-          // _that.$router.push({name: 'userCenter'})
175
-          window.history.go(-1)
176
-        },300)
173
+        if (this.$route.query.isLottery) {
174
+          setTimeout(() => {
175
+            const from = this.$route.query.luckshare ? `#/from/${this.$route.query.luckshare}` : ''
176
+            window.location.href = `/game/luckdraw/${from}`
177
+          }, 2000)
178
+        } else {
179
+          setTimeout(function () {
180
+            // _that.$router.push({name: 'userCenter'})
181
+            window.history.go(-1)
182
+          }, 300)
183
+        }
177 184
       })
178 185
     }
179 186
   }
@@ -181,5 +188,5 @@ export default {
181 188
 </script>
182 189
 
183 190
 <style lang="scss" scoped>
184
-@import "page.scss";
191
+@import 'page.scss';
185 192
 </style>

+ 16
- 1
src/pages/user/mainPage/userCenter/index.vue 查看文件

@@ -50,10 +50,14 @@
50 50
           <span>商品订单</span>
51 51
           <i class="iconfont icon-jiantou-right"></i>
52 52
         </div>
53
-        <div class="menu-item flex-h">
53
+        <div class="menu-item flex-h" @click="toBodyCheck">
54 54
           <span>体检报告</span>
55 55
           <i class="iconfont icon-jiantou-right"></i>
56 56
         </div>
57
+        <div class="menu-item flex-h" @click="toLuckdraw">
58
+          <span>抽奖记录</span>
59
+          <i class="iconfont icon-jiantou-right"></i>
60
+        </div>
57 61
       </div>
58 62
     </div>
59 63
   </div>
@@ -109,6 +113,17 @@ export default {
109 113
     toGoodsOrder () {
110 114
       this.$router.push({ name: 'orderList' })
111 115
     },
116
+    toBodyCheck () {
117
+      window.location.href = `/bodyCheck.html#/`
118
+    },
119
+    toLuckdraw () {
120
+      // ^参数约定为97
121
+      let userid = this.userInfo.customer.CustomerId
122
+      let num = Math.floor(Math.random() * 10 + 1) * 100 + Math.floor(Math.random() * 10 + 1) * 10 + Math.floor(Math.random() * 10 + 1)
123
+      num = num >= 1000 ? 999 : num
124
+      userid = parseInt(`${userid}${num}`) ^ 97
125
+      window.location.href = `/game/luckdraw/#/lotteryList?from=${userid}`
126
+    }
112 127
   }
113 128
 }
114 129
 </script>

+ 33
- 0
src/store/bodyCheck/index.js 查看文件

@@ -0,0 +1,33 @@
1
+import Ajax from '../../util/ajax'
2
+import api from '../../util/api'
3
+
4
+export default {
5
+  namespaced: true,
6
+  state: {
7
+    result: [],
8
+    user: {},
9
+    mainInfo: {}
10
+  },
11
+  mutations: {
12
+    updateState(state, payload) {
13
+      Object.keys(payload).forEach(k => (state[k] = payload[k]))
14
+    }
15
+  },
16
+  actions: {
17
+    getBodyCheck (context, data) {
18
+      return new Promise((resolve) => {
19
+        // Ajax(api.user.gymCard.url, {
20
+        //   method: api.user.gymCard.method,
21
+        //   queryData: {
22
+        //     ...data
23
+        //   }
24
+        // }).then(res => {
25
+        //   context.commit('setgymCardList', res)
26
+        //   resolve(res)
27
+        // }).catch((err) => {
28
+        //   reject(err)
29
+        // })
30
+      })
31
+    }
32
+  }
33
+}

+ 3
- 3
src/store/card/index.js 查看文件

@@ -9,7 +9,7 @@ export default {
9 9
     gymCardDetail: ''
10 10
   },
11 11
   mutations: {
12
-    setgymCardList (state, data) { // 设置页面信息
12
+    setgymCardList (state, data) {
13 13
       state.gymCardList = data.list
14 14
     },
15 15
     setgymCardDetail (state, data) {
@@ -42,7 +42,7 @@ export default {
42 42
         })
43 43
       })
44 44
     },
45
-    getgymCardList (context, data) { // 获取课程详情信息
45
+    getgymCardList (context, data) {
46 46
       return new Promise((resolve) => {
47 47
         Ajax(api.user.gymCard.url, {
48 48
           method: api.user.gymCard.method,
@@ -57,7 +57,7 @@ export default {
57 57
         })
58 58
       })
59 59
     },
60
-    getgymCardDetail (context, data) { // 获取课程详情信息
60
+    getgymCardDetail (context, data) {
61 61
       return new Promise((resolve, reject) => {
62 62
         Ajax(api.user.gymCardDetail.url, {
63 63
           method: api.user.gymCardDetail.method,

+ 1
- 0
src/store/index.js 查看文件

@@ -24,6 +24,7 @@ export const modules = {
24 24
   card: () => require('./card/index').default,
25 25
   forbid: () => require('./forbid/index').default,
26 26
   share: () => require('./share/index').default,
27
+  bodyCheck: () => require('./bodyCheck/index').default,
27 28
 }
28 29
 
29 30
 Object.keys(modules).forEach((modKey) => {

+ 24
- 0
src/util/util.js 查看文件

@@ -40,6 +40,30 @@ const toolClass = {
40 40
   getCode: (appid) => {
41 41
     let url = `https://open.weixin.qq.com/connect/oauth2/authorize?appid=${appid}&redirect_uri=${wechatConfig.redirect_uri}&response_type=${wechatConfig.response_type}&scope=${wechatConfig.scope}&state=${wechatConfig.state}#wechat_redirect`
42 42
     window.location.href = url
43
+  },
44
+  /**
45
+   * caculate the great circle distance
46
+   * 经纬度计算距离
47
+   * @param {Object} lat1 精度1
48
+   * @param {Object} lng1 纬度1
49
+   * @param {Object} lat2 精度2
50
+   * @param {Object} lng2 纬度2
51
+   */
52
+
53
+  getGreatCircleDistance: (lat1, lng1, lat2, lng2) => {
54
+    if (lat1 === lat2 && lng1 === lng2) {
55
+      return 0
56
+    }
57
+    var EARTH_RADIUS = 6378137.0//单位M
58
+    var PI = Math.PI
59
+    var radLat1 = lat1 * PI / 180.0
60
+    var radLat2 = lat2 * PI / 180.0
61
+    var a = radLat1 - radLat2
62
+    var b = lng1 * PI / 180.0 - lng2 * PI / 180.0
63
+    var s = 2 * Math.asin(Math.sqrt(Math.pow(Math.sin(a / 2), 2) + Math.cos(radLat1) * Math.cos(radLat2) * Math.pow(Math.sin(b / 2), 2)))
64
+    s = s * EARTH_RADIUS
65
+    s = Math.round(s * 10000) / 10000.0
66
+    return s
43 67
   }
44 68
 }
45 69
 

+ 2
- 1
title.js 查看文件

@@ -1,4 +1,5 @@
1 1
 module.exports = {
2 2
   user: '城的空间',
3
-  sales: '城的空间案场端'
3
+  sales: '城的空间案场端',
4
+  bodyCheck: '城的空间体检'
4 5
 }