purchase.vue 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244
  1. <template>
  2. <view class="purchase-traceability-page">
  3. <!-- 顶部导航栏 -->
  4. <uni-nav-bar
  5. fixed="true"
  6. statusBar="true"
  7. left-icon="back"
  8. title="采购溯源"
  9. background-color="#fff"
  10. color="#000"
  11. @clickLeft="handleBack"
  12. ></uni-nav-bar>
  13. <!-- 主内容区 -->
  14. <view class="content-wrapper">
  15. <!-- 产品图片区域 -->
  16. <view class="product-image-section">
  17. <view class="product-title">
  18. 采购溯源
  19. </view>
  20. <image class="product-image" :src="productImageSrc" mode="aspectFit"></image>
  21. </view>
  22. <!-- 采购信息列表 -->
  23. <view class="info-list">
  24. <!-- 采购详情标题 -->
  25. <view class="info-title">
  26. <text>采购详情</text>
  27. </view>
  28. <view class="info-item">
  29. <text class="info-label">原药批号:</text>
  30. <text class="info-value">YA085-250401</text>
  31. </view>
  32. <view class="info-item">
  33. <text class="info-label">原药产地:</text>
  34. <text class="info-value">湖南怀化</text>
  35. </view>
  36. <view class="info-item">
  37. <text class="info-label">采购时间:</text>
  38. <text class="info-value"></text>
  39. </view>
  40. <view class="info-item">
  41. <text class="info-label">采购人员:</text>
  42. <text class="info-value">申瑶</text>
  43. </view>
  44. <view class="info-item">
  45. <text class="info-label">采购重量:</text>
  46. <text class="info-value">1000kg</text>
  47. </view>
  48. <view class="info-item">
  49. <text class="info-label">采购日期:</text>
  50. <text class="info-value">2025-03-29</text>
  51. </view>
  52. <view class="images-section">
  53. <text class="section-subtitle">图片:</text>
  54. <view class="images-grid">
  55. <image class="detail-image" :src="detailImageSrc" mode="aspectFill"></image>
  56. </view>
  57. </view>
  58. </view>
  59. <!-- 图片展示区域 -->
  60. <!-- <view class="images-section">
  61. <text class="section-subtitle">图片:</text>
  62. <view class="images-grid">
  63. <image class="detail-image" :src="detailImageSrc" mode="aspectFill"></image>
  64. </view>
  65. </view> -->
  66. <!-- 返回首页按钮 -->
  67. <!-- <view class="home-button" @click="goToHome">
  68. <image class="home-icon" :src="homeIconSrc" mode="aspectFit"></image>
  69. </view> -->
  70. </view>
  71. </view>
  72. </template>
  73. <script>
  74. export default {
  75. data() {
  76. return {
  77. // 使用项目中已有的图标路径
  78. productImageSrc: '/static/product/1.svg',
  79. detailImageSrc: '/static/product/1.svg',
  80. homeIconSrc: '/static/tab/home.png'
  81. };
  82. },
  83. methods: {
  84. handleBack() {
  85. // 返回上一页
  86. uni.navigateBack();
  87. },
  88. goToHome() {
  89. // 返回首页
  90. uni.switchTab({
  91. url: '/pages/home/home'
  92. });
  93. }
  94. }
  95. };
  96. </script>
  97. <style lang="scss" scoped>
  98. .purchase-traceability-page {
  99. background-color: #f5f5f5;
  100. min-height: 100vh;
  101. background-image: url('/static/svg-icons/bg-pattern.svg');
  102. background-size: cover;
  103. background-position: center;
  104. }
  105. .content-wrapper {
  106. padding: 60rpx 40rpx 60rpx;
  107. }
  108. .product-image-section {
  109. display: flex;
  110. justify-content: center;
  111. margin-bottom: 40rpx;
  112. background-color: #fff;
  113. padding: 40rpx;
  114. border-radius: 20rpx;
  115. box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.05);
  116. border: 2rpx solid #ffe6e6;
  117. position: relative;
  118. }
  119. .product-title {
  120. position: absolute;
  121. font-size: 32rpx;
  122. font-weight: bold;
  123. color: #fff;
  124. text-align: center;
  125. margin-bottom: 20rpx;
  126. padding: 10rpx 40rpx;
  127. background: #bd0402;
  128. border-radius: 10rpx;
  129. box-shadow: 0 2rpx 8rpx rgba(255, 107, 107, 0.3);
  130. top: -20rpx;
  131. }
  132. .product-image {
  133. width: 100%;
  134. height: 400rpx;
  135. border-radius: 10rpx;
  136. margin-top: 20rpx;
  137. }
  138. .info-list {
  139. background-color: #fff;
  140. border-radius: 20rpx;
  141. padding: 30rpx;
  142. margin-bottom: 30rpx;
  143. box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.05);
  144. position: relative;
  145. padding-top: 56rpx;
  146. border: 2rpx solid #ffe6e6;
  147. }
  148. .info-title {
  149. position: absolute;
  150. top: -20rpx;
  151. left: 35%;
  152. background-color: #bd0402;
  153. color: #fff;
  154. text-align: center;
  155. padding: 10rpx 40rpx;
  156. margin-bottom: 30rpx;
  157. border-radius: 10rpx;
  158. font-size: 32rpx;
  159. font-weight: bold;
  160. }
  161. .info-item {
  162. display: flex;
  163. justify-content: space-between;
  164. align-items: center;
  165. padding: 20rpx 0;
  166. border-bottom: 1rpx solid #f0f0f0;
  167. }
  168. .info-item:last-child {
  169. border-bottom: none;
  170. }
  171. .info-label {
  172. font-size: 28rpx;
  173. color: #bd0402;
  174. }
  175. .info-value {
  176. font-size: 28rpx;
  177. color: #333;
  178. text-align: right;
  179. }
  180. .images-section {
  181. // background-color: #fff;
  182. // border-radius: 20rpx;
  183. padding: 20rpx 0;
  184. // margin-bottom: 60rpx;
  185. // box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.05);
  186. }
  187. .section-subtitle {
  188. font-size: 28rpx;
  189. color: #bd0402;
  190. margin-bottom: 20rpx;
  191. display: block;
  192. }
  193. .images-grid {
  194. display: flex;
  195. flex-direction: column;
  196. gap: 20rpx;
  197. }
  198. .detail-image {
  199. width: 100%;
  200. height: 400rpx;
  201. border-radius: 10rpx;
  202. }
  203. .home-button {
  204. position: fixed;
  205. bottom: 60rpx;
  206. right: 60rpx;
  207. width: 100rpx;
  208. height: 100rpx;
  209. background-color: #bd0402;
  210. border-radius: 50%;
  211. display: flex;
  212. justify-content: center;
  213. align-items: center;
  214. box-shadow: 0 4rpx 20rpx rgba(189, 4, 2, 0.4);
  215. }
  216. .home-icon {
  217. width: 60rpx;
  218. height: 60rpx;
  219. }
  220. </style>