修复了部分bug

This commit is contained in:
2025-02-13 10:39:12 +08:00
parent a35ad49431
commit ea0d35007a
24 changed files with 827 additions and 588 deletions

14
.idea/UniappTool.xml generated Normal file
View File

@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="cn.fjdmy.uniapp.UniappProjectDataService">
<option name="basePath" value="$PROJECT_DIR$" />
<option name="generalBasePath" value="$PROJECT_DIR$" />
<option name="manifestPath" value="$PROJECT_DIR$/manifest.json" />
<option name="pagesPath" value="$PROJECT_DIR$/pages.json" />
<option name="scanNum" value="1" />
<option name="type" value="store" />
<option name="uniapp" value="true" />
<option name="uniappHx" value="true" />
<option name="vueVersion" value="2" />
</component>
</project>

View File

@@ -0,0 +1,31 @@
<component name="InspectionProjectProfileManager">
<profile version="1.0">
<option name="myName" value="Project Default" />
<inspection_tool class="HtmlUnknownAttribute" enabled="true" level="WARNING" enabled_by_default="true">
<option name="myValues">
<value>
<list size="1">
<item index="0" class="java.lang.String" itemvalue="class" />
</list>
</value>
</option>
<option name="myCustomValuesEnabled" value="true" />
</inspection_tool>
<inspection_tool class="HtmlUnknownTag" enabled="true" level="WARNING" enabled_by_default="true">
<option name="myValues">
<value>
<list size="7">
<item index="0" class="java.lang.String" itemvalue="nobr" />
<item index="1" class="java.lang.String" itemvalue="noembed" />
<item index="2" class="java.lang.String" itemvalue="comment" />
<item index="3" class="java.lang.String" itemvalue="noscript" />
<item index="4" class="java.lang.String" itemvalue="embed" />
<item index="5" class="java.lang.String" itemvalue="script" />
<item index="6" class="java.lang.String" itemvalue="u-swiper" />
</list>
</value>
</option>
<option name="myCustomValuesEnabled" value="true" />
</inspection_tool>
</profile>
</component>

6
.idea/jsLibraryMappings.xml generated Normal file
View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="JavaScriptLibraryMappings">
<excludedPredefinedLibrary name="uni-api" />
</component>
</project>

6
.idea/vcs.xml generated Normal file
View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="" vcs="Git" />
</component>
</project>

View File

@@ -5,7 +5,6 @@
export default { export default {
// //初始化状态-如果登录过,保持登录状态 // //初始化状态-如果登录过,保持登录状态
onLaunch: async function() { onLaunch: async function() {
// console.log('App Launch')
const version = 4 // 如果当前版本和后台返回的版本一致,那就是审核中,审核通过后 后台设置加1如果后台的比本地的大 那就是生产版本 const version = 4 // 如果当前版本和后台返回的版本一致,那就是审核中,审核通过后 后台设置加1如果后台的比本地的大 那就是生产版本
const res = await getVersion() const res = await getVersion()
const val = Number(res.data.data.value) const val = Number(res.data.data.value)
@@ -30,7 +29,7 @@
// 获取小程序更新机制兼容 // 获取小程序更新机制兼容
if (uni.canIUse('getUpdateManager')) { if (uni.canIUse('getUpdateManager')) {
const updateManager = uni.getUpdateManager() const updateManager = uni.getUpdateManager()
// 检查是否有新版本发布 // 检查是否有新版本发布
@@ -52,7 +51,7 @@
content: '我们已经做了新的优化,请及时更新哦~', content: '我们已经做了新的优化,请及时更新哦~',
showCancel: false, //隐藏取消按钮也可显示取消会走res.cancel然后从新开始提示 showCancel: false, //隐藏取消按钮也可显示取消会走res.cancel然后从新开始提示
success: function(res) { success: function(res) {
//第二次提示后,强制更新 //第二次提示后,强制更新
if (res.confirm) { if (res.confirm) {
// 新的版本已经下载好,调用 applyUpdate 应用新版本并重启 // 新的版本已经下载好,调用 applyUpdate 应用新版本并重启
updateManager.applyUpdate() updateManager.applyUpdate()
@@ -99,7 +98,6 @@
const doctors_id = decodeURIComponent(e.query.scene).split('=') const doctors_id = decodeURIComponent(e.query.scene).split('=')
uni.setStorageSync('doctors_id', st_id[0].split('su_id=')[1]) uni.setStorageSync('doctors_id', st_id[0].split('su_id=')[1])
uni.setStorageSync('st_id', doctors_id[2]) uni.setStorageSync('st_id', doctors_id[2])
console.log(scene, '2222');
// console.log(scene[1], '4444'); // console.log(scene[1], '4444');
} }
// const scene = decodeURIComponent(e.query.scene).split('STORE_QR_CODE_') // const scene = decodeURIComponent(e.query.scene).split('STORE_QR_CODE_')
@@ -120,4 +118,4 @@
/* 注意要写在第一行同时给style标签加入lang="scss"属性 */ /* 注意要写在第一行同时给style标签加入lang="scss"属性 */
@import "uview-ui/index.scss"; @import "uview-ui/index.scss";
@import url("static/iconfont/index.css"); @import url("static/iconfont/index.css");
</style> </style>

18
package-lock.json generated
View File

@@ -1,8 +1,20 @@
{ {
"name": "xk-client-wx",
"lockfileVersion": 3,
"requires": true, "requires": true,
"lockfileVersion": 1, "packages": {
"dependencies": { "": {
"uview-ui": { "dependencies": {
"js-base64": "^3.7.7",
"uview-ui": "^1.8.8"
}
},
"node_modules/js-base64": {
"version": "3.7.7",
"resolved": "https://registry.npmmirror.com/js-base64/-/js-base64-3.7.7.tgz",
"integrity": "sha512-7rCnleh0z2CkXhH67J8K1Ytz0b2Y+yxTPL+/KOJoa20hfnVQ/3/T6W/KflYI4bRHRagNeXeU2bkNGI3v1oS/lw=="
},
"node_modules/uview-ui": {
"version": "1.8.8", "version": "1.8.8",
"resolved": "https://registry.npmmirror.com/uview-ui/-/uview-ui-1.8.8.tgz", "resolved": "https://registry.npmmirror.com/uview-ui/-/uview-ui-1.8.8.tgz",
"integrity": "sha512-Osal3yzXiHor0In9OPTZuXTaqTbDglMZ9RGK/MPYDoQQs+y0hrBCUD0Xp5T70C8i2lLu2X6Z11zJhmsQWMR7Jg==" "integrity": "sha512-Osal3yzXiHor0In9OPTZuXTaqTbDglMZ9RGK/MPYDoQQs+y0hrBCUD0Xp5T70C8i2lLu2X6Z11zJhmsQWMR7Jg=="

View File

@@ -1,5 +1,6 @@
{ {
"dependencies": { "dependencies": {
"js-base64": "^3.7.7",
"uview-ui": "^1.8.8" "uview-ui": "^1.8.8"
} }
} }

View File

@@ -7,14 +7,6 @@
}, },
"pages": [ //pages数组中第一项表示应用启动页参考https://uniapp.dcloud.io/collocation/pages "pages": [ //pages数组中第一项表示应用启动页参考https://uniapp.dcloud.io/collocation/pages
{ {
"path": "pages/home/home",
"style": {
// "navigationBarTitleText": "custom"
"navigationStyle": "default",
"navigationBarBackgroundColor": "#298DFF",
"navigationBarTextStyle": "white"
}
}, {
"path": "pages/home/index", "path": "pages/home/index",
"style": { "style": {
"navigationBarTitleText": "萧康互联网医院", "navigationBarTitleText": "萧康互联网医院",
@@ -24,6 +16,15 @@
}, },
"needLogin": false "needLogin": false
}, },
{
"path": "pages/home/home",
"style": {
// "navigationBarTitleText": "custom"
"navigationStyle": "default",
"navigationBarBackgroundColor": "#298DFF",
"navigationBarTextStyle": "white"
}
},
{ {
"path": "pages/home/index-list", "path": "pages/home/index-list",
"style": { "style": {
@@ -457,4 +458,4 @@
"backgroundColor": "#F8F8F8" "backgroundColor": "#F8F8F8"
}, },
"uniIdRouter": {} "uniIdRouter": {}
} }

View File

@@ -169,7 +169,6 @@
this.show = true this.show = true
} }
console.log(e, 666);
}, },
// 立即购买 // 立即购买
tocartPay() { tocartPay() {
@@ -180,7 +179,6 @@
}, },
//点击药品一级分类 //点击药品一级分类
handleCategory1(e, index) { handleCategory1(e, index) {
console.log('handleCategory1')
this.num = e this.num = e
this.category_first = e - 1 this.category_first = e - 1
this.selectIndex = index this.selectIndex = index
@@ -190,17 +188,12 @@
this.category_second = 7 this.category_second = 7
} }
this.getDrugList() this.getDrugList()
console.log(e);
}, },
//点击药品二级分类 //点击药品二级分类
handleCategory2(e) { handleCategory2(e) {
console.log('handleCategory2', this.selectIndex, this.current)
this.current = e this.current = e
this.category_second = e - 3 this.category_second = e - 3
this.getDrugList() this.getDrugList()
console.log(e);
}, },
//获取药品分类 //获取药品分类
@@ -213,7 +206,6 @@
}).then((res) => { }).then((res) => {
// console.log(res, 'list'); // console.log(res, 'list');
if (res.data.code == 0) { if (res.data.code == 0) {
console.log(res.data.data[0]);
this.drugCategoryLists = res.data.data this.drugCategoryLists = res.data.data
this.category_first = res.data.data.map(x => x.id) this.category_first = res.data.data.map(x => x.id)
this.num = res.data.data[0].id //初始选中 this.num = res.data.data[0].id //初始选中
@@ -234,9 +226,6 @@
// console.log(res, 'list'); // console.log(res, 'list');
if (res.data.code == 0) { if (res.data.code == 0) {
this.drugLists = res.data.data this.drugLists = res.data.data
console.log(res.data)
} }
}) })

View File

@@ -11,11 +11,10 @@ export default {
}, },
onLoad(e) { onLoad(e) {
this.url = decodeURIComponent(e.id) this.url = decodeURIComponent(e.id)
console.log(this.url,'aaaaaaaaaaaa')
// 传入需要跳转的链接 使用web-view标签进行跳转 // 传入需要跳转的链接 使用web-view标签进行跳转
} }
} }
</script> </script>
<style> <style>
</style> </style>

View File

@@ -150,45 +150,35 @@
], ],
info: [], info: [],
bgShow: false, bgShow: false,
isShow_envVersion: false isShow_envVersion: true
} }
}, },
onLoad() { onLoad() {
setInterval(() => {
this.isShow_envVersion = uni.getStorageSync('isShow_envVersion') const token = uni.getStorageSync('token')
if (this.isShow_envVersion == false) { const userInfo = uni.getStorageSync('userinfo')
if (this.doctorList.length == 0) { if (!token || !userInfo) {
this.getList(); // 跳转到登录页,不要返回的
} uni.navigateTo({
url: '/pages/home/index'
})
}
this.isShow_envVersion = uni.getStorageSync('isShow_envVersion')
if (this.isShow_envVersion === false) {
if (this.doctorList.length === 0) {
this.getList();
} }
}, 500) }
}, },
created() { created() {
const token = uni.getStorageSync('token') const token = uni.getStorageSync('token')
const userInfo = uni.getStorageSync('userinfo') const userInfo = uni.getStorageSync('userinfo')
setTimeout(function () { if (!token || !userInfo) {
if (!token || !userInfo) { // 跳转到登录页,不要返回的
// console.log('token'); uni.navigateTo({
// if (this.isShow_envVersion) { url: '/pages/home/index'
// uni.navigateTo({ })
// url: '/pages/home/index' }
// })
// } else {
// uni.navigateTo({
// url: '/pages/login/login'
// })
// }
// uni.navigateTo({
// url: '/pages/home/index'
// })
// 跳转到登录页,不要返回的
uni.navigateTo({
url: '/pages/login/login'
})
}
}, 300)
}, },
onReady() { onReady() {
@@ -228,6 +218,13 @@
}, },
// 线上复诊 // 线上复诊
golist() { golist() {
// 提醒用户正在开发
uni.showToast({
title: '正在开发中',
icon: 'none',
duration: 2000
})
return;
// this.bgShow = true // this.bgShow = true
let that = this let that = this
if (!this.flag) { if (!this.flag) {
@@ -274,7 +271,6 @@
}, },
}).then((res) => { }).then((res) => {
if (res.data.errcode == 0) { if (res.data.errcode == 0) {
console.log(res.data.data.token, 'h5-token');
// uni.setStorageSync('platform_id', res.data.data.platform_id) // uni.setStorageSync('platform_id', res.data.data.platform_id)
uni.setStorageSync('token_platform_id', res.data.data.token) uni.setStorageSync('token_platform_id', res.data.data.token)
} else { } else {
@@ -351,17 +347,15 @@
uni.setNavigationBarTitle({ uni.setNavigationBarTitle({
title: this.headerTitle, title: this.headerTitle,
success() { success() {
console.log(7777);
}, },
fail() { fail() {
console.log(77888);
this.getStore() this.getStore()
} }
}); });
uni.setNavigationBarColor({ uni.setNavigationBarColor({
frontColor: '#000000', //前景颜色值,包括按钮、标题、状态栏的颜色,仅支持 #ffffff 和 #000000 frontColor: '#000000', //前景颜色值,包括按钮、标题、状态栏的颜色,仅支持 #ffffff 和 #000000
}) })
this.getList(); // this.getList();
this.getBannered(); this.getBannered();
} }
}) })
@@ -391,13 +385,12 @@
uni.setNavigationBarTitle({ uni.setNavigationBarTitle({
title: this.headerTitle, title: this.headerTitle,
success() { success() {
console.log(3333);
} }
}); });
uni.setNavigationBarColor({ uni.setNavigationBarColor({
frontColor: '#000000', //前景颜色值,包括按钮、标题、状态栏的颜色,仅支持 #ffffff 和 #000000 frontColor: '#000000', //前景颜色值,包括按钮、标题、状态栏的颜色,仅支持 #ffffff 和 #000000
}) })
this.getList(); // this.getList();
this.getBannered(); this.getBannered();
} }
@@ -408,9 +401,9 @@
url: '/pages/home/index' url: '/pages/home/index'
}) })
} else { } else {
uni.navigateTo({ uni.navigateTo({
url: '/pages/login/login' url: '/pages/home/index'
}) })
} }
} }
}) })
@@ -425,17 +418,19 @@
// 医生列表 // 医生列表
getList() { getList() {
doctorList({ if (this.doctorList?.length <= 0) {
method: "post", doctorList({
data: { method: "post",
store_id: uni.getStorageSync('stores_id') || uni.getStorageSync('store_id') || '11001', data: {
} store_id: uni.getStorageSync('stores_id') || uni.getStorageSync('store_id') || '11001',
}).then((res) => { }
// console.log(res, 'list'); }).then((res) => {
if (res.data.errcode == 0) { // console.log(res, 'list');
this.doctorList = (res.data.data.list).slice(0, 3) if (res.data.errcode === 0) {
} this.doctorList = (res.data.data.list).slice(0, 3)
}) }
})
}
}, },
// 切换门店 // 切换门店
@@ -984,4 +979,4 @@
} }
} }
} }
</style> </style>

View File

@@ -56,34 +56,33 @@
</view> </view>
<view class="doctor_list" v-if="isShow_envVersion" @click="gologin"> <!-- <view class="doctor_list" v-if="isShow_envVersion" @click="gologin">-->
商品列表 <!-- 商品列表-->
<view class="info"> <!-- <view class="info">-->
更多 <text class="iconfont icon-jiantou1"></text> <!-- 更多 <text class="iconfont icon-jiantou1"></text>-->
</view> <!-- </view>-->
</view> <!-- </view>-->
<!-- 医生列表 --> <!-- 医生列表 -->
<view class="list" @click="gologin" v-if="isShow_envVersion"> <!-- <view class="list" @click="gologin" v-if="isShow_envVersion">-->
<!-- 图片部分 --> <!-- &lt;!&ndash; 图片部分 &ndash;&gt;-->
<view class="list_info"> <!-- <view class="list_info">-->
<view class="list_left"> <!-- <view class="list_left">-->
<image src="https://p3.maiyaole.com/img/971/971752/org_org.jpg?v=1" mode=""></image> <!-- <image src="https://p3.maiyaole.com/img/971/971752/org_org.jpg?v=1" mode=""></image>-->
<view class="it"> <!-- <view class="it">-->
<view class="it_name">日康对乙酰氨基酚片0.3g*12*2/</view> <!-- <view class="it_name">日康对乙酰氨基酚片0.3g*12*2/</view>-->
<view class="it_info">清热解毒,咽喉肿痛,牙痛</view> <!-- <view class="it_info">清热解毒,咽喉肿痛,牙痛</view>-->
<view class="it_price"> <!-- <view class="it_price">-->
<text>34.00</text> <!-- <text>34.00</text>-->
<text class="num">x1</text> <!-- <text class="num">x1</text>-->
</view> <!-- </view>-->
</view> <!-- </view>-->
</view> <!-- </view>-->
</view> <!-- </view>-->
<!-- </view>-->
</view> <!-- <view class="list" @click="gologin" v-if="isShow_envVersion">
&lt;!&ndash; 图片部分 &ndash;&gt;
<view class="list" @click="gologin" v-if="isShow_envVersion">
<!-- 图片部分 -->
<view class="list_info"> <view class="list_info">
<view class="list_left"> <view class="list_left">
<image src="https://p2.maiyaole.com/img/item/202210/24/202210241042513.jpg" mode=""></image> <image src="https://p2.maiyaole.com/img/item/202210/24/202210241042513.jpg" mode=""></image>
@@ -98,7 +97,7 @@
</view> </view>
</view> </view>
</view> </view>-->
<view class="" v-if="isShow_envVersion==false"> <view class="" v-if="isShow_envVersion==false">
<view class="lists" @click="gologin" v-for="(item,index) in doctorList" :key="item.id"> <view class="lists" @click="gologin" v-for="(item,index) in doctorList" :key="item.id">
@@ -163,10 +162,20 @@
onLoad() { onLoad() {
setInterval(() => { setInterval(() => {
this.isShow_envVersion = uni.getStorageSync('isShow_envVersion') this.isShow_envVersion = uni.getStorageSync('isShow_envVersion')
}, 500) })
}, },
created() { created() {
// 如果有token存着就跳转到home
if (uni.getStorageSync('token')) {
// 如果有token存着就跳转到home
uni.reLaunch({
url: "/pages/home/home",
success() {
uni.hideLoading();
}
})
}
}, },
methods: { methods: {
gologin() { gologin() {
@@ -212,7 +221,6 @@
store_id: uni.getStorageSync('stores_id') || '11001', store_id: uni.getStorageSync('stores_id') || '11001',
} }
}).then((res) => { }).then((res) => {
console.log(res, 'info');
if (res.data.errcode == 0) { if (res.data.errcode == 0) {
this.info = res.data.data this.info = res.data.data
this.list = (res.data.data.nav).map((item) => { this.list = (res.data.data.nav).map((item) => {
@@ -616,4 +624,4 @@
} }
} }
} }
</style> </style>

View File

@@ -1,397 +1,379 @@
<template> <template>
<view class="container safe-area-inset-bottom"> <view class="container safe-area-inset-bottom">
<view class="none"> <view class="none">
<!-- 授权登录 --> <!-- 授权登录 -->
<view class="conter"> <view class="conter">
<view class="title"> <view class="title">
欢迎登录 欢迎登录
</view> </view>
<image src="@/static/empty/login.png" mode="aspectFit"></image> <image src="@/static/empty/login.png" mode="aspectFit"></image>
<button class="btn" :class="form['check']?'':'bg'" :disabled="!form['check']" open-type="getPhoneNumber" <!-- <button class="btn" :class="form['check']?'':'bg'" :disabled="!form['check']" open-type="getPhoneNumber"-->
@getphonenumber="getToLogin">手机号一键登录</button> <!-- @getphonenumber="getToLogin">手机号一键登录</button>-->
<button class="btn" :class="form['check']?'':'bg'" :disabled="!form['check']"
@click="getToLogin">一键登录</button>
<view class="word"> <view class="word">
<u-icon size="35" :color="form['check']?'#2979FF':'#E5E5E5'" name="checkmark-circle-fill" <u-icon size="35" :color="form['check']?'#2979FF':'#E5E5E5'" name="checkmark-circle-fill"
@click="form['check']=!form['check']"></u-icon> @click="form['check']=!form['check']"></u-icon>
<view class="agreement"> <view class="agreement">
我已阅读并同意 我已阅读并同意
<text @click="getInfo(1)">用户服务协议</text> <text @click="getInfo(1)">用户服务协议</text>
<text @click="getInfo(2)">隐私政策</text> <text @click="getInfo(2)">隐私政策</text>
</view> </view>
</view> </view>
<view class="text" @click="back">取消登录</view> <view class="text" @click="back">取消登录</view>
<!-- <view class="footer" @click="toLogon"> <!-- <view class="footer" @click="toLogon">
输入其他手机号码注册 输入其他手机号码注册
</view> --> </view> -->
</view> </view>
</view> </view>
<u-popup v-model="show" :safe-area-inset-bottom="true" mode="bottom" height="88%" border-radius="20" <u-popup v-model="show" :safe-area-inset-bottom="true" mode="bottom" height="88%" border-radius="20"
:closeable="true"> :closeable="true">
<view class="agreen"> <view class="agreen">
<u-parse :html="content"></u-parse> <u-parse :html="content"></u-parse>
</view> </view>
</u-popup> </u-popup>
<u-toast ref="uToast" /> <u-toast ref="uToast" />
</view> </view>
</template> </template>
<script> <script>
import { import {
getAgreem, getAgreem,
getLogin, getLogin,
getsLogin getsLogin
} from '../../request/api/api.js' } from '../../request/api/api.js'
export default { export default {
data() { data() {
return { return {
code: "", code: "",
form: { form: {
check: false check: false
}, },
encryptedData: "", encryptedData: "",
iv: "", iv: "",
session_key: "", session_key: "",
show: false, show: false,
content: ``, content: ``,
type: 1, type: 1,
id: 1, id: 1,
isShow_envVersion: uni.getStorageSync('isShow_envVersion') isShow_envVersion: uni.getStorageSync('isShow_envVersion')
} }
}, },
onLoad(e) { onLoad(e) {
this.type = e.type this.type = e.type
this.id = e.id this.id = e.id
uni.removeStorageSync('token') uni.removeStorageSync('token')
uni.removeStorageSync('userinfo') uni.removeStorageSync('userinfo')
}, },
created() { created() {
},
methods: {
back() {
uni.navigateBack({ delta: 1 })
},
getPhoneNumber(e) {
uni.showLoading({
title: "加载中"
});
if (!this.form['check']) { },
uni.showToast({ methods: {
icon: "error", back() {
title: '请勾选协议'
})
return
}
if (e.detail.errMsg && e.detail.errMsg == 'getPhoneNumber:fail user deny') { uni.navigateTo({
// uni.showToast({ url: "/pages/home/index",
// icon: "error", fail: (e) => {
// title: '未获取手机号码' // console.log(e);
// }) },
this.$refs.uToast.show({ success() {
title: '未获取手机号码', }
type: 'default', })
icon: false // uni.navigateBack({ delta: 1 })
}) },
return getPhoneNumber(e) {
} uni.showLoading({
title: "加载中"
});
this.encryptedData = e.detail.encryptedData; //需要解密的内容 if (!this.form['check']) {
this.iv = e.detail.iv; //偏移量 uni.showToast({
this.code = e.detail.code icon: "error",
// console.log(e); title: '请勾选协议'
})
return
}
let data = { if (e.detail.errMsg && e.detail.errMsg == 'getPhoneNumber:fail user deny') {
iv: this.iv, // uni.showToast({
encryptedData: this.encryptedData, // icon: "error",
code: this.code, // title: '未获取手机号码'
store_id: '11001' // })
} this.$refs.uToast.show({
getLogin({ title: '未获取手机号码',
method: 'post', type: 'default',
data: data icon: false
}).then((res) => { })
// console.log(res, 'login'); return
if (res.data.errcode == 0) { }
if (this.type == 1) {
uni.navigateTo({
url: "/pages/home/index-list?id=" + this.id,
fail: (e) => {
// console.log(e);
},
success() {
uni.showToast({
title: '登陆成功',
duration: 2000
});
uni.hideLoading();
}
})
return
}
// 进入h5 token是登录返回的platform_token user_id是萧康的用户id
uni.setStorageSync('token_h5', res.data.data.plate_token)
// setTimeout(() => { this.encryptedData = e.detail.encryptedData; //需要解密的内容
// this.getH5(); this.iv = e.detail.iv; //偏移量
// }, 100) this.code = e.detail.code
uni.reLaunch({ // console.log(e);
url: "/pages/home/home",
fail: (e) => {
// console.log(e);
},
success() {
uni.showToast({
title: '登陆成功',
duration: 2000
});
uni.hideLoading();
}
})
} else {
uni.showToast({
icon: "error",
title: res.data.msg
})
}
})
},
toLogon() { let data = {
uni.navigateTo({ iv: this.iv,
url: '/pages/login/logon', encryptedData: this.encryptedData,
fail: function(res) { code: this.code,
// console.log(res); store_id: '11001'
} }
}) getLogin({
}, method: 'post',
data: data
}).then((res) => {
// console.log(res, 'login');
if (res.data.errcode == 0) {
if (this.type == 1) {
uni.navigateTo({
url: "/pages/home/index-list?id=" + this.id,
fail: (e) => {
// console.log(e);
},
success() {
uni.showToast({
title: '登陆成功',
duration: 2000
});
uni.hideLoading();
}
})
return
}
// 进入h5 token是登录返回的platform_token user_id是萧康的用户id
uni.setStorageSync('token_h5', res.data.data.plate_token)
// 协议 // setTimeout(() => {
getInfo(e) { // this.getH5();
this.show = true // }, 100)
uni.reLaunch({
url: "/pages/home/home",
fail: (e) => {
// console.log(e);
},
success() {
uni.showToast({
title: '登陆成功',
duration: 2000
});
uni.hideLoading();
}
})
} else {
uni.showToast({
icon: "error",
title: res.data.msg
})
}
})
},
getAgreem({ toLogon() {
method: "post", uni.navigateTo({
data: { url: '/pages/login/logon',
end: 1, fail: function(res) {
store_id: uni.getStorageSync('store_id') || '11001', // console.log(res);
} }
}).then((res) => { })
// console.log(res); },
if (e == 1) { // 协议
this.content = res.data.data[0].content getInfo(e) {
} else { this.show = true
this.content = res.data.data[1].content
}
})
},
getToLogin(e) { getAgreem({
uni.login({ method: "post",
provider: 'weixin', data: {
success: (loginRes) => { end: 1,
this.code = loginRes.code store_id: uni.getStorageSync('store_id') || '11001',
// console.log(loginRes.code); }
getsLogin({ }).then((res) => {
method: "post", // console.log(res);
data: {
code: this.code, if (e == 1) {
status: 1 this.content = res.data.data[0].content
} } else {
}).then((res) => { this.content = res.data.data[1].content
// console.log(res, "res"); }
if (res.data.errcode == 0) { })
uni.setStorageSync('token', res.data.data.token) //存储token },
uni.setStorageSync('user_id', res.data.data.data.user.id)
uni.setStorageSync('userinfo', res.data.data.data['user']) getToLogin(e) {
uni.setStorageSync('store_id', res.data.data.data.store_id) uni.login({
provider: 'weixin',
success: (loginRes) => {
this.code = loginRes.code
// console.log(loginRes.code);
getsLogin({
method: "post",
data: {
code: this.code,
status: 1
}
}).then((res) => {
// console.log(res, "res");
if (res.data.errcode == 0) {
uni.setStorageSync('token', res.data.data.token) //存储token
uni.setStorageSync('user_id', res.data.data.data.user.id)
uni.setStorageSync('userinfo', res.data.data.data['user'])
uni.setStorageSync('store_id', res.data.data.data.store_id)
if (res.data.data.data.user.mobile != '') { if (res.data.data.data.user.mobile != '') {
setTimeout(function () { setTimeout(function () {
uni.reLaunch({ uni.reLaunch({
url: '/pages/home/home' url: '/pages/home/home'
}) })
}, 500) }, 500)
} else { } else {
this.getPhoneNumber(e); // this.getPhoneNumber(e);
} }
} else if (res.data.errcode != 0) { } else if (res.data.errcode != 0) {
// uni.showToast({ // uni.showToast({
// icon: "error", // icon: "error",
// title: res.data.msg // title: res.data.msg
// }) // })
this.$refs.uToast.show({ this.$refs.uToast.show({
title: res.data.msg, title: res.data.msg,
type: 'default', type: 'default',
icon: false icon: false
}) })
} }
}) })
} }
}) })
}, },
},
// subScriptionMessage() { mounted() {
const token = uni.getStorageSync('token')
// }, const user_id = uni.getStorageSync('user_id')
const userInfo = uni.getStorageSync('userinfo')
// getH5() { const token_h5 = uni.getStorageSync('token_h5')
// // 进入token if (token && user_id && userInfo && token_h5) {
// uni.request({ uni.reLaunch({
// url: 'https://hy.api.ctkj88.com/platform/v1/user/login', url: "/pages/home/home",
// header: { })
// "authorization": uni.getStorageSync( } else {
// "token_h5"), uni.removeStorageSync('token')
// "Content-Type": "application/x-www-form-urlencoded" uni.removeStorageSync('user_id')
// }, }
// method: 'POST', }
// timeout: 10000, }
// data: {
// user_id: uni.getStorageSync('user_id')
// },
// success: (res) => {
// // console.log(res, 'h5-token');
// // uni.setStorageSync('platform_id', res.data.data.platform_id)
// uni.setStorageSync('token_platform_id', res.data.data.token)
// },
// fail(res) {
// // console.log(res, 'fail-h5');
// }
// })
// }
},
mounted() {
const token = uni.getStorageSync('token')
const user_id = uni.getStorageSync('user_id')
const userInfo = uni.getStorageSync('userinfo')
const token_h5 = uni.getStorageSync('token_h5')
if (token && user_id && userInfo && token_h5) {
uni.reLaunch({
url: "/pages/home/home",
})
} else {
uni.removeStorageSync('token')
uni.removeStorageSync('user_id')
}
}
}
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.text { .text {
margin-top: 20rpx; margin-top: 20rpx;
color: #666; color: #666;
} }
.container { .container {
width: 100vw; width: 100vw;
height: 100vh; height: 100vh;
padding-bottom: env(safe-area-inset-bottom); padding-bottom: env(safe-area-inset-bottom);
.none { .none {
width: 750rpx; width: 750rpx;
padding-top: 100rpx; padding-top: 100rpx;
background: linear-gradient(180deg, #EAF2FF 0%, #FFFFFF 100%); background: linear-gradient(180deg, #EAF2FF 0%, #FFFFFF 100%);
.conter { .conter {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
margin: 0rpx auto 380rpx; margin: 0rpx auto 380rpx;
image { image {
width: 431rpx; width: 431rpx;
height: 339rpx; height: 339rpx;
vertical-align: middle; vertical-align: middle;
margin-bottom: 110rpx; margin-bottom: 110rpx;
} }
.title { .title {
font-size: 48rpx; font-size: 48rpx;
font-family: PingFang SC-Regular, PingFang SC; font-family: PingFang SC-Regular, PingFang SC;
font-weight: 400; font-weight: 400;
color: #232323; color: #232323;
margin-bottom: 114rpx; margin-bottom: 114rpx;
} }
.word { .word {
display: flex; display: flex;
flex-direction: row; flex-direction: row;
color: #475569; color: #475569;
font-size: 28rpx; font-size: 28rpx;
font-family: PingFang SC-Regular, PingFang SC; font-family: PingFang SC-Regular, PingFang SC;
font-weight: 400; font-weight: 400;
margin-top: 34rpx; margin-top: 34rpx;
.agreement { .agreement {
font-size: 24rpx; font-size: 24rpx;
font-family: PingFang SC-Regular, PingFang SC; font-family: PingFang SC-Regular, PingFang SC;
font-weight: 400; font-weight: 400;
color: #6C7380; color: #6C7380;
margin-left: 16rpx; margin-left: 16rpx;
text { text {
color: #2979FF; color: #2979FF;
size: 24rpx; size: 24rpx;
} }
} }
} }
.footer { .footer {
width: 710rpx; width: 710rpx;
height: 90rpx; height: 90rpx;
line-height: 90rpx; line-height: 90rpx;
position: fixed; position: fixed;
bottom: 60rpx; bottom: 60rpx;
left: 0; left: 0;
text-align: center; text-align: center;
font-size: 26rpx; font-size: 26rpx;
font-family: PingFang SC-Regular, PingFang SC; font-family: PingFang SC-Regular, PingFang SC;
font-weight: 400; font-weight: 400;
color: #232323; color: #232323;
margin: 0 auto; margin: 0 auto;
} }
.btn { .btn {
width: 648rpx; width: 648rpx;
height: 88rpx; height: 88rpx;
background: #4175EE; background: #4175EE;
line-height: 88rpx; line-height: 88rpx;
font-size: 32rpx; font-size: 32rpx;
text-align: center; text-align: center;
font-family: PingFang SC-Medium, PingFang SC; font-family: PingFang SC-Medium, PingFang SC;
font-weight: 400; font-weight: 400;
color: #FFFFFF; color: #FFFFFF;
border-radius: 64rpx; border-radius: 64rpx;
} }
.bg { .bg {
width: 648rpx; width: 648rpx;
height: 88rpx; height: 88rpx;
background: #8ABAFF; background: #8ABAFF;
line-height: 88rpx; line-height: 88rpx;
font-size: 32rpx; font-size: 32rpx;
text-align: center; text-align: center;
font-family: PingFang SC-Medium, PingFang SC; font-family: PingFang SC-Medium, PingFang SC;
font-weight: 400; font-weight: 400;
color: #FFFFFF; color: #FFFFFF;
border-radius: 64rpx; border-radius: 64rpx;
} }
} }
} }
.agreen { .agreen {
padding: 60rpx 50rpx 20rpx; padding: 60rpx 50rpx 20rpx;
} }
} }
</style> </style>

22
pnpm-lock.yaml generated Normal file
View File

@@ -0,0 +1,22 @@
lockfileVersion: '9.0'
settings:
autoInstallPeers: true
excludeLinksFromLockfile: false
importers:
.:
dependencies:
uview-ui:
specifier: ^1.8.8
version: 1.8.8
packages:
uview-ui@1.8.8:
resolution: {integrity: sha512-Osal3yzXiHor0In9OPTZuXTaqTbDglMZ9RGK/MPYDoQQs+y0hrBCUD0Xp5T70C8i2lLu2X6Z11zJhmsQWMR7Jg==, tarball: https://registry.npmmirror.com/uview-ui/-/uview-ui-1.8.8.tgz}
snapshots:
uview-ui@1.8.8: {}

View File

@@ -1,6 +1,6 @@
import http from './request' import http from './request'
// 登录 授权 其他手机号授权 // 登录 授权 其他手机号授权
export async function getsLogin(params) { export async function getsLogin(params) {
let data = await http('/oldApi/v1/user/login', params) let data = await http('/oldApi/v1/user/login', params)
return data return data
@@ -19,7 +19,7 @@ export async function getCodes(params) {
return data return data
} }
// 登录 // 登录
export async function getLogon(params) { export async function getLogon(params) {
let data = await http('/oldApi/v1/user/phone-number', params) let data = await http('/oldApi/v1/user/phone-number', params)
return data return data
@@ -281,7 +281,7 @@ export async function getseesionRead(params) {
return data return data
} }
// 消息-医生信息列表 // 消息-医生信息列表
export async function getseesionDoctorList(params) { export async function getseesionDoctorList(params) {
let data = await http('/oldApi/v1/system-notice/doctor-news', params) let data = await http('/oldApi/v1/system-notice/doctor-news', params)
return data return data
@@ -412,7 +412,7 @@ export async function PayList(params) {
let data = await http('/newApi/order/submit', params) let data = await http('/newApi/order/submit', params)
return data return data
} }
//获取支付配置 //获取支付配置
// export async function getPayConfig(params) { // export async function getPayConfig(params) {
// let data = await http('/newApi/order/getPay', params) // let data = await http('/newApi/order/getPay', params)
// return data // return data
@@ -428,7 +428,7 @@ export async function getPayConfig(params) {
// return data // return data
// } // }
// 取消订单 https://app.xiaokang88.com/member/v1/product-order/cancel // 取消订单 https://app.xiaokang88.com/member/v1/product-order/cancel
export async function getCancle(params) { export async function getCancle(params) {
let data = await http('/oldApi/v1/product-order/cancel', params) let data = await http('/oldApi/v1/product-order/cancel', params)
return data return data
@@ -480,13 +480,11 @@ export async function getLogistics(params) {
export async function confirmAccept(params) { export async function confirmAccept(params) {
let data = await http('/newApi/order/confirm', params) let data = await http('/newApi/order/confirm', params)
return data return data
} }
//清空购物车 //清空购物车
export async function clearAll(params) { export async function clearAll(params) {
let data = await http('/newApi/cart/clearAll', params) let data = await http('/newApi/cart/clearAll', params)
return data return data
} }
export async function getVersion(params) { export async function getVersion(params) {

View File

@@ -1,51 +1,183 @@
import {Base64} from "js-base64";
const arr = [
'mobile',
'express_mobile',
'doctor',
'accept_tel',
'patient_mobile',
'id_card',
'idcard',
'password'
]
// 敏感数据
const sensitiveData = [
'id_card',
'idcard'
]
function request(url, params) { function request(url, params) {
let baseURL = "https://app.xiaokang88.com/member" let baseURL = "https://app.xiaokang88.com/member"
if (url.split('/').indexOf('newApi') !== -1) { // let baseURL = "http://www.xk888.com/member"
baseURL = "https://shop.xiaokang88.com/member" if (url.split('/').indexOf('newApi') !== -1) {
baseURL = "https://shop.xiaokang88.com/member"
}
url = url.replace('/oldApi', '');
url = url.replace('/newApi', '');
} // 加密
url = url.replace('/oldApi', ''); if (params != null) {
url = url.replace('/newApi', ''); params.data = getRes(params.data, false)
}
let num = 0;
// promise导出
return new Promise((resolve, reject) => {
uni.request({
// 基地址 + 传过来的地址
url: baseURL + url,
timeout: 8000, // 8秒超时时间单位ms
// 展开传过来的数据 请求方式 所需数据 wxfc279dcf921a38f7
// store_id: '11001'
...params,
// 请求头
header: {
"authorization": 'Bearer ' + uni.getStorageSync("token"),
"Content-Type": "application/x-www-form-urlencoded"
},
// promise导出 // 成功钩子
return new Promise((resolve, reject) => { success(res) {
uni.request({ if (res.data.errcode === 401) {
// 基地址 + 传过来的地址 // 获取当前页面,如果不是 /pages/home/index
url: baseURL + url, if (getCurrentPages()[getCurrentPages().length - 1].route !== 'pages/home/index') {
timeout: 8000, // 8秒超时时间单位ms uni.removeStorageSync('token')
// 展开传过来的数据 请求方式 所需数据 wxfc279dcf921a38f7 uni.removeStorageSync('userinfo')
// store_id: '11001' uni.removeStorageSync('token_h5')
...params, uni.removeStorageSync('user_id')
// 请求头 uni.reLaunch({url: '/pages/home/index'})
header: { }
"authorization": 'Bearer ' + uni.getStorageSync("token"), }
"Content-Type": "application/x-www-form-urlencoded" if (res.data?.data != null) {
}, res.data.data = getRes(res.data.data)
}
resolve(res)
},
// 失败钩子
fail(err) {
reject(err)
uni.showToast({
title: "请求失败",
duration: 1500,
mask: false,
icon: "error"
})
},
// 成功失败都会执行的钩子
complete() {
// 成功或者失败停止下拉刷新
uni.stopPullDownRefresh()
}
})
})
}
// 成功钩子
success(res) { function getRes(obj, isDecode = true) {
if (res.data.errcode === 401) { try {
uni.reLaunch({ url: '/pages/login/login' }) for (const key in obj) {
} if (Array.isArray(obj[key])) {
resolve(res) obj[key] = getRes(obj[key])
}, } else if (typeof obj[key] === 'object') {
// 失败钩子 obj[key] = getRes(obj[key])
fail(err) { } else {
reject(err) // 判断obj[key]是否在arr中
uni.showToast({ if (arr.indexOf(key) !== -1) {
title: "请求失败", let aseFile = ''
duration: 1500, if (isDecode === true) {
mask: false, aseFile = customBase64Decode(obj[key])
icon:"error" } else {
}) aseFile = customBase64Encode(obj[key])
}, }
// 成功失败都会执行的钩子 const isGarbled = /[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\xFF]|[\u{E000}-\u{F8FF}]/u.test(
complete() { typeof aseFile === 'string' ? aseFile : ''
// 成功或者失败停止下拉刷新 )
uni.stopPullDownRefresh() if (isGarbled) {
} aseFile = obj[key]
}) }
}) // 为了修改,暂时不脱敏
if (isDecode === true) {
if (sensitiveData.indexOf(key) !== -1) {
// 数据脱敏,自动匹配姓名、手机号、身份证
switch (key) {
case 'express_name':
case 'express_region':
case 'accept_name':
case 'patient':
// 保留前两个字符,其余用星号代替
aseFile = aseFile.slice(0, 1).padEnd(aseFile.length, '*');
break;
case 'mobile':
case 'express_mobile':
// 保留前三位和后四位,中间用星号代替
aseFile = aseFile.slice(0, 3).padEnd(aseFile.length - 4, '*') + aseFile.slice(-4);
break;
case 'id_card':
case 'idcard':
// 保留前六位和后四位,中间用星号代替
aseFile = aseFile.slice(0, 6).padEnd(aseFile.length - 4, '*') + aseFile.slice(-4);
break;
default:
// 默认情况下,全部用星号代替
break;
}
}
}
obj[key] = aseFile
}
}
}
return obj
} catch (error) {
console.error('错误:', error)
return obj
}
}
function customBase64Decode(data) {
// return data
try {
// 第一次Base64解码
const decodedFirst = Base64.decode(data)
// 截取从第30个字符开始往后的内容
const subStr = decodedFirst.slice(30)
// 第二次Base64解码
return Base64.decode(subStr) != '' ? Base64.decode(subStr) : data
} catch (error) {
console.error(`解码Base64字符串【${data}】时发生错误`, error)
return data
}
}
// 加密
function customBase64Encode(data) {
if (data == null || data === '') return data
// return data
try {
// 和加密方法差不多但是是要生成30个随机字符
let randomString = ''
for (let i = 0; i < 30; i++) {
const randomChar = String.fromCharCode(Math.floor(Math.random() * (126 - 32 + 1)) + 32)
randomString += randomChar
}
const encoded = Base64.encode(data)
return Base64.encode(randomString + encoded)
} catch (error) {
console.error(`加密字符串【${data}】时发生错误`, error)
return data
}
} }
// 导出 // 导出

View File

@@ -66,7 +66,7 @@
</u-radio> </u-radio>
</u-radio-group> </u-radio-group>
</view> </view>
<view class="tabs" v-if="allergicList[0]!=''"> <view class="tabs" v-if="allergicList[0]!='' && allergic === '有'">
<u-tag bg-color="#2979FF" color="#FFFFFF" v-for="(item,index) in allergicList" :key="index" <u-tag bg-color="#2979FF" color="#FFFFFF" v-for="(item,index) in allergicList" :key="index"
:text="item" mode="dark" /> :text="item" mode="dark" />
</view> </view>
@@ -81,7 +81,7 @@
</u-radio> </u-radio>
</u-radio-group> </u-radio-group>
</view> </view>
<view class="tabs" v-if="personList[0]!=''"> <view class="tabs" v-if="personList[0]!='' && person === '有'">
<u-tag bg-color="#2979FF" color="#FFFFFF" v-for="(item,index) in personList" :key="index" <u-tag bg-color="#2979FF" color="#FFFFFF" v-for="(item,index) in personList" :key="index"
:text="item" mode="dark" /> :text="item" mode="dark" />
</view> </view>
@@ -96,7 +96,7 @@
</d-radio> </d-radio>
</u-radio-group> </u-radio-group>
</view> </view>
<view class="tabs" v-if="familyList[0]!=''"> <view class="tabs" v-if="familyList[0]!='' && family === '有'">
<u-tag bg-color="#2979FF" color="#FFFFFF" v-for="(item,index) in familyList" :key="index" <u-tag bg-color="#2979FF" color="#FFFFFF" v-for="(item,index) in familyList" :key="index"
:text="item" mode="dark" /> :text="item" mode="dark" />
</view> </view>
@@ -182,7 +182,7 @@
return { return {
...item, ...item,
age: this.getAge(item.id_card), // age: this.getAge(item.id_card),
} }
}) })
return list return list
@@ -345,15 +345,15 @@
this.allergic = (this.heathList.allergic_status) % 2 == 0 ? '无' : '有' this.allergic = (this.heathList.allergic_status) % 2 == 0 ? '无' : '有'
this.allergicList = (this.heathList.allergic_history) == 'Array' ? [] : (this.heathList this.allergicList = (this.heathList.allergic_history) == 'Array' ? [] : (this.heathList
.allergic_history).split(',') .allergic_history)
this.person = (this.heathList.person_status) % 2 == 0 ? '无' : '有' this.person = (this.heathList.person_status) % 2 == 0 ? '无' : '有'
this.personList = (this.heathList.person_history) == 'Array' ? [] : (this.heathList this.personList = (this.heathList.person_history) == 'Array' ? [] : (this.heathList
.person_history).split(',') .person_history)
this.family = (this.heathList.family_status) % 2 == 0 ? '无' : '有' this.family = (this.heathList.family_status) % 2 == 0 ? '无' : '有'
this.familyList = (this.heathList.family_history) == 'Array' ? [] : (this.heathList this.familyList = (this.heathList.family_history) == 'Array' ? [] : (this.heathList
.family_history).split(',') .family_history)
} }
}) })
}, },
@@ -737,4 +737,4 @@
} }
} }
} }
</style> </style>

View File

@@ -65,10 +65,11 @@
<!-- 西药 --> <!-- 西药 -->
<view class="item_info" v-if="item.prescription_type==2"> <view class="item_info" v-if="item.prescription_type==2||item.prescription_type==5">
<view class="new_store"> <view class="new_store">
<text class="iconfont icon-mendian"></text>{{item.store.name}} &nbsp;&nbsp;&nbsp; <text class="iconfont icon-mendian"></text>
<u-tag text="西(中成)药" :type="item.prescription_type==2&&'primary'" size="mini" <text style="width: 70%;overflow-x: hidden">{{item.store.name}}</text>
<u-tag :text="item.prescription_type == 2? '西(中成)药': '产品服务包'" :type="(item.prescription_type==2||item.prescription_type==5)&&'primary'" size="mini"
style="margin-left: 20rpx;" /> style="margin-left: 20rpx;" />
</view> </view>
<view class="info" v-for="it in (item.items).slice(0,3)" :key="it.id"> <view class="info" v-for="it in (item.items).slice(0,3)" :key="it.id">
@@ -104,33 +105,36 @@
@tap.stop="toCancel(item.id,item.status,refundType)"> @tap.stop="toCancel(item.id,item.status,refundType)">
退款 退款
</view> </view>
<view class="order_info active" v-if="item.status==6||item.status==7 && item.forbiddenRefund==0" <view class="order_info active" v-else-if="item.status==6||item.status==7 && item.forbiddenRefund==0"
@tap.stop="toCancel(item.id,item.status,refundType)"> @tap.stop="toCancel(item.id,item.status,refundType)">
申请售后 申请售后
</view> </view>
<view class="order_info active" v-if="item.status==0 && item.is_pay==0 && item.cancel_status==0" <view class="order_info active" v-else-if="item.status==0 && item.is_pay==0 && item.cancel_status==0"
@tap.stop="next(item.id)"> @tap.stop="next(item.id)">
支付 支付
</view> </view>
<view class="order_info active" v-if="item.status==2 && item.is_pay==1" @tap.stop="getReceive(item.id)"> <view class="order_info active" v-else-if="item.status==2 && item.is_pay==1" @tap.stop="getReceive(item.id)">
签收 签收
</view> </view>
<view class="order_info active" v-if="item.is_pay==0 && item.status==0 && item.cancel_status==0" <view class="order_info active" v-else-if="item.is_pay==0 && item.status==0 && item.cancel_status==0"
@tap.stop="goCancel(item.id)"> @tap.stop="goCancel(item.id)">
取消 取消
</view> </view>
<view class="order_info" v-if="item.status==9 || item.cancel_status==1"> <view class="order_info" v-else-if="item.status==9 || item.cancel_status==1">
已取消 已取消
</view> </view>
<view class="order_info" v-else-if="item.status==4">
已退款
</view>
<view class="order_info color_red" <view class="order_info color_red"
v-if="item.refund_status==4 && item.cancel_status==0 && item.is_pay==1"> v-else-if="item.refund_status==4 && item.cancel_status==0 && item.is_pay==1">
退款被拒 退款被拒
</view> </view>
<view class="order_info" v-if="item.status>=4&& item.is_pay==1&&item.status<=5 && item.prescription_type==2"> <view class="order_info" v-else-if="item.status>=4&& item.is_pay==1&&item.status<=5 && item.prescription_type==2">
{{item.status==5&&'退款中' || item.status==4&&'已退款' }} {{item.status==5&&'退款中' || item.status==4&&'已退款' }}
</view> </view>
<!-- --> <!-- -->
<view class="order_info active" v-if="item.status>=1 && item.is_pay==1 && item.cancel_status==0" @tap.stop="toDevilty(item.id)"> <view class="order_info active" v-else-if="(item.status===1||item.status===2||item.status===6||item.status===7) && item.is_pay==1 && item.cancel_status==0" @tap.stop="toDevilty(item.id)">
查看物流 查看物流
</view> </view>
</view> </view>
@@ -172,7 +176,7 @@
keyword: "", keyword: "",
status: -1, status: -1,
current: 0, // 状态 current: 0, // 状态
orderList: [], // 订单列表 orderList: [], // 订单列表
id: "", // 订单id id: "", // 订单id
page: 1, // 当前页数 page: 1, // 当前页数
total: "", // 总条数 total: "", // 总条数
@@ -732,4 +736,4 @@
} }
} }
} }
</style> </style>

View File

@@ -6,8 +6,8 @@
头像 头像
</view> </view>
<view class="images"> <view class="images">
<u-avatar class="img" :src="avatar" shape="circle" @click="changeUserPhoto"></u-avatar> <u-avatar class="img" :src="avatar" shape="circle" @click="changeUserPhoto()"></u-avatar>
<text class="iconfont icon-jiantou1" @click="changeUserPhoto"></text> <text class="iconfont icon-jiantou1" @click="changeUserPhoto()"></text>
</view> </view>
</view> </view>
<!-- 卡片 --> <!-- 卡片 -->
@@ -92,11 +92,13 @@
// 点击头像触发click事件 changeUserPhoto // 点击头像触发click事件 changeUserPhoto
changeUserPhoto() { changeUserPhoto() {
console.log('进入更新头像的功能')
uni.chooseImage({ uni.chooseImage({
count: 1, //默认9 count: 1, //默认9
sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有 sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
sourceType: ['album', 'camera'], sourceType: ['album', 'camera'],
success: (res) => { success: (res) => {
console.log('图片选择成功')
uni.showLoading({ uni.showLoading({
title: '请稍后...' title: '请稍后...'
}) })
@@ -115,7 +117,7 @@
type: 'default', type: 'default',
icon: false icon: false
}) })
return return
} }
uni.uploadFile({ uni.uploadFile({
@@ -143,7 +145,13 @@
}) })
} }
}); });
} },
fail: (err) => {
console.error('选择图片失败:', err);
},
complete: () => {
console.log('选择图片完成');
}
}) })
}, },
@@ -186,7 +194,7 @@
}) })
this.getInfo() this.getInfo()
}, 1000) }, 1000)
setTimeout(() => { setTimeout(() => {
uni.navigateBack({ uni.navigateBack({
delta: 1 delta: 1
@@ -296,4 +304,4 @@
margin: 80rpx auto; margin: 80rpx auto;
} }
} }
</style> </style>

View File

@@ -9,26 +9,26 @@
<!-- 姓名 --> <!-- 姓名 -->
<view class="card_name"> <view class="card_name">
<text>姓名</text> <text>姓名</text>
<u-input v-model="names" input-align="right" placeholder="请输入真实姓名" <u-input disabled v-model="names" input-align="right" placeholder="请输入真实姓名"
placeholder-style="text-align:right;color: #94A3B8;" :type="type" /> placeholder-style="text-align:right;color: #94A3B8;" :type="type" />
</view> </view>
<!-- 身份证号 --> <!-- 身份证号 -->
<view class="card_name"> <view class="card_name">
<text>身份证号</text> <text>身份证号</text>
<u-input v-model="form.identityCardNo" maxlength="18" input-align="right" placeholder="已经填写无法修改,请慎重填写" <u-input disabled v-model="form.identityCardNo" maxlength="18" input-align="right" placeholder="已经填写无法修改,请慎重填写"
placeholder-style="text-align:right;color: #94A3B8;padding-right:5px;" @input="inputChange" placeholder-style="text-align:right;color: #94A3B8;padding-right:5px;" @input="inputChange"
:type="type" /> :type="type" />
</view> </view>
<!-- 性别 --> <!-- 性别 -->
<view class="card_name"> <view class="card_name">
<text>性别</text> <text>性别</text>
<u-input v-model="form.sex" input-align="right" placeholder="-" <u-input disabled v-model="form.sex" input-align="right" placeholder="-"
placeholder-style="text-align:right;color: #94A3B8;" :type="type" /> placeholder-style="text-align:right;color: #94A3B8;" :type="type" />
</view> </view>
<!-- 年龄 --> <!-- 年龄 -->
<view class="card_name"> <view class="card_name">
<text>年龄</text> <text>年龄</text>
<u-input v-model="form.age" input-align="right" placeholder="-" <u-input disabled v-model="form.age" input-align="right" placeholder="-"
placeholder-style="text-align:right;color: #94A3B8;" :type="type" /> placeholder-style="text-align:right;color: #94A3B8;" :type="type" />
</view> </view>
@@ -403,16 +403,19 @@
}, },
// 过敏史 // 过敏史
addAller() { addAller() {
this.addtext = ''
this.show = true this.show = true
this.addNum = 1 this.addNum = 1
}, },
// 个人病史 // 个人病史
addPer() { addPer() {
this.addtext = ''
this.show = true this.show = true
this.addNum = 2 this.addNum = 2
}, },
// 家庭病史 // 家庭病史
addFmaily() { addFmaily() {
this.addtext = ''
this.show = true this.show = true
this.addNum = 3 this.addNum = 3
}, },
@@ -424,20 +427,18 @@
name: this.addtext name: this.addtext
} }
this.$set(this.familyList.push(obj)) this.$set(this.familyList.push(obj))
this.addtext = ""
} else if (this.addNum == 1 && this.addtext != "") { } else if (this.addNum == 1 && this.addtext != "") {
let obj = { let obj = {
name: this.addtext name: this.addtext
} }
this.$set(this.allergicList.push(obj)) this.$set(this.allergicList.push(obj))
this.addtext = ""
} else if (this.addNum == 2 && this.addtext != "") { } else if (this.addNum == 2 && this.addtext != "") {
let obj = { let obj = {
name: this.addtext name: this.addtext
} }
this.$set(this.personList.push(obj)) this.$set(this.personList.push(obj))
this.addtext = ""
} }
this.addtext = ""
}, },
// 过敏史 // 过敏史
tapInfo(e, item) { tapInfo(e, item) {
@@ -1133,4 +1134,4 @@
} }
} }
} }
</style> </style>

View File

@@ -1,7 +1,6 @@
<template> <template>
<view class="container safe-area-inset-bottom"> <view class="container safe-area-inset-bottom">
<view class="all" v-if="status==1||status==4">
<view class="all" v-if="status==1">
<!-- 处方 --> <!-- 处方 -->
<view class="head"> <view class="head">
<view class="head_record_top"> <view class="head_record_top">
@@ -114,7 +113,7 @@
</view> </view>
</block> </block>
<block v-if="data.prescription_type==2"> <block v-if="data.prescription_type==2||data.prescription_type == 5">
<view class="item" v-for="(it,index) in infoList.repice" :key="item.id"> <view class="item" v-for="(it,index) in infoList.repice" :key="item.id">
<!-- v-for="(it,index) in item.content" :key="it.id" --> <!-- v-for="(it,index) in item.content" :key="it.id" -->
<view class="name" style="justify-content: space-between;"> <view class="name" style="justify-content: space-between;">
@@ -125,7 +124,7 @@
</view> </view>
<text>x{{ it.number}}</text> <text>x{{ it.number}}</text>
</view> </view>
<view class="details"> <view class="details" v-if="data.prescription_type==2">
<text>用法{{ it.instruction }}</text> <text>用法{{ it.instruction }}</text>
</view> </view>
</view> </view>
@@ -199,14 +198,14 @@
<!-- 温馨提示 --> <!-- 温馨提示 -->
<view class="my_prompt"> <view class="my_prompt">
<view class="titles"> <view class="titles">
{{status==1&&'温馨提示,请遵医嘱服药!处方'+data.valid_hours+'小时内有效!'|| status==3&&'温馨提示请遵医嘱服药你的处方已过48小时'}} {{status==1&&'温馨提示,请遵医嘱服药!处方'+data.valid_hours+'小时内有效!'|| status==3&&'温馨提示请遵医嘱服药你的处方已过48小时' || status==4&&'本处方为产品服务包'}}
</view> </view>
<image src="/static/group/sx.png" class="image" mode="" v-if="status==3"></image> <image src="/static/group/sx.png" class="image" v-if="status==3"></image>
</view> </view>
<!-- 状态 --> <!-- 状态 -->
<view class="my_state" v-if="status==1&&data.is_pay==0&&data.cancel_status==0"> <view class="my_state" v-if="(status==1||status==4)&&data.is_pay==0&&data.cancel_status==0">
<view class="btn" @click="toAppion"> <view class="btn" @click="toAppion">
预约购药 预约购药
</view> </view>
@@ -278,7 +277,7 @@
</view> </view>
<!-- 状态 --> <!-- 状态 -->
<view class="my_state" v-if="status==0&&data.is_pay==0&&data.cancel_status==0"> <view class="my_state" v-if="(status==0||status==4)&&data.is_pay==0&&data.cancel_status==0">
<view class="btn" @click="toAppions"> <view class="btn" @click="toAppions">
预约购药 预约购药
</view> </view>
@@ -302,7 +301,8 @@
1: '已通过', 1: '已通过',
2: '未通过', 2: '未通过',
3: '待使用', 3: '待使用',
4: '已使用', // 4: '已使用',
4: '无需审核',
5: '未使用', 5: '未使用',
6: '已失效', 6: '已失效',
7: '已初审' 7: '已初审'
@@ -385,7 +385,7 @@
}).then((res) => { }).then((res) => {
// console.log(res, 'deta'); // console.log(res, 'deta');
if (res.data.errcode == 0) { if (res.data.errcode === 0) {
this.infoList = res.data.data.content this.infoList = res.data.data.content
this.rpList = res.data.data.pharmacistInfo this.rpList = res.data.data.pharmacistInfo
this.status = res.data.data.status this.status = res.data.data.status
@@ -1023,4 +1023,4 @@
} }
} }
} }
</style> </style>

View File

@@ -20,8 +20,9 @@
<text>{{item.created_at}}</text> <text>{{item.created_at}}</text>
<text class="text" v-if="item.status==1">已通过</text> <text class="text" v-if="item.status==1">已通过</text>
<text class="text" v-if="item.status==4">无需审核</text>
<text class="txt" <text class="txt"
v-if="item.status!=1">{{item.status==0&&'待审核'||item.status==2&&'未通过'|| item.status==3&&'已失效'}}</text> v-if="item.status!=1&& item.status!==4">{{item.status==0&&'待审核'||item.status==2&&'未通过'|| item.status==3&&'已失效'}}</text>
</view> </view>
<view class="info"> <view class="info">
<view class="list_name"> <view class="list_name">
@@ -135,7 +136,7 @@
// this.infoList = res.data.data.list // this.infoList = res.data.data.list
this.totalPage = res.data.data.pagination.totalPage this.totalPage = res.data.data.pagination.totalPage
this.total = res.data.data.pagination.total this.total = res.data.data.pagination.total
if (this.page > 1) { if (this.page > 1) {
this.infoList = [...this.infoList, ...res.data.data.list] this.infoList = [...this.infoList, ...res.data.data.list]
} else { } else {
@@ -355,4 +356,4 @@
} }
} }
</style> </style>

View File

@@ -161,7 +161,8 @@
<text @click="toShow">知情同意书</text> <text @click="toShow">知情同意书</text>
</view> </view>
</view> </view>
<button class="to_pay" @click="toPay">立即支付</button> <button v-if="flag === true" class="to_pay" @click="toPay">立即支付</button>
<button v-else class="to_pay_disabled" :disabled="true">立即支付</button>
</view> </view>
<u-toast ref="uToast" /> <u-toast ref="uToast" />
</view> </view>
@@ -376,7 +377,7 @@
url: '/subPackages/setup/area-list?id=' + this.p_id + '&order_id=' + this.order_id url: '/subPackages/setup/area-list?id=' + this.p_id + '&order_id=' + this.order_id
}) })
}, },
getKnow() { getKnow() {
service({ service({
method: "get", method: "get",
@@ -399,17 +400,18 @@
icon: "error", icon: "error",
title: '请勾选协议' title: '请勾选协议'
}) })
that.flag = false
return return
} }
let that = this let that = this
if (this.flag) { if (that.flag) {
this.flag = false that.flag = false
// 获取支付配置 // 获取支付配置
getPayConfig({ getPayConfig({
method: "post", method: "post",
data: { data: {
order_id: this.order_id, order_id: that.order_id,
store_id: uni.getStorageSync('store_id'), store_id: uni.getStorageSync('store_id'),
} }
}).then((res) => { }).then((res) => {
@@ -418,7 +420,7 @@
title: "加载中" title: "加载中"
}); });
if (res.data.errcode == 0) { if (res.data.errcode === 0) {
uni.requestPayment({ uni.requestPayment({
provider: res.data.data.appId, provider: res.data.data.appId,
@@ -434,6 +436,7 @@
uni.navigateTo({ uni.navigateTo({
url: '/subPackages/my/my-drug/drug-list' url: '/subPackages/my/my-drug/drug-list'
}) })
uni.hideLoading(); uni.hideLoading();
}, 300) }, 300)
}, },
@@ -454,24 +457,22 @@
mask: false, mask: false,
icon: 'error' icon: 'error'
}) })
that.flag = false
return return
} }
uni.navigateTo({
url: '/subPackages/my/my-drug/drug-list'
})
uni.hideLoading(); uni.hideLoading();
}, 1000) that.flag = true
}, 500)
} }
}) })
}else{ }else{
uni.hideLoading(); uni.hideLoading();
this.$refs.uToast.show({ that.$refs.uToast.show({
title: res.data.msg, title: res.data.msg,
type: 'default', type: 'default',
icon: false icon: false
}) })
that.flag = false that.flag = true
} }
if (res.data.code == 1) { if (res.data.code == 1) {
@@ -483,11 +484,12 @@
// mask: false, // mask: false,
// icon: 'error' // icon: 'error'
// }) // })
this.$refs.uToast.show({ that.$refs.uToast.show({
title: res.data.msg, title: res.data.msg,
type: 'default', type: 'default',
icon: false icon: false
}) })
that.flag = true
} }
}) })
@@ -664,10 +666,16 @@
} }
.choose_area { .choose_area {
font-size: 24rpx; font-size: 24rpx;
font-family: PingFang SC-Regular, PingFang SC; font-family: 'PingFang SC', sans-serif; /* 确保字体兼容性 */
font-weight: 400; font-weight: 400;
color: #232323; color: #232323;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2; /* 设置最大行数为2 */
overflow: hidden;
line-height: 1.5; /* 根据需要调整行高 */
word-break: break-all; /* 确保长单词或URL地址换行 */
} }
} }
@@ -920,7 +928,17 @@
color: #FFFFFF; color: #FFFFFF;
text-align: center; text-align: center;
} }
.to_pay_disabled {
width: 690rpx;
height: 84rpx;
line-height: 84rpx;
background: #8a9bf8;
border-radius: 64rpx;
color: #FFFFFF;
text-align: center;
}
} }
} }
</style> </style>

13
yarn.lock Normal file
View File

@@ -0,0 +1,13 @@
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1
js-base64@^3.7.7:
version "3.7.7"
resolved "https://registry.npmmirror.com/js-base64/-/js-base64-3.7.7.tgz"
integrity sha512-7rCnleh0z2CkXhH67J8K1Ytz0b2Y+yxTPL+/KOJoa20hfnVQ/3/T6W/KflYI4bRHRagNeXeU2bkNGI3v1oS/lw==
uview-ui@^1.8.8:
version "1.8.8"
resolved "https://registry.npmmirror.com/uview-ui/-/uview-ui-1.8.8.tgz"
integrity sha512-Osal3yzXiHor0In9OPTZuXTaqTbDglMZ9RGK/MPYDoQQs+y0hrBCUD0Xp5T70C8i2lLu2X6Z11zJhmsQWMR7Jg==