storeOrder.vue 11 KB

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