storeOrder.vue 11 KB

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