storeOrder.vue 10 KB

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