dd.vue 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218
  1. <template>
  2. <view class="content">
  3. <view class="navbar flex">
  4. <view v-for="(item, index) in navList" :key="index" class="nav-item"
  5. :class="{ current: tabCurrentIndex == index }" @click="tabClick(index)">{{ item.text }}</view>
  6. </view>
  7. <swiper :current="tabCurrentIndex" class="swiper-box" duration="300" @change="changeTab"
  8. :style="{'height': height}">
  9. <swiper-item v-for="navitem in navList">
  10. <scroll-view scroll-y="true" :style="{'height': height}" class="scoll-box"
  11. :class="{'fbx-scoll': tabCurrentIndex == 0 && userInfo.type == 3}">
  12. <empty v-if="navitem.loaded === true && navitem.orderList.length === 0"></empty>
  13. <view class="dd-wrap" v-for="litem in navitem.orderList">
  14. <view class="dd-top flex">
  15. <image src="../../static/icon/qianger.png" mode=""></image>
  16. <view class="">
  17. 订单信息
  18. </view>
  19. <view class="dd-time">
  20. <text v-if="tabCurrentIndex == 0">发布时间: {{litem.add_time | showTime}}</text><text
  21. v-if="tabCurrentIndex == 1" style="color: #6786FB;">已接单</text>
  22. </view>
  23. </view>
  24. <view class="dd-info">
  25. <view class="flex fs">
  26. <view class="info-name">地区:</view>
  27. <view class="info-val">{{litem.province + ' ' + litem.city + ' ' + litem.district}}
  28. </view>
  29. </view>
  30. <view class="flex fs">
  31. <view class="info-name">机构名称:</view>
  32. <view class="info-val">{{litem.organ_name}}</view>
  33. </view>
  34. <view class="flex fs">
  35. <view class="info-name">服务时间:</view>
  36. <view class="info-val">{{litem.time_area}}</view>
  37. </view>
  38. <view class="flex fs">
  39. <view class="info-name">职称:</view>
  40. <view class="info-val">{{litem.doctor_level | showlevel}}(含)以上职称</view>
  41. </view>
  42. <view class="flex fs">
  43. <view class="info-name">专业:</view>
  44. <view class="info-val">{{litem.type}}</view>
  45. </view>
  46. <view class="flex fs">
  47. <view class="info-name">设备说明:</view>
  48. <view class="info-val">{{litem.tags.join('、')}}</view>
  49. </view>
  50. <view class="flex fs">
  51. <view class="info-name">劳务费用:</view>
  52. <view class="info-val">{{litem.brokerage}}</view>
  53. </view>
  54. <view class="flex fs">
  55. <view class="info-name">要求:</view>
  56. <view class="info-val">{{litem.content}}</view>
  57. </view>
  58. </view>
  59. <view class="jd-info flex" v-if="litem.doctor && litem.pay ==1">
  60. <view class="">
  61. 姓名:{{litem.doctor.name}}
  62. </view>
  63. <view class="">
  64. 电话:{{litem.doctor.mobile}}
  65. </view>
  66. <view class="">
  67. 职称:{{litem.level}}
  68. </view>
  69. <view class="" style="width: 100%;">
  70. 所在医院:{{litem.doctorhospital}}
  71. </view>
  72. </view>
  73. <!-- <view class="" @click="gozx(litem.doctor.uid)">
  74. 咨询
  75. </view> -->
  76. <view class="jd-btn flex" style="justify-content: space-around;" v-if="tabCurrentIndex == 1">
  77. <view class="btn" v-if="tabCurrentIndex == 1 && userInfo.type == 3 && !litem.pay"
  78. @click.stop="gozf(litem)">
  79. 支付订单费用
  80. </view>
  81. <view class=" btn"
  82. v-if="tabCurrentIndex == 1 && userInfo.type == 3 && litem.order_id && litem.pay"
  83. @click.stop="lxys(litem)">
  84. 联系医生
  85. </view>
  86. <view class="btn"
  87. v-if="tabCurrentIndex == 1 && userInfo.type == 3 && litem.order_id && litem.pay && litem.state == 0"
  88. @click="wjdd(litem.order_id)">
  89. 订单完成
  90. </view>
  91. <view class="btn"
  92. v-if="tabCurrentIndex == 1 && userInfo.type == 2 && litem.order_id && litem.pay"
  93. @click.stop="lxjg(litem)">
  94. 联系机构
  95. </view>
  96. </view>
  97. <view class="jd-btn" v-if="tabCurrentIndex == 0 && userInfo.type == 2">
  98. <view class="btn" @click="jiedan(litem)">
  99. 确认接单
  100. </view>
  101. </view>
  102. </view>
  103. <uni-load-more :status="navitem.loadingType"></uni-load-more>
  104. <!-- 底部发布新订单 -->
  105. <view class="fb-btn" v-if="tabCurrentIndex == 0 && userInfo.type == 3">
  106. <view class="new-btn" @click.stop="navto('/pages/dd/opendd')">
  107. 发布新订单
  108. </view>
  109. </view>
  110. </scroll-view>
  111. </swiper-item>
  112. </swiper>
  113. <!-- 支付弹出窗 -->
  114. <uni-popup ref="popup1" type="bottom">
  115. <view class="payment">
  116. <view class="first flex " @click="payclose()">
  117. <text class="word">选择支付方式</text>
  118. <image src="../../static/img/img25.png"></image>
  119. </view>
  120. <view class="pay-type-list">
  121. <view class="type-item b-b" @click="changePayType(1)">
  122. <view class="img">
  123. <image class="yue" src="../../static/img/img26.png"></image>
  124. </view>
  125. <view class="con"><text class="tit">微信支付</text></view>
  126. <label class="radio">
  127. <radio value="" color="#FC4141" :checked="payType == 1"></radio>
  128. </label>
  129. </view>
  130. <view class="type-item flex_item" @click="changePayType(2)">
  131. <view class="img">
  132. <image class="yue" src="../../static/img/img017.png"></image>
  133. </view>
  134. <view class="con"><text class="tit">余额支付</text></view>
  135. <label class="radio">
  136. <radio value="" color="#FC4141" :checked="payType == 2"></radio>
  137. </label>
  138. </view>
  139. </view>
  140. <view class="one"></view>
  141. <view class="Third flex">
  142. <view class="two1">
  143. <text class="two1-1 ">合计:</text>
  144. <text class="two1-2">¥</text>
  145. <text class="two1-2 size">{{ pay_price }}</text>
  146. </view>
  147. <view class="two2" :class="{ clickbg: payLoding }" @click.stop="!payLoding ? confirm() : ''">
  148. <text>立即支付</text></view>
  149. </view>
  150. <view class="" style="height: 44px;">
  151. </view>
  152. </view>
  153. </uni-popup>
  154. </view>
  155. </template>
  156. <script>
  157. // #ifdef H5
  158. import weixinObj from '@/libs/jweixin-module/index.js';
  159. // #endif
  160. import { weixindata } from '@/utils/wxAuthorized.js';
  161. import {
  162. patientFinish,
  163. patientMisson
  164. } from '@/api/patient.js';
  165. import uniPopup from '@/components/uni-popup/uni-popup.vue';
  166. import {
  167. mapState,
  168. mapMutations
  169. } from 'vuex';
  170. import {
  171. getUserInfo
  172. } from '@/api/login.js';
  173. import {
  174. ddlist,
  175. acceptMission,
  176. createOrder
  177. } from '@/api/dd.js'
  178. import empty from '@/components/empty';
  179. export default {
  180. components: {
  181. empty,
  182. uniPopup
  183. },
  184. data() {
  185. return {
  186. order_id: '',
  187. height: '',
  188. tabCurrentIndex: 0,
  189. navList: [{
  190. type: 0,
  191. text: '待接订单',
  192. loadingType: 'more',
  193. orderList: [],
  194. page: 1, //当前页数
  195. limit: 10, //每次信息条数
  196. loaded: false
  197. },
  198. {
  199. type: 1,
  200. text: '已接订单',
  201. loadingType: 'more',
  202. orderList: [],
  203. page: 1, //当前页数
  204. limit: 10, //每次信息条数
  205. loaded: true
  206. }
  207. ],
  208. pay_price: '', //支付费用
  209. payType: 1, //支付类型
  210. payLoding: false, //判断是否支付中
  211. chooseId: ''
  212. }
  213. },
  214. onReady(res) {
  215. var obj = this;
  216. uni.getSystemInfo({
  217. success: resu => {
  218. const query = uni.createSelectorQuery();
  219. query.select('.swiper-box').boundingClientRect();
  220. query.exec(function(res) {
  221. obj.height = resu.windowHeight - res[0].top + 'px';
  222. });
  223. },
  224. fail: res => {}
  225. });
  226. },
  227. onLoad(opt) {
  228. if(opt.tabcurrent) {
  229. this.tabCurrentIndex = opt.tabcurrent
  230. }
  231. },
  232. onShow() {
  233. let obj = this;
  234. // 判断是否已经登录
  235. console.log(this.hasLogin, 'user');
  236. this.navList = [{
  237. type: 0,
  238. text: '待接订单',
  239. loadingType: 'more',
  240. orderList: [],
  241. page: 1, //当前页数
  242. limit: 10, //每次信息条数
  243. loaded: false
  244. },
  245. {
  246. type: 1,
  247. text: '已接订单',
  248. loadingType: 'more',
  249. orderList: [],
  250. page: 1, //当前页数
  251. limit: 10, //每次信息条数
  252. loaded: true
  253. }
  254. ]
  255. this.loadBaseData();
  256. getUserInfo({})
  257. .then(function(e) {
  258. // obj.userInfo = e.data;
  259. obj.setUserInfo(e.data)
  260. uni.setStorageSync('userInfo', e.data);
  261. if (obj.userInfo.type == 2) {
  262. uni.setTabBarItem({
  263. index: 0,
  264. text: '首页',
  265. iconPath: 'static/tabBar/tab-home.png',
  266. selectedIconPath: 'static/tabBar/tab-home-current.png'
  267. });
  268. uni.setTabBarItem({
  269. index: 1,
  270. text: '我的病人',
  271. iconPath: 'static/tabBar/tab-cate.png',
  272. selectedIconPath: 'static/tabBar/tab-cate-current.png',
  273. visible: true
  274. });
  275. uni.setTabBarItem({
  276. index: 2,
  277. text: '科普学习',
  278. iconPath: 'static/tabBar/tab-study.png',
  279. selectedIconPath: 'static/tabBar/tab-study-current.png',
  280. visible: false
  281. });
  282. uni.setTabBarItem({
  283. index: 3,
  284. text: '接单',
  285. iconPath: 'static/tabBar/jd.png',
  286. selectedIconPath: 'static/tabBar/jd-act.png',
  287. visible: true
  288. })
  289. uni.setTabBarItem({
  290. index: 4,
  291. text: '我的',
  292. iconPath: 'static/tabBar/tab-my.png',
  293. selectedIconPath: 'static/tabBar/tab-my-current.png'
  294. });
  295. }
  296. if (obj.userInfo.type == 3) {
  297. uni.setTabBarItem({
  298. index: 0,
  299. text: '首页',
  300. iconPath: 'static/tabBar/tab-home.png',
  301. selectedIconPath: 'static/tabBar/tab-home-current.png'
  302. });
  303. uni.setTabBarItem({
  304. index: 1,
  305. text: '咨询记录',
  306. iconPath: 'static/tabBar/tab-cate.png',
  307. selectedIconPath: 'static/tabBar/tab-cate-current.png',
  308. visible: true
  309. });
  310. uni.setTabBarItem({
  311. index: 2,
  312. text: '科普学习',
  313. iconPath: 'static/tabBar/tab-study.png',
  314. selectedIconPath: 'static/tabBar/tab-study-current.png',
  315. visible: false
  316. });
  317. uni.setTabBarItem({
  318. index: 3,
  319. text: '发布订单',
  320. iconPath: 'static/tabBar/jd.png',
  321. selectedIconPath: 'static/tabBar/jd-act.png',
  322. pagePath: '/pages/dd/dd',
  323. visible: true
  324. })
  325. uni.setTabBarItem({
  326. index: 4,
  327. text: '我的',
  328. iconPath: 'static/tabBar/tab-my.png',
  329. selectedIconPath: 'static/tabBar/tab-my-current.png'
  330. });
  331. }
  332. if (obj.userInfo.type == 1) {
  333. uni.setTabBarItem({
  334. index: 0,
  335. text: '首页',
  336. iconPath: 'static/tabBar/tab-home.png',
  337. selectedIconPath: 'static/tabBar/tab-home-current.png'
  338. });
  339. uni.setTabBarItem({
  340. index: 1,
  341. text: '咨询记录',
  342. iconPath: 'static/tabBar/tab-cate.png',
  343. selectedIconPath: 'static/tabBar/tab-cate-current.png',
  344. visible: true
  345. });
  346. uni.setTabBarItem({
  347. index: 2,
  348. text: '科普学习',
  349. iconPath: 'static/tabBar/tab-study.png',
  350. selectedIconPath: 'static/tabBar/tab-study-current.png',
  351. visible: true
  352. });
  353. uni.setTabBarItem({
  354. index: 3,
  355. text: '接单',
  356. iconPath: 'static/tabBar/jd.png',
  357. selectedIconPath: 'static/tabBar/jd-act.png',
  358. visible: false
  359. })
  360. uni.setTabBarItem({
  361. index: 4,
  362. text: '我的',
  363. iconPath: 'static/tabBar/tab-my.png',
  364. selectedIconPath: 'static/tabBar/tab-my-current.png'
  365. });
  366. }
  367. })
  368. .catch(function(e) {
  369. console.log(e);
  370. });
  371. },
  372. filters: {
  373. showlevel(val) {
  374. let str = '无'
  375. if (val) {
  376. if (val == 1) {
  377. str = '初级'
  378. } else if (val == 2) {
  379. str = '中级'
  380. } else if (val == 3) {
  381. str = '副高级'
  382. } else if (val == 4) {
  383. str = '正高级'
  384. }
  385. }
  386. return str
  387. },
  388. showTime(val) {
  389. let str = ''
  390. if (val) {
  391. var time = new Date(val * 1000);
  392. var y = time.getFullYear();
  393. var m = time.getMonth() + 1;
  394. var d = time.getDate();
  395. var h = time.getHours();
  396. var mm = time.getMinutes();
  397. var s = time.getSeconds();
  398. str = y + '-' + m + '-' + d
  399. }
  400. return str
  401. }
  402. },
  403. computed: {
  404. ...mapState(['hasLogin', 'userInfo'])
  405. },
  406. methods: {
  407. ...mapMutations(['setUserInfo', 'setOrderInfo', 'logout']),
  408. payclose() {
  409. obj.$refs.popup1.close()
  410. },
  411. wjdd(item) {
  412. let obj = this
  413. patientMisson({
  414. order_id: item,
  415. // type: 3
  416. })
  417. .then(data => {
  418. // obj.$api.msg(data.msg);
  419. // obj.loadData('Refresh');
  420. obj.navList = [{
  421. type: 0,
  422. text: '待接订单',
  423. loadingType: 'more',
  424. orderList: [],
  425. page: 1, //当前页数
  426. limit: 10, //每次信息条数
  427. loaded: false
  428. },
  429. {
  430. type: 1,
  431. text: '已接订单',
  432. loadingType: 'more',
  433. orderList: [],
  434. page: 1, //当前页数
  435. limit: 10, //每次信息条数
  436. loaded: true
  437. }
  438. ]
  439. obj.loadData()
  440. })
  441. .catch(e => {
  442. console.log(e.message);
  443. });
  444. },
  445. lxys(item) {
  446. uni.navigateTo({
  447. url: '/pages/doctor/chartt?id=' + item.order_id + '&name=' + item.doctor.name + '&uid=' + item
  448. .doctor.uid
  449. });
  450. },
  451. lxjg(item) {
  452. //organ_uid
  453. uni.navigateTo({
  454. url: '/pages/doctor/chartt?id=' + item.order_id + '&name=' + item.organ_name + '&uid=' + item
  455. .organ_uid
  456. });
  457. },
  458. //选择支付方式
  459. changePayType(type) {
  460. this.payType = type;
  461. },
  462. confirm() {
  463. let obj = this;
  464. // 支付中
  465. obj.payLoding = true;
  466. // #ifdef H5
  467. // 获取当前是否为微信浏览器
  468. obj.froms = uni.getStorageSync('weichatBrowser') || '';
  469. // #endif
  470. createOrder({
  471. payType: obj.payType == 1 ? 'weixin' : 'yue',
  472. price: obj.pay_price,
  473. id: obj.chooseId
  474. }).then(({
  475. data,
  476. status,
  477. msg
  478. }) => {
  479. if (obj.payType == 2) {
  480. if (msg == '余额支付成功') {
  481. obj.$api.msg(msg);
  482. obj.$refs.popup1.close()
  483. obj.payLoding = false;
  484. obj.navList = [{
  485. type: 0,
  486. text: '待接订单',
  487. loadingType: 'more',
  488. orderList: [],
  489. page: 1, //当前页数
  490. limit: 10, //每次信息条数
  491. loaded: false
  492. },
  493. {
  494. type: 1,
  495. text: '已接订单',
  496. loadingType: 'more',
  497. orderList: [],
  498. page: 1, //当前页数
  499. limit: 10, //每次信息条数
  500. loaded: true
  501. }
  502. ]
  503. this.loadData()
  504. } else {
  505. console.log(msg, 'msg');
  506. }
  507. } else {
  508. obj.orderMoneyPay(data);
  509. }
  510. }).catch(err => {
  511. obj.payLoding = false;
  512. })
  513. },
  514. gozf(item) {
  515. this.pay_price = item.brokerage
  516. this.chooseId = item.id
  517. console.log(item)
  518. this.$refs.popup1.onTap();
  519. this.$refs.popup1.open();
  520. },
  521. gozx(id) {
  522. uni.navigateTo({
  523. url: '/pages/doctor/chartt?id=' + id
  524. });
  525. },
  526. //
  527. navto(url) {
  528. uni.navigateTo({
  529. url,
  530. fail() {
  531. uni.switchTab({
  532. url
  533. })
  534. }
  535. })
  536. },
  537. //顶部tab点击
  538. tabClick(index) {
  539. this.tabCurrentIndex = index;
  540. // 初始化数据列表
  541. this.navList[index].orderList = [];
  542. // 初始化翻页数
  543. this.navList[index].page = 1;
  544. // 初始化数据为未加载状态
  545. this.navList[index].loadingType = 'more';
  546. },
  547. //swiper 切换
  548. changeTab(e) {
  549. this.tabCurrentIndex = e.target.current;
  550. this.loadData('tabChange');
  551. },
  552. //获取navlist
  553. loadData(type) {
  554. // if(type == 'tabChange' && )
  555. let obj = this
  556. let index = obj.tabCurrentIndex
  557. let navitem = obj.navList[index]
  558. if (navitem.loadingType == 'loading' || navitem.loadingType == 'noMore') {
  559. return
  560. }
  561. navitem.loadingType = 'loading'
  562. ddlist({
  563. page: navitem.page,
  564. limit: navitem.limit,
  565. type: navitem.type
  566. }).then(res => {
  567. console.log(res)
  568. navitem.orderList = navitem.orderList.concat(res.data.list)
  569. console.log(navitem.orderList, 'navitem.orderList')
  570. navitem.page++
  571. if (res.data.list.length == navitem.limit) {
  572. navitem.loadingType = 'more'
  573. } else {
  574. navitem.loadingType = 'noMore'
  575. }
  576. navitem.loaded = true
  577. })
  578. },
  579. // 接单
  580. jiedan(item) {
  581. let obj = this
  582. console.log(item)
  583. acceptMission({
  584. id: item.id
  585. }).then(res => {
  586. let s = obj.navList[obj.tabCurrentIndex].orderList.indexOf(item)
  587. obj.navList[obj.tabCurrentIndex].orderList.splice(s, 1);
  588. uni.showToast({
  589. title: '接单成功',
  590. duration: 2000
  591. });
  592. })
  593. },
  594. // 加载初始数据
  595. loadBaseData() {
  596. let obj = this;
  597. getUserInfo({})
  598. .then(({
  599. data
  600. }) => {
  601. obj.setUserInfo(data);
  602. // obj.userInfo = data;
  603. console.log(obj.userInfo);
  604. // let arr = data.map(e => {
  605. // e.createtime = getTime(e.createtime);
  606. // return e;
  607. // });
  608. // this.getDoctor();
  609. this.loadData()
  610. if (data.ext_info.status == 2) {
  611. uni.showModal({
  612. title: '提示',
  613. content: '您的审核未通过: \n ' + data.ext_info.reason + ' \n 是否重新提交审核!',
  614. success: function(res) {
  615. if (res.confirm) {
  616. console.log('用户点击确定');
  617. if (data.type == 2) {
  618. uni.navigateTo({
  619. url: '/pages/public/DocRegister'
  620. });
  621. }
  622. if (data.type == 3) {
  623. uni.navigateTo({
  624. url: '/pages/public/MecRegister'
  625. });
  626. }
  627. } else if (res.cancel) {
  628. console.log('用户点击取消');
  629. }
  630. }
  631. });
  632. }
  633. // 1是病人 2是医生 3是机构
  634. if (obj.userInfo.type == 2) {
  635. uni.setTabBarItem({
  636. index: 0,
  637. text: '首页',
  638. iconPath: 'static/tabBar/tab-home.png',
  639. selectedIconPath: 'static/tabBar/tab-home-current.png'
  640. });
  641. uni.setTabBarItem({
  642. index: 1,
  643. text: '我的病人',
  644. iconPath: 'static/tabBar/tab-cate.png',
  645. selectedIconPath: 'static/tabBar/tab-cate-current.png',
  646. visible: true
  647. });
  648. uni.setTabBarItem({
  649. index: 2,
  650. text: '科普学习',
  651. iconPath: 'static/tabBar/tab-study.png',
  652. selectedIconPath: 'static/tabBar/tab-study-current.png',
  653. visible: false
  654. });
  655. uni.setTabBarItem({
  656. index: 3,
  657. text: '接单',
  658. iconPath: 'static/tabBar/jd.png',
  659. selectedIconPath: 'static/tabBar/jd-act.png',
  660. pagePath: '/pages/dd/dd'
  661. })
  662. uni.setTabBarItem({
  663. index: 4,
  664. text: '我的',
  665. iconPath: 'static/tabBar/tab-my.png',
  666. selectedIconPath: 'static/tabBar/tab-my-current.png'
  667. });
  668. }
  669. if (obj.userInfo.type == 1) {
  670. uni.setTabBarItem({
  671. index: 0,
  672. text: '首页',
  673. iconPath: 'static/tabBar/tab-home.png',
  674. selectedIconPath: 'static/tabBar/tab-home-current.png'
  675. });
  676. uni.setTabBarItem({
  677. index: 1,
  678. text: '咨询记录',
  679. iconPath: 'static/tabBar/tab-cate.png',
  680. selectedIconPath: 'static/tabBar/tab-cate-current.png'
  681. });
  682. uni.setTabBarItem({
  683. index: 2,
  684. text: '科普学习',
  685. iconPath: 'static/tabBar/tab-study.png',
  686. selectedIconPath: 'static/tabBar/tab-study-current.png',
  687. visible: true
  688. });
  689. uni.setTabBarItem({
  690. index: 3,
  691. text: '发布订单',
  692. iconPath: 'static/tabBar/jd.png',
  693. selectedIconPath: 'static/tabBar/jd-act.png',
  694. pagePath: '/pages/dd/dd',
  695. visible: false
  696. })
  697. uni.setTabBarItem({
  698. index: 4,
  699. text: '我的',
  700. iconPath: 'static/tabBar/tab-my.png',
  701. selectedIconPath: 'static/tabBar/tab-my-current.png'
  702. });
  703. }
  704. if (obj.userInfo.type == 3) {
  705. uni.setTabBarItem({
  706. index: 0,
  707. text: '首页',
  708. iconPath: 'static/tabBar/tab-home.png',
  709. selectedIconPath: 'static/tabBar/tab-home-current.png'
  710. });
  711. uni.setTabBarItem({
  712. index: 1,
  713. text: '咨询记录',
  714. iconPath: 'static/tabBar/tab-cate.png',
  715. selectedIconPath: 'static/tabBar/tab-cate-current.png'
  716. });
  717. uni.setTabBarItem({
  718. index: 2,
  719. text: '科普学习',
  720. iconPath: 'static/tabBar/tab-study.png',
  721. selectedIconPath: 'static/tabBar/tab-study-current.png',
  722. visible: false
  723. });
  724. uni.setTabBarItem({
  725. index: 3,
  726. text: '发布订单',
  727. iconPath: 'static/tabBar/jd.png',
  728. selectedIconPath: 'static/tabBar/jd-act.png',
  729. pagePath: '/pages/dd/dd'
  730. })
  731. uni.setTabBarItem({
  732. index: 4,
  733. text: '我的',
  734. iconPath: 'static/tabBar/tab-my.png',
  735. selectedIconPath: 'static/tabBar/tab-my-current.png'
  736. });
  737. }
  738. if (obj.userInfo.type == 2 && obj.userInfo.ext_info.price == '0.00') {
  739. uni.showModal({
  740. title: '提示',
  741. content: '您的用户信息尚未完善,是否前去完善?',
  742. success: function(res) {
  743. if (res.confirm) {
  744. console.log('用户点击确定');
  745. uni.navigateTo({
  746. url: '/pages/userinfo/doctor'
  747. });
  748. } else if (res.cancel) {
  749. console.log('用户点击取消');
  750. }
  751. }
  752. });
  753. }
  754. })
  755. .catch(e => {
  756. if (e.message == '请登录') {
  757. uni.showModal({
  758. title: '提示',
  759. content: '您未登录,是否登录?',
  760. success: function(res) {
  761. if (res.confirm) {
  762. uni.navigateTo({
  763. url: '/pages/public/wxLogin'
  764. });
  765. } else if (res.cancel) {
  766. console.log('用户点击取消');
  767. }
  768. }
  769. });
  770. } else {
  771. console.log(e.message);
  772. }
  773. });
  774. },
  775. orderMoneyPay(data) {
  776. // console.log(this,'this')
  777. let obj = this;
  778. let config = data.jsConfig;
  779. weixindata().then(e => {
  780. weixinObj.chooseWXPay({
  781. timestamp: config.timestamp,
  782. nonceStr: config.nonceStr,
  783. package: config.package,
  784. signType: config.signType,
  785. paySign: config.paySign,
  786. success: function(res) {
  787. obj.$refs.popup1.close()
  788. console.log(res);
  789. obj.$api.msg(res);
  790. obj.payLoding = false;
  791. // 支付完成事件
  792. obj.navList = [{
  793. type: 0,
  794. text: '待接订单',
  795. loadingType: 'more',
  796. orderList: [],
  797. page: 1, //当前页数
  798. limit: 10, //每次信息条数
  799. loaded: false
  800. },
  801. {
  802. type: 1,
  803. text: '已接订单',
  804. loadingType: 'more',
  805. orderList: [],
  806. page: 1, //当前页数
  807. limit: 10, //每次信息条数
  808. loaded: true
  809. }
  810. ]
  811. obj.loadData()
  812. },
  813. fail: function(res) {
  814. console.log(res, '失败');
  815. uni.showModal({
  816. title: '错误',
  817. content: res.errMsg,
  818. showCancel: false
  819. });
  820. }
  821. });
  822. });
  823. // uni.showModal({
  824. // title: 'appid',
  825. // content: JSON.stringify(config),
  826. // showCancel: false,
  827. // success: res => {},
  828. // fail: () => {},
  829. // complete: () => {}
  830. // });
  831. },
  832. }
  833. }
  834. </script>
  835. <style lang="scss" scoped>
  836. .navbar {
  837. display: flex;
  838. height: 40px;
  839. padding: 0 5px;
  840. background: #fff;
  841. box-shadow: 0 2px 2px rgba(0, 0, 0, 0.06);
  842. position: relative;
  843. z-index: 10;
  844. .nav-item {
  845. flex: 1;
  846. display: flex;
  847. justify-content: center;
  848. align-items: center;
  849. height: 100%;
  850. font-size: 15px;
  851. color: $font-color-dark;
  852. position: relative;
  853. &.current {
  854. color: $base-color;
  855. &:after {
  856. content: '';
  857. position: absolute;
  858. left: 50%;
  859. bottom: 0;
  860. transform: translateX(-50%);
  861. width: 44px;
  862. height: 0;
  863. border-bottom: 2px solid $base-color;
  864. }
  865. }
  866. }
  867. }
  868. .scoll-box {
  869. padding-top: 20rpx;
  870. }
  871. .fbx-scoll {
  872. padding-bottom: 145rpx;
  873. }
  874. .fb-btn {
  875. width: 750rpx;
  876. position: fixed;
  877. bottom: 0rpx;
  878. left: 0;
  879. height: 145rpx;
  880. padding-top: 30rpx;
  881. z-index: 9;
  882. .new-btn {
  883. width: 560rpx;
  884. line-height: 80rpx;
  885. background: #6786fb;
  886. box-shadow: 0px 0px 13rpx 3rpx rgba(209, 212, 217, 0.31);
  887. border-radius: 40rpx;
  888. margin: auto;
  889. text-align: center;
  890. font-size: 30rpx;
  891. font-weight: 500;
  892. color: #FFFFFF;
  893. }
  894. }
  895. .dd-wrap {
  896. width: 702rpx;
  897. // height: 524px;
  898. background: #FFFFFF;
  899. box-shadow: 0px 0px 20rpx 0px rgba(50, 50, 52, 0.06);
  900. border-radius: 20rpx;
  901. margin: 0 auto 20rpx;
  902. .dd-top {
  903. font-size: 32rpx;
  904. font-weight: 500;
  905. color: #333333;
  906. padding: 24rpx;
  907. image {
  908. width: 30rpx;
  909. height: 35rpx;
  910. margin-right: 13rpx;
  911. }
  912. .dd-time {
  913. flex-grow: 1;
  914. text-align: right;
  915. font-size: 25rpx;
  916. font-weight: 500;
  917. color: #999999;
  918. }
  919. }
  920. .dd-info {
  921. font-size: 28rpx;
  922. font-weight: 500;
  923. color: #333333;
  924. padding: 0 24rpx 20rpx;
  925. .fs {
  926. justify-content: flex-start;
  927. align-items: flex-start;
  928. padding: 5rpx 0;
  929. }
  930. .info-name {
  931. flex-shrink: 0;
  932. }
  933. .info-val {
  934. padding-left: 10rpx;
  935. }
  936. }
  937. .jd-info {
  938. font-size: 28rpx;
  939. font-weight: 500;
  940. color: #333333;
  941. padding: 24rpx 4rpx;
  942. border-top: dashed 1rpx #EAECED;
  943. margin: auto;
  944. width: 662rpx;
  945. flex-wrap: wrap;
  946. view {
  947. width: 50%;
  948. padding: 5rpx 0;
  949. }
  950. }
  951. .jd-btn {
  952. height: 111rpx;
  953. padding-top: 26rpx;
  954. border-top: dashed 1rpx #EAECED;
  955. margin: auto;
  956. width: 662rpx;
  957. .btn {
  958. width: 186rpx;
  959. line-height: 59rpx;
  960. background: #6499FA;
  961. border-radius: 30rpx;
  962. text-align: center;
  963. font-size: 29rpx;
  964. font-weight: 500;
  965. color: #FFFFFF;
  966. margin: auto 18rpx auto auto;
  967. }
  968. }
  969. }
  970. .zfbtn {
  971. height: 80rpx;
  972. line-height: 80rpx;
  973. background-color: #6786fb;
  974. border-radius: 0 0 20rpx 20rpx;
  975. color: #fff;
  976. text-align: center;
  977. font-size: 28rpx;
  978. }
  979. .payment {
  980. background-color: #ffffff;
  981. border-radius: 15rpx 15rpx 0rpx 0rpx;
  982. .first {
  983. border-bottom: 2rpx solid $border-color-light;
  984. padding: 38rpx 25rpx;
  985. .word {
  986. font-size: $uni-font-size-base;
  987. font-weight: bold;
  988. color: $font-color-dark;
  989. }
  990. image {
  991. width: 25rpx;
  992. height: 25rpx;
  993. }
  994. }
  995. .one {
  996. height: 20rpx;
  997. background-color: #f6f6f6;
  998. }
  999. .Third {
  1000. .two1 {
  1001. width: 55%;
  1002. background-color: #ffffff;
  1003. padding-left: 25rpx;
  1004. .two1-1 {
  1005. font-size: $uni-font-size-base;
  1006. font-weight: 400;
  1007. color: $font-color-dark;
  1008. }
  1009. .two1-2 {
  1010. font-size: $uni-font-size-sm;
  1011. font-weight: bold;
  1012. color: $color-red1;
  1013. }
  1014. .size {
  1015. font-size: $uni-font-size-lg + 4rpx;
  1016. }
  1017. }
  1018. .two2 {
  1019. width: 45%;
  1020. background: $color-red1;
  1021. color: #ffffff;
  1022. font-size: $uni-font-size-lg;
  1023. font-weight: 550;
  1024. text-align: center;
  1025. padding: 30rpx 0rpx;
  1026. }
  1027. .clickbg {
  1028. background-color: $color-gray !important;
  1029. }
  1030. }
  1031. }
  1032. .popup {
  1033. width: 536rpx;
  1034. .img {
  1035. width: 100%;
  1036. }
  1037. .row {
  1038. background: #ffffff;
  1039. overflow: hidden;
  1040. border-radius: 0 0 10rpx 10rpx;
  1041. padding: 45rpx 45rpx;
  1042. margin-top: -15rpx;
  1043. .row-1 {
  1044. font-size: $font-lg + 4rpx;
  1045. font-weight: 500;
  1046. color: rgba(51, 51, 51, 1);
  1047. line-height: 53rpx;
  1048. text-align: center;
  1049. }
  1050. .row-2 {
  1051. font-size: $uni-font-size-lg;
  1052. font-weight: 500;
  1053. color: $font-color-dark;
  1054. line-height: 44rpx;
  1055. text-align: center;
  1056. margin-top: 35rpx;
  1057. }
  1058. .row-3 {
  1059. width: 80%;
  1060. height: 70rpx;
  1061. margin: 0 auto;
  1062. margin-top: 40rpx;
  1063. background: linear-gradient(0deg, rgba(126, 153, 254, 1), rgba(151, 143, 250, 1));
  1064. border-radius: 34rpx;
  1065. justify-content: center;
  1066. font-size: $uni-font-size-lg + 4rpx;
  1067. font-weight: 500;
  1068. color: #f8f9f9;
  1069. }
  1070. }
  1071. }
  1072. .pay-type-list {
  1073. margin-top: 20upx;
  1074. background-color: #fff;
  1075. padding-left: 40upx;
  1076. .type-item {
  1077. height: 120upx;
  1078. padding: 20upx 0;
  1079. display: flex;
  1080. justify-content: space-between;
  1081. align-items: center;
  1082. padding-right: 60upx;
  1083. font-size: 30upx;
  1084. position: relative;
  1085. }
  1086. .type-item1 {
  1087. height: 120upx;
  1088. padding: 20upx 0;
  1089. // display: flex;
  1090. justify-content: space-between;
  1091. align-items: center;
  1092. padding-right: 60upx;
  1093. font-size: 30upx;
  1094. position: relative;
  1095. .row-1 {
  1096. display: flex;
  1097. }
  1098. .row-2 {
  1099. margin-top: 12rpx;
  1100. font-size: 28rpx;
  1101. color: #c0c4cc;
  1102. text-align: center;
  1103. }
  1104. }
  1105. .icon {
  1106. width: 100upx;
  1107. font-size: 52upx;
  1108. }
  1109. .img {
  1110. color: #fe8e2e;
  1111. width: 50rpx;
  1112. height: 50rpx;
  1113. image {
  1114. width: 100%;
  1115. height: 100%;
  1116. }
  1117. }
  1118. .tit {
  1119. font-size: $font-lg;
  1120. color: $font-color-dark;
  1121. margin-bottom: 4upx;
  1122. }
  1123. .con {
  1124. flex: 1;
  1125. display: flex;
  1126. flex-direction: column;
  1127. padding-left: 25rpx;
  1128. font-size: $font-sm;
  1129. color: $font-color-light;
  1130. }
  1131. }
  1132. .ddwc {
  1133. width: 40%;
  1134. background-color: #6786fb;
  1135. color: #fff;
  1136. text-align: center;
  1137. font-size: 28rpx;
  1138. line-height: 80rpx;
  1139. border-radius: 40rpx;
  1140. }
  1141. .lxys {
  1142. // margin-right: 20rpx;
  1143. border: 1px solid #6786fb;
  1144. background-color: #fff;
  1145. color: #6786fb;
  1146. }
  1147. </style>