| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339 |
- <template>
- <view class="content">
- <view class="type-item">
- <view class="item-title" v-if="userInfo.type == 1">咨询预约</view>
- <view class="item-title" v-if="userInfo.type == 2">我的病人</view>
- <view class="item-title" v-if="userInfo.type == 3">预约管理</view>
- <!-- <view class="record" v-if="userInfo.type == 3" @click="ToMyorder">预约记录</view> -->
- <view class="navbar flex">
- <view v-for="(item, index) in navList" :key="index" class="nav-item"
- :class="{ current: tabCurrentIndex === index }" @click="tabClick(index)">{{ item.text }}</view>
- </view>
- <swiper :current="tabCurrentIndex" class="swiper-box" duration="300" @change="changeTab">
- <swiper-item class="tab-content" v-for="(tabItem, tabIndex) in navList" :key="tabIndex">
- <scroll-view class="list-scroll-content" scroll-y @scrolltolower="loadData">
- <!-- 空白页 -->
- <empty v-if="tabItem.loaded === true && tabItem.orderList.length === 0"></empty>
- <!-- 订单列表 -->
- <view v-for="(item, index) in tabItem.orderList" :key="index" class="order-item">
- <view class="i-top flex_item">
- <image src="/static/img/img021.png"></image>
- <view class="time">
- 发起时间:
- <text>{{ item.add_time }}</text>
- </view>
- <view v-if="userInfo.type == 1 || userInfo.type == 3">
- <view class="state" v-if="item.refund == 0">
- {{
- item.status == 0
- ? '未支付'
- : item.status == 1
- ? '已支付'
- : item.status == 2
- ? '已预约'
- : item.status == 3
- ? '待确认'
- : item.status == 4
- ? '已确认'
- : item.status == 5
- ? '已完成'
- : '已评价'
- }}
- </view>
- <view class="state" v-if="item.refund != 0">
- {{ item.refund == 1 ? '退款中' : item.status == 2 ? '退款完成' : '退款失败' }}
- </view>
- </view>
- <view v-if="userInfo.type == 2">
- <view class="state" v-if="item.refund == 0">
- {{
- item.status == 0
- ? '未支付'
- : item.status == 1
- ? '已支付'
- : item.status == 2
- ? '已预约'
- : item.status == 3
- ? '已确认'
- : item.status == 4
- ? '待确认'
- : item.status == 5
- ? '已完成'
- : '已评价'
- }}
- </view>
- <view class="state" v-if="item.refund != 0">
- {{ item.refund == 1 ? '退款中' : item.status == 2 ? '退款完成' : '退款失败' }}
- </view>
- </view>
- </view>
- <view class="goods-box-single flex_item" @click="ToChat(item)">
- <view class="img-box">
- <view v-if="item.status == 1 || item.status == 2">
- <view class="corner" v-if="item.no_read > 0 && item.refund == 0">
- <text>{{ item.no_read }}</text>
- </view>
- </view>
- <image v-if="userInfo.type != 2" class="goods-img"
- :src="item.doctor_avatar || '/static/error/missing-face.png'" mode="aspectFill">
- </image>
- <image v-if="userInfo.type == 2" class="goods-img"
- :src="item.patient_avatar || '/static/error/missing-face.png'"
- mode="aspectFill"></image>
- </view>
- <view class="right">
- <text class="title clamp" v-if="userInfo.type != 2">
- {{ item.doctor_name }}({{
- item.doctor_level == 1 ? '初级' : item.doctor_level == 2 ? '中级' : item.doctor_level == 3 ? '副高级' : '正高级'
- }})
- </text>
- <view v-if="userInfo.type == 2">
- <text class="title clamp"
- v-if="item.type == 1 || item.type == 2">{{ item.patient_name }}</text>
- <text class="title clamp" v-if="item.type == 3">{{ item.organ_name }}</text>
- </view>
- <view class="title clamp font-da">
- {{ item.type == 1 ? '咨询' : item.type == 2 ? '预约麻醉' : '多点执业' }}
- </view>
- <view class="title red" v-if="userInfo.type != 2 && item.refund == 1">
- 您申请的退款将在平台审核后,退回您的账户,感谢您使用麻醉服务平台。</view>
- </view>
- <view class="appointment"
- v-if="userInfo.type == 2 && item.refund == 0 && item.status != 0">回复详情</view>
- <view class="appointment"
- v-if="userInfo.type != 2 && item.refund == 0 && item.status != 0">立即咨询</view>
- <!-- 0未支付 1病人已支付 2已预约时间 3医生确认完成 4病人已完成 5已完成 6已评价 -->
- </view>
- <view class="action-box b-t" v-if="userInfo.type != 2">
- <view class="action-btn" v-if="item.status == 0" @click="ConfirmPay(item)">去支付</view>
- <view class="action-btn" v-if="item.status == 0" @click="Cancel(item.order_id)">取消订单
- </view>
- <view class="action-btn"
- v-if="(item.refund == 0 && item.status == 2) || item.status == 3"
- @click="Completion(item.order_id)">确认完成</view>
- <view class="action-btn" v-if="item.status == 4 || item.status == 5"
- @click="ToEvaluate(item.order_id)">去评价</view>
- <view class="action-btn"
- v-if="item.status == 4 || item.status == 5 || item.status == 6 || item.status == 7"
- @click="open(item.order_id)">
- 打赏医生
- </view>
- <view class="action-btn" v-if="item.refund == 0 && item.status == 2"
- @click="open1(item)">退款</view>
- <!-- <view class="action-btn" v-if="item.refund == 1" @click="cancel(item.order_id)">取消退款</view> -->
- <view class="action-btn"
- v-if="item.status == 4 || item.status == 5 || item.status == 6 || item.status == 7"
- @click="ToZixu(item)">再次咨询</view>
- <!-- <view class="action-btn" v-if="item.status == 6" @click="del(item)">删除订单</view> -->
- </view>
- <view class="action-box b-t" v-if="userInfo.type == 2">
- <view class="action-btn"
- v-if="(item.refund == 0 && item.status == 2) || item.status == 4 || item.status == 7"
- @click="Completion(item.order_id)">
- 确认完成
- </view>
- <view class="action-btn" v-if="item.refund == 0 && item.status == 2"
- @click="open1(item)">退款</view>
- </view>
- </view>
- <uni-load-more :status="tabItem.loadingType"></uni-load-more>
- </scroll-view>
- </swiper-item>
- </swiper>
- </view>
- <!-- 申请退款弹窗 -->
- <uni-popup ref="popup1" type="center">
- <view class="popup">
- <view class="row">
- <view class="row-1">申请退款</view>
- <input class="row-2" type="text" v-model="reason" placeholder="请输入退款理由" />
- <button class="row-3 flex" @click="refund">申请退款</button>
- </view>
- </view>
- <view class="close_icon" @click="close1">
- <image src="../../static/img/img016.png"></image>
- </view>
- </uni-popup>
- <!-- 打赏金额弹出层 -->
- <uni-popup ref="popup" type="center">
- <view class="popup">
- <!-- <image class="img" mode="widthFix" src="../../static/img/img022.png"></image> -->
- <view class="row">
- <view class="row-1">打赏金额</view>
- <input class="row-2" type="number" v-model="money" placeholder="请输入打赏金额" />
- <button class="row-3 flex" @click="Reward">立即打赏</button>
- </view>
- </view>
- <view class="close_icon" @click="close">
- <image src="../../static/img/img016.png"></image>
- </view>
- </uni-popup>
- <!-- 支付弹窗 -->
- <uni-popup ref="popup2" style="z-index: 999;" type="bottom">
- <view class="payment">
- <view class="first flex " @click="payclose()">
- <text class="word">选择支付方式</text>
- <image src="../../static/img/img25.png"></image>
- </view>
- <view class="pay-type-list">
- <view class="type-item b-b" @click="changePayType(1)">
- <view class="img">
- <image class="yue" src="../../static/img/img26.png"></image>
- </view>
- <view class="con"><text class="tit">微信支付</text></view>
- <label class="radio">
- <radio value="" color="#FC4141" :checked="payType == 1"></radio>
- </label>
- </view>
- <view class="type-item flex_item" @click="changePayType(2)">
- <view class="img">
- <image class="yue" src="../../static/img/img017.png"></image>
- </view>
- <view class="con"><text class="tit">余额支付</text></view>
- <label class="radio">
- <radio value="" color="#FC4141" :checked="payType == 2"></radio>
- </label>
- </view>
- </view>
- <view class="one"></view>
- <view class="Third flex">
- <view class="two1">
- <text class="two1-1 ">合计:</text>
- <text class="two1-2">¥</text>
- <text class="two1-2 size">{{ money }}</text>
- </view>
- <view class="two2" :class="{ clickbg: payLoding }" @click.stop="!payLoding ? confirm() : ''">
- <text>立即支付</text>
- </view>
- </view>
- </view>
- </uni-popup>
- </view>
- </template>
- <script>
- import {
- mapState,
- mapMutations
- } from 'vuex';
- import uniLoadMore from '@/components/uni-load-more/uni-load-more.vue';
- import DatetimePicker from '@/components/datetime-picker/datetime-picker.vue';
- import empty from '@/components/empty';
- import {
- getTime
- } from '@/utils/rocessor.js';
- import uniPopup from '@/components/uni-popup/uni-popup.vue';
- import {
- orderList,
- go_pay,
- cancel,
- setTime,
- patientFinish,
- doctorFinish,
- refund,
- cancelRefund,
- reward
- } from '@/api/patient.js';
- // #ifdef H5
- import weixinObj from '@/libs/jweixin-module/index.js';
- import {
- weixindata
- } from '@/utils/wxAuthorized';
- // #endif
- export default {
- components: {
- uniLoadMore,
- empty,
- uniPopup,
- DatetimePicker
- },
- data() {
- return {
- tabCurrentIndex: 0,
- time: '', //预定时间
- rewardId: '', //打赏的订单id
- refundId: '', //申请退款的id
- money: '', //打赏金额
- reason: '', //退款理由
- payType: 1, //支付类型
- payLoding: false, //判断是否支付中
- // #ifdef H5
- froms: '', //当前是否为微信浏览器
- // #endif
- type: '', //判断是否从订单中进入
- navList: [{
- state: 0,
- text: '全部',
- loadingType: 'more',
- orderList: [],
- page: 1, //当前页数
- limit: 10 //每次信息条数
- },
- {
- state: 1,
- text: '进行中 ',
- loadingType: 'more',
- orderList: [],
- page: 1, //当前页数
- limit: 10 //每次信息条数
- },
- {
- state: 2,
- text: '待评价',
- loadingType: 'more',
- orderList: [],
- page: 1, //当前页数
- limit: 10 //每次信息条数
- }
- ]
- };
- },
- computed: {
- ...mapState(['userInfo'])
- },
- onShow() {
- console.log(this.userInfo, 'patient');
- // this.tabCurrentIndex = 0;
- this.loadData('Refresh');
- // 1是病人 2是医生 3是机构
- if (this.userInfo.type == 2) {
- uni.setTabBarItem({
- index: 0,
- text: '首页',
- iconPath: 'static/tabBar/tab-home.png',
- selectedIconPath: 'static/tabBar/tab-home-current.png'
- });
- uni.setTabBarItem({
- index: 1,
- text: '我的病人',
- iconPath: 'static/tabBar/tab-cate.png',
- selectedIconPath: 'static/tabBar/tab-cate-current.png',
- visible: true
- });
- uni.setTabBarItem({
- index: 2,
- text: '科普学习',
- iconPath: 'static/tabBar/tab-study.png',
- selectedIconPath: 'static/tabBar/tab-study-current.png',
- visible: false
- });
- uni.setTabBarItem({
- index: 3,
- text: '接单',
- iconPath: 'static/tabBar/jd.png',
- selectedIconPath: 'static/tabBar/jd-act.png',
- pagePath: '/pages/dd/dd'
- })
- uni.setTabBarItem({
- index: 4,
- text: '我的',
- iconPath: 'static/tabBar/tab-my.png',
- selectedIconPath: 'static/tabBar/tab-my-current.png'
- });
- }
- if (this.userInfo.type == 1) {
- uni.setTabBarItem({
- index: 0,
- text: '首页',
- iconPath: 'static/tabBar/tab-home.png',
- selectedIconPath: 'static/tabBar/tab-home-current.png'
- });
- uni.setTabBarItem({
- index: 1,
- text: '咨询记录',
- iconPath: 'static/tabBar/tab-cate.png',
- selectedIconPath: 'static/tabBar/tab-cate-current.png',
- visible: true
- });
- uni.setTabBarItem({
- index: 2,
- text: '科普学习',
- iconPath: 'static/tabBar/tab-study.png',
- selectedIconPath: 'static/tabBar/tab-study-current.png',
- visible: true
- });
- uni.setTabBarItem({
- index: 3,
- text: '接单',
- iconPath: 'static/tabBar/jd.png',
- selectedIconPath: 'static/tabBar/jd-act.png',
- visible: false
- })
- uni.setTabBarItem({
- index: 4,
- text: '我的',
- iconPath: 'static/tabBar/tab-my.png',
- selectedIconPath: 'static/tabBar/tab-my-current.png.png'
- });
- }
- if (this.userInfo.type == 3) {
- uni.setTabBarItem({
- index: 0,
- text: '首页',
- iconPath: 'static/tabBar/tab-home.png',
- selectedIconPath: 'static/tabBar/tab-home-current.png'
- });
- uni.setTabBarItem({
- index: 1,
- text: '咨询记录',
- iconPath: 'static/tabBar/tab-cate.png',
- selectedIconPath: 'static/tabBar/tab-cate-current.png'
- });
- uni.setTabBarItem({
- index: 2,
- text: '科普学习',
- iconPath: 'static/tabBar/tab-study.png',
- selectedIconPath: 'static/tabBar/tab-study-current.png',
- visible: false
- });
- uni.setTabBarItem({
- index: 3,
- text: '发布订单',
- iconPath: 'static/tabBar/jd.png',
- selectedIconPath: 'static/tabBar/jd-act.png',
- pagePath: '/pages/dd/dd'
- })
- uni.setTabBarItem({
- index: 4,
- text: '我的',
- iconPath: 'static/tabBar/tab-my.png',
- selectedIconPath: 'static/tabBar/tab-my-current.png'
- });
- }
- },
- //下拉刷新
- onPullDownRefresh() {
- let obj = this;
- //监听下拉刷新动作的执行方法,每次手动下拉刷新都会执行一次
- obj.loadData('Refresh');
- // setTimeout(function() {
- // obj.loadData("Refresh");
- // uni.stopPullDownRefresh(); //停止下拉刷新动画
- // }, 1000);
- },
- methods: {
- //修改当前选中的时间下标
- // changeTimeIndex(index) {
- // this.actionItem = index;
- // console.log(this.actionItem,'actionItem')
- // },
- /**
- * 选择日期时间
- * @param {Object} date 日期数据
- */
- //选择时间
- // changeDatetimePicker(date) {
- // console.log(2222,date.fmt3)
- // this.navList[this.tabCurrentIndex].orderList[this.actionItem].time = date.fmt3;
- // console.log(this.navList[this.tabCurrentIndex].orderList)
- // },
- //获取订单列表
- loadData(source) {
- //这里是将订单挂载到tab列表下
- let index = this.tabCurrentIndex;
- let navItem = this.navList[index];
- let state = navItem.state;
- if (source === 'Refresh') {
- // 刷新数据
- navItem.page = 1;
- navItem.loadingType = 'more';
- navItem.orderList = [];
- }
- if (navItem.loadingType === 'loading') {
- //防止重复加载
- return;
- }
- if (navItem.loadingType === 'noMore') {
- //防止重复加载
- return;
- }
- // 修改当前对象状态为加载中
- navItem.loadingType = 'loading';
- orderList({
- state: state,
- keyword: '',
- page: navItem.page,
- limit: navItem.limit
- })
- .then(({
- data
- }) => {
- let arr = data.list.map(e => {
- e.add_time = getTime(e.add_time);
- return e;
- });
- navItem.orderList = navItem.orderList.concat(arr);
- navItem.page++;
- if (source == 'Refresh') {
- uni.stopPullDownRefresh(); //停止下拉刷新动画
- }
- if (navItem.limit == arr.length) {
- //判断是否还有数据, 有改为 more, 没有改为noMore
- navItem.loadingType = 'more';
- return;
- } else {
- //判断是否还有数据, 有改为 more, 没有改为noMore
- navItem.loadingType = 'noMore';
- }
- this.$set(navItem, 'loaded', true);
- })
- .catch(e => {
- console.log(e);
- });
- },
- ConfirmPay(item) {
- let obj = this;
- uni.showModal({
- title: '提示',
- content: '确定支付' + item.pay_price + '吗?',
- success: function(res) {
- if (res.confirm) {
- go_pay({
- order_id: item.order_id
- })
- .then(({
- data
- }) => {
- console.log(item, data);
- if (item.pay_type == 2) {
- obj.payLoding = false;
- obj.$api.msg(msg);
- obj.loadData('Refresh');
- } else {
- obj.orderMoneyPay(data);
- }
- })
- .catch(e => {
- obj.payLoding = false;
- console.log(e.message);
- });
- } else if (res.cancel) {
- obj.payLoding = false;
- obj.$api.msg('取消支付');
- }
- }
- });
- },
- // 微信支付金额
- orderMoneyPay(data) {
- let obj = this;
- let config = data.jsConfig;
- weixindata().then(e => {
- weixinObj
- .chooseWXPay({
- timestamp: config.timestamp,
- nonceStr: config.nonceStr,
- package: config.package,
- signType: config.signType,
- paySign: config.paySign,
- success: function(res) {
- console.log(res);
- obj.$api.msg(res);
- obj.payLoding = false;
- },
- fail: function(res) {
- obj.payLoding = false;
- console.log(res, '失败');
- console.log(res.errMsg);
- }
- })
- .catch(e => {
- obj.payLoding = false;
- console.log(e.message);
- });
- });
- },
- //再次咨询
- ToZixu(item) {
- console.log(item);
- uni.navigateTo({
- url: '/pages/doctor/expert?id=' + item.doctor_id
- });
- },
- //取消订单
- Cancel(item) {
- let obj = this;
- cancel({
- order_id: item
- })
- .then(({
- data
- }) => {
- obj.$api.msg(data.msg);
- obj.loadData('Refresh');
- })
- .catch(e => {
- console.log(e.message);
- });
- },
- //确认订单完成
- Completion(item) {
- let obj = this;
- //病人和机构确认完成订单
- if (obj.userInfo.type == 1 || obj.userInfo.type == 3) {
- patientFinish({
- order_id: item
- })
- .then(data => {
- obj.$api.msg(data.msg);
- obj.loadData('Refresh');
- })
- .catch(e => {
- console.log(e.message);
- });
- }
- //医生确认完成订单
- if (obj.userInfo.type == 2) {
- doctorFinish({
- order_id: item
- })
- .then(data => {
- obj.$api.msg(data.msg);
- obj.loadData('Refresh');
- })
- .catch(e => {
- console.log(e.message);
- });
- }
- },
- //选中预约时间
- Appointment(item) {
- let obj = this;
- setTime({
- order_id: item.order_id,
- time: item.time
- })
- .then(data => {
- obj.$api.msg(data.msg);
- obj.loadData('Refresh');
- })
- .catch(e => {
- console.log(e.message);
- });
- },
- //判断时间是否过期
- // judgeTime(time) {
- // console.log(time, 'time');
- // let strtime = time.replace('/-/g', '/'); //时间转换
- // console.log(strtime, 'strtime');
- // //选择时间
- // let date1 = new Date(strtime);
- // console.log(date1, 'date1');
- // //现在时间
- // let date2 = new Date();
- // console.log(date2, 'date2');
- // //判断时间是否过期
- // if (date1 < date2) {
- // this.timeOut = false;
- // } else {
- // this.timeOut = true;
- // }
- // console.log(this.timeOut);
- // },
- //评价
- ToEvaluate(item) {
- uni.navigateTo({
- url: '/pages/patient/evaluate?id=' + item
- });
- },
- //申请退款
- refund() {
- let obj = this;
- if (obj.reason == '') {
- obj.$api.msg('请输入退款路由');
- return;
- }
- refund({
- reason: obj.reason,
- order_id: obj.refundId
- })
- .then(data => {
- obj.$api.msg(data.msg);
- obj.loadData('Refresh');
- obj.close1();
- })
- .catch(e => {
- obj.close1();
- obj.loadData('Refresh');
- console.log(e.message);
- });
- },
- //取消退款
- cancel(item) {
- let obj = this;
- uni.showModal({
- title: '提示',
- content: '确定要取消退款?',
- success: function(res) {
- if (res.confirm) {
- cancelRefund({
- order_id: item
- })
- .then(data => {
- obj.$api.msg(data.msg);
- obj.loadData('Refresh');
- })
- .catch(e => {
- obj.loadData('Refresh');
- console.log(e.message);
- });
- } else if (res.cancel) {
- obj.$api.msg('');
- }
- }
- });
- },
- //跳转咨询界面
- ToChat(item) {
- if (item.refund == 0) {
- //病人
- if (this.userInfo.type == 1) {
- uni.navigateTo({
- url: '/pages/doctor/chat?id=' + item.order_id + '&name=' + item.doctor_name + '&uid=' +
- item.doctor_id
- });
- }
- //医生
- if (this.userInfo.type == 2) {
- if (item.type == 1 || item.type == 2) {
- uni.navigateTo({
- url: '/pages/doctor/chat?id=' + item.order_id + '&name=' + item.patient_name +
- '&uid=' + item.patient_id
- });
- }
- if (item.type == 3) {
- uni.navigateTo({
- url: '/pages/doctor/chat?id=' + item.order_id + '&name=' + item.organ_name +
- '&uid=' + item.patient_id
- });
- }
- }
- //机构
- if (this.userInfo.type == 3) {
- uni.navigateTo({
- url: '/pages/doctor/chat?id=' + item.order_id + '&name=' + item.doctor_name + '&uid=' +
- item.doctor_id
- });
- }
- }
- },
- //打开打赏弹窗
- open(item) {
- this.rewardId = item;
- this.$refs.popup.open();
- },
- //关闭打赏弹窗
- close() {
- this.$refs.popup.close();
- },
- //立即打赏
- Reward() {
- if (this.money == '') {
- this.$api.msg('请输入打赏金额');
- return;
- }
- this.$refs.popup.close();
- this.payopen();
- },
- //打开支付弹窗
- payopen() {
- this.$refs.popup2.onTap();
- this.$refs.popup2.open();
- },
- //关闭支付弹窗
- payclose() {
- this.$refs.popup2.close();
- },
- //选择支付方式
- changePayType(type) {
- this.payType = type;
- },
- //确认支付
- confirm: async function() {
- let obj = this;
- // 支付中
- obj.payLoding = true;
- // #ifdef H5
- // 获取当前是否为微信浏览器
- obj.froms = uni.getStorageSync('weichatBrowser') || '';
- // #endif
- obj.CreateOrder();
- },
- //订单创建
- CreateOrder() {
- let obj = this;
- // 生成订单
- reward({
- order_id: obj.rewardId, //
- money: obj.money, //医生类型 1 普通预约 2 私人医生
- pay_type: obj.payType //支付类型 1是微信 2是余额
- })
- .then(data => {
- // 判断是否为余额支付
- if (obj.payType == 2) {
- if (data.code == 200) {
- if (data.msg == '余额支付成功') {
- obj.$api.msg('打赏成功');
- }
- obj.payclose();
- obj.loadData('Refresh');
- obj.payLoding = false;
- } else {
- obj.payclose();
- obj.payLoding = false;
- obj.$api.msg(msg);
- }
- }
- if (obj.payType == 1) {
- console.log('orderMoneyPay', data);
- let item = data.data;
- // 立即支付
- obj.orderMoneyPay(item);
- }
- })
- .catch(e => {
- // 支付完成
- console.log(e.message);
- obj.payclose();
- obj.payLoding = false;
- if (e.message == '该订单已支付!') {
- // obj.paySuccessTo();
- }
- });
- },
- //打开退款弹窗
- open1(item) {
- this.refundId = item.order_id;
- this.$refs.popup1.open();
- },
- //关闭退款弹窗
- close1() {
- this.$refs.popup1.close();
- },
- //预约记录
- ToMyorder() {
- uni.navigateTo({
- url: '/pages/order/myorder'
- });
- },
- //swiper 切换
- changeTab(e) {
- this.tabCurrentIndex = e.target.current;
- this.loadData('tabChange');
- },
- //顶部tab点击
- tabClick(index) {
- this.tabCurrentIndex = index;
- // 初始化数据列表
- this.navList[index].orderList = [];
- // 初始化翻页数
- this.navList[index].page = 1;
- // 初始化数据为未加载状态
- this.navList[index].loadingType = 'more';
- }
- }
- };
- </script>
- <style lang="scss">
- page,
- .content {
- background: $page-color-base;
- height: 100%;
- .type-item {
- height: 100%;
- position: relative;
- .item-title {
- font-weight: bold;
- background: #ffffff;
- font-size: 36rpx;
- color: #333333;
- text-align: center;
- height: 100rpx;
- line-height: 100rpx;
- border-bottom: 2rpx solid #eeeeee;
- }
- .record {
- position: absolute;
- top: 25rpx;
- right: 25rpx;
- color: #6786fb;
- font-size: 30rpx;
- }
- }
- }
- .swiper-box {
- height: calc(100% - 80px);
- }
- .list-scroll-content {
- height: 100%;
- }
- .navbar {
- display: flex;
- height: 40px;
- padding: 0 5px;
- background: #fff;
- box-shadow: 0 2px 2px rgba(0, 0, 0, 0.06);
- position: relative;
- z-index: 10;
- .nav-item {
- flex: 1;
- display: flex;
- justify-content: center;
- align-items: center;
- height: 100%;
- font-size: 15px;
- color: $font-color-dark;
- position: relative;
- &.current {
- color: $base-color;
- &:after {
- content: '';
- position: absolute;
- left: 50%;
- bottom: 0;
- transform: translateX(-50%);
- width: 44px;
- height: 0;
- border-bottom: 2px solid $base-color;
- }
- }
- }
- }
- .uni-swiper-item {
- height: auto;
- }
- .order-item {
- display: flex;
- flex-direction: column;
- padding-left: 30rpx;
- background: #fff;
- padding: 28rpx 28rpx;
- margin-bottom: 25rpx;
- border-radius: 15rpx;
- .i-top {
- display: flex;
- align-items: center;
- font-size: 30rpx;
- color: #6786fb;
- position: relative;
- image {
- width: 34rpx;
- height: 32rpx;
- margin-right: 15rpx;
- }
- .time {
- width: 75%;
- text {
- color: #666666;
- }
- }
- .del-btn {
- padding: 10rpx 0 10rpx 36rpx;
- font-size: $font-lg;
- color: $font-color-light;
- position: relative;
- &:after {
- content: '';
- width: 0;
- height: 30rpx;
- border-left: 1px solid $border-color-dark;
- position: absolute;
- left: 20rpx;
- top: 50%;
- transform: translateY(-50%);
- }
- }
- }
- .goods-box-single {
- padding: 50rpx 0;
- .img-box {
- position: relative;
- .goods-img {
- display: block;
- width: 140rpx;
- height: 140rpx;
- border-radius: 25rpx;
- }
- .corner {
- position: absolute;
- z-index: 999;
- }
- }
- .right {
- flex: 1;
- display: flex;
- flex-direction: column;
- padding: 0 30rpx 0 24rpx;
- overflow: hidden;
- .title {
- font-size: 30rpx;
- line-height: 45rpx;
- font-weight: 500;
- color: $font-color-dark;
- line-height: 50rpx;
- .price {
- color: #fc4141;
- }
- }
- .font-da {
- font-size: 35rpx;
- font-weight: bold;
- }
- .red {
- color: #fc4141;
- }
- .attr-box {
- font-size: 24rpx;
- color: #666666;
- .red {
- color: #e73932;
- }
- }
- }
- .appointment {
- font-size: 30rpx;
- color: #6786fb;
- background: rgba(103, 134, 251, 0.18);
- border-radius: 5px;
- padding: 15rpx 25rpx;
- }
- }
- .action-box {
- display: flex;
- justify-content: flex-end;
- align-items: center;
- position: relative;
- padding-top: 28rpx;
- }
- .action-btn {
- width: 160rpx;
- height: 60rpx;
- margin: 0;
- margin-left: 24rpx;
- padding: 0;
- text-align: center;
- line-height: 60rpx;
- font-size: $font-sm + 2rpx;
- color: $font-color-dark;
- background: #fff;
- border-radius: 100px;
- border: 2rpx solid #6786fb;
- color: #6786fb;
- }
- .row {
- display: flex;
- align-items: center;
- font-size: 30upx;
- position: relative;
- }
- }
- //搜索框
- .Search-box {
- overflow: hidden;
- width: 100%;
- padding: 20rpx;
- background-color: #ffffff;
- justify-content: space-around;
- .Search-box {
- width: 89%;
- height: 72rpx;
- border-radius: 36rpx;
- background-color: #f8f6f6;
- justify-content: flex-start;
- padding-left: 54rpx;
- .box-img {
- height: 30rpx;
- width: 30rpx;
- margin-right: 20rpx;
- }
- .box-word {
- font-size: $uni-font-size-base - 2rpx;
- font-weight: 500;
- color: #666666;
- }
- }
- .Search-word {
- width: 11%;
- font-size: $uni-font-size-lg - 2rpx;
- font-weight: 500;
- color: #666666;
- .word {
- float: right;
- }
- }
- }
- .second-part {
- padding: 20rpx;
- .template {
- width: 100%;
- background: #ffffff;
- overflow: hidden;
- padding: 20rpx;
- box-shadow: 0px 5px 5px 0px rgba(35, 24, 21, 0.06);
- margin-bottom: 18rpx;
- border-radius: 12rpx;
- position: relative;
- .left-img {
- width: 140rpx;
- float: left;
- overflow: hidden;
- image {
- width: 140rpx;
- height: 140rpx;
- border-radius: 50%;
- }
- }
- .center-word {
- width: 50%;
- padding-left: 25rpx;
- padding-right: 15rpx;
- .one {
- font-size: $uni-font-size-lg - 2rpx;
- font-weight: 500;
- color: $uni-text-color;
- line-height: 36rpx;
- display: block;
- margin-bottom: 10rpx;
- }
- .two {
- font-size: $uni-font-size-sm;
- font-weight: 500;
- color: #999999;
- line-height: 36rpx;
- display: block;
- }
- }
- .right-label {
- padding: 16rpx;
- border: 1px solid $base-color;
- border-radius: 7rpx;
- font-size: $font-sm - 1rpx;
- font-weight: 500;
- color: $base-color;
- align-items: center;
- image {
- width: 38rpx;
- height: 38rpx;
- margin-right: 8rpx;
- }
- }
- }
- }
- //弹窗
- .popup {
- width: 536rpx;
- .img {
- width: 100%;
- }
- .row {
- background: #ffffff;
- padding: 45rpx 45rpx;
- border-radius: 25rpx;
- .row-1 {
- color: #323333;
- font-size: 36rpx;
- text-align: center;
- width: 100%;
- padding: 30rpx 0rpx;
- padding-bottom: 50rpx !important;
- }
- .row-2 {
- background: #eaeaea;
- padding: 15rpx 25rpx;
- font-size: 26rpx;
- height: 80rpx;
- border-radius: 15rpx;
- }
- .row-3 {
- width: 80%;
- margin: 20rpx auto;
- margin-top: 50rpx;
- background: linear-gradient(0deg, rgba(126, 153, 254, 1), rgba(151, 143, 250, 1));
- border-radius: 34rpx;
- justify-content: center;
- font-size: $uni-font-size-lg + 4rpx;
- font-weight: 500;
- color: #f8f9f9;
- }
- }
- }
- .close_icon {
- width: 52rpx;
- height: 52rpx;
- margin: 88rpx auto 0;
- image {
- width: 100%;
- height: 100%;
- }
- }
- //支付弹窗
- .pay-type-list {
- margin-top: 20upx;
- background-color: #fff;
- padding-left: 40upx;
- .type-item {
- height: 120upx;
- padding: 20upx 0;
- display: flex;
- justify-content: space-between;
- align-items: center;
- padding-right: 60upx;
- font-size: 30upx;
- position: relative;
- }
- .icon {
- width: 100upx;
- font-size: 52upx;
- }
- .img {
- color: #fe8e2e;
- width: 50rpx;
- height: 50rpx;
- image {
- width: 100%;
- height: 100%;
- }
- }
- .tit {
- font-size: $font-lg;
- color: $font-color-dark;
- margin-bottom: 4upx;
- }
- .con {
- flex: 1;
- display: flex;
- flex-direction: column;
- padding-left: 25rpx;
- font-size: $font-sm;
- color: $font-color-light;
- }
- }
- .payment {
- background-color: #ffffff;
- border-radius: 15rpx 15rpx 0rpx 0rpx;
- z-index: 999;
- .first {
- border-bottom: 2rpx solid $border-color-light;
- padding: 38rpx 25rpx;
- .word {
- font-size: $uni-font-size-base;
- font-weight: bold;
- color: $font-color-dark;
- }
- image {
- width: 25rpx;
- height: 25rpx;
- }
- }
- .one {
- height: 20rpx;
- background-color: #f6f6f6;
- }
- .Third {
- .two1 {
- width: 55%;
- background-color: #ffffff;
- padding-left: 25rpx;
- .two1-1 {
- font-size: $uni-font-size-base;
- font-weight: 400;
- color: $font-color-dark;
- }
- .two1-2 {
- font-size: $uni-font-size-sm;
- font-weight: bold;
- color: $color-red1;
- }
- .size {
- font-size: $uni-font-size-lg + 4rpx;
- }
- }
- .two2 {
- width: 45%;
- background: $color-red1;
- color: #ffffff;
- font-size: $uni-font-size-lg;
- font-weight: 550;
- text-align: center;
- padding: 30rpx 0rpx;
- }
- .clickbg {
- background-color: $color-gray !important;
- }
- }
- }
- </style>
|