traceability.vue 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269
  1. <template>
  2. <view class="intro-page common">
  3. <view class="top-class"></view>
  4. <view class="title">
  5. 产品溯源
  6. </view>
  7. <view class="head">
  8. <u-row class="row-class">
  9. <u-col span="4">
  10. <image class="logo-img"
  11. src="https://hyscancode.oss-cn-hangzhou.aliyuncs.com/xiaochengxu/cjx/logo.png"
  12. mode="aspectFit" />
  13. </u-col>
  14. <u-col span="4">
  15. <image class="commodity-img"
  16. src="https://hyscancode.oss-cn-hangzhou.aliyuncs.com/xiaochengxu/cjx/commodity.png"
  17. mode="aspectFit" />
  18. </u-col>
  19. <u-col span="4">
  20. <image class="logo-rules"
  21. src="https://hyscancode.oss-cn-hangzhou.aliyuncs.com/xiaochengxu/cjx/rules.png" />
  22. </u-col>
  23. </u-row>
  24. </view>
  25. <view class="topImg">
  26. <image class="img_1" src="https://hyscancode.oss-cn-hangzhou.aliyuncs.com/xiaochengxu/cjx/topImg.png"
  27. mode="heightFix" />
  28. </view>
  29. <!-- 公司简介内容卡片 -->
  30. <view class="content">
  31. <view class="cardTop"></view>
  32. <view class="content_text">
  33. <view class="content_imgView">
  34. <image class="img_2" src="https://hyscancode.oss-cn-hangzhou.aliyuncs.com/xiaochengxu/cjx/shangping.png"
  35. mode="heightFix" />
  36. </view>
  37. <u-row class="row-class" customStyle="margin-bottom: 5px">
  38. <u-col span="4">
  39. <view class="item-left item-text">产品名称</view>
  40. </u-col>
  41. <u-col span="8">
  42. <view class="item-text">{{info.productName}}</view>
  43. </u-col>
  44. </u-row>
  45. <u-row class="row-class" customStyle="margin-bottom: 5px">
  46. <u-col span="4">
  47. <view class="item-left item-text">商标名称</view>
  48. </u-col>
  49. <u-col span="8">
  50. <view class="item-text">超级炫</view>
  51. </u-col>
  52. </u-row>
  53. <u-row class="row-class" customStyle="margin-bottom: 5px">
  54. <u-col span="4">
  55. <view class="item-left item-text">产品原料</view>
  56. </u-col>
  57. <u-col span="8">
  58. <view class="item-text">精制槟榔</view>
  59. </u-col>
  60. </u-row>
  61. <u-row class="row-class" customStyle="margin-bottom: 5px">
  62. <u-col span="4">
  63. <view class="item-left item-text">生产日期</view>
  64. </u-col>
  65. <u-col span="8">
  66. <view class="item-text">{{info.formatted_time}}</view>
  67. </u-col>
  68. </u-row>
  69. <u-row class="row-class" customStyle="margin-bottom: 5px">
  70. <u-col span="4">
  71. <view class="item-left item-text">批&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;号</view>
  72. </u-col>
  73. <u-col span="8">
  74. <view class="item-text">{{info.pici}}</view>
  75. </u-col>
  76. </u-row>
  77. <u-row class="row-class" customStyle="margin-bottom: 5px">
  78. <u-col span="4">
  79. <view class="item-left item-text">保&nbsp;&nbsp;质&nbsp;&nbsp;期</view>
  80. </u-col>
  81. <u-col span="8">
  82. <view class="item-text">60天</view>
  83. </u-col>
  84. </u-row>
  85. <u-row class="row-class" customStyle="margin-bottom: 5px">
  86. <u-col span="4">
  87. <view class="item-left item-text">出&nbsp;&nbsp;品&nbsp;&nbsp;商</view>
  88. </u-col>
  89. <u-col span="8">
  90. <view class="item-text">60天</view>
  91. </u-col>
  92. </u-row>
  93. <u-row class="row-class" customStyle="margin-bottom: 5px">
  94. <u-col span="4">
  95. <view class="item-left item-text">销售市场</view>
  96. </u-col>
  97. <u-col span="8">
  98. <view class="item-text">湖南长沙</view>
  99. </u-col>
  100. </u-row>
  101. <u-row class="row-class" customStyle="margin-bottom: 5px">
  102. <u-col span="4">
  103. <view class="item-left item-text">生产厂址</view>
  104. </u-col>
  105. <u-col span="8">
  106. <view class="item-text">湖南省娄底市新化县</view>
  107. </u-col>
  108. </u-row>
  109. </view>
  110. <view class="return_view">
  111. <view class="return-button">返回</view>
  112. </view>
  113. </view>
  114. </view>
  115. </template>
  116. <script>
  117. import {
  118. suyuanData
  119. } from '@/api/scan'
  120. export default {
  121. data() {
  122. return {
  123. scanCode: '',
  124. info: {}
  125. }
  126. },
  127. onLoad() {
  128. this.scanCode = uni.getStorageSync('scanCode');
  129. this.initData();
  130. },
  131. methods: {
  132. goBack() {
  133. uni.navigateBack();
  134. },
  135. initData() {
  136. suyuanData(this.scanCode).then(res => {
  137. console.log(res)
  138. if (res.code == 0) {
  139. this.info = res.data.info;
  140. this.info.formatted_time = this.info.create_time.split(' ')[0];
  141. }
  142. })
  143. }
  144. }
  145. }
  146. </script>
  147. <style lang="scss" scoped>
  148. @import url('../../../static/scss/common_cjx.css');
  149. .row-class {
  150. height: 60rpx;
  151. }
  152. .theme-text {
  153. height: 10vh;
  154. text-align: center;
  155. line-height: 11vh;
  156. .textImage {
  157. height: 80rpx;
  158. width: 400rpx;
  159. }
  160. }
  161. .intro-card {
  162. margin: 0 32rpx;
  163. background: rgba(131, 100, 71, 0.5);
  164. border-radius: 10rpx;
  165. max-height: 65vh;
  166. overflow: auto;
  167. .intro-view {
  168. border: 2rpx solid #341B10;
  169. padding: 20rpx;
  170. margin: 20rpx;
  171. position: relative;
  172. margin-top: 30rpx;
  173. .intro-label {
  174. background-image:
  175. url("https://hyscancode.oss-cn-hangzhou.aliyuncs.com/xiaochengxu/guzhenganzi/label.png");
  176. /* 使用绝对路径 */
  177. background-size: contain;
  178. background-repeat: no-repeat;
  179. width: 220rpx;
  180. height: 120rpx;
  181. position: absolute;
  182. margin-top: -70rpx;
  183. align-content: center;
  184. margin-left: -28rpx;
  185. .label-title {
  186. font-weight: bold;
  187. font-size: 30rpx;
  188. color: #341B10;
  189. text-align: center;
  190. margin-left: 10px;
  191. height: 120rpx;
  192. line-height: 110rpx;
  193. }
  194. }
  195. .intro-content {
  196. font-size: 28rpx;
  197. color: #5c4322;
  198. line-height: 1.8;
  199. margin-top: 20rpx;
  200. text-align: justify;
  201. }
  202. }
  203. }
  204. .image-display {
  205. text-align: center;
  206. .company-img {
  207. width: 80%;
  208. height: 240rpx;
  209. border-radius: 12rpx;
  210. object-fit: cover;
  211. margin-top: 20rpx;
  212. background: #eee;
  213. }
  214. }
  215. ::v-deep .item-left {
  216. border-radius: 6rpx !important;
  217. text-align: center;
  218. width: 160rpx !important;
  219. }
  220. .item-text {
  221. font-weight: 500;
  222. font-size: 30rpx;
  223. color: #FFFFFF;
  224. }
  225. .content {
  226. height: 68vh;
  227. border-radius: 10rpx;
  228. margin: 0rpx 40rpx;
  229. padding: 10rpx 24rpx;
  230. overflow: auto;
  231. align-items: center;
  232. justify-content: center;
  233. background-image:
  234. url("https://hyscancode.oss-cn-hangzhou.aliyuncs.com/xiaochengxu/cjx/cardBgi.png");
  235. background-size: cover;
  236. background-position: center;
  237. background-repeat: no-repeat;
  238. }
  239. .img_2{
  240. height: 240rpx;
  241. }
  242. .content_imgView{
  243. display: flex;
  244. justify-content: center;
  245. }
  246. </style>