good-list.vue 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315
  1. <template>
  2. <view class="order-list">
  3. <view v-for="(item,index) in dataList" :key="index" class="item" >
  4. <!-- 订单号,状态 -->
  5. <view class="ordersn-box">
  6. <view class="num">订单号:{{item.orderCode}}</view>
  7. <view class="status-box">
  8. <!-- <view class="recom-box">推荐订单</view> -->
  9. <text class="text success">
  10. {{parseDictName(item.status)}}
  11. </text>
  12. </view>
  13. </view>
  14. <!-- 药品列表 -->
  15. <view class="drug-list" >
  16. <view v-for="(subItem,index) in item.items" :key="index" class="drug-item">
  17. <view class="img-box">
  18. <image :src="JSON.parse(subItem.jsonInfo).image" mode="aspectFill"></image>
  19. </view>
  20. <view class="drug-info" >
  21. <view>
  22. <view class="name-box ellipsis2">
  23. <view v-if="subItem.isPrescribe==1" class="tag">处方药</view>{{JSON.parse(subItem.jsonInfo).productName}}
  24. </view>
  25. <view class="spec ellipsis">{{JSON.parse(subItem.jsonInfo).sku}}</view>
  26. </view>
  27. <view class="num-box">
  28. <view class="price">
  29. <text class="unit">¥</text>
  30. <text class="num" v-if="JSON.parse(subItem.jsonInfo).price!=null">{{JSON.parse(subItem.jsonInfo).price.toFixed(2)}}</text>
  31. </view>
  32. <view class="amount">x{{JSON.parse(subItem.jsonInfo).num}}</view>
  33. </view>
  34. </view>
  35. </view>
  36. <!-- 实付金额、按钮 -->
  37. <view class="bottom-box">
  38. <view class="amount-paid">
  39. <text class="label">实付金额:</text>
  40. <view class="price-box">
  41. <view class="unit">¥</view>
  42. <view class="num" >{{item.payPrice.toFixed(2)}}</view>
  43. </view>
  44. </view>
  45. <view class="btn-box">
  46. <view class="btn pay" @click.stop="showDetail(item)">
  47. 查看详情
  48. </view>
  49. </view>
  50. </view>
  51. </view>
  52. </view>
  53. </view>
  54. </template>
  55. <script>
  56. export default {
  57. props:{
  58. dataList: {
  59. type: Array,
  60. default(){
  61. return []
  62. }
  63. }
  64. },
  65. methods: {
  66. parseDictName(val){
  67. var name=""
  68. name=this.getStoreDictByName('store_order_status',val);
  69. return name;
  70. },
  71. showDetail(item) {
  72. uni.navigateTo({
  73. url: '/pages/user/order/storeOrderDetail?id=' + item.id
  74. })
  75. },
  76. getStoreDictByName(key,dictValue) {
  77. if(dictValue==null || dictValue==-1){
  78. return "请选择";
  79. }
  80. var dicts = uni.getStorageSync(key);
  81. var dict=JSON.parse(dicts);
  82. var name="";
  83. dict.forEach(function(item, index, array) {
  84. if(dictValue.toString()==item.dictValue.toString()){
  85. name=item.dictLabel
  86. }
  87. });
  88. return name;
  89. }
  90. }
  91. }
  92. </script>
  93. <style scoped lang="scss">
  94. .order-list{
  95. padding: 20upx;
  96. .item{
  97. background: #FFFFFF;
  98. border-radius: 16upx;
  99. padding: 0 30upx;
  100. margin-bottom: 20upx;
  101. .ordersn-box{
  102. display: flex;
  103. align-items: center;
  104. justify-content: space-between;
  105. padding: 34upx 0 20upx;
  106. .num{
  107. font-size: 26upx;
  108. font-family: PingFang SC;
  109. font-weight: 500;
  110. color: #999999;
  111. line-height: 1;
  112. }
  113. .status-box{
  114. display: flex;
  115. align-items: center;
  116. .recom-box{
  117. width: 108upx;
  118. height: 30upx;
  119. line-height: 30upx;
  120. text-align: left;
  121. padding-left: 8upx;
  122. font-size: 22upx;
  123. font-family: PingFang SC;
  124. font-weight: 500;
  125. color: #FFFFFF;
  126. //background-image: url(../static/images/recom.png);
  127. background-repeat: no-repeat;
  128. background-size: 100% 100%;
  129. margin-right: 8upx;
  130. }
  131. .text{
  132. font-size: 28upx;
  133. font-family: PingFang SC;
  134. font-weight: 500;
  135. line-height: 1;
  136. &.success{
  137. color: #2BC7B9;
  138. }
  139. &.black{
  140. color: #111111;
  141. }
  142. &.info{
  143. color: #999999;
  144. }
  145. }
  146. }
  147. }
  148. .drug-list{
  149. .drug-item{
  150. padding: 30upx 0;
  151. border-bottom: 1px soli #F0F0F0;
  152. display: flex;
  153. align-items: center;
  154. .img-box{
  155. width: 160upx;
  156. height: 160upx;
  157. margin-right: 30upx;
  158. flex-shrink: 0;
  159. image{
  160. width: 100%;
  161. height: 100%;
  162. }
  163. }
  164. .drug-info{
  165. width: calc(100% - 190upx);
  166. display: flex;
  167. flex-direction: column;
  168. justify-content: space-between;
  169. .name-box{
  170. font-size: 28upx;
  171. font-family: PingFang SC;
  172. font-weight: 500;
  173. color: #111111;
  174. line-height: 40upx;
  175. .tag{
  176. display: inline-block;
  177. padding: 0 6upx;
  178. height: 30upx;
  179. background: linear-gradient(90deg, #2BC7B9 0%, #2BC7A4 100%);
  180. border-radius: 4upx;
  181. margin-right: 10upx;
  182. font-size: 22upx;
  183. font-family: PingFang SC;
  184. font-weight: bold;
  185. color: #FFFFFF;
  186. line-height: 30upx;
  187. float: left;
  188. margin-top: 7upx;
  189. }
  190. }
  191. .spec{
  192. font-size: 24upx;
  193. font-family: PingFang SC;
  194. font-weight: 500;
  195. color: #999999;
  196. line-height: 1;
  197. margin-top: 10upx;
  198. }
  199. .num-box{
  200. display: flex;
  201. align-items: center;
  202. justify-content: space-between;
  203. .price{
  204. display: flex;
  205. align-items: flex-end;
  206. .unit{
  207. font-size: 24upx;
  208. font-family: PingFang SC;
  209. font-weight: 500;
  210. color: #111111;
  211. line-height: 1.2;
  212. margin-right: 4upx;
  213. }
  214. .num{
  215. font-size: 32upx;
  216. font-family: PingFang SC;
  217. font-weight: 500;
  218. color: #111111;
  219. line-height: 1;
  220. }
  221. }
  222. .amount{
  223. font-size: 24upx;
  224. font-family: PingFang SC;
  225. font-weight: 500;
  226. color: #999999;
  227. line-height: 1;
  228. }
  229. }
  230. }
  231. }
  232. .bottom-box{
  233. height: 110upx;
  234. display: flex;
  235. align-items: center;
  236. justify-content: space-between;
  237. .amount-paid{
  238. display: flex;
  239. align-items: center;
  240. .label{
  241. font-size: 24upx;
  242. font-family: PingFang SC;
  243. font-weight: 500;
  244. color: #999999;
  245. line-height: 1;
  246. }
  247. .price-box{
  248. display: flex;
  249. align-items: flex-end;
  250. .unit{
  251. font-size: 24upx;
  252. font-family: PingFang SC;
  253. font-weight: 500;
  254. color: #FF6633;
  255. line-height: 1.2;
  256. margin-right: 4upx;
  257. }
  258. .num{
  259. font-size: 32upx;
  260. font-family: PingFang SC;
  261. font-weight: bold;
  262. color: #FF6633;
  263. line-height: 1;
  264. }
  265. }
  266. }
  267. .btn-box{
  268. box-sizing: border-box;
  269. display: flex;
  270. align-items: center;
  271. .btn{
  272. width: 155upx;
  273. height: 64upx;
  274. line-height: 64upx;
  275. font-size: 26upx;
  276. font-family: PingFang SC;
  277. font-weight: 500;
  278. text-align: center;
  279. border-radius: 32upx;
  280. margin-left: 15upx;
  281. &:first-child{
  282. margin-left: 0;
  283. }
  284. &.cancel{
  285. border: 1px solid #DDDDDD;
  286. color: #666666;
  287. }
  288. &.pay{
  289. background: #2BC7B9;
  290. color: #FFFFFF;
  291. position: relative;
  292. .share{
  293. display: inline-block;
  294. position: absolute;
  295. top: 0;
  296. left: 0;
  297. width: 100%;
  298. height: 100%rpx;
  299. opacity: 0;
  300. }
  301. }
  302. }
  303. }
  304. }
  305. }
  306. }
  307. }
  308. </style>