testRecord.vue 9.7 KB

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