From 7e6b8b1eef198ab4de9633288037a23817f9ee39 Mon Sep 17 00:00:00 2001
From: chenyc <501753378@qq.com>
Date: 星期三, 24 五月 2023 22:52:42 +0800
Subject: [PATCH] 45

---
 package-lock.json                                 |   38 ++++
 src/views/login/index.vue                         |    3 
 src/utils/storage.ts                              |    9 +
 src/views/jifenShangCheng/components/gouwuche.vue |    0 
 src/main.ts                                       |   11 
 src/stores/userInfo.ts                            |   18 +
 /dev/null                                         |   39 ----
 src/views/home/index.vue                          |   11 
 package.json                                      |    3 
 src/router/index.ts                               |   27 ++
 src/views/jifenShangCheng/components/dizhi.vue    |  119 +++++++++++++
 src/views/myMine/index.vue                        |   11 
 src/App.vue                                       |   17 -
 src/utils/axios.ts                                |    3 
 src/views/jifenShangCheng/index.vue               |  198 ++++++++++++++++++++++
 15 files changed, 430 insertions(+), 77 deletions(-)

diff --git a/package-lock.json b/package-lock.json
index 44de7d3..a2b7d28 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -8,8 +8,10 @@
       "name": "my-vue-app",
       "version": "0.0.0",
       "dependencies": {
+        "@vant/area-data": "^1.4.1",
         "axios": "^0.26.0",
         "echarts": "^5.3.0",
+        "js-cookie": "^3.0.5",
         "node-sass": "^7.0.3",
         "pinia": "^2.0.11",
         "sass-loader": "^13.0.2",
@@ -20,6 +22,7 @@
         "vue-tsc": "^0.40.13"
       },
       "devDependencies": {
+        "@types/js-cookie": "^3.0.3",
         "@types/node": "^17.0.18",
         "@typescript-eslint/eslint-plugin": "^5.12.0",
         "@typescript-eslint/parser": "^5.12.0",
@@ -406,6 +409,12 @@
       "integrity": "sha512-CuPgU6f3eT/XgKKPqKd/gLZV1Xmvf1a2R5POBOGQa6uv82xpls89HU5zKeVoyR8XzHd1RGNOlQlvUe3CFkjWNQ==",
       "peer": true
     },
+    "node_modules/@types/js-cookie": {
+      "version": "3.0.3",
+      "resolved": "https://registry.npmmirror.com/@types/js-cookie/-/js-cookie-3.0.3.tgz",
+      "integrity": "sha512-Xe7IImK09HP1sv2M/aI+48a20VX+TdRJucfq4vfRVy6nWN8PYPOEnlMRSgxJAgYQIXJVL8dZ4/ilAM7dWNaOww==",
+      "dev": true
+    },
     "node_modules/@types/json-schema": {
       "version": "7.0.11",
       "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.11.tgz",
@@ -616,6 +625,11 @@
         "type": "opencollective",
         "url": "https://opencollective.com/typescript-eslint"
       }
+    },
+    "node_modules/@vant/area-data": {
+      "version": "1.4.1",
+      "resolved": "https://registry.npmmirror.com/@vant/area-data/-/area-data-1.4.1.tgz",
+      "integrity": "sha512-D8zI/rfxREhnIKGoYzsEJZ73fte4JARhFeFftLIH7ynu1sPrCBEgPkLEbwPyvw3VC4JdSIuzaK5uOhu+BcoPXw=="
     },
     "node_modules/@vant/icons": {
       "version": "1.8.0",
@@ -3458,6 +3472,14 @@
       "version": "2.6.4",
       "resolved": "https://registry.npmjs.org/js-base64/-/js-base64-2.6.4.tgz",
       "integrity": "sha512-pZe//GGmwJndub7ZghVHz7vjb2LgC1m8B07Au3eYqeqv9emhESByMXxaEgkUkEqJe87oBbSniGYoQNIBklc7IQ=="
+    },
+    "node_modules/js-cookie": {
+      "version": "3.0.5",
+      "resolved": "https://registry.npmmirror.com/js-cookie/-/js-cookie-3.0.5.tgz",
+      "integrity": "sha512-cEiJEAEoIbWfCZYKWhVwFuvPX1gETRYPw6LlaTKoxD3s2AkXzkCjnp6h0V77ozyqj0jakteJ4YqDJT830+lVGw==",
+      "engines": {
+        "node": ">=14"
+      }
     },
     "node_modules/js-tokens": {
       "version": "4.0.0",
@@ -7060,6 +7082,12 @@
       "integrity": "sha512-CuPgU6f3eT/XgKKPqKd/gLZV1Xmvf1a2R5POBOGQa6uv82xpls89HU5zKeVoyR8XzHd1RGNOlQlvUe3CFkjWNQ==",
       "peer": true
     },
+    "@types/js-cookie": {
+      "version": "3.0.3",
+      "resolved": "https://registry.npmmirror.com/@types/js-cookie/-/js-cookie-3.0.3.tgz",
+      "integrity": "sha512-Xe7IImK09HP1sv2M/aI+48a20VX+TdRJucfq4vfRVy6nWN8PYPOEnlMRSgxJAgYQIXJVL8dZ4/ilAM7dWNaOww==",
+      "dev": true
+    },
     "@types/json-schema": {
       "version": "7.0.11",
       "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.11.tgz",
@@ -7181,6 +7209,11 @@
         "@typescript-eslint/types": "5.36.2",
         "eslint-visitor-keys": "^3.3.0"
       }
+    },
+    "@vant/area-data": {
+      "version": "1.4.1",
+      "resolved": "https://registry.npmmirror.com/@vant/area-data/-/area-data-1.4.1.tgz",
+      "integrity": "sha512-D8zI/rfxREhnIKGoYzsEJZ73fte4JARhFeFftLIH7ynu1sPrCBEgPkLEbwPyvw3VC4JdSIuzaK5uOhu+BcoPXw=="
     },
     "@vant/icons": {
       "version": "1.8.0",
@@ -9291,6 +9324,11 @@
       "resolved": "https://registry.npmjs.org/js-base64/-/js-base64-2.6.4.tgz",
       "integrity": "sha512-pZe//GGmwJndub7ZghVHz7vjb2LgC1m8B07Au3eYqeqv9emhESByMXxaEgkUkEqJe87oBbSniGYoQNIBklc7IQ=="
     },
+    "js-cookie": {
+      "version": "3.0.5",
+      "resolved": "https://registry.npmmirror.com/js-cookie/-/js-cookie-3.0.5.tgz",
+      "integrity": "sha512-cEiJEAEoIbWfCZYKWhVwFuvPX1gETRYPw6LlaTKoxD3s2AkXzkCjnp6h0V77ozyqj0jakteJ4YqDJT830+lVGw=="
+    },
     "js-tokens": {
       "version": "4.0.0",
       "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz",
diff --git a/package.json b/package.json
index e24018e..87c6a6a 100644
--- a/package.json
+++ b/package.json
@@ -25,8 +25,10 @@
     ]
   },
   "dependencies": {
+    "@vant/area-data": "^1.4.1",
     "axios": "^0.26.0",
     "echarts": "^5.3.0",
+    "js-cookie": "^3.0.5",
     "node-sass": "^7.0.3",
     "pinia": "^2.0.11",
     "sass-loader": "^13.0.2",
@@ -37,6 +39,7 @@
     "vue-tsc": "^0.40.13"
   },
   "devDependencies": {
+    "@types/js-cookie": "^3.0.3",
     "@types/node": "^17.0.18",
     "@typescript-eslint/eslint-plugin": "^5.12.0",
     "@typescript-eslint/parser": "^5.12.0",
diff --git a/src/App.vue b/src/App.vue
index 4b75800..f332f7e 100644
--- a/src/App.vue
+++ b/src/App.vue
@@ -6,24 +6,7 @@
 
 
 <script setup lang="ts">
-    import { Session } from '@/utils/storage'
-    import { userInfoStore } from '@/stores/userInfo'
-    import { ajaxPost} from '@/utils/axios'
-    const userInfo = userInfoStore()
-    const token =Session.get('token')
-    // const token='eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJQQVRfU0ZfUEFUMjQ0MTUyMTM4MzcwMjgyN19TRl8iLCJhdXRoIjpbeyJhdXRob3JpdHkiOiJhZG1pbiJ9XSwiaWF0IjoxNjY3MjcwNTc5LCJleHAiOjE2Njc2MzA1Nzl9.3_K8avdonSTtFhPErO0M0JVan0KtnHxdACJno9B-PWg'
-    // console.log('token到底等于机',token)
-    if (token){
-        Session.set('token', token)
-        console.log('token='+Session.get('token '))
-        ajaxPost('/patient/info/getPatientInfo','').then((re:any)=>{
-            console.log(re,'得到患者的信息getUserinfo')
-            userInfo.setPatient(re)
-        })
 
-    } else {
-        console.log('token为空')
-    }
 </script>
 
 <style scoped lang="scss">
diff --git a/src/main.ts b/src/main.ts
index 5c0f178..5e65993 100644
--- a/src/main.ts
+++ b/src/main.ts
@@ -7,9 +7,9 @@
 import 'vant/lib/index.css'
 
 import { Button,Form,DatetimePicker,TreeSelect, Field, CellGroup,Tab, Tabs,Popup ,Col, Row ,Icon,Tabbar,RadioGroup, Radio,Dialog,List,
-    Switch,Calendar,Collapse,CollapseItem
+    Switch,Calendar,Collapse,CollapseItem,ActionBarButton,AddressList,AddressEdit 
     ,TabbarItem,Picker,DropdownMenu,Loading, DropdownItem,Image as VanImage,Tag,Rate,NavBar, Divider,Search, Checkbox, CheckboxGroup, Uploader,
-    Sidebar,SidebarItem,Stepper,Toast, Step, Steps, Cell } from 'vant'
+    Sidebar,SidebarItem,Stepper,Toast, Step, Steps, Cell,Card,ActionBar, ActionBarIcon } from 'vant'
 import { createPinia } from 'pinia'
 // mock数据
 // import './utils/mock'
@@ -19,9 +19,10 @@
 app.use(createPinia())
 
 app.use(Button).use(Form).use(Field).use(CellGroup).use(Tab).use(Tabs).use(Popup).use(Col).use(Row).use(Loading).use(List ).use(Switch)
-    .use(TreeSelect).use(Calendar).use(Icon).use(Tabbar).use(TabbarItem).use(DropdownItem).use(Tag)
+    .use(TreeSelect).use(Calendar).use(Icon).use(Tabbar).use(TabbarItem).use(DropdownItem).use(Tag).use(AddressList)
     .use(VanImage).use(Search).use(DatetimePicker).use(RadioGroup).use(Radio).use(Sidebar).use(SidebarItem).use(Stepper).use(Toast)
-    .use(CollapseItem).use(Collapse).use(Picker).use(DropdownMenu).use(Dialog).use(Divider).
-    use(Rate ).use(NavBar).use(Checkbox).use(CheckboxGroup).use(Uploader).use(Step).use(Steps).use(Cell)
+    .use(CollapseItem).use(Collapse).use(Picker).use(DropdownMenu).use(Dialog).use(Divider).use(ActionBarButton).
+    use(Rate ).use(NavBar).use(Checkbox).use(CheckboxGroup).use(Uploader).use(Step).use(Steps).use(Cell).use(Card).use(ActionBar).use(ActionBarIcon)
+    .use(AddressEdit)
 
 app.mount('#app')
diff --git a/src/router/index.ts b/src/router/index.ts
index 354c883..041d7f3 100644
--- a/src/router/index.ts
+++ b/src/router/index.ts
@@ -2,11 +2,16 @@
     createRouter, createWebHistory, RouteRecordRaw,
 } from 'vue-router'
 import { cancelRequest } from '@/utils/axios'
+import { userInfoStore } from '@/stores/userInfo'
+
+
+import { Session } from '@/utils/storage'
 
 const routes: Array<RouteRecordRaw> = [
     { path: '/login', name: 'login', component: () => import('views/login/index.vue'),meta:{title:'登录'}},
     { path: '/', name: 'Home', component: () => import('views/home/index.vue'),meta:{title:'首页'}},
     { path: '/my', name: 'myMine', component: () => import('views/myMine/index.vue'),meta:{title:'我的'}},
+    { path: '/jifenShangCheng', name: 'jifenShangCheng', component: () => import('views/jifenShangCheng/index.vue'),meta:{title:'积分商城'}},
     { path: '/paiban', name: 'paiban', component: () => import('views/paiban/index.vue'),meta:{title:'透析排班'}},
     { path: '/report', name: 'report', component: () => import('views/report/index.vue'),meta:{title:'检查报告'}},
     { path: '/reportItem', name: 'reportItem', component: () => import('views/report/item/index.vue'),meta:{title:'报告查看'}},
@@ -21,12 +26,30 @@
     routes,
 })
 
-router.beforeEach((to, from, next) => {
+router.beforeEach(async(to, from, next) => {
+    const userInfo = userInfoStore()
+    // 取消所有强求
     cancelRequest()
+    console.log(to,'路由。。。')
+    // 添加title
     if (to.meta.title){
         document.title = to.meta.title
     }
-    next()
+    // 看看有没有toke
+    const token = Session.get('token');
+	console.log(!token)
+    if (to.path === '/login') {
+		next();
+		
+	}else{
+        if (!token){
+            next('/login');
+        }else{
+            console.log('---')
+            await userInfo.setPatientApi()
+            next();
+        }
+    }
 })
 
 export default router
diff --git a/src/stores/userInfo.ts b/src/stores/userInfo.ts
index 9f23958..e7d5b0b 100644
--- a/src/stores/userInfo.ts
+++ b/src/stores/userInfo.ts
@@ -1,6 +1,7 @@
 
 import { defineStore } from 'pinia'
 import { ref } from 'vue'
+import { ajaxPost} from '@/utils/axios'
 // 使用示例一:函数式定义【个人推荐】
 export const userInfoStore = defineStore('userInfo', () => {
     const info = ref({
@@ -14,10 +15,13 @@
             code:'',
             id:'',
             patientCardNo:'',
+            patientOpenId:'',
             patientIdentityNo:'',
             patientName:'',
             patientTelNo:'',
-            patientAvatarIcon:''
+            patientAvatarIcon:'',
+            patientCreditValue:0,
+            clientCode:'',
         },
         pressure:'',
         weight:''
@@ -27,9 +31,15 @@
         info.value.headimgurl=userInfo.headimgurl
         info.value.nickname=userInfo.nickname
     }
-    function setPatient(info:object) {
-        patient.value=info
+    function setPatient(userInfo:object) {
+        patient.value=userInfo
+    }
+    const setPatientApi= async ()=>{
+         const res= await ajaxPost('/patient/info/getPatientInfo','')
+         console.log('-----')
+         console.log(res)
+         setPatient(res)
     }
 
-    return { info,patient,setPatient, setInfo }
+    return { info,patient,setPatient, setInfo,setPatientApi }
 })
diff --git a/src/utils/axios.ts b/src/utils/axios.ts
index 1cb5add..dfaec74 100644
--- a/src/utils/axios.ts
+++ b/src/utils/axios.ts
@@ -8,7 +8,8 @@
 
 let controllers: AbortController[] = []
 
-const BASE_URL = 'https://hemobs.icoldchain.cn'
+// const BASE_URL = 'https://hemobs.icoldchain.cn'
+const  BASE_URL='http://testbs.ihemodialysis.com'
 const TIME_OUT = 10 * 1000
 
 interface IResponseError {
diff --git a/src/utils/storage.ts b/src/utils/storage.ts
index 8dbc873..bc3f3bd 100644
--- a/src/utils/storage.ts
+++ b/src/utils/storage.ts
@@ -1,3 +1,5 @@
+
+import Cookies from "js-cookie"
 /**
  * window.localStorage 浏览器永久缓存
  * @method set 设置永久缓存
@@ -35,19 +37,26 @@
 export const Session = {
     // 设置临时缓存
     set(key: string, val: any) {
+        console.log('设置临时缓存')
+        console.log(key,val)
+        if (key === 'token') return Cookies.set(key, val);
         window.sessionStorage.setItem(key, JSON.stringify(val))
     },
     // 获取临时缓存
     get(key: string) {
+        console.log(Cookies.get(key),key)
+        if (key === 'token') return Cookies.get(key);
         const json: any = window.sessionStorage.getItem(key)
         return JSON.parse(json)
     },
     // 移除临时缓存
     remove(key: string) {
+        if (key === 'token') return Cookies.remove(key);
         window.sessionStorage.removeItem(key)
     },
     // 移除全部临时缓存
     clear() {
+        Cookies.remove('token');
         window.sessionStorage.clear()
     },
 }
diff --git a/src/views/home/index.vue b/src/views/home/index.vue
index 929f9e5..7074ef8 100644
--- a/src/views/home/index.vue
+++ b/src/views/home/index.vue
@@ -117,6 +117,7 @@
         </div>
         <van-tabbar v-model="active" @change="tabChang">
             <van-tabbar-item name="home" icon="like">首页</van-tabbar-item>
+            <van-tabbar-item name="jifen" icon="cart-circle-o">积分商城</van-tabbar-item>
             <van-tabbar-item name="my" icon="manager">我的</van-tabbar-item>
         </van-tabbar>
     </div>
@@ -138,7 +139,9 @@
     const tabChang=(index:any)=>{
         if (index==='home'){
             router.push('/')
-        } else {
+        } else if(index==='jifen') {
+            router.push('jifenShangCheng')
+        }else if(index==='my') {
             router.push('my')
         }
     }
@@ -163,9 +166,9 @@
         }
     )
     onMounted(() => {
-        if (userInfo.info.openid===''){
-            router.push('login')
-        }
+        // if (userInfo.info.openid===''){
+        //     router.push('login')
+        // }
         console.log(userInfo.patient,'患者信息')
         console.log(userInfo.info,'微信账号信息')
     })
diff --git "a/src/views/home/indexb\345\244\207\344\273\275.vue" "b/src/views/home/indexb\345\244\207\344\273\275.vue"
deleted file mode 100644
index 20dc409..0000000
--- "a/src/views/home/indexb\345\244\207\344\273\275.vue"
+++ /dev/null
@@ -1,39 +0,0 @@
-<script lang="ts" setup>
-    import { onMounted,computed } from 'vue'
-    import { ajaxGet } from '@/utils/axios'
-    import { useCounterStore } from '@/stores/counter'
-    import {useRoute} from 'vue-router'
-    const router = useRoute()
-    const counter = useCounterStore()
-    const data={
-        name:'cheng',
-        age:18
-    }
-    // counter.count++
-    const count=computed(()=>{
-        return counter.count
-    })
-    const add=()=>{
-        counter.increment()
-    }
-    const shao=()=>{
-    }
-    onMounted(() => {
-        console.log('初始化',router)
-        const queryInfo=router.query
-        const {code}=queryInfo
-        console.log(code)
-        if (code){
-            ajaxGet('wechat/code',{code}).then((re:any)=>{
-                console.log(re)
-            })
-        }
-    })
-
-</script>
-
-<template>
-    <div class="HomePage"></div>
-</template>
-
-
diff --git a/src/views/jifenShangCheng/components/dizhi.vue b/src/views/jifenShangCheng/components/dizhi.vue
new file mode 100644
index 0000000..c6cf482
--- /dev/null
+++ b/src/views/jifenShangCheng/components/dizhi.vue
@@ -0,0 +1,119 @@
+<template>
+    <div>
+        <van-popup v-model:show="showDizhi" position="bottom" :style="{ height: '100%' }">
+            <van-nav-bar
+                title="收货地址管理"
+                left-text="返回"
+                left-arrow
+                @click-left="onClickLeft"
+                />
+            <van-address-list
+                v-model="chosenAddressId"
+                :list="list"
+                default-tag-text="默认"
+                @add="onAdd"
+                @edit="onEdit"
+                />
+        </van-popup>
+        <van-popup v-model:show="editDizhi" position="bottom" :style="{ height: '100%' }">
+            <van-nav-bar
+                title="编辑地址"
+                left-text="返回"
+                left-arrow
+                @click-left="onClickLeft2"
+                />
+                <van-address-edit
+                    ref="addressEditRef"
+                    :area-list="areaList"
+                    show-delete
+                    show-set-default
+                    show-search-result
+                    :address-info="addressInfo"
+                    :area-columns-placeholder="['请选择', '请选择', '请选择']"
+                    @save="onSave"
+                    @delete="onDelete"
+                />
+        </van-popup>
+    </div>
+</template>
+<script setup lang="ts">
+
+import { Toast } from 'vant';
+import { ref } from 'vue';
+import { areaList } from '@vant/area-data';
+import type { AddressEditInstance } from 'vant';
+name:"dizhibianji"
+const emit = defineEmits(['fanhuiFun'])
+const showDizhi=ref(false)
+const editDizhi=ref(false)
+const addressEditRef = ref<AddressEditInstance>();
+const chosenAddressId = ref('1')
+const addressInfo=ref({
+    name:'',
+    tel:'',
+    province:'',
+    city:"",
+    county:'',
+    addressDetail:'',
+    isDefault:false
+})
+const list =[
+{
+        id: '1',
+        name: '张三',
+        tel: '13000000000',
+        address: '浙江省杭州市西湖区文三路 138 号东方通信大厦 7 楼 501 室',
+        isDefault: true,
+      },
+      {
+        id: '2',
+        name: '李四',
+        tel: '1310000000',
+        address: '浙江省杭州市拱墅区莫干山路 50 号',
+      },
+]
+const openShow=()=>{
+    showDizhi.value=true
+}
+const onClickLeft=()=>{
+    showDizhi.value=false
+}
+const onClickLeft2=()=>{
+    addressEditRef.value?.setAddressDetail('3434343');
+    editDizhi.value=false
+}
+const onAdd = () =>{
+    editDizhi.value=true
+    addressInfo.value={
+        name:'',
+        tel:'17717874345',
+        province:'',
+        city:"",
+        county:'',
+        addressDetail:'',
+        isDefault:false
+    }
+}
+const onEdit = (item:any, index:number) =>{
+    console.log(item)
+    addressInfo.value={
+        name:item.name,
+        tel:item.tel,
+        province:'',
+        city:"",
+        county:'',
+        addressDetail:item.address,
+        isDefault:item.isDefault
+    }
+    editDizhi.value=true
+}
+const onSave = (form:any) => {
+    Toast('save');
+    console.log(form)
+   
+}
+const onDelete = () => Toast('delete');
+defineExpose({
+    openShow
+} )
+</script>
\ No newline at end of file
diff --git a/src/views/jifenShangCheng/components/gouwuche.vue b/src/views/jifenShangCheng/components/gouwuche.vue
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/src/views/jifenShangCheng/components/gouwuche.vue
diff --git a/src/views/jifenShangCheng/index.vue b/src/views/jifenShangCheng/index.vue
new file mode 100644
index 0000000..953a118
--- /dev/null
+++ b/src/views/jifenShangCheng/index.vue
@@ -0,0 +1,198 @@
+<template>
+    <div>
+        <div>
+            <dizhi></dizhi>
+            <van-tree-select
+                :height="height"
+                v-model:main-active-index="activeIndex"
+                :items="items"
+                >
+                <template #content >
+                    <div style="text-align: right; padding-right: 20px; height: 50px; line-height: 30px; color: #409EFF; font-size: 16px;">
+                        <van-icon size="26px" name="cart-circle-o" style="margin-top: 20px;" />
+                    </div>
+                    <div style="border-left: 1px solid rgb(229, 226, 225); background:#f7f8fa;">
+                        <van-card 
+                            style="background: #ffffff;"
+                            v-for="(item) in items[activeIndex].items"
+                            >
+                            <template #desc >
+                               <span style="color:#409EFF; font-size: 1rem;">{{item.itemName}}</span>
+                            </template>
+                            <template #price >
+                               <span style="color: red; font-size: 1rem;">{{item.itemPrice}}¥</span>
+                            </template>
+                            <template #thumb >
+                                <van-image
+                                    fit="contain"
+                                    width="100%"
+                                    height="100%"
+                                    :src="item.itemPhoto"
+                                />
+                            </template>
+                            <template #tags>
+                                <!-- <van-tag plain type="danger">卡片</van-tag> -->
+                            </template>
+
+                            <template #footer>
+                                 <van-icon @click="goumai(item)" size="20" color="red" name="shopping-cart-o" />
+                            </template>
+                            </van-card>
+                    </div>
+                </template>
+            </van-tree-select>
+        </div>
+        <div>
+          
+        </div>
+        <!-- 购买弹框 -->
+        <div>
+            <van-popup v-model:show="show" position="bottom" :style="{ height: '320px' }">
+                <div style="padding-top: 20px;">
+                    <van-row>
+                        <van-col :span="2"  style="height: 60px; line-height: 60px; padding-top: 10px;">
+                            <van-icon size="40px" color="#E6A23C" name="location-o" />
+                        </van-col>
+                        <van-col :span="20" style="font-size: 16px; padding-left: 10px; height: 60px; line-height: 30px;" >
+                            王虎 燎原西路190弄3好107 
+                            <br/>联系电话:17717853034
+                        </van-col>
+                        <van-col :span="2" style="height: 60px; line-height: 60px;"> 
+                            <van-icon size="20px" @click="openDizhi" name="arrow" />
+                        </van-col>
+                    </van-row>
+                </div>
+                <div style="padding-top: 20px;" class="setItem">
+                    <van-card>
+                        <template #desc >
+                            <span style="color:#409EFF; font-size: 1rem;">{{setItem.itemName}}</span>
+                        </template>
+                        <template #price >
+                            <span style="color: red; font-size: 1rem;">{{setItem.itemPrice}}¥</span>
+                        </template>
+                        <template #thumb >
+                            <van-image
+                                fit="contain"
+                                width="100%"
+                                height="100%"
+                                :src="setItem.itemPhoto"
+                            />
+                        </template>
+                        <template #tags>
+                            <br/>
+                            <van-tag style="margin-top: 10px;" plain type="danger">选择人数多</van-tag>
+                        </template>
+
+                        <template #footer>
+                            <span>
+                                <van-icon size="1rem" v-if="setItem.number>1" @click="setItem.number--" name="minus" />
+                            </span>
+                            <span  style="font-size: 1.2rem; margin-left: 1rem; margin-right: 1rem;">
+                                {{setItem.number}}
+                            </span>
+                            <span>
+                                <van-icon size="1rem" @click="setItem.number++" name="plus" />
+                                
+                            </span>
+                        </template>
+                    </van-card>
+                </div>
+                <div style="text-align: right; font-size: 18px; color: red; font-weight: 600; margin-top: 10px;padding-right: 20px;">
+                    小计¥{{setItem.itemPrice*setItem.number}}
+                </div>
+                <van-action-bar>
+                    <van-action-bar-icon icon="revoke" @click="show=false" text="返回" dot />
+                    <van-action-bar-icon icon="cart-o" text="购物车" badge="5" />
+                    <van-action-bar-button type="warning" text="加入购物车" />
+                    <van-action-bar-button type="danger" text="立即购买" />
+                </van-action-bar>
+            </van-popup>
+        </div>
+        <!-- 地址弹框 -->
+        <div>
+            <dizhi :fanhuiFun="feihuDizhi" ref="dizhiRef"></dizhi>
+        </div>
+        <van-tabbar v-model="active" @change="tabChang">
+            <van-tabbar-item name="home" icon="like">首页</van-tabbar-item>
+            <van-tabbar-item name="jifen" icon="cart-circle-o">积分商城</van-tabbar-item>
+            <van-tabbar-item name="my" icon="manager">我的</van-tabbar-item>
+        </van-tabbar>
+    </div>
+</template>
+<script lang="ts" setup>
+import { computed, ref } from 'vue'
+import {useRouter} from 'vue-router'
+import { useWindowSize } from '@vant/use'
+// import dizhiAdmin from '../jifenShangCheng/components/dizhiAdmin.vue'
+import dizhi from '../jifenShangCheng/components/dizhi.vue'
+import { userInfoStore } from '@/stores/userInfo'
+const userInfo = userInfoStore()
+import { ajaxGet ,ajaxPost} from '@/utils/axios'
+import { onMounted } from 'vue'
+const router=useRouter()
+const { width, height } = useWindowSize();
+const dizhiRef=ref()
+const show=ref(false)
+const patientInfo=computed(() => {
+    return userInfo.patient
+})
+const setItem=ref({
+    itemName:'dsd',
+    itemPrice:0,
+    itemPhoto:'',
+    code:'',
+    number:1,
+    id:0
+})
+const activeIndex = ref(0);
+const items=ref([
+    {
+        name:'',
+        text:'',
+        items:[]
+    }
+])
+const active=ref('jifen')
+const tabChang=(index:any)=>{
+    if (index==='home'){
+        router.push('/')
+    } else if(index==='jifen') {
+        router.push('jifenShangCheng')
+    }else if(index==='my') {
+        router.push('my')
+    }
+}
+// 购买
+const goumai=(item:any)=>{
+    console.log(item)
+    setItem.value={
+        itemName:item.itemName,
+        itemPrice:item.itemPrice,
+        code:item.code,
+        number:1,
+        itemPhoto:item.itemPhoto,
+        id:item.id
+    }
+    show.value=true
+}
+// 编辑地址
+const openDizhi=()=>{
+    dizhiRef.value.openShow()
+}
+// 返回地址
+const feihuDizhi=()=>{
+    console.log()
+}
+onMounted(()=>{
+    ajaxPost('/eshop/listItems',`clientCode=${patientInfo.value.patientInfo.clientCode}`).then((re:any)=>{
+        console.log(re.category)
+        const list= re.category
+        items.value =list.map((el:any)=>{
+            el.text=el.name
+            return el
+        })
+        console.log(items.value)
+        
+    })
+})
+</script>
\ No newline at end of file
diff --git a/src/views/login/index.vue b/src/views/login/index.vue
index a71cd46..5c74b1e 100644
--- a/src/views/login/index.vue
+++ b/src/views/login/index.vue
@@ -191,13 +191,14 @@
                         placeholder="请输入登录名"
                         :rules="[{ required: true, message: '请输入登录名' }]"
                     />
+                    <!-- :rules="[{ required: true, message: '请填写密码' }]" -->
                     <van-field
                         v-model="password"
                         type="password"
                         name="密  码"
                         label="密&nbsp&nbsp码"
                         placeholder="6-16位数字或者字母组合"
-                        :rules="[{ required: true, message: '请填写密码' }]"
+                      
                     >
                         <template #button>
                             <van-button size="small" type="default" @click="wjmm">忘记密码</van-button>
diff --git a/src/views/myMine/index.vue b/src/views/myMine/index.vue
index 555359f..7b63cee 100644
--- a/src/views/myMine/index.vue
+++ b/src/views/myMine/index.vue
@@ -19,7 +19,7 @@
             <div style="padding-left: 20px; padding-top: 12px; padding-right: 20px;">
                 <van-row style="border-bottom: 1px solid #F1F1F2;margin-top: 12px;">
                     <van-col span="12" style="margin-bottom: 12px;">患者卡片</van-col>
-                    <van-col span="12" style="text-align: right;padding-right: 25px;"> <van-icon name="arrow" /></van-col>
+                    <van-col span="12" style="text-align: right;padding-right: 5px;"> <van-icon name="arrow" /></van-col>
                 </van-row>
             </div>
 
@@ -28,8 +28,8 @@
                     <div class="div1">{{patientInfo.patientInfo.patientName}}
                         <span class="but">排班提醒</span>
                     </div>
-                    <div class="div2">患者卡号</div>
-                    <div class="div3">{{patientInfo.patientInfo.patientCardNo}} </div>
+                    <div class="div2">卡号:{{patientInfo.patientInfo.patientCardNo}}</div>
+                    <div class="div3" style="color: blue; font-family: cursive; font-size: 16px;">我的积分:{{patientInfo.patientInfo.patientCreditValue}} </div>
                 </van-col>
                 <van-col span="8" class="info8">
                     <div class="img" @click="imgShow">
@@ -158,6 +158,7 @@
         </van-popup>
         <van-tabbar v-model="active" @change="tabChang">
             <van-tabbar-item name="home" icon="like">首页</van-tabbar-item>
+            <van-tabbar-item name="jifen" icon="cart-circle-o">积分商城</van-tabbar-item>
             <van-tabbar-item name="my" icon="manager">我的</van-tabbar-item>
         </van-tabbar>
     </div>
@@ -193,7 +194,9 @@
     const tabChang=(index:any)=>{
         if (index==='home'){
             router.push('/')
-        } else {
+        } else if(index==='jifen') {
+            router.push('jifenShangCheng')
+        }else if(index==='my') {
             router.push('my')
         }
     }

--
Gitblit v1.8.0