| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326 |
- <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">
- {{
- statusArray[item.status]?statusArray[item.status]:statusArray[6]
- }}
- </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">
- {{
- statusArray[item.status]?statusArray[item.status]:statusArray[6]
- }}
- </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-else 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-else>
- <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">
- <text v-if="item.type == 1">咨询</text>
- <text v-if="item.type == 2">预约</text>
- <text v-if="item.type == 3">多点执业</text>
- <text v-if="item.type == 4">会诊</text>
- </view>
- <view class="title red" v-if="userInfo.type != 2 && item.refund == 1">
- 您申请的退款将在平台审核后,退回您的账户,感谢您使用共享预约平台。</view>
- </view>
- <view class="appointment" v-if="item.refund == 0 && item.status != 0">
- <text v-if="userInfo.type == 2">回复详情</text>
- <text v-else>立即咨询</text>
- </view>
- <!-- 0未支付 1病人已支付 2已预约时间 3医生确认完成 4病人已完成 5已完成 6已评价 -->
- </view>
- <view class="action-box b-t">
- <template v-if="userInfo.type != 2">
- <template v-if="item.status == 0">
- <view class="action-btn" @click="ConfirmPay(item)">去支付</view>
- <view class="action-btn" @click="Cancel(item.order_id)">取消订单</view>
- </template>
- <view class="action-btn"
- v-if="(item.refund == 0 && item.status == 2) || item.status == 3"
- @click="Completion(item.order_id)">确认完成</view>
- <template v-if="item.status == 4 || item.status == 5">
- <view class="action-btn" @click="ToEvaluate(item.order_id)">去评价</view>
- <template v-if="item.status == 6 || item.status == 7">
- <view class="action-btn" @click="open(item.order_id)">打赏医生</view>
- <view class="action-btn" @click="ToZixu(item)">再次咨询</view>
- </template>
- </template>
- <view class="action-btn"
- v-if="item.refund == 0 && item.status == 2 && item.type != 4"
- @click="open1(item)">退款</view>
- </template>
- <template v-else>
- <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 && item.type != 4"
- @click="open1(item)">退款</view>
- </template>
- <!-- <view class="action-btn" v-if="item.refund == 1" @click="cancel(item.order_id)">取消退款</view> -->
- <!-- <view class="action-btn" v-if="item.status == 6" @click="del(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 //每次信息条数
- }
- ],
- statusArray: ['未支付', '已支付', '已预约', '待确认', '已确认', '已完成', '已评价']
- };
- },
- computed: {
- ...mapState(['userInfo'])
- },
- onShow() {
- let obj = this
- console.log(this.userInfo, 'patient');
- // this.tabCurrentIndex = 0;
- this.loadData('Refresh');
- // 1是病人 2是医生 3是机构
- if (obj.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',
- visible: true
- })
- uni.setTabBarItem({
- index: 4,
- text: '我的',
- iconPath: 'static/tabBar/tab-my.png',
- selectedIconPath: 'static/tabBar/tab-my-current.png'
- });
- }
- if (obj.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',
- 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',
- visible: true
- })
- uni.setTabBarItem({
- index: 4,
- text: '我的',
- iconPath: 'static/tabBar/tab-my.png',
- selectedIconPath: 'static/tabBar/tab-my-current.png'
- });
- }
- if (obj.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: false
- });
- 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'
- });
- }
- },
- //下拉刷新
- 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 || item.type == 4) {
- 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>
|