storeOrder.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451
  1. <template>
  2. <view>
  3. <view class="search-cont">
  4. <view class="inner">
  5. <image class="icon-search" src="/static/images/search.png" mode=""></image>
  6. <input type="text" value="" placeholder="输入订单号" confirm-type="搜索" @confirm="goSearch" placeholder-style="font-size:28rpx;color:#BBBBBB;font-family: PingFang SC;" />
  7. </view>
  8. </view>
  9. <!-- 订单列表 -->
  10. <mescroll-body ref="mescrollRef" @init="mescrollInit" @down="downCallback" @up="upCallback" :down="downOption" :up="upOption">
  11. <view class="order-list">
  12. <view v-for="(item,index) in dataList" :key="index" class="item" >
  13. <!-- 订单号,状态 -->
  14. <view class="ordersn-box">
  15. <view class="num">订单号:{{item.orderCode}}</view>
  16. <view class="status-box">
  17. <!-- <view class="recom-box">推荐订单</view> -->
  18. <text class="text success">
  19. {{utils.getDictLabelName("storeOrderStatus",item.status)}}
  20. </text>
  21. </view>
  22. </view>
  23. <!-- 药品列表 -->
  24. <view class="drug-list" >
  25. <view v-for="(subItem,index) in item.items" :key="index" class="drug-item">
  26. <view class="img-box">
  27. <image :src="JSON.parse(subItem.jsonInfo).image" mode="aspectFill"></image>
  28. </view>
  29. <view class="drug-info" >
  30. <view>
  31. <view class="name-box ellipsis2">
  32. <view v-if="subItem.isPrescribe==1" class="tag">处方药</view>{{JSON.parse(subItem.jsonInfo).productName}}
  33. </view>
  34. <view class="spec">{{JSON.parse(subItem.jsonInfo).sku}}</view>
  35. </view>
  36. <view class="num-box">
  37. <view class="price">
  38. <text class="unit">¥</text>
  39. <text class="num" v-if="JSON.parse(subItem.jsonInfo).price!=null">{{JSON.parse(subItem.jsonInfo).price.toFixed(2)}}</text>
  40. </view>
  41. <view class="amount">x{{JSON.parse(subItem.jsonInfo).num}}</view>
  42. </view>
  43. </view>
  44. </view>
  45. <view class="drug-item" v-if="item.packageJson">
  46. <view class="img-box">
  47. <image :src="JSON.parse(item.packageJson).imgUrl" mode="aspectFill"></image>
  48. </view>
  49. <view class="drug-info" >
  50. <view>
  51. <view class="name-box ellipsis2">
  52. <view v-if="item.isPrescribe==1" class="tag">处方药</view>{{JSON.parse(item.packageJson).title}}
  53. </view>
  54. <view class="spec">{{JSON.parse(item.packageJson).title}}</view>
  55. </view>
  56. </view>
  57. </view>
  58. <!-- 实付金额、按钮 -->
  59. <view class="bottom-box">
  60. <view class="amount-paid">
  61. <text class="label">实付金额:</text>
  62. <view class="price-box">
  63. <view class="unit">¥</view>
  64. <view class="num" >{{item.payPrice.toFixed(2)}}</view>
  65. </view>
  66. </view>
  67. <view class="btn-box">
  68. <view class="btn pay" @click.stop="showDetail(item)">
  69. 查看详情
  70. </view>
  71. </view>
  72. </view>
  73. </view>
  74. </view>
  75. </view>
  76. </mescroll-body>
  77. </view>
  78. </template>
  79. <script>
  80. import {getCompanyStoreOrderList} from '@/api/storeOrder'
  81. import MescrollMixin from "@/uni_modules/mescroll-uni/components/mescroll-uni/mescroll-mixins.js";
  82. export default {
  83. mixins: [MescrollMixin],
  84. data() {
  85. return {
  86. searchKey:"",
  87. mescroll:null,
  88. // 上拉加载的配置
  89. upOption: {
  90. onScroll:true,
  91. use: true, // 是否启用上拉加载; 默认true
  92. page: {
  93. num: 0, // 当前页码,默认0,回调之前会加1,即callback(page)会从1开始
  94. size: 10 // 每页数据的数量,默认10
  95. },
  96. noMoreSize: 10, // 配置列表的总数量要大于等于5条才显示'-- END --'的提示
  97. empty: {
  98. icon:'/static/images/no_data.png',
  99. tip: '暂无数据'
  100. }
  101. },
  102. // 列表数据
  103. dataList: [],
  104. };
  105. },
  106. onLoad(options) {
  107. var that=this;
  108. uni.$on('refreshOrder', () => {
  109. that.mescroll.resetUpScroll()
  110. })
  111. this.companyId=options.companyId;
  112. this.companyUserId=options.companyUserId;
  113. },
  114. methods: {
  115. goSearch(e) {
  116. this.searchKey=e.detail.value;
  117. this.mescroll.resetUpScroll()
  118. },
  119. mescrollInit(mescroll) {
  120. this.mescroll = mescroll;
  121. },
  122. /*下拉刷新的回调 */
  123. downCallback(mescroll) {
  124. mescroll.resetUpScroll()
  125. },
  126. upCallback(page) {
  127. //联网加载数据
  128. var that = this;
  129. var data = {
  130. keyword:this.searchKey,
  131. companyId:this.companyId,
  132. companyUserId:this.companyUserId,
  133. page: page.num,
  134. pageSize: page.size
  135. };
  136. getCompanyStoreOrderList(data).then(res => {
  137. if(res.code==200){
  138. //设置列表数据
  139. if (page.num == 1) {
  140. that.dataList = res.data.list;
  141. } else {
  142. that.dataList = that.dataList.concat(res.data.list);
  143. }
  144. that.mescroll.endBySize(res.data.list.length, res.data.total);
  145. }else{
  146. uni.showToast({
  147. icon:'none',
  148. title: "请求失败",
  149. });
  150. that.dataList = null;
  151. that.mescroll.endErr();
  152. }
  153. });
  154. },
  155. showDetail(item) {
  156. uni.navigateTo({
  157. url: './storeOrderDetail?id=' + item.id
  158. })
  159. },
  160. // cancel(item){
  161. // var that=this;
  162. // uni.showModal({
  163. // title: '提示',
  164. // content: '确定取消订单吗',
  165. // success: function (res) {
  166. // if (res.confirm) {
  167. // var data = {
  168. // orderId:item.id
  169. // };
  170. // cancelOrder(data).then(res => {
  171. // if(res.code==200){
  172. // uni.showToast({
  173. // icon:'success',
  174. // title: "操作成功",
  175. // });
  176. // that.mescroll.resetUpScroll()
  177. // }else{
  178. // uni.showToast({
  179. // icon:'none',
  180. // title: res.msg,
  181. // });
  182. // }
  183. // });
  184. // }
  185. // else if (res.cancel) {
  186. // }
  187. // }
  188. // });
  189. // },
  190. // pay(item) {
  191. // uni.navigateTo({
  192. // url: '../shopping/paymentOrder?orderId='+item.id
  193. // })
  194. // },
  195. // 查看物流
  196. // showDelivery(item) {
  197. // uni.navigateTo({
  198. // url: './storeOrderDelivery?orderId='+item.id
  199. // })
  200. // }
  201. }
  202. }
  203. </script>
  204. <style lang="scss">
  205. .search-cont{
  206. padding: 16upx 30upx;
  207. background-color: #FFFFFF;
  208. .inner{
  209. box-sizing: border-box;
  210. width: 100%;
  211. height: 72upx;
  212. background: #F7F7F7;
  213. border-radius: 36upx;
  214. display: flex;
  215. align-items: center;
  216. padding: 0 30upx;
  217. .icon-search{
  218. width: 28upx;
  219. height: 28upx;
  220. margin-right: 20upx;
  221. }
  222. input{
  223. height: 60upx;
  224. line-height: 60upx;
  225. flex: 1;
  226. }
  227. }
  228. }
  229. .order-list{
  230. padding: 20upx;
  231. .item{
  232. background: #FFFFFF;
  233. border-radius: 16upx;
  234. padding: 0 30upx;
  235. margin-bottom: 20upx;
  236. .ordersn-box{
  237. display: flex;
  238. align-items: center;
  239. justify-content: space-between;
  240. padding: 34upx 0 20upx;
  241. .num{
  242. font-size: 26upx;
  243. font-family: PingFang SC;
  244. font-weight: 500;
  245. color: #999999;
  246. line-height: 1;
  247. }
  248. .status-box{
  249. display: flex;
  250. align-items: center;
  251. .recom-box{
  252. width: 108upx;
  253. height: 30upx;
  254. line-height: 30upx;
  255. text-align: left;
  256. padding-left: 8upx;
  257. font-size: 22upx;
  258. font-family: PingFang SC;
  259. font-weight: 500;
  260. color: #FFFFFF;
  261. background-image: url(../static/images/recom.png);
  262. background-repeat: no-repeat;
  263. background-size: 100% 100%;
  264. margin-right: 8upx;
  265. }
  266. .text{
  267. font-size: 28upx;
  268. font-family: PingFang SC;
  269. font-weight: 500;
  270. line-height: 1;
  271. &.success{
  272. color: #2BC7B9;
  273. }
  274. &.black{
  275. color: #111111;
  276. }
  277. &.info{
  278. color: #999999;
  279. }
  280. }
  281. }
  282. }
  283. .drug-list{
  284. .drug-item{
  285. padding: 30upx 0;
  286. border-bottom: 1px soli #F0F0F0;
  287. display: flex;
  288. align-items: center;
  289. .img-box{
  290. width: 160upx;
  291. height: 160upx;
  292. margin-right: 30upx;
  293. flex-shrink: 0;
  294. image{
  295. width: 100%;
  296. height: 100%;
  297. }
  298. }
  299. .drug-info{
  300. width: calc(100% - 190upx);
  301. height: 160upx;
  302. display: flex;
  303. flex-direction: column;
  304. justify-content: space-between;
  305. .name-box{
  306. font-size: 28upx;
  307. font-family: PingFang SC;
  308. font-weight: 500;
  309. color: #111111;
  310. line-height: 40upx;
  311. .tag{
  312. display: inline-block;
  313. padding: 0 6upx;
  314. height: 30upx;
  315. background: linear-gradient(90deg, #2BC7B9 0%, #2BC7A4 100%);
  316. border-radius: 4upx;
  317. margin-right: 10upx;
  318. font-size: 22upx;
  319. font-family: PingFang SC;
  320. font-weight: bold;
  321. color: #FFFFFF;
  322. line-height: 30upx;
  323. float: left;
  324. margin-top: 7upx;
  325. }
  326. }
  327. .spec{
  328. font-size: 24upx;
  329. font-family: PingFang SC;
  330. font-weight: 500;
  331. color: #999999;
  332. line-height: 1;
  333. margin-top: 10upx;
  334. }
  335. .num-box{
  336. display: flex;
  337. align-items: center;
  338. justify-content: space-between;
  339. .price{
  340. display: flex;
  341. align-items: flex-end;
  342. .unit{
  343. font-size: 24upx;
  344. font-family: PingFang SC;
  345. font-weight: 500;
  346. color: #111111;
  347. line-height: 1.2;
  348. margin-right: 4upx;
  349. }
  350. .num{
  351. font-size: 32upx;
  352. font-family: PingFang SC;
  353. font-weight: 500;
  354. color: #111111;
  355. line-height: 1;
  356. }
  357. }
  358. .amount{
  359. font-size: 24upx;
  360. font-family: PingFang SC;
  361. font-weight: 500;
  362. color: #999999;
  363. line-height: 1;
  364. }
  365. }
  366. }
  367. }
  368. .bottom-box{
  369. height: 110upx;
  370. display: flex;
  371. align-items: center;
  372. justify-content: space-between;
  373. .amount-paid{
  374. display: flex;
  375. align-items: center;
  376. .label{
  377. font-size: 24upx;
  378. font-family: PingFang SC;
  379. font-weight: 500;
  380. color: #999999;
  381. line-height: 1;
  382. }
  383. .price-box{
  384. display: flex;
  385. align-items: flex-end;
  386. .unit{
  387. font-size: 24upx;
  388. font-family: PingFang SC;
  389. font-weight: 500;
  390. color: #FF6633;
  391. line-height: 1.2;
  392. margin-right: 4upx;
  393. }
  394. .num{
  395. font-size: 32upx;
  396. font-family: PingFang SC;
  397. font-weight: bold;
  398. color: #FF6633;
  399. line-height: 1;
  400. }
  401. }
  402. }
  403. .btn-box{
  404. box-sizing: border-box;
  405. display: flex;
  406. align-items: center;
  407. .btn{
  408. width: 155upx;
  409. height: 64upx;
  410. line-height: 64upx;
  411. font-size: 26upx;
  412. font-family: PingFang SC;
  413. font-weight: 500;
  414. text-align: center;
  415. border-radius: 32upx;
  416. margin-left: 15upx;
  417. &:first-child{
  418. margin-left: 0;
  419. }
  420. &.cancel{
  421. border: 1px solid #DDDDDD;
  422. color: #666666;
  423. }
  424. &.pay{
  425. background: #2BC7B9;
  426. color: #FFFFFF;
  427. position: relative;
  428. .share{
  429. display: inline-block;
  430. position: absolute;
  431. top: 0;
  432. left: 0;
  433. width: 100%;
  434. height: 100%rpx;
  435. opacity: 0;
  436. }
  437. }
  438. }
  439. }
  440. }
  441. }
  442. }
  443. }
  444. </style>