addInformation.vue 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377
  1. <template>
  2. <view class="content">
  3. <view class="top-fixed">
  4. <!-- tab切换 -->
  5. <view class="pub-tab-box">
  6. <view class="tab-inner">
  7. <view
  8. v-for="(item,index) in orderStatus"
  9. :key="index"
  10. :class="item.val == showType?'item active':'item'"
  11. @click="orderStatusChange(item)"
  12. >
  13. <view class="text">
  14. {{ item.name }}
  15. </view>
  16. </view>
  17. </view>
  18. </view>
  19. </view>
  20. <mescroll-body top="88upx" ref="mescrollRef">
  21. <view class="phone-list" v-if="showType==1">
  22. <view v-for="(item,index) in dataList" :key="index" class="item" >
  23. <image src="/static/images/company/deenergize_icon.png" class="w32 h32"></image>
  24. <view class="phone-name">
  25. <view class="justify-between align-center" style="width: 100%;">
  26. <view class="name">{{item.name}}</view>
  27. <view class="type">去电</view>
  28. </view>
  29. <view class="time">{{item.time}}</view>
  30. </view>
  31. </view>
  32. </view>
  33. <view class="sms-list" v-if="showType==2">
  34. <view v-for="(item,index) in dataList2" :key="index" class="item" >
  35. <view class="title">{{item.content}}</view>
  36. <view class="box">
  37. <view class="time">{{item.time}}</view>
  38. <view class="state">{{item.state}}</view>
  39. </view>
  40. </view>
  41. </view>
  42. </mescroll-body>
  43. <view class="btn-box2">
  44. <view v-if="showType==1" class="sub-btn" @click="navgetTo(orderStatusValue)">
  45. <image src="/static/images/company/make_phone_call_icon.png" class="w48 h48"></image>
  46. <text>拨打电话</text>
  47. </view>
  48. <view v-if="showType==2" class="sub-btn" @click="navgetTo(orderStatusValue)">
  49. <image src="/static/images/company/send_SMS_icon.png" class="w48 h48"></image>
  50. <text>发送短信</text>
  51. </view>
  52. </view>
  53. </view>
  54. </template>
  55. <script>
  56. import {getMyDoctorOrderList,cancelOrder} from '@/api/doctorOrder.js'
  57. import MescrollMixin from "@/uni_modules/mescroll-uni/components/mescroll-uni/mescroll-mixins.js";
  58. export default {
  59. mixins: [MescrollMixin],
  60. data() {
  61. return {
  62. orderStatus:[
  63. {name:"电话记录",val:1},
  64. {name:"短信记录",val:2},
  65. ],
  66. showType:1,
  67. mescroll:null,
  68. // 上拉加载的配置
  69. upOption: {
  70. onScroll:true,
  71. use: true, // 是否启用上拉加载; 默认true
  72. page: {
  73. num: 0, // 当前页码,默认0,回调之前会加1,即callback(page)会从1开始
  74. size: 10 // 每页数据的数量,默认10
  75. },
  76. noMoreSize: 10, // 配置列表的总数量要大于等于5条才显示'-- END --'的提示
  77. empty: {
  78. icon:'/static/images/no_data.png',
  79. tip: '暂无数据'
  80. }
  81. },
  82. // 列表数据
  83. dataList: [
  84. {orderId:1, name:'今日 11:22',time:'4分16秒'},
  85. {orderId:2, name:'昨天 09:16',time:'4分16秒'},
  86. {orderId:3, name:'1月12 13:06',time:'4分16秒'}
  87. ],
  88. dataList2: [
  89. {orderId:1,content:'服用胰岛素口服液 规格20mg*20 每次1片1日一次 用法口服',state:'已送达',time:'2025-2-20 10:29',},
  90. {orderId:2,content:'服用胰岛素口服液 规格20mg*20 每次1片1日一次 用法口服',state:'已送达',time:'2025-2-20 10:29',},
  91. {orderId:3,content:'服用胰岛素口服液 规格20mg*20 每次1片1日一次 用法口服',state:'已送达',time:'2025-2-20 10:29',}
  92. ]
  93. }
  94. },
  95. onLoad() {
  96. // uni.$on('refreshDoctorOrder', () => {
  97. // this.mescroll.resetUpScroll()
  98. // })
  99. },
  100. methods: {
  101. pay(item){
  102. uni.navigateTo({
  103. url: '/pages_/doctor/paymentOrder?orderId='+item.orderId
  104. })
  105. },
  106. navgetTo(index){
  107. // uni.navigateTo({
  108. // url: index==0?'/pages_health/addServe':'/pages_health/addCompetitors'
  109. // })
  110. },
  111. cancel(item){
  112. var that=this;
  113. uni.showModal({
  114. title: '提示',
  115. content: '确定取消订单吗',
  116. success: function (res) {
  117. if (res.confirm) {
  118. var data = {
  119. orderId:item.orderId
  120. };
  121. cancelOrder(data).then(res => {
  122. if(res.code==200){
  123. uni.showToast({
  124. icon:'success',
  125. title: '订单已取消',
  126. });
  127. that.mescroll.resetUpScroll()
  128. }else{
  129. uni.showToast({
  130. icon:'none',
  131. title: res.msg,
  132. });
  133. }
  134. });
  135. }
  136. else if (res.cancel) {
  137. }
  138. }
  139. });
  140. },
  141. // tab切换
  142. orderStatusChange(item) {
  143. this.showType = item.val
  144. this.mescroll.resetUpScroll()
  145. },
  146. mescrollInit(mescroll) {
  147. this.mescroll = mescroll;
  148. },
  149. /*下拉刷新的回调 */
  150. downCallback(mescroll) {
  151. mescroll.resetUpScroll()
  152. },
  153. upCallback(page) {
  154. //联网加载数据
  155. var that = this;
  156. var data = {
  157. status:this.showType,
  158. page: page.num,
  159. pageSize: page.size
  160. };
  161. // getMyDoctorOrderList(data).then(res => {
  162. // if(res.code==200){
  163. // //设置列表数据
  164. // if (page.num == 1) {
  165. // that.dataList = res.data.list;
  166. // } else {
  167. // that.dataList = that.dataList.concat(res.data.list);
  168. // }
  169. // that.mescroll.endBySize(res.data.list.length, res.data.total);
  170. // }else{
  171. // uni.showToast({
  172. // icon:'none',
  173. // title: "请求失败",
  174. // });
  175. // that.dataList = null;
  176. // that.mescroll.endErr();
  177. // }
  178. // });
  179. },
  180. showDetail(item) {
  181. if(item.orderType==1){
  182. uni.navigateTo({
  183. url: '/pages_doctor/doctorOrderIM?orderId='+item.orderId
  184. })
  185. }
  186. }
  187. }
  188. }
  189. </script>
  190. <style lang="scss">
  191. .content{
  192. padding: 20upx;
  193. .top-fixed{
  194. width: 100%;
  195. position: fixed;
  196. top: 0;
  197. left: 0;
  198. z-index: 10;
  199. }
  200. .pub-tab-box{
  201. box-sizing: border-box;
  202. width: 100%;
  203. padding: 0 40upx;
  204. background-color: #FFFFFF;
  205. .tab-inner{
  206. height: 88upx;
  207. line-height: 88upx;
  208. display: flex;
  209. align-items: center;
  210. justify-content: space-between;
  211. overflow-x: auto;
  212. }
  213. .item{
  214. flex:1;
  215. font-size: 28upx;
  216. white-space: nowrap;
  217. line-height: 1;
  218. font-family: PingFang SC;
  219. font-weight: 500;
  220. color: #626468;
  221. // margin-right: 60upx;
  222. display: flex;
  223. align-items: center;
  224. justify-content: center;
  225. &:last-child{
  226. margin-right: 0;
  227. }
  228. &.active{
  229. font-weight: bold;
  230. color:#008FD3;
  231. &::after {
  232. content: "";
  233. width: 48rpx;
  234. height: 8rpx;
  235. background: linear-gradient(120deg, #31A1FE 0%, #008FD3 100%);
  236. position: absolute;
  237. bottom: 0;
  238. border-radius: 6upx 6upx 0upx 0;
  239. }
  240. }
  241. .text{
  242. position: relative;
  243. z-index: 1;
  244. }
  245. .tab-bg{
  246. width: 72upx;
  247. height: 28upx;
  248. position: absolute;
  249. top: 17upx;
  250. left: 50%;
  251. transform: translateX(-36upx);
  252. z-index: -1;
  253. }
  254. }
  255. }
  256. .btn-box2{
  257. z-index: 9999;
  258. width: 100%;
  259. padding: 30upx;
  260. position: fixed;
  261. bottom: 0;
  262. left: 0;
  263. box-sizing: border-box;
  264. // background: #FFFFFF;
  265. .sub-btn{
  266. width: 100%;
  267. height: 88upx;
  268. line-height: 88upx;
  269. text-align: center;
  270. font-size: 30upx;
  271. font-family: PingFang SC;
  272. font-weight: bold;
  273. color: #FFFFFF;
  274. background: #008FD3;
  275. border-radius: 44upx;
  276. display: flex;
  277. align-items: center;
  278. justify-content: center;
  279. image{
  280. margin-right: 16rpx;
  281. }
  282. }
  283. }
  284. .phone-list{
  285. padding: 30rpx;
  286. background: #FFFFFF;
  287. border-radius: 16rpx 16rpx 16rpx 16rpx;
  288. .item{
  289. display: flex;
  290. align-items: flex-start;
  291. border-bottom: 1rpx solid #ECECEC;
  292. padding-bottom: 30rpx;
  293. margin-bottom: 30rpx;
  294. &:last-child{
  295. border-bottom: 0;
  296. margin-bottom: 0;
  297. padding-bottom: 0;
  298. }
  299. .phone-name{
  300. display: flex;
  301. flex-direction: column;
  302. align-items: flex-start;
  303. justify-content: flex-start;
  304. padding-left: 24rpx;
  305. flex: 1;
  306. .name{
  307. font-family: PingFang SC;
  308. font-weight: 500;
  309. font-size: 32rpx;
  310. color: #222426;
  311. text-align: left;
  312. }
  313. .type{
  314. font-family: PingFang SC;
  315. font-weight: 400;
  316. font-size: 28rpx;
  317. color: #626468;
  318. text-align: right;
  319. }
  320. .time{
  321. font-family: PingFang SC;
  322. font-weight: 400;
  323. font-size: 28rpx;
  324. color: #898E91;
  325. text-align: left;
  326. margin-top: 14rpx;
  327. }
  328. }
  329. }
  330. }
  331. .sms-list{
  332. .item{
  333. padding: 30rpx;
  334. background: #FFFFFF;
  335. border-radius: 16rpx 16rpx 16rpx 16rpx;
  336. margin-bottom: 20rpx;
  337. .title{
  338. font-family: PingFang SC;
  339. font-weight: 500;
  340. font-size: 32rpx;
  341. color: #222426;
  342. text-align: left;
  343. }
  344. .box{
  345. display: flex;
  346. align-items: center;
  347. justify-content: space-between;
  348. padding-top: 22rpx;
  349. .time{
  350. font-family: PingFang SC;
  351. font-weight: 400;
  352. font-size: 24rpx;
  353. color: #898E91;
  354. text-align: left;
  355. }
  356. .state{
  357. font-family: PingFang SC;
  358. font-weight: 400;
  359. font-size: 24rpx;
  360. color: #2CAE5C;
  361. text-align: right;
  362. }
  363. }
  364. }
  365. }
  366. }
  367. </style>