testRecord.vue 9.8 KB

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