This commit is contained in:
liuyuan
2025-06-10 17:52:06 +08:00
parent 3b86ad9ed8
commit a26581fd81
96 changed files with 11316 additions and 367 deletions

View File

@@ -0,0 +1,97 @@
<template>
<view class="goods_nav">
<view class="left">
<view v-for="(v,i) in iconList" class="icon_item" v-if="iconList.length>0">
<u-icon :name="v.icon" :color="v.infoColor" size="22" v-if="v.iconType" style="margin:0 auto"
@click="clickIcon(v)"></u-icon>
<uni-icons :type="v.icon" size="22" :color="v.infoColor" style="margin:0 auto" v-else> </uni-icons>
<view :style="`color:${v.infoColor};`">{{ v.text }}</view>
</view>
<slot name="leftSlot"></slot>
</view>
<view class="right">
<view class="button" v-for="(v,i) in customButton"
:style="`background:${v.backgroundColor} !important;color:${v.color};width:${v.width}`"
@click="submit(v)">
{{ v.text }}
</view>
</view>
<slot name="bottomSlot"></slot>
</view>
</template>
<script>
import $http from '@/config/requestConfig.js';
import {
mapState
} from 'vuex';
export default {
props: ['iconList', 'customButton'],
data() {
return {
}
},
computed: {
...mapState(['userInfo']),
},
methods: {
submit(v) {
this.$emit('submit', v)
},
clickIcon(v) {
this.$emit('clickIcon', v)
},
},
onBackPress() {
// #ifdef APP-PLUS
plus.key.hideSoftKeybord();
// #endif
},
}
</script>
<style lang="scss" scoped>
.goods_nav {
background-color: #fff;
width: 100%;
padding: 20rpx 30rpx;
overflow: hidden;
display: flex;
align-items: center;
justify-content: space-between;
.left {
height: 100%;
float: left;
display: flex;
align-items: center;
}
}
.richDetail {
width: 100%;
height: 100%;
}
.button {
float: right;
width: 240rpx;
border-radius: 100rpx;
line-height: 70rpx;
text-align: center;
background: linear-gradient(90deg, rgb(254, 96, 53), rgb(239, 18, 36));
color: rgb(255, 255, 255);
}
.icon_item {
display: flex;
justify-content: center;
flex-direction: column;
}
</style>

View File

@@ -24,7 +24,7 @@
<u-empty v-else-if="noDataIcon && isLoadingHide" :mode="noDataIcon"
:icon="`http://cdn.uviewui.com/uview/empty/${noDataIcon}.png`">
</u-empty>
<u-divider style="width: 100%;" v-else-if="!isOrderList" text="暂无数据"></u-divider>
<text class="null_text" v-else-if="!isOrderList">暂无数据</text>
</view>
</view>
</template>
@@ -126,4 +126,12 @@
.list_item:last-child {
border-bottom: none !important;
}
.null_text{
display: block;
text-align: center;
font-size: 30rpx;
color: #999;
padding-top: 150rpx;
padding-bottom: 50rpx;
}
</style>

View File

@@ -1,6 +1,6 @@
<template>
<view class="content">
<z-nav-bar title="名医精彩"></z-nav-bar>
<z-nav-bar title="名医精彩" bgColor="#5188e5" fontColor="#fff"></z-nav-bar>
<z-navigation></z-navigation>
</view>
</template>
@@ -18,7 +18,7 @@ export default {
uni.hideTabBar();
},
onShow() {
uni.removeStorageSync('homeParams');
},
methods: {
//获取数据

451
pages/folder/index.vue Normal file
View File

@@ -0,0 +1,451 @@
<template>
<view class="content">
<z-nav-bar title="我的病历夹" bgColor="#5188e5" fontColor="#fff">
<template v-slot:right>
<view class="top_right" @tap="createFolder">
<uni-icons type="folder-add" size="17" color="#fff"></uni-icons>
<text>创建</text>
</view>
</template>
</z-nav-bar>
<view class="list_wrap">
<view v-if="showMask" class="mask" @click="closeMenu"></view>
<view class="list_content" v-if="list&&list.length>0">
<view class="list_item" v-for="(item, index) in list" :key="index"
@click="goToList(item.id, item.folderName)"
@longpress="handleLongPress(index)"
@touchstart="handleTouchStart(index)"
@touchend="handleTouchEnd"
:class="activeIndex==index?'active':''">
<view class="item_data">
<text class="item_name">{{item.folderName}}</text>
<text class="item_time">{{item.createTime}}</text>
</view>
<!-- 长按弹窗菜单 -->
<view class="action-menu" v-if="activeIndex === index && showMenu">
<view class="menu-item" @tap.stop="renameItem(item.folderName, item.id)">
<text>重命名</text><uni-icons type="compose" size="18"></uni-icons>
</view>
<view class="menu-item" @tap.stop="deleteItem(item)">
<text style=" color: red;">删除</text><uni-icons type="trash" size="18" color="red"></uni-icons>
</view>
</view>
</view>
</view>
<text class="null_text" v-else>{{null_text}}</text>
</view>
<uni-popup ref="edit_folder" class="folder_popup">
<view class="popup-content">
<text class="edit_folder_name">重命名</text>
<view class="edit_folder_input">
<input type="text" v-model="folderName" placeholder="请输入病历夹名称" placeholder-class="custom-placeholder" />
</view>
<button class="edit_folder_btn" @click="update">保存</button>
</view>
</uni-popup>
<uni-popup ref="add_folder" class="folder_popup">
<view class="popup-content">
<text class="add_folder_name">创建病历夹</text>
<view class="add_folder_input">
<input type="text" v-model="addFolderName" placeholder="请输入病历夹名称" placeholder-class="custom-placeholder" />
</view>
<button class="add_folder_btn" @click="addFolder">保存</button>
</view>
</uni-popup>
</view>
</template>
<script>
import $http from "@/config/requestConfig.js";
export default {
data() {
return {
id: null,
list: [],
null_text: '',
folderName: '',
activeIndex: -1,
showMenu: false, //是否显示菜单
showMask: false, //是否显示遮罩
addFolderName: '',
isLongPress: false,
touchStartTime: 0,
}
},
onLoad() {
uni.hideTabBar();
},
onShow() {
this.getData();
},
methods: {
//获取数据
getData() {
uni.showLoading({
title: '加载中'
})
this.$http.request({
url: 'taihumed/aiRecordFolder/getRecordFolders',
method: "POST",
data: {
folderName: '',
patientName: ''
},
header: {
"Content-Type": "application/json",
},
})
.then(res=> {
if(res.code==0){
uni.hideLoading();
if(res.list&&res.list.length>0){
this.list = res.list;
}else{
this.list = [];
this.null_text = '暂无数据';
}
}
});
},
//长按操作
handleLongPress(index) {
this.activeIndex = index;
this.showMenu = true;
this.showMask = true;
//标记长按模式
this.isLongPress = true;
},
//关闭菜单
closeMenu() {
this.showMenu = false;
this.showMask = false;
this.activeIndex = -1;
},
//重命名
renameItem(name, id) {
this.id = id; //编辑的id
this.folderName = name;
this.$refs.edit_folder.open('center');
this.closeMenu();
},
//保存
update(){
if(!this.folderName){
this.$commonJS.showToast("请输入病历夹名称");
return
}
uni.showLoading({
title: '正在保存'
})
this.$http.request({
url: 'taihumed/aiRecordFolder/updateRecordFolder',
method: "POST",
data: {
id: this.id,
folderName: this.folderName,
sort: 0
},
header: {
"Content-Type": "application/json",
},
})
.then(res=> {
if(res.code==0){
uni.hideLoading();
uni.showToast({
title: '保存成功',
icon: 'success'
})
this.$refs.edit_folder.close();
this.getData();
}
});
},
//删除
deleteItem(data) {
this.closeMenu();
uni.showModal({
title: '提示',
content: '确定删除['+ data.folderName +']病历夹?',
success: (res) => {
if (res.confirm) {
uni.showLoading({
title: '正在删除'
})
this.$http.request({
url: 'taihumed/aiRecordFolder/delRecordFolder',
method: "POST",
data: {
id: data.id
},
header: {
"Content-Type": "application/json",
},
})
.then(res=> {
if(res.code==0){
uni.hideLoading();
uni.showToast({
title: '删除成功',
icon: 'success'
})
this.getData();
}
});
}
}
});
},
//创建
createFolder(){
this.$refs.add_folder.open();
this.addFolderName = '';
},
//保存
addFolder(){
if(!this.addFolderName){
this.$commonJS.showToast("请输入病历夹名称");
return
}
uni.showLoading({
title: '正在创建中'
})
this.$http.request({
url: 'taihumed/aiRecordFolder/addRecordFolder',
method: "POST",
data: {
folderName: this.addFolderName,
sort: 0
},
header: {
"Content-Type": "application/json",
},
})
.then(res=> {
if(res.code==0){
uni.hideLoading();
uni.showToast({
title: '创建成功',
icon: 'success'
})
this.$refs.add_folder.close();
this.getData();
}
})
},
//跳转患者列表页
goToList(id, name){
if (this.isLongPress) {
this.isLongPress = false; //重置状态
}
this.onPageJump("/pages/folder/patient?id="+id+"&name="+name);
},
//触摸开始(防抖)
handleTouchStart(index) {
this.isLongPress = false;
},
//触摸结束
handleTouchEnd() {
const touchDuration = Date.now() - this.touchStartTime;
//如果触摸时间超过300ms认为是长按不触发点击
if (touchDuration > 300) {
this.isLongPress = true;
}
},
onPageJump(url) {
uni.navigateTo({
url: url,
});
},
},
}
</script>
<style lang="scss" scoped>
@import '@/static/mixin.scss';
.content{
height: 100%;
overflow: auto;
background-color: #fff;
}
.top_right{
display: flex;
align-items: center;
margin-right: 30rpx;
text{
font-size: 28rpx;
color: #fff;
padding-left: 2rpx;
}
}
.list_content{
margin: 20rpx 30rpx;
border-radius: 10rpx;
background-color: #fff;
padding: 20rpx 30rpx;
box-shadow: 0px 0px 10px 0px #a7bbe4;
.list_item{
position: relative;
transition: background-color 0.2s;
.action-menu{
padding: 15rpx;
width: 320rpx;
position: absolute;
top: 75rpx;
left: 0;
z-index: 100;
background: #fff;
border-radius: 8rpx;
box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.1);
overflow: hidden;
.menu-item{
padding: 20rpx;
border-bottom: 1rpx solid #f5f5f5;
display: flex;
align-items: center;
justify-content: space-between;
font-size: 28rpx;
line-height: 36rpx;
}
.menu-item:last-child{
border-bottom: none;
}
.menu-item:active{
background-color: #f5f5f5;
}
}
.item_data{
display: flex;
align-items: center;
justify-content: space-between;
width: 100%;
font-size: 30rpx;
line-height: 50rpx;
padding: 20rpx 0;
border-bottom: 1rpx solid #e5dcdc;
.item_name{
width: 60%;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.item_time{
color: #999;
font-size: 24rpx;
}
}
}
.list_item:last-child .item_data{
border-bottom: none;
}
}
.null_text{
display: block;
text-align: center;
font-size: 30rpx;
color: #999;
padding-top: 150rpx;
}
.edit_folder_name{
font-size: 30rpx;
line-height: 45rpx;
color: #5188e5;
}
.edit_folder_input{
margin-top: 20rpx;
input{
height: 70rpx;
line-height: 70rpx;
padding: 0 20rpx;
font-size: 26rpx;
color: #303030;
border-radius: 10rpx;
border: 1rpx solid #ddd;
box-sizing: border-box;
}
.custom-placeholder{
font-size: 26rpx;
}
}
.edit_folder_btn{
width: 50%;
margin: 25rpx auto 0;
background: #5188e5;
border-radius: 50rpx;
font-size: 26rpx;
color: #fff;
line-height: 70rpx;
}
.folder_popup{
.popup-content{
padding: 30rpx;
width: 550rpx;
background: #fff;
border-radius: 10rpx;
}
}
.mask{
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(0, 0, 0, 0.5);
z-index: 99;
}
.add_folder_name{
font-size: 30rpx;
line-height: 45rpx;
color: #5188e5;
}
.add_folder_input{
margin-top: 20rpx;
input{
height: 70rpx;
line-height: 70rpx;
padding: 0 20rpx;
font-size: 26rpx;
color: #303030;
border-radius: 10rpx;
border: 1rpx solid #ddd;
box-sizing: border-box;
}
.custom-placeholder{
font-size: 26rpx;
}
}
.add_folder_btn{
width: 50%;
margin: 25rpx auto 0;
background: #5188e5;
border-radius: 50rpx;
font-size: 26rpx;
color: #fff;
line-height: 70rpx;
}
</style>

504
pages/folder/patient.vue Normal file
View File

@@ -0,0 +1,504 @@
<template>
<view class="content">
<z-nav-bar :title="name+'患者列表'" bgColor="#5188e5" fontColor="#fff"></z-nav-bar>
<view class="list_wrap">
<view class="list_content" v-if="list&&list.length>0">
<view v-if="showMask" class="mask" @click="closeMenu"></view>
<view class="list_item" v-for="(item, index) in list" :key="index"
@click="clickRecord(item, index)"
@longpress="handleLongPress(index)"
@touchstart="handleTouchStart(index)"
@touchend="handleTouchEnd">
<view class="item_img">
<image src="../../static/icon/icon_hz.png"></image>
<text>{{item.patientName}}</text>
</view>
<view class="item_content">
<view>西医诊断<text>{{item.diagnosis}}</text></view>
<view>助手类型<text>{{item.chatAssistantName}}</text></view>
<view>创建时间<text>{{item.createTime}}</text></view>
</view>
<!-- 长按弹窗菜单 -->
<view class="action-menu" v-if="activeIndex === index && showMenu">
<view class="menu-item" @tap.stop="renameItem(item)">
<text>重命名</text><uni-icons type="compose" size="18"></uni-icons>
</view>
<view class="menu-item" @tap.stop="moveItem(item)">
<text>移出到</text><uni-icons type="redo" size="18"></uni-icons>
</view>
<view class="menu-item" @tap.stop="deleteItem(item)">
<text style=" color: red;">删除</text><uni-icons type="trash" size="18" color="red"></uni-icons>
</view>
</view>
</view>
</view>
<text class="null_text" v-else>{{null_text}}</text>
</view>
<uni-popup ref="edit_folder" class="folder_popup">
<view class="popup-content">
<text class="edit_folder_name">重命名</text>
<view class="edit_folder_input">
<input type="text" v-model="patientName" placeholder="请输入患者名称" placeholder-class="custom-placeholder" />
</view>
<button class="edit_folder_btn" @click="update">保存</button>
</view>
</uni-popup>
<uni-popup ref="move_folder" class="folder_popup">
<view class="popup-content">
<text class="edit_folder_name">移出到病历夹</text>
<view class="edit_folder_list" style=" margin-top: 20rpx;">
<scroll-view scroll-y class="popup-scroll">
<view class="item_select" v-for="(item, index) in folderList" :key="index" @click="handleRadioClick(item)">
<radio :value="String(item.id)"
:checked="selectedItem.id === item.id" color="#5188e5"
:disabled="item.here === 1"
:style="item.here === 1 ? 'opacity: 0.8; pointer-events: none;' : ''"
/>
<text :style="item.here === 1 ? 'color: #999;' : ''">{{ item.folderName }}</text>
</view>
</scroll-view>
</view>
<button class="edit_folder_btn" @click="confirm">确定</button>
</view>
</uni-popup>
</view>
</template>
<script>
import $http from "@/config/requestConfig.js";
export default {
data() {
return {
id: null,
name: '',
list: [],
null_text: '',
activeIndex: -1,
showMenu: false, //是否显示菜单
showMask: false, //是否显示遮罩
patientId: null,
patientName: '',
chatAssistantId: '',
chatId: '',
folderList: [], //病历夹列表数据
selectedItem: {},
patientData: {}, //患者数据
isLongPress: false,
touchStartTime: 0,
}
},
onLoad(e) {
uni.hideTabBar();
this.id = e.id;
this.name = e.name;
},
onShow() {
this.getData();
},
methods: {
//病历夹获取数据
getFolderList(assistantId,chatId) {
uni.showLoading({
title: '加载中'
})
this.$http.request({
url: 'taihumed/aiRecordFolder/getRecordFolders',
method: "POST",
data: {
assistantId: assistantId,
chatId: chatId,
folderName: '',
patientName: ''
},
header: {
"Content-Type": "application/json",
},
})
.then(res=> {
if(res.code==0){
uni.hideLoading();
if(res.list&&res.list.length>0){
this.folderList = res.list;
}
}
});
},
//获取数据
getData() {
uni.showLoading({
title: '加载中'
})
this.$http.request({
url: 'taihumed/aiRecordFolder/getRecordFolderChats',
method: "POST",
data: {
folderId: this.id,
patientName: ''
},
header: {
"Content-Type": "application/json",
},
})
.then(res=> {
if(res.code==0){
uni.hideLoading();
if(res.list&&res.list.length>0){
this.list = res.list;
}else{
this.list = [];
this.null_text = '暂无数据';
}
}
});
},
//长按操作
handleLongPress(index) {
this.activeIndex = index;
this.showMenu = true;
this.showMask = true;
//标记长按模式
this.isLongPress = true;
},
//重命名
renameItem(data) {
this.chatAssistantId = data.chatAssistantId;
this.chatId = data.chatId;
this.patientName = data.name;
this.$refs.edit_folder.open('center');
this.closeMenu();
},
//保存
update(){
if(!this.patientName){
this.$commonJS.showToast("请输入患者名称");
return
}
uni.showLoading({
title: '正在保存'
})
this.$http.request({
url: 'taihumed/aiRecordFolder/updateRecordFolderChat',
method: "POST",
data: {
chatAssistantId: this.chatAssistantId,
chatId: this.chatId,
patientName: this.patientName,
},
header: {
"Content-Type": "application/json",
},
})
.then(res=> {
if(res.code==0){
uni.hideLoading();
uni.showToast({
title: '保存成功',
icon: 'success'
})
this.$refs.edit_folder.close();
this.getData();
}
});
},
//删除
deleteItem(data) {
this.closeMenu();
uni.showModal({
title: '提示',
content: '确定移除患者['+ data.patientName +']',
success: (res) => {
if (res.confirm) {
uni.showLoading({
title: '正在操作'
})
this.$http.request({
url: 'taihumed/aiRecordFolder/delRecordFolderChat',
method: "POST",
data: {
id: data.id
},
header: {
"Content-Type": "application/json",
},
})
.then(res=> {
if(res.code==0){
uni.hideLoading();
uni.showToast({
title: '操作成功',
icon: 'success'
})
this.getData();
}
});
}
}
});
},
//移入到其他病历夹
moveItem(data){
this.closeMenu();
this.$refs.move_folder.open('center');
console.log('患者数据:',data)
this.patientData = data; //移入需要数据
this.getFolderList(data.chatAssistantId, data.chatId);
},
//radio点击事件
handleRadioClick(data){
if (data.here === 1) return; //在此病历夹的禁止点击
this.selectedItem = data;
},
//移入-确定
confirm(){
//先操作移出
this.$http.request({
url: 'taihumed/aiRecordFolder/delRecordFolderChat',
method: "POST",
data: {
id: this.patientData.id
},
header: {
"Content-Type": "application/json",
},
})
.then(res=> {
if(res.code==0){
//再操作移入
this.joinFolder();
}
});
},
//移入
joinFolder(){
uni.showLoading({
title: '正在操作中'
})
this.$http.request({
url: 'taihumed/aiRecordFolder/addRecordFolderChat',
method: "POST",
data: {
folderId: this.selectedItem.id,
patientName: this.patientData.patientName,
chatAssistantId: this.patientData.chatAssistantId,
chatId: this.patientData.chatId
},
header: {
"Content-Type": "application/json",
},
})
.then(res=> {
if(res.code==0){
uni.hideLoading();
uni.showToast({
title: '操作成功',
icon: 'success'
})
this.$refs.move_folder.close();
this.getData();
}
});
},
//点击会话跳转到首页记录
clickRecord(item, index){
if (this.isLongPress) {
this.isLongPress = false; //重置状态
}
uni.setStorageSync('homeParams', { data: item, index: index, type: 'patient' });
uni.switchTab({
url: '/pages/home/index'
});
},
//触摸开始(防抖)
handleTouchStart(index) {
this.isLongPress = false;
},
//触摸结束
handleTouchEnd() {
const touchDuration = Date.now() - this.touchStartTime;
//如果触摸时间超过300ms认为是长按不触发点击
if (touchDuration > 300) {
this.isLongPress = true;
}
},
//关闭菜单
closeMenu() {
this.showMenu = false;
this.showMask = false;
this.activeIndex = -1;
},
},
}
</script>
<style lang="scss" scoped>
@import '@/static/mixin.scss';
.content{
height: 100%;
overflow: auto;
background-color: #fff;
}
.list_content{
margin: 20rpx 30rpx;
.list_item{
border: 1rpx solid $themeColor;
border-radius: 15rpx;
margin-bottom: 20rpx;
padding: 25rpx;
position: relative;
.item_img{
display: flex;
align-items: center;
image{
width: 80rpx;
height: 80rpx;
}
text{
font-size: 30rpx;
color: #333;
padding-left: 20rpx;
}
}
.action-menu{
padding: 15rpx;
width: 320rpx;
position: absolute;
top: 120rpx;
left: 25rpx;
z-index: 100;
background: #fff;
border-radius: 8rpx;
box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.1);
overflow: hidden;
.menu-item{
padding: 20rpx;
border-bottom: 1rpx solid #f5f5f5;
display: flex;
align-items: center;
justify-content: space-between;
font-size: 28rpx;
line-height: 36rpx;
}
.menu-item:last-child{
border-bottom: none;
}
.menu-item:active{
background-color: #f5f5f5;
}
}
}
}
.item_content{
margin-top: 20rpx;
view{
display: flex;
align-items: center;
font-size: 28rpx;
color: #333;
line-height: 46rpx;
text{
color: #999;
width: 78%;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
}
}
.null_text{
display: block;
text-align: center;
font-size: 30rpx;
color: #999;
padding-top: 150rpx;
}
.mask{
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(0, 0, 0, 0.5);
z-index: 99;
}
.folder_popup{
.popup-content{
padding: 30rpx;
width: 550rpx;
background: #fff;
border-radius: 10rpx;
}
}
.edit_folder_name{
font-size: 30rpx;
line-height: 45rpx;
color: #5188e5;
}
.edit_folder_input{
margin-top: 20rpx;
input{
height: 70rpx;
line-height: 70rpx;
padding: 0 20rpx;
font-size: 26rpx;
color: #303030;
border-radius: 10rpx;
border: 1rpx solid #ddd;
box-sizing: border-box;
}
.custom-placeholder{
font-size: 26rpx;
}
}
.edit_folder_btn{
width: 50%;
margin: 25rpx auto 0;
background: #5188e5;
border-radius: 50rpx;
font-size: 26rpx;
color: #fff;
line-height: 70rpx;
}
.popup-scroll{
max-height: 325rpx;
.item_select{
display: flex;
align-items: center;
margin: 10rpx 0;
radio{
transform: scale(0.6);
/deep/.uni-radio-input{
}
}
text{
font-size: 28rpx;
margin-left: -8rpx;
}
}
}
</style>

File diff suppressed because it is too large Load Diff

View File

@@ -20,7 +20,7 @@
太湖云医是一款以吴雄志老师独有的一以贯之的中医学针灸学与心学学术体系把精准医学思想引入传统医学将中西医有机整合医学与心理学有机整合同时将心理学与东方心学及国学的有机融合为患者及医生提供现代医学中医学与心理学的治疗预防及康复指导意见的一款app
</view>
<view style="text-align: right; padding-right: 20rpx; padding-top: 30rpx;">
<uni-link href="https://soulspace.taihumed.com/privacy.html" text="隐私政策"></uni-link>
<uni-link href="https://www.taimed.cn/privacy.html" text="隐私政策"></uni-link>
</view>
</view>
</template>

View File

@@ -22,6 +22,66 @@
<br clear="both" />
</view>
<view class="modal_vip" v-if="$platform=='android'">
<template>
<view class="chong_zhi boxShadow box_fillet vip_box">
<view class="noVip">
<view style="display: flex; align-items: center;">
<view class="zhanghu" style="text-align: left">
<image class="vip_image" src="@/static/icon/vip.png" mode="aspectFit"></image>
<text style="color: #fff; font-size: 60rpx; padding-left: 10rpx;" v-if="aiVipLog==null">VIP</text>
</view>
<view class="vip_block" v-if="aiVipLog!=null">
<view class="vip_infor_item">
<text v-if="aiVipLog.type==1">月度{{aiVipLog.count}}</text>
<text v-if="aiVipLog.type==2">季度{{aiVipLog.count}}</text>
<text>有效期到 {{aiVipLog.endTime.split(' ')[0]}})</text>
</view>
</view>
<view v-else class="vip_null">办理VIP畅享更多专属权益</view>
</view>
<view class="vip_btn" @click="onPageJump('/pages/vip/index?flag='+flag)">
<button v-if="flag==1">去升级</button>
<button v-if="flag==0">去办理</button>
</view>
</view>
</view>
</template>
</view>
<view class="recharge_block">
<view class="chong_zhi boxShadow box_fillet chongzhi_box">
<view class="chong_list">
<view class="left">
<view class="chong_list_item" @click="onPageJump('/pages/wallet/account')">
<view class="pay_item_img">
天医币
<u-icon @click.native.stop="openInfo()"
name="question-circle"
style="float: right; margin: 0 6rpx">
</u-icon>
</view>
<view class="text" style="line-height:30rpx; display: flex">
{{userMes.peanutCoin ? userMes.peanutCoin : 0}}
</view>
</view>
<view class="chong_list_item" @click="onPageJump('/pages/wallet/points')" v-if="$platform=='android'">
<view class="pay_item_img">
积分
</view>
<view class="text" style="line-height:30rpx">{{userMes.jf ? userMes.jf : 0}}</view>
</view>
</view>
<view class="chong_list_item" style="flex-direction:initial;margin-right:0;">
<view class="chong_btn" @click="onPageJump('/pages/wallet/recharge')"> </view>
</view>
</view>
</view>
</view>
<view class="list_box">
<view class="xiugai boxShadow box_fillet">
<common-list :dataList="pageList" @hancleClick="handleClickTab" label="name">
@@ -33,6 +93,28 @@
</view>
</view>
</view>
<u-popup :show="infoShow" mode="center" round="6" backgroundColor="#fff">
<view class="popup_box">
<view class="title">温馨提示</view>
<view class="content">
<view class="center">
&nbsp;&nbsp;&nbsp;&nbsp;天医币仅为我平台支付使用币种
一人民币=一天医币仅为了方便用户支付使用<br />天医币可以用于在我平台支付书籍或课程使用
<br />天医币这个名称是为适应我们平台的定位属性所起名称与区块链虚拟货币无任何关系
</view>
<view class="bottom">
<view class="button_box" style=" align-items: center; justify-content: center;">
<u-button style="width: 200rpx; float: center" :plain="true" text="知道啦" color="#9b9b9b"
size="small" @click="infoShow = false"></u-button>
</view>
</view>
</view>
</view>
</u-popup>
<z-navigation></z-navigation>
</view>
</template>
@@ -48,11 +130,21 @@ export default {
return {
userMes: {},
pageList: [
{
name: "我的病历夹",
url: "/pages/folder/index",
type: "pageJump",
},
{
name: "会话记录",
url: "/pages/my/recordsList",
type: "pageJump",
},
{
name: "我的订单",
url: "/pages/order/index",
type: "pageJump"
},
{
name: "个人资料",
url: "/pages/my/persData",
@@ -68,7 +160,10 @@ export default {
url: "/pages/user/workOrder",
type: "pageJump"
}
]
],
infoShow: false, // 显示电子书相关
aiVipLog: null,
flag: null
};
},
computed: {
@@ -80,8 +175,8 @@ export default {
},
//页面显示
onShow() {
uni.removeStorageSync('homeParams');
this.getData();
this.getVipData();
},
//方法
methods: {
@@ -105,7 +200,10 @@ export default {
break;
}
},
//点击天医币显示弹窗
openInfo() {
this.infoShow = true;
},
//获取个人信息
getData() {
if (this.userInfo.id != undefined) {
@@ -114,6 +212,23 @@ export default {
});
}
},
//获取数据
getVipData() {
this.$http.request({
url: 'taihumed/aiVip/getUserAiVip',
method: "POST",
data: {},
header: {
"Content-Type": "application/json",
},
})
.then(res=> {
if(res.code==0){
this.aiVipLog = res.aiVipLog;
this.flag = res.flag;
}
});
},
onPageJump(url) {
uni.navigateTo({
url: url,
@@ -257,17 +372,21 @@ export default {
.chong_list_item {
width: auto;
height: 100rpx;
margin-right: 60rpx;
text-align: center;
display: inline-block;
color: #294a97;
display: flex;
align-items: center;
flex-direction: column;
justify-content: space-between;
.text {
font-size: 30rpx;
display: block;
font-weight: 700;
color: #294a97 !important;
color: $themeColor;
padding-top: 20rpx;
}
}
@@ -275,7 +394,8 @@ export default {
font-size: 26rpx;
border-radius: 50rpx;
color: #fffbf6;
padding: 8rpx 32rpx;
line-height: 40rpx;
padding: 10rpx 30rpx;
background: $themeBgColor;
}
}
@@ -335,7 +455,7 @@ export default {
width: calc(100%);
height: 100%;
float: left;
padding: 20rpx 30rpx;
padding: 30rpx;
background: rgba(255, 255, 255, 0.65);
border-radius: 10rpx;
box-shadow: 0px 0px 5px 1px rgba(0, 82, 79, 0.1);
@@ -351,6 +471,9 @@ export default {
right: 30rpx;
}
}
.vip_block{
padding-left: 10rpx;
}
.mine_box {
width: 100%;
@@ -360,23 +483,17 @@ export default {
}
.list_box {
padding: 40rpx 0;
padding: 20rpx 0;
}
.pay_item_img {
display: flex;
color: #333;
align-items: center;
padding: 0;
box-sizing: border-box;
font-weight: bold;
margin: 0 auto;
margin-bottom: 10rpx;
color: #000;
}
.popup_box {
padding-bottom: 20rpx;
width: 88vw;
width: 80vw;
overflow: hidden;
position: relative;
height: auto;
@@ -386,15 +503,15 @@ export default {
font-weight: normal;
font-size: 46rpx;
color: $themeColor;
padding: 20rpx;
padding: 30rpx;
border-top-left-radius: 6px;
border-top-right-radius: 6px;
}
.content {
font-size: 26rpx;
font-size: 28rpx;
letter-spacing: 0.15rpx;
padding: 20rpx;
padding: 10rpx 30rpx 30rpx;
color: #3f3f3f;
.top {
@@ -407,8 +524,8 @@ export default {
.bottom {
width: 100%;
margin-top: 60rpx;
margin-top: 40rpx;
margin-bottom: 20rpx;
font-size: 24rpx;
line-height: 26rpx;
color: #b0b0b0;
@@ -432,8 +549,8 @@ export default {
}
.modal_vip{
margin-top: 50rpx;
padding: 20rpx 20rpx 0;
margin-top: 40rpx;
padding: 20rpx 30rpx 0;
height: auto;
display: flex;
align-items: center;
@@ -472,10 +589,8 @@ export default {
margin-top: 6rpx;
font-weight: normal;
font-size: 28rpx;
color: #000000;
// line-height: 46rpx;
color: #000;
text-align: center;
// color: #fff;
}
}
}
@@ -740,25 +855,51 @@ export default {
.vip_infor_item text{
color: #fff;
}
.vip_btn{
}
.vip_btn button{
background: none;
border: 2rpx solid #294a97;
border: 1rpx solid #5188e5;
border-radius: 40rpx;
font-size: 24rpx;
width: 82rpx;
line-height: 42rpx;
color: #294a97;
font-weight: bold;
color: #5188e5;
padding: 0 10rpx;
}
.vip_null{
color: #fff;
font-size: 26rpx;
line-height: 34rpx;
padding-left: 30rpx;
}
.expired{
opacity: 0.55;
}
.recharge_block{
padding: 20rpx 30rpx 0;
height: auto;
display: flex;
align-items: center;
justify-content: space-between;
}
.vip_box {
padding: 25rpx 0;
float: right;
position: relative;
width: 100%;
height: auto;
border-radius: 20rpx !important;
background: linear-gradient(90deg, #5188e5 0%, #accafb 80%);
.PM_font {
color: #476379;
}
.zhanghu {
font-size: 80rpx;
text-align: center;
line-height: 100%;
margin-bottom: 0;
}
}
</style>

View File

@@ -55,6 +55,7 @@ export default {
if(res.list&&res.list.length>0){
this.list = res.list;
}else{
this.list = [];
this.null_text = '暂无数据';
}
}

324
pages/order/index.vue Normal file
View File

@@ -0,0 +1,324 @@
<template>
<view class="content">
<z-nav-bar title="我的订单" bgColor="#5188e5" fontColor="#fff"></z-nav-bar>
<view class="order_block">
<view class="order_list" v-if="list.length>0">
<view class="order_item" v-for="(item, index) in list" :key="index" @click="goToDetail(item)">
<view class="order_orderSn">
{{item.orderSn}}
<u-tag @click="handleCopy(item.orderSn, '订单编号')" text="复制" plain style="float: right" size="mini" type="success"></u-tag>
</view>
<view class="item_top">
<text class="orderstatus" v-show="item.orderStatus == 0">未付款</text>
<text class="orderstatus" v-show="item.orderStatus == 1">待发货</text>
<text class="orderstatus" v-show="item.orderStatus == 2">已发货</text>
<text class="orderstatus" v-show="item.orderStatus == 3">交易成功</text>
<text class="orderstatus" v-show="item.orderStatus == 4">交易失败</text>
<text class="orderstatus" v-show="item.orderStatus == 5">已过期</text>
</view>
<view class="order_infor" v-if="item.orderType=='aiVip'||item.orderType=='upgradeAiVip'">
<view class="left">
<image src="../../static/icon/order_vip.png" mode="aspectFill"></image>
<text>{{item.aiBuyConfig.title}}<span>{{item.aiBuyConfig.count}}</span><span v-if="item.orderType=='upgradeAiVip'">VIP升级</span></text>
</view>
<view class="right">
<text v-if="item.orderType=='upgradeAiVip'&&item.districtMoney>0">{{Number(item.aiBuyConfig.fee)-Number(item.districtMoney)}}</text>
<text v-else>{{item.aiBuyConfig.fee}}</text>
</view>
</view>
<view class="order_price">实付款
<view class="left">
<text v-if="item.realMoney && item.realMoney > 0">
{{ item.realMoney }}
</text>
<text v-if="item.realMoney==0&&item.jfDeduction==0">
0
</text>
<text v-if="item.realMoney > 0 && item.jfDeduction > 0">
+
</text>
<text v-if="item.jfDeduction > 0">{{ item.jfDeduction }} 积分</text>
</view>
</view>
<text class="order_time">下单时间{{item.createTime}}</text>
<view class="order_statusbtn">
<text v-if="item.orderStatus == 0" @click.stop="goPay(item)">继续付款</text>
<text v-if="item.orderStatus == 3">申请售后</text>
</view>
</view>
</view>
<text class="null_text" v-else>{{null_text}}</text>
</view>
</view>
</template>
<script>
import $http from "@/config/requestConfig.js";
import { mapState, mapMutations } from "vuex";
import {setPay, setPayAssign, setWXPay} from "@/config/utils";
export default {
data() {
return {
list: [],
pagination: {
page: 1, //页码
limit: 20, //每页显示
total: 0, //总条数
},
null_text: '',
}
},
onLoad() {
this.getData();
},
onShow() {
},
computed: {
...mapState(["userInfo"]),
},
methods: {
//获取数据
getData() {
uni.showLoading({
title: '加载中'
})
var params = {
userId: this.userInfo.id,
come: '4',
orderStatus: 3,
...this.pagination
}
this.$http.request({
url: 'common/buyOrder/commonBuyOrderList',
method: "POST",
data: params,
header: {
"Content-Type": "application/json",
},
})
.then(res=> {
uni.hideLoading();
if(res.code==0){
if (res.data.records&&res.data.records.length>0) {
this.list = res.data.records;
}else{
this.list = [];
this.null_text = '暂无数据';
}
}
});
},
//复制
handleCopy(value, title) {
this.$commonJS.handleCopy(value, title);
},
//跳转
goToDetail(val){
uni.navigateTo({
url: "/pages/order/infor?orderId=" +
val.orderId +
"&orderType=" +
val.orderStatus +
"&orderSn=" +
val.orderSn,
});
},
//继续支付
goPay(payItem) {
if (payItem.paymentMethod == 2) {
console.log("阿里支付");
setPay({
typePay: "alipay",
subject: "order",
totalAmount: payItem.realMoney,
type: 2,
relevanceoid: payItem.orderSn,
customerId: this.userInfo.id,
},
(res) => {
if (res.success) {
uni.showToast({
title: "支付成功",
});
} else {
uni.showToast({
title: "支付失败",
icon: "none"
});
}
}
);
} else if (payItem.paymentMethod == 1) {
console.log("微信支付");
if (this.isAndorid == false) {
uni.showModal({
title: "提示",
content: "很抱歉,苹果系统暂不支持微信支付",
showCancel: false,
});
return false;
} else {
let data1 = {
orderSn: payItem.orderSn,
buyOrderId: null,
totalAmount: payItem.realMoney,
};
setWXPay(data1, (res) => {
if (res.success) {
uni.showToast({
title: "支付成功",
});
} else {
if (res.data.errMsg.indexOf("User canceled") != -1) {
uni.showToast({
title: "用户取消支付",
icon: "none"
});
} else {
uni.showToast({
title: "支付失败",
icon: "none"
});
}
}
});
}
} else if (payItem.paymentMethod == 3) {
// 苹果充值
console.log("苹果二次支付");
if (this.isAndorid) {
uni.showModal({
title: "提示",
showCancel: false,
content: "很抱歉,当前订单属于苹果系统内购订单,安卓系统无法完成支付操作,您可切换到苹果系统进行支付,也可以取消该订单,并重新下单",
});
} else {
console.log("进行苹果支付");
}
}
},
},
}
</script>
<style lang="scss" scoped>
@import '@/static/mixin.scss';
.content{
height: 100%;
overflow: auto;
background-color: #fff;
}
.order_block{
padding-bottom: 20rpx;
}
.order_list{
margin: 20rpx 30rpx;
border-radius: 10rpx;
background-color: #fff;
.order_item{
display: block;
width: 100%;
padding: 20rpx 30rpx;
box-shadow: 0px 0px 10px 0px #a7bbe4;
border-radius: 10rpx;
margin-bottom: 20rpx;
position: relative;
}
}
.order_orderSn{
font-size: 28rpx;
color: #999;
position: relative;
text{
}
}
.item_top{
position: absolute;
top: 75rpx;
right: 30rpx;
font-size: 24rpx;
font-weight: normal;
color: red;
}
.order_infor{
margin-top: 40rpx;
display: flex;
align-items: center;
justify-content: space-between;
.left{
display: flex;
align-items: center;
image{
width: 85rpx;
height: 85rpx;
}
text{
padding-left: 30rpx;
font-size: 30rpx;
font-weight: bold;
color: #333;
span{
color: red;
font-size: 28rpx;
}
}
}
}
.order_time{
display: block;
margin-top: 20rpx;
font-size: 26rpx;
color: #999;
}
.order_price{
margin-top: 30rpx;
line-height: 50rpx;
display: flex;
align-items: center;
justify-content: flex-end;
font-size: 28rpx;
.left{
padding-left: 10rpx;
font-size: 30rpx;
color: #333;
font-weight: bold;
}
}
.order_statusbtn{
position: absolute;
bottom: 20rpx;
right: 30rpx;
padding: 0 15rpx;
line-height: 45rpx;
font-size: 24rpx;
color: #999;
border: 1px solid #999;
border-radius: 30rpx;
}
.null_text{
display: block;
text-align: center;
font-size: 30rpx;
color: #999;
padding-top: 150rpx;
}
</style>

906
pages/order/infor.vue Normal file
View File

@@ -0,0 +1,906 @@
<template>
<view class="content">
<z-nav-bar title="订单详情" bgColor="#5188e5" fontColor="#fff"></z-nav-bar>
<view class="orderList" v-if="consigneeShow">
<view class="orderItem">
<view class="" style="position: relative; height: 60rpx">
<text
class="orderState orderState0"
v-if="orderContet.orderStatus == 0">待支付</text>
<text
class="orderState orderState1"
v-if="orderContet.orderStatus == 1">待发货</text>
<text
class="orderState orderState2"
v-if="orderContet.orderStatus == 2">待收货</text>
<text
class="orderState orderState3"
v-if="orderContet.orderStatus == 3">已完成</text>
<text
class="orderState orderState5"
v-if="orderContet.orderStatus == 5">已超时</text>
</view>
<view class="orderContent" v-if="orderContet.orderType == 'aiVip'||orderContet.orderType == 'upgradeAiVip'" style=" display: flex; align-items: center; justify-content: center;">
<image src="/static/icon/order_vip.png" mode="aspectFill" style="width: 100rpx; height: 100rpx;"></image>
<view class="itemJian">
<view class="orderTitle" style="line-height: 46rpx; margin-bottom: 0;">
{{ orderContet.aiBuyConfig.title }}<span style=" color: red;">{{ orderContet.aiBuyConfig.count }}<span v-if="orderContet.orderType=='upgradeAiVip'">VIP升级</span></span>
</view>
</view>
</view>
<view
class="orderContent" v-else-if="orderContet.orderType == 'point'">
<image
src="/static/icon/pay_3.png"
mode="aspectFill"
style="width: 100rpx; height: 100rpx"
></image>
<view class="itemJian">
<view class="orderTitle" style="line-height: 100rpx">
<text>充值 {{ orderContet.bookBuyConfigEntity.money }}天医币</text>
</view>
</view>
</view>
<view class="order_item">
<view class="orderallpri">
<span style="color: #666; margin-right: 10rpx; float: left">商品总价 :
</span>
<span></span>
<text v-if="orderContet.orderType=='upgradeAiVip'&&orderContet.districtMoney>0">{{Number(orderContet.aiBuyConfig.fee)-Number(orderContet.districtMoney)}}</text>
<text v-else>{{ orderContet.orderMoney }}</text>
</view>
<view class="orderReal" v-if="orderContet.jfDeduction > 0">
<span style="color: #666; margin-right: 10rpx; float: left">积分抵扣:</span>
<span style="color: red" v-if="orderContet.jfDeduction > 0">-</span>
<span style="color: red"> {{ orderContet.jfDeduction }}</span>
</view>
<view
class="orderReal"
v-if="orderContet.paymentMethod == 4 && orderContet.realMoney > 0"
>
<span style="color: #666; margin-right: 10rpx; float: left">天医币抵扣:</span>
<span style="color: red">-</span>
<span style="color: red">{{ orderContet.realMoney }}</span>
</view>
<view class="orderReal" v-if="orderContet.orderStatus != 0">
<span style="color: #666; margin-right: 10rpx; float: left">
实付款:
</span>
<b v-if="orderContet.orderType == 'point'" style="color: red"> {{ orderContet.bookBuyConfigEntity.realMoney }}</b>
<b style="color: red" v-else>
<template v-if="orderContet.realMoney">
{{ orderContet.realMoney }}
<text style="font-size: 24rpx;margin-left: 10rpx;">
<span
style=""
v-if="orderContet.paymentMethod == 1"
>微信支付</span
>
<span
style=""
v-if="orderContet.paymentMethod == 2"
>支付宝支付</span
>
<span
style=""
v-if="orderContet.paymentMethod == 3"
>苹果支付</span
>
<span
style=""
v-if="orderContet.paymentMethod == 4"
>
天医币支付
</span>
</text>
</template>
<template v-if="orderContet.realMoney == 0&&orderContet.jfDeduction==0">0</template>
<text
style="margin: 0 4rpx"
v-if="
orderContet.realMoney > 0 && orderContet.jfDeduction > 0
"
>
+
</text>
<text v-if="orderContet.jfDeduction > 0"
>{{ orderContet.jfDeduction }} 积分</text
>
</b>
</view>
<view class="orderReal" v-if="orderContet.remark">
<span style="color: #666; margin-right: 10rpx; float: left">
备注 :
</span>
<text style="color: #666; line-height: 36rpx; display: inline-block; max-width: 80%;">{{ orderContet.remark }}</text>
</view>
</view>
<view class="order_item">
<view class="orderYunf">
<span style="color: #666; float: left">订单编号 : </span>
<text style="font-size: 24rpx; color: #666">{{ orderContet.orderSn }}
</text>
<u-tag
@click="handleCopy(orderContet.orderSn, '订单编号')"
borderColor="#5188e5"
color="#5188e5"
text="复制"
plain
style="float: right; margin-left: 15rpx;"
size="mini"
type="success"
></u-tag>
</view>
<view class="orderReal" style=" width: 100%;
display: flex;
align-items: center;
justify-content: space-between;">
<span style="color: #666; margin-right: 10rpx; float: left">
创建时间 :
</span>
<text style="font-size: 24rpx; color: #666">{{orderContet.createTime}}</text>
</view>
<view
class="orderReal"
v-if=" orderContet.orderStatus >= 1 && orderContet.orderStatus != 5 &&orderContet.paymentDate">
<span style="color: #666; margin-right: 10rpx; float: left">
付款时间 :
</span>
<text style="font-size: 24rpx; color: #666">{{orderContet.paymentDate}}</text>
</view>
</view>
</view>
</view>
<view class="goods_nav_box">
<common-goods-nav
:iconList="iconList"
:customButton="customButton"
@submit="goBuyJie"
@clickIcon="clickIcon"
>
<!-- leftSlot -->
<template slot="leftSlot" slot-scope="slotProps">
<view
class="price_box order_bottom_box"
v-if="orderContet.orderStatus == 0"
>
<text class="price">
合计:
<text class="total">¥{{ orderContet.realMoney }}</text>
</text>
</view>
</template>
</common-goods-nav>
</view>
</view>
</template>
<script>
import $http from "@/config/requestConfig.js";
import { setPay, setPayAssign, setWXPay } from "@/config/utils";
import { mapState } from "vuex";
export default {
data() {
return {
iconList: [
{
text: "联系客服",
iconType: 1,
icon: "server-fill",
infoColor: "#666",
},
],
userRecordid: null, // 用户的评价状态
playData: {},
title: "Hello",
logisticsData: [], // 快递信息列表
titleStat: "",
orderID: 0,
orderSn: "",
orderType: "",
orderContet: {},
sheetList: [], // 面单数据
consigneeShow: false,
customButton: [],
};
},
onLoad(e) {
this.windowWidth = uni.getSystemInfoSync().windowWidth;
this.orderID = e.orderId;
this.orderType = e.orderType;
this.orderSn = e.orderSn;
},
onHide() {
this.sheetList = [];
},
onShow() {
this.getOrderList();
},
computed: {
...mapState(["userInfo"]),
},
methods: {
async goBuyJie(data) {
if (data.text == "继续付款") {
this.goPay(this.orderContet);
} else if (data.text == "取消订单") {
this.canceOrder();
}
},
//联系客服
async clickIcon(data) {
if (data.text == "联系客服") {
this.kefu();
}
},
//联系客服
kefu() {
uni.showModal({
title: "提示",
content: "微信号yilujiankangkefu",
});
},
//复制
handleCopy(value, title) {
this.$commonJS.handleCopy(value, title);
},
onPageJump(item) {
uni.navigateTo({
url: "./deliverDetail?objId=" + item,
});
},
//获取订单详情
getOrderList() {
this.$http
.request({
url: "common/buyOrder/commonOrderDetail",
method: "POST",
data: {
orderId: this.orderID,
},
header: {
"Content-Type": "application/json",
},
})
.then((res) => {
this.customButton = [];
this.orderContet = res.data.buyOrder;
this.consigneeShow = true;
if (
this.orderContet.orderStatus == 2 &&
this.sheetList.length > 0 &&
this.orderContet.orderStatus != 5
) {
this.customButton.push({
width: "160rpx",
text: "查看物流",
color: "#333",
backgroundColor: "#f0f0f0",
color: "#fff",
});
}
if (this.orderContet.orderStatus == 2) {
this.customButton.push({
width: "160rpx",
text: "确认收货",
color: "#fff",
});
}
if (this.orderContet.orderStatus == 0) {
this.customButton.push({
width: "160rpx",
text: "继续付款",
});
}
if (this.orderContet.orderStatus == 0) {
this.customButton.push({
width: "160rpx",
text: "取消订单",
color: "#333",
backgroundColor: "#f0f0f0",
});
}
if (this.orderContet.orderStatus == 0) {
this.titleStat = "待支付";
} else if (this.orderContet.orderStatus == 1) {
this.titleStat = "待发货";
} else if (this.orderContet.orderStatus == 2) {
this.titleStat = "待收货";
} else if (this.orderContet.orderStatus == 3) {
this.titleStat = "已完成";
}
if (
this.orderContet.orderStatus >= 2 &&
this.orderContet.orderType == "order" &&
this.orderContet.expressOrders
) {
this.sheetList = this.orderContet.expressOrders;
} else {
this.sheetList = [];
}
console.log(this.orderContet, "订单详情");
});
},
//取消订单
canceOrder() {
uni.showModal({
title: "提示",
content: "确定要取消订单吗?",
confirmText: "取消订单",
cancelText: "考虑一下",
confirmColor: "#c96713",
cancelColor: "#555",
success: (res) => {
if (res.confirm) {
this.$http
.post(
"book/buyOrder/appDelete?orderId=" + this.orderContet.orderId
)
.then((res) => {
uni.showToast({
icon: "none",
title: "取消订单成功",
});
uni.switchTab({
url: "./orderList",
});
});
}
},
});
},
//支付
goPay(payItem) {
if (payItem.paymentMethod == 2) {
console.log("阿里支付");
setPay(
{
typePay: "alipay",
subject: "order",
totalAmount: payItem.realMoney,
type: 2,
relevanceoid: payItem.orderSn,
customerId: this.userInfo.id,
},
(res) => {
if (res.success) {
uni.showToast({
title: "支付成功",
});
} else {
uni.showToast({
title: "支付失败",
icon: "none"
});
}
this.getOrderList();
}
);
} else if (payItem.paymentMethod == 1) {
console.log("微信支付");
if (this.isAndorid == false) {
uni.showModal({
title: "提示",
content: "很抱歉,苹果系统暂不支持微信支付",
showCancel: false,
});
return false;
} else {
let data1 = {
orderSn: payItem.orderSn,
buyOrderId: null,
totalAmount: payItem.realMoney,
};
console.log(data1, "data1");
setWXPay(data1, (res) => {
if (res.success) {
uni.showToast({
title: "支付成功",
});
} else {
console.log(res);
if (res.data.errMsg.indexOf("User canceled") != -1) {
uni.showToast({
title: "用户取消支付",
icon: "none"
});
} else {
uni.showToast({
title: "支付失败",
icon: "none"
});
}
}
});
}
} else if (payItem.paymentMethod == 3) {
// 苹果充值
console.log("苹果二次支付");
if (this.isAndorid) {
uni.showModal({
title: "提示",
showCancel: false,
content:
"很抱歉,当前订单属于苹果系统内购订单,安卓系统无法完成支付操作,您可切换到苹果系统进行支付,也可以取消该订单,并重新下单",
});
} else {
this.iphonepay(payItem);
}
}
},
},
};
</script>
<style lang="scss" scoped>
@import "@/static/mixin.scss";
@import "@/static/common.scss";
view,uni-view {
font-size: 28rpx;
}
.expresslist {
font-size: 28rpx;
color: #666;
.title {
text-align: center;
}
.item {
padding: 30rpx;
border-bottom: 1px solid #eee;
}
}
.orderState {
color: #fff;
position: absolute;
left: 0;
top: 0rpx;
padding: 6rpx 10rpx;
border-radius: 0 24rpx 24rpx 0;
font-size: 26rpx;
// font-weight: bold;
color: #fff;
}
.orderState0 {
background-color: #e6a23c;
}
.orderState1 {
background-color: #409eff;
}
.orderState2 {
background-color: #f56c6c;
}
.orderState3 {
background-color: #5188e5;
}
.orderState5 {
background-color: #787878;
}
.guoqi {
font-size: 28rpx;
align-items: center;
color: red;
float: right;
line-height: 40rpx;
}
.star {
display: inline-block;
width: 20px;
height: 20px;
margin-right: 10rpx;
}
.mb30 {
margin-bottom: 30rpx;
overflow: hidden;
}
.tanchu {
padding: 40rpx 30rpx 40rpx 30rpx;
position: relative;
.dp_title {
font-size: 32rpx;
margin-bottom: 50rpx;
color: #555;
text-align: center;
font-weight: bold;
}
.dp_add {
position: absolute;
top: 40rpx;
right: 30rpx;
font-size: 22rpx;
background-color: #fd6004;
color: #fff;
border-radius: 10rpx;
padding: 5rpx 10rpx;
.u-icon {
display: inline-block;
margin-right: 5rpx;
}
}
.addressItem {
border: 2px dashed #d9d9d9;
border-radius: 10rpx;
width: 100%;
display: flex;
padding: 20rpx 10rpx;
margin: 25rpx 0 0 0;
align-items: center;
background-color: #fff;
.addrContent {
margin-left: 40rpx;
flex: 1;
.addrContentTop {
display: flex;
align-items: flex-end;
margin: 0 0 15rpx 0;
position: relative;
.userName {
font-size: 35rpx;
font-weight: bold;
margin-right: 30rpx;
}
.userTel {
font-size: 25rpx;
color: #888;
}
.userMoren {
border: 1px solid #fd6004;
color: #fd6004;
padding: 3rpx 10rpx;
font-size: 22rpx;
border-radius: 10rpx;
margin: 0 0 0 20rpx;
}
.chooseCheck {
position: absolute;
top: 3rpx;
right: 6rpx;
}
}
.addrContentBottom {
font-size: 32rpx;
}
}
}
.addressItem.addItem_style {
border-color: #fd6004;
}
.youhuiItem {
border: 1px solid #d9d9d9;
border-radius: 10rpx;
width: 100%;
display: flex;
padding: 20rpx 10rpx;
margin: 25rpx 0 0 0;
align-items: center;
background-color: #fff;
font-size: 30rpx;
}
.youhuiItem > view {
float: left;
}
.youhuiItem.youItem_style {
border-color: #fd6004;
}
}
.opShou {
border-color: $uni-color-success !important;
}
.adDefault {
padding: 30rpx 50rpx 30rpx 100rpx;
background-color: #fff;
border-top: 1px solid #eee;
border-bottom: 2px dashed #b2e9d7;
margin: 0 0 5rpx 0;
position: relative;
.defalTop {
.userName {
font-size: 35rpx;
font-weight: bold;
margin-right: 30rpx;
}
.userTel {
font-size: 25rpx;
color: #888;
}
}
.defalBottom {
.userAddress {
font-size: 32rpx;
line-height: 40rpx;
}
}
.defalLeft {
position: absolute;
left: 30rpx;
top: 55rpx;
}
}
.orderList {
margin: 30rpx;
box-shadow: 0px 0px 10px 0px #a7bbe4;
border-radius: 10rpx;
.orderItem {
padding: 30rpx 0rpx;
background-color: #fff;
border-radius: 10rpx;
margin-bottom: 30rpx;
.orderContent {
padding: 20rpx;
margin-bottom: 20rpx;
image {
width: 150rpx;
height: 180rpx;
margin-right: 20rpx;
float: left;
}
.goods_info {
float: left;
width: calc(100% - 180rpx) !important;
justify-content: space-between;
}
.itemJian {
width: 100%;
justify-content: space-between;
.orderTitle {
font-weight: bold;
font-size: 30rpx;
margin: 0 0 20rpx 0;
float: left;
width: 540rpx;
}
.orderPrice {
font-size: 28rpx;
float: right;
width: 60rpx;
text-align: right;
line-height: 40rpx;
}
}
}
.orderallpri {
text-align: right;
margin: 10rpx 0;
font-size: 28rpx;
}
.orderReal {
text-align: right;
font-size: 28rpx;
margin: 10rpx 0;
overflow: hidden;
}
.orderYunf {
text-align: right;
font-size: 28rpx;
}
.orderOper {
text-align: right;
margin: 40rpx 20rpx 0 0;
view {
margin-left: 20rpx;
padding: 10rpx 0;
display: inline-block;
width: 160rpx;
font-size: 25rpx;
text-align: center;
}
.opFix {
color: #555;
border: 1px solid #ddd;
border-radius: 30rpx;
}
.opCan {
color: #c96713;
border: 1px solid #eba00b;
border-radius: 30rpx;
}
.kefu {
float: left;
}
}
}
}
.copyCode {
display: inline-block;
margin-left: 20rpx;
}
.deliverCntent {
padding: 32rpx;
position: relative;
background-color: #fff;
margin-bottom: 20rpx;
border-top: 1px solid #eee;
font-size: 28rpx;
}
.flexbox {
display: flex;
}
.img_icon {
padding-right: 5px;
}
.moreBtnF {
align-items: center;
padding: 30rpx;
height: 100%;
position: absolute;
right: 0;
top: 0;
z-index: 1;
background-color: rgba(255, 255, 255, 0.9);
}
.wuliu {
.time {
color: #888;
}
.moreBtn {
display: inline-block;
width: 50px;
}
}
.address_box {
background-color: #fff;
display: flex;
align-items: center;
.order_top {
background-color: #fff;
}
.user_info {
width: 100%;
float: left;
display: flex;
align-items: center;
.name {
color: #838282;
margin-right: 10rpx;
}
.tel {
color: #838282;
}
}
.curriulum_title {
width: auto;
font-size: 30rpx;
font-weight: 700;
float: left;
margin-right: 10rpx;
color: #333;
line-height: 40rpx;
letter-spacing: 2rpx;
}
.normal_box {
margin-left: 5rpx;
width: calc(100% - 120rpx);
}
.goods_box {
padding: 20rpx 20rpx;
display: flex;
align-items: center;
}
.rightArrow {
margin-left: 40rpx;
width: 40rpx;
height: 40rpx;
}
}
.feng {
background-color: #fafafa;
margin: 0rpx 22rpx 0 0;
height: 140rpx !important;
width: 140rpx !important;
float: left;
border-radius: 14rpx;
// border: 1rpx solid #e9e9e9;
}
.booknameleft {
font-size: 32rpx;
width: calc(100% - 100rpx);
color: #070707;
letter-spacing: 0.5rpx;
font-weight: 600;
}
.order_item {
padding: 20rpx 20rpx;
border-top: 1px solid #eee;
}
/deep/.goods_nav_box {
.left {
margin-top: -10rpx;
width: auto;
height: auto;
position: relative;
// overflow: hidden;
}
}
.delisted {
background-color: red;
color: #fff;
// padding: 2rpx 4rpx;
position: absolute;
border-radius: 4rpx;
font-size: 22rpx;
width: 100rpx;
text-align: center;
height: 40rpx;
line-height: 40rpx;
left: calc((100% - 100rpx) / 2);
top: calc((100% - 40rpx) / 2);
}
.order_bottom_box {
margin-left: 20rpx;
.number {
font-size: 28rpx;
margin-right: 15rpx;
margin-top: 5rpx;
}
.price {
.total {
font-size: 38rpx;
color: red;
}
}
}
.vip_year{
padding-left: 20rpx;
color: #f5342b;
font-size: 30rpx;
}
</style>

View File

@@ -30,6 +30,10 @@
<text>预约信息</text>
<span style="white-space: pre-line;">{{taihuTalent.reservation.replace('电话预约:', '电话预约:\n')}}</span>
</view>
<view class="taihu_common">
<text>所属地域</text>
{{taihuTalent.region}}
</view>
<view class="taihu_common">
<text>太湖证书</text>
<view class="certificate-list" v-if="certificates.length>0">

View File

@@ -1,7 +1,67 @@
<template>
<view class="content">
<z-nav-bar title="太湖英才" bgColor="#5188e5" fontColor="#fff"></z-nav-bar>
<view class="talents_list">
<z-nav-bar title="太湖英才" bgColor="#5188e5" fontColor="#fff" :backState="2000"></z-nav-bar>
<view class="talents_module" :style="`top: ${45 + statusBarHeight}px;`">
<view class="talents_tab">
<view class="tab_item" @click="toggleFilter('city')">
地区
<text :class="['arrow', activeFilter === 'city' ? 'up' : 'down']"></text>
</view>
<view class="tab_item" @click="toggleFilter('department')">
科室
<text :class="['arrow', activeFilter === 'department' ? 'up' : 'down']"></text>
</view>
</view>
<!-- 弹窗 -->
<view class="talents_tan" v-if="activeFilter">
<view class="tan_item tan_city" v-if="activeFilter=='city'">
<scroll-view scroll-y="true" class="city_scroll scroll_left" :class="!cityStatus?'width50':''" :scroll-into-view="'country_' + selectedPath[0]">
<view class="city_item"
:class="countryIndex==index?'active':''"
v-for="(item,index) in country" :key="index" :id="'country_' + item.areaId" @click="click_country(item,index)">
<text>{{item.title}}</text>
</view>
</scroll-view>
<scroll-view scroll-y="true" class="city_scroll scroll_center" :class="!cityStatus?'width50':''" :scroll-into-view="'province_' + selectedPath[1]">
<view class="city_item"
:class="provinceIndex==index?'active':''"
v-for="(item,index) in province" :key="index" :id="'province_' + item.provId" @click="click_province(item,index)">
<text>{{item.provName}}</text>
</view>
</scroll-view>
<scroll-view scroll-y="true" class="city_scroll scroll_right" v-if="cityStatus" :scroll-into-view="'city_' + selectedPath[2]">
<view class="city_item"
:class="cityIndex==index?'active':''"
v-for="(item,index) in city" :key="index" :id="'city_' + item.cityId" @click="click_city(item,index)">
<text>{{item.cityName}}</text>
</view>
</scroll-view>
</view>
<view class="tan_item tan_department" v-if="activeFilter=='department'">
<view class="department_item"
:class="departmentIndex==index?'department_active':''"
v-for="(item,index) in chatAssistants" :key="index" @click="click_department(item.name,index)">
<text>{{item.name}}</text>
</view>
</view>
</view>
<view class="name_search" v-if="!activeFilter">
<uni-easyinput
v-model="name"
prefixIcon="search"
placeholder="按姓名搜索"
placeholderClass="name-placeholder"
class="center-input"
/>
<button @click="getData()">查询</button>
</view>
</view>
<!-- 遮罩层 -->
<view v-if="activeFilter" class="overlay" @click="closeFilter"></view>
<view class="talents_list" v-if="list&&list.length>0">
<view class="talents_item" v-for="(item,index) in list" :key="index" @click="goToDetail(item.id)">
<image :src="item.icon" class="item_image" mode="aspectFit"></image>
<view class="item_right">
@@ -13,6 +73,7 @@
</view>
</view>
</view>
<text class="null_text" v-else>{{null_text}}</text>
<z-navigation></z-navigation>
</view>
</template>
@@ -23,15 +84,35 @@ export default {
data() {
return {
name: '',
region: '',
list: []
region: '', //地区
department: '', //科室
list: [],
null_text: '',
departmentIndex: null,
activeFilter: '',
chatAssistants: [], //科室数据
country: [], //国家数据
province: [], //省份数据
city: [], //城市数据
countryIndex: 0,
provinceIndex: null,
cityIndex: null,
countryTitle: '',
provinceTitle: '',
cityTitle: '',
//城市模块是否显示
cityStatus: false,
selectedPath: [], //存储选中路径
}
},
onLoad() {
uni.hideTabBar();
this.getAllBaseArea();
this.getChatAssistants();
},
onShow() {
uni.removeStorageSync('homeParams');
this.getData();
},
methods: {
@@ -45,7 +126,8 @@ export default {
method: "POST",
data: {
name: this.name,
region: this.region
region: this.region,
department: this.department
},
header: {
"Content-Type": "application/json",
@@ -55,15 +137,165 @@ export default {
uni.hideLoading();
if (res.list&&res.list.length>0) {
this.list = res.list;
}else{
this.list = [];
this.null_text = '暂无数据';
}
});
},
//获取科室数据
getChatAssistants() {
this.$http.request({
url: 'common/ragFlowApi/getChatAssistants',
method: "POST",
data: {},
header: {
"Content-Type": "application/json",
},
})
.then(res=> {
if (res.list&&res.list.length>0) {
this.chatAssistants = res.list;
}
})
},
//获取国家
getAllBaseArea() {
this.$http.request({
url: 'common/baseArea/getAllBaseArea',
method: "POST",
data: {},
header: {
"Content-Type": "application/json",
},
})
.then(res=> {
if (res.baseAreas&&res.baseAreas.length>0) {
this.country = res.baseAreas;
//如果第一位是中国默认请求
if(this.country[0].code=='86'){
this.countryTitle = this.country[0].title;
this.getProvinceList();
}
}
})
},
//获取中国省份
getProvinceList() {
this.$http.request({
url: 'common/province/getProvinceList',
method: "POST",
data: {},
header: {
"Content-Type": "application/json",
},
})
.then(res=> {
if (res.provinceList&&res.provinceList.length>0) {
this.province = res.provinceList;
}
})
},
//获取城市
getCityList(provId) {
this.$http.request({
url: 'common/province/getCityList?provId='+provId,
method: "POST",
data: {},
header: {
"Content-Type": "application/json",
},
})
.then(res=> {
if (res.prov&&res.prov.length>0) {
this.city = res.prov;
this.cityStatus = true;
}
})
},
//点击国家
click_country(data, index){
this.provinceIndex = null;
this.cityIndex = null;
this.city = [];
this.region = '';
this.selectedPath = [data.areaId];
//只有中国有二级,如果没有二级则为海外国家
if(data.code!='86'){
this.cityStatus = false;
if(this.countryTitle == data.title){
this.countryIndex = null;
this.provinceIndex = null;
}else{
this.province = [];
this.countryIndex = index;
this.countryTitle = data.title;
this.region = data.title;
}
this.activeFilter = '';
this.getData();
}else{
this.countryIndex = index;
this.countryTitle = data.title;
this.getProvinceList();
}
console.log(this.countryIndex, this.countryTitle)
},
//点击省份
click_province(data, index){
this.provinceIndex = index;
this.cityIndex = null;
this.provinceTitle = data.provName;
this.selectedPath = [this.selectedPath[0], data.provId];
console.log(this.provinceTitle)
this.getCityList(data.provId);
},
//点击城市
click_city(data, index){
this.selectedPath = [this.selectedPath[0], this.selectedPath[1], data.cityId];
if(this.cityTitle == data.cityName){
this.cityIndex = null;
this.cityTitle = '';
this.region = '';
}else{
this.cityIndex = index;
this.cityTitle = data.cityName;
this.region = this.provinceTitle + this.cityTitle;
}
this.activeFilter = '';
this.getData();
console.log(this.region)
},
//详情
goToDetail(id){
uni.navigateTo({
url: '/pages/talents/detail?id='+id,
});
},
//点击
toggleFilter(type) {
this.activeFilter = this.activeFilter === type ? '' : type;
},
//关闭
closeFilter() {
this.activeFilter = '';
},
//点击科室类别
click_department(name, index){
if(this.department==name){
this.departmentIndex = null;
this.department = ''
}else{
this.departmentIndex = index;
this.department = name;
}
this.activeFilter = '';
this.getData();
}
},
}
</script>
@@ -76,7 +308,8 @@ export default {
background-color: #fff;
}
.talents_list{
margin: 20rpx 30rpx;
margin: 185rpx 30rpx 20rpx;
padding-bottom: 120rpx;
}
.talents_item{
border: 1rpx solid $themeColor;
@@ -121,4 +354,162 @@ export default {
overflow: hidden;
text-overflow: ellipsis;
}
.null_text{
display: block;
text-align: center;
font-size: 30rpx;
color: #999;
padding-top: 300rpx;
}
.talents_module{
width: 100%;
position: fixed;
z-index: 999;
top: 0;
left: 0;
}
.talents_tab {
width: 100%;
height: 80rpx;
display: flex;
justify-content: space-around;
background: #f3f3f3;
}
.tab_item {
display: flex;
align-items: center;
}
.arrow {
display: inline-block;
width: 0;
height: 0;
border-left: 10rpx solid transparent;
border-right: 10rpx solid transparent;
margin-left: 10rpx;
}
.arrow.down {
border-top: 10rpx solid #666;
}
.arrow.up {
border-bottom: 10rpx solid #666;
}
.overlay {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: rgba(0, 0, 0, 0.5);
z-index: 9;
}
.talents_tan{
width: 100%;
background: #fff;
font-size: 28rpx;
.tan_department{
display: flex;
flex-wrap: wrap;
padding-bottom: 1rpx;
.department_item{
display: flex;
justify-content: center;
width: 50%;
height: 85rpx;
line-height: 85rpx;
border-bottom: 1rpx solid #f3f3f3;
border-right: 1rpx solid #f3f3f3;
text{
color: #333;
}
}
.department_item:nth-of-type(2n){
border-right: 0;
}
.department_item:nth-last-child(-n+2){
border-bottom: 0;
}
.department_active{
text{
color: $themeColor;
font-weight: bold;
}
}
}
.tan_city{
display: flex;
align-items: center;
.city_scroll{
width: 33.3%;
height: 395rpx;
}
.scroll_left,.scroll_center{
border-right: 1rpx solid #f3f3f3;
box-sizing: border-box;
}
.width50{
width: 50% !important;
}
}
}
.city_item{
padding-left: 20rpx;
line-height: 78rpx;
border-bottom: 1rpx solid #f3f3f3;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.city_item:last-child{
border-bottom: 0;
}
.active{
text{
color: $themeColor;
font-weight: bold;
}
}
.name_search{
background-color: #fff;
padding: 20rpx 30rpx;
display: flex;
align-items: center;
/deep/.is-input-border{
background-color: #f3f3f3;
border-radius: 50rpx;
height: 60rpx;
line-height: 30rpx;
padding: 15rpx;
font-size: 28rpx;
color: #666;
}
/deep/.uni-easyinput__content-input{
}
.name-placeholder{
font-size: 28rpx;
text-align: center;
color: #666;
}
button{
background-color: $themeBgColor;
font-size: 26rpx;
line-height: 36rpx;
border-radius: 15rpx;
color: #fff;
padding: 5rpx 20rpx;
margin-left: 15rpx;
}
}
</style>

View File

@@ -73,8 +73,7 @@
<span class="highlight" @click="yszcShow = true">隐私协议</span>
</view>
<view class="btn_box">
<button @click="onSubmit" v-if="btnShow"> </button>
<button v-else> </button>
<button @click="onSubmit"> </button>
</view>
<view class="loginHelp" v-if="submitClickNum > 0">
<text>登录遇到问题</text><text class="link"
@@ -129,10 +128,8 @@ export default {
codeText: "获取验证码",
//验证码已发
readonly: false,
btnShow: true,
agree: false,
isIos: true,
isWeixin: true,
system: 13,
clearTime: null,
HealthOpen: false,
@@ -168,10 +165,6 @@ export default {
this.isIos = plus.os.name == "iOS";
let systemInfo = uni.getSystemInfoSync();
this.system = parseFloat(systemInfo["system"].replace(/[a-zA-Z]/g, ""));
this.isWeixin = plus.runtime.isApplicationExist({
pname: "com.tencent.mm",
action: "weixin://",
});
this.type = 2000;
this.brand = 3000;
@@ -205,19 +198,6 @@ export default {
this.loginForm.quCode = this.quCodeList[0].value;
this.brand = val;
},
closeMusic() {
this.$music.setCloseBgm(); // 关闭音频
uni.setStorage({
key: "playVisible",
data: false,
success: function() {
console.log("success");
},
});
this.setUserInfo({
playVisible: false,
});
},
// 获取国家区域编码
getCountyCode() {
this.$http
@@ -270,13 +250,6 @@ export default {
quChange(e) {
console.log(e, "e");
},
// 修改密码
resetPassWord() {
uni.navigateTo({
url: "",
});
},
onPageJump(url, name) {
if(name){
uni.navigateTo({
@@ -380,24 +353,6 @@ export default {
});
}
},
loginAPP() {
this.$http.post(this.urlList.apiLogin, this.appForm).then((res) => {
this.$store.commit("setUserInfo", res.obj);
uni.setStorageSync("token", res.obj.token);
uni.setStorageSync("customerOid", res.obj.customerOid);
this.setUserInfo(res.obj);
uni.showToast({
title: "登录成功",
duration: 1000,
});
setTimeout(() => {
uni.reLaunch({
url: "/pages/home/index",
});
}, 1000);
});
return;
},
// 手机密码登录
async onSubmit() {
if (!this.agree) {
@@ -514,188 +469,7 @@ export default {
});
}
},
// 一路健康APP登录进入
onSubmit_Health() {
if (!this.health_phone) {
this.$commonJS.showToast("请输入一路健康账号");
return;
}
if (!this.health_password) {
this.$commonJS.showToast("请输入密码");
return;
}
let healthData = {};
healthData.phone = this.health_phone;
healthData.password = this.health_password;
this.$http.post("book/user/getEverhealthInfo", healthData).then((res) => {
this.setHealthMes(res.everhealthInfo);
if (res.userInfo) {
res.userInfo.token = res.token.token;
this.setUserInfo(res.userInfo);
uni.showToast({
title: "登录成功",
});
setTimeout(() => {
uni.reLaunch({
url: "/pages/home/index"
});
}, 500);
} else {
setTimeout(() => {
uni.navigateTo({
url: "",
});
}, 600);
uni.showToast({
title: "账号验证成功",
duration: 600,
});
}
});
},
// 一路健康APP登录
onHealthLogin() {
if (!this.agree) {
this.$commonJS.showToast("请先同意《用户协议》和《隐私协议》");
return;
}
this.HealthOpen = true;
},
// 微信APP登录
onWxAppLogin() {
uni.login({
provider: "weixin",
success: (res) => {
uni.getUserInfo({
success: (info) => {
this.userInfo = info.userInfo;
if (res.authResult.openid && res.authResult.unionid) {
this.$http
.post("api/open/v1/login", {
wxAppOpenId: res.authResult.openid,
unionid: res.authResult.unionid,
nickname: this.userInfo.nickName,
headImg: this.userInfo.avatarUrl,
})
.then((data) => {
this.setUserInfo({
openId: res.authResult.openid,
unionid: res.authResult.unionid,
...data,
});
if (data.thirdLoginSuccess) {
socket.init();
uni.showToast({
title: "登录成功",
});
setTimeout(() => {
uni.reLaunch({
url: "/pages/home/index"
});
}, 500);
} else {
uni.showModal({
title: "提示",
content: "您还未绑定手机号,请先绑定~",
confirmText: "去绑定",
cancelText: "再逛会",
success: (res) => {
if (res.confirm) {
uni.redirectTo({
url: "",
});
}
},
});
}
});
} else {
uni.showToast({
title: "点击无效,请再次点击",
icon: "none",
});
}
},
fail: () => {
console.log("未授权");
},
});
},
fail(err) {
console.log(err);
},
});
},
// 苹果登录
onAppleLogin() {
uni.login({
provider: "apple",
success: (loginRes) => {
uni.getUserInfo({
provider: "apple",
success: (userInfoRes) => {
if (userInfoRes.userInfo.identityToken) {
this.$http
.post("api/open/v1/ios_login", {
identityToken: userInfoRes.userInfo.identityToken,
})
.then((data) => {
this.setUserInfo(data);
if (data.thirdLoginSuccess) {
socket.init();
uni.showToast({
title: "登录成功",
duration: 2000,
});
setTimeout(() => {
uni.reLaunch({
url: "/pages/home/index"
});
}, 500);
} else {
uni.showModal({
title: "提示",
content: "您还未绑定手机号,请先绑定~",
confirmText: "去绑定",
cancelText: "再逛会",
success: (res) => {
if (res.confirm) {
uni.redirectTo({
url: "",
});
}
},
});
}
});
}
},
});
},
fail: (err) => {
uni.showToast({
title: "登录失败",
icon: "none",
});
},
});
},
},
//页面隐藏
onHide() {},
//页面卸载
onUnload() {},
//页面下来刷新
onPullDownRefresh() {},
//页面上拉触底
onReachBottom() {},
};
</script>
<style lang="scss" scoped>

1043
pages/vip/index.vue Normal file

File diff suppressed because it is too large Load Diff

494
pages/wallet/account.vue Normal file
View File

@@ -0,0 +1,494 @@
<template>
<view class="wallet_wrap">
<z-nav-bar title="我的账户" bgColor="#5188e5" fontColor="#fff"></z-nav-bar>
<u-alert
type="warning"
size="20rpx"
:title="goBuyTitle"
:show-icon="true"
>
</u-alert>
<view class="ACTable">
<view class="ACTable_block">
<view>
<view
class="AC_chong PM_font"
@click="onPageJump('/pages/wallet/recharge')"
>立即充值
<u-icon
name="arrow-right"
color="#fff"
size="16"
class="rightArrow"
></u-icon>
</view>
</view>
<view>
<view class="AC_con">
<common-list
:dataList="MoneyRecord"
isCondition="true"
isNoIcon="true"
label="orderType"
@hancleClick="goClick"
>
<template slot="labelSlot" slot-scope="slotProps">
<view class="label_content AC_List">
<view style=" display: flex; align-items: center; justify-content: space-between;">
<view class="left">
<view class="title" v-if="slotProps.row.orderType=='购买商品'&&slotProps.row.productName">{{ slotProps.row.orderType }} <br/> {{ slotProps.row.productName }}</view>
<view class="title" v-else>{{ slotProps.row.orderType }}</view>
</view>
<view class="right Hot">
<text v-if="slotProps.row.changeAmount > 0">+</text>
<text>{{ slotProps.row.changeAmount }}</text>
</view>
</view>
<view class="AC_mark" v-if="slotProps.row.remark">{{slotProps.row.remark}}</view>
<view class="AC_time">{{ slotProps.row.createTime }}</view>
</view>
</template>
</common-list>
</view>
</view>
</view>
<view>
<u-back-top
:scroll-top="scrollTop"
bottom="60"
:customStyle="bgiStyle"
:iconStyle="iconStyle"
>
</u-back-top>
</view>
</view>
</view>
</template>
<script>
import $http from "@/config/requestConfig.js";
import { mapState } from "vuex";
export default {
data() {
return {
goBuyTitle:'【天医币】仅为我平台支付使用币种 。一人民币=一天医币,仅为了方便用户支付使用。【天医币】可以用于在我平台支付书籍或课程使用。【天医币】这个名称是为适应我们平台的定位属性,所起名称。与区块链虚拟货币无任何关系。',
playData: {},
options: {},
urlList: {
list: "common/transactionDetails/getTransactionDetailsList",
},
cardList: [],
couponListTab: 0,
MoneyRecord: [],
userMes: {},
scrollTop: 0,
status: 3,
totalPage: 0,
totalCount: 0,
tab_muJian: 0,
bgiStyle: {
background: "#7dc1f0",
},
iconStyle: {
fontSize: "40rpx",
fontWeight: "bold",
color: "#fff",
},
};
},
// 返回顶部
onPageScroll(e) {
this.scrollTop = e.scrollTop;
},
//第一次加载
onLoad(options) {
this.options = options;
},
computed: {
...mapState(["userInfo"]),
},
//页面显示
onShow() {
this.getData();
},
//方法
methods: {
//列表跳转到详情
goClick(data){
if(data.relationId){
uni.navigateTo({
url: "/pages/order/infor?orderId=" + data.relationId
});
}
},
//获取数据
getData() {
var data = {
userId: this.userInfo.id,
};
if (!this.iosHide) {
this.tab_muJian = 1;
}
//用户详情
if (this.userInfo.id != undefined) {
this.$http.post("book/user/info/" + this.userInfo.id).then((res) => {
this.userMes = res.user;
});
}
uni.showLoading({
title: '加载中'
})
$http.request({
url: this.urlList.list,
method: "POST",
data,
header: {
"Content-Type": "application/json",
},
})
.then((res) => {
uni.hideLoading();
this.MoneyRecord = res.transactionDetailsList;
});
},
// 跳转
onPageJump(url) {
uni.navigateTo({
url: url,
});
},
},
};
</script>
<style lang="scss" scoped>
@import "@/static/mixin.scss";
.wallet_wrap{
background-color: #eff5f8;
height: 100%;
}
.ACTable_block{
padding: 0 30rpx;
}
.ACTable {
margin-top: 20rpx;
.AC_mes {
width: 100%;
height: 400rpx;
padding: 160rpx 160rpx 100rpx 120rpx;
box-shadow: 0 0px 10px 1px #d3d1d133;
border-radius: 15rpx;
margin-bottom: 40rpx;
position: relative;
.wallet_title {
color: #fff;
font-size: 62rpx;
line-height: 80rpx;
font-weight: 600;
text-align: center;
}
.wallet_number {
color: #fff;
font-size: 70rpx;
line-height: 100rpx;
font-weight: 500;
text-align: center;
}
}
.AC_con {
background-color: #fff;
overflow: hidden;
box-shadow: 0 0px 10px 1px #d3d1d133;
border-radius: 0 0 15rpx 15rpx;
font-size: 30rpx;
.AC_jilu {
font-size: 42rpx;
text-align: left;
color: #294a97;
padding: 30rpx 20rpx 20rpx;
}
.AC_List {
overflow: hidden;
.left {
width: calc(100% - 140rpx) !important;
font-weight: 700;
float: left;
color: #333;
font-size: 32rpx;
line-height: 60rpx;
.title{
line-height: 48rpx;
}
}
.right {
display: block;
float: right;
text-align: right;
font-size: 32rpx;
font-weight: 700;
color: #333;
}
.AC_title {
font-size: 32rpx;
margin-bottom: 20rpx;
view {
float: right;
font-size: 34rpx;
font-weight: bold;
}
}
.AC_mark {
width: 100%;
font-size: 28rpx;
margin-top: 20rpx;
color: #888;
}
.AC_time {
color: #bababa;
font-size: 28rpx;
}
}
}
.couponList {
view {
display: inline-block;
padding: 0 0 25rpx 0;
margin: 40rpx 0 40rpx 0;
width: 33%;
text-align: center;
font-size: 30rpx;
}
.couStyle {
border-bottom: 5rpx solid #54a966;
color: #54a966;
font-weight: bold;
}
}
.card {
width: 100%;
overflow: hidden;
margin-bottom: 30rpx;
padding-left: 10rpx;
position: relative;
}
.card > view {
background: #fff;
border-radius: 5rpx;
}
.card .dot-left,
.card .dot-right {
display: block;
width: 12rpx;
height: 12rpx;
border-radius: 50%;
background: #f5f5f5;
position: absolute;
z-index: 999;
}
.card .dot-left {
bottom: -6rpx;
left: -6rpx;
}
.card .dot-right {
bottom: -6rpx;
right: -6rpx;
}
.card .page-group {
position: absolute;
top: 10rpx;
left: -2rpx;
width: 100%;
max-width: 200rpx;
.fold-page {
display: block;
width: 10rpx;
height: 8rpx;
background: #54a966;
transform: skewY(-40deg);
position: absolute;
top: -5rpx;
left: -8rpx;
z-index: 0;
}
.page {
position: absolute;
z-index: 1;
display: block;
padding: 5rpx 20rpx 3rpx 20rpx;
height: 40rpx;
line-height: 40rpx;
background: linear-gradient(137deg, #54a966 0%, #0d5e1e 100%);
border-radius: 0 20rpx 20rpx 0;
color: #fff;
text-align: center;
font-size: 24rpx;
overflow: hidden;
left: -8rpx;
}
}
.card .page-group.grey {
.fold-page {
background: #c6c6c6;
}
.page {
background: linear-gradient(137deg, #c6c6c6 0%, #999595 100%);
}
}
.card .content {
width: 100%;
height: 180rpx;
border-bottom: 1rpx dotted #f5f5f5;
position: relative;
z-index: 2;
}
.card .content .coupon-detail {
display: flex;
padding: 0 15rpx 0 20rpx;
}
.card .content .coupon-detail > view {
height: 130rpx;
display: flex;
align-items: center;
}
.card .content .coupon-detail > view:first-child {
color: #54a966;
padding-top: 100rpx;
width: 30%;
}
.card .content .coupon-detail > view.grey {
color: #c6c6c6;
}
.card .content .coupon-detail > view:first-child > span:first-child {
font-size: 30rpx;
margin: 0 10rpx 0 0;
}
.card .content .coupon-detail > view:first-child > span:last-child {
font-size: 70rpx;
}
.card .content .coupon-detail > view:last-child > view {
color: #54a966;
border: 1rpx solid #54a966;
border-radius: 50rpx;
font-size: 12px;
line-height: 25px;
width: 150rpx;
height: 50rpx;
margin: 100rpx 0 0 5rpx;
text-align: center;
}
.card .coupon-detail > view:nth-child(2) {
flex-direction: column;
padding-top: 60rpx;
width: 40%;
}
.card .coupon-detail > view:nth-child(2) > view {
width: 100%;
}
.card .coupon-detail > view:nth-child(2) > view:first-child {
color: #333;
font-weight: bold;
font-size: 25rpx;
margin: 0 0 10rpx 0;
}
.card .coupon-detail > view:nth-child(2) > view:last-child {
font-size: 12px;
color: #adadad;
margin-top: 5rpx;
}
.card .coupon-detail > view:nth-child(2) > view:last-child > view {
transform: scale(0.8);
margin-left: -14rpx;
}
.card {
.footer {
color: #999;
font-size: 12px;
padding: 30rpx 15rpx 30rpx 30rpx;
}
.ribbon {
width: 160rpx;
height: 40rpx;
background: #54a966;
position: absolute;
right: -40rpx;
top: 25rpx;
transform: rotateZ(45deg);
text-align: center;
color: #fff;
font-size: 20rpx;
line-height: 44rpx;
}
.ribbon.grey {
background: #c6c6c6;
}
}
}
.Hot {
color: $themeColor !important;
}
.AC_chong {
display: flex;
align-items: center;
justify-content: space-between;
background: $themeBgColor;
color: #fff;
border-top-left-radius: 15rpx;
border-top-right-radius: 15rpx;
padding: 20rpx 20rpx;
font-size: 34rpx;
text-align: right;
}
.rightArrow {
width: 40rpx;
height: 40rpx;
float: right;
margin-left: 10rpx;
// position: absolute;
// right: 30rpx;
// top: 20rpx;
}
/deep/.u-alert__content__title
{
// background-color: #f0f0f0;
font-size: 24rpx !important;
// color: #f4511a !important;
line-height: 28rpx !important;
}
</style>

435
pages/wallet/points.vue Normal file
View File

@@ -0,0 +1,435 @@
<template>
<view class="wallet_wrap">
<z-nav-bar title="我的积分" bgColor="#5188e5" fontColor="#fff"></z-nav-bar>
<view class="ACTable"><view>
<view class="AC_con">
<common-list
:dataList="MoneyRecord"
isCondition="true"
isNoIcon="true"
label="orderType"
>
<template slot="labelSlot" slot-scope="slotProps">
<view class="label_content AC_List" @click="slotProps.row.relationId?goClick(slotProps.row.relationId):''">
<view class="point_box">
<view class="title"><view class="AC_time">{{slotProps.row.createTime}}</view></view>
<view class="Hot">
<text v-if="slotProps.row.changeAmount > 0">+</text>
<text>{{slotProps.row.changeAmount}}</text>
</view>
</view>
<view class="AC_mark" v-if="slotProps.row.remark">{{slotProps.row.remark}}</view>
</view>
</template>
</common-list>
</view>
</view>
<view style="padding-bottom: 20rpx">
<u-back-top
:scroll-top="scrollTop"
bottom="60"
:customStyle="bgiStyle"
:iconStyle="iconStyle"
>
</u-back-top>
</view>
</view>
</view>
</template>
<script>
import $http from "@/config/requestConfig.js";
import { mapState } from "vuex";
export default {
data() {
return {
playData: {},
platform: null,
urlList: {
list: "common/jfTransactionDetails/getJfTransactionDetailsList",
},
cardList: [],
couponListTab: 0,
MoneyRecord: [],
userMes: {},
RecordScreen: {
userid: "",
page: 1,
limit: 5,
},
scrollTop: 0,
status: 3,
totalPage: 0,
totalCount: 0,
tab_muJian: 0,
bgiStyle: {
background: "#54a966",
},
iconStyle: {
fontSize: "40rpx",
fontWeight: "bold",
color: "#54a966",
},
};
},
// 返回顶部
onPageScroll(e) {
this.scrollTop = e.scrollTop;
},
//第一次加载
onLoad(e) {
},
computed: {
...mapState(["userInfo"]),
},
//页面显示
onShow() {
this.getData();
},
//方法
methods: {
//列表进入详情
goClick(id){
uni.navigateTo({
url: "/pages/order/infor?orderId=" + id
});
},
//获取数据
getData() {
var data = {
userId: this.userInfo.id,
};
if (!this.iosHide) {
this.tab_muJian = 1;
}
//用户详情
if (this.userInfo.id != undefined) {
this.$http.post("book/user/info/" + this.userInfo.id).then((res) => {
this.userMes = res.user;
});
}
uni.showLoading({
title: '加载中'
})
$http.request({
url: this.urlList.list,
method: "POST",
data,
header: {
"Content-Type": "application/json",
},
})
.then((res) => {
uni.hideLoading();
this.MoneyRecord = res.transactionDetailsList;
});
},
},
};
</script>
<style lang="scss" scoped>
@import "@/static/mixin.scss";
.wallet_wrap{
background-color: #eff5f8;
height: 100%;
overflow: auto;
}
.ACTable {
margin: 30rpx;
border-radius: 15rpx;
background: #fff;
.AC_mes {
width: 100%;
height: 300rpx;
padding: 40rpx 20rpx;
box-shadow: 0 0px 10px 1px #d3d1d133;
border-radius: 15rpx;
margin-bottom: 10rpx;
position: relative;
.wallet_title {
color: $themeColor;
font-size: 40rpx;
line-height: 60rpx;
font-weight: 500 !important;
margin-bottom: 20rpx;
}
.wallet_number {
color: $themeColor;
font-size: 80rpx;
line-height: 80rpx;
font-weight: bold;
}
}
.AC_con {
overflow: hidden;
font-size: 30rpx;
padding-bottom: 30rpx;
.AC_jilu {
font-size: 42rpx;
text-align: left;
color: #3d75bf;
padding: 10rpx 20rpx 40rpx;
}
/deep/.list_item {
padding: 30rpx !important;
}
}
.couponList {
view {
display: inline-block;
padding: 0 0 25rpx 0;
margin: 40rpx 0 40rpx 0;
width: 33%;
text-align: center;
font-size: 30rpx;
}
.couStyle {
border-bottom: 5rpx solid #54a966;
color: #54a966;
font-weight: bold;
}
}
.card {
width: 100%;
overflow: hidden;
margin-bottom: 30rpx;
padding-left: 10rpx;
position: relative;
}
.card > view {
background: #fff;
border-radius: 5rpx;
}
.card .dot-left,
.card .dot-right {
display: block;
width: 12rpx;
height: 12rpx;
border-radius: 50%;
background: #f5f5f5;
position: absolute;
z-index: 999;
}
.card .dot-left {
bottom: -6rpx;
left: -6rpx;
}
.card .dot-right {
bottom: -6rpx;
right: -6rpx;
}
.card .page-group {
position: absolute;
top: 10rpx;
left: -2rpx;
width: 100%;
max-width: 200rpx;
.fold-page {
display: block;
width: 10rpx;
height: 8rpx;
background: #54a966;
transform: skewY(-40deg);
position: absolute;
top: -5rpx;
left: -8rpx;
z-index: 0;
}
.page {
position: absolute;
z-index: 1;
display: block;
padding: 5rpx 20rpx 3rpx 20rpx;
height: 40rpx;
line-height: 40rpx;
background: linear-gradient(137deg, #54a966 0%, #0d5e1e 100%);
border-radius: 0 20rpx 20rpx 0;
color: #fff;
text-align: center;
font-size: 24rpx;
overflow: hidden;
left: -8rpx;
}
}
.card .page-group.grey {
.fold-page {
background: #c6c6c6;
}
.page {
background: linear-gradient(137deg, #c6c6c6 0%, #999595 100%);
}
}
.card .content {
width: 100%;
height: 180rpx;
border-bottom: 1rpx dotted #f5f5f5;
position: relative;
z-index: 2;
}
.card .content .coupon-detail {
display: flex;
padding: 0 15rpx 0 20rpx;
}
.card .content .coupon-detail > view {
height: 130rpx;
display: flex;
align-items: center;
}
.card .content .coupon-detail > view:first-child {
color: #54a966;
padding-top: 100rpx;
width: 30%;
}
.card .content .coupon-detail > view.grey {
color: #c6c6c6;
}
.card .content .coupon-detail > view:first-child > span:first-child {
font-size: 30rpx;
margin: 0 10rpx 0 0;
}
.card .content .coupon-detail > view:first-child > span:last-child {
font-size: 70rpx;
}
.card .content .coupon-detail > view:last-child > view {
color: #54a966;
border: 1rpx solid #54a966;
border-radius: 50rpx;
font-size: 12px;
line-height: 25px;
width: 150rpx;
height: 50rpx;
margin: 100rpx 0 0 5rpx;
text-align: center;
}
.card .coupon-detail > view:nth-child(2) {
flex-direction: column;
padding-top: 60rpx;
width: 40%;
}
.card .coupon-detail > view:nth-child(2) > view {
width: 100%;
}
.card .coupon-detail > view:nth-child(2) > view:first-child {
color: #333;
font-weight: bold;
font-size: 25rpx;
margin: 0 0 10rpx 0;
}
.card .coupon-detail > view:nth-child(2) > view:last-child {
font-size: 12px;
color: #adadad;
margin-top: 5rpx;
}
.card .coupon-detail > view:nth-child(2) > view:last-child > view {
transform: scale(0.8);
margin-left: -14rpx;
}
.card {
.footer {
color: #999;
font-size: 12px;
padding: 30rpx 15rpx 30rpx 30rpx;
}
.ribbon {
width: 160rpx;
height: 40rpx;
background: #54a966;
position: absolute;
right: -40rpx;
top: 25rpx;
transform: rotateZ(45deg);
text-align: center;
color: #fff;
font-size: 20rpx;
line-height: 44rpx;
}
.ribbon.grey {
background: #c6c6c6;
}
}
}
.Hot {
color: $themeColor !important;
font-size: 32rpx;
font-weight: bold;
}
.AC_chong {
display: flex;
align-items: center;
justify-content: space-between;
background-image: linear-gradient(90deg, #258feb 0%, #73ee9c 100%);
color: #fff;
border-top-left-radius: 15rpx;
border-top-right-radius: 15rpx;
padding: 20rpx 20rpx;
font-size: 36rpx;
font-weight: 800;
text-align: right;
}
.rightArrow {
width: 40rpx;
height: 40rpx;
float: right;
margin-left: 10rpx;
}
.point_box{
display: flex;
align-items: center;
justify-content: space-between;
padding: 10rpx 0;
color: #333;
}
.title{
font-size: 32rpx;
font-weight: bold;
}
.AC_mark {
width: 100%;
display: block;
font-size: 28rpx;
color: #343434;
}
.AC_time {
color: #909090;
font-size: 28rpx;
padding-top: 10rpx;
}
</style>

786
pages/wallet/recharge.vue Normal file
View File

@@ -0,0 +1,786 @@
<template>
<view class="commonPageBox">
<z-nav-bar title="充值" bgColor="#5188e5" fontColor="#fff"></z-nav-bar>
<view>
<view class="cha_jine">
<view class="cj_title PM_font">充值金额</view>
<view class="cj_xiang">
<view v-for="(item, index) in cjList" @click="chosPric(item)" :class="
stepsCj.priceTypeId == item.priceTypeId
? 'Tab_cj cj_price'
: 'cj_price'
">
<view class="pr_jg">{{ item.realMoney }}</view>
<view class="pr_yl">{{ item.money }} 天医币</view>
<view class="pr_lj">限时特惠</view>
</view>
<br clear="both" />
</view>
</view>
<view class="cha_fangsh" v-if="isAndroid">
<view class="cf_title PM_font">支付方式</view>
<view class="cf_radio">
<u-radio-group v-model="payType">
<view style="width: 100%">
<view v-for="(item, index) in paylist" @click="choseType(item.id)"
:class="payType == item.id ? 'Tab_xf cf_xuanx' : 'cf_xuanx'">
<image class="pay_item_img" :src="item.imgUrl" mode="aspectFil">
</image>
{{ item.title }}
<u-radio :key="index" activeColor="#5188e5" :name="item.id"
style="float: right; margin-top: 5rpx"></u-radio>
</view>
</view>
</u-radio-group>
</view>
</view>
<view class="agree_wo flexbox" style="float: left; display: flex">
<radio-group class="agree">
<view v-for="(item, index) in argee" :key="index">
<radio class="agreeRadio" :value="item.id" :checked="item.id == radioValue" color="#5188e5"
@click="radioCheck(index)"></radio>
</view>
</radio-group>
<view>* 我已阅读并同意<span class="highlight" @click="showXieyi">增值服务协议</span></view>
</view>
<view class="char_btn">
<view @click="goToPay">立即充值</view>
</view>
</view>
<!-- 充值协议 -->
<u-popup :show="xieyiShow" :round="10" @close="xieyiShow = false">
<view class="tanchu">
<view class="dp_title">{{ xieyi.title }}</view>
<view style="max-height: 1000rpx; overflow-y: scroll">
<view v-html="xieyi.content"></view>
</view>
</view>
</u-popup>
</view>
</template>
<script>
import $http from "@/config/requestConfig.js";
import { checkIapOrder } from "@/store/modules/common.js";
import {
mapState,
mapMutations
} from "vuex";
import {
setPay,
setPayAssign,
setWXPay
} from "@/config/utils";
export default {
data() {
return {
playData: {},
options: {},
xieyi: {
title: "",
content: "",
},
chargeOrderSn: "", // 通过query传过来的orderSN二次支付情况
xieyiShow: false,
stepsCj: {},
cjList: [],
argee: [{value: false, id: "1"}], // 同意权限
radioValue: "",
orderSn: "", // 订单sn
productid: "",
isAndroid: true, // 是否为安卓环境
payType: null,
paylist: [{
title: "支付宝",
id: 2,
imgUrl: require("@/static/icon/pay_1.png"),
},
{
title: "微信",
id: 1,
imgUrl: require("@/static/icon/pay_2.png"),
},
],
transaction: {
//成功回调
},
urlList: {
list: "common/bookBuyConfig/getBookBuyConfigList",
},
};
},
//第一次加载
onLoad(options) {
this.options = options;
if (this.$platform == "ios") {
this.payType = 3;
} else {
this.payType = 1;
}
this.chargeOrderSn = options.orderSn;
this.getDevName();
},
//页面显示
onShow() {
},
computed: {
...mapState(["userInfo"]),
},
//方法
methods: {
...mapMutations(["setUserInfo"]),
// 关闭交易订单
finishTransaction(trans) {
this.iapChannel.finishTransaction(
trans,
(success) => {
console.log("关闭订单成功");
this.setUserInfo({
restoreFlag: false,
});
},
(fail) => {
console.log("关闭订单失败");
}
);
},
async showXieyi() {
var data = await this.$commonJS.getAgreement(114);
if (data.content) {
data.content = data.content.replace(
/<h5>/g,
'<view style="font-weight: bold;font-size: 32rpx;margin-top: 20rpx;margin-bottom: 20rpx;">'
);
data.content = data.content.replace(/<\/h5>/g, "</view>");
}
this.xieyi = data;
this.xieyiShow = true;
},
//勾选用户协议
radioCheck(index) {
this.argee.forEach((item) => {
item.isCheck = false;
});
if (this.radioValue == this.argee[index].id) {
this.radioValue = null;
} else {
this.radioValue = this.argee[index].id;
}
},
getProvider() {
return new Promise((resolve, reject) => {
uni.getProvider({
service: 'payment',
success: (res) => {
const iapChannel = res.providers.find((channel) => {
return (channel.id === 'appleiap')
})
resolve(iapChannel);
// 如果 iapChannel 为 null说明当前包没有包含iap支付模块。注意HBuilder基座不包含 iap 通道
}
});
})
},
requestPayment(orderInfo) {
let that = this
return new Promise((resolve, reject) => {
uni.requestPayment({
provider: 'appleiap',
orderInfo: orderInfo,
success: (res) => {
that.iapCheck(res);
resolve(res);
},
fail: (err) => {
uni.hideLoading()
that.restoreComplateRequest()
if (err.code == 2) {
uni.showToast({
title: '取消支付,内购订单即将关闭',
icon: 'none'
})
} else {
uni.showToast({
title: '支付失败,内购订单即将关闭',
icon: 'none'
})
}
reject(err);
}
});
})
},
// 查询未关闭iap订单
async restoreComplateRequest() {
let that = this;
await this.iapChannel.restoreCompletedTransactions({
manualFinishTransaction: true
}, function(results) {
// results 格式为数组存放恢复的IAP商品交易信息对象 IAPTransaction通用需将返回的支付凭证传给后端进行二次认证
that.ComplateRequestArr = results
console.log('未完成订单数组共有:', that.ComplateRequestArr.length)
if (results && results.length > 0) {
results.map((item, index) => {
that.finishTransaction(item);
});
}
});
},
async iphonepay() {
const that = this;
uni.showLoading({
title: "检测支付环境"
})
this.iapChannel = await this.getProvider()
if (this.iapChannel) {
await this.restoreComplateRequest();
await this.requestOrder();
} else {
uni.hideLoading()
uni.showToast({
title: '不支持内购支付',
icon: 'none'
})
}
},
requestOrder() {
uni.showLoading({
title: "获取商品信息",
mask: true,
});
const that = this;
let IAPOrders = [];
IAPOrders.push('t' + that.stepsCj.priceTypeId);
// 新建订单
uni.showLoading({
title: "正在创建订单",
mask: true,
});
that.iapChannel.requestProduct(
IAPOrders,
function(event) {
for (var index in event) {
var OrderItem = event[index];
that.topay(OrderItem.productid);
}
},
function(erroemsg) {
uni.showToast({
title: "商品获取失败",
icon: "none",
});
}
);
},
async topay(id) {
const that = this;
uni.showLoading({
title: "正在支付",
mask: true,
});
let orderInfo = {
productid: id,
username: that.orderSn, // 用户标识/订单标识
quantity: 1,
manualFinishTransaction: true, // 3.5.1+ 支持,设置此参数后需要开发者主动关闭订单,参见下面的关闭订单方法 finishTransaction()
}
that.transaction = await that.requestPayment(orderInfo)
},
iapCheck(result) {
let that = this;
let data = {
transactionId: result.transactionIdentifier, // 支付交易id
customerOid: that.userInfo.id,
productId: result.payment.productid.slice(1), // 产品id
orderId: result.payment.username, // 系统订单号
receiptData: result.transactionReceipt, // 苹果返回收据
// sandBox: true, //测试数据
// body: that.stepsCj.priceTypeId //充值类型id
};
$http
.request({
url: "Ipa/veri",
method: "POST",
data,
header: {
"Content-Type": "application/json",
},
})
.then((res) => {
if (res.code == 0) {
that.transaction = null
uni.hideLoading()
uni.showToast({
title: '充值成功!',
icon: 'success'
})
//服务器验证票据有效后在客户端关闭订单 (iapChannel.finishTransaction)
that.finishTransaction(result);
setTimeout(() => {
uni.switchTab({
url: '/pages/my/index'
})
}, 2000);
}
})
.catch((e) => {
uni.hideLoading()
that.finishTransaction(result);
uni.showModal({
title: "提示",
showCancel: false,
content: "支付验证失败请稍后重启app如不能解决您的问题可联系官方客服",
success: function(res) {
if (res.confirm) {
console.log("用户点击确定");
}
},
});
}, )
},
//获取使用环境
getDevName() {
if (uni.getSystemInfoSync().platform === "android") {
this.isAndroid = true;
} else {
this.isAndroid = false;
}
this.getData();
},
//获取充值金额
getData() {
if (this.isAndroid) {
this.getAndorList();
} else {
this.getAppleList();
}
},
// 安卓充值列表
getAndorList() {
uni.showLoading({
title: '加载中'
})
var data = {
type: "point",
qudao: "Android",
};
$http.request({
url: this.urlList.list,
method: "POST",
data,
header: {
"Content-Type": "application/json",
},
})
.then((res) => {
uni.hideLoading();
this.cjList = res.bookBuyConfigList;
this.stepsCj = res.bookBuyConfigList[0];
});
},
// 苹果充值列表
getAppleList() {
var data = {
type: "point",
qudao: "IOS",
};
$http.request({
url: this.urlList.list,
method: "POST",
data,
header: {
"Content-Type": "application/json",
},
})
.then((res) => {
this.cjList = res.bookBuyConfigList;
this.stepsCj = res.bookBuyConfigList[0];
});
},
// 点击充值金额
chosPric(e) {
this.stepsCj = e;
},
// 选择支付方式1
choseType(e) {
let that = this;
that.payType = e;
},
// 充值
goToPay() {
this.kaiChar();
},
// 正常充值
kaiChar() {
if (!this.payType) {
uni.showToast({
title: "请勾选支付方式",
icon: "none",
});
return false;
}
//常规充值
if (this.radioValue == "1") {
uni.showLoading({
title: "支付中,请勿离开",
icon: "loading",
});
let that = this;
let data = {
userId: that.userInfo.id, //下单人ID
userPhone: that.userInfo.tel, //收货人手机号
paymentMethod: that.payType, //2支付宝1微信3ios内购
orderMoney: that.stepsCj.money * 1, //订单金额
districtMoney: 0, //优惠金额
realMoney: that.stepsCj.money * 1, //实收金额
appName: "xlkj",
come: "3",
productId: that.stepsCj.priceTypeId, // 充值的类型id
};
$http.request({
url: "book/buyOrder/rechargeSave",
method: "POST",
data,
header: {
"Content-Type": "application/json",
},
})
.then((res) => {
that.orderSn = res.orderSn;
uni.hideLoading();
if (res.code == 0) {
if (that.payType == 2) {
setPay({
typePay: "alipay",
subject: "point",
totalAmount: that.stepsCj.money,
type: that.payType,
relevanceoid: res.orderSn,
body: that.stepsCj.priceTypeId,
},
(res) => {
if (res.success) {
uni.showToast({
title: "支付成功",
});
setTimeout(() => {
uni.navigateTo({
url: "/pages/wallet/account?source=recharge",
});
}, 2000);
} else {
uni.showToast({
title: "支付失败",
icon: "none"
});
}
}
);
} else if (that.payType == 1) {
// 微信支付
that.orderSn = res.orderSn;
let data1 = {
orderSn: res.orderSn,
buyOrderId: that.stepsCj.priceTypeId,
totalAmount: that.stepsCj.money,
};
setWXPay(data1, (res) => {
if (res.success) {
uni.showToast({
title: "支付成功",
});
setTimeout(() => {
uni.navigateTo({
url: "/pages/wallet/account?source=recharge",
});
}, 2000);
} else {
console.log(res);
if (res.data.errMsg.indexOf("User canceled") != -1) {
uni.showToast({
title: "用户取消支付",
icon: "none"
});
} else {
uni.showToast({
title: "支付失败",
icon: "none"
});
}
}
});
} else if (that.payType == 3) {
that.iphonepay();
}
}
});
} else {
uni.showToast({
title: "请勾选 已阅读增值服务协议",
icon: "none",
});
return false;
}
},
// 跳转
onPageJump(url) {
uni.navigateTo({
url: url,
});
},
},
};
</script>
<style lang="scss" scoped>
@import "@/static/mixin.scss";
.tanchu {
padding: 40rpx 30rpx 40rpx 30rpx;
position: relative;
.dp_title {
font-size: 32rpx;
margin-bottom: 50rpx;
color: #555;
text-align: center;
font-weight: bold;
}
.dp_add {
position: absolute;
top: 40rpx;
right: 30rpx;
font-size: 22rpx;
background-color: #fd6004;
color: #fff;
border-radius: 10rpx;
padding: 5rpx 10rpx;
.u-icon {
display: inline-block;
margin-right: 5rpx;
}
}
.addressItem {
border: 2px dashed #d9d9d9;
border-radius: 10rpx;
width: 100%;
display: flex;
padding: 20rpx 10rpx;
margin: 25rpx 0 0 0;
align-items: center;
background-color: #fff;
.addrContent {
margin-left: 40rpx;
flex: 1;
.addrContentTop {
display: flex;
align-items: flex-end;
margin: 0 0 15rpx 0;
position: relative;
.userName {
font-size: 35rpx;
font-weight: bold;
margin-right: 30rpx;
}
.userTel {
font-size: 25rpx;
color: #888;
}
.userMoren {
border: 1px solid #fd6004;
color: #fd6004;
padding: 3rpx 10rpx;
font-size: 22rpx;
border-radius: 10rpx;
margin: 0 0 0 20rpx;
}
.chooseCheck {
position: absolute;
top: 3rpx;
right: 6rpx;
}
}
.addrContentBottom {
font-size: 32rpx;
}
}
}
.addressItem.addItem_style {
border-color: #fd6004;
}
.youhuiItem {
border: 1px solid #d9d9d9;
border-radius: 10rpx;
width: 100%;
display: flex;
padding: 20rpx 10rpx;
margin: 25rpx 0 0 0;
align-items: center;
background-color: #fff;
font-size: 30rpx;
}
.youhuiItem>view {
float: left;
}
.youhuiItem.youItem_style {
border-color: #fd6004;
}
}
.agreeRadio {
zoom: 0.8;
}
.cha_jine {
padding: 60rpx 30rpx 40rpx;
.cj_title {
font-size: 46rpx;
color: #294a97;
}
.cj_xiang {
margin-top: 40rpx;
.cj_price {
box-shadow: 0 0 20rpx 0 #0000001a;
float: left;
width: 47%;
margin: 0 5% 30rpx 0;
text-align: center;
padding: 20rpx;
border-radius: 15rpx;
position: relative;
color: #2d2d2d;
.pr_jg {
font-size: 45rpx;
margin: 20rpx 0 10rpx 0;
font-weight: bold;
}
.pr_yl {
font-size: 26rpx;
color: #575555;
}
.pr_lj {
background-image: linear-gradient(180deg, #5188e5 0%, #abcbfb 100%);
color: #fff;
position: absolute;
top: -20rpx;
right: -20rpx;
z-index: 999;
font-size: 24rpx;
line-height: 20px;
padding: 5rpx 10rpx;
border-top-left-radius: 20rpx;
border-bottom-right-radius: 20rpx;
}
}
.cj_price:nth-child(2n) {
margin-right: 0;
}
.Tab_cj {
box-shadow: 0px 0px 5px 0px $themeColor !important;
color: $themeColor;
.pr_yl{
color: $themeColor;
}
}
}
}
.highlight {
color: $themeColor;
}
.cha_fangsh {
padding: 40rpx 30rpx;
.cf_title {
font-size: 46rpx;
color: #294a97;
}
.cf_radio {
margin-top: 20rpx;
.cf_xuanx {
font-size: 32rpx;
padding: 20rpx 0;
margin-bottom: 20rpx;
border-bottom: 1px solid #ededed;
image {
width: 40rpx;
height: 40rpx;
display: inline-block;
margin-right: 20rpx;
vertical-align: bottom;
}
}
}
}
.agree_wo {
color: #aaa;
font-size: 25rpx;
margin-top: 30rpx;
padding: 30rpx;
padding-bottom: 180rpx;
}
.char_btn {
position: fixed;
left: 0;
right: 0;
bottom: 30rpx;
view {
background: $themeBgColor;
color: #fff;
width: 90%;
margin: 0 auto;
text-align: center;
font-size: 30rpx;
padding: 20rpx 0;
border-radius: 50rpx;
}
}
.pay_item_img {
width: 50rpx;
height: 50rpx;
float: left;
margin-right: 20rpx;
}
.agree {
width: auto !important;
}
.commonPageBox {
background-color: #fff !important;
}
</style>

View File

@@ -1,6 +1,6 @@
<template>
<view class="content">
<z-nav-bar title="吴门医述"></z-nav-bar>
<z-nav-bar title="吴门医述" bgColor="#5188e5" fontColor="#fff"></z-nav-bar>
<z-navigation></z-navigation>
</view>
</template>