traceability.vue 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278
  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" @click="openDetail"/>
  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" @click="goBack">返回</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. openDetail(){
  145. uni.navigateTo({
  146. url: '/pages/cjx/index/rules'
  147. });
  148. }
  149. }
  150. }
  151. </script>
  152. <style lang="scss" scoped>
  153. @import url('../../../static/scss/common_cjx.css');
  154. .row-class {
  155. height: 60rpx;
  156. }
  157. .cardTop{
  158. background-image:
  159. url("https://hyscancode.oss-cn-hangzhou.aliyuncs.com/xiaochengxu/cjx/cpsy.png");
  160. }
  161. .theme-text {
  162. height: 10vh;
  163. text-align: center;
  164. line-height: 11vh;
  165. .textImage {
  166. height: 80rpx;
  167. width: 400rpx;
  168. }
  169. }
  170. .intro-card {
  171. margin: 0 32rpx;
  172. background: rgba(131, 100, 71, 0.5);
  173. border-radius: 10rpx;
  174. max-height: 65vh;
  175. overflow: auto;
  176. .intro-view {
  177. border: 2rpx solid #341B10;
  178. padding: 20rpx;
  179. margin: 20rpx;
  180. position: relative;
  181. margin-top: 30rpx;
  182. .intro-label {
  183. background-image:
  184. url("https://hyscancode.oss-cn-hangzhou.aliyuncs.com/xiaochengxu/guzhenganzi/label.png");
  185. /* 使用绝对路径 */
  186. background-size: contain;
  187. background-repeat: no-repeat;
  188. width: 220rpx;
  189. height: 120rpx;
  190. position: absolute;
  191. margin-top: -70rpx;
  192. align-content: center;
  193. margin-left: -28rpx;
  194. .label-title {
  195. font-weight: bold;
  196. font-size: 30rpx;
  197. color: #341B10;
  198. text-align: center;
  199. margin-left: 10px;
  200. height: 120rpx;
  201. line-height: 110rpx;
  202. }
  203. }
  204. .intro-content {
  205. font-size: 28rpx;
  206. color: #5c4322;
  207. line-height: 1.8;
  208. margin-top: 20rpx;
  209. text-align: justify;
  210. }
  211. }
  212. }
  213. .image-display {
  214. text-align: center;
  215. .company-img {
  216. width: 80%;
  217. height: 240rpx;
  218. border-radius: 12rpx;
  219. object-fit: cover;
  220. margin-top: 20rpx;
  221. background: #eee;
  222. }
  223. }
  224. ::v-deep .item-left {
  225. border-radius: 6rpx !important;
  226. text-align: center;
  227. width: 160rpx !important;
  228. }
  229. .item-text {
  230. font-weight: 500;
  231. font-size: 30rpx;
  232. color: #FFFFFF;
  233. }
  234. .content {
  235. height: 68vh;
  236. border-radius: 10rpx;
  237. margin: 0rpx 40rpx;
  238. padding: 10rpx 24rpx;
  239. overflow: auto;
  240. align-items: center;
  241. justify-content: center;
  242. background-image:
  243. url("https://hyscancode.oss-cn-hangzhou.aliyuncs.com/xiaochengxu/cjx/cardBgi.png");
  244. background-size: cover;
  245. background-position: center;
  246. background-repeat: no-repeat;
  247. }
  248. .img_2{
  249. height: 240rpx;
  250. }
  251. .content_imgView{
  252. display: flex;
  253. justify-content: center;
  254. }
  255. </style>