marketItem.vue 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261
  1. <template>
  2. <view>
  3. <view >
  4. <template v-if="showType == 0">
  5. <view v-for="(item,index) in newsList" :key="index" class="box" >
  6. <view style="margin-left: 24rpx;margin-top: 24rpx;width: 640rpx;" class="box_BOTTOM" >
  7. <view class="box_time">
  8. <u--image radius='16rpx' width="48rpx" height="48rpx" src="/static/supplier/icon_gonyings.png" ></u--image>
  9. <text style="margin-left: 16rpx;">{{item.name}}</text>
  10. </view>
  11. <view class="flexac" @click="openFrom(item)">
  12. <text style="margin-right: 16rpx;font-size: 28rpx;color: #999;">查看详情</text>
  13. <u--image radius='16rpx' width="48rpx" height="48rpx" src="/static/myinfo/btn_right.png" ></u--image>
  14. </view>
  15. </view>
  16. <view class="divider"></view>
  17. <view class="PICbox">
  18. <view style="margin-left: 24rpx;" v-for="picItem in item.declareList" :key="picItem.id">
  19. <view >
  20. <u--image radius='16rpx' width="128rpx" height="128rpx" :src="picItem.pic" ></u--image>
  21. </view>
  22. </view>
  23. </view>
  24. </view>
  25. </template>
  26. <template v-if="showType == 1">
  27. <view v-for="(item,index) in newsList" :key="index" class="box2" >
  28. <view class="box_TOP">
  29. <view >
  30. <u--image radius='16rpx' width="128rpx" height="128rpx" :src="item.pic" ></u--image>
  31. </view>
  32. <view class="box_right">
  33. <view class="box_title2">
  34. {{item.supplierName}}
  35. </view>
  36. <!-- <view class="box_specifications">
  37. 规格:{{item.price}} g/只
  38. </view> -->
  39. <view class="box_num">
  40. <view class="box_num_item">
  41. <text>售价:</text><text style="color:#333;">{{'¥' + item.price}}</text>
  42. </view>
  43. <view class="box_num_item">
  44. <text>数量:</text><text style="color:#333;">{{item.num + '个'}}</text>
  45. </view>
  46. </view>
  47. </view>
  48. </view>
  49. <view class="divider"></view>
  50. <view class="box_BOTTOM" @click="openFrom(item)">
  51. <view class="box_time">
  52. <u--image radius='16rpx' width="48rpx" height="48rpx" src="/static/supplier/icon_gonyings.png" ></u--image>
  53. <text style="margin-left: 16rpx;">{{item.vendorName}}</text>
  54. </view>
  55. <view>
  56. <u--image radius='16rpx' width="48rpx" height="48rpx" src="/static/myinfo/btn_right.png" ></u--image>
  57. </view>
  58. </view>
  59. </view>
  60. </template>
  61. </view>
  62. </view>
  63. </template>
  64. <script>
  65. export default {
  66. components: {
  67. },
  68. props: {
  69. listdata: {
  70. type: Array,
  71. default: [],
  72. },
  73. showType: {
  74. type: Number,
  75. default: 0,
  76. },
  77. },
  78. watch:{
  79. listdata: {
  80. immediate: true,
  81. handler(val) {
  82. console.log(val);
  83. this.newsList = val
  84. },
  85. }
  86. },
  87. data() {
  88. return {
  89. newsList:[],
  90. selectData:null,
  91. showFrom:false,
  92. }
  93. },
  94. onLoad(e) {
  95. },
  96. methods: {
  97. openFrom(item){
  98. let id = item?.id || item?.vendorId;
  99. let name = item?.name || item?.vendorName;
  100. uni.navigateTo({
  101. url: '/supplierPages/pages/supplier/base/SupplypProductDetails?id=' + id + '&name=' + name,
  102. });
  103. },
  104. }
  105. }
  106. </script>
  107. <style lang="less" scoped>
  108. .box{
  109. width: 700rpx;
  110. height: 274rpx;
  111. background: #ffffff;
  112. border-radius: 16rpx;
  113. margin: 24rpx;
  114. display: flex;
  115. flex-direction: column;
  116. }
  117. .box_right{
  118. width: 500rpx;
  119. margin-left: 24rpx;
  120. }
  121. .box2{
  122. width: 700rpx;
  123. height: 273rpx;
  124. background: #ffffff;
  125. border-radius: 16rpx;
  126. margin: 24rpx;
  127. }
  128. .box_TOP{
  129. width: 676rpx;
  130. height: 152rpx;
  131. display: flex;
  132. align-items: center;
  133. margin-left: 12rpx;
  134. }
  135. .box_BOTTOM{
  136. width: 666rpx;
  137. display: flex;
  138. align-items: center;
  139. margin-left: 12rpx;
  140. justify-content: space-between;
  141. }
  142. .box_title2{
  143. font-size: 28rpx;
  144. font-weight: 500;
  145. text-align: left;
  146. color: #333333;
  147. }
  148. .box_specifications{
  149. margin-top: 6rpx;
  150. font-size: 24rpx;
  151. font-weight: 500;
  152. text-align: left;
  153. color: #999999;
  154. }
  155. .box_num{
  156. margin-top: 10rpx;
  157. display: flex;
  158. justify-content: space-between;
  159. }
  160. .box_num_item{
  161. display: flex;
  162. font-size: 28rpx;
  163. color: #999999;
  164. }
  165. .box_time{
  166. font-size: 28rpx;
  167. font-weight: 400;
  168. text-align: left;
  169. color: #999999;
  170. display: flex;
  171. align-items: center;
  172. }
  173. .box_type1{
  174. width: 140rpx;
  175. height: 56rpx;
  176. background: #ffedec;
  177. border-radius: 8rpx;
  178. font-size: 28rpx;
  179. font-family: PingFang SC, PingFang SC-Medium;
  180. font-weight: 500;
  181. text-align: left;
  182. color: #ff655b;
  183. line-height: 56rpx;
  184. text-align: center;
  185. }
  186. .box_type2{
  187. width: 140rpx;
  188. height: 56rpx;
  189. background: #deeefc;
  190. border-radius: 8rpx;
  191. font-size: 28rpx;
  192. font-family: PingFang SC, PingFang SC-Medium;
  193. font-weight: 500;
  194. text-align: left;
  195. color: #0084FF;
  196. line-height: 56rpx;
  197. text-align: center;
  198. }
  199. .box_type3{
  200. width: 140rpx;
  201. height: 56rpx;
  202. background: #eee;
  203. border-radius: 8rpx;
  204. font-size: 28rpx;
  205. font-family: PingFang SC, PingFang SC-Medium;
  206. font-weight: 500;
  207. text-align: left;
  208. color: #999;
  209. line-height: 56rpx;
  210. text-align: center;
  211. }
  212. .btnBox{
  213. width: 750rpx;
  214. height: 100rpx;
  215. background: #FFFFFF;
  216. border-radius: 0rpx 0rpx 0rpx 0rpx;
  217. opacity: 1;
  218. display: flex;
  219. flex-direction: row;
  220. justify-content: center;
  221. align-items: center;
  222. position: fixed;
  223. bottom: 0;
  224. }
  225. .btn{
  226. width: 702rpx;
  227. height: 80rpx;
  228. background: #46A6FF;
  229. border-radius: 64rpx 64rpx 64rpx 64rpx;
  230. opacity: 1;
  231. font-weight: 500;
  232. color: #FFFFFF;
  233. line-height: 80rpx;
  234. text-align: center;
  235. }
  236. .divider{
  237. width: 100%;
  238. border-top: 1rpx solid #eee;
  239. margin: 20rpx 0;
  240. }
  241. .PICbox{
  242. margin-left: 24rpx;
  243. display: flex;
  244. }
  245. </style>