storeOrder.vue 11 KB

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